diff options
Diffstat (limited to '3rdparty/lua/src/modules/lua-winreg/src/win_registry.c')
-rw-r--r-- | 3rdparty/lua/src/modules/lua-winreg/src/win_registry.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/3rdparty/lua/src/modules/lua-winreg/src/win_registry.c b/3rdparty/lua/src/modules/lua-winreg/src/win_registry.c index a6ff972..4603251 100644 --- a/3rdparty/lua/src/modules/lua-winreg/src/win_registry.c +++ b/3rdparty/lua/src/modules/lua-winreg/src/win_registry.c @@ -1,20 +1,20 @@ -#include <windows.h>
-
-// delete the whole sub key
-LONG win_reg_deltree(HKEY hParentKey, const TCHAR * strKeyName){
- TCHAR szSubKeyName[MAX_PATH];
- HKEY hCurrentKey;
- LONG dwResult;
- if ((dwResult = RegOpenKey(hParentKey, strKeyName, &hCurrentKey)) == ERROR_SUCCESS){
- // Remove all subkeys of the key to delete
- while ((dwResult = RegEnumKey(hCurrentKey, 0, szSubKeyName, 255)) == ERROR_SUCCESS){
- if((dwResult = win_reg_deltree(hCurrentKey, szSubKeyName)) != ERROR_SUCCESS)break;
- }
- // If all went well, we should now be able to delete the requested key
- if((dwResult == ERROR_NO_MORE_ITEMS) || (dwResult == ERROR_BADKEY)){
- dwResult = RegDeleteKey(hParentKey, strKeyName);
- }
- RegCloseKey(hCurrentKey);
- }
- return dwResult;
+#include <windows.h> + +// delete the whole sub key +LONG win_reg_deltree(HKEY hParentKey, const TCHAR * strKeyName){ + TCHAR szSubKeyName[MAX_PATH]; + HKEY hCurrentKey; + LONG dwResult; + if ((dwResult = RegOpenKey(hParentKey, strKeyName, &hCurrentKey)) == ERROR_SUCCESS){ + // Remove all subkeys of the key to delete + while ((dwResult = RegEnumKey(hCurrentKey, 0, szSubKeyName, 255)) == ERROR_SUCCESS){ + if((dwResult = win_reg_deltree(hCurrentKey, szSubKeyName)) != ERROR_SUCCESS)break; + } + // If all went well, we should now be able to delete the requested key + if((dwResult == ERROR_NO_MORE_ITEMS) || (dwResult == ERROR_BADKEY)){ + dwResult = RegDeleteKey(hParentKey, strKeyName); + } + RegCloseKey(hCurrentKey); + } + return dwResult; }
\ No newline at end of file |