kernel32: Add partial CreateFile2 implementation (try2)
André Hentschel
nerv at dawncrow.de
Mon Sep 9 17:24:55 CDT 2013
Needed for minizip (test application for zlib) on ARM
see Vincents https://github.com/madewokherd/zlib
---
dlls/kernel32/file.c | 15 +++++++++++++++
dlls/kernel32/kernel32.spec | 1 +
include/fileapi.h | 41 +++++++++++++++++++++++++++++++++++++++++
3 files changed, 57 insertions(+)
create mode 100644 include/fileapi.h
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/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 */
--
1.8.1.2
More information about the wine-patches
mailing list