Changeset 12724 in vbox for trunk/src/VBox/Additions/WINNT/VBoxService/VBoxVMInfo.cpp
- Timestamp:
- Sep 25, 2008 12:13:12 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxService/VBoxVMInfo.cpp
r11982 r12724 23 23 { 24 24 int rc = VINF_SUCCESS; 25 if((!a_pCtx) || (!a_pszKey)) 26 return VERR_INVALID_PARAMETER; 25 Assert(a_pCtx); 26 Assert(a_pszKey); 27 /* Not checking for a valid a_pszValue is intentional. */ 27 28 28 29 char szKeyTemp [_MAX_PATH] = {0}; … … 59 60 } 60 61 61 int vboxVMInfoWritePropInt(VBOXINFORMATIONCONTEXT* a_pCtx, char *a_pszKey, int a_iValue 62 int vboxVMInfoWritePropInt(VBOXINFORMATIONCONTEXT* a_pCtx, char *a_pszKey, int a_iValue) 62 63 { 64 Assert(a_pCtx); 65 Assert(a_pszKey); 66 63 67 char szBuffer[_MAX_PATH] = {0}; /** @todo r=bird: this is a bit excessive (the size) */ 64 68 itoa(a_iValue, szBuffer, 10); … … 69 73 int vboxVMInfoInit(const VBOXSERVICEENV *pEnv, void **ppInstance, bool *pfStartThread) 70 74 { 75 Assert(pEnv); 76 Assert(ppInstance); 77 71 78 Log(("vboxVMInfoThread: Init.\n")); 72 79 … … 100 107 void vboxVMInfoDestroy(const VBOXSERVICEENV *pEnv, void *pInstance) 101 108 { 109 Assert(pEnv); 110 102 111 VBOXINFORMATIONCONTEXT *pCtx = (VBOXINFORMATIONCONTEXT *)pInstance; 112 Assert(pCtx); 103 113 114 /* @todo Temporary solution: Zap all values which are not valid anymore when VM goes down (reboot/shutdown). 115 * Needs to be replaced with "temporary properties" later. */ 116 char szPropPath [_MAX_PATH+1] = {0}; 117 char*pPtr = &szPropPath[0]; 118 119 vboxVMInfoWriteProp(pCtx, "GuestInfo/OS/LoggedInUsersList", ""); 120 vboxVMInfoWritePropInt(pCtx, "GuestInfo/OS/LoggedInUsers", 0); 121 122 RTStrPrintf(szPropPath, sizeof(szPropPath), "/VirtualBox/GuestInfo/Net/*"); 123 VbglR3GuestPropDelTree(pCtx->iInfoSvcClientID, &pPtr, 1); 124 vboxVMInfoWritePropInt(pCtx, "GuestInfo/Net/Count", 0); 125 126 /* Disconnect from guest properties API. */ 104 127 int rc = VbglR3GuestPropDisconnect(pCtx->iInfoSvcClientID); 105 128 if (!RT_SUCCESS(rc)) … … 112 135 unsigned __stdcall vboxVMInfoThread(void *pInstance) 113 136 { 137 Assert(pInstance); 138 114 139 VBOXINFORMATIONCONTEXT *pCtx = (VBOXINFORMATIONCONTEXT *)pInstance; 115 140 bool fTerminate = false;
Note:
See TracChangeset
for help on using the changeset viewer.