p_SetCurrentDirectoryA?"":"!",
p_SetCurrentDirectoryW?"":"!");
sendit(msg, len, arg);
- len = Mmsg(msg, " %sGCDA,%sGCDW\n",
+ len = Mmsg(msg, " %sGCDA,%sGCDW,%sGVPNW,%sGVNFVMPW\n",
p_GetCurrentDirectoryA?"":"!",
- p_GetCurrentDirectoryW?"":"!");
+ p_GetCurrentDirectoryW?"":"!",
+ p_GetVolumePathNameW?"":"!",
+ p_GetVolumeNameForVolumeMountPointW?"":"!");
sendit(msg, len, arg);
}
#endif
t_GetCurrentDirectoryA p_GetCurrentDirectoryA = NULL;
t_GetCurrentDirectoryW p_GetCurrentDirectoryW = NULL;
+t_GetVolumePathNameW p_GetVolumePathNameW = NULL;
+t_GetVolumeNameForVolumeMountPointW p_GetVolumeNameForVolumeMountPointW = NULL;
+
#ifdef WIN32_VSS
void
VSSCleanup()
GetProcAddress(hLib, "GetCurrentDirectoryA");
p_GetCurrentDirectoryW = (t_GetCurrentDirectoryW)
GetProcAddress(hLib, "GetCurrentDirectoryW");
+
+ /* some special stuff we need for VSS
+ but statically linkage doesn't work on Win 9x */
+ p_GetVolumePathNameW = (t_GetVolumePathNameW)
+ GetProcAddress(hLib, "GetVolumePathNameW");
+ p_GetVolumeNameForVolumeMountPointW = (t_GetVolumeNameForVolumeMountPointW)
+ GetProcAddress(hLib, "GetVolumeNameForVolumeMountPointW");
+
FreeLibrary(hLib);
}
p_wunlink = NULL;
p_wmkdir = NULL;
p_wopen = NULL;
+
+ p_GetVolumePathNameW = NULL;
+ p_GetVolumeNameForVolumeMountPointW = NULL;
}
/* decide which vss class to initialize */
typedef DWORD (WINAPI * t_GetCurrentDirectoryA) (DWORD, LPSTR);
typedef DWORD (WINAPI * t_GetCurrentDirectoryW) (DWORD, LPWSTR);
+typedef BOOL (WINAPI * t_GetVolumePathNameW) (LPCWSTR, LPWSTR, DWORD);
+typedef BOOL (WINAPI * t_GetVolumeNameForVolumeMountPointW) (LPCWSTR, LPWSTR, DWORD);
+
extern t_GetFileAttributesA p_GetFileAttributesA;
extern t_GetFileAttributesW p_GetFileAttributesW;
extern t_GetCurrentDirectoryA p_GetCurrentDirectoryA;
extern t_GetCurrentDirectoryW p_GetCurrentDirectoryW;
+extern t_GetVolumePathNameW p_GetVolumePathNameW;
+extern t_GetVolumeNameForVolumeMountPointW p_GetVolumeNameForVolumeMountPointW;
+
#ifdef WIN32_VSS
class VSSClient;
extern VSSClient* g_pVSSClient;
// Used for safe string manipulation
#include <strsafe.h>
+#include "../../lib/winapi.h"
+
#ifdef B_VSS_XP
#pragma message("compile VSS for Windows XP")
#define VSSClientGeneric VSSClientXP
// Get the unique volume name for the given path
inline wstring GetUniqueVolumeNameForPath(wstring path)
{
- _ASSERTE(path.length() > 0);
+ _ASSERTE(path.length() > 0);
// Add the backslash termination, if needed
path = AppendBackslash(path);
WCHAR volumeName[MAX_PATH];
WCHAR volumeUniqueName[MAX_PATH];
- if (!GetVolumePathNameW((LPCWSTR)path.c_str(), volumeRootPath, MAX_PATH))
+ if (!p_GetVolumePathNameW || !p_GetVolumePathNameW((LPCWSTR)path.c_str(), volumeRootPath, MAX_PATH))
return L"";
// Get the volume name alias (might be different from the unique volume name in rare cases)
- if (!GetVolumeNameForVolumeMountPointW(volumeRootPath, volumeName, MAX_PATH))
+ if (!p_GetVolumeNameForVolumeMountPointW || !p_GetVolumeNameForVolumeMountPointW(volumeRootPath, volumeName, MAX_PATH))
return L"";
// Get the unique volume name
- if (!GetVolumeNameForVolumeMountPointW(volumeName, volumeUniqueName, MAX_PATH))
+ if (!p_GetVolumeNameForVolumeMountPointW(volumeName, volumeUniqueName, MAX_PATH))
return L"";
return volumeUniqueName;