From edc162eb293c314507d6ca9dc1fc80ef3301d551 Mon Sep 17 00:00:00 2001 From: Jan Zerebecki Date: Fri, 6 Apr 2007 14:45:43 +0200 Subject: [PATCH] push 17e95bb5b89ca06d3b4ab9c4a2ab44cb05c88b95 --- dlls/comctl32/header.c | 3 + dlls/comctl32/listview.c | 2 +- dlls/comctl32/toolbar.c | 4 + dlls/comdlg32/cdlg.h | 6 +- dlls/comdlg32/filedlg31.c | 2 +- dlls/comdlg32/filedlg31.h | 2 +- dlls/comdlg32/finddlg16.c | 12 +- dlls/comdlg32/finddlg32.c | 4 +- dlls/comdlg32/fontdlg.c | 16 +- dlls/comdlg32/fontdlg16.c | 4 +- dlls/comdlg32/printdlg.c | 31 +- dlls/comdlg32/printdlg16.c | 6 +- dlls/kernel32/tests/mailslot.c | 2 +- dlls/msvcrt/tests/cpp.c | 3 + dlls/msvcrt/undname.c | 61 ++-- dlls/ntdll/heap.c | 16 +- dlls/ole32/compobj_private.h | 3 + dlls/ole32/stubmanager.c | 4 +- dlls/ole32/tests/marshal.c | 5 - dlls/quartz/filtergraph.c | 24 +- dlls/shlwapi/shlwapi.spec | 2 +- dlls/user32/tests/win.c | 67 ++++- dlls/wined3d/directx.c | 3 + dlls/winex11.drv/window.c | 11 +- dlls/wintrust/crypt.c | 39 ++- dlls/wintrust/wintrust.spec | 2 +- include/wine/wined3d_gl.h | 12 + programs/cmd/directory.c | 661 +++++++++++++++++++++++++++-------------- programs/cmd/wcmd.h | 2 +- programs/cmd/wcmdmain.c | 42 ++- programs/notepad/En.rc | 4 +- programs/taskmgr/procpage.c | 3 +- 32 files changed, 709 insertions(+), 349 deletions(-) diff --git a/dlls/comctl32/header.c b/dlls/comctl32/header.c index 138b58f0688..b80ef74642d 100644 --- a/dlls/comctl32/header.c +++ b/dlls/comctl32/header.c @@ -979,6 +979,7 @@ HEADER_CreateDragImage (HWND hwnd, WPARAM wParam) HDC hMemoryDC; HDC hDeviceDC; int height, width; + HFONT hFont; if (wParam < 0 || wParam >= infoPtr->uNumItem) return FALSE; @@ -996,6 +997,8 @@ HEADER_CreateDragImage (HWND hwnd, WPARAM wParam) ReleaseDC(NULL, hDeviceDC); hOldBitmap = SelectObject(hMemoryDC, hMemory); SetViewportOrgEx(hMemoryDC, -lpItem->rect.left, -lpItem->rect.top, NULL); + hFont = infoPtr->hFont ? infoPtr->hFont : GetStockObject(SYSTEM_FONT); + SelectObject(hMemoryDC, hFont); GetClientRect(hwnd, &rc); lCDFlags = HEADER_SendCtrlCustomDraw(hwnd, CDDS_PREPAINT, hMemoryDC, &rc); diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 68a1ddbf695..68615040b84 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -1980,7 +1980,7 @@ static void LISTVIEW_GetItemMetrics(const LISTVIEW_INFO *infoPtr, const LVITEMW (!lpColumnInfo || lpLVItem->iSubItem == 0 || (lpColumnInfo->fmt & LVCFMT_IMAGE) || ((infoPtr->dwLvExStyle & LVS_EX_SUBITEMIMAGES) && lpLVItem->iImage != I_IMAGECALLBACK))) Icon.right += infoPtr->iconSize.cx; - Icon.bottom = Icon.top + infoPtr->nItemHeight; + Icon.bottom = Icon.top + infoPtr->iconSize.cy; } if(lprcIcon) *lprcIcon = Icon; TRACE(" - icon=%s\n", wine_dbgstr_rect(&Icon)); diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c index b8c76e51313..e08a15f8dfc 100644 --- a/dlls/comctl32/toolbar.c +++ b/dlls/comctl32/toolbar.c @@ -5860,6 +5860,10 @@ TOOLBAR_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam) { SendMessageW (infoPtr->hwndNotify, WM_COMMAND, MAKEWPARAM(infoPtr->buttons[nHit].idCommand, BN_CLICKED), (LPARAM)hwnd); + + /* In case we have just been destroyed... */ + if(!IsWindow(hwnd)) + return 0; } } diff --git a/dlls/comdlg32/cdlg.h b/dlls/comdlg32/cdlg.h index 1d091cc6088..22cd5a21e8a 100644 --- a/dlls/comdlg32/cdlg.h +++ b/dlls/comdlg32/cdlg.h @@ -213,10 +213,10 @@ typedef struct } CFn_ENUMSTRUCT, *LPCFn_ENUMSTRUCT; INT AddFontFamily(const ENUMLOGFONTEXW *lpElfex, const NEWTEXTMETRICEXW *lpNTM, - UINT nFontType, LPCHOOSEFONTW lpcf, HWND hwnd, + UINT nFontType, const CHOOSEFONTW *lpcf, HWND hwnd, LPCFn_ENUMSTRUCT e); INT AddFontStyle(const ENUMLOGFONTEXW *lpElfex, const NEWTEXTMETRICEXW *metrics, - UINT nFontType, LPCHOOSEFONTW lpcf, HWND hcmb2, HWND hcmb3, + UINT nFontType, const CHOOSEFONTW *lpcf, HWND hcmb2, HWND hcmb3, HWND hDlg, BOOL iswin16); void _dump_cf_flags(DWORD cflags); @@ -227,6 +227,6 @@ LRESULT CFn_WMDrawItem(HWND hDlg, WPARAM wParam, LPARAM lParam); LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam, LPCHOOSEFONTW lpcf); LRESULT CFn_WMPaint(HWND hDlg, WPARAM wParam, LPARAM lParam, - LPCHOOSEFONTW lpcf); + const CHOOSEFONTW *lpcf); #endif /* _WINE_DLL_CDLG_H */ diff --git a/dlls/comdlg32/filedlg31.c b/dlls/comdlg32/filedlg31.c index 958677315af..b49cc7e6986 100644 --- a/dlls/comdlg32/filedlg31.c +++ b/dlls/comdlg32/filedlg31.c @@ -754,7 +754,7 @@ void FD31_MapOfnStructA(const OPENFILENAMEA *ofnA, LPOPENFILENAMEW ofnW, BOOL op * FD31_FreeOfnW [internal] * Undo all allocations done by FD31_MapOfnStructA */ -void FD31_FreeOfnW(const OPENFILENAMEW *ofnW) +void FD31_FreeOfnW(OPENFILENAMEW *ofnW) { HeapFree(GetProcessHeap(), 0, (LPWSTR) ofnW->lpstrFilter); HeapFree(GetProcessHeap(), 0, ofnW->lpstrCustomFilter); diff --git a/dlls/comdlg32/filedlg31.h b/dlls/comdlg32/filedlg31.h index b86bc0feae9..7328f07d209 100644 --- a/dlls/comdlg32/filedlg31.h +++ b/dlls/comdlg32/filedlg31.h @@ -55,7 +55,7 @@ extern PFD31_DATA FD31_AllocPrivate(LPARAM lParam, UINT dlgType, PFD31_CALLBACKS callbacks, DWORD data); extern void FD31_DestroyPrivate(PFD31_DATA lfs); extern void FD31_MapOfnStructA(const OPENFILENAMEA *ofnA, LPOPENFILENAMEW ofnW, BOOL open); -extern void FD31_FreeOfnW(const OPENFILENAMEW *ofnW); +extern void FD31_FreeOfnW(OPENFILENAMEW *ofnW); extern BOOL FD31_CallWindowProc(const FD31_DATA *lfs, UINT wMsg, WPARAM wParam, LPARAM lParam); extern LONG FD31_WMInitDialog(HWND hWnd, WPARAM wParam, LPARAM lParam); diff --git a/dlls/comdlg32/finddlg16.c b/dlls/comdlg32/finddlg16.c index 113b15d6156..f30bae80172 100644 --- a/dlls/comdlg32/finddlg16.c +++ b/dlls/comdlg32/finddlg16.c @@ -228,7 +228,7 @@ HWND16 WINAPI ReplaceText16( SEGPTR find ) * FINDDLG_WMInitDialog [internal] */ static LRESULT FINDDLG_WMInitDialog(HWND hWnd, LPARAM lParam, LPDWORD lpFlags, - LPSTR lpstrFindWhat, BOOL fUnicode) + LPCSTR lpstrFindWhat, BOOL fUnicode) { SetWindowLongPtrW(hWnd, DWLP_USER, lParam); *lpFlags &= ~(FR_FINDNEXT | FR_REPLACE | FR_REPLACEALL | FR_DIALOGTERM); @@ -237,7 +237,7 @@ static LRESULT FINDDLG_WMInitDialog(HWND hWnd, LPARAM lParam, LPDWORD lpFlags, * FindNext (IDOK) button. Only after typing some text, the button should be * enabled. */ - if (fUnicode) SetDlgItemTextW(hWnd, edt1, (LPWSTR)lpstrFindWhat); + if (fUnicode) SetDlgItemTextW(hWnd, edt1, (LPCWSTR)lpstrFindWhat); else SetDlgItemTextA(hWnd, edt1, lpstrFindWhat); CheckRadioButton(hWnd, rad1, rad2, (*lpFlags & FR_DOWN) ? rad2 : rad1); if (*lpFlags & (FR_HIDEUPDOWN | FR_NOUPDOWN)) { @@ -341,8 +341,8 @@ BOOL16 CALLBACK FindTextDlgProc16(HWND16 hWnd16, UINT16 wMsg, WPARAM16 wParam, * REPLACEDLG_WMInitDialog [internal] */ static LRESULT REPLACEDLG_WMInitDialog(HWND hWnd, LPARAM lParam, - LPDWORD lpFlags, LPSTR lpstrFindWhat, - LPSTR lpstrReplaceWith, BOOL fUnicode) + LPDWORD lpFlags, LPCSTR lpstrFindWhat, + LPCSTR lpstrReplaceWith, BOOL fUnicode) { SetWindowLongPtrW(hWnd, DWLP_USER, lParam); *lpFlags &= ~(FR_FINDNEXT | FR_REPLACE | FR_REPLACEALL | FR_DIALOGTERM); @@ -353,8 +353,8 @@ static LRESULT REPLACEDLG_WMInitDialog(HWND hWnd, LPARAM lParam, */ if (fUnicode) { - SetDlgItemTextW(hWnd, edt1, (LPWSTR)lpstrFindWhat); - SetDlgItemTextW(hWnd, edt2, (LPWSTR)lpstrReplaceWith); + SetDlgItemTextW(hWnd, edt1, (LPCWSTR)lpstrFindWhat); + SetDlgItemTextW(hWnd, edt2, (LPCWSTR)lpstrReplaceWith); } else { SetDlgItemTextA(hWnd, edt1, lpstrFindWhat); diff --git a/dlls/comdlg32/finddlg32.c b/dlls/comdlg32/finddlg32.c index 2d655263060..5485804733d 100644 --- a/dlls/comdlg32/finddlg32.c +++ b/dlls/comdlg32/finddlg32.c @@ -299,8 +299,8 @@ static INT_PTR CALLBACK COMDLG32_FindReplaceDlgProc(HWND hDlgWnd, UINT iMsg, WPA * FALSE: Failure */ static BOOL COMDLG32_FR_CheckPartial( - LPFINDREPLACEA pfr, /* [in] Find structure */ - BOOL Replace /* [in] True if called as replace */ + const FINDREPLACEA *pfr, /* [in] Find structure */ + BOOL Replace /* [in] True if called as replace */ ) { if(!pfr) { diff --git a/dlls/comdlg32/fontdlg.c b/dlls/comdlg32/fontdlg.c index 2f01b3b83d5..42833f14b6e 100644 --- a/dlls/comdlg32/fontdlg.c +++ b/dlls/comdlg32/fontdlg.c @@ -287,7 +287,7 @@ static const COLORREF textcolors[TEXT_COLORS]= /*********************************************************************** * CFn_HookCallChk32 [internal] */ -static BOOL CFn_HookCallChk32(LPCHOOSEFONTW lpcf) +static BOOL CFn_HookCallChk32(const CHOOSEFONTW *lpcf) { if (lpcf) if(lpcf->Flags & CF_ENABLEHOOK) @@ -300,7 +300,7 @@ static BOOL CFn_HookCallChk32(LPCHOOSEFONTW lpcf) * AddFontFamily [internal] */ INT AddFontFamily(const ENUMLOGFONTEXW *lpElfex, const NEWTEXTMETRICEXW *lpNTM, - UINT nFontType, LPCHOOSEFONTW lpcf, HWND hwnd, LPCFn_ENUMSTRUCT e) + UINT nFontType, const CHOOSEFONTW *lpcf, HWND hwnd, LPCFn_ENUMSTRUCT e) { int i; WORD w; @@ -403,7 +403,7 @@ static int SetFontStylesToCombo2(HWND hwnd, HDC hdc, const LOGFONTW *lplf) /************************************************************************* * AddFontSizeToCombo3 [internal] */ -static int AddFontSizeToCombo3(HWND hwnd, UINT h, LPCHOOSEFONTW lpcf) +static int AddFontSizeToCombo3(HWND hwnd, UINT h, const CHOOSEFONTW *lpcf) { int j; WCHAR buffer[20]; @@ -427,7 +427,7 @@ static int AddFontSizeToCombo3(HWND hwnd, UINT h, LPCHOOSEFONTW lpcf) /************************************************************************* * SetFontSizesToCombo3 [internal] */ -static int SetFontSizesToCombo3(HWND hwnd, LPCHOOSEFONTW lpcf) +static int SetFontSizesToCombo3(HWND hwnd, const CHOOSEFONTW *lpcf) { static const BYTE sizes[]={6,7,8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72}; int i; @@ -440,7 +440,7 @@ static int SetFontSizesToCombo3(HWND hwnd, LPCHOOSEFONTW lpcf) /************************************************************************* * CFn_GetDC [internal] */ -static inline HDC CFn_GetDC(LPCHOOSEFONTW lpcf) +static inline HDC CFn_GetDC(const CHOOSEFONTW *lpcf) { HDC ret = ((lpcf->Flags & CF_PRINTERFONTS) && lpcf->hDC) ? lpcf->hDC : @@ -452,7 +452,7 @@ static inline HDC CFn_GetDC(LPCHOOSEFONTW lpcf) /************************************************************************* * CFn_ReleaseDC [internal] */ -static inline void CFn_ReleaseDC(LPCHOOSEFONTW lpcf, HDC hdc) +static inline void CFn_ReleaseDC(const CHOOSEFONTW *lpcf, HDC hdc) { if(!((lpcf->Flags & CF_PRINTERFONTS) && lpcf->hDC)) ReleaseDC(0, hdc); @@ -462,7 +462,7 @@ static inline void CFn_ReleaseDC(LPCHOOSEFONTW lpcf, HDC hdc) * AddFontStyle [internal] */ INT AddFontStyle( const ENUMLOGFONTEXW *lpElfex, const NEWTEXTMETRICEXW *lpNTM, - UINT nFontType, LPCHOOSEFONTW lpcf, HWND hcmb2, HWND hcmb3, + UINT nFontType, const CHOOSEFONTW *lpcf, HWND hcmb2, HWND hcmb3, HWND hDlg, BOOL iswin16) { int i; @@ -1075,7 +1075,7 @@ static LRESULT CFn_WMDestroy(HWND hwnd, WPARAM wParam, LPARAM lParam, LPCHOOSEFO return TRUE; } -LRESULT CFn_WMPaint(HWND hDlg, WPARAM wParam, LPARAM lParam, LPCHOOSEFONTW lpcf) +LRESULT CFn_WMPaint(HWND hDlg, WPARAM wParam, LPARAM lParam, const CHOOSEFONTW *lpcf) { WINDOWINFO info; diff --git a/dlls/comdlg32/fontdlg16.c b/dlls/comdlg32/fontdlg16.c index 297952cd602..7ed63dc0e0b 100644 --- a/dlls/comdlg32/fontdlg16.c +++ b/dlls/comdlg32/fontdlg16.c @@ -72,7 +72,7 @@ static void FONT_Metrics16To32W( const TEXTMETRIC16 *pm16, pnm32w->ntmTm.tmExternalLeading = pm16->tmExternalLeading; } -static void CFn_CHOOSEFONT16to32W(LPCHOOSEFONT16 chf16, LPCHOOSEFONTW chf32w) +static void CFn_CHOOSEFONT16to32W(const CHOOSEFONT16 *chf16, LPCHOOSEFONTW chf32w) { int len; if (chf16->Flags & CF_ENABLETEMPLATE) @@ -106,7 +106,7 @@ static void CFn_CHOOSEFONT16to32W(LPCHOOSEFONT16 chf16, LPCHOOSEFONTW chf32w) /*********************************************************************** * CFn_HookCallChk [internal] */ -static BOOL CFn_HookCallChk(LPCHOOSEFONT16 lpcf) +static BOOL CFn_HookCallChk(const CHOOSEFONT16 *lpcf) { if (lpcf) if(lpcf->Flags & CF_ENABLEHOOK) diff --git a/dlls/comdlg32/printdlg.c b/dlls/comdlg32/printdlg.c index 82e90237032..4dc4de04cad 100644 --- a/dlls/comdlg32/printdlg.c +++ b/dlls/comdlg32/printdlg.c @@ -185,8 +185,8 @@ static INT PRINTDLG_SetUpPrinterListComboW(HWND hDlg, UINT id, LPCWSTR name) * * (NB. when we handle unicode the offsets will be in wchars). */ -static BOOL PRINTDLG_CreateDevNames(HGLOBAL *hmem, char* DeviceDriverName, - char* DeviceName, char* OutputPort) +static BOOL PRINTDLG_CreateDevNames(HGLOBAL *hmem, const char* DeviceDriverName, + const char* DeviceName, const char* OutputPort) { long size; char* pDevNamesSpace; @@ -673,8 +673,8 @@ static BOOL PRINTDLG_SetUpPaperComboBoxA(HWND hDlg, static BOOL PRINTDLG_SetUpPaperComboBoxW(HWND hDlg, int nIDComboBox, - WCHAR* PrinterName, - WCHAR* PortName, + const WCHAR* PrinterName, + const WCHAR* PortName, LPDEVMODEW dm) { int i; @@ -785,7 +785,7 @@ static BOOL PRINTDLG_SetUpPaperComboBoxW(HWND hDlg, /*********************************************************************** * PRINTDLG_UpdatePrinterInfoTexts [internal] */ -static void PRINTDLG_UpdatePrinterInfoTextsA(HWND hDlg, LPPRINTER_INFO_2A pi) +static void PRINTDLG_UpdatePrinterInfoTextsA(HWND hDlg, const PRINTER_INFO_2A *pi) { char StatusMsg[256]; char ResourceString[256]; @@ -821,7 +821,7 @@ static void PRINTDLG_UpdatePrinterInfoTextsA(HWND hDlg, LPPRINTER_INFO_2A pi) return; } -static void PRINTDLG_UpdatePrinterInfoTextsW(HWND hDlg, LPPRINTER_INFO_2W pi) +static void PRINTDLG_UpdatePrinterInfoTextsW(HWND hDlg, const PRINTER_INFO_2W *pi) { WCHAR StatusMsg[256]; WCHAR ResourceString[256]; @@ -1857,7 +1857,7 @@ static INT_PTR CALLBACK PrintDlgProcW(HWND hDlg, UINT uMsg, WPARAM wParam, * PRINTDLG_GetDlgTemplate * */ -static HGLOBAL PRINTDLG_GetDlgTemplateA(PRINTDLGA *lppd) +static HGLOBAL PRINTDLG_GetDlgTemplateA(const PRINTDLGA *lppd) { HRSRC hResInfo; HGLOBAL hDlgTmpl; @@ -1891,7 +1891,7 @@ static HGLOBAL PRINTDLG_GetDlgTemplateA(PRINTDLGA *lppd) return hDlgTmpl; } -static HGLOBAL PRINTDLG_GetDlgTemplateW(PRINTDLGW *lppd) +static HGLOBAL PRINTDLG_GetDlgTemplateW(const PRINTDLGW *lppd) { HRSRC hResInfo; HGLOBAL hDlgTmpl; @@ -2325,7 +2325,7 @@ typedef struct { } PageSetupDataW; -static HGLOBAL PRINTDLG_GetPGSTemplateA(PAGESETUPDLGA *lppd) +static HGLOBAL PRINTDLG_GetPGSTemplateA(const PAGESETUPDLGA *lppd) { HRSRC hResInfo; HGLOBAL hDlgTmpl; @@ -2343,7 +2343,7 @@ static HGLOBAL PRINTDLG_GetPGSTemplateA(PAGESETUPDLGA *lppd) return hDlgTmpl; } -static HGLOBAL PRINTDLG_GetPGSTemplateW(PAGESETUPDLGW *lppd) +static HGLOBAL PRINTDLG_GetPGSTemplateW(const PAGESETUPDLGW *lppd) { HRSRC hResInfo; HGLOBAL hDlgTmpl; @@ -2421,7 +2421,7 @@ _c_size2strW(PageSetupDataW *pda,DWORD size,LPWSTR strout) { } static DWORD -_c_str2sizeA(PAGESETUPDLGA *dlga,LPCSTR strin) { +_c_str2sizeA(const PAGESETUPDLGA *dlga, LPCSTR strin) { float val; char rest[200]; @@ -2461,13 +2461,13 @@ _c_str2sizeA(PAGESETUPDLGA *dlga,LPCSTR strin) { static DWORD -_c_str2sizeW(PAGESETUPDLGW *dlga, LPCWSTR strin) { +_c_str2sizeW(const PAGESETUPDLGW *dlga, LPCWSTR strin) { char buf[200]; /* this W -> A transition is OK */ /* we need a unicode version of sscanf to avoid it */ WideCharToMultiByte(CP_ACP, 0, strin, -1, buf, sizeof(buf), NULL, NULL); - return _c_str2sizeA((PAGESETUPDLGA *)dlga, buf); + return _c_str2sizeA((const PAGESETUPDLGA *)dlga, buf); } @@ -2685,7 +2685,7 @@ PRINTDLG_PS_ChangePrinterW(HWND hDlg, PageSetupDataW *pda) { * always - TRUE */ static BOOL -PRINTDLG_PS_ChangePaperPrev(PageSetupDataA *pda) +PRINTDLG_PS_ChangePaperPrev(const PageSetupDataA *pda) { LONG width, height, x, y; RECT rtTmp; @@ -2913,7 +2913,8 @@ PRINTDLG_PS_WMCommandW( */ static UINT_PTR -PRINTDLG_DefaultPagePaintHook(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam, PageSetupDataA *pda) +PRINTDLG_DefaultPagePaintHook(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam, + const PageSetupDataA *pda) { LPRECT lprc = (LPRECT) lParam; HDC hdc = (HDC) wParam; diff --git a/dlls/comdlg32/printdlg16.c b/dlls/comdlg32/printdlg16.c index a84ee6a58d3..4f883daad53 100644 --- a/dlls/comdlg32/printdlg16.c +++ b/dlls/comdlg32/printdlg16.c @@ -56,8 +56,8 @@ typedef struct /* Internal Functions */ -static BOOL PRINTDLG_CreateDevNames16(HGLOBAL16 *hmem, char* DeviceDriverName, - char* DeviceName, char* OutputPort) +static BOOL PRINTDLG_CreateDevNames16(HGLOBAL16 *hmem, const char* DeviceDriverName, + const char* DeviceName, const char* OutputPort) { long size; char* pDevNamesSpace; @@ -291,7 +291,7 @@ static BOOL PRINTDLG_CreateDC16(LPPRINTDLG16 lppd) * PRINTDLG_GetDlgTemplate * */ -static HGLOBAL16 PRINTDLG_GetDlgTemplate16(PRINTDLG16 *lppd) +static HGLOBAL16 PRINTDLG_GetDlgTemplate16(const PRINTDLG16 *lppd) { HGLOBAL16 hDlgTmpl, hResInfo; diff --git a/dlls/kernel32/tests/mailslot.c b/dlls/kernel32/tests/mailslot.c index 850b065b2a2..6eb8d8aaeff 100644 --- a/dlls/kernel32/tests/mailslot.c +++ b/dlls/kernel32/tests/mailslot.c @@ -299,7 +299,7 @@ static int mailslot_test(void) ok( !ReadFile( hSlot, buffer, sizeof buffer, &count, NULL), "slot read\n"); ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() ); dwTimeout = GetTickCount() - dwTimeout; - ok( dwTimeout >= 1000, "timeout too short %u\n", dwTimeout ); + ok( dwTimeout >= 990, "timeout too short %u\n", dwTimeout ); ok( CloseHandle( hSlot ), "closing the mailslot\n"); return 0; diff --git a/dlls/msvcrt/tests/cpp.c b/dlls/msvcrt/tests/cpp.c index 1d435028df0..370a348481f 100644 --- a/dlls/msvcrt/tests/cpp.c +++ b/dlls/msvcrt/tests/cpp.c @@ -975,6 +975,9 @@ static void test_demangle(void) {"??0aa$_3a@@QAE@XZ", "public: __thiscall aa$_3a::aa$_3a(void)"}, {"??2?$aaa@AAUbbb@@AAUccc@@AAU2@@ddd@1eee@2@QAEHXZ", "public: int __thiscall eee::eee::ddd::ddd::aaa::operator new(void)"}, {"?pSW@@3P6GHKPAX0PAU_tagSTACKFRAME@@0P6GH0K0KPAK@ZP6GPAX0K@ZP6GK0K@ZP6GK00PAU_tagADDRESS@@@Z@ZA", "int (__stdcall* pSW)(unsigned long,void *,void *,struct _tagSTACKFRAME *,void *,int (__stdcall*)(void *,unsigned long,void *,unsigned long,unsigned long *),void * (__stdcall*)(void *,unsigned long),unsigned long (__stdcall*)(void *,unsigned long),unsigned long (__stdcall*)(void *,void *,struct _tagADDRESS *))"}, +{"?$_aaa@Vbbb@@", "_aaa"}, +{"??$_aaa@Vbbb@@", "??$_aaa@Vbbb@@"}, +{"?$aaa@Vbbb@ccc@@Vddd@2@", "aaa"}, }; int i, num_test = (sizeof(test)/sizeof(test[0])); char* name; diff --git a/dlls/msvcrt/undname.c b/dlls/msvcrt/undname.c index a775e72d0c5..a16d3d8e9ca 100644 --- a/dlls/msvcrt/undname.c +++ b/dlls/msvcrt/undname.c @@ -427,6 +427,35 @@ static char* get_literal_string(struct parsed_symbol* sym) } /****************************************************************** + * get_template_name + * Parses a name with a template argument list and returns it as + * a string. + * In a template argument list the back reference to the names + * table is separately created. '0' points to the class component + * name with the template arguments. We use the same stack array + * to hold the names but save/restore the stack state before/after + * parsing the template argument list. + */ +static char* get_template_name(struct parsed_symbol* sym) +{ + char *name, *args; + unsigned num_mark = sym->names.num; + unsigned start_mark = sym->names.start; + unsigned stack_mark = sym->stack.num; + + sym->names.start = sym->names.num; + if (!(name = get_literal_string(sym))) + return FALSE; + args = get_args(sym, NULL, FALSE, '<', '>'); + if (args != NULL) + name = str_printf(sym, "%s%s", name, args); + sym->names.num = num_mark; + sym->names.start = start_mark; + sym->stack.num = stack_mark; + return name; +} + +/****************************************************************** * get_class * Parses class as a list of parent-classes, terminated by '@' and stores the * result in 'a' array. Each parent-classes, as well as the inner element @@ -457,29 +486,8 @@ static BOOL get_class(struct parsed_symbol* sym) case '?': if (*++sym->current == '$') { - /* In a template argument list the back reference to names - table is separately created. '0' points to the class - component name with the template arguments. We use the same - stack array to hold the names but save/restore the stack - state before/after parsing the template argument list. */ - char* args = NULL; - unsigned num_mark = sym->names.num; - unsigned start_mark = sym->names.start; - unsigned stack_mark = sym->stack.num; - - sym->names.start = sym->names.num; sym->current++; - if (!(name = get_literal_string(sym))) - return FALSE; - args = get_args(sym, NULL, FALSE, '<', '>'); - if (args != NULL) - name = str_printf(sym, "%s%s", name, args); - sym->names.num = num_mark; - sym->names.start = start_mark; - sym->stack.num = stack_mark; - /* Now that we are back to the standard name scope push - the class component with all its template arguments - to the names array for back reference. */ + name = get_template_name(sym); str_array_push(sym, name, -1, &sym->names); } break; @@ -1148,6 +1156,15 @@ static BOOL symbol_demangle(struct parsed_symbol* sym) } sym->stack.start = 1; } + else if (*sym->current == '$') + { + /* Strange construct, it's a name with a template argument list + and that's all. */ + sym->current++; + sym->result = get_template_name(sym); + ret = TRUE; + goto done; + } /* Either a class name, or '@' if the symbol is not a class member */ if (*sym->current != '@') diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c index c481262e231..195c26b1711 100644 --- a/dlls/ntdll/heap.c +++ b/dlls/ntdll/heap.c @@ -396,7 +396,8 @@ static SUBHEAP *HEAP_FindSubHeap( while (sub) { if (((const char *)ptr >= (const char *)sub) && - ((const char *)ptr < (const char *)sub + sub->size)) return (SUBHEAP*)sub; + ((const char *)ptr < (const char *)sub + sub->size - sizeof(ARENA_INUSE))) + return (SUBHEAP *)sub; sub = sub->next; } return NULL; @@ -786,7 +787,7 @@ static ARENA_FREE *HEAP_FindFreeBlock( HEAP *heap, SIZE_T size, * * Check that the pointer is inside the range possible for arenas. */ -static BOOL HEAP_IsValidArenaPtr( const HEAP *heap, const void *ptr ) +static BOOL HEAP_IsValidArenaPtr( const HEAP *heap, const ARENA_FREE *ptr ) { int i; const SUBHEAP *subheap = HEAP_FindSubHeap( heap, ptr ); @@ -1006,13 +1007,12 @@ static BOOL HEAP_IsRealArena( HEAP *heapPtr, /* [in] ptr to the heap */ if (!(flags & HEAP_NO_SERIALIZE)) RtlEnterCriticalSection( &heapPtr->critSection ); - if (block) + if (block) /* only check this single memory block */ { - /* Only check this single memory block */ + const ARENA_INUSE *arena = (const ARENA_INUSE *)block - 1; - if (!(subheap = HEAP_FindSubHeap( heapPtr, block )) || - ((const char *)block < (char *)subheap + subheap->headerSize - + sizeof(ARENA_INUSE))) + if (!(subheap = HEAP_FindSubHeap( heapPtr, arena )) || + ((const char *)arena < (char *)subheap + subheap->headerSize)) { if (quiet == NOISY) ERR("Heap %p: block %p is not inside heap\n", heapPtr, block ); @@ -1020,7 +1020,7 @@ static BOOL HEAP_IsRealArena( HEAP *heapPtr, /* [in] ptr to the heap */ WARN("Heap %p: block %p is not inside heap\n", heapPtr, block ); ret = FALSE; } else - ret = HEAP_ValidateInUseArena( subheap, (const ARENA_INUSE *)block - 1, quiet ); + ret = HEAP_ValidateInUseArena( subheap, arena, quiet ); if (!(flags & HEAP_NO_SERIALIZE)) RtlLeaveCriticalSection( &heapPtr->critSection ); diff --git a/dlls/ole32/compobj_private.h b/dlls/ole32/compobj_private.h index 401224a00f5..e877cce0269 100644 --- a/dlls/ole32/compobj_private.h +++ b/dlls/ole32/compobj_private.h @@ -45,6 +45,9 @@ DEFINE_OLEGUID( CLSID_DfMarshal, 0x0000030b, 0, 0 ); DEFINE_OLEGUID( CLSID_PSFactoryBuffer, 0x00000320, 0, 0 ); DEFINE_OLEGUID( CLSID_InProcFreeMarshaler, 0x0000033a, 0, 0 ); +/* signal to stub manager that this is a rem unknown object */ +#define MSHLFLAGSP_REMUNKNOWN 0x80000000 + /* Thread-safety Annotation Legend: * * RO - The value is read only. It never changes after creation, so no diff --git a/dlls/ole32/stubmanager.c b/dlls/ole32/stubmanager.c index b7d6ba7f42f..76e07a21c3d 100644 --- a/dlls/ole32/stubmanager.c +++ b/dlls/ole32/stubmanager.c @@ -471,7 +471,7 @@ struct ifstub *stub_manager_new_ifstub(struct stub_manager *m, IRpcStubBuffer *s /* FIXME: find a cleaner way of identifying that we are creating an ifstub * for the remunknown interface */ - if (IsEqualIID(iid, &IID_IRemUnknown)) + if (flags & MSHLFLAGSP_REMUNKNOWN) stub->ipid = m->oxid_info.ipidRemUnknown; else generate_ipid(m, &stub->ipid); @@ -763,7 +763,7 @@ HRESULT start_apartment_remote_unknown(void) { STDOBJREF stdobjref; /* dummy - not used */ /* register it with the stub manager */ - hr = marshal_object(apt, &stdobjref, &IID_IRemUnknown, (IUnknown *)pRemUnknown, MSHLFLAGS_NORMAL); + hr = marshal_object(apt, &stdobjref, &IID_IRemUnknown, (IUnknown *)pRemUnknown, MSHLFLAGS_NORMAL|MSHLFLAGSP_REMUNKNOWN); /* release our reference to the object as the stub manager will manage the life cycle for us */ IRemUnknown_Release(pRemUnknown); if (hr == S_OK) diff --git a/dlls/ole32/tests/marshal.c b/dlls/ole32/tests/marshal.c index 41a2aec1956..7e3e82e766a 100644 --- a/dlls/ole32/tests/marshal.c +++ b/dlls/ole32/tests/marshal.c @@ -2199,12 +2199,7 @@ static void test_client_security(void) CoTaskMemFree(pServerPrincName); IClassFactory_Release(pProxy); -#if 0 - /* FIXME: fix stub manager to not depend on the IID of the interface to - * determine whether it is really the rem unknown for the object before - * re-enabling this line */ IUnknown_Release(pProxy2); -#endif IUnknown_Release(pUnknown1); IUnknown_Release(pUnknown2); IMarshal_Release(pMarshal); diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index 8f87870e37a..e6c19f5112f 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -190,6 +190,7 @@ typedef struct _IFilterGraphImpl { int EcCompleteCount; int HandleEcComplete; int HandleEcRepaint; + int HandleEcClockChanged; OAFilterState state; CRITICAL_SECTION cs; ITF_CACHE_ENTRY ItfCacheEntries[MAX_ITF_CACHE_ENTRIES]; @@ -274,7 +275,10 @@ static ULONG Filtergraph_Release(IFilterGraphImpl *This) { IBaseFilter_Release(This->ppFiltersInGraph[i]); } for (i = 0; i < This->nItfCacheEntries; i++) - IUnknown_Release(This->ItfCacheEntries[i].iface); + { + if (This->ItfCacheEntries[i].iface) + IUnknown_Release(This->ItfCacheEntries[i].iface); + } IFilterMapper2_Release(This->pFilterMapper2); CloseHandle(This->hEventCompletion); EventsQueue_Destroy(&This->evqueue); @@ -4106,6 +4110,8 @@ static HRESULT WINAPI MediaEvent_CancelDefaultHandling(IMediaEventEx *iface, This->HandleEcComplete = FALSE; else if (lEvCode == EC_REPAINT) This->HandleEcRepaint = FALSE; + else if (lEvCode == EC_CLOCK_CHANGED) + This->HandleEcClockChanged = FALSE; else return S_FALSE; @@ -4122,6 +4128,8 @@ static HRESULT WINAPI MediaEvent_RestoreDefaultHandling(IMediaEventEx *iface, This->HandleEcComplete = TRUE; else if (lEvCode == EC_REPAINT) This->HandleEcRepaint = TRUE; + else if (lEvCode == EC_CLOCK_CHANGED) + This->HandleEcClockChanged = TRUE; else return S_FALSE; @@ -4290,6 +4298,19 @@ static HRESULT WINAPI MediaFilter_SetSyncSource(IMediaFilter *iface, IReferenceC This->refClock = pClock; if (This->refClock) IReferenceClock_AddRef(This->refClock); + + if (This->HandleEcClockChanged) + { + IMediaEventSink *pEventSink; + HRESULT eshr; + + eshr = IMediaFilter_QueryInterface(iface, &IID_IMediaEventSink, (LPVOID)&pEventSink); + if (SUCCEEDED(eshr)) + { + IMediaEventSink_Notify(pEventSink, EC_CLOCK_CHANGED, 0, 0); + IMediaEventSink_Release(pEventSink); + } + } } } LeaveCriticalSection(&This->cs); @@ -4591,6 +4612,7 @@ HRESULT FilterGraph_create(IUnknown *pUnkOuter, LPVOID *ppObj) fimpl->hEventCompletion = CreateEventW(0, TRUE, FALSE, 0); fimpl->HandleEcComplete = TRUE; fimpl->HandleEcRepaint = TRUE; + fimpl->HandleEcClockChanged = TRUE; fimpl->notif.hWnd = 0; fimpl->notif.disabled = FALSE; fimpl->nRenderers = 0; diff --git a/dlls/shlwapi/shlwapi.spec b/dlls/shlwapi/shlwapi.spec index 8d2cd852778..c1cebdd0569 100644 --- a/dlls/shlwapi/shlwapi.spec +++ b/dlls/shlwapi/shlwapi.spec @@ -334,7 +334,7 @@ 334 stdcall -noname SHGetPathFromIDListWrapW(ptr ptr) 335 stdcall -noname ShellExecuteExWrapW(ptr) 336 stdcall -noname SHFileOperationWrapW(ptr) -337 stdcall @(wstr long ptr ptr long) user32.ExtractIconExW +337 stdcall @(wstr long ptr ptr long) user32.PrivateExtractIconExW 338 stdcall @(wstr long) kernel32.SetFileAttributesW 339 stdcall @(long long wstr ptr ptr long) kernel32.GetNumberFormatW 340 stdcall @(long wstr wstr long) user32.MessageBoxW diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 5502bf9cf43..632fcc19d34 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -3718,8 +3718,36 @@ static void test_IsWindowUnicode(void) DestroyWindow(hwnd); } +static LRESULT CALLBACK minmax_wnd_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) +{ + MINMAXINFO *minmax; + + if (msg != WM_GETMINMAXINFO) + return DefWindowProc(hwnd, msg, wp, lp); + + minmax = (MINMAXINFO *)lp; + + if ((GetWindowLong(hwnd, GWL_STYLE) & WS_CHILD)) + { + minmax->ptReserved.x = 0; + minmax->ptReserved.y = 0; + minmax->ptMaxSize.x = 400; + minmax->ptMaxSize.y = 400; + minmax->ptMaxPosition.x = 300; + minmax->ptMaxPosition.y = 300; + minmax->ptMaxTrackSize.x = 200; + minmax->ptMaxTrackSize.y = 200; + minmax->ptMinTrackSize.x = 100; + minmax->ptMinTrackSize.y = 100; + } + else + DefWindowProc(hwnd, msg, wp, lp); + return 1; +} + static void test_CreateWindow(void) { + WNDCLASS cls; HWND hwnd, parent; HMENU hmenu; RECT rc, rc_minmax; @@ -3917,8 +3945,20 @@ static void test_CreateWindow(void) ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError()); /* test child window sizing */ + cls.style = 0; + cls.lpfnWndProc = minmax_wnd_proc; + cls.cbClsExtra = 0; + cls.cbWndExtra = 0; + cls.hInstance = GetModuleHandle(0); + cls.hIcon = 0; + cls.hCursor = LoadCursorA(0, (LPSTR)IDC_ARROW); + cls.hbrBackground = GetStockObject(WHITE_BRUSH); + cls.lpszMenuName = NULL; + cls.lpszClassName = "MinMax_WndClass"; + RegisterClass(&cls); + SetLastError(0xdeadbeef); - parent = CreateWindowEx(0, "static", NULL, WS_CAPTION | WS_SYSMENU | WS_THICKFRAME, + parent = CreateWindowEx(0, "MinMax_WndClass", NULL, WS_CAPTION | WS_SYSMENU | WS_THICKFRAME, 0, 0, 100, 100, 0, 0, 0, NULL); ok(parent != 0, "CreateWindowEx error %d\n", GetLastError()); expect_menu(parent, 0); @@ -3928,19 +3968,20 @@ static void test_CreateWindow(void) memset(&minmax, 0, sizeof(minmax)); SendMessage(parent, WM_GETMINMAXINFO, 0, (LPARAM)&minmax); SetRect(&rc_minmax, 0, 0, minmax.ptMaxSize.x, minmax.ptMaxSize.y); - ok(IsRectEmpty(&rc_minmax), "rc_minmax is not empty\n"); + ok(IsRectEmpty(&rc_minmax), "ptMaxSize is not empty\n"); + SetRect(&rc_minmax, 0, 0, minmax.ptMaxTrackSize.x, minmax.ptMaxTrackSize.y); + ok(IsRectEmpty(&rc_minmax), "ptMaxTrackSize is not empty\n"); + GetWindowRect(parent, &rc); + ok(!IsRectEmpty(&rc), "parent window rect is empty\n"); GetClientRect(parent, &rc); - ok(rc_minmax.left >= rc.left && rc_minmax.top >= rc.top && - rc_minmax.right <= rc.right && rc_minmax.bottom <= rc.bottom, - "rc_minmax (%d,%d-%d,%d) is not within of parent client rect (%d,%d-%d,%d)\n", - rc_minmax.left, rc_minmax.top, rc_minmax.right, rc_minmax.bottom, - rc.left, rc.top, rc.right, rc.bottom); + ok(!IsRectEmpty(&rc), "parent client rect is empty\n"); + InflateRect(&rc, 200, 200); trace("creating child with rect (%d,%d-%d,%d)\n", rc.left, rc.top, rc.right, rc.bottom); SetLastError(0xdeadbeef); - hwnd = CreateWindowEx(0, "static", NULL, WS_CHILD | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME, + hwnd = CreateWindowEx(0, "MinMax_WndClass", NULL, WS_CHILD | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, parent, (HMENU)1, 0, NULL); ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError()); @@ -3948,10 +3989,12 @@ static void test_CreateWindow(void) expect_style(hwnd, WS_CHILD | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME); expect_ex_style(hwnd, WS_EX_WINDOWEDGE); - OffsetRect(&rc, -rc.left, -rc.top); + memset(&minmax, 0, sizeof(minmax)); + SendMessage(hwnd, WM_GETMINMAXINFO, 0, (LPARAM)&minmax); + SetRect(&rc_minmax, 0, 0, minmax.ptMaxTrackSize.x, minmax.ptMaxTrackSize.y); - GetWindowRect(hwnd, &rc_minmax); - OffsetRect(&rc_minmax, -rc_minmax.left, -rc_minmax.top); + GetWindowRect(hwnd, &rc); + OffsetRect(&rc, -rc.left, -rc.top); ok(EqualRect(&rc, &rc_minmax), "rects don't match: (%d,%d-%d,%d) and (%d,%d-%d,%d)\n", rc.left, rc.top, rc.right, rc.bottom, rc_minmax.left, rc_minmax.top, rc_minmax.right, rc_minmax.bottom); @@ -3959,6 +4002,8 @@ static void test_CreateWindow(void) DestroyWindow(hwnd); DestroyWindow(parent); + UnregisterClass("MinMax_WndClass", GetModuleHandle(0)); + #undef expect_menu #undef expect_style #undef expect_ex_style diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 1378b41bdd3..a6982419117 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -681,6 +681,9 @@ BOOL IWineD3DImpl_FillGLCaps(IWineD3D *iface, Display* display) { } else if (strcmp(ThisExtn, "GL_EXT_framebuffer_object") == 0) { TRACE_(d3d_caps)(" FOUND: EXT Frame Buffer Object support\n"); gl_info->supported[EXT_FRAMEBUFFER_OBJECT] = TRUE; + } else if (strcmp(ThisExtn, "GL_EXT_framebuffer_blit") == 0) { + TRACE_(d3d_caps)(" FOUND: EXT Frame Buffer Blit support\n"); + gl_info->supported[EXT_FRAMEBUFFER_BLIT] = TRUE; } else if (strcmp(ThisExtn, "GL_EXT_blend_minmax") == 0) { TRACE_(d3d_caps)(" FOUND: EXT Blend minmax support\n"); gl_info->supported[EXT_BLEND_MINMAX] = TRUE; diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 26cf6ea5b04..fa6e00547d6 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1180,10 +1180,15 @@ BOOL X11DRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode ) if ((cs->style & WS_THICKFRAME) || !(cs->style & (WS_POPUP | WS_CHILD))) { POINT maxSize, maxPos, minTrack, maxTrack; - /* Although Windows sends WM_GETMINMAXINFO at the window creation time, - * it doesn't use returned values to set window size. - */ + WINPOS_GetMinMaxInfo( hwnd, &maxSize, &maxPos, &minTrack, &maxTrack); + if (maxTrack.x < cs->cx) cs->cx = maxTrack.x; + if (maxTrack.y < cs->cy) cs->cy = maxTrack.y; + if (cs->cx < 0) cs->cx = 0; + if (cs->cy < 0) cs->cy = 0; + + SetRect( &rect, cs->x, cs->y, cs->x + cs->cx, cs->y + cs->cy ); + if (!X11DRV_SetWindowPos( hwnd, 0, &rect, &rect, SWP_NOZORDER, NULL )) return FALSE; } /* send WM_NCCREATE */ diff --git a/dlls/wintrust/crypt.c b/dlls/wintrust/crypt.c index 1edf1717631..3dd127c5f7a 100644 --- a/dlls/wintrust/crypt.c +++ b/dlls/wintrust/crypt.c @@ -42,15 +42,16 @@ WINE_DEFAULT_DEBUG_CHANNEL(wintrust); * * RETURNS * Success: TRUE. catAdmin contains the context handle. - * Failure: FAIL. + * Failure: FALSE. * */ BOOL WINAPI CryptCATAdminAcquireContext(HCATADMIN* catAdmin, const GUID *sysSystem, DWORD dwFlags ) { FIXME("%p %s %x\n", catAdmin, debugstr_guid(sysSystem), dwFlags); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + + if (catAdmin) *catAdmin = (HCATADMIN)0xdeadbeef; + return TRUE; } /*********************************************************************** @@ -60,8 +61,9 @@ BOOL WINAPI CryptCATAdminCalcHashFromFileHandle(HANDLE hFile, DWORD* pcbHash, BYTE* pbHash, DWORD dwFlags ) { FIXME("%p %p %p %x\n", hFile, pcbHash, pbHash, dwFlags); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + + if (pbHash && pcbHash) memset(pbHash, 0, *pcbHash); + return TRUE; } /*********************************************************************** @@ -74,7 +76,6 @@ HCATINFO WINAPI CryptCATAdminEnumCatalogFromHash(HCATADMIN hCatAdmin, HCATINFO* phPrevCatInfo ) { FIXME("%p %p %d %d %p\n", hCatAdmin, pbHash, cbHash, dwFlags, phPrevCatInfo); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return NULL; } @@ -84,7 +85,7 @@ HCATINFO WINAPI CryptCATAdminEnumCatalogFromHash(HCATADMIN hCatAdmin, * Release a catalog administrator context handle. * * PARAMS - * catAdmin [I] Pointer to the context handle. + * catAdmin [I] Context handle. * dwFlags [I] Reserved. * * RETURNS @@ -95,8 +96,28 @@ HCATINFO WINAPI CryptCATAdminEnumCatalogFromHash(HCATADMIN hCatAdmin, BOOL WINAPI CryptCATAdminReleaseContext(HCATADMIN hCatAdmin, DWORD dwFlags ) { FIXME("%p %x\n", hCatAdmin, dwFlags); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + return TRUE; +} + +/*********************************************************************** + * CryptCATAdminRemoveCatalog (WINTRUST.@) + * + * Remove a catalog file. + * + * PARAMS + * catAdmin [I] Context handle. + * pwszCatalogFile [I] Catalog file. + * dwFlags [I] Reserved. + * + * RETURNS + * Success: TRUE. + * Failure: FALSE. + * + */ +BOOL WINAPI CryptCATAdminRemoveCatalog(HCATADMIN hCatAdmin, LPCWSTR pwszCatalogFile, DWORD dwFlags) +{ + FIXME("%p %s %x\n", hCatAdmin, debugstr_w(pwszCatalogFile), dwFlags); + return DeleteFileW(pwszCatalogFile); } /*********************************************************************** diff --git a/dlls/wintrust/wintrust.spec b/dlls/wintrust/wintrust.spec index 49fb9c831ba..e44e6cce9be 100644 --- a/dlls/wintrust/wintrust.spec +++ b/dlls/wintrust/wintrust.spec @@ -7,7 +7,7 @@ @ stub CryptCATAdminPauseServiceForBackup @ stub CryptCATAdminReleaseCatalogContext @ stdcall CryptCATAdminReleaseContext(long long) -@ stub CryptCATAdminRemoveCatalog +@ stdcall CryptCATAdminRemoveCatalog(ptr wstr long) @ stub CryptCATAdminResolveCatalogPath @ stub CryptCATCDFClose @ stub CryptCATCDFEnumAttributes diff --git a/include/wine/wined3d_gl.h b/include/wine/wined3d_gl.h index 1b4744f7678..7a2ffdba0f7 100644 --- a/include/wine/wined3d_gl.h +++ b/include/wine/wined3d_gl.h @@ -364,6 +364,15 @@ typedef void (APIENTRY * PGLFNGLFRAMEBUFFERTEXTURE3DEXTPROC)(GLenum target, GLen typedef void (APIENTRY * PGLFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); typedef void (APIENTRY * PGLFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)(GLenum target, GLenum attachment, GLenum pname, GLint *params); typedef void (APIENTRY * PGLFNGLGENERATEMIPMAPEXTPROC)(GLenum target); +/* GL_EXT_framebuffer_blit */ +#ifndef GL_EXT_framebuffer_blit +#define GL_EXT_framebuffer_blit 1 +#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 +#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA +#endif +typedef void (APIENTRY * PGLFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); /* GL_EXT_secondary_color */ #ifndef GL_EXT_secondary_color #define GL_EXT_secondary_color 1 @@ -1508,6 +1517,7 @@ typedef enum _GL_SupportedExt { EXT_BLEND_MINMAX, EXT_FOG_COORD, EXT_FRAMEBUFFER_OBJECT, + EXT_FRAMEBUFFER_BLIT, EXT_PALETTED_TEXTURE, EXT_PIXEL_BUFFER_OBJECT, EXT_POINT_PARAMETERS, @@ -1622,6 +1632,8 @@ typedef enum _GL_SupportedExt { USE_GL_FUNC(PGLFNGLGENERATEMIPMAPEXTPROC, glGenerateMipmapEXT); \ USE_GL_FUNC(PGLFNGLGETRENDERBUFFERPARAMETERIVEXTPROC, glGetRenderbufferParameterivEXT); \ USE_GL_FUNC(PGLFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC, glGetFramebufferAttachmentParameterivEXT); \ + /* GL_EXT_framebuffer_blit */ \ + USE_GL_FUNC(PGLFNGLBLITFRAMEBUFFEREXTPROC, glBlitFramebufferEXT); \ /* GL_EXT_paletted_texture */ \ USE_GL_FUNC(PGLFNGLCOLORTABLEEXTPROC, glColorTableEXT); \ /* GL_EXT_point_parameters */ \ diff --git a/programs/cmd/directory.c b/programs/cmd/directory.c index 79d755a7e32..ac1e59d5eda 100644 --- a/programs/cmd/directory.c +++ b/programs/cmd/directory.c @@ -33,10 +33,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(cmd); int WCMD_dir_sort (const void *a, const void *b); -void WCMD_list_directory (char *path, int level); char * WCMD_filesize64 (ULONGLONG free); char * WCMD_strrev (char *buff); static void WCMD_getfileowner(char *filename, char *owner, int ownerlen); +static void WCMD_dir_trailer(char drive); extern int echo_mode; extern char quals[MAX_PATH], param1[MAX_PATH], param2[MAX_PATH]; @@ -57,6 +57,14 @@ typedef enum _DISPLAYORDER Date } DISPLAYORDER; +typedef struct _DIRECTORY_STACK +{ + struct _DIRECTORY_STACK *next; + char *dirName; + char *fileName; +} DIRECTORY_STACK; + +static DIRECTORY_STACK *WCMD_list_directory (DIRECTORY_STACK *parms, int level); static int file_total, dir_total, recurse, wide, bare, max_width, lower; static int shortname, usernames; static ULONGLONG byte_total; @@ -73,14 +81,25 @@ static ULONG showattrs, attrsbits; * */ -void WCMD_directory (void) { +void WCMD_directory (char *cmd) { - char path[MAX_PATH], drive[8]; + char path[MAX_PATH], cwd[MAX_PATH]; int status, paged_mode; - ULARGE_INTEGER avail, total, free; CONSOLE_SCREEN_BUFFER_INFO consoleInfo; char *p; char string[MAXSTRING]; + int argno = 0; + int argsProcessed = 0; + char *argN = cmd; + char lastDrive; + BOOL trailerReqd = FALSE; + DIRECTORY_STACK *fullParms = NULL; + DIRECTORY_STACK *prevEntry = NULL; + DIRECTORY_STACK *thisEntry = NULL; + char drive[10]; + char dir[MAX_PATH]; + char fname[MAX_PATH]; + char ext[MAX_PATH]; errorlevel = 0; @@ -261,40 +280,156 @@ void WCMD_directory (void) { WCMD_enter_paged_mode(); } - if (param1[0] == '\0') strcpy (param1, "."); - status = GetFullPathName (param1, sizeof(path), path, NULL); - if (!status) { - WCMD_print_error(); - if (paged_mode) WCMD_leave_paged_mode(); - errorlevel = 1; - return; + argno = 0; + argsProcessed = 0; + argN = cmd; + GetCurrentDirectory (1024, cwd); + strcat(cwd, "\\"); + + /* Loop through all args, calculating full effective directory */ + fullParms = NULL; + prevEntry = NULL; + while (argN) { + char fullname[MAXSTRING]; + char *thisArg = WCMD_parameter (cmd, argno++, &argN); + if (argN && argN[0] != '/') { + + WINE_TRACE("Found parm '%s'\n", thisArg); + if (thisArg[1] == ':' && thisArg[2] == '\\') { + strcpy(fullname, thisArg); + } else if (thisArg[1] == ':' && thisArg[2] != '\\') { + char envvar[4]; + sprintf(envvar, "=%c:", thisArg[0]); + if (!GetEnvironmentVariable(envvar, fullname, MAX_PATH)) { + sprintf(fullname, "%c:", thisArg[0]); + } + strcat(fullname, "\\"); + strcat(fullname, &thisArg[2]); + } else if (thisArg[0] == '\\') { + strncpy(fullname, cwd, 2); + fullname[2] = 0x00; + strcat((fullname+2), thisArg); + } else { + strcpy(fullname, cwd); + strcat(fullname, thisArg); + } + WINE_TRACE("Using location '%s'\n", fullname); + + status = GetFullPathName (fullname, sizeof(path), path, NULL); + + /* + * If the path supplied does not include a wildcard, and the endpoint of the + * path references a directory, we need to list the *contents* of that + * directory not the directory file itself. + */ + if ((strchr(path, '*') == NULL) && (strchr(path, '%') == NULL)) { + status = GetFileAttributes (path); + if ((status != INVALID_FILE_ATTRIBUTES) && (status & FILE_ATTRIBUTE_DIRECTORY)) { + if (path[strlen(path)-1] == '\\') { + strcat (path, "*"); + } + else { + strcat (path, "\\*"); + } + } + } else { + /* Special case wildcard search with no extension (ie parameters ending in '.') as + GetFullPathName strips off the additional '.' */ + if (fullname[strlen(fullname)-1] == '.') strcat(path, "."); + } + + WINE_TRACE("Using path '%s'\n", path); + thisEntry = (DIRECTORY_STACK *) HeapAlloc(GetProcessHeap(),0,sizeof(DIRECTORY_STACK)); + if (fullParms == NULL) fullParms = thisEntry; + if (prevEntry != NULL) prevEntry->next = thisEntry; + prevEntry = thisEntry; + thisEntry->next = NULL; + + /* Split into components */ + WCMD_splitpath(path, drive, dir, fname, ext); + WINE_TRACE("Path Parts: drive: '%s' dir: '%s' name: '%s' ext:'%s'\n", + drive, dir, fname, ext); + + thisEntry->dirName = HeapAlloc(GetProcessHeap(),0,strlen(drive)+strlen(dir)+1); + strcpy(thisEntry->dirName, drive); + strcat(thisEntry->dirName, dir); + + thisEntry->fileName = HeapAlloc(GetProcessHeap(),0,strlen(fname)+strlen(ext)+1); + strcpy(thisEntry->fileName, fname); + strcat(thisEntry->fileName, ext); + + } } - lstrcpyn (drive, path, 3); - - if (!bare) { - status = WCMD_volume (0, drive); - if (!status) { - if (paged_mode) WCMD_leave_paged_mode(); - errorlevel = 1; - return; - } + + /* If just 'dir' entered, a '*' parameter is assumed */ + if (fullParms == NULL) { + WINE_TRACE("Inserting default '*'\n"); + fullParms = (DIRECTORY_STACK *) HeapAlloc(GetProcessHeap(),0, sizeof(DIRECTORY_STACK)); + fullParms->next = NULL; + fullParms->dirName = HeapAlloc(GetProcessHeap(),0,(strlen(cwd)+1)); + strcpy(fullParms->dirName, cwd); + fullParms->fileName = HeapAlloc(GetProcessHeap(),0,2); + strcpy(fullParms->fileName, "*"); } - WCMD_list_directory (path, 0); - lstrcpyn (drive, path, 4); - GetDiskFreeSpaceEx (drive, &avail, &total, &free); - - if (errorlevel==0 && !bare) { - if (recurse) { - WCMD_output ("\n\n Total files listed:\n%8d files%25s bytes\n", - file_total, WCMD_filesize64 (byte_total)); - WCMD_output ("%8d directories %18s bytes free\n\n", - dir_total, WCMD_filesize64 (free.QuadPart)); - } else { - WCMD_output (" %18s bytes free\n\n", WCMD_filesize64 (free.QuadPart)); - } + lastDrive = '?'; + prevEntry = NULL; + thisEntry = fullParms; + trailerReqd = FALSE; + + while (thisEntry != NULL) { + + /* Output disk free (trailer) and volume information (header) if the drive + letter changes */ + if (lastDrive != toupper(thisEntry->dirName[0])) { + + /* Trailer Information */ + if (lastDrive != '?') { + trailerReqd = FALSE; + WCMD_dir_trailer(prevEntry->dirName[0]); + } + + lastDrive = toupper(thisEntry->dirName[0]); + + if (!bare) { + char drive[3]; + + WINE_TRACE("Writing volume for '%c:'\n", thisEntry->dirName[0]); + strncpy(drive, thisEntry->dirName, 2); + drive[2] = 0x00; + status = WCMD_volume (0, drive); + trailerReqd = TRUE; + if (!status) { + errorlevel = 1; + goto exit; + } + } + } else { + if (!bare) WCMD_output ("\n\n"); + } + + /* Clear any errors from previous invocations, and process it */ + errorlevel = 0; + prevEntry = thisEntry; + thisEntry = WCMD_list_directory (thisEntry, 0); + } + + /* Trailer Information */ + if (trailerReqd) { + WCMD_dir_trailer(prevEntry->dirName[0]); } + +exit: if (paged_mode) WCMD_leave_paged_mode(); + + /* Free storage allocated for parms */ + while (fullParms != NULL) { + prevEntry = fullParms; + fullParms = prevEntry->next; + HeapFree(GetProcessHeap(),0,prevEntry->dirName); + HeapFree(GetProcessHeap(),0,prevEntry->fileName); + HeapFree(GetProcessHeap(),0,prevEntry); + } } /***************************************************************************** @@ -303,25 +438,25 @@ void WCMD_directory (void) { * List a single file directory. This function (and those below it) can be called * recursively when the /S switch is used. * - * FIXME: Entries sorted by name only. Should we support DIRCMD?? * FIXME: Assumes 24-line display for the /P qualifier. - * FIXME: Other command qualifiers not supported. - * FIXME: DIR /S FILENAME fails if at least one matching file is not found in the top level. */ -void WCMD_list_directory (char *search_path, int level) { +static DIRECTORY_STACK *WCMD_list_directory (DIRECTORY_STACK *inputparms, int level) { char string[1024], datestring[32], timestring[32]; - char *p; char real_path[MAX_PATH]; WIN32_FIND_DATA *fd; FILETIME ft; SYSTEMTIME st; HANDLE hff; - int status, dir_count, file_count, entry_count, i, widest, cur_width, tmp_width; + int dir_count, file_count, entry_count, i, widest, cur_width, tmp_width; int numCols, numRows; int rows, cols; ULARGE_INTEGER byte_count, file_size; + DIRECTORY_STACK *parms; + int concurrentDirs = 0; + BOOL done_header = FALSE; + dir_count = 0; file_count = 0; @@ -330,222 +465,270 @@ void WCMD_list_directory (char *search_path, int level) { widest = 0; cur_width = 0; -/* - * If the path supplied does not include a wildcard, and the endpoint of the - * path references a directory, we need to list the *contents* of that - * directory not the directory file itself. - */ - - if ((strchr(search_path, '*') == NULL) && (strchr(search_path, '%') == NULL)) { - status = GetFileAttributes (search_path); - if ((status != INVALID_FILE_ATTRIBUTES) && (status & FILE_ATTRIBUTE_DIRECTORY)) { - if (search_path[strlen(search_path)-1] == '\\') { - strcat (search_path, "*"); - } - else { - strcat (search_path, "\\*"); - } - } - } - - /* Work out the actual current directory name */ - p = strrchr (search_path, '\\'); - memset(real_path, 0x00, sizeof(real_path)); - lstrcpyn (real_path, search_path, (p-search_path+2)); - - /* Load all files into an in memory structure */ + /* Loop merging all the files from consecutive parms which relate to the + same directory. Note issuing a directory header with no contents + mirrors what windows does */ + parms = inputparms; fd = HeapAlloc(GetProcessHeap(),0,sizeof(WIN32_FIND_DATA)); - hff = FindFirstFile (search_path, fd); - if (hff == INVALID_HANDLE_VALUE) { - SetLastError (ERROR_FILE_NOT_FOUND); - WCMD_print_error (); - HeapFree(GetProcessHeap(),0,fd); - errorlevel = 1; - return; - } - do { - /* Skip any which are filtered out by attribute */ - if (((fd+entry_count)->dwFileAttributes & attrsbits) != showattrs) continue; - - entry_count++; - - /* Keep running track of longest filename for wide output */ - if (wide || orderByCol) { - int tmpLen = strlen((fd+(entry_count-1))->cFileName) + 3; - if ((fd+(entry_count-1))->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) tmpLen = tmpLen + 2; - if (tmpLen > widest) widest = tmpLen; - } + while (parms && strcmp(inputparms->dirName, parms->dirName) == 0) { + concurrentDirs++; + + /* Work out the full path + filename */ + strcpy(real_path, parms->dirName); + strcat(real_path, parms->fileName); + + /* Load all files into an in memory structure */ + WINE_TRACE("Looking for matches to '%s'\n", real_path); + hff = FindFirstFile (real_path, (fd+entry_count)); + if (hff != INVALID_HANDLE_VALUE) { + do { + /* Skip any which are filtered out by attribute */ + if (((fd+entry_count)->dwFileAttributes & attrsbits) != showattrs) continue; + + entry_count++; + + /* Keep running track of longest filename for wide output */ + if (wide || orderByCol) { + int tmpLen = strlen((fd+(entry_count-1))->cFileName) + 3; + if ((fd+(entry_count-1))->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) tmpLen = tmpLen + 2; + if (tmpLen > widest) widest = tmpLen; + } - fd = HeapReAlloc(GetProcessHeap(),0,fd,(entry_count+1)*sizeof(WIN32_FIND_DATA)); - if (fd == NULL) { + fd = HeapReAlloc(GetProcessHeap(),0,fd,(entry_count+1)*sizeof(WIN32_FIND_DATA)); + if (fd == NULL) { + FindClose (hff); + WCMD_output ("Memory Allocation Error"); + errorlevel = 1; + return parms->next; + } + } while (FindNextFile(hff, (fd+entry_count)) != 0); FindClose (hff); - WCMD_output ("Memory Allocation Error"); - errorlevel = 1; - return; } - } while (FindNextFile(hff, (fd+entry_count)) != 0); - FindClose (hff); - - /* Handle case where everything is filtered out */ - if (entry_count == 0) { - SetLastError (ERROR_FILE_NOT_FOUND); - WCMD_print_error (); - HeapFree(GetProcessHeap(),0,fd); - errorlevel = 1; - return; - } - /* Sort the list of files */ - qsort (fd, entry_count, sizeof(WIN32_FIND_DATA), WCMD_dir_sort); + /* Work out the actual current directory name without a trailing \ */ + strcpy(real_path, parms->dirName); + real_path[strlen(parms->dirName)-1] = 0x00; + + /* Output the results */ + if (!bare) { + if (level != 0 && (entry_count > 0)) WCMD_output ("\n"); + if (!recurse || ((entry_count > 0) && done_header==FALSE)) { + WCMD_output ("Directory of %s\n\n", real_path); + done_header = TRUE; + } + } - /* Output the results */ - if (!bare) { - if (level != 0) WCMD_output ("\n\n"); - WCMD_output ("Directory of %s\n\n", real_path); + /* Move to next parm */ + parms = parms->next; } - /* Work out the number of columns */ - WINE_TRACE("%d entries, maxwidth=%d, widest=%d\n", entry_count, max_width, widest); - if (wide || orderByCol) { - numCols = max(1, (int)max_width / widest); - numRows = entry_count / numCols; - if (entry_count % numCols) numRows++; - } else { - numCols = 1; - numRows = entry_count; - } - WINE_TRACE("cols=%d, rows=%d\n", numCols, numRows); + /* Handle case where everything is filtered out */ + if (entry_count > 0) { - for (rows=0; rows= entry_count) continue; + /* Work out the number of columns */ + WINE_TRACE("%d entries, maxwidth=%d, widest=%d\n", entry_count, max_width, widest); + if (wide || orderByCol) { + numCols = max(1, (int)max_width / widest); + numRows = entry_count / numCols; + if (entry_count % numCols) numRows++; } else { - i = (rows * numCols) + cols; - if (i >= entry_count) continue; - } - - /* /L convers all names to lower case */ - if (lower) { - char *p = (fd+i)->cFileName; - while ( (*p = tolower(*p)) ) ++p; + numCols = 1; + numRows = entry_count; } + WINE_TRACE("cols=%d, rows=%d\n", numCols, numRows); - /* /Q gets file ownership information */ - if (usernames) { - p = strrchr (search_path, '\\'); - lstrcpyn (string, search_path, (p-search_path+2)); - lstrcat (string, (fd+i)->cFileName); - WCMD_getfileowner(string, username, sizeof(username)); - } + for (rows=0; rowsftLastWriteTime, &ft); - } else if (dirTime == Access) { - FileTimeToLocalFileTime (&(fd+i)->ftLastAccessTime, &ft); - } else { - FileTimeToLocalFileTime (&(fd+i)->ftCreationTime, &ft); - } - FileTimeToSystemTime (&ft, &st); - GetDateFormat (0, DATE_SHORTDATE, &st, NULL, datestring, - sizeof(datestring)); - GetTimeFormat (0, TIME_NOSECONDS, &st, - NULL, timestring, sizeof(timestring)); - - if (wide) { - - tmp_width = cur_width; - if ((fd+i)->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - WCMD_output ("[%s]", (fd+i)->cFileName); - dir_count++; - tmp_width = tmp_width + strlen((fd+i)->cFileName) + 2; + /* Work out the index of the entry being pointed to */ + if (orderByCol) { + i = (cols * numRows) + rows; + if (i >= entry_count) continue; } else { - WCMD_output ("%s", (fd+i)->cFileName); - tmp_width = tmp_width + strlen((fd+i)->cFileName) ; - file_count++; - file_size.u.LowPart = (fd+i)->nFileSizeLow; - file_size.u.HighPart = (fd+i)->nFileSizeHigh; - byte_count.QuadPart += file_size.QuadPart; + i = (rows * numCols) + cols; + if (i >= entry_count) continue; } - cur_width = cur_width + widest; - if ((cur_width + widest) > max_width) { - cur_width = 0; - } else { - WCMD_output ("%*.s", (tmp_width - cur_width) ,""); + /* /L convers all names to lower case */ + if (lower) { + char *p = (fd+i)->cFileName; + while ( (*p = tolower(*p)) ) ++p; } - } else if ((fd+i)->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - dir_count++; + /* /Q gets file ownership information */ + if (usernames) { + lstrcpy (string, inputparms->dirName); + lstrcat (string, (fd+i)->cFileName); + WCMD_getfileowner(string, username, sizeof(username)); + } - if (!bare) { - WCMD_output ("%10s %8s ", datestring, timestring); - if (shortname) WCMD_output ("%-13s", (fd+i)->cAlternateFileName); - if (usernames) WCMD_output ("%-23s", username); - WCMD_output("%s",(fd+i)->cFileName); + if (dirTime == Written) { + FileTimeToLocalFileTime (&(fd+i)->ftLastWriteTime, &ft); + } else if (dirTime == Access) { + FileTimeToLocalFileTime (&(fd+i)->ftLastAccessTime, &ft); } else { - if (!((strcmp((fd+i)->cFileName, ".") == 0) || - (strcmp((fd+i)->cFileName, "..") == 0))) { - WCMD_output ("%s%s", recurse?real_path:"", (fd+i)->cFileName); - } + FileTimeToLocalFileTime (&(fd+i)->ftCreationTime, &ft); } - } - else { - file_count++; - file_size.u.LowPart = (fd+i)->nFileSizeLow; - file_size.u.HighPart = (fd+i)->nFileSizeHigh; - byte_count.QuadPart += file_size.QuadPart; - if (!bare) { - WCMD_output ("%10s %8s %10s ", datestring, timestring, - WCMD_filesize64(file_size.QuadPart)); - if (shortname) WCMD_output ("%-13s", (fd+i)->cAlternateFileName); - if (usernames) WCMD_output ("%-23s", username); - WCMD_output("%s",(fd+i)->cFileName); - } else { - WCMD_output ("%s%s", recurse?real_path:"", (fd+i)->cFileName); + FileTimeToSystemTime (&ft, &st); + GetDateFormat (0, DATE_SHORTDATE, &st, NULL, datestring, + sizeof(datestring)); + GetTimeFormat (0, TIME_NOSECONDS, &st, + NULL, timestring, sizeof(timestring)); + + if (wide) { + + tmp_width = cur_width; + if ((fd+i)->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { + WCMD_output ("[%s]", (fd+i)->cFileName); + dir_count++; + tmp_width = tmp_width + strlen((fd+i)->cFileName) + 2; + } else { + WCMD_output ("%s", (fd+i)->cFileName); + tmp_width = tmp_width + strlen((fd+i)->cFileName) ; + file_count++; + file_size.u.LowPart = (fd+i)->nFileSizeLow; + file_size.u.HighPart = (fd+i)->nFileSizeHigh; + byte_count.QuadPart += file_size.QuadPart; + } + cur_width = cur_width + widest; + + if ((cur_width + widest) > max_width) { + cur_width = 0; + } else { + WCMD_output ("%*.s", (tmp_width - cur_width) ,""); + } + + } else if ((fd+i)->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { + dir_count++; + + if (!bare) { + WCMD_output ("%10s %8s ", datestring, timestring); + if (shortname) WCMD_output ("%-13s", (fd+i)->cAlternateFileName); + if (usernames) WCMD_output ("%-23s", username); + WCMD_output("%s",(fd+i)->cFileName); + } else { + if (!((strcmp((fd+i)->cFileName, ".") == 0) || + (strcmp((fd+i)->cFileName, "..") == 0))) { + WCMD_output ("%s%s", recurse?inputparms->dirName:"", (fd+i)->cFileName); + } else { + addNewLine = FALSE; + } + } + } + else { + file_count++; + file_size.u.LowPart = (fd+i)->nFileSizeLow; + file_size.u.HighPart = (fd+i)->nFileSizeHigh; + byte_count.QuadPart += file_size.QuadPart; + if (!bare) { + WCMD_output ("%10s %8s %10s ", datestring, timestring, + WCMD_filesize64(file_size.QuadPart)); + if (shortname) WCMD_output ("%-13s", (fd+i)->cAlternateFileName); + if (usernames) WCMD_output ("%-23s", username); + WCMD_output("%s",(fd+i)->cFileName); + } else { + WCMD_output ("%s%s", recurse?inputparms->dirName:"", (fd+i)->cFileName); + } } + } + if (addNewLine) WCMD_output ("\n"); + cur_width = 0; } - } - WCMD_output ("\n"); - cur_width = 0; - } - if (!bare) { - if (file_count == 1) { - WCMD_output (" 1 file %25s bytes\n", WCMD_filesize64 (byte_count.QuadPart)); - } - else { - WCMD_output ("%8d files %24s bytes\n", file_count, WCMD_filesize64 (byte_count.QuadPart)); - } - } - byte_total = byte_total + byte_count.QuadPart; - file_total = file_total + file_count; - dir_total = dir_total + dir_count; + if (!bare) { + if (file_count == 1) { + WCMD_output (" 1 file %25s bytes\n", WCMD_filesize64 (byte_count.QuadPart)); + } + else { + WCMD_output ("%8d files %24s bytes\n", file_count, WCMD_filesize64 (byte_count.QuadPart)); + } + } + byte_total = byte_total + byte_count.QuadPart; + file_total = file_total + file_count; + dir_total = dir_total + dir_count; - if (!bare) { - if (dir_count == 1) WCMD_output ("1 directory "); - else WCMD_output ("%8d directories", dir_count); - } - for (i=0; icFileName[0] != '.') && - ((fd+i)->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { -#if 0 - GetFullPathName ((fd+i)->cFileName, sizeof(string), string, NULL); -#endif - p = strrchr (search_path, '\\'); - lstrcpyn (string, search_path, (p-search_path+2)); - lstrcat (string, (fd+i)->cFileName); - lstrcat (string, p); - WCMD_list_directory (string, 1); + if (!bare && !recurse) { + if (dir_count == 1) WCMD_output ("%8d directory ", 1); + else WCMD_output ("%8d directories", dir_count); } } HeapFree(GetProcessHeap(),0,fd); - return; + + /* When recursing, look in all subdirectories for matches */ + if (recurse) { + DIRECTORY_STACK *dirStack = NULL; + DIRECTORY_STACK *lastEntry = NULL; + WIN32_FIND_DATA finddata; + + /* Build path to search */ + strcpy(string, inputparms->dirName); + strcat(string, "*"); + + WINE_TRACE("Recursive, looking for '%s'\n", string); + hff = FindFirstFile (string, &finddata); + if (hff != INVALID_HANDLE_VALUE) { + do { + if ((finddata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && + (strcmp(finddata.cFileName, "..") != 0) && + (strcmp(finddata.cFileName, ".") != 0)) { + + DIRECTORY_STACK *thisDir; + int dirsToCopy = concurrentDirs; + + /* Loop creating list of subdirs for all concurrent entries */ + parms = inputparms; + while (dirsToCopy > 0) { + dirsToCopy--; + + /* Work out search parameter in sub dir */ + strcpy (string, inputparms->dirName); + strcat (string, finddata.cFileName); + strcat (string, "\\"); + WINE_TRACE("Recursive, Adding to search list '%s'\n", string); + + /* Allocate memory, add to list */ + thisDir = (DIRECTORY_STACK *) HeapAlloc(GetProcessHeap(),0,sizeof(DIRECTORY_STACK)); + if (dirStack == NULL) dirStack = thisDir; + if (lastEntry != NULL) lastEntry->next = thisDir; + lastEntry = thisDir; + thisDir->next = NULL; + thisDir->dirName = HeapAlloc(GetProcessHeap(),0,(strlen(string)+1)); + strcpy(thisDir->dirName, string); + thisDir->fileName = HeapAlloc(GetProcessHeap(),0,(strlen(parms->fileName)+1)); + strcpy(thisDir->fileName, parms->fileName); + parms = parms->next; + } + } + } while (FindNextFile(hff, &finddata) != 0); + FindClose (hff); + + while (dirStack != NULL) { + DIRECTORY_STACK *thisDir = dirStack; + dirStack = WCMD_list_directory (thisDir, 1); + while (thisDir != dirStack) { + DIRECTORY_STACK *tempDir = thisDir->next; + HeapFree(GetProcessHeap(),0,thisDir->dirName); + HeapFree(GetProcessHeap(),0,thisDir->fileName); + HeapFree(GetProcessHeap(),0,thisDir); + thisDir = tempDir; + } + } + } + } + + /* Handle case where everything is filtered out */ + if ((file_total + dir_total == 0) && (level == 0)) { + SetLastError (ERROR_FILE_NOT_FOUND); + WCMD_print_error (); + errorlevel = 1; + } + + return parms; } /***************************************************************************** @@ -729,3 +912,29 @@ void WCMD_getfileowner(char *filename, char *owner, int ownerlen) { } return; } + +/***************************************************************************** + * WCMD_dir_trailer + * + * Print out the trailer for the supplied drive letter + */ +static void WCMD_dir_trailer(char drive) { + ULARGE_INTEGER avail, total, freebytes; + DWORD status; + char driveName[4] = "c:\\"; + + driveName[0] = drive; + status = GetDiskFreeSpaceEx (driveName, &avail, &total, &freebytes); + WINE_TRACE("Writing trailer for '%s' gave %d(%d)\n", driveName, status, GetLastError()); + + if (errorlevel==0 && !bare) { + if (recurse) { + WCMD_output ("\n Total files listed:\n%8d files%25s bytes\n", + file_total, WCMD_filesize64 (byte_total)); + WCMD_output ("%8d directories %18s bytes free\n\n", + dir_total, WCMD_filesize64 (freebytes.QuadPart)); + } else { + WCMD_output (" %18s bytes free\n\n", WCMD_filesize64 (freebytes.QuadPart)); + } + } +} diff --git a/programs/cmd/wcmd.h b/programs/cmd/wcmd.h index 671019bc5a2..29efbe43658 100644 --- a/programs/cmd/wcmd.h +++ b/programs/cmd/wcmd.h @@ -36,7 +36,7 @@ void WCMD_color (void); void WCMD_copy (void); void WCMD_create_dir (void); void WCMD_delete (char *); -void WCMD_directory (void); +void WCMD_directory (char *); void WCMD_echo (const char *); void WCMD_endlocal (void); void WCMD_enter_paged_mode(void); diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c index 2b5644a3222..44195a5d460 100644 --- a/programs/cmd/wcmdmain.c +++ b/programs/cmd/wcmdmain.c @@ -34,7 +34,7 @@ const char * const inbuilt[] = {"ATTRIB", "CALL", "CD", "CHDIR", "CLS", "COPY", "DATE", "DEL", "DIR", "ECHO", "ERASE", "FOR", "GOTO", "HELP", "IF", "LABEL", "MD", "MKDIR", "MOVE", "PATH", "PAUSE", "PROMPT", "REM", "REN", "RENAME", "RD", "RMDIR", "SET", "SHIFT", - "TIME", "TITLE", "TYPE", "VERIFY", "VER", "VOL", + "TIME", "TITLE", "TYPE", "VERIFY", "VER", "VOL", "ENDLOCAL", "SETLOCAL", "PUSHD", "POPD", "ASSOC", "COLOR", "FTYPE", "EXIT" }; @@ -622,7 +622,7 @@ void WCMD_process_command (char *command) WCMD_delete (p); break; case WCMD_DIR: - WCMD_directory (); + WCMD_directory (p); break; case WCMD_ECHO: WCMD_echo(&whichcmd[count]); @@ -814,6 +814,7 @@ void WCMD_run_program (char *command, int called) { BOOL extensionsupplied = FALSE; BOOL launched = FALSE; BOOL status; + BOOL assumeInternal = FALSE; DWORD len; @@ -849,6 +850,7 @@ void WCMD_run_program (char *command, int called) { /* Loop through the search path, dir by dir */ pathposn = pathtosearch; + WINE_TRACE("Searching in '%s' for '%s'\n", pathtosearch, stemofsearch); while (!launched && pathposn) { char thisDir[MAX_PATH] = ""; @@ -877,8 +879,11 @@ void WCMD_run_program (char *command, int called) { strcat(thisDir, stemofsearch); pos = &thisDir[strlen(thisDir)]; /* Pos = end of name */ - if (GetFileAttributes(thisDir) != INVALID_FILE_ATTRIBUTES) { - found = TRUE; + /* 1. If extension supplied, see if that file exists */ + if (extensionsupplied) { + if (GetFileAttributes(thisDir) != INVALID_FILE_ATTRIBUTES) { + found = TRUE; + } } /* 2. Any .* matches? */ @@ -914,8 +919,20 @@ void WCMD_run_program (char *command, int called) { } } + /* Internal programs won't be picked up by this search, so even + though not found, try one last createprocess and wait for it + to complete. + Note: Ideally we could tell between a console app (wait) and a + windows app, but the API's for it fail in this case */ + if (!found && pathposn == NULL) { + WINE_TRACE("ASSUMING INTERNAL\n"); + assumeInternal = TRUE; + } else { + WINE_TRACE("Found as %s\n", thisDir); + } + /* Once found, launch it */ - if (found) { + if (found || assumeInternal) { STARTUPINFO st; PROCESS_INFORMATION pe; SHFILEINFO psfi; @@ -935,7 +952,7 @@ void WCMD_run_program (char *command, int called) { /* thisDir contains the file to be launched, but with what? eg. a.exe will require a.exe to be launched, a.html may be iexplore */ - hinst = FindExecutable (param1, NULL, temp); + hinst = FindExecutable (thisDir, NULL, temp); if ((INT_PTR)hinst < 32) console = 0; else @@ -945,9 +962,10 @@ void WCMD_run_program (char *command, int called) { st.cb = sizeof(STARTUPINFO); init_msvcrt_io_block(&st); - /* Launch the process and if a CUI wait on it to complete */ - status = CreateProcess (thisDir, command, NULL, NULL, TRUE, - 0, NULL, NULL, &st, &pe); + /* Launch the process and if a CUI wait on it to complete + Note: Launching internal wine processes cannot specify a full path to exe */ + status = CreateProcess (assumeInternal?NULL : thisDir, + command, NULL, NULL, TRUE, 0, NULL, NULL, &st, &pe); if ((opt_c || opt_k) && !opt_s && !status && GetLastError()==ERROR_FILE_NOT_FOUND && command[0]=='\"') { /* strip first and last quote characters and try again */ @@ -963,10 +981,10 @@ void WCMD_run_program (char *command, int called) { errorlevel = 9009; return; } - if (!console) errorlevel = 0; + if (!assumeInternal && !console) errorlevel = 0; else { - if (!HIWORD(console)) WaitForSingleObject (pe.hProcess, INFINITE); + if (assumeInternal || !HIWORD(console)) WaitForSingleObject (pe.hProcess, INFINITE); GetExitCodeProcess (pe.hProcess, &errorlevel); if (errorlevel == STILL_ACTIVE) errorlevel = 0; } @@ -1227,7 +1245,7 @@ void WCMD_output_asis (const char *message) { if (paged_mode) { do { if ((ptr = strchr(message, '\n')) != NULL) ptr++; - WriteFile (GetStdHandle(STD_OUTPUT_HANDLE), message, + WriteFile (GetStdHandle(STD_OUTPUT_HANDLE), message, (ptr) ? ptr - message : lstrlen(message), &count, NULL); if (ptr) { if (++line_count >= max_height - 1) { diff --git a/programs/notepad/En.rc b/programs/notepad/En.rc index fd69972200a..0697f5f8567 100644 --- a/programs/notepad/En.rc +++ b/programs/notepad/En.rc @@ -74,12 +74,12 @@ STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU FONT 8, "MS Shell Dlg" CAPTION "Page Setup" { -LTEXT "&Header (millimeters):", 0x140, 10, 07, 40, 15 +LTEXT "&Header:", 0x140, 10, 07, 40, 15 EDITTEXT IDC_PAGESETUP_HEADERVALUE, 60, 05,110, 12, WS_BORDER | WS_TABSTOP LTEXT "&Footer:", 0x142, 10, 24, 40, 15 EDITTEXT IDC_PAGESETUP_FOOTERVALUE, 60, 22,110, 12, WS_BORDER | WS_TABSTOP -GROUPBOX "&Margins:", 0x144, 10, 43,160, 45 +GROUPBOX "&Margins (millimeters):", 0x144, 10, 43,160, 45 LTEXT "&Left:", 0x145, 20, 55, 30, 10, WS_CHILD EDITTEXT IDC_PAGESETUP_LEFTVALUE, 50, 55, 35, 11, WS_CHILD | WS_BORDER | WS_TABSTOP LTEXT "&Top:", 0x148, 20, 73, 30, 10, WS_CHILD diff --git a/programs/taskmgr/procpage.c b/programs/taskmgr/procpage.c index 04921c0d9cc..3450f8344cf 100644 --- a/programs/taskmgr/procpage.c +++ b/programs/taskmgr/procpage.c @@ -461,9 +461,8 @@ ProcessPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) hProcessPageShowAllProcessesButton = GetDlgItem(hDlg, IDC_SHOWALLPROCESSES); /* - * Set the font, title, and extended window styles for the list control + * Set the title and extended window styles for the list control */ - SendMessage(hProcessPageListCtrl, WM_SETFONT, SendMessage(hProcessPage, WM_GETFONT, 0, 0), TRUE); SetWindowText(hProcessPageListCtrl, _T("Processes")); SendMessage(hProcessPageListCtrl, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, ListView_GetExtendedListViewStyle(hProcessPageListCtrl) | LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP); -- 2.11.4.GIT