Replaced VERSION_* calls by exported API equivalents.

oldstable
Alexandre Julliard 2000-08-14 14:35:01 +00:00
parent 198746d812
commit d586dc99be
21 changed files with 214 additions and 263 deletions

View File

@ -10,7 +10,6 @@
#include "ntddk.h"
#include "ntsecapi.h"
#include "debugtools.h"
#include "winversion.h"
DEFAULT_DEBUG_CHANNEL(advapi);

View File

@ -10,7 +10,6 @@
#include "winuser.h"
#include "winerror.h"
#include "debugtools.h"
#include "winversion.h"
#include "imm.h"
DEFAULT_DEBUG_CHANNEL(imm);
@ -222,19 +221,20 @@ BOOL WINAPI ImmGetCompositionFontW(HIMC hIMC, LPLOGFONTW lplf)
LONG WINAPI ImmGetCompositionStringA(
HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen)
{
OSVERSIONINFOA version;
FIXME("(0x%08x, %ld, %p, %ld): stub\n",
hIMC, dwIndex, lpBuf, dwBufLen
);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
switch(VERSION_GetVersion())
{
default:
FIXME("%s not supported",VERSION_GetVersionName());
case WIN95:
return 0xffffffff;
case NT40:
return 0;
}
GetVersionExA( &version );
switch(version.dwPlatformId)
{
case VER_PLATFORM_WIN32_WINDOWS: return -1;
case VER_PLATFORM_WIN32_NT: return 0;
default:
FIXME("%ld not supported",version.dwPlatformId);
return -1;
}
}
/***********************************************************************
@ -244,19 +244,20 @@ LONG WINAPI ImmGetCompositionStringW(
HIMC hIMC, DWORD dwIndex,
LPVOID lpBuf, DWORD dwBufLen)
{
OSVERSIONINFOA version;
FIXME("(0x%08x, %ld, %p, %ld): stub\n",
hIMC, dwIndex, lpBuf, dwBufLen
);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
switch(VERSION_GetVersion())
{
default:
FIXME("%s not supported",VERSION_GetVersionName());
case WIN95:
return 0xffffffff;
case NT40:
return 0;
}
GetVersionExA( &version );
switch(version.dwPlatformId)
{
case VER_PLATFORM_WIN32_WINDOWS: return -1;
case VER_PLATFORM_WIN32_NT: return 0;
default:
FIXME("%ld not supported",version.dwPlatformId);
return -1;
}
}
/***********************************************************************
@ -465,17 +466,20 @@ BOOL WINAPI ImmGetStatusWindowPos(HIMC hIMC, LPPOINT lpptPos)
*/
UINT WINAPI ImmGetVirtualKey(HWND hWnd)
{
OSVERSIONINFOA version;
FIXME("(0x%08x): stub\n", hWnd);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
switch(VERSION_GetVersion())
{
default:
FIXME("%s not supported", VERSION_GetVersionName());
case WIN95:
GetVersionExA( &version );
switch(version.dwPlatformId)
{
case VER_PLATFORM_WIN32_WINDOWS:
return VK_PROCESSKEY;
case NT40:
case VER_PLATFORM_WIN32_NT:
return 0;
}
default:
FIXME("%ld not supported",version.dwPlatformId);
return VK_PROCESSKEY;
}
}
/***********************************************************************

View File

@ -14,9 +14,8 @@
#include "msacm.h"
#include "msacmdrv.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
*/
DWORD WINAPI acmGetVersion(void)
{
switch (VERSION_GetVersion()) {
default:
FIXME("%s not supported\n", VERSION_GetVersionName());
case WIN95:
return 0x04000000; /* 4.0.0 */
case NT40:
OSVERSIONINFOA version;
GetVersionExA( &version );
switch(version.dwPlatformId)
{
case VER_PLATFORM_WIN32_NT:
return 0x04000565; /* 4.0.1381 */
}
default:
FIXME("%ld not supported",version.dwPlatformId);
case VER_PLATFORM_WIN32_WINDOWS:
return 0x04000000; /* 4.0.0 */
}
}
/***********************************************************************

View File

@ -7,7 +7,6 @@
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "winversion.h"
#include "heap.h"
#include "ldt.h"
@ -105,19 +104,19 @@ HRESULT WINAPI GetActiveObject(REFCLSID rcid,LPVOID preserved,LPUNKNOWN *ppunk)
UINT WINAPI OaBuildVersion()
{
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 */
case WIN95:
case 0x80000004: /* WIN95 */
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 */
case NT351:
case 0x00003303: /* NT351 */
return MAKELONG(4265, 30); /* value borrowed from Win95 */
case NT40:
case 0x00000004: /* NT40 */
return MAKELONG(4122, 20); /* ouch ! Quite old, I guess */
default:
default:
ERR("Version value not known yet. Please investigate it !\n");
return 0x0;
}

View File

@ -34,7 +34,6 @@
#include "heap.h"
#include "wine/obj_base.h"
#include "debugtools.h"
#include "winversion.h"
#include "typelib.h"
DEFAULT_DEBUG_CHANNEL(ole);
@ -294,15 +293,15 @@ HRESULT WINAPI UnRegisterTypeLib(
DWORD WINAPI OaBuildVersion16(void)
{
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 */
case WIN95:
case 0x80000004: /* WIN95 */
return MAKELONG(700, 23); /* Win95A */
case WIN98:
case 0x80000a04: /* WIN98 */
return MAKELONG(3024, 10); /* W98 SE */
default:
default:
FIXME_(ole)("Version value not known yet. Please investigate it !");
return 0;
}

View File

@ -10,7 +10,6 @@
#include "debugtools.h"
#include "pidl.h"
#include "shell32_main.h"
#include "winversion.h"
#include "wine/undocshell.h"
DEFAULT_DEBUG_CHANNEL(shell);
@ -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)
{
if(VERSION_OsIsUnicode())
if(SHELL_OsIsUnicode())
SHChangeNotifyW (wEventId, uFlags, dwItem1, dwItem2);
else
SHChangeNotifyA (wEventId, uFlags, dwItem1, dwItem2);

View File

@ -16,7 +16,6 @@
#include "module.h"
#include "heap.h"
#include "debugtools.h"
#include "winversion.h"
#include "shellapi.h"
#include "shlguid.h"
@ -808,7 +807,7 @@ INT WINAPI Shell_GetCachedImageIndexW(LPCWSTR szPath, INT nIndex, BOOL bSimulate
}
INT WINAPI Shell_GetCachedImageIndexAW(LPCVOID szPath, INT nIndex, BOOL bSimulateDoc)
{ if( VERSION_OsIsUnicode())
{ if( SHELL_OsIsUnicode())
return Shell_GetCachedImageIndexW(szPath, nIndex, bSimulateDoc);
return Shell_GetCachedImageIndexA(szPath, nIndex, bSimulateDoc);
}
@ -817,7 +816,7 @@ INT WINAPI Shell_GetCachedImageIndexAW(LPCVOID szPath, INT nIndex, BOOL bSimulat
* ExtractIconEx [shell32.189]
*/
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 ExtractIconExA ( lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons);
}

View File

@ -17,15 +17,14 @@
#include "shlguid.h"
#include "winerror.h"
#include "winnls.h"
#include "winversion.h"
#include "shell32_main.h"
#include "shellapi.h"
#include "pidl.h"
#include "wine/undocshell.h"
DEFAULT_DEBUG_CHANNEL(pidl)
DECLARE_DEBUG_CHANNEL(shell)
DEFAULT_DEBUG_CHANNEL(pidl);
DECLARE_DEBUG_CHANNEL(shell);
void pdump (LPCITEMIDLIST pidl)
{
@ -316,7 +315,7 @@ HRESULT WINAPI SHILCreateFromPathW (LPCWSTR path, LPITEMIDLIST * ppidl, DWORD *
}
HRESULT WINAPI SHILCreateFromPathAW (LPCVOID path, LPITEMIDLIST * ppidl, DWORD * attributes)
{
if ( VERSION_OsIsUnicode())
if ( SHELL_OsIsUnicode())
return SHILCreateFromPathW (path, ppidl, attributes);
return SHILCreateFromPathA (path, ppidl, attributes);
}
@ -727,7 +726,7 @@ LPITEMIDLIST WINAPI ILCreateFromPathW (LPCWSTR path)
}
LPITEMIDLIST WINAPI ILCreateFromPathAW (LPCVOID path)
{
if ( VERSION_OsIsUnicode())
if ( SHELL_OsIsUnicode())
return ILCreateFromPathW (path);
return ILCreateFromPathA (path);
}
@ -772,7 +771,7 @@ LPITEMIDLIST WINAPI SHSimpleIDListFromPathW (LPCWSTR lpszPath)
LPITEMIDLIST WINAPI SHSimpleIDListFromPathAW (LPCVOID lpszPath)
{
if ( VERSION_OsIsUnicode())
if ( SHELL_OsIsUnicode())
return SHSimpleIDListFromPathW (lpszPath);
return SHSimpleIDListFromPathA (lpszPath);
}
@ -1064,7 +1063,7 @@ BOOL WINAPI SHGetPathFromIDListAW(LPCITEMIDLIST pidl,LPVOID pszPath)
{
TRACE_(shell)("(pidl=%p,%p)\n",pidl,pszPath);
if (VERSION_OsIsUnicode())
if (SHELL_OsIsUnicode())
return SHGetPathFromIDListW(pidl,pszPath);
return SHGetPathFromIDListA(pidl,pszPath);
}

View File

@ -18,7 +18,6 @@
#include "debugtools.h"
#include "winreg.h"
#include "authors.h"
#include "winversion.h"
#include "shellapi.h"
#include "pidl.h"
@ -296,7 +295,7 @@ DWORD WINAPI SHGetFileInfoAW(
UINT sizeofpsfi,
UINT flags)
{
if(VERSION_OsIsUnicode())
if(SHELL_OsIsUnicode())
return SHGetFileInfoW(path, dwFileAttributes, psfi, sizeofpsfi, flags );
return SHGetFileInfoA(path, dwFileAttributes, psfi, sizeofpsfi, flags );
}

View File

@ -164,4 +164,11 @@ void FreeChangeNotifications(void);
/* file operation */
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

View File

@ -18,14 +18,13 @@
#include "wine/obj_extracticon.h"
#include "shlguid.h"
#include "winversion.h"
#include "winreg.h"
#include "winerror.h"
#include "debugtools.h"
#include "shell32_main.h"
DEFAULT_DEBUG_CHANNEL(shell)
DEFAULT_DEBUG_CHANNEL(shell);
DWORD WINAPI SHCLSIDFromStringA (LPSTR clsid, CLSID *id);
extern IShellFolder * IShellFolder_Constructor(
@ -135,7 +134,7 @@ DWORD WINAPI SHCLSIDFromStringW (LPWSTR clsid, CLSID *id)
}
DWORD WINAPI SHCLSIDFromStringAW (LPVOID clsid, CLSID *id)
{
if (VERSION_OsIsUnicode())
if (SHELL_OsIsUnicode())
return SHCLSIDFromStringW (clsid, id);
return SHCLSIDFromStringA (clsid, id);
}
@ -587,7 +586,7 @@ UINT WINAPI DragQueryFileA(
}
}
i = lstrlenA(lpDrop);
i = strlen(lpDrop);
i++;
if (!lpszFile ) goto end; /* needed buffer size */
i = (lLength > i) ? i : lLength;

View File

@ -11,7 +11,6 @@
#include "winreg.h"
#include "debugtools.h"
#include "winnls.h"
#include "winversion.h"
#include "heap.h"
#include "shellapi.h"
@ -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)
{
if (VERSION_OsIsUnicode())
if (SHELL_OsIsUnicode())
return ParseFieldW(src, nField, dst, len);
return ParseFieldA(src, nField, dst, len);
}
@ -99,7 +98,7 @@ BOOL WINAPI GetFileNameFromBrowse(
/* puts up a Open Dialog and requests input into targetbuf */
/* OFN_HIDEREADONLY|OFN_NOCHANGEDIR|OFN_FILEMUSTEXIST|OFN_unknown */
lstrcpyA(lpstrFile,"x:\\dummy.exe");
strcpy(lpstrFile,"x:\\dummy.exe");
return 1;
}
@ -485,7 +484,7 @@ HRESULT WINAPI SHRunControlPanel (DWORD x, DWORD z)
*
*/
BOOL WINAPI ShellExecuteExAW (LPVOID sei)
{ if (VERSION_OsIsUnicode())
{ if (SHELL_OsIsUnicode())
return ShellExecuteExW (sei);
return ShellExecuteExA (sei);
}
@ -941,7 +940,7 @@ HRESULT WINAPI DoEnvironmentSubstW(LPWSTR x, LPWSTR y)
*/
HRESULT WINAPI DoEnvironmentSubstAW(LPVOID x, LPVOID y)
{
if (VERSION_OsIsUnicode())
if (SHELL_OsIsUnicode())
return DoEnvironmentSubstW(x, y);
return DoEnvironmentSubstA(x, y);
}

View File

@ -8,7 +8,6 @@
#include <ctype.h>
#include "debugtools.h"
#include "winnls.h"
#include "winversion.h"
#include "winreg.h"
#include "shlobj.h"
@ -33,7 +32,7 @@ BOOL WINAPI PathAppendAW(
LPVOID lpszPath1,
LPCVOID lpszPath2)
{
if (VERSION_OsIsUnicode())
if (SHELL_OsIsUnicode())
return PathAppendW(lpszPath1, lpszPath2);
return PathAppendA(lpszPath1, lpszPath2);
}
@ -46,7 +45,7 @@ LPVOID WINAPI PathCombineAW(
LPCVOID lpszDir,
LPCVOID lpszFile)
{
if (VERSION_OsIsUnicode())
if (SHELL_OsIsUnicode())
return PathCombineW( szDest, lpszDir, lpszFile );
return PathCombineA( szDest, lpszDir, lpszFile );
}
@ -56,7 +55,7 @@ LPVOID WINAPI PathCombineAW(
*/
LPVOID WINAPI PathAddBackslashAW(LPVOID lpszPath)
{
if(VERSION_OsIsUnicode())
if(SHELL_OsIsUnicode())
return PathAddBackslashW(lpszPath);
return PathAddBackslashA(lpszPath);
}
@ -66,7 +65,7 @@ LPVOID WINAPI PathAddBackslashAW(LPVOID lpszPath)
*/
LPVOID WINAPI PathBuildRootAW(LPVOID lpszPath, int drive)
{
if(VERSION_OsIsUnicode())
if(SHELL_OsIsUnicode())
return PathBuildRootW(lpszPath, drive);
return PathBuildRootA(lpszPath, drive);
}
@ -80,7 +79,7 @@ LPVOID WINAPI PathBuildRootAW(LPVOID lpszPath, int drive)
*/
LPVOID WINAPI PathFindFileNameAW(LPCVOID lpszPath)
{
if(VERSION_OsIsUnicode())
if(SHELL_OsIsUnicode())
return PathFindFileNameW(lpszPath);
return PathFindFileNameA(lpszPath);
}
@ -90,18 +89,44 @@ LPVOID WINAPI PathFindFileNameAW(LPCVOID lpszPath)
*/
LPVOID WINAPI PathFindExtensionAW(LPCVOID lpszPath)
{
if (VERSION_OsIsUnicode())
if (SHELL_OsIsUnicode())
return PathFindExtensionW(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]
*/
LPVOID WINAPI PathGetExtensionAW(LPCVOID lpszPath)
{
if (VERSION_OsIsUnicode())
if (SHELL_OsIsUnicode())
return PathGetExtensionW(lpszPath);
return PathGetExtensionA(lpszPath);
}
@ -111,7 +136,7 @@ LPVOID WINAPI PathGetExtensionAW(LPCVOID lpszPath)
*/
LPVOID WINAPI PathGetArgsAW(LPVOID lpszPath)
{
if (VERSION_OsIsUnicode())
if (SHELL_OsIsUnicode())
return PathGetArgsW(lpszPath);
return PathGetArgsA(lpszPath);
}
@ -121,7 +146,7 @@ LPVOID WINAPI PathGetArgsAW(LPVOID lpszPath)
*/
int WINAPI PathGetDriveNumberAW(LPVOID lpszPath)
{
if (VERSION_OsIsUnicode())
if (SHELL_OsIsUnicode())
return PathGetDriveNumberW(lpszPath);
return PathGetDriveNumberA(lpszPath);
}
@ -131,7 +156,7 @@ int WINAPI PathGetDriveNumberAW(LPVOID lpszPath)
*/
BOOL WINAPI PathRemoveFileSpecAW(LPVOID lpszPath)
{
if (VERSION_OsIsUnicode())
if (SHELL_OsIsUnicode())
return PathRemoveFileSpecW(lpszPath);
return PathRemoveFileSpecA(lpszPath);
}
@ -141,7 +166,7 @@ BOOL WINAPI PathRemoveFileSpecAW(LPVOID lpszPath)
*/
void WINAPI PathStripPathAW(LPVOID lpszPath)
{
if (VERSION_OsIsUnicode())
if (SHELL_OsIsUnicode())
return PathStripPathW(lpszPath);
return PathStripPathA(lpszPath);
}
@ -151,7 +176,7 @@ void WINAPI PathStripPathAW(LPVOID lpszPath)
*/
BOOL WINAPI PathStripToRootAW(LPVOID lpszPath)
{
if (VERSION_OsIsUnicode())
if (SHELL_OsIsUnicode())
return PathStripToRootW(lpszPath);
return PathStripToRootA(lpszPath);
}
@ -161,7 +186,7 @@ BOOL WINAPI PathStripToRootAW(LPVOID lpszPath)
*/
void WINAPI PathRemoveArgsAW(LPVOID lpszPath)
{
if (VERSION_OsIsUnicode())
if (SHELL_OsIsUnicode())
PathRemoveArgsW(lpszPath);
PathRemoveArgsA(lpszPath);
}
@ -171,7 +196,7 @@ void WINAPI PathRemoveArgsAW(LPVOID lpszPath)
*/
void WINAPI PathRemoveExtensionAW(LPVOID lpszPath)
{
if (VERSION_OsIsUnicode())
if (SHELL_OsIsUnicode())
return PathRemoveExtensionW(lpszPath);
return PathRemoveExtensionA(lpszPath);
}
@ -204,7 +229,7 @@ LPWSTR WINAPI PathGetShortPathW(LPWSTR lpszPath)
*/
LPVOID WINAPI PathGetShortPathAW(LPVOID lpszPath)
{
if(VERSION_OsIsUnicode())
if(SHELL_OsIsUnicode())
return PathGetShortPathW(lpszPath);
return PathGetShortPathA(lpszPath);
}
@ -214,7 +239,7 @@ LPVOID WINAPI PathGetShortPathAW(LPVOID lpszPath)
*/
void WINAPI PathRemoveBlanksAW(LPVOID str)
{
if(VERSION_OsIsUnicode())
if(SHELL_OsIsUnicode())
PathRemoveBlanksW(str);
PathRemoveBlanksA(str);
}
@ -224,7 +249,7 @@ void WINAPI PathRemoveBlanksAW(LPVOID str)
*/
LPVOID WINAPI PathQuoteSpacesAW (LPVOID lpszPath)
{
if(VERSION_OsIsUnicode())
if(SHELL_OsIsUnicode())
return PathQuoteSpacesW(lpszPath);
return PathQuoteSpacesA(lpszPath);
}
@ -234,7 +259,7 @@ LPVOID WINAPI PathQuoteSpacesAW (LPVOID lpszPath)
*/
VOID WINAPI PathUnquoteSpacesAW(LPVOID str)
{
if(VERSION_OsIsUnicode())
if(SHELL_OsIsUnicode())
PathUnquoteSpacesW(str);
else
PathUnquoteSpacesA(str);
@ -245,7 +270,7 @@ VOID WINAPI PathUnquoteSpacesAW(LPVOID str)
*/
int WINAPI PathParseIconLocationAW (LPVOID lpszPath)
{
if(VERSION_OsIsUnicode())
if(SHELL_OsIsUnicode())
return PathParseIconLocationW(lpszPath);
return PathParseIconLocationA(lpszPath);
}
@ -258,7 +283,7 @@ int WINAPI PathParseIconLocationAW (LPVOID lpszPath)
*/
BOOL WINAPI PathIsUNCAW (LPCVOID lpszPath)
{
if (VERSION_OsIsUnicode())
if (SHELL_OsIsUnicode())
return PathIsUNCW( lpszPath );
return PathIsUNCA( lpszPath );
}
@ -268,7 +293,7 @@ BOOL WINAPI PathIsUNCAW (LPCVOID lpszPath)
*/
BOOL WINAPI PathIsRelativeAW (LPCVOID lpszPath)
{
if (VERSION_OsIsUnicode())
if (SHELL_OsIsUnicode())
return PathIsRelativeW( lpszPath );
return PathIsRelativeA( lpszPath );
}
@ -278,17 +303,53 @@ BOOL WINAPI PathIsRelativeAW (LPCVOID lpszPath)
*/
BOOL WINAPI PathIsRootAW(LPCVOID lpszPath)
{
if (VERSION_OsIsUnicode())
if (SHELL_OsIsUnicode())
return PathIsRootW(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]
*/
BOOL WINAPI PathIsExeAW (LPCVOID path)
{
if (VERSION_OsIsUnicode())
if (SHELL_OsIsUnicode())
return PathIsExeW (path);
return PathIsExeA(path);
}
@ -298,7 +359,7 @@ BOOL WINAPI PathIsExeAW (LPCVOID path)
*/
BOOL WINAPI PathIsDirectoryAW (LPCVOID lpszPath)
{
if (VERSION_OsIsUnicode())
if (SHELL_OsIsUnicode())
return PathIsDirectoryW (lpszPath);
return PathIsDirectoryA (lpszPath);
}
@ -308,7 +369,7 @@ BOOL WINAPI PathIsDirectoryAW (LPCVOID lpszPath)
*/
BOOL WINAPI PathFileExistsAW (LPCVOID lpszPath)
{
if (VERSION_OsIsUnicode())
if (SHELL_OsIsUnicode())
return PathFileExistsW (lpszPath);
return PathFileExistsA (lpszPath);
}
@ -318,7 +379,7 @@ BOOL WINAPI PathFileExistsAW (LPCVOID lpszPath)
*/
BOOL WINAPI PathMatchSpecAW(LPVOID name, LPVOID mask)
{
if (VERSION_OsIsUnicode())
if (SHELL_OsIsUnicode())
return PathMatchSpecW( name, mask );
return PathMatchSpecA( name, mask );
}
@ -328,7 +389,7 @@ BOOL WINAPI PathMatchSpecAW(LPVOID name, LPVOID mask)
*/
BOOL WINAPI PathIsSameRootAW(LPCVOID lpszPath1, LPCVOID lpszPath2)
{
if (VERSION_OsIsUnicode())
if (SHELL_OsIsUnicode())
return PathIsSameRootW(lpszPath1, lpszPath2);
return PathIsSameRootA(lpszPath1, lpszPath2);
}
@ -393,7 +454,7 @@ BOOL WINAPI PathMakeUniqueNameAW(
LPCVOID lpszLongName,
LPCVOID lpszPathName)
{
if (VERSION_OsIsUnicode())
if (SHELL_OsIsUnicode())
return PathMakeUniqueNameW(lpszBuffer,dwBuffSize, lpszShortName,lpszLongName,lpszPathName);
return PathMakeUniqueNameA(lpszBuffer,dwBuffSize, lpszShortName,lpszLongName,lpszPathName);
}
@ -425,7 +486,7 @@ BOOL WINAPI PathYetAnotherMakeUniqueNameA(
*/
BOOL WINAPI PathFindOnPathAW(LPVOID sFile, LPCVOID sOtherDirs)
{
if (VERSION_OsIsUnicode())
if (SHELL_OsIsUnicode())
return PathFindOnPathW(sFile, sOtherDirs);
return PathFindOnPathA(sFile, sOtherDirs);
}
@ -435,9 +496,8 @@ BOOL WINAPI PathFindOnPathAW(LPVOID sFile, LPCVOID sOtherDirs)
*/
DWORD WINAPI PathCleanupSpecAW (LPVOID x, LPVOID y)
{
if (VERSION_OsIsUnicode())
return PathCleanupSpecW(x,y);
return PathCleanupSpecA(x,y);
FIXME("(%p, %p) stub\n",x,y);
return TRUE;
}
/*************************************************************************
@ -463,7 +523,7 @@ BOOL WINAPI PathQualifyW(LPCWSTR pszPath)
*/
BOOL WINAPI PathQualifyAW(LPCVOID pszPath)
{
if (VERSION_OsIsUnicode())
if (SHELL_OsIsUnicode())
return PathQualifyW(pszPath);
return PathQualifyA(pszPath);
}
@ -502,7 +562,7 @@ BOOL WINAPI PathResolveAW(
LPCVOID *alpszPaths,
DWORD dwFlags)
{
if (VERSION_OsIsUnicode())
if (SHELL_OsIsUnicode())
return PathResolveW(lpszPath, (LPCWSTR*)alpszPaths, dwFlags);
return PathResolveA(lpszPath, (LPCSTR*)alpszPaths, dwFlags);
}
@ -518,7 +578,7 @@ HRESULT WINAPI PathProcessCommandA (
{
FIXME("%s %p 0x%04lx 0x%04lx stub\n",
lpszPath, lpszBuff, dwBuffSize, dwFlags);
lstrcpyA(lpszBuff, lpszPath);
strcpy(lpszBuff, lpszPath);
return 0;
}
@ -533,7 +593,7 @@ HRESULT WINAPI PathProcessCommandW (
{
FIXME("(%s, %p, 0x%04lx, 0x%04lx) stub\n",
debugstr_w(lpszPath), lpszBuff, dwBuffSize, dwFlags);
lstrcpyW(lpszBuff, lpszPath);
strcpyW(lpszBuff, lpszPath);
return 0;
}
@ -546,7 +606,7 @@ HRESULT WINAPI PathProcessCommandAW (
DWORD dwBuffSize,
DWORD dwFlags)
{
if (VERSION_OsIsUnicode())
if (SHELL_OsIsUnicode())
return PathProcessCommandW(lpszPath, lpszBuff, dwBuffSize, dwFlags);
return PathProcessCommandA(lpszPath, lpszBuff, dwBuffSize, dwFlags);
}
@ -559,7 +619,7 @@ HRESULT WINAPI PathProcessCommandAW (
* PathSetDlgItemPathAW
*/
BOOL WINAPI PathSetDlgItemPathAW(HWND hDlg, int id, LPCVOID pszPath)
{ if (VERSION_OsIsUnicode())
{ if (SHELL_OsIsUnicode())
return PathSetDlgItemPathW(hDlg, id, pszPath);
return PathSetDlgItemPathA(hDlg, id, pszPath);
}
@ -806,7 +866,7 @@ BOOL WINAPI SHGetSpecialFolderPathAW (
BOOL bCreate)
{
if (VERSION_OsIsUnicode())
if (SHELL_OsIsUnicode())
return SHGetSpecialFolderPathW (hwndOwner, szPath, csidl, bCreate);
return SHGetSpecialFolderPathA (hwndOwner, szPath, csidl, bCreate);
}

View File

@ -7,7 +7,6 @@
#include "winreg.h"
#include "debugtools.h"
#include "winnls.h"
#include "winversion.h"
#include "heap.h"
#include "shellapi.h"

View File

@ -6,10 +6,10 @@
#include "winnls.h"
#include "winerror.h"
#include "debugtools.h"
#include "winversion.h"
#include "heap.h"
#include "shellapi.h"
#include "shell32_main.h"
#include "wine/undocshell.h"
#include "wine/unicode.h"
@ -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)
{
if(VERSION_OsIsUnicode())
if(SHELL_OsIsUnicode())
return StrRetToStrNW (dest, len, src, pidl);
return StrRetToStrNA (dest, len, src, pidl);
}
@ -61,15 +61,13 @@ int WINAPI StrToOleStrW (LPWSTR lpWideCharStr, LPCWSTR lpWString)
TRACE("(%p, %p %s)\n",
lpWideCharStr, lpWString, debugstr_w(lpWString));
if (lstrcpyW (lpWideCharStr, lpWString ))
{ return lstrlenW (lpWideCharStr);
}
return 0;
strcpyW (lpWideCharStr, lpWString );
return strlenW(lpWideCharStr);
}
BOOL WINAPI StrToOleStrAW (LPWSTR lpWideCharStr, LPCVOID lpString)
{
if (VERSION_OsIsUnicode())
if (SHELL_OsIsUnicode())
return StrToOleStrW (lpWideCharStr, lpString);
return StrToOleStrA (lpWideCharStr, lpString);
}
@ -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)
{
if (VERSION_OsIsUnicode())
if (SHELL_OsIsUnicode())
return StrToOleStrNW (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)
BOOL WINAPI OleStrToStrNAW (LPVOID lpOut, INT nOut, LPCVOID lpIn, INT nIn)
{
if (VERSION_OsIsUnicode())
if (SHELL_OsIsUnicode())
return OleStrToStrNW (lpOut, nOut, lpIn, nIn);
return OleStrToStrNA (lpOut, nOut, lpIn, nIn);
}

View File

@ -5,7 +5,6 @@
#include "debugtools.h"
#include "shellapi.h"
#include "shell32_main.h"
#include "winversion.h"
#include "shlobj.h"
#include "shresdef.h"
@ -140,7 +139,7 @@ DWORD WINAPI SHFileOperationW (LPSHFILEOPSTRUCTW lpFileOp)
*/
DWORD WINAPI SHFileOperationAW(LPVOID lpFileOp)
{
if (VERSION_OsIsUnicode())
if (SHELL_OsIsUnicode())
return SHFileOperationW(lpFileOp);
return SHFileOperationA(lpFileOp);
}

View File

@ -10,7 +10,6 @@
#include "heap.h"
#include "debugtools.h"
#include "winversion.h"
#include "shell32_main.h"
#include "shlguid.h"
@ -365,7 +364,7 @@ BOOL WINAPI FileMenu_AppendItemAW(
BOOL ret;
LPSTR lpszText=NULL;
if (VERSION_OsIsUnicode() && (lpText!=FM_SEPARATOR))
if (SHELL_OsIsUnicode() && (lpText!=FM_SEPARATOR))
lpszText = HEAP_strdupWtoA ( GetProcessHeap(),0, lpText);
ret = FileMenu_AppendItemA(hMenu, (lpszText) ? lpszText : lpText, uID, icon, hMenuPopup, nItemHeight);

View File

@ -1,21 +0,0 @@
#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 */

View File

@ -19,10 +19,19 @@
#include "options.h"
#include "debugtools.h"
#include "neexe.h"
#include "winversion.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
{
@ -31,7 +40,6 @@ typedef struct
OSVERSIONINFOA getVersionEx;
} VERSION_DATA;
/* FIXME: compare values below with original and fix */
static VERSION_DATA VersionData[NB_WINDOWS_VERSIONS] =
{
@ -309,7 +317,7 @@ DWORD VERSION_GetLinkedDllVersion(PDB *pdb)
* is called by EVERY GetVersion*() API !
*
*/
WINDOWS_VERSION VERSION_GetVersion(void)
static WINDOWS_VERSION VERSION_GetVersion(void)
{
static WORD winver = 0xffff;
@ -325,56 +333,6 @@ WINDOWS_VERSION VERSION_GetVersion(void)
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)
@ -545,22 +503,3 @@ void WINAPI DiagOutput16(LPCSTR str)
/* FIXME */
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;
}
}

View File

@ -26,7 +26,6 @@
#include "winbase.h"
#include "winreg.h"
#include "winerror.h"
#include "winversion.h"
#include "file.h"
#include "process.h"
#include "heap.h"
@ -989,32 +988,8 @@ static DWORD VxDCall_VWin32( DWORD service, CONTEXT86 *context )
{
case 0x0000: /* GetVersion */
{
DWORD vers = VERSION_GetVersion();
switch (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 */
DWORD vers = GetVersion();
return (LOBYTE(vers) << 8) | HIBYTE(vers);
}
break;

View File

@ -11,12 +11,11 @@
#include "wingdi.h"
#include "wine/winuser16.h"
#include "wine/winbase16.h"
#include "winversion.h"
#include "heap.h"
#include "ldt.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,
BOOL ret;
/* We might call WinExec() */
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();
return ret;
}
@ -44,7 +53,6 @@ BOOL WINAPI WinHelpA( HWND hWnd, LPCSTR lpHelpFile, UINT wCommand,
HWND hDest;
LPWINHELP lpwh;
HGLOBAL16 hwh;
HINSTANCE winhelp;
int size,dsize,nlen;
@ -57,17 +65,8 @@ BOOL WINAPI WinHelpA( HWND hWnd, LPCSTR lpHelpFile, UINT wCommand,
hDest = FindWindowA( "MS_WINHELP", NULL );
if(!hDest) {
if(wCommand == HELP_QUIT)
return TRUE;
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(wCommand == HELP_QUIT) return TRUE;
if (WinExec ( "winhlp32.exe -x", SW_SHOWNORMAL ) < 32) return FALSE;
if ( ! ( hDest = FindWindowA ( "MS_WINHELP", NULL ) )) return FALSE;
}