[SHLWAPI] Sync with Wine Staging 3.3. CORE-14434
[reactos.git] / dll / win32 / shlwapi / reg.c
index 8b573a3..a72f4c2 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "precomp.h"
+#include <stdarg.h>
+#include <string.h>
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "winreg.h"
+#include "wine/debug.h"
+#define NO_SHLWAPI_STREAM
+#include "shlwapi.h"
+#include "wine/unicode.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(shell);
 
 /* Key/Value names for MIME content types */
 static const char lpszContentTypeA[] = "Content Type";
@@ -182,6 +193,9 @@ LONG WINAPI SHRegCloseUSKey(
     LPSHUSKEY hKey = hUSKey;
     LONG ret = ERROR_SUCCESS;
 
+    if (!hKey)
+        return ERROR_INVALID_PARAMETER;
+
     if (hKey->HKCUkey)
         ret = RegCloseKey(hKey->HKCUkey);
     if (hKey->HKCUstart && hKey->HKCUstart != HKEY_CURRENT_USER)