mirror of
https://github.com/reactos/reactos.git
synced 2024-07-04 11:44:33 +00:00
[shell32.dll]
[FORMATTING] - Format the code to a more acceptable level. This is just for my sanity while sifting through it. svn path=/branches/shell32_new-bringup/; revision=53537
This commit is contained in:
parent
5beaebef93
commit
b815342563
|
@ -101,7 +101,8 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs)
|
||||||
/* space */
|
/* space */
|
||||||
argc++;
|
argc++;
|
||||||
/* skip the remaining spaces */
|
/* skip the remaining spaces */
|
||||||
while (*cs==0x0009 || *cs==0x0020) {
|
while (*cs==0x0009 || *cs==0x0020)
|
||||||
|
{
|
||||||
cs++;
|
cs++;
|
||||||
}
|
}
|
||||||
if (*cs==0)
|
if (*cs==0)
|
||||||
|
@ -131,8 +132,10 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs)
|
||||||
* This way the caller can make a single GlobalFree call to free both, as per MSDN.
|
* This way the caller can make a single GlobalFree call to free both, as per MSDN.
|
||||||
*/
|
*/
|
||||||
argv = (LPWSTR *)LocalAlloc(LMEM_FIXED, argc*sizeof(LPWSTR)+(wcslen(lpCmdline)+1)*sizeof(WCHAR));
|
argv = (LPWSTR *)LocalAlloc(LMEM_FIXED, argc*sizeof(LPWSTR)+(wcslen(lpCmdline)+1)*sizeof(WCHAR));
|
||||||
|
|
||||||
if (!argv)
|
if (!argv)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
cmdline=(LPWSTR)(argv+argc);
|
cmdline=(LPWSTR)(argv+argc);
|
||||||
wcscpy(cmdline, lpCmdline);
|
wcscpy(cmdline, lpCmdline);
|
||||||
|
|
||||||
|
@ -238,14 +241,17 @@ static DWORD shgfi_get_exe_type(LPCWSTR szFullPath)
|
||||||
|
|
||||||
SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET );
|
SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET );
|
||||||
ReadFile( hfile, magic, sizeof(magic), &len, NULL );
|
ReadFile( hfile, magic, sizeof(magic), &len, NULL );
|
||||||
|
|
||||||
if ( *(DWORD*)magic == IMAGE_NT_SIGNATURE )
|
if ( *(DWORD*)magic == IMAGE_NT_SIGNATURE )
|
||||||
{
|
{
|
||||||
SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET );
|
SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET );
|
||||||
ReadFile( hfile, &nt, sizeof(nt), &len, NULL );
|
ReadFile( hfile, &nt, sizeof(nt), &len, NULL );
|
||||||
CloseHandle( hfile );
|
CloseHandle( hfile );
|
||||||
|
|
||||||
/* DLL files are not executable and should return 0 */
|
/* DLL files are not executable and should return 0 */
|
||||||
if (nt.FileHeader.Characteristics & IMAGE_FILE_DLL)
|
if (nt.FileHeader.Characteristics & IMAGE_FILE_DLL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (nt.OptionalHeader.Subsystem == IMAGE_SUBSYSTEM_WINDOWS_GUI)
|
if (nt.OptionalHeader.Subsystem == IMAGE_SUBSYSTEM_WINDOWS_GUI)
|
||||||
{
|
{
|
||||||
return IMAGE_NT_SIGNATURE |
|
return IMAGE_NT_SIGNATURE |
|
||||||
|
@ -260,6 +266,7 @@ static DWORD shgfi_get_exe_type(LPCWSTR szFullPath)
|
||||||
SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET );
|
SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET );
|
||||||
ReadFile( hfile, &ne, sizeof(ne), &len, NULL );
|
ReadFile( hfile, &ne, sizeof(ne), &len, NULL );
|
||||||
CloseHandle( hfile );
|
CloseHandle( hfile );
|
||||||
|
|
||||||
if (ne.ne_exetyp == 2)
|
if (ne.ne_exetyp == 2)
|
||||||
return IMAGE_OS2_SIGNATURE | (ne.ne_expver << 16);
|
return IMAGE_OS2_SIGNATURE | (ne.ne_expver << 16);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -582,6 +589,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
||||||
GetSystemMetrics( SM_CXICON),
|
GetSystemMetrics( SM_CXICON),
|
||||||
GetSystemMetrics( SM_CYICON),
|
GetSystemMetrics( SM_CYICON),
|
||||||
&psfi->hIcon, 0, 1, 0);
|
&psfi->hIcon, 0, 1, 0);
|
||||||
|
|
||||||
if (ret != 0 && ret != 0xFFFFFFFF)
|
if (ret != 0 && ret != 0xFFFFFFFF)
|
||||||
{
|
{
|
||||||
IconNotYetLoaded=FALSE;
|
IconNotYetLoaded=FALSE;
|
||||||
|
@ -851,39 +859,49 @@ UINT_PTR WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data)
|
||||||
{
|
{
|
||||||
case ABM_GETSTATE:
|
case ABM_GETSTATE:
|
||||||
return ABS_ALWAYSONTOP | ABS_AUTOHIDE;
|
return ABS_ALWAYSONTOP | ABS_AUTOHIDE;
|
||||||
|
|
||||||
case ABM_GETTASKBARPOS:
|
case ABM_GETTASKBARPOS:
|
||||||
GetWindowRect(data->hWnd, &rec);
|
GetWindowRect(data->hWnd, &rec);
|
||||||
data->rc=rec;
|
data->rc=rec;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case ABM_ACTIVATE:
|
case ABM_ACTIVATE:
|
||||||
SetActiveWindow(data->hWnd);
|
SetActiveWindow(data->hWnd);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case ABM_GETAUTOHIDEBAR:
|
case ABM_GETAUTOHIDEBAR:
|
||||||
return 0; /* pretend there is no autohide bar */
|
return 0; /* pretend there is no autohide bar */
|
||||||
|
|
||||||
case ABM_NEW:
|
case ABM_NEW:
|
||||||
/* cbSize, hWnd, and uCallbackMessage are used. All other ignored */
|
/* cbSize, hWnd, and uCallbackMessage are used. All other ignored */
|
||||||
SetWindowPos(data->hWnd,HWND_TOP,0,0,0,0,SWP_SHOWWINDOW|SWP_NOMOVE|SWP_NOSIZE);
|
SetWindowPos(data->hWnd,HWND_TOP,0,0,0,0,SWP_SHOWWINDOW|SWP_NOMOVE|SWP_NOSIZE);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case ABM_QUERYPOS:
|
case ABM_QUERYPOS:
|
||||||
GetWindowRect(data->hWnd, &(data->rc));
|
GetWindowRect(data->hWnd, &(data->rc));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case ABM_REMOVE:
|
case ABM_REMOVE:
|
||||||
FIXME("ABM_REMOVE broken\n");
|
FIXME("ABM_REMOVE broken\n");
|
||||||
/* FIXME: this is wrong; should it be DestroyWindow instead? */
|
/* FIXME: this is wrong; should it be DestroyWindow instead? */
|
||||||
/*CloseHandle(data->hWnd);*/
|
/*CloseHandle(data->hWnd);*/
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case ABM_SETAUTOHIDEBAR:
|
case ABM_SETAUTOHIDEBAR:
|
||||||
SetWindowPos(data->hWnd,HWND_TOP,rec.left+1000,rec.top,
|
SetWindowPos(data->hWnd,HWND_TOP,rec.left+1000,rec.top,
|
||||||
width,height,SWP_SHOWWINDOW);
|
width,height,SWP_SHOWWINDOW);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case ABM_SETPOS:
|
case ABM_SETPOS:
|
||||||
data->uEdge=(ABE_RIGHT | ABE_LEFT);
|
data->uEdge=(ABE_RIGHT | ABE_LEFT);
|
||||||
SetWindowPos(data->hWnd,HWND_TOP,data->rc.left,data->rc.top,
|
SetWindowPos(data->hWnd,HWND_TOP,data->rc.left,data->rc.top,
|
||||||
width,height,SWP_SHOWWINDOW);
|
width,height,SWP_SHOWWINDOW);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case ABM_WINDOWPOSCHANGED:
|
case ABM_WINDOWPOSCHANGED:
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1076,7 +1094,9 @@ INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam
|
||||||
}
|
}
|
||||||
|
|
||||||
// We need the decimal point of the current locale to display the RAM size correctly
|
// We need the decimal point of the current locale to display the RAM size correctly
|
||||||
if( GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, szDecimalSeparator, sizeof(szDecimalSeparator) / sizeof(WCHAR)) > 0)
|
if (GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL,
|
||||||
|
szDecimalSeparator,
|
||||||
|
sizeof(szDecimalSeparator) / sizeof(WCHAR)) > 0)
|
||||||
{
|
{
|
||||||
UCHAR uDecimals;
|
UCHAR uDecimals;
|
||||||
UINT uIntegral;
|
UINT uIntegral;
|
||||||
|
@ -1127,11 +1147,10 @@ INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam
|
||||||
|
|
||||||
EndPaint(hWnd, &ps);
|
EndPaint(hWnd, &ps);
|
||||||
}
|
}
|
||||||
|
}; break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
|
{
|
||||||
switch(wParam)
|
switch(wParam)
|
||||||
{
|
{
|
||||||
case IDOK:
|
case IDOK:
|
||||||
|
@ -1160,7 +1179,7 @@ INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
}; break;
|
||||||
|
|
||||||
case WM_CLOSE:
|
case WM_CLOSE:
|
||||||
EndDialog(hWnd, TRUE);
|
EndDialog(hWnd, TRUE);
|
||||||
|
|
|
@ -107,7 +107,8 @@ static void confirm_msg_move_button(HWND hDlg, INT iId, INT *xPos, INT yOffset,
|
||||||
HWND hButton = GetDlgItem(hDlg, iId);
|
HWND hButton = GetDlgItem(hDlg, iId);
|
||||||
RECT r;
|
RECT r;
|
||||||
|
|
||||||
if (bShow) {
|
if (bShow)
|
||||||
|
{
|
||||||
POINT pt;
|
POINT pt;
|
||||||
int width;
|
int width;
|
||||||
|
|
||||||
|
@ -143,6 +144,7 @@ static INT_PTR ConfirmMsgBox_Paint(HWND hDlg)
|
||||||
DrawTextW(hdc, (LPWSTR)GetPropW(hDlg, CONFIRM_MSG_PROP), -1, &r, DT_NOPREFIX | DT_PATH_ELLIPSIS | DT_WORDBREAK);
|
DrawTextW(hdc, (LPWSTR)GetPropW(hDlg, CONFIRM_MSG_PROP), -1, &r, DT_NOPREFIX | DT_PATH_ELLIPSIS | DT_WORDBREAK);
|
||||||
SelectObject(hdc, hOldFont);
|
SelectObject(hdc, hOldFont);
|
||||||
EndPaint(hDlg, &ps);
|
EndPaint(hDlg, &ps);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -183,6 +185,7 @@ static INT_PTR ConfirmMsgBox_Init(HWND hDlg, LPARAM lParam)
|
||||||
confirm_msg_move_button(hDlg, IDNO, &xPos, yOffset, TRUE);
|
confirm_msg_move_button(hDlg, IDNO, &xPos, yOffset, TRUE);
|
||||||
confirm_msg_move_button(hDlg, IDD_YESTOALL, &xPos, yOffset, info->bYesToAll);
|
confirm_msg_move_button(hDlg, IDD_YESTOALL, &xPos, yOffset, info->bYesToAll);
|
||||||
confirm_msg_move_button(hDlg, IDYES, &xPos, yOffset, TRUE);
|
confirm_msg_move_button(hDlg, IDYES, &xPos, yOffset, TRUE);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -227,59 +230,70 @@ typedef struct
|
||||||
static BOOL SHELL_ConfirmIDs(int nKindOfDialog, SHELL_ConfirmIDstruc *ids)
|
static BOOL SHELL_ConfirmIDs(int nKindOfDialog, SHELL_ConfirmIDstruc *ids)
|
||||||
{
|
{
|
||||||
ids->hIconInstance = shell32_hInstance;
|
ids->hIconInstance = shell32_hInstance;
|
||||||
switch (nKindOfDialog) {
|
switch (nKindOfDialog)
|
||||||
|
{
|
||||||
case ASK_DELETE_FILE:
|
case ASK_DELETE_FILE:
|
||||||
ids->icon_resource_id = IDI_SHELL_CONFIRM_DELETE;
|
ids->icon_resource_id = IDI_SHELL_CONFIRM_DELETE;
|
||||||
ids->caption_resource_id = IDS_DELETEITEM_CAPTION;
|
ids->caption_resource_id = IDS_DELETEITEM_CAPTION;
|
||||||
ids->text_resource_id = IDS_DELETEITEM_TEXT;
|
ids->text_resource_id = IDS_DELETEITEM_TEXT;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case ASK_DELETE_FOLDER:
|
case ASK_DELETE_FOLDER:
|
||||||
ids->icon_resource_id = IDI_SHELL_CONFIRM_DELETE;
|
ids->icon_resource_id = IDI_SHELL_CONFIRM_DELETE;
|
||||||
ids->caption_resource_id = IDS_DELETEFOLDER_CAPTION;
|
ids->caption_resource_id = IDS_DELETEFOLDER_CAPTION;
|
||||||
ids->text_resource_id = IDS_DELETEITEM_TEXT;
|
ids->text_resource_id = IDS_DELETEITEM_TEXT;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case ASK_DELETE_MULTIPLE_ITEM:
|
case ASK_DELETE_MULTIPLE_ITEM:
|
||||||
ids->icon_resource_id = IDI_SHELL_CONFIRM_DELETE;
|
ids->icon_resource_id = IDI_SHELL_CONFIRM_DELETE;
|
||||||
ids->caption_resource_id = IDS_DELETEITEM_CAPTION;
|
ids->caption_resource_id = IDS_DELETEITEM_CAPTION;
|
||||||
ids->text_resource_id = IDS_DELETEMULTIPLE_TEXT;
|
ids->text_resource_id = IDS_DELETEMULTIPLE_TEXT;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case ASK_TRASH_FILE:
|
case ASK_TRASH_FILE:
|
||||||
ids->icon_resource_id = IDI_SHELL_TRASH_FILE;
|
ids->icon_resource_id = IDI_SHELL_TRASH_FILE;
|
||||||
ids->caption_resource_id = IDS_DELETEITEM_CAPTION;
|
ids->caption_resource_id = IDS_DELETEITEM_CAPTION;
|
||||||
ids->text_resource_id = IDS_TRASHITEM_TEXT;
|
ids->text_resource_id = IDS_TRASHITEM_TEXT;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case ASK_TRASH_FOLDER:
|
case ASK_TRASH_FOLDER:
|
||||||
ids->icon_resource_id = IDI_SHELL_TRASH_FILE;
|
ids->icon_resource_id = IDI_SHELL_TRASH_FILE;
|
||||||
ids->caption_resource_id = IDS_DELETEFOLDER_CAPTION;
|
ids->caption_resource_id = IDS_DELETEFOLDER_CAPTION;
|
||||||
ids->text_resource_id = IDS_TRASHFOLDER_TEXT;
|
ids->text_resource_id = IDS_TRASHFOLDER_TEXT;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case ASK_TRASH_MULTIPLE_ITEM:
|
case ASK_TRASH_MULTIPLE_ITEM:
|
||||||
ids->icon_resource_id = IDI_SHELL_TRASH_FILE;
|
ids->icon_resource_id = IDI_SHELL_TRASH_FILE;
|
||||||
ids->caption_resource_id = IDS_DELETEITEM_CAPTION;
|
ids->caption_resource_id = IDS_DELETEITEM_CAPTION;
|
||||||
ids->text_resource_id = IDS_TRASHMULTIPLE_TEXT;
|
ids->text_resource_id = IDS_TRASHMULTIPLE_TEXT;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case ASK_CANT_TRASH_ITEM:
|
case ASK_CANT_TRASH_ITEM:
|
||||||
ids->icon_resource_id = IDI_SHELL_CONFIRM_DELETE;
|
ids->icon_resource_id = IDI_SHELL_CONFIRM_DELETE;
|
||||||
ids->caption_resource_id = IDS_DELETEITEM_CAPTION;
|
ids->caption_resource_id = IDS_DELETEITEM_CAPTION;
|
||||||
ids->text_resource_id = IDS_CANTTRASH_TEXT;
|
ids->text_resource_id = IDS_CANTTRASH_TEXT;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case ASK_DELETE_SELECTED:
|
case ASK_DELETE_SELECTED:
|
||||||
ids->icon_resource_id = IDI_SHELL_CONFIRM_DELETE;
|
ids->icon_resource_id = IDI_SHELL_CONFIRM_DELETE;
|
||||||
ids->caption_resource_id = IDS_DELETEITEM_CAPTION;
|
ids->caption_resource_id = IDS_DELETEITEM_CAPTION;
|
||||||
ids->text_resource_id = IDS_DELETESELECTED_TEXT;
|
ids->text_resource_id = IDS_DELETESELECTED_TEXT;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case ASK_OVERWRITE_FILE:
|
case ASK_OVERWRITE_FILE:
|
||||||
ids->hIconInstance = NULL;
|
ids->hIconInstance = NULL;
|
||||||
ids->icon_resource_id = IDI_SHELL_CONFIRM_DELETE;
|
ids->icon_resource_id = IDI_SHELL_CONFIRM_DELETE;
|
||||||
ids->caption_resource_id = IDS_OVERWRITEFILE_CAPTION;
|
ids->caption_resource_id = IDS_OVERWRITEFILE_CAPTION;
|
||||||
ids->text_resource_id = IDS_OVERWRITEFILE_TEXT;
|
ids->text_resource_id = IDS_OVERWRITEFILE_TEXT;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case ASK_OVERWRITE_FOLDER:
|
case ASK_OVERWRITE_FOLDER:
|
||||||
ids->hIconInstance = NULL;
|
ids->hIconInstance = NULL;
|
||||||
ids->icon_resource_id = IDI_SHELL_CONFIRM_DELETE;
|
ids->icon_resource_id = IDI_SHELL_CONFIRM_DELETE;
|
||||||
ids->caption_resource_id = IDS_OVERWRITEFILE_CAPTION;
|
ids->caption_resource_id = IDS_OVERWRITEFILE_CAPTION;
|
||||||
ids->text_resource_id = IDS_OVERWRITEFOLDER_TEXT;
|
ids->text_resource_id = IDS_OVERWRITEFOLDER_TEXT;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
FIXME(" Unhandled nKindOfDialog %d stub\n", nKindOfDialog);
|
FIXME(" Unhandled nKindOfDialog %d stub\n", nKindOfDialog);
|
||||||
}
|
}
|
||||||
|
@ -294,6 +308,8 @@ static BOOL SHELL_ConfirmDialogW(HWND hWnd, int nKindOfDialog, LPCWSTR szDir, FI
|
||||||
HICON hIcon;
|
HICON hIcon;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
DbgPrint("[shell32, SHELL_ConfirmDialogW] Called\n");
|
||||||
|
|
||||||
assert(nKindOfDialog >= 0 && nKindOfDialog < 32);
|
assert(nKindOfDialog >= 0 && nKindOfDialog < 32);
|
||||||
if (op && (op->dwYesToAllMask & (1 << nKindOfDialog)))
|
if (op && (op->dwYesToAllMask & (1 << nKindOfDialog)))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -309,8 +325,10 @@ static BOOL SHELL_ConfirmDialogW(HWND hWnd, int nKindOfDialog, LPCWSTR szDir, FI
|
||||||
hIcon = LoadIconW(ids.hIconInstance, (LPWSTR)MAKEINTRESOURCE(ids.icon_resource_id));
|
hIcon = LoadIconW(ids.hIconInstance, (LPWSTR)MAKEINTRESOURCE(ids.icon_resource_id));
|
||||||
|
|
||||||
ret = SHELL_ConfirmMsgBox(hWnd, szBuffer, szCaption, hIcon, op && op->bManyItems);
|
ret = SHELL_ConfirmMsgBox(hWnd, szBuffer, szCaption, hIcon, op && op->bManyItems);
|
||||||
if (op) {
|
if (op)
|
||||||
if (ret == IDD_YESTOALL) {
|
{
|
||||||
|
if (ret == IDD_YESTOALL)
|
||||||
|
{
|
||||||
op->dwYesToAllMask |= (1 << nKindOfDialog);
|
op->dwYesToAllMask |= (1 << nKindOfDialog);
|
||||||
ret = IDYES;
|
ret = IDYES;
|
||||||
}
|
}
|
||||||
|
@ -648,21 +666,22 @@ static INT_PTR CALLBACK SHOperationDialog(HWND hwndDlg, UINT uMsg, WPARAM wParam
|
||||||
Context->op->bCancelled = TRUE;
|
Context->op->bCancelled = TRUE;
|
||||||
EndDialog(hwndDlg, Context->op->bCancelled);
|
EndDialog(hwndDlg, Context->op->bCancelled);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
if (LOWORD(wParam) == 14002)
|
if (LOWORD(wParam) == 14002)
|
||||||
{
|
{
|
||||||
Context->op->bCancelled = TRUE;
|
Context->op->bCancelled = TRUE;
|
||||||
EndDialog(hwndDlg, Context->op->bCancelled);
|
EndDialog(hwndDlg, Context->op->bCancelled);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}; break;
|
||||||
break;
|
|
||||||
case WM_TIMER:
|
case WM_TIMER:
|
||||||
if (wParam == TIMER_ID)
|
if (wParam == TIMER_ID)
|
||||||
{
|
{
|
||||||
QueueFile(Context);
|
QueueFile(Context);
|
||||||
KillTimer(hwndDlg, TIMER_ID);
|
KillTimer(hwndDlg, TIMER_ID);
|
||||||
}
|
}; break;
|
||||||
break;
|
|
||||||
case WM_FILE:
|
case WM_FILE:
|
||||||
if (!QueueFile(Context))
|
if (!QueueFile(Context))
|
||||||
EndDialog(hwndDlg, Context->op->bCancelled);
|
EndDialog(hwndDlg, Context->op->bCancelled);
|
||||||
|
@ -726,6 +745,8 @@ static DWORD SHNotifyCopyFileW(LPCWSTR src, LPCWSTR dest, BOOL bFailIfExists)
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
DWORD attribs;
|
DWORD attribs;
|
||||||
|
|
||||||
|
DbgPrint("[shell32, SHNotifyCopyFileW] Called\n");
|
||||||
|
|
||||||
TRACE("(%s %s %s)\n", debugstr_w(src), debugstr_w(dest), bFailIfExists ? "failIfExists" : "");
|
TRACE("(%s %s %s)\n", debugstr_w(src), debugstr_w(dest), bFailIfExists ? "failIfExists" : "");
|
||||||
|
|
||||||
/* Destination file may already exist with read only attribute */
|
/* Destination file may already exist with read only attribute */
|
||||||
|
@ -733,6 +754,16 @@ static DWORD SHNotifyCopyFileW(LPCWSTR src, LPCWSTR dest, BOOL bFailIfExists)
|
||||||
if (IsAttrib(attribs, FILE_ATTRIBUTE_READONLY))
|
if (IsAttrib(attribs, FILE_ATTRIBUTE_READONLY))
|
||||||
SetFileAttributesW(dest, attribs & ~FILE_ATTRIBUTE_READONLY);
|
SetFileAttributesW(dest, attribs & ~FILE_ATTRIBUTE_READONLY);
|
||||||
|
|
||||||
|
if (GetFileAttributesW(dest) & FILE_ATTRIBUTE_READONLY)
|
||||||
|
{
|
||||||
|
SetFileAttributesW(dest, attribs & ~FILE_ATTRIBUTE_READONLY);
|
||||||
|
DbgPrint("[shell32, SHNotifyCopyFileW] Something went really WRONG...%ls, we still have FILE_ATTRIBUTE_READONLY\n", dest);
|
||||||
|
if (GetFileAttributesW(dest) & FILE_ATTRIBUTE_READONLY)
|
||||||
|
{
|
||||||
|
DbgPrint("[shell32, SHNotifyCopyFileW] STILL SHIT\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ret = CopyFileW(src, dest, bFailIfExists);
|
ret = CopyFileW(src, dest, bFailIfExists);
|
||||||
if (ret)
|
if (ret)
|
||||||
{
|
{
|
||||||
|
@ -870,6 +901,7 @@ int WINAPI SHCreateDirectoryExW(HWND hWnd, LPCWSTR path, LPSECURITY_ATTRIBUTES s
|
||||||
ret = ERROR_CANCELLED; /* Error has been already presented to user (not really yet!) */
|
ret = ERROR_CANCELLED; /* Error has been already presented to user (not really yet!) */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -904,8 +936,8 @@ static DWORD SHFindAttrW(LPCWSTR pName, BOOL fileOnly)
|
||||||
continue;
|
continue;
|
||||||
dwAttr = wfd.dwFileAttributes;
|
dwAttr = wfd.dwFileAttributes;
|
||||||
break;
|
break;
|
||||||
}
|
} while (FindNextFileW(hFind, &wfd));
|
||||||
while (FindNextFileW(hFind, &wfd));
|
|
||||||
FindClose(hFind);
|
FindClose(hFind);
|
||||||
}
|
}
|
||||||
return dwAttr;
|
return dwAttr;
|
||||||
|
@ -933,6 +965,7 @@ static DWORD SHNameTranslate(LPWSTR* wString, LPCWSTR* pWToFrom, BOOL more)
|
||||||
aSize += size;
|
aSize += size;
|
||||||
aString += size;
|
aString += size;
|
||||||
} while ((size != 1) && more);
|
} while ((size != 1) && more);
|
||||||
|
|
||||||
/* The two sizes might be different in the case of multibyte chars */
|
/* The two sizes might be different in the case of multibyte chars */
|
||||||
size = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)*pWToFrom, aSize, *wString, 0);
|
size = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)*pWToFrom, aSize, *wString, 0);
|
||||||
if (*wString) /* only in the second loop */
|
if (*wString) /* only in the second loop */
|
||||||
|
@ -1063,14 +1096,21 @@ static void parse_wildcard_files(FILE_LIST *flList, LPCWSTR szFile, LPDWORD pdwL
|
||||||
|
|
||||||
for (res = TRUE; res; res = FindNextFileW(hFile, &wfd))
|
for (res = TRUE; res; res = FindNextFileW(hFile, &wfd))
|
||||||
{
|
{
|
||||||
if (IsDotDir(wfd.cFileName)) continue;
|
if (IsDotDir(wfd.cFileName))
|
||||||
if (*pdwListIndex >= flList->num_alloc) grow_list( flList );
|
continue;
|
||||||
|
|
||||||
|
if (*pdwListIndex >= flList->num_alloc)
|
||||||
|
grow_list( flList );
|
||||||
|
|
||||||
szFullPath = wildcard_to_file(szFile, wfd.cFileName);
|
szFullPath = wildcard_to_file(szFile, wfd.cFileName);
|
||||||
file = &flList->feFiles[(*pdwListIndex)++];
|
file = &flList->feFiles[(*pdwListIndex)++];
|
||||||
add_file_to_entry(file, szFullPath);
|
add_file_to_entry(file, szFullPath);
|
||||||
file->bFromWildcard = TRUE;
|
file->bFromWildcard = TRUE;
|
||||||
file->attributes = wfd.dwFileAttributes;
|
file->attributes = wfd.dwFileAttributes;
|
||||||
if (IsAttribDir(file->attributes)) flList->bAnyDirectories = TRUE;
|
|
||||||
|
if (IsAttribDir(file->attributes))
|
||||||
|
flList->bAnyDirectories = TRUE;
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, szFullPath);
|
HeapFree(GetProcessHeap(), 0, szFullPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1180,7 +1220,8 @@ static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWST
|
||||||
else
|
else
|
||||||
lstrcpyW(szTo, szDestPath);
|
lstrcpyW(szTo, szDestPath);
|
||||||
|
|
||||||
if (!(op->req->fFlags & FOF_NOCONFIRMATION) && PathFileExistsW(szTo)) {
|
if (!(op->req->fFlags & FOF_NOCONFIRMATION) && PathFileExistsW(szTo))
|
||||||
|
{
|
||||||
if (!SHELL_ConfirmDialogW(op->req->hwnd, ASK_OVERWRITE_FOLDER, feFrom->szFilename, op))
|
if (!SHELL_ConfirmDialogW(op->req->hwnd, ASK_OVERWRITE_FOLDER, feFrom->szFilename, op))
|
||||||
{
|
{
|
||||||
/* Vista returns an ERROR_CANCELLED even if user pressed "No" */
|
/* Vista returns an ERROR_CANCELLED even if user pressed "No" */
|
||||||
|
@ -1367,6 +1408,7 @@ static HRESULT copy_files(FILE_OPERATION *op, const FILE_LIST *flFrom, FILE_LIST
|
||||||
{
|
{
|
||||||
if (!copy_file_to_file(op, entryToCopy->szFullPath, fileDest->szFullPath))
|
if (!copy_file_to_file(op, entryToCopy->szFullPath, fileDest->szFullPath))
|
||||||
{
|
{
|
||||||
|
DbgPrint("[shell32, copy_files] copy_file_to_file failed\n");
|
||||||
op->req->fAnyOperationsAborted = TRUE;
|
op->req->fAnyOperationsAborted = TRUE;
|
||||||
return ERROR_CANCELLED;
|
return ERROR_CANCELLED;
|
||||||
}
|
}
|
||||||
|
@ -1736,7 +1778,8 @@ EXTERN_C DWORD WINAPI SheGetDirW(DWORD drive, LPWSTR buffer)
|
||||||
char drv_path[3];
|
char drv_path[3];
|
||||||
|
|
||||||
/* change current directory to the specified drive */
|
/* change current directory to the specified drive */
|
||||||
if (drive) {
|
if (drive)
|
||||||
|
{
|
||||||
strcpy(drv_path, "A:");
|
strcpy(drv_path, "A:");
|
||||||
drv_path[0] += (char)drive-1;
|
drv_path[0] += (char)drive-1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue