100 delete[] pIconContext->phIcons;
116 pIconContext->phIcons =
new HICON[pIconContext->nIcons];
118 if (
ExtractIconExW(szExpandedPath, 0, pIconContext->phIcons,
NULL, pIconContext->nIcons))
124 pIconContext->nIcons = 0;
130 pIconContext->nIcons = 1;
131 pIconContext->phIcons =
new HICON[1];
133 if (
ExtractIconExW(szExpandedPath, 0, pIconContext->phIcons,
NULL, pIconContext->nIcons))
139 pIconContext->nIcons = 0;
147 if (pIconContext->nIcons == 0)
149 delete[] pIconContext->phIcons;
150 pIconContext->phIcons =
NULL;
153 return (pIconContext->nIcons > 0);
170 #define CX_ICON GetSystemMetrics(SM_CXICON) 171 #define CY_ICON GetSystemMetrics(SM_CYICON) 174 #define CX_ITEM (CX_ICON + 4) 175 #define CY_ITEM (CY_ICON + 12) 204 if (!
DoLoadIcons(hwndDlg, pIconContext, pIconContext->szPath))
211 if (pIconContext->Index < 0)
219 pIconContext->Index = 0;
230 delete[] pIconContext->phIcons;
362 IconContext.
Index = *lpdwIconIndex;
366 if (!szExpandedPath[0] ||
369 if (szExpandedPath[0])
387 *lpdwIconIndex = IconContext.Index;
425 static const WCHAR dotexeW[] =
L".exe";
441 while (*
src && *
src !=
'"')
460 else if (*
src ==
'\\')
513 if (prfdp->lpstrTitle)
515 if (prfdp->lpstrDescription)
527 FIXME(
"RFF_NOSEPARATEMEM not supported\n");
531 if (prfdp->hIcon ==
NULL)
548 ComboInfo.
cbSize =
sizeof(ComboInfo);
562 if (prfdp->bCoInited)
624 if (prfdp->lpstrDirectory)
625 pszStartDir = prfdp->lpstrDirectory;
646 nmrfd.
lpFile = pszExpanded;
680 if (psz != pszExpanded)
693 WCHAR szFName[1024] = {0};
713 ERR(
"Couldn't get GetOpenFileName function entry (lib=%p, proc=%p)\n", hComdlg, ofnProc);
757 DWORD dwType, icList = 0, icCmd = 0;
768 cchLatest =
wcslen(pszLatest);
769 if (cchStr < cchLatest + 2 + 1)
771 TRACE(
"pszLatest buffer is not large enough (%d) to hold the MRU terminator.\n", cchStr);
783 L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\RunMRU",
797 TRACE(
"HeapAlloc failed to allocate %d bytes\n", icList);
812 icList =
sizeof(
WCHAR);
816 TRACE(
"HeapAlloc failed to allocate %d bytes\n", icList);
824 icList /=
sizeof(
WCHAR);
826 for (Nix = 0; Nix < icList - 1; Nix++)
828 if (pszList[Nix] > cMax)
831 szIndex[0] = pszList[Nix];
845 TRACE(
"HeapReAlloc failed to reallocate %d bytes\n", icCmd);
855 TRACE(
"HeapAlloc failed to allocate %d bytes\n", icCmd);
891 if (
wcsicmp(pszCmd, pszLatest) == 0)
897 cMatch = pszList[Nix];
904 if (icList - 1 != 26 || icList - 2 != Nix || cMatch || pszLatest ==
NULL)
907 if (!Nix && fShowDefault)
919 cMatch = pszList[Nix];
924 wcscpy(&pszLatest[cchLatest],
L"\\1");
926 pszLatest[cchLatest] =
L'\0';
930 if (!cMatch && pszLatest !=
NULL)
943 TRACE(
"HeapReAlloc failed to reallocate enough bytes\n");
953 TRACE(
"HeapAlloc failed to allocate enough bytes\n");
958 memmove(&pszList[1], pszList, (icList - 1) *
sizeof(
WCHAR));
962 wcscpy(&pszLatest[cchLatest],
L"\\1");
964 pszLatest[cchLatest] =
L'\0';
1028 &
tp.Privileges[0].Luid);
1031 tp.PrivilegeCount = 1;
1047 TRACE(
"(%p)\n", hWndOwner);
1049 CComPtr<IUnknown> fadeHandler;
1116 CComPtr<IUnknown> fadeHandler;
1144 TRACE(
"(%p)\n", hWndOwner);
1170 TRACE(
"(%p)\n", hWndOwner);
1172 CComPtr<IUnknown> fadeHandler;
1181 TRACE(
"Unable to load msgina.dll.\n");
1186 ShellShFunc pShellShutdownDialog = (ShellShFunc)
GetProcAddress(msginaDll,
"ShellShutdownDialog");
1188 if (pShellShutdownDialog)
1193 switch (returnValue)
1246 TRACE(
"Unable to find the 'ShellShutdownDialog' function");
BOOLEAN WINAPI SetSuspendState(BOOLEAN Hibernate, BOOLEAN ForceCritical, BOOLEAN DisableWakeEvent)
#define OFN_FILEMUSTEXIST
struct tagMEASUREITEMSTRUCT * LPMEASUREITEMSTRUCT
#define IDS_PICK_ICON_TITLE
#define IDC_RUNDLG_EDITPATH
WINE_DEFAULT_DEBUG_CHANNEL(shell)
#define memmove(s1, s2, n)
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
static void FillList(HWND, LPWSTR, UINT, BOOL)
BOOL WINAPI LookupPrivilegeValueW(LPCWSTR lpSystemName, LPCWSTR lpPrivilegeName, PLUID lpLuid)
_In_ ULONG _In_ ULONG _In_ ULONG Length
BOOLEAN WINAPI IsPwrSuspendAllowed(VOID)
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
#define LB_FINDSTRINGEXACT
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
#define LB_SETCOLUMNWIDTH
BOOL WINAPI IsWindow(_In_opt_ HWND)
struct tagDRAWITEMSTRUCT * LPDRAWITEMSTRUCT
BOOL WINAPI DestroyIcon(_In_ HICON)
WINE_UNICODE_INLINE int isspaceW(WCHAR wc)
#define HKEY_CURRENT_USER
GLuint GLuint GLsizei count
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
static BOOL DoLoadIcons(HWND hwndDlg, PPICK_ICON_CONTEXT pIconContext, LPCWSTR pszFile)
#define IDS_SHUTDOWN_PROMPT
tShellDimScreen ShellDimScreen
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
int WINAPI RestartDialogEx(HWND hWndOwner, LPCWSTR lpwstrReason, DWORD uFlags, DWORD uReason)
DWORD WINAPI GetLastError(VOID)
GLint GLint GLint GLint GLint x
HWND WINAPI SetFocus(_In_opt_ HWND)
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
#define SendDlgItemMessage
#define GetWindowLongPtrW
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define IDS_RUNDLG_BROWSE_ERROR
#define IDS_RESTART_TITLE
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
static void EnableOkButtonFromEditContents(HWND hwnd)
static LPWSTR RunDlg_GetParentDir(LPCWSTR cmdline)
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
#define SE_PRIVILEGE_ENABLED
#define IDC_PICKICON_LIST
#define IDC_RUNDLG_DESCRIPTION
struct PICK_ICON_CONTEXT * PPICK_ICON_CONTEXT
LONG WINAPI RegCloseKey(HKEY hKey)
static const WCHAR szText[]
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
BOOL WINAPI PickIconDlg(HWND hWndOwner, LPWSTR lpstrFile, UINT nMaxFile, INT *lpdwIconIndex)
static void NoIconsInFile(HWND hwndDlg, PPICK_ICON_CONTEXT pIconContext)
UINT WINAPI ExtractIconExW(LPCWSTR lpszFile, INT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIcons)
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
#define IDS_RUNDLG_BROWSE_FILTER
BOOL WINAPI GetOpenFileNameW(OPENFILENAMEW *ofn)
BOOL CALLBACK EnumPickIconResourceProc(HMODULE hModule, LPCWSTR lpszType, LPWSTR lpszName, LONG_PTR lParam)
#define IDS_PICK_ICON_FILTER
#define SECL_ALLOW_NONEXE
void WINAPI RunFileDlg(HWND hWndOwner, HICON hIcon, LPCWSTR lpstrDirectory, LPCWSTR lpstrTitle, LPCWSTR lpstrDescription, UINT uFlags)
#define DialogBoxW(i, t, p, f)
static INT_PTR CALLBACK RunDlgProc(HWND, UINT, WPARAM, LPARAM)
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
#define OFN_PATHMUSTEXIST
int WINAPI RestartDialog(HWND hWndOwner, LPCWSTR lpstrReason, DWORD uFlags)
#define REG_OPTION_NON_VOLATILE
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
#define RFF_NOSEPARATEMEM
#define IS_INTRESOURCE(i)
static const WCHAR Title[]
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static BOOL ConfirmDialog(HWND hWndOwner, UINT PromptId, UINT TitleId)
_CONST_RETURN wchar_t *__cdecl wcschr(_In_z_ const wchar_t *_Str, wchar_t _Ch)
#define IDS_SHUTDOWN_TITLE
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
void WINAPI ExitWindowsDialog(HWND hWndOwner)
BOOL WINAPI DrawIconEx(_In_ HDC, _In_ int, _In_ int, _In_ HICON, _In_ int, _In_ int, _In_ UINT, _In_opt_ HBRUSH, _In_ UINT)
_In_ WDFCOLLECTION _In_ ULONG Index
int WINAPI GetWindowTextLengthW(_In_ HWND)
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define INVALID_FILE_ATTRIBUTES
static BOOL EnablePrivilege(LPCWSTR lpszPrivilegeName, BOOL bEnablePrivilege)
static void DestroyIconList(HWND hDlgCtrl, PPICK_ICON_CONTEXT pIconContext)
BOOL WINAPI EnumResourceNamesW(HMODULE hmod, LPCWSTR type, ENUMRESNAMEPROCW lpfun, LONG_PTR lparam)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
struct _PICK_ICON_CONTEXT PICK_ICON_CONTEXT
INT_PTR CALLBACK LogOffDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
#define IDS_FILE_NOT_FOUND
#define GetCurrentProcess()
static const WCHAR Cleanup[]
#define IDS_RESTART_PROMPT
BOOL WINAPI ExitWindowsEx(_In_ UINT, _In_ DWORD)
BOOL WINAPI AdjustTokenPrivileges(HANDLE TokenHandle, BOOL DisableAllPrivileges, PTOKEN_PRIVILEGES NewState, DWORD BufferLength, PTOKEN_PRIVILEGES PreviousState, PDWORD ReturnLength)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define LOAD_LIBRARY_AS_DATAFILE
HRESULT(WINAPI * tShellDimScreen)(IUnknown **Unknown, HWND *hWindow)
#define RFF_CALCDIRECTORY
#define shell32_hInstance
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
void shell(int argc, const char *argv[])
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
WINE_UNICODE_INLINE WCHAR * strcatW(WCHAR *dst, const WCHAR *src)
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
BOOL(WINAPI * LPFNOFN)(OPENFILENAMEW *)
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
GLint GLint GLint GLint GLint GLint y
static const LPCWSTR s_pszDefaultPath
INT_PTR CALLBACK PickIconProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
BOOL WINAPI StrTrimW(LPWSTR lpszStr, LPCWSTR lpszTrim)
#define IDC_RUNDLG_BROWSE
#define IDS_RUNDLG_BROWSE_CAPTION
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
#define GetProcAddress(x, y)
#define SHACF_FILESYS_ONLY
#define SetWindowLongPtrW
EXTERN_C int WINAPI LogoffWindowsDialog(HWND hWndOwner)
#define MAKEINTRESOURCEW(i)
VOID ExitWindowsDialog_backup(HWND hWndOwner)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
BOOL CallShellDimScreen(IUnknown **pUnknown, HWND *hWindow)
BOOLEAN WINAPI IsPwrHibernateAllowed(VOID)
#define TOKEN_ADJUST_PRIVILEGES
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define HeapFree(x, y, z)
BOOL WINAPI GetComboBoxInfo(_In_ HWND, _Inout_ PCOMBOBOXINFO)
HRESULT WINAPI SHAutoComplete(HWND hwndEdit, DWORD dwFlags)