Author: janderwald
Date: Wed Jan 16 00:07:06 2008
New Revision: 31814
URL:
http://svn.reactos.org/svn/reactos?rev=31814&view=rev
Log:
- misc cleanups ported from Wine project by Christoph Brill (egore@irc)
- reflect changes in header
See issue #2946 for more details.
Modified:
trunk/reactos/dll/win32/shell32/dialogs.c
trunk/reactos/dll/win32/shell32/shell32_main.h
trunk/reactos/dll/win32/shell32/shlfileop.c
trunk/reactos/dll/win32/shell32/shv_item_cmenu.c
Modified: trunk/reactos/dll/win32/shell32/dialogs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/dialogs.…
==============================================================================
--- trunk/reactos/dll/win32/shell32/dialogs.c (original)
+++ trunk/reactos/dll/win32/shell32/dialogs.c Wed Jan 16 00:07:06 2008
@@ -394,14 +394,13 @@
{
TRACE("(%p)\n", hWndOwner);
- /*FIXME: use uReason */
-
+ /* FIXME: use lpwstrReason */
if (ConfirmDialog(hWndOwner, IDS_RESTART_PROMPT, IDS_RESTART_TITLE))
{
HANDLE hToken;
TOKEN_PRIVILEGES npr;
- /* enable shutdown privilege for current process */
+ /* enable the shutdown privilege for the current process */
if (OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hToken))
{
LookupPrivilegeValueA(0, "SeShutdownPrivilege",
&npr.Privileges[0].Luid);
@@ -410,7 +409,7 @@
AdjustTokenPrivileges(hToken, FALSE, &npr, 0, 0, 0);
CloseHandle(hToken);
}
- ExitWindowsEx(EWX_REBOOT, 0);
+ ExitWindowsEx(EWX_REBOOT, uReason);
}
return 0;
Modified: trunk/reactos/dll/win32/shell32/shell32_main.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shell32_…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shell32_main.h (original)
+++ trunk/reactos/dll/win32/shell32/shell32_main.h Wed Jan 16 00:07:06 2008
@@ -81,7 +81,7 @@
LPENUMFORMATETC IEnumFORMATETC_Constructor(UINT, const FORMATETC []);
LPCLASSFACTORY IClassFactory_Constructor(REFCLSID);
-IContextMenu2 * ISvItemCm_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST pidl,
LPCITEMIDLIST *aPidls, UINT uItemCount);
+IContextMenu2 * ISvItemCm_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST pidl, const
LPCITEMIDLIST *aPidls, UINT uItemCount);
HRESULT WINAPI INewItem_Constructor(IUnknown * pUnkOuter, REFIID riif, LPVOID *ppv);
IContextMenu2 * ISvStaticItemCm_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST pidl,
LPCITEMIDLIST *apidl, UINT cidl, HKEY hKey);
IContextMenu2 * ISvBgCm_Constructor(LPSHELLFOLDER pSFParent, BOOL bDesktop);
Modified: trunk/reactos/dll/win32/shell32/shlfileop.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlfileo…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shlfileop.c (original)
+++ trunk/reactos/dll/win32/shell32/shlfileop.c Wed Jan 16 00:07:06 2008
@@ -1080,7 +1080,7 @@
HeapFree(GetProcessHeap(), 0, flList->feFiles);
}
-static void copy_dir_to_dir(FILE_OPERATION *op, FILE_ENTRY *feFrom, LPWSTR szDestPath)
+static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPWSTR
szDestPath)
{
WCHAR szFrom[MAX_PATH], szTo[MAX_PATH];
SHFILEOPSTRUCTW fileOp;
@@ -1124,7 +1124,7 @@
SHFileOperationW(&fileOp);
}
-static BOOL copy_file_to_file(FILE_OPERATION *op, WCHAR *szFrom, WCHAR *szTo)
+static BOOL copy_file_to_file(FILE_OPERATION *op, const WCHAR *szFrom, const WCHAR
*szTo)
{
if (!(op->req->fFlags & FOF_NOCONFIRMATION) &&
PathFileExistsW(szTo))
{
@@ -1136,7 +1136,7 @@
}
/* copy a file or directory to another directory */
-static void copy_to_dir(FILE_OPERATION *op, FILE_ENTRY *feFrom, FILE_ENTRY *feTo)
+static void copy_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, const FILE_ENTRY
*feTo)
{
if (!PathFileExistsW(feTo->szFullPath))
SHNotifyCreateDirectoryW(feTo->szFullPath, NULL);
@@ -1172,11 +1172,11 @@
}
/* the FO_COPY operation */
-static HRESULT copy_files(FILE_OPERATION *op, FILE_LIST *flFrom, FILE_LIST *flTo)
+static HRESULT copy_files(FILE_OPERATION *op, const FILE_LIST *flFrom, const FILE_LIST
*flTo)
{
DWORD i;
- FILE_ENTRY *entryToCopy;
- FILE_ENTRY *fileDest = &flTo->feFiles[0];
+ const FILE_ENTRY *entryToCopy;
+ const FILE_ENTRY *fileDest = &flTo->feFiles[0];
BOOL bCancelIfAnyDirectories = FALSE;
if (flFrom->bAnyDontExist)
@@ -1269,7 +1269,7 @@
return ERROR_SUCCESS;
}
-static BOOL confirm_delete_list(HWND hWnd, DWORD fFlags, BOOL fTrash, FILE_LIST *flFrom)
+static BOOL confirm_delete_list(HWND hWnd, DWORD fFlags, BOOL fTrash, const FILE_LIST
*flFrom)
{
if (flFrom->dwNumFiles > 1)
{
@@ -1281,7 +1281,7 @@
}
else
{
- FILE_ENTRY *fileEntry = &flFrom->feFiles[0];
+ const FILE_ENTRY *fileEntry = &flFrom->feFiles[0];
if (IsAttribFile(fileEntry->attributes))
return SHELL_ConfirmDialogW(hWnd, (fTrash?ASK_TRASH_FILE:ASK_DELETE_FILE),
fileEntry->szFullPath, NULL);
@@ -1292,9 +1292,9 @@
}
/* the FO_DELETE operation */
-static HRESULT delete_files(LPSHFILEOPSTRUCTW lpFileOp, FILE_LIST *flFrom)
-{
- FILE_ENTRY *fileEntry;
+static HRESULT delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom)
+{
+ const FILE_ENTRY *fileEntry;
DWORD i;
BOOL bPathExists;
BOOL bTrash;
@@ -1354,7 +1354,7 @@
return ERROR_SUCCESS;
}
-static void move_dir_to_dir(LPSHFILEOPSTRUCTW lpFileOp, FILE_ENTRY *feFrom, LPWSTR
szDestPath)
+static void move_dir_to_dir(LPSHFILEOPSTRUCTW lpFileOp, const FILE_ENTRY *feFrom, LPWSTR
szDestPath)
{
WCHAR szFrom[MAX_PATH], szTo[MAX_PATH];
SHFILEOPSTRUCTW fileOp;
@@ -1380,7 +1380,7 @@
}
/* moves a file or directory to another directory */
-static void move_to_dir(LPSHFILEOPSTRUCTW lpFileOp, FILE_ENTRY *feFrom, FILE_ENTRY
*feTo)
+static void move_to_dir(LPSHFILEOPSTRUCTW lpFileOp, const FILE_ENTRY *feFrom, const
FILE_ENTRY *feTo)
{
WCHAR szDestPath[MAX_PATH];
@@ -1393,11 +1393,11 @@
}
/* the FO_MOVE operation */
-static HRESULT move_files(LPSHFILEOPSTRUCTW lpFileOp, FILE_LIST *flFrom, FILE_LIST
*flTo)
+static HRESULT move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const
FILE_LIST *flTo)
{
DWORD i;
- FILE_ENTRY *entryToMove;
- FILE_ENTRY *fileDest;
+ const FILE_ENTRY *entryToMove;
+ const FILE_ENTRY *fileDest;
if (!flFrom->dwNumFiles || !flTo->dwNumFiles)
return ERROR_CANCELLED;
@@ -1445,10 +1445,10 @@
}
/* the FO_RENAME files */
-static HRESULT rename_files(LPSHFILEOPSTRUCTW lpFileOp, FILE_LIST *flFrom, FILE_LIST
*flTo)
-{
- FILE_ENTRY *feFrom;
- FILE_ENTRY *feTo;
+static HRESULT rename_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const
FILE_LIST *flTo)
+{
+ const FILE_ENTRY *feFrom;
+ const FILE_ENTRY *feTo;
if (flFrom->dwNumFiles != 1)
return ERROR_GEN_FAILURE;
Modified: trunk/reactos/dll/win32/shell32/shv_item_cmenu.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shv_item…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shv_item_cmenu.c (original)
+++ trunk/reactos/dll/win32/shell32/shv_item_cmenu.c Wed Jan 16 00:07:06 2008
@@ -107,7 +107,7 @@
/**************************************************************************
* ISvItemCm_Constructor()
*/
-IContextMenu2 *ISvItemCm_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST pidl,
LPCITEMIDLIST *apidl, UINT cidl)
+IContextMenu2 *ISvItemCm_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST pidl, const
LPCITEMIDLIST *apidl, UINT cidl)
{ ItemCmImpl* cm;
UINT u;