Changeset 68828 in vbox
- Timestamp:
- Sep 22, 2017 2:15:57 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 118082
- Location:
- trunk
- Files:
-
- 14 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/ExtPack/ExtPack.h
r62476 r68828 4 4 5 5 /* 6 * Copyright (C) 2010-201 6Oracle Corporation6 * Copyright (C) 2010-2017 Oracle Corporation 7 7 * 8 8 * This file is part of VirtualBox Open Source Edition (OSE), as … … 48 48 typedef enum VBOXEXTPACKMODKIND 49 49 { 50 /** Zero is invalid as alwa sy. */50 /** Zero is invalid as always. */ 51 51 VBOXEXTPACKMODKIND_INVALID = 0, 52 52 /** Raw-mode context module. */ … … 67 67 typedef enum VBOXEXTPACKCTX 68 68 { 69 /** Zero is invalid as alwa sy. */69 /** Zero is invalid as always. */ 70 70 VBOXEXTPACKCTX_INVALID = 0, 71 71 /** The per-user daemon process (VBoxSVC). */ 72 72 VBOXEXTPACKCTX_PER_USER_DAEMON, 73 /** A VM process. 74 * @remarks This will also include the client processes in v4.0. */ 73 /** A VM process. */ 75 74 VBOXEXTPACKCTX_VM_PROCESS, 76 /** A API client process.77 * @remarks This will not be returned by VirtualBox 4.0. */75 /** An API client process. 76 * @remarks This will not be returned by VirtualBox yet. */ 78 77 VBOXEXTPACKCTX_CLIENT_PROCESS, 79 78 /** End of the valid values (exclusive). */ … … 210 209 * Callback table returned by VBoxExtPackRegister. 211 210 * 211 * All the callbacks are called the context of the per-user service (VBoxSVC). 212 * 212 213 * This must be valid until the extension pack main module is unloaded. 213 214 */ … … 223 224 * Hook for doing setups after the extension pack was installed. 224 225 * 225 * This is called in the context of the per-user service (VBoxSVC).226 *227 226 * @returns VBox status code. 228 227 * @retval VERR_EXTPACK_UNSUPPORTED_HOST_UNINSTALL if the extension pack … … 241 240 * Hook for cleaning up before the extension pack is uninstalled. 242 241 * 243 * This is called in the context of the per-user service (VBoxSVC).244 *245 242 * @returns VBox status code. 246 243 * @param pThis Pointer to this structure. … … 255 252 * Hook for doing work after the VirtualBox object is ready. 256 253 * 257 * This is called in the context of the per-user service (VBoxSVC). The258 * pfnConsoleReady method is the equivalent for the VM/client process.259 *260 254 * @param pThis Pointer to this structure. 261 255 * @param pVirtualBox The VirtualBox interface. … … 264 258 265 259 /** 266 * Hook for doing work after the Console object is ready.267 *268 * This is called in the context of the VM/client process. The269 * pfnVirtualBoxReady method is the equivalent for the per-user service270 * (VBoxSVC).271 *272 * @param pThis Pointer to this structure.273 * @param pConsole The Console interface.274 */275 DECLCALLBACKMEMBER(void, pfnConsoleReady)(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IConsole) *pConsole);276 277 /**278 260 * Hook for doing work before unloading. 279 *280 * This is called both in the context of the per-user service (VBoxSVC) and281 * in context of the VM process (VBoxC).282 261 * 283 262 * @param pThis Pointer to this structure. … … 292 271 * Hook for changing the default VM configuration upon creation. 293 272 * 294 * This is called in the context of the per-user service (VBoxSVC).295 *296 273 * @returns VBox status code. 297 274 * @param pThis Pointer to this structure. … … 303 280 304 281 /** 305 * Hook for configuring the VMM for a VM.306 *307 * This is called in the context of the VM process (VBoxC).308 *309 * @returns VBox status code.310 * @param pThis Pointer to this structure.311 * @param pConsole The console interface.312 * @param pVM The cross context VM structure.313 */314 DECLCALLBACKMEMBER(int, pfnVMConfigureVMM)(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IConsole) *pConsole, PVM pVM);315 316 /**317 * Hook for doing work right before powering on the VM.318 *319 * This is called in the context of the VM process (VBoxC).320 *321 * @returns VBox status code.322 * @param pThis Pointer to this structure.323 * @param pConsole The console interface.324 * @param pVM The cross context VM structure.325 */326 DECLCALLBACKMEMBER(int, pfnVMPowerOn)(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IConsole) *pConsole, PVM pVM);327 328 /**329 * Hook for doing work after powering on the VM.330 *331 * This is called in the context of the VM process (VBoxC).332 *333 * @param pThis Pointer to this structure.334 * @param pConsole The console interface.335 * @param pVM The cross context VM structure. Can be NULL.336 */337 DECLCALLBACKMEMBER(void, pfnVMPowerOff)(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IConsole) *pConsole, PVM pVM);338 339 /**340 282 * Query the IUnknown interface to an object in the main module. 341 283 * 342 * This is can be called in any context.343 *344 284 * @returns IUnknown pointer (referenced) on success, NULL on failure. 345 285 * @param pThis Pointer to this structure. … … 348 288 DECLCALLBACKMEMBER(void *, pfnQueryObject)(PCVBOXEXTPACKREG pThis, PCRTUUID pObjectId); 349 289 350 DECLR3CALLBACKMEMBER(int, pfnReserved1,(PCVBOXEXTPACK HLP pHlp)); /**< Reserved for minor structure revisions. */351 DECLR3CALLBACKMEMBER(int, pfnReserved2,(PCVBOXEXTPACK HLP pHlp)); /**< Reserved for minor structure revisions. */352 DECLR3CALLBACKMEMBER(int, pfnReserved3,(PCVBOXEXTPACK HLP pHlp)); /**< Reserved for minor structure revisions. */353 DECLR3CALLBACKMEMBER(int, pfnReserved4,(PCVBOXEXTPACK HLP pHlp)); /**< Reserved for minor structure revisions. */354 DECLR3CALLBACKMEMBER(int, pfnReserved5,(PCVBOXEXTPACK HLP pHlp)); /**< Reserved for minor structure revisions. */355 DECLR3CALLBACKMEMBER(int, pfnReserved6,(PCVBOXEXTPACK HLP pHlp)); /**< Reserved for minor structure revisions. */290 DECLR3CALLBACKMEMBER(int, pfnReserved1,(PCVBOXEXTPACKREG pThis)); /**< Reserved for minor structure revisions. */ 291 DECLR3CALLBACKMEMBER(int, pfnReserved2,(PCVBOXEXTPACKREG pThis)); /**< Reserved for minor structure revisions. */ 292 DECLR3CALLBACKMEMBER(int, pfnReserved3,(PCVBOXEXTPACKREG pThis)); /**< Reserved for minor structure revisions. */ 293 DECLR3CALLBACKMEMBER(int, pfnReserved4,(PCVBOXEXTPACKREG pThis)); /**< Reserved for minor structure revisions. */ 294 DECLR3CALLBACKMEMBER(int, pfnReserved5,(PCVBOXEXTPACKREG pThis)); /**< Reserved for minor structure revisions. */ 295 DECLR3CALLBACKMEMBER(int, pfnReserved6,(PCVBOXEXTPACKREG pThis)); /**< Reserved for minor structure revisions. */ 356 296 357 297 /** Reserved for minor structure revisions. */ … … 362 302 } VBOXEXTPACKREG; 363 303 /** Current version of the VBOXEXTPACKREG structure. */ 364 #define VBOXEXTPACKREG_VERSION RT_MAKE_U32( 1, 1)304 #define VBOXEXTPACKREG_VERSION RT_MAKE_U32(2, 0) 365 305 366 306 … … 368 308 * The VBoxExtPackRegister callback function. 369 309 * 370 * PDM will invoke this function after loading a driver module and letting 371 * the module decide which drivers to register and how to handle conflicts. 310 * The Main API (as in VBoxSVC) will invoke this function after loading an 311 * extension pack Main module. Its job is to do version compatibility checking 312 * and returning the extension pack registration structure. 372 313 * 373 314 * @returns VBox status code. … … 388 329 389 330 331 /** Pointer to the extension pack VM callback table. */ 332 typedef struct VBOXEXTPACKVMREG const *PCVBOXEXTPACKVMREG; 333 /** 334 * Callback table returned by VBoxExtPackVMRegister. 335 * 336 * All the callbacks are called the context of a VM process. 337 * 338 * This must be valid until the extension pack main VM module is unloaded. 339 */ 340 typedef struct VBOXEXTPACKVMREG 341 { 342 /** Interface version. 343 * This is set to VBOXEXTPACKVMREG_VERSION. */ 344 uint32_t u32Version; 345 /** The VirtualBox version this extension pack was built against. */ 346 uint32_t uVBoxVersion; 347 348 /** 349 * Hook for doing work after the Console object is ready. 350 * 351 * @param pThis Pointer to this structure. 352 * @param pConsole The Console interface. 353 */ 354 DECLCALLBACKMEMBER(void, pfnConsoleReady)(PCVBOXEXTPACKVMREG pThis, VBOXEXTPACK_IF_CS(IConsole) *pConsole); 355 356 /** 357 * Hook for doing work before unloading. 358 * 359 * @param pThis Pointer to this structure. 360 * 361 * @remarks The helpers are not available at this point in time. 362 */ 363 DECLCALLBACKMEMBER(void, pfnUnload)(PCVBOXEXTPACKVMREG pThis); 364 365 /** 366 * Hook for configuring the VMM for a VM. 367 * 368 * @returns VBox status code. 369 * @param pThis Pointer to this structure. 370 * @param pConsole The console interface. 371 * @param pVM The cross context VM structure. 372 */ 373 DECLCALLBACKMEMBER(int, pfnVMConfigureVMM)(PCVBOXEXTPACKVMREG pThis, VBOXEXTPACK_IF_CS(IConsole) *pConsole, PVM pVM); 374 375 /** 376 * Hook for doing work right before powering on the VM. 377 * 378 * @returns VBox status code. 379 * @param pThis Pointer to this structure. 380 * @param pConsole The console interface. 381 * @param pVM The cross context VM structure. 382 */ 383 DECLCALLBACKMEMBER(int, pfnVMPowerOn)(PCVBOXEXTPACKVMREG pThis, VBOXEXTPACK_IF_CS(IConsole) *pConsole, PVM pVM); 384 385 /** 386 * Hook for doing work after powering off the VM. 387 * 388 * @param pThis Pointer to this structure. 389 * @param pConsole The console interface. 390 * @param pVM The cross context VM structure. Can be NULL. 391 */ 392 DECLCALLBACKMEMBER(void, pfnVMPowerOff)(PCVBOXEXTPACKVMREG pThis, VBOXEXTPACK_IF_CS(IConsole) *pConsole, PVM pVM); 393 394 /** 395 * Query the IUnknown interface to an object in the main VM module. 396 * 397 * @returns IUnknown pointer (referenced) on success, NULL on failure. 398 * @param pThis Pointer to this structure. 399 * @param pObjectId Pointer to the object ID (UUID). 400 */ 401 DECLCALLBACKMEMBER(void *, pfnQueryObject)(PCVBOXEXTPACKVMREG pThis, PCRTUUID pObjectId); 402 403 DECLR3CALLBACKMEMBER(int, pfnReserved1,(PCVBOXEXTPACKVMREG pThis)); /**< Reserved for minor structure revisions. */ 404 DECLR3CALLBACKMEMBER(int, pfnReserved2,(PCVBOXEXTPACKVMREG pThis)); /**< Reserved for minor structure revisions. */ 405 DECLR3CALLBACKMEMBER(int, pfnReserved3,(PCVBOXEXTPACKVMREG pThis)); /**< Reserved for minor structure revisions. */ 406 DECLR3CALLBACKMEMBER(int, pfnReserved4,(PCVBOXEXTPACKVMREG pThis)); /**< Reserved for minor structure revisions. */ 407 DECLR3CALLBACKMEMBER(int, pfnReserved5,(PCVBOXEXTPACKVMREG pThis)); /**< Reserved for minor structure revisions. */ 408 DECLR3CALLBACKMEMBER(int, pfnReserved6,(PCVBOXEXTPACKVMREG pThis)); /**< Reserved for minor structure revisions. */ 409 410 /** Reserved for minor structure revisions. */ 411 uint32_t uReserved7; 412 413 /** End of structure marker (VBOXEXTPACKVMREG_VERSION). */ 414 uint32_t u32EndMarker; 415 } VBOXEXTPACKVMREG; 416 /** Current version of the VBOXEXTPACKVMREG structure. */ 417 #define VBOXEXTPACKVMREG_VERSION RT_MAKE_U32(2, 0) 418 419 420 /** 421 * The VBoxExtPackVMRegister callback function. 422 * 423 * The Main API (in a VM process) will invoke this function after loading an 424 * extension pack VM module. Its job is to do version compatibility checking 425 * and returning the extension pack registration structure for a VM. 426 * 427 * @returns VBox status code. 428 * @param pHlp Pointer to the extension pack helper function 429 * table. This is valid until the module is unloaded. 430 * @param ppReg Where to return the pointer to the registration 431 * structure containing all the hooks. This structure 432 * be valid and unchanged until the module is unloaded 433 * (i.e. use some static const data for it). 434 * @param pErrInfo Where to return extended error information. 435 */ 436 typedef DECLCALLBACK(int) FNVBOXEXTPACKVMREGISTER(PCVBOXEXTPACKHLP pHlp, PCVBOXEXTPACKVMREG *ppReg, PRTERRINFO pErrInfo); 437 /** Pointer to a FNVBOXEXTPACKVMREGISTER. */ 438 typedef FNVBOXEXTPACKVMREGISTER *PFNVBOXEXTPACKVMREGISTER; 439 440 /** The name of the main VM module entry point. */ 441 #define VBOX_EXTPACK_MAIN_VM_MOD_ENTRY_POINT "VBoxExtPackVMRegister" 442 443 390 444 /** 391 445 * Checks if extension pack interface version is compatible. -
trunk/src/VBox/ExtPacks/BusMouseSample/ExtPack.xml
r44446 r68828 5 5 <Version revision="@VBOX_SVN_REV@">@VBOX_VERSION_STRING@</Version> 6 6 <MainModule>VBoxBusMouseMain</MainModule> 7 <MainVMModule>VBoxBusMouseMainVM</MainVMModule> 7 8 <ShowLicense/> 8 9 </VirtualBoxExtensionPack> -
trunk/src/VBox/ExtPacks/BusMouseSample/Makefile.kmk
r62496 r68828 5 5 6 6 # 7 # Copyright (C) 2010-201 6Oracle Corporation7 # Copyright (C) 2010-2017 Oracle Corporation 8 8 # 9 9 # Permission is hereby granted, free of charge, to any person … … 69 69 70 70 # 71 # VBoxBusMouseMainVM - The module in a VM which the VirtualBox Main API talks to. 72 # 73 DLLS += VBoxBusMouseMainVM 74 VBoxBusMouseMainVM_TEMPLATE = VBoxR3ExtPackBusMouse 75 VBoxBusMouseMainVM_SOURCES = VBoxBusMouseMainVM.cpp 76 VBoxBusMouseMainVM_DEFS = 77 78 79 # 71 80 # The device code. 72 81 # … … 112 121 VBOX_BUSMOUSE_FILES_MACRO = \ 113 122 $(PATH_OUT_BASE)/$(1)/$(KBUILD_TYPE)/$(2)/ExtensionPacks/$(VBOX_BUSMOUSE_MANGLED_NAME)/$(1)/VBoxBusMouseMain.$(3)=>$(1)/VBoxBusMouseMain.$(3) \ 123 $(PATH_OUT_BASE)/$(1)/$(KBUILD_TYPE)/$(2)/ExtensionPacks/$(VBOX_BUSMOUSE_MANGLED_NAME)/$(1)/VBoxBusMouseMainVM.$(3)=>$(1)/VBoxBusMouseMainVM.$(3) \ 114 124 $(PATH_OUT_BASE)/$(1)/$(KBUILD_TYPE)/$(2)/ExtensionPacks/$(VBOX_BUSMOUSE_MANGLED_NAME)/$(1)/VBoxBusMouseR3.$(3)=>$(1)/VBoxBusMouseR3.$(3) \ 115 125 $(PATH_OUT_BASE)/$(1)/$(KBUILD_TYPE)/$(2)/ExtensionPacks/$(VBOX_BUSMOUSE_MANGLED_NAME)/$(1)/VBoxBusMouseR0.r0=>$(1)/VBoxBusMouseR0.r0 -
trunk/src/VBox/ExtPacks/BusMouseSample/VBoxBusMouseMain.cpp
r63419 r68828 5 5 6 6 /* 7 * Copyright (C) 2010-201 6Oracle Corporation7 * Copyright (C) 2010-2017 Oracle Corporation 8 8 * 9 9 * Permission is hereby granted, free of charge, to any person … … 37 37 #include <VBox/err.h> 38 38 #include <VBox/version.h> 39 #include <VBox/vmm/cfgm.h>40 39 #include <iprt/string.h> 41 40 #include <iprt/param.h> … … 53 52 // * @interface_method_impl{VBOXEXTPACKREG,pfnInstalled} 54 53 // */ 55 // static DECLCALLBACK(void) vboxSkeletonExtPack_Installed(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox); 54 // static DECLCALLBACK(void) vboxBusMouseExtPack_Installed(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox, PRTERRINFO pErrInfo); 55 // 56 56 // /** 57 57 // * @interface_method_impl{VBOXEXTPACKREG,pfnUninstall} 58 58 // */ 59 // static DECLCALLBACK(int) vbox SkeletonExtPack_Uninstall(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox);59 // static DECLCALLBACK(int) vboxBusMouseExtPack_Uninstall(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox); 60 60 // 61 61 // /** 62 62 // * @interface_method_impl{VBOXEXTPACKREG,pfnVirtualBoxReady} 63 63 // */ 64 // static DECLCALLBACK(void) vbox SkeletonExtPack_VirtualBoxReady(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox);64 // static DECLCALLBACK(void) vboxBusMouseExtPack_VirtualBoxReady(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox); 65 65 // 66 66 // /** 67 67 // * @interface_method_impl{VBOXEXTPACKREG,pfnUnload} 68 68 // */ 69 // static DECLCALLBACK(void) vboxSkeletonExtPack_Unload(PCVBOXEXTPACKREG pThis); 69 // static DECLCALLBACK(void) vboxBusMouseExtPack_Unload(PCVBOXEXTPACKREG pThis); 70 // 70 71 // /** 71 72 // * @interface_method_impl{VBOXEXTPACKREG,pfnVMCreated} 72 73 // */ 73 // static DECLCALLBACK(int) vbox SkeletonExtPack_VMCreated(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox, IMachine*pMachine);74 // static DECLCALLBACK(int) vboxBusMouseExtPack_VMCreated(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox, VBOXEXTPACK_IF_CS(IMachine) *pMachine); 74 75 // 75 76 /**77 * @interface_method_impl{VBOXEXTPACKREG,pfnVMConfigureVMM78 */79 static DECLCALLBACK(int) vboxBusMouseExtPack_VMConfigureVMM(PCVBOXEXTPACKREG pThis, IConsole *pConsole, PVM pVM)80 {81 RT_NOREF(pThis, pConsole);82 83 /*84 * Find the bus mouse module and tell PDM to load it.85 * ASSUME /PDM/Devices exists.86 */87 char szPath[RTPATH_MAX];88 int rc = g_pHlp->pfnFindModule(g_pHlp, "VBoxBusMouseR3", NULL, VBOXEXTPACKMODKIND_R3, szPath, sizeof(szPath), NULL);89 if (RT_FAILURE(rc))90 return rc;91 92 PCFGMNODE pCfgRoot = CFGMR3GetRoot(pVM);93 AssertReturn(pCfgRoot, VERR_INTERNAL_ERROR_3);94 95 PCFGMNODE pCfgDevices = CFGMR3GetChild(pCfgRoot, "PDM/Devices");96 AssertReturn(pCfgDevices, VERR_INTERNAL_ERROR_3);97 98 PCFGMNODE pCfgMine;99 rc = CFGMR3InsertNode(pCfgDevices, "VBoxBusMouse", &pCfgMine);100 AssertRCReturn(rc, rc);101 rc = CFGMR3InsertString(pCfgMine, "Path", szPath);102 AssertRCReturn(rc, rc);103 104 /*105 * Tell PDM where to find the R0 and RC modules for the bus mouse device.106 */107 #ifdef VBOX_WITH_RAW_MODE108 rc = g_pHlp->pfnFindModule(g_pHlp, "VBoxBusMouseRC", NULL, VBOXEXTPACKMODKIND_RC, szPath, sizeof(szPath), NULL);109 AssertRCReturn(rc, rc);110 RTPathStripFilename(szPath);111 rc = CFGMR3InsertString(pCfgMine, "RCSearchPath", szPath);112 AssertRCReturn(rc, rc);113 #endif114 115 rc = g_pHlp->pfnFindModule(g_pHlp, "VBoxBusMouseR0", NULL, VBOXEXTPACKMODKIND_R0, szPath, sizeof(szPath), NULL);116 AssertRCReturn(rc, rc);117 RTPathStripFilename(szPath);118 rc = CFGMR3InsertString(pCfgMine, "R0SearchPath", szPath);119 AssertRCReturn(rc, rc);120 121 return VINF_SUCCESS;122 }123 124 76 // /** 125 // * @interface_method_impl{VBOXEXTPACKREG,pfn VMPowerOn}77 // * @interface_method_impl{VBOXEXTPACKREG,pfnQueryObject} 126 78 // */ 127 // static DECLCALLBACK(int) vboxSkeletonExtPack_VMPowerOn(PCVBOXEXTPACKREG pThis, IConsole *pConsole, PVM pVM); 128 // /** 129 // * @interface_method_impl{VBOXEXTPACKREG,pfnVMPowerOff} 130 // */ 131 // static DECLCALLBACK(void) vboxSkeletonExtPack_VMPowerOff(PCVBOXEXTPACKREG pThis, IConsole *pConsole, PVM pVM); 132 // /** 133 // * @interface_method_impl{VBOXEXTPACKREG,pfnVMPowerOff} 134 // */ 135 // static DECLCALLBACK(void) vboxSkeletonExtPack_QueryObject(PCVBOXEXTPACKREG pThis, PCRTUUID pObjectId); 79 // static DECLCALLBACK(void) vboxBusMouseExtPack_QueryObject(PCVBOXEXTPACKREG pThis, PCRTUUID pObjectId); 136 80 137 81 … … 143 87 /* .pfnUninstall = */ NULL, 144 88 /* .pfnVirtualBoxReady =*/ NULL, 145 /* .pfnConsoleReady = */ NULL,146 89 /* .pfnUnload = */ NULL, 147 90 /* .pfnVMCreated = */ NULL, 148 /* .pfnVMConfigureVMM = */ vboxBusMouseExtPack_VMConfigureVMM,149 /* .pfnVMPowerOn = */ NULL,150 /* .pfnVMPowerOff = */ NULL,151 91 /* .pfnQueryObject = */ NULL, 152 92 /* .pfnReserved1 = */ NULL, -
trunk/src/VBox/ExtPacks/BusMouseSample/VBoxBusMouseMainVM.cpp
r68805 r68828 1 1 /* $Id$ */ 2 2 /** @file 3 * Bus Mouse main module.3 * Bus Mouse main VM module. 4 4 */ 5 5 6 6 /* 7 * Copyright (C) 2010-201 6Oracle Corporation7 * Copyright (C) 2010-2017 Oracle Corporation 8 8 * 9 9 * Permission is hereby granted, free of charge, to any person … … 51 51 52 52 // /** 53 // * @interface_method_impl{VBOXEXTPACK REG,pfnInstalled}53 // * @interface_method_impl{VBOXEXTPACKVMREG,pfnConsoleReady} 54 54 // */ 55 // static DECLCALLBACK(void) vboxSkeletonExtPack_Installed(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox); 56 // /** 57 // * @interface_method_impl{VBOXEXTPACKREG,pfnUninstall} 58 // */ 59 // static DECLCALLBACK(int) vboxSkeletonExtPack_Uninstall(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox); 55 // static DECLCALLBACK(void) vboxBusMouseExtPackVM_ConsoleReady(PCVBOXEXTPACKVMREG pThis, VBOXEXTPACK_IF_CS(IConsole) *pConsole); 60 56 // 61 57 // /** 62 // * @interface_method_impl{VBOXEXTPACK REG,pfnVirtualBoxReady}58 // * @interface_method_impl{VBOXEXTPACKVMREG,pfnUnload} 63 59 // */ 64 // static DECLCALLBACK(void) vboxSkeletonExtPack_VirtualBoxReady(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox); 65 // 66 // /** 67 // * @interface_method_impl{VBOXEXTPACKREG,pfnUnload} 68 // */ 69 // static DECLCALLBACK(void) vboxSkeletonExtPack_Unload(PCVBOXEXTPACKREG pThis); 70 // /** 71 // * @interface_method_impl{VBOXEXTPACKREG,pfnVMCreated} 72 // */ 73 // static DECLCALLBACK(int) vboxSkeletonExtPack_VMCreated(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox, IMachine *pMachine); 74 // 60 // static DECLCALLBACK(void) vboxBusMouseExtPackVM_Unload(PCVBOXEXTPACKVMREG pThis); 75 61 76 62 /** 77 * @interface_method_impl{VBOXEXTPACK REG,pfnVMConfigureVMM63 * @interface_method_impl{VBOXEXTPACKVMREG,pfnVMConfigureVMM 78 64 */ 79 static DECLCALLBACK(int) vboxBusMouseExtPack _VMConfigureVMM(PCVBOXEXTPACKREG pThis, IConsole*pConsole, PVM pVM)65 static DECLCALLBACK(int) vboxBusMouseExtPackVM_VMConfigureVMM(PCVBOXEXTPACKVMREG pThis, VBOXEXTPACK_IF_CS(IConsole) *pConsole, PVM pVM) 80 66 { 81 67 RT_NOREF(pThis, pConsole); … … 123 109 124 110 // /** 125 // * @interface_method_impl{VBOXEXTPACK REG,pfnVMPowerOn}111 // * @interface_method_impl{VBOXEXTPACKVMREG,pfnVMPowerOn} 126 112 // */ 127 // static DECLCALLBACK(int) vboxSkeletonExtPack_VMPowerOn(PCVBOXEXTPACKREG pThis, IConsole *pConsole, PVM pVM); 113 // static DECLCALLBACK(int) vboxBusMouseExtPackVM_VMPowerOn(PCVBOXEXTPACKVMREG pThis, VBOXEXTPACK_IF_CS(IConsole) *pConsole, PVM pVM); 114 // 128 115 // /** 129 // * @interface_method_impl{VBOXEXTPACK REG,pfnVMPowerOff}116 // * @interface_method_impl{VBOXEXTPACKVMREG,pfnVMPowerOff} 130 117 // */ 131 // static DECLCALLBACK(void) vboxSkeletonExtPack_VMPowerOff(PCVBOXEXTPACKREG pThis, IConsole *pConsole, PVM pVM); 118 // static DECLCALLBACK(void) vboxBusMouseExtPackVM_VMPowerOff(PCVBOXEXTPACKVMREG pThis, VBOXEXTPACK_IF_CS(IConsole) *pConsole, PVM pVM); 119 // 132 120 // /** 133 // * @interface_method_impl{VBOXEXTPACK REG,pfnVMPowerOff}121 // * @interface_method_impl{VBOXEXTPACKVMREG,pfnQueryObject} 134 122 // */ 135 // static DECLCALLBACK(void) vbox SkeletonExtPack_QueryObject(PCVBOXEXTPACKREG pThis, PCRTUUID pObjectId);123 // static DECLCALLBACK(void) vboxBusMouseExtPackVM_QueryObject(PCVBOXEXTPACKVMREG pThis, PCRTUUID pObjectId); 136 124 137 125 138 static const VBOXEXTPACK REG g_vboxBusMouseExtPackReg =126 static const VBOXEXTPACKVMREG g_vboxBusMouseExtPackVMReg = 139 127 { 140 VBOXEXTPACK REG_VERSION,128 VBOXEXTPACKVMREG_VERSION, 141 129 /* .uVBoxFullVersion = */ VBOX_FULL_VERSION, 142 /* .pfnInstalled = */ NULL,143 /* .pfnUninstall = */ NULL,144 /* .pfnVirtualBoxReady =*/ NULL,145 130 /* .pfnConsoleReady = */ NULL, 146 131 /* .pfnUnload = */ NULL, 147 /* .pfnVMCreated = */ NULL, 148 /* .pfnVMConfigureVMM = */ vboxBusMouseExtPack_VMConfigureVMM, 132 /* .pfnVMConfigureVMM = */ vboxBusMouseExtPackVM_VMConfigureVMM, 149 133 /* .pfnVMPowerOn = */ NULL, 150 134 /* .pfnVMPowerOff = */ NULL, … … 157 141 /* .pfnReserved6 = */ NULL, 158 142 /* .u32Reserved7 = */ 0, 159 VBOXEXTPACK REG_VERSION143 VBOXEXTPACKVMREG_VERSION 160 144 }; 161 145 162 146 163 /** @callback_method_impl{FNVBOXEXTPACK REGISTER} */164 extern "C" DECLEXPORT(int) VBoxExtPack Register(PCVBOXEXTPACKHLP pHlp, PCVBOXEXTPACKREG *ppReg, PRTERRINFO pErrInfo)147 /** @callback_method_impl{FNVBOXEXTPACKVMREGISTER} */ 148 extern "C" DECLEXPORT(int) VBoxExtPackVMRegister(PCVBOXEXTPACKHLP pHlp, PCVBOXEXTPACKVMREG *ppReg, PRTERRINFO pErrInfo) 165 149 { 166 150 /* … … 183 167 */ 184 168 g_pHlp = pHlp; 185 *ppReg = &g_vboxBusMouseExtPack Reg;169 *ppReg = &g_vboxBusMouseExtPackVMReg; 186 170 187 171 return VINF_SUCCESS; -
trunk/src/VBox/ExtPacks/Skeleton/ExtPack.xml
r35963 r68828 5 5 <Version revision="@VBOX_SVN_REV@">@VBOX_VERSION_STRING@</Version> 6 6 <MainModule>VBoxSkeletonMain</MainModule> 7 <MainVMModule>VBoxSkeletonMainVM</MainVMModule> 7 8 <!-- VRDEModule>VBoxVNC</VRDEModule --> 8 9 <ShowLicense/> -
trunk/src/VBox/ExtPacks/Skeleton/Makefile.kmk
r62496 r68828 5 5 6 6 # 7 # Copyright (C) 2010-201 6Oracle Corporation7 # Copyright (C) 2010-2017 Oracle Corporation 8 8 # 9 9 # Permission is hereby granted, free of charge, to any person … … 68 68 69 69 # 70 # VBoxSkeletonMainVM - The module in a VM which the VirtualBox Main API talks to. 71 # 72 DLLS += VBoxSkeletonMainVM 73 VBoxSkeletonMainVM_TEMPLATE = VBoxR3ExtPackSkeleton 74 VBoxSkeletonMainVM_SOURCES = VBoxSkeletonMainVM.cpp 75 VBoxSkeletonMainVM_DEFS = 76 77 # 70 78 # Install the description. 71 79 # … … 92 100 # Build the file list. The macro takes 1=darwin.x86, 2=dist/VirtualBox.app/Contents/MacOS, 3=dylib 93 101 VBOX_SKELETON_FILES_MACRO = \ 94 $(PATH_OUT_BASE)/$(1)/$(KBUILD_TYPE)/$(2)/ExtensionPacks/$(VBOX_SKELETON_MANGLED_NAME)/$(1)/VBoxSkeletonMain.$(3)=>$(1)/VBoxSkeletonMain.$(3) 102 $(PATH_OUT_BASE)/$(1)/$(KBUILD_TYPE)/$(2)/ExtensionPacks/$(VBOX_SKELETON_MANGLED_NAME)/$(1)/VBoxSkeletonMain.$(3)=>$(1)/VBoxSkeletonMain.$(3) \ 103 $(PATH_OUT_BASE)/$(1)/$(KBUILD_TYPE)/$(2)/ExtensionPacks/$(VBOX_SKELETON_MANGLED_NAME)/$(1)/VBoxSkeletonMainVM.$(3)=>$(1)/VBoxSkeletonMainVM.$(3) 95 104 96 105 VBOX_SKELETON_FILES := \ -
trunk/src/VBox/ExtPacks/Skeleton/VBoxSkeletonMain.cpp
r62496 r68828 5 5 6 6 /* 7 * Copyright (C) 2010-201 6Oracle Corporation7 * Copyright (C) 2010-2017 Oracle Corporation 8 8 * 9 9 * Permission is hereby granted, free of charge, to any person … … 37 37 #include <VBox/err.h> 38 38 #include <VBox/version.h> 39 #include <VBox/vmm/cfgm.h>40 39 #include <iprt/string.h> 41 40 #include <iprt/param.h> … … 53 52 // * @interface_method_impl{VBOXEXTPACKREG,pfnInstalled} 54 53 // */ 55 // static DECLCALLBACK(void) vboxSkeletonExtPack_Installed(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox); 54 // static DECLCALLBACK(void) vboxSkeletonExtPack_Installed(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox, PRTERRINFO pErrInfo); 55 // 56 56 // /** 57 57 // * @interface_method_impl{VBOXEXTPACKREG,pfnUninstall} … … 68 68 // */ 69 69 // static DECLCALLBACK(void) vboxSkeletonExtPack_Unload(PCVBOXEXTPACKREG pThis); 70 // 70 71 // /** 71 72 // * @interface_method_impl{VBOXEXTPACKREG,pfnVMCreated} 72 73 // */ 73 // static DECLCALLBACK(int) vboxSkeletonExtPack_VMCreated(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox, IMachine*pMachine);74 // static DECLCALLBACK(int) vboxSkeletonExtPack_VMCreated(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox, VBOXEXTPACK_IF_CS(IMachine) *pMachine); 74 75 // 75 76 // /** 76 // * @interface_method_impl{VBOXEXTPACKREG,pfn VMConfigureVMM}77 // * @interface_method_impl{VBOXEXTPACKREG,pfnQueryObject} 77 78 // */ 78 // static DECLCALLBACK(int) vboxSkeletonExtPack_VMConfigureVMM(PCVBOXEXTPACKREG pThis, IConsole *pConsole, PVM pVM); 79 // 80 // /** 81 // * @interface_method_impl{VBOXEXTPACKREG,pfnVMPowerOn} 82 // */ 83 // static DECLCALLBACK(int) vboxSkeletonExtPack_VMPowerOn(PCVBOXEXTPACKREG pThis, IConsole *pConsole, PVM pVM); 84 // /** 85 // * @interface_method_impl{VBOXEXTPACKREG,pfnVMPowerOff} 86 // */ 87 // static DECLCALLBACK(void) vboxSkeletonExtPack_VMPowerOff(PCVBOXEXTPACKREG pThis, IConsole *pConsole, PVM pVM); 88 // /** 89 // * @interface_method_impl{VBOXEXTPACKREG,pfnVMPowerOff} 90 // */ 91 // static DECLCALLBACK(void) vboxSkeletonExtPack_QueryObject(PCVBOXEXTPACKREG pThis, PCRTUUID pObjectId); 79 // static DECLCALLBACK(int) vboxSkeletonExtPack_QueryObject(PCVBOXEXTPACKREG pThis, PCRTUUID pObjectId); 92 80 93 81 … … 99 87 /* .pfnUninstall = */ NULL, 100 88 /* .pfnVirtualBoxReady =*/ NULL, 101 /* .pfnConsoleReady = */ NULL,102 89 /* .pfnUnload = */ NULL, 103 90 /* .pfnVMCreated = */ NULL, 104 /* .pfnVMConfigureVMM = */ NULL,105 /* .pfnVMPowerOn = */ NULL,106 /* .pfnVMPowerOff = */ NULL,107 91 /* .pfnQueryObject = */ NULL, 108 92 /* .pfnReserved1 = */ NULL, -
trunk/src/VBox/ExtPacks/Skeleton/VBoxSkeletonMainVM.cpp
r68805 r68828 1 1 /* $Id$ */ 2 2 /** @file 3 * Skeleton main module.3 * Skeleton main VM module. 4 4 */ 5 5 6 6 /* 7 * Copyright (C) 2010-201 6Oracle Corporation7 * Copyright (C) 2010-2017 Oracle Corporation 8 8 * 9 9 * Permission is hereby granted, free of charge, to any person … … 51 51 52 52 // /** 53 // * @interface_method_impl{VBOXEXTPACK REG,pfnInstalled}53 // * @interface_method_impl{VBOXEXTPACKVMREG,pfnConsoleReady} 54 54 // */ 55 // static DECLCALLBACK(void) vboxSkeletonExtPack_Installed(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox); 56 // /** 57 // * @interface_method_impl{VBOXEXTPACKREG,pfnUninstall} 58 // */ 59 // static DECLCALLBACK(int) vboxSkeletonExtPack_Uninstall(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox); 55 // static DECLCALLBACK(void) vboxSkeletonExtPackVM_ConsoleReady(PCVBOXEXTPACKVMREG pThis, VBOXEXTPACK_IF_CS(IConsole) *pConsole); 60 56 // 61 57 // /** 62 // * @interface_method_impl{VBOXEXTPACK REG,pfnVirtualBoxReady}58 // * @interface_method_impl{VBOXEXTPACKVMREG,pfnUnload} 63 59 // */ 64 // static DECLCALLBACK(void) vboxSkeletonExtPack_VirtualBoxReady(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox); 60 // static DECLCALLBACK(void) vboxSkeletonExtPackVM_Unload(PCVBOXEXTPACKVMREG pThis); 61 // 62 // * @interface_method_impl{VBOXEXTPACKVMREG,pfnVMConfigureVMM} 63 // */ 64 // static DECLCALLBACK(int) vboxSkeletonExtPackVM_VMConfigureVMM(PCVBOXEXTPACKVMREG pThis, VBOXEXTPACK_IF_CS(IConsole) *pConsole, PVM pVM); 65 65 // 66 66 // /** 67 // * @interface_method_impl{VBOXEXTPACK REG,pfnUnload}67 // * @interface_method_impl{VBOXEXTPACKVMREG,pfnVMPowerOn} 68 68 // */ 69 // static DECLCALLBACK(void) vboxSkeletonExtPack_Unload(PCVBOXEXTPACKREG pThis); 70 // /** 71 // * @interface_method_impl{VBOXEXTPACKREG,pfnVMCreated} 72 // */ 73 // static DECLCALLBACK(int) vboxSkeletonExtPack_VMCreated(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox, IMachine *pMachine); 69 // static DECLCALLBACK(int) vboxSkeletonExtPackVM_VMPowerOn(PCVBOXEXTPACKVMREG pThis, VBOXEXTPACK_IF_CS(IConsole) *pConsole, PVM pVM); 74 70 // 75 71 // /** 76 // * @interface_method_impl{VBOXEXTPACK REG,pfnVMConfigureVMM}72 // * @interface_method_impl{VBOXEXTPACKVMREG,pfnVMPowerOff} 77 73 // */ 78 // static DECLCALLBACK( int) vboxSkeletonExtPack_VMConfigureVMM(PCVBOXEXTPACKREG pThis, IConsole*pConsole, PVM pVM);74 // static DECLCALLBACK(void) vboxSkeletonExtPackVM_VMPowerOff(PCVBOXEXTPACKVMREG pThis, VBOXEXTPACK_IF_CS(IConsole) *pConsole, PVM pVM); 79 75 // 80 76 // /** 81 // * @interface_method_impl{VBOXEXTPACK REG,pfnVMPowerOn}77 // * @interface_method_impl{VBOXEXTPACKVMREG,pfnQueryObject} 82 78 // */ 83 // static DECLCALLBACK(int) vboxSkeletonExtPack_VMPowerOn(PCVBOXEXTPACKREG pThis, IConsole *pConsole, PVM pVM); 84 // /** 85 // * @interface_method_impl{VBOXEXTPACKREG,pfnVMPowerOff} 86 // */ 87 // static DECLCALLBACK(void) vboxSkeletonExtPack_VMPowerOff(PCVBOXEXTPACKREG pThis, IConsole *pConsole, PVM pVM); 88 // /** 89 // * @interface_method_impl{VBOXEXTPACKREG,pfnVMPowerOff} 90 // */ 91 // static DECLCALLBACK(void) vboxSkeletonExtPack_QueryObject(PCVBOXEXTPACKREG pThis, PCRTUUID pObjectId); 79 // static DECLCALLBACK(void) vboxSkeletonExtPackVM_QueryObject(PCVBOXEXTPACKVMREG pThis, PCRTUUID pObjectId); 92 80 93 81 94 static const VBOXEXTPACK REG g_vboxSkeletonExtPackReg =82 static const VBOXEXTPACKVMREG g_vboxSkeletonExtPackVMReg = 95 83 { 96 VBOXEXTPACK REG_VERSION,84 VBOXEXTPACKVMREG_VERSION, 97 85 /* .uVBoxFullVersion = */ VBOX_FULL_VERSION, 98 /* .pfnInstalled = */ NULL,99 /* .pfnUninstall = */ NULL,100 /* .pfnVirtualBoxReady =*/ NULL,101 86 /* .pfnConsoleReady = */ NULL, 102 87 /* .pfnUnload = */ NULL, 103 /* .pfnVMCreated = */ NULL,104 88 /* .pfnVMConfigureVMM = */ NULL, 105 89 /* .pfnVMPowerOn = */ NULL, … … 113 97 /* .pfnReserved6 = */ NULL, 114 98 /* .u32Reserved7 = */ 0, 115 VBOXEXTPACK REG_VERSION99 VBOXEXTPACKVMREG_VERSION 116 100 }; 117 101 118 102 119 /** @callback_method_impl{FNVBOXEXTPACK REGISTER} */120 extern "C" DECLEXPORT(int) VBoxExtPack Register(PCVBOXEXTPACKHLP pHlp, PCVBOXEXTPACKREG *ppReg, PRTERRINFO pErrInfo)103 /** @callback_method_impl{FNVBOXEXTPACKVMREGISTER} */ 104 extern "C" DECLEXPORT(int) VBoxExtPackVMRegister(PCVBOXEXTPACKHLP pHlp, PCVBOXEXTPACKVMREG *ppReg, PRTERRINFO pErrInfo) 121 105 { 122 106 /* … … 139 123 */ 140 124 g_pHlp = pHlp; 141 *ppReg = &g_vboxSkeletonExtPack Reg;125 *ppReg = &g_vboxSkeletonExtPackVMReg; 142 126 143 127 return VINF_SUCCESS; -
trunk/src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceMain.cpp
r62496 r68828 5 5 6 6 /* 7 * Copyright (C) 2010-201 6Oracle Corporation7 * Copyright (C) 2010-2017 Oracle Corporation 8 8 * 9 9 * Permission is hereby granted, free of charge, to any person … … 37 37 #include <VBox/err.h> 38 38 #include <VBox/version.h> 39 #include <VBox/vmm/cfgm.h>40 39 #include <iprt/string.h> 41 40 #include <iprt/param.h> … … 53 52 // * @interface_method_impl{VBOXEXTPACKREG,pfnInstalled} 54 53 // */ 55 // static DECLCALLBACK(void) vboxSkeletonExtPack_Installed(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox); 54 // static DECLCALLBACK(void) vboxDTraceExtPack_Installed(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox, PRTERRINFO pErrInfo); 55 // 56 56 // /** 57 57 // * @interface_method_impl{VBOXEXTPACKREG,pfnUninstall} 58 58 // */ 59 // static DECLCALLBACK(int) vbox SkeletonExtPack_Uninstall(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox);59 // static DECLCALLBACK(int) vboxDTraceExtPack_Uninstall(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox); 60 60 // 61 61 // /** 62 62 // * @interface_method_impl{VBOXEXTPACKREG,pfnVirtualBoxReady} 63 63 // */ 64 // static DECLCALLBACK(void) vbox SkeletonExtPack_VirtualBoxReady(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox);64 // static DECLCALLBACK(void) vboxDTraceExtPack_VirtualBoxReady(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox); 65 65 // 66 66 // /** 67 67 // * @interface_method_impl{VBOXEXTPACKREG,pfnUnload} 68 68 // */ 69 // static DECLCALLBACK(void) vboxSkeletonExtPack_Unload(PCVBOXEXTPACKREG pThis); 69 // static DECLCALLBACK(void) vboxDTraceExtPack_Unload(PCVBOXEXTPACKREG pThis); 70 // 70 71 // /** 71 72 // * @interface_method_impl{VBOXEXTPACKREG,pfnVMCreated} 72 73 // */ 73 // static DECLCALLBACK(int) vbox SkeletonExtPack_VMCreated(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox, IMachine*pMachine);74 // static DECLCALLBACK(int) vboxDTraceExtPack_VMCreated(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox, VBOXEXTPACK_IF_CS(IMachine) *pMachine); 74 75 // 75 76 // /** 76 // * @interface_method_impl{VBOXEXTPACKREG,pfn VMConfigureVMM}77 // * @interface_method_impl{VBOXEXTPACKREG,pfnQueryObject} 77 78 // */ 78 // static DECLCALLBACK(int) vboxSkeletonExtPack_VMConfigureVMM(PCVBOXEXTPACKREG pThis, IConsole *pConsole, PVM pVM); 79 // 80 // /** 81 // * @interface_method_impl{VBOXEXTPACKREG,pfnVMPowerOn} 82 // */ 83 // static DECLCALLBACK(int) vboxSkeletonExtPack_VMPowerOn(PCVBOXEXTPACKREG pThis, IConsole *pConsole, PVM pVM); 84 // /** 85 // * @interface_method_impl{VBOXEXTPACKREG,pfnVMPowerOff} 86 // */ 87 // static DECLCALLBACK(void) vboxSkeletonExtPack_VMPowerOff(PCVBOXEXTPACKREG pThis, IConsole *pConsole, PVM pVM); 88 // /** 89 // * @interface_method_impl{VBOXEXTPACKREG,pfnVMPowerOff} 90 // */ 91 // static DECLCALLBACK(void) vboxSkeletonExtPack_QueryObject(PCVBOXEXTPACKREG pThis, PCRTUUID pObjectId); 79 // static DECLCALLBACK(void) vboxDTraceExtPack_QueryObject(PCVBOXEXTPACKREG pThis, PCRTUUID pObjectId); 92 80 93 81 94 static const VBOXEXTPACKREG g_vbox SkeletonExtPackReg =82 static const VBOXEXTPACKREG g_vboxDTraceExtPackReg = 95 83 { 96 84 VBOXEXTPACKREG_VERSION, … … 99 87 /* .pfnUninstall = */ NULL, 100 88 /* .pfnVirtualBoxReady =*/ NULL, 101 /* .pfnConsoleReady = */ NULL,102 89 /* .pfnUnload = */ NULL, 103 90 /* .pfnVMCreated = */ NULL, 104 /* .pfnVMConfigureVMM = */ NULL,105 /* .pfnVMPowerOn = */ NULL,106 /* .pfnVMPowerOff = */ NULL,107 91 /* .pfnQueryObject = */ NULL, 108 92 /* .pfnReserved1 = */ NULL, … … 139 123 */ 140 124 g_pHlp = pHlp; 141 *ppReg = &g_vbox SkeletonExtPackReg;125 *ppReg = &g_vboxDTraceExtPackReg; 142 126 143 127 return VINF_SUCCESS; -
trunk/src/VBox/ExtPacks/VNC/VBoxVNCMain.cpp
r62496 r68828 5 5 6 6 /* 7 * Copyright (C) 2010-201 6Oracle Corporation7 * Copyright (C) 2010-2017 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 24 24 #include <VBox/err.h> 25 25 #include <VBox/version.h> 26 #include <VBox/vmm/cfgm.h>27 26 #include <iprt/string.h> 28 27 #include <iprt/param.h> … … 40 39 // * @interface_method_impl{VBOXEXTPACKREG,pfnInstalled} 41 40 // */ 42 // static DECLCALLBACK(void) vboxVNCExtPack_Installed(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox); 41 // static DECLCALLBACK(void) vboxVNCExtPack_Installed(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox, PRTERRINFO pErrInfo); 42 // 43 43 // /** 44 44 // * @interface_method_impl{VBOXEXTPACKREG,pfnUninstall} … … 55 55 // */ 56 56 // static DECLCALLBACK(void) vboxVNCExtPack_Unload(PCVBOXEXTPACKREG pThis); 57 // 57 58 // /** 58 59 // * @interface_method_impl{VBOXEXTPACKREG,pfnVMCreated} 59 60 // */ 60 // static DECLCALLBACK(int) vboxVNCExtPack_VMCreated(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox, IMachine*pMachine);61 // static DECLCALLBACK(int) vboxVNCExtPack_VMCreated(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox, VBOXEXTPACK_IF_CS(IMachine) *pMachine); 61 62 // 62 63 // /** 63 // * @interface_method_impl{VBOXEXTPACKREG,pfnVMConfigureVMM} 64 // */ 65 // static DECLCALLBACK(int) vboxVNCExtPack_VMConfigureVMM(PCVBOXEXTPACKREG pThis, IConsole *pConsole, PVM pVM); 66 // 67 // /** 68 // * @interface_method_impl{VBOXEXTPACKREG,pfnVMPowerOn} 69 // */ 70 // static DECLCALLBACK(int) vboxVNCExtPack_VMPowerOn(PCVBOXEXTPACKREG pThis, IConsole *pConsole, PVM pVM); 71 // /** 72 // * @interface_method_impl{VBOXEXTPACKREG,pfnVMPowerOff} 73 // */ 74 // static DECLCALLBACK(void) vboxVNCExtPack_VMPowerOff(PCVBOXEXTPACKREG pThis, IConsole *pConsole, PVM pVM); 75 // /** 76 // * @interface_method_impl{VBOXEXTPACKREG,pfnVMPowerOff} 64 // * @interface_method_impl{VBOXEXTPACKREG,pfnQueryObject} 77 65 // */ 78 66 // static DECLCALLBACK(void) vboxVNCExtPack_QueryObject(PCVBOXEXTPACKREG pThis, PCRTUUID pObjectId); … … 86 74 /* .pfnUninstall = */ NULL, 87 75 /* .pfnVirtualBoxReady =*/ NULL, 88 /* .pfnConsoleReady = */ NULL,89 76 /* .pfnUnload = */ NULL, 90 77 /* .pfnVMCreated = */ NULL, 91 /* .pfnVMConfigureVMM = */ NULL,92 /* .pfnVMPowerOn = */ NULL,93 /* .pfnVMPowerOff = */ NULL,94 78 /* .pfnQueryObject = */ NULL, 95 79 /* .pfnReserved1 = */ NULL, -
trunk/src/VBox/Main/include/ExtPackManagerImpl.h
r63147 r68828 5 5 6 6 /* 7 * Copyright (C) 2010-201 6Oracle Corporation7 * Copyright (C) 2010-2017 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 31 31 32 32 33 #if !defined(VBOX_COM_INPROC)33 #ifndef VBOX_COM_INPROC 34 34 /** 35 35 * An extension pack file. … … 87 87 friend class ExtPackInstallTask; 88 88 }; 89 #endif 89 #endif /* !VBOX_COM_INPROC */ 90 90 91 91 … … 110 110 /** @name Internal interfaces used by ExtPackManager. 111 111 * @{ */ 112 #ifndef VBOX_COM_INPROC 112 113 bool i_callInstalledHook(IVirtualBox *a_pVirtualBox, AutoWriteLock *a_pLock, PRTERRINFO pErrInfo); 113 114 HRESULT i_callUninstallHookAndClose(IVirtualBox *a_pVirtualBox, bool a_fForcedRemoval); 114 115 bool i_callVirtualBoxReadyHook(IVirtualBox *a_pVirtualBox, AutoWriteLock *a_pLock); 116 #endif 117 #ifdef VBOX_COM_INPROC 115 118 bool i_callConsoleReadyHook(IConsole *a_pConsole, AutoWriteLock *a_pLock); 119 #endif 120 #ifndef VBOX_COM_INPROC 116 121 bool i_callVmCreatedHook(IVirtualBox *a_pVirtualBox, IMachine *a_pMachine, AutoWriteLock *a_pLock); 122 #endif 123 #ifdef VBOX_COM_INPROC 117 124 bool i_callVmConfigureVmmHook(IConsole *a_pConsole, PVM a_pVM, AutoWriteLock *a_pLock, int *a_pvrc); 118 125 bool i_callVmPowerOnHook(IConsole *a_pConsole, PVM a_pVM, AutoWriteLock *a_pLock, int *a_pvrc); 119 126 bool i_callVmPowerOffHook(IConsole *a_pConsole, PVM a_pVM, AutoWriteLock *a_pLock); 127 #endif 120 128 HRESULT i_checkVrde(void); 121 129 HRESULT i_getVrdpLibraryName(Utf8Str *a_pstrVrdeLibrary); … … 197 205 /** @name Internal interfaces used by other Main classes. 198 206 * @{ */ 199 #if !defined(VBOX_COM_INPROC)207 #ifndef VBOX_COM_INPROC 200 208 HRESULT i_doInstall(ExtPackFile *a_pExtPackFile, bool a_fReplace, Utf8Str const *a_pstrDisplayInfo); 201 209 HRESULT i_doUninstall(const Utf8Str *a_pstrName, bool a_fForcedRemoval, const Utf8Str *a_pstrDisplayInfo); 202 #endif203 210 void i_callAllVirtualBoxReadyHooks(void); 211 #endif 212 #ifdef VBOX_COM_INPROC 204 213 void i_callAllConsoleReadyHooks(IConsole *a_pConsole); 214 #endif 215 #ifndef VBOX_COM_INPROC 205 216 void i_callAllVmCreatedHooks(IMachine *a_pMachine); 217 #endif 218 #ifdef VBOX_COM_INPROC 206 219 int i_callAllVmConfigureVmmHooks(IConsole *a_pConsole, PVM a_pVM); 207 220 int i_callAllVmPowerOnHooks(IConsole *a_pConsole, PVM a_pVM); 208 221 void i_callAllVmPowerOffHooks(IConsole *a_pConsole, PVM a_pVM); 222 #endif 209 223 HRESULT i_checkVrdeExtPack(Utf8Str const *a_pstrExtPack); 210 224 int i_getVrdeLibraryPathForExtPack(Utf8Str const *a_pstrExtPack, Utf8Str *a_pstrVrdeLibrary); -
trunk/src/VBox/Main/include/ExtPackUtil.h
r62485 r68828 5 5 6 6 /* 7 * Copyright (C) 2010-201 6Oracle Corporation7 * Copyright (C) 2010-2017 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 100 100 /** The name of the main module. */ 101 101 RTCString strMainModule; 102 /** The name of the main VM module, empty if none. */ 103 RTCString strMainVMModule; 102 104 /** The name of the VRDE module, empty if none. */ 103 105 RTCString strVrdeModule; -
trunk/src/VBox/Main/src-all/ExtPackManagerImpl.cpp
r66294 r68828 46 46 #include "Global.h" 47 47 #include "ProgressImpl.h" 48 #if defined(VBOX_COM_INPROC)48 #ifdef VBOX_COM_INPROC 49 49 # include "ConsoleImpl.h" 50 50 #else … … 85 85 }; 86 86 87 #if !defined(VBOX_COM_INPROC)87 #ifndef VBOX_COM_INPROC 88 88 /** 89 89 * Private extension pack data. … … 132 132 /** Pointer back to the extension pack object (for Hlp methods). */ 133 133 ExtPack *pThis; 134 /** The extension pack registration structure. */ 134 #ifndef VBOX_COM_INPROC 135 /** The extension pack main registration structure. */ 135 136 PCVBOXEXTPACKREG pReg; 137 #else 138 /** The extension pack main VM registration structure. */ 139 PCVBOXEXTPACKVMREG pReg; 140 #endif 136 141 /** The current context. */ 137 142 VBOXEXTPACKCTX enmContext; … … 157 162 /** The list of installed extension packs. */ 158 163 ExtPackList llInstalledExtPacks; 159 #if !defined(VBOX_COM_INPROC)164 #ifndef VBOX_COM_INPROC 160 165 /** Pointer to the VirtualBox object, our parent. */ 161 166 VirtualBox *pVirtualBox; … … 163 168 /** The current context. */ 164 169 VBOXEXTPACKCTX enmContext; 165 #if !defined(RT_OS_WINDOWS) && !defined(RT_OS_DARWIN)166 /** File handle for the VBoxVMM libary which we slurp because ExtPacks depend on it. */167 RTLDRMOD hVBoxVMM;168 #endif169 170 170 171 RTMEMEF_NEW_AND_DELETE_OPERATORS(); 171 172 }; 172 173 173 #if !defined(VBOX_COM_INPROC)174 #ifndef VBOX_COM_INPROC 174 175 175 176 /** … … 821 822 822 823 824 #ifndef VBOX_COM_INPROC 823 825 /** 824 826 * Calls the installed hook. … … 895 897 if ( m != NULL 896 898 && m->fUsable 899 && m->hMainMod != NIL_RTLDRMOD 897 900 && !m->fMadeReadyCall) 898 901 { … … 909 912 return false; 910 913 } 911 914 #endif /* !VBOX_COM_INPROC */ 915 916 #ifdef VBOX_COM_INPROC 912 917 /** 913 918 * Calls the pfnConsoleReady hook. … … 921 926 if ( m != NULL 922 927 && m->fUsable 928 && m->hMainMod != NIL_RTLDRMOD 923 929 && !m->fMadeReadyCall) 924 930 { … … 935 941 return false; 936 942 } 937 943 #endif /* VBOX_COM_INPROC */ 944 945 #ifndef VBOX_COM_INPROC 938 946 /** 939 947 * Calls the pfnVMCreate hook. … … 947 955 { 948 956 if ( m != NULL 957 && m->hMainMod != NIL_RTLDRMOD 949 958 && m->fUsable) 950 959 { … … 960 969 return false; 961 970 } 962 971 #endif /* !VBOX_COM_INPROC */ 972 973 #ifdef VBOX_COM_INPROC 963 974 /** 964 975 * Calls the pfnVMConfigureVMM hook. … … 976 987 *a_pvrc = VINF_SUCCESS; 977 988 if ( m != NULL 989 && m->hMainMod != NIL_RTLDRMOD 978 990 && m->fUsable) 979 991 { … … 1008 1020 *a_pvrc = VINF_SUCCESS; 1009 1021 if ( m != NULL 1022 && m->hMainMod != NIL_RTLDRMOD 1010 1023 && m->fUsable) 1011 1024 { … … 1036 1049 { 1037 1050 if ( m != NULL 1051 && m->hMainMod != NIL_RTLDRMOD 1038 1052 && m->fUsable) 1039 1053 { … … 1049 1063 return false; 1050 1064 } 1065 #endif /* !VBOX_COM_INPROC */ 1051 1066 1052 1067 /** … … 1285 1300 * Load the main DLL and call the predefined entry point. 1286 1301 */ 1302 #ifndef VBOX_COM_INPROC 1303 const char *pszMainModule = m->Desc.strMainModule.c_str(); 1304 #else 1305 const char *pszMainModule = m->Desc.strMainVMModule.c_str(); 1306 if (m->Desc.strMainVMModule.isEmpty()) 1307 { 1308 /* 1309 * We're good! The main module for VM processes is optional. 1310 */ 1311 m->fUsable = true; 1312 m->strWhyUnusable.setNull(); 1313 return; 1314 } 1315 #endif 1287 1316 bool fIsNative; 1288 if (!i_findModule( m->Desc.strMainModule.c_str(), NULL /* default extension */, VBOXEXTPACKMODKIND_R3,1317 if (!i_findModule(pszMainModule, NULL /* default extension */, VBOXEXTPACKMODKIND_R3, 1289 1318 &m->strMainModPath, &fIsNative, &m->ObjInfoMainMod)) 1290 1319 { 1291 m->strWhyUnusable.printf(tr("Failed to locate the main module ('%s')"), m->Desc.strMainModule.c_str());1320 m->strWhyUnusable.printf(tr("Failed to locate the main module ('%s')"), pszMainModule); 1292 1321 return; 1293 1322 } … … 1320 1349 * Resolve the predefined entry point. 1321 1350 */ 1351 #ifndef VBOX_COM_INPROC 1352 const char *pszMainEntryPoint = VBOX_EXTPACK_MAIN_MOD_ENTRY_POINT; 1322 1353 PFNVBOXEXTPACKREGISTER pfnRegistration; 1323 vrc = RTLdrGetSymbol(m->hMainMod, VBOX_EXTPACK_MAIN_MOD_ENTRY_POINT, (void **)&pfnRegistration); 1354 uint32_t uVersion = VBOXEXTPACKREG_VERSION; 1355 #else 1356 const char *pszMainEntryPoint = VBOX_EXTPACK_MAIN_VM_MOD_ENTRY_POINT; 1357 PFNVBOXEXTPACKVMREGISTER pfnRegistration; 1358 uint32_t uVersion = VBOXEXTPACKVMREG_VERSION; 1359 #endif 1360 vrc = RTLdrGetSymbol(m->hMainMod, pszMainEntryPoint, (void **)&pfnRegistration); 1324 1361 if (RT_SUCCESS(vrc)) 1325 1362 { … … 1330 1367 && VALID_PTR(m->pReg)) 1331 1368 { 1332 if ( VBOXEXTPACK_IS_MAJOR_VER_EQUAL(m->pReg->u32Version, VBOXEXTPACKREG_VERSION)1369 if ( VBOXEXTPACK_IS_MAJOR_VER_EQUAL(m->pReg->u32Version, uVersion) 1333 1370 && m->pReg->u32EndMarker == m->pReg->u32Version) 1334 1371 { 1372 #ifndef VBOX_COM_INPROC 1335 1373 if ( (!m->pReg->pfnInstalled || RT_VALID_PTR(m->pReg->pfnInstalled)) 1336 1374 && (!m->pReg->pfnUninstall || RT_VALID_PTR(m->pReg->pfnUninstall)) 1337 1375 && (!m->pReg->pfnVirtualBoxReady || RT_VALID_PTR(m->pReg->pfnVirtualBoxReady)) 1338 && (!m->pReg->pfnConsoleReady || RT_VALID_PTR(m->pReg->pfnConsoleReady))1339 1376 && (!m->pReg->pfnUnload || RT_VALID_PTR(m->pReg->pfnUnload)) 1340 1377 && (!m->pReg->pfnVMCreated || RT_VALID_PTR(m->pReg->pfnVMCreated)) 1378 && (!m->pReg->pfnQueryObject || RT_VALID_PTR(m->pReg->pfnQueryObject)) 1379 ) 1380 { 1381 /* 1382 * We're good! 1383 */ 1384 m->fUsable = true; 1385 m->strWhyUnusable.setNull(); 1386 return; 1387 } 1388 #else 1389 if ( (!m->pReg->pfnConsoleReady || RT_VALID_PTR(m->pReg->pfnConsoleReady)) 1390 && (!m->pReg->pfnUnload || RT_VALID_PTR(m->pReg->pfnUnload)) 1341 1391 && (!m->pReg->pfnVMConfigureVMM || RT_VALID_PTR(m->pReg->pfnVMConfigureVMM)) 1342 1392 && (!m->pReg->pfnVMPowerOn || RT_VALID_PTR(m->pReg->pfnVMPowerOn)) … … 1352 1402 return; 1353 1403 } 1354 1355 m->strWhyUnusable = tr("The registration structure contains on or more invalid function pointers"); 1404 #endif 1405 1406 m->strWhyUnusable = tr("The registration structure contains one or more invalid function pointers"); 1356 1407 } 1357 1408 else … … 1361 1412 else 1362 1413 m->strWhyUnusable.printf(tr("%s returned %Rrc, pReg=%p ErrInfo='%s'"), 1363 VBOX_EXTPACK_MAIN_MOD_ENTRY_POINT, vrc, m->pReg, ErrInfo.Core.pszMsg);1414 pszMainEntryPoint, vrc, m->pReg, ErrInfo.Core.pszMsg); 1364 1415 m->pReg = NULL; 1365 1416 } 1366 1417 else 1367 1418 m->strWhyUnusable.printf(tr("Failed to resolve exported symbol '%s' in the main module: %Rrc"), 1368 VBOX_EXTPACK_MAIN_MOD_ENTRY_POINT, vrc);1419 pszMainEntryPoint, vrc); 1369 1420 1370 1421 RTLdrClose(m->hMainMod); … … 1904 1955 #else 1905 1956 RT_NOREF_PV(a_pVirtualBox); 1906 #endif1907 1908 /*1909 * Slurp in VBoxVMM which is used by VBoxPuelMain.1910 */1911 #if !defined(RT_OS_WINDOWS) && !defined(RT_OS_DARWIN)1912 if (a_enmContext == VBOXEXTPACKCTX_PER_USER_DAEMON)1913 {1914 int vrc = SUPR3HardenedLdrLoadAppPriv("VBoxVMM", &m->hVBoxVMM, RTLDRLOAD_FLAGS_GLOBAL, NULL);1915 if (RT_FAILURE(vrc))1916 m->hVBoxVMM = NIL_RTLDRMOD;1917 /* cleanup in ::uninit()? */1918 }1919 1957 #endif 1920 1958 … … 2043 2081 AssertReturn(m->enmContext == VBOXEXTPACKCTX_PER_USER_DAEMON, E_UNEXPECTED); 2044 2082 2045 #if !defined(VBOX_COM_INPROC)2083 #ifndef VBOX_COM_INPROC 2046 2084 /* The API can optionally take a ::SHA-256=<hex-digest> attribute at the 2047 2085 end of the file name. This is just a temporary measure for … … 2077 2115 Assert(m->enmContext == VBOXEXTPACKCTX_PER_USER_DAEMON); 2078 2116 2079 #if !defined(VBOX_COM_INPROC)2117 #ifndef VBOX_COM_INPROC 2080 2118 2081 2119 HRESULT hrc; … … 2436 2474 } 2437 2475 2438 #if !defined(VBOX_COM_INPROC)2476 #ifndef VBOX_COM_INPROC 2439 2477 2440 2478 /** … … 2859 2897 #endif /* !VBOX_COM_INPROC */ 2860 2898 2899 #ifdef VBOX_COM_INPROC 2861 2900 /** 2862 2901 * Calls the pfnConsoleReady hook for all working extension packs. … … 2884 2923 } 2885 2924 } 2886 2887 #if !defined(VBOX_COM_INPROC) 2925 #endif 2926 2927 #ifndef VBOX_COM_INPROC 2888 2928 /** 2889 2929 * Calls the pfnVMCreated hook for all working extension packs. … … 2906 2946 #endif 2907 2947 2948 #ifdef VBOX_COM_INPROC 2908 2949 /** 2909 2950 * Calls the pfnVMConfigureVMM hook for all working extension packs. … … 2983 3024 (*it)->i_callVmPowerOffHook(a_pConsole, a_pVM, &autoLock); 2984 3025 } 3026 #endif 2985 3027 2986 3028 -
trunk/src/VBox/Main/src-all/ExtPackUtil.cpp
r65088 r68828 5 5 6 6 /* 7 * Copyright (C) 2010-201 6Oracle Corporation7 * Copyright (C) 2010-2017 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 74 74 a_pExtPackDesc->uRevision = 0; 75 75 a_pExtPackDesc->strMainModule.setNull(); 76 a_pExtPackDesc->strMainVMModule.setNull(); 76 77 a_pExtPackDesc->strVrdeModule.setNull(); 77 78 a_pExtPackDesc->cPlugIns = 0; … … 164 165 165 166 /* 167 * The main VM module, optional. 168 * Accept both none and empty as tokens of no main VM module. 169 */ 170 const char *pszMainVMModule = NULL; 171 const xml::ElementNode *pMainVMModuleElm = pVBoxExtPackElm->findChildElement("MainVMModule"); 172 if (pMainVMModuleElm) 173 { 174 pszMainVMModule = pMainVMModuleElm->getValue(); 175 if (!pszMainVMModule || *pszMainVMModule == '\0') 176 pszMainVMModule = NULL; 177 else if (!VBoxExtPackIsValidModuleString(pszMainVMModule)) 178 return &(new RTCString("Invalid main VM module string: "))->append(pszMainVMModule); 179 } 180 181 /* 166 182 * The VRDE module, optional. 167 183 * Accept both none and empty as tokens of no VRDE module. … … 205 221 a_pExtPackDesc->uRevision = uRevision; 206 222 a_pExtPackDesc->strMainModule = pszMainModule; 223 a_pExtPackDesc->strMainVMModule = pszMainVMModule; 207 224 a_pExtPackDesc->strVrdeModule = pszVrdeModule; 208 225 a_pExtPackDesc->cPlugIns = cPlugIns; … … 362 379 a_pExtPackDesc->uRevision = 0; 363 380 a_pExtPackDesc->strMainModule.setNull(); 381 a_pExtPackDesc->strMainVMModule.setNull(); 364 382 a_pExtPackDesc->strVrdeModule.setNull(); 365 383 a_pExtPackDesc->cPlugIns = 0; -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r68804 r68828 825 825 // we don't perform uninit() as it's possible that some pending event refers to this source 826 826 unconst(mEventSource).setNull(); 827 828 #ifdef VBOX_WITH_EXTPACK 829 unconst(mptrExtPackManager).setNull(); 830 #endif 827 831 828 832 LogFlowThisFuncLeave();
Note:
See TracChangeset
for help on using the changeset viewer.