diff --git a/base/applications/charmap/charmap.c b/base/applications/charmap/charmap.c index 4614bf9c644..6f91d5b4ef9 100644 --- a/base/applications/charmap/charmap.c +++ b/base/applications/charmap/charmap.c @@ -133,57 +133,96 @@ ChangeMapFont(HWND hDlg) } } +// Copy collected characters into the clipboard +static +void +CopyCharacters(HWND hDlg) +{ + HWND hText = GetDlgItem(hDlg, IDC_TEXTBOX); + DWORD dwStart, dwEnd; + // Acquire selection limits + SendMessage(hText, EM_GETSEL, (WPARAM)&dwStart, (LPARAM)&dwEnd); + + // Test if the whose text is unselected + if(dwStart == dwEnd) { + + // Select the whole text + SendMessageW(hText, EM_SETSEL, 0, -1); + + // Copy text + SendMessageW(hText, WM_COPY, 0, 0); + + // Restore previous values + SendMessageW(hText, EM_SETSEL, (WPARAM)dwStart, (LPARAM)dwEnd); + + } else { + + // Copy text + SendMessageW(hText, WM_COPY, 0, 0); + } +} + +// Recover charset for the given font +static +BYTE +GetFontMetrics(HWND hWnd, HFONT hFont) +{ + TEXTMETRIC tmFont; + HGDIOBJ hOldObj; + HDC hDC; + + hDC = GetDC(hWnd); + hOldObj = SelectObject(hDC, hFont); + GetTextMetrics(hDC, &tmFont); + SelectObject(hDC, hOldObj); + ReleaseDC(hWnd, hDC); + + return tmFont.tmCharSet; +} + +// Select a new character static VOID -AddCharToSelection(HWND hText, - WCHAR ch) +AddCharToSelection(HWND hDlg, WCHAR ch) { - LPWSTR lpText; - INT Len = GetWindowTextLength(hText); + HWND hMap = GetDlgItem(hDlg, IDC_FONTMAP); + HWND hText = GetDlgItem(hDlg, IDC_TEXTBOX); + HFONT hFont; + LOGFONT lFont; + CHARFORMAT cf; - if (Len != 0) + // Retrieve current character selected + if (ch == 0) { - lpText = HeapAlloc(GetProcessHeap(), - 0, - (Len + 2) * sizeof(WCHAR)); - - if (lpText) - { - LPWSTR lpStr = lpText; - - SendMessageW(hText, - WM_GETTEXT, - Len + 1, - (LPARAM)lpStr); - - lpStr += Len; - *lpStr = ch; - lpStr++; - *lpStr = L'\0'; - - SendMessageW(hText, - WM_SETTEXT, - 0, - (LPARAM)lpText); - - HeapFree(GetProcessHeap(), - 0, - lpText); - } + ch = (WCHAR) SendMessageW(hMap, FM_GETCHAR, 0, 0); + if (!ch) + return; } - else - { - WCHAR szText[2]; - szText[0] = ch; - szText[1] = L'\0'; + // Retrieve current selected font + hFont = (HFONT)SendMessage(hMap, FM_GETHFONT, 0, 0); - SendMessageW(hText, - WM_SETTEXT, - 0, - (LPARAM)szText); - } + // Recover LOGFONT structure from hFont + if (!GetObject(hFont, sizeof(LOGFONT), &lFont)) + return; + + // Recover font properties of Richedit control + ZeroMemory(&cf, sizeof(cf)); + cf.cbSize = sizeof(cf); + SendMessage(hText, EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf); + + // Apply properties of the new font + cf.bCharSet = GetFontMetrics(hText, hFont); + + // Update font name + wcscpy(cf.szFaceName, lFont.lfFaceName); + + // Update font properties + SendMessage(hText, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf); + + // Send selected character to Richedit + SendMessage(hText, WM_CHAR, (WPARAM)ch, 0); } @@ -204,6 +243,7 @@ DlgProc(HWND hDlg, case WM_INITDIALOG: { HMENU hSysMenu; + DWORD evMask; hSmIcon = LoadImageW(hInstance, MAKEINTRESOURCEW(IDI_ICON), @@ -256,6 +296,12 @@ DlgProc(HWND hDlg, lpAboutText); } } + + // Configure Richedi control for sending notification changes. + evMask = SendDlgItemMessage(hDlg, IDC_TEXTBOX, EM_GETEVENTMASK, 0, 0); + evMask |= ENM_CHANGE; + SendDlgItemMessage(hDlg, IDC_TEXTBOX, EM_SETEVENTMASK, 0, (LPARAM)evMask); + return TRUE; } @@ -264,41 +310,39 @@ DlgProc(HWND hDlg, switch(LOWORD(wParam)) { case IDC_FONTMAP: - { switch (HIWORD(wParam)) { case FM_SETCHAR: - AddCharToSelection(GetDlgItem(hDlg, IDC_TEXTBOX), - LOWORD(lParam)); + AddCharToSelection(hDlg, LOWORD(lParam)); break; } - } - break; + break; case IDC_FONTCOMBO: - { if (HIWORD(wParam) == CBN_SELCHANGE) { ChangeMapFont(hDlg); } - } - break; + break; case IDC_SELECT: - { - WCHAR ch; - HWND hMap = GetDlgItem(hDlg, IDC_FONTMAP); - - ch = (WCHAR) SendMessageW(hMap, FM_GETCHAR, 0, 0); - - if (ch) - { - AddCharToSelection(GetDlgItem(hDlg, IDC_TEXTBOX), - ch); - } - + AddCharToSelection(hDlg, 0); + break; + + case IDC_TEXTBOX: + switch (HIWORD(wParam)) { + case EN_CHANGE: + if (GetWindowTextLength(GetDlgItem(hDlg, IDC_TEXTBOX)) == 0) + EnableWindow(GetDlgItem(hDlg, IDC_COPY), FALSE); + else + EnableWindow(GetDlgItem(hDlg, IDC_COPY), TRUE); + break; + } + break; + + case IDC_COPY: + CopyCharacters(hDlg); break; - } case IDOK: if (hSmIcon) @@ -306,7 +350,7 @@ DlgProc(HWND hDlg, if (hBgIcon) DestroyIcon(hBgIcon); EndDialog(hDlg, 0); - break; + break; } } break; @@ -347,6 +391,7 @@ wWinMain(HINSTANCE hInst, { INITCOMMONCONTROLSEX iccx; INT Ret = 1; + HMODULE hRichEd20; hInstance = hInst; @@ -356,11 +401,17 @@ wWinMain(HINSTANCE hInst, if (RegisterMapClasses(hInstance)) { - Ret = DialogBoxW(hInstance, - MAKEINTRESOURCEW(IDD_CHARMAP), - NULL, - DlgProc) >= 0; + hRichEd20 = LoadLibraryW(L"RICHED20.DLL"); + if (hRichEd20 != NULL) + { + Ret = DialogBoxW(hInstance, + MAKEINTRESOURCEW(IDD_CHARMAP), + NULL, + DlgProc) >= 0; + + FreeLibrary(hRichEd20); + } UnregisterMapClasses(hInstance); } diff --git a/base/applications/charmap/charmap.rc b/base/applications/charmap/charmap.rc index 6c50cb661d5..ce6b398b5d7 100644 --- a/base/applications/charmap/charmap.rc +++ b/base/applications/charmap/charmap.rc @@ -1,5 +1,6 @@ #include #include +#include #include "resource.h" diff --git a/base/applications/charmap/lang/bg-BG.rc b/base/applications/charmap/lang/bg-BG.rc index 243a34b308b..a4c203b4e9f 100644 --- a/base/applications/charmap/lang/bg-BG.rc +++ b/base/applications/charmap/lang/bg-BG.rc @@ -10,7 +10,7 @@ BEGIN PUSHBUTTON "", IDC_CMHELP, 249, 5, 35, 13 CONTROL "", IDC_FONTMAP, "FontMapWnd", WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL, 20, 22, 266, 156 LTEXT " :", IDC_STATIC, 3, 188, 75, 9 - EDITTEXT IDC_TEXTBOX, 79, 186, 114, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP + CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "", IDC_COPY, 242, 186, 44, 13, WS_DISABLED //AUTOCHECKBOX "a ", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP diff --git a/base/applications/charmap/lang/ca-ES.rc b/base/applications/charmap/lang/ca-ES.rc index 170cef53200..102e1ceb4f7 100644 --- a/base/applications/charmap/lang/ca-ES.rc +++ b/base/applications/charmap/lang/ca-ES.rc @@ -10,7 +10,7 @@ BEGIN PUSHBUTTON "Ajuda", IDC_CMHELP, 249, 5, 35, 13 CONTROL "", IDC_FONTMAP, "FontMapWnd", WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL, 20, 22, 266, 156 LTEXT "Carcters a copiar :", IDC_STATIC, 6, 188, 66, 9 - EDITTEXT IDC_TEXTBOX, 74, 186, 114, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP + CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "Selecciona", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "Copia", IDC_COPY, 242, 186, 44, 13, WS_DISABLED //AUTOCHECKBOX "Vista avanada", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP diff --git a/base/applications/charmap/lang/cs-CZ.rc b/base/applications/charmap/lang/cs-CZ.rc index 2a917a2e2c2..a9d48a5ff64 100644 --- a/base/applications/charmap/lang/cs-CZ.rc +++ b/base/applications/charmap/lang/cs-CZ.rc @@ -15,7 +15,7 @@ BEGIN PUSHBUTTON "Npovda", IDC_CMHELP, 249, 5, 35, 13 CONTROL "", IDC_FONTMAP, "FontMapWnd", WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL, 20, 22, 266, 156 LTEXT "Znaky ke zkoprovn:", IDC_STATIC, 6, 188, 66, 9 - EDITTEXT IDC_TEXTBOX, 74, 186, 114, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP + CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "Oznait", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "Koprovat", IDC_COPY, 242, 186, 44, 13, WS_DISABLED //AUTOCHECKBOX "Pokroil zobrazen", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP diff --git a/base/applications/charmap/lang/de-DE.rc b/base/applications/charmap/lang/de-DE.rc index 9133cdb2c41..cecf8fe2621 100644 --- a/base/applications/charmap/lang/de-DE.rc +++ b/base/applications/charmap/lang/de-DE.rc @@ -10,7 +10,7 @@ BEGIN PUSHBUTTON "Hilfe", IDC_CMHELP, 249, 5, 35, 13 CONTROL "", IDC_FONTMAP, "FontMapWnd", WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL, 20, 22, 266, 156 LTEXT "Zeichenauswahl:", IDC_STATIC, 6, 188, 66, 9 - EDITTEXT IDC_TEXTBOX, 74, 186, 114, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP + CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "Auswhlen", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "Kopieren", IDC_COPY, 242, 186, 44, 13, WS_DISABLED //AUTOCHECKBOX "Erweiterte Ansicht", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP diff --git a/base/applications/charmap/lang/el-GR.rc b/base/applications/charmap/lang/el-GR.rc index 5d1be14b608..4ad6c2764cb 100644 --- a/base/applications/charmap/lang/el-GR.rc +++ b/base/applications/charmap/lang/el-GR.rc @@ -12,7 +12,7 @@ BEGIN CONTROL "",IDC_FONTMAP,"FontMapWnd",WS_VSCROLL | WS_TABSTOP,20, 22,266,156 LTEXT " :",IDC_STATIC,6,184,66,17 - EDITTEXT IDC_TEXTBOX,74,186,114,13 + CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "",IDC_SELECT,194,186,44,13 PUSHBUTTON "",IDC_COPY,242,186,44,13,WS_DISABLED END diff --git a/base/applications/charmap/lang/en-US.rc b/base/applications/charmap/lang/en-US.rc index a3390d7d68e..9cf7dfc5347 100644 --- a/base/applications/charmap/lang/en-US.rc +++ b/base/applications/charmap/lang/en-US.rc @@ -10,7 +10,7 @@ BEGIN PUSHBUTTON "Help", IDC_CMHELP, 249, 5, 35, 13 CONTROL "", IDC_FONTMAP, "FontMapWnd", WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL, 20, 22, 266, 156 LTEXT "Characters to copy:", IDC_STATIC, 6, 188, 66, 9 - EDITTEXT IDC_TEXTBOX, 74, 186, 114, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP + CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "Select", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "Copy", IDC_COPY, 242, 186, 44, 13, WS_DISABLED //AUTOCHECKBOX "Advanced view", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP diff --git a/base/applications/charmap/lang/es-ES.rc b/base/applications/charmap/lang/es-ES.rc index 1e0735b0335..ada78f80c69 100644 --- a/base/applications/charmap/lang/es-ES.rc +++ b/base/applications/charmap/lang/es-ES.rc @@ -10,7 +10,7 @@ BEGIN PUSHBUTTON "Ayuda", IDC_CMHELP, 249, 5, 35, 13 CONTROL "", IDC_FONTMAP, "FontMapWnd", WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL, 20, 22, 266, 156 LTEXT "Caracteres a copiar :", IDC_STATIC, 6, 188, 66, 9 - EDITTEXT IDC_TEXTBOX, 74, 186, 114, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP + CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "Seleccionar", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "Copiar", IDC_COPY, 242, 186, 44, 13, WS_DISABLED //AUTOCHECKBOX "Vista Avanzada", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP diff --git a/base/applications/charmap/lang/fr-FR.rc b/base/applications/charmap/lang/fr-FR.rc index dc49060ae38..9a2a206726e 100644 --- a/base/applications/charmap/lang/fr-FR.rc +++ b/base/applications/charmap/lang/fr-FR.rc @@ -10,7 +10,7 @@ BEGIN PUSHBUTTON "Aide", IDC_CMHELP, 249, 5, 35, 13 CONTROL "", IDC_FONTMAP, "FontMapWnd", WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL, 20, 22, 266, 156 LTEXT "Caractres copier :", IDC_STATIC, 6, 188, 66, 9 - EDITTEXT IDC_TEXTBOX, 74, 186, 114, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP + CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "Slectionner", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "Copier", IDC_COPY, 242, 186, 44, 13, WS_DISABLED //AUTOCHECKBOX "Vue avance", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP diff --git a/base/applications/charmap/lang/id-ID.rc b/base/applications/charmap/lang/id-ID.rc index e003f2c1268..790bf651bef 100644 --- a/base/applications/charmap/lang/id-ID.rc +++ b/base/applications/charmap/lang/id-ID.rc @@ -10,7 +10,7 @@ BEGIN PUSHBUTTON "Bantuan", IDC_CMHELP, 249, 5, 35, 13 CONTROL "", IDC_FONTMAP, "FontMapWnd", WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL, 20, 22, 266, 156 LTEXT "Karakter untuk di-copy :", IDC_STATIC, 6, 188, 66, 9 - EDITTEXT IDC_TEXTBOX, 74, 186, 114, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP + CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "Pilih", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "Copy", IDC_COPY, 242, 186, 44, 13, WS_DISABLED //AUTOCHECKBOX "Advanced view", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP diff --git a/base/applications/charmap/lang/it-IT.rc b/base/applications/charmap/lang/it-IT.rc index 2ca73a7b4a1..f7f44bb2453 100644 --- a/base/applications/charmap/lang/it-IT.rc +++ b/base/applications/charmap/lang/it-IT.rc @@ -10,7 +10,7 @@ BEGIN PUSHBUTTON "Aiuto", IDC_CMHELP, 249, 5, 35, 13 CONTROL "", IDC_FONTMAP, "FontMapWnd", WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL, 20, 22, 266, 156 LTEXT "Caratteri da copiare :", IDC_STATIC, 6, 188, 66, 9 - EDITTEXT IDC_TEXTBOX, 74, 186, 114, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP + CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "Selezionare", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "Copiare", IDC_COPY, 242, 186, 44, 13, WS_DISABLED //AUTOCHECKBOX "Visualizzazione avanzata", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP diff --git a/base/applications/charmap/lang/ja-JP.rc b/base/applications/charmap/lang/ja-JP.rc index 17c649a23a0..e5e426d2674 100644 --- a/base/applications/charmap/lang/ja-JP.rc +++ b/base/applications/charmap/lang/ja-JP.rc @@ -10,7 +10,7 @@ BEGIN PUSHBUTTON "wv", IDC_CMHELP, 249, 5, 35, 13 CONTROL "", IDC_FONTMAP, "FontMapWnd", WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL, 20, 22, 266, 156 LTEXT "Rs[镶:", IDC_STATIC, 6, 188, 66, 9 - EDITTEXT IDC_TEXTBOX, 74, 186, 114, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP + CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "I", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "Rs[", IDC_COPY, 242, 186, 44, 13, WS_DISABLED //AUTOCHECKBOX "ڍו\\", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP diff --git a/base/applications/charmap/lang/ko-KR.rc b/base/applications/charmap/lang/ko-KR.rc index 7dea59944a3..b700764d09a 100644 --- a/base/applications/charmap/lang/ko-KR.rc +++ b/base/applications/charmap/lang/ko-KR.rc @@ -13,7 +13,7 @@ BEGIN PUSHBUTTON "", IDC_CMHELP, 249, 5, 35, 13 CONTROL "", IDC_FONTMAP, "FontMapWnd", WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL, 20, 22, 266, 156 LTEXT " :", IDC_STATIC, 6, 188, 66, 9 - EDITTEXT IDC_TEXTBOX, 74, 186, 114, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP + CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "", IDC_COPY, 242, 186, 44, 13, WS_DISABLED //AUTOCHECKBOX "Ȯ ", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP diff --git a/base/applications/charmap/lang/lt-LT.rc b/base/applications/charmap/lang/lt-LT.rc index 9101081416f..9fec37413ed 100644 --- a/base/applications/charmap/lang/lt-LT.rc +++ b/base/applications/charmap/lang/lt-LT.rc @@ -19,7 +19,7 @@ BEGIN PUSHBUTTON "Pagalba", IDC_CMHELP, 249, 5, 35, 13 CONTROL "", IDC_FONTMAP, "FontMapWnd", WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL, 20, 22, 266, 156 LTEXT "Simboliai kopijavimui:", IDC_STATIC, 6, 188, 72, 9 - EDITTEXT IDC_TEXTBOX, 81, 186, 107, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP + CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "Parinkti", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "Kopijuoti", IDC_COPY, 242, 186, 44, 13, WS_DISABLED //AUTOCHECKBOX "Advanced view", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP diff --git a/base/applications/charmap/lang/nl-NL.rc b/base/applications/charmap/lang/nl-NL.rc index a3a72ab3320..6389f34f2d0 100644 --- a/base/applications/charmap/lang/nl-NL.rc +++ b/base/applications/charmap/lang/nl-NL.rc @@ -10,7 +10,7 @@ BEGIN PUSHBUTTON "Help", IDC_CMHELP, 249, 5, 35, 13 CONTROL "", IDC_FONTMAP, "FontMapWnd", WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL, 20, 22, 266, 156 LTEXT "Te kopiren tekens:", IDC_STATIC, 6, 188, 66, 9 - EDITTEXT IDC_TEXTBOX, 74, 186, 114, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP + CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "Selecteren", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "Kopiren", IDC_COPY, 242, 186, 44, 13, WS_DISABLED //AUTOCHECKBOX "Geavanceerde weergave", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP diff --git a/base/applications/charmap/lang/no-NO.rc b/base/applications/charmap/lang/no-NO.rc index a37305737ad..8fd7c204e0b 100644 --- a/base/applications/charmap/lang/no-NO.rc +++ b/base/applications/charmap/lang/no-NO.rc @@ -10,7 +10,7 @@ BEGIN PUSHBUTTON "Hjelp", IDC_CMHELP, 249, 5, 35, 13 CONTROL "", IDC_FONTMAP, "FontMapWnd", WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL, 20, 22, 266, 156 LTEXT "Kopier flgende tegn:", IDC_STATIC, 6, 188, 66, 9 - EDITTEXT IDC_TEXTBOX, 74, 186, 114, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP + CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "Velg", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "Kopier", IDC_COPY, 242, 186, 44, 13, WS_DISABLED //AUTOCHECKBOX "Avansert visning", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP diff --git a/base/applications/charmap/lang/pl-PL.rc b/base/applications/charmap/lang/pl-PL.rc index 8b636ecadec..75dce3c7064 100644 --- a/base/applications/charmap/lang/pl-PL.rc +++ b/base/applications/charmap/lang/pl-PL.rc @@ -16,7 +16,7 @@ BEGIN PUSHBUTTON "Pomo&c", IDC_CMHELP, 249, 5, 35, 13 CONTROL "", IDC_FONTMAP, "FontMapWnd", WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL, 20, 22, 266, 156 LTEXT "&Znaki do skopiowania:", IDC_STATIC, 6, 188, 66, 9 - EDITTEXT IDC_TEXTBOX, 74, 186, 114, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP + CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "Wy&bierz", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "&Kopiuj", IDC_COPY, 242, 186, 44, 13, WS_DISABLED //AUTOCHECKBOX "Widok z&aawansowany", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP diff --git a/base/applications/charmap/lang/pt-BR.rc b/base/applications/charmap/lang/pt-BR.rc index a9706cace16..6a86e180307 100644 --- a/base/applications/charmap/lang/pt-BR.rc +++ b/base/applications/charmap/lang/pt-BR.rc @@ -10,7 +10,7 @@ BEGIN PUSHBUTTON "Aj&uda", IDC_CMHELP, 249, 5, 35, 13 CONTROL "", IDC_FONTMAP, "FontMapWnd", WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL, 20, 22, 266, 156 LTEXT "Caracteres a serem copiados :", IDC_STATIC, 6, 183, 66, 17 - EDITTEXT IDC_TEXTBOX, 74, 186, 114, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP + CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "Selecionar", IDC_SELECT, 194, 186, 46, 13 PUSHBUTTON "Copiar", IDC_COPY, 244, 186, 46, 13, WS_DISABLED //AUTOCHECKBOX "Modo de exibio avanado", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP diff --git a/base/applications/charmap/lang/ru-RU.rc b/base/applications/charmap/lang/ru-RU.rc index 79941fe6796..1a6bc939526 100644 --- a/base/applications/charmap/lang/ru-RU.rc +++ b/base/applications/charmap/lang/ru-RU.rc @@ -12,7 +12,7 @@ BEGIN PUSHBUTTON "", IDC_CMHELP, 249, 5, 35, 13 CONTROL "", IDC_FONTMAP, "FontMapWnd", WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL, 20, 22, 266, 156 LTEXT " :", IDC_STATIC, 6, 188, 95, 9 - EDITTEXT IDC_TEXTBOX, 80, 186, 109, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP + CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "", IDC_COPY, 242, 186, 44, 13, WS_DISABLED //AUTOCHECKBOX "Advanced view", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP diff --git a/base/applications/charmap/lang/sk-SK.rc b/base/applications/charmap/lang/sk-SK.rc index 628801f1a92..7ab74b1715e 100644 --- a/base/applications/charmap/lang/sk-SK.rc +++ b/base/applications/charmap/lang/sk-SK.rc @@ -19,7 +19,7 @@ BEGIN PUSHBUTTON "&Pomocnk", IDC_CMHELP, 249, 5, 35, 13 CONTROL "", IDC_FONTMAP, "FontMapWnd", WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL, 20, 22, 266, 156 LTEXT "Koprova &znaky:", IDC_STATIC, 6, 188, 66, 9 - EDITTEXT IDC_TEXTBOX, 74, 186, 114, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP + CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "&Vybra", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "&Koprova", IDC_COPY, 242, 186, 44, 13, WS_DISABLED //AUTOCHECKBOX "R&ozren zobrazenie", IDC_ADVVIEW, 10, 204, 75, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP diff --git a/base/applications/charmap/lang/uk-UA.rc b/base/applications/charmap/lang/uk-UA.rc index 3c82d762f3f..cabd820e41d 100644 --- a/base/applications/charmap/lang/uk-UA.rc +++ b/base/applications/charmap/lang/uk-UA.rc @@ -18,7 +18,7 @@ BEGIN PUSHBUTTON "", IDC_CMHELP, 249, 5, 35, 13 CONTROL "", IDC_FONTMAP, "FontMapWnd", WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL, 20, 22, 266, 156 LTEXT " :", IDC_STATIC, 6, 188, 66, 9 - EDITTEXT IDC_TEXTBOX, 74, 186, 114, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP + CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "", IDC_COPY, 242, 186, 44, 13, WS_DISABLED //AUTOCHECKBOX " ", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP diff --git a/base/applications/charmap/lang/zh-CN.rc b/base/applications/charmap/lang/zh-CN.rc index 9b8187200ec..7fdfffd1a1f 100644 --- a/base/applications/charmap/lang/zh-CN.rc +++ b/base/applications/charmap/lang/zh-CN.rc @@ -12,7 +12,7 @@ BEGIN PUSHBUTTON "˵", IDC_CMHELP, 249, 5, 35, 13 CONTROL "", IDC_FONTMAP, "FontMapWnd", WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL, 20, 22, 266, 156 LTEXT "Ƶַ:", IDC_STATIC, 6, 188, 66, 9 - EDITTEXT IDC_TEXTBOX, 74, 186, 114, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP + CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "ѡ", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "", IDC_COPY, 242, 186, 44, 13, WS_DISABLED //AUTOCHECKBOX "Advanced view", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP diff --git a/base/applications/charmap/lang/zh-TW.rc b/base/applications/charmap/lang/zh-TW.rc index 4cb9841adf5..ba36b67fb70 100644 --- a/base/applications/charmap/lang/zh-TW.rc +++ b/base/applications/charmap/lang/zh-TW.rc @@ -12,7 +12,7 @@ BEGIN PUSHBUTTON "", IDC_CMHELP, 249, 5, 35, 13 CONTROL "", IDC_FONTMAP, "FontMapWnd", WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL, 20, 22, 266, 156 LTEXT "ݽƻsršG", IDC_STATIC, 6, 188, 66, 9 - EDITTEXT IDC_TEXTBOX, 74, 186, 114, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP + CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "ƻs", IDC_COPY, 242, 186, 44, 13, WS_DISABLED //AUTOCHECKBOX "Advanced view", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP diff --git a/base/applications/charmap/map.c b/base/applications/charmap/map.c index b9e37cf5a4d..8cbda5af59f 100644 --- a/base/applications/charmap/map.c +++ b/base/applications/charmap/map.c @@ -529,6 +529,9 @@ MapWndProc(HWND hwnd, return infoPtr->pActiveCell->ch; } + case FM_GETHFONT: + return (LRESULT)infoPtr->hFont; + case WM_PAINT: { OnPaint(infoPtr, diff --git a/base/applications/charmap/precomp.h b/base/applications/charmap/precomp.h index 4e0324c3de5..597d9f20967 100644 --- a/base/applications/charmap/precomp.h +++ b/base/applications/charmap/precomp.h @@ -5,6 +5,7 @@ #include #include #include +#include #include "resource.h" #define XCELLS 20 @@ -12,9 +13,10 @@ #define XLARGE 45 #define YLARGE 25 -#define FM_SETFONT (WM_USER + 1) -#define FM_GETCHAR (WM_USER + 2) -#define FM_SETCHAR (WM_USER + 3) +#define FM_SETFONT (WM_USER + 1) +#define FM_GETCHAR (WM_USER + 2) +#define FM_SETCHAR (WM_USER + 3) +#define FM_GETHFONT (WM_USER + 4) extern HINSTANCE hInstance; diff --git a/base/applications/cmdutils/xcopy/Es.rc b/base/applications/cmdutils/xcopy/Es.rc new file mode 100644 index 00000000000..67c9eb8ba04 --- /dev/null +++ b/base/applications/cmdutils/xcopy/Es.rc @@ -0,0 +1,80 @@ +/* + * XCOPY - Wine-compatible xcopy program + * Spanish language support + * + * Copyright (C) 2007 Jeisson T. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "xcopy.h" + +LANGUAGE LANG_SPANISH, SUBLANG_DEFAULT + +STRINGTABLE +{ + STRING_INVPARMS, "Cantidad invalido de parametros - Use xcopy /? para obtener ayuda\n" + STRING_INVPARM, "Parametro invalido '%s' - Use xcopy /? para obtener ayuda\n" + STRING_PAUSE, "Unde para iniciar la copia\n" + STRING_SIMCOPY, "%d archivo(s) seran copiado(s)\n" + STRING_COPY, "%d archivo(s) copiado(s)\n" + STRING_QISDIR, "Es '%s' un nombre de archivo o de directorio\n\ + en el punto de destino?\n\ + (F - Archivo, D - Directorio)\n" + STRING_SRCPROMPT,"%s? (Si|No)\n" + STRING_OVERWRITE,"Destruir y escribir encima %s? (Si|No|Todo)\n" + STRING_COPYFAIL, "La copia de '%s' a '%s' ha faillecido con r/c %d\n" + STRING_OPENFAIL, "Impossible de abrir '%s'\n" + STRING_READFAIL, "Hubo un error durante la lectura de '%s'\n" + STRING_YES_CHAR, "S" + STRING_NO_CHAR, "N" + STRING_ALL_CHAR, "T" + STRING_FILE_CHAR,"A" + STRING_DIR_CHAR, "D" + + STRING_HELP, +"XCOPY - Copia los archivos o directorios fuentes a un destino\n\ +\n\ +Sintaxis:\n\ +XCOPY fuente [dest] [/I] [/S] [/Q] [/F] [/L] [/W] [/T] [/N] [/U]\n\ +\t [/R] [/H] [/C] [/P] [/A] [/M] [/E] [/D] [/Y] [/-Y]\n\ +\n\ +En la cual:\n\ +\n\ +[/I] Asuma el directorio si el destino no existe y copia dos o\n\ +\tmas archivos\n\ +[/S] Copia directorios y subdirectorios\n\ +[/E] Copia directorios y subdirectorios, incluyendo las que estan vacias\n\ +[/Q] No mostrar la lista de los nombres de los archivos durante la copia (silencioso)\n\ +[/F] Mostrar todas las fuentes y todos los destinos durante la copia.\n\ +[/L] Simular la operacion, mostrando los nombres de archivos que seran copiados\n\ +[/W] Preguntar antes de iniciar la operacion de copia\n\ +[/T] Crear una estructura de repertorios vacios pero no copia los archivos\n\ +[/Y] No pide confirmacion cuando sobreescribe sobre los archivos\n\ +[/-Y] Pide confirmacion cuando sobreescribe los archivos\n\ +[/P] Pregunta al usuario ante de copiar cada archivo fuente\n\ +[/N] Copiar usando los nombres cortos\n\ +[/U] Copia solamente los archivos que ya existent en el punto de destino\n\ +[/R] Sobreescribir los archivos en lectura unica\n\ +[/H] Incluir los archivos escondidos y los del systema en la copia\n\ +[/C] Siempre continuar mismo si un error occure en la copia\n\ +[/A] Copia solamente archivos con el attributo de archivo definido\n\ +[/M] Copia solamente archivos con el attributo de archivo definido, supprime\n\ +\tl'attributo de archivo\n\ +[/D | /D:m-d-y] Copia los nuevos archivos or los que fueront modificado despues la fecha especificada.\n\ +\t\tSi la fecha no esta especificada, copia unicamente cuando el archivo de destino est mas viejo\n\ +\t\tque el archivo fuente\n\n" + +} diff --git a/base/applications/cmdutils/xcopy/rsrc.rc b/base/applications/cmdutils/xcopy/rsrc.rc index ec82d6116f6..38e169fd31f 100644 --- a/base/applications/cmdutils/xcopy/rsrc.rc +++ b/base/applications/cmdutils/xcopy/rsrc.rc @@ -30,6 +30,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL #include "En.rc" #include "No.rc" #include "Pl.rc" +#include "Es.rc" /* UTF-8 */ #include "De.rc" diff --git a/base/applications/dxdiag/precomp.h b/base/applications/dxdiag/precomp.h index b049f77702c..05200f7b2d5 100644 --- a/base/applications/dxdiag/precomp.h +++ b/base/applications/dxdiag/precomp.h @@ -43,10 +43,10 @@ INT_PTR CALLBACK NetworkPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPAR INT_PTR CALLBACK HelpPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); /* DirectDraw tests */ -VOID DDTests(); +VOID DDTests(VOID); /* Direct3D tests */ -VOID D3DTests(); +VOID D3DTests(VOID); /* DirectSound initialization */ void InitializeDirectSoundPage(PDXDIAG_CONTEXT pContext); diff --git a/base/applications/games/solitaire/solitaire.h b/base/applications/games/solitaire/solitaire.h index 3b1e1bbe1e8..ae52831b073 100644 --- a/base/applications/games/solitaire/solitaire.h +++ b/base/applications/games/solitaire/solitaire.h @@ -16,7 +16,7 @@ extern bool fGameStarted; extern DWORD dwOptions; -void CreateSol(); +void CreateSol(void); void NewGame(void); #define NUM_ROW_STACKS 7 diff --git a/base/applications/games/spider/spider.h b/base/applications/games/spider/spider.h index caff04abead..17b919b91aa 100644 --- a/base/applications/games/spider/spider.h +++ b/base/applications/games/spider/spider.h @@ -25,7 +25,7 @@ extern DWORD dwDifficulty; extern TCHAR MsgDeal[]; extern TCHAR MsgWin[]; -void CreateSpider(); +void CreateSpider(void); void NewGame(void); bool CARDLIBPROC RowStackDragProc(CardRegion &stackobj, int iNumCards); diff --git a/base/applications/magnify/magnifier.h b/base/applications/magnify/magnifier.h index 18b9f84cf71..8728c02fb88 100644 --- a/base/applications/magnify/magnifier.h +++ b/base/applications/magnify/magnifier.h @@ -32,5 +32,5 @@ extern BOOL bInvertColors; extern BOOL bStartMinimized; extern BOOL bShowMagnifier; -void LoadSettings(); -void SaveSettings(); +void LoadSettings(void); +void SaveSettings(void); diff --git a/base/applications/mplay32/mplay32.c b/base/applications/mplay32/mplay32.c index f4bd117a65f..3e0cca4c93b 100644 --- a/base/applications/mplay32/mplay32.c +++ b/base/applications/mplay32/mplay32.c @@ -455,7 +455,7 @@ PlayFile(HWND hwnd, LPTSTR lpFileName) mciPlay.dwFrom = 0; mciPlay.dwTo = MaxFilePos; - mciError = mciSendCommand(wDeviceId, MCI_PLAY, MCI_NOTIFY | MCI_FROM | MCI_TO, (DWORD_PTR)&mciPlay); + mciError = mciSendCommand(wDeviceId, MCI_PLAY, MCI_NOTIFY | MCI_FROM /*| MCI_TO*/, (DWORD_PTR)&mciPlay); if (mciError != 0) { MessageBox(hwnd, _T("Can't play!"), NULL, MB_OK); diff --git a/base/applications/mscutils/eventvwr/eventvwr.c b/base/applications/mscutils/eventvwr/eventvwr.c index 69086b132a9..6a116ac3d00 100644 --- a/base/applications/mscutils/eventvwr/eventvwr.c +++ b/base/applications/mscutils/eventvwr/eventvwr.c @@ -203,7 +203,7 @@ GetEventMessageFileDLL(IN LPCWSTR lpLogName, /* Returns a string containing the requested substituted environment variable. */ ExpandEnvironmentStringsW((LPCWSTR)szModuleName, ExpandedName, MAX_PATH); - /* Succesfull */ + /* Successful */ bReturn = TRUE; } } @@ -503,11 +503,12 @@ QueryEventMessages(LPWSTR lpMachineName, HWND hwndDlg; HANDLE hEventLog; EVENTLOGRECORD *pevlr; - DWORD dwRead, dwNeeded, dwThisRecord, dwTotalRecords = 0, dwCurrentRecord = 1, dwRecordsToRead = 0, dwFlags; + DWORD dwRead, dwNeeded, dwThisRecord, dwTotalRecords = 0, dwCurrentRecord = 1, dwRecordsToRead = 0, dwFlags, dwMaxLength; LPWSTR lpSourceName; LPWSTR lpComputerName; - LPWSTR lpData; + LPSTR lpData; BOOL bResult = TRUE; /* Read succeeded. */ + int i; WCHAR szWindowTitle[MAX_PATH]; WCHAR szStatusText[MAX_PATH]; @@ -519,6 +520,7 @@ QueryEventMessages(LPWSTR lpMachineName, WCHAR szUsername[MAX_PATH]; WCHAR szEventText[EVENT_MESSAGE_FILE_BUFFER]; WCHAR szCategory[MAX_PATH]; + WCHAR szData[MAX_PATH]; SYSTEMTIME time; LVITEMW lviEventItem; @@ -606,7 +608,7 @@ QueryEventMessages(LPWSTR lpMachineName, lpComputerName = (LPWSTR)((LPBYTE)pevlr + sizeof(EVENTLOGRECORD) + (wcslen(lpSourceName) + 1) * sizeof(WCHAR)); // This ist the data section of the current event - lpData = (LPWSTR)((LPBYTE)pevlr + pevlr->DataOffset); + lpData = (LPSTR)((LPBYTE)pevlr + pevlr->DataOffset); // Compute the event type EventTimeToSystemTime(pevlr->TimeWritten, &time); @@ -665,7 +667,13 @@ QueryEventMessages(LPWSTR lpMachineName, ListView_SetItemText(hwndListView, lviEventItem.iItem, 5, szEventID); ListView_SetItemText(hwndListView, lviEventItem.iItem, 6, szUsername); //User ListView_SetItemText(hwndListView, lviEventItem.iItem, 7, lpComputerName); //Computer - ListView_SetItemText(hwndListView, lviEventItem.iItem, 8, lpData); //Event Text + MultiByteToWideChar(CP_ACP, + 0, + lpData, + pevlr->DataLength, + szData, + MAX_PATH); + ListView_SetItemText(hwndListView, lviEventItem.iItem, 8, szData); //Event Text dwRead -= pevlr->Length; pevlr = (EVENTLOGRECORD *)((LPBYTE) pevlr + pevlr->Length); @@ -678,7 +686,15 @@ QueryEventMessages(LPWSTR lpMachineName, // All events loaded EndDialog(hwndDlg, 0); - swprintf(szWindowTitle, L"%s - %s Log on \\\\%s", szTitle, lpLogName, lpComputerName); + + i = swprintf(szWindowTitle, L"%s - %s Log on \\\\", szTitle, lpLogName); /* i = number of characters written */ + /* lpComputerName can be NULL here if no records was read */ + dwMaxLength = sizeof(szWindowTitle)/sizeof(WCHAR)-i; + if(!lpComputerName) + GetComputerNameW(szWindowTitle+i, &dwMaxLength); + else + _snwprintf(szWindowTitle+i, dwMaxLength, L"%s", lpComputerName); + swprintf(szStatusText, L"%s has %d event(s)", lpLogName, dwTotalRecords); // Update the status bar diff --git a/base/applications/network/ftp/cmds.c b/base/applications/network/ftp/cmds.c index 977b847621f..91b3bc48d5e 100644 --- a/base/applications/network/ftp/cmds.c +++ b/base/applications/network/ftp/cmds.c @@ -47,14 +47,15 @@ static char sccsid[] = "@(#)cmds.c 5.18 (Berkeley) 4/20/89"; extern char *globerr; extern char home[]; -extern char *remglob(); +static const char *remglob(const char *argv[], int doswitch); extern int allbinary; extern off_t restart_point; extern char reply_string[]; const char *mname; jmp_buf jabort; -const char *dotrans(), *domap(); +const char *dotrans(const char *name); +const char *domap(const char *name); extern short portnum; extern char *hostname; @@ -169,8 +170,7 @@ struct types { /* * Set transfer type. */ -void settype(argc, argv) - const char *argv[]; +void settype(int argc, const char *argv[]) { register struct types *p; int comret; @@ -225,7 +225,7 @@ const char *stype[] = { * Set binary transfer type. */ /*VARARGS*/ -void setbinary() +void setbinary(int argc, const char *argv[]) { stype[1] = "binary"; settype(2, stype); @@ -235,7 +235,7 @@ void setbinary() * Set ascii transfer type. */ /*VARARGS*/ -void setascii() +void setascii(int argc, const char *argv[]) { stype[1] = "ascii"; settype(2, stype); @@ -245,7 +245,7 @@ void setascii() * Set tenex transfer type. */ /*VARARGS*/ -void settenex() +void settenex(int argc, const char *argv[]) { stype[1] = "tenex"; settype(2, stype); @@ -266,8 +266,7 @@ void setebcdic() */ /*ARGSUSED*/ -void fsetmode(argc, argv) - char *argv[]; +void fsetmode(int argc, const char *argv[]) { printf("We only support %s mode, sorry.\n", modename); @@ -280,8 +279,7 @@ void fsetmode(argc, argv) * Set file transfer format. */ /*ARGSUSED*/ -void setform(argc, argv) - char *argv[]; +void setform(int argc, const char *argv[]) { printf("We only support %s format, sorry.\n", formname); @@ -293,8 +291,7 @@ void setform(argc, argv) * Set file transfer structure. */ /*ARGSUSED*/ -void setstruct(argc, argv) - char *argv[]; +void setstruct(int argc, const char *argv[]) { printf("We only support %s structure, sorry.\n", structname); @@ -305,9 +302,7 @@ void setstruct(argc, argv) /* * Send a single file. */ -void put(argc, argv) - int argc; - const char *argv[]; +void put(int argc, const char *argv[]) { const char *cmd; int loc = 0; @@ -372,8 +367,7 @@ usage: /* * Send multiple files. */ -void mput(argc, argv) - const char *argv[]; +void mput(int argc, const char *argv[]) { register int i; int ointer; @@ -400,7 +394,8 @@ void mput(argc, argv) // oldintr = signal(SIGINT, mabort); (void) setjmp(jabort); if (proxy) { - char *cp, *tp2, tmpbuf[MAXPATHLEN]; + const char *cp; + char *tp2, tmpbuf[MAXPATHLEN]; while ((cp = remglob(argv,0)) != NULL) { if (*cp == 0) { @@ -503,14 +498,12 @@ void mput(argc, argv) mflag = 0; } -void reget(argc, argv) - const char *argv[]; +void reget(int argc, const char *argv[]) { (void) getit(argc, argv, 1, "r+w"); } -void get(argc, argv) - const char *argv[]; +void get(int argc, const char *argv[]) { (void) getit(argc, argv, 0, restart_point ? "r+w" : "w" ); } @@ -518,9 +511,7 @@ void get(argc, argv) /* * Receive one file. */ -int getit(argc, argv, restartit, mode) - const char *argv[]; - const char *mode; +int getit(int argc, const char *argv[], int restartit, const char *mode) { int loc = 0; const char *oldargv1, *oldargv2; @@ -674,8 +665,7 @@ mabort() /* * Get multiple files. */ -void mget(argc, argv) - const char *argv[]; +void mget(int argc, const char *argv[]) { const char *cp, *tp; char *tp2, tmpbuf[MAXPATHLEN]; @@ -747,18 +737,17 @@ void mget(argc, argv) mflag = 0; } -char * -remglob(argv,doswitch) - char *argv[]; - int doswitch; +const char * +remglob(const char *argv[], int doswitch) { char temp[16]; static char buf[MAXPATHLEN]; static FILE *ftemp = NULL; - static char **args; + static const char **args; int oldverbose, oldhash; - char *cp; + const char *cp; const char *mode; + char *terminator; if (!mflag) { if (!doglob) { @@ -805,16 +794,14 @@ remglob(argv,doswitch) (void) fclose(ftemp), ftemp = NULL; return (NULL); } - if ((cp = index(buf, '\n')) != NULL) - *cp = '\0'; + if ((terminator = index(buf, '\n')) != NULL) + *terminator = '\0'; return (buf); } static const char * -onoff(bool) - int bool; +onoff(int bool) { - return (bool ? "on" : "off"); } @@ -822,8 +809,7 @@ onoff(bool) * Show status. */ /*ARGSUSED*/ -void status(argc, argv) - char *argv[]; +void status(int argc, const char *argv[]) { int i; @@ -877,7 +863,7 @@ void status(argc, argv) * Set beep on cmd completed mode. */ /*VARARGS*/ -void setbell() +void setbell(int argc, const char *argv[]) { bell = !bell; @@ -890,7 +876,7 @@ void setbell() * Turn on packet tracing. */ /*VARARGS*/ -void settrace() +void settrace(int argc, const char *argv[]) { trace = !trace; @@ -903,7 +889,7 @@ void settrace() * Toggle hash mark printing during transfers. */ /*VARARGS*/ -void sethash() +void sethash(int argc, const char *argv[]) { hash = !hash; @@ -919,7 +905,7 @@ void sethash() * Turn on printing of server echo's. */ /*VARARGS*/ -void setverbose() +void setverbose(int argc, const char *argv[]) { verbose = !verbose; @@ -932,7 +918,7 @@ void setverbose() * Toggle PORT cmd use before each data connection. */ /*VARARGS*/ -void setport() +void setport(int argc, const char *argv[]) { sendport = !sendport; @@ -946,7 +932,7 @@ void setport() * during mget, mput, and mdelete. */ /*VARARGS*/ -void setprompt() +void setprompt(int argc, const char *argv[]) { interactive = !interactive; @@ -960,7 +946,7 @@ void setprompt() * on local file names. */ /*VARARGS*/ -void setglob() +void setglob(int argc, const char *argv[]) { doglob = !doglob; @@ -974,8 +960,7 @@ void setglob() * set level of debugging. */ /*VARARGS*/ -void setdebug(argc, argv) - char *argv[]; +void setdebug(int argc, const char *argv[]) { int val; @@ -1003,8 +988,7 @@ void setdebug(argc, argv) * Set current working directory * on remote machine. */ -void cd(argc, argv) - const char *argv[]; +void cd(int argc, const char *argv[]) { if (argc < 2) { @@ -1035,8 +1019,7 @@ void cd(argc, argv) * Set current working directory * on local machine. */ -void lcd(argc, argv) - const char *argv[]; +void lcd(int argc, const char *argv[]) { char buf[MAXPATHLEN]; @@ -1065,8 +1048,7 @@ void lcd(argc, argv) /* * Delete a single file. */ -void delete(argc, argv) - const char *argv[]; +void delete(int argc, const char *argv[]) { if (argc < 2) { @@ -1090,10 +1072,9 @@ void delete(argc, argv) /* * Delete multiple files. */ -void mdelete(argc, argv) - const char *argv[]; +void mdelete(int argc, const char *argv[]) { - char *cp; + const char *cp; int ointer; extern jmp_buf jabort; @@ -1140,8 +1121,7 @@ void mdelete(argc, argv) /* * Rename a remote file. */ -void renamefile(argc, argv) - const char *argv[]; +void renamefile(int argc, const char *argv[]) { if (argc < 2) { @@ -1179,8 +1159,7 @@ usage: * Get a directory listing * of remote files. */ -void ls(argc, argv) - const char *argv[]; +void ls(int argc, const char *argv[]) { const char *cmd; @@ -1212,8 +1191,7 @@ void ls(argc, argv) * Get a directory listing * of multiple remote files. */ -void mls(argc, argv) - const char *argv[]; +void mls(int argc, const char *argv[]) { const char *cmd, *dest; char mode[1]; @@ -1276,8 +1254,7 @@ void mls(argc, argv) * Do a shell escape */ /*ARGSUSED*/ -void shell(argc, argv) - char *argv[]; +void shell(int argc, const char *argv[]) { #if 0 int pid; @@ -1396,9 +1373,7 @@ void shell(argc, argv) /* * Send new user information (re-login) */ -void user(argc, argv) - int argc; - const char **argv; +void user(int argc, const char *argv[]) { char acct[80], *getpass(); int n, aflag = 0; @@ -1449,7 +1424,7 @@ void user(argc, argv) * Print working directory. */ /*VARARGS*/ -void pwd() +void pwd(int argc, const char *argv[]) { int oldverbose = verbose; @@ -1468,8 +1443,7 @@ void pwd() /* * Make a directory. */ -void makedir(argc, argv) - const char *argv[]; +void makedir(int argc, const char *argv[]) { if (argc < 2) { @@ -1499,8 +1473,7 @@ void makedir(argc, argv) /* * Remove a directory. */ -void removedir(argc, argv) - const char *argv[]; +void removedir(int argc, const char *argv[]) { if (argc < 2) { @@ -1530,8 +1503,7 @@ void removedir(argc, argv) /* * Send a line, verbatim, to the remote machine. */ -void quote(argc, argv) - const char *argv[]; +void quote(int argc, const char *argv[]) { int i; char buf[BUFSIZ]; @@ -1566,9 +1538,7 @@ void quote(argc, argv) * is sent almost verbatim to the remote machine, the * first argument is changed to SITE. */ - -void site(argc, argv) - const char *argv[]; +void site(int argc, const char *argv[]) { int i; char buf[BUFSIZ]; @@ -1599,8 +1569,7 @@ void site(argc, argv) } } -void do_chmod(argc, argv) - const char *argv[]; +void do_chmod(int argc, const char *argv[]) { if (argc == 2) { printf("usage: %s mode file-name\n", argv[0]); @@ -1626,8 +1595,7 @@ void do_chmod(argc, argv) (void)command("SITE CHMOD %s %s", argv[1], argv[2]); } -void do_umask(argc, argv) - char *argv[]; +void do_umask(int argc, const char *argv[]) { int oldverbose = verbose; @@ -1636,8 +1604,7 @@ void do_umask(argc, argv) verbose = oldverbose; } -void idle(argc, argv) - char *argv[]; +void idle(int argc, const char *argv[]) { int oldverbose = verbose; @@ -1649,8 +1616,7 @@ void idle(argc, argv) /* * Ask the other side for help. */ -void rmthelp(argc, argv) - char *argv[]; +void rmthelp(int argc, const char *argv[]) { int oldverbose = verbose; @@ -1663,14 +1629,13 @@ void rmthelp(argc, argv) * Terminate session and exit. */ /*VARARGS*/ -void quit() +void quit(int argc, const char *argv[]) { - if (connected) - disconnect(); + disconnect(0, NULL); pswitch(1); if (connected) { - disconnect(); + disconnect(0, NULL); } exit(0); } @@ -1678,7 +1643,7 @@ void quit() /* * Terminate session, but don't exit. */ -void disconnect() +void disconnect(int argc, const char *argv[]) { extern int cout; extern int data; @@ -1694,8 +1659,7 @@ void disconnect() } } -int confirm(cmd, file) - const char *cmd, *file; +int confirm(const char *cmd, const char *file) { char line[BUFSIZ]; @@ -1708,8 +1672,7 @@ int confirm(cmd, file) } #if 0 -static void fatal(msg) - char *msg; +static void fatal(const char *msg) { fprintf(stderr, "ftp: %s\n", msg); @@ -1723,8 +1686,7 @@ static void fatal(msg) * Can't control multiple values being expanded * from the expression, we return only the first. */ -int globulize(cpp) - const char **cpp; +int globulize(const char **cpp) { char **globbed; @@ -1751,9 +1713,7 @@ int globulize(cpp) return (1); } -void account(argc,argv) - int argc; - char **argv; +void account(int argc, const char *argv[]) { char acct[50], *getpass(), *ap; @@ -1797,9 +1757,7 @@ proxabort() } #endif -void doproxy(argc,argv) - int argc; - const char *argv[]; +void doproxy(int argc, const char *argv[]) { register struct cmd *c; struct cmd *getcmd(); @@ -1865,7 +1823,7 @@ void doproxy(argc,argv) // (void) signal(SIGINT, oldintr); } -void setcase() +void setcase(int argc, const char *argv[]) { mcase = !mcase; printf("Case mapping %s.\n", onoff(mcase)); @@ -1873,7 +1831,7 @@ void setcase() code = mcase; } -void setcr() +void setcr(int argc, const char *argv[]) { crflag = !crflag; printf("Carriage Return stripping %s.\n", onoff(crflag)); @@ -1881,9 +1839,7 @@ void setcr() code = crflag; } -void setntrans(argc,argv) - int argc; - char *argv[]; +void setntrans(int argc, const char *argv[]) { if (argc == 1) { ntflag = 0; @@ -1905,8 +1861,7 @@ void setntrans(argc,argv) } const char * -dotrans(name) - const char *name; +dotrans(const char *name) { static char new[MAXPATHLEN]; const char *cp1; @@ -1933,11 +1888,7 @@ dotrans(name) return(new); } - -void -setpassive(argc, argv) - int argc; - char *argv[]; +void setpassive(int argc, const char *argv[]) { passivemode = !passivemode; printf("Passive mode %s.\n", onoff(passivemode)); @@ -1945,9 +1896,7 @@ setpassive(argc, argv) code = passivemode; } -void setnmap(argc, argv) - int argc; - const char *argv[]; +void setnmap(int argc, const char *argv[]) { char *cp; @@ -1988,8 +1937,7 @@ void setnmap(argc, argv) } const char * -domap(name) - const char *name; +domap(const char *name) { static char new[MAXPATHLEN]; const char *cp1 = name; @@ -2161,7 +2109,7 @@ LOOP: return(new); } -void setsunique() +void setsunique(int argc, const char *argv[]) { sunique = !sunique; printf("Store unique %s.\n", onoff(sunique)); @@ -2169,7 +2117,7 @@ void setsunique() code = sunique; } -void setrunique() +void setrunique(int argc, const char *argv[]) { runique = !runique; printf("Receive unique %s.\n", onoff(runique)); @@ -2178,7 +2126,7 @@ void setrunique() } /* change directory to perent directory */ -void cdup() +void cdup(int argc, const char *argv[]) { if (command("CDUP") == ERROR && code == 500) { if (verbose) { @@ -2190,9 +2138,7 @@ void cdup() } /* restart transfer at specific point */ -void restart(argc, argv) - int argc; - char *argv[]; +void restart(int argc, const char *argv[]) { if (argc != 2) printf("restart: offset not specified\n"); @@ -2205,14 +2151,12 @@ void restart(argc, argv) } /* show remote system type */ -void syst() +void syst(int argc, const char *argv[]) { (void) command("SYST"); } -void macdef(argc, argv) - int argc; - const char *argv[]; +void macdef(int argc, const char *argv[]) { char *tmp; int c; @@ -2287,8 +2231,7 @@ void macdef(argc, argv) /* * get size of file on remote machine */ -void sizecmd(argc, argv) - const char *argv[]; +void sizecmd(int argc, const char *argv[]) { if (argc < 2) { @@ -2312,8 +2255,7 @@ void sizecmd(argc, argv) /* * get last modification time of file on remote machine */ -void modtime(argc, argv) - const char *argv[]; +void modtime(int argc, const char *argv[]) { int overbose; @@ -2351,8 +2293,7 @@ void modtime(argc, argv) /* * show status on reomte machine */ -void rmtstatus(argc, argv) - const char *argv[]; +void rmtstatus(int argc, const char *argv[]) { (void) command(argc > 1 ? "STAT %s" : "STAT" , argv[1]); } @@ -2360,8 +2301,7 @@ void rmtstatus(argc, argv) /* * get file if modtime is more recent than current file */ -void newer(argc, argv) - const char *argv[]; +void newer(int argc, const char *argv[]) { if (getit(argc, argv, -1, "w")) { printf("Local file \"%s\" is newer than remote file \"%s\"\n", diff --git a/base/applications/network/ftp/domacro.c b/base/applications/network/ftp/domacro.c index a741a344048..fc96ad76288 100644 --- a/base/applications/network/ftp/domacro.c +++ b/base/applications/network/ftp/domacro.c @@ -28,9 +28,7 @@ static char sccsid[] = "@(#)domacro.c 1.6 (Berkeley) 2/28/89"; #include //#include -void domacro(argc, argv) - int argc; - const char *argv[]; +void domacro(int argc, const char *argv[]) { int i, j; const char *cp1; diff --git a/base/applications/network/ftp/fake.c b/base/applications/network/ftp/fake.c index a00f30560be..5f4bfc88f83 100644 --- a/base/applications/network/ftp/fake.c +++ b/base/applications/network/ftp/fake.c @@ -35,7 +35,7 @@ void blkfree(char **av0) free(*av++); } -char **glob(register char *v) +char **glob(const char *v) { return NULL; } diff --git a/base/applications/network/ftp/ftp.c b/base/applications/network/ftp/ftp.c index 5fdc81ce9fa..9d0da1c4a73 100644 --- a/base/applications/network/ftp/ftp.c +++ b/base/applications/network/ftp/ftp.c @@ -110,7 +110,7 @@ typedef void (*Sig_t)(int); void psabort(int sig); -char *hookup(char *host, int port) +char *hookup(const char *host, int port) { register struct hostent *hp = 0; int len; @@ -837,7 +837,7 @@ null();// (void) signal(SIGINT, oldintr); oldverbose = verbose; if (!debug) verbose = 0; - setascii(); + setascii(0, NULL); verbose = oldverbose; } } else if (restart_point) { @@ -852,13 +852,13 @@ null();// (void) signal(SIGINT, oldintr); verbose = 0; switch (oldtype) { case TYPE_I: - setbinary(); + setbinary(0, NULL); break; case TYPE_E: setebcdic(); break; case TYPE_L: - settenex(); + settenex(0, NULL); break; } verbose = oldverbose; @@ -873,13 +873,13 @@ null();// (void) signal(SIGINT, oldintr); verbose = 0; switch (oldtype) { case TYPE_I: - setbinary(); + setbinary(0, NULL); break; case TYPE_E: setebcdic(); break; case TYPE_L: - settenex(); + settenex(0, NULL); break; } verbose = oldverbose; @@ -1044,13 +1044,13 @@ null();// (void) signal(SIGPIPE, oldintp); verbose = 0; switch (oldtype) { case TYPE_I: - setbinary(); + setbinary(0, NULL); break; case TYPE_E: setebcdic(); break; case TYPE_L: - settenex(); + settenex(0, NULL); break; } verbose = oldverbose; @@ -1069,13 +1069,13 @@ null();// (void) signal(SIGINT,SIG_IGN); verbose = 0; switch (oldtype) { case TYPE_I: - setbinary(); + setbinary(0, NULL); break; case TYPE_E: setebcdic(); break; case TYPE_L: - settenex(); + settenex(0, NULL); break; } verbose = oldverbose; @@ -1463,16 +1463,16 @@ void proxtrans(cmd, local, remote) oldtype = type; switch (tmptype) { case TYPE_A: - setascii(); + setascii(0, NULL); break; case TYPE_I: - setbinary(); + setbinary(0, NULL); break; case TYPE_E: setebcdic(); break; case TYPE_L: - settenex(); + settenex(0, NULL); break; } } @@ -1481,16 +1481,16 @@ void proxtrans(cmd, local, remote) case 0: break; case TYPE_A: - setascii(); + setascii(0, NULL); break; case TYPE_I: - setbinary(); + setbinary(0, NULL); break; case TYPE_E: setebcdic(); break; case TYPE_L: - settenex(); + settenex(0, NULL); break; } pswitch(1); @@ -1505,16 +1505,16 @@ null();// (void) signal(SIGINT, oldintr); case 0: break; case TYPE_A: - setascii(); + setascii(0, NULL); break; case TYPE_I: - setbinary(); + setbinary(0, NULL); break; case TYPE_E: setebcdic(); break; case TYPE_L: - settenex(); + settenex(0, NULL); break; } pswitch(1); @@ -1534,16 +1534,16 @@ null();// (void) signal(SIGINT, oldintr); case 0: break; case TYPE_A: - setascii(); + setascii(0, NULL); break; case TYPE_I: - setbinary(); + setbinary(0, NULL); break; case TYPE_E: setebcdic(); break; case TYPE_L: - settenex(); + settenex(0, NULL); break; } pswitch(1); @@ -1565,16 +1565,16 @@ null();// (void) signal(SIGINT, SIG_IGN); case 0: break; case TYPE_A: - setascii(); + setascii(0, NULL); break; case TYPE_I: - setbinary(); + setbinary(0, NULL); break; case TYPE_E: setebcdic(); break; case TYPE_L: - settenex(); + settenex(0, NULL); break; } if (cpend) { @@ -1636,16 +1636,16 @@ null();// (void) signal(SIGINT, oldintr); case 0: break; case TYPE_A: - setascii(); + setascii(0, NULL); break; case TYPE_I: - setbinary(); + setbinary(0, NULL); break; case TYPE_E: setebcdic(); break; case TYPE_L: - settenex(); + settenex(0, NULL); break; } if (cpend) { @@ -1720,16 +1720,16 @@ null();// (void) signal(SIGINT, oldintr); case 0: break; case TYPE_A: - setascii(); + setascii(0, NULL); break; case TYPE_I: - setbinary(); + setbinary(0, NULL); break; case TYPE_E: setebcdic(); break; case TYPE_L: - settenex(); + settenex(0, NULL); break; } pswitch(1); @@ -1738,7 +1738,7 @@ null();// (void) signal(SIGINT, oldintr); null();// (void) signal(SIGINT, oldintr); } -void reset() +void reset(int argc, const char *argv[]) { // struct fd_set mask; diff --git a/base/applications/network/ftp/ftp_var.h b/base/applications/network/ftp/ftp_var.h index a0a99b23ee5..69bfcfe0484 100644 --- a/base/applications/network/ftp/ftp_var.h +++ b/base/applications/network/ftp/ftp_var.h @@ -141,7 +141,7 @@ struct cmd { char c_bell; /* give bell when command completes */ char c_conn; /* must be connected to use command */ char c_proxy; /* proxy server may execute */ - void (*c_handler)(); /* function to call */ + void (*c_handler)(int argc, const char *argv[]); /* function to call */ }; struct macel { diff --git a/base/applications/network/ftp/main.c b/base/applications/network/ftp/main.c index 745e908d868..5843096df99 100644 --- a/base/applications/network/ftp/main.c +++ b/base/applications/network/ftp/main.c @@ -53,10 +53,10 @@ static char sccsid[] = "@(#)main.c based on 5.13 (Berkeley) 3/14/89"; typedef int uid_t; #endif -uid_t getuid(); -void intr(); -void lostpeer(); -char *getlogin(); +uid_t getuid(void); +void intr(void); +void lostpeer(void); +char *getlogin(void); short portnum; @@ -262,10 +262,8 @@ int main(int argc, const char *argv[]) } } -void -intr() +void intr(void) { - longjmp(toplevel, 1); } @@ -299,8 +297,7 @@ void lostpeer(void) } /*char * -tail(filename) - char *filename; +tail(char *filename) { register char *s; @@ -318,8 +315,7 @@ tail(filename) /* * Command parser. */ -void cmdscanner(top) - int top; +void cmdscanner(int top) { register struct cmd *c; @@ -333,7 +329,7 @@ void cmdscanner(top) } if (gets(line) == 0) { if (feof(stdin) || ferror(stdin)) - quit(); + quit(0, NULL); break; } if (line[0] == 0) @@ -367,8 +363,7 @@ void cmdscanner(top) } struct cmd * -getcmd(name) - const char *name; +getcmd(const char *name) { extern struct cmd cmdtab[]; const char *p, *q; @@ -402,7 +397,7 @@ getcmd(name) int slrflag; -void makeargv() +void makeargv(void) { const char **argp; @@ -421,7 +416,7 @@ void makeargv() * handle quoting and strings */ static const char * -slurpstring() +slurpstring(void) { int got_one = 0; register char *sb = stringbase; @@ -544,9 +539,7 @@ OUT1: * Help command. * Call each command handler with argc == 0 and argv[0] == name. */ -void help(argc, argv) - int argc; - char *argv[]; +void help(int argc, const char *argv[]) { extern struct cmd cmdtab[]; struct cmd *c; @@ -594,7 +587,7 @@ void help(argc, argv) return; } while (--argc > 0) { - register char *arg; + const char *arg; arg = *++argv; c = getcmd(arg); if (c == (struct cmd *)-1) diff --git a/base/applications/network/ftp/prototypes.h b/base/applications/network/ftp/prototypes.h index 05f3ab281d4..fb00fdcb4ab 100644 --- a/base/applications/network/ftp/prototypes.h +++ b/base/applications/network/ftp/prototypes.h @@ -8,8 +8,8 @@ int fputcSocket(int s, char putChar); int fputSocket(int s, char *putChar, int len); char *fgetsSocket(int s, char *string); -char *hookup(); -char **glob(); +char *hookup(const char *host, int port); +char **glob(const char *s); int herror(char *s); int getreply(int expecteof); @@ -20,18 +20,18 @@ void domacro(int argc, const char *argv[]); void proxtrans(const char *cmd, const char *local, const char *remote); int null(void); int initconn(void); -void disconnect(void); +void disconnect(int argc, const char *argv[]); void ptransfer(const char *direction, long bytes, struct timeval *t0, struct timeval *t1); -void setascii(void); -void setbinary(void); +void setascii(int argc, const char *argv[]); +void setbinary(int argc, const char *argv[]); void setebcdic(void); -void settenex(void); +void settenex(int argc, const char *argv[]); void tvsub(struct timeval *tdiff, struct timeval *t1, struct timeval *t0); -void setpassive(int argc, char *argv[]); +void setpassive(int argc, const char *argv[]); void setpeer(int argc, const char *argv[]); void cmdscanner(int top); void pswitch(int flag); -void quit(void); +void quit(int argc, const char *argv[]); int login(const char *host); int command(const char *fmt, ...); int globulize(const char **cpp); @@ -43,22 +43,59 @@ void blkfree(char **av0); int getit(int argc, const char *argv[], int restartit, const char *mode); int sleep(int time); -char *tail(); -void setbell(), setdebug(); -void setglob(), sethash(), setport(); -void setprompt(); -void settrace(), setverbose(); -void settype(), setform(), setstruct(); -void restart(), syst(); -void cd(), lcd(), delete(), mdelete(); -void ls(), mls(), get(), mget(), help(), append(), put(), mput(), reget(); -void status(); -void renamefile(); -void quote(), rmthelp(), site(); -void pwd(), makedir(), removedir(), setcr(); -void account(), doproxy(), reset(), setcase(), setntrans(), setnmap(); -void setsunique(), setrunique(), cdup(), macdef(); -void sizecmd(), modtime(), newer(), rmtstatus(); -void do_chmod(), do_umask(), idle(); -void shell(), user(), fsetmode(); -struct cmd *getcmd(); +char *tail(void); +void setbell(int argc, const char *argv[]); +void setdebug(int argc, const char *argv[]); +void setglob(int argc, const char *argv[]); +void sethash(int argc, const char *argv[]); +void setport(int argc, const char *argv[]); +void setprompt(int argc, const char *argv[]); +void settrace(int argc, const char *argv[]); +void setverbose(int argc, const char *argv[]); +void settype(int argc, const char *argv[]); +void setform(int argc, const char *argv[]); +void setstruct(int argc, const char *argv[]); +void restart(int argc, const char *argv[]); +void syst(int argc, const char *argv[]); +void cd(int argc, const char *argv[]); +void lcd(int argc, const char *argv[]); +void delete(int argc, const char *argv[]); +void mdelete(int argc, const char *argv[]); +void ls(int argc, const char *argv[]); +void mls(int argc, const char *argv[]); +void get(int argc, const char *argv[]); +void mget(int argc, const char *argv[]); +void help(int argc, const char *argv[]); +void put(int argc, const char *argv[]); +void mput(int argc, const char *argv[]); +void reget(int argc, const char *argv[]); +void status(int argc, const char *argv[]); +void renamefile(int argc, const char *argv[]); +void quote(int argc, const char *argv[]); +void rmthelp(int argc, const char *argv[]); +void site(int argc, const char *argv[]); +void pwd(int argc, const char *argv[]); +void makedir(int argc, const char *argv[]); +void removedir(int argc, const char *argv[]); +void setcr(int argc, const char *argv[]); +void account(int argc, const char *argv[]); +void doproxy(int argc, const char *argv[]); +void reset(int argc, const char *argv[]); +void setcase(int argc, const char *argv[]); +void setntrans(int argc, const char *argv[]); +void setnmap(int argc, const char *argv[]); +void setsunique(int argc, const char *argv[]); +void setrunique(int argc, const char *argv[]); +void cdup(int argc, const char *argv[]); +void macdef(int argc, const char *argv[]); +void sizecmd(int argc, const char *argv[]); +void modtime(int argc, const char *argv[]); +void newer(int argc, const char *argv[]); +void rmtstatus(int argc, const char *argv[]); +void do_chmod(int argc, const char *argv[]); +void do_umask(int argc, const char *argv[]); +void idle(int argc, const char *argv[]); +void shell(int argc, const char *argv[]); +void user(int argc, const char *argv[]); +void fsetmode(int argc, const char *argv[]); +struct cmd *getcmd(const char *name); diff --git a/base/applications/network/net/net.h b/base/applications/network/net/net.h index d86af564206..594bbb86669 100644 --- a/base/applications/network/net/net.h +++ b/base/applications/network/net/net.h @@ -13,8 +13,8 @@ #include #include -void help(); -int unimplemented(); +void help(void); +int unimplemented(void); INT cmdHelp(INT argc, CHAR **argv); diff --git a/base/applications/network/ping/lang/uk-UA.rc b/base/applications/network/ping/lang/uk-UA.rc new file mode 100644 index 00000000000..eb0523a771f --- /dev/null +++ b/base/applications/network/ping/lang/uk-UA.rc @@ -0,0 +1,43 @@ +/* + * PROJECT: Ping for ReactOS + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/applications/network/ping/lang/uk-UA.rc + * PURPOSE: Ukraianian Language File for Ping + * TRANSLATORS: Sakara Eugene (vzov@yandex.ua) + */ + +LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT + +STRINGTABLE DISCARDABLE +BEGIN + IDS_USAGE "\n: ping [-t] [-n count] [-l size] [-w timeout] \n\n\ +:\n\ + -t ϳ .\n\ + Control-C.\n\ + -n count , .\n\ + -l size .\n\ + -w timeout .\n\n\0" + + IDS_PING_WITH_BYTES "\n %1 [%2] %3!d! :\n\n\0" + IDS_PING_STATISTICS "\n Ping %1:\n\0" + IDS_PACKETS_SENT_RECEIVED_LOST " : = %1!d!, = %2!d!, = %3!d! (%4!d!%% ),\n\0" + IDS_APPROXIMATE_ROUND_TRIP " -:\n\0" + IDS_MIN_MAX_AVERAGE " ̳ = %1, = %2, = %3\n\0" + IDS_NOT_ENOUGH_RESOURCES " .\n\0" + IDS_UNKNOWN_HOST " %1.\n\0" + IDS_SETSOCKOPT_FAILED "setsockopt (%1!d!).\n\0" + IDS_COULD_NOT_CREATE_SOCKET " (#%1!d!).\n\0" + IDS_COULD_NOT_INIT_WINSOCK " winsock dll.\n\0" + IDS_DEST_MUST_BE_SPECIFIED "' IP- .\n\0" + IDS_BAD_PARAMETER " %1.\n\0" + IDS_BAD_OPTION_FORMAT " %1.\n\0" + IDS_BAD_OPTION " %1.\n\0" + IDS_BAD_VALUE_OPTION_L " -l, 0 %1!d!.\n\0" + IDS_REPLY_FROM "³ %1: =%2!d! %3%4 TTL=%5!d!\n\0" + IDS_DEST_UNREACHABLE " .\n\0" + IDS_COULD_NOT_TRANSMIT " (%1!d!).\n\0" + IDS_COULD_NOT_RECV " (%1!d!).\n\0" + IDS_REQUEST_TIMEOUT " .\n\0" + IDS_MS "\0" + IDS_1MS "1\0" +END diff --git a/base/applications/network/ping/ping.rc b/base/applications/network/ping/ping.rc index 0cc7ddf1792..3f25d017260 100644 --- a/base/applications/network/ping/ping.rc +++ b/base/applications/network/ping/ping.rc @@ -13,3 +13,4 @@ #include "lang/fr-FR.rc" #include "lang/pl-PL.rc" #include "lang/it-IT.rc" +#include "lang/uk-UA.rc" diff --git a/base/applications/notepad/dialog.c b/base/applications/notepad/dialog.c index 3bc53ac9383..1ac3019af90 100644 --- a/base/applications/notepad/dialog.c +++ b/base/applications/notepad/dialog.c @@ -112,31 +112,27 @@ VOID ShowLastError(void) /** * Sets the caption of the main window according to Globals.szFileTitle: - * Notepad - (untitled) if no file is open - * Notepad - [filename] if a file is given + * (untitled) - Notepad if no file is open + * [filename] - Notepad if a file is given */ static void UpdateWindowCaption(void) { - TCHAR szCaption[MAX_STRING_LEN]; - TCHAR szUntitled[MAX_STRING_LEN]; + TCHAR szCaption[MAX_STRING_LEN] = _T(""); + TCHAR szNotepad[MAX_STRING_LEN]; - LoadString(Globals.hInstance, STRING_NOTEPAD, szCaption, SIZEOF(szCaption)); + LoadString(Globals.hInstance, STRING_NOTEPAD, szNotepad, SIZEOF(szNotepad)); - if (Globals.szFileTitle[0] != '\0') { - static const TCHAR bracket_l[] = _T(" - ["); - static const TCHAR bracket_r[] = _T("]"); - _tcscat(szCaption, bracket_l); - _tcscat(szCaption, Globals.szFileTitle); - _tcscat(szCaption, bracket_r); + if (Globals.szFileTitle[0] != '\0') + { + StringCchCat(szCaption, MAX_STRING_LEN, Globals.szFileTitle); } else { - static const TCHAR hyphen[] = _T(" - "); - LoadString(Globals.hInstance, STRING_UNTITLED, szUntitled, SIZEOF(szUntitled)); - _tcscat(szCaption, hyphen); - _tcscat(szCaption, szUntitled); + LoadString(Globals.hInstance, STRING_UNTITLED, szCaption, SIZEOF(szCaption)); } - + + StringCchCat(szCaption, MAX_STRING_LEN, _T(" - ")); + StringCchCat(szCaption, MAX_STRING_LEN, szNotepad); SetWindowText(Globals.hMainWnd, szCaption); } @@ -684,7 +680,7 @@ VOID DIALOG_EditTimeDate(VOID) _tcscat(szText, _T(" ")); GetDateFormat(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, szDate, MAX_STRING_LEN); _tcscat(szText, szDate); - SendMessage(Globals.hEdit, EM_REPLACESEL, TRUE, (LPARAM)szDate); + SendMessage(Globals.hEdit, EM_REPLACESEL, TRUE, (LPARAM)szText); } VOID DoCreateStatusBar(VOID) @@ -766,7 +762,7 @@ VOID DoCreateEditWindow(VOID) { DWORD dwStyle; int iSize; - LPTSTR pTemp; + LPTSTR pTemp = NULL; iSize = 0; diff --git a/base/applications/notepad/notepad.h b/base/applications/notepad/notepad.h index 26ea408b87f..bc910ab275e 100644 --- a/base/applications/notepad/notepad.h +++ b/base/applications/notepad/notepad.h @@ -6,6 +6,7 @@ #include #include #include +#include #include "main.h" #include "dialog.h" diff --git a/base/applications/notepad/settings.c b/base/applications/notepad/settings.c index 9a68c8b43db..c0a12491694 100644 --- a/base/applications/notepad/settings.c +++ b/base/applications/notepad/settings.c @@ -134,10 +134,10 @@ void LoadSettings(void) QueryBool(hKey, _T("fWrap"), &Globals.bWrapLongLines); QueryBool(hKey, _T("fStatusBar"), &Globals.bShowStatusBar); - QueryByte(hKey, _T("iWindowPosX"), (LPBYTE)&Globals.main_rect.left); - QueryByte(hKey, _T("iWindowPosX"), (LPBYTE)&Globals.main_rect.top); - QueryByte(hKey, _T("iWindowPosDX"), (LPBYTE)&dx); - QueryByte(hKey, _T("iWindowPosDY"), (LPBYTE)&dy); + QueryDword(hKey, _T("iWindowPosX"), (DWORD*)&Globals.main_rect.left); + QueryDword(hKey, _T("iWindowPosY"), (DWORD*)&Globals.main_rect.top); + QueryDword(hKey, _T("iWindowPosDX"), (DWORD*)&dx); + QueryDword(hKey, _T("iWindowPosDY"), (DWORD*)&dy); Globals.main_rect.right = Globals.main_rect.left + dx; Globals.main_rect.bottom = Globals.main_rect.top + dy; diff --git a/base/applications/paint/dialogs.h b/base/applications/paint/dialogs.h index dc608dac84c..4378045ecc5 100644 --- a/base/applications/paint/dialogs.h +++ b/base/applications/paint/dialogs.h @@ -6,8 +6,8 @@ * PROGRAMMERS: Benedikt Freisen */ -int mirrorRotateDlg(); +int mirrorRotateDlg(void); -int attributesDlg(); +int attributesDlg(void); int changeSizeDlg(); diff --git a/base/applications/paint/history.h b/base/applications/paint/history.h index b0733e99e8e..a373ea5a102 100644 --- a/base/applications/paint/history.h +++ b/base/applications/paint/history.h @@ -6,16 +6,16 @@ * PROGRAMMERS: Benedikt Freisen */ -void newReversible(); +void newReversible(void); -void undo(); +void undo(void); -void redo(); +void redo(void); -void resetToU1(); +void resetToU1(void); -void clearHistory(); +void clearHistory(void); -void insertReversible(); +void insertReversible(HBITMAP hbm); void cropReversible(int width, int height, int xOffset, int yOffset); diff --git a/base/applications/paint/mouse.h b/base/applications/paint/mouse.h index 49bbb408a96..acb083c0a8b 100644 --- a/base/applications/paint/mouse.h +++ b/base/applications/paint/mouse.h @@ -6,7 +6,7 @@ * PROGRAMMERS: Benedikt Freisen */ -void placeSelWin(); +void placeSelWin(void); void startPaintingL(HDC hdc, short x, short y, int fg, int bg); diff --git a/base/applications/rapps/lang/fr-FR.rc b/base/applications/rapps/lang/fr-FR.rc new file mode 100644 index 00000000000..e4d526e6142 --- /dev/null +++ b/base/applications/rapps/lang/fr-FR.rc @@ -0,0 +1,193 @@ +LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL + +IDR_MAINMENU MENU +BEGIN + POPUP "&Fichier" + BEGIN + MENUITEM "&Configuration", ID_SETTINGS + MENUITEM SEPARATOR + MENUITEM "S&ortir", ID_EXIT + END + POPUP "&Programmes" + BEGIN + MENUITEM "&Installer", ID_INSTALL + MENUITEM "&Dsinstaller",ID_UNINSTALL + MENUITEM "&Modifier", ID_MODIFY + MENUITEM SEPARATOR + MENUITEM "&Supprimer du registre", ID_REGREMOVE + MENUITEM SEPARATOR + MENUITEM "&Rafrachir", ID_REFRESH + END + POPUP "Aide" + BEGIN + MENUITEM "Aide", ID_HELP, GRAYED + MENUITEM " propos", ID_ABOUT + END +END + +IDR_LINKMENU MENU +BEGIN + POPUP "popup" + BEGIN + MENUITEM "&Ouvrir le lien dans un navigateur", ID_OPEN_LINK + MENUITEM "&Copier le lien dans le presse-papier", ID_COPY_LINK + END +END + +IDR_APPLICATIONMENU MENU +BEGIN + POPUP "popup" + BEGIN + MENUITEM "&Installer", ID_INSTALL + MENUITEM "&Dsinstaller", ID_UNINSTALL + MENUITEM "&Modifier", ID_MODIFY + MENUITEM SEPARATOR + MENUITEM "&Supprimer du registre", ID_REGREMOVE + MENUITEM SEPARATOR + MENUITEM "&Rafrachir", ID_REFRESH + END +END + +IDD_SETTINGS_DIALOG DIALOGEX DISCARDABLE 0, 0, 250, 144 +STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Configuration" +FONT 8, "MS Shell Dlg" +BEGIN + GROUPBOX "Gnral", -1, 4, 2, 240, 61 + AUTOCHECKBOX "&Enregistrer la position de la fentre", IDC_SAVE_WINDOW_POS, 15, 12, 219, 12 + AUTOCHECKBOX "&Mettre jour la liste des programmes accessibles au dmarage", IDC_UPDATE_AVLIST, 15, 29, 219, 12 + AUTOCHECKBOX "&Journal de l'installation de la suppression des programmes", IDC_LOG_ENABLED, 15, 46, 219, 12 + + GROUPBOX "Tlchargement", -1, 4, 65, 240, 51 + LTEXT "Fichier des tlchargements :", -1, 16, 75, 100, 9 + EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP + PUSHBUTTON "&Slectionner", IDC_CHOOSE, 187, 85, 50, 14 + AUTOCHECKBOX "&Supprimer l'installateur du programme aprs l'installation", IDC_DEL_AFTER_INSTALL, 16, 100, 218, 12 + + PUSHBUTTON "Par dfaut", IDC_DEFAULT_SETTINGS, 8, 124, 60, 14 + PUSHBUTTON "Accepter", IDOK, 116, 124, 60, 14 + PUSHBUTTON "Annuler", IDCANCEL, 181, 124, 60, 14 +END + +IDD_INSTALL_DIALOG DIALOGEX DISCARDABLE 0, 0, 216, 97 +STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Installation de programme" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "...", IDC_INSTALL_TEXT, 4, 5, 209, 35 + + AUTORADIOBUTTON "&Installer partir d'un disque (CD ou DVD)", IDC_CD_INSTALL, 10, 46, 197, 11, WS_GROUP + AUTORADIOBUTTON "&Tlcharger et installer", IDC_DOWNLOAD_INSTALL, 10, 59, 197, 11, NOT WS_TABSTOP + + PUSHBUTTON "Accepter", IDOK, 86, 78, 60, 14 + PUSHBUTTON "Annuler", IDCANCEL, 150, 78, 60, 14 +END + +IDD_DOWNLOAD_DIALOG DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 76 +STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE +CAPTION "Tlcharger..." +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "Progress1", IDC_DOWNLOAD_PROGRESS, "msctls_progress32", WS_BORDER | PBS_SMOOTH, 10, 10, 200, 12 + LTEXT "", IDC_DOWNLOAD_STATUS, 10, 30, 200, 10, SS_CENTER + PUSHBUTTON "Annuler", IDCANCEL, 85, 58, 50, 15, WS_GROUP | WS_TABSTOP +END + +IDD_ABOUT_DIALOG DIALOGEX 22, 16, 190, 66 +STYLE DS_SHELLFONT | WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME +CAPTION " propos" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "ReactOS Applications Manager\nCopyright (C) 2009\npar Dmitry Chapyshev (dmitry@reactos.org)", IDC_STATIC, 48, 7, 130, 39 + PUSHBUTTON "Fermer", IDOK, 133, 46, 50, 14 + ICON IDI_MAIN, IDC_STATIC, 10, 10, 7, 30 +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_TOOLTIP_INSTALL "Installer" + IDS_TOOLTIP_UNINSTALL "Dsinstaller" + IDS_TOOLTIP_MODIFY "Modifier" + IDS_TOOLTIP_SETTINGS "Configuration" + IDS_TOOLTIP_REFRESH "Rafrachir" + IDS_TOOLTIP_EXIT "Sortir" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_APP_NAME "Nom" + IDS_APP_INST_VERSION "Version" + IDS_APP_DESCRIPTION "Description" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_INFO_VERSION "\nVersion : " + IDS_INFO_DESCRIPTION "\nDescription : " + IDS_INFO_PUBLISHER "\nAuteur : " + IDS_INFO_HELPLINK "\nLien d'aide : " + IDS_INFO_HELPPHONE "\nTlphone d'aide : " + IDS_INFO_README "\nLisez-moi : " + IDS_INFO_REGOWNER "\nUtilisateur enregistr : " + IDS_INFO_PRODUCTID "\nID du produit : " + IDS_INFO_CONTACT "\nContact : " + IDS_INFO_UPDATEINFO "\nInformation de mise jour : " + IDS_INFO_INFOABOUT "\nInformation propos : " + IDS_INFO_COMMENTS "\nCommentaires : " + IDS_INFO_INSTLOCATION "\Emplacement de l'installation : " + IDS_INFO_INSTALLSRC "\nSource de l'installation : " + IDS_INFO_UNINSTALLSTR "\nCommande de dsinstallation : " + IDS_INFO_MODIFYPATH "\nModifier le chemin d'accs : " + IDS_INFO_INSTALLDATE "\nDate d'installation : " +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_AINFO_VERSION "\nVersion : " + IDS_AINFO_DESCRIPTION "\nDescription : " + IDS_AINFO_SIZE "\nTaille : " + IDS_AINFO_URLSITE "\nSite internet : " + IDS_AINFO_LICENCE "\nLicence : " +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_CAT_AUDIO "Audio" + IDS_CAT_DEVEL "Dveloppement" + IDS_CAT_DRIVERS "Pilotes" + IDS_CAT_EDU "ducation" + IDS_CAT_ENGINEER "Ingnierie" + IDS_CAT_FINANCE "Finance" + IDS_CAT_GAMES "Jeux & dtente" + IDS_CAT_GRAPHICS "Graphismes" + IDS_CAT_INTERNET "Internet & rsaux" + IDS_CAT_LIBS "Bibliothques" + IDS_CAT_OFFICE "Bureautique" + IDS_CAT_OTHER "Autres" + IDS_CAT_SCIENCE "Sciences" + IDS_CAT_TOOLS "Outils" + IDS_CAT_VIDEO "Vido" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_APPTITLE "ReactOS Applications Manager" + IDS_SEARCH_TEXT "Chercher..." + IDS_INSTALL "Installer" + IDS_UNINSTALL "Dsinstaller" + IDS_MODIFY "Modifier" + IDS_APPS_COUNT "Nombre d'applications : %d" + IDS_WELCOME_TITLE "Bienvenue ReactOS Applications Manager!\n\n" + IDS_WELCOME_TEXT "Choisisez une catgorie gauche, ensuite choisisez une application installer ou dsinstaller.\nSite internet de ReactOS : " + IDS_WELCOME_URL "http://www.reactos.org" + IDS_INSTALLED "Install" + IDS_AVAILABLEFORINST "Disponible pour installation" + IDS_UPDATES "Mises jour" + IDS_APPLICATIONS "Applications" + IDS_CHOOSE_FOLDER_TEXT "Choisisez un dossier dans lequel seront tlchargs les programmes :" + IDS_CHOOSE_FOLDER_ERROR "Le dossier que vous avez spcifi n'existe pas. Le crer ?" + IDS_USER_NOT_ADMIN "Vous devez tre un administrateur pour dmarrer ""ReactOS Applications Manager""!" + IDS_APP_REG_REMOVE "Etes-vous sr de vouloir supprimer les donnes du programme install du registre ?" + IDS_INFORMATION "Information" + IDS_UNABLE_TO_REMOVE "Impossible de supprimer les donnes du programme du registre !" +END diff --git a/base/applications/rapps/rapps/7zip.txt b/base/applications/rapps/rapps/7zip.txt index e5e8df83ae6..84da1e5ef3f 100644 --- a/base/applications/rapps/rapps/7zip.txt +++ b/base/applications/rapps/rapps/7zip.txt @@ -1,24 +1,27 @@ -; UTF-8 - -[Section] -Name = 7-Zip -Version = 9.20 -Licence = LGPL -Description = Utility to create and open 7zip, zip, tar, rar and other archive files. -Size = 1.0M -Category = 12 -URLSite = http://www.7-zip.org/ -URLDownload = http://ovh.dl.sourceforge.net/project/sevenzip/7-Zip/9.20/7z920.exe -CDPath = none - -[Section.0407] -Description = Tool zum Erstellen und Öffnen von 7zip, zip, tar, rar und andrern Archiven. - -[Section.040a] -Description = Utilidad para crear y abrir 7zip, zip, tar, rar y otros archivos comprimidos. - -[Section.0415] -Description = Narzędzie do tworzenia i otwierania plików typu 7zip, zip, tar, i innych plików archiwizacyjnych. - -[Section.0422] -Description = Утиліта для створення та відкриття 7zip, zip, tar, rar та інших архівних файлів. +; UTF-8 + +[Section] +Name = 7-Zip +Version = 9.20 +Licence = LGPL +Description = Utility to create and open 7zip, zip, tar, rar and other archive files. +Size = 1.0M +Category = 12 +URLSite = http://www.7-zip.org/ +URLDownload = http://ovh.dl.sourceforge.net/project/sevenzip/7-Zip/9.20/7z920.exe +CDPath = none + +[Section.0407] +Description = Tool zum Erstellen und Öffnen von 7zip, zip, tar, rar und andrern Archiven. + +[Section.040a] +Description = Utilidad para crear y abrir 7zip, zip, tar, rar y otros archivos comprimidos. + +[Section.040c] +Description = Utilitaire pour créer et ouvrir les fichiers 7zip, zip, tar, rar et autres archives. + +[Section.0415] +Description = Narzędzie do tworzenia i otwierania plików typu 7zip, zip, tar, i innych plików archiwizacyjnych. + +[Section.0422] +Description = Утиліта для створення та відкриття 7zip, zip, tar, rar та інших архівних файлів. diff --git a/base/applications/rapps/rapps/abiword.txt b/base/applications/rapps/rapps/abiword.txt index 9ce5c9bb3c5..1660ba30d72 100644 --- a/base/applications/rapps/rapps/abiword.txt +++ b/base/applications/rapps/rapps/abiword.txt @@ -1,24 +1,27 @@ -; UTF-8 - -[Section] -Name = AbiWord -Version = 2.6.8 -Licence = GPL -Description = Word processor. -Size = 5.6MB -Category = 6 -URLSite = http://www.abisource.com/ -URLDownload = http://www.abisource.com/downloads/abiword/2.6.8/Windows/abiword-setup-2.6.8.exe -CDPath = none - -[Section.0407] -Description = Textverarbeitung. - -[Section.040a] -Description = Procesador de textos. - -[Section.0415] -Description = Edytor tekstu. - -[Section.0422] -Description = Текстовий процесор. +; UTF-8 + +[Section] +Name = AbiWord +Version = 2.6.8 +Licence = GPL +Description = Word processor. +Size = 5.6MB +Category = 6 +URLSite = http://www.abisource.com/ +URLDownload = http://www.abisource.com/downloads/abiword/2.6.8/Windows/abiword-setup-2.6.8.exe +CDPath = none + +[Section.0407] +Description = Textverarbeitung. + +[Section.040a] +Description = Procesador de textos. + +[Section.040c] +Description = Éditeur de texte. + +[Section.0415] +Description = Edytor tekstu. + +[Section.0422] +Description = Текстовий процесор. diff --git a/base/applications/rapps/rapps/abiword28x.txt b/base/applications/rapps/rapps/abiword28x.txt index 5a9b178efcf..ab3d57460a5 100644 --- a/base/applications/rapps/rapps/abiword28x.txt +++ b/base/applications/rapps/rapps/abiword28x.txt @@ -1,24 +1,27 @@ -; UTF-8 - -[Section] -Name = AbiWord -Version = 2.8.6 -Licence = GPL -Description = Word processor. -Size = 7.9MB -Category = 6 -URLSite = http://www.abisource.com/ -URLDownload = http://www.abisource.com/downloads/abiword/2.8.6/Windows/abiword-setup-2.8.6.exe -CDPath = none - -[Section.0407] -Description = Textverarbeitung. - -[Section.040a] -Description = Procesador de textos. - -[Section.0415] -Description = Edytor tekstu. - -[Section.0422] -Description = Текстовий процесор. +; UTF-8 + +[Section] +Name = AbiWord +Version = 2.8.6 +Licence = GPL +Description = Word processor. +Size = 7.9MB +Category = 6 +URLSite = http://www.abisource.com/ +URLDownload = http://www.abisource.com/downloads/abiword/2.8.6/Windows/abiword-setup-2.8.6.exe +CDPath = none + +[Section.0407] +Description = Textverarbeitung. + +[Section.040a] +Description = Procesador de textos. + +[Section.040c] +Description = Éditeur de texte. + +[Section.0415] +Description = Edytor tekstu. + +[Section.0422] +Description = Текстовий процесор. diff --git a/base/applications/rapps/rapps/abyss.txt b/base/applications/rapps/rapps/abyss.txt index 8959327b617..89e0d78ba54 100644 --- a/base/applications/rapps/rapps/abyss.txt +++ b/base/applications/rapps/rapps/abyss.txt @@ -1,23 +1,26 @@ -; UTF-8 - -[Section] -Name = Abyss Web server X1 -Version = 2.6 -Licence = Freeware -Description = Abyss Web Server enables you to host your Web sites on your computer. It supports secure SSL/TLS connections (HTTPS) as well as a wide range of Web technologies. It can also run advanced PHP, Perl, Python, ASP, ASP.NET, and Ruby on Rails Web applications, which can be backed by databases such as MySQL, SQLite, MS SQL Server, MS Access, or Oracle. -Size = 0.8M -Category = 5 -URLSite = http://www.aprelium.com/ -URLDownload = http://www.aprelium.com/data/abwsx1.exe -CDPath = none - -[Section.0407] -Description = Abyss Web Server ermöglicht es Webseiten auf Ihrem Computer zu hosten. Er unterstützt sichere SSL/TLS Verbindungen (HTTPS) sowie eine Vielfalt an Web Technologien. Er kann ebenfalls PHP, Perl, Python, ASP, ASP.NET, und Ruby on Rails Web Anwendungen ausführen, welche von Datenbanken, wie MySQL, SQLite, MS SQL Server, MS Access, oder Oracle unterstützt werden können. - -[Section.0415] -Description = Abyss Web Server pozwala Ci na stworzenie serwera WWW na własnym komputerze. Ten program obsługuje zabezpieczone połączenia typu SSL/TLS (HTTPS) i wiele technologii Sieci. -Może także uruchamiać zaawansowane aplikacje internetowe takie jak PHP, Perl, Python, ASP, ASP.NET, i Ruby on Rails. -Mogą one zostać oparte o MySQL, SQLite, MS SQL Server, MS Access, lub Oracle. - -[Section.0422] -Description = Abyss Web Server дозволить вам утримувати веб-сайти на вашому комп'ютері. Від підтримує безпечні SSL/TLS з'єднання (HTTPS) та великий ряд веб-технологій. Він також запускає PHP, Perl, Python, ASP, ASP.NET, та Ruby on Rails веб-додатки, які можуть підтримуватись такими базами даних, як MySQL, SQLite, MS SQL Server, MS Access, чи Oracle. +; UTF-8 + +[Section] +Name = Abyss Web server X1 +Version = 2.6 +Licence = Freeware +Description = Abyss Web Server enables you to host your Web sites on your computer. It supports secure SSL/TLS connections (HTTPS) as well as a wide range of Web technologies. It can also run advanced PHP, Perl, Python, ASP, ASP.NET, and Ruby on Rails Web applications, which can be backed by databases such as MySQL, SQLite, MS SQL Server, MS Access, or Oracle. +Size = 0.8M +Category = 5 +URLSite = http://www.aprelium.com/ +URLDownload = http://www.aprelium.com/data/abwsx1.exe +CDPath = none + +[Section.0407] +Description = Abyss Web Server ermöglicht es Webseiten auf Ihrem Computer zu hosten. Er unterstützt sichere SSL/TLS Verbindungen (HTTPS) sowie eine Vielfalt an Web Technologien. Er kann ebenfalls PHP, Perl, Python, ASP, ASP.NET, und Ruby on Rails Web Anwendungen ausführen, welche von Datenbanken, wie MySQL, SQLite, MS SQL Server, MS Access, oder Oracle unterstützt werden können. + +[Section.040c] +Description = Abyss Web Server vous permet d'héberger vos sites internet sur votre ordinateur. Il supporte les connexions sécurisées SSL/TLS (HTTPS) ainsi qu'un grand nombre de technologies web. Il peut également faire tourner des applications web PHP, Perl, Python, ASP, ASP.Net, Ruby et Ruby on Rails, qui peuvent être associées à des bases de données telles que MySQL, SQLite, MS SQL Server, MS Access ou Oracle. + +[Section.0415] +Description = Abyss Web Server pozwala Ci na stworzenie serwera WWW na własnym komputerze. Ten program obsługuje zabezpieczone połączenia typu SSL/TLS (HTTPS) i wiele technologii Sieci. +Może także uruchamiać zaawansowane aplikacje internetowe takie jak PHP, Perl, Python, ASP, ASP.NET, i Ruby on Rails. +Mogą one zostać oparte o MySQL, SQLite, MS SQL Server, MS Access, lub Oracle. + +[Section.0422] +Description = Abyss Web Server дозволить вам утримувати веб-сайти на вашому комп'ютері. Від підтримує безпечні SSL/TLS з'єднання (HTTPS) та великий ряд веб-технологій. Він також запускає PHP, Perl, Python, ASP, ASP.NET, та Ruby on Rails веб-додатки, які можуть підтримуватись такими базами даних, як MySQL, SQLite, MS SQL Server, MS Access, чи Oracle. diff --git a/base/applications/rapps/rapps/ac97forvirtualbox.txt b/base/applications/rapps/rapps/ac97forvirtualbox.txt index 8454b861282..d5d1b3a6da0 100644 --- a/base/applications/rapps/rapps/ac97forvirtualbox.txt +++ b/base/applications/rapps/rapps/ac97forvirtualbox.txt @@ -1,48 +1,54 @@ -; UTF-8 - -[Section] -Name = AC97 Driver for VirtualBox -Version = 5.10.00.3610 -Licence = Unknown -Description = Unzip in the "ReactOS" folder then restart ReactOS twice. -Size = 186kB -Category = 13 -URLSite = Unknown -URLDownload = http://svn.reactos.org/packages/ac97_vbox.exe -CDPath = none - -[Section.0405] -Name = Ovladač AC97 pro VirtualBox -Licence = Neznámá -Description = Rozbalte do složky "ReactOS" a pak ReactOS dvakrát restartujte. -URLSite = Neznámá - -[Section.0407] -Name = AC97 Treiber für VirtualBox -Licence = Unbekannt -Description = Entpacken in das "ReactOS"-Verzeichnis und ReactOS zweimal neustarten. -URLSite = Unbekannt - -[Section.040a] -Name = Driver AC97 para VirtualBox -Licence = Desconocida -Description = Descomprimir en la carpeta "Reactos" y reiniciar Reactos dos veces. -URLSite = Desconocida - -[Section.0415] -Name = Sterownik AC97 dla VirtualBox -Licence = Nieznana -Description = Rozpakuj zawartość w folderze "ReactOS" i dwukrotnie zrestartuj system. -URLSite = Nieznana - -[Section.0419] -Name = Драйвер AC97 для VirtualBox -Licence = Не указано -Description = Pазархивируйте содержимое в папку "ReactOS", затем дважды перезагрузите систему. -URLSite = Не указано - -[Section.0422] -Name = Драйвер AC97 для VirtualBox -Licence = Невідома -Description = Pозархівуйте вміст в теку "ReactOS" після чого двічі перезавантажте систему. -URLSite = Не вказано +; UTF-8 + +[Section] +Name = AC97 Driver for VirtualBox +Version = 5.10.00.3610 +Licence = Unknown +Description = Unzip in the "ReactOS" folder then restart ReactOS twice. +Size = 186kB +Category = 13 +URLSite = Unknown +URLDownload = http://svn.reactos.org/packages/ac97_vbox.exe +CDPath = none + +[Section.0405] +Name = Ovladač AC97 pro VirtualBox +Licence = Neznámá +Description = Rozbalte do složky "ReactOS" a pak ReactOS dvakrát restartujte. +URLSite = Neznámá + +[Section.0407] +Name = AC97 Treiber für VirtualBox +Licence = Unbekannt +Description = Entpacken in das "ReactOS"-Verzeichnis und ReactOS zweimal neustarten. +URLSite = Unbekannt + +[Section.040a] +Name = Driver AC97 para VirtualBox +Licence = Desconocida +Description = Descomprimir en la carpeta "Reactos" y reiniciar Reactos dos veces. +URLSite = Desconocida + +[Section.040c] +Name = Pilote AC97 pour VirtualBox +Licence = Inconnue +Description = Décompresser dans le dossier "ReactOS" puis redémarrer ReactOS deux fois. +URLSite = Inconnue + +[Section.0415] +Name = Sterownik AC97 dla VirtualBox +Licence = Nieznana +Description = Rozpakuj zawartość w folderze "ReactOS" i dwukrotnie zrestartuj system. +URLSite = Nieznana + +[Section.0419] +Name = Драйвер AC97 для VirtualBox +Licence = Не указано +Description = Pазархивируйте содержимое в папку "ReactOS", затем дважды перезагрузите систему. +URLSite = Не указано + +[Section.0422] +Name = Драйвер AC97 для VirtualBox +Licence = Невідома +Description = Pозархівуйте вміст в теку "ReactOS" після чого двічі перезавантажте систему. +URLSite = Не вказано diff --git a/base/applications/rapps/rapps/audiograbber.txt b/base/applications/rapps/rapps/audiograbber.txt index 69aeee9926b..5f8ed5c0bf4 100644 --- a/base/applications/rapps/rapps/audiograbber.txt +++ b/base/applications/rapps/rapps/audiograbber.txt @@ -1,24 +1,27 @@ -; UTF-8 - -[Section] -Name = Audio Grabber -Version = 1.83 SE -Licence = Freeware -Description = A very good CD Ripper/Audio File Converter. -Size = 1.6MB -Category = 1 -URLSite = http://www.audiograbber.de/ -URLDownload = http://www.audiograbber.de/files/4898276276/agsetup183se.exe -CDPath = none - -[Section.0407] -Description = Ein sehr guter CD-Ripper/Audio-Datei-Konverter. - -[Section.040a] -Description = Un buen CD Ripper/ conversor de archivos de audio. - -[Section.0415] -Description = Bardzo dobry CD Ripper/konwerter plików audio. - -[Section.0422] -Description = Чудовий CD Ріппер/Конвертер аудіо файлів. +; UTF-8 + +[Section] +Name = Audio Grabber +Version = 1.83 SE +Licence = Freeware +Description = A very good CD Ripper/Audio File Converter. +Size = 1.6MB +Category = 1 +URLSite = http://www.audiograbber.de/ +URLDownload = http://www.audiograbber.de/files/4898276276/agsetup183se.exe +CDPath = none + +[Section.0407] +Description = Ein sehr guter CD-Ripper/Audio-Datei-Konverter. + +[Section.040a] +Description = Un buen CD Ripper/ conversor de archivos de audio. + +[Section.040c] +Description = Un très bon extracteur de CD/convertisseur de fichier audio. + +[Section.0415] +Description = Bardzo dobry CD Ripper/konwerter plików audio. + +[Section.0422] +Description = Чудовий CD Ріппер/Конвертер аудіо файлів. diff --git a/base/applications/rapps/rapps/comctl32ocx.txt b/base/applications/rapps/rapps/comctl32ocx.txt index 392e8faf26c..b0aac593814 100644 --- a/base/applications/rapps/rapps/comctl32ocx.txt +++ b/base/applications/rapps/rapps/comctl32ocx.txt @@ -1,28 +1,32 @@ -; UTF-8 - -[Section] -Name = Microsoft Visual Basic 6.0 Common Controls -Version = 6.0 -Licence = Unknown -Description = File needed by some applications. -Size = 914kB -Category = 14 -URLSite = http://www.microsoft.com/downloads/details.aspx?FamilyID=25437D98-51D0-41C1-BB14-64662F5F62FE&displaylang=en -URLDownload = http://download.microsoft.com/download/3/a/5/3a5925ac-e779-4b1c-bb01-af67dc2f96fc/VisualBasic6-KB896559-v1-ENU.exe -CDPath = none - -[Section.0407] -Licence = Unbekannt -Description = Datei wird von einigen Anwendungen benötigt. - -[Section.040a] -Licence = Desconocida -Description = X es necesario para varias aplicaciones. - -[Section.0415] -Licence = Nieznana -Description = Microsoft Visual Basic 6.0 Common Controls jest używany przez część aplikacji. - -[Section.0422] -Licence = Невідома -Description = Файл потрібен декотрим програмам. +; UTF-8 + +[Section] +Name = Microsoft Visual Basic 6.0 Common Controls +Version = 6.0 +Licence = Unknown +Description = File needed by some applications. +Size = 914kB +Category = 14 +URLSite = http://www.microsoft.com/downloads/details.aspx?FamilyID=25437D98-51D0-41C1-BB14-64662F5F62FE&displaylang=en +URLDownload = http://download.microsoft.com/download/3/a/5/3a5925ac-e779-4b1c-bb01-af67dc2f96fc/VisualBasic6-KB896559-v1-ENU.exe +CDPath = none + +[Section.0407] +Licence = Unbekannt +Description = Datei wird von einigen Anwendungen benötigt. + +[Section.040a] +Licence = Desconocida +Description = X es necesario para varias aplicaciones. + +[Section.040c] +Licence = Inconnue +Description = Fichier nécessaire pour certaines applications. + +[Section.0415] +Licence = Nieznana +Description = Microsoft Visual Basic 6.0 Common Controls jest używany przez część aplikacji. + +[Section.0422] +Licence = Невідома +Description = Файл потрібен декотрим програмам. diff --git a/base/applications/rapps/rapps/diablo2.txt b/base/applications/rapps/rapps/diablo2.txt index df11f7be0a5..43c9d50fe92 100644 --- a/base/applications/rapps/rapps/diablo2.txt +++ b/base/applications/rapps/rapps/diablo2.txt @@ -1,24 +1,27 @@ -; UTF-8 - -[Section] -Name = Diablo II -Version = 1.4 -Licence = Shareware -Description = Diablo 2 Shareware. zeckensack's glide wrapper is required to run it. -Size = 132MB -Category = 4 -URLSite = http://www.blizzard.com/diablo2/ -URLDownload = http://pub.zoneofgames.ru/demos/diabloiidemo.exe -CDPath = none - -[Section.0407] -Description = Diablo 2 Shareware. zeckensacks glide wrapper wird zum Ausführen benötigt. - -[Section.040a] -Description = Diablo 2 Shareware. zeckensack's glide wrapper es necesario para su ejecución. - -[Section.0415] -Description = Diablo 2 Shareware. Do poprawnego działania wymagany jest zainstalowany zeckensacks glide wrapper. - -[Section.0422] -Description = Diablo 2 Shareware. Для запуску потрібен zeckensack's glide wrapper. +; UTF-8 + +[Section] +Name = Diablo II +Version = 1.4 +Licence = Shareware +Description = Diablo 2 Shareware. zeckensack's glide wrapper is required to run it. +Size = 132MB +Category = 4 +URLSite = http://www.blizzard.com/diablo2/ +URLDownload = http://pub.zoneofgames.ru/demos/diabloiidemo.exe +CDPath = none + +[Section.0407] +Description = Diablo 2 Shareware. zeckensacks glide wrapper wird zum Ausführen benötigt. + +[Section.040a] +Description = Diablo 2 Shareware. zeckensack's glide wrapper es necesario para su ejecución. + +[Section.040c] +Description = Diablo 2 Shareware. zeckensack's glide wrapper est requis pour le faire tourner. + +[Section.0415] +Description = Diablo 2 Shareware. Do poprawnego działania wymagany jest zainstalowany zeckensacks glide wrapper. + +[Section.0422] +Description = Diablo 2 Shareware. Для запуску потрібен zeckensack's glide wrapper. diff --git a/base/applications/rapps/rapps/dosblaster.txt b/base/applications/rapps/rapps/dosblaster.txt index a499b7a956c..022294c295b 100644 --- a/base/applications/rapps/rapps/dosblaster.txt +++ b/base/applications/rapps/rapps/dosblaster.txt @@ -1,24 +1,27 @@ -; UTF-8 - -[Section] -Name = DosBlaster -Version = 2.5 -Licence = GPL -Description = DosBlaster is a Shell extension which makes it possible to open any DOS executabe in DOSBox via right click. This version contains DOSBox 0.70, but can be simply updated by installing a newer DOSBox into the DosBlaster folders. -Size = 2.1MB -Category = 15 -URLSite = http://dosblaster.sourceforge.net/ -URLDownload = http://surfnet.dl.sourceforge.net/project/dosblaster/DosBlaster%202.5%20%28x86%29/Downloads/DosbasterSetup_2_5.exe -CDPath = none - -[Section.0407] -Description = DosBlaster ist eine Shell Extension, die es ermöglicht jede DOS Anwendung via Rechtsklick in DOSBox zu öffnen. Diese Version beinhaltet DOSBox 0.70, kann aber sehr einfach aktualisiert werden, indem man ein neueres DOSBox in die DosBlaster Ordner installiert. - -[Section.040a] -Description = DosBlaster en una extensión Shell que permite abrir cualquier ejecutable DOS en DOSBox desde el botón derecho del ratón. Esta versión contiene DOSBox 0.70, pero puede ser actualizado facilmente instalando una nueva versión de DOSBox en la carpeta de DosBlaster. - -[Section.0415] -Description = DosBlaster to rozszerzenie powłoki, które umożliwia otwarcie każdego DOS-owego pliku wykonywalnego w DOSBox za pomocą prawego klawisza myszki. Ta wersja zawiera DosBox 0.70, ale można go łatwo zaktualizować, instalując nowszą wersje DOSBox do folderów DosBlaster. - -[Section.0422] -Description = DosBlaster це розширення оболонки, яке дозволяє запустити будь-який виконавчий файл DOS в DOSBox через правий клік. Ця версія містить DOSBox 0.70, але може бути оновлена встановленням новішої версії DOSBox в теки DosBlaster. +; UTF-8 + +[Section] +Name = DosBlaster +Version = 2.5 +Licence = GPL +Description = DosBlaster is a Shell extension which makes it possible to open any DOS executabe in DOSBox via right click. This version contains DOSBox 0.70, but can be simply updated by installing a newer DOSBox into the DosBlaster folders. +Size = 2.1MB +Category = 15 +URLSite = http://dosblaster.sourceforge.net/ +URLDownload = http://surfnet.dl.sourceforge.net/project/dosblaster/DosBlaster%202.5%20%28x86%29/Downloads/DosbasterSetup_2_5.exe +CDPath = none + +[Section.0407] +Description = DosBlaster ist eine Shell Extension, die es ermöglicht jede DOS Anwendung via Rechtsklick in DOSBox zu öffnen. Diese Version beinhaltet DOSBox 0.70, kann aber sehr einfach aktualisiert werden, indem man ein neueres DOSBox in die DosBlaster Ordner installiert. + +[Section.040a] +Description = DosBlaster en una extensión Shell que permite abrir cualquier ejecutable DOS en DOSBox desde el botón derecho del ratón. Esta versión contiene DOSBox 0.70, pero puede ser actualizado facilmente instalando una nueva versión de DOSBox en la carpeta de DosBlaster. + +[Section.040c] +Description = DosBlaster est une extension Shell qui permet d'ouvrir n'importe quel exécutable DOS dans DOSBox via un click droit. Cette version contient DOSBox 0.70 mais peut être simplement mise à jour en installant une nouvelle version de DOSBox dans les répertoires de DosBlaster. + +[Section.0415] +Description = DosBlaster to rozszerzenie powłoki, które umożliwia otwarcie każdego DOS-owego pliku wykonywalnego w DOSBox za pomocą prawego klawisza myszki. Ta wersja zawiera DosBox 0.70, ale można go łatwo zaktualizować, instalując nowszą wersje DOSBox do folderów DosBlaster. + +[Section.0422] +Description = DosBlaster це розширення оболонки, яке дозволяє запустити будь-який виконавчий файл DOS в DOSBox через правий клік. Ця версія містить DOSBox 0.70, але може бути оновлена встановленням новішої версії DOSBox в теки DosBlaster. diff --git a/base/applications/rapps/rapps/dosbox.txt b/base/applications/rapps/rapps/dosbox.txt index 4d437c7c6ba..3c10329fab5 100644 --- a/base/applications/rapps/rapps/dosbox.txt +++ b/base/applications/rapps/rapps/dosbox.txt @@ -1,24 +1,27 @@ -; UTF-8 - -[Section] -Name = DOSBox -Version = 0.74 -Licence = GPL -Description = DOSBox is a DOS emulator. -Size = 1.4MB -Category = 15 -URLSite = http://www.dosbox.com/ -URLDownload = http://ovh.dl.sourceforge.net/project/dosbox/dosbox/0.74/DOSBox0.74-win32-installer.exe -CDPath = none - -[Section.0407] -Description = DOSBox ist ein DOS Emulator. - -[Section.040a] -Description = DOSBox es un emulador de DOS. - -[Section.0415] -Description = DOSBox - emulator DOSa. - -[Section.0422] -Description = DOSBox - емулятор DOSу. +; UTF-8 + +[Section] +Name = DOSBox +Version = 0.74 +Licence = GPL +Description = DOSBox is a DOS emulator. +Size = 1.4MB +Category = 15 +URLSite = http://www.dosbox.com/ +URLDownload = http://ovh.dl.sourceforge.net/project/dosbox/dosbox/0.74/DOSBox0.74-win32-installer.exe +CDPath = none + +[Section.0407] +Description = DOSBox ist ein DOS Emulator. + +[Section.040a] +Description = DOSBox es un emulador de DOS. + +[Section.040c] +Description = DOSBox est un émulateur DOS. + +[Section.0415] +Description = DOSBox - emulator DOSa. + +[Section.0422] +Description = DOSBox - емулятор DOSу. diff --git a/base/applications/rapps/rapps/fap.txt b/base/applications/rapps/rapps/fap.txt index 0132c7ad621..420e1cffa19 100644 --- a/base/applications/rapps/rapps/fap.txt +++ b/base/applications/rapps/rapps/fap.txt @@ -1,21 +1,24 @@ -; UTF-8 - -[Section] -Name = Fox Audio Player -Version = 0.8.3 -Licence = GPL -Description = Simple and lightweight audio player. -Size = 1.85MB -Category = 1 -URLSite = http://foxaudioplayer.sourceforge.net/ -URLDownload = http://svn.reactos.org/packages/fap-0.8.3-win32-bin.exe -CDPath = none - -[Section.0407] -Description = Kleiner und einfacher Mediaplayer. - -[Section.0415] -Description = Prosty i lekki odtwarzacz audio. - -[Section.0422] -Description = Простий та маленький програвач аудіо файлів. +; UTF-8 + +[Section] +Name = Fox Audio Player +Version = 0.8.3 +Licence = GPL +Description = Simple and lightweight audio player. +Size = 1.85MB +Category = 1 +URLSite = http://foxaudioplayer.sourceforge.net/ +URLDownload = http://svn.reactos.org/packages/fap-0.8.3-win32-bin.exe +CDPath = none + +[Section.0407] +Description = Kleiner und einfacher Mediaplayer. + +[Section.040c] +Description = Lecteur audio simple et léger. + +[Section.0415] +Description = Prosty i lekki odtwarzacz audio. + +[Section.0422] +Description = Простий та маленький програвач аудіо файлів. diff --git a/base/applications/rapps/rapps/firefox2.txt b/base/applications/rapps/rapps/firefox2.txt index ddb07405697..816bf597e62 100644 --- a/base/applications/rapps/rapps/firefox2.txt +++ b/base/applications/rapps/rapps/firefox2.txt @@ -1,36 +1,52 @@ -; UTF-8 - -[Section] -Name = Mozilla Firefox 2.0 -Version = 2.0.0.20 -Licence = MPL/GPL/LGPL -Description = The most popular and one of the best free Web Browsers out there. -Size = 5.8M -Category = 5 -URLSite = http://www.mozilla.com/en-US/ -URLDownload = http://svn.reactos.org/packages/Firefox%20Setup%202.0.0.20.exe -CDPath = none - -[Section.0405] -Description = Nejpopulárnější a jeden z nejlepších svobodných webových prohlížečů. -Size = 5.5M -URLSite = http://www.mozilla-europe.org/cs/ -URLDownload = http://194.71.11.70/pub/www/clients/mozilla.org/firefox/releases/2.0.0.20/win32/cs/Firefox%20Setup%202.0.0.20.exe - -[Section.0407] -Description = Der populärste und einer der besten freien Webbrowser. - -[Section.040a] -Description = El más popular y uno de los mejores navegadores web gratuitos que hay. - -[Section.0414] -Description = Mest populære og best også gratis nettleserene der ute. - -[Section.0415] -Description = Najpopularniejsza i jedna z najlepszych darmowych przeglądarek internetowych. - -[Section.0419] -Description = Один из самых популярных и лучших бесплатных браузеров. - -[Section.0422] -Description = Найпопулярніший та один з кращих безплатних веб-браузерів. +; UTF-8 + +[Section] +Name = Mozilla Firefox 2.0 +Version = 2.0.0.20 +Licence = MPL/GPL/LGPL +Description = The most popular and one of the best free Web Browsers out there. +Size = 5.8M +Category = 5 +URLSite = http://www.mozilla.com/en-US/ +URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/2.0.0.20/win32/en-US/Firefox%20Setup%202.0.0.20.exe +CDPath = none + +[Section.0405] +Description = Nejpopulárnější a jeden z nejlepších svobodných webových prohlížečů. +URLSite = http://www.mozilla-europe.org/cs/ +URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/2.0.0.20/win32/cs/Firefox%20Setup%202.0.0.20.exe + +[Section.0407] +Description = Der populärste und einer der besten freien Webbrowser. +URLSite = http://www.mozilla-europe.org/de/ +URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/2.0.0.20/win32/de/Firefox%20Setup%202.0.0.20.exe + +[Section.040a] +Description = El más popular y uno de los mejores navegadores web gratuitos que hay. +URLSite = http://www.mozilla-europe.org/es/ +URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/2.0.0.20/win32/es-ES/Firefox%20Setup%202.0.0.20.exe + +[Section.040c] +Description = Le navigateur web gratuit le plus populaire et l'un des meilleurs. +URLSite = http://www.mozilla-europe.org/fr/ +URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/2.0.0.20/win32/fr/Firefox%20Setup%202.0.0.20.exe + +[Section.0414] +Description = Mest populære og best også gratis nettleserene der ute. +URLSite = http://www.mozilla-europe.org/no/ +URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/2.0.0.20/win32/nb-NO/Firefox%20Setup%202.0.0.20.exe + +[Section.0415] +Description = Najpopularniejsza i jedna z najlepszych darmowych przeglądarek internetowych. +URLSite = http://www.mozilla-europe.org/pl/ +URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/2.0.0.20/win32/pl/Firefox%20Setup%202.0.0.20.exe + +[Section.0419] +Description = Один из самых популярных и лучших бесплатных браузеров. +URLSite = http://www.mozilla-europe.org/ru/ +URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/2.0.0.20/win32/ru/Firefox%20Setup%202.0.0.20.exe + +[Section.0422] +Description = Найпопулярніший та один з кращих безплатних веб-браузерів. +URLSite = http://www.mozilla-europe.org/uk/ +URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/2.0.0.20/win32/uk/Firefox%20Setup%202.0.0.20.exe diff --git a/base/applications/rapps/rapps/firefox3.txt b/base/applications/rapps/rapps/firefox3.txt index 9db19037cf9..76855309d81 100644 --- a/base/applications/rapps/rapps/firefox3.txt +++ b/base/applications/rapps/rapps/firefox3.txt @@ -1,54 +1,59 @@ -; UTF-8 - -[Section] -Name = Mozilla Firefox 3.0 -Version = 3.0.19 -Licence = MPL/GPL/LGPL -Description = The most popular and one of the best free Web Browsers out there. -Size = 7.2M -Category = 5 -URLSite = http://www.mozilla.com/en-US/ -URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.0.19-real-real/win32/en-US/Firefox%20Setup%203.0.19.exe -CDPath = none - -[Section.0405] -Description = Nejpopulárnější a jeden z nejlepších svobodných webových prohlížečů. -Size = 7.0M -URLSite = http://www.mozilla-europe.org/cs/ -URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.0.19-real-real/win32/cs/Firefox%20Setup%203.0.19.exe - -[Section.0407] -Description = Der populärste und einer der besten freien Webbrowser. -Size = 7.0M -URLSite = http://www.mozilla-europe.org/de/ -URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.0.19-real-real/win32/de/Firefox%20Setup%203.0.19.exe - -[Section.040a] -Description = El más popular y uno de los mejores navegadores web gratuitos que hay. -Size = 7.0M -URLSite = http://www.mozilla-europe.org/es/ -URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.0.19-real-real/win32/es-ES/Firefox%20Setup%203.0.19.exe - -[Section.0414] -Description = Mest populære og best også gratis nettleserene der ute. -Size = 7.0M -URLSite = http://www.mozilla-europe.org/no/ -URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.0.19-real-real/win32/nb-NO/Firefox%20Setup%203.0.19.exe - -[Section.0415] -Description = Najpopularniejsza i jedna z najlepszych darmowych przeglądarek internetowych. -Size = 7.8M -URLSite = http://www.mozilla-europe.org/pl/ -URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.0.19-real-real/win32/pl/Firefox%20Setup%203.0.19.exe - -[Section.0419] -Description = Один из самых популярных и лучших бесплатных браузеров. -Size = 7.4M -URLSite = http://www.mozilla-europe.org/ru/ -URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.0.19-real-real/win32/ru/Firefox%20Setup%203.0.19.exe - -[Section.0422] -Description = Найпопулярніший та один з кращих безплатних веб-браузерів. -Size = 7.3M -URLSite = http://www.mozilla-europe.org/uk/ -URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.0.19-real-real/win32/uk/Firefox%20Setup%203.0.19.exe +; UTF-8 + +[Section] +Name = Mozilla Firefox 3.0 +Version = 3.0.19 +Licence = MPL/GPL/LGPL +Description = The most popular and one of the best free Web Browsers out there. +Size = 7.2M +Category = 5 +URLSite = http://www.mozilla.com/en-US/ +URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/3.0.19-real-real/win32/en-US/Firefox%20Setup%203.0.19.exe +CDPath = none + +[Section.0405] +Description = Nejpopulárnější a jeden z nejlepších svobodných webových prohlížečů. +Size = 7.0M +URLSite = http://www.mozilla-europe.org/cs/ +URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/3.0.19-real-real/win32/cs/Firefox%20Setup%203.0.19.exe + +[Section.0407] +Description = Der populärste und einer der besten freien Webbrowser. +Size = 7.0M +URLSite = http://www.mozilla-europe.org/de/ +URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/3.0.19-real-real/win32/de/Firefox%20Setup%203.0.19.exe + +[Section.040a] +Description = El más popular y uno de los mejores navegadores web gratuitos que hay. +Size = 7.0M +URLSite = http://www.mozilla-europe.org/es/ +URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/3.0.19-real-real/win32/es-ES/Firefox%20Setup%203.0.19.exe + +[Section.040c] +Description = Le navigateur web gratuit le plus populaire et l'un des meilleurs. +URLSite = http://www.mozilla-europe.org/fr/ +URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/3.0.19-real-real/win32/fr/Firefox%20Setup%203.0.19.exe + +[Section.0414] +Description = Mest populære og best også gratis nettleserene der ute. +Size = 7.0M +URLSite = http://www.mozilla-europe.org/no/ +URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/3.0.19-real-real/win32/nb-NO/Firefox%20Setup%203.0.19.exe + +[Section.0415] +Description = Najpopularniejsza i jedna z najlepszych darmowych przeglądarek internetowych. +Size = 7.9M +URLSite = http://www.mozilla-europe.org/pl/ +URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/3.0.19-real-real/win32/pl/Firefox%20Setup%203.0.19.exe + +[Section.0419] +Description = Один из самых популярных и лучших бесплатных браузеров. +Size = 7.8M +URLSite = http://www.mozilla-europe.org/ru/ +URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/3.0.19-real-real/win32/ru/Firefox%20Setup%203.0.19.exe + +[Section.0422] +Description = Найпопулярніший та один з кращих безплатних веб-браузерів. +Size = 7.4M +URLSite = http://www.mozilla-europe.org/uk/ +URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/3.0.19-real-real/win32/uk/Firefox%20Setup%203.0.19.exe diff --git a/base/applications/rapps/rapps/firefox36.txt b/base/applications/rapps/rapps/firefox36.txt index cb035e8fc21..d8a96e71e56 100644 --- a/base/applications/rapps/rapps/firefox36.txt +++ b/base/applications/rapps/rapps/firefox36.txt @@ -1,48 +1,54 @@ -; UTF-8 - -[Section] -Name = Mozilla Firefox 3.6 -Version = 3.6.13 -Licence = MPL/GPL/LGPL -Description = The most popular and one of the best free Web Browsers out there. -Size = 8.1M -Category = 5 -URLSite = http://www.mozilla.com/en-US/ -URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.6.13/win32/en-US/Firefox%20Setup%203.6.13.exe -CDPath = none - -[Section.0407] -Description = Der populärste und einer der besten freien Webbrowser. -Size = 8.0M -URLSite = http://www.mozilla-europe.org/de/ -URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.6.13/win32/de/Firefox%20Setup%203.6.13.exe - -[Section.040a] -Description = El más popular y uno de los mejores navegadores web gratuitos que hay. -Size = 8.0M -URLSite = http://www.mozilla-europe.org/es/ -URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.6.13/win32/es-ES/Firefox%20Setup%203.6.13.exe - -[Section.0414] -Description = Mest populære og best også gratis nettleserene der ute. -Size = 8.0M -URLSite = http://www.mozilla-europe.org/no/ -URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.6.13/win32/nb-NO/Firefox%20Setup%203.6.13.exe - -[Section.0415] -Description = Najpopularniejsza i jedna z najlepszych darmowych przeglądarek internetowych. -Size = 8.8M -URLSite = http://www.mozilla-europe.org/pl/ -URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.6.13/win32/pl/Firefox%20Setup%203.6.13.exe - -[Section.0419] -Description = Один из самых популярных и лучших бесплатных браузеров. -Size = 8.4M -URLSite = http://www.mozilla-europe.org/ru/ -URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.6.13/win32/ru/Firefox%20Setup%203.6.13.exe - -[Section.0422] -Description = Найпопулярніший та один з кращих безплатних веб-браузерів. -Size = 8.4M -URLSite = http://www.mozilla-europe.org/uk/ -URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.6.13/win32/uk/Firefox%20Setup%203.6.13.exe +; UTF-8 + +[Section] +Name = Mozilla Firefox 3.6 +Version = 3.6.15 +Licence = MPL/GPL/LGPL +Description = The most popular and one of the best free Web Browsers out there. +Size = 8.2M +Category = 5 +URLSite = http://www.mozilla.com/en-US/ +URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/3.6.15/win32/en-US/Firefox%20Setup%203.6.15.exe +CDPath = none + +[Section.0407] +Description = Der populärste und einer der besten freien Webbrowser. +Size = 8.1M +URLSite = http://www.mozilla-europe.org/de/ +URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/3.6.15/win32/de/Firefox%20Setup%203.6.15.exe + +[Section.040a] +Description = El más popular y uno de los mejores navegadores web gratuitos que hay. +Size = 8.1M +URLSite = http://www.mozilla-europe.org/es/ +URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/3.6.15/win32/es-ES/Firefox%20Setup%203.6.15.exe + +[Section.040c] +Description = Le navigateur web gratuit le plus populaire et l'un des meilleurs. +Size = 8.1M +URLSite = http://www.mozilla-europe.org/fr/ +URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/3.6.15/win32/fr/Firefox%20Setup%203.6.15.exe + +[Section.0414] +Description = Mest populære og best også gratis nettleserene der ute. +Size = 8.1M +URLSite = http://www.mozilla-europe.org/no/ +URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/3.6.15/win32/nb-NO/Firefox%20Setup%203.6.15.exe + +[Section.0415] +Description = Najpopularniejsza i jedna z najlepszych darmowych przeglądarek internetowych. +Size = 8.9M +URLSite = http://www.mozilla-europe.org/pl/ +URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/3.6.15/win32/pl/Firefox%20Setup%203.6.15.exe + +[Section.0419] +Description = Один из самых популярных и лучших бесплатных браузеров. +Size = 8.5M +URLSite = http://www.mozilla-europe.org/ru/ +URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/3.6.15/win32/ru/Firefox%20Setup%203.6.15.exe + +[Section.0422] +Description = Найпопулярніший та один з кращих безплатних веб-браузерів. +Size = 8.5M +URLSite = http://www.mozilla-europe.org/uk/ +URLDownload = ftp://ftp.mozilla.org/pub/firefox/releases/3.6.15/win32/uk/Firefox%20Setup%203.6.15.exe diff --git a/base/applications/rapps/rapps/freebasic.txt b/base/applications/rapps/rapps/freebasic.txt index 97759aa8a41..616b90384b4 100644 --- a/base/applications/rapps/rapps/freebasic.txt +++ b/base/applications/rapps/rapps/freebasic.txt @@ -1,24 +1,27 @@ -; UTF-8 - -[Section] -Name = FreeBASIC -Version = 0.21.1 -Licence = GPL/LGPL -Description = Open Source BASIC Compiler. The BASIC syntax is compatible to QBASIC. -Size = 5.9MB -Category = 7 -URLSite = http://www.freebasic.net/ -URLDownload = http://freefr.dl.sourceforge.net/project/fbc/Binaries%20-%20Windows/FreeBASIC%200.21.1/FreeBASIC-0.21.1-win32.exe -CDPath = none - -[Section.0407] -Description = Open Source BASIC Compiler. Die BASIC Syntax ist kompatibel zu QBASIC. - -[Section.040a] -Description = Compilador BASIC de código abierto. El lenguaje BASIC es compatible con QBASIC. - -[Section.0415] -Description = Otwarty kompilator BASIC, ze składnią kompatybilną z QBASIC. - -[Section.0422] -Description = Відкритий компілятор BASIC. Синтаксис сумісний з QBASIC. +; UTF-8 + +[Section] +Name = FreeBASIC +Version = 0.21.1 +Licence = GPL/LGPL +Description = Open Source BASIC Compiler. The BASIC syntax is compatible to QBASIC. +Size = 5.9MB +Category = 7 +URLSite = http://www.freebasic.net/ +URLDownload = http://freefr.dl.sourceforge.net/project/fbc/Binaries%20-%20Windows/FreeBASIC%200.21.1/FreeBASIC-0.21.1-win32.exe +CDPath = none + +[Section.0407] +Description = Open Source BASIC Compiler. Die BASIC Syntax ist kompatibel zu QBASIC. + +[Section.040a] +Description = Compilador BASIC de código abierto. El lenguaje BASIC es compatible con QBASIC. + +[Section.040c] +Description = Compilateur BASIC open source. La syntaxe du BASIC est compatible avec le QBASIC. + +[Section.0415] +Description = Otwarty kompilator BASIC, ze składnią kompatybilną z QBASIC. + +[Section.0422] +Description = Відкритий компілятор BASIC. Синтаксис сумісний з QBASIC. diff --git a/base/applications/rapps/rapps/glidewrapzbag.txt b/base/applications/rapps/rapps/glidewrapzbag.txt index 7870fbe4f98..e8024abfca8 100644 --- a/base/applications/rapps/rapps/glidewrapzbag.txt +++ b/base/applications/rapps/rapps/glidewrapzbag.txt @@ -1,24 +1,27 @@ -; UTF-8 - -[Section] -Name = GlidewrapZbag -Version = 0.84c -Licence = Freeware -Description = glidewrapper needed to run Diablo 2 on ReactOS. -Size = 249kB -Category = 3 -URLSite = http://www.zeckensack.de/glide/index.html -URLDownload = http://www.zeckensack.de/glide/archive/GlideWrapper084c.exe -CDPath = none - -[Section.0407] -Description = glidewrapper ist erforderlich um Diablo2 in ReactOS auszuführen. - -[Section.040a] -Description = glidewrapper es necesario para ejecutar Diablo 2 en ReactOS. - -[Section.0415] -Description = glidewrapper jest potrzebny do uruchomienia Diablo2 w ReactOS-ie. - -[Section.0422] -Description = glidewrapper необхідний для запуску Diablo2 в ReactOS. +; UTF-8 + +[Section] +Name = GlidewrapZbag +Version = 0.84c +Licence = Freeware +Description = glidewrapper needed to run Diablo 2 on ReactOS. +Size = 249kB +Category = 3 +URLSite = http://www.zeckensack.de/glide/index.html +URLDownload = http://www.zeckensack.de/glide/archive/GlideWrapper084c.exe +CDPath = none + +[Section.0407] +Description = glidewrapper ist erforderlich um Diablo2 in ReactOS auszuführen. + +[Section.040a] +Description = glidewrapper es necesario para ejecutar Diablo 2 en ReactOS. + +[Section.040c] +Description = glidewrapper est nécessaire pour faire tourner Diablo 2 dans ReactOS. + +[Section.0415] +Description = glidewrapper jest potrzebny do uruchomienia Diablo2 w ReactOS-ie. + +[Section.0422] +Description = glidewrapper необхідний для запуску Diablo2 в ReactOS. diff --git a/base/applications/rapps/rapps/go-oo.txt b/base/applications/rapps/rapps/go-oo.txt index 39dbe608ad5..28e9fa68f1a 100644 --- a/base/applications/rapps/rapps/go-oo.txt +++ b/base/applications/rapps/rapps/go-oo.txt @@ -1,24 +1,27 @@ -; UTF-8 - -[Section] -Name = Go-OO -Version = 3.2.1-11 -Licence = LGPL -Description = Open Source Office Suite, based on Open Office, but way better. -Size = 181.0MB -Category = 6 -URLSite = http://www.go-oo.org/ -URLDownload = http://go-oo.mirrorbrain.org/stable/win32/3.2.1/GoOo-3.2.1-11.exe -CDPath = none - -[Section.0407] -Description = Open Source Office Suite, basierend auf Open Office, aber viel besser. - -[Section.040a] -Description = La suite de ofimática de código abierto. - -[Section.0415] -Description = Otwarty pakiet biurowy, bazujący na Open Office, ale znacznie lepszy. - -[Section.0422] -Description = Відкритий офісний пакет. +; UTF-8 + +[Section] +Name = Go-OO +Version = 3.2.1-11 +Licence = LGPL +Description = Open Source Office Suite, based on Open Office, but way better. +Size = 181.0MB +Category = 6 +URLSite = http://www.go-oo.org/ +URLDownload = http://go-oo.mirrorbrain.org/stable/win32/3.2.1/GoOo-3.2.1-11.exe +CDPath = none + +[Section.0407] +Description = Open Source Office Suite, basierend auf Open Office, aber viel besser. + +[Section.040a] +Description = La suite de ofimática de código abierto. + +[Section.040c] +Description = Suite bureautique open source basée sur Open Office, mais bien meilleure. + +[Section.0415] +Description = Otwarty pakiet biurowy, bazujący na Open Office, ale znacznie lepszy. + +[Section.0422] +Description = Відкритий офісний пакет. diff --git a/base/applications/rapps/rapps/irfanview.txt b/base/applications/rapps/rapps/irfanview.txt index 0edc06bfe38..044d478cef0 100644 --- a/base/applications/rapps/rapps/irfanview.txt +++ b/base/applications/rapps/rapps/irfanview.txt @@ -1,28 +1,32 @@ -; UTF-8 - -[Section] -Name = IrfanView -Version = 4.28 -Licence = Freeware (for personal use) -Description = Viewer for all kinds of graphics/audio files/video files. -Size = 1.3MB -Category = 3 -URLSite = http://www.irfanview.com/ -URLDownload = http://irfanview.tuwien.ac.at/iview428_setup.exe -CDPath = none - -[Section.0407] -Licence = Freeware für nichtkommerzielle Nutzung -Description = Anzeigeprogramm für alle Arten von Grafik-/Audio- oder Video-Dateien. - -[Section.040a] -Licence = Gratuito (para uso personal) -Description = Visor para toda clase de archivos de imagen,audio y video. - -[Section.0415] -Licence = Freeware (dla użytku domowego) -Description = Przeglądarka dla bardzo wielu typów obrazów, plików audio oraz wideo. - -[Section.0422] -Licence = Freeware (для домашнього використання) -Description = Переглядач для всіх видів графічних та аудіо/відео файлів. +; UTF-8 + +[Section] +Name = IrfanView +Version = 4.28 +Licence = Freeware (for personal use) +Description = Viewer for all kinds of graphics/audio files/video files. +Size = 1.3MB +Category = 3 +URLSite = http://www.irfanview.com/ +URLDownload = http://irfanview.tuwien.ac.at/iview428_setup.exe +CDPath = none + +[Section.0407] +Licence = Freeware für nichtkommerzielle Nutzung +Description = Anzeigeprogramm für alle Arten von Grafik-/Audio- oder Video-Dateien. + +[Section.040a] +Licence = Gratuito (para uso personal) +Description = Visor para toda clase de archivos de imagen,audio y video. + +[Section.040c] +Licence = Gratuit (pour un usage personnel) +Description = Visionneur pour tous les types de fichiers graphiques/audio/vidéo. + +[Section.0415] +Licence = Freeware (dla użytku domowego) +Description = Przeglądarka dla bardzo wielu typów obrazów, plików audio oraz wideo. + +[Section.0422] +Licence = Freeware (для домашнього використання) +Description = Переглядач для всіх видів графічних та аудіо/відео файлів. diff --git a/base/applications/rapps/rapps/irfanviewplugins.txt b/base/applications/rapps/rapps/irfanviewplugins.txt index 03686ab053f..7a116f1d9ef 100644 --- a/base/applications/rapps/rapps/irfanviewplugins.txt +++ b/base/applications/rapps/rapps/irfanviewplugins.txt @@ -1,28 +1,32 @@ -; UTF-8 - -[Section] -Name = IrfanView Plugins -Version = 4.28 -Licence = Freeware (for personal use) -Description = Additional Plugins for supporting more file types. -Size = 7.8MB -Category = 3 -URLSite = http://www.irfanview.com/ -URLDownload = http://irfanview.tuwien.ac.at/plugins/irfanview_plugins_428_setup.exe -CDPath = none - -[Section.0407] -Licence = Freeware für nichtkommerzielle Nutzung -Description = Zusätzlich Plugins zur Unterstützung von weiteren Dateitypen. - -[Section.040a] -Licence = Gratuito (para uso personal) -Description = Complementos adicionales para soportar más formatos. - -[Section.0415] -Licence = Freeware (dla użytku domowego) -Description = Wtyczki otwierające dodatkowe typy plików w Irfanview. - -[Section.0422] -Licence = Freeware (для домашнього використання) -Description = Додаткові плагіни для підтримки більшої кількості файлових типів. +; UTF-8 + +[Section] +Name = IrfanView Plugins +Version = 4.28 +Licence = Freeware (for personal use) +Description = Additional Plugins for supporting more file types. +Size = 7.8MB +Category = 3 +URLSite = http://www.irfanview.com/ +URLDownload = http://irfanview.tuwien.ac.at/plugins/irfanview_plugins_428_setup.exe +CDPath = none + +[Section.0407] +Licence = Freeware für nichtkommerzielle Nutzung +Description = Zusätzlich Plugins zur Unterstützung von weiteren Dateitypen. + +[Section.040a] +Licence = Gratuito (para uso personal) +Description = Complementos adicionales para soportar más formatos. + +[Section.040c] +Licence = Gratuit (pour un usage personnel) +Description = Modules additionnels pour supporter plus de types de fichiers. + +[Section.0415] +Licence = Freeware (dla użytku domowego) +Description = Wtyczki otwierające dodatkowe typy plików w Irfanview. + +[Section.0422] +Licence = Freeware (для домашнього використання) +Description = Додаткові плагіни для підтримки більшої кількості файлових типів. diff --git a/base/applications/rapps/rapps/kdewin.txt b/base/applications/rapps/rapps/kdewin.txt index ced1b4a3a9e..d3b6383f61c 100644 --- a/base/applications/rapps/rapps/kdewin.txt +++ b/base/applications/rapps/rapps/kdewin.txt @@ -1,21 +1,24 @@ -; UTF-8 - -[Section] -Name = K Desktop Environment -Version = 0.9.8-1 -Licence = GPL -Description = KDE for Windows. -Size = 2.0MB -Category = 15 -URLSite = http://www.winkde.org/ -URLDownload = http://www.winkde.org/pub/kde/ports/win32/installer/kdewin-installer-gui-0.9.8-1.exe -CDPath = none - -[Section.0407] -Description = KDE für Windows. - -[Section.0415] -Description = KDE dla Windows. - -[Section.0422] -Description = KDE для Windows. +; UTF-8 + +[Section] +Name = K Desktop Environment +Version = 0.9.8-1 +Licence = GPL +Description = KDE for Windows. +Size = 2.0MB +Category = 15 +URLSite = http://www.winkde.org/ +URLDownload = http://www.winkde.org/pub/kde/ports/win32/installer/kdewin-installer-gui-0.9.8-1.exe +CDPath = none + +[Section.0407] +Description = KDE für Windows. + +[Section.040c] +Description = KDE pour Windows. + +[Section.0415] +Description = KDE dla Windows. + +[Section.0422] +Description = KDE для Windows. diff --git a/base/applications/rapps/rapps/lbreakout2.txt b/base/applications/rapps/rapps/lbreakout2.txt index 98c3262265d..82da4bb8ae2 100644 --- a/base/applications/rapps/rapps/lbreakout2.txt +++ b/base/applications/rapps/rapps/lbreakout2.txt @@ -1,24 +1,27 @@ -; UTF-8 - -[Section] -Name = LBreakout2 -Version = 2.4.1 -Licence = GPL -Description = Breakout Clone using SDL libs. -Size = 3.1MB -Category = 4 -URLSite = http://lgames.sourceforge.net/index.php?project=LBreakout2 -URLDownload = http://ovh.dl.sourceforge.net/project/lgames/binaries/lbreakout2-2.4.1-win32.exe -CDPath = none - -[Section.0407] -Description = Breakout-Klon verwendet SDL Bibliothek. - -[Section.040a] -Description = Clon de Breakout usando las librerias SDL. - -[Section.0415] -Description = Klon Breakouta/Arkanoida napisany przy użyciu biblioteki SDL. - -[Section.0422] -Description = Клон Breakouta/Arkanoida, що використовує бібліотеки SDL. +; UTF-8 + +[Section] +Name = LBreakout2 +Version = 2.4.1 +Licence = GPL +Description = Breakout Clone using SDL libs. +Size = 3.1MB +Category = 4 +URLSite = http://lgames.sourceforge.net/index.php?project=LBreakout2 +URLDownload = http://ovh.dl.sourceforge.net/project/lgames/binaries/lbreakout2-2.4.1-win32.exe +CDPath = none + +[Section.0407] +Description = Breakout-Klon verwendet SDL Bibliothek. + +[Section.040a] +Description = Clon de Breakout usando las librerias SDL. + +[Section.040c] +Description = Clone de casse-brique utilisant la bibliothèque SDL. + +[Section.0415] +Description = Klon Breakouta/Arkanoida napisany przy użyciu biblioteki SDL. + +[Section.0422] +Description = Клон Breakouta/Arkanoida, що використовує бібліотеки SDL. diff --git a/base/applications/rapps/rapps/lgeneral.txt b/base/applications/rapps/rapps/lgeneral.txt index 0fe80aa68eb..a3fd16d924b 100644 --- a/base/applications/rapps/rapps/lgeneral.txt +++ b/base/applications/rapps/rapps/lgeneral.txt @@ -1,24 +1,27 @@ -; UTF-8 - -[Section] -Name = LGeneral -Version = 1.1 -Licence = GPL -Description = Panzer General Clone using SDL libs. -Size = 2.0MB -Category = 4 -URLSite = http://lgames.sourceforge.net/index.php?project=LGeneral -URLDownload = http://ovh.dl.sourceforge.net/project/lgames/binaries/lgeneral-1.1-win32.exe -CDPath = none - -[Section.0407] -Description = Panzer-General-Klon verwendet SDL Bibliotheken. - -[Section.040a] -Description = Clon de Panzer General usando las librerias SDL. - -[Section.0415] -Description = Klon gry Panzer General napisany przy użyciu biblioteki SDL. - -[Section.0422] -Description = Клон гри Panzer General, що використовує бібліотеки SDL. +; UTF-8 + +[Section] +Name = LGeneral +Version = 1.1 +Licence = GPL +Description = Panzer General Clone using SDL libs. +Size = 2.0MB +Category = 4 +URLSite = http://lgames.sourceforge.net/index.php?project=LGeneral +URLDownload = http://ovh.dl.sourceforge.net/project/lgames/binaries/lgeneral-1.1-win32.exe +CDPath = none + +[Section.0407] +Description = Panzer-General-Klon verwendet SDL Bibliotheken. + +[Section.040a] +Description = Clon de Panzer General usando las librerias SDL. + +[Section.040c] +Description = Clone de Pansez General utilisant la bibliothèque SDL. + +[Section.0415] +Description = Klon gry Panzer General napisany przy użyciu biblioteki SDL. + +[Section.0422] +Description = Клон гри Panzer General, що використовує бібліотеки SDL. diff --git a/base/applications/rapps/rapps/libreoffice.txt b/base/applications/rapps/rapps/libreoffice.txt index 60c99c5f174..93805ef8f7d 100644 --- a/base/applications/rapps/rapps/libreoffice.txt +++ b/base/applications/rapps/rapps/libreoffice.txt @@ -1,24 +1,27 @@ -; UTF-8 - -[Section] -Name = LibreOffice -Version = 3.3.0 RC3 -Licence = LGPL -Description = Former called OpenOffice. Open Source Office Suite. -Size = 209.0MB -Category = 6 -URLSite = http://www.documentfoundation.org/ -URLDownload = http://download.documentfoundation.org/libreoffice/testing/3.3.0-rc3/win/x86/LibO_3.3.0rc3_Win_x86_install_multi.exe -CDPath = none - -[Section.0407] -Description = Vorher bekannt als OpenOffice. Open Source Office Suite. - -[Section.040a] -Description = La suite de ofimática de código abierto. - -[Section.0415] -Description = Otwarty pakiet biurowy. - -[Section.0422] -Description = Відкритий офісний пакет. +; UTF-8 + +[Section] +Name = LibreOffice +Version = 3.3.1 +Licence = LGPL +Description = Former called OpenOffice. Open Source Office Suite. +Size = 213.4MB +Category = 6 +URLSite = http://www.documentfoundation.org/ +URLDownload = http://download.documentfoundation.org/libreoffice/stable/3.3.1/win/x86/LibO_3.3.1_Win_x86_install_multi.exe +CDPath = none + +[Section.0407] +Description = Vorher bekannt als OpenOffice. Open Source Office Suite. + +[Section.040a] +Description = La suite de ofimática de código abierto. + +[Section.040c] +Description = Précédemment appelé OpenOffice. Suite bureautique open source. + +[Section.0415] +Description = Otwarty pakiet biurowy. + +[Section.0422] +Description = Відкритий офісний пакет. diff --git a/base/applications/rapps/rapps/lmarbles.txt b/base/applications/rapps/rapps/lmarbles.txt index 025508cc4ad..d2beeef014d 100644 --- a/base/applications/rapps/rapps/lmarbles.txt +++ b/base/applications/rapps/rapps/lmarbles.txt @@ -1,24 +1,27 @@ -; UTF-8 - -[Section] -Name = LMarbles -Version = 1.0.6 -Licence = GPL -Description = Atomix Clone using SDL libs. -Size = 1.4MB -Category = 4 -URLSite = http://lgames.sourceforge.net/index.php?project=LMarbles -URLDownload = http://ovh.dl.sourceforge.net/project/lgames/binaries/lmarbles-1.0.6-win32.exe -CDPath = none - -[Section.0407] -Description = Atomix-Klon verwendet SDL Bibliotheken. - -[Section.040a] -Description = Clon de Atomix usando las librerias SDL. - -[Section.0415] -Description = Klon gry Atomix, używający biblioteki SDL. - -[Section.0422] -Description = Клон гри Atomix, що використовує бібліотеки SDL. +; UTF-8 + +[Section] +Name = LMarbles +Version = 1.0.6 +Licence = GPL +Description = Atomix Clone using SDL libs. +Size = 1.4MB +Category = 4 +URLSite = http://lgames.sourceforge.net/index.php?project=LMarbles +URLDownload = http://ovh.dl.sourceforge.net/project/lgames/binaries/lmarbles-1.0.6-win32.exe +CDPath = none + +[Section.0407] +Description = Atomix-Klon verwendet SDL Bibliotheken. + +[Section.040a] +Description = Clon de Atomix usando las librerias SDL. + +[Section.040c] +Description = Clone de Atomix utilisant la bibliothèque SDL. + +[Section.0415] +Description = Klon gry Atomix, używający biblioteki SDL. + +[Section.0422] +Description = Клон гри Atomix, що використовує бібліотеки SDL. diff --git a/base/applications/rapps/rapps/mfc40.txt b/base/applications/rapps/rapps/mfc40.txt index c0d85391605..58e1f4ebe02 100644 --- a/base/applications/rapps/rapps/mfc40.txt +++ b/base/applications/rapps/rapps/mfc40.txt @@ -1,32 +1,37 @@ -; UTF-8 - -[Section] -Name = OLE Viewer and Microsoft Foundation Classes version 4 -Version = 4.0 -Licence = Unknown -Description = MFC 4 is needed by some applications. -Size = 865kB -Category = 14 -URLSite = http://support.microsoft.com/kb/122244/ -URLDownload = http://download.microsoft.com/download/ole/ole2v/3.5/w351/en-us/ole2v.exe -CDPath = none - -[Section.0407] -Name = OLE Anzeige und Microsoft Foundation Classes Version 4 -Licence = Unbekannt -Description = MFC 4 wird von einigen Anwendungen benötigt. - -[Section.040a] -Name = Visor OLE y Microsoft Foundation Classes Version 4 -Licence = Desconocida -Description = MFC 4 es necesario para varias aplicaciones. - -[Section.0415] -Name = Przeglądarka OLE oraz MFC (Microsoft Foundation Classes) wersja 4 -Licence = Nieznana -Description = Biblioteka MFC 4 jest używana przez część aplikacji. - -[Section.0422] -Name = Переглядач OLE та MFC (Microsoft Foundation Classes) версія 4 -Licence = Невідома -Description = Бібліотека MFC 4 необхідна декотрим програмам. +; UTF-8 + +[Section] +Name = OLE Viewer and Microsoft Foundation Classes version 4 +Version = 4.0 +Licence = Unknown +Description = MFC 4 is needed by some applications. +Size = 865kB +Category = 14 +URLSite = http://support.microsoft.com/kb/122244/ +URLDownload = http://download.microsoft.com/download/ole/ole2v/3.5/w351/en-us/ole2v.exe +CDPath = none + +[Section.0407] +Name = OLE Anzeige und Microsoft Foundation Classes Version 4 +Licence = Unbekannt +Description = MFC 4 wird von einigen Anwendungen benötigt. + +[Section.040a] +Name = Visor OLE y Microsoft Foundation Classes Version 4 +Licence = Desconocida +Description = MFC 4 es necesario para varias aplicaciones. + +[Section.040c] +Name = Visionneur OLE et Microsoft Foundation Classes version 4 +Licence = Inconnue +Description = MFC 4 est nécessaire pour certaines applications. + +[Section.0415] +Name = Przeglądarka OLE oraz MFC (Microsoft Foundation Classes) wersja 4 +Licence = Nieznana +Description = Biblioteka MFC 4 jest używana przez część aplikacji. + +[Section.0422] +Name = Переглядач OLE та MFC (Microsoft Foundation Classes) версія 4 +Licence = Невідома +Description = Бібліотека MFC 4 необхідна декотрим програмам. diff --git a/base/applications/rapps/rapps/mingw.txt b/base/applications/rapps/rapps/mingw.txt index 054a2fb71c3..fb31d173adf 100644 --- a/base/applications/rapps/rapps/mingw.txt +++ b/base/applications/rapps/rapps/mingw.txt @@ -1,24 +1,27 @@ -; UTF-8 - -[Section] -Name = MinGW -Version = 20100909 -Licence = Public domain/GPL -Description = A Port of the GNU toolchain with GCC, GDB, GNU make, etc. -Size = 568kb -Category = 7 -URLSite = http://mingw.org/ -URLDownload = http://ovh.dl.sourceforge.net/project/mingw/Automated%20MinGW%20Installer/mingw-get-inst/mingw-get-inst-20100909/mingw-get-inst-20100909.exe -CDPath = none - -[Section.0407] -Description = Eine Portierung der GNU Werkzeugkette mit GCC, GDB, GNU make usw. - -[Section.040a] -Description = Es una cadena de herramientas GNU con GCC, GDB, GNU make, etc. - -[Section.0415] -Description = Kompilator GCC dla platformy Windows wraz z dodatkowymi narzędziami (GDB, make, itd.). - -[Section.0422] -Description = Компілятор GCC для платформи Windows з додатковими інструментами GDB, GNU make, та ін. +; UTF-8 + +[Section] +Name = MinGW +Version = 20100909 +Licence = Public domain/GPL +Description = A Port of the GNU toolchain with GCC, GDB, GNU make, etc. +Size = 568kb +Category = 7 +URLSite = http://mingw.org/ +URLDownload = http://ovh.dl.sourceforge.net/project/mingw/Automated%20MinGW%20Installer/mingw-get-inst/mingw-get-inst-20100909/mingw-get-inst-20100909.exe +CDPath = none + +[Section.0407] +Description = Eine Portierung der GNU Werkzeugkette mit GCC, GDB, GNU make usw. + +[Section.040a] +Description = Es una cadena de herramientas GNU con GCC, GDB, GNU make, etc. + +[Section.040c] +Description = Un portage de la chaîne d'outils GNU avec GCC, GDB, GNU make, etc. + +[Section.0415] +Description = Kompilator GCC dla platformy Windows wraz z dodatkowymi narzędziami (GDB, make, itd.). + +[Section.0422] +Description = Компілятор GCC для платформи Windows з додатковими інструментами GDB, GNU make, та ін. diff --git a/base/applications/rapps/rapps/mirandaim.txt b/base/applications/rapps/rapps/mirandaim.txt index 68a2a602090..68ff3854ab0 100644 --- a/base/applications/rapps/rapps/mirandaim.txt +++ b/base/applications/rapps/rapps/mirandaim.txt @@ -1,24 +1,27 @@ -; UTF-8 - -[Section] -Name = Miranda IM -Version = 0.9.13 -Licence = GPL -Description = Open source multiprotocol instant messaging application - May not work completely. -Size = 3.0MB -Category = 5 -URLSite = http://www.miranda-im.org/ -URLDownload = http://miranda.googlecode.com/files/miranda-im-v0.9.13-unicode.exe -CDPath = none - -[Section.0407] -Description = Open source Multiprotokoll Instant Messaging Anwendung - funktioniert möglicherweise nicht vollständig. - -[Section.040a] -Description = Aplicación de mensajería instantánea multiprotocolo de código abierto - Puede no funcionar en su totalidad. - -[Section.0415] -Description = Otwarty komunikator internetowy, obsługujący wiele różnych protokołów (m.in. GG, Tlen, Jabber, ICQ, IRC) - może nie działać prawidłowo. - -[Section.0422] -Description = Відкрита мультипротокольна програма миттєвих повідомлень - може не працювати повністю. +; UTF-8 + +[Section] +Name = Miranda IM +Version = 0.9.17 +Licence = GPL +Description = Open source multiprotocol instant messaging application - May not work completely. +Size = 3.0MB +Category = 5 +URLSite = http://www.miranda-im.org/ +URLDownload = http://miranda.googlecode.com/files/miranda-im-v0.9.17-unicode.exe +CDPath = none + +[Section.0407] +Description = Open source Multiprotokoll Instant Messaging Anwendung - funktioniert möglicherweise nicht vollständig. + +[Section.040a] +Description = Aplicación de mensajería instantánea multiprotocolo de código abierto - Puede no funcionar en su totalidad. + +[Section.040c] +Description = Application de messagerie instantannée multi-protocoles open source - pourrait ne pas fonctionner complètement. + +[Section.0415] +Description = Otwarty komunikator internetowy, obsługujący wiele różnych protokołów (m.in. GG, Tlen, Jabber, ICQ, IRC) - może nie działać prawidłowo. + +[Section.0422] +Description = Відкрита мультипротокольна програма миттєвих повідомлень - може не працювати повністю. diff --git a/base/applications/rapps/rapps/mirc.txt b/base/applications/rapps/rapps/mirc.txt index 754f89ea473..64ca1bb5a56 100644 --- a/base/applications/rapps/rapps/mirc.txt +++ b/base/applications/rapps/rapps/mirc.txt @@ -1,24 +1,27 @@ -; UTF-8 - -[Section] -Name = mIRC -Version = 7.17 -Licence = Shareware -Description = The most popular client for the Internet Relay Chat (IRC). -Size = 2.0M -Category = 5 -URLSite = http://www.mirc.com/ -URLDownload = http://download.mirc.com/mirc717.exe -CDPath = none - -[Section.0407] -Description = Der populärste Client für Internet Relay Chat (IRC). - -[Section.040a] -Description = El más popular cliente para Internet Relay Chat (IRC). - -[Section.0415] -Description = Najpopularniejszy klient IRC (Internet Relay Chat). - -[Section.0422] -Description = Найпопулярніший клієнт IRC (Internet Relay Chat). +; UTF-8 + +[Section] +Name = mIRC 7 +Version = 7.19 +Licence = Shareware +Description = The most popular client for the Internet Relay Chat (IRC). +Size = 1.9M +Category = 5 +URLSite = http://www.mirc.com/ +URLDownload = http://download.mirc.com/mirc719.exe +CDPath = none + +[Section.0407] +Description = Der populärste Client für Internet Relay Chat (IRC). + +[Section.040a] +Description = El más popular cliente para Internet Relay Chat (IRC). + +[Section.040c] +Description = Le client le plus populaire pour l'Internet Relay Chat (IRC). + +[Section.0415] +Description = Najpopularniejszy klient IRC (Internet Relay Chat). + +[Section.0422] +Description = Найпопулярніший клієнт IRC (Internet Relay Chat). diff --git a/base/applications/rapps/rapps/mirc6.txt b/base/applications/rapps/rapps/mirc6.txt new file mode 100644 index 00000000000..1debcaa7e62 --- /dev/null +++ b/base/applications/rapps/rapps/mirc6.txt @@ -0,0 +1,27 @@ +; UTF-8 + +[Section] +Name = mIRC 6 +Version = 6.35 +Licence = Shareware +Description = The most popular client for the Internet Relay Chat (IRC). +Size = 1.9M +Category = 5 +URLSite = http://www.mirc.com/ +URLDownload = http://download.mirc.com/mirc635.exe +CDPath = none + +[Section.0407] +Description = Der populärste Client für Internet Relay Chat (IRC). + +[Section.040a] +Description = El más popular cliente para Internet Relay Chat (IRC). + +[Section.040c] +Description = Le client le plus populaire pour l'Internet Relay Chat (IRC). + +[Section.0415] +Description = Najpopularniejszy klient IRC (Internet Relay Chat). + +[Section.0422] +Description = Найпопулярніший клієнт IRC (Internet Relay Chat). diff --git a/base/applications/rapps/rapps/mono2.txt b/base/applications/rapps/rapps/mono2.txt index 309fc5d201c..3b4b6c0dfad 100644 --- a/base/applications/rapps/rapps/mono2.txt +++ b/base/applications/rapps/rapps/mono2.txt @@ -1,18 +1,21 @@ -; UTF-8 - -[Section] -Name = Mono .net Development Framework -Version = 2.8.2 -Licence = Unknown -Description = Open Source .net Framework. -Size = 77MB -Category = 14 -URLSite = http://www.mono-project.com/Main_Page -URLDownload = http://ftp.novell.com/pub/mono/archive/2.8.2/windows-installer/1/mono-2.8.2-gtksharp-2.12.10-win32-1.exe -CDPath = none - -[Section.0415] -Description = Pakiet Mono .net Framework dla Programistów. - -[Section.0422] -Description = Відкритий .net Фреймворк. +; UTF-8 + +[Section] +Name = Mono .net Development Framework +Version = 2.8.2 +Licence = Unknown +Description = Open Source .net Framework. +Size = 77MB +Category = 14 +URLSite = http://www.mono-project.com/Main_Page +URLDownload = http://ftp.novell.com/pub/mono/archive/2.8.2/windows-installer/1/mono-2.8.2-gtksharp-2.12.10-win32-1.exe +CDPath = none + +[Section.040c] +Description = Framework .net open source. + +[Section.0415] +Description = Pakiet Mono .net Framework dla Programistów. + +[Section.0422] +Description = Відкритий .net Фреймворк. diff --git a/base/applications/rapps/rapps/mpc.txt b/base/applications/rapps/rapps/mpc.txt index d89fb38bb6a..5c369cf8fd9 100644 --- a/base/applications/rapps/rapps/mpc.txt +++ b/base/applications/rapps/rapps/mpc.txt @@ -1,27 +1,30 @@ -; UTF-8 - -[Section] -Name = Media Player Classic Home Cinema -Version = 1.4.2499 -Licence = GPL -Description = A media player. -Size = 4.9MB -Category = 1 -URLSite = http://mpc-hc.sourceforge.net/ -URLDownload = http://freefr.dl.sourceforge.net/project/mpc-hc/MPC%20HomeCinema%20-%20Win32/MPC-HC%20v1.4.2499.0_32%20bits/MPC-HomeCinema.1.4.2499.0.x86.exe -CDPath = none - -[Section.0407] -Description = Ein Mediaplayer. - -[Section.040a] -Description = Reproductor multimedia. - -[Section.0419] -Description = Мультимедийный проигрыватель. - -[Section.0415] -Description = Odtwarzacz multimediów. - -[Section.0422] -Description = Мультимедійний програвач. +; UTF-8 + +[Section] +Name = Media Player Classic Home Cinema +Version = 1.5.0.2827 +Licence = GPL +Description = A media player. +Size = 4.9MB +Category = 1 +URLSite = http://mpc-hc.sourceforge.net/ +URLDownload = http://freefr.dl.sourceforge.net/project/mpc-hc/MPC%20HomeCinema%20-%20Win32/MPC-HC%20v1.5.0.2827_32%20bits/MPC-HomeCinema.1.5.0.2827.x86.exe +CDPath = none + +[Section.0407] +Description = Ein Mediaplayer. + +[Section.040a] +Description = Reproductor multimedia. + +[Section.040c] +Description = Un lecteur media. + +[Section.0419] +Description = Мультимедийный проигрыватель. + +[Section.0415] +Description = Odtwarzacz multimediów. + +[Section.0422] +Description = Мультимедійний програвач. diff --git a/base/applications/rapps/rapps/msxml3.txt b/base/applications/rapps/rapps/msxml3.txt index 4147a2ca074..788488af34c 100644 --- a/base/applications/rapps/rapps/msxml3.txt +++ b/base/applications/rapps/rapps/msxml3.txt @@ -1,28 +1,32 @@ -; UTF-8 - -[Section] -Name = Microsoft XML 3 -Version = 3.0 -Licence = Unknown -Description = MSXML3 is needed for some MSI Installers. -Size = 1.0MB -Category = 14 -URLSite = http://www.microsoft.com/downloads/details.aspx?FamilyID=28494391-052B-42FF-9674-F752BDCA9582&displaylang=en -URLDownload = http://download.microsoft.com/download/8/8/8/888f34b7-4f54-4f06-8dac-fa29b19f33dd/msxml3.msi -CDPath = none - -[Section.0407] -Licence = Unbekannt -Description = MSXML3 wird von einige MSI Installern benötigt. - -[Section.040a] -Licence = Desconocida -Description = MSXML3 para varios instaladores MSI. - -[Section.0415] -Licence = Nieznana -Description = Niektóre spośród plików instalacyjnych MSI potrzebują parsera MSXML3. - -[Section.0422] -Licence = Невідома -Description = MSXML3 необхідна для декотрих MSI інсталяторів. +; UTF-8 + +[Section] +Name = Microsoft XML 3 +Version = 3.0 +Licence = Unknown +Description = MSXML3 is needed for some MSI Installers. +Size = 1.0MB +Category = 14 +URLSite = http://www.microsoft.com/downloads/details.aspx?FamilyID=28494391-052B-42FF-9674-F752BDCA9582&displaylang=en +URLDownload = http://download.microsoft.com/download/8/8/8/888f34b7-4f54-4f06-8dac-fa29b19f33dd/msxml3.msi +CDPath = none + +[Section.0407] +Licence = Unbekannt +Description = MSXML3 wird von einige MSI Installern benötigt. + +[Section.040a] +Licence = Desconocida +Description = MSXML3 para varios instaladores MSI. + +[Section.040c] +Licence = Inconnue +Description = MSXML3 est nécessaire pour certains installateurs MSI. + +[Section.0415] +Licence = Nieznana +Description = Niektóre spośród plików instalacyjnych MSI potrzebują parsera MSXML3. + +[Section.0422] +Licence = Невідома +Description = MSXML3 необхідна для декотрих MSI інсталяторів. diff --git a/base/applications/rapps/rapps/net11.txt b/base/applications/rapps/rapps/net11.txt index 15966d9b229..4ba17e8c506 100644 --- a/base/applications/rapps/rapps/net11.txt +++ b/base/applications/rapps/rapps/net11.txt @@ -1,15 +1,18 @@ -; UTF-8 - -[Section] -Name = Microsoft .NET Framework Version 1.1 Redistributable Package -Version = 1.1 -Licence = Unknown -Description = Microsoft .NET Framework Version 1.1 Redistributable Package. -Size = 23.1MB -Category = 14 -URLSite = http://www.microsoft.com/downloads/details.aspx?FamilyId=262D25E3-F589-4842-8157-034D1E7CF3A3 -URLDownload = http://download.microsoft.com/download/a/a/c/aac39226-8825-44ce-90e3-bf8203e74006/dotnetfx.exe -CDPath = none - -[Section.0415] -Description = Microsoft .NET Framework Wersja 1.1 - Pakiet Dystrybucyjny. +; UTF-8 + +[Section] +Name = Microsoft .NET Framework Version 1.1 Redistributable Package +Version = 1.1 +Licence = Unknown +Description = Microsoft .NET Framework Version 1.1 Redistributable Package. +Size = 23.1MB +Category = 14 +URLSite = http://www.microsoft.com/downloads/details.aspx?FamilyId=262D25E3-F589-4842-8157-034D1E7CF3A3 +URLDownload = http://download.microsoft.com/download/a/a/c/aac39226-8825-44ce-90e3-bf8203e74006/dotnetfx.exe +CDPath = none + +[Section.040c] +Description = Microsoft .NET Framework version 1.1 - Paquet redistribuable. + +[Section.0415] +Description = Microsoft .NET Framework Wersja 1.1 - Pakiet Dystrybucyjny. diff --git a/base/applications/rapps/rapps/net20.txt b/base/applications/rapps/rapps/net20.txt index a29ed102861..3b01fbaf29b 100644 --- a/base/applications/rapps/rapps/net20.txt +++ b/base/applications/rapps/rapps/net20.txt @@ -1,15 +1,18 @@ -; UTF-8 - -[Section] -Name = Microsoft .NET Framework Version 2.0 Redistributable Package -Version = 2.0 -Licence = Unknown -Description = Microsoft .NET Framework Version 2.0 Redistributable Package. -Size = 22.4MB -Category = 14 -URLSite = http://www.microsoft.com/downloads/details.aspx?FamilyID=0856eacb-4362-4b0d-8edd-aab15c5e04f5 -URLDownload = http://download.microsoft.com/download/5/6/7/567758a3-759e-473e-bf8f-52154438565a/dotnetfx.exe -CDPath = none - -[Section.0415] -Description = Microsoft .NET Framework Wersja 2.0 - Pakiet Dystrybucyjny. +; UTF-8 + +[Section] +Name = Microsoft .NET Framework Version 2.0 Redistributable Package +Version = 2.0 +Licence = Unknown +Description = Microsoft .NET Framework Version 2.0 Redistributable Package. +Size = 22.4MB +Category = 14 +URLSite = http://www.microsoft.com/downloads/details.aspx?FamilyID=0856eacb-4362-4b0d-8edd-aab15c5e04f5 +URLDownload = http://download.microsoft.com/download/5/6/7/567758a3-759e-473e-bf8f-52154438565a/dotnetfx.exe +CDPath = none + +[Section.040c] +Description = Microsoft .NET Framework version 2.0 - Paquet redistribuable. + +[Section.0415] +Description = Microsoft .NET Framework Wersja 2.0 - Pakiet Dystrybucyjny. diff --git a/base/applications/rapps/rapps/net20sp2.txt b/base/applications/rapps/rapps/net20sp2.txt index 1901bfe937e..ef47b60270b 100644 --- a/base/applications/rapps/rapps/net20sp2.txt +++ b/base/applications/rapps/rapps/net20sp2.txt @@ -1,15 +1,18 @@ -; UTF-8 - -[Section] -Name = Microsoft .NET Framework Version 2.0 Service Pack 2 -Version = 2.0SP2 -Licence = Unknown -Description = Microsoft .NET Framework Version 2.0 Service Pack 2 -Size = 23.8MB -Category = 14 -URLSite = http://www.microsoft.com/downloads/details.aspx?familyid=5B2C0358-915B-4EB5-9B1D-10E506DA9D0F -URLDownload = http://download.microsoft.com/download/c/6/e/c6e88215-0178-4c6c-b5f3-158ff77b1f38/NetFx20SP2_x86.exe -CDPath = none - -[Section.0415] -Description = Microsoft .NET Framework Wersja 2.0 Service Pack 2. \ No newline at end of file +; UTF-8 + +[Section] +Name = Microsoft .NET Framework Version 2.0 Service Pack 2 +Version = 2.0SP2 +Licence = Unknown +Description = Microsoft .NET Framework Version 2.0 Service Pack 2 +Size = 23.8MB +Category = 14 +URLSite = http://www.microsoft.com/downloads/details.aspx?familyid=5B2C0358-915B-4EB5-9B1D-10E506DA9D0F +URLDownload = http://download.microsoft.com/download/c/6/e/c6e88215-0178-4c6c-b5f3-158ff77b1f38/NetFx20SP2_x86.exe +CDPath = none + +[Section.040c] +Description = Microsoft .NET Framework version 2.0 Service Pack 2. + +[Section.0415] +Description = Microsoft .NET Framework Wersja 2.0 Service Pack 2. diff --git a/base/applications/rapps/rapps/offbyone.txt b/base/applications/rapps/rapps/offbyone.txt index 733e710fa9b..582627c7392 100644 --- a/base/applications/rapps/rapps/offbyone.txt +++ b/base/applications/rapps/rapps/offbyone.txt @@ -1,27 +1,30 @@ -; UTF-8 - -[Section] -Name = Off By One Browser -Version = 3.5d -Licence = Freeware -Description = The Off By One Browser is a very small and fast web browser with full HTML 3.2 support. -Size = 0.98M -Category = 5 -URLSite = http://offbyone.com/ -URLDownload = http://offbyone.com/offbyone/images/OffByOneSetup.exe -CDPath = none - -[Section.0405] -Description = Off-By-One-Browser je velmi malý a rychlý webový prohlížeč s plnou podporou HTML 3.2. - -[Section.0407] -Description = Der Off-By-One-Browser ist ein sehr kleiner und schneller Webbrowser mit voller HTML 3.2 Unterstützung. - -[Section.040a] -Description = Es un pequeño y rápido navegador web con completo soporte HTML 3.2. - -[Section.0415] -Description = Bardzo mała i szybka przeglądarka internetowa z pełną obsługą HTML 3.2. - -[Section.0422] -Description = Дуже малий та швидкий веб-браузер з повною підтримкою HTML 3.2. +; UTF-8 + +[Section] +Name = Off By One Browser +Version = 3.5d +Licence = Freeware +Description = The Off By One Browser is a very small and fast web browser with full HTML 3.2 support. +Size = 0.98M +Category = 5 +URLSite = http://offbyone.com/ +URLDownload = http://offbyone.com/offbyone/images/OffByOneSetup.exe +CDPath = none + +[Section.0405] +Description = Off-By-One-Browser je velmi malý a rychlý webový prohlížeč s plnou podporou HTML 3.2. + +[Section.0407] +Description = Der Off-By-One-Browser ist ein sehr kleiner und schneller Webbrowser mit voller HTML 3.2 Unterstützung. + +[Section.040a] +Description = Es un pequeño y rápido navegador web con completo soporte HTML 3.2. + +[Section.040c] +Description = Le navigateur Off By One est un navigateur internet très petit et rapide avec un support complet de HTML 3.2. + +[Section.0415] +Description = Bardzo mała i szybka przeglądarka internetowa z pełną obsługą HTML 3.2. + +[Section.0422] +Description = Дуже малий та швидкий веб-браузер з повною підтримкою HTML 3.2. diff --git a/base/applications/rapps/rapps/openoffice2.4.txt b/base/applications/rapps/rapps/openoffice2.4.txt index 89434276526..f2bc9ec0578 100644 --- a/base/applications/rapps/rapps/openoffice2.4.txt +++ b/base/applications/rapps/rapps/openoffice2.4.txt @@ -1,36 +1,43 @@ -; UTF-8 - -[Section] -Name = OpenOffice 2.4 -Version = 2.4.3 -Licence = LGPL -Description = THE Open Source Office Suite. -Size = 127MB -Category = 6 -URLSite = http://www.openoffice.org/ -URLDownload = ftp://archive.services.openoffice.org/pub/openoffice-archive/stable/2.4.3/OOo_2.4.3_Win32Intel_install_en-US.exe -CDPath = none - -[Section.0407] -Description = DIE Open Source Office Suite. -URLSite = http://de.openoffice.org/ -Size = 114.2MB -URLDownload = ftp://archive.services.openoffice.org/pub/openoffice-archive/localized/de/2.4.3/OOo_2.4.3_Win32Intel_install_de.exe - -[Section.040a] -Description = La suite de ofimática de código abierto. -URLSite = http://es.openoffice.org/ -Size = 113.9MB -URLDownload = ftp://archive.services.openoffice.org/pub/openoffice-archive/localized/es/2.4.3/OOo_2.4.3_Win32Intel_install_es.exe - -[Section.0415] -URLSite = http://pl.openoffice.org/ -Description = Otwarty pakiet biurowy. -URLDownload = ftp://archive.services.openoffice.org/pub/openoffice-archive/localized/pl/2.4.2/OOo_2.4.2_Win32Intel_install_pl.exe -Size = 113.9M - -[Section.0422] -URLSite = http://ua.openoffice.org/ -Description = Відкритий офісний пакет. -URLDownload = ftp://archive.services.openoffice.org/pub/openoffice-archive/localized/ru/2.4.3/OOo_2.4.3_Win32Intel_install_ru.exe -Size = 114.8M +; UTF-8 + +[Section] +Name = OpenOffice 2.4 +Version = 2.4.3 +Licence = LGPL +Description = THE Open Source Office Suite. +Size = 127MB +Category = 6 +URLSite = http://www.openoffice.org/ +URLDownload = ftp://archive.services.openoffice.org/pub/openoffice-archive/stable/2.4.3/OOo_2.4.3_Win32Intel_install_en-US.exe +CDPath = none + +[Section.0407] +Description = DIE Open Source Office Suite. +URLSite = http://de.openoffice.org/ +Size = 114.2MB +URLDownload = ftp://archive.services.openoffice.org/pub/openoffice-archive/localized/de/2.4.3/OOo_2.4.3_Win32Intel_install_de.exe + +[Section.040a] +Description = La suite de ofimática de código abierto. +URLSite = http://es.openoffice.org/ +Size = 113.9MB +URLDownload = ftp://archive.services.openoffice.org/pub/openoffice-archive/localized/es/2.4.3/OOo_2.4.3_Win32Intel_install_es.exe + +[Section.040c] +Version = 2.4.2 +Description = LA suite bureautique open source. +URLSite = http://fr.openoffice.org/ +Size = 113.9MB +URLDownload = ftp://archive.services.openoffice.org/pub/openoffice-archive/localized/fr/2.4.2/OOo_2.4.2_Win32Intel_install_fr.exe + +[Section.0415] +URLSite = http://pl.openoffice.org/ +Description = Otwarty pakiet biurowy. +URLDownload = ftp://archive.services.openoffice.org/pub/openoffice-archive/localized/pl/2.4.2/OOo_2.4.2_Win32Intel_install_pl.exe +Size = 113.9M + +[Section.0422] +URLSite = http://ua.openoffice.org/ +Description = Відкритий офісний пакет. +URLDownload = ftp://archive.services.openoffice.org/pub/openoffice-archive/localized/ru/2.4.3/OOo_2.4.3_Win32Intel_install_ru.exe +Size = 114.8M diff --git a/base/applications/rapps/rapps/openoffice3.0.txt b/base/applications/rapps/rapps/openoffice3.0.txt index 2c06235c344..4662cfee621 100644 --- a/base/applications/rapps/rapps/openoffice3.0.txt +++ b/base/applications/rapps/rapps/openoffice3.0.txt @@ -1,36 +1,42 @@ -; UTF-8 - -[Section] -Name = OpenOffice 3.0 -Version = 3.2.1 -Licence = LGPL -Description = THE Open Source Office Suite. -Size = 134.0MB -Category = 6 -URLSite = http://www.openoffice.org/ -URLDownload = http://ftp3.gwdg.de/pub/openoffice/stable/3.2.1/OOo_3.2.1_Win_x86_install_en-US.exe -CDPath = none - -[Section.0407] -Description = DIE Open Source Office Suite. -URLSite = http://de.openoffice.org/ -Size = 144.0MB -URLDownload = http://ftp3.gwdg.de/pub/openoffice/localized/de/3.2.1/OOo_3.2.1_Win_x86_install_de.exe - -[Section.040a] -Description = La suite de ofimática de código abierto. -URLSite = http://es.openoffice.org/ -Size = 144.0MB -URLDownload = http://ftp3.gwdg.de/pub/openoffice/localized/es/3.2.1/OOo_3.2.1_Win_x86_install-wJRE_es.exe - -[Section.0415] -Description = Otwarty pakiet biurowy. -URLSite = http://pl.openoffice.org/ -Size = 130.0MB -URLDownload = http://ftp3.gwdg.de/pub/openoffice/localized/pl/3.2.1/OOo_3.2.1_Win_x86_install_pl.exe - -[Section.0422] -Description = Відкритий офісний пакет. -URLSite = http://ua.openoffice.org/ -Size = 128.0MB -URLDownload = http://ftp3.gwdg.de/pub/openoffice/localized/ru/3.2.1/OOo_3.2.1_Win_x86_install_ru.exe +; UTF-8 + +[Section] +Name = OpenOffice 3.3 +Version = 3.3.0 +Licence = LGPL +Description = THE Open Source Office Suite. +Size = 137.0MB +Category = 6 +URLSite = http://www.openoffice.org/ +URLDownload = http://ftp3.gwdg.de/pub/openoffice/stable/3.3.0/OOo_3.3.0_Win_x86_install_en-US.exe +CDPath = none + +[Section.0407] +Description = DIE Open Source Office Suite. +URLSite = http://de.openoffice.org/ +Size = 160.0MB +URLDownload = http://ftp3.gwdg.de/pub/openoffice/localized/de/3.3.0/OOo_3.3.0_Win_x86_install-wJRE_de.exe + +[Section.040a] +Description = La suite de ofimática de código abierto. +URLSite = http://es.openoffice.org/ +Size = 132.0MB +URLDownload = http://ftp.gwdg.de/pub/openoffice/localized/es/3.3.0/OOo_3.3.0_Win_x86_install_es.exe + +[Section.040c] +Description = LA suite bureautique open source. +URLSite = http://fr.openoffice.org/ +Size = 132.0MB +URLDownload = http://ftp.gwdg.de/pub/openoffice/localized/fr/3.3.0/OOo_3.3.0_Win_x86_install_fr.exe + +[Section.0415] +Description = Otwarty pakiet biurowy. +URLSite = http://pl.openoffice.org/ +Size = 134.0MB +URLDownload = http://ftp3.gwdg.de/pub/openoffice/localized/pl/3.3.0/OOo_3.3.0_Win_x86_install_pl.exe + +[Section.0422] +Description = Відкритий офісний пакет. +URLSite = http://ua.openoffice.org/ +Size = 133.0MB +URLDownload = http://ftp3.gwdg.de/pub/openoffice/localized/ru/3.3.0/OOo_3.3.0_Win_x86_install_ru.exe diff --git a/base/applications/rapps/rapps/openttd.txt b/base/applications/rapps/rapps/openttd.txt index 43d57387674..6351e4ab1ae 100644 --- a/base/applications/rapps/rapps/openttd.txt +++ b/base/applications/rapps/rapps/openttd.txt @@ -1,24 +1,27 @@ -; UTF-8 - -[Section] -Name = OpenTTD -Version = 1.0.5 -Licence = GPL v2 -Description = Open Source clone of the "Transport Tycoon Deluxe" game engine. You need a copy of Transport Tycoon. -Size = 3.4MB -Category = 4 -URLSite = http://www.openttd.org/ -URLDownload = http://cz.binaries.openttd.org/openttd/binaries/releases/1.0.5/openttd-1.0.5-windows-win32.exe -CDPath = none - -[Section.0407] -Description = Open Source Klon der "Transport Tycoon Deluxe" Spiel-Engine. Sie benötigen eine Kopie von Transport Tycoon. - -[Section.040a] -Description = Clon del motor de juegos "Transport Tycoon Deluxe" de código abierto. Es necesaria una copia de Transport Tycoon. - -[Section.0415] -Description = Otwarty klon silnika gry "Transport Tycoon Deluxe". Do poprawnego działania potrzebna jest kopia gry Transport Tycoon. - -[Section.0422] -Description = Відкритий клон двигуна гри "Transport Tycoon Deluxe". Вам потрібна копія гри Transport Tycoon. +; UTF-8 + +[Section] +Name = OpenTTD +Version = 1.0.5 +Licence = GPL v2 +Description = Open Source clone of the "Transport Tycoon Deluxe" game engine. You need a copy of Transport Tycoon. +Size = 3.4MB +Category = 4 +URLSite = http://www.openttd.org/ +URLDownload = http://cz.binaries.openttd.org/openttd/binaries/releases/1.0.5/openttd-1.0.5-windows-win32.exe +CDPath = none + +[Section.0407] +Description = Open Source Klon der "Transport Tycoon Deluxe" Spiel-Engine. Sie benötigen eine Kopie von Transport Tycoon. + +[Section.040a] +Description = Clon del motor de juegos "Transport Tycoon Deluxe" de código abierto. Es necesaria una copia de Transport Tycoon. + +[Section.040c] +Description = Clone open source du moteur de jeu "Transport Tycoon Deluxe". Vous aurez besoin d'une copie de Transport Tycoon. + +[Section.0415] +Description = Otwarty klon silnika gry "Transport Tycoon Deluxe". Do poprawnego działania potrzebna jest kopia gry Transport Tycoon. + +[Section.0422] +Description = Відкритий клон двигуна гри "Transport Tycoon Deluxe". Вам потрібна копія гри Transport Tycoon. diff --git a/base/applications/rapps/rapps/opera.txt b/base/applications/rapps/rapps/opera.txt index f01bd9d833d..cfca69373ad 100644 --- a/base/applications/rapps/rapps/opera.txt +++ b/base/applications/rapps/rapps/opera.txt @@ -1,30 +1,33 @@ -; UTF-8 - -[Section] -Name = Opera -Version = 11.00 -Licence = Freeware -Description = The popular Opera Browser with many advanced features and including a Mail and BitTorrent client. -Size = 8.9M -Category = 5 -URLSite = http://www.opera.com/ -URLDownload = http://get4.opera.com/pub/opera/win/1100/int/Opera_1100_int_Setup.exe -CDPath = none - -[Section.0405] -Description = Populární prohlížeč Opera s mnoha pokročilými vlastnostmi, včetně vestavené podpory pro e-mail a BitTorrent. - -[Section.0407] -Description = Der populäre Opera Browser mit vielen fortschrittlichen Eigenschaften, enthält einen Mail und BitTorrent Client. - -[Section.040a] -Description = Popular navegador web con muchas características avanzadas e incluye un cliente de correo y BitTorrent. - -[Section.0415] -Description = Popularna przeglądarka internetowa z wieloma zaawansowanymi funkcjami, zawierająca klientów: poczty oraz BitTorrent. - -[Section.0419] -Description = Популярный браузер со многими дополнительными возможностями, включающий клиентов почты и BitTorrent. - -[Section.0422] -Description = Популярний браузер з багатьма додатковими можливостями, який включає в себе поштовий та BitTorrent клієнти. +; UTF-8 + +[Section] +Name = Opera +Version = 11.01 +Licence = Freeware +Description = The popular Opera Browser with many advanced features and including a Mail and BitTorrent client. +Size = 8.9M +Category = 5 +URLSite = http://www.opera.com/ +URLDownload = http://get4.opera.com/pub/opera/win/1101/int/Opera_1101_int_Setup.exe +CDPath = none + +[Section.0405] +Description = Populární prohlížeč Opera s mnoha pokročilými vlastnostmi, včetně vestavené podpory pro e-mail a BitTorrent. + +[Section.0407] +Description = Der populäre Opera Browser mit vielen fortschrittlichen Eigenschaften, enthält einen Mail und BitTorrent Client. + +[Section.040a] +Description = Popular navegador web con muchas características avanzadas e incluye un cliente de correo y BitTorrent. + +[Section.040c] +Description = Le populaire navigateur Opera avec beaucoup de fonctionnalités avancées, incluant un client mail et BitTorrent. + +[Section.0415] +Description = Popularna przeglądarka internetowa z wieloma zaawansowanymi funkcjami, zawierająca klientów: poczty oraz BitTorrent. + +[Section.0419] +Description = Популярный браузер со многими дополнительными возможностями, включающий клиентов почты и BitTorrent. + +[Section.0422] +Description = Популярний браузер з багатьма додатковими можливостями, який включає в себе поштовий та BitTorrent клієнти. diff --git a/base/applications/rapps/rapps/opera9.txt b/base/applications/rapps/rapps/opera9.txt index 72c275a95f4..51f6450bfc1 100644 --- a/base/applications/rapps/rapps/opera9.txt +++ b/base/applications/rapps/rapps/opera9.txt @@ -1,27 +1,30 @@ -; UTF-8 - -[Section] -Name = Opera -Version = 9.64 -Licence = Freeware -Description = The popular Opera Browser with many advanced features and including a Mail and BitTorrent client. -Size = 7.2M -Category = 5 -URLSite = http://www.opera.com/ -URLDownload = http://get4.opera.com/pub/opera/win/964/int/Opera_964_int_Setup.exe -CDPath = none - -[Section.0407] -Description = Der populäre Opera Browser mit vielen fortschrittlichen Eigenschaften, enthält einen Mail und BitTorrent Client. - -[Section.040a] -Description = Popular navegador web con muchas características avanzadas e incluye un cliente de correo y BitTorrent. - -[Section.0415] -Description = Popularna przeglądarka internetowa z wieloma zaawansowanymi funkcjami, zawierająca klientów: poczty oraz BitTorrent. - -[Section.0419] -Description = Популярный браузер со многими дополнительными возможностями, включающий клиентов почты и BitTorrent. - -[Section.0422] -Description = Популярний браузер з багатьма додатковими можливостями, який включає в себе поштовий та BitTorrent клієнти. +; UTF-8 + +[Section] +Name = Opera +Version = 9.64 +Licence = Freeware +Description = The popular Opera Browser with many advanced features and including a Mail and BitTorrent client. +Size = 7.2M +Category = 5 +URLSite = http://www.opera.com/ +URLDownload = http://get4.opera.com/pub/opera/win/964/int/Opera_964_int_Setup.exe +CDPath = none + +[Section.0407] +Description = Der populäre Opera Browser mit vielen fortschrittlichen Eigenschaften, enthält einen Mail und BitTorrent Client. + +[Section.040a] +Description = Popular navegador web con muchas características avanzadas e incluye un cliente de correo y BitTorrent. + +[Section.040c] +Description = Le populaire navigateur Opera avec beaucoup de fonctionnalités avancées, incluant un client mail et BitTorrent. + +[Section.0415] +Description = Popularna przeglądarka internetowa z wieloma zaawansowanymi funkcjami, zawierająca klientów: poczty oraz BitTorrent. + +[Section.0419] +Description = Популярный браузер со многими дополнительными возможностями, включающий клиентов почты и BitTorrent. + +[Section.0422] +Description = Популярний браузер з багатьма додатковими можливостями, який включає в себе поштовий та BitTorrent клієнти. diff --git a/base/applications/rapps/rapps/putty.txt b/base/applications/rapps/rapps/putty.txt index f920f3b2db3..f73e9ea9287 100644 --- a/base/applications/rapps/rapps/putty.txt +++ b/base/applications/rapps/rapps/putty.txt @@ -1,24 +1,27 @@ -; UTF-8 - -[Section] -Name = PuTTY -Version = 0.60 -Licence = MIT -Description = A free SSH, Telnet, rlogin, and raw TCP client. -Size = 1.7MB -Category = 5 -URLSite = http://www.chiark.greenend.org.uk/~sgtatham/putty/ -URLDownload = http://the.earth.li/~sgtatham/putty/latest/x86/putty-0.60-installer.exe -CDPath = none - -[Section.0407] -Description = Ein freier SSH-, Telnet-, rlogin- und TCP-Client. - -[Section.040a] -Description = Un ciente SSH, Telnet, rlogin y TCP gratuito. - -[Section.0415] -Description = Darmowy klient obsługujący protokoły SSH, Telnet, rlogin oraz bezpośrednie TCP. - -[Section.0422] -Description = Безплатний SSH, Telnet, rlogin та raw TCP клієнт. +; UTF-8 + +[Section] +Name = PuTTY +Version = 0.60 +Licence = MIT +Description = A free SSH, Telnet, rlogin, and raw TCP client. +Size = 1.7MB +Category = 5 +URLSite = http://www.chiark.greenend.org.uk/~sgtatham/putty/ +URLDownload = http://the.earth.li/~sgtatham/putty/latest/x86/putty-0.60-installer.exe +CDPath = none + +[Section.0407] +Description = Ein freier SSH-, Telnet-, rlogin- und TCP-Client. + +[Section.040a] +Description = Un ciente SSH, Telnet, rlogin y TCP gratuito. + +[Section.040c] +Description = Un client SSH, Telnet, rlogin et raw TCP gratuit. + +[Section.0415] +Description = Darmowy klient obsługujący protokoły SSH, Telnet, rlogin oraz bezpośrednie TCP. + +[Section.0422] +Description = Безплатний SSH, Telnet, rlogin та raw TCP клієнт. diff --git a/base/applications/rapps/rapps/python.txt b/base/applications/rapps/rapps/python.txt index f18ae1ccfca..40aa3ead5d8 100644 --- a/base/applications/rapps/rapps/python.txt +++ b/base/applications/rapps/rapps/python.txt @@ -1,22 +1,24 @@ -; UTF-8 - -[Section] -Name = Python -Version = 2.7.1 -Licence = GPL/LGPL -Description = A remarkably powerful dynamic programming language. -Size = 15.0MB -Category = 7 -URLSite = http://www.python.org/ -URLDownload = http://www.python.org/ftp/python/2.7.1/python-2.7.1.msi -CDPath = none - -[Section.0407] -Description = Eine sehr mächtige, dynamische Programmiersprache. - - -[Section.0415] -Description = Potęży i dynamiczny język programowania. - -[Section.0422] -Description = Дуже потужна динамічна мова програмування. +; UTF-8 + +[Section] +Name = Python +Version = 2.7.1 +Licence = GPL/LGPL +Description = A remarkably powerful dynamic programming language. +Size = 15.0MB +Category = 7 +URLSite = http://www.python.org/ +URLDownload = http://www.python.org/ftp/python/2.7.1/python-2.7.1.msi +CDPath = none + +[Section.0407] +Description = Eine sehr mächtige, dynamische Programmiersprache. + +[Section.040c] +Description = Un langage de programmation dynamique remarquablement puissant. + +[Section.0415] +Description = Potęży i dynamiczny język programowania. + +[Section.0422] +Description = Дуже потужна динамічна мова програмування. diff --git a/base/applications/rapps/rapps/remood.txt b/base/applications/rapps/rapps/remood.txt index dd58417f4fa..7a05e5dc8f9 100644 --- a/base/applications/rapps/rapps/remood.txt +++ b/base/applications/rapps/rapps/remood.txt @@ -1,21 +1,24 @@ -; UTF-8 - -[Section] -Name = ReMooD -Version = 0.8a -Licence = GPL -Description = ReMooD is a source port of Doom Legacy. It aims to provide the classic Legacy Experience with new features and more stability. This supports Windows 98/98SE/ME/NT/2000/XP/2003/ Vista/2008/7/XP 64-bit/2003 64-bit/Vista 64-bit/2008 64-bit/7 64-bit; ReactOS 0.3.x and higher; and Linux (x86 and x86_64). -Size = 1.2M -Category = 4 -URLSite = http://remood.sourceforge.net/ -URLDownload = http://ovh.dl.sourceforge.net/project/remood/ReMooD/0.8a/remoodsetup-win32_08a.exe -CDPath = none - -[Section.0407] -Description = ReMooD ist ein Port des Doom Legacy Sources. Es versucht das klassische Legacy Erfahrung zusammen mit neuen Features und mehr Stabilitt zu bieten. Untersttzt werden Windows 98/98SE/ME/NT/2000/XP/2003/ Vista/2008/7/XP 64-bit/2003 64-bit/Vista 64-bit/2008 64-bit/7 64-bit; ReactOS 0.3.x und hher; und Linux (x86 und x86_64). - -[Section.0415] -Description = rdowy port Doom. Jego celem jest zapewnienie rozrywki znanej z klasycznej wersji z nowymi funkcjami, i lepsz stabilnoci. Obsuguje Windows 98/98SE/ME/NT/2000/XP/2003/ Vista/2008/7/XP 64-bit/2003 64-bit/Vista 64-bit/2008 64-bit/7 64-bit; ReactOS 0.3.x i wysze; i Linux (x86 i x86_64). - -[Section.0422] -Description = ReMooD э Портом вихідних кодів Doom Legacy. Його метою є додати нові можливості та стабільність до досвіду класичного Legacy. Він підтримує Windows 98/98SE/ME/NT/2000/XP/2003/ Vista/2008/7/XP 64-bit/2003 64-bit/Vista 64-bit/2008 64-bit/7 64-bit; ReactOS 0.3.x та новіші; а також Linux (x86 та x86_64). +; UTF-8 + +[Section] +Name = ReMooD +Version = 0.8a +Licence = GPL +Description = ReMooD is a source port of Doom Legacy. It aims to provide the classic Legacy Experience with new features and more stability. +Size = 1.2M +Category = 4 +URLSite = http://remood.sourceforge.net/ +URLDownload = http://ovh.dl.sourceforge.net/project/remood/ReMooD/0.8a/remoodsetup-win32_08a.exe +CDPath = none + +[Section.0407] +Description = ReMooD ist ein Port des Doom Legacy Sources. Es versucht das klassische Legacy Erfahrung zusammen mit neuen Features und mehr Stabilität zu bieten. + +[Section.040c] +Description = ReMood est un portage du source de Doom Legacy. Son but est de fournir l'expérience classique de Legacy avec de nouvelles fonctionnalités et plus de stabilité. + +[Section.0415] +Description = Źródłowy port Doom. Jego celem jest zapewnienie rozrywki znanej z klasycznej wersji z nowymi funkcjami i lepszą stabilnością. + +[Section.0422] +Description = ReMooD э Портом вихідних кодів Doom Legacy. Його метою є додати нові можливості та стабільність до досвіду класичного Legacy. diff --git a/base/applications/rapps/rapps/rosbe.txt b/base/applications/rapps/rapps/rosbe.txt index c8a6990a752..6106b47b3be 100644 --- a/base/applications/rapps/rapps/rosbe.txt +++ b/base/applications/rapps/rapps/rosbe.txt @@ -1,27 +1,30 @@ -; UTF-8 - -[Section] -Name = ReactOS Build Environment -Version = 1.5.1.1 -Licence = GPL -Description = Allows you to build the ReactOS Source. For more instructions see ReactOS wiki. -Size = 13.8MB -Category = 7 -URLSite = http://reactos.org/wiki/Build_Environment -URLDownload = http://ovh.dl.sourceforge.net/project/reactos/RosBE-Windows/i386/1.5.1/RosBE-1.5.1.1.exe -CDPath = none - -[Section.0405] -Description = Dovoluje zkompilovat zdrojový kód systému ReactOS. Pro další detaily viz. ReactOS wiki. - -[Section.0407] -Description = Erlaubt es Ihnen den ReactOS Source Code zu kompilieren. Im ReactOS-Wiki finden Sie dazu nähere Anweisungen. - -[Section.040a] -Description = Te permite compilar el código de ReactOS. Para más instrucciones consulta la wiki de ReactOS. - -[Section.0415] -Description = Pozwala zbudować obraz płyty ReactOS ze źródeł. Więcej informacji na Wiki ReactOS. - -[Section.0422] -Description = Дозволяє зібрати ReactOS з вихідних кодів. За детальною інформацією дивіться в ReactOS Вікі. +; UTF-8 + +[Section] +Name = ReactOS Build Environment +Version = 1.5.1.1 +Licence = GPL +Description = Allows you to build the ReactOS Source. For more instructions see ReactOS wiki. +Size = 13.8MB +Category = 7 +URLSite = http://reactos.org/wiki/Build_Environment +URLDownload = http://ovh.dl.sourceforge.net/project/reactos/RosBE-Windows/i386/1.5.1/RosBE-1.5.1.1.exe +CDPath = none + +[Section.0405] +Description = Dovoluje zkompilovat zdrojový kód systému ReactOS. Pro další detaily viz. ReactOS wiki. + +[Section.0407] +Description = Erlaubt es Ihnen den ReactOS Source Code zu kompilieren. Im ReactOS-Wiki finden Sie dazu nähere Anweisungen. + +[Section.040a] +Description = Te permite compilar el código de ReactOS. Para más instrucciones consulta la wiki de ReactOS. + +[Section.040c] +Description = Vous permet de compiler le code source de ReactOS. Pour plus d'instruction, reportez-vous au wiki ReactOS. + +[Section.0415] +Description = Pozwala zbudować obraz płyty ReactOS ze źródeł. Więcej informacji na Wiki ReactOS. + +[Section.0422] +Description = Дозволяє зібрати ReactOS з вихідних кодів. За детальною інформацією дивіться в ReactOS Вікі. diff --git a/base/applications/rapps/rapps/rosbeamd64.txt b/base/applications/rapps/rapps/rosbeamd64.txt index 989cd3bcd19..357c303dfca 100644 --- a/base/applications/rapps/rapps/rosbeamd64.txt +++ b/base/applications/rapps/rapps/rosbeamd64.txt @@ -1,27 +1,30 @@ -; UTF-8 - -[Section] -Name = ReactOS Build Environment AMD64 Addon -Version = 1.4b -Licence = GPL -Description = Allows you to build the ReactOS AMD64 Source. For more instructions see ReactOS wiki. -Size = 15.4MB -Category = 7 -URLSite = http://reactos.org/wiki/Build_Environment/ -URLDownload = http://dreimer.bplaced.net/rosbe/RosBE64-1.4b.exe -CDPath = none - -[Section.0405] -Description = Dovoluje zkompilovat zdrojový kód systému ReactOS AMD64. Pro další detaily viz. ReactOS wiki. - -[Section.0407] -Description = Erlaubt es Ihnen den ReactOS AMD64 Source Code zu kompilieren. Im ReactOS-Wiki finden Sie dazu nähere Anweisungen. - -[Section.040a] -Description = Te permite compilar el código de ReactOS AMD64. Para más instrucciones consulta la wiki de ReactOS. - -[Section.0415] -Description = Pozwala zbudować obraz płyty ReactOS AMD64 ze źródeł. Więcej informacji na Wiki ReactOS. - -[Section.0422] -Description = Дозволяє зібрати ReactOS AMD64 з вихідних кодів. За детальною інформацією дивіться в ReactOS Вікі. +; UTF-8 + +[Section] +Name = ReactOS Build Environment AMD64 Addon +Version = 1.4b +Licence = GPL +Description = Allows you to build the ReactOS AMD64 Source. For more instructions see ReactOS wiki. +Size = 15.4MB +Category = 7 +URLSite = http://reactos.org/wiki/Build_Environment/ +URLDownload = http://dreimer.bplaced.net/rosbe/RosBE64-1.4b.exe +CDPath = none + +[Section.0405] +Description = Dovoluje zkompilovat zdrojový kód systému ReactOS AMD64. Pro další detaily viz. ReactOS wiki. + +[Section.0407] +Description = Erlaubt es Ihnen den ReactOS AMD64 Source Code zu kompilieren. Im ReactOS-Wiki finden Sie dazu nähere Anweisungen. + +[Section.040a] +Description = Te permite compilar el código de ReactOS AMD64. Para más instrucciones consulta la wiki de ReactOS. + +[Section.040c] +Description = Vous permet de compiler le code source de ReactOS pour AMD64. Pour plus d'instruction, reportez-vous au wiki ReactOS. + +[Section.0415] +Description = Pozwala zbudować obraz płyty ReactOS AMD64 ze źródeł. Więcej informacji na Wiki ReactOS. + +[Section.0422] +Description = Дозволяє зібрати ReactOS AMD64 з вихідних кодів. За детальною інформацією дивіться в ReactOS Вікі. diff --git a/base/applications/rapps/rapps/rosbearm.txt b/base/applications/rapps/rapps/rosbearm.txt index 18eb22b61ff..4db452a36b6 100644 --- a/base/applications/rapps/rapps/rosbearm.txt +++ b/base/applications/rapps/rapps/rosbearm.txt @@ -1,24 +1,27 @@ -; UTF-8 - -[Section] -Name = ReactOS Build Environment ARM Addon -Version = 1.0 -Licence = GPL -Description = Allows you to build the ReactOS ARM Source. For more instructions see ReactOS wiki. -Size = 11.1MB -Category = 7 -URLSite = http://reactos.org/wiki/Build_Environment/ -URLDownload = http://ovh.dl.sourceforge.net/project/reactos/RosBE-Windows/arm/1.0/RosBE-ARM-1.0.exe -CDPath = none - -[Section.0407] -Description = Erlaubt es Ihnen den ReactOS ARM Source Code zu kompilieren. Im ReactOS-Wiki finden Sie dazu nähere Anweisungen. - -[Section.040a] -Description = Te permite compilar el código de ReactOS ARM. Para más instrucciones consulta la wiki de ReactOS. - -[Section.0415] -Description = Pozwala zbudować obraz płyty ReactOS ARM ze źródeł. Więcej informacji na Wiki ReactOS. - -[Section.0422] -Description = Дозволяє зібрати ReactOS ARM з вихідних кодів. За детальною інформацією дивіться в ReactOS Вікі. +; UTF-8 + +[Section] +Name = ReactOS Build Environment ARM Addon +Version = 1.0 +Licence = GPL +Description = Allows you to build the ReactOS ARM Source. For more instructions see ReactOS wiki. +Size = 11.1MB +Category = 7 +URLSite = http://reactos.org/wiki/Build_Environment/ +URLDownload = http://ovh.dl.sourceforge.net/project/reactos/RosBE-Windows/arm/1.0/RosBE-ARM-1.0.exe +CDPath = none + +[Section.0407] +Description = Erlaubt es Ihnen den ReactOS ARM Source Code zu kompilieren. Im ReactOS-Wiki finden Sie dazu nähere Anweisungen. + +[Section.040a] +Description = Te permite compilar el código de ReactOS ARM. Para más instrucciones consulta la wiki de ReactOS. + +[Section.040c] +Description = Vous permet de compiler le code source de ReactOS pour ARM. Pour plus d'instruction, reportez-vous au wiki ReactOS. + +[Section.0415] +Description = Pozwala zbudować obraz płyty ReactOS ARM ze źródeł. Więcej informacji na Wiki ReactOS. + +[Section.0422] +Description = Дозволяє зібрати ReactOS ARM з вихідних кодів. За детальною інформацією дивіться в ReactOS Вікі. diff --git a/base/applications/rapps/rapps/sambatng.txt b/base/applications/rapps/rapps/sambatng.txt index 37dae7f7fec..a76bf5f5c74 100644 --- a/base/applications/rapps/rapps/sambatng.txt +++ b/base/applications/rapps/rapps/sambatng.txt @@ -1,24 +1,27 @@ -; UTF-8 - -[Section] -Name = Samba TNG -Version = 0.5-RC1 -Licence = GPL -Description = This tool allows you to access your Windows shared folders/printers with ReactOS. -Size = 2.1MB -Category = 5 -URLSite = http://samba-tng.org/ -URLDownload = http://svn.reactos.org/packages/samba-tng.exe -CDPath = none - -[Section.0407] -Description = Dieses Werkzeug erlaubt den Zugriff auf Windows' gemeinsame Verzeichnisse und Drucker aus ReactOS heraus. - -[Section.040a] -Description = Esta utilidad le permite acceder a sus carpetas e impresoras compartidas en Windows con ReactOS. - -[Section.0415] -Description = Narzędzie pozwalające na dostęp z poziomu ReactOSa do współdzielonych folderów/drukarek Windows. - -[Section.0422] -Description = Цей інструмент дозволяє отримати доступ до спільних тек/принтерів Windows з ReactOSа. +; UTF-8 + +[Section] +Name = Samba TNG +Version = 0.5-RC1 +Licence = GPL +Description = This tool allows you to access your Windows shared folders/printers with ReactOS. +Size = 2.1MB +Category = 5 +URLSite = http://samba-tng.org/ +URLDownload = http://svn.reactos.org/packages/samba-tng.exe +CDPath = none + +[Section.0407] +Description = Dieses Werkzeug erlaubt den Zugriff auf Windows' gemeinsame Verzeichnisse und Drucker aus ReactOS heraus. + +[Section.040a] +Description = Esta utilidad le permite acceder a sus carpetas e impresoras compartidas en Windows con ReactOS. + +[Section.040c] +Description = Cet outil vous permet d'accéder à vos répertoire/imprimantes partagés Windows avec ReactOS. + +[Section.0415] +Description = Narzędzie pozwalające na dostęp z poziomu ReactOSa do współdzielonych folderów/drukarek Windows. + +[Section.0422] +Description = Цей інструмент дозволяє отримати доступ до спільних тек/принтерів Windows з ReactOSа. diff --git a/base/applications/rapps/rapps/sbforvmware.txt b/base/applications/rapps/rapps/sbforvmware.txt index 4b73234b775..9fac3b81bfd 100644 --- a/base/applications/rapps/rapps/sbforvmware.txt +++ b/base/applications/rapps/rapps/sbforvmware.txt @@ -1,48 +1,54 @@ -; UTF-8 - -[Section] -Name = SoundBlaster Driver for VMWare -Version = 5.12.1.5017 -Licence = Unknown -Description = Unzip in the "ReactOS" folder then restart ReactOS twice. -Size = 2.2MB -Category = 13 -URLSite = Unknown -URLDownload = http://svn.reactos.org/packages/sb_vmware.exe -CDPath = none - -[Section.0405] -Name = Ovladač SoundBlaster pro VMWare -Licence = Neznámá -Description = Rozbalte do složky "ReactOS" a pak ReactOS dvakrát restartujte. -URLSite = Neznámá - -[Section.0407] -Name = SoundBlaster Treiber für VMWare -Licence = Unbekannt -Description = Entpacken in das "ReactOS"-Verzeichnis und ReactOS zweimal neustarten. -URLSite = Unbekannt - -[Section.040a] -Name = Driver SoundBlaster para VMWare -Licence = Desconocida -Description = Descomprimir en la carpeta "Reactos" y reiniciar Reactos dos veces. -URLSite = Desconocida - -[Section.0415] -Name = Sterownik SoundBlaster dla VMWare -Licence = Nieznana -Description = Rozpakuj zawartość w folderze "ReactOS" i dwukrotnie zrestartuj system. -URLSite = Nieznana - -[Section.0419] -Name = Драйвер SoundBlaster для VMWare -Licence = Не указано -Description = Pазархивируйте содержимое в папку "ReactOS", затем дважды перезагрузите систему. -URLSite = Не указано - -[Section.0422] -Name = Драйвер SoundBlaster для VMWare -Licence = Невідома -Description = Pозархівуйте вміст в теку "ReactOS" після чого двічі перезавантажте систему. -URLSite = Не вказано +; UTF-8 + +[Section] +Name = SoundBlaster Driver for VMWare +Version = 5.12.1.5017 +Licence = Unknown +Description = Unzip in the "ReactOS" folder then restart ReactOS twice. +Size = 2.2MB +Category = 13 +URLSite = Unknown +URLDownload = http://svn.reactos.org/packages/sb_vmware.exe +CDPath = none + +[Section.0405] +Name = Ovladač SoundBlaster pro VMWare +Licence = Neznámá +Description = Rozbalte do složky "ReactOS" a pak ReactOS dvakrát restartujte. +URLSite = Neznámá + +[Section.0407] +Name = SoundBlaster Treiber für VMWare +Licence = Unbekannt +Description = Entpacken in das "ReactOS"-Verzeichnis und ReactOS zweimal neustarten. +URLSite = Unbekannt + +[Section.040a] +Name = Driver SoundBlaster para VMWare +Licence = Desconocida +Description = Descomprimir en la carpeta "Reactos" y reiniciar Reactos dos veces. +URLSite = Desconocida + +[Section.040c] +Name = Pilote SoundBlaster pour VMWare +Licence = Inconnue +Description = Dézippez dans le répertoire "ReactOS" puis redémarrez deux fois. +URLSite = Inconnue + +[Section.0415] +Name = Sterownik SoundBlaster dla VMWare +Licence = Nieznana +Description = Rozpakuj zawartość w folderze "ReactOS" i dwukrotnie zrestartuj system. +URLSite = Nieznana + +[Section.0419] +Name = Драйвер SoundBlaster для VMWare +Licence = Не указано +Description = Pазархивируйте содержимое в папку "ReactOS", затем дважды перезагрузите систему. +URLSite = Не указано + +[Section.0422] +Name = Драйвер SoundBlaster для VMWare +Licence = Невідома +Description = Pозархівуйте вміст в теку "ReactOS" після чого двічі перезавантажте систему. +URLSite = Не вказано diff --git a/base/applications/rapps/rapps/scite.txt b/base/applications/rapps/rapps/scite.txt index 2b5ae7117f4..a323c6d24a1 100644 --- a/base/applications/rapps/rapps/scite.txt +++ b/base/applications/rapps/rapps/scite.txt @@ -1,24 +1,27 @@ -; UTF-8 - -[Section] -Name = SciTE -Version = 2.23 -Licence = Freeware -Description = SciTE is a SCIntilla based Text Editor. Originally built to demonstrate Scintilla, it has grown to be a generally useful editor with facilities for building and running programs. -Size = 0.6M -Category = 7 -URLSite = http://www.scintilla.org/ -URLDownload = http://kent.dl.sourceforge.net/project/scintilla/SciTE/2.23/Sc223.exe -CDPath = none - -[Section.0407] -Description = SciTE ist ein SCIntilla basierter Text Editor. Ursprünglich wurde er erstellt, um Scintilla vorzuführen, wuchs aber zu einem nützlichen Editor mit der Fähigkeit Programme zu erstellen und auszuführen. - -[Section.040a] -Description = Editor de texto basado en SCIntilla. Originalmente creado para demostrar Scintilla, a crecido para ser un gran editor con capacidad para crear y ejecutar programas. - -[Section.0415] -Description = SciTE to edytor tekstu bazowany na SCIntilla. Oryginalnie stworzony aby pokazać Scintille, stał sie ogólnie przydatnym edytorem z infrastrukturą potrzebną do tworzenia i uruchamiania programów. - -[Section.0422] -Description = Текстовий редактор на основі SCIntilla. Був зібраний як презентація Scintilla, але виріс до редактора загального користування з засобами збирання та запуску програм. +; UTF-8 + +[Section] +Name = SciTE +Version = 2.24 +Licence = Freeware +Description = SciTE is a SCIntilla based Text Editor. Originally built to demonstrate Scintilla, it has grown to be a generally useful editor with facilities for building and running programs. +Size = 0.6M +Category = 7 +URLSite = http://www.scintilla.org/ +URLDownload = http://kent.dl.sourceforge.net/project/scintilla/SciTE/2.24/Sc224.exe +CDPath = none + +[Section.0407] +Description = SciTE ist ein SCIntilla basierter Text Editor. Ursprünglich wurde er erstellt, um Scintilla vorzuführen, wuchs aber zu einem nützlichen Editor mit der Fähigkeit Programme zu erstellen und auszuführen. + +[Section.040a] +Description = Editor de texto basado en SCIntilla. Originalmente creado para demostrar Scintilla, a crecido para ser un gran editor con capacidad para crear y ejecutar programas. + +[Section.040c] +Description = SciTE est un éditeur de texte basé sur SCIntilla. Originelement réalisé pour montrer Scintilla, il a évolué pour devenir un éditeur généralement utile avec des options pour compiler et lancer des programmes. + +[Section.0415] +Description = SciTE to edytor tekstu bazowany na SCIntilla. Oryginalnie stworzony aby pokazać Scintille, stał sie ogólnie przydatnym edytorem z infrastrukturą potrzebną do tworzenia i uruchamiania programów. + +[Section.0422] +Description = Текстовий редактор на основі SCIntilla. Був зібраний як презентація Scintilla, але виріс до редактора загального користування з засобами збирання та запуску програм. diff --git a/base/applications/rapps/rapps/scummvm.txt b/base/applications/rapps/rapps/scummvm.txt index 55fd2204af1..f5954442c32 100644 --- a/base/applications/rapps/rapps/scummvm.txt +++ b/base/applications/rapps/rapps/scummvm.txt @@ -1,24 +1,27 @@ -; UTF-8 - -[Section] -Name = ScummVM -Version = 1.2.1 -Licence = GPL -Description = Sam and Max, Day of the Tentacle, etc on ReactOS. -Size = 4.0MB -Category = 4 -URLSite = http://scummvm.org/ -URLDownload = http://dfn.dl.sourceforge.net/project/scummvm/scummvm/1.2.1/scummvm-1.2.1-win32.exe -CDPath = none - -[Section.0407] -Description = Sam and Max, Day of the Tentacle usw in ReactOS. - -[Section.040a] -Description = Sam and Max, Day of the Tentacle en ReactOS. - -[Section.0415] -Description = Program pozwalający uruchomić stare gry przygodowe (Sam and Max, Day of the Tentacle, Monkey Island) w ReactOS. - -[Section.0422] -Description = Дозволить грати Sam and Max, Day of the Tentacle та інші класичні ігри в ReactOS. +; UTF-8 + +[Section] +Name = ScummVM +Version = 1.2.1 +Licence = GPL +Description = Sam and Max, Day of the Tentacle, etc on ReactOS. +Size = 4.0MB +Category = 4 +URLSite = http://scummvm.org/ +URLDownload = http://dfn.dl.sourceforge.net/project/scummvm/scummvm/1.2.1/scummvm-1.2.1-win32.exe +CDPath = none + +[Section.0407] +Description = Sam and Max, Day of the Tentacle usw in ReactOS. + +[Section.040a] +Description = Sam and Max, Day of the Tentacle en ReactOS. + +[Section.040c] +Description = Sam and Max, Day of the Tentacle, etc sur ReactOS. + +[Section.0415] +Description = Program pozwalający uruchomić stare gry przygodowe (Sam and Max, Day of the Tentacle, Monkey Island) w ReactOS. + +[Section.0422] +Description = Дозволить грати Sam and Max, Day of the Tentacle та інші класичні ігри в ReactOS. diff --git a/base/applications/rapps/rapps/sdl_mixer.txt b/base/applications/rapps/rapps/sdl_mixer.txt index 5f74ea6be10..c1104f3adfb 100644 --- a/base/applications/rapps/rapps/sdl_mixer.txt +++ b/base/applications/rapps/rapps/sdl_mixer.txt @@ -1,27 +1,30 @@ -; UTF-8 - -[Section] -Name = Simple Direct Media Layer (SDL) Mixer -Version = 1.2.11 -Licence = LGPL -Description = Needed for some Open Source Games to run. You need 7-Zip or a similar Utility to extract it. -Size = 307kB -Category = 14 -URLSite = http://www.libsdl.org/projects/SDL_mixer/ -URLDownload = http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-1.2.11-win32.zip -CDPath = none - -[Section.0405] -Description = Nutný pro spuštění některých open source her. K rozbalení je nutný 7-zip nebo podobný nástroj. - -[Section.0407] -Description = Erforderlich um einige Open Source Spiele auszuführen. Sie brauchen 7-Zip oder einen ähnlichen Entpacker um es zu entpacken. - -[Section.040a] -Description = Necesario para ejecutar varios juegos de código abierto. Necesita 7-Zip o una utilidad similar para extraerlo. - -[Section.0415] -Description = Biblioteka wymagana przez niektóre gry (zwłaszcza te o otwartym źródle). Do jej rozpakowania potrzebny jest 7-Zip lub podobny program. - -[Section.0422] -Description = Необхідний для роботи декотрих відкритих ігор. Вам потрібен 7-Zip або подібна утиліта щоб розпакувати його. +; UTF-8 + +[Section] +Name = Simple Direct Media Layer (SDL) Mixer +Version = 1.2.11 +Licence = LGPL +Description = Needed for some Open Source Games to run. You need 7-Zip or a similar Utility to extract it. +Size = 307kB +Category = 14 +URLSite = http://www.libsdl.org/projects/SDL_mixer/ +URLDownload = http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-1.2.11-win32.zip +CDPath = none + +[Section.0405] +Description = Nutný pro spuštění některých open source her. K rozbalení je nutný 7-zip nebo podobný nástroj. + +[Section.0407] +Description = Erforderlich um einige Open Source Spiele auszuführen. Sie brauchen 7-Zip oder einen ähnlichen Entpacker um es zu entpacken. + +[Section.040a] +Description = Necesario para ejecutar varios juegos de código abierto. Necesita 7-Zip o una utilidad similar para extraerlo. + +[Section.040c] +Description = Nécessaire pour faire tourner certains jeux open source. Vous aurez besoin de 7-Zip ou d'un outil similaire pour l'extraire. + +[Section.0415] +Description = Biblioteka wymagana przez niektóre gry (zwłaszcza te o otwartym źródle). Do jej rozpakowania potrzebny jest 7-Zip lub podobny program. + +[Section.0422] +Description = Необхідний для роботи декотрих відкритих ігор. Вам потрібен 7-Zip або подібна утиліта щоб розпакувати його. diff --git a/base/applications/rapps/rapps/sdl_runtime.txt b/base/applications/rapps/rapps/sdl_runtime.txt index 4d572846270..c9377ae02c8 100644 --- a/base/applications/rapps/rapps/sdl_runtime.txt +++ b/base/applications/rapps/rapps/sdl_runtime.txt @@ -1,28 +1,32 @@ -; UTF-8 - -[Section] -Name = Simple Direct Media Layer (SDL) Runtime -Version = 1.2.14 -Licence = LGPL -Description = Needed for many Open Source Games to run. You need 7-Zip or a similar Utility to extract it. -Size = 145kB -Category = 14 -URLSite = http://www.libsdl.org/ -URLDownload = http://www.libsdl.org/release/SDL-1.2.14-win32.zip -CDPath = none - -[Section.0407] -Name = Simple Direct Media Layer (SDL) Laufzeitsystem -Description = Erforderlich um einige Open Source Spiele auszuführen. Sie brauchen 7-Zip oder einen ähnlichen Entpacker um es zu entpacken. - -[Section.040a] -Name = Libería Simple Direct Media Layer (SDL) -Description = Necesario para ejecutar varios juegos de código abierto. Necesita 7-Zip o una utilidad similar para extraerlo. - -[Section.0415] -Name = Biblioteka uruchomieniowa Simple Direct Media Layer (SDL) -Description = Wymagana przez wiele gier (głównie o otwartym źródle). Do jej rozpakowania potrzebny jest program 7-Zip lub podobny. - -[Section.0422] -Name = Бібліотека Simple Direct Media Layer (SDL) -Description = Необхідна для роботи багатьох відкритих ігор. Вам потрібен 7-Zip або подібна утиліта щоб розпакувати її. +; UTF-8 + +[Section] +Name = Simple Direct Media Layer (SDL) Runtime +Version = 1.2.14 +Licence = LGPL +Description = Needed for many Open Source Games to run. You need 7-Zip or a similar Utility to extract it. +Size = 145kB +Category = 14 +URLSite = http://www.libsdl.org/ +URLDownload = http://www.libsdl.org/release/SDL-1.2.14-win32.zip +CDPath = none + +[Section.0407] +Name = Simple Direct Media Layer (SDL) Laufzeitsystem +Description = Erforderlich um einige Open Source Spiele auszuführen. Sie brauchen 7-Zip oder einen ähnlichen Entpacker um es zu entpacken. + +[Section.040a] +Name = Libería Simple Direct Media Layer (SDL) +Description = Necesario para ejecutar varios juegos de código abierto. Necesita 7-Zip o una utilidad similar para extraerlo. + +[Section.040c] +Name = Bibliothèque Simple Direct Media Layer (SDL) +Description = Nécessaire pour faire tourner certains jeux open source. Vous aurez besoin de 7-Zip ou d'un outil similaire pour l'extraire. + +[Section.0415] +Name = Biblioteka uruchomieniowa Simple Direct Media Layer (SDL) +Description = Wymagana przez wiele gier (głównie o otwartym źródle). Do jej rozpakowania potrzebny jest program 7-Zip lub podobny. + +[Section.0422] +Name = Бібліотека Simple Direct Media Layer (SDL) +Description = Необхідна для роботи багатьох відкритих ігор. Вам потрібен 7-Zip або подібна утиліта щоб розпакувати її. diff --git a/base/applications/rapps/rapps/seamonkey.txt b/base/applications/rapps/rapps/seamonkey.txt index c9543c8c5ea..82e5a0401ff 100644 --- a/base/applications/rapps/rapps/seamonkey.txt +++ b/base/applications/rapps/rapps/seamonkey.txt @@ -1,32 +1,37 @@ -; UTF-8 - -[Section] -Name = Mozilla SeaMonkey -Version = 2.0.11 -Licence = MPL/GPL/LGPL -Description = Mozilla Suite is alive. This is the one and only Browser, Mail, Chat, and Composer bundle you will ever need. -Size = 10.1MB -Category = 5 -URLSite = http://www.seamonkey-project.org/ -URLDownload = http://releases.mozilla.org/pub/mozilla.org/seamonkey/releases/2.0.11/win32/en-US/SeaMonkey%20Setup%202.0.11.exe -CDPath = none - -[Section.0407] -Description = Mozilla Suite lebt. Dies ist das einzige Browser-, Mail-, Chat- and Composerwerkzeug-Bundle welches Sie benötigen. -Size = 10.0MB -URLDownload = http://releases.mozilla.org/pub/mozilla.org/seamonkey/releases/2.0.11/win32/de/SeaMonkey%20Setup%202.0.11.exe - -[Section.040a] -Description = La suite de Mozilla está viva. Es el primero y único navegador web, gestor de correo, lector de noticias, Chat y editor HTML que necesitarás. -Size = 10.0MB -URLDownload = http://releases.mozilla.org/pub/mozilla.org/seamonkey/releases/2.0.11/win32/es-ES/SeaMonkey%20Setup%202.0.11.exe - -[Section.0415] -Description = Pakiet Mozilla żyje. W zestawie: przeglądarka, klient poczty, IRC oraz Edytor HTML - wszystko, czego potrzebujesz. -Size = 10.8MB -URLDownload = http://releases.mozilla.org/pub/mozilla.org/seamonkey/releases/2.0.11/win32/pl/SeaMonkey%20Setup%202.0.11.exe - -[Section.0419] -Description = Продолжение Mozilla Suite. Включает браузер, почтовый клиент, IRC-клиент и HTML-редактор. -Size = 10.4MB -URLDownload = http://releases.mozilla.org/pub/mozilla.org/seamonkey/releases/2.0.11/win32/ru/SeaMonkey%20Setup%202.0.11.exe +; UTF-8 + +[Section] +Name = Mozilla SeaMonkey +Version = 2.0.12 +Licence = MPL/GPL/LGPL +Description = Mozilla Suite is alive. This is the one and only Browser, Mail, Chat, and Composer bundle you will ever need. +Size = 10.2MB +Category = 5 +URLSite = http://www.seamonkey-project.org/ +URLDownload = ftp://ftp.mozilla.org/pub/seamonkey/releases/2.0.12/win32/en-US/SeaMonkey%20Setup%202.0.12.exe +CDPath = none + +[Section.0407] +Description = Mozilla Suite lebt. Dies ist das einzige Browser-, Mail-, Chat- and Composerwerkzeug-Bundle welches Sie benötigen. +Size = 10.1MB +URLDownload = ftp://ftp.mozilla.org/pub/seamonkey/releases/2.0.12/win32/de/SeaMonkey%20Setup%202.0.12.exe + +[Section.040a] +Description = La suite de Mozilla está viva. Es el primero y único navegador web, gestor de correo, lector de noticias, Chat y editor HTML que necesitarás. +Size = 10.1MB +URLDownload = ftp://ftp.mozilla.org/pub/seamonkey/releases/2.0.12/win32/es-ES/SeaMonkey%20Setup%202.0.12.exe + +[Section.040c] +Description = La suite Mozilla est en vie. Ceci est le seul et l'unique package navigateur, client mail, client chat et composer dont vous aurez besoin. +Size = 10.1MB +URLDownload = ftp://ftp.mozilla.org/pub/seamonkey/releases/2.0.12/win32/fr/SeaMonkey%20Setup%202.0.12.exe + +[Section.0415] +Description = Pakiet Mozilla żyje. W zestawie: przeglądarka, klient poczty, IRC oraz Edytor HTML - wszystko, czego potrzebujesz. +Size = 11.0MB +URLDownload = ftp://ftp.mozilla.org/pub/seamonkey/releases/2.0.12/win32/pl/SeaMonkey%20Setup%202.0.12.exe + +[Section.0419] +Description = Продолжение Mozilla Suite. Включает браузер, почтовый клиент, IRC-клиент и HTML-редактор. +Size = 10.5MB +URLDownload = ftp://ftp.mozilla.org/pub/seamonkey/releases/2.0.12/win32/ru/SeaMonkey%20Setup%202.0.12.exe diff --git a/base/applications/rapps/rapps/smplayer.txt b/base/applications/rapps/rapps/smplayer.txt index de7520c1519..9cfd35f26b9 100644 --- a/base/applications/rapps/rapps/smplayer.txt +++ b/base/applications/rapps/rapps/smplayer.txt @@ -1,27 +1,30 @@ -; UTF-8 - -[Section] -Name = SMPlayer -Version = 0.6.9 -Licence = GPL -Description = SMPlayer. -Size = 14.2MB -Category = 1 -URLSite = http://smplayer.sourceforge.net/ -URLDownload = http://ovh.dl.sourceforge.net/project/smplayer/SMPlayer/0.6.9/smplayer-0.6.9-win32.exe -CDPath = none - -[Section.0407] -URLSite = http://smplayer.sourceforge.net/index.php?tr_lang=de - -[Section.040a] -URLSite = http://smplayer.sourceforge.net/index.php?tr_lang=es -Description = Interfaz gráfico para Mplayer (reproductor multimedia). - -[Section.0415] -URLSite = http://smplayer.sourceforge.net/index.php?tr_lang=pl -Description = Graficzna nakładka na MPlayer, otwarty odtwarzacz filmów. - -[Section.0422] -URLSite = http://smplayer.sourceforge.net/index.php?tr_lang=uk -Description = Графічний інтерфейс для MPlayer (мультимедійний плеєр). +; UTF-8 + +[Section] +Name = SMPlayer +Version = 0.6.9 +Licence = GPL +Description = SMPlayer. +Size = 14.2MB +Category = 1 +URLSite = http://smplayer.sourceforge.net/ +URLDownload = http://ovh.dl.sourceforge.net/project/smplayer/SMPlayer/0.6.9/smplayer-0.6.9-win32.exe +CDPath = none + +[Section.0407] +URLSite = http://smplayer.sourceforge.net/index.php?tr_lang=de + +[Section.040a] +URLSite = http://smplayer.sourceforge.net/index.php?tr_lang=es +Description = Interfaz gráfico para Mplayer (reproductor multimedia). + +[Section.040a] +URLSite = http://smplayer.sourceforge.net/index.php?tr_lang=fr + +[Section.0415] +URLSite = http://smplayer.sourceforge.net/index.php?tr_lang=pl +Description = Graficzna nakładka na MPlayer, otwarty odtwarzacz filmów. + +[Section.0422] +URLSite = http://smplayer.sourceforge.net/index.php?tr_lang=uk +Description = Графічний інтерфейс для MPlayer (мультимедійний плеєр). diff --git a/base/applications/rapps/rapps/steam.txt b/base/applications/rapps/rapps/steam.txt index 9d4a0af1012..615734a26d4 100644 --- a/base/applications/rapps/rapps/steam.txt +++ b/base/applications/rapps/rapps/steam.txt @@ -1,21 +1,24 @@ -; UTF-8 - -[Section] -Name = STEAM -Version = 1.0 -Licence = Freeware -Description = The STEAM Gaming platform used by many games these days. -Size = 1.5MB -Category = 4 -URLSite = http://steampowered.com/ -URLDownload = http://storefront.steampowered.com/download/SteamInstall.msi -CDPath = none - -[Section.0407] -Description = Die STEAM Spieleplattform, die von viele Spielen verwendet wird. - -[Section.0415] -Description = STEAM - platforma, którą używa obecnie wiele gier. - -[Section.0422] -Description = Ігрова платформа, що використовується багатьма іграми. +; UTF-8 + +[Section] +Name = STEAM +Version = 1.0 +Licence = Freeware +Description = The STEAM Gaming platform used by many games these days. +Size = 1.5MB +Category = 4 +URLSite = http://steampowered.com/ +URLDownload = http://storefront.steampowered.com/download/SteamInstall.msi +CDPath = none + +[Section.0407] +Description = Die STEAM Spieleplattform, die von viele Spielen verwendet wird. + +[Section.040c] +Description = La plateforme de jeu STEAM utilisée par beaucoup de jeux de nos jours. + +[Section.0415] +Description = STEAM - platforma, którą używa obecnie wiele gier. + +[Section.0422] +Description = Ігрова платформа, що використовується багатьма іграми. diff --git a/base/applications/rapps/rapps/sumatrapdf.txt b/base/applications/rapps/rapps/sumatrapdf.txt new file mode 100644 index 00000000000..abb9bc6926e --- /dev/null +++ b/base/applications/rapps/rapps/sumatrapdf.txt @@ -0,0 +1,18 @@ +; UTF-8 + +[Section] +Name = SumatraPDF +Version = 1.2 +Licence = GPLv3 +Description = Sumatra PDF is a slim, free, open-source PDF reader. Portable out of the box. +Size = 3.1MB +Category = 6 +URLSite = http://blog.kowalczyk.info/software/sumatrapdf/free-pdf-reader.html +URLDownload = http://kjkpub.s3.amazonaws.com/sumatrapdf/rel/SumatraPDF-1.2-install.exe +CDPath = none + +[Section.0407] +Description = Sumatra PDF ist ein freies, schlankes, Open-Source PDF-Anzeigeprogramm. + +[Section.0410] +Description = Sumatra PDF è un visualizzatore di file PDF. E' molto leggero ed è open source. diff --git a/base/applications/rapps/rapps/superfinder.txt b/base/applications/rapps/rapps/superfinder.txt index 9098b11e8db..350ac49bc84 100644 --- a/base/applications/rapps/rapps/superfinder.txt +++ b/base/applications/rapps/rapps/superfinder.txt @@ -1,18 +1,21 @@ -; UTF-8 - -[Section] -Name = Super Finder XT -Version = 1.6.2.1 -Licence = Freeware -Description = A fast and feature rich search Aapplication. -Size = 4.5MB -Category = 12 -URLSite = http://fsl.sytes.net/ssearchxt.html -URLDownload = http://fsl.sytes.net/releases/setup_SuperFinderXT.exe -CDPath = none - -[Section.0407] -Description = Eine schnelle und effektive Suchanwendung. - -[Section.0415] -Description = Szybka i bogata w opcje aplikacja szukająca. +; UTF-8 + +[Section] +Name = Super Finder XT +Version = 1.6.2.1 +Licence = Freeware +Description = A fast and feature rich search Application. +Size = 4.5MB +Category = 12 +URLSite = http://fsl.sytes.net/ssearchxt.html +URLDownload = http://fsl.sytes.net/releases/setup_SuperFinderXT.exe +CDPath = none + +[Section.0407] +Description = Eine schnelle und effektive Suchanwendung. + +[Section.040c] +Description = Une application de recherche rapide et riche en fonctionnalités. + +[Section.0415] +Description = Szybka i bogata w opcje aplikacja szukająca. diff --git a/base/applications/rapps/rapps/tahoma.txt b/base/applications/rapps/rapps/tahoma.txt index c5e57fdf4b4..68181fd4e0e 100644 --- a/base/applications/rapps/rapps/tahoma.txt +++ b/base/applications/rapps/rapps/tahoma.txt @@ -1,23 +1,27 @@ -; UTF-8 - -[Section] -Name = Microsoft Tahoma Font -Version = 1.0 -Licence = Unknown -Description = Tahoma Font pack needed by some apps (Steam). -Size = 305kB -Category = 14 -URLSite = http://support.microsoft.com/ -URLDownload = http://download.microsoft.com/download/office97pro/fonts/1/w95/en-us/tahoma32.exe -CDPath = none - -[Section.0407] -Licence = Unbekannt -Description = Tahoma Font pack, der von einigen Anwendungen benötigt wird (Steam). - -[Section.0415] -Description = Pakiet Czcionki Tahoma wymagany przez niektóre programy (np. Steam). - -[Section.0422] -Licence = Невідома -Description = Пакет шрифтів Tahoma, що необхідні деяким програмам (Steam). +; UTF-8 + +[Section] +Name = Microsoft Tahoma Font +Version = 1.0 +Licence = Unknown +Description = Tahoma Font pack needed by some apps (Steam). +Size = 305kB +Category = 14 +URLSite = http://support.microsoft.com/ +URLDownload = http://download.microsoft.com/download/office97pro/fonts/1/w95/en-us/tahoma32.exe +CDPath = none + +[Section.0407] +Licence = Unbekannt +Description = Tahoma Font pack, der von einigen Anwendungen benötigt wird (Steam). + +[Section.040c] +Licence = Inconnue +Description = Package pour la police Tahoma, nécessaire pour certaines applications (Steam). + +[Section.0415] +Description = Pakiet Czcionki Tahoma wymagany przez niektóre programy (np. Steam). + +[Section.0422] +Licence = Невідома +Description = Пакет шрифтів Tahoma, що необхідні деяким програмам (Steam). diff --git a/base/applications/rapps/rapps/thunderbird.txt b/base/applications/rapps/rapps/thunderbird.txt index 293389025d3..644933e5867 100644 --- a/base/applications/rapps/rapps/thunderbird.txt +++ b/base/applications/rapps/rapps/thunderbird.txt @@ -1,42 +1,48 @@ -; UTF-8 - -[Section] -Name = Mozilla Thunderbird -Version = 3.1.7 -Licence = MPL/GPL/LGPL -Description = The most popular and one of the best free Mail Clients out there. -Size = 9.0M -Category = 5 -URLSite = http://www.mozilla-europe.org/en/products/thunderbird/ -URLDownload = http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/3.1.7/win32/en-US/Thunderbird%20Setup%203.1.7.exe -CDPath = none - -[Section.0407] -Description = Der populärste und einer der besten freien Mail-Clients. -Size = 8.8M -URLSite = http://www.mozilla-europe.org/de/products/thunderbird/ -URLDownload = http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/3.1.7/win32/de/Thunderbird%20Setup%203.1.7.exe - -[Section.040a] -Description = El más popular y uno de los mejores clientes mail que hay. -Size = 8.8M -URLSite = http://www.mozilla-europe.org/es/products/thunderbird/ -URLDownload = http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/3.1.7/win32/es-ES/Thunderbird%20Setup%203.1.7.exe - -[Section.0415] -Description = Najpopularniejszy i jeden z najlepszych darmowych klientów poczty. -Size = 9.7M -URLSite = http://www.mozilla-europe.org/pl/products/thunderbird/ -URLDownload = http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/3.1.7/win32/pl/Thunderbird%20Setup%203.1.7.exe - -[Section.0419] -Description = Один из самых популярных и лучших бесплатных почтовых клиентов. -Size = 9.2M -URLSite = http://www.mozilla-europe.org/ru/products/thunderbird/ -URLDownload = http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/3.1.7/win32/ru/Thunderbird%20Setup%203.1.7.exe - -[Section.0422] -Description = Найпопулярніший та один з кращих поштових клієнтів. -Size = 9.2M -URLSite = http://www.mozillamessaging.com/uk/thunderbird/ -URLDownload = http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/3.1.7/win32/uk/Thunderbird%20Setup%203.1.7.exe +; UTF-8 + +[Section] +Name = Mozilla Thunderbird +Version = 3.1.9 +Licence = MPL/GPL/LGPL +Description = The most popular and one of the best free Mail Clients out there. +Size = 9.0M +Category = 5 +URLSite = http://www.mozilla-europe.org/en/products/thunderbird/ +URLDownload = ftp://ftp.mozilla.org/pub/thunderbird/releases/3.1.9/win32/en-US/Thunderbird%20Setup%203.1.9.exe +CDPath = none + +[Section.0407] +Description = Der populärste und einer der besten freien Mail-Clients. +Size = 8.8M +URLSite = http://www.mozilla-europe.org/de/products/thunderbird/ +URLDownload = ftp://ftp.mozilla.org/pub/thunderbird/releases/3.1.9/win32/de/Thunderbird%20Setup%203.1.9.exe + +[Section.040a] +Description = El más popular y uno de los mejores clientes mail que hay. +Size = 8.8M +URLSite = http://www.mozilla-europe.org/es/products/thunderbird/ +URLDownload = ftp://ftp.mozilla.org/pub/thunderbird/releases/3.1.9/win32/es-ES/Thunderbird%20Setup%203.1.9.exe + +[Section.040c] +Description = Le plus populaire et l'un des meilleurs clients mail gratuits disponible. +Size = 8.8M +URLSite = http://www.mozilla-europe.org/fr/products/thunderbird/ +URLDownload = ftp://ftp.mozilla.org/pub/thunderbird/releases/3.1.9/win32/fr/Thunderbird%20Setup%203.1.9.exe + +[Section.0415] +Description = Najpopularniejszy i jeden z najlepszych darmowych klientów poczty. +Size = 9.7M +URLSite = http://www.mozilla-europe.org/pl/products/thunderbird/ +URLDownload = ftp://ftp.mozilla.org/pub/thunderbird/releases/3.1.9/win32/pl/Thunderbird%20Setup%203.1.9.exe + +[Section.0419] +Description = Один из самых популярных и лучших бесплатных почтовых клиентов. +Size = 9.2M +URLSite = http://www.mozilla-europe.org/ru/products/thunderbird/ +URLDownload = ftp://ftp.mozilla.org/pub/thunderbird/releases/3.1.9/win32/ru/Thunderbird%20Setup%203.1.9.exe + +[Section.0422] +Description = Найпопулярніший та один з кращих поштових клієнтів. +Size = 9.2M +URLSite = http://www.mozillamessaging.com/uk/thunderbird/ +URLDownload = ftp://ftp.mozilla.org/pub/thunderbird/releases/3.1.9/win32/uk/Thunderbird%20Setup%203.1.9.exe diff --git a/base/applications/rapps/rapps/tileworld.txt b/base/applications/rapps/rapps/tileworld.txt index fe9cd2eb972..985eb61e8a8 100644 --- a/base/applications/rapps/rapps/tileworld.txt +++ b/base/applications/rapps/rapps/tileworld.txt @@ -1,24 +1,27 @@ -; UTF-8 - -[Section] -Name = Tile World -Version = 1.3.0 -Licence = GPL -Description = Nice Clone of Chip's Challenge originally made for the Atari Lynx. Includes free CCLP2 Graphics Pack, so you dont need the copyrighted Original. -Size = 1.2MB -Category = 4 -URLSite = http://www.muppetlabs.com/~breadbox/software/tworld/ -URLDownload = http://www.muppetlabs.com/~breadbox/pub/software/tworld/tworld-1.3.0-win32-CCLP2.exe -CDPath = none - -[Section.0407] -Description = Schöner Klon von Chip's Challenge ursprünglich etnwickelt für Atari Lynx. Enthält CCLP2 Graphics Pack, deshalb wird das urheberrechtlich geschützte Original nicht benötigt. - -[Section.040a] -Description = Clon de Chip's Challenge originalmente creado para Atari Lynx. Incluye el paquete gráfico gratuito CCLP2, así que no es necesario el original con copyright. - -[Section.0415] -Description = Udany klon gry Chip's Challenge z Atari Lynx. Zawiera darmowy zestaw grafik CCLP2. - -[Section.0422] -Description = Чудовий клон гри Chip's Challenge для Atari Lynx. Включено безплатний графічний пакет CCLP2, тому вам не потрібен оригінальний. +; UTF-8 + +[Section] +Name = Tile World +Version = 1.3.0 +Licence = GPL +Description = Nice Clone of Chip's Challenge originally made for the Atari Lynx. Includes free CCLP2 Graphics Pack, so you dont need the copyrighted Original. +Size = 1.2MB +Category = 4 +URLSite = http://www.muppetlabs.com/~breadbox/software/tworld/ +URLDownload = http://www.muppetlabs.com/~breadbox/pub/software/tworld/tworld-1.3.0-win32-CCLP2.exe +CDPath = none + +[Section.0407] +Description = Schöner Klon von Chip's Challenge ursprünglich etnwickelt für Atari Lynx. Enthält CCLP2 Graphics Pack, deshalb wird das urheberrechtlich geschützte Original nicht benötigt. + +[Section.040a] +Description = Clon de Chip's Challenge originalmente creado para Atari Lynx. Incluye el paquete gráfico gratuito CCLP2, así que no es necesario el original con copyright. + +[Section.040c] +Description = Clone sympathique de Chip's Challenge originelment fait pour Atari Lynx. Il inclut le pack de graphisme gratuit CCLP2, ainsi vous n'avez pas besoin de l'original sous copyrigth. + +[Section.0415] +Description = Udany klon gry Chip's Challenge z Atari Lynx. Zawiera darmowy zestaw grafik CCLP2. + +[Section.0422] +Description = Чудовий клон гри Chip's Challenge для Atari Lynx. Включено безплатний графічний пакет CCLP2, тому вам не потрібен оригінальний. diff --git a/base/applications/rapps/rapps/tuxpaint.txt b/base/applications/rapps/rapps/tuxpaint.txt index 60928f66842..f4c6e4d6528 100644 --- a/base/applications/rapps/rapps/tuxpaint.txt +++ b/base/applications/rapps/rapps/tuxpaint.txt @@ -1,27 +1,30 @@ -; UTF-8 - -[Section] -Name = TuxPaint -Version = 0.9.21c -Licence = GPL -Description = An Open Source bitmap graphics editor geared towards young children. -Size = 11MB -Category = 3 -URLSite = http://tuxpaint.org/ -URLDownload = http://ovh.dl.sourceforge.net/project/tuxpaint/tuxpaint/0.9.21c/tuxpaint-0.9.21c-win32-installer.exe -CDPath = none - -[Section.0405] -Description = Open source bitmapový editor určený dětem. - -[Section.0407] -Description = Ein Open Source Bitmap Zeichenprogramm für kleine Kinder. - -[Section.040a] -Description = Editor gráfico de imágenes pensado para niños de código abierto. - -[Section.0415] -Description = Otwarty program graficzny przeznaczony głównie dla dzieci. - -[Section.0422] -Description = Відкритий графічний редактор для малих дітей. +; UTF-8 + +[Section] +Name = TuxPaint +Version = 0.9.21c +Licence = GPL +Description = An Open Source bitmap graphics editor geared towards young children. +Size = 11MB +Category = 3 +URLSite = http://tuxpaint.org/ +URLDownload = http://ovh.dl.sourceforge.net/project/tuxpaint/tuxpaint/0.9.21c/tuxpaint-0.9.21c-win32-installer.exe +CDPath = none + +[Section.0405] +Description = Open source bitmapový editor určený dětem. + +[Section.0407] +Description = Ein Open Source Bitmap Zeichenprogramm für kleine Kinder. + +[Section.040a] +Description = Editor gráfico de imágenes pensado para niños de código abierto. + +[Section.040c] +Description = Un éditeur graphic bitmap open source orienté pour les jeunes enfants. + +[Section.0415] +Description = Otwarty program graficzny przeznaczony głównie dla dzieci. + +[Section.0422] +Description = Відкритий графічний редактор для малих дітей. diff --git a/base/applications/rapps/rapps/ultravnc.txt b/base/applications/rapps/rapps/ultravnc.txt index 7c107c1aba9..b8017499130 100644 --- a/base/applications/rapps/rapps/ultravnc.txt +++ b/base/applications/rapps/rapps/ultravnc.txt @@ -1,21 +1,24 @@ -; UTF-8 - -[Section] -Name = UltraVNC -Version = 1.0.9.5 -Licence = GPL -Description = Open-source VNC client/server. -Size = 2.1MB -Category = 5 -URLSite = http://www.uvnc.com/ -URLDownload = http://support1.uvnc.com/download/1095/UltraVNC_1.0.9.5_Setup.exe -CDPath = none - -[Section.040a] -Description = Cliente/Servidor VNC de código abierto. - -[Section.0415] -Description = Otwarty klient/serwer VNC. - -[Section.0422] -Description = Відкритий VNC клієнт/сервер. +; UTF-8 + +[Section] +Name = UltraVNC +Version = 1.0.9.5 +Licence = GPL +Description = Open-source VNC client/server. +Size = 2.1MB +Category = 5 +URLSite = http://www.uvnc.com/ +URLDownload = http://support1.uvnc.com/download/1095/UltraVNC_1.0.9.5_Setup.exe +CDPath = none + +[Section.040a] +Description = Cliente/Servidor VNC de código abierto. + +[Section.040c] +Description = Client/serveur VNC open source. + +[Section.0415] +Description = Otwarty klient/serwer VNC. + +[Section.0422] +Description = Відкритий VNC клієнт/сервер. diff --git a/base/applications/rapps/rapps/utorrent.txt b/base/applications/rapps/rapps/utorrent.txt index 86fa5ae6884..7747b2b6102 100644 --- a/base/applications/rapps/rapps/utorrent.txt +++ b/base/applications/rapps/rapps/utorrent.txt @@ -1,33 +1,37 @@ -; UTF-8 - -[Section] -Name = µTorrent -Version = 2.2 -Licence = Freeware for non-commercial uses -Description = Small and fast BitTorrent Client. -Size = 385K -Category = 5 -URLSite = http://www.utorrent.com/ -URLDownload = http://download.utorrent.com/2.2/utorrent.exe -CDPath = none - - -[Section.0407] -Licence = Freeware für nichtkommerzielle Nutzung -Description = Kleiner und schneller BitTorrent Client. - -[Section.040a] -Licence = Gratuito para uso no comercial -Description = Pequeño y rápido cliente BitTorrent. - -[Section.0415] -Licence = Freeware (do użytku domowego) -Description = Mały i szybki klient BitTorrent. - -[Section.0419] -Licence = Бесплатная для некоммерческого использования -Description = Маленький и быстрый клиент BitTorrent. - -[Section.0422] -Licence = Безплатна для некомерційного використання -Description = Маленький і швидкий клієнт BitTorrent. +; UTF-8 + +[Section] +Name = µTorrent +Version = 2.2.1 +Licence = Freeware for non-commercial uses +Description = Small and fast BitTorrent Client. +Size = 390K +Category = 5 +URLSite = http://www.utorrent.com/ +URLDownload = http://download.utorrent.com/2.2.1/utorrent.exe +CDPath = none + + +[Section.0407] +Licence = Freeware für nichtkommerzielle Nutzung +Description = Kleiner und schneller BitTorrent Client. + +[Section.040a] +Licence = Gratuito para uso no comercial +Description = Pequeño y rápido cliente BitTorrent. + +[Section.040c] +Licence = Gratuit pour une utilisation non-commerciale +Description = Client BitTorrent petit et rapide. + +[Section.0415] +Licence = Freeware (do użytku domowego) +Description = Mały i szybki klient BitTorrent. + +[Section.0419] +Licence = Бесплатная для некоммерческого использования +Description = Маленький и быстрый клиент BitTorrent. + +[Section.0422] +Licence = Безплатна для некомерційного використання +Description = Маленький і швидкий клієнт BitTorrent. diff --git a/base/applications/rapps/rapps/vb5run.txt b/base/applications/rapps/rapps/vb5run.txt index b916ea4ed5a..12fb70ef3e9 100644 --- a/base/applications/rapps/rapps/vb5run.txt +++ b/base/applications/rapps/rapps/vb5run.txt @@ -1,28 +1,32 @@ -; UTF-8 - -[Section] -Name = Visual Basic 5 Runtime -Version = 5.0 -Licence = Unknown -Description = Visual Basic 5 Runtime. -Size = 970kB -Category = 14 -URLSite = http://support.microsoft.com/kb/180071/ -URLDownload = http://download.microsoft.com/download/vb50pro/utility/1/win98/en-us/msvbvm50.exe -CDPath = none - -[Section.0407] -Licence = Unbekannt -Description = Visual Basic 5 Laufzeitsystem. - -[Section.040a] -Licence = Desconocida -Description = Librerias Visual Basic 5. - -[Section.0415] -Licence = Nieznana -Description = Biblioteki uruchomieniowe Visual Basic 5. - -[Section.0422] -Licence = Невідома -Description = Бібліотеки Visual Basic 5. +; UTF-8 + +[Section] +Name = Visual Basic 5 Runtime +Version = 5.0 +Licence = Unknown +Description = Visual Basic 5 Runtime. +Size = 970kB +Category = 14 +URLSite = http://support.microsoft.com/kb/180071/ +URLDownload = http://download.microsoft.com/download/vb50pro/utility/1/win98/en-us/msvbvm50.exe +CDPath = none + +[Section.0407] +Licence = Unbekannt +Description = Visual Basic 5 Laufzeitsystem. + +[Section.040a] +Licence = Desconocida +Description = Librerias Visual Basic 5. + +[Section.040c] +Licence = Inconnue +Description = Bibliothèque Visual Basic 5. + +[Section.0415] +Licence = Nieznana +Description = Biblioteki uruchomieniowe Visual Basic 5. + +[Section.0422] +Licence = Невідома +Description = Бібліотеки Visual Basic 5. diff --git a/base/applications/rapps/rapps/vb6run.txt b/base/applications/rapps/rapps/vb6run.txt index 521a7fc1ba3..542b977c95d 100644 --- a/base/applications/rapps/rapps/vb6run.txt +++ b/base/applications/rapps/rapps/vb6run.txt @@ -1,28 +1,32 @@ -; UTF-8 - -[Section] -Name = Visual Basic 6 Runtime -Version = 6.0 -Licence = Unknown -Description = Visual Basic 6 Runtime. -Size = 1.0MB -Category = 14 -URLSite = http://support.microsoft.com/kb/192461/ -URLDownload = http://download.microsoft.com/download/5/a/d/5ad868a0-8ecd-4bb0-a882-fe53eb7ef348/VB6.0-KB290887-X86.exe -CDPath = none - -[Section.0407] -Licence = Unbekannt -Description = Visual Basic 6 Laufzeitsystem. - -[Section.040a] -Licence = Desconocida -Description = Librerias Visual Basic 6. - -[Section.0415] -Licence = Nieznana -Description = Biblioteki uruchomieniowe Visual Basic 6. - -[Section.0422] -Licence = Невідома -Description = Бібліотеки Visual Basic 6. +; UTF-8 + +[Section] +Name = Visual Basic 6 Runtime +Version = 6.0 +Licence = Unknown +Description = Visual Basic 6 Runtime. +Size = 1.0MB +Category = 14 +URLSite = http://support.microsoft.com/kb/192461/ +URLDownload = http://download.microsoft.com/download/5/a/d/5ad868a0-8ecd-4bb0-a882-fe53eb7ef348/VB6.0-KB290887-X86.exe +CDPath = none + +[Section.0407] +Licence = Unbekannt +Description = Visual Basic 6 Laufzeitsystem. + +[Section.040a] +Licence = Desconocida +Description = Librerias Visual Basic 6. + +[Section.040c] +Licence = Inconnue +Description = Bibliothèque Visual Basic -. + +[Section.0415] +Licence = Nieznana +Description = Biblioteki uruchomieniowe Visual Basic 6. + +[Section.0422] +Licence = Невідома +Description = Бібліотеки Visual Basic 6. diff --git a/base/applications/rapps/rapps/vc2005run.txt b/base/applications/rapps/rapps/vc2005run.txt index 9f4f11f6f76..50b68787d2c 100644 --- a/base/applications/rapps/rapps/vc2005run.txt +++ b/base/applications/rapps/rapps/vc2005run.txt @@ -1,28 +1,32 @@ -; UTF-8 - -[Section] -Name = Microsoft Visual C++ 2005 Redistributable Package -Version = 7.0 -Licence = Unknown -Description = Visual Studio 2005 Runtime. -Size = 2.6MB -Category = 14 -URLSite = http://www.microsoft.com/Downloads/details.aspx?displaylang=en&FamilyID=32bc1bee-a3f9-4c13-9c99-220b62a191ee -URLDownload = http://download.microsoft.com/download/6/B/B/6BB661D6-A8AE-4819-B79F-236472F6070C/vcredist_x86.exe -CDPath = none - -[Section.0407] -Licence = Unbekannt -Description = Visual Studio 2005 Laufzeitsystem. - -[Section.040a] -Licence = Desconocida -Description = Librerias Visual Studio 2005. - -[Section.0415] -Licence = Nieznana -Description = Biblioteki uruchomieniowe Visual Studio 2005. - -[Section.0422] -Licence = Невідома -Description = Бібліотеки Visual Studio 2005. +; UTF-8 + +[Section] +Name = Microsoft Visual C++ 2005 Redistributable Package +Version = 7.0 +Licence = Unknown +Description = Visual Studio 2005 Runtime. +Size = 2.6MB +Category = 14 +URLSite = http://www.microsoft.com/Downloads/details.aspx?displaylang=en&FamilyID=32bc1bee-a3f9-4c13-9c99-220b62a191ee +URLDownload = http://download.microsoft.com/download/6/B/B/6BB661D6-A8AE-4819-B79F-236472F6070C/vcredist_x86.exe +CDPath = none + +[Section.0407] +Licence = Unbekannt +Description = Visual Studio 2005 Laufzeitsystem. + +[Section.040a] +Licence = Desconocida +Description = Librerias Visual Studio 2005. + +[Section.040c] +Licence = Inconnue +Description = Bibliothèque Visual Studio 2005. + +[Section.0415] +Licence = Nieznana +Description = Biblioteki uruchomieniowe Visual Studio 2005. + +[Section.0422] +Licence = Невідома +Description = Бібліотеки Visual Studio 2005. diff --git a/base/applications/rapps/rapps/vc2005sp1run.txt b/base/applications/rapps/rapps/vc2005sp1run.txt index 0e59740320b..40a8a5dee88 100644 --- a/base/applications/rapps/rapps/vc2005sp1run.txt +++ b/base/applications/rapps/rapps/vc2005sp1run.txt @@ -1,28 +1,32 @@ -; UTF-8 - -[Section] -Name = Microsoft Visual C++ 2005 SP1 Redistributable Package -Version = 7.1 -Licence = Unknown -Description = Visual Studio 2005 Runtime SP1. -Size = 2.6MB -Category = 14 -URLSite = http://www.microsoft.com/downloads/details.aspx?FamilyID=200b2fd9-ae1a-4a14-984d-389c36f85647&displaylang=en -URLDownload = http://download.microsoft.com/download/e/1/c/e1c773de-73ba-494a-a5ba-f24906ecf088/vcredist_x86.exe -CDPath = none - -[Section.0407] -Licence = Unbekannt -Description = Visual Studio 2005 Laufzeitsystem SP1. - -[Section.040a] -Licence = Desconocida -Description = Librerias Visual Studio 2005 SP1. - -[Section.0415] -Licence = Nieznana -Description = Biblioteki uruchomieniowe Visual Studio 2005 SP1. - -[Section.0422] -Licence = Невідома -Description = Бібліотеки Visual Studio 2005 SP1. +; UTF-8 + +[Section] +Name = Microsoft Visual C++ 2005 SP1 Redistributable Package +Version = 7.1 +Licence = Unknown +Description = Visual Studio 2005 Runtime SP1. +Size = 2.6MB +Category = 14 +URLSite = http://www.microsoft.com/downloads/details.aspx?FamilyID=200b2fd9-ae1a-4a14-984d-389c36f85647&displaylang=en +URLDownload = http://download.microsoft.com/download/e/1/c/e1c773de-73ba-494a-a5ba-f24906ecf088/vcredist_x86.exe +CDPath = none + +[Section.0407] +Licence = Unbekannt +Description = Visual Studio 2005 Laufzeitsystem SP1. + +[Section.040a] +Licence = Desconocida +Description = Librerias Visual Studio 2005 SP1. + +[Section.040c] +Licence = Inconnue +Description = Bibliothèque Visual Studio 2005 SP1. + +[Section.0415] +Licence = Nieznana +Description = Biblioteki uruchomieniowe Visual Studio 2005 SP1. + +[Section.0422] +Licence = Невідома +Description = Бібліотеки Visual Studio 2005 SP1. diff --git a/base/applications/rapps/rapps/vc2008run.txt b/base/applications/rapps/rapps/vc2008run.txt index a527fecdfef..b6bf3443feb 100644 --- a/base/applications/rapps/rapps/vc2008run.txt +++ b/base/applications/rapps/rapps/vc2008run.txt @@ -1,28 +1,32 @@ -; UTF-8 - -[Section] -Name = Microsoft Visual C++ 2008 Redistributable Package -Version = 8.0 -Licence = Unknown -Description = Visual Studio 2008 Runtime. -Size = 4.3MB -Category = 14 -URLSite = http://www.microsoft.com/DOWNLOADS/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en -URLDownload = http://download.microsoft.com/download/9/7/7/977B481A-7BA6-4E30-AC40-ED51EB2028F2/vcredist_x86.exe -CDPath = none - -[Section.0407] -Licence = Unbekannt -Description = Visual Studio 2008 Laufzeitsystem. - -[Section.040a] -Licence = Desconocida -Description = Librerias Visual Studio 2008. - -[Section.0415] -Licence = Nieznana -Description = Biblioteki uruchomieniowe Visual Studio 2008. - -[Section.0422] -Licence = Невідома -Description = Бібліотеки Visual Studio 2008. +; UTF-8 + +[Section] +Name = Microsoft Visual C++ 2008 Redistributable Package +Version = 8.0 +Licence = Unknown +Description = Visual Studio 2008 Runtime. +Size = 4.3MB +Category = 14 +URLSite = http://www.microsoft.com/DOWNLOADS/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en +URLDownload = http://download.microsoft.com/download/9/7/7/977B481A-7BA6-4E30-AC40-ED51EB2028F2/vcredist_x86.exe +CDPath = none + +[Section.0407] +Licence = Unbekannt +Description = Visual Studio 2008 Laufzeitsystem. + +[Section.040a] +Licence = Desconocida +Description = Librerias Visual Studio 2008. + +[Section.040c] +Licence = Inconnue +Description = Bibliothèque Visual Studio 2008. + +[Section.0415] +Licence = Nieznana +Description = Biblioteki uruchomieniowe Visual Studio 2008. + +[Section.0422] +Licence = Невідома +Description = Бібліотеки Visual Studio 2008. diff --git a/base/applications/rapps/rapps/vc2008sp1run.txt b/base/applications/rapps/rapps/vc2008sp1run.txt index b72f27bc606..0f05a041bc6 100644 --- a/base/applications/rapps/rapps/vc2008sp1run.txt +++ b/base/applications/rapps/rapps/vc2008sp1run.txt @@ -1,28 +1,32 @@ -; UTF-8 - -[Section] -Name = Microsoft Visual C++ 2008 SP1 Redistributable Package -Version = 8.0 -Licence = Unknown -Description = Visual Studio 2008 SP1 Runtime. -Size = 4.0MB -Category = 14 -URLSite = http://www.microsoft.com/downloads/details.aspx?familyid=A5C84275-3B97-4AB7-A40D-3802B2AF5FC2&displaylang=en -URLDownload = http://download.microsoft.com/download/d/d/9/dd9a82d0-52ef-40db-8dab-795376989c03/vcredist_x86.exe -CDPath = none - -[Section.0407] -Licence = Unbekannt -Description = Visual Studio 2008 SP1 Laufzeitsystem. - -[Section.040a] -Licence = Desconocida -Description = Librerias Visual Studio 2008 SP1. - -[Section.0415] -Licence = Nieznana -Description = Biblioteki uruchomieniowe Visual Studio 2008 SP1. - -[Section.0422] -Licence = Невідома -Description = Бібліотеки Visual Studio 2008 SP1. +; UTF-8 + +[Section] +Name = Microsoft Visual C++ 2008 SP1 Redistributable Package +Version = 8.0 +Licence = Unknown +Description = Visual Studio 2008 SP1 Runtime. +Size = 4.0MB +Category = 14 +URLSite = http://www.microsoft.com/downloads/details.aspx?familyid=A5C84275-3B97-4AB7-A40D-3802B2AF5FC2&displaylang=en +URLDownload = http://download.microsoft.com/download/d/d/9/dd9a82d0-52ef-40db-8dab-795376989c03/vcredist_x86.exe +CDPath = none + +[Section.0407] +Licence = Unbekannt +Description = Visual Studio 2008 SP1 Laufzeitsystem. + +[Section.040a] +Licence = Desconocida +Description = Librerias Visual Studio 2008 SP1. + +[Section.040c] +Licence = Inconnue +Description = Bibliothèque Visual Studio 2008 SP1. + +[Section.0415] +Licence = Nieznana +Description = Biblioteki uruchomieniowe Visual Studio 2008 SP1. + +[Section.0422] +Licence = Невідома +Description = Бібліотеки Visual Studio 2008 SP1. diff --git a/base/applications/rapps/rapps/vc6run.txt b/base/applications/rapps/rapps/vc6run.txt index 806b51504da..9ed5a088034 100644 --- a/base/applications/rapps/rapps/vc6run.txt +++ b/base/applications/rapps/rapps/vc6run.txt @@ -1,28 +1,32 @@ -; UTF-8 - -[Section] -Name = Microsoft Visual C++ 6 Redistributable Package -Version = 6.0 -Licence = Unknown -Description = Visual Studio 6 Runtime. -Size = 1.7MB -Category = 14 -URLSite = http://support.microsoft.com/kb/259403/ -URLDownload = http://download.microsoft.com/download/vc60pro/update/1/w9xnt4/en-us/vc6redistsetup_enu.exe -CDPath = none - -[Section.0407] -Licence = Unbekannt -Description = Visual Studio 6 Laufzeitsystem. - -[Section.040a] -Licence = Desconocida -Description = Librerias Visual Studio 2006. - -[Section.0415] -Licence = Nieznana -Description = Biblioteki uruchomieniowe Visual Studio 6. - -[Section.0422] -Licence = Невідома -Description = Бібліотеки Visual Studio 6. +; UTF-8 + +[Section] +Name = Microsoft Visual C++ 6 Redistributable Package +Version = 6.0 +Licence = Unknown +Description = Visual Studio 6 Runtime. +Size = 1.7MB +Category = 14 +URLSite = http://support.microsoft.com/kb/259403/ +URLDownload = http://download.microsoft.com/download/vc60pro/update/1/w9xnt4/en-us/vc6redistsetup_enu.exe +CDPath = none + +[Section.0407] +Licence = Unbekannt +Description = Visual Studio 6 Laufzeitsystem. + +[Section.040a] +Licence = Desconocida +Description = Librerias Visual Studio 2006. + +[Section.040c] +Licence = Inconnue +Description = Bibliothèque Visual Studio 6. + +[Section.0415] +Licence = Nieznana +Description = Biblioteki uruchomieniowe Visual Studio 6. + +[Section.0422] +Licence = Невідома +Description = Бібліотеки Visual Studio 6. diff --git a/base/applications/rapps/rapps/vlc.txt b/base/applications/rapps/rapps/vlc.txt index 76c8c74fe8b..ae94d897561 100644 --- a/base/applications/rapps/rapps/vlc.txt +++ b/base/applications/rapps/rapps/vlc.txt @@ -1,27 +1,30 @@ -; UTF-8 - -[Section] -Name = VLC media player -Version = 1.1.5 -Licence = GPL -Description = A media player. -Size = 19.1MB -Category = 1 -URLSite = http://www.videolan.org/vlc/ -URLDownload = http://ignum.dl.sourceforge.net/project/vlc/1.1.5/win32/vlc-1.1.5-win32.exe -CDPath = none - -[Section.0407] -Description = Ein Mediaplayer. - -[Section.040a] -Description = Reproductor multimedia. - -[Section.0419] -Description = Мультимедийный проигрыватель. - -[Section.0415] -Description = Odtwarzacz multimediów. - -[Section.0422] -Description = Мультимедійний програвач. +; UTF-8 + +[Section] +Name = VLC media player +Version = 1.1.7 +Licence = GPL +Description = A media player. +Size = 19.4MB +Category = 1 +URLSite = http://www.videolan.org/vlc/ +URLDownload = http://kent.dl.sourceforge.net/project/vlc/1.1.7/win32/vlc-1.1.7-win32.exe +CDPath = none + +[Section.0407] +Description = Ein Mediaplayer. + +[Section.040a] +Description = Reproductor multimedia. + +[Section.040c] +Description = Un lecteur media. + +[Section.0415] +Description = Odtwarzacz multimediów. + +[Section.0419] +Description = Мультимедийный проигрыватель. + +[Section.0422] +Description = Мультимедійний програвач. diff --git a/base/applications/rapps/rapps/winboard.txt b/base/applications/rapps/rapps/winboard.txt index b5486a23c40..9e58a153fd0 100644 --- a/base/applications/rapps/rapps/winboard.txt +++ b/base/applications/rapps/rapps/winboard.txt @@ -1,24 +1,27 @@ -; UTF-8 - -[Section] -Name = WinBoard -Version = 4.2.7b -Licence = GPL 3 -Description = WinBoard is a graphical chessboard for the Windows/ReactOS that can serve as a user interface for GNU Chess, Crafty, and other chess engines, for the Internet Chess Servers, and for electronic mail correspondence chess. -Size = 5.9MB -Category = 4 -URLSite = http://www.gnu.org/software/xboard/ -URLDownload = ftp://ftp.gnu.org/old-gnu/xboard/winboard/winboard-4_2_7b.exe -CDPath = none - -[Section.0407] -Description = WinBoard ist ein grafisches Schachbrett für Windows/ReactOS welches als Nutzerinterface für GNU Chess, Crafty oder andere Schachprogramme, für Internet Schachserver und für Briefschach dient. - -[Section.040a] -Description = Tablero de ajedrez para Windows/ReactOS que puede ser utilizado como interfaz para GNU Chess, Crafty, y otros motores de ajedrez, para servidores de ajedrez en internet, y para partidas por correo electrónico. - -[Section.0415] -Description = Graficzna szachownica dla systemu Windows/ReactOS, która może służyć jako graficzna nakładka dla GNU Chess, Crafty, lub innych programów szachowych(w tym internetowych serwerów szachowych) lub szachów korespondencyjnych. - -[Section.0422] -Description = Графічна шахматна дошка для Windows/ReactOS, що може слугувати графічним інтерфейсом для GNU Chess, Crafty, та інших шахматних двигунів, для серверів інтернет-шахмат та для шахматної переписки по е-мейл. +; UTF-8 + +[Section] +Name = WinBoard +Version = 4.2.7b +Licence = GPL 3 +Description = WinBoard is a graphical chessboard for the Windows/ReactOS that can serve as a user interface for GNU Chess, Crafty, and other chess engines, for the Internet Chess Servers, and for electronic mail correspondence chess. +Size = 5.9MB +Category = 4 +URLSite = http://www.gnu.org/software/xboard/ +URLDownload = ftp://ftp.gnu.org/old-gnu/xboard/winboard/winboard-4_2_7b.exe +CDPath = none + +[Section.0407] +Description = WinBoard ist ein grafisches Schachbrett für Windows/ReactOS welches als Nutzerinterface für GNU Chess, Crafty oder andere Schachprogramme, für Internet Schachserver und für Briefschach dient. + +[Section.040a] +Description = Tablero de ajedrez para Windows/ReactOS que puede ser utilizado como interfaz para GNU Chess, Crafty, y otros motores de ajedrez, para servidores de ajedrez en internet, y para partidas por correo electrónico. + +[Section.040c] +Description = WinBoard est un jeu d'échec graphique pour Windows/ReactOS qui peut servir d'interface utilisateur pour GNU Chess, Crafty et d'autres moteurs d'échecs, pour les serveurs d'échec internet et pour le jeu d'échec par courriel. + +[Section.0415] +Description = Graficzna szachownica dla systemu Windows/ReactOS, która może służyć jako graficzna nakładka dla GNU Chess, Crafty, lub innych programów szachowych (w tym internetowych serwerów szachowych) lub szachów korespondencyjnych. + +[Section.0422] +Description = Графічна шахматна дошка для Windows/ReactOS, що може слугувати графічним інтерфейсом для GNU Chess, Crafty, та інших шахматних двигунів, для серверів інтернет-шахмат та для шахматної переписки по е-мейл. diff --git a/base/applications/rapps/rapps/wme9.txt b/base/applications/rapps/rapps/wme9.txt index 842568e6f72..994896f5907 100644 --- a/base/applications/rapps/rapps/wme9.txt +++ b/base/applications/rapps/rapps/wme9.txt @@ -1,24 +1,27 @@ -; UTF-8 - -[Section] -Name = Windows Media Encoder 9 -Version = 9.0 -Licence = Unknown -Description = Windows Media Encoder 9 -Size = 9.5MB -Category = 14 -URLSite = http://www.microsoft.com/downloads/details.aspx?FamilyID=5691ba02-e496-465a-bba9-b2f1182cdf24 -URLDownload = http://download.microsoft.com/download/8/1/f/81f9402f-efdd-439d-b2a4-089563199d47/WMEncoder.exe -CDPath = none - -[Section.0407] -Licence = Unbekannt - -[Section.040a] -Licence = Desconocida - -[Section.0415] -Licence = Nieznana - -[Section.0422] -Licence = Невідома +; UTF-8 + +[Section] +Name = Windows Media Encoder 9 +Version = 9.0 +Licence = Unknown +Description = Windows Media Encoder 9 +Size = 9.5MB +Category = 14 +URLSite = http://www.microsoft.com/downloads/details.aspx?FamilyID=5691ba02-e496-465a-bba9-b2f1182cdf24 +URLDownload = http://download.microsoft.com/download/8/1/f/81f9402f-efdd-439d-b2a4-089563199d47/WMEncoder.exe +CDPath = none + +[Section.0407] +Licence = Unbekannt + +[Section.040a] +Licence = Desconocida + +[Section.040a] +Licence = Inconnue + +[Section.0415] +Licence = Nieznana + +[Section.0422] +Licence = Невідома diff --git a/base/applications/rapps/rsrc.rc b/base/applications/rapps/rsrc.rc index 4be23905aea..c1bdae757b1 100644 --- a/base/applications/rapps/rsrc.rc +++ b/base/applications/rapps/rsrc.rc @@ -3,6 +3,7 @@ #include "lang/de-DE.rc" #include "lang/en-US.rc" #include "lang/es-ES.rc" +#include "lang/fr-FR.rc" #include "lang/it-IT.rc" //#include "lang/ja-JP.rc" FIXME: iconv issue #include "lang/no-NO.rc" diff --git a/base/applications/rapps/winmain.c b/base/applications/rapps/winmain.c index f39b34ab7e8..33e6f6f9e0a 100644 --- a/base/applications/rapps/winmain.c +++ b/base/applications/rapps/winmain.c @@ -144,8 +144,11 @@ EnumAvailableAppProc(APPLICATION_INFO Info) PAPPLICATION_INFO ItemInfo; INT Index; - if (!IsInstalledApplication(Info.szRegName, FALSE) && - !IsInstalledApplication(Info.szRegName, TRUE)) + /* Only add a ListView entry if... + - no RegName was supplied (so we cannot determine whether the application is installed or not) or + - a RegName was supplied and the application is not installed + */ + if (!*Info.szRegName || (!IsInstalledApplication(Info.szRegName, FALSE) && !IsInstalledApplication(Info.szRegName, TRUE))) { ItemInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(APPLICATION_INFO)); if (!ItemInfo) return FALSE; diff --git a/base/services/audiosrv/audiosrv.h b/base/services/audiosrv/audiosrv.h index b4d02a744db..1fce5ce0841 100644 --- a/base/services/audiosrv/audiosrv.h +++ b/base/services/audiosrv/audiosrv.h @@ -29,22 +29,22 @@ BOOL CreateAudioDeviceList(DWORD max_size); VOID -DestroyAudioDeviceList(); +DestroyAudioDeviceList(VOID); /* Plug and Play (pnp.c) */ BOOL -ProcessExistingDevices(); +ProcessExistingDevices(VOID); DWORD ProcessDeviceArrival(DEV_BROADCAST_DEVICEINTERFACE* device); BOOL -RegisterForDeviceNotifications(); +RegisterForDeviceNotifications(VOID); VOID -UnregisterDeviceNotifications(); +UnregisterDeviceNotifications(VOID); DWORD HandleDeviceEvent( @@ -52,7 +52,7 @@ HandleDeviceEvent( LPVOID lpEventData); BOOL -StartSystemAudioServices(); +StartSystemAudioServices(VOID); /* Debugging */ diff --git a/base/services/tcpsvcs/tcpsvcs.h b/base/services/tcpsvcs/tcpsvcs.h index e1d3c987ab3..b2e8d90e03a 100644 --- a/base/services/tcpsvcs/tcpsvcs.h +++ b/base/services/tcpsvcs/tcpsvcs.h @@ -35,8 +35,8 @@ extern volatile BOOL bShutdown; extern volatile BOOL bPause; /* logging functions */ -BOOL InitLogging(); -VOID UninitLogging(); +BOOL InitLogging(VOID); +VOID UninitLogging(VOID); VOID LogEvent(LPCWSTR lpMsg, DWORD errNum, DWORD exitCode, UINT flags); /* skelserver functions */ diff --git a/base/services/tftpd/tftpd.h b/base/services/tftpd/tftpd.h index bdbcf942d15..54bf5dfe160 100644 --- a/base/services/tftpd/tftpd.h +++ b/base/services/tftpd/tftpd.h @@ -146,16 +146,16 @@ struct data15 }; //Functions -void runProg(); +void runProg(void); void processRequest(LPVOID lpParam); char* myGetToken(char*, BYTE); -void init(); +void init(void); bool cleanReq(request*); bool getSection(const char*, char*, BYTE, char*); bool isIP(char*s); char* myLower(char*); char* myUpper(char*); char* IP2String(char*, DWORD); -void printWindowsError(); +void printWindowsError(void); void logMess(request*, BYTE); void logMess(char*, BYTE); diff --git a/base/services/umpnpmgr/umpnpmgr.c b/base/services/umpnpmgr/umpnpmgr.c index dc4463c1949..64d8b45cd2f 100644 --- a/base/services/umpnpmgr/umpnpmgr.c +++ b/base/services/umpnpmgr/umpnpmgr.c @@ -1855,7 +1855,12 @@ DWORD PNP_SetHwProf( /* Function 56 */ DWORD PNP_QueryArbitratorFreeData( - handle_t hBinding) + handle_t hBinding, + BYTE *pData, + DWORD DataLen, + LPWSTR pDeviceID, + RESOURCEID ResourceID, + DWORD ulFlags) { UNIMPLEMENTED; return CR_CALL_NOT_IMPLEMENTED; @@ -1864,7 +1869,11 @@ DWORD PNP_QueryArbitratorFreeData( /* Function 57 */ DWORD PNP_QueryArbitratorFreeSize( - handle_t hBinding) + handle_t hBinding, + DWORD *pulSize, + LPWSTR pDeviceID, + RESOURCEID ResourceID, + DWORD ulFlags) { UNIMPLEMENTED; return CR_CALL_NOT_IMPLEMENTED; diff --git a/base/setup/usetup/cabinet.h b/base/setup/usetup/cabinet.h index 711a07f6ac2..70fa34cc49f 100644 --- a/base/setup/usetup/cabinet.h +++ b/base/setup/usetup/cabinet.h @@ -166,9 +166,9 @@ typedef VOID (*PCABINET_DISK_CHANGE)(PWCHAR CabinetName, /* Classes */ /* Default constructor */ -VOID CabinetInitialize(); +VOID CabinetInitialize(VOID); /* Default destructor */ -VOID CabinetCleanup(); +VOID CabinetCleanup(VOID); /* Returns a pointer to the filename part of a fully qualified filename */ PWCHAR CabinetGetFileName(PWCHAR Path); /* Removes a filename from a fully qualified filename */ @@ -176,19 +176,19 @@ VOID CabinetRemoveFileName(PWCHAR Path); /* Normalizes a path */ BOOL CabinetNormalizePath(PWCHAR Path, ULONG Length); /* Returns name of cabinet file */ -PWCHAR CabinetGetCabinetName(); +PWCHAR CabinetGetCabinetName(VOID); /* Sets the name of the cabinet file */ VOID CabinetSetCabinetName(PWCHAR FileName); /* Sets destination path for extracted files */ VOID CabinetSetDestinationPath(PWCHAR DestinationPath); /* Returns destination path */ -PWCHAR CabinetGetDestinationPath(); +PWCHAR CabinetGetDestinationPath(VOID); /* Returns zero-based current disk number */ -ULONG CabinetGetCurrentDiskNumber(); +ULONG CabinetGetCurrentDiskNumber(VOID); /* Opens the current cabinet file */ -ULONG CabinetOpen(); +ULONG CabinetOpen(VOID); /* Closes the current open cabinet file */ -VOID CabinetClose(); +VOID CabinetClose(VOID); /* Locates the first file in the current cabinet file that matches a search criteria */ ULONG CabinetFindFirst(PWCHAR FileName, PCAB_SEARCH Search); /* Locates the next file in the current cabinet file */ diff --git a/base/setup/usetup/inffile.c b/base/setup/usetup/inffile.c index 7b0d2a9748a..71c01088152 100644 --- a/base/setup/usetup/inffile.c +++ b/base/setup/usetup/inffile.c @@ -39,13 +39,6 @@ #ifdef __REACTOS__ -VOID WINAPI -InfpCloseInfFile( - IN HINF InfHandle) -{ - InfCloseFile(InfHandle); -} - BOOL WINAPI InfpFindFirstLineW( IN HINF InfHandle, @@ -65,28 +58,6 @@ InfpFindFirstLineW( return TRUE; } -BOOL WINAPI -InfpGetMultiSzFieldW( - IN PINFCONTEXT Context, - IN ULONG FieldIndex, - IN OUT PWSTR ReturnBuffer, - IN ULONG ReturnBufferSize, - OUT PULONG RequiredSize) -{ - return InfGetMultiSzField(Context, FieldIndex, ReturnBuffer, ReturnBufferSize, RequiredSize); -} - -BOOL WINAPI -InfpGetStringFieldW( - IN PINFCONTEXT Context, - IN ULONG FieldIndex, - IN OUT PWSTR ReturnBuffer, - IN ULONG ReturnBufferSize, - OUT PULONG RequiredSize) -{ - return InfGetStringField(Context, FieldIndex, ReturnBuffer, ReturnBufferSize, RequiredSize); -} - HINF WINAPI InfpOpenInfFileW( IN PCWSTR FileName, @@ -238,12 +209,4 @@ INF_OpenBufferedFileA( #endif /* !__REACTOS__ */ } -VOID INF_SetHeap( - IN PVOID Heap) -{ -#ifdef __REACTOS__ - InfSetHeap(Heap); -#endif -} - /* EOF */ diff --git a/base/setup/usetup/inffile.h b/base/setup/usetup/inffile.h index 4a5b8d9360f..ba0e45a0fd1 100644 --- a/base/setup/usetup/inffile.h +++ b/base/setup/usetup/inffile.h @@ -34,14 +34,9 @@ #include -#define SetupCloseInfFile InfpCloseInfFile #define SetupFindFirstLineW InfpFindFirstLineW -#define SetupFindNextLine InfFindNextLine -#define SetupGetBinaryField InfGetBinaryField #define SetupGetFieldCount InfGetFieldCount #define SetupGetIntField InfGetIntField -#define SetupGetMultiSzFieldW InfpGetMultiSzFieldW -#define SetupGetStringFieldW InfpGetStringFieldW #define SetupOpenInfFileW InfpOpenInfFileW #define INF_STYLE_WIN4 0x00000002 @@ -55,10 +50,6 @@ typedef struct _INFCONTEXT PVOID Line; } INFCONTEXT; -VOID WINAPI -InfpCloseInfFile( - IN HINF InfHandle); - BOOL WINAPI InfpFindFirstLineW( IN HINF InfHandle, @@ -66,22 +57,6 @@ InfpFindFirstLineW( IN PCWSTR Key, IN OUT PINFCONTEXT Context); -BOOL WINAPI -InfpGetMultiSzFieldW( - IN PINFCONTEXT Context, - IN ULONG FieldIndex, - IN OUT PWSTR ReturnBuffer, - IN ULONG ReturnBufferSize, - OUT PULONG RequiredSize); - -BOOL WINAPI -InfpGetStringFieldW( - IN PINFCONTEXT Context, - IN ULONG FieldIndex, - IN OUT PWSTR ReturnBuffer, - IN ULONG ReturnBufferSize, - OUT PULONG RequiredSize); - HINF WINAPI InfpOpenInfFileW( IN PCWSTR FileName, @@ -113,7 +88,4 @@ INF_OpenBufferedFileA( IN LCID LocaleId, OUT PUINT ErrorLine); -VOID INF_SetHeap( - IN PVOID Heap); - /* EOF */ diff --git a/base/setup/usetup/interface/usetup.c b/base/setup/usetup/interface/usetup.c index 231238048aa..9fa6d32fdf3 100644 --- a/base/setup/usetup/interface/usetup.c +++ b/base/setup/usetup/interface/usetup.c @@ -3978,7 +3978,7 @@ NtProcessStartup(PPEB Peb) RtlNormalizeProcessParams(Peb->ProcessParameters); ProcessHeap = Peb->ProcessHeap; - INF_SetHeap(ProcessHeap); + InfSetHeap(ProcessHeap); RunUSetup(); } #endif /* __REACTOS__ */ diff --git a/base/setup/usetup/registry.c b/base/setup/usetup/registry.c index a8081292e67..c5951762d28 100644 --- a/base/setup/usetup/registry.c +++ b/base/setup/usetup/registry.c @@ -646,7 +646,7 @@ ImportRegistryFile(PWSTR Filename, DPRINT1("registry_callback() failed\n"); } - SetupCloseInfFile (hInf); + InfCloseFile (hInf); return TRUE; } diff --git a/base/setup/usetup/settings.c b/base/setup/usetup/settings.c index ffc20ac286a..90fd2634585 100644 --- a/base/setup/usetup/settings.c +++ b/base/setup/usetup/settings.c @@ -637,6 +637,10 @@ ProcessLocaleRegistry(PGENERIC_LIST List) if (LanguageId == NULL) return FALSE; + /* Skip first 4 zeroes */ + if (wcslen(LanguageId) >= 4) + LanguageId += 4; + /* Open the NLS language key */ RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\NLS\\Language"); @@ -660,13 +664,12 @@ ProcessLocaleRegistry(PGENERIC_LIST List) /* Set default language */ RtlInitUnicodeString(&ValueName, L"Default"); - Status = NtSetValueKey(KeyHandle, &ValueName, 0, REG_SZ, - (PVOID)(LanguageId + 4), - 8 * sizeof(PWCHAR)); + (PVOID)LanguageId, + (wcslen(LanguageId) + 1) * sizeof(WCHAR)); if (!NT_SUCCESS(Status)) { DPRINT1("NtSetValueKey() failed (Status %lx)\n", Status); @@ -681,8 +684,8 @@ ProcessLocaleRegistry(PGENERIC_LIST List) &ValueName, 0, REG_SZ, - (PVOID)(LanguageId + 4), - 8 * sizeof(PWCHAR)); + (PVOID)LanguageId, + (wcslen(LanguageId) + 1) * sizeof(WCHAR)); NtClose(KeyHandle); if (!NT_SUCCESS(Status)) { diff --git a/base/setup/usetup/usetup.h b/base/setup/usetup/usetup.h index bbb4212891c..b6f887a20d5 100644 --- a/base/setup/usetup/usetup.h +++ b/base/setup/usetup/usetup.h @@ -78,6 +78,36 @@ extern UNICODE_STRING SourcePath; extern BOOLEAN IsUnattendedSetup; extern PWCHAR SelectedLanguageId; +#ifdef __REACTOS__ + +extern VOID InfSetHeap(PVOID Heap); +extern VOID InfCloseFile(HINF InfHandle); +extern BOOLEAN InfFindNextLine(PINFCONTEXT ContextIn, + PINFCONTEXT ContextOut); +extern BOOLEAN InfGetBinaryField(PINFCONTEXT Context, + ULONG FieldIndex, + PUCHAR ReturnBuffer, + ULONG ReturnBufferSize, + PULONG RequiredSize); +extern BOOLEAN InfGetMultiSzField(PINFCONTEXT Context, + ULONG FieldIndex, + PWSTR ReturnBuffer, + ULONG ReturnBufferSize, + PULONG RequiredSize); +extern BOOLEAN InfGetStringField(PINFCONTEXT Context, + ULONG FieldIndex, + PWSTR ReturnBuffer, + ULONG ReturnBufferSize, + PULONG RequiredSize); + +#define SetupCloseInfFile InfCloseFile +#define SetupFindNextLine InfFindNextLine +#define SetupGetBinaryField InfGetBinaryField +#define SetupGetMultiSzFieldW InfGetMultiSzField +#define SetupGetStringFieldW InfGetStringField + +#endif /* __REACTOS__ */ + typedef enum _PAGE_NUMBER { START_PAGE, diff --git a/base/shell/cmd/batch.h b/base/shell/cmd/batch.h index 841b09b814f..644fc35f6fb 100644 --- a/base/shell/cmd/batch.h +++ b/base/shell/cmd/batch.h @@ -45,7 +45,7 @@ extern TCHAR textline[BATCH_BUFFSIZE]; /* Buffer for reading Batch file lines */ LPTSTR FindArg (TCHAR, BOOL *); LPTSTR BatchParams (LPTSTR, LPTSTR); -VOID ExitBatch (); +VOID ExitBatch (VOID); INT Batch (LPTSTR, LPTSTR, LPTSTR, PARSED_COMMAND *); -LPTSTR ReadBatchLine(); +LPTSTR ReadBatchLine(VOID); VOID AddBatchRedirection(REDIRECTION **); diff --git a/base/shell/explorer-new/trayntfy.c b/base/shell/explorer-new/trayntfy.c index ef2c58997e3..086ba2257d2 100644 --- a/base/shell/explorer-new/trayntfy.c +++ b/base/shell/explorer-new/trayntfy.c @@ -19,12 +19,15 @@ */ #include +#include /* * TrayClockWnd - */ + */ static const TCHAR szTrayClockWndClass[] = TEXT("TrayClockWClass"); +static LPCTSTR s_szRegistryKey = _T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced"); +BOOL blShowSeconds; #define ID_TRAYCLOCK_TIMER 0 #define ID_TRAYCLOCK_TIMER_INIT 1 @@ -34,11 +37,51 @@ static const struct BOOL IsTime; DWORD dwFormatFlags; LPCTSTR lpFormat; -} ClockWndFormats[] = { - {TRUE, TIME_NOSECONDS, NULL}, - {FALSE, 0, TEXT("dddd")}, - {FALSE, DATE_SHORTDATE, NULL}, -}; +}ClockWndFormats[]= { +{TRUE, 0, NULL}, +{FALSE, 0, TEXT("dddd")}, +{FALSE, DATE_SHORTDATE, NULL} +}; + +HRESULT RegGetDWord(HKEY hKey, LPCTSTR szValueName, DWORD * lpdwResult) +{ + LONG lResult; + DWORD dwDataSize = sizeof(DWORD); + DWORD dwType = 0; + + // Check input parameters... + if (hKey == NULL || lpdwResult == NULL) return E_INVALIDARG; + + // Get dword value from the registry... + lResult = RegQueryValueEx(hKey, szValueName, 0, &dwType, (LPBYTE) lpdwResult, &dwDataSize ); + + // Check result and make sure the registry value is a DWORD(REG_DWORD)... + if (lResult != ERROR_SUCCESS) return HRESULT_FROM_WIN32(lResult); + else if (dwType != REG_DWORD) return DISP_E_TYPEMISMATCH; + + return NOERROR; +} + +void LoadSettings(void) +{ + HKEY hKey = NULL; + DWORD dwValue; + + if (RegOpenKey(HKEY_CURRENT_USER, s_szRegistryKey, &hKey) == ERROR_SUCCESS) + { + RegGetDWord(hKey, TEXT("blShowSeconds"), &dwValue); + if (dwValue == 1) + { + blShowSeconds = TRUE; + } + else + { + blShowSeconds = FALSE; + } + + RegCloseKey(hKey); + } +} #define CLOCKWND_FORMAT_COUNT (sizeof(ClockWndFormats) / sizeof(ClockWndFormats[0])) @@ -52,6 +95,7 @@ typedef struct _TRAY_CLOCK_WND_DATA HFONT hFont; RECT rcText; SYSTEMTIME LocalTime; + union { DWORD dwFlags; @@ -233,6 +277,11 @@ TrayClockWnd_UpdateWnd(IN OUT PTRAY_CLOCK_WND_DATA This) if (iRet != 0 && i == 0) { + if (blShowSeconds == FALSE) + { + (This->szLines[0][5] = '\0'); + }; + /* Set the window text to the time only */ SetWindowText(This->hWnd, This->szLines[i]); @@ -296,7 +345,10 @@ TrayClockWnd_CalculateDueTime(IN OUT PTRAY_CLOCK_WND_DATA This) /* Calculate the due time */ GetLocalTime(&This->LocalTime); uiDueTime = 1000 - (UINT)This->LocalTime.wMilliseconds; - uiDueTime += (59 - (UINT)This->LocalTime.wSecond) * 1000; + if (blShowSeconds == TRUE) + uiDueTime += ( (UINT)This->LocalTime.wSecond) * 100; + else + uiDueTime += (59 - (UINT)This->LocalTime.wSecond) * 1000; if (uiDueTime < USER_TIMER_MINIMUM || uiDueTime > USER_TIMER_MAXIMUM) uiDueTime = 1000; @@ -350,6 +402,7 @@ TrayClockWnd_CalibrateTimer(IN OUT PTRAY_CLOCK_WND_DATA This) { UINT uiDueTime; BOOL Ret; + int intWait1, intWait2; /* Kill the initialization timer */ KillTimer(This->hWnd, @@ -357,15 +410,26 @@ TrayClockWnd_CalibrateTimer(IN OUT PTRAY_CLOCK_WND_DATA This) This->IsInitTimerEnabled = FALSE; uiDueTime = TrayClockWnd_CalculateDueTime(This); + + if (blShowSeconds == TRUE) + { + intWait1 = 1000-200; + intWait2 = 1000; + } + else + { + intWait1 = 60*1000-200; + intWait2 = 60*1000; + } - if (uiDueTime > (60 * 1000) - 200) + if (uiDueTime > intWait1) { /* The update of the clock will be up to 200 ms late, but that's - acceptable. We're going to setup a timer that fires every - minute. */ + acceptable. We're going to setup a timer that fires depending + intWait2. */ Ret = SetTimer(This->hWnd, ID_TRAYCLOCK_TIMER, - 60 * 1000, + intWait2, NULL) != 0; This->IsTimerEnabled = Ret; @@ -375,7 +439,7 @@ TrayClockWnd_CalibrateTimer(IN OUT PTRAY_CLOCK_WND_DATA This) else { /* Recalibrate the timer and recalculate again when the current - minute ends. */ + minute/second ends. */ TrayClockWnd_ResetTime(This); } } @@ -614,6 +678,7 @@ CreateTrayClockWnd(IN HWND hWndParent, PTRAY_CLOCK_WND_DATA TcData; DWORD dwStyle; HWND hWnd = NULL; + LoadSettings(); TcData = HeapAlloc(hProcessHeap, 0, diff --git a/base/shell/explorer/shell/mainframe.cpp b/base/shell/explorer/shell/mainframe.cpp index 9019de568cc..d03efbfcd7e 100644 --- a/base/shell/explorer/shell/mainframe.cpp +++ b/base/shell/explorer/shell/mainframe.cpp @@ -873,7 +873,7 @@ HWND MDIMainFrame::Create() HMENU hMenuFrame = LoadMenu(g_Globals._hInstance, MAKEINTRESOURCE(IDM_MDIFRAME)); return Window::Create(WINDOW_CREATOR(MDIMainFrame), 0, - (LPCTSTR)(int)g_Globals._hframeClass, ResString(IDS_TITLE), WS_OVERLAPPEDWINDOW, + (LPCTSTR)(int)g_Globals._hframeClass, ResString(IDS_TITLE), WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 0/*hwndDesktop*/, hMenuFrame); } diff --git a/base/shell/explorer/shell/pane.cpp b/base/shell/explorer/shell/pane.cpp index b5fd6ab5de7..0273fb67802 100644 --- a/base/shell/explorer/shell/pane.cpp +++ b/base/shell/explorer/shell/pane.cpp @@ -702,7 +702,10 @@ void Pane::set_header() item.mask = HDI_WIDTH; item.cxy = 0; - for(; x+_widths[i]= scroll_pos) + break; + x += _widths[i]; Header_SetItem(_hwndHeader, i, &item); } diff --git a/base/shell/explorer/shell/shellbrowser.cpp b/base/shell/explorer/shell/shellbrowser.cpp index a8728293e0f..17a23d01b52 100644 --- a/base/shell/explorer/shell/shellbrowser.cpp +++ b/base/shell/explorer/shell/shellbrowser.cpp @@ -654,8 +654,12 @@ MDIShellBrowserChild::MDIShellBrowserChild(HWND hwnd, const ShellChildWndInfo& i MDIShellBrowserChild* MDIShellBrowserChild::create(const ShellChildWndInfo& info) { - ChildWindow* child = ChildWindow::create(info, info._pos.rcNormalPosition, - WINDOW_CREATOR_INFO(MDIShellBrowserChild,ShellChildWndInfo), CLASSNAME_CHILDWND, NULL, info._pos.showCmd==SW_SHOWMAXIMIZED? WS_MAXIMIZE: 0); + ChildWindow* child = ChildWindow::create(info, + info._pos.rcNormalPosition, + WINDOW_CREATOR_INFO(MDIShellBrowserChild,ShellChildWndInfo), + CLASSNAME_CHILDWND, + NULL, + WS_CLIPCHILDREN | (info._pos.showCmd==SW_SHOWMAXIMIZED? WS_MAXIMIZE: 0)); return static_cast(child); } diff --git a/base/shell/explorer/utility/window.cpp b/base/shell/explorer/utility/window.cpp index cfbce1db79f..4ad750f7a8c 100644 --- a/base/shell/explorer/utility/window.cpp +++ b/base/shell/explorer/utility/window.cpp @@ -39,7 +39,7 @@ WindowClass::WindowClass(LPCTSTR classname, UINT style_, WNDPROC wndproc) style = style_; hInstance = g_Globals._hInstance; hCursor = LoadCursor(0, IDC_ARROW); - + this->hbrBackground = (HBRUSH)(COLOR_BTNFACE+1); lpszClassName = classname; lpfnWndProc = wndproc; diff --git a/base/system/runonce/lang/fr-FR.rc b/base/system/runonce/lang/fr-FR.rc new file mode 100644 index 00000000000..8c5d3bb443e --- /dev/null +++ b/base/system/runonce/lang/fr-FR.rc @@ -0,0 +1,11 @@ +LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL + +IDD_RUNONCE_DLG DIALOG DISCARDABLE 0, 0, 239, 170 +STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Installation de ReactOS" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "ReactOS est en train d'installer les lments suivants :", -1, 38, 8, 196, 18 + LISTBOX IDC_COMP_LIST, 36, 32, 197, 131, LBS_OWNERDRAWVARIABLE | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + ICON IDI_ICON, -1, 5, 6, 21, 20 +END diff --git a/base/system/runonce/rsrc.rc b/base/system/runonce/rsrc.rc index cc21daecfe9..58c669a3faf 100644 --- a/base/system/runonce/rsrc.rc +++ b/base/system/runonce/rsrc.rc @@ -1,5 +1,6 @@ #include "lang/de-DE.rc" #include "lang/en-US.rc" +#include "lang/fr-FR.rc" #include "lang/es-ES.rc" #include "lang/ja-JP.rc" #include "lang/ru-RU.rc" diff --git a/base/system/services/database.c b/base/system/services/database.c index 7a9819e4c8b..02afda3a8f1 100644 --- a/base/system/services/database.c +++ b/base/system/services/database.c @@ -30,6 +30,7 @@ LIST_ENTRY ServiceListHead; static RTL_RESOURCE DatabaseLock; static DWORD dwResumeCount = 1; +static CRITICAL_SECTION ControlServiceCriticalSection; /* FUNCTIONS *****************************************************************/ @@ -691,13 +692,18 @@ ScmControlService(PSERVICE Service, DPRINT("ScmControlService() called\n"); + EnterCriticalSection(&ControlServiceCriticalSection); + TotalLength = wcslen(Service->lpServiceName) + 1; ControlPacket = (SCM_CONTROL_PACKET*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(SCM_CONTROL_PACKET) + (TotalLength * sizeof(WCHAR))); if (ControlPacket == NULL) + { + LeaveCriticalSection(&ControlServiceCriticalSection); return ERROR_NOT_ENOUGH_MEMORY; + } ControlPacket->dwControl = dwControl; ControlPacket->dwSize = TotalLength; @@ -728,6 +734,8 @@ ScmControlService(PSERVICE Service, dwError = ReplyPacket.dwError; } + LeaveCriticalSection(&ControlServiceCriticalSection); + DPRINT("ScmControlService() done\n"); return dwError; @@ -914,6 +922,9 @@ ScmStartUserModeService(PSERVICE Service, /* Create '\\.\pipe\net\NtControlPipeXXX' instance */ swprintf(NtControlPipeName, L"\\\\.\\pipe\\net\\NtControlPipe%u", ServiceCurrent); + + DPRINT1("Service: %p ImagePath: %wZ PipeName: %S\n", Service, &ImagePath, NtControlPipeName); + Service->ControlPipeHandle = CreateNamedPipeW(NtControlPipeName, PIPE_ACCESS_DUPLEX, PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT, @@ -1028,6 +1039,17 @@ ScmStartService(PSERVICE Service, DWORD argc, LPWSTR *argv) DPRINT("ScmStartService() called\n"); + DPRINT1("Start Service %p (%S)\n", Service, Service->lpServiceName); + + EnterCriticalSection(&ControlServiceCriticalSection); + + if (Service->Status.dwCurrentState != SERVICE_STOPPED) + { + DPRINT1("Service %S is already running!\n", Service->lpServiceName); + LeaveCriticalSection(&ControlServiceCriticalSection); + return ERROR_SERVICE_ALREADY_RUNNING; + } + Service->ControlPipeHandle = INVALID_HANDLE_VALUE; DPRINT("Service->Type: %lu\n", Service->Status.dwServiceType); @@ -1055,6 +1077,8 @@ ScmStartService(PSERVICE Service, DWORD argc, LPWSTR *argv) } } + LeaveCriticalSection(&ControlServiceCriticalSection); + DPRINT("ScmStartService() done (Error %lu)\n", dwError); if (dwError == ERROR_SUCCESS) @@ -1257,4 +1281,18 @@ ScmUnlockDatabase(VOID) RtlReleaseResource(&DatabaseLock); } + +VOID +ScmInitNamedPipeCriticalSection(VOID) +{ + InitializeCriticalSection(&ControlServiceCriticalSection); +} + + +VOID +ScmDeleteNamedPipeCriticalSection(VOID) +{ + DeleteCriticalSection(&ControlServiceCriticalSection); +} + /* EOF */ diff --git a/base/system/services/services.c b/base/system/services/services.c index 96aecd2a77b..e5a00411259 100644 --- a/base/system/services/services.c +++ b/base/system/services/services.c @@ -385,6 +385,8 @@ wWinMain(HINSTANCE hInstance, /* Acquire privileges to load drivers */ AcquireLoadDriverPrivilege(); + ScmInitNamedPipeCriticalSection(); + /* Start auto-start services */ ScmAutoStartServices(); @@ -404,6 +406,8 @@ wWinMain(HINSTANCE hInstance, } #endif + ScmDeleteNamedPipeCriticalSection(); + CloseHandle(hScmStartEvent); DPRINT("SERVICES: Finished.\n"); diff --git a/base/system/services/services.h b/base/system/services/services.h index 8371ad18b71..673edbf115d 100644 --- a/base/system/services/services.h +++ b/base/system/services/services.h @@ -123,6 +123,9 @@ BOOL ScmLockDatabaseExclusive(VOID); BOOL ScmLockDatabaseShared(VOID); VOID ScmUnlockDatabase(VOID); +VOID ScmInitNamedPipeCriticalSection(VOID); +VOID ScmDeleteNamedPipeCriticalSection(VOID); + /* driver.c */ diff --git a/base/system/winlogon/sas.c b/base/system/winlogon/sas.c index d4dbad881f6..d394439b191 100644 --- a/base/system/winlogon/sas.c +++ b/base/system/winlogon/sas.c @@ -25,8 +25,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(winlogon); #define HK_CTRL_ALT_DEL 0 #define HK_CTRL_SHIFT_ESC 1 -extern BOOL WINAPI SetLogonNotifyWindow(HWND Wnd, HWINSTA WinSta); - /* FUNCTIONS ****************************************************************/ static BOOL @@ -843,6 +841,40 @@ CheckForShutdownPrivilege( return STATUS_SUCCESS; } +BOOL +WINAPI +HandleMessageBeep(UINT uType) +{ + LPWSTR EventName; + + switch(uType) + { + case 0xFFFFFFFF: + EventName = NULL; + break; + case MB_OK: + EventName = L"SystemDefault"; + break; + case MB_ICONASTERISK: + EventName = L"SystemAsterisk"; + break; + case MB_ICONEXCLAMATION: + EventName = L"SystemExclamation"; + break; + case MB_ICONHAND: + EventName = L"SystemHand"; + break; + case MB_ICONQUESTION: + EventName = L"SystemQuestion"; + break; + default: + WARN("Unhandled type %d\n", uType); + EventName = L"SystemDefault"; + } + + return PlaySoundRoutine(EventName, FALSE, SND_ALIAS | SND_NOWAIT | SND_NOSTOP | SND_ASYNC); +} + static LRESULT CALLBACK SASWindowProc( IN HWND hwndDlg, @@ -902,6 +934,21 @@ SASWindowProc( } return TRUE; } + case WM_LOGONNOTIFY: + { + switch(wParam) + { + case LN_MESSAGE_BEEP: + { + return HandleMessageBeep(lParam); + } + default: + { + ERR("WM_LOGONNOTIFY case %d is unimplemented\n", wParam); + } + } + return 0; + } case WLX_WM_SAS: { DispatchSAS(Session, (DWORD)wParam); diff --git a/base/system/winlogon/winlogon.c b/base/system/winlogon/winlogon.c index 3f977d0f9be..619ff4e7367 100644 --- a/base/system/winlogon/winlogon.c +++ b/base/system/winlogon/winlogon.c @@ -23,6 +23,49 @@ PWLSESSION WLSession = NULL; /* FUNCTIONS *****************************************************************/ +BOOL +PlaySoundRoutine( + IN LPCWSTR FileName, + IN UINT bLogon, + IN UINT Flags) +{ + typedef BOOL (WINAPI *PLAYSOUNDW)(LPCWSTR,HMODULE,DWORD); + typedef UINT (WINAPI *WAVEOUTGETNUMDEVS)(VOID); + PLAYSOUNDW Play; + WAVEOUTGETNUMDEVS waveOutGetNumDevs; + UINT NumDevs; + HMODULE hLibrary; + BOOL Ret = FALSE; + + hLibrary = LoadLibraryW(L"winmm.dll"); + if (hLibrary) + { + waveOutGetNumDevs = (WAVEOUTGETNUMDEVS)GetProcAddress(hLibrary, "waveOutGetNumDevs"); + if (waveOutGetNumDevs) + { + NumDevs = waveOutGetNumDevs(); + if (!NumDevs) + { + if (!bLogon) + { + Beep(500, 500); + } + FreeLibrary(hLibrary); + return FALSE; + } + } + + Play = (PLAYSOUNDW)GetProcAddress(hLibrary, "PlaySoundW"); + if (Play) + { + Ret = Play(FileName, NULL, Flags); + } + FreeLibrary(hLibrary); + } + + return Ret; +} + DWORD WINAPI PlayLogonSoundThread( @@ -32,10 +75,8 @@ PlayLogonSoundThread( WCHAR szBuffer[MAX_PATH] = {0}; WCHAR szDest[MAX_PATH]; DWORD dwSize = sizeof(szBuffer); - HMODULE hLibrary; SERVICE_STATUS_PROCESS Info; - typedef BOOL (WINAPI *PLAYSOUNDW)(LPCWSTR,HMODULE,DWORD); - PLAYSOUNDW Play; + ULONG Index = 0; if (RegOpenKeyExW(HKEY_CURRENT_USER, L"AppEvents\\Schemes\\Apps\\.Default\\WindowsLogon\\.Current", 0, KEY_READ, &hKey) != ERROR_SUCCESS) @@ -94,17 +135,7 @@ PlayLogonSoundThread( if (Info.dwCurrentState != SERVICE_RUNNING) ExitThread(0); - - hLibrary = LoadLibraryW(L"winmm.dll"); - if (hLibrary) - { - Play = (PLAYSOUNDW)GetProcAddress(hLibrary, "PlaySoundW"); - if (Play) - { - Play(szDest, NULL, SND_FILENAME); - } - FreeLibrary(hLibrary); - } + PlaySoundRoutine(szDest, TRUE, SND_FILENAME); } ExitThread(0); } diff --git a/base/system/winlogon/winlogon.h b/base/system/winlogon/winlogon.h index 45e73254428..d28e1502544 100644 --- a/base/system/winlogon/winlogon.h +++ b/base/system/winlogon/winlogon.h @@ -40,6 +40,7 @@ #include #include +#include #include #include "setup.h" @@ -203,6 +204,13 @@ StartScreenSaver( IN PWLSESSION Session); /* winlogon.c */ + +BOOL +PlaySoundRoutine( + IN LPCWSTR FileName, + IN UINT Logon, + IN UINT Flags); + BOOL DisplayStatusMessage( IN PWLSESSION Session, diff --git a/boot/bootdata/hivedef_amd64.inf b/boot/bootdata/hivedef_amd64.inf index f26f7024ece..fbf8909fd72 100644 --- a/boot/bootdata/hivedef_amd64.inf +++ b/boot/bootdata/hivedef_amd64.inf @@ -97,7 +97,7 @@ HKCU,"Control Panel\Desktop","ScreenSaverIsSecure",2,"1" HKCU,"Control Panel\Desktop","ScreenSaveTimeOut",0,"600" HKCU,"Control Panel\Desktop","WaitToKillAppTimeout",2,"20000" HKCU,"Control Panel\Desktop","Wallpaper",0x00000000,"" -HKCU,"Control Panel\Desktop","FontSmoothing",0,"0" +HKCU,"Control Panel\Desktop","FontSmoothing",0,"1" HKCU,"Control Panel\Desktop","FontSmoothingOrientation",0x00010003,0x00000001 HKCU,"Control Panel\Desktop","FontSmoothingType",0x00010003,0x00000001 HKCU,"Control Panel\Desktop","ForegroundFlashCount",0x00010003,0x00000003 diff --git a/boot/bootdata/hivedef_arm.inf b/boot/bootdata/hivedef_arm.inf index 27dcf75b2e3..7ff0764f519 100644 --- a/boot/bootdata/hivedef_arm.inf +++ b/boot/bootdata/hivedef_arm.inf @@ -28,7 +28,7 @@ HKCU,"Control Panel\Desktop","HungAppTimeout",0x00000002,"5000" HKCU,"Control Panel\Desktop","SCRNSAVE.EXE",0x00000000,"" HKCU,"Control Panel\Desktop","WaitToKillAppTimeout",0x00000002,"20000" HKCU,"Control Panel\Desktop","Wallpaper",0x00000000,"" -HKCU,"Control Panel\Desktop","FontSmoothing",0,"0" +HKCU,"Control Panel\Desktop","FontSmoothing",0,"1" HKCU,"Control Panel\Desktop","SmoothScroll",3,00,00,00,00 HKCU,"Control Panel\Desktop","UserPreferencesMask",3,10,00,00,80 HKCU,"Control Panel\Desktop","LowPowerActive",,"0" diff --git a/boot/bootdata/hivedef_i386.inf b/boot/bootdata/hivedef_i386.inf index aeb59c43efb..b49f1ba038d 100644 Binary files a/boot/bootdata/hivedef_i386.inf and b/boot/bootdata/hivedef_i386.inf differ diff --git a/boot/bootdata/hivesys_amd64.inf b/boot/bootdata/hivesys_amd64.inf index 517dfa1a53b..af890ec1b55 100644 --- a/boot/bootdata/hivesys_amd64.inf +++ b/boot/bootdata/hivesys_amd64.inf @@ -886,6 +886,7 @@ HKLM,"SYSTEM\CurrentControlSet\Control\GroupOrderList","SCSI Miniport", 0x000000 ; Session Manager stuff HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager","BootExecute", 0x00010000, \ "autocheck autochk *" +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager","GlobalFlag", 0x00010003, 0x00000000 HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager","ObjectDirectories",0x00010000, \ "\Windows", \ "\RPC Control" diff --git a/boot/bootdata/hivesys_arm.inf b/boot/bootdata/hivesys_arm.inf index abf8d68c100..e766a5aaad5 100644 --- a/boot/bootdata/hivesys_arm.inf +++ b/boot/bootdata/hivesys_arm.inf @@ -740,6 +740,7 @@ HKLM,"SYSTEM\CurrentControlSet\Control\GroupOrderList","SCSI Miniport", 0x000000 ; Session Manager stuff HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager","BootExecute", 0x00010000, \ "autocheck autochk *" +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager","GlobalFlag", 0x00010003, 0x00000000 HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager","ObjectDirectories",0x00010000, \ "\Windows", \ "\RPC Control" diff --git a/boot/bootdata/hivesys_i386.inf b/boot/bootdata/hivesys_i386.inf index c7447cda8dc..a5d1e4264cc 100644 --- a/boot/bootdata/hivesys_i386.inf +++ b/boot/bootdata/hivesys_i386.inf @@ -979,6 +979,7 @@ HKLM,"SYSTEM\CurrentControlSet\Control\GroupOrderList","SCSI Miniport", 0x000000 ; Session Manager stuff HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager","BootExecute", 0x00010000, \ "autocheck autochk *" +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager","GlobalFlag", 0x00010003, 0x00000000 HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager","ObjectDirectories",0x00010000, \ "\Windows", \ "\RPC Control" diff --git a/boot/bootdata/txtsetup.sif b/boot/bootdata/txtsetup.sif index 57617385bbe..fb0937edbb2 100644 --- a/boot/bootdata/txtsetup.sif +++ b/boot/bootdata/txtsetup.sif @@ -59,7 +59,7 @@ Cabinet=reactos.cab [SetupData] DefaultPath = \ReactOS OsLoadOptions = "/NOGUIBOOT /NODEBUG" -DbgOsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM1 /FIRSTCHANCE /KDSERIAL" +DbgOsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM1 /FIRSTCHANCE" ;OsLoadOptions = "/NOGUIBOOT /DEBUGPORT=SCREEN" ;OsLoadOptions = "/NOGUIBOOT /DEBUGPORT=BOCHS" diff --git a/boot/freeldr/freeldr/debug.c b/boot/freeldr/freeldr/debug.c index 08f49bdf515..daabc6715f3 100644 --- a/boot/freeldr/freeldr/debug.c +++ b/boot/freeldr/freeldr/debug.c @@ -66,19 +66,6 @@ ULONG BaudRate = 115200; BOOLEAN DebugStartOfLine = TRUE; -// We need to emulate these, because the original ones don't work in freeldr -int __cdecl wctomb(char *mbchar, wchar_t wchar) -{ - *mbchar = wchar; - return 1; -} - -int __cdecl mbtowc (wchar_t *wchar, const char *mbchar, size_t count) -{ - *wchar = *mbchar; - return 1; -} - VOID DebugInit(VOID) { if (DebugPort & RS232) diff --git a/boot/freeldr/freeldr/freeldr.c b/boot/freeldr/freeldr/freeldr.c index 077f2bb6686..98af295c4c7 100644 --- a/boot/freeldr/freeldr/freeldr.c +++ b/boot/freeldr/freeldr/freeldr.c @@ -64,3 +64,16 @@ long _ftol2_sse(double f) return _ftol(f); } #endif + +// We need to emulate these, because the original ones don't work in freeldr +int __cdecl wctomb(char *mbchar, wchar_t wchar) +{ + *mbchar = wchar; + return 1; +} + +int __cdecl mbtowc (wchar_t *wchar, const char *mbchar, size_t count) +{ + *wchar = *mbchar; + return 1; +} diff --git a/dll/cpl/console/lang/fr-Fr.rc b/dll/cpl/console/lang/fr-Fr.rc new file mode 100644 index 00000000000..3cc34122141 --- /dev/null +++ b/dll/cpl/console/lang/fr-Fr.rc @@ -0,0 +1,148 @@ +/* + * PROJECT: ReactOS Console Configuration DLL + * LICENSE: GPL - See COPYING in the top level directory + * FILE: dll/cpl/console/lang/fr-FR.rc + * PURPOSE: French resource file + * TRANSLATOR: Jason Toscano + */ + +#include + +LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL + +IDD_PROPPAGEOPTIONS DIALOGEX 0, 0, 253, 220 +STYLE DS_SHELLFONT | WS_CHILD | WS_CAPTION +CAPTION "Options" +FONT 8, "MS Shell Dlg" +BEGIN + GROUPBOX "Taille du curseur", -1, 7, 7, 120, 70, WS_CHILD | WS_VISIBLE | WS_GROUP + CONTROL "&Petit", IDC_RADIO_SMALL_CURSOR, "Button", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 15, 20, 90, 10 + CONTROL "&Moyen", IDC_RADIO_MEDIUM_CURSOR, "Button", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 15, 40, 90, 10 + CONTROL "&Grand", IDC_RADIO_LARGE_CURSOR, "Button", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 15, 60, 90, 10 + GROUPBOX "Options d'affichage", -1, 133, 7, 112, 70, WS_CHILD | WS_VISIBLE | WS_GROUP + CONTROL "&Fenêtre", IDC_RADIO_DISPLAY_WINDOW, "Button", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 142, 20, 70, 10 + CONTROL "P&lein écran", IDC_RADIO_DISPLAY_FULL, "Button", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 142, 40, 70, 10 + GROUPBOX "Historique des commandes", -1, 7, 84, 120, 77, WS_CHILD | WS_VISIBLE | WS_GROUP + LTEXT "Taille du &buffer :", -1, 14, 101, 70, 12 + EDITTEXT IDC_EDIT_BUFFER_SIZE, 90, 97, 30, 15, ES_RIGHT | WS_GROUP + CONTROL "", IDC_UPDOWN_BUFFER_SIZE, UPDOWN_CLASS, UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 119, 97, 12, 15 + LTEXT "&Nombre de buffers :", -1, 14, 124, 70, 12 + EDITTEXT IDC_EDIT_NUM_BUFFER, 90, 120, 30, 15, ES_RIGHT | WS_GROUP + CONTROL "", IDC_UPDOWN_NUM_BUFFER, UPDOWN_CLASS, UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 119, 120, 12, 15 + CHECKBOX "&Se débarrasser des vielles copies", IDC_CHECK_DISCARD_DUPLICATES, 12, 140, 110, 15 + GROUPBOX "Options d'édition", -1, 133, 85, 112, 77, BS_GROUPBOX | WS_CHILD | WS_VISIBLE | WS_GROUP + CHECKBOX "M&ode d'édition rapide", IDC_CHECK_QUICK_EDIT, 140, 97, 102, 15, WS_CHILD | WS_VISIBLE | WS_TABSTOP + CHECKBOX "Mode &insertion", IDC_CHECK_INSERT_MODE, 140, 113, 76, 15, WS_CHILD | WS_VISIBLE | WS_TABSTOP +END + +IDD_PROPPAGEFONT DIALOGEX 0, 0, 253, 220 +STYLE DS_SHELLFONT | WS_CHILD | WS_CAPTION +CAPTION "Police" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Fenêtre de Prévisualisation :", -1, 10, 10, 94, 10 + LTEXT "Taille :", -1, 180, 10, 36, 10 + CONTROL "", IDC_STATIC_FONT_WINDOW_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 10, 20, 163, 74 + LISTBOX IDC_LBOX_FONTS, 181, 20, 55, 80, LBS_DISABLENOSCROLL | WS_VSCROLL + LTEXT "&Police :", -1, 10, 105, 33, 10 + CHECKBOX "&Gras", IDC_CHECK_BOLD_FONTS, 56, 105, 60, 10 + LISTBOX IDC_LBOX_TYPE, 10, 120, 110, 40, LBS_DISABLENOSCROLL | WS_VSCROLL + GROUPBOX "", IDC_GROUPBOX_FONT_NAME, 6, 156, 241, 50 + CONTROL "", IDC_STATIC_SELECT_FONT_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 16, 165, 95, 35 + LTEXT "Chaque caractère est :", -1, 124, 166, 75, 10 + LTEXT "largeur du pixel\nhauteur du pixel", -1, 136, 180, 101, 20 + LTEXT "", IDC_FONT_SIZE_X, 120, 180, 10, 10 + LTEXT "", IDC_FONT_SIZE_Y, 120, 188, 10, 10 +END + +IDD_PROPPAGELAYOUT DIALOGEX 0, 0, 253, 220 +STYLE DS_SHELLFONT | WS_CHILD | WS_CAPTION +CAPTION "Disposition" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Fenêtre de Prévisualisation :", -1, 8, 6, 95, 10 + CONTROL "", IDC_STATIC_LAYOUT_WINDOW_PREVIEW, "Static", SS_SUNKEN | SS_OWNERDRAW, 8, 16, 115, 70 + GROUPBOX "Taille du buffer de l'écran", -1, 130, 12, 115, 50 + LTEXT "&Largeur :", -1, 140, 28, 40, 10 + LTEXT "&Hauteur :", -1, 140, 46, 39, 10 + EDITTEXT IDC_EDIT_SCREEN_BUFFER_WIDTH, 203, 25, 35, 14, ES_RIGHT | WS_GROUP + CONTROL "", IDC_UPDOWN_SCREEN_BUFFER_WIDTH, UPDOWN_CLASS, UDS_NOTHOUSANDS | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 238, 25, 13, 14 + EDITTEXT IDC_EDIT_SCREEN_BUFFER_HEIGHT, 203, 42, 35, 14, ES_RIGHT | WS_GROUP + CONTROL "", IDC_UPDOWN_SCREEN_BUFFER_HEIGHT, UPDOWN_CLASS, UDS_NOTHOUSANDS | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 238, 42, 13, 14 + GROUPBOX "Taille de la fenêtre", -1, 130, 65, 115, 47 + LTEXT "&L&argeur :", -1, 140, 78, 39, 10 + LTEXT "&H&auteur :", -1, 140, 95, 37, 10 + EDITTEXT IDC_EDIT_WINDOW_SIZE_WIDTH, 203, 75, 35, 14, ES_RIGHT | WS_GROUP + CONTROL "", IDC_UPDOWN_WINDOW_SIZE_WIDTH, UPDOWN_CLASS, UDS_NOTHOUSANDS | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 238, 75, 13, 14 + EDITTEXT IDC_EDIT_WINDOW_SIZE_HEIGHT, 203, 92, 35, 14, ES_RIGHT | WS_GROUP + CONTROL "", IDC_UPDOWN_WINDOW_SIZE_HEIGHT, UPDOWN_CLASS, UDS_NOTHOUSANDS | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 238, 92, 13, 14 + GROUPBOX "Position de la Fenêtre", -1, 130, 116, 115, 64 + LTEXT "&Gauche :", -1, 140, 132, 38, 10 + LTEXT "&En haut :", -1, 140, 149, 40, 10 + EDITTEXT IDC_EDIT_WINDOW_POS_LEFT, 203, 128, 35, 14, ES_RIGHT | WS_GROUP + CONTROL "", IDC_UPDOWN_WINDOW_POS_LEFT, UPDOWN_CLASS, UDS_NOTHOUSANDS | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 238, 128, 13, 14 + EDITTEXT IDC_EDIT_WINDOW_POS_TOP, 203, 146, 35, 14, ES_RIGHT | WS_GROUP + CONTROL "", IDC_UPDOWN_WINDOW_POS_TOP, UPDOWN_CLASS, UDS_NOTHOUSANDS | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 238, 146, 13, 14 + CHECKBOX "Laisser le système &positionner la fenêtre", IDC_CHECK_SYSTEM_POS_WINDOW, 137, 165, 104, 10 +END + +IDD_PROPPAGECOLORS DIALOGEX 0, 0, 253, 220 +STYLE DS_SHELLFONT | WS_CHILD | WS_CAPTION +CAPTION "Couleurs" +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "&Texte à l'écran", IDC_RADIO_SCREEN_TEXT, "Button", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 10, 12, 112, 10 + CONTROL "Fond de l'&écran", IDC_RADIO_SCREEN_BACKGROUND, "Button", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 10, 30, 112, 10 + CONTROL "Texte du &popup", IDC_RADIO_POPUP_TEXT, "Button", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 10, 48, 112, 10 + CONTROL "Fond du Pop&up", IDC_RADIO_POPUP_BACKGROUND, "Button", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 10, 67, 112, 10 + GROUPBOX "Valeurs de couleur séléctionnées", -1, 129, 7, 118, 73 + LTEXT "&Rouge :", -1, 140, 25, 48, 10 + EDITTEXT IDC_EDIT_COLOR_RED, 210, 22, 30, 14, ES_RIGHT | WS_GROUP + CONTROL "", IDC_UPDOWN_COLOR_RED, UPDOWN_CLASS, UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 240, 22, 12, 14 + LTEXT "&Vert :", -1, 140, 42, 48, 10 + EDITTEXT IDC_EDIT_COLOR_GREEN, 210, 39, 30, 14, ES_RIGHT | WS_GROUP + CONTROL "", IDC_UPDOWN_COLOR_GREEN, UPDOWN_CLASS, UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 240, 39, 12, 14 + LTEXT "&Bleu :", -1, 140, 60, 48, 10 + EDITTEXT IDC_EDIT_COLOR_BLUE, 210, 56, 30, 14, ES_RIGHT | WS_GROUP + CONTROL "", IDC_UPDOWN_COLOR_BLUE, UPDOWN_CLASS, UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 240, 56, 12, 14 + CONTROL "", IDC_STATIC_COLOR1, "Static", SS_NOTIFY | SS_SUNKEN | SS_OWNERDRAW, 17, 90, 12, 12 + CONTROL "", IDC_STATIC_COLOR2, "Static", SS_NOTIFY | SS_SUNKEN | SS_OWNERDRAW, 31, 90, 12, 12 + CONTROL "", IDC_STATIC_COLOR3, "Static", SS_NOTIFY | SS_SUNKEN | SS_OWNERDRAW, 45, 90, 12, 12 + CONTROL "", IDC_STATIC_COLOR4, "Static", SS_NOTIFY | SS_SUNKEN | SS_OWNERDRAW, 59, 90, 12, 12 + CONTROL "", IDC_STATIC_COLOR5, "Static", SS_NOTIFY | SS_SUNKEN | SS_OWNERDRAW, 73, 90, 12, 12 + CONTROL "", IDC_STATIC_COLOR6, "Static", SS_NOTIFY | SS_SUNKEN | SS_OWNERDRAW, 87, 90, 12, 12 + CONTROL "", IDC_STATIC_COLOR7, "Static", SS_NOTIFY | SS_SUNKEN | SS_OWNERDRAW, 101, 90, 12, 12 + CONTROL "", IDC_STATIC_COLOR8, "Static", SS_NOTIFY | SS_SUNKEN | SS_OWNERDRAW, 115, 90, 12, 12 + CONTROL "", IDC_STATIC_COLOR9, "Static", SS_NOTIFY | SS_SUNKEN | SS_OWNERDRAW, 129, 90, 12, 12 + CONTROL "", IDC_STATIC_COLOR10, "Static", SS_NOTIFY | SS_SUNKEN | SS_OWNERDRAW, 143, 90, 12, 12 + CONTROL "", IDC_STATIC_COLOR11, "Static", SS_NOTIFY | SS_SUNKEN | SS_OWNERDRAW, 157, 90, 12, 12 + CONTROL "", IDC_STATIC_COLOR12, "Static", SS_NOTIFY | SS_SUNKEN | SS_OWNERDRAW, 171, 90, 12, 12 + CONTROL "", IDC_STATIC_COLOR13, "Static", SS_NOTIFY | SS_SUNKEN | SS_OWNERDRAW, 185, 90, 12, 12 + CONTROL "", IDC_STATIC_COLOR14, "Static", SS_NOTIFY | SS_SUNKEN | SS_OWNERDRAW, 199, 90, 12, 12 + CONTROL "", IDC_STATIC_COLOR15, "Static", SS_NOTIFY | SS_SUNKEN | SS_OWNERDRAW, 213, 90, 12, 12 + CONTROL "", IDC_STATIC_COLOR16, "Static", SS_NOTIFY | SS_SUNKEN | SS_OWNERDRAW, 227, 90, 12, 12 + GROUPBOX "Couleurs de l'écran sélectionneés", -1, 7, 111, 240, 40 + CONTROL "", IDC_STATIC_SCREEN_COLOR, "Static", SS_OWNERDRAW | SS_SUNKEN, 15, 124, 224, 20 + GROUPBOX "Couleurs du popup sélectionneés", -1, 7, 162, 240, 40 + CONTROL "", IDC_STATIC_POPUP_COLOR, "Static", SS_OWNERDRAW | SS_SUNKEN, 15, 176, 224, 20 +END + +IDD_APPLYOPTIONS DIALOGEX 0, 0, 220, 79 +STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION +CAPTION "Appliquer propriétés" +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "&Appliquer les propriétés à la fenêtre actuelle seulement", IDC_RADIO_APPLY_CURRENT, "Button", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 12, 12, 207, 10 + CONTROL "&Enregistrer les propriétés pour les prochaines fenêtres avec le même titre", IDC_RADIO_APPLY_ALL, "Button", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 12, 31, 207, 10 + PUSHBUTTON "OK", IDOK, 58, 58, 50, 14, WS_VISIBLE + PUSHBUTTON "Cancel", IDCANCEL, 114, 58, 50, 14, WS_VISIBLE +END + +STRINGTABLE +BEGIN + IDS_CPLNAME "Console" + IDS_CPLDESCRIPTION "Configurer les propriétés de la console." + IDS_APPLY_SHORTCUT_ALL "Modify &shortcut that started this window" + IDS_SCREEN_TEXT "C:\\ReactOS> dir\nSYSTEM 10-01-99 5:00\nSYSTEM32 10-01-99 5:00" + IDS_RASTERFONTS "Polices Raster" +END diff --git a/dll/cpl/console/rsrc.rc b/dll/cpl/console/rsrc.rc index f711388e3a9..facd97b3150 100644 --- a/dll/cpl/console/rsrc.rc +++ b/dll/cpl/console/rsrc.rc @@ -8,6 +8,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL #include "lang/de-DE.rc" #include "lang/en-US.rc" #include "lang/es-ES.rc" +#include "lang/fr-FR.rc" #include "lang/id-ID.rc" #include "lang/it-IT.rc" #include "lang/no-NO.rc" diff --git a/dll/cpl/input/input.h b/dll/cpl/input/input.h index edfe121878f..dcf0ac7d5e5 100644 --- a/dll/cpl/input/input.h +++ b/dll/cpl/input/input.h @@ -47,7 +47,7 @@ IsLayoutExists(LPTSTR szLayoutID, LPTSTR szLangID); INT_PTR CALLBACK KeySettingsDlgProc(HWND hDlg,UINT message,WPARAM wParam,LPARAM lParam); VOID -UpdateKeySettingsList(); +UpdateKeySettingsList(VOID); /* add.c */ INT_PTR CALLBACK diff --git a/dll/cpl/usrmgr/lang/fr-FR.rc b/dll/cpl/usrmgr/lang/fr-FR.rc new file mode 100644 index 00000000000..d98b04dd671 --- /dev/null +++ b/dll/cpl/usrmgr/lang/fr-FR.rc @@ -0,0 +1,219 @@ +LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL + + +/* Dialogs */ + +IDD_USERS DIALOGEX DISCARDABLE 0, 0, 252, 223 +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Utilisateurs" +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "", IDC_USERS_LIST, "SysListView32", LVS_REPORT | LVS_EDITLABELS | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP, + 7, 7, 238, 85, WS_EX_CLIENTEDGE +END + + +IDD_GROUPS DIALOGEX DISCARDABLE 0, 0, 252, 223 +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Groupes" +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "", IDC_GROUPS_LIST, "SysListView32", LVS_REPORT | LVS_EDITLABELS | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP, + 7, 7, 238, 85, WS_EX_CLIENTEDGE +END + + +IDD_EXTRA DIALOGEX DISCARDABLE 0, 0, 252, 223 +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Extra" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Cet espace est intentionnellement laissé vide", IDC_STATIC, 66, 90, 112, 8 +END + + +IDD_USER_GENERAL DIALOGEX DISCARDABLE 0, 0, 252, 223 +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Général" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "", IDC_USER_GENERAL_NAME, 7, 12, 112, 8 + LTEXT "Nom complet :", -1, 7, 46, 63, 8 + EDITTEXT IDC_USER_GENERAL_FULL_NAME,77,43,168,13,ES_AUTOHSCROLL + LTEXT "Description :", -1, 7, 64, 63, 8 + EDITTEXT IDC_USER_GENERAL_DESCRIPTION,77,61,168,13,ES_AUTOHSCROLL + AUTOCHECKBOX "L'utilisateur doit changer son mot de passe après sa première connexion",IDC_USER_GENERAL_FORCE_CHANGE,7,82,210,10 + AUTOCHECKBOX "L'utilisateur ne peut pas changer le mot de passe",IDC_USER_GENERAL_CANNOT_CHANGE,7,95,210,10 + AUTOCHECKBOX "Le mot de passe n'expire jamais",IDC_USER_GENERAL_NEVER_EXPIRES,7,108,210,10 + AUTOCHECKBOX "Compte désactivé",IDC_USER_GENERAL_DISABLED,7,121,210,10 + AUTOCHECKBOX "Compte bloqué",IDC_USER_GENERAL_LOCKED,7,134,210,10 +END + + +IDD_USER_MEMBERSHIP DIALOGEX DISCARDABLE 0, 0, 252, 223 +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Appartenance" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Menbre de :", -1, 7, 7, 56, 8 + CONTROL "", IDC_USER_MEMBERSHIP_LIST, "SysListView32", LVS_REPORT | LVS_NOCOLUMNHEADER | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP, + 7, 18, 238, 173, WS_EX_CLIENTEDGE + PUSHBUTTON "Ajouter...", IDC_USER_MEMBERSHIP_ADD, 7, 197, 50, 14 + PUSHBUTTON "Enlever", IDC_USER_MEMBERSHIP_REMOVE, 61, 197, 50, 14, WS_DISABLED +END + + +IDD_USER_PROFILE DIALOGEX DISCARDABLE 0, 0, 252, 223 +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Profil" +FONT 8, "MS Shell Dlg" +BEGIN + GROUPBOX "Profil d'utilisateur", -1, 7, 7, 238, 54 + LTEXT "Chemin d'accès au profil :", -1, 16, 22, 55, 8 + EDITTEXT IDC_USER_PROFILE_PATH, 78, 19, 160, 13, ES_AUTOHSCROLL + LTEXT "Script d'ouverture de session :", -1, 16, 40, 55, 8 + EDITTEXT IDC_USER_PROFILE_SCRIPT, 78, 37, 160, 13, ES_AUTOHSCROLL + + GROUPBOX "Répertoire personnel", -1, 7, 68, 238, 54 + AUTORADIOBUTTON "Chemin d'accès local :", IDC_USER_PROFILE_LOCAL, 16, 83, 60, 10 + AUTORADIOBUTTON "Connecter :", IDC_USER_PROFILE_REMOTE, 16, 100, 60, 10 + EDITTEXT IDC_USER_PROFILE_LOCAL_PATH, 78, 81, 160, 13, ES_AUTOHSCROLL + COMBOBOX IDC_USER_PROFILE_DRIVE, 78, 99, 26, 160, CBS_DROPDOWNLIST | CBS_SORT | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL + LTEXT "à :", -1, 112, 101, 12, 8 + EDITTEXT IDC_USER_PROFILE_REMOTE_PATH, 130, 99, 108, 13, ES_AUTOHSCROLL +END + + +IDD_GROUP_GENERAL DIALOGEX DISCARDABLE 0, 0, 252, 223 +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Général" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "", IDC_GROUP_GENERAL_NAME, 7, 12, 112, 8 + LTEXT "Description :", -1, 7, 45, 46, 8 + EDITTEXT IDC_GROUP_GENERAL_DESCRIPTION,65,42,180,13,ES_AUTOHSCROLL + LTEXT "Membres :", -1, 7, 63, 45, 8 + CONTROL "", IDC_GROUP_GENERAL_MEMBERS, "SysListView32", LVS_REPORT | LVS_NOCOLUMNHEADER | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP, + 7, 74, 238, 117, WS_EX_CLIENTEDGE + PUSHBUTTON "Ajouter...", IDC_GROUP_GENERAL_ADD, 7, 197, 50, 14 + PUSHBUTTON "Enlever", IDC_GROUP_GENERAL_REMOVE, 61, 197, 50, 14, WS_DISABLED +END + + +IDD_CHANGE_PASSWORD DIALOGEX DISCARDABLE 0, 0, 267, 74 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | DS_SHELLFONT +CAPTION "Changer le mot de passe" +FONT 8, "MS Shell Dlg" +BEGIN + EDITTEXT IDC_EDIT_PASSWORD1,107,7,153,14,ES_AUTOHSCROLL | ES_PASSWORD + RTEXT "Nouveau mot de passe :", -1,7,10,96,8 + EDITTEXT IDC_EDIT_PASSWORD2,107,25,153,14,ES_AUTOHSCROLL | ES_PASSWORD + RTEXT "Répéter le mot de passe :", -1,7,28,96,8 + DEFPUSHBUTTON "Accepter",IDOK,156,53,50,14 + PUSHBUTTON "Annuler",IDCANCEL,210,53,50,14 +END + + +IDD_USER_NEW DIALOGEX DISCARDABLE 0, 0, 267, 200 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | DS_SHELLFONT +CAPTION "Nouvel utilisateur" +FONT 8, "MS Shell Dlg" +BEGIN + EDITTEXT IDC_USER_NEW_NAME,107,7,153,14,ES_AUTOHSCROLL + RTEXT "Nom d'utilisateur :", -1,7,10,96,8 + EDITTEXT IDC_USER_NEW_FULL_NAME,107,25,153,14,ES_AUTOHSCROLL + RTEXT "Nom complet de l'utilisateur :", -1,7,28,96,8 + EDITTEXT IDC_USER_NEW_DESCRIPTION,107,43,153,14,ES_AUTOHSCROLL + RTEXT "Description :", -1,7,46,96,8 + EDITTEXT IDC_USER_NEW_PASSWORD1,107,67,153,14,ES_AUTOHSCROLL | ES_PASSWORD + RTEXT "Mot de passe :", -1,7,70,96,8 + EDITTEXT IDC_USER_NEW_PASSWORD2,107,85,153,14,ES_AUTOHSCROLL | ES_PASSWORD + RTEXT "Répéter le mot de passe :", -1,7,88,96,8 + AUTOCHECKBOX "L'utilisateur doit changer son mot de passe après sa première connexion",IDC_USER_NEW_FORCE_CHANGE,7,109,200,10 + AUTOCHECKBOX "L'utilisateur ne peut pas changer le mot de passe",IDC_USER_NEW_CANNOT_CHANGE,7,123,200,10,WS_DISABLED + AUTOCHECKBOX "Le mot de passe n'expire jamais",IDC_USER_NEW_NEVER_EXPIRES,7,137,200,10,WS_DISABLED + AUTOCHECKBOX "Compte désactivé",IDC_USER_NEW_DISABLED,7,151,200,10 + DEFPUSHBUTTON "Accepter",IDOK,156,179,50,14,WS_DISABLED + PUSHBUTTON "Annuler",IDCANCEL,210,179,50,14 +END + + +IDD_GROUP_NEW DIALOGEX DISCARDABLE 0, 0, 267, 74 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | DS_SHELLFONT +CAPTION "Nouveau groupe" +FONT 8, "MS Shell Dlg" +BEGIN + EDITTEXT IDC_GROUP_NEW_NAME,107,7,153,14,ES_AUTOHSCROLL + RTEXT "Nom du groupe :", -1,7,10,96,8 + EDITTEXT IDC_GROUP_NEW_DESCRIPTION,107,25,153,14,ES_AUTOHSCROLL + RTEXT "Description :", -1,7,28,96,8 + DEFPUSHBUTTON "Accepter",IDOK,156,53,50,14,WS_DISABLED + PUSHBUTTON "Annuler",IDCANCEL,210,53,50,14 +END + + +IDD_USER_ADD_MEMBERSHIP DIALOGEX DISCARDABLE 0, 0, 252, 223 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | DS_SHELLFONT +CAPTION "Appartenance à un groupe" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Membre de :", -1, 7, 7, 56, 8 + CONTROL "", IDC_USER_ADD_MEMBERSHIP_LIST, "SysListView32", LVS_REPORT | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP, + 7, 18, 238, 173, WS_EX_CLIENTEDGE + DEFPUSHBUTTON "Accepter",IDOK,141,197,50,14 + PUSHBUTTON "Annuler",IDCANCEL,195,197,50,14 +END + + +/* Menus */ + +IDM_POPUP_GROUP MENU DISCARDABLE +BEGIN + POPUP "" + BEGIN + MENUITEM "Nouveau groupe...", IDM_GROUP_NEW + END + POPUP "" + BEGIN + MENUITEM "Ajouter membre", IDM_GROUP_ADD_MEMBER, GRAYED + MENUITEM SEPARATOR + MENUITEM "Supprimer", IDM_GROUP_DELETE + MENUITEM "Renommer", IDM_GROUP_RENAME + MENUITEM SEPARATOR + MENUITEM "Propriétés", IDM_GROUP_PROPERTIES + END +END + + +IDM_POPUP_USER MENU DISCARDABLE +BEGIN + POPUP "" + BEGIN + MENUITEM "Nouvel utilisateur...", IDM_USER_NEW + END + POPUP "" + BEGIN + MENUITEM "Changer le mot de passe", IDM_USER_CHANGE_PASSWORD + MENUITEM SEPARATOR + MENUITEM "Supprimer", IDM_USER_DELETE + MENUITEM "Renommer", IDM_USER_RENAME + MENUITEM SEPARATOR + MENUITEM "Propriétés", IDM_USER_PROPERTIES + END +END + + +/* Strings */ + +STRINGTABLE +BEGIN + IDS_CPLNAME "Comptes d'utilisateur" + IDS_CPLDESCRIPTION "Gestion des utilisateurs et des groupes." +END + +STRINGTABLE +BEGIN + IDS_NAME "Nom" + IDS_FULLNAME "Nom complet" + IDS_DESCRIPTION "Description" +END diff --git a/dll/cpl/usrmgr/rsrc.rc b/dll/cpl/usrmgr/rsrc.rc index 3c5ab7370fe..7f2108c7e81 100644 --- a/dll/cpl/usrmgr/rsrc.rc +++ b/dll/cpl/usrmgr/rsrc.rc @@ -4,5 +4,6 @@ #include "lang/de-DE.rc" #include "lang/en-US.rc" #include "lang/es-ES.rc" +#include "lang/fr-FR.rc" #include "lang/pl-PL.rc" #include "lang/ru-RU.rc" diff --git a/dll/directx/ddraw/rosdraw.h b/dll/directx/ddraw/rosdraw.h index 9b50c1c7eda..0f8af8dad72 100644 --- a/dll/directx/ddraw/rosdraw.h +++ b/dll/directx/ddraw/rosdraw.h @@ -125,8 +125,8 @@ VOID Cleanup(LPDDRAWI_DIRECTDRAW_INT iface); /******** Main Object ********/ /* Public interface */ -VOID WINAPI AcquireDDThreadLock(); -VOID WINAPI ReleaseDDThreadLock(); +VOID WINAPI AcquireDDThreadLock(VOID); +VOID WINAPI ReleaseDDThreadLock(VOID); ULONG WINAPI DirectDrawClipper_AddRef (LPDIRECTDRAWCLIPPER iface); HRESULT WINAPI DirectDrawClipper_Initialize( LPDIRECTDRAWCLIPPER iface, LPDIRECTDRAW lpDD, DWORD dwFlags); diff --git a/dll/directx/msdmo/stubs.c b/dll/directx/msdmo/stubs.c index dfafe7afd49..1b4dee9a72f 100644 --- a/dll/directx/msdmo/stubs.c +++ b/dll/directx/msdmo/stubs.c @@ -1,7 +1,7 @@ #include #define NDEBUG -#include +#include void WINAPI diff --git a/dll/ntdll/CMakeLists.txt b/dll/ntdll/CMakeLists.txt index d57e5bbd930..aab01f16052 100644 --- a/dll/ntdll/CMakeLists.txt +++ b/dll/ntdll/CMakeLists.txt @@ -15,9 +15,10 @@ list(APPEND SOURCE csr/capture.c csr/connect.c dbg/dbgui.c + ldr/actctx.c + ldr/ldrinit.c ldr/startup.c ldr/utils.c - ldr/actctx.c rtl/libsupp.c rtl/version.c def/ntdll.rc diff --git a/dll/ntdll/ldr/ldrinit.c b/dll/ntdll/ldr/ldrinit.c new file mode 100644 index 00000000000..77baa0a5ed8 --- /dev/null +++ b/dll/ntdll/ldr/ldrinit.c @@ -0,0 +1,320 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS NT User-Mode Library + * FILE: dll/ntdll/ldr/ldrinit.c + * PURPOSE: User-Mode Process/Thread Startup + * PROGRAMMERS: Alex Ionescu (alex@relsoft.net) + * Aleksey Bragin (aleksey@reactos.org) + */ + +/* INCLUDES *****************************************************************/ + +#include +#define NDEBUG +#include + +/* GLOBALS *******************************************************************/ + +HKEY ImageExecOptionsKey; +HKEY Wow64ExecOptionsKey; +UNICODE_STRING ImageExecOptionsString = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options"); +UNICODE_STRING Wow64OptionsString = RTL_CONSTANT_STRING(L""); + +/* FUNCTIONS *****************************************************************/ + +/* + * @implemented + */ +NTSTATUS +NTAPI +LdrOpenImageFileOptionsKey(IN PUNICODE_STRING SubKey, + IN BOOLEAN Wow64, + OUT PHKEY NewKeyHandle) +{ + PHKEY RootKeyLocation; + HANDLE RootKey; + UNICODE_STRING SubKeyString; + OBJECT_ATTRIBUTES ObjectAttributes; + NTSTATUS Status; + PWCHAR p1; + + /* Check which root key to open */ + if (Wow64) + RootKeyLocation = &Wow64ExecOptionsKey; + else + RootKeyLocation = &ImageExecOptionsKey; + + /* Get the current key */ + RootKey = *RootKeyLocation; + + /* Setup the object attributes */ + InitializeObjectAttributes(&ObjectAttributes, + Wow64 ? + &Wow64OptionsString : &ImageExecOptionsString, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); + + /* Open the root key */ + Status = ZwOpenKey(&RootKey, KEY_ENUMERATE_SUB_KEYS, &ObjectAttributes); + if (NT_SUCCESS(Status)) + { + /* Write the key handle */ + if (_InterlockedCompareExchange((LONG*)RootKeyLocation, (LONG)RootKey, 0) != 0) + { + /* Someone already opened it, use it instead */ + NtClose(RootKey); + RootKey = *RootKeyLocation; + } + + /* Extract the name */ + SubKeyString = *SubKey; + p1 = (PWCHAR)((ULONG_PTR)SubKeyString.Buffer + SubKeyString.Length); + while (SubKey->Length) + { + if (p1[-1] == L'\\') break; + p1--; + SubKeyString.Length -= sizeof(*p1); + } + SubKeyString.Buffer = p1; + SubKeyString.Length = SubKeyString.MaximumLength - SubKeyString.Length - sizeof(WCHAR); + + /* Setup the object attributes */ + InitializeObjectAttributes(&ObjectAttributes, + &SubKeyString, + OBJ_CASE_INSENSITIVE, + RootKey, + NULL); + + /* Open the setting key */ + Status = ZwOpenKey((PHANDLE)NewKeyHandle, GENERIC_READ, &ObjectAttributes); + } + + /* Return to caller */ + return Status; +} + +/* + * @implemented + */ +NTSTATUS +NTAPI +LdrQueryImageFileKeyOption(IN HKEY KeyHandle, + IN PCWSTR ValueName, + IN ULONG Type, + OUT PVOID Buffer, + IN ULONG BufferSize, + OUT PULONG ReturnedLength OPTIONAL) +{ + ULONG KeyInfo[256]; + UNICODE_STRING ValueNameString, IntegerString; + ULONG KeyInfoSize, ResultSize; + PKEY_VALUE_PARTIAL_INFORMATION KeyValueInformation = (PKEY_VALUE_PARTIAL_INFORMATION)&KeyInfo; + BOOLEAN FreeHeap = FALSE; + NTSTATUS Status; + + /* Build a string for the value name */ + Status = RtlInitUnicodeStringEx(&ValueNameString, ValueName); + if (!NT_SUCCESS(Status)) return Status; + + /* Query the value */ + Status = NtQueryValueKey(KeyHandle, + &ValueNameString, + KeyValuePartialInformation, + KeyValueInformation, + sizeof(KeyInfo), + &ResultSize); + if (Status == STATUS_BUFFER_OVERFLOW) + { + /* Our local buffer wasn't enough, allocate one */ + KeyInfoSize = sizeof(KEY_VALUE_PARTIAL_INFORMATION) + + KeyValueInformation->DataLength; + KeyValueInformation = RtlAllocateHeap(RtlGetProcessHeap(), + 0, + KeyInfoSize); + if (KeyInfo == NULL) + { + /* Give up this time */ + Status = STATUS_NO_MEMORY; + } + + /* Try again */ + Status = NtQueryValueKey(KeyHandle, + &ValueNameString, + KeyValuePartialInformation, + KeyValueInformation, + KeyInfoSize, + &ResultSize); + FreeHeap = TRUE; + } + + /* Check for success */ + if (NT_SUCCESS(Status)) + { + /* Handle binary data */ + if (KeyValueInformation->Type == REG_BINARY) + { + /* Check validity */ + if ((Buffer) && (KeyValueInformation->DataLength <= BufferSize)) + { + /* Copy into buffer */ + RtlMoveMemory(Buffer, + &KeyValueInformation->Data, + KeyValueInformation->DataLength); + } + else + { + Status = STATUS_BUFFER_OVERFLOW; + } + + /* Copy the result length */ + if (ReturnedLength) *ReturnedLength = KeyValueInformation->DataLength; + } + else if (KeyValueInformation->Type == REG_DWORD) + { + /* Check for valid type */ + if (KeyValueInformation->Type != Type) + { + /* Error */ + Status = STATUS_OBJECT_TYPE_MISMATCH; + } + else + { + /* Check validity */ + if ((Buffer) && + (BufferSize == sizeof(ULONG)) && + (KeyValueInformation->DataLength <= BufferSize)) + { + /* Copy into buffer */ + RtlMoveMemory(Buffer, + &KeyValueInformation->Data, + KeyValueInformation->DataLength); + } + else + { + Status = STATUS_BUFFER_OVERFLOW; + } + + /* Copy the result length */ + if (ReturnedLength) *ReturnedLength = KeyValueInformation->DataLength; + } + } + else if (KeyValueInformation->Type != REG_SZ) + { + /* We got something weird */ + Status = STATUS_OBJECT_TYPE_MISMATCH; + } + else + { + /* String, check what you requested */ + if (Type == REG_DWORD) + { + /* Validate */ + if (BufferSize != sizeof(ULONG)) + { + /* Invalid size */ + BufferSize = 0; + Status = STATUS_INFO_LENGTH_MISMATCH; + } + else + { + /* OK, we know what you want... */ + IntegerString.Buffer = (PWSTR)KeyValueInformation->Data; + IntegerString.Length = KeyValueInformation->DataLength - + sizeof(WCHAR); + IntegerString.MaximumLength = KeyValueInformation->DataLength; + Status = RtlUnicodeStringToInteger(&IntegerString, 0, (PULONG)Buffer); + } + } + else + { + /* Validate */ + if (KeyValueInformation->DataLength > BufferSize) + { + /* Invalid */ + Status = STATUS_BUFFER_OVERFLOW; + } + else + { + /* Set the size */ + BufferSize = KeyValueInformation->DataLength; + } + + /* Copy the string */ + RtlMoveMemory(Buffer, &KeyValueInformation->Data, BufferSize); + } + + /* Copy the result length */ + if (ReturnedLength) *ReturnedLength = KeyValueInformation->DataLength; + } + } + + /* Check if buffer was in heap */ + if (FreeHeap) RtlFreeHeap(RtlGetProcessHeap(), 0, KeyValueInformation); + + /* Close key and return */ + NtClose(KeyHandle); + return Status; +} + +/* + * @implemented + */ +NTSTATUS +NTAPI +LdrQueryImageFileExecutionOptionsEx(IN PUNICODE_STRING SubKey, + IN PCWSTR ValueName, + IN ULONG Type, + OUT PVOID Buffer, + IN ULONG BufferSize, + OUT PULONG ReturnedLength OPTIONAL, + IN BOOLEAN Wow64) +{ + NTSTATUS Status; + HKEY KeyHandle; + + /* Open a handle to the key */ + Status = LdrOpenImageFileOptionsKey(SubKey, Wow64, &KeyHandle); + + /* Check for success */ + if (NT_SUCCESS(Status)) + { + /* Query the data */ + Status = LdrQueryImageFileKeyOption(KeyHandle, + ValueName, + Type, + Buffer, + BufferSize, + ReturnedLength); + + /* Close the key */ + NtClose(KeyHandle); + } + + /* Return to caller */ + return Status; +} + +/* + * @implemented + */ +NTSTATUS +NTAPI +LdrQueryImageFileExecutionOptions(IN PUNICODE_STRING SubKey, + IN PCWSTR ValueName, + IN ULONG Type, + OUT PVOID Buffer, + IN ULONG BufferSize, + OUT PULONG ReturnedLength OPTIONAL) +{ + /* Call the newer function */ + return LdrQueryImageFileExecutionOptionsEx(SubKey, + ValueName, + Type, + Buffer, + BufferSize, + ReturnedLength, + FALSE); +} + +/* EOF */ diff --git a/dll/ntdll/ldr/startup.c b/dll/ntdll/ldr/startup.c index 2b5ae0140a9..06b90b07558 100644 --- a/dll/ntdll/ldr/startup.c +++ b/dll/ntdll/ldr/startup.c @@ -74,9 +74,9 @@ LoadImageFileExecutionOptions(PPEB Peb) UNICODE_STRING ImageName; UNICODE_STRING ImagePathName; ULONG ValueSize; - extern ULONG RtlpPageHeapGlobalFlags, RtlpPageHeapSizeRangeStart, RtlpPageHeapSizeRangeEnd; + extern ULONG RtlpDphGlobalFlags, RtlpPageHeapSizeRangeStart, RtlpPageHeapSizeRangeEnd; extern ULONG RtlpPageHeapDllRangeStart, RtlpPageHeapDllRangeEnd; - extern WCHAR RtlpPageHeapTargetDlls[512]; + extern WCHAR RtlpDphTargetDlls[512]; extern BOOLEAN RtlpPageHeapEnabled; if (Peb->ProcessParameters && @@ -144,8 +144,8 @@ LoadImageFileExecutionOptions(PPEB Peb) LdrQueryImageFileExecutionOptions(&ImageName, L"PageHeapFlags", REG_DWORD, - (PVOID)&RtlpPageHeapGlobalFlags, - sizeof(RtlpPageHeapGlobalFlags), + (PVOID)&RtlpDphGlobalFlags, + sizeof(RtlpDphGlobalFlags), &ValueSize); LdrQueryImageFileExecutionOptions(&ImageName, @@ -179,8 +179,8 @@ LoadImageFileExecutionOptions(PPEB Peb) LdrQueryImageFileExecutionOptions(&ImageName, L"PageHeapTargetDlls", REG_SZ, - (PVOID)RtlpPageHeapTargetDlls, - sizeof(RtlpPageHeapTargetDlls), + (PVOID)RtlpDphTargetDlls, + sizeof(RtlpDphTargetDlls), &ValueSize); /* Now when all parameters are read, enable page heap */ diff --git a/dll/ntdll/ldr/utils.c b/dll/ntdll/ldr/utils.c index 4482f93fdf4..e7213b3df07 100644 --- a/dll/ntdll/ldr/utils.c +++ b/dll/ntdll/ldr/utils.c @@ -2394,7 +2394,6 @@ LdrpLoadModule(IN PWSTR SearchPath OPTIONAL, RtlFreeUnicodeString (&(*Module)->FullDllName); RtlFreeUnicodeString (&(*Module)->BaseDllName); RemoveEntryList (&(*Module)->InLoadOrderLinks); - RtlFreeHeap (RtlGetProcessHeap (), 0, Module); return Status; } @@ -3289,162 +3288,6 @@ LdrVerifyImageMatchesChecksum (IN HANDLE FileHandle, return Status; } - -/*************************************************************************** - * NAME EXPORTED - * LdrQueryImageFileExecutionOptions - * - * DESCRIPTION - * - * ARGUMENTS - * - * RETURN VALUE - * - * REVISIONS - * - * NOTE - * - * @implemented - */ -NTSTATUS NTAPI -LdrQueryImageFileExecutionOptions(IN PUNICODE_STRING SubKey, - IN PCWSTR ValueName, - IN ULONG Type, - OUT PVOID Buffer, - IN ULONG BufferSize, - OUT PULONG ReturnedLength OPTIONAL) -{ - PKEY_VALUE_PARTIAL_INFORMATION KeyInfo; - CHAR KeyInfoBuffer[sizeof(KEY_VALUE_PARTIAL_INFORMATION) + 32]; - OBJECT_ATTRIBUTES ObjectAttributes; - UNICODE_STRING ValueNameString; - UNICODE_STRING KeyName; - WCHAR NameBuffer[256]; - HANDLE KeyHandle; - ULONG KeyInfoSize; - ULONG ResultSize; - PWCHAR Ptr; - NTSTATUS Status; - - wcscpy (NameBuffer, - L"\\Registry\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options\\"); - Ptr = wcsrchr (SubKey->Buffer, L'\\'); - if (Ptr == NULL) - { - Ptr = SubKey->Buffer; - } - else - { - Ptr++; - } - wcscat (NameBuffer, Ptr); - RtlInitUnicodeString (&KeyName, - NameBuffer); - - InitializeObjectAttributes(&ObjectAttributes, - &KeyName, - OBJ_CASE_INSENSITIVE, - NULL, - NULL); - - Status = NtOpenKey(&KeyHandle, - KEY_READ, - &ObjectAttributes); - if (!NT_SUCCESS(Status)) - { - DPRINT ("NtOpenKey() failed (Status %lx)\n", Status); - return Status; - } - - KeyInfoSize = sizeof(KeyInfoBuffer); - KeyInfo = (PKEY_VALUE_PARTIAL_INFORMATION)KeyInfoBuffer; - - RtlInitUnicodeString(&ValueNameString, - (PWSTR)ValueName); - Status = NtQueryValueKey(KeyHandle, - &ValueNameString, - KeyValuePartialInformation, - KeyInfo, - KeyInfoSize, - &ResultSize); - if (Status == STATUS_BUFFER_OVERFLOW) - { - /* We can allocate only if there is a process heap already */ - if (!RtlGetProcessHeap()) - { - NtClose (KeyHandle); - return STATUS_NO_MEMORY; - } - KeyInfoSize = sizeof(KEY_VALUE_PARTIAL_INFORMATION) + KeyInfo->DataLength; - KeyInfo = RtlAllocateHeap (RtlGetProcessHeap(), - HEAP_ZERO_MEMORY, - KeyInfoSize); - if (KeyInfo == NULL) - { - NtClose (KeyHandle); - return STATUS_INSUFFICIENT_RESOURCES; - } - - Status = NtQueryValueKey (KeyHandle, - &ValueNameString, - KeyValuePartialInformation, - KeyInfo, - KeyInfoSize, - &ResultSize); - } - NtClose (KeyHandle); - - if (!NT_SUCCESS(Status)) - { - if ((PCHAR)KeyInfo != KeyInfoBuffer) - { - RtlFreeHeap (RtlGetProcessHeap(), - 0, - KeyInfo); - } - return Status; - } - - if (KeyInfo->Type != Type) - { - if ((PCHAR)KeyInfo != KeyInfoBuffer) - { - RtlFreeHeap (RtlGetProcessHeap(), - 0, - KeyInfo); - } - return STATUS_OBJECT_TYPE_MISMATCH; - } - - ResultSize = BufferSize; - if (ResultSize < KeyInfo->DataLength) - { - Status = STATUS_BUFFER_OVERFLOW; - } - else - { - ResultSize = KeyInfo->DataLength; - } - RtlCopyMemory (Buffer, - &KeyInfo->Data, - ResultSize); - - if ((PCHAR)KeyInfo != KeyInfoBuffer) - { - RtlFreeHeap (RtlGetProcessHeap(), - 0, - KeyInfo); - } - - if (ReturnedLength != NULL) - { - *ReturnedLength = ResultSize; - } - - return Status; -} - - PIMAGE_BASE_RELOCATION NTAPI LdrProcessRelocationBlock( diff --git a/dll/win32/advapi32/crypt/crypt.c b/dll/win32/advapi32/crypt/crypt.c index ee2380cee90..e7c04c5478c 100644 --- a/dll/win32/advapi32/crypt/crypt.c +++ b/dll/win32/advapi32/crypt/crypt.c @@ -2217,124 +2217,3 @@ BOOL WINAPI CryptVerifySignatureA (HCRYPTHASH hHash, CONST BYTE *pbSignature, DW return result; } - -/* - * @unimplemented - */ -DWORD WINAPI AddUsersToEncryptedFile ( - LPCWSTR lpcwstr, - PENCRYPTION_CERTIFICATE_LIST pencryption_certificate_list - ) -{ - FIXME("%s() not implemented!\n", __FUNCTION__); - return ERROR_CALL_NOT_IMPLEMENTED; -} - -/* - * @unimplemented - */ -DWORD WINAPI RemoveUsersFromEncryptedFile ( - LPCWSTR lpcwstr, - PENCRYPTION_CERTIFICATE_HASH_LIST pencryption_certificate_hash_list - ) -{ - FIXME("%s() not implemented!\n", __FUNCTION__); - return ERROR_CALL_NOT_IMPLEMENTED; -} - -/* - * @unimplemented - */ -BOOL WINAPI FileEncryptionStatusW ( - LPCWSTR lpFileName, - LPDWORD lpStatus - ) -{ - FIXME("%s(%S) not implemented!\n", __FUNCTION__, lpFileName); - if (!lpStatus) - return FALSE; - *lpStatus = FILE_SYSTEM_NOT_SUPPORT; - return TRUE; -} - - -/* - * @implemented - */ -BOOL WINAPI FileEncryptionStatusA ( - LPCSTR lpFileName, - LPDWORD lpStatus - ) -{ - UNICODE_STRING FileName; - NTSTATUS Status; - BOOL ret = FALSE; - - TRACE("(%s, %p)\n", lpFileName, lpStatus); - - FileName.Buffer = NULL; - - Status = RtlCreateUnicodeStringFromAsciiz(&FileName, lpFileName); - if (!NT_SUCCESS(Status)) - { - SetLastError(RtlNtStatusToDosError(Status)); - goto cleanup; - } - ret = FileEncryptionStatusW(FileName.Buffer, lpStatus); - -cleanup: - if (FileName.Buffer != NULL) - RtlFreeUnicodeString(&FileName); - return ret; -} - -/* - * @unimplemented - */ -DWORD WINAPI QueryUsersOnEncryptedFile ( - LPCWSTR lpctstr, - PENCRYPTION_CERTIFICATE_HASH_LIST* pencryption_certificate_hash_list - ) -{ - FIXME("%s() not implemented!\n", __FUNCTION__); - return ERROR_CALL_NOT_IMPLEMENTED; -} - - -/* - * @unimplemented - */ -void WINAPI FreeEncryptionCertificateHashList ( - PENCRYPTION_CERTIFICATE_HASH_LIST pencryption_certificate_hash_list - ) -{ - FIXME("%s() not implemented!\n", __FUNCTION__); - return; -} - - -/* - * @unimplemented - */ -DWORD WINAPI QueryRecoveryAgentsOnEncryptedFile ( - LPCWSTR lpctstr, - PENCRYPTION_CERTIFICATE_HASH_LIST* pencryption_certificate_hash_list - ) -{ - FIXME("%s() not implemented!\n", __FUNCTION__); - return ERROR_CALL_NOT_IMPLEMENTED; -} - -/* - * @unimplemented - */ -BOOL WINAPI EncryptionDisable( - LPCWSTR DirPath, - BOOL Disable - ) -{ - FIXME("%s() not implemented!\n", __FUNCTION__); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - diff --git a/dll/win32/advapi32/misc/efs.c b/dll/win32/advapi32/misc/efs.c index 11fb8e588ed..51f4111368a 100644 --- a/dll/win32/advapi32/misc/efs.c +++ b/dll/win32/advapi32/misc/efs.c @@ -12,11 +12,24 @@ WINE_DEFAULT_DEBUG_CHANNEL(advapi); +/* + * @unimplemented + */ +DWORD WINAPI +AddUsersToEncryptedFile(LPCWSTR lpcwstr, + PENCRYPTION_CERTIFICATE_LIST pencryption_certificate_list) +{ + FIXME("%s() not implemented!\n", __FUNCTION__); + return ERROR_CALL_NOT_IMPLEMENTED; +} + + /* * @implemented */ BOOL WINAPI -DecryptFileA(LPCSTR lpFileName, DWORD dwReserved) +DecryptFileA(LPCSTR lpFileName, + DWORD dwReserved) { UNICODE_STRING FileName; NTSTATUS Status; @@ -40,7 +53,9 @@ DecryptFileA(LPCSTR lpFileName, DWORD dwReserved) /* * @unimplemented */ -BOOL WINAPI DecryptFileW(LPCWSTR lpFileName, DWORD dwReserved) +BOOL WINAPI +DecryptFileW(LPCWSTR lpFileName, + DWORD dwReserved) { FIXME("%s(%S) not implemented!\n", __FUNCTION__, lpFileName); return TRUE; @@ -82,4 +97,113 @@ EncryptFileW(LPCWSTR lpFileName) return TRUE; } + +/* + * @unimplemented + */ +BOOL WINAPI +EncryptionDisable(LPCWSTR DirPath, + BOOL Disable) +{ + FIXME("%s() not implemented!\n", __FUNCTION__); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + + +/* + * @implemented + */ +BOOL WINAPI +FileEncryptionStatusA(LPCSTR lpFileName, + LPDWORD lpStatus) +{ + UNICODE_STRING FileName; + NTSTATUS Status; + BOOL ret = FALSE; + + TRACE("(%s, %p)\n", lpFileName, lpStatus); + + FileName.Buffer = NULL; + + Status = RtlCreateUnicodeStringFromAsciiz(&FileName, lpFileName); + if (!NT_SUCCESS(Status)) + { + SetLastError(RtlNtStatusToDosError(Status)); + goto cleanup; + } + + ret = FileEncryptionStatusW(FileName.Buffer, lpStatus); + +cleanup: + if (FileName.Buffer != NULL) + RtlFreeUnicodeString(&FileName); + + return ret; +} + +/* + * @unimplemented + */ +BOOL WINAPI +FileEncryptionStatusW(LPCWSTR lpFileName, + LPDWORD lpStatus) +{ + FIXME("%s(%S) not implemented!\n", __FUNCTION__, lpFileName); + + if (!lpStatus) + return FALSE; + + *lpStatus = FILE_SYSTEM_NOT_SUPPORT; + + return TRUE; +} + + +/* + * @unimplemented + */ +VOID WINAPI +FreeEncryptionCertificateHashList(PENCRYPTION_CERTIFICATE_HASH_LIST pencryption_certificate_hash_list) +{ + FIXME("%s() not implemented!\n", __FUNCTION__); + return; +} + + +/* + * @unimplemented + */ +DWORD WINAPI +QueryRecoveryAgentsOnEncryptedFile(LPCWSTR lpctstr, + PENCRYPTION_CERTIFICATE_HASH_LIST* pencryption_certificate_hash_list) +{ + FIXME("%s() not implemented!\n", __FUNCTION__); + return ERROR_CALL_NOT_IMPLEMENTED; +} + + +/* + * @unimplemented + */ +DWORD WINAPI +QueryUsersOnEncryptedFile(LPCWSTR lpctstr, + PENCRYPTION_CERTIFICATE_HASH_LIST* pencryption_certificate_hash_list) +{ + FIXME("%s() not implemented!\n", __FUNCTION__); + return ERROR_CALL_NOT_IMPLEMENTED; +} + + +/* + * @unimplemented + */ +DWORD WINAPI +RemoveUsersFromEncryptedFile(LPCWSTR lpcwstr, + PENCRYPTION_CERTIFICATE_HASH_LIST pencryption_certificate_hash_list) +{ + FIXME("%s() not implemented!\n", __FUNCTION__); + return ERROR_CALL_NOT_IMPLEMENTED; +} + /* EOF */ diff --git a/dll/win32/advapi32/service/scm.c b/dll/win32/advapi32/service/scm.c index c3a05da4bf9..ccd3e677986 100644 --- a/dll/win32/advapi32/service/scm.c +++ b/dll/win32/advapi32/service/scm.c @@ -2372,7 +2372,7 @@ StartServiceA(SC_HANDLE hService, if (dwError != ERROR_SUCCESS) { - TRACE("RStartServiceA() failed (Error %lu)\n", dwError); + ERR("RStartServiceA() failed (Error %lu)\n", dwError); SetLastError(dwError); return FALSE; } @@ -2407,7 +2407,7 @@ StartServiceW(SC_HANDLE hService, if (dwError != ERROR_SUCCESS) { - TRACE("RStartServiceW() failed (Error %lu)\n", dwError); + ERR("RStartServiceW() failed (Error %lu)\n", dwError); SetLastError(dwError); return FALSE; } diff --git a/dll/win32/atl/stubs.c b/dll/win32/atl/stubs.c index a35e3dc6508..01f22de9199 100644 --- a/dll/win32/atl/stubs.c +++ b/dll/win32/atl/stubs.c @@ -1,5 +1,5 @@ #include -#include +#include #define ATLAPI_(x) x WINAPI #define ATLAPI ATLAPI_(HRESULT) @@ -31,7 +31,7 @@ AtlSetErrorInfo( return E_NOTIMPL; } -ATLAPI_(LPDEVMODEA) +ATLAPI_(LPDEVMODEA) AtlDevModeW2A(LPDEVMODEA lpDevModeA, LPDEVMODEW lpDevModeW) { UNIMPLEMENTED; diff --git a/dll/win32/cabinet/stubs.c b/dll/win32/cabinet/stubs.c index d57a544020d..e0469cb5ae4 100644 --- a/dll/win32/cabinet/stubs.c +++ b/dll/win32/cabinet/stubs.c @@ -1,5 +1,5 @@ #include -#include +#include typedef PVOID PSESSION; diff --git a/dll/win32/cfgmgr32/cfgmgr32.spec b/dll/win32/cfgmgr32/cfgmgr32.spec index f1c54cb363a..f3aab21514a 100644 --- a/dll/win32/cfgmgr32/cfgmgr32.spec +++ b/dll/win32/cfgmgr32/cfgmgr32.spec @@ -1,9 +1,9 @@ @ stdcall CMP_Init_Detection(long) setupapi.CMP_Init_Detection @ stdcall CMP_RegisterNotification(ptr ptr long ptr) setupapi.CMP_RegisterNotification @ stdcall CMP_Report_LogOn(long long) setupapi.CMP_Report_LogOn -@ stub CMP_UnregisterNotification # setupapi.CMP_UnregisterNotification +@ stdcall CMP_UnregisterNotification(ptr) setupapi.CMP_UnregisterNotification @ stdcall CMP_WaitNoPendingInstallEvents(long) setupapi.CMP_WaitNoPendingInstallEvents -@ stub CMP_WaitServicesAvailable # setupapi.CMP_WaitServicesAvailable +@ stdcall CMP_WaitServicesAvailable(ptr) setupapi.CMP_WaitServicesAvailable @ stdcall CM_Add_Empty_Log_Conf(ptr ptr long long) setupapi.CM_Add_Empty_Log_Conf @ stdcall CM_Add_Empty_Log_Conf_Ex(ptr ptr long long ptr) setupapi.CM_Add_Empty_Log_Conf_Ex @ stdcall CM_Add_IDA(ptr str long) setupapi.CM_Add_IDA @@ -11,8 +11,8 @@ @ stdcall CM_Add_ID_ExA(ptr str long ptr) setupapi.CM_Add_ID_ExA @ stdcall CM_Add_ID_ExW(ptr wstr long ptr) setupapi.CM_Add_ID_ExW @ stub CM_Add_Range # setupapi.CM_Add_Range -@ stub CM_Add_Res_Des # setupapi.CM_Add_Res_Des -@ stub CM_Add_Res_Des_Ex # setupapi.CM_Add_Res_Des_Ex +@ stdcall CM_Add_Res_Des(ptr ptr long ptr long long) setupapi.CM_Add_Res_Des +@ stdcall CM_Add_Res_Des_Ex(ptr ptr long ptr long long long) setupapi.CM_Add_Res_Des_Ex @ stdcall CM_Connect_MachineA(str ptr) setupapi.CM_Connect_MachineA @ stdcall CM_Connect_MachineW(wstr ptr) setupapi.CM_Connect_MachineW @ stdcall CM_Create_DevNodeA(ptr str long long) setupapi.CM_Create_DevNodeA @@ -45,9 +45,10 @@ @ stdcall CM_Free_Log_Conf_Ex(ptr long ptr) setupapi.CM_Free_Log_Conf_Ex @ stdcall CM_Free_Log_Conf_Handle(ptr) setupapi.CM_Free_Log_Conf_Handle @ stub CM_Free_Range_List # setupapi.CM_Free_Range_List -@ stub CM_Free_Res_Des # setupapi.CM_Free_Res_Des -@ stub CM_Free_Res_Des_Ex # setupapi.CM_Free_Res_Des_Ex -@ stub CM_Free_Res_Des_Handle # setupapi.CM_Free_Res_Des_Handle +@ stdcall CM_Free_Res_Des(ptr ptr long) setupapi.CM_Free_Res_Des +@ stdcall CM_Free_Res_Des_Ex(ptr ptr long long) setupapi.CM_Free_Res_Des_Ex +@ stdcall CM_Free_Res_Des_Handle(ptr) setupapi.CM_Free_Res_Des_Handle +@ stub CM_Free_Resource_Conflict_Handle # setupapi.CM_Free_Resource_Conflict_Handle @ stdcall CM_Get_Child(ptr long long) setupapi.CM_Get_Child @ stdcall CM_Get_Child_Ex(ptr long long long) setupapi.CM_Get_Child_Ex @ stdcall CM_Get_Class_Key_NameA(ptr str ptr long) setupapi.CM_Get_Class_Key_NameA @@ -58,6 +59,8 @@ @ stdcall CM_Get_Class_NameW(ptr wstr ptr long) setupapi.CM_Get_Class_NameW @ stdcall CM_Get_Class_Name_ExA(ptr str ptr long long) setupapi.CM_Get_Class_Name_ExA @ stdcall CM_Get_Class_Name_ExW(ptr wstr ptr long long) setupapi.CM_Get_Class_Name_ExW +@ stub CM_Get_Class_Registry_PropertyA # setupapi.CM_Get_Class_Registry_PropertyA +@ stub CM_Get_Class_Registry_PropertyW # setupapi.CM_Get_Class_Registry_PropertyW @ stdcall CM_Get_Depth(ptr long long) setupapi.CM_Get_Depth @ stdcall CM_Get_Depth_Ex(ptr long long long) setupapi.CM_Get_Depth_Ex @ stdcall CM_Get_DevNode_Registry_PropertyA(long long ptr ptr ptr long) setupapi.CM_Get_DevNode_Registry_PropertyA @@ -108,14 +111,17 @@ @ stdcall CM_Get_Log_Conf_Priority_Ex(ptr ptr long long) setupapi.CM_Get_Log_Conf_Priority_Ex @ stdcall CM_Get_Next_Log_Conf(ptr ptr long) setupapi.CM_Get_Next_Log_Conf @ stdcall CM_Get_Next_Log_Conf_Ex(ptr ptr long long) setupapi.CM_Get_Next_Log_Conf_Ex -@ stub CM_Get_Next_Res_Des # setupapi.CM_Get_Next_Res_Des -@ stub CM_Get_Next_Res_Des_Ex # setupapi.CM_Get_Next_Res_Des_Ex +@ stdcall CM_Get_Next_Res_Des(ptr ptr long ptr long) setupapi.CM_Get_Next_Res_Des +@ stdcall CM_Get_Next_Res_Des_Ex(ptr ptr long ptr long long) setupapi.CM_Get_Next_Res_Des_Ex @ stdcall CM_Get_Parent(ptr long long) setupapi.CM_Get_Parent @ stdcall CM_Get_Parent_Ex(ptr long long long) setupapi.CM_Get_Parent_Ex -@ stub CM_Get_Res_Des_Data # setupapi.CM_Get_Res_Des_Data -@ stub CM_Get_Res_Des_Data_Ex # setupapi.CM_Get_Res_Des_Data_Ex -@ stub CM_Get_Res_Des_Data_Size # setupapi.CM_Get_Res_Des_Data_Size -@ stub CM_Get_Res_Des_Data_Size_Ex # setupapi.CM_Get_Res_Des_Data_Size_Ex +@ stdcall CM_Get_Res_Des_Data(ptr ptr long long) setupapi.CM_Get_Res_Des_Data +@ stdcall CM_Get_Res_Des_Data_Ex(ptr ptr long long long) setupapi.CM_Get_Res_Des_Data_Ex +@ stdcall CM_Get_Res_Des_Data_Size(ptr ptr long) setupapi.CM_Get_Res_Des_Data_Size +@ stdcall CM_Get_Res_Des_Data_Size_Ex(ptr ptr long long) setupapi.CM_Get_Res_Des_Data_Size_Ex +@ stub CM_Get_Resource_Conflict_Count # setupapi.CM_Get_Resource_Conflict_Count +@ stub CM_Get_Resource_Conflict_DetailsA # setupapi.CM_Get_Resource_Conflict_DetailsA +@ stub CM_Get_Resource_Conflict_DetailsW # setupapi.CM_Get_Resource_Conflict_DetailsW @ stdcall CM_Get_Sibling(ptr long long) setupapi.CM_Get_Sibling @ stdcall CM_Get_Sibling_Ex(ptr long long long) setupapi.CM_Get_Sibling_Ex @ stdcall CM_Get_Version() setupapi.CM_Get_Version @@ -129,8 +135,8 @@ @ stdcall CM_Locate_DevNode_ExA(ptr str long long) setupapi.CM_Locate_DevNode_ExA @ stdcall CM_Locate_DevNode_ExW(ptr wstr long long) setupapi.CM_Locate_DevNode_ExW @ stub CM_Merge_Range_List # setupapi.CM_Merge_Range_List -@ stub CM_Modify_Res_Des # setupapi.CM_Modify_Res_Des -@ stub CM_Modify_Res_Des_Ex # setupapi.CM_Modify_Res_Des_Ex +@ stdcall CM_Modify_Res_Des(ptr ptr long ptr long long) setupapi.CM_Modify_Res_Des +@ stdcall CM_Modify_Res_Des_Ex(ptr ptr long ptr long long long) setupapi.CM_Modify_Res_Des_Ex @ stdcall CM_Move_DevNode(long long long) setupapi.CM_Move_DevNode @ stdcall CM_Move_DevNode_Ex(long long long long) setupapi.CM_Move_DevNode_Ex @ stub CM_Next_Range # setupapi.CM_Next_Range @@ -140,14 +146,17 @@ @ stdcall CM_Open_Class_Key_ExW(ptr wstr long long ptr long long) setupapi.CM_Open_Class_Key_ExW @ stdcall CM_Open_DevNode_Key(ptr long long long ptr long) setupapi.CM_Open_DevNode_Key @ stdcall CM_Open_DevNode_Key_Ex(ptr long long long ptr long long) setupapi.CM_Open_DevNode_Key_Ex -@ stub CM_Query_And_Remove_SubTreeA -@ stub CM_Query_And_Remove_SubTreeW +@ stub CM_Query_And_Remove_SubTreeA # setupapi.CM_Query_And_Remove_SubTreeA +@ stub CM_Query_And_Remove_SubTreeW # setupapi.CM_Query_And_Remove_SubTreeW +@ stub CM_Query_And_Remove_SubTree_ExA # setupapi.CM_Query_And_Remove_SubTree_ExA +@ stub CM_Query_And_Remove_SubTree_ExW # setupapi.CM_Query_And_Remove_SubTree_ExW @ stub CM_Query_Arbitrator_Free_Data # setupapi.CM_Query_Arbitrator_Free_Data @ stub CM_Query_Arbitrator_Free_Data_Ex # setupapi.CM_Query_Arbitrator_Free_Data_Ex @ stub CM_Query_Arbitrator_Free_Size # setupapi.CM_Query_Arbitrator_Free_Size @ stub CM_Query_Arbitrator_Free_Size_Ex # setupapi.CM_Query_Arbitrator_Free_Size_Ex @ stub CM_Query_Remove_SubTree # setupapi.CM_Query_Remove_SubTree @ stub CM_Query_Remove_SubTree_Ex # setupapi.CM_Query_Remove_SubTree_Ex +@ stub CM_Query_Resource_Conflict_List # setupapi.CM_Query_Resource_Conflict_List @ stdcall CM_Reenumerate_DevNode(long long) setupapi.CM_Reenumerate_DevNode @ stdcall CM_Reenumerate_DevNode_Ex(long long long) setuapi.CM_Reenumerate_DevNode_Ex @ stub CM_Register_Device_Driver # setupapi.CM_Register_Device_Driver @@ -158,16 +167,14 @@ @ stub CM_Register_Device_Interface_ExW # setupapi.CM_Register_Device_Interface_ExW @ stub CM_Remove_SubTree # setupapi.CM_Remove_SubTree @ stub CM_Remove_SubTree_Ex # setupapi.CM_Remove_SubTree_Ex -@ stub CM_Remove_Unmarked_Children # setupapi.CM_Remove_Unmarked_Children -@ stub CM_Remove_Unmarked_Children_Ex # setupapi.CM_Remove_Unmarked_Children_Ex @ stub CM_Request_Device_EjectA # setupapi.CM_Request_Device_EjectA @ stub CM_Request_Device_EjectW # setupapi.CM_Request_Device_EjectW @ stdcall CM_Request_Eject_PC() setupapi.CM_Request_Eject_PC @ stdcall CM_Request_Eject_PC_Ex(long) setupapi.CM_Request_Eject_PC_Ex -@ stub CM_Reset_Children_Marks # setupapi.CM_Reset_Children_Marks -@ stub CM_Reset_Children_Marks_Ex # setupapi.CM_Reset_Children_Marks_Ex @ stdcall CM_Run_Detection(long) setupapi.CM_Run_Detection @ stdcall CM_Run_Detection_Ex(long long) setupapi.CM_Run_Detection_Ex +@ stub CM_Set_Class_Registry_PropertyA # setupapi.CM_Set_Class_Registry_PropertyA +@ stub CM_Set_Class_Registry_PropertyW # setupapi.CM_Set_Class_Registry_PropertyW @ stdcall CM_Set_DevNode_Problem(long long long) setupapi.CM_Set_DevNode_Problem @ stdcall CM_Set_DevNode_Problem_Ex(long long long long) setupapi.CM_Set_DevNode_Problem_Ex @ stdcall CM_Set_DevNode_Registry_PropertyA(long long ptr long long) setupapi.CM_Set_DevNode_Registry_PropertyA @@ -189,3 +196,9 @@ @ stub CM_Unregister_Device_InterfaceW # setupapi.CM_Unregister_Device_InterfaceW @ stub CM_Unregister_Device_Interface_ExA # setupapi.CM_Unregister_Device_Interface_ExA @ stub CM_Unregister_Device_Interface_ExW # setupapi.CM_Unregister_Device_Interface_ExW + +# Deprecated functions, they are not present in Win2003 SP1 +@ stub CM_Remove_Unmarked_Children # setupapi.CM_Remove_Unmarked_Children +@ stub CM_Remove_Unmarked_Children_Ex # setupapi.CM_Remove_Unmarked_Children_Ex +@ stub CM_Reset_Children_Marks # setupapi.CM_Reset_Children_Marks +@ stub CM_Reset_Children_Marks_Ex # setupapi.CM_Reset_Children_Marks_Ex diff --git a/dll/win32/comctl32/comboex.c b/dll/win32/comctl32/comboex.c index 4b5e079ac99..10d8b8727b8 100644 --- a/dll/win32/comctl32/comboex.c +++ b/dll/win32/comctl32/comboex.c @@ -431,18 +431,13 @@ static void COMBOEX_ReSize (const COMBOEX_INFO *infoPtr) if (infoPtr->hwndCombo) { SendMessageW (infoPtr->hwndCombo, CB_SETITEMHEIGHT, 0, cy); if ( !(infoPtr->flags & CBES_EX_NOSIZELIMIT)) { - RECT comboRect; - if (GetWindowRect(infoPtr->hwndCombo, &comboRect)) { - RECT ourRect; - if (GetWindowRect(infoPtr->hwndSelf, &ourRect)) { - if (comboRect.bottom > ourRect.bottom) { - POINT pt = { ourRect.left, ourRect.top }; - if (ScreenToClient(infoPtr->hwndSelf, &pt)) - MoveWindow( infoPtr->hwndSelf, pt.x, pt.y, ourRect.right - ourRect.left, - comboRect.bottom - comboRect.top, FALSE); - } - } - } + RECT comboRect, ourRect; + GetWindowRect(infoPtr->hwndCombo, &comboRect); + GetWindowRect(infoPtr->hwndSelf, &ourRect); + if (comboRect.bottom > ourRect.bottom) + SetWindowPos( infoPtr->hwndSelf, 0, 0, 0, ourRect.right - ourRect.left, + comboRect.bottom - comboRect.top, + SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW ); } } } @@ -758,7 +753,7 @@ static HIMAGELIST COMBOEX_SetImageList (COMBOEX_INFO *infoPtr, HIMAGELIST himl) return himlTemp; } -static BOOL COMBOEX_SetItemW (const COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit) +static BOOL COMBOEX_SetItemW (const COMBOEX_INFO *infoPtr, const COMBOBOXEXITEMW *cit) { INT_PTR index = cit->iItem; CBE_ITEMDATA *item; @@ -1698,7 +1693,7 @@ static LRESULT COMBOEX_WindowPosChanging (const COMBOEX_INFO *infoPtr, WINDOWPOS height = (cb_wrect.bottom-cb_wrect.top) + (cbx_wrect.bottom-cbx_wrect.top) - (cbx_crect.bottom-cbx_crect.top); - if (wp->cy < height) wp->cy = height; + wp->cy = height; if (infoPtr->hwndEdit) { COMBOEX_AdjustEditPos (infoPtr); InvalidateRect (infoPtr->hwndCombo, 0, TRUE); diff --git a/dll/win32/comctl32/comctl32.h b/dll/win32/comctl32/comctl32.h index 3d172ae7605..401468883fd 100644 --- a/dll/win32/comctl32/comctl32.h +++ b/dll/win32/comctl32/comctl32.h @@ -101,16 +101,15 @@ extern HBRUSH COMCTL32_hPattern55AABrush; #define IDT_CHECK 401 -/* Header cursors */ +/* Cursors */ +#define IDC_MOVEBUTTON 102 +#define IDC_COPY 104 #define IDC_DIVIDER 106 #define IDC_DIVIDEROPEN 107 /* DragList resources */ #define IDI_DRAGARROW 501 -#define IDC_COPY 502 - -#define IDC_MOVEBUTTON 1 /* HOTKEY internal strings */ #define HKY_NONE 2048 diff --git a/dll/win32/comctl32/comctl32.spec b/dll/win32/comctl32/comctl32.spec index 60378c28513..1654d3ec903 100644 --- a/dll/win32/comctl32/comctl32.spec +++ b/dll/win32/comctl32/comctl32.spec @@ -38,27 +38,27 @@ 234 stdcall -noname Str_SetPtrA(str str) 235 stdcall -noname Str_GetPtrW(wstr wstr long) 236 stdcall -noname Str_SetPtrW(wstr wstr) -320 stdcall -noname DSA_Create(long long) -321 stdcall -noname DSA_Destroy(ptr) -322 stdcall -noname DSA_GetItem(ptr long long) -323 stdcall -noname DSA_GetItemPtr(ptr long) -324 stdcall -noname DSA_InsertItem(ptr long long) -325 stdcall -noname DSA_SetItem (ptr long long) -326 stdcall -noname DSA_DeleteItem(ptr long) -327 stdcall -noname DSA_DeleteAllItems(ptr) -328 stdcall -noname DPA_Create(long) -329 stdcall -noname DPA_Destroy(ptr) -330 stdcall -noname DPA_Grow(ptr long) -331 stdcall -noname DPA_Clone(ptr ptr) -332 stdcall -noname DPA_GetPtr(ptr long) -333 stdcall -noname DPA_GetPtrIndex(ptr ptr) -334 stdcall -noname DPA_InsertPtr(ptr long ptr) -335 stdcall -noname DPA_SetPtr(ptr long ptr) -336 stdcall -noname DPA_DeletePtr(ptr long) -337 stdcall -noname DPA_DeleteAllPtrs(ptr) -338 stdcall -noname DPA_Sort(ptr ptr long) -339 stdcall -noname DPA_Search(ptr ptr long ptr long long) -340 stdcall -noname DPA_CreateEx(long long) +320 stdcall -ordinal DSA_Create(long long) +321 stdcall -ordinal DSA_Destroy(ptr) +322 stdcall -ordinal DSA_GetItem(ptr long long) +323 stdcall -ordinal DSA_GetItemPtr(ptr long) +324 stdcall -ordinal DSA_InsertItem(ptr long long) +325 stdcall -ordinal DSA_SetItem (ptr long long) +326 stdcall -ordinal DSA_DeleteItem(ptr long) +327 stdcall -ordinal DSA_DeleteAllItems(ptr) +328 stdcall -ordinal DPA_Create(long) +329 stdcall -ordinal DPA_Destroy(ptr) +330 stdcall -ordinal DPA_Grow(ptr long) +331 stdcall -ordinal DPA_Clone(ptr ptr) +332 stdcall -ordinal DPA_GetPtr(ptr long) +333 stdcall -ordinal DPA_GetPtrIndex(ptr ptr) +334 stdcall -ordinal DPA_InsertPtr(ptr long ptr) +335 stdcall -ordinal DPA_SetPtr(ptr long ptr) +336 stdcall -ordinal DPA_DeletePtr(ptr long) +337 stdcall -ordinal DPA_DeleteAllPtrs(ptr) +338 stdcall -ordinal DPA_Sort(ptr ptr long) +339 stdcall -ordinal DPA_Search(ptr ptr long ptr long long) +340 stdcall -ordinal DPA_CreateEx(long long) 341 stdcall -noname SendNotify(long long long ptr) 342 stdcall -noname SendNotifyEx(long long long ptr long) 350 stdcall -noname StrChrA(str str) @@ -90,16 +90,16 @@ 382 stdcall -noname SmoothScrollWindow(ptr) 383 stdcall -noname DoReaderMode(ptr) 384 stdcall -noname SetPathWordBreakProc(ptr long) -385 stdcall -noname DPA_EnumCallback(long long long) -386 stdcall -noname DPA_DestroyCallback(ptr ptr long) -387 stdcall -noname DSA_EnumCallback(ptr ptr long) -388 stdcall -noname DSA_DestroyCallback(ptr ptr long) +385 stdcall -ordinal DPA_EnumCallback(long long long) +386 stdcall -ordinal DPA_DestroyCallback(ptr ptr long) +387 stdcall -ordinal DSA_EnumCallback(ptr ptr long) +388 stdcall -ordinal DSA_DestroyCallback(ptr ptr long) 389 stdcall -noname comctl32_389(long long) 390 stdcall -noname ImageList_SetColorTable(ptr long long ptr) -400 stdcall -noname CreateMRUListW(ptr) -401 stdcall -noname AddMRUStringW(long wstr) +400 stdcall -ordinal CreateMRUListW(ptr) +401 stdcall -ordinal AddMRUStringW(long wstr) 402 stdcall -noname FindMRUStringW(long wstr ptr) -403 stdcall -noname EnumMRUListW(long long ptr long) +403 stdcall -ordinal EnumMRUListW(long long ptr long) 404 stdcall -noname CreateMRUListLazyW(ptr long long long) 410 stdcall -ordinal SetWindowSubclass(long ptr long long) 411 stdcall -ordinal GetWindowSubclass(long ptr long ptr) @@ -188,5 +188,6 @@ @ stdcall PropertySheet(ptr) PropertySheetA @ stdcall PropertySheetA(ptr) @ stdcall PropertySheetW(ptr) +@ stdcall TaskDialogIndirect(ptr ptr ptr ptr) @ stdcall UninitializeFlatSB(long) @ stdcall _TrackMouseEvent(ptr) diff --git a/dll/win32/comctl32/comctl_Bg.rc b/dll/win32/comctl32/comctl_Bg.rc index a45bcd16f29..f44eda499fd 100644 --- a/dll/win32/comctl32/comctl_Bg.rc +++ b/dll/win32/comctl32/comctl_Bg.rc @@ -68,24 +68,3 @@ BEGIN LTEXT "& :", -1,192,5,78,10 /* 182 -> 192 ? */ LISTBOX IDC_TOOLBARBTN_LBOX, 192,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP /* 182 -> 192 ? */ END - -STRINGTABLE -{ - IDS_CLOSE "" -} - -STRINGTABLE -{ - IDM_TODAY ":" - IDM_GOTODAY " " -} - -STRINGTABLE -{ - IDS_SEPARATOR "" -} - -STRINGTABLE -{ - HKY_NONE "" -} diff --git a/dll/win32/comctl32/comctl_Cs.rc b/dll/win32/comctl32/comctl_Cs.rc index d993c713a29..e75138f33ce 100644 --- a/dll/win32/comctl32/comctl_Cs.rc +++ b/dll/win32/comctl32/comctl_Cs.rc @@ -72,24 +72,3 @@ BEGIN LTEXT "&Tlatka panelu:", -1,182,5,78,10 LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP END - -STRINGTABLE -{ - IDS_CLOSE "Zavt" -} - -STRINGTABLE -{ - IDM_TODAY "Dnes:" - IDM_GOTODAY "Jdi na dneek" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Oddlova" -} - -STRINGTABLE -{ - HKY_NONE "dn" -} diff --git a/dll/win32/comctl32/comctl_Da.rc b/dll/win32/comctl32/comctl_Da.rc index 0dc1068f83b..f49b522705f 100644 --- a/dll/win32/comctl32/comctl_Da.rc +++ b/dll/win32/comctl32/comctl_Da.rc @@ -69,24 +69,3 @@ BEGIN LTEXT "&Værktøjs knapper:", -1,182,5,78,10 LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP END - -STRINGTABLE -{ - IDS_CLOSE "Luk" -} - -STRINGTABLE -{ - IDM_TODAY "Idag:" - IDM_GOTODAY "Gå til i dag" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Separator" -} - -STRINGTABLE -{ - HKY_NONE "Ingen" -} diff --git a/dll/win32/comctl32/comctl_De.rc b/dll/win32/comctl32/comctl_De.rc index afb2a844c1e..455fd458a1d 100644 --- a/dll/win32/comctl32/comctl_De.rc +++ b/dll/win32/comctl32/comctl_De.rc @@ -22,27 +22,6 @@ LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL -STRINGTABLE -{ - IDS_CLOSE "Schließen" -} - -STRINGTABLE -{ - IDM_TODAY "Heute:" - IDM_GOTODAY "Gehe zu Heute" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Trennzeichen" -} - -STRINGTABLE -{ - HKY_NONE "Keiner" -} - IDD_PROPSHEET DIALOG 0, 0, 220, 140 STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE CAPTION "Eigenschaften für %s" diff --git a/dll/win32/comctl32/comctl_El.rc b/dll/win32/comctl32/comctl_El.rc index 284b3a287c4..d0227dd9ca5 100644 --- a/dll/win32/comctl32/comctl_El.rc +++ b/dll/win32/comctl32/comctl_El.rc @@ -66,24 +66,3 @@ BEGIN LTEXT "& :", -1,182,5,78,10 LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP END - -STRINGTABLE -{ - IDS_CLOSE "" -} - -STRINGTABLE -{ - IDM_TODAY ":" - IDM_GOTODAY " " -} - -STRINGTABLE -{ - IDS_SEPARATOR "" -} - -STRINGTABLE -{ - HKY_NONE "" -} diff --git a/dll/win32/comctl32/comctl_En.rc b/dll/win32/comctl32/comctl_En.rc index c7ddc7a15c8..c9bd6849f85 100644 --- a/dll/win32/comctl32/comctl_En.rc +++ b/dll/win32/comctl32/comctl_En.rc @@ -66,24 +66,3 @@ BEGIN LTEXT "&Toolbar buttons:", -1,182,5,78,10 LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP END - -STRINGTABLE -{ - IDS_CLOSE "Close" -} - -STRINGTABLE -{ - IDM_TODAY "Today:" - IDM_GOTODAY "Go to today" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Separator" -} - -STRINGTABLE -{ - HKY_NONE "None" -} diff --git a/dll/win32/comctl32/comctl_Eo.rc b/dll/win32/comctl32/comctl_Eo.rc new file mode 100644 index 00000000000..5d627aa2f3a --- /dev/null +++ b/dll/win32/comctl32/comctl_Eo.rc @@ -0,0 +1,68 @@ +/* Esperanto Language Support + * Copyright 2006 Antonio Codazzi + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "comctl32.h" + +LANGUAGE LANG_ESPERANTO, SUBLANG_DEFAULT + +IDD_PROPSHEET DIALOG 0, 0, 220, 140 +STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE +CAPTION "Ecoj la %s" +FONT 8, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "Bone", IDOK,4,122,50,14, WS_TABSTOP | WS_GROUP + PUSHBUTTON "Rezigni", IDCANCEL,58,122,50,14 + PUSHBUTTON "&Apliku", IDC_APPLY_BUTTON,112,122,50,14,WS_DISABLED + PUSHBUTTON "Helpo", IDHELP,166,122,50,14,WS_TABSTOP|WS_GROUP + CONTROL "Langeto", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS|WS_GROUP|WS_TABSTOP|TCS_MULTILINE,4,4,212,114 +END + + +IDD_WIZARD DIALOG 0, 0, 290, 159 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE +CAPTION "Estrita Proceduro" +FONT 8, "MS Shell Dlg" +BEGIN + PUSHBUTTON "< &Retro", IDC_BACK_BUTTON,71,138,50,14 + DEFPUSHBUTTON "&Antaen >", IDC_NEXT_BUTTON,121,138,50,14 + DEFPUSHBUTTON "Konkludi", IDC_FINISH_BUTTON,121,138,50,14 + PUSHBUTTON "Rezigni", IDCANCEL,178,138,50,14 + PUSHBUTTON "Helpo", IDHELP,235,138,50,14,WS_GROUP + LTEXT "", IDC_SUNKEN_LINE,7,129,278,1,SS_SUNKEN + CONTROL "Langeto", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS | WS_DISABLED,7,7,258,5 + LTEXT "", IDC_SUNKEN_LINEHEADER,0,35,290,1,SS_LEFT | SS_SUNKEN | WS_CHILD | WS_VISIBLE +END + + +IDD_TBCUSTOMIZE DIALOG 10, 20, 357, 125 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Agordu stangon de la iloj" +FONT 8, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "&Fermu", IDCANCEL,308,6,44,14 + PUSHBUTTON "R&ee agordu", IDC_RESET_BTN,308,23,44,14 + PUSHBUTTON "&Helpo", IDC_HELP_BTN,308,40,44,14 + PUSHBUTTON "&Supre forovu", IDC_MOVEUP_BTN,308,74,44,14 + PUSHBUTTON "Su&be forovu", IDC_MOVEDN_BTN,308,91,44,14 + LTEXT "&Disponeblaj butonoj:", -1,4,5,84,10 + LISTBOX IDC_AVAILBTN_LBOX,4,17,120,100, LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP + PUSHBUTTON "&Aldonu ->", IDOK, 131, 42, 44, 14 + PUSHBUTTON "<- &Forigu", IDC_REMOVE_BTN,131,62,44,14 + LTEXT "Butonoj por stango de la &iloj", -1,182,5,78,10 + LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP +END diff --git a/dll/win32/comctl32/comctl_Es.rc b/dll/win32/comctl32/comctl_Es.rc index 34e6f6c0a5d..e026f54cb03 100644 --- a/dll/win32/comctl32/comctl_Es.rc +++ b/dll/win32/comctl32/comctl_Es.rc @@ -66,24 +66,3 @@ BEGIN LTEXT "B&otones de la barra:", -1,182,5,78,10 LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP END - -STRINGTABLE -{ - IDS_CLOSE "Cerrar" -} - -STRINGTABLE -{ - IDM_TODAY "Hoy:" - IDM_GOTODAY "Ir a hoy" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Separador" -} - -STRINGTABLE -{ - HKY_NONE "Ninguno" -} diff --git a/dll/win32/comctl32/comctl_Fr.rc b/dll/win32/comctl32/comctl_Fr.rc index fd8aa10eb49..bab9a31b5a8 100644 --- a/dll/win32/comctl32/comctl_Fr.rc +++ b/dll/win32/comctl32/comctl_Fr.rc @@ -73,24 +73,3 @@ BEGIN LTEXT "&Boutons de la barre d'outils :", -1,182,5,93,10 LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP END - -STRINGTABLE -{ - IDS_CLOSE "Fermer" -} - -STRINGTABLE -{ - IDM_TODAY "Aujourd'hui :" - IDM_GOTODAY "Aller à aujourd'hui" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Séparateur" -} - -STRINGTABLE -{ - HKY_NONE "Aucun" -} diff --git a/dll/win32/comctl32/comctl_Cn.rc b/dll/win32/comctl32/comctl_He.rc similarity index 53% rename from dll/win32/comctl32/comctl_Cn.rc rename to dll/win32/comctl32/comctl_He.rc index a9fa9979bed..cc052615732 100644 --- a/dll/win32/comctl32/comctl_Cn.rc +++ b/dll/win32/comctl32/comctl_He.rc @@ -1,5 +1,6 @@ /* - * Copyright 2002 Tisheng Chen + * Copyright 1999 Eric Kohl + * Copyright 2010 Yaron shahrabani * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -16,75 +17,58 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED -#pragma code_page(936) +#include "comctl32.h" -IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140 +#pragma code_page(65001) + +LANGUAGE LANG_HEBREW, SUBLANG_DEFAULT + +IDD_PROPSHEET DIALOG 0, 0, 220, 140 STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE -CAPTION " %s" +EXSTYLE WS_EX_LAYOUTRTL +CAPTION "המאפיינים של %s" FONT 8, "MS Shell Dlg" BEGIN - DEFPUSHBUTTON "ȷ", IDOK,4,122,50,14, WS_TABSTOP | WS_GROUP - PUSHBUTTON "ȡ", IDCANCEL,58,122,50,14 - PUSHBUTTON "Ӧ(&A)", IDC_APPLY_BUTTON,112,122,50,14,WS_DISABLED - PUSHBUTTON "", IDHELP,166,122,50,14,WS_TABSTOP|WS_GROUP + DEFPUSHBUTTON "אישור", IDOK,4,122,50,14, WS_TABSTOP | WS_GROUP + PUSHBUTTON "ביטול", IDCANCEL,58,122,50,14 + PUSHBUTTON "ה&חלה", IDC_APPLY_BUTTON,112,122,50,14,WS_DISABLED + PUSHBUTTON "עזרה", IDHELP,166,122,50,14,WS_TABSTOP|WS_GROUP CONTROL "Tab", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS|WS_GROUP|WS_TABSTOP|TCS_MULTILINE,4,4,212,114 END -IDD_WIZARD DIALOG DISCARDABLE 0, 0, 290, 159 +IDD_WIZARD DIALOG 0, 0, 290, 159 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE +EXSTYLE WS_EX_LAYOUTRTL CAPTION "Wizard" FONT 8, "MS Shell Dlg" BEGIN - PUSHBUTTON "< һ(&B)", IDC_BACK_BUTTON,71,138,50,14 - DEFPUSHBUTTON "һ(&N) >", IDC_NEXT_BUTTON,121,138,50,14 - DEFPUSHBUTTON "", IDC_FINISH_BUTTON,121,138,50,14 - PUSHBUTTON "ȡ", IDCANCEL,178,138,50,14 - PUSHBUTTON "", IDHELP,235,138,50,14,WS_GROUP + PUSHBUTTON "< ה&קודם", IDC_BACK_BUTTON,71,138,50,14 + DEFPUSHBUTTON "ה&בא >", IDC_NEXT_BUTTON,121,138,50,14 + DEFPUSHBUTTON "סיום", IDC_FINISH_BUTTON,121,138,50,14 + PUSHBUTTON "ביטול", IDCANCEL,178,138,50,14 + PUSHBUTTON "עזרה", IDHELP,235,138,50,14,WS_GROUP LTEXT "", IDC_SUNKEN_LINE,7,129,278,1,SS_SUNKEN CONTROL "Tab", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS | WS_DISABLED,7,7,258,5 LTEXT "", IDC_SUNKEN_LINEHEADER,0,35,290,1,SS_LEFT | SS_SUNKEN | WS_CHILD | WS_VISIBLE END -IDD_TBCUSTOMIZE DIALOG DISCARDABLE 10, 20, 357, 125 +IDD_TBCUSTOMIZE DIALOG 10, 20, 357, 125 STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Զ幤" +EXSTYLE WS_EX_LAYOUTRTL +CAPTION "התאמת סרגל כלים" FONT 8, "MS Shell Dlg" BEGIN - DEFPUSHBUTTON "ر(&C)", IDCANCEL,308,6,44,14 - PUSHBUTTON "(&e)", IDC_RESET_BTN,308,23,44,14 - PUSHBUTTON "(&H)", IDC_HELP_BTN,308,40,44,14 - PUSHBUTTON "(&U)", IDC_MOVEUP_BTN,308,74,44,14 - PUSHBUTTON "(&D)", IDC_MOVEDN_BTN,308,91,44,14 - LTEXT "ùť(&V):", -1,4,5,84,10 + DEFPUSHBUTTON "&סגירה", IDCANCEL,308,6,44,14 + PUSHBUTTON "&איפוס", IDC_RESET_BTN,308,23,44,14 + PUSHBUTTON "ע&זרה", IDC_HELP_BTN,308,40,44,14 + PUSHBUTTON "הזזה למ&עלה", IDC_MOVEUP_BTN,308,74,44,14 + PUSHBUTTON "הזזה למ&טה", IDC_MOVEDN_BTN,308,91,44,14 + LTEXT "לחצנים &זמינים:", -1,4,5,84,10 LISTBOX IDC_AVAILBTN_LBOX,4,17,120,100, LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP - PUSHBUTTON "(&A) ->", IDOK, 131, 42, 44, 14 - PUSHBUTTON "<- ɾ(&R)", IDC_REMOVE_BTN,131,62,44,14 - LTEXT "ǰť(&T):", -1,182,5,78,10 + PUSHBUTTON "הוס&פה ->", IDOK, 131, 42, 44, 14 + PUSHBUTTON "<- ה&סרה", IDC_REMOVE_BTN,131,62,44,14 + LTEXT "&לחצני סרגל הכלים:", -1,182,5,78,10 LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP END - -STRINGTABLE DISCARDABLE -{ - IDS_CLOSE "ر" -} - -STRINGTABLE DISCARDABLE -{ - IDM_TODAY "Today:" - IDM_GOTODAY "Go to today" -} - -STRINGTABLE DISCARDABLE -{ - IDS_SEPARATOR "ָ" -} - -STRINGTABLE DISCARDABLE -{ - HKY_NONE "None" -} - -#pragma code_page(default) diff --git a/dll/win32/comctl32/comctl_Hu.rc b/dll/win32/comctl32/comctl_Hu.rc index 87183c4038a..176e0d8731c 100644 --- a/dll/win32/comctl32/comctl_Hu.rc +++ b/dll/win32/comctl32/comctl_Hu.rc @@ -66,24 +66,3 @@ BEGIN LTEXT "E&szkztr gombok:", -1,182,5,78,10 LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP END - -STRINGTABLE -{ - IDS_CLOSE "Bezrs" -} - -STRINGTABLE -{ - IDM_TODAY "Ma:" - IDM_GOTODAY "Ugrs mra" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Elvlaszt" -} - -STRINGTABLE -{ - HKY_NONE "Nincs" -} diff --git a/dll/win32/comctl32/comctl_It.rc b/dll/win32/comctl32/comctl_It.rc index 8253dab38ce..d6c7fad3d53 100644 --- a/dll/win32/comctl32/comctl_It.rc +++ b/dll/win32/comctl32/comctl_It.rc @@ -19,11 +19,14 @@ #include "comctl32.h" +/* UTF-8 */ +#pragma code_page(65001) + LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL IDD_PROPSHEET DIALOG 0, 0, 220, 140 STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE -CAPTION "Propriet per %s" +CAPTION "Proprietà per %s" FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "OK", IDOK,4,122,50,14, WS_TABSTOP | WS_GROUP @@ -57,34 +60,13 @@ FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "&Chiudi", IDCANCEL,308,6,44,14 PUSHBUTTON "R&eimpostare", IDC_RESET_BTN,308,23,44,14 - PUSHBUTTON "&Aiuto", IDC_HELP_BTN,308,40,44,14 - PUSHBUTTON "Muovi &Su", IDC_MOVEUP_BTN,308,74,44,14 - PUSHBUTTON "Muovi &Gi", IDC_MOVEDN_BTN,308,91,44,14 + PUSHBUTTON "A&iuto", IDC_HELP_BTN,308,40,44,14 + PUSHBUTTON "Muovi &su", IDC_MOVEUP_BTN,308,74,44,14 + PUSHBUTTON "Muovi &giù", IDC_MOVEDN_BTN,308,91,44,14 LTEXT "&Tasti disponibili:", -1,4,5,84,10 LISTBOX IDC_AVAILBTN_LBOX,4,17,120,100, LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP PUSHBUTTON "&Aggiungi ->", IDOK, 131, 42, 44, 14 PUSHBUTTON "<- &Rimuovi", IDC_REMOVE_BTN,131,62,44,14 - LTEXT "&Tasti della barra degli strumenti:", -1,182,5,78,10 + LTEXT "Tasti della &barra degli strumenti:", -1,182,5,78,10 LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP END - -STRINGTABLE -{ - IDS_CLOSE "Chiudi" -} - -STRINGTABLE -{ - IDM_TODAY "Oggi:" - IDM_GOTODAY "Vai a oggi" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Separatore" -} - -STRINGTABLE -{ - HKY_NONE "Nessuno" -} diff --git a/dll/win32/comctl32/comctl_Ja.rc b/dll/win32/comctl32/comctl_Ja.rc index 156a00f60d0..c426497b5a2 100644 --- a/dll/win32/comctl32/comctl_Ja.rc +++ b/dll/win32/comctl32/comctl_Ja.rc @@ -69,24 +69,3 @@ BEGIN LTEXT "ツールバーのボタン(&T):", -1,182,5,78,10 LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP END - -STRINGTABLE -{ - IDS_CLOSE "閉じる" -} - -STRINGTABLE -{ - IDM_TODAY "今日:" - IDM_GOTODAY "今日へ移動" -} - -STRINGTABLE -{ - IDS_SEPARATOR "区切り" -} - -STRINGTABLE -{ - HKY_NONE "なし" -} diff --git a/dll/win32/comctl32/comctl_Ko.rc b/dll/win32/comctl32/comctl_Ko.rc index 31c625263bc..900663a325f 100644 --- a/dll/win32/comctl32/comctl_Ko.rc +++ b/dll/win32/comctl32/comctl_Ko.rc @@ -19,72 +19,53 @@ #include "comctl32.h" +#pragma code_page(65001) + LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT IDD_PROPSHEET DIALOG 0, 0, 220, 140 STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE -CAPTION "%s Ӽ" +CAPTION "%s 속성" FONT 9, "MS Shell Dlg" BEGIN - DEFPUSHBUTTON "Ȯ", IDOK,4,122,50,14, WS_TABSTOP | WS_GROUP - PUSHBUTTON "", IDCANCEL,58,122,50,14 - PUSHBUTTON "(&A)", IDC_APPLY_BUTTON,112,122,50,14,WS_DISABLED - PUSHBUTTON "", IDHELP,166,122,50,14,WS_TABSTOP|WS_GROUP - CONTROL "", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS|WS_GROUP|WS_TABSTOP|TCS_MULTILINE,4,4,212,114 + DEFPUSHBUTTON "확인", IDOK,4,122,50,14, WS_TABSTOP | WS_GROUP + PUSHBUTTON "취소", IDCANCEL,58,122,50,14 + PUSHBUTTON "적용(&A)", IDC_APPLY_BUTTON,112,122,50,14,WS_DISABLED + PUSHBUTTON "도움말", IDHELP,166,122,50,14,WS_TABSTOP|WS_GROUP + CONTROL "탭", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS|WS_GROUP|WS_TABSTOP|TCS_MULTILINE,4,4,212,114 END IDD_WIZARD DIALOG 0, 0, 290, 159 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE -CAPTION "" +CAPTION "마법사" FONT 9, "MS Shell Dlg" BEGIN - PUSHBUTTON "< (&B)", IDC_BACK_BUTTON,71,138,50,14 - DEFPUSHBUTTON "(&N) >", IDC_NEXT_BUTTON,121,138,50,14 - DEFPUSHBUTTON "", IDC_FINISH_BUTTON,121,138,50,14 - PUSHBUTTON "", IDCANCEL,178,138,50,14 - PUSHBUTTON "", IDHELP,235,138,50,14,WS_GROUP + PUSHBUTTON "< 이전(&B)", IDC_BACK_BUTTON,71,138,50,14 + DEFPUSHBUTTON "다음(&N) >", IDC_NEXT_BUTTON,121,138,50,14 + DEFPUSHBUTTON "종료", IDC_FINISH_BUTTON,121,138,50,14 + PUSHBUTTON "취소", IDCANCEL,178,138,50,14 + PUSHBUTTON "도움말", IDHELP,235,138,50,14,WS_GROUP LTEXT "", IDC_SUNKEN_LINE,7,129,278,1,SS_SUNKEN - CONTROL "", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS | WS_DISABLED,7,7,258,5 + CONTROL "탭", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS | WS_DISABLED,7,7,258,5 LTEXT "", IDC_SUNKEN_LINEHEADER,0,35,290,1,SS_LEFT | SS_SUNKEN | WS_CHILD | WS_VISIBLE END IDD_TBCUSTOMIZE DIALOG 10, 20, 357, 125 STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION " " +CAPTION "도구바 사용자 정의" FONT 9, "MS Shell Dlg" BEGIN - DEFPUSHBUTTON "ݱ(&C)", IDCANCEL,308,6,44,14 - PUSHBUTTON "缳(&E)", IDC_RESET_BTN,308,23,44,14 - PUSHBUTTON "(&H)", IDC_HELP_BTN,308,40,44,14 - PUSHBUTTON " ̵(&U)", IDC_MOVEUP_BTN,308,74,44,14 - PUSHBUTTON "Ʒ ̵(&D)", IDC_MOVEDN_BTN,308,91,49,14 - LTEXT " ư(&V)", -1,4,5,84,10 + DEFPUSHBUTTON "닫기(&C)", IDCANCEL,308,6,44,14 + PUSHBUTTON "재설정(&E)", IDC_RESET_BTN,308,23,44,14 + PUSHBUTTON "도움말(&H)", IDC_HELP_BTN,308,40,44,14 + PUSHBUTTON "위로 이동(&U)", IDC_MOVEUP_BTN,308,74,44,14 + PUSHBUTTON "아래로 이동(&D)", IDC_MOVEDN_BTN,308,91,49,14 + LTEXT "가능한 버튼(&V)", -1,4,5,84,10 LISTBOX IDC_AVAILBTN_LBOX,4,17,120,100, LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP - PUSHBUTTON "ϱ(&A) ->", IDOK, 131, 42, 44, 14 - PUSHBUTTON "<-(&R)", IDC_REMOVE_BTN,131,62,44,14 - LTEXT " ư(&T):", -1,182,5,78,10 + PUSHBUTTON "더하기(&A) ->", IDOK, 131, 42, 44, 14 + PUSHBUTTON "<-지우기(&R)", IDC_REMOVE_BTN,131,62,44,14 + LTEXT "도구바 버튼(&T):", -1,182,5,78,10 LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP END - -STRINGTABLE -{ - IDS_CLOSE "ݱ" -} - -STRINGTABLE -{ - IDM_TODAY ":" - IDM_GOTODAY "÷ " -} - -STRINGTABLE -{ - IDS_SEPARATOR "и" -} - -STRINGTABLE -{ - HKY_NONE "" -} diff --git a/dll/win32/comctl32/comctl_Lt.rc b/dll/win32/comctl32/comctl_Lt.rc index b723d223155..ea1dc21e68a 100644 --- a/dll/win32/comctl32/comctl_Lt.rc +++ b/dll/win32/comctl32/comctl_Lt.rc @@ -69,24 +69,3 @@ BEGIN LTEXT "&Mygtukų juostos turinys:", -1,182,5,84,10 LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP END - -STRINGTABLE -{ - IDS_CLOSE "Užverti" -} - -STRINGTABLE -{ - IDM_TODAY "Šiandien:" - IDM_GOTODAY "Eiti į šiandien" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Skirtukas" -} - -STRINGTABLE -{ - HKY_NONE "Joks" -} diff --git a/dll/win32/comctl32/comctl_Nl.rc b/dll/win32/comctl32/comctl_Nl.rc index 5e94680a2de..46d155f4fd4 100644 --- a/dll/win32/comctl32/comctl_Nl.rc +++ b/dll/win32/comctl32/comctl_Nl.rc @@ -68,24 +68,3 @@ BEGIN LTEXT "&Knoppen:", -1,182,5,78,10 LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP END - -STRINGTABLE -{ - IDS_CLOSE "Sluiten" -} - -STRINGTABLE -{ - IDM_TODAY "Vandaag:" - IDM_GOTODAY "Ga naar vandaag" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Scheidingsteken" -} - -STRINGTABLE -{ - HKY_NONE "Geen" -} diff --git a/dll/win32/comctl32/comctl_No.rc b/dll/win32/comctl32/comctl_No.rc index ada1a47c4ca..770e57914d5 100644 --- a/dll/win32/comctl32/comctl_No.rc +++ b/dll/win32/comctl32/comctl_No.rc @@ -40,7 +40,7 @@ FONT 8, "MS Shell Dlg" BEGIN PUSHBUTTON "< Til&bake", IDC_BACK_BUTTON,71,138,50,14 DEFPUSHBUTTON "&Neste >", IDC_NEXT_BUTTON,121,138,50,14 - DEFPUSHBUTTON "Fullfr", IDC_FINISH_BUTTON,121,138,50,14 + DEFPUSHBUTTON "Fullfr", IDC_FINISH_BUTTON,121,138,50,14 PUSHBUTTON "Avbryt", IDCANCEL,178,138,50,14 PUSHBUTTON "Hjelp", IDHELP,235,138,50,14,WS_GROUP LTEXT "", IDC_SUNKEN_LINE,7,129,278,1,SS_SUNKEN @@ -51,7 +51,7 @@ END IDD_TBCUSTOMIZE DIALOG 10, 20, 357, 125 STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Tilpass verktylinje" +CAPTION "Tilpass verktylinje" FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "&Lukk", IDCANCEL,308,6,44,14 @@ -63,27 +63,6 @@ BEGIN LISTBOX IDC_AVAILBTN_LBOX,4,17,120,100, LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP PUSHBUTTON "Le&gg til ->", IDOK, 131, 42, 44, 14 PUSHBUTTON "<- Fje&rn", IDC_REMOVE_BTN,131,62,44,14 - LTEXT "Verk&tylinje-knapper:", -1,182,5,78,10 + LTEXT "Verk&tylinje-knapper:", -1,182,5,78,10 LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP END - -STRINGTABLE -{ - IDS_CLOSE "Lukk" -} - -STRINGTABLE -{ - IDM_TODAY "Idag:" - IDM_GOTODAY "G til idag" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Adskiller" -} - -STRINGTABLE -{ - HKY_NONE "Ingen" -} diff --git a/dll/win32/comctl32/comctl_Pl.rc b/dll/win32/comctl32/comctl_Pl.rc index f3317e00e27..4da65f15ba5 100644 --- a/dll/win32/comctl32/comctl_Pl.rc +++ b/dll/win32/comctl32/comctl_Pl.rc @@ -23,7 +23,7 @@ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT IDD_PROPSHEET DIALOG 0, 0, 220, 140 STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE -CAPTION "Waciwoci %s" +CAPTION "Waciwoci %s" FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "OK", IDOK,4,122,50,14, WS_TABSTOP | WS_GROUP @@ -41,7 +41,7 @@ FONT 8, "MS Shell Dlg" BEGIN PUSHBUTTON "< &Wstecz", IDC_BACK_BUTTON,71,138,50,14 DEFPUSHBUTTON "&Dalej >", IDC_NEXT_BUTTON,121,138,50,14 - DEFPUSHBUTTON "Zakocz", IDC_FINISH_BUTTON,121,138,50,14 + DEFPUSHBUTTON "Zakocz", IDC_FINISH_BUTTON,121,138,50,14 PUSHBUTTON "Anuluj", IDCANCEL,178,138,50,14 PUSHBUTTON "Pomoc", IDHELP,235,138,50,14,WS_GROUP LTEXT "", IDC_SUNKEN_LINE,7,129,278,1,SS_SUNKEN @@ -67,24 +67,3 @@ BEGIN LTEXT "&Przyciski paska narzdzi:", -1,182,5,78,10 LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP END - -STRINGTABLE -{ - IDS_CLOSE "Zamknij" -} - -STRINGTABLE -{ - IDM_TODAY "Dzi:" - IDM_GOTODAY "Id do dzi" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Odstp" -} - -STRINGTABLE -{ - HKY_NONE "Brak" -} diff --git a/dll/win32/comctl32/comctl_Pt.rc b/dll/win32/comctl32/comctl_Pt.rc index ca60a59f130..70dd367cd03 100644 --- a/dll/win32/comctl32/comctl_Pt.rc +++ b/dll/win32/comctl32/comctl_Pt.rc @@ -68,24 +68,3 @@ BEGIN LTEXT "&Botões da barra de ferramentas:", -1,182,5,78,10 LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP END - -STRINGTABLE -{ - IDS_CLOSE "Fechar" -} - -STRINGTABLE -{ - IDM_TODAY "Hoje:" - IDM_GOTODAY "Ir para hoje" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Separador" -} - -STRINGTABLE -{ - HKY_NONE "Nenhum" -} diff --git a/dll/win32/comctl32/comctl_Ro.rc b/dll/win32/comctl32/comctl_Ro.rc index fd6b1161ec8..ab2873f4a60 100644 --- a/dll/win32/comctl32/comctl_Ro.rc +++ b/dll/win32/comctl32/comctl_Ro.rc @@ -69,24 +69,3 @@ BEGIN LTEXT "Butoane &toolbar:", -1,182,5,78,10 LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP END - -STRINGTABLE -{ - IDS_CLOSE "Închide" -} - -STRINGTABLE -{ - IDM_TODAY "Azi:" - IDM_GOTODAY "Mergi la Azi" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Separator" -} - -STRINGTABLE -{ - HKY_NONE "Nimic" -} diff --git a/dll/win32/comctl32/comctl_Ru.rc b/dll/win32/comctl32/comctl_Ru.rc index ce330609db4..c75fb0d5af8 100644 --- a/dll/win32/comctl32/comctl_Ru.rc +++ b/dll/win32/comctl32/comctl_Ru.rc @@ -71,24 +71,3 @@ BEGIN LTEXT "Кнопки &панели инструментов:", -1,182,5,78,10 LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP END - -STRINGTABLE -{ - IDS_CLOSE "Закрыть" -} - -STRINGTABLE -{ - IDM_TODAY "Сегодня:" - IDM_GOTODAY "Текущая дата" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Разделитель" -} - -STRINGTABLE -{ - HKY_NONE "Нет" -} diff --git a/dll/win32/comctl32/comctl_Si.rc b/dll/win32/comctl32/comctl_Si.rc index 9d1b1f22a62..dca3143390f 100644 --- a/dll/win32/comctl32/comctl_Si.rc +++ b/dll/win32/comctl32/comctl_Si.rc @@ -68,24 +68,3 @@ BEGIN LTEXT "G&umbi orodne vrstice:", -1,182,5,78,10 LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP END - -STRINGTABLE -{ - IDS_CLOSE "Zapri" -} - -STRINGTABLE -{ - IDM_TODAY "Danes:" - IDM_GOTODAY "Pojdi na danes" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Ločilo" -} - -STRINGTABLE -{ - HKY_NONE "Brez" -} diff --git a/dll/win32/comctl32/comctl_Sk.rc b/dll/win32/comctl32/comctl_Sk.rc index 4acd84c5ac5..94cc7e937ec 100644 --- a/dll/win32/comctl32/comctl_Sk.rc +++ b/dll/win32/comctl32/comctl_Sk.rc @@ -69,24 +69,3 @@ BEGIN LTEXT "&Tlaidl panela:", -1,182,5,78,10 LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP END - -STRINGTABLE -{ - IDS_CLOSE "Zavrie" -} - -STRINGTABLE -{ - IDM_TODAY "Dnes:" - IDM_GOTODAY "Cho na dneok" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Oddeova" -} - -STRINGTABLE -{ - HKY_NONE "iadne" -} diff --git a/dll/win32/comctl32/comctl_Sr.rc b/dll/win32/comctl32/comctl_Sr.rc index 8681ecbe629..390556fa8a1 100644 --- a/dll/win32/comctl32/comctl_Sr.rc +++ b/dll/win32/comctl32/comctl_Sr.rc @@ -1,6 +1,7 @@ /* * Copyright 2010 Nenad Vujic * Paul Vriens + * Copyright 2010 Đorđe Vasiljević * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,138 +26,96 @@ LANGUAGE LANG_SERBIAN, SUBLANG_SERBIAN_LATIN IDD_PROPSHEET DIALOG 0, 0, 220, 140 STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE -CAPTION "Detalji za %s" +CAPTION "Svojstva za %s" FONT 8, "MS Shell Dlg" BEGIN - DEFPUSHBUTTON "OK", IDOK,4,122,50,14, WS_TABSTOP | WS_GROUP + DEFPUSHBUTTON "U redu", IDOK,4,122,50,14, WS_TABSTOP | WS_GROUP PUSHBUTTON "Otkaži", IDCANCEL,58,122,50,14 PUSHBUTTON "&Primeni", IDC_APPLY_BUTTON,112,122,50,14,WS_DISABLED PUSHBUTTON "Pomoć", IDHELP,166,122,50,14,WS_TABSTOP|WS_GROUP - CONTROL "Tab", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS|WS_GROUP|WS_TABSTOP|TCS_MULTILINE,4,4,212,114 + CONTROL "Jezičak", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS|WS_GROUP|WS_TABSTOP|TCS_MULTILINE,4,4,212,114 END IDD_WIZARD DIALOG 0, 0, 290, 159 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE -CAPTION "Čarobnjak" +CAPTION "Vodič" FONT 8, "MS Shell Dlg" BEGIN PUSHBUTTON "< &Nazad", IDC_BACK_BUTTON,71,138,50,14 - DEFPUSHBUTTON "&Sledeće >", IDC_NEXT_BUTTON,121,138,50,14 - DEFPUSHBUTTON "Završi", IDC_FINISH_BUTTON,121,138,50,14 + DEFPUSHBUTTON "&Napred >", IDC_NEXT_BUTTON,121,138,50,14 + DEFPUSHBUTTON "Kraj", IDC_FINISH_BUTTON,121,138,50,14 PUSHBUTTON "Otkaži", IDCANCEL,178,138,50,14 PUSHBUTTON "Pomoć", IDHELP,235,138,50,14,WS_GROUP LTEXT "", IDC_SUNKEN_LINE,7,129,278,1,SS_SUNKEN - CONTROL "Tab", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS | WS_DISABLED,7,7,258,5 + CONTROL "Jezičak", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS | WS_DISABLED,7,7,258,5 LTEXT "", IDC_SUNKEN_LINEHEADER,0,35,290,1,SS_LEFT | SS_SUNKEN | WS_CHILD | WS_VISIBLE END IDD_TBCUSTOMIZE DIALOG 10, 20, 357, 125 STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Podesi Toolbar" +CAPTION "Prilagodi alatnicu" FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "&Zatvori", IDCANCEL,308,6,44,14 - PUSHBUTTON "R&esetuj", IDC_RESET_BTN,308,23,44,14 + PUSHBUTTON "&Poništi", IDC_RESET_BTN,308,23,44,14 PUSHBUTTON "&Pomoć", IDC_HELP_BTN,308,40,44,14 - PUSHBUTTON "Pomeri &Gore", IDC_MOVEUP_BTN,308,74,44,14 - PUSHBUTTON "Pomeri &Dole", IDC_MOVEDN_BTN,308,91,44,14 - LTEXT "D&ostupni tasteri:", -1,4,5,84,10 + PUSHBUTTON "Pomeri na&gore", IDC_MOVEUP_BTN,308,74,44,14 + PUSHBUTTON "Pomeri na&dole", IDC_MOVEDN_BTN,308,91,44,14 + LTEXT "&Dostupni dugmići:", -1,4,5,84,10 LISTBOX IDC_AVAILBTN_LBOX,4,17,120,100, LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP PUSHBUTTON "&Dodaj ->", IDOK, 131, 42, 44, 14 PUSHBUTTON "<- &Ukloni", IDC_REMOVE_BTN,131,62,44,14 - LTEXT "&Toolbar tasteri:", -1,182,5,78,10 + LTEXT "&Dugmići na alatnici:", -1,182,5,78,10 LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP END -STRINGTABLE -{ - IDS_CLOSE "Zatvori" -} - -STRINGTABLE -{ - IDM_TODAY "Danas:" - IDM_GOTODAY "Idi na danas" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Odvajanje" -} - -STRINGTABLE -{ - HKY_NONE "Ništa" -} - LANGUAGE LANG_SERBIAN, SUBLANG_SERBIAN_CYRILLIC IDD_PROPSHEET DIALOG 0, 0, 220, 140 STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE -CAPTION "Детаљи за %s" +CAPTION "Својства за %s" FONT 8, "MS Shell Dlg" BEGIN - DEFPUSHBUTTON "ОK", IDOK,4,122,50,14, WS_TABSTOP | WS_GROUP + DEFPUSHBUTTON "У реду", IDOK,4,122,50,14, WS_TABSTOP | WS_GROUP PUSHBUTTON "Откажи", IDCANCEL,58,122,50,14 PUSHBUTTON "&Примени", IDC_APPLY_BUTTON,112,122,50,14,WS_DISABLED PUSHBUTTON "Помоћ", IDHELP,166,122,50,14,WS_TABSTOP|WS_GROUP - CONTROL "Таб", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS|WS_GROUP|WS_TABSTOP|TCS_MULTILINE,4,4,212,114 + CONTROL "Језичак", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS|WS_GROUP|WS_TABSTOP|TCS_MULTILINE,4,4,212,114 END IDD_WIZARD DIALOG 0, 0, 290, 159 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE -CAPTION "Чаробњак" +CAPTION "Водич" FONT 8, "MS Shell Dlg" BEGIN PUSHBUTTON "< &Назад", IDC_BACK_BUTTON,71,138,50,14 - DEFPUSHBUTTON "&Следеће >", IDC_NEXT_BUTTON,121,138,50,14 - DEFPUSHBUTTON "Заврши", IDC_FINISH_BUTTON,121,138,50,14 + DEFPUSHBUTTON "&Напред >", IDC_NEXT_BUTTON,121,138,50,14 + DEFPUSHBUTTON "Крај", IDC_FINISH_BUTTON,121,138,50,14 PUSHBUTTON "Откажи", IDCANCEL,178,138,50,14 PUSHBUTTON "Помоћ", IDHELP,235,138,50,14,WS_GROUP LTEXT "", IDC_SUNKEN_LINE,7,129,278,1,SS_SUNKEN - CONTROL "Таб", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS | WS_DISABLED,7,7,258,5 + CONTROL "Језичак", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS | WS_DISABLED,7,7,258,5 LTEXT "", IDC_SUNKEN_LINEHEADER,0,35,290,1,SS_LEFT | SS_SUNKEN | WS_CHILD | WS_VISIBLE END IDD_TBCUSTOMIZE DIALOG 10, 20, 357, 125 STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Подеси Тулбар" +CAPTION "Прилагоди алатницу" FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "&Затвори", IDCANCEL,308,6,44,14 - PUSHBUTTON "Р&есетуј", IDC_RESET_BTN,308,23,44,14 + PUSHBUTTON "&Поништи", IDC_RESET_BTN,308,23,44,14 PUSHBUTTON "&Помоћ", IDC_HELP_BTN,308,40,44,14 - PUSHBUTTON "Помери &Горе", IDC_MOVEUP_BTN,308,74,44,14 - PUSHBUTTON "Помери &Доле", IDC_MOVEDN_BTN,308,91,44,14 - LTEXT "Д&оступни тастери:", -1,4,5,84,10 + PUSHBUTTON "Помери на&горе", IDC_MOVEUP_BTN,308,74,44,14 + PUSHBUTTON "Помери на&доле", IDC_MOVEDN_BTN,308,91,44,14 + LTEXT "&Доступни дугмићи:", -1,4,5,84,10 LISTBOX IDC_AVAILBTN_LBOX,4,17,120,100, LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP PUSHBUTTON "&Додај ->", IDOK, 131, 42, 44, 14 PUSHBUTTON "<- &Уклони", IDC_REMOVE_BTN,131,62,44,14 - LTEXT "&Тулбар тастери:", -1,182,5,78,10 + LTEXT "&Дугмићи на алатници:", -1,182,5,78,10 LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP END - -STRINGTABLE -{ - IDS_CLOSE "Затвори" -} - -STRINGTABLE -{ - IDM_TODAY "Данас:" - IDM_GOTODAY "Иди на данас" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Одвајање" -} - -STRINGTABLE -{ - HKY_NONE "Ништа" -} diff --git a/dll/win32/comctl32/comctl_Sv.rc b/dll/win32/comctl32/comctl_Sv.rc index e66b379217d..6dcadaf6867 100644 --- a/dll/win32/comctl32/comctl_Sv.rc +++ b/dll/win32/comctl32/comctl_Sv.rc @@ -66,24 +66,3 @@ BEGIN LTEXT "Knappar i v&erktygsfltet:", -1,182,5,85,10 LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP END - -STRINGTABLE -{ - IDS_CLOSE "Stng" -} - -STRINGTABLE -{ - IDM_TODAY "Idag:" - IDM_GOTODAY "G till idag" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Separator" -} - -STRINGTABLE -{ - HKY_NONE "Ingen" -} diff --git a/dll/win32/comctl32/comctl_Th.rc b/dll/win32/comctl32/comctl_Th.rc index 915ecf4df8d..54b63356a05 100644 --- a/dll/win32/comctl32/comctl_Th.rc +++ b/dll/win32/comctl32/comctl_Th.rc @@ -66,24 +66,3 @@ BEGIN LTEXT "áзᶺͧ:", -1,182,5,78,10 LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP END - -STRINGTABLE -{ - IDS_CLOSE "մ" -} - -STRINGTABLE -{ - IDM_TODAY "ѹ:" - IDM_GOTODAY "件֧ѹ" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Separator" -} - -STRINGTABLE -{ - HKY_NONE "" -} diff --git a/dll/win32/comctl32/comctl_Tr.rc b/dll/win32/comctl32/comctl_Tr.rc index cda21936f5c..a57ed789721 100644 --- a/dll/win32/comctl32/comctl_Tr.rc +++ b/dll/win32/comctl32/comctl_Tr.rc @@ -66,24 +66,3 @@ BEGIN LTEXT "&Ara ubuu butonlar:", -1,182,5,78,10 LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP END - -STRINGTABLE -{ - IDS_CLOSE "Kapat" -} - -STRINGTABLE -{ - IDM_TODAY "Bugn:" - IDM_GOTODAY "Bugne git" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Ayra" -} - -STRINGTABLE -{ - HKY_NONE "Hibiri" -} diff --git a/dll/win32/comctl32/comctl_Uk.rc b/dll/win32/comctl32/comctl_Uk.rc index 3aa29f024f8..dde83f41c8d 100644 --- a/dll/win32/comctl32/comctl_Uk.rc +++ b/dll/win32/comctl32/comctl_Uk.rc @@ -70,24 +70,3 @@ BEGIN LTEXT "& :", -1,182,5,78,10 LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP END - -STRINGTABLE -{ - IDS_CLOSE "" -} - -STRINGTABLE -{ - IDM_TODAY ":" - IDM_GOTODAY " " -} - -STRINGTABLE -{ - IDS_SEPARATOR "" -} - -STRINGTABLE -{ - HKY_NONE "" -} diff --git a/dll/win32/comctl32/comctl_Zh.rc b/dll/win32/comctl32/comctl_Zh.rc index 63f22e7aa16..8a80817b521 100644 --- a/dll/win32/comctl32/comctl_Zh.rc +++ b/dll/win32/comctl32/comctl_Zh.rc @@ -73,27 +73,6 @@ BEGIN LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP END -STRINGTABLE -{ - IDS_CLOSE "关闭" -} - -STRINGTABLE -{ - IDM_TODAY "今天:" - IDM_GOTODAY "转到今天" -} - -STRINGTABLE -{ - IDS_SEPARATOR "分隔符" -} - -STRINGTABLE -{ - HKY_NONE "无" -} - LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL IDD_PROPSHEET DIALOG 0, 0, 220, 140 @@ -142,24 +121,3 @@ BEGIN LTEXT "當前工具欄按鈕(&T):", -1,182,5,78,10 LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP END - -STRINGTABLE -{ - IDS_CLOSE "關閉" -} - -STRINGTABLE -{ - IDM_TODAY "今天:" - IDM_GOTODAY "轉到今天" -} - -STRINGTABLE -{ - IDS_SEPARATOR "分隔符" -} - -STRINGTABLE -{ - HKY_NONE "無" -} diff --git a/dll/win32/comctl32/commctrl.c b/dll/win32/comctl32/commctrl.c index eb0f6b5293e..a82b233c6d6 100644 --- a/dll/win32/comctl32/commctrl.c +++ b/dll/win32/comctl32/commctrl.c @@ -1689,3 +1689,17 @@ int WINAPI DrawShadowText(HDC hdc, LPCWSTR pszText, UINT cch, RECT *rect, DWORD crText, crShadow, ixOffset, iyOffset); return DrawTextW(hdc, pszText, cch, rect, DT_LEFT); } + +/*********************************************************************** + * TaskDialogIndirect [COMCTL32.@] + */ +HRESULT WINAPI TaskDialogIndirect(const TASKDIALOGCONFIG *pTaskConfig, int *pnButton, + int *pnRadioButton, BOOL *pfVerificationFlagChecked) +{ + FIXME("%p, %p, %p, %p\n", pTaskConfig, pnButton, pnRadioButton, pfVerificationFlagChecked); + + if (pnButton) *pnButton = IDYES; + if (pnRadioButton) *pnRadioButton = pTaskConfig->nDefaultButton; + if (pfVerificationFlagChecked) *pfVerificationFlagChecked = TRUE; + return S_OK; +} diff --git a/dll/win32/comctl32/datetime.c b/dll/win32/comctl32/datetime.c index 24189507d64..1ac6ba7ad36 100644 --- a/dll/win32/comctl32/datetime.c +++ b/dll/win32/comctl32/datetime.c @@ -787,6 +787,7 @@ DATETIME_LButtonDown (DATETIME_INFO *infoPtr, INT x, INT y) if (infoPtr->select == DTHT_MCPOPUP) { RECT rcMonthCal; + POINT pos; SendMessageW(infoPtr->hMonthCal, MCM_GETMINREQRECT, 0, (LPARAM)&rcMonthCal); /* FIXME: button actually is only depressed during dropdown of the */ @@ -795,17 +796,16 @@ DATETIME_LButtonDown (DATETIME_INFO *infoPtr, INT x, INT y) /* recalculate the position of the monthcal popup */ if(infoPtr->dwStyle & DTS_RIGHTALIGN) - infoPtr->monthcal_pos.x = infoPtr->calbutton.left - - (rcMonthCal.right - rcMonthCal.left); + pos.x = infoPtr->calbutton.left - (rcMonthCal.right - rcMonthCal.left); else /* FIXME: this should be after the area reserved for the checkbox */ - infoPtr->monthcal_pos.x = infoPtr->rcDraw.left; + pos.x = infoPtr->rcDraw.left; - infoPtr->monthcal_pos.y = infoPtr->rcClient.bottom; - ClientToScreen (infoPtr->hwndSelf, &(infoPtr->monthcal_pos)); - SetWindowPos(infoPtr->hMonthCal, 0, infoPtr->monthcal_pos.x, - infoPtr->monthcal_pos.y, rcMonthCal.right - rcMonthCal.left, - rcMonthCal.bottom - rcMonthCal.top, 0); + pos.y = infoPtr->rcClient.bottom; + OffsetRect( &rcMonthCal, pos.x, pos.y ); + MapWindowPoints( infoPtr->hwndSelf, 0, (POINT *)&rcMonthCal, 2 ); + SetWindowPos(infoPtr->hMonthCal, 0, rcMonthCal.left, rcMonthCal.top, + rcMonthCal.right - rcMonthCal.left, rcMonthCal.bottom - rcMonthCal.top, 0); if(IsWindowVisible(infoPtr->hMonthCal)) { ShowWindow(infoPtr->hMonthCal, SW_HIDE); @@ -1368,7 +1368,7 @@ DATETIME_Destroy (DATETIME_INFO *infoPtr) static INT -DATETIME_GetText (DATETIME_INFO *infoPtr, INT count, LPWSTR dst) +DATETIME_GetText (const DATETIME_INFO *infoPtr, INT count, LPWSTR dst) { WCHAR buf[80]; int i; diff --git a/dll/win32/comctl32/header.c b/dll/win32/comctl32/header.c index d916c7297d5..603d0a33e08 100644 --- a/dll/win32/comctl32/header.c +++ b/dll/win32/comctl32/header.c @@ -1215,7 +1215,7 @@ HEADER_GetOrderArray(const HEADER_INFO *infoPtr, INT size, LPINT order) /* Returns index of first duplicate 'value' from [0,to) range, or -1 if there isn't any */ -static INT has_duplicate(INT *array, INT to, INT value) +static INT has_duplicate(const INT *array, INT to, INT value) { INT i; for(i = 0; i < to; i++) @@ -1224,7 +1224,7 @@ static INT has_duplicate(INT *array, INT to, INT value) } /* returns next available value from [0,max] not to duplicate in [0,to) */ -static INT get_nextvalue(INT *array, INT to, INT max) +static INT get_nextvalue(const INT *array, INT to, INT max) { INT i; for(i = 0; i < max; i++) diff --git a/dll/win32/comctl32/idb_hist_large.bmp b/dll/win32/comctl32/idb_hist_large.bmp index b7818fbafb2..c6aee0bb37a 100644 Binary files a/dll/win32/comctl32/idb_hist_large.bmp and b/dll/win32/comctl32/idb_hist_large.bmp differ diff --git a/dll/win32/comctl32/idb_hist_small.bmp b/dll/win32/comctl32/idb_hist_small.bmp index c735f54377f..2ae50010edb 100644 Binary files a/dll/win32/comctl32/idb_hist_small.bmp and b/dll/win32/comctl32/idb_hist_small.bmp differ diff --git a/dll/win32/comctl32/idb_std_large.bmp b/dll/win32/comctl32/idb_std_large.bmp index 7e19185c929..c10dc72da1b 100644 Binary files a/dll/win32/comctl32/idb_std_large.bmp and b/dll/win32/comctl32/idb_std_large.bmp differ diff --git a/dll/win32/comctl32/idb_std_small.bmp b/dll/win32/comctl32/idb_std_small.bmp index 7db2f3ca805..aedd4a861cf 100644 Binary files a/dll/win32/comctl32/idb_std_small.bmp and b/dll/win32/comctl32/idb_std_small.bmp differ diff --git a/dll/win32/comctl32/idb_view_large.bmp b/dll/win32/comctl32/idb_view_large.bmp index 22e4d1d8b8b..ce4ea4f4c1b 100644 Binary files a/dll/win32/comctl32/idb_view_large.bmp and b/dll/win32/comctl32/idb_view_large.bmp differ diff --git a/dll/win32/comctl32/idb_view_small.bmp b/dll/win32/comctl32/idb_view_small.bmp index 6ba3d831637..abee9b8063d 100644 Binary files a/dll/win32/comctl32/idb_view_small.bmp and b/dll/win32/comctl32/idb_view_small.bmp differ diff --git a/dll/win32/comctl32/imagelist.c b/dll/win32/comctl32/imagelist.c index 47279c9812a..66cd03d6eb4 100644 --- a/dll/win32/comctl32/imagelist.c +++ b/dll/win32/comctl32/imagelist.c @@ -694,6 +694,8 @@ ImageList_Create (INT cx, INT cy, UINT flags, TRACE("(%d %d 0x%x %d %d)\n", cx, cy, flags, cInitial, cGrow); + if (cx <= 0 || cy <= 0) return NULL; + /* Create the IImageList interface for the image list */ if (FAILED(ImageListImpl_CreateInstance(NULL, &IID_IImageList, (void **)&himl))) return NULL; @@ -1519,7 +1521,6 @@ ImageList_Duplicate (HIMAGELIST himlSrc) himlSrc->hdcMask, 0, 0, SRCCOPY); himlDst->cCurImage = himlSrc->cCurImage; - himlDst->cMaxImage = himlSrc->cMaxImage; if (himlSrc->has_alpha && himlDst->has_alpha) memcpy( himlDst->has_alpha, himlSrc->has_alpha, himlDst->cCurImage ); } @@ -1726,15 +1727,13 @@ ImageList_GetIcon (HIMAGELIST himl, INT i, UINT fStyle) BOOL WINAPI ImageList_GetIconSize (HIMAGELIST himl, INT *cx, INT *cy) { - if (!is_valid(himl)) + if (!is_valid(himl) || !cx || !cy) return FALSE; if ((himl->cx <= 0) || (himl->cy <= 0)) return FALSE; - if (cx) - *cx = himl->cx; - if (cy) - *cy = himl->cy; + *cx = himl->cx; + *cy = himl->cy; return TRUE; } @@ -1907,8 +1906,11 @@ ImageList_LoadImageW (HINSTANCE hi, LPCWSTR lpbmp, INT cx, INT cGrow, } if (uType == IMAGE_BITMAP) { - BITMAP bmp; - GetObjectW (handle, sizeof(BITMAP), &bmp); + DIBSECTION dib; + UINT color; + + if (GetObjectW (handle, sizeof(dib), &dib) == sizeof(BITMAP)) color = ILC_COLOR; + else color = dib.dsBm.bmBitsPixel; /* To match windows behavior, if cx is set to zero and the flag DI_DEFAULTSIZE is specified, cx becomes the @@ -1919,13 +1921,12 @@ ImageList_LoadImageW (HINSTANCE hi, LPCWSTR lpbmp, INT cx, INT cGrow, if (uFlags & DI_DEFAULTSIZE) cx = GetSystemMetrics (SM_CXICON); else - cx = bmp.bmHeight; + cx = dib.dsBm.bmHeight; } - nImageCount = bmp.bmWidth / cx; + nImageCount = dib.dsBm.bmWidth / cx; - himl = ImageList_Create (cx, bmp.bmHeight, ILC_MASK | ILC_COLOR, - nImageCount, cGrow); + himl = ImageList_Create (cx, dib.dsBm.bmHeight, ILC_MASK | color, nImageCount, cGrow); if (!himl) { DeleteObject (handle); return NULL; @@ -3298,11 +3299,8 @@ static HRESULT WINAPI ImageListImpl_Draw(IImageList *iface, IMAGELISTDRAWPARAMS *pimldp) { HIMAGELIST This = (HIMAGELIST) iface; - HIMAGELIST old_himl = 0; - int ret = 0; - - if (!pimldp) - return E_FAIL; + HIMAGELIST old_himl; + int ret; /* As far as I can tell, Windows simply ignores the contents of pimldp->himl so we shall simulate the same */ @@ -3312,12 +3310,12 @@ static HRESULT WINAPI ImageListImpl_Draw(IImageList *iface, ret = ImageList_DrawIndirect(pimldp); pimldp->himl = old_himl; - return ret ? S_OK : E_FAIL; + return ret ? S_OK : E_INVALIDARG; } static HRESULT WINAPI ImageListImpl_Remove(IImageList *iface, int i) { - return (ImageList_Remove((HIMAGELIST) iface, i) == 0) ? E_FAIL : S_OK; + return (ImageList_Remove((HIMAGELIST) iface, i) == 0) ? E_INVALIDARG : S_OK; } static HRESULT WINAPI ImageListImpl_GetIcon(IImageList *iface, int i, UINT flags, @@ -3368,15 +3366,14 @@ static HRESULT WINAPI ImageListImpl_Copy(IImageList *iface, int iDst, } static HRESULT WINAPI ImageListImpl_Merge(IImageList *iface, int i1, - IUnknown *punk2, int i2, int dx, int dy, REFIID riid, PVOID *ppv) + IUnknown *punk2, int i2, int dx, int dy, REFIID riid, void **ppv) { HIMAGELIST This = (HIMAGELIST) iface; IImageList *iml2 = NULL; HIMAGELIST hNew; HRESULT ret = E_FAIL; - if (!punk2 || !ppv) - return E_FAIL; + TRACE("(%p)->(%d %p %d %d %d %s %p)\n", iface, i1, punk2, i2, dx, dy, debugstr_guid(riid), ppv); /* TODO: Add test for IID_ImageList2 too */ if (FAILED(IImageList_QueryInterface(punk2, &IID_IImageList, @@ -3387,27 +3384,35 @@ static HRESULT WINAPI ImageListImpl_Merge(IImageList *iface, int i1, /* Get the interface for the new image list */ if (hNew) + { + IImageList *imerge = (IImageList*)hNew; + ret = HIMAGELIST_QueryInterface(hNew, riid, ppv); + IImageList_Release(imerge); + } IImageList_Release(iml2); return ret; } -static HRESULT WINAPI ImageListImpl_Clone(IImageList *iface, REFIID riid, - PVOID *ppv) +static HRESULT WINAPI ImageListImpl_Clone(IImageList *iface, REFIID riid, void **ppv) { HIMAGELIST This = (HIMAGELIST) iface; - HIMAGELIST hNew; + HIMAGELIST clone; HRESULT ret = E_FAIL; - if (!ppv) - return E_FAIL; + TRACE("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv); - hNew = ImageList_Duplicate(This); + clone = ImageList_Duplicate(This); /* Get the interface for the new image list */ - if (hNew) - ret = HIMAGELIST_QueryInterface(hNew, riid, ppv); + if (clone) + { + IImageList *iclone = (IImageList*)clone; + + ret = HIMAGELIST_QueryInterface(clone, riid, ppv); + IImageList_Release(iclone); + } return ret; } @@ -3432,7 +3437,7 @@ static HRESULT WINAPI ImageListImpl_GetIconSize(IImageList *iface, int *cx, { HIMAGELIST This = (HIMAGELIST) iface; - return ImageList_GetIconSize(This, cx, cy) ? S_OK : E_FAIL; + return ImageList_GetIconSize(This, cx, cy) ? S_OK : E_INVALIDARG; } static HRESULT WINAPI ImageListImpl_SetIconSize(IImageList *iface, int cx, @@ -3443,9 +3448,6 @@ static HRESULT WINAPI ImageListImpl_SetIconSize(IImageList *iface, int cx, static HRESULT WINAPI ImageListImpl_GetImageCount(IImageList *iface, int *pi) { - if (!pi) - return E_FAIL; - *pi = ImageList_GetImageCount((HIMAGELIST) iface); return S_OK; } @@ -3459,18 +3461,12 @@ static HRESULT WINAPI ImageListImpl_SetImageCount(IImageList *iface, static HRESULT WINAPI ImageListImpl_SetBkColor(IImageList *iface, COLORREF clrBk, COLORREF *pclr) { - if (!pclr) - return E_FAIL; - *pclr = ImageList_SetBkColor((HIMAGELIST) iface, clrBk); - return *pclr == CLR_NONE ? E_FAIL : S_OK; + return S_OK; } static HRESULT WINAPI ImageListImpl_GetBkColor(IImageList *iface, COLORREF *pclr) { - if (!pclr) - return E_FAIL; - *pclr = ImageList_GetBkColor((HIMAGELIST) iface); return S_OK; } @@ -3543,7 +3539,12 @@ static HRESULT WINAPI ImageListImpl_GetDragImage(IImageList *iface, POINT *ppt, /* Get the interface for the new image list */ if (hNew) + { + IImageList *idrag = (IImageList*)hNew; + ret = HIMAGELIST_QueryInterface(hNew, riid, ppv); + IImageList_Release(idrag); + } return ret; } @@ -3650,11 +3651,9 @@ static HRESULT ImageListImpl_CreateInstance(const IUnknown *pUnkOuter, REFIID ii if (pUnkOuter) return CLASS_E_NOAGGREGATION; - This = HeapAlloc(GetProcessHeap(), 0, sizeof(struct _IMAGELIST)); + This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct _IMAGELIST)); if (!This) return E_OUTOFMEMORY; - ZeroMemory(This, sizeof(struct _IMAGELIST)); - This->lpVtbl = &ImageListImpl_Vtbl; This->ref = 1; diff --git a/dll/win32/comctl32/ipaddress.c b/dll/win32/comctl32/ipaddress.c index 03b8d1c9ed3..1f41f91eac1 100644 --- a/dll/win32/comctl32/ipaddress.c +++ b/dll/win32/comctl32/ipaddress.c @@ -149,7 +149,6 @@ static LRESULT IPADDRESS_Draw (const IPADDRESS_INFO *infoPtr, HDC hdc) { static const WCHAR dotW[] = { '.', 0 }; RECT rect, rcPart; - POINT pt; COLORREF bgCol, fgCol; int i; @@ -173,13 +172,11 @@ static LRESULT IPADDRESS_Draw (const IPADDRESS_INFO *infoPtr, HDC hdc) for (i = 0; i < 3; i++) { GetWindowRect (infoPtr->Part[i].EditHwnd, &rcPart); - pt.x = rcPart.right; - ScreenToClient(infoPtr->Self, &pt); - rect.left = pt.x; + MapWindowPoints( 0, infoPtr->Self, (POINT *)&rcPart, 2 ); + rect.left = rcPart.right; GetWindowRect (infoPtr->Part[i+1].EditHwnd, &rcPart); - pt.x = rcPart.left; - ScreenToClient(infoPtr->Self, &pt); - rect.right = pt.x; + MapWindowPoints( 0, infoPtr->Self, (POINT *)&rcPart, 2 ); + rect.right = rcPart.left; DrawTextW(hdc, dotW, 1, &rect, DT_SINGLELINE | DT_CENTER | DT_BOTTOM); } diff --git a/dll/win32/comctl32/listview.c b/dll/win32/comctl32/listview.c index 4e13577b48f..dc96200ee35 100644 --- a/dll/win32/comctl32/listview.c +++ b/dll/win32/comctl32/listview.c @@ -6,7 +6,7 @@ * Copyright 2000 Jason Mawdsley * Copyright 2001 CodeWeavers Inc. * Copyright 2002 Dimitrie O. Paun - * Copyright 2009 Nikolay Sivov + * Copyright 2009-2011 Nikolay Sivov * Copyright 2009 Owen Rudge for CodeWeavers * * This library is free software; you can redistribute it and/or @@ -456,8 +456,8 @@ static INT LISTVIEW_GetStringWidthT(const LISTVIEW_INFO *, LPCWSTR, BOOL); static BOOL LISTVIEW_KeySelection(LISTVIEW_INFO *, INT, BOOL); static UINT LISTVIEW_GetItemState(const LISTVIEW_INFO *, INT, UINT); static BOOL LISTVIEW_SetItemState(LISTVIEW_INFO *, INT, const LVITEMW *); -static LRESULT LISTVIEW_VScroll(LISTVIEW_INFO *, INT, INT, HWND); -static LRESULT LISTVIEW_HScroll(LISTVIEW_INFO *, INT, INT, HWND); +static LRESULT LISTVIEW_VScroll(LISTVIEW_INFO *, INT, INT); +static LRESULT LISTVIEW_HScroll(LISTVIEW_INFO *, INT, INT); static BOOL LISTVIEW_EnsureVisible(LISTVIEW_INFO *, INT, BOOL); static HIMAGELIST LISTVIEW_SetImageList(LISTVIEW_INFO *, INT, HIMAGELIST); static INT LISTVIEW_HitTest(const LISTVIEW_INFO *, LPLVHITTESTINFO, BOOL, BOOL); @@ -474,20 +474,14 @@ static BOOL LISTVIEW_Scroll(LISTVIEW_INFO *, INT, INT); * W: Unicode, T: ANSI/Unicode - function of isW */ -static inline BOOL is_textW(LPCWSTR text) +static inline BOOL is_text(LPCWSTR text) { return text != NULL && text != LPSTR_TEXTCALLBACKW; } -static inline BOOL is_textT(LPCWSTR text, BOOL isW) -{ - /* we can ignore isW since LPSTR_TEXTCALLBACKW == LPSTR_TEXTCALLBACKA */ - return is_textW(text); -} - static inline int textlenT(LPCWSTR text, BOOL isW) { - return !is_textT(text, isW) ? 0 : + return !is_text(text) ? 0 : isW ? lstrlenW(text) : lstrlenA((LPCSTR)text); } @@ -505,7 +499,7 @@ static inline LPWSTR textdupTtoW(LPCWSTR text, BOOL isW) { LPWSTR wstr = (LPWSTR)text; - if (!isW && is_textT(text, isW)) + if (!isW && is_text(text)) { INT len = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)text, -1, NULL, 0); wstr = Alloc(len * sizeof(WCHAR)); @@ -517,7 +511,7 @@ static inline LPWSTR textdupTtoW(LPCWSTR text, BOOL isW) static inline void textfreeT(LPWSTR wstr, BOOL isW) { - if (!isW && is_textT(wstr, isW)) Free (wstr); + if (!isW && is_text(wstr)) Free (wstr); } /* @@ -530,7 +524,7 @@ static BOOL textsetptrT(LPWSTR *dest, LPCWSTR src, BOOL isW) if (src == LPSTR_TEXTCALLBACKW) { - if (is_textW(*dest)) Free(*dest); + if (is_text(*dest)) Free(*dest); *dest = LPSTR_TEXTCALLBACKW; } else @@ -623,7 +617,7 @@ static const char* debugscrollinfo(const SCROLLINFO *pScrollInfo) if (pScrollInfo->fMask & SIF_TRACKPOS) len = snprintf(buf, size, "nTrackPos=%d, ", pScrollInfo->nTrackPos); else len = 0; - if (len == -1) goto end; buf += len; size -= len; + if (len == -1) goto end; buf += len; goto undo; end: buf = text + strlen(text); @@ -668,7 +662,7 @@ static const char* debuglvitem_t(const LVITEMW *lpLVItem, BOOL isW) if (lpLVItem->mask & LVIF_INDENT) len = snprintf(buf, size, "iIndent=%d, ", lpLVItem->iIndent); else len = 0; - if (len == -1) goto end; buf += len; size -= len; + if (len == -1) goto end; buf += len; goto undo; end: buf = text + strlen(text); @@ -708,7 +702,7 @@ static const char* debuglvcolumn_t(const LVCOLUMNW *lpColumn, BOOL isW) if (lpColumn->mask & LVCF_ORDER) len = snprintf(buf, size, "iOrder=%d, ", lpColumn->iOrder); else len = 0; - if (len == -1) goto end; buf += len; size -= len; + if (len == -1) goto end; buf += len; goto undo; end: buf = text + strlen(text); @@ -934,74 +928,104 @@ static BOOL notify_deleteitem(const LISTVIEW_INFO *infoPtr, INT nItem) Send notification. depends on dispinfoW having same structure as dispinfoA. infoPtr : listview struct - notificationCode : *Unicode* notification code + code : *Unicode* notification code pdi : dispinfo structure (can be unicode or ansi) isW : TRUE if dispinfo is Unicode */ -static BOOL notify_dispinfoT(const LISTVIEW_INFO *infoPtr, UINT notificationCode, LPNMLVDISPINFOW pdi, BOOL isW) +static BOOL notify_dispinfoT(const LISTVIEW_INFO *infoPtr, UINT code, LPNMLVDISPINFOW pdi, BOOL isW) { - BOOL bResult = FALSE; - BOOL convertToAnsi = FALSE, convertToUnicode = FALSE; - INT cchTempBufMax = 0, savCchTextMax = 0; - UINT realNotifCode; - LPWSTR pszTempBuf = NULL, savPszText = NULL; + INT length = 0, ret_length; + LPWSTR buffer = NULL, ret_text; + BOOL return_ansi = FALSE; + BOOL return_unicode = FALSE; + BOOL ret; - if ((pdi->item.mask & LVIF_TEXT) && is_textT(pdi->item.pszText, isW)) + if ((pdi->item.mask & LVIF_TEXT) && is_text(pdi->item.pszText)) { - convertToAnsi = (isW && infoPtr->notifyFormat == NFR_ANSI); - convertToUnicode = (!isW && infoPtr->notifyFormat == NFR_UNICODE); + return_unicode = ( isW && infoPtr->notifyFormat == NFR_ANSI); + return_ansi = (!isW && infoPtr->notifyFormat == NFR_UNICODE); } - if (convertToAnsi || convertToUnicode) + ret_length = pdi->item.cchTextMax; + ret_text = pdi->item.pszText; + + if (return_unicode || return_ansi) { - if (notificationCode != LVN_GETDISPINFOW) - { - cchTempBufMax = convertToUnicode ? + if (code != LVN_GETDISPINFOW) + { + length = return_ansi ? MultiByteToWideChar(CP_ACP, 0, (LPCSTR)pdi->item.pszText, -1, NULL, 0): WideCharToMultiByte(CP_ACP, 0, pdi->item.pszText, -1, NULL, 0, NULL, NULL); - } - else - { - cchTempBufMax = pdi->item.cchTextMax; - *pdi->item.pszText = 0; /* make sure we don't process garbage */ - } + } + else + { + length = pdi->item.cchTextMax; + *pdi->item.pszText = 0; /* make sure we don't process garbage */ + } - pszTempBuf = Alloc( (convertToUnicode ? sizeof(WCHAR) : sizeof(CHAR)) * cchTempBufMax); - if (!pszTempBuf) return FALSE; + buffer = Alloc( (return_ansi ? sizeof(WCHAR) : sizeof(CHAR)) * length); + if (!buffer) return FALSE; - if (convertToUnicode) - MultiByteToWideChar(CP_ACP, 0, (LPCSTR)pdi->item.pszText, -1, - pszTempBuf, cchTempBufMax); - else - WideCharToMultiByte(CP_ACP, 0, pdi->item.pszText, -1, (LPSTR) pszTempBuf, - cchTempBufMax, NULL, NULL); + if (return_ansi) + MultiByteToWideChar(CP_ACP, 0, (LPCSTR)pdi->item.pszText, -1, + buffer, length); + else + WideCharToMultiByte(CP_ACP, 0, pdi->item.pszText, -1, (LPSTR) buffer, + length, NULL, NULL); - savCchTextMax = pdi->item.cchTextMax; - savPszText = pdi->item.pszText; - pdi->item.pszText = pszTempBuf; - pdi->item.cchTextMax = cchTempBufMax; + pdi->item.pszText = buffer; + pdi->item.cchTextMax = length; } if (infoPtr->notifyFormat == NFR_ANSI) - realNotifCode = get_ansi_notification(notificationCode); - else - realNotifCode = notificationCode; - TRACE(" pdi->item=%s\n", debuglvitem_t(&pdi->item, infoPtr->notifyFormat != NFR_ANSI)); - bResult = notify_hdr(infoPtr, realNotifCode, &pdi->hdr); + code = get_ansi_notification(code); - if (convertToUnicode || convertToAnsi) + TRACE(" pdi->item=%s\n", debuglvitem_t(&pdi->item, infoPtr->notifyFormat != NFR_ANSI)); + ret = notify_hdr(infoPtr, code, &pdi->hdr); + TRACE(" resulting code=%d\n", pdi->hdr.code); + + if (return_ansi || return_unicode) { - if (convertToUnicode) /* note : pointer can be changed by app ! */ - WideCharToMultiByte(CP_ACP, 0, pdi->item.pszText, -1, (LPSTR) savPszText, - savCchTextMax, NULL, NULL); - else - MultiByteToWideChar(CP_ACP, 0, (LPSTR) pdi->item.pszText, -1, - savPszText, savCchTextMax); - pdi->item.pszText = savPszText; /* restores our buffer */ - pdi->item.cchTextMax = savCchTextMax; - Free (pszTempBuf); + if (return_ansi && (pdi->hdr.code == LVN_GETDISPINFOA)) + { + strcpy((char*)ret_text, (char*)pdi->item.pszText); + } + else if (return_unicode && (pdi->hdr.code == LVN_GETDISPINFOW)) + { + strcpyW(ret_text, pdi->item.pszText); + } + else if (return_ansi) /* note : pointer can be changed by app ! */ + { + WideCharToMultiByte(CP_ACP, 0, pdi->item.pszText, -1, (LPSTR) ret_text, + ret_length, NULL, NULL); + } + else + MultiByteToWideChar(CP_ACP, 0, (LPSTR) pdi->item.pszText, -1, + ret_text, ret_length); + + pdi->item.pszText = ret_text; /* restores our buffer */ + pdi->item.cchTextMax = ret_length; + + Free(buffer); + return ret; } - return bResult; + + /* if dipsinfo holder changed notification code then convert */ + if (!isW && (pdi->hdr.code == LVN_GETDISPINFOW) && (pdi->item.mask & LVIF_TEXT)) + { + length = WideCharToMultiByte(CP_ACP, 0, pdi->item.pszText, -1, NULL, 0, NULL, NULL); + + buffer = Alloc(length * sizeof(CHAR)); + if (!buffer) return FALSE; + + WideCharToMultiByte(CP_ACP, 0, pdi->item.pszText, -1, (LPSTR) buffer, + ret_length, NULL, NULL); + + strcpy((LPSTR)pdi->item.pszText, (LPSTR)buffer); + Free(buffer); + } + + return ret; } static void customdraw_fill(NMLVCUSTOMDRAW *lpnmlvcd, const LISTVIEW_INFO *infoPtr, HDC hdc, @@ -1789,8 +1813,6 @@ static INT LISTVIEW_ProcessLetterKeys(LISTVIEW_INFO *infoPtr, WPARAM charCode, L infoPtr->charCode = charCode; infoPtr->szSearchParam[0] = charCode; infoPtr->nSearchParamLength = 1; - /* redundant with the 1 char string */ - charCode = 0; } /* and search from the current position */ @@ -1855,8 +1877,9 @@ static INT LISTVIEW_ProcessLetterKeys(LISTVIEW_INFO *infoPtr, WPARAM charCode, L } } - /* found something or second search completed with any result */ - if (nItem != -1 || endidx != infoPtr->nItemCount) + if ( nItem != -1 || /* found something */ + endidx != infoPtr->nItemCount || /* second search done */ + (startidx == 0 && endidx == infoPtr->nItemCount) /* full range for first search */ ) break; }; } @@ -2325,7 +2348,7 @@ static void LISTVIEW_GetItemMetrics(const LISTVIEW_INFO *infoPtr, const LVITEMW /* we need the text in non owner draw mode */ assert(lpLVItem->mask & LVIF_TEXT); - if (is_textT(lpLVItem->pszText, TRUE)) + if (is_text(lpLVItem->pszText)) { HFONT hFont = infoPtr->hFont ? infoPtr->hFont : infoPtr->hDefaultFont; HDC hdc = GetDC(infoPtr->hwndSelf); @@ -3231,7 +3254,7 @@ static BOOL ranges_del(RANGES ranges, RANGE range) /* case 5: fully internal */ else { - RANGE tmprgn = *chkrgn, *newrgn; + RANGE *newrgn; if (!(newrgn = Alloc(sizeof(RANGE)))) goto fail; newrgn->lower = chkrgn->lower; @@ -3242,7 +3265,6 @@ static BOOL ranges_del(RANGES ranges, RANGE range) Free(newrgn); goto fail; } - chkrgn = &tmprgn; break; } @@ -3704,7 +3726,9 @@ static LRESULT LISTVIEW_MouseHover(LISTVIEW_INFO *infoPtr, INT x, INT y) * RETURN: * None. */ -static void LISTVIEW_MarqueeHighlight(LISTVIEW_INFO *infoPtr, LPPOINT coords_orig, LPPOINT coords_offs, LPPOINT offset, INT scroll) +static void LISTVIEW_MarqueeHighlight(LISTVIEW_INFO *infoPtr, const POINT *coords_orig, + const POINT *coords_offs, const POINT *offset, + INT scroll) { BOOL controlDown = FALSE; LVITEMW item; @@ -4318,7 +4342,7 @@ static BOOL LISTVIEW_SetItemT(LISTVIEW_INFO *infoPtr, LVITEMW *lpLVItem, BOOL is return FALSE; /* For efficiency, we transform the lpLVItem->pszText to Unicode here */ - if ((lpLVItem->mask & LVIF_TEXT) && is_textW(lpLVItem->pszText)) + if ((lpLVItem->mask & LVIF_TEXT) && is_text(lpLVItem->pszText)) { pszText = lpLVItem->pszText; lpLVItem->pszText = textdupTtoW(lpLVItem->pszText, isW); @@ -5060,8 +5084,6 @@ enddraw: static DWORD LISTVIEW_ApproximateViewRect(const LISTVIEW_INFO *infoPtr, INT nItemCount, WORD wWidth, WORD wHeight) { - INT nItemCountPerColumn = 1; - INT nColumnCount = 0; DWORD dwViewRect = 0; if (nItemCount == -1) @@ -5069,6 +5091,9 @@ static DWORD LISTVIEW_ApproximateViewRect(const LISTVIEW_INFO *infoPtr, INT nIte if (infoPtr->uView == LV_VIEW_LIST) { + INT nItemCountPerColumn = 1; + INT nColumnCount = 0; + if (wHeight == 0xFFFF) { /* use current height */ @@ -5129,9 +5154,6 @@ static DWORD LISTVIEW_ApproximateViewRect(const LISTVIEW_INFO *infoPtr, INT nIte nItemWidth = infoPtr->iconSpacing.cx; nItemHeight = infoPtr->iconSpacing.cy; - if (nItemCount == -1) - nItemCount = infoPtr->nItemCount; - if (wWidth == 0xffff) wWidth = infoPtr->rcList.right - infoPtr->rcList.left; @@ -5307,7 +5329,7 @@ static BOOL LISTVIEW_DeleteAllItems(LISTVIEW_INFO *infoPtr, BOOL destroy) for (j = 0; j < DPA_GetPtrCount(hdpaSubItems); j++) { hdrItem = DPA_GetPtr(hdpaSubItems, j); - if (is_textW(hdrItem->pszText)) Free(hdrItem->pszText); + if (is_text(hdrItem->pszText)) Free(hdrItem->pszText); Free(hdrItem); } DPA_Destroy(hdpaSubItems); @@ -5449,7 +5471,7 @@ static BOOL LISTVIEW_DeleteColumn(LISTVIEW_INFO *infoPtr, INT nColumn) if (nSubItem > 0) { /* free string */ - if (is_textW(lpDelItem->hdr.pszText)) + if (is_text(lpDelItem->hdr.pszText)) Free(lpDelItem->hdr.pszText); /* free item */ @@ -5598,7 +5620,7 @@ static BOOL LISTVIEW_DeleteItem(LISTVIEW_INFO *infoPtr, INT nItem) for (i = 0; i < DPA_GetPtrCount(hdpaSubItems); i++) { hdrItem = DPA_GetPtr(hdpaSubItems, i); - if (is_textW(hdrItem->pszText)) Free(hdrItem->pszText); + if (is_text(hdrItem->pszText)) Free(hdrItem->pszText); Free(hdrItem); } DPA_Destroy(hdpaSubItems); @@ -5843,7 +5865,7 @@ static HWND CreateEditLabelT(LISTVIEW_INFO *infoPtr, LPCWSTR text, BOOL isW) TRACE("(%p, text=%s, isW=%d)\n", infoPtr, debugtext_t(text, isW), isW); - /* Window will be resized and positioned after LVN_BEGINLABELEDIT */ + /* window will be resized and positioned after LVN_BEGINLABELEDIT */ if (isW) hedit = CreateWindowW(WC_EDITW, text, style, 0, 0, 0, 0, infoPtr->hwndSelf, 0, hinst, 0); else @@ -5875,21 +5897,21 @@ static HWND CreateEditLabelT(LISTVIEW_INFO *infoPtr, LPCWSTR text, BOOL isW) */ static HWND LISTVIEW_EditLabelT(LISTVIEW_INFO *infoPtr, INT nItem, BOOL isW) { - WCHAR szDispText[DISP_TEXT_SIZE] = { 0 }; + WCHAR disptextW[DISP_TEXT_SIZE] = { 0 }; + HWND hwndSelf = infoPtr->hwndSelf; NMLVDISPINFOW dispInfo; + HFONT hOldFont = NULL; + TEXTMETRICW tm; RECT rect; SIZE sz; - HWND hwndSelf = infoPtr->hwndSelf; HDC hdc; - HFONT hOldFont = NULL; - TEXTMETRICW textMetric; TRACE("(nItem=%d, isW=%d)\n", nItem, isW); if (~infoPtr->dwStyle & LVS_EDITLABELS) return 0; - /* Is the EditBox still there, if so remove it */ - if(infoPtr->hwndEdit != 0) + /* remove existing edit box */ + if (infoPtr->hwndEdit) { SetFocus(infoPtr->hwndSelf); infoPtr->hwndEdit = 0; @@ -5911,7 +5933,7 @@ static HWND LISTVIEW_EditLabelT(LISTVIEW_INFO *infoPtr, INT nItem, BOOL isW) dispInfo.item.iItem = nItem; dispInfo.item.iSubItem = 0; dispInfo.item.stateMask = ~0; - dispInfo.item.pszText = szDispText; + dispInfo.item.pszText = disptextW; dispInfo.item.cchTextMax = DISP_TEXT_SIZE; if (!LISTVIEW_GetItemT(infoPtr, &dispInfo.item, isW)) return 0; @@ -5927,27 +5949,36 @@ static HWND LISTVIEW_EditLabelT(LISTVIEW_INFO *infoPtr, INT nItem, BOOL isW) return 0; } - /* Now position and display edit box */ + TRACE("disp text=%s\n", debugtext_t(dispInfo.item.pszText, isW)); + + /* position and display edit box */ hdc = GetDC(infoPtr->hwndSelf); - /* Select the font to get appropriate metric dimensions */ - if(infoPtr->hFont != 0) + /* select the font to get appropriate metric dimensions */ + if (infoPtr->hFont) hOldFont = SelectObject(hdc, infoPtr->hFont); - /* Get String Length in pixels */ - GetTextExtentPoint32W(hdc, dispInfo.item.pszText, lstrlenW(dispInfo.item.pszText), &sz); + /* use real edit box content, it could be altered during LVN_BEGINLABELEDIT notification */ + GetWindowTextW(infoPtr->hwndEdit, disptextW, DISP_TEXT_SIZE); + TRACE("edit box text=%s\n", debugstr_w(disptextW)); - /* Add Extra spacing for the next character */ - GetTextMetricsW(hdc, &textMetric); - sz.cx += (textMetric.tmMaxCharWidth * 2); + /* get string length in pixels */ + GetTextExtentPoint32W(hdc, disptextW, lstrlenW(disptextW), &sz); - if(infoPtr->hFont != 0) + /* add extra spacing for the next character */ + GetTextMetricsW(hdc, &tm); + sz.cx += tm.tmMaxCharWidth * 2; + + if (infoPtr->hFont) SelectObject(hdc, hOldFont); ReleaseDC(infoPtr->hwndSelf, hdc); - MoveWindow(infoPtr->hwndEdit, rect.left - 2, rect.top - 1, sz.cx, - rect.bottom - rect.top + 2, FALSE); + sz.cy = rect.bottom - rect.top + 2; + rect.left -= 2; + rect.top -= 1; + TRACE("moving edit=(%d,%d)-(%d,%d)\n", rect.left, rect.top, sz.cx, sz.cy); + MoveWindow(infoPtr->hwndEdit, rect.left, rect.top, sz.cx, sz.cy, FALSE); ShowWindow(infoPtr->hwndEdit, SW_NORMAL); SetFocus(infoPtr->hwndEdit); SendMessageW(infoPtr->hwndEdit, EM_SETSEL, 0, -1); @@ -6029,14 +6060,14 @@ static BOOL LISTVIEW_EnsureVisible(LISTVIEW_INFO *infoPtr, INT nItem, BOOL bPart { INT diff = nHorzDiff / nScrollPosWidth; if (nHorzDiff % nScrollPosWidth) diff += nHorzAdjust; - LISTVIEW_HScroll(infoPtr, SB_INTERNAL, diff, 0); + LISTVIEW_HScroll(infoPtr, SB_INTERNAL, diff); } if (nScrollPosHeight) { INT diff = nVertDiff / nScrollPosHeight; if (nVertDiff % nScrollPosHeight) diff += nVertAdjust; - LISTVIEW_VScroll(infoPtr, SB_INTERNAL, diff, 0); + LISTVIEW_VScroll(infoPtr, SB_INTERNAL, diff); } return TRUE; @@ -6077,7 +6108,7 @@ static INT LISTVIEW_FindItemW(const LISTVIEW_INFO *infoPtr, INT nStart, } if (!lpFindInfo || nItem < 0) return -1; - + lvItem.mask = 0; if (lpFindInfo->flags & (LVFI_STRING | LVFI_PARTIAL) || lpFindInfo->flags & LVFI_SUBSTRING) @@ -6214,24 +6245,6 @@ static INT LISTVIEW_FindItemA(const LISTVIEW_INFO *infoPtr, INT nStart, return res; } -/*** - * DESCRIPTION: - * Retrieves the background image of the listview control. - * - * PARAMETER(S): - * [I] infoPtr : valid pointer to the listview structure - * [O] lpBkImage : background image attributes - * - * RETURN: - * SUCCESS : TRUE - * FAILURE : FALSE - */ -/* static BOOL LISTVIEW_GetBkImage(const LISTVIEW_INFO *infoPtr, LPLVBKIMAGE lpBkImage) */ -/* { */ -/* FIXME (listview, "empty stub!\n"); */ -/* return FALSE; */ -/* } */ - /*** * DESCRIPTION: * Retrieves column attributes. @@ -6454,6 +6467,7 @@ static BOOL LISTVIEW_GetItemT(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, return FALSE; if (lpLVItem->mask == 0) return TRUE; + TRACE("mask=%x\n", lpLVItem->mask); /* make a local copy */ isubitem = lpLVItem->iSubItem; @@ -6502,7 +6516,7 @@ static BOOL LISTVIEW_GetItemT(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, if (lpLVItem->mask & LVIF_STATE) dispInfo.item.stateMask = lpLVItem->stateMask & infoPtr->uCallbackMask; /* could be zeroed on LVIF_NORECOMPUTE case */ - if (dispInfo.item.mask != 0) + if (dispInfo.item.mask) { notify_dispinfoT(infoPtr, LVN_GETDISPINFOW, &dispInfo, isW); dispInfo.item.stateMask = lpLVItem->stateMask; @@ -6598,7 +6612,7 @@ static BOOL LISTVIEW_GetItemT(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, /* Apps depend on calling back for text if it is NULL or LPSTR_TEXTCALLBACKW */ if ((lpLVItem->mask & LVIF_TEXT) && !(lpLVItem->mask & LVIF_NORECOMPUTE) && - !is_textW(pItemHdr->pszText)) + !is_text(pItemHdr->pszText)) { dispInfo.item.mask |= LVIF_TEXT; dispInfo.item.pszText = lpLVItem->pszText; @@ -6608,7 +6622,7 @@ static BOOL LISTVIEW_GetItemT(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, } /* If we don't have all the requested info, query the application */ - if (dispInfo.item.mask != 0) + if (dispInfo.item.mask) { dispInfo.item.iItem = lpLVItem->iItem; dispInfo.item.iSubItem = lpLVItem->iSubItem; /* yes: the original subitem */ @@ -6646,7 +6660,7 @@ static BOOL LISTVIEW_GetItemT(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, else if (lpLVItem->mask & LVIF_TEXT) { /* if LVN_GETDISPINFO's disabled with LVIF_NORECOMPUTE return callback placeholder */ - if (isW || !is_textW(pItemHdr->pszText)) lpLVItem->pszText = pItemHdr->pszText; + if (isW || !is_text(pItemHdr->pszText)) lpLVItem->pszText = pItemHdr->pszText; else textcpynT(lpLVItem->pszText, isW, pItemHdr->pszText, TRUE, lpLVItem->cchTextMax); } @@ -7353,7 +7367,7 @@ static INT LISTVIEW_GetStringWidthT(const LISTVIEW_INFO *infoPtr, LPCWSTR lpszTe SIZE stringSize; stringSize.cx = 0; - if (is_textT(lpszText, isW)) + if (is_text(lpszText)) { HFONT hFont = infoPtr->hFont ? infoPtr->hFont : infoPtr->hDefaultFont; HDC hdc = GetDC(infoPtr->hwndSelf); @@ -7818,8 +7832,8 @@ static BOOL LISTVIEW_Scroll(LISTVIEW_INFO *infoPtr, INT dx, INT dy) break; } - if (dx != 0) LISTVIEW_HScroll(infoPtr, SB_INTERNAL, dx, 0); - if (dy != 0) LISTVIEW_VScroll(infoPtr, SB_INTERNAL, dy, 0); + if (dx != 0) LISTVIEW_HScroll(infoPtr, SB_INTERNAL, dx); + if (dy != 0) LISTVIEW_VScroll(infoPtr, SB_INTERNAL, dy); return TRUE; } @@ -8677,7 +8691,7 @@ static BOOL LISTVIEW_SetItemCount(LISTVIEW_INFO *infoPtr, INT nItems, DWORD dwFl * SUCCESS : TRUE * FAILURE : FALSE */ -static BOOL LISTVIEW_SetItemPosition(LISTVIEW_INFO *infoPtr, INT nItem, POINT *pt) +static BOOL LISTVIEW_SetItemPosition(LISTVIEW_INFO *infoPtr, INT nItem, const POINT *pt) { POINT Origin, Pt; @@ -8883,10 +8897,10 @@ static HWND LISTVIEW_SetToolTips( LISTVIEW_INFO *infoPtr, HWND hwndNewToolTip) * RETURN: * Old Unicode Format */ -static BOOL LISTVIEW_SetUnicodeFormat( LISTVIEW_INFO *infoPtr, BOOL fUnicode) +static BOOL LISTVIEW_SetUnicodeFormat( LISTVIEW_INFO *infoPtr, BOOL unicode) { SHORT rc = infoPtr->notifyFormat; - infoPtr->notifyFormat = (fUnicode) ? NFR_UNICODE : NFR_ANSI; + infoPtr->notifyFormat = (unicode) ? NFR_UNICODE : NFR_ANSI; return rc == NFR_UNICODE; } @@ -9304,6 +9318,7 @@ static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs) (WPARAM)infoPtr->hwndSelf, NF_QUERY); /* on error defaulting to ANSI notifications */ if (infoPtr->notifyFormat == 0) infoPtr->notifyFormat = NFR_ANSI; + TRACE("notify format=%d\n", infoPtr->notifyFormat); if ((infoPtr->uView == LV_VIEW_DETAILS) && (lpcs->style & WS_VISIBLE)) { @@ -9452,7 +9467,7 @@ static void scroll_list(LISTVIEW_INFO *infoPtr, INT dx, INT dy) * */ static LRESULT LISTVIEW_VScroll(LISTVIEW_INFO *infoPtr, INT nScrollCode, - INT nScrollDiff, HWND hScrollWnd) + INT nScrollDiff) { INT nOldScrollPos, nNewScrollPos; SCROLLINFO scrollInfo; @@ -9556,7 +9571,7 @@ static LRESULT LISTVIEW_VScroll(LISTVIEW_INFO *infoPtr, INT nScrollCode, * */ static LRESULT LISTVIEW_HScroll(LISTVIEW_INFO *infoPtr, INT nScrollCode, - INT nScrollDiff, HWND hScrollWnd) + INT nScrollDiff) { INT nOldScrollPos, nNewScrollPos; SCROLLINFO scrollInfo; @@ -9657,7 +9672,7 @@ static LRESULT LISTVIEW_MouseWheel(LISTVIEW_INFO *infoPtr, INT wheelDelta) * should be fixed in the future. */ LISTVIEW_VScroll(infoPtr, SB_INTERNAL, (gcWheelDelta < 0) ? - -LISTVIEW_SCROLL_ICON_LINE_SIZE : LISTVIEW_SCROLL_ICON_LINE_SIZE, 0); + -LISTVIEW_SCROLL_ICON_LINE_SIZE : LISTVIEW_SCROLL_ICON_LINE_SIZE); break; case LV_VIEW_DETAILS: @@ -9665,12 +9680,12 @@ static LRESULT LISTVIEW_MouseWheel(LISTVIEW_INFO *infoPtr, INT wheelDelta) { int cLineScroll = min(LISTVIEW_GetCountPerColumn(infoPtr), pulScrollLines); cLineScroll *= (gcWheelDelta / WHEEL_DELTA); - LISTVIEW_VScroll(infoPtr, SB_INTERNAL, cLineScroll, 0); + LISTVIEW_VScroll(infoPtr, SB_INTERNAL, cLineScroll); } break; case LV_VIEW_LIST: - LISTVIEW_HScroll(infoPtr, (gcWheelDelta < 0) ? SB_LINELEFT : SB_LINERIGHT, 0, 0); + LISTVIEW_HScroll(infoPtr, (gcWheelDelta < 0) ? SB_LINELEFT : SB_LINERIGHT, 0); break; } return 0; @@ -9845,7 +9860,7 @@ static LRESULT LISTVIEW_LButtonDblClk(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, { LVHITTESTINFO htInfo; - TRACE("(key=%hu, X=%hu, Y=%hu)\n", wKey, x, y); + TRACE("(key=%hu, X=%u, Y=%u)\n", wKey, x, y); /* Cancel the item edition if any */ if (infoPtr->itemEdit.fEnabled) @@ -9889,7 +9904,7 @@ static LRESULT LISTVIEW_LButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, IN POINT pt = { x, y }; INT nItem; - TRACE("(key=%hu, X=%hu, Y=%hu)\n", wKey, x, y); + TRACE("(key=%hu, X=%u, Y=%u)\n", wKey, x, y); /* send NM_RELEASEDCAPTURE notification */ if (!notify(infoPtr, NM_RELEASEDCAPTURE)) return 0; @@ -10005,7 +10020,7 @@ static LRESULT LISTVIEW_LButtonUp(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, INT { LVHITTESTINFO lvHitTestInfo; - TRACE("(key=%hu, X=%hu, Y=%hu)\n", wKey, x, y); + TRACE("(key=%hu, X=%u, Y=%u)\n", wKey, x, y); if (!infoPtr->bLButtonDown) return 0; @@ -10114,26 +10129,32 @@ static LRESULT LISTVIEW_NCDestroy(LISTVIEW_INFO *infoPtr) /*** * DESCRIPTION: - * Handles notifications from header. + * Handles notifications. * * PARAMETER(S): * [I] infoPtr : valid pointer to the listview structure - * [I] nCtrlId : control identifier - * [I] lpnmh : notification information + * [I] lpnmhdr : notification information * * RETURN: * Zero */ -static LRESULT LISTVIEW_HeaderNotification(LISTVIEW_INFO *infoPtr, const NMHEADERW *lpnmh) +static LRESULT LISTVIEW_Notify(LISTVIEW_INFO *infoPtr, const NMHDR *lpnmhdr) { HWND hwndSelf = infoPtr->hwndSelf; + const NMHEADERW *lpnmh; - TRACE("(lpnmh=%p)\n", lpnmh); + TRACE("(lpnmhdr=%p)\n", lpnmhdr); - if (!lpnmh || lpnmh->iItem < 0 || lpnmh->iItem >= DPA_GetPtrCount(infoPtr->hdpaColumns)) return 0; - - switch (lpnmh->hdr.code) - { + if (!lpnmhdr || lpnmhdr->hwndFrom != infoPtr->hwndHeader) return 0; + + /* remember: HDN_LAST < HDN_FIRST */ + if (lpnmhdr->code > HDN_FIRST || lpnmhdr->code < HDN_LAST) return 0; + lpnmh = (const NMHEADERW *)lpnmhdr; + + if (lpnmh->iItem < 0 || lpnmh->iItem >= DPA_GetPtrCount(infoPtr->hdpaColumns)) return 0; + + switch (lpnmhdr->code) + { case HDN_TRACKW: case HDN_TRACKA: { @@ -10465,7 +10486,7 @@ static LRESULT LISTVIEW_RButtonDblClk(const LISTVIEW_INFO *infoPtr, WORD wKey, I { LVHITTESTINFO lvHitTestInfo; - TRACE("(key=%hu,X=%hu,Y=%hu)\n", wKey, x, y); + TRACE("(key=%hu,X=%u,Y=%u)\n", wKey, x, y); /* send NM_RELEASEDCAPTURE notification */ if (!notify(infoPtr, NM_RELEASEDCAPTURE)) return 0; @@ -10496,7 +10517,7 @@ static LRESULT LISTVIEW_RButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, IN LVHITTESTINFO lvHitTestInfo; INT nItem; - TRACE("(key=%hu,X=%hu,Y=%hu)\n", wKey, x, y); + TRACE("(key=%hu,X=%u,Y=%u)\n", wKey, x, y); /* send NM_RELEASEDCAPTURE notification */ if (!notify(infoPtr, NM_RELEASEDCAPTURE)) return 0; @@ -10544,7 +10565,7 @@ static LRESULT LISTVIEW_RButtonUp(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, INT LVHITTESTINFO lvHitTestInfo; POINT pt; - TRACE("(key=%hu,X=%hu,Y=%hu)\n", wKey, x, y); + TRACE("(key=%hu,X=%u,Y=%u)\n", wKey, x, y); if (!infoPtr->bRButtonDown) return 0; @@ -11411,7 +11432,7 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return (LRESULT)infoPtr->hFont; case WM_HSCROLL: - return LISTVIEW_HScroll(infoPtr, (INT)LOWORD(wParam), 0, (HWND)lParam); + return LISTVIEW_HScroll(infoPtr, (INT)LOWORD(wParam), 0); case WM_KEYDOWN: return LISTVIEW_KeyDown(infoPtr, (INT)wParam, (LONG)lParam); @@ -11441,9 +11462,7 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return LISTVIEW_NCPaint(infoPtr, (HRGN)wParam); case WM_NOTIFY: - if (lParam && ((LPNMHDR)lParam)->hwndFrom == infoPtr->hwndHeader) - return LISTVIEW_HeaderNotification(infoPtr, (LPNMHEADERW)lParam); - else return 0; + return LISTVIEW_Notify(infoPtr, (LPNMHDR)lParam); case WM_NOTIFYFORMAT: return LISTVIEW_NotifyFormat(infoPtr, (HWND)wParam, (INT)lParam); @@ -11496,7 +11515,7 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return LISTVIEW_ThemeChanged(infoPtr); case WM_VSCROLL: - return LISTVIEW_VScroll(infoPtr, (INT)LOWORD(wParam), 0, (HWND)lParam); + return LISTVIEW_VScroll(infoPtr, (INT)LOWORD(wParam), 0); case WM_MOUSEWHEEL: if (wParam & (MK_SHIFT | MK_CONTROL)) diff --git a/dll/win32/comctl32/monthcal.c b/dll/win32/comctl32/monthcal.c index 3eb2c32b101..2091d8875fb 100644 --- a/dll/win32/comctl32/monthcal.c +++ b/dll/win32/comctl32/monthcal.c @@ -94,12 +94,9 @@ typedef struct { HWND hwndSelf; DWORD dwStyle; /* cached GWL_STYLE */ - COLORREF bk; - COLORREF txt; - COLORREF titlebk; - COLORREF titletxt; - COLORREF monthbk; - COLORREF trailingtxt; + + COLORREF colors[MCSC_TRAILINGTEXT+1]; + HFONT hFont; HFONT hBoldFont; int textHeight; @@ -122,9 +119,8 @@ typedef struct int status; /* See MC_SEL flags */ SYSTEMTIME firstSel; /* first selected day */ INT maxSelCount; - SYSTEMTIME minSel; + SYSTEMTIME minSel; /* contains single selection when used without MCS_MULTISELECT */ SYSTEMTIME maxSel; - SYSTEMTIME curSel; /* contains currently selected year, month and day */ SYSTEMTIME focusedSel; /* date currently focused with mouse movement */ DWORD rangeValid; SYSTEMTIME minDate; @@ -150,8 +146,12 @@ static const SYSTEMTIME st_null; static const SYSTEMTIME max_allowed_date = { 9999, 12, 0, 31, 0, 0, 0, 0 }; static const SYSTEMTIME min_allowed_date = { 1752, 9, 0, 14, 0, 0, 0, 0 }; - -#define MONTHCAL_GetInfoPtr(hwnd) ((MONTHCAL_INFO *)GetWindowLongPtrW(hwnd, 0)) +/* Prev/Next buttons */ +enum nav_direction +{ + DIRECTION_BACKWARD, + DIRECTION_FORWARD +}; /* helper functions */ @@ -449,26 +449,29 @@ int MONTHCAL_CalculateDayOfWeek(SYSTEMTIME *date, BOOL inplace) return st.wDayOfWeek; } +/* add/substract 'months' from date */ +static inline void MONTHCAL_GetMonth(SYSTEMTIME *date, INT months) +{ + INT length, m = date->wMonth + months; + + date->wYear += m > 0 ? (m - 1) / 12 : m / 12 - 1; + date->wMonth = m > 0 ? (m - 1) % 12 + 1 : 12 + m % 12; + /* fix moving from last day in a month */ + length = MONTHCAL_MonthLength(date->wMonth, date->wYear); + if(date->wDay > length) date->wDay = length; + MONTHCAL_CalculateDayOfWeek(date, TRUE); +} + /* properly updates date to point on next month */ static inline void MONTHCAL_GetNextMonth(SYSTEMTIME *date) { - if(++date->wMonth > 12) - { - date->wMonth = 1; - date->wYear++; - } - MONTHCAL_CalculateDayOfWeek(date, TRUE); + return MONTHCAL_GetMonth(date, 1); } /* properly updates date to point on prev month */ static inline void MONTHCAL_GetPrevMonth(SYSTEMTIME *date) { - if(--date->wMonth < 1) - { - date->wMonth = 12; - date->wYear--; - } - MONTHCAL_CalculateDayOfWeek(date, TRUE); + return MONTHCAL_GetMonth(date, -1); } /* Returns full date for a first currently visible day */ @@ -520,7 +523,7 @@ static int MONTHCAL_CalcDayFromPos(const MONTHCAL_INFO *infoPtr, int x, int y, { int retval, firstDay; RECT rcClient; - SYSTEMTIME st = infoPtr->curSel; + SYSTEMTIME st = infoPtr->minSel; GetClientRect(infoPtr->hwndSelf, &rcClient); @@ -548,20 +551,20 @@ static int MONTHCAL_CalcDayFromPos(const MONTHCAL_INFO *infoPtr, int x, int y, * [O] y : week column (zero based) */ static void MONTHCAL_CalcDayXY(const MONTHCAL_INFO *infoPtr, - const SYSTEMTIME *date, int *x, int *y) + const SYSTEMTIME *date, INT *x, INT *y) { - SYSTEMTIME st = infoPtr->curSel; + SYSTEMTIME st = infoPtr->minSel; LONG cmp; int first; st.wDay = 1; first = (MONTHCAL_CalculateDayOfWeek(&st, FALSE) + 6 - infoPtr->firstDay) % 7; - cmp = MONTHCAL_CompareMonths(date, &infoPtr->curSel); + cmp = MONTHCAL_CompareMonths(date, &infoPtr->minSel); /* previous month */ if(cmp == -1) { - *x = (first - MONTHCAL_MonthLength(date->wMonth, infoPtr->curSel.wYear) + date->wDay) % 7; + *x = (first - MONTHCAL_MonthLength(date->wMonth, infoPtr->minSel.wYear) + date->wDay) % 7; *y = 0; return; } @@ -569,7 +572,7 @@ static void MONTHCAL_CalcDayXY(const MONTHCAL_INFO *infoPtr, /* next month calculation is same as for current, just add current month length */ if(cmp == 1) { - first += MONTHCAL_MonthLength(infoPtr->curSel.wMonth, infoPtr->curSel.wYear); + first += MONTHCAL_MonthLength(infoPtr->minSel.wMonth, infoPtr->minSel.wYear); } *x = (date->wDay + first) % 7; @@ -681,8 +684,8 @@ static void MONTHCAL_DrawDay(const MONTHCAL_INFO *infoPtr, HDC hdc, const SYSTEM TRACE("%d %d %d\n", st->wDay, infoPtr->minSel.wDay, infoPtr->maxSel.wDay); TRACE("%s\n", wine_dbgstr_rect(&r)); - oldCol = SetTextColor(hdc, infoPtr->monthbk); - oldBk = SetBkColor(hdc, infoPtr->trailingtxt); + oldCol = SetTextColor(hdc, infoPtr->colors[MCSC_MONTHBK]); + oldBk = SetBkColor(hdc, infoPtr->colors[MCSC_TRAILINGTEXT]); hbr = GetSysColorBrush(COLOR_HIGHLIGHT); FillRect(hdc, &r, hbr); @@ -709,12 +712,12 @@ static void MONTHCAL_DrawDay(const MONTHCAL_INFO *infoPtr, HDC hdc, const SYSTEM } -static void MONTHCAL_PaintButton(MONTHCAL_INFO *infoPtr, HDC hdc, BOOL btnNext) +static void MONTHCAL_PaintButton(MONTHCAL_INFO *infoPtr, HDC hdc, enum nav_direction button) { HTHEME theme = GetWindowTheme (infoPtr->hwndSelf); - RECT *r = btnNext ? &infoPtr->titlebtnnext : &infoPtr->titlebtnprev; - BOOL pressed = btnNext ? (infoPtr->status & MC_NEXTPRESSED) : - (infoPtr->status & MC_PREVPRESSED); + RECT *r = button == DIRECTION_FORWARD ? &infoPtr->titlebtnnext : &infoPtr->titlebtnprev; + BOOL pressed = button == DIRECTION_FORWARD ? infoPtr->status & MC_NEXTPRESSED : + infoPtr->status & MC_PREVPRESSED; if (theme) { static const int states[] = { @@ -723,7 +726,7 @@ static void MONTHCAL_PaintButton(MONTHCAL_INFO *infoPtr, HDC hdc, BOOL btnNext) /* Next button */ ABS_RIGHTNORMAL, ABS_RIGHTPRESSED, ABS_RIGHTDISABLED }; - int stateNum = btnNext ? 3 : 0; + int stateNum = button == DIRECTION_FORWARD ? 3 : 0; if (pressed) stateNum += 1; else @@ -734,7 +737,7 @@ static void MONTHCAL_PaintButton(MONTHCAL_INFO *infoPtr, HDC hdc, BOOL btnNext) } else { - int style = btnNext ? DFCS_SCROLLRIGHT : DFCS_SCROLLLEFT; + int style = button == DIRECTION_FORWARD ? DFCS_SCROLLRIGHT : DFCS_SCROLLLEFT; if (pressed) style |= DFCS_PUSHED; else @@ -750,24 +753,25 @@ static void MONTHCAL_PaintTitle(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRU { static const WCHAR fmt_monthW[] = { '%','s',' ','%','l','d',0 }; RECT *title = &infoPtr->calendars[calIdx].title; + const SYSTEMTIME *st = &infoPtr->calendars[calIdx].month; WCHAR buf_month[80], buf_fmt[80]; HBRUSH hbr; SIZE sz; /* fill header box */ - hbr = CreateSolidBrush(infoPtr->titlebk); + hbr = CreateSolidBrush(infoPtr->colors[MCSC_TITLEBK]); FillRect(hdc, title, hbr); DeleteObject(hbr); /* month/year string */ - SetBkColor(hdc, infoPtr->titlebk); - SetTextColor(hdc, infoPtr->titletxt); + SetBkColor(hdc, infoPtr->colors[MCSC_TITLEBK]); + SetTextColor(hdc, infoPtr->colors[MCSC_TITLETEXT]); SelectObject(hdc, infoPtr->hBoldFont); - GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SMONTHNAME1+infoPtr->curSel.wMonth-1, + GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SMONTHNAME1 + st->wMonth - 1, buf_month, countof(buf_month)); - wsprintfW(buf_fmt, fmt_monthW, buf_month, infoPtr->curSel.wYear); + wsprintfW(buf_fmt, fmt_monthW, buf_month, st->wYear); DrawTextW(hdc, buf_fmt, strlenW(buf_fmt), title, DT_CENTER | DT_VCENTER | DT_SINGLELINE); @@ -783,20 +787,22 @@ static void MONTHCAL_PaintTitle(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRU static void MONTHCAL_PaintWeeknumbers(const MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT *ps, INT calIdx) { + const SYSTEMTIME *date = &infoPtr->calendars[calIdx].month; static const WCHAR fmt_weekW[] = { '%','d',0 }; INT mindays, weeknum, weeknum1, startofprescal; - SYSTEMTIME st = infoPtr->curSel; - RECT r; - WCHAR buf[80]; INT i, prev_month; + SYSTEMTIME st; + WCHAR buf[80]; + HBRUSH hbr; + RECT r; if (!(infoPtr->dwStyle & MCS_WEEKNUMBERS)) return; MONTHCAL_GetMinDate(infoPtr, &st); startofprescal = st.wDay; - st = infoPtr->curSel; + st = *date; - prev_month = infoPtr->curSel.wMonth - 1; + prev_month = date->wMonth - 1; if(prev_month == 0) prev_month = 12; /* @@ -823,7 +829,7 @@ static void MONTHCAL_PaintWeeknumbers(const MONTHCAL_INFO *infoPtr, HDC hdc, con mindays = 0; } - if (infoPtr->curSel.wMonth == 1) + if (date->wMonth == 1) { /* calculate all those exceptions for january */ st.wDay = st.wMonth = 1; @@ -834,7 +840,7 @@ static void MONTHCAL_PaintWeeknumbers(const MONTHCAL_INFO *infoPtr, HDC hdc, con { weeknum = 0; for(i = 0; i < 11; i++) - weeknum += MONTHCAL_MonthLength(i+1, infoPtr->curSel.wYear - 1); + weeknum += MONTHCAL_MonthLength(i+1, date->wYear - 1); weeknum += startofprescal + 7; weeknum /= 7; @@ -847,7 +853,7 @@ static void MONTHCAL_PaintWeeknumbers(const MONTHCAL_INFO *infoPtr, HDC hdc, con { weeknum = 0; for(i = 0; i < prev_month - 1; i++) - weeknum += MONTHCAL_MonthLength(i+1, infoPtr->curSel.wYear); + weeknum += MONTHCAL_MonthLength(i+1, date->wYear); weeknum += startofprescal + 7; weeknum /= 7; @@ -857,6 +863,13 @@ static void MONTHCAL_PaintWeeknumbers(const MONTHCAL_INFO *infoPtr, HDC hdc, con } r = infoPtr->calendars[calIdx].weeknums; + + /* erase whole week numbers area */ + hbr = CreateSolidBrush(infoPtr->colors[MCSC_MONTHBK]); + FillRect(hdc, &r, hbr); + DeleteObject(hbr); + + /* reduce rectangle to one week number */ r.bottom = r.top + infoPtr->height_increment; for(i = 0; i < 6; i++) { @@ -919,8 +932,8 @@ static void MONTHCAL_PaintTodayTitle(const MONTHCAL_INFO *infoPtr, HDC hdc, cons /* today mark + focus */ static void MONTHCAL_PaintFocusAndCircle(const MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT *ps) { - if((infoPtr->curSel.wMonth == infoPtr->todaysDate.wMonth) && - (infoPtr->curSel.wYear == infoPtr->todaysDate.wYear) && + if((infoPtr->minSel.wMonth == infoPtr->todaysDate.wMonth) && + (infoPtr->minSel.wYear == infoPtr->todaysDate.wYear) && !(infoPtr->dwStyle & MCS_NOTODAYCIRCLE)) { MONTHCAL_CircleDay(infoPtr, hdc, &infoPtr->todaysDate); @@ -937,19 +950,20 @@ static void MONTHCAL_PaintFocusAndCircle(const MONTHCAL_INFO *infoPtr, HDC hdc, /* paint a calendar area */ static void MONTHCAL_PaintCalendar(const MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT *ps, INT calIdx) { - INT prev_month, i, j; + const SYSTEMTIME *date = &infoPtr->calendars[calIdx].month; + INT prev_month, i, j, length; + RECT r, fill_bk_rect; + SYSTEMTIME st; WCHAR buf[80]; HBRUSH hbr; - RECT r, fill_bk_rect; int mask; - SYSTEMTIME st; /* fill whole days area - from week days area to today note rectangle */ fill_bk_rect = infoPtr->calendars[calIdx].wdays; fill_bk_rect.bottom = infoPtr->calendars[calIdx].days.bottom + (infoPtr->todayrect.bottom - infoPtr->todayrect.top); - hbr = CreateSolidBrush(infoPtr->monthbk); + hbr = CreateSolidBrush(infoPtr->colors[MCSC_MONTHBK]); FillRect(hdc, &fill_bk_rect, hbr); DeleteObject(hbr); @@ -959,7 +973,7 @@ static void MONTHCAL_PaintCalendar(const MONTHCAL_INFO *infoPtr, HDC hdc, const LineTo(hdc, infoPtr->calendars[calIdx].days.right - 3, infoPtr->calendars[calIdx].title.bottom + infoPtr->textHeight + 1); - prev_month = infoPtr->curSel.wMonth - 1; + prev_month = date->wMonth - 1; if (prev_month == 0) prev_month = 12; infoPtr->calendars[calIdx].wdays.left = infoPtr->calendars[calIdx].days.left = @@ -967,8 +981,8 @@ static void MONTHCAL_PaintCalendar(const MONTHCAL_INFO *infoPtr, HDC hdc, const /* 1. draw day abbreviations */ SelectObject(hdc, infoPtr->hFont); - SetBkColor(hdc, infoPtr->monthbk); - SetTextColor(hdc, infoPtr->trailingtxt); + SetBkColor(hdc, infoPtr->colors[MCSC_MONTHBK]); + SetTextColor(hdc, infoPtr->colors[MCSC_TRAILINGTEXT]); /* rectangle to draw a single day abbreviation within */ r = infoPtr->calendars[calIdx].wdays; r.right = r.left + infoPtr->width_increment; @@ -985,15 +999,16 @@ static void MONTHCAL_PaintCalendar(const MONTHCAL_INFO *infoPtr, HDC hdc, const { SYSTEMTIME st_max; - SetTextColor(hdc, infoPtr->trailingtxt); + SetTextColor(hdc, infoPtr->colors[MCSC_TRAILINGTEXT]); /* draw prev month */ if (calIdx == 0) { MONTHCAL_GetMinDate(infoPtr, &st); mask = 1 << (st.wDay-1); + length = MONTHCAL_MonthLength(prev_month, date->wYear); - while(st.wDay <= MONTHCAL_MonthLength(prev_month, infoPtr->curSel.wYear)) + while(st.wDay <= length) { MONTHCAL_DrawDay(infoPtr, hdc, &st, infoPtr->monthdayState[0] & mask, ps); mask <<= 1; @@ -1004,7 +1019,7 @@ static void MONTHCAL_PaintCalendar(const MONTHCAL_INFO *infoPtr, HDC hdc, const /* draw next month */ if (calIdx == infoPtr->cal_num - 1) { - st = infoPtr->curSel; + st = *date; st.wDay = 1; MONTHCAL_GetNextMonth(&st); MONTHCAL_GetMaxDate(infoPtr, &st_max); @@ -1020,11 +1035,13 @@ static void MONTHCAL_PaintCalendar(const MONTHCAL_INFO *infoPtr, HDC hdc, const } /* 3. current month */ - SetTextColor(hdc, infoPtr->txt); - st = infoPtr->curSel; + SetTextColor(hdc, infoPtr->colors[MCSC_TEXT]); + st = *date; st.wDay = 1; mask = 1; - while(st.wDay <= MONTHCAL_MonthLength(infoPtr->curSel.wMonth, infoPtr->curSel.wYear)) { + length = MONTHCAL_MonthLength(date->wMonth, date->wYear); + while(st.wDay <= length) + { MONTHCAL_DrawDay(infoPtr, hdc, &st, infoPtr->monthdayState[1] & mask, ps); mask <<= 1; st.wDay++; @@ -1066,8 +1083,8 @@ static void MONTHCAL_Refresh(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT MONTHCAL_PaintTodayTitle(infoPtr, hdc, ps); /* navigation buttons */ - MONTHCAL_PaintButton(infoPtr, hdc, FALSE); - MONTHCAL_PaintButton(infoPtr, hdc, TRUE); + MONTHCAL_PaintButton(infoPtr, hdc, DIRECTION_BACKWARD); + MONTHCAL_PaintButton(infoPtr, hdc, DIRECTION_FORWARD); /* restore context */ SetBkColor(hdc, old_bk_clr); @@ -1076,91 +1093,51 @@ static void MONTHCAL_Refresh(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT } static LRESULT -MONTHCAL_GetMinReqRect(const MONTHCAL_INFO *infoPtr, LPRECT lpRect) +MONTHCAL_GetMinReqRect(const MONTHCAL_INFO *infoPtr, RECT *rect) { - TRACE("rect %p\n", lpRect); + TRACE("rect %p\n", rect); - if(!lpRect) return FALSE; + if(!rect) return FALSE; - lpRect->left = infoPtr->calendars[0].title.left; - lpRect->top = infoPtr->calendars[0].title.top; - lpRect->right = infoPtr->calendars[0].title.right; - lpRect->bottom = infoPtr->todayrect.bottom; + *rect = infoPtr->calendars[0].title; + rect->bottom = infoPtr->calendars[0].days.bottom + infoPtr->todayrect.bottom - + infoPtr->todayrect.top; - AdjustWindowRect(lpRect, infoPtr->dwStyle, FALSE); + AdjustWindowRect(rect, infoPtr->dwStyle, FALSE); /* minimal rectangle is zero based */ - OffsetRect(lpRect, -lpRect->left, -lpRect->top); + OffsetRect(rect, -rect->left, -rect->top); - TRACE("%s\n", wine_dbgstr_rect(lpRect)); + TRACE("%s\n", wine_dbgstr_rect(rect)); return TRUE; } - -static LRESULT -MONTHCAL_GetColor(const MONTHCAL_INFO *infoPtr, INT index) +static COLORREF +MONTHCAL_GetColor(const MONTHCAL_INFO *infoPtr, UINT index) { - TRACE("\n"); + TRACE("%p, %d\n", infoPtr, index); - switch(index) { - case MCSC_BACKGROUND: - return infoPtr->bk; - case MCSC_TEXT: - return infoPtr->txt; - case MCSC_TITLEBK: - return infoPtr->titlebk; - case MCSC_TITLETEXT: - return infoPtr->titletxt; - case MCSC_MONTHBK: - return infoPtr->monthbk; - case MCSC_TRAILINGTEXT: - return infoPtr->trailingtxt; - } - - return -1; + if (index > MCSC_TRAILINGTEXT) return -1; + return infoPtr->colors[index]; } - static LRESULT -MONTHCAL_SetColor(MONTHCAL_INFO *infoPtr, INT index, COLORREF color) +MONTHCAL_SetColor(MONTHCAL_INFO *infoPtr, UINT index, COLORREF color) { - COLORREF prev = -1; + COLORREF prev; - TRACE("%d: color %08x\n", index, color); + TRACE("%p, %d: color %08x\n", infoPtr, index, color); - switch(index) { - case MCSC_BACKGROUND: - prev = infoPtr->bk; - infoPtr->bk = color; - break; - case MCSC_TEXT: - prev = infoPtr->txt; - infoPtr->txt = color; - break; - case MCSC_TITLEBK: - prev = infoPtr->titlebk; - infoPtr->titlebk = color; - break; - case MCSC_TITLETEXT: - prev=infoPtr->titletxt; - infoPtr->titletxt = color; - break; - case MCSC_MONTHBK: - prev = infoPtr->monthbk; - infoPtr->monthbk = color; - break; - case MCSC_TRAILINGTEXT: - prev = infoPtr->trailingtxt; - infoPtr->trailingtxt = color; - break; - } + if (index > MCSC_TRAILINGTEXT) return -1; + + prev = infoPtr->colors[index]; + infoPtr->colors[index] = color; InvalidateRect(infoPtr->hwndSelf, NULL, index == MCSC_BACKGROUND ? TRUE : FALSE); return prev; } - static LRESULT MONTHCAL_GetMonthDelta(const MONTHCAL_INFO *infoPtr) { @@ -1399,7 +1376,7 @@ MONTHCAL_GetCurSel(const MONTHCAL_INFO *infoPtr, SYSTEMTIME *curSel) if(!curSel) return FALSE; if(infoPtr->dwStyle & MCS_MULTISELECT) return FALSE; - *curSel = infoPtr->curSel; + *curSel = infoPtr->minSel; TRACE("%d/%d/%d\n", curSel->wYear, curSel->wMonth, curSel->wDay); return TRUE; } @@ -1407,7 +1384,8 @@ MONTHCAL_GetCurSel(const MONTHCAL_INFO *infoPtr, SYSTEMTIME *curSel) static LRESULT MONTHCAL_SetCurSel(MONTHCAL_INFO *infoPtr, SYSTEMTIME *curSel) { - SYSTEMTIME prev = infoPtr->curSel; + SYSTEMTIME prev = infoPtr->minSel; + WORD day; TRACE("%p\n", curSel); if(!curSel) return FALSE; @@ -1415,21 +1393,23 @@ MONTHCAL_SetCurSel(MONTHCAL_INFO *infoPtr, SYSTEMTIME *curSel) if(!MONTHCAL_ValidateDate(curSel)) return FALSE; /* exit earlier if selection equals current */ - if (MONTHCAL_IsDateEqual(&infoPtr->curSel, curSel)) return TRUE; + if (MONTHCAL_IsDateEqual(&infoPtr->minSel, curSel)) return TRUE; if(!MONTHCAL_IsDateInValidRange(infoPtr, curSel, FALSE)) return FALSE; + infoPtr->calendars[0].month = *curSel; infoPtr->minSel = *curSel; infoPtr->maxSel = *curSel; /* if selection is still in current month, reduce rectangle */ + day = prev.wDay; prev.wDay = curSel->wDay; if (MONTHCAL_IsDateEqual(&prev, curSel)) { RECT r_prev, r_new; - /* note that infoPtr->curSel isn't updated yet */ - MONTHCAL_CalcPosFromDay(infoPtr, &infoPtr->curSel, &r_prev); + prev.wDay = day; + MONTHCAL_CalcPosFromDay(infoPtr, &prev, &r_prev); MONTHCAL_CalcPosFromDay(infoPtr, curSel, &r_new); InvalidateRect(infoPtr->hwndSelf, &r_prev, FALSE); @@ -1438,9 +1418,6 @@ MONTHCAL_SetCurSel(MONTHCAL_INFO *infoPtr, SYSTEMTIME *curSel) else InvalidateRect(infoPtr->hwndSelf, NULL, FALSE); - infoPtr->curSel = *curSel; - infoPtr->calendars[0].month = *curSel; - return TRUE; } @@ -1519,13 +1496,11 @@ MONTHCAL_SetSelRange(MONTHCAL_INFO *infoPtr, SYSTEMTIME *range) infoPtr->minSel = range[1]; infoPtr->maxSel = range[0]; } - infoPtr->curSel = infoPtr->minSel; infoPtr->calendars[0].month = infoPtr->minSel; /* update day of week */ MONTHCAL_CalculateDayOfWeek(&infoPtr->minSel, TRUE); MONTHCAL_CalculateDayOfWeek(&infoPtr->maxSel, TRUE); - MONTHCAL_CalculateDayOfWeek(&infoPtr->curSel, TRUE); /* redraw if bounds changed */ /* FIXME: no actual need to redraw everything */ @@ -1612,10 +1587,22 @@ static INT MONTHCAL_GetCalendarFromPoint(const MONTHCAL_INFO *infoPtr, const POI return -1; } +static inline UINT fill_hittest_info(const MCHITTESTINFO *src, MCHITTESTINFO *dest) +{ + dest->uHit = src->uHit; + dest->st = src->st; + + if (dest->cbSize == sizeof(MCHITTESTINFO)) + memcpy(&dest->rc, &src->rc, sizeof(MCHITTESTINFO) - MCHITTESTINFO_V1_SIZE); + + return src->uHit; +} + static LRESULT MONTHCAL_HitTest(const MONTHCAL_INFO *infoPtr, MCHITTESTINFO *lpht) { INT day, wday, wnum, calIdx; + MCHITTESTINFO htinfo; SYSTEMTIME ht_month; UINT x, y; @@ -1624,7 +1611,11 @@ MONTHCAL_HitTest(const MONTHCAL_INFO *infoPtr, MCHITTESTINFO *lpht) x = lpht->pt.x; y = lpht->pt.y; - memset(&lpht->st, 0, sizeof(lpht->st)); + htinfo.st = st_null; + + /* we should preserve passed fields if hit area doesn't need them */ + if (lpht->cbSize == sizeof(MCHITTESTINFO)) + memcpy(&htinfo.rc, &lpht->rc, sizeof(MCHITTESTINFO) - MCHITTESTINFO_V1_SIZE); /* Comment in for debugging... TRACE("%d %d wd[%d %d %d %d] d[%d %d %d %d] t[%d %d %d %d] wn[%d %d %d %d]\n", x, y, @@ -1643,12 +1634,15 @@ MONTHCAL_HitTest(const MONTHCAL_INFO *infoPtr, MCHITTESTINFO *lpht) if (calIdx == -1) { if (PtInRect(&infoPtr->todayrect, lpht->pt)) - lpht->uHit = MCHT_TODAYLINK; + { + htinfo.uHit = MCHT_TODAYLINK; + htinfo.rc = infoPtr->todayrect; + } else /* outside of calendar area? What's left must be background :-) */ - lpht->uHit = MCHT_CALENDARBK; + htinfo.uHit = MCHT_CALENDARBK; - return lpht->uHit; + return fill_hittest_info(&htinfo, lpht); } ht_month = infoPtr->calendars[calIdx].month; @@ -1659,85 +1653,101 @@ MONTHCAL_HitTest(const MONTHCAL_INFO *infoPtr, MCHITTESTINFO *lpht) two calendars have buttons */ if (calIdx == 0 && PtInRect(&infoPtr->titlebtnprev, lpht->pt)) { - lpht->uHit = MCHT_TITLEBTNPREV; + htinfo.uHit = MCHT_TITLEBTNPREV; + htinfo.rc = infoPtr->titlebtnprev; } else if (PtInRect(&infoPtr->titlebtnnext, lpht->pt)) { - lpht->uHit = MCHT_TITLEBTNNEXT; + htinfo.uHit = MCHT_TITLEBTNNEXT; + htinfo.rc = infoPtr->titlebtnnext; } else if (PtInRect(&infoPtr->calendars[calIdx].titlemonth, lpht->pt)) { - lpht->uHit = MCHT_TITLEMONTH; + htinfo.uHit = MCHT_TITLEMONTH; + htinfo.rc = infoPtr->calendars[calIdx].titlemonth; + htinfo.iOffset = calIdx; } else if (PtInRect(&infoPtr->calendars[calIdx].titleyear, lpht->pt)) { - lpht->uHit = MCHT_TITLEYEAR; + htinfo.uHit = MCHT_TITLEYEAR; + htinfo.rc = infoPtr->calendars[calIdx].titleyear; + htinfo.iOffset = calIdx; } else - lpht->uHit = MCHT_TITLE; + { + htinfo.uHit = MCHT_TITLE; + htinfo.rc = infoPtr->calendars[calIdx].title; + htinfo.iOffset = calIdx; + } - return lpht->uHit; + return fill_hittest_info(&htinfo, lpht); } /* days area (including week days and week numbers */ day = MONTHCAL_CalcDayFromPos(infoPtr, x, y, &wday, &wnum); if (PtInRect(&infoPtr->calendars[calIdx].wdays, lpht->pt)) { - lpht->uHit = MCHT_CALENDARDAY; - lpht->st.wYear = ht_month.wYear; - lpht->st.wMonth = (day < 1) ? ht_month.wMonth -1 : ht_month.wMonth; - lpht->st.wDay = (day < 1) ? + htinfo.uHit = MCHT_CALENDARDAY; + htinfo.iOffset = calIdx; + htinfo.st.wYear = ht_month.wYear; + htinfo.st.wMonth = (day < 1) ? ht_month.wMonth -1 : ht_month.wMonth; + htinfo.st.wDay = (day < 1) ? MONTHCAL_MonthLength(ht_month.wMonth-1, ht_month.wYear) - day : day; + + MONTHCAL_CalcDayXY(infoPtr, &htinfo.st, &htinfo.iCol, &htinfo.iRow); } else if(PtInRect(&infoPtr->calendars[calIdx].weeknums, lpht->pt)) { - lpht->uHit = MCHT_CALENDARWEEKNUM; - lpht->st.wYear = ht_month.wYear; + htinfo.uHit = MCHT_CALENDARWEEKNUM; + htinfo.st.wYear = ht_month.wYear; + htinfo.iOffset = calIdx; - if (day < 1) { - lpht->st.wMonth = ht_month.wMonth - 1; + if (day < 1) + { + htinfo.st.wMonth = ht_month.wMonth - 1; + htinfo.st.wDay = MONTHCAL_MonthLength(ht_month.wMonth-1, ht_month.wYear) - day; } - else if (day > MONTHCAL_MonthLength(ht_month.wMonth, ht_month.wYear)) { - lpht->st.wMonth = ht_month.wMonth + 1; + else if (day > MONTHCAL_MonthLength(ht_month.wMonth, ht_month.wYear)) + { + htinfo.st.wMonth = ht_month.wMonth + 1; + htinfo.st.wDay = day - MONTHCAL_MonthLength(ht_month.wMonth, ht_month.wYear); } else - lpht->st.wMonth = ht_month.wMonth; - - if (day < 1) { - lpht->st.wDay = MONTHCAL_MonthLength(ht_month.wMonth-1, ht_month.wYear) - day; + { + htinfo.st.wMonth = ht_month.wMonth; + htinfo.st.wDay = day; } - else if (day > MONTHCAL_MonthLength(ht_month.wMonth, ht_month.wYear)) { - lpht->st.wDay = day - MONTHCAL_MonthLength(ht_month.wMonth, ht_month.wYear); - } - else - lpht->st.wDay = day; } else if(PtInRect(&infoPtr->calendars[calIdx].days, lpht->pt)) { - lpht->st.wYear = ht_month.wYear; - lpht->st.wMonth = ht_month.wMonth; + htinfo.iOffset = calIdx; + htinfo.st.wYear = ht_month.wYear; + htinfo.st.wMonth = ht_month.wMonth; if (day < 1) { - lpht->uHit = MCHT_CALENDARDATEPREV; - MONTHCAL_GetPrevMonth(&lpht->st); - lpht->st.wDay = MONTHCAL_MonthLength(lpht->st.wMonth, lpht->st.wYear) + day; + htinfo.uHit = MCHT_CALENDARDATEPREV; + MONTHCAL_GetPrevMonth(&htinfo.st); + htinfo.st.wDay = MONTHCAL_MonthLength(lpht->st.wMonth, lpht->st.wYear) + day; } else if (day > MONTHCAL_MonthLength(ht_month.wMonth, ht_month.wYear)) { - lpht->uHit = MCHT_CALENDARDATENEXT; - MONTHCAL_GetNextMonth(&lpht->st); - lpht->st.wDay = day - MONTHCAL_MonthLength(ht_month.wMonth, ht_month.wYear); + htinfo.uHit = MCHT_CALENDARDATENEXT; + MONTHCAL_GetNextMonth(&htinfo.st); + htinfo.st.wDay = day - MONTHCAL_MonthLength(ht_month.wMonth, ht_month.wYear); } - else { - lpht->uHit = MCHT_CALENDARDATE; - lpht->st.wDay = day; + else + { + htinfo.uHit = MCHT_CALENDARDATE; + htinfo.st.wDay = day; } + MONTHCAL_CalcDayXY(infoPtr, &htinfo.st, &htinfo.iCol, &htinfo.iRow); + MONTHCAL_CalcDayRect(infoPtr, &htinfo.rc, htinfo.iCol, htinfo.iRow); /* always update day of week */ - MONTHCAL_CalculateDayOfWeek(&lpht->st, TRUE); + MONTHCAL_CalculateDayOfWeek(&htinfo.st, TRUE); } - return lpht->uHit; + return fill_hittest_info(&htinfo, lpht); } /* MCN_GETDAYSTATE notification helper */ @@ -1753,8 +1763,8 @@ static void MONTHCAL_NotifyDayState(MONTHCAL_INFO *infoPtr) nmds.prgDayState = Alloc(infoPtr->monthRange * sizeof(MONTHDAYSTATE)); nmds.stStart = infoPtr->todaysDate; - nmds.stStart.wYear = infoPtr->curSel.wYear; - nmds.stStart.wMonth = infoPtr->curSel.wMonth; + nmds.stStart.wYear = infoPtr->minSel.wYear; + nmds.stStart.wMonth = infoPtr->minSel.wMonth; nmds.stStart.wDay = 1; SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, nmds.nmhdr.idFrom, (LPARAM)&nmds); @@ -1764,41 +1774,62 @@ static void MONTHCAL_NotifyDayState(MONTHCAL_INFO *infoPtr) } } -static void MONTHCAL_GoToPrevNextMonth(MONTHCAL_INFO *infoPtr, BOOL prev) +/* no valid range check performed */ +static void MONTHCAL_Scroll(MONTHCAL_INFO *infoPtr, INT delta) { - SYSTEMTIME st = infoPtr->curSel; + INT i, selIdx = -1; - TRACE("%s\n", prev ? "prev" : "next"); + for(i = 0; i < infoPtr->cal_num; i++) + { + /* save selection position to shift it later */ + if (selIdx == -1 && MONTHCAL_CompareMonths(&infoPtr->minSel, &infoPtr->calendars[i].month) == 0) + selIdx = i; - if(prev) MONTHCAL_GetPrevMonth(&st); else MONTHCAL_GetNextMonth(&st); - - if(!MONTHCAL_IsDateInValidRange(infoPtr, &st, FALSE)) return; + MONTHCAL_GetMonth(&infoPtr->calendars[i].month, delta); + } + /* selection is always shifted to first calendar */ if(infoPtr->dwStyle & MCS_MULTISELECT) { SYSTEMTIME range[2]; - range[0] = infoPtr->minSel; - range[1] = infoPtr->maxSel; - - if(prev) - { - MONTHCAL_GetPrevMonth(&range[0]); - MONTHCAL_GetPrevMonth(&range[1]); - } - else - { - MONTHCAL_GetNextMonth(&range[0]); - MONTHCAL_GetNextMonth(&range[1]); - } - + MONTHCAL_GetSelRange(infoPtr, range); + MONTHCAL_GetMonth(&range[0], delta - selIdx); + MONTHCAL_GetMonth(&range[1], delta - selIdx); MONTHCAL_SetSelRange(infoPtr, range); } else + { + SYSTEMTIME st = infoPtr->minSel; + + MONTHCAL_GetMonth(&st, delta - selIdx); MONTHCAL_SetCurSel(infoPtr, &st); + } +} +static void MONTHCAL_GoToMonth(MONTHCAL_INFO *infoPtr, enum nav_direction direction) +{ + INT delta = infoPtr->delta ? infoPtr->delta : infoPtr->cal_num; + SYSTEMTIME st; + + TRACE("%s\n", direction == DIRECTION_BACKWARD ? "back" : "fwd"); + + /* check if change allowed by range set */ + if(direction == DIRECTION_BACKWARD) + { + st = infoPtr->calendars[0].month; + MONTHCAL_GetMonth(&st, -delta); + } + else + { + st = infoPtr->calendars[infoPtr->cal_num-1].month; + MONTHCAL_GetMonth(&st, delta); + } + + if(!MONTHCAL_IsDateInValidRange(infoPtr, &st, FALSE)) return; + + MONTHCAL_Scroll(infoPtr, direction == DIRECTION_BACKWARD ? -delta : delta); MONTHCAL_NotifyDayState(infoPtr); - MONTHCAL_NotifySelectionChange(infoPtr); } @@ -1823,7 +1854,6 @@ MONTHCAL_RButtonUp(MONTHCAL_INFO *infoPtr, LPARAM lParam) if( TrackPopupMenu(hMenu, TPM_RIGHTBUTTON | TPM_NONOTIFY | TPM_RETURNCMD, menupoint.x, menupoint.y, 0, infoPtr->hwndSelf, NULL)) { - infoPtr->curSel = infoPtr->todaysDate; infoPtr->calendars[0].month = infoPtr->todaysDate; infoPtr->minSel = infoPtr->todaysDate; infoPtr->maxSel = infoPtr->todaysDate; @@ -1881,12 +1911,15 @@ static LRESULT CALLBACK EditWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM } /* creates updown control and edit box */ -static void MONTHCAL_EditYear(MONTHCAL_INFO *infoPtr) +static void MONTHCAL_EditYear(MONTHCAL_INFO *infoPtr, INT calIdx) { + RECT *rc = &infoPtr->calendars[calIdx].titleyear; + RECT *title = &infoPtr->calendars[calIdx].title; + infoPtr->hWndYearEdit = CreateWindowExW(0, WC_EDITW, 0, WS_VISIBLE | WS_CHILD | ES_READONLY, - infoPtr->calendars[0].titleyear.left + 3, infoPtr->titlebtnnext.top, - infoPtr->calendars[0].titleyear.right - infoPtr->calendars[0].titleyear.left + 4, + rc->left + 3, (title->bottom + title->top - infoPtr->textHeight) / 2, + rc->right - rc->left + 4, infoPtr->textHeight, infoPtr->hwndSelf, NULL, NULL, NULL); @@ -1895,7 +1928,7 @@ static void MONTHCAL_EditYear(MONTHCAL_INFO *infoPtr) infoPtr->hWndYearUpDown = CreateWindowExW(0, UPDOWN_CLASSW, 0, WS_VISIBLE | WS_CHILD | UDS_SETBUDDYINT | UDS_NOTHOUSANDS | UDS_ARROWKEYS, - infoPtr->calendars[0].titleyear.right + 7, infoPtr->titlebtnnext.top, + rc->right + 7, (title->bottom + title->top - infoPtr->textHeight) / 2, 18, infoPtr->textHeight, infoPtr->hwndSelf, NULL, NULL, NULL); @@ -1903,7 +1936,7 @@ static void MONTHCAL_EditYear(MONTHCAL_INFO *infoPtr) SendMessageW(infoPtr->hWndYearUpDown, UDM_SETRANGE, 0, MAKELONG(max_allowed_date.wYear, min_allowed_date.wYear)); SendMessageW(infoPtr->hWndYearUpDown, UDM_SETBUDDY, (WPARAM)infoPtr->hWndYearEdit, 0); - SendMessageW(infoPtr->hWndYearUpDown, UDM_SETPOS, 0, infoPtr->curSel.wYear); + SendMessageW(infoPtr->hWndYearUpDown, UDM_SETPOS, 0, infoPtr->calendars[calIdx].month.wYear); /* subclass edit box */ infoPtr->EditWndProc = (WNDPROC)SetWindowLongPtrW(infoPtr->hWndYearEdit, @@ -1939,14 +1972,14 @@ MONTHCAL_LButtonDown(MONTHCAL_INFO *infoPtr, LPARAM lParam) switch(hit) { case MCHT_TITLEBTNNEXT: - MONTHCAL_GoToPrevNextMonth(infoPtr, FALSE); + MONTHCAL_GoToMonth(infoPtr, DIRECTION_FORWARD); infoPtr->status = MC_NEXTPRESSED; SetTimer(infoPtr->hwndSelf, MC_PREVNEXTMONTHTIMER, MC_PREVNEXTMONTHDELAY, 0); InvalidateRect(infoPtr->hwndSelf, NULL, FALSE); return 0; case MCHT_TITLEBTNPREV: - MONTHCAL_GoToPrevNextMonth(infoPtr, TRUE); + MONTHCAL_GoToMonth(infoPtr, DIRECTION_BACKWARD); infoPtr->status = MC_PREVPRESSED; SetTimer(infoPtr->hwndSelf, MC_PREVNEXTMONTHTIMER, MC_PREVNEXTMONTHDELAY, 0); InvalidateRect(infoPtr->hwndSelf, NULL, FALSE); @@ -1970,22 +2003,33 @@ MONTHCAL_LButtonDown(MONTHCAL_INFO *infoPtr, LPARAM lParam) i = TrackPopupMenu(hMenu,TPM_LEFTALIGN | TPM_NONOTIFY | TPM_RIGHTBUTTON | TPM_RETURNCMD, menupoint.x, menupoint.y, 0, infoPtr->hwndSelf, NULL); - if ((i > 0) && (i < 13) && infoPtr->curSel.wMonth != i) + if ((i > 0) && (i < 13) && infoPtr->calendars[ht.iOffset].month.wMonth != i) { - infoPtr->curSel.wMonth = i; - MONTHCAL_IsDateInValidRange(infoPtr, &infoPtr->curSel, TRUE); - InvalidateRect(infoPtr->hwndSelf, NULL, FALSE); + INT delta = i - infoPtr->calendars[ht.iOffset].month.wMonth; + SYSTEMTIME st; + + /* check if change allowed by range set */ + st = delta < 0 ? infoPtr->calendars[0].month : + infoPtr->calendars[infoPtr->cal_num-1].month; + MONTHCAL_GetMonth(&st, delta); + + if (MONTHCAL_IsDateInValidRange(infoPtr, &st, FALSE)) + { + MONTHCAL_Scroll(infoPtr, delta); + MONTHCAL_NotifyDayState(infoPtr); + MONTHCAL_NotifySelectionChange(infoPtr); + InvalidateRect(infoPtr->hwndSelf, NULL, FALSE); + } } return 0; } case MCHT_TITLEYEAR: { - MONTHCAL_EditYear(infoPtr); + MONTHCAL_EditYear(infoPtr, ht.iOffset); return 0; } case MCHT_TODAYLINK: { - infoPtr->curSel = infoPtr->todaysDate; infoPtr->calendars[0].month = infoPtr->todaysDate; infoPtr->minSel = infoPtr->todaysDate; infoPtr->maxSel = infoPtr->todaysDate; @@ -2058,7 +2102,7 @@ MONTHCAL_LButtonUp(MONTHCAL_INFO *infoPtr, LPARAM lParam) if((hit & MCHT_CALENDARDATE) == MCHT_CALENDARDATE) { - SYSTEMTIME sel = infoPtr->curSel; + SYSTEMTIME sel = infoPtr->minSel; /* will be invalidated here */ MONTHCAL_SetCurSel(infoPtr, &ht.st); @@ -2081,8 +2125,8 @@ MONTHCAL_Timer(MONTHCAL_INFO *infoPtr, WPARAM id) switch(id) { case MC_PREVNEXTMONTHTIMER: - if(infoPtr->status & MC_NEXTPRESSED) MONTHCAL_GoToPrevNextMonth(infoPtr, FALSE); - if(infoPtr->status & MC_PREVPRESSED) MONTHCAL_GoToPrevNextMonth(infoPtr, TRUE); + if(infoPtr->status & MC_NEXTPRESSED) MONTHCAL_GoToMonth(infoPtr, DIRECTION_FORWARD); + if(infoPtr->status & MC_PREVPRESSED) MONTHCAL_GoToMonth(infoPtr, DIRECTION_BACKWARD); InvalidateRect(infoPtr->hwndSelf, NULL, FALSE); break; case MC_TODAYUPDATETIMER: @@ -2199,7 +2243,7 @@ MONTHCAL_EraseBkgnd(const MONTHCAL_INFO *infoPtr, HDC hdc) if (!GetClipBox(hdc, &rc)) return FALSE; /* fill background */ - hbr = CreateSolidBrush (infoPtr->bk); + hbr = CreateSolidBrush (infoPtr->colors[MCSC_BACKGROUND]); FillRect(hdc, &rc, hbr); DeleteObject(hbr); @@ -2374,8 +2418,6 @@ static LRESULT MONTHCAL_Size(MONTHCAL_INFO *infoPtr, int Width, int Height) TRACE("(width=%d, height=%d)\n", Width, Height); MONTHCAL_UpdateSize(infoPtr); - - /* invalidate client area and erase background */ InvalidateRect(infoPtr->hwndSelf, NULL, TRUE); return 0; @@ -2489,16 +2531,15 @@ MONTHCAL_Create(HWND hwnd, LPCREATESTRUCTW lpcs) infoPtr->monthdayState = Alloc(infoPtr->monthRange * sizeof(MONTHDAYSTATE)); if (!infoPtr->monthdayState) goto fail; - infoPtr->titlebk = comctl32_color.clrActiveCaption; - infoPtr->titletxt = comctl32_color.clrWindow; - infoPtr->monthbk = comctl32_color.clrWindow; - infoPtr->trailingtxt = comctl32_color.clrGrayText; - infoPtr->bk = comctl32_color.clrWindow; - infoPtr->txt = comctl32_color.clrWindowText; + infoPtr->colors[MCSC_BACKGROUND] = comctl32_color.clrWindow; + infoPtr->colors[MCSC_TEXT] = comctl32_color.clrWindowText; + infoPtr->colors[MCSC_TITLEBK] = comctl32_color.clrActiveCaption; + infoPtr->colors[MCSC_TITLETEXT] = comctl32_color.clrWindow; + infoPtr->colors[MCSC_MONTHBK] = comctl32_color.clrWindow; + infoPtr->colors[MCSC_TRAILINGTEXT] = comctl32_color.clrGrayText; infoPtr->minSel = infoPtr->todaysDate; infoPtr->maxSel = infoPtr->todaysDate; - infoPtr->curSel = infoPtr->todaysDate; infoPtr->calendars[0].month = infoPtr->todaysDate; infoPtr->isUnicode = TRUE; @@ -2545,16 +2586,12 @@ MONTHCAL_Notify(MONTHCAL_INFO *infoPtr, NMHDR *hdr) { NMUPDOWN *nmud = (NMUPDOWN*)hdr; - if (hdr->hwndFrom == infoPtr->hWndYearUpDown) + if (hdr->hwndFrom == infoPtr->hWndYearUpDown && nmud->iDelta) { /* year value limits are set up explicitly after updown creation */ - if ((nmud->iDelta + nmud->iPos) != infoPtr->curSel.wYear) - { - SYSTEMTIME new_date = infoPtr->curSel; - - new_date.wYear = nmud->iDelta + nmud->iPos; - MONTHCAL_SetCurSel(infoPtr, &new_date); - } + MONTHCAL_Scroll(infoPtr, 12 * nmud->iDelta); + MONTHCAL_NotifyDayState(infoPtr); + MONTHCAL_NotifySelectionChange(infoPtr); } } return 0; @@ -2577,11 +2614,10 @@ MONTHCAL_GetUnicodeFormat(const MONTHCAL_INFO *infoPtr) static LRESULT WINAPI MONTHCAL_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { - MONTHCAL_INFO *infoPtr; + MONTHCAL_INFO *infoPtr = (MONTHCAL_INFO *)GetWindowLongPtrW(hwnd, 0); TRACE("hwnd=%p msg=%x wparam=%lx lparam=%lx\n", hwnd, uMsg, wParam, lParam); - infoPtr = MONTHCAL_GetInfoPtr(hwnd); if (!infoPtr && (uMsg != WM_CREATE)) return DefWindowProcW(hwnd, uMsg, wParam, lParam); switch(uMsg) diff --git a/dll/win32/comctl32/pager.c b/dll/win32/comctl32/pager.c index f3461fde88d..e1420e06ab5 100644 --- a/dll/win32/comctl32/pager.c +++ b/dll/win32/comctl32/pager.c @@ -99,11 +99,7 @@ PAGER_GetButtonRects(const PAGER_INFO* infoPtr, RECT* prcTopLeft, RECT* prcBotto GetWindowRect (infoPtr->hwndSelf, &rcWindow); if (bClientCoords) - { - POINT pt = {rcWindow.left, rcWindow.top}; - ScreenToClient(infoPtr->hwndSelf, &pt); - OffsetRect(&rcWindow, -(rcWindow.left-pt.x), -(rcWindow.top-pt.y)); - } + MapWindowPoints( 0, infoPtr->hwndSelf, (POINT *)&rcWindow, 2 ); else OffsetRect(&rcWindow, -rcWindow.left, -rcWindow.top); diff --git a/dll/win32/comctl32/progress.c b/dll/win32/comctl32/progress.c index c44b816a2b8..71fba9d4c05 100644 --- a/dll/win32/comctl32/progress.c +++ b/dll/win32/comctl32/progress.c @@ -29,11 +29,6 @@ * * TODO: * - * Messages: - * -- PBM_GETSTEP - * -- PBM_SETSTATE - * -- PBM_GETSTATE - * * Styles: * -- PBS_SMOOTHREVERSE * @@ -380,8 +375,7 @@ static LRESULT PROGRESS_Draw (PROGRESS_INFO *infoPtr, HDC hdc) if (pdi.theme) { GetWindowRect( infoPtr->Self, &pdi.bgRect ); - ScreenToClient( infoPtr->Self, (POINT*)&pdi.bgRect ); - ScreenToClient( infoPtr->Self, (POINT*)&pdi.bgRect.right ); + MapWindowPoints( infoPtr->Self, 0, (POINT*)&pdi.bgRect, 2 ); } if (!barSmooth) @@ -663,6 +657,9 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message, return oldStep; } + case PBM_GETSTEP: + return infoPtr->Step; + case PBM_STEPIT: { INT oldVal; @@ -708,6 +705,14 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message, case PBM_GETBKCOLOR: return infoPtr->ColorBk; + case PBM_SETSTATE: + if(wParam != PBST_NORMAL) + FIXME("state %04lx not yet handled\n", wParam); + return PBST_NORMAL; + + case PBM_GETSTATE: + return PBST_NORMAL; + case PBM_SETMARQUEE: if(wParam != 0) { diff --git a/dll/win32/comctl32/propsheet.c b/dll/win32/comctl32/propsheet.c index 3e313bad59e..2172a8507ad 100644 --- a/dll/win32/comctl32/propsheet.c +++ b/dll/win32/comctl32/propsheet.c @@ -613,7 +613,7 @@ static INT_PTR PROPSHEET_CreateDialog(PropSheetInfo* psInfo) DWORD resSize; WORD resID = IDD_PROPSHEET; - TRACE("\n"); + TRACE("(%p)\n", psInfo); if (psInfo->ppshheader.dwFlags & INTRNL_ANY_WIZARD) resID = IDD_WIZARD; @@ -1074,18 +1074,13 @@ static PADDING_INFO PROPSHEET_GetPaddingInfo(HWND hwndDlg) { HWND hwndTab = GetDlgItem(hwndDlg, IDC_TABCONTROL); RECT rcTab; - POINT tl; PADDING_INFO padding; GetWindowRect(hwndTab, &rcTab); + MapWindowPoints( 0, hwndDlg, (POINT *)&rcTab, 2 ); - tl.x = rcTab.left; - tl.y = rcTab.top; - - ScreenToClient(hwndDlg, &tl); - - padding.x = tl.x; - padding.y = tl.y; + padding.x = rcTab.left; + padding.y = rcTab.top; return padding; } @@ -1131,21 +1126,17 @@ static PADDING_INFO PROPSHEET_GetPaddingInfoWizard(HWND hwndDlg, const PropSheet hwndControl = GetDlgItem(hwndDlg, idButton); GetWindowRect(hwndControl, &rc); - + MapWindowPoints( 0, hwndDlg, (POINT *)&rc, 2 ); ptButton.x = rc.left; ptButton.y = rc.top; - ScreenToClient(hwndDlg, &ptButton); - /* Line */ hwndControl = GetDlgItem(hwndDlg, IDC_SUNKEN_LINE); GetWindowRect(hwndControl, &rc); - + MapWindowPoints( 0, hwndDlg, (POINT *)&rc, 2 ); ptLine.x = rc.left; ptLine.y = rc.bottom; - ScreenToClient(hwndDlg, &ptLine); - padding.y = ptButton.y - ptLine.y; if (padding.y < 0) @@ -2421,6 +2412,28 @@ static BOOL PROPSHEET_RemovePage(HWND hwndDlg, return FALSE; } +BOOL CALLBACK +EnumChildProc(HWND hwnd, LPARAM lParam) +{ + WCHAR szType[20]; + RealGetWindowClassW(hwnd, szType, 20); + + if (strcmpW(szType, WC_EDITW) == 0) + { + if (IsWindowEnabled(hwnd) && IsWindowVisible(hwnd)) + { + SetFocus(hwnd); + return FALSE; + } + } + else + { + EnumChildWindows(hwnd, EnumChildProc, 0); + } + + return TRUE; +} + /****************************************************************************** * PROPSHEET_SetWizButtons * @@ -2442,17 +2455,6 @@ static void PROPSHEET_SetWizButtons(HWND hwndDlg, DWORD dwFlags) EnableWindow(hwndNext, FALSE); EnableWindow(hwndFinish, FALSE); - /* set the default pushbutton to an enabled button */ - if (((dwFlags & PSWIZB_FINISH) || psInfo->hasFinish) && !(dwFlags & PSWIZB_DISABLEDFINISH)) - SendMessageW(hwndDlg, DM_SETDEFID, IDC_FINISH_BUTTON, 0); - else if (dwFlags & PSWIZB_NEXT) - SendMessageW(hwndDlg, DM_SETDEFID, IDC_NEXT_BUTTON, 0); - else if (dwFlags & PSWIZB_BACK) - SendMessageW(hwndDlg, DM_SETDEFID, IDC_BACK_BUTTON, 0); - else - SendMessageW(hwndDlg, DM_SETDEFID, IDCANCEL, 0); - - if (dwFlags & PSWIZB_BACK) EnableWindow(hwndBack, TRUE); @@ -2482,6 +2484,31 @@ static void PROPSHEET_SetWizButtons(HWND hwndDlg, DWORD dwFlags) } else if (!(dwFlags & PSWIZB_DISABLEDFINISH)) EnableWindow(hwndFinish, TRUE); + + /* set the default pushbutton to an enabled button and give it focus */ + if (((dwFlags & PSWIZB_FINISH) || psInfo->hasFinish) && !(dwFlags & PSWIZB_DISABLEDFINISH)) + { + SendMessageW(hwndDlg, DM_SETDEFID, IDC_FINISH_BUTTON, 0); + SetFocus(hwndFinish); + } + else if (dwFlags & PSWIZB_NEXT) + { + SendMessageW(hwndDlg, DM_SETDEFID, IDC_NEXT_BUTTON, 0); + SetFocus(hwndNext); + } + else if (dwFlags & PSWIZB_BACK) + { + SendMessageW(hwndDlg, DM_SETDEFID, IDC_BACK_BUTTON, 0); + SetFocus(hwndBack); + } + else + { + SendMessageW(hwndDlg, DM_SETDEFID, IDCANCEL, 0); + SetFocus(GetDlgItem(hwndDlg, IDCANCEL)); + } + + /* Now try to find an edit control that deserves focus */ + EnumChildWindows(PropSheet_GetCurrentPageHwnd(hwndDlg), EnumChildProc, 0); } /****************************************************************************** @@ -3415,10 +3442,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { /* set up the Next and Back buttons by default */ PROPSHEET_SetWizButtons(hwnd, PSWIZB_BACK|PSWIZB_NEXT); - SetFocus(GetDlgItem(hwnd, IDC_NEXT_BUTTON)); } - else - SetFocus(GetDlgItem(hwnd, IDOK)); /* Set up fonts */ SystemParametersInfoW (SPI_GETICONTITLELOGFONT, 0, &logFont, 0); @@ -3464,6 +3488,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ShowWindow(hwndTabCtrl, SW_HIDE); PROPSHEET_AdjustSizeWizard(hwnd, psInfo); PROPSHEET_AdjustButtonsWizard(hwnd, psInfo); + SetFocus(GetDlgItem(hwnd, IDC_NEXT_BUTTON)); } else { @@ -3472,6 +3497,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) PROPSHEET_AdjustSize(hwnd, psInfo); PROPSHEET_AdjustButtons(hwnd, psInfo); } + SetFocus(GetDlgItem(hwnd, IDOK)); } if (IS_INTRESOURCE(psInfo->ppshheader.pszCaption) && diff --git a/dll/win32/comctl32/rebar.c b/dll/win32/comctl32/rebar.c index c254e34d8df..8e9c38b7a79 100644 --- a/dll/win32/comctl32/rebar.c +++ b/dll/win32/comctl32/rebar.c @@ -1180,8 +1180,6 @@ static void REBAR_SetRowRectsX(const REBAR_INFO *infoPtr, INT iBeginBand, INT iE for (i = iBeginBand; i < iEndBand; i = next_visible(infoPtr, i)) { REBAR_BAND *lpBand = REBAR_GetBand(infoPtr, i); - - lpBand = REBAR_GetBand(infoPtr, i); if (lpBand->rcBand.left != xPos || lpBand->rcBand.right != xPos + lpBand->cxEffective) { lpBand->fDraw |= NTF_INVALIDATE; TRACE("Setting rect %d to %d,%d\n", i, xPos, xPos + lpBand->cxEffective); @@ -1264,6 +1262,57 @@ static int REBAR_ShrinkBandsLTR(const REBAR_INFO *infoPtr, INT iBeginBand, INT i return cxShrink; } +/* Tries to move a band to a given offset within a row. */ +static int REBAR_MoveBandToRowOffset(REBAR_INFO *infoPtr, INT iBand, INT iFirstBand, + INT iLastBand, INT xOff, BOOL reorder) +{ + REBAR_BAND *insertBand = REBAR_GetBand(infoPtr, iBand); + int xPos = 0, i; + const BOOL setBreak = REBAR_GetBand(infoPtr, iFirstBand)->fStyle & RBBS_BREAK; + + /* Find the band's new position */ + if(reorder) + { + /* Used during an LR band reorder drag */ + for (i = iFirstBand; i < iLastBand; i = next_visible(infoPtr, i)) + { + if(xPos > xOff) + break; + xPos += REBAR_GetBand(infoPtr, i)->cxEffective + SEP_WIDTH; + } + } + else + { + /* Used during a UD band insertion drag */ + for (i = iFirstBand; i < iLastBand; i = next_visible(infoPtr, i)) + { + const REBAR_BAND *band = REBAR_GetBand(infoPtr, i); + if(xPos + band->cxMinBand / 2 > xOff) + break; + xPos += band->cxEffective + SEP_WIDTH; + } + } + + /* Move the band to its new position */ + DPA_DeletePtr(infoPtr->bands, iBand); + if(i > iBand) + i--; + DPA_InsertPtr(infoPtr->bands, i, insertBand); + + /* Ensure only the last band has the RBBS_BREAK flag set */ + insertBand->fStyle &= ~RBBS_BREAK; + if(setBreak) + REBAR_GetBand(infoPtr, iFirstBand)->fStyle |= RBBS_BREAK; + + /* Return the currently grabbed band */ + if(infoPtr->iGrabbedBand == iBand) + { + infoPtr->iGrabbedBand = i; + return i; + } + else return -1; +} + /* Set the heights of the visible bands in [iBeginBand; iEndBand) to the max height. iBeginBand must be visible */ static int REBAR_SetBandsHeight(const REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand, INT yStart) { @@ -2002,26 +2051,11 @@ REBAR_HandleLRDrag (REBAR_INFO *infoPtr, const POINT *ptsmove) /* Gripper drag within a row. It will not implement "out- */ /* of-row" drags. (They are detected and handled in */ /* REBAR_MouseMove.) */ - /* **** FIXME Switching order of bands in a row not **** */ - /* **** yet implemented. **** */ { REBAR_BAND *hitBand; INT iHitBand, iRowBegin, iRowEnd; - INT movement, xBand; - - /* on first significant mouse movement, issue notify */ - if (!(infoPtr->fStatus & BEGIN_DRAG_ISSUED)) { - if (REBAR_Notify_NMREBAR (infoPtr, -1, RBN_BEGINDRAG)) { - /* Notify returned TRUE - abort drag */ - infoPtr->dragStart.x = 0; - infoPtr->dragStart.y = 0; - infoPtr->dragNow = infoPtr->dragStart; - infoPtr->iGrabbedBand = -1; - ReleaseCapture (); - return ; - } - infoPtr->fStatus |= BEGIN_DRAG_ISSUED; - } + INT movement, xBand, cxLeft = 0; + BOOL shrunkBands = FALSE; iHitBand = infoPtr->iGrabbedBand; iRowBegin = get_row_begin_for_band(infoPtr, iHitBand); @@ -2032,21 +2066,44 @@ REBAR_HandleLRDrag (REBAR_INFO *infoPtr, const POINT *ptsmove) movement = (infoPtr->dwStyle&CCS_VERT ? ptsmove->y : ptsmove->x) - (xBand + REBAR_PRE_GRIPPER - infoPtr->ihitoffset); - if (movement < 0) { - INT cxLeft = REBAR_ShrinkBandsRTL(infoPtr, iRowBegin, iHitBand, -movement, TRUE); - hitBand->cxEffective += -movement - cxLeft; - hitBand->cx = hitBand->cxEffective; - } else if (movement > 0) { - INT prev; + /* Dragging the first band in a row cannot cause shrinking */ + if(iHitBand != iRowBegin) + { + if (movement < 0) { + cxLeft = REBAR_ShrinkBandsRTL(infoPtr, iRowBegin, iHitBand, -movement, TRUE); + + if(cxLeft < -movement) + { + hitBand->cxEffective += -movement - cxLeft; + hitBand->cx = hitBand->cxEffective; + shrunkBands = TRUE; + } + + } else if (movement > 0) { + + cxLeft = movement; + if (prev_visible(infoPtr, iHitBand) >= 0) + cxLeft = REBAR_ShrinkBandsLTR(infoPtr, iHitBand, iRowEnd, movement, TRUE); + + if(cxLeft < movement) + { + REBAR_BAND *lpPrev = REBAR_GetBand(infoPtr, prev_visible(infoPtr, iHitBand)); + lpPrev->cxEffective += movement - cxLeft; + lpPrev->cx = hitBand->cxEffective; + shrunkBands = TRUE; + } - if ((prev = prev_visible(infoPtr, iHitBand)) >= 0) { - INT cxLeft = REBAR_ShrinkBandsLTR(infoPtr, iHitBand, iRowEnd, movement, TRUE); - REBAR_BAND *lpPrev = REBAR_GetBand(infoPtr, prev_visible(infoPtr, iHitBand)); - lpPrev->cxEffective += movement - cxLeft; - lpPrev->cx = lpPrev->cxEffective; } } + if(!shrunkBands) + { + /* It was not possible to move the band by shrinking bands. + * Try relocating the band instead. */ + REBAR_MoveBandToRowOffset(infoPtr, iHitBand, iRowBegin, + iRowEnd, xBand + movement, TRUE); + } + REBAR_SetRowRectsX(infoPtr, iRowBegin, iRowEnd); if (infoPtr->dwStyle & CCS_VERT) REBAR_CalcVertBand(infoPtr, 0, infoPtr->uNumBands); @@ -2055,6 +2112,71 @@ REBAR_HandleLRDrag (REBAR_INFO *infoPtr, const POINT *ptsmove) REBAR_MoveChildWindows(infoPtr, iRowBegin, iRowEnd); } +static void +REBAR_HandleUDDrag (REBAR_INFO *infoPtr, const POINT *ptsmove) +{ + INT yOff = (infoPtr->dwStyle & CCS_VERT) ? ptsmove->x : ptsmove->y; + INT iHitBand, iRowBegin, iNextRowBegin; + REBAR_BAND *hitBand, *rowBeginBand; + + if(infoPtr->uNumBands <= 0) + ERR("There are no bands in this rebar"); + + /* Up/down dragging can only occur when there is more than one + * band in the rebar */ + if(infoPtr->uNumBands <= 1) + return; + + iHitBand = infoPtr->iGrabbedBand; + hitBand = REBAR_GetBand(infoPtr, iHitBand); + + /* If we're taking a band that has the RBBS_BREAK style set, this + * style needs to be reapplied to the band that is going to become + * the new start of the row. */ + if((hitBand->fStyle & RBBS_BREAK) && + (iHitBand < infoPtr->uNumBands - 1)) + REBAR_GetBand(infoPtr, iHitBand + 1)->fStyle |= RBBS_BREAK; + + if(yOff < 0) + { + /* Place the band above the current top row */ + DPA_DeletePtr(infoPtr->bands, iHitBand); + hitBand->fStyle &= RBBS_BREAK; + REBAR_GetBand(infoPtr, 0)->fStyle |= RBBS_BREAK; + infoPtr->iGrabbedBand = DPA_InsertPtr( + infoPtr->bands, 0, hitBand); + } + else if(yOff > REBAR_GetBand(infoPtr, infoPtr->uNumBands - 1)->rcBand.bottom) + { + /* Place the band below the current bottom row */ + DPA_DeletePtr(infoPtr->bands, iHitBand); + hitBand->fStyle |= RBBS_BREAK; + infoPtr->iGrabbedBand = DPA_InsertPtr( + infoPtr->bands, infoPtr->uNumBands - 1, hitBand); + } + else + { + /* Place the band in the prexisting row the mouse is hovering over */ + iRowBegin = first_visible(infoPtr); + while(iRowBegin < infoPtr->uNumBands) + { + iNextRowBegin = get_row_end_for_band(infoPtr, iRowBegin); + rowBeginBand = REBAR_GetBand(infoPtr, iRowBegin); + if(rowBeginBand->rcBand.bottom > yOff) + { + REBAR_MoveBandToRowOffset( + infoPtr, iHitBand, iRowBegin, iNextRowBegin, + ((infoPtr->dwStyle & CCS_VERT) ? ptsmove->y : ptsmove->x) + - REBAR_PRE_GRIPPER - infoPtr->ihitoffset, FALSE); + break; + } + + iRowBegin = iNextRowBegin; + } + } + + REBAR_Layout(infoPtr); +} /* << REBAR_BeginDrag >> */ @@ -2397,7 +2519,7 @@ REBAR_IdToIndex (const REBAR_INFO *infoPtr, UINT uId) static LRESULT -REBAR_InsertBandT(REBAR_INFO *infoPtr, INT iIndex, LPREBARBANDINFOW lprbbi, BOOL bUnicode) +REBAR_InsertBandT(REBAR_INFO *infoPtr, INT iIndex, const REBARBANDINFOW *lprbbi, BOOL bUnicode) { REBAR_BAND *lpBand; @@ -2613,7 +2735,7 @@ REBAR_strdifW( LPCWSTR a, LPCWSTR b ) } static LRESULT -REBAR_SetBandInfoT(REBAR_INFO *infoPtr, INT iBand, LPREBARBANDINFOW lprbbi, BOOL bUnicode) +REBAR_SetBandInfoT(REBAR_INFO *infoPtr, INT iBand, const REBARBANDINFOW *lprbbi, BOOL bUnicode) { REBAR_BAND *lpBand; UINT uChanged; @@ -2661,7 +2783,7 @@ REBAR_SetBandInfoT(REBAR_INFO *infoPtr, INT iBand, LPREBARBANDINFOW lprbbi, BOOL static LRESULT -REBAR_SetBarInfo (REBAR_INFO *infoPtr, LPREBARINFO lpInfo) +REBAR_SetBarInfo (REBAR_INFO *infoPtr, const REBARINFO *lpInfo) { REBAR_BAND *lpBand; UINT i; @@ -3025,25 +3147,36 @@ REBAR_MouseMove (REBAR_INFO *infoPtr, LPARAM lParam) /* if we are currently dragging a band */ if (infoPtr->iGrabbedBand >= 0) { - REBAR_BAND *band1 = NULL, *band2; + REBAR_BAND *band; int yPtMove = (infoPtr->dwStyle & CCS_VERT ? ptMove.x : ptMove.y); if (GetCapture() != infoPtr->hwndSelf) ERR("We are dragging but haven't got capture?!?\n"); - if (infoPtr->iGrabbedBand > 0) - band1 = REBAR_GetBand(infoPtr, infoPtr->iGrabbedBand - 1); - band2 = REBAR_GetBand(infoPtr, infoPtr->iGrabbedBand); + band = REBAR_GetBand(infoPtr, infoPtr->iGrabbedBand); /* if mouse did not move much, exit */ if ((abs(ptMove.x - infoPtr->dragNow.x) <= mindragx) && (abs(ptMove.y - infoPtr->dragNow.y) <= mindragy)) return 0; + /* on first significant mouse movement, issue notify */ + if (!(infoPtr->fStatus & BEGIN_DRAG_ISSUED)) { + if (REBAR_Notify_NMREBAR (infoPtr, -1, RBN_BEGINDRAG)) { + /* Notify returned TRUE - abort drag */ + infoPtr->dragStart.x = 0; + infoPtr->dragStart.y = 0; + infoPtr->dragNow = infoPtr->dragStart; + infoPtr->iGrabbedBand = -1; + ReleaseCapture (); + return 0; + } + infoPtr->fStatus |= BEGIN_DRAG_ISSUED; + } + /* Test for valid drag case - must not be first band in row */ - if ((yPtMove < band2->rcBand.top) || - (yPtMove > band2->rcBand.bottom) || - ((infoPtr->iGrabbedBand > 0) && (band1->iRow != band2->iRow))) { - FIXME("Cannot drag to other rows yet!!\n"); + if ((yPtMove < band->rcBand.top) || + (yPtMove > band->rcBand.bottom)) { + REBAR_HandleUDDrag (infoPtr, &ptMove); } else { REBAR_HandleLRDrag (infoPtr, &ptMove); @@ -3126,7 +3259,7 @@ REBAR_NCCalcSize (const REBAR_INFO *infoPtr, RECT *rect) static LRESULT -REBAR_NCCreate (HWND hwnd, LPCREATESTRUCTW cs) +REBAR_NCCreate (HWND hwnd, const CREATESTRUCTW *cs) { REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd); RECT wnrc1, clrc1; diff --git a/dll/win32/comctl32/rsrc.rc b/dll/win32/comctl32/rsrc.rc index a95d0fb531c..903c147bf55 100644 --- a/dll/win32/comctl32/rsrc.rc +++ b/dll/win32/comctl32/rsrc.rc @@ -94,10 +94,9 @@ IDI_TT_ERROR_SM ICON idi_tt_error_sm.ico #include "comctl_Cs.rc" #include "comctl_El.rc" #include "comctl_En.rc" +#include "comctl_Eo.rc" #include "comctl_Es.rc" #include "comctl_Hu.rc" -#include "comctl_It.rc" -#include "comctl_Ko.rc" #include "comctl_Nl.rc" #include "comctl_No.rc" #include "comctl_Pl.rc" @@ -111,7 +110,10 @@ IDI_TT_ERROR_SM ICON idi_tt_error_sm.ico #include "comctl_Da.rc" #include "comctl_De.rc" #include "comctl_Fr.rc" +#include "comctl_He.rc" +#include "comctl_It.rc" #include "comctl_Ja.rc" +#include "comctl_Ko.rc" #include "comctl_Lt.rc" #include "comctl_Pt.rc" #include "comctl_Ro.rc" diff --git a/dll/win32/comctl32/status.c b/dll/win32/comctl32/status.c index 1b69ef2d053..eeaf299f6b3 100644 --- a/dll/win32/comctl32/status.c +++ b/dll/win32/comctl32/status.c @@ -1047,7 +1047,10 @@ STATUSBAR_WMNCHitTest (const STATUS_INFO *infoPtr, INT x, INT y) rect.top += 2; if (PtInRect (&rect, pt)) - return HTBOTTOMRIGHT; + { + if (GetWindowLongW( infoPtr->Self, GWL_EXSTYLE ) & WS_EX_LAYOUTRTL) return HTBOTTOMLEFT; + else return HTBOTTOMRIGHT; + } } return HTERROR; diff --git a/dll/win32/comctl32/tab.c b/dll/win32/comctl32/tab.c index c99153eea31..fe82d59e90f 100644 --- a/dll/win32/comctl32/tab.c +++ b/dll/win32/comctl32/tab.c @@ -83,8 +83,10 @@ typedef struct BYTE extra[1]; /* Space for caller supplied info, variable size */ } TAB_ITEM; -/* The size of a tab item depends on how much extra data is requested */ -#define TAB_ITEM_SIZE(infoPtr) (FIELD_OFFSET(TAB_ITEM, extra[(infoPtr)->cbInfo])) +/* The size of a tab item depends on how much extra data is requested. + TCM_INSERTITEM always stores at least LPARAM sized data. */ +#define EXTRA_ITEM_SIZE(infoPtr) (max((infoPtr)->cbInfo, sizeof(LPARAM))) +#define TAB_ITEM_SIZE(infoPtr) FIELD_OFFSET(TAB_ITEM, extra[EXTRA_ITEM_SIZE(infoPtr)]) typedef struct { @@ -1163,14 +1165,14 @@ static void TAB_SetItemBounds (TAB_INFO *infoPtr) if (!(infoPtr->fHeightSet)) { int item_height; - int icon_height = 0; + INT icon_height = 0, cx; /* Use the current font to determine the height of a tab. */ GetTextMetricsW(hdc, &fontMetrics); /* Get the icon height */ if (infoPtr->himl) - ImageList_GetIconSize(infoPtr->himl, 0, &icon_height); + ImageList_GetIconSize(infoPtr->himl, &cx, &icon_height); /* Take the highest between font or icon */ if (fontMetrics.tmHeight > icon_height) @@ -1195,7 +1197,9 @@ static void TAB_SetItemBounds (TAB_INFO *infoPtr) /* Get the icon width */ if (infoPtr->himl) { - ImageList_GetIconSize(infoPtr->himl, &icon_width, 0); + INT cy; + + ImageList_GetIconSize(infoPtr->himl, &icon_width, &cy); if (infoPtr->dwStyle & TCS_FIXEDWIDTH) icon_width += 4; @@ -1726,7 +1730,7 @@ TAB_DrawItemInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem, RECT *drawRect /* * if owner draw, tell the owner to draw */ - if ((infoPtr->dwStyle & TCS_OWNERDRAWFIXED) && GetParent(infoPtr->hwnd)) + if ((infoPtr->dwStyle & TCS_OWNERDRAWFIXED) && IsWindow(infoPtr->hwndNotify)) { DRAWITEMSTRUCT dis; UINT id; @@ -1739,14 +1743,9 @@ TAB_DrawItemInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem, RECT *drawRect drawRect->left += 1; } - /* - * get the control id - */ id = (UINT)GetWindowLongPtrW( infoPtr->hwnd, GWLP_ID ); - /* - * put together the DRAWITEMSTRUCT - */ + /* fill DRAWITEMSTRUCT */ dis.CtlType = ODT_TAB; dis.CtlID = id; dis.itemID = iItem; @@ -1759,11 +1758,18 @@ TAB_DrawItemInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem, RECT *drawRect dis.hwndItem = infoPtr->hwnd; dis.hDC = hdc; CopyRect(&dis.rcItem,drawRect); - dis.itemData = (ULONG_PTR)TAB_GetItem(infoPtr, iItem)->extra; - /* - * send the draw message - */ + /* when extra data fits ULONG_PTR, store it directly */ + if (infoPtr->cbInfo > sizeof(LPARAM)) + dis.itemData = (ULONG_PTR) TAB_GetItem(infoPtr, iItem)->extra; + else + { + /* this could be considered broken on 64 bit, but that's how it works - + only first 4 bytes are copied */ + memcpy(&dis.itemData, (ULONG_PTR*)TAB_GetItem(infoPtr, iItem)->extra, 4); + } + + /* draw notification */ SendMessageW( infoPtr->hwndNotify, WM_DRAWITEM, id, (LPARAM)&dis ); } else @@ -2620,7 +2626,7 @@ static inline LRESULT TAB_Paint (TAB_INFO *infoPtr, HDC hdcPaint) } static LRESULT -TAB_InsertItemT (TAB_INFO *infoPtr, INT iItem, TCITEMW *pti, BOOL bUnicode) +TAB_InsertItemT (TAB_INFO *infoPtr, INT iItem, const TCITEMW *pti, BOOL bUnicode) { TAB_ITEM *item; RECT rect; @@ -2684,10 +2690,10 @@ TAB_InsertItemT (TAB_INFO *infoPtr, INT iItem, TCITEMW *pti, BOOL bUnicode) item->iImage = -1; if (pti->mask & TCIF_PARAM) - memcpy(item->extra, &pti->lParam, infoPtr->cbInfo); + memcpy(item->extra, &pti->lParam, EXTRA_ITEM_SIZE(infoPtr)); else - memset(item->extra, 0, infoPtr->cbInfo); - + memset(item->extra, 0, EXTRA_ITEM_SIZE(infoPtr)); + TAB_SetItemBounds(infoPtr); if (infoPtr->uNumItem > 1) TAB_InvalidateTabArea(infoPtr); @@ -3188,15 +3194,8 @@ TAB_SetItemExtra (TAB_INFO *infoPtr, INT cbInfo) { TRACE("(%p %d)\n", infoPtr, cbInfo); - if (cbInfo <= 0) - return FALSE; + if (cbInfo < 0 || infoPtr->uNumItem) return FALSE; - if (infoPtr->uNumItem) - { - /* FIXME: MSDN says this is not allowed, but this hasn't been verified */ - return FALSE; - } - infoPtr->cbInfo = cbInfo; return TRUE; } diff --git a/dll/win32/comctl32/toolbar.c b/dll/win32/comctl32/toolbar.c index 9b41732c289..0b9dec24ee0 100644 --- a/dll/win32/comctl32/toolbar.c +++ b/dll/win32/comctl32/toolbar.c @@ -2900,13 +2900,27 @@ TOOLBAR_AddStringW (TOOLBAR_INFO *infoPtr, HINSTANCE hInstance, LPARAM lParam) BOOL fFirstString = (infoPtr->nNumStrings == 0); INT nIndex = infoPtr->nNumStrings; - if (hInstance && IS_INTRESOURCE(lParam)) { + TRACE("%p, %lx\n", hInstance, lParam); + + if (IS_INTRESOURCE(lParam)) { WCHAR szString[MAX_RESOURCE_STRING_LENGTH]; WCHAR delimiter; WCHAR *next_delim; + HRSRC hrsrc; WCHAR *p; INT len; - TRACE("adding string from resource!\n"); + + TRACE("adding string from resource\n"); + + if (!hInstance) return -1; + + hrsrc = FindResourceW( hInstance, MAKEINTRESOURCEW((LOWORD(lParam) >> 4) + 1), + (LPWSTR)RT_STRING ); + if (!hrsrc) + { + TRACE("string not found in resources\n"); + return -1; + } len = LoadStringW (hInstance, (UINT)lParam, szString, MAX_RESOURCE_STRING_LENGTH); @@ -2915,7 +2929,7 @@ TOOLBAR_AddStringW (TOOLBAR_INFO *infoPtr, HINSTANCE hInstance, LPARAM lParam) if (len == 0 || len == 1) return nIndex; - TRACE("Delimiter: 0x%x\n", *szString); + TRACE("delimiter: 0x%x\n", *szString); delimiter = *szString; p = szString + 1; @@ -2941,7 +2955,7 @@ TOOLBAR_AddStringW (TOOLBAR_INFO *infoPtr, HINSTANCE hInstance, LPARAM lParam) if (p == NULL) return -1; - TRACE("adding string(s) from array!\n"); + TRACE("adding string(s) from array\n"); while (*p) { len = strlenW (p); @@ -2968,14 +2982,16 @@ TOOLBAR_AddStringA (TOOLBAR_INFO *infoPtr, HINSTANCE hInstance, LPARAM lParam) INT nIndex; INT len; - if (hInstance && IS_INTRESOURCE(lParam)) /* load from resources */ + TRACE("%p, %lx\n", hInstance, lParam); + + if (IS_INTRESOURCE(lParam)) /* load from resources */ return TOOLBAR_AddStringW(infoPtr, hInstance, lParam); p = (LPSTR)lParam; if (p == NULL) return -1; - TRACE("adding string(s) from array!\n"); + TRACE("adding string(s) from array\n"); nIndex = infoPtr->nNumStrings; while (*p) { len = strlen (p); @@ -3033,7 +3049,7 @@ TOOLBAR_AutoSize (TOOLBAR_INFO *infoPtr) if ((infoPtr->dwStyle & CCS_BOTTOM) == CCS_NOMOVEY) { GetWindowRect(infoPtr->hwndSelf, &window_rect); - ScreenToClient(parent, (LPPOINT)&window_rect.left); + MapWindowPoints( 0, parent, (POINT *)&window_rect, 2 ); y = window_rect.top; } if ((infoPtr->dwStyle & CCS_BOTTOM) == CCS_BOTTOM) diff --git a/dll/win32/comctl32/tooltips.c b/dll/win32/comctl32/tooltips.c index 688d3b5ec44..49e20cf3515 100644 --- a/dll/win32/comctl32/tooltips.c +++ b/dll/win32/comctl32/tooltips.c @@ -636,7 +636,8 @@ TOOLTIPS_Show (TOOLTIPS_INFO *infoPtr, BOOL track_activate) if (!(style & TTS_BALLOON)) rect.top -= (size.cy / 2); } - infoPtr->bToolBelow = TRUE; + if (!(infoPtr->bToolBelow = (infoPtr->yTrackPos + size.cy <= GetSystemMetrics(SM_CYSCREEN)))) + rect.top -= size.cy; if (!(toolPtr->uFlags & TTF_ABSOLUTE)) { @@ -1430,7 +1431,7 @@ TOOLTIPS_HitTestT (const TOOLTIPS_INFO *infoPtr, LPTTHITTESTINFOW lptthit, static LRESULT -TOOLTIPS_NewToolRectT (TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti, BOOL isW) +TOOLTIPS_NewToolRectT (TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti) { INT nTool; @@ -1840,15 +1841,7 @@ TOOLTIPS_UpdateTipTextT (TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti, BOOL isW static LRESULT -TOOLTIPS_WindowFromPoint (HWND hwnd, WPARAM wParam, LPARAM lParam) -{ - return (LRESULT)WindowFromPoint (*((LPPOINT)lParam)); -} - - - -static LRESULT -TOOLTIPS_Create (HWND hwnd, const CREATESTRUCTW *lpcs) +TOOLTIPS_Create (HWND hwnd) { TOOLTIPS_INFO *infoPtr; @@ -1944,7 +1937,7 @@ TOOLTIPS_MouseMessage (TOOLTIPS_INFO *infoPtr) static LRESULT -TOOLTIPS_NCCreate (HWND hwnd, const CREATESTRUCTW *lpcs) +TOOLTIPS_NCCreate (HWND hwnd) { DWORD dwStyle = GetWindowLongW (hwnd, GWL_STYLE); DWORD dwExStyle = GetWindowLongW (hwnd, GWL_EXSTYLE); @@ -1986,7 +1979,32 @@ TOOLTIPS_NCHitTest (const TOOLTIPS_INFO *infoPtr, WPARAM wParam, LPARAM lParam) static LRESULT TOOLTIPS_NotifyFormat (TOOLTIPS_INFO *infoPtr, WPARAM wParam, LPARAM lParam) { - FIXME ("hwnd=%p wParam=%lx lParam=%lx\n", infoPtr->hwndSelf, wParam, lParam); + TTTOOL_INFO *toolPtr = infoPtr->tools; + LRESULT nResult; + + TRACE("infoPtr=%p wParam=%lx lParam=%p\n", infoPtr, wParam, (PVOID)lParam); + + if (lParam == NF_QUERY) { + if (toolPtr->bNotifyUnicode) { + return NFR_UNICODE; + } else { + return NFR_ANSI; + } + } + else if (lParam == NF_REQUERY) { + nResult = SendMessageW (toolPtr->hwnd, WM_NOTIFYFORMAT, + (WPARAM)infoPtr->hwndSelf, (LPARAM)NF_QUERY); + if (nResult == NFR_ANSI) { + toolPtr->bNotifyUnicode = FALSE; + TRACE(" -- WM_NOTIFYFORMAT returns: NFR_ANSI\n"); + } else if (nResult == NFR_UNICODE) { + toolPtr->bNotifyUnicode = TRUE; + TRACE(" -- WM_NOTIFYFORMAT returns: NFR_UNICODE\n"); + } else { + TRACE (" -- WM_NOTIFYFORMAT returns: error!\n"); + } + return nResult; + } return 0; } @@ -2220,8 +2238,8 @@ TOOLTIPS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) uMsg == TTM_HITTESTW); case TTM_NEWTOOLRECTA: case TTM_NEWTOOLRECTW: - return TOOLTIPS_NewToolRectT (infoPtr, (LPTTTOOLINFOW)lParam, - uMsg == TTM_NEWTOOLRECTW); + return TOOLTIPS_NewToolRectT (infoPtr, (LPTTTOOLINFOW)lParam); + case TTM_POP: return TOOLTIPS_Pop (infoPtr); @@ -2268,11 +2286,10 @@ TOOLTIPS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) uMsg == TTM_UPDATETIPTEXTW); case TTM_WINDOWFROMPOINT: - return TOOLTIPS_WindowFromPoint (hwnd, wParam, lParam); - + return (LRESULT)WindowFromPoint (*((LPPOINT)lParam)); case WM_CREATE: - return TOOLTIPS_Create (hwnd, (LPCREATESTRUCTW)lParam); + return TOOLTIPS_Create (hwnd); case WM_DESTROY: return TOOLTIPS_Destroy (infoPtr); @@ -2300,7 +2317,7 @@ TOOLTIPS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return TOOLTIPS_MouseMessage (infoPtr); case WM_NCCREATE: - return TOOLTIPS_NCCreate (hwnd, (LPCREATESTRUCTW)lParam); + return TOOLTIPS_NCCreate (hwnd); case WM_NCHITTEST: return TOOLTIPS_NCHitTest (infoPtr, wParam, lParam); diff --git a/dll/win32/comctl32/treeview.c b/dll/win32/comctl32/treeview.c index c3b43c4ad13..de692bc1674 100644 --- a/dll/win32/comctl32/treeview.c +++ b/dll/win32/comctl32/treeview.c @@ -33,7 +33,8 @@ * * missing styles: TVS_FULLROWSELECT, TVS_INFOTIP, TVS_RTLREADING, * - * missing item styles: TVIS_CUT, TVIS_EXPANDPARTIAL + * missing item styles: TVIS_CUT, TVIS_EXPANDPARTIAL, TVIS_EX_FLAT, + * TVIS_EX_DISABLED * * Make the insertion mark look right. * Scroll (instead of repaint) as much as possible. @@ -69,6 +70,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(treeview); typedef struct _TREEITEM /* HTREEITEM is a _TREEINFO *. */ { + HTREEITEM parent; /* handle to parent or 0 if at root */ + HTREEITEM nextSibling; /* handle to next item in list, 0 if last */ + HTREEITEM firstChild; /* handle to first child or 0 if no child */ + UINT callbackMask; UINT state; UINT stateMask; @@ -81,11 +86,8 @@ typedef struct _TREEITEM /* HTREEITEM is a _TREEINFO *. */ LPARAM lParam; int iIntegral; /* item height multiplier (1 is normal) */ int iLevel; /* indentation level:0=root level */ - HTREEITEM parent; /* handle to parent or 0 if at root */ - HTREEITEM firstChild; /* handle to first child or 0 if no child */ HTREEITEM lastChild; HTREEITEM prevSibling; /* handle to prev item in list, 0 if first */ - HTREEITEM nextSibling; /* handle to next item in list, 0 if last */ RECT rect; LONG linesOffset; LONG stateOffset; @@ -488,10 +490,10 @@ static INT get_notifycode(const TREEVIEW_INFO *infoPtr, INT code) } static inline BOOL -TREEVIEW_SendRealNotify(const TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam) +TREEVIEW_SendRealNotify(const TREEVIEW_INFO *infoPtr, WPARAM wParam, LPNMHDR pnmh) { - TRACE("wParam=%ld, lParam=%ld\n", wParam, lParam); - return SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, wParam, lParam); + TRACE("wParam=%ld, lParam=%p\n", wParam, pnmh); + return SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, wParam, (LPARAM)pnmh); } static BOOL @@ -505,7 +507,7 @@ TREEVIEW_SendSimpleNotify(const TREEVIEW_INFO *infoPtr, UINT code) nmhdr.idFrom = GetWindowLongPtrW(hwnd, GWLP_ID); nmhdr.code = get_notifycode(infoPtr, code); - return TREEVIEW_SendRealNotify(infoPtr, nmhdr.idFrom, (LPARAM)&nmhdr); + return TREEVIEW_SendRealNotify(infoPtr, nmhdr.idFrom, &nmhdr); } static VOID @@ -568,7 +570,7 @@ TREEVIEW_SendTreeviewNotify(const TREEVIEW_INFO *infoPtr, UINT code, UINT action nmhdr.ptDrag.x = 0; nmhdr.ptDrag.y = 0; - ret = TREEVIEW_SendRealNotify(infoPtr, nmhdr.hdr.idFrom, (LPARAM)&nmhdr); + ret = TREEVIEW_SendRealNotify(infoPtr, nmhdr.hdr.idFrom, &nmhdr.hdr); if (!infoPtr->bNtfUnicode) { Free(nmhdr.itemOld.pszText); @@ -598,7 +600,7 @@ TREEVIEW_SendTreeviewDnDNotify(const TREEVIEW_INFO *infoPtr, UINT code, nmhdr.ptDrag.x = pt.x; nmhdr.ptDrag.y = pt.y; - return TREEVIEW_SendRealNotify(infoPtr, nmhdr.hdr.idFrom, (LPARAM)&nmhdr); + return TREEVIEW_SendRealNotify(infoPtr, nmhdr.hdr.idFrom, &nmhdr.hdr); } @@ -626,7 +628,7 @@ TREEVIEW_SendCustomDrawNotify(const TREEVIEW_INFO *infoPtr, DWORD dwDrawStage, nmcdhdr.clrTextBk = infoPtr->clrBk; nmcdhdr.iLevel = 0; - return TREEVIEW_SendRealNotify(infoPtr, nmcd->hdr.idFrom, (LPARAM)&nmcdhdr); + return TREEVIEW_SendRealNotify(infoPtr, nmcd->hdr.idFrom, &nmcdhdr.nmcd.hdr); } @@ -670,7 +672,7 @@ TREEVIEW_SendCustomDrawItemNotify(const TREEVIEW_INFO *infoPtr, HDC hdc, nmcd->dwDrawStage, nmcd->hdc, nmcd->dwItemSpec, nmcd->uItemState, nmcd->lItemlParam); - return TREEVIEW_SendRealNotify(infoPtr, nmcd->hdr.idFrom, (LPARAM)nmcdhdr); + return TREEVIEW_SendRealNotify(infoPtr, nmcd->hdr.idFrom, &nmcdhdr->nmcd.hdr); } static BOOL @@ -687,7 +689,7 @@ TREEVIEW_BeginLabelEditNotify(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *editI TREEVIEW_TVItemFromItem(infoPtr, TVIF_HANDLE | TVIF_STATE | TVIF_PARAM | TVIF_TEXT, &tvdi.item, editItem); - ret = TREEVIEW_SendRealNotify(infoPtr, tvdi.hdr.idFrom, (LPARAM)&tvdi); + ret = TREEVIEW_SendRealNotify(infoPtr, tvdi.hdr.idFrom, &tvdi.hdr); if (!infoPtr->bNtfUnicode) Free(tvdi.item.pszText); @@ -725,7 +727,8 @@ TREEVIEW_UpdateDispInfo(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem, if (mask & TVIF_TEXT) wineItem->textWidth = 0; - TREEVIEW_SendRealNotify(infoPtr, callback.hdr.idFrom, (LPARAM)&callback); + TREEVIEW_SendRealNotify(infoPtr, callback.hdr.idFrom, &callback.hdr); + TRACE("resulting code 0x%08x\n", callback.hdr.code); /* It may have changed due to a call to SetItem. */ mask &= wineItem->callbackMask; @@ -733,7 +736,7 @@ TREEVIEW_UpdateDispInfo(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem, if ((mask & TVIF_TEXT) && callback.item.pszText != wineItem->pszText) { /* Instead of copying text into our buffer user specified its own */ - if (!infoPtr->bNtfUnicode) { + if (!infoPtr->bNtfUnicode && (callback.hdr.code == TVN_GETDISPINFOA)) { LPWSTR newText; int buflen; int len = MultiByteToWideChar( CP_ACP, 0, @@ -774,7 +777,7 @@ TREEVIEW_UpdateDispInfo(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem, } else if (mask & TVIF_TEXT) { /* User put text into our buffer, that is ok unless A string */ - if (!infoPtr->bNtfUnicode) { + if (!infoPtr->bNtfUnicode && (callback.hdr.code == TVN_GETDISPINFOA)) { LPWSTR newText; LPWSTR oldText = NULL; int buflen; @@ -1005,7 +1008,7 @@ TREEVIEW_AllocateItem(const TREEVIEW_INFO *infoPtr) * inc/dec to toggle the images. */ newItem->iImage = 0; newItem->iSelectedImage = 0; - newItem->iExpandedImage = 0; + newItem->iExpandedImage = (WORD)I_IMAGENONE; if (DPA_InsertPtr(infoPtr->items, INT_MAX, newItem) == -1) { @@ -1478,12 +1481,12 @@ TREEVIEW_RemoveItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem) { TRACE("%p, (%s)\n", wineItem, TREEVIEW_ItemName(wineItem)); - TREEVIEW_SendTreeviewNotify(infoPtr, TVN_DELETEITEMW, TVC_UNKNOWN, - TVIF_HANDLE | TVIF_PARAM, wineItem, 0); - if (wineItem->firstChild) TREEVIEW_RemoveAllChildren(infoPtr, wineItem); + TREEVIEW_SendTreeviewNotify(infoPtr, TVN_DELETEITEMW, TVC_UNKNOWN, + TVIF_HANDLE | TVIF_PARAM, wineItem, 0); + TREEVIEW_UnlinkItem(wineItem); infoPtr->uNumItems--; @@ -1512,7 +1515,7 @@ TREEVIEW_DeleteItem(TREEVIEW_INFO *infoPtr, HTREEITEM wineItem) TREEVIEW_ITEM *parent, *prev = NULL; BOOL visible = FALSE; - if (wineItem == TVI_ROOT) + if (wineItem == TVI_ROOT || !wineItem) { TRACE("TVI_ROOT\n"); parent = infoPtr->root; @@ -1827,7 +1830,7 @@ TREEVIEW_SetItemHeight(TREEVIEW_INFO *infoPtr, INT newHeight) { INT prevHeight = infoPtr->uItemHeight; - TRACE("%d\n", newHeight); + TRACE("new=%d, old=%d\n", newHeight, prevHeight); if (newHeight == -1) { infoPtr->uItemHeight = TREEVIEW_NaturalHeight(infoPtr); @@ -1835,13 +1838,17 @@ TREEVIEW_SetItemHeight(TREEVIEW_INFO *infoPtr, INT newHeight) } else { - infoPtr->uItemHeight = newHeight; - infoPtr->bHeightSet = TRUE; + if (newHeight == 0) newHeight = 1; + infoPtr->uItemHeight = newHeight; + infoPtr->bHeightSet = TRUE; } /* Round down, unless we support odd ("non even") heights. */ - if (!(infoPtr->dwStyle & TVS_NONEVENHEIGHT)) - infoPtr->uItemHeight &= ~1; + if (!(infoPtr->dwStyle & TVS_NONEVENHEIGHT) && infoPtr->uItemHeight != 1) + { + infoPtr->uItemHeight &= ~1; + TRACE("after rounding=%d\n", infoPtr->uItemHeight); + } if (infoPtr->uItemHeight != prevHeight) { @@ -2061,6 +2068,7 @@ static inline LRESULT TREEVIEW_GetVisibleCount(const TREEVIEW_INFO *infoPtr) { /* Surprise! This does not take integral height into account. */ + TRACE("client=%d, item=%d\n", infoPtr->clientHeight, infoPtr->uItemHeight); return infoPtr->clientHeight / infoPtr->uItemHeight; } @@ -2142,6 +2150,13 @@ TREEVIEW_GetItemT(const TREEVIEW_INFO *infoPtr, LPTVITEMEXW tvItem, BOOL isW) } } } + + if (tvItem->mask & TVIF_STATEEX) + { + FIXME("Extended item state not supported, returning 0.\n"); + tvItem->uStateEx = 0; + } + TRACE("item <%p>, txt %p, img %p, mask %x\n", wineItem, tvItem->pszText, &tvItem->iImage, tvItem->mask); @@ -2575,7 +2590,7 @@ TREEVIEW_DrawItem(const TREEVIEW_INFO *infoPtr, HDC hdc, TREEVIEW_ITEM *wineItem /* The item is currently selected */ imageIndex = wineItem->iSelectedImage; } - else if ((wineItem->state & TVIS_EXPANDED) && (wineItem->iExpandedImage >= 0)) + else if ((wineItem->state & TVIS_EXPANDED) && (wineItem->iExpandedImage != (WORD)I_IMAGENONE)) { /* The item is currently not selected but expanded */ imageIndex = wineItem->iExpandedImage; @@ -2878,6 +2893,7 @@ TREEVIEW_Refresh(TREEVIEW_INFO *infoPtr, HDC hdc, const RECT *rc) } } + // // This is correct, but is causes and infinite loop of WM_PAINT messages, resulting // in continuous painting of the scroll bar in reactos. Comment out until the real // bug is found @@ -2917,6 +2933,7 @@ TREEVIEW_Paint(TREEVIEW_INFO *infoPtr, HDC hdc_ref) { hdc = hdc_ref; GetClientRect(infoPtr->hwnd, &rc); + TREEVIEW_FillBkgnd(infoPtr, hdc, &rc); } else { @@ -3309,7 +3326,7 @@ TREEVIEW_Collapse(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem, static BOOL TREEVIEW_Expand(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem, - BOOL bExpandPartial, BOOL bUser) + BOOL partial, BOOL user) { LONG scrollDist; LONG orgNextTop = 0; @@ -3317,7 +3334,7 @@ TREEVIEW_Expand(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem, TREEVIEW_ITEM *nextItem, *tmpItem; BOOL sendsNotifications; - TRACE("(%p, %p, partial=%d, %d\n", infoPtr, wineItem, bExpandPartial, bUser); + TRACE("(%p, %p, partial=%d, %d\n", infoPtr, wineItem, partial, user); if (wineItem->state & TVIS_EXPANDED) return TRUE; @@ -3338,7 +3355,7 @@ TREEVIEW_Expand(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem, TRACE("TVE_EXPAND %p %s\n", wineItem, TREEVIEW_ItemName(wineItem)); - sendsNotifications = bUser || ((wineItem->cChildren != 0) && + sendsNotifications = user || ((wineItem->cChildren != 0) && !(wineItem->state & TVIS_EXPANDEDONCE)); if (sendsNotifications) { @@ -3353,7 +3370,7 @@ TREEVIEW_Expand(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem, wineItem->state |= TVIS_EXPANDED; - if (bExpandPartial) + if (partial) FIXME("TVE_EXPANDPARTIAL not implemented\n"); if (ISVISIBLE(wineItem)) @@ -3419,6 +3436,58 @@ TREEVIEW_Expand(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem, return TRUE; } +/* Handler for TVS_SINGLEEXPAND behaviour. Used on response + to mouse messages and TVM_SELECTITEM. + + selection - previously selected item, used to collapse a part of a tree + item - new selected item +*/ +static void TREEVIEW_SingleExpand(TREEVIEW_INFO *infoPtr, + HTREEITEM selection, HTREEITEM item) +{ + TREEVIEW_ITEM *SelItem; + + if ((infoPtr->dwStyle & TVS_SINGLEEXPAND) == 0 || infoPtr->hwndEdit || !item) return; + + TREEVIEW_SendTreeviewNotify(infoPtr, TVN_SINGLEEXPAND, TVC_UNKNOWN, TVIF_HANDLE | TVIF_PARAM, item, 0); + + /* + * Close the previous selection all the way to the root + * as long as the new selection is not a child + */ + if(selection && (selection != item)) + { + BOOL closeit = TRUE; + SelItem = item; + + /* determine if the hitItem is a child of the currently selected item */ + while(closeit && SelItem && TREEVIEW_ValidItem(infoPtr, SelItem) && + (SelItem->parent != infoPtr->root)) + { + closeit = (SelItem != selection); + SelItem = SelItem->parent; + } + + if(closeit) + { + if(TREEVIEW_ValidItem(infoPtr, selection)) + SelItem = selection; + + while(SelItem && (SelItem != item) && TREEVIEW_ValidItem(infoPtr, SelItem) && + SelItem->parent != infoPtr->root) + { + TREEVIEW_Collapse(infoPtr, SelItem, FALSE, FALSE); + SelItem = SelItem->parent; + } + } + } + + /* + * Expand the current item + */ + TREEVIEW_Expand(infoPtr, item, FALSE, FALSE); +} + static BOOL TREEVIEW_Toggle(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem, BOOL bUser) { @@ -3865,7 +3934,7 @@ TREEVIEW_EndEditLabelNow(TREEVIEW_INFO *infoPtr, BOOL bCancel) tvdi.item.cchTextMax = 0; } - bCommit = TREEVIEW_SendRealNotify(infoPtr, tvdi.hdr.idFrom, (LPARAM)&tvdi); + bCommit = TREEVIEW_SendRealNotify(infoPtr, tvdi.hdr.idFrom, &tvdi.hdr); if (!bCancel && bCommit) /* Apply the changes */ { @@ -4136,58 +4205,11 @@ TREEVIEW_LButtonDown(TREEVIEW_INFO *infoPtr, LPARAM lParam) } else if (ht.flags & (TVHT_ONITEMICON|TVHT_ONITEMLABEL)) /* select the item if the hit was inside of the icon or text */ { - /* - * if we are TVS_SINGLEEXPAND then we want this single click to - * do a bunch of things. - */ - if((infoPtr->dwStyle & TVS_SINGLEEXPAND) && - (infoPtr->hwndEdit == 0)) - { - TREEVIEW_ITEM *SelItem; - - /* - * Send the notification - */ - TREEVIEW_SendTreeviewNotify(infoPtr, TVN_SINGLEEXPAND, TVC_UNKNOWN, TVIF_HANDLE | TVIF_PARAM, ht.hItem, 0); - - /* - * Close the previous selection all the way to the root - * as long as the new selection is not a child - */ - if((infoPtr->selectedItem) - && (infoPtr->selectedItem != ht.hItem)) - { - BOOL closeit = TRUE; - SelItem = ht.hItem; - - /* determine if the hitItem is a child of the currently selected item */ - while(closeit && SelItem && TREEVIEW_ValidItem(infoPtr, SelItem) && (SelItem != infoPtr->root)) - { - closeit = (SelItem != infoPtr->selectedItem); - SelItem = SelItem->parent; - } - - if(closeit) - { - if(TREEVIEW_ValidItem(infoPtr, infoPtr->selectedItem)) - SelItem = infoPtr->selectedItem; - - while(SelItem && (SelItem != ht.hItem) && TREEVIEW_ValidItem(infoPtr, SelItem) && (SelItem != infoPtr->root)) - { - TREEVIEW_Collapse(infoPtr, SelItem, FALSE, FALSE); - SelItem = SelItem->parent; - } - } - } - - /* - * Expand the current item - */ - TREEVIEW_Expand(infoPtr, ht.hItem, TVE_TOGGLE, FALSE); - } + TREEVIEW_ITEM *selection = infoPtr->selectedItem; /* Select the current item */ TREEVIEW_DoSelectItem(infoPtr, TVGN_CARET, ht.hItem, TVC_BYMOUSE); + TREEVIEW_SingleExpand(infoPtr, selection, ht.hItem); } else if (ht.flags & TVHT_ONITEMSTATEICON) { @@ -4350,6 +4372,9 @@ TREEVIEW_DoSelectItem(TREEVIEW_INFO *infoPtr, INT action, HTREEITEM newSelect, switch (action) { + case TVGN_CARET|TVSI_NOSINGLEEXPAND: + FIXME("TVSI_NOSINGLEEXPAND specified.\n"); + /* Fall through */ case TVGN_CARET: prevSelect = infoPtr->selectedItem; @@ -4419,7 +4444,9 @@ TREEVIEW_DoSelectItem(TREEVIEW_INFO *infoPtr, INT action, HTREEITEM newSelect, static LRESULT TREEVIEW_SelectItem(TREEVIEW_INFO *infoPtr, INT wParam, HTREEITEM item) { - if (item != NULL && !TREEVIEW_ValidItem(infoPtr, item)) + TREEVIEW_ITEM *selection = infoPtr->selectedItem; + + if (item && !TREEVIEW_ValidItem(infoPtr, item)) return FALSE; TRACE("%p (%s) %d\n", item, TREEVIEW_ItemName(item), wParam); @@ -4427,6 +4454,8 @@ TREEVIEW_SelectItem(TREEVIEW_INFO *infoPtr, INT wParam, HTREEITEM item) if (!TREEVIEW_DoSelectItem(infoPtr, wParam, item, TVC_UNKNOWN)) return FALSE; + TREEVIEW_SingleExpand(infoPtr, selection, item); + return TRUE; } @@ -5474,7 +5503,7 @@ TREEVIEW_SetCursor(const TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam) nmmouse.pt.x = 0; nmmouse.pt.y = 0; nmmouse.dwHitInfo = lParam; - if (TREEVIEW_SendRealNotify(infoPtr, nmmouse.hdr.idFrom, (LPARAM)&nmmouse)) + if (TREEVIEW_SendRealNotify(infoPtr, nmmouse.hdr.idFrom, &nmmouse.hdr)) return 0; if (item && (infoPtr->dwStyle & TVS_TRACKSELECT)) @@ -5824,10 +5853,10 @@ TREEVIEW_Unregister(void) /* Tree Verification ****************************************************/ static inline void -TREEVIEW_VerifyChildren(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item); +TREEVIEW_VerifyChildren(TREEVIEW_INFO *infoPtr, const TREEVIEW_ITEM *item); static inline void TREEVIEW_VerifyItemCommon(TREEVIEW_INFO *infoPtr, - TREEVIEW_ITEM *item) + const TREEVIEW_ITEM *item) { assert(infoPtr != NULL); assert(item != NULL); @@ -5866,7 +5895,7 @@ static inline void TREEVIEW_VerifyItemCommon(TREEVIEW_INFO *infoPtr, } static inline void -TREEVIEW_VerifyItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item) +TREEVIEW_VerifyItem(TREEVIEW_INFO *infoPtr, const TREEVIEW_ITEM *item) { assert(item != NULL); @@ -5882,9 +5911,9 @@ TREEVIEW_VerifyItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item) } static inline void -TREEVIEW_VerifyChildren(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item) +TREEVIEW_VerifyChildren(TREEVIEW_INFO *infoPtr, const TREEVIEW_ITEM *item) { - TREEVIEW_ITEM *child; + const TREEVIEW_ITEM *child; assert(item != NULL); for (child = item->firstChild; child != NULL; child = child->nextSibling) diff --git a/dll/win32/cryptdll/stubs.c b/dll/win32/cryptdll/stubs.c index 230ce09d74c..86bee19fa34 100644 --- a/dll/win32/cryptdll/stubs.c +++ b/dll/win32/cryptdll/stubs.c @@ -1,7 +1,7 @@ #include #define NDEBUG -#include +#include void WINAPI CDBuildIntegrityVect(DWORD Unknown1, DWORD Unknown2) diff --git a/dll/win32/dhcpcsvc/include/rosdhcp.h b/dll/win32/dhcpcsvc/include/rosdhcp.h index 09539de42bc..8265de33d0a 100644 --- a/dll/win32/dhcpcsvc/include/rosdhcp.h +++ b/dll/win32/dhcpcsvc/include/rosdhcp.h @@ -79,16 +79,16 @@ typedef DWORD (*PipeSendFunc)( COMM_DHCP_REPLY *Reply ); void AdapterInit(VOID); HANDLE StartAdapterDiscovery(VOID); void AdapterStop(VOID); -extern PDHCP_ADAPTER AdapterGetFirst(); +extern PDHCP_ADAPTER AdapterGetFirst(VOID); extern PDHCP_ADAPTER AdapterGetNext(PDHCP_ADAPTER); extern PDHCP_ADAPTER AdapterFindIndex( unsigned int AdapterIndex ); extern PDHCP_ADAPTER AdapterFindInfo( struct interface_info *info ); extern PDHCP_ADAPTER AdapterFindByHardwareAddress( u_int8_t haddr[16], u_int8_t hlen ); -extern HANDLE PipeInit(); -extern VOID ApiInit(); -extern VOID ApiFree(); -extern VOID ApiLock(); -extern VOID ApiUnlock(); +extern HANDLE PipeInit(VOID); +extern VOID ApiInit(VOID); +extern VOID ApiFree(VOID); +extern VOID ApiLock(VOID); +extern VOID ApiUnlock(VOID); extern DWORD DSQueryHWInfo( PipeSendFunc Send, COMM_DHCP_REQ *Req ); extern DWORD DSLeaseIpAddress( PipeSendFunc Send, COMM_DHCP_REQ *Req ); extern DWORD DSRenewIpAddressLease( PipeSendFunc Send, COMM_DHCP_REQ *Req ); diff --git a/dll/win32/gdi32/include/gdi32p.h b/dll/win32/gdi32/include/gdi32p.h index 49673de0ce2..f4ef1d9342b 100644 --- a/dll/win32/gdi32/include/gdi32p.h +++ b/dll/win32/gdi32/include/gdi32p.h @@ -279,7 +279,6 @@ WINAPI GdiSetLastError( DWORD dwErrCode ); DWORD WINAPI GdiGetCodePage(HDC); -UINT FASTCALL DIB_BitmapBitsSize( CONST BITMAPINFO* ); int WINAPI diff --git a/dll/win32/gdi32/objects/bitmap.c b/dll/win32/gdi32/objects/bitmap.c index 969beb6ad44..9e5aaeb6477 100644 --- a/dll/win32/gdi32/objects/bitmap.c +++ b/dll/win32/gdi32/objects/bitmap.c @@ -3,6 +3,9 @@ #define NDEBUG #include +// From Yuan, ScanLineSize = (Width * bitcount + 31)/32 +#define WIDTH_BYTES_ALIGN32(cx, bpp) ((((cx) * (bpp) + 31) & ~31) >> 3) + /* * DIB_BitmapInfoSize * @@ -41,30 +44,6 @@ INT FASTCALL DIB_BitmapInfoSize(const BITMAPINFO * info, WORD coloruse) UINT FASTCALL DIB_BitmapMaxBitsSize( PBITMAPINFO Info, UINT ScanLines ) -{ - UINT MaxBits = 0; - - if (!Info) return 0; - - if (Info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER)) - { - PBITMAPCOREHEADER Core = (PBITMAPCOREHEADER)Info; - MaxBits = Core->bcBitCount * Core->bcPlanes * Core->bcWidth; - } - else /* assume BITMAPINFOHEADER */ - { - if ((Info->bmiHeader.biCompression) && (Info->bmiHeader.biCompression != BI_BITFIELDS)) - return Info->bmiHeader.biSizeImage; - // Planes are over looked by Yuan. I guess assumed always 1. - MaxBits = Info->bmiHeader.biBitCount * Info->bmiHeader.biPlanes * Info->bmiHeader.biWidth; - } - MaxBits = ((MaxBits + 31) & ~31 ) / 8; // From Yuan, ScanLineSize = (Width * bitcount + 31)/32 - return (MaxBits * ScanLines); // ret the full Size. -} - -UINT -FASTCALL -DIB_BitmapBitsSize( CONST BITMAPINFO* Info ) { UINT Ret; @@ -73,22 +52,22 @@ DIB_BitmapBitsSize( CONST BITMAPINFO* Info ) if ( Info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER)) { PBITMAPCOREHEADER Core = (PBITMAPCOREHEADER)Info; - Ret = Core->bcHeight * - ((Core->bcWidth * Core->bcPlanes * Core->bcBitCount + 31) & ~31 ) / 8; + Ret = WIDTH_BYTES_ALIGN32(Core->bcWidth * Core->bcPlanes, Core->bcBitCount) * ScanLines; } else /* assume BITMAPINFOHEADER */ { - if ((Info->bmiHeader.biCompression) && - (Info->bmiHeader.biCompression != BI_BITFIELDS)) - return Info->bmiHeader.biSizeImage; - // Make Height positive always.... - Ret = abs(Info->bmiHeader.biHeight) * - ((Info->bmiHeader.biWidth * Info->bmiHeader.biPlanes * Info->bmiHeader.biBitCount + 31) & ~31 ) / 8; + if (!(Info->bmiHeader.biCompression) || (Info->bmiHeader.biCompression == BI_BITFIELDS)) + { + Ret = WIDTH_BYTES_ALIGN32(Info->bmiHeader.biWidth * Info->bmiHeader.biPlanes, Info->bmiHeader.biBitCount) * ScanLines; + } + else + { + Ret = Info->bmiHeader.biSizeImage; + } } return Ret; } - /* * DIB_GetBitmapInfo is complete copy of wine cvs 2/9-2006 * from file dib.c from gdi32.dll or orginal version @@ -161,39 +140,27 @@ int WINAPI GdiGetBitmapBitsSize(BITMAPINFO *lpbmi) { - int retSize; + UINT Ret; - if (lpbmi->bmiHeader.biSize == FIELD_OFFSET(BITMAPINFOHEADER, biPlanes)) + if (!lpbmi) return 0; + + if ( lpbmi->bmiHeader.biSize == sizeof(BITMAPCOREHEADER)) { - /* Calc the bits Size and align it*/ - retSize = HIWORD(lpbmi->bmiHeader.biWidth) * ((LOWORD(lpbmi->bmiHeader.biWidth) * - LOWORD(lpbmi->bmiHeader.biHeight) * HIWORD(lpbmi->bmiHeader.biHeight) + 31) - & -32) / 8; + PBITMAPCOREHEADER Core = (PBITMAPCOREHEADER)lpbmi; + Ret = WIDTH_BYTES_ALIGN32(Core->bcWidth * Core->bcPlanes, Core->bcBitCount) * Core->bcHeight; } - else + else /* assume BITMAPINFOHEADER */ { - if ( (lpbmi->bmiHeader.biCompression == BI_BITFIELDS) || - (lpbmi->bmiHeader.biCompression == BI_RGB)) + if (!(lpbmi->bmiHeader.biCompression) || (lpbmi->bmiHeader.biCompression == BI_BITFIELDS)) { - if (lpbmi->bmiHeader.biHeight >=0 ) - { - /* Calc the bits Size and align it*/ - retSize = lpbmi->bmiHeader.biHeight * ((lpbmi->bmiHeader.biWidth * - lpbmi->bmiHeader.biPlanes * lpbmi->bmiHeader.biBitCount + 31) & -32) / 8; - } - else - { - /* Make height postiive if it negitve then calc the bits Size and align it*/ - retSize = (-lpbmi->bmiHeader.biHeight) * ((lpbmi->bmiHeader.biWidth * - lpbmi->bmiHeader.biPlanes * lpbmi->bmiHeader.biBitCount + 31) & -32) / 8; - } + Ret = WIDTH_BYTES_ALIGN32(lpbmi->bmiHeader.biWidth * lpbmi->bmiHeader.biPlanes, lpbmi->bmiHeader.biBitCount) * abs(lpbmi->bmiHeader.biHeight); } else { - retSize = lpbmi->bmiHeader.biSizeImage; + Ret = lpbmi->bmiHeader.biSizeImage; } } - return retSize; + return Ret; } /* @@ -316,7 +283,7 @@ StretchBlt( } /* - * @unimplemented + * @implemented */ HBITMAP WINAPI CreateBitmap(INT Width, @@ -325,7 +292,6 @@ CreateBitmap(INT Width, UINT BitsPixel, CONST VOID* pUnsafeBits) { - /* FIXME some part should be done in user mode */ if (Width && Height) { return NtGdiCreateBitmap(Width, Height, Planes, BitsPixel, (LPBYTE) pUnsafeBits); @@ -382,8 +348,6 @@ CreateCompatibleBitmap( INT Height) { PDC_ATTR pDc_Attr; - HBITMAP hBmp = NULL; - DIBSECTION dibs; if (!GdiGetHandleUserData(hDC, GDI_OBJECT_TYPE_DC, (PVOID)&pDc_Attr)) return NULL; @@ -395,19 +359,26 @@ CreateCompatibleBitmap( { return NtGdiCreateCompatibleBitmap(hDC, Width, Height); } + else + { + HBITMAP hBmp = NULL; + char buffer[sizeof(DIBSECTION) + 256*sizeof(RGBQUAD)]; + DIBSECTION* pDIBs = (DIBSECTION*)buffer; - hBmp = NtGdiGetDCObject(hDC, GDI_OBJECT_TYPE_BITMAP); + hBmp = NtGdiGetDCObject(hDC, GDI_OBJECT_TYPE_BITMAP); - if ( GetObjectA(hBmp, sizeof(DIBSECTION), &dibs) != sizeof(DIBSECTION) ) - return NULL; + if ( GetObjectA(hBmp, sizeof(DIBSECTION), pDIBs) != sizeof(DIBSECTION) ) + return NULL; - if ( dibs.dsBm.bmBitsPixel <= 8 ) - GetDIBColorTable(hDC, 0, 256, (RGBQUAD *)&dibs.dsBitfields); + if ( pDIBs->dsBm.bmBitsPixel <= 8 ) + GetDIBColorTable(hDC, 0, 256, (RGBQUAD *)&pDIBs->dsBitfields[0]); - dibs.dsBmih.biWidth = Width; - dibs.dsBmih.biHeight = Height; + pDIBs->dsBmih.biWidth = Width; + pDIBs->dsBmih.biHeight = Height; - return CreateDIBSection(hDC, (CONST BITMAPINFO *)&dibs.dsBmih, 0, NULL, NULL, 0); + return CreateDIBSection(hDC, (CONST BITMAPINFO *)&pDIBs->dsBmih, 0, NULL, NULL, 0); + } + return NULL; } @@ -493,7 +464,7 @@ CreateDIBitmap( HDC hDC, { _SEH2_TRY { - cjBmpScanSize = DIB_BitmapBitsSize(Data); + cjBmpScanSize = GdiGetBitmapBitsSize((BITMAPINFO *)Data); CalculateColorTableSize(&Data->bmiHeader, &ColorUse, &InfoSize); InfoSize += Data->bmiHeader.biSize; } @@ -531,7 +502,6 @@ CreateDIBitmap( HDC hDC, return hBmp; } -#if 0 // FIXME!!! This is a victim of the Win32k Initialization BUG!!!!! /* * @implemented */ @@ -567,9 +537,9 @@ SetDIBits(HDC hDC, } } - hDCc = NtGdiGetDCforBitmap(hBitmap); + hDCc = NtGdiGetDCforBitmap(hBitmap); // hDC can be NULL, so, get it from the bitmap. SavehDC = hDCc; - if ( !hDCc ) + if ( !hDCc ) // No DC associated with bitmap, Clone or Create one. { nhDC = CreateCompatibleDC(hDC); if ( !nhDC ) return 0; @@ -623,60 +593,6 @@ SetDIBits(HDC hDC, return LinesCopied; } -#endif - -INT -WINAPI -SetDIBits(HDC hdc, - HBITMAP hbmp, - UINT uStartScan, - UINT cScanLines, - CONST VOID *lpvBits, - CONST BITMAPINFO *lpbmi, - UINT fuColorUse) -{ - PBITMAPINFO pConvertedInfo; - UINT ConvertedInfoSize; - INT LinesCopied = 0; - UINT cjBmpScanSize = 0; - PVOID pvSafeBits = (PVOID)lpvBits; - -// This needs to be almost the sames as SetDIBitsToDevice - - if ( !cScanLines || !lpbmi || !lpvBits || (GDI_HANDLE_GET_TYPE(hbmp) != GDI_OBJECT_TYPE_BITMAP)) - return 0; - - if ( fuColorUse && fuColorUse != DIB_PAL_COLORS && fuColorUse != DIB_PAL_COLORS+1 ) - return 0; - - pConvertedInfo = ConvertBitmapInfo(lpbmi, fuColorUse, - &ConvertedInfoSize, FALSE); - if (!pConvertedInfo) - return 0; - - cjBmpScanSize = DIB_BitmapMaxBitsSize((LPBITMAPINFO)lpbmi, cScanLines); - - if ( lpvBits ) - { - pvSafeBits = RtlAllocateHeap(GetProcessHeap(), 0, cjBmpScanSize); - if (pvSafeBits) - RtlCopyMemory( pvSafeBits, lpvBits, cjBmpScanSize); - } - - LinesCopied = NtGdiSetDIBits( hdc, - hbmp, - uStartScan, - cScanLines, - pvSafeBits, - pConvertedInfo, - fuColorUse); - - if ( lpvBits != pvSafeBits) - RtlFreeHeap(RtlGetProcessHeap(), 0, pvSafeBits); - if (lpbmi != pConvertedInfo) - RtlFreeHeap(RtlGetProcessHeap(), 0, pConvertedInfo); - return LinesCopied; -} /* * @implemented @@ -703,6 +619,7 @@ SetDIBitsToDevice( UINT ConvertedInfoSize; INT LinesCopied = 0; UINT cjBmpScanSize = 0; + BOOL Hit = FALSE; PVOID pvSafeBits = (PVOID)Bits; if ( !ScanLines || !lpbmi || !Bits ) @@ -766,7 +683,26 @@ SetDIBitsToDevice( { pvSafeBits = RtlAllocateHeap(GetProcessHeap(), 0, cjBmpScanSize); if (pvSafeBits) - RtlCopyMemory( pvSafeBits, Bits, cjBmpScanSize); + { + _SEH2_TRY + { + RtlCopyMemory( pvSafeBits, Bits, cjBmpScanSize); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Hit = TRUE; + } + _SEH2_END + + if (Hit) + { + // We don't die, we continue on with a allocated safe pointer to kernel + // space..... + DPRINT1("SetDIBitsToDevice fail to read BitMapInfo: %x or Bits: %x & Size: %d\n",pConvertedInfo,Bits,cjBmpScanSize); + } + DPRINT("SetDIBitsToDevice Allocate Bits %d!!!\n", cjBmpScanSize); + } + } if (!GdiGetHandleUserData(hdc, GDI_OBJECT_TYPE_DC, (PVOID)&pDc_Attr)) @@ -775,7 +711,8 @@ SetDIBitsToDevice( return 0; } /* - if ( !pDc_Attr || + if ( !pDc_Attr || // DC is Public + ColorUse == DIB_PAL_COLORS || ((pConvertedInfo->bmiHeader.biSize >= sizeof(BITMAPINFOHEADER)) && (pConvertedInfo->bmiHeader.biCompression == BI_JPEG || pConvertedInfo->bmiHeader.biCompression == BI_PNG )) )*/ @@ -888,7 +825,7 @@ StretchDIBits(HDC hdc, return 0; } - cjBmpScanSize = DIB_BitmapBitsSize((LPBITMAPINFO)pConvertedInfo); + cjBmpScanSize = GdiGetBitmapBitsSize((BITMAPINFO *)pConvertedInfo); if ( lpBits ) { @@ -922,6 +859,7 @@ StretchDIBits(HDC hdc, } /* if ( !pDc_Attr || + iUsage == DIB_PAL_COLORS || ((pConvertedInfo->bmiHeader.biSize >= sizeof(BITMAPINFOHEADER)) && (pConvertedInfo->bmiHeader.biCompression == BI_JPEG || pConvertedInfo->bmiHeader.biCompression == BI_PNG )) )*/ diff --git a/dll/win32/gdi32/objects/utils.c b/dll/win32/gdi32/objects/utils.c index 734d5df54c6..7ed0d229d64 100644 --- a/dll/win32/gdi32/objects/utils.c +++ b/dll/win32/gdi32/objects/utils.c @@ -214,7 +214,7 @@ ConvertBitmapInfo( if (FollowedByData) { - DataSize = DIB_BitmapBitsSize((PBITMAPINFO)BitmapInfo ); + DataSize = GdiGetBitmapBitsSize((PBITMAPINFO)BitmapInfo ); } /* diff --git a/dll/win32/imagehlp/integrity.c b/dll/win32/imagehlp/integrity.c index 72bf1552eff..99402788007 100644 --- a/dll/win32/imagehlp/integrity.c +++ b/dll/win32/imagehlp/integrity.c @@ -4,6 +4,8 @@ * Copyright 1998 Patrik Stridvall * Copyright 2003 Mike McCormack * Copyright 2009 Owen Rudge for CodeWeavers + * Copyright 2010 Juan Lang + * Copyright 2010 Andrey Turkin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -461,9 +463,10 @@ BOOL WINAPI ImageAddCertificate( if (Certificate->dwLength % 8) { char null[8]; + DWORD dwBytesWritten; ZeroMemory(null, 8); - WriteFile(FileHandle, null, 8 - (Certificate->dwLength % 8), NULL, NULL); + WriteFile(FileHandle, null, 8 - (Certificate->dwLength % 8), &dwBytesWritten, NULL); size += 8 - (Certificate->dwLength % 8); } @@ -630,18 +633,255 @@ BOOL WINAPI ImageGetCertificateHeader( return TRUE; } +/* Finds the section named section in the array of IMAGE_SECTION_HEADERs hdr. If + * found, returns the offset to the section. Otherwise returns 0. If the section + * is found, optionally returns the size of the section (in size) and the base + * address of the section (in base.) + */ +static DWORD IMAGEHLP_GetSectionOffset( IMAGE_SECTION_HEADER *hdr, + DWORD num_sections, LPCSTR section, PDWORD size, PDWORD base ) +{ + DWORD i, offset = 0; + + for( i = 0; !offset && i < num_sections; i++, hdr++ ) + { + if( !memcmp( hdr->Name, section, strlen(section) ) ) + { + offset = hdr->PointerToRawData; + if( size ) + *size = hdr->SizeOfRawData; + if( base ) + *base = hdr->VirtualAddress; + } + } + return offset; +} + +/* Calls DigestFunction e bytes at offset offset from the file mapped at map. + * Returns the return value of DigestFunction, or FALSE if the data is not available. + */ +static BOOL IMAGEHLP_ReportSectionFromOffset( DWORD offset, DWORD size, + BYTE *map, DWORD fileSize, DIGEST_FUNCTION DigestFunction, DIGEST_HANDLE DigestHandle ) +{ + if( offset + size > fileSize ) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + return DigestFunction( DigestHandle, map + offset, size ); +} + +/* Finds the section named section among the IMAGE_SECTION_HEADERs in + * section_headers and calls DigestFunction for this section. Returns + * the return value from DigestFunction, or FALSE if the data could not be read. + */ +static BOOL IMAGEHLP_ReportSection( IMAGE_SECTION_HEADER *section_headers, + DWORD num_sections, LPCSTR section, BYTE *map, DWORD fileSize, + DIGEST_FUNCTION DigestFunction, DIGEST_HANDLE DigestHandle ) +{ + DWORD offset, size = 0; + + offset = IMAGEHLP_GetSectionOffset( section_headers, num_sections, section, + &size, NULL ); + if( !offset ) + return FALSE; + return IMAGEHLP_ReportSectionFromOffset( offset, size, map, fileSize, + DigestFunction, DigestHandle ); +} + +/* Calls DigestFunction for all sections with the IMAGE_SCN_CNT_CODE flag set. + * Returns the return value from * DigestFunction, or FALSE if a section could not be read. + */ +static BOOL IMAGEHLP_ReportCodeSections( IMAGE_SECTION_HEADER *hdr, DWORD num_sections, + BYTE *map, DWORD fileSize, DIGEST_FUNCTION DigestFunction, DIGEST_HANDLE DigestHandle ) +{ + DWORD i; + BOOL ret = TRUE; + + for( i = 0; ret && i < num_sections; i++, hdr++ ) + { + if( hdr->Characteristics & IMAGE_SCN_CNT_CODE ) + ret = IMAGEHLP_ReportSectionFromOffset( hdr->PointerToRawData, + hdr->SizeOfRawData, map, fileSize, DigestFunction, DigestHandle ); + } + return ret; +} + +/* Reports the import section from the file FileHandle. If + * CERT_PE_IMAGE_DIGEST_ALL_IMPORT_INFO is set in DigestLevel, reports the entire + * import section. + * FIXME: if it's not set, the function currently fails. + */ +static BOOL IMAGEHLP_ReportImportSection( IMAGE_SECTION_HEADER *hdr, + DWORD num_sections, BYTE *map, DWORD fileSize, DWORD DigestLevel, + DIGEST_FUNCTION DigestFunction, DIGEST_HANDLE DigestHandle ) +{ + BOOL ret = FALSE; + DWORD offset, size, base; + + /* Get import data */ + offset = IMAGEHLP_GetSectionOffset( hdr, num_sections, ".idata", &size, + &base ); + if( !offset ) + return FALSE; + + /* If CERT_PE_IMAGE_DIGEST_ALL_IMPORT_INFO is set, the entire + * section is reported. Otherwise, the debug info section is + * decoded and reported piecemeal. See tests. However, I haven't been + * able to figure out how the native implementation decides which values + * to report. Either it's buggy or my understanding is flawed. + */ + if( DigestLevel & CERT_PE_IMAGE_DIGEST_ALL_IMPORT_INFO ) + ret = IMAGEHLP_ReportSectionFromOffset( offset, size, map, fileSize, + DigestFunction, DigestHandle ); + else + { + FIXME("not supported except for CERT_PE_IMAGE_DIGEST_ALL_IMPORT_INFO\n"); + SetLastError(ERROR_INVALID_PARAMETER); + ret = FALSE; + } + + return ret; +} + /*********************************************************************** * ImageGetDigestStream (IMAGEHLP.@) + * + * Gets a stream of bytes from a PE file overwhich a hash might be computed to + * verify that the image has not changed. Useful for creating a certificate to + * be added to the file with ImageAddCertificate. + * + * PARAMS + * FileHandle [In] File for which to return a stream. + * DigestLevel [In] Flags to control which portions of the file to return. + * 0 is allowed, as is any combination of: + * CERT_PE_IMAGE_DIGEST_ALL_IMPORT_INFO: reports the entire + * import section rather than selected portions of it. + * CERT_PE_IMAGE_DIGEST_DEBUG_INFO: reports the debug section. + * CERT_PE_IMAGE_DIGEST_RESOURCES: reports the resources + section. + * DigestFunction [In] Callback function. + * DigestHandle [In] Handle passed as first parameter to DigestFunction. + * + * RETURNS + * TRUE if successful. + * FALSE if unsuccessful. GetLastError returns more about the error. + * + * NOTES + * Only supports 32-bit PE files, not tested with any other format. + * Reports data in the following order: + * 1. The file headers are reported first + * 2. Any code sections are reported next. + * 3. The data (".data" and ".rdata") sections are reported next. + * 4. The import section is reported next. + * 5. If CERT_PE_IMAGE_DIGEST_DEBUG_INFO is set in DigestLevel, the debug section is + * reported next. + * 6. If CERT_PE_IMAGE_DIGEST_RESOURCES is set in DigestLevel, the resources section + * is reported next. + * + * BUGS + * CERT_PE_IMAGE_DIGEST_ALL_IMPORT_INFO must be specified, returns an error if not. */ BOOL WINAPI ImageGetDigestStream( HANDLE FileHandle, DWORD DigestLevel, DIGEST_FUNCTION DigestFunction, DIGEST_HANDLE DigestHandle) { - FIXME("(%p, %d, %p, %p): stub\n", - FileHandle, DigestLevel, DigestFunction, DigestHandle - ); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + DWORD error = 0; + BOOL ret = FALSE; + DWORD offset, size, num_sections, fileSize; + HANDLE hMap = INVALID_HANDLE_VALUE; + BYTE *map = NULL; + IMAGE_DOS_HEADER *dos_hdr; + IMAGE_NT_HEADERS *nt_hdr; + IMAGE_SECTION_HEADER *section_headers; + + TRACE("(%p, %d, %p, %p)\n", FileHandle, DigestLevel, DigestFunction, + DigestHandle); + + /* Get the file size */ + if( !FileHandle ) + goto invalid_parameter; + fileSize = GetFileSize( FileHandle, NULL ); + if(fileSize == INVALID_FILE_SIZE ) + goto invalid_parameter; + + /* map file */ + hMap = CreateFileMappingW( FileHandle, NULL, PAGE_READONLY, 0, 0, NULL ); + if( hMap == INVALID_HANDLE_VALUE ) + goto invalid_parameter; + map = MapViewOfFile( hMap, FILE_MAP_COPY, 0, 0, 0 ); + if( !map ) + goto invalid_parameter; + + /* Read the file header */ + if( fileSize < sizeof(IMAGE_DOS_HEADER) ) + goto invalid_parameter; + dos_hdr = (IMAGE_DOS_HEADER *)map; + + if( dos_hdr->e_magic != IMAGE_DOS_SIGNATURE ) + goto invalid_parameter; + offset = dos_hdr->e_lfanew; + if( !offset || offset > fileSize ) + goto invalid_parameter; + ret = DigestFunction( DigestHandle, map, offset ); + if( !ret ) + goto end; + + /* Read the NT header */ + if( offset + sizeof(IMAGE_NT_HEADERS) > fileSize ) + goto invalid_parameter; + nt_hdr = (IMAGE_NT_HEADERS *)(map + offset); + if( nt_hdr->Signature != IMAGE_NT_SIGNATURE ) + goto invalid_parameter; + /* It's clear why the checksum is cleared, but why only these size headers? + */ + nt_hdr->OptionalHeader.SizeOfInitializedData = 0; + nt_hdr->OptionalHeader.SizeOfImage = 0; + nt_hdr->OptionalHeader.CheckSum = 0; + size = sizeof(nt_hdr->Signature) + sizeof(nt_hdr->FileHeader) + + nt_hdr->FileHeader.SizeOfOptionalHeader; + ret = DigestFunction( DigestHandle, map + offset, size ); + if( !ret ) + goto end; + + /* Read the section headers */ + offset += size; + num_sections = nt_hdr->FileHeader.NumberOfSections; + size = num_sections * sizeof(IMAGE_SECTION_HEADER); + if( offset + size > fileSize ) + goto invalid_parameter; + ret = DigestFunction( DigestHandle, map + offset, size ); + if( !ret ) + goto end; + + section_headers = (IMAGE_SECTION_HEADER *)(map + offset); + IMAGEHLP_ReportCodeSections( section_headers, num_sections, + map, fileSize, DigestFunction, DigestHandle ); + IMAGEHLP_ReportSection( section_headers, num_sections, ".data", + map, fileSize, DigestFunction, DigestHandle ); + IMAGEHLP_ReportSection( section_headers, num_sections, ".rdata", + map, fileSize, DigestFunction, DigestHandle ); + IMAGEHLP_ReportImportSection( section_headers, num_sections, + map, fileSize, DigestLevel, DigestFunction, DigestHandle ); + if( DigestLevel & CERT_PE_IMAGE_DIGEST_DEBUG_INFO ) + IMAGEHLP_ReportSection( section_headers, num_sections, ".debug", + map, fileSize, DigestFunction, DigestHandle ); + if( DigestLevel & CERT_PE_IMAGE_DIGEST_RESOURCES ) + IMAGEHLP_ReportSection( section_headers, num_sections, ".rsrc", + map, fileSize, DigestFunction, DigestHandle ); + +end: + if( map ) + UnmapViewOfFile( map ); + if( hMap != INVALID_HANDLE_VALUE ) + CloseHandle( hMap ); + if( error ) + SetLastError(error); + return ret; + +invalid_parameter: + error = ERROR_INVALID_PARAMETER; + goto end; } /*********************************************************************** diff --git a/dll/win32/iphlpapi/resinfo.h b/dll/win32/iphlpapi/resinfo.h index f735288c21e..1aaa352ceed 100644 --- a/dll/win32/iphlpapi/resinfo.h +++ b/dll/win32/iphlpapi/resinfo.h @@ -28,7 +28,7 @@ typedef struct _IPHLP_RES_INFO { /* Get resolver info. This currently is limited to a list of IP addresses * that name our DNS server list. */ -PIPHLP_RES_INFO getResInfo(); +PIPHLP_RES_INFO getResInfo(VOID); /* Release any resources used in acquiring the resolver information */ VOID disposeResInfo( PIPHLP_RES_INFO InfoPtr ); diff --git a/dll/win32/kernel32/file/bintype.c b/dll/win32/kernel32/file/bintype.c index e59a1c48c26..824121c395c 100644 --- a/dll/win32/kernel32/file/bintype.c +++ b/dll/win32/kernel32/file/bintype.c @@ -301,23 +301,43 @@ GetBinaryTypeW ( */ BOOL WINAPI -GetBinaryTypeA ( - LPCSTR lpApplicationName, - LPDWORD lpBinaryType - ) +GetBinaryTypeA(IN LPCSTR lpApplicationName, + OUT LPDWORD lpBinaryType) { - PWCHAR ApplicationNameW; + ANSI_STRING ApplicationNameString; + UNICODE_STRING ApplicationNameW; + BOOL StringAllocated = FALSE, Result; + NTSTATUS Status; - if(!lpApplicationName || !lpBinaryType) - { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } + RtlInitAnsiString(&ApplicationNameString, lpApplicationName); - if (!(ApplicationNameW = FilenameA2W(lpApplicationName, FALSE))) - return FALSE; + if (ApplicationNameString.Length * sizeof(WCHAR) >= NtCurrentTeb()->StaticUnicodeString.MaximumLength) + { + StringAllocated = TRUE; + Status = RtlAnsiStringToUnicodeString(&ApplicationNameW, &ApplicationNameString, TRUE); + } + else + { + Status = RtlAnsiStringToUnicodeString(&(NtCurrentTeb()->StaticUnicodeString), &ApplicationNameString, FALSE); + } - return GetBinaryTypeW(ApplicationNameW, lpBinaryType); + if (!NT_SUCCESS(Status)) + { + BaseSetLastNTError(Status); + return FALSE; + } + + if (StringAllocated) + { + Result = GetBinaryTypeW(ApplicationNameW.Buffer, lpBinaryType); + RtlFreeUnicodeString(&ApplicationNameW); + } + else + { + Result = GetBinaryTypeW(NtCurrentTeb()->StaticUnicodeString.Buffer, lpBinaryType); + } + + return Result; } /* EOF */ diff --git a/dll/win32/kernel32/file/cnotify.c b/dll/win32/kernel32/file/cnotify.c index 3f6420bf7ec..37814a13384 100644 --- a/dll/win32/kernel32/file/cnotify.c +++ b/dll/win32/kernel32/file/cnotify.c @@ -9,10 +9,14 @@ * Created 01/11/98 */ +/* INCLUDES *****************************************************************/ + #include #define NDEBUG #include +/* FUNCTIONS ****************************************************************/ + /* * @implemented */ @@ -35,20 +39,30 @@ FindCloseChangeNotification (HANDLE hChangeHandle) */ HANDLE WINAPI -FindFirstChangeNotificationA ( - LPCSTR lpPathName, - BOOL bWatchSubtree, - DWORD dwNotifyFilter - ) +FindFirstChangeNotificationA(IN LPCSTR lpPathName, + IN BOOL bWatchSubtree, + IN DWORD dwNotifyFilter) { - PWCHAR PathNameW; + NTSTATUS Status; + ANSI_STRING PathNameString; - if (!(PathNameW = FilenameA2W(lpPathName, FALSE))) - return INVALID_HANDLE_VALUE; + RtlInitAnsiString(&PathNameString, lpPathName); + Status = RtlAnsiStringToUnicodeString(&(NtCurrentTeb()->StaticUnicodeString), &PathNameString, FALSE); + if (!NT_SUCCESS(Status)) + { + if (Status != STATUS_BUFFER_OVERFLOW) + { + SetLastError(ERROR_FILENAME_EXCED_RANGE); + } + else + { + BaseSetLastNTError(Status); + } + return INVALID_HANDLE_VALUE; + } - return FindFirstChangeNotificationW (PathNameW , - bWatchSubtree, - dwNotifyFilter); + return FindFirstChangeNotificationW(NtCurrentTeb()->StaticUnicodeString.Buffer, + bWatchSubtree, dwNotifyFilter); } diff --git a/dll/win32/kernel32/file/copy.c b/dll/win32/kernel32/file/copy.c index a55fbff84cd..30c847bacf1 100644 --- a/dll/win32/kernel32/file/copy.c +++ b/dll/win32/kernel32/file/copy.c @@ -314,37 +314,36 @@ CopyFileExW ( */ BOOL WINAPI -CopyFileExA ( - LPCSTR lpExistingFileName, - LPCSTR lpNewFileName, - LPPROGRESS_ROUTINE lpProgressRoutine, - LPVOID lpData, - BOOL *pbCancel, - DWORD dwCopyFlags - ) +CopyFileExA(IN LPCSTR lpExistingFileName, + IN LPCSTR lpNewFileName, + IN LPPROGRESS_ROUTINE lpProgressRoutine OPTIONAL, + IN LPVOID lpData OPTIONAL, + IN LPBOOL pbCancel OPTIONAL, + IN DWORD dwCopyFlags) { - PWCHAR ExistingFileNameW; - PWCHAR NewFileNameW; - BOOL Result; + BOOL Result = FALSE; + UNICODE_STRING lpNewFileNameW; + PUNICODE_STRING lpExistingFileNameW; - if (!(ExistingFileNameW = FilenameA2W(lpExistingFileName, FALSE))) - return FALSE; + lpExistingFileNameW = Basep8BitStringToStaticUnicodeString(lpExistingFileName); + if (!lpExistingFileName) + { + return FALSE; + } - if (!(NewFileNameW = FilenameA2W(lpNewFileName, TRUE))) - return FALSE; + if (Basep8BitStringToDynamicUnicodeString(&lpNewFileNameW, lpNewFileName)) + { + Result = CopyFileExW(lpExistingFileNameW->Buffer, + lpNewFileNameW.Buffer, + lpProgressRoutine, + lpData, + pbCancel, + dwCopyFlags); - Result = CopyFileExW (ExistingFileNameW , - NewFileNameW , - lpProgressRoutine, - lpData, - pbCancel, - dwCopyFlags); + RtlFreeUnicodeString(&lpNewFileNameW); + } - RtlFreeHeap (RtlGetProcessHeap (), - 0, - NewFileNameW); - - return Result; + return Result; } diff --git a/dll/win32/kernel32/file/file.c b/dll/win32/kernel32/file/file.c index b79bc2b9876..7f0c0446441 100644 --- a/dll/win32/kernel32/file/file.c +++ b/dll/win32/kernel32/file/file.c @@ -5,7 +5,7 @@ * FILE: lib/kernel32/file/file.c * PURPOSE: Directory functions * PROGRAMMER: Ariadne ( ariadne@xs4all.nl) - * GetTempFileName is modified from WINE [ Alexandre Juiliard ] + * Pierre Schweitzer (pierre.schweitzer@reactos.org) * UPDATE HISTORY: * Created 01/11/98 */ @@ -406,26 +406,26 @@ OpenFile(LPCSTR lpFileName, * @implemented */ BOOL WINAPI -FlushFileBuffers(HANDLE hFile) +FlushFileBuffers(IN HANDLE hFile) { - NTSTATUS errCode; - IO_STATUS_BLOCK IoStatusBlock; + NTSTATUS Status; + IO_STATUS_BLOCK IoStatusBlock; - hFile = TranslateStdHandle(hFile); + hFile = TranslateStdHandle(hFile); - if (IsConsoleHandle(hFile)) - { - return FALSE; - } + if (IsConsoleHandle(hFile)) + { + return FlushConsoleInputBuffer(hFile); + } - errCode = NtFlushBuffersFile(hFile, - &IoStatusBlock); - if (!NT_SUCCESS(errCode)) - { - SetLastErrorByStatus(errCode); - return(FALSE); - } - return(TRUE); + Status = NtFlushBuffersFile(hFile, + &IoStatusBlock); + if (!NT_SUCCESS(Status)) + { + BaseSetLastNTError(Status); + return FALSE; + } + return TRUE; } @@ -1212,83 +1212,205 @@ SetFileAttributesW(LPCWSTR lpFileName, /*********************************************************************** * GetTempFileNameA (KERNEL32.@) */ -UINT WINAPI GetTempFileNameA( LPCSTR path, LPCSTR prefix, UINT unique, LPSTR buffer) +UINT WINAPI +GetTempFileNameA(IN LPCSTR lpPathName, + IN LPCSTR lpPrefixString, + IN UINT uUnique, + OUT LPSTR lpTempFileName) { - WCHAR BufferW[MAX_PATH]; - PWCHAR PathW; - WCHAR PrefixW[3+1]; - UINT ret; + UINT ID; + NTSTATUS Status; + LPWSTR lpTempFileNameW; + PUNICODE_STRING lpPathNameW; + ANSI_STRING TempFileNameStringA; + UNICODE_STRING lpPrefixStringW, TempFileNameStringW; - if (!(PathW = FilenameA2W(path, FALSE))) - return 0; - - if (prefix) - FilenameA2W_N(PrefixW, 3+1, prefix, -1); - - ret = GetTempFileNameW(PathW, prefix ? PrefixW : NULL, unique, BufferW); - - if (ret) - FilenameW2A_N(buffer, MAX_PATH, BufferW, -1); - - return ret; -} - -/*********************************************************************** - * GetTempFileNameW (KERNEL32.@) - */ -UINT WINAPI GetTempFileNameW( LPCWSTR path, LPCWSTR prefix, UINT unique, LPWSTR buffer ) -{ - static const WCHAR formatW[] = L"%x.tmp"; - - int i; - LPWSTR p; - - if ( !path || !buffer ) + /* Convert strings */ + lpPathNameW = Basep8BitStringToStaticUnicodeString(lpPathName); + if (!lpPathNameW) { - SetLastError( ERROR_INVALID_PARAMETER ); return 0; } - wcscpy( buffer, path ); - p = buffer + wcslen(buffer); - - /* add a \, if there isn't one */ - if ((p == buffer) || (p[-1] != '\\')) *p++ = '\\'; - - if ( prefix ) - for (i = 3; (i > 0) && (*prefix); i--) *p++ = *prefix++; - - unique &= 0xffff; - - if (unique) swprintf( p, formatW, unique ); - else + if (!Basep8BitStringToDynamicUnicodeString(&lpPrefixStringW, lpPrefixString)) { - /* get a "random" unique number and try to create the file */ - HANDLE handle; - UINT num = GetTickCount() & 0xffff; - - if (!num) num = 1; - unique = num; - do - { - swprintf( p, formatW, unique ); - handle = CreateFileW( buffer, GENERIC_WRITE, 0, NULL, - CREATE_NEW, FILE_ATTRIBUTE_NORMAL, 0 ); - if (handle != INVALID_HANDLE_VALUE) - { /* We created it */ - TRACE("created %S\n", buffer); - CloseHandle( handle ); - break; - } - if (GetLastError() != ERROR_FILE_EXISTS && - GetLastError() != ERROR_SHARING_VIOLATION) - break; /* No need to go on */ - if (!(++unique & 0xffff)) unique = 1; - } while (unique != num); + return 0; } - TRACE("returning %S\n", buffer); - return unique; + lpTempFileNameW = RtlAllocateHeap(RtlGetProcessHeap(), 0, MAX_PATH * sizeof(WCHAR)); + if (!lpTempFileNameW) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + RtlFreeUnicodeString(&lpPrefixStringW); + return 0; + } + + /* Call Unicode */ + ID = GetTempFileNameW(lpPathNameW->Buffer, lpPrefixStringW.Buffer, uUnique, lpTempFileNameW); + if (ID) + { + RtlInitUnicodeString(&TempFileNameStringW, lpTempFileNameW); + TempFileNameStringA.Buffer = lpTempFileName; + TempFileNameStringA.MaximumLength = MAX_PATH; + + Status = BasepUnicodeStringTo8BitString(&TempFileNameStringA, &TempFileNameStringW, FALSE); + if (!NT_SUCCESS(Status)) + { + BaseSetLastNTError(Status); + ID = 0; + } + } + + /* Cleanup */ + RtlFreeUnicodeString(&lpPrefixStringW); + RtlFreeHeap(RtlGetProcessHeap(), 0, lpTempFileNameW); + return ID; + } + + /*********************************************************************** + * GetTempFileNameW (KERNEL32.@) + */ +UINT WINAPI +GetTempFileNameW(IN LPCWSTR lpPathName, + IN LPCWSTR lpPrefixString, + IN UINT uUnique, + OUT LPWSTR lpTempFileName) +{ + CHAR * Let; + HANDLE TempFile; + UINT ID, Num = 0; + CHAR IDString[5]; + WCHAR * TempFileName; + CSR_API_MESSAGE ApiMessage; + DWORD FileAttributes, LastError; + UNICODE_STRING PathNameString, PrefixString; + static const WCHAR Ext[] = { L'.', 't', 'm', 'p', UNICODE_NULL }; + + RtlInitUnicodeString(&PathNameString, lpPathName); + if (PathNameString.Length == 0 || PathNameString.Buffer[(PathNameString.Length / sizeof(WCHAR)) - 1] != L'\\') + { + PathNameString.Length += sizeof(WCHAR); + } + + /* lpTempFileName must be able to contain: PathName, Prefix (3), number(4), .tmp(4) & \0(1) + * See: http://msdn.microsoft.com/en-us/library/aa364991%28v=vs.85%29.aspx + */ + if (PathNameString.Length > (MAX_PATH - 3 - 4 - 4 - 1) * sizeof(WCHAR)) + { + SetLastError(ERROR_BUFFER_OVERFLOW); + return 0; + } + + /* If PathName and TempFileName aren't the same buffer, move PathName to TempFileName */ + if (lpPathName != lpTempFileName) + { + memmove(lpTempFileName, PathNameString.Buffer, PathNameString.Length); + } + + /* PathName MUST BE a path. Check it */ + lpTempFileName[(PathNameString.Length / sizeof(WCHAR)) - 1] = UNICODE_NULL; + FileAttributes = GetFileAttributesW(lpTempFileName); + if (FileAttributes == INVALID_FILE_ATTRIBUTES) + { + /* Append a '\' if necessary */ + lpTempFileName[(PathNameString.Length / sizeof(WCHAR)) - 1] = L'\\'; + lpTempFileName[PathNameString.Length / sizeof(WCHAR)] = UNICODE_NULL; + FileAttributes = GetFileAttributesW(lpTempFileName); + if (FileAttributes == INVALID_FILE_ATTRIBUTES) + { + SetLastError(ERROR_DIRECTORY); + return 0; + } + } + if (!(FileAttributes & FILE_ATTRIBUTE_DIRECTORY)) + { + SetLastError(ERROR_DIRECTORY); + return 0; + } + + /* Make sure not to mix path & prefix */ + lpTempFileName[(PathNameString.Length / sizeof(WCHAR)) - 1] = L'\\'; + RtlInitUnicodeString(&PrefixString, lpPrefixString); + if (PrefixString.Length > 3 * sizeof(WCHAR)) + { + PrefixString.Length = 3 * sizeof(WCHAR); + } + + /* Append prefix to path */ + TempFileName = lpTempFileName + PathNameString.Length / sizeof(WCHAR); + memmove(TempFileName, PrefixString.Buffer, PrefixString.Length); + TempFileName += PrefixString.Length / sizeof(WCHAR); + + /* Then, generate filename */ + do + { + /* If user didn't gave any ID, ask Csrss to give one */ + if (!uUnique) + { + CsrClientCallServer(&ApiMessage, NULL, MAKE_CSR_API(GET_TEMP_FILE, CSR_NATIVE), sizeof(CSR_API_MESSAGE)); + if (ApiMessage.Data.GetTempFile.UniqueID == 0) + { + Num++; + continue; + } + + ID = ApiMessage.Data.GetTempFile.UniqueID; + } + else + { + ID = uUnique; + } + + /* Convert that ID to wchar */ + RtlIntegerToChar(ID, 0x10, sizeof(IDString), IDString); + Let = IDString; + do + { + *(TempFileName++) = RtlAnsiCharToUnicodeChar(&Let); + } while (*Let != 0); + + /* Append extension & UNICODE_NULL */ + memmove(TempFileName, Ext, sizeof(Ext) + sizeof(WCHAR)); + + /* If user provided its ID, just return */ + if (uUnique) + { + return uUnique; + } + + /* Then, try to create file */ + if (!RtlIsDosDeviceName_U(lpTempFileName)) + { + TempFile = CreateFileW(lpTempFileName, + GENERIC_READ, + 0, + NULL, + CREATE_NEW, + FILE_ATTRIBUTE_NORMAL, + 0); + if (TempFile != INVALID_HANDLE_VALUE) + { + NtClose(TempFile); + DPRINT("Temp file: %S\n", lpTempFileName); + return ID; + } + + LastError = GetLastError(); + /* There is no need to recover from those errors, they would hit next step */ + if (LastError == ERROR_INVALID_PARAMETER || LastError == ERROR_CANNOT_MAKE || + LastError == ERROR_WRITE_PROTECT || LastError == ERROR_NETWORK_ACCESS_DENIED || + LastError == ERROR_DISK_FULL || LastError == ERROR_INVALID_NAME || + LastError == ERROR_BAD_PATHNAME || LastError == ERROR_NO_INHERITANCE || + LastError == ERROR_DISK_CORRUPT || + (LastError == ERROR_ACCESS_DENIED && NtCurrentTeb()->LastStatusValue != STATUS_FILE_IS_A_DIRECTORY)) + { + break; + } + } + Num++; + } while (Num & 0xFFFF); + + return 0; } @@ -1299,40 +1421,51 @@ UINT WINAPI GetTempFileNameW( LPCWSTR path, LPCWSTR prefix, UINT unique, LPWSTR * @implemented */ BOOL WINAPI -GetFileTime(HANDLE hFile, - LPFILETIME lpCreationTime, - LPFILETIME lpLastAccessTime, - LPFILETIME lpLastWriteTime) +GetFileTime(IN HANDLE hFile, + OUT LPFILETIME lpCreationTime OPTIONAL, + OUT LPFILETIME lpLastAccessTime OPTIONAL, + OUT LPFILETIME lpLastWriteTime OPTIONAL) { - IO_STATUS_BLOCK IoStatusBlock; - FILE_BASIC_INFORMATION FileBasic; - NTSTATUS Status; + NTSTATUS Status; + IO_STATUS_BLOCK IoStatusBlock; + FILE_BASIC_INFORMATION FileBasic; - if(IsConsoleHandle(hFile)) - { - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } + if(IsConsoleHandle(hFile)) + { + BaseSetLastNTError(STATUS_INVALID_HANDLE); + return FALSE; + } - Status = NtQueryInformationFile(hFile, - &IoStatusBlock, - &FileBasic, - sizeof(FILE_BASIC_INFORMATION), - FileBasicInformation); - if (!NT_SUCCESS(Status)) - { - SetLastErrorByStatus(Status); - return FALSE; - } + Status = NtQueryInformationFile(hFile, + &IoStatusBlock, + &FileBasic, + sizeof(FILE_BASIC_INFORMATION), + FileBasicInformation); + if (!NT_SUCCESS(Status)) + { + BaseSetLastNTError(Status); + return FALSE; + } - if (lpCreationTime) - memcpy(lpCreationTime, &FileBasic.CreationTime, sizeof(FILETIME)); - if (lpLastAccessTime) - memcpy(lpLastAccessTime, &FileBasic.LastAccessTime, sizeof(FILETIME)); - if (lpLastWriteTime) - memcpy(lpLastWriteTime, &FileBasic.LastWriteTime, sizeof(FILETIME)); + if (lpCreationTime) + { + lpCreationTime->dwLowDateTime = FileBasic.CreationTime.LowPart; + lpCreationTime->dwHighDateTime = FileBasic.CreationTime.HighPart; + } - return TRUE; + if (lpLastAccessTime) + { + lpLastAccessTime->dwLowDateTime = FileBasic.LastAccessTime.LowPart; + lpLastAccessTime->dwHighDateTime = FileBasic.LastAccessTime.HighPart; + } + + if (lpLastWriteTime) + { + lpLastWriteTime->dwLowDateTime = FileBasic.LastWriteTime.LowPart; + lpLastWriteTime->dwHighDateTime = FileBasic.LastWriteTime.HighPart; + } + + return TRUE; } @@ -1340,53 +1473,53 @@ GetFileTime(HANDLE hFile, * @implemented */ BOOL WINAPI -SetFileTime(HANDLE hFile, - CONST FILETIME *lpCreationTime, - CONST FILETIME *lpLastAccessTime, - CONST FILETIME *lpLastWriteTime) +SetFileTime(IN HANDLE hFile, + CONST FILETIME *lpCreationTime OPTIONAL, + CONST FILETIME *lpLastAccessTime OPTIONAL, + CONST FILETIME *lpLastWriteTime OPTIONAL) { - FILE_BASIC_INFORMATION FileBasic; - IO_STATUS_BLOCK IoStatusBlock; - NTSTATUS Status; + NTSTATUS Status; + IO_STATUS_BLOCK IoStatusBlock; + FILE_BASIC_INFORMATION FileBasic; - if(IsConsoleHandle(hFile)) - { - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } + if(IsConsoleHandle(hFile)) + { + BaseSetLastNTError(STATUS_INVALID_HANDLE); + return FALSE; + } - Status = NtQueryInformationFile(hFile, - &IoStatusBlock, - &FileBasic, - sizeof(FILE_BASIC_INFORMATION), - FileBasicInformation); - if (!NT_SUCCESS(Status)) - { - SetLastErrorByStatus(Status); - return FALSE; - } + memset(&FileBasic, 0, sizeof(FILE_BASIC_INFORMATION)); - if (lpCreationTime) - memcpy(&FileBasic.CreationTime, lpCreationTime, sizeof(FILETIME)); - if (lpLastAccessTime) - memcpy(&FileBasic.LastAccessTime, lpLastAccessTime, sizeof(FILETIME)); - if (lpLastWriteTime) - memcpy(&FileBasic.LastWriteTime, lpLastWriteTime, sizeof(FILETIME)); + if (lpCreationTime) + { + FileBasic.CreationTime.LowPart = lpCreationTime->dwLowDateTime; + FileBasic.CreationTime.HighPart = lpCreationTime->dwHighDateTime; + } - // should i initialize changetime ??? + if (lpLastAccessTime) + { + FileBasic.LastAccessTime.LowPart = lpLastAccessTime->dwLowDateTime; + FileBasic.LastAccessTime.HighPart = lpLastAccessTime->dwHighDateTime; + } - Status = NtSetInformationFile(hFile, - &IoStatusBlock, - &FileBasic, - sizeof(FILE_BASIC_INFORMATION), - FileBasicInformation); - if (!NT_SUCCESS(Status)) - { - SetLastErrorByStatus(Status); - return FALSE; - } + if (lpLastWriteTime) + { + FileBasic.LastWriteTime.LowPart = lpLastWriteTime->dwLowDateTime; + FileBasic.LastWriteTime.HighPart = lpLastWriteTime->dwHighDateTime; + } - return TRUE; + Status = NtSetInformationFile(hFile, + &IoStatusBlock, + &FileBasic, + sizeof(FILE_BASIC_INFORMATION), + FileBasicInformation); + if (!NT_SUCCESS(Status)) + { + BaseSetLastNTError(Status); + return FALSE; + } + + return TRUE; } diff --git a/dll/win32/kernel32/file/find.c b/dll/win32/kernel32/file/find.c index 967d94c3df5..0060e662889 100644 --- a/dll/win32/kernel32/file/find.c +++ b/dll/win32/kernel32/file/find.c @@ -5,6 +5,7 @@ * FILE: lib/kernel32/file/find.c * PURPOSE: Find functions * PROGRAMMER: Ariadne ( ariadne@xs4all.nl) + * Pierre Schweitzer (pierre.schweitzer@reactos.org) * UPDATE HISTORY: * Created 01/11/98 */ @@ -73,34 +74,6 @@ InternalCopyDeviceFindDataW(LPWIN32_FIND_DATAW lpFindFileData, DeviceName.Length); } -static VOID -InternalCopyDeviceFindDataA(LPWIN32_FIND_DATAA lpFindFileData, - PUNICODE_STRING FileName, - ULONG DeviceNameInfo) -{ - UNICODE_STRING DeviceName; - ANSI_STRING BufferA; - CHAR Buffer[MAX_PATH]; - - DeviceName.Length = DeviceName.MaximumLength = (USHORT)(DeviceNameInfo & 0xFFFF); - DeviceName.Buffer = (LPWSTR)((ULONG_PTR)FileName->Buffer + (DeviceNameInfo >> 16)); - - BufferA.MaximumLength = sizeof(Buffer) - sizeof(Buffer[0]); - BufferA.Buffer = Buffer; - if (bIsFileApiAnsi) - RtlUnicodeStringToAnsiString (&BufferA, &DeviceName, FALSE); - else - RtlUnicodeStringToOemString (&BufferA, &DeviceName, FALSE); - - /* Return the data */ - RtlZeroMemory(lpFindFileData, - sizeof(*lpFindFileData)); - lpFindFileData->dwFileAttributes = FILE_ATTRIBUTE_ARCHIVE; - RtlCopyMemory(lpFindFileData->cFileName, - BufferA.Buffer, - BufferA.Length); -} - static VOID InternalCopyFindDataW(LPWIN32_FIND_DATAW lpFindFileData, PFILE_BOTH_DIR_INFORMATION lpFileInfo) @@ -126,57 +99,6 @@ InternalCopyFindDataW(LPWIN32_FIND_DATAW lpFindFileData, lpFindFileData->cAlternateFileName[lpFileInfo->ShortNameLength / sizeof(WCHAR)] = 0; } -static VOID -InternalCopyFindDataA(LPWIN32_FIND_DATAA lpFindFileData, - PFILE_BOTH_DIR_INFORMATION lpFileInfo) -{ - UNICODE_STRING FileNameU; - ANSI_STRING FileNameA; - - lpFindFileData->dwFileAttributes = lpFileInfo->FileAttributes; - - lpFindFileData->ftCreationTime.dwHighDateTime = lpFileInfo->CreationTime.u.HighPart; - lpFindFileData->ftCreationTime.dwLowDateTime = lpFileInfo->CreationTime.u.LowPart; - - lpFindFileData->ftLastAccessTime.dwHighDateTime = lpFileInfo->LastAccessTime.u.HighPart; - lpFindFileData->ftLastAccessTime.dwLowDateTime = lpFileInfo->LastAccessTime.u.LowPart; - - lpFindFileData->ftLastWriteTime.dwHighDateTime = lpFileInfo->LastWriteTime.u.HighPart; - lpFindFileData->ftLastWriteTime.dwLowDateTime = lpFileInfo->LastWriteTime.u.LowPart; - - lpFindFileData->nFileSizeHigh = lpFileInfo->EndOfFile.u.HighPart; - lpFindFileData->nFileSizeLow = lpFileInfo->EndOfFile.u.LowPart; - - FileNameU.Length = FileNameU.MaximumLength = (USHORT)lpFileInfo->FileNameLength; - FileNameU.Buffer = lpFileInfo->FileName; - - FileNameA.MaximumLength = sizeof(lpFindFileData->cFileName) - sizeof(CHAR); - FileNameA.Buffer = lpFindFileData->cFileName; - - /* convert unicode string to ansi (or oem) */ - if (bIsFileApiAnsi) - RtlUnicodeStringToAnsiString (&FileNameA, &FileNameU, FALSE); - else - RtlUnicodeStringToOemString (&FileNameA, &FileNameU, FALSE); - - FileNameA.Buffer[FileNameA.Length] = 0; - - TRACE("lpFileInfo->ShortNameLength %d\n", lpFileInfo->ShortNameLength); - - FileNameU.Length = FileNameU.MaximumLength = lpFileInfo->ShortNameLength; - FileNameU.Buffer = lpFileInfo->ShortName; - - FileNameA.MaximumLength = sizeof(lpFindFileData->cAlternateFileName) - sizeof(CHAR); - FileNameA.Buffer = lpFindFileData->cAlternateFileName; - - /* convert unicode string to ansi (or oem) */ - if (bIsFileApiAnsi) - RtlUnicodeStringToAnsiString (&FileNameA, &FileNameU, FALSE); - else - RtlUnicodeStringToOemString (&FileNameA, &FileNameU, FALSE); - - FileNameA.Buffer[FileNameA.Length] = 0; -} /* * @implemented @@ -186,8 +108,7 @@ WINAPI InternalFindNextFile ( HANDLE hFindFile, PUNICODE_STRING SearchPattern, - PVOID lpFindFileData, - BOOL bUnicode + PVOID lpFindFileData ) { PKERNEL32_FIND_DATA_HEADER IHeader; @@ -290,16 +211,8 @@ NeedMoreData: { _SEH2_TRY { - if (bUnicode) - { - InternalCopyFindDataW(lpFindFileData, - FoundFile); - } - else - { - InternalCopyFindDataA(lpFindFileData, - FoundFile); - } + InternalCopyFindDataW(lpFindFileData, + FoundFile); } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { @@ -334,8 +247,7 @@ WINAPI InternalFindFirstFile ( LPCWSTR lpFileName, BOOLEAN DirectoryOnly, - PVOID lpFindFileData, - BOOL bUnicode + PVOID lpFindFileData ) { OBJECT_ATTRIBUTES ObjectAttributes; @@ -460,18 +372,9 @@ InternalFindFirstFile ( DeviceNameInfo = RtlIsDosDeviceName_U((PWSTR)((ULONG_PTR)lpFileName)); if (DeviceNameInfo != 0) { - if (bUnicode) - { - InternalCopyDeviceFindDataW(lpFindFileData, - lpFileName, - DeviceNameInfo); - } - else - { - InternalCopyDeviceFindDataA(lpFindFileData, - &FileName, - DeviceNameInfo); - } + InternalCopyDeviceFindDataW(lpFindFileData, + lpFileName, + DeviceNameInfo); return FIND_DEVICE_HANDLE; } @@ -526,8 +429,7 @@ InternalFindFirstFile ( bResult = InternalFindNextFile((HANDLE)IHeader, &PathFileName, - lpFindFileData, - bUnicode); + lpFindFileData); RtlFreeHeap (hProcessHeap, 0, @@ -551,17 +453,59 @@ InternalFindFirstFile ( */ HANDLE WINAPI -FindFirstFileA ( - LPCSTR lpFileName, - LPWIN32_FIND_DATAA lpFindFileData - ) +FindFirstFileA(IN LPCSTR lpFileName, + OUT LPWIN32_FIND_DATAA lpFindFileData) { - return FindFirstFileExA (lpFileName, - FindExInfoStandard, - (LPVOID)lpFindFileData, - FindExSearchNameMatch, - NULL, - 0); + HANDLE hSearch; + NTSTATUS Status; + ANSI_STRING Ansi; + UNICODE_STRING UTF8; + PUNICODE_STRING lpFileNameW; + WIN32_FIND_DATAW FindFileDataW; + + lpFileNameW = Basep8BitStringToStaticUnicodeString(lpFileName); + if (!lpFileNameW) + { + return INVALID_HANDLE_VALUE; + } + + hSearch = FindFirstFileExW(lpFileNameW->Buffer, + FindExInfoStandard, + &FindFileDataW, + FindExSearchNameMatch, + NULL, 0); + if (hSearch == INVALID_HANDLE_VALUE) + { + return INVALID_HANDLE_VALUE; + } + + memcpy(lpFindFileData, &FindFileDataW, FIELD_OFFSET(WIN32_FIND_DATA, cFileName)); + + RtlInitUnicodeString(&UTF8, FindFileDataW.cFileName); + Ansi.Buffer = lpFindFileData->cFileName; + Ansi.Length = 0; + Ansi.MaximumLength = MAX_PATH; + Status = BasepUnicodeStringTo8BitString(&Ansi, &UTF8, FALSE); + if (!NT_SUCCESS(Status)) + { + FindClose(hSearch); + BaseSetLastNTError(Status); + return INVALID_HANDLE_VALUE; + } + + RtlInitUnicodeString(&UTF8, FindFileDataW.cAlternateFileName); + Ansi.Buffer = lpFindFileData->cAlternateFileName; + Ansi.Length = 0; + Ansi.MaximumLength = 14; + Status = BasepUnicodeStringTo8BitString(&Ansi, &UTF8, FALSE); + if (!NT_SUCCESS(Status)) + { + FindClose(hSearch); + BaseSetLastNTError(Status); + return INVALID_HANDLE_VALUE; + } + + return hSearch; } @@ -570,14 +514,44 @@ FindFirstFileA ( */ BOOL WINAPI -FindNextFileA ( - HANDLE hFindFile, - LPWIN32_FIND_DATAA lpFindFileData) +FindNextFileA(IN HANDLE hFindFile, + OUT LPWIN32_FIND_DATAA lpFindFileData) { - return InternalFindNextFile (hFindFile, - NULL, - lpFindFileData, - FALSE); + NTSTATUS Status; + ANSI_STRING Ansi; + UNICODE_STRING UTF8; + WIN32_FIND_DATAW FindFileDataW; + + if (!FindNextFileW(hFindFile, &FindFileDataW)) + { + return FALSE; + } + + memcpy(lpFindFileData, &FindFileDataW, FIELD_OFFSET(WIN32_FIND_DATA, cFileName)); + + RtlInitUnicodeString(&UTF8, FindFileDataW.cFileName); + Ansi.Buffer = lpFindFileData->cFileName; + Ansi.Length = 0; + Ansi.MaximumLength = MAX_PATH; + Status = BasepUnicodeStringTo8BitString(&Ansi, &UTF8, FALSE); + if (!NT_SUCCESS(Status)) + { + BaseSetLastNTError(Status); + return FALSE; + } + + RtlInitUnicodeString(&UTF8, FindFileDataW.cAlternateFileName); + Ansi.Buffer = lpFindFileData->cAlternateFileName; + Ansi.Length = 0; + Ansi.MaximumLength = 14; + Status = BasepUnicodeStringTo8BitString(&Ansi, &UTF8, FALSE); + if (!NT_SUCCESS(Status)) + { + BaseSetLastNTError(Status); + return FALSE; + } + + return TRUE; } @@ -643,17 +617,15 @@ FindClose ( */ HANDLE WINAPI -FindFirstFileW ( - LPCWSTR lpFileName, - LPWIN32_FIND_DATAW lpFindFileData - ) +FindFirstFileW(IN LPCWSTR lpFileName, + OUT LPWIN32_FIND_DATAW lpFindFileData) { - return FindFirstFileExW (lpFileName, - FindExInfoStandard, - (LPVOID)lpFindFileData, - FindExSearchNameMatch, - NULL, - 0); + return FindFirstFileExW(lpFileName, + FindExInfoStandard, + lpFindFileData, + FindExSearchNameMatch, + NULL, + 0); } /* @@ -661,15 +633,12 @@ FindFirstFileW ( */ BOOL WINAPI -FindNextFileW ( - HANDLE hFindFile, - LPWIN32_FIND_DATAW lpFindFileData - ) +FindNextFileW(IN HANDLE hFindFile, + OUT LPWIN32_FIND_DATAW lpFindFileData) { - return InternalFindNextFile (hFindFile, - NULL, - lpFindFileData, - TRUE); + return InternalFindNextFile(hFindFile, + NULL, + lpFindFileData); } @@ -678,12 +647,12 @@ FindNextFileW ( */ HANDLE WINAPI -FindFirstFileExW (LPCWSTR lpFileName, - FINDEX_INFO_LEVELS fInfoLevelId, - LPVOID lpFindFileData, - FINDEX_SEARCH_OPS fSearchOp, - LPVOID lpSearchFilter, - DWORD dwAdditionalFlags) +FindFirstFileExW(IN LPCWSTR lpFileName, + IN FINDEX_INFO_LEVELS fInfoLevelId, + OUT LPVOID lpFindFileData, + IN FINDEX_SEARCH_OPS fSearchOp, + LPVOID lpSearchFilter, + IN DWORD dwAdditionalFlags) { if (fInfoLevelId != FindExInfoStandard) { @@ -701,8 +670,7 @@ FindFirstFileExW (LPCWSTR lpFileName, return InternalFindFirstFile (lpFileName, fSearchOp == FindExSearchLimitToDirectories, - lpFindFileData, - TRUE); + lpFindFileData); } SetLastError(ERROR_INVALID_PARAMETER); @@ -714,51 +682,64 @@ FindFirstFileExW (LPCWSTR lpFileName, */ HANDLE WINAPI -FindFirstFileExA ( - LPCSTR lpFileName, - FINDEX_INFO_LEVELS fInfoLevelId, - LPVOID lpFindFileData, - FINDEX_SEARCH_OPS fSearchOp, - LPVOID lpSearchFilter, - DWORD dwAdditionalFlags - ) +FindFirstFileExA(IN LPCSTR lpFileName, + IN FINDEX_INFO_LEVELS fInfoLevelId, + OUT LPVOID lpFindFileData, + IN FINDEX_SEARCH_OPS fSearchOp, + LPVOID lpSearchFilter, + IN DWORD dwAdditionalFlags) { - UNICODE_STRING FileNameU; - ANSI_STRING FileNameA; - HANDLE Handle; + HANDLE hSearch; + NTSTATUS Status; + ANSI_STRING Ansi; + UNICODE_STRING UTF8; + PUNICODE_STRING lpFileNameW; + WIN32_FIND_DATAW FindFileDataW; - if (fInfoLevelId != FindExInfoStandard) + lpFileNameW = Basep8BitStringToStaticUnicodeString(lpFileName); + if (!lpFileNameW) { - SetLastError(ERROR_INVALID_PARAMETER); return INVALID_HANDLE_VALUE; } - if (fSearchOp == FindExSearchNameMatch || fSearchOp == FindExSearchLimitToDirectories) + + hSearch = FindFirstFileExW(lpFileNameW->Buffer, + fInfoLevelId, + &FindFileDataW, + fSearchOp, + lpSearchFilter, + dwAdditionalFlags); + if (hSearch == INVALID_HANDLE_VALUE) { - if (lpSearchFilter) - { - SetLastError(ERROR_INVALID_PARAMETER); - return INVALID_HANDLE_VALUE; - } - - RtlInitAnsiString (&FileNameA, (LPSTR)lpFileName); - - /* convert ansi (or oem) string to unicode */ - if (bIsFileApiAnsi) - RtlAnsiStringToUnicodeString (&FileNameU, &FileNameA, TRUE); - else - RtlOemStringToUnicodeString (&FileNameU, &FileNameA, TRUE); - - Handle = InternalFindFirstFile (FileNameU.Buffer, - fSearchOp == FindExSearchLimitToDirectories, - lpFindFileData, - FALSE); - - RtlFreeUnicodeString (&FileNameU); - return Handle; + return INVALID_HANDLE_VALUE; } - SetLastError(ERROR_INVALID_PARAMETER); - return INVALID_HANDLE_VALUE; + memcpy(lpFindFileData, &FindFileDataW, FIELD_OFFSET(WIN32_FIND_DATA, cFileName)); + + RtlInitUnicodeString(&UTF8, FindFileDataW.cFileName); + Ansi.Buffer = ((LPWIN32_FIND_DATAA)lpFindFileData)->cFileName; + Ansi.Length = 0; + Ansi.MaximumLength = MAX_PATH; + Status = BasepUnicodeStringTo8BitString(&Ansi, &UTF8, FALSE); + if (!NT_SUCCESS(Status)) + { + FindClose(hSearch); + BaseSetLastNTError(Status); + return INVALID_HANDLE_VALUE; + } + + RtlInitUnicodeString(&UTF8, FindFileDataW.cAlternateFileName); + Ansi.Buffer = ((LPWIN32_FIND_DATAA)lpFindFileData)->cAlternateFileName; + Ansi.Length = 0; + Ansi.MaximumLength = 14; + Status = BasepUnicodeStringTo8BitString(&Ansi, &UTF8, FALSE); + if (!NT_SUCCESS(Status)) + { + FindClose(hSearch); + BaseSetLastNTError(Status); + return INVALID_HANDLE_VALUE; + } + + return hSearch; } diff --git a/dll/win32/kernel32/file/npipe.c b/dll/win32/kernel32/file/npipe.c index 629b69b678f..8915fb18052 100644 --- a/dll/win32/kernel32/file/npipe.c +++ b/dll/win32/kernel32/file/npipe.c @@ -251,7 +251,7 @@ WaitNamedPipeA(LPCSTR lpNamedPipeName, UNICODE_STRING NameU; /* Convert the name to Unicode */ - Basep8BitStringToHeapUnicodeString(&NameU, lpNamedPipeName); + Basep8BitStringToDynamicUnicodeString(&NameU, lpNamedPipeName); /* Call the Unicode API */ r = WaitNamedPipeW(NameU.Buffer, nTimeOut); @@ -501,19 +501,19 @@ WaitNamedPipeW(LPCWSTR lpNamedPipeName, } /* Check what timeout we got */ - if (nTimeOut == NMPWAIT_USE_DEFAULT_WAIT) + if (nTimeOut == NMPWAIT_WAIT_FOREVER) { /* Don't use a timeout */ WaitPipe.TimeoutSpecified = FALSE; } else { - /* Check if we should wait forever */ - if (nTimeOut == NMPWAIT_WAIT_FOREVER) + /* Check if default */ + if (nTimeOut == NMPWAIT_USE_DEFAULT_WAIT) { - /* Set the max */ + /* Set it to 0 */ WaitPipe.Timeout.LowPart = 0; - WaitPipe.Timeout.HighPart = 0x80000000; + WaitPipe.Timeout.HighPart = 0; } else { diff --git a/dll/win32/kernel32/include/kernel32.h b/dll/win32/kernel32/include/kernel32.h index fae3e844009..747c8b1b664 100755 --- a/dll/win32/kernel32/include/kernel32.h +++ b/dll/win32/kernel32/include/kernel32.h @@ -68,8 +68,6 @@ #define STARTF_SHELLPRIVATE 0x400 #define SetLastErrorByStatus(x) RtlSetLastWin32ErrorAndNtStatusFromNtStatus((x)) -#define GetLastError() NtCurrentTeb()->LastErrorValue -#define SetLastError(x) NtCurrentTeb()->LastErrorValue = (x) typedef struct _CODEPAGE_ENTRY { @@ -192,17 +190,14 @@ BasepAnsiStringToHeapUnicodeString(IN LPCSTR AnsiString, PUNICODE_STRING WINAPI -Basep8BitStringToCachedUnicodeString(IN LPCSTR String); +Basep8BitStringToStaticUnicodeString(IN LPCSTR AnsiString); -NTSTATUS +BOOLEAN WINAPI -Basep8BitStringToLiveUnicodeString(OUT PUNICODE_STRING UnicodeString, - IN LPCSTR String); - -NTSTATUS -WINAPI -Basep8BitStringToHeapUnicodeString(OUT PUNICODE_STRING UnicodeString, - IN LPCSTR String); +Basep8BitStringToDynamicUnicodeString(OUT PUNICODE_STRING UnicodeString, + IN LPCSTR String); + +#define BasepUnicodeStringTo8BitString RtlUnicodeStringToAnsiString typedef NTSTATUS (NTAPI *PRTL_CONVERT_STRING)(IN PUNICODE_STRING UnicodeString, IN PANSI_STRING AnsiString, @@ -225,3 +220,10 @@ GetDllLoadPath(LPCWSTR lpModule); VOID WINAPI InitCommandLines(VOID); + +VOID +WINAPI +BaseSetLastNTError(IN NTSTATUS Status); + +/* FIXME */ +WCHAR WINAPI RtlAnsiCharToUnicodeChar(LPSTR *); diff --git a/dll/win32/kernel32/kernel32.spec b/dll/win32/kernel32/kernel32.spec index e8adc8e7a6c..c0a8bf54022 100644 --- a/dll/win32/kernel32/kernel32.spec +++ b/dll/win32/kernel32/kernel32.spec @@ -44,7 +44,7 @@ @ stdcall BaseProcessInitPostImport() ; missing in Win 7 @ stdcall BaseQueryModuleData(str str ptr ptr ptr) ;check ;@ stdcall BaseThreadInitThunk ; Win 7 -;@ stdcall BaseSetLastNTError ; Win 7, not 64 bit +;@ stdcall BaseSetLastNTError ; Win 7, not 64 bit (present on w2k3 but not exported) @ stdcall BaseUpdateAppcompatCache(long long long) ;@ stdcall BaseVerifyUnicodeString ; Win 7 ;@ stdcall Basep8BitStringToDynamicUnicodeString ; Win 7 diff --git a/dll/win32/kernel32/mem/local.c b/dll/win32/kernel32/mem/local.c index 68d9de20699..875ae4bce8a 100644 --- a/dll/win32/kernel32/mem/local.c +++ b/dll/win32/kernel32/mem/local.c @@ -441,8 +441,62 @@ BOOL NTAPI LocalUnlock(HLOCAL hMem) { - /* This is the same as a Global Unlock */ - return GlobalUnlock(hMem); + PBASE_HEAP_HANDLE_ENTRY HandleEntry; + BOOL RetVal = TRUE; + + /* Check if this was a simple allocated heap entry */ + if (!((ULONG_PTR)hMem & BASE_HEAP_IS_HANDLE_ENTRY)) + { + /* Fail, because LocalUnlock is not supported on LMEM_FIXED allocations */ + SetLastError(ERROR_NOT_LOCKED); + return FALSE; + } + + /* Otherwise, lock the heap */ + RtlLockHeap(hProcessHeap); + + /* Get the handle entry */ + HandleEntry = BaseHeapGetEntry(hMem); + BASE_TRACE_HANDLE(HandleEntry, hMem); + + _SEH2_TRY + { + /* Make sure it's valid */ + if (!BaseHeapValidateEntry(HandleEntry)) + { + /* It's not, fail */ + BASE_TRACE_FAILURE(); + SetLastError(ERROR_INVALID_HANDLE); + RetVal = FALSE; + } + else + { + /* Otherwise, decrement lock count, unless we're already at 0*/ + if (!HandleEntry->LockCount--) + { + /* In which case we simply lock it back and fail */ + HandleEntry->LockCount++; + SetLastError(ERROR_NOT_LOCKED); + RetVal = FALSE; + } + else if (!HandleEntry->LockCount) + { + /* Nothing to unlock */ + SetLastError(NO_ERROR); + RetVal = FALSE; + } + } + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + SetLastError(ERROR_INVALID_PARAMETER); + RetVal = FALSE; + } + _SEH2_END + + /* All done. Unlock the heap and return the pointer */ + RtlUnlockHeap(hProcessHeap); + return RetVal; } /* EOF */ diff --git a/dll/win32/kernel32/misc/console.c b/dll/win32/kernel32/misc/console.c index b608367b1c5..2b0d253b23e 100644 --- a/dll/win32/kernel32/misc/console.c +++ b/dll/win32/kernel32/misc/console.c @@ -384,6 +384,7 @@ IntExpungeConsoleCommandHistory(LPCVOID lpExeName, BOOL bUnicode) CaptureBuffer = CsrAllocateCaptureBuffer(1, IntStringSize(lpExeName, bUnicode)); if (!CaptureBuffer) { + DPRINT1("CsrAllocateCaptureBuffer failed!\n"); SetLastError(ERROR_NOT_ENOUGH_MEMORY); return FALSE; } @@ -466,6 +467,7 @@ GetConsoleAliasW(LPWSTR lpSource, CaptureBuffer = CsrAllocateCaptureBuffer(1, TargetBufferLength); if (!CaptureBuffer) { + DPRINT1("CsrAllocateCaptureBuffer failed!\n"); RtlFreeHeap(GetProcessHeap(), 0, Request); SetLastError(ERROR_NOT_ENOUGH_MEMORY); return 0; @@ -594,6 +596,7 @@ GetConsoleAliasExesW(LPWSTR lpExeNameBuffer, CaptureBuffer = CsrAllocateCaptureBuffer(1, ExeNameBufferLength); if (!CaptureBuffer) { + DPRINT1("CsrAllocateCaptureBuffer failed!\n"); SetLastError(ERROR_NOT_ENOUGH_MEMORY); return 0; } @@ -849,6 +852,7 @@ IntGetConsoleCommandHistory(LPVOID lpHistory, DWORD cbHistory, LPCVOID lpExeName HistoryLength); if (!CaptureBuffer) { + DPRINT1("CsrAllocateCaptureBuffer failed!\n"); SetLastError(ERROR_NOT_ENOUGH_MEMORY); return 0; } @@ -927,6 +931,7 @@ IntGetConsoleCommandHistoryLength(LPCVOID lpExeName, BOOL bUnicode) CaptureBuffer = CsrAllocateCaptureBuffer(1, IntStringSize(lpExeName, bUnicode)); if (!CaptureBuffer) { + DPRINT1("CsrAllocateCaptureBuffer failed!\n"); SetLastError(ERROR_NOT_ENOUGH_MEMORY); return 0; } @@ -1318,6 +1323,7 @@ IntSetConsoleNumberOfCommands(DWORD dwNumCommands, CaptureBuffer = CsrAllocateCaptureBuffer(1, IntStringSize(lpExeName, bUnicode)); if (!CaptureBuffer) { + DPRINT1("CsrAllocateCaptureBuffer failed!\n"); SetLastError(ERROR_NOT_ENOUGH_MEMORY); return FALSE; } @@ -1696,6 +1702,7 @@ IntReadConsole(HANDLE hConsoleInput, CaptureBuffer = CsrAllocateCaptureBuffer(1, nNumberOfCharsToRead * CharSize); if (CaptureBuffer == NULL) { + DPRINT1("CsrAllocateCaptureBuffer failed!\n"); SetLastError(ERROR_NOT_ENOUGH_MEMORY); return FALSE; } @@ -2052,6 +2059,12 @@ IntPeekConsoleInput(HANDLE hConsoleInput, /* Allocate a Capture Buffer */ DPRINT("IntPeekConsoleInput: %lx %p\n", Size, lpNumberOfEventsRead); CaptureBuffer = CsrAllocateCaptureBuffer(1, Size); + if (CaptureBuffer == NULL) + { + DPRINT1("CsrAllocateCaptureBuffer failed!\n"); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } /* Allocate space in the Buffer */ CsrCaptureMessageBuffer(CaptureBuffer, @@ -2281,6 +2294,12 @@ IntWriteConsoleInput(HANDLE hConsoleInput, /* Allocate a Capture Buffer */ DPRINT("IntWriteConsoleInput: %lx %p\n", Size, lpNumberOfEventsWritten); CaptureBuffer = CsrAllocateCaptureBuffer(1, Size); + if (CaptureBuffer == NULL) + { + DPRINT1("CsrAllocateCaptureBuffer failed!\n"); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } /* Allocate space in the Buffer */ CsrCaptureMessageBuffer(CaptureBuffer, @@ -2389,6 +2408,12 @@ IntReadConsoleOutput(HANDLE hConsoleOutput, /* Allocate a Capture Buffer */ DPRINT("IntReadConsoleOutput: %lx %p\n", Size, lpReadRegion); CaptureBuffer = CsrAllocateCaptureBuffer(1, Size); + if (CaptureBuffer == NULL) + { + DPRINT1("CsrAllocateCaptureBuffer failed with size 0x%x!\n", Size); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } /* Allocate space in the Buffer */ CsrCaptureMessageBuffer(CaptureBuffer, @@ -2505,6 +2530,12 @@ IntWriteConsoleOutput(HANDLE hConsoleOutput, /* Allocate a Capture Buffer */ DPRINT("IntWriteConsoleOutput: %lx %p\n", Size, lpWriteRegion); CaptureBuffer = CsrAllocateCaptureBuffer(1, Size); + if (CaptureBuffer == NULL) + { + DPRINT1("CsrAllocateCaptureBuffer failed!\n"); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } /* Allocate space in the Buffer */ CsrCaptureMessageBuffer(CaptureBuffer, @@ -3561,6 +3592,7 @@ IntGetConsoleTitle(LPVOID lpConsoleTitle, DWORD nSize, BOOL bUnicode) CaptureBuffer = CsrAllocateCaptureBuffer(1, Request.Data.GetTitleRequest.Length); if (CaptureBuffer == NULL) { + DPRINT1("CsrAllocateCaptureBuffer failed!\n"); SetLastError(ERROR_NOT_ENOUGH_MEMORY); return 0; } @@ -3652,6 +3684,7 @@ SetConsoleTitleW(LPCWSTR lpConsoleTitle) CaptureBuffer = CsrAllocateCaptureBuffer(1, Request.Data.SetTitleRequest.Length); if (CaptureBuffer == NULL) { + DPRINT1("CsrAllocateCaptureBuffer failed!\n"); SetLastError(ERROR_NOT_ENOUGH_MEMORY); return FALSE; } @@ -3866,6 +3899,7 @@ GetConsoleProcessList(LPDWORD lpdwProcessList, CaptureBuffer = CsrAllocateCaptureBuffer(1, dwProcessCount * sizeof(DWORD)); if (CaptureBuffer == NULL) { + DPRINT1("CsrAllocateCaptureBuffer failed!\n"); SetLastError(ERROR_NOT_ENOUGH_MEMORY); return FALSE; } diff --git a/dll/win32/kernel32/misc/env.c b/dll/win32/kernel32/misc/env.c index b132abfa3df..3ff452b583e 100644 --- a/dll/win32/kernel32/misc/env.c +++ b/dll/win32/kernel32/misc/env.c @@ -5,6 +5,8 @@ * FILE: lib/kernel32/misc/env.c * PURPOSE: Environment functions * PROGRAMMER: Ariadne ( ariadne@xs4all.nl) + * Emanuele Aliberti + * Thomas Weidenmueller * UPDATE HISTORY: * Created 01/11/98 */ @@ -17,6 +19,85 @@ /* FUNCTIONS ******************************************************************/ +/* + * @implemented + */ +BOOL +WINAPI +Beep (DWORD dwFreq, DWORD dwDuration) +{ + HANDLE hBeep; + UNICODE_STRING BeepDevice; + OBJECT_ATTRIBUTES ObjectAttributes; + IO_STATUS_BLOCK IoStatusBlock; + BEEP_SET_PARAMETERS BeepSetParameters; + NTSTATUS Status; + + /* check the parameters */ + if ((dwFreq >= 0x25 && dwFreq <= 0x7FFF) || + (dwFreq == 0x0 && dwDuration == 0x0)) + { + /* open the device */ + RtlInitUnicodeString(&BeepDevice, + L"\\Device\\Beep"); + + InitializeObjectAttributes(&ObjectAttributes, + &BeepDevice, + 0, + NULL, + NULL); + + Status = NtCreateFile(&hBeep, + FILE_READ_DATA | FILE_WRITE_DATA, + &ObjectAttributes, + &IoStatusBlock, + NULL, + 0, + FILE_SHARE_READ | FILE_SHARE_WRITE, + FILE_OPEN_IF, + 0, + NULL, + 0); + if (NT_SUCCESS(Status)) + { + /* Set beep data */ + BeepSetParameters.Frequency = dwFreq; + BeepSetParameters.Duration = dwDuration; + + Status = NtDeviceIoControlFile(hBeep, + NULL, + NULL, + NULL, + &IoStatusBlock, + IOCTL_BEEP_SET, + &BeepSetParameters, + sizeof(BEEP_SET_PARAMETERS), + NULL, + 0); + + /* do an alertable wait if necessary */ + if (NT_SUCCESS(Status) && + (dwFreq != 0x0 || dwDuration != 0x0) && dwDuration != MAXDWORD) + { + SleepEx(dwDuration, + TRUE); + } + + NtClose(hBeep); + } + } + else + Status = STATUS_INVALID_PARAMETER; + + if (!NT_SUCCESS(Status)) + { + SetLastErrorByStatus (Status); + return FALSE; + } + + return TRUE; +} + /* * @implemented */ diff --git a/dll/win32/kernel32/misc/error.c b/dll/win32/kernel32/misc/error.c index 91499530312..1430a3a9a7b 100644 --- a/dll/win32/kernel32/misc/error.c +++ b/dll/win32/kernel32/misc/error.c @@ -1,99 +1,61 @@ -/* $Id$ - * +/* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries * FILE: dll/win32/kernel32/misc/error.c - * PURPOSE: Environment functions - * PROGRAMMER: Emanuele Aliberti - * Thomas Weidenmueller - * UPDATE HISTORY: - * Created 05/10/98 + * PURPOSE: Error functions + * PROGRAMMER: Pierre Schweitzer (pierre.schweitzer@reactos.org) */ - #include #define NDEBUG #include +DWORD g_dwLastErrorToBreakOn; + +/* FUNCTIONS ******************************************************************/ + /* * @implemented */ -BOOL +VOID WINAPI -Beep (DWORD dwFreq, DWORD dwDuration) +SetLastError( + IN DWORD dwErrCode) { - HANDLE hBeep; - UNICODE_STRING BeepDevice; - OBJECT_ATTRIBUTES ObjectAttributes; - IO_STATUS_BLOCK IoStatusBlock; - BEEP_SET_PARAMETERS BeepSetParameters; - NTSTATUS Status; - - /* check the parameters */ - if ((dwFreq >= 0x25 && dwFreq <= 0x7FFF) || - (dwFreq == 0x0 && dwDuration == 0x0)) + if (g_dwLastErrorToBreakOn) { - /* open the device */ - RtlInitUnicodeString(&BeepDevice, - L"\\Device\\Beep"); - - InitializeObjectAttributes(&ObjectAttributes, - &BeepDevice, - 0, - NULL, - NULL); - - Status = NtCreateFile(&hBeep, - FILE_READ_DATA | FILE_WRITE_DATA, - &ObjectAttributes, - &IoStatusBlock, - NULL, - 0, - FILE_SHARE_READ | FILE_SHARE_WRITE, - FILE_OPEN_IF, - 0, - NULL, - 0); - if (NT_SUCCESS(Status)) + /* If we have error to break on and if current matches, break */ + if (g_dwLastErrorToBreakOn == dwErrCode) { - /* Set beep data */ - BeepSetParameters.Frequency = dwFreq; - BeepSetParameters.Duration = dwDuration; - - Status = NtDeviceIoControlFile(hBeep, - NULL, - NULL, - NULL, - &IoStatusBlock, - IOCTL_BEEP_SET, - &BeepSetParameters, - sizeof(BEEP_SET_PARAMETERS), - NULL, - 0); - - /* do an alertable wait if necessary */ - if (NT_SUCCESS(Status) && - (dwFreq != 0x0 || dwDuration != 0x0) && dwDuration != MAXDWORD) - { - SleepEx(dwDuration, - TRUE); - } - - NtClose(hBeep); + DbgBreakPoint(); } } - else - Status = STATUS_INVALID_PARAMETER; - if (!NT_SUCCESS(Status)) - { - SetLastErrorByStatus (Status); - return FALSE; - } + /* Set last error */ + NtCurrentTeb()->LastErrorValue = dwErrCode; +} - return TRUE; +/* + * @implemented + */ +VOID +WINAPI +BaseSetLastNTError( + IN NTSTATUS Status) +{ + SetLastError(RtlNtStatusToDosError(Status)); +} + +/* + * @implemented + */ +DWORD +WINAPI +GetLastError() +{ + return NtCurrentTeb()->LastErrorValue; } /* EOF */ diff --git a/dll/win32/kernel32/misc/ldr.c b/dll/win32/kernel32/misc/ldr.c index 9e324785454..6a954ae802c 100644 --- a/dll/win32/kernel32/misc/ldr.c +++ b/dll/win32/kernel32/misc/ldr.c @@ -102,19 +102,18 @@ GetDllLoadPath(LPCWSTR lpModule) */ BOOL WINAPI -DisableThreadLibraryCalls ( - HMODULE hLibModule - ) +DisableThreadLibraryCalls( + IN HMODULE hLibModule) { - NTSTATUS Status; + NTSTATUS Status; - Status = LdrDisableThreadCalloutsForDll ((PVOID)hLibModule); - if (!NT_SUCCESS (Status)) - { - SetLastErrorByStatus (Status); - return FALSE; - } - return TRUE; + Status = LdrDisableThreadCalloutsForDll((PVOID)hLibModule); + if (!NT_SUCCESS(Status)) + { + BaseSetLastNTError(Status); + return FALSE; + } + return TRUE; } @@ -136,18 +135,17 @@ LoadLibraryA ( */ HINSTANCE WINAPI -LoadLibraryExA ( - LPCSTR lpLibFileName, - HANDLE hFile, - DWORD dwFlags - ) +LoadLibraryExA( + LPCSTR lpLibFileName, + HANDLE hFile, + DWORD dwFlags) { - PWCHAR FileNameW; + PUNICODE_STRING FileNameW; - if (!(FileNameW = FilenameA2W(lpLibFileName, FALSE))) - return FALSE; + if (!(FileNameW = Basep8BitStringToStaticUnicodeString(lpLibFileName))) + return NULL; - return LoadLibraryExW(FileNameW, hFile, dwFlags); + return LoadLibraryExW(FileNameW->Buffer, hFile, dwFlags); } @@ -433,10 +431,10 @@ GetModuleFileNameA ( &Module->FullDllName, FALSE); - if (nSize < Length) - SetLastErrorByStatus (STATUS_BUFFER_TOO_SMALL); - else + if (Length < nSize) lpFilename[Length] = '\0'; + else + SetLastErrorByStatus (STATUS_BUFFER_TOO_SMALL); RtlLeaveCriticalSection (Peb->LoaderLock); return Length; @@ -491,10 +489,10 @@ GetModuleFileNameW ( RtlCopyUnicodeString (&FileName, &Module->FullDllName); - if (nSize < Length) - SetLastErrorByStatus (STATUS_BUFFER_TOO_SMALL); - else + if (Length < nSize) lpFilename[Length] = L'\0'; + else + SetLastErrorByStatus (STATUS_BUFFER_TOO_SMALL); RtlLeaveCriticalSection (Peb->LoaderLock); diff --git a/dll/win32/kernel32/misc/utils.c b/dll/win32/kernel32/misc/utils.c index 5e2508e4ab6..a011ff5e6e3 100644 --- a/dll/win32/kernel32/misc/utils.c +++ b/dll/win32/kernel32/misc/utils.c @@ -4,6 +4,7 @@ * FILE: lib/kernel32/misc/utils.c * PURPOSE: Utility and Support Functions * PROGRAMMER: Alex Ionescu (alex@relsoft.net) + * Pierre Schweitzer (pierre.schweitzer@reactos.org) */ /* INCLUDES ****************************************************************/ @@ -24,87 +25,68 @@ PRTL_CONVERT_STRING Basep8BitStringToUnicodeString; /* FUNCTIONS ****************************************************************/ -/* - * Converts an ANSI or OEM String to the specified Unicode String - */ -NTSTATUS -WINAPI -Basep8BitStringToLiveUnicodeString(OUT PUNICODE_STRING UnicodeString, - IN LPCSTR String) -{ - ANSI_STRING AnsiString; - NTSTATUS Status; - - DPRINT("Basep8BitStringToLiveUnicodeString\n"); - - /* Create the ANSI String */ - RtlInitAnsiString(&AnsiString, String); - - /* Convert from OEM or ANSI */ - Status = Basep8BitStringToUnicodeString(UnicodeString, &AnsiString, FALSE); - - /* Return Status */ - if (!NT_SUCCESS(Status)) - { - SetLastErrorByStatus(Status); - } - return Status; -} - /* * Converts an ANSI or OEM String to the TEB StaticUnicodeString */ PUNICODE_STRING WINAPI -Basep8BitStringToCachedUnicodeString(IN LPCSTR String) +Basep8BitStringToStaticUnicodeString(IN LPCSTR String) { - PUNICODE_STRING StaticString = &NtCurrentTeb()->StaticUnicodeString; + PUNICODE_STRING StaticString = &(NtCurrentTeb()->StaticUnicodeString); ANSI_STRING AnsiString; NTSTATUS Status; - - DPRINT("Basep8BitStringToCachedUnicodeString\n"); - + /* Initialize an ANSI String */ - RtlInitAnsiString(&AnsiString, String); - - /* Convert it */ - Status = Basep8BitStringToUnicodeString(StaticString, &AnsiString, FALSE); - - /* Handle failure */ - if (!NT_SUCCESS(Status)) + if (!NT_SUCCESS(RtlInitAnsiStringEx(&AnsiString, String))) { - SetLastErrorByStatus(Status); + SetLastError(ERROR_FILENAME_EXCED_RANGE); return NULL; } - - /* Return pointer to the string */ + + /* Convert it */ + Status = Basep8BitStringToUnicodeString(StaticString, &AnsiString, FALSE); + if (!NT_SUCCESS(Status)) + { + BaseSetLastNTError(Status); + return NULL; + } + return StaticString; } -NTSTATUS +/* + * Allocates space from the Heap and converts an Unicode String into it + */ +BOOLEAN WINAPI -Basep8BitStringToHeapUnicodeString(OUT PUNICODE_STRING UnicodeString, - IN LPCSTR String) +Basep8BitStringToDynamicUnicodeString(OUT PUNICODE_STRING UnicodeString, + IN LPCSTR String) { ANSI_STRING AnsiString; NTSTATUS Status; - DPRINT("Basep8BitStringToCachedUnicodeString\n"); - + DPRINT("Basep8BitStringToDynamicUnicodeString\n"); + /* Initialize an ANSI String */ - RtlInitAnsiString(&AnsiString, String); - + if (!NT_SUCCESS(RtlInitAnsiStringEx(&AnsiString, String))) + { + SetLastError(ERROR_BUFFER_OVERFLOW); + return FALSE; + } + /* Convert it */ - Status = Basep8BitStringToUnicodeString(UnicodeString, &AnsiString, TRUE); - + Status = Basep8BitStringToUnicodeString(UnicodeString, &AnsiString, TRUE); + /* Handle failure */ if (!NT_SUCCESS(Status)) { SetLastErrorByStatus(Status); + return FALSE; } + /* Return Status */ - return Status; + return TRUE; } /* diff --git a/dll/win32/kernel32/process/proc.c b/dll/win32/kernel32/process/proc.c index ea9a23e6b56..41889ec8b4a 100644 --- a/dll/win32/kernel32/process/proc.c +++ b/dll/win32/kernel32/process/proc.c @@ -1011,7 +1011,7 @@ WINAPI IsWow64Process(HANDLE hProcess, PBOOL Wow64Process) { - ULONG pbi; + ULONG_PTR pbi; NTSTATUS Status; Status = NtQueryInformationProcess(hProcess, diff --git a/dll/win32/kernel32/process/procsup.c b/dll/win32/kernel32/process/procsup.c index 2afb4e06111..33b053d9324 100644 --- a/dll/win32/kernel32/process/procsup.c +++ b/dll/win32/kernel32/process/procsup.c @@ -1558,13 +1558,13 @@ CreateProcessInternalA(HANDLE hToken, NtCurrentTeb()->StaticUnicodeString.MaximumLength) { /* Cache it in the TEB */ - CommandLine = Basep8BitStringToCachedUnicodeString(lpCommandLine); + CommandLine = Basep8BitStringToStaticUnicodeString(lpCommandLine); } else { /* Use a dynamic version */ - Basep8BitStringToHeapUnicodeString(&LiveCommandLine, - lpCommandLine); + Basep8BitStringToDynamicUnicodeString(&LiveCommandLine, + lpCommandLine); } } else @@ -1576,13 +1576,13 @@ CreateProcessInternalA(HANDLE hToken, /* Convert the Name and Directory */ if (lpApplicationName) { - Basep8BitStringToHeapUnicodeString(&ApplicationName, - lpApplicationName); + Basep8BitStringToDynamicUnicodeString(&ApplicationName, + lpApplicationName); } if (lpCurrentDirectory) { - Basep8BitStringToHeapUnicodeString(&CurrentDirectory, - lpCurrentDirectory); + Basep8BitStringToDynamicUnicodeString(&CurrentDirectory, + lpCurrentDirectory); } /* Now convert Startup Strings */ diff --git a/dll/win32/loadperf/stubs.c b/dll/win32/loadperf/stubs.c index bd172d27924..e319f10ecfc 100644 --- a/dll/win32/loadperf/stubs.c +++ b/dll/win32/loadperf/stubs.c @@ -1,7 +1,7 @@ #include #define NDEBUG -#include +#include #define LOADPERF_FUNCTION DWORD WINAPI diff --git a/dll/win32/lpk/ros_lpk.h b/dll/win32/lpk/ros_lpk.h index ef45aaf22a8..06eeb0d24da 100644 --- a/dll/win32/lpk/ros_lpk.h +++ b/dll/win32/lpk/ros_lpk.h @@ -12,7 +12,7 @@ #include /* FIXME USP10 api that does not have prototype in any include file */ -VOID WINAPI LpkPresent(); +VOID WINAPI LpkPresent(VOID); /* FIXME move _LPK_LPEDITCONTROL_LIST to global place so user32 can access it */ typedef struct _LPK_LPEDITCONTROL_LIST diff --git a/dll/win32/mapi32/mapi32.spec b/dll/win32/mapi32/mapi32.spec index b530e8e2dad..0698dc32fcf 100644 --- a/dll/win32/mapi32/mapi32.spec +++ b/dll/win32/mapi32/mapi32.spec @@ -16,8 +16,8 @@ 24 stub PRProviderInit 25 stub LAUNCHWIZARD 26 stub LaunchWizard@20 - @ stdcall -private DllGetClassObject(ptr ptr ptr) - @ stdcall -private DllCanUnloadNow() + 27 stdcall -private DllGetClassObject(ptr ptr ptr) + 28 stdcall -private DllCanUnloadNow() 29 stdcall MAPIOpenFormMgr(ptr ptr) 30 stdcall MAPIOpenFormMgr@8(ptr ptr) MAPIOpenFormMgr 31 stdcall MAPIOpenLocalFormContainer(ptr) diff --git a/dll/win32/msafd/misc/dllmain.c b/dll/win32/msafd/misc/dllmain.c index 5714213cd5a..b2680e0bf28 100644 --- a/dll/win32/msafd/misc/dllmain.c +++ b/dll/win32/msafd/misc/dllmain.c @@ -27,7 +27,7 @@ CRITICAL_SECTION SocketListLock; LIST_ENTRY SockHelpersListHead = { NULL, NULL }; ULONG SockAsyncThreadRefCount; HANDLE SockAsyncHelperAfdHandle; -HANDLE SockAsyncCompletionPort; +HANDLE SockAsyncCompletionPort = NULL; BOOLEAN SockAsyncSelectCalled; @@ -562,12 +562,11 @@ WSPCloseSocket(IN SOCKET Handle, } LeaveCriticalSection(&SocketListLock); - HeapFree(GlobalHeap, 0, Socket); - /* Close the handle */ NtClose((HANDLE)Handle); NtClose(SockEvent); + HeapFree(GlobalHeap, 0, Socket); return MsafdReturnWithErrno(Status, lpErrno, 0, NULL); } @@ -907,7 +906,7 @@ WSPSelect(IN int nfds, } PollInfo->HandleCount = j; - PollBufferSize = ((PCHAR)&PollInfo->Handles[j+1]) - ((PCHAR)PollInfo); + PollBufferSize = FIELD_OFFSET(AFD_POLL_INFO, Handles) + PollInfo->HandleCount * sizeof(AFD_HANDLE); /* Send IOCTL */ Status = NtDeviceIoControlFile((HANDLE)PollInfo->Handles[0].Handle, @@ -2420,6 +2419,7 @@ BOOLEAN SockCreateOrReferenceAsyncThread(VOID) /* Check if the Thread Already Exists */ if (SockAsyncThreadRefCount) { + ASSERT(SockAsyncCompletionPort); return TRUE; } @@ -2430,7 +2430,11 @@ BOOLEAN SockCreateOrReferenceAsyncThread(VOID) IO_COMPLETION_ALL_ACCESS, NULL, 2); // Allow 2 threads only - + if (!NT_SUCCESS(Status)) + { + AFD_DbgPrint(MID_TRACE,("Failed to create completion port\n")); + return FALSE; + } /* Protect Handle */ HandleFlags.ProtectFromClose = TRUE; HandleFlags.Inherit = FALSE; diff --git a/dll/win32/msafd/msafd.h b/dll/win32/msafd/msafd.h index d872c97b4d6..52027581d0b 100755 --- a/dll/win32/msafd/msafd.h +++ b/dll/win32/msafd/msafd.h @@ -488,7 +488,7 @@ MsafdReturnWithErrno(NTSTATUS Status, } else { - DbgPrint("%s: Received invalid lpErrno pointer!\n", __FUNCTION__); + DbgPrint("%s: Received invalid lpErrno pointer! %s\n", __FUNCTION__); if (ReturnedBytes) *ReturnedBytes = (Status == STATUS_SUCCESS) ? Received : 0; diff --git a/dll/win32/netshell/precomp.h b/dll/win32/netshell/precomp.h index fa75e02d7c7..73a1d58ed30 100644 --- a/dll/win32/netshell/precomp.h +++ b/dll/win32/netshell/precomp.h @@ -85,7 +85,7 @@ HRESULT WINAPI ISF_NetConnect_Constructor (IUnknown * pUnkOuter, REFIID riid, LP /* enumlist.c */ IEnumIDList * IEnumIDList_Constructor(void); -LPITEMIDLIST _ILCreateNetConnect(); +LPITEMIDLIST _ILCreateNetConnect(void); LPITEMIDLIST ILCreateNetConnectItem(INetConnection * pItem); BOOL _ILIsNetConnect (LPCITEMIDLIST pidl); BOOL AddToEnumList(IEnumIDList * iface, LPITEMIDLIST pidl); diff --git a/dll/win32/opengl32/icdtable.h b/dll/win32/opengl32/icdtable.h index eaab125ca47..2619f34632d 100644 --- a/dll/win32/opengl32/icdtable.h +++ b/dll/win32/opengl32/icdtable.h @@ -18,6 +18,8 @@ typedef struct tagICDTable PROC dispatch_table[812]; /*!< Table containing \a num_funcs pointers to OpenGL functions */ } ICDTable, *PICDTable; +#define DISPATCH_TABLE_SIZE 812*sizeof(PROC) + #endif /* OPENGL32_PRIVATE_ICDTABLE_H */ /* EOF */ diff --git a/dll/win32/opengl32/opengl32.c b/dll/win32/opengl32/opengl32.c index cf460079bee..e3c56026e72 100644 --- a/dll/win32/opengl32/opengl32.c +++ b/dll/win32/opengl32/opengl32.c @@ -34,7 +34,7 @@ OPENGL32_ThreadAttach( void ) dispatchTable = (PROC*)HeapAlloc( GetProcessHeap(), HEAP_GENERATE_EXCEPTIONS | HEAP_ZERO_MEMORY, - sizeof (((ICDTable *)(0))->dispatch_table) ); + DISPATCH_TABLE_SIZE ); if (dispatchTable == NULL) { DBGPRINT( "Error: Couldn't allocate GL dispatch table" ); @@ -72,7 +72,7 @@ static void OPENGL32_ThreadDetach( void ) { GLTHREADDATA* lpData = NULL; - PROC *dispatchTable = NULL; + TEB* teb = NtCurrentTeb(); rosglMakeCurrent( NULL, NULL ); @@ -84,13 +84,17 @@ OPENGL32_ThreadDetach( void ) GetLastError() ); lpData = NULL; } + TlsSetValue( OPENGL32_tls, NULL ); - dispatchTable = NtCurrentTeb()->glTable; - if (dispatchTable != NULL) + if (teb->glTable != NULL) { - if (!HeapFree( GetProcessHeap(), 0, dispatchTable )) + if (!HeapFree( GetProcessHeap(), 0, teb->glTable )) + { DBGPRINT( "Warning: HeapFree() on dispatch table failed (%d)", GetLastError() ); + } + /* NULL-ify it. Even if something went wrong, it's not a good idea to keep it non NULL */ + teb->glTable = NULL; } } diff --git a/dll/win32/opengl32/wgl.c b/dll/win32/opengl32/wgl.c index aadf186e9ac..9584ba5b362 100644 --- a/dll/win32/opengl32/wgl.c +++ b/dll/win32/opengl32/wgl.c @@ -454,13 +454,12 @@ ROSGL_SetContextCallBack( const ICDTable *table ) /* save table */ size = sizeof (PROC) * table->num_funcs; memcpy( tebTable, table->dispatch_table, size ); - memset( tebTable + table->num_funcs, 0, - sizeof (table->dispatch_table) - size ); + memset( tebTable + table->num_funcs, 0, DISPATCH_TABLE_SIZE - size ); } else { DBGPRINT( "Unsetting current context" ); - memset( tebTable, 0, sizeof (table->dispatch_table) ); + memset( tebTable, 0, DISPATCH_TABLE_SIZE ); } /* put in empty functions as long as we dont have a fallback */ diff --git a/dll/win32/rpcrt4/rpc_transport.c b/dll/win32/rpcrt4/rpc_transport.c index 630c5bbecf4..92588bad087 100644 --- a/dll/win32/rpcrt4/rpc_transport.c +++ b/dll/win32/rpcrt4/rpc_transport.c @@ -219,13 +219,20 @@ static RPC_STATUS rpcrt4_conn_open_pipe(RpcConnection *Connection, LPCSTR pname, if (pipe != INVALID_HANDLE_VALUE) break; err = GetLastError(); if (err == ERROR_PIPE_BUSY) { - TRACE("connection failed, error=%x\n", err); + ERR("connection to %s failed, error=%x\n", pname, err); return RPC_S_SERVER_TOO_BUSY; } - if (!wait || !WaitNamedPipeA(pname, NMPWAIT_WAIT_FOREVER)) { - err = GetLastError(); - WARN("connection failed, error=%x\n", err); - return RPC_S_SERVER_UNAVAILABLE; + if (wait) ERR("Waiting for Pipe Instance\n"); + if (wait) { + if (!WaitNamedPipeA(pname, NMPWAIT_WAIT_FOREVER)) { + err = GetLastError(); + ERR("connection to %s failed, error=%x, wait %x\n", pname, err, wait); + return RPC_S_SERVER_UNAVAILABLE; + } + else + { + ERR("Pipe Instance Ready!!!!!!!!!!!!!!!!!!\n"); + } } } @@ -314,7 +321,7 @@ static RPC_STATUS rpcrt4_ncacn_np_open(RpcConnection* Connection) /* protseq=ncacn_np: named pipes */ pname = I_RpcAllocate(strlen(prefix) + strlen(Connection->Endpoint) + 1); strcat(strcpy(pname, prefix), Connection->Endpoint); - r = rpcrt4_conn_open_pipe(Connection, pname, FALSE); + r = rpcrt4_conn_open_pipe(Connection, pname, TRUE); I_RpcFree(pname); return r; diff --git a/dll/win32/secur32/sspi.c b/dll/win32/secur32/sspi.c index 4bbc757630f..af4cdc28bb1 100644 --- a/dll/win32/secur32/sspi.c +++ b/dll/win32/secur32/sspi.c @@ -80,7 +80,7 @@ EnumerateSecurityPackagesW ( SECURITY_STATUS ret = SEC_E_OK; *pcPackages = 0; - + *ppPackageInfo = NULL; /* if (packageTable) { @@ -113,7 +113,7 @@ EnumerateSecurityPackagesA( } */ FreeContextBuffer(info); } - + *ppPackageInfo = NULL; UNIMPLEMENTED; return ret; diff --git a/dll/win32/setupapi/cfgmgr.c b/dll/win32/setupapi/cfgmgr.c index 684853f2299..78709d3532c 100644 --- a/dll/win32/setupapi/cfgmgr.c +++ b/dll/win32/setupapi/cfgmgr.c @@ -153,7 +153,7 @@ CONFIGRET WINAPI CMP_Report_LogOn( if (!PnpGetLocalHandles(&BindingHandle, NULL)) return CR_FAILURE; - bAdmin = IsUserAdmin(); + bAdmin = pSetupIsUserAdmin(); for (i = 0; i < 30; i++) { @@ -237,7 +237,7 @@ CONFIGRET WINAPI CM_Add_Empty_Log_Conf_Ex( FIXME("%p %p %lu %lx %p\n", plcLogConf, dnDevInst, Priority, ulFlags, hMachine); - if (!IsUserAdmin()) + if (!pSetupIsUserAdmin()) return CR_ACCESS_DENIED; if (plcLogConf == NULL) @@ -268,7 +268,7 @@ CONFIGRET WINAPI CM_Add_Empty_Log_Conf_Ex( return CR_FAILURE; } - lpDevInst = StringTableStringFromId(StringTable, dnDevInst); + lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst); if (lpDevInst == NULL) return CR_INVALID_DEVNODE; @@ -340,7 +340,7 @@ CONFIGRET WINAPI CM_Add_ID_ExA( TRACE("%p %s %lx %p\n", dnDevInst, pszID, ulFlags, hMachine); - if (CaptureAndConvertAnsiArg(pszID, &pszIDW)) + if (pSetupCaptureAndConvertAnsiArg(pszID, &pszIDW)) return CR_INVALID_DATA; ret = CM_Add_ID_ExW(dnDevInst, pszIDW, ulFlags, hMachine); @@ -364,7 +364,7 @@ CONFIGRET WINAPI CM_Add_ID_ExW( TRACE("%p %s %lx %p\n", dnDevInst, debugstr_w(pszID), ulFlags, hMachine); - if (!IsUserAdmin()) + if (!pSetupIsUserAdmin()) return CR_ACCESS_DENIED; if (dnDevInst == 0) @@ -392,7 +392,7 @@ CONFIGRET WINAPI CM_Add_ID_ExW( return CR_FAILURE; } - lpDevInst = StringTableStringFromId(StringTable, dnDevInst); + lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst); if (lpDevInst == NULL) return CR_INVALID_DEVNODE; @@ -413,6 +413,34 @@ CONFIGRET WINAPI CM_Add_ID_ExW( } +/*********************************************************************** + * CM_Add_Res_Des [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Add_Res_Des( + PRES_DES prdResDes, LOG_CONF lcLogConf, RESOURCEID ResourceID, + PCVOID ResourceData, ULONG ResourceLen, ULONG ulFlags) +{ + TRACE("%p %p %lu %p %lu %lx\n", prdResDes, lcLogConf, ResourceID, + ResourceData, ResourceLen, ulFlags); + return CM_Add_Res_Des_Ex(prdResDes, lcLogConf, ResourceID, ResourceData, + ResourceLen, ulFlags, NULL); +} + + +/*********************************************************************** + * CM_Add_Res_Des_Ex [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Add_Res_Des_Ex( + PRES_DES prdResDes, LOG_CONF lcLogConf, RESOURCEID ResourceID, + PCVOID ResourceData, ULONG ResourceLen, ULONG ulFlags, HMACHINE hMachine) +{ + FIXME("%p %p %lu %p %lu %lx %p\n", prdResDes, lcLogConf, ResourceID, + ResourceData, ResourceLen, ulFlags, hMachine); + + return CR_CALL_NOT_IMPLEMENTED; +} + + /*********************************************************************** * CM_Connect_MachineA [SETUPAPI.@] */ @@ -427,7 +455,7 @@ CONFIGRET WINAPI CM_Connect_MachineA( if (UNCServerName == NULL || *UNCServerName == 0) return CM_Connect_MachineW(NULL, phMachine); - if (CaptureAndConvertAnsiArg(UNCServerName, &pServerNameW)) + if (pSetupCaptureAndConvertAnsiArg(UNCServerName, &pServerNameW)) return CR_INVALID_DATA; ret = CM_Connect_MachineW(pServerNameW, phMachine); @@ -480,18 +508,18 @@ CONFIGRET WINAPI CM_Connect_MachineW( } lstrcpyW(pMachine->szMachineName, UNCServerName); - pMachine->StringTable = StringTableInitialize(); + pMachine->StringTable = pSetupStringTableInitialize(); if (pMachine->StringTable == NULL) { HeapFree(GetProcessHeap(), 0, pMachine); return CR_FAILURE; } - StringTableAddString(pMachine->StringTable, L"PLT", 1); + pSetupStringTableAddString(pMachine->StringTable, L"PLT", 1); if (!PnpBindRpc(UNCServerName, &pMachine->BindingHandle)) { - StringTableDestroy(pMachine->StringTable); + pSetupStringTableDestroy(pMachine->StringTable); HeapFree(GetProcessHeap(), 0, pMachine); return CR_INVALID_MACHINENAME; } @@ -544,7 +572,7 @@ CONFIGRET WINAPI CM_Create_DevNode_ExA( TRACE("%p %s %p %lx %p\n", pdnDevInst, debugstr_a(pDeviceID), dnParent, ulFlags, hMachine); - if (CaptureAndConvertAnsiArg(pDeviceID, &pDeviceIDW)) + if (pSetupCaptureAndConvertAnsiArg(pDeviceID, &pDeviceIDW)) return CR_INVALID_DATA; ret = CM_Create_DevNode_ExW(pdnDevInst, pDeviceIDW, dnParent, ulFlags, @@ -571,7 +599,7 @@ CONFIGRET WINAPI CM_Create_DevNode_ExW( FIXME("%p %s %p %lx %p\n", pdnDevInst, debugstr_w(pDeviceID), dnParent, ulFlags, hMachine); - if (!IsUserAdmin()) + if (!pSetupIsUserAdmin()) return CR_ACCESS_DENIED; if (pdnDevInst == NULL) @@ -602,7 +630,7 @@ CONFIGRET WINAPI CM_Create_DevNode_ExW( return CR_FAILURE; } - lpParentDevInst = StringTableStringFromId(StringTable, dnParent); + lpParentDevInst = pSetupStringTableStringFromId(StringTable, dnParent); if (lpParentDevInst == NULL) return CR_INVALID_DEVNODE; @@ -622,7 +650,7 @@ CONFIGRET WINAPI CM_Create_DevNode_ExW( if (ret == CR_SUCCESS) { - *pdnDevInst = StringTableAddString(StringTable, pDeviceID, 1); + *pdnDevInst = pSetupStringTableAddString(StringTable, pDeviceID, 1); if (*pdnDevInst == 0) ret = CR_NO_SUCH_DEVNODE; } @@ -741,7 +769,7 @@ CONFIGRET WINAPI CM_Disable_DevNode_Ex( FIXME("%p %lx %p\n", dnDevInst, ulFlags, hMachine); - if (!IsUserAdmin()) + if (!pSetupIsUserAdmin()) return CR_ACCESS_DENIED; if (dnDevInst == 0) @@ -766,7 +794,7 @@ CONFIGRET WINAPI CM_Disable_DevNode_Ex( return CR_FAILURE; } - lpDevInst = StringTableStringFromId(StringTable, dnDevInst); + lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst); if (lpDevInst == NULL) return CR_INVALID_DEVNODE; @@ -804,7 +832,7 @@ CONFIGRET WINAPI CM_Disconnect_Machine(HMACHINE hMachine) if (pMachine->bLocal == FALSE) { if (pMachine->StringTable != NULL) - StringTableDestroy(pMachine->StringTable); + pSetupStringTableDestroy(pMachine->StringTable); if (!PnpUnbindRpc(pMachine->BindingHandle)) return CR_ACCESS_DENIED; @@ -840,7 +868,7 @@ CONFIGRET WINAPI CM_Enable_DevNode_Ex( TRACE("%p %lx %p\n", dnDevInst, ulFlags, hMachine); - if (!IsUserAdmin()) + if (!pSetupIsUserAdmin()) return CR_ACCESS_DENIED; if (dnDevInst == 0) @@ -865,7 +893,7 @@ CONFIGRET WINAPI CM_Enable_DevNode_Ex( return CR_FAILURE; } - lpDevInst = StringTableStringFromId(StringTable, dnDevInst); + lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst); if (lpDevInst == NULL) return CR_INVALID_DEVNODE; @@ -1107,7 +1135,7 @@ CONFIGRET WINAPI CM_Free_Log_Conf_Ex( TRACE("%lx %lx %lx\n", lcLogConfToBeFreed, ulFlags, hMachine); - if (!IsUserAdmin()) + if (!pSetupIsUserAdmin()) return CR_ACCESS_DENIED; pLogConfInfo = (PLOG_CONF_INFO)lcLogConfToBeFreed; @@ -1133,7 +1161,7 @@ CONFIGRET WINAPI CM_Free_Log_Conf_Ex( return CR_FAILURE; } - lpDevInst = StringTableStringFromId(StringTable, pLogConfInfo->dnDevInst); + lpDevInst = pSetupStringTableStringFromId(StringTable, pLogConfInfo->dnDevInst); if (lpDevInst == NULL) return CR_INVALID_DEVNODE; @@ -1172,6 +1200,42 @@ CONFIGRET WINAPI CM_Free_Log_Conf_Handle( } +/*********************************************************************** + * CM_Free_Res_Des [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Free_Res_Des( + PRES_DES prdResDes, RES_DES rdResDes, ULONG ulFlags) +{ + TRACE("%p %p %lx\n", prdResDes, rdResDes, ulFlags); + return CM_Free_Res_Des_Ex(prdResDes, rdResDes, ulFlags, NULL); +} + + +/*********************************************************************** + * CM_Free_Res_Des_Ex [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Free_Res_Des_Ex( + PRES_DES prdResDes, RES_DES rdResDes, ULONG ulFlags, + HMACHINE hMachine) +{ + FIXME("%p %p %lx %lx\n", prdResDes, rdResDes, ulFlags, hMachine); + + return CR_CALL_NOT_IMPLEMENTED; +} + + +/*********************************************************************** + * CM_Free_Res_Des_Handle [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Free_Res_Des_Handle( + RES_DES rdResDes) +{ + FIXME("%p\n", rdResDes); + + return CR_CALL_NOT_IMPLEMENTED; +} + + /*********************************************************************** * CM_Get_Child [SETUPAPI.@] */ @@ -1225,7 +1289,7 @@ CONFIGRET WINAPI CM_Get_Child_Ex( return CR_FAILURE; } - lpDevInst = StringTableStringFromId(StringTable, dnDevInst); + lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst); if (lpDevInst == NULL) return CR_INVALID_DEVNODE; @@ -1249,7 +1313,7 @@ CONFIGRET WINAPI CM_Get_Child_Ex( TRACE("szRelatedDevInst: %s\n", debugstr_w(szRelatedDevInst)); - dwIndex = StringTableAddString(StringTable, szRelatedDevInst, 1); + dwIndex = pSetupStringTableAddString(StringTable, szRelatedDevInst, 1); if (dwIndex == -1) return CR_FAILURE; @@ -1532,7 +1596,7 @@ CONFIGRET WINAPI CM_Get_Depth_Ex( return CR_FAILURE; } - lpDevInst = StringTableStringFromId(StringTable, dnDevInst); + lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst); if (lpDevInst == NULL) return CR_INVALID_DEVNODE; @@ -1709,7 +1773,7 @@ CONFIGRET WINAPI CM_Get_DevNode_Registry_Property_ExW( return CR_FAILURE; } - lpDevInst = StringTableStringFromId(StringTable, dnDevInst); + lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst); if (lpDevInst == NULL) return CR_INVALID_DEVNODE; @@ -1797,7 +1861,7 @@ CM_Get_DevNode_Status_Ex( return CR_FAILURE; } - lpDevInst = StringTableStringFromId(StringTable, dnDevInst); + lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst); if (lpDevInst == NULL) return CR_INVALID_DEVNODE; @@ -1914,10 +1978,10 @@ CONFIGRET WINAPI CM_Get_Device_ID_ExW( return CR_FAILURE; } - if (!StringTableStringFromIdEx(StringTable, - dnDevInst, - Buffer, - &BufferLen)) + if (!pSetupStringTableStringFromIdEx(StringTable, + dnDevInst, + Buffer, + &BufferLen)) return CR_FAILURE; return CR_SUCCESS; @@ -1976,7 +2040,7 @@ CONFIGRET WINAPI CM_Get_Device_ID_List_ExA( } else { - if (CaptureAndConvertAnsiArg(pszFilter, &pszFilterW)) + if (pSetupCaptureAndConvertAnsiArg(pszFilter, &pszFilterW)) { ret = CR_INVALID_DEVICE_ID; goto Done; @@ -2101,7 +2165,7 @@ CONFIGRET WINAPI CM_Get_Device_ID_List_Size_ExA( } else { - if (CaptureAndConvertAnsiArg(pszFilter, &pszFilterW)) + if (pSetupCaptureAndConvertAnsiArg(pszFilter, &pszFilterW)) return CR_INVALID_DEVICE_ID; ret = CM_Get_Device_ID_List_Size_ExW(pulLen, @@ -2207,7 +2271,7 @@ CONFIGRET WINAPI CM_Get_Device_ID_Size_Ex( return CR_FAILURE; } - DeviceId = StringTableStringFromId(StringTable, dnDevInst); + DeviceId = pSetupStringTableStringFromId(StringTable, dnDevInst); if (DeviceId == NULL) { *pulLen = 0; @@ -2220,6 +2284,367 @@ CONFIGRET WINAPI CM_Get_Device_ID_Size_Ex( } +/*********************************************************************** + * CM_Get_Device_Interface_AliasA [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Get_Device_Interface_AliasA( + LPCSTR pszDeviceInterface, LPGUID AliasInterfaceGuid, + LPSTR pszAliasDeviceInterface, PULONG pulLength, ULONG ulFlags) +{ + TRACE("%p %p %p %p %lu\n", pszDeviceInterface, AliasInterfaceGuid, + pszAliasDeviceInterface, pulLength, ulFlags); + + return CM_Get_Device_Interface_Alias_ExA(pszDeviceInterface, + AliasInterfaceGuid, pszAliasDeviceInterface, pulLength, + ulFlags, NULL); +} + + +/*********************************************************************** + * CM_Get_Device_Interface_AliasW [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Get_Device_Interface_AliasW( + LPCWSTR pszDeviceInterface, LPGUID AliasInterfaceGuid, + LPWSTR pszAliasDeviceInterface, PULONG pulLength, ULONG ulFlags) +{ + TRACE("%p %p %p %p %lu\n", pszDeviceInterface, AliasInterfaceGuid, + pszAliasDeviceInterface, pulLength, ulFlags); + + return CM_Get_Device_Interface_Alias_ExW(pszDeviceInterface, + AliasInterfaceGuid, pszAliasDeviceInterface, pulLength, + ulFlags, NULL); +} + + +/*********************************************************************** + * CM_Get_Device_Interface_Alias_ExA [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Get_Device_Interface_Alias_ExA( + LPCSTR pszDeviceInterface, LPGUID AliasInterfaceGuid, LPSTR pszAliasDeviceInterface, + PULONG pulLength, ULONG ulFlags, HMACHINE hMachine) +{ + FIXME("%p %p %p %p %lu %lx\n", pszDeviceInterface, AliasInterfaceGuid, + pszAliasDeviceInterface, pulLength, ulFlags, hMachine); + + return CR_CALL_NOT_IMPLEMENTED; +} + + +/*********************************************************************** + * CM_Get_Device_Interface_Alias_ExW [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Get_Device_Interface_Alias_ExW( + LPCWSTR pszDeviceInterface, LPGUID AliasInterfaceGuid, LPWSTR pszAliasDeviceInterface, + PULONG pulLength, ULONG ulFlags, HMACHINE hMachine) +{ + RPC_BINDING_HANDLE BindingHandle = NULL; + ULONG ulTransferLength; + CONFIGRET ret = CR_SUCCESS; + + TRACE("%p %p %p %p %lu %lx\n", pszDeviceInterface, AliasInterfaceGuid, + pszAliasDeviceInterface, pulLength, ulFlags, hMachine); + + if (pszDeviceInterface == NULL || + AliasInterfaceGuid == NULL || + pszAliasDeviceInterface == NULL || + pulLength == NULL) + return CR_INVALID_POINTER; + + if (ulFlags != 0) + return CR_INVALID_FLAG; + + if (hMachine != NULL) + { + BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle; + if (BindingHandle == NULL) + return CR_FAILURE; + } + else + { + if (!PnpGetLocalHandles(&BindingHandle, NULL)) + return CR_FAILURE; + } + + ulTransferLength = *pulLength; + + RpcTryExcept + { + ret = PNP_GetInterfaceDeviceAlias(BindingHandle, + (LPWSTR)pszDeviceInterface, + AliasInterfaceGuid, + pszAliasDeviceInterface, + pulLength, + &ulTransferLength, + 0); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + ret = RpcStatusToCmStatus(RpcExceptionCode()); + } + RpcEndExcept; + + return ret; +} + + +/*********************************************************************** + * CM_Get_Device_Interface_ListA (SETUPAPI.@) + */ +CONFIGRET WINAPI CM_Get_Device_Interface_ListA( + LPGUID InterfaceClassGuid, DEVINSTID_A pDeviceID, PCHAR Buffer, + ULONG BufferLen, ULONG ulFlags) +{ + TRACE("%s %s %p %lu 0x%08lx\n", debugstr_guid(InterfaceClassGuid), + pDeviceID, Buffer, BufferLen, ulFlags); + + return CM_Get_Device_Interface_List_ExA(InterfaceClassGuid, pDeviceID, + Buffer, BufferLen, ulFlags, NULL); +} + + +/*********************************************************************** + * CM_Get_Device_Interface_ListW (SETUPAPI.@) + */ +CONFIGRET WINAPI CM_Get_Device_Interface_ListW( + LPGUID InterfaceClassGuid, DEVINSTID_W pDeviceID, PWCHAR Buffer, + ULONG BufferLen, ULONG ulFlags) +{ + TRACE("%s %s %p %lu 0x%08lx\n", debugstr_guid(InterfaceClassGuid), + debugstr_w(pDeviceID), Buffer, BufferLen, ulFlags); + + return CM_Get_Device_Interface_List_ExW(InterfaceClassGuid, pDeviceID, + Buffer, BufferLen, ulFlags, NULL); +} + + +/*********************************************************************** + * CM_Get_Device_Interface_List_ExA (SETUPAPI.@) + */ +CONFIGRET WINAPI CM_Get_Device_Interface_List_ExA( + LPGUID InterfaceClassGuid, DEVINSTID_A pDeviceID, PCHAR Buffer, + ULONG BufferLen, ULONG ulFlags, HMACHINE hMachine) +{ + DEVINSTID_W pDeviceIdW = NULL; + PWCHAR BufferW = NULL; + CONFIGRET ret = CR_SUCCESS; + + TRACE("%s %s %p %lu 0x%08lx %p\n", debugstr_guid(InterfaceClassGuid), + pDeviceID, Buffer, BufferLen, ulFlags, hMachine); + + if (Buffer == NULL || + BufferLen == 0) + return CR_INVALID_POINTER; + + if (pDeviceID != NULL) + { + if (!pSetupCaptureAndConvertAnsiArg(pDeviceID, &pDeviceIdW)) + return CR_INVALID_DEVICE_ID; + } + + BufferW = MyMalloc(BufferLen * sizeof(WCHAR)); + if (BufferW == NULL) + { + ret = CR_OUT_OF_MEMORY; + goto Done; + } + + ret = CM_Get_Device_Interface_List_ExW(InterfaceClassGuid, pDeviceIdW, + BufferW, BufferLen, ulFlags, + hMachine); + if (ret != CR_SUCCESS) + goto Done; + + if (WideCharToMultiByte(CP_ACP, + 0, + BufferW, + lstrlenW(BufferW) + 1, + Buffer, + BufferLen, + NULL, + NULL) == 0) + ret = CR_FAILURE; + +Done: + if (BufferW != NULL) + MyFree(BufferW); + + if (pDeviceIdW != NULL) + MyFree(pDeviceIdW); + + return ret; +} + + +/*********************************************************************** + * CM_Get_Device_Interface_List_ExW (SETUPAPI.@) + */ +CONFIGRET WINAPI CM_Get_Device_Interface_List_ExW( + LPGUID InterfaceClassGuid, DEVINSTID_W pDeviceID, PWCHAR Buffer, + ULONG BufferLen, ULONG ulFlags, HMACHINE hMachine) +{ + RPC_BINDING_HANDLE BindingHandle = NULL; + PNP_RPC_BUFFER_SIZE BufferSize = 0; + CONFIGRET ret = CR_SUCCESS; + + TRACE("%s %s %p %lu 0x%08lx %p\n", debugstr_guid(InterfaceClassGuid), + debugstr_w(pDeviceID), Buffer, BufferLen, ulFlags, hMachine); + + if (Buffer == NULL || + BufferLen == 0) + return CR_INVALID_POINTER; + + if (ulFlags & ~CM_GET_DEVICE_INTERFACE_LIST_BITS) + return CR_INVALID_FLAG; + + if (hMachine != NULL) + { + BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle; + if (BindingHandle == NULL) + return CR_FAILURE; + } + else + { + if (!PnpGetLocalHandles(&BindingHandle, NULL)) + return CR_FAILURE; + } + + *Buffer = 0; + BufferSize = BufferLen; + + RpcTryExcept + { + ret = PNP_GetInterfaceDeviceList(BindingHandle, + InterfaceClassGuid, + pDeviceID, + (LPBYTE)Buffer, + &BufferSize, + ulFlags); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + ret = RpcStatusToCmStatus(RpcExceptionCode()); + } + RpcEndExcept; + + return ret; +} + + +/*********************************************************************** + * CM_Get_Device_Interface_List_SizeA (SETUPAPI.@) + */ +CONFIGRET WINAPI CM_Get_Device_Interface_List_SizeA( + PULONG pulLen, LPGUID InterfaceClassGuid, DEVINSTID_A pDeviceId, + ULONG ulFlags) +{ + TRACE("%p %p %s 0x%08lx\n", pulLen, InterfaceClassGuid, + pDeviceId, ulFlags); + + return CM_Get_Device_Interface_List_Size_ExA(pulLen, InterfaceClassGuid, + pDeviceId, ulFlags, NULL); +} + + +/*********************************************************************** + * CM_Get_Device_Interface_List_SizeW (SETUPAPI.@) + */ +CONFIGRET WINAPI CM_Get_Device_Interface_List_SizeW( + PULONG pulLen, LPGUID InterfaceClassGuid, DEVINSTID_W pDeviceId, + ULONG ulFlags) +{ + TRACE("%p %p %s 0x%08lx\n", pulLen, InterfaceClassGuid, + debugstr_w(pDeviceId), ulFlags); + + return CM_Get_Device_Interface_List_Size_ExW(pulLen, InterfaceClassGuid, + pDeviceId, ulFlags, NULL); +} + + +/*********************************************************************** + * CM_Get_Device_Interface_List_Size_ExA (SETUPAPI.@) + */ +CONFIGRET WINAPI CM_Get_Device_Interface_List_Size_ExA( + PULONG pulLen, LPGUID InterfaceClassGuid, DEVINSTID_A pDeviceId, + ULONG ulFlags, HMACHINE hMachine) +{ + DEVINSTID_W pDeviceIdW = NULL; + CONFIGRET ret = CR_SUCCESS; + + TRACE("%p %p %s 0x%08lx %p\n", pulLen, InterfaceClassGuid, + pDeviceId, ulFlags, hMachine); + + if (pulLen == NULL) + return CR_INVALID_POINTER; + + if (pDeviceId != NULL) + { + if (!pSetupCaptureAndConvertAnsiArg(pDeviceId, &pDeviceIdW)) + return CR_INVALID_DEVICE_ID; + } + + *pulLen = 0; + + ret = CM_Get_Device_Interface_List_Size_ExW(pulLen, InterfaceClassGuid, + pDeviceIdW, ulFlags, hMachine); + + if (pDeviceIdW != NULL) + MyFree(pDeviceIdW); + + return ret; +} + + +/*********************************************************************** + * CM_Get_Device_Interface_List_Size_ExW (SETUPAPI.@) + */ +CONFIGRET WINAPI CM_Get_Device_Interface_List_Size_ExW( + PULONG pulLen, LPGUID InterfaceClassGuid, DEVINSTID_W pDeviceId, + ULONG ulFlags, HMACHINE hMachine) +{ + RPC_BINDING_HANDLE BindingHandle = NULL; + CONFIGRET ret = CR_SUCCESS; + + TRACE("%p %p %s 0x%08lx %p\n", pulLen, InterfaceClassGuid, + debugstr_w(pDeviceId), ulFlags, hMachine); + + if (pulLen == NULL) + return CR_INVALID_POINTER; + + if (ulFlags & ~CM_GET_DEVICE_INTERFACE_LIST_BITS) + return CR_INVALID_FLAG; + + if (hMachine != NULL) + { + BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle; + if (BindingHandle == NULL) + return CR_FAILURE; + } + else + { + if (!PnpGetLocalHandles(&BindingHandle, NULL)) + return CR_FAILURE; + } + + *pulLen = 0; + + RpcTryExcept + { + ret = PNP_GetInterfaceDeviceListSize(BindingHandle, + pulLen, + InterfaceClassGuid, + pDeviceId, + ulFlags); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + ret = RpcStatusToCmStatus(RpcExceptionCode()); + } + RpcEndExcept; + + return ret; +} + + /*********************************************************************** * CM_Get_First_Log_Conf [SETUPAPI.@] */ @@ -2271,7 +2696,7 @@ CONFIGRET WINAPI CM_Get_First_Log_Conf_Ex( return CR_FAILURE; } - lpDevInst = StringTableStringFromId(StringTable, dnDevInst); + lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst); if (lpDevInst == NULL) return CR_INVALID_DEVNODE; @@ -2409,7 +2834,7 @@ CONFIGRET WINAPI CM_Get_HW_Prof_Flags_ExA( if (szDevInstName != NULL) { - if (CaptureAndConvertAnsiArg(szDevInstName, &pszDevIdW)) + if (pSetupCaptureAndConvertAnsiArg(szDevInstName, &pszDevIdW)) return CR_INVALID_DEVICE_ID; } @@ -2471,6 +2896,114 @@ CONFIGRET WINAPI CM_Get_HW_Prof_Flags_ExW( } +/*********************************************************************** + * CM_Get_Hardware_Profile_InfoA [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Get_Hardware_Profile_InfoA( + ULONG ulIndex, PHWPROFILEINFO_A pHWProfileInfo, ULONG ulFlags) +{ + TRACE("%lu %p %lx\n", ulIndex, pHWProfileInfo, ulFlags); + + return CM_Get_Hardware_Profile_Info_ExA(ulIndex, pHWProfileInfo, + ulFlags, NULL); +} + + +/*********************************************************************** + * CM_Get_Hardware_Profile_InfoW [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Get_Hardware_Profile_InfoW( + ULONG ulIndex, PHWPROFILEINFO_W pHWProfileInfo, ULONG ulFlags) +{ + TRACE("%lu %p %lx\n", ulIndex, pHWProfileInfo, ulFlags); + + return CM_Get_Hardware_Profile_Info_ExW(ulIndex, pHWProfileInfo, + ulFlags, NULL); +} + + +/*********************************************************************** + * CM_Get_Hardware_Profile_Info_ExA [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Get_Hardware_Profile_Info_ExA( + ULONG ulIndex, PHWPROFILEINFO_A pHWProfileInfo, ULONG ulFlags, + HMACHINE hMachine) +{ + HWPROFILEINFO_W LocalProfileInfo; + CONFIGRET ret; + + TRACE("%lu %p %lx %lx\n", ulIndex, pHWProfileInfo, ulFlags, hMachine); + + if (pHWProfileInfo == NULL) + return CR_INVALID_POINTER; + + ret = CM_Get_Hardware_Profile_Info_ExW(ulIndex, &LocalProfileInfo, + ulFlags, hMachine); + if (ret == CR_SUCCESS) + { + pHWProfileInfo->HWPI_ulHWProfile = LocalProfileInfo.HWPI_ulHWProfile; + pHWProfileInfo->HWPI_dwFlags = LocalProfileInfo.HWPI_dwFlags; + + if (WideCharToMultiByte(CP_ACP, + 0, + LocalProfileInfo.HWPI_szFriendlyName, + lstrlenW(LocalProfileInfo.HWPI_szFriendlyName) + 1, + pHWProfileInfo->HWPI_szFriendlyName, + MAX_PROFILE_LEN, + NULL, + NULL) == 0) + ret = CR_FAILURE; + } + + return ret; +} + + +/*********************************************************************** + * CM_Get_Hardware_Profile_Info_ExW [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Get_Hardware_Profile_Info_ExW( + ULONG ulIndex, PHWPROFILEINFO_W pHWProfileInfo, ULONG ulFlags, + HMACHINE hMachine) +{ + RPC_BINDING_HANDLE BindingHandle = NULL; + CONFIGRET ret; + + TRACE("%lu %p %lx %lx\n", ulIndex, pHWProfileInfo, ulFlags, hMachine); + + if (pHWProfileInfo == NULL) + return CR_INVALID_POINTER; + + if (ulFlags != 0) + return CR_INVALID_FLAG; + + if (hMachine != NULL) + { + BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle; + if (BindingHandle == NULL) + return CR_FAILURE; + } + else + { + if (!PnpGetLocalHandles(&BindingHandle, NULL)) + return CR_FAILURE; + } + + RpcTryExcept + { + ret = PNP_GetHwProfInfo(BindingHandle, ulIndex, pHWProfileInfo, + sizeof(HWPROFILEINFO_W), 0); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + ret = RpcStatusToCmStatus(RpcExceptionCode()); + } + RpcEndExcept; + + return ret; +} + + /*********************************************************************** * CM_Get_Log_Conf_Priority [SETUPAPI.@] */ @@ -2523,7 +3056,7 @@ CONFIGRET WINAPI CM_Get_Log_Conf_Priority_Ex( return CR_FAILURE; } - lpDevInst = StringTableStringFromId(StringTable, pLogConfInfo->dnDevInst); + lpDevInst = pSetupStringTableStringFromId(StringTable, pLogConfInfo->dnDevInst); if (lpDevInst == NULL) return CR_INVALID_DEVNODE; @@ -2600,7 +3133,7 @@ CONFIGRET WINAPI CM_Get_Next_Log_Conf_Ex( return CR_FAILURE; } - lpDevInst = StringTableStringFromId(StringTable, pLogConfInfo->dnDevInst); + lpDevInst = pSetupStringTableStringFromId(StringTable, pLogConfInfo->dnDevInst); if (lpDevInst == NULL) return CR_INVALID_DEVNODE; @@ -2640,6 +3173,34 @@ CONFIGRET WINAPI CM_Get_Next_Log_Conf_Ex( } +/*********************************************************************** + * CM_Get_Next_Re_Des [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Get_Next_Res_Des( + PRES_DES prdResDes, RES_DES rdResDes, RESOURCEID ForResource, + PRESOURCEID pResourceID, ULONG ulFlags) +{ + TRACE("%p %p %lu %p %lx\n", prdResDes, rdResDes, ForResource, + pResourceID, ulFlags); + return CM_Get_Next_Res_Des_Ex(prdResDes, rdResDes, ForResource, + pResourceID, ulFlags, NULL); +} + + +/*********************************************************************** + * CM_Get_Next_Re_Des_Ex [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Get_Next_Res_Des_Ex( + PRES_DES prdResDes, RES_DES rdResDes, RESOURCEID ForResource, + PRESOURCEID pResourceID, ULONG ulFlags, HMACHINE hMachine) +{ + FIXME("%p %p %lu %p %lx %lx\n", prdResDes, rdResDes, ForResource, + pResourceID, ulFlags, hMachine); + + return CR_CALL_NOT_IMPLEMENTED; +} + + /*********************************************************************** * CM_Get_Parent [SETUPAPI.@] */ @@ -2693,7 +3254,7 @@ CONFIGRET WINAPI CM_Get_Parent_Ex( return CR_FAILURE; } - lpDevInst = StringTableStringFromId(StringTable, dnDevInst); + lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst); if (lpDevInst == NULL) return CR_INVALID_DEVNODE; @@ -2717,7 +3278,7 @@ CONFIGRET WINAPI CM_Get_Parent_Ex( TRACE("szRelatedDevInst: %s\n", debugstr_w(szRelatedDevInst)); - dwIndex = StringTableAddString(StringTable, szRelatedDevInst, 1); + dwIndex = pSetupStringTableAddString(StringTable, szRelatedDevInst, 1); if (dwIndex == -1) return CR_FAILURE; @@ -2727,6 +3288,51 @@ CONFIGRET WINAPI CM_Get_Parent_Ex( } +/*********************************************************************** + * CM_Get_Res_Des_Data [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Get_Res_Des_Data( + RES_DES rdResDes, PVOID Buffer, ULONG BufferLen, ULONG ulFlags) +{ + TRACE("%p %p %l %lx\n", rdResDes, Buffer, BufferLen, ulFlags); + return CM_Get_Res_Des_Data_Ex(rdResDes, Buffer, BufferLen, ulFlags, NULL); +} + + +/*********************************************************************** + * CM_Get_Res_Des_Data_Ex [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Get_Res_Des_Data_Ex( + RES_DES rdResDes, PVOID Buffer, ULONG BufferLen, ULONG ulFlags, + HMACHINE hMachine) +{ + FIXME("%p %p %l %lx %lx\n", rdResDes, Buffer, BufferLen, ulFlags, hMachine); + return CR_CALL_NOT_IMPLEMENTED; +} + + +/*********************************************************************** + * CM_Get_Res_Des_Size [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Get_Res_Des_Data_Size( + PULONG pulSize, RES_DES rdResDes, ULONG ulFlags) +{ + TRACE("%p %p %lx\n", pulSize, rdResDes, ulFlags); + return CM_Get_Res_Des_Data_Size_Ex(pulSize, rdResDes, ulFlags, NULL); +} + + +/*********************************************************************** + * CM_Get_Res_Des_Size_Ex [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Get_Res_Des_Data_Size_Ex( + PULONG pulSize, RES_DES rdResDes, ULONG ulFlags, HMACHINE hMachine) +{ + TRACE("%p %p %lx %lx\n", pulSize, rdResDes, ulFlags, hMachine); + return CR_CALL_NOT_IMPLEMENTED; +} + + /*********************************************************************** * CM_Get_Sibling [SETUPAPI.@] */ @@ -2780,7 +3386,7 @@ CONFIGRET WINAPI CM_Get_Sibling_Ex( return CR_FAILURE; } - lpDevInst = StringTableStringFromId(StringTable, dnDevInst); + lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst); if (lpDevInst == NULL) return CR_INVALID_DEVNODE; @@ -2804,7 +3410,7 @@ CONFIGRET WINAPI CM_Get_Sibling_Ex( TRACE("szRelatedDevInst: %s\n", debugstr_w(szRelatedDevInst)); - dwIndex = StringTableAddString(StringTable, szRelatedDevInst, 1); + dwIndex = pSetupStringTableAddString(StringTable, szRelatedDevInst, 1); if (dwIndex == -1) return CR_FAILURE; @@ -3008,7 +3614,7 @@ CONFIGRET WINAPI CM_Locate_DevNode_ExA( if (pDeviceID != NULL) { - if (CaptureAndConvertAnsiArg(pDeviceID, &pDevIdW)) + if (pSetupCaptureAndConvertAnsiArg(pDeviceID, &pDevIdW)) return CR_INVALID_DEVICE_ID; } @@ -3095,7 +3701,7 @@ CONFIGRET WINAPI CM_Locate_DevNode_ExW( if (ret == CR_SUCCESS) { - *pdnDevInst = StringTableAddString(StringTable, DeviceIdBuffer, 1); + *pdnDevInst = pSetupStringTableAddString(StringTable, DeviceIdBuffer, 1); if (*pdnDevInst == -1) ret = CR_FAILURE; } @@ -3104,6 +3710,33 @@ CONFIGRET WINAPI CM_Locate_DevNode_ExW( } +/*********************************************************************** + * CM_Modify_Res_Des [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Modify_Res_Des( + PRES_DES prdResDes, RES_DES rdResDes, RESOURCEID ResourceID, + PCVOID ResourceData, ULONG ResourceLen, ULONG ulFlags) +{ + TRACE("%p %p %lx %p %lu %lx", prdResDes, rdResDes, ResourceID, ResourceData, + ResourceLen, ulFlags); + return CM_Modify_Res_Des_Ex(prdResDes, rdResDes, ResourceID, ResourceData, + ResourceLen, ulFlags, NULL); +} + + +/*********************************************************************** + * CM_Modify_Res_Des_Ex [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Modify_Res_Des_Ex( + PRES_DES prdResDes, RES_DES rdResDes, RESOURCEID ResourceID, PCVOID ResourceData, + ULONG ResourceLen, ULONG ulFlags, HMACHINE hMachine) +{ + FIXME("%p %p %lx %p %lu %lx %lx", prdResDes, rdResDes, ResourceID, ResourceData, + ResourceLen, ulFlags, hMachine); + return CR_CALL_NOT_IMPLEMENTED; +} + + /*********************************************************************** * CM_Move_DevNode [SETUPAPI.@] */ @@ -3131,7 +3764,7 @@ CONFIGRET WINAPI CM_Move_DevNode_Ex( FIXME("%lx %lx %lx %lx\n", dnFromDevInst, dnToDevInst, ulFlags, hMachine); - if (!IsUserAdmin()) + if (!pSetupIsUserAdmin()) return CR_ACCESS_DENIED; if (dnFromDevInst == 0 || dnToDevInst == 0) @@ -3156,11 +3789,11 @@ CONFIGRET WINAPI CM_Move_DevNode_Ex( return CR_FAILURE; } - lpFromDevInst = StringTableStringFromId(StringTable, dnFromDevInst); + lpFromDevInst = pSetupStringTableStringFromId(StringTable, dnFromDevInst); if (lpFromDevInst == NULL) return CR_INVALID_DEVNODE; - lpToDevInst = StringTableStringFromId(StringTable, dnToDevInst); + lpToDevInst = pSetupStringTableStringFromId(StringTable, dnToDevInst); if (lpToDevInst == NULL) return CR_INVALID_DEVNODE; @@ -3231,7 +3864,7 @@ CONFIGRET WINAPI CM_Open_Class_Key_ExA( if (pszClassName != NULL) { - if (CaptureAndConvertAnsiArg(pszClassName, &pszClassNameW)) + if (pSetupCaptureAndConvertAnsiArg(pszClassName, &pszClassNameW)) return CR_INVALID_DATA; } @@ -3370,6 +4003,323 @@ CONFIGRET WINAPI CM_Open_DevNode_Key_Ex( } +/*********************************************************************** + * CM_Query_And_Remove_SubTreeA [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Query_And_Remove_SubTreeA( + DEVINST dnAncestor, PPNP_VETO_TYPE pVetoType, LPSTR pszVetoName, + ULONG ulNameLength, ULONG ulFlags) +{ + TRACE("%lx %p %s %lu %lx\n", dnAncestor, pVetoType, pszVetoName, + ulNameLength, ulFlags); + + return CM_Query_And_Remove_SubTree_ExA(dnAncestor, pVetoType, pszVetoName, + ulNameLength, ulFlags, NULL); +} + + +/*********************************************************************** + * CM_Query_And_Remove_SubTreeW [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Query_And_Remove_SubTreeW( + DEVINST dnAncestor, PPNP_VETO_TYPE pVetoType, LPWSTR pszVetoName, + ULONG ulNameLength, ULONG ulFlags) +{ + TRACE("%lx %p %s %lu %lx\n", dnAncestor, pVetoType, + debugstr_w(pszVetoName), ulNameLength, ulFlags); + + return CM_Query_And_Remove_SubTree_ExW(dnAncestor, pVetoType, pszVetoName, + ulNameLength, ulFlags, NULL); +} + + +/*********************************************************************** + * CM_Query_And_Remove_SubTree_ExA [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Query_And_Remove_SubTree_ExA( + DEVINST dnAncestor, PPNP_VETO_TYPE pVetoType, LPSTR pszVetoName, + ULONG ulNameLength, ULONG ulFlags, HMACHINE hMachine) +{ + LPWSTR lpLocalVetoName; + CONFIGRET ret; + + TRACE("%lx %p %s %lu %lx %lx\n", dnAncestor, pVetoType, pszVetoName, + ulNameLength, ulFlags, hMachine); + + if (pszVetoName == NULL && ulNameLength == 0) + return CR_INVALID_POINTER; + + lpLocalVetoName = HeapAlloc(GetProcessHeap(), 0, ulNameLength * sizeof(WCHAR)); + if (lpLocalVetoName == NULL) + return CR_OUT_OF_MEMORY; + + ret = CM_Query_And_Remove_SubTree_ExW(dnAncestor, pVetoType, lpLocalVetoName, + ulNameLength, ulFlags, hMachine); + if (ret == CR_REMOVE_VETOED) + { + if (WideCharToMultiByte(CP_ACP, + 0, + lpLocalVetoName, + ulNameLength, + pszVetoName, + ulNameLength, + NULL, + NULL) == 0) + ret = CR_FAILURE; + } + + HeapFree(GetProcessHeap(), 0, lpLocalVetoName); + + return ret; +} + + +/*********************************************************************** + * CM_Query_And_Remove_SubTree_ExW [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Query_And_Remove_SubTree_ExW( + DEVINST dnAncestor, PPNP_VETO_TYPE pVetoType, LPWSTR pszVetoName, + ULONG ulNameLength, ULONG ulFlags, HMACHINE hMachine) +{ + RPC_BINDING_HANDLE BindingHandle = NULL; + HSTRING_TABLE StringTable = NULL; + LPWSTR lpDevInst; + CONFIGRET ret; + + TRACE("%lx %p %s %lu %lx %lx\n", dnAncestor, pVetoType, + debugstr_w(pszVetoName), ulNameLength, ulFlags, hMachine); + + if (dnAncestor == 0) + return CR_INVALID_DEVNODE; + + if (ulFlags & ~CM_REMOVE_BITS) + return CR_INVALID_FLAG; + + if (pszVetoName == NULL && ulNameLength == 0) + return CR_INVALID_POINTER; + + if (hMachine != NULL) + { + BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle; + if (BindingHandle == NULL) + return CR_FAILURE; + + StringTable = ((PMACHINE_INFO)hMachine)->StringTable; + if (StringTable == 0) + return CR_FAILURE; + } + else + { + if (!PnpGetLocalHandles(&BindingHandle, &StringTable)) + return CR_FAILURE; + } + + lpDevInst = pSetupStringTableStringFromId(StringTable, dnAncestor); + if (lpDevInst == NULL) + return CR_INVALID_DEVNODE; + + RpcTryExcept + { + ret = PNP_QueryRemove(BindingHandle, + lpDevInst, + pVetoType, + pszVetoName, + ulNameLength, + ulFlags); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + ret = RpcStatusToCmStatus(RpcExceptionCode()); + } + RpcEndExcept; + + return ret; +} + + +/*********************************************************************** + * CM_Query_Arbitrator_Free_Data [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Query_Arbitrator_Free_Data( + PVOID pData, ULONG DataLen, DEVINST dnDevInst, RESOURCEID ResourceID, + ULONG ulFlags) +{ + TRACE("%p %lu %lx %lu 0x%08lx\n", pData, DataLen, dnDevInst, + ResourceID, ulFlags); + + return CM_Query_Arbitrator_Free_Data_Ex(pData, DataLen, dnDevInst, + ResourceID, ulFlags, NULL); +} + + +/*********************************************************************** + * CM_Query_Arbitrator_Free_Data_Ex [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Query_Arbitrator_Free_Data_Ex( + OUT PVOID pData, + IN ULONG DataLen, + IN DEVINST dnDevInst, + IN RESOURCEID ResourceID, + IN ULONG ulFlags, + IN HMACHINE hMachine) +{ + RPC_BINDING_HANDLE BindingHandle = NULL; + HSTRING_TABLE StringTable = NULL; + LPWSTR lpDevInst; + CONFIGRET ret; + + TRACE("%p %lu %lx %lu 0x%08lx %p\n", pData, DataLen, dnDevInst, + ResourceID, ulFlags, hMachine); + + if (pData == NULL || DataLen == 0) + return CR_INVALID_POINTER; + + if (dnDevInst == 0) + return CR_INVALID_DEVINST; + + if (ulFlags & ~CM_QUERY_ARBITRATOR_BITS) + return CR_INVALID_FLAG; + + if (hMachine != NULL) + { + BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle; + if (BindingHandle == NULL) + return CR_FAILURE; + + StringTable = ((PMACHINE_INFO)hMachine)->StringTable; + if (StringTable == 0) + return CR_FAILURE; + } + else + { + if (!PnpGetLocalHandles(&BindingHandle, &StringTable)) + return CR_FAILURE; + } + + lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst); + if (lpDevInst == NULL) + return CR_INVALID_DEVNODE; + + RpcTryExcept + { + ret = PNP_QueryArbitratorFreeData(BindingHandle, + pData, + DataLen, + lpDevInst, + ResourceID, + ulFlags); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + ret = RpcStatusToCmStatus(RpcExceptionCode()); + } + RpcEndExcept; + + return ret; +} + + +/*********************************************************************** + * CM_Query_Arbitrator_Free_Size [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Query_Arbitrator_Free_Size( + PULONG pulSize, DEVINST dnDevInst, RESOURCEID ResourceID, ULONG ulFlags) +{ + TRACE("%p %lu %lx 0x%08lx\n", pulSize, dnDevInst,ResourceID, ulFlags); + + return CM_Query_Arbitrator_Free_Size_Ex(pulSize, dnDevInst, ResourceID, + ulFlags, NULL); +} + + +/*********************************************************************** + * CM_Query_Arbitrator_Free_Size_Ex [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Query_Arbitrator_Free_Size_Ex( + PULONG pulSize, DEVINST dnDevInst, RESOURCEID ResourceID, + ULONG ulFlags, HMACHINE hMachine) +{ + RPC_BINDING_HANDLE BindingHandle = NULL; + HSTRING_TABLE StringTable = NULL; + LPWSTR lpDevInst; + CONFIGRET ret; + + TRACE("%p %lu %lx 0x%08lx %p\n", pulSize, dnDevInst,ResourceID, ulFlags, + hMachine); + + if (pulSize == NULL) + return CR_INVALID_POINTER; + + if (dnDevInst == 0) + return CR_INVALID_DEVINST; + + if (ulFlags & ~CM_QUERY_ARBITRATOR_BITS) + return CR_INVALID_FLAG; + + if (hMachine != NULL) + { + BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle; + if (BindingHandle == NULL) + return CR_FAILURE; + + StringTable = ((PMACHINE_INFO)hMachine)->StringTable; + if (StringTable == 0) + return CR_FAILURE; + } + else + { + if (!PnpGetLocalHandles(&BindingHandle, &StringTable)) + return CR_FAILURE; + } + + lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst); + if (lpDevInst == NULL) + return CR_INVALID_DEVNODE; + + RpcTryExcept + { + ret = PNP_QueryArbitratorFreeSize(BindingHandle, + pulSize, + lpDevInst, + ResourceID, + ulFlags); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + ret = RpcStatusToCmStatus(RpcExceptionCode()); + } + RpcEndExcept; + + return ret; +} + + +/*********************************************************************** + * CM_Query_Remove_SubTree [SETUPAPI.@] + * + * This function is obsolete in Windows XP and above. + */ +CONFIGRET WINAPI CM_Query_Remove_SubTree( + DEVINST dnAncestor, ULONG ulFlags) +{ + TRACE("%lx %lx\n", dnAncestor, ulFlags); + return CR_CALL_NOT_IMPLEMENTED; +} + + +/*********************************************************************** + * CM_Query_Remove_SubTree_Ex [SETUPAPI.@] + * + * This function is obsolete in Windows XP and above. + */ +CONFIGRET WINAPI CM_Query_Remove_SubTree_Ex( + DEVINST dnAncestor, ULONG ulFlags, HMACHINE hMachine) +{ + TRACE("%lx %lx %lx\n", dnAncestor, ulFlags, hMachine); + return CR_CALL_NOT_IMPLEMENTED; +} + + /*********************************************************************** * CM_Reenumerate_DevNode [SETUPAPI.@] */ @@ -3417,7 +4367,7 @@ CM_Reenumerate_DevNode_Ex( return CR_FAILURE; } - lpDevInst = StringTableStringFromId(StringTable, dnDevInst); + lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst); if (lpDevInst == NULL) return CR_INVALID_DEVNODE; @@ -3439,6 +4389,398 @@ CM_Reenumerate_DevNode_Ex( } +/*********************************************************************** + * CM_Register_Device_InterfaceA [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Register_Device_InterfaceA( + DEVINST dnDevInst, LPGUID InterfaceClassGuid, LPCSTR pszReference, + LPSTR pszDeviceInterface, PULONG pulLength, ULONG ulFlags) +{ + TRACE("%lx %s %s %p %p %lx\n", dnDevInst, debugstr_guid(InterfaceClassGuid), + pszReference, pszDeviceInterface, pulLength, ulFlags); + + return CM_Register_Device_Interface_ExA(dnDevInst, InterfaceClassGuid, + pszReference, pszDeviceInterface, + pulLength, ulFlags, NULL); +} + + +/*********************************************************************** + * CM_Register_Device_InterfaceW [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Register_Device_InterfaceW( + DEVINST dnDevInst, LPGUID InterfaceClassGuid, LPCWSTR pszReference, + LPWSTR pszDeviceInterface, PULONG pulLength, ULONG ulFlags) +{ + TRACE("%lx %s %s %p %p %lx\n", dnDevInst, debugstr_guid(InterfaceClassGuid), + debugstr_w(pszReference), pszDeviceInterface, pulLength, ulFlags); + + return CM_Register_Device_Interface_ExW(dnDevInst, InterfaceClassGuid, + pszReference, pszDeviceInterface, + pulLength, ulFlags, NULL); +} + + +/*********************************************************************** + * CM_Register_Device_Interface_ExA [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Register_Device_Interface_ExA( + DEVINST dnDevInst, LPGUID InterfaceClassGuid, LPCSTR pszReference, + LPSTR pszDeviceInterface, PULONG pulLength, ULONG ulFlags, HMACHINE hMachine) +{ + LPWSTR pszReferenceW = NULL; + LPWSTR pszDeviceInterfaceW = NULL; + ULONG ulLength; + CONFIGRET ret; + + TRACE("%lx %s %s %p %p %lx %lx\n", dnDevInst, debugstr_guid(InterfaceClassGuid), + pszReference, pszDeviceInterface, pulLength, ulFlags, hMachine); + + if (pulLength == NULL || pszDeviceInterface == NULL) + return CR_INVALID_POINTER; + + if (pszReference != NULL) + { + if (pSetupCaptureAndConvertAnsiArg(pszReference, &pszReferenceW)) + return CR_INVALID_DATA; + } + + ulLength = *pulLength; + + pszDeviceInterfaceW = HeapAlloc(GetProcessHeap(), 0, ulLength * sizeof(WCHAR)); + if (pszDeviceInterfaceW == NULL) + { + ret = CR_OUT_OF_MEMORY; + goto Done; + } + + ret = CM_Register_Device_Interface_ExW(dnDevInst, + InterfaceClassGuid, + pszReferenceW, + pszDeviceInterfaceW, + &ulLength, + ulFlags, + hMachine); + if (ret == CR_SUCCESS) + { + if (WideCharToMultiByte(CP_ACP, + 0, + pszDeviceInterfaceW, + ulLength, + pszDeviceInterface, + *pulLength, + NULL, + NULL) == 0) + ret = CR_FAILURE; + } + + *pulLength = ulLength; + +Done: + if (pszDeviceInterfaceW != NULL) + HeapFree(GetProcessHeap(), 0, pszDeviceInterfaceW); + + if (pszReferenceW != NULL) + MyFree(pszReferenceW); + + return ret; +} + + +/*********************************************************************** + * CM_Register_Device_Interface_ExW [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Register_Device_Interface_ExW( + DEVINST dnDevInst, LPGUID InterfaceClassGuid, LPCWSTR pszReference, + LPWSTR pszDeviceInterface, PULONG pulLength, ULONG ulFlags, HMACHINE hMachine) +{ + RPC_BINDING_HANDLE BindingHandle = NULL; + HSTRING_TABLE StringTable = NULL; + LPWSTR lpDevInst; + ULONG ulTransferLength; + CONFIGRET ret; + + TRACE("%lx %s %s %p %p %lx %lx\n", dnDevInst, debugstr_guid(InterfaceClassGuid), + debugstr_w(pszReference), pszDeviceInterface, pulLength, ulFlags, hMachine); + + if (dnDevInst == 0) + return CR_INVALID_DEVNODE; + + if (InterfaceClassGuid == NULL || + pszDeviceInterface == NULL || + pulLength == NULL) + return CR_INVALID_POINTER; + + if (ulFlags != 0) + return CR_INVALID_FLAG; + + if (hMachine != NULL) + { + BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle; + if (BindingHandle == NULL) + return CR_FAILURE; + + StringTable = ((PMACHINE_INFO)hMachine)->StringTable; + if (StringTable == 0) + return CR_FAILURE; + } + else + { + if (!PnpGetLocalHandles(&BindingHandle, &StringTable)) + return CR_FAILURE; + } + + lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst); + if (lpDevInst == NULL) + return CR_INVALID_DEVNODE; + + ulTransferLength = *pulLength; + + RpcTryExcept + { + ret = PNP_RegisterDeviceClassAssociation(BindingHandle, + lpDevInst, + InterfaceClassGuid, + (LPWSTR)pszReference, + pszDeviceInterface, + pulLength, + &ulTransferLength, + 0); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + ret = RpcStatusToCmStatus(RpcExceptionCode()); + } + RpcEndExcept; + + return ret; +} + + +/*********************************************************************** + * CM_Register_Device_Driver [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Register_Device_Driver( + DEVINST dnDevInst, ULONG ulFlags) +{ + TRACE("%lx 0x%08lx\n", dnDevInst, ulFlags); + return CM_Register_Device_Driver_Ex(dnDevInst, ulFlags, NULL); +} + + +/*********************************************************************** + * CM_Register_Device_Driver [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Register_Device_Driver_Ex( + DEVINST dnDevInst, ULONG ulFlags, HMACHINE hMachine) +{ + RPC_BINDING_HANDLE BindingHandle = NULL; + HSTRING_TABLE StringTable = NULL; + LPWSTR lpDevInst; + CONFIGRET ret; + + TRACE("%lx 0x%08lx %p\n", dnDevInst, ulFlags, hMachine); + + if (dnDevInst == 0) + return CR_INVALID_DEVNODE; + + if (ulFlags & ~CM_REGISTER_DEVICE_DRIVER_BITS) + return CR_INVALID_FLAG; + + if (hMachine != NULL) + { + BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle; + if (BindingHandle == NULL) + return CR_FAILURE; + + StringTable = ((PMACHINE_INFO)hMachine)->StringTable; + if (StringTable == 0) + return CR_FAILURE; + } + else + { + if (!PnpGetLocalHandles(&BindingHandle, &StringTable)) + return CR_FAILURE; + } + + lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst); + if (lpDevInst == NULL) + return CR_INVALID_DEVNODE; + + RpcTryExcept + { + ret = PNP_RegisterDriver(BindingHandle, + lpDevInst, + ulFlags); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + ret = RpcStatusToCmStatus(RpcExceptionCode()); + } + RpcEndExcept; + + return ret; +} + + +/*********************************************************************** + * CM_Remove_SubTree [SETUPAPI.@] + * + * This function is obsolete in Windows XP and above. + */ +CONFIGRET WINAPI CM_Remove_SubTree( + DEVINST dnAncestor, ULONG ulFlags) +{ + TRACE("%lx %lx\n", dnAncestor, ulFlags); + return CR_CALL_NOT_IMPLEMENTED; +} + + +/*********************************************************************** + * CM_Remove_SubTree_Ex [SETUPAPI.@] + * + * This function is obsolete in Windows XP and above. + */ +CONFIGRET WINAPI CM_Remove_SubTree_Ex( + DEVINST dnAncestor, ULONG ulFlags, HMACHINE hMachine) +{ + TRACE("%lx %lx %lx\n", dnAncestor, ulFlags, hMachine); + return CR_CALL_NOT_IMPLEMENTED; +} + + +/*********************************************************************** + * CM_Request_Device_EjectA [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Request_Device_EjectA( + DEVINST dnDevInst, PPNP_VETO_TYPE pVetoType, LPSTR pszVetoName, + ULONG ulNameLength, ULONG ulFlags) +{ + TRACE("%lx %p %s %lu %lx\n", dnDevInst, pVetoType, pszVetoName, + ulNameLength, ulFlags); + return CM_Request_Device_Eject_ExA(dnDevInst, pVetoType, pszVetoName, + ulNameLength, ulFlags, NULL); +} + + +/*********************************************************************** + * CM_Request_Device_EjectW [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Request_Device_EjectW( + DEVINST dnDevInst, PPNP_VETO_TYPE pVetoType, LPWSTR pszVetoName, + ULONG ulNameLength, ULONG ulFlags) +{ + TRACE("%lx %p %s %lu %lx\n", dnDevInst, pVetoType, debugstr_w(pszVetoName), + ulNameLength, ulFlags); + return CM_Request_Device_Eject_ExW(dnDevInst, pVetoType, pszVetoName, + ulNameLength, ulFlags, NULL); +} + + +/*********************************************************************** + * CM_Request_Device_Eject_ExA [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Request_Device_Eject_ExA( + DEVINST dnDevInst, PPNP_VETO_TYPE pVetoType, LPSTR pszVetoName, + ULONG ulNameLength, ULONG ulFlags, HMACHINE hMachine) +{ + LPWSTR lpLocalVetoName; + CONFIGRET ret; + + TRACE("%lx %p %s %lu %lx %lx\n", dnDevInst, pVetoType, pszVetoName, + ulNameLength, ulFlags, hMachine); + + if (pszVetoName == NULL && ulNameLength == 0) + return CR_INVALID_POINTER; + + lpLocalVetoName = HeapAlloc(GetProcessHeap(), 0, ulNameLength * sizeof(WCHAR)); + if (lpLocalVetoName == NULL) + return CR_OUT_OF_MEMORY; + + ret = CM_Request_Device_Eject_ExW(dnDevInst, pVetoType, lpLocalVetoName, + ulNameLength, ulFlags, hMachine); + if (ret == CR_REMOVE_VETOED) + { + if (WideCharToMultiByte(CP_ACP, + 0, + lpLocalVetoName, + ulNameLength, + pszVetoName, + ulNameLength, + NULL, + NULL) == 0) + ret = CR_FAILURE; + } + + HeapFree(GetProcessHeap(), 0, lpLocalVetoName); + + return ret; +} + + +/*********************************************************************** + * CM_Request_Device_Eject_ExW [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Request_Device_Eject_ExW( + DEVINST dnDevInst, PPNP_VETO_TYPE pVetoType, LPWSTR pszVetoName, + ULONG ulNameLength, ULONG ulFlags, HMACHINE hMachine) +{ + RPC_BINDING_HANDLE BindingHandle = NULL; + HSTRING_TABLE StringTable = NULL; + LPWSTR lpDevInst; + CONFIGRET ret; + + TRACE("%lx %p %s %lu %lx %lx\n", dnDevInst, pVetoType, + debugstr_w(pszVetoName), ulNameLength, ulFlags, hMachine); + + if (dnDevInst == 0) + return CR_INVALID_DEVNODE; + + if (ulFlags != 0) + return CR_INVALID_FLAG; + + if (pszVetoName == NULL && ulNameLength == 0) + return CR_INVALID_POINTER; + + if (hMachine != NULL) + { + BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle; + if (BindingHandle == NULL) + return CR_FAILURE; + + StringTable = ((PMACHINE_INFO)hMachine)->StringTable; + if (StringTable == 0) + return CR_FAILURE; + } + else + { + if (!PnpGetLocalHandles(&BindingHandle, &StringTable)) + return CR_FAILURE; + } + + lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst); + if (lpDevInst == NULL) + return CR_INVALID_DEVNODE; + + RpcTryExcept + { + ret = PNP_RequestDeviceEject(BindingHandle, + lpDevInst, + pVetoType, + pszVetoName, + ulNameLength, + ulFlags); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + ret = RpcStatusToCmStatus(RpcExceptionCode()); + } + RpcEndExcept; + + return ret; +} + + /*********************************************************************** * CM_Request_Eject_PC [SETUPAPI.@] */ @@ -3508,7 +4850,7 @@ CONFIGRET WINAPI CM_Run_Detection_Ex( TRACE("%lx %lx\n", ulFlags, hMachine); - if (!IsUserAdmin()) + if (!pSetupIsUserAdmin()) return CR_ACCESS_DENIED; if (ulFlags & ~CM_DETECT_BITS) @@ -3587,7 +4929,7 @@ CONFIGRET WINAPI CM_Set_DevNode_Problem_Ex( return CR_FAILURE; } - lpDevInst = StringTableStringFromId(StringTable, dnDevInst); + lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst); if (lpDevInst == NULL) return CR_INVALID_DEVNODE; @@ -3815,7 +5157,7 @@ CONFIGRET WINAPI CM_Set_DevNode_Registry_Property_ExW( return CR_FAILURE; } - lpDevInst = StringTableStringFromId(StringTable, dnDevInst); + lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst); if (lpDevInst == NULL) return CR_INVALID_DEVNODE; @@ -3919,7 +5261,7 @@ CONFIGRET WINAPI CM_Set_HW_Prof_Ex( TRACE("%lu %lu %lx\n", ulHardwareProfile, ulFlags, hMachine); - if (!IsUserAdmin()) + if (!pSetupIsUserAdmin()) return CR_ACCESS_DENIED; if (ulFlags != 0) @@ -3994,7 +5336,7 @@ CONFIGRET WINAPI CM_Set_HW_Prof_Flags_ExA( if (szDevInstName != NULL) { - if (CaptureAndConvertAnsiArg(szDevInstName, &pszDevIdW)) + if (pSetupCaptureAndConvertAnsiArg(szDevInstName, &pszDevIdW)) return CR_INVALID_DEVICE_ID; } @@ -4080,7 +5422,7 @@ CONFIGRET WINAPI CM_Setup_DevNode_Ex( FIXME("%lx %lx %lx\n", dnDevInst, ulFlags, hMachine); - if (!IsUserAdmin()) + if (!pSetupIsUserAdmin()) return CR_ACCESS_DENIED; if (dnDevInst == 0) @@ -4105,7 +5447,7 @@ CONFIGRET WINAPI CM_Setup_DevNode_Ex( return CR_FAILURE; } - lpDevInst = StringTableStringFromId(StringTable, dnDevInst); + lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst); if (lpDevInst == NULL) return CR_INVALID_DEVNODE; @@ -4173,7 +5515,7 @@ CONFIGRET WINAPI CM_Uninstall_DevNode_Ex( return CR_FAILURE; } - lpDevInst = StringTableStringFromId(StringTable, dnPhantom); + lpDevInst = pSetupStringTableStringFromId(StringTable, dnPhantom); if (lpDevInst == NULL) return CR_INVALID_DEVNODE; @@ -4191,3 +5533,101 @@ CONFIGRET WINAPI CM_Uninstall_DevNode_Ex( return ret; } + + +/*********************************************************************** + * CM_Unregister_Device_InterfaceA [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Unregister_Device_InterfaceA( + LPCSTR pszDeviceInterface, ULONG ulFlags) +{ + TRACE("%s %lx\n", pszDeviceInterface, ulFlags); + + return CM_Unregister_Device_Interface_ExA(pszDeviceInterface, + ulFlags, NULL); +} + + +/*********************************************************************** + * CM_Unregister_Device_InterfaceW [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Unregister_Device_InterfaceW( + LPCWSTR pszDeviceInterface, ULONG ulFlags) +{ + TRACE("%s %lx\n", debugstr_w(pszDeviceInterface), ulFlags); + + return CM_Unregister_Device_Interface_ExW(pszDeviceInterface, + ulFlags, NULL); +} + + +/*********************************************************************** + * CM_Unregister_Device_Interface_ExA [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Unregister_Device_Interface_ExA( + LPCSTR pszDeviceInterface, ULONG ulFlags, HMACHINE hMachine) +{ + LPWSTR pszDeviceInterfaceW = NULL; + CONFIGRET ret; + + TRACE("%s %lx %lx\n", pszDeviceInterface, ulFlags, hMachine); + + if (pszDeviceInterface == NULL) + return CR_INVALID_POINTER; + + if (pSetupCaptureAndConvertAnsiArg(pszDeviceInterface, &pszDeviceInterfaceW)) + return CR_INVALID_DATA; + + ret = CM_Unregister_Device_Interface_ExW(pszDeviceInterfaceW, + ulFlags, hMachine); + + if (pszDeviceInterfaceW != NULL) + MyFree(pszDeviceInterfaceW); + + return ret; +} + + +/*********************************************************************** + * CM_Unregister_Device_Interface_ExW [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Unregister_Device_Interface_ExW( + LPCWSTR pszDeviceInterface, ULONG ulFlags, HMACHINE hMachine) +{ + RPC_BINDING_HANDLE BindingHandle = NULL; + CONFIGRET ret; + + TRACE("%s %lx %lx\n", debugstr_w(pszDeviceInterface), ulFlags, hMachine); + + if (pszDeviceInterface == NULL) + return CR_INVALID_POINTER; + + if (ulFlags != 0) + return CR_INVALID_FLAG; + + if (hMachine != NULL) + { + BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle; + if (BindingHandle == NULL) + return CR_FAILURE; + } + else + { + if (!PnpGetLocalHandles(&BindingHandle, NULL)) + return CR_FAILURE; + } + + RpcTryExcept + { + ret = PNP_UnregisterDeviceClassAssociation(BindingHandle, + (LPWSTR)pszDeviceInterface, + ulFlags); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + ret = RpcStatusToCmStatus(RpcExceptionCode()); + } + RpcEndExcept; + + return ret; +} diff --git a/dll/win32/setupapi/devclass.c b/dll/win32/setupapi/devclass.c index f636e66c740..61a9be49276 100644 --- a/dll/win32/setupapi/devclass.c +++ b/dll/win32/setupapi/devclass.c @@ -446,7 +446,7 @@ SetupDiGetClassImageListExA( if (MachineName) { - MachineNameW = MultiByteToUnicode(MachineName, CP_ACP); + MachineNameW = pSetupMultiByteToUnicode(MachineName, CP_ACP); if (MachineNameW == NULL) return FALSE; } diff --git a/dll/win32/setupapi/devinst.c b/dll/win32/setupapi/devinst.c index 6ab6184cca9..c87811f669f 100644 --- a/dll/win32/setupapi/devinst.c +++ b/dll/win32/setupapi/devinst.c @@ -156,10 +156,10 @@ CheckSectionValid( *ScorePlatform = *ScoreMajorVersion = *ScoreMinorVersion = *ScoreProductType = *ScoreSuiteMask = 0; - Section = DuplicateString(SectionName); + Section = pSetupDuplicateString(SectionName); if (!Section) { - TRACE("DuplicateString() failed\n"); + TRACE("pSetupDuplicateString() failed\n"); goto cleanup; } @@ -687,7 +687,7 @@ BOOL WINAPI SetupDiBuildClassInfoListExA( if (MachineName) { - MachineNameW = MultiByteToUnicode(MachineName, CP_ACP); + MachineNameW = pSetupMultiByteToUnicode(MachineName, CP_ACP); if (MachineNameW == NULL) return FALSE; } @@ -910,13 +910,13 @@ BOOL WINAPI SetupDiClassGuidsFromNameExA( return FALSE; } - ClassNameW = MultiByteToUnicode(ClassName, CP_ACP); + ClassNameW = pSetupMultiByteToUnicode(ClassName, CP_ACP); if (ClassNameW == NULL) return FALSE; if (MachineName) { - MachineNameW = MultiByteToUnicode(MachineName, CP_ACP); + MachineNameW = pSetupMultiByteToUnicode(MachineName, CP_ACP); if (MachineNameW == NULL) { MyFree(ClassNameW); @@ -1101,7 +1101,7 @@ BOOL WINAPI SetupDiClassNameFromGuidExA( BOOL ret; if (MachineName) - MachineNameW = MultiByteToUnicode(MachineName, CP_ACP); + MachineNameW = pSetupMultiByteToUnicode(MachineName, CP_ACP); ret = SetupDiClassNameFromGuidExW(ClassGuid, ClassNameW, MAX_CLASS_NAME_LEN, RequiredSize, MachineNameW, Reserved); if (ret) @@ -1235,7 +1235,7 @@ SetupDiCreateDeviceInfoListExA(const GUID *ClassGuid, if (MachineName) { - MachineNameW = MultiByteToUnicode(MachineName, CP_ACP); + MachineNameW = pSetupMultiByteToUnicode(MachineName, CP_ACP); if (MachineNameW == NULL) return INVALID_HANDLE_VALUE; } @@ -1381,7 +1381,7 @@ HKEY WINAPI SetupDiCreateDevRegKeyA( } else { - InfSectionNameW = MultiByteToUnicode(InfSectionName, CP_ACP); + InfSectionNameW = pSetupMultiByteToUnicode(InfSectionName, CP_ACP); if (InfSectionNameW == NULL) return INVALID_HANDLE_VALUE; } } @@ -1635,12 +1635,12 @@ BOOL WINAPI SetupDiCreateDeviceInfoA( if (DeviceName) { - DeviceNameW = MultiByteToUnicode(DeviceName, CP_ACP); + DeviceNameW = pSetupMultiByteToUnicode(DeviceName, CP_ACP); if (DeviceNameW == NULL) return FALSE; } if (DeviceDescription) { - DeviceDescriptionW = MultiByteToUnicode(DeviceDescription, CP_ACP); + DeviceDescriptionW = pSetupMultiByteToUnicode(DeviceDescription, CP_ACP); if (DeviceDescriptionW == NULL) { MyFree(DeviceNameW); @@ -2038,7 +2038,7 @@ SetupDiGetActualSectionToInstallExA( if (InfSectionName) { - InfSectionNameW = MultiByteToUnicode(InfSectionName, CP_ACP); + InfSectionNameW = pSetupMultiByteToUnicode(InfSectionName, CP_ACP); if (InfSectionNameW == NULL) goto cleanup; } @@ -2135,7 +2135,7 @@ BOOL WINAPI SetupDiGetClassDescriptionExA( if (MachineName) { - MachineNameW = MultiByteToUnicode(MachineName, CP_ACP); + MachineNameW = pSetupMultiByteToUnicode(MachineName, CP_ACP); if (!MachineNameW) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); @@ -2285,7 +2285,7 @@ HDEVINFO WINAPI SetupDiGetClassDevsExA( if (enumstr) { - enumstrW = MultiByteToUnicode(enumstr, CP_ACP); + enumstrW = pSetupMultiByteToUnicode(enumstr, CP_ACP); if (!enumstrW) { ret = INVALID_HANDLE_VALUE; @@ -2294,7 +2294,7 @@ HDEVINFO WINAPI SetupDiGetClassDevsExA( } if (machine) { - machineW = MultiByteToUnicode(machine, CP_ACP); + machineW = pSetupMultiByteToUnicode(machine, CP_ACP); if (!machineW) { MyFree(enumstrW); @@ -2540,7 +2540,7 @@ BOOL WINAPI SetupDiCreateDeviceInterfaceA( if (ReferenceString) { - ReferenceStringW = MultiByteToUnicode(ReferenceString, CP_ACP); + ReferenceStringW = pSetupMultiByteToUnicode(ReferenceString, CP_ACP); if (ReferenceStringW == NULL) return FALSE; } @@ -2621,7 +2621,7 @@ HKEY WINAPI SetupDiCreateDeviceInterfaceRegKeyA( SetLastError(ERROR_INVALID_PARAMETER); return INVALID_HANDLE_VALUE; } - InfSectionNameW = MultiByteToUnicode(InfSectionName, CP_ACP); + InfSectionNameW = pSetupMultiByteToUnicode(InfSectionName, CP_ACP); if (!InfSectionNameW) return INVALID_HANDLE_VALUE; } @@ -3462,7 +3462,7 @@ SetupDiInstallClassExA( } else { - InfFileNameW = MultiByteToUnicode(InfFileName, CP_ACP); + InfFileNameW = pSetupMultiByteToUnicode(InfFileName, CP_ACP); if (InfFileNameW == NULL) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); @@ -3592,7 +3592,7 @@ HKEY WINAPI SetupDiOpenClassRegKeyExA( if (MachineName) { - MachineNameW = MultiByteToUnicode(MachineName, CP_ACP); + MachineNameW = pSetupMultiByteToUnicode(MachineName, CP_ACP); if (MachineNameW == NULL) return INVALID_HANDLE_VALUE; } @@ -3934,7 +3934,7 @@ BOOL WINAPI SetupDiOpenDeviceInterfaceA( TRACE("%p %s %08lx %p\n", DeviceInfoSet, debugstr_a(DevicePath), OpenFlags, DeviceInterfaceData); - DevicePathW = MultiByteToUnicode(DevicePath, CP_ACP); + DevicePathW = pSetupMultiByteToUnicode(DevicePath, CP_ACP); if (DevicePathW == NULL) return FALSE; @@ -4667,7 +4667,7 @@ SetupDiOpenDeviceInfoA( TRACE("%p %s %p %lx %p\n", DeviceInfoSet, DeviceInstanceId, hwndParent, OpenFlags, DeviceInfoData); - DeviceInstanceIdW = MultiByteToUnicode(DeviceInstanceId, CP_ACP); + DeviceInstanceIdW = pSetupMultiByteToUnicode(DeviceInstanceId, CP_ACP); if (DeviceInstanceIdW == NULL) return FALSE; diff --git a/dll/win32/setupapi/install.c b/dll/win32/setupapi/install.c index 0d1fd062321..5a6ad6c0e0c 100644 --- a/dll/win32/setupapi/install.c +++ b/dll/win32/setupapi/install.c @@ -998,7 +998,7 @@ profile_items_callback( } else { - FullIconName = DuplicateString(FullFileName); + FullIconName = pSetupDuplicateString(FullFileName); if (!FullIconName) goto cleanup; } @@ -2177,9 +2177,9 @@ BOOL WINAPI SetupCopyOEMInfA( if (!DestinationInfFileName && DestinationInfFileNameSize > 0) SetLastError(ERROR_INVALID_PARAMETER); - else if (!(SourceInfFileNameW = MultiByteToUnicode(SourceInfFileName, CP_ACP))) + else if (!(SourceInfFileNameW = pSetupMultiByteToUnicode(SourceInfFileName, CP_ACP))) SetLastError(ERROR_INVALID_PARAMETER); - else if (OEMSourceMediaType != SPOST_NONE && !(OEMSourceMediaLocationW = MultiByteToUnicode(OEMSourceMediaLocation, CP_ACP))) + else if (OEMSourceMediaType != SPOST_NONE && !(OEMSourceMediaLocationW = pSetupMultiByteToUnicode(OEMSourceMediaLocation, CP_ACP))) SetLastError(ERROR_INVALID_PARAMETER); else { diff --git a/dll/win32/setupapi/misc.c b/dll/win32/setupapi/misc.c index 7f764723f2f..fa35e3640fa 100644 --- a/dll/win32/setupapi/misc.c +++ b/dll/win32/setupapi/misc.c @@ -63,7 +63,7 @@ GetFunctionPointer( Comma++; /* W->A conversion for function name */ - FunctionNameA = UnicodeToMultiByte(Comma, CP_ACP); + FunctionNameA = pSetupUnicodeToMultiByte(Comma, CP_ACP); if (!FunctionNameA) { rc = GetLastError(); @@ -168,7 +168,7 @@ LPVOID WINAPI MyRealloc(LPVOID lpSrc, DWORD dwSize) /************************************************************************** - * DuplicateString [SETUPAPI.@] + * pSetupDuplicateString [SETUPAPI.@] * * Duplicates a unicode string. * @@ -182,7 +182,7 @@ LPVOID WINAPI MyRealloc(LPVOID lpSrc, DWORD dwSize) * NOTES * Call MyFree() to release the duplicated string. */ -LPWSTR WINAPI DuplicateString(LPCWSTR lpSrc) +LPWSTR WINAPI pSetupDuplicateString(LPCWSTR lpSrc) { LPWSTR lpDst; @@ -250,7 +250,7 @@ LONG WINAPI QueryRegistryValue(HKEY hKey, /************************************************************************** - * MultiByteToUnicode [SETUPAPI.@] + * pSetupMultiByteToUnicode [SETUPAPI.@] * * Converts a multi-byte string to a Unicode string. * @@ -265,7 +265,7 @@ LONG WINAPI QueryRegistryValue(HKEY hKey, * NOTE * Use MyFree to release the returned Unicode string. */ -LPWSTR WINAPI MultiByteToUnicode(LPCSTR lpMultiByteStr, UINT uCodePage) +LPWSTR WINAPI pSetupMultiByteToUnicode(LPCSTR lpMultiByteStr, UINT uCodePage) { LPWSTR lpUnicodeStr; int nLength; @@ -296,7 +296,7 @@ LPWSTR WINAPI MultiByteToUnicode(LPCSTR lpMultiByteStr, UINT uCodePage) /************************************************************************** - * UnicodeToMultiByte [SETUPAPI.@] + * pSetupUnicodeToMultiByte [SETUPAPI.@] * * Converts a Unicode string to a multi-byte string. * @@ -311,7 +311,7 @@ LPWSTR WINAPI MultiByteToUnicode(LPCSTR lpMultiByteStr, UINT uCodePage) * NOTE * Use MyFree to release the returned multi-byte string. */ -LPSTR WINAPI UnicodeToMultiByte(LPCWSTR lpUnicodeStr, UINT uCodePage) +LPSTR WINAPI pSetupUnicodeToMultiByte(LPCWSTR lpUnicodeStr, UINT uCodePage) { LPSTR lpMultiByteStr; int nLength; @@ -411,7 +411,7 @@ BOOL WINAPI DoesUserHavePrivilege(LPCWSTR lpPrivilegeName) /************************************************************************** - * EnablePrivilege [SETUPAPI.@] + * pSetupEnablePrivilege [SETUPAPI.@] * * Enables or disables one of the current users privileges. * @@ -424,7 +424,7 @@ BOOL WINAPI DoesUserHavePrivilege(LPCWSTR lpPrivilegeName) * Success: TRUE * Failure: FALSE */ -BOOL WINAPI EnablePrivilege(LPCWSTR lpPrivilegeName, BOOL bEnable) +BOOL WINAPI pSetupEnablePrivilege(LPCWSTR lpPrivilegeName, BOOL bEnable) { TOKEN_PRIVILEGES Privileges; HANDLE hToken; @@ -536,14 +536,14 @@ DWORD WINAPI CaptureStringArg(LPCWSTR pSrc, LPWSTR *pDst) if (pDst == NULL) return ERROR_INVALID_PARAMETER; - *pDst = DuplicateString(pSrc); + *pDst = pSetupDuplicateString(pSrc); return ERROR_SUCCESS; } /************************************************************************** - * CaptureAndConvertAnsiArg [SETUPAPI.@] + * pSetupCaptureAndConvertAnsiArg [SETUPAPI.@] * * Captures an ANSI string and converts it to a UNICODE string. * @@ -558,19 +558,19 @@ DWORD WINAPI CaptureStringArg(LPCWSTR pSrc, LPWSTR *pDst) * NOTE * Call MyFree to release the captured UNICODE string. */ -DWORD WINAPI CaptureAndConvertAnsiArg(LPCSTR pSrc, LPWSTR *pDst) +DWORD WINAPI pSetupCaptureAndConvertAnsiArg(LPCSTR pSrc, LPWSTR *pDst) { if (pDst == NULL) return ERROR_INVALID_PARAMETER; - *pDst = MultiByteToUnicode(pSrc, CP_ACP); + *pDst = pSetupMultiByteToUnicode(pSrc, CP_ACP); return ERROR_SUCCESS; } /************************************************************************** - * OpenAndMapFileForRead [SETUPAPI.@] + * pSetupOpenAndMapFileForRead [SETUPAPI.@] * * Open and map a file to a buffer. * @@ -588,11 +588,11 @@ DWORD WINAPI CaptureAndConvertAnsiArg(LPCSTR pSrc, LPWSTR *pDst) * NOTE * Call UnmapAndCloseFile to release the file. */ -DWORD WINAPI OpenAndMapFileForRead(LPCWSTR lpFileName, - LPDWORD lpSize, - LPHANDLE lpFile, - LPHANDLE lpMapping, - LPVOID *lpBuffer) +DWORD WINAPI pSetupOpenAndMapFileForRead(LPCWSTR lpFileName, + LPDWORD lpSize, + LPHANDLE lpFile, + LPHANDLE lpMapping, + LPVOID *lpBuffer) { DWORD dwError; @@ -635,7 +635,7 @@ DWORD WINAPI OpenAndMapFileForRead(LPCWSTR lpFileName, /************************************************************************** - * UnmapAndCloseFile [SETUPAPI.@] + * pSetupUnmapAndCloseFile [SETUPAPI.@] * * Unmap and close a mapped file. * @@ -648,7 +648,7 @@ DWORD WINAPI OpenAndMapFileForRead(LPCWSTR lpFileName, * Success: TRUE * Failure: FALSE */ -BOOL WINAPI UnmapAndCloseFile(HANDLE hFile, HANDLE hMapping, LPVOID lpBuffer) +BOOL WINAPI pSetupUnmapAndCloseFile(HANDLE hFile, HANDLE hMapping, LPVOID lpBuffer) { TRACE("%p %p %p\n", hFile, hMapping, lpBuffer); @@ -938,7 +938,7 @@ DWORD WINAPI GetSetFileTimestamp(LPCWSTR lpFileName, /************************************************************************** - * MyGetFileTitle [SETUPAPI.@] + * pSetupGetFileTitle [SETUPAPI.@] * * Returns a pointer to the last part of a fully qualified file name. * @@ -949,7 +949,7 @@ DWORD WINAPI GetSetFileTimestamp(LPCWSTR lpFileName, * Pointer to a files name. */ LPWSTR WINAPI -MyGetFileTitle(LPCWSTR lpFileName) +pSetupGetFileTitle(LPCWSTR lpFileName) { LPWSTR ptr; LPWSTR ret; @@ -976,7 +976,7 @@ MyGetFileTitle(LPCWSTR lpFileName) /************************************************************************** - * ConcatenatePaths [SETUPAPI.@] + * pSetupConcatenatePaths [SETUPAPI.@] * * Concatenates two paths. * @@ -991,10 +991,10 @@ MyGetFileTitle(LPCWSTR lpFileName) * Failure: FALSE */ BOOL WINAPI -ConcatenatePaths(LPWSTR lpPath, - LPCWSTR lpAppend, - DWORD dwBufferSize, - LPDWORD lpRequiredSize) +pSetupConcatenatePaths(LPWSTR lpPath, + LPCWSTR lpAppend, + DWORD dwBufferSize, + LPDWORD lpRequiredSize) { DWORD dwPathSize; DWORD dwAppendSize; @@ -1048,7 +1048,7 @@ ConcatenatePaths(LPWSTR lpPath, /************************************************************************** - * CenterWindowRelativeToParent [SETUPAPI.@] + * pSetupCenterWindowRelativeToParent [SETUPAPI.@] * * Centers a window relative to its parent. * @@ -1059,7 +1059,7 @@ ConcatenatePaths(LPWSTR lpPath, * None */ VOID WINAPI -CenterWindowRelativeToParent(HWND hwnd) +pSetupCenterWindowRelativeToParent(HWND hwnd) { HWND hwndOwner; POINT ptOrigin; @@ -1094,7 +1094,7 @@ CenterWindowRelativeToParent(HWND hwnd) /************************************************************************** - * GetVersionInfoFromImage [SETUPAPI.@] + * pSetupGetVersionInfoFromImage [SETUPAPI.@] * * Retrieves version information for a given file. * @@ -1109,9 +1109,9 @@ CenterWindowRelativeToParent(HWND hwnd) * Failure: FALSE */ BOOL WINAPI -GetVersionInfoFromImage(LPWSTR lpFileName, - PULARGE_INTEGER lpFileVersion, - LPWORD lpVersionVarSize) +pSetupGetVersionInfoFromImage(LPWSTR lpFileName, + PULARGE_INTEGER lpFileVersion, + LPWORD lpVersionVarSize) { DWORD dwHandle; DWORD dwSize; @@ -1345,7 +1345,7 @@ BOOL WINAPI SetupGetFileCompressionInfoExA( PCSTR source, PSTR name, DWORD len, TRACE("%s, %p, %d, %p, %p, %p, %p\n", debugstr_a(source), name, len, required, source_size, target_size, type); - if (!source || !(sourceW = MultiByteToUnicode( source, CP_ACP ))) return FALSE; + if (!source || !(sourceW = pSetupMultiByteToUnicode( source, CP_ACP ))) return FALSE; if (name) { @@ -1359,7 +1359,7 @@ BOOL WINAPI SetupGetFileCompressionInfoExA( PCSTR source, PSTR name, DWORD len, ret = SetupGetFileCompressionInfoExW( sourceW, nameW, nb_chars, &nb_chars, source_size, target_size, type ); if (ret) { - if ((nameA = UnicodeToMultiByte( nameW, CP_ACP ))) + if ((nameA = pSetupUnicodeToMultiByte( nameW, CP_ACP ))) { if (name && len >= nb_chars) lstrcpyA( name, nameA ); else @@ -1580,8 +1580,8 @@ DWORD WINAPI SetupDecompressOrCopyFileA( PCSTR source, PCSTR target, PUINT type DWORD ret = FALSE; WCHAR *sourceW = NULL, *targetW = NULL; - if (source && !(sourceW = MultiByteToUnicode( source, CP_ACP ))) return FALSE; - if (target && !(targetW = MultiByteToUnicode( target, CP_ACP ))) + if (source && !(sourceW = pSetupMultiByteToUnicode( source, CP_ACP ))) return FALSE; + if (target && !(targetW = pSetupMultiByteToUnicode( target, CP_ACP ))) { MyFree( sourceW ); return ERROR_NOT_ENOUGH_MEMORY; @@ -1736,7 +1736,7 @@ pSetupIsGuidNull(LPGUID lpGUID) */ BOOL WINAPI -IsUserAdmin(VOID) +pSetupIsUserAdmin(VOID) { SID_IDENTIFIER_AUTHORITY Authority = {SECURITY_NT_AUTHORITY}; BOOL bResult = FALSE; @@ -1773,7 +1773,7 @@ HSPFILELOG WINAPI SetupInitializeFileLogW(LPCWSTR LogFileName, DWORD Flags) if (Flags & SPFILELOG_SYSTEMLOG) { - if (!IsUserAdmin() && !(Flags & SPFILELOG_QUERYONLY)) + if (!pSetupIsUserAdmin() && !(Flags & SPFILELOG_QUERYONLY)) { /* insufficient privileges */ SetLastError(ERROR_ACCESS_DENIED); diff --git a/dll/win32/setupapi/parser.c b/dll/win32/setupapi/parser.c index e1b693ddaec..0271d179da9 100644 --- a/dll/win32/setupapi/parser.c +++ b/dll/win32/setupapi/parser.c @@ -2243,7 +2243,7 @@ SetupGetInfFileListA( if (DirectoryPath != NULL) { - DirectoryPathW = MultiByteToUnicode(DirectoryPath, CP_ACP); + DirectoryPathW = pSetupMultiByteToUnicode(DirectoryPath, CP_ACP); if (DirectoryPathW == NULL) goto Cleanup; } @@ -2318,7 +2318,7 @@ BOOL WINAPI SetupDiGetINFClassA( if (InfName != NULL) { - InfNameW = MultiByteToUnicode(InfName, CP_ACP); + InfNameW = pSetupMultiByteToUnicode(InfName, CP_ACP); if (InfNameW == NULL) goto Cleanup; } diff --git a/dll/win32/setupapi/rpc.c b/dll/win32/setupapi/rpc.c index b4bce194f10..72ce54a0a1d 100644 --- a/dll/win32/setupapi/rpc.c +++ b/dll/win32/setupapi/rpc.c @@ -79,17 +79,17 @@ PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, return TRUE; } - LocalStringTable = StringTableInitialize(); + LocalStringTable = pSetupStringTableInitialize(); if (LocalStringTable == NULL) return FALSE; if (PnpBindRpc(NULL, &LocalBindingHandle) != RPC_S_OK) { - StringTableDestroy(LocalStringTable); + pSetupStringTableDestroy(LocalStringTable); return FALSE; } - StringTableAddString(LocalStringTable, L"PLT", 1); + pSetupStringTableAddString(LocalStringTable, L"PLT", 1); if (BindingHandle != NULL) *BindingHandle = LocalBindingHandle; @@ -104,7 +104,7 @@ PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, RPC_STATUS PnpUnbindLocalBindingHandle(VOID) { - StringTableDestroy(LocalStringTable); + pSetupStringTableDestroy(LocalStringTable); LocalStringTable = NULL; return PnpUnbindRpc(&LocalBindingHandle); } diff --git a/dll/win32/setupapi/setupapi.spec b/dll/win32/setupapi/setupapi.spec index fb6d16ad18a..0a64df095b8 100644 --- a/dll/win32/setupapi/setupapi.spec +++ b/dll/win32/setupapi/setupapi.spec @@ -14,8 +14,8 @@ @ stdcall CM_Add_ID_ExA(ptr str long ptr) @ stdcall CM_Add_ID_ExW(ptr wstr long ptr) @ stub CM_Add_Range -@ stub CM_Add_Res_Des -@ stub CM_Add_Res_Des_Ex +@ stdcall CM_Add_Res_Des(ptr ptr long ptr long long) +@ stdcall CM_Add_Res_Des_Ex(ptr ptr long ptr long long long) @ stdcall CM_Connect_MachineA(str ptr) @ stdcall CM_Connect_MachineW(wstr ptr) @ stdcall CM_Create_DevNodeA(ptr str long long) @@ -48,9 +48,9 @@ @ stdcall CM_Free_Log_Conf_Ex(ptr long ptr) @ stdcall CM_Free_Log_Conf_Handle(ptr) @ stub CM_Free_Range_List -@ stub CM_Free_Res_Des -@ stub CM_Free_Res_Des_Ex -@ stub CM_Free_Res_Des_Handle +@ stdcall CM_Free_Res_Des(ptr ptr long) +@ stdcall CM_Free_Res_Des_Ex(ptr ptr long long) +@ stdcall CM_Free_Res_Des_Handle(ptr) @ stub CM_Free_Resource_Conflict_Handle @ stdcall CM_Get_Child(ptr long long) @ stdcall CM_Get_Child_Ex(ptr long long long) @@ -90,16 +90,16 @@ @ stdcall CM_Get_Device_ID_List_Size_ExW(ptr wstr long long) @ stdcall CM_Get_Device_ID_Size(ptr long long) @ stdcall CM_Get_Device_ID_Size_Ex(ptr long long long) -@ stub CM_Get_Device_Interface_AliasA -@ stub CM_Get_Device_Interface_AliasW -@ stub CM_Get_Device_Interface_Alias_ExA -@ stub CM_Get_Device_Interface_Alias_ExW -@ stub CM_Get_Device_Interface_ListA -@ stub CM_Get_Device_Interface_ListW -@ stub CM_Get_Device_Interface_List_ExA -@ stub CM_Get_Device_Interface_List_ExW -@ stub CM_Get_Device_Interface_List_SizeA -@ stub CM_Get_Device_Interface_List_SizeW +@ stdcall CM_Get_Device_Interface_AliasA(str ptr str ptr long) +@ stdcall CM_Get_Device_Interface_AliasW(wstr ptr wstr ptr long) +@ stdcall CM_Get_Device_Interface_Alias_ExA(str ptr str ptr long long) +@ stdcall CM_Get_Device_Interface_Alias_ExW(wstr ptr wstr ptr long long) +@ stdcall CM_Get_Device_Interface_ListA(ptr str str long long) +@ stdcall CM_Get_Device_Interface_ListW(ptr wstr wstr long long) +@ stdcall CM_Get_Device_Interface_List_ExA(ptr str str long long ptr) +@ stdcall CM_Get_Device_Interface_List_ExW(ptr wstr wstr long long ptr) +@ stdcall CM_Get_Device_Interface_List_SizeA(ptr ptr str long) +@ stdcall CM_Get_Device_Interface_List_SizeW(ptr ptr wstr long) @ stdcall CM_Get_Device_Interface_List_Size_ExA(ptr ptr str long ptr) @ stdcall CM_Get_Device_Interface_List_Size_ExW(ptr ptr wstr long ptr) @ stdcall CM_Get_First_Log_Conf(ptr long long) @@ -110,22 +110,22 @@ @ stdcall CM_Get_HW_Prof_FlagsW(wstr long ptr long) @ stdcall CM_Get_HW_Prof_Flags_ExA(str long ptr long long) @ stdcall CM_Get_HW_Prof_Flags_ExW(wstr long ptr long long) -@ stub CM_Get_Hardware_Profile_InfoA -@ stub CM_Get_Hardware_Profile_InfoW -@ stub CM_Get_Hardware_Profile_Info_ExA -@ stub CM_Get_Hardware_Profile_Info_ExW +@ stdcall CM_Get_Hardware_Profile_InfoA(long ptr long) +@ stdcall CM_Get_Hardware_Profile_InfoW(long ptr long) +@ stdcall CM_Get_Hardware_Profile_Info_ExA(long ptr long long) +@ stdcall CM_Get_Hardware_Profile_Info_ExW(long ptr long long) @ stdcall CM_Get_Log_Conf_Priority(ptr ptr long) @ stdcall CM_Get_Log_Conf_Priority_Ex(ptr ptr long long) @ stdcall CM_Get_Next_Log_Conf(ptr ptr long) @ stdcall CM_Get_Next_Log_Conf_Ex(ptr ptr long long) -@ stub CM_Get_Next_Res_Des -@ stub CM_Get_Next_Res_Des_Ex +@ stdcall CM_Get_Next_Res_Des(ptr ptr long ptr long) +@ stdcall CM_Get_Next_Res_Des_Ex(ptr ptr long ptr long long) @ stdcall CM_Get_Parent(ptr long long) @ stdcall CM_Get_Parent_Ex(ptr long long long) -@ stub CM_Get_Res_Des_Data -@ stub CM_Get_Res_Des_Data_Ex -@ stub CM_Get_Res_Des_Data_Size -@ stub CM_Get_Res_Des_Data_Size_Ex +@ stdcall CM_Get_Res_Des_Data(ptr ptr long long) +@ stdcall CM_Get_Res_Des_Data_Ex(ptr ptr long long long) +@ stdcall CM_Get_Res_Des_Data_Size(ptr ptr long) +@ stdcall CM_Get_Res_Des_Data_Size_Ex(ptr ptr long long) @ stub CM_Get_Resource_Conflict_Count @ stub CM_Get_Resource_Conflict_DetailsA @ stub CM_Get_Resource_Conflict_DetailsW @@ -144,8 +144,8 @@ @ stdcall CM_Locate_DevNode_ExA(ptr str long long) @ stdcall CM_Locate_DevNode_ExW(ptr wstr long long) @ stub CM_Merge_Range_List -@ stub CM_Modify_Res_Des -@ stub CM_Modify_Res_Des_Ex +@ stdcall CM_Modify_Res_Des(ptr ptr long ptr long long) +@ stdcall CM_Modify_Res_Des_Ex(ptr ptr long ptr long long long) @ stdcall CM_Move_DevNode(long long long) @ stdcall CM_Move_DevNode_Ex(long long long long) @ stub CM_Next_Range @@ -155,31 +155,31 @@ @ stdcall CM_Open_Class_Key_ExW(ptr wstr long long ptr long long) @ stdcall CM_Open_DevNode_Key(ptr long long long ptr long) @ stdcall CM_Open_DevNode_Key_Ex(ptr long long long ptr long long) -@ stub CM_Query_And_Remove_SubTreeA -@ stub CM_Query_And_Remove_SubTreeW -@ stub CM_Query_And_Remove_SubTree_ExA -@ stub CM_Query_And_Remove_SubTree_ExW -@ stub CM_Query_Arbitrator_Free_Data -@ stub CM_Query_Arbitrator_Free_Data_Ex -@ stub CM_Query_Arbitrator_Free_Size -@ stub CM_Query_Arbitrator_Free_Size_Ex -@ stub CM_Query_Remove_SubTree -@ stub CM_Query_Remove_SubTree_Ex +@ stdcall CM_Query_And_Remove_SubTreeA(long ptr str long long) +@ stdcall CM_Query_And_Remove_SubTreeW(long ptr wstr long long) +@ stdcall CM_Query_And_Remove_SubTree_ExA(long ptr str long long long) +@ stdcall CM_Query_And_Remove_SubTree_ExW(long ptr wstr long long long) +@ stdcall CM_Query_Arbitrator_Free_Data(ptr long long long long) +@ stdcall CM_Query_Arbitrator_Free_Data_Ex(ptr long long long long ptr) +@ stdcall CM_Query_Arbitrator_Free_Size(ptr long long long) +@ stdcall CM_Query_Arbitrator_Free_Size_Ex(ptr long long long ptr) +@ stdcall CM_Query_Remove_SubTree(long long) +@ stdcall CM_Query_Remove_SubTree_Ex(long long long) @ stub CM_Query_Resource_Conflict_List @ stdcall CM_Reenumerate_DevNode(long long) @ stdcall CM_Reenumerate_DevNode_Ex(long long long) -@ stub CM_Register_Device_Driver -@ stub CM_Register_Device_Driver_Ex -@ stub CM_Register_Device_InterfaceA -@ stub CM_Register_Device_InterfaceW -@ stub CM_Register_Device_Interface_ExA -@ stub CM_Register_Device_Interface_ExW -@ stub CM_Remove_SubTree -@ stub CM_Remove_SubTree_Ex -@ stub CM_Request_Device_EjectA -@ stub CM_Request_Device_EjectW -@ stub CM_Request_Device_Eject_ExA -@ stub CM_Request_Device_Eject_ExW +@ stdcall CM_Register_Device_Driver(long long) +@ stdcall CM_Register_Device_Driver_Ex(long long ptr) +@ stdcall CM_Register_Device_InterfaceA(long ptr str str ptr long) +@ stdcall CM_Register_Device_InterfaceW(long ptr wstr wstr ptr long) +@ stdcall CM_Register_Device_Interface_ExA(long ptr str str ptr long long) +@ stdcall CM_Register_Device_Interface_ExW(long ptr wstr wstr ptr long long) +@ stdcall CM_Remove_SubTree(long long) +@ stdcall CM_Remove_SubTree_Ex(long long long) +@ stdcall CM_Request_Device_EjectA(long ptr str long long) +@ stdcall CM_Request_Device_EjectW(long ptr wstr long long) +@ stdcall CM_Request_Device_Eject_ExA(long ptr str long long long) +@ stdcall CM_Request_Device_Eject_ExW(long ptr wstr long long long) @ stdcall CM_Request_Eject_PC() @ stdcall CM_Request_Eject_PC_Ex(long) @ stdcall CM_Run_Detection(long) @@ -203,17 +203,17 @@ @ stub CM_Test_Range_Available @ stdcall CM_Uninstall_DevNode(long long) @ stdcall CM_Uninstall_DevNode_Ex(long long long) -@ stub CM_Unregister_Device_InterfaceA -@ stub CM_Unregister_Device_InterfaceW -@ stub CM_Unregister_Device_Interface_ExA -@ stub CM_Unregister_Device_Interface_ExW +@ stdcall CM_Unregister_Device_InterfaceA(str long) +@ stdcall CM_Unregister_Device_InterfaceW(wstr long) +@ stdcall CM_Unregister_Device_Interface_ExA(str long long) +@ stdcall CM_Unregister_Device_Interface_ExW(wstr long long) @ stdcall DoesUserHavePrivilege(wstr) @ stub ExtensionPropSheetPageProc @ stdcall InstallCatalog(str str ptr) @ stdcall InstallHinfSection(long long str long) InstallHinfSectionA @ stdcall InstallHinfSectionA(long long str long) @ stdcall InstallHinfSectionW(long long wstr long) -@ stdcall IsUserAdmin() +@ stdcall IsUserAdmin() pSetupIsUserAdmin @ stdcall MyFree(ptr) @ stdcall MyMalloc(long) @ stdcall MyRealloc(ptr long) @@ -532,32 +532,32 @@ @ stdcall SetupUninstallOEMInfW(wstr long ptr) @ stub SetupVerifyInfFileA @ stub SetupVerifyInfFileW -@ stdcall UnicodeToMultiByte(wstr long) +@ stdcall UnicodeToMultiByte(wstr long) pSetupUnicodeToMultiByte @ stub VerifyCatalogFile @ stub pSetupAccessRunOnceNodeList @ stub pSetupAcquireSCMLock @ stub pSetupAddMiniIconToList @ stub pSetupAddTagToGroupOrderListEntry @ stub pSetupAppendStringToMultiSz -@ stdcall pSetupCaptureAndConvertAnsiArg(str ptr) CaptureAndConvertAnsiArg -@ stdcall pSetupCenterWindowRelativeToParent(long) CenterWindowRelativeToParent -@ stdcall pSetupConcatenatePaths(wstr wstr long ptr) ConcatenatePaths +@ stdcall pSetupCaptureAndConvertAnsiArg(str ptr) +@ stdcall pSetupCenterWindowRelativeToParent(long) +@ stdcall pSetupConcatenatePaths(wstr wstr long ptr) @ stub pSetupDestroyRunOnceNodeList @ stub pSetupDiGetDeviceInfoContext @ stub pSetupDiSetDeviceInfoContext @ stub pSetupDoesUserHavePrivilege -@ stdcall pSetupDuplicateString(wstr) DuplicateString -@ stdcall pSetupEnablePrivilege(wstr long) EnablePrivilege +@ stdcall pSetupDuplicateString(wstr) +@ stdcall pSetupEnablePrivilege(wstr long) @ stub pSetupFree @ stub pSetupFreeStringArray @ stub pSetupGetCurrentDriverSigningPolicy @ stdcall pSetupGetField(ptr long) -@ stdcall pSetupGetFileTitle(wstr) MyGetFileTitle +@ stdcall pSetupGetFileTitle(wstr) @ stdcall pSetupGetGlobalFlags() @ stub pSetupGetInfSections @ stdcall pSetupGetQueueFlags(ptr) @ stub pSetupGetRealSystemTime -@ stdcall pSetupGetVersionInfoFromImage(wstr ptr ptr) GetVersionInfoFromImage +@ stdcall pSetupGetVersionInfoFromImage(wstr ptr ptr) @ stdcall pSetupGuidFromString(wstr ptr) @ stub pSetupHandleFailedVerification @ stub pSetupInfCacheBuild @@ -566,16 +566,16 @@ @ stub pSetupInstallStopEx @ stdcall pSetupIsGuidNull(ptr) @ stub pSetupIsLocalSystem -@ stdcall pSetupIsUserAdmin() IsUserAdmin +@ stdcall pSetupIsUserAdmin() @ stub pSetupMakeSurePathExists @ stub pSetupMalloc @ stub pSetupModifyGlobalFlags -@ stdcall pSetupMultiByteToUnicode(str long) MultiByteToUnicode -@ stdcall pSetupOpenAndMapFileForRead(wstr ptr ptr ptr ptr) OpenAndMapFileForRead +@ stdcall pSetupMultiByteToUnicode(str long) +@ stdcall pSetupOpenAndMapFileForRead(wstr ptr ptr ptr ptr) @ stub pSetupOutOfMemory @ stub pSetupQueryMultiSzValueToArray @ stub pSetupRealloc -@ stdcall pSetupRegistryDelnode(long long) RegistryDelnode +@ stdcall pSetupRegistryDelnode(long long) @ stub pSetupRetrieveServiceConfig @ stub pSetupSetArrayToMultiSzValue @ stdcall pSetupSetGlobalFlags(long) @@ -584,21 +584,21 @@ @ stub pSetupSetSystemSourcePath @ stub pSetupShouldDeviceBeExcluded @ stdcall pSetupStringFromGuid(ptr wstr long) -@ stdcall pSetupStringTableAddString(ptr wstr long) StringTableAddString -@ stdcall pSetupStringTableAddStringEx(ptr wstr long ptr long) StringTableAddStringEx -@ stdcall pSetupStringTableDestroy(ptr) StringTableDestroy -@ stdcall pSetupStringTableDuplicate(ptr) StringTableDuplicate +@ stdcall pSetupStringTableAddString(ptr wstr long) +@ stdcall pSetupStringTableAddStringEx(ptr wstr long ptr long) +@ stdcall pSetupStringTableDestroy(ptr) +@ stdcall pSetupStringTableDuplicate(ptr) @ stub pSetupStringTableEnum -@ stdcall pSetupStringTableGetExtraData(ptr long ptr long) StringTableGetExtraData -@ stdcall pSetupStringTableInitialize() StringTableInitialize -@ stdcall pSetupStringTableInitializeEx(long long) StringTableInitializeEx -@ stdcall pSetupStringTableLookUpString(ptr wstr long) StringTableLookUpString -@ stdcall pSetupStringTableLookUpStringEx(ptr wstr long ptr ptr) StringTableLookUpStringEx -@ stdcall pSetupStringTableSetExtraData(ptr long ptr long) StringTableSetExtraData -@ stdcall pSetupStringTableStringFromId(ptr long) StringTableStringFromId -@ stdcall pSetupStringTableStringFromIdEx(ptr long ptr ptr) StringTableStringFromIdEx -@ stdcall pSetupUnicodeToMultiByte(wstr long) UnicodeToMultiByte -@ stdcall pSetupUnmapAndCloseFile(long long ptr) UnmapAndCloseFile +@ stdcall pSetupStringTableGetExtraData(ptr long ptr long) +@ stdcall pSetupStringTableInitialize() +@ stdcall pSetupStringTableInitializeEx(long long) +@ stdcall pSetupStringTableLookUpString(ptr wstr long) +@ stdcall pSetupStringTableLookUpStringEx(ptr wstr long ptr ptr) +@ stdcall pSetupStringTableSetExtraData(ptr long ptr long) +@ stdcall pSetupStringTableStringFromId(ptr long) +@ stdcall pSetupStringTableStringFromIdEx(ptr long ptr ptr) +@ stdcall pSetupUnicodeToMultiByte(wstr long) +@ stdcall pSetupUnmapAndCloseFile(long long ptr) @ stub pSetupVerifyCatalogFile @ stub pSetupVerifyFile @ stub pSetupVerifyQueuedCatalogs @@ -627,7 +627,6 @@ @ stdcall RetreiveFileSecurity(wstr ptr) @ stub SearchForInfFile @ stdcall StampFileSecurity(wstr ptr) -@ stdcall StringTableTrim(ptr) @ stdcall TakeOwnershipOfFile(wstr) @ stub pSetupDirectoryIdToPath @ stub pSetupGetOsLoaderDriveAndPath diff --git a/dll/win32/setupapi/stringtable.c b/dll/win32/setupapi/stringtable.c index 9eba15fb977..522df7c2556 100644 --- a/dll/win32/setupapi/stringtable.c +++ b/dll/win32/setupapi/stringtable.c @@ -41,7 +41,7 @@ typedef struct _STRING_TABLE /************************************************************************** - * StringTableInitialize [SETUPAPI.@] + * pSetupStringTableInitialize [SETUPAPI.@] * * Creates a new string table and initializes it. * @@ -53,7 +53,7 @@ typedef struct _STRING_TABLE * Failure: NULL */ HSTRING_TABLE WINAPI -StringTableInitialize(VOID) +pSetupStringTableInitialize(VOID) { PSTRING_TABLE pStringTable; @@ -88,7 +88,7 @@ StringTableInitialize(VOID) /************************************************************************** - * StringTableInitializeEx [SETUPAPI.@] + * pSetupStringTableInitializeEx [SETUPAPI.@] * * Creates a new string table and initializes it. * @@ -101,8 +101,8 @@ StringTableInitialize(VOID) * Failure: NULL */ HSTRING_TABLE WINAPI -StringTableInitializeEx(DWORD dwMaxExtraDataSize, - DWORD dwReserved) +pSetupStringTableInitializeEx(DWORD dwMaxExtraDataSize, + DWORD dwReserved) { PSTRING_TABLE pStringTable; @@ -133,7 +133,7 @@ StringTableInitializeEx(DWORD dwMaxExtraDataSize, /************************************************************************** - * StringTableDestroy [SETUPAPI.@] + * pSetupStringTableDestroy [SETUPAPI.@] * * Destroys a string table. * @@ -144,7 +144,7 @@ StringTableInitializeEx(DWORD dwMaxExtraDataSize, * None */ VOID WINAPI -StringTableDestroy(HSTRING_TABLE hStringTable) +pSetupStringTableDestroy(HSTRING_TABLE hStringTable) { PSTRING_TABLE pStringTable; DWORD i; @@ -175,7 +175,7 @@ StringTableDestroy(HSTRING_TABLE hStringTable) /************************************************************************** - * StringTableAddString [SETUPAPI.@] + * pSetupStringTableAddString [SETUPAPI.@] * * Adds a new string to the string table. * @@ -195,9 +195,9 @@ StringTableDestroy(HSTRING_TABLE hStringTable) * this case. */ DWORD WINAPI -StringTableAddString(HSTRING_TABLE hStringTable, - LPWSTR lpString, - DWORD dwFlags) +pSetupStringTableAddString(HSTRING_TABLE hStringTable, + LPWSTR lpString, + DWORD dwFlags) { PSTRING_TABLE pStringTable; DWORD i; @@ -250,7 +250,7 @@ StringTableAddString(HSTRING_TABLE hStringTable, MyFree(pNewSlots); pStringTable->dwMaxSlots = dwNewMaxSlots; - return StringTableAddString(hStringTable, lpString, dwFlags); + return pSetupStringTableAddString(hStringTable, lpString, dwFlags); } /* Search for an empty slot */ @@ -280,7 +280,7 @@ StringTableAddString(HSTRING_TABLE hStringTable, /************************************************************************** - * StringTableAddStringEx [SETUPAPI.@] + * pSetupStringTableAddStringEx [SETUPAPI.@] * * Adds a new string plus extra data to the string table. * @@ -302,11 +302,11 @@ StringTableAddString(HSTRING_TABLE hStringTable, * this case. */ DWORD WINAPI -StringTableAddStringEx(HSTRING_TABLE hStringTable, - LPWSTR lpString, - DWORD dwFlags, - LPVOID lpExtraData, - DWORD dwExtraDataSize) +pSetupStringTableAddStringEx(HSTRING_TABLE hStringTable, + LPWSTR lpString, + DWORD dwFlags, + LPVOID lpExtraData, + DWORD dwExtraDataSize) { PSTRING_TABLE pStringTable; DWORD i; @@ -390,7 +390,7 @@ StringTableAddStringEx(HSTRING_TABLE hStringTable, /************************************************************************** - * StringTableDuplicate [SETUPAPI.@] + * pSetupStringTableDuplicate [SETUPAPI.@] * * Duplicates a given string table. * @@ -403,7 +403,7 @@ StringTableAddStringEx(HSTRING_TABLE hStringTable, * */ HSTRING_TABLE WINAPI -StringTableDuplicate(HSTRING_TABLE hStringTable) +pSetupStringTableDuplicate(HSTRING_TABLE hStringTable) { PSTRING_TABLE pSourceTable; PSTRING_TABLE pDestinationTable; @@ -474,7 +474,7 @@ StringTableDuplicate(HSTRING_TABLE hStringTable) /************************************************************************** - * StringTableGetExtraData [SETUPAPI.@] + * pSetupStringTableGetExtraData [SETUPAPI.@] * * Retrieves extra data from a given string table entry. * @@ -489,10 +489,10 @@ StringTableDuplicate(HSTRING_TABLE hStringTable) * Failure: FALSE */ BOOL WINAPI -StringTableGetExtraData(HSTRING_TABLE hStringTable, - DWORD dwId, - LPVOID lpExtraData, - DWORD dwExtraDataSize) +pSetupStringTableGetExtraData(HSTRING_TABLE hStringTable, + DWORD dwId, + LPVOID lpExtraData, + DWORD dwExtraDataSize) { PSTRING_TABLE pStringTable; @@ -527,7 +527,7 @@ StringTableGetExtraData(HSTRING_TABLE hStringTable, /************************************************************************** - * StringTableLookUpString [SETUPAPI.@] + * pSetupStringTableLookUpString [SETUPAPI.@] * * Searches a string table for a given string. * @@ -542,9 +542,9 @@ StringTableGetExtraData(HSTRING_TABLE hStringTable, * Failure: -1 */ DWORD WINAPI -StringTableLookUpString(HSTRING_TABLE hStringTable, - LPWSTR lpString, - DWORD dwFlags) +pSetupStringTableLookUpString(HSTRING_TABLE hStringTable, + LPWSTR lpString, + DWORD dwFlags) { PSTRING_TABLE pStringTable; DWORD i; @@ -581,7 +581,7 @@ StringTableLookUpString(HSTRING_TABLE hStringTable, /************************************************************************** - * StringTableLookUpStringEx [SETUPAPI.@] + * pSetupStringTableLookUpStringEx [SETUPAPI.@] * * Searches a string table and extra data for a given string. * @@ -598,11 +598,11 @@ StringTableLookUpString(HSTRING_TABLE hStringTable, * Failure: -1 */ DWORD WINAPI -StringTableLookUpStringEx(HSTRING_TABLE hStringTable, - LPWSTR lpString, - DWORD dwFlags, - LPVOID lpExtraData, - DWORD dwReserved) +pSetupStringTableLookUpStringEx(HSTRING_TABLE hStringTable, + LPWSTR lpString, + DWORD dwFlags, + LPVOID lpExtraData, + DWORD dwReserved) { PSTRING_TABLE pStringTable; DWORD i; @@ -647,7 +647,7 @@ StringTableLookUpStringEx(HSTRING_TABLE hStringTable, /************************************************************************** - * StringTableSetExtraData [SETUPAPI.@] + * pSetupStringTableSetExtraData [SETUPAPI.@] * * Sets extra data for a given string table entry. * @@ -662,10 +662,10 @@ StringTableLookUpStringEx(HSTRING_TABLE hStringTable, * Failure: FALSE */ BOOL WINAPI -StringTableSetExtraData(HSTRING_TABLE hStringTable, - DWORD dwId, - LPVOID lpExtraData, - DWORD dwExtraDataSize) +pSetupStringTableSetExtraData(HSTRING_TABLE hStringTable, + DWORD dwId, + LPVOID lpExtraData, + DWORD dwExtraDataSize) { PSTRING_TABLE pStringTable; @@ -708,7 +708,7 @@ StringTableSetExtraData(HSTRING_TABLE hStringTable, /************************************************************************** - * StringTableStringFromId [SETUPAPI.@] + * pSetupStringTableStringFromId [SETUPAPI.@] * * Returns a pointer to a string for the given string ID. * @@ -721,8 +721,8 @@ StringTableSetExtraData(HSTRING_TABLE hStringTable, * Failure: NULL */ LPWSTR WINAPI -StringTableStringFromId(HSTRING_TABLE hStringTable, - DWORD dwId) +pSetupStringTableStringFromId(HSTRING_TABLE hStringTable, + DWORD dwId) { PSTRING_TABLE pStringTable; static WCHAR empty[] = {0}; @@ -744,7 +744,7 @@ StringTableStringFromId(HSTRING_TABLE hStringTable, /************************************************************************** - * StringTableStringFromIdEx [SETUPAPI.@] + * pSetupStringTableStringFromIdEx [SETUPAPI.@] * * Returns a string for the given string ID. * @@ -759,10 +759,10 @@ StringTableStringFromId(HSTRING_TABLE hStringTable, * Failure: FALSE */ BOOL WINAPI -StringTableStringFromIdEx(HSTRING_TABLE hStringTable, - DWORD dwId, - LPWSTR lpBuffer, - LPDWORD lpBufferLength) +pSetupStringTableStringFromIdEx(HSTRING_TABLE hStringTable, + DWORD dwId, + LPWSTR lpBuffer, + LPDWORD lpBufferLength) { PSTRING_TABLE pStringTable; DWORD dwLength; @@ -797,21 +797,3 @@ StringTableStringFromIdEx(HSTRING_TABLE hStringTable, return bResult; } - - -/************************************************************************** - * StringTableTrim [SETUPAPI.@] - * - * ... - * - * PARAMS - * hStringTable [I] Handle to the string table - * - * RETURNS - * None - */ -VOID WINAPI -StringTableTrim(HSTRING_TABLE hStringTable) -{ - FIXME("%p\n", hStringTable); -} diff --git a/dll/win32/setupapi/stubs.c b/dll/win32/setupapi/stubs.c index 2ea74984bef..e4003a6eacf 100644 --- a/dll/win32/setupapi/stubs.c +++ b/dll/win32/setupapi/stubs.c @@ -42,9 +42,9 @@ DWORD WINAPI suErrorToIds16( WORD w1, WORD w2 ) } /*********************************************************************** - * RegistryDelnode(SETUPAPI.@) + * pSetupRegistryDelnode(SETUPAPI.@) */ -BOOL WINAPI RegistryDelnode(DWORD x, DWORD y) +BOOL WINAPI pSetupRegistryDelnode(DWORD x, DWORD y) { FIXME("%08x %08x: stub\n", x, y); return FALSE; @@ -187,25 +187,6 @@ CMP_UnregisterNotification(IN HDEVNOTIFY handle) return CR_SUCCESS; } -/*********************************************************************** - * CM_Get_Device_Interface_List_Size_ExA (SETUPAPI.@) - */ -CONFIGRET WINAPI CM_Get_Device_Interface_List_Size_ExA(PULONG len, LPGUID class, DEVINSTID_A id, - ULONG flags, HMACHINE machine) -{ - FIXME("%p %p %s 0x%08x %p: stub\n", len, class, debugstr_a(id), flags, machine); - return CR_FAILURE; -} - -/*********************************************************************** - * CM_Get_Device_Interface_List_Size_ExW (SETUPAPI.@) - */ -CONFIGRET WINAPI CM_Get_Device_Interface_List_Size_ExW(PULONG len, LPGUID class, DEVINSTID_W id, - ULONG flags, HMACHINE machine) -{ - FIXME("%p %p %s 0x%08x %p: stub\n", len, class, debugstr_w(id), flags, machine); - return CR_FAILURE; -} WINSETUPAPI BOOL WINAPI SetupDiGetDeviceInterfaceAlias(IN HDEVINFO DeviceInfoSet, IN PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData, IN CONST GUID *AliasInterfaceClassGuid, OUT PSP_DEVICE_INTERFACE_DATA AliasDeviceInterfaceData) { diff --git a/dll/win32/sfc/precomp.h b/dll/win32/sfc/precomp.h index 2801b0ffdbd..c8b836cf4b0 100644 --- a/dll/win32/sfc/precomp.h +++ b/dll/win32/sfc/precomp.h @@ -5,8 +5,8 @@ #include #include -DWORD WINAPI sfc_8(); -DWORD WINAPI sfc_9(); +DWORD WINAPI sfc_8(VOID); +DWORD WINAPI sfc_9(VOID); typedef BOOL (WINAPI *PSRSRPA)(PRESTOREPOINTINFOA, PSTATEMGRSTATUS); typedef BOOL (WINAPI *PSRSRPW)(PRESTOREPOINTINFOW, PSTATEMGRSTATUS); diff --git a/dll/win32/shell32/dialogs.c b/dll/win32/shell32/dialogs.c index fa09de07916..9955e83c7a7 100644 --- a/dll/win32/shell32/dialogs.c +++ b/dll/win32/shell32/dialogs.c @@ -63,7 +63,7 @@ BOOL CALLBACK EnumPickIconResourceProc(HMODULE hModule, PPICK_ICON_CONTEXT pIconContext = (PPICK_ICON_CONTEXT)lParam; if (IS_INTRESOURCE(lpszName)) - swprintf(szName, L"%u\n", lpszName); + swprintf(szName, L"%u", lpszName); else wcscpy(szName, (WCHAR*)lpszName); @@ -105,7 +105,7 @@ INT_PTR CALLBACK PickIconProc(HWND hwndDlg, LPMEASUREITEMSTRUCT lpmis; LPDRAWITEMSTRUCT lpdis; HICON hIcon; - INT index; + INT index, count; WCHAR szText[MAX_PATH], szTitle[100], szFilter[100]; OPENFILENAMEW ofn = {0}; @@ -123,18 +123,21 @@ INT_PTR CALLBACK PickIconProc(HWND hwndDlg, else SendDlgItemMessageW(hwndDlg, IDC_EDIT_PATH, WM_SETTEXT, 0, (LPARAM)pIconContext->szName); - swprintf(szText, L"%u", pIconContext->Index); - index = SendMessageW(pIconContext->hDlgCtrl, LB_FINDSTRING, -1, (LPARAM)szText); - if (index != LB_ERR) - SendMessageW(pIconContext->hDlgCtrl, LB_SETCURSEL, index, 0); + count = SendMessage(pIconContext->hDlgCtrl, LB_GETCOUNT, 0, 0); + if (count != LB_ERR) + { + if (count > pIconContext->Index) + SendMessageW(pIconContext->hDlgCtrl, LB_SETCURSEL, pIconContext->Index, 0); + else + SendMessageW(pIconContext->hDlgCtrl, LB_SETCURSEL, 0, 0); + } return TRUE; case WM_COMMAND: switch(LOWORD(wParam)) { case IDOK: index = SendMessageW(pIconContext->hDlgCtrl, LB_GETCURSEL, 0, 0); - SendMessageW(pIconContext->hDlgCtrl, LB_GETTEXT, index, (LPARAM)szText); - pIconContext->Index = _wtoi(szText); + pIconContext->Index = index; SendDlgItemMessageW(hwndDlg, IDC_EDIT_PATH, WM_GETTEXT, MAX_PATH, (LPARAM)pIconContext->szName); DestroyIconList(pIconContext->hDlgCtrl); EndDialog(hwndDlg, 1); diff --git a/dll/win32/shell32/iconcache.c b/dll/win32/shell32/iconcache.c index a57c33e52c6..01e84c99e75 100644 --- a/dll/win32/shell32/iconcache.c +++ b/dll/win32/shell32/iconcache.c @@ -180,8 +180,8 @@ static HICON SIC_OverlayShortcutImage(HICON SourceIcon, BOOL large) if (NULL == SelectObject(ShortcutDC, ShortcutIconInfo.hbmColor)) goto fail; if (!MaskBlt(TargetDC, 0, SourceBitmapInfo.bmHeight - ShortcutBitmapInfo.bmHeight, ShortcutBitmapInfo.bmWidth, ShortcutBitmapInfo.bmHeight, - ShortcutDC, 0, 0, ShortcutIconInfo.hbmMask, 0, 0, - MAKEROP4(SRCCOPY, 0xAA0000))) + ShortcutDC, 0, 0, ShortcutIconInfo.hbmMask, 0, 0, + MAKEROP4(0xAA0000, SRCCOPY))) { goto fail; } diff --git a/dll/win32/shell32/she_ocmenu.c b/dll/win32/shell32/she_ocmenu.c index 1b6adec94aa..c2e9c05ede5 100644 --- a/dll/win32/shell32/she_ocmenu.c +++ b/dll/win32/shell32/she_ocmenu.c @@ -1219,8 +1219,8 @@ SHEOW_LoadOpenWithItems(SHEOWImpl *This, IDataObject *pdtobj) ERR("no mem\n"); return E_OUTOFMEMORY; } - if (_ILIsDesktop(pidl_child) || _ILIsMyDocuments(pidl_child) || _ILIsControlPanel(pidl_child) || _ILIsNetHood(pidl_child) || - _ILIsBitBucket(pidl_child) || _ILIsDrive(pidl_child) || _ILIsCPanelStruct(pidl_child) || _ILIsFolder(pidl_child) || _ILIsControlPanel(pidl_folder)) + if (_ILIsDesktop(pidl) || _ILIsMyDocuments(pidl) || _ILIsControlPanel(pidl) || _ILIsNetHood(pidl) || + _ILIsBitBucket(pidl) || _ILIsDrive(pidl) || _ILIsCPanelStruct(pidl) || _ILIsFolder(pidl) || _ILIsControlPanel(pidl)) { TRACE("pidl is a folder\n"); SHFree((void*)pidl); diff --git a/dll/win32/shell32/shlview.c b/dll/win32/shell32/shlview.c index f3cd5507c13..335524548ab 100644 --- a/dll/win32/shell32/shlview.c +++ b/dll/win32/shell32/shlview.c @@ -1475,7 +1475,7 @@ static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpn case LVN_ENDLABELEDITW: { - TRACE("-- LVN_ENDLABELEDITA %p\n",This); + TRACE("-- LVN_ENDLABELEDITW %p\n",This); if (lpdi->item.pszText) { HRESULT hr; diff --git a/dll/win32/syssetup/install.c b/dll/win32/syssetup/install.c index feb2136abf8..59b32470bc4 100644 --- a/dll/win32/syssetup/install.c +++ b/dll/win32/syssetup/install.c @@ -481,6 +481,7 @@ EnableUserModePnpManager(VOID) if (hSCManager == NULL) { DPRINT1("Unable to open the service control manager.\n"); + DPRINT1("Last Error %d\n", GetLastError()); goto cleanup; } @@ -506,9 +507,9 @@ EnableUserModePnpManager(VOID) } ret = StartServiceW(hService, 0, NULL); - if (!ret) + if ((!ret) && (GetLastError() != ERROR_SERVICE_ALREADY_RUNNING)) { - DPRINT("Unable to start service\n"); + DPRINT1("Unable to start service\n"); goto cleanup; } diff --git a/dll/win32/user32/controls/combo.c b/dll/win32/user32/controls/combo.c index de6c646268d..422953195c4 100644 --- a/dll/win32/user32/controls/combo.c +++ b/dll/win32/user32/controls/combo.c @@ -1119,7 +1119,7 @@ static void CBDropDown( LPHEADCOMBO lphc ) if( (rect.bottom + nDroppedHeight) >= mon_info.rcWork.bottom ) rect.bottom = rect.top - nDroppedHeight; - SetWindowPos( lphc->hWndLBox, HWND_TOP, rect.left, rect.bottom, + SetWindowPos( lphc->hWndLBox, HWND_TOPMOST, rect.left, rect.bottom, lphc->droppedRect.right - lphc->droppedRect.left, nDroppedHeight, SWP_NOACTIVATE | SWP_SHOWWINDOW); diff --git a/dll/win32/user32/controls/edit.c b/dll/win32/user32/controls/edit.c index b484c842ea0..65f36797f63 100644 --- a/dll/win32/user32/controls/edit.c +++ b/dll/win32/user32/controls/edit.c @@ -426,8 +426,8 @@ static void EDIT_BuildLineDefs_ML(EDITSTATE *es, INT istart, INT iend, INT delta /* The buffer has been expanded, create a new line and insert it into the link list */ LINEDEF *new_line = HeapAlloc(GetProcessHeap(), 0, sizeof(LINEDEF)); - if (new_line == NULL) - break; + if (new_line == NULL) // reactos r33509 + break; // reactos r33509 new_line->next = previous_line->next; previous_line->next = new_line; current_line = new_line; @@ -1109,8 +1109,7 @@ static void EDIT_LockBuffer(EDITSTATE *es) if(textA) { HLOCAL hloc32W_new; - UINT countW_new = MultiByteToWideChar(CP_ACP, 0, textA, countA, NULL, 0); - TRACE("%d bytes translated to %d WCHARs\n", countA, countW_new); + UINT countW_new = MultiByteToWideChar(CP_ACP, 0, textA, -1, NULL, 0); if(countW_new > es->buffer_size + 1) { UINT alloc_size = ROUND_TO_GROW(countW_new * sizeof(WCHAR)); @@ -1125,14 +1124,11 @@ static void EDIT_LockBuffer(EDITSTATE *es) else WARN("FAILED! Will synchronize partially\n"); } + es->text = LocalLock(es->hloc32W); + MultiByteToWideChar(CP_ACP, 0, textA, -1, es->text, es->buffer_size + 1); + LocalUnlock(es->hloc32A); } - /*TRACE("Locking 32-bit UNICODE buffer\n");*/ - es->text = LocalLock(es->hloc32W); - if(textA) - { - MultiByteToWideChar(CP_ACP, 0, textA, countA, es->text, es->buffer_size + 1); - LocalUnlock(es->hloc32A); - } + else es->text = LocalLock(es->hloc32W); } if(es->flags & EF_APP_HAS_HANDLE) text_buffer_changed(es); es->lock_count++; @@ -1165,7 +1161,6 @@ static void EDIT_UnlockBuffer(EDITSTATE *es, BOOL force) if (force || (es->lock_count == 1)) { if (es->hloc32W) { - CHAR *textA = NULL; // ReactOS hacked! UINT countA = 0; UINT countW = get_text_length(es) + 1; @@ -1190,13 +1185,9 @@ static void EDIT_UnlockBuffer(EDITSTATE *es, BOOL force) else WARN("FAILED! Will synchronize partially\n"); } - textA = LocalLock(es->hloc32A); - } - - if(textA) - { - WideCharToMultiByte(CP_ACP, 0, es->text, countW, textA, countA, NULL, NULL); - LocalUnlock(es->hloc32A); + WideCharToMultiByte(CP_ACP, 0, es->text, countW, + LocalLock(es->hloc32A), countA, NULL, NULL); + LocalUnlock(es->hloc32A); } LocalUnlock(es->hloc32W); @@ -1653,8 +1644,8 @@ static LRESULT EDIT_EM_Scroll(EDITSTATE *es, INT action) /* Notification is done in EDIT_EM_LineScroll */ if(dy) { EDIT_EM_LineScroll(es, 0, dy); - return MAKELONG((SHORT)dy, (BOOL)TRUE); - } + return MAKELONG(dy, TRUE); + } } return (LRESULT)FALSE; @@ -2771,13 +2762,13 @@ static void EDIT_EM_SetPasswordChar(EDITSTATE *es, WCHAR c) if (es->password_char == c) return; - style = GetWindowLongPtrW( es->hwndSelf, GWL_STYLE ); + style = GetWindowLongW( es->hwndSelf, GWL_STYLE ); es->password_char = c; if (c) { - SetWindowLongPtrW( es->hwndSelf, GWL_STYLE, style | ES_PASSWORD ); + SetWindowLongW( es->hwndSelf, GWL_STYLE, style | ES_PASSWORD ); es->style |= ES_PASSWORD; } else { - SetWindowLongPtrW( es->hwndSelf, GWL_STYLE, style & ~ES_PASSWORD ); + SetWindowLongW( es->hwndSelf, GWL_STYLE, style & ~ES_PASSWORD ); es->style &= ~ES_PASSWORD; } EDIT_UpdateText(es, NULL, TRUE); @@ -2799,11 +2790,11 @@ static BOOL EDIT_EM_SetTabStops(EDITSTATE *es, INT count, const INT *tabs) es->tabs = NULL; else { es->tabs = HeapAlloc(GetProcessHeap(), 0, count * sizeof(INT)); - if (es->tabs == NULL) + if (es->tabs == NULL) // reactos r33503 { es->tabs_count = 0; return FALSE; - } + } // reactos r33503 memcpy(es->tabs, tabs, count * sizeof(INT)); } return TRUE; @@ -2847,8 +2838,8 @@ static BOOL EDIT_EM_Undo(EDITSTATE *es) ulength = strlenW(es->undo_text); utext = HeapAlloc(GetProcessHeap(), 0, (ulength + 1) * sizeof(WCHAR)); - if (utext == NULL) - return FALSE; + if (utext == NULL) // reactos r33503 + return FALSE; // reactos r33503 strcpyW(utext, es->undo_text); @@ -2877,7 +2868,7 @@ static BOOL EDIT_EM_Undo(EDITSTATE *es) * controls without ES_WANTRETURN would attempt to detect whether it is inside * a dialog box or not. */ -static BOOL EDIT_IsInsideDialog(EDITSTATE *es) +static inline BOOL EDIT_IsInsideDialog(EDITSTATE *es) { return (es->flags & EF_DIALOGMODE); } @@ -3090,6 +3081,7 @@ static void EDIT_WM_Command(EDITSTATE *es, INT code, INT id, HWND control) } #endif + /********************************************************************* * * WM_CONTEXTMENU @@ -3108,11 +3100,7 @@ static void EDIT_WM_Command(EDITSTATE *es, INT code, INT id, HWND control) */ static void EDIT_WM_ContextMenu(EDITSTATE *es, INT x, INT y) { -#ifdef __REACTOS__ - HMENU menu = LoadMenuA(User32Instance, "EDITMENU"); -#else HMENU menu = LoadMenuA(user32_module, "EDITMENU"); -#endif HMENU popup = GetSubMenu(menu, 0); UINT start = es->selection_start; UINT end = es->selection_end; @@ -3143,6 +3131,10 @@ static void EDIT_WM_ContextMenu(EDITSTATE *es, INT x, INT y) y = rc.top + (rc.bottom - rc.top) / 2; } + if (!(es->flags & EF_FOCUSED)) + SetFocus(es->hwndSelf); + +#ifdef __REACTOS__ selectedItem = TrackPopupMenu(popup, TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD, x, y, 0, es->hwndSelf, NULL); // Added see Revision 43925 comments. switch (selectedItem) { @@ -3169,7 +3161,7 @@ static void EDIT_WM_ContextMenu(EDITSTATE *es, INT x, INT y) ERR("unknown menu item, please report\n"); break; } - +#endif DestroyMenu(menu); } @@ -3238,14 +3230,14 @@ static BOOL EDIT_CheckCombo(EDITSTATE *es, UINT msg, INT key) nEUI = 2; } - SendMessageW(hLBox, WM_KEYDOWN, (WPARAM)key, 0); + SendMessageW(hLBox, WM_KEYDOWN, key, 0); break; case WM_SYSKEYDOWN: /* Handle Alt+up/down arrows */ if (nEUI) SendMessageW(hCombo, CB_SHOWDROPDOWN, bDropped ? FALSE : TRUE, 0); else - SendMessageW(hLBox, WM_KEYDOWN, (WPARAM)VK_F4, 0); + SendMessageW(hLBox, WM_KEYDOWN, VK_F4, 0); break; } @@ -3359,17 +3351,17 @@ static LRESULT EDIT_WM_KeyDown(EDITSTATE *es, INT key) /* If the edit doesn't want the return send a message to the default object */ if(!(es->style & ES_MULTILINE) || !(es->style & ES_WANTRETURN)) { - DWORD dw; + DWORD dw; if (!EDIT_IsInsideDialog(es)) break; if (control) break; - dw = SendMessageW( es->hwndParent, DM_GETDEFID, 0, 0 ); + dw = SendMessageW(es->hwndParent, DM_GETDEFID, 0, 0); if (HIWORD(dw) == DC_HASDEFID) { HWND hwDefCtrl = GetDlgItem(es->hwndParent, LOWORD(dw)); if (hwDefCtrl) { - SendMessageW(es->hwndParent, WM_NEXTDLGCTL, (WPARAM)hwDefCtrl, (LPARAM)TRUE); + SendMessageW(es->hwndParent, WM_NEXTDLGCTL, (WPARAM)hwDefCtrl, TRUE); PostMessageW(hwDefCtrl, WM_KEYDOWN, VK_RETURN, 0); } } @@ -3384,7 +3376,7 @@ static LRESULT EDIT_WM_KeyDown(EDITSTATE *es, INT key) SendMessageW(es->hwndParent, WM_NEXTDLGCTL, shift, 0); break; } - return TRUE; + return TRUE; } @@ -3681,7 +3673,7 @@ static void EDIT_WM_SetFont(EDITSTATE *es, HFONT font, BOOL redraw) EDIT_UpdateText(es, NULL, TRUE); if (es->flags & EF_FOCUSED) { DestroyCaret(); - CreateCaret(es->hwndSelf, 0, 2, es->line_height); + CreateCaret(es->hwndSelf, 0, 1, es->line_height); EDIT_SetCaretPos(es, es->selection_end, es->flags & EF_AFTER_WRAP); ShowCaret(es->hwndSelf); @@ -3839,7 +3831,7 @@ static LRESULT EDIT_WM_SysKeyDown(EDITSTATE *es, INT key, DWORD key_data) if (EDIT_CheckCombo(es, WM_SYSKEYDOWN, key)) return 0; } - return DefWindowProcW(es->hwndSelf, WM_SYSKEYDOWN, (WPARAM)key, (LPARAM)key_data); + return DefWindowProcW(es->hwndSelf, WM_SYSKEYDOWN, key, key_data); } @@ -3929,7 +3921,7 @@ static LRESULT EDIT_WM_HScroll(EDITSTATE *es, INT action, INT pos) case SB_THUMBPOSITION: TRACE("SB_THUMBPOSITION %d\n", pos); es->flags &= ~EF_HSCROLL_TRACK; - if(GetWindowLongPtrW( es->hwndSelf, GWL_STYLE ) & WS_HSCROLL) + if(GetWindowLongW( es->hwndSelf, GWL_STYLE ) & WS_HSCROLL) dx = pos - es->x_offset; else { @@ -3959,7 +3951,7 @@ static LRESULT EDIT_WM_HScroll(EDITSTATE *es, INT action, INT pos) case EM_GETTHUMB: /* this one is used by NT notepad */ { LRESULT ret; - if(GetWindowLongPtrW( es->hwndSelf, GWL_STYLE ) & WS_HSCROLL) + if(GetWindowLongW( es->hwndSelf, GWL_STYLE ) & WS_HSCROLL) ret = GetScrollPos(es->hwndSelf, SB_HORZ); else { @@ -3970,10 +3962,10 @@ static LRESULT EDIT_WM_HScroll(EDITSTATE *es, INT action, INT pos) TRACE("EM_GETTHUMB: returning %ld\n", ret); return ret; } - case EM_LINESCROLL: - TRACE("EM_LINESCROLL16\n"); - dx = pos; - break; + case EM_LINESCROLL: + TRACE("EM_LINESCROLL16\n"); + dx = pos; + break; default: ERR("undocumented WM_HSCROLL action %d (0x%04x), please report\n", @@ -4082,7 +4074,7 @@ static LRESULT EDIT_WM_VScroll(EDITSTATE *es, INT action, INT pos) case EM_GETTHUMB: /* this one is used by NT notepad */ { LRESULT ret; - if(GetWindowLongPtrW( es->hwndSelf, GWL_STYLE ) & WS_VSCROLL) + if(GetWindowLongW( es->hwndSelf, GWL_STYLE ) & WS_VSCROLL) ret = GetScrollPos(es->hwndSelf, SB_VERT); else { @@ -4094,7 +4086,7 @@ static LRESULT EDIT_WM_VScroll(EDITSTATE *es, INT action, INT pos) return ret; } case EM_LINESCROLL: - TRACE("EM_LINESCROLL16 %d\n", pos); + TRACE("EM_LINESCROLL %d\n", pos); dy = pos; break; @@ -4121,7 +4113,7 @@ static LRESULT EDIT_WM_VScroll(EDITSTATE *es, INT action, INT pos) static LRESULT EDIT_EM_GetThumb(EDITSTATE *es) { return MAKELONG(EDIT_WM_VScroll(es, EM_GETTHUMB, 0), - EDIT_WM_HScroll(es, EM_GETTHUMB, 0)); + EDIT_WM_HScroll(es, EM_GETTHUMB, 0)); } @@ -4361,17 +4353,17 @@ static LRESULT EDIT_WM_NCCreate(HWND hwnd, LPCREATESTRUCTW lpcs, BOOL unicode) if (lpcs->dwExStyle & WS_EX_CLIENTEDGE) es->style &= ~WS_BORDER; else if (es->style & WS_BORDER) - SetWindowLongPtrW(hwnd, GWL_STYLE, es->style & ~WS_BORDER); + SetWindowLongW(hwnd, GWL_STYLE, es->style & ~WS_BORDER); return TRUE; cleanup: - SetWindowLongPtrW(es->hwndSelf, 0, 0); - HeapFree(GetProcessHeap(), 0, es->first_line_def); - HeapFree(GetProcessHeap(), 0, es->undo_text); - if (es->hloc32W) LocalFree(es->hloc32W); - HeapFree(GetProcessHeap(), 0, es); - return FALSE; + SetWindowLongPtrW(es->hwndSelf, 0, 0); + HeapFree(GetProcessHeap(), 0, es->first_line_def); + HeapFree(GetProcessHeap(), 0, es->undo_text); + if (es->hloc32W) LocalFree(es->hloc32W); + HeapFree(GetProcessHeap(), 0, es); + return FALSE; } @@ -4427,10 +4419,10 @@ static LRESULT EDIT_WM_Create(EDITSTATE *es, LPCWSTR name) /********************************************************************* * - * WM_DESTROY + * WM_NCDESTROY * */ -static LRESULT EDIT_WM_Destroy(EDITSTATE *es) +static LRESULT EDIT_WM_NCDestroy(EDITSTATE *es) { LINEDEF *pc, *pp; @@ -4448,8 +4440,8 @@ static LRESULT EDIT_WM_Destroy(EDITSTATE *es) pc = pp; } - SetWindowLongPtrW( es->hwndSelf, 0, 0 ); - HeapFree(GetProcessHeap(), 0, es->undo_text); + SetWindowLongPtrW( es->hwndSelf, 0, 0 ); + HeapFree(GetProcessHeap(), 0, es->undo_text); HeapFree(GetProcessHeap(), 0, es); return 0; @@ -4471,8 +4463,7 @@ static inline LRESULT DefWindowProcT(HWND hwnd, UINT msg, WPARAM wParam, LPARAM * The messages are in the order of the actual integer values * (which can be found in include/windows.h) */ -LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg, - WPARAM wParam, LPARAM lParam, BOOL unicode ) +LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicode ) { EDITSTATE *es = (EDITSTATE *)GetWindowLongPtrW( hwnd, 0 ); LRESULT result = 0; @@ -4494,7 +4485,7 @@ LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg, if (!es && msg != WM_NCCREATE) return DefWindowProcT(hwnd, msg, wParam, lParam, unicode); - if (es && (msg != WM_DESTROY)) EDIT_LockBuffer(es); + if (es && (msg != WM_NCDESTROY)) EDIT_LockBuffer(es); switch (msg) { case EM_GETSEL: @@ -4569,13 +4560,9 @@ LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg, break; /* these messages missing from specs */ - case WM_USER+15: case 0x00bf: - case WM_USER+16: case 0x00c0: - case WM_USER+19: case 0x00c3: - case WM_USER+26: case 0x00ca: FIXME("undocumented message 0x%x, please report\n", msg); result = DefWindowProcW(hwnd, msg, wParam, lParam); @@ -4595,8 +4582,8 @@ LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg, { LPSTR textA = (LPSTR)lParam; INT countW = MultiByteToWideChar(CP_ACP, 0, textA, -1, NULL, 0); - if(!(textW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR)))) break; - MultiByteToWideChar(CP_ACP, 0, textA, -1, textW, countW); + if (!(textW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR)))) break; + MultiByteToWideChar(CP_ACP, 0, textA, -1, textW, countW); } EDIT_EM_ReplaceSel(es, (BOOL)wParam, textW, TRUE, TRUE); @@ -4665,12 +4652,12 @@ LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg, DWORD old_style = es->style; if (wParam) { - SetWindowLongPtrW( hwnd, GWL_STYLE, - GetWindowLongPtrW( hwnd, GWL_STYLE ) | ES_READONLY ); + SetWindowLongW( hwnd, GWL_STYLE, + GetWindowLongW( hwnd, GWL_STYLE ) | ES_READONLY ); es->style |= ES_READONLY; } else { - SetWindowLongPtrW( hwnd, GWL_STYLE, - GetWindowLongPtrW( hwnd, GWL_STYLE ) & ~ES_READONLY ); + SetWindowLongW( hwnd, GWL_STYLE, + GetWindowLongW( hwnd, GWL_STYLE ) & ~ES_READONLY ); es->style &= ~ES_READONLY; } @@ -4732,9 +4719,9 @@ LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg, result = EDIT_WM_NCCreate(hwnd, (LPCREATESTRUCTW)lParam, unicode); break; - case WM_DESTROY: - result = EDIT_WM_Destroy(es); - es = NULL; + case WM_NCDESTROY: + result = EDIT_WM_NCDestroy(es); +// es = NULL; reactos #ifdef __REACTOS__ NtUserSetWindowFNID(hwnd, FNID_DESTROY); #endif @@ -4908,7 +4895,7 @@ LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg, break; case WM_MBUTTONDOWN: - result = EDIT_WM_MButtonDown(es); + result = EDIT_WM_MButtonDown(es); break; case WM_MOUSEMOVE: @@ -4985,8 +4972,8 @@ LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg, } break; - - /* IME messages to make the edit control IME aware */ + + /* IME messages to make the edit control IME aware */ case WM_IME_SETCONTEXT: break; @@ -5022,7 +5009,9 @@ LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg, break; } - if (IsWindow(hwnd) && es) EDIT_UnlockBuffer(es, FALSE); + /* reactos: check GetWindowLong in case es has been destroyed during processing */ + if (IsWindow(hwnd) && es && GetWindowLongPtrW(hwnd, 0)) + EDIT_UnlockBuffer(es, FALSE); TRACE("hwnd=%p msg=%x (%s) -- 0x%08lx\n", hwnd, msg, SPY_GetMsgName(msg, hwnd), result); @@ -5057,10 +5046,10 @@ const struct builtin_class_descr EDIT_builtin_class = CS_DBLCLKS | CS_PARENTDC, /* style */ EditWndProcA, /* procA */ EditWndProcW, /* procW */ -#ifdef _WIN64 - sizeof(EDITSTATE *), /* extra */ -#else +#ifndef _WIN64 sizeof(EDITSTATE *) + sizeof(WORD), /* extra */ +#else + sizeof(EDITSTATE *), /* extra */ #endif IDC_IBEAM, /* cursor */ 0 /* brush */ diff --git a/dll/win32/user32/include/user32p.h b/dll/win32/user32/include/user32p.h index 9a27bbc19ac..d4b32cb0abe 100644 --- a/dll/win32/user32/include/user32p.h +++ b/dll/win32/user32/include/user32p.h @@ -106,6 +106,7 @@ /* Internal Thread Data */ extern HINSTANCE User32Instance; +#define user32_module User32Instance extern HINSTANCE hImmInstance; /* Critical Section*/ @@ -122,7 +123,7 @@ typedef struct _USER32_THREAD_DATA USER32_TRACKINGLIST tracking_info; /* TrackMouseEvent stuff */ } USER32_THREAD_DATA, *PUSER32_THREAD_DATA; -PUSER32_THREAD_DATA User32GetThreadData(); +PUSER32_THREAD_DATA User32GetThreadData(VOID); /* FIXME: Belongs to some header. */ BOOL WINAPI GdiDllInitialize(HANDLE, DWORD, LPVOID); diff --git a/dll/win32/user32/misc/misc.c b/dll/win32/user32/misc/misc.c index e7b7672cfdc..3f1c4b6b367 100644 --- a/dll/win32/user32/misc/misc.c +++ b/dll/win32/user32/misc/misc.c @@ -72,7 +72,7 @@ SetLogonNotifyWindow (HWND Wnd, HWINSTA WinSta) return(FALSE); } - return(TRUE); + return NtUserSetLogonNotifyWindow(Wnd); } /* diff --git a/dll/win32/user32/resources/obm_btncorners.bmp b/dll/win32/user32/resources/obm_btncorners.bmp new file mode 100644 index 00000000000..e7838624b1a Binary files /dev/null and b/dll/win32/user32/resources/obm_btncorners.bmp differ diff --git a/dll/win32/user32/resources/obm_btsize.bmp b/dll/win32/user32/resources/obm_btsize.bmp new file mode 100644 index 00000000000..076e4f870ee Binary files /dev/null and b/dll/win32/user32/resources/obm_btsize.bmp differ diff --git a/dll/win32/user32/resources/obm_check.bmp b/dll/win32/user32/resources/obm_check.bmp new file mode 100644 index 00000000000..e9e4fb5de77 Binary files /dev/null and b/dll/win32/user32/resources/obm_check.bmp differ diff --git a/dll/win32/user32/resources/obm_dnarrow.bmp b/dll/win32/user32/resources/obm_dnarrow.bmp new file mode 100644 index 00000000000..0f3288f3245 Binary files /dev/null and b/dll/win32/user32/resources/obm_dnarrow.bmp differ diff --git a/dll/win32/user32/resources/obm_dnarrowd.bmp b/dll/win32/user32/resources/obm_dnarrowd.bmp new file mode 100644 index 00000000000..51b38e90f75 Binary files /dev/null and b/dll/win32/user32/resources/obm_dnarrowd.bmp differ diff --git a/dll/win32/user32/resources/obm_dnarrowi.bmp b/dll/win32/user32/resources/obm_dnarrowi.bmp new file mode 100644 index 00000000000..3cbf4fbba4c Binary files /dev/null and b/dll/win32/user32/resources/obm_dnarrowi.bmp differ diff --git a/dll/win32/user32/resources/obm_lfarrow.bmp b/dll/win32/user32/resources/obm_lfarrow.bmp new file mode 100644 index 00000000000..6ceef252550 Binary files /dev/null and b/dll/win32/user32/resources/obm_lfarrow.bmp differ diff --git a/dll/win32/user32/resources/obm_lfarrowd.bmp b/dll/win32/user32/resources/obm_lfarrowd.bmp new file mode 100644 index 00000000000..bb446c3e040 Binary files /dev/null and b/dll/win32/user32/resources/obm_lfarrowd.bmp differ diff --git a/dll/win32/user32/resources/obm_lfarrowi.bmp b/dll/win32/user32/resources/obm_lfarrowi.bmp new file mode 100644 index 00000000000..c81363d484f Binary files /dev/null and b/dll/win32/user32/resources/obm_lfarrowi.bmp differ diff --git a/dll/win32/user32/resources/obm_old_close.bmp b/dll/win32/user32/resources/obm_old_close.bmp new file mode 100644 index 00000000000..905e927ec82 Binary files /dev/null and b/dll/win32/user32/resources/obm_old_close.bmp differ diff --git a/dll/win32/user32/resources/obm_old_dnarrow.bmp b/dll/win32/user32/resources/obm_old_dnarrow.bmp new file mode 100644 index 00000000000..bab716f95a6 Binary files /dev/null and b/dll/win32/user32/resources/obm_old_dnarrow.bmp differ diff --git a/dll/win32/user32/resources/obm_old_lfarrow.bmp b/dll/win32/user32/resources/obm_old_lfarrow.bmp new file mode 100644 index 00000000000..4d4c4c62f99 Binary files /dev/null and b/dll/win32/user32/resources/obm_old_lfarrow.bmp differ diff --git a/dll/win32/user32/resources/obm_old_reduce.bmp b/dll/win32/user32/resources/obm_old_reduce.bmp new file mode 100644 index 00000000000..cee2329995f Binary files /dev/null and b/dll/win32/user32/resources/obm_old_reduce.bmp differ diff --git a/dll/win32/user32/resources/obm_old_restore.bmp b/dll/win32/user32/resources/obm_old_restore.bmp new file mode 100644 index 00000000000..f6938f01325 Binary files /dev/null and b/dll/win32/user32/resources/obm_old_restore.bmp differ diff --git a/dll/win32/user32/resources/obm_old_rgarrow.bmp b/dll/win32/user32/resources/obm_old_rgarrow.bmp new file mode 100644 index 00000000000..0c05d811730 Binary files /dev/null and b/dll/win32/user32/resources/obm_old_rgarrow.bmp differ diff --git a/dll/win32/user32/resources/obm_old_uparrow.bmp b/dll/win32/user32/resources/obm_old_uparrow.bmp new file mode 100644 index 00000000000..299fadb47a0 Binary files /dev/null and b/dll/win32/user32/resources/obm_old_uparrow.bmp differ diff --git a/dll/win32/user32/resources/obm_old_zoom.bmp b/dll/win32/user32/resources/obm_old_zoom.bmp new file mode 100644 index 00000000000..c1b4eb68b88 Binary files /dev/null and b/dll/win32/user32/resources/obm_old_zoom.bmp differ diff --git a/dll/win32/user32/resources/obm_reduce.bmp b/dll/win32/user32/resources/obm_reduce.bmp new file mode 100644 index 00000000000..d0dbf01a44a Binary files /dev/null and b/dll/win32/user32/resources/obm_reduce.bmp differ diff --git a/dll/win32/user32/resources/obm_reduced.bmp b/dll/win32/user32/resources/obm_reduced.bmp new file mode 100644 index 00000000000..c39f8e9505a Binary files /dev/null and b/dll/win32/user32/resources/obm_reduced.bmp differ diff --git a/dll/win32/user32/resources/obm_restore.bmp b/dll/win32/user32/resources/obm_restore.bmp new file mode 100644 index 00000000000..a22d3ddff44 Binary files /dev/null and b/dll/win32/user32/resources/obm_restore.bmp differ diff --git a/dll/win32/user32/resources/obm_restored.bmp b/dll/win32/user32/resources/obm_restored.bmp new file mode 100644 index 00000000000..6958dc2ca15 Binary files /dev/null and b/dll/win32/user32/resources/obm_restored.bmp differ diff --git a/dll/win32/user32/resources/obm_rgarrow.bmp b/dll/win32/user32/resources/obm_rgarrow.bmp new file mode 100644 index 00000000000..75cc1ff5308 Binary files /dev/null and b/dll/win32/user32/resources/obm_rgarrow.bmp differ diff --git a/dll/win32/user32/resources/obm_rgarrowd.bmp b/dll/win32/user32/resources/obm_rgarrowd.bmp new file mode 100644 index 00000000000..abf3f7c99f2 Binary files /dev/null and b/dll/win32/user32/resources/obm_rgarrowd.bmp differ diff --git a/dll/win32/user32/resources/obm_rgarrowi.bmp b/dll/win32/user32/resources/obm_rgarrowi.bmp new file mode 100644 index 00000000000..a90b836a739 Binary files /dev/null and b/dll/win32/user32/resources/obm_rgarrowi.bmp differ diff --git a/dll/win32/user32/resources/obm_size.bmp b/dll/win32/user32/resources/obm_size.bmp new file mode 100644 index 00000000000..d4eedf965f3 Binary files /dev/null and b/dll/win32/user32/resources/obm_size.bmp differ diff --git a/dll/win32/user32/resources/obm_trtype.bmp b/dll/win32/user32/resources/obm_trtype.bmp new file mode 100644 index 00000000000..da41d3233f1 Binary files /dev/null and b/dll/win32/user32/resources/obm_trtype.bmp differ diff --git a/dll/win32/user32/resources/obm_uparrow.bmp b/dll/win32/user32/resources/obm_uparrow.bmp new file mode 100644 index 00000000000..ce3aa0e29ae Binary files /dev/null and b/dll/win32/user32/resources/obm_uparrow.bmp differ diff --git a/dll/win32/user32/resources/obm_uparrowd.bmp b/dll/win32/user32/resources/obm_uparrowd.bmp new file mode 100644 index 00000000000..872dc323044 Binary files /dev/null and b/dll/win32/user32/resources/obm_uparrowd.bmp differ diff --git a/dll/win32/user32/resources/obm_uparrowi.bmp b/dll/win32/user32/resources/obm_uparrowi.bmp new file mode 100644 index 00000000000..6abb8106366 Binary files /dev/null and b/dll/win32/user32/resources/obm_uparrowi.bmp differ diff --git a/dll/win32/user32/resources/obm_zoom.bmp b/dll/win32/user32/resources/obm_zoom.bmp new file mode 100644 index 00000000000..a3838ebaea1 Binary files /dev/null and b/dll/win32/user32/resources/obm_zoom.bmp differ diff --git a/dll/win32/user32/resources/obm_zoomd.bmp b/dll/win32/user32/resources/obm_zoomd.bmp new file mode 100644 index 00000000000..649958db0c3 Binary files /dev/null and b/dll/win32/user32/resources/obm_zoomd.bmp differ diff --git a/dll/win32/user32/user32.rc b/dll/win32/user32/user32.rc index 79b9ac45e2f..40e4bbe04df 100644 --- a/dll/win32/user32/user32.rc +++ b/dll/win32/user32/user32.rc @@ -38,34 +38,34 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL 116 CURSOR "resources/ocr_cdautostart.cur" /* Compatible cursor resources (will be removed) */ -32512 CURSOR "resources/ocr_normal.cur" -32513 CURSOR "resources/ocr_ibeam.cur" -32514 CURSOR "resources/ocr_wait.cur" -32515 CURSOR "resources/ocr_cross.cur" -32516 CURSOR "resources/ocr_up.cur" -32642 CURSOR "resources/ocr_sizenwse.cur" -32643 CURSOR "resources/ocr_sizenesw.cur" -32644 CURSOR "resources/ocr_sizewe.cur" -32645 CURSOR "resources/ocr_sizens.cur" -32646 CURSOR "resources/ocr_sizeall.cur" -32648 CURSOR "resources/ocr_no.cur" -32650 CURSOR "resources/ocr_appstarting.cur" -32651 CURSOR "resources/ocr_help.cur" -32640 CURSOR "resources/ocr_size.cur" -32641 CURSOR "resources/ocr_icon.cur" -32649 CURSOR "resources/ocr_hand.cur" +OCR_NORMAL CURSOR "resources/ocr_normal.cur" +OCR_IBEAM CURSOR "resources/ocr_ibeam.cur" +OCR_WAIT CURSOR "resources/ocr_wait.cur" +OCR_CROSS CURSOR "resources/ocr_cross.cur" +OCR_UP CURSOR "resources/ocr_up.cur" +OCR_SIZENWSE CURSOR "resources/ocr_sizenwse.cur" +OCR_SIZENESW CURSOR "resources/ocr_sizenesw.cur" +OCR_SIZEWE CURSOR "resources/ocr_sizewe.cur" +OCR_SIZENS CURSOR "resources/ocr_sizens.cur" +OCR_SIZEALL CURSOR "resources/ocr_sizeall.cur" +OCR_NO CURSOR "resources/ocr_no.cur" +OCR_APPSTARTING CURSOR "resources/ocr_appstarting.cur" +OCR_HELP CURSOR "resources/ocr_help.cur" +OCR_SIZE CURSOR "resources/ocr_size.cur" +OCR_ICON CURSOR "resources/ocr_icon.cur" +OCR_HAND CURSOR "resources/ocr_hand.cur" ///////////////////////////////////////////////////////////////////////////// // // Icons // -32512 ICON "resources/oic_sample.ico" -32513 ICON "resources/oic_hand.ico" -32514 ICON "resources/oic_ques.ico" -32515 ICON "resources/oic_bang.ico" -32516 ICON "resources/oic_note.ico" -32517 ICON "resources/oic_reactos.ico" +OIC_SAMPLE ICON "resources/oic_sample.ico" +OIC_HAND ICON "resources/oic_hand.ico" +OIC_QUES ICON "resources/oic_ques.ico" +OIC_BANG ICON "resources/oic_bang.ico" +OIC_NOTE ICON "resources/oic_note.ico" +OIC_WINLOGO ICON "resources/oic_reactos.ico" ///////////////////////////////////////////////////////////////////////////// // @@ -76,6 +76,37 @@ OBM_CHECKBOXES BITMAP "resources/obm_checkboxes.bmp" OBM_CLOSE BITMAP "resources/obm_close.bmp" OBM_COMBO BITMAP "resources/obm_combo.bmp" OBM_MNARROW BITMAP "resources/obm_mnarrow.bmp" +OBM_TRTYPE BITMAP "resources/obm_trtype.bmp" +OBM_LFARROWI BITMAP "resources/obm_lfarrowi.bmp" +OBM_RGARROWI BITMAP "resources/obm_rgarrowi.bmp" +OBM_DNARROWI BITMAP "resources/obm_dnarrowi.bmp" +OBM_UPARROWI BITMAP "resources/obm_uparrowi.bmp" +OBM_LFARROWD BITMAP "resources/obm_lfarrowd.bmp" +OBM_RGARROWD BITMAP "resources/obm_rgarrowd.bmp" +OBM_DNARROWD BITMAP "resources/obm_dnarrowd.bmp" +OBM_UPARROWD BITMAP "resources/obm_uparrowd.bmp" +OBM_RESTORED BITMAP "resources/obm_restored.bmp" +OBM_ZOOMD BITMAP "resources/obm_zoomd.bmp" +OBM_REDUCED BITMAP "resources/obm_reduced.bmp" +OBM_RESTORE BITMAP "resources/obm_restore.bmp" +OBM_ZOOM BITMAP "resources/obm_zoom.bmp" +OBM_REDUCE BITMAP "resources/obm_reduce.bmp" +OBM_LFARROW BITMAP "resources/obm_lfarrow.bmp" +OBM_RGARROW BITMAP "resources/obm_rgarrow.bmp" +OBM_DNARROW BITMAP "resources/obm_dnarrow.bmp" +OBM_UPARROW BITMAP "resources/obm_uparrow.bmp" +OBM_OLD_RESTORE BITMAP "resources/obm_old_restore.bmp" +OBM_OLD_ZOOM BITMAP "resources/obm_old_zoom.bmp" +OBM_OLD_REDUCE BITMAP "resources/obm_old_reduce.bmp" +OBM_BTNCORNERS BITMAP "resources/obm_btncorners.bmp" +OBM_CHECK BITMAP "resources/obm_check.bmp" +OBM_BTSIZE BITMAP "resources/obm_btsize.bmp" +OBM_OLD_LFARROW BITMAP "resources/obm_old_lfarrow.bmp" +OBM_OLD_RGARROW BITMAP "resources/obm_old_rgarrow.bmp" +OBM_OLD_DNARROW BITMAP "resources/obm_old_dnarrow.bmp" +OBM_OLD_UPARROW BITMAP "resources/obm_old_uparrow.bmp" +OBM_SIZE BITMAP "resources/obm_size.bmp" +OBM_OLD_CLOSE BITMAP "resources/obm_old_close.bmp" ///////////////////////////////////////////////////////////////////////////// // diff --git a/dll/win32/user32/windows/defwnd.c b/dll/win32/user32/windows/defwnd.c index 774b74552ca..edee49dac73 100644 --- a/dll/win32/user32/windows/defwnd.c +++ b/dll/win32/user32/windows/defwnd.c @@ -1189,7 +1189,7 @@ User32DefWindowProc(HWND hWnd, case WM_SYSCOLORCHANGE: { /* force to redraw non-client area */ - DefWndNCPaint(hWnd, (HRGN)1, -1); + DefWndNCPaint(hWnd, HRGN_WINDOW, -1); /* Use InvalidateRect to redraw client area, enable * erase to redraw all subcontrols otherwise send the * WM_SYSCOLORCHANGE to child windows/controls is required @@ -1966,7 +1966,7 @@ RealDefWindowProcA(HWND hWnd, if ((GetWindowLongPtrW(hWnd, GWL_STYLE) & WS_CAPTION) == WS_CAPTION) { - DefWndNCPaint(hWnd, (HRGN)1, -1); + DefWndNCPaint(hWnd, HRGN_WINDOW, -1); } Result = 1; break; @@ -2112,7 +2112,7 @@ RealDefWindowProcW(HWND hWnd, if ((GetWindowLongPtrW(hWnd, GWL_STYLE) & WS_CAPTION) == WS_CAPTION) { - DefWndNCPaint(hWnd, (HRGN)1, -1); + DefWndNCPaint(hWnd, HRGN_WINDOW, -1); } Result = 1; break; diff --git a/dll/win32/user32/windows/input.c b/dll/win32/user32/windows/input.c index 08e457bf5a1..63f266eb492 100644 --- a/dll/win32/user32/windows/input.c +++ b/dll/win32/user32/windows/input.c @@ -48,9 +48,8 @@ DragDetect( HWND hWnd, POINT pt) { -#if 0 return NtUserDragDetect(hWnd, pt); -#else +#if 0 MSG msg; RECT rect; POINT tmp; diff --git a/dll/win32/user32/windows/menu.c b/dll/win32/user32/windows/menu.c index 04fefbd253f..bbc24c7db52 100644 --- a/dll/win32/user32/windows/menu.c +++ b/dll/win32/user32/windows/menu.c @@ -4068,13 +4068,9 @@ DrawMenuBar(HWND hWnd) MenuGetRosMenuInfo(&MenuInfo, hMenu); MenuInfo.Height = 0; // make sure to recalc size MenuSetRosMenuInfo(&MenuInfo); - /* The wine method doesn't work and I suspect it's more effort - then hackfix solution + SetWindowPos( hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_FRAMECHANGED ); - return TRUE;*/ - // FIXME: hackfix - DefWndNCPaint(hWnd,(HRGN)-1,-1); return TRUE; } diff --git a/dll/win32/user32/windows/message.c b/dll/win32/user32/windows/message.c index df82ac37049..f00e6670a00 100644 --- a/dll/win32/user32/windows/message.c +++ b/dll/win32/user32/windows/message.c @@ -296,26 +296,6 @@ MsgiKMToUMMessage(PMSG KMMsg, PMSG UMMsg) } break; - case WM_MDICREATE: - { - MDICREATESTRUCTW *mCs = (MDICREATESTRUCTW *) KMMsg->lParam; - PCHAR Class; - mCs->szTitle = (LPCWSTR) ((PCHAR) mCs + (DWORD_PTR) mCs->szTitle); - Class = (PCHAR) mCs + (DWORD_PTR) mCs->szClass; - if (L'A' == *((WCHAR *) Class)) - { - Class += sizeof(WCHAR); - mCs->szClass = (LPCWSTR)(DWORD_PTR) (*((ATOM *) Class)); - } - else - { - ASSERT(L'S' == *((WCHAR *) Class)); - Class += sizeof(WCHAR); - mCs->szClass = (LPCWSTR) Class; - } - } - break; - case WM_DDE_ACK: { PKMDDELPARAM DdeLparam = (PKMDDELPARAM) KMMsg->lParam; diff --git a/dll/win32/user32/windows/messagebox.c b/dll/win32/user32/windows/messagebox.c index 7ea0b9016e2..3809f590790 100644 --- a/dll/win32/user32/windows/messagebox.c +++ b/dll/win32/user32/windows/messagebox.c @@ -890,36 +890,7 @@ BOOL WINAPI MessageBeep(UINT uType) { -#if 0 - LPWSTR EventName; - - switch(uType) - { - case 0xFFFFFFFF: - if(waveOutGetNumDevs() == 0) - return Beep(500, 100); // Beep through speaker - /* fall through */ - case MB_OK: - EventName = L"SystemDefault"; - break; - case MB_ICONASTERISK: - EventName = L"SystemAsterisk"; - break; - case MB_ICONEXCLAMATION: - EventName = L"SystemExclamation"; - break; - case MB_ICONHAND: - EventName = L"SystemHand"; - break; - case MB_ICONQUESTION: - EventName = L"SystemQuestion"; - break; - } - - return PlaySoundW((LPCWSTR)EventName, NULL, SND_ALIAS | SND_NOWAIT | SND_NOSTOP | SND_ASYNC); -#else - return Beep(500, 100); // Beep through speaker -#endif + return (BOOL)NtUserCallOneParam(uType, ONEPARAM_ROUTINE_MESSAGEBEEP); } diff --git a/dll/win32/user32/windows/nonclient.c b/dll/win32/user32/windows/nonclient.c index b9df4425149..1d825b978df 100644 --- a/dll/win32/user32/windows/nonclient.c +++ b/dll/win32/user32/windows/nonclient.c @@ -489,7 +489,8 @@ DefWndNCPaint(HWND hWnd, HRGN hRgn, BOOL Active) } ReleaseDC(hWnd, hDC); - DeleteObject(hRgn); // We use DCX_KEEPCLIPRGN + if (hRgn != HRGN_WINDOW) + DeleteObject(hRgn); // We use DCX_KEEPCLIPRGN return 0; } @@ -650,7 +651,7 @@ DefWndNCCalcSize(HWND hWnd, BOOL CalcSizeStruct, RECT *Rect) LRESULT DefWndNCActivate(HWND hWnd, WPARAM wParam) { - DefWndNCPaint(hWnd, (HRGN)1, wParam); + DefWndNCPaint(hWnd, HRGN_WINDOW, wParam); return TRUE; } diff --git a/dll/win32/user32/windows/paint.c b/dll/win32/user32/windows/paint.c index 982cc5cfb06..433577eedf5 100644 --- a/dll/win32/user32/windows/paint.c +++ b/dll/win32/user32/windows/paint.c @@ -278,9 +278,9 @@ GetWindowRgn( pWnd = ValidateHwnd(hWnd); - if (!pWnd) // || !pwnd->hrgnClip || pwnd->state2 & WNDS2_MAXIMIZEDMONITORREGION) + if (!pWnd || !pWnd->hrgnClip || pWnd->state2 & WNDS2_MAXIMIZEDMONITORREGION) return ERROR; -/* + Ret = CombineRgn(hRgn, pWnd->hrgnClip, NULL, RGN_COPY); if (!Ret) @@ -291,8 +291,6 @@ GetWindowRgn( if (pWnd->ExStyle & WS_EX_LAYOUTRTL) MirrorRgn(hWnd, hRgn); -*/ - Ret = (int)NtUserCallTwoParam((DWORD_PTR)hWnd, (DWORD_PTR)hRgn, TWOPARAM_ROUTINE_GETWINDOWRGN); return Ret; } @@ -314,21 +312,19 @@ GetWindowRgnBox( pWnd = ValidateHwnd(hWnd); - if (!pWnd) // || !pwnd->hrgnClip || pwnd->state2 & WNDS2_MAXIMIZEDMONITORREGION) + if (!pWnd || !pWnd->hrgnClip || pWnd->state2 & WNDS2_MAXIMIZEDMONITORREGION) return ERROR; -/* + Ret = GetRgnBox(pWnd->hrgnClip, lprc); if (!Ret) return ERROR; if (pWnd->fnid != FNID_DESKTOP) - Ret = OffsetRect(lprc, -pWnd->rcWindow.left, -pWnd->rcWindow.top); + OffsetRect(lprc, -pWnd->rcWindow.left, -pWnd->rcWindow.top); if (pWnd->ExStyle & WS_EX_LAYOUTRTL) MirrorWindowRect(pWnd, lprc); -*/ - Ret = (int)NtUserCallTwoParam((DWORD_PTR)hWnd, (DWORD_PTR)lprc, TWOPARAM_ROUTINE_GETWINDOWRGNBOX); return Ret; } diff --git a/dll/win32/user32/windows/window.c b/dll/win32/user32/windows/window.c index d2a7bb9ee97..2025d815617 100644 --- a/dll/win32/user32/windows/window.c +++ b/dll/win32/user32/windows/window.c @@ -1727,7 +1727,7 @@ SetWindowTextA(HWND hWnd, if ((GetWindowLongPtrW(hWnd, GWL_STYLE) & WS_CAPTION) == WS_CAPTION) { - DefWndNCPaint(hWnd, (HRGN)1, -1); + DefWndNCPaint(hWnd, HRGN_WINDOW, -1); } return TRUE; } @@ -1757,7 +1757,7 @@ SetWindowTextW(HWND hWnd, if ((GetWindowLongPtrW(hWnd, GWL_STYLE) & WS_CAPTION) == WS_CAPTION) { - DefWndNCPaint(hWnd, (HRGN)1, -1); + DefWndNCPaint(hWnd, HRGN_WINDOW, -1); } return TRUE; } diff --git a/dll/win32/wdmaud.drv/legacy.c b/dll/win32/wdmaud.drv/legacy.c index 0c05fabbb0e..90a00b4f8dc 100644 --- a/dll/win32/wdmaud.drv/legacy.c +++ b/dll/win32/wdmaud.drv/legacy.c @@ -250,7 +250,9 @@ WdmAudGetCapabilitiesByLegacy( } MMRESULT -WdmAudOpenSoundDeviceByLegacy() +WdmAudOpenSoundDeviceByLegacy( + IN PSOUND_DEVICE SoundDevice, + OUT PVOID *Handle) { /* Only open this if it's not already open */ if ( KernelHandle == INVALID_HANDLE_VALUE ) @@ -476,7 +478,7 @@ WdmAudSetWaveDeviceFormatByLegacy( DeviceInfo.u.WaveFormatEx.nSamplesPerSec = WaveFormat->nSamplesPerSec; DeviceInfo.u.WaveFormatEx.nBlockAlign = WaveFormat->nBlockAlign; DeviceInfo.u.WaveFormatEx.nAvgBytesPerSec = WaveFormat->nAvgBytesPerSec; - DeviceInfo.u.WaveFormatEx.wBitsPerSample = WaveFormat->wBitsPerSample; + DeviceInfo.u.WaveFormatEx.wBitsPerSample = (DeviceInfo.u.WaveFormatEx.nAvgBytesPerSec * 8) / (DeviceInfo.u.WaveFormatEx.nSamplesPerSec * DeviceInfo.u.WaveFormatEx.nChannels); #endif Result = SyncOverlappedDeviceIoControl(KernelHandle, @@ -492,14 +494,19 @@ WdmAudSetWaveDeviceFormatByLegacy( return TranslateInternalMmResult(Result); } - /* Store format */ - Instance->WaveFormatEx.cbSize = WaveFormat->cbSize; - Instance->WaveFormatEx.wFormatTag = WaveFormat->wFormatTag; - Instance->WaveFormatEx.nChannels = WaveFormat->nChannels; - Instance->WaveFormatEx.nSamplesPerSec = WaveFormat->nSamplesPerSec; - Instance->WaveFormatEx.nBlockAlign = WaveFormat->nBlockAlign; - Instance->WaveFormatEx.nAvgBytesPerSec = WaveFormat->nAvgBytesPerSec; - Instance->WaveFormatEx.wBitsPerSample = WaveFormat->wBitsPerSample; + if (WaveFormatSize >= sizeof(WAVEFORMAT)) + { + /* Store format */ + Instance->WaveFormatEx.wFormatTag = WaveFormat->wFormatTag; + Instance->WaveFormatEx.nChannels = WaveFormat->nChannels; + Instance->WaveFormatEx.nSamplesPerSec = WaveFormat->nSamplesPerSec; + Instance->WaveFormatEx.nBlockAlign = WaveFormat->nBlockAlign; + Instance->WaveFormatEx.nAvgBytesPerSec = WaveFormat->nAvgBytesPerSec; + } + + /* store details */ + Instance->WaveFormatEx.cbSize = sizeof(WAVEFORMATEX); + Instance->WaveFormatEx.wBitsPerSample = (DeviceInfo.u.WaveFormatEx.nAvgBytesPerSec * 8) / (DeviceInfo.u.WaveFormatEx.nSamplesPerSec * DeviceInfo.u.WaveFormatEx.nChannels); /* Store sound device handle instance handle */ Instance->Handle = (PVOID)DeviceInfo.hDevice; @@ -528,18 +535,18 @@ WdmAudSetWaveDeviceFormatByLegacy( Instance->BufferCount = 100; } - if (DeviceType == WAVE_OUT_DEVICE_TYPE) - { - /* Now start the stream */ - DeviceInfo.u.State = KSSTATE_RUN; - SyncOverlappedDeviceIoControl(KernelHandle, - IOCTL_SETDEVICE_STATE, - (LPVOID) &DeviceInfo, - sizeof(WDMAUD_DEVICE_INFO), - (LPVOID) &DeviceInfo, - sizeof(WDMAUD_DEVICE_INFO), - NULL); - } + /* Now acquire resources */ + DeviceInfo.u.State = KSSTATE_ACQUIRE; + SyncOverlappedDeviceIoControl(KernelHandle, IOCTL_SETDEVICE_STATE, (LPVOID) &DeviceInfo, sizeof(WDMAUD_DEVICE_INFO), (LPVOID) &DeviceInfo, sizeof(WDMAUD_DEVICE_INFO), NULL); + + /* pause the pin */ + DeviceInfo.u.State = KSSTATE_PAUSE; + SyncOverlappedDeviceIoControl(KernelHandle, IOCTL_SETDEVICE_STATE, (LPVOID) &DeviceInfo, sizeof(WDMAUD_DEVICE_INFO), (LPVOID) &DeviceInfo, sizeof(WDMAUD_DEVICE_INFO), NULL); + + /* start the pin */ + DeviceInfo.u.State = KSSTATE_RUN; + SyncOverlappedDeviceIoControl(KernelHandle, IOCTL_SETDEVICE_STATE, (LPVOID) &DeviceInfo, sizeof(WDMAUD_DEVICE_INFO), (LPVOID) &DeviceInfo, sizeof(WDMAUD_DEVICE_INFO), NULL); + return MMSYSERR_NOERROR; } @@ -617,7 +624,7 @@ WdmAudCommitWaveBufferByLegacy( // create completion event - Overlap->Standard.hEvent = CreateEventW(NULL, FALSE, FALSE, NULL); + Overlap->Standard.hEvent = Handle = CreateEventW(NULL, FALSE, FALSE, NULL); if (Overlap->Standard.hEvent == NULL) { // no memory @@ -641,13 +648,11 @@ WdmAudCommitWaveBufferByLegacy( } // close event handle - CloseHandle(Overlap->Standard.hEvent); + CloseHandle(Handle); return MMSYSERR_NOERROR; } - - MMRESULT WdmAudSetWaveStateByLegacy( IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance, diff --git a/dll/win32/wdmaud.drv/wdmaud.h b/dll/win32/wdmaud.drv/wdmaud.h index 87936508798..1374cea1a98 100644 --- a/dll/win32/wdmaud.drv/wdmaud.h +++ b/dll/win32/wdmaud.drv/wdmaud.h @@ -15,19 +15,16 @@ #include BOOL -WdmAudInitUserModeMixer(); +WdmAudInitUserModeMixer(VOID); ULONG -WdmAudGetWaveOutCount(); +WdmAudGetWaveOutCount(VOID); ULONG -WdmAudGetWaveInCount(); +WdmAudGetWaveInCount(VOID); ULONG -WdmAudGetMixerCount(); - -MMRESULT -WdmAudOpenSoundDeviceByLegacy(); +WdmAudGetMixerCount(VOID); MMRESULT WdmAudGetNumWdmDevsByMMixer( @@ -150,12 +147,12 @@ WdmAudCommitWaveBufferByMMixer( IN LPOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine); MMRESULT -WdmAudCleanupByMMixer(); +WdmAudCleanupByMMixer(VOID); /* legacy.c */ MMRESULT -WdmAudCleanupByLegacy(); +WdmAudCleanupByLegacy(VOID); MMRESULT WdmAudGetCapabilitiesByLegacy( @@ -165,7 +162,10 @@ WdmAudGetCapabilitiesByLegacy( IN DWORD CapabilitiesSize); MMRESULT -WdmAudOpenSoundDeviceByLegacy(); +WdmAudOpenSoundDeviceByLegacy( + IN PSOUND_DEVICE SoundDevice, + OUT PVOID *Handle +); MMRESULT WdmAudCloseSoundDeviceByLegacy( diff --git a/dll/win32/wininet/CMakeLists.txt b/dll/win32/wininet/CMakeLists.txt index e0e5f3de2ae..8beeff2b603 100644 --- a/dll/win32/wininet/CMakeLists.txt +++ b/dll/win32/wininet/CMakeLists.txt @@ -1,10 +1,9 @@ -add_definitions(-D__WINESRC__ -D_WINE) -add_definitions(-Dclose=_close) +add_definitions( + -D__WINESRC__ -D_WINE + -Dclose=_close) -include_directories( - ${REACTOS_SOURCE_DIR}/include/reactos/wine - ${REACTOS_SOURCE_DIR}/lib/3rdparty/zlib) +include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine) spec2def(wininet.dll wininet.spec) @@ -30,10 +29,7 @@ add_library(wininet SHARED ${SOURCE}) set_module_type(wininet win32dll) -target_link_libraries(wininet - wine - zlib - ${PSEH_LIB}) +target_link_libraries(wininet wine ${PSEH_LIB}) add_importlibs(wininet mpr shlwapi shell32 user32 advapi32 secur32 crypt32 ws2_32 msvcrt kernel32 ntdll) diff --git a/dll/win32/wininet/urlcache.c b/dll/win32/wininet/urlcache.c index 2129f42e734..63a160d4a29 100644 --- a/dll/win32/wininet/urlcache.c +++ b/dll/win32/wininet/urlcache.c @@ -527,6 +527,7 @@ void URLCacheContainers_CreateDefaults(void) static const WCHAR HistoryPrefix[] = {'V','i','s','i','t','e','d',':',0}; static const WCHAR CookieSuffix[] = {0}; static const WCHAR CookiePrefix[] = {'C','o','o','k','i','e',':',0}; + static const WCHAR UserProfile[] = {'U','S','E','R','P','R','O','F','I','L','E',0}; static const struct { int nFolder; /* CSIDL_* constant */ @@ -540,6 +541,12 @@ void URLCacheContainers_CreateDefaults(void) }; DWORD i; + if (GetEnvironmentVariableW(UserProfile, NULL, 0) == 0 && GetLastError() == ERROR_ENVVAR_NOT_FOUND) + { + TRACE("Environment variable 'USERPROFILE' does not exist!\n"); + return; + } + for (i = 0; i < sizeof(DefaultContainerData) / sizeof(DefaultContainerData[0]); i++) { WCHAR wszCachePath[MAX_PATH]; diff --git a/dll/win32/ws2_32_new/inc/ws2_32p.h b/dll/win32/ws2_32_new/inc/ws2_32p.h index c3eb837b03b..c8d256ba351 100644 --- a/dll/win32/ws2_32_new/inc/ws2_32p.h +++ b/dll/win32/ws2_32_new/inc/ws2_32p.h @@ -858,14 +858,14 @@ WsAsyncGlobalInitialize(VOID); FORCEINLINE PWSPROCESS -WsGetProcess() +WsGetProcess(VOID) { return CurrentWsProcess; } FORCEINLINE DWORD -WsQuickProlog() +WsQuickProlog(VOID) { /* Try to see if we're initialized. If not, do the full prolog */ return WsGetProcess() ? ERROR_SUCCESS : WsSlowProlog(); diff --git a/drivers/filesystems/fastfat/create.c b/drivers/filesystems/fastfat/create.c index 514084ee3f1..1053413d945 100644 --- a/drivers/filesystems/fastfat/create.c +++ b/drivers/filesystems/fastfat/create.c @@ -433,7 +433,6 @@ VfatCreateFile ( PDEVICE_OBJECT DeviceObject, PIRP Irp ) NTSTATUS Status = STATUS_SUCCESS; PDEVICE_EXTENSION DeviceExt; ULONG RequestedDisposition, RequestedOptions; - PVFATCCB pCcb; PVFATFCB pFcb = NULL; PVFATFCB ParentFcb = NULL; PWCHAR c, last; @@ -468,9 +467,8 @@ VfatCreateFile ( PDEVICE_OBJECT DeviceObject, PIRP Irp ) if (FileObject->FileName.Length == 0 && (FileObject->RelatedFileObject == NULL || FileObject->RelatedFileObject->FsContext2 != NULL)) { - if (RequestedDisposition == FILE_CREATE || - RequestedDisposition == FILE_OVERWRITE_IF || - RequestedDisposition == FILE_SUPERSEDE) + if (RequestedDisposition != FILE_OPEN || + RequestedDisposition != FILE_OPEN_IF) { return(STATUS_ACCESS_DENIED); } @@ -481,16 +479,9 @@ VfatCreateFile ( PDEVICE_OBJECT DeviceObject, PIRP Irp ) return(STATUS_NOT_A_DIRECTORY); } #endif + pFcb = DeviceExt->VolumeFcb; - pCcb = ExAllocateFromNPagedLookasideList(&VfatGlobalData->CcbLookasideList); - if (pCcb == NULL) - { - return (STATUS_INSUFFICIENT_RESOURCES); - } - RtlZeroMemory(pCcb, sizeof(VFATCCB)); - FileObject->SectionObjectPointer = &pFcb->SectionObjectPointers; - FileObject->FsContext = pFcb; - FileObject->FsContext2 = pCcb; + vfatAttachFCBToFileObject(DeviceExt, pFcb, FileObject); pFcb->RefCount++; Irp->IoStatus.Information = FILE_OPENED; diff --git a/drivers/filesystems/fastfat/finfo.c b/drivers/filesystems/fastfat/finfo.c index 5b18261d6d9..cdadc87e4fa 100644 --- a/drivers/filesystems/fastfat/finfo.c +++ b/drivers/filesystems/fastfat/finfo.c @@ -156,43 +156,68 @@ VfatSetBasicInformation(PFILE_OBJECT FileObject, if (FCB->Flags & FCB_IS_FATX_ENTRY) { - FsdSystemTimeToDosDateTime(DeviceExt, - &BasicInfo->CreationTime, - &FCB->entry.FatX.CreationDate, - &FCB->entry.FatX.CreationTime); - FsdSystemTimeToDosDateTime(DeviceExt, - &BasicInfo->LastAccessTime, - &FCB->entry.FatX.AccessDate, - &FCB->entry.FatX.AccessTime); - FsdSystemTimeToDosDateTime(DeviceExt, - &BasicInfo->LastWriteTime, - &FCB->entry.FatX.UpdateDate, - &FCB->entry.FatX.UpdateTime); + if (BasicInfo->CreationTime.QuadPart != 0 && BasicInfo->CreationTime.QuadPart != -1) + { + FsdSystemTimeToDosDateTime(DeviceExt, + &BasicInfo->CreationTime, + &FCB->entry.FatX.CreationDate, + &FCB->entry.FatX.CreationTime); + } + + if (BasicInfo->LastAccessTime.QuadPart != 0 && BasicInfo->LastAccessTime.QuadPart != -1) + { + FsdSystemTimeToDosDateTime(DeviceExt, + &BasicInfo->LastAccessTime, + &FCB->entry.FatX.AccessDate, + &FCB->entry.FatX.AccessTime); + } + + if (BasicInfo->LastWriteTime.QuadPart != 0 && BasicInfo->LastWriteTime.QuadPart != -1) + { + FsdSystemTimeToDosDateTime(DeviceExt, + &BasicInfo->LastWriteTime, + &FCB->entry.FatX.UpdateDate, + &FCB->entry.FatX.UpdateTime); + } } else { - FsdSystemTimeToDosDateTime(DeviceExt, - &BasicInfo->CreationTime, - &FCB->entry.Fat.CreationDate, - &FCB->entry.Fat.CreationTime); - FsdSystemTimeToDosDateTime(DeviceExt, - &BasicInfo->LastAccessTime, - &FCB->entry.Fat.AccessDate, - NULL); - FsdSystemTimeToDosDateTime(DeviceExt, - &BasicInfo->LastWriteTime, - &FCB->entry.Fat.UpdateDate, - &FCB->entry.Fat.UpdateTime); + if (BasicInfo->CreationTime.QuadPart != 0 && BasicInfo->CreationTime.QuadPart != -1) + { + FsdSystemTimeToDosDateTime(DeviceExt, + &BasicInfo->CreationTime, + &FCB->entry.Fat.CreationDate, + &FCB->entry.Fat.CreationTime); + } + + if (BasicInfo->LastAccessTime.QuadPart != 0 && BasicInfo->LastAccessTime.QuadPart != -1) + { + FsdSystemTimeToDosDateTime(DeviceExt, + &BasicInfo->LastAccessTime, + &FCB->entry.Fat.AccessDate, + NULL); + } + + if (BasicInfo->LastWriteTime.QuadPart != 0 && BasicInfo->LastWriteTime.QuadPart != -1) + { + FsdSystemTimeToDosDateTime(DeviceExt, + &BasicInfo->LastWriteTime, + &FCB->entry.Fat.UpdateDate, + &FCB->entry.Fat.UpdateTime); + } } - *FCB->Attributes = (unsigned char)((*FCB->Attributes & - (FILE_ATTRIBUTE_DIRECTORY | 0x48)) | - (BasicInfo->FileAttributes & - (FILE_ATTRIBUTE_ARCHIVE | - FILE_ATTRIBUTE_SYSTEM | - FILE_ATTRIBUTE_HIDDEN | - FILE_ATTRIBUTE_READONLY))); - DPRINT("Setting attributes 0x%02x\n", *FCB->Attributes); + if (BasicInfo->FileAttributes) + { + *FCB->Attributes = (unsigned char)((*FCB->Attributes & + (FILE_ATTRIBUTE_DIRECTORY | 0x48)) | + (BasicInfo->FileAttributes & + (FILE_ATTRIBUTE_ARCHIVE | + FILE_ATTRIBUTE_SYSTEM | + FILE_ATTRIBUTE_HIDDEN | + FILE_ATTRIBUTE_READONLY))); + DPRINT("Setting attributes 0x%02x\n", *FCB->Attributes); + } VfatUpdateEntry(FCB); diff --git a/drivers/filesystems/fastfat_new/dir.c b/drivers/filesystems/fastfat_new/dir.c index 991971545bf..b1fb747ddad 100644 --- a/drivers/filesystems/fastfat_new/dir.c +++ b/drivers/filesystems/fastfat_new/dir.c @@ -248,7 +248,7 @@ FatiOpenExistingDcb(IN PFAT_IRP_CONTEXT IrpContext, } /* Set the file object */ - Ccb = FatCreateCcb(IrpContext); + Ccb = FatCreateCcb(); FatSetFileObject(FileObject, UserDirectoryOpen, Dcb, diff --git a/drivers/filesystems/npfs/fsctrl.c b/drivers/filesystems/npfs/fsctrl.c index decae593b86..e7085af0610 100644 --- a/drivers/filesystems/npfs/fsctrl.c +++ b/drivers/filesystems/npfs/fsctrl.c @@ -317,10 +317,106 @@ NpfsDisconnectPipe(PNPFS_CCB Ccb) return Status; } - static NTSTATUS NpfsWaitPipe(PIRP Irp, PNPFS_CCB Ccb) +{ + PLIST_ENTRY current_entry; + PNPFS_FCB Fcb; + PNPFS_CCB ServerCcb; + PFILE_PIPE_WAIT_FOR_BUFFER WaitPipe; + PLARGE_INTEGER TimeOut; + NTSTATUS Status; + PEXTENDED_IO_STACK_LOCATION IoStack; + PFILE_OBJECT FileObject; + PNPFS_VCB Vcb; + + IoStack = (PEXTENDED_IO_STACK_LOCATION)IoGetCurrentIrpStackLocation(Irp); + ASSERT(IoStack); + FileObject = IoStack->FileObject; + ASSERT(FileObject); + + DPRINT1("Waiting on Pipe %wZ\n", &FileObject->FileName); + + WaitPipe = (PFILE_PIPE_WAIT_FOR_BUFFER)Irp->AssociatedIrp.SystemBuffer; + + ASSERT(Ccb->Fcb); + ASSERT(Ccb->Fcb->Vcb); + + /* Get the VCB */ + Vcb = Ccb->Fcb->Vcb; + + /* Lock the pipe list */ + KeLockMutex(&Vcb->PipeListLock); + + /* File a pipe with the given name */ + Fcb = NpfsFindPipe(Vcb, + &FileObject->FileName); + + /* Unlock the pipe list */ + KeUnlockMutex(&Vcb->PipeListLock); + + /* Fail if not pipe was found */ + if (Fcb == NULL) + { + DPRINT1("No pipe found!\n", Fcb); + return STATUS_OBJECT_NAME_NOT_FOUND; + } + + /* search for listening server */ + current_entry = Fcb->ServerCcbListHead.Flink; + while (current_entry != &Fcb->ServerCcbListHead) + { + ServerCcb = CONTAINING_RECORD(current_entry, + NPFS_CCB, + CcbListEntry); + + if (ServerCcb->PipeState == FILE_PIPE_LISTENING_STATE) + { + /* found a listening server CCB */ + DPRINT("Listening server CCB found -- connecting\n"); + + return STATUS_SUCCESS; + } + + current_entry = current_entry->Flink; + } + + /* No listening server fcb found, so wait for one */ + + /* If a timeout specified */ + if (WaitPipe->TimeoutSpecified) + { + /* NMPWAIT_USE_DEFAULT_WAIT = 0 */ + if (WaitPipe->Timeout.QuadPart == 0) + { + TimeOut = &Fcb->TimeOut; + } + else + { + TimeOut = &WaitPipe->Timeout; + } + } + else + { + /* Wait forever */ + TimeOut = NULL; + } + + Status = KeWaitForSingleObject(&Ccb->ConnectEvent, + UserRequest, + KernelMode, + TRUE, + TimeOut); + + DPRINT("KeWaitForSingleObject() returned (Status %lx)\n", Status); + + return Status; +} + +NTSTATUS +NpfsWaitPipe2(PIRP Irp, + PNPFS_CCB Ccb) { PLIST_ENTRY current_entry; PNPFS_FCB Fcb; diff --git a/drivers/storage/ide/uniata/bm_devs.h b/drivers/storage/ide/uniata/bm_devs.h index dbcbfa91adc..672b22ae7fd 100644 --- a/drivers/storage/ide/uniata/bm_devs.h +++ b/drivers/storage/ide/uniata/bm_devs.h @@ -31,9 +31,12 @@ Revision History: --*/ -#define IDE_MAX_CHAN 8 +#define IDE_MAX_CHAN 16 +#define IDE_DEFAULT_MAX_CHAN 2 // Thanks to SATA Port Multipliers: -#define IDE_MAX_LUN_PER_CHAN 16 +//#define IDE_MAX_LUN_PER_CHAN SATA_MAX_PM_UNITS +#define IDE_MAX_LUN_PER_CHAN 2 + #define IDE_MAX_LUN (AHCI_MAX_PORT*IDE_MAX_LUN_PER_CHAN) #define MAX_QUEUE_STAT 8 @@ -113,6 +116,7 @@ typedef struct _BUSMASTER_CONTROLLER_INFORMATION { ULONG Isr2Vector; PKINTERRUPT Isr2InterruptObject; CHAR AltInitMasterDev; // 0xff - uninitialized, 0x00 - normal, 0x01 - change ISA to PCI + CHAR NeedAltInit; // 0x01 - try change ISA to PCI #endif }BUSMASTER_CONTROLLER_INFORMATION, *PBUSMASTER_CONTROLLER_INFORMATION; diff --git a/drivers/storage/ide/uniata/bsmaster.h b/drivers/storage/ide/uniata/bsmaster.h index 365f076d669..0626b2c590b 100644 --- a/drivers/storage/ide/uniata/bsmaster.h +++ b/drivers/storage/ide/uniata/bsmaster.h @@ -95,6 +95,8 @@ Revision History: #define AHCI_MAX_PORT 32 +#define SATA_MAX_PM_UNITS 16 + typedef struct _BUSMASTER_CTX { PBUSMASTER_CONTROLLER_INFORMATION* BMListPtr; ULONG* BMListLen; @@ -178,6 +180,7 @@ typedef struct _IDE_AHCI_REGISTERS { } CAP; #define AHCI_CAP_NOP_MASK 0x0000001f +#define AHCI_CAP_SPM 0x00010000 #define AHCI_CAP_S64A 0x80000000 // Global HBA Control @@ -793,7 +796,10 @@ typedef struct _HW_CHANNEL { // KIRQL QueueOldIrql; #endif struct _HW_DEVICE_EXTENSION* DeviceExtension; - struct _HW_LU_EXTENSION* lun[2]; + struct _HW_LU_EXTENSION* lun[IDE_MAX_LUN_PER_CHAN]; + + ULONG NumberLuns; + ULONG PmLunMap; // Double-buffering support PVOID DB_PRD; @@ -898,7 +904,8 @@ typedef struct _HW_LU_EXTENSION { // Controller-specific LUN options union { /* for tricky controllers, those can change Logical-to-Physical LUN mapping. - mainly for mapping SATA ports to compatible PATA registers */ + Treated as PHYSICAL port number, regardless of logical mapping. + */ ULONG SATA_lun_map; }; @@ -1493,6 +1500,14 @@ AtapiReadBuffer2( #define GET_LDEV2(P, T, L) (T | ((P)<<1)) #define GET_CDEV(Srb) (Srb->TargetId) +VOID +NTAPI +AtapiSetupLunPtrs( + IN PHW_CHANNEL chan, + IN PHW_DEVICE_EXTENSION deviceExtension, + IN ULONG c + ); +/* #define AtapiSetupLunPtrs(chan, deviceExtension, c) \ { \ chan->DeviceExtension = deviceExtension; \ @@ -1504,7 +1519,7 @@ AtapiReadBuffer2( chan->lun[0]->DeviceExtension = deviceExtension; \ chan->lun[1]->DeviceExtension = deviceExtension; \ } - +*/ BOOLEAN NTAPI AtapiReadChipConfig( diff --git a/drivers/storage/ide/uniata/id_ata.cpp b/drivers/storage/ide/uniata/id_ata.cpp index 70aaed34e67..07c44253e0e 100644 --- a/drivers/storage/ide/uniata/id_ata.cpp +++ b/drivers/storage/ide/uniata/id_ata.cpp @@ -2976,8 +2976,8 @@ ContinueSearch: kptr = KeyWord; while ((*cptr == *kptr) || - (*cptr <= 'Z' && *cptr + ('a' - 'A') == *kptr) || - (*cptr >= 'a' && *cptr - ('a' - 'A') == *kptr)) { + (*cptr >= 'A' && *cptr <= 'Z' && *cptr + ('a' - 'A') == *kptr) || + (*cptr >= 'a' && *cptr <= 'z' && *cptr - ('a' - 'A') == *kptr)) { cptr++; kptr++; @@ -8589,6 +8589,16 @@ DriverEntry( &hwInitializationData.comm, (PVOID)(i | (alt ? 0x80000000 : 0))); KdPrint2((PRINT_PREFIX "ScsiPortInitialize Status %#x\n", newStatus)); + if(newStatus == (ULONG)STATUS_DEVICE_DOES_NOT_EXIST && BMList[i].NeedAltInit) { + KdPrint2((PRINT_PREFIX "STATUS_DEVICE_DOES_NOT_EXIST, try workaround\n")); + hwInitializationData.comm.AdapterInterfaceType = Isa; + newStatus = ScsiPortInitialize(DriverObject, + Argument2, + &hwInitializationData.comm, + (PVOID)(i | 0x80000000)); + KdPrint2((PRINT_PREFIX "ScsiPortInitialize Status %#x (2)\n", newStatus)); + } + if (newStatus < statusToReturn) { statusToReturn = newStatus; } @@ -9090,7 +9100,7 @@ AtapiRegCheckParameterValue( status = RtlQueryRegistryValues(RTL_REGISTRY_ABSOLUTE /*| RTL_REGISTRY_OPTIONAL*/, paramPath.Buffer, parameters, NULL, NULL); - //KdPrint(( "AtapiCheckRegValue: %ws -> %ws is %#x\n", PathSuffix, Name, doRun)); + KdPrint(( "AtapiCheckRegValue: %ws -> %ws is %#x\n", PathSuffix, Name, doRun)); ExFreePool(paramPath.Buffer); diff --git a/drivers/storage/ide/uniata/id_init.cpp b/drivers/storage/ide/uniata/id_init.cpp index 526a60d2119..81265998761 100644 --- a/drivers/storage/ide/uniata/id_init.cpp +++ b/drivers/storage/ide/uniata/id_init.cpp @@ -68,6 +68,11 @@ UniataChipDetectChannels( deviceExtension->NumberChannels = 1; } + if(ChipFlags & (UNIATA_SATA | UNIATA_AHCI)) { + KdPrint2((PRINT_PREFIX "SATA/AHCI -> possible PM, max luns %d\n", SATA_MAX_PM_UNITS)); + //deviceExtension->NumberLuns = SATA_MAX_PM_UNITS; + } + switch(VendorID) { case ATA_ACER_LABS_ID: switch(deviceExtension->DevID) { @@ -102,8 +107,8 @@ UniataChipDetectChannels( case ATA_ATI_ID: KdPrint2((PRINT_PREFIX "ATI\n")); switch(deviceExtension->DevID) { - case 0x438c1002: - case 0x439c1002: + case ATA_ATI_IXP600: + case ATA_ATI_IXP700: /* IXP600 & IXP700 only have 1 PATA channel */ if(BMList[deviceExtension->DevIndex].channel) { KdPrint2((PRINT_PREFIX "New ATI no 2nd PATA chan\n")); @@ -142,6 +147,12 @@ UniataChipDetectChannels( deviceExtension->NumberChannels = 3; KdPrint2((PRINT_PREFIX "VIA 3 chan\n")); } + if(ChipFlags & VIASATA) { + /* 2 SATA without SATA registers on first channel + 1 PATA on second */ + // do nothing, generic PATA INIT + KdPrint2((PRINT_PREFIX "VIA SATA without SATA regs -> no PM\n")); + deviceExtension->NumberLuns = SATA_MAX_PM_UNITS; + } break; case ATA_ITE_ID: /* ITE ATA133 controller */ @@ -981,32 +992,14 @@ for_ugly_chips: IsPata = FALSE; if(ChipFlags & ICH5) { if ((tmp8 & 0x04) == 0) { - //ch->flags |= ATA_SATA; - //ch->flags |= ATA_NO_SLAVE; - //smap[0] = (map & 0x01) ^ ch->unit; - //smap[1] = 0; chan->ChannelCtrlFlags |= CTRFLAGS_NO_SLAVE; - chan->lun[0]->SATA_lun_map = (tmp8 & 0x01) ^ c; - chan->lun[1]->SATA_lun_map = 0; } else if ((tmp8 & 0x02) == 0) { - //ch->flags |= ATA_SATA; - //smap[0] = (map & 0x01) ? 1 : 0; - //smap[1] = (map & 0x01) ? 0 : 1; - if(c == 0) { - chan->lun[0]->SATA_lun_map = (tmp8 & 0x01) ? 1 : 0; - chan->lun[1]->SATA_lun_map = (tmp8 & 0x01) ? 0 : 1; - } else { + if(c != 0) { IsPata = TRUE; //chan->ChannelCtrlFlags |= CTRFLAGS_PATA; } } else if ((tmp8 & 0x02) != 0) { - //ch->flags |= ATA_SATA; - //smap[0] = (map & 0x01) ? 1 : 0; - //smap[1] = (map & 0x01) ? 0 : 1; - if(c == 1) { - chan->lun[0]->SATA_lun_map = (tmp8 & 0x01) ? 1 : 0; - chan->lun[1]->SATA_lun_map = (tmp8 & 0x01) ? 0 : 1; - } else { + if(c != 1) { IsPata = TRUE; //chan->ChannelCtrlFlags |= CTRFLAGS_PATA; } @@ -1014,28 +1007,16 @@ for_ugly_chips: } else if(ChipFlags & I6CH2) { chan->ChannelCtrlFlags |= CTRFLAGS_NO_SLAVE; - chan->lun[0]->SATA_lun_map = c ? 4 : 5; - chan->lun[1]->SATA_lun_map = 0; } else { switch(tmp8 & 0x03) { - case 0: - chan->lun[0]->SATA_lun_map = 0+c; - chan->lun[1]->SATA_lun_map = 2+c; - break; case 2: - if(c==0) { - chan->lun[0]->SATA_lun_map = 0; - chan->lun[1]->SATA_lun_map = 2; - } else { + if(c!=0) { // PATA IsPata = TRUE; } break; case 1: - if(c==1) { - chan->lun[0]->SATA_lun_map = 1; - chan->lun[1]->SATA_lun_map = 3; - } else { + if(c!=1) { // PATA IsPata = TRUE; } @@ -1045,9 +1026,11 @@ for_ugly_chips: if(IsPata) { chan->MaxTransferMode = min(deviceExtension->MaxTransferMode, ATA_UDMA5); + KdPrint2((PRINT_PREFIX "PATA part\n")); } else { if((ChipFlags & ICH5) && BaseMemAddress) { + KdPrint2((PRINT_PREFIX "ICH5 indexed\n")); chan->RegTranslation[IDX_INDEXED_ADDR].Addr = BaseMemAddress + 0; chan->RegTranslation[IDX_INDEXED_ADDR].MemIo = MemIo; chan->RegTranslation[IDX_INDEXED_DATA].Addr = BaseMemAddress + 4; @@ -1055,6 +1038,7 @@ for_ugly_chips: } if((ChipFlags & ICH5) || BaseMemAddress) { + KdPrint2((PRINT_PREFIX "i indexed\n")); // Rather interesting way of register access... ChipType = INTEL_IDX; deviceExtension->HwFlags &= ~CHIPTYPE_MASK; @@ -1085,6 +1069,10 @@ for_ugly_chips: } if(ChipFlags & UNIATA_AHCI) { + if(AtapiRegCheckDevValue(NULL, CHAN_NOT_SPECIFIED, DEVNUM_NOT_SPECIFIED, L"IgnoreAhci", 1)) { + KdPrint((" AHCI excluded\n")); + return STATUS_UNSUCCESSFUL; + } return UniataAhciInit(HwDeviceExtension) ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL; } @@ -1395,8 +1383,8 @@ UniAtaReadLunConfig( c = channel - deviceExtension->Channel; // logical channel chan = &deviceExtension->chan[c]; - ldev &= 0x01; - LunExt = &(deviceExtension->lun[c*2+ldev]); + ldev &= (deviceExtension->NumberLuns-1); + LunExt = &(deviceExtension->lun[c*deviceExtension->NumberLuns+ldev]); tmp32 = AtapiRegCheckDevValue(deviceExtension, channel, ldev, L"ReadCacheEnable", 1); LunExt->opt_ReadCacheEnable = tmp32 ? TRUE : FALSE; @@ -1441,6 +1429,7 @@ AtapiReadChipConfig( PHW_CHANNEL chan; ULONG tmp32; ULONG c; // logical channel (for Compatible Mode controllers) + ULONG i; KdPrint2((PRINT_PREFIX "AtapiReadChipConfig: devExt %#x\n", deviceExtension )); ASSERT(deviceExtension); @@ -1504,8 +1493,9 @@ AtapiReadChipConfig( tmp32 = AtapiRegCheckDevValue(deviceExtension, c, DEVNUM_NOT_SPECIFIED, L"ReorderEnable", TRUE); chan->UseReorder = tmp32 ? TRUE : FALSE; - UniAtaReadLunConfig(deviceExtension, channel, 0); - UniAtaReadLunConfig(deviceExtension, channel, 1); + for(i=0; iNumberLuns; i++) { + UniAtaReadLunConfig(deviceExtension, channel, i); + } } return TRUE; @@ -1656,25 +1646,104 @@ AtapiChipInit( } break; case ATA_INTEL_ID: { + BOOLEAN IsPata; USHORT reg54; + UCHAR tmp8; if(ChipFlags & UNIATA_SATA) { - if(ChipFlags & UNIATA_AHCI) + KdPrint2((PRINT_PREFIX "Intel SATA\n")); + if(ChipFlags & UNIATA_AHCI) { + KdPrint2((PRINT_PREFIX "Skip AHCI\n")); break; + } if(c == CHAN_NOT_SPECIFIED) { + KdPrint2((PRINT_PREFIX "Base init\n")); /* force all ports active "the legacy way" */ ChangePciConfig2(0x92, (a | 0x0f)); /* enable PCI interrupt */ ChangePciConfig2(/*PCIR_COMMAND*/0x04, (a & ~0x0400)); + } else { + + KdPrint2((PRINT_PREFIX "channel init\n")); + + GetPciConfig1(0x90, tmp8); + KdPrint2((PRINT_PREFIX "reg 90: %x, init lun map\n", tmp8)); + + KdPrint2((PRINT_PREFIX "chan %d\n", c)); + chan = &deviceExtension->chan[c]; + IsPata = FALSE; + if(ChipFlags & ICH5) { + KdPrint2((PRINT_PREFIX "ICH5\n")); + if ((tmp8 & 0x04) == 0) { + chan->ChannelCtrlFlags |= CTRFLAGS_NO_SLAVE; + chan->lun[0]->SATA_lun_map = (tmp8 & 0x01) ^ c; + chan->lun[1]->SATA_lun_map = 0; + } else if ((tmp8 & 0x02) == 0) { + if(c == 0) { + chan->lun[0]->SATA_lun_map = (tmp8 & 0x01) ? 1 : 0; + chan->lun[1]->SATA_lun_map = (tmp8 & 0x01) ? 0 : 1; + } else { + IsPata = TRUE; + //chan->ChannelCtrlFlags |= CTRFLAGS_PATA; + } + } else if ((tmp8 & 0x02) != 0) { + if(c == 1) { + chan->lun[0]->SATA_lun_map = (tmp8 & 0x01) ? 1 : 0; + chan->lun[1]->SATA_lun_map = (tmp8 & 0x01) ? 0 : 1; + } else { + IsPata = TRUE; + //chan->ChannelCtrlFlags |= CTRFLAGS_PATA; + } + } + } else + if(ChipFlags & I6CH2) { + KdPrint2((PRINT_PREFIX "I6CH2\n")); + chan->ChannelCtrlFlags |= CTRFLAGS_NO_SLAVE; + chan->lun[0]->SATA_lun_map = c ? 4 : 5; + chan->lun[1]->SATA_lun_map = 0; + } else { + KdPrint2((PRINT_PREFIX "other Intel\n")); + switch(tmp8 & 0x03) { + case 0: + chan->lun[0]->SATA_lun_map = 0+c; + chan->lun[1]->SATA_lun_map = 2+c; + break; + case 2: + if(c==0) { + chan->lun[0]->SATA_lun_map = 0; + chan->lun[1]->SATA_lun_map = 2; + } else { + // PATA + IsPata = TRUE; + } + break; + case 1: + if(c==1) { + chan->lun[0]->SATA_lun_map = 1; + chan->lun[1]->SATA_lun_map = 3; + } else { + // PATA + IsPata = TRUE; + } + break; + } + } + + if(IsPata) { + KdPrint2((PRINT_PREFIX "PATA part\n")); + chan->MaxTransferMode = min(deviceExtension->MaxTransferMode, ATA_UDMA5); + } + if(ChipType == INTEL_IDX) { - for(c=0; cNumberChannels; c++) { + KdPrint2((PRINT_PREFIX "i indexed\n")); + //for(c=0; cNumberChannels; c++) { chan = &deviceExtension->chan[c]; UniataSataWritePort4(chan, IDX_SATA_SError, 0xffffffff, 0); if(!(chan->ChannelCtrlFlags & CTRFLAGS_NO_SLAVE)) { UniataSataWritePort4(chan, IDX_SATA_SError, 0xffffffff, 1); } - } + //} } } @@ -2141,3 +2210,30 @@ UniataInitSyncBaseIO( RtlCopyMemory(&chan->RegTranslation[IDX_IO1_o], &chan->RegTranslation[IDX_IO1], IDX_IO1_SZ*sizeof(chan->RegTranslation[0])); RtlCopyMemory(&chan->RegTranslation[IDX_IO2_o], &chan->RegTranslation[IDX_IO2], IDX_IO2_SZ*sizeof(chan->RegTranslation[0])); } // end UniataInitSyncBaseIO() + +VOID +NTAPI +AtapiSetupLunPtrs( + IN PHW_CHANNEL chan, + IN PHW_DEVICE_EXTENSION deviceExtension, + IN ULONG c + ) +{ + ULONG i; + + if(!deviceExtension->NumberLuns) { + deviceExtension->NumberLuns = IDE_MAX_LUN_PER_CHAN; + } + chan->DeviceExtension = deviceExtension; + chan->lChannel = c; + chan->NumberLuns = deviceExtension->NumberLuns; + for(i=0; iNumberLuns; i++) { + chan->lun[i] = &(deviceExtension->lun[c*deviceExtension->NumberLuns+i]); + } + chan->AltRegMap = deviceExtension->AltRegMap; + chan->NextDpcChan = -1; + for(i=0; iNumberLuns; i++) { + chan->lun[i]->DeviceExtension = deviceExtension; + } +} // end AtapiSetupLunPtrs() + diff --git a/drivers/storage/ide/uniata/id_probe.cpp b/drivers/storage/ide/uniata/id_probe.cpp index 2752b2a6747..00eab9bec7b 100644 --- a/drivers/storage/ide/uniata/id_probe.cpp +++ b/drivers/storage/ide/uniata/id_probe.cpp @@ -145,6 +145,11 @@ AtapiGetIoRange( ScsiPortConvertUlongToPhysicalAddress(io_start); (*ConfigInfo->AccessRanges)[rid].RangeLength = length; } + if((pciData->u.type0.BaseAddresses[rid] & PCI_ADDRESS_IO_SPACE)) { + (*ConfigInfo->AccessRanges)[rid].RangeInMemory = FALSE; + } else { + (*ConfigInfo->AccessRanges)[rid].RangeInMemory = TRUE; + } } else { io_start = 0; } @@ -252,6 +257,7 @@ UniataEnumBusMasterController__( BOOLEAN found; BOOLEAN known; + BOOLEAN NeedPciAltInit; UCHAR IrqForCompat = 10; @@ -269,6 +275,7 @@ UniataEnumBusMasterController__( for(pass=0; pass<3; pass++) { for(busNumber=0 ;busNumberMasterDev = IsMasterDev(&pciData) ? 1 : 0; newBMListPtr->busNumber = busNumber; + newBMListPtr->NeedAltInit = NeedPciAltInit; newBMListPtr->Known = known; - KdPrint2((PRINT_PREFIX "Add to BMList\n")); + KdPrint2((PRINT_PREFIX "Add to BMList, AltInit %d\n", NeedPciAltInit)); } else { KdPrint2((PRINT_PREFIX "count: BMListLen++\n")); } @@ -812,12 +825,12 @@ UniataAllocateLunExt( } } - deviceExtension->lun = (PHW_LU_EXTENSION)ExAllocatePool(NonPagedPool, sizeof(HW_LU_EXTENSION) * (deviceExtension->NumberChannels+1) * IDE_MAX_LUN_PER_CHAN); + deviceExtension->lun = (PHW_LU_EXTENSION)ExAllocatePool(NonPagedPool, sizeof(HW_LU_EXTENSION) * (deviceExtension->NumberChannels+1) * deviceExtension->NumberLuns); if (!deviceExtension->lun) { KdPrint2((PRINT_PREFIX "!deviceExtension->lun => SP_RETURN_ERROR\n")); return FALSE; } - RtlZeroMemory(deviceExtension->lun, sizeof(HW_LU_EXTENSION) * (deviceExtension->NumberChannels+1) * IDE_MAX_LUN_PER_CHAN); + RtlZeroMemory(deviceExtension->lun, sizeof(HW_LU_EXTENSION) * (deviceExtension->NumberChannels+1) * deviceExtension->NumberLuns); deviceExtension->chan = (PHW_CHANNEL)ExAllocatePool(NonPagedPool, sizeof(HW_CHANNEL) * (deviceExtension->NumberChannels+1)); if (!deviceExtension->chan) { @@ -1025,7 +1038,8 @@ UniataFindBusMasterController( deviceExtension->SystemIoBusNumber = SystemIoBusNumber; deviceExtension->DevID = dev_id; deviceExtension->RevID = RevID; - deviceExtension->NumberChannels = 2; // default + deviceExtension->NumberChannels = IDE_DEFAULT_MAX_CHAN; // default + deviceExtension->NumberLuns = IDE_MAX_LUN_PER_CHAN; // default deviceExtension->DevIndex = i; _snprintf(deviceExtension->Signature, sizeof(deviceExtension->Signature), @@ -1266,9 +1280,9 @@ UniataFindBusMasterController( } if(simplexOnly && MasterDev) { - if(deviceExtension->NumberChannels < 2) { - KdPrint2((PRINT_PREFIX "set NumberChannels = 2\n")); - deviceExtension->NumberChannels = 2; + if(deviceExtension->NumberChannels < IDE_DEFAULT_MAX_CHAN) { + KdPrint2((PRINT_PREFIX "set NumberChannels = %d\n", IDE_DEFAULT_MAX_CHAN)); + deviceExtension->NumberChannels = IDE_DEFAULT_MAX_CHAN; if(BaseIoAddressBM_0) { UniataInitMapBM(deviceExtension, BaseIoAddressBM_0, @@ -1289,7 +1303,7 @@ UniataFindBusMasterController( KdPrint2((PRINT_PREFIX "set ConfigInfo->InitiatorBusId[0] = %#x\n", ConfigInfo->InitiatorBusId[0])); } // Indicate four devices can be attached to the adapter - ConfigInfo->MaximumNumberOfTargets = (UCHAR)(/*deviceExtension->NumberChannels **/ 2); + ConfigInfo->MaximumNumberOfTargets = (UCHAR)(deviceExtension->NumberLuns); if (MasterDev) { KdPrint2((PRINT_PREFIX "MasterDev (2)\n")); @@ -1461,6 +1475,15 @@ UniataFindBusMasterController( (*ConfigInfo->AccessRanges)[4].RangeStart = ScsiPortConvertUlongToPhysicalAddress(0); (*ConfigInfo->AccessRanges)[4].RangeLength = 0; } + } else + if(AltInit && + !(*ConfigInfo->AccessRanges)[channel * 2 + 0].RangeStart.QuadPart && + !(*ConfigInfo->AccessRanges)[channel * 2 + 1].RangeStart.QuadPart) { + KdPrint2((PRINT_PREFIX "cheat ScsiPort, sync real PCI and ConfigInfo IO ranges\n")); + AtapiGetIoRange(HwDeviceExtension, ConfigInfo, &pciData, SystemIoBusNumber, + channel * 2 + 0, 0, ATA_IOSIZE); + AtapiGetIoRange(HwDeviceExtension, ConfigInfo, &pciData, SystemIoBusNumber, + channel * 2 + 1, 0, ATA_ALTIOSIZE); } IoBasePort1 = (*ConfigInfo->AccessRanges)[channel * 2 + 0].RangeStart; @@ -1860,7 +1883,8 @@ UniataFindFakeBusMasterController( deviceExtension->SystemIoBusNumber = SystemIoBusNumber; deviceExtension->DevID = dev_id; deviceExtension->RevID = RevID; - deviceExtension->NumberChannels = 2; // default + deviceExtension->NumberChannels = IDE_DEFAULT_MAX_CHAN; // default + deviceExtension->NumberLuns = IDE_MAX_LUN_PER_CHAN; // default deviceExtension->DevIndex = i; _snprintf(deviceExtension->Signature, sizeof(deviceExtension->Signature), @@ -2291,6 +2315,7 @@ AtapiFindController( KdPrint2((PRINT_PREFIX " assume max PIO4\n")); deviceExtension->MaxTransferMode = ATA_PIO4; deviceExtension->NumberChannels = 1; + deviceExtension->NumberLuns = IDE_MAX_LUN_PER_CHAN; // default if(!UniataAllocateLunExt(deviceExtension, UNIATA_ALLOCATE_NEW_LUNS)) { goto exit_error; @@ -2525,7 +2550,7 @@ not_found: } ConfigInfo->NumberOfBuses = 1; - ConfigInfo->MaximumNumberOfTargets = 2; + ConfigInfo->MaximumNumberOfTargets = IDE_MAX_LUN_PER_CHAN; // Indicate maximum transfer length is 64k. ConfigInfo->MaximumTransferLength = 0x10000; @@ -2970,7 +2995,7 @@ FindDevices( // Clear expecting interrupt flag and current SRB field. chan->ExpectingInterrupt = FALSE; // chan->CurrentSrb = NULL; - max_ldev = (chan->ChannelCtrlFlags & CTRFLAGS_NO_SLAVE) ? 1 : 2; + max_ldev = (chan->ChannelCtrlFlags & CTRFLAGS_NO_SLAVE) ? 1 : IDE_MAX_LUN_PER_CHAN; KdPrint2((PRINT_PREFIX " max_ldev %d\n", max_ldev)); // Search for devices. diff --git a/drivers/storage/ide/uniata/id_sata.cpp b/drivers/storage/ide/uniata/id_sata.cpp index 96627dcb829..e73ac56280e 100644 --- a/drivers/storage/ide/uniata/id_sata.cpp +++ b/drivers/storage/ide/uniata/id_sata.cpp @@ -382,32 +382,64 @@ UniataAhciInit( ULONG BaseMemAddress; ULONG PI; ULONG CAP; + ULONG GHC; BOOLEAN MemIo; ULONGLONG base; /* reset AHCI controller */ - AtapiWritePortEx4(NULL, (ULONG_PTR)(&deviceExtension->BaseIoAHCI_0), IDX_AHCI_GHC, - AtapiReadPortEx4(NULL, (ULONG_PTR)(&deviceExtension->BaseIoAHCI_0), IDX_AHCI_GHC) | AHCI_GHC_HR); - AtapiStallExecution(1000000); - if(AtapiReadPortEx4(NULL, (ULONG_PTR)(&deviceExtension->BaseIoAHCI_0), IDX_AHCI_GHC) & AHCI_GHC_HR) { + GHC = AtapiReadPortEx4(NULL, (ULONG_PTR)&deviceExtension->BaseIoAHCI_0, IDX_AHCI_GHC); + KdPrint2((PRINT_PREFIX " reset AHCI controller, GHC %x\n", GHC)); + AtapiWritePortEx4(NULL, (ULONG_PTR)&deviceExtension->BaseIoAHCI_0, IDX_AHCI_GHC, + GHC | AHCI_GHC_HR); + + for(i=0; i<1000; i++) { + AtapiStallExecution(1000); + GHC = AtapiReadPortEx4(NULL, (ULONG_PTR)&deviceExtension->BaseIoAHCI_0, IDX_AHCI_GHC); + KdPrint2((PRINT_PREFIX " AHCI GHC %x\n", GHC)); + if(!(GHC & AHCI_GHC_HR)) { + break; + } + } + if(GHC & AHCI_GHC_HR) { KdPrint2((PRINT_PREFIX " AHCI reset failed\n")); return FALSE; } /* enable AHCI mode */ - AtapiWritePortEx4(NULL, (ULONG_PTR)(&deviceExtension->BaseIoAHCI_0), IDX_AHCI_GHC, - AtapiReadPortEx4(NULL, (ULONG_PTR)(&deviceExtension->BaseIoAHCI_0), IDX_AHCI_GHC) | AHCI_GHC_AE); + GHC = AtapiReadPortEx4(NULL, (ULONG_PTR)&deviceExtension->BaseIoAHCI_0, IDX_AHCI_GHC); + KdPrint2((PRINT_PREFIX " enable AHCI mode, GHC %x\n", GHC)); + AtapiWritePortEx4(NULL, (ULONG_PTR)&deviceExtension->BaseIoAHCI_0, IDX_AHCI_GHC, + GHC | AHCI_GHC_AE); + GHC = AtapiReadPortEx4(NULL, (ULONG_PTR)&deviceExtension->BaseIoAHCI_0, IDX_AHCI_GHC); + KdPrint2((PRINT_PREFIX " AHCI GHC %x\n", GHC)); + CAP = AtapiReadPortEx4(NULL, (ULONG_PTR)(&deviceExtension->BaseIoAHCI_0), IDX_AHCI_CAP); PI = AtapiReadPortEx4(NULL, (ULONG_PTR)(&deviceExtension->BaseIoAHCI_0), IDX_AHCI_PI); - /* get the number of HW channels */ - for(i=PI, n=0; i; n++, i=i>>1); - deviceExtension->NumberChannels = - max((CAP & AHCI_CAP_NOP_MASK)+1, n); + KdPrint2((PRINT_PREFIX " AHCI CAP %x\n", CAP)); if(CAP & AHCI_CAP_S64A) { KdPrint2((PRINT_PREFIX " AHCI 64bit\n")); deviceExtension->Host64 = TRUE; } + /* get the number of HW channels */ + PI = AtapiReadPortEx4(NULL, (ULONG)&deviceExtension->BaseIoAHCI_0, IDX_AHCI_PI); + KdPrint2((PRINT_PREFIX " AHCI PI %x\n", PI)); + for(i=PI, n=0; i; n++, i=i>>1); + deviceExtension->NumberChannels = + max((CAP & AHCI_CAP_NOP_MASK)+1, n); + + switch(deviceExtension->DevID) { + case ATA_M88SX6111: + deviceExtension->NumberChannels = 1; + break; + case ATA_M88SX6121: + deviceExtension->NumberChannels = 2; + break; + case ATA_M88SX6141: + case ATA_M88SX6145: + deviceExtension->NumberChannels = 4; + break; + } // switch() /* clear interrupts */ AtapiWritePortEx4(NULL, (ULONG_PTR)(&deviceExtension->BaseIoAHCI_0), IDX_AHCI_IS, @@ -418,10 +450,13 @@ UniataAhciInit( AtapiReadPortEx4(NULL, (ULONG_PTR)(&deviceExtension->BaseIoAHCI_0), IDX_AHCI_GHC) | AHCI_GHC_IE); version = AtapiReadPortEx4(NULL, (ULONG_PTR)(&deviceExtension->BaseIoAHCI_0), IDX_AHCI_VS); - KdPrint2((PRINT_PREFIX " AHCI version %x%x.%x%x controller with %d ports (mask %x) detected\n", - (version >> 24) & 0xff, (version >> 16) & 0xff, - (version >> 8) & 0xff, version & 0xff, deviceExtension->NumberChannels, PI)); + KdPrint2((PRINT_PREFIX " AHCI version %x.%02x controller with %d ports (mask %x) detected\n", + ((version >> 20) & 0xf0) + ((version >> 16) & 0x0f), + ((version >> 4) & 0xf0) + (version & 0x0f), + deviceExtension->NumberChannels, PI)); + KdPrint2((PRINT_PREFIX " PM%s supported\n", + CAP & AHCI_CAP_SPM ? "" : " not")); deviceExtension->HwFlags |= UNIATA_SATA; deviceExtension->HwFlags |= UNIATA_AHCI; diff --git a/drivers/storage/ide/uniata/uata_ctl.h b/drivers/storage/ide/uniata/uata_ctl.h index b199d2b8e51..560b1d87fad 100644 --- a/drivers/storage/ide/uniata/uata_ctl.h +++ b/drivers/storage/ide/uniata/uata_ctl.h @@ -43,9 +43,9 @@ extern "C" { #endif //__cplusplus #define AHCI_MAX_PORT 32 -#define IDE_MAX_CHAN 8 +#define IDE_MAX_CHAN 16 // Thanks to SATA Port Multipliers: -#define IDE_MAX_LUN_PER_CHAN 16 +#define IDE_MAX_LUN_PER_CHAN 2 #define IDE_MAX_LUN (AHCI_MAX_PORT*IDE_MAX_LUN_PER_CHAN) #define MAX_QUEUE_STAT 8 diff --git a/drivers/storage/ide/uniata/uniata_ver.h b/drivers/storage/ide/uniata/uniata_ver.h index 5cfcf462cc9..381ae7b73db 100644 --- a/drivers/storage/ide/uniata/uniata_ver.h +++ b/drivers/storage/ide/uniata/uniata_ver.h @@ -1,6 +1,6 @@ -#define UNIATA_VER_STR "40a1" -#define UNIATA_VER_DOT 0.40.1.1 -#define UNIATA_VER_DOT_COMMA 0,40,1,1 -#define UNIATA_VER_DOT_STR "0.40.1.1" +#define UNIATA_VER_STR "40a5" +#define UNIATA_VER_DOT 0.40.1.5 +#define UNIATA_VER_DOT_COMMA 0,40,1,5 +#define UNIATA_VER_DOT_STR "0.40.1.5" #define UNIATA_VER_YEAR 2010 #define UNIATA_VER_YEAR_STR "2010" diff --git a/drivers/wdm/audio/backpln/portcls/dma_slave.cpp b/drivers/wdm/audio/backpln/portcls/dma_slave.cpp index a68e25ea8ef..7aefa8e531f 100644 --- a/drivers/wdm/audio/backpln/portcls/dma_slave.cpp +++ b/drivers/wdm/audio/backpln/portcls/dma_slave.cpp @@ -194,6 +194,19 @@ CDmaChannelInit::MaximumBufferSize() return m_MaximumBufferSize; } +#ifdef _MSC_VER + +PHYSICAL_ADDRESS +NTAPI +CDmaChannelInit::PhysicalAddress() +{ + DPRINT("CDmaChannelInit_PhysicalAdress: this %p Virtuell %p Physical High %x Low %x%\n", this, m_Buffer, m_Address.HighPart, m_Address.LowPart); + + return m_Address; +} + +#else + PHYSICAL_ADDRESS NTAPI CDmaChannelInit::PhysicalAddress( @@ -208,6 +221,9 @@ CDmaChannelInit::PhysicalAddress( return Result; } + +#endif + VOID NTAPI CDmaChannelInit::SetBufferSize( diff --git a/drivers/wdm/audio/backpln/portcls/interfaces.hpp b/drivers/wdm/audio/backpln/portcls/interfaces.hpp index 9163a6a78d6..ce924174852 100644 --- a/drivers/wdm/audio/backpln/portcls/interfaces.hpp +++ b/drivers/wdm/audio/backpln/portcls/interfaces.hpp @@ -106,7 +106,7 @@ DEFINE_GUID(IID_IIrpTargetFactory, 0xB4C90A62, 0x5791, 0x11D0, 0xF9, 0x86, 0x00, IN PDEVICE_OBJECT DeviceObject, \ IN PIRP Irp)PURE; \ \ - STDMETHOD_(NTSTATUS, Close)(THIS_ \ + STDMETHOD_(NTSTATUS, Close)( \ IN PDEVICE_OBJECT DeviceObject, \ IN PIRP Irp)PURE; \ \ @@ -888,6 +888,38 @@ typedef IPortPinDMus *PPORTPINDMUS; ***************************************************************************** */ +#ifdef _MSC_VER + +#define IMP_IDmaChannelEx \ + STDMETHODIMP_(NTSTATUS) AllocateBuffer( \ + IN ULONG BufferSize, \ + IN PPHYSICAL_ADDRESS PhysicalAddressConstraint OPTIONAL); \ + \ + STDMETHODIMP_(void) FreeBuffer(void); \ + STDMETHODIMP_(ULONG) TransferCount(void); \ + STDMETHODIMP_(ULONG) MaximumBufferSize(void); \ + STDMETHODIMP_(ULONG) AllocatedBufferSize(void); \ + STDMETHODIMP_(ULONG) BufferSize(void); \ + \ + STDMETHODIMP_(void) SetBufferSize( \ + IN ULONG BufferSize); \ + \ + STDMETHODIMP_(PVOID) SystemAddress(void); \ + STDMETHODIMP_(PHYSICAL_ADDRESS) PhysicalAddress(); \ + STDMETHODIMP_(PADAPTER_OBJECT) GetAdapterObject(void); \ + \ + STDMETHODIMP_(void) CopyTo( \ + IN PVOID Destination, \ + IN PVOID Source, \ + IN ULONG ByteCount); \ + \ + STDMETHODIMP_(void) CopyFrom( \ + IN PVOID Destination, \ + IN PVOID Source, \ + IN ULONG ByteCount) + +#else + #define IMP_IDmaChannelEx \ STDMETHODIMP_(NTSTATUS) AllocateBuffer( \ IN ULONG BufferSize, \ @@ -917,6 +949,11 @@ typedef IPortPinDMus *PPORTPINDMUS; IN PVOID Source, \ IN ULONG ByteCount) + + +#endif + + #define IMP_IDmaChannelSlaveEx \ IMP_IDmaChannelEx; \ STDMETHODIMP_(NTSTATUS) Start( \ @@ -935,6 +972,37 @@ typedef IPortPinDMus *PPORTPINDMUS; IN PDEVICE_DESCRIPTION DeviceDescription, \ IN PDEVICE_OBJECT DeviceObject) +#ifdef _MSC_VER + +#define DEFINE_ABSTRACT_DMACHANNEL_EX() \ + STDMETHOD_(NTSTATUS, AllocateBuffer)( THIS_ \ + IN ULONG BufferSize, \ + IN PPHYSICAL_ADDRESS PhysicalAddressConstraint OPTIONAL) PURE; \ +\ + STDMETHOD_(void, FreeBuffer)( THIS ) PURE; \ + STDMETHOD_(ULONG, TransferCount)( THIS ) PURE; \ + STDMETHOD_(ULONG, MaximumBufferSize)( THIS ) PURE; \ + STDMETHOD_(ULONG, AllocatedBufferSize)( THIS ) PURE; \ + STDMETHOD_(ULONG, BufferSize)( THIS ) PURE; \ +\ + STDMETHOD_(void, SetBufferSize)( THIS_ \ + IN ULONG BufferSize) PURE; \ +\ + STDMETHOD_(PVOID, SystemAddress)( THIS ) PURE; \ + STDMETHOD_(PHYSICAL_ADDRESS, PhysicalAddress)( THIS) PURE; \ + STDMETHOD_(PADAPTER_OBJECT, GetAdapterObject)( THIS ) PURE; \ +\ + STDMETHOD_(void, CopyTo)( THIS_ \ + IN PVOID Destination, \ + IN PVOID Source, \ + IN ULONG ByteCount) PURE; \ +\ + STDMETHOD_(void, CopyFrom)( THIS_ \ + IN PVOID Destination, \ + IN PVOID Source, \ + IN ULONG ByteCount) PURE; +#else + #define DEFINE_ABSTRACT_DMACHANNEL_EX() \ STDMETHOD_(NTSTATUS, AllocateBuffer)( THIS_ \ IN ULONG BufferSize, \ @@ -964,6 +1032,7 @@ typedef IPortPinDMus *PPORTPINDMUS; IN PVOID Source, \ IN ULONG ByteCount) PURE; +#endif #undef INTERFACE #define INTERFACE IDmaChannelInit diff --git a/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp b/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp index 7733606c6a5..fd7fc9de6c7 100644 --- a/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp +++ b/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp @@ -823,7 +823,7 @@ CPortPinWaveCyclic::RequestService() PC_ASSERT_IRQL(DISPATCH_LEVEL); - if (m_State == KSSTATE_RUN) + if (m_State == KSSTATE_RUN && m_ResetState == KSRESET_END) { Status = m_Stream->GetPosition(&Position); @@ -904,13 +904,19 @@ CPortPinWaveCyclic::DeviceIoControl( /* check for success */ if (NT_SUCCESS(Status)) { + //determine state of reset request if (ResetValue == KSRESET_BEGIN) { - m_IrpQueue->CancelBuffers(); + // start reset procress + // incoming read/write requests will be rejected m_ResetState = KSRESET_BEGIN; + + // cancel existing buffers + m_IrpQueue->CancelBuffers(); } else if (ResetValue == KSRESET_END) { + // end of reset process m_ResetState = KSRESET_END; } } diff --git a/hal/halx86/generic/usage.c b/hal/halx86/generic/usage.c index 8339119c39a..099a9e79648 100644 --- a/hal/halx86/generic/usage.c +++ b/hal/halx86/generic/usage.c @@ -43,17 +43,17 @@ ADDRESS_USAGE HalpDefaultIoSpace = { NULL, CmResourceTypePort, IDT_INTERNAL, { - {0x2000, 0xC000}, /* Everything */ - {0xC000, 0x1000}, /* DMA 2 */ - {0x8000, 0x1000}, /* DMA 1 */ - {0x2000, 0x200}, /* PIC 1 */ - {0xA000, 0x200}, /* PIC 2 */ - {0x4000, 0x400}, /* PIT 1 */ - {0x4800, 0x400}, /* PIT 2 */ - {0x9200, 0x100}, /* System Control Port A */ - {0x7000, 0x200}, /* CMOS */ - {0xF000, 0x1000}, /* x87 Coprocessor */ - {0xCF800, 0x800}, /* PCI 0 */ + {0x00, 0x20}, /* DMA 1 */ + {0xC0, 0x20}, /* DMA 2 */ + {0x80, 0x10}, /* DMA EPAR */ + {0x20, 0x2}, /* PIC 1 */ + {0xA0, 0x2}, /* PIC 2 */ + {0x40, 0x4}, /* PIT 1 */ + {0x48, 0x4}, /* PIT 2 */ + {0x92, 0x1}, /* System Control Port A */ + {0x70, 0x2}, /* CMOS */ + {0xF0, 0x10}, /* x87 Coprocessor */ + {0xCF8, 0x8}, /* PCI 0 */ {0,0}, } }; diff --git a/include/crt/_mingw_mac.h b/include/crt/_mingw_mac.h index de7351943f8..a3890f4b243 100644 --- a/include/crt/_mingw_mac.h +++ b/include/crt/_mingw_mac.h @@ -116,19 +116,31 @@ #define __WINT_TYPE__ unsigned short #endif +#undef __MINGW_EXTENSION #if defined(__GNUC__) || defined(__GNUG__) #define __MINGW_EXTENSION __extension__ #else #define __MINGW_EXTENSION #endif -#ifdef UNICODE -# define __MINGW_NAME_AW(func) func##W -#else -# define __MINGW_NAME_AW(func) func##A +/* Special case nameless struct/union. */ +#ifndef __C89_NAMELESS +#define __C89_NAMELESS __MINGW_EXTENSION + +#define __C89_NAMELESSSTRUCTNAME +#define __C89_NAMELESSUNIONNAME #endif -#define __MINGW_TYPEDEF_AW(type) \ - typedef __MINGW_NAME_AW(type) type; + +#ifndef __GNU_EXTENSION +#define __GNU_EXTENSION __MINGW_EXTENSION +#endif + +/* MinGW-w64 has some additional C99 printf/scanf feature support. + So we add some helper macros to ease recognition of them. */ +#define __MINGW_HAVE_ANSI_C99_PRINTF 1 +#define __MINGW_HAVE_WIDE_C99_PRINTF 1 +#define __MINGW_HAVE_ANSI_C99_SCANF 1 +#define __MINGW_HAVE_WIDE_C99_SCANF 1 #endif /* _INC_CRTDEFS_MACRO */ diff --git a/include/crt/_mingw_unicode.h b/include/crt/_mingw_unicode.h new file mode 100644 index 00000000000..38334bc71e4 --- /dev/null +++ b/include/crt/_mingw_unicode.h @@ -0,0 +1,33 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER.PD within this package. + */ + +#if !defined(_INC_CRT_UNICODE_MACROS) +/* _INC_CRT_UNICODE_MACROS defined based on UNICODE flag */ + +#if defined(UNICODE) +# define _INC_CRT_UNICODE_MACROS 1 +# define __MINGW_NAME_AW(func) func##W +# define __MINGW_NAME_AW_EXT(func,ext) func##W##ext +# define __MINGW_NAME_UAW(func) func##_W +# define __MINGW_NAME_UAW_EXT(func,ext) func##_W_##ext +# define __MINGW_STRING_AW(str) L##str /* same as TEXT() from winnt.h */ +# define __MINGW_PROCNAMEEXT_AW "W" +#else +# define _INC_CRT_UNICODE_MACROS 2 +# define __MINGW_NAME_AW(func) func##A +# define __MINGW_NAME_AW_EXT(func,ext) func##A##ext +# define __MINGW_NAME_UAW(func) func##_A +# define __MINGW_NAME_UAW_EXT(func,ext) func##_A_##ext +# define __MINGW_STRING_AW(str) str /* same as TEXT() from winnt.h */ +# define __MINGW_PROCNAMEEXT_AW "A" +#endif + +#define __MINGW_TYPEDEF_AW(type) \ + typedef __MINGW_NAME_AW(type) type; +#define __MINGW_TYPEDEF_UAW(type) \ + typedef __MINGW_NAME_UAW(type) type; + +#endif /* !defined(_INC_CRT_UNICODE_MACROS) */ diff --git a/include/ddk/ioaccess.h b/include/ddk/ioaccess.h old mode 100755 new mode 100644 diff --git a/include/ddk/punknown.h b/include/ddk/punknown.h index 9b801f71e4e..29dae3c82bc 100644 --- a/include/ddk/punknown.h +++ b/include/ddk/punknown.h @@ -32,7 +32,7 @@ extern "C" { #define __IUnknown_INTERFACE_DEFINED__ DEFINE_GUID(IID_IUnknown, - 0x00000000, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46); + 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x46); #undef INTERFACE #define INTERFACE IUnknown diff --git a/include/ndk/haltypes.h b/include/ndk/haltypes.h index f7d5e57082a..272a0d4fdc2 100644 --- a/include/ndk/haltypes.h +++ b/include/ndk/haltypes.h @@ -88,7 +88,7 @@ VOID ); typedef -BOOLEAN +NTSTATUS (NTAPI *pHalAllocateMapRegisters)( IN PADAPTER_OBJECT AdapterObject, IN ULONG Unknown, diff --git a/include/ndk/rtltypes.h b/include/ndk/rtltypes.h index 6d393c2b1e0..c211ccada3c 100644 --- a/include/ndk/rtltypes.h +++ b/include/ndk/rtltypes.h @@ -1285,6 +1285,18 @@ typedef struct _STACK_TRACE_DATABASE RTL_CRITICAL_SECTION CriticalSection; } STACK_TRACE_DATABASE, *PSTACK_TRACE_DATABASE; +typedef struct _RTL_TRACE_BLOCK +{ + ULONG Magic; + ULONG Count; + ULONG Size; + ULONG UserCount; + ULONG UserSize; + PVOID UserContext; + struct _RTL_TRACE_BLOCK *Next; + PVOID *Trace; +} RTL_TRACE_BLOCK, *PRTL_TRACE_BLOCK; + #ifndef NTOS_MODE_USER // diff --git a/include/psdk/commctrl.h b/include/psdk/commctrl.h index 0ed66f5355f..2b2bfd38bd7 100644 --- a/include/psdk/commctrl.h +++ b/include/psdk/commctrl.h @@ -6,6 +6,8 @@ #ifndef _INC_COMMCTRL #define _INC_COMMCTRL +#include <_mingw_unicode.h> + #ifndef _WINRESRC_ #ifndef _WIN32_IE #define _WIN32_IE 0x0501 @@ -336,6 +338,7 @@ extern "C" { WINCOMMCTRLAPI COLORREF WINAPI ImageList_SetBkColor(HIMAGELIST himl,COLORREF clrBk); WINCOMMCTRLAPI COLORREF WINAPI ImageList_GetBkColor(HIMAGELIST himl); WINCOMMCTRLAPI WINBOOL WINAPI ImageList_SetOverlayImage(HIMAGELIST himl,int iImage,int iOverlay); + WINCOMMCTRLAPI HRESULT WINAPI HIMAGELIST_QueryInterface(HIMAGELIST,REFIID,void **); #define ImageList_AddIcon(himl,hicon) ImageList_ReplaceIcon(himl,-1,hicon) #define ILD_NORMAL 0x0 @@ -372,11 +375,7 @@ extern "C" { WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_LoadImageA(HINSTANCE hi,LPCSTR lpbmp,int cx,int cGrow,COLORREF crMask,UINT uType,UINT uFlags); WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_LoadImageW(HINSTANCE hi,LPCWSTR lpbmp,int cx,int cGrow,COLORREF crMask,UINT uType,UINT uFlags); -#ifdef UNICODE -#define ImageList_LoadImage ImageList_LoadImageW -#else -#define ImageList_LoadImage ImageList_LoadImageA -#endif +#define ImageList_LoadImage __MINGW_NAME_AW(ImageList_LoadImage) #define ILCF_MOVE 0x0 #define ILCF_SWAP 0x1 @@ -417,8 +416,6 @@ extern "C" { WINCOMMCTRLAPI WINBOOL WINAPI ImageList_GetImageInfo(HIMAGELIST himl,int i,IMAGEINFO *pImageInfo); WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Merge(HIMAGELIST himl1,int i1,HIMAGELIST himl2,int i2,int dx,int dy); WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Duplicate(HIMAGELIST himl); - WINCOMMCTRLAPI HRESULT WINAPI HIMAGELIST_QueryInterface(HIMAGELIST himl, REFIID riid, void **ppv); - #endif #ifndef NOHEADER @@ -426,11 +423,7 @@ extern "C" { #define WC_HEADERA "SysHeader32" #define WC_HEADERW L"SysHeader32" -#ifdef UNICODE -#define WC_HEADER WC_HEADERW -#else -#define WC_HEADER WC_HEADERA -#endif +#define WC_HEADER __MINGW_NAME_AW(WC_HEADER) #define HDS_HORZ 0x0 #define HDS_BUTTONS 0x2 @@ -451,17 +444,10 @@ extern "C" { #define HDFT_HASNOVALUE 0x8000 -#ifdef UNICODE -#define HD_TEXTFILTER HD_TEXTFILTERW -#define HDTEXTFILTER HD_TEXTFILTERW -#define LPHD_TEXTFILTER LPHD_TEXTFILTERW -#define LPHDTEXTFILTER LPHD_TEXTFILTERW -#else -#define HD_TEXTFILTER HD_TEXTFILTERA -#define HDTEXTFILTER HD_TEXTFILTERA -#define LPHD_TEXTFILTER LPHD_TEXTFILTERA -#define LPHDTEXTFILTER LPHD_TEXTFILTERA -#endif +#define HD_TEXTFILTER __MINGW_NAME_AW(HD_TEXTFILTER) +#define HDTEXTFILTER __MINGW_NAME_AW(HD_TEXTFILTER) +#define LPHD_TEXTFILTER __MINGW_NAME_AW(LPHD_TEXTFILTER) +#define LPHDTEXTFILTER __MINGW_NAME_AW(LPHD_TEXTFILTER) typedef struct _HD_TEXTFILTERA { LPSTR pszText; @@ -508,15 +494,10 @@ extern "C" { void *pvFilter; } HDITEMW,*LPHDITEMW; -#ifdef UNICODE -#define HDITEM HDITEMW -#define LPHDITEM LPHDITEMW -#define HDITEM_V1_SIZE HDITEMW_V1_SIZE -#else -#define HDITEM HDITEMA -#define LPHDITEM LPHDITEMA -#define HDITEM_V1_SIZE HDITEMA_V1_SIZE -#endif +#define HDITEM __MINGW_NAME_AW(HDITEM) +#define LPHDITEM __MINGW_NAME_AW(LPHDITEM) + +#define HDITEM_V1_SIZE __MINGW_NAME_AW_EXT(HDITEM,_V1_SIZE) #define HDI_WIDTH 0x1 #define HDI_HEIGHT HDI_WIDTH @@ -555,11 +536,7 @@ extern "C" { #define HDM_INSERTITEMA (HDM_FIRST+1) #define HDM_INSERTITEMW (HDM_FIRST+10) -#ifdef UNICODE -#define HDM_INSERTITEM HDM_INSERTITEMW -#else -#define HDM_INSERTITEM HDM_INSERTITEMA -#endif +#define HDM_INSERTITEM __MINGW_NAME_AW(HDM_INSERTITEM) #define Header_InsertItem(hwndHD,i,phdi) (int)SNDMSG((hwndHD),HDM_INSERTITEM,(WPARAM)(int)(i),(LPARAM)(const HD_ITEM *)(phdi)) @@ -569,22 +546,14 @@ extern "C" { #define HDM_GETITEMA (HDM_FIRST+3) #define HDM_GETITEMW (HDM_FIRST+11) -#ifdef UNICODE -#define HDM_GETITEM HDM_GETITEMW -#else -#define HDM_GETITEM HDM_GETITEMA -#endif +#define HDM_GETITEM __MINGW_NAME_AW(HDM_GETITEM) #define Header_GetItem(hwndHD,i,phdi) (WINBOOL)SNDMSG((hwndHD),HDM_GETITEM,(WPARAM)(int)(i),(LPARAM)(HD_ITEM *)(phdi)) #define HDM_SETITEMA (HDM_FIRST+4) #define HDM_SETITEMW (HDM_FIRST+12) -#ifdef UNICODE -#define HDM_SETITEM HDM_SETITEMW -#else -#define HDM_SETITEM HDM_SETITEMA -#endif +#define HDM_SETITEM __MINGW_NAME_AW(HDM_SETITEM) #define Header_SetItem(hwndHD,i,phdi) (WINBOOL)SNDMSG((hwndHD),HDM_SETITEM,(WPARAM)(int)(i),(LPARAM)(const HD_ITEM *)(phdi)) @@ -688,27 +657,15 @@ extern "C" { #define HDN_FILTERCHANGE (HDN_FIRST-12) #define HDN_FILTERBTNCLICK (HDN_FIRST-13) -#ifdef UNICODE -#define HDN_ITEMCHANGING HDN_ITEMCHANGINGW -#define HDN_ITEMCHANGED HDN_ITEMCHANGEDW -#define HDN_ITEMCLICK HDN_ITEMCLICKW -#define HDN_ITEMDBLCLICK HDN_ITEMDBLCLICKW -#define HDN_DIVIDERDBLCLICK HDN_DIVIDERDBLCLICKW -#define HDN_BEGINTRACK HDN_BEGINTRACKW -#define HDN_ENDTRACK HDN_ENDTRACKW -#define HDN_TRACK HDN_TRACKW -#define HDN_GETDISPINFO HDN_GETDISPINFOW -#else -#define HDN_ITEMCHANGING HDN_ITEMCHANGINGA -#define HDN_ITEMCHANGED HDN_ITEMCHANGEDA -#define HDN_ITEMCLICK HDN_ITEMCLICKA -#define HDN_ITEMDBLCLICK HDN_ITEMDBLCLICKA -#define HDN_DIVIDERDBLCLICK HDN_DIVIDERDBLCLICKA -#define HDN_BEGINTRACK HDN_BEGINTRACKA -#define HDN_ENDTRACK HDN_ENDTRACKA -#define HDN_TRACK HDN_TRACKA -#define HDN_GETDISPINFO HDN_GETDISPINFOA -#endif +#define HDN_ITEMCHANGING __MINGW_NAME_AW(HDN_ITEMCHANGING) +#define HDN_ITEMCHANGED __MINGW_NAME_AW(HDN_ITEMCHANGED) +#define HDN_ITEMCLICK __MINGW_NAME_AW(HDN_ITEMCLICK) +#define HDN_ITEMDBLCLICK __MINGW_NAME_AW(HDN_ITEMDBLCLICK) +#define HDN_DIVIDERDBLCLICK __MINGW_NAME_AW(HDN_DIVIDERDBLCLICK) +#define HDN_BEGINTRACK __MINGW_NAME_AW(HDN_BEGINTRACK) +#define HDN_ENDTRACK __MINGW_NAME_AW(HDN_ENDTRACK) +#define HDN_TRACK __MINGW_NAME_AW(HDN_TRACK) +#define HDN_GETDISPINFO __MINGW_NAME_AW(HDN_GETDISPINFO) #define HD_NOTIFYA NMHEADERA #define HD_NOTIFYW NMHEADERW @@ -728,13 +685,8 @@ extern "C" { HDITEMW *pitem; } NMHEADERW,*LPNMHEADERW; -#ifdef UNICODE -#define NMHEADER NMHEADERW -#define LPNMHEADER LPNMHEADERW -#else -#define NMHEADER NMHEADERA -#define LPNMHEADER LPNMHEADERA -#endif +#define NMHEADER __MINGW_NAME_AW(NMHEADER) +#define LPNMHEADER __MINGW_NAME_AW(LPNMHEADER) typedef struct tagNMHDDISPINFOW { NMHDR hdr; @@ -756,13 +708,8 @@ extern "C" { LPARAM lParam; } NMHDDISPINFOA,*LPNMHDDISPINFOA; -#ifdef UNICODE -#define NMHDDISPINFO NMHDDISPINFOW -#define LPNMHDDISPINFO LPNMHDDISPINFOW -#else -#define NMHDDISPINFO NMHDDISPINFOA -#define LPNMHDDISPINFO LPNMHDDISPINFOA -#endif +#define NMHDDISPINFO __MINGW_NAME_AW(NMHDDISPINFO) +#define LPNMHDDISPINFO __MINGW_NAME_AW(LPNMHDDISPINFO) typedef struct tagNMHDFILTERBTNCLICK { NMHDR hdr; @@ -776,11 +723,7 @@ extern "C" { #define TOOLBARCLASSNAMEW L"ToolbarWindow32" #define TOOLBARCLASSNAMEA "ToolbarWindow32" -#ifdef UNICODE -#define TOOLBARCLASSNAME TOOLBARCLASSNAMEW -#else -#define TOOLBARCLASSNAME TOOLBARCLASSNAMEA -#endif +#define TOOLBARCLASSNAME __MINGW_NAME_AW(TOOLBARCLASSNAME) typedef struct _TBBUTTON { int iBitmap; @@ -957,13 +900,8 @@ extern "C" { LPCWSTR pszValueName; } TBSAVEPARAMSW,*LPTBSAVEPARAMW; -#ifdef UNICODE -#define TBSAVEPARAMS TBSAVEPARAMSW -#define LPTBSAVEPARAMS LPTBSAVEPARAMSW -#else -#define TBSAVEPARAMS TBSAVEPARAMSA -#define LPTBSAVEPARAMS LPTBSAVEPARAMSA -#endif +#define TBSAVEPARAMS __MINGW_NAME_AW(TBSAVEPARAMS) +#define LPTBSAVEPARAMS __MINGW_NAME_AW(LPTBSAVEPARAMS) #define TB_SAVERESTOREA (WM_USER+26) #define TB_SAVERESTOREW (WM_USER+76) @@ -1002,15 +940,10 @@ extern "C" { #define TB_SETMAXTEXTROWS (WM_USER+60) #define TB_GETTEXTROWS (WM_USER+61) -#ifdef UNICODE -#define TB_GETBUTTONTEXT TB_GETBUTTONTEXTW -#define TB_SAVERESTORE TB_SAVERESTOREW -#define TB_ADDSTRING TB_ADDSTRINGW -#else -#define TB_GETBUTTONTEXT TB_GETBUTTONTEXTA -#define TB_SAVERESTORE TB_SAVERESTOREA -#define TB_ADDSTRING TB_ADDSTRINGA -#endif +#define TB_GETBUTTONTEXT __MINGW_NAME_AW(TB_GETBUTTONTEXT) +#define TB_SAVERESTORE __MINGW_NAME_AW(TB_SAVERESTORE) +#define TB_ADDSTRING __MINGW_NAME_AW(TB_ADDSTRING) + #define TB_GETOBJECT (WM_USER+62) #define TB_GETHOTITEM (WM_USER+71) #define TB_SETHOTITEM (WM_USER+72) @@ -1044,11 +977,8 @@ extern "C" { #define TB_GETUNICODEFORMAT CCM_GETUNICODEFORMAT #define TB_MAPACCELERATORW (WM_USER+90) -#ifdef UNICODE -#define TB_MAPACCELERATOR TB_MAPACCELERATORW -#else -#define TB_MAPACCELERATOR TB_MAPACCELERATORA -#endif + +#define TB_MAPACCELERATOR __MINGW_NAME_AW(TB_MAPACCELERATOR) typedef struct { HINSTANCE hInstOld; @@ -1097,48 +1027,31 @@ extern "C" { int cchText; } TBBUTTONINFOW,*LPTBBUTTONINFOW; -#ifdef UNICODE -#define TBBUTTONINFO TBBUTTONINFOW -#define LPTBBUTTONINFO LPTBBUTTONINFOW -#else -#define TBBUTTONINFO TBBUTTONINFOA -#define LPTBBUTTONINFO LPTBBUTTONINFOA -#endif +#define TBBUTTONINFO __MINGW_NAME_AW(TBBUTTONINFO) +#define LPTBBUTTONINFO __MINGW_NAME_AW(LPTBBUTTONINFO) #define TB_GETBUTTONINFOW (WM_USER+63) #define TB_SETBUTTONINFOW (WM_USER+64) #define TB_GETBUTTONINFOA (WM_USER+65) #define TB_SETBUTTONINFOA (WM_USER+66) -#ifdef UNICODE -#define TB_GETBUTTONINFO TB_GETBUTTONINFOW -#define TB_SETBUTTONINFO TB_SETBUTTONINFOW -#else -#define TB_GETBUTTONINFO TB_GETBUTTONINFOA -#define TB_SETBUTTONINFO TB_SETBUTTONINFOA -#endif + +#define TB_GETBUTTONINFO __MINGW_NAME_AW(TB_GETBUTTONINFO) +#define TB_SETBUTTONINFO __MINGW_NAME_AW(TB_SETBUTTONINFO) #define TB_INSERTBUTTONW (WM_USER+67) #define TB_ADDBUTTONSW (WM_USER+68) #define TB_HITTEST (WM_USER+69) -#ifdef UNICODE -#define TB_INSERTBUTTON TB_INSERTBUTTONW -#define TB_ADDBUTTONS TB_ADDBUTTONSW -#else -#define TB_INSERTBUTTON TB_INSERTBUTTONA -#define TB_ADDBUTTONS TB_ADDBUTTONSA -#endif +#define TB_INSERTBUTTON __MINGW_NAME_AW(TB_INSERTBUTTON) +#define TB_ADDBUTTONS __MINGW_NAME_AW(TB_ADDBUTTONS) #define TB_SETDRAWTEXTFLAGS (WM_USER+70) #define TB_GETSTRINGW (WM_USER+91) #define TB_GETSTRINGA (WM_USER+92) -#ifdef UNICODE -#define TB_GETSTRING TB_GETSTRINGW -#else -#define TB_GETSTRING TB_GETSTRINGA -#endif + +#define TB_GETSTRING __MINGW_NAME_AW(TB_GETSTRING) #define TB_SETHOTITEM2 (WM_USER+94) #define TB_SETLISTGAP (WM_USER+96) @@ -1251,15 +1164,9 @@ extern "C" { LPARAM lParam; } NMTBGETINFOTIPW,*LPNMTBGETINFOTIPW; -#ifdef UNICODE -#define TBN_GETINFOTIP TBN_GETINFOTIPW -#define NMTBGETINFOTIP NMTBGETINFOTIPW -#define LPNMTBGETINFOTIP LPNMTBGETINFOTIPW -#else -#define TBN_GETINFOTIP TBN_GETINFOTIPA -#define NMTBGETINFOTIP NMTBGETINFOTIPA -#define LPNMTBGETINFOTIP LPNMTBGETINFOTIPA -#endif +#define TBN_GETINFOTIP __MINGW_NAME_AW(TBN_GETINFOTIP) +#define NMTBGETINFOTIP __MINGW_NAME_AW(NMTBGETINFOTIP) +#define LPNMTBGETINFOTIP __MINGW_NAME_AW(LPNMTBGETINFOTIP) #define TBNF_IMAGE 0x1 #define TBNF_TEXT 0x2 @@ -1285,25 +1192,15 @@ extern "C" { int cchText; } NMTBDISPINFOW,*LPNMTBDISPINFOW; -#ifdef UNICODE -#define TBN_GETDISPINFO TBN_GETDISPINFOW -#define NMTBDISPINFO NMTBDISPINFOW -#define LPNMTBDISPINFO LPNMTBDISPINFOW -#else -#define TBN_GETDISPINFO TBN_GETDISPINFOA -#define NMTBDISPINFO NMTBDISPINFOA -#define LPNMTBDISPINFO LPNMTBDISPINFOA -#endif +#define TBN_GETDISPINFO __MINGW_NAME_AW(TBN_GETDISPINFO) +#define NMTBDISPINFO __MINGW_NAME_AW(NMTBDISPINFO) +#define LPNMTBDISPINFO __MINGW_NAME_AW(LPNMTBDISPINFO) #define TBDDRET_DEFAULT 0 #define TBDDRET_NODEFAULT 1 #define TBDDRET_TREATPRESSED 2 -#ifdef UNICODE -#define TBN_GETBUTTONINFO TBN_GETBUTTONINFOW -#else -#define TBN_GETBUTTONINFO TBN_GETBUTTONINFOA -#endif +#define TBN_GETBUTTONINFO __MINGW_NAME_AW(TBN_GETBUTTONINFO) #define TBNOTIFYA NMTOOLBARA #define TBNOTIFYW NMTOOLBARW @@ -1331,13 +1228,9 @@ extern "C" { RECT rcButton; } NMTOOLBARW,*LPNMTOOLBARW; -#ifdef UNICODE -#define NMTOOLBAR NMTOOLBARW -#define LPNMTOOLBAR LPNMTOOLBARW -#else -#define NMTOOLBAR NMTOOLBARA -#define LPNMTOOLBAR LPNMTOOLBARA -#endif +#define NMTOOLBAR __MINGW_NAME_AW(NMTOOLBAR) +#define LPNMTOOLBAR __MINGW_NAME_AW(LPNMTOOLBAR) + #endif #ifndef NOREBAR @@ -1345,11 +1238,7 @@ extern "C" { #define REBARCLASSNAMEW L"ReBarWindow32" #define REBARCLASSNAMEA "ReBarWindow32" -#ifdef UNICODE -#define REBARCLASSNAME REBARCLASSNAMEW -#else -#define REBARCLASSNAME REBARCLASSNAMEA -#endif +#define REBARCLASSNAME __MINGW_NAME_AW(REBARCLASSNAME) #define RBIM_IMAGELIST 0x1 @@ -1449,19 +1338,14 @@ extern "C" { LPARAM lParam; UINT cxHeader; } REBARBANDINFOW,*LPREBARBANDINFOW; + typedef REBARBANDINFOW CONST *LPCREBARBANDINFOW; -#ifdef UNICODE -#define REBARBANDINFO REBARBANDINFOW -#define LPREBARBANDINFO LPREBARBANDINFOW -#define LPCREBARBANDINFO LPCREBARBANDINFOW -#define REBARBANDINFO_V3_SIZE REBARBANDINFOW_V3_SIZE -#else -#define REBARBANDINFO REBARBANDINFOA -#define LPREBARBANDINFO LPREBARBANDINFOA -#define LPCREBARBANDINFO LPCREBARBANDINFOA -#define REBARBANDINFO_V3_SIZE REBARBANDINFOA_V3_SIZE -#endif +#define REBARBANDINFO __MINGW_NAME_AW(REBARBANDINFO) +#define LPREBARBANDINFO __MINGW_NAME_AW(LPREBARBANDINFO) +#define LPCREBARBANDINFO __MINGW_NAME_AW(LPCREBARBANDINFO) + +#define REBARBANDINFO_V3_SIZE __MINGW_NAME_AW_EXT(REBARBANDINFO,_V3_SIZE) #define RB_INSERTBANDA (WM_USER+1) #define RB_DELETEBAND (WM_USER+2) @@ -1490,13 +1374,8 @@ extern "C" { #define RB_SETCOLORSCHEME CCM_SETCOLORSCHEME #define RB_GETCOLORSCHEME CCM_GETCOLORSCHEME -#ifdef UNICODE -#define RB_INSERTBAND RB_INSERTBANDW -#define RB_SETBANDINFO RB_SETBANDINFOW -#else -#define RB_INSERTBAND RB_INSERTBANDA -#define RB_SETBANDINFO RB_SETBANDINFOA -#endif +#define RB_INSERTBAND __MINGW_NAME_AW(RB_INSERTBAND) +#define RB_SETBANDINFO __MINGW_NAME_AW(RB_SETBANDINFO) #define RB_BEGINDRAG (WM_USER+24) #define RB_ENDDRAG (WM_USER+25) @@ -1505,11 +1384,7 @@ extern "C" { #define RB_GETBANDINFOW (WM_USER+28) #define RB_GETBANDINFOA (WM_USER+29) -#ifdef UNICODE -#define RB_GETBANDINFO RB_GETBANDINFOW -#else -#define RB_GETBANDINFO RB_GETBANDINFOA -#endif +#define RB_GETBANDINFO __MINGW_NAME_AW(RB_GETBANDINFO) #define RB_MINIMIZEBAND (WM_USER+30) #define RB_MAXIMIZEBAND (WM_USER+31) @@ -1605,11 +1480,8 @@ extern "C" { #define TOOLTIPS_CLASSW L"tooltips_class32" #define TOOLTIPS_CLASSA "tooltips_class32" -#ifdef UNICODE -#define TOOLTIPS_CLASS TOOLTIPS_CLASSW -#else -#define TOOLTIPS_CLASS TOOLTIPS_CLASSA -#endif + +#define TOOLTIPS_CLASS __MINGW_NAME_AW(TOOLTIPS_CLASS) #define LPTOOLINFOA LPTTTOOLINFOA #define LPTOOLINFOW LPTTTOOLINFOW @@ -1650,17 +1522,11 @@ extern "C" { void *lpReserved; } TTTOOLINFOW,NEAR *PTOOLINFOW,*LPTTTOOLINFOW; -#ifdef UNICODE -#define TTTOOLINFO TTTOOLINFOW -#define PTOOLINFO PTOOLINFOW -#define LPTTTOOLINFO LPTTTOOLINFOW -#define TTTOOLINFO_V1_SIZE TTTOOLINFOW_V1_SIZE -#else -#define PTOOLINFO PTOOLINFOA -#define TTTOOLINFO TTTOOLINFOA -#define LPTTTOOLINFO LPTTTOOLINFOA -#define TTTOOLINFO_V1_SIZE TTTOOLINFOA_V1_SIZE -#endif +#define TTTOOLINFO __MINGW_NAME_AW(TTTOOLINFO) +#define PTOOLINFO __MINGW_NAME_AW(PTOOLINFO) +#define LPTTTOOLINFO __MINGW_NAME_AW(LPTTTOOLINFO) + +#define TTTOOLINFO_V1_SIZE __MINGW_NAME_AW_EXT(TTTOOLINFO,_V1_SIZE) #define TTS_ALWAYSTIP 0x1 #define TTS_NOPREFIX 0x2 @@ -1744,31 +1610,18 @@ extern "C" { WCHAR *pszTitle; } TTGETTITLE,*PTTGETTITLE; -#ifdef UNICODE -#define TTM_ADDTOOL TTM_ADDTOOLW -#define TTM_DELTOOL TTM_DELTOOLW -#define TTM_NEWTOOLRECT TTM_NEWTOOLRECTW -#define TTM_GETTOOLINFO TTM_GETTOOLINFOW -#define TTM_SETTOOLINFO TTM_SETTOOLINFOW -#define TTM_HITTEST TTM_HITTESTW -#define TTM_GETTEXT TTM_GETTEXTW -#define TTM_UPDATETIPTEXT TTM_UPDATETIPTEXTW -#define TTM_ENUMTOOLS TTM_ENUMTOOLSW -#define TTM_GETCURRENTTOOL TTM_GETCURRENTTOOLW -#define TTM_SETTITLE TTM_SETTITLEW -#else -#define TTM_ADDTOOL TTM_ADDTOOLA -#define TTM_DELTOOL TTM_DELTOOLA -#define TTM_NEWTOOLRECT TTM_NEWTOOLRECTA -#define TTM_GETTOOLINFO TTM_GETTOOLINFOA -#define TTM_SETTOOLINFO TTM_SETTOOLINFOA -#define TTM_HITTEST TTM_HITTESTA -#define TTM_GETTEXT TTM_GETTEXTA -#define TTM_UPDATETIPTEXT TTM_UPDATETIPTEXTA -#define TTM_ENUMTOOLS TTM_ENUMTOOLSA -#define TTM_GETCURRENTTOOL TTM_GETCURRENTTOOLA -#define TTM_SETTITLE TTM_SETTITLEA -#endif +#define TTM_ADDTOOL __MINGW_NAME_AW(TTM_ADDTOOL) +#define TTM_DELTOOL __MINGW_NAME_AW(TTM_DELTOOL) +#define TTM_NEWTOOLRECT __MINGW_NAME_AW(TTM_NEWTOOLRECT) +#define TTM_GETTOOLINFO __MINGW_NAME_AW(TTM_GETTOOLINFO) +#define TTM_SETTOOLINFO __MINGW_NAME_AW(TTM_SETTOOLINFO) +#define TTM_HITTEST __MINGW_NAME_AW(TTM_HITTEST) +#define TTM_GETTEXT __MINGW_NAME_AW(TTM_GETTEXT) +#define TTM_UPDATETIPTEXT __MINGW_NAME_AW(TTM_UPDATETIPTEXT) +#define TTM_ENUMTOOLS __MINGW_NAME_AW(TTM_ENUMTOOLS) +#define TTM_GETCURRENTTOOL __MINGW_NAME_AW(TTM_GETCURRENTTOOL) +#define TTM_SETTITLE __MINGW_NAME_AW(TTM_SETTITLE) + #define TTM_SETWINDOWTHEME CCM_SETWINDOWTHEME #define LPHITTESTINFOW LPTTHITTESTINFOW @@ -1787,13 +1640,8 @@ extern "C" { TTTOOLINFOW ti; } TTHITTESTINFOW,*LPTTHITTESTINFOW; -#ifdef UNICODE -#define TTHITTESTINFO TTHITTESTINFOW -#define LPTTHITTESTINFO LPTTHITTESTINFOW -#else -#define TTHITTESTINFO TTHITTESTINFOA -#define LPTTHITTESTINFO LPTTHITTESTINFOA -#endif +#define TTHITTESTINFO __MINGW_NAME_AW(TTHITTESTINFO) +#define LPTTHITTESTINFO __MINGW_NAME_AW(LPTTHITTESTINFO) #define TTN_GETDISPINFOA (TTN_FIRST - 0) #define TTN_GETDISPINFOW (TTN_FIRST - 10) @@ -1801,11 +1649,7 @@ extern "C" { #define TTN_POP (TTN_FIRST - 2) #define TTN_LINKCLICK (TTN_FIRST - 3) -#ifdef UNICODE -#define TTN_GETDISPINFO TTN_GETDISPINFOW -#else -#define TTN_GETDISPINFO TTN_GETDISPINFOA -#endif +#define TTN_GETDISPINFO __MINGW_NAME_AW(TTN_GETDISPINFO) #define TTN_NEEDTEXT TTN_GETDISPINFO #define TTN_NEEDTEXTA TTN_GETDISPINFOA @@ -1840,15 +1684,11 @@ extern "C" { LPARAM lParam; } NMTTDISPINFOW,*LPNMTTDISPINFOW; -#ifdef UNICODE -#define NMTTDISPINFO NMTTDISPINFOW -#define LPNMTTDISPINFO LPNMTTDISPINFOW -#define NMTTDISPINFO_V1_SIZE NMTTDISPINFOW_V1_SIZE -#else -#define NMTTDISPINFO NMTTDISPINFOA -#define LPNMTTDISPINFO LPNMTTDISPINFOA -#define NMTTDISPINFO_V1_SIZE NMTTDISPINFOA_V1_SIZE -#endif + +#define NMTTDISPINFO __MINGW_NAME_AW(NMTTDISPINFO) +#define LPNMTTDISPINFO __MINGW_NAME_AW(LPNMTTDISPINFO) + +#define NMTTDISPINFO_V1_SIZE __MINGW_NAME_AW_EXT(NMTTDISPINFO,_V1_SIZE) #endif #ifndef NOSTATUSBAR @@ -1863,21 +1703,13 @@ extern "C" { WINCOMMCTRLAPI HWND WINAPI CreateStatusWindowA(LONG style,LPCSTR lpszText,HWND hwndParent,UINT wID); WINCOMMCTRLAPI HWND WINAPI CreateStatusWindowW(LONG style,LPCWSTR lpszText,HWND hwndParent,UINT wID); -#ifdef UNICODE -#define CreateStatusWindow CreateStatusWindowW -#define DrawStatusText DrawStatusTextW -#else -#define CreateStatusWindow CreateStatusWindowA -#define DrawStatusText DrawStatusTextA -#endif +#define CreateStatusWindow __MINGW_NAME_AW(CreateStatusWindow) +#define DrawStatusText __MINGW_NAME_AW(DrawStatusText) #define STATUSCLASSNAMEW L"msctls_statusbar32" #define STATUSCLASSNAMEA "msctls_statusbar32" -#ifdef UNICODE -#define STATUSCLASSNAME STATUSCLASSNAMEW -#else -#define STATUSCLASSNAME STATUSCLASSNAMEA -#endif + +#define STATUSCLASSNAME __MINGW_NAME_AW(STATUSCLASSNAME) #define SB_SETTEXTA (WM_USER+1) #define SB_SETTEXTW (WM_USER+11) @@ -1886,19 +1718,11 @@ extern "C" { #define SB_GETTEXTLENGTHA (WM_USER+3) #define SB_GETTEXTLENGTHW (WM_USER+12) -#ifdef UNICODE -#define SB_GETTEXT SB_GETTEXTW -#define SB_SETTEXT SB_SETTEXTW -#define SB_GETTEXTLENGTH SB_GETTEXTLENGTHW -#define SB_SETTIPTEXT SB_SETTIPTEXTW -#define SB_GETTIPTEXT SB_GETTIPTEXTW -#else -#define SB_GETTEXT SB_GETTEXTA -#define SB_SETTEXT SB_SETTEXTA -#define SB_GETTEXTLENGTH SB_GETTEXTLENGTHA -#define SB_SETTIPTEXT SB_SETTIPTEXTA -#define SB_GETTIPTEXT SB_GETTIPTEXTA -#endif +#define SB_GETTEXT __MINGW_NAME_AW(SB_GETTEXT) +#define SB_SETTEXT __MINGW_NAME_AW(SB_SETTEXT) +#define SB_GETTEXTLENGTH __MINGW_NAME_AW(SB_GETTEXTLENGTH) +#define SB_SETTIPTEXT __MINGW_NAME_AW(SB_SETTIPTEXT) +#define SB_GETTIPTEXT __MINGW_NAME_AW(SB_GETTIPTEXT) #define SB_SETPARTS (WM_USER+4) #define SB_GETPARTS (WM_USER+6) @@ -1942,11 +1766,8 @@ extern "C" { #define TRACKBAR_CLASSA "msctls_trackbar32" #define TRACKBAR_CLASSW L"msctls_trackbar32" -#ifdef UNICODE -#define TRACKBAR_CLASS TRACKBAR_CLASSW -#else -#define TRACKBAR_CLASS TRACKBAR_CLASSA -#endif + +#define TRACKBAR_CLASS __MINGW_NAME_AW(TRACKBAR_CLASS) #define TBS_AUTOTICKS 0x1 #define TBS_VERT 0x2 @@ -2051,11 +1872,8 @@ extern "C" { #define UPDOWN_CLASSA "msctls_updown32" #define UPDOWN_CLASSW L"msctls_updown32" -#ifdef UNICODE -#define UPDOWN_CLASS UPDOWN_CLASSW -#else -#define UPDOWN_CLASS UPDOWN_CLASSA -#endif + +#define UPDOWN_CLASS __MINGW_NAME_AW(UPDOWN_CLASS) typedef struct _UDACCEL { UINT nSec; @@ -2110,11 +1928,8 @@ extern "C" { #define PROGRESS_CLASSA "msctls_progress32" #define PROGRESS_CLASSW L"msctls_progress32" -#ifdef UNICODE -#define PROGRESS_CLASS PROGRESS_CLASSW -#else -#define PROGRESS_CLASS PROGRESS_CLASSA -#endif + +#define PROGRESS_CLASS __MINGW_NAME_AW(PROGRESS_CLASS) #define PBS_SMOOTH 0x1 #define PBS_VERTICAL 0x4 @@ -2173,11 +1988,8 @@ extern "C" { #define HOTKEY_CLASSA "msctls_hotkey32" #define HOTKEY_CLASSW L"msctls_hotkey32" -#ifdef UNICODE -#define HOTKEY_CLASS HOTKEY_CLASSW -#else -#define HOTKEY_CLASS HOTKEY_CLASSA -#endif + +#define HOTKEY_CLASS __MINGW_NAME_AW(HOTKEY_CLASS) #endif #define CCS_TOP 0x1L @@ -2196,11 +2008,8 @@ extern "C" { #define WC_LISTVIEWA "SysListView32" #define WC_LISTVIEWW L"SysListView32" -#ifdef UNICODE -#define WC_LISTVIEW WC_LISTVIEWW -#else -#define WC_LISTVIEW WC_LISTVIEWA -#endif + +#define WC_LISTVIEW __MINGW_NAME_AW(WC_LISTVIEW) #define LVS_ICON 0x0 #define LVS_REPORT 0x1 @@ -2239,9 +2048,9 @@ extern "C" { #define LVM_GETIMAGELIST (LVM_FIRST+2) #define ListView_GetImageList(hwnd,iImageList) (HIMAGELIST)SNDMSG((hwnd),LVM_GETIMAGELIST,(WPARAM)(INT)(iImageList),0L) -#define LVSIL_NORMAL 0 -#define LVSIL_SMALL 1 -#define LVSIL_STATE 2 +#define LVSIL_NORMAL 0 +#define LVSIL_SMALL 1 +#define LVSIL_STATE 2 #define LVSIL_GROUPHEADER 3 #define LVM_SETIMAGELIST (LVM_FIRST+3) @@ -2316,23 +2125,15 @@ extern "C" { PUINT puColumns; } LVITEMW,*LPLVITEMW; -#ifdef UNICODE -#define LVITEM LVITEMW -#define LPLVITEM LPLVITEMW -#define LVITEM_V1_SIZE LVITEMW_V1_SIZE -#else -#define LVITEM LVITEMA -#define LPLVITEM LPLVITEMA -#define LVITEM_V1_SIZE LVITEMA_V1_SIZE -#endif +#define LVITEM __MINGW_NAME_AW(LVITEM) +#define LPLVITEM __MINGW_NAME_AW(LPLVITEM) + +#define LVITEM_V1_SIZE __MINGW_NAME_AW_EXT(LVITEM,_V1_SIZE) #define LPSTR_TEXTCALLBACKW ((LPWSTR)-1L) #define LPSTR_TEXTCALLBACKA ((LPSTR)-1L) -#ifdef UNICODE -#define LPSTR_TEXTCALLBACK LPSTR_TEXTCALLBACKW -#else -#define LPSTR_TEXTCALLBACK LPSTR_TEXTCALLBACKA -#endif + +#define LPSTR_TEXTCALLBACK __MINGW_NAME_AW(LPSTR_TEXTCALLBACK) #define I_IMAGECALLBACK (-1) #define I_IMAGENONE (-2) @@ -2340,31 +2141,23 @@ extern "C" { #define LVM_GETITEMA (LVM_FIRST+5) #define LVM_GETITEMW (LVM_FIRST+75) -#ifdef UNICODE -#define LVM_GETITEM LVM_GETITEMW -#else -#define LVM_GETITEM LVM_GETITEMA -#endif + +#define LVM_GETITEM __MINGW_NAME_AW(LVM_GETITEM) #define ListView_GetItem(hwnd,pitem) (WINBOOL)SNDMSG((hwnd),LVM_GETITEM,0,(LPARAM)(LV_ITEM *)(pitem)) #define LVM_SETITEMA (LVM_FIRST+6) #define LVM_SETITEMW (LVM_FIRST+76) -#ifdef UNICODE -#define LVM_SETITEM LVM_SETITEMW -#else -#define LVM_SETITEM LVM_SETITEMA -#endif + +#define LVM_SETITEM __MINGW_NAME_AW(LVM_SETITEM) #define ListView_SetItem(hwnd,pitem) (WINBOOL)SNDMSG((hwnd),LVM_SETITEM,0,(LPARAM)(const LV_ITEM *)(pitem)) #define LVM_INSERTITEMA (LVM_FIRST+7) #define LVM_INSERTITEMW (LVM_FIRST+77) -#ifdef UNICODE -#define LVM_INSERTITEM LVM_INSERTITEMW -#else -#define LVM_INSERTITEM LVM_INSERTITEMA -#endif + +#define LVM_INSERTITEM __MINGW_NAME_AW(LVM_INSERTITEM) + #define ListView_InsertItem(hwnd,pitem) (int)SNDMSG((hwnd),LVM_INSERTITEM,0,(LPARAM)(const LV_ITEM *)(pitem)) #define LVM_DELETEITEM (LVM_FIRST+8) @@ -2393,12 +2186,12 @@ extern "C" { #define LVM_GETNEXTITEM (LVM_FIRST+12) #define ListView_GetNextItem(hwnd,i,flags) (int)SNDMSG((hwnd),LVM_GETNEXTITEM,(WPARAM)(int)(i),MAKELPARAM((flags),0)) -#define LVFI_PARAM 0x1 -#define LVFI_STRING 0x2 -#define LVFI_SUBSTRING 0x4 -#define LVFI_PARTIAL 0x8 -#define LVFI_WRAP 0x20 -#define LVFI_NEARESTXY 0x40 +#define LVFI_PARAM 0x0001 +#define LVFI_STRING 0x0002 +#define LVFI_SUBSTRING 0x0004 +#define LVFI_PARTIAL 0x0008 +#define LVFI_WRAP 0x0020 +#define LVFI_NEARESTXY 0x0040 #define LV_FINDINFOA LVFINDINFOA #define LV_FINDINFOW LVFINDINFOW @@ -2420,19 +2213,12 @@ extern "C" { UINT vkDirection; } LVFINDINFOW,*LPFINDINFOW; -#ifdef UNICODE -#define LVFINDINFO LVFINDINFOW -#else -#define LVFINDINFO LVFINDINFOA -#endif +#define LVFINDINFO __MINGW_NAME_AW(LVFINDINFO) #define LVM_FINDITEMA (LVM_FIRST+13) #define LVM_FINDITEMW (LVM_FIRST+83) -#ifdef UNICODE -#define LVM_FINDITEM LVM_FINDITEMW -#else -#define LVM_FINDITEM LVM_FINDITEMA -#endif + +#define LVM_FINDITEM __MINGW_NAME_AW(LVM_FINDITEM) #define ListView_FindItem(hwnd,iStart,plvfi) (int)SNDMSG((hwnd),LVM_FINDITEM,(WPARAM)(int)(iStart),(LPARAM)(const LV_FINDINFO *)(plvfi)) @@ -2452,11 +2238,8 @@ extern "C" { #define LVM_GETSTRINGWIDTHA (LVM_FIRST+17) #define LVM_GETSTRINGWIDTHW (LVM_FIRST+87) -#ifdef UNICODE -#define LVM_GETSTRINGWIDTH LVM_GETSTRINGWIDTHW -#else -#define LVM_GETSTRINGWIDTH LVM_GETSTRINGWIDTHA -#endif + +#define LVM_GETSTRINGWIDTH __MINGW_NAME_AW(LVM_GETSTRINGWIDTH) #define ListView_GetStringWidth(hwndLV,psz) (int)SNDMSG((hwndLV),LVM_GETSTRINGWIDTH,0,(LPARAM)(LPCTSTR)(psz)) @@ -2504,11 +2287,8 @@ extern "C" { #define LVM_EDITLABELA (LVM_FIRST+23) #define LVM_EDITLABELW (LVM_FIRST+118) -#ifdef UNICODE -#define LVM_EDITLABEL LVM_EDITLABELW -#else -#define LVM_EDITLABEL LVM_EDITLABELA -#endif + +#define LVM_EDITLABEL __MINGW_NAME_AW(LVM_EDITLABEL) #define ListView_EditLabel(hwndLV,i) (HWND)SNDMSG((hwndLV),LVM_EDITLABEL,(WPARAM)(int)(i),0L) @@ -2533,33 +2313,28 @@ extern "C" { int iOrder; } LVCOLUMNA,*LPLVCOLUMNA; - typedef struct tagLVCOLUMNW { - UINT mask; - int fmt; - int cx; - LPWSTR pszText; - int cchTextMax; - int iSubItem; - #if (_WIN32_IE >= 0x0300) - int iImage; - int iOrder; - #endif - #if (_WIN32_WINNT >= 0x0600) - int cxMin; - int cxDefault; - int cxIdeal; - #endif + typedef struct tagLVCOLUMNW { + UINT mask; + int fmt; + int cx; + LPWSTR pszText; + int cchTextMax; + int iSubItem; +# if (_WIN32_IE >= 0x0300) + int iImage; + int iOrder; +# endif +# if (_WIN32_WINNT >= 0x0600) + int cxMin; + int cxDefault; + int cxIdeal; +# endif } LVCOLUMNW,*LPLVCOLUMNW; -#ifdef UNICODE -#define LVCOLUMN LVCOLUMNW -#define LPLVCOLUMN LPLVCOLUMNW -#define LVCOLUMN_V1_SIZE LVCOLUMNW_V1_SIZE -#else -#define LVCOLUMN LVCOLUMNA -#define LPLVCOLUMN LPLVCOLUMNA -#define LVCOLUMN_V1_SIZE LVCOLUMNA_V1_SIZE -#endif +#define LVCOLUMN __MINGW_NAME_AW(LVCOLUMN) +#define LPLVCOLUMN __MINGW_NAME_AW(LPLVCOLUMN) + +#define LVCOLUMN_V1_SIZE __MINGW_NAME_AW_EXT(LVCOLUMN,_V1_SIZE) #define LVCF_FMT 0x1 #define LVCF_WIDTH 0x2 @@ -2594,31 +2369,22 @@ extern "C" { #define LVM_GETCOLUMNA (LVM_FIRST+25) #define LVM_GETCOLUMNW (LVM_FIRST+95) -#ifdef UNICODE -#define LVM_GETCOLUMN LVM_GETCOLUMNW -#else -#define LVM_GETCOLUMN LVM_GETCOLUMNA -#endif + +#define LVM_GETCOLUMN __MINGW_NAME_AW(LVM_GETCOLUMN) #define ListView_GetColumn(hwnd,iCol,pcol) (WINBOOL)SNDMSG((hwnd),LVM_GETCOLUMN,(WPARAM)(int)(iCol),(LPARAM)(LV_COLUMN *)(pcol)) #define LVM_SETCOLUMNA (LVM_FIRST+26) #define LVM_SETCOLUMNW (LVM_FIRST+96) -#ifdef UNICODE -#define LVM_SETCOLUMN LVM_SETCOLUMNW -#else -#define LVM_SETCOLUMN LVM_SETCOLUMNA -#endif + +#define LVM_SETCOLUMN __MINGW_NAME_AW(LVM_SETCOLUMN) #define ListView_SetColumn(hwnd,iCol,pcol) (WINBOOL)SNDMSG((hwnd),LVM_SETCOLUMN,(WPARAM)(int)(iCol),(LPARAM)(const LV_COLUMN *)(pcol)) #define LVM_INSERTCOLUMNA (LVM_FIRST+27) #define LVM_INSERTCOLUMNW (LVM_FIRST+97) -#ifdef UNICODE -#define LVM_INSERTCOLUMN LVM_INSERTCOLUMNW -#else -#define LVM_INSERTCOLUMN LVM_INSERTCOLUMNA -#endif + +#define LVM_INSERTCOLUMN __MINGW_NAME_AW(LVM_INSERTCOLUMN) #define ListView_InsertColumn(hwnd,iCol,pcol) (int)SNDMSG((hwnd),LVM_INSERTCOLUMN,(WPARAM)(int)(iCol),(LPARAM)(const LV_COLUMN *)(pcol)) @@ -2666,22 +2432,14 @@ extern "C" { #define LVM_GETITEMTEXTA (LVM_FIRST+45) #define LVM_GETITEMTEXTW (LVM_FIRST+115) -#ifdef UNICODE -#define LVM_GETITEMTEXT LVM_GETITEMTEXTW -#else -#define LVM_GETITEMTEXT LVM_GETITEMTEXTA -#endif +#define LVM_GETITEMTEXT __MINGW_NAME_AW(LVM_GETITEMTEXT) #define ListView_GetItemText(hwndLV,i,iSubItem_,pszText_,cchTextMax_) { LV_ITEM _ms_lvi; _ms_lvi.iSubItem = iSubItem_; _ms_lvi.cchTextMax = cchTextMax_; _ms_lvi.pszText = pszText_; SNDMSG((hwndLV),LVM_GETITEMTEXT,(WPARAM)(i),(LPARAM)(LV_ITEM *)&_ms_lvi);} #define LVM_SETITEMTEXTA (LVM_FIRST+46) #define LVM_SETITEMTEXTW (LVM_FIRST+116) -#ifdef UNICODE -#define LVM_SETITEMTEXT LVM_SETITEMTEXTW -#else -#define LVM_SETITEMTEXT LVM_SETITEMTEXTA -#endif +#define LVM_SETITEMTEXT __MINGW_NAME_AW(LVM_SETITEMTEXT) #define ListView_SetItemText(hwndLV,i,iSubItem_,pszText_) { LV_ITEM _ms_lvi; _ms_lvi.iSubItem = iSubItem_; _ms_lvi.pszText = pszText_; SNDMSG((hwndLV),LVM_SETITEMTEXT,(WPARAM)(i),(LPARAM)(LV_ITEM *)&_ms_lvi);} @@ -2709,11 +2467,7 @@ extern "C" { #define LVM_GETISEARCHSTRINGA (LVM_FIRST+52) #define LVM_GETISEARCHSTRINGW (LVM_FIRST+117) -#ifdef UNICODE -#define LVM_GETISEARCHSTRING LVM_GETISEARCHSTRINGW -#else -#define LVM_GETISEARCHSTRING LVM_GETISEARCHSTRINGA -#endif +#define LVM_GETISEARCHSTRING __MINGW_NAME_AW(LVM_GETISEARCHSTRING) #define ListView_GetISearchString(hwndLV,lpsz) (WINBOOL)SNDMSG((hwndLV),LVM_GETISEARCHSTRING,0,(LPARAM)(LPTSTR)(lpsz)) @@ -3017,17 +2771,10 @@ extern "C" { #define LVM_ISITEMVISIBLE (LVM_FIRST+182) #define ListView_IsItemVisible(hwnd,index) (UINT)SNDMSG((hwnd),LVM_ISITEMVISIBLE,(WPARAM)(index),(LPARAM)0) -#ifdef UNICODE -#define LVBKIMAGE LVBKIMAGEW -#define LPLVBKIMAGE LPLVBKIMAGEW -#define LVM_SETBKIMAGE LVM_SETBKIMAGEW -#define LVM_GETBKIMAGE LVM_GETBKIMAGEW -#else -#define LVBKIMAGE LVBKIMAGEA -#define LPLVBKIMAGE LPLVBKIMAGEA -#define LVM_SETBKIMAGE LVM_SETBKIMAGEA -#define LVM_GETBKIMAGE LVM_GETBKIMAGEA -#endif +#define LVBKIMAGE __MINGW_NAME_AW(LVBKIMAGE) +#define LPLVBKIMAGE __MINGW_NAME_AW(LPLVBKIMAGE) +#define LVM_SETBKIMAGE __MINGW_NAME_AW(LVM_SETBKIMAGE) +#define LVM_GETBKIMAGE __MINGW_NAME_AW(LVM_GETBKIMAGE) #define ListView_SetBkImage(hwnd,plvbki) (WINBOOL)SNDMSG((hwnd),LVM_SETBKIMAGE,0,(LPARAM)(plvbki)) #define ListView_GetBkImage(hwnd,plvbki) (WINBOOL)SNDMSG((hwnd),LVM_GETBKIMAGE,0,(LPARAM)(plvbki)) @@ -3115,19 +2862,11 @@ extern "C" { #define LPNM_FINDITEMW LPNMLVFINDITEMW #define NM_FINDITEMW NMLVFINDITEMW -#ifdef UNICODE -#define PNM_FINDITEM PNM_FINDITEMW -#define LPNM_FINDITEM LPNM_FINDITEMW -#define NM_FINDITEM NM_FINDITEMW -#define NMLVFINDITEM NMLVFINDITEMW -#define LPNMLVFINDITEM LPNMLVFINDITEMW -#else -#define PNM_FINDITEM PNM_FINDITEMA -#define LPNM_FINDITEM LPNM_FINDITEMA -#define NM_FINDITEM NM_FINDITEMA -#define NMLVFINDITEM NMLVFINDITEMA -#define LPNMLVFINDITEM LPNMLVFINDITEMA -#endif +#define PNM_FINDITEM __MINGW_NAME_AW(PNM_FINDITEM) +#define LPNM_FINDITEM __MINGW_NAME_AW(LPNM_FINDITEM) +#define NM_FINDITEM __MINGW_NAME_AW(NM_FINDITEM) +#define NMLVFINDITEM __MINGW_NAME_AW(NMLVFINDITEM) +#define LPNMLVFINDITEM __MINGW_NAME_AW(LPNMLVFINDITEM) typedef struct tagNMLVODSTATECHANGE { NMHDR hdr; @@ -3161,11 +2900,7 @@ extern "C" { #define LVN_ITEMACTIVATE (LVN_FIRST-14) #define LVN_ODSTATECHANGED (LVN_FIRST-15) -#ifdef UNICODE -#define LVN_ODFINDITEM LVN_ODFINDITEMW -#else -#define LVN_ODFINDITEM LVN_ODFINDITEMA -#endif +#define LVN_ODFINDITEM __MINGW_NAME_AW(LVN_ODFINDITEM) #define LVN_HOTTRACK (LVN_FIRST-21) #define LVN_GETDISPINFOA (LVN_FIRST-50) @@ -3173,17 +2908,10 @@ extern "C" { #define LVN_SETDISPINFOA (LVN_FIRST-51) #define LVN_SETDISPINFOW (LVN_FIRST-78) -#ifdef UNICODE -#define LVN_BEGINLABELEDIT LVN_BEGINLABELEDITW -#define LVN_ENDLABELEDIT LVN_ENDLABELEDITW -#define LVN_GETDISPINFO LVN_GETDISPINFOW -#define LVN_SETDISPINFO LVN_SETDISPINFOW -#else -#define LVN_BEGINLABELEDIT LVN_BEGINLABELEDITA -#define LVN_ENDLABELEDIT LVN_ENDLABELEDITA -#define LVN_GETDISPINFO LVN_GETDISPINFOA -#define LVN_SETDISPINFO LVN_SETDISPINFOA -#endif +#define LVN_BEGINLABELEDIT __MINGW_NAME_AW(LVN_BEGINLABELEDIT) +#define LVN_ENDLABELEDIT __MINGW_NAME_AW(LVN_ENDLABELEDIT) +#define LVN_GETDISPINFO __MINGW_NAME_AW(LVN_GETDISPINFO) +#define LVN_SETDISPINFO __MINGW_NAME_AW(LVN_SETDISPINFO) #define LVIF_DI_SETITEM 0x1000 @@ -3201,11 +2929,7 @@ extern "C" { LVITEMW item; } NMLVDISPINFOW,*LPNMLVDISPINFOW; -#ifdef UNICODE -#define NMLVDISPINFO NMLVDISPINFOW -#else -#define NMLVDISPINFO NMLVDISPINFOA -#endif +#define NMLVDISPINFO __MINGW_NAME_AW(NMLVDISPINFO) #define LVN_KEYDOWN (LVN_FIRST-55) @@ -3248,15 +2972,9 @@ extern "C" { #define LVN_GETINFOTIPA (LVN_FIRST-57) #define LVN_GETINFOTIPW (LVN_FIRST-58) -#ifdef UNICODE -#define LVN_GETINFOTIP LVN_GETINFOTIPW -#define NMLVGETINFOTIP NMLVGETINFOTIPW -#define LPNMLVGETINFOTIP LPNMLVGETINFOTIPW -#else -#define LVN_GETINFOTIP LVN_GETINFOTIPA -#define NMLVGETINFOTIP NMLVGETINFOTIPA -#define LPNMLVGETINFOTIP LPNMLVGETINFOTIPA -#endif +#define LVN_GETINFOTIP __MINGW_NAME_AW(LVN_GETINFOTIP) +#define NMLVGETINFOTIP __MINGW_NAME_AW(NMLVGETINFOTIP) +#define LPNMLVGETINFOTIP __MINGW_NAME_AW(LPNMLVGETINFOTIP) typedef struct tagNMLVSCROLL { NMHDR hdr; @@ -3272,11 +2990,8 @@ extern "C" { #define WC_TREEVIEWA "SysTreeView32" #define WC_TREEVIEWW L"SysTreeView32" -#ifdef UNICODE -#define WC_TREEVIEW WC_TREEVIEWW -#else -#define WC_TREEVIEW WC_TREEVIEWA -#endif + +#define WC_TREEVIEW __MINGW_NAME_AW(WC_TREEVIEW) #define TVS_HASBUTTONS 0x1 #define TVS_HASLINES 0x2 @@ -3304,10 +3019,13 @@ extern "C" { #define TVIF_HANDLE 0x10 #define TVIF_SELECTEDIMAGE 0x20 #define TVIF_CHILDREN 0x40 +#if(_WIN32_IE >= 0x0400) #define TVIF_INTEGRAL 0x80 -#define TVIF_STATEEX 0x100 +#endif +#if(_WIN32_IE >= 0x0600) +#define TVIF_STATEEX 0x100 +#endif #define TVIF_EXPANDEDIMAGE 0x200 -#define TVIF_DI_SETITEM 0x1000 #define TVIS_SELECTED 0x2 #define TVIS_CUT 0x4 #define TVIS_DROPHILITED 0x8 @@ -3366,39 +3084,33 @@ extern "C" { int cChildren; LPARAM lParam; int iIntegral; - } TVITEMEXA,*LPTVITEMEXA; + UINT uStateEx; /* _WIN32_IE >= 0x600 */ + HWND hwnd; /* _WIN32_IE >= 0x600 */ + int iExpandedImage; /* _WIN32_IE >= 0x600 */ + } TVITEMEXA, *LPTVITEMEXA; -typedef struct tagTVITEMEXW { - UINT mask; - HTREEITEM hItem; - UINT state; - UINT stateMask; - LPWSTR pszText; - INT cchTextMax; - INT iImage; - INT iSelectedImage; - INT cChildren; - LPARAM lParam; - INT iIntegral; - UINT uStateEx; /* _WIN32_IE >= 0x600 */ - HWND hwnd; /* _WIN32_IE >= 0x600 */ - INT iExpandedImage; /* _WIN32_IE >= 0x600 */ -} TVITEMEXW, *LPTVITEMEXW; -#ifdef UNICODE - typedef TVITEMEXW TVITEMEX; - typedef LPTVITEMEXW LPTVITEMEX; -#else - typedef TVITEMEXA TVITEMEX; - typedef LPTVITEMEXA LPTVITEMEX; -#endif + typedef struct tagTVITEMEXW { + UINT mask; + HTREEITEM hItem; + UINT state; + UINT stateMask; + LPWSTR pszText; + int cchTextMax; + int iImage; + int iSelectedImage; + int cChildren; + LPARAM lParam; + int iIntegral; + UINT uStateEx; /* _WIN32_IE >= 0x600 */ + HWND hwnd; /* _WIN32_IE >= 0x600 */ + int iExpandedImage; /* _WIN32_IE >= 0x600 */ + } TVITEMEXW, *LPTVITEMEXW; -#ifdef UNICODE -#define TVITEM TVITEMW -#define LPTVITEM LPTVITEMW -#else -#define TVITEM TVITEMA -#define LPTVITEM LPTVITEMA -#endif + __MINGW_TYPEDEF_AW(TVITEMEX) + __MINGW_TYPEDEF_AW(LPTVITEMEX) + +#define TVITEM __MINGW_NAME_AW(TVITEM) +#define LPTVITEM __MINGW_NAME_AW(LPTVITEM) #define TVI_ROOT ((HTREEITEM)(ULONG_PTR)-0x10000) #define TVI_FIRST ((HTREEITEM)(ULONG_PTR)-0xffff) @@ -3418,7 +3130,7 @@ typedef struct tagTVITEMEXW { typedef struct tagTVINSERTSTRUCTA { HTREEITEM hParent; HTREEITEM hInsertAfter; - __MINGW_EXTENSION union { + __C89_NAMELESS union { TVITEMEXA itemex; TV_ITEMA item; } DUMMYUNIONNAME; @@ -3427,29 +3139,22 @@ typedef struct tagTVITEMEXW { typedef struct tagTVINSERTSTRUCTW { HTREEITEM hParent; HTREEITEM hInsertAfter; - __MINGW_EXTENSION union { + __C89_NAMELESS union { TVITEMEXW itemex; TV_ITEMW item; } DUMMYUNIONNAME; } TVINSERTSTRUCTW,*LPTVINSERTSTRUCTW; -#ifdef UNICODE -#define TVINSERTSTRUCT TVINSERTSTRUCTW -#define LPTVINSERTSTRUCT LPTVINSERTSTRUCTW -#define TVINSERTSTRUCT_V1_SIZE TVINSERTSTRUCTW_V1_SIZE -#else -#define TVINSERTSTRUCT TVINSERTSTRUCTA -#define LPTVINSERTSTRUCT LPTVINSERTSTRUCTA -#define TVINSERTSTRUCT_V1_SIZE TVINSERTSTRUCTA_V1_SIZE -#endif + +#define TVINSERTSTRUCT __MINGW_NAME_AW(TVINSERTSTRUCT) +#define LPTVINSERTSTRUCT __MINGW_NAME_AW(LPTVINSERTSTRUCT) + +#define TVINSERTSTRUCT_V1_SIZE __MINGW_NAME_AW_EXT(TVINSERTSTRUCT,_V1_SIZE) #define TVM_INSERTITEMA (TV_FIRST+0) #define TVM_INSERTITEMW (TV_FIRST+50) -#ifdef UNICODE -#define TVM_INSERTITEM TVM_INSERTITEMW -#else -#define TVM_INSERTITEM TVM_INSERTITEMA -#endif + +#define TVM_INSERTITEM __MINGW_NAME_AW(TVM_INSERTITEM) #define TreeView_InsertItem(hwnd,lpis) (HTREEITEM)SNDMSG((hwnd),TVM_INSERTITEM,0,(LPARAM)(LPTV_INSERTSTRUCT)(lpis)) @@ -3527,32 +3232,21 @@ typedef struct tagTVITEMEXW { #define TVM_GETITEMA (TV_FIRST+12) #define TVM_GETITEMW (TV_FIRST+62) -#ifdef UNICODE -#define TVM_GETITEM TVM_GETITEMW -#else -#define TVM_GETITEM TVM_GETITEMA -#endif +#define TVM_GETITEM __MINGW_NAME_AW(TVM_GETITEM) #define TreeView_GetItem(hwnd,pitem) (WINBOOL)SNDMSG((hwnd),TVM_GETITEM,0,(LPARAM)(TV_ITEM *)(pitem)) #define TVM_SETITEMA (TV_FIRST+13) #define TVM_SETITEMW (TV_FIRST+63) -#ifdef UNICODE -#define TVM_SETITEM TVM_SETITEMW -#else -#define TVM_SETITEM TVM_SETITEMA -#endif +#define TVM_SETITEM __MINGW_NAME_AW(TVM_SETITEM) #define TreeView_SetItem(hwnd,pitem) (WINBOOL)SNDMSG((hwnd),TVM_SETITEM,0,(LPARAM)(const TV_ITEM *)(pitem)) #define TVM_EDITLABELA (TV_FIRST+14) #define TVM_EDITLABELW (TV_FIRST+65) -#ifdef UNICODE -#define TVM_EDITLABEL TVM_EDITLABELW -#else -#define TVM_EDITLABEL TVM_EDITLABELA -#endif + +#define TVM_EDITLABEL __MINGW_NAME_AW(TVM_EDITLABEL) #define TreeView_EditLabel(hwnd,hitem) (HWND)SNDMSG((hwnd),TVM_EDITLABEL,0,(LPARAM)(HTREEITEM)(hitem)) @@ -3606,11 +3300,7 @@ typedef struct tagTVITEMEXW { #define TVM_GETISEARCHSTRINGA (TV_FIRST+23) #define TVM_GETISEARCHSTRINGW (TV_FIRST+64) -#ifdef UNICODE -#define TVM_GETISEARCHSTRING TVM_GETISEARCHSTRINGW -#else -#define TVM_GETISEARCHSTRING TVM_GETISEARCHSTRINGA -#endif +#define TVM_GETISEARCHSTRING __MINGW_NAME_AW(TVM_GETISEARCHSTRING) #define TVM_SETTOOLTIPS (TV_FIRST+24) #define TreeView_SetToolTips(hwnd,hwndTT) (HWND)SNDMSG((hwnd),TVM_SETTOOLTIPS,(WPARAM)(hwndTT),0) @@ -3696,13 +3386,8 @@ typedef struct tagTVITEMEXW { POINT ptDrag; } NMTREEVIEWW,*LPNMTREEVIEWW; -#ifdef UNICODE -#define NMTREEVIEW NMTREEVIEWW -#define LPNMTREEVIEW LPNMTREEVIEWW -#else -#define NMTREEVIEW NMTREEVIEWA -#define LPNMTREEVIEW LPNMTREEVIEWA -#endif +#define NMTREEVIEW __MINGW_NAME_AW(NMTREEVIEW) +#define LPNMTREEVIEW __MINGW_NAME_AW(LPNMTREEVIEW) #define TVN_SELCHANGINGA (TVN_FIRST-1) #define TVN_SELCHANGINGW (TVN_FIRST-50) @@ -3734,13 +3419,8 @@ typedef struct tagTVITEMEXW { TVITEMW item; } NMTVDISPINFOW,*LPNMTVDISPINFOW; -#ifdef UNICODE -#define NMTVDISPINFO NMTVDISPINFOW -#define LPNMTVDISPINFO LPNMTVDISPINFOW -#else -#define NMTVDISPINFO NMTVDISPINFOA -#define LPNMTVDISPINFO LPNMTVDISPINFOA -#endif +#define NMTVDISPINFO __MINGW_NAME_AW(NMTVDISPINFO) +#define LPNMTVDISPINFO __MINGW_NAME_AW(LPNMTVDISPINFO) #if (_WIN32_IE >= 0x0600) @@ -3754,13 +3434,8 @@ typedef struct tagTVDISPINFOEXW { TVITEMEXW item; } NMTVDISPINFOEXW, *LPNMTVDISPINFOEXW; -#ifdef UNICODE -#define NMTVDISPINFOEX NMTVDISPINFOEXW -#define LPNMTVDISPINFOEX LPNMTVDISPINFOEXW -#else -#define NMTVDISPINFOEX NMTVDISPINFOEXA -#define LPNMTVDISPINFOEX LPNMTVDISPINFOEXA -#endif /* UNICODE */ +#define NMTVDISPINFOEX __MINGW_NAME_AW(NMTVDISPINFOEX) +#define LPNMTVDISPINFOEX __MINGW_NAME_AW(LPNMTVDISPINFOEX) #define TV_DISPINFOEXA NMTVDISPINFOEXA #define TV_DISPINFOEXW NMTVDISPINFOEXW @@ -3803,31 +3478,17 @@ typedef struct tagTVDISPINFOEXW { #include -#ifdef UNICODE -#define TVN_SELCHANGING TVN_SELCHANGINGW -#define TVN_SELCHANGED TVN_SELCHANGEDW -#define TVN_GETDISPINFO TVN_GETDISPINFOW -#define TVN_SETDISPINFO TVN_SETDISPINFOW -#define TVN_ITEMEXPANDING TVN_ITEMEXPANDINGW -#define TVN_ITEMEXPANDED TVN_ITEMEXPANDEDW -#define TVN_BEGINDRAG TVN_BEGINDRAGW -#define TVN_BEGINRDRAG TVN_BEGINRDRAGW -#define TVN_DELETEITEM TVN_DELETEITEMW -#define TVN_BEGINLABELEDIT TVN_BEGINLABELEDITW -#define TVN_ENDLABELEDIT TVN_ENDLABELEDITW -#else -#define TVN_SELCHANGING TVN_SELCHANGINGA -#define TVN_SELCHANGED TVN_SELCHANGEDA -#define TVN_GETDISPINFO TVN_GETDISPINFOA -#define TVN_SETDISPINFO TVN_SETDISPINFOA -#define TVN_ITEMEXPANDING TVN_ITEMEXPANDINGA -#define TVN_ITEMEXPANDED TVN_ITEMEXPANDEDA -#define TVN_BEGINDRAG TVN_BEGINDRAGA -#define TVN_BEGINRDRAG TVN_BEGINRDRAGA -#define TVN_DELETEITEM TVN_DELETEITEMA -#define TVN_BEGINLABELEDIT TVN_BEGINLABELEDITA -#define TVN_ENDLABELEDIT TVN_ENDLABELEDITA -#endif +#define TVN_SELCHANGING __MINGW_NAME_AW(TVN_SELCHANGING) +#define TVN_SELCHANGED __MINGW_NAME_AW(TVN_SELCHANGED) +#define TVN_GETDISPINFO __MINGW_NAME_AW(TVN_GETDISPINFO) +#define TVN_SETDISPINFO __MINGW_NAME_AW(TVN_SETDISPINFO) +#define TVN_ITEMEXPANDING __MINGW_NAME_AW(TVN_ITEMEXPANDING) +#define TVN_ITEMEXPANDED __MINGW_NAME_AW(TVN_ITEMEXPANDED) +#define TVN_BEGINDRAG __MINGW_NAME_AW(TVN_BEGINDRAG) +#define TVN_BEGINRDRAG __MINGW_NAME_AW(TVN_BEGINRDRAG) +#define TVN_DELETEITEM __MINGW_NAME_AW(TVN_DELETEITEM) +#define TVN_BEGINLABELEDIT __MINGW_NAME_AW(TVN_BEGINLABELEDIT) +#define TVN_ENDLABELEDIT __MINGW_NAME_AW(TVN_ENDLABELEDIT) #define NMTVCUSTOMDRAW_V3_SIZE CCSIZEOF_STRUCT(NMTVCUSTOMDRAW,clrTextBk) @@ -3854,15 +3515,9 @@ typedef struct tagTVDISPINFOEXW { LPARAM lParam; } NMTVGETINFOTIPW,*LPNMTVGETINFOTIPW; -#ifdef UNICODE -#define TVN_GETINFOTIP TVN_GETINFOTIPW -#define NMTVGETINFOTIP NMTVGETINFOTIPW -#define LPNMTVGETINFOTIP LPNMTVGETINFOTIPW -#else -#define TVN_GETINFOTIP TVN_GETINFOTIPA -#define NMTVGETINFOTIP NMTVGETINFOTIPA -#define LPNMTVGETINFOTIP LPNMTVGETINFOTIPA -#endif +#define TVN_GETINFOTIP __MINGW_NAME_AW(TVN_GETINFOTIP) +#define NMTVGETINFOTIP __MINGW_NAME_AW(NMTVGETINFOTIP) +#define LPNMTVGETINFOTIP __MINGW_NAME_AW(LPNMTVGETINFOTIP) #define TVCDRF_NOIMAGES 0x10000 #endif @@ -3872,11 +3527,7 @@ typedef struct tagTVDISPINFOEXW { #define WC_COMBOBOXEXW L"ComboBoxEx32" #define WC_COMBOBOXEXA "ComboBoxEx32" -#ifdef UNICODE -#define WC_COMBOBOXEX WC_COMBOBOXEXW -#else -#define WC_COMBOBOXEX WC_COMBOBOXEXA -#endif +#define WC_COMBOBOXEX __MINGW_NAME_AW(WC_COMBOBOXEX) #define CBEIF_TEXT 0x1 #define CBEIF_IMAGE 0x2 @@ -3914,15 +3565,9 @@ typedef struct tagTVDISPINFOEXW { } COMBOBOXEXITEMW,*PCOMBOBOXEXITEMW; typedef COMBOBOXEXITEMW CONST *PCCOMBOEXITEMW; -#ifdef UNICODE -#define COMBOBOXEXITEM COMBOBOXEXITEMW -#define PCOMBOBOXEXITEM PCOMBOBOXEXITEMW -#define PCCOMBOBOXEXITEM PCCOMBOBOXEXITEMW -#else -#define COMBOBOXEXITEM COMBOBOXEXITEMA -#define PCOMBOBOXEXITEM PCOMBOBOXEXITEMA -#define PCCOMBOBOXEXITEM PCCOMBOBOXEXITEMA -#endif +#define COMBOBOXEXITEM __MINGW_NAME_AW(COMBOBOXEXITEM) +#define PCOMBOBOXEXITEM __MINGW_NAME_AW(PCOMBOBOXEXITEM) +#define PCCOMBOBOXEXITEM __MINGW_NAME_AW(PCCOMBOBOXEXITEM) #define CBEM_INSERTITEMA (WM_USER+1) #define CBEM_SETIMAGELIST (WM_USER+2) @@ -3943,15 +3588,9 @@ typedef struct tagTVDISPINFOEXW { #define CBEM_SETITEMW (WM_USER+12) #define CBEM_GETITEMW (WM_USER+13) -#ifdef UNICODE -#define CBEM_INSERTITEM CBEM_INSERTITEMW -#define CBEM_SETITEM CBEM_SETITEMW -#define CBEM_GETITEM CBEM_GETITEMW -#else -#define CBEM_INSERTITEM CBEM_INSERTITEMA -#define CBEM_SETITEM CBEM_SETITEMA -#define CBEM_GETITEM CBEM_GETITEMA -#endif +#define CBEM_INSERTITEM __MINGW_NAME_AW(CBEM_INSERTITEM) +#define CBEM_SETITEM __MINGW_NAME_AW(CBEM_SETITEM) +#define CBEM_GETITEM __MINGW_NAME_AW(CBEM_GETITEM) #define CBEM_SETWINDOWTHEME CCM_SETWINDOWTHEME @@ -3971,15 +3610,9 @@ typedef struct tagTVDISPINFOEXW { COMBOBOXEXITEMW ceItem; } NMCOMBOBOXEXW,*PNMCOMBOBOXEXW; -#ifdef UNICODE -#define NMCOMBOBOXEX NMCOMBOBOXEXW -#define PNMCOMBOBOXEX PNMCOMBOBOXEXW -#define CBEN_GETDISPINFO CBEN_GETDISPINFOW -#else -#define NMCOMBOBOXEX NMCOMBOBOXEXA -#define PNMCOMBOBOXEX PNMCOMBOBOXEXA -#define CBEN_GETDISPINFO CBEN_GETDISPINFOA -#endif +#define NMCOMBOBOXEX __MINGW_NAME_AW(NMCOMBOBOXEX) +#define PNMCOMBOBOXEX __MINGW_NAME_AW(PNMCOMBOBOXEX) +#define CBEN_GETDISPINFO __MINGW_NAME_AW(CBEN_GETDISPINFO) #define CBEN_GETDISPINFOA (CBEN_FIRST - 0) #define CBEN_INSERTITEM (CBEN_FIRST - 1) @@ -3993,17 +3626,9 @@ typedef struct tagTVDISPINFOEXW { #define CBEN_DRAGBEGINA (CBEN_FIRST - 8) #define CBEN_DRAGBEGINW (CBEN_FIRST - 9) -#ifdef UNICODE -#define CBEN_DRAGBEGIN CBEN_DRAGBEGINW -#else -#define CBEN_DRAGBEGIN CBEN_DRAGBEGINA -#endif +#define CBEN_DRAGBEGIN __MINGW_NAME_AW(CBEN_DRAGBEGIN) -#ifdef UNICODE -#define CBEN_ENDEDIT CBEN_ENDEDITW -#else -#define CBEN_ENDEDIT CBEN_ENDEDITA -#endif +#define CBEN_ENDEDIT __MINGW_NAME_AW(CBEN_ENDEDIT) #define CBENF_KILLFOCUS 1 #define CBENF_RETURN 2 @@ -4024,15 +3649,9 @@ typedef struct tagTVDISPINFOEXW { char szText[CBEMAXSTRLEN]; }NMCBEDRAGBEGINA,*LPNMCBEDRAGBEGINA,*PNMCBEDRAGBEGINA; -#ifdef UNICODE -#define NMCBEDRAGBEGIN NMCBEDRAGBEGINW -#define LPNMCBEDRAGBEGIN LPNMCBEDRAGBEGINW -#define PNMCBEDRAGBEGIN PNMCBEDRAGBEGINW -#else -#define NMCBEDRAGBEGIN NMCBEDRAGBEGINA -#define LPNMCBEDRAGBEGIN LPNMCBEDRAGBEGINA -#define PNMCBEDRAGBEGIN PNMCBEDRAGBEGINA -#endif +#define NMCBEDRAGBEGIN __MINGW_NAME_AW(NMCBEDRAGBEGIN) +#define LPNMCBEDRAGBEGIN __MINGW_NAME_AW(LPNMCBEDRAGBEGIN) +#define PNMCBEDRAGBEGIN __MINGW_NAME_AW(PNMCBEDRAGBEGIN) typedef struct { NMHDR hdr; @@ -4050,26 +3669,17 @@ typedef struct tagTVDISPINFOEXW { int iWhy; } NMCBEENDEDITA,*LPNMCBEENDEDITA,*PNMCBEENDEDITA; -#ifdef UNICODE -#define NMCBEENDEDIT NMCBEENDEDITW -#define LPNMCBEENDEDIT LPNMCBEENDEDITW -#define PNMCBEENDEDIT PNMCBEENDEDITW -#else -#define NMCBEENDEDIT NMCBEENDEDITA -#define LPNMCBEENDEDIT LPNMCBEENDEDITA -#define PNMCBEENDEDIT PNMCBEENDEDITA -#endif +#define NMCBEENDEDIT __MINGW_NAME_AW(NMCBEENDEDIT) +#define LPNMCBEENDEDIT __MINGW_NAME_AW(LPNMCBEENDEDIT) +#define PNMCBEENDEDIT __MINGW_NAME_AW(PNMCBEENDEDIT) + #endif #ifndef NOTABCONTROL #define WC_TABCONTROLA "SysTabControl32" #define WC_TABCONTROLW L"SysTabControl32" -#ifdef UNICODE -#define WC_TABCONTROL WC_TABCONTROLW -#else -#define WC_TABCONTROL WC_TABCONTROLA -#endif +#define WC_TABCONTROL __MINGW_NAME_AW(WC_TABCONTROL) #define TCS_SCROLLOPPOSITE 0x1 #define TCS_BOTTOM 0x2 @@ -4135,13 +3745,8 @@ typedef struct tagTVDISPINFOEXW { int iImage; } TCITEMHEADERW,*LPTCITEMHEADERW; -#ifdef UNICODE -#define TCITEMHEADER TCITEMHEADERW -#define LPTCITEMHEADER LPTCITEMHEADERW -#else -#define TCITEMHEADER TCITEMHEADERA -#define LPTCITEMHEADER LPTCITEMHEADERA -#endif +#define TCITEMHEADER __MINGW_NAME_AW(TCITEMHEADER) +#define LPTCITEMHEADER __MINGW_NAME_AW(LPTCITEMHEADER) #define TC_ITEMA TCITEMA #define TC_ITEMW TCITEMW @@ -4167,44 +3772,27 @@ typedef struct tagTVDISPINFOEXW { LPARAM lParam; } TCITEMW,*LPTCITEMW; -#ifdef UNICODE -#define TCITEM TCITEMW -#define LPTCITEM LPTCITEMW -#else -#define TCITEM TCITEMA -#define LPTCITEM LPTCITEMA -#endif +#define TCITEM __MINGW_NAME_AW(TCITEM) +#define LPTCITEM __MINGW_NAME_AW(LPTCITEM) #define TCM_GETITEMA (TCM_FIRST+5) #define TCM_GETITEMW (TCM_FIRST+60) -#ifdef UNICODE -#define TCM_GETITEM TCM_GETITEMW -#else -#define TCM_GETITEM TCM_GETITEMA -#endif +#define TCM_GETITEM __MINGW_NAME_AW(TCM_GETITEM) #define TabCtrl_GetItem(hwnd,iItem,pitem) (WINBOOL)SNDMSG((hwnd),TCM_GETITEM,(WPARAM)(int)(iItem),(LPARAM)(TC_ITEM *)(pitem)) #define TCM_SETITEMA (TCM_FIRST+6) #define TCM_SETITEMW (TCM_FIRST+61) -#ifdef UNICODE -#define TCM_SETITEM TCM_SETITEMW -#else -#define TCM_SETITEM TCM_SETITEMA -#endif +#define TCM_SETITEM __MINGW_NAME_AW(TCM_SETITEM) #define TabCtrl_SetItem(hwnd,iItem,pitem) (WINBOOL)SNDMSG((hwnd),TCM_SETITEM,(WPARAM)(int)(iItem),(LPARAM)(TC_ITEM *)(pitem)) #define TCM_INSERTITEMA (TCM_FIRST+7) #define TCM_INSERTITEMW (TCM_FIRST+62) -#ifdef UNICODE -#define TCM_INSERTITEM TCM_INSERTITEMW -#else -#define TCM_INSERTITEM TCM_INSERTITEMA -#endif +#define TCM_INSERTITEM __MINGW_NAME_AW(TCM_INSERTITEM) #define TabCtrl_InsertItem(hwnd,iItem,pitem) (int)SNDMSG((hwnd),TCM_INSERTITEM,(WPARAM)(int)(iItem),(LPARAM)(const TC_ITEM *)(pitem)) @@ -4297,11 +3885,8 @@ typedef struct tagTVDISPINFOEXW { #define ANIMATE_CLASSW L"SysAnimate32" #define ANIMATE_CLASSA "SysAnimate32" -#ifdef UNICODE -#define ANIMATE_CLASS ANIMATE_CLASSW -#else -#define ANIMATE_CLASS ANIMATE_CLASSA -#endif + +#define ANIMATE_CLASS __MINGW_NAME_AW(ANIMATE_CLASS) #define ACS_CENTER 0x1 #define ACS_TRANSPARENT 0x2 @@ -4310,11 +3895,8 @@ typedef struct tagTVDISPINFOEXW { #define ACM_OPENA (WM_USER+100) #define ACM_OPENW (WM_USER+103) -#ifdef UNICODE -#define ACM_OPEN ACM_OPENW -#else -#define ACM_OPEN ACM_OPENA -#endif + +#define ACM_OPEN __MINGW_NAME_AW(ACM_OPEN) #define ACM_PLAY (WM_USER+101) #define ACM_STOP (WM_USER+102) @@ -4335,11 +3917,8 @@ typedef struct tagTVDISPINFOEXW { #ifndef NOMONTHCAL #define MONTHCAL_CLASSW L"SysMonthCal32" #define MONTHCAL_CLASSA "SysMonthCal32" -#ifdef UNICODE -#define MONTHCAL_CLASS MONTHCAL_CLASSW -#else -#define MONTHCAL_CLASS MONTHCAL_CLASSA -#endif + +#define MONTHCAL_CLASS __MINGW_NAME_AW(MONTHCAL_CLASS) typedef DWORD MONTHDAYSTATE,*LPMONTHDAYSTATE; @@ -4382,13 +3961,18 @@ typedef struct tagTVDISPINFOEXW { #define MCM_HITTEST (MCM_FIRST+14) #define MonthCal_HitTest(hmc,pinfo) SNDMSG(hmc,MCM_HITTEST,0,(LPARAM)(PMCHITTESTINFO)(pinfo)) - typedef struct { - UINT cbSize; - POINT pt; - - UINT uHit; - SYSTEMTIME st; - } MCHITTESTINFO,*PMCHITTESTINFO; +typedef struct { + UINT cbSize; + POINT pt; + UINT uHit; + SYSTEMTIME st; +#if(NTDDI_VERSION >= NTDDI_VISTA) + RECT rc; + int iOffset; + int iRow; + int iCol; +#endif +} MCHITTESTINFO, *PMCHITTESTINFO; #define MCHITTESTINFO_V1_SIZE CCSIZEOF_STRUCT(MCHITTESTINFO, st) @@ -4432,6 +4016,8 @@ typedef struct tagTVDISPINFOEXW { #define MonthCal_SetUnicodeFormat(hwnd,fUnicode) (WINBOOL)SNDMSG((hwnd),MCM_SETUNICODEFORMAT,(WPARAM)(fUnicode),0) #define MCM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT #define MonthCal_GetUnicodeFormat(hwnd) (WINBOOL)SNDMSG((hwnd),MCM_GETUNICODEFORMAT,0,0) +#define MCM_SETCALENDARBORDER (MCM_FIRST + 30) +#define MCM_GETCALENDARBORDER (MCM_FIRST + 31) typedef struct tagNMSELCHANGE { NMHDR nmhdr; @@ -4455,16 +4041,12 @@ typedef struct tagTVDISPINFOEXW { #define MCN_SELECT (MCN_FIRST+4) -#define MCS_DAYSTATE 0x0001 -#define MCS_MULTISELECT 0x0002 -#define MCS_WEEKNUMBERS 0x0004 -#define MCS_NOTODAYCIRCLE 0x0008 -#define MCS_NOTODAY 0x0010 -#if (NTDDI_VERSION >= NTDDI_VISTA) -#define MCS_NOTRAILINGDATES 0x0040 -#define MCS_SHORTDAYSOFWEEK 0x0080 -#define MCS_NOSELCHANGEONNAV 0x0100 -#endif +#define MCS_DAYSTATE 0x0001 +#define MCS_MULTISELECT 0x0002 +#define MCS_WEEKNUMBERS 0x0004 +#define MCS_NOTODAYCIRCLE 0x0008 +#define MCS_NOTODAY 0x0010 +#define MCS_NOTRAILINGDATES 0x0040 #define GMR_VISIBLE 0 #define GMR_DAYSTATE 1 @@ -4473,11 +4055,9 @@ typedef struct tagTVDISPINFOEXW { #ifndef NODATETIMEPICK #define DATETIMEPICK_CLASSW L"SysDateTimePick32" #define DATETIMEPICK_CLASSA "SysDateTimePick32" -#ifdef UNICODE -#define DATETIMEPICK_CLASS DATETIMEPICK_CLASSW -#else -#define DATETIMEPICK_CLASS DATETIMEPICK_CLASSA -#endif + +#define DATETIMEPICK_CLASS __MINGW_NAME_AW(DATETIMEPICK_CLASS) + #define DTM_FIRST 0x1000 #define DTM_GETSYSTEMTIME (DTM_FIRST+1) @@ -4491,11 +4071,7 @@ typedef struct tagTVDISPINFOEXW { #define DTM_SETFORMATA (DTM_FIRST+5) #define DTM_SETFORMATW (DTM_FIRST+50) -#ifdef UNICODE -#define DTM_SETFORMAT DTM_SETFORMATW -#else -#define DTM_SETFORMAT DTM_SETFORMATA -#endif +#define DTM_SETFORMAT __MINGW_NAME_AW(DTM_SETFORMAT) #define DateTime_SetFormat(hdp,sz) (WINBOOL)SNDMSG(hdp,DTM_SETFORMAT,0,(LPARAM)(sz)) @@ -4542,15 +4118,9 @@ typedef struct tagTVDISPINFOEXW { DWORD dwFlags; } NMDATETIMESTRINGW,*LPNMDATETIMESTRINGW; -#ifdef UNICODE -#define DTN_USERSTRING DTN_USERSTRINGW -#define NMDATETIMESTRING NMDATETIMESTRINGW -#define LPNMDATETIMESTRING LPNMDATETIMESTRINGW -#else -#define DTN_USERSTRING DTN_USERSTRINGA -#define NMDATETIMESTRING NMDATETIMESTRINGA -#define LPNMDATETIMESTRING LPNMDATETIMESTRINGA -#endif +#define DTN_USERSTRING __MINGW_NAME_AW(DTN_USERSTRING) +#define NMDATETIMESTRING __MINGW_NAME_AW(NMDATETIMESTRING) +#define LPNMDATETIMESTRING __MINGW_NAME_AW(LPNMDATETIMESTRING) #define DTN_WMKEYDOWNA (DTN_FIRST+3) #define DTN_WMKEYDOWNW (DTN_FIRST+16) @@ -4568,15 +4138,9 @@ typedef struct tagTVDISPINFOEXW { SYSTEMTIME st; } NMDATETIMEWMKEYDOWNW,*LPNMDATETIMEWMKEYDOWNW; -#ifdef UNICODE -#define DTN_WMKEYDOWN DTN_WMKEYDOWNW -#define NMDATETIMEWMKEYDOWN NMDATETIMEWMKEYDOWNW -#define LPNMDATETIMEWMKEYDOWN LPNMDATETIMEWMKEYDOWNW -#else -#define DTN_WMKEYDOWN DTN_WMKEYDOWNA -#define NMDATETIMEWMKEYDOWN NMDATETIMEWMKEYDOWNA -#define LPNMDATETIMEWMKEYDOWN LPNMDATETIMEWMKEYDOWNA -#endif +#define DTN_WMKEYDOWN __MINGW_NAME_AW(DTN_WMKEYDOWN) +#define NMDATETIMEWMKEYDOWN __MINGW_NAME_AW(NMDATETIMEWMKEYDOWN) +#define LPNMDATETIMEWMKEYDOWN __MINGW_NAME_AW(LPNMDATETIMEWMKEYDOWN) #define DTN_FORMATA (DTN_FIRST+4) #define DTN_FORMATW (DTN_FIRST+17) @@ -4596,15 +4160,9 @@ typedef struct tagTVDISPINFOEXW { WCHAR szDisplay[64]; } NMDATETIMEFORMATW,*LPNMDATETIMEFORMATW; -#ifdef UNICODE -#define DTN_FORMAT DTN_FORMATW -#define NMDATETIMEFORMAT NMDATETIMEFORMATW -#define LPNMDATETIMEFORMAT LPNMDATETIMEFORMATW -#else -#define DTN_FORMAT DTN_FORMATA -#define NMDATETIMEFORMAT NMDATETIMEFORMATA -#define LPNMDATETIMEFORMAT LPNMDATETIMEFORMATA -#endif +#define DTN_FORMAT __MINGW_NAME_AW(DTN_FORMAT) +#define NMDATETIMEFORMAT __MINGW_NAME_AW(NMDATETIMEFORMAT) +#define LPNMDATETIMEFORMAT __MINGW_NAME_AW(LPNMDATETIMEFORMAT) #define DTN_FORMATQUERYA (DTN_FIRST+5) #define DTN_FORMATQUERYW (DTN_FIRST+18) @@ -4620,15 +4178,9 @@ typedef struct tagTVDISPINFOEXW { SIZE szMax; } NMDATETIMEFORMATQUERYW,*LPNMDATETIMEFORMATQUERYW; -#ifdef UNICODE -#define DTN_FORMATQUERY DTN_FORMATQUERYW -#define NMDATETIMEFORMATQUERY NMDATETIMEFORMATQUERYW -#define LPNMDATETIMEFORMATQUERY LPNMDATETIMEFORMATQUERYW -#else -#define DTN_FORMATQUERY DTN_FORMATQUERYA -#define NMDATETIMEFORMATQUERY NMDATETIMEFORMATQUERYA -#define LPNMDATETIMEFORMATQUERY LPNMDATETIMEFORMATQUERYA -#endif +#define DTN_FORMATQUERY __MINGW_NAME_AW(DTN_FORMATQUERY) +#define NMDATETIMEFORMATQUERY __MINGW_NAME_AW(NMDATETIMEFORMATQUERY) +#define LPNMDATETIMEFORMATQUERY __MINGW_NAME_AW(LPNMDATETIMEFORMATQUERY) #define DTN_DROPDOWN (DTN_FIRST+6) #define DTN_CLOSEUP (DTN_FIRST+7) @@ -4651,11 +4203,7 @@ typedef struct tagTVDISPINFOEXW { #define WC_IPADDRESSW L"SysIPAddress32" #define WC_IPADDRESSA "SysIPAddress32" -#ifdef UNICODE -#define WC_IPADDRESS WC_IPADDRESSW -#else -#define WC_IPADDRESS WC_IPADDRESSA -#endif +#define WC_IPADDRESS __MINGW_NAME_AW(WC_IPADDRESS) #define IPN_FIELDCHANGED (IPN_FIRST - 0) typedef struct tagNMIPADDRESS { @@ -4678,11 +4226,7 @@ typedef struct tagTVDISPINFOEXW { #define WC_PAGESCROLLERW L"SysPager" #define WC_PAGESCROLLERA "SysPager" -#ifdef UNICODE -#define WC_PAGESCROLLER WC_PAGESCROLLERW -#else -#define WC_PAGESCROLLER WC_PAGESCROLLERA -#endif +#define WC_PAGESCROLLER __MINGW_NAME_AW(WC_PAGESCROLLER) #define PGS_VERT 0x0 #define PGS_HORZ 0x1 @@ -4790,11 +4334,7 @@ typedef struct tagTVDISPINFOEXW { #define WC_NATIVEFONTCTLW L"NativeFontCtl" #define WC_NATIVEFONTCTLA "NativeFontCtl" -#ifdef UNICODE -#define WC_NATIVEFONTCTL WC_NATIVEFONTCTLW -#else -#define WC_NATIVEFONTCTL WC_NATIVEFONTCTLA -#endif +#define WC_NATIVEFONTCTL __MINGW_NAME_AW(WC_NATIVEFONTCTL) #define NFS_EDIT 0x1 #define NFS_STATIC 0x2 @@ -4807,11 +4347,8 @@ typedef struct tagTVDISPINFOEXW { #ifndef NOBUTTON #define WC_BUTTONA "Button" #define WC_BUTTONW L"Button" -#ifdef UNICODE -#define WC_BUTTON WC_BUTTONW -#else -#define WC_BUTTON WC_BUTTONA -#endif + +#define WC_BUTTON __MINGW_NAME_AW(WC_BUTTON) #define BUTTON_IMAGELIST_ALIGN_LEFT 0 #define BUTTON_IMAGELIST_ALIGN_RIGHT 1 @@ -4853,20 +4390,14 @@ typedef struct tagTVDISPINFOEXW { #ifndef NOSTATIC #define WC_STATICA "Static" #define WC_STATICW L"Static" -#ifdef UNICODE -#define WC_STATIC WC_STATICW -#else -#define WC_STATIC WC_STATICA -#endif + +#define WC_STATIC __MINGW_NAME_AW(WC_STATIC) #ifndef NOEDIT #define WC_EDITA "Edit" #define WC_EDITW L"Edit" -#ifdef UNICODE -#define WC_EDIT WC_EDITW -#else -#define WC_EDIT WC_EDITA -#endif + +#define WC_EDIT __MINGW_NAME_AW(WC_EDIT) #define EM_SETCUEBANNER (ECM_FIRST+1) #define Edit_SetCueBannerText(hwnd,lpcwText) (WINBOOL)SNDMSG((hwnd),EM_SETCUEBANNER,0,(LPARAM)(lpcwText)) @@ -4888,21 +4419,17 @@ typedef struct tagTVDISPINFOEXW { #ifndef NOLISTBOX #define WC_LISTBOXA "ListBox" #define WC_LISTBOXW L"ListBox" -#ifdef UNICODE -#define WC_LISTBOX WC_LISTBOXW -#else -#define WC_LISTBOX WC_LISTBOXA -#endif + +#define WC_LISTBOX __MINGW_NAME_AW(WC_LISTBOX) + #endif #ifndef NOCOMBOBOX #define WC_COMBOBOXA "ComboBox" #define WC_COMBOBOXW L"ComboBox" -#ifdef UNICODE -#define WC_COMBOBOX WC_COMBOBOXW -#else -#define WC_COMBOBOX WC_COMBOBOXA -#endif + +#define WC_COMBOBOX __MINGW_NAME_AW(WC_COMBOBOX) + #endif #define CB_SETMINVISIBLE (CBM_FIRST+1) @@ -4914,11 +4441,9 @@ typedef struct tagTVDISPINFOEXW { #ifndef NOSCROLLBAR #define WC_SCROLLBARA "ScrollBar" #define WC_SCROLLBARW L"ScrollBar" -#ifdef UNICODE -#define WC_SCROLLBAR WC_SCROLLBARW -#else -#define WC_SCROLLBAR WC_SCROLLBARA -#endif + +#define WC_SCROLLBAR __MINGW_NAME_AW(WC_SCROLLBAR) + #endif #define INVALID_LINK_INDEX (-1) @@ -5010,6 +4535,40 @@ typedef struct tagTVDISPINFOEXW { WINCOMMCTRLAPI int WINAPI DPA_Search(HDPA hdpa,void *pFind,int iStart,PFNDPACOMPARE pfnCompare,LPARAM lParam,UINT options); WINCOMMCTRLAPI WINBOOL WINAPI Str_SetPtrW(LPWSTR *ppsz,LPCWSTR psz); +typedef struct _DPASTREAMINFO { + int iPos; + void *pvItem; +} DPASTREAMINFO; + +struct IStream; +typedef HRESULT (CALLBACK *PFNDPASTREAM)(DPASTREAMINFO*, struct IStream*, void*); +typedef void* (CALLBACK *PFNDPAMERGE)(UINT, void*, void*, LPARAM); +typedef const void* (CALLBACK *PFNDPAMERGECONST)(UINT, const void*, const void*, LPARAM); + + WINCOMMCTRLAPI HRESULT WINAPI DPA_LoadStream(HDPA * phdpa, PFNDPASTREAM pfn, struct IStream * pstream, void *pvInstData); + WINCOMMCTRLAPI HRESULT WINAPI DPA_SaveStream(HDPA hdpa, PFNDPASTREAM pfn, struct IStream * pstream, void *pvInstData); + WINCOMMCTRLAPI WINBOOL WINAPI DPA_Grow(HDPA pdpa, int cp); + WINCOMMCTRLAPI int WINAPI DPA_InsertPtr(HDPA hdpa, int i, void *p); + WINCOMMCTRLAPI PVOID WINAPI DPA_GetPtr(HDPA hdpa, INT_PTR i); + WINCOMMCTRLAPI WINBOOL WINAPI DPA_SetPtr(HDPA hdpa, int i, void *p); + WINCOMMCTRLAPI int WINAPI DPA_GetPtrIndex(HDPA hdpa, const void *p); + +#define DPA_GetPtrCount(hdpa) (*(int *)(hdpa)) +#define DPA_SetPtrCount(hdpa, cItems) (*(int *)(hdpa) = (cItems)) +#define DPA_GetPtrPtr(hdpa) (*((void * **)((BYTE *)(hdpa) + sizeof(void *)))) +#define DPA_AppendPtr(hdpa, pitem) DPA_InsertPtr(hdpa, DA_LAST, pitem) +#define DPA_FastDeleteLastPtr(hdpa) (--*(int *)(hdpa)) +#define DPA_FastGetPtr(hdpa, i) (DPA_GetPtrPtr(hdpa)[i]) + +#define DPAM_SORTED 1 +#define DPAM_NORMAL 2 +#define DPAM_UNION 4 +#define DPAM_INTERSECT 8 + +#define DPAMM_MERGE 1 +#define DPAMM_DELETE 2 +#define DPAMM_INSERT 3 + #ifndef NOTRACKMOUSEEVENT #ifndef WM_MOUSEHOVER @@ -5088,39 +4647,91 @@ typedef struct tagTVDISPINFOEXW { LRESULT WINAPI DefSubclassProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam); int WINAPI DrawShadowText(HDC hdc,LPCWSTR pszText,UINT cch,RECT *prc,DWORD dwFlags,COLORREF crText,COLORREF crShadow,int ixOffset,int iyOffset); -typedef struct _DPASTREAMINFO { - int iPos; - void *pvItem; -} DPASTREAMINFO; +#ifndef NOTASKDIALOG -struct IStream; -typedef HRESULT (CALLBACK *PFNDPASTREAM)(DPASTREAMINFO*, struct IStream*, void*); -typedef void* (CALLBACK *PFNDPAMERGE)(UINT, void*, void*, LPARAM); -typedef const void* (CALLBACK *PFNDPAMERGECONST)(UINT, const void*, const void*, LPARAM); +#include - WINCOMMCTRLAPI HRESULT WINAPI DPA_LoadStream(HDPA * phdpa, PFNDPASTREAM pfn, struct IStream * pstream, void *pvInstData); - WINCOMMCTRLAPI HRESULT WINAPI DPA_SaveStream(HDPA hdpa, PFNDPASTREAM pfn, struct IStream * pstream, void *pvInstData); - WINCOMMCTRLAPI BOOL WINAPI DPA_Grow(HDPA pdpa, IN int cp); - WINCOMMCTRLAPI int WINAPI DPA_InsertPtr(HDPA hdpa, IN int i, void *p); - WINCOMMCTRLAPI PVOID WINAPI DPA_GetPtr(HDPA hdpa, INT_PTR i); - WINCOMMCTRLAPI BOOL WINAPI DPA_SetPtr(HDPA hdpa, IN int i, void *p); - WINCOMMCTRLAPI int WINAPI DPA_GetPtrIndex(HDPA hdpa, const void *p); +enum _TASKDIALOG_FLAGS +{ + TDF_ENABLE_HYPERLINKS = 0x0001, + TDF_USE_HICON_MAIN = 0x0002, + TDF_USE_HICON_FOOTER = 0x0004, + TDF_ALLOW_DIALOG_CANCELLATION = 0x0008, + TDF_USE_COMMAND_LINKS = 0x0010, + TDF_USE_COMMAND_LINKS_NO_ICON = 0x0020, + TDF_EXPAND_FOOTER_AREA = 0x0040, + TDF_EXPANDED_BY_DEFAULT = 0x0080, + TDF_VERIFICATION_FLAG_CHECKED = 0x0100, + TDF_SHOW_PROGRESS_BAR = 0x0200, + TDF_SHOW_MARQUEE_PROGRESS_BAR = 0x0400, + TDF_CALLBACK_TIMER = 0x0800, + TDF_POSITION_RELATIVE_TO_WINDOW = 0x1000, + TDF_RTL_LAYOUT = 0x2000, + TDF_NO_DEFAULT_RADIO_BUTTON = 0x4000, + TDF_CAN_BE_MINIMIZED = 0x8000 +}; +typedef int TASKDIALOG_FLAGS; -#define DPA_GetPtrCount(hdpa) (*(int *)(hdpa)) -#define DPA_SetPtrCount(hdpa, cItems) (*(int *)(hdpa) = (cItems)) -#define DPA_GetPtrPtr(hdpa) (*((void * **)((BYTE *)(hdpa) + sizeof(void *)))) -#define DPA_AppendPtr(hdpa, pitem) DPA_InsertPtr(hdpa, DA_LAST, pitem) -#define DPA_FastDeleteLastPtr(hdpa) (--*(int *)(hdpa)) -#define DPA_FastGetPtr(hdpa, i) (DPA_GetPtrPtr(hdpa)[i]) +enum _TASKDIALOG_COMMON_BUTTON_FLAGS +{ + TDCBF_OK_BUTTON = 0x0001, + TDCBF_YES_BUTTON = 0x0002, + TDCBF_NO_BUTTON = 0x0004, + TDCBF_CANCEL_BUTTON = 0x0008, + TDCBF_RETRY_BUTTON = 0x0010, + TDCBF_CLOSE_BUTTON = 0x0020 +}; +typedef int TASKDIALOG_COMMON_BUTTON_FLAGS; -#define DPAM_SORTED 1 -#define DPAM_NORMAL 2 -#define DPAM_UNION 4 -#define DPAM_INTERSECT 8 +typedef struct _TASKDIALOG_BUTTON +{ + int nButtonID; + PCWSTR pszButtonText; +} TASKDIALOG_BUTTON; -#define DPAMM_MERGE 1 -#define DPAMM_DELETE 2 -#define DPAMM_INSERT 3 +typedef HRESULT (CALLBACK *PFTASKDIALOGCALLBACK)(HWND, UINT, WPARAM, LPARAM, LONG_PTR); + +typedef struct _TASKDIALOGCONFIG +{ + UINT cbSize; + HWND hwndParent; + HINSTANCE hInstance; + TASKDIALOG_FLAGS dwFlags; + TASKDIALOG_COMMON_BUTTON_FLAGS dwCommonButtons; + PCWSTR pszWindowTitle; + union + { + HICON hMainIcon; + PCWSTR pszMainIcon; + } DUMMYUNIONNAME; + PCWSTR pszMainInstruction; + PCWSTR pszContent; + UINT cButtons; + const TASKDIALOG_BUTTON *pButtons; + int nDefaultButton; + UINT cRadioButtons; + const TASKDIALOG_BUTTON *pRadioButtons; + int nDefaultRadioButton; + PCWSTR pszVerificationText; + PCWSTR pszExpandedInformation; + PCWSTR pszExpandedControlText; + PCWSTR pszCollapsedControlText; + union + { + HICON hFooterIcon; + PCWSTR pszFooterIcon; + } DUMMYUNIONNAME2; + PCWSTR pszFooter; + PFTASKDIALOGCALLBACK pfCallback; + LONG_PTR lpCallbackData; + UINT cxWidth; +} TASKDIALOGCONFIG; + +HRESULT WINAPI TaskDialogIndirect(const TASKDIALOGCONFIG *, int *, int *, BOOL *); + +#include + +#endif /* NOTASKDIALOG */ #ifdef __cplusplus } diff --git a/include/psdk/richedit.h b/include/psdk/richedit.h index 095cc8ab554..b0dcd04fa3d 100644 --- a/include/psdk/richedit.h +++ b/include/psdk/richedit.h @@ -32,19 +32,20 @@ extern "C" { #define cchTextLimitDefault 0x7fff -#if defined(__GNUC__) -# define MSFTEDIT_CLASS (const WCHAR []){ 'R','i','c','h','E','d','i','t','5','0','W',0 } -#elif defined(_MSC_VER) +#if defined(_MSC_VER) || defined(RC_INVOKED) # define MSFTEDIT_CLASS L"RichEdit50W" +#elif defined(__GNUC__) +# define MSFTEDIT_CLASS (const WCHAR []){ 'R','i','c','h','E','d','i','t','5','0','W',0 } #else static const WCHAR MSFTEDIT_CLASS[] = { 'R','i','c','h','E','d','i','t','5','0','W',0 }; #endif #define RICHEDIT_CLASS20A "RichEdit20A" -#if defined(__GNUC__) + +#if defined(_MSC_VER) || defined(RC_INVOKED) +# define RICHEDIT_CLASS20W L"RichEdit20W" +#elif defined(__GNUC__) # define RICHEDIT_CLASS20W (const WCHAR []){ 'R','i','c','h','E','d','i','t','2','0','W',0 } -#elif defined(_MSC_VER) -# define RICHEDIT_CLASS20W L"RichEdit20W" #else static const WCHAR RICHEDIT_CLASS20W[] = { 'R','i','c','h','E','d','i','t','2','0','W',0 }; #endif diff --git a/include/psdk/setupapi.h b/include/psdk/setupapi.h index e2756f293ed..066d78d477e 100644 --- a/include/psdk/setupapi.h +++ b/include/psdk/setupapi.h @@ -1116,24 +1116,15 @@ typedef SP_REGISTER_CONTROL_STATUSA SP_REGISTER_CONTROL_STATUS, *PSP_REGISTER_CO WINSETUPAPI LONG WINAPI AddTagToGroupOrderList(PCWSTR, DWORD, DWORD); WINSETUPAPI VOID WINAPI AssertFail(LPSTR, UINT, LPSTR); -WINSETUPAPI DWORD WINAPI CaptureAndConvertAnsiArg(PCSTR, PWSTR*); WINSETUPAPI DWORD WINAPI CaptureStringArg(PCWSTR, PWSTR*); -WINSETUPAPI VOID WINAPI CenterWindowRelativeToParent(HWND); -WINSETUPAPI BOOL WINAPI ConcatenatePaths(LPWSTR, LPCWSTR, DWORD, LPDWORD); WINSETUPAPI BOOL WINAPI DelayedMove(PCWSTR, PCWSTR); WINSETUPAPI BOOL WINAPI DoesUserHavePrivilege(PCWSTR); -WINSETUPAPI PWSTR WINAPI DuplicateString(PCWSTR); -WINSETUPAPI BOOL WINAPI EnablePrivilege(PCWSTR, BOOL); WINSETUPAPI BOOL WINAPI FileExists(PCWSTR, PWIN32_FIND_DATAW); WINSETUPAPI DWORD WINAPI GetSetFileTimestamp(PCWSTR, PFILETIME, PFILETIME, PFILETIME, BOOLEAN); -WINSETUPAPI BOOL WINAPI GetVersionInfoFromImage(LPWSTR, PULARGE_INTEGER, LPWORD); WINSETUPAPI BOOL WINAPI IsUserAdmin(VOID); -WINSETUPAPI PWSTR WINAPI MultiByteToUnicode(PCSTR, UINT); WINSETUPAPI VOID WINAPI MyFree(PVOID); -WINSETUPAPI PWSTR WINAPI MyGetFileTitle(PCWSTR); WINSETUPAPI PVOID WINAPI MyMalloc(DWORD); WINSETUPAPI PVOID WINAPI MyRealloc(PVOID, DWORD); -WINSETUPAPI DWORD WINAPI OpenAndMapForRead(PCWSTR, PDWORD, PHANDLE, PHANDLE, PVOID*); WINSETUPAPI LONG WINAPI QueryRegistryValue(HKEY, PCWSTR, PBYTE*, PDWORD, PDWORD); WINSETUPAPI DWORD WINAPI RetreiveFileSecurity(PCWSTR, PSECURITY_DESCRIPTOR*); @@ -1430,23 +1421,39 @@ WINSETUPAPI BOOL WINAPI SetupTerminateFileLog(HSPFILELOG); WINSETUPAPI DWORD WINAPI StampFileSecurity(PCWSTR, PSECURITY_DESCRIPTOR); -WINSETUPAPI DWORD WINAPI StringTableAddString(HSTRING_TABLE, LPWSTR, DWORD); -WINSETUPAPI DWORD WINAPI StringTableAddStringEx(HSTRING_TABLE, LPWSTR, DWORD, LPVOID, DWORD); -WINSETUPAPI VOID WINAPI StringTableDestroy(HSTRING_TABLE); -WINSETUPAPI HSTRING_TABLE WINAPI StringTableDuplicate(HSTRING_TABLE); -WINSETUPAPI BOOL WINAPI StringTableGetExtraData(HSTRING_TABLE, DWORD, LPVOID, DWORD); -WINSETUPAPI HSTRING_TABLE WINAPI StringTableInitialize(VOID); -WINSETUPAPI HSTRING_TABLE WINAPI StringTableInitializeEx(DWORD, DWORD); -WINSETUPAPI DWORD WINAPI StringTableLookUpString(HSTRING_TABLE, LPWSTR, DWORD); -WINSETUPAPI DWORD WINAPI StringTableLookUpStringEx(HSTRING_TABLE, LPWSTR, DWORD, LPVOID, DWORD); -WINSETUPAPI BOOL WINAPI StringTableSetExtraData(HSTRING_TABLE, DWORD, LPVOID, DWORD); -WINSETUPAPI LPWSTR WINAPI StringTableStringFromId(HSTRING_TABLE, DWORD); -WINSETUPAPI BOOL WINAPI StringTableStringFromIdEx(HSTRING_TABLE, DWORD, LPWSTR, LPDWORD); -WINSETUPAPI VOID WINAPI StringTableTrim(HSTRING_TABLE); + +WINSETUPAPI DWORD WINAPI pSetupCaptureAndConvertAnsiArg(PCSTR, PWSTR*); +WINSETUPAPI VOID WINAPI pSetupCenterWindowRelativeToParent(HWND); +WINSETUPAPI BOOL WINAPI pSetupConcatenatePaths(LPWSTR, LPCWSTR, DWORD, LPDWORD); +WINSETUPAPI PWSTR WINAPI pSetupDuplicateString(PCWSTR); +WINSETUPAPI BOOL WINAPI pSetupEnablePrivilege(PCWSTR, BOOL); +WINSETUPAPI PWSTR WINAPI pSetupGetFileTitle(PCWSTR); +WINSETUPAPI BOOL WINAPI pSetupGetVersionInfoFromImage(LPWSTR, PULARGE_INTEGER, LPWORD); +WINSETUPAPI BOOL WINAPI pSetupIsUserAdmin(VOID); +WINSETUPAPI PWSTR WINAPI pSetupMultiByteToUnicode(PCSTR, UINT); +WINSETUPAPI DWORD WINAPI pSetupOpenAndMapForRead(PCWSTR, PDWORD, PHANDLE, PHANDLE, PVOID*); + + + +WINSETUPAPI DWORD WINAPI pSetupStringTableAddString(HSTRING_TABLE, LPWSTR, DWORD); +WINSETUPAPI DWORD WINAPI pSetupStringTableAddStringEx(HSTRING_TABLE, LPWSTR, DWORD, LPVOID, DWORD); +WINSETUPAPI VOID WINAPI pSetupStringTableDestroy(HSTRING_TABLE); +WINSETUPAPI HSTRING_TABLE WINAPI pSetupStringTableDuplicate(HSTRING_TABLE); +WINSETUPAPI BOOL WINAPI pSetupStringTableGetExtraData(HSTRING_TABLE, DWORD, LPVOID, DWORD); +WINSETUPAPI HSTRING_TABLE WINAPI pSetupStringTableInitialize(VOID); +WINSETUPAPI HSTRING_TABLE WINAPI pSetupStringTableInitializeEx(DWORD, DWORD); +WINSETUPAPI DWORD WINAPI pSetupStringTableLookUpString(HSTRING_TABLE, LPWSTR, DWORD); +WINSETUPAPI DWORD WINAPI pSetupStringTableLookUpStringEx(HSTRING_TABLE, LPWSTR, DWORD, LPVOID, DWORD); +WINSETUPAPI BOOL WINAPI pSetupStringTableSetExtraData(HSTRING_TABLE, DWORD, LPVOID, DWORD); +WINSETUPAPI LPWSTR WINAPI pSetupStringTableStringFromId(HSTRING_TABLE, DWORD); +WINSETUPAPI BOOL WINAPI pSetupStringTableStringFromIdEx(HSTRING_TABLE, DWORD, LPWSTR, LPDWORD); + +WINSETUPAPI PSTR WINAPI pSetupUnicodeToMultiByte(PCWSTR lpUnicodeStr, UINT uCodePage); +WINSETUPAPI BOOL WINAPI pSetupUnmapAndCloseFile(HANDLE, HANDLE, PVOID); + WINSETUPAPI DWORD WINAPI TakeOwnershipOfFile(PCWSTR); WINSETUPAPI PSTR WINAPI UnicodeToMultiByte(PCWSTR lpUnicodeStr, UINT uCodePage); -WINSETUPAPI BOOL WINAPI UnmapAndCloseFile(HANDLE, HANDLE, PVOID); /* for backward compatability */ diff --git a/include/psdk/windowsx.h b/include/psdk/windowsx.h index dc813389899..0ed21e8fe04 100644 --- a/include/psdk/windowsx.h +++ b/include/psdk/windowsx.h @@ -1,6 +1,7 @@ #ifndef _WINDOWSX_H #define _WINDOWSX_H +#define WM_CTLCOLOR 25 #define Button_Enable(hwndCtl,fEnable) EnableWindow((hwndCtl),(fEnable)) #define Button_GetCheck(hwndCtl) ((int)(DWORD)SendMessage((hwndCtl),BM_GETCHECK,0,0)) #define Button_GetState(hwndCtl) ((int)(DWORD)SendMessage((hwndCtl),BM_GETSTATE,0,0)) diff --git a/include/psdk/wingdi.h b/include/psdk/wingdi.h index 052b04be334..c9e0b9e610e 100644 --- a/include/psdk/wingdi.h +++ b/include/psdk/wingdi.h @@ -3110,6 +3110,7 @@ int WINAPI GetTextFaceA(HDC,int,LPSTR); int WINAPI GetTextFaceW(HDC,int,LPWSTR); BOOL WINAPI GetTextMetricsA(HDC,LPTEXTMETRICA); BOOL WINAPI GetTextMetricsW(HDC,LPTEXTMETRICW); +BOOL WINAPI GetTransform(HDC,DWORD,XFORM*); BOOL WINAPI GetViewportExtEx(HDC,LPSIZE); BOOL WINAPI GetViewportOrgEx(HDC,LPPOINT); BOOL WINAPI GetWindowExtEx(HDC,LPSIZE); diff --git a/include/psdk/winuser.h b/include/psdk/winuser.h index c0d0ea295cb..4cebd7a2c34 100644 --- a/include/psdk/winuser.h +++ b/include/psdk/winuser.h @@ -1067,40 +1067,41 @@ extern "C" { #define KEYEVENTF_UNICODE 0x00000004 #define KEYEVENTF_SCANCODE 0x00000008 #endif -#define OBM_BTNCORNERS 32758 -#define OBM_BTSIZE 32761 -#define OBM_CHECK 32760 -#define OBM_CHECKBOXES 32759 -#define OBM_CLOSE 32754 -#define OBM_COMBO 32738 -#define OBM_DNARROW 32752 -#define OBM_DNARROWD 32742 -#define OBM_DNARROWI 32736 -#define OBM_LFARROW 32750 +#define OBM_TRTYPE 32732 #define OBM_LFARROWI 32734 -#define OBM_LFARROWD 32740 +#define OBM_RGARROWI 32735 +#define OBM_DNARROWI 32736 +#define OBM_UPARROWI 32737 +#define OBM_COMBO 32738 #define OBM_MNARROW 32739 -#define OBM_OLD_CLOSE 32767 -#define OBM_OLD_DNARROW 32764 -#define OBM_OLD_LFARROW 32762 -#define OBM_OLD_REDUCE 32757 -#define OBM_OLD_RESTORE 32755 -#define OBM_OLD_RGARROW 32763 -#define OBM_OLD_UPARROW 32765 -#define OBM_OLD_ZOOM 32756 -#define OBM_REDUCE 32749 +#define OBM_LFARROWD 32740 +#define OBM_RGARROWD 32741 +#define OBM_DNARROWD 32742 +#define OBM_UPARROWD 32743 +#define OBM_RESTORED 32744 +#define OBM_ZOOMD 32745 #define OBM_REDUCED 32746 #define OBM_RESTORE 32747 -#define OBM_RESTORED 32744 -#define OBM_RGARROW 32751 -#define OBM_RGARROWD 32741 -#define OBM_RGARROWI 32735 -#define OBM_SIZE 32766 -#define OBM_UPARROW 32753 -#define OBM_UPARROWD 32743 -#define OBM_UPARROWI 32737 #define OBM_ZOOM 32748 -#define OBM_ZOOMD 32745 +#define OBM_REDUCE 32749 +#define OBM_LFARROW 32750 +#define OBM_RGARROW 32751 +#define OBM_DNARROW 32752 +#define OBM_UPARROW 32753 +#define OBM_CLOSE 32754 +#define OBM_OLD_RESTORE 32755 +#define OBM_OLD_ZOOM 32756 +#define OBM_OLD_REDUCE 32757 +#define OBM_BTNCORNERS 32758 +#define OBM_CHECKBOXES 32759 +#define OBM_CHECK 32760 +#define OBM_BTSIZE 32761 +#define OBM_OLD_LFARROW 32762 +#define OBM_OLD_RGARROW 32763 +#define OBM_OLD_DNARROW 32764 +#define OBM_OLD_UPARROW 32765 +#define OBM_SIZE 32766 +#define OBM_OLD_CLOSE 32767 #define OCR_NORMAL 32512 #define OCR_IBEAM 32513 #define OCR_WAIT 32514 @@ -1114,7 +1115,9 @@ extern "C" { #define OCR_SIZENS 32645 #define OCR_SIZEALL 32646 #define OCR_NO 32648 +#define OCR_HAND 32649 #define OCR_APPSTARTING 32650 +#define OCR_HELP 32651 #define OIC_SAMPLE 32512 #define OIC_HAND 32513 #define OIC_QUES 32514 @@ -1735,6 +1738,9 @@ extern "C" { #define WM_XBUTTONUP 524 #define WM_XBUTTONDBLCLK 525 #endif +#if (_WIN32_WINNT >= 0x0600) +#define WM_MOUSEHWHEEL 526 +#endif #if (_WIN32_WINNT >= 0x0500) #define WM_MOUSELAST 525 #elif (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400) diff --git a/include/reactos/idl/pnp.idl b/include/reactos/idl/pnp.idl index daef2a2b235..b776e6d4a78 100644 --- a/include/reactos/idl/pnp.idl +++ b/include/reactos/idl/pnp.idl @@ -731,11 +731,20 @@ interface pnp /* Function 56 */ DWORD PNP_QueryArbitratorFreeData( - [in] handle_t hBinding); + [in] handle_t hBinding, + [out,size_is(DataLen)] BYTE *pData, + [in] DWORD DataLen, + [in, string, ref] LPWSTR pDeviceID, + [in] RESOURCEID ResourceID, + [in] DWORD ulFlags); /* Function 57 */ DWORD PNP_QueryArbitratorFreeSize( - [in] handle_t hBinding); + [in] handle_t hBinding, + [out] DWORD *pulSize, + [in, string, ref] LPWSTR pDeviceID, + [in] RESOURCEID ResourceID, + [in] DWORD ulFlags); /* Function 58 */ DWORD PNP_RunDetection( diff --git a/include/reactos/libs/sound/mmebuddy.h b/include/reactos/libs/sound/mmebuddy.h index 90b89ef1198..d1139c7d867 100644 --- a/include/reactos/libs/sound/mmebuddy.h +++ b/include/reactos/libs/sound/mmebuddy.h @@ -366,6 +366,7 @@ typedef struct _SOUND_DEVICE_INSTANCE HANDLE hStopEvent; HANDLE hResetEvent; BOOL ResetInProgress; + BOOL bPaused; } SOUND_DEVICE_INSTANCE, *PSOUND_DEVICE_INSTANCE; /* This lives in WAVEHDR.reserved */ @@ -702,6 +703,9 @@ MMRESULT StopStreaming( IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance); +VOID +InitiateSoundStreaming( + IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance); /* kernel.c diff --git a/include/reactos/subsys/csrss/csrss.h b/include/reactos/subsys/csrss/csrss.h index 1156d39bd49..47c5addc8b8 100644 --- a/include/reactos/subsys/csrss/csrss.h +++ b/include/reactos/subsys/csrss/csrss.h @@ -511,7 +511,12 @@ typedef struct DWORD NumberOfHistoryBuffers; DWORD dwFlags; } CSRSS_GET_HISTORY_INFO, *PCSRSS_GET_HISTORY_INFO, - CSRSS_SET_HISTORY_INFO, *PCSRSS_SET_HISTORY_INFO; + CSRSS_SET_HISTORY_INFO, *PCSRSS_SET_HISTORY_INFO;; + +typedef struct +{ + UINT UniqueID; +} CSRSS_GET_TEMP_FILE, *PCSRSS_GET_TEMP_FILE; #define CSR_API_MESSAGE_HEADER_SIZE(Type) (FIELD_OFFSET(CSR_API_MESSAGE, Data) + sizeof(Type)) #define CSRSS_MAX_WRITE_CONSOLE (LPC_MAX_DATA_LENGTH - CSR_API_MESSAGE_HEADER_SIZE(CSRSS_WRITE_CONSOLE)) @@ -592,6 +597,7 @@ typedef struct #define SET_HISTORY_NUMBER_COMMANDS (0x45) #define GET_HISTORY_INFO (0x46) #define SET_HISTORY_INFO (0x47) +#define GET_TEMP_FILE (0x48) /* Keep in sync with definition below. */ #define CSRSS_HEADER_SIZE (sizeof(PORT_MESSAGE) + sizeof(ULONG) + sizeof(NTSTATUS)) @@ -673,6 +679,7 @@ typedef struct _CSR_API_MESSAGE CSRSS_SET_HISTORY_NUMBER_COMMANDS SetHistoryNumberCommands; CSRSS_GET_HISTORY_INFO GetHistoryInfo; CSRSS_SET_HISTORY_INFO SetHistoryInfo; + CSRSS_GET_TEMP_FILE GetTempFile; } Data; } CSR_API_MESSAGE, *PCSR_API_MESSAGE; diff --git a/include/reactos/undocuser.h b/include/reactos/undocuser.h index 22bd858ee3b..06312d7d34e 100644 --- a/include/reactos/undocuser.h +++ b/include/reactos/undocuser.h @@ -25,7 +25,6 @@ /* Non SDK Window Message types. */ #define WM_SETVISIBLE 0x00000009 -#define WM_CTLCOLOR 0x00000019 #define WM_ALTTABACTIVE 0x00000029 #define WM_ISACTIVEICON 0x00000035 #define WM_QUERYPARKICON 0x00000036 @@ -92,7 +91,7 @@ #define SBRG_PAGEDOWNLEFT 4 /* the page down or page left region */ #define SBRG_BOTTOMLEFTBTN 5 /* the bottom or left button */ - +BOOL WINAPI SetLogonNotifyWindow(HWND Wnd, HWINSTA WinSta); BOOL WINAPI KillSystemTimer(HWND,UINT_PTR); UINT_PTR WINAPI SetSystemTimer(HWND,UINT_PTR,UINT,TIMERPROC); DWORD_PTR WINAPI SetSysColorsTemp(const COLORREF *, const HBRUSH *, DWORD_PTR); diff --git a/include/reactos/win32k/ntuser.h b/include/reactos/win32k/ntuser.h index a334a04ff30..b0e800bacdb 100644 --- a/include/reactos/win32k/ntuser.h +++ b/include/reactos/win32k/ntuser.h @@ -231,6 +231,10 @@ C_ASSERT(sizeof(CLIENTINFO) <= sizeof(((PTEB)0)->Win32ClientInfo)); #define GetWin32ClientInfo() ((PCLIENTINFO)(NtCurrentTeb()->Win32ClientInfo)) +#define HRGN_NULL ( (HRGN) 0) // NULL empty region +#define HRGN_WINDOW ( (HRGN) 1) // region from window rcWindow +#define HRGN_MONITOR ( (HRGN) 2) // region from monitor region. + /* Menu Item fType. */ #define MFT_RTOL 0x6000 @@ -3126,8 +3130,6 @@ typedef struct tagKMDDELPARAM #define ONEPARAM_ROUTINE_ENABLEPROCWNDGHSTING 0xfffe000d #define ONEPARAM_ROUTINE_GETDESKTOPMAPPING 0xfffe000e #define ONEPARAM_ROUTINE_GETCURSORPOSITION 0xfffe0048 // use ONEPARAM_ or TWOPARAM routine ? -#define TWOPARAM_ROUTINE_GETWINDOWRGNBOX 0xfffd0048 // user mode -#define TWOPARAM_ROUTINE_GETWINDOWRGN 0xfffd0049 // user mode #define TWOPARAM_ROUTINE_SETMENUBARHEIGHT 0xfffd0050 #define TWOPARAM_ROUTINE_SETGUITHRDHANDLE 0xfffd0052 #define MSQ_STATE_CAPTURE 0x1 diff --git a/include/reactos/wine/config.h b/include/reactos/wine/config.h index 2d62068fd05..6973c336a46 100644 --- a/include/reactos/wine/config.h +++ b/include/reactos/wine/config.h @@ -457,12 +457,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_OPENSSL_SSL_H */ -/* Define to 1 if you have the `z' library (-lz). */ -#define HAVE_ZLIB 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to 1 if you have the `pclose' function. */ #define HAVE_PCLOSE 1 diff --git a/include/reactos/winlogon.h b/include/reactos/winlogon.h index 42eaf620468..4c00b674e81 100644 --- a/include/reactos/winlogon.h +++ b/include/reactos/winlogon.h @@ -17,14 +17,6 @@ #define EWX_INTERNAL_KILL_ALL_APPS (EWX_INTERNAL_FLAG | 0x200) #define EWX_INTERNAL_FLAG_LOGOFF 0x1000 -#define WM_LOGONNOTIFY 0x0000004c - -/* WPARAM values for WM_LOGONNOTIFY */ -#define LN_START_TASK_MANAGER 0x4 -#define LN_LOCK_WORKSTATION 0x5 -#define LN_UNLOCK_WORKSTATION 0x6 -#define LN_MESSAGE_BEEP 0x9 - #endif /* REACTOS_WINLOGON_H_INCLUDED */ /* EOF */ diff --git a/include/xdk/kefuncs.h b/include/xdk/kefuncs.h index 27049e651ba..eb5c7a25c5e 100644 --- a/include/xdk/kefuncs.h +++ b/include/xdk/kefuncs.h @@ -208,7 +208,7 @@ KeInitializeSpinLock(IN PKSPIN_LOCK SpinLock) #endif NTKERNELAPI -DECLSPEC_NORETURN +//DECLSPEC_NORETURN VOID NTAPI KeBugCheckEx( diff --git a/lib/drivers/sound/mmebuddy/mmewrap.c b/lib/drivers/sound/mmebuddy/mmewrap.c index 9e03770c175..5b651540bde 100644 --- a/lib/drivers/sound/mmebuddy/mmewrap.c +++ b/lib/drivers/sound/mmebuddy/mmewrap.c @@ -29,6 +29,7 @@ MmeSetState( PMMFUNCTION_TABLE FunctionTable; PSOUND_DEVICE SoundDevice; PSOUND_DEVICE_INSTANCE SoundDeviceInstance; + BOOL OldState; VALIDATE_MMSYS_PARAMETER( PrivateHandle ); SoundDeviceInstance = (PSOUND_DEVICE_INSTANCE) PrivateHandle; @@ -53,6 +54,20 @@ MmeSetState( /* Try change state */ Result = FunctionTable->SetState(SoundDeviceInstance, bStart); + if ( MMSUCCESS(Result) ) + { + /* Get old audio stream state */ + OldState = SoundDeviceInstance->bPaused; + + /* Store audio stream pause state */ + SoundDeviceInstance->bPaused = !bStart; + + if (SoundDeviceInstance->bPaused == FALSE && OldState == TRUE) + { + InitiateSoundStreaming(SoundDeviceInstance); + } + } + return Result; } diff --git a/lib/drivers/sound/mmebuddy/wave/header.c b/lib/drivers/sound/mmebuddy/wave/header.c index b4d7fdcf119..998edef57af 100644 --- a/lib/drivers/sound/mmebuddy/wave/header.c +++ b/lib/drivers/sound/mmebuddy/wave/header.c @@ -242,7 +242,11 @@ EnqueueWaveHeader( SoundDeviceInstance->HeadWaveHeader = WaveHeader; SoundDeviceInstance->TailWaveHeader = WaveHeader; - DoWaveStreaming(SoundDeviceInstance); + /* Only do wave streaming when the stream has not been paused */ + if (SoundDeviceInstance->bPaused == FALSE) + { + DoWaveStreaming(SoundDeviceInstance); + } } else { @@ -258,7 +262,11 @@ EnqueueWaveHeader( SoundDeviceInstance->TailWaveHeader = WaveHeader; DUMP_WAVEHDR_QUEUE(SoundDeviceInstance); - DoWaveStreaming(SoundDeviceInstance); + /* Only do wave streaming when the stream has not been paused */ + if ( SoundDeviceInstance->bPaused == FALSE ) + { + DoWaveStreaming(SoundDeviceInstance); + } } } diff --git a/lib/drivers/sound/mmebuddy/wave/streaming.c b/lib/drivers/sound/mmebuddy/wave/streaming.c index 63ac5e0a89d..d892f2d1f36 100644 --- a/lib/drivers/sound/mmebuddy/wave/streaming.c +++ b/lib/drivers/sound/mmebuddy/wave/streaming.c @@ -60,7 +60,7 @@ DoWaveStreaming( } while ( ( SoundDeviceInstance->OutstandingBuffers < SoundDeviceInstance->BufferCount ) && - ( Header ) ) + ( Header ) && SoundDeviceInstance->ResetInProgress == FALSE) { HeaderExtension = (PWAVEHDR_EXTENSION) Header->reserved; SND_ASSERT( HeaderExtension ); @@ -176,8 +176,6 @@ CompleteIO( WaveHdr = (PWAVEHDR) SoundOverlapped->Header; SND_ASSERT( WaveHdr ); - SND_ASSERT( ERROR_SUCCESS == dwErrorCode ); - HdrExtension = (PWAVEHDR_EXTENSION) WaveHdr->reserved; SND_ASSERT( HdrExtension ); @@ -305,6 +303,12 @@ StopStreamingInSoundThread( /* cancel all current audio buffers */ FunctionTable->ResetStream(SoundDeviceInstance, DeviceType, TRUE); } + while(SoundDeviceInstance->OutstandingBuffers) + { + SND_TRACE(L"StopStreamingInSoundThread OutStandingBufferCount %lu\n", SoundDeviceInstance->OutstandingBuffers); + /* wait until pending i/o has completed */ + SleepEx(10, TRUE); + } /* complete all current headers */ while( SoundDeviceInstance->HeadWaveHeader ) @@ -316,12 +320,6 @@ StopStreamingInSoundThread( /* there should be no oustanding buffers now */ SND_ASSERT(SoundDeviceInstance->OutstandingBuffers == 0); - while(SoundDeviceInstance->OutstandingBuffers) - { - SND_ERR("StopStreamingInSoundThread OutStandingBufferCount %lu\n", SoundDeviceInstance->OutstandingBuffers); - /* my hack of doom */ - Sleep(10); - } /* Check if reset function is supported */ if (FunctionTable->ResetStream) @@ -363,3 +361,37 @@ StopStreaming( StopStreamingInSoundThread, NULL); } + +MMRESULT +PerformWaveStreaming( + IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance, + IN PVOID Parameter) +{ + DoWaveStreaming(SoundDeviceInstance); + + return MMSYSERR_NOERROR; +} + +DWORD +WINAPI +WaveActivateSoundStreaming( + IN PVOID lpParameter) +{ + CallSoundThread((PSOUND_DEVICE_INSTANCE)lpParameter, + PerformWaveStreaming, + NULL); + + ExitThread(0); +} + +VOID +InitiateSoundStreaming( + IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance) +{ + HANDLE hThread; + + hThread = CreateThread(NULL, 0, WaveActivateSoundStreaming, (PVOID)SoundDeviceInstance, 0, NULL); + + if (hThread != NULL) + CloseHandle(hThread); +} diff --git a/lib/inflib/infros.h b/lib/inflib/infros.h index 80e8692ca56..6a723739080 100644 --- a/lib/inflib/infros.h +++ b/lib/inflib/infros.h @@ -14,7 +14,6 @@ extern "C" { #include -extern VOID InfSetHeap(PVOID Heap); extern NTSTATUS InfOpenBufferedFile(PHINF InfHandle, PVOID Buffer, ULONG BufferSize, @@ -25,13 +24,10 @@ extern NTSTATUS InfOpenFile(PHINF InfHandle, extern NTSTATUS InfWriteFile(HINF InfHandle, PUNICODE_STRING FileName, PUNICODE_STRING HeaderComment); -extern VOID InfCloseFile(HINF InfHandle); extern BOOLEAN InfFindFirstLine(HINF InfHandle, PCWSTR Section, PCWSTR Key, PINFCONTEXT *Context); -extern BOOLEAN InfFindNextLine(PINFCONTEXT ContextIn, - PINFCONTEXT ContextOut); extern BOOLEAN InfFindFirstMatchLine(PINFCONTEXT ContextIn, PCWSTR Key, PINFCONTEXT ContextOut); @@ -41,24 +37,9 @@ extern BOOLEAN InfFindNextMatchLine(PINFCONTEXT ContextIn, extern LONG InfGetLineCount(HINF InfHandle, PCWSTR Section); extern LONG InfGetFieldCount(PINFCONTEXT Context); -extern BOOLEAN InfGetBinaryField(PINFCONTEXT Context, - ULONG FieldIndex, - PUCHAR ReturnBuffer, - ULONG ReturnBufferSize, - PULONG RequiredSize); extern BOOLEAN InfGetIntField(PINFCONTEXT Context, ULONG FieldIndex, PINT IntegerValue); -extern BOOLEAN InfGetMultiSzField(PINFCONTEXT Context, - ULONG FieldIndex, - PWSTR ReturnBuffer, - ULONG ReturnBufferSize, - PULONG RequiredSize); -extern BOOLEAN InfGetStringField(PINFCONTEXT Context, - ULONG FieldIndex, - PWSTR ReturnBuffer, - ULONG ReturnBufferSize, - PULONG RequiredSize); extern BOOLEAN InfGetData(PINFCONTEXT Context, PWCHAR *Key, PWCHAR *Data); diff --git a/lib/rtl/CMakeLists.txt b/lib/rtl/CMakeLists.txt index c992a615ffc..64194389eac 100644 --- a/lib/rtl/CMakeLists.txt +++ b/lib/rtl/CMakeLists.txt @@ -29,6 +29,7 @@ list(APPEND SOURCE handle.c heap.c heapdbg.c + heappage.c image.c interlck.c message.c diff --git a/lib/rtl/avlsupp.c b/lib/rtl/avlsupp.c index 50b96ce2874..d50d5e8e286 100644 --- a/lib/rtl/avlsupp.c +++ b/lib/rtl/avlsupp.c @@ -12,7 +12,6 @@ typedef struct _TABLE_ENTRY_HEADER { RTL_BALANCED_LINKS BalancedLinks; - LIST_ENTRY ListEntry; LONGLONG UserData; } TABLE_ENTRY_HEADER, *PTABLE_ENTRY_HEADER; diff --git a/lib/rtl/avltable.c b/lib/rtl/avltable.c index acfb99d4a64..2b5c6085f00 100644 --- a/lib/rtl/avltable.c +++ b/lib/rtl/avltable.c @@ -70,11 +70,12 @@ RtlInsertElementGenericTableFullAvl(IN PRTL_AVL_TABLE Table, if (NewElement) *NewElement = FALSE; return NULL; } - + /* Data to return to user */ UserData = &((PTABLE_ENTRY_HEADER)NewNode)->UserData; /* Insert the node in the tree */ + RtlZeroMemory(NewNode, sizeof(RTL_BALANCED_LINKS)); RtlpInsertAvlTreeNode(Table, NewNode, NodeOrParent, SearchResult); /* Copy user buffer */ @@ -88,7 +89,7 @@ RtlInsertElementGenericTableFullAvl(IN PRTL_AVL_TABLE Table, } /* Return status */ - if (NewElement) *NewElement = (SearchResult == TableFoundNode); + if (NewElement) *NewElement = (SearchResult != TableFoundNode); /* Return pointer to user data */ return UserData; diff --git a/lib/rtl/critical.c b/lib/rtl/critical.c index 03bffca4289..8270b469fdf 100644 --- a/lib/rtl/critical.c +++ b/lib/rtl/critical.c @@ -604,7 +604,7 @@ NTAPI RtlLeaveCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) { #ifndef NDEBUG - HANDLE Thread = (HANDLE)NtCurrentTeb()->Cid.UniqueThread; + HANDLE Thread = (HANDLE)NtCurrentTeb()->ClientId.UniqueThread; /* In win this case isn't checked. However it's a valid check so it should only be performed in debug builds! */ diff --git a/lib/rtl/heap.c b/lib/rtl/heap.c index 9a563eeecd0..110e68b0993 100644 --- a/lib/rtl/heap.c +++ b/lib/rtl/heap.c @@ -414,7 +414,7 @@ RtlpCreateUnCommittedRange(PHEAP_SEGMENT Segment) if (IsListEmpty(&Heap->UCRList)) { /* Get a pointer to the first UCR segment */ - UcrSegment = CONTAINING_RECORD(&Heap->UCRSegments.Flink, HEAP_UCR_SEGMENT, ListEntry); + UcrSegment = CONTAINING_RECORD(Heap->UCRSegments.Flink, HEAP_UCR_SEGMENT, ListEntry); /* Check the list of UCR segments */ if (IsListEmpty(&Heap->UCRSegments) || @@ -539,8 +539,11 @@ RtlpInsertUnCommittedPages(PHEAP_SEGMENT Segment, Address = (ULONG_PTR)UcrDescriptor->Address; Size += UcrDescriptor->Size; - /* Remove it from the list and destroy it */ - RemoveEntryList(Current); + /* Advance to the next descriptor */ + Current = Current->Flink; + + /* Remove the current descriptor from the list and destroy it */ + RemoveEntryList(&UcrDescriptor->SegmentEntry); RtlpDestroyUnCommittedRange(Segment, UcrDescriptor); Segment->NumberOfUnCommittedRanges--; @@ -1362,8 +1365,11 @@ RtlCreateHeap(ULONG Flags, Heap = RtlpPageHeapCreate(Flags, Addr, TotalSize, CommitSize, Lock, Parameters); if (Heap) return Heap; - //ASSERT(FALSE); - DPRINT1("Enabling page heap failed\n"); + /* Reset a special Parameters == -1 hack */ + if ((ULONG_PTR)Parameters == (ULONG_PTR)-1) + Parameters = NULL; + else + DPRINT1("Enabling page heap failed\n"); } /* Check validation flags */ @@ -1716,6 +1722,9 @@ RtlDestroyHeap(HANDLE HeapPtr) /* [in] Handle of heap */ if (!HeapPtr) return NULL; + /* Call page heap routine if required */ + if (Heap->ForceFlags & HEAP_FLAG_PAGE_ALLOCS) return RtlpPageHeapDestroy(HeapPtr); + /* Call special heap */ if (RtlpHeapIsSpecial(Heap->Flags)) { @@ -3701,7 +3710,9 @@ BOOLEAN NTAPI RtlValidateHeap( BOOLEAN HeapLocked = FALSE; BOOLEAN HeapValid; - // FIXME Check for special heap + /* Check for page heap */ + if (Heap->ForceFlags & HEAP_FLAG_PAGE_ALLOCS) + return RtlpDebugPageHeapValidate(HeapPtr, Flags, Block); /* Check signature */ if (Heap->Signature != HEAP_SIGNATURE) diff --git a/lib/rtl/heap.h b/lib/rtl/heap.h index 8291838c6de..f00a8daedea 100644 --- a/lib/rtl/heap.h +++ b/lib/rtl/heap.h @@ -182,6 +182,19 @@ typedef struct _HEAP_TUNING_PARAMETERS ULONG MaxPreCommittThreshold; } HEAP_TUNING_PARAMETERS, *PHEAP_TUNING_PARAMETERS; +typedef struct _HEAP_LIST_LOOKUP +{ + struct _HEAP_LIST_LOOKUP *ExtendedLookup; + ULONG ArraySize; + ULONG ExtraItem; + ULONG ItemCount; + ULONG OutOfRangeItems; + ULONG BaseIndex; + PLIST_ENTRY ListHead; + PULONG ListsInUseUlong; + PLIST_ENTRY *ListHints; +} HEAP_LIST_LOOKUP, *PHEAP_LIST_LOOKUP; + typedef struct _HEAP { HEAP_ENTRY Entry; @@ -229,10 +242,11 @@ typedef struct _HEAP struct _HEAP_SEGMENT *Segments[HEAP_SEGMENTS]; //FIXME: non-Vista USHORT AllocatorBackTraceIndex; ULONG NonDedicatedListLength; - PVOID BlocksIndex; + PVOID BlocksIndex; // HEAP_LIST_LOOKUP PVOID UCRIndex; PHEAP_PSEUDO_TAG_ENTRY PseudoTagEntries; LIST_ENTRY FreeLists[HEAP_FREELISTS]; //FIXME: non-Vista + //LIST_ENTRY FreeLists; union { ULONG FreeListsInUseUlong[HEAP_FREELISTS / (sizeof(ULONG) * 8)]; //FIXME: non-Vista @@ -385,6 +399,8 @@ RtlDebugSizeHeap(HANDLE HeapPtr, ULONG Flags, PVOID Ptr); +/* heappage.c */ + HANDLE NTAPI RtlpPageHeapCreate(ULONG Flags, PVOID Addr, @@ -393,4 +409,55 @@ RtlpPageHeapCreate(ULONG Flags, PVOID Lock, PRTL_HEAP_PARAMETERS Parameters); +PVOID NTAPI +RtlpPageHeapDestroy(HANDLE HeapPtr); + +PVOID NTAPI +RtlpPageHeapAllocate(IN PVOID HeapPtr, + IN ULONG Flags, + IN SIZE_T Size); + +BOOLEAN NTAPI +RtlpPageHeapFree(HANDLE HeapPtr, + ULONG Flags, + PVOID Ptr); + +PVOID NTAPI +RtlpPageHeapReAllocate(HANDLE HeapPtr, + ULONG Flags, + PVOID Ptr, + SIZE_T Size); + +BOOLEAN NTAPI +RtlpPageHeapGetUserInfo(PVOID HeapHandle, + ULONG Flags, + PVOID BaseAddress, + PVOID *UserValue, + PULONG UserFlags); + +BOOLEAN NTAPI +RtlpPageHeapSetUserValue(PVOID HeapHandle, + ULONG Flags, + PVOID BaseAddress, + PVOID UserValue); + +BOOLEAN +NTAPI +RtlpPageHeapSetUserFlags(PVOID HeapHandle, + ULONG Flags, + PVOID BaseAddress, + ULONG UserFlagsReset, + ULONG UserFlagsSet); + +BOOLEAN +NTAPI +RtlpDebugPageHeapValidate(PVOID HeapPtr, + ULONG Flags, + PVOID Block); + +SIZE_T NTAPI +RtlpPageHeapSize(HANDLE HeapPtr, + ULONG Flags, + PVOID Ptr); + #endif diff --git a/lib/rtl/heapdbg.c b/lib/rtl/heapdbg.c index b8d68bd31eb..89865227fcc 100644 --- a/lib/rtl/heapdbg.c +++ b/lib/rtl/heapdbg.c @@ -14,12 +14,6 @@ #define NDEBUG #include -BOOLEAN RtlpPageHeapEnabled = FALSE; -ULONG RtlpPageHeapGlobalFlags; -ULONG RtlpPageHeapSizeRangeStart, RtlpPageHeapSizeRangeEnd; -ULONG RtlpPageHeapDllRangeStart, RtlpPageHeapDllRangeEnd; -WCHAR RtlpPageHeapTargetDlls[512]; - /* FUNCTIONS ******************************************************************/ HANDLE NTAPI @@ -142,8 +136,8 @@ RtlDebugAllocateHeap(PVOID HeapPtr, BOOLEAN HeapLocked = FALSE; PVOID Result; - //if (Heap->ForceFlags & HEAP_FLAG_PAGE_ALLOCS) - //return RtlpPageHeapAllocateHeap(HeapPtr, Flags, Size); + if (Heap->ForceFlags & HEAP_FLAG_PAGE_ALLOCS) + return RtlpPageHeapAllocate(HeapPtr, Flags, Size); if (Heap->Signature != HEAP_SIGNATURE) { @@ -209,8 +203,8 @@ RtlDebugReAllocateHeap(HANDLE HeapPtr, PVOID Result = NULL; PHEAP_ENTRY HeapEntry; - //if (Heap->ForceFlags & HEAP_FLAG_PAGE_ALLOCS) - //return RtlpPageHeapReAllocateHeap(HeapPtr, Flags, Size); + if (Heap->ForceFlags & HEAP_FLAG_PAGE_ALLOCS) + return RtlpPageHeapReAllocate(HeapPtr, Flags, Ptr, Size); if (Heap->Signature != HEAP_SIGNATURE) { @@ -279,8 +273,8 @@ RtlDebugFreeHeap(HANDLE HeapPtr, PHEAP_ENTRY HeapEntry; BOOLEAN Result = FALSE; - //if (Heap->ForceFlags & HEAP_FLAG_PAGE_ALLOCS) - //return RtlpPageHeapFreeHeap(HeapPtr, Flags, Size); + if (Heap->ForceFlags & HEAP_FLAG_PAGE_ALLOCS) + return RtlpPageHeapFree(HeapPtr, Flags, Ptr); if (Heap->Signature != HEAP_SIGNATURE) { @@ -336,8 +330,8 @@ RtlDebugGetUserInfoHeap(PVOID HeapHandle, PHEAP_ENTRY HeapEntry; BOOLEAN Result = FALSE; - //if (Heap->ForceFlags & HEAP_FLAG_PAGE_ALLOCS) - //return RtlpPageHeapGetUserInfoHeap(HeapPtr, Flags, Size); + if (Heap->ForceFlags & HEAP_FLAG_PAGE_ALLOCS) + return RtlpPageHeapGetUserInfo(HeapHandle, Flags, BaseAddress, UserValue, UserFlags); if (Heap->Signature != HEAP_SIGNATURE) { @@ -388,8 +382,8 @@ RtlDebugSetUserValueHeap(PVOID HeapHandle, PHEAP_ENTRY HeapEntry; BOOLEAN Result = FALSE; - //if (Heap->ForceFlags & HEAP_FLAG_PAGE_ALLOCS) - //return RtlpPageHeapSetUserValueHeap(HeapPtr, Flags, Size); + if (Heap->ForceFlags & HEAP_FLAG_PAGE_ALLOCS) + return RtlpPageHeapSetUserValue(HeapHandle, Flags, BaseAddress, UserValue); if (Heap->Signature != HEAP_SIGNATURE) { @@ -445,8 +439,8 @@ RtlDebugSetUserFlagsHeap(PVOID HeapHandle, PHEAP_ENTRY HeapEntry; BOOLEAN Result = FALSE; - //if (Heap->ForceFlags & HEAP_FLAG_PAGE_ALLOCS) - //return RtlPageHeapSetUserFlagsHeap(HeapPtr, Flags, BaseAddress, UserFlagsReset, UserFlagsSet); + if (Heap->ForceFlags & HEAP_FLAG_PAGE_ALLOCS) + return RtlpPageHeapSetUserFlags(HeapHandle, Flags, BaseAddress, UserFlagsReset, UserFlagsSet); /* Check if this heap allows flags to be set at all */ if (UserFlagsSet & ~HEAP_SETTABLE_USER_FLAGS || @@ -506,8 +500,8 @@ RtlDebugSizeHeap(HANDLE HeapPtr, PHEAP_ENTRY HeapEntry; SIZE_T Result = ~(SIZE_T)0; - //if (Heap->ForceFlags & HEAP_FLAG_PAGE_ALLOCS) - //return RtlPageHeapSizeHeap(HeapPtr, Flags, Ptr); + if (Heap->ForceFlags & HEAP_FLAG_PAGE_ALLOCS) + return RtlpPageHeapSize(HeapPtr, Flags, Ptr); /* Check heap signature */ if (Heap->Signature != HEAP_SIGNATURE) @@ -548,18 +542,4 @@ RtlDebugSizeHeap(HANDLE HeapPtr, return Result; } - -// Page heap -> move to another file - -HANDLE NTAPI -RtlpPageHeapCreate(ULONG Flags, - PVOID Addr, - SIZE_T TotalSize, - SIZE_T CommitSize, - PVOID Lock, - PRTL_HEAP_PARAMETERS Parameters) -{ - return NULL; -} - /* EOF */ \ No newline at end of file diff --git a/lib/rtl/heappage.c b/lib/rtl/heappage.c new file mode 100644 index 00000000000..a4a6307dd70 --- /dev/null +++ b/lib/rtl/heappage.c @@ -0,0 +1,2295 @@ +/* COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: lib/rtl/heappage.c + * PURPOSE: RTL Page Heap implementation + * PROGRAMMERS: Copyright 2011 Aleksey Bragin + */ + +/* Useful references: + http://msdn.microsoft.com/en-us/library/ms220938(VS.80).aspx + http://blogs.msdn.com/b/jiangyue/archive/2010/03/16/windows-heap-overrun-monitoring.aspx +*/ + +/* INCLUDES *****************************************************************/ + +#include +#include + +#define NDEBUG +#include + +/* TYPES **********************************************************************/ + +typedef struct _DPH_BLOCK_INFORMATION +{ + ULONG StartStamp; + PVOID Heap; + ULONG RequestedSize; + ULONG ActualSize; + union + { + LIST_ENTRY FreeQueue; + SINGLE_LIST_ENTRY FreePushList; + WORD TraceIndex; + }; + PVOID StackTrace; + ULONG EndStamp; +} DPH_BLOCK_INFORMATION, *PDPH_BLOCK_INFORMATION; + +typedef struct _DPH_HEAP_BLOCK +{ + union + { + struct _DPH_HEAP_BLOCK *pNextAlloc; + LIST_ENTRY AvailableEntry; + RTL_BALANCED_LINKS TableLinks; + }; + PUCHAR pUserAllocation; + PUCHAR pVirtualBlock; + ULONG nVirtualBlockSize; + ULONG nVirtualAccessSize; + ULONG nUserRequestedSize; + ULONG nUserActualSize; + PVOID UserValue; + ULONG UserFlags; + PRTL_TRACE_BLOCK StackTrace; + LIST_ENTRY AdjacencyEntry; + PUCHAR pVirtualRegion; +} DPH_HEAP_BLOCK, *PDPH_HEAP_BLOCK; + +typedef struct _DPH_HEAP_ROOT +{ + ULONG Signature; + ULONG HeapFlags; + PRTL_CRITICAL_SECTION HeapCritSect; + ULONG nRemoteLockAcquired; + + PDPH_HEAP_BLOCK pVirtualStorageListHead; + PDPH_HEAP_BLOCK pVirtualStorageListTail; + ULONG nVirtualStorageRanges; + ULONG nVirtualStorageBytes; + + RTL_AVL_TABLE BusyNodesTable; + PDPH_HEAP_BLOCK NodeToAllocate; + ULONG nBusyAllocations; + ULONG nBusyAllocationBytesCommitted; + + PDPH_HEAP_BLOCK pFreeAllocationListHead; + PDPH_HEAP_BLOCK pFreeAllocationListTail; + ULONG nFreeAllocations; + ULONG nFreeAllocationBytesCommitted; + + LIST_ENTRY AvailableAllocationHead; + ULONG nAvailableAllocations; + ULONG nAvailableAllocationBytesCommitted; + + PDPH_HEAP_BLOCK pUnusedNodeListHead; + PDPH_HEAP_BLOCK pUnusedNodeListTail; + ULONG nUnusedNodes; + ULONG nBusyAllocationBytesAccessible; + PDPH_HEAP_BLOCK pNodePoolListHead; + PDPH_HEAP_BLOCK pNodePoolListTail; + ULONG nNodePools; + ULONG nNodePoolBytes; + + LIST_ENTRY NextHeap; + ULONG ExtraFlags; + ULONG Seed; + PVOID NormalHeap; + PRTL_TRACE_BLOCK CreateStackTrace; + PVOID FirstThread; +} DPH_HEAP_ROOT, *PDPH_HEAP_ROOT; + +/* GLOBALS ********************************************************************/ + +BOOLEAN RtlpPageHeapEnabled = FALSE; +ULONG RtlpDphGlobalFlags; +ULONG RtlpPageHeapSizeRangeStart, RtlpPageHeapSizeRangeEnd; +ULONG RtlpPageHeapDllRangeStart, RtlpPageHeapDllRangeEnd; +WCHAR RtlpDphTargetDlls[512]; + +LIST_ENTRY RtlpDphPageHeapList; +BOOLEAN RtlpDphPageHeapListInitialized; +RTL_CRITICAL_SECTION RtlpDphPageHeapListLock; +ULONG RtlpDphPageHeapListLength; +UNICODE_STRING RtlpDphTargetDllsUnicode; + +RTL_CRITICAL_SECTION RtlpDphDelayedFreeQueueLock; +LIST_ENTRY RtlpDphDelayedFreeQueue; +SLIST_HEADER RtlpDphDelayedTemporaryPushList; +ULONG RtlpDphMemoryUsedByDelayedFreeBlocks; +ULONG RtlpDphNumberOfDelayedFreeBlocks; + +/* Counters */ +LONG RtlpDphCounter; +LONG RtlpDphAllocFails; +LONG RtlpDphReleaseFails; +LONG RtlpDphFreeFails; +LONG RtlpDphProtectFails; + +#define DPH_RESERVE_SIZE 0x100000 +#define DPH_POOL_SIZE 0x4000 +#define DPH_FREE_LIST_MINIMUM 8 + +/* RtlpDphBreakOptions */ +#define DPH_BREAK_ON_RESERVE_FAIL 0x01 +#define DPH_BREAK_ON_COMMIT_FAIL 0x02 +#define DPH_BREAK_ON_RELEASE_FAIL 0x04 +#define DPH_BREAK_ON_FREE_FAIL 0x08 +#define DPH_BREAK_ON_PROTECT_FAIL 0x10 +#define DPH_BREAK_ON_NULL_FREE 0x80 + +/* RtlpDphDebugOptions */ +#define DPH_DEBUG_INTERNAL_VALIDATE 0x01 +#define DPH_DEBUG_VERBOSE 0x04 + +/* DPH ExtraFlags */ +#define DPH_EXTRA_LOG_STACK_TRACES 0x02 +#define DPH_EXTRA_CHECK_UNDERRUN 0x10 + +/* Fillers */ +#define DPH_FILL 0xEEEEEEEE +#define DPH_FILL_START_STAMP_1 0xABCDBBBB +#define DPH_FILL_START_STAMP_2 0xABCDBBBA +#define DPH_FILL_END_STAMP_1 0xDCBABBBB +#define DPH_FILL_END_STAMP_2 0xDCBABBBA +#define DPH_FILL_SUFFIX 0xD0 +#define DPH_FILL_INFIX 0xC0 + +/* Validation info flags */ +#define DPH_VALINFO_BAD_START_STAMP 0x01 +#define DPH_VALINFO_BAD_END_STAMP 0x02 +#define DPH_VALINFO_BAD_POINTER 0x04 +#define DPH_VALINFO_BAD_PREFIX_PATTERN 0x08 +#define DPH_VALINFO_BAD_SUFFIX_PATTERN 0x10 +#define DPH_VALINFO_EXCEPTION 0x20 +#define DPH_VALINFO_1 0x40 +#define DPH_VALINFO_BAD_INFIX_PATTERN 0x80 +#define DPH_VALINFO_ALREADY_FREED 0x100 +#define DPH_VALINFO_CORRUPTED_AFTER_FREE 0x200 + +/* Signatures */ +#define DPH_SIGNATURE 0xFFEEDDCC + +/* Biased pointer macros */ +#define IS_BIASED_POINTER(ptr) ((ULONG_PTR)(ptr) & 1) +#define POINTER_REMOVE_BIAS(ptr) ((ULONG_PTR)(ptr) & ~(ULONG_PTR)1) +#define POINTER_ADD_BIAS(ptr) ((ULONG_PTR)(ptr) | 1) + + +ULONG RtlpDphBreakOptions = 0;//0xFFFFFFFF; +ULONG RtlpDphDebugOptions; + +/* FUNCTIONS ******************************************************************/ + +BOOLEAN NTAPI +RtlpDphGrowVirtual(PDPH_HEAP_ROOT DphRoot, SIZE_T Size); + +BOOLEAN NTAPI +RtlpDphIsNormalFreeHeapBlock(PVOID Block, PULONG ValidationInformation, BOOLEAN CheckFillers); + +VOID NTAPI +RtlpDphReportCorruptedBlock(PDPH_HEAP_ROOT DphRoot, ULONG Reserved, PVOID Block, ULONG ValidationInfo); + +BOOLEAN NTAPI +RtlpDphNormalHeapValidate(PDPH_HEAP_ROOT DphRoot, ULONG Flags, PVOID BaseAddress); + + +VOID NTAPI +RtlpDphRaiseException(NTSTATUS Status) +{ + EXCEPTION_RECORD Exception; + + /* Initialize exception record */ + Exception.ExceptionCode = Status; + Exception.ExceptionAddress = RtlpDphRaiseException; + Exception.ExceptionFlags = 0; + Exception.ExceptionRecord = NULL; + Exception.NumberParameters = 0; + + /* Raise the exception */ + RtlRaiseException(&Exception); +} + +PVOID NTAPI +RtlpDphPointerFromHandle(PVOID Handle) +{ + PHEAP NormalHeap = (PHEAP)Handle; + PDPH_HEAP_ROOT DphHeap = (PDPH_HEAP_ROOT)((PUCHAR)Handle + PAGE_SIZE); + + if (NormalHeap->ForceFlags & HEAP_FLAG_PAGE_ALLOCS) + { + if (DphHeap->Signature == DPH_SIGNATURE) + return DphHeap; + } + + DPRINT1("heap handle with incorrect signature\n"); + DbgBreakPoint(); + return NULL; +} + +VOID NTAPI +RtlpDphEnterCriticalSection(PDPH_HEAP_ROOT DphRoot, ULONG Flags) +{ + if (Flags & HEAP_NO_SERIALIZE) + { + /* More complex scenario */ + if (!RtlTryEnterCriticalSection(DphRoot->HeapCritSect)) + { + if (!DphRoot->nRemoteLockAcquired) + { + DPRINT1("multithreaded access in HEAP_NO_SERIALIZE heap\n"); + DbgBreakPoint(); + + /* Clear out the no serialize flag */ + DphRoot->HeapFlags &= ~HEAP_NO_SERIALIZE; + } + + /* Enter the heap's critical section */ + RtlEnterCriticalSection(DphRoot->HeapCritSect); + } + } + else + { + /* Just enter the heap's critical section */ + RtlEnterCriticalSection(DphRoot->HeapCritSect); + } +} + +VOID NTAPI +RtlpDphLeaveCriticalSection(PDPH_HEAP_ROOT DphRoot) +{ + /* Just leave the heap's critical section */ + RtlLeaveCriticalSection(DphRoot->HeapCritSect); +} + + +VOID NTAPI +RtlpDphPreProcessing(PDPH_HEAP_ROOT DphRoot, ULONG Flags) +{ + RtlpDphEnterCriticalSection(DphRoot, Flags); + + /* FIXME: Validate integrity, internal lists if necessary */ +} + +VOID NTAPI +RtlpDphPostProcessing(PDPH_HEAP_ROOT DphRoot) +{ + if (!DphRoot) return; + + if (RtlpDphDebugOptions & DPH_DEBUG_INTERNAL_VALIDATE) + { + /* FIXME: Validate integrity, internal lists if necessary */ + } + + /* Release the lock */ + RtlpDphLeaveCriticalSection(DphRoot); +} + +NTSTATUS NTAPI +RtlpSecMemFreeVirtualMemory(HANDLE Process, PVOID *Base, PSIZE_T Size, ULONG Type) +{ + NTSTATUS Status; + //PVOID *SavedBase = Base; + //PSIZE_T SavedSize = Size; + + /* Free the memory */ + Status = ZwFreeVirtualMemory(Process, Base, Size, Type); + + /* Flush secure memory cache if needed and retry freeing */ +#if 0 + if (Status == STATUS_INVALID_PAGE_PROTECTION && + Process == NtCurrentProcess() && + RtlFlushSecureMemoryCache(*SavedBase, *SavedSize)) + { + Status = ZwFreeVirtualMemory(NtCurrentProcess(), SavedBase, SavedSize, Type); + } +#endif + + return Status; +} + +NTSTATUS NTAPI +RtlpDphAllocateVm(PVOID *Base, SIZE_T Size, ULONG Type, ULONG Protection) +{ + NTSTATUS Status; + Status = ZwAllocateVirtualMemory(NtCurrentProcess(), + Base, + 0, + &Size, + Type, + Protection); + DPRINT("Page heap: AllocVm (%p, %p, %x) status %x \n", Base, Size, Type, Status); + /* Check for failures */ + if (!NT_SUCCESS(Status)) + { + if (Type == MEM_RESERVE) + { + _InterlockedIncrement(&RtlpDphCounter); + if (RtlpDphBreakOptions & DPH_BREAK_ON_RESERVE_FAIL) + { + DPRINT1("Page heap: AllocVm (%p, %p, %x) failed with %x \n", Base, Size, Type, Status); + DbgBreakPoint(); + return Status; + } + } + else + { + _InterlockedIncrement(&RtlpDphAllocFails); + if (RtlpDphBreakOptions & DPH_BREAK_ON_COMMIT_FAIL) + { + DPRINT1("Page heap: AllocVm (%p, %p, %x) failed with %x \n", Base, Size, Type, Status); + DbgBreakPoint(); + return Status; + } + } + } + + return Status; +} + +NTSTATUS NTAPI +RtlpDphFreeVm(PVOID Base, SIZE_T Size, ULONG Type) +{ + NTSTATUS Status; + + /* Free the memory */ + Status = RtlpSecMemFreeVirtualMemory(NtCurrentProcess(), &Base, &Size, Type); + DPRINT1("Page heap: FreeVm (%p, %p, %x) status %x \n", Base, Size, Type, Status); + /* Log/report failures */ + if (!NT_SUCCESS(Status)) + { + if (Type == MEM_RELEASE) + { + _InterlockedIncrement(&RtlpDphReleaseFails); + if (RtlpDphBreakOptions & DPH_BREAK_ON_RELEASE_FAIL) + { + DPRINT1("Page heap: FreeVm (%p, %p, %x) failed with %x \n", Base, Size, Type, Status); + DbgBreakPoint(); + return Status; + } + } + else + { + _InterlockedIncrement(&RtlpDphFreeFails); + if (RtlpDphBreakOptions & DPH_BREAK_ON_FREE_FAIL) + { + DPRINT1("Page heap: FreeVm (%p, %p, %x) failed with %x \n", Base, Size, Type, Status); + DbgBreakPoint(); + return Status; + } + } + } + + return Status; +} + +NTSTATUS NTAPI +RtlpDphProtectVm(PVOID Base, SIZE_T Size, ULONG Protection) +{ + NTSTATUS Status; + ULONG OldProtection; + + /* Change protection */ + Status = ZwProtectVirtualMemory(NtCurrentProcess(), &Base, &Size, Protection, &OldProtection); + + /* Log/report failures */ + if (!NT_SUCCESS(Status)) + { + _InterlockedIncrement(&RtlpDphProtectFails); + if (RtlpDphBreakOptions & DPH_BREAK_ON_PROTECT_FAIL) + { + DPRINT1("Page heap: ProtectVm (%p, %p, %x) failed with %x \n", Base, Size, Protection, Status); + DbgBreakPoint(); + return Status; + } + } + + return Status; +} + +BOOLEAN NTAPI +RtlpDphWritePageHeapBlockInformation(PDPH_HEAP_ROOT DphRoot, PVOID UserAllocation, SIZE_T Size, SIZE_T UserSize) +{ + PDPH_BLOCK_INFORMATION BlockInfo; + PUCHAR FillPtr; + + /* Get pointer to the block info structure */ + BlockInfo = (PDPH_BLOCK_INFORMATION)UserAllocation - 1; + + /* Set up basic fields */ + BlockInfo->Heap = DphRoot; + BlockInfo->ActualSize = UserSize; + BlockInfo->RequestedSize = Size; + BlockInfo->StartStamp = DPH_FILL_START_STAMP_1; + BlockInfo->EndStamp = DPH_FILL_END_STAMP_1; + + /* Fill with a pattern */ + FillPtr = (PUCHAR)UserAllocation + Size; + RtlFillMemory(FillPtr, ROUND_UP(FillPtr, PAGE_SIZE) - (ULONG_PTR)FillPtr, DPH_FILL_SUFFIX); + + /* FIXME: Check if logging stack traces is turned on */ + //if (DphRoot->ExtraFlags & + + return TRUE; +} + +VOID NTAPI +RtlpDphPlaceOnBusyList(PDPH_HEAP_ROOT DphRoot, PDPH_HEAP_BLOCK DphNode) +{ + BOOLEAN NewElement; + PVOID AddressUserData; + + DPRINT("RtlpDphPlaceOnBusyList(%p %p)\n", DphRoot, DphNode); + + /* Add it to the AVL busy nodes table */ + DphRoot->NodeToAllocate = DphNode; + AddressUserData = RtlInsertElementGenericTableAvl(&DphRoot->BusyNodesTable, + &DphNode->pUserAllocation, + sizeof(ULONG_PTR), + &NewElement); + + ASSERT(AddressUserData == &DphNode->pUserAllocation); + ASSERT(NewElement == TRUE); + + /* Update heap counters */ + DphRoot->nBusyAllocations++; + DphRoot->nBusyAllocationBytesAccessible += DphNode->nVirtualAccessSize; + DphRoot->nBusyAllocationBytesCommitted += DphNode->nVirtualBlockSize; +} + +VOID NTAPI +RtlpDphPlaceOnFreeList(PDPH_HEAP_ROOT DphRoot, PDPH_HEAP_BLOCK Node) +{ + DPRINT("RtlpDphPlaceOnFreeList(%p %p)\n", DphRoot, Node); + + /* Node is being added to the tail of the list */ + Node->pNextAlloc = NULL; + + /* Add it to the tail of the linked list */ + if (DphRoot->pFreeAllocationListTail) + DphRoot->pFreeAllocationListTail->pNextAlloc = Node; + else + DphRoot->pFreeAllocationListHead = Node; + DphRoot->pFreeAllocationListTail = Node; + + /* Update byte counts taking in account this new node */ + DphRoot->nFreeAllocations++; + DphRoot->nFreeAllocationBytesCommitted += Node->nVirtualBlockSize; +} + +VOID NTAPI +RtlpDphPlaceOnPoolList(PDPH_HEAP_ROOT DphRoot, PDPH_HEAP_BLOCK Node) +{ + DPRINT("RtlpDphPlaceOnPoolList(%p %p)\n", DphRoot, Node); + + /* Node is being added to the tail of the list */ + Node->pNextAlloc = NULL; + + /* Add it to the tail of the linked list */ + if (DphRoot->pNodePoolListTail) + DphRoot->pNodePoolListTail->pNextAlloc = Node; + else + DphRoot->pNodePoolListHead = Node; + DphRoot->pNodePoolListTail = Node; + + /* Update byte counts taking in account this new node */ + DphRoot->nNodePools++; + DphRoot->nNodePoolBytes += Node->nVirtualBlockSize; +} + +VOID NTAPI +RtlpDphPlaceOnVirtualList(PDPH_HEAP_ROOT DphRoot, PDPH_HEAP_BLOCK Node) +{ + DPRINT("RtlpDphPlaceOnVirtualList(%p %p)\n", DphRoot, Node); + + /* Add it to the head of the virtual list */ + Node->pNextAlloc = DphRoot->pVirtualStorageListHead; + if (!DphRoot->pVirtualStorageListHead) + DphRoot->pVirtualStorageListTail = Node; + DphRoot->pVirtualStorageListHead = Node; + + /* Update byte counts taking in account this new node */ + DphRoot->nVirtualStorageRanges++; + DphRoot->nVirtualStorageBytes += Node->nVirtualBlockSize; +} + +PDPH_HEAP_BLOCK NTAPI +RtlpDphTakeNodeFromUnusedList(PDPH_HEAP_ROOT DphRoot) +{ + PDPH_HEAP_BLOCK Node = DphRoot->pUnusedNodeListHead; + PDPH_HEAP_BLOCK Next; + + DPRINT("RtlpDphTakeNodeFromUnusedList(%p), ret %p\n", DphRoot, Node); + + /* Take the first entry */ + if (!Node) return NULL; + + /* Remove that entry (Node) from the list */ + Next = Node->pNextAlloc; + if (DphRoot->pUnusedNodeListHead == Node) DphRoot->pUnusedNodeListHead = Next; + if (DphRoot->pUnusedNodeListTail == Node) DphRoot->pUnusedNodeListTail = NULL; + + /* Decrease amount of unused nodes */ + DphRoot->nUnusedNodes--; + + return Node; +} + +VOID NTAPI +RtlpDphReturnNodeToUnusedList(PDPH_HEAP_ROOT DphRoot, + PDPH_HEAP_BLOCK Node) +{ + DPRINT("RtlpDphReturnNodeToUnusedList(%p, %p)\n", DphRoot, Node); + + /* Add it back to the head of the unused list */ + Node->pNextAlloc = DphRoot->pUnusedNodeListHead; + if (!DphRoot->pUnusedNodeListHead) + DphRoot->pUnusedNodeListTail = Node; + DphRoot->pUnusedNodeListHead = Node; + + /* Increase amount of unused nodes */ + DphRoot->nUnusedNodes++; +} + +VOID NTAPI +RtlpDphRemoveFromAvailableList(PDPH_HEAP_ROOT DphRoot, + PDPH_HEAP_BLOCK Node) +{ + /* Make sure Adjacency list pointers are biased */ + //ASSERT(IS_BIASED_POINTER(Node->AdjacencyEntry.Flink)); + //ASSERT(IS_BIASED_POINTER(Node->AdjacencyEntry.Blink)); + + DPRINT("RtlpDphRemoveFromAvailableList(%p %p)\n", DphRoot, Node); + + /* Check if it is in the list */ +#if 0 + { + PLIST_ENTRY CurEntry; + PDPH_HEAP_BLOCK NodeEntry; + BOOLEAN Found = FALSE; + + /* Find where to put this node according to its virtual address */ + CurEntry = DphRoot->AvailableAllocationHead.Flink; + + while (CurEntry != &DphRoot->AvailableAllocationHead) + { + NodeEntry = CONTAINING_RECORD(CurEntry, DPH_HEAP_BLOCK, AvailableEntry); + + if (NodeEntry == Node) + { + Found = TRUE; + break; + } + + CurEntry = CurEntry->Flink; + } + + if (!Found) + { + DPRINT1("Trying to remove non-existing in availlist node!\n"); + DbgBreakPoint(); + } + } +#endif + + /* Remove it from the list */ + RemoveEntryList(&Node->AvailableEntry); + + /* Decrease heap counters */ + DphRoot->nAvailableAllocations--; + DphRoot->nAvailableAllocationBytesCommitted -= Node->nVirtualBlockSize; + + /* Remove bias from the AdjacencyEntry pointer */ + Node->AdjacencyEntry.Flink = (PLIST_ENTRY)POINTER_REMOVE_BIAS(Node->AdjacencyEntry.Flink); + Node->AdjacencyEntry.Blink = (PLIST_ENTRY)POINTER_REMOVE_BIAS(Node->AdjacencyEntry.Blink); +} + +VOID NTAPI +RtlpDphRemoveFromBusyList(PDPH_HEAP_ROOT DphRoot, + PDPH_HEAP_BLOCK Node) +{ + BOOLEAN ElementPresent; + + DPRINT("RtlpDphRemoveFromBusyList(%p %p)\n", DphRoot, Node); + + /* Delete it from busy nodes table */ + ElementPresent = RtlDeleteElementGenericTableAvl(&DphRoot->BusyNodesTable, &Node->pUserAllocation); + ASSERT(ElementPresent == TRUE); + + /* Update counters */ + DphRoot->nBusyAllocations--; + DphRoot->nBusyAllocationBytesCommitted -= Node->nVirtualBlockSize; + DphRoot->nBusyAllocationBytesAccessible -= Node->nVirtualAccessSize; +} + +VOID NTAPI +RtlpDphRemoveFromFreeList(PDPH_HEAP_ROOT DphRoot, + PDPH_HEAP_BLOCK Node, + PDPH_HEAP_BLOCK Prev) +{ + PDPH_HEAP_BLOCK Next; + + DPRINT("RtlpDphRemoveFromFreeList(%p %p %p)\n", DphRoot, Node, Prev); + + /* Detach it from the list */ + Next = Node->pNextAlloc; + if (DphRoot->pFreeAllocationListHead == Node) + DphRoot->pFreeAllocationListHead = Next; + if (DphRoot->pFreeAllocationListTail == Node) + DphRoot->pFreeAllocationListTail = Prev; + if (Prev) Prev->pNextAlloc = Next; + + /* Decrease heap counters */ + DphRoot->nFreeAllocations--; + DphRoot->nFreeAllocationBytesCommitted -= Node->nVirtualBlockSize; + + Node->StackTrace = NULL; +} + +VOID NTAPI +RtlpDphCoalesceNodeIntoAvailable(PDPH_HEAP_ROOT DphRoot, + PDPH_HEAP_BLOCK Node) +{ + PDPH_HEAP_BLOCK NodeEntry, PrevNode = NULL, NextNode; + PLIST_ENTRY AvailListHead; + PLIST_ENTRY CurEntry; + + DPRINT("RtlpDphCoalesceNodeIntoAvailable(%p %p)\n", DphRoot, Node); + + /* Update heap counters */ + DphRoot->nAvailableAllocationBytesCommitted += Node->nVirtualBlockSize; + DphRoot->nAvailableAllocations++; + + /* Find where to put this node according to its virtual address */ + AvailListHead = &DphRoot->AvailableAllocationHead; + + /* Find a point where to insert an available node */ + CurEntry = AvailListHead->Flink; + + while (CurEntry != AvailListHead) + { + NodeEntry = CONTAINING_RECORD(CurEntry, DPH_HEAP_BLOCK, AvailableEntry); + if (NodeEntry->pVirtualBlock >= Node->pVirtualBlock) + { + PrevNode = NodeEntry; + break; + } + CurEntry = CurEntry->Flink; + } + + if (!PrevNode) + { + /* That means either this list is empty, or we should add to the head of it */ + InsertHeadList(AvailListHead, &Node->AvailableEntry); + } + else + { + /* Check the previous node and merge if possible */ + if (PrevNode->pVirtualBlock + PrevNode->nVirtualBlockSize == Node->pVirtualBlock) + { + /* They are adjacent - merge! */ + PrevNode->nVirtualBlockSize += Node->nVirtualBlockSize; + RtlpDphReturnNodeToUnusedList(DphRoot, Node); + DphRoot->nAvailableAllocations--; + + Node = PrevNode; + } + else + { + /* Insert after PrevNode */ + InsertTailList(&PrevNode->AvailableEntry, &Node->AvailableEntry); + } + + /* Now check the next entry after our one */ + if (Node->AvailableEntry.Flink != AvailListHead) + { + NextNode = CONTAINING_RECORD(Node->AvailableEntry.Flink, DPH_HEAP_BLOCK, AvailableEntry); + /* Node is not at the tail of the list, check if it's adjacent */ + if (Node->pVirtualBlock + Node->nVirtualBlockSize == NextNode->pVirtualBlock) + { + /* They are adjacent - merge! */ + Node->nVirtualBlockSize += NextNode->nVirtualBlockSize; + + /* Remove next entry from the list and put it into unused entries list */ + RemoveEntryList(&NextNode->AvailableEntry); + RtlpDphReturnNodeToUnusedList(DphRoot, NextNode); + DphRoot->nAvailableAllocations--; + } + } + } +} + +VOID NTAPI +RtlpDphCoalesceFreeIntoAvailable(PDPH_HEAP_ROOT DphRoot, + ULONG LeaveOnFreeList) +{ + PDPH_HEAP_BLOCK Node = DphRoot->pFreeAllocationListHead, Next; + SIZE_T FreeAllocations = DphRoot->nFreeAllocations; + + /* Make sure requested size is not too big */ + ASSERT(FreeAllocations >= LeaveOnFreeList); + + DPRINT("RtlpDphCoalesceFreeIntoAvailable(%p %d)\n", DphRoot, LeaveOnFreeList); + + while (Node) + { + FreeAllocations--; + if (FreeAllocations < LeaveOnFreeList) break; + + /* Get the next pointer, because it may be changed after following two calls */ + Next = Node->pNextAlloc; + + /* Remove it from the free list */ + RtlpDphRemoveFromFreeList(DphRoot, Node, NULL); + + /* And put into the available */ + RtlpDphCoalesceNodeIntoAvailable(DphRoot, Node); + + /* Go to the next node */ + Node = Next; + } +} + +VOID NTAPI +RtlpDphAddNewPool(PDPH_HEAP_ROOT DphRoot, PDPH_HEAP_BLOCK NodeBlock, PVOID Virtual, SIZE_T Size, BOOLEAN PlaceOnPool) +{ + PDPH_HEAP_BLOCK DphNode, DphStartNode; + ULONG NodeCount, i; + + //NodeCount = (Size >> 6) - 1; + NodeCount = (Size / sizeof(DPH_HEAP_BLOCK)); + DphStartNode = Virtual; + + /* Set pNextAlloc for all blocks */ + for (DphNode = Virtual, i=NodeCount-1; i > 0; i--) + { + DphNode->pNextAlloc = DphNode + 1; + DphNode = DphNode->pNextAlloc; + } + + /* and the last one */ + DphNode->pNextAlloc = NULL; + + /* Add it to the tail of unused node list */ + if (DphRoot->pUnusedNodeListTail) + DphRoot->pUnusedNodeListTail->pNextAlloc = DphStartNode; + else + DphRoot->pUnusedNodeListHead = DphStartNode; + + DphRoot->pUnusedNodeListTail = DphNode; + + /* Increase counters */ + DphRoot->nUnusedNodes += NodeCount; + + /* Check if we need to place it on the pool list */ + if (PlaceOnPool) + { + /* Get a node from the unused list */ + DphNode = RtlpDphTakeNodeFromUnusedList(DphRoot); + ASSERT(DphNode); + + /* Set its virtual block values */ + DphNode->pVirtualBlock = Virtual; + DphNode->nVirtualBlockSize = Size; + + /* Place it on the pool list */ + RtlpDphPlaceOnPoolList(DphRoot, DphNode); + } +} + +PDPH_HEAP_BLOCK NTAPI +RtlpDphSearchAvailableMemoryListForBestFit(PDPH_HEAP_ROOT DphRoot, + SIZE_T Size) +{ + PLIST_ENTRY CurEntry; + PDPH_HEAP_BLOCK Node, NodeFound = NULL; + + CurEntry = DphRoot->AvailableAllocationHead.Flink; + + while (CurEntry != &DphRoot->AvailableAllocationHead) + { + /* Get the current available node */ + Node = CONTAINING_RECORD(CurEntry, DPH_HEAP_BLOCK, AvailableEntry); + + /* Check its size */ + if (Node->nVirtualBlockSize >= Size) + { + NodeFound = Node; + break; + } + + /* Move to the next available entry */ + CurEntry = CurEntry->Flink; + } + + /* Make sure Adjacency list pointers are biased */ + //ASSERT(IS_BIASED_POINTER(Node->AdjacencyEntry.Flink)); + //ASSERT(IS_BIASED_POINTER(Node->AdjacencyEntry.Blink)); + + return NodeFound; +} + +PDPH_HEAP_BLOCK NTAPI +RtlpDphFindAvailableMemory(PDPH_HEAP_ROOT DphRoot, + SIZE_T Size, + BOOLEAN Grow) +{ + PDPH_HEAP_BLOCK Node; + ULONG NewSize; + + /* Find an available best fitting node */ + Node = RtlpDphSearchAvailableMemoryListForBestFit(DphRoot, Size); + + /* If that didn't work, try to search a smaller one in the loop */ + while (!Node) + { + /* Break if the free list becomes too small */ + if (DphRoot->nFreeAllocations <= DPH_FREE_LIST_MINIMUM) break; + + /* Calculate a new free list size */ + NewSize = DphRoot->nFreeAllocations >> 2; + if (NewSize < DPH_FREE_LIST_MINIMUM) NewSize = DPH_FREE_LIST_MINIMUM; + + /* Coalesce free into available */ + RtlpDphCoalesceFreeIntoAvailable(DphRoot, NewSize); + + /* Try to find an available best fitting node again */ + Node = RtlpDphSearchAvailableMemoryListForBestFit(DphRoot, Size); + } + + /* If Node is NULL, then we could fix the situation only by + growing the available VM size */ + if (!Node && Grow) + { + /* Grow VM size, if it fails - return failure directly */ + if (!RtlpDphGrowVirtual(DphRoot, Size)) return NULL; + + /* Try to find an available best fitting node again */ + Node = RtlpDphSearchAvailableMemoryListForBestFit(DphRoot, Size); + + if (!Node) + { + /* Do the last attempt: coalesce all free into available (if Size fits there) */ + if (DphRoot->nFreeAllocationBytesCommitted + DphRoot->nAvailableAllocationBytesCommitted >= Size) + { + /* Coalesce free into available */ + RtlpDphCoalesceFreeIntoAvailable(DphRoot, 0); + + /* Try to find an available best fitting node again */ + Node = RtlpDphSearchAvailableMemoryListForBestFit(DphRoot, Size); + } + } + } + + /* Return node we found */ + return Node; +} + +PDPH_HEAP_BLOCK NTAPI +RtlpDphFindBusyMemory(PDPH_HEAP_ROOT DphRoot, + PVOID pUserMem) +{ + PDPH_HEAP_BLOCK Node; + PVOID Ptr; + + /* Lookup busy block in AVL */ + Ptr = RtlLookupElementGenericTableAvl(&DphRoot->BusyNodesTable, &pUserMem); + if (!Ptr) return NULL; + + /* Restore pointer to the heap block */ + Node = CONTAINING_RECORD(Ptr, DPH_HEAP_BLOCK, pUserAllocation); + ASSERT(Node->pUserAllocation == pUserMem); + return Node; +} + +NTSTATUS NTAPI +RtlpDphSetProtectionBeforeUse(PDPH_HEAP_ROOT DphRoot, PUCHAR VirtualBlock, ULONG UserSize) +{ + ULONG Protection; + PVOID Base; + + // FIXME: Check this, when we should add up usersize and when we shouldn't! + if (!(DphRoot->ExtraFlags & DPH_EXTRA_CHECK_UNDERRUN)) + { + Base = VirtualBlock; + } + else + { + Base = VirtualBlock + PAGE_SIZE; + } + + // FIXME: It should be different, but for now it's fine + Protection = PAGE_READWRITE; + + return RtlpDphProtectVm(Base, UserSize, Protection); +} + +NTSTATUS NTAPI +RtlpDphSetProtectionAfterUse(PDPH_HEAP_ROOT DphRoot, /*PUCHAR VirtualBlock*/PDPH_HEAP_BLOCK Node) +{ + // FIXME: Bring stuff here + if (DphRoot->ExtraFlags & DPH_EXTRA_CHECK_UNDERRUN) + { + } + else + { + } + + return STATUS_SUCCESS; +} + +PDPH_HEAP_BLOCK NTAPI +RtlpDphAllocateNode(PDPH_HEAP_ROOT DphRoot) +{ + PDPH_HEAP_BLOCK Node; + NTSTATUS Status; + SIZE_T Size = DPH_POOL_SIZE, SizeVirtual; + PVOID Ptr = NULL; + + /* Check for the easy case */ + if (DphRoot->pUnusedNodeListHead) + { + /* Just take a node from this list */ + Node = RtlpDphTakeNodeFromUnusedList(DphRoot); + ASSERT(Node); + return Node; + } + + /* There is a need to make free space */ + Node = RtlpDphFindAvailableMemory(DphRoot, DPH_POOL_SIZE, FALSE); + + if (!DphRoot->pUnusedNodeListHead && !Node) + { + /* Retry with a smaller request */ + Size = PAGE_SIZE; + Node = RtlpDphFindAvailableMemory(DphRoot, PAGE_SIZE, FALSE); + } + + if (!DphRoot->pUnusedNodeListHead) + { + if (Node) + { + RtlpDphRemoveFromAvailableList(DphRoot, Node); + Ptr = Node->pVirtualBlock; + SizeVirtual = Node->nVirtualBlockSize; + } + else + { + /* No free space, need to alloc a new VM block */ + Size = DPH_POOL_SIZE; + SizeVirtual = DPH_RESERVE_SIZE; + Status = RtlpDphAllocateVm(&Ptr, SizeVirtual, MEM_COMMIT, PAGE_NOACCESS); + + if (!NT_SUCCESS(Status)) + { + /* Retry with a smaller size */ + SizeVirtual = 0x10000; + Status = RtlpDphAllocateVm(&Ptr, SizeVirtual, MEM_COMMIT, PAGE_NOACCESS); + if (!NT_SUCCESS(Status)) return NULL; + } + } + + /* VM is allocated at this point, set protection */ + Status = RtlpDphProtectVm(Ptr, Size, PAGE_READWRITE); + if (!NT_SUCCESS(Status)) + { + if (Node) + { + RtlpDphCoalesceNodeIntoAvailable(DphRoot, Node); + } + else + { + //RtlpDphFreeVm(); + ASSERT(FALSE); + } + + return NULL; + } + + /* Zero the memory */ + if (Node) RtlZeroMemory(Ptr, Size); + + /* Add a new pool based on this VM */ + RtlpDphAddNewPool(DphRoot, Node, Ptr, Size, TRUE); + + if (Node) + { + if (Node->nVirtualBlockSize > Size) + { + Node->pVirtualBlock += Size; + Node->nVirtualBlockSize -= Size; + + RtlpDphCoalesceNodeIntoAvailable(DphRoot, Node); + } + else + { + RtlpDphReturnNodeToUnusedList(DphRoot, Node); + } + } + else + { + /* The new VM block was just allocated a few code lines ago, + so initialize it */ + Node = RtlpDphTakeNodeFromUnusedList(DphRoot); + Node->pVirtualBlock = Ptr; + Node->nVirtualBlockSize = SizeVirtual; + RtlpDphPlaceOnVirtualList(DphRoot, Node); + + Node = RtlpDphTakeNodeFromUnusedList(DphRoot); + Node->pVirtualBlock = (PUCHAR)Ptr + Size; + Node->nVirtualBlockSize = SizeVirtual - Size; + RtlpDphPlaceOnVirtualList(DphRoot, Node); + + /* Coalesce them into available list */ + RtlpDphCoalesceNodeIntoAvailable(DphRoot, Node); + } + } + + return RtlpDphTakeNodeFromUnusedList(DphRoot); +} + +BOOLEAN NTAPI +RtlpDphGrowVirtual(PDPH_HEAP_ROOT DphRoot, + SIZE_T Size) +{ + PDPH_HEAP_BLOCK Node, AvailableNode; + PVOID Base = NULL; + SIZE_T VirtualSize; + NTSTATUS Status; + + /* Start with allocating a couple of nodes */ + Node = RtlpDphAllocateNode(DphRoot); + if (!Node) return FALSE; + + AvailableNode = RtlpDphAllocateNode(DphRoot); + if (!AvailableNode) + { + /* Free the allocated node and return failure */ + RtlpDphReturnNodeToUnusedList(DphRoot, Node); + return FALSE; + } + + /* Calculate size of VM to allocate by rounding it up */ + Size = ROUND_UP(Size, 0xFFFF); + VirtualSize = Size; + if (Size < DPH_RESERVE_SIZE) + VirtualSize = DPH_RESERVE_SIZE; + + /* Allocate the virtual memory */ + // FIXME: Shouldn't it be MEM_RESERVE with later committing? + Status = RtlpDphAllocateVm(&Base, VirtualSize, MEM_COMMIT, PAGE_NOACCESS); + if (!NT_SUCCESS(Status)) + { + /* Retry again with a smaller size */ + VirtualSize = Size; + Status = RtlpDphAllocateVm(&Base, VirtualSize, MEM_COMMIT, PAGE_NOACCESS); + if (!NT_SUCCESS(Status)) + { + /* Free the allocated node and return failure */ + RtlpDphReturnNodeToUnusedList(DphRoot, Node); + RtlpDphReturnNodeToUnusedList(DphRoot, AvailableNode); + return FALSE; + } + } + + /* Set up our two nodes describing this VM */ + Node->pVirtualBlock = Base; + Node->nVirtualBlockSize = VirtualSize; + AvailableNode->pVirtualBlock = Base; + AvailableNode->nVirtualBlockSize = VirtualSize; + + /* Add them to virtual and available lists respectively */ + RtlpDphPlaceOnVirtualList(DphRoot, Node); + RtlpDphCoalesceNodeIntoAvailable(DphRoot, AvailableNode); + + /* Return success */ + return TRUE; +} + +RTL_GENERIC_COMPARE_RESULTS +NTAPI +RtlpDphCompareNodeForTable(IN PRTL_AVL_TABLE Table, + IN PVOID FirstStruct, + IN PVOID SecondStruct) +{ + ULONG_PTR FirstBlock, SecondBlock; + + FirstBlock = *((ULONG_PTR *)FirstStruct); + SecondBlock = *((ULONG_PTR *)SecondStruct); + + if (FirstBlock < SecondBlock) + return GenericLessThan; + else if (FirstBlock > SecondBlock) + return GenericGreaterThan; + + return GenericEqual; +} + +PVOID +NTAPI +RtlpDphAllocateNodeForTable(IN PRTL_AVL_TABLE Table, + IN CLONG ByteSize) +{ + PDPH_HEAP_BLOCK pBlock; + PDPH_HEAP_ROOT DphRoot; + + /* This mega-assert comes from a text search over Windows 2003 checked binary of ntdll.dll */ + ASSERT((ULONG_PTR)(((PRTL_BALANCED_LINKS)0)+1) + sizeof(PUCHAR) == ByteSize); + + /* Get pointer to the containing heap root record */ + DphRoot = CONTAINING_RECORD(Table, DPH_HEAP_ROOT, BusyNodesTable); + pBlock = DphRoot->NodeToAllocate; + + DphRoot->NodeToAllocate = NULL; + ASSERT(pBlock); + + return &(pBlock->TableLinks); +} + +VOID +NTAPI +RtlpDphFreeNodeForTable(IN PRTL_AVL_TABLE Table, + IN PVOID Buffer) +{ + /* Nothing */ +} + +NTSTATUS NTAPI +RtlpDphInitializeDelayedFreeQueue() +{ + NTSTATUS Status; + + Status = RtlInitializeCriticalSection(&RtlpDphDelayedFreeQueueLock); + if (!NT_SUCCESS(Status)) + { + // TODO: Log this error! + DPRINT1("Failure initializing delayed free queue critical section\n"); + return Status; + } + + /* Initialize lists */ + InitializeListHead(&RtlpDphDelayedFreeQueue); + RtlInitializeSListHead(&RtlpDphDelayedTemporaryPushList); + + /* Reset counters */ + RtlpDphMemoryUsedByDelayedFreeBlocks = 0; + RtlpDphNumberOfDelayedFreeBlocks = 0; + + return Status; +} + +VOID NTAPI +RtlpDphFreeDelayedBlocksFromHeap(PDPH_HEAP_ROOT DphRoot, + PHEAP NormalHeap) +{ + PLIST_ENTRY Current, Next; + PDPH_BLOCK_INFORMATION BlockInfo; + ULONG ValidationInfo; + + /* The original routine seems to use a temporary SList to put blocks to be freed, + then it releases the lock and frees the blocks. But let's make it simple for now */ + + /* Acquire the delayed free queue lock */ + RtlEnterCriticalSection(&RtlpDphDelayedFreeQueueLock); + + /* Traverse the list */ + Current = RtlpDphDelayedFreeQueue.Flink; + while (Current != &RtlpDphDelayedFreeQueue); + { + /* Get the next entry pointer */ + Next = Current->Flink; + + BlockInfo = CONTAINING_RECORD(Current, DPH_BLOCK_INFORMATION, FreeQueue); + + /* Check if it belongs to the same heap */ + if (BlockInfo->Heap == DphRoot) + { + /* Remove it from the list */ + RemoveEntryList(Current); + + /* Reset its heap to NULL */ + BlockInfo->Heap = NULL; + + if (!RtlpDphIsNormalFreeHeapBlock(BlockInfo + 1, &ValidationInfo, TRUE)) + { + RtlpDphReportCorruptedBlock(DphRoot, 10, BlockInfo + 1, ValidationInfo); + } + + /* Decrement counters */ + RtlpDphMemoryUsedByDelayedFreeBlocks -= BlockInfo->ActualSize; + RtlpDphNumberOfDelayedFreeBlocks--; + + /* Free the normal heap */ + RtlFreeHeap (NormalHeap, 0, BlockInfo); + } + + /* Move to the next one */ + Current = Next; + } + + /* Release the delayed free queue lock */ + RtlLeaveCriticalSection(&RtlpDphDelayedFreeQueueLock); +} + +NTSTATUS NTAPI +RtlpDphTargetDllsLogicInitialize() +{ + UNIMPLEMENTED; + return STATUS_SUCCESS; +} + +VOID NTAPI +RtlpDphInternalValidatePageHeap(PDPH_HEAP_ROOT DphRoot, PVOID Address, ULONG Value) +{ + UNIMPLEMENTED; +} + +VOID NTAPI +RtlpDphVerifyIntegrity(PDPH_HEAP_ROOT DphRoot) +{ + UNIMPLEMENTED; +} + +VOID NTAPI +RtlpDphReportCorruptedBlock(PDPH_HEAP_ROOT DphRoot, + ULONG Reserved, + PVOID Block, + ULONG ValidationInfo) +{ + //RtlpDphGetBlockSizeFromCorruptedBlock(); + + if (ValidationInfo & DPH_VALINFO_CORRUPTED_AFTER_FREE) + { + DPRINT1("block corrupted after having been freed\n"); + } + + if (ValidationInfo & DPH_VALINFO_ALREADY_FREED) + { + DPRINT1("block already freed\n"); + } + + if (ValidationInfo & DPH_VALINFO_BAD_INFIX_PATTERN) + { + DPRINT1("corrupted infix pattern for freed block\n"); + } + + if (ValidationInfo & DPH_VALINFO_BAD_POINTER) + { + DPRINT1("corrupted heap pointer or using wrong heap\n"); + } + + if (ValidationInfo & DPH_VALINFO_BAD_SUFFIX_PATTERN) + { + DPRINT1("corrupted suffix pattern\n"); + } + + if (ValidationInfo & DPH_VALINFO_BAD_PREFIX_PATTERN) + { + DPRINT1("corrupted prefix pattern\n"); + } + + if (ValidationInfo & DPH_VALINFO_BAD_START_STAMP) + { + DPRINT1("corrupted start stamp\n"); + } + + if (ValidationInfo & DPH_VALINFO_BAD_END_STAMP) + { + DPRINT1("corrupted end stamp\n"); + } + + if (ValidationInfo & DPH_VALINFO_EXCEPTION) + { + DPRINT1("exception raised while verifying block\n"); + } + + DPRINT1("Corrupted heap block %p\n", Block); +} + +BOOLEAN NTAPI +RtlpDphIsPageHeapBlock(PDPH_HEAP_ROOT DphRoot, + PVOID Block, + PULONG ValidationInformation, + BOOLEAN CheckFillers) +{ + PDPH_BLOCK_INFORMATION BlockInfo; + BOOLEAN SomethingWrong = FALSE; + PUCHAR Byte, Start, End; + + ASSERT(ValidationInformation != NULL); + *ValidationInformation = 0; + + // _SEH2_TRY { + BlockInfo = (PDPH_BLOCK_INFORMATION)Block - 1; + + /* Check stamps */ + if (BlockInfo->StartStamp != DPH_FILL_START_STAMP_1) + { + *ValidationInformation |= DPH_VALINFO_BAD_START_STAMP; + SomethingWrong = TRUE; + + /* Check if it has an alloc/free mismatch */ + if (BlockInfo->StartStamp == DPH_FILL_START_STAMP_2) + { + /* Notify respectively */ + *ValidationInformation = 0x101; + } + } + + if (BlockInfo->EndStamp != DPH_FILL_END_STAMP_1) + { + *ValidationInformation |= DPH_VALINFO_BAD_END_STAMP; + SomethingWrong = TRUE; + } + + /* Check root heap pointer */ + if (BlockInfo->Heap != DphRoot) + { + *ValidationInformation |= DPH_VALINFO_BAD_POINTER; + SomethingWrong = TRUE; + } + + /* Check other fillers if requested */ + if (CheckFillers) + { + /* Check space after the block */ + Start = (PUCHAR)Block + BlockInfo->RequestedSize; + End = (PUCHAR)ROUND_UP(Start, PAGE_SIZE); + for (Byte = Start; Byte < End; Byte++) + { + if (*Byte != DPH_FILL_SUFFIX) + { + *ValidationInformation |= DPH_VALINFO_BAD_SUFFIX_PATTERN; + SomethingWrong = TRUE; + break; + } + } + } + + return (SomethingWrong == FALSE); +} + +BOOLEAN NTAPI +RtlpDphIsNormalFreeHeapBlock(PVOID Block, + PULONG ValidationInformation, + BOOLEAN CheckFillers) +{ + ASSERT(ValidationInformation != NULL); + + UNIMPLEMENTED; + *ValidationInformation = 0; + return TRUE; +} + +NTSTATUS NTAPI +RtlpDphProcessStartupInitialization() +{ + NTSTATUS Status; + PTEB Teb = NtCurrentTeb(); + + /* Initialize the DPH heap list and its critical section */ + InitializeListHead(&RtlpDphPageHeapList); + Status = RtlInitializeCriticalSection(&RtlpDphPageHeapListLock); + if (!NT_SUCCESS(Status)) + { + ASSERT(FALSE); + return Status; + } + + /* Initialize delayed-free queue */ + Status = RtlpDphInitializeDelayedFreeQueue(); + if (!NT_SUCCESS(Status)) return Status; + + /* Initialize the target dlls string */ + RtlInitUnicodeString(&RtlpDphTargetDllsUnicode, RtlpDphTargetDlls); + Status = RtlpDphTargetDllsLogicInitialize(); + + /* Per-process DPH init is done */ + RtlpDphPageHeapListInitialized = TRUE; + + DPRINT1("Page heap: pid 0x%X: page heap enabled with flags 0x%X.\n", Teb->ClientId.UniqueProcess, RtlpDphGlobalFlags); + + return Status; +} + +BOOLEAN NTAPI +RtlpDphShouldAllocateInPageHeap(PDPH_HEAP_ROOT DphRoot, + SIZE_T Size) +{ + //UNIMPLEMENTED; + /* Always use page heap for now */ + return TRUE; +} + +HANDLE NTAPI +RtlpPageHeapCreate(ULONG Flags, + PVOID Addr, + SIZE_T TotalSize, + SIZE_T CommitSize, + PVOID Lock, + PRTL_HEAP_PARAMETERS Parameters) +{ + PVOID Base = NULL; + PHEAP HeapPtr; + PDPH_HEAP_ROOT DphRoot; + PDPH_HEAP_BLOCK DphNode; + ULONG MemSize; + NTSTATUS Status; + LARGE_INTEGER PerfCounter; + + /* Check for a DPH bypass flag */ + if ((ULONG_PTR)Parameters == -1) return NULL; + + /* Make sure no user-allocated stuff was provided */ + if (Addr || Lock) return NULL; + + /* Allocate minimum amount of virtual memory */ + MemSize = DPH_RESERVE_SIZE; + Status = RtlpDphAllocateVm(&Base, MemSize, MEM_COMMIT, PAGE_NOACCESS); + if (!NT_SUCCESS(Status)) + { + ASSERT(FALSE); + return NULL; + } + + /* Set protection */ + Status = RtlpDphProtectVm(Base, 2*PAGE_SIZE + DPH_POOL_SIZE, PAGE_READWRITE); + if (!NT_SUCCESS(Status)) + { + //RtlpDphFreeVm(Base, 0, 0, 0); + ASSERT(FALSE); + return NULL; + } + + /* Start preparing the 1st page. Fill it with the default filler */ + RtlFillMemory(Base, PAGE_SIZE, DPH_FILL); + + /* Set flags in the "HEAP" structure */ + HeapPtr = (PHEAP)Base; + HeapPtr->Flags = Flags | HEAP_FLAG_PAGE_ALLOCS; + HeapPtr->ForceFlags = Flags | HEAP_FLAG_PAGE_ALLOCS; + + /* Set 1st page to read only now */ + Status = RtlpDphProtectVm(Base, PAGE_SIZE, PAGE_READONLY); + if (!NT_SUCCESS(Status)) + { + ASSERT(FALSE); + return NULL; + } + + /* 2nd page is the real DPH root block */ + DphRoot = (PDPH_HEAP_ROOT)((PCHAR)Base + PAGE_SIZE); + + /* Initialize the DPH root */ + DphRoot->Signature = DPH_SIGNATURE; + DphRoot->HeapFlags = Flags; + DphRoot->HeapCritSect = (PRTL_CRITICAL_SECTION)((PCHAR)DphRoot + DPH_POOL_SIZE); + DphRoot->ExtraFlags = RtlpDphGlobalFlags; + + ZwQueryPerformanceCounter(&PerfCounter, NULL); + DphRoot->Seed = PerfCounter.LowPart; + + RtlInitializeCriticalSection(DphRoot->HeapCritSect); + InitializeListHead(&DphRoot->AvailableAllocationHead); + + /* Create a normal heap for this paged heap */ + DphRoot->NormalHeap = RtlCreateHeap(Flags, NULL, TotalSize, CommitSize, NULL, (PRTL_HEAP_PARAMETERS)-1); + if (!DphRoot->NormalHeap) + { + ASSERT(FALSE); + return NULL; + } + + /* 3rd page: a pool for DPH allocations */ + RtlpDphAddNewPool(DphRoot, NULL, DphRoot + 1, DPH_POOL_SIZE - sizeof(DPH_HEAP_ROOT), FALSE); + + /* Allocate internal heap blocks. For the root */ + DphNode = RtlpDphAllocateNode(DphRoot); + ASSERT(DphNode != NULL); + DphNode->pVirtualBlock = (PUCHAR)DphRoot; + DphNode->nVirtualBlockSize = DPH_POOL_SIZE; + RtlpDphPlaceOnPoolList(DphRoot, DphNode); + + /* For the memory we allocated as a whole */ + DphNode = RtlpDphAllocateNode(DphRoot); + ASSERT(DphNode != NULL); + DphNode->pVirtualBlock = Base; + DphNode->nVirtualBlockSize = MemSize; + RtlpDphPlaceOnVirtualList(DphRoot, DphNode); + + /* For the remaining part */ + DphNode = RtlpDphAllocateNode(DphRoot); + ASSERT(DphNode != NULL); + DphNode->pVirtualBlock = (PUCHAR)Base + 2*PAGE_SIZE + DPH_POOL_SIZE; + DphNode->nVirtualBlockSize = MemSize - (2*PAGE_SIZE + DPH_POOL_SIZE); + RtlpDphCoalesceNodeIntoAvailable(DphRoot, DphNode); + + //DphRoot->CreateStackTrace = RtlpDphLogStackTrace(1); + + /* Initialize AVL-based busy nodes table */ + RtlInitializeGenericTableAvl(&DphRoot->BusyNodesTable, + RtlpDphCompareNodeForTable, + RtlpDphAllocateNodeForTable, + RtlpDphFreeNodeForTable, + NULL); + + /* Initialize per-process startup info */ + if (!RtlpDphPageHeapListInitialized) RtlpDphProcessStartupInitialization(); + + /* Acquire the heap list lock */ + RtlEnterCriticalSection(&RtlpDphPageHeapListLock); + + /* Insert this heap to the tail of the global list */ + InsertTailList(&RtlpDphPageHeapList, &DphRoot->NextHeap); + + /* Note we increased the size of the list */ + RtlpDphPageHeapListLength++; + + /* Release the heap list lock */ + RtlLeaveCriticalSection(&RtlpDphPageHeapListLock); + + if (RtlpDphDebugOptions & DPH_DEBUG_VERBOSE) + { + DPRINT1("Page heap: process 0x%X created heap @ %p (%p, flags 0x%X)\n", + NtCurrentTeb()->ClientId.UniqueProcess, (PUCHAR)DphRoot - PAGE_SIZE, DphRoot->NormalHeap, DphRoot->ExtraFlags); + } + + /* Perform internal validation if required */ + if (RtlpDphDebugOptions & DPH_DEBUG_INTERNAL_VALIDATE) + RtlpDphInternalValidatePageHeap(DphRoot, NULL, 0); + + return (PUCHAR)DphRoot - PAGE_SIZE; +} + +PVOID NTAPI +RtlpPageHeapDestroy(HANDLE HeapPtr) +{ + PDPH_HEAP_ROOT DphRoot; + PDPH_HEAP_BLOCK Node, Next; + PHEAP NormalHeap; + ULONG Value; + + /* Check if it's not a process heap */ + if (HeapPtr == RtlGetProcessHeap()) + { + DbgBreakPoint(); + return NULL; + } + + /* Get pointer to the heap root */ + DphRoot = RtlpDphPointerFromHandle(HeapPtr); + if (!DphRoot) return NULL; + + RtlpDphPreProcessing(DphRoot, DphRoot->HeapFlags); + + /* Get the pointer to the normal heap */ + NormalHeap = DphRoot->NormalHeap; + + /* Free the delayed-free blocks */ + RtlpDphFreeDelayedBlocksFromHeap(DphRoot, NormalHeap); + + /* Go through the busy blocks */ + Node = RtlEnumerateGenericTableAvl(&DphRoot->BusyNodesTable, TRUE); + + while (Node) + { + if (!(DphRoot->ExtraFlags & DPH_EXTRA_CHECK_UNDERRUN)) + { + if (!RtlpDphIsPageHeapBlock(DphRoot, Node->pUserAllocation, &Value, TRUE)) + { + RtlpDphReportCorruptedBlock(DphRoot, 3, Node->pUserAllocation, Value); + } + } + + /* FIXME: Call AV notification */ + //AVrfInternalHeapFreeNotification(); + + /* Go to the next node */ + Node = RtlEnumerateGenericTableAvl(&DphRoot->BusyNodesTable, FALSE); + } + + /* Acquire the global heap list lock */ + RtlEnterCriticalSection(&RtlpDphPageHeapListLock); + + /* Remove the entry and decrement the global counter */ + RemoveEntryList(&DphRoot->NextHeap); + RtlpDphPageHeapListLength--; + + /* Release the global heap list lock */ + RtlLeaveCriticalSection(&RtlpDphPageHeapListLock); + + /* Leave and delete this heap's critical section */ + RtlLeaveCriticalSection(DphRoot->HeapCritSect); + RtlDeleteCriticalSection(DphRoot->HeapCritSect); + + /* Now go through all virtual list nodes and release the VM */ + Node = DphRoot->pVirtualStorageListHead; + while (Node) + { + Next = Node->pNextAlloc; + /* Release the memory without checking result */ + RtlpDphFreeVm(Node->pVirtualBlock, 0, MEM_RELEASE); + Node = Next; + } + + /* Destroy the normal heap */ + RtlDestroyHeap(NormalHeap); + + /* Report success */ + if (RtlpDphDebugOptions & DPH_DEBUG_VERBOSE) + DPRINT1("Page heap: process 0x%X destroyed heap @ %p (%p)\n", NtCurrentTeb()->ClientId.UniqueProcess, HeapPtr, NormalHeap); + + return NULL; +} + +PVOID NTAPI +RtlpPageHeapAllocate(IN PVOID HeapPtr, + IN ULONG Flags, + IN SIZE_T Size) +{ + PDPH_HEAP_ROOT DphRoot; + PDPH_HEAP_BLOCK Node, AllocatedNode; + BOOLEAN Biased = FALSE; + ULONG TotalSize, AccessSize; + NTSTATUS Status; + SIZE_T UserActualSize; + PVOID Ptr; + + /* Check requested size */ + if (Size > 0x7FF00000) + { + DPRINT1("extreme size request\n"); + + /* Generate an exception if needed */ + if (Flags & HEAP_GENERATE_EXCEPTIONS) RtlpDphRaiseException(STATUS_NO_MEMORY); + + return NULL; + } + + /* Unbias the pointer if necessary */ + if (IS_BIASED_POINTER(HeapPtr)) + { + HeapPtr = (PVOID)POINTER_REMOVE_BIAS(HeapPtr); + Biased = TRUE; + } + + /* Get a pointer to the heap root */ + DphRoot = RtlpDphPointerFromHandle(HeapPtr); + if (!DphRoot) return NULL; + + /* Acquire the heap lock */ + //RtlpDphEnterCriticalSection(DphRoot, Flags); + RtlpDphPreProcessing(DphRoot, Flags); + + /* Perform internal validation if specified by flags */ + if (RtlpDphDebugOptions & DPH_DEBUG_INTERNAL_VALIDATE && !Biased) + { + RtlpDphInternalValidatePageHeap(DphRoot, NULL, 0); + } + + /* Add heap flags */ + Flags |= DphRoot->HeapFlags; + + if (!Biased && !RtlpDphShouldAllocateInPageHeap(DphRoot, Size)) + { + /* Perform allocation from a normal heap */ + ASSERT(FALSE); + } + + /* Perform heap integrity check if specified by flags */ + if (RtlpDphDebugOptions & DPH_DEBUG_INTERNAL_VALIDATE) + { + RtlpDphVerifyIntegrity(DphRoot); + } + + /* Calculate sizes */ + AccessSize = ROUND_UP(Size + sizeof(DPH_BLOCK_INFORMATION), PAGE_SIZE); + TotalSize = AccessSize + PAGE_SIZE; + + // RtlpDphAllocateNode(DphRoot); + Node = RtlpDphFindAvailableMemory(DphRoot, TotalSize, TRUE); + if (!Node) + { + DPRINT1("Page heap: Unable to allocate virtual memory\n"); + DbgBreakPoint(); + + /* Release the lock */ + RtlpDphPostProcessing(DphRoot); + + return NULL; + } + ASSERT(Node->nVirtualBlockSize >= TotalSize); + + /* Set protection */ + Status = RtlpDphSetProtectionBeforeUse(DphRoot, Node->pVirtualBlock, AccessSize); + if (!NT_SUCCESS(Status)) + { + ASSERT(FALSE); + } + + Ptr = Node->pVirtualBlock; + + /* Check node's size */ + if (Node->nVirtualBlockSize > TotalSize) + { + /* The block contains too much free space, reduce it */ + Node->pVirtualBlock += TotalSize; + Node->nVirtualBlockSize -= TotalSize; + DphRoot->nAvailableAllocationBytesCommitted -= TotalSize; + + AllocatedNode = RtlpDphAllocateNode(DphRoot); + ASSERT(AllocatedNode != NULL); + AllocatedNode->pVirtualBlock = Ptr; + AllocatedNode->nVirtualBlockSize = TotalSize; + } + else + { + /* The block's size fits exactly */ + RtlpDphRemoveFromAvailableList(DphRoot, Node); + AllocatedNode = Node; + } + + /* Calculate actual user size */ + if (DphRoot->HeapFlags & HEAP_NO_ALIGNMENT) + UserActualSize = Size; + else + UserActualSize = ROUND_UP(Size, 8); + + /* Set up the block */ + AllocatedNode->nVirtualAccessSize = AccessSize; + AllocatedNode->nUserActualSize = UserActualSize; + AllocatedNode->nUserRequestedSize = Size; + + if (DphRoot->ExtraFlags & DPH_EXTRA_CHECK_UNDERRUN) + AllocatedNode->pUserAllocation = AllocatedNode->pVirtualBlock + PAGE_SIZE; + else + AllocatedNode->pUserAllocation = AllocatedNode->pVirtualBlock + AllocatedNode->nVirtualAccessSize - UserActualSize; + + AllocatedNode->UserValue = NULL; + AllocatedNode->UserFlags = Flags & HEAP_SETTABLE_USER_FLAGS; + + // FIXME: Don't forget about stack traces if such flag was set + AllocatedNode->StackTrace = NULL; + + /* Place it on busy list */ + RtlpDphPlaceOnBusyList(DphRoot, AllocatedNode); + + /* Zero or patter-fill memory depending on flags */ + if (Flags & HEAP_ZERO_MEMORY) + RtlZeroMemory(AllocatedNode->pUserAllocation, Size); + else + RtlFillMemory(AllocatedNode->pUserAllocation, Size, DPH_FILL_INFIX); + + /* Write DPH info */ + if (!(DphRoot->ExtraFlags & DPH_EXTRA_CHECK_UNDERRUN)) + { + RtlpDphWritePageHeapBlockInformation(DphRoot, AllocatedNode->pUserAllocation, Size, AccessSize); + } + + /* Finally allocation is done, perform validation again if required */ + if (RtlpDphDebugOptions & DPH_DEBUG_INTERNAL_VALIDATE && !Biased) + { + RtlpDphInternalValidatePageHeap(DphRoot, NULL, 0); + } + + /* Release the lock */ + RtlpDphPostProcessing(DphRoot); + + DPRINT("Allocated user block pointer: %p\n", AllocatedNode->pUserAllocation); + + /* Return pointer to user allocation */ + return AllocatedNode->pUserAllocation; +} + +BOOLEAN NTAPI +RtlpPageHeapFree(HANDLE HeapPtr, + ULONG Flags, + PVOID Ptr) +{ + PDPH_HEAP_ROOT DphRoot; + PDPH_HEAP_BLOCK Node; + ULONG ValidationInfo; + PDPH_BLOCK_INFORMATION Info; + + /* Check for a NULL pointer freeing */ + if (!Ptr) + { + if (RtlpDphBreakOptions & DPH_BREAK_ON_NULL_FREE) + { + DPRINT1("Page heap: freeing a null pointer \n"); + DbgBreakPoint(); + } + return TRUE; + } + + /* Get a pointer to the heap root */ + DphRoot = RtlpDphPointerFromHandle(HeapPtr); + if (!DphRoot) return FALSE; + + /* Acquire the heap lock */ + RtlpDphPreProcessing(DphRoot, Flags); + + /* Perform internal validation if specified by flags */ + if (RtlpDphDebugOptions & DPH_DEBUG_INTERNAL_VALIDATE) + RtlpDphInternalValidatePageHeap(DphRoot, NULL, 0); + + /* Add heap flags */ + Flags |= DphRoot->HeapFlags; + + /* Find busy memory */ + Node = RtlpDphFindBusyMemory(DphRoot, Ptr); + + if (!Node) + { + /* This block was not found in page heap, try a normal heap instead */ + //RtlpDphNormalHeapFree(); + ASSERT(FALSE); + } + + if (!(DphRoot->ExtraFlags & DPH_EXTRA_CHECK_UNDERRUN)) + { + /* Check and report corrupted block */ + if (!RtlpDphIsPageHeapBlock(DphRoot, Ptr, &ValidationInfo, TRUE)) + { + RtlpDphReportCorruptedBlock(DphRoot, 1, Ptr, ValidationInfo); + } + + // FIXME: Should go inside RtlpDphSetProtectionAfterUse + if (Node->nVirtualAccessSize != 0) + { + /* Set stamps */ + Info = (PDPH_BLOCK_INFORMATION)Node->pUserAllocation - 1; + Info->StartStamp = DPH_FILL_START_STAMP_2; + Info->EndStamp = DPH_FILL_END_STAMP_2; + + RtlpDphProtectVm(Node->pVirtualBlock, Node->nVirtualAccessSize, PAGE_NOACCESS); + } + } + else + { + // FIXME: Should go inside RtlpDphSetProtectionAfterUse + if (Node->nVirtualAccessSize != 0) + RtlpDphProtectVm(Node->pVirtualBlock + PAGE_SIZE, Node->nVirtualAccessSize, PAGE_NOACCESS); + } + + /* Set new protection */ + RtlpDphSetProtectionAfterUse(DphRoot, Node); + + /* Remove it from the list of busy nodes */ + RtlpDphRemoveFromBusyList(DphRoot, Node); + + /* And put it into the list of free nodes */ + RtlpDphPlaceOnFreeList(DphRoot, Node); + + //if (DphRoot->ExtraFlags & DPH_EXTRA_LOG_STACK_TRACES) + // Node->StackTrace = RtlpDphLogStackTrace(3); + //else + Node->StackTrace = NULL; + + /* Leave the heap lock */ + RtlpDphPostProcessing(DphRoot); + + /* Return success */ + return TRUE; +} + +PVOID NTAPI +RtlpPageHeapReAllocate(HANDLE HeapPtr, + ULONG Flags, + PVOID Ptr, + SIZE_T Size) +{ + PDPH_HEAP_ROOT DphRoot; + PDPH_HEAP_BLOCK Node = NULL, AllocatedNode; + BOOLEAN Biased = FALSE, UseNormalHeap = FALSE, OldBlockPageHeap = TRUE; + ULONG DataSize, ValidationInfo; + PVOID NewAlloc = NULL; + + /* Check requested size */ + if (Size > 0x7FF00000) + { + DPRINT1("extreme size request\n"); + + /* Generate an exception if needed */ + if (Flags & HEAP_GENERATE_EXCEPTIONS) RtlpDphRaiseException(STATUS_NO_MEMORY); + + return NULL; + } + + /* Unbias the pointer if necessary */ + if (IS_BIASED_POINTER(HeapPtr)) + { + HeapPtr = (PVOID)POINTER_REMOVE_BIAS(HeapPtr); + Biased = TRUE; + } + + /* Get a pointer to the heap root */ + DphRoot = RtlpDphPointerFromHandle(HeapPtr); + if (!DphRoot) return NULL; + + /* Acquire the heap lock */ + RtlpDphPreProcessing(DphRoot, Flags); + + /* Perform internal validation if specified by flags */ + if (RtlpDphDebugOptions & DPH_DEBUG_INTERNAL_VALIDATE) + { + RtlpDphInternalValidatePageHeap(DphRoot, NULL, 0); + } + + /* Add heap flags */ + Flags |= DphRoot->HeapFlags; + + /* Exit with NULL right away if inplace is specified */ + if (Flags & HEAP_REALLOC_IN_PLACE_ONLY) + { + /* Release the lock */ + RtlpDphPostProcessing(DphRoot); + + /* Generate an exception if needed */ + if (Flags & HEAP_GENERATE_EXCEPTIONS) RtlpDphRaiseException(STATUS_NO_MEMORY); + + return NULL; + } + + /* Try to get node of the allocated block */ + AllocatedNode = RtlpDphFindBusyMemory(DphRoot, Ptr); + + if (!AllocatedNode) + { + /* This block was not found in page heap, try a normal heap instead */ + //RtlpDphNormalHeapFree(); + ASSERT(FALSE); + OldBlockPageHeap = FALSE; + } + + /* Check the block */ + if (!(DphRoot->ExtraFlags & DPH_EXTRA_CHECK_UNDERRUN)) + { + if (!RtlpDphIsPageHeapBlock(DphRoot, AllocatedNode->pUserAllocation, &ValidationInfo, TRUE)) + { + RtlpDphReportCorruptedBlock(DphRoot, 3, AllocatedNode->pUserAllocation, ValidationInfo); + } + } + + /* Remove old one from the busy list */ + RtlpDphRemoveFromBusyList(DphRoot, AllocatedNode); + + if (!Biased && !RtlpDphShouldAllocateInPageHeap(DphRoot, Size)) + { + // FIXME: Use normal heap + ASSERT(FALSE); + UseNormalHeap = TRUE; + } + else + { + /* Now do a trick: bias the pointer and call our allocate routine */ + NewAlloc = RtlpPageHeapAllocate((PVOID)POINTER_ADD_BIAS(HeapPtr), Flags, Size); + } + + if (!NewAlloc) + { + /* New allocation failed, put the block back (if it was found in page heap) */ + RtlpDphPlaceOnBusyList(DphRoot, AllocatedNode); + + /* Release the lock */ + RtlpDphPostProcessing(DphRoot); + + /* Perform validation again if required */ + if (RtlpDphDebugOptions & DPH_DEBUG_INTERNAL_VALIDATE) + { + RtlpDphInternalValidatePageHeap(DphRoot, NULL, 0); + } + + /* Generate an exception if needed */ + if (Flags & HEAP_GENERATE_EXCEPTIONS) RtlpDphRaiseException(STATUS_NO_MEMORY); + + return NULL; + } + + /* Copy contents of the old block */ + if (AllocatedNode->nUserRequestedSize > Size) + DataSize = Size; + else + DataSize = AllocatedNode->nUserRequestedSize; + + if (DataSize != 0) RtlCopyMemory(NewAlloc, Ptr, DataSize); + + /* Copy user flags and values */ + if (!UseNormalHeap) + { + /* Get the node of the new block */ + Node = RtlpDphFindBusyMemory(DphRoot, NewAlloc); + ASSERT(Node != NULL); + + /* Set its values/flags */ + Node->UserValue = AllocatedNode->UserValue; + if (Flags & HEAP_SETTABLE_USER_FLAGS) + Node->UserFlags = Flags & HEAP_SETTABLE_USER_FLAGS; + else + Node->UserFlags = AllocatedNode->UserFlags; + } + + if (!OldBlockPageHeap) + { + /* Weird scenario, investigate */ + ASSERT(FALSE); + } + + /* Mark the old block as no access */ + if (AllocatedNode->nVirtualAccessSize != 0) + { + RtlpDphProtectVm(AllocatedNode->pVirtualBlock, AllocatedNode->nVirtualAccessSize, PAGE_NOACCESS); + } + + /* And place it on the free list */ + RtlpDphPlaceOnFreeList(DphRoot, AllocatedNode); + + // FIXME: Capture stack traces if needed + AllocatedNode->StackTrace = NULL; + + /* Finally allocation is done, perform validation again if required */ + if (RtlpDphDebugOptions & DPH_DEBUG_INTERNAL_VALIDATE && !Biased) + { + RtlpDphInternalValidatePageHeap(DphRoot, NULL, 0); + } + + /* Release the lock */ + RtlpDphPostProcessing(DphRoot); + + DPRINT("Allocated new user block pointer: %p\n", NewAlloc); + + /* Return pointer to user allocation */ + return NewAlloc; +} + +BOOLEAN NTAPI +RtlpPageHeapGetUserInfo(PVOID HeapHandle, + ULONG Flags, + PVOID BaseAddress, + PVOID *UserValue, + PULONG UserFlags) +{ + PDPH_HEAP_ROOT DphRoot; + PDPH_HEAP_BLOCK Node; + + /* Get a pointer to the heap root */ + DphRoot = RtlpDphPointerFromHandle(HeapHandle); + if (!DphRoot) return FALSE; + + /* Add heap flags */ + Flags |= DphRoot->HeapFlags; + + /* Acquire the heap lock */ + RtlpDphPreProcessing(DphRoot, Flags); + + /* Find busy memory */ + Node = RtlpDphFindBusyMemory(DphRoot, BaseAddress); + + if (!Node) + { + /* This block was not found in page heap, try a normal heap instead */ + //RtlpDphNormalHeapGetUserInfo(); + ASSERT(FALSE); + return FALSE; + } + + /* Get user values and flags and store them in user provided pointers */ + if (UserValue) *UserValue = Node->UserValue; + if (UserFlags) *UserFlags = Node->UserFlags; + + /* Leave the heap lock */ + RtlpDphPostProcessing(DphRoot); + + /* Return success */ + return TRUE; +} + +BOOLEAN NTAPI +RtlpPageHeapSetUserValue(PVOID HeapHandle, + ULONG Flags, + PVOID BaseAddress, + PVOID UserValue) +{ + PDPH_HEAP_ROOT DphRoot; + PDPH_HEAP_BLOCK Node; + + /* Get a pointer to the heap root */ + DphRoot = RtlpDphPointerFromHandle(HeapHandle); + if (!DphRoot) return FALSE; + + /* Add heap flags */ + Flags |= DphRoot->HeapFlags; + + /* Acquire the heap lock */ + RtlpDphPreProcessing(DphRoot, Flags); + + /* Find busy memory */ + Node = RtlpDphFindBusyMemory(DphRoot, BaseAddress); + + if (!Node) + { + /* This block was not found in page heap, try a normal heap instead */ + //RtlpDphNormalHeapSetUserValue(); + ASSERT(FALSE); + return FALSE; + } + + /* Get user values and flags and store them in user provided pointers */ + Node->UserValue = UserValue; + + /* Leave the heap lock */ + RtlpDphPostProcessing(DphRoot); + + /* Return success */ + return TRUE; +} + +BOOLEAN +NTAPI +RtlpPageHeapSetUserFlags(PVOID HeapHandle, + ULONG Flags, + PVOID BaseAddress, + ULONG UserFlagsReset, + ULONG UserFlagsSet) +{ + PDPH_HEAP_ROOT DphRoot; + PDPH_HEAP_BLOCK Node; + + /* Get a pointer to the heap root */ + DphRoot = RtlpDphPointerFromHandle(HeapHandle); + if (!DphRoot) return FALSE; + + /* Add heap flags */ + Flags |= DphRoot->HeapFlags; + + /* Acquire the heap lock */ + RtlpDphPreProcessing(DphRoot, Flags); + + /* Find busy memory */ + Node = RtlpDphFindBusyMemory(DphRoot, BaseAddress); + + if (!Node) + { + /* This block was not found in page heap, try a normal heap instead */ + //RtlpDphNormalHeapSetUserFlags(); + ASSERT(FALSE); + return FALSE; + } + + /* Get user values and flags and store them in user provided pointers */ + Node->UserFlags &= ~(UserFlagsReset); + Node->UserFlags |= UserFlagsSet; + + /* Leave the heap lock */ + RtlpDphPostProcessing(DphRoot); + + /* Return success */ + return TRUE; +} + +SIZE_T NTAPI +RtlpPageHeapSize(HANDLE HeapHandle, + ULONG Flags, + PVOID BaseAddress) +{ + PDPH_HEAP_ROOT DphRoot; + PDPH_HEAP_BLOCK Node; + SIZE_T Size; + + /* Get a pointer to the heap root */ + DphRoot = RtlpDphPointerFromHandle(HeapHandle); + if (!DphRoot) return -1; + + /* Add heap flags */ + Flags |= DphRoot->HeapFlags; + + /* Acquire the heap lock */ + RtlpDphPreProcessing(DphRoot, Flags); + + /* Find busy memory */ + Node = RtlpDphFindBusyMemory(DphRoot, BaseAddress); + + if (!Node) + { + /* This block was not found in page heap, try a normal heap instead */ + //RtlpDphNormalHeapSize(); + ASSERT(FALSE); + return -1; + } + + /* Get heap block size */ + Size = Node->nUserRequestedSize; + + /* Leave the heap lock */ + RtlpDphPostProcessing(DphRoot); + + /* Return user requested size */ + return Size; +} + +BOOLEAN +NTAPI +RtlpDebugPageHeapValidate(PVOID HeapHandle, + ULONG Flags, + PVOID BaseAddress) +{ + PDPH_HEAP_ROOT DphRoot; + PDPH_HEAP_BLOCK Node = NULL; + BOOLEAN Valid = FALSE; + + /* Get a pointer to the heap root */ + DphRoot = RtlpDphPointerFromHandle(HeapHandle); + if (!DphRoot) return -1; + + /* Add heap flags */ + Flags |= DphRoot->HeapFlags; + + /* Acquire the heap lock */ + RtlpDphPreProcessing(DphRoot, Flags); + + /* Find busy memory */ + if (BaseAddress) + Node = RtlpDphFindBusyMemory(DphRoot, BaseAddress); + + if (!Node) + { + /* This block was not found in page heap, or the request is to validate all normal heap */ + Valid = RtlpDphNormalHeapValidate(DphRoot, Flags, BaseAddress); + } + + /* Leave the heap lock */ + RtlpDphPostProcessing(DphRoot); + + /* Return result of a normal heap validation */ + if (BaseAddress && !Node) + return Valid; + + /* Otherwise return our own result */ + if (!BaseAddress || Node) Valid = TRUE; + + return Valid; +} + +BOOLEAN +NTAPI +RtlpDphNormalHeapValidate(PDPH_HEAP_ROOT DphRoot, + ULONG Flags, + PVOID BaseAddress) +{ + PDPH_BLOCK_INFORMATION BlockInfo = (PDPH_BLOCK_INFORMATION)BaseAddress - 1; + if (!BaseAddress) + { + /* Validate all normal heap */ + return RtlValidateHeap(DphRoot->NormalHeap, Flags, NULL); + } + + // FIXME: Check is this a normal heap block + /*if (!RtlpDphIsNormalHeapBlock(DphRoot, BaseAddress, &ValidationInfo)) + { + }*/ + + return RtlValidateHeap(DphRoot->NormalHeap, Flags, BlockInfo); +} + +/* EOF */ diff --git a/lib/rtl/nls.c b/lib/rtl/nls.c index 131587ddbc3..697835dd697 100644 --- a/lib/rtl/nls.c +++ b/lib/rtl/nls.c @@ -226,9 +226,9 @@ RtlInitNlsTables(IN PUSHORT AnsiTableBase, */ NTSTATUS NTAPI RtlMultiByteToUnicodeN( - IN PWCHAR UnicodeString, + OUT PWCHAR UnicodeString, IN ULONG UnicodeSize, - IN PULONG ResultSize, + OUT PULONG ResultSize, IN PCSTR MbString, IN ULONG MbSize) { @@ -286,7 +286,7 @@ RtlMultiByteToUnicodeN( *ResultSize = i * sizeof(WCHAR); } - return(STATUS_SUCCESS); + return STATUS_SUCCESS; } diff --git a/lib/rtl/path.c b/lib/rtl/path.c index 238d5c89b34..d0b4e21a7a1 100644 --- a/lib/rtl/path.c +++ b/lib/rtl/path.c @@ -3,7 +3,9 @@ * PROJECT: ReactOS system libraries * FILE: lib/rtl/path.c * PURPOSE: Path and current directory functions - * PROGRAMMERS: + * PROGRAMMERS: Wine team + * Thomas Weidenmueller + * Gunnar Dalsnes */ /* INCLUDES *****************************************************************/ @@ -112,30 +114,24 @@ RtlIsDosDeviceName_U(PWSTR dos_name) if (!_wcsicmp( dos_name, consoleW )) return MAKELONG( sizeof(conW), 4 * sizeof(WCHAR) ); /* 4 is length of \\.\ prefix */ return 0; + case RtlPathTypeDriveAbsolute: + case RtlPathTypeDriveRelative: + start = dos_name + 2; /* skip drive letter */ + break; default: + start = dos_name; break; } - end = dos_name + wcslen(dos_name) - 1; - while (end >= dos_name && *end == ':') end--; /* remove all trailing ':' */ - /* find start of file name */ - for (start = end; start >= dos_name; start--) - { - if (IS_PATH_SEPARATOR(start[0])) break; - /* check for ':' but ignore if before extension (for things like NUL:.txt) */ - if (start[0] == ':' && start[1] != '.') break; - } - start++; + for (p = start; *p; p++) if (IS_PATH_SEPARATOR(*p)) start = p + 1; + + /* truncate at extension and ':' */ + for (end = start; *end; end++) if (*end == '.' || *end == ':') break; + end--; - /* remove extension */ - if ((p = wcschr( start, '.' ))) - { - end = p - 1; - if (end >= dos_name && *end == ':') end--; /* remove trailing ':' before extension */ - } /* remove trailing spaces */ - while (end >= dos_name && *end == ' ') end--; + while (end >= start && *end == ' ') end--; /* now we have a potential device name between start and end, check it */ switch(end - start + 1) @@ -218,6 +214,8 @@ RtlSetCurrentDirectory_U(PUNICODE_STRING dir) DPRINT("RtlSetCurrentDirectory %wZ\n", dir); + full.Buffer = NULL; + RtlAcquirePebLock (); cd = (PCURDIR)&NtCurrentPeb ()->ProcessParameters->CurrentDirectory.DosPath; @@ -287,16 +285,13 @@ RtlSetCurrentDirectory_U(PUNICODE_STRING dir) } - /****************************************************************** - * collapse_path + * collapse_path * * Helper for RtlGetFullPathName_U. - * 1) Convert slashes into backslashes - * 2) Get rid of duplicate backslashes - * 3) Get rid of . and .. components in the path. + * Get rid of . and .. components in the path. */ -static __inline void collapse_path( WCHAR *path, UINT mark ) +void FORCEINLINE collapse_path( WCHAR *path, UINT mark ) { WCHAR *p, *next; @@ -469,9 +464,11 @@ static ULONG get_full_path_helper( tmp[1] = ':'; tmp[2] = '\\'; ins_str = tmp; + RtlFreeHeap(RtlGetProcessHeap(), 0, val.Buffer); break; default: DPRINT1("Unsupported status code\n"); + RtlFreeHeap(RtlGetProcessHeap(), 0, val.Buffer); break; } mark = 3; @@ -554,7 +551,7 @@ static ULONG get_full_path_helper( if (reqsize) memcpy(buffer, ins_str, reqsize); reqsize += deplen; - if (ins_str && ins_str != tmp && ins_str != cd->Buffer) + if (ins_str != tmp && ins_str != cd->Buffer) RtlFreeHeap(RtlGetProcessHeap(), 0, ins_str); collapse_path( buffer, mark ); @@ -614,10 +611,9 @@ ULONG NTAPI RtlGetFullPathName_U( if (reqsize > size) { LPWSTR tmp = RtlAllocateHeap(RtlGetProcessHeap(), 0, reqsize); - if (tmp == NULL) - return 0; + if (tmp == NULL) return 0; reqsize = get_full_path_helper(name, tmp, reqsize); - if (reqsize > size) /* it may have worked the second time */ + if (reqsize + sizeof(WCHAR) > size) /* it may have worked the second time */ { RtlFreeHeap(RtlGetProcessHeap(), 0, tmp); return reqsize + sizeof(WCHAR); @@ -799,77 +795,79 @@ RtlDosPathNameToNtPathName_U(IN PCWSTR DosPathName, /* * @implemented */ +/****************************************************************** + * RtlDosSearchPath_U + * + * Searches a file of name 'name' into a ';' separated list of paths + * (stored in paths) + * Doesn't seem to search elsewhere than the paths list + * Stores the result in buffer (file_part will point to the position + * of the file name in the buffer) + * FIXME: + * - how long shall the paths be ??? (MAX_PATH or larger with \\?\ constructs ???) + */ ULONG NTAPI -RtlDosSearchPath_U ( - PCWSTR sp, - PCWSTR name, - PCWSTR ext, - ULONG buf_sz, - WCHAR *buffer, - PWSTR *FilePart - ) +RtlDosSearchPath_U(PCWSTR paths, + PCWSTR search, + PCWSTR ext, + ULONG buffer_size, + PWSTR buffer, + PWSTR* file_part) { - ULONG Type; - ULONG Length = 0; - PWSTR full_name; - PWSTR wcs; - PCWSTR path; + RTL_PATH_TYPE type = RtlDetermineDosPathNameType_U(search); + ULONG len = 0; - Type = RtlDetermineDosPathNameType_U (name); + if (type == RtlPathTypeRelative) + { + ULONG allocated = 0, needed, filelen; + WCHAR *name = NULL; - if (Type == 5) - { - Length = wcslen (sp); - Length += wcslen (name); - if (wcschr (name, L'.')) - ext = NULL; - if (ext != NULL) - Length += wcslen (ext); + filelen = 1 /* for \ */ + wcslen(search) + 1 /* \0 */; - full_name = (WCHAR*)RtlAllocateHeap (RtlGetProcessHeap (), - 0, - (Length + 1) * sizeof(WCHAR)); - Length = 0; - if (full_name != NULL) - { - path = sp; - while (*path) - { - wcs = full_name; - while (*path && *path != L';') - *wcs++ = *path++; - if (*path) - path++; - if (wcs != full_name && *(wcs - 1) != L'\\') - *wcs++ = L'\\'; - wcscpy (wcs, name); - if (ext) - wcscat (wcs, ext); - if (RtlDoesFileExists_U (full_name)) - { - Length = RtlGetFullPathName_U (full_name, - buf_sz, - buffer, - FilePart); - break; - } - } + /* Windows only checks for '.' without worrying about path components */ + if (wcschr( search, '.' )) ext = NULL; + if (ext != NULL) filelen += wcslen(ext); - RtlFreeHeap (RtlGetProcessHeap (), - 0, - full_name); - } - } - else if (RtlDoesFileExists_U (name)) - { - Length = RtlGetFullPathName_U (name, - buf_sz, - buffer, - FilePart); - } + while (*paths) + { + LPCWSTR ptr; - return Length; + for (needed = 0, ptr = paths; *ptr != 0 && *ptr++ != ';'; needed++); + if (needed + filelen > allocated) + { + if (!name) name = RtlAllocateHeap(RtlGetProcessHeap(), 0, + (needed + filelen) * sizeof(WCHAR)); + else + { + WCHAR *newname = RtlReAllocateHeap(RtlGetProcessHeap(), 0, name, + (needed + filelen) * sizeof(WCHAR)); + if (!newname) RtlFreeHeap(RtlGetProcessHeap(), 0, name); + name = newname; + } + if (!name) return 0; + allocated = needed + filelen; + } + memmove(name, paths, needed * sizeof(WCHAR)); + /* append '\\' if none is present */ + if (needed > 0 && name[needed - 1] != '\\') name[needed++] = '\\'; + wcscpy(&name[needed], search); + if (ext) wcscat(&name[needed], ext); + if (RtlDoesFileExists_U(name)) + { + len = RtlGetFullPathName_U(name, buffer_size, buffer, file_part); + break; + } + paths = ptr; + } + RtlFreeHeap(RtlGetProcessHeap(), 0, name); + } + else if (RtlDoesFileExists_U(search)) + { + len = RtlGetFullPathName_U(search, buffer_size, buffer, file_part); + } + + return len; } @@ -881,11 +879,10 @@ RtlDoesFileExists_U(IN PCWSTR FileName) { UNICODE_STRING NtFileName; OBJECT_ATTRIBUTES Attr; - FILE_BASIC_INFORMATION Info; + FILE_BASIC_INFORMATION Info; NTSTATUS Status; CURDIR CurDir; - if (!RtlDosPathNameToNtPathName_U (FileName, &NtFileName, NULL, @@ -905,7 +902,7 @@ RtlDoesFileExists_U(IN PCWSTR FileName) Status = ZwQueryAttributesFile (&Attr, &Info); - RtlFreeUnicodeString(&NtFileName); + RtlFreeUnicodeString(&NtFileName); if (NT_SUCCESS(Status) || diff --git a/lib/rtl/unicode.c b/lib/rtl/unicode.c index e0b8a4f9741..e49896efa4e 100644 --- a/lib/rtl/unicode.c +++ b/lib/rtl/unicode.c @@ -33,13 +33,23 @@ extern USHORT NlsUnicodeDefaultChar; */ WCHAR NTAPI -RtlAnsiCharToUnicodeChar(IN PUCHAR *AnsiChar) +RtlAnsiCharToUnicodeChar(IN OUT PUCHAR *AnsiChar) { ULONG Size; NTSTATUS Status; WCHAR UnicodeChar = L' '; - Size = (NlsLeadByteInfo[**AnsiChar] == 0) ? 1 : 2; + PAGED_CODE_RTL(); + + if (NlsLeadByteInfo) + { + Size = (NlsLeadByteInfo[**AnsiChar] == 0) ? 1 : 2; + } + else + { + DPRINT("HACK::Shouldn't have happened! Consider fixing Usetup and registry entries it creates on install\n"); + Size = 1; + } Status = RtlMultiByteToUnicodeN(&UnicodeChar, sizeof(WCHAR), diff --git a/lib/sdk/crt/direct/chdir.c b/lib/sdk/crt/direct/chdir.c index 5515d4622cb..f16e0d44cf5 100644 --- a/lib/sdk/crt/direct/chdir.c +++ b/lib/sdk/crt/direct/chdir.c @@ -17,10 +17,13 @@ int _tchdir(const _TCHAR* _path) } /* Update the drive-specific current directory variable */ - if (GetCurrentDirectoryW(MAX_PATH, newdir) && newdir[1] == L':') + if (GetCurrentDirectoryW(MAX_PATH, newdir) >= 2) { - WCHAR envvar[4] = { L'=', towupper(newdir[0]), L':', L'\0' }; - SetEnvironmentVariableW(envvar, newdir); + if (newdir[1] == L':') + { + WCHAR envvar[4] = { L'=', towupper(newdir[0]), L':', L'\0' }; + SetEnvironmentVariableW(envvar, newdir); + } } return 0; diff --git a/lib/sdk/crt/direct/getdrive.c b/lib/sdk/crt/direct/getdrive.c index de790868d95..d36aec88591 100644 --- a/lib/sdk/crt/direct/getdrive.c +++ b/lib/sdk/crt/direct/getdrive.c @@ -20,9 +20,12 @@ int _getdrive(void) { WCHAR buffer[MAX_PATH]; - if (GetCurrentDirectoryW( MAX_PATH, buffer ) && - buffer[0] >= 'A' && buffer[0] <= 'z' && buffer[1] == ':') - return towupper(buffer[0]) - 'A' + 1; + if (GetCurrentDirectoryW( MAX_PATH, buffer )>=2) + { + buffer[0]=towupper(buffer[0]); + if (buffer[0] >= L'A' && buffer[0] <= L'Z' && buffer[1] == L':') + return buffer[0] - L'A' + 1; + } return 0; } diff --git a/lib/sdk/crt/printf/streamout.c b/lib/sdk/crt/printf/streamout.c index c1f654f2c89..8e9ce4f667a 100644 --- a/lib/sdk/crt/printf/streamout.c +++ b/lib/sdk/crt/printf/streamout.c @@ -587,6 +587,9 @@ streamout(FILE *stream, const TCHAR *format, va_list argptr) if (flags & FLAG_SPECIAL) { prefix = &digits[16]; +#ifdef _USER32_WSPRINTF + fieldwidth += 2; +#endif } case _T('u'): diff --git a/lib/sdk/crt/string/mbstowcs_nt.c b/lib/sdk/crt/string/mbstowcs_nt.c index 4b613368c3e..7058558f4e2 100644 --- a/lib/sdk/crt/string/mbstowcs_nt.c +++ b/lib/sdk/crt/string/mbstowcs_nt.c @@ -4,26 +4,35 @@ #include #include +WCHAR NTAPI RtlAnsiCharToUnicodeChar(IN OUT PUCHAR *AnsiChar); +#undef MB_CUR_MAX +#define MB_CUR_MAX 2 + /* * @implemented */ int mbtowc (wchar_t *wchar, const char *mbchar, size_t count) { - NTSTATUS Status; - ULONG Size; + UCHAR mbarr[MB_CUR_MAX] = { 0 }; + PUCHAR mbs = mbarr; + WCHAR wc; + + if (mbchar == NULL) + return 0; if (wchar == NULL) return 0; - Status = RtlMultiByteToUnicodeN (wchar, - sizeof(WCHAR), - &Size, - mbchar, - count); - if (!NT_SUCCESS(Status)) + memcpy(mbarr, mbchar, min(count, sizeof mbarr)); + + wc = RtlAnsiCharToUnicodeChar(&mbs); + + if (wc == L' ' && mbarr[0] != ' ') return -1; - return (int)Size; + *wchar = wc; + + return mbs - mbarr; } /* diff --git a/media/doc/README.WINE b/media/doc/README.WINE index adaff2f0e71..1385a5967a6 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -48,7 +48,7 @@ reactos/dll/win32/browseui # Out of sync reactos/dll/win32/cabinet # Autosync reactos/dll/win32/clusapi # Autosync reactos/dll/win32/comcat # Autosync -reactos/dll/win32/comctl32 # Autosync +reactos/dll/win32/comctl32 # Synced to Wine 1.3.14 reactos/dll/win32/comdlg32 # Autosync reactos/dll/win32/compstui # Autosync reactos/dll/win32/credui # Autosync diff --git a/ntoskrnl/CMakeLists.txt b/ntoskrnl/CMakeLists.txt index 34c3fad4c9c..f10b62c9f3f 100644 --- a/ntoskrnl/CMakeLists.txt +++ b/ntoskrnl/CMakeLists.txt @@ -127,6 +127,7 @@ list(APPEND SOURCE fstub/disksup.c fstub/fstubex.c fstub/halstub.c + fstub/translate.c inbv/inbv.c inbv/inbvport.c io/iomgr/adapter.c diff --git a/ntoskrnl/ex/init.c b/ntoskrnl/ex/init.c index b3039cb2593..3e2066dc482 100644 --- a/ntoskrnl/ex/init.c +++ b/ntoskrnl/ex/init.c @@ -1061,6 +1061,9 @@ ExpInitializeExecutive(IN ULONG Cpu, if (CmNtCSDReleaseType == 1) CmNtSpBuildNumber |= 1830 << 16; } + /* Add loaded CmNtGlobalFlag value */ + NtGlobalFlag |= CmNtGlobalFlag; + /* Initialize the executive at phase 0 */ if (!ExInitSystem()) KeBugCheck(PHASE0_INITIALIZATION_FAILED); diff --git a/ntoskrnl/fsrtl/dbcsname.c b/ntoskrnl/fsrtl/dbcsname.c index 5b67c30dc1c..2bf4af91b37 100644 --- a/ntoskrnl/fsrtl/dbcsname.c +++ b/ntoskrnl/fsrtl/dbcsname.c @@ -46,8 +46,8 @@ FsRtlDissectDbcs(IN ANSI_STRING Name, OUT PANSI_STRING FirstPart, OUT PANSI_STRING RemainingPart) { - ULONG FirstPosition, i; - ULONG SkipFirstSlash = 0; + USHORT FirstPosition, i; + USHORT SkipFirstSlash = 0; PAGED_CODE(); /* Zero the strings before continuing */ @@ -116,7 +116,7 @@ BOOLEAN NTAPI FsRtlDoesDbcsContainWildCards(IN PANSI_STRING Name) { - ULONG i; + USHORT i; PAGED_CODE(); /* Check every character */ @@ -160,7 +160,7 @@ NTAPI FsRtlIsDbcsInExpression(IN PANSI_STRING Expression, IN PANSI_STRING Name) { - USHORT ExpressionPosition = 0, NamePosition = 0, MatchingChars; + USHORT ExpressionPosition = 0, NamePosition = 0, MatchingChars, StarFound = MAXUSHORT; PAGED_CODE(); ASSERT(Name->Length); @@ -169,34 +169,74 @@ FsRtlIsDbcsInExpression(IN PANSI_STRING Expression, while (NamePosition < Name->Length && ExpressionPosition < Expression->Length) { - if ((Expression->Buffer[ExpressionPosition] == Name->Buffer[NamePosition]) || - (Expression->Buffer[ExpressionPosition] == '?') || (Expression->Buffer[ExpressionPosition] == ANSI_DOS_QM) || - (Expression->Buffer[ExpressionPosition] == ANSI_DOS_DOT && Name->Buffer[NamePosition] == '.')) + if ((Expression->Buffer[ExpressionPosition] == Name->Buffer[NamePosition])) { NamePosition++; ExpressionPosition++; } + else if (StarFound != MAXUSHORT && (Expression->Buffer[StarFound + 1] == '*' || + Expression->Buffer[StarFound + 1] == '?' || Expression->Buffer[StarFound + 1] == ANSI_DOS_DOT)) + { + ExpressionPosition = StarFound + 1; + switch (Expression->Buffer[ExpressionPosition]) + { + case '*': + StarFound = MAXUSHORT; + break; + + case '?': + if (++ExpressionPosition == Expression->Length) + { + NamePosition = Name->Length; + break; + } + + MatchingChars = NamePosition; + while (NamePosition < Name->Length && + Name->Buffer[NamePosition] != Expression->Buffer[ExpressionPosition]) + { + NamePosition++; + } + + if (NamePosition - MatchingChars > 0) + { + StarFound = MAXUSHORT; + } + break; + + case ANSI_DOS_DOT: + while (NamePosition < Name->Length && Name->Buffer[NamePosition] != '.') + { + NamePosition++; + } + ExpressionPosition++; + StarFound = MAXUSHORT; + break; + + default: + /* Should never happen */ + ASSERT(FALSE); + } + } + else if ((Expression->Buffer[ExpressionPosition] == '?') || (Expression->Buffer[ExpressionPosition] == ANSI_DOS_QM) || + (Expression->Buffer[ExpressionPosition] == ANSI_DOS_DOT && Name->Buffer[NamePosition] == '.')) + { + NamePosition++; + ExpressionPosition++; + StarFound = MAXUSHORT; + } else if (Expression->Buffer[ExpressionPosition] == '*') { - if (ExpressionPosition < (Expression->Length - 1)) - { - if (Expression->Buffer[ExpressionPosition+1] != '*' && Expression->Buffer[ExpressionPosition+1] != '?' && - Expression->Buffer[ExpressionPosition+1] != ANSI_DOS_DOT && - Expression->Buffer[ExpressionPosition+1] != ANSI_DOS_QM && - Expression->Buffer[ExpressionPosition+1] != ANSI_DOS_STAR) - { - while (Name->Buffer[NamePosition] != Expression->Buffer[ExpressionPosition+1] && - NamePosition < Name->Length) NamePosition++; - } - } - else + StarFound = ExpressionPosition++; + if (ExpressionPosition == Expression->Length) { NamePosition = Name->Length; + break; } - ExpressionPosition++; } else if (Expression->Buffer[ExpressionPosition] == ANSI_DOS_STAR) { + StarFound = MAXUSHORT; MatchingChars = NamePosition; while (MatchingChars < Name->Length) { @@ -208,9 +248,18 @@ FsRtlIsDbcsInExpression(IN PANSI_STRING Expression, } ExpressionPosition++; } + else if (StarFound != MAXUSHORT) + { + ExpressionPosition = StarFound + 1; + while (NamePosition < Name->Length && + Name->Buffer[NamePosition] != Expression->Buffer[ExpressionPosition]) + { + NamePosition++; + } + } else { - NamePosition = Name->Length; + break; } } if (ExpressionPosition + 1 == Expression->Length && NamePosition == Name->Length && @@ -257,7 +306,7 @@ FsRtlIsFatDbcsLegal(IN ANSI_STRING DbcsName, { ANSI_STRING FirstPart, RemainingPart, Name; BOOLEAN LastDot; - ULONG i; + USHORT i; PAGED_CODE(); /* Just quit if the string is empty */ @@ -394,7 +443,7 @@ FsRtlIsHpfsDbcsLegal(IN ANSI_STRING DbcsName, IN BOOLEAN LeadingBackslashPermissible) { ANSI_STRING FirstPart, RemainingPart, Name; - ULONG i; + USHORT i; PAGED_CODE(); /* Just quit if the string is empty */ @@ -447,7 +496,7 @@ FsRtlIsHpfsDbcsLegal(IN ANSI_STRING DbcsName, i++; } /* Then check for bad characters */ - else if (!!FsRtlIsAnsiCharacterLegalHpfs(FirstPart.Buffer[i], WildCardsPermissible)) + else if (!FsRtlIsAnsiCharacterLegalHpfs(FirstPart.Buffer[i], WildCardsPermissible)) { return FALSE; } diff --git a/ntoskrnl/fsrtl/name.c b/ntoskrnl/fsrtl/name.c index fc4d7400141..4cd096038db 100644 --- a/ntoskrnl/fsrtl/name.c +++ b/ntoskrnl/fsrtl/name.c @@ -5,7 +5,8 @@ * PURPOSE: Provides name parsing and other support routines for FSDs * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) * Filip Navara (navaraf@reactos.org) - * Pierre Schweitzer (pierre.schweitzer@reactos.org) + * Pierre Schweitzer (pierre.schweitzer@reactos.org) + * Aleksey Bragin (aleksey@reactos.org) */ /* INCLUDES ******************************************************************/ @@ -22,40 +23,152 @@ FsRtlIsNameInExpressionPrivate(IN PUNICODE_STRING Expression, IN BOOLEAN IgnoreCase, IN PWCHAR UpcaseTable OPTIONAL) { - USHORT ExpressionPosition = 0, NamePosition = 0, MatchingChars; + USHORT ExpressionPosition = 0, NamePosition = 0, MatchingChars, StarFound = MAXUSHORT; + UNICODE_STRING IntExpression; PAGED_CODE(); + /* Check if we were given strings at all */ + if (!Name->Length || !Expression->Length) + { + /* Return TRUE if both strings are empty, otherwise FALSE */ + if (Name->Length == 0 && Expression->Length == 0) + return TRUE; + else + return FALSE; + } + + /* Check for a shortcut: just one wildcard */ + if (Expression->Length == sizeof(WCHAR)) + { + if (Expression->Buffer[0] == L'*') + return TRUE; + } + ASSERT(!IgnoreCase || UpcaseTable); + /* Another shortcut, wildcard followed by some string */ + if (Expression->Buffer[0] == L'*') + { + /* Copy Expression to our local variable */ + IntExpression = *Expression; + + /* Skip the first char */ + IntExpression.Buffer++; + IntExpression.Length -= sizeof(WCHAR); + + /* Continue only if the rest of the expression does NOT contain + any more wildcards */ + if (!FsRtlDoesNameContainWildCards(&IntExpression)) + { + /* Check for a degenerate case */ + if (Name->Length < (Expression->Length - sizeof(WCHAR))) + return FALSE; + + /* Calculate position */ + NamePosition = (Name->Length - IntExpression.Length) / sizeof(WCHAR); + + /* Compare */ + if (!IgnoreCase) + { + /* We can just do a byte compare */ + return RtlEqualMemory(IntExpression.Buffer, + Name->Buffer + NamePosition, + IntExpression.Length); + } + else + { + /* Not so easy, need to upcase and check char by char */ + for (ExpressionPosition = 0; ExpressionPosition < (IntExpression.Length / sizeof(WCHAR)); ExpressionPosition++) + { + /* Assert that expression is already upcased! */ + ASSERT(IntExpression.Buffer[ExpressionPosition] == UpcaseTable[IntExpression.Buffer[ExpressionPosition]]); + + /* Now compare upcased name char with expression */ + if (UpcaseTable[Name->Buffer[NamePosition + ExpressionPosition]] != + IntExpression.Buffer[ExpressionPosition]) + { + return FALSE; + } + } + + /* It matches */ + return TRUE; + } + } + } + while (NamePosition < Name->Length / sizeof(WCHAR) && ExpressionPosition < Expression->Length / sizeof(WCHAR)) { - if ((Expression->Buffer[ExpressionPosition] == (IgnoreCase ? UpcaseTable[Name->Buffer[NamePosition]] : Name->Buffer[NamePosition])) || - (Expression->Buffer[ExpressionPosition] == L'?') || (Expression->Buffer[ExpressionPosition] == DOS_QM) || - (Expression->Buffer[ExpressionPosition] == DOS_DOT && Name->Buffer[NamePosition] == L'.')) + if ((Expression->Buffer[ExpressionPosition] == (IgnoreCase ? UpcaseTable[Name->Buffer[NamePosition]] : Name->Buffer[NamePosition]))) { NamePosition++; ExpressionPosition++; } + else if (StarFound != MAXUSHORT && (Expression->Buffer[StarFound + 1] == L'*' || + Expression->Buffer[StarFound + 1] == L'?' || Expression->Buffer[StarFound + 1] == DOS_DOT)) + { + ExpressionPosition = StarFound + 1; + switch (Expression->Buffer[ExpressionPosition]) + { + case L'*': + StarFound = MAXUSHORT; + break; + + case L'?': + if (++ExpressionPosition == Expression->Length / sizeof(WCHAR)) + { + NamePosition = Name->Length / sizeof(WCHAR); + break; + } + + MatchingChars = NamePosition; + while (NamePosition < Name->Length / sizeof(WCHAR) && + (IgnoreCase ? UpcaseTable[Name->Buffer[NamePosition]] : + Name->Buffer[NamePosition]) != Expression->Buffer[ExpressionPosition]) + { + NamePosition++; + } + + if (NamePosition - MatchingChars > 0) + { + StarFound = MAXUSHORT; + } + break; + + case DOS_DOT: + while (NamePosition < Name->Length / sizeof(WCHAR) && + Name->Buffer[NamePosition] != L'.') + { + NamePosition++; + } + ExpressionPosition++; + StarFound = MAXUSHORT; + break; + + default: + /* Should never happen */ + ASSERT(FALSE); + } + } + else if (Expression->Buffer[ExpressionPosition] == L'?' || (Expression->Buffer[ExpressionPosition] == DOS_QM) || + (Expression->Buffer[ExpressionPosition] == DOS_DOT && Name->Buffer[NamePosition] == L'.')) + { + NamePosition++; + ExpressionPosition++; + StarFound = MAXUSHORT; + } else if (Expression->Buffer[ExpressionPosition] == L'*') { - if (ExpressionPosition < (Expression->Length / sizeof(WCHAR) - 1)) - { - if (Expression->Buffer[ExpressionPosition+1] != L'*' && Expression->Buffer[ExpressionPosition+1] != L'?' && - Expression->Buffer[ExpressionPosition+1] != DOS_DOT && Expression->Buffer[ExpressionPosition+1] != DOS_QM && - Expression->Buffer[ExpressionPosition+1] != DOS_STAR) - { - while ((IgnoreCase ? UpcaseTable[Name->Buffer[NamePosition]] : Name->Buffer[NamePosition]) != Expression->Buffer[ExpressionPosition+1] && - NamePosition < Name->Length / sizeof(WCHAR)) NamePosition++; - } - } - else + StarFound = ExpressionPosition++; + if (ExpressionPosition == Expression->Length / sizeof(WCHAR)) { NamePosition = Name->Length / sizeof(WCHAR); + break; } - ExpressionPosition++; } else if (Expression->Buffer[ExpressionPosition] == DOS_STAR) { + StarFound = MAXUSHORT; MatchingChars = NamePosition; while (MatchingChars < Name->Length / sizeof(WCHAR)) { @@ -67,9 +180,19 @@ FsRtlIsNameInExpressionPrivate(IN PUNICODE_STRING Expression, } ExpressionPosition++; } + else if (StarFound != MAXUSHORT) + { + ExpressionPosition = StarFound + 1; + while (NamePosition < Name->Length / sizeof(WCHAR) && + (IgnoreCase ? UpcaseTable[Name->Buffer[NamePosition]] : + Name->Buffer[NamePosition]) != Expression->Buffer[ExpressionPosition]) + { + NamePosition++; + } + } else { - NamePosition = Name->Length / sizeof(WCHAR); + break; } } if (ExpressionPosition + 1 == Expression->Length / sizeof(WCHAR) && NamePosition == Name->Length / sizeof(WCHAR) && @@ -116,7 +239,7 @@ FsRtlAreNamesEqual(IN PCUNICODE_STRING Name1, UNICODE_STRING UpcaseName1; UNICODE_STRING UpcaseName2; BOOLEAN StringsAreEqual, MemoryAllocated = FALSE; - ULONG i; + USHORT i; NTSTATUS Status; PAGED_CODE(); @@ -208,8 +331,8 @@ FsRtlDissectName(IN UNICODE_STRING Name, OUT PUNICODE_STRING FirstPart, OUT PUNICODE_STRING RemainingPart) { - ULONG FirstPosition, i; - ULONG SkipFirstSlash = 0; + USHORT FirstPosition, i; + USHORT SkipFirstSlash = 0; PAGED_CODE(); /* Zero the strings before continuing */ @@ -332,7 +455,7 @@ FsRtlIsNameInExpression(IN PUNICODE_STRING Expression, if (IgnoreCase && !UpcaseTable) { Status = RtlUpcaseUnicodeString(&IntName, Name, TRUE); - if (Status != STATUS_SUCCESS) + if (!NT_SUCCESS(Status)) { ExRaiseStatus(Status); } diff --git a/ntoskrnl/fstub/disksup.c b/ntoskrnl/fstub/disksup.c index ce184bcdced..7c4f651f8ff 100644 --- a/ntoskrnl/fstub/disksup.c +++ b/ntoskrnl/fstub/disksup.c @@ -24,6 +24,8 @@ const WCHAR DiskMountString[] = L"\\DosDevices\\%C:"; #define PARTITION_MAGIC 0xaa55 +#define EFI_PMBR_OSTYPE_EFI 0xEE + #include typedef struct _REG_DISK_MOUNT_INFO @@ -1358,6 +1360,24 @@ xHalExamineMBR(IN PDEVICE_OBJECT DeviceObject, } } +VOID +NTAPI +FstubFixupEfiPartition(IN PPARTITION_DESCRIPTOR PartitionDescriptor, + IN ULONGLONG MaxOffset) +{ + ULONG PartitionLength; + PAGED_CODE(); + + /* Compute partition length (according to MBR entry) */ + PartitionLength = PartitionDescriptor->StartingSectorLsb0 + PartitionDescriptor->PartitionLengthLsb0; + /* In case the partition length goes beyond disk size... */ + if (PartitionLength > MaxOffset) + { + /* Resize partition to its maximum real length */ + PartitionDescriptor->PartitionLengthLsb0 = MaxOffset - PartitionDescriptor->StartingSectorLsb0; + } +} + NTSTATUS FASTCALL xHalIoReadPartitionTable(IN PDEVICE_OBJECT DeviceObject, @@ -1425,7 +1445,7 @@ xHalIoReadPartitionTable(IN PDEVICE_OBJECT DeviceObject, MaxOffset, MaxSector); /* Allocate our buffer */ - Buffer = ExAllocatePoolWithTag(NonPagedPool, PAGE_SIZE, TAG_FILE_SYSTEM); + Buffer = ExAllocatePoolWithTag(NonPagedPool, InputSize, TAG_FILE_SYSTEM); if (!Buffer) { /* Fail, free the input buffer */ @@ -1503,9 +1523,6 @@ xHalIoReadPartitionTable(IN PDEVICE_OBJECT DeviceObject, PartitionDescriptor = (PPARTITION_DESCRIPTOR) &(((PUSHORT)Buffer)[PARTITION_TABLE_OFFSET]); - /* Get the partition type */ - PartitionType = PartitionDescriptor->PartitionType; - /* Start looping partitions */ j++; DPRINT("FSTUB: Partition Table %d:\n", j); @@ -1524,6 +1541,14 @@ xHalIoReadPartitionTable(IN PDEVICE_OBJECT DeviceObject, GET_STARTING_SECTOR(PartitionDescriptor), GET_PARTITION_LENGTH(PartitionDescriptor)); + /* Check whether we're facing a protective MBR */ + if (PartitionType == EFI_PMBR_OSTYPE_EFI) + { + /* Partition length might be bigger than disk size */ + FstubFixupEfiPartition(PartitionDescriptor, + MaxOffset); + } + /* Make sure that the partition is valid, unless it's the first */ if (!(HalpIsValidPartitionEntry(PartitionDescriptor, MaxOffset, diff --git a/ntoskrnl/fstub/halstub.c b/ntoskrnl/fstub/halstub.c index 38eec69b014..a89ce80cc1f 100644 --- a/ntoskrnl/fstub/halstub.c +++ b/ntoskrnl/fstub/halstub.c @@ -4,6 +4,7 @@ * FILE: ntoskrnl/fstub/halstub.c * PURPOSE: I/O Stub HAL Routines * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) + Pierre Schweitzer (pierre.schweitzer@reactos.org) */ /* INCLUDES ******************************************************************/ @@ -17,51 +18,51 @@ HAL_DISPATCH HalDispatchTable = { HAL_DISPATCH_VERSION, - (pHalQuerySystemInformation)NULL, - (pHalSetSystemInformation)NULL, - (pHalQueryBusSlots)NULL, + xHalQuerySystemInformation, + xHalSetSystemInformation, + xHalQueryBusSlots, 0, xHalExamineMBR, xHalIoAssignDriveLetters, xHalIoReadPartitionTable, xHalIoSetPartitionInformation, xHalIoWritePartitionTable, - (pHalHandlerForBus)NULL, - (pHalReferenceBusHandler)NULL, - (pHalReferenceBusHandler)NULL, - (pHalInitPnpDriver)NULL, - (pHalInitPowerManagement)NULL, + xHalHandlerForBus, + xHalReferenceHandler, + xHalReferenceHandler, + xHalInitPnpDriver, + xHalInitPowerManagement, (pHalGetDmaAdapter) NULL, - (pHalGetInterruptTranslator)NULL, - (pHalStartMirroring)NULL, - (pHalEndMirroring)NULL, - (pHalMirrorPhysicalMemory)NULL, + xHalGetInterruptTranslator, + xHalStartMirroring, + xHalEndMirroring, + xHalMirrorPhysicalMemory, xHalEndOfBoot, - (pHalMirrorVerify)NULL + xHalMirrorPhysicalMemory }; HAL_PRIVATE_DISPATCH HalPrivateDispatchTable = { HAL_PRIVATE_DISPATCH_VERSION, - (pHalHandlerForBus)NULL, - (pHalHandlerForConfigSpace)NULL, - (pHalLocateHiberRanges)NULL, - (pHalRegisterBusHandler)NULL, + xHalHandlerForBus, + (pHalHandlerForConfigSpace)xHalHandlerForBus, + xHalLocateHiberRanges, + xHalRegisterBusHandler, xHalSetWakeEnable, - (pHalSetWakeAlarm)NULL, - (pHalTranslateBusAddress)NULL, - (pHalAssignSlotResources)NULL, + xHalSetWakeAlarm, + xHalTranslateBusAddress, + (pHalAssignSlotResources)xHalTranslateBusAddress, xHalHaltSystem, (pHalFindBusAddressTranslation)NULL, (pHalResetDisplay)NULL, - (pHalAllocateMapRegisters)NULL, - (pKdSetupPciDeviceForDebugging)NULL, - (pKdReleasePciDeviceForDebugging)NULL, - (pKdGetAcpiTablePhase0)NULL, - (pKdCheckPowerButton)NULL, - (pHalVectorToIDTEntry)xHalVectorToIDTEntry, - (pKdMapPhysicalMemory64)NULL, - (pKdUnmapVirtualAddress)NULL + xHalAllocateMapRegisters, + xKdSetupPciDeviceForDebugging, + xKdReleasePciDeviceForDebugging, + xKdGetAcpiTablePhase, + (pKdCheckPowerButton)xHalReferenceHandler, + xHalVectorToIDTEntry, + (pKdMapPhysicalMemory64)MatchAll, + (pKdUnmapVirtualAddress)xKdUnmapVirtualAddress }; /* FUNCTIONS *****************************************************************/ @@ -86,6 +87,8 @@ VOID NTAPI xHalEndOfBoot(VOID) { + PAGED_CODE(); + /* Nothing */ return; } @@ -97,3 +100,193 @@ xHalSetWakeEnable(IN BOOLEAN Enable) /* Nothing */ return; } + +PBUS_HANDLER +FASTCALL +xHalHandlerForBus(IN INTERFACE_TYPE InterfaceType, + IN ULONG BusNumber) +{ + return NULL; +} + +VOID +FASTCALL +xHalReferenceHandler(IN PBUS_HANDLER BusHandler) +{ + /* Nothing */ + return; +} + +NTSTATUS +NTAPI +xHalInitPnpDriver(VOID) +{ + return STATUS_NOT_SUPPORTED; +} + +NTSTATUS +NTAPI +xHalInitPowerManagement(IN PPM_DISPATCH_TABLE PmDriverDispatchTable, + OUT PPM_DISPATCH_TABLE *PmHalDispatchTable) +{ + return STATUS_NOT_SUPPORTED; +} + +NTSTATUS +NTAPI +xHalStartMirroring(VOID) +{ + PAGED_CODE(); + + return STATUS_NOT_SUPPORTED; +} + +NTSTATUS +NTAPI +xHalEndMirroring(IN ULONG PassNumber) +{ + return STATUS_NOT_SUPPORTED; +} + +NTSTATUS +NTAPI +xHalMirrorPhysicalMemory(IN PHYSICAL_ADDRESS PhysicalAddress, + IN LARGE_INTEGER NumberOfBytes) +{ + return STATUS_NOT_SUPPORTED; +} + +NTSTATUS +NTAPI +xHalQueryBusSlots(IN PBUS_HANDLER BusHandler, + IN ULONG BufferSize, + OUT PULONG SlotNumbers, + OUT PULONG ReturnedLength) +{ + PAGED_CODE(); + + return STATUS_NOT_SUPPORTED; +} + +NTSTATUS +NTAPI +xHalSetSystemInformation(IN HAL_SET_INFORMATION_CLASS InformationClass, + IN ULONG BufferSize, + IN PVOID Buffer) +{ + PAGED_CODE(); + + return STATUS_INVALID_LEVEL; +} + +NTSTATUS +NTAPI +xHalQuerySystemInformation(IN HAL_QUERY_INFORMATION_CLASS InformationClass, + IN ULONG BufferSize, + IN OUT PVOID Buffer, + OUT PULONG ReturnedLength) +{ + PAGED_CODE(); + + return STATUS_INVALID_LEVEL; +} + +VOID +NTAPI +xHalLocateHiberRanges(IN PVOID MemoryMap) +{ + /* Nothing */ + return; +} + +NTSTATUS +NTAPI +xHalRegisterBusHandler(IN INTERFACE_TYPE InterfaceType, + IN BUS_DATA_TYPE ConfigSpace, + IN ULONG BusNumber, + IN INTERFACE_TYPE ParentInterfaceType, + IN ULONG ParentBusNumber, + IN ULONG ContextSize, + IN PINSTALL_BUS_HANDLER InstallCallback, + OUT PBUS_HANDLER *BusHandler) +{ + PAGED_CODE(); + + return STATUS_NOT_SUPPORTED; +} + +VOID +NTAPI +xHalSetWakeAlarm(IN ULONGLONG AlartTime, + IN PTIME_FIELDS TimeFields) +{ + /* Nothing */ + return; +} + +BOOLEAN +NTAPI +xHalTranslateBusAddress(IN INTERFACE_TYPE InterfaceType, + IN ULONG BusNumber, + IN PHYSICAL_ADDRESS BusAddress, + IN OUT PULONG AddressSpace, + OUT PPHYSICAL_ADDRESS TranslatedAddress) +{ + KeBugCheckEx(HAL_INITIALIZATION_FAILED, 0, 0, 0, 0); + + return FALSE; +} + +NTSTATUS +NTAPI +xHalAllocateMapRegisters(IN PADAPTER_OBJECT AdapterObject, + IN ULONG Unknown, + IN ULONG Unknown2, + PMAP_REGISTER_ENTRY Registers) +{ + PAGED_CODE(); + + return STATUS_NOT_IMPLEMENTED; +} + +NTSTATUS +NTAPI +xKdSetupPciDeviceForDebugging(IN PVOID LoaderBlock OPTIONAL, + IN OUT PDEBUG_DEVICE_DESCRIPTOR PciDevice) +{ + return STATUS_NOT_IMPLEMENTED; +} + +NTSTATUS +NTAPI +xKdReleasePciDeviceForDebugging(IN OUT PDEBUG_DEVICE_DESCRIPTOR PciDevice) +{ + return STATUS_NOT_IMPLEMENTED; +} + +PVOID +NTAPI +xKdGetAcpiTablePhase(IN struct _LOADER_PARAMETER_BLOCK *LoaderBlock, + IN ULONG Signature) +{ + return NULL; +} + +PVOID +NTAPI +MatchAll(IN PHYSICAL_ADDRESS PhysicalAddress, + IN ULONG NumberPages, + IN BOOLEAN FlushCurrentTLB) +{ + return NULL; +} + +VOID +NTAPI +xKdUnmapVirtualAddress(IN PVOID VirtualAddress, + IN ULONG NumberPages, + IN BOOLEAN FlushCurrentTLB) +{ + /* Nothing */ + return; +} diff --git a/ntoskrnl/fstub/translate.c b/ntoskrnl/fstub/translate.c new file mode 100644 index 00000000000..b9d37d266cd --- /dev/null +++ b/ntoskrnl/fstub/translate.c @@ -0,0 +1,189 @@ +/* +* PROJECT: ReactOS Kernel +* LICENSE: GPL - See COPYING in the top level directory +* FILE: ntoskrnl/fstub/translate.c +* PURPOSE: Interrupt Translator Routines +* PROGRAMMERS: Pierre Schweitzer (pierre.schweitzer@reactos.org) +*/ + +/* INCLUDES ******************************************************************/ + +#include +#define NDEBUG +#include + +#define HAL_IRQ_TRANSLATOR_VERSION 0x0 + +/* PRIVATE FUNCTIONS *********************************************************/ + +/* + * @implemented + */ +VOID +NTAPI +FstubTranslatorNull(PVOID Context) +{ + PAGED_CODE(); + + /* Do nothing */ + return; +} + +/* + * @implemented + */ +NTSTATUS +NTAPI +FstubTranslateResource(IN OUT PVOID Context OPTIONAL, + IN PCM_PARTIAL_RESOURCE_DESCRIPTOR Source, + IN RESOURCE_TRANSLATION_DIRECTION Direction, + IN ULONG AlternativesCount OPTIONAL, + IN IO_RESOURCE_DESCRIPTOR Alternatives[], + IN PDEVICE_OBJECT PhysicalDeviceObject, + OUT PCM_PARTIAL_RESOURCE_DESCRIPTOR Target) +{ + INT k; + KIRQL Irql; + KAFFINITY Affinity; + ULONG MinimumVector, Vector; + PIO_RESOURCE_DESCRIPTOR Alternative; + NTSTATUS Status = STATUS_UNSUCCESSFUL; + PAGED_CODE(); + + ASSERT(Source->Type == CmResourceTypeInterrupt); + + /* Copy common information */ + Target->Type = Source->Type; + Target->ShareDisposition = Source->ShareDisposition; + Target->Flags = Source->Flags; + + if (Direction == TranslateChildToParent) + { + /* Get IRQL, affinity & system vector for the device vector */ + Target->u.Interrupt.Vector = HalGetInterruptVector((INTERFACE_TYPE)Context, 0, + Source->u.Interrupt.Vector, + Source->u.Interrupt.Vector, + &Irql, &Affinity); + Target->u.Interrupt.Level = Irql; + Target->u.Interrupt.Affinity = Affinity; + Status = STATUS_TRANSLATION_COMPLETE; + } + else if (Direction == TranslateParentToChild) + { + /* Browse all the resources */ + for (k = 0; k < AlternativesCount; k++) + { + Alternative = &(Alternatives[k]); + + ASSERT(Alternative->Type == CmResourceTypeInterrupt); + + /* Try to find the device vector, proceeding by trial & error + * We try a vector, and translate it + */ + MinimumVector = Alternative->u.Interrupt.MinimumVector; + while (MinimumVector <= Alternative->u.Interrupt.MaximumVector) + { + /* Translate the vector */ + Vector = HalGetInterruptVector((INTERFACE_TYPE)Context, 0, + MinimumVector, + MinimumVector, + &Irql, &Affinity); + + /* If the translated vector is matching the given translated vector */ + if (Vector == Source->u.Interrupt.Vector) + { + /* We are done, send back device vector */ + Target->u.Interrupt.Affinity = -1; + Target->u.Interrupt.Vector = MinimumVector; + Target->u.Interrupt.Level = MinimumVector; + + return STATUS_SUCCESS; + } + + MinimumVector++; + } + } + } + + return Status; +} + +/* + * @implemented + */ +NTSTATUS +NTAPI +FstubTranslateRequirement(IN OUT PVOID Context OPTIONAL, + IN PIO_RESOURCE_DESCRIPTOR Source, + IN PDEVICE_OBJECT PhysicalDeviceObject, + OUT PULONG TargetCount, + OUT PIO_RESOURCE_DESCRIPTOR *Target) +{ + KIRQL Irql; + KAFFINITY Affinity; + PAGED_CODE(); + + ASSERT(Source->Type == CmResourceTypeInterrupt); + + /* Allocate output buffer */ + *Target = ExAllocatePoolWithTag(PagedPool, sizeof(IO_RESOURCE_DESCRIPTOR), 'btsF'); + if (!*Target) + { + return STATUS_INSUFFICIENT_RESOURCES; + } + + /* Zero & set out count to 1 */ + RtlZeroMemory(*Target, sizeof(IO_RESOURCE_DESCRIPTOR)); + *TargetCount = 1; + + /* Translate minimum interrupt vector */ + (*Target)->u.Interrupt.MinimumVector = HalGetInterruptVector((INTERFACE_TYPE)Context, 0, + Source->u.Interrupt.MinimumVector, + Source->u.Interrupt.MinimumVector, + &Irql, &Affinity); + + /* Translate maximum interrupt vector */ + (*Target)->u.Interrupt.MaximumVector = HalGetInterruptVector((INTERFACE_TYPE)Context, 0, + Source->u.Interrupt.MaximumVector, + Source->u.Interrupt.MaximumVector, + &Irql, &Affinity); + + return STATUS_TRANSLATION_COMPLETE; +} + +/* + * @implemented + */ +NTSTATUS +NTAPI +xHalGetInterruptTranslator(IN INTERFACE_TYPE ParentInterfaceType, + IN ULONG ParentBusNumber, + IN INTERFACE_TYPE BridgeInterfaceType, + IN USHORT Size, + IN USHORT Version, + OUT PTRANSLATOR_INTERFACE Translator, + OUT PULONG BridgeBusNumber) +{ + PAGED_CODE(); + + ASSERT(Version == HAL_IRQ_TRANSLATOR_VERSION); + ASSERT(Size >= sizeof(TRANSLATOR_INTERFACE)); + + /* Only (E)ISA interfaces are supported */ + if (BridgeInterfaceType == Internal || BridgeInterfaceType >= MicroChannel) + { + return STATUS_NOT_IMPLEMENTED; + } + + /* Fill in output struct */ + Translator->Size = sizeof(TRANSLATOR_INTERFACE); + Translator->Version = HAL_IRQ_TRANSLATOR_VERSION; + /* In case caller set interface to undefined, faulty it to ISA */ + Translator->Context = (PVOID)((BridgeInterfaceType == InterfaceTypeUndefined) ? Isa : BridgeInterfaceType); + Translator->InterfaceReference = FstubTranslatorNull; + Translator->InterfaceDereference = FstubTranslatorNull; + Translator->TranslateResources = FstubTranslateResource; + Translator->TranslateResourceRequirements = FstubTranslateRequirement; + + return STATUS_SUCCESS; +} diff --git a/ntoskrnl/include/internal/cm.h b/ntoskrnl/include/internal/cm.h index 30fa3669f4a..9a0dd907585 100644 --- a/ntoskrnl/include/internal/cm.h +++ b/ntoskrnl/include/internal/cm.h @@ -1585,6 +1585,7 @@ extern ULONG CmDefaultLanguageIdType; extern WCHAR CmInstallUILanguageId[]; extern ULONG CmInstallUILanguageIdLength; extern ULONG CmInstallUILanguageIdType; +extern ULONG CmNtGlobalFlag; extern LANGID PsInstallUILanguageId; extern LANGID PsDefaultUILanguageId; extern CM_SYSTEM_CONTROL_VECTOR CmControlVector[]; diff --git a/ntoskrnl/include/internal/hal.h b/ntoskrnl/include/internal/hal.h index 47b76beee48..249ae64a19b 100644 --- a/ntoskrnl/include/internal/hal.h +++ b/ntoskrnl/include/internal/hal.h @@ -4,6 +4,7 @@ * FILE: ntoskrnl/include/hal.h * PURPOSE: Internal header for the I/O HAL Functions (Fstub) * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) + * Pierre Schweitzer (pierre.schweitzer@reactos.org) */ #pragma once @@ -71,6 +72,170 @@ xHalVectorToIDTEntry( IN ULONG Vector ); +NTSTATUS +NTAPI +xHalGetInterruptTranslator( + IN INTERFACE_TYPE ParentInterfaceType, + IN ULONG ParentBusNumber, + IN INTERFACE_TYPE BridgeInterfaceType, + IN USHORT Size, + IN USHORT Version, + OUT PTRANSLATOR_INTERFACE Translator, + OUT PULONG BridgeBusNumber +); + +PBUS_HANDLER +FASTCALL +xHalHandlerForBus( + IN INTERFACE_TYPE InterfaceType, + IN ULONG BusNumber +); + +VOID +FASTCALL +xHalReferenceHandler( + IN PBUS_HANDLER BusHandler +); + +NTSTATUS +NTAPI +xHalInitPnpDriver( + VOID +); + +NTSTATUS +NTAPI +xHalInitPowerManagement( + IN PPM_DISPATCH_TABLE PmDriverDispatchTable, + OUT PPM_DISPATCH_TABLE *PmHalDispatchTable +); + +NTSTATUS +NTAPI +xHalStartMirroring( + VOID +); + +NTSTATUS +NTAPI +xHalEndMirroring( + IN ULONG PassNumber +); + +NTSTATUS +NTAPI +xHalMirrorPhysicalMemory( + IN PHYSICAL_ADDRESS PhysicalAddress, + IN LARGE_INTEGER NumberOfBytes +); + +NTSTATUS +NTAPI +xHalQueryBusSlots( + IN PBUS_HANDLER BusHandler, + IN ULONG BufferSize, + OUT PULONG SlotNumbers, + OUT PULONG ReturnedLength +); + +NTSTATUS +NTAPI +xHalSetSystemInformation( + IN HAL_SET_INFORMATION_CLASS InformationClass, + IN ULONG BufferSize, + IN PVOID Buffer +); + +NTSTATUS +NTAPI +xHalQuerySystemInformation( + IN HAL_QUERY_INFORMATION_CLASS InformationClass, + IN ULONG BufferSize, + IN OUT PVOID Buffer, + OUT PULONG ReturnedLength +); + +VOID +NTAPI +xHalLocateHiberRanges( + IN PVOID MemoryMap +); + +NTSTATUS +NTAPI +xHalRegisterBusHandler( + IN INTERFACE_TYPE InterfaceType, + IN BUS_DATA_TYPE ConfigSpace, + IN ULONG BusNumber, + IN INTERFACE_TYPE ParentInterfaceType, + IN ULONG ParentBusNumber, + IN ULONG ContextSize, + IN PINSTALL_BUS_HANDLER InstallCallback, + OUT PBUS_HANDLER *BusHandler +); + +VOID +NTAPI +xHalSetWakeAlarm( + IN ULONGLONG AlartTime, + IN PTIME_FIELDS TimeFields +); + +BOOLEAN +NTAPI +xHalTranslateBusAddress( + IN INTERFACE_TYPE InterfaceType, + IN ULONG BusNumber, + IN PHYSICAL_ADDRESS BusAddress, + IN OUT PULONG AddressSpace, + OUT PPHYSICAL_ADDRESS TranslatedAddress +); + +NTSTATUS +NTAPI +xHalAllocateMapRegisters( + IN PADAPTER_OBJECT AdapterObject, + IN ULONG Unknown, + IN ULONG Unknown2, + PMAP_REGISTER_ENTRY Registers +); + +NTSTATUS +NTAPI +xKdSetupPciDeviceForDebugging( + IN PVOID LoaderBlock OPTIONAL, + IN OUT PDEBUG_DEVICE_DESCRIPTOR PciDevice +); + +NTSTATUS +NTAPI +xKdReleasePciDeviceForDebugging( + IN OUT PDEBUG_DEVICE_DESCRIPTOR PciDevice +); + +PVOID +NTAPI +xKdGetAcpiTablePhase( + IN struct _LOADER_PARAMETER_BLOCK *LoaderBlock, + IN ULONG Signature +); + +PVOID +NTAPI +MatchAll( + IN PHYSICAL_ADDRESS PhysicalAddress, + IN ULONG NumberPages, + IN BOOLEAN FlushCurrentTLB +); + +VOID +NTAPI +xKdUnmapVirtualAddress( + IN PVOID VirtualAddress, + IN ULONG NumberPages, + IN BOOLEAN FlushCurrentTLB +); + // // Various offsets in the boot record diff --git a/ntoskrnl/include/internal/kd.h b/ntoskrnl/include/internal/kd.h index b61d498b771..53ee9b0f4b2 100644 --- a/ntoskrnl/include/internal/kd.h +++ b/ntoskrnl/include/internal/kd.h @@ -363,3 +363,12 @@ extern KD_CONTEXT KdpContext; extern ULONG Kd_WIN2000_Mask; #endif + +#if DBG +#define ID_Win32PreServiceHook 'WSH0' +#define ID_Win32PostServiceHook 'WSH1' +typedef void (NTAPI *PKDBG_PRESERVICEHOOK)(ULONG, PULONG_PTR); +typedef ULONG_PTR (NTAPI *PKDBG_POSTSERVICEHOOK)(ULONG, ULONG_PTR); +extern PKDBG_PRESERVICEHOOK KeWin32PreServiceHook; +extern PKDBG_POSTSERVICEHOOK KeWin32PostServiceHook; +#endif diff --git a/ntoskrnl/io/pnpmgr/pnpres.c b/ntoskrnl/io/pnpmgr/pnpres.c index 733440dd5fb..ac1884e2d11 100644 --- a/ntoskrnl/io/pnpmgr/pnpres.c +++ b/ntoskrnl/io/pnpmgr/pnpres.c @@ -755,7 +755,7 @@ IopTranslateDeviceResources( &DescriptorTranslated->u.Port.Start)) { Status = STATUS_UNSUCCESSFUL; - DPRINT1("Failed to translate port resource (Start: 0xI64x)\n", DescriptorRaw->u.Port.Start.QuadPart); + DPRINT1("Failed to translate port resource (Start: 0x%I64x)\n", DescriptorRaw->u.Port.Start.QuadPart); goto cleanup; } break; diff --git a/ntoskrnl/kd/kdmain.c b/ntoskrnl/kd/kdmain.c index 6b16582735a..ac1f0bc4911 100644 --- a/ntoskrnl/kd/kdmain.c +++ b/ntoskrnl/kd/kdmain.c @@ -71,7 +71,7 @@ KdpServiceDispatcher(ULONG Service, case EnterDebugger: DbgBreakPoint(); break; - + case KdSpare3: MmDumpArmPfnDatabase(FALSE); break; @@ -82,6 +82,23 @@ KdpServiceDispatcher(ULONG Service, break; } + /* Register a debug callback */ + case 'CsoR': + { + switch (Buffer1Length) + { + case ID_Win32PreServiceHook: + KeWin32PreServiceHook = Buffer1; + break; + + case ID_Win32PostServiceHook: + KeWin32PostServiceHook = Buffer1; + break; + + } + break; + } + /* Special case for stack frame dumps */ case 'DsoR': { diff --git a/ntoskrnl/kdbg/kdb_cli.c b/ntoskrnl/kdbg/kdb_cli.c index ba20dc401ff..a0d5135f929 100644 --- a/ntoskrnl/kdbg/kdb_cli.c +++ b/ntoskrnl/kdbg/kdb_cli.c @@ -877,6 +877,8 @@ KdbpCmdBackTrace( else KdbpPrint("\n"); + if (KdbOutputAborted) break; + if (Address == 0) break; @@ -2707,6 +2709,7 @@ KdbpCliMainLoop( /* Call the command */ Continue = KdbpDoCommand(Command); + KdbOutputAborted = FALSE; } while (Continue); } diff --git a/ntoskrnl/ke/i386/cpu.c b/ntoskrnl/ke/i386/cpu.c index 2606297c1b4..38539b11e70 100644 --- a/ntoskrnl/ke/i386/cpu.c +++ b/ntoskrnl/ke/i386/cpu.c @@ -303,10 +303,17 @@ KiGetFeatureBits(VOID) /* Remove support for correct PTE support. */ FeatureBits &= ~KF_WORKING_PTE; } + + /* Virtualbox claims to have no SYSENTER support, + * which is false for processors >= Pentium Pro */ + if(Prcb->CpuType >= 6) + { + Reg[3] |= 0x800; + } - /* Check if the CPU is too old to support SYSENTER */ - if ((Prcb->CpuType < 6) || - ((Prcb->CpuType == 6) && (Prcb->CpuStep < 0x0303))) + /* Check if the CPU is too old to support SYSENTER, + * See Intel CPUID instruction manual for details*/ + if ((Reg[0] & 0x0FFF3FFF) < 0x00000633) { /* Disable it */ Reg[3] &= ~0x800; @@ -474,6 +481,32 @@ KiGetFeatureBits(VOID) } } } + + DPRINT1("Supported CPU features : %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s\n", +#define print_supported(kf_value) \ + FeatureBits & kf_value ? #kf_value : "" + print_supported(KF_V86_VIS), + print_supported(KF_RDTSC), + print_supported(KF_CR4), + print_supported(KF_CMOV), + print_supported(KF_GLOBAL_PAGE), + print_supported(KF_LARGE_PAGE), + print_supported(KF_MTRR), + print_supported(KF_CMPXCHG8B), + print_supported(KF_MMX), + print_supported(KF_WORKING_PTE), + print_supported(KF_PAT), + print_supported(KF_FXSR), + print_supported(KF_FAST_SYSCALL), + print_supported(KF_XMMI), + print_supported(KF_3DNOW), + print_supported(KF_AMDK6MTRR), + print_supported(KF_XMMI64), + print_supported(KF_DTS), + print_supported(KF_NX_BIT), + print_supported(KF_NX_DISABLED), + print_supported(KF_NX_ENABLED)); +#undef print_supported /* Return the Feature Bits */ return FeatureBits; diff --git a/ntoskrnl/ke/i386/traphdlr.c b/ntoskrnl/ke/i386/traphdlr.c index 4822b71b8aa..c3f5893d1e8 100644 --- a/ntoskrnl/ke/i386/traphdlr.c +++ b/ntoskrnl/ke/i386/traphdlr.c @@ -46,6 +46,10 @@ UCHAR KiTrapIoTable[] = }; PFAST_SYSTEM_CALL_EXIT KiFastCallExitHandler; +#if DBG && !defined(_WINKD_) +PKDBG_PRESERVICEHOOK KeWin32PreServiceHook = NULL; +PKDBG_POSTSERVICEHOOK KeWin32PostServiceHook = NULL; +#endif /* TRAP EXIT CODE *************************************************************/ @@ -1443,6 +1447,28 @@ KiDebugServiceHandler(IN PKTRAP_FRAME TrapFrame) KiDebugHandler(TrapFrame, TrapFrame->Eax, TrapFrame->Ecx, TrapFrame->Edx); } + +FORCEINLINE +VOID +KiDbgPreServiceHook(ULONG SystemCallNumber, PULONG_PTR Arguments) +{ +#if DBG && !defined(_WINKD_) + if (SystemCallNumber >= 0x1000 && KeWin32PreServiceHook) + KeWin32PreServiceHook(SystemCallNumber, Arguments); +#endif +} + +FORCEINLINE +ULONG_PTR +KiDbgPostServiceHook(ULONG SystemCallNumber, ULONG_PTR Result) +{ +#if DBG && !defined(_WINKD_) + if (SystemCallNumber >= 0x1000 && KeWin32PostServiceHook) + return KeWin32PostServiceHook(SystemCallNumber, Result); +#endif + return Result; +} + DECLSPEC_NORETURN VOID FORCEINLINE @@ -1553,10 +1579,16 @@ KiSystemCall(IN PKTRAP_FRAME TrapFrame, while (TRUE); } + /* Call pre-service debug hook */ + KiDbgPreServiceHook(SystemCallNumber, Arguments); + /* Get the handler and make the system call */ Handler = (PVOID)DescriptorTable->Base[Id]; Result = KiSystemCallTrampoline(Handler, Arguments, StackBytes); + /* Call post-service debug hook */ + Result = KiDbgPostServiceHook(SystemCallNumber, Result); + /* Make sure we're exiting correctly */ KiExitSystemCallDebugChecks(Id, TrapFrame); diff --git a/ntoskrnl/mm/ARM3/miavl.h b/ntoskrnl/mm/ARM3/miavl.h index 8b0ce6db62c..da698d6f70c 100644 --- a/ntoskrnl/mm/ARM3/miavl.h +++ b/ntoskrnl/mm/ARM3/miavl.h @@ -44,7 +44,7 @@ RtlpAvlCompareRoutine(IN PRTL_AVL_TABLE Table, IN PVOID Buffer, IN PVOID UserData) { - PRTL_BALANCED_LINKS CurrentNode = (PVOID)((ULONG_PTR)UserData - sizeof(LIST_ENTRY) - sizeof(RTL_BALANCED_LINKS)); + PRTL_BALANCED_LINKS CurrentNode = (PVOID)((ULONG_PTR)UserData - sizeof(RTL_BALANCED_LINKS)); ULONG_PTR StartingVpn = (ULONG_PTR)Buffer; if (StartingVpn < CurrentNode->StartingVpn) { diff --git a/ntoskrnl/mm/marea.c b/ntoskrnl/mm/marea.c index cacf2ae667e..dc50d13f723 100644 --- a/ntoskrnl/mm/marea.c +++ b/ntoskrnl/mm/marea.c @@ -458,7 +458,7 @@ MmFindGapBottomUp( { PVOID LowestAddress = MmGetAddressSpaceOwner(AddressSpace) ? MM_LOWEST_USER_ADDRESS : MmSystemRangeStart; PVOID HighestAddress = MmGetAddressSpaceOwner(AddressSpace) ? - (PVOID)((ULONG_PTR)MmSystemRangeStart - 1) : (PVOID)MAXULONG_PTR; + MmHighestUserAddress : (PVOID)MAXULONG_PTR; PVOID AlignedAddress; PMEMORY_AREA Node; PMEMORY_AREA FirstNode; diff --git a/ntoskrnl/ps/query.c b/ntoskrnl/ps/query.c index 342c818945e..6b6c2681186 100644 --- a/ntoskrnl/ps/query.c +++ b/ntoskrnl/ps/query.c @@ -469,11 +469,26 @@ NtQueryInformationProcess(IN HANDLE ProcessHandle, NULL); if (!NT_SUCCESS(Status)) break; - DPRINT1("Not implemented: ProcessWow64Information\n"); + /* Protect write in SEH */ + _SEH2_TRY + { +#ifdef _WIN64 + DPRINT1("Not implemented: ProcessWow64Information\n"); + Status = STATUS_NOT_IMPLEMENTED; +#else + /* Wow64 not present */ + *(PULONG_PTR)ProcessInformation = 0; +#endif + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + /* Get the exception code */ + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; /* Dereference the process */ ObDereferenceObject(Process); - Status = STATUS_NOT_IMPLEMENTED; break; /* Virtual Memory Statistics */ diff --git a/ntoskrnl/ps/state.c b/ntoskrnl/ps/state.c index e64f227c140..62664f9cc10 100644 --- a/ntoskrnl/ps/state.c +++ b/ntoskrnl/ps/state.c @@ -510,7 +510,7 @@ NtQueueApcThread(IN HANDLE ThreadHandle, ExGetPreviousMode(), (PVOID)&Thread, NULL); - if (NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) return Status; /* Check if this is a System Thread */ if (Thread->SystemThread) diff --git a/subsystems/win32/csrss/csrsrv/api/process.c b/subsystems/win32/csrss/csrsrv/api/process.c index 8b7a4832f8d..58fb959611b 100644 --- a/subsystems/win32/csrss/csrsrv/api/process.c +++ b/subsystems/win32/csrss/csrsrv/api/process.c @@ -145,6 +145,8 @@ NTSTATUS WINAPI CsrFreeProcessData(HANDLE Pid) ULONG hash; PCSRSS_PROCESS_DATA pProcessData, *pPrevLink; HANDLE Process; + PLIST_ENTRY NextEntry; + PCSR_THREAD Thread; hash = ((ULONG_PTR)Pid >> 2) % (sizeof(ProcessData) / sizeof(*ProcessData)); pPrevLink = &ProcessData[hash]; @@ -161,14 +163,27 @@ NTSTATUS WINAPI CsrFreeProcessData(HANDLE Pid) DPRINT("CsrFreeProcessData pid: %d\n", Pid); Process = pProcessData->Process; CallProcessDeleted(pProcessData); + + /* Dereference all process threads */ + NextEntry = pProcessData->ThreadList.Flink; + while (NextEntry != &pProcessData->ThreadList) + { + Thread = CONTAINING_RECORD(NextEntry, CSR_THREAD, Link); + NextEntry = NextEntry->Flink; + + CsrThreadRefcountZero(Thread); + } + if (pProcessData->CsrSectionViewBase) { NtUnmapViewOfSection(NtCurrentProcess(), pProcessData->CsrSectionViewBase); } + if (pProcessData->ServerCommunicationPort) { NtClose(pProcessData->ServerCommunicationPort); } + *pPrevLink = pProcessData->next; RtlFreeHeap(CsrssApiHeap, 0, pProcessData); diff --git a/subsystems/win32/csrss/win32csr/CMakeLists.txt b/subsystems/win32/csrss/win32csr/CMakeLists.txt index 829ea9a19d8..8422a9500c0 100644 --- a/subsystems/win32/csrss/win32csr/CMakeLists.txt +++ b/subsystems/win32/csrss/win32csr/CMakeLists.txt @@ -20,6 +20,7 @@ list(APPEND SOURCE desktopbg.c dllmain.c exitros.c + file.c guiconsole.c handle.c harderror.c diff --git a/subsystems/win32/csrss/win32csr/dllmain.c b/subsystems/win32/csrss/win32csr/dllmain.c index f38558838e8..06112ab1f42 100644 --- a/subsystems/win32/csrss/win32csr/dllmain.c +++ b/subsystems/win32/csrss/win32csr/dllmain.c @@ -87,6 +87,7 @@ static CSRSS_API_DEFINITION Win32CsrApiDefinitions[] = CSRSS_DEFINE_API(SET_HISTORY_NUMBER_COMMANDS, CsrSetHistoryNumberCommands), CSRSS_DEFINE_API(GET_HISTORY_INFO, CsrGetHistoryInfo), CSRSS_DEFINE_API(SET_HISTORY_INFO, CsrSetHistoryInfo), + CSRSS_DEFINE_API(GET_TEMP_FILE, CsrGetTempFile), { 0, 0, NULL } }; diff --git a/subsystems/win32/csrss/win32csr/file.c b/subsystems/win32/csrss/win32csr/file.c new file mode 100644 index 00000000000..d7e8414b0dd --- /dev/null +++ b/subsystems/win32/csrss/win32csr/file.c @@ -0,0 +1,33 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: subsys/csrss/win32csr/file.c + * PURPOSE: File handling + * PROGRAMMERS: Pierre Schweitzer (pierre.schweitzer@reactos.org) + * NOTE: Belongs to basesrv.dll + */ + +/* INCLUDES ******************************************************************/ + +#include + +#define NDEBUG +#include + +/* GLOBALS *******************************************************************/ + +UINT CsrGetTempFileUnique; + +/* FUNCTIONS *****************************************************************/ + +CSR_API(CsrGetTempFile) +{ + DPRINT("CsrGetTempFile entered\n"); + + /* Return 16-bits ID */ + Request->Data.GetTempFile.UniqueID = (++CsrGetTempFileUnique & 0xFFFF); + + DPRINT("Returning: %u\n", Request->Data.GetTempFile.UniqueID); + + return STATUS_SUCCESS; +} diff --git a/subsystems/win32/csrss/win32csr/file.h b/subsystems/win32/csrss/win32csr/file.h new file mode 100644 index 00000000000..c163ee53254 --- /dev/null +++ b/subsystems/win32/csrss/win32csr/file.h @@ -0,0 +1,17 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: subsystem/win32/csrss/win32csr/file.h + * PURPOSE: File handling + * PROGRAMMERS: Pierre Schweitzer (pierre.schweitzer@reactos.org) + * NOTE: Belongs to basesrv.dll + */ + +#pragma once + +#include "api.h" + +/* Api functions */ +CSR_API(CsrGetTempFile); + +/* EOF */ diff --git a/subsystems/win32/csrss/win32csr/harderror.c b/subsystems/win32/csrss/win32csr/harderror.c index cfa16c6eb34..ee195f7aab2 100644 --- a/subsystems/win32/csrss/win32csr/harderror.c +++ b/subsystems/win32/csrss/win32csr/harderror.c @@ -118,7 +118,7 @@ CsrpCaptureStringParameters( ULONG nParam, UnicodeStringParameterMask, Size = 0; NTSTATUS Status; UNICODE_STRING TempStringU; - PWSTR ParamString; + CHAR *ParamString; UnicodeStringParameterMask = HardErrorMessage->UnicodeStringParameterMask; @@ -166,7 +166,8 @@ CsrpCaptureStringParameters( } /* Zero terminate the string */ - ParamString[TempStringU.Length / sizeof(WCHAR)] = 0; + ParamString[TempStringU.Length] = 0; + ParamString[TempStringU.Length + 1] = 0; DPRINT("ParamString=\'%S\'\n", ParamString); Parameters[nParam] = (ULONG_PTR)ParamString; diff --git a/subsystems/win32/csrss/win32csr/w32csr.h b/subsystems/win32/csrss/win32csr/w32csr.h index 5ecc378a7c7..8516cccd034 100644 --- a/subsystems/win32/csrss/win32csr/w32csr.h +++ b/subsystems/win32/csrss/win32csr/w32csr.h @@ -18,6 +18,7 @@ #include #include #include +#include "file.h" #include "guiconsole.h" #include "tuiconsole.h" #include diff --git a/subsystems/win32/win32k/CMakeLists.txt b/subsystems/win32/win32k/CMakeLists.txt index 0ba97e94055..1e819e70e36 100644 --- a/subsystems/win32/win32k/CMakeLists.txt +++ b/subsystems/win32/win32k/CMakeLists.txt @@ -130,6 +130,7 @@ list(APPEND SOURCE objects/font.c objects/freetype.c objects/gdibatch.c + objects/gdidbg.c objects/gdiobj.c objects/icm.c objects/line.c diff --git a/subsystems/win32/win32k/dib/dib.c b/subsystems/win32/win32k/dib/dib.c index 2066c9e0b72..516b4bd3ae9 100644 --- a/subsystems/win32/win32k/dib/dib.c +++ b/subsystems/win32/win32k/dib/dib.c @@ -87,11 +87,12 @@ DIB_FUNCTIONS DibFunctionsForBitmapFormat[] = } }; + ULONG DIB_DoRop(ULONG Rop, ULONG Dest, ULONG Source, ULONG Pattern) { ULONG ResultNibble; - ULONG Result; + ULONG Result = 0; ULONG i; static const ULONG ExpandDest[16] = { @@ -151,27 +152,30 @@ static const ULONG ExpandDest[16] = 0xF0F0F0F0 /* 1111 */, }; - /* Optimized code for the various named rop codes. */ - switch (Rop) + Rop &=0xFF; + switch(Rop) { - case ROP3_TO_ROP4(BLACKNESS): return(0); - case ROP3_TO_ROP4(NOTSRCERASE): return(~(Dest | Source)); - case ROP3_TO_ROP4(NOTSRCCOPY): return(~Source); - case ROP3_TO_ROP4(SRCERASE): return((~Dest) & Source); - case ROP3_TO_ROP4(DSTINVERT): return(~Dest); - case ROP3_TO_ROP4(PATINVERT): return(Dest ^ Pattern); - case ROP3_TO_ROP4(SRCINVERT): return(Dest ^ Source); - case ROP3_TO_ROP4(SRCAND): return(Dest & Source); - case ROP3_TO_ROP4(MERGEPAINT): return(Dest | (~Source)); - case ROP3_TO_ROP4(SRCPAINT): return(Dest | Source); - case ROP3_TO_ROP4(MERGECOPY): return(Source & Pattern); - case ROP3_TO_ROP4(SRCCOPY): return(Source); - case ROP3_TO_ROP4(PATCOPY): return(Pattern); - case ROP3_TO_ROP4(PATPAINT): return(Dest | (~Source) | Pattern); - case ROP3_TO_ROP4(WHITENESS): return(0xFFFFFFFF); + + /* Optimized code for the various named rop codes. */ + case R3_OPINDEX_NOOP: return(Dest); + case R3_OPINDEX_BLACKNESS: return(0); + case R3_OPINDEX_NOTSRCERASE: return(~(Dest | Source)); + case R3_OPINDEX_NOTSRCCOPY: return(~Source); + case R3_OPINDEX_SRCERASE: return((~Dest) & Source); + case R3_OPINDEX_DSTINVERT: return(~Dest); + case R3_OPINDEX_PATINVERT: return(Dest ^ Pattern); + case R3_OPINDEX_SRCINVERT: return(Dest ^ Source); + case R3_OPINDEX_SRCAND: return(Dest & Source); + case R3_OPINDEX_MERGEPAINT: return(Dest | (~Source)); + case R3_OPINDEX_SRCPAINT: return(Dest | Source); + case R3_OPINDEX_MERGECOPY: return(Source & Pattern); + case R3_OPINDEX_SRCCOPY: return(Source); + case R3_OPINDEX_PATCOPY: return(Pattern); + case R3_OPINDEX_PATPAINT: return(Dest | (~Source) | Pattern); + case R3_OPINDEX_WHITENESS: return(0xFFFFFFFF); } + /* Expand the ROP operation to all four bytes */ - Rop &= 0xFF; Rop |= (Rop << 24) | (Rop << 16) | (Rop << 8); /* Do the operation on four bits simultaneously. */ Result = 0; diff --git a/subsystems/win32/win32k/dib/dib.h b/subsystems/win32/win32k/dib/dib.h index 4ae455bc92b..5db2f042c7e 100644 --- a/subsystems/win32/win32k/dib/dib.h +++ b/subsystems/win32/win32k/dib/dib.h @@ -31,7 +31,7 @@ typedef struct _BLTINFO POINTL SourcePoint; BRUSHOBJ *Brush; POINTL BrushOrigin; - ULONG Rop4; + ROP4 Rop4; } BLTINFO, *PBLTINFO; typedef VOID (*PFN_DIB_PutPixel)(SURFOBJ*,LONG,LONG,ULONG); diff --git a/subsystems/win32/win32k/dib/dib1bpp.c b/subsystems/win32/win32k/dib/dib1bpp.c index b924112351c..b245c528611 100644 --- a/subsystems/win32/win32k/dib/dib1bpp.c +++ b/subsystems/win32/win32k/dib/dib1bpp.c @@ -380,7 +380,7 @@ DIB_1BPP_BitBlt(PBLTINFO BltInfo) Pattern |= (DIB_GetSourceIndex(PatternObj, (X + BrushOrigin.x + k) % PatternWidth, PatternY) << (31 - k)); } - Dest = DIB_DoRop(Rop4, Dest, Source, Pattern); + Dest = DIB_DoRop(BltInfo->Rop4, Dest, Source, Pattern); Dest &= ~((1 << (31 - NoBits)) - 1); Dest |= *((PBYTE)DestBits) & ((1 << (31 - NoBits)) - 1); diff --git a/subsystems/win32/win32k/dib/stretchblt.c b/subsystems/win32/win32k/dib/stretchblt.c index b6d479d8703..45a5b8f826b 100644 --- a/subsystems/win32/win32k/dib/stretchblt.c +++ b/subsystems/win32/win32k/dib/stretchblt.c @@ -43,6 +43,8 @@ BOOLEAN DIB_XXBPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, SURFOBJ *Ma LONG PatternX = 0, PatternY = 0; + ASSERT(IS_VALID_ROP4(ROP)); + BOOL UsesSource = ROP4_USES_SOURCE(ROP); BOOL UsesPattern = ROP4_USES_PATTERN(ROP); @@ -122,7 +124,7 @@ BOOLEAN DIB_XXBPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, SURFOBJ *Ma { sx = SourceRect->left+(DesX - DestRect->left) * SrcWidth / DstWidth; if (sx < 0 || sy < 0 || - MaskSurf->sizlBitmap.cx < sx || MaskSurf->sizlBitmap.cy < sy || + MaskSurf->sizlBitmap.cx < sx || MaskSurf->sizlBitmap.cy < sy || fnMask_GetPixel(MaskSurf, sx, sy) != 0) { CanDraw = FALSE; @@ -137,10 +139,10 @@ BOOLEAN DIB_XXBPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, SURFOBJ *Ma { Source = XLATEOBJ_iXlate(ColorTranslation, fnSource_GetPixel(SourceSurf, sx, sy)); } - else + else { Source = 0; - CanDraw = (ROP3_TO_ROP4(SRCCOPY) != ROP); + CanDraw = ((ROP & 0xFF) != R3_OPINDEX_SRCCOPY); } } diff --git a/subsystems/win32/win32k/eng/bitblt.c b/subsystems/win32/win32k/eng/bitblt.c index 3525a2caf2a..6b6ee51f9f1 100644 --- a/subsystems/win32/win32k/eng/bitblt.c +++ b/subsystems/win32/win32k/eng/bitblt.c @@ -27,11 +27,11 @@ typedef BOOLEAN (APIENTRY *PBLTRECTFUNC)(SURFOBJ* OutputObj, static BOOLEAN APIENTRY BltMask(SURFOBJ* psoDest, - SURFOBJ* psoSource, // unused + SURFOBJ* psoSource, SURFOBJ* psoMask, - XLATEOBJ* ColorTranslation, // unused + XLATEOBJ* ColorTranslation, RECTL* prclDest, - POINTL* pptlSource, // unused + POINTL* pptlSource, POINTL* pptlMask, BRUSHOBJ* pbo, POINTL* pptlBrush, @@ -46,19 +46,21 @@ BltMask(SURFOBJ* psoDest, PSURFACE psurfPattern; ULONG PatternWidth = 0, PatternHeight = 0; LONG PatternX0 = 0, PatternX = 0, PatternY = 0; + LONG SrcX = 0, SrcY = 0; PFN_DIB_PutPixel fnDest_PutPixel = NULL; - PFN_DIB_GetPixel fnPattern_GetPixel = NULL; - ULONG Pattern = 0; + PFN_DIB_GetPixel fnPattern_GetPixel = NULL, fnSrc_GetPixel = NULL, fnDest_GetPixel; + ULONG Pattern = 0, Source = 0, Dest = 0; HBITMAP hbmPattern; + DWORD fgndRop, bkgndRop; - ASSERT(psoSource == NULL); - ASSERT(pptlSource == NULL); + ASSERT(IS_VALID_ROP4(Rop4)); - if (psoMask == NULL) - { - return FALSE; - } + fgndRop = ROP4_FGND(Rop4); + bkgndRop = ROP4_BKGND(Rop4); + //DPRINT1("Rop4 : 0x%08x\n", Rop4); + + /* Determine pattern */ if (pbo && pbo->iSolidColor == 0xFFFFFFFF) { pebo = CONTAINING_RECORD(pbo, EBRUSHOBJ, BrushObject); @@ -80,6 +82,18 @@ BltMask(SURFOBJ* psoDest, fjMaskBit0 = 0x80 >> (pptlMask->x & 0x07); fnDest_PutPixel = DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_PutPixel; + fnDest_GetPixel = DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_GetPixel; + + /* Do we have a source */ + if(psoSource) + { + /* Sanity check */ + ASSERT(ROP4_USES_SOURCE(Rop4)); + fnSrc_GetPixel = DibFunctionsForBitmapFormat[psoSource->iBitmapFormat].DIB_GetPixel; + SrcY = pptlSource->y; + SrcX = pptlSource->x; + } + if (psurfPattern) { PatternY = (prclDest->top - pptlBrush->y) % PatternHeight; @@ -92,48 +106,64 @@ BltMask(SURFOBJ* psoDest, { PatternX0 += PatternWidth; } - - for (y = prclDest->top; y < prclDest->bottom; y++) - { - pjMskCurrent = pjMskLine; - fjMaskBit = fjMaskBit0; - PatternX = PatternX0; - - for (x = prclDest->left; x < prclDest->right; x++) - { - if (*pjMskCurrent & fjMaskBit) - { - fnDest_PutPixel(psoDest, x, y, - fnPattern_GetPixel(psoPattern, PatternX, PatternY)); - } - fjMaskBit = _rotr8(fjMaskBit, 1); - pjMskCurrent += (fjMaskBit >> 7); - PatternX++; - PatternX %= PatternWidth; - } - pjMskLine += psoMask->lDelta; - PatternY++; - PatternY %= PatternHeight; - } + PatternX = PatternX0; } else { Pattern = pbo ? pbo->iSolidColor : 0; - for (y = prclDest->top; y < prclDest->bottom; y++) - { - pjMskCurrent = pjMskLine; - fjMaskBit = fjMaskBit0; + } - for (x = prclDest->left; x < prclDest->right; x++) + for (y = prclDest->top; y < prclDest->bottom; y++) + { + pjMskCurrent = pjMskLine; + fjMaskBit = fjMaskBit0; + + for (x = prclDest->left; x < prclDest->right; x++) + { + Rop4 = (*pjMskCurrent & fjMaskBit) ? fgndRop : bkgndRop; + + if(psurfPattern) { - if (*pjMskCurrent & fjMaskBit) - { - fnDest_PutPixel(psoDest, x, y, Pattern); - } - fjMaskBit = _rotr8(fjMaskBit, 1); - pjMskCurrent += (fjMaskBit >> 7); + if(ROP4_USES_PATTERN(Rop4)) + Pattern = fnPattern_GetPixel(psoPattern, PatternX, PatternY); + PatternX++; + PatternX %= PatternWidth; } - pjMskLine += psoMask->lDelta; + + if(psoSource) + { + if(ROP4_USES_SOURCE(Rop4)) + { + Source = XLATEOBJ_iXlate(ColorTranslation, + fnSrc_GetPixel(psoSource, SrcX, SrcY)); + } + SrcX++; + } + + if(ROP4_USES_DEST(Rop4)) + Dest = fnDest_GetPixel(psoDest, x, y); + + fnDest_PutPixel(psoDest, + x, + y, + DIB_DoRop(Rop4, + Dest, + Source, + Pattern)); + fjMaskBit = _rotr8(fjMaskBit, 1); + pjMskCurrent += (fjMaskBit >> 7); + } + pjMskLine += psoMask->lDelta; + if(psurfPattern) + { + PatternY++; + PatternY %= PatternHeight; + PatternX = PatternX0; + } + if(psoSource) + { + SrcY++; + SrcX = pptlSource->x; } } @@ -153,7 +183,7 @@ BltPatCopy(SURFOBJ* Dest, POINTL* MaskPoint, BRUSHOBJ* pbo, POINTL* BrushPoint, - ROP4 Rop4) + DWORD Rop4) { // These functions are assigned if we're working with a DIB // The assigned functions depend on the bitsPerPixel of the DIB @@ -188,7 +218,7 @@ CallDibBitBlt(SURFOBJ* OutputObj, BltInfo.DestRect = *OutputRect; BltInfo.SourcePoint = *InputPoint; - if (ROP3_TO_ROP4(SRCCOPY) == Rop4) + if ((Rop4 & 0xFF) == R3_OPINDEX_SRCCOPY) return DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_BitBltSrcCopy(&BltInfo); BltInfo.Brush = pbo; @@ -244,7 +274,7 @@ NtGdiEngBitBlt( IN POINTL *pptlMask, IN BRUSHOBJ *pbo, IN POINTL *pptlBrush, - IN ROP4 rop4 ) + IN ROP4 Rop4) { RECTL rclTrg; POINTL ptlSrc; @@ -272,7 +302,7 @@ NtGdiEngBitBlt( } _SEH2_END; - return EngBitBlt(psoTrg, psoSrc, psoMask, pco, pxlo, &rclTrg, &ptlSrc, &ptlMask, pbo, &ptlBrush, rop4); + return EngBitBlt(psoTrg, psoSrc, psoMask, pco, pxlo, &rclTrg, &ptlSrc, &ptlMask, pbo, &ptlBrush, Rop4); } /* @@ -289,7 +319,7 @@ EngBitBlt(SURFOBJ *DestObj, POINTL *MaskOrigin, BRUSHOBJ *pbo, POINTL *BrushOrigin, - ROP4 rop4) + ROP4 Rop4) { BYTE clippingType; RECTL CombinedRect; @@ -306,16 +336,20 @@ EngBitBlt(SURFOBJ *DestObj, unsigned i; POINTL Pt; ULONG Direction; - BOOL UsesSource; + BOOL UsesSource, UsesMask; POINTL AdjustedBrushOrigin; - UsesSource = ROP4_USES_SOURCE(rop4); - if (R4_NOOP == rop4) + UsesSource = ROP4_USES_SOURCE(Rop4); + UsesMask = ROP4_USES_MASK(Rop4); + + if (Rop4 == ROP4_NOOP) { /* Copy destination onto itself: nop */ return TRUE; } + //DPRINT1("Rop4 : 0x%08x\n", Rop4); + OutputRect = *DestRect; if (OutputRect.right < OutputRect.left) { @@ -434,11 +468,11 @@ EngBitBlt(SURFOBJ *DestObj, clippingType = ClipRegion->iDComplexity; } - if (R4_MASK == rop4) + if (UsesMask) { BltRectFunc = BltMask; } - else if (ROP3_TO_ROP4(PATCOPY) == rop4) + else if ((Rop4 & 0xFF) == R3_OPINDEX_PATCOPY) { if (pbo && pbo->iSolidColor == 0xFFFFFFFF) BltRectFunc = CallDibBitBlt; @@ -456,7 +490,7 @@ EngBitBlt(SURFOBJ *DestObj, case DC_TRIVIAL: Ret = (*BltRectFunc)(OutputObj, InputObj, Mask, ColorTranslation, &OutputRect, &InputPoint, MaskOrigin, pbo, - &AdjustedBrushOrigin, rop4); + &AdjustedBrushOrigin, Rop4); break; case DC_RECT: /* Clip the blt to the clip rectangle */ @@ -470,7 +504,7 @@ EngBitBlt(SURFOBJ *DestObj, Pt.y = InputPoint.y + CombinedRect.top - OutputRect.top; Ret = (*BltRectFunc)(OutputObj, InputObj, Mask, ColorTranslation, &CombinedRect, &Pt, MaskOrigin, pbo, - &AdjustedBrushOrigin, rop4); + &AdjustedBrushOrigin, Rop4); } break; case DC_COMPLEX: @@ -511,7 +545,7 @@ EngBitBlt(SURFOBJ *DestObj, Ret = (*BltRectFunc)(OutputObj, InputObj, Mask, ColorTranslation, &CombinedRect, &Pt, MaskOrigin, pbo, &AdjustedBrushOrigin, - rop4) && Ret; + Rop4) && Ret; } } } @@ -534,15 +568,13 @@ IntEngBitBlt( POINTL *pptlMask, BRUSHOBJ *pbo, POINTL *pptlBrush, - ROP4 rop4) + ROP4 Rop4) { SURFACE *psurfTrg; SURFACE *psurfSrc = NULL; BOOL bResult; RECTL rclClipped; RECTL rclSrc; -// INTENG_ENTER_LEAVE EnterLeaveSource; -// INTENG_ENTER_LEAVE EnterLeaveDest; PFN_DrvBitBlt pfnBitBlt; ASSERT(psoTrg); @@ -552,9 +584,14 @@ IntEngBitBlt( rclClipped = *prclTrg; RECTL_vMakeWellOrdered(&rclClipped); - /* Clip target rect against the bounds of the clipping region */ + //DPRINT1("Rop4 : 0x%08x\n", Rop4); + + /* Sanity check */ + ASSERT(IS_VALID_ROP4(Rop4)); + if (pco) { + /* Clip target rect against the bounds of the clipping region */ if (!RECTL_bIntersectRect(&rclClipped, &rclClipped, &pco->rclBounds)) { /* Nothing left */ @@ -566,7 +603,7 @@ IntEngBitBlt( pco = NULL; } - if (ROP4_USES_SOURCE(rop4)) + if (ROP4_USES_SOURCE(Rop4)) { ASSERT(psoSrc); psurfSrc = CONTAINING_RECORD(psoSrc, SURFACE, SurfObj); @@ -616,7 +653,7 @@ IntEngBitBlt( pptlMask, pbo, pptlBrush, - rop4); + Rop4); // FIXME: cleanup temp surface! @@ -822,7 +859,7 @@ EngMaskBitBlt(SURFOBJ *psoDest, else Ret = BltMask(psoOutput, NULL, psoInput, DestColorTranslation, &OutputRect, NULL, &InputPoint, pbo, &AdjustedBrushOrigin, - R4_MASK); + ROP4_MASK); break; case DC_RECT: // Clip the blt to the clip rectangle @@ -842,7 +879,7 @@ EngMaskBitBlt(SURFOBJ *psoDest, else { Ret = BltMask(psoOutput, NULL, psoInput, DestColorTranslation, - &CombinedRect, NULL, &Pt, pbo, &AdjustedBrushOrigin, R4_MASK); + &CombinedRect, NULL, &Pt, pbo, &AdjustedBrushOrigin, ROP4_MASK); } } break; @@ -891,7 +928,7 @@ EngMaskBitBlt(SURFOBJ *psoDest, Ret = BltMask(psoOutput, NULL, psoInput, DestColorTranslation, &CombinedRect, NULL, &Pt, pbo, &AdjustedBrushOrigin, - R4_MASK) && Ret; + ROP4_MASK) && Ret; } } } @@ -956,7 +993,7 @@ IntEngMaskBlt(SURFOBJ *psoDest, but the VMware driver doesn't hook that call. */ IntEngBitBlt(psoDest, NULL, psoMask, ClipRegion, DestColorTranslation, DestRect, pptlMask, pptlMask, pbo, BrushOrigin, - R4_NOOP); + ROP4_NOOP); ret = EngMaskBitBlt(psoDest, psoMask, ClipRegion, DestColorTranslation, SourceColorTranslation, &OutputRect, &InputPoint, pbo, BrushOrigin); @@ -964,7 +1001,7 @@ IntEngMaskBlt(SURFOBJ *psoDest, /* Dummy BitBlt to let driver know that something has changed. */ IntEngBitBlt(psoDest, NULL, psoMask, ClipRegion, DestColorTranslation, DestRect, pptlMask, pptlMask, pbo, BrushOrigin, - R4_NOOP); + ROP4_NOOP); return ret; } diff --git a/subsystems/win32/win32k/eng/copybits.c b/subsystems/win32/win32k/eng/copybits.c index afb2f16cc99..0bec04a5af3 100644 --- a/subsystems/win32/win32k/eng/copybits.c +++ b/subsystems/win32/win32k/eng/copybits.c @@ -49,12 +49,28 @@ EngCopyBits(SURFOBJ *psoDest, BLTINFO BltInfo; SURFACE *psurfDest; SURFACE *psurfSource; + RECTL rclDest = *DestRect; + POINTL ptlSrc = *SourcePoint; ASSERT(psoDest != NULL && psoSource != NULL && DestRect != NULL && SourcePoint != NULL); psurfSource = CONTAINING_RECORD(psoSource, SURFACE, SurfObj); psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj); + /* Clip dest rect against source surface size / source point */ + if (psoSource->sizlBitmap.cx - ptlSrc.x < rclDest.right - rclDest.left) + rclDest.right = rclDest.left + psoSource->sizlBitmap.cx - ptlSrc.x; + if (psoSource->sizlBitmap.cy - ptlSrc.y < rclDest.bottom - rclDest.top) + rclDest.bottom = rclDest.top + psoSource->sizlBitmap.cy - ptlSrc.y; + + /* Clip dest rect against target surface size */ + if (rclDest.right > psoDest->sizlBitmap.cx) + rclDest.right = psoDest->sizlBitmap.cx; + if (rclDest.bottom > psoDest->sizlBitmap.cy) + rclDest.bottom = psoDest->sizlBitmap.cy; + if (RECTL_bIsEmptyRect(&rclDest)) return TRUE; + DestRect = &rclDest; + // FIXME: Don't punt to the driver's DrvCopyBits immediately. Instead, // mark the copy block function to be DrvCopyBits instead of the // GDI's copy bit function so as to remove clipping from the @@ -92,7 +108,7 @@ EngCopyBits(SURFOBJ *psoDest, // If CopyBits wasn't hooked, BitBlt must be ret = IntEngBitBlt(psoDest, psoSource, NULL, Clip, ColorTranslation, DestRect, SourcePoint, - NULL, NULL, NULL, ROP3_TO_ROP4(SRCCOPY)); + NULL, NULL, NULL, ROP4_FROM_INDEX(R3_OPINDEX_SRCCOPY)); goto cleanup; } @@ -111,7 +127,7 @@ EngCopyBits(SURFOBJ *psoDest, BltInfo.SourceSurface = psoSource; BltInfo.PatternSurface = NULL; BltInfo.XlateSourceToDest = ColorTranslation; - BltInfo.Rop4 = SRCCOPY; + BltInfo.Rop4 = ROP4_FROM_INDEX(R3_OPINDEX_SRCCOPY); switch (clippingType) { diff --git a/subsystems/win32/win32k/eng/gradient.c b/subsystems/win32/win32k/eng/gradient.c index 75faeae5c33..38d663c7723 100644 --- a/subsystems/win32/win32k/eng/gradient.c +++ b/subsystems/win32/win32k/eng/gradient.c @@ -130,7 +130,7 @@ IntEngGradientFillRect( { Color = XLATEOBJ_iXlate(pxlo, RGB(c[0], c[1], c[2])); DibFunctionsForBitmapFormat[psoOutput->iBitmapFormat].DIB_VLine( - psoOutput, y, FillRect.top, FillRect.bottom, Color); + psoOutput, y + Translate.x, FillRect.top + Translate.y, FillRect.bottom + Translate.y, Color); } HVSTEPCOL(0); HVSTEPCOL(1); @@ -158,7 +158,7 @@ IntEngGradientFillRect( { Color = XLATEOBJ_iXlate(pxlo, RGB(c[0], c[1], c[2])); DibFunctionsForBitmapFormat[psoOutput->iBitmapFormat].DIB_HLine( - psoOutput, FillRect.left, FillRect.right, y, Color); + psoOutput, FillRect.left + Translate.x, FillRect.right + Translate.x, y + Translate.y, Color); } HVSTEPCOL(0); HVSTEPCOL(1); @@ -187,7 +187,7 @@ IntEngGradientFillRect( for(; FillRect.top < FillRect.bottom; FillRect.top++) { DibFunctionsForBitmapFormat[psoOutput->iBitmapFormat].DIB_HLine( - psoOutput, FillRect.left, FillRect.right, FillRect.top, Color); + psoOutput, FillRect.left + Translate.x, FillRect.right + Translate.x, FillRect.top + Translate.y, Color); } } } @@ -318,7 +318,7 @@ IntEngGradientFillTriangle( //ULONG i; POINTL Translate; INTENG_ENTER_LEAVE EnterLeave; - RECTL FillRect; + RECTL FillRect = { 0, 0, 0, 0 }; //ULONG Color; //BOOL sx[NLINES]; diff --git a/subsystems/win32/win32k/eng/mouse.c b/subsystems/win32/win32k/eng/mouse.c index b2db0e61af7..00dc0333ccb 100644 --- a/subsystems/win32/win32k/eng/mouse.c +++ b/subsystems/win32/win32k/eng/mouse.c @@ -175,7 +175,7 @@ IntHideMousePointer( &ptlSave, NULL, NULL, - ROP3_TO_ROP4(SRCCOPY)); + ROP4_FROM_INDEX(R3_OPINDEX_SRCCOPY)); } VOID @@ -228,7 +228,7 @@ IntShowMousePointer(PDEVOBJ *ppdev, SURFOBJ *psoDest) NULL, NULL, NULL, - ROP3_TO_ROP4(SRCCOPY)); + ROP4_FROM_INDEX(R3_OPINDEX_SRCCOPY)); /* Blt the pointer on the screen. */ if (pgp->psurfColor) @@ -243,7 +243,7 @@ IntShowMousePointer(PDEVOBJ *ppdev, SURFOBJ *psoDest) NULL, NULL, NULL, - ROP3_TO_ROP4(SRCAND)); + ROP4_FROM_INDEX(R3_OPINDEX_SRCAND)); IntEngBitBlt(psoDest, &pgp->psurfColor->SurfObj, @@ -255,7 +255,7 @@ IntShowMousePointer(PDEVOBJ *ppdev, SURFOBJ *psoDest) NULL, NULL, NULL, - ROP3_TO_ROP4(SRCINVERT)); + ROP4_FROM_INDEX(R3_OPINDEX_SRCINVERT)); } else { @@ -269,7 +269,7 @@ IntShowMousePointer(PDEVOBJ *ppdev, SURFOBJ *psoDest) NULL, NULL, NULL, - ROP3_TO_ROP4(SRCAND)); + ROP4_FROM_INDEX(R3_OPINDEX_SRCAND)); rclPointer.top += pgp->Size.cy; @@ -283,7 +283,7 @@ IntShowMousePointer(PDEVOBJ *ppdev, SURFOBJ *psoDest) NULL, NULL, NULL, - ROP3_TO_ROP4(SRCINVERT)); + ROP4_FROM_INDEX(R3_OPINDEX_SRCINVERT)); } } @@ -337,7 +337,7 @@ EngSetPointerShape( rectl.bottom = sizel.cy; /* Calculate lDelta for our surfaces. */ - lDelta = WIDTH_BYTES_ALIGN32(sizel.cx, + lDelta = WIDTH_BYTES_ALIGN32(sizel.cx, BitsPerFormat(pso->iBitmapFormat)); /* Create a bitmap for saving the pixels under the cursor. */ diff --git a/subsystems/win32/win32k/eng/stretchblt.c b/subsystems/win32/win32k/eng/stretchblt.c index a6f3d4f4572..1b4a7f99ea6 100644 --- a/subsystems/win32/win32k/eng/stretchblt.c +++ b/subsystems/win32/win32k/eng/stretchblt.c @@ -104,7 +104,7 @@ EngStretchBltROP( IN POINTL *MaskOrigin, IN ULONG Mode, IN BRUSHOBJ *pbo, - IN DWORD ROP4) + IN ROP4 Rop4) { RECTL InputRect; RECTL OutputRect; @@ -116,7 +116,7 @@ EngStretchBltROP( PSTRETCHRECTFUNC BltRectFunc; BOOLEAN Ret = TRUE; POINTL AdjustedBrushOrigin; - BOOL UsesSource = ROP4_USES_SOURCE(ROP4); + BOOL UsesSource = ROP4_USES_SOURCE(Rop4); BYTE clippingType; RECTL ClipRect; @@ -132,6 +132,13 @@ EngStretchBltROP( LONG SrcHeight; LONG SrcWidth; + if (Rop4 == ROP4_NOOP) + { + /* Copy destination onto itself: nop */ + return TRUE; + } + + /* Determine clipping type */ if (ClipRegion == (CLIPOBJ *) NULL) { @@ -142,12 +149,6 @@ EngStretchBltROP( clippingType = ClipRegion->iDComplexity; } - if (ROP4 == R4_NOOP) - { - /* Copy destination onto itself: nop */ - return TRUE; - } - OutputRect = *prclDest; if (OutputRect.right < OutputRect.left) { @@ -257,7 +258,7 @@ EngStretchBltROP( case DC_TRIVIAL: Ret = (*BltRectFunc)(psoOutput, psoInput, Mask, ColorTranslation, &OutputRect, &InputRect, MaskOrigin, - pbo, &AdjustedBrushOrigin, ROP4); + pbo, &AdjustedBrushOrigin, Rop4); break; case DC_RECT: // Clip the blt to the clip rectangle @@ -278,7 +279,7 @@ EngStretchBltROP( MaskOrigin, pbo, &AdjustedBrushOrigin, - ROP4); + Rop4); } break; case DC_COMPLEX: @@ -323,7 +324,7 @@ EngStretchBltROP( MaskOrigin, pbo, &AdjustedBrushOrigin, - ROP4); + Rop4); } } } @@ -371,7 +372,7 @@ EngStretchBlt( MaskOrigin, Mode, NULL, - ROP3_TO_ROP4(SRCCOPY)); + ROP4_FROM_INDEX(R3_OPINDEX_SRCCOPY)); } BOOL APIENTRY @@ -385,7 +386,7 @@ IntEngStretchBlt(SURFOBJ *psoDest, POINTL *pMaskOrigin, BRUSHOBJ *pbo, POINTL *BrushOrigin, - ROP4 ROP) + DWORD Rop4) { BOOLEAN ret; COLORADJUSTMENT ca; @@ -395,7 +396,7 @@ IntEngStretchBlt(SURFOBJ *psoDest, RECTL InputClippedRect; RECTL InputRect; RECTL OutputRect; - BOOL UsesSource = ROP4_USES_SOURCE(ROP); + BOOL UsesSource = ROP4_USES_SOURCE(Rop4); LONG InputClWidth, InputClHeight, InputWidth, InputHeight; ASSERT(psoDest); @@ -403,6 +404,9 @@ IntEngStretchBlt(SURFOBJ *psoDest, ASSERT(psurfDest); ASSERT(DestRect); + /* Sanity check */ + ASSERT(IS_VALID_ROP4(Rop4)); + InputClippedRect = *DestRect; if (InputClippedRect.right < InputClippedRect.left) { @@ -485,7 +489,7 @@ IntEngStretchBlt(SURFOBJ *psoDest, &MaskOrigin, COLORONCOLOR, pbo, - ROP); + Rop4); } if (! ret) @@ -502,7 +506,7 @@ IntEngStretchBlt(SURFOBJ *psoDest, &MaskOrigin, COLORONCOLOR, pbo, - ROP); + Rop4); } return ret; diff --git a/subsystems/win32/win32k/eng/xlate.c b/subsystems/win32/win32k/eng/xlate.c index f6aa48cd5fe..d2d1fa6afb0 100644 --- a/subsystems/win32/win32k/eng/xlate.c +++ b/subsystems/win32/win32k/eng/xlate.c @@ -17,8 +17,6 @@ /** Globals *******************************************************************/ ULONG giUniqueXlate = 0; -EXLATEOBJ gexloTrivial; -XLATEOBJ* gpxloTrivial = &gexloTrivial.xlo; const BYTE gajXlate5to8[32] = { 0, 8, 16, 25, 33, 41, 49, 58, 66, 74, 82, 90, 99,107,115,123, @@ -329,23 +327,6 @@ EXLATEOBJ_iXlateBitfieldsToPal(PEXLATEOBJ pexlo, ULONG iColor) /** Private Functions *********************************************************/ -VOID -NTAPI -EXLATEOBJ_vInitTrivial(PEXLATEOBJ pexlo) -{ - pexlo->xlo.iUniq = InterlockedIncrement((LONG*)&giUniqueXlate); - pexlo->xlo.flXlate = XO_TRIVIAL; - pexlo->xlo.iSrcType = PAL_RGB; - pexlo->xlo.iDstType = PAL_RGB; - pexlo->xlo.cEntries = 0; - pexlo->xlo.pulXlate = pexlo->aulXlate; - pexlo->pfnXlate = EXLATEOBJ_iXlateTrivial; - pexlo->ppalSrc = &gpalRGB; - pexlo->ppalDst = &gpalRGB; - pexlo->ppalDstDc = &gpalRGB; - pexlo->hColorTransform = NULL; -} - VOID NTAPI EXLATEOBJ_vInitialize( @@ -359,19 +340,26 @@ EXLATEOBJ_vInitialize( ULONG cEntries; ULONG i, ulColor; - EXLATEOBJ_vInitTrivial(pexlo); - - if (ppalDst == ppalSrc || !ppalSrc || !ppalDst || - ((ppalDst->flFlags == PAL_RGB || ppalDst->flFlags == PAL_BGR) && - ppalDst->flFlags == ppalSrc->flFlags)) - { - return; - } + if (!ppalSrc) ppalSrc = &gpalRGB; + if (!ppalDst) ppalDst = &gpalRGB; + pexlo->xlo.iUniq = InterlockedIncrement((LONG*)&giUniqueXlate); + pexlo->xlo.cEntries = 0; + pexlo->xlo.flXlate = 0; + pexlo->xlo.pulXlate = pexlo->aulXlate; + pexlo->pfnXlate = EXLATEOBJ_iXlateTrivial; + pexlo->hColorTransform = NULL; pexlo->ppalSrc = ppalSrc; pexlo->ppalDst = ppalDst; pexlo->xlo.iSrcType = ppalSrc->flFlags; pexlo->xlo.iDstType = ppalDst->flFlags; + pexlo->ppalDstDc = &gpalRGB; + + if (ppalDst == ppalSrc) + { + pexlo->xlo.flXlate |= XO_TRIVIAL; + return; + } /* Chack if both of the pallettes are indexed */ if (!(ppalSrc->flFlags & PAL_INDEXED) || !(ppalDst->flFlags & PAL_INDEXED)) @@ -430,9 +418,9 @@ EXLATEOBJ_vInitialize( else if (ppalSrc->flFlags & PAL_BITFIELDS) { PALETTE_vGetBitMasks(ppalSrc, &pexlo->ulRedMask); - pexlo->ulRedShift = CalculateShift(0xFF, pexlo->ulRedMask); - pexlo->ulGreenShift = CalculateShift(0xFF00, pexlo->ulGreenMask); - pexlo->ulBlueShift = CalculateShift(0xFF0000, pexlo->ulBlueMask); + pexlo->ulRedShift = CalculateShift(RGB(0xFF,0,0), pexlo->ulRedMask); + pexlo->ulGreenShift = CalculateShift(RGB(0,0xFF,0), pexlo->ulGreenMask); + pexlo->ulBlueShift = CalculateShift(RGB(0,0,0xFF), pexlo->ulBlueMask); pexlo->aulXlate[0] = EXLATEOBJ_iXlateShiftAndMask(pexlo, crSrcBackColor); } @@ -455,12 +443,14 @@ EXLATEOBJ_vInitialize( return; } } - pexlo->xlo.cEntries = cEntries; pexlo->pfnXlate = EXLATEOBJ_iXlateTable; + pexlo->xlo.cEntries = cEntries; + pexlo->xlo.flXlate |= XO_TABLE; + if (ppalDst->flFlags & PAL_INDEXED) { - pexlo->xlo.flXlate |= XO_TABLE; + ULONG cDiff = 0; for (i = 0; i < cEntries; i++) { @@ -471,11 +461,11 @@ EXLATEOBJ_vInitialize( pexlo->xlo.pulXlate[i] = PALETTE_ulGetNearestPaletteIndex(ppalDst, ulColor); - if (pexlo->xlo.pulXlate[i] != i) - pexlo->xlo.flXlate &= ~XO_TRIVIAL; + if (pexlo->xlo.pulXlate[i] != i) cDiff++; } - if (pexlo->xlo.flXlate & XO_TRIVIAL) + /* Check if we have only trivial mappings */ + if (cDiff == 0) { if (pexlo->xlo.pulXlate != pexlo->aulXlate) { @@ -484,23 +474,18 @@ EXLATEOBJ_vInitialize( } pexlo->pfnXlate = EXLATEOBJ_iXlateTrivial; pexlo->xlo.flXlate = XO_TRIVIAL; + pexlo->xlo.cEntries = 0; return; } } else { - // FIXME: use PALETTE_ulGetNearest - EXLATEOBJ exloTmp = *pexlo; - exloTmp.xlo.pulXlate = exloTmp.aulXlate; - - pexlo->xlo.flXlate |= XO_TABLE; for (i = 0; i < pexlo->xlo.cEntries; i++) { ulColor = RGB(ppalSrc->IndexedColors[i].peRed, ppalSrc->IndexedColors[i].peGreen, ppalSrc->IndexedColors[i].peBlue); - pexlo->xlo.pulXlate[i] = - EXLATEOBJ_iXlateShiftAndMask(&exloTmp, ulColor); + pexlo->xlo.pulXlate[i] = PALETTE_ulGetNearestBitFieldsIndex(ppalDst, ulColor); } } } @@ -607,13 +592,6 @@ EXLATEOBJ_vInitXlateFromDCs( psurfDst = pdcDst->dclevel.pSurface; psurfSrc = pdcSrc->dclevel.pSurface; - /* Check for trivial color translation */ - if (psurfDst == psurfSrc) - { - EXLATEOBJ_vInitTrivial(pexlo); - return; - } - /* Normal initialisation. No surface means DEFAULT_BITMAP */ EXLATEOBJ_vInitialize(pexlo, psurfSrc ? psurfSrc->ppal : &gpalMono, @@ -621,6 +599,8 @@ EXLATEOBJ_vInitXlateFromDCs( pdcSrc->pdcattr->crBackgroundClr, pdcDst->pdcattr->crBackgroundClr, pdcDst->pdcattr->crForegroundClr); + + pexlo->ppalDstDc = pdcDst->dclevel.ppal; } VOID @@ -639,7 +619,6 @@ NTSTATUS NTAPI InitXlateImpl(VOID) { - EXLATEOBJ_vInitTrivial(&gexloTrivial); return STATUS_SUCCESS; } diff --git a/subsystems/win32/win32k/include/color.h b/subsystems/win32/win32k/include/color.h index 0972f2e8dd3..233412e6ccd 100644 --- a/subsystems/win32/win32k/include/color.h +++ b/subsystems/win32/win32k/include/color.h @@ -27,7 +27,7 @@ typedef struct _COLORSPACE typedef struct _COLORTRANSFORMOBJ { BASEOBJECT BaseObject; - HANDLE hColorTransform; + HANDLE hColorTransform; } GDICLRXFORM, COLORTRANSFORMOBJ, *PCOLORTRANSFORMOBJ; extern HCOLORSPACE hStockColorSpace; diff --git a/subsystems/win32/win32k/include/dc.h b/subsystems/win32/win32k/include/dc.h index 2d94c245ca3..1e85e364d35 100644 --- a/subsystems/win32/win32k/include/dc.h +++ b/subsystems/win32/win32k/include/dc.h @@ -55,9 +55,6 @@ typedef struct _ROS_DC_INFO HRGN hGCClipRgn; /* GC clip region (ClipRgn AND VisRgn) */ CLIPOBJ *CombinedClip; - - UNICODE_STRING DriverName; - } ROS_DC_INFO; typedef struct _DCLEVEL @@ -213,7 +210,10 @@ DC_vSelectSurface(PDC pdc, PSURFACE psurfNew) { PSURFACE psurfOld = pdc->dclevel.pSurface; if (psurfOld) + { + psurfOld->hdc = NULL; SURFACE_ShareUnlockSurface(psurfOld); + } if (psurfNew) GDIOBJ_IncrementShareCount((POBJ)psurfNew); pdc->dclevel.pSurface = psurfNew; diff --git a/subsystems/win32/win32k/include/gdidebug.h b/subsystems/win32/win32k/include/gdidebug.h new file mode 100644 index 00000000000..944e546c118 --- /dev/null +++ b/subsystems/win32/win32k/include/gdidebug.h @@ -0,0 +1,116 @@ +#pragma once + +extern ULONG gulDebugChannels; + +#define GDI_STACK_LEVELS 20 +extern ULONG_PTR GDIHandleAllocator[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; +extern ULONG_PTR GDIHandleLocker[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; +extern ULONG_PTR GDIHandleShareLocker[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; +extern ULONG_PTR GDIHandleDeleter[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; + +enum _DEBUGCHANNELS +{ + DbgCustom = 1, + DbgObjects = 2, + DbgBitBlt = 4, + DbgXlate = 8, + DbgModeSwitch = 16, +}; + +void IntDumpHandleTable(PGDI_HANDLE_TABLE HandleTable); +ULONG CaptureStackBackTace(PVOID* pFrames, ULONG nFramesToCapture); +BOOL GdiDbgHTIntegrityCheck(); +void GdiDbgDumpLockedHandles(); + +#define DBGENABLE(ch) gulDebugChannels |= (ch); +#define DBGDISABLE(ch) gulDebugChannels &= ~(ch); +#define DPRINTCH(ch) if (gulDebugChannels & (ch)) DbgPrint + +#ifdef GDI_DEBUG + +#define KeRosDumpStackFrames(Frames, Count) KdSystemDebugControl('DsoR', (PVOID)Frames, Count, NULL, 0, NULL, KernelMode) +NTSYSAPI ULONG APIENTRY RtlWalkFrameChain(OUT PVOID *Callers, IN ULONG Count, IN ULONG Flags); + +#define IS_HANDLE_VALID(idx) \ + ((GdiHandleTable->Entries[idx].Type & GDI_ENTRY_BASETYPE_MASK) != 0) + +#define GDIDBG_TRACECALLER() \ + DPRINT1("-> called from:\n"); \ + KeRosDumpStackFrames(NULL, 20); +#define GDIDBG_TRACEALLOCATOR(handle) \ + DPRINT1("-> allocated from:\n"); \ + KeRosDumpStackFrames(GDIHandleAllocator[GDI_HANDLE_GET_INDEX(handle)], GDI_STACK_LEVELS); +#define GDIDBG_TRACELOCKER(handle) \ + DPRINT1("-> locked from:\n"); \ + KeRosDumpStackFrames(GDIHandleLocker[GDI_HANDLE_GET_INDEX(handle)], GDI_STACK_LEVELS); +#define GDIDBG_TRACESHARELOCKER(handle) \ + DPRINT1("-> locked from:\n"); \ + KeRosDumpStackFrames(GDIHandleShareLocker[GDI_HANDLE_GET_INDEX(handle)], GDI_STACK_LEVELS); +#define GDIDBG_TRACEDELETER(handle) \ + DPRINT1("-> deleted from:\n"); \ + KeRosDumpStackFrames(GDIHandleDeleter[GDI_HANDLE_GET_INDEX(handle)], GDI_STACK_LEVELS); +#define GDIDBG_CAPTUREALLOCATOR(handle) \ + CaptureStackBackTace((PVOID*)GDIHandleAllocator[GDI_HANDLE_GET_INDEX(handle)], GDI_STACK_LEVELS); +#define GDIDBG_CAPTURELOCKER(handle) \ + CaptureStackBackTace((PVOID*)GDIHandleLocker[GDI_HANDLE_GET_INDEX(handle)], GDI_STACK_LEVELS); +#define GDIDBG_CAPTURESHARELOCKER(handle) \ + CaptureStackBackTace((PVOID*)GDIHandleShareLocker[GDI_HANDLE_GET_INDEX(handle)], GDI_STACK_LEVELS); +#define GDIDBG_CAPTUREDELETER(handle) \ + CaptureStackBackTace((PVOID*)GDIHandleDeleter[GDI_HANDLE_GET_INDEX(handle)], GDI_STACK_LEVELS); +#define GDIDBG_DUMPHANDLETABLE() \ + IntDumpHandleTable(GdiHandleTable) +#define GDIDBG_INITLOOPTRACE() \ + ULONG Attempts = 0; +#define GDIDBG_TRACELOOP(Handle, PrevThread, Thread) \ + if ((++Attempts % 20) == 0) \ + { \ + DPRINT1("[%d] Handle 0x%p Locked by 0x%x (we're 0x%x)\n", Attempts, Handle, PrevThread, Thread); \ + } + +#else + +#define GDIDBG_TRACECALLER() +#define GDIDBG_TRACEALLOCATOR(index) +#define GDIDBG_TRACELOCKER(index) +#define GDIDBG_TRACESHARELOCKER(index) +#define GDIDBG_CAPTUREALLOCATOR(index) +#define GDIDBG_CAPTURELOCKER(index) +#define GDIDBG_CAPTURESHARELOCKER(index) +#define GDIDBG_CAPTUREDELETER(handle) +#define GDIDBG_DUMPHANDLETABLE() +#define GDIDBG_INITLOOPTRACE() +#define GDIDBG_TRACELOOP(Handle, PrevThread, Thread) +#define GDIDBG_TRACEDELETER(handle) + +#endif /* GDI_DEBUG */ + +#if DBG +void +NTAPI +DbgPreServiceHook(ULONG ulSyscallId, PULONG_PTR pulArguments); + +ULONG_PTR +NTAPI +DbgPostServiceHook(ULONG ulSyscallId, ULONG_PTR ulResult); + +#define ID_Win32PreServiceHook 'WSH0' +#define ID_Win32PostServiceHook 'WSH1' + +FORCEINLINE void +GdiDbgAssertNoLocks(char * pszFile, ULONG nLine) +{ + PTHREADINFO pti = (PTHREADINFO)PsGetCurrentThreadWin32Thread(); + if (pti && pti->cExclusiveLocks != 0) + { + DbgPrint("(%s:%ld) There are %ld exclusive locks!\n", + pszFile, nLine, pti->cExclusiveLocks); + GdiDbgDumpLockedHandles(); + ASSERT(FALSE); + } +} + +#define ASSERT_NOGDILOCKS() GdiDbgAssertNoLocks(__FILE__,__LINE__) +#else +#define ASSERT_NOGDILOCKS() +#endif + diff --git a/subsystems/win32/win32k/include/gdiobj.h b/subsystems/win32/win32k/include/gdiobj.h index e736391322e..3f581bca22f 100644 --- a/subsystems/win32/win32k/include/gdiobj.h +++ b/subsystems/win32/win32k/include/gdiobj.h @@ -9,6 +9,9 @@ #include #include "win32.h" +/* apparently the first 10 entries are never used in windows as they are empty */ +#define RESERVE_ENTRIES_COUNT 10 + typedef struct _GDI_HANDLE_TABLE { /* The table must be located at the beginning of this structure so it can be @@ -105,6 +108,19 @@ ULONG FORCEINLINE GDIOBJ_UnlockObjByPtr(POBJ Object) { +#if DBG + PTHREADINFO pti = (PTHREADINFO)PsGetCurrentThreadWin32Thread(); + if (pti) + { + if (pti->cExclusiveLocks < 1) + { + DbgPrint("cExclusiveLocks = %ld, object: %ld\n", + pti->cExclusiveLocks, Object->cExclusiveLock); + ASSERT(FALSE); + } + pti->cExclusiveLocks--; + } +#endif INT cLocks = InterlockedDecrement((PLONG)&Object->cExclusiveLock); ASSERT(cLocks >= 0); return cLocks; @@ -120,6 +136,7 @@ GDIOBJ_ShareUnlockObjByPtr(POBJ Object) ASSERT(cLocks >= 0); if ((flags & BASEFLAG_READY_TO_DIE) && (cLocks == 0)) { + ASSERT(Object->cExclusiveLock == 0); GDIOBJ_SetOwnership(hobj, PsGetCurrentProcess()); GDIOBJ_FreeObjByHandle(hobj, GDI_OBJECT_TYPE_DONTCARE); } @@ -143,3 +160,7 @@ INT FASTCALL GreGetObjectOwner(HGDIOBJ, GDIOBJTYPE); #define GDIOBJ_GetKernelObj(Handle) \ ((PGDI_TABLE_ENTRY)&GdiHandleTable->Entries[GDI_HANDLE_GET_INDEX(Handle)])->KernelData +#define GDI_ENTRY_TO_INDEX(ht, e) \ + (((ULONG_PTR)(e) - (ULONG_PTR)&((ht)->Entries[0])) / sizeof(GDI_TABLE_ENTRY)) +#define GDI_HANDLE_GET_ENTRY(HandleTable, h) \ + (&(HandleTable)->Entries[GDI_HANDLE_GET_INDEX((h))]) diff --git a/subsystems/win32/win32k/include/inteng.h b/subsystems/win32/win32k/include/inteng.h index 1d8610d2dac..4b360b0ce9b 100644 --- a/subsystems/win32/win32k/include/inteng.h +++ b/subsystems/win32/win32k/include/inteng.h @@ -17,19 +17,40 @@ typedef struct tagSPAN ULONG Width; } SPAN, *PSPAN; -#define R3_OPINDEX_SRCCOPY 0xcc -#define R3_OPINDEX_NOOP 0xaa -#define R4_NOOP ((R3_OPINDEX_NOOP << 8) | R3_OPINDEX_NOOP) -#define R4_MASK ((R3_OPINDEX_NOOP << 8) | R3_OPINDEX_SRCCOPY) +#define R3_OPINDEX_NOOP 0xAA + +#define R3_OPINDEX_BLACKNESS 0x00 +#define R3_OPINDEX_NOTSRCERASE 0x11 +#define R3_OPINDEX_NOTSRCCOPY 0x33 +#define R3_OPINDEX_SRCERASE 0x44 +#define R3_OPINDEX_DSTINVERT 0x55 +#define R3_OPINDEX_PATINVERT 0x5A +#define R3_OPINDEX_SRCINVERT 0x66 +#define R3_OPINDEX_SRCAND 0x88 +#define R3_OPINDEX_MERGEPAINT 0xBB +#define R3_OPINDEX_MERGECOPY 0xC0 +#define R3_OPINDEX_SRCCOPY 0xCC +#define R3_OPINDEX_SRCPAINT 0xEE +#define R3_OPINDEX_PATCOPY 0xF0 +#define R3_OPINDEX_PATPAINT 0xFB +#define R3_OPINDEX_WHITENESS 0xFF #define ROP2_TO_MIX(Rop2) (((Rop2) << 8) | (Rop2)) -#define ROP3_USES_DEST(Rop3) ((((Rop3) & 0xAA0000) >> 1) != ((Rop3) & 0x550000)) -#define ROP4_USES_DEST(Rop4) (((((Rop4) & 0xAA) >> 1) != ((Rop4) & 0x55)) || ((((Rop4) & 0xAA00) >> 1) != ((Rop4) & 0x5500))) -#define ROP3_USES_SOURCE(Rop3) ((((Rop3) & 0xCC0000) >> 2) != ((Rop3) & 0x330000)) -#define ROP4_USES_SOURCE(Rop4) (((((Rop4) & 0xCC) >> 2) != ((Rop4) & 0x33)) || ((((Rop4) & 0xCC00) >> 2) != ((Rop4) & 0x3300))) -#define ROP3_USES_PATTERN(Rop3) ((((Rop3) & 0xF00000) >> 4) != ((Rop3) & 0x0F0000)) + +#define ROP4_FROM_INDEX(index) ((index) | ((index) << 8)) + +#define ROP4_USES_SOURCE(Rop4) (((((Rop4) & 0xCC00) >> 2) != ((Rop4) & 0x3300)) || ((((Rop4) & 0xCC) >> 2) != ((Rop4) & 0x33))) +#define ROP4_USES_MASK(Rop4) (((Rop4) & 0xFF00) != (((Rop4) & 0xff) << 8)) +#define ROP4_USES_DEST(Rop4) (((((Rop4) & 0xAA) >> 1) != ((Rop4) & 0x55)) || ((((Rop4) & 0xAA00) >> 1) != ((Rop4) & 0x5500))) #define ROP4_USES_PATTERN(Rop4) (((((Rop4) & 0xF0) >> 4) != ((Rop4) & 0x0F)) || ((((Rop4) & 0xF000) >> 4) != ((Rop4) & 0x0F00))) -#define ROP3_TO_ROP4(Rop3) ((((Rop3) >> 8) & 0xff00) | (((Rop3) >> 16) & 0x00ff)) + +#define IS_VALID_ROP4(rop) (((rop) & 0xFFFF0000) == 0) + +#define ROP4_FGND(Rop4) ((Rop4) & 0x00FF) +#define ROP4_BKGND(Rop4) (((Rop4) & 0xFF00) >> 8) + +#define ROP4_NOOP (R3_OPINDEX_NOOP | (R3_OPINDEX_NOOP << 8)) +#define ROP4_MASK (R3_OPINDEX_SRCCOPY | (R3_OPINDEX_NOOP << 8)) /* Definitions of IntEngXxx functions */ diff --git a/subsystems/win32/win32k/include/intgdi.h b/subsystems/win32/win32k/include/intgdi.h index fcbb7a08e10..5e7ca97d68f 100644 --- a/subsystems/win32/win32k/include/intgdi.h +++ b/subsystems/win32/win32k/include/intgdi.h @@ -232,8 +232,6 @@ IntGetSystemPaletteEntries(HDC hDC, UINT StartIndex, UINT Entries, LPPALETTEENTRY pe); -UINT APIENTRY -IntGetDIBColorTable(HDC hDC, UINT StartIndex, UINT Entries, RGBQUAD *Colors); UINT APIENTRY IntSetDIBColorTable(HDC hDC, UINT StartIndex, UINT Entries, CONST RGBQUAD *Colors); diff --git a/subsystems/win32/win32k/include/msgqueue.h b/subsystems/win32/win32k/include/msgqueue.h index ed80d369dc3..84d803bb7fb 100644 --- a/subsystems/win32/win32k/include/msgqueue.h +++ b/subsystems/win32/win32k/include/msgqueue.h @@ -180,6 +180,11 @@ co_IntSendMessage(HWND hWnd, WPARAM wParam, LPARAM lParam); LRESULT FASTCALL +co_IntPostOrSendMessage(HWND hWnd, + UINT Msg, + WPARAM wParam, + LPARAM lParam); +LRESULT FASTCALL co_IntSendMessageTimeout(HWND hWnd, UINT Msg, WPARAM wParam, @@ -187,6 +192,7 @@ co_IntSendMessageTimeout(HWND hWnd, UINT uFlags, UINT uTimeout, ULONG_PTR *uResult); + BOOL FASTCALL UserSendNotifyMessage( HWND hWnd,UINT Msg,WPARAM wParam,LPARAM lParam ); LRESULT FASTCALL co_IntSendMessageNoWait(HWND hWnd, UINT Msg, diff --git a/subsystems/win32/win32k/include/palette.h b/subsystems/win32/win32k/include/palette.h index 3fad906ff45..d18edee49df 100644 --- a/subsystems/win32/win32k/include/palette.h +++ b/subsystems/win32/win32k/include/palette.h @@ -81,6 +81,7 @@ INT FASTCALL PALETTE_ToPhysical (PDC dc, COLORREF color); INT FASTCALL PALETTE_GetObject(PPALETTE pGdiObject, INT cbCount, LPLOGBRUSH lpBuffer); ULONG NTAPI PALETTE_ulGetNearestPaletteIndex(PALETTE* ppal, ULONG iColor); ULONG NTAPI PALETTE_ulGetNearestIndex(PALETTE* ppal, ULONG iColor); +ULONG NTAPI PALETTE_ulGetNearestBitFieldsIndex(PALETTE* ppal, ULONG ulColor); VOID NTAPI PALETTE_vGetBitMasks(PPALETTE ppal, PULONG pulColors); PPALETTEENTRY FASTCALL ReturnSystemPalette (VOID); diff --git a/subsystems/win32/win32k/include/win32.h b/subsystems/win32/win32k/include/win32.h index 56bfd56856a..521ef7a407c 100644 --- a/subsystems/win32/win32k/include/win32.h +++ b/subsystems/win32/win32k/include/win32.h @@ -99,10 +99,13 @@ typedef struct _THREADINFO LIST_ENTRY aphkStart[NB_HOOKS]; CLIENTTHREADINFO cti; // Used only when no Desktop or pcti NULL. - /* ReactOS */ - LIST_ENTRY WindowListHead; - LIST_ENTRY W32CallbackListHead; - SINGLE_LIST_ENTRY ReferencesList; + + /* ReactOS */ + LIST_ENTRY WindowListHead; + LIST_ENTRY W32CallbackListHead; + SINGLE_LIST_ENTRY ReferencesList; + ULONG cExclusiveLocks; + } THREADINFO; #include @@ -175,7 +178,6 @@ typedef struct _PROCESSINFO DWORD dwLayout; DWORD dwRegisteredClasses; /* ReactOS */ - LIST_ENTRY ClassList; LIST_ENTRY MenuListHead; FAST_MUTEX PrivateFontListLock; LIST_ENTRY PrivateFontListHead; diff --git a/subsystems/win32/win32k/include/win32kp.h b/subsystems/win32/win32k/include/win32kp.h index 7842bb276d9..94bf3190b85 100644 --- a/subsystems/win32/win32k/include/win32kp.h +++ b/subsystems/win32/win32k/include/win32kp.h @@ -87,3 +87,4 @@ #include #include #include +#include diff --git a/subsystems/win32/win32k/include/winpos.h b/subsystems/win32/win32k/include/winpos.h index b21b9107616..7f1c52a4124 100644 --- a/subsystems/win32/win32k/include/winpos.h +++ b/subsystems/win32/win32k/include/winpos.h @@ -9,6 +9,9 @@ NtGdiPtInRegion((WndObject)->hrgnClip, (INT)((x) - (WndObject)->rcWindow.left), \ (INT)((y) - (WndObject)->rcWindow.top)))) +#define IntPtInRect(lprc,pt) \ + ((pt.x >= (lprc)->left) && (pt.x < (lprc)->right) && (pt.y >= (lprc)->top) && (pt.y < (lprc)->bottom)) + UINT FASTCALL co_WinPosArrangeIconicWindows(PWND parent); BOOL FASTCALL diff --git a/subsystems/win32/win32k/include/winsta.h b/subsystems/win32/win32k/include/winsta.h index a50a23ed6b7..c40d14bf419 100644 --- a/subsystems/win32/win32k/include/winsta.h +++ b/subsystems/win32/win32k/include/winsta.h @@ -61,6 +61,7 @@ typedef struct _WINSTATION_OBJECT extern WINSTATION_OBJECT *InputWindowStation; extern PPROCESSINFO LogonProcess; +extern HWND hwndSAS; INIT_FUNCTION NTSTATUS diff --git a/subsystems/win32/win32k/main/dllmain.c b/subsystems/win32/win32k/main/dllmain.c index c8cf433ce04..f78bf1940b9 100644 --- a/subsystems/win32/win32k/main/dllmain.c +++ b/subsystems/win32/win32k/main/dllmain.c @@ -89,8 +89,6 @@ Win32kProcessCallback(struct _EPROCESS *Process, Win32Process->HeapMappings.UserMapping = UserBase; Win32Process->HeapMappings.Count = 1; - InitializeListHead(&Win32Process->ClassList); - InitializeListHead(&Win32Process->MenuListHead); InitializeListHead(&Win32Process->GDIBrushAttrFreeList); @@ -133,6 +131,7 @@ Win32kProcessCallback(struct _EPROCESS *Process, /* no process windows should exist at this point, or the function will assert! */ DestroyProcessClasses(Win32Process); + Win32Process->W32PF_flags &= ~W32PF_CLASSESREGISTERED; GDI_CleanupForProcess(Process); @@ -461,6 +460,12 @@ DriverEntry( /* Register our per-process and per-thread structures. */ PsEstablishWin32Callouts((PWIN32_CALLOUTS_FPNS)&CalloutData); +#if 0 // DBG + /* Register service hook callbacks */ + KdSystemDebugControl('CsoR', DbgPreServiceHook, ID_Win32PreServiceHook, 0, 0, 0, 0); + KdSystemDebugControl('CsoR', DbgPostServiceHook, ID_Win32PostServiceHook, 0, 0, 0, 0); +#endif + /* Create the global USER heap */ GlobalUserHeap = UserCreateHeap(&GlobalUserHeapSection, &GlobalUserHeapBase, diff --git a/subsystems/win32/win32k/ntuser/desktop.c b/subsystems/win32/win32k/ntuser/desktop.c index 74da248d3e7..1653bc21494 100644 --- a/subsystems/win32/win32k/ntuser/desktop.c +++ b/subsystems/win32/win32k/ntuser/desktop.c @@ -616,15 +616,19 @@ VOID APIENTRY UserRedrawDesktop() { PWND Window = NULL; - + HRGN hRgn; + Window = UserGetDesktopWindow(); + hRgn = IntSysCreateRectRgnIndirect(&Window->rcWindow); IntInvalidateWindows( Window, - Window->hrgnUpdate, + hRgn, RDW_FRAME | RDW_ERASE | RDW_INVALIDATE | RDW_ALLCHILDREN); + + REGION_FreeRgnByHandle(hRgn); } @@ -738,7 +742,11 @@ VOID co_IntShellHookNotify(WPARAM Message, LPARAM lParam) for (; *cursor; cursor++) { - UserPostMessage(*cursor, gpsi->uiShellMsg, Message, lParam); + DPRINT("Sending notify\n"); + co_IntPostOrSendMessage(*cursor, + gpsi->uiShellMsg, + Message, + lParam); } ExFreePool(HwndList); diff --git a/subsystems/win32/win32k/ntuser/focus.c b/subsystems/win32/win32k/ntuser/focus.c index 6b1428c45e4..9989e880956 100644 --- a/subsystems/win32/win32k/ntuser/focus.c +++ b/subsystems/win32/win32k/ntuser/focus.c @@ -77,7 +77,7 @@ co_IntSendActivateMessages(HWND hWndPrev, HWND hWnd, BOOL MouseActivate) if (WindowPrev) UserRefObjectCo(WindowPrev, &RefPrev); /* Send palette messages */ - if (co_IntSendMessage(hWnd, WM_QUERYNEWPALETTE, 0, 0)) + if (co_IntPostOrSendMessage(hWnd, WM_QUERYNEWPALETTE, 0, 0)) { UserSendNotifyMessage( HWND_BROADCAST, WM_PALETTEISCHANGING, @@ -166,7 +166,7 @@ co_IntSendKillFocusMessages(HWND hWndPrev, HWND hWnd) if (hWndPrev) { IntNotifyWinEvent(EVENT_OBJECT_FOCUS, NULL, OBJID_CLIENT, CHILDID_SELF, 0); - co_IntSendMessageNoWait(hWndPrev, WM_KILLFOCUS, (WPARAM)hWnd, 0); + co_IntPostOrSendMessage(hWndPrev, WM_KILLFOCUS, (WPARAM)hWnd, 0); } } @@ -177,7 +177,7 @@ co_IntSendSetFocusMessages(HWND hWndPrev, HWND hWnd) { PWND pWnd = UserGetWindowObject(hWnd); IntNotifyWinEvent(EVENT_OBJECT_FOCUS, pWnd, OBJID_CLIENT, CHILDID_SELF, 0); - co_IntSendMessageNoWait(hWnd, WM_SETFOCUS, (WPARAM)hWndPrev, 0); + co_IntPostOrSendMessage(hWnd, WM_SETFOCUS, (WPARAM)hWndPrev, 0); } } @@ -534,29 +534,23 @@ CLEANUP: END_CLEANUP; } -/* - * @implemented - */ -HWND APIENTRY -NtUserSetCapture(HWND hWnd) + +HWND FASTCALL +co_UserSetCapture(HWND hWnd) { PTHREADINFO pti; PUSER_MESSAGE_QUEUE ThreadQueue; PWND Window, pWnd; HWND hWndPrev; - DECLARE_RETURN(HWND); - - DPRINT("Enter NtUserSetCapture(%x)\n", hWnd); - UserEnterExclusive(); pti = PsGetCurrentThreadWin32Thread(); ThreadQueue = pti->MessageQueue; - if((Window = UserGetWindowObject(hWnd))) + if ((Window = UserGetWindowObject(hWnd))) { - if(Window->head.pti->MessageQueue != ThreadQueue) + if (Window->head.pti->MessageQueue != ThreadQueue) { - RETURN(NULL); + return NULL; } } @@ -579,10 +573,24 @@ NtUserSetCapture(HWND hWnd) if (Window) IntNotifyWinEvent(EVENT_SYSTEM_CAPTURESTART, Window, OBJID_WINDOW, CHILDID_SELF, WEF_SETBYWNDPTI); - co_IntSendMessageNoWait(hWndPrev, WM_CAPTURECHANGED, 0, (LPARAM)hWnd); + co_IntPostOrSendMessage(hWndPrev, WM_CAPTURECHANGED, 0, (LPARAM)hWnd); ThreadQueue->CaptureWindow = hWnd; - RETURN( hWndPrev); + return hWndPrev; +} + +/* + * @implemented + */ +HWND APIENTRY +NtUserSetCapture(HWND hWnd) +{ + DECLARE_RETURN(HWND); + + DPRINT("Enter NtUserSetCapture(%x)\n", hWnd); + UserEnterExclusive(); + + RETURN( co_UserSetCapture(hWnd)); CLEANUP: DPRINT("Leave NtUserSetCapture, ret=%i\n",_ret_); diff --git a/subsystems/win32/win32k/ntuser/hook.c b/subsystems/win32/win32k/ntuser/hook.c index 41e9d476bf9..40d847b12ae 100644 --- a/subsystems/win32/win32k/ntuser/hook.c +++ b/subsystems/win32/win32k/ntuser/hook.c @@ -77,7 +77,6 @@ IntCallLowLevelHook( PHOOK Hook, case WH_KEYBOARD: uTimeout = 200; Block = TRUE; - Size = sizeof(KBDLLHOOKSTRUCT); break; } diff --git a/subsystems/win32/win32k/ntuser/input.c b/subsystems/win32/win32k/ntuser/input.c index 04fc11531be..f8550fc79d6 100644 --- a/subsystems/win32/win32k/ntuser/input.c +++ b/subsystems/win32/win32k/ntuser/input.c @@ -708,6 +708,7 @@ KeyboardThreadMain(PVOID StartContext) if (ModifierState == 0) { + UserEnterExclusive(); if (fsModifiers == MOD_WIN) IntKeyboardSendWinKeyMsg(); else if (fsModifiers == MOD_ALT) @@ -723,6 +724,7 @@ KeyboardThreadMain(PVOID StartContext) } co_IntKeyboardSendAltKeyMsg(); } + UserLeave(); continue; } @@ -731,6 +733,8 @@ KeyboardThreadMain(PVOID StartContext) } } + UserEnterExclusive(); + for (;NumKeys;memcpy(&KeyInput, &NextKeyInput, sizeof(KeyInput)), NumKeys--) { @@ -860,6 +864,8 @@ KeyboardThreadMain(PVOID StartContext) */ co_MsqPostKeyboardMessage(msg.message,msg.wParam,msg.lParam); } + + UserLeave(); } KeyboardEscape: @@ -1243,17 +1249,11 @@ IntKeyboardInput(KEYBDINPUT *ki) LARGE_INTEGER LargeTickCount; KBDLLHOOKSTRUCT KbdHookData; WORD flags, wVkStripped, wVkL, wVkR, wVk = ki->wVk, vk_hook = ki->wVk; - BOOLEAN Entered = FALSE; Msg.lParam = 0; - // Condition may arise when calling MsqPostMessage and waiting for an event. - if (!UserIsEntered()) - { - // Fixme: Not sure ATM if this thread is locked. - UserEnterExclusive(); - Entered = TRUE; - } + // Condition may arise when calling MsqPostMessage and waiting for an event. + ASSERT (UserIsEntered()); wVk = LOBYTE(wVk); Msg.wParam = wVk; @@ -1352,7 +1352,7 @@ IntKeyboardInput(KEYBDINPUT *ki) { DPRINT1("Kbd msg %d wParam %d lParam 0x%08x dropped by WH_KEYBOARD_LL hook\n", Msg.message, vk_hook, Msg.lParam); - if (Entered) UserLeave(); + return FALSE; } @@ -1380,7 +1380,7 @@ IntKeyboardInput(KEYBDINPUT *ki) if (FocusMessageQueue == NULL) { DPRINT("No focus message queue\n"); - if (Entered) UserLeave(); + return FALSE; } @@ -1401,8 +1401,6 @@ IntKeyboardInput(KEYBDINPUT *ki) DPRINT("Invalid focus window handle\n"); } - if (Entered) UserLeave(); - return TRUE; } diff --git a/subsystems/win32/win32k/ntuser/message.c b/subsystems/win32/win32k/ntuser/message.c index 9abaa04d357..0822009f541 100644 --- a/subsystems/win32/win32k/ntuser/message.c +++ b/subsystems/win32/win32k/ntuser/message.c @@ -16,6 +16,7 @@ #include BOOLEAN NTAPI PsGetProcessExitProcessCalled(PEPROCESS Process); +HWND FASTCALL co_UserSetCapture(HWND hWnd); #define PM_BADMSGFLAGS ~((QS_RAWINPUT << 16)|PM_QS_SENDMESSAGE|PM_QS_PAINT|PM_QS_POSTMESSAGE|PM_QS_INPUT|PM_NOYIELD|PM_REMOVE) @@ -139,7 +140,6 @@ static MSGMEMORY MsgMemory[] = { WM_COPYGLOBALDATA, MMS_SIZE_WPARAM, MMS_FLAG_READ }, { WM_WINDOWPOSCHANGED, sizeof(WINDOWPOS), MMS_FLAG_READ }, { WM_WINDOWPOSCHANGING, sizeof(WINDOWPOS), MMS_FLAG_READWRITE }, - { WM_MDICREATE, MMS_SIZE_SPECIAL, MMS_FLAG_READWRITE }, }; static PMSGMEMORY FASTCALL @@ -165,7 +165,6 @@ static UINT FASTCALL MsgMemorySize(PMSGMEMORY MsgMemoryEntry, WPARAM wParam, LPARAM lParam) { CREATESTRUCTW *Cs; - MDICREATESTRUCTW *mCs; PUNICODE_STRING WindowName; PUNICODE_STRING ClassName; UINT Size = 0; @@ -204,21 +203,6 @@ MsgMemorySize(PMSGMEMORY MsgMemoryEntry, WPARAM wParam, LPARAM lParam) } break; - case WM_MDICREATE: - mCs = (MDICREATESTRUCTW *)lParam; - WindowName = (PUNICODE_STRING) mCs->szTitle; - ClassName = (PUNICODE_STRING) mCs->szClass; - Size = sizeof(MDICREATESTRUCTW) + WindowName->Length + sizeof(WCHAR); - if (IS_ATOM(ClassName->Buffer)) - { - Size += sizeof(WCHAR) + sizeof(ATOM); - } - else - { - Size += sizeof(WCHAR) + ClassName->Length + sizeof(WCHAR); - } - break; - case WM_NCCALCSIZE: Size = wParam ? sizeof(NCCALCSIZE_PARAMS) + sizeof(WINDOWPOS) : sizeof(RECT); break; @@ -254,7 +238,6 @@ PackParam(LPARAM *lParamPacked, UINT Msg, WPARAM wParam, LPARAM lParam, BOOL Non NCCALCSIZE_PARAMS *PackedNcCalcsize; CREATESTRUCTW *UnpackedCs; CREATESTRUCTW *PackedCs; - MDICREATESTRUCTW *UnpackedmCs, *PackedmCs; PLARGE_STRING WindowName; PUNICODE_STRING ClassName; POOL_TYPE PoolType; @@ -333,53 +316,6 @@ PackParam(LPARAM *lParamPacked, UINT Msg, WPARAM wParam, LPARAM lParam, BOOL Non ASSERT(CsData == (PCHAR) PackedCs + Size); *lParamPacked = (LPARAM) PackedCs; } - else if (WM_MDICREATE == Msg) - { - UnpackedmCs = (MDICREATESTRUCTW *) lParam; - WindowName = (PLARGE_STRING) UnpackedmCs->szTitle; - ClassName = (PUNICODE_STRING) UnpackedmCs->szClass; - Size = sizeof(MDICREATESTRUCTW) + WindowName->Length + sizeof(WCHAR); - if (IS_ATOM(ClassName->Buffer)) - { - Size += sizeof(WCHAR) + sizeof(ATOM); - } - else - { - Size += sizeof(WCHAR) + ClassName->Length + sizeof(WCHAR); - } - PackedmCs = ExAllocatePoolWithTag(PoolType, Size, TAG_MSG); - if (NULL == PackedmCs) - { - DPRINT1("Not enough memory to pack lParam\n"); - return STATUS_NO_MEMORY; - } - RtlCopyMemory(PackedmCs, UnpackedmCs, sizeof(MDICREATESTRUCTW)); - CsData = (PCHAR) (PackedmCs + 1); - PackedmCs->szTitle = (LPCWSTR) (CsData - (PCHAR) PackedmCs); - RtlCopyMemory(CsData, WindowName->Buffer, WindowName->Length); - CsData += WindowName->Length; - *((WCHAR *) CsData) = L'\0'; - CsData += sizeof(WCHAR); - PackedmCs->szClass = (LPCWSTR) (CsData - (PCHAR) PackedmCs); - if (IS_ATOM(ClassName->Buffer)) - { - *((WCHAR *) CsData) = L'A'; - CsData += sizeof(WCHAR); - *((ATOM *) CsData) = (ATOM)(DWORD_PTR) ClassName->Buffer; - CsData += sizeof(ATOM); - } - else - { - *((WCHAR *) CsData) = L'S'; - CsData += sizeof(WCHAR); - RtlCopyMemory(CsData, ClassName->Buffer, ClassName->Length); - CsData += ClassName->Length; - *((WCHAR *) CsData) = L'\0'; - CsData += sizeof(WCHAR); - } - ASSERT(CsData == (PCHAR) PackedmCs + Size); - *lParamPacked = (LPARAM) PackedmCs; - } else if (PoolType == NonPagedPool) { PMSGMEMORY MsgMemoryEntry; @@ -430,11 +366,6 @@ UnpackParam(LPARAM lParamPacked, UINT Msg, WPARAM wParam, LPARAM lParam, BOOL No return STATUS_SUCCESS; } - else if (WM_MDICREATE == Msg) - { - ExFreePool((PVOID) lParamPacked); - return STATUS_SUCCESS; - } else if (NonPagedPoolUsed) { PMSGMEMORY MsgMemoryEntry; @@ -1516,7 +1447,7 @@ co_IntSendMessageWithCallBack( HWND hWnd, if(!(Message = ExAllocatePoolWithTag(NonPagedPool, sizeof(USER_SENT_MESSAGE), TAG_USRMSG))) { DPRINT1("MsqSendMessage(): Not enough memory to allocate a message"); - return STATUS_INSUFFICIENT_RESOURCES; + RETURN( FALSE); } Message->Msg.hwnd = hWnd; @@ -1549,6 +1480,47 @@ CLEANUP: END_CLEANUP; } +/* This function posts a message if the destination's message queue belongs to +another thread, otherwise it sends the message. It does not support broadcast +messages! */ +LRESULT FASTCALL +co_IntPostOrSendMessage( HWND hWnd, + UINT Msg, + WPARAM wParam, + LPARAM lParam ) +{ + ULONG_PTR Result; + PTHREADINFO pti; + PWND Window; + + if ( hWnd == HWND_BROADCAST ) + { + return 0; + } + + if(!(Window = UserGetWindowObject(hWnd))) + { + return 0; + } + + pti = PsGetCurrentThreadWin32Thread(); + + if ( Window->head.pti->MessageQueue != pti->MessageQueue && + FindMsgMemory(Msg) == 0 ) + { + Result = UserPostMessage(hWnd, Msg, wParam, lParam); + } + else + { + if ( !co_IntSendMessageTimeoutSingle(hWnd, Msg, wParam, lParam, SMTO_NORMAL, 0, &Result) ) + { + Result = 0; + } + } + + return (LRESULT)Result; +} + LRESULT FASTCALL co_IntDoSendMessage( HWND hWnd, UINT Msg, @@ -1653,11 +1625,6 @@ UserSendNotifyMessage( HWND hWnd, for (i = 0; List[i]; i++) { Ret = UserSendNotifyMessage(List[i], Msg, wParam, lParam); - if (!Ret) - { - DPRINT1("SendNotifyMessage: Failed in Broadcast!\n"); - break; - } } ExFreePool(List); } @@ -1732,6 +1699,76 @@ IntUninitMessagePumpHook() /** Functions ******************************************************************/ +BOOL +APIENTRY +NtUserDragDetect( + HWND hWnd, + POINT pt) // Just like the User call. +{ + MSG msg; + RECT rect; + WORD wDragWidth, wDragHeight; + DECLARE_RETURN(BOOL); + + DPRINT("Enter NtUserDragDetect(%x)\n", hWnd); + UserEnterExclusive(); + + wDragWidth = UserGetSystemMetrics(SM_CXDRAG); + wDragHeight= UserGetSystemMetrics(SM_CYDRAG); + + rect.left = pt.x - wDragWidth; + rect.right = pt.x + wDragWidth; + + rect.top = pt.y - wDragHeight; + rect.bottom = pt.y + wDragHeight; + + co_UserSetCapture(hWnd); + + for (;;) + { + while (co_IntGetPeekMessage( &msg, 0, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE, FALSE ) || + co_IntGetPeekMessage( &msg, 0, WM_QUEUESYNC, WM_QUEUESYNC, PM_REMOVE, FALSE ) || + co_IntGetPeekMessage( &msg, 0, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE, FALSE ) ) + { + if ( msg.message == WM_LBUTTONUP ) + { + co_UserSetCapture(NULL); + RETURN( FALSE); + } + if ( msg.message == WM_MOUSEMOVE ) + { + POINT tmp; + tmp.x = (short)LOWORD(msg.lParam); + tmp.y = (short)HIWORD(msg.lParam); + if( !IntPtInRect( &rect, tmp ) ) + { + co_UserSetCapture(NULL); + RETURN( TRUE); + } + } + if ( msg.message == WM_KEYDOWN ) + { + if ( msg.wParam == VK_ESCAPE ) + { + co_UserSetCapture(NULL); + RETURN( TRUE); + } + } + if ( msg.message == WM_QUEUESYNC ) + { + co_HOOK_CallHooks( WH_CBT, HCBT_QS, 0, 0 ); + } + } + co_IntWaitMessage(NULL, 0, 0); + } + RETURN( FALSE); + +CLEANUP: + DPRINT("Leave NtUserDragDetect, ret=%i\n",_ret_); + UserLeave(); + END_CLEANUP; +} + BOOL APIENTRY NtUserPostMessage(HWND hWnd, UINT Msg, diff --git a/subsystems/win32/win32k/ntuser/monitor.c b/subsystems/win32/win32k/ntuser/monitor.c index d744d6ee563..935be89cf12 100644 --- a/subsystems/win32/win32k/ntuser/monitor.c +++ b/subsystems/win32/win32k/ntuser/monitor.c @@ -282,7 +282,10 @@ IntResetMonitorSize(IN PDEVOBJ *pGdiDevice) Monitor->rcWork = Monitor->rcMonitor; if (Monitor->hrgnMonitor) + { + GDIOBJ_SetOwnership(Monitor->hrgnMonitor, PsGetCurrentProcess()); REGION_FreeRgnByHandle(Monitor->hrgnMonitor); + } Monitor->hrgnMonitor = IntSysCreateRectRgnIndirect( &Monitor->rcMonitor ); diff --git a/subsystems/win32/win32k/ntuser/msgqueue.c b/subsystems/win32/win32k/ntuser/msgqueue.c index 6947db56004..f225950dfd6 100644 --- a/subsystems/win32/win32k/ntuser/msgqueue.c +++ b/subsystems/win32/win32k/ntuser/msgqueue.c @@ -279,18 +279,12 @@ co_MsqPostKeyboardMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) MSG Msg; LARGE_INTEGER LargeTickCount; KBDLLHOOKSTRUCT KbdHookData; - BOOLEAN Entered = FALSE; DPRINT("MsqPostKeyboardMessage(uMsg 0x%x, wParam 0x%x, lParam 0x%x)\n", uMsg, wParam, lParam); // Condition may arise when calling MsqPostMessage and waiting for an event. - if (!UserIsEntered()) - { - // Fixme: Not sure ATM if this thread is locked. - UserEnterExclusive(); - Entered = TRUE; - } + ASSERT(UserIsEntered()); FocusMessageQueue = IntGetFocusMessageQueue(); @@ -320,14 +314,12 @@ co_MsqPostKeyboardMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) { DPRINT1("Kbd msg %d wParam %d lParam 0x%08x dropped by WH_KEYBOARD_LL hook\n", Msg.message, Msg.wParam, Msg.lParam); - if (Entered) UserLeave(); return; } if (FocusMessageQueue == NULL) { DPRINT("No focus message queue\n"); - if (Entered) UserLeave(); return; } @@ -346,7 +338,6 @@ co_MsqPostKeyboardMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) DPRINT("Invalid focus window handle\n"); } - if (Entered) UserLeave(); return; } @@ -1093,7 +1084,7 @@ BOOL co_IntProcessMouseMessage(MSG* msg, BOOL* RemoveMessages, UINT first, UINT /* Activate the window if needed */ - if (msg->hwnd != MessageQueue->ActiveWindow) + if (msg->hwnd != UserGetForegroundWindow()) { PWND pwndTop = pwndMsg; while (pwndTop) diff --git a/subsystems/win32/win32k/ntuser/ntstubs.c b/subsystems/win32/win32k/ntuser/ntstubs.c index 5045718de8a..7d405821102 100644 --- a/subsystems/win32/win32k/ntuser/ntstubs.c +++ b/subsystems/win32/win32k/ntuser/ntstubs.c @@ -1272,17 +1272,6 @@ NtUserSetLayeredWindowAttributes(HWND hwnd, return FALSE; } -/* - * @unimplemented - */ -BOOL APIENTRY -NtUserSetLogonNotifyWindow(HWND hWnd) -{ - UNIMPLEMENTED - - return 0; -} - /* * @unimplemented */ @@ -1349,16 +1338,6 @@ NtUserResolveDesktopForWOW(DWORD Unknown0) return 0; } -BOOL -APIENTRY -NtUserDragDetect( - HWND hWnd, - POINT pt) // Just like the User call. -{ - UNIMPLEMENTED - return 0; -} - /* * @unimplemented */ diff --git a/subsystems/win32/win32k/ntuser/ntuser.c b/subsystems/win32/win32k/ntuser/ntuser.c index d28aa33e2e6..2e9d7eb9b47 100644 --- a/subsystems/win32/win32k/ntuser/ntuser.c +++ b/subsystems/win32/win32k/ntuser/ntuser.c @@ -38,7 +38,7 @@ InitUserAtoms(VOID) gpsi->atomSysClass[ICLS_SWITCH] = 32771; gpsi->atomSysClass[ICLS_ICONTITLE] = 32772; gpsi->atomSysClass[ICLS_TOOLTIPS] = 32774; - + /* System Message Atom */ AtomMessage = IntAddGlobalAtom(L"Message", TRUE); gpsi->atomSysClass[ICLS_HWNDMESSAGE] = AtomMessage; @@ -112,7 +112,7 @@ UserInitialize( // { GetW32ThreadInfo(); - + // Callback to User32 Client Thread Setup co_IntClientThreadSetup(); @@ -208,12 +208,14 @@ VOID FASTCALL UserEnterShared(VOID) VOID FASTCALL UserEnterExclusive(VOID) { + ASSERT_NOGDILOCKS(); KeEnterCriticalRegion(); ExAcquireResourceExclusiveLite(&UserLock, TRUE); } VOID FASTCALL UserLeave(VOID) { + ASSERT_NOGDILOCKS(); ExReleaseResourceLite(&UserLock); KeLeaveCriticalRegion(); } diff --git a/subsystems/win32/win32k/ntuser/painting.c b/subsystems/win32/win32k/ntuser/painting.c index c9bc3146a60..f2e3850437f 100644 --- a/subsystems/win32/win32k/ntuser/painting.c +++ b/subsystems/win32/win32k/ntuser/painting.c @@ -141,7 +141,7 @@ IntGetNCUpdateRgn(PWND Window, BOOL Validate) UINT RgnType; if (Window->hrgnUpdate != NULL && - Window->hrgnUpdate != (HRGN)1) + Window->hrgnUpdate != HRGN_WINDOW) { hRgnNonClient = IntCalcWindowRgn(Window, FALSE); @@ -151,14 +151,14 @@ IntGetNCUpdateRgn(PWND Window, BOOL Validate) */ if (hRgnNonClient == NULL) { - return (HRGN)1; + return HRGN_WINDOW; } hRgnWindow = IntCalcWindowRgn(Window, TRUE); if (hRgnWindow == NULL) { REGION_FreeRgnByHandle(hRgnNonClient); - return (HRGN)1; + return HRGN_WINDOW; } RgnType = NtGdiCombineRgn(hRgnNonClient, hRgnNonClient, @@ -167,7 +167,7 @@ IntGetNCUpdateRgn(PWND Window, BOOL Validate) { REGION_FreeRgnByHandle(hRgnWindow); REGION_FreeRgnByHandle(hRgnNonClient); - return (HRGN)1; + return HRGN_WINDOW; } else if (RgnType == NULLREGION) { @@ -307,9 +307,9 @@ co_IntPaintWindows(PWND Wnd, ULONG Flags, BOOL Recurse) /* * IntInvalidateWindows * - * Internal function used by IntRedrawWindow. + * Internal function used by IntRedrawWindow, UserRedrawDesktop, + * co_WinPosSetWindowPos, IntValidateParent, co_UserRedrawWindow. */ - VOID FASTCALL IntInvalidateWindows(PWND Wnd, HRGN hRgn, ULONG Flags) { @@ -759,7 +759,7 @@ IntPrintWindow( xSrc = 0; ySrc = 0; } - + // TODO: Setup Redirection for Print. return FALSE; @@ -1049,7 +1049,7 @@ NtUserGetUpdateRect(HWND hWnd, LPRECT UnsafeRect, BOOL bErase) else { /* Get the update region bounding box. */ - if (Window->hrgnUpdate == (HRGN)1) + if (Window->hrgnUpdate == HRGN_WINDOW) { Rect = Window->rcClient; } @@ -2065,7 +2065,7 @@ NtUserPrintWindow( HDC hdcBlt, UINT nFlags) { - PWND Window; + PWND Window; BOOL Ret = FALSE; UserEnterExclusive(); @@ -2075,7 +2075,7 @@ NtUserPrintWindow( Window = UserGetWindowObject(hwnd); // TODO: Add Desktop and MessageBox check via FNID's. if ( Window ) - { + { /* Validate flags and check it as a mask for 0 or 1. */ if ( (nFlags & PW_CLIENTONLY) == nFlags) Ret = IntPrintWindow( Window, hdcBlt, nFlags); diff --git a/subsystems/win32/win32k/ntuser/simplecall.c b/subsystems/win32/win32k/ntuser/simplecall.c index 941d31a4f63..2c4844f0e98 100644 --- a/subsystems/win32/win32k/ntuser/simplecall.c +++ b/subsystems/win32/win32k/ntuser/simplecall.c @@ -341,6 +341,9 @@ NtUserCallOneParam( } case ONEPARAM_ROUTINE_REPLYMESSAGE: RETURN (co_MsqReplyMessage((LRESULT) Param)); + case ONEPARAM_ROUTINE_MESSAGEBEEP: + RETURN ( UserPostMessage(hwndSAS, WM_LOGONNOTIFY, LN_MESSAGE_BEEP, Param) ); + /* TODO: Implement sound sentry */ } DPRINT1("Calling invalid routine number 0x%x in NtUserCallOneParam(), Param=0x%x\n", Routine, Param); @@ -364,7 +367,6 @@ NtUserCallTwoParam( DWORD_PTR Param2, DWORD Routine) { - NTSTATUS Status; PWND Window; DECLARE_RETURN(DWORD_PTR); @@ -373,29 +375,6 @@ NtUserCallTwoParam( switch(Routine) { - case TWOPARAM_ROUTINE_GETWINDOWRGNBOX: - { - DWORD_PTR Ret; - RECTL rcRect; - Window = UserGetWindowObject((HWND)Param1); - if (!Window) RETURN(ERROR); - - Ret = (DWORD_PTR)IntGetWindowRgnBox(Window, &rcRect); - Status = MmCopyToCaller((PVOID)Param2, &rcRect, sizeof(RECT)); - if(!NT_SUCCESS(Status)) - { - SetLastNtError(Status); - RETURN( ERROR); - } - RETURN( Ret); - } - case TWOPARAM_ROUTINE_GETWINDOWRGN: - { - Window = UserGetWindowObject((HWND)Param1); - if (!Window) RETURN(ERROR); - - RETURN( (DWORD_PTR)IntGetWindowRgn(Window, (HRGN)Param2)); - } case TWOPARAM_ROUTINE_SETMENUBARHEIGHT: { DWORD_PTR Ret; @@ -737,7 +716,7 @@ NtUserCallHwndParamLock( USER_REFERENCE_ENTRY Ref; DECLARE_RETURN(DWORD); - DPRINT1("Enter NtUserCallHwndParamLock\n"); + DPRINT("Enter NtUserCallHwndParamLock\n"); UserEnterExclusive(); if (!(Window = UserGetWindowObject(hWnd))) @@ -758,7 +737,7 @@ NtUserCallHwndParamLock( RETURN( Ret); CLEANUP: - DPRINT1("Leave NtUserCallHwndParamLock, ret=%i\n",_ret_); + DPRINT("Leave NtUserCallHwndParamLock, ret=%i\n",_ret_); UserLeave(); END_CLEANUP; diff --git a/subsystems/win32/win32k/ntuser/windc.c b/subsystems/win32/win32k/ntuser/windc.c index 89f44f76fe0..619f94b430a 100644 --- a/subsystems/win32/win32k/ntuser/windc.c +++ b/subsystems/win32/win32k/ntuser/windc.c @@ -551,7 +551,7 @@ UserGetDCEx(PWND Wnd OPTIONAL, HANDLE ClipRegion, ULONG Flags) ClipRegion = Wnd->hrgnUpdate; } - if (ClipRegion == (HRGN) 1) + if (ClipRegion == HRGN_WINDOW) { if (!(Flags & DCX_WINDOW)) { diff --git a/subsystems/win32/win32k/ntuser/window.c b/subsystems/win32/win32k/ntuser/window.c index 892ef7ac979..7be4ef57280 100644 --- a/subsystems/win32/win32k/ntuser/window.c +++ b/subsystems/win32/win32k/ntuser/window.c @@ -472,6 +472,7 @@ static LRESULT co_UserFreeWindow(PWND Window, if(Window->hrgnClip) { GreDeleteObject(Window->hrgnClip); + Window->hrgnClip = NULL; } // ASSERT(Window != NULL); @@ -4016,83 +4017,6 @@ CLEANUP: END_CLEANUP; } - -INT FASTCALL -IntGetWindowRgn(PWND Window, HRGN hRgn) -{ - INT Ret; - HRGN VisRgn; - ROSRGNDATA *pRgn; - - if(!Window) - { - return ERROR; - } - if(!hRgn) - { - return ERROR; - } - - /* Create a new window region using the window rectangle */ - VisRgn = IntSysCreateRectRgnIndirect(&Window->rcWindow); - NtGdiOffsetRgn(VisRgn, -Window->rcWindow.left, -Window->rcWindow.top); - /* if there's a region assigned to the window, combine them both */ - if(Window->hrgnClip && !(Window->style & WS_MINIMIZE)) - NtGdiCombineRgn(VisRgn, VisRgn, Window->hrgnClip, RGN_AND); - /* Copy the region into hRgn */ - NtGdiCombineRgn(hRgn, VisRgn, NULL, RGN_COPY); - - if((pRgn = RGNOBJAPI_Lock(hRgn, NULL))) - { - Ret = REGION_Complexity(pRgn); - RGNOBJAPI_Unlock(pRgn); - } - else - Ret = ERROR; - - REGION_FreeRgnByHandle(VisRgn); - - return Ret; -} - -INT FASTCALL -IntGetWindowRgnBox(PWND Window, RECTL *Rect) -{ - INT Ret; - HRGN VisRgn; - ROSRGNDATA *pRgn; - - if(!Window) - { - return ERROR; - } - if(!Rect) - { - return ERROR; - } - - /* Create a new window region using the window rectangle */ - VisRgn = IntSysCreateRectRgnIndirect(&Window->rcWindow); - NtGdiOffsetRgn(VisRgn, -Window->rcWindow.left, -Window->rcWindow.top); - /* if there's a region assigned to the window, combine them both */ - if(Window->hrgnClip && !(Window->style & WS_MINIMIZE)) - NtGdiCombineRgn(VisRgn, VisRgn, Window->hrgnClip, RGN_AND); - - if((pRgn = RGNOBJAPI_Lock(VisRgn, NULL))) - { - Ret = REGION_Complexity(pRgn); - *Rect = pRgn->rdh.rcBound; - RGNOBJAPI_Unlock(pRgn); - } - else - Ret = ERROR; - - REGION_FreeRgnByHandle(VisRgn); - - return Ret; -} - - /* * @implemented */ @@ -4104,6 +4028,8 @@ NtUserSetWindowRgn( { HRGN hrgnCopy; PWND Window; + INT flags = (SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE|SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOSIZE|SWP_NOMOVE); + BOOLEAN Ret = FALSE; DECLARE_RETURN(INT); DPRINT("Enter NtUserSetWindowRgn\n"); @@ -4119,32 +4045,36 @@ NtUserSetWindowRgn( if (GDIOBJ_ValidateHandle(hRgn, GDI_OBJECT_TYPE_REGION)) { hrgnCopy = IntSysCreateRectRgn(0, 0, 0, 0); + NtGdiCombineRgn(hrgnCopy, hRgn, 0, RGN_COPY); } else RETURN( 0); } else - hrgnCopy = (HRGN) 1; + { + hrgnCopy = NULL; + } if (Window->hrgnClip) { /* Delete no longer needed region handle */ GreDeleteObject(Window->hrgnClip); } + + if (hrgnCopy) + { + if (Window->fnid != FNID_DESKTOP) + NtGdiOffsetRgn(hrgnCopy, Window->rcWindow.left, Window->rcWindow.top); + + /* Set public ownership */ + IntGdiSetRegionOwner(hrgnCopy, GDI_OBJ_HMGR_PUBLIC); + } Window->hrgnClip = hrgnCopy; - /* FIXME - send WM_WINDOWPOSCHANGING and WM_WINDOWPOSCHANGED messages to the window */ + Ret = co_WinPosSetWindowPos(Window, HWND_TOP, 0, 0, 0, 0, bRedraw ? flags : (flags|SWP_NOREDRAW) ); - if(bRedraw) - { - USER_REFERENCE_ENTRY Ref; - UserRefObjectCo(Window, &Ref); - co_UserRedrawWindow(Window, NULL, NULL, RDW_INVALIDATE); - UserDerefObjectCo(Window); - } - - RETURN( (INT)hRgn); + RETURN( (INT)Ret); CLEANUP: DPRINT("Leave NtUserSetWindowRgn, ret=%i\n",_ret_); diff --git a/subsystems/win32/win32k/ntuser/winpos.c b/subsystems/win32/win32k/ntuser/winpos.c index 3099bee17ef..6a9dfd2b169 100644 --- a/subsystems/win32/win32k/ntuser/winpos.c +++ b/subsystems/win32/win32k/ntuser/winpos.c @@ -1120,7 +1120,7 @@ co_WinPosSetWindowPos( Window->style |= WS_VISIBLE; } - if (Window->hrgnUpdate != NULL && Window->hrgnUpdate != (HRGN)1) + if (Window->hrgnUpdate != NULL && Window->hrgnUpdate != HRGN_WINDOW) { NtGdiOffsetRgn(Window->hrgnUpdate, NewWindowRect.left - OldWindowRect.left, diff --git a/subsystems/win32/win32k/ntuser/winsta.c b/subsystems/win32/win32k/ntuser/winsta.c index d6e5a0fe446..ff429a17524 100644 --- a/subsystems/win32/win32k/ntuser/winsta.c +++ b/subsystems/win32/win32k/ntuser/winsta.c @@ -43,6 +43,9 @@ /* Currently active window station */ PWINSTATION_OBJECT InputWindowStation = NULL; +/* Winlogon sas window*/ +HWND hwndSAS = NULL; + /* INITALIZATION FUNCTIONS ****************************************************/ static GENERIC_MAPPING IntWindowStationMapping = @@ -1455,4 +1458,25 @@ NtUserBuildNameList( BuildDesktopNameList(hWindowStation, dwSize, lpBuffer, pRequiredSize); } +/* + * @implemented + */ +BOOL APIENTRY +NtUserSetLogonNotifyWindow(HWND hWnd) +{ + if(LogonProcess != PsGetCurrentProcessWin32Process()) + { + return FALSE; + } + + if(!IntIsWindow(hWnd)) + { + return FALSE; + } + + hwndSAS = hWnd; + + return TRUE; +} + /* EOF */ diff --git a/subsystems/win32/win32k/objects/bitblt.c b/subsystems/win32/win32k/objects/bitblt.c index f4843c2c0b2..1fa1d550027 100644 --- a/subsystems/win32/win32k/objects/bitblt.c +++ b/subsystems/win32/win32k/objects/bitblt.c @@ -23,7 +23,11 @@ #define NDEBUG #include +#define ROP_USES_SOURCE(Rop) (((((Rop) & 0xCC0000) >> 2) != ((Rop) & 0x330000)) || ((((Rop) & 0xCC000000) >> 2) != ((Rop) & 0x33000000))) +#define ROP_USES_MASK(Rop) (((Rop) & 0xFF000000) != (((Rop) & 0xff0000) << 8)) +#define FIXUP_ROP(Rop) if(((Rop) & 0xFF000000) == 0) Rop = MAKEROP4((Rop), (Rop)) +#define ROP_TO_ROP4(Rop) ((Rop) >> 16) BOOL APIENTRY NtGdiAlphaBlend( @@ -169,144 +173,21 @@ NtGdiBitBlt( IN DWORD crBackColor, IN FLONG fl) { - PDC DCDest; - PDC DCSrc = NULL; - HDC ahDC[2]; - PGDIOBJ apObj[2]; - PDC_ATTR pdcattr = NULL; - SURFACE *BitmapDest, *BitmapSrc = NULL; - RECTL DestRect, SourceRect; - POINTL SourcePoint; - BOOL Status = FALSE; - EXLATEOBJ exlo; - XLATEOBJ *XlateObj = NULL; - BOOL UsesSource = ROP3_USES_SOURCE(ROP); - - DPRINT("Locking DCs\n"); - ahDC[0] = hDCDest; - ahDC[1] = hDCSrc ; - GDIOBJ_LockMultipleObjs(2, ahDC, apObj); - DCDest = apObj[0]; - DCSrc = apObj[1]; - - if (NULL == DCDest) - { - if(DCSrc) GDIOBJ_UnlockObjByPtr(&DCSrc->BaseObject); - DPRINT("Invalid destination dc handle (0x%08x) passed to NtGdiBitBlt\n", hDCDest); - return FALSE; - } - - if (DCDest->dctype == DC_TYPE_INFO) - { - if(DCSrc) GDIOBJ_UnlockObjByPtr(&DCSrc->BaseObject); - GDIOBJ_UnlockObjByPtr(&DCDest->BaseObject); - /* Yes, Windows really returns TRUE in this case */ - return TRUE; - } - - if (UsesSource) - { - if (NULL == DCSrc) - { - GDIOBJ_UnlockObjByPtr(&DCDest->BaseObject); - DPRINT("Invalid source dc handle (0x%08x) passed to NtGdiBitBlt\n", hDCSrc); - return FALSE; - } - if (DCSrc->dctype == DC_TYPE_INFO) - { - GDIOBJ_UnlockObjByPtr(&DCDest->BaseObject); - GDIOBJ_UnlockObjByPtr(&DCSrc->BaseObject); - /* Yes, Windows really returns TRUE in this case */ - return TRUE; - } - } - else if(DCSrc) - { - DPRINT1("Getting a valid Source handle without using source!!!\n"); - GDIOBJ_UnlockObjByPtr(&DCSrc->BaseObject); - DCSrc = NULL ; - } - - pdcattr = DCDest->pdcattr; - - DestRect.left = XDest; - DestRect.top = YDest; - DestRect.right = XDest+Width; - DestRect.bottom = YDest+Height; - IntLPtoDP(DCDest, (LPPOINT)&DestRect, 2); - - DestRect.left += DCDest->ptlDCOrig.x; - DestRect.top += DCDest->ptlDCOrig.y; - DestRect.right += DCDest->ptlDCOrig.x; - DestRect.bottom += DCDest->ptlDCOrig.y; - - SourcePoint.x = XSrc; - SourcePoint.y = YSrc; - - if (UsesSource) - { - IntLPtoDP(DCSrc, (LPPOINT)&SourcePoint, 1); - - SourcePoint.x += DCSrc->ptlDCOrig.x; - SourcePoint.y += DCSrc->ptlDCOrig.y; - /* Calculate Source Rect */ - SourceRect.left = SourcePoint.x; - SourceRect.top = SourcePoint.y; - SourceRect.right = SourcePoint.x + DestRect.right - DestRect.left; - SourceRect.bottom = SourcePoint.y + DestRect.bottom - DestRect.top ; - } - - /* Prepare blit */ - DC_vPrepareDCsForBlit(DCDest, DestRect, DCSrc, SourceRect); - - if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY)) - DC_vUpdateFillBrush(DCDest); - - /* Determine surfaces to be used in the bitblt */ - BitmapDest = DCDest->dclevel.pSurface; - if (!BitmapDest) - goto cleanup; - - if (UsesSource) - { - { - BitmapSrc = DCSrc->dclevel.pSurface; - if (!BitmapSrc) - goto cleanup; - } - } - - /* Create the XLATEOBJ. */ - if (UsesSource) - { - EXLATEOBJ_vInitXlateFromDCs(&exlo, DCSrc, DCDest); - XlateObj = &exlo.xlo; - } - - /* Perform the bitblt operation */ - Status = IntEngBitBlt(&BitmapDest->SurfObj, - BitmapSrc ? &BitmapSrc->SurfObj : NULL, - NULL, - DCDest->rosdc.CombinedClip, - XlateObj, - &DestRect, - &SourcePoint, - NULL, - &DCDest->eboFill.BrushObject, - &DCDest->dclevel.pbrFill->ptOrigin, - ROP3_TO_ROP4(ROP)); - - if (UsesSource) - EXLATEOBJ_vCleanup(&exlo); -cleanup: - DC_vFinishBlit(DCDest, DCSrc); - if (UsesSource) - { - GDIOBJ_UnlockObjByPtr(&DCSrc->BaseObject); - } - GDIOBJ_UnlockObjByPtr(&DCDest->BaseObject); - - return Status; + /* Forward to NtGdiMaskBlt */ + // TODO : what's fl for? + return NtGdiMaskBlt(hDCDest, + XDest, + YDest, + Width, + Height, + hDCSrc, + XSrc, + YSrc, + NULL, + 0, + 0, + ROP, + crBackColor); } BOOL APIENTRY @@ -414,86 +295,6 @@ done: return Ret; } -/*********************************************************************** -* MaskBlt -* Ported from WINE by sedwards 11-4-03 -* -* Someone thought it would be faster to do it here and then switch back -* to GDI32. I dunno. Write a test and let me know. -* A. It should be in here! -*/ - -static const DWORD ROP3Table[256] = -{ - 0x000042, 0x010289, 0x020C89, 0x0300AA, 0x040C88, 0x0500A9, 0x060865, 0x0702C5, - 0x080F08, 0x090245, 0x0A0329, 0x0B0B2A, 0x0C0324, 0x0D0B25, 0x0E08A5, 0x0F0001, - 0x100C85, 0x1100A6, 0x120868, 0x1302C8, 0x140869, 0x1502C9, 0x165CCA, 0x171D54, - 0x180D59, 0x191CC8, 0x1A06C5, 0x1B0768, 0x1C06CA, 0x1D0766, 0x1E01A5, 0x1F0385, - 0x200F09, 0x210248, 0x220326, 0x230B24, 0x240D55, 0x251CC5, 0x2606C8, 0x271868, - 0x280369, 0x2916CA, 0x2A0CC9, 0x2B1D58, 0x2C0784, 0x2D060A, 0x2E064A, 0x2F0E2A, - 0x30032A, 0x310B28, 0x320688, 0x330008, 0x3406C4, 0x351864, 0x3601A8, 0x370388, - 0x38078A, 0x390604, 0x3A0644, 0x3B0E24, 0x3C004A, 0x3D18A4, 0x3E1B24, 0x3F00EA, - 0x400F0A, 0x410249, 0x420D5D, 0x431CC4, 0x440328, 0x450B29, 0x4606C6, 0x47076A, - 0x480368, 0x4916C5, 0x4A0789, 0x4B0605, 0x4C0CC8, 0x4D1954, 0x4E0645, 0x4F0E25, - 0x500325, 0x510B26, 0x5206C9, 0x530764, 0x5408A9, 0x550009, 0x5601A9, 0x570389, - 0x580785, 0x590609, 0x5A0049, 0x5B18A9, 0x5C0649, 0x5D0E29, 0x5E1B29, 0x5F00E9, - 0x600365, 0x6116C6, 0x620786, 0x630608, 0x640788, 0x650606, 0x660046, 0x6718A8, - 0x6858A6, 0x690145, 0x6A01E9, 0x6B178A, 0x6C01E8, 0x6D1785, 0x6E1E28, 0x6F0C65, - 0x700CC5, 0x711D5C, 0x720648, 0x730E28, 0x740646, 0x750E26, 0x761B28, 0x7700E6, - 0x7801E5, 0x791786, 0x7A1E29, 0x7B0C68, 0x7C1E24, 0x7D0C69, 0x7E0955, 0x7F03C9, - 0x8003E9, 0x810975, 0x820C49, 0x831E04, 0x840C48, 0x851E05, 0x8617A6, 0x8701C5, - 0x8800C6, 0x891B08, 0x8A0E06, 0x8B0666, 0x8C0E08, 0x8D0668, 0x8E1D7C, 0x8F0CE5, - 0x900C45, 0x911E08, 0x9217A9, 0x9301C4, 0x9417AA, 0x9501C9, 0x960169, 0x97588A, - 0x981888, 0x990066, 0x9A0709, 0x9B07A8, 0x9C0704, 0x9D07A6, 0x9E16E6, 0x9F0345, - 0xA000C9, 0xA11B05, 0xA20E09, 0xA30669, 0xA41885, 0xA50065, 0xA60706, 0xA707A5, - 0xA803A9, 0xA90189, 0xAA0029, 0xAB0889, 0xAC0744, 0xAD06E9, 0xAE0B06, 0xAF0229, - 0xB00E05, 0xB10665, 0xB21974, 0xB30CE8, 0xB4070A, 0xB507A9, 0xB616E9, 0xB70348, - 0xB8074A, 0xB906E6, 0xBA0B09, 0xBB0226, 0xBC1CE4, 0xBD0D7D, 0xBE0269, 0xBF08C9, - 0xC000CA, 0xC11B04, 0xC21884, 0xC3006A, 0xC40E04, 0xC50664, 0xC60708, 0xC707AA, - 0xC803A8, 0xC90184, 0xCA0749, 0xCB06E4, 0xCC0020, 0xCD0888, 0xCE0B08, 0xCF0224, - 0xD00E0A, 0xD1066A, 0xD20705, 0xD307A4, 0xD41D78, 0xD50CE9, 0xD616EA, 0xD70349, - 0xD80745, 0xD906E8, 0xDA1CE9, 0xDB0D75, 0xDC0B04, 0xDD0228, 0xDE0268, 0xDF08C8, - 0xE003A5, 0xE10185, 0xE20746, 0xE306EA, 0xE40748, 0xE506E5, 0xE61CE8, 0xE70D79, - 0xE81D74, 0xE95CE6, 0xEA02E9, 0xEB0849, 0xEC02E8, 0xED0848, 0xEE0086, 0xEF0A08, - 0xF00021, 0xF10885, 0xF20B05, 0xF3022A, 0xF40B0A, 0xF50225, 0xF60265, 0xF708C5, - 0xF802E5, 0xF90845, 0xFA0089, 0xFB0A09, 0xFC008A, 0xFD0A0A, 0xFE02A9, 0xFF0062, -}; - -static __inline BYTE -SwapROP3_SrcDst(BYTE bRop3) -{ - return (bRop3 & 0x99) | ((bRop3 & 0x22) << 1) | ((bRop3 & 0x44) >> 1); -} - -#define FRGND_ROP3(ROP4) ((ROP4) & 0x00FFFFFF) -#define BKGND_ROP3(ROP4) (ROP3Table[(SwapROP3_SrcDst((ROP4)>>24)) & 0xFF]) -#define DSTCOPY 0x00AA0029 -#define DSTERASE 0x00220326 /* dest = dest & (~src) : DSna */ - -/* NOTE: An alternative algorithm could use a pattern brush, created from - * the mask bitmap and then use raster operation 0xCA to combine the fore - * and background bitmaps. In this case erasing the bits beforehand would be - * unneccessary. On the other hand the Operation does not provide an optimized - * version in the DIB code, while SRCAND and SRCPAINT do. - * A fully correct implementation would call Eng/DrvBitBlt, but our - * EngBitBlt completely ignores the mask surface. - * - * Msk Fg Bk => x - * P S D DPSDxax - * ------------------------------------------ - * 0 0 0 0 0000xax = 000ax = 00x = 0 - * 0 0 1 1 1001xax = 101ax = 10x = 1 - * 0 1 0 0 0010xax = 001ax = 00x = 0 - * 0 1 1 1 1011xax = 100ax = 10x = 1 - * 1 0 0 0 0100xax = 010ax = 00x = 0 - * 1 0 1 0 1101xax = 111ax = 11x = 0 - * 1 1 0 1 0110xax = 011ax = 01x = 1 - * 1 1 1 1 1111xax = 110ax = 10x = 1 - * - * Operation index = 11001010 = 0xCA = PSaDPnao = DPSDxax - * ^ no, this is not random letters, its reverse Polish notation - */ - BOOL APIENTRY NtGdiMaskBlt( HDC hdcDest, @@ -510,97 +311,188 @@ NtGdiMaskBlt( DWORD dwRop, IN DWORD crBackColor) { - HBITMAP hbmFore, hbmBack; - HDC hdcMask, hdcFore, hdcBack; - PDC pdc; - HBRUSH hbr; - COLORREF crFore, crBack; + PDC DCDest; + PDC DCSrc = NULL; + HDC ahDC[2]; + PGDIOBJ apObj[2]; + PDC_ATTR pdcattr = NULL; + SURFACE *BitmapDest, *BitmapSrc = NULL, *psurfMask = NULL; + RECTL DestRect, SourceRect; + POINTL SourcePoint, MaskPoint; + BOOL Status = FALSE; + EXLATEOBJ exlo; + XLATEOBJ *XlateObj = NULL; + BOOL UsesSource = ROP_USES_SOURCE(dwRop); + BOOL UsesMask; - if (!hbmMask) - return NtGdiBitBlt(hdcDest, - nXDest, - nYDest, - nWidth, - nHeight, - hdcSrc, - nXSrc, - nYSrc, - FRGND_ROP3(dwRop), - crBackColor, - 0); + FIXUP_ROP(dwRop); - /* Lock the dest DC */ - pdc = DC_LockDc(hdcDest); - if (!pdc) return FALSE; + UsesMask = ROP_USES_MASK(dwRop); - /* Get brush and colors from dest dc */ - hbr = pdc->pdcattr->hbrush; - crFore = pdc->pdcattr->crForegroundClr; - crBack = pdc->pdcattr->crBackgroundClr; + //DPRINT1("dwRop : 0x%08x\n", dwRop); - /* Unlock the DC */ - DC_UnlockDc(pdc); + /* Take care of mask bitmap */ + if(hbmMask) + { + psurfMask = SURFACE_LockSurface(hbmMask); + if(!psurfMask) + { + EngSetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + } - /* 1. Create mask bitmap's dc */ - hdcMask = NtGdiCreateCompatibleDC(hdcDest); - NtGdiSelectBitmap(hdcMask, hbmMask); + if(UsesMask) + { + if(!psurfMask) + { + EngSetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + if(gajBitsPerFormat[psurfMask->SurfObj.iBitmapFormat] != 1) + { + EngSetLastError(ERROR_INVALID_PARAMETER); + SURFACE_UnlockSurface(psurfMask); + return FALSE; + } + } + else if(psurfMask) + { + DPRINT1("Getting Mask bitmap without needing it?\n"); + SURFACE_UnlockSurface(psurfMask); + psurfMask = NULL; + } + MaskPoint.x = xMask; + MaskPoint.y = yMask; - /* 2. Create masked Background bitmap */ + /* Take care of source and destination bitmap */ + DPRINT("Locking DCs\n"); + ahDC[0] = hdcDest; + ahDC[1] = hdcSrc ; + GDIOBJ_LockMultipleObjs(2, ahDC, apObj); + DCDest = apObj[0]; + DCSrc = apObj[1]; - /* 2.1 Create bitmap */ - hdcBack = NtGdiCreateCompatibleDC(hdcDest); - hbmBack = NtGdiCreateCompatibleBitmap(hdcDest, nWidth, nHeight); - NtGdiSelectBitmap(hdcBack, hbmBack); + if (NULL == DCDest) + { + if(DCSrc) DC_UnlockDc(DCSrc); + DPRINT("Invalid destination dc handle (0x%08x) passed to NtGdiBitBlt\n", hdcDest); + return FALSE; + } - /* 2.2 Copy source bitmap */ - NtGdiSelectBrush(hdcBack, hbr); - IntGdiSetBkColor(hdcBack, crBack); - IntGdiSetTextColor(hdcBack, crFore); - NtGdiBitBlt(hdcBack, 0, 0, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, SRCCOPY, 0, 0); + if (DCDest->dctype == DC_TYPE_INFO) + { + if(DCSrc) DC_UnlockDc(DCSrc); + DC_UnlockDc(DCDest); + /* Yes, Windows really returns TRUE in this case */ + return TRUE; + } - /* 2.3 Do the background rop */ - NtGdiBitBlt(hdcBack, 0, 0, nWidth, nHeight, hdcDest, nXDest, nYDest, BKGND_ROP3(dwRop), 0, 0); + if (UsesSource) + { + if (NULL == DCSrc) + { + DC_UnlockDc(DCDest); + DPRINT("Invalid source dc handle (0x%08x) passed to NtGdiBitBlt\n", hdcSrc); + return FALSE; + } + if (DCSrc->dctype == DC_TYPE_INFO) + { + DC_UnlockDc(DCDest); + DC_UnlockDc(DCSrc); + /* Yes, Windows really returns TRUE in this case */ + return TRUE; + } + } + else if(DCSrc) + { + DPRINT("Getting a valid Source handle without using source!!!\n"); + DC_UnlockDc(DCSrc); + DCSrc = NULL ; + } - /* 2.4 Erase the foreground pixels */ - IntGdiSetBkColor(hdcBack, 0xffffffff); - IntGdiSetTextColor(hdcBack, 0); - NtGdiBitBlt(hdcBack, 0, 0, nWidth, nHeight, hdcMask, xMask, yMask, SRCAND, 0, 0); + pdcattr = DCDest->pdcattr; - /* 3. Create masked Foreground bitmap */ + DestRect.left = nXDest; + DestRect.top = nYDest; + DestRect.right = nXDest + nWidth; + DestRect.bottom = nYDest + nHeight; + IntLPtoDP(DCDest, (LPPOINT)&DestRect, 2); - /* 3.1 Create bitmap */ - hdcFore = NtGdiCreateCompatibleDC(hdcDest); - hbmFore = NtGdiCreateCompatibleBitmap(hdcDest, nWidth, nHeight); - NtGdiSelectBitmap(hdcFore, hbmFore); + DestRect.left += DCDest->ptlDCOrig.x; + DestRect.top += DCDest->ptlDCOrig.y; + DestRect.right += DCDest->ptlDCOrig.x; + DestRect.bottom += DCDest->ptlDCOrig.y; - /* 3.2 Copy the dest bitmap */ - NtGdiSelectBrush(hdcFore, hbr); - IntGdiSetBkColor(hdcFore, crBack); - IntGdiSetTextColor(hdcFore, crFore); - NtGdiBitBlt(hdcFore, 0, 0, nWidth, nHeight, hdcDest, nXDest, nYDest, SRCCOPY, 0, 0); + SourcePoint.x = nXSrc; + SourcePoint.y = nYSrc; - /* 2.3 Do the foreground rop */ - NtGdiBitBlt(hdcFore, 0, 0, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, FRGND_ROP3(dwRop), 0,0); + if (UsesSource) + { + IntLPtoDP(DCSrc, (LPPOINT)&SourcePoint, 1); - /* 2.4 Erase the background pixels */ - IntGdiSetBkColor(hdcFore, 0); - IntGdiSetTextColor(hdcFore, 0xffffffff); - NtGdiBitBlt(hdcFore, 0, 0, nWidth, nHeight, hdcMask, xMask, yMask, SRCAND, 0, 0); + SourcePoint.x += DCSrc->ptlDCOrig.x; + SourcePoint.y += DCSrc->ptlDCOrig.y; + /* Calculate Source Rect */ + SourceRect.left = SourcePoint.x; + SourceRect.top = SourcePoint.y; + SourceRect.right = SourcePoint.x + DestRect.right - DestRect.left; + SourceRect.bottom = SourcePoint.y + DestRect.bottom - DestRect.top ; + } - /* 3. Combine the fore and background into the background bitmap */ - NtGdiBitBlt(hdcBack, 0, 0, nWidth, nHeight, hdcFore, 0, 0, SRCPAINT, 0, 0); + /* Prepare blit */ + DC_vPrepareDCsForBlit(DCDest, DestRect, DCSrc, SourceRect); - /* 4. Copy the result to hdcDest */ - NtGdiBitBlt(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcBack, 0, 0, SRCCOPY, 0, 0); + if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY)) + DC_vUpdateFillBrush(DCDest); - /* 5. delete all temp objects */ - NtGdiDeleteObjectApp(hdcBack); - NtGdiDeleteObjectApp(hdcFore); - NtGdiDeleteObjectApp(hdcMask); - GreDeleteObject(hbmFore); - GreDeleteObject(hbmBack); + /* Determine surfaces to be used in the bitblt */ + BitmapDest = DCDest->dclevel.pSurface; + if (!BitmapDest) + goto cleanup; - return TRUE; + if (UsesSource) + { + { + BitmapSrc = DCSrc->dclevel.pSurface; + if (!BitmapSrc) + goto cleanup; + } + } + + /* Create the XLATEOBJ. */ + if (UsesSource) + { + EXLATEOBJ_vInitXlateFromDCs(&exlo, DCSrc, DCDest); + XlateObj = &exlo.xlo; + } + + + /* Perform the bitblt operation */ + Status = IntEngBitBlt(&BitmapDest->SurfObj, + BitmapSrc ? &BitmapSrc->SurfObj : NULL, + psurfMask ? &psurfMask->SurfObj : NULL, + DCDest->rosdc.CombinedClip, + XlateObj, + &DestRect, + &SourcePoint, + &MaskPoint, + &DCDest->eboFill.BrushObject, + &DCDest->dclevel.pbrFill->ptOrigin, + ROP_TO_ROP4(dwRop)); + + if (UsesSource) + EXLATEOBJ_vCleanup(&exlo); +cleanup: + DC_vFinishBlit(DCDest, DCSrc); + if (UsesSource) + { + DC_UnlockDc(DCSrc); + } + DC_UnlockDc(DCDest); + if(psurfMask) SURFACE_UnlockSurface(psurfMask); + + return Status; } BOOL @@ -655,7 +547,9 @@ GreStretchBltMask( EXLATEOBJ exlo; XLATEOBJ *XlateObj = NULL; POINTL BrushOrigin; - BOOL UsesSource = ROP3_USES_SOURCE(ROP); + BOOL UsesSource = ROP_USES_SOURCE(ROP); + + FIXUP_ROP(ROP); if (0 == WidthDest || 0 == HeightDest || 0 == WidthSrc || 0 == HeightSrc) { @@ -803,7 +697,7 @@ GreStretchBltMask( BitmapMask ? &MaskPoint : NULL, &DCDest->eboFill.BrushObject, &BrushOrigin, - ROP3_TO_ROP4(ROP)); + ROP_TO_ROP4(ROP)); if (UsesSource) { EXLATEOBJ_vCleanup(&exlo); @@ -877,6 +771,8 @@ IntPatBlt( ASSERT(pbrush); + FIXUP_ROP(dwRop); + if (pbrush->flAttrs & GDIBRUSH_IS_NULL) { return TRUE; @@ -934,7 +830,7 @@ IntPatBlt( NULL, &eboFill.BrushObject, &BrushOrigin, - ROP3_TO_ROP4(dwRop)); + ROP_TO_ROP4(dwRop)); DC_vFinishBlit(pdc, NULL); @@ -1007,7 +903,7 @@ NtGdiPatBlt( PDC_ATTR pdcattr; BOOL ret; - BOOL UsesSource = ROP3_USES_SOURCE(ROP); + BOOL UsesSource = ROP_USES_SOURCE(ROP); if (UsesSource) { /* in this case we call on GdiMaskBlt */ diff --git a/subsystems/win32/win32k/objects/bitmaps.c b/subsystems/win32/win32k/objects/bitmaps.c index 23e8c395b7d..f97462594bd 100644 --- a/subsystems/win32/win32k/objects/bitmaps.c +++ b/subsystems/win32/win32k/objects/bitmaps.c @@ -82,8 +82,6 @@ GreCreateBitmapEx( PSURFACE psurf; SURFOBJ *pso; HBITMAP hbmp; - PVOID pvCompressedBits; - SIZEL sizl; /* Verify format */ if (iFormat < BMF_1BPP || iFormat > BMF_PNG) return NULL; @@ -103,22 +101,31 @@ GreCreateBitmapEx( /* The infamous RLE hack */ if (iFormat == BMF_4RLE || iFormat == BMF_8RLE) { + PVOID pvCompressedBits; + SIZEL sizl; + LONG lDelta; + sizl.cx = nWidth; sizl.cy = nHeight; + lDelta = WIDTH_BYTES_ALIGN32(nWidth, gajBitsPerFormat[iFormat]); + pvCompressedBits = pvBits; - pvBits = EngAllocMem(FL_ZERO_MEMORY, pso->cjBits, TAG_DIB); + pvBits = EngAllocMem(FL_ZERO_MEMORY, lDelta * nHeight, TAG_DIB); if (!pvBits) { EngSetLastError(ERROR_NOT_ENOUGH_MEMORY); SURFACE_FreeSurfaceByHandle(hbmp); return NULL; } - DecompressBitmap(sizl, pvCompressedBits, pvBits, pso->lDelta, iFormat); + DecompressBitmap(sizl, pvCompressedBits, pvBits, lDelta, iFormat); fjBitmap |= BMF_RLE_HACK; + + iFormat = iFormat == BMF_4RLE ? BMF_4BPP : BMF_8BPP; + psurf->SurfObj.iBitmapFormat = iFormat; } - /* Mark as API bitmap */ - psurf->flags |= (flags | API_BITMAP); + /* Mark as API bitmap */ + psurf->flags |= (flags | API_BITMAP); /* Set the bitmap bits */ if (!SURFACE_bSetBitmapBits(psurf, fjBitmap, cjWidthBytes, pvBits)) @@ -226,116 +233,111 @@ IntCreateCompatibleBitmap( /* MS doc says if width or height is 0, return 1-by-1 pixel, monochrome bitmap */ if (0 == Width || 0 == Height) { - Bmp = NtGdiGetStockObject(DEFAULT_BITMAP); + return NtGdiGetStockObject(DEFAULT_BITMAP); + } + + if (Dc->dctype != DC_TYPE_MEMORY) + { + PSURFACE psurf; + + Bmp = GreCreateBitmap(abs(Width), + abs(Height), + 1, + Dc->ppdev->gdiinfo.cBitsPixel, + NULL); + psurf = SURFACE_ShareLockSurface(Bmp); + ASSERT(psurf); + /* Set palette */ + psurf->ppal = PALETTE_ShareLockPalette(Dc->ppdev->devinfo.hpalDefault); + /* Set flags */ + psurf->flags = API_BITMAP; + psurf->hdc = NULL; // Fixme + SURFACE_ShareUnlockSurface(psurf); } else { - if (Dc->dctype != DC_TYPE_MEMORY) + DIBSECTION dibs; + INT Count; + PSURFACE psurf = Dc->dclevel.pSurface; + Count = BITMAP_GetObject(psurf, sizeof(dibs), &dibs); + + if (Count == sizeof(BITMAP)) { - PSURFACE psurf; + PSURFACE psurfBmp; Bmp = GreCreateBitmap(abs(Width), - abs(Height), - 1, - Dc->ppdev->gdiinfo.cBitsPixel, - NULL); - psurf = SURFACE_LockSurface(Bmp); - ASSERT(psurf); - /* Set palette */ - psurf->ppal = PALETTE_ShareLockPalette(Dc->ppdev->devinfo.hpalDefault); + abs(Height), + 1, + dibs.dsBm.bmBitsPixel, + NULL); + psurfBmp = SURFACE_LockSurface(Bmp); + ASSERT(psurfBmp); + /* Assign palette */ + psurfBmp->ppal = psurf->ppal; + GDIOBJ_IncrementShareCount((POBJ)psurf->ppal); /* Set flags */ - psurf->flags = API_BITMAP; - psurf->hdc = NULL; // Fixme - SURFACE_UnlockSurface(psurf); + psurfBmp->flags = API_BITMAP; + psurfBmp->hdc = NULL; // Fixme + SURFACE_UnlockSurface(psurfBmp); } - else + else if (Count == sizeof(DIBSECTION)) { - DIBSECTION dibs; - INT Count; - PSURFACE psurf = Dc->dclevel.pSurface; - Count = BITMAP_GetObject(psurf, sizeof(dibs), &dibs); + /* A DIB section is selected in the DC */ + BYTE buf[sizeof(BITMAPINFOHEADER) + 256*sizeof(RGBQUAD)] = {0}; + PVOID Bits; + BITMAPINFO* bi = (BITMAPINFO*)buf; - if (Count) + bi->bmiHeader.biSize = sizeof(bi->bmiHeader); + bi->bmiHeader.biWidth = Width; + bi->bmiHeader.biHeight = Height; + bi->bmiHeader.biPlanes = dibs.dsBmih.biPlanes; + bi->bmiHeader.biBitCount = dibs.dsBmih.biBitCount; + bi->bmiHeader.biCompression = dibs.dsBmih.biCompression; + bi->bmiHeader.biSizeImage = 0; + bi->bmiHeader.biXPelsPerMeter = dibs.dsBmih.biXPelsPerMeter; + bi->bmiHeader.biYPelsPerMeter = dibs.dsBmih.biYPelsPerMeter; + bi->bmiHeader.biClrUsed = dibs.dsBmih.biClrUsed; + bi->bmiHeader.biClrImportant = dibs.dsBmih.biClrImportant; + + if (bi->bmiHeader.biCompression == BI_BITFIELDS) { - if (Count == sizeof(BITMAP)) - { - PSURFACE psurfBmp; - - Bmp = GreCreateBitmap(abs(Width), - abs(Height), - 1, - dibs.dsBm.bmBitsPixel, - NULL); - psurfBmp = SURFACE_LockSurface(Bmp); - ASSERT(psurfBmp); - /* Assign palette */ - psurfBmp->ppal = psurf->ppal; - GDIOBJ_IncrementShareCount((POBJ)psurf->ppal); - /* Set flags */ - psurfBmp->flags = API_BITMAP; - psurfBmp->hdc = NULL; // Fixme - SURFACE_UnlockSurface(psurfBmp); - } - else - { - /* A DIB section is selected in the DC */ - BYTE buf[sizeof(BITMAPINFOHEADER) + 256*sizeof(RGBQUAD)] = {0}; - PVOID Bits; - BITMAPINFO* bi = (BITMAPINFO*)buf; - - bi->bmiHeader.biSize = sizeof(bi->bmiHeader); - bi->bmiHeader.biWidth = Width; - bi->bmiHeader.biHeight = Height; - bi->bmiHeader.biPlanes = dibs.dsBmih.biPlanes; - bi->bmiHeader.biBitCount = dibs.dsBmih.biBitCount; - bi->bmiHeader.biCompression = dibs.dsBmih.biCompression; - bi->bmiHeader.biSizeImage = 0; - bi->bmiHeader.biXPelsPerMeter = dibs.dsBmih.biXPelsPerMeter; - bi->bmiHeader.biYPelsPerMeter = dibs.dsBmih.biYPelsPerMeter; - bi->bmiHeader.biClrUsed = dibs.dsBmih.biClrUsed; - bi->bmiHeader.biClrImportant = dibs.dsBmih.biClrImportant; - - if (bi->bmiHeader.biCompression == BI_BITFIELDS) - { - /* Copy the color masks */ - RtlCopyMemory(bi->bmiColors, dibs.dsBitfields, 3*sizeof(RGBQUAD)); - } - else if (bi->bmiHeader.biBitCount <= 8) - { - /* Copy the color table */ - UINT Index; - PPALETTE PalGDI; - - if (!psurf->ppal) - { - EngSetLastError(ERROR_INVALID_HANDLE); - return 0; - } - - PalGDI = PALETTE_LockPalette(psurf->ppal->BaseObject.hHmgr); - - for (Index = 0; - Index < 256 && Index < PalGDI->NumColors; - Index++) - { - bi->bmiColors[Index].rgbRed = PalGDI->IndexedColors[Index].peRed; - bi->bmiColors[Index].rgbGreen = PalGDI->IndexedColors[Index].peGreen; - bi->bmiColors[Index].rgbBlue = PalGDI->IndexedColors[Index].peBlue; - bi->bmiColors[Index].rgbReserved = 0; - } - PALETTE_UnlockPalette(PalGDI); - - Bmp = DIB_CreateDIBSection(Dc, - bi, - DIB_RGB_COLORS, - &Bits, - NULL, - 0, - 0); - return Bmp; - } - } + /* Copy the color masks */ + RtlCopyMemory(bi->bmiColors, dibs.dsBitfields, 3*sizeof(RGBQUAD)); } + else if (bi->bmiHeader.biBitCount <= 8) + { + /* Copy the color table */ + UINT Index; + PPALETTE PalGDI; + + if (!psurf->ppal) + { + EngSetLastError(ERROR_INVALID_HANDLE); + return 0; + } + + PalGDI = PALETTE_LockPalette(psurf->ppal->BaseObject.hHmgr); + + for (Index = 0; + Index < 256 && Index < PalGDI->NumColors; + Index++) + { + bi->bmiColors[Index].rgbRed = PalGDI->IndexedColors[Index].peRed; + bi->bmiColors[Index].rgbGreen = PalGDI->IndexedColors[Index].peGreen; + bi->bmiColors[Index].rgbBlue = PalGDI->IndexedColors[Index].peBlue; + bi->bmiColors[Index].rgbReserved = 0; + } + PALETTE_UnlockPalette(PalGDI); + } + + Bmp = DIB_CreateDIBSection(Dc, + bi, + DIB_RGB_COLORS, + &Bits, + NULL, + 0, + 0); + return Bmp; } } return Bmp; @@ -438,7 +440,8 @@ NtGdiGetPixel(HDC hDC, INT XPos, INT YPos) XPos += dc->ptlDCOrig.x; YPos += dc->ptlDCOrig.y; - if (RECTL_bPointInRect(&dc->rosdc.CombinedClip->rclBounds, XPos, YPos)) + if ((dc->rosdc.CombinedClip == NULL) || + (RECTL_bPointInRect(&dc->rosdc.CombinedClip->rclBounds, XPos, YPos))) { bInRect = TRUE; psurf = dc->dclevel.pSurface; @@ -841,7 +844,7 @@ BITMAP_CopyBitmap(HBITMAP hBitmap) return 0; } - Bitmap = SURFACE_LockSurface(hBitmap); + Bitmap = SURFACE_ShareLockSurface(hBitmap); if (Bitmap == NULL) { return 0; @@ -866,11 +869,14 @@ BITMAP_CopyBitmap(HBITMAP hBitmap) if (res) { - resBitmap = SURFACE_LockSurface(res); + resBitmap = SURFACE_ShareLockSurface(res); if (resBitmap) { IntSetBitmapBits(resBitmap, Bitmap->SurfObj.cjBits, Bitmap->SurfObj.pvBits); - SURFACE_UnlockSurface(resBitmap); + GDIOBJ_IncrementShareCount(&Bitmap->ppal->BaseObject); + GDIOBJ_ShareUnlockObjByPtr(&resBitmap->ppal->BaseObject); + resBitmap->ppal = Bitmap->ppal; + SURFACE_ShareUnlockSurface(resBitmap); } else { @@ -879,7 +885,7 @@ BITMAP_CopyBitmap(HBITMAP hBitmap) } } - SURFACE_UnlockSurface(Bitmap); + SURFACE_ShareUnlockSurface(Bitmap); return res; } @@ -919,36 +925,47 @@ BITMAP_GetObject(SURFACE *psurf, INT Count, LPVOID buffer) pds->dsBmih.biHeight = pds->dsBm.bmHeight; pds->dsBmih.biPlanes = pds->dsBm.bmPlanes; pds->dsBmih.biBitCount = pds->dsBm.bmBitsPixel; - if(psurf->ppal->flFlags & PAL_BITFIELDS) - { - pds->dsBmih.biCompression = BI_BITFIELDS; - } - else - { - switch (psurf->SurfObj.iBitmapFormat) - { - case BMF_1BPP: - case BMF_4BPP: - case BMF_8BPP: - case BMF_16BPP: - case BMF_24BPP: - case BMF_32BPP: - pds->dsBmih.biCompression = BI_RGB; - break; - case BMF_4RLE: - pds->dsBmih.biCompression = BI_RLE4; - break; - case BMF_8RLE: - pds->dsBmih.biCompression = BI_RLE8; - break; - case BMF_JPEG: - pds->dsBmih.biCompression = BI_JPEG; - break; - case BMF_PNG: - pds->dsBmih.biCompression = BI_PNG; - break; - } - } + + switch (psurf->SurfObj.iBitmapFormat) + { + case BMF_1BPP: + case BMF_4BPP: + case BMF_8BPP: + pds->dsBmih.biCompression = BI_RGB; + break; + + case BMF_16BPP: + if (psurf->ppal->flFlags & PAL_RGB16_555) + pds->dsBmih.biCompression = BI_RGB; + else + pds->dsBmih.biCompression = BI_BITFIELDS; + break; + + case BMF_24BPP: + case BMF_32BPP: + /* 24/32bpp BI_RGB is actually BGR format */ + if (psurf->ppal->flFlags & PAL_BGR) + pds->dsBmih.biCompression = BI_RGB; + else + pds->dsBmih.biCompression = BI_BITFIELDS; + break; + + case BMF_4RLE: + pds->dsBmih.biCompression = BI_RLE4; + break; + case BMF_8RLE: + pds->dsBmih.biCompression = BI_RLE8; + break; + case BMF_JPEG: + pds->dsBmih.biCompression = BI_JPEG; + break; + case BMF_PNG: + pds->dsBmih.biCompression = BI_PNG; + break; + default: + ASSERT(FALSE); /* this shouldn't happen */ + } + pds->dsBmih.biSizeImage = psurf->SurfObj.cjBits; pds->dsBmih.biXPelsPerMeter = 0; pds->dsBmih.biYPelsPerMeter = 0; diff --git a/subsystems/win32/win32k/objects/brush.c b/subsystems/win32/win32k/objects/brush.c index aa1c3480737..5ad5f0764bf 100644 --- a/subsystems/win32/win32k/objects/brush.c +++ b/subsystems/win32/win32k/objects/brush.c @@ -394,7 +394,7 @@ IntGdiCreateSolidBrush( pbrush->flAttrs |= GDIBRUSH_IS_SOLID; - pbrush->BrushAttr.lbColor = Color; + pbrush->BrushAttr.lbColor = Color & 0x00FFFFFF; /* FIXME: Fill in the rest of fields!!! */ BRUSH_UnlockBrush(pbrush); diff --git a/subsystems/win32/win32k/objects/dclife.c b/subsystems/win32/win32k/objects/dclife.c index 108762e1ff2..7d6d330e708 100644 --- a/subsystems/win32/win32k/objects/dclife.c +++ b/subsystems/win32/win32k/objects/dclife.c @@ -480,6 +480,15 @@ DC_vPrepareDCsForBlit(PDC pdc1, { PDC pdcFirst, pdcSecond; PRECT prcFirst, prcSecond; + + /* Update brushes */ + if (pdc1->pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY)) + DC_vUpdateFillBrush(pdc1); + if (pdc1->pdcattr->ulDirty_ & (DIRTY_LINE | DC_PEN_DIRTY)) + DC_vUpdateLineBrush(pdc1); + if(pdc1->pdcattr->ulDirty_ & DIRTY_TEXT) + DC_vUpdateTextBrush(pdc1); + /* Lock them in good order */ if(pdc2) { @@ -502,7 +511,8 @@ DC_vPrepareDCsForBlit(PDC pdc1, { pdcFirst = pdc1 ; prcFirst = &rc1; - pdcSecond = NULL ; + pdcSecond = NULL; + prcSecond = NULL; } if(pdcFirst && pdcFirst->dctype == DCTYPE_DIRECT) diff --git a/subsystems/win32/win32k/objects/dcobjs.c b/subsystems/win32/win32k/objects/dcobjs.c index 75cde4146ab..7e6870be76f 100644 --- a/subsystems/win32/win32k/objects/dcobjs.c +++ b/subsystems/win32/win32k/objects/dcobjs.c @@ -179,6 +179,11 @@ GdiSelectPalette( DIRTY_BACKGROUND | DIRTY_TEXT; } + if(pdc->dctype == DCTYPE_MEMORY) + { + IntGdiRealizePalette(pdc); + } + PALETTE_ShareUnlockPalette(ppal); DC_UnlockDc(pdc); @@ -251,89 +256,119 @@ NtGdiSelectPen( HBITMAP APIENTRY NtGdiSelectBitmap( - IN HDC hDC, - IN HBITMAP hBmp) + IN HDC hdc, + IN HBITMAP hbmp) { - PDC pDC; + PDC pdc; PDC_ATTR pdcattr; - HBITMAP hOrgBmp; - PSURFACE psurfBmp, psurfOld; + HBITMAP hbmpOld; + PSURFACE psurfNew; HRGN hVisRgn; + SIZEL sizlBitmap = {1, 1}; + HDC hdcOld; + ASSERT_NOGDILOCKS(); - if (hDC == NULL || hBmp == NULL) return NULL; + /* Verify parameters */ + if (hdc == NULL || hbmp == NULL) return NULL; - pDC = DC_LockDc(hDC); - if (!pDC) + /* First lock the DC */ + pdc = DC_LockDc(hdc); + if (!pdc) { return NULL; } - pdcattr = pDC->pdcattr; + pdcattr = pdc->pdcattr; - /* must be memory dc to select bitmap */ - if (pDC->dctype != DC_TYPE_MEMORY) + /* Must be a memory dc to select a bitmap */ + if (pdc->dctype != DC_TYPE_MEMORY) { - DC_UnlockDc(pDC); + DC_UnlockDc(pdc); return NULL; } - psurfBmp = SURFACE_LockSurface(hBmp); - if (!psurfBmp) + /* Check if there was a bitmap selected before */ + if (pdc->dclevel.pSurface) { - DC_UnlockDc(pDC); - return NULL; + /* Return its handle */ + hbmpOld = pdc->dclevel.pSurface->BaseObject.hHmgr; + } + else + { + /* Return default bitmap */ + hbmpOld = StockObjects[DEFAULT_BITMAP]; } - /* Get the handle for the old bitmap */ - ASSERT(pDC->dclevel.pSurface); - hOrgBmp = pDC->dclevel.pSurface->BaseObject.hHmgr; + /* Check if the default bitmap was passed */ + if (hbmp == StockObjects[DEFAULT_BITMAP]) + { + psurfNew = NULL; - /* Lock it, to be sure while we mess with it*/ - psurfOld = SURFACE_LockSurface(hOrgBmp); + // HACK + psurfNew = SURFACE_ShareLockSurface(hbmp); + } + else + { + /* Reference the new bitmap and check if it's valid */ + psurfNew = SURFACE_ShareLockSurface(hbmp); + if (!psurfNew) + { + DC_UnlockDc(pdc); + return NULL; + } - /* Reset hdc, this surface isn't selected anymore */ - psurfOld->hdc = NULL; + /* Set the bitmp's hdc */ + hdcOld = InterlockedCompareExchangePointer((PVOID*)&psurfNew->hdc, hdc, 0); + if (hdcOld != NULL && hdcOld != hdc) + { + /* The bitmap is already selected, fail */ + SURFACE_ShareUnlockSurface(psurfNew); + DC_UnlockDc(pdc); + return NULL; + } - /* Release the old bitmap, reference the new */ - DC_vSelectSurface(pDC, psurfBmp); + /* Get the bitmap size */ + sizlBitmap = psurfNew->SurfObj.sizlBitmap; - /* And unlock it, now we're done */ - SURFACE_UnlockSurface(psurfOld); + /* Check if the bitmap is a dibsection */ + if(psurfNew->hSecure) + { + /* Set DIBSECTION attribute */ + pdcattr->ulDirty_ |= DC_DIBSECTION; + } + else + { + pdcattr->ulDirty_ &= ~DC_DIBSECTION; + } + } - // If Info DC this is zero and pSurface is moved to DC->pSurfInfo. - psurfBmp->hdc = hDC; + /* Select the new surface, release the old */ + DC_vSelectSurface(pdc, psurfNew); + /* Set the new size */ + pdc->dclevel.sizl = sizlBitmap; + + /* Release one reference we added */ + SURFACE_ShareUnlockSurface(psurfNew); + + /* Mark the dc brushes invalid */ + pdcattr->ulDirty_ |= DIRTY_FILL | DIRTY_LINE; + + /* Unlock the DC */ + DC_UnlockDc(pdc); /* FIXME; improve by using a region without a handle and selecting it */ hVisRgn = IntSysCreateRectRgn( 0, 0, - psurfBmp->SurfObj.sizlBitmap.cx, - psurfBmp->SurfObj.sizlBitmap.cy); - - if(psurfBmp->hSecure) - { - /* Set DIBSECTION attribute */ - pdcattr->ulDirty_ |= DC_DIBSECTION; - } - else - { - pdcattr->ulDirty_ &= ~DC_DIBSECTION; - } - - /* Release the exclusive lock */ - SURFACE_UnlockSurface(psurfBmp); - - /* Mark the brushes invalid */ - pdcattr->ulDirty_ |= DIRTY_FILL | DIRTY_LINE; - - DC_UnlockDc(pDC); - + sizlBitmap.cx, + sizlBitmap.cy); if (hVisRgn) { - GdiSelectVisRgn(hDC, hVisRgn); + GdiSelectVisRgn(hdc, hVisRgn); REGION_FreeRgnByHandle(hVisRgn); } - return hOrgBmp; + /* Return the old bitmp handle */ + return hbmpOld; } diff --git a/subsystems/win32/win32k/objects/dcutil.c b/subsystems/win32/win32k/objects/dcutil.c index 4b172c01892..ba220929134 100644 --- a/subsystems/win32/win32k/objects/dcutil.c +++ b/subsystems/win32/win32k/objects/dcutil.c @@ -540,6 +540,7 @@ NtGdiSetBoundsRect( } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { + DC_UnlockDc(pdc); _SEH2_YIELD(return 0;) } _SEH2_END; @@ -550,6 +551,6 @@ NtGdiSetBoundsRect( if (flags & DCB_ENABLE) pdc->fs |= DC_ACCUM_APP; if (flags & DCB_DISABLE) pdc->fs &= ~DC_ACCUM_APP; - DC_UnlockDc( pdc ); + DC_UnlockDc(pdc); return ret; } diff --git a/subsystems/win32/win32k/objects/dibobj.c b/subsystems/win32/win32k/objects/dibobj.c index 6ab2f6cd306..2fe1e4ccb00 100644 --- a/subsystems/win32/win32k/objects/dibobj.c +++ b/subsystems/win32/win32k/objects/dibobj.c @@ -22,8 +22,9 @@ #define NDEBUG #include -static const RGBQUAD EGAColorsQuads[16] = { -/* rgbBlue, rgbGreen, rgbRed, rgbReserved */ +static const RGBQUAD EGAColorsQuads[16] = +{ + /* rgbBlue, rgbGreen, rgbRed, rgbReserved */ { 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x80, 0x00 }, { 0x00, 0x80, 0x00, 0x00 }, @@ -42,8 +43,9 @@ static const RGBQUAD EGAColorsQuads[16] = { { 0xff, 0xff, 0xff, 0x00 } }; -static const RGBTRIPLE EGAColorsTriples[16] = { -/* rgbBlue, rgbGreen, rgbRed */ +static const RGBTRIPLE EGAColorsTriples[16] = +{ + /* rgbBlue, rgbGreen, rgbRed */ { 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x80 }, { 0x00, 0x80, 0x00 }, @@ -62,8 +64,9 @@ static const RGBTRIPLE EGAColorsTriples[16] = { { 0xff, 0xff, 0xff } }; -static const RGBQUAD DefLogPaletteQuads[20] = { /* Copy of Default Logical Palette */ -/* rgbBlue, rgbGreen, rgbRed, rgbReserved */ +static const RGBQUAD DefLogPaletteQuads[20] = /* Copy of Default Logical Palette */ +{ + /* rgbBlue, rgbGreen, rgbRed, rgbReserved */ { 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x80, 0x00 }, { 0x00, 0x80, 0x00, 0x00 }, @@ -86,8 +89,9 @@ static const RGBQUAD DefLogPaletteQuads[20] = { /* Copy of Default Logical Palet { 0xff, 0xff, 0xff, 0x00 } }; -static const RGBQUAD DefLogPaletteTriples[20] = { /* Copy of Default Logical Palette */ -/* rgbBlue, rgbGreen, rgbRed, rgbReserved */ +static const RGBQUAD DefLogPaletteTriples[20] = /* Copy of Default Logical Palette */ +{ + /* rgbBlue, rgbGreen, rgbRed, rgbReserved */ { 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x80 }, { 0x00, 0x80, 0x00 }, @@ -163,8 +167,8 @@ IntSetDIBColorTable( PalGDI = PALETTE_LockPalette(psurf->ppal->BaseObject.hHmgr); for (Index = StartIndex; - Index < StartIndex + Entries && Index < PalGDI->NumColors; - Index++) + Index < StartIndex + Entries && Index < PalGDI->NumColors; + Index++) { PalGDI->IndexedColors[Index].peRed = Colors[Index - StartIndex].rgbRed; PalGDI->IndexedColors[Index].peGreen = Colors[Index - StartIndex].rgbGreen; @@ -193,9 +197,8 @@ IntGetDIBColorTable( { PDC dc; PSURFACE psurf; - PPALETTE PalGDI; + PPALETTE ppal; UINT Index, Count = 0; - ULONG biBitCount; if (!(dc = DC_LockDc(hDC))) return 0; if (dc->dctype == DC_TYPE_INFO) @@ -219,33 +222,22 @@ IntGetDIBColorTable( return 0; } - biBitCount = BitsPerFormat(psurf->SurfObj.iBitmapFormat); - if (biBitCount <= 8 && - StartIndex < (1 << biBitCount)) + ppal = psurf->ppal; + ASSERT(ppal); + + if (ppal->flFlags & PAL_INDEXED) { - if (StartIndex + Entries > (1 << biBitCount)) - Entries = (1 << biBitCount) - StartIndex; - - if (psurf->ppal == NULL) - { - DC_UnlockDc(dc); - EngSetLastError(ERROR_INVALID_HANDLE); - return 0; - } - - PalGDI = PALETTE_LockPalette(psurf->ppal->BaseObject.hHmgr); for (Index = StartIndex; - Index < StartIndex + Entries && Index < PalGDI->NumColors; - Index++) + Index < StartIndex + Entries && Index < ppal->NumColors; + Index++) { - Colors[Index - StartIndex].rgbRed = PalGDI->IndexedColors[Index].peRed; - Colors[Index - StartIndex].rgbGreen = PalGDI->IndexedColors[Index].peGreen; - Colors[Index - StartIndex].rgbBlue = PalGDI->IndexedColors[Index].peBlue; + Colors[Index - StartIndex].rgbRed = ppal->IndexedColors[Index].peRed; + Colors[Index - StartIndex].rgbGreen = ppal->IndexedColors[Index].peGreen; + Colors[Index - StartIndex].rgbBlue = ppal->IndexedColors[Index].peBlue; Colors[Index - StartIndex].rgbReserved = 0; Count++; } - PALETTE_UnlockPalette(PalGDI); } DC_UnlockDc(dc); @@ -266,66 +258,66 @@ IntSetDIBits( UINT ColorUse) { HBITMAP SourceBitmap; - PSURFACE psurfDst, psurfSrc; + PSURFACE psurfDst, psurfSrc; INT result = 0; - RECT rcDst; - POINTL ptSrc; - PVOID pvBits; - EXLATEOBJ exlo; + RECT rcDst; + POINTL ptSrc; + PVOID pvBits; + EXLATEOBJ exlo; SourceBitmap = DIB_CreateDIBSection(DC, bmi, ColorUse, &pvBits, NULL, 0, 0); - if (0 == SourceBitmap) + if (0 == SourceBitmap) { - DPRINT1("Error : Could not create a DIBSection.\n"); + DPRINT1("Error : Could not create a DIBSection.\n"); EngSetLastError(ERROR_NO_SYSTEM_RESOURCES); return 0; } - RtlCopyMemory(pvBits, Bits, DIB_GetDIBImageBytes(bmi->bmiHeader.biWidth, - bmi->bmiHeader.biHeight, - bmi->bmiHeader.biBitCount)); + RtlCopyMemory(pvBits, Bits, DIB_GetDIBImageBytes(bmi->bmiHeader.biWidth, + bmi->bmiHeader.biHeight, + bmi->bmiHeader.biBitCount)); - psurfDst = SURFACE_LockSurface(hBitmap); - psurfSrc = SURFACE_LockSurface(SourceBitmap); + psurfDst = SURFACE_LockSurface(hBitmap); + psurfSrc = SURFACE_LockSurface(SourceBitmap); - if(!(psurfSrc && psurfDst)) - { - DPRINT1("Error, could not lock surfaces\n"); - goto cleanup; - } + if(!(psurfSrc && psurfDst)) + { + DPRINT1("Error, could not lock surfaces\n"); + goto cleanup; + } - rcDst.top = bmi->bmiHeader.biHeight < 0 ? - abs(bmi->bmiHeader.biHeight) - (ScanLines + StartScan) : StartScan; - rcDst.left = 0; - rcDst.bottom = rcDst.top + ScanLines; - rcDst.right = psurfDst->SurfObj.sizlBitmap.cx; + rcDst.top = StartScan; + rcDst.left = 0; + rcDst.bottom = rcDst.top + ScanLines; + rcDst.right = psurfDst->SurfObj.sizlBitmap.cx; - ptSrc.x = 0; - ptSrc.y = 0; + ptSrc.x = 0; + ptSrc.y = 0; - EXLATEOBJ_vInitialize(&exlo, psurfSrc->ppal, psurfDst->ppal, 0, 0, 0); + /* 1bpp bitmaps have 0 for white, 1 for black */ + EXLATEOBJ_vInitialize(&exlo, psurfSrc->ppal, psurfDst->ppal, 0xFFFFFF, 0xFFFFFF, 0); - result = IntEngCopyBits(&psurfDst->SurfObj, - &psurfSrc->SurfObj, - NULL, - &exlo.xlo, - &rcDst, - &ptSrc); - if(result) - result = ScanLines; + result = IntEngCopyBits(&psurfDst->SurfObj, + &psurfSrc->SurfObj, + NULL, + &exlo.xlo, + &rcDst, + &ptSrc); + if(result) + result = ScanLines; - EXLATEOBJ_vCleanup(&exlo); + EXLATEOBJ_vCleanup(&exlo); cleanup: - if(psurfSrc) - { - SURFACE_UnlockSurface(psurfSrc); - } - if(psurfDst) - { - SURFACE_UnlockSurface(psurfDst); - } - GreDeleteObject(SourceBitmap); + if(psurfSrc) + { + SURFACE_UnlockSurface(psurfSrc); + } + if(psurfDst) + { + SURFACE_UnlockSurface(psurfDst); + } + GreDeleteObject(SourceBitmap); return result; } @@ -344,7 +336,7 @@ NtGdiSetDIBits( CONST BITMAPINFO *bmi, UINT ColorUse) { - PDC Dc; + PDC Dc = NULL; INT Ret; NTSTATUS Status = STATUS_SUCCESS; @@ -353,13 +345,13 @@ NtGdiSetDIBits( _SEH2_TRY { ProbeForRead(&bmi->bmiHeader.biSize, sizeof(DWORD), 1); - ProbeForRead(bmi, bmi->bmiHeader.biSize, 1); - ProbeForRead(bmi, DIB_BitmapInfoSize(bmi, ColorUse), 1); + ProbeForRead(bmi, bmi->bmiHeader.biSize, 1); + ProbeForRead(bmi, DIB_BitmapInfoSize(bmi, ColorUse), 1); ProbeForRead(Bits, - DIB_GetDIBImageBytes(bmi->bmiHeader.biWidth, - ScanLines, - bmi->bmiHeader.biBitCount), - 1); + DIB_GetDIBImageBytes(bmi->bmiHeader.biWidth, + ScanLines, + bmi->bmiHeader.biBitCount), + 1); } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { @@ -372,21 +364,25 @@ NtGdiSetDIBits( return 0; } - Dc = DC_LockDc(hDC); - if (NULL == Dc) + /* Lock DC if asked to */ + if(ColorUse == DIB_PAL_COLORS) { - EngSetLastError(ERROR_INVALID_HANDLE); - return 0; - } - if (Dc->dctype == DC_TYPE_INFO) - { - DC_UnlockDc(Dc); - return 0; + Dc = DC_LockDc(hDC); + if (NULL == Dc) + { + EngSetLastError(ERROR_INVALID_HANDLE); + return 0; + } + if (Dc->dctype == DC_TYPE_INFO) + { + DC_UnlockDc(Dc); + return 0; + } } Ret = IntSetDIBits(Dc, hBitmap, StartScan, ScanLines, Bits, bmi, ColorUse); - DC_UnlockDc(Dc); + if(Dc) DC_UnlockDc(Dc); return Ret; } @@ -466,7 +462,7 @@ NtGdiSetDIBitsToDeviceInternal( rcDest.top = YDest; if (bTransformCoordinates) { - CoordLPtoDP(pDC, (LPPOINT)&rcDest); + IntLPtoDP(pDC, (LPPOINT)&rcDest, 2); } rcDest.left += pDC->ptlDCOrig.x; rcDest.top += pDC->ptlDCOrig.y; @@ -482,12 +478,16 @@ NtGdiSetDIBitsToDeviceInternal( DIBWidth = WIDTH_BYTES_ALIGN32(SourceSize.cx, bmi->bmiHeader.biBitCount); - hSourceBitmap = EngCreateBitmap(SourceSize, - DIBWidth, - BitmapFormat(bmi->bmiHeader.biBitCount, - bmi->bmiHeader.biCompression), - bmi->bmiHeader.biHeight < 0 ? BMF_TOPDOWN : 0, - (PVOID) Bits); + hSourceBitmap = GreCreateBitmapEx(bmi->bmiHeader.biWidth, + ScanLines, + 0, + BitmapFormat(bmi->bmiHeader.biBitCount, + bmi->bmiHeader.biCompression), + bmi->bmiHeader.biHeight < 0 ? BMF_TOPDOWN : 0, + bmi->bmiHeader.biSizeImage, + Bits, + 0); + if (!hSourceBitmap) { EngSetLastError(ERROR_NO_SYSTEM_RESOURCES); @@ -523,12 +523,17 @@ NtGdiSetDIBitsToDeviceInternal( } /* Initialize EXLATEOBJ */ - EXLATEOBJ_vInitialize(&exlo, ppalDIB, pSurf->ppal, 0, 0, 0); + EXLATEOBJ_vInitialize(&exlo, + ppalDIB, + pSurf->ppal, + RGB(0xff, 0xff, 0xff), + pDC->pdcattr->crBackgroundClr, + pDC->pdcattr->crForegroundClr); /* Copy the bits */ DPRINT("BitsToDev with dstsurf=(%d|%d) (%d|%d), src=(%d|%d) w=%d h=%d\n", - rcDest.left, rcDest.top, rcDest.right, rcDest.bottom, - ptSource.x, ptSource.y, SourceSize.cx, SourceSize.cy); + rcDest.left, rcDest.top, rcDest.right, rcDest.bottom, + ptSource.x, ptSource.y, SourceSize.cx, SourceSize.cy); Status = IntEngBitBlt(pDestSurf, pSourceSurf, NULL, @@ -539,7 +544,7 @@ NtGdiSetDIBitsToDeviceInternal( NULL, NULL, NULL, - ROP3_TO_ROP4(SRCCOPY)); + ROP4_FROM_INDEX(R3_OPINDEX_SRCCOPY)); /* Cleanup EXLATEOBJ */ EXLATEOBJ_vCleanup(&exlo); @@ -575,17 +580,17 @@ NtGdiGetDIBitsInternal( UINT MaxBits, UINT MaxInfo) { - BITMAPCOREINFO* pbmci = NULL; - PSURFACE psurf = NULL; - PDC pDC; - LONG width, height; - WORD planes, bpp; - DWORD compr, size ; - int i, bitmap_type; - RGBTRIPLE* rgbTriples; - RGBQUAD* rgbQuads; - VOID* colorPtr; - NTSTATUS Status = STATUS_SUCCESS; + BITMAPCOREINFO* pbmci = NULL; + PSURFACE psurf = NULL; + PDC pDC; + LONG width, height; + WORD planes, bpp; + DWORD compr, size ; + int i, bitmap_type; + RGBTRIPLE* rgbTriples; + RGBQUAD* rgbQuads; + VOID* colorPtr; + NTSTATUS Status = STATUS_SUCCESS; DPRINT("Entered NtGdiGetDIBitsInternal()\n"); @@ -594,9 +599,9 @@ NtGdiGetDIBitsInternal( _SEH2_TRY { - /* Probe for read and write */ + /* Probe for read and write */ ProbeForRead(Info, MaxInfo, 1); - ProbeForWrite(Info, MaxInfo, 1); + ProbeForWrite(Info, MaxInfo, 1); if (Bits) ProbeForWrite(Bits, MaxBits, 1); } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) @@ -610,163 +615,165 @@ NtGdiGetDIBitsInternal( return 0; } - colorPtr = (LPBYTE)Info + Info->bmiHeader.biSize; - rgbTriples = colorPtr; - rgbQuads = colorPtr; + colorPtr = (LPBYTE)Info + Info->bmiHeader.biSize; + rgbTriples = colorPtr; + rgbQuads = colorPtr; - bitmap_type = DIB_GetBitmapInfo(&Info->bmiHeader, - &width, - &height, - &planes, - &bpp, - &compr, - &size); - if(bitmap_type == -1) - { - DPRINT("Wrong bitmap format\n"); - EngSetLastError(ERROR_INVALID_PARAMETER); - return 0; - } - else if(bitmap_type == 0) - { - /* We need a BITMAPINFO to create a DIB, but we have to fill - * the BITMAPCOREINFO we're provided */ - pbmci = (BITMAPCOREINFO*)Info; - Info = DIB_ConvertBitmapInfo((BITMAPINFO*)pbmci, Usage); - if(Info == NULL) - { - DPRINT1("Error, could not convert the BITMAPCOREINFO!\n"); - return 0; - } - rgbQuads = Info->bmiColors; - } + bitmap_type = DIB_GetBitmapInfo(&Info->bmiHeader, + &width, + &height, + &planes, + &bpp, + &compr, + &size); + if(bitmap_type == -1) + { + DPRINT("Wrong bitmap format\n"); + EngSetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + else if(bitmap_type == 0) + { + /* We need a BITMAPINFO to create a DIB, but we have to fill + * the BITMAPCOREINFO we're provided */ + pbmci = (BITMAPCOREINFO*)Info; + Info = DIB_ConvertBitmapInfo((BITMAPINFO*)pbmci, Usage); + if(Info == NULL) + { + DPRINT1("Error, could not convert the BITMAPCOREINFO!\n"); + return 0; + } + rgbQuads = Info->bmiColors; + } pDC = DC_LockDc(hDC); if (pDC == NULL || pDC->dctype == DC_TYPE_INFO) { - ScanLines = 0; + ScanLines = 0; goto done; } /* Get a pointer to the source bitmap object */ - psurf = SURFACE_LockSurface(hBitmap); + psurf = SURFACE_ShareLockSurface(hBitmap); if (psurf == NULL) { ScanLines = 0; goto done; } - /* Fill in the structure */ - switch(bpp) - { - case 0: /* Only info */ - if(pbmci) - { - pbmci->bmciHeader.bcWidth = psurf->SurfObj.sizlBitmap.cx; - pbmci->bmciHeader.bcHeight = (psurf->SurfObj.fjBitmap & BMF_TOPDOWN) ? - -psurf->SurfObj.sizlBitmap.cy : - psurf->SurfObj.sizlBitmap.cy; - pbmci->bmciHeader.bcPlanes = 1; - pbmci->bmciHeader.bcBitCount = BitsPerFormat(psurf->SurfObj.iBitmapFormat); - } - Info->bmiHeader.biWidth = psurf->SurfObj.sizlBitmap.cx; - Info->bmiHeader.biHeight = (psurf->SurfObj.fjBitmap & BMF_TOPDOWN) ? - -psurf->SurfObj.sizlBitmap.cy : - psurf->SurfObj.sizlBitmap.cy;; - Info->bmiHeader.biPlanes = 1; - Info->bmiHeader.biBitCount = BitsPerFormat(psurf->SurfObj.iBitmapFormat); - Info->bmiHeader.biSizeImage = DIB_GetDIBImageBytes( Info->bmiHeader.biWidth, - Info->bmiHeader.biHeight, - Info->bmiHeader.biBitCount); - if(psurf->hSecure) - { - switch(Info->bmiHeader.biBitCount) - { - case 16: - case 32: - Info->bmiHeader.biCompression = BI_BITFIELDS; - break; - default: - Info->bmiHeader.biCompression = BI_RGB; - break; - } - } - else if(Info->bmiHeader.biBitCount > 8) - { - Info->bmiHeader.biCompression = BI_BITFIELDS; - } - else - { - Info->bmiHeader.biCompression = BI_RGB; - } - Info->bmiHeader.biXPelsPerMeter = 0; + /* Fill in the structure */ + switch(bpp) + { + case 0: /* Only info */ + if(pbmci) + { + pbmci->bmciHeader.bcWidth = psurf->SurfObj.sizlBitmap.cx; + pbmci->bmciHeader.bcHeight = (psurf->SurfObj.fjBitmap & BMF_TOPDOWN) ? + -psurf->SurfObj.sizlBitmap.cy : + psurf->SurfObj.sizlBitmap.cy; + pbmci->bmciHeader.bcPlanes = 1; + pbmci->bmciHeader.bcBitCount = BitsPerFormat(psurf->SurfObj.iBitmapFormat); + } + Info->bmiHeader.biWidth = psurf->SurfObj.sizlBitmap.cx; + Info->bmiHeader.biHeight = (psurf->SurfObj.fjBitmap & BMF_TOPDOWN) ? + -psurf->SurfObj.sizlBitmap.cy : + psurf->SurfObj.sizlBitmap.cy;; + Info->bmiHeader.biPlanes = 1; + Info->bmiHeader.biBitCount = BitsPerFormat(psurf->SurfObj.iBitmapFormat); + Info->bmiHeader.biSizeImage = DIB_GetDIBImageBytes( Info->bmiHeader.biWidth, + Info->bmiHeader.biHeight, + Info->bmiHeader.biBitCount); + if(psurf->hSecure) + { + switch(Info->bmiHeader.biBitCount) + { + case 16: + case 32: + Info->bmiHeader.biCompression = BI_BITFIELDS; + break; + default: + Info->bmiHeader.biCompression = BI_RGB; + break; + } + } + else if(Info->bmiHeader.biBitCount > 8) + { + Info->bmiHeader.biCompression = BI_BITFIELDS; + } + else + { + Info->bmiHeader.biCompression = BI_RGB; + } + Info->bmiHeader.biXPelsPerMeter = 0; Info->bmiHeader.biYPelsPerMeter = 0; Info->bmiHeader.biClrUsed = 0; Info->bmiHeader.biClrImportant = 0; - ScanLines = abs(Info->bmiHeader.biHeight); - goto done; + ScanLines = abs(Info->bmiHeader.biHeight); + goto done; - case 1: - case 4: - case 8: - Info->bmiHeader.biClrUsed = 0; + case 1: + case 4: + case 8: + Info->bmiHeader.biClrUsed = 0; - /* If the bitmap if a DIB section and has the same format than what - * we're asked, go ahead! */ - if((psurf->hSecure) && - (BitsPerFormat(psurf->SurfObj.iBitmapFormat) == bpp)) - { - if(Usage == DIB_RGB_COLORS) - { - unsigned int colors = min(psurf->ppal->NumColors, 1 << bpp); + /* If the bitmap if a DIB section and has the same format than what + * we're asked, go ahead! */ + if((psurf->hSecure) && + (BitsPerFormat(psurf->SurfObj.iBitmapFormat) == bpp)) + { + if(Usage == DIB_RGB_COLORS) + { + unsigned int colors = min(psurf->ppal->NumColors, 1 << bpp); - if(pbmci) - { - for(i=0; i < colors; i++) - { - rgbTriples[i].rgbtRed = psurf->ppal->IndexedColors[i].peRed; - rgbTriples[i].rgbtGreen = psurf->ppal->IndexedColors[i].peGreen; - rgbTriples[i].rgbtBlue = psurf->ppal->IndexedColors[i].peBlue; - } - } - if(colors != 1 << bpp) Info->bmiHeader.biClrUsed = colors; - for(i=0; i < colors; i++) - { - rgbQuads[i].rgbRed = psurf->ppal->IndexedColors[i].peRed; - rgbQuads[i].rgbGreen = psurf->ppal->IndexedColors[i].peGreen; - rgbQuads[i].rgbBlue = psurf->ppal->IndexedColors[i].peBlue; - } - } - else - { - for(i=0; i < 1 << bpp; i++) - { - if(pbmci) ((WORD*)rgbTriples)[i] = i; - ((WORD*)rgbQuads)[i] = i; - } - } - } - else - { - if(Usage == DIB_PAL_COLORS) - { - for(i=0; i < 1 << bpp; i++) - { - if(pbmci) ((WORD*)rgbTriples)[i] = i; - ((WORD*)rgbQuads)[i] = i; - } - } - else if(bpp > 1 && bpp == BitsPerFormat(psurf->SurfObj.iBitmapFormat)) { + if(pbmci) + { + for(i=0; i < colors; i++) + { + rgbTriples[i].rgbtRed = psurf->ppal->IndexedColors[i].peRed; + rgbTriples[i].rgbtGreen = psurf->ppal->IndexedColors[i].peGreen; + rgbTriples[i].rgbtBlue = psurf->ppal->IndexedColors[i].peBlue; + } + } + if(colors != 1 << bpp) Info->bmiHeader.biClrUsed = colors; + for(i=0; i < colors; i++) + { + rgbQuads[i].rgbRed = psurf->ppal->IndexedColors[i].peRed; + rgbQuads[i].rgbGreen = psurf->ppal->IndexedColors[i].peGreen; + rgbQuads[i].rgbBlue = psurf->ppal->IndexedColors[i].peBlue; + } + } + else + { + for(i=0; i < 1 << bpp; i++) + { + if(pbmci) ((WORD*)rgbTriples)[i] = i; + ((WORD*)rgbQuads)[i] = i; + } + } + } + else + { + if(Usage == DIB_PAL_COLORS) + { + for(i=0; i < 1 << bpp; i++) + { + if(pbmci) ((WORD*)rgbTriples)[i] = i; + ((WORD*)rgbQuads)[i] = i; + } + } + else if(bpp > 1 && bpp == BitsPerFormat(psurf->SurfObj.iBitmapFormat)) + { /* For color DDBs in native depth (mono DDBs always have a black/white palette): Generate the color map from the selected palette */ PPALETTE pDcPal = PALETTE_LockPalette(pDC->dclevel.hpal); - if(!pDcPal) - { - ScanLines = 0 ; - goto done ; - } - for (i = 0; i < pDcPal->NumColors; i++) { + if(!pDcPal) + { + ScanLines = 0 ; + goto done ; + } + for (i = 0; i < pDcPal->NumColors; i++) + { if (pbmci) { rgbTriples[i].rgbtRed = pDcPal->IndexedColors[i].peRed; @@ -778,23 +785,26 @@ NtGdiGetDIBitsInternal( rgbQuads[i].rgbGreen = pDcPal->IndexedColors[i].peGreen; rgbQuads[i].rgbBlue = pDcPal->IndexedColors[i].peBlue; rgbQuads[i].rgbReserved = 0; - } - PALETTE_UnlockPalette(pDcPal); - } else { - switch (bpp) { + } + PALETTE_UnlockPalette(pDcPal); + } + else + { + switch (bpp) + { case 1: if (pbmci) { rgbTriples[0].rgbtRed = rgbTriples[0].rgbtGreen = - rgbTriples[0].rgbtBlue = 0; + rgbTriples[0].rgbtBlue = 0; rgbTriples[1].rgbtRed = rgbTriples[1].rgbtGreen = - rgbTriples[1].rgbtBlue = 0xff; + rgbTriples[1].rgbtBlue = 0xff; } rgbQuads[0].rgbRed = rgbQuads[0].rgbGreen = - rgbQuads[0].rgbBlue = 0; + rgbQuads[0].rgbBlue = 0; rgbQuads[0].rgbReserved = 0; rgbQuads[1].rgbRed = rgbQuads[1].rgbGreen = - rgbQuads[1].rgbBlue = 0xff; + rgbQuads[1].rgbBlue = 0xff; rgbQuads[1].rgbReserved = 0; break; @@ -806,52 +816,52 @@ NtGdiGetDIBitsInternal( break; case 8: + { + INT r, g, b; + RGBQUAD *color; + if (pbmci) { - INT r, g, b; - RGBQUAD *color; - if (pbmci) - { - RGBTRIPLE *colorTriple; + RGBTRIPLE *colorTriple; - RtlCopyMemory(rgbTriples, DefLogPaletteTriples, - 10 * sizeof(RGBTRIPLE)); - RtlCopyMemory(rgbTriples + 246, DefLogPaletteTriples + 10, - 10 * sizeof(RGBTRIPLE)); - colorTriple = rgbTriples + 10; - for(r = 0; r <= 5; r++) /* FIXME */ - { - for(g = 0; g <= 5; g++) - { - for(b = 0; b <= 5; b++) - { - colorTriple->rgbtRed = (r * 0xff) / 5; - colorTriple->rgbtGreen = (g * 0xff) / 5; - colorTriple->rgbtBlue = (b * 0xff) / 5; - color++; - } - } - } - } - memcpy(rgbQuads, DefLogPaletteQuads, - 10 * sizeof(RGBQUAD)); - memcpy(rgbQuads + 246, DefLogPaletteQuads + 10, - 10 * sizeof(RGBQUAD)); - color = rgbQuads + 10; + RtlCopyMemory(rgbTriples, DefLogPaletteTriples, + 10 * sizeof(RGBTRIPLE)); + RtlCopyMemory(rgbTriples + 246, DefLogPaletteTriples + 10, + 10 * sizeof(RGBTRIPLE)); + colorTriple = rgbTriples + 10; for(r = 0; r <= 5; r++) /* FIXME */ - { + { for(g = 0; g <= 5; g++) - { + { for(b = 0; b <= 5; b++) - { - color->rgbRed = (r * 0xff) / 5; - color->rgbGreen = (g * 0xff) / 5; - color->rgbBlue = (b * 0xff) / 5; - color->rgbReserved = 0; + { + colorTriple->rgbtRed = (r * 0xff) / 5; + colorTriple->rgbtGreen = (g * 0xff) / 5; + colorTriple->rgbtBlue = (b * 0xff) / 5; color++; } - } - } + } + } } + memcpy(rgbQuads, DefLogPaletteQuads, + 10 * sizeof(RGBQUAD)); + memcpy(rgbQuads + 246, DefLogPaletteQuads + 10, + 10 * sizeof(RGBQUAD)); + color = rgbQuads + 10; + for(r = 0; r <= 5; r++) /* FIXME */ + { + for(g = 0; g <= 5; g++) + { + for(b = 0; b <= 5; b++) + { + color->rgbRed = (r * 0xff) / 5; + color->rgbGreen = (g * 0xff) / 5; + color->rgbBlue = (b * 0xff) / 5; + color->rgbReserved = 0; + color++; + } + } + } + } } } } @@ -870,11 +880,11 @@ NtGdiGetDIBitsInternal( if (Info->bmiHeader.biCompression == BI_BITFIELDS) { if (psurf->hSecure) - { - ((PDWORD)Info->bmiColors)[0] = psurf->ppal->RedMask; + { + ((PDWORD)Info->bmiColors)[0] = psurf->ppal->RedMask; ((PDWORD)Info->bmiColors)[1] = psurf->ppal->GreenMask; ((PDWORD)Info->bmiColors)[2] = psurf->ppal->BlueMask; - } + } else { ((PDWORD)Info->bmiColors)[0] = 0xf800; @@ -889,11 +899,11 @@ NtGdiGetDIBitsInternal( if (Info->bmiHeader.biCompression == BI_BITFIELDS) { if (psurf->hSecure) - { - ((PDWORD)Info->bmiColors)[0] = psurf->ppal->RedMask; + { + ((PDWORD)Info->bmiColors)[0] = psurf->ppal->RedMask; ((PDWORD)Info->bmiColors)[1] = psurf->ppal->GreenMask; ((PDWORD)Info->bmiColors)[2] = psurf->ppal->BlueMask; - } + } else { ((PDWORD)Info->bmiColors)[0] = 0xff0000; @@ -903,228 +913,274 @@ NtGdiGetDIBitsInternal( } break; } - Info->bmiHeader.biSizeImage = DIB_GetDIBImageBytes(width, height, bpp); + Info->bmiHeader.biSizeImage = DIB_GetDIBImageBytes(width, height, bpp); - if(Bits && ScanLines) - { - /* Create a DIBSECTION, blt it, profit */ - PVOID pDIBits ; - HBITMAP hBmpDest; - PSURFACE psurfDest; - EXLATEOBJ exlo; - RECT rcDest; - POINTL srcPoint; - BOOL ret ; + if(Bits && ScanLines) + { + /* Create a DIBSECTION, blt it, profit */ + PVOID pDIBits ; + HBITMAP hBmpDest; + PSURFACE psurfDest; + EXLATEOBJ exlo; + RECT rcDest; + POINTL srcPoint; + BOOL ret ; - if (StartScan > psurf->SurfObj.sizlBitmap.cy) + if (StartScan > psurf->SurfObj.sizlBitmap.cy) { - ScanLines = 0; + ScanLines = 0; goto done; } else { ScanLines = min(ScanLines, psurf->SurfObj.sizlBitmap.cy - StartScan); - } + } - /* Fixup values */ - Info->bmiHeader.biWidth = psurf->SurfObj.sizlBitmap.cx; - Info->bmiHeader.biHeight = height < 0 ? - -ScanLines : ScanLines; - /* Create the DIB */ - hBmpDest = DIB_CreateDIBSection(pDC, Info, Usage, &pDIBits, NULL, 0, 0); - /* Restore them */ - Info->bmiHeader.biWidth = width; - Info->bmiHeader.biHeight = height; + /* Fixup values */ + Info->bmiHeader.biWidth = psurf->SurfObj.sizlBitmap.cx; + Info->bmiHeader.biHeight = height < 0 ? + -ScanLines : ScanLines; + /* Create the DIB */ + hBmpDest = DIB_CreateDIBSection(pDC, Info, Usage, &pDIBits, NULL, 0, 0); + /* Restore them */ + Info->bmiHeader.biWidth = width; + Info->bmiHeader.biHeight = height; - if(!hBmpDest) - { - DPRINT1("Unable to create a DIB Section!\n"); - EngSetLastError(ERROR_INVALID_PARAMETER); - ScanLines = 0; - goto done ; - } + if(!hBmpDest) + { + DPRINT1("Unable to create a DIB Section!\n"); + EngSetLastError(ERROR_INVALID_PARAMETER); + ScanLines = 0; + goto done ; + } - psurfDest = SURFACE_LockSurface(hBmpDest); + psurfDest = SURFACE_ShareLockSurface(hBmpDest); - rcDest.left = 0; - rcDest.top = 0; - rcDest.bottom = ScanLines; - rcDest.right = psurf->SurfObj.sizlBitmap.cx; + rcDest.left = 0; + rcDest.top = 0; + rcDest.bottom = ScanLines; + rcDest.right = psurf->SurfObj.sizlBitmap.cx; - srcPoint.x = 0; - srcPoint.y = height < 0 ? - psurf->SurfObj.sizlBitmap.cy - (StartScan + ScanLines) : StartScan; + srcPoint.x = 0; - EXLATEOBJ_vInitialize(&exlo, psurf->ppal, psurfDest->ppal, 0, 0, 0); + if(height < 0) + { + srcPoint.y = 0; - ret = IntEngCopyBits(&psurfDest->SurfObj, - &psurf->SurfObj, - NULL, - &exlo.xlo, - &rcDest, - &srcPoint); + if(ScanLines <= StartScan) + { + ScanLines = 1; + SURFACE_ShareUnlockSurface(psurfDest); + GreDeleteObject(hBmpDest); + goto done; + } - if(!ret) - ScanLines = 0; - else - { - Status = STATUS_SUCCESS; - _SEH2_TRY - { - RtlCopyMemory(Bits, pDIBits, DIB_GetDIBImageBytes (width, ScanLines, bpp)); - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - Status = _SEH2_GetExceptionCode(); - } - _SEH2_END + ScanLines -= StartScan; + } + else + { + srcPoint.y = StartScan; + } - if(!NT_SUCCESS(Status)) - { - DPRINT1("Unable to copy bits to the user provided pointer\n"); - ScanLines = 0; - } - } + EXLATEOBJ_vInitialize(&exlo, psurf->ppal, psurfDest->ppal, 0xffffff, 0xffffff, 0); - GreDeleteObject(hBmpDest); - EXLATEOBJ_vCleanup(&exlo); - } - else ScanLines = abs(height); + ret = IntEngCopyBits(&psurfDest->SurfObj, + &psurf->SurfObj, + NULL, + &exlo.xlo, + &rcDest, + &srcPoint); + + SURFACE_ShareUnlockSurface(psurfDest); + + if(!ret) + ScanLines = 0; + else + { + Status = STATUS_SUCCESS; + _SEH2_TRY + { + RtlCopyMemory(Bits, pDIBits, DIB_GetDIBImageBytes (width, ScanLines, bpp)); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END + + if(!NT_SUCCESS(Status)) + { + DPRINT1("Unable to copy bits to the user provided pointer\n"); + ScanLines = 0; + } + } + + GreDeleteObject(hBmpDest); + EXLATEOBJ_vCleanup(&exlo); + } + else ScanLines = abs(height); done: - if(pDC) DC_UnlockDc(pDC); - if(psurf) SURFACE_UnlockSurface(psurf); - if(pbmci) DIB_FreeConvertedBitmapInfo(Info, (BITMAPINFO*)pbmci); + if(pDC) DC_UnlockDc(pDC); + if(psurf) SURFACE_ShareUnlockSurface(psurf); + if(pbmci) DIB_FreeConvertedBitmapInfo(Info, (BITMAPINFO*)pbmci); - return ScanLines; + return ScanLines; } +#define ROP_TO_ROP4(Rop) ((Rop) >> 16) +W32KAPI INT APIENTRY NtGdiStretchDIBitsInternal( - HDC hDC, - INT XDest, - INT YDest, - INT DestWidth, - INT DestHeight, - INT XSrc, - INT YSrc, - INT SrcWidth, - INT SrcHeight, - LPBYTE Bits, - LPBITMAPINFO BitsInfo, - DWORD Usage, - DWORD ROP, - UINT cjMaxInfo, - UINT cjMaxBits, - HANDLE hcmXform) + IN HDC hdc, + IN INT xDst, + IN INT yDst, + IN INT cxDst, + IN INT cyDst, + IN INT xSrc, + IN INT ySrc, + IN INT cxSrc, + IN INT cySrc, + IN OPTIONAL LPBYTE pjInit, + IN LPBITMAPINFO pbmi, + IN DWORD dwUsage, + IN DWORD dwRop, // ms ntgdi.h says dwRop4(?) + IN UINT cjMaxInfo, + IN UINT cjMaxBits, + IN HANDLE hcmXform) { + BOOL bResult = FALSE; + SIZEL sizel; + RECTL rcSrc, rcDst; PDC pdc; - INT ret = 0; - LONG height; - LONG width; - WORD planes, bpp; - DWORD compr, size; - HBITMAP hBitmap; - HBITMAP hOldBitmap; - HDC hdcMem; - PVOID pvBits; - PBYTE safeBits; + HBITMAP hbmTmp; + PSURFACE psurfTmp, psurfDst; + EXLATEOBJ exlo; - if (!Bits || !BitsInfo) - return 0; - - safeBits = ExAllocatePoolWithTag(PagedPool, cjMaxBits, TAG_DIB); - if(!safeBits) + if (!(pdc = DC_LockDc(hdc))) { - EngSetLastError(ERROR_NOT_ENOUGH_MEMORY); - return 0; - } - - if (!(pdc = DC_LockDc(hDC))) - { - ExFreePoolWithTag(safeBits, TAG_DIB); EngSetLastError(ERROR_INVALID_HANDLE); return 0; } - _SEH2_TRY - { - ProbeForRead(BitsInfo, cjMaxInfo, 1); - ProbeForRead(Bits, cjMaxBits, 1); - if (DIB_GetBitmapInfo(&BitsInfo->bmiHeader, &width, &height, &planes, &bpp, &compr, &size) == -1) - { - DPRINT1("Invalid bitmap\n"); - _SEH2_YIELD(goto cleanup;) - } - RtlCopyMemory(safeBits, Bits, cjMaxBits); - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - DPRINT1("Error, failed to read the DIB bits\n"); - _SEH2_YIELD(goto cleanup;) - } - _SEH2_END + /* Transform dest size */ + sizel.cx = cxDst; + sizel.cy = cyDst; + IntLPtoDP(pdc, (POINTL*)&sizel, 1); + DC_UnlockDc(pdc); - if (width < 0) + /* Check if we can use NtGdiSetDIBitsToDeviceInternal */ + if (sizel.cx == cxSrc && sizel.cy == cySrc && dwRop == SRCCOPY) { - DPRINT1("Bitmap has a negative width\n"); + /* Yes, we can! */ + return NtGdiSetDIBitsToDeviceInternal(hdc, + xDst, + yDst, + cxDst, + cyDst, + xSrc, + ySrc, + 0, + cySrc, + pjInit, + pbmi, + dwUsage, + cjMaxBits, + cjMaxInfo, + TRUE, + hcmXform); + } + + /* Create an intermediate bitmap from the DIB */ + hbmTmp = NtGdiCreateDIBitmapInternal(hdc, + cxSrc, + cySrc, + CBM_INIT, + pjInit, + pbmi, + dwUsage, + cjMaxInfo, + cjMaxBits, + 0, + hcmXform); + if (!hbmTmp) + { + DPRINT1("NtGdiCreateDIBitmapInternal failed\n"); return 0; } - hBitmap = NtGdiGetDCObject(hDC, OBJ_BITMAP); - - if (XDest == 0 && YDest == 0 && XSrc == 0 && XSrc == 0 && - DestWidth == SrcWidth && DestHeight == SrcHeight && - compr == BI_RGB && - ROP == SRCCOPY) + /* FIXME: locking twice is cheesy, coord tranlation in UM will fix it */ + if (!(pdc = DC_LockDc(hdc))) { - BITMAP bmp; - ret = IntGdiGetObject(hBitmap, sizeof(bmp), &bmp) == sizeof(bmp); - if (ret && - bmp.bmBitsPixel == bpp && - bmp.bmWidth == SrcWidth && - bmp.bmHeight == SrcHeight && - bmp.bmPlanes == planes) - { - /* fast path */ - ret = IntSetDIBits(pdc, hBitmap, 0, height, safeBits, BitsInfo, Usage); - goto cleanup; - } + DPRINT1("Could not lock dc\n"); + EngSetLastError(ERROR_INVALID_HANDLE); + GreDeleteObject(hbmTmp); + return 0; } - /* slow path - need to use StretchBlt */ - - hdcMem = NtGdiCreateCompatibleDC(hDC); - hBitmap = DIB_CreateDIBSection(pdc, BitsInfo, Usage, &pvBits, NULL, 0, 0); - if(!hBitmap) + psurfTmp = SURFACE_ShareLockSurface(hbmTmp); + if (!psurfTmp) { - DPRINT1("Error, failed to create a DIB section\n"); - NtGdiDeleteObjectApp(hdcMem); + DPRINT1("Could not lock bitmap :-(\n"); goto cleanup; } - RtlCopyMemory(pvBits, safeBits, cjMaxBits); - hOldBitmap = NtGdiSelectBitmap(hdcMem, hBitmap); + psurfDst = pdc->dclevel.pSurface; + if (!psurfDst) + { + // CHECKME + bResult = TRUE; + goto cleanup; + } - /* Origin for DIBitmap may be bottom left (positive biHeight) or top - left (negative biHeight) */ - ret = NtGdiStretchBlt(hDC, XDest, YDest, DestWidth, DestHeight, - hdcMem, XSrc, abs(height) - SrcHeight - YSrc, - SrcWidth, SrcHeight, ROP, 0); + /* Calculate source and destination rect */ + rcSrc.left = xSrc; + rcSrc.top = ySrc; + rcSrc.right = xSrc + abs(cxSrc); + rcSrc.bottom = ySrc + abs(cySrc); + rcDst.left = xDst; + rcDst.top = yDst; + rcDst.right = rcDst.left + cxDst; + rcDst.bottom = rcDst.top + cyDst; + IntLPtoDP(pdc, (POINTL*)&rcDst, 2); + RECTL_vOffsetRect(&rcDst, pdc->ptlDCOrig.x, pdc->ptlDCOrig.y); - if(ret) - ret = SrcHeight; - NtGdiSelectBitmap(hdcMem, hOldBitmap); - NtGdiDeleteObjectApp(hdcMem); - GreDeleteObject(hBitmap); + /* Initialize XLATEOBJ */ + EXLATEOBJ_vInitialize(&exlo, + psurfTmp->ppal, + psurfDst->ppal, + RGB(0xff, 0xff, 0xff), + pdc->pdcattr->crBackgroundClr, + pdc->pdcattr->crForegroundClr); + /* Prepare DC for blit */ + DC_vPrepareDCsForBlit(pdc, rcDst, NULL, rcSrc); + + /* Perform the stretch operation */ + bResult = IntEngStretchBlt(&psurfDst->SurfObj, + &psurfTmp->SurfObj, + NULL, + pdc->rosdc.CombinedClip, + &exlo.xlo, + &rcDst, + &rcSrc, + NULL, + &pdc->eboFill.BrushObject, + NULL, + ROP_TO_ROP4(dwRop)); + + /* Cleanup */ + DC_vFinishBlit(pdc, NULL); + EXLATEOBJ_vCleanup(&exlo); cleanup: - ExFreePoolWithTag(safeBits, TAG_DIB); - DC_UnlockDc(pdc); - return ret; + if (psurfTmp) SURFACE_ShareUnlockSurface(psurfTmp); + if (hbmTmp) GreDeleteObject(hbmTmp); + if (pdc) DC_UnlockDc(pdc); + + return bResult; } @@ -1208,27 +1264,27 @@ NtGdiCreateDIBitmapInternal( IN HANDLE hcmXform) { NTSTATUS Status = STATUS_SUCCESS; - PBYTE safeBits = NULL; - HBITMAP hbmResult = NULL; + PBYTE safeBits = NULL; + HBITMAP hbmResult = NULL; - if(pjInit && (fInit == CBM_INIT)) - { - safeBits = ExAllocatePoolWithTag(PagedPool, cjMaxBits, TAG_DIB); - if(!safeBits) - { - EngSetLastError(ERROR_NOT_ENOUGH_MEMORY); - return NULL; - } - } + if(pjInit && (fInit == CBM_INIT)) + { + safeBits = ExAllocatePoolWithTag(PagedPool, cjMaxBits, TAG_DIB); + if(!safeBits) + { + EngSetLastError(ERROR_NOT_ENOUGH_MEMORY); + return NULL; + } + } _SEH2_TRY { if(pbmi) ProbeForRead(pbmi, cjMaxInitInfo, 1); if(pjInit && (fInit == CBM_INIT)) - { - ProbeForRead(pjInit, cjMaxBits, 1); - RtlCopyMemory(safeBits, pjInit, cjMaxBits); - } + { + ProbeForRead(pjInit, cjMaxBits, 1); + RtlCopyMemory(safeBits, pjInit, cjMaxBits); + } } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { @@ -1239,13 +1295,13 @@ NtGdiCreateDIBitmapInternal( if(!NT_SUCCESS(Status)) { SetLastNtError(Status); - goto cleanup; + goto cleanup; } hbmResult = GreCreateDIBitmapInternal(hDc, - cx, - cy, - fInit, + cx, + cy, + fInit, safeBits, pbmi, iUsage, @@ -1253,8 +1309,8 @@ NtGdiCreateDIBitmapInternal( hcmXform); cleanup: - if (safeBits) ExFreePoolWithTag(safeBits, TAG_DIB); - return hbmResult; + if (safeBits) ExFreePoolWithTag(safeBits, TAG_DIB); + return hbmResult; } HBITMAP @@ -1276,7 +1332,8 @@ GreCreateDIBitmapInternal( HDC hdcDest; if (!hDc) /* 1bpp monochrome bitmap */ - { // Should use System Bitmap DC hSystemBM, with CreateCompatibleDC for this. + { + // Should use System Bitmap DC hSystemBM, with CreateCompatibleDC for this. hdcDest = NtGdiCreateCompatibleDC(0); if(!hdcDest) { @@ -1327,15 +1384,15 @@ NtGdiCreateDIBSection( HBITMAP hbitmap = 0; DC *dc; BOOL bDesktopDC = FALSE; - NTSTATUS Status = STATUS_SUCCESS; + NTSTATUS Status = STATUS_SUCCESS; if (!bmi) return hbitmap; // Make sure. - _SEH2_TRY + _SEH2_TRY { ProbeForRead(&bmi->bmiHeader.biSize, sizeof(DWORD), 1); - ProbeForRead(bmi, bmi->bmiHeader.biSize, 1); - ProbeForRead(bmi, DIB_BitmapInfoSize(bmi, Usage), 1); + ProbeForRead(bmi, bmi->bmiHeader.biSize, 1); + ProbeForRead(bmi, DIB_BitmapInfoSize(bmi, Usage), 1); } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { @@ -1409,6 +1466,7 @@ DIB_CreateDIBSection( /* CreateDIBSection should fail for compressed formats */ if (bi->biCompression == BI_RLE4 || bi->biCompression == BI_RLE8) { + DPRINT1("no compressed format allowed\n"); return (HBITMAP)NULL; } @@ -1441,6 +1499,7 @@ DIB_CreateDIBSection( 0); if (!NT_SUCCESS(Status)) { + DPRINT1("ZwQuerySystemInformation failed (0x%lx)\n", Status); return NULL; } @@ -1462,6 +1521,7 @@ DIB_CreateDIBSection( PAGE_READWRITE); if (!NT_SUCCESS(Status)) { + DPRINT1("ZwMapViewOfSection failed (0x%lx)\n", Status); EngSetLastError(ERROR_INVALID_PARAMETER); return NULL; } @@ -1474,7 +1534,11 @@ DIB_CreateDIBSection( { offset = 0; bm.bmBits = EngAllocUserMem(totalSize, 0); - if(!bm.bmBits) goto cleanup; + if(!bm.bmBits) + { + DPRINT1("Failed to allocate memory\n"); + goto cleanup; + } } // hSecure = MmSecureVirtualMemory(bm.bmBits, totalSize, PAGE_READWRITE); @@ -1482,31 +1546,31 @@ DIB_CreateDIBSection( if (usage == DIB_PAL_COLORS) { - if(dc) - { - PPALETTE pdcPal ; - pdcPal = PALETTE_LockPalette(dc->dclevel.hpal); - hpal = DIB_MapPaletteColors(pdcPal, bmi); - PALETTE_UnlockPalette(pdcPal); - } - else - { - /* For DIB Brushes */ - DPRINT1("FIXME : Unsupported DIB_PAL_COLORS without a DC to map colors.\n"); - /* HACK */ - hpal = (HPALETTE) 0xFFFFFFFF; - } + if(dc) + { + PPALETTE pdcPal ; + pdcPal = PALETTE_LockPalette(dc->dclevel.hpal); + hpal = DIB_MapPaletteColors(pdcPal, bmi); + PALETTE_UnlockPalette(pdcPal); + } + else + { + /* For DIB Brushes */ + DPRINT1("FIXME : Unsupported DIB_PAL_COLORS without a DC to map colors.\n"); + /* HACK */ + hpal = (HPALETTE) 0xFFFFFFFF; + } } else - { + { hpal = BuildDIBPalette(bmi); - } + } - if(!hpal) - { - DPRINT1("Error : Could not create a palette for the DIB.\n"); - goto cleanup; - } + if(!hpal) + { + DPRINT1("Error : Could not create a palette for the DIB.\n"); + goto cleanup; + } // Create Device Dependent Bitmap and add DIB pointer Size.cx = bm.bmWidth; @@ -1516,19 +1580,21 @@ DIB_CreateDIBSection( bm.bmWidthBytes, BitmapFormat(bi->biBitCount * bi->biPlanes, bi->biCompression), BMF_DONTCACHE | BMF_USERMEM | BMF_NOZEROINIT | - (bi->biHeight < 0 ? BMF_TOPDOWN : 0), + ((bi->biHeight < 0) ? BMF_TOPDOWN : 0), bi->biSizeImage, bm.bmBits, - 0); + 0); if (!res) { + DPRINT1("GreCreateBitmapEx failed\n"); EngSetLastError(ERROR_NO_SYSTEM_RESOURCES); goto cleanup; } bmp = SURFACE_LockSurface(res); if (NULL == bmp) { - EngSetLastError(ERROR_INVALID_HANDLE); + DPRINT1("SURFACE_LockSurface failed\n"); + EngSetLastError(ERROR_INVALID_HANDLE); goto cleanup; } @@ -1543,13 +1609,13 @@ DIB_CreateDIBSection( bmp->biClrImportant = bi->biClrImportant; bmp->SurfObj.fjBitmap &= ~BMF_DONT_FREE; - /* HACK */ - if(hpal != (HPALETTE)0xFFFFFFFF) - { - bmp->ppal = PALETTE_ShareLockPalette(hpal); - /* Lazy delete hpal, it will be freed at surface release */ - GreDeleteObject(hpal); - } + /* HACK */ + if(hpal != (HPALETTE)0xFFFFFFFF) + { + bmp->ppal = PALETTE_ShareLockPalette(hpal); + /* Lazy delete hpal, it will be freed at surface release */ + GreDeleteObject(hpal); + } // Clean up in case of errors cleanup: @@ -1564,9 +1630,8 @@ cleanup: ZwUnmapViewOfSection(NtCurrentProcess(), mapBits); bm.bmBits = NULL; } - else - if (!offset) - EngFreeUserMem(bm.bmBits), bm.bmBits = NULL; + else if (!offset) + EngFreeUserMem(bm.bmBits), bm.bmBits = NULL; } if (bmp) @@ -1602,7 +1667,7 @@ cleanup: int FASTCALL DIB_GetBitmapInfo( const BITMAPINFOHEADER *header, LONG *width, - LONG *height, WORD *planes, WORD *bpp, DWORD *compr, DWORD *size ) + LONG *height, WORD *planes, WORD *bpp, DWORD *compr, DWORD *size ) { if (header->biSize == sizeof(BITMAPCOREHEADER)) { @@ -1657,7 +1722,7 @@ INT FASTCALL DIB_BitmapInfoSize(const BITMAPINFO * info, WORD coloruse) const BITMAPCOREHEADER *core = (const BITMAPCOREHEADER *)info; colors = (core->bcBitCount <= 8) ? 1 << core->bcBitCount : 0; return sizeof(BITMAPCOREHEADER) + colors * - ((coloruse == DIB_RGB_COLORS) ? sizeof(RGBTRIPLE) : sizeof(WORD)); + ((coloruse == DIB_RGB_COLORS) ? sizeof(RGBTRIPLE) : sizeof(WORD)); } else /* assume BITMAPINFOHEADER */ { @@ -1678,7 +1743,7 @@ DIB_MapPaletteColors(PPALETTE ppal, CONST BITMAPINFO* lpbmi) PALETTEENTRY* ppalEntries; ULONG nNumColors,i; USHORT *lpIndex; - HPALETTE hpal; + HPALETTE hpal; if (!(ppal->flFlags & PAL_INDEXED)) { @@ -1691,8 +1756,8 @@ DIB_MapPaletteColors(PPALETTE ppal, CONST BITMAPINFO* lpbmi) nNumColors = min(nNumColors, lpbmi->bmiHeader.biClrUsed); } - /* Don't have more colors than we need */ - nNumColors = min(ppal->NumColors, nNumColors); + /* Don't have more colors than we need */ + nNumColors = min(ppal->NumColors, nNumColors); ppalEntries = ExAllocatePoolWithTag(PagedPool, sizeof(PALETTEENTRY) * nNumColors, TAG_COLORMAP); if (ppalEntries == NULL) @@ -1712,19 +1777,19 @@ DIB_MapPaletteColors(PPALETTE ppal, CONST BITMAPINFO* lpbmi) else { ppalEntries[i].peRed = 0; - ppalEntries[i].peGreen = 0; - ppalEntries[i].peBlue = 0; - ppalEntries[i].peFlags = 0; + ppalEntries[i].peGreen = 0; + ppalEntries[i].peBlue = 0; + ppalEntries[i].peFlags = 0; } lpIndex++; } - hpal = PALETTE_AllocPalette(PAL_INDEXED, nNumColors, (ULONG*)ppalEntries, 0, 0, 0); + hpal = PALETTE_AllocPalette(PAL_INDEXED, nNumColors, (ULONG*)ppalEntries, 0, 0, 0); - ExFreePoolWithTag(ppalEntries, TAG_COLORMAP); + ExFreePoolWithTag(ppalEntries, TAG_COLORMAP); - return hpal; + return hpal; } HPALETTE @@ -1736,7 +1801,7 @@ BuildDIBPalette(CONST BITMAPINFO *bmi) HPALETTE hPal; ULONG RedMask = 0, GreenMask = 0, BlueMask = 0; PDWORD pdwColors = (PDWORD)((PBYTE)bmi + bmi->bmiHeader.biSize); - INT paletteType; + INT paletteType; // Determine Bits Per Pixel bits = bmi->bmiHeader.biBitCount; @@ -1750,36 +1815,39 @@ BuildDIBPalette(CONST BITMAPINFO *bmi) else if (bmi->bmiHeader.biCompression == BI_BITFIELDS) { paletteType = PAL_BITFIELDS; - RedMask = pdwColors[0]; - GreenMask = pdwColors[1]; - BlueMask = pdwColors[2]; + if (bmi->bmiHeader.biSize >= sizeof(BITMAPV4HEADER)) + { + PBITMAPV4HEADER pV4Header = (PBITMAPV4HEADER)&bmi->bmiHeader; + RedMask = pV4Header->bV4RedMask; + GreenMask = pV4Header->bV4GreenMask; + BlueMask = pV4Header->bV4BlueMask; + } + else + { + RedMask = pdwColors[0]; + GreenMask = pdwColors[1]; + BlueMask = pdwColors[2]; + } } else { paletteType = PAL_BITFIELDS; switch (bits) { - case 15: - paletteType |= PAL_RGB16_555; - RedMask = 0x7C00; - GreenMask = 0x03E0; - BlueMask = 0x001F; - break; + case 16: + paletteType |= PAL_RGB16_555; + RedMask = 0x7C00; + GreenMask = 0x03E0; + BlueMask = 0x001F; + break; - case 16: - paletteType |= PAL_RGB16_565; - RedMask = 0xF800; - GreenMask = 0x07E0; - BlueMask = 0x001F; - break; - - case 24: - case 32: - paletteType |= PAL_BGR; - RedMask = 0xFF0000; - GreenMask = 0x00FF00; - BlueMask = 0x0000FF; - break; + case 24: + case 32: + paletteType |= PAL_BGR; + RedMask = 0xFF0000; + GreenMask = 0x00FF00; + BlueMask = 0x0000FF; + break; } } @@ -1812,62 +1880,62 @@ BITMAPINFO* FASTCALL DIB_ConvertBitmapInfo (CONST BITMAPINFO* pbmi, DWORD Usage) { - CONST BITMAPCOREINFO* pbmci = (BITMAPCOREINFO*)pbmi; - BITMAPINFO* pNewBmi ; - UINT numColors = 0, ColorsSize = 0; + CONST BITMAPCOREINFO* pbmci = (BITMAPCOREINFO*)pbmi; + BITMAPINFO* pNewBmi ; + UINT numColors = 0, ColorsSize = 0; - if(pbmi->bmiHeader.biSize >= sizeof(BITMAPINFOHEADER)) return (BITMAPINFO*)pbmi; - if(pbmi->bmiHeader.biSize != sizeof(BITMAPCOREHEADER)) return NULL; + if(pbmi->bmiHeader.biSize >= sizeof(BITMAPINFOHEADER)) return (BITMAPINFO*)pbmi; + if(pbmi->bmiHeader.biSize != sizeof(BITMAPCOREHEADER)) return NULL; - if(pbmci->bmciHeader.bcBitCount <= 8) - { - numColors = 1 << pbmci->bmciHeader.bcBitCount; - if(Usage == DIB_PAL_COLORS) - { - ColorsSize = numColors * sizeof(WORD); - } - else - { - ColorsSize = numColors * sizeof(RGBQUAD); - } - } - else if (Usage == DIB_PAL_COLORS) - { - /* Invalid at high Res */ - return NULL; - } + if(pbmci->bmciHeader.bcBitCount <= 8) + { + numColors = 1 << pbmci->bmciHeader.bcBitCount; + if(Usage == DIB_PAL_COLORS) + { + ColorsSize = numColors * sizeof(WORD); + } + else + { + ColorsSize = numColors * sizeof(RGBQUAD); + } + } + else if (Usage == DIB_PAL_COLORS) + { + /* Invalid at high Res */ + return NULL; + } - pNewBmi = ExAllocatePoolWithTag(PagedPool, sizeof(BITMAPINFOHEADER) + ColorsSize, TAG_DIB); - if(!pNewBmi) return NULL; + pNewBmi = ExAllocatePoolWithTag(PagedPool, sizeof(BITMAPINFOHEADER) + ColorsSize, TAG_DIB); + if(!pNewBmi) return NULL; - RtlZeroMemory(pNewBmi, sizeof(BITMAPINFOHEADER) + ColorsSize); + RtlZeroMemory(pNewBmi, sizeof(BITMAPINFOHEADER) + ColorsSize); - pNewBmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - pNewBmi->bmiHeader.biBitCount = pbmci->bmciHeader.bcBitCount; - pNewBmi->bmiHeader.biWidth = pbmci->bmciHeader.bcWidth; - pNewBmi->bmiHeader.biHeight = pbmci->bmciHeader.bcHeight; - pNewBmi->bmiHeader.biPlanes = pbmci->bmciHeader.bcPlanes; - pNewBmi->bmiHeader.biCompression = BI_RGB ; - pNewBmi->bmiHeader.biSizeImage = DIB_GetDIBImageBytes(pNewBmi->bmiHeader.biWidth, - pNewBmi->bmiHeader.biHeight, - pNewBmi->bmiHeader.biBitCount); + pNewBmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + pNewBmi->bmiHeader.biBitCount = pbmci->bmciHeader.bcBitCount; + pNewBmi->bmiHeader.biWidth = pbmci->bmciHeader.bcWidth; + pNewBmi->bmiHeader.biHeight = pbmci->bmciHeader.bcHeight; + pNewBmi->bmiHeader.biPlanes = pbmci->bmciHeader.bcPlanes; + pNewBmi->bmiHeader.biCompression = BI_RGB ; + pNewBmi->bmiHeader.biSizeImage = DIB_GetDIBImageBytes(pNewBmi->bmiHeader.biWidth, + pNewBmi->bmiHeader.biHeight, + pNewBmi->bmiHeader.biBitCount); - if(Usage == DIB_PAL_COLORS) - { - RtlCopyMemory(pNewBmi->bmiColors, pbmci->bmciColors, ColorsSize); - } - else - { - UINT i; - for(i=0; ibmiColors[i].rgbRed = pbmci->bmciColors[i].rgbtRed; - pNewBmi->bmiColors[i].rgbGreen = pbmci->bmciColors[i].rgbtGreen; - pNewBmi->bmiColors[i].rgbBlue = pbmci->bmciColors[i].rgbtBlue; - } - } + if(Usage == DIB_PAL_COLORS) + { + RtlCopyMemory(pNewBmi->bmiColors, pbmci->bmciColors, ColorsSize); + } + else + { + UINT i; + for(i=0; ibmiColors[i].rgbRed = pbmci->bmciColors[i].rgbtRed; + pNewBmi->bmiColors[i].rgbGreen = pbmci->bmciColors[i].rgbtGreen; + pNewBmi->bmiColors[i].rgbBlue = pbmci->bmciColors[i].rgbtBlue; + } + } - return pNewBmi ; + return pNewBmi ; } /* Frees a BITMAPINFO created with DIB_ConvertBitmapInfo */ @@ -1875,8 +1943,8 @@ VOID FASTCALL DIB_FreeConvertedBitmapInfo(BITMAPINFO* converted, BITMAPINFO* orig) { - if(converted != orig) - ExFreePoolWithTag(converted, TAG_DIB); + if(converted != orig) + ExFreePoolWithTag(converted, TAG_DIB); } diff --git a/subsystems/win32/win32k/objects/drawing.c b/subsystems/win32/win32k/objects/drawing.c index 351c081731a..bac849ce9e9 100755 --- a/subsystems/win32/win32k/objects/drawing.c +++ b/subsystems/win32/win32k/objects/drawing.c @@ -61,8 +61,8 @@ SUCH DAMAGE. typedef struct _Rect { - int x, y; /* top-left point inside rect */ - int width, height; /* width and height of rect */ + int x, y; /* top-left point inside rect */ + int width, height; /* width and height of rect */ } Rect, *PRect; int FASTCALL IntFillRect(DC *dc, INT XLeft, INT YLeft, INT Width, INT Height, PBRUSH pbrush, BOOL Pen); @@ -73,10 +73,10 @@ POINT INTERNAL_CALL app_new_point(int x, int y) { - POINT p; - p.x = x; - p.y = y; - return p; + POINT p; + p.x = x; + p.y = y; + return p; } #define pt(x,y) app_new_point((x),(y)) @@ -85,12 +85,12 @@ Rect INTERNAL_CALL rect(int x, int y, int width, int height) { - Rect r; - r.x = x; - r.y = y; - r.width = width; - r.height = height; - return r; + Rect r; + r.x = x; + r.y = y; + r.width = width; + r.height = height; + return r; } @@ -125,202 +125,214 @@ int INTERNAL_CALL app_draw_ellipse(DC *g, Rect r, PBRUSH pbrush) { - /* Outer ellipse: e(x,y) = b*b*x*x + a*a*y*y - a*a*b*b */ + /* Outer ellipse: e(x,y) = b*b*x*x + a*a*y*y - a*a*b*b */ - int a = r.width / 2; - int b = r.height / 2; - int x = 0; - int y = b; - long a2 = a*a; - long b2 = b*b; - long xcrit = (3 * a2 / 4) + 1; - long ycrit = (3 * b2 / 4) + 1; - long t = b2 + a2 - 2*a2*b; /* t = e(x+1,y-1) */ - long dxt = b2*(3+x+x); - long dyt = a2*(3-y-y); - int d2xt = b2+b2; - int d2yt = a2+a2; + int a = r.width / 2; + int b = r.height / 2; + int x = 0; + int y = b; + long a2 = a*a; + long b2 = b*b; + long xcrit = (3 * a2 / 4) + 1; + long ycrit = (3 * b2 / 4) + 1; + long t = b2 + a2 - 2*a2*b; /* t = e(x+1,y-1) */ + long dxt = b2*(3+x+x); + long dyt = a2*(3-y-y); + int d2xt = b2+b2; + int d2yt = a2+a2; - int w = pbrush->ptPenWidth.x; + int w = pbrush->ptPenWidth.x; - /* Inner ellipse: E(X,Y) = B*B*X*X + A*A*Y*Y - A*A*B*B */ + /* Inner ellipse: E(X,Y) = B*B*X*X + A*A*Y*Y - A*A*B*B */ - int A = a-w > 0 ? a-w : 0; - int B = b-w > 0 ? b-w : 0; - int X = 0; - int Y = B; - long A2 = A*A; - long B2 = B*B; - long XCRIT = (3 * A2 / 4) + 1; - long YCRIT = (3 * B2 / 4) + 1; - long T = B2 + A2 - 2*A2*B; /* T = E(X+1,Y-1) */ - long DXT = B2*(3+X+X); - long DYT = A2*(3-Y-Y); - int D2XT = B2+B2; - int D2YT = A2+A2; + int A = a-w > 0 ? a-w : 0; + int B = b-w > 0 ? b-w : 0; + int X = 0; + int Y = B; + long A2 = A*A; + long B2 = B*B; + long XCRIT = (3 * A2 / 4) + 1; + long YCRIT = (3 * B2 / 4) + 1; + long T = B2 + A2 - 2*A2*B; /* T = E(X+1,Y-1) */ + long DXT = B2*(3+X+X); + long DYT = A2*(3-Y-Y); + int D2XT = B2+B2; + int D2YT = A2+A2; - int movedown, moveout; - int innerX = 0, prevx, prevy, W; - Rect r1, r2; - int result = 1; + int movedown, moveout; + int innerX = 0, prevx, prevy, W; + Rect r1, r2; + int result = 1; // START_DEBUG(); - if ((r.width <= 2) || (r.height <= 2)) - return app_fill_rect(g, r, pbrush, TRUE); + if ((r.width <= 2) || (r.height <= 2)) + return app_fill_rect(g, r, pbrush, TRUE); - r1.x = r.x + a; - r1.y = r.y; - r1.width = r.width & 1; /* i.e. if width is odd */ - r1.height = 1; + r1.x = r.x + a; + r1.y = r.y; + r1.width = r.width & 1; /* i.e. if width is odd */ + r1.height = 1; - r2 = r1; - r2.y = r.y + r.height - 1; + r2 = r1; + r2.y = r.y + r.height - 1; - prevx = r1.x; - prevy = r1.y; + prevx = r1.x; + prevy = r1.y; - while (y > 0) - { - while (Y == y) - { - innerX = X; + while (y > 0) + { + while (Y == y) + { + innerX = X; - if (T + A2*Y < XCRIT) /* E(X+1,Y-1/2) <= 0 */ - { - /* move outwards to encounter edge */ - X += 1; - T += DXT; - DXT += D2XT; - } - else if (T - B2*X >= YCRIT) /* e(x+1/2,y-1) > 0 */ - { - /* drop down one line */ - Y -= 1; - T += DYT; - DYT += D2YT; - } - else { - /* drop diagonally down and out */ - X += 1; - Y -= 1; - T += DXT + DYT; - DXT += D2XT; - DYT += D2YT; - } - } + if (T + A2*Y < XCRIT) /* E(X+1,Y-1/2) <= 0 */ + { + /* move outwards to encounter edge */ + X += 1; + T += DXT; + DXT += D2XT; + } + else if (T - B2*X >= YCRIT) /* e(x+1/2,y-1) > 0 */ + { + /* drop down one line */ + Y -= 1; + T += DYT; + DYT += D2YT; + } + else + { + /* drop diagonally down and out */ + X += 1; + Y -= 1; + T += DXT + DYT; + DXT += D2XT; + DYT += D2YT; + } + } - movedown = moveout = 0; + movedown = moveout = 0; - W = x - innerX; - if (r1.x + W < prevx) - W = prevx - r1.x; - if (W < w) - W = w; + W = x - innerX; + if (r1.x + W < prevx) + W = prevx - r1.x; + if (W < w) + W = w; - if (t + a2*y < xcrit) /* e(x+1,y-1/2) <= 0 */ - { - /* move outwards to encounter edge */ - x += 1; - t += dxt; - dxt += d2xt; + if (t + a2*y < xcrit) /* e(x+1,y-1/2) <= 0 */ + { + /* move outwards to encounter edge */ + x += 1; + t += dxt; + dxt += d2xt; - moveout = 1; - } - else if (t - b2*x >= ycrit) /* e(x+1/2,y-1) > 0 */ - { - /* drop down one line */ - y -= 1; - t += dyt; - dyt += d2yt; + moveout = 1; + } + else if (t - b2*x >= ycrit) /* e(x+1/2,y-1) > 0 */ + { + /* drop down one line */ + y -= 1; + t += dyt; + dyt += d2yt; - movedown = 1; - } - else { - /* drop diagonally down and out */ - x += 1; - y -= 1; - t += dxt + dyt; - dxt += d2xt; - dyt += d2yt; + movedown = 1; + } + else + { + /* drop diagonally down and out */ + x += 1; + y -= 1; + t += dxt + dyt; + dxt += d2xt; + dyt += d2yt; - movedown = 1; - moveout = 1; - } + movedown = 1; + moveout = 1; + } - if (movedown) { - if (r1.width == 0) { - r1.x -= 1; r1.width += 2; - r2.x -= 1; r2.width += 2; - moveout = 0; - } + if (movedown) + { + if (r1.width == 0) + { + r1.x -= 1; + r1.width += 2; + r2.x -= 1; + r2.width += 2; + moveout = 0; + } - if (r1.x < r.x) - r1.x = r2.x = r.x; - if (r1.width > r.width) - r1.width = r2.width = r.width; - if (r1.y == r2.y-1) { - r1.x = r2.x = r.x; - r1.width = r2.width = r.width; - } + if (r1.x < r.x) + r1.x = r2.x = r.x; + if (r1.width > r.width) + r1.width = r2.width = r.width; + if (r1.y == r2.y-1) + { + r1.x = r2.x = r.x; + r1.width = r2.width = r.width; + } - if ((r1.y < r.y+w) || (r1.x+W >= r1.x+r1.width-W)) - { - result &= app_fill_rect(g, r1, pbrush, TRUE); - result &= app_fill_rect(g, r2, pbrush, TRUE); + if ((r1.y < r.y+w) || (r1.x+W >= r1.x+r1.width-W)) + { + result &= app_fill_rect(g, r1, pbrush, TRUE); + result &= app_fill_rect(g, r2, pbrush, TRUE); - prevx = r1.x; - prevy = r1.y; - } - else if (r1.y+r1.height < r2.y) - { - /* draw distinct rectangles */ - result &= app_fill_rect(g, rect(r1.x,r1.y, - W,1), pbrush, TRUE); - result &= app_fill_rect(g, rect( - r1.x+r1.width-W,r1.y,W,1), pbrush, TRUE); - result &= app_fill_rect(g, rect(r2.x, - r2.y,W,1), pbrush, TRUE); - result &= app_fill_rect(g, rect( - r2.x+r2.width-W,r2.y,W,1), pbrush, TRUE); + prevx = r1.x; + prevy = r1.y; + } + else if (r1.y+r1.height < r2.y) + { + /* draw distinct rectangles */ + result &= app_fill_rect(g, rect(r1.x,r1.y, + W,1), pbrush, TRUE); + result &= app_fill_rect(g, rect( + r1.x+r1.width-W,r1.y,W,1), pbrush, TRUE); + result &= app_fill_rect(g, rect(r2.x, + r2.y,W,1), pbrush, TRUE); + result &= app_fill_rect(g, rect( + r2.x+r2.width-W,r2.y,W,1), pbrush, TRUE); - prevx = r1.x; - prevy = r1.y; - } + prevx = r1.x; + prevy = r1.y; + } - /* move down */ - r1.y += 1; - r2.y -= 1; - } + /* move down */ + r1.y += 1; + r2.y -= 1; + } - if (moveout) { - /* move outwards */ - r1.x -= 1; r1.width += 2; - r2.x -= 1; r2.width += 2; - } - } - if ((x <= a) && (prevy < r2.y)) { - /* draw final line */ - r1.height = r1.y+r1.height-r2.y; - r1.y = r2.y; + if (moveout) + { + /* move outwards */ + r1.x -= 1; + r1.width += 2; + r2.x -= 1; + r2.width += 2; + } + } + if ((x <= a) && (prevy < r2.y)) + { + /* draw final line */ + r1.height = r1.y+r1.height-r2.y; + r1.y = r2.y; - W = w; - if (r.x + W != prevx) - W = prevx - r.x; - if (W < w) - W = w; + W = w; + if (r.x + W != prevx) + W = prevx - r.x; + if (W < w) + W = w; - if (W+W >= r.width) { - result &= app_fill_rect(g, rect(r.x, r1.y, - r.width, r1.height), pbrush, TRUE); - return result; - } + if (W+W >= r.width) + { + result &= app_fill_rect(g, rect(r.x, r1.y, + r.width, r1.height), pbrush, TRUE); + return result; + } - result &= app_fill_rect(g, rect(r.x, r1.y, W, r1.height), pbrush, TRUE); - result &= app_fill_rect(g, rect(r.x+r.width-W, r1.y, - W, r1.height), pbrush, TRUE); - } - return result; + result &= app_fill_rect(g, rect(r.x, r1.y, W, r1.height), pbrush, TRUE); + result &= app_fill_rect(g, rect(r.x+r.width-W, r1.y, + W, r1.height), pbrush, TRUE); + } + return result; } /* @@ -360,220 +372,220 @@ static int FASTCALL app_fill_arc_rect(DC *g, - Rect r, // top, left, width, height - POINT p0, // Center - POINT p1, // Start - POINT p2, // End - int start_angle, - int end_angle, - PBRUSH pbrush, - BOOL Pen) + Rect r, // top, left, width, height + POINT p0, // Center + POINT p1, // Start + POINT p2, // End + int start_angle, + int end_angle, + PBRUSH pbrush, + BOOL Pen) { - int x1, x2; - int start_above, end_above; - long rise1, run1, rise2, run2; + int x1, x2; + int start_above, end_above; + long rise1, run1, rise2, run2; - rise1 = p1.y - p0.y; - run1 = p1.x - p0.x; - rise2 = p2.y - p0.y; - run2 = p2.x - p0.x; + rise1 = p1.y - p0.y; + run1 = p1.x - p0.x; + rise2 = p2.y - p0.y; + run2 = p2.x - p0.x; - if (r.y <= p0.y) // + if (r.y <= p0.y) // + { + /* in top half of arc ellipse */ + + if (p1.y <= r.y) { - /* in top half of arc ellipse */ + /* start_line is in the top half and is */ + /* intersected by the current Y scan line */ + if (rise1 == 0) + x1 = p1.x; + else + x1 = p0.x + (r.y-p0.y)*run1/rise1; + start_above = 1; + } + else if ((start_angle >= 0) && (start_angle <= 180)) + { + /* start_line is above middle */ + x1 = p1.x; + start_above = 1; + } + else + { + /* start_line is below middle */ + x1 = r.x + r.width; + start_above = 0; + } + if (x1 < r.x) + x1 = r.x; + if (x1 > r.x+r.width) + x1 = r.x+r.width; - if (p1.y <= r.y) - { - /* start_line is in the top half and is */ - /* intersected by the current Y scan line */ - if (rise1 == 0) - x1 = p1.x; - else - x1 = p0.x + (r.y-p0.y)*run1/rise1; - start_above = 1; - } - else if ((start_angle >= 0) && (start_angle <= 180)) - { - /* start_line is above middle */ - x1 = p1.x; - start_above = 1; - } - else - { - /* start_line is below middle */ - x1 = r.x + r.width; - start_above = 0; - } - if (x1 < r.x) - x1 = r.x; - if (x1 > r.x+r.width) - x1 = r.x+r.width; + if (p2.y <= r.y) + { + /* end_line is in the top half and is */ + /* intersected by the current Y scan line */ + if (rise2 == 0) + x2 = p2.x; + else + x2 = p0.x + (r.y-p0.y)*run2/rise2; + end_above = 1; + } + else if ((end_angle >= 0) && (end_angle <= 180)) + { + /* end_line is above middle */ + x2 = p2.x; + end_above = 1; + } + else + { + /* end_line is below middle */ + x2 = r.x; + end_above = 0; + } - if (p2.y <= r.y) - { - /* end_line is in the top half and is */ - /* intersected by the current Y scan line */ - if (rise2 == 0) - x2 = p2.x; - else - x2 = p0.x + (r.y-p0.y)*run2/rise2; - end_above = 1; - } - else if ((end_angle >= 0) && (end_angle <= 180)) - { - /* end_line is above middle */ - x2 = p2.x; - end_above = 1; - } - else - { - /* end_line is below middle */ - x2 = r.x; - end_above = 0; - } + if (x2 < r.x) x2 = r.x; - if (x2 < r.x) x2 = r.x; + if (x2 > r.x+r.width) x2 = r.x+r.width; - if (x2 > r.x+r.width) x2 = r.x+r.width; + if (start_above && end_above) + { + if (start_angle > end_angle) + { + /* fill outsides of wedge */ + if (! app_fill_rect(g, rect(r.x, r.y, + x1-r.x, r.height), pbrush, Pen)) + return 0; + return app_fill_rect(g, rect(x2, r.y, + r.x+r.width-x2, r.height), pbrush, Pen); + } + else + { + /* fill inside of wedge */ + r.width = x1-x2; + r.x = x2; + return app_fill_rect(g, r, pbrush, Pen); + } + } + else if (start_above) + { + /* fill to the left of the start_line */ + r.width = x1-r.x; + return app_fill_rect(g, r, pbrush, Pen); + } + else if (end_above) + { + /* fill right of end_line */ + r.width = r.x+r.width-x2; + r.x = x2; + return app_fill_rect(g, r, pbrush, Pen); + } + else + { + if (start_angle > end_angle) + return app_fill_rect(g,r, pbrush, Pen); + else + return 1; + } + } + else + { + /* in lower half of arc ellipse */ - if (start_above && end_above) - { - if (start_angle > end_angle) - { - /* fill outsides of wedge */ - if (! app_fill_rect(g, rect(r.x, r.y, - x1-r.x, r.height), pbrush, Pen)) - return 0; - return app_fill_rect(g, rect(x2, r.y, - r.x+r.width-x2, r.height), pbrush, Pen); - } - else - { - /* fill inside of wedge */ - r.width = x1-x2; - r.x = x2; - return app_fill_rect(g, r, pbrush, Pen); - } - } - else if (start_above) - { - /* fill to the left of the start_line */ - r.width = x1-r.x; - return app_fill_rect(g, r, pbrush, Pen); - } - else if (end_above) - { - /* fill right of end_line */ - r.width = r.x+r.width-x2; - r.x = x2; - return app_fill_rect(g, r, pbrush, Pen); - } - else - { - if (start_angle > end_angle) - return app_fill_rect(g,r, pbrush, Pen); - else - return 1; - } - } - else - { - /* in lower half of arc ellipse */ + if (p1.y >= r.y) + { + /* start_line is in the lower half and is */ + /* intersected by the current Y scan line */ + if (rise1 == 0) + x1 = p1.x; + else + x1 = p0.x + (r.y-p0.y)*run1/rise1; + start_above = 0; + } + else if ((start_angle >= 180) && (start_angle <= 360)) + { + /* start_line is below middle */ + x1 = p1.x; + start_above = 0; + } + else + { + /* start_line is above middle */ + x1 = r.x; + start_above = 1; + } + if (x1 < r.x) + x1 = r.x; + if (x1 > r.x+r.width) + x1 = r.x+r.width; - if (p1.y >= r.y) - { - /* start_line is in the lower half and is */ - /* intersected by the current Y scan line */ - if (rise1 == 0) - x1 = p1.x; - else - x1 = p0.x + (r.y-p0.y)*run1/rise1; - start_above = 0; - } - else if ((start_angle >= 180) && (start_angle <= 360)) - { - /* start_line is below middle */ - x1 = p1.x; - start_above = 0; - } - else - { - /* start_line is above middle */ - x1 = r.x; - start_above = 1; - } - if (x1 < r.x) - x1 = r.x; - if (x1 > r.x+r.width) - x1 = r.x+r.width; + if (p2.y >= r.y) + { + /* end_line is in the lower half and is */ + /* intersected by the current Y scan line */ + if (rise2 == 0) + x2 = p2.x; + else + x2 = p0.x + (r.y-p0.y)*run2/rise2; + end_above = 0; + } + else if ((end_angle >= 180) && (end_angle <= 360)) + { + /* end_line is below middle */ + x2 = p2.x; + end_above = 0; + } + else + { + /* end_line is above middle */ + x2 = r.x + r.width; + end_above = 1; + } + if (x2 < r.x) + x2 = r.x; + if (x2 > r.x+r.width) + x2 = r.x+r.width; - if (p2.y >= r.y) - { - /* end_line is in the lower half and is */ - /* intersected by the current Y scan line */ - if (rise2 == 0) - x2 = p2.x; - else - x2 = p0.x + (r.y-p0.y)*run2/rise2; - end_above = 0; - } - else if ((end_angle >= 180) && (end_angle <= 360)) - { - /* end_line is below middle */ - x2 = p2.x; - end_above = 0; - } - else - { - /* end_line is above middle */ - x2 = r.x + r.width; - end_above = 1; - } - if (x2 < r.x) - x2 = r.x; - if (x2 > r.x+r.width) - x2 = r.x+r.width; - - if (start_above && end_above) - { - if (start_angle > end_angle) - return app_fill_rect(g,r, pbrush, Pen); - else - return 1; - } - else if (start_above) - { - /* fill to the left of end_line */ - r.width = x2-r.x; - return app_fill_rect(g,r, pbrush, Pen); - } - else if (end_above) - { - /* fill right of start_line */ - r.width = r.x+r.width-x1; - r.x = x1; - return app_fill_rect(g,r, pbrush, Pen); - } - else - { - if (start_angle > end_angle) - { - /* fill outsides of wedge */ - if (! app_fill_rect(g, rect(r.x, r.y, - x2-r.x, r.height), pbrush, Pen)) - return 0; - return app_fill_rect(g, rect(x1, r.y, - r.x+r.width-x1, r.height), pbrush, Pen); - } - else - { - /* fill inside of wedge */ - r.width = x2-x1; - r.x = x1; - return app_fill_rect(g, r, pbrush, Pen); - } - } - } + if (start_above && end_above) + { + if (start_angle > end_angle) + return app_fill_rect(g,r, pbrush, Pen); + else + return 1; + } + else if (start_above) + { + /* fill to the left of end_line */ + r.width = x2-r.x; + return app_fill_rect(g,r, pbrush, Pen); + } + else if (end_above) + { + /* fill right of start_line */ + r.width = r.x+r.width-x1; + r.x = x1; + return app_fill_rect(g,r, pbrush, Pen); + } + else + { + if (start_angle > end_angle) + { + /* fill outsides of wedge */ + if (! app_fill_rect(g, rect(r.x, r.y, + x2-r.x, r.height), pbrush, Pen)) + return 0; + return app_fill_rect(g, rect(x1, r.y, + r.x+r.width-x1, r.height), pbrush, Pen); + } + else + { + /* fill inside of wedge */ + r.width = x2-x1; + r.x = x1; + return app_fill_rect(g, r, pbrush, Pen); + } + } + } } /* @@ -608,110 +620,125 @@ int FASTCALL app_fill_ellipse(DC *g, Rect r, PBRUSH pbrush) { - /* e(x,y) = b*b*x*x + a*a*y*y - a*a*b*b */ + /* e(x,y) = b*b*x*x + a*a*y*y - a*a*b*b */ - int a = r.width / 2; - int b = r.height / 2; - int x = 0; - int y = b; - long a2 = a*a; - long b2 = b*b; - long xcrit = (3 * a2 / 4) + 1; - long ycrit = (3 * b2 / 4) + 1; - long t = b2 + a2 - 2*a2*b; /* t = e(x+1,y-1) */ - long dxt = b2*(3+x+x); - long dyt = a2*(3-y-y); - int d2xt = b2+b2; - int d2yt = a2+a2; - Rect r1, r2; - int result = 1; + int a = r.width / 2; + int b = r.height / 2; + int x = 0; + int y = b; + long a2 = a*a; + long b2 = b*b; + long xcrit = (3 * a2 / 4) + 1; + long ycrit = (3 * b2 / 4) + 1; + long t = b2 + a2 - 2*a2*b; /* t = e(x+1,y-1) */ + long dxt = b2*(3+x+x); + long dyt = a2*(3-y-y); + int d2xt = b2+b2; + int d2yt = a2+a2; + Rect r1, r2; + int result = 1; // START_DEBUG(); - if ((r.width <= 2) || (r.height <= 2)) - return app_fill_rect(g, r, pbrush, FALSE); + if ((r.width <= 2) || (r.height <= 2)) + return app_fill_rect(g, r, pbrush, FALSE); - r1.x = r.x + a; - r1.y = r.y; - r1.width = r.width & 1; /* i.e. if width is odd */ - r1.height = 1; + r1.x = r.x + a; + r1.y = r.y; + r1.width = r.width & 1; /* i.e. if width is odd */ + r1.height = 1; - r2 = r1; - r2.y = r.y + r.height - 1; + r2 = r1; + r2.y = r.y + r.height - 1; - while (y > 0) - { - if (t + a2*y < xcrit) { /* e(x+1,y-1/2) <= 0 */ - /* move outwards to encounter edge */ - x += 1; - t += dxt; - dxt += d2xt; + while (y > 0) + { + if (t + a2*y < xcrit) /* e(x+1,y-1/2) <= 0 */ + { + /* move outwards to encounter edge */ + x += 1; + t += dxt; + dxt += d2xt; - /* move outwards */ - r1.x -= 1; r1.width += 2; - r2.x -= 1; r2.width += 2; - } - else if (t - b2*x >= ycrit) { /* e(x+1/2,y-1) > 0 */ - /* drop down one line */ - y -= 1; - t += dyt; - dyt += d2yt; + /* move outwards */ + r1.x -= 1; + r1.width += 2; + r2.x -= 1; + r2.width += 2; + } + else if (t - b2*x >= ycrit) /* e(x+1/2,y-1) > 0 */ + { + /* drop down one line */ + y -= 1; + t += dyt; + dyt += d2yt; - /* enlarge rectangles */ - r1.height += 1; - r2.height += 1; r2.y -= 1; - } - else { - /* drop diagonally down and out */ - x += 1; - y -= 1; - t += dxt + dyt; - dxt += d2xt; - dyt += d2yt; + /* enlarge rectangles */ + r1.height += 1; + r2.height += 1; + r2.y -= 1; + } + else + { + /* drop diagonally down and out */ + x += 1; + y -= 1; + t += dxt + dyt; + dxt += d2xt; + dyt += d2yt; - if ((r1.width > 0) && (r1.height > 0)) - { - /* draw rectangles first */ + if ((r1.width > 0) && (r1.height > 0)) + { + /* draw rectangles first */ - if (r1.y+r1.height < r2.y) { - /* distinct rectangles */ - result &= app_fill_rect(g, r1, pbrush, FALSE); - result &= app_fill_rect(g, r2, pbrush, FALSE); - } + if (r1.y+r1.height < r2.y) + { + /* distinct rectangles */ + result &= app_fill_rect(g, r1, pbrush, FALSE); + result &= app_fill_rect(g, r2, pbrush, FALSE); + } - /* move down */ - r1.y += r1.height; r1.height = 1; - r2.y -= 1; r2.height = 1; - } - else { - /* skipped pixels on initial diagonal */ + /* move down */ + r1.y += r1.height; + r1.height = 1; + r2.y -= 1; + r2.height = 1; + } + else + { + /* skipped pixels on initial diagonal */ - /* enlarge, rather than moving down */ - r1.height += 1; - r2.height += 1; r2.y -= 1; - } + /* enlarge, rather than moving down */ + r1.height += 1; + r2.height += 1; + r2.y -= 1; + } - /* move outwards */ - r1.x -= 1; r1.width += 2; - r2.x -= 1; r2.width += 2; - } - } - if (r1.y < r2.y) { - /* overlap */ - r1.x = r.x; - r1.width = r.width; - r1.height = r2.y+r2.height-r1.y; - result &= app_fill_rect(g, r1, pbrush, FALSE); - } - else if (x <= a) { - /* crossover, draw final line */ - r1.x = r.x; - r1.width = r.width; - r1.height = r1.y+r1.height-r2.y; - r1.y = r2.y; - result &= app_fill_rect(g, r1, pbrush, FALSE); - } - return result; + /* move outwards */ + r1.x -= 1; + r1.width += 2; + r2.x -= 1; + r2.width += 2; + } + } + if (r1.y < r2.y) + { + /* overlap */ + r1.x = r.x; + r1.width = r.width; + r1.height = r2.y+r2.height-r1.y; + result &= app_fill_rect(g, r1, pbrush, FALSE); + } + else if (x <= a) + { + /* crossover, draw final line */ + r1.x = r.x; + r1.width = r.width; + r1.height = r1.y+r1.height-r2.y; + r1.y = r2.y; + result &= app_fill_rect(g, r1, pbrush, FALSE); + } + return result; } static @@ -719,465 +746,495 @@ POINT FASTCALL app_boundary_point(Rect r, int angle) { - int cx, cy; - double tangent; + int cx, cy; + double tangent; - cx = r.width; - cx /= 2; - cx += r.x; + cx = r.width; + cx /= 2; + cx += r.x; - cy = r.height; - cy /= 2; - cy += r.y; + cy = r.height; + cy /= 2; + cy += r.y; - if (angle == 0) - return pt(r.x+r.width, cy); - else if (angle == 45) - return pt(r.x+r.width, r.y); - else if (angle == 90) - return pt(cx, r.y); - else if (angle == 135) - return pt(r.x, r.y); - else if (angle == 180) - return pt(r.x, cy); - else if (angle == 225) - return pt(r.x, r.y+r.height); - else if (angle == 270) - return pt(cx, r.y+r.height); - else if (angle == 315) - return pt(r.x+r.width, r.y+r.height); + if (angle == 0) + return pt(r.x+r.width, cy); + else if (angle == 45) + return pt(r.x+r.width, r.y); + else if (angle == 90) + return pt(cx, r.y); + else if (angle == 135) + return pt(r.x, r.y); + else if (angle == 180) + return pt(r.x, cy); + else if (angle == 225) + return pt(r.x, r.y+r.height); + else if (angle == 270) + return pt(cx, r.y+r.height); + else if (angle == 315) + return pt(r.x+r.width, r.y+r.height); - tangent = tan(DEGREES_TO_RADIANS(angle)); + tangent = tan(DEGREES_TO_RADIANS(angle)); - if ((angle > 45) && (angle < 135)) - return pt((int)(cx+r.height/tangent/2), r.y); - else if ((angle > 225) && (angle < 315)) - return pt((int)(cx-r.height/tangent/2), r.y+r.height); - else if ((angle > 135) && (angle < 225)) - return pt(r.x, (int)(cy+r.width*tangent/2)); - else - return pt(r.x+r.width, (int)(cy-r.width*tangent/2)); + if ((angle > 45) && (angle < 135)) + return pt((int)(cx+r.height/tangent/2), r.y); + else if ((angle > 225) && (angle < 315)) + return pt((int)(cx-r.height/tangent/2), r.y+r.height); + else if ((angle > 135) && (angle < 225)) + return pt(r.x, (int)(cy+r.width*tangent/2)); + else + return pt(r.x+r.width, (int)(cy-r.width*tangent/2)); } int FASTCALL app_fill_arc(DC *g, Rect r, int start_angle, int end_angle, PBRUSH pbrush, BOOL Chord) { - /* e(x,y) = b*b*x*x + a*a*y*y - a*a*b*b */ + /* e(x,y) = b*b*x*x + a*a*y*y - a*a*b*b */ - int a = r.width / 2; - int b = r.height / 2; - int x = 0; - int y = b; - long a2 = a*a; - long b2 = b*b; - long xcrit = (3 * a2 / 4) + 1; - long ycrit = (3 * b2 / 4) + 1; - long t = b2 + a2 - 2*a2*b; /* t = e(x+1,y-1) */ - long dxt = b2*(3+x+x); - long dyt = a2*(3-y-y); - int d2xt = b2+b2; - int d2yt = a2+a2; - Rect r1, r2; - int movedown, moveout; - int result = 1; + int a = r.width / 2; + int b = r.height / 2; + int x = 0; + int y = b; + long a2 = a*a; + long b2 = b*b; + long xcrit = (3 * a2 / 4) + 1; + long ycrit = (3 * b2 / 4) + 1; + long t = b2 + a2 - 2*a2*b; /* t = e(x+1,y-1) */ + long dxt = b2*(3+x+x); + long dyt = a2*(3-y-y); + int d2xt = b2+b2; + int d2yt = a2+a2; + Rect r1, r2; + int movedown, moveout; + int result = 1; - /* line descriptions */ - POINT p0, p1, p2; + /* line descriptions */ + POINT p0, p1, p2; // START_DEBUG(); - /* if angles differ by 360 degrees or more, close the shape */ - if ((start_angle + 360 <= end_angle) || - (start_angle - 360 >= end_angle)) - { - return app_fill_ellipse(g, r, pbrush); - } + /* if angles differ by 360 degrees or more, close the shape */ + if ((start_angle + 360 <= end_angle) || + (start_angle - 360 >= end_angle)) + { + return app_fill_ellipse(g, r, pbrush); + } - /* make start_angle >= 0 and <= 360 */ - while (start_angle < 0) - start_angle += 360; - start_angle %= 360; + /* make start_angle >= 0 and <= 360 */ + while (start_angle < 0) + start_angle += 360; + start_angle %= 360; - /* make end_angle >= 0 and <= 360 */ - while (end_angle < 0) - end_angle += 360; - end_angle %= 360; + /* make end_angle >= 0 and <= 360 */ + while (end_angle < 0) + end_angle += 360; + end_angle %= 360; - /* draw nothing if the angles are equal */ - if (start_angle == end_angle) - return 1; + /* draw nothing if the angles are equal */ + if (start_angle == end_angle) + return 1; - /* find arc wedge line end points */ - p1 = app_boundary_point(r, start_angle); - p2 = app_boundary_point(r, end_angle); - if (Chord) - p0 = pt((p1.x+p2.x)/2,(p1.y+p2.y)/2); - else - p0 = pt(r.x + r.width/2, r.y + r.height/2); + /* find arc wedge line end points */ + p1 = app_boundary_point(r, start_angle); + p2 = app_boundary_point(r, end_angle); + if (Chord) + p0 = pt((p1.x+p2.x)/2,(p1.y+p2.y)/2); + else + p0 = pt(r.x + r.width/2, r.y + r.height/2); - /* initialise rectangles to be drawn */ - r1.x = r.x + a; - r1.y = r.y; - r1.width = r.width & 1; /* i.e. if width is odd */ - r1.height = 1; + /* initialise rectangles to be drawn */ + r1.x = r.x + a; + r1.y = r.y; + r1.width = r.width & 1; /* i.e. if width is odd */ + r1.height = 1; - r2 = r1; - r2.y = r.y + r.height - 1; + r2 = r1; + r2.y = r.y + r.height - 1; - while (y > 0) - { - moveout = movedown = 0; + while (y > 0) + { + moveout = movedown = 0; - if (t + a2*y < xcrit) { /* e(x+1,y-1/2) <= 0 */ - /* move outwards to encounter edge */ - x += 1; - t += dxt; - dxt += d2xt; + if (t + a2*y < xcrit) /* e(x+1,y-1/2) <= 0 */ + { + /* move outwards to encounter edge */ + x += 1; + t += dxt; + dxt += d2xt; - moveout = 1; - } - else if (t - b2*x >= ycrit) { /* e(x+1/2,y-1) > 0 */ - /* drop down one line */ - y -= 1; - t += dyt; - dyt += d2yt; + moveout = 1; + } + else if (t - b2*x >= ycrit) /* e(x+1/2,y-1) > 0 */ + { + /* drop down one line */ + y -= 1; + t += dyt; + dyt += d2yt; - movedown = 1; - } - else { - /* drop diagonally down and out */ - x += 1; - y -= 1; - t += dxt + dyt; - dxt += d2xt; - dyt += d2yt; + movedown = 1; + } + else + { + /* drop diagonally down and out */ + x += 1; + y -= 1; + t += dxt + dyt; + dxt += d2xt; + dyt += d2yt; - moveout = 1; - movedown = 1; - } + moveout = 1; + movedown = 1; + } - if (movedown) { - if (r1.width == 0) { - r1.x -= 1; r1.width += 2; - r2.x -= 1; r2.width += 2; - moveout = 0; - } + if (movedown) + { + if (r1.width == 0) + { + r1.x -= 1; + r1.width += 2; + r2.x -= 1; + r2.width += 2; + moveout = 0; + } - if (r1.x < r.x) - r1.x = r2.x = r.x; - if (r1.width > r.width) - r1.width = r2.width = r.width; - if (r1.y == r2.y-1) { - r1.x = r2.x = r.x; - r1.width = r2.width = r.width; - } + if (r1.x < r.x) + r1.x = r2.x = r.x; + if (r1.width > r.width) + r1.width = r2.width = r.width; + if (r1.y == r2.y-1) + { + r1.x = r2.x = r.x; + r1.width = r2.width = r.width; + } - if ((r1.width > 0) && (r1.y+r1.height < r2.y)) { - /* distinct rectangles */ - result &= app_fill_arc_rect(g, r1, - p0, p1, p2, - start_angle, end_angle, pbrush, FALSE); - result &= app_fill_arc_rect(g, r2, - p0, p1, p2, - start_angle, end_angle, pbrush, FALSE); - } + if ((r1.width > 0) && (r1.y+r1.height < r2.y)) + { + /* distinct rectangles */ + result &= app_fill_arc_rect(g, r1, + p0, p1, p2, + start_angle, end_angle, pbrush, FALSE); + result &= app_fill_arc_rect(g, r2, + p0, p1, p2, + start_angle, end_angle, pbrush, FALSE); + } - /* move down */ - r1.y += 1; - r2.y -= 1; - } + /* move down */ + r1.y += 1; + r2.y -= 1; + } - if (moveout) { - /* move outwards */ - r1.x -= 1; r1.width += 2; - r2.x -= 1; r2.width += 2; - } - } - if (r1.y < r2.y) { - /* overlap */ - r1.x = r.x; - r1.width = r.width; - r1.height = r2.y+r2.height-r1.y; - while (r1.height > 0) { - result &= app_fill_arc_rect(g, - rect(r1.x, r1.y, r1.width, 1), - p0, p1, p2, start_angle, end_angle, pbrush, FALSE); - r1.y += 1; - r1.height -= 1; - } - } - else if (x <= a) { - /* crossover, draw final line */ - r1.x = r.x; - r1.width = r.width; - r1.height = r1.y+r1.height-r2.y; - r1.y = r2.y; - while (r1.height > 0) { - result &= app_fill_arc_rect(g, - rect(r1.x, r1.y, r1.width, 1), - p0, p1, p2, start_angle, end_angle, pbrush, FALSE); - r1.y += 1; - r1.height -= 1; - } - } - return result; + if (moveout) + { + /* move outwards */ + r1.x -= 1; + r1.width += 2; + r2.x -= 1; + r2.width += 2; + } + } + if (r1.y < r2.y) + { + /* overlap */ + r1.x = r.x; + r1.width = r.width; + r1.height = r2.y+r2.height-r1.y; + while (r1.height > 0) + { + result &= app_fill_arc_rect(g, + rect(r1.x, r1.y, r1.width, 1), + p0, p1, p2, start_angle, end_angle, pbrush, FALSE); + r1.y += 1; + r1.height -= 1; + } + } + else if (x <= a) + { + /* crossover, draw final line */ + r1.x = r.x; + r1.width = r.width; + r1.height = r1.y+r1.height-r2.y; + r1.y = r2.y; + while (r1.height > 0) + { + result &= app_fill_arc_rect(g, + rect(r1.x, r1.y, r1.width, 1), + p0, p1, p2, start_angle, end_angle, pbrush, FALSE); + r1.y += 1; + r1.height -= 1; + } + } + return result; } int app_draw_arc(DC *g, Rect r, int start_angle, int end_angle, PBRUSH pbrushPen, BOOL Chord) { - /* Outer ellipse: e(x,y) = b*b*x*x + a*a*y*y - a*a*b*b */ + /* Outer ellipse: e(x,y) = b*b*x*x + a*a*y*y - a*a*b*b */ - int a = r.width / 2; - int b = r.height / 2; - int x = 0; - int y = b; - long a2 = a*a; - long b2 = b*b; - long xcrit = (3 * a2 / 4) + 1; - long ycrit = (3 * b2 / 4) + 1; - long t = b2 + a2 - 2*a2*b; /* t = e(x+1,y-1) */ - long dxt = b2*(3+x+x); - long dyt = a2*(3-y-y); - int d2xt = b2+b2; - int d2yt = a2+a2; + int a = r.width / 2; + int b = r.height / 2; + int x = 0; + int y = b; + long a2 = a*a; + long b2 = b*b; + long xcrit = (3 * a2 / 4) + 1; + long ycrit = (3 * b2 / 4) + 1; + long t = b2 + a2 - 2*a2*b; /* t = e(x+1,y-1) */ + long dxt = b2*(3+x+x); + long dyt = a2*(3-y-y); + int d2xt = b2+b2; + int d2yt = a2+a2; - int w = pbrushPen->ptPenWidth.x; + int w = pbrushPen->ptPenWidth.x; - /* Inner ellipse: E(X,Y) = B*B*X*X + A*A*Y*Y - A*A*B*B */ + /* Inner ellipse: E(X,Y) = B*B*X*X + A*A*Y*Y - A*A*B*B */ - int A = a-w > 0 ? a-w : 0; - int B = b-w > 0 ? b-w : 0; - int X = 0; - int Y = B; - long A2 = A*A; - long B2 = B*B; - long XCRIT = (3 * A2 / 4) + 1; - long YCRIT = (3 * B2 / 4) + 1; - long T = B2 + A2 - 2*A2*B; /* T = E(X+1,Y-1) */ - long DXT = B2*(3+X+X); - long DYT = A2*(3-Y-Y); - int D2XT = B2+B2; - int D2YT = A2+A2; + int A = a-w > 0 ? a-w : 0; + int B = b-w > 0 ? b-w : 0; + int X = 0; + int Y = B; + long A2 = A*A; + long B2 = B*B; + long XCRIT = (3 * A2 / 4) + 1; + long YCRIT = (3 * B2 / 4) + 1; + long T = B2 + A2 - 2*A2*B; /* T = E(X+1,Y-1) */ + long DXT = B2*(3+X+X); + long DYT = A2*(3-Y-Y); + int D2XT = B2+B2; + int D2YT = A2+A2; - /* arc rectangle calculations */ - int movedown, moveout; - int innerX = 0, prevx, prevy, W; - Rect r1, r2; - int result = 1; + /* arc rectangle calculations */ + int movedown, moveout; + int innerX = 0, prevx, prevy, W; + Rect r1, r2; + int result = 1; - /* line descriptions */ - POINT p0, p1, p2; + /* line descriptions */ + POINT p0, p1, p2; // START_DEBUG(); - /* if angles differ by 360 degrees or more, close the shape */ - if ((start_angle + 360 <= end_angle) || - (start_angle - 360 >= end_angle)) - { - return app_draw_ellipse(g, r, pbrushPen); - } + /* if angles differ by 360 degrees or more, close the shape */ + if ((start_angle + 360 <= end_angle) || + (start_angle - 360 >= end_angle)) + { + return app_draw_ellipse(g, r, pbrushPen); + } - /* make start_angle >= 0 and <= 360 */ - while (start_angle < 0) - start_angle += 360; - start_angle %= 360; + /* make start_angle >= 0 and <= 360 */ + while (start_angle < 0) + start_angle += 360; + start_angle %= 360; - /* make end_angle >= 0 and <= 360 */ - while (end_angle < 0) - end_angle += 360; - end_angle %= 360; + /* make end_angle >= 0 and <= 360 */ + while (end_angle < 0) + end_angle += 360; + end_angle %= 360; - /* draw nothing if the angles are equal */ - if (start_angle == end_angle) - return 1; + /* draw nothing if the angles are equal */ + if (start_angle == end_angle) + return 1; - /* find arc wedge line end points */ - p1 = app_boundary_point(r, start_angle); - p2 = app_boundary_point(r, end_angle); - if (Chord) - p0 = pt((p1.x+p2.x)/2,(p1.y+p2.y)/2); - else - p0 = pt(r.x + r.width/2, r.y + r.height/2); + /* find arc wedge line end points */ + p1 = app_boundary_point(r, start_angle); + p2 = app_boundary_point(r, end_angle); + if (Chord) + p0 = pt((p1.x+p2.x)/2,(p1.y+p2.y)/2); + else + p0 = pt(r.x + r.width/2, r.y + r.height/2); - /* determine ellipse rectangles */ - r1.x = r.x + a; - r1.y = r.y; - r1.width = r.width & 1; /* i.e. if width is odd */ - r1.height = 1; + /* determine ellipse rectangles */ + r1.x = r.x + a; + r1.y = r.y; + r1.width = r.width & 1; /* i.e. if width is odd */ + r1.height = 1; - r2 = r1; - r2.y = r.y + r.height - 1; + r2 = r1; + r2.y = r.y + r.height - 1; - prevx = r1.x; - prevy = r1.y; + prevx = r1.x; + prevy = r1.y; - while (y > 0) - { - while (Y == y) - { - innerX = X; + while (y > 0) + { + while (Y == y) + { + innerX = X; - if (T + A2*Y < XCRIT) /* E(X+1,Y-1/2) <= 0 */ - { - /* move outwards to encounter edge */ - X += 1; - T += DXT; - DXT += D2XT; - } - else if (T - B2*X >= YCRIT) /* e(x+1/2,y-1) > 0 */ - { - /* drop down one line */ - Y -= 1; - T += DYT; - DYT += D2YT; - } - else { - /* drop diagonally down and out */ - X += 1; - Y -= 1; - T += DXT + DYT; - DXT += D2XT; - DYT += D2YT; - } - } + if (T + A2*Y < XCRIT) /* E(X+1,Y-1/2) <= 0 */ + { + /* move outwards to encounter edge */ + X += 1; + T += DXT; + DXT += D2XT; + } + else if (T - B2*X >= YCRIT) /* e(x+1/2,y-1) > 0 */ + { + /* drop down one line */ + Y -= 1; + T += DYT; + DYT += D2YT; + } + else + { + /* drop diagonally down and out */ + X += 1; + Y -= 1; + T += DXT + DYT; + DXT += D2XT; + DYT += D2YT; + } + } - movedown = moveout = 0; + movedown = moveout = 0; - W = x - innerX; - if (r1.x + W < prevx) - W = prevx - r1.x; - if (W < w) - W = w; + W = x - innerX; + if (r1.x + W < prevx) + W = prevx - r1.x; + if (W < w) + W = w; - if (t + a2*y < xcrit) /* e(x+1,y-1/2) <= 0 */ - { - /* move outwards to encounter edge */ - x += 1; - t += dxt; - dxt += d2xt; + if (t + a2*y < xcrit) /* e(x+1,y-1/2) <= 0 */ + { + /* move outwards to encounter edge */ + x += 1; + t += dxt; + dxt += d2xt; - moveout = 1; - } - else if (t - b2*x >= ycrit) /* e(x+1/2,y-1) > 0 */ - { - /* drop down one line */ - y -= 1; - t += dyt; - dyt += d2yt; + moveout = 1; + } + else if (t - b2*x >= ycrit) /* e(x+1/2,y-1) > 0 */ + { + /* drop down one line */ + y -= 1; + t += dyt; + dyt += d2yt; - movedown = 1; - } - else { - /* drop diagonally down and out */ - x += 1; - y -= 1; - t += dxt + dyt; - dxt += d2xt; - dyt += d2yt; + movedown = 1; + } + else + { + /* drop diagonally down and out */ + x += 1; + y -= 1; + t += dxt + dyt; + dxt += d2xt; + dyt += d2yt; - movedown = 1; - moveout = 1; - } + movedown = 1; + moveout = 1; + } - if (movedown) { - if (r1.width == 0) { - r1.x -= 1; r1.width += 2; - r2.x -= 1; r2.width += 2; - moveout = 0; - } + if (movedown) + { + if (r1.width == 0) + { + r1.x -= 1; + r1.width += 2; + r2.x -= 1; + r2.width += 2; + moveout = 0; + } - if (r1.x < r.x) - r1.x = r2.x = r.x; - if (r1.width > r.width) - r1.width = r2.width = r.width; - if (r1.y == r2.y-1) { - r1.x = r2.x = r.x; - r1.width = r2.width = r.width; - } + if (r1.x < r.x) + r1.x = r2.x = r.x; + if (r1.width > r.width) + r1.width = r2.width = r.width; + if (r1.y == r2.y-1) + { + r1.x = r2.x = r.x; + r1.width = r2.width = r.width; + } - if ((r1.y < r.y+w) || (r1.x+W >= r1.x+r1.width-W)) - { - result &= app_fill_arc_rect(g, r1, - p0, p1, p2, - start_angle, end_angle, pbrushPen, TRUE); - result &= app_fill_arc_rect(g, r2, - p0, p1, p2, - start_angle, end_angle, pbrushPen, TRUE); + if ((r1.y < r.y+w) || (r1.x+W >= r1.x+r1.width-W)) + { + result &= app_fill_arc_rect(g, r1, + p0, p1, p2, + start_angle, end_angle, pbrushPen, TRUE); + result &= app_fill_arc_rect(g, r2, + p0, p1, p2, + start_angle, end_angle, pbrushPen, TRUE); - prevx = r1.x; - prevy = r1.y; - } - else if (r1.y+r1.height < r2.y) - { - /* draw distinct rectangles */ - result &= app_fill_arc_rect(g, rect( - r1.x,r1.y,W,1), - p0, p1, p2, - start_angle, end_angle, pbrushPen, TRUE); - result &= app_fill_arc_rect(g, rect( - r1.x+r1.width-W,r1.y,W,1), - p0, p1, p2, - start_angle, end_angle, pbrushPen, TRUE); - result &= app_fill_arc_rect(g, rect( - r2.x,r2.y,W,1), - p0, p1, p2, - start_angle, end_angle, pbrushPen, TRUE); - result &= app_fill_arc_rect(g, rect( - r2.x+r2.width-W,r2.y,W,1), - p0, p1, p2, - start_angle, end_angle, pbrushPen, TRUE); + prevx = r1.x; + prevy = r1.y; + } + else if (r1.y+r1.height < r2.y) + { + /* draw distinct rectangles */ + result &= app_fill_arc_rect(g, rect( + r1.x,r1.y,W,1), + p0, p1, p2, + start_angle, end_angle, pbrushPen, TRUE); + result &= app_fill_arc_rect(g, rect( + r1.x+r1.width-W,r1.y,W,1), + p0, p1, p2, + start_angle, end_angle, pbrushPen, TRUE); + result &= app_fill_arc_rect(g, rect( + r2.x,r2.y,W,1), + p0, p1, p2, + start_angle, end_angle, pbrushPen, TRUE); + result &= app_fill_arc_rect(g, rect( + r2.x+r2.width-W,r2.y,W,1), + p0, p1, p2, + start_angle, end_angle, pbrushPen, TRUE); - prevx = r1.x; - prevy = r1.y; - } + prevx = r1.x; + prevy = r1.y; + } - /* move down */ - r1.y += 1; - r2.y -= 1; - } + /* move down */ + r1.y += 1; + r2.y -= 1; + } - if (moveout) { - /* move outwards */ - r1.x -= 1; r1.width += 2; - r2.x -= 1; r2.width += 2; - } - } - if ((x <= a) && (prevy < r2.y)) { - /* draw final lines */ - r1.height = r1.y+r1.height-r2.y; - r1.y = r2.y; + if (moveout) + { + /* move outwards */ + r1.x -= 1; + r1.width += 2; + r2.x -= 1; + r2.width += 2; + } + } + if ((x <= a) && (prevy < r2.y)) + { + /* draw final lines */ + r1.height = r1.y+r1.height-r2.y; + r1.y = r2.y; - W = w; - if (r.x + W != prevx) - W = prevx - r.x; - if (W < w) - W = w; + W = w; + if (r.x + W != prevx) + W = prevx - r.x; + if (W < w) + W = w; - if (W+W >= r.width) { - while (r1.height > 0) { - result &= app_fill_arc_rect(g, rect(r.x, - r1.y, r.width, 1), p0, p1, p2, - start_angle, end_angle, pbrushPen, TRUE); - r1.y += 1; - r1.height -= 1; - } - return result; - } + if (W+W >= r.width) + { + while (r1.height > 0) + { + result &= app_fill_arc_rect(g, rect(r.x, + r1.y, r.width, 1), p0, p1, p2, + start_angle, end_angle, pbrushPen, TRUE); + r1.y += 1; + r1.height -= 1; + } + return result; + } - while (r1.height > 0) { - result &= app_fill_arc_rect(g, rect(r.x, r1.y, - W, 1), p0, p1, p2, - start_angle, end_angle, pbrushPen, TRUE); - result &= app_fill_arc_rect(g, rect(r.x+r.width-W, - r1.y, W, 1), p0, p1, p2, - start_angle, end_angle, pbrushPen, TRUE); - r1.y += 1; - r1.height -= 1; - } - } + while (r1.height > 0) + { + result &= app_fill_arc_rect(g, rect(r.x, r1.y, + W, 1), p0, p1, p2, + start_angle, end_angle, pbrushPen, TRUE); + result &= app_fill_arc_rect(g, rect(r.x+r.width-W, + r1.y, W, 1), p0, p1, p2, + start_angle, end_angle, pbrushPen, TRUE); + r1.y += 1; + r1.height -= 1; + } + } - return result; + return result; } /* ReactOS Interface *********************************************************/ @@ -1192,67 +1249,65 @@ IntFillRect( DC *dc, PBRUSH pbrush, BOOL Pen) { - DWORD ROP = PATCOPY; - RECTL DestRect; - SURFACE *psurf; - POINTL BrushOrigin; - BOOL Ret = TRUE; - PDC_ATTR pdcattr; + DWORD ROP = ROP4_FROM_INDEX(R3_OPINDEX_PATCOPY); + RECTL DestRect; + SURFACE *psurf; + POINTL BrushOrigin; + BOOL Ret = TRUE; + PDC_ATTR pdcattr; - ASSERT(pbrush); + ASSERT(pbrush); - psurf = dc->dclevel.pSurface; - if (psurf == NULL) - { - EngSetLastError(ERROR_INVALID_HANDLE); - return 0; - } + psurf = dc->dclevel.pSurface; + if (psurf == NULL) + { + EngSetLastError(ERROR_INVALID_HANDLE); + return 0; + } - if (!(pbrush->flAttrs & GDIBRUSH_IS_NULL)) - { - pdcattr = dc->pdcattr; + if (!(pbrush->flAttrs & GDIBRUSH_IS_NULL)) + { + pdcattr = dc->pdcattr; - /* fix negative spaces */ - if (Width < 0) - { - XLeft += Width; - Width = 0 - Width; - } - if (Height < 0) - { - YLeft += Height; - Height = 0 - Height; - } + /* fix negative spaces */ + if (Width < 0) + { + XLeft += Width; + Width = 0 - Width; + } + if (Height < 0) + { + YLeft += Height; + Height = 0 - Height; + } - DestRect.left = XLeft; - DestRect.right = XLeft + Width; + DestRect.left = XLeft; + DestRect.right = XLeft + Width; - DestRect.top = YLeft; - DestRect.bottom = YLeft + Height; + DestRect.top = YLeft; + DestRect.bottom = YLeft + Height; - BrushOrigin.x = pbrush->ptOrigin.x; - BrushOrigin.y = pbrush->ptOrigin.y; + BrushOrigin.x = pbrush->ptOrigin.x; + BrushOrigin.y = pbrush->ptOrigin.y; - if (pdcattr->jROP2 == R2_XORPEN) - ROP = PATINVERT; - else - ROP = PATCOPY; + if (pdcattr->jROP2 == R2_XORPEN) + ROP = ROP4_FROM_INDEX(R3_OPINDEX_PATINVERT); - Ret = IntEngBitBlt( - &psurf->SurfObj, - NULL, - NULL, - dc->rosdc.CombinedClip, - NULL, - &DestRect, - NULL, - NULL, - Pen ? &dc->eboLine.BrushObject : &dc->eboFill.BrushObject, - &BrushOrigin, - ROP3_TO_ROP4(ROP)); - } + Ret = IntEngBitBlt( + &psurf->SurfObj, + NULL, + NULL, + dc->rosdc.CombinedClip, + NULL, + &DestRect, + NULL, + NULL, + Pen ? &dc->eboLine.BrushObject : &dc->eboFill.BrushObject, + &BrushOrigin, + ROP); + } - return (int)Ret; + return (int)Ret; } BOOL @@ -1266,29 +1321,29 @@ IntFillArc( PDC dc, double EndArc, ARCTYPE arctype) { - PDC_ATTR pdcattr; - PBRUSH pbrush; - int Start = ceil(StartArc); - int End = ceil(EndArc); - BOOL Chord = (arctype == GdiTypeChord), ret; + PDC_ATTR pdcattr; + PBRUSH pbrush; + int Start = ceil(StartArc); + int End = ceil(EndArc); + BOOL Chord = (arctype == GdiTypeChord), ret; - pdcattr = dc->pdcattr; + pdcattr = dc->pdcattr; - pbrush = BRUSH_LockBrush(pdcattr->hbrush); - if (!pbrush) - { - DPRINT1("FillArc Fail\n"); - EngSetLastError(ERROR_INTERNAL_ERROR); - return FALSE; - } - // Sort out alignment here. - ret = app_fill_arc(dc, rect( XLeft, YLeft, Width, Height), - (dc->dclevel.flPath & DCPATH_CLOCKWISE) ? -End : -Start, - (dc->dclevel.flPath & DCPATH_CLOCKWISE) ? -Start : -End, - pbrush, Chord); + pbrush = BRUSH_LockBrush(pdcattr->hbrush); + if (!pbrush) + { + DPRINT1("FillArc Fail\n"); + EngSetLastError(ERROR_INTERNAL_ERROR); + return FALSE; + } + // Sort out alignment here. + ret = app_fill_arc(dc, rect( XLeft, YLeft, Width, Height), + (dc->dclevel.flPath & DCPATH_CLOCKWISE) ? -End : -Start, + (dc->dclevel.flPath & DCPATH_CLOCKWISE) ? -Start : -End, + pbrush, Chord); - BRUSH_UnlockBrush(pbrush); - return ret; + BRUSH_UnlockBrush(pbrush); + return ret; } BOOL @@ -1303,14 +1358,14 @@ IntDrawArc( PDC dc, ARCTYPE arctype, PBRUSH pbrush) { - int Start = ceil(StartArc); - int End = ceil(EndArc); - BOOL Chord = (arctype == GdiTypeChord); - // Sort out alignment here. - return app_draw_arc(dc, rect( XLeft, YLeft, Width, Height), - (dc->dclevel.flPath & DCPATH_CLOCKWISE) ? -End : -Start, - (dc->dclevel.flPath & DCPATH_CLOCKWISE) ? -Start : -End, - pbrush, Chord); + int Start = ceil(StartArc); + int End = ceil(EndArc); + BOOL Chord = (arctype == GdiTypeChord); + // Sort out alignment here. + return app_draw_arc(dc, rect( XLeft, YLeft, Width, Height), + (dc->dclevel.flPath & DCPATH_CLOCKWISE) ? -End : -Start, + (dc->dclevel.flPath & DCPATH_CLOCKWISE) ? -Start : -End, + pbrush, Chord); } BOOL @@ -1322,7 +1377,7 @@ IntDrawEllipse( PDC dc, INT Height, PBRUSH pbrush) { - return (BOOL)app_draw_ellipse(dc, rect( XLeft, YLeft, Width, Height), pbrush); + return (BOOL)app_draw_ellipse(dc, rect( XLeft, YLeft, Width, Height), pbrush); } BOOL @@ -1334,7 +1389,7 @@ IntFillEllipse( PDC dc, INT Height, PBRUSH pbrush) { - return (BOOL)app_fill_ellipse(dc, rect( XLeft, YLeft, Width, Height), pbrush); + return (BOOL)app_fill_ellipse(dc, rect( XLeft, YLeft, Width, Height), pbrush); } BOOL @@ -1348,58 +1403,58 @@ IntFillRoundRect( PDC dc, INT Hellipse, PBRUSH pbrush) { - Rect r; - int rx, ry; /* radius in x and y directions */ + Rect r; + int rx, ry; /* radius in x and y directions */ - // x y Width Height - r = rect( Left, Top, abs(Right-Left), abs(Bottom-Top)); - rx = Wellipse/2; - ry = Hellipse/2; + // x y Width Height + r = rect( Left, Top, abs(Right-Left), abs(Bottom-Top)); + rx = Wellipse/2; + ry = Hellipse/2; - if (Wellipse > r.width) - { - if (Hellipse > r.height) // > W > H - app_fill_ellipse(dc, r, pbrush); - else // > W < H - { - app_fill_arc(dc, rect( r.x, r.y, r.width - 1, Hellipse), - 0, 180, pbrush,FALSE); - app_fill_arc(dc, rect(r.x, Bottom - Hellipse - 1, r.width - 1, Hellipse), - 180, 360, pbrush, FALSE); - } - } - else if(Hellipse > r.height) // < W > H - { - app_fill_arc(dc, rect(r.x, r.y, Wellipse, r.height - 1), - 90, 270, pbrush, FALSE); - app_fill_arc(dc, rect(Right - Wellipse - 1, r.y, Wellipse, r.height - 1), - 270, 90, pbrush,FALSE); - } - else // < W < H - { - app_fill_arc(dc, rect(r.x, r.y, rx+rx, ry+ry), - 90, 180, pbrush, FALSE); + if (Wellipse > r.width) + { + if (Hellipse > r.height) // > W > H + app_fill_ellipse(dc, r, pbrush); + else // > W < H + { + app_fill_arc(dc, rect( r.x, r.y, r.width - 1, Hellipse), + 0, 180, pbrush,FALSE); + app_fill_arc(dc, rect(r.x, Bottom - Hellipse - 1, r.width - 1, Hellipse), + 180, 360, pbrush, FALSE); + } + } + else if(Hellipse > r.height) // < W > H + { + app_fill_arc(dc, rect(r.x, r.y, Wellipse, r.height - 1), + 90, 270, pbrush, FALSE); + app_fill_arc(dc, rect(Right - Wellipse - 1, r.y, Wellipse, r.height - 1), + 270, 90, pbrush,FALSE); + } + else // < W < H + { + app_fill_arc(dc, rect(r.x, r.y, rx+rx, ry+ry), + 90, 180, pbrush, FALSE); - app_fill_arc(dc, rect(r.x, r.y+r.height-ry-ry, rx+rx, ry+ry), - 180, 270, pbrush, FALSE); + app_fill_arc(dc, rect(r.x, r.y+r.height-ry-ry, rx+rx, ry+ry), + 180, 270, pbrush, FALSE); - app_fill_arc(dc, rect(r.x+r.width-rx-rx, r.y+r.height-ry-ry, rx+rx, ry+ry), - 270, 360, pbrush,FALSE); + app_fill_arc(dc, rect(r.x+r.width-rx-rx, r.y+r.height-ry-ry, rx+rx, ry+ry), + 270, 360, pbrush,FALSE); - app_fill_arc(dc, rect(r.x+r.width-rx-rx, r.y, rx+rx, ry+ry), - 0, 90, pbrush,FALSE); - } - if (Wellipse < r.width) - { - app_fill_rect(dc, rect(r.x+rx, r.y, r.width-rx-rx, ry+1), pbrush, FALSE); - app_fill_rect(dc, rect(r.x+rx, r.y+r.height-ry+1, r.width-rx-rx, ry-1), pbrush, FALSE); - } - if (Hellipse < r.height) - { - app_fill_rect(dc, rect(r.x, r.y+ry+1, r.width, r.height-ry-ry), pbrush, FALSE); - } + app_fill_arc(dc, rect(r.x+r.width-rx-rx, r.y, rx+rx, ry+ry), + 0, 90, pbrush,FALSE); + } + if (Wellipse < r.width) + { + app_fill_rect(dc, rect(r.x+rx, r.y, r.width-rx-rx, ry+1), pbrush, FALSE); + app_fill_rect(dc, rect(r.x+rx, r.y+r.height-ry+1, r.width-rx-rx, ry-1), pbrush, FALSE); + } + if (Hellipse < r.height) + { + app_fill_rect(dc, rect(r.x, r.y+ry+1, r.width, r.height-ry-ry), pbrush, FALSE); + } - return TRUE; + return TRUE; } @@ -1414,62 +1469,62 @@ IntDrawRoundRect( PDC dc, INT Hellipse, PBRUSH pbrushPen) { - Rect r; - int rx, ry; /* radius in x and y directions */ - int w = pbrushPen->ptPenWidth.x; + Rect r; + int rx, ry; /* radius in x and y directions */ + int w = pbrushPen->ptPenWidth.x; - r = rect( Left, Top, abs(Right-Left), abs(Bottom-Top)); - rx = Wellipse/2; - ry = Hellipse/2; + r = rect( Left, Top, abs(Right-Left), abs(Bottom-Top)); + rx = Wellipse/2; + ry = Hellipse/2; - if (Wellipse > r.width) - { - if (Hellipse > r.height) // > W > H - app_draw_ellipse(dc, r, pbrushPen); - else // > W < H - { - app_draw_arc(dc, rect( r.x, r.y, r.width - 1, Hellipse - 1), + if (Wellipse > r.width) + { + if (Hellipse > r.height) // > W > H + app_draw_ellipse(dc, r, pbrushPen); + else // > W < H + { + app_draw_arc(dc, rect( r.x, r.y, r.width - 1, Hellipse - 1), 0, 180, pbrushPen, FALSE); - app_draw_arc(dc, rect(r.x, Bottom - Hellipse, r.width - 1, Hellipse - 1), + app_draw_arc(dc, rect(r.x, Bottom - Hellipse, r.width - 1, Hellipse - 1), 180, 360, pbrushPen, FALSE); - } - } - else if(Hellipse > r.height) // < W > H - { + } + } + else if(Hellipse > r.height) // < W > H + { app_draw_arc(dc, rect(r.x, r.y, Wellipse - 1, r.height - 1), - 90, 270, pbrushPen, FALSE); + 90, 270, pbrushPen, FALSE); app_draw_arc(dc, rect(Right - Wellipse, r.y, Wellipse - 1, r.height - 1), - 270, 90, pbrushPen, FALSE); - } - else // < W < H - { - app_draw_arc(dc, rect(r.x, r.y, rx+rx, ry+ry), - 90, 180, pbrushPen, FALSE); + 270, 90, pbrushPen, FALSE); + } + else // < W < H + { + app_draw_arc(dc, rect(r.x, r.y, rx+rx, ry+ry), + 90, 180, pbrushPen, FALSE); - app_draw_arc(dc, rect(r.x,r.y+r.height-ry-ry,rx+rx,ry+ry), - 180, 270, pbrushPen, FALSE); + app_draw_arc(dc, rect(r.x,r.y+r.height-ry-ry,rx+rx,ry+ry), + 180, 270, pbrushPen, FALSE); - app_draw_arc(dc, rect(r.x+r.width-rx-rx, r.y+r.height-ry-ry, rx+rx, ry+ry), - 270, 360, pbrushPen, FALSE); + app_draw_arc(dc, rect(r.x+r.width-rx-rx, r.y+r.height-ry-ry, rx+rx, ry+ry), + 270, 360, pbrushPen, FALSE); - app_draw_arc(dc, rect(r.x+r.width-rx-rx,r.y,rx+rx,ry+ry), - 0, 90, pbrushPen, FALSE); - } - if ( Hellipse < r.height) - { - app_fill_rect(dc, rect(r.x, r.y+ry+1, w, r.height-ry-ry), pbrushPen, TRUE); + app_draw_arc(dc, rect(r.x+r.width-rx-rx,r.y,rx+rx,ry+ry), + 0, 90, pbrushPen, FALSE); + } + if ( Hellipse < r.height) + { + app_fill_rect(dc, rect(r.x, r.y+ry+1, w, r.height-ry-ry), pbrushPen, TRUE); - app_fill_rect(dc, rect(r.x+r.width-w, r.y+ry+1, w, r.height-ry-ry), - pbrushPen, TRUE); - } - if ( Wellipse < r.width) - { - app_fill_rect(dc, rect(r.x+rx, r.y+r.height-w, r.width-rx-rx, w), - pbrushPen, TRUE); + app_fill_rect(dc, rect(r.x+r.width-w, r.y+ry+1, w, r.height-ry-ry), + pbrushPen, TRUE); + } + if ( Wellipse < r.width) + { + app_fill_rect(dc, rect(r.x+rx, r.y+r.height-w, r.width-rx-rx, w), + pbrushPen, TRUE); - app_fill_rect(dc, rect(r.x+rx, r.y, r.width-rx-rx, w), pbrushPen, TRUE); - } - return TRUE; + app_fill_rect(dc, rect(r.x+rx, r.y, r.width-rx-rx, w), pbrushPen, TRUE); + } + return TRUE; } diff --git a/subsystems/win32/win32k/objects/fillshap.c b/subsystems/win32/win32k/objects/fillshap.c index d5d6469ff6e..ae071d2cddf 100644 --- a/subsystems/win32/win32k/objects/fillshap.c +++ b/subsystems/win32/win32k/objects/fillshap.c @@ -604,7 +604,7 @@ IntRectangle(PDC dc, NULL, &dc->eboFill.BrushObject, &BrushOrigin, - ROP3_TO_ROP4(PATCOPY)); + ROP4_FROM_INDEX(R3_OPINDEX_PATCOPY)); } } diff --git a/subsystems/win32/win32k/objects/freetype.c b/subsystems/win32/win32k/objects/freetype.c index 21a0883c2da..4e941ee2047 100644 --- a/subsystems/win32/win32k/objects/freetype.c +++ b/subsystems/win32/win32k/objects/freetype.c @@ -3248,8 +3248,6 @@ GreExtTextOutW( DestRect.right = lprc->right; DestRect.bottom = lprc->bottom; - IntLPtoDP(dc, (LPPOINT)&DestRect, 2); - DestRect.left += dc->ptlDCOrig.x; DestRect.top += dc->ptlDCOrig.y; DestRect.right += dc->ptlDCOrig.x; @@ -3271,7 +3269,7 @@ GreExtTextOutW( &SourcePoint, &dc->eboBackground.BrushObject, &BrushOrigin, - ROP3_TO_ROP4(PATCOPY)); + ROP4_FROM_INDEX(R3_OPINDEX_PATCOPY)); fuOptions &= ~ETO_OPAQUE; DC_vFinishBlit(dc, NULL); } @@ -3516,7 +3514,7 @@ GreExtTextOutW( &SourcePoint, &dc->eboBackground.BrushObject, &BrushOrigin, - ROP3_TO_ROP4(PATCOPY)); + ROP4_FROM_INDEX(R3_OPINDEX_PATCOPY)); MouseSafetyOnDrawEnd(dc->ppdev); BackgroundLeft = DestRect.right; diff --git a/subsystems/win32/win32k/objects/gdidbg.c b/subsystems/win32/win32k/objects/gdidbg.c index efa686fc06b..bf46e2b5111 100644 --- a/subsystems/win32/win32k/objects/gdidbg.c +++ b/subsystems/win32/win32k/objects/gdidbg.c @@ -1,13 +1,26 @@ +/* + * PROJECT: ReactOS win32 kernel mode subsystem + * LICENSE: GPL - See COPYING in the top level directory + * FILE: subsystems/win32/win32k/objects/gdidbg.c + * PURPOSE: Special debugging functions for gdi + * PROGRAMMERS: Timo Kreuzer + */ + +/** INCLUDES ******************************************************************/ + +#include +#define NDEBUG +#include + + +ULONG gulDebugChannels = 0; + #ifdef GDI_DEBUG -#define KeRosDumpStackFrames(Frames, Count) KdSystemDebugControl('DsoR', (PVOID)Frames, Count, NULL, 0, NULL, KernelMode) -NTSYSAPI ULONG APIENTRY RtlWalkFrameChain(OUT PVOID *Callers, IN ULONG Count, IN ULONG Flags); - -#define GDI_STACK_LEVELS 20 -static ULONG_PTR GDIHandleAllocator[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; -static ULONG_PTR GDIHandleLocker[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; -static ULONG_PTR GDIHandleShareLocker[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; -static ULONG_PTR GDIHandleDeleter[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; +ULONG_PTR GDIHandleAllocator[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; +ULONG_PTR GDIHandleLocker[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; +ULONG_PTR GDIHandleShareLocker[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; +ULONG_PTR GDIHandleDeleter[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; struct DbgOpenGDIHandle { ULONG idx; @@ -37,9 +50,6 @@ CompareBacktraces(ULONG idx1, ULONG idx2) return TRUE; } -#define IS_HANDLE_VALID(idx) \ - ((GdiHandleTable->Entries[idx].Type & GDI_ENTRY_BASETYPE_MASK) != 0) - void IntDumpHandleTable(PGDI_HANDLE_TABLE HandleTable) { static int leak_reported = 0; @@ -110,8 +120,8 @@ void IntDumpHandleTable(PGDI_HANDLE_TABLE HandleTable) for (i = 0; i < nTraces && AllocatorTable[i].count > 1; i++) { /* Print out the allocation count */ - DbgPrint(" %i allocs, type = 0x%lx:\n", - AllocatorTable[i].count, + DbgPrint(" %i allocs, type = 0x%lx:\n", + AllocatorTable[i].count, GdiHandleTable->Entries[AllocatorTable[i].idx].Type); /* Dump the frames */ @@ -161,44 +171,42 @@ GdiDbgHTIntegrityCheck() /* FIXME: check reserved entries */ /* Now go through the deleted objects */ - i = GdiHandleTable->FirstFree; - if (i) + i = GdiHandleTable->FirstFree & 0xffff; + while (i) { pEntry = &GdiHandleTable->Entries[i]; - for (;;) + if (i > GDI_HANDLE_COUNT) { - nDeleted++; - - /* Check the entry */ - if ((pEntry->Type & GDI_ENTRY_BASETYPE_MASK) != 0) - { - r = 0; - DPRINT1("Deleted Entry has a type != 0\n"); - } - if ((ULONG_PTR)pEntry->KernelData >= GDI_HANDLE_COUNT) - { - r = 0; - DPRINT1("Deleted entries KernelPointer too big\n"); - } - if (pEntry->UserData != NULL) - { - r = 0; - DPRINT1("Deleted entry has UserData != 0\n"); - } - if (pEntry->ProcessId != 0) - { - r = 0; - DPRINT1("Deleted entry has ProcessId != 0\n"); - } - - i = (ULONG_PTR)pEntry->KernelData; - if (!i) - { - break; - } - pEntry = &GdiHandleTable->Entries[i]; + DPRINT1("nDeleted=%ld\n", nDeleted); + ASSERT(FALSE); } - } + + nDeleted++; + + /* Check the entry */ + if ((pEntry->Type & GDI_ENTRY_BASETYPE_MASK) != 0) + { + r = 0; + DPRINT1("Deleted Entry has a type != 0\n"); + } + if ((ULONG_PTR)pEntry->KernelData >= GDI_HANDLE_COUNT) + { + r = 0; + DPRINT1("Deleted entries KernelPointer too big\n"); + } + if (pEntry->UserData != NULL) + { + r = 0; + DPRINT1("Deleted entry has UserData != 0\n"); + } + if (pEntry->ProcessId != 0) + { + r = 0; + DPRINT1("Deleted entry has ProcessId != 0\n"); + } + + i = (ULONG_PTR)pEntry->KernelData & 0xffff; + }; for (i = GdiHandleTable->FirstUnused; i < GDI_HANDLE_COUNT; @@ -272,39 +280,6 @@ GdiDbgHTIntegrityCheck() return r; } -#define GDIDBG_TRACECALLER() \ - DPRINT1("-> called from:\n"); \ - KeRosDumpStackFrames(NULL, 20); -#define GDIDBG_TRACEALLOCATOR(handle) \ - DPRINT1("-> allocated from:\n"); \ - KeRosDumpStackFrames(GDIHandleAllocator[GDI_HANDLE_GET_INDEX(handle)], GDI_STACK_LEVELS); -#define GDIDBG_TRACELOCKER(handle) \ - DPRINT1("-> locked from:\n"); \ - KeRosDumpStackFrames(GDIHandleLocker[GDI_HANDLE_GET_INDEX(handle)], GDI_STACK_LEVELS); -#define GDIDBG_TRACESHARELOCKER(handle) \ - DPRINT1("-> locked from:\n"); \ - KeRosDumpStackFrames(GDIHandleShareLocker[GDI_HANDLE_GET_INDEX(handle)], GDI_STACK_LEVELS); -#define GDIDBG_TRACEDELETER(handle) \ - DPRINT1("-> deleted from:\n"); \ - KeRosDumpStackFrames(GDIHandleDeleter[GDI_HANDLE_GET_INDEX(handle)], GDI_STACK_LEVELS); -#define GDIDBG_CAPTUREALLOCATOR(handle) \ - CaptureStackBackTace((PVOID*)GDIHandleAllocator[GDI_HANDLE_GET_INDEX(handle)], GDI_STACK_LEVELS); -#define GDIDBG_CAPTURELOCKER(handle) \ - CaptureStackBackTace((PVOID*)GDIHandleLocker[GDI_HANDLE_GET_INDEX(handle)], GDI_STACK_LEVELS); -#define GDIDBG_CAPTURESHARELOCKER(handle) \ - CaptureStackBackTace((PVOID*)GDIHandleShareLocker[GDI_HANDLE_GET_INDEX(handle)], GDI_STACK_LEVELS); -#define GDIDBG_CAPTUREDELETER(handle) \ - CaptureStackBackTace((PVOID*)GDIHandleDeleter[GDI_HANDLE_GET_INDEX(handle)], GDI_STACK_LEVELS); -#define GDIDBG_DUMPHANDLETABLE() \ - IntDumpHandleTable(GdiHandleTable) -#define GDIDBG_INITLOOPTRACE() \ - ULONG Attempts = 0; -#define GDIDBG_TRACELOOP(Handle, PrevThread, Thread) \ - if ((++Attempts % 20) == 0) \ - { \ - DPRINT1("[%d] Handle 0x%p Locked by 0x%x (we're 0x%x)\n", Attempts, Handle, PrevThread, Thread); \ - } - ULONG FASTCALL GDIOBJ_IncrementShareCount(POBJ Object) @@ -315,20 +290,59 @@ GDIOBJ_IncrementShareCount(POBJ Object) return cLocks; } -#else - -#define GDIDBG_TRACECALLER() -#define GDIDBG_TRACEALLOCATOR(index) -#define GDIDBG_TRACELOCKER(index) -#define GDIDBG_TRACESHARELOCKER(index) -#define GDIDBG_CAPTUREALLOCATOR(index) -#define GDIDBG_CAPTURELOCKER(index) -#define GDIDBG_CAPTURESHARELOCKER(index) -#define GDIDBG_CAPTUREDELETER(handle) -#define GDIDBG_DUMPHANDLETABLE() -#define GDIDBG_INITLOOPTRACE() -#define GDIDBG_TRACELOOP(Handle, PrevThread, Thread) -#define GDIDBG_TRACEDELETER(handle) - #endif /* GDI_DEBUG */ +void +GdiDbgDumpLockedHandles() +{ + ULONG i; + + for (i = RESERVE_ENTRIES_COUNT; i < GDI_HANDLE_COUNT; i++) + { + PGDI_TABLE_ENTRY pEntry = &GdiHandleTable->Entries[i]; + + if (pEntry->Type & GDI_ENTRY_BASETYPE_MASK) + { + BASEOBJECT *pObject = pEntry->KernelData; + if (pObject->cExclusiveLock > 0) + { + DPRINT1("Locked object: %lx, type = %lx. allocated from:\n", + i, pEntry->Type); + GDIDBG_TRACEALLOCATOR(i); + DPRINT1("Locked from:\n"); + GDIDBG_TRACELOCKER(i); + } + } + } +} + +void +NTAPI +DbgPreServiceHook(ULONG ulSyscallId, PULONG_PTR pulArguments) +{ + PTHREADINFO pti = (PTHREADINFO)PsGetCurrentThreadWin32Thread(); + if (pti && pti->cExclusiveLocks != 0) + { + DbgPrint("FATAL: Win32DbgPreServiceHook(%ld): There are %ld exclusive locks!\n", + ulSyscallId, pti->cExclusiveLocks); + GdiDbgDumpLockedHandles(); + ASSERT(FALSE); + } + +} + +ULONG_PTR +NTAPI +DbgPostServiceHook(ULONG ulSyscallId, ULONG_PTR ulResult) +{ + PTHREADINFO pti = (PTHREADINFO)PsGetCurrentThreadWin32Thread(); + if (pti && pti->cExclusiveLocks != 0) + { + DbgPrint("FATAL: Win32DbgPostServiceHook(%ld): There are %ld exclusive locks!\n", + ulSyscallId, pti->cExclusiveLocks); + GdiDbgDumpLockedHandles(); + ASSERT(FALSE); + } + return ulResult; +} + diff --git a/subsystems/win32/win32k/objects/gdiobj.c b/subsystems/win32/win32k/objects/gdiobj.c index beeee0a7cdf..6bbca8cddd4 100644 --- a/subsystems/win32/win32k/objects/gdiobj.c +++ b/subsystems/win32/win32k/objects/gdiobj.c @@ -8,28 +8,16 @@ /** INCLUDES ******************************************************************/ -//#define GDI_DEBUG - #include #define NDEBUG #include -#define GDI_ENTRY_TO_INDEX(ht, e) \ - (((ULONG_PTR)(e) - (ULONG_PTR)&((ht)->Entries[0])) / sizeof(GDI_TABLE_ENTRY)) -#define GDI_HANDLE_GET_ENTRY(HandleTable, h) \ - (&(HandleTable)->Entries[GDI_HANDLE_GET_INDEX((h))]) - -/* apparently the first 10 entries are never used in windows as they are empty */ -#define RESERVE_ENTRIES_COUNT 10 - #define BASE_OBJTYPE_COUNT 32 #define DelayExecution() \ DPRINT("%s:%i: Delay\n", __FILE__, __LINE__); \ KeDelayExecutionThread(KernelMode, FALSE, &ShortDelay) -#include "gdidbg.c" - static BOOL INTERNAL_CALL GDI_CleanupDummy(PVOID ObjectBody); @@ -487,6 +475,9 @@ LockHandle: newObject->ulShareCount = 0; newObject->cExclusiveLock = 1; newObject->Tid = Thread; +#if DBG + if (Thread) Thread->cExclusiveLocks++; +#endif AllocTypeDataDump(TypeInfo); @@ -607,11 +598,11 @@ LockHandle: ((Entry->Type & GDI_ENTRY_BASETYPE_MASK) == (HandleUpper & GDI_ENTRY_BASETYPE_MASK)) ) { POBJ Object; + PTHREADINFO Thread = (PTHREADINFO)PsGetCurrentThreadWin32Thread(); Object = Entry->KernelData; - if ((Object->cExclusiveLock == 0 || - Object->Tid == (PTHREADINFO)PsGetCurrentThreadWin32Thread()) && + if ((Object->cExclusiveLock == 0 || Object->Tid == Thread) && Object->ulShareCount == 0) { BOOL Ret; @@ -627,6 +618,18 @@ LockHandle: InterlockedPushFreeEntry(GDI_ENTRY_TO_INDEX(GdiHandleTable, Entry)); Object->hHmgr = NULL; +#if DBG + if (Thread) + { + if (Thread->cExclusiveLocks < Object->cExclusiveLock) + { + DPRINT1("cExclusiveLocks = %ld, object: %ld\n", + Thread->cExclusiveLocks, Object->cExclusiveLock); + ASSERT(FALSE); + } + Thread->cExclusiveLocks -= Object->cExclusiveLock; + } +#endif if (W32Process != NULL) { @@ -1009,16 +1012,6 @@ GDIOBJ_LockObj(HGDIOBJ hObj, DWORD ExpectedType) } ProcessId = (HANDLE)((ULONG_PTR)PsGetCurrentProcessId() & ~1); - HandleProcessId = (HANDLE)((ULONG_PTR)Entry->ProcessId & ~1); - - /* Check for invalid owner. */ - if (ProcessId != HandleProcessId && HandleProcessId != NULL) - { - DPRINT1("Tried to lock object (0x%p) of wrong owner! ProcessId = %p, HandleProcessId = %p\n", hObj, ProcessId, HandleProcessId); - GDIDBG_TRACECALLER(); - GDIDBG_TRACEALLOCATOR(hObj); - return NULL; - } /* * Prevent the thread from being terminated during the locking process. @@ -1035,6 +1028,17 @@ GDIOBJ_LockObj(HGDIOBJ hObj, DWORD ExpectedType) for (;;) { + HandleProcessId = (HANDLE)((ULONG_PTR)Entry->ProcessId & ~1); + + /* Check for invalid owner. */ + if (ProcessId != HandleProcessId && HandleProcessId != NULL) + { + DPRINT1("Tried to lock object (0x%p) of wrong owner! ProcessId = %p, HandleProcessId = %p\n", hObj, ProcessId, HandleProcessId); + GDIDBG_TRACECALLER(); + GDIDBG_TRACEALLOCATOR(hObj); + break; + } + /* Lock the handle table entry. */ LockedProcessId = (HANDLE)((ULONG_PTR)HandleProcessId | 0x1); PrevProcId = InterlockedCompareExchangePointer((PVOID*)&Entry->ProcessId, @@ -1059,6 +1063,9 @@ GDIOBJ_LockObj(HGDIOBJ hObj, DWORD ExpectedType) Object->Tid = Thread; Object->cExclusiveLock = 1; GDIDBG_CAPTURELOCKER(GDI_HANDLE_GET_INDEX(hObj)) +#if DBG + if (Thread) Thread->cExclusiveLocks++; +#endif } else { @@ -1071,6 +1078,9 @@ GDIOBJ_LockObj(HGDIOBJ hObj, DWORD ExpectedType) continue; } InterlockedIncrement((PLONG)&Object->cExclusiveLock); +#if DBG + if (Thread) Thread->cExclusiveLocks++; +#endif } } else diff --git a/subsystems/win32/win32k/objects/palette.c b/subsystems/win32/win32k/objects/palette.c index 860813ce8f1..c7656e03d1c 100644 --- a/subsystems/win32/win32k/objects/palette.c +++ b/subsystems/win32/win32k/objects/palette.c @@ -197,6 +197,8 @@ PALETTE_AllocPalette(ULONG Mode, PalGDI->flFlags |= PAL_RGB16_565; else if (Red == 0xFF0000 && Green == 0xFF00 && Blue == 0xFF) PalGDI->flFlags |= PAL_BGR; + else if (Red == 0xFF && Green == 0xFF00 && Blue == 0xFF0000) + PalGDI->flFlags |= PAL_RGB; } PALETTE_UnlockPalette(PalGDI); @@ -723,58 +725,39 @@ UINT FASTCALL IntGdiRealizePalette(HDC hDC) { - /* - * This function doesn't do any real work now and there's plenty - * of bugs in it. - */ + UINT i, realize = 0; + PDC pdc; + PALETTE *ppalSurf, *ppalDC; - PPALETTE palGDI, sysGDI; - int realized = 0; - PDC dc; - HPALETTE systemPalette; + pdc = DC_LockDc(hDC); + if(!pdc) + { + EngSetLastError(ERROR_INVALID_HANDLE); + return 0; + } - dc = DC_LockDc(hDC); - if (!dc) return 0; + ppalSurf = pdc->dclevel.pSurface->ppal; + ppalDC = pdc->dclevel.ppal; - systemPalette = NtGdiGetStockObject(DEFAULT_PALETTE); - palGDI = PALETTE_LockPalette(dc->dclevel.hpal); + if(!(ppalSurf->flFlags & PAL_INDEXED)) + { + // FIXME : set error? + goto cleanup; + } - if (palGDI == NULL) - { - DPRINT1("IntGdiRealizePalette(): palGDI is NULL, exiting\n"); - DC_UnlockDc(dc); - return 0; - } + ASSERT(ppalDC->flFlags & PAL_INDEXED); - sysGDI = PALETTE_LockPalette(systemPalette); + // FIXME : should we resize ppalSurf if it's too small? + realize = (ppalDC->NumColors < ppalSurf->NumColors) ? ppalDC->NumColors : ppalSurf->NumColors; - if (sysGDI == NULL) - { - DPRINT1("IntGdiRealizePalette(): sysGDI is NULL, exiting\n"); - PALETTE_UnlockPalette(palGDI); - DC_UnlockDc(dc); - return 0; - } + for(i=0; iIndexedColors[i], *(LONG*)&ppalDC->IndexedColors[i]); + } - // The RealizePalette function modifies the palette for the device associated with the specified device context. If the - // device context is a memory DC, the color table for the bitmap selected into the DC is modified. If the device - // context is a display DC, the physical palette for that device is modified. - if(dc->dctype == DC_TYPE_MEMORY) - { - // Memory managed DC - DPRINT1("RealizePalette unimplemented for memory managed DCs\n"); - } else - { - DPRINT1("RealizePalette unimplemented for device DCs\n"); - } - - // need to pass this to IntEngCreateXlate with palettes unlocked - PALETTE_UnlockPalette(sysGDI); - PALETTE_UnlockPalette(palGDI); - - DC_UnlockDc(dc); - - return realized; +cleanup: + DC_UnlockDc(pdc); + return realize; } UINT APIENTRY diff --git a/subsystems/win32/win32k/objects/path.c b/subsystems/win32/win32k/objects/path.c index 801e8e598c8..0b1a7aa512c 100644 --- a/subsystems/win32/win32k/objects/path.c +++ b/subsystems/win32/win32k/objects/path.c @@ -1858,7 +1858,7 @@ PATH_WidenPath(DC *dc) PATH_DestroyGdiPath(pDownPath); ExFreePoolWithTag(pDownPath, TAG_PATH); } - ExFreePoolWithTag(pStrokes, TAG_PATH); + if (pStrokes) ExFreePoolWithTag(pStrokes, TAG_PATH); pNewPath->state = PATH_Closed; if (!(ret = PATH_AssignGdiPath(pPath, pNewPath))) @@ -2041,6 +2041,7 @@ PATH_ExtTextOut(PDC dc, INT x, INT y, UINT flags, const RECTL *lprc, if ( !TextObj ) return FALSE; FontGetObject( TextObj, sizeof(lf), &lf); + TEXTOBJ_UnlockText(TextObj); if (lf.lfEscapement != 0) { @@ -2154,7 +2155,7 @@ NtGdiBeginPath( HDC hDC ) if ( dc->dclevel.hPath ) { - DPRINT1("BeginPath 1 0x%x\n", dc->dclevel.hPath); + DPRINT("BeginPath 1 0x%x\n", dc->dclevel.hPath); if ( !(dc->dclevel.flPath & DCPATH_SAVE) ) { // Remove previous handle. if (!PATH_Delete(dc->dclevel.hPath)) @@ -2179,7 +2180,7 @@ NtGdiBeginPath( HDC hDC ) dc->dclevel.hPath = pPath->BaseObject.hHmgr; - DPRINT1("BeginPath 2 h 0x%x p 0x%x\n", dc->dclevel.hPath, pPath); + DPRINT("BeginPath 2 h 0x%x p 0x%x\n", dc->dclevel.hPath, pPath); // Path handles are shared. Also due to recursion with in the same thread. GDIOBJ_UnlockObjByPtr((POBJ)pPath); // Unlock pPath = PATH_LockPath(dc->dclevel.hPath); // Share Lock. @@ -2265,7 +2266,7 @@ NtGdiEndPath(HDC hDC) /* Set flag to indicate that path is finished */ else { - DPRINT1("EndPath 0x%x\n", dc->dclevel.hPath); + DPRINT("EndPath 0x%x\n", dc->dclevel.hPath); pPath->state = PATH_Closed; dc->dclevel.flPath &= ~DCPATH_ACTIVE; } @@ -2281,13 +2282,15 @@ NtGdiFillPath(HDC hDC) BOOL ret = FALSE; PPATH pPath; PDC_ATTR pdcattr; - PDC dc = DC_LockDc ( hDC ); + PDC dc; - if ( !dc ) + dc = DC_LockDc(hDC); + if (!dc) { EngSetLastError(ERROR_INVALID_PARAMETER); return FALSE; } + pPath = PATH_LockPath( dc->dclevel.hPath ); if (!pPath) { diff --git a/subsystems/win32/win32k/objects/polyfill.c b/subsystems/win32/win32k/objects/polyfill.c index 1f6196a53af..e1b33802960 100644 --- a/subsystems/win32/win32k/objects/polyfill.c +++ b/subsystems/win32/win32k/objects/polyfill.c @@ -606,14 +606,14 @@ IntFillPolygon( BRUSHOBJ *BrushObj, CONST PPOINT Points, int Count, - RECTL DestRect, + RECTL DestRect, POINTL *BrushOrigin) { FILL_EDGE_LIST *list = 0; FILL_EDGE *ActiveHead = 0; FILL_EDGE *pLeft, *pRight; int ScanLine; - + //DPRINT("IntFillPolygon\n"); /* Create Edge List. */ @@ -657,11 +657,11 @@ IntFillPolygon( NULL, BrushObj, BrushOrigin, - ROP3_TO_ROP4(PATCOPY)); + ROP4_FROM_INDEX(R3_OPINDEX_PATCOPY)); } pLeft = pRight->pNext; pRight = pLeft ? pLeft->pNext : NULL; - } + } } /* Free Edge List. If any are left. */ diff --git a/subsystems/win32/win32k/objects/region.c b/subsystems/win32/win32k/objects/region.c index c681d4e9f42..d1b00441065 100644 --- a/subsystems/win32/win32k/objects/region.c +++ b/subsystems/win32/win32k/objects/region.c @@ -2073,14 +2073,12 @@ FASTCALL REGION_AllocUserRgnWithHandle(INT nRgn) { PROSRGNDATA pRgn; - INT Index; PGDI_TABLE_ENTRY Entry; pRgn = REGION_AllocRgnWithHandle(nRgn); if (pRgn) { - Index = GDI_HANDLE_GET_INDEX(pRgn->BaseObject.hHmgr); - Entry = &GdiHandleTable->Entries[Index]; + Entry = GDI_HANDLE_GET_ENTRY(GdiHandleTable, pRgn->BaseObject.hHmgr); Entry->UserData = AllocateObjectAttr(); } return pRgn; @@ -2090,23 +2088,18 @@ PROSRGNDATA FASTCALL RGNOBJAPI_Lock(HRGN hRgn, PRGN_ATTR *ppRgn_Attr) { - INT Index; PGDI_TABLE_ENTRY Entry; - PROSRGNDATA pRgn; PRGN_ATTR pRgn_Attr; - HANDLE pid; + PROSRGNDATA pRgn = NULL; pRgn = REGION_LockRgn(hRgn); - if (pRgn) + if (pRgn && GDIOBJ_OwnedByCurrentProcess(hRgn)) { - Index = GDI_HANDLE_GET_INDEX(hRgn); - Entry = &GdiHandleTable->Entries[Index]; + Entry = GDI_HANDLE_GET_ENTRY(GdiHandleTable, hRgn); pRgn_Attr = Entry->UserData; - pid = (HANDLE)((ULONG_PTR)Entry->ProcessId & ~0x1); - if ( pid == NtCurrentTeb()->ClientId.UniqueProcess && - pRgn_Attr ) + if ( pRgn_Attr ) { _SEH2_TRY { @@ -2151,20 +2144,15 @@ VOID FASTCALL RGNOBJAPI_Unlock(PROSRGNDATA pRgn) { - INT Index; PGDI_TABLE_ENTRY Entry; PRGN_ATTR pRgn_Attr; - HANDLE pid; - if (pRgn) + if (pRgn && GDIOBJ_OwnedByCurrentProcess(pRgn->BaseObject.hHmgr)) { - Index = GDI_HANDLE_GET_INDEX(pRgn->BaseObject.hHmgr); - Entry = &GdiHandleTable->Entries[Index]; + Entry = GDI_HANDLE_GET_ENTRY(GdiHandleTable, pRgn->BaseObject.hHmgr); pRgn_Attr = Entry->UserData; - pid = (HANDLE)((ULONG_PTR)Entry->ProcessId & ~0x1); - if ( pid == NtCurrentTeb()->ClientId.UniqueProcess && - pRgn_Attr ) + if ( pRgn_Attr ) { _SEH2_TRY {