16-bit shell seperation
György 'Nog' Jeney
nog at sdf.lonestar.org
Sun Oct 27 04:41:48 CST 2002
Is there any reason why this hasn't been applied yet?
ChangeLog:
* dlls/shell32/shell32_main.h
* dlls/shell32/shell.c
* dlls/shell32/shellreg.c
* dlls/shell32/Makefile.in
* dlls/shell32/shlexec.c
Seperate out 16-bit functions into seperate file.
nog.
-------------- next part --------------
Index: dlls/shell32/Makefile.in
===================================================================
RCS file: /home/wine/wine/dlls/shell32/Makefile.in,v
retrieving revision 1.54
diff -u -r1.54 Makefile.in
--- dlls/shell32/Makefile.in 18 Oct 2002 23:46:28 -0000 1.54
+++ dlls/shell32/Makefile.in 27 Oct 2002 10:27:18 -0000
@@ -27,7 +27,6 @@
iconcache.c \
memorystream.c \
pidl.c \
- shell.c \
shell32_main.c \
shelllink.c \
shellole.c \
@@ -50,6 +49,7 @@
RC_SRCS= shres.rc
RC_SRCS16 = version16.rc
+C_SRCS16 = shell.c
SUBDIRS = tests
Index: dlls/shell32/shell.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/shell.c,v
retrieving revision 1.48
diff -u -r1.48 shell.c
--- dlls/shell32/shell.c 25 Oct 2002 19:26:46 -0000 1.48
+++ dlls/shell32/shell.c 27 Oct 2002 10:27:32 -0000
@@ -2,6 +2,7 @@
* Shell Library Functions
*
* Copyright 1998 Marcus Meissner
+ * Copyright 2000 Juergen Schmied
* Copyright 2002 Eric Pouech
*
* This library is free software; you can redistribute it and/or
@@ -540,4 +541,115 @@
break;
}
return ret;
+}
+
+
+/* 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 == (HKEY)1) *hkey = HKEY_CLASSES_ROOT;
+}
+
+/******************************************************************************
+ * RegOpenKey [SHELL.1]
+ */
+DWORD WINAPI RegOpenKey16( HKEY hkey, LPCSTR name, PHKEY retkey )
+{
+ fix_win16_hkey( &hkey );
+ return RegOpenKeyA( hkey, name, retkey );
+}
+
+/******************************************************************************
+ * RegCreateKey [SHELL.2]
+ */
+DWORD WINAPI RegCreateKey16( HKEY hkey, LPCSTR name, PHKEY 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 );
+}
+
+
+/*************************************************************************
+ * ShellExecute [SHELL.20]
+ */
+HINSTANCE16 WINAPI ShellExecute16( HWND16 hWnd, LPCSTR lpOperation,
+ LPCSTR lpFile, LPCSTR lpParameters,
+ LPCSTR lpDirectory, INT16 iShowCmd )
+{
+ SHELLEXECUTEINFOA sei;
+ HANDLE hProcess = 0;
+
+ sei.cbSize = sizeof(sei);
+ sei.fMask = 0;
+ sei.hwnd = HWND_32(hWnd);
+ sei.lpVerb = lpOperation;
+ sei.lpFile = lpFile;
+ sei.lpParameters = lpParameters;
+ sei.lpDirectory = lpDirectory;
+ sei.nShow = iShowCmd;
+ sei.lpIDList = 0;
+ sei.lpClass = 0;
+ sei.hkeyClass = 0;
+ sei.dwHotKey = 0;
+ sei.hProcess = hProcess;
+
+ ShellExecuteExA32 (&sei, FALSE);
+ return (HINSTANCE16)sei.hInstApp;
}
Index: dlls/shell32/shell32_main.h
===================================================================
RCS file: /home/wine/wine/dlls/shell32/shell32_main.h,v
retrieving revision 1.54
diff -u -r1.54 shell32_main.h
--- dlls/shell32/shell32_main.h 17 Oct 2002 16:43:44 -0000 1.54
+++ dlls/shell32/shell32_main.h 27 Oct 2002 10:27:51 -0000
@@ -201,4 +201,7 @@
#define HICON_32(h16) ((HICON)(ULONG_PTR)(h16))
#define HINSTANCE_32(h16) ((HINSTANCE)(ULONG_PTR)(h16))
+/* needed by 16-bit shell code in shell.c */
+BOOL WINAPI ShellExecuteExA32 (LPSHELLEXECUTEINFOA sei, BOOL is32);
+
#endif
Index: dlls/shell32/shellreg.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/shellreg.c,v
retrieving revision 1.14
diff -u -r1.14 shellreg.c
--- dlls/shell32/shellreg.c 3 Oct 2002 19:46:27 -0000 1.14
+++ dlls/shell32/shellreg.c 27 Oct 2002 10:27:54 -0000
@@ -147,86 +147,3 @@
TRACE("0x%04x\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 == (HKEY)1) *hkey = HKEY_CLASSES_ROOT;
-}
-
-/******************************************************************************
- * RegOpenKey [SHELL.1]
- */
-DWORD WINAPI RegOpenKey16( HKEY hkey, LPCSTR name, PHKEY retkey )
-{
- fix_win16_hkey( &hkey );
- return RegOpenKeyA( hkey, name, retkey );
-}
-
-/******************************************************************************
- * RegCreateKey [SHELL.2]
- */
-DWORD WINAPI RegCreateKey16( HKEY hkey, LPCSTR name, PHKEY 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 );
-}
Index: dlls/shell32/shlexec.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/shlexec.c,v
retrieving revision 1.9
diff -u -r1.9 shlexec.c
--- dlls/shell32/shlexec.c 17 Oct 2002 16:43:44 -0000 1.9
+++ dlls/shell32/shlexec.c 27 Oct 2002 10:28:35 -0000
@@ -674,35 +674,6 @@
return TRUE;
}
-
-/*************************************************************************
- * ShellExecute [SHELL.20]
- */
-HINSTANCE16 WINAPI ShellExecute16( HWND16 hWnd, LPCSTR lpOperation,
- LPCSTR lpFile, LPCSTR lpParameters,
- LPCSTR lpDirectory, INT16 iShowCmd )
-{
- SHELLEXECUTEINFOA sei;
- HANDLE hProcess = 0;
-
- sei.cbSize = sizeof(sei);
- sei.fMask = 0;
- sei.hwnd = HWND_32(hWnd);
- sei.lpVerb = lpOperation;
- sei.lpFile = lpFile;
- sei.lpParameters = lpParameters;
- sei.lpDirectory = lpDirectory;
- sei.nShow = iShowCmd;
- sei.lpIDList = 0;
- sei.lpClass = 0;
- sei.hkeyClass = 0;
- sei.dwHotKey = 0;
- sei.hProcess = hProcess;
-
- ShellExecuteExA32 (&sei, FALSE);
- return (HINSTANCE16)sei.hInstApp;
-}
-
/*************************************************************************
* ShellExecuteA [SHELL32.290]
*/
More information about the wine-patches
mailing list