Needed for IE11.
Signed-off-by: Mohamad Al-Jaf mohamadaljaf@gmail.com --- v4: - Don't use static sized buffer. --- dlls/kernel32/Makefile.in | 1 + dlls/kernel32/kernel32.spec | 2 +- dlls/kernel32/security.c | 53 +++++++++++++++++++++++++++++++++++++ include/namespaceapi.h | 2 ++ 4 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 dlls/kernel32/security.c
diff --git a/dlls/kernel32/Makefile.in b/dlls/kernel32/Makefile.in index 7e68a950b71..bda8d03e90c 100644 --- a/dlls/kernel32/Makefile.in +++ b/dlls/kernel32/Makefile.in @@ -23,6 +23,7 @@ C_SRCS = \ process.c \ profile.c \ resource.c \ + security.c \ sync.c \ tape.c \ thread.c \ diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index 818e7d87a2f..cb994a8ce19 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -266,7 +266,7 @@ @ stdcall CopyLZFile(long long) LZCopy @ stdcall CreateActCtxA(ptr) @ stdcall -import CreateActCtxW(ptr) -# @ stub CreateBoundaryDescriptorA +@ stdcall CreateBoundaryDescriptorA(str long) @ stdcall -import CreateBoundaryDescriptorW(wstr long) @ stdcall -import CreateConsoleScreenBuffer(long long ptr long ptr) @ stdcall -import CreateDirectoryA(str ptr) diff --git a/dlls/kernel32/security.c b/dlls/kernel32/security.c new file mode 100644 index 00000000000..dc8c8e58d7d --- /dev/null +++ b/dlls/kernel32/security.c @@ -0,0 +1,53 @@ +/* + * Win32 security functions + * + * Copyright (C) 2022 Mohamad Al-Jaf + * + * 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 + */ + +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "winnls.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(security); + +/****************************************************************************** + * CreateBoundaryDescriptorA (KERNEL32.@) + */ +HANDLE WINAPI CreateBoundaryDescriptorA( LPCSTR name, ULONG flags ) +{ + DWORD len; + HANDLE ret; + LPWSTR str = NULL; + + TRACE( "%s %d\n", debugstr_a(name), flags ); + + if(name) + { + len = MultiByteToWideChar( CP_ACP, 0, name, -1, NULL, 0 ); + str = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) ); + MultiByteToWideChar( CP_ACP, 0, name, -1, str, len ); + } + + ret = CreateBoundaryDescriptorW( str, flags ); + + HeapFree( GetProcessHeap(), 0, str ); + return ret; +} diff --git a/include/namespaceapi.h b/include/namespaceapi.h index 9446806f82e..f219a2a7488 100644 --- a/include/namespaceapi.h +++ b/include/namespaceapi.h @@ -27,7 +27,9 @@ extern "C" {
WINBASEAPI BOOL WINAPI AddSIDToBoundaryDescriptor(HANDLE*,PSID); WINBASEAPI BOOLEAN WINAPI ClosePrivateNamespace(HANDLE,ULONG); +WINBASEAPI HANDLE WINAPI CreateBoundaryDescriptorA(LPCSTR,ULONG); WINBASEAPI HANDLE WINAPI CreateBoundaryDescriptorW(LPCWSTR,ULONG); +#define CreateBoundaryDescriptor WINELIB_NAME_AW(CreateBoundaryDescriptor) WINBASEAPI HANDLE WINAPI CreatePrivateNamespaceW(LPSECURITY_ATTRIBUTES,LPVOID,LPCWSTR); WINBASEAPI void WINAPI DeleteBoundaryDescriptor(HANDLE); WINBASEAPI HANDLE WINAPI OpenPrivateNamespaceW(LPVOID,LPCWSTR);