client/{directory.h,file.h}: reactos parts are no longer public
authorshort <>
Sat, 22 Mar 2003 19:59:31 +0000 (19:59 +0000)
committershort <>
Sat, 22 Mar 2003 19:59:31 +0000 (19:59 +0000)
 - it required compat-wrapped reactos include files for regular clients

src/libcaptive/client/directory.c
src/libcaptive/client/directory.h [new file with mode: 0644]
src/libcaptive/client/file.c
src/libcaptive/client/file.h [new file with mode: 0644]
src/libcaptive/include/captive/client-directory.h
src/libcaptive/include/captive/client-file.h

index 2bb883e..534e5f8 100644 (file)
@@ -20,6 +20,7 @@
 #include "config.h"
 
 #include "captive/client-directory.h"  /* self */
+#include "directory.h" /* self-priv */
 #include "lib.h"
 #include <glib/gmessages.h>
 #include "captive/unicode.h"
diff --git a/src/libcaptive/client/directory.h b/src/libcaptive/client/directory.h
new file mode 100644 (file)
index 0000000..d675a7c
--- /dev/null
@@ -0,0 +1,61 @@
+/* $Id$
+ * Include file for captive vfs 'directory' private interface to reactos
+ * Copyright (C) 2003 Jan Kratochvil <project-captive@jankratochvil.net>
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; exactly version 2 of June 1991 is required
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+
+#ifndef _CAPTIVE_CLIENT_PRIV_DIRECTORY_H
+#define _CAPTIVE_CLIENT_PRIV_DIRECTORY_H 1
+
+
+#include <glib/gmacros.h>
+#include <glib/gtypes.h>
+#include "reactos/napi/types.h"        /* for NTSTATUS */
+#include "reactos/ntos/zwtypes.h"      /* for FILE_ID_BOTH_DIR_INFORMATION */
+
+
+G_BEGIN_DECLS
+
+struct _CaptiveDirectoryObject {
+       GObject parent_instance;
+
+       /*< private >*/
+       HANDLE dir_Handle;
+       gboolean read_first;
+       /* 'QueryDirectory_buf' for NtQueryDirectoryFile() must be persistent
+        * to keep the state if !read_first.
+        * Both types of 'QueryDirectory_buf' MUST NOT be 'union' as we convert
+        * them by copying one to other.
+        */
+       struct {
+               char FileIdBothDirInformation[sizeof(FILE_ID_BOTH_DIR_INFORMATION)
+                               +0x1000 /* max 'FileName' length, 255 should be enough */ * sizeof(WCHAR /* *FILE_ID_BOTH_DIR_INFORMATION.FileName */ )];
+               char FileBothDirInformation[sizeof(FILE_BOTH_DIR_INFORMATION)
+                               +0x1000 /* max 'FileName' length, 255 should be enough */ * sizeof(WCHAR /* *FILE_ID_BOTH_DIR_INFORMATION.FileName */ )];
+               } QueryDirectory_buf;
+       enum {
+               CaptiveDirectoryObject_QueryDirectory_type_FileIdBothDirInformation,
+               CaptiveDirectoryObject_QueryDirectory_type_FileBothDirInformation,
+               } CaptiveDirectoryObject_QueryDirectory_type;
+       };
+struct _CaptiveDirectoryObjectClass {
+       GObjectClass parent_class;
+       };
+
+G_END_DECLS
+
+
+#endif /* _CAPTIVE_CLIENT_PRIV_DIRECTORY_H */
index 4aeb93c..e8df7a8 100644 (file)
@@ -20,6 +20,8 @@
 #include "config.h"
 
 #include "captive/client-file.h"       /* self */
+#include "file.h"      /* self-priv */
+#include "directory.h"
 #include "lib.h"
 #include <glib/gmessages.h>
 #include "captive/unicode.h"
@@ -655,6 +657,7 @@ gchar *pathname_new_dirname,*pathname_new_basename;
 CaptiveDirectoryObject *captive_target_directory_object;
 FILE_OBJECT *target_dir_FileObject;
 UNICODE_STRING *target_dir_FileObject_FileName_UnicodeString_local;
+BOOLEAN errboolean;
 
        g_return_val_if_fail(captive_file_object_old!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
        g_return_val_if_fail(captive_file_object_old->file_Handle!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
@@ -684,7 +687,9 @@ UNICODE_STRING *target_dir_FileObject_FileName_UnicodeString_local;
         * as the directory is fully determined by its other attributes.
         */
        target_dir_FileObject_FileName_UnicodeString_local=captive_utf8_to_UnicodeString_alloca(pathname_new_basename);
-       target_dir_FileObject->FileName=*target_dir_FileObject_FileName_UnicodeString_local;
+       errboolean=RtlCreateUnicodeString(&target_dir_FileObject->FileName,
+                       target_dir_FileObject_FileName_UnicodeString_local->Buffer);
+       g_assert(errboolean==TRUE);
 
        ObDereferenceObject(target_dir_FileObject);
 
diff --git a/src/libcaptive/client/file.h b/src/libcaptive/client/file.h
new file mode 100644 (file)
index 0000000..3af3cf0
--- /dev/null
@@ -0,0 +1,45 @@
+/* $Id$
+ * Include file for captive vfs 'file' private interface to reactos
+ * Copyright (C) 2003 Jan Kratochvil <project-captive@jankratochvil.net>
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; exactly version 2 of June 1991 is required
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+
+#ifndef _CAPTIVE_CLIENT_PRIV_FILE_H
+#define _CAPTIVE_CLIENT_PRIV_FILE_H 1
+
+
+#include <glib/gmacros.h>
+#include <glib/gtypes.h>
+#include "reactos/napi/types.h"        /* for NTSTATUS */
+
+
+G_BEGIN_DECLS
+
+struct _CaptiveFileObject {
+       GObject parent_instance;
+
+       /*< private >*/
+       HANDLE file_Handle;
+       GnomeVFSFileOffset offset;
+       };
+struct _CaptiveFileObjectClass {
+       GObjectClass parent_class;
+       };
+
+G_END_DECLS
+
+
+#endif /* _CAPTIVE_CLIENT_PRIV_FILE_H */
index 6b1049e..5b70dc9 100644 (file)
@@ -23,8 +23,6 @@
 
 #include <glib/gmacros.h>
 #include <glib-object.h>
-#include "reactos/ntos/types.h"        /* for HANDLE */
-#include "reactos/ntos/zwtypes.h"      /* for FILE_ID_BOTH_DIR_INFORMATION */
 #include <libgnomevfs/gnome-vfs-file-info.h>   /* for GnomeVFSFileInfo */
 
 
@@ -38,31 +36,7 @@ G_BEGIN_DECLS
 #define CAPTIVE_DIRECTORY_OBJECT_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),CAPTIVE_DIRECTORY_TYPE_OBJECT,CaptiveDirectoryObjectClass))
 typedef struct _CaptiveDirectoryObject      CaptiveDirectoryObject;
 typedef struct _CaptiveDirectoryObjectClass CaptiveDirectoryObjectClass;
-struct _CaptiveDirectoryObject {
-       GObject parent_instance;
 
-       /*< private >*/
-       HANDLE dir_Handle;
-       gboolean read_first;
-       /* 'QueryDirectory_buf' for NtQueryDirectoryFile() must be persistent
-        * to keep the state if !read_first.
-        * Both types of 'QueryDirectory_buf' MUST NOT be 'union' as we convert
-        * them by copying one to other.
-        */
-       struct {
-               char FileIdBothDirInformation[sizeof(FILE_ID_BOTH_DIR_INFORMATION)
-                               +0x1000 /* max 'FileName' length, 255 should be enough */ * sizeof(WCHAR /* *FILE_ID_BOTH_DIR_INFORMATION.FileName */ )];
-               char FileBothDirInformation[sizeof(FILE_BOTH_DIR_INFORMATION)
-                               +0x1000 /* max 'FileName' length, 255 should be enough */ * sizeof(WCHAR /* *FILE_ID_BOTH_DIR_INFORMATION.FileName */ )];
-               } QueryDirectory_buf;
-       enum {
-               CaptiveDirectoryObject_QueryDirectory_type_FileIdBothDirInformation,
-               CaptiveDirectoryObject_QueryDirectory_type_FileBothDirInformation,
-               } CaptiveDirectoryObject_QueryDirectory_type;
-       };
-struct _CaptiveDirectoryObjectClass {
-       GObjectClass parent_class;
-       };
 
 GType captive_directory_object_get_type(void);
 
index f7d76a3..7c3e344 100644 (file)
@@ -23,8 +23,6 @@
 
 #include <glib/gmacros.h>
 #include <glib-object.h>
-#include "reactos/ntos/types.h"        /* for HANDLE */
-#include "reactos/ntos/zwtypes.h"      /* for FILE_ID_BOTH_DIR_INFORMATION */
 #include <libgnomevfs/gnome-vfs-handle.h>      /* for GnomeVFSOpenMode */
 
 
@@ -38,16 +36,7 @@ G_BEGIN_DECLS
 #define CAPTIVE_FILE_OBJECT_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),CAPTIVE_FILE_TYPE_OBJECT,CaptiveFileObjectClass))
 typedef struct _CaptiveFileObject      CaptiveFileObject;
 typedef struct _CaptiveFileObjectClass CaptiveFileObjectClass;
-struct _CaptiveFileObject {
-       GObject parent_instance;
 
-       /*< private >*/
-       HANDLE file_Handle;
-       GnomeVFSFileOffset offset;
-       };
-struct _CaptiveFileObjectClass {
-       GObjectClass parent_class;
-       };
 
 GType captive_file_object_get_type(void);