Implemented SHLWAPI_266 and SHLWAPI_271.
This commit is contained in:
parent
77357a3f56
commit
40cfe48b7d
|
@ -46,6 +46,7 @@
|
||||||
#include "winuser.h"
|
#include "winuser.h"
|
||||||
#include "wine/debug.h"
|
#include "wine/debug.h"
|
||||||
#include "shlwapi.h"
|
#include "shlwapi.h"
|
||||||
|
#include "ordinal.h"
|
||||||
|
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||||
|
@ -1068,7 +1069,6 @@ HRESULT WINAPI SHLWAPI_168(IUnknown* lpUnkSink, REFIID riid, BOOL bAdviseOnly,
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* @ [SHLWAPI.169]
|
* @ [SHLWAPI.169]
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* Release an interface.
|
* Release an interface.
|
||||||
*
|
*
|
||||||
* PARAMS
|
* PARAMS
|
||||||
|
@ -1371,7 +1371,7 @@ DWORD WINAPI SHLWAPI_180(HMENU hMenu)
|
||||||
* bEnable [I] Whether to enable (TRUE) or disable (FALSE) the item.
|
* bEnable [I] Whether to enable (TRUE) or disable (FALSE) the item.
|
||||||
*
|
*
|
||||||
* RETURNS
|
* RETURNS
|
||||||
* The return code from CheckMenuItem.
|
* The return code from EnableMenuItem.
|
||||||
*/
|
*/
|
||||||
UINT WINAPI SHLWAPI_181(HMENU hMenu, UINT wItemID, BOOL bEnable)
|
UINT WINAPI SHLWAPI_181(HMENU hMenu, UINT wItemID, BOOL bEnable)
|
||||||
{
|
{
|
||||||
|
@ -1912,24 +1912,90 @@ DWORD WINAPI SHLWAPI_241 ()
|
||||||
return /* 0xabba1243 */ 0;
|
return /* 0xabba1243 */ 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* default shell policy registry key */
|
||||||
|
static WCHAR strRegistryPolicyW[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o',
|
||||||
|
's','o','f','t','\\','W','i','n','d','o','w','s','\\',
|
||||||
|
'C','u','r','r','e','n','t','V','e','r','s','i','o','n',
|
||||||
|
'\\','P','o','l','i','c','i','e','s',0};
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* @ [SHLWAPI.266]
|
* @ [SHLWAPI.271]
|
||||||
*
|
*
|
||||||
* native does at least approximately:
|
* Retrieve a policy value from the registry.
|
||||||
* strcpyW(newstr, x);
|
*
|
||||||
* strcatW(newstr, "\\Restrictions");
|
* PARAMS
|
||||||
* if (RegOpenKeyExA(80000001, newstr, 00000000,00000001,40520b78))
|
* lpSubKey [I] registry key name
|
||||||
* return 0;
|
* lpSubName [I] subname of registry key
|
||||||
* *unknown*
|
* lpValue [I] value name of registry value
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* the value associated with the registry key or 0 if not found
|
||||||
|
*/
|
||||||
|
DWORD WINAPI SHLWAPI_271(LPCWSTR lpSubKey, LPCWSTR lpSubName, LPCWSTR lpValue)
|
||||||
|
{
|
||||||
|
DWORD retval, datsize = 4;
|
||||||
|
HKEY hKey;
|
||||||
|
|
||||||
|
if (!lpSubKey)
|
||||||
|
lpSubKey = (LPCWSTR)strRegistryPolicyW;
|
||||||
|
|
||||||
|
retval = RegOpenKeyW(HKEY_LOCAL_MACHINE, lpSubKey, &hKey);
|
||||||
|
if (retval != ERROR_SUCCESS)
|
||||||
|
retval = RegOpenKeyW(HKEY_CURRENT_USER, lpSubKey, &hKey);
|
||||||
|
if (retval != ERROR_SUCCESS)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
SHGetValueW(hKey, lpSubName, lpValue, NULL, (LPBYTE)&retval, &datsize);
|
||||||
|
RegCloseKey(hKey);
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* @ [SHLWAPI.266]
|
||||||
|
*
|
||||||
|
* Helper function to retrieve the possibly cached value for a specific policy
|
||||||
|
*
|
||||||
|
* PARAMS
|
||||||
|
* policy [I] The policy to look for
|
||||||
|
* initial [I] Main registry key to open, if NULL use default
|
||||||
|
* polTable [I] Table of known policies, 0 terminated
|
||||||
|
* polArr [I] Cache array of policy values
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* The retrieved policy value or 0 if not successful
|
||||||
|
*
|
||||||
|
* NOTES
|
||||||
|
* This function is used by the native SHRestricted function to search for the
|
||||||
|
* policy and cache it once retrieved. The current Wine implementation uses a
|
||||||
|
* different POLICYDATA structure and implements a similar algorithme adapted to
|
||||||
|
* that structure.
|
||||||
*/
|
*/
|
||||||
DWORD WINAPI SHLWAPI_266 (
|
DWORD WINAPI SHLWAPI_266 (
|
||||||
LPVOID w,
|
DWORD policy,
|
||||||
LPVOID x, /* [in] partial registry key */
|
LPCWSTR initial, /* [in] partial registry key */
|
||||||
LPVOID y,
|
LPPOLICYDATA polTable,
|
||||||
LPVOID z)
|
LPDWORD polArr)
|
||||||
{
|
{
|
||||||
FIXME("(%p %p %p %p)stub\n",w,x,y,z);
|
TRACE("(0x%08lx %s %p %p)\n", policy, debugstr_w(initial), polTable, polArr);
|
||||||
return /* 0xabba1248 */ 0;
|
|
||||||
|
if (!polTable || !polArr)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
for (;polTable->policy; polTable++, polArr++)
|
||||||
|
{
|
||||||
|
if (policy == polTable->policy)
|
||||||
|
{
|
||||||
|
/* we have a known policy */
|
||||||
|
|
||||||
|
/* check if this policy has been cached */
|
||||||
|
if (*polArr == SHELL_NO_POLICY)
|
||||||
|
*polArr = SHLWAPI_271(initial, polTable->appstr, polTable->keystr);
|
||||||
|
return *polArr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* we don't know this policy, return 0 */
|
||||||
|
TRACE("unknown policy: (%08lx)\n", policy);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
|
|
|
@ -52,6 +52,17 @@ DWORD WINAPI SHLWAPI_2(LPCWSTR x, UNKNOWN_SHLWAPI_2 *y);
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
/* SHLWAPI_266 definitions and structures */
|
||||||
|
#define SHELL_NO_POLICY -1
|
||||||
|
|
||||||
|
typedef struct tagPOLICYDATA
|
||||||
|
{
|
||||||
|
DWORD policy; /* flags value passed to SHRestricted */
|
||||||
|
LPCWSTR appstr; /* application str such as "Explorer" */
|
||||||
|
LPCWSTR keystr; /* name of the actual registry key / policy */
|
||||||
|
} POLICYDATA, *LPPOLICYDATA;
|
||||||
|
|
||||||
|
|
||||||
extern HMODULE SHLWAPI_hshell32;
|
extern HMODULE SHLWAPI_hshell32;
|
||||||
|
|
||||||
/* Shared internal functions */
|
/* Shared internal functions */
|
||||||
|
|
|
@ -212,7 +212,7 @@
|
||||||
212 stdcall @(ptr ptr long) SHLWAPI_212
|
212 stdcall @(ptr ptr long) SHLWAPI_212
|
||||||
213 stdcall @(ptr) SHLWAPI_213
|
213 stdcall @(ptr) SHLWAPI_213
|
||||||
214 stdcall @(ptr ptr) SHLWAPI_214
|
214 stdcall @(ptr ptr) SHLWAPI_214
|
||||||
215 stdcall @(long long long) SHLWAPI_215
|
215 stdcall @(str ptr long) SHLWAPI_215
|
||||||
216 stub @
|
216 stub @
|
||||||
217 stdcall @(wstr ptr ptr) SHLWAPI_217
|
217 stdcall @(wstr ptr ptr) SHLWAPI_217
|
||||||
218 stdcall @(long wstr ptr ptr) SHLWAPI_218
|
218 stdcall @(long wstr ptr ptr) SHLWAPI_218
|
||||||
|
@ -263,12 +263,12 @@
|
||||||
263 stub @
|
263 stub @
|
||||||
264 stub @
|
264 stub @
|
||||||
265 stub @
|
265 stub @
|
||||||
266 stdcall @(long long long long) SHLWAPI_266
|
266 stdcall @(long wstr ptr ptr) SHLWAPI_266
|
||||||
267 stdcall @(long long long long) SHLWAPI_267
|
267 stdcall @(long long long long) SHLWAPI_267
|
||||||
268 stdcall @(long long) SHLWAPI_268
|
268 stdcall @(long long) SHLWAPI_268
|
||||||
269 stub @
|
269 stub @
|
||||||
270 stub @
|
270 stub @
|
||||||
271 stub @
|
271 stdcall @(wstr wstr wstr) SHLWAPI_271
|
||||||
272 stub @
|
272 stub @
|
||||||
273 stub @
|
273 stub @
|
||||||
274 stub @
|
274 stub @
|
||||||
|
|
Loading…
Reference in New Issue