- Timestamp:
- Jun 25, 2002, 12:27:00 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/registry.cpp
r8693 r8762 1 /* $Id: registry.cpp,v 1.1 7 2002-06-16 08:20:16sandervl Exp $ */1 /* $Id: registry.cpp,v 1.18 2002-06-25 10:27:00 sandervl Exp $ */ 2 2 3 3 /* … … 870 870 LPDWORD lpcbData) 871 871 { 872 LONG ret; 873 DWORD dwType = 0; 874 872 875 dprintf(("ADVAPI32:Registry key=%s", lpszValueName)); 873 876 874 return O32_RegQueryValueEx(ConvertKey(hkey), 877 if(lpdwType == NULL) { 878 lpdwType = &dwType; 879 } 880 ret = O32_RegQueryValueEx(ConvertKey(hkey), 875 881 lpszValueName, 876 882 lpdwReserved, … … 878 884 lpbData, 879 885 lpcbData); 886 887 if(ret == 0) { 888 if(lpdwType) dprintf(("key type: %x", *lpdwType)); 889 if(lpcbData) dprintf(("key length: %d", *lpcbData)); 890 } 891 if(ret == 0 || ret == ERROR_MORE_DATA) { 892 //TODO:!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 893 // Probably the same bug for some other key types (binary, multi_sz, REG_EXPAND_SZ) 894 if(*lpdwType == REG_SZ && (lpbData == NULL || ret == ERROR_MORE_DATA) && lpcbData) { 895 dprintf(("Get the real size of the string key data")); 896 //Get the real size of the string key data 897 //not a nice fix; hope this is enough (there is no clear connection 898 //between returned length and real string length (not linear for different 899 //string sizes)) 900 *lpcbData = 4096; 901 lpbData = (LPBYTE)malloc(*lpcbData); 902 if(lpcbData) { 903 //don't overwrite return value (in case it was ERROR_MODE_DATA) 904 O32_RegQueryValueEx(ConvertKey(hkey), 905 lpszValueName, 906 lpdwReserved, 907 lpdwType, 908 lpbData, 909 lpcbData); 910 if(lpcbData) dprintf(("real key length: %d", *lpcbData)); 911 free(lpbData); 912 } 913 } 914 } 915 return ret; 880 916 } 881 917
Note:
See TracChangeset
for help on using the changeset viewer.