From fa6b0580702b1cdcf97f64ac34b53095604c1230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Hentschel?= Date: Tue, 10 Sep 2013 00:24:55 +0200 Subject: [PATCH] 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(+) create mode 100644 include/fileapi.h diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c index 89e0fad63dd..506b651920b 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 57cc38bacdb..08b225f48d2 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 3da29774a89..d40284e3226 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 00000000000..02bbbd4d920 --- /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 */