Changeset 10005 in vbox for trunk/src/VBox/Additions/common
- Timestamp:
- Jun 27, 2008 9:33:35 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 32462
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibInfoSvc.cpp
r9918 r10005 86 86 * @param u32ClientId The client id returned by VbglR3InvsSvcConnect(). 87 87 * @param pszKey The registry key to save to. 88 * @param pszValue The value to save. 88 * @param pszValue The value to store. If this is NULL then the key 89 * will be removed. 89 90 */ 90 91 VBGLR3DECL(int) VbglR3InfoSvcWriteKey(uint32_t u32ClientId, char *pszKey, char *pszValue) 91 92 { 92 SetConfigKey Msg;93 int rc; 93 94 94 Msg.hdr.result = (uint32_t)VERR_WRONG_ORDER; /** @todo drop the cast when the result type has been fixed! */ 95 Msg.hdr.u32ClientID = u32ClientId; 96 Msg.hdr.u32Function = SET_CONFIG_KEY; 97 Msg.hdr.cParms = 2; 98 VbglHGCMParmPtrSet(&Msg.key, pszKey, strlen(pszKey) + 1); 99 VbglHGCMParmPtrSet(&Msg.value, pszValue, strlen(pszValue) + 1); 95 if (pszValue != NULL) 96 { 97 SetConfigKey Msg; 100 98 101 int rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_HGCM_CALL(sizeof(Msg)), &Msg, sizeof(Msg)); 99 Msg.hdr.result = (uint32_t)VERR_WRONG_ORDER; /** @todo drop the cast when the result type has been fixed! */ 100 Msg.hdr.u32ClientID = u32ClientId; 101 Msg.hdr.u32Function = SET_CONFIG_KEY; 102 Msg.hdr.cParms = 2; 103 VbglHGCMParmPtrSet(&Msg.key, pszKey, strlen(pszKey) + 1); 104 VbglHGCMParmPtrSet(&Msg.value, pszValue, strlen(pszValue) + 1); 105 rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_HGCM_CALL(sizeof(Msg)), &Msg, sizeof(Msg)); 106 if (RT_SUCCESS(rc)) 107 rc = Msg.hdr.result; 108 } 109 else 110 { 111 DelConfigKey Msg; 112 113 Msg.hdr.result = (uint32_t)VERR_WRONG_ORDER; /** @todo drop the cast when the result type has been fixed! */ 114 Msg.hdr.u32ClientID = u32ClientId; 115 Msg.hdr.u32Function = DEL_CONFIG_KEY; 116 Msg.hdr.cParms = 1; 117 VbglHGCMParmPtrSet(&Msg.key, pszKey, strlen(pszKey) + 1); 118 rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_HGCM_CALL(sizeof(Msg)), &Msg, sizeof(Msg)); 119 if (RT_SUCCESS(rc)) 120 rc = Msg.hdr.result; 121 } 102 122 return rc; 103 123 }
Note:
See TracChangeset
for help on using the changeset viewer.