Commit d586dc99 authored by Alexandre Julliard's avatar Alexandre Julliard

Replaced VERSION_* calls by exported API equivalents.

parent 198746d8
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include "ntddk.h" #include "ntddk.h"
#include "ntsecapi.h" #include "ntsecapi.h"
#include "debugtools.h" #include "debugtools.h"
#include "winversion.h"
DEFAULT_DEBUG_CHANNEL(advapi); DEFAULT_DEBUG_CHANNEL(advapi);
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include "winuser.h" #include "winuser.h"
#include "winerror.h" #include "winerror.h"
#include "debugtools.h" #include "debugtools.h"
#include "winversion.h"
#include "imm.h" #include "imm.h"
DEFAULT_DEBUG_CHANNEL(imm); DEFAULT_DEBUG_CHANNEL(imm);
...@@ -222,19 +221,20 @@ BOOL WINAPI ImmGetCompositionFontW(HIMC hIMC, LPLOGFONTW lplf) ...@@ -222,19 +221,20 @@ BOOL WINAPI ImmGetCompositionFontW(HIMC hIMC, LPLOGFONTW lplf)
LONG WINAPI ImmGetCompositionStringA( LONG WINAPI ImmGetCompositionStringA(
HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen) HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen)
{ {
OSVERSIONINFOA version;
FIXME("(0x%08x, %ld, %p, %ld): stub\n", FIXME("(0x%08x, %ld, %p, %ld): stub\n",
hIMC, dwIndex, lpBuf, dwBufLen hIMC, dwIndex, lpBuf, dwBufLen
); );
SetLastError(ERROR_CALL_NOT_IMPLEMENTED); SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
switch(VERSION_GetVersion()) GetVersionExA( &version );
{ switch(version.dwPlatformId)
default: {
FIXME("%s not supported",VERSION_GetVersionName()); case VER_PLATFORM_WIN32_WINDOWS: return -1;
case WIN95: case VER_PLATFORM_WIN32_NT: return 0;
return 0xffffffff; default:
case NT40: FIXME("%ld not supported",version.dwPlatformId);
return 0; return -1;
} }
} }
/*********************************************************************** /***********************************************************************
...@@ -244,19 +244,20 @@ LONG WINAPI ImmGetCompositionStringW( ...@@ -244,19 +244,20 @@ LONG WINAPI ImmGetCompositionStringW(
HIMC hIMC, DWORD dwIndex, HIMC hIMC, DWORD dwIndex,
LPVOID lpBuf, DWORD dwBufLen) LPVOID lpBuf, DWORD dwBufLen)
{ {
OSVERSIONINFOA version;
FIXME("(0x%08x, %ld, %p, %ld): stub\n", FIXME("(0x%08x, %ld, %p, %ld): stub\n",
hIMC, dwIndex, lpBuf, dwBufLen hIMC, dwIndex, lpBuf, dwBufLen
); );
SetLastError(ERROR_CALL_NOT_IMPLEMENTED); SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
switch(VERSION_GetVersion()) GetVersionExA( &version );
{ switch(version.dwPlatformId)
default: {
FIXME("%s not supported",VERSION_GetVersionName()); case VER_PLATFORM_WIN32_WINDOWS: return -1;
case WIN95: case VER_PLATFORM_WIN32_NT: return 0;
return 0xffffffff; default:
case NT40: FIXME("%ld not supported",version.dwPlatformId);
return 0; return -1;
} }
} }
/*********************************************************************** /***********************************************************************
...@@ -465,17 +466,20 @@ BOOL WINAPI ImmGetStatusWindowPos(HIMC hIMC, LPPOINT lpptPos) ...@@ -465,17 +466,20 @@ BOOL WINAPI ImmGetStatusWindowPos(HIMC hIMC, LPPOINT lpptPos)
*/ */
UINT WINAPI ImmGetVirtualKey(HWND hWnd) UINT WINAPI ImmGetVirtualKey(HWND hWnd)
{ {
OSVERSIONINFOA version;
FIXME("(0x%08x): stub\n", hWnd); FIXME("(0x%08x): stub\n", hWnd);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED); SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
switch(VERSION_GetVersion()) GetVersionExA( &version );
{ switch(version.dwPlatformId)
default: {
FIXME("%s not supported", VERSION_GetVersionName()); case VER_PLATFORM_WIN32_WINDOWS:
case WIN95:
return VK_PROCESSKEY; return VK_PROCESSKEY;
case NT40: case VER_PLATFORM_WIN32_NT:
return 0; return 0;
} default:
FIXME("%ld not supported",version.dwPlatformId);
return VK_PROCESSKEY;
}
} }
/*********************************************************************** /***********************************************************************
......
...@@ -14,9 +14,8 @@ ...@@ -14,9 +14,8 @@
#include "msacm.h" #include "msacm.h"
#include "msacmdrv.h" #include "msacmdrv.h"
#include "wineacm.h" #include "wineacm.h"
#include "winversion.h"
DEFAULT_DEBUG_CHANNEL(msacm) DEFAULT_DEBUG_CHANNEL(msacm);
/**********************************************************************/ /**********************************************************************/
...@@ -66,14 +65,17 @@ BOOL WINAPI MSACM32_LibMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReser ...@@ -66,14 +65,17 @@ BOOL WINAPI MSACM32_LibMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReser
*/ */
DWORD WINAPI acmGetVersion(void) DWORD WINAPI acmGetVersion(void)
{ {
switch (VERSION_GetVersion()) { OSVERSIONINFOA version;
default: GetVersionExA( &version );
FIXME("%s not supported\n", VERSION_GetVersionName()); switch(version.dwPlatformId)
case WIN95: {
return 0x04000000; /* 4.0.0 */ case VER_PLATFORM_WIN32_NT:
case NT40:
return 0x04000565; /* 4.0.1381 */ return 0x04000565; /* 4.0.1381 */
} default:
FIXME("%ld not supported",version.dwPlatformId);
case VER_PLATFORM_WIN32_WINDOWS:
return 0x04000000; /* 4.0.0 */
}
} }
/*********************************************************************** /***********************************************************************
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include "wingdi.h" #include "wingdi.h"
#include "winuser.h" #include "winuser.h"
#include "winerror.h" #include "winerror.h"
#include "winversion.h"
#include "heap.h" #include "heap.h"
#include "ldt.h" #include "ldt.h"
...@@ -105,19 +104,19 @@ HRESULT WINAPI GetActiveObject(REFCLSID rcid,LPVOID preserved,LPUNKNOWN *ppunk) ...@@ -105,19 +104,19 @@ HRESULT WINAPI GetActiveObject(REFCLSID rcid,LPVOID preserved,LPUNKNOWN *ppunk)
UINT WINAPI OaBuildVersion() UINT WINAPI OaBuildVersion()
{ {
FIXME("Please report to a.mohr@mailto.de if you get version error messages !\n"); FIXME("Please report to a.mohr@mailto.de if you get version error messages !\n");
switch(VERSION_GetVersion()) switch(GetVersion() & 0x8000ffff) /* mask off build number */
{ {
case WIN31: case 0x80000a03: /* WIN31 */
return MAKELONG(4049, 20); /* from Win32s 1.1e */ return MAKELONG(4049, 20); /* from Win32s 1.1e */
case WIN95: case 0x80000004: /* WIN95 */
return MAKELONG(4265, 30); return MAKELONG(4265, 30);
case WIN98: case 0x80000a04: /* WIN98 */
return MAKELONG(4275, 40); /* value of W98 SE; orig. W98 AFAIK has 4265, 30 just as W95 */ return MAKELONG(4275, 40); /* value of W98 SE; orig. W98 AFAIK has 4265, 30 just as W95 */
case NT351: case 0x00003303: /* NT351 */
return MAKELONG(4265, 30); /* value borrowed from Win95 */ return MAKELONG(4265, 30); /* value borrowed from Win95 */
case NT40: case 0x00000004: /* NT40 */
return MAKELONG(4122, 20); /* ouch ! Quite old, I guess */ return MAKELONG(4122, 20); /* ouch ! Quite old, I guess */
default: default:
ERR("Version value not known yet. Please investigate it !\n"); ERR("Version value not known yet. Please investigate it !\n");
return 0x0; return 0x0;
} }
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
#include "heap.h" #include "heap.h"
#include "wine/obj_base.h" #include "wine/obj_base.h"
#include "debugtools.h" #include "debugtools.h"
#include "winversion.h"
#include "typelib.h" #include "typelib.h"
DEFAULT_DEBUG_CHANNEL(ole); DEFAULT_DEBUG_CHANNEL(ole);
...@@ -294,15 +293,15 @@ HRESULT WINAPI UnRegisterTypeLib( ...@@ -294,15 +293,15 @@ HRESULT WINAPI UnRegisterTypeLib(
DWORD WINAPI OaBuildVersion16(void) DWORD WINAPI OaBuildVersion16(void)
{ {
FIXME("Please report to a.mohr@mailto.de if you get version error messages !\n"); FIXME("Please report to a.mohr@mailto.de if you get version error messages !\n");
switch(VERSION_GetVersion()) switch(GetVersion() & 0x8000ffff) /* mask off build number */
{ {
case WIN31: case 0x80000a03: /* WIN31 */
return MAKELONG(3027, 3); /* WfW 3.11 */ return MAKELONG(3027, 3); /* WfW 3.11 */
case WIN95: case 0x80000004: /* WIN95 */
return MAKELONG(700, 23); /* Win95A */ return MAKELONG(700, 23); /* Win95A */
case WIN98: case 0x80000a04: /* WIN98 */
return MAKELONG(3024, 10); /* W98 SE */ return MAKELONG(3024, 10); /* W98 SE */
default: default:
FIXME_(ole)("Version value not known yet. Please investigate it !"); FIXME_(ole)("Version value not known yet. Please investigate it !");
return 0; return 0;
} }
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include "debugtools.h" #include "debugtools.h"
#include "pidl.h" #include "pidl.h"
#include "shell32_main.h" #include "shell32_main.h"
#include "winversion.h"
#include "wine/undocshell.h" #include "wine/undocshell.h"
DEFAULT_DEBUG_CHANNEL(shell); DEFAULT_DEBUG_CHANNEL(shell);
...@@ -274,7 +273,7 @@ void WINAPI SHChangeNotifyA (LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVO ...@@ -274,7 +273,7 @@ void WINAPI SHChangeNotifyA (LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVO
*/ */
void WINAPI SHChangeNotifyAW (LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2) void WINAPI SHChangeNotifyAW (LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2)
{ {
if(VERSION_OsIsUnicode()) if(SHELL_OsIsUnicode())
SHChangeNotifyW (wEventId, uFlags, dwItem1, dwItem2); SHChangeNotifyW (wEventId, uFlags, dwItem1, dwItem2);
else else
SHChangeNotifyA (wEventId, uFlags, dwItem1, dwItem2); SHChangeNotifyA (wEventId, uFlags, dwItem1, dwItem2);
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include "module.h" #include "module.h"
#include "heap.h" #include "heap.h"
#include "debugtools.h" #include "debugtools.h"
#include "winversion.h"
#include "shellapi.h" #include "shellapi.h"
#include "shlguid.h" #include "shlguid.h"
...@@ -808,7 +807,7 @@ INT WINAPI Shell_GetCachedImageIndexW(LPCWSTR szPath, INT nIndex, BOOL bSimulate ...@@ -808,7 +807,7 @@ INT WINAPI Shell_GetCachedImageIndexW(LPCWSTR szPath, INT nIndex, BOOL bSimulate
} }
INT WINAPI Shell_GetCachedImageIndexAW(LPCVOID szPath, INT nIndex, BOOL bSimulateDoc) INT WINAPI Shell_GetCachedImageIndexAW(LPCVOID szPath, INT nIndex, BOOL bSimulateDoc)
{ if( VERSION_OsIsUnicode()) { if( SHELL_OsIsUnicode())
return Shell_GetCachedImageIndexW(szPath, nIndex, bSimulateDoc); return Shell_GetCachedImageIndexW(szPath, nIndex, bSimulateDoc);
return Shell_GetCachedImageIndexA(szPath, nIndex, bSimulateDoc); return Shell_GetCachedImageIndexA(szPath, nIndex, bSimulateDoc);
} }
...@@ -817,7 +816,7 @@ INT WINAPI Shell_GetCachedImageIndexAW(LPCVOID szPath, INT nIndex, BOOL bSimulat ...@@ -817,7 +816,7 @@ INT WINAPI Shell_GetCachedImageIndexAW(LPCVOID szPath, INT nIndex, BOOL bSimulat
* ExtractIconEx [shell32.189] * ExtractIconEx [shell32.189]
*/ */
HICON WINAPI ExtractIconExAW ( LPCVOID lpszFile, INT nIconIndex, HICON * phiconLarge, HICON * phiconSmall, UINT nIcons ) HICON WINAPI ExtractIconExAW ( LPCVOID lpszFile, INT nIconIndex, HICON * phiconLarge, HICON * phiconSmall, UINT nIcons )
{ if (VERSION_OsIsUnicode()) { if (SHELL_OsIsUnicode())
return ExtractIconExW ( lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons); return ExtractIconExW ( lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons);
return ExtractIconExA ( lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons); return ExtractIconExA ( lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons);
} }
......
...@@ -17,15 +17,14 @@ ...@@ -17,15 +17,14 @@
#include "shlguid.h" #include "shlguid.h"
#include "winerror.h" #include "winerror.h"
#include "winnls.h" #include "winnls.h"
#include "winversion.h"
#include "shell32_main.h" #include "shell32_main.h"
#include "shellapi.h" #include "shellapi.h"
#include "pidl.h" #include "pidl.h"
#include "wine/undocshell.h" #include "wine/undocshell.h"
DEFAULT_DEBUG_CHANNEL(pidl) DEFAULT_DEBUG_CHANNEL(pidl);
DECLARE_DEBUG_CHANNEL(shell) DECLARE_DEBUG_CHANNEL(shell);
void pdump (LPCITEMIDLIST pidl) void pdump (LPCITEMIDLIST pidl)
{ {
...@@ -316,7 +315,7 @@ HRESULT WINAPI SHILCreateFromPathW (LPCWSTR path, LPITEMIDLIST * ppidl, DWORD * ...@@ -316,7 +315,7 @@ HRESULT WINAPI SHILCreateFromPathW (LPCWSTR path, LPITEMIDLIST * ppidl, DWORD *
} }
HRESULT WINAPI SHILCreateFromPathAW (LPCVOID path, LPITEMIDLIST * ppidl, DWORD * attributes) HRESULT WINAPI SHILCreateFromPathAW (LPCVOID path, LPITEMIDLIST * ppidl, DWORD * attributes)
{ {
if ( VERSION_OsIsUnicode()) if ( SHELL_OsIsUnicode())
return SHILCreateFromPathW (path, ppidl, attributes); return SHILCreateFromPathW (path, ppidl, attributes);
return SHILCreateFromPathA (path, ppidl, attributes); return SHILCreateFromPathA (path, ppidl, attributes);
} }
...@@ -727,7 +726,7 @@ LPITEMIDLIST WINAPI ILCreateFromPathW (LPCWSTR path) ...@@ -727,7 +726,7 @@ LPITEMIDLIST WINAPI ILCreateFromPathW (LPCWSTR path)
} }
LPITEMIDLIST WINAPI ILCreateFromPathAW (LPCVOID path) LPITEMIDLIST WINAPI ILCreateFromPathAW (LPCVOID path)
{ {
if ( VERSION_OsIsUnicode()) if ( SHELL_OsIsUnicode())
return ILCreateFromPathW (path); return ILCreateFromPathW (path);
return ILCreateFromPathA (path); return ILCreateFromPathA (path);
} }
...@@ -772,7 +771,7 @@ LPITEMIDLIST WINAPI SHSimpleIDListFromPathW (LPCWSTR lpszPath) ...@@ -772,7 +771,7 @@ LPITEMIDLIST WINAPI SHSimpleIDListFromPathW (LPCWSTR lpszPath)
LPITEMIDLIST WINAPI SHSimpleIDListFromPathAW (LPCVOID lpszPath) LPITEMIDLIST WINAPI SHSimpleIDListFromPathAW (LPCVOID lpszPath)
{ {
if ( VERSION_OsIsUnicode()) if ( SHELL_OsIsUnicode())
return SHSimpleIDListFromPathW (lpszPath); return SHSimpleIDListFromPathW (lpszPath);
return SHSimpleIDListFromPathA (lpszPath); return SHSimpleIDListFromPathA (lpszPath);
} }
...@@ -1064,7 +1063,7 @@ BOOL WINAPI SHGetPathFromIDListAW(LPCITEMIDLIST pidl,LPVOID pszPath) ...@@ -1064,7 +1063,7 @@ BOOL WINAPI SHGetPathFromIDListAW(LPCITEMIDLIST pidl,LPVOID pszPath)
{ {
TRACE_(shell)("(pidl=%p,%p)\n",pidl,pszPath); TRACE_(shell)("(pidl=%p,%p)\n",pidl,pszPath);
if (VERSION_OsIsUnicode()) if (SHELL_OsIsUnicode())
return SHGetPathFromIDListW(pidl,pszPath); return SHGetPathFromIDListW(pidl,pszPath);
return SHGetPathFromIDListA(pidl,pszPath); return SHGetPathFromIDListA(pidl,pszPath);
} }
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include "debugtools.h" #include "debugtools.h"
#include "winreg.h" #include "winreg.h"
#include "authors.h" #include "authors.h"
#include "winversion.h"
#include "shellapi.h" #include "shellapi.h"
#include "pidl.h" #include "pidl.h"
...@@ -296,7 +295,7 @@ DWORD WINAPI SHGetFileInfoAW( ...@@ -296,7 +295,7 @@ DWORD WINAPI SHGetFileInfoAW(
UINT sizeofpsfi, UINT sizeofpsfi,
UINT flags) UINT flags)
{ {
if(VERSION_OsIsUnicode()) if(SHELL_OsIsUnicode())
return SHGetFileInfoW(path, dwFileAttributes, psfi, sizeofpsfi, flags ); return SHGetFileInfoW(path, dwFileAttributes, psfi, sizeofpsfi, flags );
return SHGetFileInfoA(path, dwFileAttributes, psfi, sizeofpsfi, flags ); return SHGetFileInfoA(path, dwFileAttributes, psfi, sizeofpsfi, flags );
} }
......
...@@ -164,4 +164,11 @@ void FreeChangeNotifications(void); ...@@ -164,4 +164,11 @@ void FreeChangeNotifications(void);
/* file operation */ /* file operation */
BOOL SHELL_DeleteDirectoryA(LPCSTR pszDir, BOOL bShowUI); BOOL SHELL_DeleteDirectoryA(LPCSTR pszDir, BOOL bShowUI);
inline static BOOL SHELL_OsIsUnicode(void)
{
/* if high-bit of version is 0, we are emulating NT */
return !(GetVersion() & 0x80000000);
}
#endif #endif
...@@ -18,14 +18,13 @@ ...@@ -18,14 +18,13 @@
#include "wine/obj_extracticon.h" #include "wine/obj_extracticon.h"
#include "shlguid.h" #include "shlguid.h"
#include "winversion.h"
#include "winreg.h" #include "winreg.h"
#include "winerror.h" #include "winerror.h"
#include "debugtools.h" #include "debugtools.h"
#include "shell32_main.h" #include "shell32_main.h"
DEFAULT_DEBUG_CHANNEL(shell) DEFAULT_DEBUG_CHANNEL(shell);
DWORD WINAPI SHCLSIDFromStringA (LPSTR clsid, CLSID *id); DWORD WINAPI SHCLSIDFromStringA (LPSTR clsid, CLSID *id);
extern IShellFolder * IShellFolder_Constructor( extern IShellFolder * IShellFolder_Constructor(
...@@ -135,7 +134,7 @@ DWORD WINAPI SHCLSIDFromStringW (LPWSTR clsid, CLSID *id) ...@@ -135,7 +134,7 @@ DWORD WINAPI SHCLSIDFromStringW (LPWSTR clsid, CLSID *id)
} }
DWORD WINAPI SHCLSIDFromStringAW (LPVOID clsid, CLSID *id) DWORD WINAPI SHCLSIDFromStringAW (LPVOID clsid, CLSID *id)
{ {
if (VERSION_OsIsUnicode()) if (SHELL_OsIsUnicode())
return SHCLSIDFromStringW (clsid, id); return SHCLSIDFromStringW (clsid, id);
return SHCLSIDFromStringA (clsid, id); return SHCLSIDFromStringA (clsid, id);
} }
...@@ -587,7 +586,7 @@ UINT WINAPI DragQueryFileA( ...@@ -587,7 +586,7 @@ UINT WINAPI DragQueryFileA(
} }
} }
i = lstrlenA(lpDrop); i = strlen(lpDrop);
i++; i++;
if (!lpszFile ) goto end; /* needed buffer size */ if (!lpszFile ) goto end; /* needed buffer size */
i = (lLength > i) ? i : lLength; i = (lLength > i) ? i : lLength;
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "winreg.h" #include "winreg.h"
#include "debugtools.h" #include "debugtools.h"
#include "winnls.h" #include "winnls.h"
#include "winversion.h"
#include "heap.h" #include "heap.h"
#include "shellapi.h" #include "shellapi.h"
...@@ -75,7 +74,7 @@ DWORD WINAPI ParseFieldW(LPCWSTR src, DWORD nField, LPWSTR dst, DWORD len) ...@@ -75,7 +74,7 @@ DWORD WINAPI ParseFieldW(LPCWSTR src, DWORD nField, LPWSTR dst, DWORD len)
*/ */
DWORD WINAPI ParseFieldAW(LPCVOID src, DWORD nField, LPVOID dst, DWORD len) DWORD WINAPI ParseFieldAW(LPCVOID src, DWORD nField, LPVOID dst, DWORD len)
{ {
if (VERSION_OsIsUnicode()) if (SHELL_OsIsUnicode())
return ParseFieldW(src, nField, dst, len); return ParseFieldW(src, nField, dst, len);
return ParseFieldA(src, nField, dst, len); return ParseFieldA(src, nField, dst, len);
} }
...@@ -99,7 +98,7 @@ BOOL WINAPI GetFileNameFromBrowse( ...@@ -99,7 +98,7 @@ BOOL WINAPI GetFileNameFromBrowse(
/* puts up a Open Dialog and requests input into targetbuf */ /* puts up a Open Dialog and requests input into targetbuf */
/* OFN_HIDEREADONLY|OFN_NOCHANGEDIR|OFN_FILEMUSTEXIST|OFN_unknown */ /* OFN_HIDEREADONLY|OFN_NOCHANGEDIR|OFN_FILEMUSTEXIST|OFN_unknown */
lstrcpyA(lpstrFile,"x:\\dummy.exe"); strcpy(lpstrFile,"x:\\dummy.exe");
return 1; return 1;
} }
...@@ -485,7 +484,7 @@ HRESULT WINAPI SHRunControlPanel (DWORD x, DWORD z) ...@@ -485,7 +484,7 @@ HRESULT WINAPI SHRunControlPanel (DWORD x, DWORD z)
* *
*/ */
BOOL WINAPI ShellExecuteExAW (LPVOID sei) BOOL WINAPI ShellExecuteExAW (LPVOID sei)
{ if (VERSION_OsIsUnicode()) { if (SHELL_OsIsUnicode())
return ShellExecuteExW (sei); return ShellExecuteExW (sei);
return ShellExecuteExA (sei); return ShellExecuteExA (sei);
} }
...@@ -941,7 +940,7 @@ HRESULT WINAPI DoEnvironmentSubstW(LPWSTR x, LPWSTR y) ...@@ -941,7 +940,7 @@ HRESULT WINAPI DoEnvironmentSubstW(LPWSTR x, LPWSTR y)
*/ */
HRESULT WINAPI DoEnvironmentSubstAW(LPVOID x, LPVOID y) HRESULT WINAPI DoEnvironmentSubstAW(LPVOID x, LPVOID y)
{ {
if (VERSION_OsIsUnicode()) if (SHELL_OsIsUnicode())
return DoEnvironmentSubstW(x, y); return DoEnvironmentSubstW(x, y);
return DoEnvironmentSubstA(x, y); return DoEnvironmentSubstA(x, y);
} }
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include <ctype.h> #include <ctype.h>
#include "debugtools.h" #include "debugtools.h"
#include "winnls.h" #include "winnls.h"
#include "winversion.h"
#include "winreg.h" #include "winreg.h"
#include "shlobj.h" #include "shlobj.h"
...@@ -33,7 +32,7 @@ BOOL WINAPI PathAppendAW( ...@@ -33,7 +32,7 @@ BOOL WINAPI PathAppendAW(
LPVOID lpszPath1, LPVOID lpszPath1,
LPCVOID lpszPath2) LPCVOID lpszPath2)
{ {
if (VERSION_OsIsUnicode()) if (SHELL_OsIsUnicode())
return PathAppendW(lpszPath1, lpszPath2); return PathAppendW(lpszPath1, lpszPath2);
return PathAppendA(lpszPath1, lpszPath2); return PathAppendA(lpszPath1, lpszPath2);
} }
...@@ -46,7 +45,7 @@ LPVOID WINAPI PathCombineAW( ...@@ -46,7 +45,7 @@ LPVOID WINAPI PathCombineAW(
LPCVOID lpszDir, LPCVOID lpszDir,
LPCVOID lpszFile) LPCVOID lpszFile)
{ {
if (VERSION_OsIsUnicode()) if (SHELL_OsIsUnicode())
return PathCombineW( szDest, lpszDir, lpszFile ); return PathCombineW( szDest, lpszDir, lpszFile );
return PathCombineA( szDest, lpszDir, lpszFile ); return PathCombineA( szDest, lpszDir, lpszFile );
} }
...@@ -56,7 +55,7 @@ LPVOID WINAPI PathCombineAW( ...@@ -56,7 +55,7 @@ LPVOID WINAPI PathCombineAW(
*/ */
LPVOID WINAPI PathAddBackslashAW(LPVOID lpszPath) LPVOID WINAPI PathAddBackslashAW(LPVOID lpszPath)
{ {
if(VERSION_OsIsUnicode()) if(SHELL_OsIsUnicode())
return PathAddBackslashW(lpszPath); return PathAddBackslashW(lpszPath);
return PathAddBackslashA(lpszPath); return PathAddBackslashA(lpszPath);
} }
...@@ -66,7 +65,7 @@ LPVOID WINAPI PathAddBackslashAW(LPVOID lpszPath) ...@@ -66,7 +65,7 @@ LPVOID WINAPI PathAddBackslashAW(LPVOID lpszPath)
*/ */
LPVOID WINAPI PathBuildRootAW(LPVOID lpszPath, int drive) LPVOID WINAPI PathBuildRootAW(LPVOID lpszPath, int drive)
{ {
if(VERSION_OsIsUnicode()) if(SHELL_OsIsUnicode())
return PathBuildRootW(lpszPath, drive); return PathBuildRootW(lpszPath, drive);
return PathBuildRootA(lpszPath, drive); return PathBuildRootA(lpszPath, drive);
} }
...@@ -80,7 +79,7 @@ LPVOID WINAPI PathBuildRootAW(LPVOID lpszPath, int drive) ...@@ -80,7 +79,7 @@ LPVOID WINAPI PathBuildRootAW(LPVOID lpszPath, int drive)
*/ */
LPVOID WINAPI PathFindFileNameAW(LPCVOID lpszPath) LPVOID WINAPI PathFindFileNameAW(LPCVOID lpszPath)
{ {
if(VERSION_OsIsUnicode()) if(SHELL_OsIsUnicode())
return PathFindFileNameW(lpszPath); return PathFindFileNameW(lpszPath);
return PathFindFileNameA(lpszPath); return PathFindFileNameA(lpszPath);
} }
...@@ -90,18 +89,44 @@ LPVOID WINAPI PathFindFileNameAW(LPCVOID lpszPath) ...@@ -90,18 +89,44 @@ LPVOID WINAPI PathFindFileNameAW(LPCVOID lpszPath)
*/ */
LPVOID WINAPI PathFindExtensionAW(LPCVOID lpszPath) LPVOID WINAPI PathFindExtensionAW(LPCVOID lpszPath)
{ {
if (VERSION_OsIsUnicode()) if (SHELL_OsIsUnicode())
return PathFindExtensionW(lpszPath); return PathFindExtensionW(lpszPath);
return PathFindExtensionA(lpszPath); return PathFindExtensionA(lpszPath);
} }
/************************************************************************* /*************************************************************************
* PathGetExtensionA [internal]
*
* NOTES
* exported by ordinal
* return value points to the first char after the dot
*/
static LPSTR PathGetExtensionA(LPCSTR lpszPath)
{
TRACE("(%s)\n",lpszPath);
lpszPath = PathFindExtensionA(lpszPath);
return (LPSTR)(*lpszPath?(lpszPath+1):lpszPath);
}
/*************************************************************************
* PathGetExtensionW [internal]
*/
static LPWSTR PathGetExtensionW(LPCWSTR lpszPath)
{
TRACE("(%s)\n",debugstr_w(lpszPath));
lpszPath = PathFindExtensionW(lpszPath);
return (LPWSTR)(*lpszPath?(lpszPath+1):lpszPath);
}
/*************************************************************************
* PathGetExtensionAW [SHELL32.158] * PathGetExtensionAW [SHELL32.158]
*/ */
LPVOID WINAPI PathGetExtensionAW(LPCVOID lpszPath) LPVOID WINAPI PathGetExtensionAW(LPCVOID lpszPath)
{ {
if (VERSION_OsIsUnicode()) if (SHELL_OsIsUnicode())
return PathGetExtensionW(lpszPath); return PathGetExtensionW(lpszPath);
return PathGetExtensionA(lpszPath); return PathGetExtensionA(lpszPath);
} }
...@@ -111,7 +136,7 @@ LPVOID WINAPI PathGetExtensionAW(LPCVOID lpszPath) ...@@ -111,7 +136,7 @@ LPVOID WINAPI PathGetExtensionAW(LPCVOID lpszPath)
*/ */
LPVOID WINAPI PathGetArgsAW(LPVOID lpszPath) LPVOID WINAPI PathGetArgsAW(LPVOID lpszPath)
{ {
if (VERSION_OsIsUnicode()) if (SHELL_OsIsUnicode())
return PathGetArgsW(lpszPath); return PathGetArgsW(lpszPath);
return PathGetArgsA(lpszPath); return PathGetArgsA(lpszPath);
} }
...@@ -121,7 +146,7 @@ LPVOID WINAPI PathGetArgsAW(LPVOID lpszPath) ...@@ -121,7 +146,7 @@ LPVOID WINAPI PathGetArgsAW(LPVOID lpszPath)
*/ */
int WINAPI PathGetDriveNumberAW(LPVOID lpszPath) int WINAPI PathGetDriveNumberAW(LPVOID lpszPath)
{ {
if (VERSION_OsIsUnicode()) if (SHELL_OsIsUnicode())
return PathGetDriveNumberW(lpszPath); return PathGetDriveNumberW(lpszPath);
return PathGetDriveNumberA(lpszPath); return PathGetDriveNumberA(lpszPath);
} }
...@@ -131,7 +156,7 @@ int WINAPI PathGetDriveNumberAW(LPVOID lpszPath) ...@@ -131,7 +156,7 @@ int WINAPI PathGetDriveNumberAW(LPVOID lpszPath)
*/ */
BOOL WINAPI PathRemoveFileSpecAW(LPVOID lpszPath) BOOL WINAPI PathRemoveFileSpecAW(LPVOID lpszPath)
{ {
if (VERSION_OsIsUnicode()) if (SHELL_OsIsUnicode())
return PathRemoveFileSpecW(lpszPath); return PathRemoveFileSpecW(lpszPath);
return PathRemoveFileSpecA(lpszPath); return PathRemoveFileSpecA(lpszPath);
} }
...@@ -141,7 +166,7 @@ BOOL WINAPI PathRemoveFileSpecAW(LPVOID lpszPath) ...@@ -141,7 +166,7 @@ BOOL WINAPI PathRemoveFileSpecAW(LPVOID lpszPath)
*/ */
void WINAPI PathStripPathAW(LPVOID lpszPath) void WINAPI PathStripPathAW(LPVOID lpszPath)
{ {
if (VERSION_OsIsUnicode()) if (SHELL_OsIsUnicode())
return PathStripPathW(lpszPath); return PathStripPathW(lpszPath);
return PathStripPathA(lpszPath); return PathStripPathA(lpszPath);
} }
...@@ -151,7 +176,7 @@ void WINAPI PathStripPathAW(LPVOID lpszPath) ...@@ -151,7 +176,7 @@ void WINAPI PathStripPathAW(LPVOID lpszPath)
*/ */
BOOL WINAPI PathStripToRootAW(LPVOID lpszPath) BOOL WINAPI PathStripToRootAW(LPVOID lpszPath)
{ {
if (VERSION_OsIsUnicode()) if (SHELL_OsIsUnicode())
return PathStripToRootW(lpszPath); return PathStripToRootW(lpszPath);
return PathStripToRootA(lpszPath); return PathStripToRootA(lpszPath);
} }
...@@ -161,7 +186,7 @@ BOOL WINAPI PathStripToRootAW(LPVOID lpszPath) ...@@ -161,7 +186,7 @@ BOOL WINAPI PathStripToRootAW(LPVOID lpszPath)
*/ */
void WINAPI PathRemoveArgsAW(LPVOID lpszPath) void WINAPI PathRemoveArgsAW(LPVOID lpszPath)
{ {
if (VERSION_OsIsUnicode()) if (SHELL_OsIsUnicode())
PathRemoveArgsW(lpszPath); PathRemoveArgsW(lpszPath);
PathRemoveArgsA(lpszPath); PathRemoveArgsA(lpszPath);
} }
...@@ -171,7 +196,7 @@ void WINAPI PathRemoveArgsAW(LPVOID lpszPath) ...@@ -171,7 +196,7 @@ void WINAPI PathRemoveArgsAW(LPVOID lpszPath)
*/ */
void WINAPI PathRemoveExtensionAW(LPVOID lpszPath) void WINAPI PathRemoveExtensionAW(LPVOID lpszPath)
{ {
if (VERSION_OsIsUnicode()) if (SHELL_OsIsUnicode())
return PathRemoveExtensionW(lpszPath); return PathRemoveExtensionW(lpszPath);
return PathRemoveExtensionA(lpszPath); return PathRemoveExtensionA(lpszPath);
} }
...@@ -204,7 +229,7 @@ LPWSTR WINAPI PathGetShortPathW(LPWSTR lpszPath) ...@@ -204,7 +229,7 @@ LPWSTR WINAPI PathGetShortPathW(LPWSTR lpszPath)
*/ */
LPVOID WINAPI PathGetShortPathAW(LPVOID lpszPath) LPVOID WINAPI PathGetShortPathAW(LPVOID lpszPath)
{ {
if(VERSION_OsIsUnicode()) if(SHELL_OsIsUnicode())
return PathGetShortPathW(lpszPath); return PathGetShortPathW(lpszPath);
return PathGetShortPathA(lpszPath); return PathGetShortPathA(lpszPath);
} }
...@@ -214,7 +239,7 @@ LPVOID WINAPI PathGetShortPathAW(LPVOID lpszPath) ...@@ -214,7 +239,7 @@ LPVOID WINAPI PathGetShortPathAW(LPVOID lpszPath)
*/ */
void WINAPI PathRemoveBlanksAW(LPVOID str) void WINAPI PathRemoveBlanksAW(LPVOID str)
{ {
if(VERSION_OsIsUnicode()) if(SHELL_OsIsUnicode())
PathRemoveBlanksW(str); PathRemoveBlanksW(str);
PathRemoveBlanksA(str); PathRemoveBlanksA(str);
} }
...@@ -224,7 +249,7 @@ void WINAPI PathRemoveBlanksAW(LPVOID str) ...@@ -224,7 +249,7 @@ void WINAPI PathRemoveBlanksAW(LPVOID str)
*/ */
LPVOID WINAPI PathQuoteSpacesAW (LPVOID lpszPath) LPVOID WINAPI PathQuoteSpacesAW (LPVOID lpszPath)
{ {
if(VERSION_OsIsUnicode()) if(SHELL_OsIsUnicode())
return PathQuoteSpacesW(lpszPath); return PathQuoteSpacesW(lpszPath);
return PathQuoteSpacesA(lpszPath); return PathQuoteSpacesA(lpszPath);
} }
...@@ -234,7 +259,7 @@ LPVOID WINAPI PathQuoteSpacesAW (LPVOID lpszPath) ...@@ -234,7 +259,7 @@ LPVOID WINAPI PathQuoteSpacesAW (LPVOID lpszPath)
*/ */
VOID WINAPI PathUnquoteSpacesAW(LPVOID str) VOID WINAPI PathUnquoteSpacesAW(LPVOID str)
{ {
if(VERSION_OsIsUnicode()) if(SHELL_OsIsUnicode())
PathUnquoteSpacesW(str); PathUnquoteSpacesW(str);
else else
PathUnquoteSpacesA(str); PathUnquoteSpacesA(str);
...@@ -245,7 +270,7 @@ VOID WINAPI PathUnquoteSpacesAW(LPVOID str) ...@@ -245,7 +270,7 @@ VOID WINAPI PathUnquoteSpacesAW(LPVOID str)
*/ */
int WINAPI PathParseIconLocationAW (LPVOID lpszPath) int WINAPI PathParseIconLocationAW (LPVOID lpszPath)
{ {
if(VERSION_OsIsUnicode()) if(SHELL_OsIsUnicode())
return PathParseIconLocationW(lpszPath); return PathParseIconLocationW(lpszPath);
return PathParseIconLocationA(lpszPath); return PathParseIconLocationA(lpszPath);
} }
...@@ -258,7 +283,7 @@ int WINAPI PathParseIconLocationAW (LPVOID lpszPath) ...@@ -258,7 +283,7 @@ int WINAPI PathParseIconLocationAW (LPVOID lpszPath)
*/ */
BOOL WINAPI PathIsUNCAW (LPCVOID lpszPath) BOOL WINAPI PathIsUNCAW (LPCVOID lpszPath)
{ {
if (VERSION_OsIsUnicode()) if (SHELL_OsIsUnicode())
return PathIsUNCW( lpszPath ); return PathIsUNCW( lpszPath );
return PathIsUNCA( lpszPath ); return PathIsUNCA( lpszPath );
} }
...@@ -268,7 +293,7 @@ BOOL WINAPI PathIsUNCAW (LPCVOID lpszPath) ...@@ -268,7 +293,7 @@ BOOL WINAPI PathIsUNCAW (LPCVOID lpszPath)
*/ */
BOOL WINAPI PathIsRelativeAW (LPCVOID lpszPath) BOOL WINAPI PathIsRelativeAW (LPCVOID lpszPath)
{ {
if (VERSION_OsIsUnicode()) if (SHELL_OsIsUnicode())
return PathIsRelativeW( lpszPath ); return PathIsRelativeW( lpszPath );
return PathIsRelativeA( lpszPath ); return PathIsRelativeA( lpszPath );
} }
...@@ -278,17 +303,53 @@ BOOL WINAPI PathIsRelativeAW (LPCVOID lpszPath) ...@@ -278,17 +303,53 @@ BOOL WINAPI PathIsRelativeAW (LPCVOID lpszPath)
*/ */
BOOL WINAPI PathIsRootAW(LPCVOID lpszPath) BOOL WINAPI PathIsRootAW(LPCVOID lpszPath)
{ {
if (VERSION_OsIsUnicode()) if (SHELL_OsIsUnicode())
return PathIsRootW(lpszPath); return PathIsRootW(lpszPath);
return PathIsRootA(lpszPath); return PathIsRootA(lpszPath);
} }
/************************************************************************* /*************************************************************************
* PathIsExeA [internal]
*/
static BOOL PathIsExeA (LPCSTR lpszPath)
{
LPCSTR lpszExtension = PathGetExtensionA(lpszPath);
int i = 0;
static char * lpszExtensions[6] = {"exe", "com", "pid", "cmd", "bat", NULL };
TRACE("path=%s\n",lpszPath);
for(i=0; lpszExtensions[i]; i++)
if (!strcasecmp(lpszExtension,lpszExtensions[i])) return TRUE;
return FALSE;
}
/*************************************************************************
* PathIsExeW [internal]
*/
static BOOL PathIsExeW (LPCWSTR lpszPath)
{
LPCWSTR lpszExtension = PathGetExtensionW(lpszPath);
int i = 0;
static WCHAR lpszExtensions[6][4] =
{{'e','x','e','\0'}, {'c','o','m','\0'}, {'p','i','d','\0'},
{'c','m','d','\0'}, {'b','a','t','\0'}, {'\0'} };
TRACE("path=%s\n",debugstr_w(lpszPath));
for(i=0; lpszExtensions[i]; i++)
if (!strcmpiW(lpszExtension,lpszExtensions[i])) return TRUE;
return FALSE;
}
/*************************************************************************
* PathIsExeAW [SHELL32.43] * PathIsExeAW [SHELL32.43]
*/ */
BOOL WINAPI PathIsExeAW (LPCVOID path) BOOL WINAPI PathIsExeAW (LPCVOID path)
{ {
if (VERSION_OsIsUnicode()) if (SHELL_OsIsUnicode())
return PathIsExeW (path); return PathIsExeW (path);
return PathIsExeA(path); return PathIsExeA(path);
} }
...@@ -298,7 +359,7 @@ BOOL WINAPI PathIsExeAW (LPCVOID path) ...@@ -298,7 +359,7 @@ BOOL WINAPI PathIsExeAW (LPCVOID path)
*/ */
BOOL WINAPI PathIsDirectoryAW (LPCVOID lpszPath) BOOL WINAPI PathIsDirectoryAW (LPCVOID lpszPath)
{ {
if (VERSION_OsIsUnicode()) if (SHELL_OsIsUnicode())
return PathIsDirectoryW (lpszPath); return PathIsDirectoryW (lpszPath);
return PathIsDirectoryA (lpszPath); return PathIsDirectoryA (lpszPath);
} }
...@@ -308,7 +369,7 @@ BOOL WINAPI PathIsDirectoryAW (LPCVOID lpszPath) ...@@ -308,7 +369,7 @@ BOOL WINAPI PathIsDirectoryAW (LPCVOID lpszPath)
*/ */
BOOL WINAPI PathFileExistsAW (LPCVOID lpszPath) BOOL WINAPI PathFileExistsAW (LPCVOID lpszPath)
{ {
if (VERSION_OsIsUnicode()) if (SHELL_OsIsUnicode())
return PathFileExistsW (lpszPath); return PathFileExistsW (lpszPath);
return PathFileExistsA (lpszPath); return PathFileExistsA (lpszPath);
} }
...@@ -318,7 +379,7 @@ BOOL WINAPI PathFileExistsAW (LPCVOID lpszPath) ...@@ -318,7 +379,7 @@ BOOL WINAPI PathFileExistsAW (LPCVOID lpszPath)
*/ */
BOOL WINAPI PathMatchSpecAW(LPVOID name, LPVOID mask) BOOL WINAPI PathMatchSpecAW(LPVOID name, LPVOID mask)
{ {
if (VERSION_OsIsUnicode()) if (SHELL_OsIsUnicode())
return PathMatchSpecW( name, mask ); return PathMatchSpecW( name, mask );
return PathMatchSpecA( name, mask ); return PathMatchSpecA( name, mask );
} }
...@@ -328,7 +389,7 @@ BOOL WINAPI PathMatchSpecAW(LPVOID name, LPVOID mask) ...@@ -328,7 +389,7 @@ BOOL WINAPI PathMatchSpecAW(LPVOID name, LPVOID mask)
*/ */
BOOL WINAPI PathIsSameRootAW(LPCVOID lpszPath1, LPCVOID lpszPath2) BOOL WINAPI PathIsSameRootAW(LPCVOID lpszPath1, LPCVOID lpszPath2)
{ {
if (VERSION_OsIsUnicode()) if (SHELL_OsIsUnicode())
return PathIsSameRootW(lpszPath1, lpszPath2); return PathIsSameRootW(lpszPath1, lpszPath2);
return PathIsSameRootA(lpszPath1, lpszPath2); return PathIsSameRootA(lpszPath1, lpszPath2);
} }
...@@ -393,7 +454,7 @@ BOOL WINAPI PathMakeUniqueNameAW( ...@@ -393,7 +454,7 @@ BOOL WINAPI PathMakeUniqueNameAW(
LPCVOID lpszLongName, LPCVOID lpszLongName,
LPCVOID lpszPathName) LPCVOID lpszPathName)
{ {
if (VERSION_OsIsUnicode()) if (SHELL_OsIsUnicode())
return PathMakeUniqueNameW(lpszBuffer,dwBuffSize, lpszShortName,lpszLongName,lpszPathName); return PathMakeUniqueNameW(lpszBuffer,dwBuffSize, lpszShortName,lpszLongName,lpszPathName);
return PathMakeUniqueNameA(lpszBuffer,dwBuffSize, lpszShortName,lpszLongName,lpszPathName); return PathMakeUniqueNameA(lpszBuffer,dwBuffSize, lpszShortName,lpszLongName,lpszPathName);
} }
...@@ -425,7 +486,7 @@ BOOL WINAPI PathYetAnotherMakeUniqueNameA( ...@@ -425,7 +486,7 @@ BOOL WINAPI PathYetAnotherMakeUniqueNameA(
*/ */
BOOL WINAPI PathFindOnPathAW(LPVOID sFile, LPCVOID sOtherDirs) BOOL WINAPI PathFindOnPathAW(LPVOID sFile, LPCVOID sOtherDirs)
{ {
if (VERSION_OsIsUnicode()) if (SHELL_OsIsUnicode())
return PathFindOnPathW(sFile, sOtherDirs); return PathFindOnPathW(sFile, sOtherDirs);
return PathFindOnPathA(sFile, sOtherDirs); return PathFindOnPathA(sFile, sOtherDirs);
} }
...@@ -435,9 +496,8 @@ BOOL WINAPI PathFindOnPathAW(LPVOID sFile, LPCVOID sOtherDirs) ...@@ -435,9 +496,8 @@ BOOL WINAPI PathFindOnPathAW(LPVOID sFile, LPCVOID sOtherDirs)
*/ */
DWORD WINAPI PathCleanupSpecAW (LPVOID x, LPVOID y) DWORD WINAPI PathCleanupSpecAW (LPVOID x, LPVOID y)
{ {
if (VERSION_OsIsUnicode()) FIXME("(%p, %p) stub\n",x,y);
return PathCleanupSpecW(x,y); return TRUE;
return PathCleanupSpecA(x,y);
} }
/************************************************************************* /*************************************************************************
...@@ -463,7 +523,7 @@ BOOL WINAPI PathQualifyW(LPCWSTR pszPath) ...@@ -463,7 +523,7 @@ BOOL WINAPI PathQualifyW(LPCWSTR pszPath)
*/ */
BOOL WINAPI PathQualifyAW(LPCVOID pszPath) BOOL WINAPI PathQualifyAW(LPCVOID pszPath)
{ {
if (VERSION_OsIsUnicode()) if (SHELL_OsIsUnicode())
return PathQualifyW(pszPath); return PathQualifyW(pszPath);
return PathQualifyA(pszPath); return PathQualifyA(pszPath);
} }
...@@ -502,7 +562,7 @@ BOOL WINAPI PathResolveAW( ...@@ -502,7 +562,7 @@ BOOL WINAPI PathResolveAW(
LPCVOID *alpszPaths, LPCVOID *alpszPaths,
DWORD dwFlags) DWORD dwFlags)
{ {
if (VERSION_OsIsUnicode()) if (SHELL_OsIsUnicode())
return PathResolveW(lpszPath, (LPCWSTR*)alpszPaths, dwFlags); return PathResolveW(lpszPath, (LPCWSTR*)alpszPaths, dwFlags);
return PathResolveA(lpszPath, (LPCSTR*)alpszPaths, dwFlags); return PathResolveA(lpszPath, (LPCSTR*)alpszPaths, dwFlags);
} }
...@@ -518,7 +578,7 @@ HRESULT WINAPI PathProcessCommandA ( ...@@ -518,7 +578,7 @@ HRESULT WINAPI PathProcessCommandA (
{ {
FIXME("%s %p 0x%04lx 0x%04lx stub\n", FIXME("%s %p 0x%04lx 0x%04lx stub\n",
lpszPath, lpszBuff, dwBuffSize, dwFlags); lpszPath, lpszBuff, dwBuffSize, dwFlags);
lstrcpyA(lpszBuff, lpszPath); strcpy(lpszBuff, lpszPath);
return 0; return 0;
} }
...@@ -533,7 +593,7 @@ HRESULT WINAPI PathProcessCommandW ( ...@@ -533,7 +593,7 @@ HRESULT WINAPI PathProcessCommandW (
{ {
FIXME("(%s, %p, 0x%04lx, 0x%04lx) stub\n", FIXME("(%s, %p, 0x%04lx, 0x%04lx) stub\n",
debugstr_w(lpszPath), lpszBuff, dwBuffSize, dwFlags); debugstr_w(lpszPath), lpszBuff, dwBuffSize, dwFlags);
lstrcpyW(lpszBuff, lpszPath); strcpyW(lpszBuff, lpszPath);
return 0; return 0;
} }
...@@ -546,7 +606,7 @@ HRESULT WINAPI PathProcessCommandAW ( ...@@ -546,7 +606,7 @@ HRESULT WINAPI PathProcessCommandAW (
DWORD dwBuffSize, DWORD dwBuffSize,
DWORD dwFlags) DWORD dwFlags)
{ {
if (VERSION_OsIsUnicode()) if (SHELL_OsIsUnicode())
return PathProcessCommandW(lpszPath, lpszBuff, dwBuffSize, dwFlags); return PathProcessCommandW(lpszPath, lpszBuff, dwBuffSize, dwFlags);
return PathProcessCommandA(lpszPath, lpszBuff, dwBuffSize, dwFlags); return PathProcessCommandA(lpszPath, lpszBuff, dwBuffSize, dwFlags);
} }
...@@ -559,7 +619,7 @@ HRESULT WINAPI PathProcessCommandAW ( ...@@ -559,7 +619,7 @@ HRESULT WINAPI PathProcessCommandAW (
* PathSetDlgItemPathAW * PathSetDlgItemPathAW
*/ */
BOOL WINAPI PathSetDlgItemPathAW(HWND hDlg, int id, LPCVOID pszPath) BOOL WINAPI PathSetDlgItemPathAW(HWND hDlg, int id, LPCVOID pszPath)
{ if (VERSION_OsIsUnicode()) { if (SHELL_OsIsUnicode())
return PathSetDlgItemPathW(hDlg, id, pszPath); return PathSetDlgItemPathW(hDlg, id, pszPath);
return PathSetDlgItemPathA(hDlg, id, pszPath); return PathSetDlgItemPathA(hDlg, id, pszPath);
} }
...@@ -806,7 +866,7 @@ BOOL WINAPI SHGetSpecialFolderPathAW ( ...@@ -806,7 +866,7 @@ BOOL WINAPI SHGetSpecialFolderPathAW (
BOOL bCreate) BOOL bCreate)
{ {
if (VERSION_OsIsUnicode()) if (SHELL_OsIsUnicode())
return SHGetSpecialFolderPathW (hwndOwner, szPath, csidl, bCreate); return SHGetSpecialFolderPathW (hwndOwner, szPath, csidl, bCreate);
return SHGetSpecialFolderPathA (hwndOwner, szPath, csidl, bCreate); return SHGetSpecialFolderPathA (hwndOwner, szPath, csidl, bCreate);
} }
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include "winreg.h" #include "winreg.h"
#include "debugtools.h" #include "debugtools.h"
#include "winnls.h" #include "winnls.h"
#include "winversion.h"
#include "heap.h" #include "heap.h"
#include "shellapi.h" #include "shellapi.h"
......
...@@ -6,10 +6,10 @@ ...@@ -6,10 +6,10 @@
#include "winnls.h" #include "winnls.h"
#include "winerror.h" #include "winerror.h"
#include "debugtools.h" #include "debugtools.h"
#include "winversion.h"
#include "heap.h" #include "heap.h"
#include "shellapi.h" #include "shellapi.h"
#include "shell32_main.h"
#include "wine/undocshell.h" #include "wine/undocshell.h"
#include "wine/unicode.h" #include "wine/unicode.h"
...@@ -37,7 +37,7 @@ HRESULT WINAPI StrRetToStrNW (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST ...@@ -37,7 +37,7 @@ HRESULT WINAPI StrRetToStrNW (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST
HRESULT WINAPI StrRetToStrNAW (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl) HRESULT WINAPI StrRetToStrNAW (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl)
{ {
if(VERSION_OsIsUnicode()) if(SHELL_OsIsUnicode())
return StrRetToStrNW (dest, len, src, pidl); return StrRetToStrNW (dest, len, src, pidl);
return StrRetToStrNA (dest, len, src, pidl); return StrRetToStrNA (dest, len, src, pidl);
} }
...@@ -61,15 +61,13 @@ int WINAPI StrToOleStrW (LPWSTR lpWideCharStr, LPCWSTR lpWString) ...@@ -61,15 +61,13 @@ int WINAPI StrToOleStrW (LPWSTR lpWideCharStr, LPCWSTR lpWString)
TRACE("(%p, %p %s)\n", TRACE("(%p, %p %s)\n",
lpWideCharStr, lpWString, debugstr_w(lpWString)); lpWideCharStr, lpWString, debugstr_w(lpWString));
if (lstrcpyW (lpWideCharStr, lpWString )) strcpyW (lpWideCharStr, lpWString );
{ return lstrlenW (lpWideCharStr); return strlenW(lpWideCharStr);
}
return 0;
} }
BOOL WINAPI StrToOleStrAW (LPWSTR lpWideCharStr, LPCVOID lpString) BOOL WINAPI StrToOleStrAW (LPWSTR lpWideCharStr, LPCVOID lpString)
{ {
if (VERSION_OsIsUnicode()) if (SHELL_OsIsUnicode())
return StrToOleStrW (lpWideCharStr, lpString); return StrToOleStrW (lpWideCharStr, lpString);
return StrToOleStrA (lpWideCharStr, lpString); return StrToOleStrA (lpWideCharStr, lpString);
} }
...@@ -96,7 +94,7 @@ BOOL WINAPI StrToOleStrNW (LPWSTR lpWide, INT nWide, LPCWSTR lpStrW, INT nStr) ...@@ -96,7 +94,7 @@ BOOL WINAPI StrToOleStrNW (LPWSTR lpWide, INT nWide, LPCWSTR lpStrW, INT nStr)
BOOL WINAPI StrToOleStrNAW (LPWSTR lpWide, INT nWide, LPCVOID lpStr, INT nStr) BOOL WINAPI StrToOleStrNAW (LPWSTR lpWide, INT nWide, LPCVOID lpStr, INT nStr)
{ {
if (VERSION_OsIsUnicode()) if (SHELL_OsIsUnicode())
return StrToOleStrNW (lpWide, nWide, lpStr, nStr); return StrToOleStrNW (lpWide, nWide, lpStr, nStr);
return StrToOleStrNA (lpWide, nWide, lpStr, nStr); return StrToOleStrNA (lpWide, nWide, lpStr, nStr);
} }
...@@ -122,7 +120,7 @@ BOOL WINAPI OleStrToStrNW (LPWSTR lpwStr, INT nwStr, LPCWSTR lpOle, INT nOle) ...@@ -122,7 +120,7 @@ BOOL WINAPI OleStrToStrNW (LPWSTR lpwStr, INT nwStr, LPCWSTR lpOle, INT nOle)
BOOL WINAPI OleStrToStrNAW (LPVOID lpOut, INT nOut, LPCVOID lpIn, INT nIn) BOOL WINAPI OleStrToStrNAW (LPVOID lpOut, INT nOut, LPCVOID lpIn, INT nIn)
{ {
if (VERSION_OsIsUnicode()) if (SHELL_OsIsUnicode())
return OleStrToStrNW (lpOut, nOut, lpIn, nIn); return OleStrToStrNW (lpOut, nOut, lpIn, nIn);
return OleStrToStrNA (lpOut, nOut, lpIn, nIn); return OleStrToStrNA (lpOut, nOut, lpIn, nIn);
} }
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#include "debugtools.h" #include "debugtools.h"
#include "shellapi.h" #include "shellapi.h"
#include "shell32_main.h" #include "shell32_main.h"
#include "winversion.h"
#include "shlobj.h" #include "shlobj.h"
#include "shresdef.h" #include "shresdef.h"
...@@ -140,7 +139,7 @@ DWORD WINAPI SHFileOperationW (LPSHFILEOPSTRUCTW lpFileOp) ...@@ -140,7 +139,7 @@ DWORD WINAPI SHFileOperationW (LPSHFILEOPSTRUCTW lpFileOp)
*/ */
DWORD WINAPI SHFileOperationAW(LPVOID lpFileOp) DWORD WINAPI SHFileOperationAW(LPVOID lpFileOp)
{ {
if (VERSION_OsIsUnicode()) if (SHELL_OsIsUnicode())
return SHFileOperationW(lpFileOp); return SHFileOperationW(lpFileOp);
return SHFileOperationA(lpFileOp); return SHFileOperationA(lpFileOp);
} }
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include "heap.h" #include "heap.h"
#include "debugtools.h" #include "debugtools.h"
#include "winversion.h"
#include "shell32_main.h" #include "shell32_main.h"
#include "shlguid.h" #include "shlguid.h"
...@@ -365,7 +364,7 @@ BOOL WINAPI FileMenu_AppendItemAW( ...@@ -365,7 +364,7 @@ BOOL WINAPI FileMenu_AppendItemAW(
BOOL ret; BOOL ret;
LPSTR lpszText=NULL; LPSTR lpszText=NULL;
if (VERSION_OsIsUnicode() && (lpText!=FM_SEPARATOR)) if (SHELL_OsIsUnicode() && (lpText!=FM_SEPARATOR))
lpszText = HEAP_strdupWtoA ( GetProcessHeap(),0, lpText); lpszText = HEAP_strdupWtoA ( GetProcessHeap(),0, lpText);
ret = FileMenu_AppendItemA(hMenu, (lpszText) ? lpszText : lpText, uID, icon, hMenuPopup, nItemHeight); ret = FileMenu_AppendItemA(hMenu, (lpszText) ? lpszText : lpText, uID, icon, hMenuPopup, nItemHeight);
......
#ifndef __WINE_WINVERSION_H
#define __WINE_WINVERSION_H
#include "windef.h"
typedef enum
{
WIN31, /* Windows 3.1 */
WIN95, /* Windows 95 */
WIN98, /* Windows 98 */
NT351, /* Windows NT 3.51 */
NT40, /* Windows NT 4.0 */
NB_WINDOWS_VERSIONS
} WINDOWS_VERSION;
extern WINDOWS_VERSION VERSION_GetVersion(void);
extern char *VERSION_GetVersionName(void);
extern BOOL VERSION_OsIsUnicode(void);
extern DWORD VERSION_AppWinVer(void);
#endif /* __WINE_WINVERSION_H */
...@@ -19,10 +19,19 @@ ...@@ -19,10 +19,19 @@
#include "options.h" #include "options.h"
#include "debugtools.h" #include "debugtools.h"
#include "neexe.h" #include "neexe.h"
#include "winversion.h"
#include "winerror.h" #include "winerror.h"
DEFAULT_DEBUG_CHANNEL(ver) DEFAULT_DEBUG_CHANNEL(ver);
typedef enum
{
WIN31, /* Windows 3.1 */
WIN95, /* Windows 95 */
WIN98, /* Windows 98 */
NT351, /* Windows NT 3.51 */
NT40, /* Windows NT 4.0 */
NB_WINDOWS_VERSIONS
} WINDOWS_VERSION;
typedef struct typedef struct
{ {
...@@ -31,7 +40,6 @@ typedef struct ...@@ -31,7 +40,6 @@ typedef struct
OSVERSIONINFOA getVersionEx; OSVERSIONINFOA getVersionEx;
} VERSION_DATA; } VERSION_DATA;
/* FIXME: compare values below with original and fix */ /* FIXME: compare values below with original and fix */
static VERSION_DATA VersionData[NB_WINDOWS_VERSIONS] = static VERSION_DATA VersionData[NB_WINDOWS_VERSIONS] =
{ {
...@@ -309,7 +317,7 @@ DWORD VERSION_GetLinkedDllVersion(PDB *pdb) ...@@ -309,7 +317,7 @@ DWORD VERSION_GetLinkedDllVersion(PDB *pdb)
* is called by EVERY GetVersion*() API ! * is called by EVERY GetVersion*() API !
* *
*/ */
WINDOWS_VERSION VERSION_GetVersion(void) static WINDOWS_VERSION VERSION_GetVersion(void)
{ {
static WORD winver = 0xffff; static WORD winver = 0xffff;
...@@ -325,56 +333,6 @@ WINDOWS_VERSION VERSION_GetVersion(void) ...@@ -325,56 +333,6 @@ WINDOWS_VERSION VERSION_GetVersion(void)
return winver; return winver;
} }
/**********************************************************************
* VERSION_AppWinVer
* Returns the window version in case Wine emulates a later version
* of windows then the application expects.
*
* In a number of cases when windows runs an application that was
* designed for an earlier windows version, windows reverts
* to "old" behaviour of that earlier version.
*
* An example is a disabled edit control that needs to be painted.
* Old style behaviour is to send a WM_CTLCOLOREDIT message. This was
* changed in Win95, NT4.0 by a WM_CTLCOLORSTATIC message _only_ for
* applications with an expected version 0f 4.0 or higher.
*
*/
DWORD VERSION_AppWinVer(void)
{
WINDOWS_VERSION ver = VERSION_GetVersion();
DWORD dwEmulatedVersion=MAKELONG( VersionData[ver].getVersionEx.dwMinorVersion,
VersionData[ver].getVersionEx.dwMajorVersion);
/* fixme: this may not be 100% correct; see discussion on the
* wine developer list in Nov 1999 */
DWORD dwProcVersion = GetProcessVersion(0);
return dwProcVersion < dwEmulatedVersion ? dwProcVersion : dwEmulatedVersion;
}
/**********************************************************************
* VERSION_GetVersionName
*/
char *VERSION_GetVersionName()
{
WINDOWS_VERSION ver = VERSION_GetVersion();
switch(ver)
{
case WIN31:
return "Windows 3.1";
case WIN95:
return "Windows 95";
case WIN98:
return "Windows 98";
case NT351:
return "Windows NT 3.51";
case NT40:
return "Windows NT 4.0";
default:
FIXME("Windows version %d not named",ver);
return "Windows <Unknown>";
}
}
/*********************************************************************** /***********************************************************************
* GetVersion16 (KERNEL.3) * GetVersion16 (KERNEL.3)
...@@ -545,22 +503,3 @@ void WINAPI DiagOutput16(LPCSTR str) ...@@ -545,22 +503,3 @@ void WINAPI DiagOutput16(LPCSTR str)
/* FIXME */ /* FIXME */
DPRINTF("DIAGOUTPUT:%s\n", debugstr_a(str)); DPRINTF("DIAGOUTPUT:%s\n", debugstr_a(str));
} }
/***********************************************************************
* VERSION_OsIsUnicode [internal]
*
* NOTES
* some functions getting sometimes LPSTR sometimes LPWSTR...
*
*/
BOOL VERSION_OsIsUnicode(void)
{
switch(VERSION_GetVersion())
{
case NT351:
case NT40:
return TRUE;
default:
return FALSE;
}
}
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include "winbase.h" #include "winbase.h"
#include "winreg.h" #include "winreg.h"
#include "winerror.h" #include "winerror.h"
#include "winversion.h"
#include "file.h" #include "file.h"
#include "process.h" #include "process.h"
#include "heap.h" #include "heap.h"
...@@ -989,32 +988,8 @@ static DWORD VxDCall_VWin32( DWORD service, CONTEXT86 *context ) ...@@ -989,32 +988,8 @@ static DWORD VxDCall_VWin32( DWORD service, CONTEXT86 *context )
{ {
case 0x0000: /* GetVersion */ case 0x0000: /* GetVersion */
{ {
DWORD vers = VERSION_GetVersion(); DWORD vers = GetVersion();
switch (vers) return (LOBYTE(vers) << 8) | HIBYTE(vers);
{
case WIN31:
return(0x0301); /* Windows 3.1 */
break;
case WIN95:
return(0x0400); /* Win95 aka 4.0 */
break;
case WIN98:
return(0x040a); /* Win98 aka 4.10 */
break;
case NT351:
case NT40:
ERR("VxDCall when emulating NT???\n");
break;
default:
WARN("Unknown version %lx\n", vers);
break;
}
return(0x040a); /* default to win98 */
} }
break; break;
......
...@@ -11,12 +11,11 @@ ...@@ -11,12 +11,11 @@
#include "wingdi.h" #include "wingdi.h"
#include "wine/winuser16.h" #include "wine/winuser16.h"
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "winversion.h"
#include "heap.h" #include "heap.h"
#include "ldt.h" #include "ldt.h"
#include "syslevel.h" #include "syslevel.h"
DEFAULT_DEBUG_CHANNEL(win) DEFAULT_DEBUG_CHANNEL(win);
/********************************************************************** /**********************************************************************
...@@ -28,7 +27,17 @@ BOOL16 WINAPI WinHelp16( HWND16 hWnd, LPCSTR lpHelpFile, UINT16 wCommand, ...@@ -28,7 +27,17 @@ BOOL16 WINAPI WinHelp16( HWND16 hWnd, LPCSTR lpHelpFile, UINT16 wCommand,
BOOL ret; BOOL ret;
/* We might call WinExec() */ /* We might call WinExec() */
SYSLEVEL_ReleaseWin16Lock(); SYSLEVEL_ReleaseWin16Lock();
ret = WinHelpA( hWnd, lpHelpFile, wCommand, (DWORD)PTR_SEG_TO_LIN(dwData) );
if (!(ret = WinHelpA( hWnd, lpHelpFile, wCommand, (DWORD)PTR_SEG_TO_LIN(dwData) )))
{
/* try to start the 16-bit winhelp */
if (WinExec( "winhelp.exe -x", SW_SHOWNORMAL ) >= 32)
{
Yield16();
ret = WinHelpA( hWnd, lpHelpFile, wCommand, (DWORD)PTR_SEG_TO_LIN(dwData) );
}
}
SYSLEVEL_RestoreWin16Lock(); SYSLEVEL_RestoreWin16Lock();
return ret; return ret;
} }
...@@ -44,7 +53,6 @@ BOOL WINAPI WinHelpA( HWND hWnd, LPCSTR lpHelpFile, UINT wCommand, ...@@ -44,7 +53,6 @@ BOOL WINAPI WinHelpA( HWND hWnd, LPCSTR lpHelpFile, UINT wCommand,
HWND hDest; HWND hDest;
LPWINHELP lpwh; LPWINHELP lpwh;
HGLOBAL16 hwh; HGLOBAL16 hwh;
HINSTANCE winhelp;
int size,dsize,nlen; int size,dsize,nlen;
...@@ -57,17 +65,8 @@ BOOL WINAPI WinHelpA( HWND hWnd, LPCSTR lpHelpFile, UINT wCommand, ...@@ -57,17 +65,8 @@ BOOL WINAPI WinHelpA( HWND hWnd, LPCSTR lpHelpFile, UINT wCommand,
hDest = FindWindowA( "MS_WINHELP", NULL ); hDest = FindWindowA( "MS_WINHELP", NULL );
if(!hDest) { if(!hDest) {
if(wCommand == HELP_QUIT) if(wCommand == HELP_QUIT) return TRUE;
return TRUE; if (WinExec ( "winhlp32.exe -x", SW_SHOWNORMAL ) < 32) return FALSE;
else
if ( VERSION_GetVersion() == WIN31 ) {
winhelp = WinExec ( "winhelp.exe -x", SW_SHOWNORMAL );
Yield16();
}
else {
winhelp = WinExec ( "winhlp32.exe -x", SW_SHOWNORMAL );
}
if ( winhelp <= 32 ) return FALSE;
if ( ! ( hDest = FindWindowA ( "MS_WINHELP", NULL ) )) return FALSE; if ( ! ( hDest = FindWindowA ( "MS_WINHELP", NULL ) )) return FALSE;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment