Fixed pitch bending in the midi driver.
[wine] / dlls / shell32 / shellreg.c
index 63b44cf..700ab51 100644 (file)
@@ -1,19 +1,45 @@
 /*
-       Shell Registry Access
-*/
+ * Shell Registry Access
+ *
+ * Copyright 2000 Juergen Schmied
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include "config.h"
+
 #include <string.h>
+#include <stdarg.h>
 #include <stdio.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "shellapi.h"
+#include "wingdi.h"
+#include "winuser.h"
+#include "shlobj.h"
 #include "winerror.h"
 #include "winreg.h"
-#include "debugtools.h"
 #include "winnls.h"
 
-#include "shellapi.h"
-#include "shlobj.h"
-#include "shell32_main.h"
-#include "wine/undocshell.h"
+#include "undocshell.h"
+#include "wine/winbase16.h"
+
+#include "wine/debug.h"
 
-DEFAULT_DEBUG_CHANNEL(shell);
+WINE_DEFAULT_DEBUG_CHANNEL(shell);
 
 /*************************************************************************
  * SHRegOpenKeyA                               [SHELL32.506]
@@ -22,22 +48,22 @@ DEFAULT_DEBUG_CHANNEL(shell);
 HRESULT WINAPI SHRegOpenKeyA(
        HKEY hKey,
        LPSTR lpSubKey,
-       LPHKEY phkResult)
+       PHKEY phkResult)
 {
-       TRACE("(0x%08x, %s, %p)\n", hKey, debugstr_a(lpSubKey), phkResult);
+       TRACE("(%p, %s, %p)\n", hKey, debugstr_a(lpSubKey), phkResult);
        return RegOpenKeyA(hKey, lpSubKey, phkResult);
 }
 
 /*************************************************************************
- * SHRegOpenKeyW                               [NT4.0:SHELL32.507]
+ * SHRegOpenKeyW                               [SHELL32.507] NT 4.0
  *
  */
 HRESULT WINAPI SHRegOpenKeyW (
        HKEY hkey,
        LPCWSTR lpszSubKey,
-       LPHKEY retkey)
+       PHKEY retkey)
 {
-       WARN("0x%04x %s %p\n",hkey,debugstr_w(lpszSubKey),retkey);
+       WARN("%p %s %p\n",hkey,debugstr_w(lpszSubKey),retkey);
        return RegOpenKeyW( hkey, lpszSubKey, retkey );
 }
 
@@ -53,12 +79,12 @@ HRESULT WINAPI SHRegQueryValueExA(
        LPBYTE lpData,
        LPDWORD lpcbData)
 {
-       TRACE("0x%04x %s %p %p %p %p\n", hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
+       TRACE("%p %s %p %p %p %p\n", hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
        return RegQueryValueExA (hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
 }
 
 /*************************************************************************
- * SHRegQueryValueW                            [NT4.0:SHELL32.510]
+ * SHRegQueryValueW                            [SHELL32.510] NT4.0
  *
  */
 HRESULT WINAPI SHRegQueryValueW(
@@ -67,17 +93,17 @@ HRESULT WINAPI SHRegQueryValueW(
        LPWSTR lpszData,
        LPDWORD lpcbData )
 {
-       WARN("0x%04x %s %p %p semi-stub\n",
+       WARN("%p %s %p %p semi-stub\n",
                hkey, debugstr_w(lpszSubKey), lpszData, lpcbData);
        return RegQueryValueW( hkey, lpszSubKey, lpszData, lpcbData );
 }
 
 /*************************************************************************
- * SHRegQueryValueExW  [NT4.0:SHELL32.511]
+ * SHRegQueryValueExW  [SHELL32.511] NT4.0
  *
- * FIXME 
+ * FIXME
  *  if the datatype REG_EXPAND_SZ then expand the string and change
- *  *pdwType to REG_SZ. 
+ *  *pdwType to REG_SZ.
  */
 HRESULT WINAPI SHRegQueryValueExW (
        HKEY hkey,
@@ -88,20 +114,20 @@ HRESULT WINAPI SHRegQueryValueExW (
        LPDWORD pcbData)
 {
        DWORD ret;
-       WARN("0x%04x %s %p %p %p %p semi-stub\n",
+       WARN("%p %s %p %p %p %p semi-stub\n",
                hkey, debugstr_w(pszValue), pdwReserved, pdwType, pvData, pcbData);
        ret = RegQueryValueExW ( hkey, pszValue, pdwReserved, pdwType, pvData, pcbData);
        return ret;
 }
 
 /*************************************************************************
- * SHRegDeleteKeyA   [SHELL32]
+ * SHRegDeleteKeyA   [SHELL32.?]
  */
 HRESULT WINAPI SHRegDeleteKeyA(
        HKEY hkey,
        LPCSTR pszSubKey)
 {
-       FIXME("hkey=0x%08x, %s\n", hkey, debugstr_a(pszSubKey));
+       FIXME("hkey=%p, %s\n", hkey, debugstr_a(pszSubKey));
        return 0;
 }
 
@@ -112,99 +138,16 @@ HRESULT WINAPI SHRegDeleteKeyW(
        HKEY hkey,
        LPCWSTR pszSubKey)
 {
-       FIXME("hkey=0x%08x, %s\n", hkey, debugstr_w(pszSubKey));
+       FIXME("hkey=%p, %s\n", hkey, debugstr_w(pszSubKey));
        return 0;
 }
 
 /*************************************************************************
- * SHRegCloseKey                       [NT4.0:SHELL32.505]
+ * SHRegCloseKey                       [SHELL32.505] NT 4.0
  *
  */
 HRESULT WINAPI SHRegCloseKey (HKEY hkey)
 {
-       TRACE("0x%04x\n",hkey);
+       TRACE("%p\n",hkey);
        return RegCloseKey( hkey );
 }
-
-
-/* 16-bit functions */
-
-/* 0 and 1 are valid rootkeys in win16 shell.dll and are used by
- * some programs. Do not remove those cases. -MM
- */
-static inline void fix_win16_hkey( HKEY *hkey )
-{
-    if (*hkey == 0 || *hkey == 1) *hkey = HKEY_CLASSES_ROOT;
-}
-
-/******************************************************************************
- *           RegOpenKey   [SHELL.1]
- */
-DWORD WINAPI RegOpenKey16( HKEY hkey, LPCSTR name, LPHKEY retkey )
-{
-    fix_win16_hkey( &hkey );
-    return RegOpenKeyA( hkey, name, retkey );
-}
-
-/******************************************************************************
- *           RegCreateKey   [SHELL.2]
- */
-DWORD WINAPI RegCreateKey16( HKEY hkey, LPCSTR name, LPHKEY retkey )
-{
-    fix_win16_hkey( &hkey );
-    return RegCreateKeyA( hkey, name, retkey );
-}
-
-/******************************************************************************
- *           RegCloseKey   [SHELL.3]
- */
-DWORD WINAPI RegCloseKey16( HKEY hkey )
-{
-    fix_win16_hkey( &hkey );
-    return RegCloseKey( hkey );
-}
-
-/******************************************************************************
- *           RegDeleteKey   [SHELL.4]
- */
-DWORD WINAPI RegDeleteKey16( HKEY hkey, LPCSTR name )
-{
-    fix_win16_hkey( &hkey );
-    return RegDeleteKeyA( hkey, name );
-}
-
-/******************************************************************************
- *           RegSetValue   [SHELL.5]
- */
-DWORD WINAPI RegSetValue16( HKEY hkey, LPCSTR name, DWORD type, LPCSTR data, DWORD count )
-{
-    fix_win16_hkey( &hkey );
-    return RegSetValueA( hkey, name, type, data, count );
-}
-
-/******************************************************************************
- *           RegQueryValue   [SHELL.6]
- *
- * NOTES
- *    Is this HACK still applicable?
- *
- * HACK
- *    The 16bit RegQueryValue doesn't handle selectorblocks anyway, so we just
- *    mask out the high 16 bit.  This (not so much incidently) hopefully fixes
- *    Aldus FH4)
- */
-DWORD WINAPI RegQueryValue16( HKEY hkey, LPCSTR name, LPSTR data, LPDWORD count )
-{
-    fix_win16_hkey( &hkey );
-    if (count) *count &= 0xffff;
-    return RegQueryValueA( hkey, name, data, count );
-}
-
-/******************************************************************************
- *           RegEnumKey   [SHELL.7]
- */
-DWORD WINAPI RegEnumKey16( HKEY hkey, DWORD index, LPSTR name, DWORD name_len )
-{
-    fix_win16_hkey( &hkey );
-    return RegEnumKeyA( hkey, index, name, name_len );
-}