diff --git a/dlls/shlwapi/ordinal.c b/dlls/shlwapi/ordinal.c index e3d021f41ef..334607eda9a 100644 --- a/dlls/shlwapi/ordinal.c +++ b/dlls/shlwapi/ordinal.c @@ -4842,7 +4842,7 @@ typedef struct SHELL_USER_PERMISSION { /* ...and this should be in shlwapi.h */ * NOTES * Call should free returned descriptor with LocalFree */ -PSECURITY_DESCRIPTOR WINAPI GetShellSecurityDescriptor(PSHELL_USER_PERMISSION *apUserPerm, int cUserPerm) +PSECURITY_DESCRIPTOR WINAPI GetShellSecurityDescriptor(const PSHELL_USER_PERMISSION *apUserPerm, int cUserPerm) { PSID *sidlist; PSID cur_user = NULL; diff --git a/dlls/shlwapi/tests/ordinal.c b/dlls/shlwapi/tests/ordinal.c index afccd3a906f..2a1eaeddebb 100644 --- a/dlls/shlwapi/tests/ordinal.c +++ b/dlls/shlwapi/tests/ordinal.c @@ -72,6 +72,23 @@ static HWND (WINAPI *pSHSetParentHwnd)(HWND, HWND); static HRESULT (WINAPI *pIUnknown_GetClassID)(IUnknown*, CLSID*); static HRESULT (WINAPI *pDllGetVersion)(DLLVERSIONINFO2*); +typedef struct SHELL_USER_SID { + SID_IDENTIFIER_AUTHORITY sidAuthority; + DWORD dwUserGroupID; + DWORD dwUserID; +} SHELL_USER_SID, *PSHELL_USER_SID; +typedef struct SHELL_USER_PERMISSION { + + SHELL_USER_SID susID; + DWORD dwAccessType; + BOOL fInherit; + DWORD dwAccessMask; + DWORD dwInheritMask; + DWORD dwInheritAccessMask; +} SHELL_USER_PERMISSION, *PSHELL_USER_PERMISSION; + +static SECURITY_DESCRIPTOR* (WINAPI *pGetShellSecurityDescriptor)(const SHELL_USER_PERMISSION**,int); + static HMODULE hmlang; static HRESULT (WINAPI *pLcidToRfc1766A)(LCID, LPSTR, INT); @@ -676,40 +693,23 @@ static void test_fdsa(void) HeapFree(GetProcessHeap(), 0, mem); } - -typedef struct SHELL_USER_SID { - SID_IDENTIFIER_AUTHORITY sidAuthority; - DWORD dwUserGroupID; - DWORD dwUserID; -} SHELL_USER_SID, *PSHELL_USER_SID; -typedef struct SHELL_USER_PERMISSION { - SHELL_USER_SID susID; - DWORD dwAccessType; - BOOL fInherit; - DWORD dwAccessMask; - DWORD dwInheritMask; - DWORD dwInheritAccessMask; -} SHELL_USER_PERMISSION, *PSHELL_USER_PERMISSION; static void test_GetShellSecurityDescriptor(void) { - SHELL_USER_PERMISSION supCurrentUserFull = { + static const SHELL_USER_PERMISSION supCurrentUserFull = { { {SECURITY_NULL_SID_AUTHORITY}, 0, 0 }, ACCESS_ALLOWED_ACE_TYPE, FALSE, GENERIC_ALL, 0, 0 }; #define MY_INHERITANCE 0xBE /* invalid value to proof behavior */ - SHELL_USER_PERMISSION supEveryoneDenied = { + static const SHELL_USER_PERMISSION supEveryoneDenied = { { {SECURITY_WORLD_SID_AUTHORITY}, SECURITY_WORLD_RID, 0 }, ACCESS_DENIED_ACE_TYPE, TRUE, GENERIC_WRITE, MY_INHERITANCE | 0xDEADBA00, GENERIC_READ }; - PSHELL_USER_PERMISSION rgsup[2] = { + const SHELL_USER_PERMISSION* rgsup[2] = { &supCurrentUserFull, &supEveryoneDenied, }; SECURITY_DESCRIPTOR* psd; - SECURITY_DESCRIPTOR* (WINAPI*pGetShellSecurityDescriptor)(PSHELL_USER_PERMISSION*,int); void *pChrCmpIW = GetProcAddress(hShlwapi, "ChrCmpIW"); - pGetShellSecurityDescriptor=(void*)GetProcAddress(hShlwapi,(char*)475); - if(!pGetShellSecurityDescriptor) { win_skip("GetShellSecurityDescriptor not available\n"); @@ -3064,6 +3064,7 @@ static void init_pointers(void) MAKEFUNC(SHFormatDateTimeA, 353); MAKEFUNC(SHFormatDateTimeW, 354); MAKEFUNC(SHIShellFolder_EnumObjects, 404); + MAKEFUNC(GetShellSecurityDescriptor, 475); MAKEFUNC(SHGetObjectCompatFlags, 476); MAKEFUNC(IUnknown_QueryServiceExec, 484); MAKEFUNC(SHGetShellKey, 491);