]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/win32/compat/vss_generic.cpp
This commit was manufactured by cvs2svn to create tag
[bacula/bacula] / bacula / src / win32 / compat / vss_generic.cpp
index 75387df27267cffa886a30f6045ccde79deafa69..94beae42f0ce0eb3d4ca5e6aa5b446865fadf0c8 100644 (file)
@@ -4,7 +4,7 @@
 // Copyright transferred from MATRIX-Computer GmbH to
 //   Kern Sibbald by express permission.
 //
-//  Copyright (C) 2005 Kern Sibbald
+//  Copyright (C) 2005-2006 Kern Sibbald
 //
 //  This program is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU General Public License
@@ -67,6 +67,8 @@ using namespace std;
 #ifdef B_VSS_XP
    #pragma message("compile VSS for Windows XP")   
    #define VSSClientGeneric VSSClientXP
+   // wait is not available under XP...
+   #define VSS_TIMEOUT
 
    #include "vss/inc/WinXP/vss.h"
    #include "vss/inc/WinXP/vswriter.h"
@@ -85,6 +87,9 @@ using namespace std;
 #ifdef B_VSS_W2K3
    #pragma message("compile VSS for Windows 2003")
    #define VSSClientGeneric VSSClient2003
+   // wait x ms for a VSS asynchronous operation (-1 = infinite)
+   // unfortunately, it doesn't work, so do not set timeout
+   #define VSS_TIMEOUT
 
    #include "vss/inc/Win2003/vss.h"
    #include "vss/inc/Win2003/vswriter.h"
@@ -277,8 +282,10 @@ BOOL VSSClientGeneric::Initialize(DWORD dwContext, BOOL bDuringRestore)
 
 void VSSClientGeneric::WaitAndCheckForAsyncOperation(IVssAsync* pAsync)
 {
-     // Wait until the async operation finishes
-    HRESULT hr = pAsync->Wait();
+    // Wait until the async operation finishes
+    // unfortunately we can't use a timeout here yet.
+    // the interface would allow it on W2k3, but it is not implemented yet....
+    HRESULT hr = pAsync->Wait(VSS_TIMEOUT);
 
     // Check the result of the asynchronous operation
     HRESULT hrReturned = S_OK;