From 93eeaa417dfe74da07c501dd52387cbebfbdda5c Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Mon, 16 Aug 2004 23:18:23 +0000 Subject: [PATCH] Implemented Get/SetFileSecurity A->W. --- dlls/advapi32/security.c | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c index db37bed8da4..a1dcf4833f0 100644 --- a/dlls/advapi32/security.c +++ b/dlls/advapi32/security.c @@ -973,8 +973,23 @@ GetFileSecurityA( LPCSTR lpFileName, PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength, LPDWORD lpnLengthNeeded ) { - FIXME("(%s) : stub\n", debugstr_a(lpFileName)); - return TRUE; + DWORD len; + BOOL r; + LPWSTR name = NULL; + + if( lpFileName ) + { + len = MultiByteToWideChar( CP_ACP, 0, lpFileName, -1, NULL, 0 ); + name = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) ); + MultiByteToWideChar( CP_ACP, 0, lpFileName, -1, name, len ); + } + + r = GetFileSecurityW( name, RequestedInformation, pSecurityDescriptor, + nLength, lpnLengthNeeded ); + if( name ) + HeapFree( GetProcessHeap(), 0, name ); + + return r; } /****************************************************************************** @@ -1076,8 +1091,22 @@ BOOL WINAPI SetFileSecurityA( LPCSTR lpFileName, SECURITY_INFORMATION RequestedInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor) { - FIXME("(%s) : stub\n", debugstr_a(lpFileName)); - return TRUE; + DWORD len; + BOOL r; + LPWSTR name = NULL; + + if( lpFileName ) + { + len = MultiByteToWideChar( CP_ACP, 0, lpFileName, -1, NULL, 0 ); + name = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) ); + MultiByteToWideChar( CP_ACP, 0, lpFileName, -1, name, len ); + } + + r = SetFileSecurityW( name, RequestedInformation, pSecurityDescriptor ); + if( name ) + HeapFree( GetProcessHeap(), 0, name ); + + return r; } /****************************************************************************** -- 2.11.4.GIT