NT Native API File functions

Mike McCormack mikem at codeweavers.com
Sun Jun 2 17:29:38 CDT 2002


Hi,

I have a small dilema. I'd like to implement the functions below, and 
declare them in a header file somewhere, but they are not declared by 
Microsoft in any of their header files. (Checked the NT DDK, VC++ 
headers and Platform SDK.)

So, should I:
* go ahead and declare them like this
* add an #ifdef DECLARE_NATIVEAPI / #endif around the functions
* put them in a private header file in (say dlls/ntdll/native.h )

or just leave them out all together?

Anyway, feel free to apply this if it's the right way to do it...

Mike

License: LGPL (as always)

ChangeLog:
* declare NtCreateFile() NtOpenFile() and NtReadFile()
-------------- next part --------------
Index: include/ntddk.h
===================================================================
RCS file: /home/wine/wine/include/ntddk.h,v
retrieving revision 1.44
diff -u -r1.44 ntddk.h
--- include/ntddk.h	31 May 2002 23:06:48 -0000	1.44
+++ include/ntddk.h	2 Jun 2002 13:51:35 -0000
@@ -1027,6 +1027,31 @@
 BOOL     WINAPI RtlTryEnterCriticalSection( RTL_CRITICAL_SECTION *crit );
 NTSTATUS WINAPI RtlLeaveCriticalSection( RTL_CRITICAL_SECTION *crit );
 
+/* file functions */
+
+/* flags for NtCreateFile and NtOpenFile */
+#define FILE_DIRECTORY_FLAG  0x00000001
+#define FILE_WRITE_THROUGH   0x00000002
+#define FILE_SEQUENTIAL_ONLY 0x00000004
+#define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008
+#define FILE_SYNCHRONOUS_IO_ALERT    0x00000010
+#define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
+#define FILE_NON_DIRECTORY_FILE      0x00000040
+#define FILE_CREATE_TREE_CONNECTION  0x00000080
+
+/* status for NtCreateFile or NtOpenFile */
+#define FILE_SUPERSEDED  0x00000000
+#define FILE_OPENED      0x00000001
+#define FILE_CREATED     0x00000002
+#define FILE_OVERWRITTEN 0x00000003
+#define FILE_EXISTS      0x00000004
+#define FILE_DOES_NOT_EXIST 0x00000005
+
+NTSTATUS WINAPI NtCreateFile(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, PIO_STATUS_BLOCK, PLARGE_INTEGER, ULONG, ULONG, ULONG, ULONG, PVOID, ULONG);
+NTSTATUS WINAPI NtOpenFile(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, PIO_STATUS_BLOCK, ULONG, ULONG);
+NTSTATUS WINAPI NtReadFile(HANDLE, HANDLE, PIO_APC_ROUTINE, PVOID, PIO_STATUS_BLOCK, PVOID, ULONG, PLARGE_INTEGER, PULONG);
+
+
 /* string functions */
 extern LPSTR _strlwr( LPSTR str );
 extern LPSTR _strupr( LPSTR str );


More information about the wine-devel mailing list