Moved policy related functions to shpolicy.c
Moved dialog related functions to dialogs.c
This commit is contained in:
parent
6b266db3c6
commit
85b9293495
|
@ -19,6 +19,7 @@ C_SRCS = \
|
||||||
classes.c \
|
classes.c \
|
||||||
clipboard.c \
|
clipboard.c \
|
||||||
dataobject.c \
|
dataobject.c \
|
||||||
|
dialogs.c \
|
||||||
enumidlist.c \
|
enumidlist.c \
|
||||||
folders.c \
|
folders.c \
|
||||||
iconcache.c \
|
iconcache.c \
|
||||||
|
|
|
@ -0,0 +1,63 @@
|
||||||
|
/*
|
||||||
|
* common shell dialogs
|
||||||
|
*/
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include "winerror.h"
|
||||||
|
#include "debugtools.h"
|
||||||
|
|
||||||
|
#include "shellapi.h"
|
||||||
|
#include "shlobj.h"
|
||||||
|
#include "shell32_main.h"
|
||||||
|
#include "wine/undocshell.h"
|
||||||
|
|
||||||
|
DEFAULT_DEBUG_CHANNEL(shell);
|
||||||
|
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* PickIconDlg [SHELL32.62]
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
BOOL WINAPI PickIconDlg(
|
||||||
|
HWND hwndOwner,
|
||||||
|
LPSTR lpstrFile,
|
||||||
|
DWORD nMaxFile,
|
||||||
|
LPDWORD lpdwIconIndex)
|
||||||
|
{
|
||||||
|
FIXME("(%08x,%s,%08lx,%p):stub.\n",
|
||||||
|
hwndOwner, lpstrFile, nMaxFile,lpdwIconIndex);
|
||||||
|
return 0xffffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* RunFileDlg [SHELL32.61]
|
||||||
|
*
|
||||||
|
* NOTES
|
||||||
|
* Original name: RunFileDlg (exported by ordinal)
|
||||||
|
*/
|
||||||
|
void WINAPI RunFileDlg(
|
||||||
|
HWND hwndOwner,
|
||||||
|
HICON hIcon,
|
||||||
|
LPCSTR lpstrDirectory,
|
||||||
|
LPCSTR lpstrTitle,
|
||||||
|
LPCSTR lpstrDescription,
|
||||||
|
UINT uFlags)
|
||||||
|
{
|
||||||
|
FIXME("(0x%04x 0x%04x %s %s %s 0x%08x):stub.\n",
|
||||||
|
hwndOwner, hIcon, lpstrDirectory, lpstrTitle, lpstrDescription, uFlags);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* ExitWindowsDialog [SHELL32.60]
|
||||||
|
*
|
||||||
|
* NOTES
|
||||||
|
* exported by ordinal
|
||||||
|
*/
|
||||||
|
void WINAPI ExitWindowsDialog (HWND hWndOwner)
|
||||||
|
{
|
||||||
|
TRACE("(0x%08x)\n", hWndOwner);
|
||||||
|
if (MessageBoxA( hWndOwner, "Do you want to exit WINE?", "Shutdown", MB_YESNO|MB_ICONQUESTION) == IDOK)
|
||||||
|
{
|
||||||
|
SendMessageA ( hWndOwner, WM_QUIT, 0, 0);
|
||||||
|
}
|
||||||
|
}
|
|
@ -19,18 +19,21 @@
|
||||||
#include "shlobj.h"
|
#include "shlobj.h"
|
||||||
#include "shell32_main.h"
|
#include "shell32_main.h"
|
||||||
#include "wine/undocshell.h"
|
#include "wine/undocshell.h"
|
||||||
#include "shpolicy.h"
|
|
||||||
|
|
||||||
DEFAULT_DEBUG_CHANNEL(shell);
|
DEFAULT_DEBUG_CHANNEL(shell);
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* ParseFieldA [SHELL32.58]
|
* ParseFieldA [internal]
|
||||||
*
|
*
|
||||||
* copys a field from a ',' delimited string
|
* copys a field from a ',' delimited string
|
||||||
*
|
*
|
||||||
* first field is nField = 1
|
* first field is nField = 1
|
||||||
*/
|
*/
|
||||||
DWORD WINAPI ParseFieldA(LPCSTR src, DWORD nField, LPSTR dst, DWORD len)
|
DWORD WINAPI ParseFieldA(
|
||||||
|
LPCSTR src,
|
||||||
|
DWORD nField,
|
||||||
|
LPSTR dst,
|
||||||
|
DWORD len)
|
||||||
{
|
{
|
||||||
WARN("('%s',0x%08lx,%p,%ld) semi-stub.\n",src,nField,dst,len);
|
WARN("('%s',0x%08lx,%p,%ld) semi-stub.\n",src,nField,dst,len);
|
||||||
|
|
||||||
|
@ -54,24 +57,49 @@ DWORD WINAPI ParseFieldA(LPCSTR src, DWORD nField, LPSTR dst, DWORD len)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* PickIconDlg [SHELL32.62]
|
* ParseFieldW [internal]
|
||||||
|
*
|
||||||
|
* copys a field from a ',' delimited string
|
||||||
*
|
*
|
||||||
|
* first field is nField = 1
|
||||||
*/
|
*/
|
||||||
DWORD WINAPI PickIconDlg(DWORD x,DWORD y,DWORD z,DWORD a)
|
DWORD WINAPI ParseFieldW(LPCWSTR src, DWORD nField, LPWSTR dst, DWORD len)
|
||||||
{ FIXME("(%08lx,%08lx,%08lx,%08lx):stub.\n",x,y,z,a);
|
{
|
||||||
return 0xffffffff;
|
FIXME("('%s',0x%08lx,%p,%ld) stub.\n",
|
||||||
|
debugstr_w(src), nField, dst, len);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* ParseFieldAW [SHELL32.58]
|
||||||
|
*/
|
||||||
|
DWORD WINAPI ParseFieldAW(LPCVOID src, DWORD nField, LPVOID dst, DWORD len)
|
||||||
|
{
|
||||||
|
if (VERSION_OsIsUnicode())
|
||||||
|
return ParseFieldW(src, nField, dst, len);
|
||||||
|
return ParseFieldA(src, nField, dst, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* GetFileNameFromBrowse [SHELL32.63]
|
* GetFileNameFromBrowse [SHELL32.63]
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
DWORD WINAPI GetFileNameFromBrowse(HWND howner, LPSTR targetbuf, DWORD len, DWORD x, LPCSTR suffix, LPCSTR y, LPCSTR cmd)
|
BOOL WINAPI GetFileNameFromBrowse(
|
||||||
{ FIXME("(%04x,%p,%ld,%08lx,%s,%s,%s):stub.\n",
|
HWND hwndOwner,
|
||||||
howner,targetbuf,len,x,suffix,y,cmd);
|
LPSTR lpstrFile,
|
||||||
|
DWORD nMaxFile,
|
||||||
|
LPCSTR lpstrInitialDir,
|
||||||
|
LPCSTR lpstrDefExt,
|
||||||
|
LPCSTR lpstrFilter,
|
||||||
|
LPCSTR lpstrTitle)
|
||||||
|
{
|
||||||
|
FIXME("(%04x,%s,%ld,%s,%s,%s,%s):stub.\n",
|
||||||
|
hwndOwner, lpstrFile, nMaxFile, lpstrInitialDir, lpstrDefExt,
|
||||||
|
lpstrFilter, lpstrTitle);
|
||||||
|
|
||||||
/* puts up a Open Dialog and requests input into targetbuf */
|
/* puts up a Open Dialog and requests input into targetbuf */
|
||||||
/* OFN_HIDEREADONLY|OFN_NOCHANGEDIR|OFN_FILEMUSTEXIST|OFN_unknown */
|
/* OFN_HIDEREADONLY|OFN_NOCHANGEDIR|OFN_FILEMUSTEXIST|OFN_unknown */
|
||||||
lstrcpyA(targetbuf,"x:\\dummy.exe");
|
lstrcpyA(lpstrFile,"x:\\dummy.exe");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,9 +174,13 @@ void WINAPI SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask, DWORD dwx)
|
||||||
* shell view to re-sort the item list. lParam identifies the column
|
* shell view to re-sort the item list. lParam identifies the column
|
||||||
* that was clicked.
|
* that was clicked.
|
||||||
*/
|
*/
|
||||||
int WINAPI SHShellFolderView_Message(HWND hwndCabinet,UINT uMsg,LPARAM lParam)
|
int WINAPI SHShellFolderView_Message(
|
||||||
{ FIXME("%04x %08ux %08lx stub\n",hwndCabinet,uMsg,lParam);
|
HWND hwndCabinet,
|
||||||
return 0;
|
DWORD dwMessage,
|
||||||
|
DWORD dwParam)
|
||||||
|
{
|
||||||
|
FIXME("%04x %08lx %08lx stub\n",hwndCabinet, dwMessage, dwParam);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
|
@ -214,8 +246,12 @@ BOOL WINAPI StrToOleStrNAW (LPWSTR lpWide, INT nWide, LPCVOID lpStr, INT nStr)
|
||||||
* NOTES
|
* NOTES
|
||||||
* exported by ordinal
|
* exported by ordinal
|
||||||
*/
|
*/
|
||||||
void WINAPI RegisterShellHook(HWND hwnd, DWORD y) {
|
BOOL WINAPI RegisterShellHook(
|
||||||
FIXME("(0x%08x,0x%08lx):stub.\n",hwnd,y);
|
HWND hWnd,
|
||||||
|
DWORD dwType)
|
||||||
|
{
|
||||||
|
FIXME("(0x%08x,0x%08lx):stub.\n",hWnd, dwType);
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* ShellMessageBoxW [SHELL32.182]
|
* ShellMessageBoxW [SHELL32.182]
|
||||||
|
@ -228,170 +264,71 @@ void WINAPI RegisterShellHook(HWND hwnd, DWORD y) {
|
||||||
* NOTES
|
* NOTES
|
||||||
* exported by ordinal
|
* exported by ordinal
|
||||||
*/
|
*/
|
||||||
INT __cdecl
|
int WINAPIV ShellMessageBoxW(
|
||||||
ShellMessageBoxW(HMODULE hmod,HWND hwnd,DWORD idText,DWORD idTitle,DWORD uType,LPCVOID arglist)
|
HINSTANCE hInstance,
|
||||||
{ WCHAR szText[100],szTitle[100],szTemp[256];
|
HWND hWnd,
|
||||||
LPWSTR pszText = &szText[0], pszTitle = &szTitle[0];
|
LPCWSTR lpText,
|
||||||
LPVOID args = &arglist;
|
LPCWSTR lpCaption,
|
||||||
|
UINT uType,
|
||||||
|
...)
|
||||||
|
{
|
||||||
|
WCHAR szText[100],szTitle[100],szTemp[256];
|
||||||
|
LPCWSTR pszText = szText, pszTitle = szTitle;
|
||||||
|
va_list args;
|
||||||
|
va_start(args, uType);
|
||||||
|
/* wvsprintfA(buf,fmt, args); */
|
||||||
|
va_end(args);
|
||||||
|
|
||||||
TRACE("(%08lx,%08lx,%08lx,%08lx,%08lx,%p)\n",(DWORD)hmod,(DWORD)hwnd,idText,idTitle,uType,arglist);
|
TRACE("(%08lx,%08lx,%p,%p,%08x)\n",
|
||||||
|
(DWORD)hInstance,(DWORD)hWnd,lpText,lpCaption,uType);
|
||||||
|
|
||||||
if (!HIWORD (idTitle))
|
if (!HIWORD(lpCaption))
|
||||||
LoadStringW(hmod,idTitle,pszTitle,100);
|
LoadStringW(hInstance, (DWORD)lpCaption, szTitle, 100);
|
||||||
else
|
else
|
||||||
pszTitle = (LPWSTR)idTitle;
|
pszTitle = lpCaption;
|
||||||
|
|
||||||
if (! HIWORD (idText))
|
if (!HIWORD(lpText))
|
||||||
LoadStringW(hmod,idText,pszText,100);
|
LoadStringW(hInstance, (DWORD)lpText, szText, 100);
|
||||||
else
|
else
|
||||||
pszText = (LPWSTR)idText;
|
pszText = lpText;
|
||||||
|
|
||||||
FormatMessageW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ARGUMENT_ARRAY ,szText,0,0,szTemp,256,args);
|
FormatMessageW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ARGUMENT_ARRAY ,szText,0,0,szTemp,256,args);
|
||||||
return MessageBoxW(hwnd,szTemp,szTitle,uType);
|
return MessageBoxW(hWnd,szTemp,szTitle,uType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* ShellMessageBoxA [SHELL32.183]
|
* ShellMessageBoxA [SHELL32.183]
|
||||||
*/
|
*/
|
||||||
INT __cdecl
|
int WINAPIV ShellMessageBoxA(
|
||||||
ShellMessageBoxA(HMODULE hmod,HWND hwnd,DWORD idText,DWORD idTitle,DWORD uType,LPCVOID arglist)
|
HINSTANCE hInstance,
|
||||||
{ char szText[100],szTitle[100],szTemp[256];
|
HWND hWnd,
|
||||||
LPSTR pszText = &szText[0], pszTitle = &szTitle[0];
|
LPCSTR lpText,
|
||||||
LPVOID args = &arglist;
|
LPCSTR lpCaption,
|
||||||
|
UINT uType,
|
||||||
TRACE("(%08lx,%08lx,%08lx,%08lx,%08lx,%p)\n", (DWORD)hmod,(DWORD)hwnd,idText,idTitle,uType,arglist);
|
...)
|
||||||
|
|
||||||
if (!HIWORD (idTitle))
|
|
||||||
LoadStringA(hmod,idTitle,pszTitle,100);
|
|
||||||
else
|
|
||||||
pszTitle = (LPSTR)idTitle;
|
|
||||||
|
|
||||||
if (! HIWORD (idText))
|
|
||||||
LoadStringA(hmod,idText,pszText,100);
|
|
||||||
else
|
|
||||||
pszText = (LPSTR)idText;
|
|
||||||
|
|
||||||
FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ARGUMENT_ARRAY ,pszText,0,0,szTemp,256,args);
|
|
||||||
return MessageBoxA(hwnd,szTemp,pszTitle,uType);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
* SHRestricted [SHELL32.100]
|
|
||||||
*
|
|
||||||
* walks through policy table, queries <app> key, <type> value, returns
|
|
||||||
* queried (DWORD) value, and caches it between called to SHInitRestricted
|
|
||||||
* to prevent unnecessary registry access.
|
|
||||||
*
|
|
||||||
* NOTES
|
|
||||||
* exported by ordinal
|
|
||||||
*
|
|
||||||
* REFERENCES:
|
|
||||||
* MS System Policy Editor
|
|
||||||
* 98Lite 2.0 (which uses many of these policy keys) http://www.98lite.net/
|
|
||||||
* "The Windows 95 Registry", by John Woram, 1996 MIS: Press
|
|
||||||
*/
|
|
||||||
DWORD WINAPI SHRestricted (DWORD pol) {
|
|
||||||
char regstr[256];
|
|
||||||
HKEY xhkey;
|
|
||||||
DWORD retval, polidx, i, datsize = 4;
|
|
||||||
|
|
||||||
TRACE("(%08lx)\n",pol);
|
|
||||||
|
|
||||||
polidx = -1;
|
|
||||||
|
|
||||||
/* scan to see if we know this policy ID */
|
|
||||||
for (i = 0; i < SHELL_MAX_POLICIES; i++)
|
|
||||||
{
|
|
||||||
if (pol == sh32_policy_table[i].polflags)
|
|
||||||
{
|
|
||||||
polidx = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (polidx == -1)
|
|
||||||
{
|
|
||||||
/* we don't know this policy, return 0 */
|
|
||||||
TRACE("unknown policy: (%08lx)\n", pol);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* we have a known policy */
|
|
||||||
lstrcpyA(regstr, "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\");
|
|
||||||
lstrcatA(regstr, sh32_policy_table[polidx].appstr);
|
|
||||||
|
|
||||||
/* first check if this policy has been cached, return it if so */
|
|
||||||
if (sh32_policy_table[polidx].cache != SHELL_NO_POLICY)
|
|
||||||
{
|
|
||||||
return sh32_policy_table[polidx].cache;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* return 0 and don't set the cache if any registry errors occur */
|
|
||||||
retval = 0;
|
|
||||||
if (RegOpenKeyA(HKEY_CURRENT_USER, regstr, &xhkey) == ERROR_SUCCESS)
|
|
||||||
{
|
|
||||||
if (RegQueryValueExA(xhkey, sh32_policy_table[polidx].keystr, NULL, NULL, (LPBYTE)&retval, &datsize) == ERROR_SUCCESS)
|
|
||||||
{
|
|
||||||
sh32_policy_table[polidx].cache = retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
RegCloseKey(xhkey);
|
|
||||||
}
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
* SHInitRestricted [SHELL32.244]
|
|
||||||
*
|
|
||||||
* Win98+ by-ordinal only routine called by Explorer and MSIE 4 and 5.
|
|
||||||
* Inits the policy cache used by SHRestricted to avoid excess
|
|
||||||
* registry access.
|
|
||||||
*
|
|
||||||
* INPUTS
|
|
||||||
* Two inputs: one is a string or NULL. If non-NULL the pointer
|
|
||||||
* should point to a string containing the following exact text:
|
|
||||||
* "Software\Microsoft\Windows\CurrentVersion\Policies".
|
|
||||||
* The other input is unused.
|
|
||||||
*
|
|
||||||
* NOTES
|
|
||||||
* If the input is non-NULL and does not point to a string containing
|
|
||||||
* that exact text the routine will do nothing.
|
|
||||||
*
|
|
||||||
* If the text does match or the pointer is NULL, then the routine
|
|
||||||
* will init SHRestricted()'s policy cache to all 0xffffffff and
|
|
||||||
* returns 0xffffffff as well.
|
|
||||||
*
|
|
||||||
* I haven't yet run into anything calling this with inputs other than
|
|
||||||
* (NULL, NULL), so I may have the inputs reversed.
|
|
||||||
*/
|
|
||||||
|
|
||||||
BOOL WINAPI SHInitRestricted(LPSTR inpRegKey, LPSTR parm2)
|
|
||||||
{
|
{
|
||||||
int i;
|
char szText[100],szTitle[100],szTemp[256];
|
||||||
|
LPCSTR pszText = szText, pszTitle = szTitle;
|
||||||
|
va_list args;
|
||||||
|
va_start(args, uType);
|
||||||
|
/* wvsprintfA(buf,fmt, args); */
|
||||||
|
va_end(args);
|
||||||
|
|
||||||
TRACE("(%p, %p)\n", inpRegKey, parm2);
|
TRACE("(%08lx,%08lx,%p,%p,%08x)\n",
|
||||||
|
(DWORD)hInstance,(DWORD)hWnd,lpText,lpCaption,uType);
|
||||||
|
|
||||||
/* first check - if input is non-NULL and points to the secret
|
if (!HIWORD(lpCaption))
|
||||||
key string, then pass. Otherwise return 0.
|
LoadStringA(hInstance, (DWORD)lpCaption, szTitle, 100);
|
||||||
*/
|
else
|
||||||
|
pszTitle = lpCaption;
|
||||||
|
|
||||||
if (inpRegKey != (LPSTR)NULL)
|
if (!HIWORD(lpText))
|
||||||
{
|
LoadStringA(hInstance, (DWORD)lpText, szText, 100);
|
||||||
if (lstrcmpiA(inpRegKey, "Software\\Microsoft\\Windows\\CurrentVersion\\Policies"))
|
else
|
||||||
{
|
pszText = lpText;
|
||||||
/* doesn't match, fail */
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* check passed, init all policy cache entries with SHELL_NO_POLICY */
|
FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ARGUMENT_ARRAY ,szText,0,0,szTemp,256,args);
|
||||||
for (i = 0; i < SHELL_MAX_POLICIES; i++)
|
return MessageBoxA(hWnd,szTemp,szTitle,uType);
|
||||||
{
|
|
||||||
sh32_policy_table[i].cache = SHELL_NO_POLICY;
|
|
||||||
}
|
|
||||||
|
|
||||||
return SHELL_NO_POLICY;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
|
@ -402,7 +339,7 @@ BOOL WINAPI SHInitRestricted(LPSTR inpRegKey, LPSTR parm2)
|
||||||
* exported by ordinal
|
* exported by ordinal
|
||||||
*/
|
*/
|
||||||
#define MEM_DEBUG 1
|
#define MEM_DEBUG 1
|
||||||
DWORD WINAPI SHFree(LPVOID x)
|
void WINAPI SHFree(LPVOID x)
|
||||||
{
|
{
|
||||||
#if MEM_DEBUG
|
#if MEM_DEBUG
|
||||||
WORD len = *(LPWORD)((LPBYTE)x-2);
|
WORD len = *(LPWORD)((LPBYTE)x-2);
|
||||||
|
@ -421,7 +358,7 @@ DWORD WINAPI SHFree(LPVOID x)
|
||||||
#else
|
#else
|
||||||
TRACE("%p\n",x);
|
TRACE("%p\n",x);
|
||||||
#endif
|
#endif
|
||||||
return HeapFree(GetProcessHeap(), 0, x);
|
HeapFree(GetProcessHeap(), 0, x);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
|
@ -458,7 +395,9 @@ LPVOID WINAPI SHAlloc(DWORD len)
|
||||||
* NOTES
|
* NOTES
|
||||||
* exported by ordinal
|
* exported by ordinal
|
||||||
*/
|
*/
|
||||||
DWORD WINAPI SHRegisterDragDrop(HWND hWnd,IDropTarget * pDropTarget)
|
HRESULT WINAPI SHRegisterDragDrop(
|
||||||
|
HWND hWnd,
|
||||||
|
LPDROPTARGET pDropTarget)
|
||||||
{
|
{
|
||||||
FIXME("(0x%08x,%p):stub.\n", hWnd, pDropTarget);
|
FIXME("(0x%08x,%p):stub.\n", hWnd, pDropTarget);
|
||||||
if (GetShellOle()) return pRegisterDragDrop(hWnd, pDropTarget);
|
if (GetShellOle()) return pRegisterDragDrop(hWnd, pDropTarget);
|
||||||
|
@ -471,8 +410,9 @@ DWORD WINAPI SHRegisterDragDrop(HWND hWnd,IDropTarget * pDropTarget)
|
||||||
* NOTES
|
* NOTES
|
||||||
* exported by ordinal
|
* exported by ordinal
|
||||||
*/
|
*/
|
||||||
DWORD WINAPI SHRevokeDragDrop(DWORD x) {
|
HRESULT WINAPI SHRevokeDragDrop(HWND hWnd)
|
||||||
FIXME("(0x%08lx):stub.\n",x);
|
{
|
||||||
|
FIXME("(0x%08x):stub.\n",hWnd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -482,50 +422,31 @@ DWORD WINAPI SHRevokeDragDrop(DWORD x) {
|
||||||
* NOTES
|
* NOTES
|
||||||
* exported by ordinal
|
* exported by ordinal
|
||||||
*/
|
*/
|
||||||
DWORD WINAPI SHDoDragDrop(DWORD u, DWORD v, DWORD w, DWORD x, DWORD y, DWORD z) {
|
HRESULT WINAPI SHDoDragDrop(
|
||||||
FIXME("(0x%08lx 0x%08lx 0x%08lx 0x%08lx 0x%08lx 0x%08lx):stub.\n",u,v,w,x,y,z);
|
HWND hWnd,
|
||||||
return 0;
|
LPDATAOBJECT lpDataObject,
|
||||||
}
|
LPDROPSOURCE lpDropSource,
|
||||||
|
DWORD dwOKEffect,
|
||||||
/*************************************************************************
|
LPDWORD pdwEffect)
|
||||||
* RunFileDlg [SHELL32.61]
|
|
||||||
*
|
|
||||||
* NOTES
|
|
||||||
* Original name: RunFileDlg (exported by ordinal)
|
|
||||||
*/
|
|
||||||
DWORD WINAPI
|
|
||||||
RunFileDlg (HWND hwndOwner, DWORD dwParam1, DWORD dwParam2,
|
|
||||||
LPSTR lpszTitle, LPSTR lpszPrompt, UINT uFlags)
|
|
||||||
{
|
{
|
||||||
FIXME("(0x%08x 0x%lx 0x%lx \"%s\" \"%s\" 0x%x):stub.\n",
|
FIXME("(0x%04x %p %p 0x%08lx %p):stub.\n",
|
||||||
hwndOwner, dwParam1, dwParam2, lpszTitle, lpszPrompt, uFlags);
|
hWnd, lpDataObject, lpDropSource, dwOKEffect, pdwEffect);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
* ExitWindowsDialog [SHELL32.60]
|
|
||||||
*
|
|
||||||
* NOTES
|
|
||||||
* exported by ordinal
|
|
||||||
*/
|
|
||||||
void WINAPI ExitWindowsDialog (HWND hWndOwner)
|
|
||||||
{
|
|
||||||
TRACE("(0x%08x)\n", hWndOwner);
|
|
||||||
if (MessageBoxA( hWndOwner, "Do you want to exit WINE?", "Shutdown", MB_YESNO|MB_ICONQUESTION) == IDOK)
|
|
||||||
{ SendMessageA ( hWndOwner, WM_QUIT, 0, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* ArrangeWindows [SHELL32.184]
|
* ArrangeWindows [SHELL32.184]
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
DWORD WINAPI
|
WORD WINAPI ArrangeWindows(
|
||||||
ArrangeWindows (DWORD dwParam1, DWORD dwParam2, DWORD dwParam3,
|
HWND hwndParent,
|
||||||
DWORD dwParam4, DWORD dwParam5)
|
DWORD dwReserved,
|
||||||
|
LPCRECT lpRect,
|
||||||
|
WORD cKids,
|
||||||
|
CONST HWND * lpKids)
|
||||||
{
|
{
|
||||||
FIXME("(0x%lx 0x%lx 0x%lx 0x%lx 0x%lx):stub.\n",
|
FIXME("(0x%08x 0x%08lx %p 0x%04x %p):stub.\n",
|
||||||
dwParam1, dwParam2, dwParam3, dwParam4, dwParam5);
|
hwndParent, dwReserved, lpRect, cKids, lpKids);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -569,16 +490,17 @@ DWORD WINAPI SHAddToRecentDocs (UINT uFlags,LPCVOID pv)
|
||||||
* see IShellFolder::CreateViewObject
|
* see IShellFolder::CreateViewObject
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI SHCreateShellFolderViewEx(
|
HRESULT WINAPI SHCreateShellFolderViewEx(
|
||||||
LPSHELLVIEWDATA psvcbi, /*[in ] shelltemplate struct*/
|
LPCSHELLFOLDERVIEWINFO psvcbi, /*[in ] shelltemplate struct*/
|
||||||
LPVOID* ppv) /*[out] IShellView pointer*/
|
LPSHELLVIEW* ppv) /*[out] IShellView pointer*/
|
||||||
{
|
{
|
||||||
IShellView * psf;
|
IShellView * psf;
|
||||||
HRESULT hRes;
|
HRESULT hRes;
|
||||||
|
|
||||||
TRACE("sf=%p pidl=%p cb=%p mode=0x%08lx parm=0x%08lx\n",
|
TRACE("sf=%p pidl=%p cb=%p mode=0x%08x parm=0x%08lx\n",
|
||||||
psvcbi->pShellFolder, psvcbi->pidl, psvcbi->pCallBack, psvcbi->viewmode, psvcbi->dwUserParam);
|
psvcbi->pshf, psvcbi->pidlFolder, psvcbi->lpfnCallback,
|
||||||
|
psvcbi->uViewMode, psvcbi->dwUser);
|
||||||
|
|
||||||
psf = IShellView_Constructor(psvcbi->pShellFolder);
|
psf = IShellView_Constructor(psvcbi->pshf);
|
||||||
|
|
||||||
if (!psf)
|
if (!psf)
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
|
@ -627,6 +549,8 @@ BOOL WINAPI ShellExecuteExAW (LPVOID sei)
|
||||||
* %S ???
|
* %S ???
|
||||||
* %* all following parameters (see batfile)
|
* %* all following parameters (see batfile)
|
||||||
*/
|
*/
|
||||||
|
#include "process.h" /* we can get rid of it hopefully */
|
||||||
|
#include "task.h"
|
||||||
BOOL WINAPI ShellExecuteExA (LPSHELLEXECUTEINFOA sei)
|
BOOL WINAPI ShellExecuteExA (LPSHELLEXECUTEINFOA sei)
|
||||||
{ CHAR szApplicationName[MAX_PATH],szCommandline[MAX_PATH],szPidl[20];
|
{ CHAR szApplicationName[MAX_PATH],szCommandline[MAX_PATH],szPidl[20];
|
||||||
LPSTR pos;
|
LPSTR pos;
|
||||||
|
@ -677,9 +601,11 @@ BOOL WINAPI ShellExecuteExA (LPSHELLEXECUTEINFOA sei)
|
||||||
pos = strstr(szCommandline, "%I");
|
pos = strstr(szCommandline, "%I");
|
||||||
if (pos)
|
if (pos)
|
||||||
{
|
{
|
||||||
|
LPVOID pv;
|
||||||
HGLOBAL hmem = SHAllocShared ( sei->lpIDList, ILGetSize(sei->lpIDList), 0);
|
HGLOBAL hmem = SHAllocShared ( sei->lpIDList, ILGetSize(sei->lpIDList), 0);
|
||||||
sprintf(szPidl,":%li",(DWORD)SHLockShared(hmem,0) );
|
pv = SHLockShared(hmem,0);
|
||||||
SHUnlockShared(hmem);
|
sprintf(szPidl,":%p",pv );
|
||||||
|
SHUnlockShared(pv);
|
||||||
|
|
||||||
gap = strlen(szPidl);
|
gap = strlen(szPidl);
|
||||||
len = strlen(pos)-2;
|
len = strlen(pos)-2;
|
||||||
|
@ -794,9 +720,9 @@ HRESULT WINAPI SHGetInstanceExplorer (LPUNKNOWN * lpUnknown)
|
||||||
* NOTES
|
* NOTES
|
||||||
* exported by name
|
* exported by name
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI SHFreeUnusedLibraries (void)
|
void WINAPI SHFreeUnusedLibraries (void)
|
||||||
{ FIXME("stub\n");
|
{
|
||||||
return TRUE;
|
FIXME("stub\n");
|
||||||
}
|
}
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* DAD_SetDragImage [SHELL32.136]
|
* DAD_SetDragImage [SHELL32.136]
|
||||||
|
@ -804,8 +730,11 @@ HRESULT WINAPI SHFreeUnusedLibraries (void)
|
||||||
* NOTES
|
* NOTES
|
||||||
* exported by name
|
* exported by name
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI DAD_SetDragImage (DWORD u, DWORD v)
|
BOOL WINAPI DAD_SetDragImage(
|
||||||
{ FIXME("0x%08lx 0x%08lx stub\n",u, v);
|
HIMAGELIST himlTrack,
|
||||||
|
LPPOINT lppt)
|
||||||
|
{
|
||||||
|
FIXME("%p %p stub\n",himlTrack, lppt);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
|
@ -814,9 +743,10 @@ HRESULT WINAPI DAD_SetDragImage (DWORD u, DWORD v)
|
||||||
* NOTES
|
* NOTES
|
||||||
* exported by name
|
* exported by name
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI DAD_ShowDragImage (DWORD u)
|
BOOL WINAPI DAD_ShowDragImage(BOOL bShow)
|
||||||
{ FIXME("0x%08lx stub\n",u);
|
{
|
||||||
return 0;
|
FIXME("0x%08x stub\n",bShow);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* SHRegCloseKey [NT4.0:SHELL32.505]
|
* SHRegCloseKey [NT4.0:SHELL32.505]
|
||||||
|
@ -886,6 +816,8 @@ HRESULT WINAPI SHRegQueryValueExW (HKEY hkey, LPWSTR pszValue, LPDWORD pdwReserv
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* SHGetValue: Gets a value from the registry */
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* SHGetValueA
|
* SHGetValueA
|
||||||
*
|
*
|
||||||
|
@ -924,6 +856,8 @@ DWORD WINAPI SHGetValueW(
|
||||||
return ERROR_SUCCESS; /* return success */
|
return ERROR_SUCCESS; /* return success */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* gets a user-specific registry value. */
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* SHRegGetUSValueA
|
* SHRegGetUSValueA
|
||||||
*
|
*
|
||||||
|
@ -1187,9 +1121,10 @@ LPVOID WINAPI SHLockShared(HANDLE hmem, DWORD procID)
|
||||||
* NOTES
|
* NOTES
|
||||||
* parameter1 is return value from SHLockShared
|
* parameter1 is return value from SHLockShared
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI SHUnlockShared(HANDLE pmem)
|
BOOL WINAPI SHUnlockShared(LPVOID pv)
|
||||||
{ TRACE("handle=0x%04x\n",pmem);
|
{
|
||||||
return GlobalUnlock(pmem);
|
TRACE("%p\n",pv);
|
||||||
|
return GlobalUnlock((HANDLE)pv);
|
||||||
}
|
}
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* SHFreeShared [SHELL32.523]
|
* SHFreeShared [SHELL32.523]
|
||||||
|
@ -1198,14 +1133,16 @@ BOOL WINAPI SHUnlockShared(HANDLE pmem)
|
||||||
* parameter1 is return value from SHAllocShared
|
* parameter1 is return value from SHAllocShared
|
||||||
* parameter2 is return value from GetCurrentProcessId
|
* parameter2 is return value from GetCurrentProcessId
|
||||||
*/
|
*/
|
||||||
HANDLE WINAPI SHFreeShared(HANDLE hmem, DWORD procID)
|
BOOL WINAPI SHFreeShared(
|
||||||
{ TRACE("handle=0x%04x 0x%04lx\n",hmem,procID);
|
HANDLE hMem,
|
||||||
return GlobalFree(hmem);
|
DWORD pid)
|
||||||
|
{
|
||||||
|
TRACE("handle=0x%04x 0x%04lx\n",hMem,pid);
|
||||||
|
return GlobalFree(hMem);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* SetAppStartingCursor [SHELL32.99]
|
* SetAppStartingCursor [SHELL32.99]
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI SetAppStartingCursor(HWND u, DWORD v)
|
HRESULT WINAPI SetAppStartingCursor(HWND u, DWORD v)
|
||||||
{ FIXME("hwnd=0x%04x 0x%04lx stub\n",u,v );
|
{ FIXME("hwnd=0x%04x 0x%04lx stub\n",u,v );
|
||||||
|
@ -1239,8 +1176,12 @@ HRESULT WINAPI SHAbortInvokeCommand(void)
|
||||||
* SHOutOfMemoryMessageBox [SHELL32.126]
|
* SHOutOfMemoryMessageBox [SHELL32.126]
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI SHOutOfMemoryMessageBox(DWORD u, DWORD v, DWORD w)
|
int WINAPI SHOutOfMemoryMessageBox(
|
||||||
{ FIXME("0x%04lx 0x%04lx 0x%04lx stub\n",u,v,w);
|
HWND hwndOwner,
|
||||||
|
LPCSTR lpCaption,
|
||||||
|
UINT uType)
|
||||||
|
{
|
||||||
|
FIXME("0x%04x %s 0x%08x stub\n",hwndOwner, lpCaption, uType);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
|
@ -1299,8 +1240,12 @@ LPWSTR WINAPI StrFormatByteSizeW ( DWORD dw, LPWSTR pszBuf, UINT cchBuf )
|
||||||
* SHWaitForFileToOpen [SHELL32.97]
|
* SHWaitForFileToOpen [SHELL32.97]
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI SHWaitForFileToOpen(DWORD u, DWORD v, DWORD w)
|
BOOL WINAPI SHWaitForFileToOpen(
|
||||||
{ FIXME("0x%04lx 0x%04lx 0x%04lx stub\n",u,v,w);
|
LPCITEMIDLIST pidl,
|
||||||
|
DWORD dwFlags,
|
||||||
|
DWORD dwTimeout)
|
||||||
|
{
|
||||||
|
FIXME("%p 0x%08lx 0x%08lx stub\n", pidl, dwFlags, dwTimeout);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
|
|
|
@ -18,8 +18,26 @@
|
||||||
|
|
||||||
#include "windef.h"
|
#include "windef.h"
|
||||||
#include "wingdi.h"
|
#include "wingdi.h"
|
||||||
|
#include "winerror.h"
|
||||||
|
#include "winreg.h"
|
||||||
|
#include "debugtools.h"
|
||||||
#include "wine/winuser16.h"
|
#include "wine/winuser16.h"
|
||||||
#include "shpolicy.h"
|
|
||||||
|
DEFAULT_DEBUG_CHANNEL(shell);
|
||||||
|
|
||||||
|
#define SHELL_MAX_POLICIES 57
|
||||||
|
|
||||||
|
#define SHELL_NO_POLICY 0xffffffff
|
||||||
|
|
||||||
|
typedef struct tagPOLICYDAT
|
||||||
|
{
|
||||||
|
DWORD polflags; /* flags value passed to SHRestricted */
|
||||||
|
LPSTR appstr; /* application str such as "Explorer" */
|
||||||
|
LPSTR keystr; /* name of the actual registry key / policy */
|
||||||
|
DWORD cache; /* cached value or 0xffffffff for invalid */
|
||||||
|
} POLICYDATA, *LPPOLICYDATA;
|
||||||
|
|
||||||
|
//extern POLICYDATA sh32_policy_table[SHELL_MAX_POLICIES];
|
||||||
|
|
||||||
/* application strings */
|
/* application strings */
|
||||||
|
|
||||||
|
@ -434,3 +452,122 @@ POLICYDATA sh32_policy_table[] =
|
||||||
SHELL_NO_POLICY
|
SHELL_NO_POLICY
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* SHRestricted [SHELL32.100]
|
||||||
|
*
|
||||||
|
* walks through policy table, queries <app> key, <type> value, returns
|
||||||
|
* queried (DWORD) value, and caches it between called to SHInitRestricted
|
||||||
|
* to prevent unnecessary registry access.
|
||||||
|
*
|
||||||
|
* NOTES
|
||||||
|
* exported by ordinal
|
||||||
|
*
|
||||||
|
* REFERENCES:
|
||||||
|
* MS System Policy Editor
|
||||||
|
* 98Lite 2.0 (which uses many of these policy keys) http://www.98lite.net/
|
||||||
|
* "The Windows 95 Registry", by John Woram, 1996 MIS: Press
|
||||||
|
*/
|
||||||
|
DWORD WINAPI SHRestricted (DWORD pol) {
|
||||||
|
char regstr[256];
|
||||||
|
HKEY xhkey;
|
||||||
|
DWORD retval, polidx, i, datsize = 4;
|
||||||
|
|
||||||
|
TRACE("(%08lx)\n",pol);
|
||||||
|
|
||||||
|
polidx = -1;
|
||||||
|
|
||||||
|
/* scan to see if we know this policy ID */
|
||||||
|
for (i = 0; i < SHELL_MAX_POLICIES; i++)
|
||||||
|
{
|
||||||
|
if (pol == sh32_policy_table[i].polflags)
|
||||||
|
{
|
||||||
|
polidx = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (polidx == -1)
|
||||||
|
{
|
||||||
|
/* we don't know this policy, return 0 */
|
||||||
|
TRACE("unknown policy: (%08lx)\n", pol);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* we have a known policy */
|
||||||
|
lstrcpyA(regstr, "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\");
|
||||||
|
lstrcatA(regstr, sh32_policy_table[polidx].appstr);
|
||||||
|
|
||||||
|
/* first check if this policy has been cached, return it if so */
|
||||||
|
if (sh32_policy_table[polidx].cache != SHELL_NO_POLICY)
|
||||||
|
{
|
||||||
|
return sh32_policy_table[polidx].cache;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* return 0 and don't set the cache if any registry errors occur */
|
||||||
|
retval = 0;
|
||||||
|
if (RegOpenKeyA(HKEY_CURRENT_USER, regstr, &xhkey) == ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
if (RegQueryValueExA(xhkey, sh32_policy_table[polidx].keystr, NULL, NULL, (LPBYTE)&retval, &datsize) == ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
sh32_policy_table[polidx].cache = retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
RegCloseKey(xhkey);
|
||||||
|
}
|
||||||
|
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* SHInitRestricted [SHELL32.244]
|
||||||
|
*
|
||||||
|
* Win98+ by-ordinal only routine called by Explorer and MSIE 4 and 5.
|
||||||
|
* Inits the policy cache used by SHRestricted to avoid excess
|
||||||
|
* registry access.
|
||||||
|
*
|
||||||
|
* INPUTS
|
||||||
|
* Two inputs: one is a string or NULL. If non-NULL the pointer
|
||||||
|
* should point to a string containing the following exact text:
|
||||||
|
* "Software\Microsoft\Windows\CurrentVersion\Policies".
|
||||||
|
* The other input is unused.
|
||||||
|
*
|
||||||
|
* NOTES
|
||||||
|
* If the input is non-NULL and does not point to a string containing
|
||||||
|
* that exact text the routine will do nothing.
|
||||||
|
*
|
||||||
|
* If the text does match or the pointer is NULL, then the routine
|
||||||
|
* will init SHRestricted()'s policy cache to all 0xffffffff and
|
||||||
|
* returns 0xffffffff as well.
|
||||||
|
*
|
||||||
|
* I haven't yet run into anything calling this with inputs other than
|
||||||
|
* (NULL, NULL), so I may have the inputs reversed.
|
||||||
|
*/
|
||||||
|
|
||||||
|
BOOL WINAPI SHInitRestricted(LPSTR inpRegKey, LPSTR parm2)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
TRACE("(%p, %p)\n", inpRegKey, parm2);
|
||||||
|
|
||||||
|
/* first check - if input is non-NULL and points to the secret
|
||||||
|
key string, then pass. Otherwise return 0.
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (inpRegKey != (LPSTR)NULL)
|
||||||
|
{
|
||||||
|
if (lstrcmpiA(inpRegKey, "Software\\Microsoft\\Windows\\CurrentVersion\\Policies"))
|
||||||
|
{
|
||||||
|
/* doesn't match, fail */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* check passed, init all policy cache entries with SHELL_NO_POLICY */
|
||||||
|
for (i = 0; i < SHELL_MAX_POLICIES; i++)
|
||||||
|
{
|
||||||
|
sh32_policy_table[i].cache = SHELL_NO_POLICY;
|
||||||
|
}
|
||||||
|
|
||||||
|
return SHELL_NO_POLICY;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue