osver.dwOSVersionInfoSize = sizeof(osver);
GetVersionEx(&osver);
- if (osver.dwPlatformId == VER_PLATFORM_WIN32_NT) {
+ if (osver.dwMajorVersion > 4) {
WCHAR widename[MAX_PATH];
GetModuleFileNameW(NULL, widename, sizeof(widename)/sizeof(WCHAR));
argv[0] = ansi = win32_ansipath(widename);
GetVersionEx(&osver);
bManageDirectory = 0;
- if (osver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) {
+ if (osver.dwMajorVersion < 5) {
char szBuffer[MAX_PATH*driveCount];
if (GetLogicalDriveStringsA(sizeof(szBuffer), szBuffer)) {
char* pEnv = (char*)GetEnvironmentStringsA();
}
SetDefaultA(".");
}
- else { /* Windows NT or later */
+ else { /* Windows 2000 or later */
WCHAR szBuffer[MAX_PATH*driveCount];
if (GetLogicalDriveStringsW(sizeof(szBuffer), szBuffer)) {
WCHAR* pEnv = GetEnvironmentStringsW();
# define HWND_MESSAGE ((HWND)-3)
#endif
#ifndef WC_NO_BEST_FIT_CHARS
-# define WC_NO_BEST_FIT_CHARS 0x00000400
+# define WC_NO_BEST_FIT_CHARS 0x00000400 /* requires Windows 2000 or later */
#endif
#include <winnt.h>
#include <tlhelp32.h>
return (g_osver.dwPlatformId == VER_PLATFORM_WIN32_NT);
}
+int
+IsWin2000(void)
+{
+ return (g_osver.dwMajorVersion > 4);
+}
+
EXTERN_C void
set_w32_module_name(void)
{
osver.dwOSVersionInfoSize = sizeof(osver);
GetVersionEx(&osver);
- if (osver.dwPlatformId == VER_PLATFORM_WIN32_NT) {
+ if (osver.dwMajorVersion > 4) {
WCHAR modulename[MAX_PATH];
WCHAR fullname[MAX_PATH];
char *ansi;
scanname[len] = '\0';
/* do the FindFirstFile call */
- if (IsWinNT()) {
+ if (IsWin2000()) {
WCHAR wscanname[sizeof(scanname)];
MultiByteToWideChar(CP_ACP, 0, scanname, -1, wscanname, sizeof(wscanname)/sizeof(WCHAR));
dirp->handle = FindFirstFileW(PerlDir_mapW(wscanname), &wFindData);
/* finding the next file that matches the wildcard
* (which should be all of them in this directory!).
*/
- if (IsWinNT()) {
+ if (IsWin2000()) {
WIN32_FIND_DATAW wFindData;
res = FindNextFileW(dirp->handle, &wFindData);
if (res) {
WCHAR *wide_path;
WCHAR *wide_dir;
- /* there is no Unicode environment on Windows 9X */
- if (IsWin95())
+ /* win32_ansipath() requires Windows 2000 or later */
+ if (!IsWin2000())
return;
/* fetch Unicode version of PATH */
* "right" place with DispatchMessage() anymore, as there is no WindowProc
* if there is no window handle.
*/
- if (g_osver.dwMajorVersion < 5)
+ if (!IsWin2000())
return NULL;
return CreateWindow("Static", "", 0, 0, 0, 0, 0, HWND_MESSAGE, 0, 0, NULL);