From bc895db439fd90fda07ba7e8761c720f6b3f927e Mon Sep 17 00:00:00 2001 From: Thorsten Engel Date: Sat, 7 May 2005 23:45:56 +0000 Subject: [PATCH] moved g_platform_id to winapi git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2012 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/filed/win32/winservice.cpp | 2 +- bacula/src/lib/winapi.c | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/bacula/src/filed/win32/winservice.cpp b/bacula/src/filed/win32/winservice.cpp index 0111087d2f..31e77a5da5 100755 --- a/bacula/src/filed/win32/winservice.cpp +++ b/bacula/src/filed/win32/winservice.cpp @@ -54,7 +54,7 @@ void set_service_description(SC_HANDLE hSCManager, SC_HANDLE hService, bacService init; -DWORD g_platform_id; +extern DWORD g_platform_id; bacService::bacService() { diff --git a/bacula/src/lib/winapi.c b/bacula/src/lib/winapi.c index 917d1c8268..3c1d16390d 100644 --- a/bacula/src/lib/winapi.c +++ b/bacula/src/lib/winapi.c @@ -31,6 +31,10 @@ #include "winapi.h" +// init with win9x, but maybe set to NT in InitWinAPI +DWORD g_platform_id = VER_PLATFORM_WIN32_WINDOWS; + + /* API Pointers */ t_OpenProcessToken p_OpenProcessToken = NULL; @@ -70,6 +74,7 @@ t_SetCurrentDirectoryW p_SetCurrentDirectoryW = NULL; t_GetCurrentDirectoryA p_GetCurrentDirectoryA = NULL; t_GetCurrentDirectoryW p_GetCurrentDirectoryW = NULL; + void InitWinAPIWrapper() { @@ -156,20 +161,17 @@ InitWinAPIWrapper() } // do we run on win 9x ??? - - DWORD dw_platform_id; - OSVERSIONINFO osversioninfo; osversioninfo.dwOSVersionInfoSize = sizeof(osversioninfo); // Get the current OS version if (!GetVersionEx(&osversioninfo)) { - dw_platform_id = 0; + g_platform_id = 0; } else { - dw_platform_id = osversioninfo.dwPlatformId; + g_platform_id = osversioninfo.dwPlatformId; } - if (dw_platform_id == VER_PLATFORM_WIN32_WINDOWS) { + if (g_platform_id == VER_PLATFORM_WIN32_WINDOWS) { p_BackupRead = NULL; p_BackupWrite = NULL; -- 2.39.5