Changeset 21916 for trunk/src/kernel32/registry.cpp
- Timestamp:
- Dec 18, 2011, 10:28:22 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 1 bin 2 Makefile.inc 1 env.cmd 2 LocalConfig.kmk
-
-
Property svn:mergeinfo
set to
/branches/gcc-kmk merged eligible
- Property svn:ignore
-
trunk/src/kernel32/registry.cpp
r21302 r21916 79 79 } 80 80 81 extern "C" { 82 81 83 void WIN32API SetRegistryRootKey(HKEY hRootkey, HKEY hKey) 82 84 { 83 85 switch((DWORD)hRootkey) 84 86 { 85 case HKEY_CLASSES_ROOT: 87 case HKEY_CLASSES_ROOT: 86 88 hKeyClassesRoot = hKey; 87 89 break; … … 112 114 LONG WIN32API RegCloseKey(HKEY hKey) 113 115 { 114 switch(hKey) 116 switch(hKey) 115 117 {//Closing a root key should just return success (matters for custom builds) 116 118 case HKEY_CLASSES_ROOT: … … 166 168 astring, 167 169 phkResult); 168 170 169 171 if (NULL != astring) 170 172 FreeAsciiString(astring); 171 173 172 174 return(rc); 173 175 } … … 247 249 phkResult, 248 250 lpdwDisposition); 249 251 250 252 if (NULL != astring1) 251 253 FreeAsciiString(astring1); 252 254 253 255 if (NULL != astring2) 254 256 FreeAsciiString(astring2); 255 257 256 258 return(rc); 257 259 } … … 278 280 rc = O32_RegDeleteKey(ConvertKey(hKey), 279 281 astring); 280 282 281 283 if (NULL != astring) 282 284 FreeAsciiString(astring); 283 285 284 286 return(rc); 285 287 } … … 317 319 *****************************************************************************/ 318 320 319 LONG WIN32API RegDeleteValueA(HKEY hKey, LP STR lpszValue)321 LONG WIN32API RegDeleteValueA(HKEY hKey, LPCSTR lpszValue) 320 322 { 321 323 return O32_RegDeleteValue(ConvertKey(hKey), … … 336 338 *****************************************************************************/ 337 339 338 LONG WIN32API RegDeleteValueW(HKEY hKey, LP WSTR lpszValue)340 LONG WIN32API RegDeleteValueW(HKEY hKey, LPCWSTR lpszValue) 339 341 { 340 342 char *astring = UnicodeToAsciiString(lpszValue); … … 343 345 rc = O32_RegDeleteValue(ConvertKey(hKey), 344 346 astring); 345 347 346 348 if (NULL != astring) 347 349 FreeAsciiString(astring); 348 350 349 351 return(rc); 350 352 } … … 385 387 *****************************************************************************/ 386 388 387 LONG WIN32API RegEnumKeyW(HKEY hKey, DWORD iSubKey, LPWSTR lpszName, 389 LONG WIN32API RegEnumKeyW(HKEY hKey, DWORD iSubKey, LPWSTR lpszName, 388 390 DWORD cchName) 389 391 { … … 529 531 * Author : Patrick Haller [Tue, 1998/06/16 23:00] 530 532 *****************************************************************************/ 531 533 532 534 LONG WIN32API RegEnumValueW(HKEY hkey, 533 535 DWORD iValue, … … 638 640 if(rc) 639 641 *arg3 = 0; 640 642 641 643 if (NULL != astring) 642 644 FreeAsciiString(astring); 643 645 644 646 return(rc); 645 647 } … … 705 707 if(rc) 706 708 *arg5 = 0; 707 709 708 710 if (NULL != astring) 709 711 FreeAsciiString(astring); 710 712 711 713 return(rc); 712 714 } … … 741 743 lpcchClass, lpdwReserved, lpcSubKeys, 742 744 lpcchMaxSubKey, lpcchMaxClass, lpcValues, 743 lpcchMaxValueName, lpcbMaxValueData, 745 lpcchMaxValueName, lpcbMaxValueData, 744 746 lpcbSecurityDescriptor,lpftLastWriteTime); 745 747 } … … 776 778 lpcchClass, lpdwReserved, lpcSubKeys, 777 779 lpcchMaxSubKey, lpcchMaxClass, lpcValues, 778 lpcchMaxValueName, lpcbMaxValueData, 780 lpcchMaxValueName, lpcbMaxValueData, 779 781 lpcbSecurityDescriptor,lpftLastWriteTime); 780 782 if(rc == ERROR_SUCCESS) … … 786 788 free(astring); 787 789 } 788 else 790 else 789 791 if(lpszClass) *lpszClass = 0; 790 792 } … … 852 854 } 853 855 854 if((rc == ERROR_SUCCESS || rc == ERROR_MORE_DATA) && 855 pcbValue) 856 if((rc == ERROR_SUCCESS || rc == ERROR_MORE_DATA) && 857 pcbValue) 856 858 { 857 859 *pcbValue = *pcbValue * sizeof(WCHAR); //size in bytes!! 858 860 } 859 861 860 862 if (NULL != astring1) 861 863 FreeAsciiString(astring1); 862 864 863 865 return(rc); 864 866 } … … 986 988 } 987 989 988 if((rc == ERROR_SUCCESS || rc == ERROR_MORE_DATA) && 989 lpcbData) 990 if((rc == ERROR_SUCCESS || rc == ERROR_MORE_DATA) && 991 lpcbData) 990 992 { 991 993 switch(*lpdwType) { … … 1001 1003 if (NULL != astring) 1002 1004 FreeAsciiString(astring); 1003 1005 1004 1006 if(akeydata) 1005 1007 free(akeydata); … … 1073 1075 1074 1076 rc = RegSetValueA(hkey, astring1, dwType, astring2, cbData); 1075 1077 1076 1078 if (NULL != astring1) 1077 1079 FreeAsciiString(astring1); 1078 1080 1079 1081 if (NULL != astring2) 1080 1082 FreeAsciiString(astring2); 1081 1083 1082 1084 return(rc); 1083 1085 } … … 1100 1102 DWORD dwReserved, 1101 1103 DWORD fdwType, 1102 BYTE*lpbData,1104 const BYTE *lpbData, 1103 1105 DWORD cbData) 1104 1106 { … … 1165 1167 DWORD dwReserved, 1166 1168 DWORD fdwType, 1167 BYTE*lpbData,1169 const BYTE *lpbData, 1168 1170 DWORD cbData) 1169 1171 { … … 1184 1186 } 1185 1187 rc = RegSetValueExA(hkey, astring, dwReserved, fdwType, lpbData, cbData); 1186 1188 1187 1189 if(akeydata) 1188 1190 FreeAsciiString(akeydata); 1189 1191 1190 1192 if (NULL != astring) 1191 1193 FreeAsciiString(astring); 1192 1194 1193 1195 return(rc); 1194 1196 } … … 1715 1717 } 1716 1718 1719 } // extern "C" 1720
Note:
See TracChangeset
for help on using the changeset viewer.