James Hawkins truiken@gmail.com writes:
- /* a key cannot be created directly beneath HKEY_LOCAL_MACHINE or HKEY_USERS */
- if ((hkey == HKEY_LOCAL_MACHINE || hkey == HKEY_USERS) && !strchr(name, '\')) {
*retkey = NULL;
- return ERROR_INVALID_PARAMETER;
- }
- if (!(ret = RegOpenKeyExW( hkey, name, 0, KEY_ENUMERATE_SUB_KEYS, &tmp ))) {
/* check for any subkeys
* a key cannot be deleted if it has any subkeys
*/
RegQueryInfoKeyW(tmp, NULL, NULL, NULL, &numSubKeys, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
if (numSubKeys != 0) {
if (*name) RegCloseKey(tmp);
return ERROR_ACCESS_DENIED;
}
These kinds of checks should be done in the lower level functions, not in advapi32 (and in the case of the delete, are done already AFAICT).
On 23 Feb 2005 13:57:08 +0100, Alexandre Julliard julliard@winehq.org wrote:
James Hawkins truiken@gmail.com writes:
- /* a key cannot be created directly beneath HKEY_LOCAL_MACHINE or HKEY_USERS */
- if ((hkey == HKEY_LOCAL_MACHINE || hkey == HKEY_USERS) && !strchr(name, '\')) {
*retkey = NULL;
return ERROR_INVALID_PARAMETER;
- }
- if (!(ret = RegOpenKeyExW( hkey, name, 0, KEY_ENUMERATE_SUB_KEYS, &tmp ))) {
/* check for any subkeys
* a key cannot be deleted if it has any subkeys
*/
RegQueryInfoKeyW(tmp, NULL, NULL, NULL, &numSubKeys, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
if (numSubKeys != 0) {
if (*name) RegCloseKey(tmp);
return ERROR_ACCESS_DENIED;
}
These kinds of checks should be done in the lower level functions, not in advapi32 (and in the case of the delete, are done already AFAICT).
-- Alexandre Julliard julliard@winehq.org
By lower level functions do you mean the ntdll reg functions?
James Hawkins truiken@gmail.com writes:
By lower level functions do you mean the ntdll reg functions?
Either in ntdll or directly in the Wine server, depending on the case; most likely in the server.
On 23 Feb 2005 16:00:04 +0100, Alexandre Julliard julliard@winehq.org wrote:
James Hawkins truiken@gmail.com writes:
By lower level functions do you mean the ntdll reg functions?
Either in ntdll or directly in the Wine server, depending on the case; most likely in the server.
If you have time available, could you explain what the different cases are for putting the checks in either ntdll or the wine server. In the meantime I will be reading through the server's reg functions and adding the checks there.
Thanks, James Hawkins
James Hawkins truiken@gmail.com writes:
If you have time available, could you explain what the different cases are for putting the checks in either ntdll or the wine server. In the meantime I will be reading through the server's reg functions and adding the checks there.
If the function is implemented in ntdll then the check should be in there. If all the ntdll function does is call the server then the check should be in the server.