=?UTF-8?Q?Andr=C3=A9=20Hentschel=20?=: kernel32: Add partial CreateFile2 implementation.

Alexandre Julliard julliard at winehq.org
Tue Sep 10 14:49:56 CDT 2013


Module: wine
Branch: master
Commit: fa6b0580702b1cdcf97f64ac34b53095604c1230
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=fa6b0580702b1cdcf97f64ac34b53095604c1230

Author: André Hentschel <nerv at dawncrow.de>
Date:   Tue Sep 10 00:24:55 2013 +0200

kernel32: Add partial CreateFile2 implementation.

---

 dlls/kernel32/file.c        |   15 +++++++++++++++
 dlls/kernel32/kernel32.spec |    1 +
 include/Makefile.in         |    1 +
 include/fileapi.h           |   41 +++++++++++++++++++++++++++++++++++++++++
 4 files changed, 58 insertions(+), 0 deletions(-)

diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c
index 89e0fad..506b651 100644
--- a/dlls/kernel32/file.c
+++ b/dlls/kernel32/file.c
@@ -42,6 +42,7 @@
 #include "wincon.h"
 #include "ddk/ntddk.h"
 #include "kernel_private.h"
+#include "fileapi.h"
 
 #include "wine/exception.h"
 #include "wine/unicode.h"
@@ -1527,6 +1528,20 @@ HANDLE WINAPI CreateFileA( LPCSTR filename, DWORD access, DWORD sharing,
     return CreateFileW( nameW, access, sharing, sa, creation, attributes, template );
 }
 
+/*************************************************************************
+ *              CreateFile2              (KERNEL32.@)
+ */
+HANDLE WINAPI CreateFile2( LPCWSTR filename, DWORD access, DWORD sharing, DWORD creation,
+                           CREATEFILE2_EXTENDED_PARAMETERS *exparams )
+{
+    LPSECURITY_ATTRIBUTES sa = exparams ? exparams->lpSecurityAttributes : NULL;
+    DWORD attributes = exparams ? exparams->dwFileAttributes : 0;
+    HANDLE template = exparams ? exparams->hTemplateFile : NULL;
+
+    FIXME("(%s %x %x %x %p), partial stub\n", debugstr_w(filename), access, sharing, creation, exparams);
+
+    return CreateFileW( filename, access, sharing, sa, creation, attributes, template );
+}
 
 /***********************************************************************
  *           DeleteFileW   (KERNEL32.@)
diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec
index 57cc38b..08b225f 100644
--- a/dlls/kernel32/kernel32.spec
+++ b/dlls/kernel32/kernel32.spec
@@ -229,6 +229,7 @@
 @ stdcall CreateEventW(ptr long long wstr)
 @ stdcall CreateFiber(long ptr ptr)
 @ stdcall CreateFiberEx(long long long ptr ptr)
+@ stdcall CreateFile2(wstr long long long ptr)
 @ stdcall CreateFileA(str long long ptr long long long)
 @ stdcall CreateFileMappingA(long ptr long long long str)
 @ stdcall CreateFileMappingW(long ptr long long long wstr)
diff --git a/include/Makefile.in b/include/Makefile.in
index 3da2977..d40284e 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -302,6 +302,7 @@ SRCDIR_INCLUDES = \
 	exdispid.h \
 	fci.h \
 	fdi.h \
+	fileapi.h \
 	fltdefs.h \
 	gdiplus.h \
 	gdipluscolor.h \
diff --git a/include/fileapi.h b/include/fileapi.h
new file mode 100644
index 0000000..02bbbd4
--- /dev/null
+++ b/include/fileapi.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2013 André Hentschel
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef __WINE_FILEAPI_H
+#define __WINE_FILEAPI_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct _CREATEFILE2_EXTENDED_PARAMETERS {
+    DWORD dwSize;
+    DWORD dwFileAttributes;
+    DWORD dwFileFlags;
+    DWORD dwSecurityQosFlags;
+    LPSECURITY_ATTRIBUTES lpSecurityAttributes;
+    HANDLE hTemplateFile;
+} CREATEFILE2_EXTENDED_PARAMETERS, *PCREATEFILE2_EXTENDED_PARAMETERS, *LPCREATEFILE2_EXTENDED_PARAMETERS;
+
+WINBASEAPI HANDLE WINAPI CreateFile2(LPCWSTR,DWORD,DWORD,DWORD,LPCREATEFILE2_EXTENDED_PARAMETERS);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif  /* __WINE_FILEAPI_H */




More information about the wine-cvs mailing list