]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/findlib/win32filter.h
Restore win32 dir from Branch-5.2 and update it
[bacula/bacula] / bacula / src / findlib / win32filter.h
index 048ce9406a8f4ef41f3f020784510adf62776981..d65f073d6f2e0d2ec91f548ce469e28a78fb0f0b 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula(R) - The Network Backup Solution
 
-   Copyright (C) 2000-2015 Kern Sibbald
+   Copyright (C) 2000-2018 Kern Sibbald
 
    The original author of Bacula is Kern Sibbald, with contributions
    from many others, a complete list can be found in the file AUTHORS.
    Public License, v3.0 ("AGPLv3") and some additional permissions and
    terms pursuant to its AGPLv3 Section 7.
 
-   This notice must be preserved when any source code is 
+   This notice must be preserved when any source code is
    conveyed and/or propagated.
 
    Bacula(R) is a registered trademark of Kern Sibbald.
 */
 
-#ifndef WIN32FILTER_H
-#define WIN32FILTER_H
+/* Pulled from other files by Alain Spineux */
+
+#ifndef WIN32FILTER_H_
+#define WIN32FILTER_H_
 
 #include "bacula.h"
-#include "bfile.h"      /* for BWIN32_STREAM_ID */
+
+/* this should physically correspond to WIN32_STREAM_ID
+ * from winbase.h on Win32. We didn't inlcude cStreamName
+ * as we don't use it and don't need it for a correct struct size.
+ */
+
+#define WIN32_BACKUP_DATA 1
+
+typedef struct _BWIN32_STREAM_ID {
+        int32_t        dwStreamId;
+        int32_t        dwStreamAttributes;
+        int64_t        Size;
+        int32_t        dwStreamNameSize;
+} BWIN32_STREAM_ID, *LPBWIN32_STREAM_ID ;
 
 class Win32Filter
 {
 public:
+   bool    initialized;
    int64_t skip_size;   /* how many bytes we have to skip before next header */
    int64_t data_size;   /* how many data are expected in the stream */
    int     header_pos;  /* the part of the header that was filled in by previous record */
@@ -37,6 +53,7 @@ public:
    };
    
    void init() {
+      initialized = false;
       skip_size = 0;
       data_size = 0;
       header_pos = 0;
@@ -48,6 +65,9 @@ public:
       data_size = f->data_size;
       header_pos = f->header_pos;
       header = f->header;
+      initialized = (skip_size != 0  ||
+                     data_size != 0  ||
+                     header_pos != 0);
    };
 
    /* If the stream is HHHDDDDD, you can call  have_data("HHHDDDDD", 8, <not used>)