diff --git a/base/applications/cacls/lang/pl-PL.rc b/base/applications/cacls/lang/pl-PL.rc index 44c50aab083..1df18a59503 100644 --- a/base/applications/cacls/lang/pl-PL.rc +++ b/base/applications/cacls/lang/pl-PL.rc @@ -2,7 +2,7 @@ * Translated by TestamenT * testament@users.sourceforge.net * https://sourceforge.net/projects/reactospl - * Updated by Saibamen - Adam Stachowicz (saibamenppl@gmail.com) (Apr, 2011) + * Updated by Saibamen - Adam Stachowicz (saibamenppl@gmail.com) (May, 2014) * UTF-8 conversion by Caemyr (May, 2011) */ @@ -51,8 +51,8 @@ Skróty:\n\ IDS_ABBR_CHANGE "C" IDS_ABBR_NONE "N" IDS_ALLOW "" - IDS_DENY "(DENY)" - IDS_SPECIAL_ACCESS "(special access:)" + IDS_DENY "(ODMÓW)" + IDS_SPECIAL_ACCESS "(dostęp specjalny:)" IDS_GENERIC_READ "GENERIC_READ" IDS_GENERIC_WRITE "GENERIC_WRITE" IDS_GENERIC_EXECUTE "GENERIC_EXECUTE" diff --git a/base/applications/calc/winmain.c b/base/applications/calc/winmain.c index 8944790482b..589a453a6ae 100644 --- a/base/applications/calc/winmain.c +++ b/base/applications/calc/winmain.c @@ -1626,7 +1626,7 @@ static INT_PTR CALLBACK DlgMainProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) if (IsWindow(calc.hStatWnd)) break; calc.hStatWnd = CreateDialog(calc.hInstance, - MAKEINTRESOURCE(IDD_DIALOG_STAT), hWnd, (DLGPROC)DlgStatProc); + MAKEINTRESOURCE(IDD_DIALOG_STAT), hWnd, DlgStatProc); if (calc.hStatWnd != NULL) { enable_allowed_controls(hWnd, calc.base); SendMessage(calc.hStatWnd, WM_SETFOCUS, 0, 0); @@ -1722,7 +1722,7 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdL dwLayout = IDD_DIALOG_STANDARD; /* This call will always fail if UNICODE for Win9x */ - if (NULL == CreateDialog(hInstance, MAKEINTRESOURCE(dwLayout), NULL, (DLGPROC)DlgMainProc)) + if (NULL == CreateDialog(hInstance, MAKEINTRESOURCE(dwLayout), NULL, DlgMainProc)) break; while (GetMessage(&msg, NULL, 0, 0)) { diff --git a/base/applications/cmdutils/help/help.c b/base/applications/cmdutils/help/help.c index 2a2b67cb5ba..668e930a113 100644 --- a/base/applications/cmdutils/help/help.c +++ b/base/applications/cmdutils/help/help.c @@ -56,7 +56,7 @@ VOID PrintResourceString(INT resID, ...) // FIXME: Optimize by using Win32 console functions. if (IsConsoleHandle(OutputHandle)) { - _vcwprintf(tmpBuffer, arg_ptr); + vfwprintf(stdout, tmpBuffer, arg_ptr); } else { diff --git a/base/applications/cmdutils/reg/CMakeLists.txt b/base/applications/cmdutils/reg/CMakeLists.txt index a6833f9a77c..4efbd6bd5eb 100644 --- a/base/applications/cmdutils/reg/CMakeLists.txt +++ b/base/applications/cmdutils/reg/CMakeLists.txt @@ -1,8 +1,5 @@ -remove_definitions(-D_WIN32_WINNT=0x502) -add_definitions(-D_WIN32_WINNT=0x600) - add_executable(reg reg.c reg.rc) set_module_type(reg win32cui UNICODE) -add_importlibs(reg advapi32 user32 msvcrt kernel32) +add_importlibs(reg advapi32 user32 shlwapi msvcrt kernel32) add_cd_file(TARGET reg DESTINATION reactos/system32 FOR all) diff --git a/base/applications/cmdutils/reg/reg.c b/base/applications/cmdutils/reg/reg.c index b7144eae51c..7a667b6cff4 100644 --- a/base/applications/cmdutils/reg/reg.c +++ b/base/applications/cmdutils/reg/reg.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include "reg.h" @@ -293,7 +294,7 @@ static int reg_delete(WCHAR *key_name, WCHAR *value_name, BOOL value_empty, /* Delete subtree only if no /v* option is given */ if (!value_name && !value_empty && !value_all) { - if (RegDeleteTreeW(root,p)!=ERROR_SUCCESS) + if (SHDeleteKeyW(root, p) != ERROR_SUCCESS) { reg_message(STRING_CANNOT_FIND); return 1; diff --git a/base/applications/magnify/magnifier.c b/base/applications/magnify/magnifier.c index 856bf0160d7..3af6236d46f 100644 --- a/base/applications/magnify/magnifier.c +++ b/base/applications/magnify/magnifier.c @@ -166,7 +166,7 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) if (bShowWarning) { - DialogBox (hInstance, MAKEINTRESOURCE(IDD_WARNINGDIALOG), hMainWnd, (DLGPROC)WarningProc); + DialogBox (hInstance, MAKEINTRESOURCE(IDD_WARNINGDIALOG), hMainWnd, WarningProc); } return TRUE; @@ -353,22 +353,20 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) //Update to new position pMouse = pNewMouse; cp = pNewMouse; - Refresh(); } else if (((pCaret.x != pNewCaret.x) || (pCaret.y != pNewCaret.y)) && bFollowCaret) { //Update to new position pCaret = pNewCaret; cp = pNewCaret; - Refresh(); } else if (((pFocus.x != pNewFocus.x) || (pFocus.y != pNewFocus.y)) && bFollowFocus) { //Update to new position pFocus = pNewFocus; cp = pNewFocus; - Refresh(); } + Refresh(); } break; case WM_COMMAND: @@ -377,10 +375,10 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) switch (wmId) { case IDM_OPTIONS: - DialogBox(hInst, MAKEINTRESOURCE(IDD_DIALOGOPTIONS), hWnd, (DLGPROC)OptionsProc); + DialogBox(hInst, MAKEINTRESOURCE(IDD_DIALOGOPTIONS), hWnd, OptionsProc); break; case IDM_ABOUT: - DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, (DLGPROC)AboutProc); + DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, AboutProc); break; case IDM_EXIT: DestroyWindow(hWnd); diff --git a/base/applications/mplay32/lang/pl-PL.rc b/base/applications/mplay32/lang/pl-PL.rc index 5c21137ef55..fdcb893c289 100644 --- a/base/applications/mplay32/lang/pl-PL.rc +++ b/base/applications/mplay32/lang/pl-PL.rc @@ -3,6 +3,7 @@ * http://www.reactos.org * IRC: irc.freenode.net #reactos-pl * UTF-8 conversion by Caemyr (May, 2011) + * Updated by Saibamen - Adam Stachowicz (saibamenppl@gmail.com) (May, 2014) */ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT @@ -16,11 +17,11 @@ BEGIN MENUITEM SEPARATOR MENUITEM "&Wyjdź", IDM_EXIT END - POPUP "&Device" + POPUP "&Urządzenie" BEGIN - MENUITEM "&Properties", IDM_DEVPROPS + MENUITEM "&Właściwości", IDM_DEVPROPS MENUITEM SEPARATOR - MENUITEM "&Volume Control", IDM_VOLUMECTL + MENUITEM "&Regulacja głośności", IDM_VOLUMECTL END POPUP "&Pomoc" BEGIN @@ -38,8 +39,8 @@ BEGIN IDS_TOOLTIP_SEEKBACK "Przewiń do tyłu" IDS_TOOLTIP_SEEKFORW "Przewiń do przodu" IDS_TOOLTIP_FORWARD "Przeskocz do przodu" - IDS_APPTITLE "ReactOS Multimedia Player" + IDS_APPTITLE "Odtwarzacz multimedialny ReactOS" IDS_PLAY "Odtwórz" - IDS_DEFAULTMCIERRMSG "No description is available for this error" - IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename extension." + IDS_DEFAULTMCIERRMSG "Brak dostępnego opisu dla tego błędu" + IDS_UNKNOWNFILEEXT "Nie można określić typu urządzenia z podanego rozszerzenia pliku." END diff --git a/base/applications/mscutils/eventvwr/CMakeLists.txt b/base/applications/mscutils/eventvwr/CMakeLists.txt index a15680efcd4..fff7e3a7048 100644 --- a/base/applications/mscutils/eventvwr/CMakeLists.txt +++ b/base/applications/mscutils/eventvwr/CMakeLists.txt @@ -1,7 +1,7 @@ add_executable(eventvwr eventvwr.c eventvwr.rc) set_module_type(eventvwr win32gui UNICODE) -add_importlibs(eventvwr user32 comctl32 advapi32 msvcrt kernel32) +add_importlibs(eventvwr user32 comctl32 comdlg32 advapi32 msvcrt kernel32) if(MSVC) add_importlibs(eventvwr ntdll) endif() diff --git a/base/applications/mscutils/eventvwr/eventvwr.c b/base/applications/mscutils/eventvwr/eventvwr.c index 8d0a019d950..86b7666aa8d 100644 --- a/base/applications/mscutils/eventvwr/eventvwr.c +++ b/base/applications/mscutils/eventvwr/eventvwr.c @@ -28,9 +28,11 @@ #include #include #include +#include #include #include #include +#include #include "resource.h" @@ -42,7 +44,7 @@ static const LPWSTR EVENT_SOURCE_APPLICATION = L"Application"; static const LPWSTR EVENT_SOURCE_SECURITY = L"Security"; static const LPWSTR EVENT_SOURCE_SYSTEM = L"System"; -static const WCHAR szWindowClass[] = L"EVENTVWR"; /* the main window class name*/ +static const WCHAR szWindowClass[] = L"EVENTVWR"; /* the main window class name*/ //MessageFile message buffer size #define EVENT_MESSAGE_EVENTTEXT_BUFFER 1024*10 @@ -58,12 +60,15 @@ static const WCHAR szWindowClass[] = L"EVENTVWR"; /* the main window cl HINSTANCE hInst; /* current instance */ WCHAR szTitle[MAX_LOADSTRING]; /* The title bar text */ WCHAR szTitleTemplate[MAX_LOADSTRING]; /* The logged-on title bar text */ +WCHAR szSaveFilter[MAX_LOADSTRING]; /* Filter Mask for the save Dialog */ HWND hwndMainWindow; /* Main window */ HWND hwndListView; /* ListView control */ HWND hwndStatus; /* Status bar */ +HMENU hMainMenu; /* The application's main menu */ WCHAR szStatusBarTemplate[MAX_LOADSTRING]; /* The status bar text */ PEVENTLOGRECORD *g_RecordPtrs = NULL; DWORD g_TotalRecords = 0; +OPENFILENAMEW sfn; LPWSTR lpSourceLogName = NULL; LPWSTR lpComputerName = NULL; @@ -137,6 +142,25 @@ static void FreeRecords(void) g_RecordPtrs = NULL; } +VOID +ShowLastWin32Error(VOID) +{ + DWORD dwError; + LPWSTR lpMessageBuffer; + + dwError = GetLastError(); + FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, + NULL, + dwError, + 0, + (LPWSTR)&lpMessageBuffer, + 0, + NULL); + + MessageBoxW(hwndMainWindow, lpMessageBuffer, szTitle, MB_OK | MB_ICONERROR); + LocalFree(lpMessageBuffer); +} + VOID EventTimeToSystemTime(DWORD EventTime, SYSTEMTIME *pSystemTime) @@ -219,10 +243,7 @@ GetEventMessageFileDLL(IN LPCWSTR lpLogName, } else { - MessageBoxW(NULL, - L"Registry access failed!", - L"Event Log", - MB_OK | MB_ICONINFORMATION); + ShowLastWin32Error(); } if (hSourceKey != NULL) @@ -524,21 +545,18 @@ QueryEventMessages(LPWSTR lpMachineName, dwFlags = EVENTLOG_FORWARDS_READ | EVENTLOG_SEQUENTIAL_READ; - lpSourceLogName = lpLogName; - lpComputerName = lpMachineName; - /* Open the event log. */ hEventLog = OpenEventLogW(lpMachineName, lpLogName); if (hEventLog == NULL) { - MessageBoxW(NULL, - L"Could not open the event log.", - L"Event Log", - MB_OK | MB_ICONINFORMATION); + ShowLastWin32Error(); return FALSE; } + lpSourceLogName = lpLogName; + lpComputerName = lpMachineName; + /* Disable listview redraw */ SendMessage(hwndListView, WM_SETREDRAW, FALSE, 0); @@ -552,6 +570,17 @@ QueryEventMessages(LPWSTR lpMachineName, GetNumberOfEventLogRecords (hEventLog , &dwTotalRecords); g_TotalRecords = dwTotalRecords; + if (dwTotalRecords > 0) + { + EnableMenuItem(hMainMenu, ID_CLEAR_EVENTS, MF_BYCOMMAND | MF_ENABLED); + EnableMenuItem(hMainMenu, ID_SAVE_PROTOCOL, MF_BYCOMMAND | MF_ENABLED); + } + else + { + EnableMenuItem(hMainMenu, ID_CLEAR_EVENTS, MF_BYCOMMAND | MF_GRAYED); + EnableMenuItem(hMainMenu, ID_SAVE_PROTOCOL, MF_BYCOMMAND | MF_GRAYED); + } + g_RecordPtrs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwTotalRecords * sizeof(PVOID)); /* If we have at least 1000 records show the waiting dialog */ @@ -710,6 +739,97 @@ QueryEventMessages(LPWSTR lpMachineName, } +VOID +SaveProtocol(VOID) +{ + HANDLE hEventLog; + WCHAR szFileName[MAX_PATH]; + + ZeroMemory(szFileName, sizeof(szFileName)); + + sfn.lpstrFile = szFileName; + sfn.nMaxFile = MAX_PATH; + + if (!GetSaveFileNameW(&sfn)) + { + return; + } + + hEventLog = OpenEventLogW(lpComputerName, lpSourceLogName); + if (!hEventLog) + { + ShowLastWin32Error(); + return; + } + + if (!BackupEventLogW(hEventLog, szFileName)) + { + ShowLastWin32Error(); + } + + CloseEventLog(hEventLog); +} + + +BOOL +ClearEvents(VOID) +{ + HANDLE hEventLog; + WCHAR szFileName[MAX_PATH]; + WCHAR szMessage[MAX_LOADSTRING]; + + ZeroMemory(szFileName, sizeof(szFileName)); + ZeroMemory(szMessage, sizeof(szMessage)); + + LoadStringW(hInst, IDS_CLEAREVENTS_MSG, szMessage, MAX_LOADSTRING); + + sfn.lpstrFile = szFileName; + sfn.nMaxFile = MAX_PATH; + + switch (MessageBoxW(hwndMainWindow, szMessage, szTitle, MB_YESNOCANCEL | MB_ICONINFORMATION)) + { + case IDCANCEL: + { + return FALSE; + break; + } + + case IDNO: + { + sfn.lpstrFile = NULL; + break; + } + + case IDYES: + { + if (!GetSaveFileNameW(&sfn)) + { + return FALSE; + } + break; + } + } + + hEventLog = OpenEventLogW(lpComputerName, lpSourceLogName); + if (!hEventLog) + { + ShowLastWin32Error(); + return FALSE; + } + + if (!ClearEventLogW(hEventLog, sfn.lpstrFile)) + { + ShowLastWin32Error(); + CloseEventLog(hEventLog); + return FALSE; + } + + CloseEventLog(hEventLog); + + return TRUE; +} + + VOID Refresh(VOID) { @@ -905,6 +1025,20 @@ InitInstance(HINSTANCE hInstance, lvc.pszText = szTemp; (void)ListView_InsertColumn(hwndListView, 8, &lvc); + // Initialize the save Dialog + ZeroMemory(&sfn, sizeof(sfn)); + ZeroMemory(szSaveFilter, sizeof(szSaveFilter)); + + LoadStringW(hInst, IDS_SAVE_FILTER, szSaveFilter, MAX_LOADSTRING); + + sfn.lStructSize = sizeof(sfn); + sfn.hwndOwner = hwndMainWindow; + sfn.hInstance = hInstance; + sfn.lpstrFilter = szSaveFilter; + sfn.lpstrInitialDir = NULL; + sfn.Flags = OFN_HIDEREADONLY | OFN_SHAREAWARE; + sfn.lpstrDefExt = NULL; + ShowWindow(hwndMainWindow, nCmdShow); UpdateWindow(hwndMainWindow); @@ -934,6 +1068,7 @@ WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) switch (message) { case WM_CREATE: + hMainMenu = GetMenu(hWnd); CheckMenuRadioItem(GetMenu(hWnd), ID_LOG_APPLICATION, ID_LOG_SYSTEM, @@ -1002,6 +1137,17 @@ WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) } break; + case ID_SAVE_PROTOCOL: + SaveProtocol(); + break; + + case ID_CLEAR_EVENTS: + if (ClearEvents()) + { + Refresh(); + } + break; + case IDM_REFRESH: Refresh(); break; @@ -1011,7 +1157,7 @@ WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) break; case IDM_HELP: - MessageBoxW(NULL, + MessageBoxW(hwndMainWindow, L"Help not implemented yet!", L"Event Log", MB_OK | MB_ICONINFORMATION); @@ -1221,7 +1367,7 @@ EventDetails(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) return (INT_PTR)TRUE; case IDHELP: - MessageBoxW(NULL, + MessageBoxW(hDlg, L"Help not implemented yet!", L"Event Log", MB_OK | MB_ICONINFORMATION); diff --git a/base/applications/mscutils/eventvwr/lang/bg-BG.rc b/base/applications/mscutils/eventvwr/lang/bg-BG.rc index 6476b51cc86..360802294a2 100644 --- a/base/applications/mscutils/eventvwr/lang/bg-BG.rc +++ b/base/applications/mscutils/eventvwr/lang/bg-BG.rc @@ -8,6 +8,10 @@ BEGIN MENUITEM "&Сигурност", ID_LOG_SECURITY MENUITEM "&Уредба", ID_LOG_SYSTEM MENUITEM SEPARATOR + MENUITEM "Save &Protocol...", ID_SAVE_PROTOCOL, GRAYED + MENUITEM SEPARATOR + MENUITEM "C&lear all Events", ID_CLEAR_EVENTS, GRAYED + MENUITEM SEPARATOR MENUITEM "Из&ход", IDM_EXIT END POPUP "Из&глед" @@ -95,6 +99,8 @@ BEGIN IDS_EVENTLOG_AUDIT_FAILURE "Audit Failure" IDS_EVENTLOG_SUCCESS "Success" IDS_EVENTLOG_UNKNOWN_TYPE "Unknown Event" + IDS_CLEAREVENTS_MSG "Do you want to save this event log before clearing it?" + IDS_SAVE_FILTER "Event Log (*.evt)\0*.evt\0" END STRINGTABLE diff --git a/base/applications/mscutils/eventvwr/lang/cs-CZ.rc b/base/applications/mscutils/eventvwr/lang/cs-CZ.rc index 873bb14f6e1..a939a0724e8 100644 --- a/base/applications/mscutils/eventvwr/lang/cs-CZ.rc +++ b/base/applications/mscutils/eventvwr/lang/cs-CZ.rc @@ -8,6 +8,10 @@ BEGIN MENUITEM "&Zabezpečení", ID_LOG_SECURITY MENUITEM "&Systém", ID_LOG_SYSTEM MENUITEM SEPARATOR + MENUITEM "Uložit &Protokol...", ID_SAVE_PROTOCOL, GRAYED + MENUITEM SEPARATOR + MENUITEM "&Odstranit události", ID_CLEAR_EVENTS, GRAYED + MENUITEM SEPARATOR MENUITEM "&Konec", IDM_EXIT END POPUP "&Zobrazit" @@ -95,6 +99,8 @@ BEGIN IDS_EVENTLOG_AUDIT_FAILURE "Audit selhal" IDS_EVENTLOG_SUCCESS "Úspěch" IDS_EVENTLOG_UNKNOWN_TYPE "Neznámá událost" + IDS_CLEAREVENTS_MSG "Chcete tento protokol před odstraněním uložit?" + IDS_SAVE_FILTER "Protokol událostí (*.evt)\0*.evt\0" END STRINGTABLE diff --git a/base/applications/mscutils/eventvwr/lang/de-DE.rc b/base/applications/mscutils/eventvwr/lang/de-DE.rc index e7e87e97711..e9c0234f69d 100644 --- a/base/applications/mscutils/eventvwr/lang/de-DE.rc +++ b/base/applications/mscutils/eventvwr/lang/de-DE.rc @@ -10,6 +10,10 @@ BEGIN MENUITEM "&Sicherheit", ID_LOG_SECURITY MENUITEM "&System", ID_LOG_SYSTEM MENUITEM SEPARATOR + MENUITEM "Protokoll s&peichern...", ID_SAVE_PROTOCOL, GRAYED + MENUITEM SEPARATOR + MENUITEM "Alle E&reignisse löschen", ID_CLEAR_EVENTS, GRAYED + MENUITEM SEPARATOR MENUITEM "B&eenden", IDM_EXIT END POPUP "&Ansicht" @@ -97,6 +101,8 @@ BEGIN IDS_EVENTLOG_AUDIT_FAILURE "Audit Fehlgeschlagen" IDS_EVENTLOG_SUCCESS "Erfolgreich" IDS_EVENTLOG_UNKNOWN_TYPE "Unbekanntes Ereignis" + IDS_CLEAREVENTS_MSG "Möchten Sie dieses Protokoll vor dem Löschen speichern?" + IDS_SAVE_FILTER "Ereignisprotokoll (*.evt)\0*.evt\0" END STRINGTABLE diff --git a/base/applications/mscutils/eventvwr/lang/el-GR.rc b/base/applications/mscutils/eventvwr/lang/el-GR.rc index 56dd3abafc3..e4e757bdcb5 100644 --- a/base/applications/mscutils/eventvwr/lang/el-GR.rc +++ b/base/applications/mscutils/eventvwr/lang/el-GR.rc @@ -10,6 +10,10 @@ BEGIN MENUITEM "&Ασφάλεια", ID_LOG_SECURITY MENUITEM "&Σύστημα", ID_LOG_SYSTEM MENUITEM SEPARATOR + MENUITEM "Save &Protocol...", ID_SAVE_PROTOCOL, GRAYED + MENUITEM SEPARATOR + MENUITEM "C&lear all Events", ID_CLEAR_EVENTS, GRAYED + MENUITEM SEPARATOR MENUITEM "Έ&ξοδος", IDM_EXIT END POPUP "&Εμφάνιση" @@ -97,6 +101,8 @@ BEGIN IDS_EVENTLOG_AUDIT_FAILURE "Audit Failure" IDS_EVENTLOG_SUCCESS "Επιτυχία" IDS_EVENTLOG_UNKNOWN_TYPE "Άγνωστο συμβάν" + IDS_CLEAREVENTS_MSG "Do you want to save this event log before clearing it?" + IDS_SAVE_FILTER "Event Log (*.evt)\0*.evt\0" END STRINGTABLE diff --git a/base/applications/mscutils/eventvwr/lang/en-US.rc b/base/applications/mscutils/eventvwr/lang/en-US.rc index 3ab08cbe328..a02247904ac 100644 --- a/base/applications/mscutils/eventvwr/lang/en-US.rc +++ b/base/applications/mscutils/eventvwr/lang/en-US.rc @@ -16,6 +16,10 @@ BEGIN MENUITEM "&Security", ID_LOG_SECURITY MENUITEM "&System", ID_LOG_SYSTEM MENUITEM SEPARATOR + MENUITEM "Save &Protocol...", ID_SAVE_PROTOCOL, GRAYED + MENUITEM SEPARATOR + MENUITEM "C&lear all Events", ID_CLEAR_EVENTS, GRAYED + MENUITEM SEPARATOR MENUITEM "E&xit", IDM_EXIT END POPUP "&View" @@ -103,6 +107,8 @@ BEGIN IDS_EVENTLOG_AUDIT_FAILURE "Audit Failure" IDS_EVENTLOG_SUCCESS "Success" IDS_EVENTLOG_UNKNOWN_TYPE "Unknown Event" + IDS_CLEAREVENTS_MSG "Do you want to save this event log before clearing it?" + IDS_SAVE_FILTER "Event Log (*.evt)\0*.evt\0" END STRINGTABLE diff --git a/base/applications/mscutils/eventvwr/lang/es-ES.rc b/base/applications/mscutils/eventvwr/lang/es-ES.rc index 5195415d4ee..d7dfb8bde9b 100644 --- a/base/applications/mscutils/eventvwr/lang/es-ES.rc +++ b/base/applications/mscutils/eventvwr/lang/es-ES.rc @@ -10,6 +10,10 @@ BEGIN MENUITEM "&Seguridad", ID_LOG_SECURITY MENUITEM "&Sistema", ID_LOG_SYSTEM MENUITEM SEPARATOR + MENUITEM "Save &Protocol...", ID_SAVE_PROTOCOL, GRAYED + MENUITEM SEPARATOR + MENUITEM "C&lear all Events", ID_CLEAR_EVENTS, GRAYED + MENUITEM SEPARATOR MENUITEM "S&alir", IDM_EXIT END POPUP "&Ver" @@ -97,6 +101,8 @@ BEGIN IDS_EVENTLOG_AUDIT_FAILURE "Auditoria Fallida" IDS_EVENTLOG_SUCCESS "Acierto" IDS_EVENTLOG_UNKNOWN_TYPE "Evento Desconocido" + IDS_CLEAREVENTS_MSG "Do you want to save this event log before clearing it?" + IDS_SAVE_FILTER "Event Log (*.evt)\0*.evt\0" END STRINGTABLE diff --git a/base/applications/mscutils/eventvwr/lang/fr-FR.rc b/base/applications/mscutils/eventvwr/lang/fr-FR.rc index 42732e33cad..f123ba5deb6 100644 --- a/base/applications/mscutils/eventvwr/lang/fr-FR.rc +++ b/base/applications/mscutils/eventvwr/lang/fr-FR.rc @@ -10,6 +10,10 @@ BEGIN MENUITEM "&Sécurité", ID_LOG_SECURITY MENUITEM "&Système", ID_LOG_SYSTEM MENUITEM SEPARATOR + MENUITEM "Save &Protocol...", ID_SAVE_PROTOCOL, GRAYED + MENUITEM SEPARATOR + MENUITEM "C&lear all Events", ID_CLEAR_EVENTS, GRAYED + MENUITEM SEPARATOR MENUITEM "Quitter", IDM_EXIT END POPUP "Affichage" @@ -97,6 +101,8 @@ BEGIN IDS_EVENTLOG_AUDIT_FAILURE "Échec de l'audit" IDS_EVENTLOG_SUCCESS "Succès" IDS_EVENTLOG_UNKNOWN_TYPE "Événement Inconnu" + IDS_CLEAREVENTS_MSG "Do you want to save this event log before clearing it?" + IDS_SAVE_FILTER "Event Log (*.evt)\0*.evt\0" END STRINGTABLE diff --git a/base/applications/mscutils/eventvwr/lang/he-IL.rc b/base/applications/mscutils/eventvwr/lang/he-IL.rc index 0dffb05f056..aafdb5bbf15 100644 --- a/base/applications/mscutils/eventvwr/lang/he-IL.rc +++ b/base/applications/mscutils/eventvwr/lang/he-IL.rc @@ -10,6 +10,10 @@ BEGIN MENUITEM "אבטחה", ID_LOG_SECURITY MENUITEM "מערכת", ID_LOG_SYSTEM MENUITEM SEPARATOR + MENUITEM "Save &Protocol...", ID_SAVE_PROTOCOL, GRAYED + MENUITEM SEPARATOR + MENUITEM "C&lear all Events", ID_CLEAR_EVENTS, GRAYED + MENUITEM SEPARATOR MENUITEM "יציאה", IDM_EXIT END POPUP "תצוגה" @@ -97,6 +101,8 @@ BEGIN IDS_EVENTLOG_AUDIT_FAILURE "Audit Failure" IDS_EVENTLOG_SUCCESS "הצלחה" IDS_EVENTLOG_UNKNOWN_TYPE "אירוע לא ידוע" + IDS_CLEAREVENTS_MSG "Do you want to save this event log before clearing it?" + IDS_SAVE_FILTER "Event Log (*.evt)\0*.evt\0" END STRINGTABLE diff --git a/base/applications/mscutils/eventvwr/lang/it-IT.rc b/base/applications/mscutils/eventvwr/lang/it-IT.rc index 24a758707f8..d1543a1626c 100644 --- a/base/applications/mscutils/eventvwr/lang/it-IT.rc +++ b/base/applications/mscutils/eventvwr/lang/it-IT.rc @@ -10,6 +10,10 @@ BEGIN MENUITEM "&Sicurezza", ID_LOG_SECURITY MENUITEM "&Sistema", ID_LOG_SYSTEM MENUITEM SEPARATOR + MENUITEM "Save &Protocol...", ID_SAVE_PROTOCOL, GRAYED + MENUITEM SEPARATOR + MENUITEM "C&lear all Events", ID_CLEAR_EVENTS, GRAYED + MENUITEM SEPARATOR MENUITEM "E&sci", IDM_EXIT END POPUP "&Vista" @@ -97,6 +101,8 @@ BEGIN IDS_EVENTLOG_AUDIT_FAILURE "Audit fallita" IDS_EVENTLOG_SUCCESS "Successo" IDS_EVENTLOG_UNKNOWN_TYPE "Evento sconosciuto" + IDS_CLEAREVENTS_MSG "Do you want to save this event log before clearing it?" + IDS_SAVE_FILTER "Event Log (*.evt)\0*.evt\0" END STRINGTABLE diff --git a/base/applications/mscutils/eventvwr/lang/ja-JP.rc b/base/applications/mscutils/eventvwr/lang/ja-JP.rc index 07af81219b4..5fb5194e80d 100644 --- a/base/applications/mscutils/eventvwr/lang/ja-JP.rc +++ b/base/applications/mscutils/eventvwr/lang/ja-JP.rc @@ -10,6 +10,10 @@ BEGIN MENUITEM "セキュリティ(&S)", ID_LOG_SECURITY MENUITEM "システム(&S)", ID_LOG_SYSTEM MENUITEM SEPARATOR + MENUITEM "Save &Protocol...", ID_SAVE_PROTOCOL, GRAYED + MENUITEM SEPARATOR + MENUITEM "C&lear all Events", ID_CLEAR_EVENTS, GRAYED + MENUITEM SEPARATOR MENUITEM "終了(&X)", IDM_EXIT END POPUP "表示(&V)" @@ -97,6 +101,8 @@ BEGIN IDS_EVENTLOG_AUDIT_FAILURE "失敗の監査" IDS_EVENTLOG_SUCCESS "成功" IDS_EVENTLOG_UNKNOWN_TYPE "不明なイベント" + IDS_CLEAREVENTS_MSG "Do you want to save this event log before clearing it?" + IDS_SAVE_FILTER "Event Log (*.evt)\0*.evt\0" END STRINGTABLE diff --git a/base/applications/mscutils/eventvwr/lang/ko-KR.rc b/base/applications/mscutils/eventvwr/lang/ko-KR.rc index a8ed9d67c5e..5d02fc087ba 100644 --- a/base/applications/mscutils/eventvwr/lang/ko-KR.rc +++ b/base/applications/mscutils/eventvwr/lang/ko-KR.rc @@ -10,6 +10,10 @@ BEGIN MENUITEM "보안(&S)", ID_LOG_SECURITY MENUITEM "시스템(&S)", ID_LOG_SYSTEM MENUITEM SEPARATOR + MENUITEM "Save &Protocol...", ID_SAVE_PROTOCOL, GRAYED + MENUITEM SEPARATOR + MENUITEM "C&lear all Events", ID_CLEAR_EVENTS, GRAYED + MENUITEM SEPARATOR MENUITEM "종료(&X)", IDM_EXIT END POPUP "보기(&V)" @@ -97,6 +101,8 @@ BEGIN IDS_EVENTLOG_AUDIT_FAILURE "감사 실패" IDS_EVENTLOG_SUCCESS "성공" IDS_EVENTLOG_UNKNOWN_TYPE "알려지지 않은 이벤트" + IDS_CLEAREVENTS_MSG "Do you want to save this event log before clearing it?" + IDS_SAVE_FILTER "Event Log (*.evt)\0*.evt\0" END STRINGTABLE diff --git a/base/applications/mscutils/eventvwr/lang/no-NO.rc b/base/applications/mscutils/eventvwr/lang/no-NO.rc index 79e28b4353a..f66eca5bc68 100644 --- a/base/applications/mscutils/eventvwr/lang/no-NO.rc +++ b/base/applications/mscutils/eventvwr/lang/no-NO.rc @@ -8,6 +8,10 @@ BEGIN MENUITEM "&Sikkerhet", ID_LOG_SECURITY MENUITEM "&System", ID_LOG_SYSTEM MENUITEM SEPARATOR + MENUITEM "Save &Protocol...", ID_SAVE_PROTOCOL, GRAYED + MENUITEM SEPARATOR + MENUITEM "C&lear all Events", ID_CLEAR_EVENTS, GRAYED + MENUITEM SEPARATOR MENUITEM "A&vslutt", IDM_EXIT END POPUP "&Vis" @@ -95,6 +99,8 @@ BEGIN IDS_EVENTLOG_AUDIT_FAILURE "Revisjon misslykkes" IDS_EVENTLOG_SUCCESS "Suksess" IDS_EVENTLOG_UNKNOWN_TYPE "Ukjent hendelse" + IDS_CLEAREVENTS_MSG "Do you want to save this event log before clearing it?" + IDS_SAVE_FILTER "Event Log (*.evt)\0*.evt\0" END STRINGTABLE diff --git a/base/applications/mscutils/eventvwr/lang/pl-PL.rc b/base/applications/mscutils/eventvwr/lang/pl-PL.rc index 1c6732b64bf..7432a6686ab 100644 --- a/base/applications/mscutils/eventvwr/lang/pl-PL.rc +++ b/base/applications/mscutils/eventvwr/lang/pl-PL.rc @@ -1,4 +1,6 @@ -/* Polish translation by Caemyr - Olaf Siejka */ +/* Polish translation by Caemyr - Olaf Siejka + * PL update by wojo664 (June 2014) + */ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT @@ -10,6 +12,10 @@ BEGIN MENUITEM "&Zabezpieczenia", ID_LOG_SECURITY MENUITEM "&System", ID_LOG_SYSTEM MENUITEM SEPARATOR + MENUITEM "Zapisz &protokół...", ID_SAVE_PROTOCOL, GRAYED + MENUITEM SEPARATOR + MENUITEM "W&yczyść wszystkie zdarzenia", ID_CLEAR_EVENTS, GRAYED + MENUITEM SEPARATOR MENUITEM "&Wyjście", IDM_EXIT END POPUP "&Podgląd" @@ -87,8 +93,8 @@ END STRINGTABLE BEGIN IDS_APP_TITLE "Podgląd zdarzeń" - IDS_APP_TITLE_EX "%s - %s Log on \\\\" - IDS_STATUS_MSG "%s has %lu event(s)" + IDS_APP_TITLE_EX "%s - %s Log na \\\\" + IDS_STATUS_MSG "%s posiada %lu zdarzeń" IDS_EVENTSTRINGIDNOTFOUND "Opis zdarzenia dla danego numeru ID: ( %lu ) nie został odnaleziony w źródle: ( %s ). Ten komputer może nie miec wystarczających informacji w rejestrze, albo bibliotek DLL, aby wyświetlić wiadomości z komputera zdalnego." IDS_EVENTLOG_ERROR_TYPE "Błąd" IDS_EVENTLOG_WARNING_TYPE "Ostrzeżenie" @@ -97,6 +103,8 @@ BEGIN IDS_EVENTLOG_AUDIT_FAILURE "Nieudany Audyt" IDS_EVENTLOG_SUCCESS "Sukces" IDS_EVENTLOG_UNKNOWN_TYPE "Zdarzenie nieznane" + IDS_CLEAREVENTS_MSG "Czy chcesz zapisać dziennik zdarzeń przed czyszczeniem?" + IDS_SAVE_FILTER "Dziennik zdarzeń (*.evt)\0*.evt\0" END STRINGTABLE diff --git a/base/applications/mscutils/eventvwr/lang/pt-BR.rc b/base/applications/mscutils/eventvwr/lang/pt-BR.rc index a8bd572175f..47f33b21bc9 100644 --- a/base/applications/mscutils/eventvwr/lang/pt-BR.rc +++ b/base/applications/mscutils/eventvwr/lang/pt-BR.rc @@ -10,6 +10,10 @@ BEGIN MENUITEM "S&egurança", ID_LOG_SECURITY MENUITEM "&Sistema", ID_LOG_SYSTEM MENUITEM SEPARATOR + MENUITEM "Save &Protocol...", ID_SAVE_PROTOCOL, GRAYED + MENUITEM SEPARATOR + MENUITEM "C&lear all Events", ID_CLEAR_EVENTS, GRAYED + MENUITEM SEPARATOR MENUITEM "&Sair", IDM_EXIT END POPUP "&Visualizar" @@ -97,6 +101,8 @@ BEGIN IDS_EVENTLOG_AUDIT_FAILURE "Falha na Auditoria" IDS_EVENTLOG_SUCCESS "Sucesso" IDS_EVENTLOG_UNKNOWN_TYPE "Evento Desconhecido" + IDS_CLEAREVENTS_MSG "Do you want to save this event log before clearing it?" + IDS_SAVE_FILTER "Event Log (*.evt)\0*.evt\0" END STRINGTABLE diff --git a/base/applications/mscutils/eventvwr/lang/ro-RO.rc b/base/applications/mscutils/eventvwr/lang/ro-RO.rc index 62683009ecc..473f8755e5c 100644 --- a/base/applications/mscutils/eventvwr/lang/ro-RO.rc +++ b/base/applications/mscutils/eventvwr/lang/ro-RO.rc @@ -10,6 +10,10 @@ BEGIN MENUITEM "Se&curitate", ID_LOG_SECURITY MENUITEM "&Sistem", ID_LOG_SYSTEM MENUITEM SEPARATOR + MENUITEM "Save &Protocol...", ID_SAVE_PROTOCOL, GRAYED + MENUITEM SEPARATOR + MENUITEM "C&lear all Events", ID_CLEAR_EVENTS, GRAYED + MENUITEM SEPARATOR MENUITEM "I&eșire", IDM_EXIT END POPUP "&Afișare" @@ -97,6 +101,8 @@ BEGIN IDS_EVENTLOG_AUDIT_FAILURE "Eșec audit" IDS_EVENTLOG_SUCCESS "Succes" IDS_EVENTLOG_UNKNOWN_TYPE "Eveniment necunoscut" + IDS_CLEAREVENTS_MSG "Do you want to save this event log before clearing it?" + IDS_SAVE_FILTER "Event Log (*.evt)\0*.evt\0" END STRINGTABLE diff --git a/base/applications/mscutils/eventvwr/lang/ru-RU.rc b/base/applications/mscutils/eventvwr/lang/ru-RU.rc index 4da2d57fcc9..8a1a767751f 100644 --- a/base/applications/mscutils/eventvwr/lang/ru-RU.rc +++ b/base/applications/mscutils/eventvwr/lang/ru-RU.rc @@ -10,6 +10,10 @@ BEGIN MENUITEM "&Безопасности", ID_LOG_SECURITY MENUITEM "&Системы", ID_LOG_SYSTEM MENUITEM SEPARATOR + MENUITEM "Save &Protocol...", ID_SAVE_PROTOCOL, GRAYED + MENUITEM SEPARATOR + MENUITEM "C&lear all Events", ID_CLEAR_EVENTS, GRAYED + MENUITEM SEPARATOR MENUITEM "В&ыход", IDM_EXIT END POPUP "&Вид" @@ -97,6 +101,8 @@ BEGIN IDS_EVENTLOG_AUDIT_FAILURE "Аудит отказов" IDS_EVENTLOG_SUCCESS "Успех" IDS_EVENTLOG_UNKNOWN_TYPE "Неизвестное событие" + IDS_CLEAREVENTS_MSG "Do you want to save this event log before clearing it?" + IDS_SAVE_FILTER "Event Log (*.evt)\0*.evt\0" END STRINGTABLE diff --git a/base/applications/mscutils/eventvwr/lang/sk-SK.rc b/base/applications/mscutils/eventvwr/lang/sk-SK.rc index eb3a99f1f95..a751ec062bc 100644 --- a/base/applications/mscutils/eventvwr/lang/sk-SK.rc +++ b/base/applications/mscutils/eventvwr/lang/sk-SK.rc @@ -13,6 +13,10 @@ BEGIN MENUITEM "&Security", ID_LOG_SECURITY MENUITEM "&System", ID_LOG_SYSTEM MENUITEM SEPARATOR + MENUITEM "Save &Protocol...", ID_SAVE_PROTOCOL, GRAYED + MENUITEM SEPARATOR + MENUITEM "C&lear all Events", ID_CLEAR_EVENTS, GRAYED + MENUITEM SEPARATOR MENUITEM "&Skončiť", IDM_EXIT END POPUP "&Zobraziť" @@ -100,6 +104,8 @@ BEGIN IDS_EVENTLOG_AUDIT_FAILURE "Kontrola zlyhala" IDS_EVENTLOG_SUCCESS "Úspech" //Success IDS_EVENTLOG_UNKNOWN_TYPE "Neznáma udalosť" + IDS_CLEAREVENTS_MSG "Do you want to save this event log before clearing it?" + IDS_SAVE_FILTER "Event Log (*.evt)\0*.evt\0" END STRINGTABLE diff --git a/base/applications/mscutils/eventvwr/lang/sq-AL.rc b/base/applications/mscutils/eventvwr/lang/sq-AL.rc index 65e869f3b37..bb0be3429f3 100644 --- a/base/applications/mscutils/eventvwr/lang/sq-AL.rc +++ b/base/applications/mscutils/eventvwr/lang/sq-AL.rc @@ -16,6 +16,10 @@ BEGIN MENUITEM "&Siguri", ID_LOG_SECURITY MENUITEM "&Sistemi", ID_LOG_SYSTEM MENUITEM SEPARATOR + MENUITEM "Save &Protocol...", ID_SAVE_PROTOCOL, GRAYED + MENUITEM SEPARATOR + MENUITEM "C&lear all Events", ID_CLEAR_EVENTS, GRAYED + MENUITEM SEPARATOR MENUITEM "Dil", IDM_EXIT END POPUP "&Vëzhgo" @@ -103,6 +107,8 @@ BEGIN IDS_EVENTLOG_AUDIT_FAILURE "Audit dështoj" IDS_EVENTLOG_SUCCESS "Sukses" IDS_EVENTLOG_UNKNOWN_TYPE "Ngjraje e panjohur" + IDS_CLEAREVENTS_MSG "Do you want to save this event log before clearing it?" + IDS_SAVE_FILTER "Event Log (*.evt)\0*.evt\0" END STRINGTABLE diff --git a/base/applications/mscutils/eventvwr/lang/sv-SE.rc b/base/applications/mscutils/eventvwr/lang/sv-SE.rc index b9241cb28c6..f9eb385f189 100644 --- a/base/applications/mscutils/eventvwr/lang/sv-SE.rc +++ b/base/applications/mscutils/eventvwr/lang/sv-SE.rc @@ -10,6 +10,10 @@ BEGIN MENUITEM "&Säkerhet", ID_LOG_SECURITY MENUITEM "&System", ID_LOG_SYSTEM MENUITEM SEPARATOR + MENUITEM "Save &Protocol...", ID_SAVE_PROTOCOL, GRAYED + MENUITEM SEPARATOR + MENUITEM "C&lear all Events", ID_CLEAR_EVENTS, GRAYED + MENUITEM SEPARATOR MENUITEM "A&vsluta", IDM_EXIT END POPUP "&Visa" @@ -97,6 +101,8 @@ BEGIN IDS_EVENTLOG_AUDIT_FAILURE "Revision misslyckades" IDS_EVENTLOG_SUCCESS "Uppgift lyckades" IDS_EVENTLOG_UNKNOWN_TYPE "Okänd händelse" + IDS_CLEAREVENTS_MSG "Do you want to save this event log before clearing it?" + IDS_SAVE_FILTER "Event Log (*.evt)\0*.evt\0" END STRINGTABLE diff --git a/base/applications/mscutils/eventvwr/lang/tr-TR.rc b/base/applications/mscutils/eventvwr/lang/tr-TR.rc index 50cc321270c..e60c19c3f34 100644 --- a/base/applications/mscutils/eventvwr/lang/tr-TR.rc +++ b/base/applications/mscutils/eventvwr/lang/tr-TR.rc @@ -16,6 +16,10 @@ BEGIN MENUITEM "&Güvenlik", ID_LOG_SECURITY MENUITEM "&Dizge", ID_LOG_SYSTEM MENUITEM SEPARATOR + MENUITEM "Save &Protocol...", ID_SAVE_PROTOCOL, GRAYED + MENUITEM SEPARATOR + MENUITEM "C&lear all Events", ID_CLEAR_EVENTS, GRAYED + MENUITEM SEPARATOR MENUITEM "&Çıkış", IDM_EXIT END POPUP "&Görünüm" @@ -103,6 +107,8 @@ BEGIN IDS_EVENTLOG_AUDIT_FAILURE "Başarısızlık Denetimi" IDS_EVENTLOG_SUCCESS "Başarı" IDS_EVENTLOG_UNKNOWN_TYPE "Bilinmeyen Olay" + IDS_CLEAREVENTS_MSG "Do you want to save this event log before clearing it?" + IDS_SAVE_FILTER "Event Log (*.evt)\0*.evt\0" END STRINGTABLE diff --git a/base/applications/mscutils/eventvwr/lang/uk-UA.rc b/base/applications/mscutils/eventvwr/lang/uk-UA.rc index 501a705b7f3..82c61cab7a1 100644 --- a/base/applications/mscutils/eventvwr/lang/uk-UA.rc +++ b/base/applications/mscutils/eventvwr/lang/uk-UA.rc @@ -10,6 +10,10 @@ BEGIN MENUITEM "&Захист", ID_LOG_SECURITY MENUITEM "&Система", ID_LOG_SYSTEM MENUITEM SEPARATOR + MENUITEM "Save &Protocol...", ID_SAVE_PROTOCOL, GRAYED + MENUITEM SEPARATOR + MENUITEM "C&lear all Events", ID_CLEAR_EVENTS, GRAYED + MENUITEM SEPARATOR MENUITEM "В&ихід", IDM_EXIT END POPUP "&Вигляд" @@ -97,6 +101,8 @@ BEGIN IDS_EVENTLOG_AUDIT_FAILURE "Аудит відмов" IDS_EVENTLOG_SUCCESS "Успіх" IDS_EVENTLOG_UNKNOWN_TYPE "Невідома подія" + IDS_CLEAREVENTS_MSG "Do you want to save this event log before clearing it?" + IDS_SAVE_FILTER "Event Log (*.evt)\0*.evt\0" END STRINGTABLE diff --git a/base/applications/mscutils/eventvwr/lang/zh-CN.rc b/base/applications/mscutils/eventvwr/lang/zh-CN.rc index aee2a57aee3..524cf3dd552 100644 --- a/base/applications/mscutils/eventvwr/lang/zh-CN.rc +++ b/base/applications/mscutils/eventvwr/lang/zh-CN.rc @@ -10,6 +10,10 @@ BEGIN MENUITEM "安全日志(&S)", ID_LOG_SECURITY MENUITEM "系统日志(&Y)", ID_LOG_SYSTEM MENUITEM SEPARATOR + MENUITEM "Save &Protocol...", ID_SAVE_PROTOCOL, GRAYED + MENUITEM SEPARATOR + MENUITEM "C&lear all Events", ID_CLEAR_EVENTS, GRAYED + MENUITEM SEPARATOR MENUITEM "退出(&X)", IDM_EXIT END POPUP "查看(&V)" @@ -97,6 +101,8 @@ BEGIN IDS_EVENTLOG_AUDIT_FAILURE "审核失败" IDS_EVENTLOG_SUCCESS "成功" IDS_EVENTLOG_UNKNOWN_TYPE "未知事件" + IDS_CLEAREVENTS_MSG "Do you want to save this event log before clearing it?" + IDS_SAVE_FILTER "Event Log (*.evt)\0*.evt\0" END STRINGTABLE diff --git a/base/applications/mscutils/eventvwr/resource.h b/base/applications/mscutils/eventvwr/resource.h index 66e3032a9d7..b98a189c02e 100644 --- a/base/applications/mscutils/eventvwr/resource.h +++ b/base/applications/mscutils/eventvwr/resource.h @@ -46,6 +46,8 @@ #define ID_VIEW_REFRESH 32780 #define ID_REFRESH 32781 #define IDM_REFRESH 32782 +#define ID_CLEAR_EVENTS 32783 +#define ID_SAVE_PROTOCOL 32784 /* String IDs */ #define IDS_APP_TITLE 103 @@ -59,6 +61,8 @@ #define IDS_EVENTLOG_AUDIT_FAILURE 255 #define IDS_EVENTLOG_SUCCESS 256 #define IDS_EVENTLOG_UNKNOWN_TYPE 257 +#define IDS_CLEAREVENTS_MSG 258 +#define IDS_SAVE_FILTER 259 #define IDS_COLUMNTYPE 300 #define IDS_COLUMNDATE 301 diff --git a/base/applications/mscutils/servman/precomp.h b/base/applications/mscutils/servman/precomp.h index 4a63984bdfa..73ec61583b1 100644 --- a/base/applications/mscutils/servman/precomp.h +++ b/base/applications/mscutils/servman/precomp.h @@ -14,6 +14,7 @@ #include #include #include +#include #include "resource.h" diff --git a/base/applications/mscutils/servman/propsheet_depends.c b/base/applications/mscutils/servman/propsheet_depends.c index 01ebd0dca05..52afc515330 100644 --- a/base/applications/mscutils/servman/propsheet_depends.c +++ b/base/applications/mscutils/servman/propsheet_depends.c @@ -60,7 +60,7 @@ AddItemToTreeView(HWND hTreeView, dwSize * sizeof(TCHAR)); if (lpName) { - _tcscpy_s(lpName, dwSize, lpServiceName); + StringCchCopy(lpName, dwSize, lpServiceName); tvi.lParam = (LPARAM)lpName; } } diff --git a/base/applications/mscutils/servman/query.c b/base/applications/mscutils/servman/query.c index 69f0343ca0e..14a68e5a938 100644 --- a/base/applications/mscutils/servman/query.c +++ b/base/applications/mscutils/servman/query.c @@ -183,9 +183,9 @@ GetServiceDescription(LPTSTR lpServiceName) dwSize * sizeof(TCHAR)); if (lpDescription) { - _tcscpy_s(lpDescription, - dwSize, - pServiceDescription->lpDescription); + StringCchCopy(lpDescription, + dwSize, + pServiceDescription->lpDescription); } } } diff --git a/base/applications/mscutils/servman/stop_dependencies.c b/base/applications/mscutils/servman/stop_dependencies.c index 5ef227663f6..559002c6073 100644 --- a/base/applications/mscutils/servman/stop_dependencies.c +++ b/base/applications/mscutils/servman/stop_dependencies.c @@ -32,9 +32,9 @@ AddServiceToList(LPWSTR *lpServiceList, if (lpNewList) { /* Copy the service name */ - wcscpy_s(lpNewList, - dwToAddSize, - lpServiceToAdd); + StringCchCopy(lpNewList, + dwToAddSize, + lpServiceToAdd); /* Add the double null char */ lpNewList[dwToAddSize - 1] = L'\0'; @@ -68,9 +68,9 @@ AddServiceToList(LPWSTR *lpServiceList, if (lpNewList) { /* Copy the service name */ - wcscpy_s(&lpNewList[dwCurSize - 1], - dwToAddSize, - lpServiceToAdd); + StringCchCopy(&lpNewList[dwCurSize - 1], + dwToAddSize, + lpServiceToAdd); /* Add the double null char */ lpNewList[dwCurSize + dwToAddSize - 1] = L'\0'; diff --git a/base/applications/mspaint/dialogs.c b/base/applications/mspaint/dialogs.c index 7a7b4df093b..c0844dd8d9e 100644 --- a/base/applications/mspaint/dialogs.c +++ b/base/applications/mspaint/dialogs.c @@ -14,7 +14,7 @@ /* FUNCTIONS ********************************************************/ -LRESULT CALLBACK +INT_PTR CALLBACK MRDlgWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) @@ -66,10 +66,10 @@ MRDlgWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) int mirrorRotateDlg() { - return DialogBox(hProgInstance, MAKEINTRESOURCE(IDD_MIRRORROTATE), hMainWnd, (DLGPROC) MRDlgWinProc); + return DialogBox(hProgInstance, MAKEINTRESOURCE(IDD_MIRRORROTATE), hMainWnd, MRDlgWinProc); } -LRESULT CALLBACK +INT_PTR CALLBACK ATTDlgWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) @@ -203,10 +203,10 @@ ATTDlgWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) int attributesDlg() { - return DialogBox(hProgInstance, MAKEINTRESOURCE(IDD_ATTRIBUTES), hMainWnd, (DLGPROC) ATTDlgWinProc); + return DialogBox(hProgInstance, MAKEINTRESOURCE(IDD_ATTRIBUTES), hMainWnd, ATTDlgWinProc); } -LRESULT CALLBACK +INT_PTR CALLBACK CHSIZEDlgWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) @@ -266,5 +266,5 @@ CHSIZEDlgWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) int changeSizeDlg() { - return DialogBox(hProgInstance, MAKEINTRESOURCE(IDD_STRETCHSKEW), hMainWnd, (DLGPROC) CHSIZEDlgWinProc); + return DialogBox(hProgInstance, MAKEINTRESOURCE(IDD_STRETCHSKEW), hMainWnd, CHSIZEDlgWinProc); } diff --git a/base/applications/mstsc/connectdialog.c b/base/applications/mstsc/connectdialog.c index c67ecd9a9e6..f01e145d0dc 100644 --- a/base/applications/mstsc/connectdialog.c +++ b/base/applications/mstsc/connectdialog.c @@ -647,19 +647,11 @@ OnResolutionChanged(PINFO pInfo, INT position) Pixel, sizeof(Pixel) / sizeof(WCHAR))) { -#ifdef _MSC_VER - _swprintf(Buffer, - Pixel, - pInfo->DisplayDeviceList->Resolutions[position].dmPelsWidth, - pInfo->DisplayDeviceList->Resolutions[position].dmPelsHeight, - Pixel); -#else - swprintf(Buffer, - Pixel, - pInfo->DisplayDeviceList->Resolutions[position].dmPelsWidth, - pInfo->DisplayDeviceList->Resolutions[position].dmPelsHeight, - Pixel); -#endif + swprintf(Buffer, + Pixel, + pInfo->DisplayDeviceList->Resolutions[position].dmPelsWidth, + pInfo->DisplayDeviceList->Resolutions[position].dmPelsHeight, + Pixel); } } diff --git a/base/applications/network/net/CMakeLists.txt b/base/applications/network/net/CMakeLists.txt index 6af429e80b6..a740d3a06de 100644 --- a/base/applications/network/net/CMakeLists.txt +++ b/base/applications/network/net/CMakeLists.txt @@ -3,6 +3,7 @@ add_definitions(-D__USE_W32_SOCKETS) list(APPEND SOURCE main.c + cmdAccounts.c cmdStart.c cmdStop.c cmdHelpMsg.c @@ -11,8 +12,8 @@ list(APPEND SOURCE help.c net.h) -add_executable(net ${SOURCE}) +add_executable(net ${SOURCE} net.rc) set_module_type(net win32cui UNICODE) -add_importlibs(net advapi32 msvcrt kernel32) +add_importlibs(net advapi32 netapi32 msvcrt kernel32 user32 ntdll) add_pch(net net.h SOURCE) add_cd_file(TARGET net DESTINATION reactos/system32 FOR all) diff --git a/base/applications/network/net/cmdAccounts.c b/base/applications/network/net/cmdAccounts.c new file mode 100644 index 00000000000..456ac4c791e --- /dev/null +++ b/base/applications/network/net/cmdAccounts.c @@ -0,0 +1,229 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS net command + * FILE: + * PURPOSE: + * + * PROGRAMMERS: Eric Kohl + */ + +#include "net.h" + +INT +cmdAccounts( + INT argc, + WCHAR **argv) +{ + PUSER_MODALS_INFO_0 Info0 = NULL; + PUSER_MODALS_INFO_1 Info1 = NULL; + PUSER_MODALS_INFO_3 Info3 = NULL; + NT_PRODUCT_TYPE ProductType; + LPWSTR p; + LPWSTR endptr; + DWORD ParamErr; + ULONG value; + INT i; + BOOL Modified = FALSE; +// BOOL Domain = FALSE; + NET_API_STATUS Status; + INT result = 0; + + for (i = 2; i < argc; i++) + { + if (_wcsicmp(argv[i], L"help") == 0) + { + /* Print short syntax help */ + PrintResourceString(IDS_ACCOUNTS_SYNTAX); + return 0; + } + + if (_wcsicmp(argv[i], L"/help") == 0) + { + /* Print full help text*/ + PrintResourceString(IDS_ACCOUNTS_HELP); + return 0; + } + +/* + if (_wcsicmp(argv[i], L"/domain") == 0) + { + Domain = TRUE; + } +*/ + } + + Status = NetUserModalsGet(NULL, 0, (LPBYTE*)&Info0); + if (Status != NERR_Success) + goto done; + + for (i = 2; i < argc; i++) + { + if (_wcsnicmp(argv[i], L"/forcelogoff:", 13) == 0) + { + p = &argv[i][13]; + if (wcsicmp(p, L"no")) + { + Info0->usrmod0_force_logoff = TIMEQ_FOREVER; + Modified = TRUE; + } + else + { + value = wcstoul(p, &endptr, 10); + if (*endptr != 0) + { + printf("You entered an invalid value for the /FORCELOGOFF option.\n"); + result = 1; + goto done; + } + + Info0->usrmod0_force_logoff = value * 60; + Modified = TRUE; + } + } + else if (_wcsnicmp(argv[i], L"/minpwlen:", 10) == 0) + { + p = &argv[i][10]; + value = wcstoul(p, &endptr, 10); + if (*endptr != 0) + { + printf("You entered an invalid value for the /MINPWLEN option.\n"); + result = 1; + goto done; + } + + Info0->usrmod0_min_passwd_len = value; + Modified = TRUE; + } + else if (_wcsnicmp(argv[i], L"/maxpwage:", 10) == 0) + { + p = &argv[i][10]; + + if (wcsicmp(p, L"unlimited")) + { + Info0->usrmod0_max_passwd_age = ULONG_MAX; + Modified = TRUE; + } + else + { + value = wcstoul(p, &endptr, 10); + if (*endptr != 0) + { + printf("You entered an invalid value for the /MAXPWAGE option.\n"); + result = 1; + goto done; + } + + Info0->usrmod0_max_passwd_age = value * 86400; + Modified = TRUE; + } + } + else if (_wcsnicmp(argv[i], L"/minpwage:", 10) == 0) + { + p = &argv[i][10]; + value = wcstoul(p, &endptr, 10); + if (*endptr != 0) + { + printf("You entered an invalid value for the /MINPWAGE option.\n"); + result = 1; + goto done; + } + + Info0->usrmod0_min_passwd_age = value * 86400; + Modified = TRUE; + } + else if (_wcsnicmp(argv[i], L"/uniquepw:", 10) == 0) + { + p = &argv[i][10]; + value = wcstoul(p, &endptr, 10); + if (*endptr != 0) + { + printf("You entered an invalid value for the /UNIQUEPW option.\n"); + result = 1; + goto done; + } + + Info0->usrmod0_password_hist_len = value; + Modified = TRUE; + } + } + + if (Modified == TRUE) + { + Status = NetUserModalsSet(NULL, 0, (LPBYTE)Info0, &ParamErr); + if (Status != NERR_Success) + goto done; + } + else + { + Status = NetUserModalsGet(NULL, 1, (LPBYTE*)&Info1); + if (Status != NERR_Success) + goto done; + + Status = NetUserModalsGet(NULL, 3, (LPBYTE*)&Info3); + if (Status != NERR_Success) + goto done; + + RtlGetNtProductType(&ProductType); + + printf("Force logoff after: "); + if (Info0->usrmod0_force_logoff == TIMEQ_FOREVER) + printf("Never\n"); + else + printf("%lu seconds\n", Info0->usrmod0_force_logoff); + + printf("Minimum password age (in days): %lu\n", Info0->usrmod0_min_passwd_age / 86400); + printf("Maximum password age (in days): %lu\n", Info0->usrmod0_max_passwd_age / 86400); + printf("Minimum password length: %lu\n", Info0->usrmod0_min_passwd_len); + + printf("Password history length: "); + if (Info0->usrmod0_password_hist_len == 0) + printf("None\n"); + else + printf("%lu\n", Info0->usrmod0_password_hist_len); + + printf("Lockout threshold: "); + if (Info3->usrmod3_lockout_threshold == 0) + printf("Never\n"); + else + printf("%lu\n", Info3->usrmod3_lockout_threshold); + + printf("Lockout duration (in minutes): %lu\n", Info3->usrmod3_lockout_duration / 60); + printf("Lockout observation window (in minutes): %lu\n", Info3->usrmod3_lockout_observation_window / 60); + + printf("Computer role: "); + + if (Info1->usrmod1_role == UAS_ROLE_PRIMARY) + { + if (ProductType == NtProductLanManNt) + { + printf("Primary server\n"); + } + else if (ProductType == NtProductServer) + { + printf("Standalone server\n"); + } + else + { + printf("Workstation\n"); + } + } + else + { + printf("Backup server\n"); + } + } + +done: + if (Info3 != NULL) + NetApiBufferFree(Info3); + + if (Info1 != NULL) + NetApiBufferFree(Info1); + + if (Info0 != NULL) + NetApiBufferFree(Info0); + + return result; +} + +/* EOF */ diff --git a/base/applications/network/net/cmdContinue.c b/base/applications/network/net/cmdContinue.c index 7f23fa5777a..f36111af2c9 100644 --- a/base/applications/network/net/cmdContinue.c +++ b/base/applications/network/net/cmdContinue.c @@ -15,13 +15,23 @@ INT cmdContinue(INT argc, WCHAR **argv) SC_HANDLE hService = NULL; SERVICE_STATUS status; INT nError = 0; + INT i; if (argc != 3) { - puts("Usage: NET CONTINUE "); + PrintResourceString(IDS_CONTINUE_SYNTAX); return 1; } + for (i = 2; i < argc; i++) + { + if (_wcsicmp(argv[i], L"/help") == 0) + { + PrintResourceString(IDS_CONTINUE_HELP); + return 1; + } + } + hManager = OpenSCManager(NULL, SERVICES_ACTIVE_DATABASE, SC_MANAGER_ENUMERATE_SERVICE); if (hManager == NULL) { diff --git a/base/applications/network/net/cmdHelpMsg.c b/base/applications/network/net/cmdHelpMsg.c index d7766c0a1cf..8247836b354 100644 --- a/base/applications/network/net/cmdHelpMsg.c +++ b/base/applications/network/net/cmdHelpMsg.c @@ -16,17 +16,27 @@ INT cmdHelpMsg(INT argc, WCHAR **argv) LPWSTR endptr; LPWSTR lpBuffer; LONG errNum; + INT i; if (argc < 3) { - puts("Usage: NET HELPMSG "); + PrintResourceString(IDS_HELPMSG_SYNTAX); return 1; } + for (i = 2; i < argc; i++) + { + if (_wcsicmp(argv[i], L"/help") == 0) + { + PrintResourceString(IDS_HELPMSG_HELP); + return 1; + } + } + errNum = wcstol(argv[2], &endptr, 10); if (*endptr != 0) { - puts("Usage: NET HELPMSG "); + PrintResourceString(IDS_HELPMSG_SYNTAX); return 1; } diff --git a/base/applications/network/net/cmdPause.c b/base/applications/network/net/cmdPause.c index 02278939c98..32f87756509 100644 --- a/base/applications/network/net/cmdPause.c +++ b/base/applications/network/net/cmdPause.c @@ -15,13 +15,23 @@ INT cmdPause(INT argc, WCHAR **argv) SC_HANDLE hService = NULL; SERVICE_STATUS status; INT nError = 0; + INT i; if (argc != 3) { - puts("Usage: NET PAUSE "); + PrintResourceString(IDS_PAUSE_SYNTAX); return 1; } + for (i = 2; i < argc; i++) + { + if (_wcsicmp(argv[i], L"/help") == 0) + { + PrintResourceString(IDS_PAUSE_HELP); + return 1; + } + } + hManager = OpenSCManager(NULL, SERVICES_ACTIVE_DATABASE, SC_MANAGER_ENUMERATE_SERVICE); if (hManager == NULL) { diff --git a/base/applications/network/net/cmdStart.c b/base/applications/network/net/cmdStart.c index c2da1ce7161..34070584f72 100644 --- a/base/applications/network/net/cmdStart.c +++ b/base/applications/network/net/cmdStart.c @@ -162,16 +162,21 @@ done: INT cmdStart(INT argc, WCHAR **argv) { - INT nError = 0; + INT i; if (argc == 2) { - nError = EnumerateRunningServices(); - } - else - { - nError = StartOneService(argc, argv); + return EnumerateRunningServices(); } - return nError; + for (i = 2; i < argc; i++) + { + if (_wcsicmp(argv[i], L"/help") == 0) + { + PrintResourceString(IDS_START_HELP); + return 1; + } + } + + return StartOneService(argc, argv); } diff --git a/base/applications/network/net/cmdStop.c b/base/applications/network/net/cmdStop.c index 3f395219424..ef30aae270d 100644 --- a/base/applications/network/net/cmdStop.c +++ b/base/applications/network/net/cmdStop.c @@ -16,14 +16,23 @@ INT cmdStop(INT argc, WCHAR **argv) SERVICE_STATUS ServiceStatus; DWORD dwError = ERROR_SUCCESS; INT nError = 0; + INT i; if (argc != 3) { - /* FIXME: Print usage message! */ - printf("Usage: NET STOP \n"); + PrintResourceString(IDS_STOP_SYNTAX); return 1; } + for (i = 2; i < argc; i++) + { + if (_wcsicmp(argv[i], L"/help") == 0) + { + PrintResourceString(IDS_STOP_HELP); + return 1; + } + } + hManager = OpenSCManagerW(NULL, SERVICES_ACTIVE_DATABASE, SC_MANAGER_ENUMERATE_SERVICE); diff --git a/base/applications/network/net/help.c b/base/applications/network/net/help.c index 089f4a64f20..cce77a68418 100644 --- a/base/applications/network/net/help.c +++ b/base/applications/network/net/help.c @@ -13,186 +13,150 @@ INT cmdHelp(INT argc, WCHAR **argv) { if (argc != 3) { - return 0; - } - - if (_wcsicmp(argv[2],L"ACCOUNTS")==0) - { - puts("ACCOUNTS"); - puts("help text"); + PrintResourceString(IDS_HELP_SYNTAX); return 0; } - if (_wcsicmp(argv[2],L"COMPUTER")==0) + if (_wcsicmp(argv[2],L"ACCOUNTS") == 0) { - puts("COMPUTER"); - puts("help text"); + PrintResourceString(IDS_ACCOUNTS_HELP); return 0; } - if (_wcsicmp(argv[2],L"CONFIG")==0) + if (_wcsicmp(argv[2],L"COMPUTER") == 0) { - puts("CONFIG"); - puts("help text"); + PrintResourceString(IDS_COMPUTER_HELP); return 0; } - if (_wcsicmp(argv[2],L"CONTINUE")==0) + if (_wcsicmp(argv[2],L"CONFIG") == 0) { - puts("CONTINUE"); - puts("help text"); + PrintResourceString(IDS_CONFIG_HELP); return 0; } - if (_wcsicmp(argv[2],L"FILE")==0) + if (_wcsicmp(argv[2],L"CONTINUE") == 0) { - puts("FILE"); - puts("help text"); + PrintResourceString(IDS_CONTINUE_HELP); return 0; } - if (_wcsicmp(argv[2],L"GROUP")==0) + if (_wcsicmp(argv[2],L"FILE") == 0) { - puts("GROUP"); - puts("help text"); + PrintResourceString(IDS_FILE_HELP); return 0; } - if (_wcsicmp(argv[2],L"HELP")==0) + if (_wcsicmp(argv[2],L"GROUP") == 0) { - puts("HELP"); - puts("help text"); + PrintResourceString(IDS_GROUP_HELP); return 0; } - if (_wcsicmp(argv[2],L"HELPMSG")==0) + if (_wcsicmp(argv[2],L"HELPMSG") == 0) { - puts("HELPMSG"); - puts("help text"); + PrintResourceString(IDS_HELPMSG_HELP); return 0; } - if (_wcsicmp(argv[2],L"LOCALGROUP")==0) + if (_wcsicmp(argv[2],L"LOCALGROUP") == 0) { - puts("LOCALGROUP"); - puts("help text"); + PrintResourceString(IDS_LOCALGROUP_HELP); return 0; } - if (_wcsicmp(argv[2],L"NAME")==0) + if (_wcsicmp(argv[2],L"NAME") == 0) { - puts("NAME"); - puts("help text"); + PrintResourceString(IDS_NAME_HELP); return 0; } - if (_wcsicmp(argv[2],L"PRINT")==0) + if (_wcsicmp(argv[2],L"PAUSE") == 0) { - puts("PRINT"); - puts("help text"); + PrintResourceString(IDS_PAUSE_HELP); return 0; } - if (_wcsicmp(argv[2],L"SEND")==0) + if (_wcsicmp(argv[2],L"PRINT") == 0) { - puts("SEND"); - puts("help text"); + PrintResourceString(IDS_PRINT_HELP); return 0; } - if (_wcsicmp(argv[2],L"SESSION")==0) + if (_wcsicmp(argv[2],L"SEND") == 0) { - puts("SESSION"); - puts("help text"); + PrintResourceString(IDS_SEND_HELP); return 0; } - if (_wcsicmp(argv[2],L"SHARE")==0) + if (_wcsicmp(argv[2],L"SESSION") == 0) { - puts("SHARE"); - puts("help text"); + PrintResourceString(IDS_SESSION_HELP); return 0; } - if (_wcsicmp(argv[2],L"START")==0) + if (_wcsicmp(argv[2],L"SHARE") == 0) { - puts("START"); - puts("help text"); + PrintResourceString(IDS_SHARE_HELP); return 0; } - if (_wcsicmp(argv[2],L"STATISTICS")==0) + if (_wcsicmp(argv[2],L"START") == 0) { - puts("STATISTICS"); - puts("help text"); + PrintResourceString(IDS_START_HELP); return 0; } - if (_wcsicmp(argv[2],L"STOP")==0) + if (_wcsicmp(argv[2],L"STATISTICS") == 0) { - puts("STOP"); - puts("help text"); + PrintResourceString(IDS_STATISTICS_HELP); return 0; } - if (_wcsicmp(argv[2],L"TIME")==0) + if (_wcsicmp(argv[2],L"STOP") == 0) { - puts("TIME"); - puts("help text"); + PrintResourceString(IDS_STOP_HELP); return 0; } - if (_wcsicmp(argv[2],L"USE")==0) + if (_wcsicmp(argv[2],L"TIME") == 0) { - puts("USE"); - puts("help text"); + PrintResourceString(IDS_TIME_HELP); return 0; } - if (_wcsicmp(argv[2],L"USER")==0) + if (_wcsicmp(argv[2],L"USE") == 0) { - puts("USER"); - puts("help text"); + PrintResourceString(IDS_USE_HELP); return 0; } - if (_wcsicmp(argv[2],L"VIEW")==0) + if (_wcsicmp(argv[2],L"USER") == 0) { - puts("VIEW"); - puts("help text"); + PrintResourceString(IDS_USER_HELP); return 0; } - help(); + if (_wcsicmp(argv[2],L"VIEW") == 0) + { + PrintResourceString(IDS_VIEW_HELP); + return 0; + } + +#if 0 + if (_wcsicmp(argv[2],L"SERVICES") == 0) + { + return 0; + } + + if (_wcsicmp(argv[2],L"SYNTAX") == 0) + { + return 0; + } +#endif + + PrintResourceString(IDS_HELP_SYNTAX); + return 0; } -VOID help(VOID) -{ - puts("NET ACCOUNTS"); - puts("NET COMPUTER"); - puts("NET CONFIG"); - puts("NET CONFIG SERVER"); - puts("NET CONFIG WORKSTATION"); - puts("NET CONTINUE"); - puts("NET FILE"); - puts("NET GROUP"); - - puts("NET HELP"); - puts("NET HELPMSG"); - puts("NET LOCALGROUP"); - puts("NET NAME"); - puts("NET PAUSE"); - puts("NET PRINT"); - puts("NET SEND"); - puts("NET SESSION"); - - puts("NET SHARE"); - puts("NET START"); - puts("NET STATISTICS"); - puts("NET STOP"); - puts("NET TIME"); - puts("NET USE"); - puts("NET USER"); - puts("NET VIEW"); -} diff --git a/base/applications/network/net/lang/en-US.rc b/base/applications/network/net/lang/en-US.rc new file mode 100644 index 00000000000..3571f66f186 --- /dev/null +++ b/base/applications/network/net/lang/en-US.rc @@ -0,0 +1,63 @@ +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +STRINGTABLE +BEGIN + IDS_ACCOUNTS_SYNTAX "Usage:\nNET ACCOUNTS [/FORCELOGOFF:{Minutes|NO}] [/MINPWLEN:Length]\n\ + [/MAXPWAGE:{Days|UNLIMITED}] [/MINPWAGE:Days]\n\ + [/UNIQUEPW:Count] [/DOMAIN]\n" + IDS_ACCOUNTS_HELP "ACCOUNTS\n..." + IDS_COMPUTER_SYNTAX "Usage:\nNET COMPUTER ..." + IDS_COMPUTER_HELP "COMPUTER\n..." + IDS_CONFIG_SYNTAX "Usage:\nNET CONFIG ..." + IDS_CONFIG_HELP "CONFIG\n..." + IDS_CONTINUE_SYNTAX "Usage:\nNET CONTINUE " + IDS_CONTINUE_HELP "CONTINUE\n..." + IDS_FILE_SYNTAX "Usage:\nNET FILE ..." + IDS_FILE_HELP "FILE\n..." + IDS_GROUP_SYNTAX "Usage:\nNET GROUP ..." + IDS_GROUP_HELP "GROUP\n..." + IDS_HELPMSG_SYNTAX "Usage:\nNET HELPMSG " + IDS_HELPMSG_HELP "HELPMSG\n..." + IDS_LOCALGROUP_SYNTAX "Usage:\nNET LOCALGROUP ..." + IDS_LOCALGROUP_HELP "LOCALGROUP\n..." + IDS_NAME_SYNTAX "Usage:\nNET NAME ..." + IDS_NAME_HELP "NAME\n..." + IDS_PRINT_SYNTAX "Usage:\nNET PRINT ..." + IDS_PRINT_HELP "PRINT\n..." + IDS_PAUSE_SYNTAX "Usage:\nNET PAUSE " + IDS_PAUSE_HELP "PAUSE\n..." + IDS_SEND_SYNTAX "Usage:\nNET SEND ..." + IDS_SEND_HELP "SEND\n..." + IDS_SESSION_SYNTAX "Usage:\nNET SESSION ..." + IDS_SESSION_HELP "SESSION\n..." + IDS_SHARE_SYNTAX "Usage:\nNET SHARE ..." + IDS_SHARE_HELP "SHARE\n..." + IDS_START_SYNTAX "Usage:\nNET START ..." + IDS_START_HELP "START\n..." + IDS_STATISTICS_SYNTAX "Usage:\nNET STATISTICS ..." + IDS_STATISTICS_HELP "STATISTICS\n..." + IDS_STOP_SYNTAX "Usage:\nNET STOP " + IDS_STOP_HELP "STOP\n..." + IDS_TIME_SYNTAX "Usage:\nNET TIME ..." + IDS_TIME_HELP "TIME\n..." + IDS_USE_SYNTAX "Usage:\nNET USE ..." + IDS_USE_HELP "USE\n..." + IDS_USER_SYNTAX "Usage:\nNET USER ..." + IDS_USER_HELP "USER\n..." + IDS_VIEW_SYNTAX "Usage:\nNET VIEW ..." + IDS_VIEW_HELP "VIEW\n..." + IDS_HELP_SYNTAX "Usage:\nNET HELP \n - or -\nNET /HELP\n\n\ + The following commands are available:\n\n\ + NET ACCOUNTS NET HELP NET SHARE\n\ + NET COMPUTER NET HELPMSG NET START\n\ + NET CONFIG NET LOCALGROUP NET STATISTICS\n\ + NET CONFIG SERVER NET NAME NET STOP\n\ + NET CONFIG WORKSTATION NET PAUSE NET TIME\n\ + NET CONTINUE NET PRINT NET USE\n\ + NET FILE NET SEND NET USER\n\ + NET GROUP NET SESSION NET VIEW\n\n\ + ..." + IDS_NET_SYNTAX "Usage:\nNET [ ACCOUNTS | COMPUTER | CONFIG | CONTINUE | FILE | GROUP | HELP |\n\ + HELPMSG | LOCALGROUP | NAME | PAUSE | PRINT | SEND | SESSION |\n\ + SHARE | START | STATISTICS | STOP | TIME | USE | NET USER | VIEW ]\n" +END diff --git a/base/applications/network/net/main.c b/base/applications/network/net/main.c index 8f226967d2c..f1560dd06f3 100644 --- a/base/applications/network/net/main.c +++ b/base/applications/network/net/main.c @@ -9,6 +9,8 @@ #include "net.h" +#define MAX_BUFFER_SIZE 4096 + typedef struct _COMMAND { WCHAR *name; @@ -18,7 +20,7 @@ typedef struct _COMMAND COMMAND cmds[] = { - {L"accounts", unimplemented}, + {L"accounts", cmdAccounts}, {L"computer", unimplemented}, {L"config", unimplemented}, {L"continue", cmdContinue}, @@ -28,8 +30,8 @@ COMMAND cmds[] = {L"helpmsg", cmdHelpMsg}, {L"localgroup", unimplemented}, {L"name", unimplemented}, - {L"print", unimplemented}, {L"pause", cmdPause}, + {L"print", unimplemented}, {L"send", unimplemented}, {L"session", unimplemented}, {L"share", unimplemented}, @@ -43,13 +45,29 @@ COMMAND cmds[] = {NULL, NULL} }; + +VOID +PrintResourceString( + INT resID, + ...) +{ + WCHAR szMsgBuf[MAX_BUFFER_SIZE]; + va_list arg_ptr; + + va_start(arg_ptr, resID); + LoadStringW(GetModuleHandle(NULL), resID, szMsgBuf, MAX_BUFFER_SIZE); + vwprintf(szMsgBuf, arg_ptr); + va_end(arg_ptr); +} + + int wmain(int argc, WCHAR **argv) { PCOMMAND cmdptr; if (argc < 2) { - help(); + PrintResourceString(IDS_NET_SYNTAX); return 1; } @@ -62,7 +80,7 @@ int wmain(int argc, WCHAR **argv) } } - help(); + PrintResourceString(IDS_NET_SYNTAX); return 1; } diff --git a/base/applications/network/net/net.h b/base/applications/network/net/net.h index 4df059b8428..93cf15d81c1 100644 --- a/base/applications/network/net/net.h +++ b/base/applications/network/net/net.h @@ -7,16 +7,31 @@ #ifndef _NET_PCH_ #define _NET_PCH_ +#define WIN32_NO_STATUS + #include #include #include +#include #include #include +#include +#include +#include +#include + +#include "resource.h" + +VOID +PrintResourceString( + INT resID, + ...); VOID help(VOID); INT unimplemented(INT argc, WCHAR **argv); +INT cmdAccounts(INT argc, WCHAR **argv); INT cmdContinue(INT argc, WCHAR **argv); INT cmdHelp(INT argc, WCHAR **argv); INT cmdHelpMsg(INT argc, WCHAR **argv); diff --git a/base/applications/network/net/net.rc b/base/applications/network/net/net.rc new file mode 100644 index 00000000000..ef6ba03f034 --- /dev/null +++ b/base/applications/network/net/net.rc @@ -0,0 +1,17 @@ +#include + +#include "resource.h" + +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL + +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Net Command" +#define REACTOS_STR_INTERNAL_NAME "net" +#define REACTOS_STR_ORIGINAL_FILENAME "net.exe" +#include + +/* UTF-8 */ +#pragma code_page(65001) + +#ifdef LANGUAGE_EN_US + #include "lang/en-US.rc" +#endif diff --git a/base/applications/network/net/resource.h b/base/applications/network/net/resource.h new file mode 100644 index 00000000000..f13e3e1d881 --- /dev/null +++ b/base/applications/network/net/resource.h @@ -0,0 +1,46 @@ +#pragma once + +#define IDS_ACCOUNTS_SYNTAX 100 +#define IDS_ACCOUNTS_HELP 101 +#define IDS_COMPUTER_SYNTAX 102 +#define IDS_COMPUTER_HELP 103 +#define IDS_CONFIG_SYNTAX 104 +#define IDS_CONFIG_HELP 105 +#define IDS_CONTINUE_SYNTAX 106 +#define IDS_CONTINUE_HELP 107 +#define IDS_FILE_SYNTAX 108 +#define IDS_FILE_HELP 109 +#define IDS_GROUP_SYNTAX 110 +#define IDS_GROUP_HELP 111 +#define IDS_HELPMSG_SYNTAX 112 +#define IDS_HELPMSG_HELP 113 +#define IDS_LOCALGROUP_SYNTAX 114 +#define IDS_LOCALGROUP_HELP 115 +#define IDS_NAME_SYNTAX 116 +#define IDS_NAME_HELP 117 +#define IDS_PAUSE_SYNTAX 118 +#define IDS_PAUSE_HELP 119 +#define IDS_PRINT_SYNTAX 120 +#define IDS_PRINT_HELP 121 +#define IDS_SEND_SYNTAX 122 +#define IDS_SEND_HELP 123 +#define IDS_SESSION_SYNTAX 124 +#define IDS_SESSION_HELP 125 +#define IDS_SHARE_SYNTAX 126 +#define IDS_SHARE_HELP 127 +#define IDS_START_SYNTAX 128 +#define IDS_START_HELP 129 +#define IDS_STATISTICS_SYNTAX 130 +#define IDS_STATISTICS_HELP 131 +#define IDS_STOP_SYNTAX 132 +#define IDS_STOP_HELP 133 +#define IDS_TIME_SYNTAX 134 +#define IDS_TIME_HELP 135 +#define IDS_USE_SYNTAX 136 +#define IDS_USE_HELP 137 +#define IDS_USER_SYNTAX 138 +#define IDS_USER_HELP 139 +#define IDS_VIEW_SYNTAX 140 +#define IDS_VIEW_HELP 141 +#define IDS_HELP_SYNTAX 142 +#define IDS_NET_SYNTAX 143 diff --git a/base/applications/rapps/lang/en-US.rc b/base/applications/rapps/lang/en-US.rc index 55f375bbb7b..3333836ed8c 100644 --- a/base/applications/rapps/lang/en-US.rc +++ b/base/applications/rapps/lang/en-US.rc @@ -147,7 +147,7 @@ BEGIN IDS_AINFO_DESCRIPTION "\nDescription: " IDS_AINFO_SIZE "\nSize: " IDS_AINFO_URLSITE "\nHome Page: " - IDS_AINFO_LICENCE "\nLicence: " + IDS_AINFO_LICENCE "\nLicense: " END STRINGTABLE diff --git a/base/applications/rapps/rapps/abyss.txt b/base/applications/rapps/rapps/abyss.txt index 5ad87798927..9e0e0f6349b 100644 --- a/base/applications/rapps/rapps/abyss.txt +++ b/base/applications/rapps/rapps/abyss.txt @@ -1,9 +1,9 @@ -; UTF-8 +; UTF-8 ; Turkish translation by Erdem Ersoy (eersoy93) (erdemersoy@live.com) [Section] Name = Abyss Web server X1 -Version = 2.9.0.1 +Version = 2.9.3.2 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 = 2.1 MB diff --git a/base/applications/rapps/rapps/bochs.txt b/base/applications/rapps/rapps/bochs.txt index 3709d9ca419..445e35730ca 100644 --- a/base/applications/rapps/rapps/bochs.txt +++ b/base/applications/rapps/rapps/bochs.txt @@ -1,16 +1,16 @@ -; UTF-8 +; UTF-8 ; Polish translation by wojo664 ; Turkish translation by Erdem Ersoy (eersoy93) (erdemersoy@live.com) [Section] Name = Bochs -Version = 2.6.2 +Version = 2.6.5 Licence = LGPL v2 Description = Bochs is a highly portable open source IA-32 (x86) PC emulator written in C++, that runs on most popular platforms. Size = 4.7 MB Category = 15 URLSite = http://bochs.sourceforge.net/ -URLDownload = http://download.sourceforge.net/project/bochs/bochs/2.6.2/Bochs-2.6.2.exe +URLDownload = http://download.sourceforge.net/project/bochs/bochs/2.6.5/Bochs-2.6.5.exe CDPath = none [Section.0407] diff --git a/base/applications/rapps/rapps/boswars.txt b/base/applications/rapps/rapps/boswars.txt index 4d66d757fcb..bc586dafcbb 100644 --- a/base/applications/rapps/rapps/boswars.txt +++ b/base/applications/rapps/rapps/boswars.txt @@ -27,5 +27,5 @@ Description = Bos Wars e o strategie în timp real, futuristă. Pentru a porni j Size = 62,3 Mo [Section.041f] -Description = Bos Wars, gelecekçi ve gerçek zamanlı bir izlem oyunudur. Oyunu başlatmak için Microsoft Visual C++ 2008 Yürütücüsü'nü kurunuz. +Description = Bos Wars, gelecekçi ve gerçek zamanlı bir izlem oyunudur. Oyunu başlatmak için Microsoft Visual C++ 2008 Yürütücü'yü kurunuz. Size = 62,3 MB diff --git a/base/applications/rapps/rapps/codeblocks.txt b/base/applications/rapps/rapps/codeblocks.txt index 82257b02454..25ce4191c34 100644 --- a/base/applications/rapps/rapps/codeblocks.txt +++ b/base/applications/rapps/rapps/codeblocks.txt @@ -9,7 +9,7 @@ Description = A open source, cross-platform, powerful IDE. It doesn't contain a Size = 29.2 MB Category = 7 URLSite = http://www.codeblocks.org/ -URLDownload = http://sourceforge.net/projects/codeblocks/files/Binaries/13.12/Windows/codeblocks-13.12-setup.exe +URLDownload = http://download.sourceforge.net/project/codeblocks/Binaries/13.12/Windows/codeblocks-13.12-setup.exe CDPath = none [Section.0407] diff --git a/base/applications/rapps/rapps/codeblocks_gcc.txt b/base/applications/rapps/rapps/codeblocks_gcc.txt index 70dc894a960..de4d727bda7 100644 --- a/base/applications/rapps/rapps/codeblocks_gcc.txt +++ b/base/applications/rapps/rapps/codeblocks_gcc.txt @@ -9,7 +9,7 @@ Description = A open source, cross-platform, powerful IDE. It contains TDM-GCC ( Size = 97.8 MB Category = 7 URLSite = http://www.codeblocks.org/ -URLDownload = http://sourceforge.net/projects/codeblocks/files/Binaries/13.12/Windows/codeblocks-13.12mingw-setup.exe +URLDownload = http://download.sourceforge.net/project/codeblocks/Binaries/13.12/Windows/codeblocks-13.12mingw-setup.exe CDPath = none [Section.0407] diff --git a/base/applications/rapps/rapps/codeblocks_gcc_2.txt b/base/applications/rapps/rapps/codeblocks_gcc_2.txt index e7678186859..8b287d335ca 100644 --- a/base/applications/rapps/rapps/codeblocks_gcc_2.txt +++ b/base/applications/rapps/rapps/codeblocks_gcc_2.txt @@ -9,7 +9,7 @@ Description = A open source, cross-platform, powerful IDE. It contains TDM-GCC ( Size = 100 MB Category = 7 URLSite = http://www.codeblocks.org/ -URLDownload = http://sourceforge.net/projects/codeblocks/files/Binaries/13.12/Windows/codeblocks-13.12mingw-setup-TDM-GCC-481.exe +URLDownload = http://download.sourceforge.net/project/codeblocks/Binaries/13.12/Windows/codeblocks-13.12mingw-setup-TDM-GCC-481.exe CDPath = none [Section.0407] diff --git a/base/applications/rapps/rapps/devcpp_mingw32.txt b/base/applications/rapps/rapps/devcpp_mingw32.txt index eeab44f6c2a..55463540924 100644 --- a/base/applications/rapps/rapps/devcpp_mingw32.txt +++ b/base/applications/rapps/rapps/devcpp_mingw32.txt @@ -1,15 +1,15 @@ -; UTF-8 +; UTF-8 ; Turkish translation by Erdem Ersoy (eersoy93) (erdemersoy@live.com) [Section] Name = Orwell Dev-C++ MinGW32 -Version = 5.6.2 +Version = 5.6.3 Licence = GPLv2 Description = A maintained version of Dev-C++. It contains MinGW32 compiler. Size = 60.2 MB Category = 7 URLSite = http://orwelldevcpp.blogspot.com/ -URLDownload = http://sourceforge.net/projects/orwelldevcpp/files/Setup%20Releases/Dev-Cpp%205.6.2%20MinGW%204.8.1%20Setup.exe +URLDownload = http://download.sourceforge.net/project/orwelldevcpp/Setup%20Releases/Dev-Cpp%205.6.3%20MinGW%204.8.1%20Setup.exe CDPath = none [Section.0407] diff --git a/base/applications/rapps/rapps/devcpp_tdm_gcc_x64.txt b/base/applications/rapps/rapps/devcpp_tdm_gcc_x64.txt index ed2f12c3687..1264f0aab44 100644 --- a/base/applications/rapps/rapps/devcpp_tdm_gcc_x64.txt +++ b/base/applications/rapps/rapps/devcpp_tdm_gcc_x64.txt @@ -1,15 +1,15 @@ -; UTF-8 +; UTF-8 ; Turkish translation by Erdem Ersoy (eersoy93) (erdemersoy@live.com) [Section] Name = Orwell Dev-C++ TDM GCC x64 -Version = 5.6.2 +Version = 5.6.3 Licence = GPLv2 Description = A maintained version of Dev-C++. It contains 64 bit TDM-GCC compiler. Size = 44.8 MB Category = 7 URLSite = http://orwelldevcpp.blogspot.com/ -URLDownload = http://sourceforge.net/projects/orwelldevcpp/files/Setup%20Releases/Dev-Cpp%205.6.2%20TDM-GCC%20x64%204.8.1%20Setup.exe +URLDownload = http://download.sourceforge.net/project/orwelldevcpp/Setup%20Releases/Dev-Cpp%205.6.3%20TDM-GCC%20x64%204.8.1%20Setup.exe CDPath = none [Section.0407] diff --git a/base/applications/rapps/rapps/doublecommander.txt b/base/applications/rapps/rapps/doublecommander.txt index e2c80a5c1b9..2541aeef471 100644 --- a/base/applications/rapps/rapps/doublecommander.txt +++ b/base/applications/rapps/rapps/doublecommander.txt @@ -1,15 +1,15 @@ -; UTF-8 +; UTF-8 ; Turkish translation by Erdem Ersoy (eersoy93) (erdemersoy@live.com) [Section] Name = Double Commander -Version = 0.5.9 Beta +Version = 0.5.10 Beta Licence = GPL Description = Double Commander is an open source file manager with two panels side by side. You need 7-Zip or a similar Utility to extract it. Size = 7.6 MB Category = 12 URLSite = http://doublecmd.sourceforge.net/ -URLDownload = http://download.sourceforge.net/project/doublecmd/DC%20for%20Windows%2032%20bit/Double%20Commander%200.5.9%20beta/doublecmd-0.5.9.i386-win32.exe +URLDownload = http://download.sourceforge.net/project/doublecmd/DC%20for%20Windows%2032%20bit/Double%20Commander%200.5.10%20beta/doublecmd-0.5.10.i386-win32.exe CDPath = none [Section.0407] diff --git a/base/applications/rapps/rapps/dplus.txt b/base/applications/rapps/rapps/dplus.txt index a5c94d616a4..ce6f72e46fb 100644 --- a/base/applications/rapps/rapps/dplus.txt +++ b/base/applications/rapps/rapps/dplus.txt @@ -9,7 +9,7 @@ Description = DPlus is a graphical web browser with an emphasis on security, per Size = 1.36 MB Category = 5 URLSite = http://dplus-browser.sourceforge.net/ -URLDownload = http://heanet.dl.sourceforge.net/project/dplus-browser/Releases/dplus-0.5b/dplus-0.5b-setup.exe +URLDownload = http://download.sourceforge.net/project/dplus-browser/Releases/dplus-0.5b/dplus-0.5b-setup.exe CDPath = none [Section.0410] diff --git a/base/applications/rapps/rapps/dvdwritenow.txt b/base/applications/rapps/rapps/dvdwritenow.txt index 2795a805b1b..daf15f10e4a 100644 --- a/base/applications/rapps/rapps/dvdwritenow.txt +++ b/base/applications/rapps/rapps/dvdwritenow.txt @@ -33,5 +33,5 @@ URLSite = http://dwn.alter.org.ua/ru/ [Section.041f] Licence = Ücretsiz -Description = Ücretsiz bir doğrudan CD/DVD kaydedici yazılımı. Kurulduktan sonra CD/DVD RW'lerinizi USB Flash veyâ çıkarılabilir sâbit disk sürücüleri olarak kullanabilirsiniz. Bununla birlikte UDF kütük dizgesiyle kaydedilmiş CD/DVD RW'lere yazabilirsiniz. Ayrıca Microsoft DVD−ROM'ları, Ahead InCD ile kaydedilmiş RW diskleri gibi başka yazılımlarla oluşturulmuş UDF diskleri okuyabilirsiniz. Kurmak için bir ZIP çıkarma izlencesi gerekir. +Description = Ücretsiz bir doğrudan CD/DVD kaydedici yazılımı. Kurulduktan sonra CD/DVD RW'lerinizi, USB Flash veyâ çıkarılabilir sâbit disk sürücüleri olarak kullanabilirsiniz. Bununla birlikte UDF kütük dizgesiyle kaydedilmiş CD/DVD RW'lere yazabilirsiniz. Ayrıca Microsoft DVD−ROM'ları, Ahead InCD ile kaydedilmiş RW diskleri gibi başka yazılımlarla oluşturulmuş UDF diskleri okuyabilirsiniz. Kurmak için bir ZIP çıkarma izlencesi gerekir. Size = 1,2 MB diff --git a/base/applications/rapps/rapps/fap.txt b/base/applications/rapps/rapps/fap.txt index 730dcdd65f4..4307548e526 100644 --- a/base/applications/rapps/rapps/fap.txt +++ b/base/applications/rapps/rapps/fap.txt @@ -1,15 +1,15 @@ -; UTF-8 +; UTF-8 ; Turkish translation by Erdem Ersoy (eersoy93) (erdemersoy@live.com) [Section] Name = Fox Audio Player -Version = 0.10.0 +Version = 0.10.2 Licence = GPL Description = Simple and lightweight audio player. -Size = 1.89 MB +Size = 1.9 MB Category = 1 URLSite = http://foxaudioplayer.sourceforge.net/ -URLDownload = http://svn.reactos.org/packages/fap-0.10.0-win32-bin.exe +URLDownload = http://svn.reactos.org/packages/fap-0.10.2-win32.exe CDPath = none [Section.0407] @@ -20,7 +20,7 @@ Description = Reproductor de audio simple y ligero. [Section.040c] Description = Lecteur audio simple et léger. -Size = 1,89 Mo +Size = 1,9 Mo [Section.0410] Description = Un semplice e leggero lettore audio. @@ -33,12 +33,12 @@ Description = Prosty i lekki odtwarzacz audio. [Section.0418] Description = Un lector audio simplu și ușor. -Size = 1,89 Mo +Size = 1,9 Mo [Section.041f] Name = Fox Ses Oynatıcısı Description = Bayağı ve yeğni ses oynatıcısı. -Size = 1,89 MB +Size = 1,9 MB [Section.0422] Description = Простий та маленький програвач аудіо файлів. diff --git a/base/applications/rapps/rapps/fira.txt b/base/applications/rapps/rapps/fira.txt index beee410b87d..4dde9d6beb2 100644 --- a/base/applications/rapps/rapps/fira.txt +++ b/base/applications/rapps/rapps/fira.txt @@ -1,13 +1,13 @@ -; UTF-8 +; UTF-8 ; Polish translation by wojo664 ; Turkish translation by Erdem Ersoy (eersoy93) (erdemersoy@live.com) [Section] Name = Mozilla Fira Font -Version = 1.0 +Version = 3.1 Licence = Unknown Description = Mozilla Fira Font Pack, Includes Mono and Sans fonts. Unzip in the ReactOS's folder. -Size = 543 kB +Size = 1.1 MB Category = 14 URLSite = https://github.com/mozilla/Fira URLDownload = http://svn.reactos.org/packages/Fira.exe @@ -28,10 +28,10 @@ Description = Pakiet czcionek Mozilla Fira Font, zawiera czcionki Mono i Sans. W [Section.0418] Licence = Nespecificată Description = Pachetul Mozilla Fira Font, include fonturile Mono și Sans. Dezarhivați în dosarul „ReactOS”. (FIXME) -Size = 543 ko +Size = 1,1 Mo [Section.041f] Name = Mozilla Fira Yazı Tipi Licence = Bilinmiyor Description = Mozilla Fira Yazı Tipi Paketi, Mono ve Sans yazı tiplerini kapsar. ReactOS'un dizinine çıkartınız. -Size = 543 KB +Size = 1,1 MB diff --git a/base/applications/rapps/rapps/firefox.txt b/base/applications/rapps/rapps/firefox.txt index fee9955b3c5..425b7a5d192 100644 --- a/base/applications/rapps/rapps/firefox.txt +++ b/base/applications/rapps/rapps/firefox.txt @@ -1,84 +1,84 @@ -; UTF-8 +; UTF-8 ; Turkish translation by Erdem Ersoy (eersoy93) (erdemersoy@live.com) [Section] -Name = Mozilla Firefox 28 -Version = 28.0 +Name = Mozilla Firefox 29 +Version = 29.0.1 Licence = MPL/GPL/LGPL Description = The most popular and one of the best free Web Browsers out there. -Size = 22.9 MB +Size = 27.7 MB Category = 5 URLSite = http://www.mozilla.org/en-US/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/28.0/win32/en-US/Firefox%20Setup%2028.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/29.0.1/win32/en-US/Firefox%20Setup%2029.0.1.exe CDPath = none [Section.0407] Description = Der populärste und einer der besten freien Webbrowser. -Size = 22.8 MB +Size = 27.5 MB URLSite = http://www.mozilla.org/de/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/28.0/win32/de/Firefox%20Setup%2028.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/29.0.1/win32/de/Firefox%20Setup%2029.0.1.exe [Section.040a] Description = El más popular y uno de los mejores navegadores web gratuitos que hay. -Size = 22.7 MB +Size = 27.5 MB URLSite = http://www.mozilla.org/es-ES/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/28.0/win32/es-ES/Firefox%20Setup%2028.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/29.0.1/win32/es-ES/Firefox%20Setup%2029.0.1.exe [Section.040c] Description = Le navigateur web gratuit le plus populaire et l'un des meilleurs. -Size = 23,0 Mo +Size = 27,8 Mo URLSite = http://www.mozilla.org/fr/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/28.0/win32/fr/Firefox%20Setup%2028.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/29.0.1/win32/fr/Firefox%20Setup%2029.0.1.exe [Section.0410] Description = Il più popolare e uno dei migliori web browser gratuiti. -Size = 22.7 MB +Size = 27.5 MB URLSite = http://www.mozilla.org/it/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/28.0/win32/it/Firefox%20Setup%2028.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/29.0.1/win32/it/Firefox%20Setup%2029.0.1.exe [Section.0413] Description = De meest populaire en een van de beste gratis Web browsers. -Size = 23.4 MB +Size = 28.2 MB URLSite = http://www.mozilla.org/nl/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/28.0/win32/nl/Firefox%20Setup%2028.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/29.0.1/win32/nl/Firefox%20Setup%2029.0.1.exe [Section.0414] Description = Mest populære og best også gratis nettleserene der ute. -Size = 22.8 MB -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/28.0/win32/nb-NO/Firefox%20Setup%2028.0.exe +Size = 27.5 MB +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/29.0.1/win32/nb-NO/Firefox%20Setup%2029.0.1.exe [Section.0415] Description = Najpopularniejsza i jedna z najlepszych darmowych przeglądarek internetowych. -Size = 23.7 MB +Size = 28.4 MB URLSite = http://www.mozilla.org/pl/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/28.0/win32/pl/Firefox%20Setup%2028.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/29.0.1/win32/pl/Firefox%20Setup%2029.0.1.exe [Section.0418] Description = Cel mai popular și unul dintre cele mai bune navigatoare web gratuite existente. -Size = 23,3 Mo +Size = 28,0 Mo URLSite = http://www.mozilla.org/ro/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/28.0/win32/ro/Firefox%20Setup%2028.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/29.0.1/win32/ro/Firefox%20Setup%2029.0.1.exe [Section.0419] Description = Один из самых популярных и лучших бесплатных браузеров. -Size = 23,2 MB +Size = 27.9 MB URLSite = http://www.mozilla.org/ru/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/28.0/win32/ru/Firefox%20Setup%2028.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/29.0.1/win32/ru/Firefox%20Setup%2029.0.1.exe [Section.041b] Description = Najpopulárnejší a jeden z najlepších slobodný webových prehliadačov. -Size = 23,4 MB +Size = 28.2 MB URLSite = http://www.mozilla.org/sk/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/28.0/win32/sk/Firefox%20Setup%2028.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/29.0.1/win32/sk/Firefox%20Setup%2029.0.1.exe [Section.041f] Description = Özgür Umûmî Ağ tarayıcıları arasında en tutulanı ve en iyilerinden biri. -Size = 22,8 MB +Size = 27,5 MB URLSite = http://www.mozilla.org/tr/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/28.0/win32/tr/Firefox%20Setup%2028.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/29.0.1/win32/tr/Firefox%20Setup%2029.0.1.exe [Section.0422] Description = Найпопулярніший та один з кращих безплатних веб-браузерів. -Size = 23,2 MB +Size = 27.9 MB URLSite = http://www.mozilla.org/uk/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/28.0/win32/uk/Firefox%20Setup%2028.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/29.0.1/win32/uk/Firefox%20Setup%2029.0.1.exe diff --git a/base/applications/rapps/rapps/lazaruside.txt b/base/applications/rapps/rapps/lazaruside.txt index a0ef0845afe..53381f3cc44 100644 --- a/base/applications/rapps/rapps/lazaruside.txt +++ b/base/applications/rapps/rapps/lazaruside.txt @@ -1,16 +1,16 @@ -; UTF-8 +; UTF-8 ; Polish translation by wojo664 ; Turkish translation by Erdem Ersoy (eersoy93) (erdemersoy@live.com) [Section] Name = Lazarus -Version = 1.2 +Version = 1.2.2 Licence = modified LGPL, GPL Description = A cross-platform integrated development environment (IDE) that lets you create visual (GUI) and non-visual Object Pascal programs, and uses the Free Pascal compiler to generate your executable. -Size = 112 MB +Size = 114 MB Category = 7 URLSite = http://www.lazarus.freepascal.org/ -URLDownload = http://download.sourceforge.net/project/lazarus/Lazarus%20Windows%2032%20bits/Lazarus%201.2/lazarus-1.2.0-fpc-2.6.2-win32.exe +URLDownload = http://download.sourceforge.net/project/lazarus/Lazarus%20Windows%2032%20bits/Lazarus%201.2.2/lazarus-1.2.2-fpc-2.6.4-win32.exe CDPath = none [Section.0407] @@ -25,7 +25,7 @@ Description = Un ambiente di sviluppo integrato (IDE) cross-platform che consent [Section.0418] Licence = GPL, LGPL modificată Description = Un mediu integrat de dezvoltare (IDE) multi-platformă care vă permite crearea de programe Object Pascal, atât vizuale (GUI) cât și ne-vizuale, și utilizează compilatorul Free Pascal pentru a genera executabile. -Size = 112 Mo +Size = 114 Mo [Section.041f] Licence = Değiştirilmiş LGPL, GPL diff --git a/base/applications/rapps/rapps/libreoffice.txt b/base/applications/rapps/rapps/libreoffice.txt index 31ff17d102b..4ca07becdda 100644 --- a/base/applications/rapps/rapps/libreoffice.txt +++ b/base/applications/rapps/rapps/libreoffice.txt @@ -1,15 +1,15 @@ -; UTF-8 +; UTF-8 ; Turkish translation by Erdem Ersoy (eersoy93) (erdemersoy@live.com) [Section] Name = LibreOffice -Version = 4.2.3 +Version = 4.2.4 Licence = LGPL Description = A powerful and open source office suite. It has been forked from OpenOffice. -Size = 211.0 MB +Size = 209.3 MB Category = 6 URLSite = http://www.documentfoundation.org/ -URLDownload = http://download.documentfoundation.org/libreoffice/stable/4.2.3/win/x86/LibreOffice_4.2.3_Win_x86.msi +URLDownload = http://download.documentfoundation.org/libreoffice/stable/4.2.4/win/x86/LibreOffice_4.2.4_Win_x86.msi CDPath = none [Section.0407] @@ -20,7 +20,7 @@ Description = La suite de ofimática de código abierto. (FIXME) [Section.040c] Description = Précédemment appelé OpenOffice. Suite bureautique open source. (FIXME) -Size = 211,0 Mo +Size = 209,3 Mo [Section.0410] Description = Precedentemente chiamato OpenOffice. Open Source Office Suite. (FIXME) @@ -33,11 +33,11 @@ Description = Otwarty pakiet biurowy. (FIXME) [Section.0418] Description = Fostul OpenOffice. Suita de aplicații de birotică open-source. (FIXME) -Size = 211,0 Mo +Size = 209,3 Mo [Section.041f] Description = Güçlü ve açık kaynak bir büro takımı. OpenOffice'ten çatallanılmıştır. -Size = 211,0 MB +Size = 209,3 MB [Section.0422] Description = Відкритий офісний пакет. (FIXME) diff --git a/base/applications/rapps/rapps/mcwin32.txt b/base/applications/rapps/rapps/mcwin32.txt index 086cc7618b1..da08dec77c6 100644 --- a/base/applications/rapps/rapps/mcwin32.txt +++ b/base/applications/rapps/rapps/mcwin32.txt @@ -9,7 +9,7 @@ Description = 32-bit Windows port of GNU Midnight Commander. Size = 2.35 MB Category = 12 URLSite = http://sourceforge.net/projects/mcwin32/ -URLDownload = http://optimate.dl.sourceforge.net/project/mcwin32/mcwin32-build183-setup.exe +URLDownload = http://download.sourceforge.net/project/mcwin32/mcwin32-build183-setup.exe CDPath = none [Section.0410] diff --git a/base/applications/rapps/rapps/mirandaim.txt b/base/applications/rapps/rapps/mirandaim.txt index 145d7d66582..afe7ebbcb97 100644 --- a/base/applications/rapps/rapps/mirandaim.txt +++ b/base/applications/rapps/rapps/mirandaim.txt @@ -1,15 +1,15 @@ -; UTF-8 +; UTF-8 ; Turkish translation by Erdem Ersoy (eersoy93) (erdemersoy@live.com) [Section] Name = Miranda IM -Version = 0.10.22 +Version = 0.10.23 Licence = GPL Description = Open source multiprotocol instant messaging application - May not work completely. -Size = 2.8 MB +Size = 3.8 MB Category = 5 URLSite = http://www.miranda-im.org/ -URLDownload = http://files.miranda-im.org/stable/0.10.22.0/miranda-im-v0.10.22-unicode.exe +URLDownload = http://files.miranda-im.org/stable/0.10.23.0/miranda-im-v0.10.23-unicode.exe CDPath = none [Section.0407] @@ -20,7 +20,7 @@ Description = Aplicación de mensajería instantánea multiprotocolo de código [Section.040c] Description = Application de messagerie instantannée multi-protocoles open source - pourrait ne pas fonctionner complètement. -Size = 2,8 Mo +Size = 3,8 Mo [Section.0410] Description = Multi-protocollo open source per applicazioni di messaggistica istantanea - potrebbe non funzionare del tutto. @@ -33,11 +33,11 @@ Description = Otwarty komunikator internetowy, obsługujący wiele różnych pro [Section.0418] Description = Aplicație de mesagerie instant multiprotocol (open-source) - posibil cu limitări în funcționalitate. -Size = 2,8 Mo +Size = 3,8 Mo [Section.041f] Description = Açık kaynak, çoklu iletişim kâideli, evgin iletileşme uygulaması. Eksiksiz olarak çalışmayabilir. -Size = 2,8 MB +Size = 3,8 MB [Section.0422] Description = Відкрита мультипротокольна програма миттєвих повідомлень - може не працювати повністю. diff --git a/base/applications/rapps/rapps/mpc.txt b/base/applications/rapps/rapps/mpc.txt index 1f1f1d6f519..d02be1dc9e4 100644 --- a/base/applications/rapps/rapps/mpc.txt +++ b/base/applications/rapps/rapps/mpc.txt @@ -1,15 +1,15 @@ -; UTF-8 +; UTF-8 ; Turkish translation by Erdem Ersoy (eersoy93) (erdemersoy@live.com) [Section] Name = Media Player Classic Home Cinema -Version = 1.7.4 +Version = 1.7.5 Licence = GPL Description = A media player. Size = 10.1 MB Category = 2 URLSite = http://mpc-hc.org/ -URLDownload = http://download.sourceforge.net/project/mpc-hc/MPC%20HomeCinema%20-%20Win32/MPC-HC_v1.7.4_x86/MPC-HC.1.7.4.x86.exe +URLDownload = http://download.sourceforge.net/project/mpc-hc/MPC%20HomeCinema%20-%20Win32/MPC-HC_v1.7.5_x86/MPC-HC.1.7.5.x86.exe CDPath = none [Section.0407] diff --git a/base/applications/rapps/rapps/npp.txt b/base/applications/rapps/rapps/npp.txt index eb9e917d3e8..1789aee6f58 100644 --- a/base/applications/rapps/rapps/npp.txt +++ b/base/applications/rapps/rapps/npp.txt @@ -1,15 +1,15 @@ -; UTF-8 +; UTF-8 ; Turkish translation by Erdem Ersoy (eersoy93) (erdemersoy@live.com) [Section] Name = Notepad++ -Version = 6.5.5 +Version = 6.6.3 Licence = GPL Description = A text editor. Size = 7.3 MB Category = 6 URLSite = http://notepad-plus-plus.org/ -URLDownload = http://download.tuxfamily.org/notepadplus/6.5.5/npp.6.5.5.Installer.exe +URLDownload = http://download.tuxfamily.org/notepadplus/6.6.3/npp.6.6.3.Installer.exe CDPath = none [Section.0407] diff --git a/base/applications/rapps/rapps/openoffice.txt b/base/applications/rapps/rapps/openoffice.txt index 3e18dc4de54..b7f0daef081 100644 --- a/base/applications/rapps/rapps/openoffice.txt +++ b/base/applications/rapps/rapps/openoffice.txt @@ -1,52 +1,52 @@ -; UTF-8 +; UTF-8 ; Turkish translation by Erdem Ersoy (eersoy93) (erdemersoy@live.com) [Section] -Name = OpenOffice 4.0 -Version = 4.0.1 +Name = OpenOffice 4.1 +Version = 4.1.0 Licence = LGPL Description = The open source office suite. Size = 136.79 MB Category = 6 URLSite = http://www.openoffice.org/ -URLDownload = http://download.sourceforge.net/project/openofficeorg.mirror/4.0.1/binaries/en-US/Apache_OpenOffice_4.0.1_Win_x86_install_en-US.exe +URLDownload = http://download.sourceforge.net/project/openofficeorg.mirror/4.1.0/binaries/en-US/Apache_OpenOffice_4.1.0_Win_x86_install_en-US.exe CDPath = none [Section.0407] Description = DIE Open Source Office Suite. (FIXME) Size = 154.88 MB URLSite = http://www.openoffice.org/de/ -URLDownload = http://download.sourceforge.net/project/openofficeorg.mirror/4.0.1/binaries/de/Apache_OpenOffice_4.0.1_Win_x86_install_de.exe +URLDownload = http://download.sourceforge.net/project/openofficeorg.mirror/4.1.0/binaries/de/Apache_OpenOffice_4.1.0_Win_x86_install_de.exe [Section.040a] Description = La suite de ofimática de código abierto. Size = 126.29 MB URLSite = http://www.openoffice.org/es/ -URLDownload = http://download.sourceforge.net/project/openofficeorg.mirror/4.0.1/binaries/es/Apache_OpenOffice_4.0.1_Win_x86_install_es.exe +URLDownload = http://download.sourceforge.net/project/openofficeorg.mirror/4.1.0/binaries/es/Apache_OpenOffice_4.1.0_Win_x86_install_es.exe [Section.040c] Description = LA suite bureautique open source. Size = 127,22 Mo URLSite = http://www.openoffice.org/fr/ -URLDownload = http://download.sourceforge.net/project/openofficeorg.mirror/4.0.1/binaries/fr/Apache_OpenOffice_4.0.1_Win_x86_install_fr.exe +URLDownload = http://download.sourceforge.net/project/openofficeorg.mirror/4.1.0/binaries/fr/Apache_OpenOffice_4.1.0_Win_x86_install_fr.exe [Section.0410] Description = La suite di office Open Source. Size = 132.39 MB URLSite = http://www.openoffice.org/it/ -URLDownload = http://download.sourceforge.net/project/openofficeorg.mirror/4.0.1/binaries/it/Apache_OpenOffice_4.0.1_Win_x86_install_it.exe +URLDownload = http://download.sourceforge.net/project/openofficeorg.mirror/4.1.0/binaries/it/Apache_OpenOffice_4.1.0_Win_x86_install_it.exe [Section.0413] Description = Open-bron Office Pakket. (FIXME) Size = 132.11 MB URLSite = http://www.openoffice.org/nl/ -URLDownload = http://download.sourceforge.net/project/openofficeorg.mirror/4.0.1/binaries/nl/Apache_OpenOffice_4.0.1_Win_x86_install_nl.exe +URLDownload = http://download.sourceforge.net/project/openofficeorg.mirror/4.1.0/binaries/nl/Apache_OpenOffice_4.1.0_Win_x86_install_nl.exe [Section.0415] Description = Otwarty pakiet biurowy. Size = 127.47 MB URLSite = http://www.openoffice.org/pl/ -URLDownload = http://download.sourceforge.net/project/openofficeorg.mirror/4.0.1/binaries/pl/Apache_OpenOffice_4.0.1_Win_x86_install_pl.exe +URLDownload = http://download.sourceforge.net/project/openofficeorg.mirror/4.1.0/binaries/pl/Apache_OpenOffice_4.1.0_Win_x86_install_pl.exe [Section.0418] Description = Suita de aplicații de birotică open-source. @@ -57,7 +57,7 @@ URLSite = http://www.openoffice.org/ro/ Description = Bir açık kaynak büro takımı. Size = 124,36 MB URLSite = http://www.openoffice.org/tr/ -URLDownload = http://download.sourceforge.net/project/openofficeorg.mirror/4.0.1/binaries/tr/Apache_OpenOffice_4.0.1_Win_x86_install_tr.exe +URLDownload = http://download.sourceforge.net/project/openofficeorg.mirror/4.1.0/binaries/tr/Apache_OpenOffice_4.1.0_Win_x86_install_tr.exe [Section.0422] Description = Відкритий офісний пакет. @@ -68,4 +68,4 @@ URLSite = http://www.openoffice.org/ua/ Description = Open-bron Office Pakket. (FIXME) Size = 132.11 MB URLSite = http://www.openoffice.org/nl/ -URLDownload = http://download.sourceforge.net/project/openofficeorg.mirror/4.0.1/binaries/nl/Apache_OpenOffice_4.0.1_Win_x86_install_nl.exe +URLDownload = http://download.sourceforge.net/project/openofficeorg.mirror/4.1.0/binaries/nl/Apache_OpenOffice_4.1.0_Win_x86_install_nl.exe diff --git a/base/applications/rapps/rapps/opera.txt b/base/applications/rapps/rapps/opera.txt index 4e86e6748e3..38fcabbd6ab 100644 --- a/base/applications/rapps/rapps/opera.txt +++ b/base/applications/rapps/rapps/opera.txt @@ -1,15 +1,15 @@ -; UTF-8 +; UTF-8 ; Turkish translation by Erdem Ersoy (eersoy93) (erdemersoy@live.com) [Section] Name = Opera -Version = 12.16 +Version = 12.17 Licence = Freeware Description = The popular Opera Browser with many advanced features and including a Mail and BitTorrent client. -Size = 12.56 MB +Size = 12.57 MB Category = 5 URLSite = http://www.opera.com/ -URLDownload = http://ftp.opera.com/pub/opera/win/1216/int/Opera_1216_int_Setup.exe +URLDownload = http://ftp.opera.com/pub/opera/win/1217/int/Opera_1217_int_Setup.exe CDPath = none [Section.0405] @@ -23,7 +23,7 @@ Description = Popular navegador web con muchas características avanzadas e incl [Section.040c] Description = Le populaire navigateur Opera avec beaucoup de fonctionnalités avancées, incluant un client mail et BitTorrent. -Size = 12,56 Mo +Size = 12,57 Mo [Section.0410] Description = Il famoso browser Opera con funzionalità avanzate come un client BitTorrent integrato e la gestione delle Mail. @@ -37,7 +37,7 @@ Description = Popularna przeglądarka internetowa z wieloma zaawansowanymi funkc [Section.0418] Licence = Gratuită Description = Navigatorul popular Opera cu multe funcționalități avansate incluzând poștă electronică și un client de BitTorrent. -Size = 12,56 Mo +Size = 12,57 Mo [Section.0419] Description = Популярный браузер со многими дополнительными возможностями, включающий клиентов почты и BitTorrent. @@ -45,7 +45,7 @@ Description = Популярный браузер со многими допол [Section.041f] Licence = Ücretsiz Description = Bir posta ve BitTorrent istemcisini kapsayan birçok gelişmiş husûsiyetle, tutulan Opera Tarayıcı. -Size = 12,56 MB +Size = 12,57 MB [Section.0422] Description = Популярний браузер з багатьма додатковими можливостями, який включає в себе поштовий та BitTorrent клієнти. diff --git a/base/applications/rapps/rapps/peazip.txt b/base/applications/rapps/rapps/peazip.txt index 73b6dbb03db..5ab4aa06a87 100644 --- a/base/applications/rapps/rapps/peazip.txt +++ b/base/applications/rapps/rapps/peazip.txt @@ -1,15 +1,15 @@ -; UTF-8 +; UTF-8 ; Turkish translation by Erdem Ersoy (eersoy93) (erdemersoy@live.com) [Section] Name = PeaZip -Version = 5.3.0 +Version = 5.3.1 Licence = LGPL v3, OpenCandy EULA Description = PeaZip is a free, cross-platform, open source file and archive manager. It supports over 150 archive formats. Size = 5.8 MB Category = 12 URLSite = http://peazip.sourceforge.net/ -URLDownload = http://sourceforge.net/projects/peazip/files/5.3.0/peazip-5.3.0.WINDOWS.exe +URLDownload = http://download.sourceforge.net/project/peazip/5.3.1/peazip-5.3.1.WINDOWS.exe CDPath = none [Section.0407] diff --git a/base/applications/rapps/rapps/putty.txt b/base/applications/rapps/rapps/putty.txt index fe722146a1a..84c56761457 100644 --- a/base/applications/rapps/rapps/putty.txt +++ b/base/applications/rapps/rapps/putty.txt @@ -36,7 +36,7 @@ Description = Un client gratuit de SSH, Telnet, rlogin, and TCP brut. Size = 1,78 Mo [Section.041f] -Description = Özgür bir SSH, Telnet, rlogin ve işlenmemiş TCP istemcisi. +Description = Ücretsiz bir SSH, Telnet, rlogin ve işlenmemiş TCP istemcisi. Size = 1,78 MB [Section.0422] diff --git a/base/applications/rapps/rapps/python.txt b/base/applications/rapps/rapps/python.txt index b89b1f3dffb..c05adef8109 100644 --- a/base/applications/rapps/rapps/python.txt +++ b/base/applications/rapps/rapps/python.txt @@ -1,15 +1,15 @@ -; UTF-8 +; UTF-8 ; Turkish translation by Erdem Ersoy (eersoy93) (erdemersoy@live.com) [Section] Name = Python 3 -Version = 3.4.0 +Version = 3.4.1 Licence = GPL/LGPL Description = A remarkably powerful dynamic programming language. -Size = 23.4 MB +Size = 23.3 MB Category = 7 URLSite = http://www.python.org/ -URLDownload = http://www.python.org/ftp/python/3.4.0/python-3.4.0.msi +URLDownload = http://www.python.org/ftp/python/3.4.1/python-3.4.1.msi CDPath = none [Section.0407] @@ -20,7 +20,7 @@ Description = Un lenguaje de programación dinámico sumamente potente. [Section.040c] Description = Un langage de programmation dynamique remarquablement puissant. -Size = 23,4 Mo +Size = 23,3 Mo [Section.0410] Description = Un Linguaggio di programmazione dinamico e potente. @@ -33,11 +33,11 @@ Description = Potęży i dynamiczny język programowania. [Section.0418] Description = Un limbaj de programare dinamic și puternic. -Size = 23,4 Mo +Size = 23,3 Mo [Section.041f] Description = Dikkat çekici, güçlü ve devingen bir izlenceleme dili. -Size = 23,4 MB +Size = 23,3 MB [Section.0422] Description = Дуже потужна динамічна мова програмування. diff --git a/base/applications/rapps/rapps/qmmp.txt b/base/applications/rapps/rapps/qmmp.txt index 574e6fc1f95..ef7cb476bee 100644 --- a/base/applications/rapps/rapps/qmmp.txt +++ b/base/applications/rapps/rapps/qmmp.txt @@ -1,16 +1,16 @@ -; UTF-8 +; UTF-8 ; Polish translation by wojo664 ; Turkish translation by Erdem Ersoy (eersoy93) (erdemersoy@live.com) [Section] Name = Qmmp (Qt-based Multimedia Player) -Version = 0.7.3 +Version = 0.7.7 Licence = GPL Description = Qmmp is an audio-player, written with the help of the Qt library. The user interface is similar to WinAMP or XMMS. Alternative user interfaces also are available. -Size = 16.0 MB +Size = 10.5 MB Category = 1 URLSite = http://qmmp.ylsoftware.com/index.php -URLDownload = http://qmmp.ylsoftware.com/files/windows/qmmp-0.7.3-win32.exe +URLDownload = http://qmmp.ylsoftware.com/files/windows/qmmp-0.7.7-win32.exe CDPath = none [Section.0407] @@ -24,7 +24,7 @@ Description = Gmmp to odtwarzacz audio, napisany z pomocą biblioteki Qt. Interf [Section.0418] Description = Qmmp este un lector audio, ce utilizează biblioteca QT. Interfața de utilizare e asemănătoare cu cea din WinAMP sau XMMS. De asemenea sunt disponibile interfețe de utilizare alternative. -Size = 16,0 Mo +Size = 10,5 Mo [Section.0419] Description = Аудиоплеер Qmmp (Qt-based Multimedia Player). @@ -32,4 +32,4 @@ Description = Аудиоплеер Qmmp (Qt-based Multimedia Player). [Section.041f] Name = Qmmp (Qt Tabanlı Çoklu Ortam Oynatıcısı) Description = Qmmp, Qt kitaplığının yardımıyla yazılmış bir ses oynatıcısıdır. Kullanıcı arayüzü WinAMP'a ve XMMS'ye benzer. Başka kullanıcı arayüzleri de vardır. -Size = 16,0 MB +Size = 10,5 MB diff --git a/base/applications/rapps/rapps/rosbe.txt b/base/applications/rapps/rapps/rosbe.txt index 962526d96b5..acb5093f961 100644 --- a/base/applications/rapps/rapps/rosbe.txt +++ b/base/applications/rapps/rapps/rosbe.txt @@ -9,7 +9,7 @@ Description = Allows you to build the ReactOS Source. For more instructions see Size = 28.3 MB Category = 7 URLSite = http://reactos.org/wiki/Build_Environment -URLDownload = http://downloads.sourceforge.net/reactos/RosBE-2.1.1.exe +URLDownload = http://download.sourceforge.net/reactos/RosBE-2.1.1.exe CDPath = none [Section.0405] diff --git a/base/applications/rapps/rapps/scite.txt b/base/applications/rapps/rapps/scite.txt index e51ffc902c9..09b89c5c45a 100644 --- a/base/applications/rapps/rapps/scite.txt +++ b/base/applications/rapps/rapps/scite.txt @@ -1,15 +1,15 @@ -; UTF-8 +; UTF-8 ; Turkish translation by Erdem Ersoy (eersoy93) (erdemersoy@live.com) [Section] Name = SciTE -Version = 3.4.1 +Version = 3.4.3 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 = 730 kB +Size = 737 kB Category = 7 URLSite = http://www.scintilla.org/ -URLDownload = http://download.sourceforge.net/project/scintilla/SciTE/3.4.1/Sc341.exe +URLDownload = http://download.sourceforge.net/project/scintilla/SciTE/3.4.3/Sc343.exe CDPath = none [Section.0407] @@ -20,7 +20,7 @@ Description = Editor de texto basado en SCIntilla. Originalmente creado para dem [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. -Size = 730 ko +Size = 737 ko [Section.0410] Description = SciTE è un editor di testo basato su scintilla. Originariamente costruito per dimostrare Scintilla, è cresciuto fino a essere un editor generalmente utile con strutture per la creazione e l'esecuzione di programmi. @@ -34,12 +34,12 @@ Description = SciTE to edytor tekstu bazowany na SCIntilla. Oryginalnie stworzon [Section.0418] Licence = Gratuită Description = SciTE este un editor de text bazat pe SCIntilla. Construit inițial pentru a demonstra Scintilla, a crescut ulterior într-un editor de uz general cu funcționalități de compilare și execuție a programelor. -Size = 730 ko +Size = 737 ko [Section.041f] Licence = Ücretsiz Description = SciTE, bir Scintilla tabanlı metin düzenleyicisidir. İlk başta Scintilla'yı göstermek için yapıldı, izlenceleri yapmak ve çalıştırmak yetenekleriyle bir umûmiyetle kullanışlı düzenleyici olmak için gelişti. -Size = 730 KB +Size = 737 KB [Section.0422] Description = Текстовий редактор на основі SCIntilla. Був зібраний як презентація Scintilla, але виріс до редактора загального користування з засобами збирання та запуску програм. diff --git a/base/applications/rapps/rapps/sdl_runtime.txt b/base/applications/rapps/rapps/sdl_runtime.txt index 3e16033d841..89849bec9d7 100644 --- a/base/applications/rapps/rapps/sdl_runtime.txt +++ b/base/applications/rapps/rapps/sdl_runtime.txt @@ -40,7 +40,7 @@ Description = Necesar pentru execuția multor jocuri (open-source). Dezarhivați Size = 136,67 ko [Section.041f] -Name = SDL (Bayağı Doğrudan Ortam Katmanı) Yürütücüsü +Name = SDL (Bayağı Doğrudan Ortam Katmanı) Yürütücü Description = Birçok açık kaynak oyunu çalıştırmak için gereklidir. Çıkartmak için 7-Zip ya da benzeri bir yazılım kullanmanız gerekir. Size = 136,67 KB diff --git a/base/applications/rapps/rapps/seamonkey.txt b/base/applications/rapps/rapps/seamonkey.txt index 706345b6968..16621853755 100644 --- a/base/applications/rapps/rapps/seamonkey.txt +++ b/base/applications/rapps/rapps/seamonkey.txt @@ -1,46 +1,46 @@ -; UTF-8 +; UTF-8 ; Turkish translation by Erdem Ersoy (eersoy93) (erdemersoy@live.com) [Section] Name = Mozilla SeaMonkey -Version = 2.25 +Version = 2.26 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 = 23.90 MB Category = 5 URLSite = http://www.seamonkey-project.org/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.25/win32/en-US/SeaMonkey%20Setup%202.25.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.26/win32/en-US/SeaMonkey%20Setup%202.26.exe CDPath = none [Section.0407] Description = Mozilla Suite lebt. Dies ist das einzige Browser-, Mail-, Chat- and Composerwerkzeug-Bundle welches Sie benötigen. Size = 23.80 MB -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.25/win32/de/SeaMonkey%20Setup%202.25.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.26/win32/de/SeaMonkey%20Setup%202.26.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 = 23.79 MB -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.25/win32/es-ES/SeaMonkey%20Setup%202.25.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.26/win32/es-ES/SeaMonkey%20Setup%202.26.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 = 24,06 Mo -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.25/win32/fr/SeaMonkey%20Setup%202.25.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.26/win32/fr/SeaMonkey%20Setup%202.26.exe [Section.0410] Description = Mozilla Suite è vivo. Questo è l'unico pachetto che include Browser, Mail, Chat, e Composer di cui avrete mai bisogno... Size = 23.71 MB -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.25/win32/it/SeaMonkey%20Setup%202.25.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.26/win32/it/SeaMonkey%20Setup%202.26.exe [Section.0413] Description = Mozilla Suite bundelt alle applicaties voor het Web: Browser, Mail, Chat, Composer. Size = 24.40 MB -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.25/win32/nl/SeaMonkey%20Setup%202.25.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.26/win32/nl/SeaMonkey%20Setup%202.26.exe [Section.0415] Description = Pakiet Mozilla żyje. W zestawie: przeglądarka, klient poczty, IRC oraz Edytor HTML - wszystko, czego potrzebujesz. Size = 24.72 MB -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.25/win32/pl/SeaMonkey%20Setup%202.25.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.26/win32/pl/SeaMonkey%20Setup%202.26.exe [Section.0418] Description = Suita Mozilla. Acest pachet ce încorporează navigator, poștă electronică, client IRC și editor HTML, acoperind astfel o arie largă de necesități. @@ -49,14 +49,14 @@ Size = 23,90 Mo [Section.0419] Description = Продолжение Mozilla Suite. Включает браузер, почтовый клиент, IRC-клиент и HTML-редактор. Size = 24.27 MB -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.25/win32/ru/SeaMonkey%20Setup%202.25.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.26/win32/ru/SeaMonkey%20Setup%202.26.exe [Section.041f] Description = Mozilla Bohçası sağ. Bu, hiç gereksinim duymayacağınız, yalnızca Tarayıcı, Posta, Söyleşi ve Yazar bohçasıdır. Size = 23,83 MB -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.25/win32/tr/SeaMonkey%20Setup%202.25.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.26/win32/tr/SeaMonkey%20Setup%202.26.exe [Section.0422] Description = Продовження Mozilla Suite. Включає в себе браузер, поштовий клієнт, IRC-клієнт та HTML-редактор. Size = 24.27 MB -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.25/win32/ru/SeaMonkey%20Setup%202.25.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.26/win32/ru/SeaMonkey%20Setup%202.26.exe diff --git a/base/applications/rapps/rapps/sumatrapdf.txt b/base/applications/rapps/rapps/sumatrapdf.txt index d48bad627fd..9c508a32000 100644 --- a/base/applications/rapps/rapps/sumatrapdf.txt +++ b/base/applications/rapps/rapps/sumatrapdf.txt @@ -1,15 +1,15 @@ -; UTF-8 +; UTF-8 ; Turkish translation by Erdem Ersoy (eersoy93) (erdemersoy@live.com) [Section] Name = SumatraPDF -Version = 2.4 +Version = 2.5.2 Licence = GPLv3 Description = Sumatra PDF is a slim, free, open-source PDF reader. Portable out of the box. Size = 4.0 MB Category = 6 URLSite = http://blog.kowalczyk.info/software/sumatrapdf/free-pdf-reader.html -URLDownload = https://kjkpub.s3.amazonaws.com/sumatrapdf/rel/SumatraPDF-2.4-install.exe +URLDownload = https://kjkpub.s3.amazonaws.com/sumatrapdf/rel/SumatraPDF-2.5.2-install.exe CDPath = none [Section.0407] diff --git a/base/applications/rapps/rapps/thunderbird.txt b/base/applications/rapps/rapps/thunderbird.txt index bb86e892602..61cadb98e24 100644 --- a/base/applications/rapps/rapps/thunderbird.txt +++ b/base/applications/rapps/rapps/thunderbird.txt @@ -1,79 +1,79 @@ -; UTF-8 +; UTF-8 ; Turkish translation by Erdem Ersoy (eersoy93) (erdemersoy@live.com) [Section] Name = Mozilla Thunderbird 24 -Version = 24.4.0 +Version = 24.5.0 Licence = MPL/GPL/LGPL Description = The most popular and one of the best free Mail Clients out there. Size = 21.12 MB Category = 5 URLSite = https://www.mozilla.org/en-US/thunderbird/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.4.0/win32/en-US/Thunderbird%20Setup%2024.4.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.5.0/win32/en-US/Thunderbird%20Setup%2024.5.0.exe CDPath = none [Section.0407] Description = Der populärste und einer der besten freien Mail-Clients. Size = 20.96 MB URLSite = https://www.mozilla.org/de/thunderbird/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.4.0/win32/de/Thunderbird%20Setup%2024.4.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.5.0/win32/de/Thunderbird%20Setup%2024.5.0.exe [Section.040a] Description = El más popular y uno de los mejores clientes mail que hay. Size = 20.92 MB URLSite = https://www.mozilla.org/es-ES/thunderbird/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.4.0/win32/es-ES/Thunderbird%20Setup%2024.4.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.5.0/win32/es-ES/Thunderbird%20Setup%2024.5.0.exe [Section.040c] Description = Le plus populaire et l'un des meilleurs clients mail gratuits disponible. Size = 21,27 Mo URLSite = https://www.mozilla.org/fr/thunderbird/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.4.0/win32/fr/Thunderbird%20Setup%2024.4.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.5.0/win32/fr/Thunderbird%20Setup%2024.5.0.exe [Section.0410] Description = Il più popolare e il migliore Client mail gratuito. Size = 20.91 MB URLSite = https://www.mozilla.org/it/thunderbird/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.4.0/win32/it/Thunderbird%20Setup%2024.4.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.5.0/win32/it/Thunderbird%20Setup%2024.5.0.exe [Section.0413] Description = De meest populaire en een van de beste gratis e-mail-programma's. Size = 21.61 MB URLSite = https://www.mozilla.org/nl/thunderbird/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.4.0/win32/nl/Thunderbird%20Setup%2024.4.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.5.0/win32/nl/Thunderbird%20Setup%2024.5.0.exe [Section.0415] Description = Najpopularniejszy i jeden z najlepszych darmowych klientów poczty. Size = 21.80 MB URLSite = https://www.mozilla.org/pl/thunderbird/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.4.0/win32/pl/Thunderbird%20Setup%2024.4.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.5.0/win32/pl/Thunderbird%20Setup%2024.5.0.exe [Section.0418] Description = Cel mai popular și unul dintre cele mai bune clientele gratuite de poștă electronică. Size = 21,48 Mo URLSite = https://www.mozilla.org/ro/thunderbird/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.4.0/win32/ro/Thunderbird%20Setup%2024.4.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.5.0/win32/ro/Thunderbird%20Setup%2024.5.0.exe [Section.0419] Description = Один из самых популярных и лучших бесплатных почтовых клиентов. Size = 21.38 MB URLSite = https://www.mozilla.org/ru/thunderbird/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.4.0/win32/ru/Thunderbird%20Setup%2024.4.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.5.0/win32/ru/Thunderbird%20Setup%2024.5.0.exe [Section.041f] Description = Özgür posta istemcileri arasında en tutulanı ve en iyilerinden biri. Size = 20,99 MB URLSite = https://www.mozilla.org/tr/thunderbird/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.4.0/win32/tr/Thunderbird%20Setup%2024.4.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.5.0/win32/tr/Thunderbird%20Setup%2024.5.0.exe [Section.0422] Description = Найпопулярніший та один з кращих поштових клієнтів. Size = 21.41 MB URLSite = https://www.mozilla.org/uk/thunderbird/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.4.0/win32/uk/Thunderbird%20Setup%2024.4.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.5.0/win32/uk/Thunderbird%20Setup%2024.5.0.exe [Section.0813] Description = De meest populaire en een van de beste gratis e-mail-programma's. Size = 9.71 MB URLSite = https://www.mozilla.org/nl/thunderbird/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.4.0/win32/nl/Thunderbird%20Setup%2024.4.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.5.0/win32/nl/Thunderbird%20Setup%2024.5.0.exe diff --git a/base/applications/rapps/rapps/totalcommander.txt b/base/applications/rapps/rapps/totalcommander.txt index 07446c9e1ad..e7980801ee6 100644 --- a/base/applications/rapps/rapps/totalcommander.txt +++ b/base/applications/rapps/rapps/totalcommander.txt @@ -1,15 +1,15 @@ -; UTF-8 +; UTF-8 ; Turkish translation by Erdem Ersoy (eersoy93) (erdemersoy@live.com) [Section] Name = Total Commander -Version = 8.50 +Version = 8.51a Licence = Shareware Description = Total Commander is a file manager with two panels side by side. -Size = 3.5 MB +Size = 3.55 MB Category = 12 URLSite = http://www.ghisler.com/ -URLDownload = http://www.slo.ru/download/total_commander/tcm850x32.exe +URLDownload = http://www.slo.ru/download/total_commander/tcm851ax32.exe CDPath = none [Section.0407] @@ -28,12 +28,12 @@ Description = Total Commander to popularny menedżer plików z dwoma panelami, u [Section.0418] Licence = Versiune de evaluare Description = Total Commander este un gestionar de fișiere după modelul «două paneluri alăturate». -Size = 3,5 Mo +Size = 3,55 Mo [Section.041f] Licence = Paylaşımlı Description = Total Commander, yan yana iki bölmeli bir kütük yöneticisidir. -Size = 3,5 MB +Size = 3,55 MB [Section.0813] Description = Total Commander is een bestandsbeheerder met twee panelen zij aan zij. diff --git a/base/applications/rapps/rapps/utorrent.txt b/base/applications/rapps/rapps/utorrent.txt index 0fb3c5aae9c..b5206838136 100644 --- a/base/applications/rapps/rapps/utorrent.txt +++ b/base/applications/rapps/rapps/utorrent.txt @@ -1,9 +1,9 @@ -; UTF-8 +; UTF-8 ; Turkish translation by Erdem Ersoy (eersoy93) (erdemersoy@live.com) [Section] Name = µTorrent -Version = 3.4.1 +Version = 3.4.2 Licence = Freeware for non-commercial uses Description = Small and fast BitTorrent Client. Size = 1.6 MB diff --git a/base/applications/rapps/rapps/vb5run.txt b/base/applications/rapps/rapps/vb5run.txt index 26e78bc3215..a588264dbc1 100644 --- a/base/applications/rapps/rapps/vb5run.txt +++ b/base/applications/rapps/rapps/vb5run.txt @@ -43,9 +43,9 @@ Description = Microsoft Visual Basic 5 Runtime. Conține: advpack.dll, asycfilt. Size = 969,59 ko [Section.041f] -Name = Microsoft Visual Basic 5 Yürütücüsü +Name = Microsoft Visual Basic 5 Yürütücü Licence = Bilinmiyor -Description = Microsoft Visual Basic 5 Yürütücüsü. Şunları içerir: advpack.dll, asycfilt.dll, comcat.dll, msvbvm50.dll, oleaut32.dll, olepro32.dll. +Description = Microsoft Visual Basic 5 Yürütücü. Şunları içerir: advpack.dll, asycfilt.dll, comcat.dll, msvbvm50.dll, oleaut32.dll, olepro32.dll. Size = 969,59 KB [Section.0422] diff --git a/base/applications/rapps/rapps/vb6run.txt b/base/applications/rapps/rapps/vb6run.txt index b6a0291cbb5..ac1efdf9a65 100644 --- a/base/applications/rapps/rapps/vb6run.txt +++ b/base/applications/rapps/rapps/vb6run.txt @@ -43,9 +43,9 @@ Description = Microsoft Visual Basic 6 Runtime. Conține: advpack.dll, asycfilt. Size = 1,02 Mo [Section.041f] -Name = Microsoft Visual Basic 6 Yürütücüsü +Name = Microsoft Visual Basic 6 Yürütücü Licence = Bilinmiyor -Description = Microsoft Visual Basic 6 Yürütücüsü. Şunları içerir: advpack.dll, asycfilt.dll, comcat.dll, msvbvm60.dll, oleaut32.dll, olepro32.dll. +Description = Microsoft Visual Basic 6 Yürütücü. Şunları içerir: advpack.dll, asycfilt.dll, comcat.dll, msvbvm60.dll, oleaut32.dll, olepro32.dll. Size = 1,02 MB [Section.0422] diff --git a/base/applications/rapps/rapps/vc2005sp1run.txt b/base/applications/rapps/rapps/vc2005sp1run.txt index b5aac6a4e5c..278fd96e011 100644 --- a/base/applications/rapps/rapps/vc2005sp1run.txt +++ b/base/applications/rapps/rapps/vc2005sp1run.txt @@ -45,7 +45,7 @@ Size = 2,6 Mo [Section.041f] Name = Microsoft Visual C++ 2005 SP1 Yeniden Dağıtılabilir Paket Licence = Bilinmiyor -Description = Microsoft Visual Studio 2005 Yürütücüsü SP1. Şunları içerir: atl80.dll, mfc80.dll, mfcm80.dll, mfcm80u.dll, msdia80.dll, msvcm80.dll, msvcp80.dll, msvcr80.dll, vcomp.dll. +Description = Microsoft Visual Studio 2005 Yürütücü SP1. Şunları içerir: atl80.dll, mfc80.dll, mfcm80.dll, mfcm80u.dll, msdia80.dll, msvcm80.dll, msvcp80.dll, msvcr80.dll, vcomp.dll. Size = 2,6 MB [Section.0422] diff --git a/base/applications/rapps/rapps/vc2008sp1run.txt b/base/applications/rapps/rapps/vc2008sp1run.txt index dd2527f40ac..48f9ef730ed 100644 --- a/base/applications/rapps/rapps/vc2008sp1run.txt +++ b/base/applications/rapps/rapps/vc2008sp1run.txt @@ -45,7 +45,7 @@ Size = 4,02 Mo [Section.041f] Name = Microsoft Visual C++ 2008 SP1 Yeniden Dağıtılabilir Paket Licence = Bilinmiyor -Description = Microsoft Visual Studio 2008 SP1 Yürütücüsü. Şunları içerir: atl90.dll, mfc90.dll, mfc90u.dll, mfcm90.dll, mfcm90u.dll, msdia90.dll, msvcm90.dll, msvcp90.dll, msvcr90.dll, vcomp90.dll. +Description = Microsoft Visual Studio 2008 SP1 Yürütücü. Şunları içerir: atl90.dll, mfc90.dll, mfc90u.dll, mfcm90.dll, mfcm90u.dll, msdia90.dll, msvcm90.dll, msvcp90.dll, msvcr90.dll, vcomp90.dll. Size = 4,02 MB [Section.0422] diff --git a/base/applications/rapps/rapps/vc2010run.txt b/base/applications/rapps/rapps/vc2010run.txt index c579426f2ef..180fc739e1f 100644 --- a/base/applications/rapps/rapps/vc2010run.txt +++ b/base/applications/rapps/rapps/vc2010run.txt @@ -45,7 +45,7 @@ Size = 4,8 Mo [Section.041f] Name = Microsoft Visual C++ 2010 Yeniden Dağıtılabilir Paket Licence = Bilinmiyor -Description = Microsoft Visual Studio 2010 Yürütücüsü. Şunları içerir: atl100.dll, mfc100.dll, mfc100u.dll, mfcm100.dll, mfcm100u.dll, msdia100.dll, msvcm100.dll, msvcp100.dll, msvcr100.dll, vcomp100.dll. +Description = Microsoft Visual Studio 2010 Yürütücü. Şunları içerir: atl100.dll, mfc100.dll, mfc100u.dll, mfcm100.dll, mfcm100u.dll, msdia100.dll, msvcm100.dll, msvcp100.dll, msvcr100.dll, vcomp100.dll. Size = 4,8 MB [Section.0422] diff --git a/base/applications/rapps/rapps/vc6run.txt b/base/applications/rapps/rapps/vc6run.txt index 203c5227cc8..831205b60bd 100644 --- a/base/applications/rapps/rapps/vc6run.txt +++ b/base/applications/rapps/rapps/vc6run.txt @@ -45,7 +45,7 @@ Size = 1,75 Mo [Section.041f] Name = Microsoft Visual C++ 6 Yeniden Dağıtılabilir Paket Licence = Bilinmiyor -Description = Microsoft Visual Studio 6 Yürütücüsü. Şunları içerir: advpack.dll, asycfilt.dll, atla.dll, atlu.dll, comcat.dll, mfc42.dll, mfc42u.dll, msvcirt.dll, msvcp60.dll, msvcrt.dll, oleaut32.dll, olepro32.dll. +Description = Microsoft Visual Studio 6 Yürütücü. Şunları içerir: advpack.dll, asycfilt.dll, atla.dll, atlu.dll, comcat.dll, mfc42.dll, mfc42u.dll, msvcirt.dll, msvcp60.dll, msvcrt.dll, oleaut32.dll, olepro32.dll. Size = 1,75 MB [Section.0422] diff --git a/base/applications/rapps/rapps/winboard.txt b/base/applications/rapps/rapps/winboard.txt index adbc371bf2e..001c3b05908 100644 --- a/base/applications/rapps/rapps/winboard.txt +++ b/base/applications/rapps/rapps/winboard.txt @@ -4,8 +4,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. +Licence = GPLv3 +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.93 MB Category = 4 URLSite = http://www.gnu.org/software/xboard/ @@ -36,7 +36,8 @@ Description = WinBoard este o tablă de șah grafică pentru Windows/ReactOS ce Size = 5,93 Mo [Section.041f] -Description = WinBoard; GNU Chess, Crafty ve diğer satranç motorlarını Umûmî Ağ satranç sunucuları ve postayla yazışmalı satranç için bir arayüz olarak sunan, Windows/ReactOS için bir çizgelik satranç tahtasıdır. +Licence = GPL 3. sürüm +Description = WinBoard, Umûmî Ağ satranç sunucularına ve postayla yazışmalı satranca GNU Chess, Crafty ve başka satranç motorlarını bir kullanıcı arayüzü olarak sunabilen, Windows/ReactOS için bir çizgelik satranç tahtasıdır. Size = 5,93 MB [Section.0422] diff --git a/base/applications/rapps/rapps/zaz.txt b/base/applications/rapps/rapps/zaz.txt index 9ecd11079d3..ab8ebf375fe 100644 --- a/base/applications/rapps/rapps/zaz.txt +++ b/base/applications/rapps/rapps/zaz.txt @@ -6,7 +6,7 @@ Name = Zaz Version = 1.0.0 Licence = GPL -Description = Zaz is a free software arcade action puzzle computer game, a little bit like Frozen Bubble. +Description = Zaz is a free arcade action puzzle computer game, a little bit like Frozen Bubble. Size = 21.0 MB Category = 4 URLSite = http://zaz.sourceforge.net @@ -27,5 +27,5 @@ Description = Zaz este un joc de acțiune de tip enigmă/arcadă, asemănător c Size = 21,0 Mo [Section.041f] -Description = Zaz, atari salonu oyunu türünde, gelişimli bir bulmaca oyunudur. Bir nebze Donmuş Kabarcıklar'a benzemektedir. +Description = Zaz; ücretsiz, atari salonu oyunu türünde, devingen bir bulmaca oyunudur, birazcık Frozen Bubble'a benzer. Size = 21,0 MB diff --git a/base/applications/setup16/main.c b/base/applications/setup16/main.c index 8c0ffe29052..fa3581970e3 100644 --- a/base/applications/setup16/main.c +++ b/base/applications/setup16/main.c @@ -13,6 +13,8 @@ static UINT WINAPI ExtCabCallback(PVOID Context, UINT Notification, UINT_PTR Par FILE_IN_CABINET_INFO_W *pInfo; FILEPATHS_W *pFilePaths; + DBG_UNREFERENCED_LOCAL_VARIABLE(pFilePaths); + switch(Notification) { case SPFILENOTIFY_FILEINCABINET: @@ -31,7 +33,7 @@ BOOL DeleteDirectory(LPWSTR lpszDir) { SHFILEOPSTRUCT fileop; DWORD len = wcslen(lpszDir); - WCHAR *pszFrom = HeapAlloc(GetProcessHeap(), 0, (len + 2) * sizeof(WCHAR)); + WCHAR *pszFrom = HeapAlloc(GetProcessHeap(), 0, (len + 2) * sizeof(WCHAR)); int ret; wcscpy(pszFrom, lpszDir); @@ -80,26 +82,26 @@ int APIENTRY wWinMain(HINSTANCE hInstance, STARTUPINFO startupInfo; UNREFERENCED_PARAMETER(hPrevInstance); UNREFERENCED_PARAMETER(nCmdShow); - + GetCurrentDirectory(MAX_PATH, szSetupPath); wcscat(szSetupPath, L"\\"); wcscpy(szFileName, szSetupPath); wcscat(szFileName, L"setup.lst"); - + if (GetFileAttributes(szFileName) == INVALID_FILE_ATTRIBUTES) { MessageBoxW(0, L"Cannot find Setup.lst file", L"Error", MB_OK | MB_ICONERROR); return 1; } - + /* read information from setup.lst */ GetPrivateProfileStringW(NT_PARAMS, L"CabinetFile", NULL, szCabFileName, MAX_PATH, szFileName); GetPrivateProfileStringW(NT_PARAMS, L"TmpDirName", NULL, szTempDirName, 50, szFileName); GetPrivateProfileStringW(NT_PARAMS, L"CmdLine", NULL, szCmdLine, MAX_PATH, szFileName); - + wcscpy(szCabFilePath, szSetupPath); wcscat(szCabFilePath, szCabFileName); - + /* ceate temp directory */ GetSystemDrive(szDrive); wcscpy(szTempPath, szDrive); @@ -107,16 +109,16 @@ int APIENTRY wWinMain(HINSTANCE hInstance, wcscpy(szFullTempPath, szTempPath); wcscat(szFullTempPath, szTempDirName); wcscat(szFullTempPath, L"\\"); - + if (SHCreateDirectoryEx(0, szFullTempPath, NULL) != ERROR_SUCCESS) { MessageBoxW(0, L"Could not create Temp Directory.", L"Error", MB_OK | MB_ICONERROR); return 1; - } + } dwAttrib = GetFileAttributes(szTempPath); SetFileAttributes(szTempPath, dwAttrib | FILE_ATTRIBUTE_HIDDEN); - + /* extract files */ if (!SetupIterateCabinetW(szCabFilePath, 0, ExtCabCallback, szFullTempPath)) { @@ -124,12 +126,12 @@ int APIENTRY wWinMain(HINSTANCE hInstance, DeleteDirectory(szTempPath); return 1; } - + /* prepare command line */ wsprintf(szTempCmdLine, szCmdLine, szFullTempPath, lpCmdLine); wcscpy(szCmdLine, szFullTempPath); wcscat(szCmdLine, szTempCmdLine); - + /* execute the 32-Bit installer */ ZeroMemory(&processInfo, sizeof(processInfo)); ZeroMemory(&startupInfo, sizeof(startupInfo)); @@ -148,10 +150,10 @@ int APIENTRY wWinMain(HINSTANCE hInstance, DeleteDirectory(szTempPath); return 1; } - + /* cleanup */ DeleteDirectory(szTempPath); - + return 0; } diff --git a/base/applications/shutdown/lang/pl-PL.rc b/base/applications/shutdown/lang/pl-PL.rc index 9471ac00c9a..b9342a67eb2 100644 --- a/base/applications/shutdown/lang/pl-PL.rc +++ b/base/applications/shutdown/lang/pl-PL.rc @@ -1,103 +1,116 @@ +/* + * Translated by Saibamen - Adam Stachowicz (saibamenppl@gmail.com) (May, 2014) + */ + LANGUAGE LANG_POLISH, SUBLANG_DEFAULT /* Dialog */ IDD_GUI DIALOGEX 0, 0, 240, 255 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Remote Shutdown" +CAPTION "Zdalne zamknięcie systemu" FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "&OK", IDC_OK, 125, 232, 50, 14 - PUSHBUTTON "&Cancel", IDC_CANCEL, 178, 232, 50, 14 - LTEXT "Co&mputers:", IDC_STATIC, 9, 9, 35, 36 + PUSHBUTTON "&Anuluj", IDC_CANCEL, 178, 232, 50, 14 + LTEXT "Ko&mputery:", IDC_STATIC, 9, 9, 35, 36 LISTBOX IDC_COMPUTER_LIST, 8, 19, 162, 55 - PUSHBUTTON "&Add...", IDC_ADD_SYSTEM, 179, 19, 50, 14 - PUSHBUTTON "&Remove", IDC_REMOVE_SYSTEM, 179, 36, 50, 14, WS_DISABLED - PUSHBUTTON "&Browse...", IDC_BROWSE_SYSTEM, 179, 53, 50, 14 - LTEXT "Action", IDC_ACTION, 11, 81, 20, 14 + PUSHBUTTON "&Dodaj...", IDC_ADD_SYSTEM, 179, 19, 50, 14 + PUSHBUTTON "&Usuń", IDC_REMOVE_SYSTEM, 179, 36, 50, 14, WS_DISABLED + PUSHBUTTON "&Przeglądaj...", IDC_BROWSE_SYSTEM, 179, 53, 50, 14 + LTEXT "Akcja", IDC_ACTION, 11, 81, 20, 14 COMBOBOX IDC_ACTION_TYPE, 37, 79, 129, 14, WS_TABSTOP | CBS_DROPDOWN - CHECKBOX "Warn users", IDC_WARN_USERS, 175, 79, 55, 14, BS_AUTOCHECKBOX | WS_TABSTOP - LTEXT "Display warning for", IDC_SHOW_WARN_ONE, 11, 99, 65, 14 + CHECKBOX "Ostrzeż użytkowników", IDC_WARN_USERS, 175, 79, 55, 14, BS_AUTOCHECKBOX | WS_TABSTOP + LTEXT "Wyświetlaj ostrzeżenie przez", IDC_SHOW_WARN_ONE, 11, 99, 65, 14 EDITTEXT IDC_SHOW_WARN, 78, 97, 41, 14 - LTEXT "second(s)", IDC_SHOW_WARN_TWO, 124, 99, 32, 10 - GROUPBOX "Shutdown Event Tracker", IDC_STATIC, 5, 114, 224, 114 - LTEXT "Reason:", IDC_STATIC, 16, 130, 27, 8 - CHECKBOX "Planned", IDC_PLANNED, 175, 130, 40, 12, BS_AUTOCHECKBOX | WS_TABSTOP + LTEXT "sekund(y)", IDC_SHOW_WARN_TWO, 124, 99, 32, 10 + GROUPBOX "Śledzenie zdarzeń zamknięcia systemu", IDC_STATIC, 5, 114, 224, 114 + LTEXT "Powód:", IDC_STATIC, 16, 130, 27, 8 + CHECKBOX "Planowane", IDC_PLANNED, 175, 130, 40, 12, BS_AUTOCHECKBOX | WS_TABSTOP COMBOBOX IDC_REASON_CODE, 17, 142, 198, 13, WS_TABSTOP | CBS_DROPDOWN - LTEXT "Comm&ent:", IDC_COMMENT_CAPTION, 16, 159, 38, 8 + LTEXT "Ko&mentarz:", IDC_COMMENT_CAPTION, 16, 159, 38, 8 EDITTEXT IDC_COMMENT_TEXT, 17, 171, 198, 50, WS_VSCROLL END /* Information and error messages */ STRINGTABLE BEGIN - IDS_USAGE "ReactOS Shutdown Utility\n\ + IDS_USAGE "Narzędzie Zamykania ReactOS\n\ \n\ -Usage: shutdown [/?] [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]\n\ - [/m \\\\computer][/t xxx][/d [p|u:]xx:yy [/c ""comment""]]\n\ +Sposób użycia: shutdown [/?] [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]\n\ + [/m \\\\komputer][/t xxx][/d [p|u:]xx:yy [/c ""komentarz""]]\n\ \n\ - No arguments or /? Display this help.\n\ - /i Show the graphical user interface (GUI). This option must be the\n\ - first one.\n\ - /l Log off on the local system only. Cannot be used with /m or /d.\n\ - /s Shutdown the computer.\n\ - /r Restart the computer.\n\ - /g Restart the computer and restart all the registered applications.\n\ - /a Cancel a delayed shutdown. Can only be used during the delay\n\ - period.\n\ - /p Shutdown the local computer without any timeout or warning. Can be\n\ - used with /d or /f.\n\ - /h Hibernate the local computer. Usable with /f.\n\ - /e Document the reason for the unexpected computer shutdown.\n\ - /m \\\\computer Specify the target computer (UNC/IP address).\n\ - /t xxx Set the timeout period to xxx seconds before shutting down.\n\ - The valid range starts from 0 to 315360000 (10 years),\n\ - 30 being the default value.\n\ - /c ""comment"" Comment on the reason for shutdown or restart.\n\ - 512 characters maximum allowed.\n\ - /f Force running applications to close without warning users. If you\n\ - do not specify any other parameter, this option will also log off.\n\ - /d [p|u:]xx:yy Give the reason code for the shutdown or the restart.\n\ - p indicates that the shutdown or the restart is planned.\n\ - u indicates that the reason is defined by the user.\n\ - If neither p nor u are specified, the shutdown or the restart are\n\ - not planned.\n\ - xx is the major reason code (positive integer smaller than 256).\n\ - yy is the minor reason code (positive integer smaller than 65536).\n" + Bez argumentów lub /? Wyświetla Pomoc.\n\ + /i Wyświetla graficzny interfejs użytkownika (GUI).\n\ + To musi być pierwsza opcja.\n\ + /l Wylogowuje. Ten parametr nie może być używany z opcjami /m\n\ + oraz /d.\n\ + /s Zamyka komputer.\n\ + /r Zamyka i ponownie uruchamia komputer.\n\ + /g Zamyka i ponownie uruchamia komputer. Po ponownym rozruchu\n\ + systemu, uruchamia ponownie wszystkie zarejestrowane\n\ + aplikacje.\n\ + /a Przerywa zamykanie systemu.\n\ + Do użytku tylko podczas limitu czasu.\n\ + /p Wyłącza lokalny komputer bez limitu czasu i ostrzeżenia.\n\ + Do użytku tylko z opcją /d i /f.\n\ + /h Przełącza komputer lokalny w stan hibernacji.\n\ + Do użytku tylko z opcją /f.\n\ + /e Dokumentuje przyczynę nieoczekiwanego zamknięcia systemu.\n\ + /m \\\\komputer Określa komputer docelowy (adres UNC/IP).\n\ + /t xxx Ustawia limit czasu zamknięcia systemu na xxx sekund.\n\ + Prawidłowy zakres to 0-315360000 (10 lat), domyślna wartość to 30.\n\ + /c ""komentarz"" Wstawia komentarz dotyczący przyczyny ponownego\n\ + uruchomienia lub zamknięcia.\n\ + Maksymalna dozwolona liczba znaków wynosi 512.\n\ + /f Wymusza zamknięcie uruchomionych aplikacji bez uprzedniego\n\ + powiadamiania użytkowników. If you do not specify any other parameter, this option will also log off.\n\ + /d [p|u:]xx:yy Podaje przyczynę ponownego uruchomienia lub\n\ + zamknięcia systemu\n\ + Opcja p określa, że zaplanowano zamknięcie lub\n\ + ponowne uruchomienie.\n\ + Opcja u określa, że przyczyna jest zdefiniowana przez\n\ + użytkownika.\n\ + Jeśli nie określono opcji p i u, ponowne uruchomienie\n\ + lub zamknięcie nie jest zaplanowane.\n\ + xx to numer przyczyny głównej (dodatnia liczba całkowita\n\ + mniejsza niż 256).\n\ + yy to numer przyczyny dodatkowej (dodatnia liczba całkowita\n\ + mniejsza niż 65 536).\n" - IDS_ERROR_SHUTDOWN_REBOOT "ERROR: Unable to shutdown and restart at the same time.\n" - IDS_ERROR_TIMEOUT "ERROR: Timeout value of %u is out of bounds (0-315360000).\n" - IDS_ERROR_ABORT "ERROR: Unable to abort the shutdown of the system.\n" - IDS_ERROR_LOGOFF "ERROR: Unable to logoff the system.\n" - IDS_ERROR_SHUTDOWN "ERROR: Unable to shutdown the system.\n" - IDS_ERROR_RESTART "ERROR: Unable to restart the system.\n" - IDS_ERROR_MAX_COMMENT_LENGTH "ERROR: Comment length exceeds maximum character limit set by the system.\n" - IDS_ERROR_HIBERNATE "ERROR: Unable to send system into hibernation mode.\n" - IDS_ERROR_HIBERNATE_LOCAL "ERROR: Hibernation mode cannot be started remotely.\n" - IDS_ERROR_HIBERNATE_ENABLED "ERROR: Hibernation mode is not enabled.\n" - IDS_ERROR_DIALOG_CAPTION "Remote Shutdown" - IDS_ERROR_DIALOG_INIT "Unable to display the graphical user interface." + IDS_ERROR_SHUTDOWN_REBOOT "BŁĄD: Nie można zamknąć i ponownie uruchomić w tym samym czasie.\n" + IDS_ERROR_TIMEOUT "BŁĄD: Limit czasu %u jest poza zakresem (0-315360000).\n" + IDS_ERROR_ABORT "BŁĄD: Nie można przerważ zamykania systemu.\n" + IDS_ERROR_LOGOFF "BŁĄD: Nie można wylogować z systemu.\n" + IDS_ERROR_SHUTDOWN "BŁĄD: Nie można zamknąć systemu.\n" + IDS_ERROR_RESTART "BŁĄD: Nie można ponownie uruchomić systemu.\n" + IDS_ERROR_MAX_COMMENT_LENGTH "BŁĄD: Długość komentarza przekrasza maksymalny limit znaków ustawiony przez system.\n" + IDS_ERROR_HIBERNATE "BŁĄD: Nie można ustawić systemu w trybie hibernacji.\n" + IDS_ERROR_HIBERNATE_LOCAL "BŁĄD: Tryb hibernacji nie może być uruchomiony zdalnie.\n" + IDS_ERROR_HIBERNATE_ENABLED "BŁĄD: Tryb hibernacji jest wyłączony.\n" + IDS_ERROR_DIALOG_CAPTION "Zdalne Zamykanie" + IDS_ERROR_DIALOG_INIT "Nie można wyświetlić graficznego interfejsu użytkownika." END /* Remote shutdown action strings */ STRINGTABLE BEGIN - IDS_ACTION_SHUTDOWN "Shutdown the system" - IDS_ACTION_RESTART "Restart the system" - IDS_ACTION_UNEXPECTED_SHUTDOWN "Annotate the unexpected shutdown" + IDS_ACTION_SHUTDOWN "Zamknięcie" + IDS_ACTION_RESTART "Uruchom ponownie" + IDS_ACTION_UNEXPECTED_SHUTDOWN "Adnotuj nieoczekiwane zamknięcie" END /* Remote shutdown reason strings */ STRINGTABLE BEGIN - IDS_REASON_OTHER "Other" - IDS_REASON_HARDWARE_MAINTENANCE "Hardware: Maintenance" - IDS_REASON_HARDWARE_INSTALL "Hardware: Installation" - IDS_REASON_OS_RECOVER "Operating System: Recovery" - IDS_REASON_OS_RECONFIGURE "Operating System: Reconfigure" - IDS_REASON_APP_MAINTENANCE "Application: Maintenance" - IDS_REASON_APP_INSTALL "Application: Installation" - IDS_REASON_APP_UNRESPONSIVE "Application: Unresponsive" - IDS_REASON_APP_UNSTABLE "Application: Unstable" - IDS_REASON_SECURITY "Security Issue" - IDS_REASON_NETWORK "Loss of network connectivity" + IDS_REASON_OTHER "Inne zadania" + IDS_REASON_HARDWARE_MAINTENANCE "Sprzęt: konserwacja" + IDS_REASON_HARDWARE_INSTALL "Sprzęt: instalacja" + IDS_REASON_OS_RECOVER "System Operacyjny: odzyskiwanie" + IDS_REASON_OS_RECONFIGURE "System Operacyjny: ponowna konfiguracja" + IDS_REASON_APP_MAINTENANCE "Aplikacja: konserwacja" + IDS_REASON_APP_INSTALL "Aplikacja: instalacja" + IDS_REASON_APP_UNRESPONSIVE "Aplikacja: nie odpowiada" + IDS_REASON_APP_UNSTABLE "Aplikacja: niestabilna" + IDS_REASON_SECURITY "Problem zabezpieczeń" + IDS_REASON_NETWORK "Utrata połączenia sieciowego" END diff --git a/base/applications/shutdown/shutdown.c b/base/applications/shutdown/shutdown.c index 37942e55113..b162d7a78ea 100644 --- a/base/applications/shutdown/shutdown.c +++ b/base/applications/shutdown/shutdown.c @@ -22,7 +22,7 @@ VOID PrintResourceString(INT resID, ...) va_start(arg_ptr, resID); LoadStringW(GetModuleHandle(NULL), resID, tmpBuffer, MAX_BUFFER_SIZE); - _vcwprintf(tmpBuffer, arg_ptr); + vfwprintf(stdout, tmpBuffer, arg_ptr); va_end(arg_ptr); } diff --git a/base/applications/sndrec32/lang/pl-PL.rc b/base/applications/sndrec32/lang/pl-PL.rc index c86f1fd2a4a..6eea26523b1 100644 --- a/base/applications/sndrec32/lang/pl-PL.rc +++ b/base/applications/sndrec32/lang/pl-PL.rc @@ -3,7 +3,8 @@ * Use ReactOS forum PM, IRC or saibamenppl at gmail.com to contact me * http://www.reactos.org * IRC: irc.freenode.net #reactos-pl; - * UTF-8 conversion by Caemyr (May, 2011) + * UTF-8 conversion by Caemyr (May, 2011) + * Update by wojo664 and Saibamen (May 2014) */ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT @@ -21,7 +22,7 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN ICON IDI_SNDREC32, -1, 19, 14, 21, 20 LTEXT "Rejestrator dźwięku ReactOS, wersja 1.0", IDC_STATIC, 56, 16, 114, 8, SS_NOPREFIX - LTEXT "Copyright (C) 2009", IDC_STATIC, 56, 25, 114, 8 + LTEXT "Prawa autorskie (C) 2009", IDC_STATIC, 56, 25, 114, 8 DEFPUSHBUTTON "OK", IDOK, 139, 54, 50, 14, WS_GROUP END @@ -33,35 +34,35 @@ BEGIN MENUITEM "Otwórz...", ID_FILE_OPEN MENUITEM "Zapisz", ID_FILE_SAVE, GRAYED MENUITEM "Zapisz jako...", ID_FILE_SAVEAS, GRAYED - MENUITEM "Restore...", ID_FILE_RESTORE, GRAYED - MENUITEM "Properties", ID_FILE_PROPERTIES + MENUITEM "Przywróć...", ID_FILE_RESTORE, GRAYED + MENUITEM "Właściwości", ID_FILE_PROPERTIES MENUITEM SEPARATOR MENUITEM "Wyjście", ID_FILE_EXIT END - POPUP "&Edit" + POPUP "&Edycja" BEGIN - MENUITEM "&Copy", ID_EDIT_COPY - MENUITEM "&Paste Insert", ID_EDIT_PASTE, GRAYED - MENUITEM "Paste Mi&x", ID_EDIT_PASTEMIX, GRAYED + MENUITEM "&Kopiuj", ID_EDIT_COPY + MENUITEM "&Wklej wstawkę", ID_EDIT_PASTE, GRAYED + MENUITEM "Wklej Mi&ks", ID_EDIT_PASTEMIX, GRAYED MENUITEM SEPARATOR - MENUITEM "&Insert File...", ID_EDIT_INSERTFILE - MENUITEM "&Mix with File...", ID_EDIT_MIXFILE + MENUITEM "&Wstaw plik...", ID_EDIT_INSERTFILE + MENUITEM "&Miksuj z plikiem...", ID_EDIT_MIXFILE MENUITEM SEPARATOR - MENUITEM "Delete &Before Current Position",ID_EDIT_DELETEBEFORE, GRAYED - MENUITEM "Delete &After Current Position",ID_EDIT_DELETEAFTER, GRAYED + MENUITEM "Kasuj &przed obecną pozycją",ID_EDIT_DELETEBEFORE, GRAYED + MENUITEM "Kasuj &za obecną pozycją",ID_EDIT_DELETEAFTER, GRAYED MENUITEM SEPARATOR - MENUITEM "A&udio Properties", ID_EDIT_AUDIOPROPS + MENUITEM "Właściwości a&udio", ID_EDIT_AUDIOPROPS END - POPUP "Effect&s" + POPUP "Efekt&y" BEGIN - MENUITEM "&Increase Volume (by 25%)", ID_EFFECTS_INCVOL - MENUITEM "&Decrease Volume", ID_EFFECTS_DECVOL + MENUITEM "&Zgłośnij (o 25%)", ID_EFFECTS_INCVOL + MENUITEM "&Ścisz", ID_EFFECTS_DECVOL MENUITEM SEPARATOR - MENUITEM "&Increase Speed (by 100%)", ID_EFFECTS_INCSPD - MENUITEM "&Decrease Speed", ID_EFFECTS_DECSPD + MENUITEM "&Przyśpiesz (o 100%)", ID_EFFECTS_INCSPD + MENUITEM "&Zwolnij", ID_EFFECTS_DECSPD MENUITEM SEPARATOR - MENUITEM "&Add Echo", ID_EFFECTS_ECHO - MENUITEM "&Reverse", ID_EFFECTS_REVERSE + MENUITEM "&Dodaj echo", ID_EFFECTS_ECHO + MENUITEM "&Odwróć", ID_EFFECTS_REVERSE END POPUP "?" BEGIN diff --git a/base/applications/taskmgr/applpage.c b/base/applications/taskmgr/applpage.c index f9c2949603e..5eabd19eeb6 100644 --- a/base/applications/taskmgr/applpage.c +++ b/base/applications/taskmgr/applpage.c @@ -869,6 +869,9 @@ void ApplicationPage_OnEndTask(void) LV_ITEM item; int i; + /* Trick: on Windows, pressing the CTRL key forces the task to be ended */ + BOOL ForceEndTask = !!(GetKeyState(VK_CONTROL) & 0x8000); + for (i=0; ihWnd, WM_CLOSE, 0, 0); + EndTask(pAPLI->hWnd, 0, ForceEndTask); } } } diff --git a/base/applications/taskmgr/taskmgr.c b/base/applications/taskmgr/taskmgr.c index 5fec61407b2..cf94146762c 100644 --- a/base/applications/taskmgr/taskmgr.c +++ b/base/applications/taskmgr/taskmgr.c @@ -172,6 +172,12 @@ int APIENTRY wWinMain(HINSTANCE hInstance, return -1; } + /* + * Set our shutdown parameters: we want to shutdown the very last, + * without displaying any end task dialog if needed. + */ + SetProcessShutdownParameters(1, SHUTDOWN_NORETRY); + DialogBoxW(hInst, (LPCWSTR)IDD_TASKMGR_DIALOG, NULL, TaskManagerWndProc); /* Save our settings to the registry */ diff --git a/base/services/tcpsvcs/discard.c b/base/services/tcpsvcs/discard.c index 8ac3d667ac9..a900b71b644 100644 --- a/base/services/tcpsvcs/discard.c +++ b/base/services/tcpsvcs/discard.c @@ -24,7 +24,7 @@ ReceiveIncomingPackets(SOCKET sock) { TCHAR logBuf[256]; - _swprintf(logBuf, L"Discard: Received %d bytes from client", readBytes); + swprintf(logBuf, L"Discard: Received %d bytes from client", readBytes); LogEvent(logBuf, 0, 0, LOG_FILE); } else if (readBytes == SOCKET_ERROR) diff --git a/base/services/tcpsvcs/echo.c b/base/services/tcpsvcs/echo.c index 95aed129bfd..e92732c899f 100644 --- a/base/services/tcpsvcs/echo.c +++ b/base/services/tcpsvcs/echo.c @@ -25,7 +25,7 @@ EchoIncomingPackets(SOCKET sock) readBytes = recv(sock, readBuffer, RECV_BUF, 0); if (readBytes > 0) { - _swprintf(logBuf, L"Received %d bytes from client", readBytes); + swprintf(logBuf, L"Received %d bytes from client", readBytes); LogEvent(logBuf, 0, 0, LOG_FILE); totalSentBytes = 0; @@ -34,7 +34,7 @@ EchoIncomingPackets(SOCKET sock) retVal = send(sock, readBuffer + totalSentBytes, readBytes - totalSentBytes, 0); if (retVal > 0) { - _swprintf(logBuf, L"Sent %d bytes back to client", retVal); + swprintf(logBuf, L"Sent %d bytes back to client", retVal); LogEvent(logBuf, 0, 0, LOG_FILE); totalSentBytes += retVal; } diff --git a/base/services/tcpsvcs/skelserver.c b/base/services/tcpsvcs/skelserver.c index 20bf8e374be..1b5e6d61584 100644 --- a/base/services/tcpsvcs/skelserver.c +++ b/base/services/tcpsvcs/skelserver.c @@ -84,14 +84,14 @@ AcceptConnections(SOCKET listeningSocket, sock = accept(listeningSocket, (SOCKADDR*)&client, &addrSize); if (sock != INVALID_SOCKET) { - _swprintf(logBuf, - L"Accepted connection to %s server from %S:%d", - lpName, - inet_ntoa(client.sin_addr), - ntohs(client.sin_port)); + swprintf(logBuf, + L"Accepted connection to %s server from %S:%d", + lpName, + inet_ntoa(client.sin_addr), + ntohs(client.sin_port)); LogEvent(logBuf, 0, 0, LOG_FILE); - _swprintf(logBuf, L"Creating worker thread for %s", lpName); + swprintf(logBuf, L"Creating worker thread for %s", lpName); LogEvent(logBuf, 0, 0, LOG_FILE); if (!bShutdown) @@ -103,8 +103,8 @@ AcceptConnections(SOCKET listeningSocket, } else { - _swprintf(logBuf, L"Failed to start worker thread for the %s server", - lpName); + swprintf(logBuf, L"Failed to start worker thread for the %s server", + lpName); LogEvent(logBuf, 0, 0, LOG_FILE); } } @@ -149,7 +149,7 @@ ShutdownConnection(SOCKET sock, ret = recv(sock, readBuffer, BUF, 0); if (ret >= 0) { - _swprintf(logBuf, L"FYI, received %d unexpected bytes during shutdown", ret); + swprintf(logBuf, L"FYI, received %d unexpected bytes during shutdown", ret); LogEvent(logBuf, 0, 0, LOG_FILE); } } while (ret > 0); @@ -170,7 +170,7 @@ StartServer(LPVOID lpParam) pServices = (PSERVICES)lpParam; - _swprintf(logBuf, L"Starting %s server", pServices->lpName); + swprintf(logBuf, L"Starting %s server", pServices->lpName); LogEvent(logBuf, 0, 0, LOG_FILE); if (!bShutdown) @@ -178,10 +178,10 @@ StartServer(LPVOID lpParam) listeningSocket = SetUpListener(htons(pServices->Port)); if (!bShutdown && listeningSocket != INVALID_SOCKET) { - _swprintf(logBuf, - L"%s is waiting for connections on port %d", - pServices->lpName, - pServices->Port); + swprintf(logBuf, + L"%s is waiting for connections on port %d", + pServices->lpName, + pServices->Port); LogEvent(logBuf, 0, 0, LOG_FILE); AcceptConnections(listeningSocket, pServices->lpService, pServices->lpName); @@ -192,9 +192,7 @@ StartServer(LPVOID lpParam) } } - _swprintf(logBuf, - L"Exiting %s thread", - pServices->lpName); + swprintf(logBuf, L"Exiting %s thread", pServices->lpName); LogEvent(logBuf, 0, 0, LOG_FILE); ExitThread(0); } diff --git a/base/services/tcpsvcs/tcpsvcs.c b/base/services/tcpsvcs/tcpsvcs.c index 345a19f5daf..f025b6746c2 100644 --- a/base/services/tcpsvcs/tcpsvcs.c +++ b/base/services/tcpsvcs/tcpsvcs.c @@ -72,7 +72,7 @@ CreateServers(PSERVICEINFO pServInfo) if ((RetVal = WSAStartup(MAKEWORD(2, 2), &wsaData)) != 0) { - _swprintf(buf, L"WSAStartup() failed : %lu\n", RetVal); + swprintf(buf, L"WSAStartup() failed : %lu\n", RetVal); LogEvent(buf, 0, 100, LOG_ALL); return FALSE; } @@ -84,7 +84,7 @@ CreateServers(PSERVICEINFO pServInfo) /* Create worker threads. */ for (i = 0; i < NUM_SERVICES; i++) { - _swprintf(buf, L"Creating thread for %s server", Services[i].lpName); + swprintf(buf, L"Creating thread for %s server", Services[i].lpName); LogEvent(buf, 0, 0, LOG_FILE); hThread[i] = CreateThread(NULL, @@ -96,7 +96,7 @@ CreateServers(PSERVICEINFO pServInfo) if (hThread[i] == NULL) { - _swprintf(buf, L"\nError creating %s server thread\n", Services[i].lpName); + swprintf(buf, L"\nError creating %s server thread\n", Services[i].lpName); LogEvent(buf, GetLastError(), 0, LOG_ALL); return FALSE; } diff --git a/base/services/tcpsvcs/tcpsvcs.h b/base/services/tcpsvcs/tcpsvcs.h index 87f27eb34c5..b024e7c2513 100644 --- a/base/services/tcpsvcs/tcpsvcs.h +++ b/base/services/tcpsvcs/tcpsvcs.h @@ -10,10 +10,6 @@ #include #include -#ifndef _MSC_VER -#define _swprintf swprintf -#endif - #define LOG_FILE 1 #define LOG_EVENTLOG 2 #define LOG_ERROR 4 diff --git a/base/services/umpnpmgr/CMakeLists.txt b/base/services/umpnpmgr/CMakeLists.txt index 958fad22c1b..9667d98d88f 100644 --- a/base/services/umpnpmgr/CMakeLists.txt +++ b/base/services/umpnpmgr/CMakeLists.txt @@ -1,9 +1,6 @@ include_directories(${REACTOS_SOURCE_DIR}/include/reactos/idl) -remove_definitions(-D_WIN32_WINNT=0x502) -add_definitions(-D_WIN32_WINNT=0x600) - add_rpc_files(server ${REACTOS_SOURCE_DIR}/include/reactos/idl/pnp.idl) @@ -17,5 +14,5 @@ target_link_libraries(umpnpmgr ${PSEH_LIB}) set_module_type(umpnpmgr win32cui UNICODE) -add_importlibs(umpnpmgr advapi32 rpcrt4 userenv msvcrt kernel32 ntdll) +add_importlibs(umpnpmgr advapi32 rpcrt4 userenv shlwapi msvcrt kernel32 ntdll) add_cd_file(TARGET umpnpmgr DESTINATION reactos/system32 FOR all) diff --git a/base/services/umpnpmgr/umpnpmgr.c b/base/services/umpnpmgr/umpnpmgr.c index f683e9f5b40..d8fbfa7a5a0 100644 --- a/base/services/umpnpmgr/umpnpmgr.c +++ b/base/services/umpnpmgr/umpnpmgr.c @@ -44,6 +44,7 @@ #include #include #include +#include #include #define NDEBUG @@ -1142,7 +1143,7 @@ DWORD PNP_DeleteClassKey( if (ulFlags & CM_DELETE_CLASS_SUBKEYS) { - if (RegDeleteTreeW(hClassKey, pszClassGuid) != ERROR_SUCCESS) + if (SHDeleteKeyW(hClassKey, pszClassGuid) != ERROR_SUCCESS) ret = CR_REGISTRY_ERROR; } else diff --git a/base/setup/setup/setup.c b/base/setup/setup/setup.c index c250eae2631..6bea7a3631a 100644 --- a/base/setup/setup/setup.c +++ b/base/setup/setup/setup.c @@ -36,112 +36,122 @@ typedef DWORD (WINAPI *PINSTALL_REACTOS)(HINSTANCE hInstance); /* FUNCTIONS ****************************************************************/ -LPTSTR lstrchr(LPCTSTR s, TCHAR c) +LPTSTR +lstrchr( + LPCTSTR s, + TCHAR c) { - while (*s) + while (*s) { - if (*s == c) + if (*s == c) + return (LPTSTR)s; + s++; + } + + if (c == (TCHAR)0) return (LPTSTR)s; - s++; - } - if (c == (TCHAR)0) - return (LPTSTR)s; - - return (LPTSTR)NULL; + return (LPTSTR)NULL; } -static VOID -RunNewSetup (HINSTANCE hInstance) + +static +VOID +RunNewSetup( + HINSTANCE hInstance) { - HMODULE hDll; - PINSTALL_REACTOS InstallReactOS; + HMODULE hDll; + PINSTALL_REACTOS InstallReactOS; - hDll = LoadLibrary (TEXT("syssetup")); - if (hDll == NULL) + hDll = LoadLibrary(TEXT("syssetup")); + if (hDll == NULL) { - DPRINT("Failed to load 'syssetup'!\n"); - return; + DPRINT("Failed to load 'syssetup'!\n"); + return; } - DPRINT("Loaded 'syssetup'!\n"); - InstallReactOS = (PINSTALL_REACTOS)GetProcAddress (hDll, "InstallReactOS"); - - if (InstallReactOS == NULL) + DPRINT("Loaded 'syssetup'!\n"); + InstallReactOS = (PINSTALL_REACTOS)GetProcAddress(hDll, "InstallReactOS"); + if (InstallReactOS == NULL) { - DPRINT("Failed to get address for 'InstallReactOS()'!\n"); - FreeLibrary (hDll); - return; + DPRINT("Failed to get address for 'InstallReactOS()'!\n"); + FreeLibrary(hDll); + return; } - InstallReactOS (hInstance); + InstallReactOS(hInstance); - FreeLibrary (hDll); + FreeLibrary(hDll); } -static VOID -RunLiveCD (HINSTANCE hInstance) + +static +VOID +RunLiveCD( + HINSTANCE hInstance) { - HMODULE hDll; - PINSTALL_REACTOS InstallLiveCD; + HMODULE hDll; + PINSTALL_REACTOS InstallLiveCD; - hDll = LoadLibrary (TEXT("syssetup")); - if (hDll == NULL) + hDll = LoadLibrary(TEXT("syssetup")); + if (hDll == NULL) { - DPRINT("Failed to load 'syssetup'!\n"); - return; + DPRINT("Failed to load 'syssetup'!\n"); + return; } - DPRINT("Loaded 'syssetup'!\n"); - InstallLiveCD = (PINSTALL_REACTOS)GetProcAddress (hDll, "InstallLiveCD"); - - if (InstallLiveCD == NULL) + DPRINT("Loaded 'syssetup'!\n"); + InstallLiveCD = (PINSTALL_REACTOS)GetProcAddress(hDll, "InstallLiveCD"); + if (InstallLiveCD == NULL) { - DPRINT("Failed to get address for 'InstallReactOS()'!\n"); - FreeLibrary (hDll); - return; + DPRINT("Failed to get address for 'InstallReactOS()'!\n"); + FreeLibrary(hDll); + return; } - InstallLiveCD (hInstance); + InstallLiveCD(hInstance); - FreeLibrary (hDll); + FreeLibrary(hDll); } -int WINAPI -_tWinMain (HINSTANCE hInstance, - HINSTANCE hPrevInstance, - LPTSTR lpCmdLine, - int nShowCmd) + +int +WINAPI +_tWinMain( + HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPTSTR lpCmdLine, + int nShowCmd) { - LPTSTR CmdLine; - LPTSTR p; + LPTSTR CmdLine; + LPTSTR p; - CmdLine = GetCommandLine (); + CmdLine = GetCommandLine(); - DPRINT("CmdLine: <%s>\n",CmdLine); + DPRINT("CmdLine: <%s>\n",CmdLine); - p = lstrchr (CmdLine, TEXT('-')); - if (p == NULL) - return 0; + p = lstrchr(CmdLine, TEXT('-')); + if (p == NULL) + return 0; - if (!lstrcmpi (p, TEXT("-newsetup"))) + if (!lstrcmpi(p, TEXT("-newsetup"))) { - RunNewSetup (hInstance); + RunNewSetup(hInstance); } - else if (!lstrcmpi (p, TEXT("-mini"))) + else if (!lstrcmpi(p, TEXT("-mini"))) { - RunLiveCD (hInstance); + RunLiveCD(hInstance); } #if 0 /* Add new setup types here */ - else if (...) + else if (...) { } #endif - return 0; + return 0; } /* EOF */ diff --git a/base/setup/usetup/errorcode.h b/base/setup/usetup/errorcode.h index 8bb5a43d308..0acfbd67b1f 100644 --- a/base/setup/usetup/errorcode.h +++ b/base/setup/usetup/errorcode.h @@ -28,7 +28,8 @@ typedef enum { - ERROR_NOT_INSTALLED = 0, + NOT_AN_ERROR = 0, + ERROR_NOT_INSTALLED, ERROR_NO_HDD, ERROR_NO_SOURCE_DRIVE, ERROR_LOAD_TXTSETUPSIF, @@ -67,6 +68,12 @@ typedef enum ERROR_UPDATE_GEOID, ERROR_INSUFFICIENT_DISKSPACE, + ERROR_PARTITION_TABLE_FULL, + ERROR_ONLY_ONE_EXTENDED, + ERROR_NOT_BEHIND_EXTENDED, + ERROR_EXTENDED_NOT_LAST, + + ERROR_LAST_ERROR_CODE }ERROR_NUMBER; diff --git a/base/setup/usetup/interface/usetup.c b/base/setup/usetup/interface/usetup.c index c0c597e617c..502e6cf286c 100644 --- a/base/setup/usetup/interface/usetup.c +++ b/base/setup/usetup/interface/usetup.c @@ -1463,12 +1463,14 @@ IsDiskSizeValid(PPARTENTRY PartEntry) static PAGE_NUMBER SelectPartitionPage(PINPUT_RECORD Ir) { + ULONG Error; + MUIDisplayPage(SELECT_PARTITION_PAGE); if (PartitionList == NULL) { PartitionList = CreatePartitionList(2, - 19, + 21, xScreen - 3, yScreen - 3); if (PartitionList == NULL) @@ -1521,9 +1523,9 @@ SelectPartitionPage(PINPUT_RECORD Ir) return SELECT_PARTITION_PAGE; /* let the user select another partition */ } #endif - CreateNewPartition(PartitionList, - PartitionList->CurrentPartition->SectorCount.QuadPart, - TRUE); + CreatePrimaryPartition(PartitionList, + PartitionList->CurrentPartition->SectorCount.QuadPart, + TRUE); DestinationDriveLetter = (WCHAR)PartitionList->CurrentPartition->DriveLetter; @@ -1548,14 +1550,38 @@ SelectPartitionPage(PINPUT_RECORD Ir) while (TRUE) { /* Update status text */ - if (PartitionList->CurrentPartition == NULL || - PartitionList->CurrentPartition->IsPartitioned == FALSE) + if (PartitionList->CurrentPartition == NULL) { CONSOLE_SetStatusText(MUIGetString(STRING_INSTALLCREATEPARTITION)); } + else if (PartitionList->CurrentPartition->LogicalPartition) + { + if (PartitionList->CurrentPartition->IsPartitioned) + { + CONSOLE_SetStatusText(MUIGetString(STRING_DELETEPARTITION)); + } + else + { + CONSOLE_SetStatusText(MUIGetString(STRING_INSTALLCREATELOGICAL)); + } + } else { - CONSOLE_SetStatusText(MUIGetString(STRING_INSTALLDELETEPARTITION)); + if (PartitionList->CurrentPartition->IsPartitioned) + { + if (IsContainerPartition(PartitionList->CurrentPartition->PartitionType)) + { + CONSOLE_SetStatusText(MUIGetString(STRING_DELETEPARTITION)); + } + else + { + CONSOLE_SetStatusText(MUIGetString(STRING_INSTALLDELETEPARTITION)); + } + } + else + { + CONSOLE_SetStatusText(MUIGetString(STRING_INSTALLCREATEPARTITION)); + } } CONSOLE_ConInKey(Ir); @@ -1575,12 +1601,14 @@ SelectPartitionPage(PINPUT_RECORD Ir) else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) && (Ir->Event.KeyEvent.wVirtualKeyCode == VK_DOWN)) /* DOWN */ { - ScrollDownPartitionList(PartitionList); + if (ScrollDownPartitionList(PartitionList)) + DrawPartitionList(PartitionList); } else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) && (Ir->Event.KeyEvent.wVirtualKeyCode == VK_UP)) /* UP */ { - ScrollUpPartitionList(PartitionList); + if (ScrollUpPartitionList(PartitionList)) + DrawPartitionList(PartitionList); } else if (Ir->Event.KeyEvent.wVirtualKeyCode == VK_RETURN) /* ENTER */ { @@ -1591,27 +1619,62 @@ SelectPartitionPage(PINPUT_RECORD Ir) return SELECT_PARTITION_PAGE; /* let the user select another partition */ } #endif + if (IsContainerPartition(PartitionList->CurrentPartition->PartitionType)) + continue; //return SELECT_PARTITION_PAGE; + if (PartitionList->CurrentPartition == NULL || PartitionList->CurrentPartition->IsPartitioned == FALSE) { - CreateNewPartition(PartitionList, - 0ULL, - TRUE); + CreatePrimaryPartition(PartitionList, + 0ULL, + TRUE); } DestinationDriveLetter = (WCHAR)PartitionList->CurrentPartition->DriveLetter; return SELECT_FILE_SYSTEM_PAGE; } - else if (Ir->Event.KeyEvent.wVirtualKeyCode == 'C') /* C */ + else if (Ir->Event.KeyEvent.wVirtualKeyCode == 'P') /* P */ { - if (PartitionList->CurrentPartition->IsPartitioned == TRUE) + if (PartitionList->CurrentPartition->LogicalPartition == FALSE) { - MUIDisplayError(ERROR_NEW_PARTITION, Ir, POPUP_WAIT_ANY_KEY); - return SELECT_PARTITION_PAGE; - } + Error = PrimaryPartitionCreationChecks(PartitionList); + if (Error != NOT_AN_ERROR) + { + MUIDisplayError(Error, Ir, POPUP_WAIT_ANY_KEY); + return SELECT_PARTITION_PAGE; + } - return CREATE_PARTITION_PAGE; + return CREATE_PRIMARY_PARTITION_PAGE; + } + } + else if (Ir->Event.KeyEvent.wVirtualKeyCode == 'E') /* E */ + { + if (PartitionList->CurrentPartition->LogicalPartition == FALSE) + { + Error = ExtendedPartitionCreationChecks(PartitionList); + if (Error != NOT_AN_ERROR) + { + MUIDisplayError(Error, Ir, POPUP_WAIT_ANY_KEY); + return SELECT_PARTITION_PAGE; + } + + return CREATE_EXTENDED_PARTITION_PAGE; + } + } + else if (Ir->Event.KeyEvent.wVirtualKeyCode == 'L') /* L */ + { + if (PartitionList->CurrentPartition->LogicalPartition == TRUE) + { + Error = LogicalPartitionCreationChecks(PartitionList); + if (Error != NOT_AN_ERROR) + { + MUIDisplayError(Error, Ir, POPUP_WAIT_ANY_KEY); + return SELECT_PARTITION_PAGE; + } + + return CREATE_LOGICAL_PARTITION_PAGE; + } } else if (Ir->Event.KeyEvent.wVirtualKeyCode == 'D') /* D */ { @@ -1773,7 +1836,7 @@ ShowPartitionSizeInputBox(SHORT Left, static PAGE_NUMBER -CreatePartitionPage(PINPUT_RECORD Ir) +CreatePrimaryPartitionPage(PINPUT_RECORD Ir) { PDISKENTRY DiskEntry; PPARTENTRY PartEntry; @@ -1907,15 +1970,307 @@ CreatePartitionPage(PINPUT_RECORD Ir) DPRINT ("Partition size: %I64u bytes\n", PartSize); - CreateNewPartition(PartitionList, - SectorCount, - FALSE); + CreatePrimaryPartition(PartitionList, + SectorCount, + FALSE); return SELECT_PARTITION_PAGE; } } - return CREATE_PARTITION_PAGE; + return CREATE_PRIMARY_PARTITION_PAGE; +} + + +static PAGE_NUMBER +CreateExtendedPartitionPage(PINPUT_RECORD Ir) +{ + PDISKENTRY DiskEntry; + PPARTENTRY PartEntry; + BOOLEAN Quit; + BOOLEAN Cancel; + CHAR InputBuffer[50]; + ULONG MaxSize; + ULONGLONG PartSize; + ULONGLONG DiskSize; + ULONGLONG SectorCount; + PCHAR Unit; + + if (PartitionList == NULL || + PartitionList->CurrentDisk == NULL || + PartitionList->CurrentPartition == NULL) + { + /* FIXME: show an error dialog */ + return QUIT_PAGE; + } + + DiskEntry = PartitionList->CurrentDisk; + PartEntry = PartitionList->CurrentPartition; + + CONSOLE_SetStatusText(MUIGetString(STRING_PLEASEWAIT)); + + CONSOLE_SetTextXY(6, 8, MUIGetString(STRING_CHOOSE_NEW_EXTENDED_PARTITION)); + + DiskSize = DiskEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector; +#if 0 + if (DiskSize >= 10737418240) /* 10 GB */ + { + DiskSize = DiskSize / 1073741824; + Unit = MUIGetString(STRING_GB); + } + else +#endif + { + DiskSize = DiskSize / 1048576; + if (DiskSize == 0) + DiskSize = 1; + + Unit = MUIGetString(STRING_MB); + } + + if (DiskEntry->DriverName.Length > 0) + { + CONSOLE_PrintTextXY(6, 10, + MUIGetString(STRING_HDINFOPARTCREATE), + DiskSize, + Unit, + DiskEntry->DiskNumber, + DiskEntry->Port, + DiskEntry->Bus, + DiskEntry->Id, + &DiskEntry->DriverName); + } + else + { + CONSOLE_PrintTextXY(6, 10, + MUIGetString(STRING_HDDINFOUNK1), + DiskSize, + Unit, + DiskEntry->DiskNumber, + DiskEntry->Port, + DiskEntry->Bus, + DiskEntry->Id); + } + + CONSOLE_SetTextXY(6, 12, MUIGetString(STRING_HDDSIZE)); + +#if 0 + CONSOLE_PrintTextXY(8, 10, "Maximum size of the new partition is %I64u MB", + PartitionList->CurrentPartition->SectorCount * DiskEntry->BytesPerSector / 1048576); +#endif + + CONSOLE_SetStatusText(MUIGetString(STRING_CREATEPARTITION)); + + PartEntry = PartitionList->CurrentPartition; + while (TRUE) + { + MaxSize = (PartEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector) / 1048576; /* in MBytes (rounded) */ + + if (MaxSize > PARTITION_MAXSIZE) + MaxSize = PARTITION_MAXSIZE; + + ShowPartitionSizeInputBox(12, 14, xScreen - 12, 17, /* left, top, right, bottom */ + MaxSize, InputBuffer, &Quit, &Cancel); + + if (Quit == TRUE) + { + if (ConfirmQuit (Ir) == TRUE) + { + return QUIT_PAGE; + } + } + else if (Cancel == TRUE) + { + return SELECT_PARTITION_PAGE; + } + else + { + PartSize = atoi(InputBuffer); + + if (PartSize < 1) + { + /* Too small */ + continue; + } + + if (PartSize > MaxSize) + { + /* Too large */ + continue; + } + + /* Convert to bytes */ + if (PartSize == MaxSize) + { + /* Use all of the unpartitioned disk space */ + SectorCount = PartEntry->SectorCount.QuadPart; + } + else + { + /* Calculate the sector count from the size in MB */ + SectorCount = PartSize * 1048576 / DiskEntry->BytesPerSector; + + /* But never get larger than the unpartitioned disk space */ + if (SectorCount > PartEntry->SectorCount.QuadPart) + SectorCount = PartEntry->SectorCount.QuadPart; + } + + DPRINT ("Partition size: %I64u bytes\n", PartSize); + + CreateExtendedPartition(PartitionList, + SectorCount); + + return SELECT_PARTITION_PAGE; + } + } + + return CREATE_EXTENDED_PARTITION_PAGE; +} + + +static PAGE_NUMBER +CreateLogicalPartitionPage(PINPUT_RECORD Ir) +{ + PDISKENTRY DiskEntry; + PPARTENTRY PartEntry; + BOOLEAN Quit; + BOOLEAN Cancel; + CHAR InputBuffer[50]; + ULONG MaxSize; + ULONGLONG PartSize; + ULONGLONG DiskSize; + ULONGLONG SectorCount; + PCHAR Unit; + + if (PartitionList == NULL || + PartitionList->CurrentDisk == NULL || + PartitionList->CurrentPartition == NULL) + { + /* FIXME: show an error dialog */ + return QUIT_PAGE; + } + + DiskEntry = PartitionList->CurrentDisk; + PartEntry = PartitionList->CurrentPartition; + + CONSOLE_SetStatusText(MUIGetString(STRING_PLEASEWAIT)); + + CONSOLE_SetTextXY(6, 8, MUIGetString(STRING_CHOOSE_NEW_LOGICAL_PARTITION)); + + DiskSize = DiskEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector; +#if 0 + if (DiskSize >= 10737418240) /* 10 GB */ + { + DiskSize = DiskSize / 1073741824; + Unit = MUIGetString(STRING_GB); + } + else +#endif + { + DiskSize = DiskSize / 1048576; + if (DiskSize == 0) + DiskSize = 1; + + Unit = MUIGetString(STRING_MB); + } + + if (DiskEntry->DriverName.Length > 0) + { + CONSOLE_PrintTextXY(6, 10, + MUIGetString(STRING_HDINFOPARTCREATE), + DiskSize, + Unit, + DiskEntry->DiskNumber, + DiskEntry->Port, + DiskEntry->Bus, + DiskEntry->Id, + &DiskEntry->DriverName); + } + else + { + CONSOLE_PrintTextXY(6, 10, + MUIGetString(STRING_HDDINFOUNK1), + DiskSize, + Unit, + DiskEntry->DiskNumber, + DiskEntry->Port, + DiskEntry->Bus, + DiskEntry->Id); + } + + CONSOLE_SetTextXY(6, 12, MUIGetString(STRING_HDDSIZE)); + +#if 0 + CONSOLE_PrintTextXY(8, 10, "Maximum size of the new partition is %I64u MB", + PartitionList->CurrentPartition->SectorCount * DiskEntry->BytesPerSector / 1048576); +#endif + + CONSOLE_SetStatusText(MUIGetString(STRING_CREATEPARTITION)); + + PartEntry = PartitionList->CurrentPartition; + while (TRUE) + { + MaxSize = (PartEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector) / 1048576; /* in MBytes (rounded) */ + + if (MaxSize > PARTITION_MAXSIZE) + MaxSize = PARTITION_MAXSIZE; + + ShowPartitionSizeInputBox(12, 14, xScreen - 12, 17, /* left, top, right, bottom */ + MaxSize, InputBuffer, &Quit, &Cancel); + + if (Quit == TRUE) + { + if (ConfirmQuit (Ir) == TRUE) + { + return QUIT_PAGE; + } + } + else if (Cancel == TRUE) + { + return SELECT_PARTITION_PAGE; + } + else + { + PartSize = atoi(InputBuffer); + + if (PartSize < 1) + { + /* Too small */ + continue; + } + + if (PartSize > MaxSize) + { + /* Too large */ + continue; + } + + /* Convert to bytes */ + if (PartSize == MaxSize) + { + /* Use all of the unpartitioned disk space */ + SectorCount = PartEntry->SectorCount.QuadPart; + } + else + { + /* Calculate the sector count from the size in MB */ + SectorCount = PartSize * 1048576 / DiskEntry->BytesPerSector; + + /* But never get larger than the unpartitioned disk space */ + if (SectorCount > PartEntry->SectorCount.QuadPart) + SectorCount = PartEntry->SectorCount.QuadPart; + } + + DPRINT("Partition size: %I64u bytes\n", PartSize); + + CreateLogicalPartition(PartitionList, + SectorCount); + + return SELECT_PARTITION_PAGE; + } + } + + return CREATE_LOGICAL_PARTITION_PAGE; } @@ -1970,6 +2325,10 @@ DeletePartitionPage(PINPUT_RECORD Ir) { PartType = "NTFS"; /* FIXME: Not quite correct! */ } + else if (IsContainerPartition(PartEntry->PartitionType)) + { + PartType = MUIGetString(STRING_EXTENDED_PARTITION); + } } PartSize = PartEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector; @@ -3848,8 +4207,16 @@ RunUSetup(VOID) Page = SelectPartitionPage(&Ir); break; - case CREATE_PARTITION_PAGE: - Page = CreatePartitionPage(&Ir); + case CREATE_PRIMARY_PARTITION_PAGE: + Page = CreatePrimaryPartitionPage(&Ir); + break; + + case CREATE_EXTENDED_PARTITION_PAGE: + Page = CreateExtendedPartitionPage(&Ir); + break; + + case CREATE_LOGICAL_PARTITION_PAGE: + Page = CreateLogicalPartitionPage(&Ir); break; case DELETE_PARTITION_PAGE: diff --git a/base/setup/usetup/lang/bg-BG.h b/base/setup/usetup/lang/bg-BG.h index e4be51b6421..80aaaa867d1 100644 --- a/base/setup/usetup/lang/bg-BG.h +++ b/base/setup/usetup/lang/bg-BG.h @@ -828,12 +828,19 @@ static MUI_ENTRY bgBGSelectPartitionEntries[] = { 8, 15, - "\x07 ᭥ C ꧤ .", + "\x07 Press P to create a primary partition.", +// "\x07 ᭥ C ꧤ .", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 ᭥ D ਢ 㢠 .", TEXT_STYLE_NORMAL }, @@ -1288,6 +1295,10 @@ static MUI_ENTRY bgBGRegistryEntries[] = MUI_ERROR bgBGErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "⎑ ꫭ ᫮ \n" @@ -1500,6 +1511,32 @@ MUI_ERROR bgBGErrorEntries[] = " * ᭥ , தꫦ.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1612,13 +1649,23 @@ MUI_STRING bgBGStrings[] = {STRING_PLEASEWAIT, " 砪..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = C = ꧤ F3 = 室"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " ENTER = C = ꧤ F3 = 室"}, + {STRING_INSTALLCREATELOGICAL, + " ENTER = Install L = Create Logical Partition F3 = Quit"}, {STRING_INSTALLDELETEPARTITION, " ENTER = D = ਢ F3 = 室"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, " :"}, {STRING_CHOOSENEWPARTITION, - "ࠫ ꧤ "}, + "You have chosen to create a primary partition on"}, +// "ࠫ ꧤ "}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, + {STRING_CHOOSE_NEW_LOGICAL_PARTITION, + "You have chosen to create a logical partition on"}, {STRING_HDDSIZE, "ꢥ ࠧ ( )."}, {STRING_CREATEPARTITION, @@ -1690,7 +1737,7 @@ MUI_STRING bgBGStrings[] = {STRING_HDINFOPARTEXISTS, " %lu (%I64u %s), =%hu, =%hu, =%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c %-3u %6lu %s"}, + "%c%c %s %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s %lu (=%hu, =%hu, =%hu) %S"}, {STRING_HDDINFOUNK6, @@ -1698,9 +1745,11 @@ MUI_STRING bgBGStrings[] = {STRING_NEWPARTITION, " ꧤ "}, {STRING_UNPSPACE, - " ࠧ। %6lu %s"}, + " %sࠧ। %s %6lu %s"}, {STRING_MAXSIZE, " ( %lu )"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, " (ଠ࠭)"}, {STRING_FORMATUNUSED, diff --git a/base/setup/usetup/lang/cs-CZ.h b/base/setup/usetup/lang/cs-CZ.h index 1bb8dd6e600..9e8071e465c 100644 --- a/base/setup/usetup/lang/cs-CZ.h +++ b/base/setup/usetup/lang/cs-CZ.h @@ -827,12 +827,19 @@ static MUI_ENTRY csCZSelectPartitionEntries[] = { 8, 15, - "\x07 Stisknutm C umonte vytvoen novho oddlu.", + "\x07 Press P to create a primary partition.", +// "\x07 Stisknutm C umonte vytvoen novho oddlu.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 Stisknutm D umonte smazn existujcho oddlu.", TEXT_STYLE_NORMAL }, @@ -1286,6 +1293,10 @@ static MUI_ENTRY csCZRegistryEntries[] = MUI_ERROR csCZErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "ReactOS nen ve vaem potai kompletn nainstalovn.\n" @@ -1496,6 +1507,32 @@ MUI_ERROR csCZErrorEntries[] = " * Pokraujte stisknutm libovoln klvesy.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1608,13 +1645,23 @@ MUI_STRING csCZStrings[] = {STRING_PLEASEWAIT, " ekejte, prosm..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = Instalovat C = Vytvoit oddl F3 = Ukonit"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " ENTER = Instalovat C = Vytvoit oddl F3 = Ukonit"}, + {STRING_INSTALLCREATELOGICAL, + " ENTER = Install L = Create Logical Partition F3 = Quit"}, {STRING_INSTALLDELETEPARTITION, " ENTER = Instalovat D = Odstranit oddl F3 = Ukonit"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "Velikost novho oddlu:"}, {STRING_CHOOSENEWPARTITION, - "Zvolili jste vytvoen novho oddlu na"}, + "You have chosen to create a primary partition on"}, +// "Zvolili jste vytvoen novho oddlu na"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, + {STRING_CHOOSE_NEW_LOGICAL_PARTITION, + "You have chosen to create a logical partition on"}, {STRING_HDDSIZE, "Zadejte velikost novho oddlu v megabajtech."}, {STRING_CREATEPARTITION, @@ -1686,7 +1733,7 @@ MUI_STRING csCZStrings[] = {STRING_HDINFOPARTEXISTS, "na harddisku %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c Typ %-3u %6lu %s"}, + "%c%c %sTyp %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu) na %S"}, {STRING_HDDINFOUNK6, @@ -1694,9 +1741,11 @@ MUI_STRING csCZStrings[] = {STRING_NEWPARTITION, "Instalace vytvoila nov oddl na"}, {STRING_UNPSPACE, - " Msto bez oddl %6lu %s"}, + " %sMsto bez oddl%s %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, "Nov (Nenaformtovan)"}, {STRING_FORMATUNUSED, diff --git a/base/setup/usetup/lang/de-DE.h b/base/setup/usetup/lang/de-DE.h index 731ff05b03f..ab58aae6ab7 100644 --- a/base/setup/usetup/lang/de-DE.h +++ b/base/setup/usetup/lang/de-DE.h @@ -466,7 +466,7 @@ static MUI_ENTRY deDERepairPageEntries[] = "nutzbaren Setups.", TEXT_STYLE_NORMAL }, - { + { 6, 14, "Die Reparaturfunktionen sind noch nicht implementiert.", @@ -814,12 +814,18 @@ static MUI_ENTRY deDESelectPartitionEntries[] = { 8, 15, - "\x07 C erstellt eine neue Partition.", + "\x07 P erstellt eine primre Partition.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 E erstellt eine erweiterte Partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 D lscht eine vorhandene Partition.", TEXT_STYLE_NORMAL }, @@ -909,7 +915,7 @@ static MUI_ENTRY deDEInstallDirectoryEntries[] = "Benutzen Sie die Entf-TASTE, um Zeichen zu lschen.", TEXT_STYLE_NORMAL }, - { + { 6, 17, "Besttigen Sie die Eingabe mit der EINGABETASTE.", @@ -1279,6 +1285,10 @@ static MUI_ENTRY deDERegistryEntries[] = MUI_ERROR deDEErrorEntries[] = { + { + // NOT_AN_ERROR + "Erfolg\n" + }, { //ERROR_NOT_INSTALLED "ReactOS wurde nicht vollstndig auf Ihrem System installiert.\n" @@ -1388,7 +1398,7 @@ MUI_ERROR deDEErrorEntries[] = { //ERROR_UPDATE_DISPLAY_SETTINGS, "Die Registrierungseintrge der Anzeigeeinstellungen\n" - "konnten nicht aktualisiert werden.", + "konnten nicht aktualisiert werden.", "EINGABETASTER = Computer neu starten" }, { @@ -1429,7 +1439,7 @@ MUI_ERROR deDEErrorEntries[] = { //ERROR_COPY_QUEUE, "Die Liste mit den zu kopierenden Dateien\n" - "konnte nicht gefunden werden.\n", + "konnte nicht gefunden werden.\n", "EINGABETASTE = Computer neu starten" }, { @@ -1493,6 +1503,32 @@ MUI_ERROR deDEErrorEntries[] = " * Eine beliebige Taste zum Fortsetzen drcken.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "Sie knnen keine weitere primre oder erweiterte Partition in\n" + "der Partitionstabelle erstellen, weil die Tabelle voll ist.\n" + "\n" + " * Eine beliebige Taste zum Fortsetzen drcken." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "Sie knnen nur eine erweiterte Partition auf jeder Festplatte anlegen.\n" + "\n" + " * Eine beliebige Taste zum Fortsetzen drcken." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "Sie knnen hinter einer erweiterten Partition keine weitere Partition anlegen.\n" + "\n" + " * Eine beliebige Taste zum Fortsetzen drcken." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "Eine erweiterte Partition muss immer die letzte Partition in \n" + "einer Partitionstabelle sein.\n" + "\n" + " * Eine beliebige Taste zum Fortsetzen drcken." + }, { NULL, NULL @@ -1605,13 +1641,21 @@ MUI_STRING deDEStrings[] = {STRING_PLEASEWAIT, " Bitte warten..."}, {STRING_INSTALLCREATEPARTITION, - " EINGABETASTE = Installieren C = Partition erstellen F3 = Installation abbr."}, + " EINGABETASTE = Installieren P = Primre E = Erweiterte F3 = Installation abbr."}, + {STRING_INSTALLCREATELOGICAL, + " EINGABETASTE = Installieren L = Logisches Laufwerk F3 = Installation abbr."}, {STRING_INSTALLDELETEPARTITION, " EINGABETASTE = Installieren D = Partition lschen F3 = Installation abbr."}, + {STRING_DELETEPARTITION, + " D = Partition lschen F3 = Installation abbrechen"}, {STRING_PARTITIONSIZE, "Gre der neuen Partition:"}, {STRING_CHOOSENEWPARTITION, - "Eine neue Partition soll hier erstellt werden:"}, + "Eine primre Partition soll hier erstellt werden:"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "Eine erweiterte Partition soll hier erstellt werden:"}, + {STRING_CHOOSE_NEW_LOGICAL_PARTITION, + "Ein logisches Laufwerk soll hier erstellt werden:"}, {STRING_HDDSIZE, "Bitte geben Sie die Gre der neuen Partition in Megabyte ein."}, {STRING_CREATEPARTITION, @@ -1683,7 +1727,7 @@ MUI_STRING deDEStrings[] = {STRING_HDINFOPARTEXISTS, "auf Festplatte %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c Typ %-3u %6lu %s"}, + "%c%c %sTyp %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s Festplatte %lu (Port=%hu, Bus=%hu, Id=%hu) auf %S"}, {STRING_HDDINFOUNK6, @@ -1691,9 +1735,11 @@ MUI_STRING deDEStrings[] = {STRING_NEWPARTITION, "Setup erstellte eine neue Partition auf"}, {STRING_UNPSPACE, - " Unpartitionierter Speicher %6lu %s"}, + " %sUnpartitionierter Speicher%s %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, + {STRING_EXTENDED_PARTITION, + "Erweiterte Partition"}, {STRING_UNFORMATTED, "Neu (Unformatiert)"}, {STRING_FORMATUNUSED, diff --git a/base/setup/usetup/lang/el-GR.h b/base/setup/usetup/lang/el-GR.h index 91b88d6410c..82d83d4dd4c 100644 --- a/base/setup/usetup/lang/el-GR.h +++ b/base/setup/usetup/lang/el-GR.h @@ -837,12 +837,19 @@ static MUI_ENTRY elGRSelectPartitionEntries[] = { 8, 15, - "\x07 㩫 C 㩜 ⤘ ⨠.", + "\x07 Press P to create a primary partition.", +// "\x07 㩫 C 㩜 ⤘ ⨠.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 㩫 D ᯜ ⤘ ᨮ ⨠.", TEXT_STYLE_NORMAL }, @@ -1308,6 +1315,10 @@ static MUI_ENTRY elGRRegistryEntries[] = MUI_ERROR elGRErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED " ReactOS ៞ \n" @@ -1512,6 +1523,32 @@ MUI_ERROR elGRErrorEntries[] = "Setup could not set the geo id.\n" "ENTER = Reboot computer" }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1624,13 +1661,23 @@ MUI_STRING elGRStrings[] = {STRING_PLEASEWAIT, " ⤜..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = ᩫ C = Partition F3 = 騞"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " ENTER = ᩫ C = Partition F3 = 騞"}, + {STRING_INSTALLCREATELOGICAL, + " ENTER = Install L = Create Logical Partition F3 = Quit"}, {STRING_INSTALLDELETEPARTITION, " ENTER = ᩫ D = Partition F3 = 騞"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "⚜ ⦬ partition:"}, {STRING_CHOOSENEWPARTITION, - "⥘ 㩜 ⤘ partition on"}, + "You have chosen to create a primary partition on"}, +// "⥘ 㩜 ⤘ partition on"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, + {STRING_CHOOSE_NEW_LOGICAL_PARTITION, + "You have chosen to create a logical partition on"}, {STRING_HDDSIZE, " 驫 ⚜ partition megabytes."}, {STRING_CREATEPARTITION, @@ -1702,7 +1749,7 @@ MUI_STRING elGRStrings[] = {STRING_HDINFOPARTEXISTS, " 婡 %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c Type %-3u %6lu %s"}, + "%c%c %sType %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s 婡 %lu (Port=%hu, Bus=%hu, Id=%hu) on %S"}, {STRING_HDDINFOUNK6, @@ -1710,9 +1757,11 @@ MUI_STRING elGRStrings[] = {STRING_NEWPARTITION, " ᩫ 稚 ⤘ partition "}, {STRING_UNPSPACE, - " Unpartitioned space %6lu %s"}, + " %sUnpartitioned space%s %6lu %s"}, {STRING_MAXSIZE, "MB (. %lu MB)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, " ( ⤦)"}, {STRING_FORMATUNUSED, diff --git a/base/setup/usetup/lang/en-US.h b/base/setup/usetup/lang/en-US.h index b89e0e4b93e..7f752f39a8f 100644 --- a/base/setup/usetup/lang/en-US.h +++ b/base/setup/usetup/lang/en-US.h @@ -117,7 +117,7 @@ static MUI_ENTRY enUSWelcomePageEntries[] = { 0, 0, - "ENTER = Continue R = Repair L = Licence F3 = Quit", + "ENTER = Continue R = Repair L = License F3 = Quit", TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { @@ -819,12 +819,18 @@ static MUI_ENTRY enUSSelectPartitionEntries[] = { 8, 15, - "\x07 Press C to create a new partition.", + "\x07 Press P to create a primary partition.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 Press D to delete an existing partition.", TEXT_STYLE_NORMAL }, @@ -1278,6 +1284,10 @@ static MUI_ENTRY enUSRegistryEntries[] = MUI_ERROR enUSErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "ReactOS is not completely installed on your\n" @@ -1488,6 +1498,32 @@ MUI_ERROR enUSErrorEntries[] = " * Press any key to continue.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1599,13 +1635,21 @@ MUI_STRING enUSStrings[] = {STRING_PLEASEWAIT, " Please wait..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = Install C = Create Partition F3 = Quit"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, + {STRING_INSTALLCREATELOGICAL, + " ENTER = Install L = Create Logical Partition F3 = Quit"}, {STRING_INSTALLDELETEPARTITION, " ENTER = Install D = Delete Partition F3 = Quit"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "Size of new partition:"}, {STRING_CHOOSENEWPARTITION, - "You have chosen to create a new partition on"}, + "You have chosen to create a primary partition on"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, + {STRING_CHOOSE_NEW_LOGICAL_PARTITION, + "You have chosen to create a logical partition on"}, {STRING_HDDSIZE, "Please enter the size of the new partition in megabytes."}, {STRING_CREATEPARTITION, @@ -1677,7 +1721,7 @@ MUI_STRING enUSStrings[] = {STRING_HDINFOPARTEXISTS, "on Harddisk %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c Type %-3u %6lu %s"}, + "%c%c %sType %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu) on %S"}, {STRING_HDDINFOUNK6, @@ -1685,9 +1729,11 @@ MUI_STRING enUSStrings[] = {STRING_NEWPARTITION, "Setup created a new partition on"}, {STRING_UNPSPACE, - " Unpartitioned space %6lu %s"}, + " %sUnpartitioned space%s %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, "New (Unformatted)"}, {STRING_FORMATUNUSED, diff --git a/base/setup/usetup/lang/es-ES.h b/base/setup/usetup/lang/es-ES.h index 2089e1e313e..d8bad41c343 100644 --- a/base/setup/usetup/lang/es-ES.h +++ b/base/setup/usetup/lang/es-ES.h @@ -826,12 +826,19 @@ static MUI_ENTRY esESSelectPartitionEntries[] = { 8, 15, - "\x07 Presione C para crear una nueva particin.", + "\x07 Press P to create a primary partition.", +// "\x07 Presione C para crear una nueva particin.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 Presione D para borrar una particin existente.", TEXT_STYLE_NORMAL }, @@ -1285,6 +1292,10 @@ static MUI_ENTRY esESRegistryEntries[] = MUI_ERROR esESErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "ReactOS no est completamente instalado en su\n" @@ -1495,6 +1506,32 @@ MUI_ERROR esESErrorEntries[] = " * Presione una tecla para continuar.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1606,13 +1643,23 @@ MUI_STRING esESStrings[] = {STRING_PLEASEWAIT, " Por favor, espere..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = Instalar C = Crear Particin F3 = Salir"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " ENTER = Instalar C = Crear Particin F3 = Salir"}, + {STRING_INSTALLCREATELOGICAL, + " ENTER = Install L = Create Logical Partition F3 = Quit"}, + {STRING_DELETEPARTITION, + " D = Borrar Particin F3 = Salir"}, {STRING_INSTALLDELETEPARTITION, " ENTER = Instalar D = Borrar Particin F3 = Salir"}, {STRING_PARTITIONSIZE, "Tamao de la nueva particin:"}, {STRING_CHOOSENEWPARTITION, - "Ha elegido crear una nueva particin en"}, + "You have chosen to create a primary partition on"}, +// "Ha elegido crear una nueva particin en"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, + {STRING_CHOOSE_NEW_LOGICAL_PARTITION, + "You have chosen to create a logical partition on"}, {STRING_HDDSIZE, "Por favor, introduzca el tamao de la nueva particin en megabytes."}, {STRING_CREATEPARTITION, @@ -1684,7 +1731,7 @@ MUI_STRING esESStrings[] = {STRING_HDINFOPARTEXISTS, "en Disco duro %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c Tipo %-3u %6lu %s"}, + "%c%c %sTipo %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s Disco duro %lu (Port=%hu, Bus=%hu, Id=%hu) en %S"}, {STRING_HDDINFOUNK6, @@ -1692,9 +1739,11 @@ MUI_STRING esESStrings[] = {STRING_NEWPARTITION, "El instalador a creado una nueva particin en"}, {STRING_UNPSPACE, - " Espacio sin particionar %6lu %s"}, + " %sEspacio sin particionar%s %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, "Nuevo (sin formato)"}, {STRING_FORMATUNUSED, diff --git a/base/setup/usetup/lang/et-EE.h b/base/setup/usetup/lang/et-EE.h index 90dce3ffbd6..e90023d4651 100644 --- a/base/setup/usetup/lang/et-EE.h +++ b/base/setup/usetup/lang/et-EE.h @@ -819,12 +819,19 @@ static MUI_ENTRY etEESelectPartitionEntries[] = { 8, 15, - "\x07 Vajuta C, et teha uus partitsioon.", + "\x07 Press P to create a primary partition.", +// "\x07 Vajuta C, et teha uus partitsioon.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 Vajuta D, et kustutada olemasolev partitsioon.", TEXT_STYLE_NORMAL }, @@ -1278,6 +1285,10 @@ static MUI_ENTRY etEERegistryEntries[] = MUI_ERROR etEEErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "ReactOS ei ole tielikult paigaldatud.\n" @@ -1485,6 +1496,32 @@ MUI_ERROR etEEErrorEntries[] = " * Vajuta suvalist klahvi, et jtkata.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1597,13 +1634,23 @@ MUI_STRING etEEStrings[] = {STRING_PLEASEWAIT, " Palun oota..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = Paigalda C = Loo partitsioon F3 = Vlju"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " ENTER = Paigalda C = Loo partitsioon F3 = Vlju"}, + {STRING_INSTALLCREATELOGICAL, + " ENTER = Install L = Create Logical Partition F3 = Quit"}, {STRING_INSTALLDELETEPARTITION, " ENTER = Paigalda D = Kustuta partitsioon F3 = Vlju"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "Uue partitsiooni suurus:"}, {STRING_CHOOSENEWPARTITION, - "Oled valinud kettale uue partitsiooni loomise"}, + "You have chosen to create a primary partition on"}, +// "Oled valinud kettale uue partitsiooni loomise"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, + {STRING_CHOOSE_NEW_LOGICAL_PARTITION, + "You have chosen to create a logical partition on"}, {STRING_HDDSIZE, "Sisesta uue partitsiooni suurus megabaitides."}, {STRING_CREATEPARTITION, @@ -1675,7 +1722,7 @@ MUI_STRING etEEStrings[] = {STRING_HDINFOPARTEXISTS, "Kvaketas %lu (%I64u %s), Port=%hu, Siin=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c Tp %-3u %6lu %s"}, + "%c%c %sTp %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s Kvaketas %lu (Port=%hu, Siin=%hu, Id=%hu) on %S"}, {STRING_HDDINFOUNK6, @@ -1683,9 +1730,11 @@ MUI_STRING etEEStrings[] = {STRING_NEWPARTITION, "Loodi uus partitsioon"}, {STRING_UNPSPACE, - " Kasutamata kettaruum %6lu %s"}, + " %sKasutamata kettaruum%s %6lu %s"}, {STRING_MAXSIZE, "MB (maks. %lu MB)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, "Uus (Vormindamata)"}, {STRING_FORMATUNUSED, diff --git a/base/setup/usetup/lang/fr-FR.h b/base/setup/usetup/lang/fr-FR.h index 258afe6b439..c4dac549943 100644 --- a/base/setup/usetup/lang/fr-FR.h +++ b/base/setup/usetup/lang/fr-FR.h @@ -42,8 +42,8 @@ static MUI_ENTRY frFRLanguagePageEntries[] = { 0, 0, - " ENTRE = Continuer F3 = Quitter", - TEXT_TYPE_STATUS + "ENTRE = Continuer F3 = Quitter", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -64,7 +64,7 @@ static MUI_ENTRY frFRWelcomePageEntries[] = { 6, 8, - "Bienvenue l'installation de ReactOS", + "Bienvenue dans l'installation de ReactOS", TEXT_STYLE_HIGHLIGHT }, { @@ -118,8 +118,8 @@ static MUI_ENTRY frFRWelcomePageEntries[] = { 0, 0, - " ENTRE = Continuer R = Rparer F3 = Quitter", - TEXT_TYPE_STATUS + "ENTRE = Continuer R = Rparer L = Licence F3 = Quitter", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -140,7 +140,7 @@ static MUI_ENTRY frFRIntroPageEntries[] = { 6, 8, - "L'Installation de ReactOS est en phase de dveloppement.", + "L'installation de ReactOS est en phase de dveloppement.", TEXT_STYLE_NORMAL }, { @@ -218,8 +218,8 @@ static MUI_ENTRY frFRIntroPageEntries[] = { 0, 0, - " ENTRE = Continuer F3 = Quitter", - TEXT_TYPE_STATUS + "ENTRE = Continuer F3 = Quitter", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -342,8 +342,8 @@ static MUI_ENTRY frFRLicensePageEntries[] = { 0, 0, - " ENTRE = Retour", - TEXT_TYPE_STATUS + "ENTRE = Retour", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -435,8 +435,8 @@ static MUI_ENTRY frFRDevicePageEntries[] = { 0, 0, - " ENTRE = Continuer F3 = Quitter", - TEXT_TYPE_STATUS + "ENTRE = Continuer F3 = Quitter", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -457,7 +457,7 @@ static MUI_ENTRY frFRRepairPageEntries[] = { 6, 8, - "L'Installation de ReactOS est en phase de dveloppement.", + "L'installation de ReactOS est en phase de dveloppement.", TEXT_STYLE_NORMAL }, { @@ -505,8 +505,8 @@ static MUI_ENTRY frFRRepairPageEntries[] = { 0, 0, - " CHAP = Page principale ENTRE = Redmarrer", - TEXT_TYPE_STATUS + "CHAP = Page principale ENTRE = Redmarrer", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -556,8 +556,8 @@ static MUI_ENTRY frFRComputerPageEntries[] = { 0, 0, - " ENTRE = Continuer CHAP = Annuler F3 = Quitter", - TEXT_TYPE_STATUS + "ENTRE = Continuer CHAP = Annuler F3 = Quitter", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -596,8 +596,8 @@ static MUI_ENTRY frFRFlushPageEntries[] = { 0, 0, - " Vidage du cache", - TEXT_TYPE_STATUS + "Vidage du cache", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -642,8 +642,8 @@ static MUI_ENTRY frFRQuitPageEntries[] = { 0, 0, - " Veuillez attendre ...", - TEXT_TYPE_STATUS, + "Veuillez attendre ...", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -693,8 +693,8 @@ static MUI_ENTRY frFRDisplayPageEntries[] = { 0, 0, - " ENTRE = Continuer CHAP = Annuler F3 = Quitter", - TEXT_TYPE_STATUS + "ENTRE = Continuer CHAP = Annuler F3 = Quitter", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -739,8 +739,8 @@ static MUI_ENTRY frFRSuccessPageEntries[] = { 0, 0, - " ENTRE = Redmarrer l'ordinateur", - TEXT_TYPE_STATUS + "ENTRE = Redmarrer l'ordinateur", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -785,8 +785,8 @@ static MUI_ENTRY frFRBootPageEntries[] = { 0, 0, - " ENTRE = Continuer F3 = Quitter", - TEXT_TYPE_STATUS + "ENTRE = Continuer F3 = Quitter", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -814,13 +814,13 @@ static MUI_ENTRY frFRSelectPartitionEntries[] = { 6, 9, - "l'espace disque non utilise pour de nouvelles partitions.", + "l'espace disque non utilis pour de nouvelles partitions.", TEXT_STYLE_NORMAL }, { 8, 11, - "\x07 Appuyer sur HAUT ou BAS pour slectionner une entree de la liste.", + "\x07 Appuyer sur HAUT ou BAS pour slectionner une entre de la liste.", TEXT_STYLE_NORMAL }, { @@ -832,20 +832,26 @@ static MUI_ENTRY frFRSelectPartitionEntries[] = { 8, 15, - "\x07 Appuyer sur C pour creer une nouvelle partition.", + "\x07 Appuyer sur P pour crer une partition primaire.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Appuyer sur E pour crer une partition tendue.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 Appuyer sur D pour effacer une partition.", TEXT_STYLE_NORMAL }, { 0, 0, - " Patienter...", - TEXT_TYPE_STATUS + "Patienter...", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -878,8 +884,8 @@ static MUI_ENTRY frFRFormatPartitionEntries[] = { 0, 0, - " ENTRE = Continuer F3 = Quitter", - TEXT_TYPE_STATUS + "ENTRE = Continuer F3 = Quitter", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -930,8 +936,8 @@ static MUI_ENTRY frFRInstallDirectoryEntries[] = { 0, 0, - " ENTRE = Continuer F3 = Quitter", - TEXT_TYPE_STATUS + "ENTRE = Continuer F3 = Quitter", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -1022,8 +1028,8 @@ static MUI_ENTRY frFRBootLoaderEntries[] = { 0, 0, - " ENTRE = Continuer F3 = Quitter", - TEXT_TYPE_STATUS + "ENTRE = Continuer F3 = Quitter", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -1062,7 +1068,7 @@ static MUI_ENTRY frFRKeyboardSettingsEntries[] = { 8, 13, - "\x07 Appuyez sur CHAP pour revenir a la page prcdente sans changer", + "\x07 Appuyez sur CHAP pour revenir la page prcdente sans changer", TEXT_STYLE_NORMAL }, { @@ -1074,8 +1080,8 @@ static MUI_ENTRY frFRKeyboardSettingsEntries[] = { 0, 0, - " ENTRE = Continuer CHAP = Annuler F3 = Quitter", - TEXT_TYPE_STATUS + "ENTRE = Continuer CHAP = Annuler F3 = Quitter", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -1114,7 +1120,7 @@ static MUI_ENTRY frFRLayoutSettingsEntries[] = { 8, 13, - "\x07 Appuyez sur CHAP pour revenir a la page prcdente sans changer", + "\x07 Appuyez sur CHAP pour revenir la page prcdente sans changer", TEXT_STYLE_NORMAL }, { @@ -1126,8 +1132,8 @@ static MUI_ENTRY frFRLayoutSettingsEntries[] = { 0, 0, - " ENTRE = Continuer CHAP = Annuler F3 = Quitter", - TEXT_TYPE_STATUS + "ENTRE = Continuer CHAP = Annuler F3 = Quitter", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -1155,8 +1161,8 @@ static MUI_ENTRY frFRPrepareCopyEntries[] = { 0, 0, - " Prpare la liste de fichiers copier...", - TEXT_TYPE_STATUS + "Prpare la liste de fichiers copier...", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -1202,8 +1208,8 @@ static MUI_ENTRY frFRSelectFSEntries[] = { 0, 0, - " ENTRE = Continuer CHAP = Annuler F3 = Quitter", - TEXT_TYPE_STATUS + "ENTRE = Continuer CHAP = Annuler F3 = Quitter", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { @@ -1249,8 +1255,8 @@ static MUI_ENTRY frFRDeletePartitionEntries[] = { 0, 0, - " D = Supprimer la Partition CHAP = Annuler F3 = Quitter", - TEXT_TYPE_STATUS + "D = Supprimer la Partition CHAP = Annuler F3 = Quitter", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -1277,8 +1283,8 @@ static MUI_ENTRY frFRRegistryEntries[] = { 0, 0, - " En train de crer la base de registres...", - TEXT_TYPE_STATUS + "En train de crer la base de registres...", + TEXT_TYPE_STATUS | TEXT_PADDING_BIG }, { 0, @@ -1291,6 +1297,10 @@ static MUI_ENTRY frFRRegistryEntries[] = MUI_ERROR frFRErrorEntries[] = { + { + // NOT_AN_ERROR + "Succs\n" + }, { //ERROR_NOT_INSTALLED "ReactOS n'est pas compltement install sur votre\n" @@ -1498,9 +1508,35 @@ MUI_ERROR frFRErrorEntries[] = { //ERROR_INSUFFICIENT_DISKSPACE, "Pas assez d'espace libre dans la partition slectionne.\n" - " * Appuyez sur n'importe quelle touche pour continuer.", + " * Appuyer sur une touche pour continuer.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "Impossible de crer une nouvelle partition primaire ou tendue\n" + "sur ce disque parce que sa table de partition est pleine.\n" + "\n" + " * Appuyer sur une touche pour continuer." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "Impossible de crer plus d'une partition tendue par disque.\n" + "\n" + " * Appuyer sur une touche pour continuer." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "Impossible de crer une partition prcdant une partition tendue.\n" + "\n" + " * Appuyer sur une touche pour continuer." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "Une partition tendue doit toujours tre place en dernier\n" + "dans la table de partition.\n" + "\n" + " * Appuyer sur une touche pour continuer." + }, { NULL, NULL @@ -1613,13 +1649,21 @@ MUI_STRING frFRStrings[] = {STRING_PLEASEWAIT, " Veuillez patienter..."}, {STRING_INSTALLCREATEPARTITION, - " ENTRE = Installer C = Crer Partition F3 = Quitter"}, + " ENTRE = Installer P/E = Crer Partition Primaire/tendue F3 = Quitter"}, + {STRING_INSTALLCREATELOGICAL, + " ENTER = Install L = Create Logical Partition F3 = Quit"}, {STRING_INSTALLDELETEPARTITION, " ENTRE = Installer D = Supprimer Partition F3 = Quitter"}, + {STRING_DELETEPARTITION, + " D = Supprimer Partition F3 = Quitter"}, {STRING_PARTITIONSIZE, "Taille de la nouvelle partition :"}, {STRING_CHOOSENEWPARTITION, - "Vous avez choisi de crer une nouvelle partition sur"}, + "Vous avez choisi de crer une partition primaire sur"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "Vous avez choisi de crer une partition tendue sur"}, + {STRING_CHOOSE_NEW_LOGICAL_PARTITION, + "You have chosen to create a logical partition on"}, {STRING_HDDSIZE, "Veuillez entrer la taille de la nouvelle partition en mgaoctets."}, {STRING_CREATEPARTITION, @@ -1691,7 +1735,7 @@ MUI_STRING frFRStrings[] = {STRING_HDINFOPARTEXISTS, "sur Disque dur %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c Type %-3u %6lu %s"}, + "%c%c %sType %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s Disque dur %lu (Port=%hu, Bus=%hu, Id=%hu) sur %S"}, {STRING_HDDINFOUNK6, @@ -1699,9 +1743,11 @@ MUI_STRING frFRStrings[] = {STRING_NEWPARTITION, "Setup a cr une nouvelle partition sur"}, {STRING_UNPSPACE, - " Espace non partitionn %6lu %s"}, + " %sEspace non partitionn%s %6lu %s"}, {STRING_MAXSIZE, "Mo (max. %lu Mo)"}, + {STRING_EXTENDED_PARTITION, + "Partition tendue"}, {STRING_UNFORMATTED, "Nouveau (non format)"}, {STRING_FORMATUNUSED, diff --git a/base/setup/usetup/lang/he-IL.h b/base/setup/usetup/lang/he-IL.h index 9bdc3a8d2b3..b4a3945f232 100644 --- a/base/setup/usetup/lang/he-IL.h +++ b/base/setup/usetup/lang/he-IL.h @@ -820,12 +820,18 @@ static MUI_ENTRY heILSelectPartitionEntries[] = { 8, 15, - "\x07 Press C to create a new partition.", + "\x07 Press P to create a primary partition.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 Press D to delete an existing partition.", TEXT_STYLE_NORMAL }, @@ -1279,6 +1285,10 @@ static MUI_ENTRY heILRegistryEntries[] = MUI_ERROR heILErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "ReactOS is not completely installed on your\n" @@ -1489,6 +1499,32 @@ MUI_ERROR heILErrorEntries[] = " * Press any key to continue.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1600,13 +1636,22 @@ MUI_STRING heILStrings[] = {STRING_PLEASEWAIT, " ..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = C = F3 = "}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " ENTER = C = F3 = "}, + {STRING_INSTALLCREATELOGICAL, + " ENTER = Install L = Create Logical Partition F3 = Quit"}, {STRING_INSTALLDELETEPARTITION, " ENTER = D = F3 = "}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, " :"}, {STRING_CHOOSENEWPARTITION, - "You have chosen to create a new partition on"}, + "You have chosen to create a primary partition on"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, + {STRING_CHOOSE_NEW_LOGICAL_PARTITION, + "You have chosen to create a logical partition on"}, {STRING_HDDSIZE, "Please enter the size of the new partition in megabytes."}, {STRING_CREATEPARTITION, @@ -1678,7 +1723,7 @@ MUI_STRING heILStrings[] = {STRING_HDINFOPARTEXISTS, "on Harddisk %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c Type %-3u %6lu %s"}, + "%c%c %sType %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu) on %S"}, {STRING_HDDINFOUNK6, @@ -1686,9 +1731,11 @@ MUI_STRING heILStrings[] = {STRING_NEWPARTITION, "Setup created a new partition on"}, {STRING_UNPSPACE, - " Unpartitioned space %6lu %s"}, + " %sUnpartitioned space%s %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, "New (Unformatted)"}, {STRING_FORMATUNUSED, diff --git a/base/setup/usetup/lang/it-IT.h b/base/setup/usetup/lang/it-IT.h index 0e4035713c5..e911a748ed1 100644 --- a/base/setup/usetup/lang/it-IT.h +++ b/base/setup/usetup/lang/it-IT.h @@ -820,12 +820,19 @@ static MUI_ENTRY itITSelectPartitionEntries[] = { 8, 15, - "\x07 Premere C per creare una nuova partizione.", + "\x07 Press P to create a primary partition.", +// "\x07 Premere C per creare una nuova partizione.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 Premere D per cancellare una partizione esistente.", TEXT_STYLE_NORMAL }, @@ -1279,6 +1286,10 @@ static MUI_ENTRY itITRegistryEntries[] = MUI_ERROR itITErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "ReactOS non installato completamente nel vostro\n" @@ -1489,6 +1500,32 @@ MUI_ERROR itITErrorEntries[] = " * Premere un tasto qualsiasi per continuare.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1601,13 +1638,23 @@ MUI_STRING itITStrings[] = {STRING_PLEASEWAIT, " Attendere..."}, {STRING_INSTALLCREATEPARTITION, - " INVIO = Installa C = Crea Partizione F3 = Esci"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " INVIO = Installa C = Crea Partizione F3 = Esci"}, + {STRING_INSTALLCREATELOGICAL, + " ENTER = Install L = Create Logical Partition F3 = Quit"}, {STRING_INSTALLDELETEPARTITION, " INVIO = Installa D = Rimuovi Partizione F3 = Esci"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "Dimensione della nuova partizione:"}, {STRING_CHOOSENEWPARTITION, - "Avete scelto di creare una nuova partizione su"}, + "You have chosen to create a primary partition on"}, +// "Avete scelto di creare una nuova partizione su"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, + {STRING_CHOOSE_NEW_LOGICAL_PARTITION, + "You have chosen to create a logical partition on"}, {STRING_HDDSIZE, "Indicare la dimensione della nuova partizione in megabyte."}, {STRING_CREATEPARTITION, @@ -1679,7 +1726,7 @@ MUI_STRING itITStrings[] = {STRING_HDINFOPARTEXISTS, "su Harddisk %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c Tipo %-3u %6lu %s"}, + "%c%c %sTipo %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu) su %S"}, {STRING_HDDINFOUNK6, @@ -1687,7 +1734,7 @@ MUI_STRING itITStrings[] = {STRING_NEWPARTITION, "Setup ha creato una nuova partizione su"}, {STRING_UNPSPACE, - " Spazio non partizionato %6lu %s"}, + " %sSpazio non partizionato%s %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, {STRING_UNFORMATTED, diff --git a/base/setup/usetup/lang/ja-JP.h b/base/setup/usetup/lang/ja-JP.h index be3834f7125..691406625fe 100644 --- a/base/setup/usetup/lang/ja-JP.h +++ b/base/setup/usetup/lang/ja-JP.h @@ -820,12 +820,19 @@ static MUI_ENTRY jaJPSelectPartitionEntries[] = { 8, 15, - "\x07 ׼ ߰è C ޻", + "\x07 Press P to create a primary partition.", +// "\x07 ׼ ߰è C ޻", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 ߰èݦ ޮ D ޻", TEXT_STYLE_NORMAL }, @@ -1279,6 +1286,10 @@ static MUI_ENTRY jaJPRegistryEntries[] = MUI_ERROR jaJPErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "ReactOS ߭ ݾ ݽİ\n" @@ -1489,6 +1500,32 @@ MUI_ERROR jaJPErrorEntries[] = " * Press any key to continue.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1600,13 +1637,23 @@ MUI_STRING jaJPStrings[] = {STRING_PLEASEWAIT, " ޻..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = ݽİ C = ߰è F3 = "}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " ENTER = ݽİ C = ߰è F3 = "}, + {STRING_INSTALLCREATELOGICAL, + " ENTER = Install L = Create Logical Partition F3 = Quit"}, {STRING_INSTALLDELETEPARTITION, " ENTER = ݽİ D = ߰è ޮ F3 = "}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "׼ ߰è :"}, {STRING_CHOOSENEWPARTITION, - "׼ ߰èݦ · Ķ ϼ:"}, + "You have chosen to create a primary partition on"}, +// "׼ ߰èݦ · Ķ ϼ:"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, + {STRING_CHOOSE_NEW_LOGICAL_PARTITION, + "You have chosen to create a logical partition on"}, {STRING_HDDSIZE, "׼ ߰è ަ Ҷ޲ ݲ ƭخ ø޻"}, {STRING_CREATEPARTITION, @@ -1678,7 +1725,7 @@ MUI_STRING jaJPStrings[] = {STRING_HDINFOPARTEXISTS, "on ʰި %lu (%I64u %s), ߰=%hu, ޽=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c ٲ %-3u %6lu %s"}, + "%c%c %sٲ %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s ʰި %lu (߰=%hu, ޽=%hu, Id=%hu) on %S"}, {STRING_HDDINFOUNK6, @@ -1686,9 +1733,11 @@ MUI_STRING jaJPStrings[] = {STRING_NEWPARTITION, "ı ׼ ߰èݦ · ϼ:"}, {STRING_UNPSPACE, - " ݶ ߰ %6lu %s"}, + " %sݶ ߰%s %6lu %s"}, {STRING_MAXSIZE, "MB (޲. %lu MB)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, "ݷ (̫ϯ)"}, {STRING_FORMATUNUSED, diff --git a/base/setup/usetup/lang/lt-LT.h b/base/setup/usetup/lang/lt-LT.h index d6f0c71c18a..7a7b4f746a5 100644 --- a/base/setup/usetup/lang/lt-LT.h +++ b/base/setup/usetup/lang/lt-LT.h @@ -829,12 +829,18 @@ static MUI_ENTRY ltLTSelectPartitionEntries[] = { 8, 15, - "\x07 Press C to create a new partition.", + "\x07 Press P to create a primary partition.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 Press D to delete an existing partition.", TEXT_STYLE_NORMAL }, @@ -1288,6 +1294,10 @@ static MUI_ENTRY ltLTRegistryEntries[] = MUI_ERROR ltLTErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "ReactOS is not completely installed on your\n" @@ -1498,6 +1508,32 @@ MUI_ERROR ltLTErrorEntries[] = " * Press any key to continue.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1610,13 +1646,21 @@ MUI_STRING ltLTStrings[] = {STRING_PLEASEWAIT, " Please wait..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = Install C = Create Partition F3 = Quit"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, + {STRING_INSTALLCREATELOGICAL, + " ENTER = Install L = Create Logical Partition F3 = Quit"}, {STRING_INSTALLDELETEPARTITION, " ENTER = Install D = Delete Partition F3 = Quit"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "Size of new partition:"}, {STRING_CHOOSENEWPARTITION, - "You have chosen to create a new partition on"}, + "You have chosen to create a primary partition on"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, + {STRING_CHOOSE_NEW_LOGICAL_PARTITION, + "You have chosen to create a logical partition on"}, {STRING_HDDSIZE, "Please enter the size of the new partition in megabytes."}, {STRING_CREATEPARTITION, @@ -1688,7 +1732,7 @@ MUI_STRING ltLTStrings[] = {STRING_HDINFOPARTEXISTS, "on Harddisk %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c Type %-3u %6lu %s"}, + "%c%c %sType %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu) on %S"}, {STRING_HDDINFOUNK6, @@ -1696,9 +1740,11 @@ MUI_STRING ltLTStrings[] = {STRING_NEWPARTITION, "Setup created a new partition on"}, {STRING_UNPSPACE, - " Unpartitioned space %6lu %s"}, + " %sUnpartitioned space%s %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, "New (Unformatted)"}, {STRING_FORMATUNUSED, diff --git a/base/setup/usetup/lang/nl-NL.h b/base/setup/usetup/lang/nl-NL.h index f1814a11e58..167e1095b0d 100644 --- a/base/setup/usetup/lang/nl-NL.h +++ b/base/setup/usetup/lang/nl-NL.h @@ -854,12 +854,19 @@ static MUI_ENTRY nlNLSelectPartitionEntries[] = { 8, 15, - "\x07 Druk op C om een nieuwe partitie aan te maken.", + "\x07 Press P to create a primary partition.", +// "\x07 Druk op C om een nieuwe partitie aan te maken.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 Druk op D om een bestaande partitie te verwijderen.", TEXT_STYLE_NORMAL }, @@ -1319,6 +1326,10 @@ static MUI_ENTRY nlNLRegistryEntries[] = MUI_ERROR nlNLErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "ReactOS is niet geheel ge\x8Bnstalleerd op uw\n" @@ -1533,6 +1544,32 @@ MUI_ERROR nlNLErrorEntries[] = " * Druk op een toets om door te gaan.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1645,13 +1682,23 @@ MUI_STRING nlNLStrings[] = {STRING_PLEASEWAIT, " Een ogenblik geduld..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = Installeren C = Partitie aanmaken F3 = Afsluiten"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " ENTER = Installeren C = Partitie aanmaken F3 = Afsluiten"}, + {STRING_INSTALLCREATELOGICAL, + " ENTER = Install L = Create Logical Partition F3 = Quit"}, {STRING_INSTALLDELETEPARTITION, " ENTER = Installeren D = Partitie verwijderen F3 = Afsluiten"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "Grootte nieuwe partitie:"}, {STRING_CHOOSENEWPARTITION, - "U wilt een nieuwe partitie aanmaken op"}, + "You have chosen to create a primary partition on"}, +// "U wilt een nieuwe partitie aanmaken op"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, + {STRING_CHOOSE_NEW_LOGICAL_PARTITION, + "You have chosen to create a logical partition on"}, {STRING_HDDSIZE, "Voert u de grootte van de nieuwe partitie in in megabytes."}, {STRING_CREATEPARTITION, @@ -1723,7 +1770,7 @@ MUI_STRING nlNLStrings[] = {STRING_HDINFOPARTEXISTS, "op Schijf %lu (%I64u %s), Poort=%hu, Bus=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c Type %-3u %6lu %s"}, + "%c%c %sType %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s Schijf %lu (Poort=%hu, Bus=%hu, Id=%hu) op %S"}, {STRING_HDDINFOUNK6, @@ -1731,9 +1778,11 @@ MUI_STRING nlNLStrings[] = {STRING_NEWPARTITION, "Setup heeft een nieuwe partitie aangemaakt op"}, {STRING_UNPSPACE, - " Niet gepartitioneerde ruimte %6lu %s"}, + " %sNiet gepartitioneerde ruimte%s %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, "Nieuw (Ongeformatteerd)"}, {STRING_FORMATUNUSED, diff --git a/base/setup/usetup/lang/pl-PL.h b/base/setup/usetup/lang/pl-PL.h index 2cf3e6f8bfa..3d700c44004 100644 --- a/base/setup/usetup/lang/pl-PL.h +++ b/base/setup/usetup/lang/pl-PL.h @@ -828,12 +828,19 @@ static MUI_ENTRY plPLSelectPartitionEntries[] = { 8, 15, - "\x07 Nacinij C, by stworzy now partycj.", + "\x07 Press P to create a primary partition.", +// "\x07 Nacinij C, by stworzy now partycj.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 Nacinij D, by skasowa istniejc partycj.", TEXT_STYLE_NORMAL }, @@ -1287,6 +1294,10 @@ static MUI_ENTRY plPLRegistryEntries[] = MUI_ERROR plPLErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "ReactOS nie zosta w peni zainstalowany na twoim\n" @@ -1497,6 +1508,32 @@ MUI_ERROR plPLErrorEntries[] = " * Nacinij dowolny klawisz, aby kontynuowa.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1609,13 +1646,23 @@ MUI_STRING plPLStrings[] = {STRING_PLEASEWAIT, " Prosz czeka..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = Instalacja C = Utworzenie Partycji F3 = Wyjcie"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " ENTER = Instalacja C = Utworzenie Partycji F3 = Wyjcie"}, + {STRING_INSTALLCREATELOGICAL, + " ENTER = Install L = Create Logical Partition F3 = Quit"}, {STRING_INSTALLDELETEPARTITION, " ENTER = Instalacja D = Skasowanie Partycji F3 = Wyjcie"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "Rozmiar nowej partycji:"}, {STRING_CHOOSENEWPARTITION, - "Wybrane: utworzenie nowej partycji na"}, + "You have chosen to create a primary partition on"}, +// "Wybrane: utworzenie nowej partycji na"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, + {STRING_CHOOSE_NEW_LOGICAL_PARTITION, + "You have chosen to create a logical partition on"}, {STRING_HDDSIZE, "Prosz wprowadzi rozmiar nowej partycji w megabajtach."}, {STRING_CREATEPARTITION, @@ -1687,7 +1734,7 @@ MUI_STRING plPLStrings[] = {STRING_HDINFOPARTEXISTS, "na Dysku Twardym %lu (%I64u %s), Port=%hu, Szyna=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c 09Typ %-3u %6lu %s"}, + "%c%c %s09Typ %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s Dysk Twardy %lu (Port=%hu, Szyna=%hu, Id=%hu) na %S"}, {STRING_HDDINFOUNK6, @@ -1695,7 +1742,7 @@ MUI_STRING plPLStrings[] = {STRING_NEWPARTITION, "Instalator utworzy now partycj"}, {STRING_UNPSPACE, - " Miejsce poza partycjami %6lu %s"}, + " %sMiejsce poza partycjami%s %6lu %s"}, {STRING_MAXSIZE, "MB (maks. %lu MB)"}, {STRING_UNFORMATTED, diff --git a/base/setup/usetup/lang/pt-BR.h b/base/setup/usetup/lang/pt-BR.h index 1ee9c7f12f9..19ad6719180 100644 --- a/base/setup/usetup/lang/pt-BR.h +++ b/base/setup/usetup/lang/pt-BR.h @@ -838,12 +838,19 @@ static MUI_ENTRY ptBRSelectPartitionEntries[] = { 8, 15, - "\x07 Para criar uma partio no espao no particionado, pressione C.", + "\x07 Press P to create a primary partition.", +// "\x07 Para criar uma partio no espao no particionado, pressione C.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 Para excluir a partio selecionada, pressione D.", TEXT_STYLE_NORMAL }, @@ -1315,6 +1322,10 @@ static MUI_ENTRY ptBRRegistryEntries[] = MUI_ERROR ptBRErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "O ReactOS no est completamente instalado no computador.\n" @@ -1525,6 +1536,32 @@ MUI_ERROR ptBRErrorEntries[] = " * Pressione qualquer tecla para continuar.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1636,13 +1673,23 @@ MUI_STRING ptBRStrings[] = {STRING_PLEASEWAIT, " Por favor, aguarde..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER=Instalar C=Criar partio F3=Sair"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " ENTER=Instalar C=Criar partio F3=Sair"}, + {STRING_INSTALLCREATELOGICAL, + " ENTER = Install L = Create Logical Partition F3 = Quit"}, {STRING_INSTALLDELETEPARTITION, " ENTER=Instalar D=Apagar partio F3=Sair"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "Tamanho da nova partio:"}, {STRING_CHOOSENEWPARTITION, - "Voc solicitou a criao de uma nova partio em"}, + "You have chosen to create a primary partition on"}, +// "Voc solicitou a criao de uma nova partio em"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, + {STRING_CHOOSE_NEW_LOGICAL_PARTITION, + "You have chosen to create a logical partition on"}, {STRING_HDDSIZE, "Por favor, insira o tamanho da nova partio em megabytes (MB)."}, {STRING_CREATEPARTITION, @@ -1714,7 +1761,7 @@ MUI_STRING ptBRStrings[] = {STRING_HDINFOPARTEXISTS, "em Disco %lu (%I64u %s), Porta=%hu, Barramento=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c Tipo %-3u %6lu %s"}, + "%c%c %sTipo %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s Disco %lu (Porta=%hu, Barramento=%hu, Id=%hu) em %S"}, {STRING_HDDINFOUNK6, @@ -1722,9 +1769,11 @@ MUI_STRING ptBRStrings[] = {STRING_NEWPARTITION, "O instalador criou uma nova partio em"}, {STRING_UNPSPACE, - " Espao no particionado %6lu %s"}, + " %sEspao no particionado%s %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, "Novo (sem formato)"}, {STRING_FORMATUNUSED, diff --git a/base/setup/usetup/lang/ro-RO.h b/base/setup/usetup/lang/ro-RO.h index 38dee78cff5..fce9d70af8e 100644 --- a/base/setup/usetup/lang/ro-RO.h +++ b/base/setup/usetup/lang/ro-RO.h @@ -881,12 +881,19 @@ static MUI_ENTRY roROSelectPartitionEntries[] = { 8, 15, - "\x07 Tastai C pentru a crea o nou partiie.", + "\x07 Press P to create a primary partition.", +// "\x07 Tastai C pentru a crea o nou partiie.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 Tastai D pentru a terge o partiie existent.", TEXT_STYLE_NORMAL }, @@ -1340,6 +1347,10 @@ static MUI_ENTRY roRORegistryEntries[] = MUI_ERROR roROErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "ReactOS nu a fost instalat complet n calculatorul\n" @@ -1566,6 +1577,32 @@ MUI_ERROR roROErrorEntries[] = " * Tastai pentru a continua.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1677,13 +1714,23 @@ MUI_STRING roROStrings[] = {STRING_PLEASEWAIT, " Ateptai..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = Instalare C = Creare partiie F3 = Ieire"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " ENTER = Instalare C = Creare partiie F3 = Ieire"}, + {STRING_INSTALLCREATELOGICAL, + " ENTER = Install L = Create Logical Partition F3 = Quit"}, {STRING_INSTALLDELETEPARTITION, " ENTER = Instalare D = tergere partiie F3 = Ieire"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "Mrimea noii partiii:"}, {STRING_CHOOSENEWPARTITION, - "Ai ales crearea unei noi partiii pe"}, + "You have chosen to create a primary partition on"}, +// "Ai ales crearea unei noi partiii pe"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, + {STRING_CHOOSE_NEW_LOGICAL_PARTITION, + "You have chosen to create a logical partition on"}, {STRING_HDDSIZE, "Introducei mrimea noii partiii n megaoctei."}, {STRING_CREATEPARTITION, @@ -1755,7 +1802,7 @@ MUI_STRING roROStrings[] = {STRING_HDINFOPARTEXISTS, "de pe Discul %lu (%I64u %s), Port=%hu, Magistrala=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c Tip %-3u %6lu %s"}, + "%c%c %sTip %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s Discul %lu (Port=%hu, Magistrala=%hu, Id=%hu) de tip %S"}, {STRING_HDDINFOUNK6, @@ -1763,9 +1810,11 @@ MUI_STRING roROStrings[] = {STRING_NEWPARTITION, "O nou partiie a fost creat n"}, {STRING_UNPSPACE, - " Spaiu nepartiionat %6lu %s"}, + " %sSpaiu nepartiionat%s %6lu %s"}, {STRING_MAXSIZE, "Mo (max. %lu Mo)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, "Part. nou (neformatat)"}, {STRING_FORMATUNUSED, diff --git a/base/setup/usetup/lang/ru-RU.h b/base/setup/usetup/lang/ru-RU.h index bbfd631b414..d8385038bd2 100644 --- a/base/setup/usetup/lang/ru-RU.h +++ b/base/setup/usetup/lang/ru-RU.h @@ -820,12 +820,19 @@ static MUI_ENTRY ruRUSelectPartitionEntries[] = { 8, 15, - "\x07 C ᮧ ࠧ.", + "\x07 Press P to create a primary partition.", +// "\x07 C ᮧ ࠧ.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 D 㤠 饣 ࠧ.", TEXT_STYLE_NORMAL }, @@ -1279,6 +1286,10 @@ static MUI_ENTRY ruRURegistryEntries[] = MUI_ERROR ruRUErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "ReactOS ⠭ \n" @@ -1489,6 +1500,32 @@ MUI_ERROR ruRUErrorEntries[] = " * Press any key to continue.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1601,13 +1638,23 @@ MUI_STRING ruRUStrings[] = {STRING_PLEASEWAIT, " , ..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = ⠭ C = ࠧ F3 = 室"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " ENTER = ⠭ C = ࠧ F3 = 室"}, + {STRING_INSTALLCREATELOGICAL, + " ENTER = Install L = Create Logical Partition F3 = Quit"}, {STRING_INSTALLDELETEPARTITION, " ENTER = ⠭ D = ࠧ F3 = 室"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, " ࠧ:"}, {STRING_CHOOSENEWPARTITION, - " ᮧ ࠧ "}, + "You have chosen to create a primary partition on"}, +// " ᮧ ࠧ "}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, + {STRING_CHOOSE_NEW_LOGICAL_PARTITION, + "You have chosen to create a logical partition on"}, {STRING_HDDSIZE, ", ࠧ ࠧ ."}, {STRING_CREATEPARTITION, @@ -1679,7 +1726,7 @@ MUI_STRING ruRUStrings[] = {STRING_HDINFOPARTEXISTS, " ⪮ ᪥ %lu (%I64u %s), =%hu, =%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c %-3u %6lu %s"}, + "%c%c %s %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s ⪨ %lu (=%hu, =%hu, Id=%hu) %S"}, {STRING_HDDINFOUNK6, @@ -1687,9 +1734,11 @@ MUI_STRING ruRUStrings[] = {STRING_NEWPARTITION, "ணࠬ ⠭ ᮧ ࠧ :"}, {STRING_UNPSPACE, - " ࠧ祭 ࠭⢮ %6lu %s"}, + " %sࠧ祭 ࠭⢮%s %6lu %s"}, {STRING_MAXSIZE, " (. %lu )"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, " (ଠ஢)"}, {STRING_FORMATUNUSED, diff --git a/base/setup/usetup/lang/sk-SK.h b/base/setup/usetup/lang/sk-SK.h index 6c7bf3c1504..1373b270101 100644 --- a/base/setup/usetup/lang/sk-SK.h +++ b/base/setup/usetup/lang/sk-SK.h @@ -827,12 +827,19 @@ static MUI_ENTRY skSKSelectPartitionEntries[] = { 8, 15, - "\x07 Stlate C pre vytvorenie novej oblasti.", + "\x07 Press P to create a primary partition.", +// "\x07 Stlate C pre vytvorenie novej oblasti.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 Stlate D pre vymazanie existujcej oblasti.", TEXT_STYLE_NORMAL }, @@ -1286,6 +1293,10 @@ static MUI_ENTRY skSKRegistryEntries[] = MUI_ERROR skSKErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "Systm ReactOS nie je kompletne naintalovan na Vaom\n" @@ -1499,6 +1510,32 @@ MUI_ERROR skSKErrorEntries[] = " * Pokraujte stlaenm ubovonho klvesu.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1611,13 +1648,23 @@ MUI_STRING skSKStrings[] = {STRING_PLEASEWAIT, " Pokajte, prosm ..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = Intalova C = Vytvori oblas F3 = Skoni"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " ENTER = Intalova C = Vytvori oblas F3 = Skoni"}, + {STRING_INSTALLCREATELOGICAL, + " ENTER = Install L = Create Logical Partition F3 = Quit"}, {STRING_INSTALLDELETEPARTITION, " ENTER = Intalova D = Odstrni oblas F3 = Skoni"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "Vekos novej oblasti:"}, {STRING_CHOOSENEWPARTITION, - "Zvolili ste vytvorenie novej oblasti na"}, + "You have chosen to create a primary partition on"}, +// "Zvolili ste vytvorenie novej oblasti na"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, + {STRING_CHOOSE_NEW_LOGICAL_PARTITION, + "You have chosen to create a logical partition on"}, {STRING_HDDSIZE, "Zadajte, prosm, vekos novej oblasti v megabajtoch."}, {STRING_CREATEPARTITION, @@ -1689,7 +1736,7 @@ MUI_STRING skSKStrings[] = {STRING_HDINFOPARTEXISTS, "na pevnom disku %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c typ %-3u %6lu %s"}, + "%c%c %styp %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s pevn disk %lu (Port=%hu, Bus=%hu, Id=%hu) na %S"}, {STRING_HDDINFOUNK6, @@ -1697,9 +1744,11 @@ MUI_STRING skSKStrings[] = {STRING_NEWPARTITION, "Intaltor vytvoril nov oblas na"}, {STRING_UNPSPACE, - " Miesto bez oblast %6lu %s"}, + " %sMiesto bez oblast%s %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, "Nov (Nenaformtovan)"}, {STRING_FORMATUNUSED, diff --git a/base/setup/usetup/lang/sq-AL.h b/base/setup/usetup/lang/sq-AL.h index f82c4a68b47..906fd89e5f7 100644 --- a/base/setup/usetup/lang/sq-AL.h +++ b/base/setup/usetup/lang/sq-AL.h @@ -823,12 +823,19 @@ static MUI_ENTRY sqALSelectPartitionEntries[] = { 8, 15, - "\x07 Kiko C pr t krijuar nj particion t ri.", + "\x07 Press P to create a primary partition.", +// "\x07 Kiko C pr t krijuar nj particion t ri.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 Kliko D pr t fshir nj particion ekzistues.", TEXT_STYLE_NORMAL }, @@ -1282,6 +1289,10 @@ static MUI_ENTRY sqALRegistryEntries[] = MUI_ERROR sqALErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "ReactOS nuk shte instaluar plotesisht ne kompjuterin\n" @@ -1492,6 +1503,32 @@ MUI_ERROR sqALErrorEntries[] = " * Shtypni nj tast cfardo pr t vazhduar.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1603,13 +1640,23 @@ MUI_STRING sqALStrings[] = {STRING_PLEASEWAIT, " Ju lutem prisni..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = Instalo C = Krijo Particion F3 = Dil"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " ENTER = Instalo C = Krijo Particion F3 = Dil"}, + {STRING_INSTALLCREATELOGICAL, + " ENTER = Install L = Create Logical Partition F3 = Quit"}, {STRING_INSTALLDELETEPARTITION, " ENTER = Instalo D = Fshi Particion F3 = Dil"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "Madhsia e particionit t ri:"}, {STRING_CHOOSENEWPARTITION, +// "You have chosen to create a primary partition on"}, "Ju keni zgjedhur pr t krijuar nj ndarje t re n"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, + {STRING_CHOOSE_NEW_LOGICAL_PARTITION, + "You have chosen to create a logical partition on"}, {STRING_HDDSIZE, "Ju lutem, jepini madhsin e particionit t ri n megabajt."}, {STRING_CREATEPARTITION, @@ -1681,7 +1728,7 @@ MUI_STRING sqALStrings[] = {STRING_HDINFOPARTEXISTS, "on Harddisku %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c Tipi %-3u %6lu %s"}, + "%c%c %sTipi %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s Harddisku %lu (Port=%hu, Bus=%hu, Id=%hu) on %S"}, {STRING_HDDINFOUNK6, @@ -1689,9 +1736,11 @@ MUI_STRING sqALStrings[] = {STRING_NEWPARTITION, "Instalimi krijoj nj particion t ri n"}, {STRING_UNPSPACE, - " Hapsire e papjesesezuar %6lu %s"}, + " %sHapsire e papjesesezuar%s %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, "I ri (papjesesezuar)"}, {STRING_FORMATUNUSED, diff --git a/base/setup/usetup/lang/sv-SE.h b/base/setup/usetup/lang/sv-SE.h index c0f8c13352a..c9101b628a8 100644 --- a/base/setup/usetup/lang/sv-SE.h +++ b/base/setup/usetup/lang/sv-SE.h @@ -826,12 +826,19 @@ static MUI_ENTRY svSESelectPartitionEntries[] = { 8, 15, - "\x07 Tryck C fr att skapa en ny partition.", + "\x07 Press P to create a primary partition.", +// "\x07 Tryck C fr att skapa en ny partition.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 Tryck D fr att ta bort en befintlig partititon.", TEXT_STYLE_NORMAL }, @@ -1285,6 +1292,10 @@ static MUI_ENTRY svSERegistryEntries[] = MUI_ERROR svSEErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "ReactOS installerades inte fullstndigt p din\n" @@ -1495,6 +1506,32 @@ MUI_ERROR svSEErrorEntries[] = " * Tryck valfri tangent fr att fortstta.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1606,13 +1643,23 @@ MUI_STRING svSEStrings[] = {STRING_PLEASEWAIT, " Var vnlig vnta..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = Installera C = Skapa Partition F3 = Avsluta"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " ENTER = Installera C = Skapa Partition F3 = Avsluta"}, + {STRING_INSTALLCREATELOGICAL, + " ENTER = Install L = Create Logical Partition F3 = Quit"}, {STRING_INSTALLDELETEPARTITION, " ENTER = Installera D = Ta bort Partition F3 = Avsluta"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "Storlek p den nya partitionen:"}, {STRING_CHOOSENEWPARTITION, - "Du har valt att skapa en ny partiton p"}, + "You have chosen to create a primary partition on"}, +// "Du har valt att skapa en ny partiton p"}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, + {STRING_CHOOSE_NEW_LOGICAL_PARTITION, + "You have chosen to create a logical partition on"}, {STRING_HDDSIZE, "Vnligen skriv in storleken av den nya partitionen i megabytes."}, {STRING_CREATEPARTITION, @@ -1684,7 +1731,7 @@ MUI_STRING svSEStrings[] = {STRING_HDINFOPARTEXISTS, "p Hrddisk %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c Typ %-3u %6lu %s"}, + "%c%c %sTyp %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s Hrddisk %lu (Port=%hu, Bus=%hu, Id=%hu) p %S"}, {STRING_HDDINFOUNK6, @@ -1692,9 +1739,11 @@ MUI_STRING svSEStrings[] = {STRING_NEWPARTITION, "Setup skapade en ny partition p"}, {STRING_UNPSPACE, - " Opartitionerat utrymme %6lu %s"}, + " %sOpartitionerat utrymme%s %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, "Ny (Oformaterad)"}, {STRING_FORMATUNUSED, diff --git a/base/setup/usetup/lang/tr-TR.h b/base/setup/usetup/lang/tr-TR.h index 415329708a1..47b4d812869 100644 --- a/base/setup/usetup/lang/tr-TR.h +++ b/base/setup/usetup/lang/tr-TR.h @@ -807,12 +807,19 @@ static MUI_ENTRY trTRSelectPartitionEntries[] = { 8, 15, - "\x07 Seili boluktan yeni bir blm oluturmak iin C dmesine basnz.", + "\x07 Press P to create a primary partition.", +// "\x07 Seili boluktan yeni bir blm oluturmak iin C dmesine basnz.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 Seili blm silmek iin D dmesine basnz.", TEXT_STYLE_NORMAL }, @@ -1254,6 +1261,10 @@ static MUI_ENTRY trTRRegistryEntries[] = MUI_ERROR trTRErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "ReactOS, bilgisayara btnyle kurulmad.\n" @@ -1463,6 +1474,32 @@ MUI_ERROR trTRErrorEntries[] = " * Srdrmek iin bir dmeye basnz.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1574,13 +1611,23 @@ MUI_STRING trTRStrings[] = {STRING_PLEASEWAIT, " Ltfen bekleyiniz..."}, {STRING_INSTALLCREATEPARTITION, - " Giri = Kur C = Blm Olutur F3 = k"}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " Giri = Kur C = Blm Olutur F3 = k"}, + {STRING_INSTALLCREATELOGICAL, + " ENTER = Install L = Create Logical Partition F3 = Quit"}, {STRING_INSTALLDELETEPARTITION, " Giri = Kur D = Blm Sil F3 = k"}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "Bykl giriniz:"}, {STRING_CHOOSENEWPARTITION, - "Yeni bir blm oluturmay setiniz."}, + "You have chosen to create a primary partition on"}, +// "Yeni bir blm oluturmay setiniz."}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, + {STRING_CHOOSE_NEW_LOGICAL_PARTITION, + "You have chosen to create a logical partition on"}, {STRING_HDDSIZE, "Oluturulacak blmn bykln megaoklu olarak giriniz."}, {STRING_CREATEPARTITION, @@ -1652,7 +1699,7 @@ MUI_STRING trTRStrings[] = {STRING_HDINFOPARTEXISTS, "zerinde: Disk %lu (%I64u %s), Giri=%hu, Veri Yolu=%hu, Kimlik=%hu, %wZ zerinde."}, {STRING_HDDINFOUNK5, - "%c%c Tr %-3u %6lu %s"}, + "%c%c %sTr %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s Disk %lu (Giri=%hu, Veri Yolu=%hu, Kimlik=%hu), %S zerinde"}, {STRING_HDDINFOUNK6, @@ -1660,9 +1707,11 @@ MUI_STRING trTRStrings[] = {STRING_NEWPARTITION, "Kur, u blm oluturdu:"}, {STRING_UNPSPACE, - " Kullanlmayan Boluk %6lu %s"}, + " %sKullanlmayan Boluk%s %6lu %s"}, {STRING_MAXSIZE, "MB (En ok %lu MB)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, "Yeni (Biimlendirilmemi)"}, {STRING_FORMATUNUSED, diff --git a/base/setup/usetup/lang/uk-UA.h b/base/setup/usetup/lang/uk-UA.h index 10231d1448b..aa723b0308b 100644 --- a/base/setup/usetup/lang/uk-UA.h +++ b/base/setup/usetup/lang/uk-UA.h @@ -825,12 +825,19 @@ static MUI_ENTRY ukUASelectPartitionEntries[] = { 8, 15, - "\x07 i C 鮡 ⢮ ஧i.", + "\x07 Press P to create a primary partition.", +// "\x07 i C 鮡 ⢮ ஧i.", TEXT_STYLE_NORMAL }, { 8, 17, + "\x07 Press E to create an extended partition.", + TEXT_STYLE_NORMAL + }, + { + 8, + 19, "\x07 i D 鮡 i稩 ஧i.", TEXT_STYLE_NORMAL }, @@ -1284,6 +1291,10 @@ static MUI_ENTRY ukUARegistryEntries[] = MUI_ERROR ukUAErrorEntries[] = { + { + // NOT_AN_ERROR + "Success\n" + }, { //ERROR_NOT_INSTALLED "ReactOS i ⠭ \n" @@ -1495,6 +1506,32 @@ MUI_ERROR ukUAErrorEntries[] = " * i - i த.", NULL }, + { + //ERROR_PARTITION_TABLE_FULL, + "You can not create a new primary or extended partition in the\n" + "partition table of this disk because the partition table is full.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_ONLY_ONE_EXTENDED, + "You can not create more than one extended partition per disk.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_NOT_BEHIND_EXTENDED, + "You can not create a partition behind an extended partition.\n" + "\n" + " * Press any key to continue." + }, + { + //ERROR_EXTENDED_NOT_LAST, + "An extended partition must always be the last\n" + "partition in a partition table.\n" + "\n" + " * Press any key to continue." + }, { NULL, NULL @@ -1606,13 +1643,23 @@ MUI_STRING ukUAStrings[] = {STRING_PLEASEWAIT, " -᪠, 祪..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = ⠭ C = ⢮ i F3 = "}, + " ENTER = Install P = Create Primary E = Create Extended F3 = Quit"}, +// " ENTER = ⠭ C = ⢮ i F3 = "}, + {STRING_INSTALLCREATELOGICAL, + " ENTER = Install L = Create Logical Partition F3 = Quit"}, {STRING_INSTALLDELETEPARTITION, " ENTER = ⠭ D = i F3 = "}, + {STRING_DELETEPARTITION, + " D = Delete Partition F3 = Quit"}, {STRING_PARTITIONSIZE, "i ஧i:"}, {STRING_CHOOSENEWPARTITION, - " ⢮ ஧i "}, + "You have chosen to create a primary partition on"}, +// " ⢮ ஧i "}, + {STRING_CHOOSE_NEW_EXTENDED_PARTITION, + "You have chosen to create an extended partition on"}, + {STRING_CHOOSE_NEW_LOGICAL_PARTITION, + "You have chosen to create a logical partition on"}, {STRING_HDDSIZE, "-᪠, i ஧i ஧i ."}, {STRING_CREATEPARTITION, @@ -1684,7 +1731,7 @@ MUI_STRING ukUAStrings[] = {STRING_HDINFOPARTEXISTS, " ⪮ %lu (%I64u %s), =%hu, =%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c Type %-3u %6lu %s"}, + "%c%c %sType %-3u%s %6lu %s"}, {STRING_HDINFOPARTSELECT, "%6lu %s ⪨ %lu (=%hu, =%hu, Id=%hu) on %S"}, {STRING_HDDINFOUNK6, @@ -1692,9 +1739,11 @@ MUI_STRING ukUAStrings[] = {STRING_NEWPARTITION, "⠭ ⢮ਢ ஧i "}, {STRING_UNPSPACE, - " ஧i祭 %6lu %s"}, + " %s஧i祭 %s %6lu %s"}, {STRING_MAXSIZE, "MB (. %lu MB)"}, + {STRING_EXTENDED_PARTITION, + "Extended Partition"}, {STRING_UNFORMATTED, " (ଠ⮢)"}, {STRING_FORMATUNUSED, diff --git a/base/setup/usetup/mui.h b/base/setup/usetup/mui.h index bf35835f792..d8b0f1bf289 100644 --- a/base/setup/usetup/mui.h +++ b/base/setup/usetup/mui.h @@ -99,9 +99,13 @@ MUIGetString( #define STRING_PLEASEWAIT 1 #define STRING_INSTALLCREATEPARTITION 2 +#define STRING_INSTALLCREATELOGICAL 60 #define STRING_INSTALLDELETEPARTITION 3 +#define STRING_DELETEPARTITION 59 #define STRING_PARTITIONSIZE 4 #define STRING_CHOOSENEWPARTITION 5 +#define STRING_CHOOSE_NEW_EXTENDED_PARTITION 57 +#define STRING_CHOOSE_NEW_LOGICAL_PARTITION 61 #define STRING_HDDSIZE 6 #define STRING_CREATEPARTITION 7 #define STRING_PARTFORMAT 8 @@ -144,6 +148,7 @@ MUIGetString( #define STRING_UNPSPACE 48 #define STRING_MAXSIZE 49 #define STRING_UNFORMATTED 50 +#define STRING_EXTENDED_PARTITION 58 #define STRING_FORMATUNUSED 51 #define STRING_FORMATUNKNOWN 52 #define STRING_KB 53 diff --git a/base/setup/usetup/partlist.c b/base/setup/usetup/partlist.c index 3312e217c76..0e28213e995 100644 --- a/base/setup/usetup/partlist.c +++ b/base/setup/usetup/partlist.c @@ -520,15 +520,19 @@ EnumerateBiosDiskEntries( static VOID -AddPrimaryPartitionToDisk( +AddPartitionToDisk( ULONG DiskNumber, PDISKENTRY DiskEntry, - ULONG PartitionIndex) + ULONG PartitionIndex, + BOOLEAN LogicalPartition) { PPARTITION_INFORMATION PartitionInfo; PPARTENTRY PartEntry; PartitionInfo = &DiskEntry->LayoutBuffer->PartitionEntry[PartitionIndex]; + if (PartitionInfo->PartitionType == 0 || + (LogicalPartition == TRUE && IsContainerPartition(PartitionInfo->PartitionType))) + return; PartEntry = RtlAllocateHeap(ProcessHeap, HEAP_ZERO_MEMORY, @@ -545,6 +549,7 @@ AddPrimaryPartitionToDisk( PartEntry->PartitionType = PartitionInfo->PartitionType; PartEntry->HiddenSectors = PartitionInfo->HiddenSectors; + PartEntry->LogicalPartition = LogicalPartition; PartEntry->IsPartitioned = TRUE; PartEntry->PartitionNumber = PartitionInfo->PartitionNumber; PartEntry->PartitionIndex = PartitionIndex; @@ -552,6 +557,9 @@ AddPrimaryPartitionToDisk( if (IsContainerPartition(PartEntry->PartitionType)) { PartEntry->FormatState = Unformatted; + + if (LogicalPartition == FALSE && DiskEntry->ExtendedPartition == NULL) + DiskEntry->ExtendedPartition = PartEntry; } else if ((PartEntry->PartitionType == PARTITION_FAT_12) || (PartEntry->PartitionType == PARTITION_FAT_16) || @@ -609,8 +617,12 @@ AddPrimaryPartitionToDisk( PartEntry->FormatState = UnknownFormat; } - InsertTailList(&DiskEntry->PrimaryPartListHead, - &PartEntry->ListEntry); + if (LogicalPartition) + InsertTailList(&DiskEntry->LogicalPartListHead, + &PartEntry->ListEntry); + else + InsertTailList(&DiskEntry->PrimaryPartListHead, + &PartEntry->ListEntry); } @@ -741,6 +753,125 @@ DPRINT1("Total Sectors: %I64u\n", NewPartEntry->SectorCount.QuadPart); } } + if (DiskEntry->ExtendedPartition != NULL) + { + if (IsListEmpty(&DiskEntry->LogicalPartListHead)) + { + DPRINT1("No logical partition!\n"); + + /* Create a partition table entry that represents the empty extended partition */ + NewPartEntry = RtlAllocateHeap(ProcessHeap, + HEAP_ZERO_MEMORY, + sizeof(PARTENTRY)); + if (NewPartEntry == NULL) + return; + + NewPartEntry->DiskEntry = DiskEntry; + NewPartEntry->LogicalPartition = TRUE; + + NewPartEntry->IsPartitioned = FALSE; + NewPartEntry->StartSector.QuadPart = DiskEntry->ExtendedPartition->StartSector.QuadPart + (ULONGLONG)DiskEntry->SectorsPerTrack; + NewPartEntry->SectorCount.QuadPart = DiskEntry->ExtendedPartition->SectorCount.QuadPart - (ULONGLONG)DiskEntry->SectorsPerTrack; + + DPRINT1("First Sector: %I64u\n", NewPartEntry->StartSector.QuadPart); + DPRINT1("Last Sector: %I64u\n", NewPartEntry->StartSector.QuadPart + NewPartEntry->SectorCount.QuadPart - 1); + DPRINT1("Total Sectors: %I64u\n", NewPartEntry->SectorCount.QuadPart); + + NewPartEntry->FormatState = Unformatted; + + InsertTailList(&DiskEntry->LogicalPartListHead, + &NewPartEntry->ListEntry); + + return; + } + + /* Start partition at head 1, cylinder 0 */ + LastStartSector = DiskEntry->ExtendedPartition->StartSector.QuadPart + (ULONGLONG)DiskEntry->SectorsPerTrack; + LastSectorCount = 0ULL; + LastUnusedSectorCount = 0ULL; + + Entry = DiskEntry->LogicalPartListHead.Flink; + while (Entry != &DiskEntry->LogicalPartListHead) + { + PartEntry = CONTAINING_RECORD(Entry, PARTENTRY, ListEntry); + + if (PartEntry->PartitionType != PARTITION_ENTRY_UNUSED || + PartEntry->SectorCount.QuadPart != 0ULL) + { + LastUnusedSectorCount = + PartEntry->StartSector.QuadPart - (ULONGLONG)DiskEntry->SectorsPerTrack - (LastStartSector + LastSectorCount); + + if ((PartEntry->StartSector.QuadPart - (ULONGLONG)DiskEntry->SectorsPerTrack) > (LastStartSector + LastSectorCount) && + LastUnusedSectorCount >= (ULONGLONG)DiskEntry->SectorAlignment) + { + DPRINT("Unpartitioned disk space %I64u sectors\n", LastUnusedSectorCount); + + NewPartEntry = RtlAllocateHeap(ProcessHeap, + HEAP_ZERO_MEMORY, + sizeof(PARTENTRY)); + if (NewPartEntry == NULL) + return; + + NewPartEntry->DiskEntry = DiskEntry; + NewPartEntry->LogicalPartition = TRUE; + + NewPartEntry->IsPartitioned = FALSE; + NewPartEntry->StartSector.QuadPart = LastStartSector + LastSectorCount; + NewPartEntry->SectorCount.QuadPart = Align(NewPartEntry->StartSector.QuadPart + LastUnusedSectorCount, DiskEntry->SectorAlignment) - + NewPartEntry->StartSector.QuadPart; +DPRINT1("First Sector: %I64u\n", NewPartEntry->StartSector.QuadPart); +DPRINT1("Last Sector: %I64u\n", NewPartEntry->StartSector.QuadPart + NewPartEntry->SectorCount.QuadPart - 1); +DPRINT1("Total Sectors: %I64u\n", NewPartEntry->SectorCount.QuadPart); + + NewPartEntry->FormatState = Unformatted; + + /* Insert the table into the list */ + InsertTailList(&PartEntry->ListEntry, + &NewPartEntry->ListEntry); + } + + LastStartSector = PartEntry->StartSector.QuadPart; + LastSectorCount = PartEntry->SectorCount.QuadPart; + } + + Entry = Entry->Flink; + } + + /* Check for trailing unpartitioned disk space */ + if ((LastStartSector + LastSectorCount) < DiskEntry->ExtendedPartition->StartSector.QuadPart + DiskEntry->ExtendedPartition->SectorCount.QuadPart) + { + LastUnusedSectorCount = Align(DiskEntry->ExtendedPartition->StartSector.QuadPart + DiskEntry->ExtendedPartition->SectorCount.QuadPart - (LastStartSector + LastSectorCount), DiskEntry->SectorAlignment); + + if (LastUnusedSectorCount >= (ULONGLONG)DiskEntry->SectorAlignment) + { + DPRINT("Unpartitioned disk space: %I64u sectors\n", LastUnusedSectorCount); + + NewPartEntry = RtlAllocateHeap(ProcessHeap, + HEAP_ZERO_MEMORY, + sizeof(PARTENTRY)); + if (NewPartEntry == NULL) + return; + + NewPartEntry->DiskEntry = DiskEntry; + NewPartEntry->LogicalPartition = TRUE; + + NewPartEntry->IsPartitioned = FALSE; + NewPartEntry->StartSector.QuadPart = LastStartSector + LastSectorCount; + NewPartEntry->SectorCount.QuadPart = Align(NewPartEntry->StartSector.QuadPart + LastUnusedSectorCount, DiskEntry->SectorAlignment) - + NewPartEntry->StartSector.QuadPart; +DPRINT1("First Sector: %I64u\n", NewPartEntry->StartSector.QuadPart); +DPRINT1("Last Sector: %I64u\n", NewPartEntry->StartSector.QuadPart + NewPartEntry->SectorCount.QuadPart - 1); +DPRINT1("Total Sectors: %I64u\n", NewPartEntry->SectorCount.QuadPart); + + NewPartEntry->FormatState = Unformatted; + + /* Append the table to the list */ + InsertTailList(&DiskEntry->LogicalPartListHead, + &NewPartEntry->ListEntry); + } + } + } + DPRINT1("ScanForUnpartitionedDiskSpace() done\n"); } @@ -983,7 +1114,7 @@ AddDiskToList( } InitializeListHead(&DiskEntry->PrimaryPartListHead); - InitializeListHead(&DiskEntry->ExtendedPartListHead); + InitializeListHead(&DiskEntry->LogicalPartListHead); DiskEntry->Cylinders = DiskGeometry.Cylinders.QuadPart; DiskEntry->TracksPerCylinder = DiskGeometry.TracksPerCylinder; @@ -1001,8 +1132,8 @@ AddDiskToList( DiskEntry->SectorAlignment = DiskGeometry.SectorsPerTrack; - DPRINT("SectorCount %I64u\n", DiskEntry->SectorCount); - DPRINT("SectorAlignment %lu\n", DiskEntry->SectorAlignment); + DPRINT1("SectorCount %I64u\n", DiskEntry->SectorCount); + DPRINT1("SectorAlignment %lu\n", DiskEntry->SectorAlignment); DiskEntry->DiskNumber = DiskNumber; DiskEntry->Port = ScsiAddress.PortNumber; @@ -1043,6 +1174,29 @@ AddDiskToList( DumpPartitionTable(DiskEntry); #endif + if (DiskEntry->LayoutBuffer->PartitionEntry[0].StartingOffset.QuadPart != 0 && + DiskEntry->LayoutBuffer->PartitionEntry[0].PartitionLength.QuadPart != 0 && + DiskEntry->LayoutBuffer->PartitionEntry[0].PartitionType != 0) + { + if ((DiskEntry->LayoutBuffer->PartitionEntry[0].StartingOffset.QuadPart / DiskEntry->BytesPerSector) % DiskEntry->SectorsPerTrack == 0) + { + DPRINT1("Use %lu Sector alignment!\n", DiskEntry->SectorsPerTrack); + } + else if (DiskEntry->LayoutBuffer->PartitionEntry[0].StartingOffset.QuadPart % 1048756 == 0) + { + DPRINT1("Use megabyte (%lu Sectors) alignment!\n", 1048756 / DiskEntry->BytesPerSector); + } + else + { + DPRINT1("No matching aligment found! Partiton 1 starts at %I64u\n", DiskEntry->LayoutBuffer->PartitionEntry[0].StartingOffset.QuadPart); + } + } + else + { + DPRINT1("No valid partiton table found! Use megabyte (%lu Sectors) alignment!\n", 1048756 / DiskEntry->BytesPerSector); + } + + if (DiskEntry->LayoutBuffer->PartitionCount == 0) { DiskEntry->NewDisk = TRUE; @@ -1055,24 +1209,18 @@ AddDiskToList( { for (i = 0; i < 4; i++) { - if (DiskEntry->LayoutBuffer->PartitionEntry[i].PartitionType != 0) - { - AddPrimaryPartitionToDisk(DiskNumber, - DiskEntry, - i); - } + AddPartitionToDisk(DiskNumber, + DiskEntry, + i, + FALSE); } - for (i = 4; i < DiskEntry->LayoutBuffer->PartitionCount; i++) + for (i = 4; i < DiskEntry->LayoutBuffer->PartitionCount; i += 4) { - if (DiskEntry->LayoutBuffer->PartitionEntry[i].PartitionType != 0) - { -#if 0 - AddExtendedPartitionToDisk(DiskNumber, - DiskEntry, - i); -#endif - } + AddPartitionToDisk(DiskNumber, + DiskEntry, + i, + TRUE); } } } @@ -1226,10 +1374,10 @@ DestroyPartitionList( RtlFreeHeap(ProcessHeap, 0, PartEntry); } - /* Release extended partition list */ - while (!IsListEmpty(&DiskEntry->ExtendedPartListHead)) + /* Release logical partition list */ + while (!IsListEmpty(&DiskEntry->LogicalPartListHead)) { - Entry = RemoveHeadList(&DiskEntry->ExtendedPartListHead); + Entry = RemoveHeadList(&DiskEntry->LogicalPartListHead); PartEntry = CONTAINING_RECORD(Entry, PARTENTRY, ListEntry); RtlFreeHeap(ProcessHeap, 0, PartEntry); @@ -1340,6 +1488,8 @@ PrintPartitionData( sprintf(LineBuffer, MUIGetString(STRING_UNPSPACE), + PartEntry->LogicalPartition ? " " : "", + PartEntry->LogicalPartition ? "" : " ", PartSize.u.LowPart, Unit); } @@ -1373,6 +1523,11 @@ PrintPartitionData( { PartType = "NTFS"; /* FIXME: Not quite correct! */ } + else if ((PartEntry->PartitionType == PARTITION_EXTENDED) || + (PartEntry->PartitionType == PARTITION_XINT13_EXTENDED)) + { + PartType = MUIGetString(STRING_EXTENDED_PARTITION); + } } PartSize.QuadPart = PartEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector; @@ -1401,17 +1556,21 @@ PrintPartitionData( MUIGetString(STRING_HDDINFOUNK5), (PartEntry->DriveLetter == 0) ? '-' : PartEntry->DriveLetter, (PartEntry->DriveLetter == 0) ? '-' : ':', + PartEntry->LogicalPartition ? " " : "", PartEntry->PartitionType, + PartEntry->LogicalPartition ? "" : " ", PartSize.u.LowPart, Unit); } else { sprintf(LineBuffer, - "%c%c %-24s %6lu %s", + "%c%c %s%-24s%s %6lu %s", (PartEntry->DriveLetter == 0) ? '-' : PartEntry->DriveLetter, (PartEntry->DriveLetter == 0) ? '-' : ':', + PartEntry->LogicalPartition ? " " : "", PartType, + PartEntry->LogicalPartition ? "" : " ", PartSize.u.LowPart, Unit); } @@ -1461,8 +1620,8 @@ PrintDiskData( PPARTLIST List, PDISKENTRY DiskEntry) { - PPARTENTRY PartEntry; - PLIST_ENTRY Entry; + PPARTENTRY PrimaryPartEntry, LogicalPartEntry; + PLIST_ENTRY PrimaryEntry, LogicalEntry; CHAR LineBuffer[128]; COORD coPos; DWORD Written; @@ -1546,16 +1705,31 @@ PrintDiskData( PrintEmptyLine(List); /* Print partition lines*/ - Entry = DiskEntry->PrimaryPartListHead.Flink; - while (Entry != &DiskEntry->PrimaryPartListHead) + PrimaryEntry = DiskEntry->PrimaryPartListHead.Flink; + while (PrimaryEntry != &DiskEntry->PrimaryPartListHead) { - PartEntry = CONTAINING_RECORD(Entry, PARTENTRY, ListEntry); + PrimaryPartEntry = CONTAINING_RECORD(PrimaryEntry, PARTENTRY, ListEntry); PrintPartitionData(List, DiskEntry, - PartEntry); + PrimaryPartEntry); - Entry = Entry->Flink; + if (IsContainerPartition(PrimaryPartEntry->PartitionType)) + { + LogicalEntry = DiskEntry->LogicalPartListHead.Flink; + while (LogicalEntry != &DiskEntry->LogicalPartListHead) + { + LogicalPartEntry = CONTAINING_RECORD(LogicalEntry, PARTENTRY, ListEntry); + + PrintPartitionData(List, + DiskEntry, + LogicalPartEntry); + + LogicalEntry = LogicalEntry->Flink; + } + } + + PrimaryEntry = PrimaryEntry->Flink; } /* Print separator line */ @@ -1835,115 +2009,192 @@ SelectPartition( } -VOID +BOOL ScrollDownPartitionList( PPARTLIST List) { -// PDISKENTRY DiskEntry; + PLIST_ENTRY DiskListEntry; + PLIST_ENTRY PartListEntry; + PDISKENTRY DiskEntry; PPARTENTRY PartEntry; -// PLIST_ENTRY Entry1; - PLIST_ENTRY Entry2; - /* Check for empty disks */ + /* Fail, if no disks are available */ if (IsListEmpty(&List->DiskListHead)) - return; + return FALSE; /* Check for next usable entry on current disk */ if (List->CurrentPartition != NULL) { - Entry2 = List->CurrentPartition->ListEntry.Flink; - if (Entry2 != &List->CurrentDisk->PrimaryPartListHead) + if (List->CurrentPartition->LogicalPartition) { - PartEntry = CONTAINING_RECORD(Entry2, PARTENTRY, ListEntry); + /* Logical partition */ - List->CurrentPartition = PartEntry; - DrawPartitionList(List); - return; - } - } - -#if 0 - /* Check for first usable entry on next disk */ - if (List->CurrentDisk != NULL) - { - Entry1 = List->CurrentDisk->ListEntry.Flink; - while (Entry1 != &List->DiskListHead) - { - DiskEntry = CONTAINING_RECORD(Entry1, DISKENTRY, ListEntry); - - Entry2 = DiskEntry->PartListHead.Flink; - if (Entry2 != &DiskEntry->PartListHead) + PartListEntry = List->CurrentPartition->ListEntry.Flink; + if (PartListEntry != &List->CurrentDisk->LogicalPartListHead) { - PartEntry = CONTAINING_RECORD(Entry2, PARTENTRY, ListEntry); + /* Next logical partition */ + PartEntry = CONTAINING_RECORD(PartListEntry, PARTENTRY, ListEntry); - List->CurrentDisk = DiskEntry; List->CurrentPartition = PartEntry; - DrawPartitionList(List); - return; + return TRUE; } + else + { + PartListEntry = List->CurrentDisk->ExtendedPartition->ListEntry.Flink; + if (PartListEntry != &List->CurrentDisk->PrimaryPartListHead) + { + PartEntry = CONTAINING_RECORD(PartListEntry, PARTENTRY, ListEntry); - Entry1 = Entry1->Flink; + List->CurrentPartition = PartEntry; + return TRUE; + } + } + } + else + { + /* Primary or extended partition */ + + if (IsContainerPartition(List->CurrentPartition->PartitionType)) + { + /* First logical partition */ + PartListEntry = List->CurrentDisk->LogicalPartListHead.Flink; + if (PartListEntry != &List->CurrentDisk->LogicalPartListHead) + { + PartEntry = CONTAINING_RECORD(PartListEntry, PARTENTRY, ListEntry); + + List->CurrentPartition = PartEntry; + return TRUE; + } + } + else + { + /* Next primary partition */ + PartListEntry = List->CurrentPartition->ListEntry.Flink; + if (PartListEntry != &List->CurrentDisk->PrimaryPartListHead) + { + PartEntry = CONTAINING_RECORD(PartListEntry, PARTENTRY, ListEntry); + + List->CurrentPartition = PartEntry; + return TRUE; + } + } } } -#endif + + /* Search for the first partition entry on the next disk */ + DiskListEntry = List->CurrentDisk->ListEntry.Flink; + while (DiskListEntry != &List->DiskListHead) + { + DiskEntry = CONTAINING_RECORD(DiskListEntry, DISKENTRY, ListEntry); + + PartListEntry = DiskEntry->PrimaryPartListHead.Flink; + if (PartListEntry != &DiskEntry->PrimaryPartListHead) + { + PartEntry = CONTAINING_RECORD(PartListEntry, PARTENTRY, ListEntry); + + List->CurrentDisk = DiskEntry; + List->CurrentPartition = PartEntry; + return TRUE; + } + + DiskListEntry = DiskListEntry->Flink; + } + + return FALSE; } -VOID +BOOL ScrollUpPartitionList( PPARTLIST List) { -// PDISKENTRY DiskEntry; + PLIST_ENTRY DiskListEntry; + PLIST_ENTRY PartListEntry; + PDISKENTRY DiskEntry; PPARTENTRY PartEntry; -// PLIST_ENTRY Entry1; - PLIST_ENTRY Entry2; - /* Check for empty disks */ + /* Fail, if no disks are available */ if (IsListEmpty(&List->DiskListHead)) - return; + return FALSE; - /* check for previous usable entry on current disk */ + /* Check for previous usable entry on current disk */ if (List->CurrentPartition != NULL) { - Entry2 = List->CurrentPartition->ListEntry.Blink; - if (Entry2 != &List->CurrentDisk->PrimaryPartListHead) + if (List->CurrentPartition->LogicalPartition) { - PartEntry = CONTAINING_RECORD(Entry2, PARTENTRY, ListEntry); - - List->CurrentPartition = PartEntry; - - /* Draw partition list and return */ - DrawPartitionList(List); - return; - } - } - -#if 0 - /* check for last usable entry on previous disk */ - if (List->CurrentDisk != NULL) - { - Entry1 = List->CurrentDisk->ListEntry.Blink; - while (Entry1 != &List->DiskListHead) - { - DiskEntry = CONTAINING_RECORD(Entry1, DISKENTRY, ListEntry); - - Entry2 = DiskEntry->PrimaryPartListHead.Blink; - if (Entry2 != &DiskEntry->PrimaryPartListHead) + /* Logical partition */ + PartListEntry = List->CurrentPartition->ListEntry.Blink; + if (PartListEntry != &List->CurrentDisk->LogicalPartListHead) { - PartEntry = CONTAINING_RECORD(Entry2, PARTENTRY, ListEntry); - - List->CurrentDisk = DiskEntry; - List->CurrentPartition = PartEntry; - - /* Draw partition list and return */ - DrawPartitionList(List); - return; + /* Previous logical partition */ + PartEntry = CONTAINING_RECORD(PartListEntry, PARTENTRY, ListEntry); + } + else + { + /* Extended partition*/ + PartEntry = List->CurrentDisk->ExtendedPartition; + } + + List->CurrentPartition = PartEntry; + return TRUE; + } + else + { + /* Primary or extended partition */ + + PartListEntry = List->CurrentPartition->ListEntry.Blink; + if (PartListEntry != &List->CurrentDisk->PrimaryPartListHead) + { + PartEntry = CONTAINING_RECORD(PartListEntry, PARTENTRY, ListEntry); + + if (IsContainerPartition(PartEntry->PartitionType)) + { + PartListEntry = List->CurrentDisk->LogicalPartListHead.Blink; + PartEntry = CONTAINING_RECORD(PartListEntry, PARTENTRY, ListEntry); + } + + List->CurrentPartition = PartEntry; + return TRUE; } - Entry1 = Entry1->Blink; } } -#endif + + /* Search for the last partition entry on the previous disk */ + DiskListEntry = List->CurrentDisk->ListEntry.Blink; + while (DiskListEntry != &List->DiskListHead) + { + DiskEntry = CONTAINING_RECORD(DiskListEntry, DISKENTRY, ListEntry); + + PartListEntry = DiskEntry->PrimaryPartListHead.Blink; + if (PartListEntry != &DiskEntry->PrimaryPartListHead) + { + PartEntry = CONTAINING_RECORD(PartListEntry, PARTENTRY, ListEntry); + + if (IsContainerPartition(PartEntry->PartitionType)) + { + PartListEntry = DiskEntry->LogicalPartListHead.Blink; + if (PartListEntry != &DiskEntry->LogicalPartListHead) + { + PartEntry = CONTAINING_RECORD(PartListEntry, PARTENTRY, ListEntry); + + List->CurrentDisk = DiskEntry; + List->CurrentPartition = PartEntry; + return TRUE; + } + } + else + { + List->CurrentDisk = DiskEntry; + List->CurrentPartition = PartEntry; + return TRUE; + } + } + + DiskListEntry = DiskListEntry->Blink; + } + + return FALSE; } @@ -2095,7 +2346,7 @@ GetNextUnpartitionedEntry( VOID -CreateNewPartition( +CreatePrimaryPartition( PPARTLIST List, ULONGLONG SectorCount, BOOLEAN AutoCreate) @@ -2104,7 +2355,7 @@ CreateNewPartition( PPARTENTRY PartEntry; PPARTENTRY NewPartEntry; - DPRINT1("CreateNewPartition(%I64u)\n", SectorCount); + DPRINT1("CreatePrimaryPartition(%I64u)\n", SectorCount); if (List == NULL || List->CurrentDisk == NULL || @@ -2180,6 +2431,176 @@ DPRINT1("Total Sectors: %I64u\n", NewPartEntry->SectorCount.QuadPart); } +static +VOID +AddLogicalDiskSpace( + PDISKENTRY DiskEntry) +{ + PPARTENTRY NewPartEntry; + + DPRINT1("AddLogicalDiskSpace()\n"); + + /* Create a partition table entry that represents the empty space in the container partition */ + NewPartEntry = RtlAllocateHeap(ProcessHeap, + HEAP_ZERO_MEMORY, + sizeof(PARTENTRY)); + if (NewPartEntry == NULL) + return; + + NewPartEntry->DiskEntry = DiskEntry; + NewPartEntry->LogicalPartition = TRUE; + + NewPartEntry->IsPartitioned = FALSE; + NewPartEntry->StartSector.QuadPart = DiskEntry->ExtendedPartition->StartSector.QuadPart + (ULONGLONG)DiskEntry->SectorsPerTrack; + NewPartEntry->SectorCount.QuadPart = DiskEntry->ExtendedPartition->SectorCount.QuadPart - (ULONGLONG)DiskEntry->SectorsPerTrack; + + DPRINT1("First Sector: %I64u\n", NewPartEntry->StartSector.QuadPart); + DPRINT1("Last Sector: %I64u\n", NewPartEntry->StartSector.QuadPart + NewPartEntry->SectorCount.QuadPart - 1); + DPRINT1("Total Sectors: %I64u\n", NewPartEntry->SectorCount.QuadPart); + + NewPartEntry->FormatState = Unformatted; + + InsertTailList(&DiskEntry->LogicalPartListHead, + &NewPartEntry->ListEntry); +} + + +VOID +CreateExtendedPartition( + PPARTLIST List, + ULONGLONG SectorCount) +{ + PDISKENTRY DiskEntry; + PPARTENTRY PartEntry; + PPARTENTRY NewPartEntry; + + DPRINT1("CreateExtendedPartition(%I64u)\n", SectorCount); + + if (List == NULL || + List->CurrentDisk == NULL || + List->CurrentPartition == NULL || + List->CurrentPartition->IsPartitioned == TRUE) + { + return; + } + + DiskEntry = List->CurrentDisk; + PartEntry = List->CurrentPartition; + +DPRINT1("Current partition sector count: %I64u\n", PartEntry->SectorCount.QuadPart); + + if (Align(PartEntry->StartSector.QuadPart + SectorCount, DiskEntry->SectorAlignment) - PartEntry->StartSector.QuadPart == PartEntry->SectorCount.QuadPart) + { +DPRINT1("Convert existing partition entry\n"); + /* Convert current entry to 'new (unformatted)' */ + PartEntry->IsPartitioned = TRUE; + PartEntry->FormatState = Formatted; + PartEntry->AutoCreate = FALSE; + PartEntry->New = FALSE; + PartEntry->BootIndicator = FALSE; /* FIXME */ + + if (PartEntry->StartSector.QuadPart < 1450560) + { + /* Partition starts below the 8.4GB boundary ==> CHS partition */ + PartEntry->PartitionType = PARTITION_EXTENDED; + } + else + { + /* Partition starts above the 8.4GB boundary ==> LBA partition */ + PartEntry->PartitionType = PARTITION_XINT13_EXTENDED; + } + + DiskEntry->ExtendedPartition = PartEntry; + +DPRINT1("First Sector: %I64u\n", PartEntry->StartSector.QuadPart); +DPRINT1("Last Sector: %I64u\n", PartEntry->StartSector.QuadPart + PartEntry->SectorCount.QuadPart - 1); +DPRINT1("Total Sectors: %I64u\n", PartEntry->SectorCount.QuadPart); + } + else + { +DPRINT1("Add new partition entry\n"); + + /* Insert and initialize a new partition entry */ + NewPartEntry = RtlAllocateHeap(ProcessHeap, + HEAP_ZERO_MEMORY, + sizeof(PARTENTRY)); + if (NewPartEntry == NULL) + return; + + /* Insert the new entry into the list */ + InsertTailList(&PartEntry->ListEntry, + &NewPartEntry->ListEntry); + + NewPartEntry->DiskEntry = DiskEntry; + + NewPartEntry->IsPartitioned = TRUE; + NewPartEntry->StartSector.QuadPart = PartEntry->StartSector.QuadPart; + NewPartEntry->SectorCount.QuadPart = Align(NewPartEntry->StartSector.QuadPart + SectorCount, DiskEntry->SectorAlignment) - + NewPartEntry->StartSector.QuadPart; + + NewPartEntry->New = FALSE; + NewPartEntry->FormatState = Formatted; + NewPartEntry->BootIndicator = FALSE; /* FIXME */ + + if (NewPartEntry->StartSector.QuadPart < 1450560) + { + /* Partition starts below the 8.4GB boundary ==> CHS partition */ + NewPartEntry->PartitionType = PARTITION_EXTENDED; + } + else + { + /* Partition starts above the 8.4GB boundary ==> LBA partition */ + NewPartEntry->PartitionType = PARTITION_XINT13_EXTENDED; + } + + DiskEntry->ExtendedPartition = NewPartEntry; + + PartEntry->StartSector.QuadPart = NewPartEntry->StartSector.QuadPart + NewPartEntry->SectorCount.QuadPart; + PartEntry->SectorCount.QuadPart -= (PartEntry->StartSector.QuadPart - NewPartEntry->StartSector.QuadPart); + +DPRINT1("First Sector: %I64u\n", NewPartEntry->StartSector.QuadPart); +DPRINT1("Last Sector: %I64u\n", NewPartEntry->StartSector.QuadPart + NewPartEntry->SectorCount.QuadPart - 1); +DPRINT1("Total Sectors: %I64u\n", NewPartEntry->SectorCount.QuadPart); + } + + AddLogicalDiskSpace(DiskEntry); + + UpdateDiskLayout(DiskEntry); + + DiskEntry->Dirty = TRUE; + + UpdatePartitionNumbers(DiskEntry); + + AssignDriveLetters(List); +} + + +VOID +CreateLogicalPartition( + PPARTLIST List, + ULONGLONG SectorCount) +{ +// PDISKENTRY DiskEntry; + PPARTENTRY PartEntry; +// PPARTENTRY NewPartEntry; + + DPRINT1("CreateLogicalPartition(%I64u)\n", SectorCount); + + if (List == NULL || + List->CurrentDisk == NULL || + List->CurrentPartition == NULL || + List->CurrentPartition->IsPartitioned == TRUE) + { + return; + } + +// DiskEntry = List->CurrentDisk; + PartEntry = List->CurrentPartition; + + DPRINT1("Current partition sector count: %I64u\n", PartEntry->SectorCount.QuadPart); +} + + VOID DeleteCurrentPartition( PPARTLIST List) @@ -2188,6 +2609,8 @@ DeleteCurrentPartition( PPARTENTRY PartEntry; PPARTENTRY PrevPartEntry; PPARTENTRY NextPartEntry; + PPARTENTRY LogicalPartEntry; + PLIST_ENTRY Entry; if (List == NULL || List->CurrentDisk == NULL || @@ -2200,6 +2623,20 @@ DeleteCurrentPartition( DiskEntry = List->CurrentDisk; PartEntry = List->CurrentPartition; + /* Delete all logical partiton entries if an extended partition will be deleted */ + if (DiskEntry->ExtendedPartition == PartEntry) + { + while (!IsListEmpty(&DiskEntry->LogicalPartListHead)) + { + Entry = RemoveHeadList(&DiskEntry->LogicalPartListHead); + LogicalPartEntry = CONTAINING_RECORD(Entry, PARTENTRY, ListEntry); + + RtlFreeHeap(ProcessHeap, 0, LogicalPartEntry); + } + + DiskEntry->ExtendedPartition = NULL; + } + /* Adjust unpartitioned disk space entries */ /* Get pointer to previous and next unpartitioned entries */ @@ -2561,4 +2998,136 @@ SetMountedDeviceValues( return TRUE; } + +static +BOOLEAN +IsLastPrimaryPartiton( + IN PPARTENTRY PartEntry) +{ + return (PartEntry->ListEntry.Flink == &PartEntry->DiskEntry->PrimaryPartListHead); +} + + +static +BOOLEAN +IsPreviousPartitionExtended( + IN PPARTENTRY PartEntry, + IN PDISKENTRY DiskEntry) +{ + PPARTENTRY PrevPartEntry; + PLIST_ENTRY Entry; + + Entry = PartEntry->ListEntry.Blink; + + while (Entry != &DiskEntry->PrimaryPartListHead) + { + PrevPartEntry = CONTAINING_RECORD(Entry, PARTENTRY, ListEntry); + + if (IsContainerPartition(PrevPartEntry->PartitionType)) + return TRUE; + + Entry = Entry->Blink; + } + + return FALSE; + +} + + +static +ULONG +GetPrimaryPartitionCount( + IN PDISKENTRY DiskEntry) +{ + PLIST_ENTRY Entry; + PPARTENTRY PartEntry; + UINT nCount = 0; + + Entry = DiskEntry->PrimaryPartListHead.Flink; + while (Entry != &DiskEntry->PrimaryPartListHead) + { + PartEntry = CONTAINING_RECORD(Entry, PARTENTRY, ListEntry); + if (PartEntry->IsPartitioned == TRUE) + nCount++; + + Entry = Entry->Flink; + } + + return nCount; +} + + +ULONG +PrimaryPartitionCreationChecks( + IN PPARTLIST List) +{ + PDISKENTRY DiskEntry; + PPARTENTRY PartEntry; + + DiskEntry = List->CurrentDisk; + PartEntry = List->CurrentPartition; + + /* Fail if partition is already in use */ + if (PartEntry->IsPartitioned == TRUE) + return ERROR_NEW_PARTITION; + + /* Fail if there are more than 4 partitions in the list */ + if (GetPrimaryPartitionCount(DiskEntry) > 4) + return ERROR_PARTITION_TABLE_FULL; + + /* Fail if this partiton is located behind an extended partition */ + if (IsPreviousPartitionExtended(PartEntry, DiskEntry)) + return ERROR_NOT_BEHIND_EXTENDED; + + return ERROR_SUCCESS; +} + + +ULONG +ExtendedPartitionCreationChecks( + IN PPARTLIST List) +{ + PDISKENTRY DiskEntry; + PPARTENTRY PartEntry; + + DiskEntry = List->CurrentDisk; + PartEntry = List->CurrentPartition; + + /* Fail if partition is already in use */ + if (PartEntry->IsPartitioned == TRUE) + return ERROR_NEW_PARTITION; + + /* Fail if there are more than 4 partitions in the list */ + if (GetPrimaryPartitionCount(DiskEntry) > 4) + return ERROR_PARTITION_TABLE_FULL; + + /* Fail if there is another extended partition in the list */ + if (DiskEntry->ExtendedPartition != NULL) + return ERROR_ONLY_ONE_EXTENDED; + + /* Fail if the partition is not the last list entry */ + if (!IsLastPrimaryPartiton(PartEntry)) + return ERROR_EXTENDED_NOT_LAST; + + return ERROR_SUCCESS; +} + + +ULONG +LogicalPartitionCreationChecks( + IN PPARTLIST List) +{ +// PDISKENTRY DiskEntry; + PPARTENTRY PartEntry; + +// DiskEntry = List->CurrentDisk; + PartEntry = List->CurrentPartition; + + /* Fail if partition is already in use */ + if (PartEntry->IsPartitioned == TRUE) + return ERROR_NEW_PARTITION; + + return ERROR_SUCCESS; +} + /* EOF */ diff --git a/base/setup/usetup/partlist.h b/base/setup/usetup/partlist.h index 5cf1841602d..a4e5871edcd 100644 --- a/base/setup/usetup/partlist.h +++ b/base/setup/usetup/partlist.h @@ -57,6 +57,8 @@ typedef struct _PARTENTRY CHAR VolumeLabel[17]; CHAR FileSystemName[9]; + BOOLEAN LogicalPartition; + /* Partition is partitioned disk space */ BOOLEAN IsPartitioned; @@ -115,8 +117,10 @@ typedef struct _DISKENTRY PDRIVE_LAYOUT_INFORMATION LayoutBuffer; + PPARTENTRY ExtendedPartition; + LIST_ENTRY PrimaryPartListHead; - LIST_ENTRY ExtendedPartListHead; + LIST_ENTRY LogicalPartListHead; } DISKENTRY, *PDISKENTRY; @@ -207,20 +211,30 @@ BOOL SetMountedDeviceValues( PPARTLIST List); -VOID +BOOL ScrollDownPartitionList( PPARTLIST List); -VOID +BOOL ScrollUpPartitionList( PPARTLIST List); VOID -CreateNewPartition( +CreatePrimaryPartition( PPARTLIST List, ULONGLONG PartitionSize, BOOLEAN AutoCreate); +VOID +CreateExtendedPartition( + PPARTLIST List, + ULONGLONG PartitionSize); + +VOID +CreateLogicalPartition( + PPARTLIST List, + ULONGLONG PartitionSize); + VOID DeleteCurrentPartition( PPARTLIST List); @@ -237,4 +251,16 @@ BOOLEAN WritePartitionsToDisk( PPARTLIST List); +ULONG +PrimaryPartitionCreationChecks( + IN PPARTLIST List); + +ULONG +ExtendedPartitionCreationChecks( + IN PPARTLIST List); + +ULONG +LogicalPartitionCreationChecks( + IN PPARTLIST List); + /* EOF */ diff --git a/base/setup/usetup/usetup.h b/base/setup/usetup/usetup.h index dd88ca8103b..48914d16bad 100644 --- a/base/setup/usetup/usetup.h +++ b/base/setup/usetup/usetup.h @@ -128,7 +128,9 @@ typedef enum _PAGE_NUMBER LAYOUT_SETTINGS_PAGE, SELECT_PARTITION_PAGE, - CREATE_PARTITION_PAGE, + CREATE_PRIMARY_PARTITION_PAGE, + CREATE_EXTENDED_PARTITION_PAGE, + CREATE_LOGICAL_PARTITION_PAGE, DELETE_PARTITION_PAGE, SELECT_FILE_SYSTEM_PAGE, diff --git a/base/shell/explorer/explorer.cpp b/base/shell/explorer/explorer.cpp index db931cb8f05..ffe9d23fe2a 100644 --- a/base/shell/explorer/explorer.cpp +++ b/base/shell/explorer/explorer.cpp @@ -1203,6 +1203,12 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdL "ROS Explorer - command line options", MB_OK); } + /* + * Set our shutdown parameters: we want to shutdown the very last, + * but before any TaskMgr instance (which has a shutdown level of 1). + */ + SetProcessShutdownParameters(2, 0); + Thread* pSSOThread = NULL; if (startup_desktop) { diff --git a/base/shell/explorer/shell/mainframe.cpp b/base/shell/explorer/shell/mainframe.cpp index 748be6b8239..dd8618a7561 100644 --- a/base/shell/explorer/shell/mainframe.cpp +++ b/base/shell/explorer/shell/mainframe.cpp @@ -332,15 +332,8 @@ bool MainFrameBase::ProcessMessage(UINT nmsg, WPARAM wparam, LPARAM lparam, LRES break; case WM_SIZE: { -#ifdef __REACTOS__ ///@todo Work around to display rebar in ROS (with flickering) as long as the control isn't fixed - int height = SendMessage(_hwndrebar, RB_GETBARHEIGHT, 0, 0); - MoveWindow(_hwndrebar, 0, 0, LOWORD(lparam), height, TRUE); -#else - resize_frame(LOWORD(lparam), HIWORD(lparam)); - SendMessage(_hwndrebar, WM_SIZE, 0, 0); -#endif - - + resize_frame(LOWORD(lparam), HIWORD(lparam)); + SendMessage(_hwndrebar, WM_SIZE, 0, 0); break;} // do not pass message to DefFrameProc case WM_GETMINMAXINFO: { @@ -769,13 +762,12 @@ MDIMainFrame::MDIMainFrame(HWND hwnd) extraBtns.iBitmap = 8; SendMessage(_hextrabar, TB_INSERTBUTTON, INT_MAX, (LPARAM)&extraBtns); } -#ifndef __REACTOS__ // don't insert reg button for ROS. Regedit should be used. + // insert Registry button extraBtns.iString = SendMessage(_hextrabar, TB_ADDSTRING, 0, (LPARAM)TEXT("Reg.\0")); extraBtns.idCommand = ID_DRIVE_REGISTRY; extraBtns.iBitmap = 9; SendMessage(_hextrabar, TB_INSERTBUTTON, INT_MAX, (LPARAM)&extraBtns); -#endif #ifdef _DEBUG // insert FAT direct file system access button diff --git a/base/shell/explorer/shell/shellfs.cpp b/base/shell/explorer/shell/shellfs.cpp index d1115a2e27d..1243a0d0055 100644 --- a/base/shell/explorer/shell/shellfs.cpp +++ b/base/shell/explorer/shell/shellfs.cpp @@ -40,7 +40,7 @@ bool ShellDirectory::fill_w32fdata_shell(LPCITEMIDLIST pidl, SFGAOF attribs, WIN IDataObject* pDataObj; STGMEDIUM medium = {0, {0}, 0}; - FORMATETC fmt = {g_Globals._cfStrFName, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL}; + FORMATETC fmt = {(USHORT)g_Globals._cfStrFName, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL}; HRESULT hr = _folder->GetUIObjectOf(0, 1, &pidl, IID_IDataObject, 0, (LPVOID*)&pDataObj); diff --git a/base/shell/explorer/taskbar/quicklaunch.cpp b/base/shell/explorer/taskbar/quicklaunch.cpp index 015dbd5d43a..fb9984d7890 100644 --- a/base/shell/explorer/taskbar/quicklaunch.cpp +++ b/base/shell/explorer/taskbar/quicklaunch.cpp @@ -184,7 +184,7 @@ void QuickLaunchBar::AddButton(int id, HBITMAP hbmp, LPCTSTR name, Entry* entry, _entries[id] = qle; - TBBUTTON btn = {0, 0, flags, BTNS_BUTTON|BTNS_NOPREFIX, {0, 0}, 0, 0}; + TBBUTTON btn = {0, 0, (BYTE)flags, BTNS_BUTTON|BTNS_NOPREFIX, {0, 0}, 0, 0}; btn.idCommand = id; btn.iBitmap = bmp_idx; @@ -195,7 +195,7 @@ void QuickLaunchBar::AddButton(int id, HBITMAP hbmp, LPCTSTR name, Entry* entry, void QuickLaunchBar::UpdateDesktopButtons(int desktop_idx) { for(int i=0; i # -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: # -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# * Neither the names of Kitware, Inc., the Insight Software Consortium, +# nor the names of their contributors may be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) if(__CMAKE_PARSE_ARGUMENTS_INCLUDED) diff --git a/cmake/gcc.cmake b/cmake/gcc.cmake index 9b534c5a516..d3b6a062ed8 100644 --- a/cmake/gcc.cmake +++ b/cmake/gcc.cmake @@ -88,7 +88,7 @@ if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") add_compile_flags("-Wno-error=unused-but-set-variable") endif() -add_compile_flags("-Wtype-limits -Wno-error=type-limits") +add_compile_flags("-Wno-error=type-limits") if(ARCH STREQUAL "amd64") add_compile_flags("-Wno-format") diff --git a/cmake/msvc.cmake b/cmake/msvc.cmake index 7d3cedd4522..fe2ec991c8c 100644 --- a/cmake/msvc.cmake +++ b/cmake/msvc.cmake @@ -103,9 +103,15 @@ else() set(rc_nologo_flag) endif() set(CMAKE_RC_COMPILE_OBJECT " ${rc_nologo_flag} ${I18N_DEFS} /fo ") - set(CMAKE_ASM_COMPILE_OBJECT - "cl ${cl_includes_flag} /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm /I${REACTOS_BINARY_DIR}/include/asm /D__ASM__ /D_USE_ML /EP /c > .tmp" - " /nologo /Cp /Fo /c /Ta .tmp") + if(ARCH STREQUAL "arm") + set(CMAKE_ASM_COMPILE_OBJECT + "cl ${cl_includes_flag} /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm /I${REACTOS_BINARY_DIR}/include/asm /D__ASM__ /D_USE_ML /EP /c > .tmp" + " -nologo -o .tmp") + else() + set(CMAKE_ASM_COMPILE_OBJECT + "cl ${cl_includes_flag} /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm /I${REACTOS_BINARY_DIR}/include/asm /D__ASM__ /D_USE_ML /EP /c > .tmp" + " /nologo /Cp /Fo /c /Ta .tmp") + endif() endif() if(_VS_ANALYZE_) @@ -222,7 +228,13 @@ endfunction() # Define those for having real libraries set(CMAKE_IMPLIB_CREATE_STATIC_LIBRARY "LINK /LIB /NOLOGO /OUT: ") -set(CMAKE_STUB_ASM_COMPILE_OBJECT " /nologo /Cp /Fo /c /Ta ") + +if(ARCH STREQUAL "arm") + set(CMAKE_STUB_ASM_COMPILE_OBJECT " -nologo -o ") +else() + set(CMAKE_STUB_ASM_COMPILE_OBJECT " /nologo /Cp /Fo /c /Ta ") +endif() + function(add_delay_importlibs _module) get_target_property(_module_type ${_module} TYPE) if(_module_type STREQUAL "STATIC_LIBRARY") @@ -248,9 +260,14 @@ function(generate_import_lib _libname _dllname _spec_file) if(MSVC_IDE) # Compile the generated asm stub file + if(ARCH STREQUAL "arm") + set(_asm_stub_command ${CMAKE_ASM_COMPILER} -nologo -o ${_asm_stubs_file}.obj ${_asm_stubs_file}) + else() + set(_asm_stub_command ${CMAKE_ASM_COMPILER} /Cp /Fo${_asm_stubs_file}.obj /c /Ta ${_asm_stubs_file}) + endif() add_custom_command( OUTPUT ${_asm_stubs_file}.obj - COMMAND ${CMAKE_ASM_COMPILER} /Cp /Fo${_asm_stubs_file}.obj /c /Ta ${_asm_stubs_file} + COMMAND ${_asm_stub_command} DEPENDS ${_asm_stubs_file}) else() # Be clear about the "language" @@ -274,8 +291,13 @@ function(generate_import_lib _libname _dllname _spec_file) endfunction() if(ARCH STREQUAL "amd64") + # This is NOT a typo. + # See https://software.intel.com/en-us/forums/topic/404643 add_definitions(/D__x86_64) set(SPEC2DEF_ARCH x86_64) +elseif(ARCH STREQUAL "arm") + add_definitions(/D__arm__) + set(SPEC2DEF_ARCH arm) else() set(SPEC2DEF_ARCH i386) endif() @@ -320,6 +342,8 @@ set(PSEH_LIB "pseh") # both the x86 and x64 versions of ml are available. if((ARCH STREQUAL "amd64") AND (DEFINED ENV{VCINSTALLDIR})) set(CMAKE_ASM16_COMPILER $ENV{VCINSTALLDIR}/bin/ml.exe) +elseif(ARCH STREQUAL "arm") + set(CMAKE_ASM16_COMPILER armasm.exe) else() set(CMAKE_ASM16_COMPILER ml.exe) endif() @@ -333,9 +357,15 @@ function(CreateBootSectorTarget _target_name _asm_file _binary_file _base_addres COMMAND ${CMAKE_C_COMPILER} /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm /I${REACTOS_BINARY_DIR}/include/asm /D__ASM__ /D_USE_ML /EP /c ${_asm_file} > ${_temp_file} DEPENDS ${_asm_file}) + if(ARCH STREQUAL "arm") + set(_asm16_command ${CMAKE_ASM16_COMPILER} -nologo -o ${_object_file} ${_temp_file}) + else() + set(_asm16_command ${CMAKE_ASM16_COMPILER} /nologo /Cp /Fo${_object_file} /c /Ta ${_temp_file}) + endif() + add_custom_command( OUTPUT ${_object_file} - COMMAND ${CMAKE_ASM16_COMPILER} /nologo /Cp /Fo${_object_file} /c /Ta ${_temp_file} + COMMAND ${_asm16_command} DEPENDS ${_temp_file}) add_custom_command( @@ -368,9 +398,14 @@ macro(add_asm_files _target) list(APPEND _source_file_defines -D${_define}) endif() endforeach() + if(ARCH STREQUAL "arm") + set(_pp_asm_compile_command ${CMAKE_ASM_COMPILER} -nologo -o ${_object_file} ${_preprocessed_asm_file}) + else() + set(_pp_asm_compile_command ${CMAKE_ASM_COMPILER} /nologo /Cp /Fo${_object_file} /c /Ta ${_preprocessed_asm_file}) + endif() add_custom_command( OUTPUT ${_preprocessed_asm_file} ${_object_file} - COMMAND cl /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm /I${REACTOS_BINARY_DIR}/include/asm ${_directory_includes} ${_source_file_defines} ${_directory_defines} /D__ASM__ /D_USE_ML /EP /c ${_source_file_full_path} > ${_preprocessed_asm_file} && ${CMAKE_ASM_COMPILER} /nologo /Cp /Fo${_object_file} /c /Ta ${_preprocessed_asm_file} + COMMAND cl /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm /I${REACTOS_BINARY_DIR}/include/asm ${_directory_includes} ${_source_file_defines} ${_directory_defines} /D__ASM__ /D_USE_ML /EP /c ${_source_file_full_path} > ${_preprocessed_asm_file} && ${_pp_asm_compile_command} DEPENDS ${_source_file_full_path}) set_source_files_properties(${_object_file} PROPERTIES EXTERNAL_OBJECT 1) list(APPEND ${_target} ${_object_file}) diff --git a/dll/3rdparty/libtiff/CMakeLists.txt b/dll/3rdparty/libtiff/CMakeLists.txt index 1971feb7c18..27ec6ad2bb5 100644 --- a/dll/3rdparty/libtiff/CMakeLists.txt +++ b/dll/3rdparty/libtiff/CMakeLists.txt @@ -61,4 +61,5 @@ add_cd_file(TARGET libtiff DESTINATION reactos/system32 FOR all) if(NOT MSVC) allow_warnings(libtiff) + add_target_compile_flags(libtiff "-Wno-unused-but-set-variable") endif() diff --git a/dll/cpl/appwiz/addons.c b/dll/cpl/appwiz/addons.c index 12b847298ea..e103bc5e7df 100644 --- a/dll/cpl/appwiz/addons.c +++ b/dll/cpl/appwiz/addons.c @@ -30,7 +30,7 @@ #ifdef __i386__ #define ARCH_STRING "x86" -#define GECKO_SHA "b4923c0565e6cbd20075a0d4119ce3b48424f962" +#define GECKO_SHA "f6984567b24fef7b0be79837e04d3a913af1a88c" #else #define ARCH_STRING "" #define GECKO_SHA "???" diff --git a/dll/cpl/appwiz/createlink.c b/dll/cpl/appwiz/createlink.c index a5ac3c44890..361ca156c9e 100644 --- a/dll/cpl/appwiz/createlink.c +++ b/dll/cpl/appwiz/createlink.c @@ -226,11 +226,7 @@ WelcomeDlgProc(HWND hwndDlg, LoadStringW(hApplet, IDS_ERROR_NOT_FOUND, szPath, MAX_PATH) < MAX_PATH) { WCHAR szError[MAX_PATH + 100]; -#ifdef _MSC_VER - _swprintf(szError, szPath, pContext->szTarget); -#else swprintf(szError, szPath, pContext->szTarget); -#endif MessageBoxW(hwndDlg, szError, szDesc, MB_ICONERROR); } SendDlgItemMessage(hwndDlg, IDC_SHORTCUT_LOCATION, EM_SETSEL, 0, -1); diff --git a/dll/cpl/appwiz/lang/pl-PL.rc b/dll/cpl/appwiz/lang/pl-PL.rc index b46b76189b7..9da524973e6 100644 --- a/dll/cpl/appwiz/lang/pl-PL.rc +++ b/dll/cpl/appwiz/lang/pl-PL.rc @@ -4,6 +4,7 @@ * http://www.reactos.org * IRC: irc.freenode.net #reactos-pl; * UTF-8 conversion by Caemyr (May, 2011) + * Updated by Saibamen - Adam Stachowicz (saibamenppl@gmail.com) (April, 2014) */ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT @@ -59,19 +60,19 @@ END STRINGTABLE BEGIN - IDS_DOWNLOADING "Downloading..." - IDS_INSTALLING "Installing..." - IDS_INVALID_SHA "Unexpected checksum of downloaded file. Aborting installation of corrupted file." + IDS_DOWNLOADING "Ściąganie..." + IDS_INSTALLING "Instalowanie..." + IDS_INVALID_SHA "Nieoczekiwana suma kontrolna ściągniętego pliku. Przerwanie instalacji uszkodzonego pliku." END ID_DWL_GECKO_DIALOG DIALOG 0, 0, 260, 95 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Wine Gecko Installer" +CAPTION "Instalator Wine Gecko" FONT 8, "MS Shell Dlg" BEGIN - CONTROL "ReactOS could not find a Wine Gecko package which is needed for applications embedding HTML to work correctly. ReactOS can automatically download and install it for you.", + CONTROL "ReactOS nie mógł znaleźć pakietu Wine Gecko, który jest potrzebny dla aplikacji osadzających kod HTML, aby mogły pracować w pełni. ReactOS może go automatycznie pobrać i zainstalować dla Ciebie.", ID_DWL_STATUS, "SysLink", 0, 10, 10, 240, 65 CONTROL "", ID_DWL_PROGRESS, PROGRESS_CLASSA, WS_BORDER | PBS_SMOOTH, 10, 40, 240, 12 - DEFPUSHBUTTON "&Install", ID_DWL_INSTALL, 200, 76, 50, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON "Cancel", IDCANCEL, 144, 76, 50, 14, WS_GROUP | WS_TABSTOP + DEFPUSHBUTTON "&Instaluj", ID_DWL_INSTALL, 200, 76, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Anuluj", IDCANCEL, 144, 76, 50, 14, WS_GROUP | WS_TABSTOP END diff --git a/dll/cpl/desk/devsett.c b/dll/cpl/desk/devsett.c index ec7e986e51c..8006153aa4d 100644 --- a/dll/cpl/desk/devsett.c +++ b/dll/cpl/desk/devsett.c @@ -667,7 +667,10 @@ CDevSettings_GetData(IDataObject* iface, { hr = StringCbCopy(pszBuf, (wcslen(pszRet) + 1) * sizeof(WCHAR), pszRet); if (FAILED(hr)) + { + GlobalFree(pszBuf); return hr; + } pmedium->tymed = TYMED_HGLOBAL; pmedium->hGlobal = pszBuf; diff --git a/dll/cpl/desk/lang/pl-PL.rc b/dll/cpl/desk/lang/pl-PL.rc index 3c0f108c7d7..514c7ef9556 100644 --- a/dll/cpl/desk/lang/pl-PL.rc +++ b/dll/cpl/desk/lang/pl-PL.rc @@ -68,7 +68,7 @@ END IDD_ADVAPPEARANCE DIALOGEX 0, 0, 250, 239 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_DLGMODALFRAME | WS_EX_WINDOWEDGE -CAPTION "Ustawienia zaawnsowane" +CAPTION "Ustawienia zaawansowane" FONT 8, "MS Shell Dlg" BEGIN CONTROL "", IDC_APPEARANCE_PREVIEW, "PreviewWndClass", WS_VISIBLE | WS_BORDER, 7, 7, 232, 120 diff --git a/dll/cpl/desk/screensaver.c b/dll/cpl/desk/screensaver.c index ce089bb5141..9a8f9bde92a 100644 --- a/dll/cpl/desk/screensaver.c +++ b/dll/cpl/desk/screensaver.c @@ -504,6 +504,8 @@ SetScreenSaver(HWND hwndDlg, PDATA pData) HKEY regKey; BOOL DeleteMode = FALSE; + DBG_UNREFERENCED_LOCAL_VARIABLE(DeleteMode); + if (RegOpenKeyEx(HKEY_CURRENT_USER, _T("Control Panel\\Desktop"), 0, diff --git a/dll/cpl/odbccp32/odbccp32.c b/dll/cpl/odbccp32/odbccp32.c index ce77120626b..57f150ad4cb 100644 --- a/dll/cpl/odbccp32/odbccp32.c +++ b/dll/cpl/odbccp32/odbccp32.c @@ -15,64 +15,76 @@ HMODULE hLibrary = NULL; LONG CALLBACK CPlApplet(HWND hwndCpl, - UINT uMsg, - LPARAM lParam1, - LPARAM lParam2) + UINT uMsg, + LPARAM lParam1, + LPARAM lParam2) { - if (ODBCProc == NULL) - { - TCHAR szBuffer[MAX_PATH]; + switch (uMsg) + { + case CPL_INIT: + return TRUE; - if (ExpandEnvironmentStrings(_T("%systemroot%\\system32\\odbccp32.dll"), - szBuffer, - sizeof(szBuffer) / sizeof(TCHAR)) > 0) - { - hLibrary = LoadLibrary(szBuffer); - if (hLibrary) - { - ODBCProc = (APPLET_PROC)GetProcAddress(hLibrary, "ODBCCPlApplet"); - } - } - } + case CPL_DBLCLK: + { + if (ODBCProc == NULL) + { + TCHAR szBuffer[MAX_PATH]; - if (ODBCProc) - { - return ODBCProc(hwndCpl, uMsg, lParam1, lParam2); - } - else - { - if(hLibrary) - { - FreeLibrary(hLibrary); - } + if (ExpandEnvironmentStrings(_T("%systemroot%\\system32\\odbccp32.dll"), + szBuffer, + sizeof(szBuffer) / sizeof(TCHAR)) > 0) + { + hLibrary = LoadLibrary(szBuffer); + if (hLibrary) + { + ODBCProc = (APPLET_PROC)GetProcAddress(hLibrary, "ODBCCPlApplet"); + } + } + } - TerminateProcess(GetCurrentProcess(), -1); - return (LONG)-1; - } + if (ODBCProc) + { + return ODBCProc(hwndCpl, uMsg, lParam1, lParam2); + } + else + { + if (hLibrary) + { + FreeLibrary(hLibrary); + } + + TerminateProcess(GetCurrentProcess(), -1); + return (LONG)-1; + } + } + } + + return FALSE; } BOOL WINAPI DllMain(HINSTANCE hinstDLL, - DWORD dwReason, - LPVOID lpReserved) + DWORD dwReason, + LPVOID lpReserved) { - INITCOMMONCONTROLSEX InitControls; - UNREFERENCED_PARAMETER(lpReserved); + INITCOMMONCONTROLSEX InitControls; + UNREFERENCED_PARAMETER(lpReserved); - switch(dwReason) - { - case DLL_PROCESS_ATTACH: - case DLL_THREAD_ATTACH: + switch(dwReason) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + { + InitControls.dwSize = sizeof(INITCOMMONCONTROLSEX); + InitControls.dwICC = ICC_LISTVIEW_CLASSES | ICC_UPDOWN_CLASS | ICC_BAR_CLASSES; + InitCommonControlsEx(&InitControls); - InitControls.dwSize = sizeof(INITCOMMONCONTROLSEX); - InitControls.dwICC = ICC_LISTVIEW_CLASSES | ICC_UPDOWN_CLASS | ICC_BAR_CLASSES; - InitCommonControlsEx(&InitControls); + hApplet = hinstDLL; + break; + } + } - hApplet = hinstDLL; - break; - } - - return TRUE; + return TRUE; } diff --git a/dll/cpl/sysdm/lang/en-US.rc b/dll/cpl/sysdm/lang/en-US.rc index 4a5f28edf78..d42b16e3eb1 100644 --- a/dll/cpl/sysdm/lang/en-US.rc +++ b/dll/cpl/sysdm/lang/en-US.rc @@ -18,7 +18,7 @@ BEGIN LTEXT "", IDC_MACHINELINE4, 130, 171, 118, 9 LTEXT "", IDC_MACHINELINE5, 130, 180, 118, 9 CONTROL "Visit the ReactOS Homepage", IDC_ROSHOMEPAGE_LINK, "SysLink", WS_CHILD | WS_VISIBLE | WS_TABSTOP, 20, 200, 140, 10 - PUSHBUTTON "View &licence...", IDC_LICENCE, 170, 199, 78, 13 + PUSHBUTTON "View &license...", IDC_LICENCE, 170, 199, 78, 13 END IDD_PROPPAGEHARDWARE DIALOGEX 0, 0, 256, 218 @@ -243,7 +243,7 @@ BEGIN END IDD_LICENCE DIALOGEX 6, 5, 267, 159 -CAPTION "Licence" +CAPTION "License" FONT 8, "MS Shell Dlg", 0, 0, 0x0 STYLE DS_SHELLFONT | WS_BORDER | WS_THICKFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU BEGIN diff --git a/dll/cpl/wined3dcfg/lang/pl-PL.rc b/dll/cpl/wined3dcfg/lang/pl-PL.rc index c99c1e78e30..385de573c96 100644 --- a/dll/cpl/wined3dcfg/lang/pl-PL.rc +++ b/dll/cpl/wined3dcfg/lang/pl-PL.rc @@ -2,6 +2,7 @@ * Translated by Caemyr - Olaf Siejka (Mar 2012) * http://www.reactos.org * IRC: irc.freenode.net #reactos-pl; + * Updated by Saibamen and wojo664 (May 2014) */ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT @@ -12,27 +13,27 @@ CAPTION "Ogólne" FONT 8, "MS Shell Dlg" BEGIN ICON IDI_CPLICON, IDI_CPLICON, 8, 0, 21, 20 - GROUPBOX "Shaders", -1, 5, 25, 230, 80 - LTEXT "Enable GLSL:", -1, 15, 42, 80, 10 + GROUPBOX "Cieniowanie", -1, 5, 25, 230, 80 + LTEXT "Włącz GLSL:", -1, 15, 42, 80, 10 COMBOBOX IDC_GLSL, 95, 40, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST - LTEXT "Maximum GS Level:", -1, 15, 57, 80, 10 + LTEXT "Maksymalny poziom GS:", -1, 15, 57, 80, 10 COMBOBOX IDC_GSLEVEL, 95, 55, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST - LTEXT "Maximum PS Level:", -1, 15, 72, 80, 10 + LTEXT "Maksymalny poziom PS:", -1, 15, 72, 80, 10 COMBOBOX IDC_PSLEVEL, 95, 70, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST - LTEXT "Maximum VS Level:", -1, 15, 87, 80, 10 + LTEXT "Maksymalny poziom VS:", -1, 15, 87, 80, 10 COMBOBOX IDC_VSLEVEL, 95, 85, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST - GROUPBOX "Rendering", -1, 5, 110, 230, 110 - LTEXT "Multisampling:", -1, 15, 127, 80, 10 + GROUPBOX "Renderowanie", -1, 5, 110, 230, 110 + LTEXT "Multipróbkowanie:", -1, 15, 127, 80, 10 COMBOBOX IDC_MULTISAMPLING, 95, 125, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST - LTEXT "Strict draw ordering:", -1, 15, 142, 80, 10 + LTEXT "Ścisła kolejność rysowania:", -1, 15, 142, 80, 10 COMBOBOX IDC_STRICTDRAWORDERING, 95, 140, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST - LTEXT "Offscreen rendering:", -1, 15, 157, 80, 10 + LTEXT "Renderowanie pozaekranowe:", -1, 15, 157, 80, 10 COMBOBOX IDC_OFFSCREEN, 95, 155, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST - LTEXT "Always offscreen:", -1, 15, 172, 72, 10, SS_LEFT + LTEXT "Zawsze pozaekranowo:", -1, 15, 172, 72, 10, SS_LEFT COMBOBOX IDC_ALWAYSOFFSCREEN, 95, 170, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST - LTEXT "Video memory size:", -1, 15, 187, 72, 10, SS_LEFT + LTEXT "Rozmiar pamięci video:", -1, 15, 187, 72, 10, SS_LEFT COMBOBOX IDC_VIDMEMSIZE, 95, 185, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST - LTEXT "DirectDraw Renderer:", -1, 15, 202, 72, 10, SS_LEFT + LTEXT "Urządzenie renderujące DirectDraw:", -1, 15, 202, 72, 10, SS_LEFT COMBOBOX IDC_DDRENDERER, 95, 200, 90, 10, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST END diff --git a/dll/directx/ddraw/Ddraw/GetCaps.c b/dll/directx/ddraw/Ddraw/GetCaps.c index fa0316609dd..ba45e683534 100644 --- a/dll/directx/ddraw/Ddraw/GetCaps.c +++ b/dll/directx/ddraw/Ddraw/GetCaps.c @@ -101,7 +101,7 @@ Main_DirectDraw_GetCaps( LPDDRAWI_DIRECTDRAW_INT This, LPDDCAPS pDriverCaps, if (CoreCaps->dwSize == sizeof(DDCORECAPS)) { - memcpy(&myCaps->dwCaps, &CoreCaps->dwCaps, sizeof(DDCAPS_DX3)); + memcpy(myCaps, CoreCaps, sizeof(DDCAPS_DX3)); } myCaps->dwVidMemFree = dwFree; @@ -126,7 +126,7 @@ Main_DirectDraw_GetCaps( LPDDRAWI_DIRECTDRAW_INT This, LPDDCAPS pDriverCaps, if (CoreCaps->dwSize == sizeof(DDCORECAPS)) { - memcpy(&myCaps->dwCaps, &CoreCaps->dwCaps, sizeof(DDCORECAPS)); + memcpy(myCaps, CoreCaps, sizeof(DDCORECAPS)); } myCaps->dwVidMemFree = dwFree; @@ -152,7 +152,7 @@ Main_DirectDraw_GetCaps( LPDDRAWI_DIRECTDRAW_INT This, LPDDCAPS pDriverCaps, if (CoreCaps->dwSize == sizeof(DDCORECAPS)) { - memcpy(&myCaps->dwCaps, &CoreCaps->dwCaps, sizeof(DDCORECAPS)); + memcpy(myCaps, CoreCaps, sizeof(DDCORECAPS)); } myCaps->dwVidMemFree = dwFree; @@ -208,7 +208,7 @@ Main_DirectDraw_GetCaps( LPDDRAWI_DIRECTDRAW_INT This, LPDDCAPS pDriverCaps, if (CoreCaps->dwSize == sizeof(DDCORECAPS)) { - memcpy(&myCaps->dwCaps, &CoreCaps->dwCaps, sizeof(DDCAPS_DX3)); + memcpy(myCaps, CoreCaps, sizeof(DDCAPS_DX3)); } myCaps->dwVidMemFree = dwFree; @@ -233,7 +233,7 @@ Main_DirectDraw_GetCaps( LPDDRAWI_DIRECTDRAW_INT This, LPDDCAPS pDriverCaps, if (CoreCaps->dwSize == sizeof(DDCORECAPS)) { - memcpy(&myCaps->dwCaps, &CoreCaps->dwCaps, sizeof(DDCORECAPS)); + memcpy(myCaps, CoreCaps, sizeof(DDCORECAPS)); } myCaps->dwVidMemFree = dwFree; @@ -259,7 +259,7 @@ Main_DirectDraw_GetCaps( LPDDRAWI_DIRECTDRAW_INT This, LPDDCAPS pDriverCaps, if (CoreCaps->dwSize == sizeof(DDCORECAPS)) { - memcpy(&myCaps->dwCaps, &CoreCaps->dwCaps, sizeof(DDCORECAPS)); + memcpy(myCaps, CoreCaps, sizeof(DDCORECAPS)); } myCaps->dwVidMemFree = dwFree; diff --git a/dll/directx/wine/devenum/CMakeLists.txt b/dll/directx/wine/devenum/CMakeLists.txt index 5768de217ba..8af2acf7b4d 100644 --- a/dll/directx/wine/devenum/CMakeLists.txt +++ b/dll/directx/wine/devenum/CMakeLists.txt @@ -1,7 +1,4 @@ -remove_definitions(-D_WIN32_WINNT=0x502) -add_definitions(-D_WIN32_WINNT=0x600) - add_definitions(-D__WINESRC__) include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine) spec2def(devenum.dll devenum.spec) @@ -22,7 +19,7 @@ add_library(devenum SHARED set_source_files_properties(devenum.rc PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/devenum_classes.rgs) set_module_type(devenum win32dll UNICODE) target_link_libraries(devenum strmiids uuid wine) -add_importlibs(devenum advapi32 ole32 oleaut32 winmm user32 avicap32 msvcrt kernel32 ntdll) +add_importlibs(devenum advapi32 ole32 oleaut32 winmm user32 avicap32 shlwapi msvcrt kernel32 ntdll) add_delay_importlibs(devenum msvfw32) add_pch(devenum devenum_private.h SOURCE) add_cd_file(TARGET devenum DESTINATION reactos/system32 FOR all) diff --git a/dll/directx/wine/devenum/createdevenum.c b/dll/directx/wine/devenum/createdevenum.c index 29ba0e8ca33..77808b2bc94 100644 --- a/dll/directx/wine/devenum/createdevenum.c +++ b/dll/directx/wine/devenum/createdevenum.c @@ -27,6 +27,7 @@ #include #include +#include #include "resource.h" @@ -675,15 +676,15 @@ static HRESULT DEVENUM_CreateSpecialCategories(void) * or switched from pulseaudio to alsa, delete all old devices first */ if (SUCCEEDED(DEVENUM_GetCategoryKey(&CLSID_AudioRendererCategory, &basekey, path, MAX_PATH))) - RegDeleteTreeW(basekey, path); + SHDeleteKeyW(basekey, path); if (SUCCEEDED(DEVENUM_GetCategoryKey(&CLSID_AudioInputDeviceCategory, &basekey, path, MAX_PATH))) - RegDeleteTreeW(basekey, path); + SHDeleteKeyW(basekey, path); if (SUCCEEDED(DEVENUM_GetCategoryKey(&CLSID_VideoInputDeviceCategory, &basekey, path, MAX_PATH))) - RegDeleteTreeW(basekey, path); + SHDeleteKeyW(basekey, path); if (SUCCEEDED(DEVENUM_GetCategoryKey(&CLSID_MidiRendererCategory, &basekey, path, MAX_PATH))) - RegDeleteTreeW(basekey, path); + SHDeleteKeyW(basekey, path); if (SUCCEEDED(DEVENUM_GetCategoryKey(&CLSID_VideoCompressorCategory, &basekey, path, MAX_PATH))) - RegDeleteTreeW(basekey, path); + SHDeleteKeyW(basekey, path); rf2.dwVersion = 2; rf2.dwMerit = MERIT_PREFERRED; diff --git a/dll/directx/wine/quartz/CMakeLists.txt b/dll/directx/wine/quartz/CMakeLists.txt index 490448bd0f7..50040af12c9 100644 --- a/dll/directx/wine/quartz/CMakeLists.txt +++ b/dll/directx/wine/quartz/CMakeLists.txt @@ -1,7 +1,4 @@ -remove_definitions(-D_WIN32_WINNT=0x502) -add_definitions(-D_WIN32_WINNT=0x600) - add_definitions( -D__WINESRC__ -DENTRY_PREFIX=QUARTZ_ diff --git a/dll/directx/wine/quartz/filesource.c b/dll/directx/wine/quartz/filesource.c index 4a26313ba2c..e63a5f42cdc 100644 --- a/dll/directx/wine/quartz/filesource.c +++ b/dll/directx/wine/quartz/filesource.c @@ -20,8 +20,6 @@ #include "quartz_private.h" -#include - static const WCHAR wszOutputPinName[] = { 'O','u','t','p','u','t',0 }; typedef struct AsyncReader diff --git a/dll/directx/wine/quartz/filtermapper.c b/dll/directx/wine/quartz/filtermapper.c index 97129e26d4a..704ea5a0aed 100644 --- a/dll/directx/wine/quartz/filtermapper.c +++ b/dll/directx/wine/quartz/filtermapper.c @@ -1513,7 +1513,7 @@ static HRESULT WINAPI FilterMapper_UnregisterFilter(IFilterMapper * iface, CLSID if (lRet != ERROR_SUCCESS) hr = HRESULT_FROM_WIN32(lRet); - lRet = RegDeleteTreeW(hKey, wszPins); + lRet = SHDeleteKeyW(hKey, wszPins); if (lRet != ERROR_SUCCESS) hr = HRESULT_FROM_WIN32(lRet); @@ -1572,7 +1572,7 @@ static HRESULT WINAPI FilterMapper_UnregisterPin(IFilterMapper * iface, CLSID Fi strcatW(wszPinNameKey, wszSlash); strcatW(wszPinNameKey, Name); - lRet = RegDeleteTreeW(hKey, wszPinNameKey); + lRet = SHDeleteKeyW(hKey, wszPinNameKey); hr = HRESULT_FROM_WIN32(lRet); CoTaskMemFree(wszPinNameKey); } diff --git a/dll/directx/wine/quartz/quartz_private.h b/dll/directx/wine/quartz/quartz_private.h index ae3a276fda1..c85a03326db 100644 --- a/dll/directx/wine/quartz/quartz_private.h +++ b/dll/directx/wine/quartz/quartz_private.h @@ -41,6 +41,7 @@ #include #include #include +#include #include #include diff --git a/dll/directx/wine/quartz/regsvr.c b/dll/directx/wine/quartz/regsvr.c index bbf519c8877..686257daa87 100644 --- a/dll/directx/wine/quartz/regsvr.c +++ b/dll/directx/wine/quartz/regsvr.c @@ -240,7 +240,7 @@ static HRESULT unregister_interfaces(struct regsvr_interface const *list) WCHAR buf[39]; StringFromGUID2(list->iid, buf, 39); - res = RegDeleteTreeW(interface_key, buf); + res = SHDeleteKeyW(interface_key, buf); if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; } @@ -346,18 +346,18 @@ static HRESULT unregister_coclasses(struct regsvr_coclass const *list) WCHAR buf[39]; StringFromGUID2(list->clsid, buf, 39); - res = RegDeleteTreeW(coclass_key, buf); + res = SHDeleteKeyW(coclass_key, buf); if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; if (list->progid) { - res = RegDeleteTreeA(HKEY_CLASSES_ROOT, list->progid); + res = SHDeleteKeyA(HKEY_CLASSES_ROOT, list->progid); if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; } if (list->viprogid) { - res = RegDeleteTreeA(HKEY_CLASSES_ROOT, list->viprogid); + res = SHDeleteKeyA(HKEY_CLASSES_ROOT, list->viprogid); if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; } @@ -500,7 +500,7 @@ static HRESULT unregister_mediatypes_parsing(struct regsvr_mediatype_parsing con if (res != ERROR_SUCCESS) break; StringFromGUID2(list->subtype, buf, 39); - res = RegDeleteTreeW(majortype_key, buf); + res = SHDeleteKeyW(majortype_key, buf); if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; /* Removed majortype key if there is no more subtype key */ @@ -535,7 +535,7 @@ static HRESULT unregister_mediatypes_extension(struct regsvr_mediatype_extension res = ERROR_SUCCESS; else if (res == ERROR_SUCCESS) for (; res == ERROR_SUCCESS && list->majortype; ++list) { - res = RegDeleteTreeA(extensions_root_key, list->extension); + res = SHDeleteKeyA(extensions_root_key, list->extension); if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; } diff --git a/dll/keyboard/kbdcz/kbdcz.c b/dll/keyboard/kbdcz/kbdcz.c index 8675452dcc9..b05d4f72776 100644 --- a/dll/keyboard/kbdcz/kbdcz.c +++ b/dll/keyboard/kbdcz/kbdcz.c @@ -78,7 +78,7 @@ ROSDATA USHORT scancode_to_vk[] = { VK_SNAPSHOT, /* - 55 - */ /* Oddities, and the remaining standard F-Keys */ - VK_EMPTY, VK_OEM_102, VK_F11, VK_F12, + VK_EMPTY, VK_OEM_102, VK_F11, VK_F12, /* - 59 - */ VK_CLEAR, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* EREOF */ VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* ZOOM */ @@ -159,20 +159,45 @@ ROSDATA VK_TO_BIT modifier_keys[] = { ROSDATA MODIFIERS modifier_bits = { modifier_keys, - 7, - { 0, 1, 2, 0, 0, 0, 3, 0 } - /* Modifier bit order: NONE, SHIFT, CTRL, SHIFT-CTRL, ALT (not used), SHIFT-ALT (not used), CTRL-ALT, SHIFT-CTRL-ALT */ + 7, /* Modifier bit order */ + { + 0, /* NONE */ + 1, /* SHIFT */ + 2, /* CTRL */ + 0, /* SHIFT-CTRL (not used) */ + 0, /* ALT (not used) */ + 0, /* SHIFT-ALT (not used) */ + 3, /* CTRL-ALT */ + 0, /* SHIFT-CTRL-ALT (not used) */ + } +}; +/* ^ This table shows which column in any VK_TO_WCHARS* structure will be used on which modifier */ + +ROSDATA VK_TO_WCHARS1 keypad_numbers[] = { + { VK_NUMPAD0, 0, {'0'} }, + { VK_NUMPAD1, 0, {'1'} }, + { VK_NUMPAD2, 0, {'2'} }, + { VK_NUMPAD3, 0, {'3'} }, + { VK_NUMPAD4, 0, {'4'} }, + { VK_NUMPAD5, 0, {'5'} }, + { VK_NUMPAD6, 0, {'6'} }, + { VK_NUMPAD7, 0, {'7'} }, + { VK_NUMPAD8, 0, {'8'} }, + { VK_NUMPAD9, 0, {'9'} }, + { VK_DECIMAL, 0, {','} }, + { VK_BACK, 0, {'\010'} }, + { 0, 0 } }; ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[] = { /* Keys that do not have shift states */ - { VK_TAB, 0, {'\t', '\t' } }, - { VK_ADD, 0, {'+', '+' } }, - { VK_SUBTRACT, 0, {'-', '-' } }, - { VK_MULTIPLY, 0, {'*', '*' } }, - { VK_DIVIDE, 0, {'/', '/' } }, - { VK_ESCAPE, 0, {0x1b, 0x1b} }, - { VK_SPACE, 0, {' ', ' ' } }, + { VK_TAB, 0, { '\t', '\t' } }, + { VK_ADD, 0, { '+', '+' } }, + { VK_SUBTRACT, 0, { '-', '-' } }, + { VK_MULTIPLY, 0, { '*', '*' } }, + { VK_DIVIDE, 0, { '/', '/' } }, + { VK_ESCAPE, 0, { 0x1b, 0x1b } }, + { VK_SPACE, 0, { ' ', ' ' } }, { 0, 0 } }; @@ -207,7 +232,7 @@ ROSDATA VK_TO_WCHARS4 key_to_chars_4mod[] = { { VK_EMPTY, 0, { WCH_NONE, WCH_NONE, WCH_NONE, 0x00b4 } }, // 9 dead letter { '0', 0, { 0x00e9, '0', WCH_NONE, WCH_DEAD } }, // e with acute { VK_EMPTY, 0, { WCH_NONE, WCH_NONE, WCH_NONE, 0x02dd } }, // 0 dead letter - + /* The misc */ { VK_OEM_MINUS, 0, { '=', '%', WCH_NONE, WCH_DEAD } }, // diaeresis { VK_EMPTY, 0, { WCH_NONE, WCH_NONE, WCH_NONE, 0x00a8 } }, // VK_OEM_MINUS dead letter @@ -224,61 +249,45 @@ ROSDATA VK_TO_WCHARS4 key_to_chars_4mod[] = { { VK_OEM_COMMA, 0, { ',', '?', WCH_NONE, '<' } }, { VK_OEM_PERIOD, 0, { '.', ':', WCH_NONE, '>' } }, { VK_OEM_2, 0, { '-', '_', WCH_NONE, '*' } }, - + /* The alphabet */ { 'A', CAPLOK, {'a', 'A', 0x01, WCH_NONE } }, - { 'B', CAPLOK, {'b', 'B', 0x02, '{' } }, - { 'C', CAPLOK, {'c', 'C', 0x03, '&' } }, - { 'D', CAPLOK, {'d', 'D', 0x04, 0x0110 } }, - { 'E', CAPLOK, {'e', 'E', 0x05, 0x20AC } }, - { 'F', CAPLOK, {'f', 'F', 0x06, '[' } }, - { 'G', CAPLOK, {'g', 'G', 0x07, ']' } }, + { 'B', CAPLOK, {'b', 'B', 0x02, '{' } }, + { 'C', CAPLOK, {'c', 'C', 0x03, '&' } }, + { 'D', CAPLOK, {'d', 'D', 0x04, 0x0110 } }, + { 'E', CAPLOK, {'e', 'E', 0x05, 0x20AC } }, + { 'F', CAPLOK, {'f', 'F', 0x06, '[' } }, + { 'G', CAPLOK, {'g', 'G', 0x07, ']' } }, { 'H', CAPLOK, {'h', 'H', 0x08, WCH_NONE } }, { 'I', CAPLOK, {'i', 'I', 0x09, WCH_NONE } }, { 'J', CAPLOK, {'j', 'J', 0x0a, WCH_NONE } }, - { 'K', CAPLOK, {'k', 'K', 0x0b, 0x0142 } }, - { 'L', CAPLOK, {'l', 'L', 0x0c, 0x0141 } }, + { 'K', CAPLOK, {'k', 'K', 0x0b, 0x0142 } }, + { 'L', CAPLOK, {'l', 'L', 0x0c, 0x0141 } }, { 'M', CAPLOK, {'m', 'M', 0x0d, WCH_NONE } }, - { 'N', CAPLOK, {'n', 'N', 0x0e, '}' } }, + { 'N', CAPLOK, {'n', 'N', 0x0e, '}' } }, { 'O', CAPLOK, {'o', 'O', 0x0f, WCH_NONE } }, { 'P', CAPLOK, {'p', 'P', 0x10, WCH_NONE } }, - { 'Q', CAPLOK, {'q', 'Q', 0x11, '\\' } }, + { 'Q', CAPLOK, {'q', 'Q', 0x11, '\\' } }, { 'R', CAPLOK, {'r', 'R', 0x12, WCH_NONE } }, - { 'S', CAPLOK, {'s', 'S', 0x13, WCH_NONE } }, + { 'S', CAPLOK, {'s', 'S', 0x13, 0x0111 } }, { 'T', CAPLOK, {'t', 'T', 0x14, WCH_NONE } }, { 'U', CAPLOK, {'u', 'U', 0x15, WCH_NONE } }, - { 'V', CAPLOK, {'v', 'V', 0x16, '@' } }, - { 'W', CAPLOK, {'w', 'W', 0x17, '|' } }, - { 'X', CAPLOK, {'x', 'X', 0x18, '#' } }, + { 'V', CAPLOK, {'v', 'V', 0x16, '@' } }, + { 'W', CAPLOK, {'w', 'W', 0x17, '|' } }, + { 'X', CAPLOK, {'x', 'X', 0x18, '#' } }, { 'Y', CAPLOK, {'y', 'Y', 0x19, WCH_NONE } }, { 'Z', CAPLOK, {'z', 'Z', 0x1a, WCH_NONE } }, { 0, 0 } }; -ROSDATA VK_TO_WCHARS1 keypad_numbers[] = { - { VK_NUMPAD0, 0, {'0'} }, - { VK_NUMPAD1, 0, {'1'} }, - { VK_NUMPAD2, 0, {'2'} }, - { VK_NUMPAD3, 0, {'3'} }, - { VK_NUMPAD4, 0, {'4'} }, - { VK_NUMPAD5, 0, {'5'} }, - { VK_NUMPAD6, 0, {'6'} }, - { VK_NUMPAD7, 0, {'7'} }, - { VK_NUMPAD8, 0, {'8'} }, - { VK_NUMPAD9, 0, {'9'} }, - { VK_DECIMAL, 0, {','} }, - { VK_BACK, 0, {'\010'} }, - { 0, 0 } -}; - -#define vk_master(n,x) { (PVK_TO_WCHARS1)x, n, sizeof(x[0]) } +#define vk_master(n, x) { (PVK_TO_WCHARS1)x, n, sizeof(x[0]) } ROSDATA VK_TO_WCHAR_TABLE vk_to_wchar_master_table[] = { - vk_master(1,keypad_numbers), - vk_master(2,key_to_chars_2mod), - vk_master(3,key_to_chars_3mod), - vk_master(4,key_to_chars_4mod), - { 0,0,0 } + vk_master(1, keypad_numbers), + vk_master(2, key_to_chars_2mod), + vk_master(3, key_to_chars_3mod), + vk_master(4, key_to_chars_4mod), + { 0, 0, 0 } }; ROSDATA VSC_LPWSTR key_names[] = { @@ -348,7 +357,9 @@ ROSDATA VSC_LPWSTR extended_key_names[] = { { 0x47, L"Home" }, { 0x48, L"Up" }, { 0x49, L"Page Up" }, - { 0x4a, L"Left" }, + /* { 0x4a, L"Left" },*/ + { 0x4a, L"-" }, + { 0x4b, L"Left" }, { 0x4c, L"Center" }, { 0x4d, L"Right" }, { 0x4f, L"End" }, @@ -423,9 +434,9 @@ ROSDATA DEADKEY dead_key[] = { }; ROSDATA DEADKEY_LPWSTR dead_key_names[] = { - L"\x00a1" L"hacek", // caron - L"\x00b4" L"carka", // acute - L"\x005e" L"krouzek", // ring + L"\x00a1" L"hacek", // caron + L"\x00b4" L"carka", // acute + L"\x005e" L"krouzek", // ring NULL }; diff --git a/dll/keyboard/kbdcz1/kbdcz1.c b/dll/keyboard/kbdcz1/kbdcz1.c index e4b6e923af2..e71f2f9fcad 100644 --- a/dll/keyboard/kbdcz1/kbdcz1.c +++ b/dll/keyboard/kbdcz1/kbdcz1.c @@ -78,7 +78,7 @@ ROSDATA USHORT scancode_to_vk[] = { VK_SNAPSHOT, /* - 55 - */ /* Oddities, and the remaining standard F-Keys */ - VK_EMPTY, VK_EMPTY, VK_F11, VK_F12, + VK_EMPTY, VK_OEM_102, VK_F11, VK_F12, /* - 59 - */ VK_CLEAR, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* EREOF */ VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* ZOOM */ @@ -159,89 +159,21 @@ ROSDATA VK_TO_BIT modifier_keys[] = { ROSDATA MODIFIERS modifier_bits = { modifier_keys, - 7, - { 0, 1, 2, 0, 0, 0, 3, 0 } - /* Modifier bit order: NONE, SHIFT, CTRL, SHIFT-CTRL, ALT (not used), SHIFT-ALT (not used), CTRL-ALT, SHIFT-CTRL-ALT */ -}; - -ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[] = { - /* Keys that do not have shift states */ - { VK_TAB, 0, {'\t','\t'} }, - { VK_ADD, 0, {'+', '+'} }, - { VK_SUBTRACT, 0, {'-', '-'} }, - { VK_MULTIPLY, 0, {'*', '*'} }, - { VK_DIVIDE, 0, {'/', '/'} }, - { VK_OEM_2 ,0, {'-', '_'} }, - { VK_ESCAPE, 0, {0x1b,0x1b} }, - { VK_SPACE, 0, {' ', ' '} }, - { 0, 0 } -}; - -ROSDATA VK_TO_WCHARS3 key_to_chars_3mod[] = { - /* normal - shift - ctrl */ - /* The alphabet */ - { 'A', CAPLOK, {'a', 'A', 0x01} }, - { 'B', CAPLOK, {'b', 'B', 0x02} }, - { 'C', CAPLOK, {'c', 'C', 0x03} }, - { 'D', CAPLOK, {'d', 'D', 0x04} }, - { 'F', CAPLOK, {'f', 'F', 0x06} }, - { 'G', CAPLOK, {'g', 'G', 0x07} }, - { 'H', CAPLOK, {'h', 'H', 0x08} }, - { 'I', CAPLOK, {'i', 'I', 0x09} }, - { 'J', CAPLOK, {'j', 'J', 0x0a} }, - { 'K', CAPLOK, {'k', 'K', 0x0b} }, - { 'L', CAPLOK, {'l', 'L', 0x0c} }, - { 'M', CAPLOK, {'m', 'M', 0x0d} }, - { 'N', CAPLOK, {'n', 'N', 0x0e} }, - { 'O', CAPLOK, {'o', 'O', 0x0f} }, - { 'P', CAPLOK, {'p', 'P', 0x10} }, - { 'Q', CAPLOK, {'q', 'Q', 0x11} }, - { 'R', CAPLOK, {'r', 'R', 0x12} }, - { 'S', CAPLOK, {'s', 'S', 0x13} }, - { 'T', CAPLOK, {'t', 'T', 0x14} }, - { 'U', CAPLOK, {'u', 'U', 0x15} }, - { 'V', CAPLOK, {'v', 'V', 0x16} }, - { 'W', CAPLOK, {'w', 'W', 0x17} }, - { 'X', CAPLOK, {'x', 'X', 0x18} }, - { 'Y', CAPLOK, {'y', 'Y', 0x19} }, - { 'Z', CAPLOK, {'z', 'Z', 0x1a} }, - - /* Legacy (telnet-style) ascii escapes */ - { VK_RETURN, 0, {'\r', '\r', '\n'} }, - { 0,0 } -}; - -ROSDATA VK_TO_WCHARS4 key_to_chars_4mod[] = { -/* Normal, shifted, control, Alt+Gr */ - { '1', 0, {'+', '1', WCH_NONE, '!' } }, - { '2', 0, {0x011b, '2', 0, '@' } }, // e with caron - { '3', 0, {0x0161, '3', WCH_NONE, '#' } }, // s with caron - { '4', 0, {0x010d, '4', WCH_NONE, '$' } }, // c with caron - { '5', 0, {0x0159, '5', WCH_NONE, '%' } }, // r with caron - { '6', 0, {0x017e, '6', 0x1e, '^' } }, // z with caron - { '7', 0, {0x00fd, '7', WCH_NONE, '&' } }, // y with acute - { '8', 0, {0x00e1, '8', WCH_NONE, '*' } }, // a with acute - { '9', 0, {0x00ed, '9', WCH_NONE, '(' } }, // i with acute - { '0', 0, {0x00e9, '0', WCH_NONE, ')' } }, // e with acute - { VK_OEM_PLUS, 0, {WCH_DEAD, WCH_DEAD, WCH_NONE, '=' } }, // dead letters - acute, caron - { VK_EMPTY, 0, {0x00b4, 0x02c7, WCH_NONE, WCH_NONE } }, // VK_OEM_PLUS death - { VK_OEM_MINUS, 0, {'=', '%', 0x1f, '-' } }, - { VK_OEM_1, 0, {0x016f, '\"', WCH_NONE, ';' } }, // u with ring - { VK_OEM_7, 0, {0x00a7, '!', WCH_NONE, 0x00a4 } }, // section sign - { VK_OEM_4, 0, {0x00fa, '/', WCH_NONE, '[' } }, // u with acute - { VK_OEM_5, 0, {WCH_DEAD, 0x2018, WCH_NONE, '\\' } }, // diaeresis, left single quotation mark - { VK_EMPTY, 0, {0x00a8, WCH_NONE, WCH_NONE, WCH_NONE } }, // VK_OEM_5 death - { VK_OEM_6, 0, {')', '(', WCH_NONE, ']' } }, - { VK_OEM_3, 0, {';', WCH_DEAD, WCH_NONE, '`' } }, // ring - { VK_EMPTY, 0, {WCH_NONE, 0x00b0, WCH_NONE, WCH_NONE } }, // VK_OEM_3 death - { VK_OEM_COMMA, 0, {',', '?', WCH_NONE, '<' } }, - { VK_OEM_PERIOD, 0, {'.', ':', WCH_NONE, '>' } }, - { 'E', CAPLOK, {'e', 'E', 0x05, 0x20AC } }, // symbol for euro (currency) - { 0, 0 } + 7, /* Modifier bit order */ + { + 0, /* NONE */ + 1, /* SHIFT */ + 2, /* CTRL */ + 0, /* SHIFT-CTRL (not used) */ + 0, /* ALT (not used) */ + 0, /* SHIFT-ALT (not used) */ + 3, /* CTRL-ALT */ + 4, /* SHIFT-CTRL-ALT */ + } }; +/* ^ This table shows which column in any VK_TO_WCHARS* structure will be used on which modifier */ ROSDATA VK_TO_WCHARS1 keypad_numbers[] = { - { VK_DECIMAL, 0, {','} }, { VK_NUMPAD0, 0, {'0'} }, { VK_NUMPAD1, 0, {'1'} }, { VK_NUMPAD2, 0, {'2'} }, @@ -252,18 +184,103 @@ ROSDATA VK_TO_WCHARS1 keypad_numbers[] = { { VK_NUMPAD7, 0, {'7'} }, { VK_NUMPAD8, 0, {'8'} }, { VK_NUMPAD9, 0, {'9'} }, + { VK_DECIMAL, 0, {','} }, { VK_BACK, 0, {'\010'} }, { 0, 0 } }; -#define vk_master(n,x) { (PVK_TO_WCHARS1)x, n, sizeof(x[0]) } +ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[] = { + /* Keys that do not have shift states */ + { VK_TAB, 0, { '\t', '\t' } }, + { VK_ADD, 0, { '+', '+' } }, + { VK_SUBTRACT, 0, { '-', '-' } }, + { VK_MULTIPLY, 0, { '*', '*' } }, + { VK_DIVIDE, 0, { '/', '/' } }, + { VK_ESCAPE, 0, { 0x1b, 0x1b } }, + { VK_SPACE, 0, { ' ', ' ' } }, + { 0, 0 } +}; + +ROSDATA VK_TO_WCHARS3 key_to_chars_3mod[] = { + /* normal - shift - ctrl */ + + /* Legacy (telnet-style) ascii escapes */ + { VK_RETURN, 0, {'\r', '\r', '\n' } }, + { 0,0 } +}; + +ROSDATA VK_TO_WCHARS5 key_to_chars_5mod[] = { +/* Normal, shifted, control, Alt+Gr, Sh+Alt+Gr */ + + /* The numbers */ + { '1', 0, { '+', '1', WCH_NONE, '!', WCH_NONE } }, + { '2', 0, { 0x011b, '2', 0, '@', WCH_NONE } }, // e with caron + { '3', 0, { 0x0161, '3', WCH_NONE, '#', WCH_NONE } }, // s with caron + { '4', 0, { 0x010d, '4', WCH_NONE, '$', WCH_NONE } }, // c with caron + { '5', 0, { 0x0159, '5', WCH_NONE, '%', WCH_NONE } }, // r with caron + { '6', 0, { 0x017e, '6', 0x1e, '^', WCH_NONE } }, // z with caron + { '7', 0, { 0x00fd, '7', WCH_NONE, '&', WCH_NONE } }, // y with acute + { '8', 0, { 0x00e1, '8', WCH_NONE, '*', WCH_NONE } }, // a with acute + { '9', 0, { 0x00ed, '9', WCH_NONE, '(', WCH_NONE } }, // i with acute + { '0', 0, { 0x00e9, '0', WCH_NONE, ')', WCH_NONE } }, // e with acute + + /* The misc */ + { VK_OEM_PLUS, 0, { WCH_DEAD, WCH_DEAD, WCH_NONE, '=', '+' } }, // dead letters - acute, caron + { VK_EMPTY, 0, { 0x00b4, 0x02c7, WCH_NONE, WCH_NONE, WCH_NONE } }, // VK_OEM_PLUS dead letter + { VK_OEM_MINUS, 0, { '=', '%', 0x1f, '-', '_' } }, + { VK_OEM_1, 0, { 0x016f, '\"', WCH_NONE, ';', ':' } }, // u with ring + { VK_OEM_7, 0, { 0x00a7, '!', WCH_NONE, 0x00a4, WCH_DEAD } }, // section sign, currency sign + { VK_EMPTY, 0, { WCH_NONE, WCH_NONE, WCH_NONE, WCH_NONE, '^' } }, // VK_OEM_7 dead letter + { VK_OEM_4, 0, { 0x00fa, '/', WCH_NONE, '[', '{' } }, // u with acute + { VK_OEM_5, 0, { WCH_DEAD, 0x2018, WCH_NONE, '\\', '|' } }, // diaeresis, left single quotation mark + { VK_EMPTY, 0, { 0x00a8, WCH_NONE, WCH_NONE, WCH_NONE, WCH_NONE } }, // VK_OEM_5 dead letter + { VK_OEM_6, 0, { ')', '(', WCH_NONE, ']', '}' } }, + { VK_OEM_3, 0, { ';', WCH_DEAD, WCH_NONE, '`', '~' } }, // ring + { VK_EMPTY, 0, { WCH_NONE, 0x00b0, WCH_NONE, WCH_NONE, WCH_NONE } }, // VK_OEM_3 dead letter + { VK_OEM_COMMA, 0, { ',', '?', WCH_NONE, '<', 0x00d7 } }, // multiplication sign + { VK_OEM_PERIOD, 0, { '.', ':', WCH_NONE, '>', 0x00f7 } }, // division sign + { VK_OEM_2, 0, { '-', '_', WCH_NONE, '/', '?' } }, + { VK_OEM_102, 0, { '\\', '|', 0x1c/*FS*/, 0x00df, WCH_DEAD } }, // sharp s, double acute accent + { VK_EMPTY, 0, { WCH_NONE, WCH_NONE, WCH_NONE, WCH_NONE, 0x02dd } }, // VK_OEM_102 dead letter + + /* The alphabet */ + { 'A', CAPLOK, { 'a', 'A', 0x01, WCH_NONE, WCH_NONE } }, + { 'B', CAPLOK, { 'b', 'B', 0x02, WCH_NONE, WCH_NONE } }, + { 'C', CAPLOK, { 'c', 'C', 0x03, WCH_NONE, WCH_NONE } }, + { 'D', CAPLOK, { 'd', 'D', 0x04, WCH_NONE, WCH_NONE } }, + { 'E', CAPLOK, { 'e', 'E', 0x05, 0x20AC, WCH_NONE } }, // symbol for euro (currency) + { 'F', CAPLOK, { 'f', 'F', 0x06, WCH_NONE, WCH_NONE } }, + { 'G', CAPLOK, { 'g', 'G', 0x07, WCH_NONE, WCH_NONE } }, + { 'H', CAPLOK, { 'h', 'H', 0x08, WCH_NONE, WCH_NONE } }, + { 'I', CAPLOK, { 'i', 'I', 0x09, WCH_NONE, WCH_NONE } }, + { 'J', CAPLOK, { 'j', 'J', 0x0a, WCH_NONE, WCH_NONE } }, + { 'K', CAPLOK, { 'k', 'K', 0x0b, WCH_NONE, WCH_NONE } }, + { 'L', CAPLOK, { 'l', 'L', 0x0c, WCH_NONE, WCH_NONE } }, + { 'M', CAPLOK, { 'm', 'M', 0x0d, WCH_NONE, WCH_NONE } }, + { 'N', CAPLOK, { 'n', 'N', 0x0e, WCH_NONE, WCH_NONE } }, + { 'O', CAPLOK, { 'o', 'O', 0x0f, WCH_NONE, WCH_NONE } }, + { 'P', CAPLOK, { 'p', 'P', 0x10, WCH_NONE, WCH_NONE } }, + { 'Q', CAPLOK, { 'q', 'Q', 0x11, WCH_NONE, WCH_NONE } }, + { 'R', CAPLOK, { 'r', 'R', 0x12, WCH_NONE, WCH_NONE } }, + { 'S', CAPLOK, { 's', 'S', 0x13, WCH_NONE, WCH_NONE } }, + { 'T', CAPLOK, { 't', 'T', 0x14, WCH_NONE, WCH_NONE } }, + { 'U', CAPLOK, { 'u', 'U', 0x15, WCH_NONE, WCH_NONE } }, + { 'V', CAPLOK, { 'v', 'V', 0x16, WCH_NONE, WCH_NONE } }, + { 'W', CAPLOK, { 'w', 'W', 0x17, WCH_NONE, WCH_NONE } }, + { 'X', CAPLOK, { 'x', 'X', 0x18, WCH_NONE, WCH_NONE } }, + { 'Y', CAPLOK, { 'y', 'Y', 0x19, WCH_NONE, WCH_NONE } }, + { 'Z', CAPLOK, { 'z', 'Z', 0x1a, WCH_NONE, WCH_NONE } }, + { 0, 0 } +}; + +#define vk_master(n, x) { (PVK_TO_WCHARS1)x, n, sizeof(x[0]) } ROSDATA VK_TO_WCHAR_TABLE vk_to_wchar_master_table[] = { - vk_master(1,keypad_numbers), - vk_master(2,key_to_chars_2mod), - vk_master(3,key_to_chars_3mod), - vk_master(4,key_to_chars_4mod), - { 0,0,0 } + vk_master(1, keypad_numbers), + vk_master(2, key_to_chars_2mod), + vk_master(3, key_to_chars_3mod), + vk_master(5, key_to_chars_5mod), + { 0, 0, 0 } }; ROSDATA VSC_LPWSTR key_names[] = { @@ -333,7 +350,9 @@ ROSDATA VSC_LPWSTR extended_key_names[] = { { 0x47, L"Home" }, { 0x48, L"Up" }, { 0x49, L"Page Up" }, - { 0x4a, L"Left" }, + /* { 0x4a, L"Left" },*/ + { 0x4a, L"-" }, + { 0x4b, L"Left" }, { 0x4c, L"Center" }, { 0x4d, L"Right" }, { 0x4f, L"End" }, @@ -401,16 +420,16 @@ ROSDATA DEADKEY dead_key[] = { { DEADTRANS(0x0075, 0x00a8, 0x00fc, 0x0000) }, // u with diaeresis { DEADTRANS(0x0020, 0x00a8, 0x00a8, 0x0000) }, // space > diaeresis - { DEADTRANS(0x0055, 0x00b0, 0x016e, 0x0000) }, // U with round - { DEADTRANS(0x0075, 0x00b0, 0x016f, 0x0000) }, // u with round - { DEADTRANS(0x0020, 0x00b0, 0x00b0, 0x0000) }, // space > round + { DEADTRANS(0x0055, 0x00b0, 0x016e, 0x0000) }, // U with ring + { DEADTRANS(0x0075, 0x00b0, 0x016f, 0x0000) }, // u with ring + { DEADTRANS(0x0020, 0x00b0, 0x00b0, 0x0000) }, // space > ring { 0, 0, 0 }, }; ROSDATA DEADKEY_LPWSTR dead_key_names[] = { - L"\x00a1" L"hacek", // caron - L"\x00b4" L"carka", // acute - L"\x005e" L"krouzek", // round + L"\x00a1" L"hacek", // caron + L"\x00b4" L"carka", // acute + L"\x005e" L"krouzek", // ring NULL }; @@ -422,7 +441,7 @@ ROSDATA KBDTABLES keyboard_layout_table = { /* character from vk tables */ vk_to_wchar_master_table, - /* diacritical marks -- */ + /* diacritical marks */ dead_key, /* Key names */ @@ -447,4 +466,3 @@ ROSDATA KBDTABLES keyboard_layout_table = { PKBDTABLES WINAPI KbdLayerDescriptor(VOID) { return &keyboard_layout_table; } - diff --git a/dll/ntdll/csr/capture.c b/dll/ntdll/csr/capture.c index 0718a3b1d49..ad266250c9b 100644 --- a/dll/ntdll/csr/capture.c +++ b/dll/ntdll/csr/capture.c @@ -3,7 +3,8 @@ * PROJECT: ReactOS kernel * FILE: dll/ntdll/csr/capture.c * PURPOSE: Routines for probing and capturing CSR API Messages - * PROGRAMMER: Alex Ionescu (alex@relsoft.net) + * PROGRAMMERS: Alex Ionescu (alex@relsoft.net) + * Hermes Belusca-Maito (hermes.belusca@sfr.fr) */ /* INCLUDES *******************************************************************/ diff --git a/dll/ntdll/def/ntdll.spec b/dll/ntdll/def/ntdll.spec index c649d574d51..06be9877f52 100644 --- a/dll/ntdll/def/ntdll.spec +++ b/dll/ntdll/def/ntdll.spec @@ -1,4 +1,15 @@ - +;@ stdcall PropertyLengthAsVariant(ptr long long long) +;@ stdcall RtlConvertPropertyToVariant(ptr long ptr ptr) +;@ stdcall RtlConvertVariantToProperty(ptr long ptr ptr ptr long ptr) +@ fastcall RtlActivateActivationContextUnsafeFast(ptr ptr) +@ fastcall RtlDeactivateActivationContextUnsafeFast(ptr) +@ stdcall RtlInterlockedPushListSList(ptr ptr ptr long) +@ fastcall -arch=i386 RtlUlongByteSwap(long) +@ fastcall -ret64 RtlUlonglongByteSwap(double) +@ fastcall -arch=i386 RtlUshortByteSwap(long) +@ stdcall -arch=i386,x86_64 ExpInterlockedPopEntrySListEnd() +@ stdcall -arch=i386,x86_64 ExpInterlockedPopEntrySListFault() +@ stdcall -arch=i386,x86_64 ExpInterlockedPopEntrySListResume() @ stdcall CsrAllocateCaptureBuffer(long long) @ stdcall CsrAllocateMessagePointer(ptr long ptr) @ stdcall CsrCaptureMessageBuffer(ptr ptr long ptr) @@ -32,12 +43,42 @@ @ stdcall DbgUiStopDebugging(ptr) @ stdcall DbgUiWaitStateChange(ptr ptr) @ stdcall DbgUserBreakPoint() +# EtwControlTraceA +# EtwControlTraceW +# EtwCreateTraceInstanceId +# EtwEnableTrace +# EtwEnumerateTraceGuids +# EtwFlushTraceA +# EtwFlushTraceW +# EtwGetTraceEnableFlags +# EtwGetTraceEnableLevel +# EtwGetTraceLoggerHandle +# EtwNotificationRegistrationA +# EtwNotificationRegistrationW +# EtwQueryAllTracesA +# EtwQueryAllTracesW +# EtwQueryTraceA +# EtwQueryTraceW +# EtwReceiveNotificationsA +# EtwReceiveNotificationsW +# EtwRegisterTraceGuidsA +# EtwRegisterTraceGuidsW +# EtwStartTraceA +# EtwStartTraceW +# EtwStopTraceA +# EtwStopTraceW +# EtwTraceEvent +# EtwTraceEventInstance +# EtwTraceMessage +# EtwTraceMessageVa +# EtwUnregisterTraceGuids +# EtwUpdateTraceA +# EtwUpdateTraceW +# EtwpGetTraceBuffer +# EtwpSetHWConfigFunction @ stdcall -arch=i386 KiFastSystemCall() @ stdcall -arch=i386 KiFastSystemCallRet() @ stdcall -arch=i386 KiIntSystemCall() -@ stdcall -arch=i386,x86_64 ExpInterlockedPopEntrySListEnd() -@ stdcall -arch=i386,x86_64 ExpInterlockedPopEntrySListFault() -@ stdcall -arch=i386,x86_64 ExpInterlockedPopEntrySListResume() @ stdcall KiRaiseUserExceptionDispatcher() @ stdcall KiUserApcDispatcher(ptr ptr ptr ptr) @ stdcall KiUserCallbackDispatcher(ptr ptr long) ; CHECKME @@ -69,6 +110,7 @@ @ stdcall LdrOpenImageFileOptionsKey(ptr long ptr) ; 5.2 SP1 and higher @ stdcall LdrProcessRelocationBlock(ptr long ptr long) @ stdcall LdrQueryImageFileExecutionOptions(ptr str long ptr long ptr) +;@ stdcall LdrQueryImageFileExecutionOptionsEx(ptr ptr long ptr long ptr long) @ stdcall LdrQueryImageFileKeyOption(ptr ptr long ptr long ptr) @ stdcall LdrQueryProcessModuleInformation(ptr long ptr) ;@ stdcall LdrSetAppCompatDllRedirectionCallback @@ -148,6 +190,7 @@ @ stdcall NtDelayExecution(long ptr) @ stdcall NtDeleteAtom(long) @ stdcall NtDeleteBootEntry(long) +# NtDeleteDriverEntry @ stdcall NtDeleteFile(ptr) @ stdcall NtDeleteKey(long) @ stdcall NtDeleteObjectAuditAlarm(ptr ptr long) @@ -157,6 +200,7 @@ @ stdcall NtDuplicateObject(long long long ptr long long long) @ stdcall NtDuplicateToken(long long long long long long) @ stdcall NtEnumerateBootEntries(ptr ptr) +;@ stdcall NtEnumerateDriverEntries(ptr ptr) @ stdcall NtEnumerateKey (long long long long long long) @ stdcall NtEnumerateSystemEnvironmentValuesEx(long ptr long) @ stdcall NtEnumerateValueKey(long long long long long long) @@ -188,6 +232,7 @@ @ stdcall NtLoadDriver(ptr) @ stdcall NtLoadKey2(ptr ptr long) @ stdcall NtLoadKey(ptr ptr) +;@ stdcall NtLoadKeyEx(ptr ptr long ptr) @ stdcall NtLockFile(long long ptr ptr ptr ptr ptr ptr long long) @ stdcall NtLockProductActivationKeys(ptr ptr) @ stdcall NtLockRegistryKey(ptr) @@ -198,6 +243,7 @@ @ stdcall NtMapUserPhysicalPagesScatter(ptr ptr ptr) @ stdcall NtMapViewOfSection(long long ptr long long ptr ptr long long long) @ stdcall NtModifyBootEntry(ptr) +# NtModifyDriverEntry @ stdcall NtNotifyChangeDirectoryFile(long long ptr ptr ptr ptr long long long) @ stdcall NtNotifyChangeKey(long long ptr ptr ptr long long ptr long long) @ stdcall NtNotifyChangeMultipleKeys(ptr long ptr ptr ptr ptr ptr long long ptr long long) @@ -236,6 +282,7 @@ @ stdcall NtQueryDefaultUILanguage(ptr) @ stdcall NtQueryDirectoryFile(long long ptr ptr ptr ptr long long long ptr long) @ stdcall NtQueryDirectoryObject(long ptr long long long ptr ptr) +;@ stdcall NtQueryDriverEntryOrder(ptr ptr) @ stdcall NtQueryEaFile(long ptr ptr long long ptr long ptr long) @ stdcall NtQueryEvent(long long ptr long ptr) @ stdcall NtQueryFullAttributesFile(ptr ptr) @@ -254,6 +301,7 @@ @ stdcall NtQueryMutant(long long ptr long ptr) @ stdcall NtQueryObject(long long long long long) @ stdcall NtQueryOpenSubKeys(ptr ptr) +;@ stdcall NtQueryOpenSubKeysEx(ptr long ptr ptr) @ stdcall NtQueryPerformanceCounter(ptr ptr) @ stdcall NtQueryPortInformationProcess() @ stdcall NtQueryQuotaInformationFile(ptr ptr ptr long long ptr long ptr long) @@ -309,6 +357,7 @@ @ stdcall NtSetDefaultHardErrorPort(ptr) @ stdcall NtSetDefaultLocale(long long) @ stdcall NtSetDefaultUILanguage(long) +;@ stdcall NtSetDriverEntryOrder(ptr ptr) @ stdcall NtSetEaFile(long ptr ptr long) @ stdcall NtSetEvent(long long) @ stdcall NtSetEventBoostPriority(ptr) @@ -354,6 +403,7 @@ @ stdcall NtTraceEvent(long long long ptr) @ stdcall NtTranslateFilePath(ptr long ptr long) @ stdcall NtUnloadDriver(ptr) +;@ stdcall NtUnloadKey2(ptr long) @ stdcall NtUnloadKey(long) @ stdcall NtUnloadKeyEx(ptr ptr) @ stdcall NtUnlockFile(long ptr ptr ptr ptr) @@ -362,6 +412,7 @@ @ stdcall NtVdmControl(long ptr) @ stdcall NtWaitForDebugEvent(ptr long ptr ptr) @ stdcall NtWaitForKeyedEvent(ptr ptr long ptr) +;@ stdcall NtWaitForMultipleObjects32(long ptr long long ptr) @ stdcall NtWaitForMultipleObjects(long ptr long long ptr) @ stdcall NtWaitForSingleObject(long long long) @ stdcall NtWaitHighEventPair(ptr) @@ -375,18 +426,14 @@ ;@ stdcall PfxInitialize ;@ stdcall PfxInsertPrefix ;@ stdcall PfxRemovePrefix -;@ stdcall PropertyLengthAsVariant @ stdcall RtlAbortRXact(ptr) @ stdcall RtlAbsoluteToSelfRelativeSD(ptr ptr ptr) @ stdcall RtlAcquirePebLock() @ stdcall RtlAcquirePrivilege(ptr long long ptr) @ stdcall RtlAcquireResourceExclusive(ptr long) @ stdcall RtlAcquireResourceShared(ptr long) -@ stdcall RtlAcquireSRWLockExclusive(ptr) -@ stdcall RtlAcquireSRWLockShared(ptr) @ stdcall RtlActivateActivationContext(long ptr ptr) @ stdcall RtlActivateActivationContextEx(long ptr ptr ptr) -@ fastcall RtlActivateActivationContextUnsafeFast(ptr ptr) @ stdcall RtlAddAccessAllowedAce(ptr long long ptr) @ stdcall RtlAddAccessAllowedAceEx(ptr long long long ptr) @ stdcall RtlAddAccessAllowedObjectAce(ptr long long long ptr ptr ptr) @@ -401,9 +448,7 @@ @ stdcall RtlAddAuditAccessAceEx(ptr long long long ptr long long) @ stdcall RtlAddAuditAccessObjectAce(ptr long long long ptr ptr ptr long long) ;@ stdcall RtlAddCompoundAce -;@ stdcall RtlAddRange ; 5.0 and 5.1 only @ stdcall -arch=x86_64 RtlAddFunctionTable(ptr long long) -;@ stdcall RtlAddMandatoryAce(ptr long long long long ptr) @ stdcall RtlAddRefActivationContext(ptr) @ stdcall RtlAddRefMemoryStream(ptr) @ stdcall RtlAddVectoredContinueHandler(long ptr) @@ -454,19 +499,16 @@ @ stdcall RtlConsoleMultiByteToUnicodeN(ptr long ptr ptr long ptr) @ stdcall RtlConvertExclusiveToShared(ptr) @ stdcall -arch=win32 -ret64 RtlConvertLongToLargeInteger(long) -;@ stdcall RtlConvertPropertyToVariant @ stdcall RtlConvertSharedToExclusive(ptr) @ stdcall RtlConvertSidToUnicodeString(ptr ptr long) @ stdcall RtlConvertToAutoInheritSecurityObject(ptr ptr ptr ptr long ptr) ;@ stdcall RtlConvertUiListToApiList @ stdcall -arch=win32 -ret64 RtlConvertUlongToLargeInteger(long) -;@ stdcall RtlConvertVariantToProperty @ stdcall RtlCopyLuid(ptr ptr) @ stdcall RtlCopyLuidAndAttributesArray(long ptr ptr) ;@ stdcall RtlCopyMappedMemory @ stdcall RtlCopyMemoryStreamTo(ptr ptr int64 ptr ptr) @ stdcall RtlCopyOutOfProcessMemoryStreamTo(ptr ptr int64 ptr ptr) RtlCopyMemoryStreamTo -;@ stdcall RtlCopyRangeList ; 5.0 and 5.1 only @ stdcall RtlCopySecurityDescriptor(ptr ptr) @ stdcall RtlCopySid(long ptr ptr) @ stdcall RtlCopySidAndAttributesArray(long ptr long ptr ptr ptr ptr) @@ -496,7 +538,7 @@ @ stdcall RtlCutoverTimeToSystemTime(ptr ptr ptr long) @ stdcall RtlDeNormalizeProcessParams(ptr) @ stdcall RtlDeactivateActivationContext(long long) -@ fastcall RtlDeactivateActivationContextUnsafeFast(ptr) +# RtlDebugPrintTimes @ stdcall RtlDecodePointer(ptr) @ stdcall RtlDecodeSystemPointer(ptr) RtlEncodeSystemPointer @ stdcall RtlDecompressBuffer(long ptr long ptr long ptr) @@ -510,8 +552,6 @@ @ stdcall RtlDeleteElementGenericTableAvl(ptr ptr) @ cdecl -arch=x86_64 RtlDeleteFunctionTable(ptr) @ stdcall RtlDeleteNoSplay(ptr ptr) -@ stdcall RtlDeleteOwnersRanges(ptr ptr) -@ stdcall RtlDeleteRange(ptr long long long long ptr) @ stdcall RtlDeleteRegistryValue(long ptr ptr) @ stdcall RtlDeleteResource(ptr) @ stdcall RtlDeleteSecurityObject(ptr) @@ -579,18 +619,13 @@ @ stdcall RtlFindClearBitsAndSet(ptr long long) @ stdcall RtlFindClearRuns(ptr ptr long long) @ stdcall RtlFindLastBackwardRunClear(ptr long ptr) -;@ stdcall RtlFindLastBackwardRunSet(ptr long ptr) @ stdcall RtlFindLeastSignificantBit(double) @ stdcall RtlFindLongestRunClear(ptr long) -@ stdcall RtlFindLongestRunSet(ptr long) @ stdcall RtlFindMessage(long long long long ptr) @ stdcall RtlFindMostSignificantBit(double) @ stdcall RtlFindNextForwardRunClear(ptr long ptr) -;@ stdcall RtlFindNextForwardRunSet(ptr long ptr) -@ stdcall RtlFindRange(ptr long long long long long long long long ptr ptr ptr) @ stdcall RtlFindSetBits(ptr long long) @ stdcall RtlFindSetBitsAndClear(ptr long long) -;@ stdcall RtlFindSetRuns(ptr ptr long long) @ stdcall RtlFirstEntrySList(ptr) @ stdcall RtlFirstFreeAce(ptr ptr) @ stdcall RtlFlushSecureMemoryCache(ptr ptr) @@ -602,7 +637,6 @@ @ stdcall RtlFreeHandle(ptr ptr) @ stdcall RtlFreeHeap(long long long) @ stdcall RtlFreeOemString(ptr) -@ stdcall RtlFreeRangeList(ptr) @ stdcall RtlFreeSid(long) @ stdcall RtlFreeThreadActivationContextStack() @ stdcall RtlFreeUnicodeString(ptr) @@ -621,7 +655,6 @@ @ stdcall RtlGetDaclSecurityDescriptor(ptr ptr ptr ptr) @ stdcall RtlGetElementGenericTable(ptr long) @ stdcall RtlGetElementGenericTableAvl(ptr long) -@ stdcall RtlGetFirstRange(ptr ptr ptr) ;@ stdcall RtlGetFrame @ stdcall RtlGetFullPathName_U(wstr long ptr ptr) @ stdcall RtlGetFullPathName_UstrEx(ptr ptr ptr ptr ptr ptr ptr ptr) @@ -633,12 +666,10 @@ @ stdcall RtlGetLengthWithoutTrailingPathSeperators(long ptr ptr) RtlGetLengthWithoutTrailingPathSeparators @ stdcall RtlGetLongestNtPathLength() @ stdcall RtlGetNativeSystemInformation(long long long long) NtQuerySystemInformation -@ stdcall RtlGetNextRange(ptr ptr long) @ stdcall RtlGetNtGlobalFlags() @ stdcall RtlGetNtProductType(ptr) @ stdcall RtlGetNtVersionNumbers(ptr ptr ptr) @ stdcall RtlGetOwnerSecurityDescriptor(ptr ptr ptr) -;@ stdcall RtlGetProductInfo(long long long long ptr) @ stdcall RtlGetProcessHeaps(long ptr) @ stdcall RtlGetSaclSecurityDescriptor(ptr ptr ptr ptr) @ stdcall RtlGetSecurityDescriptorRMControl(ptr ptr) @@ -669,19 +700,17 @@ @ stdcall RtlInitializeContext(ptr ptr ptr ptr ptr) @ stdcall RtlInitializeCriticalSection(ptr) @ stdcall RtlInitializeCriticalSectionAndSpinCount(ptr long) -;@ stdcall RtlInitializeCriticalSectionEx(ptr long long) @ stdcall RtlInitializeGenericTable(ptr ptr ptr ptr ptr) @ stdcall RtlInitializeGenericTableAvl(ptr ptr ptr ptr ptr) @ stdcall RtlInitializeHandleTable(long long ptr) @ stdcall RtlInitializeRXact(ptr long ptr) -@ stdcall RtlInitializeRangeList(ptr) @ stdcall RtlInitializeResource(ptr) @ stdcall RtlInitializeSListHead(ptr) @ stdcall RtlInitializeSid(ptr ptr long) -@ stdcall RtlInitializeSRWLock(ptr) -;@ stdcall RtlInitializeStackTraceDataBase ; 5.1 SP2 and SP3, and 5.2 only @ stdcall RtlInsertElementGenericTable(ptr ptr long ptr) @ stdcall RtlInsertElementGenericTableAvl(ptr ptr long ptr) +# RtlInsertElementGenericTableFull +;@ stdcall RtlInsertElementGenericTableFullAvl(ptr ptr long ptr ptr long) @ stdcall -arch=x86_64 RtlInstallFunctionTableCallback(double double long ptr ptr ptr) @ stdcall RtlInt64ToUnicodeString(double long ptr) @ stdcall RtlIntegerToChar(long long long ptr) @@ -690,8 +719,6 @@ @ stdcall -arch=i386,x86_64 RtlInterlockedFlushSList(ptr) @ stdcall -arch=i386,x86_64 RtlInterlockedPopEntrySList(ptr) @ stdcall -arch=i386,x86_64 RtlInterlockedPushEntrySList(ptr ptr) -@ stdcall RtlInterlockedPushListSList(ptr ptr ptr long) -@ stdcall RtlInvertRangeList(ptr ptr) @ stdcall RtlIpv4AddressToStringA(ptr ptr) @ stdcall RtlIpv4AddressToStringExA(ptr long ptr ptr) @ stdcall RtlIpv4AddressToStringExW(ptr long ptr ptr) @@ -715,7 +742,6 @@ @ stdcall RtlIsGenericTableEmpty(ptr) @ stdcall RtlIsGenericTableEmptyAvl(ptr) @ stdcall RtlIsNameLegalDOS8Dot3(ptr ptr ptr) -@ stdcall RtlIsRangeAvailable(ptr long long long long long long ptr ptr ptr) @ stdcall RtlIsTextUnicode(ptr long ptr) @ stdcall RtlIsThreadWithinLoaderCallout() @ stdcall RtlIsValidHandle(ptr ptr) @@ -740,15 +766,18 @@ @ stdcall RtlLookupAtomInAtomTable(ptr wstr ptr) @ stdcall RtlLookupElementGenericTable(ptr ptr) @ stdcall RtlLookupElementGenericTableAvl(ptr ptr) +# RtlLookupElementGenericTableFull +# RtlLookupElementGenericTableFullAvl @ stdcall -arch=x86_64 RtlLookupFunctionEntry(long ptr ptr) @ stdcall RtlMakeSelfRelativeSD(ptr ptr ptr) @ stdcall RtlMapGenericMask(long ptr) ;@ stdcall RtlMapSecurityErrorToNtStatus -@ stdcall RtlMergeRangeLists(ptr ptr ptr long) @ stdcall RtlMoveMemory(ptr ptr long) @ stdcall RtlMultiAppendUnicodeStringBuffer(ptr long ptr) @ stdcall RtlMultiByteToUnicodeN(ptr long ptr ptr long) @ stdcall RtlMultiByteToUnicodeSize(ptr str long) +# RtlMultipleAllocateHeap +# RtlMultipleFreeHeap @ stdcall RtlNewInstanceSecurityObject(long long ptr ptr ptr ptr ptr long ptr ptr) @ stdcall RtlNewSecurityGrantedAccess(long ptr ptr ptr ptr ptr) @ stdcall RtlNewSecurityObject(ptr ptr ptr long ptr ptr) @@ -771,7 +800,6 @@ ;@ stdcall RtlPopFrame @ stdcall RtlPrefixString(ptr ptr long) @ stdcall RtlPrefixUnicodeString(ptr ptr long) -;@ stdcall RtlPropertySetNameToGuid ; 4.0 only @ stdcall RtlProtectHeap(ptr long) ;@ stdcall RtlPushFrame @ stdcall RtlQueryAtomInAtomTable(ptr long ptr ptr ptr ptr) @@ -786,9 +814,6 @@ @ stdcall RtlQueryProcessDebugInformation(long long ptr) ;@ stdcall RtlQueryProcessHeapInformation ;@ stdcall RtlQueryProcessLockInformation -;@ stdcall RtlQueryProperties ; 4.0 only -;@ stdcall RtlQueryPropertyNames ; 4.0 only -;@ stdcall RtlQueryPropertySet ; 4.0 only @ stdcall RtlQueryRegistryValues(long ptr ptr ptr ptr) @ stdcall RtlQuerySecurityObject(ptr long ptr long ptr) @ stdcall RtlQueryTagHeap(ptr long long long ptr) @@ -812,8 +837,6 @@ @ stdcall RtlReleasePrivilege(ptr) @ stdcall RtlReleaseRelativeName(ptr) @ stdcall RtlReleaseResource(ptr) -@ stdcall RtlReleaseSRWLockExclusive(ptr) -@ stdcall RtlReleaseSRWLockShared(ptr) @ stdcall RtlRemoteCall(ptr ptr ptr long ptr long long) @ stdcall RtlRemoveVectoredContinueHandler(ptr) @ stdcall RtlRemoveVectoredExceptionHandler(ptr) @@ -847,10 +870,6 @@ @ stdcall RtlSetMemoryStreamSize(ptr int64) @ stdcall RtlSetOwnerSecurityDescriptor(ptr ptr long) @ cdecl RtlSetProcessIsCritical(long ptr long) -;@ stdcall RtlSetProperties ; RtlSetProperties -;@ stdcall RtlSetPropertyClassId ; 4.0 only -;@ stdcall RtlSetPropertyNames ; 4.0 only -;@ stdcall RtlSetPropertySetClassId ; 4.0 only @ stdcall RtlSetSaclSecurityDescriptor(ptr long ptr long) @ stdcall RtlSetSecurityDescriptorRMControl(ptr ptr) @ stdcall RtlSetSecurityObject(long ptr ptr ptr ptr) @@ -865,8 +884,6 @@ @ stdcall RtlSetUserFlagsHeap(ptr long ptr long long) @ stdcall RtlSetUserValueHeap(ptr long ptr ptr) @ stdcall RtlSizeHeap(long long ptr) -@ stdcall RtlSleepConditionVariableCS(ptr ptr ptr) -@ stdcall RtlSleepConditionVariableSRW(ptr ptr ptr long) @ stdcall RtlSplay(ptr) @ stdcall RtlStartRXact(ptr) @ stdcall RtlStatMemoryStream(ptr ptr long) @@ -890,8 +907,6 @@ ;@ stdcall RtlTraceDatabaseUnlock ;@ stdcall RtlTraceDatabaseValidate @ stdcall RtlTryEnterCriticalSection(ptr) -@ fastcall -arch=i386 RtlUlongByteSwap(long) -@ fastcall -ret64 RtlUlonglongByteSwap(double) ;@ stdcall RtlUnhandledExceptionFilter2 @ stdcall RtlUnhandledExceptionFilter(ptr) ;@ stdcall RtlUnicodeStringToAnsiSize(ptr) @@ -922,7 +937,6 @@ @ stdcall RtlUpperChar(long) @ stdcall RtlUpperString(ptr ptr) @ stdcall RtlUsageHeap(ptr long ptr) -@ fastcall -arch=i386 RtlUshortByteSwap(long) @ stdcall RtlValidAcl(ptr) @ stdcall RtlValidRelativeSecurityDescriptor(ptr long long) @ stdcall RtlValidSecurityDescriptor(ptr) @@ -936,8 +950,6 @@ @ stdcall RtlWalkHeap(long ptr) @ stdcall RtlWow64EnableFsRedirection(long) @ stdcall RtlWow64EnableFsRedirectionEx(long ptr) -@ stdcall RtlWakeAllConditionVariable(ptr) -@ stdcall RtlWakeConditionVariable(ptr) @ stdcall RtlWriteMemoryStream(ptr ptr long ptr) @ stdcall RtlWriteRegistryValue(long ptr ptr long ptr long) @ stdcall RtlZeroHeap(ptr long) @@ -969,6 +981,7 @@ @ stdcall ZwAccessCheckByTypeResultListAndAuditAlarmByHandle(ptr ptr ptr ptr ptr ptr ptr long long long ptr long ptr long ptr ptr ptr) NtAccessCheckByTypeResultListAndAuditAlarmByHandle @ stdcall ZwAddAtom(ptr long ptr) NtAddAtom @ stdcall ZwAddBootEntry(ptr long) +# ZwAddDriverEntry @ stdcall ZwAdjustGroupsToken(long long long long long long) NtAdjustGroupsToken @ stdcall ZwAdjustPrivilegesToken(long long long long long long) NtAdjustPrivilegesToken @ stdcall ZwAlertResumeThread(long ptr) NtAlertResumeThread @@ -977,12 +990,12 @@ @ stdcall ZwAllocateUserPhysicalPages(ptr ptr ptr) @ stdcall ZwAllocateUuids(ptr ptr ptr ptr) NtAllocateUuids @ stdcall ZwAllocateVirtualMemory(long ptr ptr ptr long long) NtAllocateVirtualMemory +# ZwApphelpCacheControl @ stdcall ZwAreMappedFilesTheSame(ptr ptr) NtAreMappedFilesTheSame @ stdcall ZwAssignProcessToJobObject(long long) NtAssignProcessToJobObject @ stdcall ZwCallbackReturn(ptr long long) @ stdcall ZwCancelDeviceWakeupRequest(ptr) @ stdcall ZwCancelIoFile(long ptr) NtCancelIoFile -;@ stdcall ZwCancelIoFileEx(long ptr ptr) NtCancelIoFileEx @ stdcall ZwCancelTimer(long ptr) NtCancelTimer @ stdcall ZwClearEvent(long) NtClearEvent @ stdcall ZwClose(long) NtClose @@ -1023,6 +1036,7 @@ @ stdcall ZwDelayExecution(long ptr) NtDelayExecution @ stdcall ZwDeleteAtom(long) NtDeleteAtom @ stdcall ZwDeleteBootEntry(long) NtDeleteBootEntry +# ZwDeleteDriverEntry @ stdcall ZwDeleteFile(ptr) NtDeleteFile @ stdcall ZwDeleteKey(long) NtDeleteKey @ stdcall ZwDeleteObjectAuditAlarm(ptr ptr long) @@ -1032,7 +1046,7 @@ @ stdcall ZwDuplicateObject(long long long ptr long long long) NtDuplicateObject @ stdcall ZwDuplicateToken(long long long long long long) NtDuplicateToken @ stdcall ZwEnumerateBootEntries(ptr ptr) -;@ stdcall ZwEnumerateBus ; 3.51 only +# ZwEnumerateDriverEntries @ stdcall ZwEnumerateKey(long long long ptr long ptr) NtEnumerateKey @ stdcall ZwEnumerateSystemEnvironmentValuesEx(long ptr long) NtEnumerateSystemEnvironmentValuesEx @ stdcall ZwEnumerateValueKey(long long long ptr long ptr) NtEnumerateValueKey @@ -1051,7 +1065,6 @@ @ stdcall ZwGetCurrentProcessorNumber() @ stdcall ZwGetDevicePowerState(ptr ptr) @ stdcall ZwGetPlugPlayEvent(long long ptr long) -@ stdcall ZwGetTickCount() RtlGetTickCount @ stdcall ZwGetWriteWatch(long long ptr long ptr ptr ptr) NtGetWriteWatch @ stdcall ZwImpersonateAnonymousToken(ptr) @ stdcall ZwImpersonateClientOfPort(ptr ptr) NtImpersonateClientOfPort @@ -1064,6 +1077,7 @@ @ stdcall ZwLoadDriver(ptr) NtLoadDriver @ stdcall ZwLoadKey2(ptr ptr long) NtLoadKey2 @ stdcall ZwLoadKey(ptr ptr) NtLoadKey +# ZwLoadKeyEx @ stdcall ZwLockFile(long long ptr ptr ptr ptr ptr ptr long long) NtLockFile @ stdcall ZwLockProductActivationKeys(ptr ptr) NtLockProductActivationKeys @ stdcall ZwLockRegistryKey(ptr) NtLockRegistryKey @@ -1074,6 +1088,7 @@ @ stdcall ZwMapUserPhysicalPagesScatter(ptr ptr ptr) @ stdcall ZwMapViewOfSection(long long ptr long long ptr ptr long long long) NtMapViewOfSection @ stdcall ZwModifyBootEntry(ptr) NtModifyBootEntry +# ZwModifyDriverEntry @ stdcall ZwNotifyChangeDirectoryFile(long long ptr ptr ptr ptr long long long) NtNotifyChangeDirectoryFile @ stdcall ZwNotifyChangeKey(long long ptr ptr ptr long long ptr long long) NtNotifyChangeKey @ stdcall ZwNotifyChangeMultipleKeys(ptr long ptr ptr ptr ptr ptr long long ptr long long) NtNotifyChangeMultipleKeys @@ -1112,6 +1127,7 @@ @ stdcall ZwQueryDefaultUILanguage(ptr) NtQueryDefaultUILanguage @ stdcall ZwQueryDirectoryFile(long long ptr ptr ptr ptr long long long ptr long) NtQueryDirectoryFile @ stdcall ZwQueryDirectoryObject(long ptr long long long ptr ptr) NtQueryDirectoryObject +# ZwQueryDriverEntryOrder @ stdcall ZwQueryEaFile(long ptr ptr long long ptr long ptr long) NtQueryEaFile @ stdcall ZwQueryEvent(long long ptr long ptr) NtQueryEvent @ stdcall ZwQueryFullAttributesFile(ptr ptr) NtQueryFullAttributesFile @@ -1130,6 +1146,7 @@ @ stdcall ZwQueryMutant(long long ptr long ptr) NtQueryMutant @ stdcall ZwQueryObject(long long long long long) NtQueryObject @ stdcall ZwQueryOpenSubKeys(ptr ptr) NtQueryOpenSubKeys +# ZwQueryOpenSubKeysEx @ stdcall ZwQueryPerformanceCounter (long long) NtQueryPerformanceCounter @ stdcall ZwQueryPortInformationProcess() NtQueryPortInformationProcess @ stdcall ZwQueryQuotaInformationFile(ptr ptr ptr long long ptr long ptr long) NtQueryQuotaInformationFile @@ -1153,11 +1170,9 @@ @ stdcall ZwReadFileScatter(long long ptr ptr ptr ptr long ptr ptr) NtReadFileScatter @ stdcall ZwReadRequestData(ptr ptr long ptr long ptr) NtReadRequestData @ stdcall ZwReadVirtualMemory(long ptr ptr long ptr) NtReadVirtualMemory -;@ stdcall ZwRegisterNewDevice ; 3.51 only @ stdcall ZwRegisterThreadTerminatePort(ptr) NtRegisterThreadTerminatePort @ stdcall ZwReleaseKeyedEvent(ptr ptr long ptr) NtReleaseKeyedEvent @ stdcall ZwReleaseMutant(long ptr) NtReleaseMutant -;@ stdcall ZwReleaseProcessMutant ; 3.51 only @ stdcall ZwReleaseSemaphore(long long ptr) NtReleaseSemaphore @ stdcall ZwRemoveIoCompletion(ptr ptr ptr ptr ptr) NtRemoveIoCompletion @ stdcall ZwRemoveProcessDebug(ptr ptr) NtRemoveProcessDebug @@ -1187,12 +1202,12 @@ @ stdcall ZwSetDefaultHardErrorPort(ptr) @ stdcall ZwSetDefaultLocale(long long) @ stdcall ZwSetDefaultUILanguage(long) +# ZwSetDriverEntryOrder @ stdcall ZwSetEaFile(long ptr ptr long) @ stdcall ZwSetEvent(long long) @ stdcall ZwSetEventBoostPriority(ptr) @ stdcall ZwSetHighEventPair(ptr) @ stdcall ZwSetHighWaitLowEventPair(ptr) -;@ stdcall ZwSetHighWaitLowThread ; 3.51 and 4.0 only @ stdcall ZwSetInformationDebugObject(ptr long ptr long ptr) @ stdcall ZwSetInformationFile(long long long long long) @ stdcall ZwSetInformationJobObject(long long ptr long) @@ -1206,7 +1221,6 @@ @ stdcall ZwSetLdtEntries(long double long double) ; CHECKME @ stdcall ZwSetLowEventPair(ptr) @ stdcall ZwSetLowWaitHighEventPair(ptr) -;@ stdcall ZwSetLowWaitHighThread ; 3.51 and 4.0 only @ stdcall ZwSetQuotaInformationFile(ptr ptr ptr long) @ stdcall ZwSetSecurityObject(long long ptr) @ stdcall ZwSetSystemEnvironmentValue(ptr ptr) @@ -1234,17 +1248,17 @@ @ stdcall ZwTraceEvent(long long long ptr) @ stdcall ZwTranslateFilePath(ptr long ptr long) @ stdcall ZwUnloadDriver(ptr) +# ZwUnloadKey2 @ stdcall ZwUnloadKey(long) @ stdcall ZwUnloadKeyEx(ptr ptr) @ stdcall ZwUnlockFile(long ptr ptr ptr ptr) @ stdcall ZwUnlockVirtualMemory(long ptr ptr long) @ stdcall ZwUnmapViewOfSection(long ptr) @ stdcall ZwVdmControl(long ptr) -;@ stdcall ZwW32Call(long ptr long ptr ptr) @ stdcall ZwWaitForDebugEvent(ptr long ptr ptr) @ stdcall ZwWaitForKeyedEvent(ptr ptr long ptr) +# ZwWaitForMultipleObjects32 @ stdcall ZwWaitForMultipleObjects(long ptr long long ptr) -;@ stdcall ZwWaitForProcessMutant ; 3.51 only @ stdcall ZwWaitForSingleObject(long long long) @ stdcall ZwWaitHighEventPair(ptr) @ stdcall ZwWaitLowEventPair(ptr) @@ -1310,6 +1324,7 @@ @ cdecl _wcsicmp(wstr wstr) @ cdecl _wcslwr(wstr) @ cdecl _wcsnicmp(wstr wstr long) +# _wcstoui64 @ cdecl _wcsupr(wstr) @ cdecl _wtoi(wstr) @ cdecl _wtoi64(wstr) @@ -1392,7 +1407,6 @@ @ cdecl wcsrchr(wstr long) @ cdecl wcsspn(wstr wstr) @ cdecl wcsstr(wstr wstr) -;@ cdecl wcstok(wstr wstr) @ cdecl wcstol(wstr ptr long) @ cdecl wcstombs(ptr ptr long) @ cdecl wcstoul(wstr ptr long) diff --git a/dll/ntdll/include/ntdll.h b/dll/ntdll/include/ntdll.h index a0e8f312e09..d4fe4969bb8 100644 --- a/dll/ntdll/include/ntdll.h +++ b/dll/ntdll/include/ntdll.h @@ -27,11 +27,11 @@ #include #include #include +#include #define NTOS_MODE_USER #include #include #include -#include #include #include #include diff --git a/dll/ntdll/ldr/ldrapi.c b/dll/ntdll/ldr/ldrapi.c index 3e094630916..ec1ee9d10b4 100644 --- a/dll/ntdll/ldr/ldrapi.c +++ b/dll/ntdll/ldr/ldrapi.c @@ -322,10 +322,8 @@ LdrLoadDll(IN PWSTR SearchPath OPTIONAL, PTEB Teb = NtCurrentTeb(); /* Initialize the strings */ + RtlInitEmptyUnicodeString(&DllString1, StringBuffer, sizeof(StringBuffer)); RtlInitEmptyUnicodeString(&DllString2, NULL, 0); - DllString1.Buffer = StringBuffer; - DllString1.Length = 0; - DllString1.MaximumLength = sizeof(StringBuffer); /* Check if the SxS Assemblies specify another file */ Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE, @@ -410,8 +408,7 @@ LdrLoadDll(IN PWSTR SearchPath OPTIONAL, (Status != STATUS_OBJECT_NAME_NOT_FOUND) && (Status != STATUS_DLL_INIT_FAILED)) { - // 85 == DPFLTR_LDR_ID; - DbgPrintEx(85, + DbgPrintEx(DPFLTR_LDR_ID, DPFLTR_WARNING_LEVEL, "LDR: %s - failing because LdrpLoadDll(%wZ) returned status %x\n", __FUNCTION__, @@ -503,8 +500,11 @@ LdrFindEntryForAddress(PVOID Address, } /* Nothing found */ - // 85 == DPFLTR_LDR_ID; - DbgPrintEx(85, DPFLTR_WARNING_LEVEL, "LDR: %s() exiting 0x%08lx\n", __FUNCTION__, STATUS_NO_MORE_ENTRIES); + DbgPrintEx(DPFLTR_LDR_ID, + DPFLTR_WARNING_LEVEL, + "LDR: %s() exiting 0x%08lx\n", + __FUNCTION__, + STATUS_NO_MORE_ENTRIES); return STATUS_NO_MORE_ENTRIES; } diff --git a/dll/ntdll/ldr/ldrpe.c b/dll/ntdll/ldr/ldrpe.c index a127e5798a1..bd0600544d7 100644 --- a/dll/ntdll/ldr/ldrpe.c +++ b/dll/ntdll/ldr/ldrpe.c @@ -711,7 +711,7 @@ LdrpWalkImportDescriptor(IN LPWSTR DllPath OPTIONAL, if (!NT_SUCCESS(Status)) { /* Exit */ - DbgPrintEx(51, // DPFLTR_SXS_ID + DbgPrintEx(DPFLTR_SXS_ID, DPFLTR_WARNING_LEVEL, "LDR: RtlGetActiveActivationContext() failed; ntstatus = " "0x%08lx\n", diff --git a/dll/ntdll/ldr/ldrutils.c b/dll/ntdll/ldr/ldrutils.c index 3cc7608417e..201a48dc11f 100644 --- a/dll/ntdll/ldr/ldrutils.c +++ b/dll/ntdll/ldr/ldrutils.c @@ -1072,8 +1072,8 @@ LdrpMapDll(IN PWSTR SearchPath OPTIONAL, if (!NT_SUCCESS(Status) && (Status != STATUS_DLL_NOT_FOUND)) { /* Failure */ - DbgPrintEx(81, //DPFLTR_LDR_ID, - 0, + DbgPrintEx(DPFLTR_LDR_ID, + DPFLTR_ERROR_LEVEL, "LDR: %s - call to LdrpCheckForKnownDll(\"%ws\", ...) failed with status %x\n", __FUNCTION__, DllName, @@ -1660,8 +1660,8 @@ LdrpResolveFullName(IN PUNICODE_STRING OriginalName, /* Display debug output if snaps are on */ if (ShowSnaps) { - DbgPrintEx(81, //DPFLTR_LDR_ID, - 0, + DbgPrintEx(DPFLTR_LDR_ID, + DPFLTR_ERROR_LEVEL, "LDR: %s - Expanding full name of %wZ\n", __FUNCTION__, OriginalName); @@ -1737,16 +1737,16 @@ Quickie: /* Check which output to use -- failure or success */ if (NT_SUCCESS(Status)) { - DbgPrintEx(81, //DPFLTR_LDR_ID, - 0, + DbgPrintEx(DPFLTR_LDR_ID, + DPFLTR_ERROR_LEVEL, "LDR: %s - Expanded to %wZ\n", __FUNCTION__, *ExpandedName); } else { - DbgPrintEx(81, //DPFLTR_LDR_ID, - 0, + DbgPrintEx(DPFLTR_LDR_ID, + DPFLTR_ERROR_LEVEL, "LDR: %s - Failed to expand %wZ; 0x%08x\n", __FUNCTION__, OriginalName, @@ -1784,8 +1784,8 @@ LdrpSearchPath(IN PWCHAR *SearchPath, /* Display debug output if snaps are on */ if (ShowSnaps) { - DbgPrintEx(81, //DPFLTR_LDR_ID, - 0, + DbgPrintEx(DPFLTR_LDR_ID, + DPFLTR_ERROR_LEVEL, "LDR: %s - Looking for %ws in %ws\n", __FUNCTION__, DllName, @@ -1820,7 +1820,7 @@ LdrpSearchPath(IN PWCHAR *SearchPath, /* FIXME: Handle relative case semicolon-lookup here */ /* Calculate length */ - Length += (ULONG)wcslen(DllName) + sizeof(UNICODE_NULL); + Length += (ULONG)wcslen(DllName) + 1; if (Length > UNICODE_STRING_MAX_CHARS) { /* Too long, fail */ @@ -1852,8 +1852,8 @@ LdrpSearchPath(IN PWCHAR *SearchPath, /* Display debug output if snaps are on */ if (ShowSnaps) { - DbgPrintEx(81, //DPFLTR_LDR_ID, - 0, + DbgPrintEx(DPFLTR_LDR_ID, + DPFLTR_ERROR_LEVEL, "LDR: %s - Looking for %ws\n", __FUNCTION__, Buffer); @@ -1932,16 +1932,16 @@ Quickie: /* Check which output to use -- failure or success */ if (NT_SUCCESS(Status)) { - DbgPrintEx(81, //DPFLTR_LDR_ID, - 0, + DbgPrintEx(DPFLTR_LDR_ID, + DPFLTR_ERROR_LEVEL, "LDR: %s - Returning %wZ\n", __FUNCTION__, *ExpandedName); } else { - DbgPrintEx(81, //DPFLTR_LDR_ID, - 0, + DbgPrintEx(DPFLTR_LDR_ID, + DPFLTR_ERROR_LEVEL, "LDR: %s - Unable to locate %ws in %ws: 0x%08x\n", __FUNCTION__, DllName, @@ -2455,8 +2455,8 @@ LdrpLoadDll(IN BOOLEAN Redirected, sizeof(NameBuffer)) { /* No space to add the extension */ - DbgPrintEx(81, //DPFLTR_LDR_ID, - 0, + DbgPrintEx(DPFLTR_LDR_ID, + DPFLTR_ERROR_LEVEL, "LDR: %s - Dll name missing extension; with extension " "added the name is too long\n" " DllName: (@ %p) \"%wZ\"\n" diff --git a/dll/ntdll/rtl/libsupp.c b/dll/ntdll/rtl/libsupp.c index 69d58f36f89..22c6811b91b 100644 --- a/dll/ntdll/rtl/libsupp.c +++ b/dll/ntdll/rtl/libsupp.c @@ -430,6 +430,7 @@ NTSTATUS find_entry( PVOID BaseAddress, LDR_RESOURCE_INFO *info, root = RtlImageDirectoryEntryToData( BaseAddress, TRUE, IMAGE_DIRECTORY_ENTRY_RESOURCE, &size ); if (!root) return STATUS_RESOURCE_DATA_NOT_FOUND; + if (size < sizeof(*resdirptr)) return STATUS_RESOURCE_DATA_NOT_FOUND; resdirptr = root; if (!level--) goto done; diff --git a/dll/opengl/mesa/drivers/common/driverfuncs.c b/dll/opengl/mesa/drivers/common/driverfuncs.c index 25261d24ac9..361f7403bc8 100644 --- a/dll/opengl/mesa/drivers/common/driverfuncs.c +++ b/dll/opengl/mesa/drivers/common/driverfuncs.c @@ -26,7 +26,6 @@ #include "main/glheader.h" #include "main/imports.h" #include "main/accum.h" -#include "main/arrayobj.h" #include "main/context.h" #include "main/framebuffer.h" #include "main/readpix.h" @@ -37,7 +36,6 @@ #include "main/texobj.h" #include "main/texstore.h" #include "main/bufferobj.h" -#include "main/texturebarrier.h" #include "tnl/tnl.h" #include "swrast/swrast.h" @@ -84,14 +82,11 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->ChooseTextureFormat = _mesa_choose_tex_format; driver->TexImage1D = _mesa_store_teximage1d; driver->TexImage2D = _mesa_store_teximage2d; - driver->TexImage3D = _mesa_store_teximage3d; driver->TexSubImage1D = _mesa_store_texsubimage1d; driver->TexSubImage2D = _mesa_store_texsubimage2d; - driver->TexSubImage3D = _mesa_store_texsubimage3d; driver->GetTexImage = _mesa_get_teximage; driver->CopyTexSubImage1D = _mesa_meta_CopyTexSubImage1D; driver->CopyTexSubImage2D = _mesa_meta_CopyTexSubImage2D; - driver->CopyTexSubImage3D = _mesa_meta_CopyTexSubImage3D; driver->TestProxyTexImage = _mesa_test_proxy_teximage; driver->BindTexture = NULL; driver->NewTextureObject = _mesa_new_texture_object; @@ -105,9 +100,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver) /* simple state commands */ driver->AlphaFunc = NULL; - driver->BlendColor = NULL; - driver->BlendEquationSeparate = NULL; - driver->BlendFuncSeparate = NULL; driver->ClearColor = NULL; driver->ClearDepth = NULL; driver->ClearStencil = NULL; @@ -148,13 +140,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->MapRenderbuffer = _swrast_map_soft_renderbuffer; driver->UnmapRenderbuffer = _swrast_unmap_soft_renderbuffer; - _mesa_init_texture_barrier_functions(driver); - - /* APPLE_vertex_array_object */ - driver->NewArrayObject = _mesa_new_array_object; - driver->DeleteArrayObject = _mesa_delete_array_object; - driver->BindArrayObject = NULL; - /* T&L stuff */ driver->CurrentExecPrimitive = 0; driver->CurrentSavePrimitive = 0; diff --git a/dll/opengl/mesa/drivers/common/meta.c b/dll/opengl/mesa/drivers/common/meta.c index 19bf52a825e..e9b44f0914e 100644 --- a/dll/opengl/mesa/drivers/common/meta.c +++ b/dll/opengl/mesa/drivers/common/meta.c @@ -34,11 +34,9 @@ #include "main/glheader.h" #include "main/mtypes.h" #include "main/imports.h" -#include "main/arrayobj.h" #include "main/blend.h" #include "main/bufferobj.h" #include "main/buffers.h" -#include "main/colortab.h" #include "main/context.h" #include "main/depth.h" #include "main/enable.h" @@ -134,10 +132,6 @@ struct save_state GLbitfield TexGenEnabled; GLuint EnvMode; /* unit[0] only */ - /** MESA_META_VERTEX */ - struct gl_array_object *ArrayObj; - struct gl_buffer_object *ArrayBufferObj; - /** MESA_META_VIEWPORT */ GLint ViewportX, ViewportY, ViewportW, ViewportH; GLclampd DepthNear, DepthFar; @@ -152,23 +146,6 @@ struct save_state GLboolean RasterDiscard; }; -/** - * Temporary texture used for glBlitFramebuffer, glDrawPixels, etc. - * This is currently shared by all the meta ops. But we could create a - * separate one for each of glDrawPixel, glBlitFramebuffer, glCopyPixels, etc. - */ -struct temp_texture -{ - GLuint TexObj; - GLenum Target; /**< GL_TEXTURE_2D */ - GLsizei MinSize; /**< Min texture size to allocate */ - GLsizei MaxSize; /**< Max possible texture size */ - GLboolean NPOT; /**< Non-power of two size OK? */ - GLsizei Width, Height; /**< Current texture size */ - GLenum IntFormat; - GLfloat Sright, Ttop; /**< right, top texcoords */ -}; - /** * State for glBlitFramebufer() @@ -188,10 +165,8 @@ struct clear_state { GLuint ArrayObj; GLuint VBO; - GLuint ShaderProg; GLint ColorLocation; - GLuint IntegerShaderProg; GLint IntegerColorLocation; }; @@ -216,13 +191,9 @@ struct gl_meta_state /** Save stack depth */ GLuint SaveStackDepth; - struct temp_texture TempTex; - struct copypix_state CopyPix; /**< For _mesa_meta_CopyPixels() */ }; -static void cleanup_temp_texture(struct gl_context *ctx, struct temp_texture *tex); - /** * Initialize meta-ops for a context. * To be called once during context creation. @@ -245,7 +216,6 @@ _mesa_meta_free(struct gl_context *ctx) { GET_CURRENT_CONTEXT(old_context); _mesa_make_current(ctx, NULL, NULL); - cleanup_temp_texture(ctx, &ctx->Meta->TempTex); if (old_context) _mesa_make_current(old_context, old_context->WinSysDrawBuffer, old_context->WinSysReadBuffer); else @@ -382,7 +352,6 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state) ctx->Texture.Unit.TexGenEnabled) { _mesa_set_enable(ctx, GL_TEXTURE_1D, GL_FALSE); _mesa_set_enable(ctx, GL_TEXTURE_2D, GL_FALSE); - _mesa_set_enable(ctx, GL_TEXTURE_3D, GL_FALSE); if (ctx->Extensions.ARB_texture_cube_map) _mesa_set_enable(ctx, GL_TEXTURE_CUBE_MAP, GL_FALSE); _mesa_set_enable(ctx, GL_TEXTURE_GEN_S, GL_FALSE); @@ -429,15 +398,6 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state) } } - if (state & MESA_META_VERTEX) { - /* save vertex array object state */ - _mesa_reference_array_object(ctx, &save->ArrayObj, - ctx->Array.ArrayObj); - _mesa_reference_buffer_object(ctx, &save->ArrayBufferObj, - ctx->Array.ArrayBufferObj); - /* set some default state? */ - } - if (state & MESA_META_VIEWPORT) { /* save viewport state */ save->ViewportX = ctx->Viewport.X; @@ -621,16 +581,6 @@ _mesa_meta_end(struct gl_context *ctx) } } - if (state & MESA_META_VERTEX) { - /* restore vertex buffer object */ - _mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB, save->ArrayBufferObj->Name); - _mesa_reference_buffer_object(ctx, &save->ArrayBufferObj, NULL); - - /* restore vertex array object */ - _mesa_BindVertexArray(save->ArrayObj->Name); - _mesa_reference_array_object(ctx, &save->ArrayObj, NULL); - } - if (state & MESA_META_VIEWPORT) { if (save->ViewportX != ctx->Viewport.X || save->ViewportY != ctx->Viewport.Y || @@ -662,270 +612,6 @@ _mesa_meta_in_progress(struct gl_context *ctx) } -/** - * Convert Z from a normalized value in the range [0, 1] to an object-space - * Z coordinate in [-1, +1] so that drawing at the new Z position with the - * default/identity ortho projection results in the original Z value. - * Used by the meta-Clear, Draw/CopyPixels and Bitmap functions where the Z - * value comes from the clear value or raster position. - */ -static INLINE GLfloat -invert_z(GLfloat normZ) -{ - GLfloat objZ = 1.0f - 2.0f * normZ; - return objZ; -} - - -/** - * One-time init for a temp_texture object. - * Choose tex target, compute max tex size, etc. - */ -static void -init_temp_texture(struct gl_context *ctx, struct temp_texture *tex) -{ - /* use 2D texture, NPOT if possible */ - tex->Target = GL_TEXTURE_2D; - tex->MaxSize = 1 << (ctx->Const.MaxTextureLevels - 1); - tex->NPOT = ctx->Extensions.ARB_texture_non_power_of_two; - tex->MinSize = 16; /* 16 x 16 at least */ - assert(tex->MaxSize > 0); - - _mesa_GenTextures(1, &tex->TexObj); -} - -static void -cleanup_temp_texture(struct gl_context *ctx, struct temp_texture *tex) -{ - if (!tex->TexObj) - return; - _mesa_DeleteTextures(1, &tex->TexObj); - tex->TexObj = 0; -} - - -/** - * Return pointer to temp_texture info for non-bitmap ops. - * This does some one-time init if needed. - */ -static struct temp_texture * -get_temp_texture(struct gl_context *ctx) -{ - struct temp_texture *tex = &ctx->Meta->TempTex; - - if (!tex->TexObj) { - init_temp_texture(ctx, tex); - } - - return tex; -} - - -/** - * Compute the width/height of texture needed to draw an image of the - * given size. Return a flag indicating whether the current texture - * can be re-used (glTexSubImage2D) or if a new texture needs to be - * allocated (glTexImage2D). - * Also, compute s/t texcoords for drawing. - * - * \return GL_TRUE if new texture is needed, GL_FALSE otherwise - */ -static GLboolean -alloc_texture(struct temp_texture *tex, - GLsizei width, GLsizei height, GLenum intFormat) -{ - GLboolean newTex = GL_FALSE; - - ASSERT(width <= tex->MaxSize); - ASSERT(height <= tex->MaxSize); - - if (width > tex->Width || - height > tex->Height || - intFormat != tex->IntFormat) { - /* alloc new texture (larger or different format) */ - - if (tex->NPOT) { - /* use non-power of two size */ - tex->Width = MAX2(tex->MinSize, width); - tex->Height = MAX2(tex->MinSize, height); - } - else { - /* find power of two size */ - GLsizei w, h; - w = h = tex->MinSize; - while (w < width) - w *= 2; - while (h < height) - h *= 2; - tex->Width = w; - tex->Height = h; - } - - tex->IntFormat = intFormat; - - newTex = GL_TRUE; - } - - /* compute texcoords */ - tex->Sright = (GLfloat) width / tex->Width; - tex->Ttop = (GLfloat) height / tex->Height; - - return newTex; -} - - -/** - * Setup/load texture for glCopyPixels or glBlitFramebuffer. - */ -static void -setup_copypix_texture(struct temp_texture *tex, - GLboolean newTex, - GLint srcX, GLint srcY, - GLsizei width, GLsizei height, GLenum intFormat, - GLenum filter) -{ - _mesa_BindTexture(tex->Target, tex->TexObj); - _mesa_TexParameteri(tex->Target, GL_TEXTURE_MIN_FILTER, filter); - _mesa_TexParameteri(tex->Target, GL_TEXTURE_MAG_FILTER, filter); - _mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); - - /* copy framebuffer image to texture */ - if (newTex) { - /* create new tex image */ - if (tex->Width == width && tex->Height == height) { - /* create new tex with framebuffer data */ - _mesa_CopyTexImage2D(tex->Target, 0, tex->IntFormat, - srcX, srcY, width, height, 0); - } - else { - /* create empty texture */ - _mesa_TexImage2D(tex->Target, 0, tex->IntFormat, - tex->Width, tex->Height, 0, - intFormat, GL_UNSIGNED_BYTE, NULL); - /* load image */ - _mesa_CopyTexSubImage2D(tex->Target, 0, - 0, 0, srcX, srcY, width, height); - } - } - else { - /* replace existing tex image */ - _mesa_CopyTexSubImage2D(tex->Target, 0, - 0, 0, srcX, srcY, width, height); - } -} - -/** - * Meta implementation of ctx->Driver.CopyPixels() in terms - * of texture mapping and polygon rendering and GLSL shaders. - */ -void -_mesa_meta_CopyPixels(struct gl_context *ctx, GLint srcX, GLint srcY, - GLsizei width, GLsizei height, - GLint dstX, GLint dstY, GLenum type) -{ - struct copypix_state *copypix = &ctx->Meta->CopyPix; - struct temp_texture *tex = get_temp_texture(ctx); - struct vertex { - GLfloat x, y, z, s, t; - }; - struct vertex verts[4]; - GLboolean newTex; - GLenum intFormat = GL_RGBA; - - if (type != GL_COLOR || - ctx->_ImageTransferState || - ctx->Fog.Enabled || - width > tex->MaxSize || - height > tex->MaxSize) { - /* XXX avoid this fallback */ - _swrast_CopyPixels(ctx, srcX, srcY, width, height, dstX, dstY, type); - return; - } - - /* Most GL state applies to glCopyPixels, but a there's a few things - * we need to override: - */ - _mesa_meta_begin(ctx, (MESA_META_RASTERIZATION | - MESA_META_TEXTURE | - MESA_META_TRANSFORM | - MESA_META_CLIP | - MESA_META_VERTEX | - MESA_META_VIEWPORT)); - - if (copypix->ArrayObj == 0) { - /* one-time setup */ - - /* create vertex array object */ - _mesa_GenVertexArrays(1, ©pix->ArrayObj); - _mesa_BindVertexArray(copypix->ArrayObj); - - /* create vertex array buffer */ - _mesa_GenBuffersARB(1, ©pix->VBO); - _mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB, copypix->VBO); - _mesa_BufferDataARB(GL_ARRAY_BUFFER_ARB, sizeof(verts), - NULL, GL_DYNAMIC_DRAW_ARB); - - /* setup vertex arrays */ - _mesa_VertexPointer(3, GL_FLOAT, sizeof(struct vertex), OFFSET(x)); - _mesa_TexCoordPointer(2, GL_FLOAT, sizeof(struct vertex), OFFSET(s)); - _mesa_EnableClientState(GL_VERTEX_ARRAY); - _mesa_EnableClientState(GL_TEXTURE_COORD_ARRAY); - } - else { - _mesa_BindVertexArray(copypix->ArrayObj); - _mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB, copypix->VBO); - } - - newTex = alloc_texture(tex, width, height, intFormat); - - /* vertex positions, texcoords (after texture allocation!) */ - { - const GLfloat dstX0 = (GLfloat) dstX; - const GLfloat dstY0 = (GLfloat) dstY; - const GLfloat dstX1 = dstX + width * ctx->Pixel.ZoomX; - const GLfloat dstY1 = dstY + height * ctx->Pixel.ZoomY; - const GLfloat z = invert_z(ctx->Current.RasterPos[2]); - - verts[0].x = dstX0; - verts[0].y = dstY0; - verts[0].z = z; - verts[0].s = 0.0F; - verts[0].t = 0.0F; - verts[1].x = dstX1; - verts[1].y = dstY0; - verts[1].z = z; - verts[1].s = tex->Sright; - verts[1].t = 0.0F; - verts[2].x = dstX1; - verts[2].y = dstY1; - verts[2].z = z; - verts[2].s = tex->Sright; - verts[2].t = tex->Ttop; - verts[3].x = dstX0; - verts[3].y = dstY1; - verts[3].z = z; - verts[3].s = 0.0F; - verts[3].t = tex->Ttop; - - /* upload new vertex data */ - _mesa_BufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, sizeof(verts), verts); - } - - /* Alloc/setup texture */ - setup_copypix_texture(tex, newTex, srcX, srcY, width, height, - GL_RGBA, GL_NEAREST); - - _mesa_set_enable(ctx, tex->Target, GL_TRUE); - - /* draw textured quad */ - _mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4); - - _mesa_set_enable(ctx, tex->Target, GL_FALSE); - - _mesa_meta_end(ctx); -} - - /** * Determine the GL data type to use for the temporary image read with * ReadPixels() and passed to Tex[Sub]Image(). @@ -1031,11 +717,6 @@ copy_tex_sub_image(struct gl_context *ctx, xoffset, width, format, type, buf, &ctx->Unpack); } - else if (target == GL_TEXTURE_3D) { - ctx->Driver.TexSubImage3D(ctx, texImage, - xoffset, yoffset, zoffset, width, height, 1, - format, type, buf, &ctx->Unpack); - } else { ctx->Driver.TexSubImage2D(ctx, texImage, xoffset, yoffset, width, height, @@ -1073,15 +754,3 @@ _mesa_meta_CopyTexSubImage2D(struct gl_context *ctx, rb, x, y, width, height); } - -void -_mesa_meta_CopyTexSubImage3D(struct gl_context *ctx, - struct gl_texture_image *texImage, - GLint xoffset, GLint yoffset, GLint zoffset, - struct gl_renderbuffer *rb, - GLint x, GLint y, - GLsizei width, GLsizei height) -{ - copy_tex_sub_image(ctx, 3, texImage, xoffset, yoffset, zoffset, - rb, x, y, width, height); -} diff --git a/dll/opengl/mesa/drivers/common/meta.h b/dll/opengl/mesa/drivers/common/meta.h index 1e2656af014..677ed05d3ff 100644 --- a/dll/opengl/mesa/drivers/common/meta.h +++ b/dll/opengl/mesa/drivers/common/meta.h @@ -47,7 +47,6 @@ #define MESA_META_STENCIL_TEST 0x400 #define MESA_META_TRANSFORM 0x800 /**< modelview/projection matrix state */ #define MESA_META_TEXTURE 0x1000 -#define MESA_META_VERTEX 0x2000 #define MESA_META_VIEWPORT 0x4000 #define MESA_META_CLIP 0x8000 #define MESA_META_SELECT_FEEDBACK 0x10000 @@ -88,12 +87,4 @@ _mesa_meta_CopyTexSubImage2D(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei height); -extern void -_mesa_meta_CopyTexSubImage3D(struct gl_context *ctx, - struct gl_texture_image *texImage, - GLint xoffset, GLint yoffset, GLint zoffset, - struct gl_renderbuffer *rb, - GLint x, GLint y, - GLsizei width, GLsizei height); - #endif /* META_H */ diff --git a/dll/opengl/mesa/main/CMakeLists.txt b/dll/opengl/mesa/main/CMakeLists.txt index 03a1029c31e..b5218e47ada 100644 --- a/dll/opengl/mesa/main/CMakeLists.txt +++ b/dll/opengl/mesa/main/CMakeLists.txt @@ -6,15 +6,12 @@ list(APPEND SOURCE api_validate.c accum.c attrib.c - arrayobj.c blend.c bufferobj.c buffers.c clear.c clip.c - colortab.c context.c - convolve.c cpuinfo.c depth.c dlist.c @@ -35,7 +32,6 @@ list(APPEND SOURCE getstring.c hash.c hint.c - #histogram.c image.c imports.c light.c @@ -67,7 +63,6 @@ list(APPEND SOURCE texstate.c texstorage.c texstore.c - texturebarrier.c varray.c version.c viewport.c @@ -78,4 +73,5 @@ add_library(mesa_main STATIC ${SOURCE}) add_pch(mesa_main precomp.h SOURCE) if(NOT MSVC) allow_warnings(mesa_main) + add_target_compile_flags(mesa_main "-Wno-type-limits") endif() diff --git a/dll/opengl/mesa/main/api_arrayelt.c b/dll/opengl/mesa/main/api_arrayelt.c index 6cb6bd83a47..1fa1d41b67d 100644 --- a/dll/opengl/mesa/main/api_arrayelt.c +++ b/dll/opengl/mesa/main/api_arrayelt.c @@ -157,7 +157,6 @@ static const int NormalFuncs[NUM_TYPES] = { }; /* Note: _gloffset_* for these may not be a compile-time constant. */ -static int SecondaryColorFuncs[NUM_TYPES]; static int FogCoordFuncs[NUM_TYPES]; @@ -673,16 +672,6 @@ GLboolean _ae_create_context( struct gl_context *ctx ) if (ctx->aelt_context) return GL_TRUE; - /* These _gloffset_* values may not be compile-time constants */ - SecondaryColorFuncs[0] = _gloffset_SecondaryColor3bvEXT; - SecondaryColorFuncs[1] = _gloffset_SecondaryColor3ubvEXT; - SecondaryColorFuncs[2] = _gloffset_SecondaryColor3svEXT; - SecondaryColorFuncs[3] = _gloffset_SecondaryColor3usvEXT; - SecondaryColorFuncs[4] = _gloffset_SecondaryColor3ivEXT; - SecondaryColorFuncs[5] = _gloffset_SecondaryColor3uivEXT; - SecondaryColorFuncs[6] = _gloffset_SecondaryColor3fvEXT; - SecondaryColorFuncs[7] = _gloffset_SecondaryColor3dvEXT; - FogCoordFuncs[0] = -1; FogCoordFuncs[1] = -1; FogCoordFuncs[2] = -1; @@ -734,49 +723,42 @@ static void _ae_update_state( struct gl_context *ctx ) AEcontext *actx = AE_CONTEXT(ctx); AEarray *aa = actx->arrays; AEattrib *at = actx->attribs; - struct gl_array_object *arrayObj = ctx->Array.ArrayObj; actx->nr_vbos = 0; /* conventional vertex arrays */ - if (arrayObj->VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Enabled) { - aa->array = &arrayObj->VertexAttrib[VERT_ATTRIB_COLOR_INDEX]; + if (ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Enabled) { + aa->array = &ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR_INDEX]; aa->offset = IndexFuncs[TYPE_IDX(aa->array->Type)]; check_vbo(actx, aa->array->BufferObj); aa++; } - if (arrayObj->VertexAttrib[VERT_ATTRIB_EDGEFLAG].Enabled) { - aa->array = &arrayObj->VertexAttrib[VERT_ATTRIB_EDGEFLAG]; + if (ctx->Array.VertexAttrib[VERT_ATTRIB_EDGEFLAG].Enabled) { + aa->array = &ctx->Array.VertexAttrib[VERT_ATTRIB_EDGEFLAG]; aa->offset = _gloffset_EdgeFlagv; check_vbo(actx, aa->array->BufferObj); aa++; } - if (arrayObj->VertexAttrib[VERT_ATTRIB_NORMAL].Enabled) { - aa->array = &arrayObj->VertexAttrib[VERT_ATTRIB_NORMAL]; + if (ctx->Array.VertexAttrib[VERT_ATTRIB_NORMAL].Enabled) { + aa->array = &ctx->Array.VertexAttrib[VERT_ATTRIB_NORMAL]; aa->offset = NormalFuncs[TYPE_IDX(aa->array->Type)]; check_vbo(actx, aa->array->BufferObj); aa++; } - if (arrayObj->VertexAttrib[VERT_ATTRIB_COLOR0].Enabled) { - aa->array = &arrayObj->VertexAttrib[VERT_ATTRIB_COLOR0]; + if (ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR].Enabled) { + aa->array = &ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR]; aa->offset = ColorFuncs[aa->array->Size-3][TYPE_IDX(aa->array->Type)]; check_vbo(actx, aa->array->BufferObj); aa++; } - if (arrayObj->VertexAttrib[VERT_ATTRIB_COLOR1].Enabled) { - aa->array = &arrayObj->VertexAttrib[VERT_ATTRIB_COLOR1]; - aa->offset = SecondaryColorFuncs[TYPE_IDX(aa->array->Type)]; - check_vbo(actx, aa->array->BufferObj); - aa++; - } - if (arrayObj->VertexAttrib[VERT_ATTRIB_FOG].Enabled) { - aa->array = &arrayObj->VertexAttrib[VERT_ATTRIB_FOG]; + if (ctx->Array.VertexAttrib[VERT_ATTRIB_FOG].Enabled) { + aa->array = &ctx->Array.VertexAttrib[VERT_ATTRIB_FOG]; aa->offset = FogCoordFuncs[TYPE_IDX(aa->array->Type)]; check_vbo(actx, aa->array->BufferObj); aa++; } { - struct gl_client_array *attribArray = &arrayObj->VertexAttrib[VERT_ATTRIB_TEX]; + struct gl_client_array *attribArray = &ctx->Array.VertexAttrib[VERT_ATTRIB_TEX]; if (attribArray->Enabled) { /* NOTE: we use generic glVertexAttribNV functions here. * If we ever remove GL_NV_vertex_program this will have to change. @@ -793,14 +775,14 @@ static void _ae_update_state( struct gl_context *ctx ) } /* finally, vertex position */ - if (arrayObj->VertexAttrib[VERT_ATTRIB_POS].Enabled) { - aa->array = &arrayObj->VertexAttrib[VERT_ATTRIB_POS]; + if (ctx->Array.VertexAttrib[VERT_ATTRIB_POS].Enabled) { + aa->array = &ctx->Array.VertexAttrib[VERT_ATTRIB_POS]; aa->offset = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)]; check_vbo(actx, aa->array->BufferObj); aa++; } - check_vbo(actx, arrayObj->ElementArrayBufferObj); + check_vbo(actx, ctx->Array.ElementArrayBufferObj); ASSERT(at - actx->attribs <= VERT_ATTRIB_MAX); ASSERT(aa - actx->arrays < 32); diff --git a/dll/opengl/mesa/main/api_exec.c b/dll/opengl/mesa/main/api_exec.c index 2e8f24cdb3c..3e597024e94 100644 --- a/dll/opengl/mesa/main/api_exec.c +++ b/dll/opengl/mesa/main/api_exec.c @@ -30,8 +30,6 @@ #include -#include "histogram.h" - #if FEATURE_GL @@ -170,7 +168,6 @@ _mesa_create_exec_table(void) SET_ReadPixels(exec, _mesa_ReadPixels); SET_Rotated(exec, _mesa_Rotated); SET_Scaled(exec, _mesa_Scaled); - SET_SecondaryColorPointerEXT(exec, _mesa_SecondaryColorPointerEXT); SET_TexEnvf(exec, _mesa_TexEnvf); SET_TexEnviv(exec, _mesa_TexEnviv); @@ -208,58 +205,11 @@ _mesa_create_exec_table(void) SET_VertexPointer(exec, _mesa_VertexPointer); #endif - /* 1.2 */ -#if _HAVE_FULL_GL - SET_CopyTexSubImage3D(exec, _mesa_CopyTexSubImage3D); - SET_TexImage3D(exec, _mesa_TexImage3D); - SET_TexSubImage3D(exec, _mesa_TexSubImage3D); -#endif - - /* OpenGL 1.2 GL_ARB_imaging */ - SET_BlendColor(exec, _mesa_BlendColor); - SET_BlendEquation(exec, _mesa_BlendEquation); - SET_BlendEquationSeparateEXT(exec, _mesa_BlendEquationSeparateEXT); - - _mesa_init_colortable_dispatch(exec); - _mesa_init_convolve_dispatch(exec); - _mesa_init_histogram_dispatch(exec); - - /* 2. GL_EXT_blend_color */ -#if 0 -/* SET_BlendColorEXT(exec, _mesa_BlendColorEXT); */ -#endif - /* 3. GL_EXT_polygon_offset */ #if _HAVE_FULL_GL SET_PolygonOffsetEXT(exec, _mesa_PolygonOffsetEXT); #endif - /* 6. GL_EXT_texture3d */ -#if 0 -/* SET_CopyTexSubImage3DEXT(exec, _mesa_CopyTexSubImage3D); */ -/* SET_TexImage3DEXT(exec, _mesa_TexImage3DEXT); */ -/* SET_TexSubImage3DEXT(exec, _mesa_TexSubImage3D); */ -#endif - - /* 11. GL_EXT_histogram */ -#if 0 - SET_GetHistogramEXT(exec, _mesa_GetHistogram); - SET_GetHistogramParameterfvEXT(exec, _mesa_GetHistogramParameterfv); - SET_GetHistogramParameterivEXT(exec, _mesa_GetHistogramParameteriv); - SET_GetMinmaxEXT(exec, _mesa_GetMinmax); - SET_GetMinmaxParameterfvEXT(exec, _mesa_GetMinmaxParameterfv); - SET_GetMinmaxParameterivEXT(exec, _mesa_GetMinmaxParameteriv); -#endif - - /* 14. SGI_color_table */ -#if 0 - SET_ColorTableSGI(exec, _mesa_ColorTable); - SET_ColorSubTableSGI(exec, _mesa_ColorSubTable); - SET_GetColorTableSGI(exec, _mesa_GetColorTable); - SET_GetColorTableParameterfvSGI(exec, _mesa_GetColorTableParameterfv); - SET_GetColorTableParameterivSGI(exec, _mesa_GetColorTableParameteriv); -#endif - /* 30. GL_EXT_vertex_array */ #if _HAVE_FULL_GL SET_ColorPointerEXT(exec, _mesa_ColorPointerEXT); @@ -270,11 +220,6 @@ _mesa_create_exec_table(void) SET_VertexPointerEXT(exec, _mesa_VertexPointerEXT); #endif - /* 37. GL_EXT_blend_minmax */ -#if 0 - SET_BlendEquationEXT(exec, _mesa_BlendEquationEXT); -#endif - /* 54. GL_EXT_point_parameters */ #if _HAVE_FULL_GL SET_PointParameterfEXT(exec, _mesa_PointParameterf); @@ -287,11 +232,6 @@ _mesa_create_exec_table(void) SET_UnlockArraysEXT(exec, _mesa_UnlockArraysEXT); #endif - /* 173. GL_INGR_blend_func_separate */ -#if _HAVE_FULL_GL - SET_BlendFuncSeparateEXT(exec, _mesa_BlendFuncSeparateEXT); -#endif - /* 197. GL_MESA_window_pos */ /* part of _mesa_init_rastpos_dispatch(exec); */ @@ -301,43 +241,6 @@ _mesa_create_exec_table(void) SET_MultiModeDrawElementsIBM(exec, _mesa_MultiModeDrawElementsIBM); #endif - /* 233. GL_NV_vertex_program */ -#if FEATURE_NV_vertex_program - SET_ExecuteProgramNV(exec, _mesa_ExecuteProgramNV); - SET_GenProgramsNV(exec, _mesa_GenPrograms); - SET_AreProgramsResidentNV(exec, _mesa_AreProgramsResidentNV); - SET_RequestResidentProgramsNV(exec, _mesa_RequestResidentProgramsNV); - SET_GetProgramParameterfvNV(exec, _mesa_GetProgramParameterfvNV); - SET_GetProgramParameterdvNV(exec, _mesa_GetProgramParameterdvNV); - SET_GetProgramivNV(exec, _mesa_GetProgramivNV); - SET_GetTrackMatrixivNV(exec, _mesa_GetTrackMatrixivNV); - SET_LoadProgramNV(exec, _mesa_LoadProgramNV); - SET_ProgramEnvParameter4dARB(exec, _mesa_ProgramEnvParameter4dARB); /* alias to ProgramParameter4dNV */ - SET_ProgramEnvParameter4dvARB(exec, _mesa_ProgramEnvParameter4dvARB); /* alias to ProgramParameter4dvNV */ - SET_ProgramEnvParameter4fARB(exec, _mesa_ProgramEnvParameter4fARB); /* alias to ProgramParameter4fNV */ - SET_ProgramEnvParameter4fvARB(exec, _mesa_ProgramEnvParameter4fvARB); /* alias to ProgramParameter4fvNV */ - SET_ProgramParameters4dvNV(exec, _mesa_ProgramParameters4dvNV); - SET_ProgramParameters4fvNV(exec, _mesa_ProgramParameters4fvNV); - SET_TrackMatrixNV(exec, _mesa_TrackMatrixNV); - /* glVertexAttrib*NV functions handled in api_loopback.c */ -#endif - - /* 273. GL_APPLE_vertex_array_object */ - SET_BindVertexArrayAPPLE(exec, _mesa_BindVertexArrayAPPLE); - SET_DeleteVertexArraysAPPLE(exec, _mesa_DeleteVertexArraysAPPLE); - SET_GenVertexArraysAPPLE(exec, _mesa_GenVertexArraysAPPLE); - SET_IsVertexArrayAPPLE(exec, _mesa_IsVertexArrayAPPLE); - - /* 282. GL_NV_fragment_program */ -#if FEATURE_NV_fragment_program - SET_ProgramNamedParameter4fNV(exec, _mesa_ProgramNamedParameter4fNV); - SET_ProgramNamedParameter4dNV(exec, _mesa_ProgramNamedParameter4dNV); - SET_ProgramNamedParameter4fvNV(exec, _mesa_ProgramNamedParameter4fvNV); - SET_ProgramNamedParameter4dvNV(exec, _mesa_ProgramNamedParameter4dvNV); - SET_GetProgramNamedParameterfvNV(exec, _mesa_GetProgramNamedParameterfvNV); - SET_GetProgramNamedParameterdvNV(exec, _mesa_GetProgramNamedParameterdvNV); -#endif - /* 262. GL_NV_point_sprite */ #if _HAVE_FULL_GL SET_PointParameteriNV(exec, _mesa_PointParameteri); @@ -381,16 +284,6 @@ _mesa_create_exec_table(void) SET_FlushMappedBufferRange(exec, _mesa_FlushMappedBufferRange); #endif - /* GL_ARB_vertex_array_object */ - SET_BindVertexArray(exec, _mesa_BindVertexArray); - SET_GenVertexArrays(exec, _mesa_GenVertexArrays); - -#if FEATURE_APPLE_object_purgeable - SET_ObjectPurgeableAPPLE(exec, _mesa_ObjectPurgeableAPPLE); - SET_ObjectUnpurgeableAPPLE(exec, _mesa_ObjectUnpurgeableAPPLE); - SET_GetObjectParameterivAPPLE(exec, _mesa_GetObjectParameterivAPPLE); -#endif - /* GL_EXT_texture_integer */ SET_ClearColorIiEXT(exec, _mesa_ClearColorIiEXT); SET_ClearColorIuiEXT(exec, _mesa_ClearColorIuiEXT); @@ -399,12 +292,6 @@ _mesa_create_exec_table(void) SET_TexParameterIivEXT(exec, _mesa_TexParameterIiv); SET_TexParameterIuivEXT(exec, _mesa_TexParameterIuiv); - /* GL 3.0 (functions not covered by other extensions) */ - SET_GetStringi(exec, _mesa_GetStringi); - - /* GL_NV_texture_barrier */ - SET_TextureBarrierNV(exec, _mesa_TextureBarrierNV); - /* GL_ARB_texture_storage */ SET_TexStorage1D(exec, _mesa_TexStorage1D); SET_TexStorage2D(exec, _mesa_TexStorage2D); diff --git a/dll/opengl/mesa/main/api_loopback.c b/dll/opengl/mesa/main/api_loopback.c index a429f906947..35e289356c6 100644 --- a/dll/opengl/mesa/main/api_loopback.c +++ b/dll/opengl/mesa/main/api_loopback.c @@ -55,7 +55,6 @@ #define RECTF(a,b,c,d) CALL_Rectf(GET_DISPATCH(), (a,b,c,d)) #define FOGCOORDF(x) CALL_FogCoordfEXT(GET_DISPATCH(), (x)) -#define SECONDARYCOLORF(a,b,c) CALL_SecondaryColor3fEXT(GET_DISPATCH(), (a,b,c)) #define ATTRIB1NV(index,x) CALL_VertexAttrib1fNV(GET_DISPATCH(), (index,x)) #define ATTRIB2NV(index,x,y) CALL_VertexAttrib2fNV(GET_DISPATCH(), (index,x,y)) @@ -765,113 +764,6 @@ loopback_Rectsv(const GLshort *v1, const GLshort *v2) RECTF((GLfloat) v1[0], (GLfloat) v1[1], (GLfloat) v2[0], (GLfloat) v2[1]); } -static void GLAPIENTRY -loopback_SecondaryColor3bEXT_f( GLbyte red, GLbyte green, GLbyte blue ) -{ - SECONDARYCOLORF( BYTE_TO_FLOAT(red), - BYTE_TO_FLOAT(green), - BYTE_TO_FLOAT(blue) ); -} - -static void GLAPIENTRY -loopback_SecondaryColor3dEXT_f( GLdouble red, GLdouble green, GLdouble blue ) -{ - SECONDARYCOLORF( (GLfloat) red, (GLfloat) green, (GLfloat) blue ); -} - -static void GLAPIENTRY -loopback_SecondaryColor3iEXT_f( GLint red, GLint green, GLint blue ) -{ - SECONDARYCOLORF( INT_TO_FLOAT(red), - INT_TO_FLOAT(green), - INT_TO_FLOAT(blue)); -} - -static void GLAPIENTRY -loopback_SecondaryColor3sEXT_f( GLshort red, GLshort green, GLshort blue ) -{ - SECONDARYCOLORF(SHORT_TO_FLOAT(red), - SHORT_TO_FLOAT(green), - SHORT_TO_FLOAT(blue)); -} - -static void GLAPIENTRY -loopback_SecondaryColor3uiEXT_f( GLuint red, GLuint green, GLuint blue ) -{ - SECONDARYCOLORF(UINT_TO_FLOAT(red), - UINT_TO_FLOAT(green), - UINT_TO_FLOAT(blue)); -} - -static void GLAPIENTRY -loopback_SecondaryColor3usEXT_f( GLushort red, GLushort green, GLushort blue ) -{ - SECONDARYCOLORF(USHORT_TO_FLOAT(red), - USHORT_TO_FLOAT(green), - USHORT_TO_FLOAT(blue)); -} - -static void GLAPIENTRY -loopback_SecondaryColor3ubEXT_f( GLubyte red, GLubyte green, GLubyte blue ) -{ - SECONDARYCOLORF(UBYTE_TO_FLOAT(red), - UBYTE_TO_FLOAT(green), - UBYTE_TO_FLOAT(blue)); -} - -static void GLAPIENTRY -loopback_SecondaryColor3bvEXT_f( const GLbyte *v ) -{ - SECONDARYCOLORF(BYTE_TO_FLOAT(v[0]), - BYTE_TO_FLOAT(v[1]), - BYTE_TO_FLOAT(v[2])); -} - -static void GLAPIENTRY -loopback_SecondaryColor3dvEXT_f( const GLdouble *v ) -{ - SECONDARYCOLORF( (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] ); -} -static void GLAPIENTRY -loopback_SecondaryColor3ivEXT_f( const GLint *v ) -{ - SECONDARYCOLORF(INT_TO_FLOAT(v[0]), - INT_TO_FLOAT(v[1]), - INT_TO_FLOAT(v[2])); -} - -static void GLAPIENTRY -loopback_SecondaryColor3svEXT_f( const GLshort *v ) -{ - SECONDARYCOLORF(SHORT_TO_FLOAT(v[0]), - SHORT_TO_FLOAT(v[1]), - SHORT_TO_FLOAT(v[2])); -} - -static void GLAPIENTRY -loopback_SecondaryColor3uivEXT_f( const GLuint *v ) -{ - SECONDARYCOLORF(UINT_TO_FLOAT(v[0]), - UINT_TO_FLOAT(v[1]), - UINT_TO_FLOAT(v[2])); -} - -static void GLAPIENTRY -loopback_SecondaryColor3usvEXT_f( const GLushort *v ) -{ - SECONDARYCOLORF(USHORT_TO_FLOAT(v[0]), - USHORT_TO_FLOAT(v[1]), - USHORT_TO_FLOAT(v[2])); -} - -static void GLAPIENTRY -loopback_SecondaryColor3ubvEXT_f( const GLubyte *v ) -{ - SECONDARYCOLORF(UBYTE_TO_FLOAT(v[0]), - UBYTE_TO_FLOAT(v[1]), - UBYTE_TO_FLOAT(v[2])); -} - /* * GL_NV_vertex_program: @@ -991,113 +883,6 @@ loopback_VertexAttrib4ubvNV(GLuint index, const GLubyte *v) } -static void GLAPIENTRY -loopback_VertexAttribs1svNV(GLuint index, GLsizei n, const GLshort *v) -{ - GLint i; - for (i = n - 1; i >= 0; i--) - loopback_VertexAttrib1svNV(index + i, v + i); -} - -static void GLAPIENTRY -loopback_VertexAttribs1fvNV(GLuint index, GLsizei n, const GLfloat *v) -{ - GLint i; - for (i = n - 1; i >= 0; i--) - ATTRIB1NV(index + i, v[i]); -} - -static void GLAPIENTRY -loopback_VertexAttribs1dvNV(GLuint index, GLsizei n, const GLdouble *v) -{ - GLint i; - for (i = n - 1; i >= 0; i--) - loopback_VertexAttrib1dvNV(index + i, v + i); -} - -static void GLAPIENTRY -loopback_VertexAttribs2svNV(GLuint index, GLsizei n, const GLshort *v) -{ - GLint i; - for (i = n - 1; i >= 0; i--) - loopback_VertexAttrib2svNV(index + i, v + 2 * i); -} - -static void GLAPIENTRY -loopback_VertexAttribs2fvNV(GLuint index, GLsizei n, const GLfloat *v) -{ - GLint i; - for (i = n - 1; i >= 0; i--) - ATTRIB2NV(index + i, v[2 * i], v[2 * i + 1]); -} - -static void GLAPIENTRY -loopback_VertexAttribs2dvNV(GLuint index, GLsizei n, const GLdouble *v) -{ - GLint i; - for (i = n - 1; i >= 0; i--) - loopback_VertexAttrib2dvNV(index + i, v + 2 * i); -} - -static void GLAPIENTRY -loopback_VertexAttribs3svNV(GLuint index, GLsizei n, const GLshort *v) -{ - GLint i; - for (i = n - 1; i >= 0; i--) - loopback_VertexAttrib3svNV(index + i, v + 3 * i); -} - -static void GLAPIENTRY -loopback_VertexAttribs3fvNV(GLuint index, GLsizei n, const GLfloat *v) -{ - GLint i; - for (i = n - 1; i >= 0; i--) - ATTRIB3NV(index + i, v[3 * i], v[3 * i + 1], v[3 * i + 2]); -} - -static void GLAPIENTRY -loopback_VertexAttribs3dvNV(GLuint index, GLsizei n, const GLdouble *v) -{ - GLint i; - for (i = n - 1; i >= 0; i--) - loopback_VertexAttrib3dvNV(index + i, v + 3 * i); -} - -static void GLAPIENTRY -loopback_VertexAttribs4svNV(GLuint index, GLsizei n, const GLshort *v) -{ - GLint i; - for (i = n - 1; i >= 0; i--) - loopback_VertexAttrib4svNV(index + i, v + 4 * i); -} - -static void GLAPIENTRY -loopback_VertexAttribs4fvNV(GLuint index, GLsizei n, const GLfloat *v) -{ - GLint i; - for (i = n - 1; i >= 0; i--) - ATTRIB4NV(index + i, v[4 * i], v[4 * i + 1], v[4 * i + 2], v[4 * i + 3]); -} - -static void GLAPIENTRY -loopback_VertexAttribs4dvNV(GLuint index, GLsizei n, const GLdouble *v) -{ - GLint i; - for (i = n - 1; i >= 0; i--) - loopback_VertexAttrib4dvNV(index + i, v + 4 * i); -} - -static void GLAPIENTRY -loopback_VertexAttribs4ubvNV(GLuint index, GLsizei n, const GLubyte *v) -{ - GLint i; - for (i = n - 1; i >= 0; i--) - loopback_VertexAttrib4ubvNV(index + i, v + 4 * i); -} - - - - /* * This code never registers handlers for any of the entry points * listed in vtxfmt.h. @@ -1133,21 +918,6 @@ _mesa_loopback_init_api_table( struct _glapi_table *dest ) SET_Color4uiv(dest, loopback_Color4uiv_f); SET_Color4usv(dest, loopback_Color4usv_f); SET_Color4ubv(dest, loopback_Color4ubv_f); - - SET_SecondaryColor3bEXT(dest, loopback_SecondaryColor3bEXT_f); - SET_SecondaryColor3dEXT(dest, loopback_SecondaryColor3dEXT_f); - SET_SecondaryColor3iEXT(dest, loopback_SecondaryColor3iEXT_f); - SET_SecondaryColor3sEXT(dest, loopback_SecondaryColor3sEXT_f); - SET_SecondaryColor3uiEXT(dest, loopback_SecondaryColor3uiEXT_f); - SET_SecondaryColor3usEXT(dest, loopback_SecondaryColor3usEXT_f); - SET_SecondaryColor3ubEXT(dest, loopback_SecondaryColor3ubEXT_f); - SET_SecondaryColor3bvEXT(dest, loopback_SecondaryColor3bvEXT_f); - SET_SecondaryColor3dvEXT(dest, loopback_SecondaryColor3dvEXT_f); - SET_SecondaryColor3ivEXT(dest, loopback_SecondaryColor3ivEXT_f); - SET_SecondaryColor3svEXT(dest, loopback_SecondaryColor3svEXT_f); - SET_SecondaryColor3uivEXT(dest, loopback_SecondaryColor3uivEXT_f); - SET_SecondaryColor3usvEXT(dest, loopback_SecondaryColor3usvEXT_f); - SET_SecondaryColor3ubvEXT(dest, loopback_SecondaryColor3ubvEXT_f); SET_EdgeFlagv(dest, loopback_EdgeFlagv); @@ -1246,19 +1016,6 @@ _mesa_loopback_init_api_table( struct _glapi_table *dest ) SET_VertexAttrib4svNV(dest, loopback_VertexAttrib4svNV); SET_VertexAttrib4dvNV(dest, loopback_VertexAttrib4dvNV); SET_VertexAttrib4ubvNV(dest, loopback_VertexAttrib4ubvNV); - SET_VertexAttribs1svNV(dest, loopback_VertexAttribs1svNV); - SET_VertexAttribs1fvNV(dest, loopback_VertexAttribs1fvNV); - SET_VertexAttribs1dvNV(dest, loopback_VertexAttribs1dvNV); - SET_VertexAttribs2svNV(dest, loopback_VertexAttribs2svNV); - SET_VertexAttribs2fvNV(dest, loopback_VertexAttribs2fvNV); - SET_VertexAttribs2dvNV(dest, loopback_VertexAttribs2dvNV); - SET_VertexAttribs3svNV(dest, loopback_VertexAttribs3svNV); - SET_VertexAttribs3fvNV(dest, loopback_VertexAttribs3fvNV); - SET_VertexAttribs3dvNV(dest, loopback_VertexAttribs3dvNV); - SET_VertexAttribs4svNV(dest, loopback_VertexAttribs4svNV); - SET_VertexAttribs4fvNV(dest, loopback_VertexAttribs4fvNV); - SET_VertexAttribs4dvNV(dest, loopback_VertexAttribs4dvNV); - SET_VertexAttribs4ubvNV(dest, loopback_VertexAttribs4ubvNV); } diff --git a/dll/opengl/mesa/main/api_validate.c b/dll/opengl/mesa/main/api_validate.c index 03f99f6ee5f..88345803435 100644 --- a/dll/opengl/mesa/main/api_validate.c +++ b/dll/opengl/mesa/main/api_validate.c @@ -101,7 +101,7 @@ check_valid_to_render(struct gl_context *ctx, const char *function) /* Draw if we have vertex positions (GL_VERTEX_ARRAY or generic * array [0]). */ - return ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POS].Enabled; + return ctx->Array.VertexAttrib[VERT_ATTRIB_POS].Enabled; } @@ -130,14 +130,14 @@ check_index_bounds(struct gl_context *ctx, GLsizei count, GLenum type, memset(&ib, 0, sizeof(ib)); ib.type = type; ib.ptr = indices; - ib.obj = ctx->Array.ArrayObj->ElementArrayBufferObj; + ib.obj = ctx->Array.ElementArrayBufferObj; vbo_get_minmax_index(ctx, &prim, &ib, &min, &max); - if (max >= ctx->Array.ArrayObj->_MaxElement) { + if (max >= ctx->Array._MaxElement) { /* the max element is out of bounds of one or more enabled arrays */ _mesa_warning(ctx, "glDrawElements() index=%u is out of bounds (max=%u)", - max, ctx->Array.ArrayObj->_MaxElement); + max, ctx->Array._MaxElement); return GL_FALSE; } @@ -197,10 +197,10 @@ _mesa_validate_DrawElements(struct gl_context *ctx, return GL_FALSE; /* Vertex buffer object tests */ - if (_mesa_is_bufferobj(ctx->Array.ArrayObj->ElementArrayBufferObj)) { + if (_mesa_is_bufferobj(ctx->Array.ElementArrayBufferObj)) { /* use indices in the buffer object */ /* make sure count doesn't go outside buffer bounds */ - if (index_bytes(type, count) > ctx->Array.ArrayObj->ElementArrayBufferObj->Size) { + if (index_bytes(type, count) > ctx->Array.ElementArrayBufferObj->Size) { _mesa_warning(ctx, "glDrawElements index out of buffer bounds"); return GL_FALSE; } @@ -218,67 +218,6 @@ _mesa_validate_DrawElements(struct gl_context *ctx, } -/** - * Error checking for glDrawRangeElements(). Includes parameter checking - * and VBO bounds checking. - * \return GL_TRUE if OK to render, GL_FALSE if error found - */ -GLboolean -_mesa_validate_DrawRangeElements(struct gl_context *ctx, GLenum mode, - GLuint start, GLuint end, - GLsizei count, GLenum type, - const GLvoid *indices) -{ - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); - - if (count <= 0) { - if (count < 0) - _mesa_error(ctx, GL_INVALID_VALUE, "glDrawRangeElements(count)" ); - return GL_FALSE; - } - - if (!_mesa_valid_prim_mode(ctx, mode)) { - _mesa_error(ctx, GL_INVALID_ENUM, "glDrawRangeElements(mode)" ); - return GL_FALSE; - } - - if (end < start) { - _mesa_error(ctx, GL_INVALID_VALUE, "glDrawRangeElements(endArray.ArrayObj->ElementArrayBufferObj)) { - /* use indices in the buffer object */ - /* make sure count doesn't go outside buffer bounds */ - if (index_bytes(type, count) > ctx->Array.ArrayObj->ElementArrayBufferObj->Size) { - _mesa_warning(ctx, "glDrawRangeElements index out of buffer bounds"); - return GL_FALSE; - } - } - else { - /* not using a VBO */ - if (!indices) - return GL_FALSE; - } - - if (!check_index_bounds(ctx, count, type, indices)) - return GL_FALSE; - - return GL_TRUE; -} - - /** * Called from the tnl module to error check the function parameters and * verify that we really can draw something. @@ -305,7 +244,7 @@ _mesa_validate_DrawArrays(struct gl_context *ctx, return GL_FALSE; if (ctx->Const.CheckArrayBounds) { - if (start + count > (GLint) ctx->Array.ArrayObj->_MaxElement) + if (start + count > (GLint) ctx->Array._MaxElement) return GL_FALSE; } diff --git a/dll/opengl/mesa/main/api_validate.h b/dll/opengl/mesa/main/api_validate.h index ea7cc25d61c..69be15625e7 100644 --- a/dll/opengl/mesa/main/api_validate.h +++ b/dll/opengl/mesa/main/api_validate.h @@ -55,10 +55,4 @@ _mesa_validate_DrawElements(struct gl_context *ctx, GLenum mode, GLsizei count, GLenum type, const GLvoid *indices); -extern GLboolean -_mesa_validate_DrawRangeElements(struct gl_context *ctx, GLenum mode, - GLuint start, GLuint end, - GLsizei count, GLenum type, - const GLvoid *indices); - #endif diff --git a/dll/opengl/mesa/main/arrayobj.c b/dll/opengl/mesa/main/arrayobj.c deleted file mode 100644 index 258d58eae31..00000000000 --- a/dll/opengl/mesa/main/arrayobj.c +++ /dev/null @@ -1,533 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.6 - * - * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. - * (C) Copyright IBM Corporation 2006 - * Copyright (C) 2009 VMware, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL OR IBM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - - -/** - * \file arrayobj.c - * Functions for the GL_APPLE_vertex_array_object extension. - * - * \todo - * The code in this file borrows a lot from bufferobj.c. There's a certain - * amount of cruft left over from that origin that may be unnecessary. - * - * \author Ian Romanick - * \author Brian Paul - */ - -#include - -/** - * Look up the array object for the given ID. - * - * \returns - * Either a pointer to the array object with the specified ID or \c NULL for - * a non-existent ID. The spec defines ID 0 as being technically - * non-existent. - */ - -static inline struct gl_array_object * -lookup_arrayobj(struct gl_context *ctx, GLuint id) -{ - if (id == 0) - return NULL; - else - return (struct gl_array_object *) - _mesa_HashLookup(ctx->Array.Objects, id); -} - - -/** - * For all the vertex arrays in the array object, unbind any pointers - * to any buffer objects (VBOs). - * This is done just prior to array object destruction. - */ -static void -unbind_array_object_vbos(struct gl_context *ctx, struct gl_array_object *obj) -{ - GLuint i; - - for (i = 0; i < Elements(obj->VertexAttrib); i++) - _mesa_reference_buffer_object(ctx, &obj->VertexAttrib[i].BufferObj, NULL); -} - - -/** - * Allocate and initialize a new vertex array object. - * - * This function is intended to be called via - * \c dd_function_table::NewArrayObject. - */ -struct gl_array_object * -_mesa_new_array_object( struct gl_context *ctx, GLuint name ) -{ - struct gl_array_object *obj = CALLOC_STRUCT(gl_array_object); - if (obj) - _mesa_initialize_array_object(ctx, obj, name); - return obj; -} - - -/** - * Delete an array object. - * - * This function is intended to be called via - * \c dd_function_table::DeleteArrayObject. - */ -void -_mesa_delete_array_object( struct gl_context *ctx, struct gl_array_object *obj ) -{ - (void) ctx; - unbind_array_object_vbos(ctx, obj); - _mesa_reference_buffer_object(ctx, &obj->ElementArrayBufferObj, NULL); - _glthread_DESTROY_MUTEX(obj->Mutex); - free(obj); -} - - -/** - * Set ptr to arrayObj w/ reference counting. - */ -void -_mesa_reference_array_object(struct gl_context *ctx, - struct gl_array_object **ptr, - struct gl_array_object *arrayObj) -{ - if (*ptr == arrayObj) - return; - - if (*ptr) { - /* Unreference the old array object */ - GLboolean deleteFlag = GL_FALSE; - struct gl_array_object *oldObj = *ptr; - - _glthread_LOCK_MUTEX(oldObj->Mutex); - ASSERT(oldObj->RefCount > 0); - oldObj->RefCount--; -#if 0 - printf("ArrayObj %p %d DECR to %d\n", - (void *) oldObj, oldObj->Name, oldObj->RefCount); -#endif - deleteFlag = (oldObj->RefCount == 0); - _glthread_UNLOCK_MUTEX(oldObj->Mutex); - - if (deleteFlag) { - ASSERT(ctx->Driver.DeleteArrayObject); - ctx->Driver.DeleteArrayObject(ctx, oldObj); - } - - *ptr = NULL; - } - ASSERT(!*ptr); - - if (arrayObj) { - /* reference new array object */ - _glthread_LOCK_MUTEX(arrayObj->Mutex); - if (arrayObj->RefCount == 0) { - /* this array's being deleted (look just above) */ - /* Not sure this can every really happen. Warn if it does. */ - _mesa_problem(NULL, "referencing deleted array object"); - *ptr = NULL; - } - else { - arrayObj->RefCount++; -#if 0 - printf("ArrayObj %p %d INCR to %d\n", - (void *) arrayObj, arrayObj->Name, arrayObj->RefCount); -#endif - *ptr = arrayObj; - } - _glthread_UNLOCK_MUTEX(arrayObj->Mutex); - } -} - - - -static void -init_array(struct gl_context *ctx, - struct gl_client_array *array, GLint size, GLint type) -{ - array->Size = size; - array->Type = type; - array->Stride = 0; - array->StrideB = 0; - array->Ptr = NULL; - array->Enabled = GL_FALSE; - array->Normalized = GL_FALSE; - array->Integer = GL_FALSE; - array->_ElementSize = size * _mesa_sizeof_type(type); - /* Vertex array buffers */ - _mesa_reference_buffer_object(ctx, &array->BufferObj, - ctx->Shared->NullBufferObj); -} - - -/** - * Initialize a gl_array_object's arrays. - */ -void -_mesa_initialize_array_object( struct gl_context *ctx, - struct gl_array_object *obj, - GLuint name ) -{ - GLuint i; - - obj->Name = name; - - _glthread_INIT_MUTEX(obj->Mutex); - obj->RefCount = 1; - - /* Init the individual arrays */ - for (i = 0; i < Elements(obj->VertexAttrib); i++) { - switch (i) { - case VERT_ATTRIB_WEIGHT: - init_array(ctx, &obj->VertexAttrib[VERT_ATTRIB_WEIGHT], 1, GL_FLOAT); - break; - case VERT_ATTRIB_NORMAL: - init_array(ctx, &obj->VertexAttrib[VERT_ATTRIB_NORMAL], 3, GL_FLOAT); - break; - case VERT_ATTRIB_COLOR1: - init_array(ctx, &obj->VertexAttrib[VERT_ATTRIB_COLOR1], 3, GL_FLOAT); - break; - case VERT_ATTRIB_FOG: - init_array(ctx, &obj->VertexAttrib[VERT_ATTRIB_FOG], 1, GL_FLOAT); - break; - case VERT_ATTRIB_COLOR_INDEX: - init_array(ctx, &obj->VertexAttrib[VERT_ATTRIB_COLOR_INDEX], 1, GL_FLOAT); - break; - case VERT_ATTRIB_EDGEFLAG: - init_array(ctx, &obj->VertexAttrib[VERT_ATTRIB_EDGEFLAG], 1, GL_BOOL); - break; -#if FEATURE_point_size_array - case VERT_ATTRIB_POINT_SIZE: - init_array(ctx, &obj->VertexAttrib[VERT_ATTRIB_POINT_SIZE], 1, GL_FLOAT); - break; -#endif - default: - init_array(ctx, &obj->VertexAttrib[i], 4, GL_FLOAT); - break; - } - } - - _mesa_reference_buffer_object(ctx, &obj->ElementArrayBufferObj, - ctx->Shared->NullBufferObj); -} - - -/** - * Add the given array object to the array object pool. - */ -static void -save_array_object( struct gl_context *ctx, struct gl_array_object *obj ) -{ - if (obj->Name > 0) { - /* insert into hash table */ - _mesa_HashInsert(ctx->Array.Objects, obj->Name, obj); - } -} - - -/** - * Remove the given array object from the array object pool. - * Do not deallocate the array object though. - */ -static void -remove_array_object( struct gl_context *ctx, struct gl_array_object *obj ) -{ - if (obj->Name > 0) { - /* remove from hash table */ - _mesa_HashRemove(ctx->Array.Objects, obj->Name); - } -} - - - -/** - * Helper for update_arrays(). - * \return min(current min, array->_MaxElement). - */ -static GLuint -update_min(GLuint min, struct gl_client_array *array) -{ - assert(array->Enabled); - _mesa_update_array_max_element(array); - return MIN2(min, array->_MaxElement); -} - - -/** - * Examine vertex arrays to update the gl_array_object::_MaxElement field. - */ -void -_mesa_update_array_object_max_element(struct gl_context *ctx, - struct gl_array_object *arrayObj) -{ - GLbitfield64 enabled = arrayObj->_Enabled; - GLuint min = ~0u; - - while (enabled) { - GLint attrib = _mesa_ffsll(enabled) - 1; - enabled &= ~BITFIELD64_BIT(attrib); - min = update_min(min, &arrayObj->VertexAttrib[attrib]); - } - - /* _MaxElement is one past the last legal array element */ - arrayObj->_MaxElement = min; -} - - -/**********************************************************************/ -/* API Functions */ -/**********************************************************************/ - - -/** - * Helper for _mesa_BindVertexArray() and _mesa_BindVertexArrayAPPLE(). - * \param genRequired specifies behavour when id was not generated with - * glGenVertexArrays(). - */ -static void -bind_vertex_array(struct gl_context *ctx, GLuint id, GLboolean genRequired) -{ - struct gl_array_object * const oldObj = ctx->Array.ArrayObj; - struct gl_array_object *newObj = NULL; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - ASSERT(oldObj != NULL); - - if ( oldObj->Name == id ) - return; /* rebinding the same array object- no change */ - - /* - * Get pointer to new array object (newObj) - */ - if (id == 0) { - /* The spec says there is no array object named 0, but we use - * one internally because it simplifies things. - */ - newObj = ctx->Array.DefaultArrayObj; - } - else { - /* non-default array object */ - newObj = lookup_arrayobj(ctx, id); - if (!newObj) { - if (genRequired) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glBindVertexArray(id)"); - return; - } - - /* For APPLE version, generate a new array object now */ - newObj = (*ctx->Driver.NewArrayObject)(ctx, id); - if (!newObj) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindVertexArrayAPPLE"); - return; - } - - save_array_object(ctx, newObj); - } - - if (!newObj->_Used) { - /* The "Interactions with APPLE_vertex_array_object" section of the - * GL_ARB_vertex_array_object spec says: - * - * "The first bind call, either BindVertexArray or - * BindVertexArrayAPPLE, determines the semantic of the object." - */ - newObj->ARBsemantics = genRequired; - newObj->_Used = GL_TRUE; - } - } - - ctx->NewState |= _NEW_ARRAY; - ctx->Array.NewState |= VERT_BIT_ALL; - _mesa_reference_array_object(ctx, &ctx->Array.ArrayObj, newObj); - - /* Pass BindVertexArray call to device driver */ - if (ctx->Driver.BindArrayObject && newObj) - ctx->Driver.BindArrayObject(ctx, newObj); -} - - -/** - * ARB version of glBindVertexArray() - * This function behaves differently from glBindVertexArrayAPPLE() in - * that this function requires all ids to have been previously generated - * by glGenVertexArrays[APPLE](). - */ -void GLAPIENTRY -_mesa_BindVertexArray( GLuint id ) -{ - GET_CURRENT_CONTEXT(ctx); - bind_vertex_array(ctx, id, GL_TRUE); -} - - -/** - * Bind a new array. - * - * \todo - * The binding could be done more efficiently by comparing the non-NULL - * pointers in the old and new objects. The only arrays that are "dirty" are - * the ones that are non-NULL in either object. - */ -void GLAPIENTRY -_mesa_BindVertexArrayAPPLE( GLuint id ) -{ - GET_CURRENT_CONTEXT(ctx); - bind_vertex_array(ctx, id, GL_FALSE); -} - - -/** - * Delete a set of array objects. - * - * \param n Number of array objects to delete. - * \param ids Array of \c n array object IDs. - */ -void GLAPIENTRY -_mesa_DeleteVertexArraysAPPLE(GLsizei n, const GLuint *ids) -{ - GET_CURRENT_CONTEXT(ctx); - GLsizei i; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (n < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteVertexArrayAPPLE(n)"); - return; - } - - for (i = 0; i < n; i++) { - struct gl_array_object *obj = lookup_arrayobj(ctx, ids[i]); - - if ( obj != NULL ) { - ASSERT( obj->Name == ids[i] ); - - /* If the array object is currently bound, the spec says "the binding - * for that object reverts to zero and the default vertex array - * becomes current." - */ - if ( obj == ctx->Array.ArrayObj ) { - CALL_BindVertexArrayAPPLE( ctx->Exec, (0) ); - } - - /* The ID is immediately freed for re-use */ - remove_array_object(ctx, obj); - - /* Unreference the array object. - * If refcount hits zero, the object will be deleted. - */ - _mesa_reference_array_object(ctx, &obj, NULL); - } - } -} - - -/** - * Generate a set of unique array object IDs and store them in \c arrays. - * Helper for _mesa_GenVertexArrays[APPLE]() functions below. - * \param n Number of IDs to generate. - * \param arrays Array of \c n locations to store the IDs. - * \param vboOnly Will arrays have to reside in VBOs? - */ -static void -gen_vertex_arrays(struct gl_context *ctx, GLsizei n, GLuint *arrays) -{ - GLuint first; - GLint i; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (n < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGenVertexArraysAPPLE"); - return; - } - - if (!arrays) { - return; - } - - first = _mesa_HashFindFreeKeyBlock(ctx->Array.Objects, n); - - /* Allocate new, empty array objects and return identifiers */ - for (i = 0; i < n; i++) { - struct gl_array_object *obj; - GLuint name = first + i; - - obj = (*ctx->Driver.NewArrayObject)( ctx, name ); - if (!obj) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGenVertexArraysAPPLE"); - return; - } - save_array_object(ctx, obj); - arrays[i] = first + i; - } -} - - -/** - * ARB version of glGenVertexArrays() - * All arrays will be required to live in VBOs. - */ -void GLAPIENTRY -_mesa_GenVertexArrays(GLsizei n, GLuint *arrays) -{ - GET_CURRENT_CONTEXT(ctx); - gen_vertex_arrays(ctx, n, arrays); -} - - -/** - * APPLE version of glGenVertexArraysAPPLE() - * Arrays may live in VBOs or ordinary memory. - */ -void GLAPIENTRY -_mesa_GenVertexArraysAPPLE(GLsizei n, GLuint *arrays) -{ - GET_CURRENT_CONTEXT(ctx); - gen_vertex_arrays(ctx, n, arrays); -} - - -/** - * Determine if ID is the name of an array object. - * - * \param id ID of the potential array object. - * \return \c GL_TRUE if \c id is the name of a array object, - * \c GL_FALSE otherwise. - */ -GLboolean GLAPIENTRY -_mesa_IsVertexArrayAPPLE( GLuint id ) -{ - struct gl_array_object * obj; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); - - if (id == 0) - return GL_FALSE; - - obj = lookup_arrayobj(ctx, id); - - return (obj != NULL) ? GL_TRUE : GL_FALSE; -} diff --git a/dll/opengl/mesa/main/arrayobj.h b/dll/opengl/mesa/main/arrayobj.h deleted file mode 100644 index 0b5a0130370..00000000000 --- a/dll/opengl/mesa/main/arrayobj.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.6 - * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. - * (C) Copyright IBM Corporation 2006 - * Copyright (C) 2009 VMware, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL OR IBM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#ifndef ARRAYOBJ_H -#define ARRAYOBJ_H - -#include "glheader.h" - -struct gl_context; - -/** - * \file arrayobj.h - * Functions for the GL_APPLE_vertex_array_object extension. - * - * \author Ian Romanick - * \author Brian Paul - */ - -/* - * Internal functions - */ - -extern struct gl_array_object * -_mesa_new_array_object( struct gl_context *ctx, GLuint name ); - -extern void -_mesa_delete_array_object( struct gl_context *ctx, struct gl_array_object *obj ); - -extern void -_mesa_reference_array_object(struct gl_context *ctx, - struct gl_array_object **ptr, - struct gl_array_object *arrayObj); - -extern void -_mesa_initialize_array_object( struct gl_context *ctx, - struct gl_array_object *obj, GLuint name ); - - -extern void -_mesa_update_array_object_max_element(struct gl_context *ctx, - struct gl_array_object *arrayObj); - - -/* - * API functions - */ - - -void GLAPIENTRY _mesa_BindVertexArray( GLuint id ); - -void GLAPIENTRY _mesa_BindVertexArrayAPPLE( GLuint id ); - -void GLAPIENTRY _mesa_DeleteVertexArraysAPPLE(GLsizei n, const GLuint *ids); - -void GLAPIENTRY _mesa_GenVertexArrays(GLsizei n, GLuint *arrays); - -void GLAPIENTRY _mesa_GenVertexArraysAPPLE(GLsizei n, GLuint *buffer); - -GLboolean GLAPIENTRY _mesa_IsVertexArrayAPPLE( GLuint id ); - -#endif /* ARRAYOBJ_H */ diff --git a/dll/opengl/mesa/main/attrib.c b/dll/opengl/mesa/main/attrib.c index 1a1dce79675..d5df1dc7b75 100644 --- a/dll/opengl/mesa/main/attrib.c +++ b/dll/opengl/mesa/main/attrib.c @@ -529,7 +529,6 @@ pop_enable_group(struct gl_context *ctx, const struct gl_enable_attrib *enable) if (ctx->Texture.Unit.Enabled != enabled) { _mesa_set_enable(ctx, GL_TEXTURE_1D, !!(enabled & TEXTURE_1D_BIT)); _mesa_set_enable(ctx, GL_TEXTURE_2D, !!(enabled & TEXTURE_2D_BIT)); - _mesa_set_enable(ctx, GL_TEXTURE_3D, !!(enabled & TEXTURE_3D_BIT)); if (ctx->Extensions.ARB_texture_cube_map) { _mesa_set_enable(ctx, GL_TEXTURE_CUBE_MAP, !!(enabled & TEXTURE_CUBE_BIT)); @@ -561,7 +560,6 @@ pop_texture_group(struct gl_context *ctx, struct texture_state *texstate) _mesa_set_enable(ctx, GL_TEXTURE_1D, !!(unit->Enabled & TEXTURE_1D_BIT)); _mesa_set_enable(ctx, GL_TEXTURE_2D, !!(unit->Enabled & TEXTURE_2D_BIT)); - _mesa_set_enable(ctx, GL_TEXTURE_3D, !!(unit->Enabled & TEXTURE_3D_BIT)); _mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, unit->EnvMode); _mesa_TexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, unit->EnvColor); @@ -725,25 +723,7 @@ _mesa_PopAttrib(void) _mesa_set_enable(ctx, GL_BLEND, (color->BlendEnabled & 1)); } /* set same blend modes for all buffers */ - _mesa_BlendFuncSeparateEXT(color->SrcRGB, - color->DstRGB, - color->SrcA, - color->DstA); - /* This special case is because glBlendEquationSeparateEXT - * cannot take GL_LOGIC_OP as a parameter. - */ - if (color->EquationRGB == color->EquationA) { - _mesa_BlendEquation(color->EquationRGB); - } - else { - _mesa_BlendEquationSeparateEXT( - color->EquationRGB, - color->EquationA); - } - _mesa_BlendColor(color->BlendColor[0], - color->BlendColor[1], - color->BlendColor[2], - color->BlendColor[3]); + _mesa_BlendFunc(color->SrcFactor, color->DstFactor); _mesa_LogicOp(color->LogicOp); _mesa_set_enable(ctx, GL_COLOR_LOGIC_OP, color->ColorLogicOpEnabled); @@ -858,8 +838,6 @@ _mesa_PopAttrib(void) (GLfloat) light->Model.LocalViewer); _mesa_LightModelf(GL_LIGHT_MODEL_TWO_SIDE, (GLfloat) light->Model.TwoSide); - _mesa_LightModelf(GL_LIGHT_MODEL_COLOR_CONTROL, - (GLfloat) light->Model.ColorControl); /* shade model */ _mesa_ShadeModel(light->ShadeModel); /* color material */ @@ -1058,31 +1036,6 @@ copy_pixelstore(struct gl_context *ctx, #define GL_CLIENT_PACK_BIT (1<<20) #define GL_CLIENT_UNPACK_BIT (1<<21) -/** - * Copy gl_array_object from src to dest. - * 'dest' must be in an initialized state. - */ -static void -copy_array_object(struct gl_context *ctx, - struct gl_array_object *dest, - struct gl_array_object *src) -{ - GLuint i; - - /* skip Name */ - /* skip RefCount */ - - /* In theory must be the same anyway, but on recreate make sure it matches */ - dest->ARBsemantics = src->ARBsemantics; - - for (i = 0; i < Elements(src->VertexAttrib); i++) - _mesa_copy_client_array(ctx, &dest->VertexAttrib[i], &src->VertexAttrib[i]); - - /* _Enabled must be the same than on push */ - dest->_Enabled = src->_Enabled; - dest->_MaxElement = src->_MaxElement; -} - /** * Copy gl_array_attrib from src to dest. * 'dest' must be in an initialized state. @@ -1090,21 +1043,30 @@ copy_array_object(struct gl_context *ctx, static void copy_array_attrib(struct gl_context *ctx, struct gl_array_attrib *dest, - struct gl_array_attrib *src, - GLboolean vbo_deleted) + struct gl_array_attrib *src) { - /* skip ArrayObj */ - /* skip DefaultArrayObj, Objects */ - dest->LockFirst = src->LockFirst; - dest->LockCount = src->LockCount; - /* skip NewState */ - /* skip RebindArrays */ + GLuint i; - if (!vbo_deleted) - copy_array_object(ctx, dest->ArrayObj, src->ArrayObj); + /* skip ArrayObj */ + /* skip DefaultArrayObj, Objects */ + dest->LockFirst = src->LockFirst; + dest->LockCount = src->LockCount; + /* skip NewState */ + /* skip RebindArrays */ - /* skip ArrayBufferObj */ - /* skip ElementArrayBufferObj */ + + /* skip Name */ + /* skip RefCount */ + + for (i = 0; i < Elements(src->VertexAttrib); i++) + _mesa_copy_client_array(ctx, &dest->VertexAttrib[i], &src->VertexAttrib[i]); + + /* _Enabled must be the same than on push */ + dest->_Enabled = src->_Enabled; + dest->_MaxElement = src->_MaxElement; + + /* skip ArrayBufferObj */ + /* skip ElementArrayBufferObj */ } /** @@ -1115,17 +1077,12 @@ save_array_attrib(struct gl_context *ctx, struct gl_array_attrib *dest, struct gl_array_attrib *src) { - /* Set the Name, needed for restore, but do never overwrite. - * Needs to match value in the object hash. */ - dest->ArrayObj->Name = src->ArrayObj->Name; /* And copy all of the rest. */ - copy_array_attrib(ctx, dest, src, GL_FALSE); + copy_array_attrib(ctx, dest, src); /* Just reference them here */ - _mesa_reference_buffer_object(ctx, &dest->ArrayBufferObj, - src->ArrayBufferObj); - _mesa_reference_buffer_object(ctx, &dest->ArrayObj->ElementArrayBufferObj, - src->ArrayObj->ElementArrayBufferObj); + _mesa_reference_buffer_object(ctx, &dest->ElementArrayBufferObj, + src->ElementArrayBufferObj); } /** @@ -1136,44 +1093,12 @@ restore_array_attrib(struct gl_context *ctx, struct gl_array_attrib *dest, struct gl_array_attrib *src) { - /* The ARB_vertex_array_object spec says: - * - * "BindVertexArray fails and an INVALID_OPERATION error is generated - * if array is not a name returned from a previous call to - * GenVertexArrays, or if such a name has since been deleted with - * DeleteVertexArrays." - * - * Therefore popping a deleted VAO cannot magically recreate it. - * - * The semantics of objects created using APPLE_vertex_array_objects behave - * differently. These objects expect to be recreated by pop. Alas. - */ - const GLboolean arb_vao = (src->ArrayObj->Name != 0 - && src->ArrayObj->ARBsemantics); + copy_array_attrib(ctx, dest, src); - if (arb_vao && !_mesa_IsVertexArrayAPPLE(src->ArrayObj->Name)) - return; - - _mesa_BindVertexArrayAPPLE(src->ArrayObj->Name); - - /* Restore or recreate the buffer objects by the names ... */ - if (!arb_vao - || src->ArrayBufferObj->Name == 0 - || _mesa_IsBufferARB(src->ArrayBufferObj->Name)) { - /* ... and restore its content */ - copy_array_attrib(ctx, dest, src, GL_FALSE); - - _mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB, - src->ArrayBufferObj->Name); - } else { - copy_array_attrib(ctx, dest, src, GL_TRUE); - } - - if (!arb_vao - || src->ArrayObj->ElementArrayBufferObj->Name == 0 - || _mesa_IsBufferARB(src->ArrayObj->ElementArrayBufferObj->Name)) + if (src->ElementArrayBufferObj->Name == 0 + || _mesa_IsBufferARB(src->ElementArrayBufferObj->Name)) _mesa_BindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, - src->ArrayObj->ElementArrayBufferObj->Name); + src->ElementArrayBufferObj->Name); /* Better safe than sorry?! */ dest->RebindArrays = GL_TRUE; @@ -1183,36 +1108,7 @@ restore_array_attrib(struct gl_context *ctx, * FIXME: of the old ArrayObj->_Enabled and the new _Enabled. * ... just do it. */ - dest->NewState |= src->ArrayObj->_Enabled | dest->ArrayObj->_Enabled; -} - -/** - * init/alloc the fields of 'attrib'. - * Needs to the init part matching free_array_attrib_data below. - */ -static void -init_array_attrib_data(struct gl_context *ctx, - struct gl_array_attrib *attrib) -{ - /* Get a non driver gl_array_object. */ - attrib->ArrayObj = CALLOC_STRUCT( gl_array_object ); - _mesa_initialize_array_object(ctx, attrib->ArrayObj, 0); -} - -/** - * Free/unreference the fields of 'attrib' but don't delete it (that's - * done later in the calling code). - * Needs to the cleanup part matching init_array_attrib_data above. - */ -static void -free_array_attrib_data(struct gl_context *ctx, - struct gl_array_attrib *attrib) -{ - /* We use a non driver array object, so don't just unref since we would - * end up using the drivers DeleteArrayObject function for deletion. */ - _mesa_delete_array_object(ctx, attrib->ArrayObj); - attrib->ArrayObj = 0; - _mesa_reference_buffer_object(ctx, &attrib->ArrayBufferObj, NULL); + dest->NewState |= src->_Enabled | dest->_Enabled; } @@ -1249,7 +1145,7 @@ _mesa_PushClientAttrib(GLbitfield mask) if (mask & GL_CLIENT_VERTEX_ARRAY_BIT) { struct gl_array_attrib *attr; attr = CALLOC_STRUCT( gl_array_attrib ); - init_array_attrib_data(ctx, attr); + _mesa_init_varray(ctx, attr); save_array_attrib(ctx, attr, &ctx->Array); save_attrib_data(&head, GL_CLIENT_VERTEX_ARRAY_BIT, attr); } @@ -1299,7 +1195,7 @@ _mesa_PopClientAttrib(void) struct gl_array_attrib * attr = (struct gl_array_attrib *) node->data; restore_array_attrib(ctx, &ctx->Array, attr); - free_array_attrib_data(ctx, attr); + _mesa_free_varray_data(ctx, attr); ctx->NewState |= _NEW_ARRAY; break; } diff --git a/dll/opengl/mesa/main/blend.c b/dll/opengl/mesa/main/blend.c index 93145d00c13..4094518d8f8 100644 --- a/dll/opengl/mesa/main/blend.c +++ b/dll/opengl/mesa/main/blend.c @@ -97,34 +97,19 @@ legal_dst_factor(const struct gl_context *ctx, GLenum factor) */ static GLboolean validate_blend_factors(struct gl_context *ctx, const char *func, - GLenum sfactorRGB, GLenum dfactorRGB, - GLenum sfactorA, GLenum dfactorA) + GLenum srcfactor, GLenum dstfactor) { - if (!legal_src_factor(ctx, sfactorRGB)) { + if (!legal_src_factor(ctx, srcfactor)) { _mesa_error(ctx, GL_INVALID_ENUM, "%s(sfactorRGB = %s)", func, - _mesa_lookup_enum_by_nr(sfactorRGB)); + _mesa_lookup_enum_by_nr(srcfactor)); return GL_FALSE; } - if (!legal_dst_factor(ctx, dfactorRGB)) { + if (!legal_dst_factor(ctx, dstfactor)) { _mesa_error(ctx, GL_INVALID_ENUM, "%s(dfactorRGB = %s)", func, - _mesa_lookup_enum_by_nr(dfactorRGB)); - return GL_FALSE; - } - - if (sfactorA != sfactorRGB && !legal_src_factor(ctx, sfactorA)) { - _mesa_error(ctx, GL_INVALID_ENUM, - "%s(sfactorA = %s)", func, - _mesa_lookup_enum_by_nr(sfactorA)); - return GL_FALSE; - } - - if (dfactorA != dfactorRGB && !legal_dst_factor(ctx, dfactorA)) { - _mesa_error(ctx, GL_INVALID_ENUM, - "%s(dfactorA = %s)", func, - _mesa_lookup_enum_by_nr(dfactorA)); + _mesa_lookup_enum_by_nr(dstfactor)); return GL_FALSE; } @@ -138,190 +123,32 @@ validate_blend_factors(struct gl_context *ctx, const char *func, * \param sfactor source factor operator. * \param dfactor destination factor operator. * - * \sa glBlendFunc, glBlendFuncSeparateEXT + * \sa glBlendFunc */ void GLAPIENTRY _mesa_BlendFunc( GLenum sfactor, GLenum dfactor ) -{ - _mesa_BlendFuncSeparateEXT(sfactor, dfactor, sfactor, dfactor); -} - - -/** - * Set the separate blend source/dest factors for all draw buffers. - * - * \param sfactorRGB RGB source factor operator. - * \param dfactorRGB RGB destination factor operator. - * \param sfactorA alpha source factor operator. - * \param dfactorA alpha destination factor operator. - */ -void GLAPIENTRY -_mesa_BlendFuncSeparateEXT( GLenum sfactorRGB, GLenum dfactorRGB, - GLenum sfactorA, GLenum dfactorA ) { GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glBlendFuncSeparate %s %s %s %s\n", - _mesa_lookup_enum_by_nr(sfactorRGB), - _mesa_lookup_enum_by_nr(dfactorRGB), - _mesa_lookup_enum_by_nr(sfactorA), - _mesa_lookup_enum_by_nr(dfactorA)); + _mesa_debug(ctx, "glBlendFunc %s %s\n", + _mesa_lookup_enum_by_nr(sfactor), + _mesa_lookup_enum_by_nr(dfactor)); - if (!validate_blend_factors(ctx, "glBlendFuncSeparate", - sfactorRGB, dfactorRGB, - sfactorA, dfactorA)) { + if (!validate_blend_factors(ctx, "glBlendFunc", sfactor, dfactor)) { return; } - if (ctx->Color.SrcRGB == sfactorRGB && - ctx->Color.DstRGB == dfactorRGB && - ctx->Color.SrcA == sfactorA && - ctx->Color.DstA == dfactorA) { + if (ctx->Color.SrcFactor == sfactor && + ctx->Color.DstFactor == dfactor) { return; } FLUSH_VERTICES(ctx, _NEW_COLOR); - ctx->Color.SrcRGB = sfactorRGB; - ctx->Color.DstRGB = dfactorRGB; - ctx->Color.SrcA = sfactorA; - ctx->Color.DstA = dfactorA; - if (ctx->Driver.BlendFuncSeparate) { - ctx->Driver.BlendFuncSeparate(ctx, sfactorRGB, dfactorRGB, - sfactorA, dfactorA); - } -} - - -#if _HAVE_FULL_GL -/** - * Check if given blend equation is legal. - * \return GL_TRUE if legal, GL_FALSE otherwise. - */ -static GLboolean -legal_blend_equation(const struct gl_context *ctx, GLenum mode) -{ - switch (mode) { - case GL_FUNC_ADD: - case GL_FUNC_SUBTRACT: - case GL_FUNC_REVERSE_SUBTRACT: - return GL_TRUE; - case GL_MIN: - case GL_MAX: - return ctx->Extensions.EXT_blend_minmax; - default: - return GL_FALSE; - } -} - - -/* This is really an extension function! */ -void GLAPIENTRY -_mesa_BlendEquation( GLenum mode ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glBlendEquation(%s)\n", - _mesa_lookup_enum_by_nr(mode)); - - if (!legal_blend_equation(ctx, mode)) { - _mesa_error(ctx, GL_INVALID_ENUM, "glBlendEquation"); - return; - } - - if (ctx->Color.EquationRGB == mode && ctx->Color.EquationA == mode) { - return; - } - - FLUSH_VERTICES(ctx, _NEW_COLOR); - ctx->Color.EquationRGB = mode; - ctx->Color.EquationA = mode; - - if (ctx->Driver.BlendEquationSeparate) - (*ctx->Driver.BlendEquationSeparate)( ctx, mode, mode ); -} - -void GLAPIENTRY -_mesa_BlendEquationSeparateEXT( GLenum modeRGB, GLenum modeA ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glBlendEquationSeparateEXT(%s %s)\n", - _mesa_lookup_enum_by_nr(modeRGB), - _mesa_lookup_enum_by_nr(modeA)); - - if ( (modeRGB != modeA) && !ctx->Extensions.EXT_blend_equation_separate ) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glBlendEquationSeparateEXT not supported by driver"); - return; - } - - if (!legal_blend_equation(ctx, modeRGB)) { - _mesa_error(ctx, GL_INVALID_ENUM, "glBlendEquationSeparateEXT(modeRGB)"); - return; - } - - if (!legal_blend_equation(ctx, modeA)) { - _mesa_error(ctx, GL_INVALID_ENUM, "glBlendEquationSeparateEXT(modeA)"); - return; - } - - if (ctx->Color.EquationRGB == modeRGB && ctx->Color.EquationA == modeA) { - return; - } - - FLUSH_VERTICES(ctx, _NEW_COLOR); - ctx->Color.EquationRGB = modeRGB; - ctx->Color.EquationA = modeA; - - if (ctx->Driver.BlendEquationSeparate) - ctx->Driver.BlendEquationSeparate(ctx, modeRGB, modeA); -} - - -#endif /* _HAVE_FULL_GL */ - - -/** - * Set the blending color. - * - * \param red red color component. - * \param green green color component. - * \param blue blue color component. - * \param alpha alpha color component. - * - * \sa glBlendColor(). - * - * Clamps the parameters and updates gl_colorbuffer_attrib::BlendColor. On a - * change, flushes the vertices and notifies the driver via - * dd_function_table::BlendColor callback. - */ -void GLAPIENTRY -_mesa_BlendColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) -{ - GLfloat tmp[4]; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - tmp[0] = red; - tmp[1] = green; - tmp[2] = blue; - tmp[3] = alpha; - - if (TEST_EQ_4V(tmp, ctx->Color.BlendColor)) - return; - - FLUSH_VERTICES(ctx, _NEW_COLOR); - COPY_4FV( ctx->Color.BlendColor, tmp ); - - if (ctx->Driver.BlendColor) - (*ctx->Driver.BlendColor)(ctx, ctx->Color.BlendColor); + ctx->Color.SrcFactor = sfactor; + ctx->Color.DstFactor = dfactor; } @@ -507,13 +334,8 @@ void _mesa_init_color( struct gl_context * ctx ) ctx->Color.AlphaFunc = GL_ALWAYS; ctx->Color.AlphaRef = 0; ctx->Color.BlendEnabled = 0x0; - ctx->Color.SrcRGB = GL_ONE; - ctx->Color.DstRGB = GL_ZERO; - ctx->Color.SrcA = GL_ONE; - ctx->Color.DstA = GL_ZERO; - ctx->Color.EquationRGB = GL_FUNC_ADD; - ctx->Color.EquationA = GL_FUNC_ADD; - ASSIGN_4V( ctx->Color.BlendColor, 0.0, 0.0, 0.0, 0.0 ); + ctx->Color.SrcFactor = GL_ONE; + ctx->Color.DstFactor = GL_ZERO; ctx->Color.IndexLogicOpEnabled = GL_FALSE; ctx->Color.ColorLogicOpEnabled = GL_FALSE; ctx->Color.LogicOp = GL_COPY; diff --git a/dll/opengl/mesa/main/blend.h b/dll/opengl/mesa/main/blend.h index 3124702520b..66452957165 100644 --- a/dll/opengl/mesa/main/blend.h +++ b/dll/opengl/mesa/main/blend.h @@ -42,24 +42,6 @@ extern void GLAPIENTRY _mesa_BlendFunc( GLenum sfactor, GLenum dfactor ); -extern void GLAPIENTRY -_mesa_BlendFuncSeparateEXT( GLenum sfactorRGB, GLenum dfactorRGB, - GLenum sfactorA, GLenum dfactorA ); - - -extern void GLAPIENTRY -_mesa_BlendEquation( GLenum mode ); - - - -extern void GLAPIENTRY -_mesa_BlendEquationSeparateEXT( GLenum modeRGB, GLenum modeA ); - - -extern void GLAPIENTRY -_mesa_BlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); - - extern void GLAPIENTRY _mesa_AlphaFunc( GLenum func, GLclampf ref ); diff --git a/dll/opengl/mesa/main/bufferobj.c b/dll/opengl/mesa/main/bufferobj.c index b237fa6a114..883aee9af8a 100644 --- a/dll/opengl/mesa/main/bufferobj.c +++ b/dll/opengl/mesa/main/bufferobj.c @@ -55,10 +55,8 @@ static inline struct gl_buffer_object ** get_buffer_target(struct gl_context *ctx, GLenum target) { switch (target) { - case GL_ARRAY_BUFFER_ARB: - return &ctx->Array.ArrayBufferObj; case GL_ELEMENT_ARRAY_BUFFER_ARB: - return &ctx->Array.ArrayObj->ElementArrayBufferObj; + return &ctx->Array.ElementArrayBufferObj; default: return NULL; } @@ -474,16 +472,6 @@ _mesa_init_buffer_objects( struct gl_context *ctx ) memset(&DummyBufferObject, 0, sizeof(DummyBufferObject)); _glthread_INIT_MUTEX(DummyBufferObject.Mutex); DummyBufferObject.RefCount = 1000*1000*1000; /* never delete */ - - _mesa_reference_buffer_object(ctx, &ctx->Array.ArrayBufferObj, - ctx->Shared->NullBufferObj); -} - - -void -_mesa_free_buffer_objects( struct gl_context *ctx ) -{ - _mesa_reference_buffer_object(ctx, &ctx->Array.ArrayBufferObj, NULL); } @@ -658,7 +646,6 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids) for (i = 0; i < n; i++) { struct gl_buffer_object *bufObj = _mesa_lookup_bufferobj(ctx, ids[i]); if (bufObj) { - struct gl_array_object *arrayObj = ctx->Array.ArrayObj; GLuint j; ASSERT(bufObj->Name == ids[i] || bufObj == &DummyBufferObject); @@ -671,14 +658,11 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids) } /* unbind any vertex pointers bound to this buffer */ - for (j = 0; j < Elements(arrayObj->VertexAttrib); j++) { - unbind(ctx, &arrayObj->VertexAttrib[j].BufferObj, bufObj); + for (j = 0; j < Elements(ctx->Array.VertexAttrib); j++) { + unbind(ctx, &ctx->Array.VertexAttrib[j].BufferObj, bufObj); } - if (ctx->Array.ArrayBufferObj == bufObj) { - _mesa_BindBufferARB( GL_ARRAY_BUFFER_ARB, 0 ); - } - if (arrayObj->ElementArrayBufferObj == bufObj) { + if (ctx->Array.ElementArrayBufferObj == bufObj) { _mesa_BindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, 0 ); } @@ -1326,286 +1310,3 @@ _mesa_FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length) ctx->Driver.FlushMappedBufferRange(ctx, offset, length, bufObj); } - -#if FEATURE_APPLE_object_purgeable -static GLenum -buffer_object_purgeable(struct gl_context *ctx, GLuint name, GLenum option) -{ - struct gl_buffer_object *bufObj; - GLenum retval; - - bufObj = _mesa_lookup_bufferobj(ctx, name); - if (!bufObj) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glObjectPurgeable(name = 0x%x)", name); - return 0; - } - if (!_mesa_is_bufferobj(bufObj)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glObjectPurgeable(buffer 0)" ); - return 0; - } - - if (bufObj->Purgeable) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glObjectPurgeable(name = 0x%x) is already purgeable", name); - return GL_VOLATILE_APPLE; - } - - bufObj->Purgeable = GL_TRUE; - - retval = GL_VOLATILE_APPLE; - if (ctx->Driver.BufferObjectPurgeable) - retval = ctx->Driver.BufferObjectPurgeable(ctx, bufObj, option); - - return retval; -} - -static GLenum -texture_object_purgeable(struct gl_context *ctx, GLuint name, GLenum option) -{ - struct gl_texture_object *bufObj; - GLenum retval; - - bufObj = _mesa_lookup_texture(ctx, name); - if (!bufObj) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glObjectPurgeable(name = 0x%x)", name); - return 0; - } - - if (bufObj->Purgeable) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glObjectPurgeable(name = 0x%x) is already purgeable", name); - return GL_VOLATILE_APPLE; - } - - bufObj->Purgeable = GL_TRUE; - - retval = GL_VOLATILE_APPLE; - if (ctx->Driver.TextureObjectPurgeable) - retval = ctx->Driver.TextureObjectPurgeable(ctx, bufObj, option); - - return retval; -} - - -GLenum GLAPIENTRY -_mesa_ObjectPurgeableAPPLE(GLenum objectType, GLuint name, GLenum option) -{ - GLenum retval; - - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0); - - if (name == 0) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glObjectPurgeable(name = 0x%x)", name); - return 0; - } - - switch (option) { - case GL_VOLATILE_APPLE: - case GL_RELEASED_APPLE: - /* legal */ - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, - "glObjectPurgeable(name = 0x%x) invalid option: %d", - name, option); - return 0; - } - - switch (objectType) { - case GL_TEXTURE: - retval = texture_object_purgeable(ctx, name, option); - break; - case GL_BUFFER_OBJECT_APPLE: - retval = buffer_object_purgeable(ctx, name, option); - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, - "glObjectPurgeable(name = 0x%x) invalid type: %d", - name, objectType); - return 0; - } - - /* In strict conformance to the spec, we must only return VOLATILE when - * when passed the VOLATILE option. Madness. - * - * XXX First fix the spec, then fix me. - */ - return option == GL_VOLATILE_APPLE ? GL_VOLATILE_APPLE : retval; -} - - -static GLenum -buffer_object_unpurgeable(struct gl_context *ctx, GLuint name, GLenum option) -{ - struct gl_buffer_object *bufObj; - GLenum retval; - - bufObj = _mesa_lookup_bufferobj(ctx, name); - if (!bufObj) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glObjectUnpurgeable(name = 0x%x)", name); - return 0; - } - - if (! bufObj->Purgeable) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glObjectUnpurgeable(name = 0x%x) object is " - " already \"unpurged\"", name); - return 0; - } - - bufObj->Purgeable = GL_FALSE; - - retval = option; - if (ctx->Driver.BufferObjectUnpurgeable) - retval = ctx->Driver.BufferObjectUnpurgeable(ctx, bufObj, option); - - return retval; -} - -static GLenum -texture_object_unpurgeable(struct gl_context *ctx, GLuint name, GLenum option) -{ - struct gl_texture_object *bufObj; - GLenum retval; - - bufObj = _mesa_lookup_texture(ctx, name); - if (!bufObj) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glObjectUnpurgeable(name = 0x%x)", name); - return 0; - } - - if (! bufObj->Purgeable) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glObjectUnpurgeable(name = 0x%x) object is" - " already \"unpurged\"", name); - return 0; - } - - bufObj->Purgeable = GL_FALSE; - - retval = option; - if (ctx->Driver.TextureObjectUnpurgeable) - retval = ctx->Driver.TextureObjectUnpurgeable(ctx, bufObj, option); - - return retval; -} - - -GLenum GLAPIENTRY -_mesa_ObjectUnpurgeableAPPLE(GLenum objectType, GLuint name, GLenum option) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0); - - if (name == 0) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glObjectUnpurgeable(name = 0x%x)", name); - return 0; - } - - switch (option) { - case GL_RETAINED_APPLE: - case GL_UNDEFINED_APPLE: - /* legal */ - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, - "glObjectUnpurgeable(name = 0x%x) invalid option: %d", - name, option); - return 0; - } - - switch (objectType) { - case GL_BUFFER_OBJECT_APPLE: - return buffer_object_unpurgeable(ctx, name, option); - case GL_TEXTURE: - return texture_object_unpurgeable(ctx, name, option); - default: - _mesa_error(ctx, GL_INVALID_ENUM, - "glObjectUnpurgeable(name = 0x%x) invalid type: %d", - name, objectType); - return 0; - } -} - - -static void -get_buffer_object_parameteriv(struct gl_context *ctx, GLuint name, - GLenum pname, GLint *params) -{ - struct gl_buffer_object *bufObj = _mesa_lookup_bufferobj(ctx, name); - if (!bufObj) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glGetObjectParameteriv(name = 0x%x) invalid object", name); - return; - } - - switch (pname) { - case GL_PURGEABLE_APPLE: - *params = bufObj->Purgeable; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetObjectParameteriv(name = 0x%x) invalid enum: %d", - name, pname); - break; - } -} - -static void -get_texture_object_parameteriv(struct gl_context *ctx, GLuint name, - GLenum pname, GLint *params) -{ - struct gl_texture_object *texObj = _mesa_lookup_texture(ctx, name); - if (!texObj) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glObjectUnpurgeable(name = 0x%x)", name); - return; - } - - switch (pname) { - case GL_PURGEABLE_APPLE: - *params = texObj->Purgeable; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetObjectParameteriv(name = 0x%x) invalid enum: %d", - name, pname); - break; - } -} - - -void GLAPIENTRY -_mesa_GetObjectParameterivAPPLE(GLenum objectType, GLuint name, GLenum pname, - GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - - if (name == 0) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glGetObjectParameteriv(name = 0x%x)", name); - return; - } - - switch (objectType) { - case GL_TEXTURE: - get_texture_object_parameteriv(ctx, name, pname, params); - break; - case GL_BUFFER_OBJECT_APPLE: - get_buffer_object_parameteriv(ctx, name, pname, params); - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetObjectParameteriv(name = 0x%x) invalid type: %d", - name, objectType); - } -} - -#endif /* FEATURE_APPLE_object_purgeable */ diff --git a/dll/opengl/mesa/main/colortab.c b/dll/opengl/mesa/main/colortab.c deleted file mode 100644 index 17cc8b7325c..00000000000 --- a/dll/opengl/mesa/main/colortab.c +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -#include - -#if FEATURE_colortable - -void GLAPIENTRY -_mesa_ColorTable( GLenum target, GLenum internalFormat, - GLsizei width, GLenum format, GLenum type, - const GLvoid *data ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - _mesa_error(ctx, GL_INVALID_ENUM, "glColorTable(target)"); -} - - - -void GLAPIENTRY -_mesa_ColorSubTable( GLenum target, GLsizei start, - GLsizei count, GLenum format, GLenum type, - const GLvoid *data ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - _mesa_error(ctx, GL_INVALID_ENUM, "glColorSubTable(target)"); -} - - - -static void GLAPIENTRY -_mesa_CopyColorTable(GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - _mesa_error(ctx, GL_INVALID_ENUM, "glCopyColorTable(target)"); -} - - - -static void GLAPIENTRY -_mesa_CopyColorSubTable(GLenum target, GLsizei start, - GLint x, GLint y, GLsizei width) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - _mesa_error(ctx, GL_INVALID_ENUM, "glCopyColorSubTable(target)"); -} - - -static void GLAPIENTRY -_mesa_GetColorTable( GLenum target, GLenum format, - GLenum type, GLvoid *data ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - _mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTable(target)"); -} - - -static void GLAPIENTRY -_mesa_ColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params) -{ - /* no extensions use this function */ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - _mesa_error(ctx, GL_INVALID_ENUM, "glColorTableParameterfv(target)"); -} - - - -static void GLAPIENTRY -_mesa_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params) -{ - /* no extensions use this function */ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - _mesa_error(ctx, GL_INVALID_ENUM, "glColorTableParameteriv(target)"); -} - - - -static void GLAPIENTRY -_mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - _mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTableParameterfv(target)"); -} - - - -static void GLAPIENTRY -_mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - _mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTableParameteriv(target)"); -} - - -void -_mesa_init_colortable_dispatch(struct _glapi_table *disp) -{ - SET_ColorSubTable(disp, _mesa_ColorSubTable); - SET_ColorTable(disp, _mesa_ColorTable); - SET_ColorTableParameterfv(disp, _mesa_ColorTableParameterfv); - SET_ColorTableParameteriv(disp, _mesa_ColorTableParameteriv); - SET_CopyColorSubTable(disp, _mesa_CopyColorSubTable); - SET_CopyColorTable(disp, _mesa_CopyColorTable); - SET_GetColorTable(disp, _mesa_GetColorTable); - SET_GetColorTableParameterfv(disp, _mesa_GetColorTableParameterfv); - SET_GetColorTableParameteriv(disp, _mesa_GetColorTableParameteriv); -} - - -#endif /* FEATURE_colortable */ diff --git a/dll/opengl/mesa/main/colortab.h b/dll/opengl/mesa/main/colortab.h deleted file mode 100644 index 4e225ffc951..00000000000 --- a/dll/opengl/mesa/main/colortab.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.2 - * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - -#ifndef COLORTAB_H -#define COLORTAB_H - - -#include "compiler.h" -#include "glheader.h" -#include "mfeatures.h" - -struct _glapi_table; - -#if FEATURE_colortable - -extern void GLAPIENTRY -_mesa_ColorTable( GLenum target, GLenum internalformat, - GLsizei width, GLenum format, GLenum type, - const GLvoid *table ); - -extern void GLAPIENTRY -_mesa_ColorSubTable( GLenum target, GLsizei start, - GLsizei count, GLenum format, GLenum type, - const GLvoid *table ); - -extern void -_mesa_init_colortable_dispatch(struct _glapi_table *disp); - -#else /* FEATURE_colortable */ - -static inline void GLAPIENTRY -_mesa_ColorTable( GLenum target, GLenum internalformat, - GLsizei width, GLenum format, GLenum type, - const GLvoid *table ) -{ - ASSERT_NO_FEATURE(); -} - -static inline void GLAPIENTRY -_mesa_ColorSubTable( GLenum target, GLsizei start, - GLsizei count, GLenum format, GLenum type, - const GLvoid *table ) -{ - ASSERT_NO_FEATURE(); -} - -static inline void -_mesa_init_colortable_dispatch(struct _glapi_table *disp) -{ -} - -#endif /* FEATURE_colortable */ - -#endif /* COLORTAB_H */ diff --git a/dll/opengl/mesa/main/config.h b/dll/opengl/mesa/main/config.h index c88dfc941ed..4f5f18ecf39 100644 --- a/dll/opengl/mesa/main/config.h +++ b/dll/opengl/mesa/main/config.h @@ -97,9 +97,6 @@ /** Line width granularity */ #define LINE_WIDTH_GRANULARITY 0.1 -/** Max texture palette / color table size */ -#define MAX_COLOR_TABLE_SIZE 256 - /** Max memory to allow for a single texture image (in megabytes) */ #define MAX_TEXTURE_MBYTES 1024 @@ -135,7 +132,6 @@ #undef MAX_WIDTH #undef MAX_HEIGHT #define MAX_TEXTURE_LEVELS 13 -#define MAX_3D_TEXTURE_LEVELS 9 #define MAX_CUBE_TEXTURE_LEVELS 13 #define MAX_WIDTH 4096 #define MAX_HEIGHT 4096 @@ -155,9 +151,6 @@ /** Max convolution filter height */ #define MAX_CONVOLUTION_HEIGHT 9 -/** For GL_ARB_texture_compression */ -#define MAX_COMPRESSED_TEXTURE_FORMATS 25 - /** For GL_EXT_texture_filter_anisotropic */ #define MAX_TEXTURE_MAX_ANISOTROPY 16.0 diff --git a/dll/opengl/mesa/main/context.c b/dll/opengl/mesa/main/context.c index ac1e0c5b0c6..8c4056fcc74 100644 --- a/dll/opengl/mesa/main/context.c +++ b/dll/opengl/mesa/main/context.c @@ -373,8 +373,7 @@ _mesa_init_current(struct gl_context *ctx) /* redo special cases: */ ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_WEIGHT], 1.0, 0.0, 0.0, 0.0 ); ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_NORMAL], 0.0, 0.0, 1.0, 1.0 ); - ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_COLOR0], 1.0, 1.0, 1.0, 1.0 ); - ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_COLOR1], 0.0, 0.0, 0.0, 1.0 ); + ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_COLOR], 1.0, 1.0, 1.0, 1.0 ); ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_COLOR_INDEX], 1.0, 0.0, 0.0, 1.0 ); ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_EDGEFLAG], 1.0, 0.0, 0.0, 1.0 ); } @@ -392,7 +391,6 @@ _mesa_init_constants(struct gl_context *ctx) /* Constants, may be overriden (usually only reduced) by device drivers */ ctx->Const.MaxTextureMbytes = MAX_TEXTURE_MBYTES; ctx->Const.MaxTextureLevels = MAX_TEXTURE_LEVELS; - ctx->Const.Max3DTextureLevels = MAX_3D_TEXTURE_LEVELS; ctx->Const.MaxCubeTextureLevels = MAX_CUBE_TEXTURE_LEVELS; ctx->Const.MaxTextureMaxAnisotropy = MAX_TEXTURE_MAX_ANISOTROPY; ctx->Const.MaxArrayLockSize = MAX_ARRAY_LOCK_SIZE; @@ -407,7 +405,6 @@ _mesa_init_constants(struct gl_context *ctx) ctx->Const.MinLineWidthAA = MIN_LINE_WIDTH; ctx->Const.MaxLineWidthAA = MAX_LINE_WIDTH; ctx->Const.LineWidthGranularity = (GLfloat) LINE_WIDTH_GRANULARITY; - ctx->Const.MaxColorTableSize = MAX_COLOR_TABLE_SIZE; ctx->Const.MaxClipPlanes = 6; ctx->Const.MaxLights = MAX_LIGHTS; ctx->Const.MaxShininess = 128.0; @@ -495,7 +492,7 @@ init_attrib_groups(struct gl_context *ctx) _mesa_init_scissor( ctx ); _mesa_init_stencil( ctx ); _mesa_init_transform( ctx ); - _mesa_init_varray( ctx ); + _mesa_init_varray(ctx, &ctx->Array); _mesa_init_viewport( ctx ); if (!_mesa_init_texture( ctx )) @@ -743,17 +740,12 @@ _mesa_free_context_data( struct gl_context *ctx ) _mesa_reference_framebuffer(&ctx->ReadBuffer, NULL); _mesa_free_attrib_data(ctx); - _mesa_free_buffer_objects(ctx); _mesa_free_lighting_data( ctx ); _mesa_free_eval_data( ctx ); _mesa_free_texture_data( ctx ); _mesa_free_matrix_data( ctx ); _mesa_free_viewport_data( ctx ); - _mesa_free_varray_data(ctx); - - _mesa_delete_array_object(ctx, ctx->Array.DefaultArrayObj); - - _mesa_reference_buffer_object(ctx, &ctx->Array.ArrayBufferObj, NULL); + _mesa_free_varray_data(ctx, &ctx->Array); /* free dispatch tables */ free(ctx->Exec); diff --git a/dll/opengl/mesa/main/convolve.c b/dll/opengl/mesa/main/convolve.c deleted file mode 100644 index a20d411b22f..00000000000 --- a/dll/opengl/mesa/main/convolve.c +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.2 - * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * Image convolution functions. - * - * Notes: filter kernel elements are indexed by and as in - * the GL spec. - */ - -#include - -#if FEATURE_convolve - -static void GLAPIENTRY -_mesa_ConvolutionFilter1D(GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *image) -{ - GET_CURRENT_CONTEXT(ctx); - - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionFilter1D"); -} - -static void GLAPIENTRY -_mesa_ConvolutionFilter2D(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image) -{ - GET_CURRENT_CONTEXT(ctx); - - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionFilter2D"); -} - - -static void GLAPIENTRY -_mesa_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat param) -{ - GET_CURRENT_CONTEXT(ctx); - - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameterf"); -} - - -static void GLAPIENTRY -_mesa_ConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameterfv"); -} - - -static void GLAPIENTRY -_mesa_ConvolutionParameteri(GLenum target, GLenum pname, GLint param) -{ - GET_CURRENT_CONTEXT(ctx); - - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameteri"); -} - - -static void GLAPIENTRY -_mesa_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameteriv"); -} - - -static void GLAPIENTRY -_mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width) -{ - GET_CURRENT_CONTEXT(ctx); - - _mesa_error(ctx, GL_INVALID_ENUM, "glCopyConvolutionFilter1D"); -} - - -static void GLAPIENTRY -_mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height) -{ - GET_CURRENT_CONTEXT(ctx); - - _mesa_error(ctx, GL_INVALID_ENUM, "glCopyConvolutionFilter2D"); -} - - -static void GLAPIENTRY -_mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, - GLvoid *image) -{ - GET_CURRENT_CONTEXT(ctx); - - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetConvolutionFilter"); -} - - -static void GLAPIENTRY -_mesa_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - - _mesa_error(ctx, GL_INVALID_ENUM, "glGetConvolutionParameterfv"); -} - - -static void GLAPIENTRY -_mesa_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - - _mesa_error(ctx, GL_INVALID_ENUM, "glGetConvolutionParameteriv"); -} - - -static void GLAPIENTRY -_mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type, - GLvoid *row, GLvoid *column, - GLvoid *span) -{ - GET_CURRENT_CONTEXT(ctx); - - _mesa_error(ctx, GL_INVALID_ENUM, "glGetSeparableFilter"); -} - - -static void GLAPIENTRY -_mesa_SeparableFilter2D(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column) -{ - GET_CURRENT_CONTEXT(ctx); - - _mesa_error(ctx, GL_INVALID_ENUM, "glSeparableFilter2D"); -} - -void -_mesa_init_convolve_dispatch(struct _glapi_table *disp) -{ - SET_ConvolutionFilter1D(disp, _mesa_ConvolutionFilter1D); - SET_ConvolutionFilter2D(disp, _mesa_ConvolutionFilter2D); - SET_ConvolutionParameterf(disp, _mesa_ConvolutionParameterf); - SET_ConvolutionParameterfv(disp, _mesa_ConvolutionParameterfv); - SET_ConvolutionParameteri(disp, _mesa_ConvolutionParameteri); - SET_ConvolutionParameteriv(disp, _mesa_ConvolutionParameteriv); - SET_CopyConvolutionFilter1D(disp, _mesa_CopyConvolutionFilter1D); - SET_CopyConvolutionFilter2D(disp, _mesa_CopyConvolutionFilter2D); - SET_GetConvolutionFilter(disp, _mesa_GetConvolutionFilter); - SET_GetConvolutionParameterfv(disp, _mesa_GetConvolutionParameterfv); - SET_GetConvolutionParameteriv(disp, _mesa_GetConvolutionParameteriv); - SET_SeparableFilter2D(disp, _mesa_SeparableFilter2D); - SET_GetSeparableFilter(disp, _mesa_GetSeparableFilter); -} - - -#endif /* FEATURE_convolve */ diff --git a/dll/opengl/mesa/main/convolve.h b/dll/opengl/mesa/main/convolve.h deleted file mode 100644 index 952285643b5..00000000000 --- a/dll/opengl/mesa/main/convolve.h +++ /dev/null @@ -1,51 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - -#ifndef CONVOLVE_H -#define CONVOLVE_H - - -#include "compiler.h" -#include "mfeatures.h" - -struct _glapi_table; - - -#if FEATURE_convolve - -extern void -_mesa_init_convolve_dispatch(struct _glapi_table *disp); - -#else /* FEATURE_convolve */ - -static inline void -_mesa_init_convolve_dispatch(struct _glapi_table *disp) -{ -} - -#endif /* FEATURE_convolve */ - -#endif /* CONVOLVE_H */ diff --git a/dll/opengl/mesa/main/dd.h b/dll/opengl/mesa/main/dd.h index 1af1c0ffad7..ba4403eb205 100644 --- a/dll/opengl/mesa/main/dd.h +++ b/dll/opengl/mesa/main/dd.h @@ -220,18 +220,6 @@ struct dd_function_table { GLint width, GLint height, GLint border, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing); - - /** - * Called by glTexImage3D(). - * - * \sa dd_function_table::TexImage1D. - */ - void (*TexImage3D)(struct gl_context *ctx, - struct gl_texture_image *texImage, - GLint internalFormat, - GLint width, GLint height, GLint depth, GLint border, - GLenum format, GLenum type, const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing); /** * Called by glTexSubImage1D(). Replace a subset of the target texture @@ -257,19 +245,6 @@ struct dd_function_table { GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing); - - /** - * Called by glTexSubImage3D(). - * - * \sa dd_function_table::TexSubImage1D. - */ - void (*TexSubImage3D)(struct gl_context *ctx, - struct gl_texture_image *texImage, - GLint xoffset, GLint yoffset, GLint zoffset, - GLsizei width, GLsizei height, GLint depth, - GLenum format, GLenum type, - const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing); /** @@ -298,16 +273,6 @@ struct dd_function_table { GLint x, GLint y, GLsizei width, GLsizei height); - /** - * Called by glCopyTexSubImage3D() and glCopyTexImage3D(). - */ - void (*CopyTexSubImage3D)(struct gl_context *ctx, - struct gl_texture_image *texImage, - GLint xoffset, GLint yoffset, GLint zoffset, - struct gl_renderbuffer *rb, - GLint x, GLint y, - GLsizei width, GLsizei height); - /** * Called by glTexImage[123]D when user specifies a proxy texture * target. @@ -348,18 +313,6 @@ struct dd_function_table { GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); - /** - * Called by glCompressedTexImage3D(). - * - * \sa dd_function_table::CompressedTexImage3D. - */ - void (*CompressedTexImage3D)(struct gl_context *ctx, - struct gl_texture_image *texImage, - GLint internalFormat, - GLsizei width, GLsizei height, GLsizei depth, - GLint border, - GLsizei imageSize, const GLvoid *data); - /** * Called by glCompressedTexSubImage1D(). */ @@ -378,16 +331,6 @@ struct dd_function_table { GLsizei width, GLint height, GLenum format, GLsizei imageSize, const GLvoid *data); - - /** - * Called by glCompressedTexSubImage3D(). - */ - void (*CompressedTexSubImage3D)(struct gl_context *ctx, - struct gl_texture_image *texImage, - GLint xoffset, GLint yoffset, GLint zoffset, - GLsizei width, GLint height, GLint depth, - GLenum format, - GLsizei imageSize, const GLvoid *data); /*@}*/ /** @@ -490,19 +433,6 @@ struct dd_function_table { /*@{*/ /** Specify the alpha test function */ void (*AlphaFunc)(struct gl_context *ctx, GLenum func, GLfloat ref); - /** Set the blend color */ - void (*BlendColor)(struct gl_context *ctx, const GLfloat color[4]); - /** Set the blend equation */ - void (*BlendEquationSeparate)(struct gl_context *ctx, GLenum modeRGB, GLenum modeA); - void (*BlendEquationSeparatei)(struct gl_context *ctx, GLuint buffer, - GLenum modeRGB, GLenum modeA); - /** Specify pixel arithmetic */ - void (*BlendFuncSeparate)(struct gl_context *ctx, - GLenum sfactorRGB, GLenum dfactorRGB, - GLenum sfactorA, GLenum dfactorA); - void (*BlendFuncSeparatei)(struct gl_context *ctx, GLuint buffer, - GLenum sfactorRGB, GLenum dfactorRGB, - GLenum sfactorA, GLenum dfactorA); /** Specify clear values for the color buffers */ void (*ClearColor)(struct gl_context *ctx, const union gl_color_union color); @@ -620,31 +550,6 @@ struct dd_function_table { struct gl_buffer_object *obj ); /*@}*/ - /** - * \name Functions for GL_APPLE_object_purgeable - */ - /*@{*/ - /* variations on ObjectPurgeable */ - GLenum (*BufferObjectPurgeable)( struct gl_context *ctx, struct gl_buffer_object *obj, GLenum option ); - GLenum (*RenderObjectPurgeable)( struct gl_context *ctx, struct gl_renderbuffer *obj, GLenum option ); - GLenum (*TextureObjectPurgeable)( struct gl_context *ctx, struct gl_texture_object *obj, GLenum option ); - - /* variations on ObjectUnpurgeable */ - GLenum (*BufferObjectUnpurgeable)( struct gl_context *ctx, struct gl_buffer_object *obj, GLenum option ); - GLenum (*RenderObjectUnpurgeable)( struct gl_context *ctx, struct gl_renderbuffer *obj, GLenum option ); - GLenum (*TextureObjectUnpurgeable)( struct gl_context *ctx, struct gl_texture_object *obj, GLenum option ); - /*@}*/ - - - /** - * \name Vertex Array objects - */ - /*@{*/ - struct gl_array_object * (*NewArrayObject)(struct gl_context *ctx, GLuint id); - void (*DeleteArrayObject)(struct gl_context *ctx, struct gl_array_object *obj); - void (*BindArrayObject)(struct gl_context *ctx, struct gl_array_object *obj); - /*@}*/ - /** * \name Support for multiple T&L engines @@ -748,11 +653,6 @@ struct dd_function_table { void (*EndCallList)( struct gl_context *ctx ); /**@}*/ - - /** - * \name GL_NV_texture_barrier interface - */ - void (*TextureBarrier)(struct gl_context *ctx); }; @@ -806,8 +706,6 @@ typedef struct { void (GLAPIENTRYP MultiTexCoord4fvARB)( GLenum, const GLfloat * ); void (GLAPIENTRYP Normal3f)( GLfloat, GLfloat, GLfloat ); void (GLAPIENTRYP Normal3fv)( const GLfloat * ); - void (GLAPIENTRYP SecondaryColor3fEXT)( GLfloat, GLfloat, GLfloat ); - void (GLAPIENTRYP SecondaryColor3fvEXT)( const GLfloat * ); void (GLAPIENTRYP TexCoord1f)( GLfloat ); void (GLAPIENTRYP TexCoord1fv)( const GLfloat * ); void (GLAPIENTRYP TexCoord2f)( GLfloat, GLfloat ); @@ -847,9 +745,6 @@ typedef struct { void (GLAPIENTRYP DrawArrays)( GLenum mode, GLint start, GLsizei count ); void (GLAPIENTRYP DrawElements)( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices ); - void (GLAPIENTRYP DrawRangeElements)( GLenum mode, GLuint start, - GLuint end, GLsizei count, - GLenum type, const GLvoid *indices ); /*@}*/ /** diff --git a/dll/opengl/mesa/main/dispatch.h b/dll/opengl/mesa/main/dispatch.h index f9ecac92781..049585ba5ae 100644 --- a/dll/opengl/mesa/main/dispatch.h +++ b/dll/opengl/mesa/main/dispatch.h @@ -403,48 +403,7 @@ typedef PROC _glapi_proc; #define _gloffset_TexSubImage2D 333 #define _gloffset_PopClientAttrib 334 #define _gloffset_PushClientAttrib 335 -#define _gloffset_BlendColor 336 -#define _gloffset_BlendEquation 337 -#define _gloffset_DrawRangeElements 338 -#define _gloffset_ColorTable 339 -#define _gloffset_ColorTableParameterfv 340 -#define _gloffset_ColorTableParameteriv 341 -#define _gloffset_CopyColorTable 342 -#define _gloffset_GetColorTable 343 -#define _gloffset_GetColorTableParameterfv 344 -#define _gloffset_GetColorTableParameteriv 345 -#define _gloffset_ColorSubTable 346 -#define _gloffset_CopyColorSubTable 347 -#define _gloffset_ConvolutionFilter1D 348 -#define _gloffset_ConvolutionFilter2D 349 -#define _gloffset_ConvolutionParameterf 350 -#define _gloffset_ConvolutionParameterfv 351 -#define _gloffset_ConvolutionParameteri 352 -#define _gloffset_ConvolutionParameteriv 353 -#define _gloffset_CopyConvolutionFilter1D 354 -#define _gloffset_CopyConvolutionFilter2D 355 -#define _gloffset_GetConvolutionFilter 356 -#define _gloffset_GetConvolutionParameterfv 357 -#define _gloffset_GetConvolutionParameteriv 358 -#define _gloffset_GetSeparableFilter 359 -#define _gloffset_SeparableFilter2D 360 -#define _gloffset_GetHistogram 361 -#define _gloffset_GetHistogramParameterfv 362 -#define _gloffset_GetHistogramParameteriv 363 -#define _gloffset_GetMinmax 364 -#define _gloffset_GetMinmaxParameterfv 365 -#define _gloffset_GetMinmaxParameteriv 366 -#define _gloffset_Histogram 367 -#define _gloffset_Minmax 368 -#define _gloffset_ResetHistogram 369 -#define _gloffset_ResetMinmax 370 -#define _gloffset_TexImage3D 371 -#define _gloffset_TexSubImage3D 372 -#define _gloffset_CopyTexSubImage3D 373 -#if !FEATURE_remap_table - -#define _gloffset_GetStringi 435 #define _gloffset_GetBufferParameteri64v 438 #define _gloffset_GetInteger64i_v 439 #define _gloffset_LoadTransposeMatrixdARB 441 @@ -464,9 +423,6 @@ typedef PROC _glapi_proc; #define _gloffset_MapBufferARB 519 #define _gloffset_UnmapBufferARB 520 #define _gloffset_AttachObjectARB 529 -#define _gloffset_CompileShaderARB 530 -#define _gloffset_CreateProgramObjectARB 531 -#define _gloffset_CreateShaderObjectARB 532 #define _gloffset_DeleteObjectARB 533 #define _gloffset_DetachObjectARB 534 #define _gloffset_GetAttachedObjectsARB 536 @@ -474,15 +430,9 @@ typedef PROC _glapi_proc; #define _gloffset_GetInfoLogARB 538 #define _gloffset_GetObjectParameterfvARB 539 #define _gloffset_GetObjectParameterivARB 540 -#define _gloffset_GetShaderSourceARB 541 -#define _gloffset_LinkProgramARB 545 -#define _gloffset_ShaderSourceARB 546 -#define _gloffset_ValidateProgramARB 567 #define _gloffset_GetActiveAttribARB 569 #define _gloffset_FlushMappedBufferRange 580 #define _gloffset_MapBufferRange 581 -#define _gloffset_BindVertexArray 583 -#define _gloffset_GenVertexArrays 584 #define _gloffset_TexStorage1D 685 #define _gloffset_TexStorage2D 686 #define _gloffset_TexStorage3D 687 @@ -502,30 +452,12 @@ typedef PROC _glapi_proc; #define _gloffset_PointParameterfvEXT 707 #define _gloffset_LockArraysEXT 708 #define _gloffset_UnlockArraysEXT 709 -#define _gloffset_SecondaryColor3bEXT 710 -#define _gloffset_SecondaryColor3bvEXT 711 -#define _gloffset_SecondaryColor3dEXT 712 -#define _gloffset_SecondaryColor3dvEXT 713 -#define _gloffset_SecondaryColor3fEXT 714 -#define _gloffset_SecondaryColor3fvEXT 715 -#define _gloffset_SecondaryColor3iEXT 716 -#define _gloffset_SecondaryColor3ivEXT 717 -#define _gloffset_SecondaryColor3sEXT 718 -#define _gloffset_SecondaryColor3svEXT 719 -#define _gloffset_SecondaryColor3ubEXT 720 -#define _gloffset_SecondaryColor3ubvEXT 721 -#define _gloffset_SecondaryColor3uiEXT 722 -#define _gloffset_SecondaryColor3uivEXT 723 -#define _gloffset_SecondaryColor3usEXT 724 -#define _gloffset_SecondaryColor3usvEXT 725 -#define _gloffset_SecondaryColorPointerEXT 726 #define _gloffset_FogCoordPointerEXT 729 #define _gloffset_FogCoorddEXT 730 #define _gloffset_FogCoorddvEXT 731 #define _gloffset_FogCoordfEXT 732 #define _gloffset_FogCoordfvEXT 733 #define _gloffset_PixelTexGenSGIX 734 -#define _gloffset_BlendFuncSeparateEXT 735 #define _gloffset_FlushVertexArrayRangeNV 736 #define _gloffset_VertexArrayRangeNV 737 #define _gloffset_CombinerInputNV 738 @@ -574,16 +506,6 @@ typedef PROC _glapi_proc; #define _gloffset_IsFenceNV 782 #define _gloffset_SetFenceNV 783 #define _gloffset_TestFenceNV 784 -#define _gloffset_AreProgramsResidentNV 785 -#define _gloffset_ExecuteProgramNV 788 -#define _gloffset_GetProgramParameterdvNV 790 -#define _gloffset_GetProgramParameterfvNV 791 -#define _gloffset_GetTrackMatrixivNV 794 -#define _gloffset_LoadProgramNV 800 -#define _gloffset_ProgramParameters4dvNV 801 -#define _gloffset_ProgramParameters4fvNV 802 -#define _gloffset_RequestResidentProgramsNV 803 -#define _gloffset_TrackMatrixNV 804 #define _gloffset_VertexAttrib1dNV 805 #define _gloffset_VertexAttrib1dvNV 806 #define _gloffset_VertexAttrib1fNV 807 @@ -610,34 +532,10 @@ typedef PROC _glapi_proc; #define _gloffset_VertexAttrib4svNV 828 #define _gloffset_VertexAttrib4ubNV 829 #define _gloffset_VertexAttrib4ubvNV 830 -#define _gloffset_VertexAttribs1dvNV 832 -#define _gloffset_VertexAttribs1fvNV 833 -#define _gloffset_VertexAttribs1svNV 834 -#define _gloffset_VertexAttribs2dvNV 835 -#define _gloffset_VertexAttribs2fvNV 836 -#define _gloffset_VertexAttribs2svNV 837 -#define _gloffset_VertexAttribs3dvNV 838 -#define _gloffset_VertexAttribs3fvNV 839 -#define _gloffset_VertexAttribs3svNV 840 -#define _gloffset_VertexAttribs4dvNV 841 -#define _gloffset_VertexAttribs4fvNV 842 -#define _gloffset_VertexAttribs4svNV 843 -#define _gloffset_VertexAttribs4ubvNV 844 #define _gloffset_PointParameteriNV 863 #define _gloffset_PointParameterivNV 864 #define _gloffset_ActiveStencilFaceEXT 865 -#define _gloffset_BindVertexArrayAPPLE 866 -#define _gloffset_DeleteVertexArraysAPPLE 867 -#define _gloffset_GenVertexArraysAPPLE 868 -#define _gloffset_IsVertexArrayAPPLE 869 -#define _gloffset_GetProgramNamedParameterdvNV 870 -#define _gloffset_GetProgramNamedParameterfvNV 871 -#define _gloffset_ProgramNamedParameter4dNV 872 -#define _gloffset_ProgramNamedParameter4dvNV 873 -#define _gloffset_ProgramNamedParameter4fNV 874 -#define _gloffset_ProgramNamedParameter4fvNV 875 #define _gloffset_DepthBoundsEXT 878 -#define _gloffset_BlendEquationSeparateEXT 879 #define _gloffset_BufferParameteriAPPLE 898 #define _gloffset_FlushMappedBufferRangeAPPLE 899 #define _gloffset_BindFragDataLocationEXT 900 @@ -650,447 +548,6 @@ typedef PROC _glapi_proc; #define _gloffset_TexParameterIuivEXT 946 #define _gloffset_GetTexParameterPointervAPPLE 957 #define _gloffset_TextureRangeAPPLE 958 -#define _gloffset_GetObjectParameterivAPPLE 959 -#define _gloffset_ObjectPurgeableAPPLE 960 -#define _gloffset_ObjectUnpurgeableAPPLE 961 -#define _gloffset_CreateShaderProgramEXT 963 -#define _gloffset_TextureBarrierNV 965 - -#else /* !FEATURE_remap_table */ - -#define driDispatchRemapTable_size 565 -extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; - -#define GetStringi_remap_index 27 -#define TexBuffer_remap_index 28 -#define GetBufferParameteri64v_remap_index 30 -#define GetInteger64i_v_remap_index 31 -#define VertexAttribDivisor_remap_index 32 -#define LoadTransposeMatrixdARB_remap_index 33 -#define LoadTransposeMatrixfARB_remap_index 34 -#define MultTransposeMatrixdARB_remap_index 35 -#define MultTransposeMatrixfARB_remap_index 36 -#define SampleCoverageARB_remap_index 37 -#define BindBufferARB_remap_index 102 -#define BufferDataARB_remap_index 103 -#define BufferSubDataARB_remap_index 104 -#define DeleteBuffersARB_remap_index 105 -#define GenBuffersARB_remap_index 106 -#define GetBufferParameterivARB_remap_index 107 -#define GetBufferPointervARB_remap_index 108 -#define GetBufferSubDataARB_remap_index 109 -#define IsBufferARB_remap_index 110 -#define MapBufferARB_remap_index 111 -#define UnmapBufferARB_remap_index 112 -#define AttachObjectARB_remap_index 121 -#define CompileShaderARB_remap_index 122 -#define CreateProgramObjectARB_remap_index 123 -#define CreateShaderObjectARB_remap_index 124 -#define DeleteObjectARB_remap_index 125 -#define DetachObjectARB_remap_index 126 -#define GetAttachedObjectsARB_remap_index 128 -#define GetHandleARB_remap_index 129 -#define GetInfoLogARB_remap_index 130 -#define GetObjectParameterfvARB_remap_index 131 -#define GetObjectParameterivARB_remap_index 132 -#define GetShaderSourceARB_remap_index 133 -#define LinkProgramARB_remap_index 137 -#define ShaderSourceARB_remap_index 138 -#define ValidateProgramARB_remap_index 159 -#define GetActiveAttribARB_remap_index 161 -#define VertexAttribDivisorARB_remap_index 171 -#define FlushMappedBufferRange_remap_index 172 -#define MapBufferRange_remap_index 173 -#define BindVertexArray_remap_index 175 -#define GenVertexArrays_remap_index 176 -#define TexStorage1D_remap_index 277 -#define TexStorage2D_remap_index 278 -#define TexStorage3D_remap_index 279 -#define TextureStorage1DEXT_remap_index 280 -#define TextureStorage2DEXT_remap_index 281 -#define TextureStorage3DEXT_remap_index 282 -#define PolygonOffsetEXT_remap_index 283 -#define SampleMaskSGIS_remap_index 290 -#define SamplePatternSGIS_remap_index 291 -#define ColorPointerEXT_remap_index 292 -#define EdgeFlagPointerEXT_remap_index 293 -#define IndexPointerEXT_remap_index 294 -#define NormalPointerEXT_remap_index 295 -#define TexCoordPointerEXT_remap_index 296 -#define VertexPointerEXT_remap_index 297 -#define PointParameterfEXT_remap_index 298 -#define PointParameterfvEXT_remap_index 299 -#define LockArraysEXT_remap_index 300 -#define UnlockArraysEXT_remap_index 301 -#define SecondaryColor3bEXT_remap_index 302 -#define SecondaryColor3bvEXT_remap_index 303 -#define SecondaryColor3dEXT_remap_index 304 -#define SecondaryColor3dvEXT_remap_index 305 -#define SecondaryColor3fEXT_remap_index 306 -#define SecondaryColor3fvEXT_remap_index 307 -#define SecondaryColor3iEXT_remap_index 308 -#define SecondaryColor3ivEXT_remap_index 309 -#define SecondaryColor3sEXT_remap_index 310 -#define SecondaryColor3svEXT_remap_index 311 -#define SecondaryColor3ubEXT_remap_index 312 -#define SecondaryColor3ubvEXT_remap_index 313 -#define SecondaryColor3uiEXT_remap_index 314 -#define SecondaryColor3uivEXT_remap_index 315 -#define SecondaryColor3usEXT_remap_index 316 -#define SecondaryColor3usvEXT_remap_index 317 -#define SecondaryColorPointerEXT_remap_index 318 -#define MultiDrawArraysEXT_remap_index 319 -#define FogCoordPointerEXT_remap_index 321 -#define FogCoorddEXT_remap_index 322 -#define FogCoorddvEXT_remap_index 323 -#define FogCoordfEXT_remap_index 324 -#define FogCoordfvEXT_remap_index 325 -#define PixelTexGenSGIX_remap_index 326 -#define BlendFuncSeparateEXT_remap_index 327 -#define FlushVertexArrayRangeNV_remap_index 328 -#define VertexArrayRangeNV_remap_index 329 -#define CombinerInputNV_remap_index 330 -#define CombinerOutputNV_remap_index 331 -#define CombinerParameterfNV_remap_index 332 -#define CombinerParameterfvNV_remap_index 333 -#define CombinerParameteriNV_remap_index 334 -#define CombinerParameterivNV_remap_index 335 -#define FinalCombinerInputNV_remap_index 336 -#define GetCombinerInputParameterfvNV_remap_index 337 -#define GetCombinerInputParameterivNV_remap_index 338 -#define GetCombinerOutputParameterfvNV_remap_index 339 -#define GetCombinerOutputParameterivNV_remap_index 340 -#define GetFinalCombinerInputParameterfvNV_remap_index 341 -#define GetFinalCombinerInputParameterivNV_remap_index 342 -#define WindowPos2dMESA_remap_index 344 -#define WindowPos2dvMESA_remap_index 345 -#define WindowPos2fMESA_remap_index 346 -#define WindowPos2fvMESA_remap_index 347 -#define WindowPos2iMESA_remap_index 348 -#define WindowPos2ivMESA_remap_index 349 -#define WindowPos2sMESA_remap_index 350 -#define WindowPos2svMESA_remap_index 351 -#define WindowPos3dMESA_remap_index 352 -#define WindowPos3dvMESA_remap_index 353 -#define WindowPos3fMESA_remap_index 354 -#define WindowPos3fvMESA_remap_index 355 -#define WindowPos3iMESA_remap_index 356 -#define WindowPos3ivMESA_remap_index 357 -#define WindowPos3sMESA_remap_index 358 -#define WindowPos3svMESA_remap_index 359 -#define WindowPos4dMESA_remap_index 360 -#define WindowPos4dvMESA_remap_index 361 -#define WindowPos4fMESA_remap_index 362 -#define WindowPos4fvMESA_remap_index 363 -#define WindowPos4iMESA_remap_index 364 -#define WindowPos4ivMESA_remap_index 365 -#define WindowPos4sMESA_remap_index 366 -#define WindowPos4svMESA_remap_index 367 -#define MultiModeDrawArraysIBM_remap_index 368 -#define MultiModeDrawElementsIBM_remap_index 369 -#define DeleteFencesNV_remap_index 370 -#define FinishFenceNV_remap_index 371 -#define GenFencesNV_remap_index 372 -#define GetFenceivNV_remap_index 373 -#define IsFenceNV_remap_index 374 -#define SetFenceNV_remap_index 375 -#define TestFenceNV_remap_index 376 -#define AreProgramsResidentNV_remap_index 377 -#define ExecuteProgramNV_remap_index 380 -#define GetProgramParameterdvNV_remap_index 382 -#define GetProgramParameterfvNV_remap_index 383 -#define GetTrackMatrixivNV_remap_index 386 -#define LoadProgramNV_remap_index 392 -#define ProgramParameters4dvNV_remap_index 393 -#define ProgramParameters4fvNV_remap_index 394 -#define RequestResidentProgramsNV_remap_index 395 -#define TrackMatrixNV_remap_index 396 -#define VertexAttrib1dNV_remap_index 397 -#define VertexAttrib1dvNV_remap_index 398 -#define VertexAttrib1fNV_remap_index 399 -#define VertexAttrib1fvNV_remap_index 400 -#define VertexAttrib1sNV_remap_index 401 -#define VertexAttrib1svNV_remap_index 402 -#define VertexAttrib2dNV_remap_index 403 -#define VertexAttrib2dvNV_remap_index 404 -#define VertexAttrib2fNV_remap_index 405 -#define VertexAttrib2fvNV_remap_index 406 -#define VertexAttrib2sNV_remap_index 407 -#define VertexAttrib2svNV_remap_index 408 -#define VertexAttrib3dNV_remap_index 409 -#define VertexAttrib3dvNV_remap_index 410 -#define VertexAttrib3fNV_remap_index 411 -#define VertexAttrib3fvNV_remap_index 412 -#define VertexAttrib3sNV_remap_index 413 -#define VertexAttrib3svNV_remap_index 414 -#define VertexAttrib4dNV_remap_index 415 -#define VertexAttrib4dvNV_remap_index 416 -#define VertexAttrib4fNV_remap_index 417 -#define VertexAttrib4fvNV_remap_index 418 -#define VertexAttrib4sNV_remap_index 419 -#define VertexAttrib4svNV_remap_index 420 -#define VertexAttrib4ubNV_remap_index 421 -#define VertexAttrib4ubvNV_remap_index 422 -#define VertexAttribs1dvNV_remap_index 424 -#define VertexAttribs1fvNV_remap_index 425 -#define VertexAttribs1svNV_remap_index 426 -#define VertexAttribs2dvNV_remap_index 427 -#define VertexAttribs2fvNV_remap_index 428 -#define VertexAttribs2svNV_remap_index 429 -#define VertexAttribs3dvNV_remap_index 430 -#define VertexAttribs3fvNV_remap_index 431 -#define VertexAttribs3svNV_remap_index 432 -#define VertexAttribs4dvNV_remap_index 433 -#define VertexAttribs4fvNV_remap_index 434 -#define VertexAttribs4svNV_remap_index 435 -#define VertexAttribs4ubvNV_remap_index 436 -#define PointParameteriNV_remap_index 455 -#define PointParameterivNV_remap_index 456 -#define ActiveStencilFaceEXT_remap_index 457 -#define BindVertexArrayAPPLE_remap_index 458 -#define DeleteVertexArraysAPPLE_remap_index 459 -#define GenVertexArraysAPPLE_remap_index 460 -#define IsVertexArrayAPPLE_remap_index 461 -#define GetProgramNamedParameterdvNV_remap_index 462 -#define GetProgramNamedParameterfvNV_remap_index 463 -#define ProgramNamedParameter4dNV_remap_index 464 -#define ProgramNamedParameter4dvNV_remap_index 465 -#define ProgramNamedParameter4fNV_remap_index 466 -#define ProgramNamedParameter4fvNV_remap_index 467 -#define DepthBoundsEXT_remap_index 470 -#define BlendEquationSeparateEXT_remap_index 471 -#define BufferParameteriAPPLE_remap_index 490 -#define FlushMappedBufferRangeAPPLE_remap_index 491 -#define BindFragDataLocationEXT_remap_index 492 -#define GetFragDataLocationEXT_remap_index 493 -#define ClearColorIiEXT_remap_index 533 -#define ClearColorIuiEXT_remap_index 534 -#define GetTexParameterIivEXT_remap_index 535 -#define GetTexParameterIuivEXT_remap_index 536 -#define TexParameterIivEXT_remap_index 537 -#define TexParameterIuivEXT_remap_index 538 -#define GetTexParameterPointervAPPLE_remap_index 549 -#define TextureRangeAPPLE_remap_index 550 -#define GetObjectParameterivAPPLE_remap_index 551 -#define ObjectPurgeableAPPLE_remap_index 552 -#define ObjectUnpurgeableAPPLE_remap_index 553 -#define CreateShaderProgramEXT_remap_index 555 -#define TextureBarrierNV_remap_index 557 - -#define _gloffset_GetStringi driDispatchRemapTable[GetStringi_remap_index] -#define _gloffset_GetBufferParameteri64v driDispatchRemapTable[GetBufferParameteri64v_remap_index] -#define _gloffset_GetInteger64i_v driDispatchRemapTable[GetInteger64i_v_remap_index] -#define _gloffset_LoadTransposeMatrixdARB driDispatchRemapTable[LoadTransposeMatrixdARB_remap_index] -#define _gloffset_LoadTransposeMatrixfARB driDispatchRemapTable[LoadTransposeMatrixfARB_remap_index] -#define _gloffset_MultTransposeMatrixdARB driDispatchRemapTable[MultTransposeMatrixdARB_remap_index] -#define _gloffset_MultTransposeMatrixfARB driDispatchRemapTable[MultTransposeMatrixfARB_remap_index] -#define _gloffset_SampleCoverageARB driDispatchRemapTable[SampleCoverageARB_remap_index] -#define _gloffset_BindBufferARB driDispatchRemapTable[BindBufferARB_remap_index] -#define _gloffset_BufferDataARB driDispatchRemapTable[BufferDataARB_remap_index] -#define _gloffset_BufferSubDataARB driDispatchRemapTable[BufferSubDataARB_remap_index] -#define _gloffset_DeleteBuffersARB driDispatchRemapTable[DeleteBuffersARB_remap_index] -#define _gloffset_GenBuffersARB driDispatchRemapTable[GenBuffersARB_remap_index] -#define _gloffset_GetBufferParameterivARB driDispatchRemapTable[GetBufferParameterivARB_remap_index] -#define _gloffset_GetBufferPointervARB driDispatchRemapTable[GetBufferPointervARB_remap_index] -#define _gloffset_GetBufferSubDataARB driDispatchRemapTable[GetBufferSubDataARB_remap_index] -#define _gloffset_IsBufferARB driDispatchRemapTable[IsBufferARB_remap_index] -#define _gloffset_MapBufferARB driDispatchRemapTable[MapBufferARB_remap_index] -#define _gloffset_UnmapBufferARB driDispatchRemapTable[UnmapBufferARB_remap_index] -#define _gloffset_AttachObjectARB driDispatchRemapTable[AttachObjectARB_remap_index] -#define _gloffset_CompileShaderARB driDispatchRemapTable[CompileShaderARB_remap_index] -#define _gloffset_CreateProgramObjectARB driDispatchRemapTable[CreateProgramObjectARB_remap_index] -#define _gloffset_CreateShaderObjectARB driDispatchRemapTable[CreateShaderObjectARB_remap_index] -#define _gloffset_DeleteObjectARB driDispatchRemapTable[DeleteObjectARB_remap_index] -#define _gloffset_DetachObjectARB driDispatchRemapTable[DetachObjectARB_remap_index] -#define _gloffset_GetAttachedObjectsARB driDispatchRemapTable[GetAttachedObjectsARB_remap_index] -#define _gloffset_GetHandleARB driDispatchRemapTable[GetHandleARB_remap_index] -#define _gloffset_GetInfoLogARB driDispatchRemapTable[GetInfoLogARB_remap_index] -#define _gloffset_GetObjectParameterfvARB driDispatchRemapTable[GetObjectParameterfvARB_remap_index] -#define _gloffset_GetObjectParameterivARB driDispatchRemapTable[GetObjectParameterivARB_remap_index] -#define _gloffset_GetShaderSourceARB driDispatchRemapTable[GetShaderSourceARB_remap_index] -#define _gloffset_LinkProgramARB driDispatchRemapTable[LinkProgramARB_remap_index] -#define _gloffset_ShaderSourceARB driDispatchRemapTable[ShaderSourceARB_remap_index] -#define _gloffset_ValidateProgramARB driDispatchRemapTable[ValidateProgramARB_remap_index] -#define _gloffset_GetActiveAttribARB driDispatchRemapTable[GetActiveAttribARB_remap_index] -#define _gloffset_GetAttribLocationARB driDispatchRemapTable[GetAttribLocationARB_remap_index] -#define _gloffset_FlushMappedBufferRange driDispatchRemapTable[FlushMappedBufferRange_remap_index] -#define _gloffset_MapBufferRange driDispatchRemapTable[MapBufferRange_remap_index] -#define _gloffset_BindVertexArray driDispatchRemapTable[BindVertexArray_remap_index] -#define _gloffset_GenVertexArrays driDispatchRemapTable[GenVertexArrays_remap_index] -#define _gloffset_TexStorage1D driDispatchRemapTable[TexStorage1D_remap_index] -#define _gloffset_TexStorage2D driDispatchRemapTable[TexStorage2D_remap_index] -#define _gloffset_TexStorage3D driDispatchRemapTable[TexStorage3D_remap_index] -#define _gloffset_TextureStorage1DEXT driDispatchRemapTable[TextureStorage1DEXT_remap_index] -#define _gloffset_TextureStorage2DEXT driDispatchRemapTable[TextureStorage2DEXT_remap_index] -#define _gloffset_TextureStorage3DEXT driDispatchRemapTable[TextureStorage3DEXT_remap_index] -#define _gloffset_PolygonOffsetEXT driDispatchRemapTable[PolygonOffsetEXT_remap_index] -#define _gloffset_SampleMaskSGIS driDispatchRemapTable[SampleMaskSGIS_remap_index] -#define _gloffset_SamplePatternSGIS driDispatchRemapTable[SamplePatternSGIS_remap_index] -#define _gloffset_ColorPointerEXT driDispatchRemapTable[ColorPointerEXT_remap_index] -#define _gloffset_EdgeFlagPointerEXT driDispatchRemapTable[EdgeFlagPointerEXT_remap_index] -#define _gloffset_IndexPointerEXT driDispatchRemapTable[IndexPointerEXT_remap_index] -#define _gloffset_NormalPointerEXT driDispatchRemapTable[NormalPointerEXT_remap_index] -#define _gloffset_TexCoordPointerEXT driDispatchRemapTable[TexCoordPointerEXT_remap_index] -#define _gloffset_VertexPointerEXT driDispatchRemapTable[VertexPointerEXT_remap_index] -#define _gloffset_PointParameterfEXT driDispatchRemapTable[PointParameterfEXT_remap_index] -#define _gloffset_PointParameterfvEXT driDispatchRemapTable[PointParameterfvEXT_remap_index] -#define _gloffset_LockArraysEXT driDispatchRemapTable[LockArraysEXT_remap_index] -#define _gloffset_UnlockArraysEXT driDispatchRemapTable[UnlockArraysEXT_remap_index] -#define _gloffset_SecondaryColor3bEXT driDispatchRemapTable[SecondaryColor3bEXT_remap_index] -#define _gloffset_SecondaryColor3bvEXT driDispatchRemapTable[SecondaryColor3bvEXT_remap_index] -#define _gloffset_SecondaryColor3dEXT driDispatchRemapTable[SecondaryColor3dEXT_remap_index] -#define _gloffset_SecondaryColor3dvEXT driDispatchRemapTable[SecondaryColor3dvEXT_remap_index] -#define _gloffset_SecondaryColor3fEXT driDispatchRemapTable[SecondaryColor3fEXT_remap_index] -#define _gloffset_SecondaryColor3fvEXT driDispatchRemapTable[SecondaryColor3fvEXT_remap_index] -#define _gloffset_SecondaryColor3iEXT driDispatchRemapTable[SecondaryColor3iEXT_remap_index] -#define _gloffset_SecondaryColor3ivEXT driDispatchRemapTable[SecondaryColor3ivEXT_remap_index] -#define _gloffset_SecondaryColor3sEXT driDispatchRemapTable[SecondaryColor3sEXT_remap_index] -#define _gloffset_SecondaryColor3svEXT driDispatchRemapTable[SecondaryColor3svEXT_remap_index] -#define _gloffset_SecondaryColor3ubEXT driDispatchRemapTable[SecondaryColor3ubEXT_remap_index] -#define _gloffset_SecondaryColor3ubvEXT driDispatchRemapTable[SecondaryColor3ubvEXT_remap_index] -#define _gloffset_SecondaryColor3uiEXT driDispatchRemapTable[SecondaryColor3uiEXT_remap_index] -#define _gloffset_SecondaryColor3uivEXT driDispatchRemapTable[SecondaryColor3uivEXT_remap_index] -#define _gloffset_SecondaryColor3usEXT driDispatchRemapTable[SecondaryColor3usEXT_remap_index] -#define _gloffset_SecondaryColor3usvEXT driDispatchRemapTable[SecondaryColor3usvEXT_remap_index] -#define _gloffset_SecondaryColorPointerEXT driDispatchRemapTable[SecondaryColorPointerEXT_remap_index] -#define _gloffset_FogCoordPointerEXT driDispatchRemapTable[FogCoordPointerEXT_remap_index] -#define _gloffset_FogCoorddEXT driDispatchRemapTable[FogCoorddEXT_remap_index] -#define _gloffset_FogCoorddvEXT driDispatchRemapTable[FogCoorddvEXT_remap_index] -#define _gloffset_FogCoordfEXT driDispatchRemapTable[FogCoordfEXT_remap_index] -#define _gloffset_FogCoordfvEXT driDispatchRemapTable[FogCoordfvEXT_remap_index] -#define _gloffset_PixelTexGenSGIX driDispatchRemapTable[PixelTexGenSGIX_remap_index] -#define _gloffset_BlendFuncSeparateEXT driDispatchRemapTable[BlendFuncSeparateEXT_remap_index] -#define _gloffset_FlushVertexArrayRangeNV driDispatchRemapTable[FlushVertexArrayRangeNV_remap_index] -#define _gloffset_VertexArrayRangeNV driDispatchRemapTable[VertexArrayRangeNV_remap_index] -#define _gloffset_CombinerInputNV driDispatchRemapTable[CombinerInputNV_remap_index] -#define _gloffset_CombinerOutputNV driDispatchRemapTable[CombinerOutputNV_remap_index] -#define _gloffset_CombinerParameterfNV driDispatchRemapTable[CombinerParameterfNV_remap_index] -#define _gloffset_CombinerParameterfvNV driDispatchRemapTable[CombinerParameterfvNV_remap_index] -#define _gloffset_CombinerParameteriNV driDispatchRemapTable[CombinerParameteriNV_remap_index] -#define _gloffset_CombinerParameterivNV driDispatchRemapTable[CombinerParameterivNV_remap_index] -#define _gloffset_FinalCombinerInputNV driDispatchRemapTable[FinalCombinerInputNV_remap_index] -#define _gloffset_GetCombinerInputParameterfvNV driDispatchRemapTable[GetCombinerInputParameterfvNV_remap_index] -#define _gloffset_GetCombinerInputParameterivNV driDispatchRemapTable[GetCombinerInputParameterivNV_remap_index] -#define _gloffset_GetCombinerOutputParameterfvNV driDispatchRemapTable[GetCombinerOutputParameterfvNV_remap_index] -#define _gloffset_GetCombinerOutputParameterivNV driDispatchRemapTable[GetCombinerOutputParameterivNV_remap_index] -#define _gloffset_GetFinalCombinerInputParameterfvNV driDispatchRemapTable[GetFinalCombinerInputParameterfvNV_remap_index] -#define _gloffset_GetFinalCombinerInputParameterivNV driDispatchRemapTable[GetFinalCombinerInputParameterivNV_remap_index] -#define _gloffset_WindowPos2dMESA driDispatchRemapTable[WindowPos2dMESA_remap_index] -#define _gloffset_WindowPos2dvMESA driDispatchRemapTable[WindowPos2dvMESA_remap_index] -#define _gloffset_WindowPos2fMESA driDispatchRemapTable[WindowPos2fMESA_remap_index] -#define _gloffset_WindowPos2fvMESA driDispatchRemapTable[WindowPos2fvMESA_remap_index] -#define _gloffset_WindowPos2iMESA driDispatchRemapTable[WindowPos2iMESA_remap_index] -#define _gloffset_WindowPos2ivMESA driDispatchRemapTable[WindowPos2ivMESA_remap_index] -#define _gloffset_WindowPos2sMESA driDispatchRemapTable[WindowPos2sMESA_remap_index] -#define _gloffset_WindowPos2svMESA driDispatchRemapTable[WindowPos2svMESA_remap_index] -#define _gloffset_WindowPos3dMESA driDispatchRemapTable[WindowPos3dMESA_remap_index] -#define _gloffset_WindowPos3dvMESA driDispatchRemapTable[WindowPos3dvMESA_remap_index] -#define _gloffset_WindowPos3fMESA driDispatchRemapTable[WindowPos3fMESA_remap_index] -#define _gloffset_WindowPos3fvMESA driDispatchRemapTable[WindowPos3fvMESA_remap_index] -#define _gloffset_WindowPos3iMESA driDispatchRemapTable[WindowPos3iMESA_remap_index] -#define _gloffset_WindowPos3ivMESA driDispatchRemapTable[WindowPos3ivMESA_remap_index] -#define _gloffset_WindowPos3sMESA driDispatchRemapTable[WindowPos3sMESA_remap_index] -#define _gloffset_WindowPos3svMESA driDispatchRemapTable[WindowPos3svMESA_remap_index] -#define _gloffset_WindowPos4dMESA driDispatchRemapTable[WindowPos4dMESA_remap_index] -#define _gloffset_WindowPos4dvMESA driDispatchRemapTable[WindowPos4dvMESA_remap_index] -#define _gloffset_WindowPos4fMESA driDispatchRemapTable[WindowPos4fMESA_remap_index] -#define _gloffset_WindowPos4fvMESA driDispatchRemapTable[WindowPos4fvMESA_remap_index] -#define _gloffset_WindowPos4iMESA driDispatchRemapTable[WindowPos4iMESA_remap_index] -#define _gloffset_WindowPos4ivMESA driDispatchRemapTable[WindowPos4ivMESA_remap_index] -#define _gloffset_WindowPos4sMESA driDispatchRemapTable[WindowPos4sMESA_remap_index] -#define _gloffset_WindowPos4svMESA driDispatchRemapTable[WindowPos4svMESA_remap_index] -#define _gloffset_MultiModeDrawArraysIBM driDispatchRemapTable[MultiModeDrawArraysIBM_remap_index] -#define _gloffset_MultiModeDrawElementsIBM driDispatchRemapTable[MultiModeDrawElementsIBM_remap_index] -#define _gloffset_DeleteFencesNV driDispatchRemapTable[DeleteFencesNV_remap_index] -#define _gloffset_FinishFenceNV driDispatchRemapTable[FinishFenceNV_remap_index] -#define _gloffset_GenFencesNV driDispatchRemapTable[GenFencesNV_remap_index] -#define _gloffset_GetFenceivNV driDispatchRemapTable[GetFenceivNV_remap_index] -#define _gloffset_IsFenceNV driDispatchRemapTable[IsFenceNV_remap_index] -#define _gloffset_SetFenceNV driDispatchRemapTable[SetFenceNV_remap_index] -#define _gloffset_TestFenceNV driDispatchRemapTable[TestFenceNV_remap_index] -#define _gloffset_AreProgramsResidentNV driDispatchRemapTable[AreProgramsResidentNV_remap_index] -#define _gloffset_ExecuteProgramNV driDispatchRemapTable[ExecuteProgramNV_remap_index] -#define _gloffset_GetProgramParameterdvNV driDispatchRemapTable[GetProgramParameterdvNV_remap_index] -#define _gloffset_GetProgramParameterfvNV driDispatchRemapTable[GetProgramParameterfvNV_remap_index] -#define _gloffset_GetTrackMatrixivNV driDispatchRemapTable[GetTrackMatrixivNV_remap_index] -#define _gloffset_LoadProgramNV driDispatchRemapTable[LoadProgramNV_remap_index] -#define _gloffset_ProgramParameters4dvNV driDispatchRemapTable[ProgramParameters4dvNV_remap_index] -#define _gloffset_ProgramParameters4fvNV driDispatchRemapTable[ProgramParameters4fvNV_remap_index] -#define _gloffset_RequestResidentProgramsNV driDispatchRemapTable[RequestResidentProgramsNV_remap_index] -#define _gloffset_TrackMatrixNV driDispatchRemapTable[TrackMatrixNV_remap_index] -#define _gloffset_VertexAttrib1dNV driDispatchRemapTable[VertexAttrib1dNV_remap_index] -#define _gloffset_VertexAttrib1dvNV driDispatchRemapTable[VertexAttrib1dvNV_remap_index] -#define _gloffset_VertexAttrib1fNV driDispatchRemapTable[VertexAttrib1fNV_remap_index] -#define _gloffset_VertexAttrib1fvNV driDispatchRemapTable[VertexAttrib1fvNV_remap_index] -#define _gloffset_VertexAttrib1sNV driDispatchRemapTable[VertexAttrib1sNV_remap_index] -#define _gloffset_VertexAttrib1svNV driDispatchRemapTable[VertexAttrib1svNV_remap_index] -#define _gloffset_VertexAttrib2dNV driDispatchRemapTable[VertexAttrib2dNV_remap_index] -#define _gloffset_VertexAttrib2dvNV driDispatchRemapTable[VertexAttrib2dvNV_remap_index] -#define _gloffset_VertexAttrib2fNV driDispatchRemapTable[VertexAttrib2fNV_remap_index] -#define _gloffset_VertexAttrib2fvNV driDispatchRemapTable[VertexAttrib2fvNV_remap_index] -#define _gloffset_VertexAttrib2sNV driDispatchRemapTable[VertexAttrib2sNV_remap_index] -#define _gloffset_VertexAttrib2svNV driDispatchRemapTable[VertexAttrib2svNV_remap_index] -#define _gloffset_VertexAttrib3dNV driDispatchRemapTable[VertexAttrib3dNV_remap_index] -#define _gloffset_VertexAttrib3dvNV driDispatchRemapTable[VertexAttrib3dvNV_remap_index] -#define _gloffset_VertexAttrib3fNV driDispatchRemapTable[VertexAttrib3fNV_remap_index] -#define _gloffset_VertexAttrib3fvNV driDispatchRemapTable[VertexAttrib3fvNV_remap_index] -#define _gloffset_VertexAttrib3sNV driDispatchRemapTable[VertexAttrib3sNV_remap_index] -#define _gloffset_VertexAttrib3svNV driDispatchRemapTable[VertexAttrib3svNV_remap_index] -#define _gloffset_VertexAttrib4dNV driDispatchRemapTable[VertexAttrib4dNV_remap_index] -#define _gloffset_VertexAttrib4dvNV driDispatchRemapTable[VertexAttrib4dvNV_remap_index] -#define _gloffset_VertexAttrib4fNV driDispatchRemapTable[VertexAttrib4fNV_remap_index] -#define _gloffset_VertexAttrib4fvNV driDispatchRemapTable[VertexAttrib4fvNV_remap_index] -#define _gloffset_VertexAttrib4sNV driDispatchRemapTable[VertexAttrib4sNV_remap_index] -#define _gloffset_VertexAttrib4svNV driDispatchRemapTable[VertexAttrib4svNV_remap_index] -#define _gloffset_VertexAttrib4ubNV driDispatchRemapTable[VertexAttrib4ubNV_remap_index] -#define _gloffset_VertexAttrib4ubvNV driDispatchRemapTable[VertexAttrib4ubvNV_remap_index] -#define _gloffset_VertexAttribs1dvNV driDispatchRemapTable[VertexAttribs1dvNV_remap_index] -#define _gloffset_VertexAttribs1fvNV driDispatchRemapTable[VertexAttribs1fvNV_remap_index] -#define _gloffset_VertexAttribs1svNV driDispatchRemapTable[VertexAttribs1svNV_remap_index] -#define _gloffset_VertexAttribs2dvNV driDispatchRemapTable[VertexAttribs2dvNV_remap_index] -#define _gloffset_VertexAttribs2fvNV driDispatchRemapTable[VertexAttribs2fvNV_remap_index] -#define _gloffset_VertexAttribs2svNV driDispatchRemapTable[VertexAttribs2svNV_remap_index] -#define _gloffset_VertexAttribs3dvNV driDispatchRemapTable[VertexAttribs3dvNV_remap_index] -#define _gloffset_VertexAttribs3fvNV driDispatchRemapTable[VertexAttribs3fvNV_remap_index] -#define _gloffset_VertexAttribs3svNV driDispatchRemapTable[VertexAttribs3svNV_remap_index] -#define _gloffset_VertexAttribs4dvNV driDispatchRemapTable[VertexAttribs4dvNV_remap_index] -#define _gloffset_VertexAttribs4fvNV driDispatchRemapTable[VertexAttribs4fvNV_remap_index] -#define _gloffset_VertexAttribs4svNV driDispatchRemapTable[VertexAttribs4svNV_remap_index] -#define _gloffset_VertexAttribs4ubvNV driDispatchRemapTable[VertexAttribs4ubvNV_remap_index] -#define _gloffset_PointParameteriNV driDispatchRemapTable[PointParameteriNV_remap_index] -#define _gloffset_PointParameterivNV driDispatchRemapTable[PointParameterivNV_remap_index] -#define _gloffset_ActiveStencilFaceEXT driDispatchRemapTable[ActiveStencilFaceEXT_remap_index] -#define _gloffset_BindVertexArrayAPPLE driDispatchRemapTable[BindVertexArrayAPPLE_remap_index] -#define _gloffset_DeleteVertexArraysAPPLE driDispatchRemapTable[DeleteVertexArraysAPPLE_remap_index] -#define _gloffset_GenVertexArraysAPPLE driDispatchRemapTable[GenVertexArraysAPPLE_remap_index] -#define _gloffset_IsVertexArrayAPPLE driDispatchRemapTable[IsVertexArrayAPPLE_remap_index] -#define _gloffset_GetProgramNamedParameterdvNV driDispatchRemapTable[GetProgramNamedParameterdvNV_remap_index] -#define _gloffset_GetProgramNamedParameterfvNV driDispatchRemapTable[GetProgramNamedParameterfvNV_remap_index] -#define _gloffset_ProgramNamedParameter4dNV driDispatchRemapTable[ProgramNamedParameter4dNV_remap_index] -#define _gloffset_ProgramNamedParameter4dvNV driDispatchRemapTable[ProgramNamedParameter4dvNV_remap_index] -#define _gloffset_ProgramNamedParameter4fNV driDispatchRemapTable[ProgramNamedParameter4fNV_remap_index] -#define _gloffset_ProgramNamedParameter4fvNV driDispatchRemapTable[ProgramNamedParameter4fvNV_remap_index] -#define _gloffset_DepthBoundsEXT driDispatchRemapTable[DepthBoundsEXT_remap_index] -#define _gloffset_BlendEquationSeparateEXT driDispatchRemapTable[BlendEquationSeparateEXT_remap_index] -#define _gloffset_BufferParameteriAPPLE driDispatchRemapTable[BufferParameteriAPPLE_remap_index] -#define _gloffset_FlushMappedBufferRangeAPPLE driDispatchRemapTable[FlushMappedBufferRangeAPPLE_remap_index] -#define _gloffset_BindFragDataLocationEXT driDispatchRemapTable[BindFragDataLocationEXT_remap_index] -#define _gloffset_GetFragDataLocationEXT driDispatchRemapTable[GetFragDataLocationEXT_remap_index] -#define _gloffset_ClearColorIiEXT driDispatchRemapTable[ClearColorIiEXT_remap_index] -#define _gloffset_ClearColorIuiEXT driDispatchRemapTable[ClearColorIuiEXT_remap_index] -#define _gloffset_GetTexParameterIivEXT driDispatchRemapTable[GetTexParameterIivEXT_remap_index] -#define _gloffset_GetTexParameterIuivEXT driDispatchRemapTable[GetTexParameterIuivEXT_remap_index] -#define _gloffset_TexParameterIivEXT driDispatchRemapTable[TexParameterIivEXT_remap_index] -#define _gloffset_TexParameterIuivEXT driDispatchRemapTable[TexParameterIuivEXT_remap_index] -#define _gloffset_GetTexParameterPointervAPPLE driDispatchRemapTable[GetTexParameterPointervAPPLE_remap_index] -#define _gloffset_TextureRangeAPPLE driDispatchRemapTable[TextureRangeAPPLE_remap_index] -#define _gloffset_GetObjectParameterivAPPLE driDispatchRemapTable[GetObjectParameterivAPPLE_remap_index] -#define _gloffset_ObjectPurgeableAPPLE driDispatchRemapTable[ObjectPurgeableAPPLE_remap_index] -#define _gloffset_ObjectUnpurgeableAPPLE driDispatchRemapTable[ObjectUnpurgeableAPPLE_remap_index] -#define _gloffset_CreateShaderProgramEXT driDispatchRemapTable[CreateShaderProgramEXT_remap_index] -#define _gloffset_TextureBarrierNV driDispatchRemapTable[TextureBarrierNV_remap_index] - -#endif /* !FEATURE_remap_table */ typedef void (GLAPIENTRYP _glptr_NewList)(GLuint, GLenum); #define CALL_NewList(disp, parameters) \ @@ -4788,435 +4245,6 @@ static inline void SET_PushClientAttrib(struct _glapi_table *disp, void (GLAPIEN SET_by_offset(disp, _gloffset_PushClientAttrib, fn); } -typedef void (GLAPIENTRYP _glptr_BlendColor)(GLclampf, GLclampf, GLclampf, GLclampf); -#define CALL_BlendColor(disp, parameters) \ - (* GET_BlendColor(disp)) parameters -static inline _glptr_BlendColor GET_BlendColor(struct _glapi_table *disp) { - return (_glptr_BlendColor) (GET_by_offset(disp, _gloffset_BlendColor)); -} - -static inline void SET_BlendColor(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLclampf, GLclampf, GLclampf, GLclampf)) { - SET_by_offset(disp, _gloffset_BlendColor, fn); -} - -typedef void (GLAPIENTRYP _glptr_BlendEquation)(GLenum); -#define CALL_BlendEquation(disp, parameters) \ - (* GET_BlendEquation(disp)) parameters -static inline _glptr_BlendEquation GET_BlendEquation(struct _glapi_table *disp) { - return (_glptr_BlendEquation) (GET_by_offset(disp, _gloffset_BlendEquation)); -} - -static inline void SET_BlendEquation(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum)) { - SET_by_offset(disp, _gloffset_BlendEquation, fn); -} - -typedef void (GLAPIENTRYP _glptr_DrawRangeElements)(GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); -#define CALL_DrawRangeElements(disp, parameters) \ - (* GET_DrawRangeElements(disp)) parameters -static inline _glptr_DrawRangeElements GET_DrawRangeElements(struct _glapi_table *disp) { - return (_glptr_DrawRangeElements) (GET_by_offset(disp, _gloffset_DrawRangeElements)); -} - -static inline void SET_DrawRangeElements(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *)) { - SET_by_offset(disp, _gloffset_DrawRangeElements, fn); -} - -typedef void (GLAPIENTRYP _glptr_ColorTable)(GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -#define CALL_ColorTable(disp, parameters) \ - (* GET_ColorTable(disp)) parameters -static inline _glptr_ColorTable GET_ColorTable(struct _glapi_table *disp) { - return (_glptr_ColorTable) (GET_by_offset(disp, _gloffset_ColorTable)); -} - -static inline void SET_ColorTable(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *)) { - SET_by_offset(disp, _gloffset_ColorTable, fn); -} - -typedef void (GLAPIENTRYP _glptr_ColorTableParameterfv)(GLenum, GLenum, const GLfloat *); -#define CALL_ColorTableParameterfv(disp, parameters) \ - (* GET_ColorTableParameterfv(disp)) parameters -static inline _glptr_ColorTableParameterfv GET_ColorTableParameterfv(struct _glapi_table *disp) { - return (_glptr_ColorTableParameterfv) (GET_by_offset(disp, _gloffset_ColorTableParameterfv)); -} - -static inline void SET_ColorTableParameterfv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, const GLfloat *)) { - SET_by_offset(disp, _gloffset_ColorTableParameterfv, fn); -} - -typedef void (GLAPIENTRYP _glptr_ColorTableParameteriv)(GLenum, GLenum, const GLint *); -#define CALL_ColorTableParameteriv(disp, parameters) \ - (* GET_ColorTableParameteriv(disp)) parameters -static inline _glptr_ColorTableParameteriv GET_ColorTableParameteriv(struct _glapi_table *disp) { - return (_glptr_ColorTableParameteriv) (GET_by_offset(disp, _gloffset_ColorTableParameteriv)); -} - -static inline void SET_ColorTableParameteriv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, const GLint *)) { - SET_by_offset(disp, _gloffset_ColorTableParameteriv, fn); -} - -typedef void (GLAPIENTRYP _glptr_CopyColorTable)(GLenum, GLenum, GLint, GLint, GLsizei); -#define CALL_CopyColorTable(disp, parameters) \ - (* GET_CopyColorTable(disp)) parameters -static inline _glptr_CopyColorTable GET_CopyColorTable(struct _glapi_table *disp) { - return (_glptr_CopyColorTable) (GET_by_offset(disp, _gloffset_CopyColorTable)); -} - -static inline void SET_CopyColorTable(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLint, GLint, GLsizei)) { - SET_by_offset(disp, _gloffset_CopyColorTable, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetColorTable)(GLenum, GLenum, GLenum, GLvoid *); -#define CALL_GetColorTable(disp, parameters) \ - (* GET_GetColorTable(disp)) parameters -static inline _glptr_GetColorTable GET_GetColorTable(struct _glapi_table *disp) { - return (_glptr_GetColorTable) (GET_by_offset(disp, _gloffset_GetColorTable)); -} - -static inline void SET_GetColorTable(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLenum, GLvoid *)) { - SET_by_offset(disp, _gloffset_GetColorTable, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetColorTableParameterfv)(GLenum, GLenum, GLfloat *); -#define CALL_GetColorTableParameterfv(disp, parameters) \ - (* GET_GetColorTableParameterfv(disp)) parameters -static inline _glptr_GetColorTableParameterfv GET_GetColorTableParameterfv(struct _glapi_table *disp) { - return (_glptr_GetColorTableParameterfv) (GET_by_offset(disp, _gloffset_GetColorTableParameterfv)); -} - -static inline void SET_GetColorTableParameterfv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLfloat *)) { - SET_by_offset(disp, _gloffset_GetColorTableParameterfv, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetColorTableParameteriv)(GLenum, GLenum, GLint *); -#define CALL_GetColorTableParameteriv(disp, parameters) \ - (* GET_GetColorTableParameteriv(disp)) parameters -static inline _glptr_GetColorTableParameteriv GET_GetColorTableParameteriv(struct _glapi_table *disp) { - return (_glptr_GetColorTableParameteriv) (GET_by_offset(disp, _gloffset_GetColorTableParameteriv)); -} - -static inline void SET_GetColorTableParameteriv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLint *)) { - SET_by_offset(disp, _gloffset_GetColorTableParameteriv, fn); -} - -typedef void (GLAPIENTRYP _glptr_ColorSubTable)(GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -#define CALL_ColorSubTable(disp, parameters) \ - (* GET_ColorSubTable(disp)) parameters -static inline _glptr_ColorSubTable GET_ColorSubTable(struct _glapi_table *disp) { - return (_glptr_ColorSubTable) (GET_by_offset(disp, _gloffset_ColorSubTable)); -} - -static inline void SET_ColorSubTable(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *)) { - SET_by_offset(disp, _gloffset_ColorSubTable, fn); -} - -typedef void (GLAPIENTRYP _glptr_CopyColorSubTable)(GLenum, GLsizei, GLint, GLint, GLsizei); -#define CALL_CopyColorSubTable(disp, parameters) \ - (* GET_CopyColorSubTable(disp)) parameters -static inline _glptr_CopyColorSubTable GET_CopyColorSubTable(struct _glapi_table *disp) { - return (_glptr_CopyColorSubTable) (GET_by_offset(disp, _gloffset_CopyColorSubTable)); -} - -static inline void SET_CopyColorSubTable(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLsizei, GLint, GLint, GLsizei)) { - SET_by_offset(disp, _gloffset_CopyColorSubTable, fn); -} - -typedef void (GLAPIENTRYP _glptr_ConvolutionFilter1D)(GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -#define CALL_ConvolutionFilter1D(disp, parameters) \ - (* GET_ConvolutionFilter1D(disp)) parameters -static inline _glptr_ConvolutionFilter1D GET_ConvolutionFilter1D(struct _glapi_table *disp) { - return (_glptr_ConvolutionFilter1D) (GET_by_offset(disp, _gloffset_ConvolutionFilter1D)); -} - -static inline void SET_ConvolutionFilter1D(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *)) { - SET_by_offset(disp, _gloffset_ConvolutionFilter1D, fn); -} - -typedef void (GLAPIENTRYP _glptr_ConvolutionFilter2D)(GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -#define CALL_ConvolutionFilter2D(disp, parameters) \ - (* GET_ConvolutionFilter2D(disp)) parameters -static inline _glptr_ConvolutionFilter2D GET_ConvolutionFilter2D(struct _glapi_table *disp) { - return (_glptr_ConvolutionFilter2D) (GET_by_offset(disp, _gloffset_ConvolutionFilter2D)); -} - -static inline void SET_ConvolutionFilter2D(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *)) { - SET_by_offset(disp, _gloffset_ConvolutionFilter2D, fn); -} - -typedef void (GLAPIENTRYP _glptr_ConvolutionParameterf)(GLenum, GLenum, GLfloat); -#define CALL_ConvolutionParameterf(disp, parameters) \ - (* GET_ConvolutionParameterf(disp)) parameters -static inline _glptr_ConvolutionParameterf GET_ConvolutionParameterf(struct _glapi_table *disp) { - return (_glptr_ConvolutionParameterf) (GET_by_offset(disp, _gloffset_ConvolutionParameterf)); -} - -static inline void SET_ConvolutionParameterf(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLfloat)) { - SET_by_offset(disp, _gloffset_ConvolutionParameterf, fn); -} - -typedef void (GLAPIENTRYP _glptr_ConvolutionParameterfv)(GLenum, GLenum, const GLfloat *); -#define CALL_ConvolutionParameterfv(disp, parameters) \ - (* GET_ConvolutionParameterfv(disp)) parameters -static inline _glptr_ConvolutionParameterfv GET_ConvolutionParameterfv(struct _glapi_table *disp) { - return (_glptr_ConvolutionParameterfv) (GET_by_offset(disp, _gloffset_ConvolutionParameterfv)); -} - -static inline void SET_ConvolutionParameterfv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, const GLfloat *)) { - SET_by_offset(disp, _gloffset_ConvolutionParameterfv, fn); -} - -typedef void (GLAPIENTRYP _glptr_ConvolutionParameteri)(GLenum, GLenum, GLint); -#define CALL_ConvolutionParameteri(disp, parameters) \ - (* GET_ConvolutionParameteri(disp)) parameters -static inline _glptr_ConvolutionParameteri GET_ConvolutionParameteri(struct _glapi_table *disp) { - return (_glptr_ConvolutionParameteri) (GET_by_offset(disp, _gloffset_ConvolutionParameteri)); -} - -static inline void SET_ConvolutionParameteri(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLint)) { - SET_by_offset(disp, _gloffset_ConvolutionParameteri, fn); -} - -typedef void (GLAPIENTRYP _glptr_ConvolutionParameteriv)(GLenum, GLenum, const GLint *); -#define CALL_ConvolutionParameteriv(disp, parameters) \ - (* GET_ConvolutionParameteriv(disp)) parameters -static inline _glptr_ConvolutionParameteriv GET_ConvolutionParameteriv(struct _glapi_table *disp) { - return (_glptr_ConvolutionParameteriv) (GET_by_offset(disp, _gloffset_ConvolutionParameteriv)); -} - -static inline void SET_ConvolutionParameteriv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, const GLint *)) { - SET_by_offset(disp, _gloffset_ConvolutionParameteriv, fn); -} - -typedef void (GLAPIENTRYP _glptr_CopyConvolutionFilter1D)(GLenum, GLenum, GLint, GLint, GLsizei); -#define CALL_CopyConvolutionFilter1D(disp, parameters) \ - (* GET_CopyConvolutionFilter1D(disp)) parameters -static inline _glptr_CopyConvolutionFilter1D GET_CopyConvolutionFilter1D(struct _glapi_table *disp) { - return (_glptr_CopyConvolutionFilter1D) (GET_by_offset(disp, _gloffset_CopyConvolutionFilter1D)); -} - -static inline void SET_CopyConvolutionFilter1D(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLint, GLint, GLsizei)) { - SET_by_offset(disp, _gloffset_CopyConvolutionFilter1D, fn); -} - -typedef void (GLAPIENTRYP _glptr_CopyConvolutionFilter2D)(GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); -#define CALL_CopyConvolutionFilter2D(disp, parameters) \ - (* GET_CopyConvolutionFilter2D(disp)) parameters -static inline _glptr_CopyConvolutionFilter2D GET_CopyConvolutionFilter2D(struct _glapi_table *disp) { - return (_glptr_CopyConvolutionFilter2D) (GET_by_offset(disp, _gloffset_CopyConvolutionFilter2D)); -} - -static inline void SET_CopyConvolutionFilter2D(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLint, GLint, GLsizei, GLsizei)) { - SET_by_offset(disp, _gloffset_CopyConvolutionFilter2D, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetConvolutionFilter)(GLenum, GLenum, GLenum, GLvoid *); -#define CALL_GetConvolutionFilter(disp, parameters) \ - (* GET_GetConvolutionFilter(disp)) parameters -static inline _glptr_GetConvolutionFilter GET_GetConvolutionFilter(struct _glapi_table *disp) { - return (_glptr_GetConvolutionFilter) (GET_by_offset(disp, _gloffset_GetConvolutionFilter)); -} - -static inline void SET_GetConvolutionFilter(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLenum, GLvoid *)) { - SET_by_offset(disp, _gloffset_GetConvolutionFilter, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetConvolutionParameterfv)(GLenum, GLenum, GLfloat *); -#define CALL_GetConvolutionParameterfv(disp, parameters) \ - (* GET_GetConvolutionParameterfv(disp)) parameters -static inline _glptr_GetConvolutionParameterfv GET_GetConvolutionParameterfv(struct _glapi_table *disp) { - return (_glptr_GetConvolutionParameterfv) (GET_by_offset(disp, _gloffset_GetConvolutionParameterfv)); -} - -static inline void SET_GetConvolutionParameterfv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLfloat *)) { - SET_by_offset(disp, _gloffset_GetConvolutionParameterfv, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetConvolutionParameteriv)(GLenum, GLenum, GLint *); -#define CALL_GetConvolutionParameteriv(disp, parameters) \ - (* GET_GetConvolutionParameteriv(disp)) parameters -static inline _glptr_GetConvolutionParameteriv GET_GetConvolutionParameteriv(struct _glapi_table *disp) { - return (_glptr_GetConvolutionParameteriv) (GET_by_offset(disp, _gloffset_GetConvolutionParameteriv)); -} - -static inline void SET_GetConvolutionParameteriv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLint *)) { - SET_by_offset(disp, _gloffset_GetConvolutionParameteriv, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetSeparableFilter)(GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); -#define CALL_GetSeparableFilter(disp, parameters) \ - (* GET_GetSeparableFilter(disp)) parameters -static inline _glptr_GetSeparableFilter GET_GetSeparableFilter(struct _glapi_table *disp) { - return (_glptr_GetSeparableFilter) (GET_by_offset(disp, _gloffset_GetSeparableFilter)); -} - -static inline void SET_GetSeparableFilter(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *)) { - SET_by_offset(disp, _gloffset_GetSeparableFilter, fn); -} - -typedef void (GLAPIENTRYP _glptr_SeparableFilter2D)(GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); -#define CALL_SeparableFilter2D(disp, parameters) \ - (* GET_SeparableFilter2D(disp)) parameters -static inline _glptr_SeparableFilter2D GET_SeparableFilter2D(struct _glapi_table *disp) { - return (_glptr_SeparableFilter2D) (GET_by_offset(disp, _gloffset_SeparableFilter2D)); -} - -static inline void SET_SeparableFilter2D(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *)) { - SET_by_offset(disp, _gloffset_SeparableFilter2D, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetHistogram)(GLenum, GLboolean, GLenum, GLenum, GLvoid *); -#define CALL_GetHistogram(disp, parameters) \ - (* GET_GetHistogram(disp)) parameters -static inline _glptr_GetHistogram GET_GetHistogram(struct _glapi_table *disp) { - return (_glptr_GetHistogram) (GET_by_offset(disp, _gloffset_GetHistogram)); -} - -static inline void SET_GetHistogram(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLboolean, GLenum, GLenum, GLvoid *)) { - SET_by_offset(disp, _gloffset_GetHistogram, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetHistogramParameterfv)(GLenum, GLenum, GLfloat *); -#define CALL_GetHistogramParameterfv(disp, parameters) \ - (* GET_GetHistogramParameterfv(disp)) parameters -static inline _glptr_GetHistogramParameterfv GET_GetHistogramParameterfv(struct _glapi_table *disp) { - return (_glptr_GetHistogramParameterfv) (GET_by_offset(disp, _gloffset_GetHistogramParameterfv)); -} - -static inline void SET_GetHistogramParameterfv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLfloat *)) { - SET_by_offset(disp, _gloffset_GetHistogramParameterfv, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetHistogramParameteriv)(GLenum, GLenum, GLint *); -#define CALL_GetHistogramParameteriv(disp, parameters) \ - (* GET_GetHistogramParameteriv(disp)) parameters -static inline _glptr_GetHistogramParameteriv GET_GetHistogramParameteriv(struct _glapi_table *disp) { - return (_glptr_GetHistogramParameteriv) (GET_by_offset(disp, _gloffset_GetHistogramParameteriv)); -} - -static inline void SET_GetHistogramParameteriv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLint *)) { - SET_by_offset(disp, _gloffset_GetHistogramParameteriv, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetMinmax)(GLenum, GLboolean, GLenum, GLenum, GLvoid *); -#define CALL_GetMinmax(disp, parameters) \ - (* GET_GetMinmax(disp)) parameters -static inline _glptr_GetMinmax GET_GetMinmax(struct _glapi_table *disp) { - return (_glptr_GetMinmax) (GET_by_offset(disp, _gloffset_GetMinmax)); -} - -static inline void SET_GetMinmax(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLboolean, GLenum, GLenum, GLvoid *)) { - SET_by_offset(disp, _gloffset_GetMinmax, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetMinmaxParameterfv)(GLenum, GLenum, GLfloat *); -#define CALL_GetMinmaxParameterfv(disp, parameters) \ - (* GET_GetMinmaxParameterfv(disp)) parameters -static inline _glptr_GetMinmaxParameterfv GET_GetMinmaxParameterfv(struct _glapi_table *disp) { - return (_glptr_GetMinmaxParameterfv) (GET_by_offset(disp, _gloffset_GetMinmaxParameterfv)); -} - -static inline void SET_GetMinmaxParameterfv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLfloat *)) { - SET_by_offset(disp, _gloffset_GetMinmaxParameterfv, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetMinmaxParameteriv)(GLenum, GLenum, GLint *); -#define CALL_GetMinmaxParameteriv(disp, parameters) \ - (* GET_GetMinmaxParameteriv(disp)) parameters -static inline _glptr_GetMinmaxParameteriv GET_GetMinmaxParameteriv(struct _glapi_table *disp) { - return (_glptr_GetMinmaxParameteriv) (GET_by_offset(disp, _gloffset_GetMinmaxParameteriv)); -} - -static inline void SET_GetMinmaxParameteriv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLint *)) { - SET_by_offset(disp, _gloffset_GetMinmaxParameteriv, fn); -} - -typedef void (GLAPIENTRYP _glptr_Histogram)(GLenum, GLsizei, GLenum, GLboolean); -#define CALL_Histogram(disp, parameters) \ - (* GET_Histogram(disp)) parameters -static inline _glptr_Histogram GET_Histogram(struct _glapi_table *disp) { - return (_glptr_Histogram) (GET_by_offset(disp, _gloffset_Histogram)); -} - -static inline void SET_Histogram(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLsizei, GLenum, GLboolean)) { - SET_by_offset(disp, _gloffset_Histogram, fn); -} - -typedef void (GLAPIENTRYP _glptr_Minmax)(GLenum, GLenum, GLboolean); -#define CALL_Minmax(disp, parameters) \ - (* GET_Minmax(disp)) parameters -static inline _glptr_Minmax GET_Minmax(struct _glapi_table *disp) { - return (_glptr_Minmax) (GET_by_offset(disp, _gloffset_Minmax)); -} - -static inline void SET_Minmax(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLboolean)) { - SET_by_offset(disp, _gloffset_Minmax, fn); -} - -typedef void (GLAPIENTRYP _glptr_ResetHistogram)(GLenum); -#define CALL_ResetHistogram(disp, parameters) \ - (* GET_ResetHistogram(disp)) parameters -static inline _glptr_ResetHistogram GET_ResetHistogram(struct _glapi_table *disp) { - return (_glptr_ResetHistogram) (GET_by_offset(disp, _gloffset_ResetHistogram)); -} - -static inline void SET_ResetHistogram(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum)) { - SET_by_offset(disp, _gloffset_ResetHistogram, fn); -} - -typedef void (GLAPIENTRYP _glptr_ResetMinmax)(GLenum); -#define CALL_ResetMinmax(disp, parameters) \ - (* GET_ResetMinmax(disp)) parameters -static inline _glptr_ResetMinmax GET_ResetMinmax(struct _glapi_table *disp) { - return (_glptr_ResetMinmax) (GET_by_offset(disp, _gloffset_ResetMinmax)); -} - -static inline void SET_ResetMinmax(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum)) { - SET_by_offset(disp, _gloffset_ResetMinmax, fn); -} - -typedef void (GLAPIENTRYP _glptr_TexImage3D)(GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -#define CALL_TexImage3D(disp, parameters) \ - (* GET_TexImage3D(disp)) parameters -static inline _glptr_TexImage3D GET_TexImage3D(struct _glapi_table *disp) { - return (_glptr_TexImage3D) (GET_by_offset(disp, _gloffset_TexImage3D)); -} - -static inline void SET_TexImage3D(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *)) { - SET_by_offset(disp, _gloffset_TexImage3D, fn); -} - -typedef void (GLAPIENTRYP _glptr_TexSubImage3D)(GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -#define CALL_TexSubImage3D(disp, parameters) \ - (* GET_TexSubImage3D(disp)) parameters -static inline _glptr_TexSubImage3D GET_TexSubImage3D(struct _glapi_table *disp) { - return (_glptr_TexSubImage3D) (GET_by_offset(disp, _gloffset_TexSubImage3D)); -} - -static inline void SET_TexSubImage3D(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *)) { - SET_by_offset(disp, _gloffset_TexSubImage3D, fn); -} - -typedef void (GLAPIENTRYP _glptr_CopyTexSubImage3D)(GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -#define CALL_CopyTexSubImage3D(disp, parameters) \ - (* GET_CopyTexSubImage3D(disp)) parameters -static inline _glptr_CopyTexSubImage3D GET_CopyTexSubImage3D(struct _glapi_table *disp) { - return (_glptr_CopyTexSubImage3D) (GET_by_offset(disp, _gloffset_CopyTexSubImage3D)); -} - -static inline void SET_CopyTexSubImage3D(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei)) { - SET_by_offset(disp, _gloffset_CopyTexSubImage3D, fn); -} - -typedef const GLubyte * (GLAPIENTRYP _glptr_GetStringi)(GLenum, GLuint); -#define CALL_GetStringi(disp, parameters) \ - (* GET_GetStringi(disp)) parameters -static inline _glptr_GetStringi GET_GetStringi(struct _glapi_table *disp) { - return (_glptr_GetStringi) (GET_by_offset(disp, _gloffset_GetStringi)); -} - -static inline void SET_GetStringi(struct _glapi_table *disp, const GLubyte * (GLAPIENTRYP fn)(GLenum, GLuint)) { - SET_by_offset(disp, _gloffset_GetStringi, fn); -} - typedef void (GLAPIENTRYP _glptr_GetBufferParameteri64v)(GLenum, GLenum, GLint64 *); #define CALL_GetBufferParameteri64v(disp, parameters) \ (* GET_GetBufferParameteri64v(disp)) parameters @@ -5426,39 +4454,6 @@ static inline void SET_AttachObjectARB(struct _glapi_table *disp, void (GLAPIENT SET_by_offset(disp, _gloffset_AttachObjectARB, fn); } -typedef void (GLAPIENTRYP _glptr_CompileShaderARB)(GLhandleARB); -#define CALL_CompileShaderARB(disp, parameters) \ - (* GET_CompileShaderARB(disp)) parameters -static inline _glptr_CompileShaderARB GET_CompileShaderARB(struct _glapi_table *disp) { - return (_glptr_CompileShaderARB) (GET_by_offset(disp, _gloffset_CompileShaderARB)); -} - -static inline void SET_CompileShaderARB(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLhandleARB)) { - SET_by_offset(disp, _gloffset_CompileShaderARB, fn); -} - -typedef GLhandleARB (GLAPIENTRYP _glptr_CreateProgramObjectARB)(void); -#define CALL_CreateProgramObjectARB(disp, parameters) \ - (* GET_CreateProgramObjectARB(disp)) parameters -static inline _glptr_CreateProgramObjectARB GET_CreateProgramObjectARB(struct _glapi_table *disp) { - return (_glptr_CreateProgramObjectARB) (GET_by_offset(disp, _gloffset_CreateProgramObjectARB)); -} - -static inline void SET_CreateProgramObjectARB(struct _glapi_table *disp, GLhandleARB (GLAPIENTRYP fn)(void)) { - SET_by_offset(disp, _gloffset_CreateProgramObjectARB, fn); -} - -typedef GLhandleARB (GLAPIENTRYP _glptr_CreateShaderObjectARB)(GLenum); -#define CALL_CreateShaderObjectARB(disp, parameters) \ - (* GET_CreateShaderObjectARB(disp)) parameters -static inline _glptr_CreateShaderObjectARB GET_CreateShaderObjectARB(struct _glapi_table *disp) { - return (_glptr_CreateShaderObjectARB) (GET_by_offset(disp, _gloffset_CreateShaderObjectARB)); -} - -static inline void SET_CreateShaderObjectARB(struct _glapi_table *disp, GLhandleARB (GLAPIENTRYP fn)(GLenum)) { - SET_by_offset(disp, _gloffset_CreateShaderObjectARB, fn); -} - typedef void (GLAPIENTRYP _glptr_DeleteObjectARB)(GLhandleARB); #define CALL_DeleteObjectARB(disp, parameters) \ (* GET_DeleteObjectARB(disp)) parameters @@ -5536,50 +4531,6 @@ static inline void SET_GetObjectParameterivARB(struct _glapi_table *disp, void ( SET_by_offset(disp, _gloffset_GetObjectParameterivARB, fn); } -typedef void (GLAPIENTRYP _glptr_GetShaderSourceARB)(GLhandleARB, GLsizei, GLsizei *, GLcharARB *); -#define CALL_GetShaderSourceARB(disp, parameters) \ - (* GET_GetShaderSourceARB(disp)) parameters -static inline _glptr_GetShaderSourceARB GET_GetShaderSourceARB(struct _glapi_table *disp) { - return (_glptr_GetShaderSourceARB) (GET_by_offset(disp, _gloffset_GetShaderSourceARB)); -} - -static inline void SET_GetShaderSourceARB(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLhandleARB, GLsizei, GLsizei *, GLcharARB *)) { - SET_by_offset(disp, _gloffset_GetShaderSourceARB, fn); -} - -typedef void (GLAPIENTRYP _glptr_LinkProgramARB)(GLhandleARB); -#define CALL_LinkProgramARB(disp, parameters) \ - (* GET_LinkProgramARB(disp)) parameters -static inline _glptr_LinkProgramARB GET_LinkProgramARB(struct _glapi_table *disp) { - return (_glptr_LinkProgramARB) (GET_by_offset(disp, _gloffset_LinkProgramARB)); -} - -static inline void SET_LinkProgramARB(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLhandleARB)) { - SET_by_offset(disp, _gloffset_LinkProgramARB, fn); -} - -typedef void (GLAPIENTRYP _glptr_ShaderSourceARB)(GLhandleARB, GLsizei, const GLcharARB **, const GLint *); -#define CALL_ShaderSourceARB(disp, parameters) \ - (* GET_ShaderSourceARB(disp)) parameters -static inline _glptr_ShaderSourceARB GET_ShaderSourceARB(struct _glapi_table *disp) { - return (_glptr_ShaderSourceARB) (GET_by_offset(disp, _gloffset_ShaderSourceARB)); -} - -static inline void SET_ShaderSourceARB(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLhandleARB, GLsizei, const GLcharARB **, const GLint *)) { - SET_by_offset(disp, _gloffset_ShaderSourceARB, fn); -} - -typedef void (GLAPIENTRYP _glptr_ValidateProgramARB)(GLhandleARB); -#define CALL_ValidateProgramARB(disp, parameters) \ - (* GET_ValidateProgramARB(disp)) parameters -static inline _glptr_ValidateProgramARB GET_ValidateProgramARB(struct _glapi_table *disp) { - return (_glptr_ValidateProgramARB) (GET_by_offset(disp, _gloffset_ValidateProgramARB)); -} - -static inline void SET_ValidateProgramARB(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLhandleARB)) { - SET_by_offset(disp, _gloffset_ValidateProgramARB, fn); -} - typedef void (GLAPIENTRYP _glptr_GetActiveAttribARB)(GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); #define CALL_GetActiveAttribARB(disp, parameters) \ (* GET_GetActiveAttribARB(disp)) parameters @@ -5613,28 +4564,6 @@ static inline void SET_MapBufferRange(struct _glapi_table *disp, GLvoid * (GLAPI SET_by_offset(disp, _gloffset_MapBufferRange, fn); } -typedef void (GLAPIENTRYP _glptr_BindVertexArray)(GLuint); -#define CALL_BindVertexArray(disp, parameters) \ - (* GET_BindVertexArray(disp)) parameters -static inline _glptr_BindVertexArray GET_BindVertexArray(struct _glapi_table *disp) { - return (_glptr_BindVertexArray) (GET_by_offset(disp, _gloffset_BindVertexArray)); -} - -static inline void SET_BindVertexArray(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint)) { - SET_by_offset(disp, _gloffset_BindVertexArray, fn); -} - -typedef void (GLAPIENTRYP _glptr_GenVertexArrays)(GLsizei, GLuint *); -#define CALL_GenVertexArrays(disp, parameters) \ - (* GET_GenVertexArrays(disp)) parameters -static inline _glptr_GenVertexArrays GET_GenVertexArrays(struct _glapi_table *disp) { - return (_glptr_GenVertexArrays) (GET_by_offset(disp, _gloffset_GenVertexArrays)); -} - -static inline void SET_GenVertexArrays(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLsizei, GLuint *)) { - SET_by_offset(disp, _gloffset_GenVertexArrays, fn); -} - typedef void (GLAPIENTRYP _glptr_TexStorage1D)(GLenum, GLsizei, GLenum, GLsizei); #define CALL_TexStorage1D(disp, parameters) \ (* GET_TexStorage1D(disp)) parameters @@ -5844,193 +4773,6 @@ static inline void SET_UnlockArraysEXT(struct _glapi_table *disp, void (GLAPIENT SET_by_offset(disp, _gloffset_UnlockArraysEXT, fn); } -typedef void (GLAPIENTRYP _glptr_SecondaryColor3bEXT)(GLbyte, GLbyte, GLbyte); -#define CALL_SecondaryColor3bEXT(disp, parameters) \ - (* GET_SecondaryColor3bEXT(disp)) parameters -static inline _glptr_SecondaryColor3bEXT GET_SecondaryColor3bEXT(struct _glapi_table *disp) { - return (_glptr_SecondaryColor3bEXT) (GET_by_offset(disp, _gloffset_SecondaryColor3bEXT)); -} - -static inline void SET_SecondaryColor3bEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLbyte, GLbyte, GLbyte)) { - SET_by_offset(disp, _gloffset_SecondaryColor3bEXT, fn); -} - -typedef void (GLAPIENTRYP _glptr_SecondaryColor3bvEXT)(const GLbyte *); -#define CALL_SecondaryColor3bvEXT(disp, parameters) \ - (* GET_SecondaryColor3bvEXT(disp)) parameters -static inline _glptr_SecondaryColor3bvEXT GET_SecondaryColor3bvEXT(struct _glapi_table *disp) { - return (_glptr_SecondaryColor3bvEXT) (GET_by_offset(disp, _gloffset_SecondaryColor3bvEXT)); -} - -static inline void SET_SecondaryColor3bvEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(const GLbyte *)) { - SET_by_offset(disp, _gloffset_SecondaryColor3bvEXT, fn); -} - -typedef void (GLAPIENTRYP _glptr_SecondaryColor3dEXT)(GLdouble, GLdouble, GLdouble); -#define CALL_SecondaryColor3dEXT(disp, parameters) \ - (* GET_SecondaryColor3dEXT(disp)) parameters -static inline _glptr_SecondaryColor3dEXT GET_SecondaryColor3dEXT(struct _glapi_table *disp) { - return (_glptr_SecondaryColor3dEXT) (GET_by_offset(disp, _gloffset_SecondaryColor3dEXT)); -} - -static inline void SET_SecondaryColor3dEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLdouble, GLdouble, GLdouble)) { - SET_by_offset(disp, _gloffset_SecondaryColor3dEXT, fn); -} - -typedef void (GLAPIENTRYP _glptr_SecondaryColor3dvEXT)(const GLdouble *); -#define CALL_SecondaryColor3dvEXT(disp, parameters) \ - (* GET_SecondaryColor3dvEXT(disp)) parameters -static inline _glptr_SecondaryColor3dvEXT GET_SecondaryColor3dvEXT(struct _glapi_table *disp) { - return (_glptr_SecondaryColor3dvEXT) (GET_by_offset(disp, _gloffset_SecondaryColor3dvEXT)); -} - -static inline void SET_SecondaryColor3dvEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(const GLdouble *)) { - SET_by_offset(disp, _gloffset_SecondaryColor3dvEXT, fn); -} - -typedef void (GLAPIENTRYP _glptr_SecondaryColor3fEXT)(GLfloat, GLfloat, GLfloat); -#define CALL_SecondaryColor3fEXT(disp, parameters) \ - (* GET_SecondaryColor3fEXT(disp)) parameters -static inline _glptr_SecondaryColor3fEXT GET_SecondaryColor3fEXT(struct _glapi_table *disp) { - return (_glptr_SecondaryColor3fEXT) (GET_by_offset(disp, _gloffset_SecondaryColor3fEXT)); -} - -static inline void SET_SecondaryColor3fEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLfloat, GLfloat, GLfloat)) { - SET_by_offset(disp, _gloffset_SecondaryColor3fEXT, fn); -} - -typedef void (GLAPIENTRYP _glptr_SecondaryColor3fvEXT)(const GLfloat *); -#define CALL_SecondaryColor3fvEXT(disp, parameters) \ - (* GET_SecondaryColor3fvEXT(disp)) parameters -static inline _glptr_SecondaryColor3fvEXT GET_SecondaryColor3fvEXT(struct _glapi_table *disp) { - return (_glptr_SecondaryColor3fvEXT) (GET_by_offset(disp, _gloffset_SecondaryColor3fvEXT)); -} - -static inline void SET_SecondaryColor3fvEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(const GLfloat *)) { - SET_by_offset(disp, _gloffset_SecondaryColor3fvEXT, fn); -} - -typedef void (GLAPIENTRYP _glptr_SecondaryColor3iEXT)(GLint, GLint, GLint); -#define CALL_SecondaryColor3iEXT(disp, parameters) \ - (* GET_SecondaryColor3iEXT(disp)) parameters -static inline _glptr_SecondaryColor3iEXT GET_SecondaryColor3iEXT(struct _glapi_table *disp) { - return (_glptr_SecondaryColor3iEXT) (GET_by_offset(disp, _gloffset_SecondaryColor3iEXT)); -} - -static inline void SET_SecondaryColor3iEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLint, GLint, GLint)) { - SET_by_offset(disp, _gloffset_SecondaryColor3iEXT, fn); -} - -typedef void (GLAPIENTRYP _glptr_SecondaryColor3ivEXT)(const GLint *); -#define CALL_SecondaryColor3ivEXT(disp, parameters) \ - (* GET_SecondaryColor3ivEXT(disp)) parameters -static inline _glptr_SecondaryColor3ivEXT GET_SecondaryColor3ivEXT(struct _glapi_table *disp) { - return (_glptr_SecondaryColor3ivEXT) (GET_by_offset(disp, _gloffset_SecondaryColor3ivEXT)); -} - -static inline void SET_SecondaryColor3ivEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(const GLint *)) { - SET_by_offset(disp, _gloffset_SecondaryColor3ivEXT, fn); -} - -typedef void (GLAPIENTRYP _glptr_SecondaryColor3sEXT)(GLshort, GLshort, GLshort); -#define CALL_SecondaryColor3sEXT(disp, parameters) \ - (* GET_SecondaryColor3sEXT(disp)) parameters -static inline _glptr_SecondaryColor3sEXT GET_SecondaryColor3sEXT(struct _glapi_table *disp) { - return (_glptr_SecondaryColor3sEXT) (GET_by_offset(disp, _gloffset_SecondaryColor3sEXT)); -} - -static inline void SET_SecondaryColor3sEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLshort, GLshort, GLshort)) { - SET_by_offset(disp, _gloffset_SecondaryColor3sEXT, fn); -} - -typedef void (GLAPIENTRYP _glptr_SecondaryColor3svEXT)(const GLshort *); -#define CALL_SecondaryColor3svEXT(disp, parameters) \ - (* GET_SecondaryColor3svEXT(disp)) parameters -static inline _glptr_SecondaryColor3svEXT GET_SecondaryColor3svEXT(struct _glapi_table *disp) { - return (_glptr_SecondaryColor3svEXT) (GET_by_offset(disp, _gloffset_SecondaryColor3svEXT)); -} - -static inline void SET_SecondaryColor3svEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(const GLshort *)) { - SET_by_offset(disp, _gloffset_SecondaryColor3svEXT, fn); -} - -typedef void (GLAPIENTRYP _glptr_SecondaryColor3ubEXT)(GLubyte, GLubyte, GLubyte); -#define CALL_SecondaryColor3ubEXT(disp, parameters) \ - (* GET_SecondaryColor3ubEXT(disp)) parameters -static inline _glptr_SecondaryColor3ubEXT GET_SecondaryColor3ubEXT(struct _glapi_table *disp) { - return (_glptr_SecondaryColor3ubEXT) (GET_by_offset(disp, _gloffset_SecondaryColor3ubEXT)); -} - -static inline void SET_SecondaryColor3ubEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLubyte, GLubyte, GLubyte)) { - SET_by_offset(disp, _gloffset_SecondaryColor3ubEXT, fn); -} - -typedef void (GLAPIENTRYP _glptr_SecondaryColor3ubvEXT)(const GLubyte *); -#define CALL_SecondaryColor3ubvEXT(disp, parameters) \ - (* GET_SecondaryColor3ubvEXT(disp)) parameters -static inline _glptr_SecondaryColor3ubvEXT GET_SecondaryColor3ubvEXT(struct _glapi_table *disp) { - return (_glptr_SecondaryColor3ubvEXT) (GET_by_offset(disp, _gloffset_SecondaryColor3ubvEXT)); -} - -static inline void SET_SecondaryColor3ubvEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(const GLubyte *)) { - SET_by_offset(disp, _gloffset_SecondaryColor3ubvEXT, fn); -} - -typedef void (GLAPIENTRYP _glptr_SecondaryColor3uiEXT)(GLuint, GLuint, GLuint); -#define CALL_SecondaryColor3uiEXT(disp, parameters) \ - (* GET_SecondaryColor3uiEXT(disp)) parameters -static inline _glptr_SecondaryColor3uiEXT GET_SecondaryColor3uiEXT(struct _glapi_table *disp) { - return (_glptr_SecondaryColor3uiEXT) (GET_by_offset(disp, _gloffset_SecondaryColor3uiEXT)); -} - -static inline void SET_SecondaryColor3uiEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLuint, GLuint)) { - SET_by_offset(disp, _gloffset_SecondaryColor3uiEXT, fn); -} - -typedef void (GLAPIENTRYP _glptr_SecondaryColor3uivEXT)(const GLuint *); -#define CALL_SecondaryColor3uivEXT(disp, parameters) \ - (* GET_SecondaryColor3uivEXT(disp)) parameters -static inline _glptr_SecondaryColor3uivEXT GET_SecondaryColor3uivEXT(struct _glapi_table *disp) { - return (_glptr_SecondaryColor3uivEXT) (GET_by_offset(disp, _gloffset_SecondaryColor3uivEXT)); -} - -static inline void SET_SecondaryColor3uivEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(const GLuint *)) { - SET_by_offset(disp, _gloffset_SecondaryColor3uivEXT, fn); -} - -typedef void (GLAPIENTRYP _glptr_SecondaryColor3usEXT)(GLushort, GLushort, GLushort); -#define CALL_SecondaryColor3usEXT(disp, parameters) \ - (* GET_SecondaryColor3usEXT(disp)) parameters -static inline _glptr_SecondaryColor3usEXT GET_SecondaryColor3usEXT(struct _glapi_table *disp) { - return (_glptr_SecondaryColor3usEXT) (GET_by_offset(disp, _gloffset_SecondaryColor3usEXT)); -} - -static inline void SET_SecondaryColor3usEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLushort, GLushort, GLushort)) { - SET_by_offset(disp, _gloffset_SecondaryColor3usEXT, fn); -} - -typedef void (GLAPIENTRYP _glptr_SecondaryColor3usvEXT)(const GLushort *); -#define CALL_SecondaryColor3usvEXT(disp, parameters) \ - (* GET_SecondaryColor3usvEXT(disp)) parameters -static inline _glptr_SecondaryColor3usvEXT GET_SecondaryColor3usvEXT(struct _glapi_table *disp) { - return (_glptr_SecondaryColor3usvEXT) (GET_by_offset(disp, _gloffset_SecondaryColor3usvEXT)); -} - -static inline void SET_SecondaryColor3usvEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(const GLushort *)) { - SET_by_offset(disp, _gloffset_SecondaryColor3usvEXT, fn); -} - -typedef void (GLAPIENTRYP _glptr_SecondaryColorPointerEXT)(GLint, GLenum, GLsizei, const GLvoid *); -#define CALL_SecondaryColorPointerEXT(disp, parameters) \ - (* GET_SecondaryColorPointerEXT(disp)) parameters -static inline _glptr_SecondaryColorPointerEXT GET_SecondaryColorPointerEXT(struct _glapi_table *disp) { - return (_glptr_SecondaryColorPointerEXT) (GET_by_offset(disp, _gloffset_SecondaryColorPointerEXT)); -} - -static inline void SET_SecondaryColorPointerEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLint, GLenum, GLsizei, const GLvoid *)) { - SET_by_offset(disp, _gloffset_SecondaryColorPointerEXT, fn); -} - typedef void (GLAPIENTRYP _glptr_FogCoordPointerEXT)(GLenum, GLsizei, const GLvoid *); #define CALL_FogCoordPointerEXT(disp, parameters) \ (* GET_FogCoordPointerEXT(disp)) parameters @@ -6097,17 +4839,6 @@ static inline void SET_PixelTexGenSGIX(struct _glapi_table *disp, void (GLAPIENT SET_by_offset(disp, _gloffset_PixelTexGenSGIX, fn); } -typedef void (GLAPIENTRYP _glptr_BlendFuncSeparateEXT)(GLenum, GLenum, GLenum, GLenum); -#define CALL_BlendFuncSeparateEXT(disp, parameters) \ - (* GET_BlendFuncSeparateEXT(disp)) parameters -static inline _glptr_BlendFuncSeparateEXT GET_BlendFuncSeparateEXT(struct _glapi_table *disp) { - return (_glptr_BlendFuncSeparateEXT) (GET_by_offset(disp, _gloffset_BlendFuncSeparateEXT)); -} - -static inline void SET_BlendFuncSeparateEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLenum, GLenum)) { - SET_by_offset(disp, _gloffset_BlendFuncSeparateEXT, fn); -} - typedef void (GLAPIENTRYP _glptr_FlushVertexArrayRangeNV)(void); #define CALL_FlushVertexArrayRangeNV(disp, parameters) \ (* GET_FlushVertexArrayRangeNV(disp)) parameters @@ -6636,116 +5367,6 @@ static inline void SET_TestFenceNV(struct _glapi_table *disp, GLboolean (GLAPIEN SET_by_offset(disp, _gloffset_TestFenceNV, fn); } -typedef GLboolean (GLAPIENTRYP _glptr_AreProgramsResidentNV)(GLsizei, const GLuint *, GLboolean *); -#define CALL_AreProgramsResidentNV(disp, parameters) \ - (* GET_AreProgramsResidentNV(disp)) parameters -static inline _glptr_AreProgramsResidentNV GET_AreProgramsResidentNV(struct _glapi_table *disp) { - return (_glptr_AreProgramsResidentNV) (GET_by_offset(disp, _gloffset_AreProgramsResidentNV)); -} - -static inline void SET_AreProgramsResidentNV(struct _glapi_table *disp, GLboolean (GLAPIENTRYP fn)(GLsizei, const GLuint *, GLboolean *)) { - SET_by_offset(disp, _gloffset_AreProgramsResidentNV, fn); -} - -typedef void (GLAPIENTRYP _glptr_ExecuteProgramNV)(GLenum, GLuint, const GLfloat *); -#define CALL_ExecuteProgramNV(disp, parameters) \ - (* GET_ExecuteProgramNV(disp)) parameters -static inline _glptr_ExecuteProgramNV GET_ExecuteProgramNV(struct _glapi_table *disp) { - return (_glptr_ExecuteProgramNV) (GET_by_offset(disp, _gloffset_ExecuteProgramNV)); -} - -static inline void SET_ExecuteProgramNV(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLuint, const GLfloat *)) { - SET_by_offset(disp, _gloffset_ExecuteProgramNV, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetProgramParameterdvNV)(GLenum, GLuint, GLenum, GLdouble *); -#define CALL_GetProgramParameterdvNV(disp, parameters) \ - (* GET_GetProgramParameterdvNV(disp)) parameters -static inline _glptr_GetProgramParameterdvNV GET_GetProgramParameterdvNV(struct _glapi_table *disp) { - return (_glptr_GetProgramParameterdvNV) (GET_by_offset(disp, _gloffset_GetProgramParameterdvNV)); -} - -static inline void SET_GetProgramParameterdvNV(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLuint, GLenum, GLdouble *)) { - SET_by_offset(disp, _gloffset_GetProgramParameterdvNV, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetProgramParameterfvNV)(GLenum, GLuint, GLenum, GLfloat *); -#define CALL_GetProgramParameterfvNV(disp, parameters) \ - (* GET_GetProgramParameterfvNV(disp)) parameters -static inline _glptr_GetProgramParameterfvNV GET_GetProgramParameterfvNV(struct _glapi_table *disp) { - return (_glptr_GetProgramParameterfvNV) (GET_by_offset(disp, _gloffset_GetProgramParameterfvNV)); -} - -static inline void SET_GetProgramParameterfvNV(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLuint, GLenum, GLfloat *)) { - SET_by_offset(disp, _gloffset_GetProgramParameterfvNV, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetTrackMatrixivNV)(GLenum, GLuint, GLenum, GLint *); -#define CALL_GetTrackMatrixivNV(disp, parameters) \ - (* GET_GetTrackMatrixivNV(disp)) parameters -static inline _glptr_GetTrackMatrixivNV GET_GetTrackMatrixivNV(struct _glapi_table *disp) { - return (_glptr_GetTrackMatrixivNV) (GET_by_offset(disp, _gloffset_GetTrackMatrixivNV)); -} - -static inline void SET_GetTrackMatrixivNV(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLuint, GLenum, GLint *)) { - SET_by_offset(disp, _gloffset_GetTrackMatrixivNV, fn); -} - -typedef void (GLAPIENTRYP _glptr_LoadProgramNV)(GLenum, GLuint, GLsizei, const GLubyte *); -#define CALL_LoadProgramNV(disp, parameters) \ - (* GET_LoadProgramNV(disp)) parameters -static inline _glptr_LoadProgramNV GET_LoadProgramNV(struct _glapi_table *disp) { - return (_glptr_LoadProgramNV) (GET_by_offset(disp, _gloffset_LoadProgramNV)); -} - -static inline void SET_LoadProgramNV(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLuint, GLsizei, const GLubyte *)) { - SET_by_offset(disp, _gloffset_LoadProgramNV, fn); -} - -typedef void (GLAPIENTRYP _glptr_ProgramParameters4dvNV)(GLenum, GLuint, GLsizei, const GLdouble *); -#define CALL_ProgramParameters4dvNV(disp, parameters) \ - (* GET_ProgramParameters4dvNV(disp)) parameters -static inline _glptr_ProgramParameters4dvNV GET_ProgramParameters4dvNV(struct _glapi_table *disp) { - return (_glptr_ProgramParameters4dvNV) (GET_by_offset(disp, _gloffset_ProgramParameters4dvNV)); -} - -static inline void SET_ProgramParameters4dvNV(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLuint, GLsizei, const GLdouble *)) { - SET_by_offset(disp, _gloffset_ProgramParameters4dvNV, fn); -} - -typedef void (GLAPIENTRYP _glptr_ProgramParameters4fvNV)(GLenum, GLuint, GLsizei, const GLfloat *); -#define CALL_ProgramParameters4fvNV(disp, parameters) \ - (* GET_ProgramParameters4fvNV(disp)) parameters -static inline _glptr_ProgramParameters4fvNV GET_ProgramParameters4fvNV(struct _glapi_table *disp) { - return (_glptr_ProgramParameters4fvNV) (GET_by_offset(disp, _gloffset_ProgramParameters4fvNV)); -} - -static inline void SET_ProgramParameters4fvNV(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLuint, GLsizei, const GLfloat *)) { - SET_by_offset(disp, _gloffset_ProgramParameters4fvNV, fn); -} - -typedef void (GLAPIENTRYP _glptr_RequestResidentProgramsNV)(GLsizei, const GLuint *); -#define CALL_RequestResidentProgramsNV(disp, parameters) \ - (* GET_RequestResidentProgramsNV(disp)) parameters -static inline _glptr_RequestResidentProgramsNV GET_RequestResidentProgramsNV(struct _glapi_table *disp) { - return (_glptr_RequestResidentProgramsNV) (GET_by_offset(disp, _gloffset_RequestResidentProgramsNV)); -} - -static inline void SET_RequestResidentProgramsNV(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLsizei, const GLuint *)) { - SET_by_offset(disp, _gloffset_RequestResidentProgramsNV, fn); -} - -typedef void (GLAPIENTRYP _glptr_TrackMatrixNV)(GLenum, GLuint, GLenum, GLenum); -#define CALL_TrackMatrixNV(disp, parameters) \ - (* GET_TrackMatrixNV(disp)) parameters -static inline _glptr_TrackMatrixNV GET_TrackMatrixNV(struct _glapi_table *disp) { - return (_glptr_TrackMatrixNV) (GET_by_offset(disp, _gloffset_TrackMatrixNV)); -} - -static inline void SET_TrackMatrixNV(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLuint, GLenum, GLenum)) { - SET_by_offset(disp, _gloffset_TrackMatrixNV, fn); -} - typedef void (GLAPIENTRYP _glptr_VertexAttrib1dNV)(GLuint, GLdouble); #define CALL_VertexAttrib1dNV(disp, parameters) \ (* GET_VertexAttrib1dNV(disp)) parameters @@ -7032,149 +5653,6 @@ static inline void SET_VertexAttrib4ubvNV(struct _glapi_table *disp, void (GLAPI SET_by_offset(disp, _gloffset_VertexAttrib4ubvNV, fn); } -typedef void (GLAPIENTRYP _glptr_VertexAttribs1dvNV)(GLuint, GLsizei, const GLdouble *); -#define CALL_VertexAttribs1dvNV(disp, parameters) \ - (* GET_VertexAttribs1dvNV(disp)) parameters -static inline _glptr_VertexAttribs1dvNV GET_VertexAttribs1dvNV(struct _glapi_table *disp) { - return (_glptr_VertexAttribs1dvNV) (GET_by_offset(disp, _gloffset_VertexAttribs1dvNV)); -} - -static inline void SET_VertexAttribs1dvNV(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLsizei, const GLdouble *)) { - SET_by_offset(disp, _gloffset_VertexAttribs1dvNV, fn); -} - -typedef void (GLAPIENTRYP _glptr_VertexAttribs1fvNV)(GLuint, GLsizei, const GLfloat *); -#define CALL_VertexAttribs1fvNV(disp, parameters) \ - (* GET_VertexAttribs1fvNV(disp)) parameters -static inline _glptr_VertexAttribs1fvNV GET_VertexAttribs1fvNV(struct _glapi_table *disp) { - return (_glptr_VertexAttribs1fvNV) (GET_by_offset(disp, _gloffset_VertexAttribs1fvNV)); -} - -static inline void SET_VertexAttribs1fvNV(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLsizei, const GLfloat *)) { - SET_by_offset(disp, _gloffset_VertexAttribs1fvNV, fn); -} - -typedef void (GLAPIENTRYP _glptr_VertexAttribs1svNV)(GLuint, GLsizei, const GLshort *); -#define CALL_VertexAttribs1svNV(disp, parameters) \ - (* GET_VertexAttribs1svNV(disp)) parameters -static inline _glptr_VertexAttribs1svNV GET_VertexAttribs1svNV(struct _glapi_table *disp) { - return (_glptr_VertexAttribs1svNV) (GET_by_offset(disp, _gloffset_VertexAttribs1svNV)); -} - -static inline void SET_VertexAttribs1svNV(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLsizei, const GLshort *)) { - SET_by_offset(disp, _gloffset_VertexAttribs1svNV, fn); -} - -typedef void (GLAPIENTRYP _glptr_VertexAttribs2dvNV)(GLuint, GLsizei, const GLdouble *); -#define CALL_VertexAttribs2dvNV(disp, parameters) \ - (* GET_VertexAttribs2dvNV(disp)) parameters -static inline _glptr_VertexAttribs2dvNV GET_VertexAttribs2dvNV(struct _glapi_table *disp) { - return (_glptr_VertexAttribs2dvNV) (GET_by_offset(disp, _gloffset_VertexAttribs2dvNV)); -} - -static inline void SET_VertexAttribs2dvNV(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLsizei, const GLdouble *)) { - SET_by_offset(disp, _gloffset_VertexAttribs2dvNV, fn); -} - -typedef void (GLAPIENTRYP _glptr_VertexAttribs2fvNV)(GLuint, GLsizei, const GLfloat *); -#define CALL_VertexAttribs2fvNV(disp, parameters) \ - (* GET_VertexAttribs2fvNV(disp)) parameters -static inline _glptr_VertexAttribs2fvNV GET_VertexAttribs2fvNV(struct _glapi_table *disp) { - return (_glptr_VertexAttribs2fvNV) (GET_by_offset(disp, _gloffset_VertexAttribs2fvNV)); -} - -static inline void SET_VertexAttribs2fvNV(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLsizei, const GLfloat *)) { - SET_by_offset(disp, _gloffset_VertexAttribs2fvNV, fn); -} - -typedef void (GLAPIENTRYP _glptr_VertexAttribs2svNV)(GLuint, GLsizei, const GLshort *); -#define CALL_VertexAttribs2svNV(disp, parameters) \ - (* GET_VertexAttribs2svNV(disp)) parameters -static inline _glptr_VertexAttribs2svNV GET_VertexAttribs2svNV(struct _glapi_table *disp) { - return (_glptr_VertexAttribs2svNV) (GET_by_offset(disp, _gloffset_VertexAttribs2svNV)); -} - -static inline void SET_VertexAttribs2svNV(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLsizei, const GLshort *)) { - SET_by_offset(disp, _gloffset_VertexAttribs2svNV, fn); -} - -typedef void (GLAPIENTRYP _glptr_VertexAttribs3dvNV)(GLuint, GLsizei, const GLdouble *); -#define CALL_VertexAttribs3dvNV(disp, parameters) \ - (* GET_VertexAttribs3dvNV(disp)) parameters -static inline _glptr_VertexAttribs3dvNV GET_VertexAttribs3dvNV(struct _glapi_table *disp) { - return (_glptr_VertexAttribs3dvNV) (GET_by_offset(disp, _gloffset_VertexAttribs3dvNV)); -} - -static inline void SET_VertexAttribs3dvNV(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLsizei, const GLdouble *)) { - SET_by_offset(disp, _gloffset_VertexAttribs3dvNV, fn); -} - -typedef void (GLAPIENTRYP _glptr_VertexAttribs3fvNV)(GLuint, GLsizei, const GLfloat *); -#define CALL_VertexAttribs3fvNV(disp, parameters) \ - (* GET_VertexAttribs3fvNV(disp)) parameters -static inline _glptr_VertexAttribs3fvNV GET_VertexAttribs3fvNV(struct _glapi_table *disp) { - return (_glptr_VertexAttribs3fvNV) (GET_by_offset(disp, _gloffset_VertexAttribs3fvNV)); -} - -static inline void SET_VertexAttribs3fvNV(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLsizei, const GLfloat *)) { - SET_by_offset(disp, _gloffset_VertexAttribs3fvNV, fn); -} - -typedef void (GLAPIENTRYP _glptr_VertexAttribs3svNV)(GLuint, GLsizei, const GLshort *); -#define CALL_VertexAttribs3svNV(disp, parameters) \ - (* GET_VertexAttribs3svNV(disp)) parameters -static inline _glptr_VertexAttribs3svNV GET_VertexAttribs3svNV(struct _glapi_table *disp) { - return (_glptr_VertexAttribs3svNV) (GET_by_offset(disp, _gloffset_VertexAttribs3svNV)); -} - -static inline void SET_VertexAttribs3svNV(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLsizei, const GLshort *)) { - SET_by_offset(disp, _gloffset_VertexAttribs3svNV, fn); -} - -typedef void (GLAPIENTRYP _glptr_VertexAttribs4dvNV)(GLuint, GLsizei, const GLdouble *); -#define CALL_VertexAttribs4dvNV(disp, parameters) \ - (* GET_VertexAttribs4dvNV(disp)) parameters -static inline _glptr_VertexAttribs4dvNV GET_VertexAttribs4dvNV(struct _glapi_table *disp) { - return (_glptr_VertexAttribs4dvNV) (GET_by_offset(disp, _gloffset_VertexAttribs4dvNV)); -} - -static inline void SET_VertexAttribs4dvNV(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLsizei, const GLdouble *)) { - SET_by_offset(disp, _gloffset_VertexAttribs4dvNV, fn); -} - -typedef void (GLAPIENTRYP _glptr_VertexAttribs4fvNV)(GLuint, GLsizei, const GLfloat *); -#define CALL_VertexAttribs4fvNV(disp, parameters) \ - (* GET_VertexAttribs4fvNV(disp)) parameters -static inline _glptr_VertexAttribs4fvNV GET_VertexAttribs4fvNV(struct _glapi_table *disp) { - return (_glptr_VertexAttribs4fvNV) (GET_by_offset(disp, _gloffset_VertexAttribs4fvNV)); -} - -static inline void SET_VertexAttribs4fvNV(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLsizei, const GLfloat *)) { - SET_by_offset(disp, _gloffset_VertexAttribs4fvNV, fn); -} - -typedef void (GLAPIENTRYP _glptr_VertexAttribs4svNV)(GLuint, GLsizei, const GLshort *); -#define CALL_VertexAttribs4svNV(disp, parameters) \ - (* GET_VertexAttribs4svNV(disp)) parameters -static inline _glptr_VertexAttribs4svNV GET_VertexAttribs4svNV(struct _glapi_table *disp) { - return (_glptr_VertexAttribs4svNV) (GET_by_offset(disp, _gloffset_VertexAttribs4svNV)); -} - -static inline void SET_VertexAttribs4svNV(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLsizei, const GLshort *)) { - SET_by_offset(disp, _gloffset_VertexAttribs4svNV, fn); -} - -typedef void (GLAPIENTRYP _glptr_VertexAttribs4ubvNV)(GLuint, GLsizei, const GLubyte *); -#define CALL_VertexAttribs4ubvNV(disp, parameters) \ - (* GET_VertexAttribs4ubvNV(disp)) parameters -static inline _glptr_VertexAttribs4ubvNV GET_VertexAttribs4ubvNV(struct _glapi_table *disp) { - return (_glptr_VertexAttribs4ubvNV) (GET_by_offset(disp, _gloffset_VertexAttribs4ubvNV)); -} - -static inline void SET_VertexAttribs4ubvNV(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLsizei, const GLubyte *)) { - SET_by_offset(disp, _gloffset_VertexAttribs4ubvNV, fn); -} - typedef void (GLAPIENTRYP _glptr_PointParameteriNV)(GLenum, GLint); #define CALL_PointParameteriNV(disp, parameters) \ (* GET_PointParameteriNV(disp)) parameters @@ -7208,116 +5686,6 @@ static inline void SET_ActiveStencilFaceEXT(struct _glapi_table *disp, void (GLA SET_by_offset(disp, _gloffset_ActiveStencilFaceEXT, fn); } -typedef void (GLAPIENTRYP _glptr_BindVertexArrayAPPLE)(GLuint); -#define CALL_BindVertexArrayAPPLE(disp, parameters) \ - (* GET_BindVertexArrayAPPLE(disp)) parameters -static inline _glptr_BindVertexArrayAPPLE GET_BindVertexArrayAPPLE(struct _glapi_table *disp) { - return (_glptr_BindVertexArrayAPPLE) (GET_by_offset(disp, _gloffset_BindVertexArrayAPPLE)); -} - -static inline void SET_BindVertexArrayAPPLE(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint)) { - SET_by_offset(disp, _gloffset_BindVertexArrayAPPLE, fn); -} - -typedef void (GLAPIENTRYP _glptr_DeleteVertexArraysAPPLE)(GLsizei, const GLuint *); -#define CALL_DeleteVertexArraysAPPLE(disp, parameters) \ - (* GET_DeleteVertexArraysAPPLE(disp)) parameters -static inline _glptr_DeleteVertexArraysAPPLE GET_DeleteVertexArraysAPPLE(struct _glapi_table *disp) { - return (_glptr_DeleteVertexArraysAPPLE) (GET_by_offset(disp, _gloffset_DeleteVertexArraysAPPLE)); -} - -static inline void SET_DeleteVertexArraysAPPLE(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLsizei, const GLuint *)) { - SET_by_offset(disp, _gloffset_DeleteVertexArraysAPPLE, fn); -} - -typedef void (GLAPIENTRYP _glptr_GenVertexArraysAPPLE)(GLsizei, GLuint *); -#define CALL_GenVertexArraysAPPLE(disp, parameters) \ - (* GET_GenVertexArraysAPPLE(disp)) parameters -static inline _glptr_GenVertexArraysAPPLE GET_GenVertexArraysAPPLE(struct _glapi_table *disp) { - return (_glptr_GenVertexArraysAPPLE) (GET_by_offset(disp, _gloffset_GenVertexArraysAPPLE)); -} - -static inline void SET_GenVertexArraysAPPLE(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLsizei, GLuint *)) { - SET_by_offset(disp, _gloffset_GenVertexArraysAPPLE, fn); -} - -typedef GLboolean (GLAPIENTRYP _glptr_IsVertexArrayAPPLE)(GLuint); -#define CALL_IsVertexArrayAPPLE(disp, parameters) \ - (* GET_IsVertexArrayAPPLE(disp)) parameters -static inline _glptr_IsVertexArrayAPPLE GET_IsVertexArrayAPPLE(struct _glapi_table *disp) { - return (_glptr_IsVertexArrayAPPLE) (GET_by_offset(disp, _gloffset_IsVertexArrayAPPLE)); -} - -static inline void SET_IsVertexArrayAPPLE(struct _glapi_table *disp, GLboolean (GLAPIENTRYP fn)(GLuint)) { - SET_by_offset(disp, _gloffset_IsVertexArrayAPPLE, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetProgramNamedParameterdvNV)(GLuint, GLsizei, const GLubyte *, GLdouble *); -#define CALL_GetProgramNamedParameterdvNV(disp, parameters) \ - (* GET_GetProgramNamedParameterdvNV(disp)) parameters -static inline _glptr_GetProgramNamedParameterdvNV GET_GetProgramNamedParameterdvNV(struct _glapi_table *disp) { - return (_glptr_GetProgramNamedParameterdvNV) (GET_by_offset(disp, _gloffset_GetProgramNamedParameterdvNV)); -} - -static inline void SET_GetProgramNamedParameterdvNV(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLsizei, const GLubyte *, GLdouble *)) { - SET_by_offset(disp, _gloffset_GetProgramNamedParameterdvNV, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetProgramNamedParameterfvNV)(GLuint, GLsizei, const GLubyte *, GLfloat *); -#define CALL_GetProgramNamedParameterfvNV(disp, parameters) \ - (* GET_GetProgramNamedParameterfvNV(disp)) parameters -static inline _glptr_GetProgramNamedParameterfvNV GET_GetProgramNamedParameterfvNV(struct _glapi_table *disp) { - return (_glptr_GetProgramNamedParameterfvNV) (GET_by_offset(disp, _gloffset_GetProgramNamedParameterfvNV)); -} - -static inline void SET_GetProgramNamedParameterfvNV(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLsizei, const GLubyte *, GLfloat *)) { - SET_by_offset(disp, _gloffset_GetProgramNamedParameterfvNV, fn); -} - -typedef void (GLAPIENTRYP _glptr_ProgramNamedParameter4dNV)(GLuint, GLsizei, const GLubyte *, GLdouble, GLdouble, GLdouble, GLdouble); -#define CALL_ProgramNamedParameter4dNV(disp, parameters) \ - (* GET_ProgramNamedParameter4dNV(disp)) parameters -static inline _glptr_ProgramNamedParameter4dNV GET_ProgramNamedParameter4dNV(struct _glapi_table *disp) { - return (_glptr_ProgramNamedParameter4dNV) (GET_by_offset(disp, _gloffset_ProgramNamedParameter4dNV)); -} - -static inline void SET_ProgramNamedParameter4dNV(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLsizei, const GLubyte *, GLdouble, GLdouble, GLdouble, GLdouble)) { - SET_by_offset(disp, _gloffset_ProgramNamedParameter4dNV, fn); -} - -typedef void (GLAPIENTRYP _glptr_ProgramNamedParameter4dvNV)(GLuint, GLsizei, const GLubyte *, const GLdouble *); -#define CALL_ProgramNamedParameter4dvNV(disp, parameters) \ - (* GET_ProgramNamedParameter4dvNV(disp)) parameters -static inline _glptr_ProgramNamedParameter4dvNV GET_ProgramNamedParameter4dvNV(struct _glapi_table *disp) { - return (_glptr_ProgramNamedParameter4dvNV) (GET_by_offset(disp, _gloffset_ProgramNamedParameter4dvNV)); -} - -static inline void SET_ProgramNamedParameter4dvNV(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLsizei, const GLubyte *, const GLdouble *)) { - SET_by_offset(disp, _gloffset_ProgramNamedParameter4dvNV, fn); -} - -typedef void (GLAPIENTRYP _glptr_ProgramNamedParameter4fNV)(GLuint, GLsizei, const GLubyte *, GLfloat, GLfloat, GLfloat, GLfloat); -#define CALL_ProgramNamedParameter4fNV(disp, parameters) \ - (* GET_ProgramNamedParameter4fNV(disp)) parameters -static inline _glptr_ProgramNamedParameter4fNV GET_ProgramNamedParameter4fNV(struct _glapi_table *disp) { - return (_glptr_ProgramNamedParameter4fNV) (GET_by_offset(disp, _gloffset_ProgramNamedParameter4fNV)); -} - -static inline void SET_ProgramNamedParameter4fNV(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLsizei, const GLubyte *, GLfloat, GLfloat, GLfloat, GLfloat)) { - SET_by_offset(disp, _gloffset_ProgramNamedParameter4fNV, fn); -} - -typedef void (GLAPIENTRYP _glptr_ProgramNamedParameter4fvNV)(GLuint, GLsizei, const GLubyte *, const GLfloat *); -#define CALL_ProgramNamedParameter4fvNV(disp, parameters) \ - (* GET_ProgramNamedParameter4fvNV(disp)) parameters -static inline _glptr_ProgramNamedParameter4fvNV GET_ProgramNamedParameter4fvNV(struct _glapi_table *disp) { - return (_glptr_ProgramNamedParameter4fvNV) (GET_by_offset(disp, _gloffset_ProgramNamedParameter4fvNV)); -} - -static inline void SET_ProgramNamedParameter4fvNV(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLsizei, const GLubyte *, const GLfloat *)) { - SET_by_offset(disp, _gloffset_ProgramNamedParameter4fvNV, fn); -} - typedef void (GLAPIENTRYP _glptr_DepthBoundsEXT)(GLclampd, GLclampd); #define CALL_DepthBoundsEXT(disp, parameters) \ (* GET_DepthBoundsEXT(disp)) parameters @@ -7329,17 +5697,6 @@ static inline void SET_DepthBoundsEXT(struct _glapi_table *disp, void (GLAPIENTR SET_by_offset(disp, _gloffset_DepthBoundsEXT, fn); } -typedef void (GLAPIENTRYP _glptr_BlendEquationSeparateEXT)(GLenum, GLenum); -#define CALL_BlendEquationSeparateEXT(disp, parameters) \ - (* GET_BlendEquationSeparateEXT(disp)) parameters -static inline _glptr_BlendEquationSeparateEXT GET_BlendEquationSeparateEXT(struct _glapi_table *disp) { - return (_glptr_BlendEquationSeparateEXT) (GET_by_offset(disp, _gloffset_BlendEquationSeparateEXT)); -} - -static inline void SET_BlendEquationSeparateEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum)) { - SET_by_offset(disp, _gloffset_BlendEquationSeparateEXT, fn); -} - typedef void (GLAPIENTRYP _glptr_BufferParameteriAPPLE)(GLenum, GLenum, GLint); #define CALL_BufferParameteriAPPLE(disp, parameters) \ (* GET_BufferParameteriAPPLE(disp)) parameters @@ -7472,60 +5829,5 @@ static inline void SET_TextureRangeAPPLE(struct _glapi_table *disp, void (GLAPIE SET_by_offset(disp, _gloffset_TextureRangeAPPLE, fn); } -typedef void (GLAPIENTRYP _glptr_GetObjectParameterivAPPLE)(GLenum, GLuint, GLenum, GLint *); -#define CALL_GetObjectParameterivAPPLE(disp, parameters) \ - (* GET_GetObjectParameterivAPPLE(disp)) parameters -static inline _glptr_GetObjectParameterivAPPLE GET_GetObjectParameterivAPPLE(struct _glapi_table *disp) { - return (_glptr_GetObjectParameterivAPPLE) (GET_by_offset(disp, _gloffset_GetObjectParameterivAPPLE)); -} - -static inline void SET_GetObjectParameterivAPPLE(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLuint, GLenum, GLint *)) { - SET_by_offset(disp, _gloffset_GetObjectParameterivAPPLE, fn); -} - -typedef GLenum (GLAPIENTRYP _glptr_ObjectPurgeableAPPLE)(GLenum, GLuint, GLenum); -#define CALL_ObjectPurgeableAPPLE(disp, parameters) \ - (* GET_ObjectPurgeableAPPLE(disp)) parameters -static inline _glptr_ObjectPurgeableAPPLE GET_ObjectPurgeableAPPLE(struct _glapi_table *disp) { - return (_glptr_ObjectPurgeableAPPLE) (GET_by_offset(disp, _gloffset_ObjectPurgeableAPPLE)); -} - -static inline void SET_ObjectPurgeableAPPLE(struct _glapi_table *disp, GLenum (GLAPIENTRYP fn)(GLenum, GLuint, GLenum)) { - SET_by_offset(disp, _gloffset_ObjectPurgeableAPPLE, fn); -} - -typedef GLenum (GLAPIENTRYP _glptr_ObjectUnpurgeableAPPLE)(GLenum, GLuint, GLenum); -#define CALL_ObjectUnpurgeableAPPLE(disp, parameters) \ - (* GET_ObjectUnpurgeableAPPLE(disp)) parameters -static inline _glptr_ObjectUnpurgeableAPPLE GET_ObjectUnpurgeableAPPLE(struct _glapi_table *disp) { - return (_glptr_ObjectUnpurgeableAPPLE) (GET_by_offset(disp, _gloffset_ObjectUnpurgeableAPPLE)); -} - -static inline void SET_ObjectUnpurgeableAPPLE(struct _glapi_table *disp, GLenum (GLAPIENTRYP fn)(GLenum, GLuint, GLenum)) { - SET_by_offset(disp, _gloffset_ObjectUnpurgeableAPPLE, fn); -} - -typedef GLuint (GLAPIENTRYP _glptr_CreateShaderProgramEXT)(GLenum, const GLchar *); -#define CALL_CreateShaderProgramEXT(disp, parameters) \ - (* GET_CreateShaderProgramEXT(disp)) parameters -static inline _glptr_CreateShaderProgramEXT GET_CreateShaderProgramEXT(struct _glapi_table *disp) { - return (_glptr_CreateShaderProgramEXT) (GET_by_offset(disp, _gloffset_CreateShaderProgramEXT)); -} - -static inline void SET_CreateShaderProgramEXT(struct _glapi_table *disp, GLuint (GLAPIENTRYP fn)(GLenum, const GLchar *)) { - SET_by_offset(disp, _gloffset_CreateShaderProgramEXT, fn); -} - -typedef void (GLAPIENTRYP _glptr_TextureBarrierNV)(void); -#define CALL_TextureBarrierNV(disp, parameters) \ - (* GET_TextureBarrierNV(disp)) parameters -static inline _glptr_TextureBarrierNV GET_TextureBarrierNV(struct _glapi_table *disp) { - return (_glptr_TextureBarrierNV) (GET_by_offset(disp, _gloffset_TextureBarrierNV)); -} - -static inline void SET_TextureBarrierNV(struct _glapi_table *disp, void (GLAPIENTRYP fn)(void)) { - SET_by_offset(disp, _gloffset_TextureBarrierNV, fn); -} - #endif /* !defined( _DISPATCH_H_ ) */ diff --git a/dll/opengl/mesa/main/dlist.c b/dll/opengl/mesa/main/dlist.c index b3d8f355057..ee3a7ade5cc 100644 --- a/dll/opengl/mesa/main/dlist.c +++ b/dll/opengl/mesa/main/dlist.c @@ -146,10 +146,7 @@ typedef enum OPCODE_ALPHA_FUNC, OPCODE_BIND_TEXTURE, OPCODE_BITMAP, - OPCODE_BLEND_COLOR, - OPCODE_BLEND_EQUATION, - OPCODE_BLEND_EQUATION_SEPARATE, - OPCODE_BLEND_FUNC_SEPARATE, + OPCODE_BLEND_FUNC, OPCODE_CALL_LIST, OPCODE_CALL_LIST_OFFSET, @@ -162,24 +159,11 @@ typedef enum OPCODE_CLIP_PLANE, OPCODE_COLOR_MASK, OPCODE_COLOR_MATERIAL, - OPCODE_COLOR_TABLE, - OPCODE_COLOR_TABLE_PARAMETER_FV, - OPCODE_COLOR_TABLE_PARAMETER_IV, - OPCODE_COLOR_SUB_TABLE, - OPCODE_CONVOLUTION_FILTER_1D, - OPCODE_CONVOLUTION_FILTER_2D, - OPCODE_CONVOLUTION_PARAMETER_I, - OPCODE_CONVOLUTION_PARAMETER_IV, - OPCODE_CONVOLUTION_PARAMETER_F, - OPCODE_CONVOLUTION_PARAMETER_FV, - OPCODE_COPY_COLOR_SUB_TABLE, - OPCODE_COPY_COLOR_TABLE, OPCODE_COPY_PIXELS, OPCODE_COPY_TEX_IMAGE1D, OPCODE_COPY_TEX_IMAGE2D, OPCODE_COPY_TEX_SUB_IMAGE1D, OPCODE_COPY_TEX_SUB_IMAGE2D, - OPCODE_COPY_TEX_SUB_IMAGE3D, OPCODE_CULL_FACE, OPCODE_DEPTH_FUNC, OPCODE_DEPTH_MASK, @@ -194,7 +178,6 @@ typedef enum OPCODE_FRONT_FACE, OPCODE_FRUSTUM, OPCODE_HINT, - OPCODE_HISTOGRAM, OPCODE_INDEX_MASK, OPCODE_INIT_NAMES, OPCODE_LIGHT, @@ -211,7 +194,6 @@ typedef enum OPCODE_MAPGRID1, OPCODE_MAPGRID2, OPCODE_MATRIX_MODE, - OPCODE_MIN_MAX, OPCODE_MULT_MATRIX, OPCODE_ORTHO, OPCODE_PASSTHROUGH, @@ -232,8 +214,6 @@ typedef enum OPCODE_PUSH_NAME, OPCODE_RASTER_POS, OPCODE_READ_BUFFER, - OPCODE_RESET_HISTOGRAM, - OPCODE_RESET_MIN_MAX, OPCODE_ROTATE, OPCODE_SCALE, OPCODE_SCISSOR, @@ -248,10 +228,8 @@ typedef enum OPCODE_TEXPARAMETER, OPCODE_TEX_IMAGE1D, OPCODE_TEX_IMAGE2D, - OPCODE_TEX_IMAGE3D, OPCODE_TEX_SUB_IMAGE1D, OPCODE_TEX_SUB_IMAGE2D, - OPCODE_TEX_SUB_IMAGE3D, OPCODE_TRANSLATE, OPCODE_VIEWPORT, OPCODE_WINDOW_POS, @@ -284,9 +262,6 @@ typedef enum OPCODE_TEXPARAMETER_I, OPCODE_TEXPARAMETER_UI, - /* GL_NV_texture_barrier */ - OPCODE_TEXTURE_BARRIER_NV, - /* The following three are meta instructions */ OPCODE_ERROR, /* raise compiled-in error */ OPCODE_CONTINUE, @@ -474,22 +449,6 @@ _mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist) free(n[7].data); n += InstSize[n[0].opcode]; break; - case OPCODE_COLOR_TABLE: - free(n[6].data); - n += InstSize[n[0].opcode]; - break; - case OPCODE_COLOR_SUB_TABLE: - free(n[6].data); - n += InstSize[n[0].opcode]; - break; - case OPCODE_CONVOLUTION_FILTER_1D: - free(n[6].data); - n += InstSize[n[0].opcode]; - break; - case OPCODE_CONVOLUTION_FILTER_2D: - free(n[7].data); - n += InstSize[n[0].opcode]; - break; case OPCODE_POLYGON_STIPPLE: free(n[1].data); n += InstSize[n[0].opcode]; @@ -502,10 +461,6 @@ _mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist) free(n[9].data); n += InstSize[n[0].opcode]; break; - case OPCODE_TEX_IMAGE3D: - free(n[10].data); - n += InstSize[n[0].opcode]; - break; case OPCODE_TEX_SUB_IMAGE1D: free(n[7].data); n += InstSize[n[0].opcode]; @@ -514,10 +469,6 @@ _mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist) free(n[9].data); n += InstSize[n[0].opcode]; break; - case OPCODE_TEX_SUB_IMAGE3D: - free(n[11].data); - n += InstSize[n[0].opcode]; - break; case OPCODE_CONTINUE: n = (Node *) n[1].next; free(block); @@ -854,85 +805,23 @@ save_Bitmap(GLsizei width, GLsizei height, } -static void GLAPIENTRY -save_BlendEquation(GLenum mode) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_BLEND_EQUATION, 1); - if (n) { - n[1].e = mode; - } - if (ctx->ExecuteFlag) { - CALL_BlendEquation(ctx->Exec, (mode)); - } -} - - -static void GLAPIENTRY -save_BlendEquationSeparateEXT(GLenum modeRGB, GLenum modeA) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_BLEND_EQUATION_SEPARATE, 2); - if (n) { - n[1].e = modeRGB; - n[2].e = modeA; - } - if (ctx->ExecuteFlag) { - CALL_BlendEquationSeparateEXT(ctx->Exec, (modeRGB, modeA)); - } -} - - -static void GLAPIENTRY -save_BlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB, - GLenum sfactorA, GLenum dfactorA) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_BLEND_FUNC_SEPARATE, 4); - if (n) { - n[1].e = sfactorRGB; - n[2].e = dfactorRGB; - n[3].e = sfactorA; - n[4].e = dfactorA; - } - if (ctx->ExecuteFlag) { - CALL_BlendFuncSeparateEXT(ctx->Exec, - (sfactorRGB, dfactorRGB, sfactorA, dfactorA)); - } -} - - static void GLAPIENTRY save_BlendFunc(GLenum srcfactor, GLenum dstfactor) -{ - save_BlendFuncSeparateEXT(srcfactor, dstfactor, srcfactor, dstfactor); -} - - -static void GLAPIENTRY -save_BlendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) { GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_BLEND_COLOR, 4); + n = alloc_instruction(ctx, OPCODE_BLEND_FUNC, 2); if (n) { - n[1].f = red; - n[2].f = green; - n[3].f = blue; - n[4].f = alpha; + n[1].e = srcfactor; + n[2].e = dstfactor; } if (ctx->ExecuteFlag) { - CALL_BlendColor(ctx->Exec, (red, green, blue, alpha)); + CALL_BlendFunc(ctx->Exec, (srcfactor, dstfactor)); } } + static void invalidate_saved_current_state( struct gl_context *ctx ) { GLint i; @@ -1178,313 +1067,6 @@ save_ColorMaterial(GLenum face, GLenum mode) } -static void GLAPIENTRY -save_ColorTable(GLenum target, GLenum internalFormat, - GLsizei width, GLenum format, GLenum type, - const GLvoid * table) -{ - GET_CURRENT_CONTEXT(ctx); - if (_mesa_is_proxy_texture(target)) { - /* execute immediately */ - CALL_ColorTable(ctx->Exec, (target, internalFormat, width, - format, type, table)); - } - else { - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_COLOR_TABLE, 6); - if (n) { - n[1].e = target; - n[2].e = internalFormat; - n[3].i = width; - n[4].e = format; - n[5].e = type; - n[6].data = unpack_image(ctx, 1, width, 1, 1, format, type, table, - &ctx->Unpack); - } - if (ctx->ExecuteFlag) { - CALL_ColorTable(ctx->Exec, (target, internalFormat, width, - format, type, table)); - } - } -} - - - -static void GLAPIENTRY -save_ColorTableParameterfv(GLenum target, GLenum pname, - const GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - - n = alloc_instruction(ctx, OPCODE_COLOR_TABLE_PARAMETER_FV, 6); - if (n) { - n[1].e = target; - n[2].e = pname; - n[3].f = params[0]; - if (pname == GL_COLOR_TABLE_SGI || - pname == GL_POST_CONVOLUTION_COLOR_TABLE_SGI || - pname == GL_TEXTURE_COLOR_TABLE_SGI) { - n[4].f = params[1]; - n[5].f = params[2]; - n[6].f = params[3]; - } - } - - if (ctx->ExecuteFlag) { - CALL_ColorTableParameterfv(ctx->Exec, (target, pname, params)); - } -} - - -static void GLAPIENTRY -save_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - - n = alloc_instruction(ctx, OPCODE_COLOR_TABLE_PARAMETER_IV, 6); - if (n) { - n[1].e = target; - n[2].e = pname; - n[3].i = params[0]; - if (pname == GL_COLOR_TABLE_SGI || - pname == GL_POST_CONVOLUTION_COLOR_TABLE_SGI || - pname == GL_TEXTURE_COLOR_TABLE_SGI) { - n[4].i = params[1]; - n[5].i = params[2]; - n[6].i = params[3]; - } - } - - if (ctx->ExecuteFlag) { - CALL_ColorTableParameteriv(ctx->Exec, (target, pname, params)); - } -} - - - -static void GLAPIENTRY -save_ColorSubTable(GLenum target, GLsizei start, GLsizei count, - GLenum format, GLenum type, const GLvoid * table) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_COLOR_SUB_TABLE, 6); - if (n) { - n[1].e = target; - n[2].i = start; - n[3].i = count; - n[4].e = format; - n[5].e = type; - n[6].data = unpack_image(ctx, 1, count, 1, 1, format, type, table, - &ctx->Unpack); - } - if (ctx->ExecuteFlag) { - CALL_ColorSubTable(ctx->Exec, - (target, start, count, format, type, table)); - } -} - - -static void GLAPIENTRY -save_CopyColorSubTable(GLenum target, GLsizei start, - GLint x, GLint y, GLsizei width) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_COPY_COLOR_SUB_TABLE, 5); - if (n) { - n[1].e = target; - n[2].i = start; - n[3].i = x; - n[4].i = y; - n[5].i = width; - } - if (ctx->ExecuteFlag) { - CALL_CopyColorSubTable(ctx->Exec, (target, start, x, y, width)); - } -} - - -static void GLAPIENTRY -save_CopyColorTable(GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_COPY_COLOR_TABLE, 5); - if (n) { - n[1].e = target; - n[2].e = internalformat; - n[3].i = x; - n[4].i = y; - n[5].i = width; - } - if (ctx->ExecuteFlag) { - CALL_CopyColorTable(ctx->Exec, (target, internalformat, x, y, width)); - } -} - - -static void GLAPIENTRY -save_ConvolutionFilter1D(GLenum target, GLenum internalFormat, GLsizei width, - GLenum format, GLenum type, const GLvoid * filter) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - - n = alloc_instruction(ctx, OPCODE_CONVOLUTION_FILTER_1D, 6); - if (n) { - n[1].e = target; - n[2].e = internalFormat; - n[3].i = width; - n[4].e = format; - n[5].e = type; - n[6].data = unpack_image(ctx, 1, width, 1, 1, format, type, filter, - &ctx->Unpack); - } - if (ctx->ExecuteFlag) { - CALL_ConvolutionFilter1D(ctx->Exec, (target, internalFormat, width, - format, type, filter)); - } -} - - -static void GLAPIENTRY -save_ConvolutionFilter2D(GLenum target, GLenum internalFormat, - GLsizei width, GLsizei height, GLenum format, - GLenum type, const GLvoid * filter) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - - n = alloc_instruction(ctx, OPCODE_CONVOLUTION_FILTER_2D, 7); - if (n) { - n[1].e = target; - n[2].e = internalFormat; - n[3].i = width; - n[4].i = height; - n[5].e = format; - n[6].e = type; - n[7].data = unpack_image(ctx, 2, width, height, 1, format, type, filter, - &ctx->Unpack); - } - if (ctx->ExecuteFlag) { - CALL_ConvolutionFilter2D(ctx->Exec, - (target, internalFormat, width, height, format, - type, filter)); - } -} - - -static void GLAPIENTRY -save_ConvolutionParameteri(GLenum target, GLenum pname, GLint param) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_I, 3); - if (n) { - n[1].e = target; - n[2].e = pname; - n[3].i = param; - } - if (ctx->ExecuteFlag) { - CALL_ConvolutionParameteri(ctx->Exec, (target, pname, param)); - } -} - - -static void GLAPIENTRY -save_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_IV, 6); - if (n) { - n[1].e = target; - n[2].e = pname; - n[3].i = params[0]; - if (pname == GL_CONVOLUTION_BORDER_COLOR || - pname == GL_CONVOLUTION_FILTER_SCALE || - pname == GL_CONVOLUTION_FILTER_BIAS) { - n[4].i = params[1]; - n[5].i = params[2]; - n[6].i = params[3]; - } - else { - n[4].i = n[5].i = n[6].i = 0; - } - } - if (ctx->ExecuteFlag) { - CALL_ConvolutionParameteriv(ctx->Exec, (target, pname, params)); - } -} - - -static void GLAPIENTRY -save_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat param) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_F, 3); - if (n) { - n[1].e = target; - n[2].e = pname; - n[3].f = param; - } - if (ctx->ExecuteFlag) { - CALL_ConvolutionParameterf(ctx->Exec, (target, pname, param)); - } -} - - -static void GLAPIENTRY -save_ConvolutionParameterfv(GLenum target, GLenum pname, - const GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_FV, 6); - if (n) { - n[1].e = target; - n[2].e = pname; - n[3].f = params[0]; - if (pname == GL_CONVOLUTION_BORDER_COLOR || - pname == GL_CONVOLUTION_FILTER_SCALE || - pname == GL_CONVOLUTION_FILTER_BIAS) { - n[4].f = params[1]; - n[5].f = params[2]; - n[6].f = params[3]; - } - else { - n[4].f = n[5].f = n[6].f = 0.0F; - } - } - if (ctx->ExecuteFlag) { - CALL_ConvolutionParameterfv(ctx->Exec, (target, pname, params)); - } -} - - static void GLAPIENTRY save_CopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type) { @@ -1607,34 +1189,6 @@ save_CopyTexSubImage2D(GLenum target, GLint level, } -static void GLAPIENTRY -save_CopyTexSubImage3D(GLenum target, GLint level, - GLint xoffset, GLint yoffset, GLint zoffset, - GLint x, GLint y, GLsizei width, GLint height) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_COPY_TEX_SUB_IMAGE3D, 9); - if (n) { - n[1].e = target; - n[2].i = level; - n[3].i = xoffset; - n[4].i = yoffset; - n[5].i = zoffset; - n[6].i = x; - n[7].i = y; - n[8].i = width; - n[9].i = height; - } - if (ctx->ExecuteFlag) { - CALL_CopyTexSubImage3D(ctx->Exec, (target, level, - xoffset, yoffset, zoffset, - x, y, width, height)); - } -} - - static void GLAPIENTRY save_CullFace(GLenum mode) { @@ -1938,27 +1492,6 @@ save_Hint(GLenum target, GLenum mode) } -static void GLAPIENTRY -save_Histogram(GLenum target, GLsizei width, GLenum internalFormat, - GLboolean sink) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_HISTOGRAM, 4); - if (n) { - n[1].e = target; - n[2].i = width; - n[3].e = internalFormat; - n[4].b = sink; - } - if (ctx->ExecuteFlag) { - CALL_Histogram(ctx->Exec, (target, width, internalFormat, sink)); - } -} - - static void GLAPIENTRY save_IndexMask(GLuint mask) { @@ -2475,25 +2008,6 @@ save_MatrixMode(GLenum mode) } -static void GLAPIENTRY -save_Minmax(GLenum target, GLenum internalFormat, GLboolean sink) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_MIN_MAX, 3); - if (n) { - n[1].e = target; - n[2].e = internalFormat; - n[3].b = sink; - } - if (ctx->ExecuteFlag) { - CALL_Minmax(ctx->Exec, (target, internalFormat, sink)); - } -} - - static void GLAPIENTRY save_MultMatrixf(const GLfloat * m) { @@ -3075,38 +2589,6 @@ save_ReadBuffer(GLenum mode) } -static void GLAPIENTRY -save_ResetHistogram(GLenum target) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_RESET_HISTOGRAM, 1); - if (n) { - n[1].e = target; - } - if (ctx->ExecuteFlag) { - CALL_ResetHistogram(ctx->Exec, (target)); - } -} - - -static void GLAPIENTRY -save_ResetMinmax(GLenum target) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_RESET_MIN_MAX, 1); - if (n) { - n[1].e = target; - } - if (ctx->ExecuteFlag) { - CALL_ResetMinmax(ctx->Exec, (target)); - } -} - - static void GLAPIENTRY save_Rotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) { @@ -3519,46 +3001,6 @@ save_TexImage2D(GLenum target, } -static void GLAPIENTRY -save_TexImage3D(GLenum target, - GLint level, GLint internalFormat, - GLsizei width, GLsizei height, GLsizei depth, - GLint border, - GLenum format, GLenum type, const GLvoid * pixels) -{ - GET_CURRENT_CONTEXT(ctx); - if (target == GL_PROXY_TEXTURE_3D) { - /* don't compile, execute immediately */ - CALL_TexImage3D(ctx->Exec, (target, level, internalFormat, width, - height, depth, border, format, type, - pixels)); - } - else { - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_TEX_IMAGE3D, 10); - if (n) { - n[1].e = target; - n[2].i = level; - n[3].i = (GLint) internalFormat; - n[4].i = (GLint) width; - n[5].i = (GLint) height; - n[6].i = (GLint) depth; - n[7].i = border; - n[8].e = format; - n[9].e = type; - n[10].data = unpack_image(ctx, 3, width, height, depth, format, type, - pixels, &ctx->Unpack); - } - if (ctx->ExecuteFlag) { - CALL_TexImage3D(ctx->Exec, (target, level, internalFormat, width, - height, depth, border, format, type, - pixels)); - } - } -} - - static void GLAPIENTRY save_TexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, @@ -3618,41 +3060,6 @@ save_TexSubImage2D(GLenum target, GLint level, } -static void GLAPIENTRY -save_TexSubImage3D(GLenum target, GLint level, - GLint xoffset, GLint yoffset, GLint zoffset, - GLsizei width, GLsizei height, GLsizei depth, - GLenum format, GLenum type, const GLvoid * pixels) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - - n = alloc_instruction(ctx, OPCODE_TEX_SUB_IMAGE3D, 11); - if (n) { - n[1].e = target; - n[2].i = level; - n[3].i = xoffset; - n[4].i = yoffset; - n[5].i = zoffset; - n[6].i = (GLint) width; - n[7].i = (GLint) height; - n[8].i = (GLint) depth; - n[9].e = format; - n[10].e = type; - n[11].data = unpack_image(ctx, 3, width, height, depth, format, type, - pixels, &ctx->Unpack); - } - if (ctx->ExecuteFlag) { - CALL_TexSubImage3D(ctx->Exec, (target, level, - xoffset, yoffset, zoffset, - width, height, depth, format, type, - pixels)); - } -} - - static void GLAPIENTRY save_Translatef(GLfloat x, GLfloat y, GLfloat z) { @@ -3913,69 +3320,6 @@ save_SampleCoverageARB(GLclampf value, GLboolean invert) } -/* - * GL_NV_vertex_program - */ - -#if FEATURE_NV_fragment_program -static void GLAPIENTRY -save_ProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte * name, - GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - - n = alloc_instruction(ctx, OPCODE_PROGRAM_NAMED_PARAMETER_NV, 6); - if (n) { - GLubyte *nameCopy = (GLubyte *) malloc(len); - if (!nameCopy) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramNamedParameter4fNV"); - return; - } - memcpy(nameCopy, name, len); - n[1].ui = id; - n[2].i = len; - n[3].data = nameCopy; - n[4].f = x; - n[5].f = y; - n[6].f = z; - n[7].f = w; - } - if (ctx->ExecuteFlag) { - CALL_ProgramNamedParameter4fNV(ctx->Exec, (id, len, name, x, y, z, w)); - } -} - -static void GLAPIENTRY -save_ProgramNamedParameter4fvNV(GLuint id, GLsizei len, const GLubyte * name, - const float v[]) -{ - save_ProgramNamedParameter4fNV(id, len, name, v[0], v[1], v[2], v[3]); -} - - -static void GLAPIENTRY -save_ProgramNamedParameter4dNV(GLuint id, GLsizei len, const GLubyte * name, - GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - save_ProgramNamedParameter4fNV(id, len, name, (GLfloat) x, (GLfloat) y, - (GLfloat) z, (GLfloat) w); -} - - -static void GLAPIENTRY -save_ProgramNamedParameter4dvNV(GLuint id, GLsizei len, const GLubyte * name, - const double v[]) -{ - save_ProgramNamedParameter4fNV(id, len, name, (GLfloat) v[0], - (GLfloat) v[1], (GLfloat) v[2], - (GLfloat) v[3]); -} -#endif - - /* GL_EXT_depth_bounds_test */ static void GLAPIENTRY save_DepthBoundsEXT(GLclampd zmin, GLclampd zmax) @@ -4447,37 +3791,25 @@ save_FogCoordfvEXT(const GLfloat * v) static void GLAPIENTRY save_Color3f(GLfloat x, GLfloat y, GLfloat z) { - save_Attr3fNV(VERT_ATTRIB_COLOR0, x, y, z); + save_Attr3fNV(VERT_ATTRIB_COLOR, x, y, z); } static void GLAPIENTRY save_Color3fv(const GLfloat * v) { - save_Attr3fNV(VERT_ATTRIB_COLOR0, v[0], v[1], v[2]); + save_Attr3fNV(VERT_ATTRIB_COLOR, v[0], v[1], v[2]); } static void GLAPIENTRY save_Color4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) { - save_Attr4fNV(VERT_ATTRIB_COLOR0, x, y, z, w); + save_Attr4fNV(VERT_ATTRIB_COLOR, x, y, z, w); } static void GLAPIENTRY save_Color4fv(const GLfloat * v) { - save_Attr4fNV(VERT_ATTRIB_COLOR0, v[0], v[1], v[2], v[3]); -} - -static void GLAPIENTRY -save_SecondaryColor3fEXT(GLfloat x, GLfloat y, GLfloat z) -{ - save_Attr3fNV(VERT_ATTRIB_COLOR1, x, y, z); -} - -static void GLAPIENTRY -save_SecondaryColor3fvEXT(const GLfloat * v) -{ - save_Attr3fNV(VERT_ATTRIB_COLOR1, v[0], v[1], v[2]); + save_Attr4fNV(VERT_ATTRIB_COLOR, v[0], v[1], v[2], v[3]); } @@ -4669,19 +4001,6 @@ exec_GetTexParameterIuiv(GLenum target, GLenum pname, GLuint *params) CALL_GetTexParameterIuivEXT(ctx->Exec, (target, pname, params)); } - -/* GL_NV_texture_barrier */ -static void GLAPIENTRY -save_TextureBarrierNV(void) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - alloc_instruction(ctx, OPCODE_TEXTURE_BARRIER_NV, 0); - if (ctx->ExecuteFlag) { - CALL_TextureBarrierNV(ctx->Exec, ()); - } -} - /** * Save an error-generating command into display list. * @@ -4797,20 +4116,9 @@ execute_list(struct gl_context *ctx, GLuint list) ctx->Unpack = save; /* restore */ } break; - case OPCODE_BLEND_COLOR: - CALL_BlendColor(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f)); + case OPCODE_BLEND_FUNC: + CALL_BlendFunc(ctx->Exec, (n[1].e, n[2].e)); break; - case OPCODE_BLEND_EQUATION: - CALL_BlendEquation(ctx->Exec, (n[1].e)); - break; - case OPCODE_BLEND_EQUATION_SEPARATE: - CALL_BlendEquationSeparateEXT(ctx->Exec, (n[1].e, n[2].e)); - break; - case OPCODE_BLEND_FUNC_SEPARATE: - CALL_BlendFuncSeparateEXT(ctx->Exec, - (n[1].e, n[2].e, n[3].e, n[4].e)); - break; - case OPCODE_CALL_LIST: /* Generated by glCallList(), don't add ListBase */ if (ctx->ListState.CallDepth < MAX_LIST_NESTING) { @@ -4862,102 +4170,6 @@ execute_list(struct gl_context *ctx, GLuint list) case OPCODE_COLOR_MATERIAL: CALL_ColorMaterial(ctx->Exec, (n[1].e, n[2].e)); break; - case OPCODE_COLOR_TABLE: - { - const struct gl_pixelstore_attrib save = ctx->Unpack; - ctx->Unpack = ctx->DefaultPacking; - CALL_ColorTable(ctx->Exec, (n[1].e, n[2].e, n[3].i, n[4].e, - n[5].e, n[6].data)); - ctx->Unpack = save; /* restore */ - } - break; - case OPCODE_COLOR_TABLE_PARAMETER_FV: - { - GLfloat params[4]; - params[0] = n[3].f; - params[1] = n[4].f; - params[2] = n[5].f; - params[3] = n[6].f; - CALL_ColorTableParameterfv(ctx->Exec, - (n[1].e, n[2].e, params)); - } - break; - case OPCODE_COLOR_TABLE_PARAMETER_IV: - { - GLint params[4]; - params[0] = n[3].i; - params[1] = n[4].i; - params[2] = n[5].i; - params[3] = n[6].i; - CALL_ColorTableParameteriv(ctx->Exec, - (n[1].e, n[2].e, params)); - } - break; - case OPCODE_COLOR_SUB_TABLE: - { - const struct gl_pixelstore_attrib save = ctx->Unpack; - ctx->Unpack = ctx->DefaultPacking; - CALL_ColorSubTable(ctx->Exec, (n[1].e, n[2].i, n[3].i, - n[4].e, n[5].e, n[6].data)); - ctx->Unpack = save; /* restore */ - } - break; - case OPCODE_CONVOLUTION_FILTER_1D: - { - const struct gl_pixelstore_attrib save = ctx->Unpack; - ctx->Unpack = ctx->DefaultPacking; - CALL_ConvolutionFilter1D(ctx->Exec, (n[1].e, n[2].i, n[3].i, - n[4].e, n[5].e, - n[6].data)); - ctx->Unpack = save; /* restore */ - } - break; - case OPCODE_CONVOLUTION_FILTER_2D: - { - const struct gl_pixelstore_attrib save = ctx->Unpack; - ctx->Unpack = ctx->DefaultPacking; - CALL_ConvolutionFilter2D(ctx->Exec, (n[1].e, n[2].i, n[3].i, - n[4].i, n[5].e, n[6].e, - n[7].data)); - ctx->Unpack = save; /* restore */ - } - break; - case OPCODE_CONVOLUTION_PARAMETER_I: - CALL_ConvolutionParameteri(ctx->Exec, (n[1].e, n[2].e, n[3].i)); - break; - case OPCODE_CONVOLUTION_PARAMETER_IV: - { - GLint params[4]; - params[0] = n[3].i; - params[1] = n[4].i; - params[2] = n[5].i; - params[3] = n[6].i; - CALL_ConvolutionParameteriv(ctx->Exec, - (n[1].e, n[2].e, params)); - } - break; - case OPCODE_CONVOLUTION_PARAMETER_F: - CALL_ConvolutionParameterf(ctx->Exec, (n[1].e, n[2].e, n[3].f)); - break; - case OPCODE_CONVOLUTION_PARAMETER_FV: - { - GLfloat params[4]; - params[0] = n[3].f; - params[1] = n[4].f; - params[2] = n[5].f; - params[3] = n[6].f; - CALL_ConvolutionParameterfv(ctx->Exec, - (n[1].e, n[2].e, params)); - } - break; - case OPCODE_COPY_COLOR_SUB_TABLE: - CALL_CopyColorSubTable(ctx->Exec, (n[1].e, n[2].i, - n[3].i, n[4].i, n[5].i)); - break; - case OPCODE_COPY_COLOR_TABLE: - CALL_CopyColorSubTable(ctx->Exec, (n[1].e, n[2].i, - n[3].i, n[4].i, n[5].i)); - break; case OPCODE_COPY_PIXELS: CALL_CopyPixels(ctx->Exec, (n[1].i, n[2].i, (GLsizei) n[3].i, (GLsizei) n[4].i, @@ -4980,11 +4192,6 @@ execute_list(struct gl_context *ctx, GLuint list) n[4].i, n[5].i, n[6].i, n[7].i, n[8].i)); break; - case OPCODE_COPY_TEX_SUB_IMAGE3D: - CALL_CopyTexSubImage3D(ctx->Exec, (n[1].e, n[2].i, n[3].i, - n[4].i, n[5].i, n[6].i, n[7].i, - n[8].i, n[9].i)); - break; case OPCODE_CULL_FACE: CALL_CullFace(ctx->Exec, (n[1].e)); break; @@ -5043,9 +4250,6 @@ execute_list(struct gl_context *ctx, GLuint list) case OPCODE_HINT: CALL_Hint(ctx->Exec, (n[1].e, n[2].e)); break; - case OPCODE_HISTOGRAM: - CALL_Histogram(ctx->Exec, (n[1].e, n[2].i, n[3].e, n[4].b)); - break; case OPCODE_INDEX_MASK: CALL_IndexMask(ctx->Exec, (n[1].ui)); break; @@ -5140,9 +4344,6 @@ execute_list(struct gl_context *ctx, GLuint list) case OPCODE_MATRIX_MODE: CALL_MatrixMode(ctx->Exec, (n[1].e)); break; - case OPCODE_MIN_MAX: - CALL_Minmax(ctx->Exec, (n[1].e, n[2].e, n[3].b)); - break; case OPCODE_MULT_MATRIX: if (sizeof(Node) == sizeof(GLfloat)) { CALL_MultMatrixf(ctx->Exec, (&n[1].f)); @@ -5226,12 +4427,6 @@ execute_list(struct gl_context *ctx, GLuint list) case OPCODE_READ_BUFFER: CALL_ReadBuffer(ctx->Exec, (n[1].e)); break; - case OPCODE_RESET_HISTOGRAM: - CALL_ResetHistogram(ctx->Exec, (n[1].e)); - break; - case OPCODE_RESET_MIN_MAX: - CALL_ResetMinmax(ctx->Exec, (n[1].e)); - break; case OPCODE_ROTATE: CALL_Rotatef(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f)); break; @@ -5314,23 +4509,6 @@ execute_list(struct gl_context *ctx, GLuint list) ctx->Unpack = save; /* restore */ } break; - case OPCODE_TEX_IMAGE3D: - { - const struct gl_pixelstore_attrib save = ctx->Unpack; - ctx->Unpack = ctx->DefaultPacking; - CALL_TexImage3D(ctx->Exec, (n[1].e, /* target */ - n[2].i, /* level */ - n[3].i, /* components */ - n[4].i, /* width */ - n[5].i, /* height */ - n[6].i, /* depth */ - n[7].e, /* border */ - n[8].e, /* format */ - n[9].e, /* type */ - n[10].data)); - ctx->Unpack = save; /* restore */ - } - break; case OPCODE_TEX_SUB_IMAGE1D: { const struct gl_pixelstore_attrib save = ctx->Unpack; @@ -5352,17 +4530,6 @@ execute_list(struct gl_context *ctx, GLuint list) ctx->Unpack = save; /* restore */ } break; - case OPCODE_TEX_SUB_IMAGE3D: - { - const struct gl_pixelstore_attrib save = ctx->Unpack; - ctx->Unpack = ctx->DefaultPacking; - CALL_TexSubImage3D(ctx->Exec, (n[1].e, n[2].i, n[3].i, - n[4].i, n[5].i, n[6].i, n[7].i, - n[8].i, n[9].e, n[10].e, - n[11].data)); - ctx->Unpack = save; /* restore */ - } - break; case OPCODE_TRANSLATE: CALL_Translatef(ctx->Exec, (n[1].f, n[2].f, n[3].f)); break; @@ -5379,38 +4546,6 @@ execute_list(struct gl_context *ctx, GLuint list) case OPCODE_WINDOW_POS_ARB: /* GL_ARB_window_pos */ CALL_WindowPos3fMESA(ctx->Exec, (n[1].f, n[2].f, n[3].f)); break; -#if FEATURE_NV_vertex_program - case OPCODE_EXECUTE_PROGRAM_NV: - { - GLfloat v[4]; - v[0] = n[3].f; - v[1] = n[4].f; - v[2] = n[5].f; - v[3] = n[6].f; - CALL_ExecuteProgramNV(ctx->Exec, (n[1].e, n[2].ui, v)); - } - break; - case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV: - CALL_RequestResidentProgramsNV(ctx->Exec, (n[1].ui, - (GLuint *) n[2].data)); - break; - case OPCODE_LOAD_PROGRAM_NV: - CALL_LoadProgramNV(ctx->Exec, (n[1].e, n[2].ui, n[3].i, - (const GLubyte *) n[4].data)); - break; - case OPCODE_TRACK_MATRIX_NV: - CALL_TrackMatrixNV(ctx->Exec, (n[1].e, n[2].ui, n[3].e, n[4].e)); - break; -#endif - -#if FEATURE_NV_fragment_program - case OPCODE_PROGRAM_NAMED_PARAMETER_NV: - CALL_ProgramNamedParameter4fNV(ctx->Exec, (n[1].ui, n[2].i, - (const GLubyte *) n[3]. - data, n[4].f, n[5].f, - n[6].f, n[7].f)); - break; -#endif case OPCODE_DEPTH_BOUNDS_EXT: CALL_DepthBoundsEXT(ctx->Exec, (n[1].f, n[2].f)); @@ -5506,10 +4641,6 @@ execute_list(struct gl_context *ctx, GLuint list) } break; - case OPCODE_TEXTURE_BARRIER_NV: - CALL_TextureBarrierNV(ctx->Exec, ()); - break; - case OPCODE_CONTINUE: n = (Node *) n[1].next; break; @@ -6252,148 +5383,6 @@ exec_VertexPointer(GLint size, GLenum type, GLsizei stride, CALL_VertexPointer(ctx->Exec, (size, type, stride, ptr)); } -static void GLAPIENTRY -exec_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat, - GLint x, GLint y, GLsizei width) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_CopyConvolutionFilter1D(ctx->Exec, - (target, internalFormat, x, y, width)); -} - -static void GLAPIENTRY -exec_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat, - GLint x, GLint y, GLsizei width, GLsizei height) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_CopyConvolutionFilter2D(ctx->Exec, - (target, internalFormat, x, y, width, - height)); -} - -static void GLAPIENTRY -exec_GetColorTable(GLenum target, GLenum format, GLenum type, GLvoid * data) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetColorTable(ctx->Exec, (target, format, type, data)); -} - -static void GLAPIENTRY -exec_GetColorTableParameterfv(GLenum target, GLenum pname, GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetColorTableParameterfv(ctx->Exec, (target, pname, params)); -} - -static void GLAPIENTRY -exec_GetColorTableParameteriv(GLenum target, GLenum pname, GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetColorTableParameteriv(ctx->Exec, (target, pname, params)); -} - -static void GLAPIENTRY -exec_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, - GLvoid * image) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetConvolutionFilter(ctx->Exec, (target, format, type, image)); -} - -static void GLAPIENTRY -exec_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetConvolutionParameterfv(ctx->Exec, (target, pname, params)); -} - -static void GLAPIENTRY -exec_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetConvolutionParameteriv(ctx->Exec, (target, pname, params)); -} - -static void GLAPIENTRY -exec_GetHistogram(GLenum target, GLboolean reset, GLenum format, - GLenum type, GLvoid *values) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetHistogram(ctx->Exec, (target, reset, format, type, values)); -} - -static void GLAPIENTRY -exec_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetHistogramParameterfv(ctx->Exec, (target, pname, params)); -} - -static void GLAPIENTRY -exec_GetHistogramParameteriv(GLenum target, GLenum pname, GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetHistogramParameteriv(ctx->Exec, (target, pname, params)); -} - -static void GLAPIENTRY -exec_GetMinmax(GLenum target, GLboolean reset, GLenum format, - GLenum type, GLvoid *values) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetMinmax(ctx->Exec, (target, reset, format, type, values)); -} - -static void GLAPIENTRY -exec_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetMinmaxParameterfv(ctx->Exec, (target, pname, params)); -} - -static void GLAPIENTRY -exec_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetMinmaxParameteriv(ctx->Exec, (target, pname, params)); -} - -static void GLAPIENTRY -exec_GetSeparableFilter(GLenum target, GLenum format, GLenum type, - GLvoid *row, GLvoid *column, GLvoid *span) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_GetSeparableFilter(ctx->Exec, - (target, format, type, row, column, span)); -} - -static void GLAPIENTRY -exec_SeparableFilter2D(GLenum target, GLenum internalFormat, - GLsizei width, GLsizei height, GLenum format, - GLenum type, const GLvoid *row, const GLvoid *column) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_SeparableFilter2D(ctx->Exec, - (target, internalFormat, width, height, format, - type, row, column)); -} - static void GLAPIENTRY exec_ColorPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr) @@ -6463,15 +5452,6 @@ exec_UnlockArraysEXT(void) CALL_UnlockArraysEXT(ctx->Exec, ()); } -static void GLAPIENTRY -exec_SecondaryColorPointerEXT(GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_SecondaryColorPointerEXT(ctx->Exec, (size, type, stride, ptr)); -} - static void GLAPIENTRY exec_FogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid *ptr) { @@ -6729,72 +5709,9 @@ _mesa_create_save_table(void) SET_TexSubImage2D(table, save_TexSubImage2D); SET_VertexPointer(table, exec_VertexPointer); - /* GL 1.2 */ - SET_CopyTexSubImage3D(table, save_CopyTexSubImage3D); - SET_TexImage3D(table, save_TexImage3D); - SET_TexSubImage3D(table, save_TexSubImage3D); - - /* GL_ARB_imaging */ - /* Not all are supported */ - SET_BlendColor(table, save_BlendColor); - SET_BlendEquation(table, save_BlendEquation); - SET_ColorSubTable(table, save_ColorSubTable); - SET_ColorTable(table, save_ColorTable); - SET_ColorTableParameterfv(table, save_ColorTableParameterfv); - SET_ColorTableParameteriv(table, save_ColorTableParameteriv); - SET_ConvolutionFilter1D(table, save_ConvolutionFilter1D); - SET_ConvolutionFilter2D(table, save_ConvolutionFilter2D); - SET_ConvolutionParameterf(table, save_ConvolutionParameterf); - SET_ConvolutionParameterfv(table, save_ConvolutionParameterfv); - SET_ConvolutionParameteri(table, save_ConvolutionParameteri); - SET_ConvolutionParameteriv(table, save_ConvolutionParameteriv); - SET_CopyColorSubTable(table, save_CopyColorSubTable); - SET_CopyColorTable(table, save_CopyColorTable); - SET_CopyConvolutionFilter1D(table, exec_CopyConvolutionFilter1D); - SET_CopyConvolutionFilter2D(table, exec_CopyConvolutionFilter2D); - SET_GetColorTable(table, exec_GetColorTable); - SET_GetColorTableParameterfv(table, exec_GetColorTableParameterfv); - SET_GetColorTableParameteriv(table, exec_GetColorTableParameteriv); - SET_GetConvolutionFilter(table, exec_GetConvolutionFilter); - SET_GetConvolutionParameterfv(table, exec_GetConvolutionParameterfv); - SET_GetConvolutionParameteriv(table, exec_GetConvolutionParameteriv); - SET_GetHistogram(table, exec_GetHistogram); - SET_GetHistogramParameterfv(table, exec_GetHistogramParameterfv); - SET_GetHistogramParameteriv(table, exec_GetHistogramParameteriv); - SET_GetMinmax(table, exec_GetMinmax); - SET_GetMinmaxParameterfv(table, exec_GetMinmaxParameterfv); - SET_GetMinmaxParameteriv(table, exec_GetMinmaxParameteriv); - SET_GetSeparableFilter(table, exec_GetSeparableFilter); - SET_Histogram(table, save_Histogram); - SET_Minmax(table, save_Minmax); - SET_ResetHistogram(table, save_ResetHistogram); - SET_ResetMinmax(table, save_ResetMinmax); - SET_SeparableFilter2D(table, exec_SeparableFilter2D); - - /* 2. GL_EXT_blend_color */ -#if 0 - SET_BlendColorEXT(table, save_BlendColorEXT); -#endif - /* 3. GL_EXT_polygon_offset */ SET_PolygonOffsetEXT(table, save_PolygonOffsetEXT); - /* 6. GL_EXT_texture3d */ -#if 0 - SET_CopyTexSubImage3DEXT(table, save_CopyTexSubImage3D); - SET_TexImage3DEXT(table, save_TexImage3DEXT); - SET_TexSubImage3DEXT(table, save_TexSubImage3D); -#endif - - /* 14. GL_SGI_color_table */ -#if 0 - SET_ColorTableSGI(table, save_ColorTable); - SET_ColorSubTableSGI(table, save_ColorSubTable); - SET_GetColorTableSGI(table, exec_GetColorTable); - SET_GetColorTableParameterfvSGI(table, exec_GetColorTableParameterfv); - SET_GetColorTableParameterivSGI(table, exec_GetColorTableParameteriv); -#endif - /* 30. GL_EXT_vertex_array */ SET_ColorPointerEXT(table, exec_ColorPointerEXT); SET_EdgeFlagPointerEXT(table, exec_EdgeFlagPointerEXT); @@ -6803,11 +5720,6 @@ _mesa_create_save_table(void) SET_TexCoordPointerEXT(table, exec_TexCoordPointerEXT); SET_VertexPointerEXT(table, exec_VertexPointerEXT); - /* 37. GL_EXT_blend_minmax */ -#if 0 - SET_BlendEquationEXT(table, save_BlendEquationEXT); -#endif - /* 54. GL_EXT_point_parameters */ SET_PointParameterfEXT(table, save_PointParameterfEXT); SET_PointParameterfvEXT(table, save_PointParameterfvEXT); @@ -6816,15 +5728,9 @@ _mesa_create_save_table(void) SET_LockArraysEXT(table, exec_LockArraysEXT); SET_UnlockArraysEXT(table, exec_UnlockArraysEXT); - /* 145. GL_EXT_secondary_color */ - SET_SecondaryColorPointerEXT(table, exec_SecondaryColorPointerEXT); - /* 149. GL_EXT_fog_coord */ SET_FogCoordPointerEXT(table, exec_FogCoordPointerEXT); - /* 173. GL_EXT_blend_func_separate */ - SET_BlendFuncSeparateEXT(table, save_BlendFuncSeparateEXT); - /* 197. GL_MESA_window_pos */ SET_WindowPos2dMESA(table, save_WindowPos2dMESA); SET_WindowPos2dvMESA(table, save_WindowPos2dvMESA); @@ -6855,50 +5761,10 @@ _mesa_create_save_table(void) SET_MultiModeDrawArraysIBM(table, exec_MultiModeDrawArraysIBM); SET_MultiModeDrawElementsIBM(table, exec_MultiModeDrawElementsIBM); -#if FEATURE_NV_vertex_program - /* 233. GL_NV_vertex_program */ - /* The following commands DO NOT go into display lists: - * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV, - * VertexAttribPointerNV, GetProgram*, GetVertexAttrib* - */ - SET_ExecuteProgramNV(table, save_ExecuteProgramNV); - SET_AreProgramsResidentNV(table, _mesa_AreProgramsResidentNV); - SET_RequestResidentProgramsNV(table, save_RequestResidentProgramsNV); - SET_GetProgramParameterfvNV(table, _mesa_GetProgramParameterfvNV); - SET_GetProgramParameterdvNV(table, _mesa_GetProgramParameterdvNV); - SET_GetTrackMatrixivNV(table, _mesa_GetTrackMatrixivNV); - SET_LoadProgramNV(table, save_LoadProgramNV); - SET_ProgramParameters4dvNV(table, save_ProgramParameters4dvNV); - SET_ProgramParameters4fvNV(table, save_ProgramParameters4fvNV); - SET_TrackMatrixNV(table, save_TrackMatrixNV); -#endif - - /* 282. GL_NV_fragment_program */ -#if FEATURE_NV_fragment_program - SET_ProgramNamedParameter4fNV(table, save_ProgramNamedParameter4fNV); - SET_ProgramNamedParameter4dNV(table, save_ProgramNamedParameter4dNV); - SET_ProgramNamedParameter4fvNV(table, save_ProgramNamedParameter4fvNV); - SET_ProgramNamedParameter4dvNV(table, save_ProgramNamedParameter4dvNV); - SET_GetProgramNamedParameterfvNV(table, - _mesa_GetProgramNamedParameterfvNV); - SET_GetProgramNamedParameterdvNV(table, - _mesa_GetProgramNamedParameterdvNV); -#endif - /* 262. GL_NV_point_sprite */ SET_PointParameteriNV(table, save_PointParameteriNV); SET_PointParameterivNV(table, save_PointParameterivNV); - /* 273. GL_APPLE_vertex_array_object */ - SET_BindVertexArrayAPPLE(table, _mesa_BindVertexArrayAPPLE); - SET_DeleteVertexArraysAPPLE(table, _mesa_DeleteVertexArraysAPPLE); - SET_GenVertexArraysAPPLE(table, _mesa_GenVertexArraysAPPLE); - SET_IsVertexArrayAPPLE(table, _mesa_IsVertexArrayAPPLE); - - /* GL_ARB_vertex_array_object */ - SET_BindVertexArray(table, _mesa_BindVertexArray); - SET_GenVertexArrays(table, _mesa_GenVertexArrays); - /* ???. GL_EXT_depth_bounds_test */ SET_DepthBoundsEXT(table, save_DepthBoundsEXT); @@ -6925,22 +5791,12 @@ _mesa_create_save_table(void) SET_MapBufferARB(table, _mesa_MapBufferARB); SET_UnmapBufferARB(table, _mesa_UnmapBufferARB); - /* 299. GL_EXT_blend_equation_separate */ - SET_BlendEquationSeparateEXT(table, save_BlendEquationSeparateEXT); - /* ARB 50. GL_ARB_map_buffer_range */ #if FEATURE_ARB_map_buffer_range SET_MapBufferRange(table, _mesa_MapBufferRange); /* no dlist save */ SET_FlushMappedBufferRange(table, _mesa_FlushMappedBufferRange); /* no dl */ #endif - /* 371. GL_APPLE_object_purgeable */ -#if FEATURE_APPLE_object_purgeable - SET_ObjectPurgeableAPPLE(table, _mesa_ObjectPurgeableAPPLE); - SET_ObjectUnpurgeableAPPLE(table, _mesa_ObjectUnpurgeableAPPLE); - SET_GetObjectParameterivAPPLE(table, _mesa_GetObjectParameterivAPPLE); -#endif - /* GL_EXT_texture_integer */ SET_ClearColorIiEXT(table, save_ClearColorIi); SET_ClearColorIuiEXT(table, save_ClearColorIui); @@ -6949,9 +5805,6 @@ _mesa_create_save_table(void) SET_GetTexParameterIivEXT(table, exec_GetTexParameterIiv); SET_GetTexParameterIuivEXT(table, exec_GetTexParameterIuiv); - /* GL_NV_texture_barrier */ - SET_TextureBarrierNV(table, save_TextureBarrierNV); - /* GL_ARB_texture_storage (no dlist support) */ SET_TexStorage1D(table, _mesa_TexStorage1D); SET_TexStorage2D(table, _mesa_TexStorage2D); @@ -7019,16 +5872,6 @@ print_list(struct gl_context *ctx, GLuint list) printf("CallList %d + offset %u = %u\n", (int) n[1].ui, ctx->List.ListBase, ctx->List.ListBase + n[1].ui); break; - case OPCODE_COLOR_TABLE_PARAMETER_FV: - printf("ColorTableParameterfv %s %s %f %f %f %f\n", - enum_string(n[1].e), enum_string(n[2].e), - n[3].f, n[4].f, n[5].f, n[6].f); - break; - case OPCODE_COLOR_TABLE_PARAMETER_IV: - printf("ColorTableParameteriv %s %s %d %d %d %d\n", - enum_string(n[1].e), enum_string(n[2].e), - n[3].i, n[4].i, n[5].i, n[6].i); - break; case OPCODE_DISABLE: printf("Disable %s\n", enum_string(n[1].e)); break; @@ -7258,8 +6101,6 @@ _mesa_save_vtxfmt_init(GLvertexformat * vfmt) vfmt->Materialfv = save_Materialfv; vfmt->Normal3f = save_Normal3f; vfmt->Normal3fv = save_Normal3fv; - vfmt->SecondaryColor3fEXT = save_SecondaryColor3fEXT; - vfmt->SecondaryColor3fvEXT = save_SecondaryColor3fvEXT; vfmt->TexCoord1f = save_TexCoord1f; vfmt->TexCoord1fv = save_TexCoord1fv; vfmt->TexCoord2f = save_TexCoord2f; @@ -7294,7 +6135,6 @@ _mesa_save_vtxfmt_init(GLvertexformat * vfmt) #if 0 vfmt->DrawArrays = 0; vfmt->DrawElements = 0; - vfmt->DrawRangeElements = 0; #endif } diff --git a/dll/opengl/mesa/main/enable.c b/dll/opengl/mesa/main/enable.c index c42c40261d8..8ba5a5e732d 100644 --- a/dll/opengl/mesa/main/enable.c +++ b/dll/opengl/mesa/main/enable.c @@ -41,77 +41,38 @@ static void client_state(struct gl_context *ctx, GLenum cap, GLboolean state) { - struct gl_array_object *arrayObj = ctx->Array.ArrayObj; GLbitfield64 flag; GLboolean *var; switch (cap) { case GL_VERTEX_ARRAY: - var = &arrayObj->VertexAttrib[VERT_ATTRIB_POS].Enabled; + var = &ctx->Array.VertexAttrib[VERT_ATTRIB_POS].Enabled; flag = VERT_BIT_POS; break; case GL_NORMAL_ARRAY: - var = &arrayObj->VertexAttrib[VERT_ATTRIB_NORMAL].Enabled; + var = &ctx->Array.VertexAttrib[VERT_ATTRIB_NORMAL].Enabled; flag = VERT_BIT_NORMAL; break; case GL_COLOR_ARRAY: - var = &arrayObj->VertexAttrib[VERT_ATTRIB_COLOR0].Enabled; - flag = VERT_BIT_COLOR0; + var = &ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR].Enabled; + flag = VERT_BIT_COLOR; break; case GL_INDEX_ARRAY: - var = &arrayObj->VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Enabled; + var = &ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Enabled; flag = VERT_BIT_COLOR_INDEX; break; case GL_TEXTURE_COORD_ARRAY: - var = &arrayObj->VertexAttrib[VERT_ATTRIB_TEX].Enabled; + var = &ctx->Array.VertexAttrib[VERT_ATTRIB_TEX].Enabled; flag = VERT_BIT_TEX; break; case GL_EDGE_FLAG_ARRAY: - var = &arrayObj->VertexAttrib[VERT_ATTRIB_EDGEFLAG].Enabled; + var = &ctx->Array.VertexAttrib[VERT_ATTRIB_EDGEFLAG].Enabled; flag = VERT_BIT_EDGEFLAG; break; case GL_FOG_COORDINATE_ARRAY_EXT: - var = &arrayObj->VertexAttrib[VERT_ATTRIB_FOG].Enabled; + var = &ctx->Array.VertexAttrib[VERT_ATTRIB_FOG].Enabled; flag = VERT_BIT_FOG; break; - case GL_SECONDARY_COLOR_ARRAY_EXT: - var = &arrayObj->VertexAttrib[VERT_ATTRIB_COLOR1].Enabled; - flag = VERT_BIT_COLOR1; - break; - -#if FEATURE_point_size_array - case GL_POINT_SIZE_ARRAY_OES: - var = &arrayObj->VertexAttrib[VERT_ATTRIB_POINT_SIZE].Enabled; - flag = VERT_BIT_POINT_SIZE; - break; -#endif - -#if FEATURE_NV_vertex_program - case GL_VERTEX_ATTRIB_ARRAY0_NV: - case GL_VERTEX_ATTRIB_ARRAY1_NV: - case GL_VERTEX_ATTRIB_ARRAY2_NV: - case GL_VERTEX_ATTRIB_ARRAY3_NV: - case GL_VERTEX_ATTRIB_ARRAY4_NV: - case GL_VERTEX_ATTRIB_ARRAY5_NV: - case GL_VERTEX_ATTRIB_ARRAY6_NV: - case GL_VERTEX_ATTRIB_ARRAY7_NV: - case GL_VERTEX_ATTRIB_ARRAY8_NV: - case GL_VERTEX_ATTRIB_ARRAY9_NV: - case GL_VERTEX_ATTRIB_ARRAY10_NV: - case GL_VERTEX_ATTRIB_ARRAY11_NV: - case GL_VERTEX_ATTRIB_ARRAY12_NV: - case GL_VERTEX_ATTRIB_ARRAY13_NV: - case GL_VERTEX_ATTRIB_ARRAY14_NV: - case GL_VERTEX_ATTRIB_ARRAY15_NV: - CHECK_EXTENSION(NV_vertex_program, cap); - { - GLint n = (GLint) cap - GL_VERTEX_ATTRIB_ARRAY0_NV; - ASSERT(VERT_ATTRIB_GENERIC(n) < Elements(ctx->Array.ArrayObj->VertexAttrib)); - var = &arrayObj->VertexAttrib[VERT_ATTRIB_GENERIC(n)].Enabled; - flag = VERT_BIT_GENERIC(n); - } - break; -#endif /* FEATURE_NV_vertex_program */ default: goto invalid_enum_error; @@ -128,9 +89,9 @@ client_state(struct gl_context *ctx, GLenum cap, GLboolean state) *var = state; if (state) - ctx->Array.ArrayObj->_Enabled |= flag; + ctx->Array._Enabled |= flag; else - ctx->Array.ArrayObj->_Enabled &= ~flag; + ctx->Array._Enabled &= ~flag; if (ctx->Driver.Enable) { ctx->Driver.Enable( ctx, cap, state ); @@ -304,7 +265,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->Light.ColorMaterialEnabled = state; if (state) { _mesa_update_color_material( ctx, - ctx->Current.Attrib[VERT_ATTRIB_COLOR0] ); + ctx->Current.Attrib[VERT_ATTRIB_COLOR] ); } break; case GL_CULL_FACE: @@ -568,11 +529,6 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) return; } break; - case GL_TEXTURE_3D: - if (!enable_texture(ctx, state, TEXTURE_3D_BIT)) { - return; - } - break; case GL_TEXTURE_GEN_S: case GL_TEXTURE_GEN_T: case GL_TEXTURE_GEN_R: @@ -886,8 +842,6 @@ _mesa_IsEnabled( GLenum cap ) return is_texture_enabled(ctx, TEXTURE_1D_BIT); case GL_TEXTURE_2D: return is_texture_enabled(ctx, TEXTURE_2D_BIT); - case GL_TEXTURE_3D: - return is_texture_enabled(ctx, TEXTURE_3D_BIT); case GL_TEXTURE_GEN_S: case GL_TEXTURE_GEN_T: case GL_TEXTURE_GEN_R: @@ -913,24 +867,21 @@ _mesa_IsEnabled( GLenum cap ) /* client-side state */ case GL_VERTEX_ARRAY: - return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POS].Enabled != 0); + return (ctx->Array.VertexAttrib[VERT_ATTRIB_POS].Enabled != 0); case GL_NORMAL_ARRAY: - return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_NORMAL].Enabled != 0); + return (ctx->Array.VertexAttrib[VERT_ATTRIB_NORMAL].Enabled != 0); case GL_COLOR_ARRAY: - return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR0].Enabled != 0); + return (ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR].Enabled != 0); case GL_INDEX_ARRAY: - return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Enabled != 0); + return (ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Enabled != 0); case GL_TEXTURE_COORD_ARRAY: - return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_TEX] + return (ctx->Array.VertexAttrib[VERT_ATTRIB_TEX] .Enabled != 0); case GL_EDGE_FLAG_ARRAY: - return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_EDGEFLAG].Enabled != 0); + return (ctx->Array.VertexAttrib[VERT_ATTRIB_EDGEFLAG].Enabled != 0); case GL_FOG_COORDINATE_ARRAY_EXT: CHECK_EXTENSION(EXT_fog_coord); - return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_FOG].Enabled != 0); - case GL_SECONDARY_COLOR_ARRAY_EXT: - CHECK_EXTENSION(EXT_secondary_color); - return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR1].Enabled != 0); + return (ctx->Array.VertexAttrib[VERT_ATTRIB_FOG].Enabled != 0); #if FEATURE_point_size_array case GL_POINT_SIZE_ARRAY_OES: return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POINT_SIZE].Enabled != 0); diff --git a/dll/opengl/mesa/main/extensions.c b/dll/opengl/mesa/main/extensions.c index a90e7f426b9..9a933cd816f 100644 --- a/dll/opengl/mesa/main/extensions.c +++ b/dll/opengl/mesa/main/extensions.c @@ -61,8 +61,6 @@ struct extension { */ static const struct extension extension_table[] = { /* ARB Extensions */ - { "GL_ARB_half_float_pixel", o(ARB_half_float_pixel), 2003 }, - { "GL_ARB_half_float_vertex", o(ARB_half_float_vertex), 2008 }, { "GL_ARB_map_buffer_range", o(ARB_map_buffer_range), 2008 }, { "GL_ARB_multisample", o(dummy_true), 1994 }, { "GL_ARB_point_parameters", o(EXT_point_parameters), 1997 }, @@ -72,12 +70,9 @@ static const struct extension extension_table[] = { { "GL_ARB_texture_env_combine", o(ARB_texture_env_combine), 2001 }, { "GL_ARB_texture_env_crossbar", o(ARB_texture_env_crossbar), 2001 }, { "GL_ARB_texture_env_dot3", o(ARB_texture_env_dot3), 2001 }, - { "GL_ARB_texture_float", o(ARB_texture_float), 2004 }, { "GL_ARB_texture_mirrored_repeat", o(dummy_true), 2001 }, - { "GL_ARB_texture_non_power_of_two", o(ARB_texture_non_power_of_two), 2003 }, { "GL_ARB_texture_storage", o(ARB_texture_storage), 2011 }, { "GL_ARB_transpose_matrix", o(ARB_transpose_matrix), 1999 }, - { "GL_ARB_vertex_array_object", o(ARB_vertex_array_object), 2006 }, { "GL_ARB_vertex_buffer_object", o(dummy_true), 2003 }, { "GL_ARB_window_pos", o(ARB_window_pos), 2001 }, /* EXT extensions */ @@ -104,7 +99,6 @@ static const struct extension extension_table[] = { { "GL_EXT_shadow_funcs", o(EXT_shadow_funcs), 2002 }, { "GL_EXT_stencil_wrap", o(dummy_true), 2002 }, { "GL_EXT_subtexture", o(dummy_true), 1995 }, - { "GL_EXT_texture3D", o(EXT_texture3D), 1996 }, { "GL_EXT_texture_cube_map", o(ARB_texture_cube_map), 2001 }, { "GL_EXT_texture_env_add", o(dummy_true), 1999 }, { "GL_EXT_texture_env_combine", o(dummy_true), 2000 }, @@ -116,12 +110,9 @@ static const struct extension extension_table[] = { { "GL_EXT_vertex_array", o(dummy_true), 1995 }, /* Vendor extensions */ - { "GL_APPLE_object_purgeable", o(APPLE_object_purgeable), 2006 }, { "GL_APPLE_packed_pixels", o(APPLE_packed_pixels), 2002 }, - { "GL_APPLE_vertex_array_object", o(APPLE_vertex_array_object), 2002 }, { "GL_ATI_blend_equation_separate", o(EXT_blend_equation_separate), 2003 }, { "GL_ATI_texture_env_combine3", o(ATI_texture_env_combine3), 2002 }, - { "GL_ATI_texture_float", o(ARB_texture_float), 2002 }, { "GL_IBM_multimode_draw_arrays", o(IBM_multimode_draw_arrays), 1998 }, { "GL_IBM_rasterpos_clip", o(IBM_rasterpos_clip), 1996 }, { "GL_IBM_texture_mirrored_repeat", o(dummy_true), 1998 }, @@ -135,7 +126,6 @@ static const struct extension extension_table[] = { { "GL_NV_light_max_exponent", o(NV_light_max_exponent), 1999 }, { "GL_NV_point_sprite", o(NV_point_sprite), 2001 }, { "GL_NV_texgen_reflection", o(NV_texgen_reflection), 1999 }, - { "GL_NV_texture_barrier", o(NV_texture_barrier), 2009 }, { "GL_NV_texture_env_combine4", o(NV_texture_env_combine4), 1999 }, { 0, 0, 0}, @@ -183,7 +173,6 @@ static const size_t default_extensions[] = { o(EXT_packed_pixels), o(EXT_rescale_normal), o(EXT_separate_specular_color), - o(EXT_texture3D), /* Vendor Extensions */ o(APPLE_packed_pixels), @@ -203,8 +192,6 @@ static const size_t default_extensions[] = { void _mesa_enable_sw_extensions(struct gl_context *ctx) { - ctx->Extensions.ARB_half_float_pixel = GL_TRUE; - ctx->Extensions.ARB_half_float_vertex = GL_TRUE; ctx->Extensions.ARB_map_buffer_range = GL_TRUE; ctx->Extensions.ARB_point_sprite = GL_TRUE; ctx->Extensions.ARB_texture_cube_map = GL_TRUE; @@ -212,13 +199,7 @@ _mesa_enable_sw_extensions(struct gl_context *ctx) ctx->Extensions.ARB_texture_env_crossbar = GL_TRUE; ctx->Extensions.ARB_texture_env_dot3 = GL_TRUE; /*ctx->Extensions.ARB_texture_float = GL_TRUE;*/ - ctx->Extensions.ARB_texture_non_power_of_two = GL_TRUE; ctx->Extensions.ARB_texture_storage = GL_TRUE; - ctx->Extensions.ARB_vertex_array_object = GL_TRUE; - ctx->Extensions.APPLE_vertex_array_object = GL_TRUE; -#if FEATURE_APPLE_object_purgeable - ctx->Extensions.APPLE_object_purgeable = GL_TRUE; -#endif ctx->Extensions.ATI_texture_env_combine3 = GL_TRUE; ctx->Extensions.EXT_blend_color = GL_TRUE; ctx->Extensions.EXT_blend_equation_separate = GL_TRUE; @@ -240,9 +221,6 @@ _mesa_enable_sw_extensions(struct gl_context *ctx) ctx->Extensions.NV_point_sprite = GL_TRUE; ctx->Extensions.NV_texture_env_combine4 = GL_TRUE; /*ctx->Extensions.NV_texgen_reflection = GL_TRUE;*/ -#if FEATURE_texture_fxt1 - _mesa_enable_extension(ctx, "GL_3DFX_texture_compression_FXT1"); -#endif } @@ -299,7 +277,6 @@ _mesa_enable_2_0_extensions(struct gl_context *ctx) { ctx->Extensions.ARB_point_sprite = GL_TRUE; ctx->Extensions.EXT_blend_equation_separate = GL_TRUE; - ctx->Extensions.ARB_texture_non_power_of_two = GL_TRUE; } diff --git a/dll/opengl/mesa/main/fog.c b/dll/opengl/mesa/main/fog.c index 4d80ff93b64..b2e141b60af 100644 --- a/dll/opengl/mesa/main/fog.c +++ b/dll/opengl/mesa/main/fog.c @@ -198,7 +198,6 @@ void _mesa_init_fog( struct gl_context * ctx ) ctx->Fog.Density = 1.0; ctx->Fog.Start = 0.0; ctx->Fog.End = 1.0; - ctx->Fog.ColorSumEnabled = GL_FALSE; ctx->Fog.FogCoordinateSource = GL_FRAGMENT_DEPTH_EXT; ctx->Fog._Scale = 1.0f; ctx->Fog.FogDistanceMode = GL_EYE_PLANE_ABSOLUTE_NV; diff --git a/dll/opengl/mesa/main/format_pack.c b/dll/opengl/mesa/main/format_pack.c index 31b247650a2..3842289068b 100644 --- a/dll/opengl/mesa/main/format_pack.c +++ b/dll/opengl/mesa/main/format_pack.c @@ -810,200 +810,6 @@ pack_float_YCBCR_REV(const GLfloat src[4], void *dst) } -/* MESA_FORMAT_RGBA_FLOAT32 */ - -static void -pack_ubyte_RGBA_FLOAT32(const GLubyte src[4], void *dst) -{ - GLfloat *d = ((GLfloat *) dst); - d[0] = UBYTE_TO_FLOAT(src[0]); - d[1] = UBYTE_TO_FLOAT(src[1]); - d[2] = UBYTE_TO_FLOAT(src[2]); - d[3] = UBYTE_TO_FLOAT(src[3]); -} - -static void -pack_float_RGBA_FLOAT32(const GLfloat src[4], void *dst) -{ - GLfloat *d = ((GLfloat *) dst); - d[0] = src[0]; - d[1] = src[1]; - d[2] = src[2]; - d[3] = src[3]; -} - - -/* MESA_FORMAT_RGBA_FLOAT16 */ - -static void -pack_ubyte_RGBA_FLOAT16(const GLubyte src[4], void *dst) -{ - GLhalfARB *d = ((GLhalfARB *) dst); - d[0] = _mesa_float_to_half(UBYTE_TO_FLOAT(src[0])); - d[1] = _mesa_float_to_half(UBYTE_TO_FLOAT(src[1])); - d[2] = _mesa_float_to_half(UBYTE_TO_FLOAT(src[2])); - d[3] = _mesa_float_to_half(UBYTE_TO_FLOAT(src[3])); -} - -static void -pack_float_RGBA_FLOAT16(const GLfloat src[4], void *dst) -{ - GLhalfARB *d = ((GLhalfARB *) dst); - d[0] = _mesa_float_to_half(src[0]); - d[1] = _mesa_float_to_half(src[1]); - d[2] = _mesa_float_to_half(src[2]); - d[3] = _mesa_float_to_half(src[3]); -} - - -/* MESA_FORMAT_RGB_FLOAT32 */ - -static void -pack_ubyte_RGB_FLOAT32(const GLubyte src[4], void *dst) -{ - GLfloat *d = ((GLfloat *) dst); - d[0] = UBYTE_TO_FLOAT(src[0]); - d[1] = UBYTE_TO_FLOAT(src[1]); - d[2] = UBYTE_TO_FLOAT(src[2]); -} - -static void -pack_float_RGB_FLOAT32(const GLfloat src[4], void *dst) -{ - GLfloat *d = ((GLfloat *) dst); - d[0] = src[0]; - d[1] = src[1]; - d[2] = src[2]; -} - - -/* MESA_FORMAT_RGB_FLOAT16 */ - -static void -pack_ubyte_RGB_FLOAT16(const GLubyte src[4], void *dst) -{ - GLhalfARB *d = ((GLhalfARB *) dst); - d[0] = _mesa_float_to_half(UBYTE_TO_FLOAT(src[0])); - d[1] = _mesa_float_to_half(UBYTE_TO_FLOAT(src[1])); - d[2] = _mesa_float_to_half(UBYTE_TO_FLOAT(src[2])); -} - -static void -pack_float_RGB_FLOAT16(const GLfloat src[4], void *dst) -{ - GLhalfARB *d = ((GLhalfARB *) dst); - d[0] = _mesa_float_to_half(src[0]); - d[1] = _mesa_float_to_half(src[1]); - d[2] = _mesa_float_to_half(src[2]); -} - - -/* MESA_FORMAT_ALPHA_FLOAT32 */ - -static void -pack_ubyte_ALPHA_FLOAT32(const GLubyte src[4], void *dst) -{ - GLfloat *d = ((GLfloat *) dst); - d[0] = UBYTE_TO_FLOAT(src[ACOMP]); -} - -static void -pack_float_ALPHA_FLOAT32(const GLfloat src[4], void *dst) -{ - GLfloat *d = ((GLfloat *) dst); - d[0] = src[ACOMP]; -} - - -/* MESA_FORMAT_ALPHA_FLOAT16 */ - -static void -pack_ubyte_ALPHA_FLOAT16(const GLubyte src[4], void *dst) -{ - GLhalfARB *d = ((GLhalfARB *) dst); - d[0] = _mesa_float_to_half(UBYTE_TO_FLOAT(src[ACOMP])); -} - -static void -pack_float_ALPHA_FLOAT16(const GLfloat src[4], void *dst) -{ - GLhalfARB *d = ((GLhalfARB *) dst); - d[0] = _mesa_float_to_half(src[ACOMP]); -} - - -/* MESA_FORMAT_LUMINANCE_FLOAT32 (and INTENSITY_FLOAT32, R_FLOAT32) */ - -static void -pack_ubyte_LUMINANCE_FLOAT32(const GLubyte src[4], void *dst) -{ - GLfloat *d = ((GLfloat *) dst); - d[0] = UBYTE_TO_FLOAT(src[RCOMP]); -} - -static void -pack_float_LUMINANCE_FLOAT32(const GLfloat src[4], void *dst) -{ - GLfloat *d = ((GLfloat *) dst); - d[0] = src[RCOMP]; -} - - -/* MESA_FORMAT_LUMINANCE_FLOAT16 (and INTENSITY_FLOAT16, R_FLOAT32) */ - -static void -pack_ubyte_LUMINANCE_FLOAT16(const GLubyte src[4], void *dst) -{ - GLhalfARB *d = ((GLhalfARB *) dst); - d[0] = _mesa_float_to_half(UBYTE_TO_FLOAT(src[RCOMP])); -} - -static void -pack_float_LUMINANCE_FLOAT16(const GLfloat src[4], void *dst) -{ - GLhalfARB *d = ((GLhalfARB *) dst); - d[0] = _mesa_float_to_half(src[RCOMP]); -} - - -/* MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32 */ - -static void -pack_ubyte_LUMINANCE_ALPHA_FLOAT32(const GLubyte src[4], void *dst) -{ - GLfloat *d = ((GLfloat *) dst); - d[0] = UBYTE_TO_FLOAT(src[RCOMP]); - d[1] = UBYTE_TO_FLOAT(src[ACOMP]); -} - -static void -pack_float_LUMINANCE_ALPHA_FLOAT32(const GLfloat src[4], void *dst) -{ - GLfloat *d = ((GLfloat *) dst); - d[0] = src[RCOMP]; - d[1] = src[ACOMP]; -} - - -/* MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16 */ - -static void -pack_ubyte_LUMINANCE_ALPHA_FLOAT16(const GLubyte src[4], void *dst) -{ - GLhalfARB *d = ((GLhalfARB *) dst); - d[0] = _mesa_float_to_half(UBYTE_TO_FLOAT(src[RCOMP])); - d[1] = _mesa_float_to_half(UBYTE_TO_FLOAT(src[ACOMP])); -} - -static void -pack_float_LUMINANCE_ALPHA_FLOAT16(const GLfloat src[4], void *dst) -{ - GLhalfARB *d = ((GLhalfARB *) dst); - d[0] = _mesa_float_to_half(src[RCOMP]); - d[1] = _mesa_float_to_half(src[ACOMP]); -} - - /* MESA_FORMAT_RGBA_16 */ static void @@ -1095,19 +901,6 @@ _mesa_get_pack_ubyte_rgba_function(gl_format format) table[MESA_FORMAT_Z32] = NULL; table[MESA_FORMAT_S8] = NULL; - table[MESA_FORMAT_RGBA_FLOAT32] = pack_ubyte_RGBA_FLOAT32; - table[MESA_FORMAT_RGBA_FLOAT16] = pack_ubyte_RGBA_FLOAT16; - table[MESA_FORMAT_RGB_FLOAT32] = pack_ubyte_RGB_FLOAT32; - table[MESA_FORMAT_RGB_FLOAT16] = pack_ubyte_RGB_FLOAT16; - table[MESA_FORMAT_ALPHA_FLOAT32] = pack_ubyte_ALPHA_FLOAT32; - table[MESA_FORMAT_ALPHA_FLOAT16] = pack_ubyte_ALPHA_FLOAT16; - table[MESA_FORMAT_LUMINANCE_FLOAT32] = pack_ubyte_LUMINANCE_FLOAT32; - table[MESA_FORMAT_LUMINANCE_FLOAT16] = pack_ubyte_LUMINANCE_FLOAT16; - table[MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32] = pack_ubyte_LUMINANCE_ALPHA_FLOAT32; - table[MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16] = pack_ubyte_LUMINANCE_ALPHA_FLOAT16; - table[MESA_FORMAT_INTENSITY_FLOAT32] = pack_ubyte_LUMINANCE_FLOAT32; - table[MESA_FORMAT_INTENSITY_FLOAT16] = pack_ubyte_LUMINANCE_FLOAT16; - /* n/a */ table[MESA_FORMAT_RGBA_INT8] = NULL; /* pack_ubyte_RGBA_INT8 */ table[MESA_FORMAT_RGBA_INT16] = NULL; /* pack_ubyte_RGBA_INT16 */ @@ -1185,20 +978,6 @@ _mesa_get_pack_float_rgba_function(gl_format format) table[MESA_FORMAT_Z32] = NULL; table[MESA_FORMAT_S8] = NULL; - table[MESA_FORMAT_RGBA_FLOAT32] = pack_float_RGBA_FLOAT32; - table[MESA_FORMAT_RGBA_FLOAT16] = pack_float_RGBA_FLOAT16; - table[MESA_FORMAT_RGB_FLOAT32] = pack_float_RGB_FLOAT32; - table[MESA_FORMAT_RGB_FLOAT16] = pack_float_RGB_FLOAT16; - table[MESA_FORMAT_ALPHA_FLOAT32] = pack_float_ALPHA_FLOAT32; - table[MESA_FORMAT_ALPHA_FLOAT16] = pack_float_ALPHA_FLOAT16; - table[MESA_FORMAT_LUMINANCE_FLOAT32] = pack_float_LUMINANCE_FLOAT32; - table[MESA_FORMAT_LUMINANCE_FLOAT16] = pack_float_LUMINANCE_FLOAT16; - table[MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32] = pack_float_LUMINANCE_ALPHA_FLOAT32; - table[MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16] = pack_float_LUMINANCE_ALPHA_FLOAT16; - - table[MESA_FORMAT_INTENSITY_FLOAT32] = pack_float_LUMINANCE_FLOAT32; - table[MESA_FORMAT_INTENSITY_FLOAT16] = pack_float_LUMINANCE_FLOAT16; - /* n/a */ table[MESA_FORMAT_RGBA_INT8] = NULL; table[MESA_FORMAT_RGBA_INT16] = NULL; diff --git a/dll/opengl/mesa/main/format_unpack.c b/dll/opengl/mesa/main/format_unpack.c index 057ceab4533..bca514d9c10 100644 --- a/dll/opengl/mesa/main/format_unpack.c +++ b/dll/opengl/mesa/main/format_unpack.c @@ -590,162 +590,6 @@ unpack_S8(const void *src, GLfloat dst[][4], GLuint n) } } -static void -unpack_RGBA_FLOAT32(const void *src, GLfloat dst[][4], GLuint n) -{ - const GLfloat *s = (const GLfloat *) src; - GLuint i; - for (i = 0; i < n; i++) { - dst[i][RCOMP] = s[i*4+0]; - dst[i][GCOMP] = s[i*4+1]; - dst[i][BCOMP] = s[i*4+2]; - dst[i][ACOMP] = s[i*4+3]; - } -} - -static void -unpack_RGBA_FLOAT16(const void *src, GLfloat dst[][4], GLuint n) -{ - const GLhalfARB *s = (const GLhalfARB *) src; - GLuint i; - for (i = 0; i < n; i++) { - dst[i][RCOMP] = _mesa_half_to_float(s[i*4+0]); - dst[i][GCOMP] = _mesa_half_to_float(s[i*4+1]); - dst[i][BCOMP] = _mesa_half_to_float(s[i*4+2]); - dst[i][ACOMP] = _mesa_half_to_float(s[i*4+3]); - } -} - -static void -unpack_RGB_FLOAT32(const void *src, GLfloat dst[][4], GLuint n) -{ - const GLfloat *s = (const GLfloat *) src; - GLuint i; - for (i = 0; i < n; i++) { - dst[i][RCOMP] = s[i*3+0]; - dst[i][GCOMP] = s[i*3+1]; - dst[i][BCOMP] = s[i*3+2]; - dst[i][ACOMP] = 1.0F; - } -} - -static void -unpack_RGB_FLOAT16(const void *src, GLfloat dst[][4], GLuint n) -{ - const GLhalfARB *s = (const GLhalfARB *) src; - GLuint i; - for (i = 0; i < n; i++) { - dst[i][RCOMP] = _mesa_half_to_float(s[i*3+0]); - dst[i][GCOMP] = _mesa_half_to_float(s[i*3+1]); - dst[i][BCOMP] = _mesa_half_to_float(s[i*3+2]); - dst[i][ACOMP] = 1.0F; - } -} - -static void -unpack_ALPHA_FLOAT32(const void *src, GLfloat dst[][4], GLuint n) -{ - const GLfloat *s = (const GLfloat *) src; - GLuint i; - for (i = 0; i < n; i++) { - dst[i][RCOMP] = - dst[i][GCOMP] = - dst[i][BCOMP] = 0.0F; - dst[i][ACOMP] = s[i]; - } -} - -static void -unpack_ALPHA_FLOAT16(const void *src, GLfloat dst[][4], GLuint n) -{ - const GLhalfARB *s = (const GLhalfARB *) src; - GLuint i; - for (i = 0; i < n; i++) { - dst[i][RCOMP] = - dst[i][GCOMP] = - dst[i][BCOMP] = 0.0F; - dst[i][ACOMP] = _mesa_half_to_float(s[i]); - } -} - -static void -unpack_LUMINANCE_FLOAT32(const void *src, GLfloat dst[][4], GLuint n) -{ - const GLfloat *s = (const GLfloat *) src; - GLuint i; - for (i = 0; i < n; i++) { - dst[i][RCOMP] = - dst[i][GCOMP] = - dst[i][BCOMP] = s[i]; - dst[i][ACOMP] = 1.0F; - } -} - -static void -unpack_LUMINANCE_FLOAT16(const void *src, GLfloat dst[][4], GLuint n) -{ - const GLhalfARB *s = (const GLhalfARB *) src; - GLuint i; - for (i = 0; i < n; i++) { - dst[i][RCOMP] = - dst[i][GCOMP] = - dst[i][BCOMP] = _mesa_half_to_float(s[i]); - dst[i][ACOMP] = 1.0F; - } -} - -static void -unpack_LUMINANCE_ALPHA_FLOAT32(const void *src, GLfloat dst[][4], GLuint n) -{ - const GLfloat *s = (const GLfloat *) src; - GLuint i; - for (i = 0; i < n; i++) { - dst[i][RCOMP] = - dst[i][GCOMP] = - dst[i][BCOMP] = s[i*2+0]; - dst[i][ACOMP] = s[i*2+1]; - } -} - -static void -unpack_LUMINANCE_ALPHA_FLOAT16(const void *src, GLfloat dst[][4], GLuint n) -{ - const GLhalfARB *s = (const GLhalfARB *) src; - GLuint i; - for (i = 0; i < n; i++) { - dst[i][RCOMP] = - dst[i][GCOMP] = - dst[i][BCOMP] = _mesa_half_to_float(s[i*2+0]); - dst[i][ACOMP] = _mesa_half_to_float(s[i*2+1]); - } -} - -static void -unpack_INTENSITY_FLOAT32(const void *src, GLfloat dst[][4], GLuint n) -{ - const GLfloat *s = (const GLfloat *) src; - GLuint i; - for (i = 0; i < n; i++) { - dst[i][RCOMP] = - dst[i][GCOMP] = - dst[i][BCOMP] = - dst[i][ACOMP] = s[i]; - } -} - -static void -unpack_INTENSITY_FLOAT16(const void *src, GLfloat dst[][4], GLuint n) -{ - const GLhalfARB *s = (const GLhalfARB *) src; - GLuint i; - for (i = 0; i < n; i++) { - dst[i][RCOMP] = - dst[i][GCOMP] = - dst[i][BCOMP] = - dst[i][ACOMP] = _mesa_half_to_float(s[i]); - } -} - static void unpack_RGBA_INT8(const void *src, GLfloat dst[][4], GLuint n) { @@ -900,19 +744,6 @@ get_unpack_rgba_function(gl_format format) table[MESA_FORMAT_Z32] = unpack_Z32; table[MESA_FORMAT_S8] = unpack_S8; - table[MESA_FORMAT_RGBA_FLOAT32] = unpack_RGBA_FLOAT32; - table[MESA_FORMAT_RGBA_FLOAT16] = unpack_RGBA_FLOAT16; - table[MESA_FORMAT_RGB_FLOAT32] = unpack_RGB_FLOAT32; - table[MESA_FORMAT_RGB_FLOAT16] = unpack_RGB_FLOAT16; - table[MESA_FORMAT_ALPHA_FLOAT32] = unpack_ALPHA_FLOAT32; - table[MESA_FORMAT_ALPHA_FLOAT16] = unpack_ALPHA_FLOAT16; - table[MESA_FORMAT_LUMINANCE_FLOAT32] = unpack_LUMINANCE_FLOAT32; - table[MESA_FORMAT_LUMINANCE_FLOAT16] = unpack_LUMINANCE_FLOAT16; - table[MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32] = unpack_LUMINANCE_ALPHA_FLOAT32; - table[MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16] = unpack_LUMINANCE_ALPHA_FLOAT16; - table[MESA_FORMAT_INTENSITY_FLOAT32] = unpack_INTENSITY_FLOAT32; - table[MESA_FORMAT_INTENSITY_FLOAT16] = unpack_INTENSITY_FLOAT16; - table[MESA_FORMAT_RGBA_INT8] = unpack_RGBA_INT8; table[MESA_FORMAT_RGBA_INT16] = unpack_RGBA_INT16; table[MESA_FORMAT_RGBA_INT32] = unpack_RGBA_INT32; diff --git a/dll/opengl/mesa/main/formats.c b/dll/opengl/mesa/main/formats.c index e1e636f4389..1d46fa3e18d 100644 --- a/dll/opengl/mesa/main/formats.c +++ b/dll/opengl/mesa/main/formats.c @@ -406,116 +406,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 0, 0, 0, 0, 8, /* Lum/Int/Index/Depth/StencilBits */ 1, 1, 1 /* BlockWidth/Height,Bytes */ }, - { - MESA_FORMAT_RGBA_FLOAT32, - "MESA_FORMAT_RGBA_FLOAT32", - GL_RGBA, - GL_FLOAT, - 32, 32, 32, 32, - 0, 0, 0, 0, 0, - 1, 1, 16 - }, - { - MESA_FORMAT_RGBA_FLOAT16, - "MESA_FORMAT_RGBA_FLOAT16", - GL_RGBA, - GL_FLOAT, - 16, 16, 16, 16, - 0, 0, 0, 0, 0, - 1, 1, 8 - }, - { - MESA_FORMAT_RGB_FLOAT32, - "MESA_FORMAT_RGB_FLOAT32", - GL_RGB, - GL_FLOAT, - 32, 32, 32, 0, - 0, 0, 0, 0, 0, - 1, 1, 12 - }, - { - MESA_FORMAT_RGB_FLOAT16, - "MESA_FORMAT_RGB_FLOAT16", - GL_RGB, - GL_FLOAT, - 16, 16, 16, 0, - 0, 0, 0, 0, 0, - 1, 1, 6 - }, - { - MESA_FORMAT_ALPHA_FLOAT32, - "MESA_FORMAT_ALPHA_FLOAT32", - GL_ALPHA, - GL_FLOAT, - 0, 0, 0, 32, - 0, 0, 0, 0, 0, - 1, 1, 4 - }, - { - MESA_FORMAT_ALPHA_FLOAT16, - "MESA_FORMAT_ALPHA_FLOAT16", - GL_ALPHA, - GL_FLOAT, - 0, 0, 0, 16, - 0, 0, 0, 0, 0, - 1, 1, 2 - }, - { - MESA_FORMAT_LUMINANCE_FLOAT32, - "MESA_FORMAT_LUMINANCE_FLOAT32", - GL_LUMINANCE, - GL_FLOAT, - 0, 0, 0, 0, - 32, 0, 0, 0, 0, - 1, 1, 4 - }, - { - MESA_FORMAT_LUMINANCE_FLOAT16, - "MESA_FORMAT_LUMINANCE_FLOAT16", - GL_LUMINANCE, - GL_FLOAT, - 0, 0, 0, 0, - 16, 0, 0, 0, 0, - 1, 1, 2 - }, - { - MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32, - "MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32", - GL_LUMINANCE_ALPHA, - GL_FLOAT, - 0, 0, 0, 32, - 32, 0, 0, 0, 0, - 1, 1, 8 - }, - { - MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16, - "MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16", - GL_LUMINANCE_ALPHA, - GL_FLOAT, - 0, 0, 0, 16, - 16, 0, 0, 0, 0, - 1, 1, 4 - }, - { - MESA_FORMAT_INTENSITY_FLOAT32, - "MESA_FORMAT_INTENSITY_FLOAT32", - GL_INTENSITY, - GL_FLOAT, - 0, 0, 0, 0, - 0, 32, 0, 0, 0, - 1, 1, 4 - }, - { - MESA_FORMAT_INTENSITY_FLOAT16, - "MESA_FORMAT_INTENSITY_FLOAT16", - GL_INTENSITY, - GL_FLOAT, - 0, 0, 0, 0, - 0, 16, 0, 0, 0, - 1, 1, 2 - }, - /* unnormalized signed int formats */ /* unnormalized unsigned int formats */ { MESA_FORMAT_ALPHA_UINT8, @@ -1355,43 +1246,6 @@ _mesa_format_to_type_and_comps(gl_format format, *comps = 4; return; - case MESA_FORMAT_RGBA_FLOAT32: - *datatype = GL_FLOAT; - *comps = 4; - return; - case MESA_FORMAT_RGBA_FLOAT16: - *datatype = GL_HALF_FLOAT_ARB; - *comps = 4; - return; - case MESA_FORMAT_RGB_FLOAT32: - *datatype = GL_FLOAT; - *comps = 3; - return; - case MESA_FORMAT_RGB_FLOAT16: - *datatype = GL_HALF_FLOAT_ARB; - *comps = 3; - return; - case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32: - *datatype = GL_FLOAT; - *comps = 2; - return; - case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16: - *datatype = GL_HALF_FLOAT_ARB; - *comps = 2; - return; - case MESA_FORMAT_ALPHA_FLOAT32: - case MESA_FORMAT_LUMINANCE_FLOAT32: - case MESA_FORMAT_INTENSITY_FLOAT32: - *datatype = GL_FLOAT; - *comps = 1; - return; - case MESA_FORMAT_ALPHA_FLOAT16: - case MESA_FORMAT_LUMINANCE_FLOAT16: - case MESA_FORMAT_INTENSITY_FLOAT16: - *datatype = GL_HALF_FLOAT_ARB; - *comps = 1; - return; - case MESA_FORMAT_ALPHA_UINT8: case MESA_FORMAT_LUMINANCE_UINT8: case MESA_FORMAT_INTENSITY_UINT8: @@ -1654,36 +1508,6 @@ _mesa_format_matches_format_and_type(gl_format gl_format, case MESA_FORMAT_S8: return GL_FALSE; - case MESA_FORMAT_RGBA_FLOAT32: - return format == GL_RGBA && type == GL_FLOAT; - case MESA_FORMAT_RGBA_FLOAT16: - return format == GL_RGBA && type == GL_HALF_FLOAT; - - case MESA_FORMAT_RGB_FLOAT32: - return format == GL_RGB && type == GL_FLOAT; - case MESA_FORMAT_RGB_FLOAT16: - return format == GL_RGB && type == GL_HALF_FLOAT; - - case MESA_FORMAT_ALPHA_FLOAT32: - return format == GL_ALPHA && type == GL_FLOAT; - case MESA_FORMAT_ALPHA_FLOAT16: - return format == GL_ALPHA && type == GL_HALF_FLOAT; - - case MESA_FORMAT_LUMINANCE_FLOAT32: - return format == GL_LUMINANCE && type == GL_FLOAT; - case MESA_FORMAT_LUMINANCE_FLOAT16: - return format == GL_LUMINANCE && type == GL_HALF_FLOAT; - - case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32: - return format == GL_LUMINANCE_ALPHA && type == GL_FLOAT; - case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16: - return format == GL_LUMINANCE_ALPHA && type == GL_HALF_FLOAT; - - case MESA_FORMAT_INTENSITY_FLOAT32: - return format == GL_INTENSITY && type == GL_FLOAT; - case MESA_FORMAT_INTENSITY_FLOAT16: - return format == GL_INTENSITY && type == GL_HALF_FLOAT; - /* FINISHME: What do we want to do for GL_EXT_texture_integer? */ case MESA_FORMAT_ALPHA_UINT8: case MESA_FORMAT_ALPHA_UINT16: diff --git a/dll/opengl/mesa/main/formats.h b/dll/opengl/mesa/main/formats.h index 2ff4af1fa59..5a93a5c5a8e 100644 --- a/dll/opengl/mesa/main/formats.h +++ b/dll/opengl/mesa/main/formats.h @@ -105,24 +105,6 @@ typedef enum MESA_FORMAT_S8, /* SSSS SSSS */ /*@}*/ - /** - * \name Floating point texture formats. - */ - /*@{*/ - MESA_FORMAT_RGBA_FLOAT32, - MESA_FORMAT_RGBA_FLOAT16, - MESA_FORMAT_RGB_FLOAT32, - MESA_FORMAT_RGB_FLOAT16, - MESA_FORMAT_ALPHA_FLOAT32, - MESA_FORMAT_ALPHA_FLOAT16, - MESA_FORMAT_LUMINANCE_FLOAT32, - MESA_FORMAT_LUMINANCE_FLOAT16, - MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32, - MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16, - MESA_FORMAT_INTENSITY_FLOAT32, - MESA_FORMAT_INTENSITY_FLOAT16, - /*@}*/ - /** * \name Non-normalized signed integer formats. * XXX Note: these are just stand-ins for some better hardware diff --git a/dll/opengl/mesa/main/get.c b/dll/opengl/mesa/main/get.c index 3dcc7e800fb..08d25ccfdc8 100644 --- a/dll/opengl/mesa/main/get.c +++ b/dll/opengl/mesa/main/get.c @@ -157,7 +157,7 @@ union value { #define CONTEXT_FIELD(field, type) \ LOC_CONTEXT, type, offsetof(struct gl_context, field) #define ARRAY_FIELD(field, type) \ - LOC_ARRAY, type, offsetof(struct gl_array_object, field) + LOC_ARRAY, type, offsetof(struct gl_array_attrib, field) #define CONST(value) \ LOC_CONTEXT, TYPE_CONST, value @@ -262,12 +262,10 @@ EXTRA_EXT(IBM_rasterpos_clip); EXTRA_EXT(NV_point_sprite); EXTRA_EXT(NV_light_max_exponent); EXTRA_EXT(EXT_depth_bounds_test); -EXTRA_EXT(APPLE_vertex_array_object); EXTRA_EXT(EXT_compiled_vertex_array); EXTRA_EXT2(NV_point_sprite, ARB_point_sprite); static const int extra_version_30[] = { EXTRA_VERSION_30, EXTRA_END }; -static const int extra_version_31[] = { EXTRA_VERSION_31, EXTRA_END }; static const int extra_version_32[] = { EXTRA_VERSION_32, EXTRA_END }; #define API_OPENGL_BIT (1 << API_OPENGL) @@ -285,7 +283,7 @@ static const int extra_version_32[] = { EXTRA_VERSION_32, EXTRA_END }; static const struct value_desc values[] = { { GL_ALPHA_BITS, BUFFER_INT(Visual.alphaBits), extra_new_buffers }, { GL_BLEND, CONTEXT_BIT0(Color.BlendEnabled), NO_EXTRA }, - { GL_BLEND_SRC, CONTEXT_ENUM(Color.SrcRGB), NO_EXTRA }, + { GL_BLEND_SRC, CONTEXT_ENUM(Color.SrcFactor), NO_EXTRA }, { GL_BLUE_BITS, BUFFER_INT(Visual.blueBits), extra_new_buffers }, { GL_COLOR_CLEAR_VALUE, LOC_CUSTOM, TYPE_FLOATN_4, 0, NO_EXTRA }, { GL_COLOR_WRITEMASK, LOC_CUSTOM, TYPE_INT_4, 0, NO_EXTRA }, @@ -347,19 +345,8 @@ static const struct value_desc values[] = { extra_ARB_texture_cube_map }, /* XXX: OES_texture_cube_map */ /* XXX: OES_blend_subtract */ - { GL_BLEND_SRC_RGB_EXT, CONTEXT_ENUM(Color.SrcRGB), NO_EXTRA }, - { GL_BLEND_DST_RGB_EXT, CONTEXT_ENUM(Color.DstRGB), NO_EXTRA }, - { GL_BLEND_SRC_ALPHA_EXT, CONTEXT_ENUM(Color.SrcA), NO_EXTRA }, - { GL_BLEND_DST_ALPHA_EXT, CONTEXT_ENUM(Color.DstA), NO_EXTRA }, - - /* GL_BLEND_EQUATION_RGB, which is what we're really after, is - * defined identically to GL_BLEND_EQUATION. */ - { GL_BLEND_EQUATION, CONTEXT_ENUM(Color.EquationRGB), NO_EXTRA }, - { GL_BLEND_EQUATION_ALPHA_EXT, CONTEXT_ENUM(Color.EquationA), NO_EXTRA }, - - /* GL_ARB_texture_compression */ - { GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB, LOC_CUSTOM, TYPE_INT, 0, NO_EXTRA }, - { GL_COMPRESSED_TEXTURE_FORMATS_ARB, LOC_CUSTOM, TYPE_INT_N, 0, NO_EXTRA }, + { GL_BLEND_SRC_RGB_EXT, CONTEXT_ENUM(Color.SrcFactor), NO_EXTRA }, + { GL_BLEND_DST_RGB_EXT, CONTEXT_ENUM(Color.DstFactor), NO_EXTRA }, /* GL_ARB_multisample */ { GL_SAMPLE_ALPHA_TO_COVERAGE_ARB, @@ -403,7 +390,7 @@ static const struct value_desc values[] = { { GL_ALPHA_TEST, CONTEXT_BOOL(Color.AlphaEnabled), NO_EXTRA }, { GL_ALPHA_TEST_FUNC, CONTEXT_ENUM(Color.AlphaFunc), NO_EXTRA }, { GL_ALPHA_TEST_REF, LOC_CUSTOM, TYPE_FLOATN, 0, NO_EXTRA }, - { GL_BLEND_DST, CONTEXT_ENUM(Color.DstRGB), NO_EXTRA }, + { GL_BLEND_DST, CONTEXT_ENUM(Color.DstFactor), NO_EXTRA }, { GL_CLIP_DISTANCE0, CONTEXT_BIT0(Transform.ClipPlanesEnabled), extra_valid_clip_distance }, { GL_CLIP_DISTANCE1, CONTEXT_BIT1(Transform.ClipPlanesEnabled), extra_valid_clip_distance }, { GL_CLIP_DISTANCE2, CONTEXT_BIT2(Transform.ClipPlanesEnabled), extra_valid_clip_distance }, @@ -414,7 +401,7 @@ static const struct value_desc values[] = { { GL_CLIP_DISTANCE7, CONTEXT_BIT7(Transform.ClipPlanesEnabled), extra_valid_clip_distance }, { GL_COLOR_MATERIAL, CONTEXT_BOOL(Light.ColorMaterialEnabled), NO_EXTRA }, { GL_CURRENT_COLOR, - CONTEXT_FIELD(Current.Attrib[VERT_ATTRIB_COLOR0][0], TYPE_FLOATN_4), + CONTEXT_FIELD(Current.Attrib[VERT_ATTRIB_COLOR][0], TYPE_FLOATN_4), extra_flush_current }, { GL_CURRENT_NORMAL, CONTEXT_FIELD(Current.Attrib[VERT_ATTRIB_NORMAL][0], TYPE_FLOATN_3), @@ -468,10 +455,10 @@ static const struct value_desc values[] = { { GL_NORMAL_ARRAY, ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_NORMAL].Enabled), NO_EXTRA }, { GL_NORMAL_ARRAY_TYPE, ARRAY_ENUM(VertexAttrib[VERT_ATTRIB_NORMAL].Type), NO_EXTRA }, { GL_NORMAL_ARRAY_STRIDE, ARRAY_INT(VertexAttrib[VERT_ATTRIB_NORMAL].Stride), NO_EXTRA }, - { GL_COLOR_ARRAY, ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_COLOR0].Enabled), NO_EXTRA }, - { GL_COLOR_ARRAY_SIZE, ARRAY_INT(VertexAttrib[VERT_ATTRIB_COLOR0].Size), NO_EXTRA }, - { GL_COLOR_ARRAY_TYPE, ARRAY_ENUM(VertexAttrib[VERT_ATTRIB_COLOR0].Type), NO_EXTRA }, - { GL_COLOR_ARRAY_STRIDE, ARRAY_INT(VertexAttrib[VERT_ATTRIB_COLOR0].Stride), NO_EXTRA }, + { GL_COLOR_ARRAY, ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_COLOR].Enabled), NO_EXTRA }, + { GL_COLOR_ARRAY_SIZE, ARRAY_INT(VertexAttrib[VERT_ATTRIB_COLOR].Size), NO_EXTRA }, + { GL_COLOR_ARRAY_TYPE, ARRAY_ENUM(VertexAttrib[VERT_ATTRIB_COLOR].Type), NO_EXTRA }, + { GL_COLOR_ARRAY_STRIDE, ARRAY_INT(VertexAttrib[VERT_ATTRIB_COLOR].Stride), NO_EXTRA }, { GL_TEXTURE_COORD_ARRAY, LOC_CUSTOM, TYPE_BOOLEAN, offsetof(struct gl_client_array, Enabled), NO_EXTRA }, { GL_TEXTURE_COORD_ARRAY_SIZE, @@ -493,11 +480,11 @@ static const struct value_desc values[] = { /* GL_ARB_vertex_buffer_object */ { GL_VERTEX_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT, - offsetof(struct gl_array_object, VertexAttrib[VERT_ATTRIB_POS].BufferObj), NO_EXTRA }, + offsetof(struct gl_array_attrib, VertexAttrib[VERT_ATTRIB_POS].BufferObj), NO_EXTRA }, { GL_NORMAL_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT, - offsetof(struct gl_array_object, VertexAttrib[VERT_ATTRIB_NORMAL].BufferObj), NO_EXTRA }, + offsetof(struct gl_array_attrib, VertexAttrib[VERT_ATTRIB_NORMAL].BufferObj), NO_EXTRA }, { GL_COLOR_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT, - offsetof(struct gl_array_object, VertexAttrib[VERT_ATTRIB_COLOR0].BufferObj), NO_EXTRA }, + offsetof(struct gl_array_attrib, VertexAttrib[VERT_ATTRIB_COLOR].BufferObj), NO_EXTRA }, { GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT, NO_OFFSET, NO_EXTRA }, /* GL_OES_point_sprite */ @@ -512,11 +499,6 @@ static const struct value_desc values[] = { { GL_BLEND_COLOR_EXT, LOC_CUSTOM, TYPE_FLOATN_4, 0, NO_EXTRA }, - /* OES_texture_3D */ - { GL_TEXTURE_BINDING_3D, LOC_CUSTOM, TYPE_INT, TEXTURE_3D_INDEX, NO_EXTRA }, - { GL_MAX_3D_TEXTURE_SIZE, LOC_CUSTOM, TYPE_INT, - offsetof(struct gl_context, Const.Max3DTextureLevels), NO_EXTRA }, - { GL_ACCUM_RED_BITS, BUFFER_INT(Visual.accumRedBits), NO_EXTRA }, { GL_ACCUM_GREEN_BITS, BUFFER_INT(Visual.accumGreenBits), NO_EXTRA }, { GL_ACCUM_BLUE_BITS, BUFFER_INT(Visual.accumBlueBits), NO_EXTRA }, @@ -540,8 +522,6 @@ static const struct value_desc values[] = { { GL_CURRENT_RASTER_DISTANCE, CONTEXT_FLOAT(Current.RasterDistance), NO_EXTRA }, { GL_CURRENT_RASTER_INDEX, CONST(1), NO_EXTRA }, { GL_CURRENT_RASTER_POSITION, CONTEXT_FLOAT4(Current.RasterPos[0]), NO_EXTRA }, - { GL_CURRENT_RASTER_SECONDARY_COLOR, - CONTEXT_FIELD(Current.RasterSecondaryColor[0], TYPE_FLOATN_4), NO_EXTRA }, { GL_CURRENT_RASTER_TEXTURE_COORDS, LOC_CUSTOM, TYPE_FLOAT_4, 0, extra_valid_texture_unit }, { GL_CURRENT_RASTER_POSITION_VALID, CONTEXT_BOOL(Current.RasterPosValid), NO_EXTRA }, @@ -561,7 +541,6 @@ static const struct value_desc values[] = { { GL_INDEX_OFFSET, CONTEXT_INT(Pixel.IndexOffset), NO_EXTRA }, { GL_INDEX_SHIFT, CONTEXT_INT(Pixel.IndexShift), NO_EXTRA }, { GL_INDEX_WRITEMASK, CONTEXT_INT(Color.IndexMask), NO_EXTRA }, - { GL_LIGHT_MODEL_COLOR_CONTROL, CONTEXT_ENUM(Light.Model.ColorControl), NO_EXTRA }, { GL_LIGHT_MODEL_LOCAL_VIEWER, CONTEXT_BOOL(Light.Model.LocalViewer), NO_EXTRA }, { GL_LINE_STIPPLE, CONTEXT_BOOL(Line.StippleFlag), NO_EXTRA }, { GL_LINE_STIPPLE_PATTERN, LOC_CUSTOM, TYPE_INT, 0, NO_EXTRA }, @@ -638,7 +617,6 @@ static const struct value_desc values[] = { { GL_STEREO, BUFFER_INT(Visual.stereoMode), NO_EXTRA }, { GL_TEXTURE_1D, LOC_CUSTOM, TYPE_BOOLEAN, NO_OFFSET, NO_EXTRA }, - { GL_TEXTURE_3D, LOC_CUSTOM, TYPE_BOOLEAN, NO_OFFSET, NO_EXTRA }, { GL_TEXTURE_BINDING_1D, LOC_CUSTOM, TYPE_INT, TEXTURE_1D_INDEX, NO_EXTRA }, @@ -686,19 +664,6 @@ static const struct value_desc values[] = { CONTEXT_MATRIX_T(ProjectionMatrixStack.Top), NO_EXTRA }, { GL_TRANSPOSE_TEXTURE_MATRIX_ARB, CONTEXT_MATRIX_T(TextureMatrixStack), NO_EXTRA }, - /* GL_EXT_secondary_color */ - { GL_CURRENT_SECONDARY_COLOR_EXT, - CONTEXT_FIELD(Current.Attrib[VERT_ATTRIB_COLOR1][0], TYPE_FLOATN_4), - extra_EXT_secondary_color_flush_current }, - { GL_SECONDARY_COLOR_ARRAY_EXT, ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_COLOR1].Enabled), - extra_EXT_secondary_color }, - { GL_SECONDARY_COLOR_ARRAY_TYPE_EXT, ARRAY_ENUM(VertexAttrib[VERT_ATTRIB_COLOR1].Type), - extra_EXT_secondary_color }, - { GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT, ARRAY_INT(VertexAttrib[VERT_ATTRIB_COLOR1].Stride), - extra_EXT_secondary_color }, - { GL_SECONDARY_COLOR_ARRAY_SIZE_EXT, ARRAY_INT(VertexAttrib[VERT_ATTRIB_COLOR1].Size), - extra_EXT_secondary_color }, - /* GL_EXT_fog_coord */ { GL_CURRENT_FOG_COORDINATE_EXT, CONTEXT_FLOAT(Current.Attrib[VERT_ATTRIB_FOG][0]), @@ -735,13 +700,11 @@ static const struct value_desc values[] = { /* GL_ARB_vertex_buffer_object */ { GL_INDEX_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT, - offsetof(struct gl_array_object, VertexAttrib[VERT_ATTRIB_COLOR_INDEX].BufferObj), NO_EXTRA }, + offsetof(struct gl_array_attrib, VertexAttrib[VERT_ATTRIB_COLOR_INDEX].BufferObj), NO_EXTRA }, { GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT, - offsetof(struct gl_array_object, VertexAttrib[VERT_ATTRIB_EDGEFLAG].BufferObj), NO_EXTRA }, - { GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT, - offsetof(struct gl_array_object, VertexAttrib[VERT_ATTRIB_COLOR1].BufferObj), NO_EXTRA }, + offsetof(struct gl_array_attrib, VertexAttrib[VERT_ATTRIB_EDGEFLAG].BufferObj), NO_EXTRA }, { GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT, - offsetof(struct gl_array_object, VertexAttrib[VERT_ATTRIB_FOG].BufferObj), NO_EXTRA }, + offsetof(struct gl_array_attrib, VertexAttrib[VERT_ATTRIB_FOG].BufferObj), NO_EXTRA }, /* GL_EXT_depth_bounds_test */ { GL_DEPTH_BOUNDS_TEST_EXT, CONTEXT_BOOL(Depth.BoundsTest), @@ -749,10 +712,6 @@ static const struct value_desc values[] = { { GL_DEPTH_BOUNDS_EXT, CONTEXT_FLOAT2(Depth.BoundsMin), extra_EXT_depth_bounds_test }, - /* GL_APPLE_vertex_array_object */ - { GL_VERTEX_ARRAY_BINDING_APPLE, ARRAY_INT(Name), - extra_APPLE_vertex_array_object }, - /* GL_EXT_texture_integer */ { GL_RGBA_INTEGER_MODE_EXT, BUFFER_BOOL(_IntegerColor), extra_EXT_texture_integer }, @@ -882,7 +841,6 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu switch (d->pname) { case GL_TEXTURE_1D: case GL_TEXTURE_2D: - case GL_TEXTURE_3D: case GL_TEXTURE_CUBE_MAP_ARB: v->value_bool = _mesa_IsEnabled(d->pname); break; @@ -940,7 +898,7 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu case GL_TEXTURE_COORD_ARRAY_SIZE: case GL_TEXTURE_COORD_ARRAY_TYPE: case GL_TEXTURE_COORD_ARRAY_STRIDE: - array = &ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_TEX]; + array = &ctx->Array.VertexAttrib[VERT_ATTRIB_TEX]; v->value_int = *(GLuint *) ((char *) array + d->offset); break; @@ -1043,18 +1001,15 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB: case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB: buffer_obj = (struct gl_buffer_object **) - ((char *) ctx->Array.ArrayObj + d->offset); + ((char *) &ctx->Array + d->offset); v->value_int = (*buffer_obj)->Name; break; - case GL_ARRAY_BUFFER_BINDING_ARB: - v->value_int = ctx->Array.ArrayBufferObj->Name; - break; case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB: v->value_int = - ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_TEX].BufferObj->Name; + ctx->Array.VertexAttrib[VERT_ATTRIB_TEX].BufferObj->Name; break; case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB: - v->value_int = ctx->Array.ArrayObj->ElementArrayBufferObj->Name; + v->value_int = ctx->Array.ElementArrayBufferObj->Name; break; case GL_FOG_COLOR: @@ -1066,9 +1021,6 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu v->value_float_4[2] = ctx->Color.ClearColor.f[2], 0.0F, 1.0F; v->value_float_4[3] = ctx->Color.ClearColor.f[3], 0.0F, 1.0F; break; - case GL_BLEND_COLOR_EXT: - COPY_4FV(v->value_float_4, ctx->Color.BlendColor); - break; case GL_ALPHA_TEST_REF: v->value_float = ctx->Color.AlphaRef; break; @@ -1206,7 +1158,7 @@ find_value(const char *func, GLenum pname, void **p, union value *v) *p = ((char *) ctx + d->offset); return d; case LOC_ARRAY: - *p = ((char *) ctx->Array.ArrayObj + d->offset); + *p = ((char *)&ctx->Array + d->offset); return d; case LOC_TEXUNIT: unit = &ctx->Texture.Unit; diff --git a/dll/opengl/mesa/main/get.h b/dll/opengl/mesa/main/get.h index 5e7a59c224c..accaf19e5bc 100644 --- a/dll/opengl/mesa/main/get.h +++ b/dll/opengl/mesa/main/get.h @@ -62,9 +62,6 @@ _mesa_GetPointerv( GLenum pname, GLvoid **params ); extern const GLubyte * GLAPIENTRY _mesa_GetString( GLenum name ); -extern const GLubyte * GLAPIENTRY -_mesa_GetStringi(GLenum name, GLuint index); - extern GLenum GLAPIENTRY _mesa_GetError( void ); diff --git a/dll/opengl/mesa/main/getstring.c b/dll/opengl/mesa/main/getstring.c index 5697d7b8f4b..ef5c272fcad 100644 --- a/dll/opengl/mesa/main/getstring.c +++ b/dll/opengl/mesa/main/getstring.c @@ -72,33 +72,6 @@ _mesa_GetString( GLenum name ) } -/** - * GL3 - */ -const GLubyte * GLAPIENTRY -_mesa_GetStringi(GLenum name, GLuint index) -{ - GET_CURRENT_CONTEXT(ctx); - - if (!ctx) - return NULL; - - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, NULL); - - switch (name) { - case GL_EXTENSIONS: - if (index >= _mesa_get_extension_count(ctx)) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGetStringi(index=%u)", index); - return (const GLubyte *) 0; - } - return _mesa_get_enabled_extension(ctx, index); - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glGetString" ); - return (const GLubyte *) 0; - } -} - - /** * Return pointer-valued state, such as a vertex array pointer. @@ -125,28 +98,25 @@ _mesa_GetPointerv( GLenum pname, GLvoid **params ) switch (pname) { case GL_VERTEX_ARRAY_POINTER: - *params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POS].Ptr; + *params = (GLvoid *) ctx->Array.VertexAttrib[VERT_ATTRIB_POS].Ptr; break; case GL_NORMAL_ARRAY_POINTER: - *params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_NORMAL].Ptr; + *params = (GLvoid *) ctx->Array.VertexAttrib[VERT_ATTRIB_NORMAL].Ptr; break; case GL_COLOR_ARRAY_POINTER: - *params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR0].Ptr; - break; - case GL_SECONDARY_COLOR_ARRAY_POINTER_EXT: - *params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR1].Ptr; + *params = (GLvoid *) ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR].Ptr; break; case GL_FOG_COORDINATE_ARRAY_POINTER_EXT: - *params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_FOG].Ptr; + *params = (GLvoid *) ctx->Array.VertexAttrib[VERT_ATTRIB_FOG].Ptr; break; case GL_INDEX_ARRAY_POINTER: - *params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Ptr; + *params = (GLvoid *) ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Ptr; break; case GL_TEXTURE_COORD_ARRAY_POINTER: - *params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_TEX].Ptr; + *params = (GLvoid *) ctx->Array.VertexAttrib[VERT_ATTRIB_TEX].Ptr; break; case GL_EDGE_FLAG_ARRAY_POINTER: - *params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_EDGEFLAG].Ptr; + *params = (GLvoid *) ctx->Array.VertexAttrib[VERT_ATTRIB_EDGEFLAG].Ptr; break; case GL_FEEDBACK_BUFFER_POINTER: *params = ctx->Feedback.Buffer; @@ -154,11 +124,6 @@ _mesa_GetPointerv( GLenum pname, GLvoid **params ) case GL_SELECTION_BUFFER_POINTER: *params = ctx->Select.Buffer; break; -#if FEATURE_point_size_array - case GL_POINT_SIZE_ARRAY_POINTER_OES: - *params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POINT_SIZE].Ptr; - break; -#endif default: _mesa_error( ctx, GL_INVALID_ENUM, "glGetPointerv" ); return; diff --git a/dll/opengl/mesa/main/glheader.h b/dll/opengl/mesa/main/glheader.h index 9bf3970f0db..56d5ab17c5f 100644 --- a/dll/opengl/mesa/main/glheader.h +++ b/dll/opengl/mesa/main/glheader.h @@ -153,11 +153,6 @@ typedef void *GLeglImageOES; #define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD #endif -#ifndef GL_ATI_texture_compression_3dc -#define GL_ATI_texture_compression_3dc 1 -#define GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI 0x8837 -#endif - /** * Internal token to represent a GLSL shader program (a collection of diff --git a/dll/opengl/mesa/main/histogram.c b/dll/opengl/mesa/main/histogram.c deleted file mode 100644 index 52cdc7e31fd..00000000000 --- a/dll/opengl/mesa/main/histogram.c +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.3 - * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -#include - -#include "histogram.h" - -#if FEATURE_histogram - -/********************************************************************** - * API functions - */ - - -/* this is defined below */ -static void GLAPIENTRY _mesa_ResetMinmax(GLenum target); - - -static void GLAPIENTRY -_mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, - GLenum type, GLvoid *values) -{ - GET_CURRENT_CONTEXT(ctx); - - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetMinmax"); -} - - -static void GLAPIENTRY -_mesa_GetHistogram(GLenum target, GLboolean reset, GLenum format, - GLenum type, GLvoid *values) -{ - GET_CURRENT_CONTEXT(ctx); - - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetHistogram"); -} - - -static void GLAPIENTRY -_mesa_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetHistogramParameterfv"); -} - - -static void GLAPIENTRY -_mesa_GetHistogramParameteriv(GLenum target, GLenum pname, GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetHistogramParameteriv"); -} - - -static void GLAPIENTRY -_mesa_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetMinmaxParameterfv"); -} - - -static void GLAPIENTRY -_mesa_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetMinmaxParameteriv"); -} - - -static void GLAPIENTRY -_mesa_Histogram(GLenum target, GLsizei width, GLenum internalFormat, GLboolean sink) -{ - GET_CURRENT_CONTEXT(ctx); - - _mesa_error(ctx, GL_INVALID_OPERATION, "glHistogram"); -} - - -static void GLAPIENTRY -_mesa_Minmax(GLenum target, GLenum internalFormat, GLboolean sink) -{ - GET_CURRENT_CONTEXT(ctx); - - _mesa_error(ctx, GL_INVALID_OPERATION, "glMinmax"); -} - - -static void GLAPIENTRY -_mesa_ResetHistogram(GLenum target) -{ - GET_CURRENT_CONTEXT(ctx); - - _mesa_error(ctx, GL_INVALID_OPERATION, "glResetHistogram"); -} - - -static void GLAPIENTRY -_mesa_ResetMinmax(GLenum target) -{ - GET_CURRENT_CONTEXT(ctx); - - _mesa_error(ctx, GL_INVALID_OPERATION, "glResetMinmax"); -} - - -void -_mesa_init_histogram_dispatch(struct _glapi_table *disp) -{ - SET_GetHistogram(disp, _mesa_GetHistogram); - SET_GetHistogramParameterfv(disp, _mesa_GetHistogramParameterfv); - SET_GetHistogramParameteriv(disp, _mesa_GetHistogramParameteriv); - SET_GetMinmax(disp, _mesa_GetMinmax); - SET_GetMinmaxParameterfv(disp, _mesa_GetMinmaxParameterfv); - SET_GetMinmaxParameteriv(disp, _mesa_GetMinmaxParameteriv); - SET_Histogram(disp, _mesa_Histogram); - SET_Minmax(disp, _mesa_Minmax); - SET_ResetHistogram(disp, _mesa_ResetHistogram); - SET_ResetMinmax(disp, _mesa_ResetMinmax); -} - -#endif /* FEATURE_histogram */ diff --git a/dll/opengl/mesa/main/histogram.h b/dll/opengl/mesa/main/histogram.h deleted file mode 100644 index d97e74abbad..00000000000 --- a/dll/opengl/mesa/main/histogram.h +++ /dev/null @@ -1,58 +0,0 @@ -/** - * \file histogram.h - * Histogram. - * - * \if subset - * (No-op) - * - * \endif - */ - -/* - * Mesa 3-D graphics library - * Version: 5.1 - * - * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - -#ifndef HISTOGRAM_H -#define HISTOGRAM_H - -#include "compiler.h" -#include "mfeatures.h" - -struct _glapi_table; - -#if FEATURE_histogram - -extern void -_mesa_init_histogram_dispatch(struct _glapi_table *disp); - -#else /* FEATURE_histogram */ - -static inline void -_mesa_init_histogram_dispatch(struct _glapi_table *disp) -{ -} - -#endif /* FEATURE_histogram */ - -#endif /* HISTOGRAM_H */ diff --git a/dll/opengl/mesa/main/image.c b/dll/opengl/mesa/main/image.c index 676ebf7ff8c..820323b4dd3 100644 --- a/dll/opengl/mesa/main/image.c +++ b/dll/opengl/mesa/main/image.c @@ -125,8 +125,6 @@ _mesa_sizeof_type( GLenum type ) return sizeof(GLfloat); case GL_DOUBLE: return sizeof(GLdouble); - case GL_HALF_FLOAT_ARB: - return sizeof(GLhalfARB); case GL_FIXED: return sizeof(GLfixed); default: @@ -157,8 +155,6 @@ _mesa_sizeof_packed_type( GLenum type ) return sizeof(GLuint); case GL_INT: return sizeof(GLint); - case GL_HALF_FLOAT_ARB: - return sizeof(GLhalfARB); case GL_FLOAT: return sizeof(GLfloat); case GL_UNSIGNED_BYTE_3_3_2: @@ -267,8 +263,6 @@ _mesa_bytes_per_pixel( GLenum format, GLenum type ) return comps * sizeof(GLint); case GL_FLOAT: return comps * sizeof(GLfloat); - case GL_HALF_FLOAT_ARB: - return comps * sizeof(GLhalfARB); case GL_UNSIGNED_BYTE_3_3_2: case GL_UNSIGNED_BYTE_2_3_3_REV: if (format == GL_RGB || format == GL_BGR || @@ -384,9 +378,6 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx, case GL_UNSIGNED_INT: case GL_FLOAT: return GL_NO_ERROR; - case GL_HALF_FLOAT: - return ctx->Extensions.ARB_half_float_pixel - ? GL_NO_ERROR : GL_INVALID_ENUM; default: return GL_INVALID_ENUM; } @@ -410,9 +401,6 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx, case GL_UNSIGNED_INT: case GL_FLOAT: return GL_NO_ERROR; - case GL_HALF_FLOAT: - return ctx->Extensions.ARB_half_float_pixel - ? GL_NO_ERROR : GL_INVALID_ENUM; default: return GL_INVALID_ENUM; } @@ -431,9 +419,6 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx, case GL_UNSIGNED_SHORT_5_6_5: case GL_UNSIGNED_SHORT_5_6_5_REV: return GL_NO_ERROR; - case GL_HALF_FLOAT: - return ctx->Extensions.ARB_half_float_pixel - ? GL_NO_ERROR : GL_INVALID_ENUM; default: return GL_INVALID_ENUM; } @@ -451,9 +436,6 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx, case GL_UNSIGNED_INT: case GL_FLOAT: return GL_NO_ERROR; - case GL_HALF_FLOAT: - return ctx->Extensions.ARB_half_float_pixel - ? GL_NO_ERROR : GL_INVALID_ENUM; default: return GL_INVALID_ENUM; } @@ -476,9 +458,6 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx, case GL_UNSIGNED_INT_8_8_8_8: case GL_UNSIGNED_INT_8_8_8_8_REV: return GL_NO_ERROR; - case GL_HALF_FLOAT: - return ctx->Extensions.ARB_half_float_pixel - ? GL_NO_ERROR : GL_INVALID_ENUM; default: return GL_INVALID_ENUM; } diff --git a/dll/opengl/mesa/main/imports.c b/dll/opengl/mesa/main/imports.c index 9652e39d07d..e4f5b59f209 100644 --- a/dll/opengl/mesa/main/imports.c +++ b/dll/opengl/mesa/main/imports.c @@ -537,146 +537,6 @@ _mesa_bitcount_64(uint64_t n) } #endif - -/** - * Convert a 4-byte float to a 2-byte half float. - * Based on code from: - * http://www.opengl.org/discussion_boards/ubb/Forum3/HTML/008786.html - */ -GLhalfARB -_mesa_float_to_half(float val) -{ - const fi_type fi = {val}; - const int flt_m = fi.i & 0x7fffff; - const int flt_e = (fi.i >> 23) & 0xff; - const int flt_s = (fi.i >> 31) & 0x1; - int s, e, m = 0; - GLhalfARB result; - - /* sign bit */ - s = flt_s; - - /* handle special cases */ - if ((flt_e == 0) && (flt_m == 0)) { - /* zero */ - /* m = 0; - already set */ - e = 0; - } - else if ((flt_e == 0) && (flt_m != 0)) { - /* denorm -- denorm float maps to 0 half */ - /* m = 0; - already set */ - e = 0; - } - else if ((flt_e == 0xff) && (flt_m == 0)) { - /* infinity */ - /* m = 0; - already set */ - e = 31; - } - else if ((flt_e == 0xff) && (flt_m != 0)) { - /* NaN */ - m = 1; - e = 31; - } - else { - /* regular number */ - const int new_exp = flt_e - 127; - if (new_exp < -24) { - /* this maps to 0 */ - /* m = 0; - already set */ - e = 0; - } - else if (new_exp < -14) { - /* this maps to a denorm */ - unsigned int exp_val = (unsigned int) (-14 - new_exp); /* 2^-exp_val*/ - e = 0; - switch (exp_val) { - case 0: - _mesa_warning(NULL, - "float_to_half: logical error in denorm creation!\n"); - /* m = 0; - already set */ - break; - case 1: m = 512 + (flt_m >> 14); break; - case 2: m = 256 + (flt_m >> 15); break; - case 3: m = 128 + (flt_m >> 16); break; - case 4: m = 64 + (flt_m >> 17); break; - case 5: m = 32 + (flt_m >> 18); break; - case 6: m = 16 + (flt_m >> 19); break; - case 7: m = 8 + (flt_m >> 20); break; - case 8: m = 4 + (flt_m >> 21); break; - case 9: m = 2 + (flt_m >> 22); break; - case 10: m = 1; break; - } - } - else if (new_exp > 15) { - /* map this value to infinity */ - /* m = 0; - already set */ - e = 31; - } - else { - /* regular */ - e = new_exp + 15; - m = flt_m >> 13; - } - } - - result = (s << 15) | (e << 10) | m; - return result; -} - - -/** - * Convert a 2-byte half float to a 4-byte float. - * Based on code from: - * http://www.opengl.org/discussion_boards/ubb/Forum3/HTML/008786.html - */ -float -_mesa_half_to_float(GLhalfARB val) -{ - /* XXX could also use a 64K-entry lookup table */ - const int m = val & 0x3ff; - const int e = (val >> 10) & 0x1f; - const int s = (val >> 15) & 0x1; - int flt_m, flt_e, flt_s; - fi_type fi; - float result; - - /* sign bit */ - flt_s = s; - - /* handle special cases */ - if ((e == 0) && (m == 0)) { - /* zero */ - flt_m = 0; - flt_e = 0; - } - else if ((e == 0) && (m != 0)) { - /* denorm -- denorm half will fit in non-denorm single */ - const float half_denorm = 1.0f / 16384.0f; /* 2^-14 */ - float mantissa = ((float) (m)) / 1024.0f; - float sign = s ? -1.0f : 1.0f; - return sign * mantissa * half_denorm; - } - else if ((e == 31) && (m == 0)) { - /* infinity */ - flt_e = 0xff; - flt_m = 0; - } - else if ((e == 31) && (m != 0)) { - /* NaN */ - flt_e = 0xff; - flt_m = 1; - } - else { - /* regular */ - flt_e = e + 112; - flt_m = m << 13; - } - - fi.i = (flt_s << 31) | (flt_e << 23) | flt_m; - result = fi.f; - return result; -} - /*@}*/ @@ -1028,14 +888,14 @@ _mesa_error( struct gl_context *ctx, GLenum error, const char *fmtString, ... ) void _mesa_debug( const struct gl_context *ctx, const char *fmtString, ... ) { -#ifdef DEBUG +//#ifdef DEBUG char s[MAXSTRING]; va_list args; va_start(args, fmtString); vsnprintf(s, MAXSTRING, fmtString, args); va_end(args); output_if_debug("Mesa", s, GL_FALSE); -#endif /* DEBUG */ +//#endif /* DEBUG */ (void) ctx; (void) fmtString; } diff --git a/dll/opengl/mesa/main/imports.h b/dll/opengl/mesa/main/imports.h index b7e87439f4c..d2ba34db888 100644 --- a/dll/opengl/mesa/main/imports.h +++ b/dll/opengl/mesa/main/imports.h @@ -597,12 +597,6 @@ extern unsigned int _mesa_bitcount(unsigned int n); #endif -extern GLhalfARB -_mesa_float_to_half(float f); - -extern float -_mesa_half_to_float(GLhalfARB h); - extern void * _mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size, diff --git a/dll/opengl/mesa/main/light.c b/dll/opengl/mesa/main/light.c index 26a9d5296a6..beaa8aa9979 100644 --- a/dll/opengl/mesa/main/light.c +++ b/dll/opengl/mesa/main/light.c @@ -418,7 +418,6 @@ _mesa_GetLightiv( GLenum light, GLenum pname, GLint *params ) void GLAPIENTRY _mesa_LightModelfv( GLenum pname, const GLfloat *params ) { - GLenum newenum; GLboolean newbool; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -448,21 +447,6 @@ _mesa_LightModelfv( GLenum pname, const GLfloat *params ) else ctx->_TriangleCaps &= ~DD_TRI_LIGHT_TWOSIDE; break; - case GL_LIGHT_MODEL_COLOR_CONTROL: - if (params[0] == (GLfloat) GL_SINGLE_COLOR) - newenum = GL_SINGLE_COLOR; - else if (params[0] == (GLfloat) GL_SEPARATE_SPECULAR_COLOR) - newenum = GL_SEPARATE_SPECULAR_COLOR; - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glLightModel(param=0x0%x)", - (GLint) params[0] ); - return; - } - if (ctx->Light.Model.ColorControl == newenum) - return; - FLUSH_VERTICES(ctx, _NEW_LIGHT); - ctx->Light.Model.ColorControl = newenum; - break; default: _mesa_error( ctx, GL_INVALID_ENUM, "glLightModel(pname=0x%x)", pname ); break; @@ -716,7 +700,7 @@ _mesa_ColorMaterial( GLenum face, GLenum mode ) if (ctx->Light.ColorMaterialEnabled) { FLUSH_CURRENT( ctx, 0 ); - _mesa_update_color_material(ctx,ctx->Current.Attrib[VERT_ATTRIB_COLOR0]); + _mesa_update_color_material(ctx,ctx->Current.Attrib[VERT_ATTRIB_COLOR]); } if (ctx->Driver.ColorMaterial) @@ -1019,7 +1003,6 @@ _mesa_update_lighting( struct gl_context *ctx ) ctx->Light._NeedVertices = ((ctx->Light._Flags & (LIGHT_POSITIONAL|LIGHT_SPOT)) || - ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR || ctx->Light.Model.LocalViewer); ctx->Light._NeedEyeCoords = ((ctx->Light._Flags & LIGHT_POSITIONAL) || @@ -1285,7 +1268,6 @@ init_lightmodel( struct gl_lightmodel *lm ) ASSIGN_4V( lm->Ambient, 0.2F, 0.2F, 0.2F, 1.0F ); lm->LocalViewer = GL_FALSE; lm->TwoSide = GL_FALSE; - lm->ColorControl = GL_SINGLE_COLOR; } diff --git a/dll/opengl/mesa/main/mfeatures.h b/dll/opengl/mesa/main/mfeatures.h index 940151abbe7..41d3bda35ed 100644 --- a/dll/opengl/mesa/main/mfeatures.h +++ b/dll/opengl/mesa/main/mfeatures.h @@ -78,12 +78,6 @@ #define FEATURE_GL !FEATURE_ES #endif -#if defined(IN_DRI_DRIVER) || (FEATURE_GL + FEATURE_ES1 + FEATURE_ES2 > 1) -#define FEATURE_remap_table 1 -#else -#define FEATURE_remap_table 0 -#endif - #define FEATURE_dispatch 1 #define FEATURE_texgen 1 #define FEATURE_userclip 1 @@ -103,14 +97,10 @@ #define FEATURE_pixel_transfer FEATURE_GL #define FEATURE_queryobj FEATURE_GL #define FEATURE_rastpos FEATURE_GL -#define FEATURE_texture_fxt1 FEATURE_GL -#define FEATURE_texture_s3tc FEATURE_GL #define FEATURE_extra_context_init FEATURE_ES #define FEATURE_point_size_array FEATURE_ES -#define FEATURE_es2_glsl FEATURE_ES2 - #define FEATURE_ARB_fragment_program 1 #define FEATURE_ARB_vertex_program 1 #define FEATURE_ARB_vertex_shader 1 diff --git a/dll/opengl/mesa/main/mtypes.h b/dll/opengl/mesa/main/mtypes.h index 7cc01fef843..c306a0cddd7 100644 --- a/dll/opengl/mesa/main/mtypes.h +++ b/dll/opengl/mesa/main/mtypes.h @@ -96,14 +96,13 @@ typedef enum VERT_ATTRIB_POS = 0, VERT_ATTRIB_WEIGHT = 1, VERT_ATTRIB_NORMAL = 2, - VERT_ATTRIB_COLOR0 = 3, - VERT_ATTRIB_COLOR1 = 4, - VERT_ATTRIB_FOG = 5, - VERT_ATTRIB_COLOR_INDEX = 6, - VERT_ATTRIB_EDGEFLAG = 7, - VERT_ATTRIB_TEX = 8, - VERT_ATTRIB_POINT_SIZE = 9, - VERT_ATTRIB_MAX = 10 + VERT_ATTRIB_COLOR = 3, + VERT_ATTRIB_FOG = 4, + VERT_ATTRIB_COLOR_INDEX = 5, + VERT_ATTRIB_EDGEFLAG = 6, + VERT_ATTRIB_TEX = 7, + VERT_ATTRIB_POINT_SIZE = 8, + VERT_ATTRIB_MAX = 9 } gl_vert_attrib; /** @@ -121,8 +120,7 @@ typedef enum #define VERT_BIT_POS BITFIELD64_BIT(VERT_ATTRIB_POS) #define VERT_BIT_WEIGHT BITFIELD64_BIT(VERT_ATTRIB_WEIGHT) #define VERT_BIT_NORMAL BITFIELD64_BIT(VERT_ATTRIB_NORMAL) -#define VERT_BIT_COLOR0 BITFIELD64_BIT(VERT_ATTRIB_COLOR0) -#define VERT_BIT_COLOR1 BITFIELD64_BIT(VERT_ATTRIB_COLOR1) +#define VERT_BIT_COLOR BITFIELD64_BIT(VERT_ATTRIB_COLOR) #define VERT_BIT_FOG BITFIELD64_BIT(VERT_ATTRIB_FOG) #define VERT_BIT_COLOR_INDEX BITFIELD64_BIT(VERT_ATTRIB_COLOR_INDEX) #define VERT_BIT_EDGEFLAG BITFIELD64_BIT(VERT_ATTRIB_EDGEFLAG) @@ -143,20 +141,18 @@ typedef enum typedef enum { FRAG_ATTRIB_WPOS = 0, - FRAG_ATTRIB_COL0 = 1, - FRAG_ATTRIB_COL1 = 2, - FRAG_ATTRIB_FOGC = 3, - FRAG_ATTRIB_TEX = 4, - FRAG_ATTRIB_FACE = 5, /**< front/back face */ - FRAG_ATTRIB_PNTC = 6, /**< sprite/point coord */ - FRAG_ATTRIB_CLIP_DIST0 = 7, - FRAG_ATTRIB_CLIP_DIST1 = 8, - FRAG_ATTRIB_MAX = 9 + FRAG_ATTRIB_COL = 1, + FRAG_ATTRIB_FOGC = 2, + FRAG_ATTRIB_TEX = 3, + FRAG_ATTRIB_FACE = 4, /**< front/back face */ + FRAG_ATTRIB_PNTC = 5, /**< sprite/point coord */ + FRAG_ATTRIB_CLIP_DIST0 = 6, + FRAG_ATTRIB_CLIP_DIST1 = 7, + FRAG_ATTRIB_MAX = 8 } gl_frag_attrib; -#define FRAG_BIT_COL0 (1 << FRAG_ATTRIB_COL0) -#define FRAG_BIT_COL1 (1 << FRAG_ATTRIB_COL1) +#define FRAG_BIT_COL (1 << FRAG_ATTRIB_COL) #define FRAG_BIT_FOGC (1 << FRAG_ATTRIB_FOGC) #define FRAG_BIT_TEX (1 << FRAG_ATTRIB_TEX) @@ -386,8 +382,6 @@ struct gl_lightmodel GLfloat Ambient[4]; /**< ambient color */ GLboolean LocalViewer; /**< Local (or infinite) view point? */ GLboolean TwoSide; /**< Two (or one) sided lighting? */ - GLenum ColorControl; /**< either GL_SINGLE_COLOR - * or GL_SEPARATE_SPECULAR_COLOR */ }; @@ -452,14 +446,9 @@ struct gl_colorbuffer_attrib * control, only on the fixed-pointness of the render target. * The query does however depend on fragment color clamping. */ - GLfloat BlendColor[4]; /**< Blending color */ - GLenum SrcRGB; /**< RGB blend source term */ - GLenum DstRGB; /**< RGB blend dest term */ - GLenum SrcA; /**< Alpha blend source term */ - GLenum DstA; /**< Alpha blend dest term */ - GLenum EquationRGB; /**< GL_ADD, GL_SUBTRACT, etc. */ - GLenum EquationA; /**< GL_ADD, GL_SUBTRACT, etc. */ + GLenum SrcFactor; /**< RGB blend source term */ + GLenum DstFactor; /**< RGB blend dest term */ /*@}*/ /** @@ -496,7 +485,6 @@ struct gl_current_attrib GLfloat RasterPos[4]; GLfloat RasterDistance; GLfloat RasterColor[4]; - GLfloat RasterSecondaryColor[4]; GLfloat RasterTexCoords[4]; GLboolean RasterPosValid; /*@}*/ @@ -572,7 +560,6 @@ struct gl_fog_attrib GLfloat End; /**< End distance in eye coords */ GLfloat Index; /**< Fog index */ GLenum Mode; /**< Fog mode */ - GLboolean ColorSumEnabled; GLenum FogCoordinateSource; /**< GL_EXT_fog_coord */ GLfloat _Scale; /**< (End == Start) ? 1.0 : 1.0 / (End - Start) */ GLenum FogDistanceMode; /**< GL_NV_fog_distance */ @@ -833,7 +820,6 @@ struct gl_stencil_attrib typedef enum { TEXTURE_CUBE_INDEX, - TEXTURE_3D_INDEX, TEXTURE_2D_INDEX, TEXTURE_1D_INDEX, NUM_TEXTURE_TARGETS @@ -846,7 +832,6 @@ typedef enum */ /*@{*/ #define TEXTURE_CUBE_BIT (1 << TEXTURE_CUBE_INDEX) -#define TEXTURE_3D_BIT (1 << TEXTURE_3D_INDEX) #define TEXTURE_2D_BIT (1 << TEXTURE_2D_INDEX) #define TEXTURE_1D_BIT (1 << TEXTURE_1D_INDEX) /*@}*/ @@ -1192,77 +1177,30 @@ struct gl_client_array }; -/** - * Collection of vertex arrays. Defined by the GL_APPLE_vertex_array_object - * extension, but a nice encapsulation in any case. - */ -struct gl_array_object -{ - /** Name of the array object as received from glGenVertexArrayAPPLE. */ - GLuint Name; - - GLint RefCount; - _glthread_Mutex Mutex; - - /** - * Does the VAO use ARB semantics or Apple semantics? - * - * There are several ways in which ARB_vertex_array_object and - * APPLE_vertex_array_object VAOs have differing semantics. At the very - * least, - * - * - ARB VAOs require that all array data be sourced from vertex buffer - * objects, but Apple VAOs do not. - * - * - ARB VAOs require that names come from GenVertexArrays. - * - * This flag notes which behavior governs this VAO. - */ - GLboolean ARBsemantics; - - /** - * Has this array object been bound? - */ - GLboolean _Used; - - /** Vertex attribute arrays */ - struct gl_client_array VertexAttrib[VERT_ATTRIB_MAX]; - - /** Mask of VERT_BIT_* values indicating which arrays are enabled */ - GLbitfield64 _Enabled; - - /** - * Min of all enabled arrays' _MaxElement. When arrays reside inside VBOs - * we can determine the max legal (in bounds) glDrawElements array index. - */ - GLuint _MaxElement; - - struct gl_buffer_object *ElementArrayBufferObj; -}; - - /** * Vertex array state */ struct gl_array_attrib { - /** Currently bound array object. See _mesa_BindVertexArrayAPPLE() */ - struct gl_array_object *ArrayObj; + /** Vertex attribute arrays */ + struct gl_client_array VertexAttrib[VERT_ATTRIB_MAX]; - /** The default vertex array object */ - struct gl_array_object *DefaultArrayObj; + /** Mask of VERT_BIT_* values indicating which arrays are enabled */ + GLbitfield64 _Enabled; - /** Array objects (GL_ARB/APPLE_vertex_array_object) */ - struct _mesa_HashTable *Objects; + /** + * Min of all enabled arrays' _MaxElement. When arrays reside inside VBOs + * we can determine the max legal (in bounds) glDrawElements array index. + */ + GLuint _MaxElement; - GLuint LockFirst; /**< GL_EXT_compiled_vertex_array */ - GLuint LockCount; /**< GL_EXT_compiled_vertex_array */ + struct gl_buffer_object *ElementArrayBufferObj; - GLbitfield64 NewState; /**< mask of VERT_BIT_* values */ - GLboolean RebindArrays; /**< whether the VBO module should rebind arrays */ + GLuint LockFirst; /**< GL_EXT_compiled_vertex_array */ + GLuint LockCount; /**< GL_EXT_compiled_vertex_array */ - /* GL_ARB_vertex_buffer_object */ - struct gl_buffer_object *ArrayBufferObj; + GLbitfield64 NewState; /**< mask of VERT_BIT_* values */ + GLboolean RebindArrays; /**< whether the VBO module should rebind arrays */ }; @@ -1494,17 +1432,6 @@ struct gl_framebuffer void (*Delete)(struct gl_framebuffer *fb); }; - -/** - * Precision info for shader datatypes. See glGetShaderPrecisionFormat(). - */ -struct gl_precision -{ - GLushort RangeMin; /**< min value exponent */ - GLushort RangeMax; /**< max value exponent */ - GLushort Precision; /**< number of mantissa bits */ -}; - /** * Constants which may be overridden by device driver during context creation * but are never changed after that. @@ -1512,8 +1439,7 @@ struct gl_precision struct gl_constants { GLint MaxTextureMbytes; /**< Max memory per image, in MB */ - GLint MaxTextureLevels; /**< Max mipmap levels. */ - GLint Max3DTextureLevels; /**< Max mipmap levels for 3D textures */ + GLint MaxTextureLevels; /**< Max mipmap levels. */ GLint MaxCubeTextureLevels; /**< Max mipmap levels for cube textures */ GLfloat MaxTextureMaxAnisotropy; /**< GL_EXT_texture_filter_anisotropic */ @@ -1528,8 +1454,6 @@ struct gl_constants GLfloat MinLineWidthAA, MaxLineWidthAA; /**< antialiased */ GLfloat LineWidthGranularity; - GLuint MaxColorTableSize; - GLuint MaxClipPlanes; GLuint MaxLights; GLfloat MaxShininess; /**< GL_NV_light_max_exponent */ @@ -1577,19 +1501,14 @@ struct gl_extensions GLboolean dummy; /* don't remove this! */ GLboolean dummy_true; /* Set true by _mesa_init_extensions(). */ GLboolean dummy_false; /* Set false by _mesa_init_extensions(). */ - GLboolean ARB_half_float_pixel; - GLboolean ARB_half_float_vertex; GLboolean ARB_map_buffer_range; GLboolean ARB_point_sprite; GLboolean ARB_texture_cube_map; GLboolean ARB_texture_env_combine; GLboolean ARB_texture_env_crossbar; GLboolean ARB_texture_env_dot3; - GLboolean ARB_texture_float; - GLboolean ARB_texture_non_power_of_two; GLboolean ARB_texture_storage; GLboolean ARB_transpose_matrix; - GLboolean ARB_vertex_array_object; GLboolean ARB_window_pos; GLboolean EXT_blend_color; GLboolean EXT_blend_equation_separate; @@ -1607,14 +1526,11 @@ struct gl_extensions GLboolean EXT_secondary_color; GLboolean EXT_separate_shader_objects; GLboolean EXT_separate_specular_color; - GLboolean EXT_texture3D; GLboolean EXT_texture_env_dot3; GLboolean EXT_texture_filter_anisotropic; GLboolean EXT_texture_integer; /* vendor extensions */ GLboolean APPLE_packed_pixels; - GLboolean APPLE_vertex_array_object; - GLboolean APPLE_object_purgeable; GLboolean ATI_texture_env_combine3; GLboolean IBM_rasterpos_clip; GLboolean IBM_multimode_draw_arrays; @@ -1625,7 +1541,6 @@ struct gl_extensions GLboolean NV_fog_distance; GLboolean NV_light_max_exponent; GLboolean NV_point_sprite; - GLboolean NV_texture_barrier; GLboolean NV_texgen_reflection; GLboolean NV_texture_env_combine4; GLboolean extension_sentinel; @@ -1694,8 +1609,7 @@ struct gl_matrix_stack #define _NEW_BUFFERS (1 << 22) /**< gl_context::Visual, DrawBuffer, */ #define _NEW_CURRENT_ATTRIB (1 << 23) /**< gl_context::Current */ #define _NEW_MULTISAMPLE (1 << 24) /**< gl_context::Multisample */ -#define _NEW_TRACK_MATRIX (1 << 25) /**< gl_context::VertexProgram */ -#define _NEW_BUFFER_OBJECT (1 << 26) +#define _NEW_BUFFER_OBJECT (1 << 25) #define _NEW_ALL ~0 /** @@ -1713,17 +1627,16 @@ struct gl_matrix_stack */ /*@{*/ #define DD_FLATSHADE 0x1 -#define DD_SEPARATE_SPECULAR 0x2 -#define DD_TRI_CULL_FRONT_BACK 0x4 /* special case on some hw */ -#define DD_TRI_LIGHT_TWOSIDE 0x8 -#define DD_TRI_UNFILLED 0x10 -#define DD_TRI_SMOOTH 0x20 -#define DD_TRI_STIPPLE 0x40 -#define DD_TRI_OFFSET 0x80 -#define DD_LINE_SMOOTH 0x100 -#define DD_LINE_STIPPLE 0x200 -#define DD_POINT_SMOOTH 0x400 -#define DD_POINT_ATTEN 0x800 +#define DD_TRI_CULL_FRONT_BACK 0x2 /* special case on some hw */ +#define DD_TRI_LIGHT_TWOSIDE 0x4 +#define DD_TRI_UNFILLED 0x8 +#define DD_TRI_SMOOTH 0x10 +#define DD_TRI_STIPPLE 0x20 +#define DD_TRI_OFFSET 0x40 +#define DD_LINE_SMOOTH 0x80 +#define DD_LINE_STIPPLE 0x100 +#define DD_POINT_SMOOTH 0x200 +#define DD_POINT_ATTEN 0x400 /*@}*/ diff --git a/dll/opengl/mesa/main/pack.c b/dll/opengl/mesa/main/pack.c index 5a8f3a4c942..6217e2f3d8c 100644 --- a/dll/opengl/mesa/main/pack.c +++ b/dll/opengl/mesa/main/pack.c @@ -1568,85 +1568,6 @@ _mesa_pack_rgba_span_float(struct gl_context *ctx, GLuint n, GLfloat rgba[][4], } } break; - case GL_HALF_FLOAT_ARB: - { - GLhalfARB *dst = (GLhalfARB *) dstAddr; - switch (dstFormat) { - case GL_RED: - for (i=0;iSwapBytes) { - for (i = 0; i < n; i++) { - GLhalfARB value = s[i]; - SWAP2BYTE(value); - indexes[i] = (GLuint) _mesa_half_to_float(value); - } - } - else { - for (i = 0; i < n; i++) - indexes[i] = (GLuint) _mesa_half_to_float(s[i]); - } - } - break; default: _mesa_problem(NULL, "bad srcType in extract_uint_indexes"); @@ -2378,12 +2282,6 @@ extract_float_rgba(GLuint n, GLfloat rgba[][4], PROCESS(bSrc, BCOMP, 0.0F, 0.0F, GLfloat, (GLfloat)); PROCESS(aSrc, ACOMP, 1.0F, 1.0F, GLfloat, (GLfloat)); break; - case GL_HALF_FLOAT_ARB: - PROCESS(rSrc, RCOMP, 0.0F, 0.0F, GLhalfARB, _mesa_half_to_float); - PROCESS(gSrc, GCOMP, 0.0F, 0.0F, GLhalfARB, _mesa_half_to_float); - PROCESS(bSrc, BCOMP, 0.0F, 0.0F, GLhalfARB, _mesa_half_to_float); - PROCESS(aSrc, ACOMP, 1.0F, 1.0F, GLhalfARB, _mesa_half_to_float); - break; case GL_UNSIGNED_BYTE_3_3_2: { const GLubyte *ubsrc = (const GLubyte *) src; @@ -2698,15 +2596,6 @@ clamp_float_to_uint(GLfloat f) return f < 0.0F ? 0 : IROUND(f); } - -static inline GLuint -clamp_half_to_uint(GLhalfARB h) -{ - GLfloat f = _mesa_half_to_float(h); - return f < 0.0F ? 0 : IROUND(f); -} - - /** * \sa extract_float_rgba() */ @@ -2845,12 +2734,6 @@ extract_uint_rgba(GLuint n, GLuint rgba[][4], PROCESS(bSrc, BCOMP, 0, GLfloat, clamp_float_to_uint); PROCESS(aSrc, ACOMP, 1, GLfloat, clamp_float_to_uint); break; - case GL_HALF_FLOAT_ARB: - PROCESS(rSrc, RCOMP, 0, GLhalfARB, clamp_half_to_uint); - PROCESS(gSrc, GCOMP, 0, GLhalfARB, clamp_half_to_uint); - PROCESS(bSrc, BCOMP, 0, GLhalfARB, clamp_half_to_uint); - PROCESS(aSrc, ACOMP, 1, GLhalfARB, clamp_half_to_uint); - break; case GL_UNSIGNED_BYTE_3_3_2: { const GLubyte *ubsrc = (const GLubyte *) src; @@ -3891,18 +3774,6 @@ _mesa_pack_index_span( struct gl_context *ctx, GLuint n, } } break; - case GL_HALF_FLOAT_ARB: - { - GLhalfARB *dst = (GLhalfARB *) dest; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = _mesa_float_to_half((GLfloat) source[i]); - } - if (dstPacking->SwapBytes) { - _mesa_swap2( (GLushort *) dst, n ); - } - } - break; default: _mesa_problem(ctx, "bad type in _mesa_pack_index_span"); } @@ -4118,18 +3989,6 @@ _mesa_pack_stencil_span( struct gl_context *ctx, GLuint n, } } break; - case GL_HALF_FLOAT_ARB: - { - GLhalfARB *dst = (GLhalfARB *) dest; - GLuint i; - for (i=0;iSwapBytes) { - _mesa_swap2( (GLushort *) dst, n ); - } - } - break; case GL_BITMAP: if (dstPacking->LsbFirst) { GLubyte *dst = (GLubyte *) dest; @@ -4279,20 +4138,6 @@ _mesa_unpack_depth_span( struct gl_context *ctx, GLuint n, DEPTH_VALUES(GLfloat, 1*); needClamp = GL_TRUE; break; - case GL_HALF_FLOAT_ARB: - { - GLuint i; - const GLhalfARB *src = (const GLhalfARB *) source; - for (i = 0; i < n; i++) { - GLhalfARB value = src[i]; - if (srcPacking->SwapBytes) { - SWAP2BYTE(value); - } - depthValues[i] = _mesa_half_to_float(value); - } - needClamp = GL_TRUE; - } - break; default: _mesa_problem(NULL, "bad type in _mesa_unpack_depth_span()"); free(depthTemp); @@ -4461,18 +4306,6 @@ _mesa_pack_depth_span( struct gl_context *ctx, GLuint n, GLvoid *dest, } } break; - case GL_HALF_FLOAT_ARB: - { - GLhalfARB *dst = (GLhalfARB *) dest; - GLuint i; - for (i = 0; i < n; i++) { - dst[i] = _mesa_float_to_half(depthSpan[i]); - } - if (dstPacking->SwapBytes) { - _mesa_swap2( (GLushort *) dst, n ); - } - } - break; default: _mesa_problem(ctx, "bad type in _mesa_pack_depth_span"); } diff --git a/dll/opengl/mesa/main/precomp.h b/dll/opengl/mesa/main/precomp.h index e670fa37c6e..168125d7c02 100644 --- a/dll/opengl/mesa/main/precomp.h +++ b/dll/opengl/mesa/main/precomp.h @@ -6,7 +6,6 @@ #include "api_exec.h" #include "api_loopback.h" #include "api_validate.h" -#include "arrayobj.h" #include "attrib.h" #include "blend.h" #include "bufferobj.h" @@ -14,10 +13,8 @@ #include "clear.h" #include "clip.h" #include "colormac.h" -#include "colortab.h" #include "compiler.h" #include "context.h" -#include "convolve.h" #include "cpuinfo.h" #include "depth.h" #include "dispatch.h" @@ -71,7 +68,6 @@ #include "texstate.h" #include "texstorage.h" #include "texstore.h" -#include "texturebarrier.h" #include "varray.h" #include "version.h" #include "viewport.h" diff --git a/dll/opengl/mesa/main/rastpos.c b/dll/opengl/mesa/main/rastpos.c index 3d47a6a45a6..a54c0b5622e 100644 --- a/dll/opengl/mesa/main/rastpos.c +++ b/dll/opengl/mesa/main/rastpos.c @@ -240,21 +240,13 @@ window_pos3f(GLfloat x, GLfloat y, GLfloat z) /* raster color = current color or index */ ctx->Current.RasterColor[0] - = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0], 0.0F, 1.0F); + = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR][0], 0.0F, 1.0F); ctx->Current.RasterColor[1] - = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1], 0.0F, 1.0F); + = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR][1], 0.0F, 1.0F); ctx->Current.RasterColor[2] - = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2], 0.0F, 1.0F); + = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR][2], 0.0F, 1.0F); ctx->Current.RasterColor[3] - = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3], 0.0F, 1.0F); - ctx->Current.RasterSecondaryColor[0] - = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0], 0.0F, 1.0F); - ctx->Current.RasterSecondaryColor[1] - = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1], 0.0F, 1.0F); - ctx->Current.RasterSecondaryColor[2] - = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2], 0.0F, 1.0F); - ctx->Current.RasterSecondaryColor[3] - = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][3], 0.0F, 1.0F); + = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR][3], 0.0F, 1.0F); /* raster texcoord = current texcoord */ COPY_4FV( ctx->Current.RasterTexCoords, ctx->Current.Attrib[VERT_ATTRIB_TEX] ); @@ -539,7 +531,6 @@ void _mesa_init_rastpos( struct gl_context * ctx ) ASSIGN_4V( ctx->Current.RasterPos, 0.0, 0.0, 0.0, 1.0 ); ctx->Current.RasterDistance = 0.0; ASSIGN_4V( ctx->Current.RasterColor, 1.0, 1.0, 1.0, 1.0 ); - ASSIGN_4V( ctx->Current.RasterSecondaryColor, 0.0, 0.0, 0.0, 1.0 ); ASSIGN_4V( ctx->Current.RasterTexCoords, 0.0, 0.0, 0.0, 1.0 ); ctx->Current.RasterPosValid = GL_TRUE; } diff --git a/dll/opengl/mesa/main/shared.c b/dll/opengl/mesa/main/shared.c index bc5807bb553..cc9ae8ba38c 100644 --- a/dll/opengl/mesa/main/shared.c +++ b/dll/opengl/mesa/main/shared.c @@ -63,7 +63,6 @@ _mesa_alloc_shared_state(struct gl_context *ctx) /* NOTE: the order of these enums matches the TEXTURE_x_INDEX values */ static const GLenum targets[NUM_TEXTURE_TARGETS] = { GL_TEXTURE_CUBE_MAP, - GL_TEXTURE_3D, GL_TEXTURE_2D, GL_TEXTURE_1D }; diff --git a/dll/opengl/mesa/main/state.c b/dll/opengl/mesa/main/state.c index 94689bdd383..428c8dafaaf 100644 --- a/dll/opengl/mesa/main/state.c +++ b/dll/opengl/mesa/main/state.c @@ -32,15 +32,6 @@ #include -static void -update_separate_specular(struct gl_context *ctx) -{ - if (_mesa_need_secondary_color(ctx)) - ctx->_TriangleCaps |= DD_SEPARATE_SPECULAR; - else - ctx->_TriangleCaps &= ~DD_SEPARATE_SPECULAR; -} - /** * Helper for update_arrays(). @@ -61,7 +52,6 @@ update_min(GLuint min, struct gl_client_array *array) static void update_arrays( struct gl_context *ctx ) { - struct gl_array_object *arrayObj = ctx->Array.ArrayObj; GLuint min = ~0; /* find min of _MaxElement values for all enabled arrays. @@ -70,46 +60,41 @@ update_arrays( struct gl_context *ctx ) */ /* 0 */ - if (arrayObj->VertexAttrib[VERT_ATTRIB_POS].Enabled) { - min = update_min(min, &arrayObj->VertexAttrib[VERT_ATTRIB_POS]); + if (ctx->Array.VertexAttrib[VERT_ATTRIB_POS].Enabled) { + min = update_min(min, &ctx->Array.VertexAttrib[VERT_ATTRIB_POS]); } /* 2 */ - if (arrayObj->VertexAttrib[VERT_ATTRIB_NORMAL].Enabled) { - min = update_min(min, &arrayObj->VertexAttrib[VERT_ATTRIB_NORMAL]); + if (ctx->Array.VertexAttrib[VERT_ATTRIB_NORMAL].Enabled) { + min = update_min(min, &ctx->Array.VertexAttrib[VERT_ATTRIB_NORMAL]); } /* 3 */ - if (arrayObj->VertexAttrib[VERT_ATTRIB_COLOR0].Enabled) { - min = update_min(min, &arrayObj->VertexAttrib[VERT_ATTRIB_COLOR0]); - } - - /* 4 */ - if (arrayObj->VertexAttrib[VERT_ATTRIB_COLOR1].Enabled) { - min = update_min(min, &arrayObj->VertexAttrib[VERT_ATTRIB_COLOR1]); + if (ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR].Enabled) { + min = update_min(min, &ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR]); } /* 5 */ - if (arrayObj->VertexAttrib[VERT_ATTRIB_FOG].Enabled) { - min = update_min(min, &arrayObj->VertexAttrib[VERT_ATTRIB_FOG]); + if (ctx->Array.VertexAttrib[VERT_ATTRIB_FOG].Enabled) { + min = update_min(min, &ctx->Array.VertexAttrib[VERT_ATTRIB_FOG]); } /* 6 */ - if (arrayObj->VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Enabled) { - min = update_min(min, &arrayObj->VertexAttrib[VERT_ATTRIB_COLOR_INDEX]); + if (ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Enabled) { + min = update_min(min, &ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR_INDEX]); } /* 8 */ - if (arrayObj->VertexAttrib[VERT_ATTRIB_TEX].Enabled) { - min = update_min(min, &arrayObj->VertexAttrib[VERT_ATTRIB_TEX]); + if (ctx->Array.VertexAttrib[VERT_ATTRIB_TEX].Enabled) { + min = update_min(min, &ctx->Array.VertexAttrib[VERT_ATTRIB_TEX]); } - if (arrayObj->VertexAttrib[VERT_ATTRIB_EDGEFLAG].Enabled) { - min = update_min(min, &arrayObj->VertexAttrib[VERT_ATTRIB_EDGEFLAG]); + if (ctx->Array.VertexAttrib[VERT_ATTRIB_EDGEFLAG].Enabled) { + min = update_min(min, &ctx->Array.VertexAttrib[VERT_ATTRIB_EDGEFLAG]); } /* _MaxElement is one past the last legal array element */ - arrayObj->_MaxElement = min; + ctx->Array._MaxElement = min; } static void @@ -263,9 +248,6 @@ _mesa_update_state_locked( struct gl_context *ctx ) if (new_state & _NEW_PIXEL) _mesa_update_pixel( ctx, new_state ); - if (new_state & _DD_NEW_SEPARATE_SPECULAR) - update_separate_specular( ctx ); - if (new_state & (_NEW_BUFFERS | _NEW_VIEWPORT)) update_viewport_matrix(ctx); diff --git a/dll/opengl/mesa/main/state.h b/dll/opengl/mesa/main/state.h index 5268effb31a..3793cab12f2 100644 --- a/dll/opengl/mesa/main/state.h +++ b/dll/opengl/mesa/main/state.h @@ -37,21 +37,4 @@ _mesa_update_state(struct gl_context *ctx); extern void _mesa_update_state_locked(struct gl_context *ctx); - -/** - * Is the secondary color needed? - */ -static inline GLboolean -_mesa_need_secondary_color(const struct gl_context *ctx) -{ - if (ctx->Light.Enabled && - ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) - return GL_TRUE; - - if (ctx->Fog.ColorSumEnabled) - return GL_TRUE; - - return GL_FALSE; -} - #endif diff --git a/dll/opengl/mesa/main/texformat.c b/dll/opengl/mesa/main/texformat.c index 971ec030fd3..2d6efe2be25 100644 --- a/dll/opengl/mesa/main/texformat.c +++ b/dll/opengl/mesa/main/texformat.c @@ -95,7 +95,6 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat, break; case GL_RGBA12: case GL_RGBA16: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_16); RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_16); RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA8888); RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888); @@ -206,81 +205,6 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat, } } - if (ctx->Extensions.ARB_texture_float) { - switch (internalFormat) { - case GL_ALPHA16F_ARB: - RETURN_IF_SUPPORTED(MESA_FORMAT_ALPHA_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_ALPHA_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); - break; - case GL_ALPHA32F_ARB: - RETURN_IF_SUPPORTED(MESA_FORMAT_ALPHA_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_ALPHA_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); - break; - case GL_LUMINANCE16F_ARB: - RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); - break; - case GL_LUMINANCE32F_ARB: - RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); - break; - case GL_LUMINANCE_ALPHA16F_ARB: - RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); - break; - case GL_LUMINANCE_ALPHA32F_ARB: - RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); - break; - case GL_INTENSITY16F_ARB: - RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); - break; - case GL_INTENSITY32F_ARB: - RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); - break; - case GL_RGB16F_ARB: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); - break; - case GL_RGB32F_ARB: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); - break; - case GL_RGBA16F_ARB: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); - break; - case GL_RGBA32F_ARB: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); - break; - default: - ; /* fallthrough */ - } - } - if (ctx->Extensions.EXT_texture_integer) { switch (internalFormat) { case GL_ALPHA8UI_EXT: diff --git a/dll/opengl/mesa/main/texgetimage.c b/dll/opengl/mesa/main/texgetimage.c index 450b7984c1e..f77d38331ef 100644 --- a/dll/opengl/mesa/main/texgetimage.c +++ b/dll/opengl/mesa/main/texgetimage.c @@ -40,7 +40,6 @@ type_needs_clamping(GLenum type) case GL_SHORT: case GL_INT: case GL_FLOAT: - case GL_HALF_FLOAT_ARB: case GL_UNSIGNED_INT_10F_11F_11F_REV: case GL_UNSIGNED_INT_5_9_9_9_REV: return GL_FALSE; @@ -398,9 +397,6 @@ _mesa_get_teximage(struct gl_context *ctx, case GL_TEXTURE_1D: dimensions = 1; break; - case GL_TEXTURE_3D: - dimensions = 3; - break; default: dimensions = 2; } diff --git a/dll/opengl/mesa/main/teximage.c b/dll/opengl/mesa/main/teximage.c index ccf9d8111bb..f6352726fee 100644 --- a/dll/opengl/mesa/main/teximage.c +++ b/dll/opengl/mesa/main/teximage.c @@ -115,31 +115,6 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat ) return GL_YCBCR_MESA; } - if (ctx->Extensions.ARB_texture_float) { - switch (internalFormat) { - case GL_ALPHA16F_ARB: - case GL_ALPHA32F_ARB: - return GL_ALPHA; - case GL_RGBA16F_ARB: - case GL_RGBA32F_ARB: - return GL_RGBA; - case GL_RGB16F_ARB: - case GL_RGB32F_ARB: - return GL_RGB; - case GL_INTENSITY16F_ARB: - case GL_INTENSITY32F_ARB: - return GL_INTENSITY; - case GL_LUMINANCE16F_ARB: - case GL_LUMINANCE32F_ARB: - return GL_LUMINANCE; - case GL_LUMINANCE_ALPHA16F_ARB: - case GL_LUMINANCE_ALPHA32F_ARB: - return GL_LUMINANCE_ALPHA; - default: - ; /* fallthrough */ - } - } - if (ctx->VersionMajor >= 3 || ctx->Extensions.EXT_texture_integer) { switch (internalFormat) { @@ -304,7 +279,6 @@ _mesa_is_proxy_texture(GLenum target) return (target == GL_PROXY_TEXTURE_1D || target == GL_PROXY_TEXTURE_2D || - target == GL_PROXY_TEXTURE_3D || target == GL_PROXY_TEXTURE_CUBE_MAP_ARB); } @@ -322,9 +296,6 @@ get_proxy_target(GLenum target) case GL_TEXTURE_2D: case GL_PROXY_TEXTURE_2D: return GL_PROXY_TEXTURE_2D; - case GL_TEXTURE_3D: - case GL_PROXY_TEXTURE_3D: - return GL_PROXY_TEXTURE_3D; case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB: case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB: case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB: @@ -364,10 +335,6 @@ _mesa_select_tex_object(struct gl_context *ctx, return ctx->Texture.Unit.CurrentTex[TEXTURE_2D_INDEX]; case GL_PROXY_TEXTURE_2D: return ctx->Texture.ProxyTex[TEXTURE_2D_INDEX]; - case GL_TEXTURE_3D: - return ctx->Texture.Unit.CurrentTex[TEXTURE_3D_INDEX]; - case GL_PROXY_TEXTURE_3D: - return ctx->Texture.ProxyTex[TEXTURE_3D_INDEX]; default: _mesa_problem(NULL, "bad target in _mesa_select_tex_object()"); return NULL; @@ -457,11 +424,6 @@ _mesa_get_proxy_tex_image(struct gl_context *ctx, GLenum target, GLint level) return NULL; texIndex = TEXTURE_2D_INDEX; break; - case GL_PROXY_TEXTURE_3D: - if (level >= ctx->Const.Max3DTextureLevels) - return NULL; - texIndex = TEXTURE_3D_INDEX; - break; case GL_PROXY_TEXTURE_CUBE_MAP: if (level >= ctx->Const.MaxCubeTextureLevels) return NULL; @@ -506,9 +468,6 @@ _mesa_max_texture_levels(struct gl_context *ctx, GLenum target) case GL_TEXTURE_2D: case GL_PROXY_TEXTURE_2D: return ctx->Const.MaxTextureLevels; - case GL_TEXTURE_3D: - case GL_PROXY_TEXTURE_3D: - return ctx->Const.Max3DTextureLevels; case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB: case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB: case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB: @@ -545,9 +504,6 @@ _mesa_get_texture_dimensions(GLenum target) case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: return 2; - case GL_TEXTURE_3D: - case GL_PROXY_TEXTURE_3D: - return 3; default: _mesa_problem(NULL, "invalid target 0x%x in get_texture_dimensions()", target); @@ -708,13 +664,6 @@ _mesa_init_teximage_fields(struct gl_context *ctx, img->Depth2 = 1; img->DepthLog2 = 0; break; - case GL_TEXTURE_3D: - case GL_PROXY_TEXTURE_3D: - img->Height2 = height - 2 * border; /* == 1 << img->HeightLog2; */ - img->HeightLog2 = _mesa_logbase2(img->Height2); - img->Depth2 = depth - 2 * border; /* == 1 << img->DepthLog2; */ - img->DepthLog2 = _mesa_logbase2(img->Depth2); - break; default: _mesa_problem(NULL, "invalid target 0x%x in _mesa_init_teximage_fields()", target); @@ -785,10 +734,8 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level, return GL_FALSE; if (level >= ctx->Const.MaxTextureLevels) return GL_FALSE; - if (!ctx->Extensions.ARB_texture_non_power_of_two) { - if (width > 0 && !_mesa_is_pow_two(width - 2 * border)) - return GL_FALSE; - } + if (width > 0 && !_mesa_is_pow_two(width - 2 * border)) + return GL_FALSE; return GL_TRUE; case GL_PROXY_TEXTURE_2D: @@ -799,32 +746,10 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level, return GL_FALSE; if (level >= ctx->Const.MaxTextureLevels) return GL_FALSE; - if (!ctx->Extensions.ARB_texture_non_power_of_two) { - if (width > 0 && !_mesa_is_pow_two(width - 2 * border)) - return GL_FALSE; - if (height > 0 && !_mesa_is_pow_two(height - 2 * border)) - return GL_FALSE; - } - return GL_TRUE; - - case GL_PROXY_TEXTURE_3D: - maxSize = 1 << (ctx->Const.Max3DTextureLevels - 1); - if (width < 2 * border || width > 2 * border + maxSize) + if (width > 0 && !_mesa_is_pow_two(width - 2 * border)) return GL_FALSE; - if (height < 2 * border || height > 2 * border + maxSize) + if (height > 0 && !_mesa_is_pow_two(height - 2 * border)) return GL_FALSE; - if (depth < 2 * border || depth > 2 * border + maxSize) - return GL_FALSE; - if (level >= ctx->Const.Max3DTextureLevels) - return GL_FALSE; - if (!ctx->Extensions.ARB_texture_non_power_of_two) { - if (width > 0 && !_mesa_is_pow_two(width - 2 * border)) - return GL_FALSE; - if (height > 0 && !_mesa_is_pow_two(height - 2 * border)) - return GL_FALSE; - if (depth > 0 && !_mesa_is_pow_two(depth - 2 * border)) - return GL_FALSE; - } return GL_TRUE; case GL_PROXY_TEXTURE_CUBE_MAP_ARB: @@ -835,12 +760,10 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level, return GL_FALSE; if (level >= ctx->Const.MaxCubeTextureLevels) return GL_FALSE; - if (!ctx->Extensions.ARB_texture_non_power_of_two) { - if (width > 0 && !_mesa_is_pow_two(width - 2 * border)) - return GL_FALSE; - if (height > 0 && !_mesa_is_pow_two(height - 2 * border)) - return GL_FALSE; - } + if (width > 0 && !_mesa_is_pow_two(width - 2 * border)) + return GL_FALSE; + if (height > 0 && !_mesa_is_pow_two(height - 2 * border)) + return GL_FALSE; return GL_TRUE; default: @@ -898,14 +821,6 @@ legal_teximage_target(struct gl_context *ctx, GLuint dims, GLenum target) default: return GL_FALSE; } - case 3: - switch (target) { - case GL_TEXTURE_3D: - case GL_PROXY_TEXTURE_3D: - return GL_TRUE; - default: - return GL_FALSE; - } default: _mesa_problem(ctx, "invalid dims=%u in legal_teximage_target()", dims); return GL_FALSE; @@ -939,13 +854,6 @@ legal_texsubimage_target(struct gl_context *ctx, GLuint dims, GLenum target) default: return GL_FALSE; } - case 3: - switch (target) { - case GL_TEXTURE_3D: - return GL_TRUE; - default: - return GL_FALSE; - } default: _mesa_problem(ctx, "invalid dims=%u in legal_texsubimage_target()", dims); @@ -1268,16 +1176,6 @@ subtexture_error_check2( struct gl_context *ctx, GLuint dimensions, return GL_TRUE; } } - if (dimensions > 2) { - if (zoffset < -((GLint)destTex->Border)) { - _mesa_error(ctx, GL_INVALID_VALUE, "glTexSubImage3D(zoffset)"); - return GL_TRUE; - } - if (zoffset + depth > (GLint) (destTex->Depth + destTex->Border)) { - _mesa_error(ctx, GL_INVALID_VALUE, "glTexSubImage3D(zoffset+depth)"); - return GL_TRUE; - } - } if (ctx->VersionMajor >= 3 || ctx->Extensions.EXT_texture_integer) { /* both source and dest must be integer-valued, or neither */ @@ -1786,7 +1684,6 @@ teximage(struct gl_context *ctx, GLuint dims, border, internalFormat, texFormat); /* Give the texture to the driver. may be null. */ - ASSERT(ctx->Driver.TexImage3D); switch (dims) { case 1: ctx->Driver.TexImage1D(ctx, texImage, internalFormat, @@ -1798,11 +1695,6 @@ teximage(struct gl_context *ctx, GLuint dims, width, height, border, format, type, pixels, unpack); break; - case 3: - ctx->Driver.TexImage3D(ctx, texImage, internalFormat, - width, height, depth, border, format, - type, pixels, unpack); - break; default: _mesa_problem(ctx, "invalid dims=%u in teximage()", dims); } @@ -1847,33 +1739,6 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, } -/* - * Called by the API or display list executor. - * Note that width and height include the border. - */ -void GLAPIENTRY -_mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat, - GLsizei width, GLsizei height, GLsizei depth, - GLint border, GLenum format, GLenum type, - const GLvoid *pixels ) -{ - GET_CURRENT_CONTEXT(ctx); - teximage(ctx, 3, target, level, internalFormat, width, height, depth, - border, format, type, pixels); -} - - -void GLAPIENTRY -_mesa_TexImage3DEXT( GLenum target, GLint level, GLenum internalFormat, - GLsizei width, GLsizei height, GLsizei depth, - GLint border, GLenum format, GLenum type, - const GLvoid *pixels ) -{ - _mesa_TexImage3D(target, level, (GLint) internalFormat, width, height, - depth, border, format, type, pixels); -} - - /** * Implement all the glTexSubImage1/2/3D() functions. */ @@ -1947,12 +1812,6 @@ texsubimage(struct gl_context *ctx, GLuint dims, GLenum target, GLint level, xoffset, yoffset, width, height, format, type, pixels, &ctx->Unpack); break; - case 3: - ctx->Driver.TexSubImage3D(ctx, texImage, - xoffset, yoffset, zoffset, - width, height, depth, - format, type, pixels, &ctx->Unpack); - break; default: _mesa_problem(ctx, "unexpected dims in subteximage()"); } @@ -1994,22 +1853,6 @@ _mesa_TexSubImage2D( GLenum target, GLint level, -void GLAPIENTRY -_mesa_TexSubImage3D( GLenum target, GLint level, - GLint xoffset, GLint yoffset, GLint zoffset, - GLsizei width, GLsizei height, GLsizei depth, - GLenum format, GLenum type, - const GLvoid *pixels ) -{ - GET_CURRENT_CONTEXT(ctx); - texsubimage(ctx, 3, target, level, - xoffset, yoffset, zoffset, - width, height, depth, - format, type, pixels); -} - - - /** * For glCopyTexSubImage, return the source renderbuffer to copy texel data * from. This depends on whether the texture contains color or depth values. @@ -2218,11 +2061,6 @@ copytexsubimage(struct gl_context *ctx, GLuint dims, GLenum target, GLint level, ctx->Driver.CopyTexSubImage2D(ctx, texImage, xoffset, yoffset, srcRb, x, y, width, height); break; - case 3: - ctx->Driver.CopyTexSubImage3D(ctx, texImage, - xoffset, yoffset, zoffset, - srcRb, x, y, width, height); - break; default: _mesa_problem(ctx, "bad dims in copytexsubimage()"); } @@ -2254,15 +2092,3 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level, copytexsubimage(ctx, 2, target, level, xoffset, yoffset, 0, x, y, width, height); } - - - -void GLAPIENTRY -_mesa_CopyTexSubImage3D( GLenum target, GLint level, - GLint xoffset, GLint yoffset, GLint zoffset, - GLint x, GLint y, GLsizei width, GLsizei height ) -{ - GET_CURRENT_CONTEXT(ctx); - copytexsubimage(ctx, 3, target, level, xoffset, yoffset, zoffset, - x, y, width, height); -} diff --git a/dll/opengl/mesa/main/teximage.h b/dll/opengl/mesa/main/teximage.h index 776e3b80478..c22171297dc 100644 --- a/dll/opengl/mesa/main/teximage.h +++ b/dll/opengl/mesa/main/teximage.h @@ -164,18 +164,6 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalformat, GLenum format, GLenum type, const GLvoid *pixels ); -extern void GLAPIENTRY -_mesa_TexImage3D( GLenum target, GLint level, GLint internalformat, - GLsizei width, GLsizei height, GLsizei depth, GLint border, - GLenum format, GLenum type, const GLvoid *pixels ); - - -extern void GLAPIENTRY -_mesa_TexImage3DEXT( GLenum target, GLint level, GLenum internalformat, - GLsizei width, GLsizei height, GLsizei depth, - GLint border, GLenum format, GLenum type, - const GLvoid *pixels ); - extern void GLAPIENTRY _mesa_TexSubImage1D( GLenum target, GLint level, GLint xoffset, GLsizei width, @@ -191,14 +179,6 @@ _mesa_TexSubImage2D( GLenum target, GLint level, const GLvoid *pixels ); -extern void GLAPIENTRY -_mesa_TexSubImage3D( GLenum target, GLint level, - GLint xoffset, GLint yoffset, GLint zoffset, - GLsizei width, GLsizei height, GLsizei depth, - GLenum format, GLenum type, - const GLvoid *pixels ); - - extern void GLAPIENTRY _mesa_CopyTexImage1D( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border ); @@ -220,12 +200,6 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ); - -extern void GLAPIENTRY -_mesa_CopyTexSubImage3D( GLenum target, GLint level, - GLint xoffset, GLint yoffset, GLint zoffset, - GLint x, GLint y, GLsizei width, GLsizei height ); - /*@}*/ #endif diff --git a/dll/opengl/mesa/main/texobj.c b/dll/opengl/mesa/main/texobj.c index b2a062d3faf..a0c7c97f869 100644 --- a/dll/opengl/mesa/main/texobj.c +++ b/dll/opengl/mesa/main/texobj.c @@ -216,7 +216,6 @@ valid_texture_object(const struct gl_texture_object *tex) case 0: case GL_TEXTURE_1D: case GL_TEXTURE_2D: - case GL_TEXTURE_3D: case GL_TEXTURE_CUBE_MAP_ARB: return GL_TRUE; case 0x99: @@ -365,12 +364,6 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx, t->Image[0][baseLevel]->HeightLog2); maxLevels = ctx->Const.MaxTextureLevels; } - else if (t->Target == GL_TEXTURE_3D) { - GLint max = MAX2(t->Image[0][baseLevel]->WidthLog2, - t->Image[0][baseLevel]->HeightLog2); - maxLog2 = MAX2(max, (GLint)(t->Image[0][baseLevel]->DepthLog2)); - maxLevels = ctx->Const.Max3DTextureLevels; - } else if (t->Target == GL_TEXTURE_CUBE_MAP_ARB) { maxLog2 = MAX2(t->Image[0][baseLevel]->WidthLog2, t->Image[0][baseLevel]->HeightLog2); @@ -503,49 +496,6 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx, } } } - else if (t->Target == GL_TEXTURE_3D) { - /* Test 3-D mipmaps */ - GLuint width = t->Image[0][baseLevel]->Width2; - GLuint height = t->Image[0][baseLevel]->Height2; - GLuint depth = t->Image[0][baseLevel]->Depth2; - for (i = baseLevel + 1; i < maxLevels; i++) { - if (width > 1) { - width /= 2; - } - if (height > 1) { - height /= 2; - } - if (depth > 1) { - depth /= 2; - } - if (i >= minLevel && i <= maxLevel) { - const struct gl_texture_image *img = t->Image[0][i]; - if (!img) { - incomplete(t, "3D Image[%d] is missing", i); - return; - } - if (img->_BaseFormat == GL_DEPTH_COMPONENT) { - incomplete(t, "GL_DEPTH_COMPONENT only works with 1/2D tex"); - return; - } - if (img->Width2 != width) { - incomplete(t, "3D Image[%d] bad width %u", i, img->Width2); - return; - } - if (img->Height2 != height) { - incomplete(t, "3D Image[%d] bad height %u", i, img->Height2); - return; - } - if (img->Depth2 != depth) { - incomplete(t, "3D Image[%d] bad depth %u", i, img->Depth2); - return; - } - } - if (width == 1 && height == 1 && depth == 1) { - return; /* found smallest needed mipmap, all done! */ - } - } - } else if (t->Target == GL_TEXTURE_CUBE_MAP_ARB) { /* make sure 6 cube faces are consistant */ GLuint width = t->Image[0][baseLevel]->Width2; @@ -863,8 +813,6 @@ target_enum_to_index(GLenum target) return TEXTURE_1D_INDEX; case GL_TEXTURE_2D: return TEXTURE_2D_INDEX; - case GL_TEXTURE_3D: - return TEXTURE_3D_INDEX; case GL_TEXTURE_CUBE_MAP_ARB: return TEXTURE_CUBE_INDEX; default: diff --git a/dll/opengl/mesa/main/texparam.c b/dll/opengl/mesa/main/texparam.c index 539bc189d57..8109e553f4e 100644 --- a/dll/opengl/mesa/main/texparam.c +++ b/dll/opengl/mesa/main/texparam.c @@ -71,8 +71,6 @@ get_texobj(struct gl_context *ctx, GLenum target, GLboolean get) return texUnit->CurrentTex[TEXTURE_1D_INDEX]; case GL_TEXTURE_2D: return texUnit->CurrentTex[TEXTURE_2D_INDEX]; - case GL_TEXTURE_3D: - return texUnit->CurrentTex[TEXTURE_3D_INDEX]; case GL_TEXTURE_CUBE_MAP: if (ctx->Extensions.ARB_texture_cube_map) { return texUnit->CurrentTex[TEXTURE_CUBE_INDEX]; @@ -247,18 +245,10 @@ set_tex_parameterf(struct gl_context *ctx, case GL_TEXTURE_BORDER_COLOR: flush(ctx); - /* ARB_texture_float disables clamping */ - if (ctx->Extensions.ARB_texture_float) { - texObj->Sampler.BorderColor.f[RCOMP] = params[0]; - texObj->Sampler.BorderColor.f[GCOMP] = params[1]; - texObj->Sampler.BorderColor.f[BCOMP] = params[2]; - texObj->Sampler.BorderColor.f[ACOMP] = params[3]; - } else { - texObj->Sampler.BorderColor.f[RCOMP] = CLAMP(params[0], 0.0F, 1.0F); - texObj->Sampler.BorderColor.f[GCOMP] = CLAMP(params[1], 0.0F, 1.0F); - texObj->Sampler.BorderColor.f[BCOMP] = CLAMP(params[2], 0.0F, 1.0F); - texObj->Sampler.BorderColor.f[ACOMP] = CLAMP(params[3], 0.0F, 1.0F); - } + texObj->Sampler.BorderColor.f[RCOMP] = CLAMP(params[0], 0.0F, 1.0F); + texObj->Sampler.BorderColor.f[GCOMP] = CLAMP(params[1], 0.0F, 1.0F); + texObj->Sampler.BorderColor.f[BCOMP] = CLAMP(params[2], 0.0F, 1.0F); + texObj->Sampler.BorderColor.f[ACOMP] = CLAMP(params[3], 0.0F, 1.0F); return GL_TRUE; default: @@ -634,22 +624,6 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, } break; - /* GL_ARB_texture_float */ - case GL_TEXTURE_RED_TYPE_ARB: - case GL_TEXTURE_GREEN_TYPE_ARB: - case GL_TEXTURE_BLUE_TYPE_ARB: - case GL_TEXTURE_ALPHA_TYPE_ARB: - case GL_TEXTURE_LUMINANCE_TYPE_ARB: - case GL_TEXTURE_INTENSITY_TYPE_ARB: - case GL_TEXTURE_DEPTH_TYPE_ARB: - if (!ctx->Extensions.ARB_texture_float) - goto invalid_pname; - if (_mesa_base_format_has_channel(img->_BaseFormat, pname)) - *params = _mesa_get_format_datatype(texFormat); - else - *params = GL_NONE; - break; - default: goto invalid_pname; } diff --git a/dll/opengl/mesa/main/texstate.c b/dll/opengl/mesa/main/texstate.c index 48d32b82bc6..ffe8ec13feb 100644 --- a/dll/opengl/mesa/main/texstate.c +++ b/dll/opengl/mesa/main/texstate.c @@ -502,7 +502,6 @@ alloc_proxy_textures( struct gl_context *ctx ) */ static const GLenum targets[] = { GL_TEXTURE_CUBE_MAP_ARB, - GL_TEXTURE_3D, GL_TEXTURE_2D, GL_TEXTURE_1D, }; diff --git a/dll/opengl/mesa/main/texstorage.c b/dll/opengl/mesa/main/texstorage.c index 1de2f71fa73..0af95d076ca 100644 --- a/dll/opengl/mesa/main/texstorage.c +++ b/dll/opengl/mesa/main/texstorage.c @@ -58,14 +58,6 @@ legal_texobj_target(struct gl_context *ctx, GLuint dims, GLenum target) default: return GL_FALSE; } - case 3: - switch (target) { - case GL_TEXTURE_3D: - case GL_PROXY_TEXTURE_3D: - return GL_TRUE; - default: - return GL_FALSE; - } default: _mesa_problem(ctx, "invalid dims=%u in legal_texobj_target()", dims); return GL_FALSE; diff --git a/dll/opengl/mesa/main/texstore.c b/dll/opengl/mesa/main/texstore.c index 397c69775d5..77747dc3586 100644 --- a/dll/opengl/mesa/main/texstore.c +++ b/dll/opengl/mesa/main/texstore.c @@ -39,7 +39,6 @@ * code: * ctx->Driver.TexImage1D = _mesa_store_teximage1d; * ctx->Driver.TexImage2D = _mesa_store_teximage2d; - * ctx->Driver.TexImage3D = _mesa_store_teximage3d; * etc... * * Texture image processing is actually kind of complicated. We have to do: @@ -2563,153 +2562,6 @@ _mesa_texstore_s8(TEXSTORE_PARAMS) } -/** - * Store an image in any of the formats: - * _mesa_texformat_rgba_float32 - * _mesa_texformat_rgb_float32 - * _mesa_texformat_alpha_float32 - * _mesa_texformat_luminance_float32 - * _mesa_texformat_luminance_alpha_float32 - * _mesa_texformat_intensity_float32 - */ -static GLboolean -_mesa_texstore_rgba_float32(TEXSTORE_PARAMS) -{ - const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - const GLint components = _mesa_components_in_format(baseFormat); - - ASSERT(dstFormat == MESA_FORMAT_RGBA_FLOAT32 || - dstFormat == MESA_FORMAT_RGB_FLOAT32 || - dstFormat == MESA_FORMAT_ALPHA_FLOAT32 || - dstFormat == MESA_FORMAT_LUMINANCE_FLOAT32 || - dstFormat == MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32 || - dstFormat == MESA_FORMAT_INTENSITY_FLOAT32 || - dstFormat == MESA_FORMAT_R_FLOAT32 || - dstFormat == MESA_FORMAT_RG_FLOAT32); - ASSERT(baseInternalFormat == GL_RGBA || - baseInternalFormat == GL_RGB || - baseInternalFormat == GL_ALPHA || - baseInternalFormat == GL_LUMINANCE || - baseInternalFormat == GL_LUMINANCE_ALPHA || - baseInternalFormat == GL_INTENSITY || - baseInternalFormat == GL_RED || - baseInternalFormat == GL_RG); - ASSERT(_mesa_get_format_bytes(dstFormat) == components * sizeof(GLfloat)); - - if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - baseInternalFormat == srcFormat && - baseInternalFormat == baseFormat && - srcType == GL_FLOAT) { - /* simple memcpy path */ - memcpy_texture(ctx, dims, - dstFormat, - dstRowStride, dstSlices, - srcWidth, srcHeight, srcDepth, srcFormat, srcType, - srcAddr, srcPacking); - } - else { - /* general path */ - const GLfloat *tempImage = _mesa_make_temp_float_image(ctx, dims, - baseInternalFormat, - baseFormat, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, srcAddr, - srcPacking, - ctx->_ImageTransferState); - const GLfloat *srcRow = tempImage; - GLint bytesPerRow; - GLint img, row; - if (!tempImage) - return GL_FALSE; - bytesPerRow = srcWidth * components * sizeof(GLfloat); - for (img = 0; img < srcDepth; img++) { - GLubyte *dstRow = dstSlices[img]; - for (row = 0; row < srcHeight; row++) { - memcpy(dstRow, srcRow, bytesPerRow); - dstRow += dstRowStride; - srcRow += srcWidth * components; - } - } - - free((void *) tempImage); - } - return GL_TRUE; -} - - - -/** - * As above, but store 16-bit floats. - */ -static GLboolean -_mesa_texstore_rgba_float16(TEXSTORE_PARAMS) -{ - const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - const GLint components = _mesa_components_in_format(baseFormat); - - ASSERT(dstFormat == MESA_FORMAT_RGBA_FLOAT16 || - dstFormat == MESA_FORMAT_RGB_FLOAT16 || - dstFormat == MESA_FORMAT_ALPHA_FLOAT16 || - dstFormat == MESA_FORMAT_LUMINANCE_FLOAT16 || - dstFormat == MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16 || - dstFormat == MESA_FORMAT_INTENSITY_FLOAT16 || - dstFormat == MESA_FORMAT_R_FLOAT16 || - dstFormat == MESA_FORMAT_RG_FLOAT16); - ASSERT(baseInternalFormat == GL_RGBA || - baseInternalFormat == GL_RGB || - baseInternalFormat == GL_ALPHA || - baseInternalFormat == GL_LUMINANCE || - baseInternalFormat == GL_LUMINANCE_ALPHA || - baseInternalFormat == GL_INTENSITY || - baseInternalFormat == GL_RED || - baseInternalFormat == GL_RG); - ASSERT(_mesa_get_format_bytes(dstFormat) == components * sizeof(GLhalfARB)); - - if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - baseInternalFormat == srcFormat && - baseInternalFormat == baseFormat && - srcType == GL_HALF_FLOAT_ARB) { - /* simple memcpy path */ - memcpy_texture(ctx, dims, - dstFormat, - dstRowStride, dstSlices, - srcWidth, srcHeight, srcDepth, srcFormat, srcType, - srcAddr, srcPacking); - } - else { - /* general path */ - const GLfloat *tempImage = _mesa_make_temp_float_image(ctx, dims, - baseInternalFormat, - baseFormat, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, srcAddr, - srcPacking, - ctx->_ImageTransferState); - const GLfloat *src = tempImage; - GLint img, row; - if (!tempImage) - return GL_FALSE; - for (img = 0; img < srcDepth; img++) { - GLubyte *dstRow = dstSlices[img]; - for (row = 0; row < srcHeight; row++) { - GLhalfARB *dstTexel = (GLhalfARB *) dstRow; - GLint i; - for (i = 0; i < srcWidth * components; i++) { - dstTexel[i] = _mesa_float_to_half(src[i]); - } - dstRow += dstRowStride; - src += srcWidth * components; - } - } - - free((void *) tempImage); - } - return GL_TRUE; -} - - /* non-normalized, signed int8 */ static GLboolean _mesa_texstore_rgba_int8(TEXSTORE_PARAMS) @@ -3186,18 +3038,6 @@ _mesa_get_texstore_func(gl_format format) table[MESA_FORMAT_Z24_X8] = _mesa_texstore_z24_x8; table[MESA_FORMAT_Z32] = _mesa_texstore_z32; table[MESA_FORMAT_S8] = _mesa_texstore_s8; - table[MESA_FORMAT_RGBA_FLOAT32] = _mesa_texstore_rgba_float32; - table[MESA_FORMAT_RGBA_FLOAT16] = _mesa_texstore_rgba_float16; - table[MESA_FORMAT_RGB_FLOAT32] = _mesa_texstore_rgba_float32; - table[MESA_FORMAT_RGB_FLOAT16] = _mesa_texstore_rgba_float16; - table[MESA_FORMAT_ALPHA_FLOAT32] = _mesa_texstore_rgba_float32; - table[MESA_FORMAT_ALPHA_FLOAT16] = _mesa_texstore_rgba_float16; - table[MESA_FORMAT_LUMINANCE_FLOAT32] = _mesa_texstore_rgba_float32; - table[MESA_FORMAT_LUMINANCE_FLOAT16] = _mesa_texstore_rgba_float16; - table[MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32] = _mesa_texstore_rgba_float32; - table[MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16] = _mesa_texstore_rgba_float16; - table[MESA_FORMAT_INTENSITY_FLOAT32] = _mesa_texstore_rgba_float32; - table[MESA_FORMAT_INTENSITY_FLOAT16] = _mesa_texstore_rgba_float16; table[MESA_FORMAT_SIGNED_RGBA_16] = _mesa_texstore_signed_rgba_16; table[MESA_FORMAT_RGBA_16] = _mesa_texstore_rgba_16; @@ -3318,9 +3158,6 @@ store_texsubimage(struct gl_context *ctx, case GL_TEXTURE_1D: dims = 1; break; - case GL_TEXTURE_3D: - dims = 3; - break; default: dims = 2; } @@ -3342,13 +3179,6 @@ store_texsubimage(struct gl_context *ctx, assert(yoffset == 0); assert(zoffset == 0); break; - case GL_TEXTURE_3D: - /* we'll store 3D images as a series of slices */ - numSlices = depth; - sliceOffset = zoffset; - srcImageStride = _mesa_image_image_stride(packing, width, height, - format, type); - break; default: _mesa_warning(ctx, "Unexpected target 0x%x in store_texsubimage()", target); return; @@ -3446,34 +3276,6 @@ _mesa_store_teximage2d(struct gl_context *ctx, -/** - * This is the fallback for Driver.TexImage3D(). - */ -void -_mesa_store_teximage3d(struct gl_context *ctx, - struct gl_texture_image *texImage, - GLint internalFormat, - GLint width, GLint height, GLint depth, GLint border, - GLenum format, GLenum type, const void *pixels, - const struct gl_pixelstore_attrib *packing) -{ - if (width == 0 || height == 0 || depth == 0) - return; - - /* allocate storage for texture data */ - if (!ctx->Driver.AllocTextureImageBuffer(ctx, texImage, texImage->TexFormat, - width, height, depth)) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage3D"); - return; - } - - store_texsubimage(ctx, texImage, - 0, 0, 0, width, height, depth, - format, type, pixels, packing, "glTexImage3D"); -} - - - /* * This is the fallback for Driver.TexSubImage1D(). @@ -3507,20 +3309,3 @@ _mesa_store_texsubimage2d(struct gl_context *ctx, xoffset, yoffset, 0, width, height, 1, format, type, pixels, packing, "glTexSubImage2D"); } - - -/* - * This is the fallback for Driver.TexSubImage3D(). - */ -void -_mesa_store_texsubimage3d(struct gl_context *ctx, - struct gl_texture_image *texImage, - GLint xoffset, GLint yoffset, GLint zoffset, - GLint width, GLint height, GLint depth, - GLenum format, GLenum type, const void *pixels, - const struct gl_pixelstore_attrib *packing) -{ - store_texsubimage(ctx, texImage, - xoffset, yoffset, zoffset, width, height, depth, - format, type, pixels, packing, "glTexSubImage3D"); -} diff --git a/dll/opengl/mesa/main/texstore.h b/dll/opengl/mesa/main/texstore.h index 42067ddcc25..07f20165b67 100644 --- a/dll/opengl/mesa/main/texstore.h +++ b/dll/opengl/mesa/main/texstore.h @@ -107,15 +107,6 @@ _mesa_store_teximage2d(struct gl_context *ctx, const struct gl_pixelstore_attrib *packing); -extern void -_mesa_store_teximage3d(struct gl_context *ctx, - struct gl_texture_image *texImage, - GLint internalFormat, - GLint width, GLint height, GLint depth, GLint border, - GLenum format, GLenum type, const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing); - - extern void _mesa_store_texsubimage1d(struct gl_context *ctx, struct gl_texture_image *texImage, @@ -133,13 +124,4 @@ _mesa_store_texsubimage2d(struct gl_context *ctx, const struct gl_pixelstore_attrib *packing); -extern void -_mesa_store_texsubimage3d(struct gl_context *ctx, - struct gl_texture_image *texImage, - GLint xoffset, GLint yoffset, GLint zoffset, - GLint width, GLint height, GLint depth, - GLenum format, GLenum type, const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing); - - #endif diff --git a/dll/opengl/mesa/main/texturebarrier.c b/dll/opengl/mesa/main/texturebarrier.c deleted file mode 100644 index c9b77c3f465..00000000000 --- a/dll/opengl/mesa/main/texturebarrier.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright © 2011 Marek Olšák - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -/** - * \file texturebarrier.c - * Implementation of glTextureBarrierNV. - * - * \author Marek Olšák - */ - -#include - -static void -_mesa_texture_barrier(struct gl_context *ctx) -{ - /* no-op */ -} - -void -_mesa_init_texture_barrier_functions(struct dd_function_table *driver) -{ - driver->TextureBarrier = _mesa_texture_barrier; -} - -void GLAPIENTRY -_mesa_TextureBarrierNV(void) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - ctx->Driver.TextureBarrier(ctx); -} diff --git a/dll/opengl/mesa/main/texturebarrier.h b/dll/opengl/mesa/main/texturebarrier.h deleted file mode 100644 index a84a85b2176..00000000000 --- a/dll/opengl/mesa/main/texturebarrier.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright © 2011 Marek Olšák - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -/** - * \file texturebarrier.h - * GL_NV_texture_barrier - * - * \author Marek Olšák - */ - -#ifndef TEXTUREBARRIER_H -#define TEXTUREBARRIER_H - -#include "glheader.h" - -struct dd_function_table; - -extern void -_mesa_init_texture_barrier_functions(struct dd_function_table *driver); - -extern void GLAPIENTRY -_mesa_TextureBarrierNV(void); - -#endif /* TEXTUREBARRIER_H */ diff --git a/dll/opengl/mesa/main/varray.c b/dll/opengl/mesa/main/varray.c index a8b2b395c17..ab2a870f61d 100644 --- a/dll/opengl/mesa/main/varray.c +++ b/dll/opengl/mesa/main/varray.c @@ -59,11 +59,6 @@ type_to_bit(const struct gl_context *ctx, GLenum type) return INT_BIT; case GL_UNSIGNED_INT: return UNSIGNED_INT_BIT; - case GL_HALF_FLOAT: - if (ctx->Extensions.ARB_half_float_vertex) - return HALF_BIT; - else - return 0x0; case GL_FLOAT: return FLOAT_BIT; case GL_DOUBLE: @@ -123,18 +118,9 @@ update_array(struct gl_context *ctx, return; } - if (ctx->Array.ArrayObj->ARBsemantics && - !_mesa_is_bufferobj(ctx->Array.ArrayBufferObj)) { - /* GL_ARB_vertex_array_object requires that all arrays reside in VBOs. - * Generate GL_INVALID_OPERATION if that's not true. - */ - _mesa_error(ctx, GL_INVALID_OPERATION, "%s(non-VBO array)", func); - return; - } - elementSize = _mesa_sizeof_type(type) * size; - array = &ctx->Array.ArrayObj->VertexAttrib[attrib]; + array = &ctx->Array.VertexAttrib[attrib]; array->Size = size; array->Type = type; array->Stride = stride; @@ -144,9 +130,6 @@ update_array(struct gl_context *ctx, array->Ptr = (const GLubyte *) ptr; array->_ElementSize = elementSize; - _mesa_reference_buffer_object(ctx, &array->BufferObj, - ctx->Array.ArrayBufferObj); - ctx->NewState |= _NEW_ARRAY; ctx->Array.NewState |= VERT_BIT(attrib); } @@ -190,7 +173,7 @@ _mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - update_array(ctx, "glColorPointer", VERT_ATTRIB_COLOR0, + update_array(ctx, "glColorPointer", VERT_ATTRIB_COLOR, legalTypes, 3, 4, size, type, stride, GL_TRUE, GL_FALSE, ptr); } @@ -223,23 +206,6 @@ _mesa_IndexPointer(GLenum type, GLsizei stride, const GLvoid *ptr) } -void GLAPIENTRY -_mesa_SecondaryColorPointerEXT(GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr) -{ - const GLbitfield legalTypes = (BYTE_BIT | UNSIGNED_BYTE_BIT | - SHORT_BIT | UNSIGNED_SHORT_BIT | - INT_BIT | UNSIGNED_INT_BIT | - HALF_BIT | FLOAT_BIT | DOUBLE_BIT); - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - update_array(ctx, "glSecondaryColorPointer", VERT_ATTRIB_COLOR1, - legalTypes, 3, 4, - size, type, stride, GL_TRUE, GL_FALSE, ptr); -} - - void GLAPIENTRY _mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) @@ -614,46 +580,22 @@ _mesa_copy_client_array(struct gl_context *ctx, dst->_MaxElement = src->_MaxElement; } - - -/** - * Print vertex array's fields. - */ static void -print_array(const char *name, GLint index, const struct gl_client_array *array) +init_array(struct gl_context *ctx, + struct gl_client_array *array, GLint size, GLint type) { - if (index >= 0) - printf(" %s[%d]: ", name, index); - else - printf(" %s: ", name); - printf("Ptr=%p, Type=0x%x, Size=%d, ElemSize=%u, Stride=%d, Buffer=%u(Size %lu), MaxElem=%u\n", - array->Ptr, array->Type, array->Size, - array->_ElementSize, array->StrideB, - array->BufferObj->Name, (unsigned long) array->BufferObj->Size, - array->_MaxElement); -} - - -/** - * Print current vertex object/array info. For debug. - */ -void -_mesa_print_arrays(struct gl_context *ctx) -{ - struct gl_array_object *arrayObj = ctx->Array.ArrayObj; - - _mesa_update_array_object_max_element(ctx, arrayObj); - - printf("Array Object %u\n", arrayObj->Name); - if (arrayObj->VertexAttrib[VERT_ATTRIB_POS].Enabled) - print_array("Vertex", -1, &arrayObj->VertexAttrib[VERT_ATTRIB_POS]); - if (arrayObj->VertexAttrib[VERT_ATTRIB_NORMAL].Enabled) - print_array("Normal", -1, &arrayObj->VertexAttrib[VERT_ATTRIB_NORMAL]); - if (arrayObj->VertexAttrib[VERT_ATTRIB_COLOR0].Enabled) - print_array("Color", -1, &arrayObj->VertexAttrib[VERT_ATTRIB_COLOR0]); - if (arrayObj->VertexAttrib[VERT_ATTRIB_TEX].Enabled) - print_array("TexCoord", -1, &arrayObj->VertexAttrib[VERT_ATTRIB_TEX]); - printf(" _MaxElement = %u\n", arrayObj->_MaxElement); + array->Size = size; + array->Type = type; + array->Stride = 0; + array->StrideB = 0; + array->Ptr = NULL; + array->Enabled = GL_FALSE; + array->Normalized = GL_FALSE; + array->Integer = GL_FALSE; + array->_ElementSize = size * _mesa_sizeof_type(type); + /* Vertex array buffers */ + _mesa_reference_buffer_object(ctx, &array->BufferObj, + ctx->Shared->NullBufferObj); } @@ -661,25 +603,33 @@ _mesa_print_arrays(struct gl_context *ctx) * Initialize vertex array state for given context. */ void -_mesa_init_varray(struct gl_context *ctx) +_mesa_init_varray(struct gl_context *ctx, struct gl_array_attrib *array) { - ctx->Array.DefaultArrayObj = _mesa_new_array_object(ctx, 0); - _mesa_reference_array_object(ctx, &ctx->Array.ArrayObj, - ctx->Array.DefaultArrayObj); + GLuint i; - ctx->Array.Objects = _mesa_NewHashTable(); -} - - -/** - * Callback for deleting an array object. Called by _mesa_HashDeleteAll(). - */ -static void -delete_arrayobj_cb(GLuint id, void *data, void *userData) -{ - struct gl_array_object *arrayObj = (struct gl_array_object *) data; - struct gl_context *ctx = (struct gl_context *) userData; - _mesa_delete_array_object(ctx, arrayObj); + /* Init the individual arrays */ + for (i = 0; i < Elements(array->VertexAttrib); i++) { + switch (i) { + case VERT_ATTRIB_WEIGHT: + init_array(ctx, &array->VertexAttrib[VERT_ATTRIB_WEIGHT], 1, GL_FLOAT); + break; + case VERT_ATTRIB_NORMAL: + init_array(ctx, &array->VertexAttrib[VERT_ATTRIB_NORMAL], 3, GL_FLOAT); + break; + case VERT_ATTRIB_FOG: + init_array(ctx, &array->VertexAttrib[VERT_ATTRIB_FOG], 1, GL_FLOAT); + break; + case VERT_ATTRIB_COLOR_INDEX: + init_array(ctx, &array->VertexAttrib[VERT_ATTRIB_COLOR_INDEX], 1, GL_FLOAT); + break; + case VERT_ATTRIB_EDGEFLAG: + init_array(ctx, &array->VertexAttrib[VERT_ATTRIB_EDGEFLAG], 1, GL_BOOL); + break; + default: + init_array(ctx, &array->VertexAttrib[i], 4, GL_FLOAT); + break; + } + } } @@ -687,8 +637,14 @@ delete_arrayobj_cb(GLuint id, void *data, void *userData) * Free vertex array state for given context. */ void -_mesa_free_varray_data(struct gl_context *ctx) +_mesa_free_varray_data(struct gl_context *ctx, struct gl_array_attrib* array) { - _mesa_HashDeleteAll(ctx->Array.Objects, delete_arrayobj_cb, ctx); - _mesa_DeleteHashTable(ctx->Array.Objects); + GLuint i; + + /* Uninit the individual arrays */ + for (i = 0; i < Elements(array->VertexAttrib); i++) + { + _mesa_reference_buffer_object(ctx, &array->VertexAttrib[i].BufferObj, NULL); + memset(&array->VertexAttrib[i], 0, sizeof(struct gl_client_array)); + } } diff --git a/dll/opengl/mesa/main/varray.h b/dll/opengl/mesa/main/varray.h index 9b3b1c50604..0a984bcec88 100644 --- a/dll/opengl/mesa/main/varray.h +++ b/dll/opengl/mesa/main/varray.h @@ -132,11 +132,6 @@ extern void GLAPIENTRY _mesa_FogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid *ptr); -extern void GLAPIENTRY -_mesa_SecondaryColorPointerEXT(GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr); - - extern void GLAPIENTRY _mesa_InterleavedArrays(GLenum format, GLsizei stride, const GLvoid *pointer); @@ -165,25 +160,17 @@ extern void GLAPIENTRY _mesa_DrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices); -extern void GLAPIENTRY -_mesa_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, - GLenum type, const GLvoid *indices); - extern void _mesa_copy_client_array(struct gl_context *ctx, struct gl_client_array *dst, struct gl_client_array *src); - extern void -_mesa_print_arrays(struct gl_context *ctx); - -extern void -_mesa_init_varray( struct gl_context * ctx ); +_mesa_init_varray( struct gl_context * ctx, struct gl_array_attrib *array); extern void -_mesa_free_varray_data(struct gl_context *ctx); +_mesa_free_varray_data(struct gl_context *ctx, struct gl_array_attrib *array); #else diff --git a/dll/opengl/mesa/main/version.c b/dll/opengl/mesa/main/version.c index 55d3769c94c..89c912cbd1b 100644 --- a/dll/opengl/mesa/main/version.c +++ b/dll/opengl/mesa/main/version.c @@ -56,80 +56,22 @@ override_version(struct gl_context *ctx, GLuint *major, GLuint *minor) static void compute_version(struct gl_context *ctx) { - GLuint major, minor; - static const int max = 100; + /* report openGL 1.1 */ + ctx->VersionMajor = 1; + ctx->VersionMinor = 1; - const GLboolean ver_1_3 = (ctx->Extensions.ARB_texture_cube_map && - ctx->Extensions.ARB_texture_env_combine && - ctx->Extensions.ARB_texture_env_dot3); - const GLboolean ver_1_4 = (ver_1_3 && - ctx->Extensions.ARB_texture_env_crossbar && - ctx->Extensions.ARB_window_pos && - ctx->Extensions.EXT_blend_color && - ctx->Extensions.EXT_blend_func_separate && - ctx->Extensions.EXT_blend_minmax && - ctx->Extensions.EXT_fog_coord && - ctx->Extensions.EXT_point_parameters && - ctx->Extensions.EXT_secondary_color); - const GLboolean ver_1_5 = (ver_1_4 && - ctx->Extensions.EXT_shadow_funcs); - const GLboolean ver_2_0 = (ver_1_5 && - ctx->Extensions.ARB_point_sprite && - ctx->Extensions.ARB_texture_non_power_of_two && - ctx->Extensions.EXT_blend_equation_separate); - const GLboolean ver_2_1 = (ver_2_0); - const GLboolean ver_3_0 = (ver_2_1 && - ctx->Extensions.ARB_half_float_pixel && - ctx->Extensions.ARB_half_float_vertex && - ctx->Extensions.ARB_map_buffer_range && - ctx->Extensions.ARB_texture_float && - ctx->Extensions.APPLE_vertex_array_object); + override_version(ctx, &ctx->VersionMajor, &ctx->VersionMinor); - - if (ver_3_0) { - major = 3; - minor = 0; - } - else if (ver_2_1) { - major = 2; - minor = 1; - } - else if (ver_2_0) { - major = 2; - minor = 0; - } - else if (ver_1_5) { - major = 1; - minor = 5; - } - else if (ver_1_4) { - major = 1; - minor = 4; - } - else if (ver_1_3) { - major = 1; - minor = 3; - } - else { - major = 1; - minor = 2; - } - - ctx->VersionMajor = major; - ctx->VersionMinor = minor; - - override_version(ctx, &ctx->VersionMajor, &ctx->VersionMinor); - - ctx->VersionString = (char *) malloc(max); - if (ctx->VersionString) { - _mesa_snprintf(ctx->VersionString, max, - "%u.%u Mesa " MESA_VERSION_STRING + ctx->VersionString = (char *) malloc(20); + if (ctx->VersionString) { + _mesa_snprintf(ctx->VersionString, 20, + "%u.%u Mesa " MESA_VERSION_STRING #ifdef MESA_GIT_SHA1 - " (" MESA_GIT_SHA1 ")" + " (" MESA_GIT_SHA1 ")" #endif - , - ctx->VersionMajor, ctx->VersionMinor); - } + , + ctx->VersionMajor, ctx->VersionMinor); + } } /** diff --git a/dll/opengl/mesa/main/vtxfmt.c b/dll/opengl/mesa/main/vtxfmt.c index 8839c6a4071..877a4714f6e 100644 --- a/dll/opengl/mesa/main/vtxfmt.c +++ b/dll/opengl/mesa/main/vtxfmt.c @@ -54,8 +54,6 @@ install_vtxfmt( struct _glapi_table *tab, const GLvertexformat *vfmt ) SET_Materialfv(tab, vfmt->Materialfv); SET_Normal3f(tab, vfmt->Normal3f); SET_Normal3fv(tab, vfmt->Normal3fv); - SET_SecondaryColor3fEXT(tab, vfmt->SecondaryColor3fEXT); - SET_SecondaryColor3fvEXT(tab, vfmt->SecondaryColor3fvEXT); SET_TexCoord1f(tab, vfmt->TexCoord1f); SET_TexCoord1fv(tab, vfmt->TexCoord1fv); SET_TexCoord2f(tab, vfmt->TexCoord2f); @@ -80,7 +78,6 @@ install_vtxfmt( struct _glapi_table *tab, const GLvertexformat *vfmt ) SET_DrawArrays(tab, vfmt->DrawArrays); SET_DrawElements(tab, vfmt->DrawElements); - SET_DrawRangeElements(tab, vfmt->DrawRangeElements); /* GL_NV_vertex_program */ SET_VertexAttrib1fNV(tab, vfmt->VertexAttrib1fNV); diff --git a/dll/opengl/mesa/swrast/CMakeLists.txt b/dll/opengl/mesa/swrast/CMakeLists.txt index f818adb5aad..bc78d599e76 100644 --- a/dll/opengl/mesa/swrast/CMakeLists.txt +++ b/dll/opengl/mesa/swrast/CMakeLists.txt @@ -32,3 +32,7 @@ add_pch(mesa_swrast precomp.h SOURCE) if(NOT MSVC) allow_warnings(mesa_swrast) endif() + +if(NOT MSVC) + add_target_compile_flags(mesa_swrast "-Wno-unused-variable") +endif() diff --git a/dll/opengl/mesa/swrast/s_aaline.c b/dll/opengl/mesa/swrast/s_aaline.c index 233fa78af29..05085adccbb 100644 --- a/dll/opengl/mesa/swrast/s_aaline.c +++ b/dll/opengl/mesa/swrast/s_aaline.c @@ -470,9 +470,6 @@ _swrast_choose_aa_line_function(struct gl_context *ctx) ASSERT(ctx->Line.SmoothFlag); if (ctx->Texture._EnabledCoord - || (ctx->Light.Enabled && - ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) - || ctx->Fog.ColorSumEnabled || swrast->_FogEnabled) { swrast->Line = aa_general_rgba_line; } diff --git a/dll/opengl/mesa/swrast/s_aatriangle.c b/dll/opengl/mesa/swrast/s_aatriangle.c index 269531ac4e9..ad27fa62c79 100644 --- a/dll/opengl/mesa/swrast/s_aatriangle.c +++ b/dll/opengl/mesa/swrast/s_aatriangle.c @@ -289,8 +289,7 @@ _swrast_set_aa_triangle_function(struct gl_context *ctx) ASSERT(ctx->Polygon.SmoothFlag); if (ctx->Texture._EnabledCoord - || swrast->_FogEnabled - || _mesa_need_secondary_color(ctx)) { + || swrast->_FogEnabled) { SWRAST_CONTEXT(ctx)->Triangle = general_aa_tri; } else { diff --git a/dll/opengl/mesa/swrast/s_alpha.c b/dll/opengl/mesa/swrast/s_alpha.c index f3f882e92b5..32f66b9cdd6 100644 --- a/dll/opengl/mesa/swrast/s_alpha.c +++ b/dll/opengl/mesa/swrast/s_alpha.c @@ -116,7 +116,7 @@ _swrast_alpha_test(const struct gl_context *ctx, SWspan *span) ALPHA_TEST(rgba[i][ACOMP], ;); } else { - GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; + GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL]; const GLfloat ref = ctx->Color.AlphaRef; ALPHA_TEST(rgba[i][ACOMP], ;); } diff --git a/dll/opengl/mesa/swrast/s_blend.c b/dll/opengl/mesa/swrast/s_blend.c index 2f5e319cb71..fa73e28e568 100644 --- a/dll/opengl/mesa/swrast/s_blend.c +++ b/dll/opengl/mesa/swrast/s_blend.c @@ -292,113 +292,6 @@ blend_add(struct gl_context *ctx, GLuint n, const GLubyte mask[], -/** - * Blend min function. - * Any chanType ok. - */ -static void _BLENDAPI -blend_min(struct gl_context *ctx, GLuint n, const GLubyte mask[], - GLvoid *src, const GLvoid *dst, GLenum chanType) -{ - GLuint i; - ASSERT(ctx->Color.EquationRGB == GL_MIN); - ASSERT(ctx->Color.EquationA == GL_MIN); - (void) ctx; - - if (chanType == GL_UNSIGNED_BYTE) { - GLubyte (*rgba)[4] = (GLubyte (*)[4]) src; - const GLubyte (*dest)[4] = (const GLubyte (*)[4]) dst; - for (i=0;iColor.EquationRGB == GL_MAX); - ASSERT(ctx->Color.EquationA == GL_MAX); - (void) ctx; - - if (chanType == GL_UNSIGNED_BYTE) { - GLubyte (*rgba)[4] = (GLubyte (*)[4]) src; - const GLubyte (*dest)[4] = (const GLubyte (*)[4]) dst; - for (i=0;iColor.SrcRGB) { + switch (ctx->Color.SrcFactor) { case GL_ZERO: - sR = sG = sB = 0.0F; + sR = sG = sB = sA = 0.0F; break; case GL_ONE: - sR = sG = sB = 1.0F; + sR = sG = sB = sA = 1.0F; break; case GL_DST_COLOR: sR = Rd; sG = Gd; sB = Bd; + sA = Ad; break; case GL_ONE_MINUS_DST_COLOR: sR = 1.0F - Rd; sG = 1.0F - Gd; sB = 1.0F - Bd; + sA = 1.0f - Ad; break; case GL_SRC_ALPHA: - sR = sG = sB = As; + sR = sG = sB = sA = As; break; case GL_ONE_MINUS_SRC_ALPHA: - sR = sG = sB = 1.0F - As; + sR = sG = sB = sA = 1.0F - As; break; case GL_DST_ALPHA: - sR = sG = sB = Ad; + sR = sG = sB = sA = Ad; break; case GL_ONE_MINUS_DST_ALPHA: - sR = sG = sB = 1.0F - Ad; + sR = sG = sB = sA = 1.0F - Ad; break; case GL_SRC_ALPHA_SATURATE: if (As < 1.0F - Ad) { - sR = sG = sB = As; + sR = sG = sB = sA = As; } else { - sR = sG = sB = 1.0F - Ad; + sR = sG = sB = sA = 1.0F - Ad; } break; - case GL_CONSTANT_COLOR: - sR = ctx->Color.BlendColor[0]; - sG = ctx->Color.BlendColor[1]; - sB = ctx->Color.BlendColor[2]; - break; - case GL_ONE_MINUS_CONSTANT_COLOR: - sR = 1.0F - ctx->Color.BlendColor[0]; - sG = 1.0F - ctx->Color.BlendColor[1]; - sB = 1.0F - ctx->Color.BlendColor[2]; - break; - case GL_CONSTANT_ALPHA: - sR = sG = sB = ctx->Color.BlendColor[3]; - break; - case GL_ONE_MINUS_CONSTANT_ALPHA: - sR = sG = sB = 1.0F - ctx->Color.BlendColor[3]; - break; case GL_SRC_COLOR: sR = Rs; sG = Gs; sB = Bs; + sA = As; break; case GL_ONE_MINUS_SRC_COLOR: sR = 1.0F - Rs; sG = 1.0F - Gs; sB = 1.0F - Bs; + sA = 1.0F - As; break; default: /* this should never happen */ @@ -557,234 +438,62 @@ blend_general_float(struct gl_context *ctx, GLuint n, const GLubyte mask[], return; } - /* Source Alpha factor */ - switch (ctx->Color.SrcA) { + /* Dest factor */ + switch (ctx->Color.DstFactor) { case GL_ZERO: - sA = 0.0F; + dR = dG = dB = dA = 0.0F; break; case GL_ONE: - sA = 1.0F; - break; - case GL_DST_COLOR: - sA = Ad; - break; - case GL_ONE_MINUS_DST_COLOR: - sA = 1.0F - Ad; - break; - case GL_SRC_ALPHA: - sA = As; - break; - case GL_ONE_MINUS_SRC_ALPHA: - sA = 1.0F - As; - break; - case GL_DST_ALPHA: - sA = Ad; - break; - case GL_ONE_MINUS_DST_ALPHA: - sA = 1.0F - Ad; - break; - case GL_SRC_ALPHA_SATURATE: - sA = 1.0; - break; - case GL_CONSTANT_COLOR: - sA = ctx->Color.BlendColor[3]; - break; - case GL_ONE_MINUS_CONSTANT_COLOR: - sA = 1.0F - ctx->Color.BlendColor[3]; - break; - case GL_CONSTANT_ALPHA: - sA = ctx->Color.BlendColor[3]; - break; - case GL_ONE_MINUS_CONSTANT_ALPHA: - sA = 1.0F - ctx->Color.BlendColor[3]; - break; - case GL_SRC_COLOR: - sA = As; - break; - case GL_ONE_MINUS_SRC_COLOR: - sA = 1.0F - As; - break; - default: - /* this should never happen */ - sA = 0.0F; - _mesa_problem(ctx, "Bad blend source A factor in blend_general_float"); - return; - } - - /* Dest RGB factor */ - switch (ctx->Color.DstRGB) { - case GL_ZERO: - dR = dG = dB = 0.0F; - break; - case GL_ONE: - dR = dG = dB = 1.0F; + dR = dG = dB = dA = 1.0F; break; case GL_SRC_COLOR: dR = Rs; dG = Gs; dB = Bs; + dA = As; break; case GL_ONE_MINUS_SRC_COLOR: dR = 1.0F - Rs; dG = 1.0F - Gs; dB = 1.0F - Bs; + dA = 1.0F - As; break; case GL_SRC_ALPHA: - dR = dG = dB = As; + dR = dG = dB = dA = As; break; case GL_ONE_MINUS_SRC_ALPHA: - dR = dG = dB = 1.0F - As; + dR = dG = dB = dA = 1.0F - As; break; case GL_DST_ALPHA: - dR = dG = dB = Ad; + dR = dG = dB = dA = Ad; break; case GL_ONE_MINUS_DST_ALPHA: - dR = dG = dB = 1.0F - Ad; - break; - case GL_CONSTANT_COLOR: - dR = ctx->Color.BlendColor[0]; - dG = ctx->Color.BlendColor[1]; - dB = ctx->Color.BlendColor[2]; - break; - case GL_ONE_MINUS_CONSTANT_COLOR: - dR = 1.0F - ctx->Color.BlendColor[0]; - dG = 1.0F - ctx->Color.BlendColor[1]; - dB = 1.0F - ctx->Color.BlendColor[2]; - break; - case GL_CONSTANT_ALPHA: - dR = dG = dB = ctx->Color.BlendColor[3]; - break; - case GL_ONE_MINUS_CONSTANT_ALPHA: - dR = dG = dB = 1.0F - ctx->Color.BlendColor[3]; + dR = dG = dB = dA = 1.0F - Ad; break; case GL_DST_COLOR: dR = Rd; dG = Gd; dB = Bd; + dA = Ad; break; case GL_ONE_MINUS_DST_COLOR: dR = 1.0F - Rd; dG = 1.0F - Gd; dB = 1.0F - Bd; - break; - default: - /* this should never happen */ - dR = dG = dB = 0.0F; - _mesa_problem(ctx, "Bad blend dest RGB factor in blend_general_float"); - return; - } - - /* Dest Alpha factor */ - switch (ctx->Color.DstA) { - case GL_ZERO: - dA = 0.0F; - break; - case GL_ONE: - dA = 1.0F; - break; - case GL_SRC_COLOR: - dA = As; - break; - case GL_ONE_MINUS_SRC_COLOR: - dA = 1.0F - As; - break; - case GL_SRC_ALPHA: - dA = As; - break; - case GL_ONE_MINUS_SRC_ALPHA: - dA = 1.0F - As; - break; - case GL_DST_ALPHA: - dA = Ad; - break; - case GL_ONE_MINUS_DST_ALPHA: - dA = 1.0F - Ad; - break; - case GL_CONSTANT_COLOR: - dA = ctx->Color.BlendColor[3]; - break; - case GL_ONE_MINUS_CONSTANT_COLOR: - dA = 1.0F - ctx->Color.BlendColor[3]; - break; - case GL_CONSTANT_ALPHA: - dA = ctx->Color.BlendColor[3]; - break; - case GL_ONE_MINUS_CONSTANT_ALPHA: - dA = 1.0F - ctx->Color.BlendColor[3]; - break; - case GL_DST_COLOR: - dA = Ad; - break; - case GL_ONE_MINUS_DST_COLOR: dA = 1.0F - Ad; break; default: /* this should never happen */ - dA = 0.0F; - _mesa_problem(ctx, "Bad blend dest A factor in blend_general_float"); + dR = dG = dB = dA = 0.0F; + _mesa_problem(ctx, "Bad blend dest factor in blend_general_float"); return; } - /* compute the blended RGB */ - switch (ctx->Color.EquationRGB) { - case GL_FUNC_ADD: - r = Rs * sR + Rd * dR; - g = Gs * sG + Gd * dG; - b = Bs * sB + Bd * dB; - a = As * sA + Ad * dA; - break; - case GL_FUNC_SUBTRACT: - r = Rs * sR - Rd * dR; - g = Gs * sG - Gd * dG; - b = Bs * sB - Bd * dB; - a = As * sA - Ad * dA; - break; - case GL_FUNC_REVERSE_SUBTRACT: - r = Rd * dR - Rs * sR; - g = Gd * dG - Gs * sG; - b = Bd * dB - Bs * sB; - a = Ad * dA - As * sA; - break; - case GL_MIN: - r = MIN2( Rd, Rs ); - g = MIN2( Gd, Gs ); - b = MIN2( Bd, Bs ); - break; - case GL_MAX: - r = MAX2( Rd, Rs ); - g = MAX2( Gd, Gs ); - b = MAX2( Bd, Bs ); - break; - default: - /* should never get here */ - r = g = b = 0.0F; /* silence uninitialized var warning */ - _mesa_problem(ctx, "unexpected BlendEquation in blend_general()"); - return; - } - - /* compute the blended alpha */ - switch (ctx->Color.EquationA) { - case GL_FUNC_ADD: - a = As * sA + Ad * dA; - break; - case GL_FUNC_SUBTRACT: - a = As * sA - Ad * dA; - break; - case GL_FUNC_REVERSE_SUBTRACT: - a = Ad * dA - As * sA; - break; - case GL_MIN: - a = MIN2( Ad, As ); - break; - case GL_MAX: - a = MAX2( Ad, As ); - break; - default: - /* should never get here */ - a = 0.0F; /* silence uninitialized var warning */ - _mesa_problem(ctx, "unexpected BlendEquation in blend_general()"); - return; - } + /* compute the blended RGBA */ + r = Rs * sR + Rd * dR; + g = Gs * sG + Gd * dG; + b = Bs * sB + Bd * dB; + a = As * sA + Ad * dA; /* final clamping */ #if 0 @@ -891,40 +600,10 @@ void _swrast_choose_blend_func(struct gl_context *ctx, GLenum chanType) { SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLenum eq = ctx->Color.EquationRGB; - const GLenum srcRGB = ctx->Color.SrcRGB; - const GLenum dstRGB = ctx->Color.DstRGB; - const GLenum srcA = ctx->Color.SrcA; - const GLenum dstA = ctx->Color.DstA; + const GLenum srcFactor = ctx->Color.SrcFactor; + const GLenum dstFactor = ctx->Color.DstFactor; - if (ctx->Color.EquationRGB != ctx->Color.EquationA) { - swrast->BlendFunc = blend_general; - } - else if (eq == GL_MIN) { - /* Note: GL_MIN ignores the blending weight factors */ -#if defined(USE_MMX_ASM) - if (cpu_has_mmx && chanType == GL_UNSIGNED_BYTE) { - swrast->BlendFunc = _mesa_mmx_blend_min; - } - else -#endif - swrast->BlendFunc = blend_min; - } - else if (eq == GL_MAX) { - /* Note: GL_MAX ignores the blending weight factors */ -#if defined(USE_MMX_ASM) - if (cpu_has_mmx && chanType == GL_UNSIGNED_BYTE) { - swrast->BlendFunc = _mesa_mmx_blend_max; - } - else -#endif - swrast->BlendFunc = blend_max; - } - else if (srcRGB != srcA || dstRGB != dstA) { - swrast->BlendFunc = blend_general; - } - else if (eq == GL_FUNC_ADD && srcRGB == GL_SRC_ALPHA - && dstRGB == GL_ONE_MINUS_SRC_ALPHA) { + if (srcFactor == GL_SRC_ALPHA && dstFactor == GL_ONE_MINUS_SRC_ALPHA) { #if defined(USE_MMX_ASM) if (cpu_has_mmx && chanType == GL_UNSIGNED_BYTE) { swrast->BlendFunc = _mesa_mmx_blend_transparency; @@ -940,7 +619,7 @@ _swrast_choose_blend_func(struct gl_context *ctx, GLenum chanType) swrast->BlendFunc = blend_transparency_float; } } - else if (eq == GL_FUNC_ADD && srcRGB == GL_ONE && dstRGB == GL_ONE) { + else if (srcFactor == GL_ONE && dstFactor == GL_ONE) { #if defined(USE_MMX_ASM) if (cpu_has_mmx && chanType == GL_UNSIGNED_BYTE) { swrast->BlendFunc = _mesa_mmx_blend_add; @@ -949,11 +628,8 @@ _swrast_choose_blend_func(struct gl_context *ctx, GLenum chanType) #endif swrast->BlendFunc = blend_add; } - else if (((eq == GL_FUNC_ADD || eq == GL_FUNC_REVERSE_SUBTRACT) - && (srcRGB == GL_ZERO && dstRGB == GL_SRC_COLOR)) - || - ((eq == GL_FUNC_ADD || eq == GL_FUNC_SUBTRACT) - && (srcRGB == GL_DST_COLOR && dstRGB == GL_ZERO))) { + else if ((srcFactor == GL_ZERO && dstFactor == GL_SRC_COLOR) + || (srcFactor == GL_DST_COLOR && dstFactor == GL_ZERO)) { #if defined(USE_MMX_ASM) if (cpu_has_mmx && chanType == GL_UNSIGNED_BYTE) { swrast->BlendFunc = _mesa_mmx_blend_modulate; @@ -962,10 +638,10 @@ _swrast_choose_blend_func(struct gl_context *ctx, GLenum chanType) #endif swrast->BlendFunc = blend_modulate; } - else if (eq == GL_FUNC_ADD && srcRGB == GL_ZERO && dstRGB == GL_ONE) { + else if (srcFactor == GL_ZERO && dstFactor == GL_ONE) { swrast->BlendFunc = blend_noop; } - else if (eq == GL_FUNC_ADD && srcRGB == GL_ONE && dstRGB == GL_ZERO) { + else if (srcFactor == GL_ONE && dstFactor == GL_ZERO) { swrast->BlendFunc = blend_replace; } else { diff --git a/dll/opengl/mesa/swrast/s_context.c b/dll/opengl/mesa/swrast/s_context.c index 93fe5b18966..179014b6ca9 100644 --- a/dll/opengl/mesa/swrast/s_context.c +++ b/dll/opengl/mesa/swrast/s_context.c @@ -190,22 +190,6 @@ _swrast_update_fog_state( struct gl_context *ctx ) } -/** - * See if we can do early diffuse+specular (primary+secondary) color - * add per vertex instead of per-fragment. - */ -static void -_swrast_update_specular_vertex_add(struct gl_context *ctx) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - GLboolean separateSpecular = ctx->Fog.ColorSumEnabled || - (ctx->Light.Enabled && - ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR); - - swrast->SpecularVertexAdd = (separateSpecular && !ctx->Texture._Enabled); -} - - #define _SWRAST_NEW_DERIVED (_SWRAST_NEW_RASTERMASK | \ _NEW_TEXTURE | \ _NEW_HINT | \ @@ -266,12 +250,6 @@ _swrast_validate_triangle( struct gl_context *ctx, swrast->choose_triangle( ctx ); ASSERT(swrast->Triangle); - if (swrast->SpecularVertexAdd) { - /* separate specular color, but no texture */ - swrast->SpecTriangle = swrast->Triangle; - swrast->Triangle = _swrast_add_spec_terms_triangle; - } - swrast->Triangle( ctx, v0, v1, v2 ); } @@ -288,11 +266,6 @@ _swrast_validate_line( struct gl_context *ctx, const SWvertex *v0, const SWverte swrast->choose_line( ctx ); ASSERT(swrast->Line); - if (swrast->SpecularVertexAdd) { - swrast->SpecLine = swrast->Line; - swrast->Line = _swrast_add_spec_terms_line; - } - swrast->Line( ctx, v0, v1 ); } @@ -308,11 +281,6 @@ _swrast_validate_point( struct gl_context *ctx, const SWvertex *v0 ) _swrast_validate_derived( ctx ); swrast->choose_point( ctx ); - if (swrast->SpecularVertexAdd) { - swrast->SpecPoint = swrast->Point; - swrast->Point = _swrast_add_spec_terms_point; - } - swrast->Point( ctx, v0 ); } @@ -411,15 +379,9 @@ _swrast_update_active_attribs(struct gl_context *ctx) attribsMask = 0x0; #if CHAN_TYPE == GL_FLOAT - attribsMask |= FRAG_BIT_COL0; + attribsMask |= FRAG_BIT_COL; #endif - if (ctx->Fog.ColorSumEnabled || - (ctx->Light.Enabled && - ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)) { - attribsMask |= FRAG_BIT_COL1; - } - if (swrast->_FogEnabled) attribsMask |= FRAG_BIT_FOGC; @@ -434,7 +396,7 @@ _swrast_update_active_attribs(struct gl_context *ctx) if (attribsMask & BITFIELD64_BIT(i)) { swrast->_ActiveAttribs[num++] = i; /* how should this attribute be interpolated? */ - if (i == FRAG_ATTRIB_COL0 || i == FRAG_ATTRIB_COL1) + if (i == FRAG_ATTRIB_COL) swrast->_InterpMode[i] = ctx->Light.ShadeModel; else swrast->_InterpMode[i] = GL_SMOOTH; @@ -479,11 +441,6 @@ _swrast_validate_derived( struct gl_context *ctx ) _NEW_TEXTURE)) _swrast_update_active_attribs(ctx); - if (swrast->NewState & (_NEW_FOG | - _NEW_LIGHT | - _NEW_TEXTURE)) - _swrast_update_specular_vertex_add(ctx); - swrast->NewState = 0; swrast->StateChanges = 0; swrast->InvalidateState = _swrast_invalidate_state; @@ -770,11 +727,6 @@ _swrast_print_vertex( struct gl_context *ctx, const SWvertex *v ) _mesa_debug(ctx, "color %d %d %d %d\n", v->color[0], v->color[1], v->color[2], v->color[3]); #endif - _mesa_debug(ctx, "spec %g %g %g %g\n", - v->attrib[FRAG_ATTRIB_COL1][0], - v->attrib[FRAG_ATTRIB_COL1][1], - v->attrib[FRAG_ATTRIB_COL1][2], - v->attrib[FRAG_ATTRIB_COL1][3]); _mesa_debug(ctx, "fog %f\n", v->attrib[FRAG_ATTRIB_FOGC][0]); _mesa_debug(ctx, "index %f\n", v->attrib[FRAG_ATTRIB_CI][0]); _mesa_debug(ctx, "pointsize %f\n", v->pointSize); diff --git a/dll/opengl/mesa/swrast/s_context.h b/dll/opengl/mesa/swrast/s_context.h index 612956eb47a..190667e2c11 100644 --- a/dll/opengl/mesa/swrast/s_context.h +++ b/dll/opengl/mesa/swrast/s_context.h @@ -227,7 +227,6 @@ typedef struct GLbitfield NewState; GLuint StateChanges; GLenum Primitive; /* current primitive being drawn (ala glBegin) */ - GLboolean SpecularVertexAdd; /**< Add specular/secondary color per vertex */ void (*InvalidateState)( struct gl_context *ctx, GLbitfield new_state ); diff --git a/dll/opengl/mesa/swrast/s_copypix.c b/dll/opengl/mesa/swrast/s_copypix.c index e63e10245ac..a63976fe483 100644 --- a/dll/opengl/mesa/swrast/s_copypix.c +++ b/dll/opengl/mesa/swrast/s_copypix.c @@ -121,7 +121,7 @@ copy_rgba_pixels(struct gl_context *ctx, GLint srcx, GLint srcy, INIT_SPAN(span, GL_BITMAP); _swrast_span_default_attribs(ctx, &span); span.arrayMask = SPAN_RGBA; - span.arrayAttribs = FRAG_BIT_COL0; /* we'll fill in COL0 attrib values */ + span.arrayAttribs = FRAG_BIT_COL; /* we'll fill in COL0 attrib values */ if (overlapping) { tmpImage = (GLfloat *) malloc(width * height * sizeof(GLfloat) * 4); @@ -146,7 +146,7 @@ copy_rgba_pixels(struct gl_context *ctx, GLint srcx, GLint srcy, ASSERT(width < MAX_WIDTH); for (row = 0; row < height; row++, sy += stepy, dy += stepy) { - GLvoid *rgba = span.array->attribs[FRAG_ATTRIB_COL0]; + GLvoid *rgba = span.array->attribs[FRAG_ATTRIB_COL]; /* Get row/span of source pixels */ if (overlapping) { diff --git a/dll/opengl/mesa/swrast/s_drawpix.c b/dll/opengl/mesa/swrast/s_drawpix.c index 6c313b60391..06d9c94bfa4 100644 --- a/dll/opengl/mesa/swrast/s_drawpix.c +++ b/dll/opengl/mesa/swrast/s_drawpix.c @@ -409,7 +409,7 @@ draw_rgba_pixels( struct gl_context *ctx, GLint x, GLint y, INIT_SPAN(span, GL_BITMAP); _swrast_span_default_attribs(ctx, &span); span.arrayMask = SPAN_RGBA; - span.arrayAttribs = FRAG_BIT_COL0; /* we're fill in COL0 attrib values */ + span.arrayAttribs = FRAG_BIT_COL; /* we're fill in COL0 attrib values */ if (_mesa_get_format_datatype(ctx->DrawBuffer->_ColorDrawBuffer->Format) != GL_FLOAT) { /* need to clamp colors before applying fragment ops */ @@ -426,7 +426,7 @@ draw_rgba_pixels( struct gl_context *ctx, GLint x, GLint y, = _mesa_image_row_stride(unpack, width, format, type); GLint skipPixels = 0; /* use span array for temp color storage */ - GLfloat *rgba = (GLfloat *) span.array->attribs[FRAG_ATTRIB_COL0]; + GLfloat *rgba = (GLfloat *) span.array->attribs[FRAG_ATTRIB_COL]; /* if the span is wider than MAX_WIDTH we have to do it in chunks */ while (skipPixels < width) { diff --git a/dll/opengl/mesa/swrast/s_feedback.c b/dll/opengl/mesa/swrast/s_feedback.c index df322e99142..2916fac9363 100644 --- a/dll/opengl/mesa/swrast/s_feedback.c +++ b/dll/opengl/mesa/swrast/s_feedback.c @@ -31,7 +31,7 @@ feedback_vertex(struct gl_context * ctx, const SWvertex * v, const SWvertex * pv { GLfloat win[4]; const GLfloat *vtc = v->attrib[FRAG_ATTRIB_TEX]; - const GLfloat *color = v->attrib[FRAG_ATTRIB_COL0]; + const GLfloat *color = v->attrib[FRAG_ATTRIB_COL]; win[0] = v->attrib[FRAG_ATTRIB_WPOS][0]; win[1] = v->attrib[FRAG_ATTRIB_WPOS][1]; diff --git a/dll/opengl/mesa/swrast/s_fog.c b/dll/opengl/mesa/swrast/s_fog.c index 8aa52824057..29a56e0ba93 100644 --- a/dll/opengl/mesa/swrast/s_fog.c +++ b/dll/opengl/mesa/swrast/s_fog.c @@ -166,7 +166,7 @@ _swrast_fog_rgba_span( const struct gl_context *ctx, SWspan *span ) FOG_LOOP(GLushort, LINEAR_FOG); } else { - GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; + GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL]; ASSERT(span->array->ChanType == GL_FLOAT); FOG_LOOP(GLfloat, LINEAR_FOG); } @@ -185,7 +185,7 @@ _swrast_fog_rgba_span( const struct gl_context *ctx, SWspan *span ) FOG_LOOP(GLushort, EXP_FOG); } else { - GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; + GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL]; ASSERT(span->array->ChanType == GL_FLOAT); FOG_LOOP(GLfloat, EXP_FOG); } @@ -204,7 +204,7 @@ _swrast_fog_rgba_span( const struct gl_context *ctx, SWspan *span ) FOG_LOOP(GLushort, EXP2_FOG); } else { - GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; + GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL]; ASSERT(span->array->ChanType == GL_FLOAT); FOG_LOOP(GLfloat, EXP2_FOG); } @@ -229,7 +229,7 @@ _swrast_fog_rgba_span( const struct gl_context *ctx, SWspan *span ) FOG_LOOP(GLushort, BLEND_FOG); } else { - GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; + GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL]; ASSERT(span->array->ChanType == GL_FLOAT); FOG_LOOP(GLfloat, BLEND_FOG); } diff --git a/dll/opengl/mesa/swrast/s_lines.c b/dll/opengl/mesa/swrast/s_lines.c index b98ad3fde81..7694cd61e4a 100644 --- a/dll/opengl/mesa/swrast/s_lines.c +++ b/dll/opengl/mesa/swrast/s_lines.c @@ -149,41 +149,6 @@ draw_wide_line( struct gl_context *ctx, SWspan *span, GLboolean xMajor ) -void -_swrast_add_spec_terms_line(struct gl_context *ctx, - const SWvertex *v0, const SWvertex *v1) -{ - SWvertex *ncv0 = (SWvertex *)v0; - SWvertex *ncv1 = (SWvertex *)v1; - GLfloat rSum, gSum, bSum; - GLchan cSave[2][4]; - - /* save original colors */ - COPY_CHAN4(cSave[0], ncv0->color); - COPY_CHAN4(cSave[1], ncv1->color); - /* sum v0 */ - rSum = CHAN_TO_FLOAT(ncv0->color[0]) + ncv0->attrib[FRAG_ATTRIB_COL1][0]; - gSum = CHAN_TO_FLOAT(ncv0->color[1]) + ncv0->attrib[FRAG_ATTRIB_COL1][1]; - bSum = CHAN_TO_FLOAT(ncv0->color[2]) + ncv0->attrib[FRAG_ATTRIB_COL1][2]; - UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[0], rSum); - UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[1], gSum); - UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[2], bSum); - /* sum v1 */ - rSum = CHAN_TO_FLOAT(ncv1->color[0]) + ncv1->attrib[FRAG_ATTRIB_COL1][0]; - gSum = CHAN_TO_FLOAT(ncv1->color[1]) + ncv1->attrib[FRAG_ATTRIB_COL1][1]; - bSum = CHAN_TO_FLOAT(ncv1->color[2]) + ncv1->attrib[FRAG_ATTRIB_COL1][2]; - UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[0], rSum); - UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[1], gSum); - UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[2], bSum); - /* draw */ - SWRAST_CONTEXT(ctx)->SpecLine( ctx, ncv0, ncv1 ); - /* restore original colors */ - COPY_CHAN4( ncv0->attrib[FRAG_ATTRIB_COL0], cSave[0] ); - COPY_CHAN4( ncv1->attrib[FRAG_ATTRIB_COL0], cSave[1] ); -} - - - #ifdef DEBUG /* record the current line function name */ @@ -215,9 +180,6 @@ void _swrast_choose_line( struct gl_context *ctx ) { SWcontext *swrast = SWRAST_CONTEXT(ctx); - GLboolean specular = (ctx->Fog.ColorSumEnabled || - (ctx->Light.Enabled && - ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)); if (ctx->RenderMode == GL_RENDER) { if (ctx->Line.SmoothFlag) { @@ -226,8 +188,7 @@ _swrast_choose_line( struct gl_context *ctx ) ASSERT(swrast->Line); } else if (ctx->Texture._EnabledCoord - || swrast->_FogEnabled - || specular) { + || swrast->_FogEnabled) { USE(general_line); } else if (ctx->Depth.Test diff --git a/dll/opengl/mesa/swrast/s_linetemp.h b/dll/opengl/mesa/swrast/s_linetemp.h index c58a39a2714..6f369eea3a5 100644 --- a/dll/opengl/mesa/swrast/s_linetemp.h +++ b/dll/opengl/mesa/swrast/s_linetemp.h @@ -153,18 +153,6 @@ NAME( struct gl_context *ctx, const SWvertex *vert0, const SWvertex *vert1 ) if (dx == 0 && dy == 0) return; - /* - printf("%s %d,%d %g %g %g %g %g %g %g %g\n", __FUNCTION__, dx, dy, - vert0->attrib[FRAG_ATTRIB_COL1][0], - vert0->attrib[FRAG_ATTRIB_COL1][1], - vert0->attrib[FRAG_ATTRIB_COL1][2], - vert0->attrib[FRAG_ATTRIB_COL1][3], - vert1->attrib[FRAG_ATTRIB_COL1][0], - vert1->attrib[FRAG_ATTRIB_COL1][1], - vert1->attrib[FRAG_ATTRIB_COL1][2], - vert1->attrib[FRAG_ATTRIB_COL1][3]); - */ - #ifdef DEPTH_TYPE zPtr = (DEPTH_TYPE *) _swrast_pixel_address(zrb, x0, y0); #endif diff --git a/dll/opengl/mesa/swrast/s_logic.c b/dll/opengl/mesa/swrast/s_logic.c index 959a92b3abb..ffc4a6fb8c6 100644 --- a/dll/opengl/mesa/swrast/s_logic.c +++ b/dll/opengl/mesa/swrast/s_logic.c @@ -203,7 +203,7 @@ _swrast_logicop_rgba_span(struct gl_context *ctx, struct gl_renderbuffer *rb, } else { logicop_uint4(ctx, 4 * span->end, - (GLuint *) span->array->attribs[FRAG_ATTRIB_COL0], + (GLuint *) span->array->attribs[FRAG_ATTRIB_COL], (const GLuint *) rbPixels, span->array->mask); } } diff --git a/dll/opengl/mesa/swrast/s_masking.c b/dll/opengl/mesa/swrast/s_masking.c index 6e848cca269..aa457a7b186 100644 --- a/dll/opengl/mesa/swrast/s_masking.c +++ b/dll/opengl/mesa/swrast/s_masking.c @@ -82,7 +82,7 @@ _swrast_mask_rgba_span(struct gl_context *ctx, struct gl_renderbuffer *rb, const GLuint bMask = ctx->Color.ColorMask[BCOMP] ? ~0x0 : 0x0; const GLuint aMask = ctx->Color.ColorMask[ACOMP] ? ~0x0 : 0x0; const GLuint (*dst)[4] = (const GLuint (*)[4]) rbPixels; - GLuint (*src)[4] = (GLuint (*)[4]) span->array->attribs[FRAG_ATTRIB_COL0]; + GLuint (*src)[4] = (GLuint (*)[4]) span->array->attribs[FRAG_ATTRIB_COL]; GLuint i; for (i = 0; i < n; i++) { src[i][RCOMP] = (src[i][RCOMP] & rMask) | (dst[i][RCOMP] & ~rMask); diff --git a/dll/opengl/mesa/swrast/s_points.c b/dll/opengl/mesa/swrast/s_points.c index 53932eb7d14..93a3415cbdb 100644 --- a/dll/opengl/mesa/swrast/s_points.c +++ b/dll/opengl/mesa/swrast/s_points.c @@ -486,33 +486,6 @@ pixel_point(struct gl_context *ctx, const SWvertex *vert) } -/** - * Add specular color to primary color, draw point, restore original - * primary color. - */ -void -_swrast_add_spec_terms_point(struct gl_context *ctx, const SWvertex *v0) -{ - SWvertex *ncv0 = (SWvertex *) v0; /* cast away const */ - GLfloat rSum, gSum, bSum; - GLchan cSave[4]; - - /* save */ - COPY_CHAN4(cSave, ncv0->color); - /* sum */ - rSum = CHAN_TO_FLOAT(ncv0->color[0]) + ncv0->attrib[FRAG_ATTRIB_COL1][0]; - gSum = CHAN_TO_FLOAT(ncv0->color[1]) + ncv0->attrib[FRAG_ATTRIB_COL1][1]; - bSum = CHAN_TO_FLOAT(ncv0->color[2]) + ncv0->attrib[FRAG_ATTRIB_COL1][2]; - UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[0], rSum); - UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[1], gSum); - UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[2], bSum); - /* draw */ - SWRAST_CONTEXT(ctx)->SpecPoint(ctx, ncv0); - /* restore */ - COPY_CHAN4(ncv0->color, cSave); -} - - /** * Examine current state to determine which point drawing function to use. */ diff --git a/dll/opengl/mesa/swrast/s_span.c b/dll/opengl/mesa/swrast/s_span.c index c1973d868b4..ce296074ad1 100644 --- a/dll/opengl/mesa/swrast/s_span.c +++ b/dll/opengl/mesa/swrast/s_span.c @@ -82,17 +82,9 @@ _swrast_span_default_attribs(struct gl_context *ctx, SWspan *span) span->alphaStep = 0; span->interpMask |= SPAN_RGBA; - COPY_4V(span->attrStart[FRAG_ATTRIB_COL0], ctx->Current.RasterColor); - ASSIGN_4V(span->attrStepX[FRAG_ATTRIB_COL0], 0.0, 0.0, 0.0, 0.0); - ASSIGN_4V(span->attrStepY[FRAG_ATTRIB_COL0], 0.0, 0.0, 0.0, 0.0); - - /* Secondary color */ - if (ctx->Light.Enabled || ctx->Fog.ColorSumEnabled) - { - COPY_4V(span->attrStart[FRAG_ATTRIB_COL1], ctx->Current.RasterSecondaryColor); - ASSIGN_4V(span->attrStepX[FRAG_ATTRIB_COL1], 0.0, 0.0, 0.0, 0.0); - ASSIGN_4V(span->attrStepY[FRAG_ATTRIB_COL1], 0.0, 0.0, 0.0, 0.0); - } + COPY_4V(span->attrStart[FRAG_ATTRIB_COL], ctx->Current.RasterColor); + ASSIGN_4V(span->attrStepX[FRAG_ATTRIB_COL], 0.0, 0.0, 0.0, 0.0); + ASSIGN_4V(span->attrStepY[FRAG_ATTRIB_COL], 0.0, 0.0, 0.0, 0.0); /* fog */ { @@ -272,7 +264,7 @@ interpolate_int_colors(struct gl_context *ctx, SWspan *span) break; #endif case GL_FLOAT: - interpolate_active_attribs(ctx, span, FRAG_BIT_COL0); + interpolate_active_attribs(ctx, span, FRAG_BIT_COL); break; default: _mesa_problem(ctx, "bad datatype 0x%x in interpolate_int_colors", @@ -283,12 +275,12 @@ interpolate_int_colors(struct gl_context *ctx, SWspan *span) /** - * Populate the FRAG_ATTRIB_COL0 array. + * Populate the FRAG_ATTRIB_COL array. */ static inline void interpolate_float_colors(SWspan *span) { - GLfloat (*col0)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; + GLfloat (*col0)[4] = span->array->attribs[FRAG_ATTRIB_COL]; const GLuint n = span->end; GLuint i; @@ -337,7 +329,7 @@ interpolate_float_colors(SWspan *span) } } - span->arrayAttribs |= FRAG_BIT_COL0; + span->arrayAttribs |= FRAG_BIT_COL; span->array->ChanType = GL_FLOAT; } @@ -739,57 +731,6 @@ clip_span( struct gl_context *ctx, SWspan *span ) } -/** - * Add specular colors to primary colors. - * Only called during fixed-function operation. - * Result is float color array (FRAG_ATTRIB_COL0). - */ -static inline void -add_specular(struct gl_context *ctx, SWspan *span) -{ - const SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLubyte *mask = span->array->mask; - GLfloat (*col0)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; - GLfloat (*col1)[4] = span->array->attribs[FRAG_ATTRIB_COL1]; - GLuint i; - - ASSERT(!_swrast_use_fragment_program(ctx)); - ASSERT(span->arrayMask & SPAN_RGBA); - ASSERT(swrast->_ActiveAttribMask & FRAG_BIT_COL1); - (void) swrast; /* silence warning */ - - if (span->array->ChanType == GL_FLOAT) { - if ((span->arrayAttribs & FRAG_BIT_COL0) == 0) { - interpolate_active_attribs(ctx, span, FRAG_BIT_COL0); - } - } - else { - /* need float colors */ - if ((span->arrayAttribs & FRAG_BIT_COL0) == 0) { - interpolate_float_colors(span); - } - } - - if ((span->arrayAttribs & FRAG_BIT_COL1) == 0) { - /* XXX could avoid this and interpolate COL1 in the loop below */ - interpolate_active_attribs(ctx, span, FRAG_BIT_COL1); - } - - ASSERT(span->arrayAttribs & FRAG_BIT_COL0); - ASSERT(span->arrayAttribs & FRAG_BIT_COL1); - - for (i = 0; i < span->end; i++) { - if (mask[i]) { - col0[i][0] += col1[i][0]; - col0[i][1] += col1[i][1]; - col0[i][2] += col1[i][2]; - } - } - - span->array->ChanType = GL_FLOAT; -} - - /** * Apply antialiasing coverage value to alpha values. */ @@ -815,7 +756,7 @@ apply_aa_coverage(SWspan *span) } } else { - GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; + GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL]; for (i = 0; i < span->end; i++) { rgba[i][ACOMP] = rgba[i][ACOMP] * coverage[i]; /* clamp later */ @@ -830,7 +771,7 @@ apply_aa_coverage(SWspan *span) static inline void clamp_colors(SWspan *span) { - GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; + GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL]; GLuint i; ASSERT(span->array->ChanType == GL_FLOAT); for (i = 0; i < span->end; i++) { @@ -854,7 +795,7 @@ convert_color_type(SWspan *span, GLenum newType, GLuint output) GLvoid *src, *dst; if (output > 0 || span->array->ChanType == GL_FLOAT) { - src = span->array->attribs[FRAG_ATTRIB_COL0 + output]; + src = span->array->attribs[FRAG_ATTRIB_COL + output]; span->array->ChanType = GL_FLOAT; } else if (span->array->ChanType == GL_UNSIGNED_BYTE) { @@ -872,7 +813,7 @@ convert_color_type(SWspan *span, GLenum newType, GLuint output) dst = span->array->rgba16; } else { - dst = span->array->attribs[FRAG_ATTRIB_COL0]; + dst = span->array->attribs[FRAG_ATTRIB_COL]; } _mesa_convert_colors(span->array->ChanType, src, @@ -1140,15 +1081,6 @@ _swrast_write_rgba_span( struct gl_context *ctx, SWspan *span) ASSERT(span->arrayMask & SPAN_RGBA); - if (span->primitive == GL_BITMAP || !swrast->SpecularVertexAdd) { - /* Add primary and specular (diffuse + specular) colors */ - if (ctx->Fog.ColorSumEnabled || - (ctx->Light.Enabled && - ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)) { - add_specular(ctx, span); - } - } - /* Fog */ if (swrast->_FogEnabled) { _swrast_fog_rgba_span(ctx, span); @@ -1187,7 +1119,7 @@ _swrast_write_rgba_span( struct gl_context *ctx, SWspan *span) span->array->rgba = span->array->rgba8; } else { - span->array->rgba = (void *)span->array->attribs[FRAG_ATTRIB_COL0]; + span->array->rgba = (void *)span->array->attribs[FRAG_ATTRIB_COL]; } } diff --git a/dll/opengl/mesa/swrast/s_texfetch.c b/dll/opengl/mesa/swrast/s_texfetch.c index d3207425d53..e8025fa869d 100644 --- a/dll/opengl/mesa/swrast/s_texfetch.c +++ b/dll/opengl/mesa/swrast/s_texfetch.c @@ -325,79 +325,6 @@ texfetch_funcs[MESA_FORMAT_COUNT] = NULL, NULL }, - { - MESA_FORMAT_RGBA_FLOAT32, - fetch_texel_1d_f_rgba_f32, - fetch_texel_2d_f_rgba_f32, - fetch_texel_3d_f_rgba_f32 - }, - { - MESA_FORMAT_RGBA_FLOAT16, - fetch_texel_1d_f_rgba_f16, - fetch_texel_2d_f_rgba_f16, - fetch_texel_3d_f_rgba_f16 - }, - { - MESA_FORMAT_RGB_FLOAT32, - fetch_texel_1d_f_rgb_f32, - fetch_texel_2d_f_rgb_f32, - fetch_texel_3d_f_rgb_f32 - }, - { - MESA_FORMAT_RGB_FLOAT16, - fetch_texel_1d_f_rgb_f16, - fetch_texel_2d_f_rgb_f16, - fetch_texel_3d_f_rgb_f16 - }, - { - MESA_FORMAT_ALPHA_FLOAT32, - fetch_texel_1d_f_alpha_f32, - fetch_texel_2d_f_alpha_f32, - fetch_texel_3d_f_alpha_f32 - }, - { - MESA_FORMAT_ALPHA_FLOAT16, - fetch_texel_1d_f_alpha_f16, - fetch_texel_2d_f_alpha_f16, - fetch_texel_3d_f_alpha_f16 - }, - { - MESA_FORMAT_LUMINANCE_FLOAT32, - fetch_texel_1d_f_luminance_f32, - fetch_texel_2d_f_luminance_f32, - fetch_texel_3d_f_luminance_f32 - }, - { - MESA_FORMAT_LUMINANCE_FLOAT16, - fetch_texel_1d_f_luminance_f16, - fetch_texel_2d_f_luminance_f16, - fetch_texel_3d_f_luminance_f16 - }, - { - MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32, - fetch_texel_1d_f_luminance_alpha_f32, - fetch_texel_2d_f_luminance_alpha_f32, - fetch_texel_3d_f_luminance_alpha_f32 - }, - { - MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16, - fetch_texel_1d_f_luminance_alpha_f16, - fetch_texel_2d_f_luminance_alpha_f16, - fetch_texel_3d_f_luminance_alpha_f16 - }, - { - MESA_FORMAT_INTENSITY_FLOAT32, - fetch_texel_1d_f_intensity_f32, - fetch_texel_2d_f_intensity_f32, - fetch_texel_3d_f_intensity_f32 - }, - { - MESA_FORMAT_INTENSITY_FLOAT16, - fetch_texel_1d_f_intensity_f16, - fetch_texel_2d_f_intensity_f16, - fetch_texel_3d_f_intensity_f16 - }, - { MESA_FORMAT_ALPHA_UINT8, NULL, diff --git a/dll/opengl/mesa/swrast/s_texfetch_tmp.h b/dll/opengl/mesa/swrast/s_texfetch_tmp.h index da996b8a100..88ebec98c9e 100644 --- a/dll/opengl/mesa/swrast/s_texfetch_tmp.h +++ b/dll/opengl/mesa/swrast/s_texfetch_tmp.h @@ -97,219 +97,6 @@ static void FETCH(f_z16)(const struct swrast_texture_image *texImage, -/* MESA_FORMAT_RGBA_F32 ******************************************************/ - -/* Fetch texel from 1D, 2D or 3D RGBA_FLOAT32 texture, returning 4 GLfloats. - */ -static void FETCH(f_rgba_f32)( const struct swrast_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 4); - texel[RCOMP] = src[0]; - texel[GCOMP] = src[1]; - texel[BCOMP] = src[2]; - texel[ACOMP] = src[3]; -} - - - - -/* MESA_FORMAT_RGBA_F16 ******************************************************/ - -/* Fetch texel from 1D, 2D or 3D RGBA_FLOAT16 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_rgba_f16)( const struct swrast_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 4); - texel[RCOMP] = _mesa_half_to_float(src[0]); - texel[GCOMP] = _mesa_half_to_float(src[1]); - texel[BCOMP] = _mesa_half_to_float(src[2]); - texel[ACOMP] = _mesa_half_to_float(src[3]); -} - - - -/* MESA_FORMAT_RGB_F32 *******************************************************/ - -/* Fetch texel from 1D, 2D or 3D RGB_FLOAT32 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_rgb_f32)( const struct swrast_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 3); - texel[RCOMP] = src[0]; - texel[GCOMP] = src[1]; - texel[BCOMP] = src[2]; - texel[ACOMP] = 1.0F; -} - - - - -/* MESA_FORMAT_RGB_F16 *******************************************************/ - -/* Fetch texel from 1D, 2D or 3D RGB_FLOAT16 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_rgb_f16)( const struct swrast_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 3); - texel[RCOMP] = _mesa_half_to_float(src[0]); - texel[GCOMP] = _mesa_half_to_float(src[1]); - texel[BCOMP] = _mesa_half_to_float(src[2]); - texel[ACOMP] = 1.0F; -} - - - - -/* MESA_FORMAT_ALPHA_F32 *****************************************************/ - -/* Fetch texel from 1D, 2D or 3D ALPHA_FLOAT32 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_alpha_f32)( const struct swrast_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = 0.0F; - texel[ACOMP] = src[0]; -} - - - - -/* MESA_FORMAT_ALPHA_F32 *****************************************************/ - -/* Fetch texel from 1D, 2D or 3D ALPHA_FLOAT16 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_alpha_f16)( const struct swrast_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = 0.0F; - texel[ACOMP] = _mesa_half_to_float(src[0]); -} - - - - -/* MESA_FORMAT_LUMINANCE_F32 *************************************************/ - -/* Fetch texel from 1D, 2D or 3D LUMINANCE_FLOAT32 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_luminance_f32)( const struct swrast_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = src[0]; - texel[ACOMP] = 1.0F; -} - - - - -/* MESA_FORMAT_LUMINANCE_F16 *************************************************/ - -/* Fetch texel from 1D, 2D or 3D LUMINANCE_FLOAT16 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_luminance_f16)( const struct swrast_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = _mesa_half_to_float(src[0]); - texel[ACOMP] = 1.0F; -} - - - - -/* MESA_FORMAT_LUMINANCE_ALPHA_F32 *******************************************/ - -/* Fetch texel from 1D, 2D or 3D LUMINANCE_ALPHA_FLOAT32 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_luminance_alpha_f32)( const struct swrast_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 2); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = src[0]; - texel[ACOMP] = src[1]; -} - - - - -/* MESA_FORMAT_LUMINANCE_ALPHA_F16 *******************************************/ - -/* Fetch texel from 1D, 2D or 3D LUMINANCE_ALPHA_FLOAT16 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_luminance_alpha_f16)( const struct swrast_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 2); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = _mesa_half_to_float(src[0]); - texel[ACOMP] = _mesa_half_to_float(src[1]); -} - - - - -/* MESA_FORMAT_INTENSITY_F32 *************************************************/ - -/* Fetch texel from 1D, 2D or 3D INTENSITY_FLOAT32 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_intensity_f32)( const struct swrast_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = - texel[ACOMP] = src[0]; -} - - - - -/* MESA_FORMAT_INTENSITY_F16 *************************************************/ - -/* Fetch texel from 1D, 2D or 3D INTENSITY_FLOAT16 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_intensity_f16)( const struct swrast_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = - texel[ACOMP] = _mesa_half_to_float(src[0]); -} - - - /* * Begin Hardware formats */ diff --git a/dll/opengl/mesa/swrast/s_texfilter.c b/dll/opengl/mesa/swrast/s_texfilter.c index 191fe4d98bc..f84396b53ca 100644 --- a/dll/opengl/mesa/swrast/s_texfilter.c +++ b/dll/opengl/mesa/swrast/s_texfilter.c @@ -1665,325 +1665,6 @@ sample_lambda_2d_aniso(struct gl_context *ctx, } - -/**********************************************************************/ -/* 3-D Texture Sampling Functions */ -/**********************************************************************/ - -/** - * Return the texture sample for coordinate (s,t,r) using GL_NEAREST filter. - */ -static inline void -sample_3d_nearest(struct gl_context *ctx, - const struct gl_texture_object *tObj, - const struct gl_texture_image *img, - const GLfloat texcoord[4], - GLfloat rgba[4]) -{ - const struct swrast_texture_image *swImg = swrast_texture_image_const(img); - const GLint width = img->Width2; /* without border, power of two */ - const GLint height = img->Height2; /* without border, power of two */ - const GLint depth = img->Depth2; /* without border, power of two */ - GLint i, j, k; - (void) ctx; - - i = nearest_texel_location(tObj->Sampler.WrapS, img, width, texcoord[0]); - j = nearest_texel_location(tObj->Sampler.WrapT, img, height, texcoord[1]); - k = nearest_texel_location(tObj->Sampler.WrapR, img, depth, texcoord[2]); - - if (i < 0 || i >= (GLint) img->Width || - j < 0 || j >= (GLint) img->Height || - k < 0 || k >= (GLint) img->Depth) { - /* Need this test for GL_CLAMP_TO_BORDER mode */ - get_border_color(tObj, img, rgba); - } - else { - swImg->FetchTexel(swImg, i, j, k, rgba); - } -} - - -/** - * Return the texture sample for coordinate (s,t,r) using GL_LINEAR filter. - */ -static void -sample_3d_linear(struct gl_context *ctx, - const struct gl_texture_object *tObj, - const struct gl_texture_image *img, - const GLfloat texcoord[4], - GLfloat rgba[4]) -{ - const struct swrast_texture_image *swImg = swrast_texture_image_const(img); - const GLint width = img->Width2; - const GLint height = img->Height2; - const GLint depth = img->Depth2; - GLint i0, j0, k0, i1, j1, k1; - GLbitfield useBorderColor = 0x0; - GLfloat a, b, c; - GLfloat t000[4], t010[4], t001[4], t011[4]; - GLfloat t100[4], t110[4], t101[4], t111[4]; - - linear_texel_locations(tObj->Sampler.WrapS, img, width, texcoord[0], &i0, &i1, &a); - linear_texel_locations(tObj->Sampler.WrapT, img, height, texcoord[1], &j0, &j1, &b); - linear_texel_locations(tObj->Sampler.WrapR, img, depth, texcoord[2], &k0, &k1, &c); - - if (img->Border) { - i0 += img->Border; - i1 += img->Border; - j0 += img->Border; - j1 += img->Border; - k0 += img->Border; - k1 += img->Border; - } - else { - /* check if sampling texture border color */ - if (i0 < 0 || i0 >= width) useBorderColor |= I0BIT; - if (i1 < 0 || i1 >= width) useBorderColor |= I1BIT; - if (j0 < 0 || j0 >= height) useBorderColor |= J0BIT; - if (j1 < 0 || j1 >= height) useBorderColor |= J1BIT; - if (k0 < 0 || k0 >= depth) useBorderColor |= K0BIT; - if (k1 < 0 || k1 >= depth) useBorderColor |= K1BIT; - } - - /* Fetch texels */ - if (useBorderColor & (I0BIT | J0BIT | K0BIT)) { - get_border_color(tObj, img, t000); - } - else { - swImg->FetchTexel(swImg, i0, j0, k0, t000); - } - if (useBorderColor & (I1BIT | J0BIT | K0BIT)) { - get_border_color(tObj, img, t100); - } - else { - swImg->FetchTexel(swImg, i1, j0, k0, t100); - } - if (useBorderColor & (I0BIT | J1BIT | K0BIT)) { - get_border_color(tObj, img, t010); - } - else { - swImg->FetchTexel(swImg, i0, j1, k0, t010); - } - if (useBorderColor & (I1BIT | J1BIT | K0BIT)) { - get_border_color(tObj, img, t110); - } - else { - swImg->FetchTexel(swImg, i1, j1, k0, t110); - } - - if (useBorderColor & (I0BIT | J0BIT | K1BIT)) { - get_border_color(tObj, img, t001); - } - else { - swImg->FetchTexel(swImg, i0, j0, k1, t001); - } - if (useBorderColor & (I1BIT | J0BIT | K1BIT)) { - get_border_color(tObj, img, t101); - } - else { - swImg->FetchTexel(swImg, i1, j0, k1, t101); - } - if (useBorderColor & (I0BIT | J1BIT | K1BIT)) { - get_border_color(tObj, img, t011); - } - else { - swImg->FetchTexel(swImg, i0, j1, k1, t011); - } - if (useBorderColor & (I1BIT | J1BIT | K1BIT)) { - get_border_color(tObj, img, t111); - } - else { - swImg->FetchTexel(swImg, i1, j1, k1, t111); - } - - /* trilinear interpolation of samples */ - lerp_rgba_3d(rgba, a, b, c, t000, t100, t010, t110, t001, t101, t011, t111); -} - - -static void -sample_3d_nearest_mipmap_nearest(struct gl_context *ctx, - const struct gl_texture_object *tObj, - GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLfloat rgba[][4] ) -{ - GLuint i; - for (i = 0; i < n; i++) { - GLint level = nearest_mipmap_level(tObj, lambda[i]); - sample_3d_nearest(ctx, tObj, tObj->Image[0][level], texcoord[i], rgba[i]); - } -} - - -static void -sample_3d_linear_mipmap_nearest(struct gl_context *ctx, - const struct gl_texture_object *tObj, - GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLfloat rgba[][4]) -{ - GLuint i; - ASSERT(lambda != NULL); - for (i = 0; i < n; i++) { - GLint level = nearest_mipmap_level(tObj, lambda[i]); - sample_3d_linear(ctx, tObj, tObj->Image[0][level], texcoord[i], rgba[i]); - } -} - - -static void -sample_3d_nearest_mipmap_linear(struct gl_context *ctx, - const struct gl_texture_object *tObj, - GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLfloat rgba[][4]) -{ - GLuint i; - ASSERT(lambda != NULL); - for (i = 0; i < n; i++) { - GLint level = linear_mipmap_level(tObj, lambda[i]); - if (level >= tObj->_MaxLevel) { - sample_3d_nearest(ctx, tObj, tObj->Image[0][tObj->_MaxLevel], - texcoord[i], rgba[i]); - } - else { - GLfloat t0[4], t1[4]; /* texels */ - const GLfloat f = FRAC(lambda[i]); - sample_3d_nearest(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); - sample_3d_nearest(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1); - lerp_rgba(rgba[i], f, t0, t1); - } - } -} - - -static void -sample_3d_linear_mipmap_linear(struct gl_context *ctx, - const struct gl_texture_object *tObj, - GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLfloat rgba[][4]) -{ - GLuint i; - ASSERT(lambda != NULL); - for (i = 0; i < n; i++) { - GLint level = linear_mipmap_level(tObj, lambda[i]); - if (level >= tObj->_MaxLevel) { - sample_3d_linear(ctx, tObj, tObj->Image[0][tObj->_MaxLevel], - texcoord[i], rgba[i]); - } - else { - GLfloat t0[4], t1[4]; /* texels */ - const GLfloat f = FRAC(lambda[i]); - sample_3d_linear(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); - sample_3d_linear(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1); - lerp_rgba(rgba[i], f, t0, t1); - } - } -} - - -/** Sample 3D texture, nearest filtering for both min/magnification */ -static void -sample_nearest_3d(struct gl_context *ctx, - const struct gl_texture_object *tObj, GLuint n, - const GLfloat texcoords[][4], const GLfloat lambda[], - GLfloat rgba[][4]) -{ - GLuint i; - struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; - (void) lambda; - for (i = 0; i < n; i++) { - sample_3d_nearest(ctx, tObj, image, texcoords[i], rgba[i]); - } -} - - -/** Sample 3D texture, linear filtering for both min/magnification */ -static void -sample_linear_3d(struct gl_context *ctx, - const struct gl_texture_object *tObj, GLuint n, - const GLfloat texcoords[][4], - const GLfloat lambda[], GLfloat rgba[][4]) -{ - GLuint i; - struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; - (void) lambda; - for (i = 0; i < n; i++) { - sample_3d_linear(ctx, tObj, image, texcoords[i], rgba[i]); - } -} - - -/** Sample 3D texture, using lambda to choose between min/magnification */ -static void -sample_lambda_3d(struct gl_context *ctx, - const struct gl_texture_object *tObj, GLuint n, - const GLfloat texcoords[][4], const GLfloat lambda[], - GLfloat rgba[][4]) -{ - GLuint minStart, minEnd; /* texels with minification */ - GLuint magStart, magEnd; /* texels with magnification */ - GLuint i; - - ASSERT(lambda != NULL); - compute_min_mag_ranges(tObj, n, lambda, - &minStart, &minEnd, &magStart, &magEnd); - - if (minStart < minEnd) { - /* do the minified texels */ - GLuint m = minEnd - minStart; - switch (tObj->Sampler.MinFilter) { - case GL_NEAREST: - for (i = minStart; i < minEnd; i++) - sample_3d_nearest(ctx, tObj, tObj->Image[0][tObj->BaseLevel], - texcoords[i], rgba[i]); - break; - case GL_LINEAR: - for (i = minStart; i < minEnd; i++) - sample_3d_linear(ctx, tObj, tObj->Image[0][tObj->BaseLevel], - texcoords[i], rgba[i]); - break; - case GL_NEAREST_MIPMAP_NEAREST: - sample_3d_nearest_mipmap_nearest(ctx, tObj, m, texcoords + minStart, - lambda + minStart, rgba + minStart); - break; - case GL_LINEAR_MIPMAP_NEAREST: - sample_3d_linear_mipmap_nearest(ctx, tObj, m, texcoords + minStart, - lambda + minStart, rgba + minStart); - break; - case GL_NEAREST_MIPMAP_LINEAR: - sample_3d_nearest_mipmap_linear(ctx, tObj, m, texcoords + minStart, - lambda + minStart, rgba + minStart); - break; - case GL_LINEAR_MIPMAP_LINEAR: - sample_3d_linear_mipmap_linear(ctx, tObj, m, texcoords + minStart, - lambda + minStart, rgba + minStart); - break; - default: - _mesa_problem(ctx, "Bad min filter in sample_3d_texture"); - return; - } - } - - if (magStart < magEnd) { - /* do the magnified texels */ - switch (tObj->Sampler.MagFilter) { - case GL_NEAREST: - for (i = magStart; i < magEnd; i++) - sample_3d_nearest(ctx, tObj, tObj->Image[0][tObj->BaseLevel], - texcoords[i], rgba[i]); - break; - case GL_LINEAR: - for (i = magStart; i < magEnd; i++) - sample_3d_linear(ctx, tObj, tObj->Image[0][tObj->BaseLevel], - texcoords[i], rgba[i]); - break; - default: - _mesa_problem(ctx, "Bad mag filter in sample_3d_texture"); - return; - } - } -} - - /**********************************************************************/ /* Texture Cube Map Sampling Functions */ /**********************************************************************/ @@ -2461,17 +2142,6 @@ _swrast_choose_texture_sample_func( struct gl_context *ctx, return func; } - case GL_TEXTURE_3D: - if (needLambda) { - return &sample_lambda_3d; - } - else if (t->Sampler.MinFilter == GL_LINEAR) { - return &sample_linear_3d; - } - else { - ASSERT(t->Sampler.MinFilter == GL_NEAREST); - return &sample_nearest_3d; - } case GL_TEXTURE_CUBE_MAP: if (needLambda) { return &sample_lambda_cube; diff --git a/dll/opengl/mesa/swrast/s_texture.c b/dll/opengl/mesa/swrast/s_texture.c index dae83419f95..81acbe6bb90 100644 --- a/dll/opengl/mesa/swrast/s_texture.c +++ b/dll/opengl/mesa/swrast/s_texture.c @@ -203,15 +203,6 @@ _swrast_map_teximage(struct gl_context *ctx, map = swImage->Buffer; - if (texImage->TexObject->Target == GL_TEXTURE_3D) { - GLuint sliceSize = _mesa_format_image_size(texImage->TexFormat, - texImage->Width, - texImage->Height, - 1); - assert(slice < texImage->Depth); - map += slice * sliceSize; - } - /* apply x/y offset to map address */ map += stride * (y / bh) + texelSize * (x / bw); diff --git a/dll/opengl/mesa/swrast/s_triangle.c b/dll/opengl/mesa/swrast/s_triangle.c index e967e9b4290..0a78a3b9848 100644 --- a/dll/opengl/mesa/swrast/s_triangle.c +++ b/dll/opengl/mesa/swrast/s_triangle.c @@ -867,56 +867,6 @@ nodraw_triangle( struct gl_context *ctx, } -/* - * This is used when separate specular color is enabled, but not - * texturing. We add the specular color to the primary color, - * draw the triangle, then restore the original primary color. - * Inefficient, but seldom needed. - */ -void -_swrast_add_spec_terms_triangle(struct gl_context *ctx, const SWvertex *v0, - const SWvertex *v1, const SWvertex *v2) -{ - SWvertex *ncv0 = (SWvertex *)v0; /* drop const qualifier */ - SWvertex *ncv1 = (SWvertex *)v1; - SWvertex *ncv2 = (SWvertex *)v2; - GLfloat rSum, gSum, bSum; - GLchan cSave[3][4]; - - /* save original colors */ - COPY_CHAN4( cSave[0], ncv0->color ); - COPY_CHAN4( cSave[1], ncv1->color ); - COPY_CHAN4( cSave[2], ncv2->color ); - /* sum v0 */ - rSum = CHAN_TO_FLOAT(ncv0->color[0]) + ncv0->attrib[FRAG_ATTRIB_COL1][0]; - gSum = CHAN_TO_FLOAT(ncv0->color[1]) + ncv0->attrib[FRAG_ATTRIB_COL1][1]; - bSum = CHAN_TO_FLOAT(ncv0->color[2]) + ncv0->attrib[FRAG_ATTRIB_COL1][2]; - UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[0], rSum); - UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[1], gSum); - UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[2], bSum); - /* sum v1 */ - rSum = CHAN_TO_FLOAT(ncv1->color[0]) + ncv1->attrib[FRAG_ATTRIB_COL1][0]; - gSum = CHAN_TO_FLOAT(ncv1->color[1]) + ncv1->attrib[FRAG_ATTRIB_COL1][1]; - bSum = CHAN_TO_FLOAT(ncv1->color[2]) + ncv1->attrib[FRAG_ATTRIB_COL1][2]; - UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[0], rSum); - UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[1], gSum); - UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[2], bSum); - /* sum v2 */ - rSum = CHAN_TO_FLOAT(ncv2->color[0]) + ncv2->attrib[FRAG_ATTRIB_COL1][0]; - gSum = CHAN_TO_FLOAT(ncv2->color[1]) + ncv2->attrib[FRAG_ATTRIB_COL1][1]; - bSum = CHAN_TO_FLOAT(ncv2->color[2]) + ncv2->attrib[FRAG_ATTRIB_COL1][2]; - UNCLAMPED_FLOAT_TO_CHAN(ncv2->color[0], rSum); - UNCLAMPED_FLOAT_TO_CHAN(ncv2->color[1], gSum); - UNCLAMPED_FLOAT_TO_CHAN(ncv2->color[2], bSum); - /* draw */ - SWRAST_CONTEXT(ctx)->SpecTriangle( ctx, ncv0, ncv1, ncv2 ); - /* restore original colors */ - COPY_CHAN4( ncv0->color, cSave[0] ); - COPY_CHAN4( ncv1->color, cSave[1] ); - COPY_CHAN4( ncv2->color, cSave[2] ); -} - - #ifdef DEBUG @@ -970,7 +920,6 @@ _swrast_choose_triangle( struct gl_context *ctx ) * needs to be interpolated. */ if (ctx->Texture._EnabledCoord || - _mesa_need_secondary_color(ctx) || swrast->_FogEnabled) { /* Ugh, we do a _lot_ of tests to pick the best textured tri func */ const struct gl_texture_object *texObj2D; @@ -999,7 +948,6 @@ _swrast_choose_triangle( struct gl_context *ctx ) && texImg->Width == swImg->RowStride && (format == MESA_FORMAT_RGB888 || format == MESA_FORMAT_RGBA8888) && minFilter == magFilter - && ctx->Light.Model.ColorControl == GL_SINGLE_COLOR && !swrast->_FogEnabled && ctx->Texture.Unit.EnvMode != GL_COMBINE_EXT && ctx->Texture.Unit.EnvMode != GL_COMBINE4_NV) { diff --git a/dll/opengl/mesa/swrast/s_tritemp.h b/dll/opengl/mesa/swrast/s_tritemp.h index 8f1723617a1..c6ae5fc3586 100644 --- a/dll/opengl/mesa/swrast/s_tritemp.h +++ b/dll/opengl/mesa/swrast/s_tritemp.h @@ -361,32 +361,32 @@ static void NAME(struct gl_context *ctx, const SWvertex *v0, GLfloat eMaj_da = (GLfloat) (vMax->color[ACOMP] - vMin->color[ACOMP]); GLfloat eBot_da = (GLfloat) (vMid->color[ACOMP] - vMin->color[ACOMP]); # endif - span.attrStepX[FRAG_ATTRIB_COL0][0] = oneOverArea * (eMaj_dr * eBot.dy - eMaj.dy * eBot_dr); - span.attrStepY[FRAG_ATTRIB_COL0][0] = oneOverArea * (eMaj.dx * eBot_dr - eMaj_dr * eBot.dx); - span.attrStepX[FRAG_ATTRIB_COL0][1] = oneOverArea * (eMaj_dg * eBot.dy - eMaj.dy * eBot_dg); - span.attrStepY[FRAG_ATTRIB_COL0][1] = oneOverArea * (eMaj.dx * eBot_dg - eMaj_dg * eBot.dx); - span.attrStepX[FRAG_ATTRIB_COL0][2] = oneOverArea * (eMaj_db * eBot.dy - eMaj.dy * eBot_db); - span.attrStepY[FRAG_ATTRIB_COL0][2] = oneOverArea * (eMaj.dx * eBot_db - eMaj_db * eBot.dx); - span.redStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_COL0][0]); - span.greenStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_COL0][1]); - span.blueStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_COL0][2]); + span.attrStepX[FRAG_ATTRIB_COL][0] = oneOverArea * (eMaj_dr * eBot.dy - eMaj.dy * eBot_dr); + span.attrStepY[FRAG_ATTRIB_COL][0] = oneOverArea * (eMaj.dx * eBot_dr - eMaj_dr * eBot.dx); + span.attrStepX[FRAG_ATTRIB_COL][1] = oneOverArea * (eMaj_dg * eBot.dy - eMaj.dy * eBot_dg); + span.attrStepY[FRAG_ATTRIB_COL][1] = oneOverArea * (eMaj.dx * eBot_dg - eMaj_dg * eBot.dx); + span.attrStepX[FRAG_ATTRIB_COL][2] = oneOverArea * (eMaj_db * eBot.dy - eMaj.dy * eBot_db); + span.attrStepY[FRAG_ATTRIB_COL][2] = oneOverArea * (eMaj.dx * eBot_db - eMaj_db * eBot.dx); + span.redStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_COL][0]); + span.greenStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_COL][1]); + span.blueStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_COL][2]); # ifdef INTERP_ALPHA - span.attrStepX[FRAG_ATTRIB_COL0][3] = oneOverArea * (eMaj_da * eBot.dy - eMaj.dy * eBot_da); - span.attrStepY[FRAG_ATTRIB_COL0][3] = oneOverArea * (eMaj.dx * eBot_da - eMaj_da * eBot.dx); - span.alphaStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_COL0][3]); + span.attrStepX[FRAG_ATTRIB_COL][3] = oneOverArea * (eMaj_da * eBot.dy - eMaj.dy * eBot_da); + span.attrStepY[FRAG_ATTRIB_COL][3] = oneOverArea * (eMaj.dx * eBot_da - eMaj_da * eBot.dx); + span.alphaStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_COL][3]); # endif /* INTERP_ALPHA */ } else { ASSERT(ctx->Light.ShadeModel == GL_FLAT); span.interpMask |= SPAN_FLAT; - span.attrStepX[FRAG_ATTRIB_COL0][0] = span.attrStepY[FRAG_ATTRIB_COL0][0] = 0.0F; - span.attrStepX[FRAG_ATTRIB_COL0][1] = span.attrStepY[FRAG_ATTRIB_COL0][1] = 0.0F; - span.attrStepX[FRAG_ATTRIB_COL0][2] = span.attrStepY[FRAG_ATTRIB_COL0][2] = 0.0F; + span.attrStepX[FRAG_ATTRIB_COL][0] = span.attrStepY[FRAG_ATTRIB_COL][0] = 0.0F; + span.attrStepX[FRAG_ATTRIB_COL][1] = span.attrStepY[FRAG_ATTRIB_COL][1] = 0.0F; + span.attrStepX[FRAG_ATTRIB_COL][2] = span.attrStepY[FRAG_ATTRIB_COL][2] = 0.0F; span.redStep = 0; span.greenStep = 0; span.blueStep = 0; # ifdef INTERP_ALPHA - span.attrStepX[FRAG_ATTRIB_COL0][3] = span.attrStepY[FRAG_ATTRIB_COL0][3] = 0.0F; + span.attrStepX[FRAG_ATTRIB_COL][3] = span.attrStepY[FRAG_ATTRIB_COL][3] = 0.0F; span.alphaStep = 0; # endif } @@ -636,26 +636,26 @@ static void NAME(struct gl_context *ctx, const SWvertex *v0, #ifdef INTERP_RGB if (ctx->Light.ShadeModel == GL_SMOOTH) { rLeft = (GLint)(ChanToFixed(vLower->color[RCOMP]) - + span.attrStepX[FRAG_ATTRIB_COL0][0] * adjx - + span.attrStepY[FRAG_ATTRIB_COL0][0] * adjy) + FIXED_HALF; + + span.attrStepX[FRAG_ATTRIB_COL][0] * adjx + + span.attrStepY[FRAG_ATTRIB_COL][0] * adjy) + FIXED_HALF; gLeft = (GLint)(ChanToFixed(vLower->color[GCOMP]) - + span.attrStepX[FRAG_ATTRIB_COL0][1] * adjx - + span.attrStepY[FRAG_ATTRIB_COL0][1] * adjy) + FIXED_HALF; + + span.attrStepX[FRAG_ATTRIB_COL][1] * adjx + + span.attrStepY[FRAG_ATTRIB_COL][1] * adjy) + FIXED_HALF; bLeft = (GLint)(ChanToFixed(vLower->color[BCOMP]) - + span.attrStepX[FRAG_ATTRIB_COL0][2] * adjx - + span.attrStepY[FRAG_ATTRIB_COL0][2] * adjy) + FIXED_HALF; - fdrOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL0][0] - + dxOuter * span.attrStepX[FRAG_ATTRIB_COL0][0]); - fdgOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL0][1] - + dxOuter * span.attrStepX[FRAG_ATTRIB_COL0][1]); - fdbOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL0][2] - + dxOuter * span.attrStepX[FRAG_ATTRIB_COL0][2]); + + span.attrStepX[FRAG_ATTRIB_COL][2] * adjx + + span.attrStepY[FRAG_ATTRIB_COL][2] * adjy) + FIXED_HALF; + fdrOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL][0] + + dxOuter * span.attrStepX[FRAG_ATTRIB_COL][0]); + fdgOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL][1] + + dxOuter * span.attrStepX[FRAG_ATTRIB_COL][1]); + fdbOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL][2] + + dxOuter * span.attrStepX[FRAG_ATTRIB_COL][2]); # ifdef INTERP_ALPHA aLeft = (GLint)(ChanToFixed(vLower->color[ACOMP]) - + span.attrStepX[FRAG_ATTRIB_COL0][3] * adjx - + span.attrStepY[FRAG_ATTRIB_COL0][3] * adjy) + FIXED_HALF; - fdaOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL0][3] - + dxOuter * span.attrStepX[FRAG_ATTRIB_COL0][3]); + + span.attrStepX[FRAG_ATTRIB_COL][3] * adjx + + span.attrStepY[FRAG_ATTRIB_COL][3] * adjy) + FIXED_HALF; + fdaOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL][3] + + dxOuter * span.attrStepX[FRAG_ATTRIB_COL][3]); # endif } else { diff --git a/dll/opengl/mesa/swrast/s_zoom.c b/dll/opengl/mesa/swrast/s_zoom.c index b02a344c6b2..240cd1f0aec 100644 --- a/dll/opengl/mesa/swrast/s_zoom.c +++ b/dll/opengl/mesa/swrast/s_zoom.c @@ -156,7 +156,7 @@ zoom_span( struct gl_context *ctx, GLint imgX, GLint imgY, const SWspan *span, else if (zoomed.array->ChanType == GL_UNSIGNED_SHORT) zoomed.array->rgba = (GLchan (*)[4]) zoomed.array->rgba16; else - zoomed.array->rgba = (GLchan (*)[4]) zoomed.array->attribs[FRAG_ATTRIB_COL0]; + zoomed.array->rgba = (GLchan (*)[4]) zoomed.array->attribs[FRAG_ATTRIB_COL]; COPY_4V(zoomed.attrStart[FRAG_ATTRIB_WPOS], span->attrStart[FRAG_ATTRIB_WPOS]); COPY_4V(zoomed.attrStepX[FRAG_ATTRIB_WPOS], span->attrStepX[FRAG_ATTRIB_WPOS]); @@ -173,7 +173,7 @@ zoom_span( struct gl_context *ctx, GLint imgX, GLint imgY, const SWspan *span, /* we'll generate an array of colorss */ zoomed.interpMask = span->interpMask & ~SPAN_RGBA; zoomed.arrayMask |= SPAN_RGBA; - zoomed.arrayAttribs |= FRAG_BIT_COL0; /* we'll produce these values */ + zoomed.arrayAttribs |= FRAG_BIT_COL; /* we'll produce these values */ ASSERT(span->arrayMask & SPAN_RGBA); } else if (format == GL_DEPTH_COMPONENT) { @@ -225,7 +225,7 @@ zoom_span( struct gl_context *ctx, GLint imgX, GLint imgY, const SWspan *span, GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x; ASSERT(j >= 0); ASSERT(j < span->end); - COPY_4V(zoomed.array->attribs[FRAG_ATTRIB_COL0][i], rgba[j]); + COPY_4V(zoomed.array->attribs[FRAG_ATTRIB_COL][i], rgba[j]); } } } @@ -263,10 +263,10 @@ zoom_span( struct gl_context *ctx, GLint imgX, GLint imgY, const SWspan *span, GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x; ASSERT(j >= 0); ASSERT(j < span->end); - zoomed.array->attribs[FRAG_ATTRIB_COL0][i][0] = rgb[j][0]; - zoomed.array->attribs[FRAG_ATTRIB_COL0][i][1] = rgb[j][1]; - zoomed.array->attribs[FRAG_ATTRIB_COL0][i][2] = rgb[j][2]; - zoomed.array->attribs[FRAG_ATTRIB_COL0][i][3] = 1.0F; + zoomed.array->attribs[FRAG_ATTRIB_COL][i][0] = rgb[j][0]; + zoomed.array->attribs[FRAG_ATTRIB_COL][i][1] = rgb[j][1]; + zoomed.array->attribs[FRAG_ATTRIB_COL][i][2] = rgb[j][2]; + zoomed.array->attribs[FRAG_ATTRIB_COL][i][3] = 1.0F; } } } diff --git a/dll/opengl/mesa/swrast/swrast.h b/dll/opengl/mesa/swrast/swrast.h index cff5ed874bd..e3f2d942fa1 100644 --- a/dll/opengl/mesa/swrast/swrast.h +++ b/dll/opengl/mesa/swrast/swrast.h @@ -70,13 +70,13 @@ * primitives unaccelerated), hook in swrast_setup instead. */ typedef struct { - GLfloat attrib[32][4]; + GLfloat attrib[FRAG_ATTRIB_MAX][4]; GLchan color[4]; /** integer color */ GLfloat pointSize; } SWvertex; -#define FRAG_ATTRIB_CI FRAG_ATTRIB_COL0 +#define FRAG_ATTRIB_CI FRAG_ATTRIB_COL struct swrast_device_driver; diff --git a/dll/opengl/mesa/swrast_setup/ss_context.c b/dll/opengl/mesa/swrast_setup/ss_context.c index 7965f8eda8a..ca2d37603dc 100644 --- a/dll/opengl/mesa/swrast_setup/ss_context.c +++ b/dll/opengl/mesa/swrast_setup/ss_context.c @@ -125,15 +125,11 @@ setup_vertex_format(struct gl_context *ctx) EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, attrib[FRAG_ATTRIB_WPOS] ); - if (index_bitset & BITFIELD64_BIT(_TNL_ATTRIB_COLOR0)) { + if (index_bitset & BITFIELD64_BIT(_TNL_ATTRIB_COLOR)) { if (swsetup->intColors) - EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4CHAN_4F_RGBA, color ); + EMIT_ATTR( _TNL_ATTRIB_COLOR, EMIT_4CHAN_4F_RGBA, color ); else - EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4F, attrib[FRAG_ATTRIB_COL0]); - } - - if (index_bitset & BITFIELD64_BIT(_TNL_ATTRIB_COLOR1)) { - EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_4F, attrib[FRAG_ATTRIB_COL1]); + EMIT_ATTR( _TNL_ATTRIB_COLOR, EMIT_4F, attrib[FRAG_ATTRIB_COL]); } if (index_bitset & BITFIELD64_BIT(_TNL_ATTRIB_FOG)) { diff --git a/dll/opengl/mesa/swrast_setup/ss_triangle.c b/dll/opengl/mesa/swrast_setup/ss_triangle.c index 58918b8d510..7684f722735 100644 --- a/dll/opengl/mesa/swrast_setup/ss_triangle.c +++ b/dll/opengl/mesa/swrast_setup/ss_triangle.c @@ -130,26 +130,18 @@ static void _swsetup_render_tri(struct gl_context *ctx, if (ctx->Light.ShadeModel == GL_FLAT) { GLchan c[2][4]; - GLfloat s[2][4]; /* save colors/indexes for v0, v1 vertices */ COPY_CHAN4(c[0], v0->color); COPY_CHAN4(c[1], v1->color); - COPY_4V(s[0], v0->attrib[FRAG_ATTRIB_COL1]); - COPY_4V(s[1], v1->attrib[FRAG_ATTRIB_COL1]); /* copy v2 color/indexes to v0, v1 indexes */ COPY_CHAN4(v0->color, v2->color); COPY_CHAN4(v1->color, v2->color); - COPY_4V(v0->attrib[FRAG_ATTRIB_COL1], v2->attrib[FRAG_ATTRIB_COL1]); - COPY_4V(v1->attrib[FRAG_ATTRIB_COL1], v2->attrib[FRAG_ATTRIB_COL1]); - render(ctx, ef, e0, e1, e2, v0, v1, v2); COPY_CHAN4(v0->color, c[0]); COPY_CHAN4(v1->color, c[1]); - COPY_4V(v0->attrib[FRAG_ATTRIB_COL1], s[0]); - COPY_4V(v1->attrib[FRAG_ATTRIB_COL1], s[1]); } else { render(ctx, ef, e0, e1, e2, v0, v1, v2); diff --git a/dll/opengl/mesa/swrast_setup/ss_tritmp.h b/dll/opengl/mesa/swrast_setup/ss_tritmp.h index 89ed0418dbd..d4a53076bac 100644 --- a/dll/opengl/mesa/swrast_setup/ss_tritmp.h +++ b/dll/opengl/mesa/swrast_setup/ss_tritmp.h @@ -37,7 +37,6 @@ static void TAG(triangle)(struct gl_context *ctx, GLuint e0, GLuint e1, GLuint e SScontext *swsetup = SWSETUP_CONTEXT(ctx); GLchan saved_color[3][4] = { { 0 } }; GLfloat saved_col0[3][4] = { { 0 } }; - GLfloat saved_spec[3][4] = { { 0 } }; #endif SWvertex *verts = SWSETUP_CONTEXT(ctx)->verts; SWvertex *v[3]; @@ -79,9 +78,9 @@ static void TAG(triangle)(struct gl_context *ctx, GLuint e0, GLuint e1, GLuint e COPY_CHAN4(saved_color[2], v[2]->color); } else { - COPY_4V(saved_col0[0], v[0]->attrib[FRAG_ATTRIB_COL0]); - COPY_4V(saved_col0[1], v[1]->attrib[FRAG_ATTRIB_COL0]); - COPY_4V(saved_col0[2], v[2]->attrib[FRAG_ATTRIB_COL0]); + COPY_4V(saved_col0[0], v[0]->attrib[FRAG_ATTRIB_COL]); + COPY_4V(saved_col0[1], v[1]->attrib[FRAG_ATTRIB_COL]); + COPY_4V(saved_col0[2], v[2]->attrib[FRAG_ATTRIB_COL]); } if (VB->BackfaceColorPtr->stride) { @@ -91,9 +90,9 @@ static void TAG(triangle)(struct gl_context *ctx, GLuint e0, GLuint e1, GLuint e SS_COLOR(v[2]->color, vbcolor[e2]); } else { - COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL0], vbcolor[e0]); - COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL0], vbcolor[e1]); - COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL0], vbcolor[e2]); + COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL], vbcolor[e0]); + COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL], vbcolor[e1]); + COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL], vbcolor[e2]); } } else { @@ -104,31 +103,12 @@ static void TAG(triangle)(struct gl_context *ctx, GLuint e0, GLuint e1, GLuint e SS_COLOR(v[2]->color, vbcolor[0]); } else { - COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL0], vbcolor[0]); - COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL0], vbcolor[0]); - COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL0], vbcolor[0]); + COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL], vbcolor[0]); + COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL], vbcolor[0]); + COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL], vbcolor[0]); } } } - - if (VB->BackfaceSecondaryColorPtr) { - GLfloat (*vbspec)[4] = VB->BackfaceSecondaryColorPtr->data; - - COPY_4V(saved_spec[0], v[0]->attrib[FRAG_ATTRIB_COL1]); - COPY_4V(saved_spec[1], v[1]->attrib[FRAG_ATTRIB_COL1]); - COPY_4V(saved_spec[2], v[2]->attrib[FRAG_ATTRIB_COL1]); - - if (VB->BackfaceSecondaryColorPtr->stride) { - SS_SPEC(v[0]->attrib[FRAG_ATTRIB_COL1], vbspec[e0]); - SS_SPEC(v[1]->attrib[FRAG_ATTRIB_COL1], vbspec[e1]); - SS_SPEC(v[2]->attrib[FRAG_ATTRIB_COL1], vbspec[e2]); - } - else { - SS_SPEC(v[0]->attrib[FRAG_ATTRIB_COL1], vbspec[0]); - SS_SPEC(v[1]->attrib[FRAG_ATTRIB_COL1], vbspec[0]); - SS_SPEC(v[2]->attrib[FRAG_ATTRIB_COL1], vbspec[0]); - } - } } #endif } @@ -210,17 +190,11 @@ static void TAG(triangle)(struct gl_context *ctx, GLuint e0, GLuint e1, GLuint e COPY_CHAN4(v[2]->color, saved_color[2]); } else { - COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL0], saved_col0[0]); - COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL0], saved_col0[1]); - COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL0], saved_col0[2]); + COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL], saved_col0[0]); + COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL], saved_col0[1]); + COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL], saved_col0[2]); } } - - if (VB->BackfaceSecondaryColorPtr) { - COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL1], saved_spec[0]); - COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL1], saved_spec[1]); - COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL1], saved_spec[2]); - } } } #endif diff --git a/dll/opengl/mesa/tnl/t_context.c b/dll/opengl/mesa/tnl/t_context.c index e4bc08b08c5..e74f3e385a7 100644 --- a/dll/opengl/mesa/tnl/t_context.c +++ b/dll/opengl/mesa/tnl/t_context.c @@ -101,10 +101,7 @@ _tnl_InvalidateState( struct gl_context *ctx, GLuint new_state ) */ tnl->render_inputs_bitset = BITFIELD64_BIT(_TNL_ATTRIB_POS); - tnl->render_inputs_bitset |= BITFIELD64_BIT(_TNL_ATTRIB_COLOR0); - - if (_mesa_need_secondary_color(ctx)) - tnl->render_inputs_bitset |= BITFIELD64_BIT(_TNL_ATTRIB_COLOR1); + tnl->render_inputs_bitset |= BITFIELD64_BIT(_TNL_ATTRIB_COLOR); if (ctx->Texture._EnabledCoord) { tnl->render_inputs_bitset |= BITFIELD64_BIT(_TNL_ATTRIB_TEX); diff --git a/dll/opengl/mesa/tnl/t_context.h b/dll/opengl/mesa/tnl/t_context.h index de8aa1323b3..81dcf17f46c 100644 --- a/dll/opengl/mesa/tnl/t_context.h +++ b/dll/opengl/mesa/tnl/t_context.h @@ -79,12 +79,15 @@ enum { _TNL_ATTRIB_POS = 0, _TNL_ATTRIB_WEIGHT = 1, _TNL_ATTRIB_NORMAL = 2, - _TNL_ATTRIB_COLOR0 = 3, - _TNL_ATTRIB_COLOR1 = 4, - _TNL_ATTRIB_FOG = 5, - _TNL_ATTRIB_COLOR_INDEX = 6, - _TNL_ATTRIB_EDGEFLAG = 7, - _TNL_ATTRIB_TEX = 8, + _TNL_ATTRIB_COLOR = 3, + _TNL_ATTRIB_FOG = 4, + _TNL_ATTRIB_COLOR_INDEX = 5, + _TNL_ATTRIB_EDGEFLAG = 6, + _TNL_ATTRIB_TEX = 7, + /* This is really a VERT_RESULT, not an attrib. Need to fix + * tnl to understand the difference. + */ + _TNL_ATTRIB_POINTSIZE = 8, /* These alias with the generics, but they are not active * concurrently, so it's not a problem. The TNL module @@ -96,50 +99,29 @@ enum { * generic attribute in order to pick up per-vertex material * data. */ - _TNL_ATTRIB_MAT_FRONT_AMBIENT = 10, - _TNL_ATTRIB_MAT_BACK_AMBIENT = 11, - _TNL_ATTRIB_MAT_FRONT_DIFFUSE = 12, - _TNL_ATTRIB_MAT_BACK_DIFFUSE = 13, - _TNL_ATTRIB_MAT_FRONT_SPECULAR = 14, - _TNL_ATTRIB_MAT_BACK_SPECULAR = 15, - _TNL_ATTRIB_MAT_FRONT_EMISSION = 16, - _TNL_ATTRIB_MAT_BACK_EMISSION = 17, - _TNL_ATTRIB_MAT_FRONT_SHININESS = 18, - _TNL_ATTRIB_MAT_BACK_SHININESS = 19, - _TNL_ATTRIB_MAT_FRONT_INDEXES = 20, - _TNL_ATTRIB_MAT_BACK_INDEXES = 21, + _TNL_ATTRIB_MAT_FRONT_AMBIENT = 9, + _TNL_ATTRIB_MAT_BACK_AMBIENT = 10, + _TNL_ATTRIB_MAT_FRONT_DIFFUSE = 11, + _TNL_ATTRIB_MAT_BACK_DIFFUSE = 12, + _TNL_ATTRIB_MAT_FRONT_SPECULAR = 13, + _TNL_ATTRIB_MAT_BACK_SPECULAR = 14, + _TNL_ATTRIB_MAT_FRONT_EMISSION = 15, + _TNL_ATTRIB_MAT_BACK_EMISSION = 16, + _TNL_ATTRIB_MAT_FRONT_SHININESS = 17, + _TNL_ATTRIB_MAT_BACK_SHININESS = 18, + _TNL_ATTRIB_MAT_FRONT_INDEXES = 29, + _TNL_ATTRIB_MAT_BACK_INDEXES = 20, - /* This is really a VERT_RESULT, not an attrib. Need to fix - * tnl to understand the difference. - */ - _TNL_ATTRIB_POINTSIZE = 9, - - _TNL_ATTRIB_MAX = 22 + _TNL_ATTRIB_MAX = 21 } ; -#define _TNL_ATTRIB_GENERIC(n) (_TNL_ATTRIB_GENERIC0 + (n)) - -/* special index used for handing invalid glVertexAttribute() indices */ -#define _TNL_ATTRIB_ERROR (_TNL_ATTRIB_GENERIC15 + 1) - /** * Handy attribute ranges: */ -#define _TNL_FIRST_PROG _TNL_ATTRIB_WEIGHT -#define _TNL_LAST_PROG _TNL_ATTRIB_TEX #define _TNL_FIRST_MAT _TNL_ATTRIB_MAT_FRONT_AMBIENT #define _TNL_LAST_MAT _TNL_ATTRIB_MAT_BACK_INDEXES -/* Number of available texture attributes */ -#define _TNL_NUM_TEX 8 - -/* Number of available generic attributes */ -#define _TNL_NUM_GENERIC 16 - -/* Number of attributes used for evaluators */ -#define _TNL_NUM_EVAL 16 - #define PRIM_BEGIN 0x10 #define PRIM_END 0x20 @@ -184,7 +166,6 @@ struct vertex_buffer GLboolean *EdgeFlag; /* _TNL_BIT_EDGEFLAG */ GLvector4f *BackfaceIndexPtr; GLvector4f *BackfaceColorPtr; - GLvector4f *BackfaceSecondaryColorPtr; const struct _mesa_prim *Primitive; GLuint PrimitiveCount; diff --git a/dll/opengl/mesa/tnl/t_draw.c b/dll/opengl/mesa/tnl/t_draw.c index afcebc9d434..c8916e7e8ed 100644 --- a/dll/opengl/mesa/tnl/t_draw.c +++ b/dll/opengl/mesa/tnl/t_draw.c @@ -73,24 +73,6 @@ static void free_space(struct gl_context *ctx) } \ } while (0) - -static void -convert_half_to_float(const struct gl_client_array *input, - const GLubyte *ptr, GLfloat *fptr, - GLuint count, GLuint sz) -{ - GLuint i, j; - - for (i = 0; i < count; i++) { - GLhalfARB *in = (GLhalfARB *)ptr; - - for (j = 0; j < sz; j++) { - *fptr++ = _mesa_half_to_float(in[j]); - } - ptr += input->StrideB; - } -} - /** * \brief Convert fixed-point to floating-point. * @@ -168,9 +150,6 @@ static void _tnl_import_array( struct gl_context *ctx, case GL_DOUBLE: CONVERT(GLdouble, (GLfloat)); break; - case GL_HALF_FLOAT: - convert_half_to_float(input, ptr, fptr, count, sz); - break; case GL_FIXED: convert_fixed_to_float(input, ptr, fptr, count); break; @@ -271,7 +250,6 @@ static void bind_inputs( struct gl_context *ctx, /* These should perhaps be part of _TNL_ATTRIB_* */ VB->BackfaceColorPtr = NULL; VB->BackfaceIndexPtr = NULL; - VB->BackfaceSecondaryColorPtr = NULL; /* Clipping and drawing code still requires this to be a packed * array of ubytes which can be written into. TODO: Fix and diff --git a/dll/opengl/mesa/tnl/t_rasterpos.c b/dll/opengl/mesa/tnl/t_rasterpos.c index ada9117144a..9d5794c5e3c 100644 --- a/dll/opengl/mesa/tnl/t_rasterpos.c +++ b/dll/opengl/mesa/tnl/t_rasterpos.c @@ -104,8 +104,7 @@ static void shade_rastpos(struct gl_context *ctx, const GLfloat vertex[4], const GLfloat normal[3], - GLfloat Rcolor[4], - GLfloat Rspec[4]) + GLfloat Rcolor[4]) { /*const*/ GLfloat (*base)[3] = ctx->Light._BaseColor; const struct gl_light *light; @@ -209,14 +208,8 @@ shade_rastpos(struct gl_context *ctx, GET_SHINE_TAB_ENTRY( ctx->_ShineTable[0], n_dot_h, spec_coef ); if (spec_coef > 1.0e-10) { - if (ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR) { - ACC_SCALE_SCALAR_3V( specularContrib, spec_coef, + ACC_SCALE_SCALAR_3V( diffuseContrib, spec_coef, light->_MatSpecular[0]); - } - else { - ACC_SCALE_SCALAR_3V( diffuseContrib, spec_coef, - light->_MatSpecular[0]); - } } } } @@ -229,10 +222,6 @@ shade_rastpos(struct gl_context *ctx, Rcolor[1] = CLAMP(diffuseColor[1], 0.0F, 1.0F); Rcolor[2] = CLAMP(diffuseColor[2], 0.0F, 1.0F); Rcolor[3] = CLAMP(diffuseColor[3], 0.0F, 1.0F); - Rspec[0] = CLAMP(specularColor[0], 0.0F, 1.0F); - Rspec[1] = CLAMP(specularColor[1], 0.0F, 1.0F); - Rspec[2] = CLAMP(specularColor[2], 0.0F, 1.0F); - Rspec[3] = CLAMP(specularColor[3], 0.0F, 1.0F); } @@ -421,15 +410,12 @@ _tnl_RasterPos(struct gl_context *ctx, const GLfloat vObj[4]) if (ctx->Light.Enabled) { /* lighting */ shade_rastpos( ctx, vObj, norm, - ctx->Current.RasterColor, - ctx->Current.RasterSecondaryColor ); + ctx->Current.RasterColor ); } else { /* use current color */ COPY_4FV(ctx->Current.RasterColor, - ctx->Current.Attrib[VERT_ATTRIB_COLOR0]); - COPY_4FV(ctx->Current.RasterSecondaryColor, - ctx->Current.Attrib[VERT_ATTRIB_COLOR1]); + ctx->Current.Attrib[VERT_ATTRIB_COLOR]); } /* texture coords */ diff --git a/dll/opengl/mesa/tnl/t_vb_light.c b/dll/opengl/mesa/tnl/t_vb_light.c index 19ba0f40332..355e85f6fd3 100644 --- a/dll/opengl/mesa/tnl/t_vb_light.c +++ b/dll/opengl/mesa/tnl/t_vb_light.c @@ -50,7 +50,6 @@ struct material_cursor { struct light_stage_data { GLvector4f Input; GLvector4f LitColor[2]; - GLvector4f LitSecondary[2]; light_func *light_func_tab; struct material_cursor mat[MAT_ATTRIB_MAX]; @@ -113,7 +112,7 @@ prepare_materials(struct gl_context *ctx, const GLuint bitmask = ctx->Light.ColorMaterialBitmask; for (i = 0 ; i < MAT_ATTRIB_MAX ; i++) if (bitmask & (1<AttribPtr[_TNL_ATTRIB_MAT_FRONT_AMBIENT + i] = VB->AttribPtr[_TNL_ATTRIB_COLOR0]; + VB->AttribPtr[_TNL_ATTRIB_MAT_FRONT_AMBIENT + i] = VB->AttribPtr[_TNL_ATTRIB_COLOR]; } /* Now, for each material attribute that's tracking vertex color, save @@ -246,9 +245,6 @@ static void validate_lighting( struct gl_context *ctx, return; if (ctx->Light._NeedVertices) { - if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) - tab = _tnl_light_spec_tab; - else tab = _tnl_light_tab; } else { @@ -290,13 +286,9 @@ static GLboolean init_lighting( struct gl_context *ctx, _mesa_vector4f_alloc( &store->Input, 0, size, 32 ); _mesa_vector4f_alloc( &store->LitColor[0], 0, size, 32 ); _mesa_vector4f_alloc( &store->LitColor[1], 0, size, 32 ); - _mesa_vector4f_alloc( &store->LitSecondary[0], 0, size, 32 ); - _mesa_vector4f_alloc( &store->LitSecondary[1], 0, size, 32 ); store->LitColor[0].size = 4; store->LitColor[1].size = 4; - store->LitSecondary[0].size = 3; - store->LitSecondary[1].size = 3; return GL_TRUE; } @@ -312,8 +304,6 @@ static void dtr( struct tnl_pipeline_stage *stage ) _mesa_vector4f_free( &store->Input ); _mesa_vector4f_free( &store->LitColor[0] ); _mesa_vector4f_free( &store->LitColor[1] ); - _mesa_vector4f_free( &store->LitSecondary[0] ); - _mesa_vector4f_free( &store->LitSecondary[1] ); FREE( store ); stage->privatePtr = NULL; } diff --git a/dll/opengl/mesa/tnl/t_vb_lighttmp.h b/dll/opengl/mesa/tnl/t_vb_lighttmp.h index aae1d18ff7f..f9a21149b92 100644 --- a/dll/opengl/mesa/tnl/t_vb_lighttmp.h +++ b/dll/opengl/mesa/tnl/t_vb_lighttmp.h @@ -28,13 +28,6 @@ */ -#if IDX & LIGHT_TWOSIDE -# define NR_SIDES 2 -#else -# define NR_SIDES 1 -#endif - - /* define TRACE to trace lighting code */ /* #define TRACE 1 */ @@ -60,10 +53,8 @@ static void TAG(light_rgba_spec)( struct gl_context *ctx, const GLfloat *normal = (GLfloat *)VB->AttribPtr[_TNL_ATTRIB_NORMAL]->data; GLfloat (*Fcolor)[4] = (GLfloat (*)[4]) store->LitColor[0].data; - GLfloat (*Fspec)[4] = (GLfloat (*)[4]) store->LitSecondary[0].data; #if IDX & LIGHT_TWOSIDE GLfloat (*Bcolor)[4] = (GLfloat (*)[4]) store->LitColor[1].data; - GLfloat (*Bspec)[4] = (GLfloat (*)[4]) store->LitSecondary[1].data; #endif const GLuint nr = VB->Count; @@ -72,13 +63,11 @@ static void TAG(light_rgba_spec)( struct gl_context *ctx, fprintf(stderr, "%s\n", __FUNCTION__ ); #endif - VB->AttribPtr[_TNL_ATTRIB_COLOR0] = &store->LitColor[0]; - VB->AttribPtr[_TNL_ATTRIB_COLOR1] = &store->LitSecondary[0]; + VB->AttribPtr[_TNL_ATTRIB_COLOR] = &store->LitColor[0]; sumA[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3]; #if IDX & LIGHT_TWOSIDE VB->BackfaceColorPtr = &store->LitColor[1]; - VB->BackfaceSecondaryColorPtr = &store->LitSecondary[1]; sumA[1] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE][3]; #endif @@ -220,12 +209,10 @@ static void TAG(light_rgba_spec)( struct gl_context *ctx, } /*loop over lights*/ COPY_3V( Fcolor[j], sum[0] ); - COPY_3V( Fspec[j], spec[0] ); Fcolor[j][3] = sumA[0]; #if IDX & LIGHT_TWOSIDE COPY_3V( Bcolor[j], sum[1] ); - COPY_3V( Bspec[j], spec[1] ); Bcolor[j][3] = sumA[1]; #endif } @@ -259,7 +246,7 @@ static void TAG(light_rgba)( struct gl_context *ctx, fprintf(stderr, "%s\n", __FUNCTION__ ); #endif - VB->AttribPtr[_TNL_ATTRIB_COLOR0] = &store->LitColor[0]; + VB->AttribPtr[_TNL_ATTRIB_COLOR] = &store->LitColor[0]; sumA[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3]; #if IDX & LIGHT_TWOSIDE @@ -449,7 +436,7 @@ static void TAG(light_fast_rgba_single)( struct gl_context *ctx, (void) input; /* doesn't refer to Eye or Obj */ - VB->AttribPtr[_TNL_ATTRIB_COLOR0] = &store->LitColor[0]; + VB->AttribPtr[_TNL_ATTRIB_COLOR] = &store->LitColor[0]; #if IDX & LIGHT_TWOSIDE VB->BackfaceColorPtr = &store->LitColor[1]; #endif @@ -559,7 +546,7 @@ static void TAG(light_fast_rgba)( struct gl_context *ctx, sumA[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3]; sumA[1] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE][3]; - VB->AttribPtr[_TNL_ATTRIB_COLOR0] = &store->LitColor[0]; + VB->AttribPtr[_TNL_ATTRIB_COLOR] = &store->LitColor[0]; #if IDX & LIGHT_TWOSIDE VB->BackfaceColorPtr = &store->LitColor[1]; #endif @@ -648,4 +635,3 @@ static void TAG(init_light_tab)( void ) #undef TAG #undef IDX -#undef NR_SIDES diff --git a/dll/opengl/mesa/tnl/t_vertex_generic.c b/dll/opengl/mesa/tnl/t_vertex_generic.c index f9a3129fa14..b8ef1f7d474 100644 --- a/dll/opengl/mesa/tnl/t_vertex_generic.c +++ b/dll/opengl/mesa/tnl/t_vertex_generic.c @@ -1065,8 +1065,7 @@ void _tnl_generic_copy_pv( struct gl_context *ctx, GLuint edst, GLuint esrc ) GLuint j; for (j = 0; j < attr_count; j++) { - if (a[j].attrib == VERT_ATTRIB_COLOR0 || - a[j].attrib == VERT_ATTRIB_COLOR1) { + if (a[j].attrib == VERT_ATTRIB_COLOR) { memcpy( vdst + a[j].vertoffset, vsrc + a[j].vertoffset, @@ -1099,15 +1098,6 @@ void _tnl_generic_interp_extras( struct gl_context *ctx, VB->BackfaceColorPtr->data[out], VB->BackfaceColorPtr->data[in] ); } - - if (VB->BackfaceSecondaryColorPtr) { - assert(VB->BackfaceSecondaryColorPtr->stride == 4 * sizeof(GLfloat)); - - INTERP_3F( t, - VB->BackfaceSecondaryColorPtr->data[dst], - VB->BackfaceSecondaryColorPtr->data[out], - VB->BackfaceSecondaryColorPtr->data[in] ); - } if (VB->BackfaceIndexPtr) { VB->BackfaceIndexPtr->data[dst][0] = LINTERP( t, @@ -1134,11 +1124,6 @@ void _tnl_generic_copy_pv_extras( struct gl_context *ctx, VB->BackfaceColorPtr->data[src] ); } - if (VB->BackfaceSecondaryColorPtr) { - COPY_4FV( VB->BackfaceSecondaryColorPtr->data[dst], - VB->BackfaceSecondaryColorPtr->data[src] ); - } - if (VB->BackfaceIndexPtr) { VB->BackfaceIndexPtr->data[dst][0] = VB->BackfaceIndexPtr->data[src][0]; } diff --git a/dll/opengl/mesa/vbo/vbo_attrib.h b/dll/opengl/mesa/vbo/vbo_attrib.h index e0ec4df4ee2..550bd2719fa 100644 --- a/dll/opengl/mesa/vbo/vbo_attrib.h +++ b/dll/opengl/mesa/vbo/vbo_attrib.h @@ -47,28 +47,27 @@ enum { VBO_ATTRIB_POS = 0, VBO_ATTRIB_WEIGHT = 1, VBO_ATTRIB_NORMAL = 2, - VBO_ATTRIB_COLOR0 = 3, - VBO_ATTRIB_COLOR1 = 4, - VBO_ATTRIB_FOG = 5, - VBO_ATTRIB_INDEX = 6, - VBO_ATTRIB_EDGEFLAG = 7, - VBO_ATTRIB_TEX = 8, - VBO_ATTRIB_POINT_SIZE = 9, + VBO_ATTRIB_COLOR = 3, + VBO_ATTRIB_FOG = 4, + VBO_ATTRIB_INDEX = 5, + VBO_ATTRIB_EDGEFLAG = 6, + VBO_ATTRIB_TEX = 7, + VBO_ATTRIB_POINT_SIZE = 8, - VBO_ATTRIB_MAT_FRONT_AMBIENT = 10, - VBO_ATTRIB_MAT_BACK_AMBIENT = 11, - VBO_ATTRIB_MAT_FRONT_DIFFUSE = 12, - VBO_ATTRIB_MAT_BACK_DIFFUSE = 13, - VBO_ATTRIB_MAT_FRONT_SPECULAR = 14, - VBO_ATTRIB_MAT_BACK_SPECULAR = 15, - VBO_ATTRIB_MAT_FRONT_EMISSION = 16, - VBO_ATTRIB_MAT_BACK_EMISSION = 17, - VBO_ATTRIB_MAT_FRONT_SHININESS = 18, - VBO_ATTRIB_MAT_BACK_SHININESS = 19, - VBO_ATTRIB_MAT_FRONT_INDEXES = 20, - VBO_ATTRIB_MAT_BACK_INDEXES = 21, + VBO_ATTRIB_MAT_FRONT_AMBIENT = 9, + VBO_ATTRIB_MAT_BACK_AMBIENT = 10, + VBO_ATTRIB_MAT_FRONT_DIFFUSE = 11, + VBO_ATTRIB_MAT_BACK_DIFFUSE = 12, + VBO_ATTRIB_MAT_FRONT_SPECULAR = 13, + VBO_ATTRIB_MAT_BACK_SPECULAR = 14, + VBO_ATTRIB_MAT_FRONT_EMISSION = 15, + VBO_ATTRIB_MAT_BACK_EMISSION = 16, + VBO_ATTRIB_MAT_FRONT_SHININESS = 17, + VBO_ATTRIB_MAT_BACK_SHININESS = 18, + VBO_ATTRIB_MAT_FRONT_INDEXES = 19, + VBO_ATTRIB_MAT_BACK_INDEXES = 20, - VBO_ATTRIB_MAX = 22 + VBO_ATTRIB_MAX = 21 }; #define VBO_ATTRIB_FIRST_MATERIAL VBO_ATTRIB_MAT_FRONT_AMBIENT diff --git a/dll/opengl/mesa/vbo/vbo_attrib_tmp.h b/dll/opengl/mesa/vbo/vbo_attrib_tmp.h index 2570030b9d5..20800a41568 100644 --- a/dll/opengl/mesa/vbo/vbo_attrib_tmp.h +++ b/dll/opengl/mesa/vbo/vbo_attrib_tmp.h @@ -197,44 +197,28 @@ static void GLAPIENTRY TAG(Color3f)(GLfloat x, GLfloat y, GLfloat z) { GET_CURRENT_CONTEXT(ctx); - ATTR3F(VBO_ATTRIB_COLOR0, x, y, z); + ATTR3F(VBO_ATTRIB_COLOR, x, y, z); } static void GLAPIENTRY TAG(Color3fv)(const GLfloat * v) { GET_CURRENT_CONTEXT(ctx); - ATTR3FV(VBO_ATTRIB_COLOR0, v); + ATTR3FV(VBO_ATTRIB_COLOR, v); } static void GLAPIENTRY TAG(Color4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w) { GET_CURRENT_CONTEXT(ctx); - ATTR4F(VBO_ATTRIB_COLOR0, x, y, z, w); + ATTR4F(VBO_ATTRIB_COLOR, x, y, z, w); } static void GLAPIENTRY TAG(Color4fv)(const GLfloat * v) { GET_CURRENT_CONTEXT(ctx); - ATTR4FV(VBO_ATTRIB_COLOR0, v); -} - - - -static void GLAPIENTRY -TAG(SecondaryColor3fEXT)(GLfloat x, GLfloat y, GLfloat z) -{ - GET_CURRENT_CONTEXT(ctx); - ATTR3F(VBO_ATTRIB_COLOR1, x, y, z); -} - -static void GLAPIENTRY -TAG(SecondaryColor3fvEXT)(const GLfloat * v) -{ - GET_CURRENT_CONTEXT(ctx); - ATTR3FV(VBO_ATTRIB_COLOR1, v); + ATTR4FV(VBO_ATTRIB_COLOR, v); } diff --git a/dll/opengl/mesa/vbo/vbo_exec_api.c b/dll/opengl/mesa/vbo/vbo_exec_api.c index fc443f76a7e..56e3fea559b 100644 --- a/dll/opengl/mesa/vbo/vbo_exec_api.c +++ b/dll/opengl/mesa/vbo/vbo_exec_api.c @@ -171,9 +171,9 @@ static void vbo_exec_copy_to_current( struct vbo_exec_context *exec ) /* Colormaterial -- this kindof sucks. */ if (ctx->Light.ColorMaterialEnabled && - exec->vtx.attrsz[VBO_ATTRIB_COLOR0]) { + exec->vtx.attrsz[VBO_ATTRIB_COLOR]) { _mesa_update_color_material(ctx, - ctx->Current.Attrib[VBO_ATTRIB_COLOR0]); + ctx->Current.Attrib[VBO_ATTRIB_COLOR]); } } @@ -871,8 +871,6 @@ static void vbo_exec_vtxfmt_init( struct vbo_exec_context *exec ) vfmt->FogCoordfvEXT = vbo_FogCoordfvEXT; vfmt->Normal3f = vbo_Normal3f; vfmt->Normal3fv = vbo_Normal3fv; - vfmt->SecondaryColor3fEXT = vbo_SecondaryColor3fEXT; - vfmt->SecondaryColor3fvEXT = vbo_SecondaryColor3fvEXT; vfmt->TexCoord1f = vbo_TexCoord1f; vfmt->TexCoord1fv = vbo_TexCoord1fv; vfmt->TexCoord2f = vbo_TexCoord2f; @@ -927,8 +925,6 @@ static void vbo_exec_vtxfmt_init( struct vbo_exec_context *exec ) (void) vbo_MultiTexCoord4fv; (void) vbo_Normal3f; (void) vbo_Normal3fv; - (void) vbo_SecondaryColor3fEXT; - (void) vbo_SecondaryColor3fvEXT; (void) vbo_TexCoord1f; (void) vbo_TexCoord1fv; (void) vbo_TexCoord2f; @@ -1168,4 +1164,4 @@ static void reset_attrfv( struct vbo_exec_context *exec ) } exec->vtx.vertex_size = 0; -} \ No newline at end of file +} diff --git a/dll/opengl/mesa/vbo/vbo_exec_array.c b/dll/opengl/mesa/vbo/vbo_exec_array.c index 29f97208e69..1858771658f 100644 --- a/dll/opengl/mesa/vbo/vbo_exec_array.c +++ b/dll/opengl/mesa/vbo/vbo_exec_array.c @@ -154,122 +154,6 @@ vbo_get_minmax_index(struct gl_context *ctx, } -/** - * Check that element 'j' of the array has reasonable data. - * Map VBO if needed. - * For debugging purposes; not normally used. - */ -static void -check_array_data(struct gl_context *ctx, struct gl_client_array *array, - GLuint attrib, GLuint j) -{ - if (array->Enabled) { - const void *data = array->Ptr; - if (_mesa_is_bufferobj(array->BufferObj)) { - if (!array->BufferObj->Pointer) { - /* need to map now */ - array->BufferObj->Pointer = - ctx->Driver.MapBufferRange(ctx, 0, array->BufferObj->Size, - GL_MAP_READ_BIT, array->BufferObj); - } - data = ADD_POINTERS(data, array->BufferObj->Pointer); - } - switch (array->Type) { - case GL_FLOAT: - { - GLfloat *f = (GLfloat *) ((GLubyte *) data + array->StrideB * j); - GLint k; - for (k = 0; k < array->Size; k++) { - if (IS_INF_OR_NAN(f[k]) || - f[k] >= 1.0e20 || f[k] <= -1.0e10) { - printf("Bad array data:\n"); - printf(" Element[%u].%u = %f\n", j, k, f[k]); - printf(" Array %u at %p\n", attrib, (void* ) array); - printf(" Type 0x%x, Size %d, Stride %d\n", - array->Type, array->Size, array->Stride); - printf(" Address/offset %p in Buffer Object %u\n", - array->Ptr, array->BufferObj->Name); - f[k] = 1.0; /* XXX replace the bad value! */ - } - /*assert(!IS_INF_OR_NAN(f[k]));*/ - } - } - break; - default: - ; - } - } -} - - -/** - * Unmap the buffer object referenced by given array, if mapped. - */ -static void -unmap_array_buffer(struct gl_context *ctx, struct gl_client_array *array) -{ - if (array->Enabled && - _mesa_is_bufferobj(array->BufferObj) && - _mesa_bufferobj_mapped(array->BufferObj)) { - ctx->Driver.UnmapBuffer(ctx, array->BufferObj); - } -} - - -/** - * Examine the array's data for NaNs, etc. - * For debug purposes; not normally used. - */ -static void -check_draw_elements_data(struct gl_context *ctx, GLsizei count, GLenum elemType, - const void *elements, GLint basevertex) -{ - struct gl_array_object *arrayObj = ctx->Array.ArrayObj; - const void *elemMap; - GLint i, k; - - if (_mesa_is_bufferobj(ctx->Array.ArrayObj->ElementArrayBufferObj)) { - elemMap = ctx->Driver.MapBufferRange(ctx, 0, - ctx->Array.ArrayObj->ElementArrayBufferObj->Size, - GL_MAP_READ_BIT, - ctx->Array.ArrayObj->ElementArrayBufferObj); - elements = ADD_POINTERS(elements, elemMap); - } - - for (i = 0; i < count; i++) { - GLuint j; - - /* j = element[i] */ - switch (elemType) { - case GL_UNSIGNED_BYTE: - j = ((const GLubyte *) elements)[i]; - break; - case GL_UNSIGNED_SHORT: - j = ((const GLushort *) elements)[i]; - break; - case GL_UNSIGNED_INT: - j = ((const GLuint *) elements)[i]; - break; - default: - assert(0); - } - - /* check element j of each enabled array */ - for (k = 0; k < Elements(arrayObj->VertexAttrib); k++) { - check_array_data(ctx, &arrayObj->VertexAttrib[k], k, j); - } - } - - if (_mesa_is_bufferobj(arrayObj->ElementArrayBufferObj)) { - ctx->Driver.UnmapBuffer(ctx, ctx->Array.ArrayObj->ElementArrayBufferObj); - } - - for (k = 0; k < Elements(arrayObj->VertexAttrib); k++) { - unmap_array_buffer(ctx, &arrayObj->VertexAttrib[k]); - } -} - - /** * Check array data, looking for NaNs, etc. */ @@ -289,7 +173,6 @@ print_draw_arrays(struct gl_context *ctx, { struct vbo_context *vbo = vbo_context(ctx); struct vbo_exec_context *exec = &vbo->exec; - struct gl_array_object *arrayObj = ctx->Array.ArrayObj; int i; printf("vbo_exec_DrawArrays(mode 0x%x, start %d, count %d):\n", @@ -305,7 +188,7 @@ print_draw_arrays(struct gl_context *ctx, exec->array.inputs[i]->Size, stride, /*exec->array.inputs[i]->Enabled,*/ - arrayObj->VertexAttrib[VERT_ATTRIB(i)].Enabled, + ctx->Array.VertexAttrib[VERT_ATTRIB(i)].Enabled, exec->array.inputs[i]->Ptr, bufName); @@ -342,7 +225,7 @@ recalculate_input_bindings(struct gl_context *ctx) { struct vbo_context *vbo = vbo_context(ctx); struct vbo_exec_context *exec = &vbo->exec; - struct gl_client_array *vertexAttrib = ctx->Array.ArrayObj->VertexAttrib; + struct gl_client_array *vertexAttrib = ctx->Array.VertexAttrib; const struct gl_client_array **inputs = &exec->array.inputs[0]; GLbitfield64 const_inputs = 0x0; GLuint i; @@ -546,7 +429,7 @@ vbo_validated_drawrangeelements(struct gl_context *ctx, GLenum mode, ib.count = count; ib.type = type; - ib.obj = ctx->Array.ArrayObj->ElementArrayBufferObj; + ib.obj = ctx->Array.ElementArrayBufferObj; ib.ptr = indices; prim[0].begin = 1; @@ -595,82 +478,6 @@ vbo_validated_drawrangeelements(struct gl_context *ctx, GLenum mode, index_bounds_valid, start, end ); } -/** - * Called by glDrawRangeElements() in immediate mode. - */ -static void GLAPIENTRY -vbo_exec_DrawRangeElements(GLenum mode, - GLuint start, GLuint end, - GLsizei count, GLenum type, - const GLvoid *indices) -{ - static GLuint warnCount = 0; - GLboolean index_bounds_valid = GL_TRUE; - GET_CURRENT_CONTEXT(ctx); - - if (MESA_VERBOSE & VERBOSE_DRAW) - _mesa_debug(ctx, - "glDrawRangeElements(%s, %u, %u, %d, %s, %p)\n", - _mesa_lookup_enum_by_nr(mode), start, end, count, - _mesa_lookup_enum_by_nr(type), indices); - - if (!_mesa_validate_DrawRangeElements( ctx, mode, start, end, count, - type, indices )) - return; - - if (end < start || - end >= ctx->Array.ArrayObj->_MaxElement) { - /* The application requested we draw using a range of indices that's - * outside the bounds of the current VBO. This is invalid and appears - * to give undefined results. The safest thing to do is to simply - * ignore the range, in case the application botched their range tracking - * but did provide valid indices. Also issue a warning indicating that - * the application is broken. - */ - if (warnCount++ < 10) { - _mesa_warning(ctx, "glDrawRangeElements(start %u, end %u, " - "count %d, type 0x%x, indices=%p):\n" - "\trange is outside VBO bounds (max=%u); ignoring.\n" - "\tThis should be fixed in the application.", - start, end, count, type, indices, - ctx->Array.ArrayObj->_MaxElement - 1); - } - index_bounds_valid = GL_FALSE; - } - - /* NOTE: It's important that 'end' is a reasonable value. - * in _tnl_draw_prims(), we use end to determine how many vertices - * to transform. If it's too large, we can unnecessarily split prims - * or we can read/write out of memory in several different places! - */ - - /* Catch/fix some potential user errors */ - if (type == GL_UNSIGNED_BYTE) { - start = MIN2(start, 0xff); - end = MIN2(end, 0xff); - } - else if (type == GL_UNSIGNED_SHORT) { - start = MIN2(start, 0xffff); - end = MIN2(end, 0xffff); - } - - if (0) { - printf("glDraw[Range]Elements" - "(start %u, end %u, type 0x%x, count %d) ElemBuf %u\n", - start, end, type, count, - ctx->Array.ArrayObj->ElementArrayBufferObj->Name); - } - -#if 0 - check_draw_elements_data(ctx, count, type, indices); -#else - (void) check_draw_elements_data; -#endif - - vbo_validated_drawrangeelements(ctx, mode, index_bounds_valid, start, end, - count, type, indices, 1); -} - /** * Called by glDrawElements() in immediate mode. @@ -703,7 +510,6 @@ vbo_exec_array_init( struct vbo_exec_context *exec ) { exec->vtxfmt.DrawArrays = vbo_exec_DrawArrays; exec->vtxfmt.DrawElements = vbo_exec_DrawElements; - exec->vtxfmt.DrawRangeElements = vbo_exec_DrawRangeElements; } @@ -735,11 +541,3 @@ _mesa_DrawElements(GLenum mode, GLsizei count, GLenum type, vbo_exec_DrawElements(mode, count, type, indices); } - -void GLAPIENTRY -_mesa_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, - GLenum type, const GLvoid *indices) -{ - vbo_exec_DrawRangeElements(mode, start, end, count, type, indices); -} - diff --git a/dll/opengl/mesa/vbo/vbo_exec_eval.c b/dll/opengl/mesa/vbo/vbo_exec_eval.c index fd1f6792674..0c0aa386c60 100644 --- a/dll/opengl/mesa/vbo/vbo_exec_eval.c +++ b/dll/opengl/mesa/vbo/vbo_exec_eval.c @@ -72,10 +72,10 @@ void vbo_exec_eval_update( struct vbo_exec_context *exec ) } if (ctx->Eval.Map1Color4) - set_active_eval1( exec, VBO_ATTRIB_COLOR0, 4, &ctx->EvalMap.Map1Color4 ); + set_active_eval1( exec, VBO_ATTRIB_COLOR, 4, &ctx->EvalMap.Map1Color4 ); if (ctx->Eval.Map2Color4) - set_active_eval2( exec, VBO_ATTRIB_COLOR0, 4, &ctx->EvalMap.Map2Color4 ); + set_active_eval2( exec, VBO_ATTRIB_COLOR, 4, &ctx->EvalMap.Map2Color4 ); if (ctx->Eval.Map1TextureCoord4) set_active_eval1( exec, VBO_ATTRIB_TEX, 4, &ctx->EvalMap.Map1Texture4 ); diff --git a/dll/opengl/mesa/vbo/vbo_noop.c b/dll/opengl/mesa/vbo/vbo_noop.c index edef84e327e..dffed25676d 100644 --- a/dll/opengl/mesa/vbo/vbo_noop.c +++ b/dll/opengl/mesa/vbo/vbo_noop.c @@ -87,16 +87,6 @@ _mesa_noop_Color3fv(const GLfloat * v) { } -static void GLAPIENTRY -_mesa_noop_SecondaryColor3fEXT(GLfloat a, GLfloat b, GLfloat c) -{ -} - -static void GLAPIENTRY -_mesa_noop_SecondaryColor3fvEXT(const GLfloat * v) -{ -} - static void GLAPIENTRY _mesa_noop_TexCoord1f(GLfloat a) { @@ -275,15 +265,6 @@ _mesa_noop_DrawElements(GLenum mode, GLsizei count, GLenum type, { } - -static void GLAPIENTRY -_mesa_noop_DrawRangeElements(GLenum mode, - GLuint start, GLuint end, - GLsizei count, GLenum type, - const GLvoid * indices) -{ -} - static void GLAPIENTRY _mesa_noop_EvalMesh1(GLenum mode, GLint i1, GLint i2) { @@ -325,8 +306,6 @@ _mesa_noop_vtxfmt_init(GLvertexformat * vfmt) vfmt->Materialfv = _mesa_noop_Materialfv; vfmt->Normal3f = _mesa_noop_Normal3f; vfmt->Normal3fv = _mesa_noop_Normal3fv; - vfmt->SecondaryColor3fEXT = _mesa_noop_SecondaryColor3fEXT; - vfmt->SecondaryColor3fvEXT = _mesa_noop_SecondaryColor3fvEXT; vfmt->TexCoord1f = _mesa_noop_TexCoord1f; vfmt->TexCoord1fv = _mesa_noop_TexCoord1fv; vfmt->TexCoord2f = _mesa_noop_TexCoord2f; @@ -354,7 +333,6 @@ _mesa_noop_vtxfmt_init(GLvertexformat * vfmt) vfmt->DrawArrays = _mesa_noop_DrawArrays; vfmt->DrawElements = _mesa_noop_DrawElements; - vfmt->DrawRangeElements = _mesa_noop_DrawRangeElements; } diff --git a/dll/opengl/mesa/vbo/vbo_save_api.c b/dll/opengl/mesa/vbo/vbo_save_api.c index 280b73cf412..69bdbe4df8d 100644 --- a/dll/opengl/mesa/vbo/vbo_save_api.c +++ b/dll/opengl/mesa/vbo/vbo_save_api.c @@ -950,21 +950,6 @@ _save_DrawElements(GLenum mode, GLsizei count, GLenum type, } -static void GLAPIENTRY -_save_DrawRangeElements(GLenum mode, GLuint start, GLuint end, - GLsizei count, GLenum type, const GLvoid * indices) -{ - GET_CURRENT_CONTEXT(ctx); - (void) mode; - (void) start; - (void) end; - (void) count; - (void) type; - (void) indices; - _mesa_compile_error(ctx, GL_INVALID_OPERATION, "glDrawRangeElements"); -} - - static void GLAPIENTRY _save_DrawArrays(GLenum mode, GLint start, GLsizei count) { @@ -1084,9 +1069,8 @@ _save_OBE_DrawElements(GLenum mode, GLsizei count, GLenum type, _ae_map_vbos(ctx); - if (_mesa_is_bufferobj(ctx->Array.ArrayObj->ElementArrayBufferObj)) - indices = - ADD_POINTERS(ctx->Array.ArrayObj->ElementArrayBufferObj->Pointer, indices); + if (_mesa_is_bufferobj(ctx->Array.ElementArrayBufferObj)) + indices = ADD_POINTERS(ctx->Array.ElementArrayBufferObj->Pointer, indices); vbo_save_NotifyBegin(ctx, (mode | VBO_SAVE_PRIM_WEAK | VBO_SAVE_PRIM_NO_CURRENT_UPDATE)); @@ -1115,25 +1099,6 @@ _save_OBE_DrawElements(GLenum mode, GLsizei count, GLenum type, } -static void GLAPIENTRY -_save_OBE_DrawRangeElements(GLenum mode, GLuint start, GLuint end, - GLsizei count, GLenum type, - const GLvoid * indices) -{ - GET_CURRENT_CONTEXT(ctx); - struct vbo_save_context *save = &vbo_context(ctx)->save; - - if (!_mesa_validate_DrawRangeElements(ctx, mode, - start, end, count, type, indices)) - return; - - if (save->out_of_memory) - return; - - _save_OBE_DrawElements(mode, count, type, indices); -} - - static void _save_vtxfmt_init(struct gl_context *ctx) { @@ -1156,8 +1121,6 @@ _save_vtxfmt_init(struct gl_context *ctx) vfmt->Materialfv = _save_Materialfv; vfmt->Normal3f = _save_Normal3f; vfmt->Normal3fv = _save_Normal3fv; - vfmt->SecondaryColor3fEXT = _save_SecondaryColor3fEXT; - vfmt->SecondaryColor3fvEXT = _save_SecondaryColor3fvEXT; vfmt->TexCoord1f = _save_TexCoord1f; vfmt->TexCoord1fv = _save_TexCoord1fv; vfmt->TexCoord2f = _save_TexCoord2f; @@ -1195,7 +1158,6 @@ _save_vtxfmt_init(struct gl_context *ctx) vfmt->Rectf = _save_Rectf; vfmt->DrawArrays = _save_DrawArrays; vfmt->DrawElements = _save_DrawElements; - vfmt->DrawRangeElements = _save_DrawRangeElements; } @@ -1396,7 +1358,6 @@ vbo_save_api_init(struct vbo_save_context *save) ctx->ListState.ListVtxfmt.Rectf = _save_OBE_Rectf; ctx->ListState.ListVtxfmt.DrawArrays = _save_OBE_DrawArrays; ctx->ListState.ListVtxfmt.DrawElements = _save_OBE_DrawElements; - ctx->ListState.ListVtxfmt.DrawRangeElements = _save_OBE_DrawRangeElements; _mesa_install_save_vtxfmt(ctx, &ctx->ListState.ListVtxfmt); } diff --git a/dll/opengl/mesa/vbo/vbo_save_draw.c b/dll/opengl/mesa/vbo/vbo_save_draw.c index 71f66bbd0f4..364d8bf3cf8 100644 --- a/dll/opengl/mesa/vbo/vbo_save_draw.c +++ b/dll/opengl/mesa/vbo/vbo_save_draw.c @@ -96,7 +96,7 @@ _playback_copy_to_current(struct gl_context *ctx, /* Colormaterial -- this kindof sucks. */ if (ctx->Light.ColorMaterialEnabled) { - _mesa_update_color_material(ctx, ctx->Current.Attrib[VBO_ATTRIB_COLOR0]); + _mesa_update_color_material(ctx, ctx->Current.Attrib[VBO_ATTRIB_COLOR]); } /* CurrentExecPrimitive diff --git a/dll/opengl/mesa/x86/gen_matypes.c b/dll/opengl/mesa/x86/gen_matypes.c index 2eaea8841a8..9d8a0e8cdb7 100644 --- a/dll/opengl/mesa/x86/gen_matypes.c +++ b/dll/opengl/mesa/x86/gen_matypes.c @@ -229,7 +229,6 @@ int main( int argc, char **argv ) OFFSET( "LIGHT_MODEL_AMBIENT ", struct gl_lightmodel, Ambient ); OFFSET( "LIGHT_MODEL_LOCAL_VIEWER ", struct gl_lightmodel, LocalViewer ); OFFSET( "LIGHT_MODEL_TWO_SIDE ", struct gl_lightmodel, TwoSide ); - OFFSET( "LIGHT_MODEL_COLOR_CONTROL ", struct gl_lightmodel, ColorControl ); printf( "\n" ); diff --git a/dll/opengl/mesa/x86/mmx.h b/dll/opengl/mesa/x86/mmx.h index 74e9979d312..53a63f321c9 100644 --- a/dll/opengl/mesa/x86/mmx.h +++ b/dll/opengl/mesa/x86/mmx.h @@ -41,16 +41,6 @@ _mesa_mmx_blend_add( struct gl_context *ctx, GLuint n, const GLubyte mask[], GLvoid *rgba, const GLvoid *dest, GLenum chanType ); -extern void _ASMAPI -_mesa_mmx_blend_min( struct gl_context *ctx, GLuint n, const GLubyte mask[], - GLvoid *rgba, const GLvoid *dest, - GLenum chanType ); - -extern void _ASMAPI -_mesa_mmx_blend_max( struct gl_context *ctx, GLuint n, const GLubyte mask[], - GLvoid *rgba, const GLvoid *dest, - GLenum chanType ); - extern void _ASMAPI _mesa_mmx_blend_modulate( struct gl_context *ctx, GLuint n, const GLubyte mask[], GLvoid *rgba, const GLvoid *dest, diff --git a/dll/opengl/mesa/x86/mmx_blend.S b/dll/opengl/mesa/x86/mmx_blend.S index eeaf43ea937..1831f220107 100644 --- a/dll/opengl/mesa/x86/mmx_blend.S +++ b/dll/opengl/mesa/x86/mmx_blend.S @@ -304,70 +304,6 @@ TWO(MOVQ ( MM1, REGIND(rgba) )) #include "mmx_blendtmp.h" -/* Blend min function - */ - -#define TAG(x) CONCAT(x,_min) -#define LLTAG(x) LLBL2(x,_min) - -/* Kevin F. Quinn 2nd July 2006 - * Replace data segment constants with text-segment instructions -#define INIT \ - MOVQ ( CONTENT(const_80), MM7 ) - */ -#define INIT \ - PUSH_L ( CONST(const_80_h) ) /* 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80*/ ;\ - PUSH_L ( CONST(const_80_l) ) ;\ - MOVQ ( REGIND(ESP), MM7 ) ;\ - ADD_L ( CONST(8), ESP) - -#define MAIN( rgba, dest ) \ - GMB_LOAD( rgba, dest, MM1, MM2 ) ;\ - MOVQ ( MM1, MM3 ) ;\ - MOVQ ( MM2, MM4 ) ;\ - PXOR ( MM7, MM3 ) /* unsigned -> signed */ ;\ - PXOR ( MM7, MM4 ) /* unsigned -> signed */ ;\ - PCMPGTB ( MM3, MM4 ) /* q > p ? 0xff : 0x00 */ ;\ - PAND ( MM4, MM1 ) /* q > p ? p : 0 */ ;\ - PANDN ( MM2, MM4 ) /* q > p ? 0 : q */ ;\ - POR ( MM1, MM4 ) /* q > p ? p : q */ ;\ - GMB_STORE( rgba, MM4 ) - -#include "mmx_blendtmp.h" - - -/* Blend max function - */ - -#define TAG(x) CONCAT(x,_max) -#define LLTAG(x) LLBL2(x,_max) - -/* Kevin F. Quinn 2nd July 2006 - * Replace data segment constants with text-segment instructions -#define INIT \ - MOVQ ( CONTENT(const_80), MM7 ) - */ -#define INIT \ - PUSH_L ( CONST(const_80_l) ) /* 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80*/ ;\ - PUSH_L ( CONST(const_80_h) ) ;\ - MOVQ ( REGIND(ESP), MM7 ) ;\ - ADD_L ( CONST(8), ESP) - -#define MAIN( rgba, dest ) \ - GMB_LOAD( rgba, dest, MM1, MM2 ) ;\ - MOVQ ( MM1, MM3 ) ;\ - MOVQ ( MM2, MM4 ) ;\ - PXOR ( MM7, MM3 ) /* unsigned -> signed */ ;\ - PXOR ( MM7, MM4 ) /* unsigned -> signed */ ;\ - PCMPGTB ( MM3, MM4 ) /* q > p ? 0xff : 0x00 */ ;\ - PAND ( MM4, MM2 ) /* q > p ? q : 0 */ ;\ - PANDN ( MM1, MM4 ) /* q > p ? 0 : p */ ;\ - POR ( MM2, MM4 ) /* q > p ? p : q */ ;\ - GMB_STORE( rgba, MM4 ) - -#include "mmx_blendtmp.h" - - /* Blend modulate function */ diff --git a/dll/opengl/opengl32/swimpl.c b/dll/opengl/opengl32/swimpl.c index 3fb164f85dd..d2957c33460 100644 --- a/dll/opengl/opengl32/swimpl.c +++ b/dll/opengl/opengl32/swimpl.c @@ -51,7 +51,7 @@ static const struct { MESA_FORMAT_RGB888, 24, 8, 0, 0x00000000, 8, 8, 0x00000000, 8, 16, 0x00000000, 0, 0, 0x00000000, 16, 16, 8, BI_RGB }, // { MESA_FORMAT_BGR888, 24, 8, 16, 8, 8, 8, 0, 0, 0, 16, 32, 8 }, // { MESA_FORMAT_BGR888, 24, 8, 16, 8, 8, 8, 0, 0, 0, 16, 16, 8 }, - { MESA_FORMAT_RGB565, 16, 5, 0, 0x00000000, 6, 5, 0x00000000, 5, 11, 0x00000000, 0, 0, 0x00000000, 16, 32, 8, BI_BITFIELDS }, + { MESA_FORMAT_RGB565, 16, 5, 0, 0x0000F800, 6, 5, 0x000007E0, 5, 11, 0x0000001F, 0, 0, 0x00000000, 16, 32, 8, BI_BITFIELDS }, { MESA_FORMAT_RGB565, 16, 5, 0, 0x0000F800, 6, 5, 0x000007E0, 5, 11, 0x0000001F, 0, 0, 0x00000000, 16, 16, 8, BI_BITFIELDS }, }; @@ -361,15 +361,15 @@ INT sw_DescribePixelFormat(HDC hdc, INT format, UINT size, PIXELFORMATDESCRIPTOR INT nb_win_compat = 0, start_win_compat = 0; INT ret = sizeof(pixel_formats)/sizeof(pixel_formats[0]); - if(GetObjectType(hdc) == OBJ_DC) + if (GetObjectType(hdc) == OBJ_DC) { /* Find the window compatible formats */ INT bpp = GetDeviceCaps(hdc, BITSPIXEL); - for(index = 0; indexformat_index = index_from_format(dc_data, format, &doubleBuffered); + TRACE("Using format %u - double buffered: %x.\n", fb->format_index, doubleBuffered); fb->flags = doubleBuffered ? SW_FB_DOUBLEBUFFERED : 0; /* Set the bitmap info describing the framebuffer */ fb->bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); @@ -663,6 +667,9 @@ sw_call_window_proc( * of the client area via GetClientRect. */ RECT client_rect; UINT width, height; + + TRACE("Got WM_WINDOWPOSCHANGED\n"); + GetClientRect(pParams->hwnd, &client_rect); width = client_rect.right - client_rect.left; height = client_rect.bottom - client_rect.top; diff --git a/dll/win32/advapi32/advapi32.spec b/dll/win32/advapi32/advapi32.spec index e3abe3b3c2e..36f658c3b94 100644 --- a/dll/win32/advapi32/advapi32.spec +++ b/dll/win32/advapi32/advapi32.spec @@ -1,3 +1,4 @@ +@ stub I_ScGetCurrentGroupStateW @ stdcall A_SHAFinal(ptr ptr) @ stdcall A_SHAInit(ptr) @ stdcall A_SHAUpdate(ptr ptr long) @@ -24,7 +25,6 @@ @ stdcall AddAuditAccessAce(ptr long long ptr long long) @ stdcall AddAuditAccessAceEx(ptr long long long ptr long long) @ stdcall AddAuditAccessObjectAce(ptr long long long ptr ptr ptr long long) -;@ stdcall AddMandatoryAce(ptr long long long ptr) @ stdcall AddUsersToEncryptedFile(wstr ptr) @ stdcall AdjustTokenGroups(long long ptr long ptr ptr) @ stdcall AdjustTokenPrivileges(long long ptr long ptr ptr) @@ -66,7 +66,6 @@ @ stdcall CommandLineFromMsiDescriptor(wstr ptr ptr) @ stub ComputeAccessTokenFromCodeAuthzLevel @ stdcall ControlService(long long ptr) -@ stdcall ControlServiceEx(ptr long long ptr) @ stdcall ControlTraceA(double str ptr long) @ stdcall ControlTraceW(double wstr ptr long) @ stub ConvertAccessToSecurityDescriptorA @@ -96,7 +95,6 @@ @ stdcall CreatePrivateObjectSecurityEx(ptr ptr ptr ptr long long ptr ptr) @ stdcall CreatePrivateObjectSecurityWithMultipleInheritance(ptr ptr ptr ptr long long long ptr ptr) @ stdcall CreateProcessAsUserA(long str str ptr ptr long long ptr str ptr ptr) -# @ stub CreateProcessAsUserSecure @ stdcall CreateProcessAsUserW(long str str ptr ptr long long ptr str ptr ptr) @ stdcall CreateProcessWithLogonW(wstr wstr wstr long wstr wstr long ptr wstr ptr ptr) @ stdcall CreateProcessWithTokenW(ptr long wstr wstr long ptr wstr ptr ptr) @@ -189,7 +187,6 @@ @ stub ElfClearEventLogFileW @ stub ElfCloseEventLog @ stub ElfDeregisterEventSource -@ stub ElfDeregisterEventSourceW @ stub ElfFlushEventLog @ stub ElfNumberOfRecords @ stub ElfOldestRecord @@ -202,6 +199,7 @@ @ stub ElfRegisterEventSourceA @ stub ElfRegisterEventSourceW @ stub ElfReportEventA +# ElfReportEventAndSourceW @ stub ElfReportEventW @ stdcall EnableTrace(long long long ptr double) @ stdcall EncryptFileA(str) @@ -210,7 +208,6 @@ @ stdcall EncryptionDisable(wstr long) @ stdcall EnumDependentServicesA(long long ptr long ptr ptr) @ stdcall EnumDependentServicesW(long long ptr long ptr ptr) -@ stub EnumServiceGroupA @ stdcall EnumServiceGroupW(ptr long long ptr long ptr ptr ptr wstr) @ stdcall EnumServicesStatusA(long long long ptr long ptr ptr ptr) @ stdcall EnumServicesStatusExA(long long long long ptr long ptr ptr ptr str) @@ -254,7 +251,6 @@ @ stub GetLocalManagedApplications @ stub GetManagedApplicationCategories @ stub GetManagedApplications -@ stub GetMangledSiteSid @ stdcall GetMultipleTrusteeA(ptr) @ stdcall GetMultipleTrusteeOperationA(ptr) @ stdcall GetMultipleTrusteeOperationW(ptr) @@ -285,7 +281,6 @@ @ stdcall GetSidLengthRequired(long) @ stdcall GetSidSubAuthority(ptr long) @ stdcall GetSidSubAuthorityCount(ptr) -@ stdcall GetSiteSidFromToken(ptr) @ stdcall GetTokenInformation(long long ptr long ptr) @ stdcall GetTraceEnableFlags(double) @ stdcall GetTraceEnableLevel(double) @@ -299,11 +294,10 @@ @ stdcall GetUserNameA(ptr ptr) @ stdcall GetUserNameW(ptr ptr) @ stdcall GetWindowsAccountDomainSid(ptr ptr ptr) -@ stub I_ScGetCurrentGroupStateW +# I_QueryTagInformation @ stub I_ScIsSecurityProcess @ stub I_ScPnPGetServiceName @ stub I_ScSendTSMessage -@ stub I_ScSetServiceBit @ stdcall I_ScSetServiceBitsA(ptr long long long str) @ stdcall I_ScSetServiceBitsW(ptr long long long wstr) @ stub IdentifyCodeAuthzLevelW @@ -319,7 +313,6 @@ @ stdcall InitiateSystemShutdownExW(wstr wstr long long long long) @ stdcall InitiateSystemShutdownW(str str long long long) @ stub InstallApplication -@ stub IsProcessRestricted @ stdcall IsTextUnicode(ptr long ptr) ntdll.RtlIsTextUnicode @ stdcall IsTokenRestricted(long) @ stub IsTokenUntrusted @@ -370,8 +363,8 @@ @ stub LsaICLookupNamesWithCreds @ stub LsaICLookupSids @ stub LsaICLookupSidsWithCreds -@ stdcall LsaLookupNames(ptr long ptr ptr ptr) @ stdcall LsaLookupNames2(ptr long long ptr ptr ptr) +@ stdcall LsaLookupNames(ptr long ptr ptr ptr) @ stdcall LsaLookupPrivilegeDisplayName(ptr ptr ptr ptr) @ stdcall LsaLookupPrivilegeName(ptr ptr ptr) @ stdcall LsaLookupPrivilegeValue(ptr ptr ptr) @@ -411,10 +404,10 @@ @ stdcall MD5Final(ptr) @ stdcall MD5Init(ptr) @ stdcall MD5Update(ptr ptr long) -@ stub MSChapSrvChangePassword @ stub MSChapSrvChangePassword2 -@ stdcall MakeAbsoluteSD(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) +@ stub MSChapSrvChangePassword @ stdcall MakeAbsoluteSD2(ptr ptr) +@ stdcall MakeAbsoluteSD(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) @ stdcall MakeSelfRelativeSD(ptr ptr ptr) @ stdcall MapGenericMask(ptr ptr) ntdll.RtlMapGenericMask @ stdcall NotifyBootConfigStatus(long) @@ -446,11 +439,9 @@ @ stdcall PrivilegedServiceAuditAlarmW(wstr wstr long ptr long) @ stub ProcessIdleTasks @ stub ProcessTrace -@ stub ProvAccessRightsToNTAccessMask # ? @ stdcall QueryAllTracesA(ptr long ptr) @ stdcall QueryAllTracesW(ptr long ptr) @ stdcall QueryRecoveryAgentsOnEncryptedFile(wstr ptr) -@ stdcall QuerySecurityAccessMask(long ptr) @ stdcall QueryServiceConfig2A(long long ptr long ptr) @ stdcall QueryServiceConfig2W(long long ptr long ptr) @ stdcall QueryServiceConfigA(long ptr long ptr) @@ -463,15 +454,14 @@ @ stub QueryTraceA @ stub QueryTraceW @ stdcall QueryUsersOnEncryptedFile(wstr ptr) -@ stdcall QueryWindows31FilesMigration(long) @ stub ReadEncryptedFileRaw @ stdcall ReadEventLogA(long long long ptr long ptr ptr) @ stdcall ReadEventLogW(long long long ptr long ptr ptr) @ stdcall RegCloseKey(long) @ stdcall RegConnectRegistryA(str long ptr) +# RegConnectRegistryExA +# RegConnectRegistryExW @ stdcall RegConnectRegistryW(wstr long ptr) -@ stdcall RegCopyTreeA(ptr str ptr) -@ stdcall RegCopyTreeW(ptr wstr ptr) @ stdcall RegCreateKeyA(long str ptr) @ stdcall RegCreateKeyExA(long str long ptr long long ptr ptr ptr) @ stdcall RegCreateKeyExW(long wstr long ptr long long ptr ptr ptr) @@ -480,14 +470,9 @@ @ stdcall RegDeleteKeyExA(long str long long) @ stdcall RegDeleteKeyExW(long wstr long long) @ stdcall RegDeleteKeyW(long wstr) -@ stdcall RegDeleteKeyValueA(ptr str str) -@ stdcall RegDeleteKeyValueW(ptr wstr wstr) -@ stdcall RegDeleteTreeA(long str) -@ stdcall RegDeleteTreeW(long wstr) @ stdcall RegDeleteValueA(long str) @ stdcall RegDeleteValueW(long wstr) @ stdcall RegDisablePredefinedCache() -@ stdcall RegDisablePredefinedCacheEx() @ stdcall RegDisableReflectionKey(ptr) @ stdcall RegEnableReflectionKey(ptr) @ stdcall RegEnumKeyA(long long ptr long) @@ -502,8 +487,6 @@ @ stdcall RegGetValueW(long wstr wstr long ptr ptr ptr) @ stdcall RegLoadKeyA(long str str) @ stdcall RegLoadKeyW(long wstr wstr) -@ stdcall RegLoadMUIStringA(long str str long ptr long str) -@ stdcall RegLoadMUIStringW(long wstr wstr long ptr long wstr) @ stdcall RegNotifyChangeKeyValue(long long long long long) @ stdcall RegOpenCurrentUser(long ptr) @ stdcall RegOpenKeyA(long str ptr) @@ -521,7 +504,6 @@ @ stdcall RegQueryValueExA(long str ptr ptr ptr ptr) @ stdcall RegQueryValueExW(long wstr ptr ptr ptr ptr) @ stdcall RegQueryValueW(long wstr ptr ptr) -@ stub RegRemapPreDefKey @ stdcall RegReplaceKeyA(long str str str) @ stdcall RegReplaceKeyW(long wstr wstr wstr) @ stdcall RegRestoreKeyA(long str long) @@ -531,8 +513,6 @@ @ stdcall RegSaveKeyExW(long str ptr long) @ stdcall RegSaveKeyW(long ptr ptr) @ stdcall RegSetKeySecurity(long long ptr) -@ stdcall RegSetKeyValueA(long str str long ptr long) -@ stdcall RegSetKeyValueW(long wstr wstr long ptr long) @ stdcall RegSetValueA(long str long ptr long) @ stdcall RegSetValueExA(long str long long ptr long) @ stdcall RegSetValueExW(long wstr long long ptr long) @@ -587,7 +567,6 @@ @ stdcall SetNamedSecurityInfoW(wstr long ptr ptr ptr ptr ptr) @ stdcall SetPrivateObjectSecurity(long ptr ptr ptr long) @ stub SetPrivateObjectSecurityEx -@ stdcall SetSecurityAccessMask(long ptr) @ stdcall SetSecurityDescriptorControl(ptr long long) @ stdcall SetSecurityDescriptorDacl(ptr long ptr long) @ stdcall SetSecurityDescriptorGroup(ptr ptr long) @@ -612,7 +591,6 @@ @ stdcall StartTraceW(ptr wstr ptr) @ stub StopTraceA @ stub StopTraceW -@ stdcall SynchronizeWindows31FilesAndWindowsNTRegistry(long long long long) @ stdcall SystemFunction001(ptr ptr ptr) @ stdcall SystemFunction002(ptr ptr ptr) @ stdcall SystemFunction003(ptr ptr) diff --git a/dll/win32/advapi32/misc/logon.c b/dll/win32/advapi32/misc/logon.c index ff06b428bf7..a333ac14d87 100644 --- a/dll/win32/advapi32/misc/logon.c +++ b/dll/win32/advapi32/misc/logon.c @@ -463,7 +463,7 @@ LogonUserW(LPWSTR lpszUsername, SE_GROUP_ENABLED_BY_DEFAULT; /* Set the token source */ - strcpy(TokenSource.SourceName, "LogonUser"); + strncpy(TokenSource.SourceName, "Advapi ", sizeof(TokenSource.SourceName)); AllocateLocallyUniqueId(&TokenSource.SourceIdentifier); Status = LsaLogonUser(LsaHandle, diff --git a/dll/win32/advapi32/misc/shutdown.c b/dll/win32/advapi32/misc/shutdown.c index 4cd0039ce15..1a8ccd7899e 100644 --- a/dll/win32/advapi32/misc/shutdown.c +++ b/dll/win32/advapi32/misc/shutdown.c @@ -117,6 +117,8 @@ InitiateSystemShutdownExW(LPWSTR lpMachineName, NTSTATUS Status; ULONG Timeout_ms; + DBG_UNREFERENCED_LOCAL_VARIABLE(Timeout_ms); + /* Convert to milliseconds so we can use the value later on */ Timeout_ms = dwTimeout * 1000; @@ -217,7 +219,7 @@ InitiateSystemShutdownExA(LPSTR lpMachineName, /****************************************************************************** * InitiateShutdownW [ADVAPI32.@] - * + * * @unimplamented */ DWORD WINAPI @@ -233,7 +235,7 @@ InitiateShutdownW(LPWSTR lpMachineName, /****************************************************************************** * InitiateShutdownA [ADVAPI32.@] - * + * * see InitiateShutdownW */ DWORD WINAPI diff --git a/dll/win32/advapi32/misc/sysfunc.c b/dll/win32/advapi32/misc/sysfunc.c index b8fc700b076..12713ddc945 100644 --- a/dll/win32/advapi32/misc/sysfunc.c +++ b/dll/win32/advapi32/misc/sysfunc.c @@ -607,9 +607,9 @@ SystemFunction036(PVOID pbBuffer, ULONG dwLen) do { /* Get each byte from the pseudo random number and store it in the buffer */ - *pBuffer = (BYTE)(uPseudoRandom >> 8 * (dwLen % 4) & 0xFF); + *pBuffer = (BYTE)(uPseudoRandom >> 8 * (dwLen % 3) & 0xFF); ++pBuffer; - } while(--dwLen % 4); + } while(--dwLen % 3); } while(dwLen); return TRUE; diff --git a/dll/win32/atl/CMakeLists.txt b/dll/win32/atl/CMakeLists.txt index 580e31c495b..fbc3632c45a 100644 --- a/dll/win32/atl/CMakeLists.txt +++ b/dll/win32/atl/CMakeLists.txt @@ -3,9 +3,6 @@ add_definitions( -D__WINESRC__ -D_ATL_VER=_ATL_VER_30) -remove_definitions(-D_WIN32_WINNT=0x502) -add_definitions(-D_WIN32_WINNT=0x600) - include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine) spec2def(atl.dll atl.spec ADD_IMPORTLIB) @@ -22,6 +19,6 @@ list(APPEND SOURCE add_library(atl SHARED ${SOURCE} rsrc.rc) set_module_type(atl win32dll) target_link_libraries(atl uuid wine) -add_importlibs(atl oleaut32 ole32 user32 gdi32 advapi32 msvcrt kernel32 ntdll) +add_importlibs(atl oleaut32 ole32 user32 gdi32 advapi32 shlwapi msvcrt kernel32 ntdll) add_pch(atl precomp.h SOURCE) add_cd_file(TARGET atl DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/atl/registrar.c b/dll/win32/atl/registrar.c index 1c2207d56d7..830328c84e5 100644 --- a/dll/win32/atl/registrar.c +++ b/dll/win32/atl/registrar.c @@ -18,6 +18,12 @@ #include +#define NO_SHLWAPI_PATH +#define NO_SHLWAPI_STRFCNS +#define NO_SHLWAPI_GDI +#define NO_SHLWAPI_STREAM +#include + /************************************************************** * ATLRegistrar implementation */ @@ -226,10 +232,10 @@ static HRESULT do_process_key(LPCOLESTR *pstr, HKEY parent_key, strbuf *buf, BOO strbuf_write(buf->str, &name, -1); }else if(key_type == DO_DELETE) { TRACE("Deleting %s\n", debugstr_w(buf->str)); - RegDeleteTreeW(parent_key, buf->str); + SHDeleteKeyW(parent_key, buf->str); }else { if(key_type == FORCE_REMOVE) - RegDeleteTreeW(parent_key, buf->str); + SHDeleteKeyW(parent_key, buf->str); lres = RegCreateKeyW(parent_key, buf->str, &hkey); if(lres != ERROR_SUCCESS) { WARN("Could not create(open) key: %08x\n", lres); diff --git a/dll/win32/atl100/CMakeLists.txt b/dll/win32/atl100/CMakeLists.txt index 710e11786fb..67dfb1db52f 100644 --- a/dll/win32/atl100/CMakeLists.txt +++ b/dll/win32/atl100/CMakeLists.txt @@ -3,9 +3,6 @@ add_definitions( -D__WINESRC__ -D_ATL_VER=_ATL_VER_100) -remove_definitions(-D_WIN32_WINNT=0x502) -add_definitions(-D_WIN32_WINNT=0x600) - include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine) spec2def(atl100.dll atl100.spec ADD_IMPORTLIB) @@ -23,6 +20,6 @@ add_library(atl100 SHARED set_module_type(atl100 win32dll) target_link_libraries(atl100 uuid wine) -add_importlibs(atl100 ole32 oleaut32 user32 gdi32 advapi32 msvcrt kernel32 ntdll) +add_importlibs(atl100 ole32 oleaut32 user32 gdi32 advapi32 shlwapi msvcrt kernel32 ntdll) add_pch(atl100 precomp.h SOURCE) add_cd_file(TARGET atl100 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/atl80/CMakeLists.txt b/dll/win32/atl80/CMakeLists.txt index c27604e573b..fe1f3a992e9 100644 --- a/dll/win32/atl80/CMakeLists.txt +++ b/dll/win32/atl80/CMakeLists.txt @@ -3,9 +3,6 @@ add_definitions( -D__WINESRC__ -D_ATL_VER=_ATL_VER_80) -remove_definitions(-D_WIN32_WINNT=0x502) -add_definitions(-D_WIN32_WINNT=0x600) - spec2def(atl80.dll atl80.spec ADD_IMPORTLIB) list(APPEND SOURCE @@ -20,6 +17,6 @@ list(APPEND SOURCE add_library(atl80 SHARED ${SOURCE}) set_module_type(atl80 win32dll) target_link_libraries(atl80 uuid wine) -add_importlibs(atl80 oleaut32 user32 ole32 gdi32 advapi32 msvcrt kernel32 ntdll) +add_importlibs(atl80 oleaut32 user32 ole32 gdi32 advapi32 shlwapi msvcrt kernel32 ntdll) add_pch(atl80 precomp.h SOURCE) add_cd_file(TARGET atl80 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/browseui/CMakeLists.txt b/dll/win32/browseui/CMakeLists.txt index b9966066e02..894ebda6413 100644 --- a/dll/win32/browseui/CMakeLists.txt +++ b/dll/win32/browseui/CMakeLists.txt @@ -58,3 +58,7 @@ add_importlibs(browseui add_pch(browseui precomp.h SOURCE) add_cd_file(TARGET browseui DESTINATION reactos/system32 FOR all) + +if(NOT MSVC) + add_target_compile_flags(browseui "-Wno-unused-but-set-variable") +endif() diff --git a/dll/win32/crypt32/CMakeLists.txt b/dll/win32/crypt32/CMakeLists.txt index a4eedfafdcb..b10d63891ab 100644 --- a/dll/win32/crypt32/CMakeLists.txt +++ b/dll/win32/crypt32/CMakeLists.txt @@ -4,9 +4,6 @@ add_definitions( -D_WINE -D_CRYPT32_) -remove_definitions(-D_WIN32_WINNT=0x502) -add_definitions(-D_WIN32_WINNT=0x600) - include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine) spec2def(crypt32.dll crypt32.spec ADD_IMPORTLIB) @@ -45,7 +42,7 @@ add_library(crypt32 SHARED set_module_type(crypt32 win32dll) target_link_libraries(crypt32 wine ${PSEH_LIB} oldnames) -add_importlibs(crypt32 user32 advapi32 msvcrt kernel32 ntdll) +add_importlibs(crypt32 user32 advapi32 shlwapi msvcrt kernel32 ntdll) add_delay_importlibs(crypt32 cryptnet) add_pch(crypt32 crypt32_private.h SOURCE) add_cd_file(TARGET crypt32 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/crypt32/regstore.c b/dll/win32/crypt32/regstore.c index f90103da8f9..364ad0d4a67 100644 --- a/dll/win32/crypt32/regstore.c +++ b/dll/win32/crypt32/regstore.c @@ -18,6 +18,8 @@ #include "crypt32_private.h" +#include + WINE_DEFAULT_DEBUG_CHANNEL(crypt); typedef struct _WINE_HASH_TO_DELETE @@ -507,12 +509,12 @@ WINECRYPT_CERTSTORE *CRYPT_RegOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags, if (dwFlags & CERT_STORE_DELETE_FLAG) { - DWORD rc = RegDeleteTreeW((HKEY)pvPara, CertsW); + DWORD rc = SHDeleteKeyW((HKEY)pvPara, CertsW); if (rc == ERROR_SUCCESS || rc == ERROR_NO_MORE_ITEMS) - rc = RegDeleteTreeW((HKEY)pvPara, CRLsW); + rc = SHDeleteKeyW((HKEY)pvPara, CRLsW); if (rc == ERROR_SUCCESS || rc == ERROR_NO_MORE_ITEMS) - rc = RegDeleteTreeW((HKEY)pvPara, CTLsW); + rc = SHDeleteKeyW((HKEY)pvPara, CTLsW); if (rc == ERROR_NO_MORE_ITEMS) rc = ERROR_SUCCESS; SetLastError(rc); diff --git a/dll/win32/kernel32/client/file/copy.c b/dll/win32/kernel32/client/file/copy.c index 9601e108267..3eb763d86a2 100644 --- a/dll/win32/kernel32/client/file/copy.c +++ b/dll/win32/kernel32/client/file/copy.c @@ -191,20 +191,16 @@ SetLastWriteTime( return errCode; } - -/* - * @implemented - */ BOOL -WINAPI -CopyFileExW ( - LPCWSTR lpExistingFileName, - LPCWSTR lpNewFileName, - LPPROGRESS_ROUTINE lpProgressRoutine, - LPVOID lpData, - BOOL *pbCancel, - DWORD dwCopyFlags -) +BasepCopyFileExW(IN LPCWSTR lpExistingFileName, + IN LPCWSTR lpNewFileName, + IN LPPROGRESS_ROUTINE lpProgressRoutine OPTIONAL, + IN LPVOID lpData OPTIONAL, + IN LPBOOL pbCancel OPTIONAL, + IN DWORD dwCopyFlags, + IN DWORD dwBasepFlags, + OUT LPHANDLE lpExistingHandle, + OUT LPHANDLE lpNewHandle) { NTSTATUS errCode; HANDLE FileHandleSource, FileHandleDest; @@ -307,6 +303,53 @@ CopyFileExW ( return RC; } +/* + * @implemented + */ +BOOL +WINAPI +CopyFileExW(IN LPCWSTR lpExistingFileName, + IN LPCWSTR lpNewFileName, + IN LPPROGRESS_ROUTINE lpProgressRoutine OPTIONAL, + IN LPVOID lpData OPTIONAL, + IN LPBOOL pbCancel OPTIONAL, + IN DWORD dwCopyFlags) +{ + BOOL Ret; + HANDLE ExistingHandle, NewHandle; + + ExistingHandle = INVALID_HANDLE_VALUE; + NewHandle = INVALID_HANDLE_VALUE; + + _SEH2_TRY + { + Ret = BasepCopyFileExW(lpExistingFileName, + lpNewFileName, + lpProgressRoutine, + lpData, + pbCancel, + dwCopyFlags, + 0, + &ExistingHandle, + &NewHandle); + } + _SEH2_FINALLY + { + if (ExistingHandle != INVALID_HANDLE_VALUE) + { + CloseHandle(ExistingHandle); + } + + if (NewHandle != INVALID_HANDLE_VALUE) + { + CloseHandle(NewHandle); + } + } + _SEH2_END; + + return Ret; +} + /* * @implemented @@ -351,18 +394,33 @@ CopyFileExA(IN LPCSTR lpExistingFileName, */ BOOL WINAPI -CopyFileA ( - LPCSTR lpExistingFileName, - LPCSTR lpNewFileName, - BOOL bFailIfExists -) +CopyFileA(IN LPCSTR lpExistingFileName, + IN LPCSTR lpNewFileName, + IN BOOL bFailIfExists) { - return CopyFileExA (lpExistingFileName, - lpNewFileName, - NULL, - NULL, - NULL, - bFailIfExists); + BOOL Result = FALSE; + UNICODE_STRING lpNewFileNameW; + PUNICODE_STRING lpExistingFileNameW; + + lpExistingFileNameW = Basep8BitStringToStaticUnicodeString(lpExistingFileName); + if (!lpExistingFileNameW) + { + return FALSE; + } + + if (Basep8BitStringToDynamicUnicodeString(&lpNewFileNameW, lpNewFileName)) + { + Result = CopyFileExW(lpExistingFileNameW->Buffer, + lpNewFileNameW.Buffer, + NULL, + NULL, + NULL, + (bFailIfExists ? COPY_FILE_FAIL_IF_EXISTS : 0)); + + RtlFreeUnicodeString(&lpNewFileNameW); + } + + return Result; } @@ -371,18 +429,16 @@ CopyFileA ( */ BOOL WINAPI -CopyFileW ( - LPCWSTR lpExistingFileName, - LPCWSTR lpNewFileName, - BOOL bFailIfExists -) +CopyFileW(IN LPCWSTR lpExistingFileName, + IN LPCWSTR lpNewFileName, + IN BOOL bFailIfExists) { - return CopyFileExW (lpExistingFileName, - lpNewFileName, - NULL, - NULL, - NULL, - bFailIfExists); + return CopyFileExW(lpExistingFileName, + lpNewFileName, + NULL, + NULL, + NULL, + (bFailIfExists ? COPY_FILE_FAIL_IF_EXISTS : 0)); } @@ -391,17 +447,53 @@ CopyFileW ( */ BOOL WINAPI -PrivCopyFileExW ( - LPCWSTR lpExistingFileName, - LPCWSTR lpNewFileName, - LPPROGRESS_ROUTINE lpProgressRoutine, - LPVOID lpData, - BOOL *pbCancel, - DWORD dwCopyFlags -) +PrivCopyFileExW(IN LPCWSTR lpExistingFileName, + IN LPCWSTR lpNewFileName, + IN LPPROGRESS_ROUTINE lpProgressRoutine, + IN LPVOID lpData, + IN LPBOOL pbCancel, + IN DWORD dwCopyFlags) { - UNIMPLEMENTED; - return FALSE; + BOOL Ret; + HANDLE ExistingHandle, NewHandle; + + ExistingHandle = INVALID_HANDLE_VALUE; + NewHandle = INVALID_HANDLE_VALUE; + + /* Check for incompatible flags */ + if (dwCopyFlags & COPY_FILE_FAIL_IF_EXISTS && dwCopyFlags & BASEP_COPY_REPLACE) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + _SEH2_TRY + { + Ret = BasepCopyFileExW(lpExistingFileName, + lpNewFileName, + lpProgressRoutine, + lpData, + pbCancel, + dwCopyFlags & BASEP_COPY_PUBLIC_MASK, + dwCopyFlags & BASEP_COPY_BASEP_MASK, + &ExistingHandle, + &NewHandle); + } + _SEH2_FINALLY + { + if (ExistingHandle != INVALID_HANDLE_VALUE) + { + CloseHandle(ExistingHandle); + } + + if (NewHandle != INVALID_HANDLE_VALUE) + { + CloseHandle(NewHandle); + } + } + _SEH2_END; + + return Ret; } /* EOF */ diff --git a/dll/win32/kernel32/client/file/fileinfo.c b/dll/win32/kernel32/client/file/fileinfo.c index 99f1f39186f..4974bd182b6 100644 --- a/dll/win32/kernel32/client/file/fileinfo.c +++ b/dll/win32/kernel32/client/file/fileinfo.c @@ -198,7 +198,9 @@ FlushFileBuffers(IN HANDLE hFile) /* * @implemented */ -DWORD WINAPI +DWORD +WINAPI +DECLSPEC_HOTPATCH SetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, diff --git a/dll/win32/kernel32/include/kernel32.h b/dll/win32/kernel32/include/kernel32.h index dad3f12904f..383a1061222 100644 --- a/dll/win32/kernel32/include/kernel32.h +++ b/dll/win32/kernel32/include/kernel32.h @@ -131,6 +131,17 @@ DWORD extern WaitForInputIdleType UserWaitForInputIdleRoutine; +/* Flags for PrivCopyFileExW && BasepCopyFileExW */ +#define BASEP_COPY_METADATA 0x10 +#define BASEP_COPY_SACL 0x20 +#define BASEP_COPY_OWNER_AND_GROUP 0x40 +#define BASEP_COPY_DIRECTORY 0x80 +#define BASEP_COPY_BACKUP_SEMANTICS 0x100 +#define BASEP_COPY_REPLACE 0x200 +#define BASEP_COPY_SKIP_DACL 0x400 +#define BASEP_COPY_PUBLIC_MASK 0xF +#define BASEP_COPY_BASEP_MASK 0xFFFFFFF0 + /* GLOBAL VARIABLES **********************************************************/ extern BOOL bIsFileApiAnsi; @@ -422,6 +433,18 @@ BaseMarkFileForDelete( IN ULONG FileAttributes ); +BOOL +BasepCopyFileExW( + IN LPCWSTR lpExistingFileName, + IN LPCWSTR lpNewFileName, + IN LPPROGRESS_ROUTINE lpProgressRoutine OPTIONAL, + IN LPVOID lpData OPTIONAL, + IN LPBOOL pbCancel OPTIONAL, + IN DWORD dwCopyFlags, + IN DWORD dwBasepFlags, + OUT LPHANDLE lpExistingHandle, + OUT LPHANDLE lpNewHandle +); /* FIXME: This is EXPORTED! It should go in an external kernel32.h header */ VOID diff --git a/dll/win32/kernel32/winnls/string/nls.c b/dll/win32/kernel32/winnls/string/nls.c index e1aba208431..02a5681309e 100644 --- a/dll/win32/kernel32/winnls/string/nls.c +++ b/dll/win32/kernel32/winnls/string/nls.c @@ -89,21 +89,22 @@ NlsInit(VOID) } /* Setup ANSI code page. */ - AnsiCodePage.CodePage = CP_ACP; AnsiCodePage.SectionHandle = NULL; AnsiCodePage.SectionMapping = NtCurrentTeb()->ProcessEnvironmentBlock->AnsiCodePageData; RtlInitCodePageTable((PUSHORT)AnsiCodePage.SectionMapping, &AnsiCodePage.CodePageTable); + AnsiCodePage.CodePage = AnsiCodePage.CodePageTable.CodePage; + InsertTailList(&CodePageListHead, &AnsiCodePage.Entry); /* Setup OEM code page. */ - OemCodePage.CodePage = CP_OEMCP; OemCodePage.SectionHandle = NULL; OemCodePage.SectionMapping = NtCurrentTeb()->ProcessEnvironmentBlock->OemCodePageData; RtlInitCodePageTable((PUSHORT)OemCodePage.SectionMapping, &OemCodePage.CodePageTable); + OemCodePage.CodePage = OemCodePage.CodePageTable.CodePage; InsertTailList(&CodePageListHead, &OemCodePage.Entry); return TRUE; @@ -199,8 +200,15 @@ IntGetCodePageEntry(UINT CodePage) WCHAR FileName[MAX_PATH + 1]; UINT FileNamePos; PCODEPAGE_ENTRY CodePageEntry; - - if (CodePage == CP_THREAD_ACP) + if (CodePage == CP_ACP) + { + return &AnsiCodePage; + } + else if (CodePage == CP_OEMCP) + { + return &OemCodePage; + } + else if (CodePage == CP_THREAD_ACP) { if (!GetLocaleInfoW(GetThreadLocale(), LOCALE_IDEFAULTANSICODEPAGE | LOCALE_RETURN_NUMBER, @@ -1816,7 +1824,7 @@ GetCPInfoExW(UINT CodePage, lpCPInfoEx->CodePage = CodePageEntry->CodePageTable.CodePage; lpCPInfoEx->UnicodeDefaultChar = CodePageEntry->CodePageTable.UniDefaultChar; - return GetLocalisedText((DWORD)CodePage, lpCPInfoEx->CodePageName); + return GetLocalisedText(CodePageEntry->CodePageTable.CodePage, lpCPInfoEx->CodePageName); } break; } diff --git a/dll/win32/localspl/CMakeLists.txt b/dll/win32/localspl/CMakeLists.txt index 17d814e6a53..92e88073716 100644 --- a/dll/win32/localspl/CMakeLists.txt +++ b/dll/win32/localspl/CMakeLists.txt @@ -1,7 +1,4 @@ -remove_definitions(-D_WIN32_WINNT=0x502) -add_definitions(-D_WIN32_WINNT=0x600) - add_definitions(-D__WINESRC__) include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine) spec2def(localspl.dll localspl.spec) @@ -20,6 +17,6 @@ add_library(localspl SHARED set_module_type(localspl win32dll) target_link_libraries(localspl wine) -add_importlibs(localspl spoolss user32 advapi32 msvcrt kernel32 ntdll) +add_importlibs(localspl spoolss user32 advapi32 shlwapi msvcrt kernel32 ntdll) add_pch(localspl localspl_private.h SOURCE) add_cd_file(TARGET localspl DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/localspl/provider.c b/dll/win32/localspl/provider.c index fb4686101e0..fbdb2e67337 100644 --- a/dll/win32/localspl/provider.c +++ b/dll/win32/localspl/provider.c @@ -20,6 +20,7 @@ #include "localspl_private.h" +#include #include /* ############################### */ @@ -1846,7 +1847,7 @@ static BOOL WINAPI fpDeleteMonitor(LPWSTR pName, LPWSTR pEnvironment, LPWSTR pMo return FALSE; } - if(RegDeleteTreeW(hroot, pMonitorName) == ERROR_SUCCESS) { + if(SHDeleteKeyW(hroot, pMonitorName) == ERROR_SUCCESS) { TRACE("%s deleted\n", debugstr_w(pMonitorName)); RegCloseKey(hroot); return TRUE; diff --git a/dll/win32/lsasrv/authpackage.c b/dll/win32/lsasrv/authpackage.c index a9f57ab76c6..f07e1fd3935 100644 --- a/dll/win32/lsasrv/authpackage.c +++ b/dll/win32/lsasrv/authpackage.c @@ -1308,23 +1308,30 @@ LsapSetPrivileges( TokenInfo1->Groups->Groups[i].Sid, ACCOUNT_VIEW, &AccountHandle); + if (!NT_SUCCESS(Status)) + continue; + + Status = LsarEnumeratePrivilegesAccount(AccountHandle, + &Privileges); if (NT_SUCCESS(Status)) { - Status = LsarEnumeratePrivilegesAccount(AccountHandle, - &Privileges); - if (NT_SUCCESS(Status)) + for (j = 0; j < Privileges->PrivilegeCount; j++) { - for (j = 0; j < Privileges->PrivilegeCount; j++) + Status = LsapAddPrivilegeToTokenPrivileges(&TokenInfo1->Privileges, + &(Privileges->Privilege[j])); + if (!NT_SUCCESS(Status)) { - Status = LsapAddPrivilegeToTokenPrivileges(&TokenInfo1->Privileges, - &(Privileges->Privilege[j])); - if (!NT_SUCCESS(Status)) - return Status; - } + /* We failed, clean everything and return */ + LsaIFree_LSAPR_PRIVILEGE_SET(Privileges); + LsarClose(&AccountHandle); + LsarClose(&PolicyHandle); - LsaIFree_LSAPR_PRIVILEGE_SET(Privileges); - Privileges = NULL; + return Status; + } } + + LsaIFree_LSAPR_PRIVILEGE_SET(Privileges); + Privileges = NULL; } LsarClose(&AccountHandle); diff --git a/dll/win32/mciseq/CMakeLists.txt b/dll/win32/mciseq/CMakeLists.txt index ee5a095d385..c9cf715b6d6 100644 --- a/dll/win32/mciseq/CMakeLists.txt +++ b/dll/win32/mciseq/CMakeLists.txt @@ -15,5 +15,5 @@ add_importlibs(mciseq winmm user32 msvcrt kernel32 ntdll) add_cd_file(TARGET mciseq DESTINATION reactos/system32 FOR all) if(NOT MSVC) - add_target_compile_flags(mciseq "-Wno-error=overflow") + add_target_compile_flags(mciseq "-Wno-overflow") endif() diff --git a/dll/win32/mciwave/mciwave.c b/dll/win32/mciwave/mciwave.c index 2c9e3b5ec55..c150e416538 100644 --- a/dll/win32/mciwave/mciwave.c +++ b/dll/win32/mciwave/mciwave.c @@ -535,7 +535,7 @@ static LRESULT WAVE_mciOpen(MCIDEVICEID wDevID, DWORD dwFlags, LPMCI_WAVE_OPEN_P wmw->nUseCount++; - wmw->wInput = wmw->wOutput = WAVE_MAPPER; + wmw->wInput = wmw->wOutput = (WORD)WAVE_MAPPER; wmw->fInput = FALSE; wmw->hWave = 0; wmw->dwStatus = MCI_MODE_NOT_READY; @@ -1371,13 +1371,13 @@ static DWORD WAVE_mciSet(MCIDEVICEID wDevID, DWORD dwFlags, LPMCI_WAVE_SET_PARMS TRACE("MCI_WAVE_SET_ANYINPUT\n"); if (wmw->wInput != (WORD)lpParms->wInput) WAVE_mciStop(wDevID, MCI_WAIT, NULL); - wmw->wInput = WAVE_MAPPER; + wmw->wInput = (WORD)WAVE_MAPPER; } if (dwFlags & MCI_WAVE_SET_ANYOUTPUT) { TRACE("MCI_WAVE_SET_ANYOUTPUT\n"); if (wmw->wOutput != (WORD)lpParms->wOutput) WAVE_mciStop(wDevID, MCI_WAIT, NULL); - wmw->wOutput = WAVE_MAPPER; + wmw->wOutput = (WORD)WAVE_MAPPER; } /* Set wave format parameters is refused after Open or Record.*/ if (dwFlags & MCI_WAVE_SET_FORMATTAG) { diff --git a/dll/win32/msctf/CMakeLists.txt b/dll/win32/msctf/CMakeLists.txt index 63be882bff0..fae9512e042 100644 --- a/dll/win32/msctf/CMakeLists.txt +++ b/dll/win32/msctf/CMakeLists.txt @@ -1,7 +1,4 @@ -remove_definitions(-D_WIN32_WINNT=0x502) -add_definitions(-D_WIN32_WINNT=0x600) - add_definitions(-D__WINESRC__) include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine) spec2def(msctf.dll msctf.spec) @@ -27,6 +24,6 @@ add_library(msctf SHARED set_module_type(msctf win32dll) target_link_libraries(msctf uuid wine) -add_importlibs(msctf ole32 oleaut32 user32 advapi32 msvcrt kernel32 ntdll) +add_importlibs(msctf ole32 oleaut32 user32 advapi32 shlwapi msvcrt kernel32 ntdll) add_pch(msctf msctf_internal.h SOURCE) add_cd_file(TARGET msctf DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/msctf/categorymgr.c b/dll/win32/msctf/categorymgr.c index 509494fd0ed..8d7241377be 100644 --- a/dll/win32/msctf/categorymgr.c +++ b/dll/win32/msctf/categorymgr.c @@ -154,9 +154,9 @@ static HRESULT WINAPI CategoryMgr_UnregisterCategory ( ITfCategoryMgr *iface, sprintfW(fullkey,fmt2,ctg,ctg,buf,buf2); sprintfW(fullkey,fmt2,ctg,itm,buf2,buf); - RegDeleteTreeW(tipkey, fullkey); + SHDeleteKeyW(tipkey, fullkey); sprintfW(fullkey,fmt2,ctg,itm,buf2,buf); - RegDeleteTreeW(tipkey, fullkey); + SHDeleteKeyW(tipkey, fullkey); RegCloseKey(tipkey); return S_OK; diff --git a/dll/win32/msctf/inputprocessor.c b/dll/win32/msctf/inputprocessor.c index 7d22540f046..f7561a959bc 100644 --- a/dll/win32/msctf/inputprocessor.c +++ b/dll/win32/msctf/inputprocessor.c @@ -227,8 +227,8 @@ static HRESULT WINAPI InputProcessorProfiles_Unregister( StringFromGUID2(rclsid, buf, 39); sprintfW(fullkey,szwTipfmt,szwSystemTIPKey,buf); - RegDeleteTreeW(HKEY_LOCAL_MACHINE, fullkey); - RegDeleteTreeW(HKEY_CURRENT_USER, fullkey); + SHDeleteKeyW(HKEY_LOCAL_MACHINE, fullkey); + SHDeleteKeyW(HKEY_CURRENT_USER, fullkey); return S_OK; } diff --git a/dll/win32/msctf/msctf_internal.h b/dll/win32/msctf/msctf_internal.h index e59765daf50..c6b26436f66 100644 --- a/dll/win32/msctf/msctf_internal.h +++ b/dll/win32/msctf/msctf_internal.h @@ -37,6 +37,7 @@ #include #include #include +#include #include #include diff --git a/dll/win32/msgina/lang/pl-PL.rc b/dll/win32/msgina/lang/pl-PL.rc index 86520561671..986522e6d97 100644 --- a/dll/win32/msgina/lang/pl-PL.rc +++ b/dll/win32/msgina/lang/pl-PL.rc @@ -162,7 +162,8 @@ BEGIN IDS_PASSWORDEXPIRED "Twoje hasło wygasło i musi zostać zmienione." END -/* Shutdown Dialog Strings */STRINGTABLE +/* Shutdown Dialog Strings */ +STRINGTABLE BEGIN IDS_SHUTDOWN_LOGOFF "Wyloguj ""%s""" IDS_SHUTDOWN_SHUTDOWN "Wyłącz" diff --git a/dll/win32/msgina/lsa.c b/dll/win32/msgina/lsa.c index 174378f0fcd..16eaf68fdd3 100644 --- a/dll/win32/msgina/lsa.c +++ b/dll/win32/msgina/lsa.c @@ -192,7 +192,7 @@ MyLogonUser( SE_GROUP_ENABLED_BY_DEFAULT; /* Set the token source */ - strcpy(TokenSource.SourceName, "LogonUser"); + strncpy(TokenSource.SourceName, "User32 ", sizeof(TokenSource.SourceName)); AllocateLocallyUniqueId(&TokenSource.SourceIdentifier); Status = LsaLogonUser(LsaHandle, diff --git a/dll/win32/msi/action.c b/dll/win32/msi/action.c index b5c2412baf6..b88d2d03e05 100644 --- a/dll/win32/msi/action.c +++ b/dll/win32/msi/action.c @@ -2989,7 +2989,7 @@ static void delete_tree( HKEY root, const WCHAR *path ) HKEY hkey; if (!(hkey = open_key( root, path, FALSE ))) return; - res = RegDeleteTreeW( hkey, NULL ); + res = SHDeleteKeyW( hkey, NULL ); if (res) TRACE("failed to delete subtree of %s (%d)\n", debugstr_w(path), res); delete_key( root, path ); RegCloseKey( hkey ); diff --git a/dll/win32/msi/classes.c b/dll/win32/msi/classes.c index eb159798132..513f6c91827 100644 --- a/dll/win32/msi/classes.c +++ b/dll/win32/msi/classes.c @@ -953,7 +953,7 @@ UINT ACTION_UnregisterClassInfo( MSIPACKAGE *package ) cls->action = INSTALLSTATE_ABSENT; - res = RegDeleteTreeW( hkey, cls->clsid ); + res = SHDeleteKeyW( hkey, cls->clsid ); if (res != ERROR_SUCCESS) WARN("Failed to delete class key %d\n", res); @@ -975,7 +975,7 @@ UINT ACTION_UnregisterClassInfo( MSIPACKAGE *package ) { strcpyW( filetype, szFileType ); strcatW( filetype, cls->clsid ); - res = RegDeleteTreeW( HKEY_CLASSES_ROOT, filetype ); + res = SHDeleteKeyW( HKEY_CLASSES_ROOT, filetype ); msi_free( filetype ); if (res != ERROR_SUCCESS) @@ -1148,7 +1148,7 @@ UINT ACTION_UnregisterProgIdInfo( MSIPACKAGE *package ) } TRACE("Unregistering progid %s\n", debugstr_w(progid->ProgID)); - res = RegDeleteTreeW( HKEY_CLASSES_ROOT, progid->ProgID ); + res = SHDeleteKeyW( HKEY_CLASSES_ROOT, progid->ProgID ); if (res != ERROR_SUCCESS) TRACE("Failed to delete progid key %d\n", res); @@ -1392,7 +1392,7 @@ UINT ACTION_UnregisterExtensionInfo( MSIPACKAGE *package ) { extension[0] = '.'; strcpyW( extension + 1, ext->Extension ); - res = RegDeleteTreeW( HKEY_CLASSES_ROOT, extension ); + res = SHDeleteKeyW( HKEY_CLASSES_ROOT, extension ); msi_free( extension ); if (res != ERROR_SUCCESS) WARN("Failed to delete extension key %d\n", res); @@ -1414,7 +1414,7 @@ UINT ACTION_UnregisterExtensionInfo( MSIPACKAGE *package ) { strcpyW( progid_shell, progid ); strcatW( progid_shell, shellW ); - res = RegDeleteTreeW( HKEY_CLASSES_ROOT, progid_shell ); + res = SHDeleteKeyW( HKEY_CLASSES_ROOT, progid_shell ); msi_free( progid_shell ); if (res != ERROR_SUCCESS) WARN("Failed to delete shell key %d\n", res); diff --git a/dll/win32/msi/registry.c b/dll/win32/msi/registry.c index afa2dfc41ec..2429fa1ee7b 100644 --- a/dll/win32/msi/registry.c +++ b/dll/win32/msi/registry.c @@ -477,7 +477,7 @@ UINT MSIREG_DeleteUninstallKey(const WCHAR *product, enum platform platform) strcpyW(keypath, szUninstall); strcatW(keypath, product); } - return RegDeleteTreeW(HKEY_LOCAL_MACHINE, keypath); + return SHDeleteKeyW(HKEY_LOCAL_MACHINE, keypath); } UINT MSIREG_OpenProductKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create) @@ -528,7 +528,7 @@ UINT MSIREG_DeleteUserProductKey(LPCWSTR szProduct) strcpyW(keypath, szUserProducts); strcatW(keypath, squished_pc); - return RegDeleteTreeW(HKEY_CURRENT_USER, keypath); + return SHDeleteKeyW(HKEY_CURRENT_USER, keypath); } UINT MSIREG_OpenUserPatchesKey(LPCWSTR szPatch, HKEY *key, BOOL create) @@ -593,7 +593,7 @@ UINT MSIREG_DeleteUserFeaturesKey(LPCWSTR szProduct) strcpyW(keypath, szUserFeatures); strcatW(keypath, squished_pc); - return RegDeleteTreeW(HKEY_CURRENT_USER, keypath); + return SHDeleteKeyW(HKEY_CURRENT_USER, keypath); } static UINT MSIREG_OpenInstallerFeaturesKey(LPCWSTR szProduct, HKEY *key, BOOL create) @@ -707,7 +707,7 @@ UINT MSIREG_DeleteUserDataComponentKey(LPCWSTR szComponent, LPCWSTR szUserSid) sprintfW(keypath, szUserDataComponents_fmt, szUserSid); if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey)) return ERROR_SUCCESS; - r = RegDeleteTreeW(hkey, comp); + r = SHDeleteKeyW(hkey, comp); RegCloseKey(hkey); return r; } @@ -788,7 +788,7 @@ UINT MSIREG_DeleteUserDataPatchKey(LPCWSTR patch, MSIINSTALLCONTEXT context) LocalFree(usersid); } if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey)) return ERROR_SUCCESS; - r = RegDeleteTreeW(hkey, squished_patch); + r = SHDeleteKeyW(hkey, squished_patch); RegCloseKey(hkey); return r; } @@ -865,7 +865,7 @@ UINT MSIREG_DeleteUserDataProductKey(LPCWSTR szProduct) LocalFree(usersid); if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey)) return ERROR_SUCCESS; - r = RegDeleteTreeW(hkey, squished_pc); + r = SHDeleteKeyW(hkey, squished_pc); RegCloseKey(hkey); return r; } @@ -881,7 +881,7 @@ UINT MSIREG_DeleteProductKey(LPCWSTR szProduct) TRACE("%s squished %s\n", debugstr_w(szProduct), debugstr_w(squished_pc)); if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, szInstaller_Products, 0, access, &hkey)) return ERROR_SUCCESS; - r = RegDeleteTreeW(hkey, squished_pc); + r = SHDeleteKeyW(hkey, squished_pc); RegCloseKey(hkey); return r; } @@ -938,7 +938,7 @@ UINT MSIREG_DeleteUserUpgradeCodesKey(LPCWSTR szUpgradeCode) strcpyW(keypath, szInstaller_UserUpgradeCodes); strcatW(keypath, squished_pc); - return RegDeleteTreeW(HKEY_CURRENT_USER, keypath); + return SHDeleteKeyW(HKEY_CURRENT_USER, keypath); } UINT MSIREG_DeleteLocalClassesProductKey(LPCWSTR szProductCode) @@ -952,7 +952,7 @@ UINT MSIREG_DeleteLocalClassesProductKey(LPCWSTR szProductCode) TRACE("%s squished %s\n", debugstr_w(szProductCode), debugstr_w(squished_pc)); if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, szInstaller_LocalClassesProducts, 0, access, &hkey)) return ERROR_SUCCESS; - r = RegDeleteTreeW(hkey, squished_pc); + r = SHDeleteKeyW(hkey, squished_pc); RegCloseKey(hkey); return r; } @@ -968,7 +968,7 @@ UINT MSIREG_DeleteLocalClassesFeaturesKey(LPCWSTR szProductCode) TRACE("%s squished %s\n", debugstr_w(szProductCode), debugstr_w(squished_pc)); if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, szInstaller_LocalClassesFeatures, 0, access, &hkey)) return ERROR_SUCCESS; - r = RegDeleteTreeW(hkey, squished_pc); + r = SHDeleteKeyW(hkey, squished_pc); RegCloseKey(hkey); return r; } @@ -999,7 +999,7 @@ UINT MSIREG_DeleteClassesUpgradeCodesKey(LPCWSTR szUpgradeCode) TRACE("%s squished %s\n", debugstr_w(szUpgradeCode), debugstr_w(squished_pc)); if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, szInstaller_ClassesUpgradeCodes, 0, access, &hkey)) return ERROR_SUCCESS; - r = RegDeleteTreeW(hkey, squished_pc); + r = SHDeleteKeyW(hkey, squished_pc); RegCloseKey(hkey); return r; } diff --git a/dll/win32/msvcrt/msvcrt.spec b/dll/win32/msvcrt/msvcrt.spec index 8587c0d9e66..ab80f4284f6 100644 --- a/dll/win32/msvcrt/msvcrt.spec +++ b/dll/win32/msvcrt/msvcrt.spec @@ -1,6 +1,5 @@ # msvcrt.dll - MS VC++ Run Time Library -@ cdecl $I10_OUTPUT() MSVCRT_I10_OUTPUT @ cdecl -i386 -norelay ??0__non_rtti_object@@QAE@ABV0@@Z(ptr) __thiscall_MSVCRT___non_rtti_object_copy_ctor @ cdecl -arch=win64 -norelay ??0__non_rtti_object@@QEAA@AEBV0@@Z(ptr) MSVCRT___non_rtti_object_copy_ctor @ cdecl -i386 -norelay ??0__non_rtti_object@@QAE@PBD@Z(ptr) __thiscall_MSVCRT___non_rtti_object_ctor @@ -95,6 +94,7 @@ @ cdecl ?unexpected@@YAXXZ() MSVCRT_unexpected @ cdecl -i386 -norelay ?what@exception@@UBEPBDXZ() __thiscall_MSVCRT_what_exception @ cdecl -arch=x86_64 -stub -norelay ?what@exception@@UEBAPEBDXZ() __thiscall_MSVCRT_what_exception +@ cdecl $I10_OUTPUT() MSVCRT_I10_OUTPUT @ cdecl -arch=i386 _CIacos() @ cdecl -arch=i386 _CIasin() @ cdecl -arch=i386 _CIatan() @@ -111,31 +111,6 @@ @ cdecl -arch=i386 _CIsqrt() @ cdecl -arch=i386 _CItan() @ cdecl -arch=i386 _CItanh() -# stub _CrtCheckMemory -# stub _CrtDbgBreak -# stub _CrtDbgReport -# stub _CrtDbgReportV -# stub _CrtDbgReportW -# stub _CrtDbgReportWV -# stub _CrtDoForAllClientObjects -# stub _CrtDumpMemoryLeaks -# stub _CrtIsMemoryBlock -# stub _CrtIsValidHeapPointer -# stub _CrtIsValidPointer -# stub _CrtMemCheckpoint -# stub _CrtMemDifference -# stub _CrtMemDumpAllObjectsSince -# stub _CrtMemDumpStatistics -# stub _CrtReportBlockType -# stub _CrtSetAllocHook -# stub _CrtSetBreakAlloc -# stub _CrtSetDbgBlockType -# stub _CrtSetDbgFlag -# stub _CrtSetDumpClient -# stub _CrtSetReportFile -# stub _CrtSetReportHook -# stub _CrtSetReportHook2 -# stub _CrtSetReportMode @ stdcall _CxxThrowException(long long) @ cdecl -i386 -norelay _EH_prolog() @ cdecl _Getdays() @@ -146,14 +121,12 @@ @ cdecl _XcptFilter(long ptr) @ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) @ cdecl __CppXcptFilter(long ptr) -# stub __CxxCallUnwindDelDtor # stub __CxxCallUnwindDtor # stub __CxxCallUnwindVecDtor @ cdecl __CxxDetectRethrow(ptr) # stub __CxxExceptionFilter @ cdecl -arch=i386,x86_64 -norelay __CxxFrameHandler(ptr ptr ptr ptr) @ cdecl -arch=i386 -norelay __CxxFrameHandler2(ptr ptr ptr ptr) __CxxFrameHandler -@ cdecl -arch=i386 -norelay __CxxFrameHandler3(ptr ptr ptr ptr) __CxxFrameHandler @ stdcall -i386 __CxxLongjmpUnwind(ptr) @ cdecl -i386 __CxxQueryExceptionSize() # stub -i386 __CxxRegisterExceptionObject @@ -178,11 +151,9 @@ @ cdecl __crtGetStringTypeW(long long wstr long ptr) @ cdecl __crtLCMapStringA(long long str long str long long long) @ cdecl __crtLCMapStringW(long long wstr long wstr long long long) -@ cdecl __daylight() __p__daylight @ cdecl __dllonexit(ptr ptr ptr) @ cdecl __doserrno() @ cdecl __fpecode() -@ cdecl __get_app_type() @ cdecl __getmainargs(ptr ptr ptr long ptr) @ extern __initenv @ cdecl __iob_func() @@ -190,31 +161,9 @@ @ cdecl __iscsym(long) @ cdecl __iscsymf(long) @ extern __lc_codepage -# @ stub __lc_collate # not in XP / 7 @ extern __lc_collate_cp MSVCRT___lc_collate_cp @ extern __lc_handle MSVCRT___lc_handle @ cdecl __lconv_init() -# stub __libm_sse2_acos -# stub __libm_sse2_acosf -# stub __libm_sse2_asin -# stub __libm_sse2_asinf -# stub __libm_sse2_atan -# stub __libm_sse2_atan2 -# stub __libm_sse2_atanf -# stub __libm_sse2_cos -# stub __libm_sse2_cosf -# stub __libm_sse2_exp -# stub __libm_sse2_expf -# stub __libm_sse2_log -# stub __libm_sse2_log10 -# stub __libm_sse2_log10f -# stub __libm_sse2_logf -# stub __libm_sse2_pow -# stub __libm_sse2_powf -# stub __libm_sse2_sin -# stub __libm_sse2_sinf -# stub __libm_sse2_tan -# stub __libm_sse2_tanf @ extern __mb_cur_max @ cdecl -arch=i386 __p___argc() @ cdecl -arch=i386 __p___argv() @@ -252,7 +201,6 @@ @ cdecl __set_app_type(long) @ extern __setlc_active @ cdecl __setusermatherr(ptr) -# stub __strncnt @ cdecl __threadhandle() kernel32.GetCurrentThread @ cdecl __threadid() kernel32.GetCurrentThreadId @ cdecl __toascii(long) @@ -261,14 +209,11 @@ @ extern __unguarded_readlc_active @ extern __wargv __wargv @ cdecl __wcserror(wstr) -@ cdecl __wcserror_s(ptr long wstr) -# stub __wcsncnt @ cdecl __wgetmainargs(ptr ptr ptr long ptr) @ extern __winitenv @ cdecl _abnormal_termination() # stub _abs64 @ cdecl _access(str long) -@ cdecl _access_s(str long) @ extern _acmdln @ stdcall -arch=i386 _adj_fdiv_m16i(long) @ stdcall -arch=i386 _adj_fdiv_m32(long) @@ -286,96 +231,52 @@ @ extern -arch=i386 _adjust_fdiv @ extern _aexit_rtn @ cdecl _aligned_free(ptr) -# stub _aligned_free_dbg @ cdecl _aligned_malloc(long long) -# stub _aligned_malloc_dbg @ cdecl _aligned_offset_malloc(long long long) -# stub _aligned_offset_malloc_dbg @ cdecl _aligned_offset_realloc(ptr long long long) -# stub _aligned_offset_realloc_dbg @ cdecl _aligned_realloc(ptr long long) -# stub _aligned_realloc_dbg @ cdecl _amsg_exit(long) @ cdecl _assert(str str long) @ cdecl _atodbl(ptr str) -# stub _atodbl_l -# @ cdecl _atof_l(str ptr) -# stub _atoflt_l @ cdecl -ret64 _atoi64(str) -# stub _atoi64_l -# stub _atoi_l -# stub _atol_l @ cdecl _atoldbl(ptr str) -# stub _atoldbl_l @ cdecl _beep(long long) @ cdecl _beginthread(ptr long ptr) @ cdecl _beginthreadex(ptr long ptr ptr long ptr) @ cdecl _c_exit() @ cdecl _cabs(long) @ cdecl _callnewh(long) -# stub _calloc_dbg @ cdecl _cexit() @ cdecl _cgets(str) -# stub _cgets_s # stub _cgetws -# stub _cgetws_s @ cdecl _chdir(str) @ cdecl _chdrive(long) @ cdecl _chgsign(double) @ cdecl -i386 -norelay _chkesp() @ cdecl _chmod(str long) @ cdecl _chsize(long long) -# stub _chsize_s -# stub _chvalidator -# stub _chvalidator_l @ cdecl _clearfp() @ cdecl _close(long) @ cdecl _commit(long) @ extern _commode @ cdecl _control87(long long) @ cdecl _controlfp(long long) -@ cdecl _controlfp_s(ptr long long) @ cdecl _copysign( double double ) @ varargs _cprintf(str) -# stub _cprintf_l -# stub _cprintf_p -# stub _cprintf_p_l -# stub _cprintf_s -# stub _cprintf_s_l @ cdecl _cputs(str) # stub _cputws @ cdecl _creat(str long) -# stub _crtAssertBusy -# stub _crtBreakAlloc -# stub _crtDbgFlag @ varargs _cscanf(str) -# @ varargs _cscanf_l(str ptr) -# @ varargs _cscanf_s(str) -# @ varargs _cscanf_s_l(str ptr) -@ cdecl _ctime32(ptr) -@ cdecl _ctime32_s(str long ptr) @ cdecl _ctime64(ptr) -@ cdecl _ctime64_s(str long ptr) @ extern _ctype @ cdecl _cwait(ptr long long) @ varargs _cwprintf(wstr) -# stub _cwprintf_l -# stub _cwprintf_p -# stub _cwprintf_p_l -# stub _cwprintf_s -# stub _cwprintf_s_l # @ varargs _cwscanf(wstr) -# @ varargs _cwscanf_l(wstr ptr) -# @ varargs _cwscanf_s(wstr) -# @ varargs _cwscanf_s_l(wstr ptr) @ extern _daylight -@ cdecl _difftime32(long long) -@ cdecl _difftime64(long long) @ extern _dstbias @ cdecl _dup(long) @ cdecl _dup2(long long) @ cdecl _ecvt(double long ptr ptr) -# stub _ecvt_s @ cdecl _endthread() @ cdecl _endthreadex(long) @ extern _environ @@ -383,7 +284,6 @@ @ cdecl _errno() @ cdecl -i386 _except_handler2(ptr ptr ptr ptr) @ cdecl -i386 _except_handler3(ptr ptr ptr ptr) -@ cdecl -i386 _except_handler4_common(ptr ptr ptr ptr ptr ptr) @ varargs _execl(str str) @ varargs _execle(str str) @ varargs _execlp(str str) @@ -394,10 +294,8 @@ @ cdecl _execvpe(str ptr ptr) @ cdecl _exit(long) @ cdecl _expand(ptr long) -# stub _expand_dbg @ cdecl _fcloseall() @ cdecl _fcvt(double long ptr ptr) -# stub _fcvt_s @ cdecl _fdopen(long str) @ cdecl _fgetchar() @ cdecl _fgetwchar() @@ -420,66 +318,22 @@ @ cdecl _fpclass(double) @ cdecl _fpieee_flt(long ptr ptr) @ cdecl _fpreset() -# stub _fprintf_l -# stub _fprintf_p -# stub _fprintf_p_l -# stub _fprintf_s_l @ cdecl _fputchar(long) @ cdecl _fputwchar(long) -# stub _free_dbg -# stub _freea -# stub _freea_s -# stub _fscanf_l -# @ varargs _fscanf_l(ptr str ptr) -# @ varargs _fscanf_s_l(ptr str ptr) -@ cdecl _fseeki64(ptr long long long) @ cdecl _fsopen(str str long) @ cdecl _fstat(long ptr) @ cdecl _fstat64(long ptr) @ cdecl _fstati64(long ptr) -@ cdecl -ret64 _ftelli64(ptr) @ cdecl _ftime(ptr) -@ cdecl _ftime32(ptr) -# stub _ftime32_s @ cdecl _ftime64(ptr) -# stub _ftime64_s @ cdecl -arch=i386 -ret64 _ftol() -@ cdecl -arch=i386 -ret64 _ftol2() _ftol -@ cdecl -arch=i386 -ret64 _ftol2_sse() _ftol #FIXME: SSE variant should be implemented -# stub _ftol2_sse_excpt @ cdecl _fullpath(ptr str long) -# stub _fullpath_dbg @ cdecl _futime(long ptr) -@ cdecl _futime32(long ptr) @ cdecl _futime64(long ptr) -# stub _fwprintf_l -# stub _fwprintf_p -# stub _fwprintf_p_l -# stub _fwprintf_s_l -# @ varargs _fwscanf_l(ptr wstr ptr) -# @ varargs _fwscanf_s_l(ptr wstr ptr) @ cdecl _gcvt(double long str) -# stub _gcvt_s -@ cdecl _get_doserrno(ptr) -# stub _get_environ -@ cdecl _get_errno(ptr) -# stub _get_fileinfo -# stub _get_fmode # @ cdecl _get_heap_handle() @ cdecl _get_osfhandle(long) -@ cdecl _get_osplatform(ptr) -# stub _get_osver -@ cdecl _get_output_format() -@ cdecl _get_pgmptr(ptr) @ cdecl _get_sbh_threshold() -# stub _get_wenviron -# stub _get_winmajor -# stub _get_winminor -# stub _get_winver -@ cdecl _get_wpgmptr(ptr) -@ cdecl _get_terminate() -@ cdecl _get_tzname(ptr str long long) -@ cdecl _get_unexpected() @ cdecl _getch() @ cdecl _getche() @ cdecl _getcwd(str long) @@ -497,10 +351,7 @@ # stub _getwche @ cdecl _getws(ptr) @ cdecl -i386 _global_unwind2(ptr) -@ cdecl _gmtime32(ptr) -@ cdecl _gmtime32_s(ptr ptr) @ cdecl _gmtime64(ptr) -@ cdecl _gmtime64_s(ptr ptr) @ cdecl _heapadd(ptr long) @ cdecl _heapchk() @ cdecl _heapmin() @@ -509,118 +360,54 @@ @ cdecl _heapwalk(ptr) @ cdecl _hypot(double double) @ cdecl _i64toa(long long ptr long) -@ cdecl _i64toa_s(long long ptr long long) @ cdecl _i64tow(long long ptr long) -@ cdecl _i64tow_s(long long ptr long long) @ cdecl _initterm(ptr ptr) -@ cdecl _initterm_e(ptr ptr) @ cdecl -arch=i386 _inp(long) MSVCRT__inp @ cdecl -arch=i386 _inpd(long) MSVCRT__inpd @ cdecl -arch=i386 _inpw(long) MSVCRT__inpw -@ cdecl _invalid_parameter(wstr wstr wstr long long) @ extern _iob -# stub _isalnum_l -# stub _isalpha_l @ cdecl _isatty(long) -# stub _iscntrl_l @ cdecl _isctype(long long) -@ cdecl _isctype_l(long long ptr) -# stub _isdigit_l -# stub _isgraph_l -# stub _isleadbyte_l -# stub _islower_l @ cdecl _ismbbalnum(long) -# stub _ismbbalnum_l @ cdecl _ismbbalpha(long) -# stub _ismbbalpha_l @ cdecl _ismbbgraph(long) -# stub _ismbbgraph_l @ cdecl _ismbbkalnum(long) -# stub _ismbbkalnum_l @ cdecl _ismbbkana(long) -# stub _ismbbkana_l @ cdecl _ismbbkprint(long) -# stub _ismbbkprint_l @ cdecl _ismbbkpunct(long) -# stub _ismbbkpunct_l @ cdecl _ismbblead(long) -# stub _ismbblead_l @ cdecl _ismbbprint(long) -# stub _ismbbprint_l @ cdecl _ismbbpunct(long) -# stub _ismbbpunct_l @ cdecl _ismbbtrail(long) -# stub _ismbbtrail_l @ cdecl _ismbcalnum(long) -# stub _ismbcalnum_l @ cdecl _ismbcalpha(long) -# stub _ismbcalpha_l @ cdecl _ismbcdigit(long) -# stub _ismbcdigit_l @ cdecl _ismbcgraph(long) -# stub _ismbcgraph_l @ cdecl _ismbchira(long) -# stub _ismbchira_l @ cdecl _ismbckata(long) -# stub _ismbckata_l @ cdecl _ismbcl0(long) -# stub _ismbcl0_l @ cdecl _ismbcl1(long) -# stub _ismbcl1_l @ cdecl _ismbcl2(long) -# stub _ismbcl2_l @ cdecl _ismbclegal(long) -# stub _ismbclegal_l @ cdecl _ismbclower(long) -# stub _ismbclower_l @ cdecl _ismbcprint(long) -# stub _ismbcprint_l @ cdecl _ismbcpunct(long) -# stub _ismbcpunct_l @ cdecl _ismbcspace(long) -# stub _ismbcspace_l @ cdecl _ismbcsymbol(long) -# stub _ismbcsymbol_l @ cdecl _ismbcupper(long) -# stub _ismbcupper_l @ cdecl _ismbslead(ptr ptr) -# stub _ismbslead_l @ cdecl _ismbstrail(ptr ptr) -# stub _ismbstrail_l @ cdecl _isnan(double) -# stub _isprint_l -# stub _isspace_l -# stub _isupper_l -# stub _iswalnum_l -# stub _iswalpha_l -# stub _iswcntrl_l -# stub _iswctype_l -# stub _iswdigit_l -# stub _iswgraph_l -# stub _iswlower_l -# stub _iswprint_l -# stub _iswpunct_l -# stub _iswspace_l -# stub _iswupper_l -# stub _iswxdigit_l -# stub _isxdigit_l @ cdecl _itoa(long ptr long) -@ cdecl _itoa_s(long ptr long long) @ cdecl _itow(long ptr long) -@ cdecl _itow_s(long ptr long long) @ cdecl _j0(double) @ cdecl _j1(double) @ cdecl _jn(long double) @ cdecl _kbhit() @ cdecl _lfind(ptr ptr ptr long ptr) -# stub _lfind_s @ cdecl _loaddll(str) @ cdecl -i386 _local_unwind2(ptr long) -@ cdecl -i386 _local_unwind4(ptr ptr long) -@ cdecl _localtime32(ptr) -@ cdecl _localtime32_s(ptr ptr) @ cdecl _localtime64(ptr) -@ cdecl _localtime64_s(ptr ptr) @ cdecl _lock(long) @ cdecl _locking(long long long) @ cdecl _logb(double) @@ -628,168 +415,74 @@ @ cdecl _lrotl(long long) @ cdecl _lrotr(long long) @ cdecl _lsearch(ptr ptr long long ptr) -# stub _lsearch_s @ cdecl _lseek(long long long) @ cdecl -ret64 _lseeki64(long double long) @ cdecl _ltoa(long ptr long) -@ cdecl _ltoa_s(long ptr long long) @ cdecl _ltow(long ptr long) -@ cdecl _ltow_s(long ptr long long) @ cdecl _makepath(ptr str str str str) -@ cdecl _makepath_s(ptr long str str str str) -# stub _malloc_dbg @ cdecl _mbbtombc(long) -# stub _mbbtombc_l @ cdecl _mbbtype(long long) @ extern _mbcasemap @ cdecl _mbccpy (str str) -# stub _mbccpy_l -# stub _mbccpy_s -# stub _mbccpy_s_l @ cdecl _mbcjistojms(long) -# stub _mbcjistojms_l @ cdecl _mbcjmstojis(long) -# stub _mbcjmstojis_l @ cdecl _mbclen(ptr) -# stub _mbclen_l @ cdecl _mbctohira(long) -# stub _mbctohira_l @ cdecl _mbctokata(long) -# stub _mbctokata_l @ cdecl _mbctolower(long) -# stub _mbctolower_l @ cdecl _mbctombb(long) -# stub _mbctombb_l @ cdecl _mbctoupper(long) -# stub _mbctoupper_l @ extern _mbctype -# stub _mblen_l @ cdecl _mbsbtype(str long) -# stub _mbsbtype_l @ cdecl _mbscat(str str) -# stub _mbscat_s -# stub _mbscat_s_l @ cdecl _mbschr(str long) -# stub _mbschr_l @ cdecl _mbscmp(str str) -# stub _mbscmp_l @ cdecl _mbscoll(str str) -# stub _mbscoll_l @ cdecl _mbscpy(ptr str) -# stub _mbscpy_s -# stub _mbscpy_s_l @ cdecl _mbscspn(str str) -# stub _mbscspn_l @ cdecl _mbsdec(ptr ptr) -# stub _mbsdec_l @ cdecl _mbsdup(str) -# stub _strdup_dbg @ cdecl _mbsicmp(str str) -# stub _mbsicmp_l @ cdecl _mbsicoll(str str) -# stub _mbsicoll_l @ cdecl _mbsinc(str) -# stub _mbsinc_l @ cdecl _mbslen(str) -# stub _mbslen_l @ cdecl _mbslwr(str) -# stub _mbslwr_l -# stub _mbslwr_s -# stub _mbslwr_s_l @ cdecl _mbsnbcat(str str long) -# stub _mbsnbcat_l -# stub _mbsnbcat_s -# stub _mbsnbcat_s_l @ cdecl _mbsnbcmp(str str long) -# stub _mbsnbcmp_l @ cdecl _mbsnbcnt(ptr long) -# stub _mbsnbcnt_l @ cdecl _mbsnbcoll(str str long) -# stub _mbsnbcoll_l @ cdecl _mbsnbcpy(ptr str long) -# stub _mbsnbcpy_l -@ cdecl _mbsnbcpy_s(ptr long str long) -# stub _mbsnbcpy_s_l @ cdecl _mbsnbicmp(str str long) -# stub _mbsnbicmp_l @ cdecl _mbsnbicoll(str str long) -# stub _mbsnbicoll_l @ cdecl _mbsnbset(str long long) -# stub _mbsnbset_l -# stub _mbsnbset_s -# stub _mbsnbset_s_l @ cdecl _mbsncat(str str long) -# stub _mbsncat_l -# stub _mbsncat_s -# stub _mbsncat_s_l @ cdecl _mbsnccnt(str long) -# stub _mbsnccnt_l @ cdecl _mbsncmp(str str long) -# stub _mbsncmp_l @ cdecl _mbsncoll(str str long) -# stub _mbsncoll_l @ cdecl _mbsncpy(str str long) -# stub _mbsncpy_l -# stub _mbsncpy_s -# stub _mbsncpy_s_l @ cdecl _mbsnextc(str) -# stub _mbsnextc_l @ cdecl _mbsnicmp(str str long) -# stub _mbsnicmp_l @ cdecl _mbsnicoll(str str long) -# stub _mbsnicoll_l @ cdecl _mbsninc(str long) -# stub _mbsninc_l -# stub _mbsnlen -# stub _mbsnlen_l @ cdecl _mbsnset(str long long) -# stub _mbsnset_l -# stub _mbsnset_s -# stub _mbsnset_s_l @ cdecl _mbspbrk(str str) -# stub _mbspbrk_l @ cdecl _mbsrchr(str long) -# stub _mbsrchr_l @ cdecl _mbsrev(str) -# stub _mbsrev_l @ cdecl _mbsset(str long) -# stub _mbsset_l -# stub _mbsset_s -# stub _mbsset_s_l @ cdecl _mbsspn(str str) -# stub _mbsspn_l @ cdecl _mbsspnp(str str) -# stub _mbsspnp_l @ cdecl _mbsstr(str str) -# stub _mbsstr_l @ cdecl _mbstok(str str) -# stub _mbstok_l -# stub _mbstok_s -# stub _mbstok_s_l -# stub _mbstowcs_l -# stub _mbstowcs_s_l @ cdecl _mbstrlen(str) -# stub _mbstrlen_l -# stub _mbstrnlen -# stub _mbstrnlen_l @ cdecl _mbsupr(str) -# stub _mbsupr_l -# stub _mbsupr_s -# stub _mbsupr_s_l -# stub _mbtowc_l @ cdecl _memccpy(ptr ptr long long) @ cdecl _memicmp(str str long) -# stub _memicmp_l @ cdecl _mkdir(str) @ cdecl _mkgmtime(ptr) -@ cdecl _mkgmtime32(ptr) @ cdecl _mkgmtime64(ptr) @ cdecl _mktemp(str) -# stub _mktemp_s -@ cdecl _mktime32(ptr) @ cdecl _mktime64(ptr) @ cdecl _msize(ptr) -# stub _msize_debug @ cdecl _nextafter(double double) @ cdecl _onexit(ptr) @ varargs _open(str long) @@ -804,20 +497,14 @@ @ extern _pgmptr @ cdecl _pipe(ptr long long) @ cdecl _popen(str str) -# stub _printf_l -# stub _printf_p -# stub _printf_p_l -# stub _printf_s_l @ cdecl _purecall() @ cdecl _putch(long) @ cdecl _putenv(str) -# stub _putenv_s @ cdecl _putw(long ptr) @ cdecl _putwch(long) @ cdecl _putws(wstr) # extern _pwctype @ cdecl _read(long ptr long) -# stub _realloc_dbg @ cdecl _resetstkoflw() @ cdecl _rmdir(str) @ cdecl _rmtmp() @@ -830,26 +517,12 @@ @ cdecl -arch=i386 _safe_fprem() @ cdecl -arch=i386 _safe_fprem1() @ cdecl _scalb(double long) -# @ varargs _scanf_l(str ptr) -# @ varargs _scanf_s_l(str ptr) # stub _scprintf -# stub _scprintf_l -# stub _scprintf_p_l # stub _scwprintf -# stub _scwprintf_l -# stub _scwprintf_p_l @ cdecl _searchenv(str str ptr) -@ cdecl _searchenv_s(str str ptr long) -@ stdcall -i386 _seh_longjmp_unwind4(ptr) @ stdcall -i386 _seh_longjmp_unwind(ptr) # stub _set_SSE2_enable -# stub _set_controlfp -@ cdecl _set_doserrno(long) -@ cdecl _set_errno(long) @ cdecl _set_error_mode(long) -# stub _set_fileinfo -# stub _set_fmode -# stub _set_output_format @ cdecl _set_sbh_threshold(long) @ cdecl _seterrormode(long) @ cdecl -arch=i386,x86_64 -norelay _setjmp(ptr) @@ -861,25 +534,10 @@ @ cdecl _setsystime(ptr long) @ cdecl _sleep(long) @ varargs _snprintf(ptr long str) -# stub _snprintf_c -# stub _snprintf_c_l -# stub _snprintf_l -@ varargs _snprintf_s(ptr long long ptr) -# stub _snprintf_s_l # stub _snscanf -# stub _snscanf_l -# stub _snscanf_s -# stub _snscanf_s_l @ varargs _snwprintf(ptr long wstr) -# stub _snwprintf_l -@ varargs _snwprintf_s(ptr long long ptr) -# stub _snwprintf_s_l # stub _snwscanf -# stub _snwscanf_l -# stub _snwscanf_s -# stub _snwscanf_s_l @ varargs _sopen(str long long) -@ cdecl _sopen_s(ptr str long long long) @ varargs _spawnl(long str str) @ varargs _spawnle(long str str) @ varargs _spawnlp(long str str) @@ -889,208 +547,77 @@ @ cdecl _spawnvp(long str ptr) @ cdecl _spawnvpe(long str ptr ptr) @ cdecl _splitpath(str ptr ptr ptr ptr) -@ cdecl _splitpath_s(str ptr long ptr long ptr long ptr long) -# stub _sprintf_l -# stub _sprintf_p_l -# stub _sprintf_s_l -# @ varargs _sscanf_l(str str ptr) -# @ varargs _sscanf_s_l(str str ptr) @ cdecl _stat(str ptr) @ cdecl _stat64(str ptr) @ cdecl _stati64(str ptr) @ cdecl _statusfp() @ cdecl _strcmpi(str str) -# stub _strcoll_l @ cdecl _strdate(ptr) -# stub _strdate_s @ cdecl _strdup(str) -# stub _strdup_dbg @ cdecl _strerror(long) -# stub _strerror_s @ cdecl _stricmp(str str) -# stub _stricmp_l @ cdecl _stricoll(str str) -# stub _stricoll_l @ cdecl _strlwr(str) -# stub _strlwr_l -# stub _strlwr_s -# stub _strlwr_s_l @ cdecl _strncoll(str str long) -# stub _strncoll_l @ cdecl _strnicmp(str str long) -# stub _strnicmp_l @ cdecl _strnicoll(str str long) -# stub _strnicoll_l @ cdecl _strnset(str long long) -# stub _strnset_s @ cdecl _strrev(str) @ cdecl _strset(str long) -# stub _strset_s @ cdecl _strtime(ptr) -# stub _strtime_s -# @ cdecl _strtod_l(str ptr ptr) @ cdecl _strtoi64(str ptr long) -# @ cdecl _strtoi64_l(str ptr long ptr) -# stub _strtol_l @ cdecl _strtoui64(str ptr long) strtoull -# @ cdecl _strtoui64_l(str ptr long ptr) -# stub _strtoul_l @ cdecl _strupr(str) -# stub _strupr_l -# stub _strupr_s -# stub _strupr_s_l -# stub _strxfrm_l @ cdecl _swab(str str long) -@ varargs _swprintf(ptr str) swprintf -# stub _swprintf_c -# stub _swprintf_c_l -# stub _swprintf_p_l -# stub _swprintf_s_l -# @ varargs _swscanf_l(wstr wstr ptr) -# @ varargs _swscanf_s_l(wstr wstr ptr) @ extern _sys_errlist @ extern _sys_nerr @ cdecl _tell(long) @ cdecl -ret64 _telli64(long) @ cdecl _tempnam(str str) -# stub _tempnam_dbg -@ cdecl _time32(ptr) @ cdecl _time64(ptr) @ extern _timezone @ cdecl _tolower(long) -# stub _tolower_l @ cdecl _toupper(long) -# stub _toupper_l -# stub _towlower_l -# stub _towupper_l @ extern _tzname @ cdecl _tzset() @ cdecl _ui64toa(long long ptr long) -@ cdecl _ui64toa_s(long long ptr long long) @ cdecl _ui64tow(long long ptr long) -@ cdecl _ui64tow_s(long long ptr long long) @ cdecl _ultoa(long ptr long) -# stub _ultoa_s @ cdecl _ultow(long ptr long) -# stub _ultow_s @ cdecl _umask(long) -# stub _umask_s @ cdecl _ungetch(long) # stub _ungetwch @ cdecl _unlink(str) @ cdecl _unloaddll(long) @ cdecl _unlock(long) -@ cdecl _utime32(str ptr) -@ cdecl _utime64(str ptr) -# stub _vcprintf -# stub _vcprintf_l -# stub _vcprintf_p -# stub _vcprintf_p_l -# stub _vcprintf_s -# stub _vcprintf_s_l -@ cdecl _vcwprintf(wstr ptr) -# stub _vcwprintf_l -# stub _vcwprintf_p -# stub _vcwprintf_p_l -# stub _vcwprintf_s -# stub _vcwprintf_s_l -# stub _vfprintf_l -# stub _vfprintf_p -# stub _vfprintf_p_l -# stub _vfprintf_s_l -# stub _vfwprintf_l -# stub _vfwprintf_p -# stub _vfwprintf_p_l -# stub _vfwprintf_s_l -# stub _vprintf_l -# stub _vprintf_p -# stub _vprintf_p_l -# stub _vprintf_s_l @ cdecl _utime(str ptr) +@ cdecl _utime64(str ptr) @ cdecl _vscprintf(str ptr) -# stub _vscprintf_l -# stub _vscprintf_p_l @ cdecl _vscwprintf(wstr ptr) -# stub _vscwprintf_l -# stub _vscwprintf_p_l @ cdecl _vsnprintf(ptr long str ptr) -@ cdecl _vsnprintf_c(ptr long str ptr) _vsnprintf -# @ cdecl _vsnprintf_c_l(ptr long str ptr ptr) _vsnprintf_l -# @ cdecl _vsnprintf_l(ptr long str ptr ptr) -@ cdecl _vsnprintf_s(ptr long long str ptr) -# @ cdecl _vsnprintf_s_l(ptr long long str ptr ptr) @ cdecl _vsnwprintf(ptr long wstr ptr) -# @ cdecl _vsnwprintf_l(ptr long wstr ptr ptr) -@ cdecl _vsnwprintf_s(ptr long long wstr ptr) -# @ cdecl _vsnwprintf_s_l(ptr long long wstr ptr ptr) -# stub _vsprintf_l -@ cdecl _vsprintf_p(ptr long str ptr) -# stub _vsprintf_p_l -# stub _vsprintf_s_l -# @ cdecl _vswprintf(ptr wstr ptr) -@ cdecl _vswprintf_c(ptr long wstr ptr) _vsnwprintf -# @ cdecl _vswprintf_c_l(ptr long wstr ptr ptr) _vsnwprintf_l -# @ cdecl _vswprintf_l(ptr wstr ptr ptr) -# @ cdecl _vswprintf_p_l(ptr long wstr ptr ptr) _vsnwprintf_l -# @ cdecl _vswprintf_s_l(ptr long wstr ptr ptr) -# stub _vwprintf_l -# stub _vwprintf_p -# stub _vwprintf_p_l -# stub _vwprintf_s_l @ cdecl _waccess(wstr long) -@ cdecl _waccess_s(wstr long) @ cdecl _wasctime(ptr) -# stub _wasctime_s -# stub _wassert @ cdecl _wchdir(wstr) @ cdecl _wchmod(wstr long) @ extern _wcmdln @ cdecl _wcreat(wstr long) -# stub _wcscoll_l @ cdecl _wcsdup(wstr) -# stub _wcsdup_dbg @ cdecl _wcserror(long) -@ cdecl _wcserror_s(ptr long long) -# stub _wcsftime_l @ cdecl _wcsicmp(wstr wstr) -# stub _wcsicmp_l @ cdecl _wcsicoll(wstr wstr) -# stub _wcsicoll_l @ cdecl _wcslwr(wstr) -# stub _wcslwr_l -@ cdecl _wcslwr_s(wstr long) -# stub _wcslwr_s_l @ cdecl _wcsncoll(wstr wstr long) -# stub _wcsncoll_l @ cdecl _wcsnicmp(wstr wstr long) -# stub _wcsnicmp_l @ cdecl _wcsnicoll(wstr wstr long) -# stub _wcsnicoll_l @ cdecl _wcsnset(wstr long long) -# stub _wcsnset_s @ cdecl _wcsrev(wstr) @ cdecl _wcsset(wstr long) -# stub _wcsset_s @ cdecl _wcstoi64(wstr ptr long) -# @ cdecl _wcstoi64_l(wstr ptr long ptr) -# stub _wcstol_l -@ cdecl _wcstombs_l(ptr ptr long ptr) -# @ cdecl _wcstombs_s_l(ptr ptr long wstr long ptr) @ cdecl _wcstoui64(wstr ptr long) -# @ cdecl _wcstoui64_l(wstr ptr long ptr) -# stub _wcstoul_l @ cdecl _wcsupr(wstr) -# stub _wcsupr_l -@ cdecl _wcsupr_s(wstr long) -# stub _wcsupr_s_l -# stub _wcsxfrm_l @ cdecl _wctime(ptr) -@ cdecl _wctime32(ptr) -# stub _wctime32_s @ cdecl _wctime64(ptr) -# stub _wctime64_s -# stub _wctomb_l -# stub _wctomb_s_l # stub _wctype @ extern _wenviron @ varargs _wexecl(wstr wstr) @@ -1109,47 +636,30 @@ # stub _wfindnext64 @ cdecl _wfindnexti64(long ptr) @ cdecl _wfopen(wstr wstr) -@ cdecl _wfopen_s(ptr wstr wstr) @ cdecl _wfreopen(wstr wstr ptr) -# stub _wfreopen_s @ cdecl _wfsopen(wstr wstr long) @ cdecl _wfullpath(ptr wstr long) -# stub _wfullpath_dbg @ cdecl _wgetcwd(wstr long) @ cdecl _wgetdcwd(long wstr long) @ cdecl _wgetenv(wstr) -# stub _wgetenv_s @ extern _winmajor @ extern _winminor -# stub _winput_s @ extern _winver @ cdecl _wmakepath(ptr wstr wstr wstr wstr) -@ cdecl _wmakepath_s(ptr long wstr wstr wstr wstr) @ cdecl _wmkdir(wstr) @ cdecl _wmktemp(wstr) -# stub _wmktemp_s @ varargs _wopen(wstr long) -# stub _woutput_s @ cdecl _wperror(wstr) @ extern _wpgmptr @ cdecl _wpopen(wstr wstr) -# stub _wprintf_l -# stub _wprintf_p -# stub _wprintf_p_l -# stub _wprintf_s_l @ cdecl _wputenv(wstr) -# stub _wputenv_s @ cdecl _wremove(wstr) @ cdecl _wrename(wstr wstr) @ cdecl _write(long ptr long) @ cdecl _wrmdir(wstr) -# @ varargs _wscanf_l(wstr ptr) -# @ varargs _wscanf_s_l(wstr ptr) @ cdecl _wsearchenv(wstr wstr ptr) -# stub _wsearchenv_s @ cdecl _wsetlocale(long wstr) @ varargs _wsopen(wstr long long) -@ cdecl _wsopen_s(ptr wstr long long long) @ varargs _wspawnl(long wstr wstr) @ varargs _wspawnle(long wstr wstr) @ varargs _wspawnlp(long wstr wstr) @@ -1159,30 +669,20 @@ @ cdecl _wspawnvp(long wstr ptr) @ cdecl _wspawnvpe(long wstr ptr ptr) @ cdecl _wsplitpath(wstr ptr ptr ptr ptr) -@ cdecl _wsplitpath_s(wstr ptr long ptr long ptr long ptr long) @ cdecl _wstat(wstr ptr) -@ cdecl _wstati64(wstr ptr) @ cdecl _wstat64(wstr ptr) +@ cdecl _wstati64(wstr ptr) @ cdecl _wstrdate(ptr) -# stub _wstrdate_s @ cdecl _wstrtime(ptr) -# stub _wstrtime_s @ cdecl _wsystem(wstr) @ cdecl _wtempnam(wstr wstr) -# stub _wtempnam_dbg @ cdecl _wtmpnam(ptr) -# stub _wtmpnam_s # @ cdecl _wtof(wstr) -# @ cdecl _wtof_l(wstr ptr) @ cdecl _wtoi(wstr) @ cdecl _wtoi64(wstr) -# stub _wtoi64_l -# stub _wtoi_l @ cdecl _wtol(wstr) -# stub _wtol_l @ cdecl _wunlink(wstr) @ cdecl _wutime(wstr ptr) -@ cdecl _wutime32(wstr ptr) @ cdecl _wutime64(wstr ptr) @ cdecl _y0(double) @ cdecl _y1(double) @@ -1191,7 +691,6 @@ @ cdecl abs(long) @ cdecl acos(double) @ cdecl asctime(ptr) -# stub asctime_s @ cdecl asin(double) @ cdecl atan(double) @ cdecl atan2(double double) @@ -1200,13 +699,10 @@ @ cdecl atoi(str) @ cdecl atol(str) @ cdecl bsearch(ptr ptr long long ptr) -# stub bsearch_s -# @ cdecl btowc(long) @ cdecl calloc(long long) @ cdecl ceil(double) @ cdecl -arch=x86_64 ceilf(double) @ cdecl clearerr(ptr) -# stub clearerr_s @ cdecl clock() @ cdecl cos(double) @ cdecl -arch=x86_64 cosf(double) @@ -1231,9 +727,7 @@ @ cdecl fmod(double double) @ cdecl -arch=x86_64 fmodf(long) @ cdecl fopen(str str) -@ cdecl fopen_s(ptr str str) @ varargs fprintf(ptr str) -@ varargs fprintf_s(ptr str) @ cdecl fputc(long ptr) @ cdecl fputs(str ptr) @ cdecl fputwc(long ptr) @@ -1241,22 +735,17 @@ @ cdecl fread(ptr long long ptr) @ cdecl free(ptr) @ cdecl freopen(str str ptr) -# stub freopen_s @ cdecl frexp(double ptr) @ varargs fscanf(ptr str) -# @ varargs fscanf_s(ptr str) @ cdecl fseek(ptr long long) @ cdecl fsetpos(ptr ptr) @ cdecl ftell(ptr) @ varargs fwprintf(ptr wstr) -@ varargs fwprintf_s(ptr wstr) @ cdecl fwrite(ptr long long ptr) @ varargs fwscanf(ptr wstr) -# @ varargs fwscanf_s(ptr wstr) @ cdecl getc(ptr) @ cdecl getchar() @ cdecl getenv(str) -# stub getenv_s @ cdecl gets(str) @ cdecl getwc(ptr) @ cdecl getwchar() @@ -1298,20 +787,12 @@ @ cdecl -i386 longjmp(ptr long) @ cdecl malloc(long) @ cdecl mblen(ptr long) -@ cdecl mbrlen(ptr long ptr) -# stub mbrtowc -# stub mbsdup_dbg -# stub mbsrtowcs -# stub mbsrtowcs_s @ cdecl mbstowcs(ptr str long) -@ cdecl mbstowcs_s(ptr ptr long str long) @ cdecl mbtowc(wstr str long) @ cdecl memchr(ptr long long) @ cdecl memcmp(ptr ptr long) @ cdecl memcpy(ptr ptr long) -@ cdecl memcpy_s(ptr long ptr long) memmove_s @ cdecl memmove(ptr ptr long) -@ cdecl memmove_s(ptr long ptr long) @ cdecl memset(ptr long long) @ cdecl mktime(ptr) @ cdecl modf(double ptr) @@ -1319,23 +800,19 @@ @ cdecl pow(double double) @ cdecl -arch=x86_64 powf(long) @ varargs printf(str) -@ varargs printf_s(str) @ cdecl putc(long ptr) @ cdecl putchar(long) @ cdecl puts(str) @ cdecl putwc(long ptr) fputwc @ cdecl putwchar(long) _fputwchar @ cdecl qsort(ptr long long ptr) -# stub qsort_s @ cdecl raise(long) @ cdecl rand() -@ cdecl rand_s(ptr) @ cdecl realloc(ptr long) @ cdecl remove(str) @ cdecl rename(str str) @ cdecl rewind(ptr) @ varargs scanf(str) -# @ varargs scanf_s(str) @ cdecl setbuf(ptr ptr) @ cdecl -arch=x86_64 -norelay -private setjmp(ptr ptr) _setjmp @ cdecl setlocale(long str) @@ -1345,112 +822,75 @@ @ cdecl -arch=x86_64 sinf(long) @ cdecl sinh(double) @ varargs sprintf(ptr str) -@ varargs sprintf_s(ptr long str) @ cdecl sqrt(double) @ cdecl -arch=x86_64 sqrtf(long) @ cdecl srand(long) @ varargs sscanf(str str) -# @ varargs sscanf_s(str str) @ cdecl strcat(str str) -@ cdecl strcat_s(str long str) @ cdecl strchr(str long) @ cdecl strcmp(str str) @ cdecl strcoll(str str) @ cdecl strcpy(ptr str) -@ cdecl strcpy_s(ptr long str) @ cdecl strcspn(str str) @ cdecl strerror(long) -@ cdecl strerror_s(ptr long long) @ cdecl strftime(str long str ptr) @ cdecl strlen(str) @ cdecl strncat(str str long) -# stub strncat_s @ cdecl strncmp(str str long) @ cdecl strncpy(ptr str long) -@ cdecl strncpy_s(ptr long str long) -@ cdecl strnlen(str long) @ cdecl strpbrk(str str) @ cdecl strrchr(str long) @ cdecl strspn(str str) @ cdecl strstr(str str) @ cdecl strtod(str ptr) @ cdecl strtok(str str) -@ cdecl strtok_s(ptr str ptr) @ cdecl strtol(str ptr long) @ cdecl strtoul(str ptr long) @ cdecl strxfrm(ptr str long) @ varargs swprintf(ptr wstr) -@ varargs swprintf_s(ptr long wstr) @ varargs swscanf(wstr wstr) -# @ varargs swscanf_s(wstr wstr) @ cdecl system(str) @ cdecl tan(double) @ cdecl tanh(double) @ cdecl time(ptr) @ cdecl tmpfile() -# stub tmpfile_s @ cdecl tmpnam(ptr) -# stub tmpnam_s @ cdecl tolower(long) @ cdecl toupper(long) @ cdecl towlower(long) @ cdecl towupper(long) @ cdecl ungetc(long ptr) @ cdecl ungetwc(long ptr) -# stub utime @ cdecl vfprintf(ptr str ptr) -@ cdecl vfprintf_s(ptr str ptr) @ cdecl vfwprintf(ptr wstr ptr) -@ cdecl vfwprintf_s(ptr wstr ptr) @ cdecl vprintf(str ptr) -@ cdecl vprintf_s(str ptr) -# stub vsnprintf @ cdecl vsprintf(ptr str ptr) -@ cdecl vsprintf_s(ptr long str ptr) @ cdecl vswprintf(ptr wstr ptr) -@ cdecl vswprintf_s(ptr long wstr ptr) @ cdecl vwprintf(wstr ptr) -@ cdecl vwprintf_s(wstr ptr) -# stub wcrtomb -# stub wcrtomb_s @ cdecl wcscat(wstr wstr) -@ cdecl wcscat_s(wstr long wstr) @ cdecl wcschr(wstr long) @ cdecl wcscmp(wstr wstr) @ cdecl wcscoll(wstr wstr) @ cdecl wcscpy(ptr wstr) -@ cdecl wcscpy_s(ptr long wstr) @ cdecl wcscspn(wstr wstr) @ cdecl wcsftime(ptr long wstr ptr) @ cdecl wcslen(wstr) @ cdecl wcsncat(wstr wstr long) -@ cdecl wcsncat_s(wstr long wstr long) @ cdecl wcsncmp(wstr wstr long) @ cdecl wcsncpy(ptr wstr long) -@ cdecl wcsncpy_s(ptr long wstr long) -@ cdecl wcsnlen(wstr long) @ cdecl wcspbrk(wstr wstr) @ cdecl wcsrchr(wstr long) -# stub wcsrtombs -# stub wcsrtombs_s @ cdecl wcsspn(wstr wstr) @ cdecl wcsstr(wstr wstr) @ cdecl wcstod(wstr ptr) @ cdecl wcstok(wstr wstr) -@ cdecl wcstok_s(ptr wstr ptr) @ cdecl wcstol(wstr ptr long) @ cdecl wcstombs(ptr ptr long) -@ cdecl wcstombs_s(ptr ptr long wstr long) @ cdecl wcstoul(wstr ptr long) @ cdecl wcsxfrm(ptr wstr long) -# stub wctob @ cdecl wctomb(ptr long) -# stub wctomb_s @ varargs wprintf(wstr) -@ varargs wprintf_s(wstr) @ varargs wscanf(wstr) -# @ varargs wscanf_s(wstr) # Functions not exported in native dll: -@ cdecl _get_invalid_parameter_handler() -@ cdecl _set_invalid_parameter_handler(ptr) +@ cdecl -arch=i386 -norelay __CxxFrameHandler3(ptr ptr ptr ptr) __CxxFrameHandler diff --git a/dll/win32/newdev/newdev.c b/dll/win32/newdev/newdev.c index 72f5bccaac8..16891769fb9 100644 --- a/dll/win32/newdev/newdev.c +++ b/dll/win32/newdev/newdev.c @@ -810,8 +810,9 @@ cleanup: BOOL WINAPI ClientSideInstallW( IN HWND hWndOwner, - IN DWORD dwUnknownFlags, - IN LPWSTR lpNamedPipeName) + IN HINSTANCE hInstance, + IN LPWSTR lpNamedPipeName, + IN INT Show) { BOOL ReturnValue = FALSE; BOOL ShowWizard; diff --git a/dll/win32/newdev/newdev.spec b/dll/win32/newdev/newdev.spec index 204f9a087b1..3dd235755b9 100644 --- a/dll/win32/newdev/newdev.spec +++ b/dll/win32/newdev/newdev.spec @@ -1,4 +1,4 @@ -@ stdcall ClientSideInstallW(ptr long wstr) +@ stdcall ClientSideInstallW(ptr ptr wstr long) @ stdcall DevInstallW(ptr ptr wstr long) @ stub InstallDevInst @ stub InstallDevInstEx diff --git a/dll/win32/newdev/wizard.c b/dll/win32/newdev/wizard.c index 12be7e0dedc..d94d49cd647 100644 --- a/dll/win32/newdev/wizard.c +++ b/dll/win32/newdev/wizard.c @@ -1255,49 +1255,49 @@ DisplayWizard( psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER; psp.hInstance = hDllInstance; psp.lParam = (LPARAM)DevInstData; - psp.pfnDlgProc = (DLGPROC) WelcomeDlgProc; + psp.pfnDlgProc = WelcomeDlgProc; psp.pszTemplate = MAKEINTRESOURCE(IDD_WELCOMEPAGE); ahpsp[IDD_WELCOMEPAGE] = CreatePropertySheetPage(&psp); /* Create the Select Source page */ psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE; - psp.pfnDlgProc = (DLGPROC) CHSourceDlgProc; + psp.pfnDlgProc = CHSourceDlgProc; psp.pszTemplate = MAKEINTRESOURCE(IDD_CHSOURCE); ahpsp[IDD_CHSOURCE] = CreatePropertySheetPage(&psp); /* Create the Search driver page */ psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE; - psp.pfnDlgProc = (DLGPROC) SearchDrvDlgProc; + psp.pfnDlgProc = SearchDrvDlgProc; psp.pszTemplate = MAKEINTRESOURCE(IDD_SEARCHDRV); ahpsp[IDD_SEARCHDRV] = CreatePropertySheetPage(&psp); /* Create the Install driver page */ psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE; - psp.pfnDlgProc = (DLGPROC) InstallDrvDlgProc; + psp.pfnDlgProc = InstallDrvDlgProc; psp.pszTemplate = MAKEINTRESOURCE(IDD_INSTALLDRV); ahpsp[IDD_INSTALLDRV] = CreatePropertySheetPage(&psp); /* Create the No driver page */ psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER; - psp.pfnDlgProc = (DLGPROC) NoDriverDlgProc; + psp.pfnDlgProc = NoDriverDlgProc; psp.pszTemplate = MAKEINTRESOURCE(IDD_NODRIVER); ahpsp[IDD_NODRIVER] = CreatePropertySheetPage(&psp); /* Create the Install failed page */ psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER; - psp.pfnDlgProc = (DLGPROC) InstallFailedDlgProc; + psp.pfnDlgProc = InstallFailedDlgProc; psp.pszTemplate = MAKEINTRESOURCE(IDD_INSTALLFAILED); ahpsp[IDD_INSTALLFAILED] = CreatePropertySheetPage(&psp); /* Create the Need reboot page */ psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER; - psp.pfnDlgProc = (DLGPROC) NeedRebootDlgProc; + psp.pfnDlgProc = NeedRebootDlgProc; psp.pszTemplate = MAKEINTRESOURCE(IDD_NEEDREBOOT); ahpsp[IDD_NEEDREBOOT] = CreatePropertySheetPage(&psp); /* Create the Finish page */ psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER; - psp.pfnDlgProc = (DLGPROC) FinishDlgProc; + psp.pfnDlgProc = FinishDlgProc; psp.pszTemplate = MAKEINTRESOURCE(IDD_FINISHPAGE); ahpsp[IDD_FINISHPAGE] = CreatePropertySheetPage(&psp); diff --git a/dll/win32/ntmarta/CMakeLists.txt b/dll/win32/ntmarta/CMakeLists.txt index 1cfea80cb4b..1890871ab5d 100644 --- a/dll/win32/ntmarta/CMakeLists.txt +++ b/dll/win32/ntmarta/CMakeLists.txt @@ -1,10 +1,6 @@ - add_definitions(-D__WINESRC__) -remove_definitions(-D_WIN32_WINNT=0x502) -add_definitions(-D_WIN32_WINNT=0x600) - spec2def(ntmarta.dll ntmarta.spec) list(APPEND SOURCE diff --git a/dll/win32/ntmarta/ntmarta.c b/dll/win32/ntmarta/ntmarta.c index fa164250039..5549949a63e 100644 --- a/dll/win32/ntmarta/ntmarta.c +++ b/dll/win32/ntmarta/ntmarta.c @@ -25,6 +25,7 @@ * UPDATE HISTORY: * 07/26/2005 Created */ + #include "ntmarta.h" #define NDEBUG @@ -32,6 +33,42 @@ HINSTANCE hDllInstance; +/* FIXME: Vista+ API */ +VOID +WINAPI +SetSecurityAccessMask(IN SECURITY_INFORMATION SecurityInformation, + OUT LPDWORD DesiredAccess) +{ + *DesiredAccess = 0; + + if (SecurityInformation & (OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION)) + *DesiredAccess |= WRITE_OWNER; + + if (SecurityInformation & DACL_SECURITY_INFORMATION) + *DesiredAccess |= WRITE_DAC; + + if (SecurityInformation & SACL_SECURITY_INFORMATION) + *DesiredAccess |= ACCESS_SYSTEM_SECURITY; +} + +/* FIXME: Vista+ API */ +VOID +WINAPI +QuerySecurityAccessMask(IN SECURITY_INFORMATION SecurityInformation, + OUT LPDWORD DesiredAccess) +{ + *DesiredAccess = 0; + + if (SecurityInformation & (OWNER_SECURITY_INFORMATION | + GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION)) + { + *DesiredAccess |= READ_CONTROL; + } + + if (SecurityInformation & SACL_SECURITY_INFORMATION) + *DesiredAccess |= ACCESS_SYSTEM_SECURITY; +} + static ACCESS_MODE AccpGetAceAccessMode(IN PACE_HEADER AceHeader) { diff --git a/dll/win32/ole32/ole32.spec b/dll/win32/ole32/ole32.spec index a12c2c4a19f..ce554435edb 100644 --- a/dll/win32/ole32/ole32.spec +++ b/dll/win32/ole32/ole32.spec @@ -1,51 +1,72 @@ +# CoVrfCheckThreadState +# CoVrfGetThreadState +# CoVrfReleaseThreadState +# PropVariantChangeType @ stdcall BindMoniker(ptr long ptr ptr) @ stdcall CLIPFORMAT_UserFree(ptr ptr) @ stdcall CLIPFORMAT_UserMarshal(ptr ptr ptr) @ stdcall CLIPFORMAT_UserSize(ptr long ptr) @ stdcall CLIPFORMAT_UserUnmarshal(ptr ptr ptr) +# CLSIDFromOle1Class @ stdcall CLSIDFromProgID(wstr ptr) @ stdcall CLSIDFromProgIDEx(wstr ptr) @ stdcall CLSIDFromString(wstr ptr) @ stdcall CoAddRefServerProcess() @ stdcall CoAllowSetForegroundWindow(ptr ptr) @ stdcall CoBuildVersion() +# CoCancelCall @ stdcall CoCopyProxy(ptr ptr) @ stdcall CoCreateFreeThreadedMarshaler(ptr ptr) @ stdcall CoCreateGuid(ptr) @ stdcall CoCreateInstance(ptr ptr long ptr ptr) @ stdcall CoCreateInstanceEx(ptr ptr long ptr long ptr) +# CoCreateObjectInContext +# CoDeactivateObject +# CoDisableCallCancellation @ stdcall CoDisconnectObject(ptr long) @ stdcall CoDosDateTimeToFileTime(long long ptr) kernel32.DosDateTimeToFileTime +# CoEnableCallCancellation @ stdcall CoFileTimeNow(ptr) @ stdcall CoFileTimeToDosDateTime(ptr ptr ptr) kernel32.FileTimeToDosDateTime @ stdcall CoFreeAllLibraries() @ stdcall CoFreeLibrary(long) @ stdcall CoFreeUnusedLibraries() @ stdcall CoFreeUnusedLibrariesEx(long long) +# CoGetApartmentID @ stdcall CoGetCallContext(ptr ptr) @ stdcall CoGetCallerTID(ptr) +# CoGetCancelObject @ stdcall CoGetClassObject(ptr long ptr ptr ptr) +# CoGetClassVersion +# CoGetComCatalog @ stdcall CoGetContextToken(ptr) @ stdcall CoGetCurrentLogicalThreadId(ptr) @ stdcall CoGetCurrentProcess() @ stdcall CoGetDefaultContext(long ptr ptr) @ stdcall CoGetInstanceFromFile(ptr ptr ptr long long wstr long ptr) @ stdcall CoGetInstanceFromIStorage(ptr ptr ptr long ptr long ptr) +# CoGetInterceptor +# CoGetInterceptorFromTypeInfo @ stdcall CoGetInterfaceAndReleaseStream(ptr ptr ptr) @ stdcall CoGetMalloc(long ptr) @ stdcall CoGetMarshalSizeMax(ptr ptr ptr long ptr long) +# CoGetModuleType @ stdcall CoGetObject(wstr ptr ptr ptr) @ stdcall CoGetObjectContext(ptr ptr) @ stdcall CoGetPSClsid(ptr ptr) +# CoGetProcessIdentifier @ stdcall CoGetStandardMarshal(ptr ptr long ptr long ptr) @ stdcall CoGetState(ptr) -@ stub CoGetTIDFromIPID +# CoGetStdMarshalEx +# CoGetSystemSecurityPermissions @ stdcall CoGetTreatAsClass(ptr ptr) @ stdcall CoImpersonateClient() @ stdcall CoInitialize(ptr) @ stdcall CoInitializeEx(ptr long) @ stdcall CoInitializeSecurity(ptr long ptr ptr long long ptr long ptr) @ stdcall CoInitializeWOW(long long) +# CoInstall +# CoInvalidateRemoteMachineBindings @ stdcall CoIsHandlerConnected(ptr) @ stdcall CoIsOle1Class (ptr) @ stdcall CoLoadLibrary(wstr long) @@ -53,10 +74,13 @@ @ stdcall CoMarshalHresult(ptr long) @ stdcall CoMarshalInterThreadInterfaceInStream(ptr ptr ptr) @ stdcall CoMarshalInterface(ptr ptr ptr long ptr long) +# CoPopServiceDomain +# CoPushServiceDomain @ stub CoQueryAuthenticationServices @ stdcall CoQueryClientBlanket(ptr ptr ptr ptr ptr ptr ptr) @ stdcall CoQueryProxyBlanket(ptr ptr ptr ptr ptr ptr ptr ptr) @ stub CoQueryReleaseObject +# CoReactivateObject @ stdcall CoRegisterChannelHook(ptr ptr) @ stdcall CoRegisterClassObject(ptr ptr long long ptr) @ stdcall CoRegisterInitializeSpy(ptr ptr) @@ -68,10 +92,12 @@ @ stdcall CoReleaseMarshalData(ptr) @ stdcall CoReleaseServerProcess() @ stdcall CoResumeClassObjects() +# CoRetireServer @ stdcall CoRevertToSelf() @ stdcall CoRevokeClassObject(long) @ stdcall CoRevokeInitializeSpy(int64) @ stdcall CoRevokeMallocSpy() +# CoSetCancelObject @ stdcall CoSetProxyBlanket(ptr long long ptr long long ptr long) @ stdcall CoSetState(ptr) @ stdcall CoSuspendClassObjects() @@ -79,12 +105,17 @@ @ stdcall CoTaskMemAlloc(long) @ stdcall CoTaskMemFree(ptr) @ stdcall CoTaskMemRealloc(ptr long) +# CoTestCancel @ stdcall CoTreatAsClass(ptr ptr) @ stdcall CoUninitialize() @ stub CoUnloadingWOW @ stdcall CoUnmarshalHresult(ptr ptr) @ stdcall CoUnmarshalInterface(ptr ptr ptr) @ stdcall CoWaitForMultipleHandles(long long long ptr ptr) +# ComPs_NdrDllCanUnloadNow +# ComPs_NdrDllGetClassObject +# ComPs_NdrDllRegisterProxy +# ComPs_NdrDllUnregisterProxy @ stdcall CreateAntiMoniker(ptr) @ stdcall CreateBindCtx(long ptr) @ stdcall CreateClassMoniker(ptr ptr) @@ -98,12 +129,13 @@ @ stub CreateObjrefMoniker @ stdcall CreateOleAdviseHolder(ptr) @ stdcall CreatePointerMoniker(ptr ptr) +# CreateStdProgressIndicator @ stdcall CreateStreamOnHGlobal(ptr long ptr) +# DcomChannelSetHResult @ stdcall DllDebugObjectRPCHook(long ptr) -@ stdcall DllGetClassObject (ptr ptr ptr) +@ stdcall DllGetClassObject(ptr ptr ptr) @ stub DllGetClassObjectWOW @ stdcall -private DllRegisterServer() -@ stdcall -private DllUnregisterServer() @ stdcall DoDragDrop(ptr ptr long ptr) @ stub EnableHookObject @ stdcall FmtIdToPropStgName(ptr wstr) @@ -164,8 +196,8 @@ @ stdcall HWND_UserMarshal(ptr ptr ptr) @ stdcall HWND_UserSize(ptr long ptr) @ stdcall HWND_UserUnmarshal(ptr ptr ptr) +# HkOleRegisterObject @ stdcall IIDFromString(wstr ptr) -@ stub I_RemoteMain @ stdcall IsAccelerator(long long ptr long) @ stdcall IsEqualGUID(ptr ptr) @ stub IsValidIid @@ -260,15 +292,19 @@ @ stdcall StgCreateDocfile(wstr long long ptr) @ stdcall StgCreateDocfileOnILockBytes(ptr long long ptr) @ stdcall StgCreatePropSetStg(ptr long ptr) +# StgCreatePropStg @ stdcall StgCreateStorageEx(wstr long long long ptr ptr ptr ptr) @ stub StgGetIFillLockBytesOnFile @ stub StgGetIFillLockBytesOnILockBytes @ stdcall StgIsStorageFile(wstr) @ stdcall StgIsStorageILockBytes(ptr) @ stub StgOpenAsyncDocfileOnIFillLockBytes +# StgOpenPropStg @ stdcall StgOpenStorage(wstr ptr long ptr long ptr) @ stdcall StgOpenStorageEx(wstr long long long ptr ptr ptr ptr) +# StgOpenStorageOnHandle @ stdcall StgOpenStorageOnILockBytes(ptr ptr long long long ptr) +# StgPropertyLengthAsVariant @ stdcall StgSetTimes(wstr ptr ptr ptr ) @ stdcall StringFromCLSID(ptr ptr) @ stdcall StringFromGUID2(ptr ptr long) diff --git a/dll/win32/oleaut32/oleaut32.spec b/dll/win32/oleaut32/oleaut32.spec index a68eb0c4eaf..53ea392e7f6 100644 --- a/dll/win32/oleaut32/oleaut32.spec +++ b/dll/win32/oleaut32/oleaut32.spec @@ -140,12 +140,14 @@ 141 stdcall VarAdd(ptr ptr ptr) 142 stdcall VarAnd(ptr ptr ptr) 143 stdcall VarDiv(ptr ptr ptr) -144 stub OACreateTypeLib2 +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) 146 stdcall DispCallFunc(ptr long long long long ptr ptr ptr) 147 stdcall VariantChangeTypeEx(ptr ptr long long long) 148 stdcall SafeArrayPtrOfIndex(ptr ptr ptr) 149 stdcall SysStringByteLen(ptr) 150 stdcall SysAllocStringByteLen(ptr long) +@ stdcall -private DllRegisterServer() 152 stdcall VarEqv(ptr ptr ptr) 153 stdcall VarIdiv(ptr ptr ptr) 154 stdcall VarImp(ptr ptr ptr) @@ -294,6 +296,8 @@ 297 stub LPSAFEARRAY_Unmarshal 298 stdcall VarDecCmpR8(ptr double) 299 stdcall VarCyAdd(int64 int64 ptr) +@ stdcall -private DllUnregisterServer() +301 stub OACreateTypeLib2 303 stdcall VarCyMul(int64 int64 ptr) 304 stdcall VarCyMulI4(int64 long ptr) 305 stdcall VarCySub(int64 int64 ptr) @@ -357,26 +361,6 @@ 377 stdcall VarI1FromUI8(int64 ptr) 378 stdcall VarUI2FromI8(int64 ptr) 379 stdcall VarUI2FromUI8(int64 ptr) -380 stub UserHWND_from_local -381 stub UserHWND_to_local -382 stub UserHWND_free_inst -383 stub UserHWND_free_local -384 stub UserBSTR_from_local -385 stub UserBSTR_to_local -386 stub UserBSTR_free_inst -387 stub UserBSTR_free_local -388 stub UserVARIANT_from_local -389 stub UserVARIANT_to_local -390 stub UserVARIANT_free_inst -391 stub UserVARIANT_free_local -392 stub UserEXCEPINFO_from_local -393 stub UserEXCEPINFO_to_local -394 stub UserEXCEPINFO_free_inst -395 stub UserEXCEPINFO_free_local -396 stub UserMSG_from_local -397 stub UserMSG_to_local -398 stub UserMSG_free_inst -399 stub UserMSG_free_local 401 stdcall OleLoadPictureEx(ptr long long long long long long ptr) 402 stub OleLoadPictureFileEx 411 stdcall SafeArrayCreateVector(long long long) @@ -412,8 +396,3 @@ 441 stdcall VarUI8FromDec(long ptr) 442 stdcall RegisterTypeLibForUser(ptr wstr wstr) 443 stdcall UnRegisterTypeLibForUser(ptr long long long long) - -@ stdcall -private DllCanUnloadNow() -@ stdcall -private DllGetClassObject(ptr ptr ptr) -@ stdcall -private DllRegisterServer() -@ stdcall -private DllUnregisterServer() diff --git a/dll/win32/powrprof/powrprof.c b/dll/win32/powrprof/powrprof.c index 8feff109ab2..e449088f859 100644 --- a/dll/win32/powrprof/powrprof.c +++ b/dll/win32/powrprof/powrprof.c @@ -64,7 +64,7 @@ CallNtPowerInformation(POWER_INFORMATION_LEVEL InformationLevel, { BOOLEAN old; - //Lohnegrim: In order to get the right results, we have to ajust our Privilegs + //Lohnegrim: In order to get the right results, we have to adjust our Privileges RtlAdjustPrivilege(SE_SHUTDOWN_PRIVILEGE, TRUE, FALSE, &old); RtlAdjustPrivilege(SE_CREATE_PAGEFILE_PRIVILEGE, TRUE, FALSE, &old); @@ -332,7 +332,7 @@ GetCurrentPowerPolicies(PGLOBAL_POWER_POLICY pGlobalPowerPolicy, return FALSE; */ /* - Lohnegrim: I dont know why this Function shoud call NtPowerInformation, becouse as far as i know, + Lohnegrim: I don't know why this Function should call NtPowerInformation, because as far as I know, it simply returns the GlobalPowerPolicy and the AktivPowerScheme! */ UINT uiID; @@ -793,8 +793,8 @@ static BOOLEAN CheckPowerActionPolicy(PPOWER_ACTION_POLICY pPAP, SYSTEM_POWER_CAPABILITIES PowerCaps) { /* - Lohnegrim: this is an Helperfunction, it checks if the POWERACTIONPOLICY is valid - Also, if the System dosn't support Hipernation, then change the PowerAction + Lohnegrim: this is an Helper function, it checks if the POWERACTIONPOLICY is valid + Also, if the System doesn't support Hibernation, then change the PowerAction */ switch (pPAP->Action) { @@ -829,7 +829,7 @@ CheckPowerActionPolicy(PPOWER_ACTION_POLICY pPAP, SYSTEM_POWER_CAPABILITIES Powe static VOID FixSystemPowerState(PSYSTEM_POWER_STATE Psps, SYSTEM_POWER_CAPABILITIES PowerCaps) { - //Lohnegrim: If the System dosn't support the Powerstates, then we have to change them + //Lohnegrim: If the System doesn't support the Powerstates, then we have to change them if (!PowerCaps.SystemS1 && *Psps == PowerSystemSleeping1) *Psps = PowerSystemSleeping2; if (!PowerCaps.SystemS2 && *Psps == PowerSystemSleeping2) @@ -923,7 +923,7 @@ ValidatePowerPolicies(PGLOBAL_POWER_POLICY pGPP, PPOWER_POLICY pPP) if (pGPP->mach.BroadcastCapacityResolution > 100) pGPP->mach.BroadcastCapacityResolution = 100; - //Lohnegrim: I have no idear, if they are realy needed, or if they are spezific for my System, or what they mean, so i removed them + //Lohnegrim: I have no idea, if they are really needed, or if they are specific for my System, or what they mean, so I removed them //pGPP->user.DischargePolicy[1].PowerPolicy.EventCode = pGPP->user.DischargePolicy[1].PowerPolicy.EventCode | 0x010000; //pGPP->user.DischargePolicy[2].PowerPolicy.EventCode = pGPP->user.DischargePolicy[2].PowerPolicy.EventCode | 0x020000; //pGPP->user.DischargePolicy[3].PowerPolicy.EventCode = pGPP->user.DischargePolicy[3].PowerPolicy.EventCode | 0x030000; @@ -1053,7 +1053,7 @@ ValidatePowerPolicies(PGLOBAL_POWER_POLICY pGPP, PPOWER_POLICY pPP) pPP->user.MaxSleepAc=PowerSystemSleeping1; pPP->user.MaxSleepDc=PowerSystemSleeping1; } - //Lohnegrim: I dont know where to get this info from, so i removed it + //Lohnegrim: I don't know where to get this info from, so I removed it //pPP->user.OptimizeForPowerAc=TRUE; //pPP->user.OptimizeForPowerDc=TRUE; diff --git a/dll/win32/rpcrt4/CMakeLists.txt b/dll/win32/rpcrt4/CMakeLists.txt index fa024a5ee24..85207ed0121 100644 --- a/dll/win32/rpcrt4/CMakeLists.txt +++ b/dll/win32/rpcrt4/CMakeLists.txt @@ -52,6 +52,6 @@ set_module_type(rpcrt4 win32dll) target_link_libraries(rpcrt4 wine uuid ${PSEH_LIB}) add_delay_importlibs(rpcrt4 iphlpapi wininet secur32 user32) -add_importlibs(rpcrt4 msvcrt advapi32 ws2_32 kernel32 ntdll) +add_importlibs(rpcrt4 advapi32 ws2_32 shlwapi msvcrt kernel32 ntdll) add_pch(rpcrt4 precomp.h SOURCE) add_cd_file(TARGET rpcrt4 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/rpcrt4/cproxy.c b/dll/win32/rpcrt4/cproxy.c index bc5fcf008cf..bf8a5910d81 100644 --- a/dll/win32/rpcrt4/cproxy.c +++ b/dll/win32/rpcrt4/cproxy.c @@ -175,13 +175,14 @@ static const struct thunk *allocate_block( unsigned int num ) { unsigned int i; struct thunk *prev, *block; + DWORD oldprot; block = VirtualAlloc( NULL, BLOCK_SIZE * sizeof(*block), MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE ); if (!block) return NULL; for (i = 0; i < BLOCK_SIZE; i++) init_thunk( &block[i], BLOCK_SIZE * num + i + 3 ); - VirtualProtect( block, BLOCK_SIZE * sizeof(*block), PAGE_EXECUTE_READ, NULL ); + VirtualProtect( block, BLOCK_SIZE * sizeof(*block), PAGE_EXECUTE_READ, &oldprot ); prev = InterlockedCompareExchangePointer( (void **)&method_blocks[num], block, NULL ); if (prev) /* someone beat us to it */ { diff --git a/dll/win32/rpcrt4/cpsf.c b/dll/win32/rpcrt4/cpsf.c index 72029a66889..888b057c73d 100644 --- a/dll/win32/rpcrt4/cpsf.c +++ b/dll/win32/rpcrt4/cpsf.c @@ -22,6 +22,12 @@ #include +#define NO_SHLWAPI_PATH +#define NO_SHLWAPI_STRFCNS +#define NO_SHLWAPI_GDI +#define NO_SHLWAPI_STREAM +#include + WINE_DEFAULT_DEBUG_CHANNEL(ole); static void format_clsid( WCHAR *buffer, const CLSID *clsid ) @@ -308,7 +314,7 @@ HRESULT WINAPI NdrDllUnregisterProxy(HMODULE hDll, strcpyW( keyname, interfaceW ); format_clsid( keyname + strlenW(keyname), proxy->header.piid ); - RegDeleteTreeW(HKEY_CLASSES_ROOT, keyname); + SHDeleteKeyW(HKEY_CLASSES_ROOT, keyname); } pProxyFileList++; } @@ -316,7 +322,7 @@ HRESULT WINAPI NdrDllUnregisterProxy(HMODULE hDll, /* unregister clsid */ strcpyW( keyname, clsidW ); strcatW( keyname, clsid ); - RegDeleteTreeW(HKEY_CLASSES_ROOT, keyname); + SHDeleteKeyW(HKEY_CLASSES_ROOT, keyname); return S_OK; } diff --git a/dll/win32/rpcrt4/cstub.c b/dll/win32/rpcrt4/cstub.c index d3a26d73c93..5beeec173f7 100644 --- a/dll/win32/rpcrt4/cstub.c +++ b/dll/win32/rpcrt4/cstub.c @@ -176,6 +176,7 @@ static const vtbl_method_t *allocate_block( unsigned int num ) { unsigned int i; vtbl_method_t *prev, *block; + DWORD oldprot; block = VirtualAlloc( NULL, BLOCK_SIZE * sizeof(*block), MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE ); @@ -186,7 +187,7 @@ static const vtbl_method_t *allocate_block( unsigned int num ) memcpy( &block[i], opcodes, sizeof(opcodes) ); block[i].offset = (BLOCK_SIZE * num + i + 3) * sizeof(void *); } - VirtualProtect( block, BLOCK_SIZE * sizeof(*block), PAGE_EXECUTE_READ, NULL ); + VirtualProtect( block, BLOCK_SIZE * sizeof(*block), PAGE_EXECUTE_READ, &oldprot ); prev = InterlockedCompareExchangePointer( (void **)&method_blocks[num], block, NULL ); if (prev) /* someone beat us to it */ { diff --git a/dll/win32/rpcrt4/ndr_stubless.c b/dll/win32/rpcrt4/ndr_stubless.c index e43ddde805b..72a853701d8 100644 --- a/dll/win32/rpcrt4/ndr_stubless.c +++ b/dll/win32/rpcrt4/ndr_stubless.c @@ -1079,6 +1079,19 @@ static LONG_PTR *stub_do_args(MIDL_STUB_MESSAGE *pStubMsg, unsigned int i; LONG_PTR *retval_ptr = NULL; + if (phase == STUBLESS_FREE) + { + /* Process the params allocated by the application first */ + for (i = 0; i < number_of_params; i++) + { + unsigned char *pArg = pStubMsg->StackTop + params[i].stack_offset; + if (params[i].attr.MustFree) + { + call_freer(pStubMsg, pArg, ¶ms[i]); + } + } + } + for (i = 0; i < number_of_params; i++) { unsigned char *pArg = pStubMsg->StackTop + params[i].stack_offset; @@ -1096,11 +1109,7 @@ static LONG_PTR *stub_do_args(MIDL_STUB_MESSAGE *pStubMsg, call_marshaller(pStubMsg, pArg, ¶ms[i]); break; case STUBLESS_FREE: - if (params[i].attr.MustFree) - { - call_freer(pStubMsg, pArg, ¶ms[i]); - } - else if (params[i].attr.ServerAllocSize) + if (params[i].attr.ServerAllocSize) { HeapFree(GetProcessHeap(), 0, *(void **)pArg); } diff --git a/dll/win32/rpcrt4/rpc_transport.c b/dll/win32/rpcrt4/rpc_transport.c index 6608d8aedf2..771c3957376 100644 --- a/dll/win32/rpcrt4/rpc_transport.c +++ b/dll/win32/rpcrt4/rpc_transport.c @@ -313,6 +313,7 @@ static RPC_STATUS rpcrt4_ncacn_np_open(RpcConnection* Connection) DWORD bufLen = sizeof(ComputerName)/sizeof(ComputerName[0]); RPC_STATUS r; LPSTR pname; + LPSTR NetworkAddr; INT size; /* already connected? */ @@ -329,9 +330,13 @@ static RPC_STATUS rpcrt4_ncacn_np_open(RpcConnection* Connection) } else { + NetworkAddr = Connection->NetworkAddr; + if (NetworkAddr[0] == '\\' && NetworkAddr[1] == '\\') + NetworkAddr += 2; + if (GetComputerNameA(ComputerName, &bufLen)) { - if (stricmp(ComputerName, Connection->NetworkAddr) == 0) + if (stricmp(ComputerName, NetworkAddr) == 0) { bUseLocalName = TRUE; size += strlen(local); @@ -339,13 +344,13 @@ static RPC_STATUS rpcrt4_ncacn_np_open(RpcConnection* Connection) else { bUseLocalName = FALSE; - size += strlen(Connection->NetworkAddr); + size += strlen(NetworkAddr); } } else { bUseLocalName = FALSE; - size += strlen(Connection->NetworkAddr); + size += strlen(NetworkAddr); } } @@ -356,7 +361,7 @@ static RPC_STATUS rpcrt4_ncacn_np_open(RpcConnection* Connection) if (bUseLocalName) strcat(pname, local); else - strcat(pname, Connection->NetworkAddr); + strcat(pname, NetworkAddr); strcat(pname, Connection->Endpoint); r = rpcrt4_conn_open_pipe(Connection, pname, TRUE); I_RpcFree(pname); diff --git a/dll/win32/rpcrt4/rpcrt4.spec b/dll/win32/rpcrt4/rpcrt4.spec index 474523b218d..96570f2ef8f 100644 --- a/dll/win32/rpcrt4/rpcrt4.spec +++ b/dll/win32/rpcrt4/rpcrt4.spec @@ -1,5 +1,6 @@ @ stdcall CreateProxyFromTypeInfo(ptr ptr ptr ptr ptr) @ stdcall CreateStubFromTypeInfo(ptr ptr ptr ptr) +# I_RpcServerTurnOnOffKeepalives @ stdcall CStdStubBuffer_AddRef(ptr) @ stdcall CStdStubBuffer_Connect(ptr ptr) @ stdcall CStdStubBuffer_CountRefs(ptr) @@ -9,9 +10,10 @@ @ stdcall CStdStubBuffer_Invoke(ptr ptr ptr) @ stdcall CStdStubBuffer_IsIIDSupported(ptr ptr) @ stdcall CStdStubBuffer_QueryInterface(ptr ptr ptr) -@ stub CreateServerInterfaceFromStub # wxp @ stdcall DceErrorInqTextA (long ptr) @ stdcall DceErrorInqTextW (long ptr) +# DllGetClassObject +# DllInstall @ stdcall -private DllRegisterServer() @ stub GlobalMutexClearExternal @ stub GlobalMutexRequestExternal @@ -25,17 +27,17 @@ @ stub I_RpcBCacheAllocate @ stub I_RpcBCacheFree @ stub I_RpcBindingCopy +# I_RpcBindingHandleToAsyncHandle @ stub I_RpcBindingInqConnId @ stub I_RpcBindingInqDynamicEndPoint @ stub I_RpcBindingInqDynamicEndPointA @ stub I_RpcBindingInqDynamicEndPointW @ stub I_RpcBindingInqLocalClientPID # wxp +# I_RpcBindingInqMarshalledTargetInfo @ stub I_RpcBindingInqSecurityContext @ stdcall I_RpcBindingInqTransportType(ptr ptr) @ stub I_RpcBindingInqWireIdForSnego @ stub I_RpcBindingIsClientLocal -# 9x version of I_RpcBindingSetAsync has 3 arguments, not 2 -@ stdcall I_RpcBindingSetAsync(ptr ptr) @ stub I_RpcBindingToStaticStringBindingW @ stub I_RpcClearMutex @ stub I_RpcConnectionInqSockBuffSize @@ -53,6 +55,8 @@ @ stub I_RpcIfInqTransferSyntaxes @ stub I_RpcLogEvent @ stdcall I_RpcMapWin32Status(long) +# I_RpcNDRCGetWireRepresentation +# I_RpcNDRSContextEmergencyCleanup @ stdcall I_RpcNegotiateTransferSyntax(ptr) @ stub I_RpcNsBindingSetEntryName @ stub I_RpcNsBindingSetEntryNameA @@ -64,21 +68,25 @@ @ stub I_RpcProxyNewConnection # wxp @ stub I_RpcReallocPipeBuffer @ stdcall I_RpcReceive(ptr) +# I_RpcRecordCalloutFailure +# I_RpcReplyToClientWithStatus @ stub I_RpcRequestMutex +# I_RpcSNCHOption @ stdcall I_RpcSend(ptr) @ stdcall I_RpcSendReceive(ptr) @ stub I_RpcServerAllocateIpPort +# I_RpcServerCheckClientRestriction @ stub I_RpcServerInqAddressChangeFn @ stub I_RpcServerInqLocalConnAddress # wxp @ stub I_RpcServerInqTransportType +# I_RpcServerIsClientDisconnected @ stub I_RpcServerRegisterForwardFunction @ stub I_RpcServerSetAddressChangeFn -@ stdcall I_RpcServerStartListening(ptr) # win9x -@ stdcall I_RpcServerStopListening() # win9x @ stub I_RpcServerUseProtseq2A @ stub I_RpcServerUseProtseq2W @ stub I_RpcServerUseProtseqEp2A @ stub I_RpcServerUseProtseqEp2W +# I_RpcSessionStrictContextHandle @ stub I_RpcSetAsyncHandle @ stub I_RpcSsDontSerializeContext @ stub I_RpcSystemFunction001 # wxp (oh, brother!) @@ -92,7 +100,6 @@ @ stub I_RpcTransIoCancelled @ stub I_RpcTransServerNewConnection @ stub I_RpcTurnOnEEInfoPropagation # wxp -@ stdcall I_RpcWindowProc(ptr long long long) # win9x @ stub I_UuidCreate @ stub MIDL_wchar_strcpy @ stub MIDL_wchar_strlen @@ -118,7 +125,6 @@ @ stdcall NdrAllocate(ptr long) @ varargs NdrAsyncClientCall(ptr ptr) @ stub NdrAsyncServerCall -@ stdcall NdrAsyncStubCall(ptr ptr ptr ptr) @ stdcall NdrByteCountPointerBufferSize(ptr ptr ptr) @ stdcall NdrByteCountPointerFree(ptr ptr ptr) @ stdcall NdrByteCountPointerMarshall(ptr ptr ptr) @@ -126,8 +132,8 @@ @ stdcall NdrCStdStubBuffer2_Release(ptr ptr) @ stdcall NdrCStdStubBuffer_Release(ptr ptr) @ stdcall NdrClearOutParameters(ptr ptr ptr) -@ varargs NdrClientCall2(ptr ptr) @ varargs -arch=i386 NdrClientCall(ptr ptr) NdrClientCall2 +@ varargs NdrClientCall2(ptr ptr) @ stdcall NdrClientContextMarshall(ptr ptr long) @ stdcall NdrClientContextUnmarshall(ptr ptr ptr) @ stub NdrClientInitialize @@ -173,6 +179,7 @@ @ stdcall NdrCorrelationFree(ptr) @ stdcall NdrCorrelationInitialize(ptr ptr long long) @ stdcall NdrCorrelationPass(ptr) +# NdrCreateServerInterfaceFromStub @ stub NdrDcomAsyncClientCall @ stub NdrDcomAsyncStubCall @ stdcall NdrDllCanUnloadNow(ptr) @@ -198,28 +205,19 @@ @ stdcall NdrFullPointerXlatInit(long long) @ stdcall NdrGetBuffer(ptr long ptr) @ stub NdrGetDcomProtocolVersion -@ stub NdrGetPartialBuffer -@ stub NdrGetPipeBuffer @ stub NdrGetSimpleTypeBufferAlignment # wxp @ stub NdrGetSimpleTypeBufferSize # wxp @ stub NdrGetSimpleTypeMemorySize # wxp @ stub NdrGetTypeFlags # wxp @ stdcall NdrGetUserMarshalInfo(ptr long ptr) -@ stub NdrHardStructBufferSize #(ptr ptr ptr) -@ stub NdrHardStructFree #(ptr ptr ptr) -@ stub NdrHardStructMarshall #(ptr ptr ptr) -@ stub NdrHardStructMemorySize #(ptr ptr) -@ stub NdrHardStructUnmarshall #(ptr ptr ptr long) @ stdcall NdrInterfacePointerBufferSize(ptr ptr ptr) @ stdcall NdrInterfacePointerFree(ptr ptr ptr) @ stdcall NdrInterfacePointerMarshall(ptr ptr ptr) @ stdcall NdrInterfacePointerMemorySize(ptr ptr) @ stdcall NdrInterfacePointerUnmarshall(ptr ptr ptr long) -@ stub NdrIsAppDoneWithPipes @ stdcall NdrMapCommAndFaultStatus(ptr ptr ptr long) -@ stub NdrMarkNextActivePipe -@ stub NdrMesProcEncodeDecode2 @ varargs NdrMesProcEncodeDecode(ptr ptr ptr) +@ stub NdrMesProcEncodeDecode2 @ stub NdrMesSimpleTypeAlignSize @ stub NdrMesSimpleTypeDecode @ stub NdrMesSimpleTypeEncode @@ -248,11 +246,6 @@ @ stub NdrPartialIgnoreClientMarshall # wxp @ stub NdrPartialIgnoreServerInitialize # wxp @ stub NdrPartialIgnoreServerUnmarshall # wxp -@ stub NdrPipePull -@ stub NdrPipePush -@ stub NdrPipeSendReceive -@ stub NdrPipesDone -@ stub NdrPipesInitialize @ stdcall NdrPointerBufferSize(ptr ptr ptr) @ stdcall NdrPointerFree(ptr ptr ptr) @ stdcall NdrPointerMarshall(ptr ptr ptr) @@ -378,13 +371,14 @@ @ stub RpcErrorClearInformation # wxp @ stdcall RpcErrorEndEnumeration(ptr) @ stdcall RpcErrorGetNextRecord(ptr long ptr) +# RpcErrorGetNumberOfRecords @ stdcall RpcErrorLoadErrorInfo(ptr long ptr) -@ stub RpcErrorNumberOfRecords # wxp @ stub RpcErrorResetEnumeration # wxp @ stdcall RpcErrorSaveErrorInfo(ptr ptr ptr) @ stdcall RpcErrorStartEnumeration(ptr) @ stub RpcFreeAuthorizationContext # wxp @ stdcall RpcGetAsyncCallStatus(ptr) RpcAsyncGetCallStatus +# RpcGetAuthorizationContextForClient @ stub RpcIfIdVectorFree @ stub RpcIfInqId @ stdcall RpcImpersonateClient(ptr) diff --git a/dll/win32/rpcrt4/rpcrt4_ros.diff b/dll/win32/rpcrt4/rpcrt4_ros.diff index 098606b3610..0ebbfaff537 100644 --- a/dll/win32/rpcrt4/rpcrt4_ros.diff +++ b/dll/win32/rpcrt4/rpcrt4_ros.diff @@ -141,7 +141,7 @@ diff -prudN .\wine\dlls\rpcrt4/rpc_transport.c .\reactos\dll\win32\rpcrt4/rpc_tr npc->pipe = pipe; return RPC_S_OK; -@@ -308,18 +306,59 @@ static RPC_STATUS rpcrt4_protseq_ncalrpc +@@ -308,18 +306,64 @@ static RPC_STATUS rpcrt4_protseq_ncalrpc static RPC_STATUS rpcrt4_ncacn_np_open(RpcConnection* Connection) { RpcConnection_np *npc = (RpcConnection_np *) Connection; @@ -153,6 +153,7 @@ diff -prudN .\wine\dlls\rpcrt4/rpc_transport.c .\reactos\dll\win32\rpcrt4/rpc_tr + DWORD bufLen = sizeof(ComputerName)/sizeof(ComputerName[0]); RPC_STATUS r; LPSTR pname; ++ LPSTR NetworkAddr; + INT size; /* already connected? */ @@ -172,9 +173,13 @@ diff -prudN .\wine\dlls\rpcrt4/rpc_transport.c .\reactos\dll\win32\rpcrt4/rpc_tr + } + else + { ++ NetworkAddr = Connection->NetworkAddr; ++ if (NetworkAddr[0] == '\\' && NetworkAddr[1] == '\\') ++ NetworkAddr += 2; ++ + if (GetComputerNameA(ComputerName, &bufLen)) + { -+ if (stricmp(ComputerName, Connection->NetworkAddr) == 0) ++ if (stricmp(ComputerName, NetworkAddr) == 0) + { + bUseLocalName = TRUE; + size += strlen(local); @@ -182,13 +187,13 @@ diff -prudN .\wine\dlls\rpcrt4/rpc_transport.c .\reactos\dll\win32\rpcrt4/rpc_tr + else + { + bUseLocalName = FALSE; -+ size += strlen(Connection->NetworkAddr); ++ size += strlen(NetworkAddr); + } + } + else + { + bUseLocalName = FALSE; -+ size += strlen(Connection->NetworkAddr); ++ size += strlen(NetworkAddr); + } + } + @@ -199,13 +204,13 @@ diff -prudN .\wine\dlls\rpcrt4/rpc_transport.c .\reactos\dll\win32\rpcrt4/rpc_tr + if (bUseLocalName) + strcat(pname, local); + else -+ strcat(pname, Connection->NetworkAddr); ++ strcat(pname, NetworkAddr); + strcat(pname, Connection->Endpoint); + r = rpcrt4_conn_open_pipe(Connection, pname, TRUE); I_RpcFree(pname); return r; -@@ -368,9 +407,9 @@ static void rpcrt4_conn_np_handoff(RpcCo +@@ -368,9 +412,9 @@ static void rpcrt4_conn_np_handoff(RpcCo * to the child, then reopen the server binding to continue listening */ new_npc->pipe = old_npc->pipe; @@ -217,7 +222,7 @@ diff -prudN .\wine\dlls\rpcrt4/rpc_transport.c .\reactos\dll\win32\rpcrt4/rpc_tr old_npc->listening = FALSE; } -@@ -415,11 +454,17 @@ static int rpcrt4_conn_np_read(RpcConnec +@@ -415,11 +459,17 @@ static int rpcrt4_conn_np_read(RpcConnec char *buf = buffer; BOOL ret = TRUE; unsigned int bytes_left = count; @@ -244,7 +249,7 @@ diff -prudN .\wine\dlls\rpcrt4/rpc_transport.c .\reactos\dll\win32\rpcrt4/rpc_tr return ret ? count : -1; } -@@ -437,16 +483,23 @@ static int rpcrt4_conn_np_write(RpcConne +@@ -437,16 +488,23 @@ static int rpcrt4_conn_np_write(RpcConne const char *buf = buffer; BOOL ret = TRUE; unsigned int bytes_left = count; @@ -269,7 +274,7 @@ diff -prudN .\wine\dlls\rpcrt4/rpc_transport.c .\reactos\dll\win32\rpcrt4/rpc_tr return ret ? count : -1; } -@@ -458,9 +511,9 @@ static int rpcrt4_conn_np_close(RpcConne +@@ -458,9 +516,9 @@ static int rpcrt4_conn_np_close(RpcConne CloseHandle(npc->pipe); npc->pipe = 0; } @@ -282,7 +287,7 @@ diff -prudN .\wine\dlls\rpcrt4/rpc_transport.c .\reactos\dll\win32\rpcrt4/rpc_tr } return 0; } -@@ -664,7 +717,7 @@ static void *rpcrt4_protseq_np_get_wait_ +@@ -664,7 +722,7 @@ static void *rpcrt4_protseq_np_get_wait_ conn = CONTAINING_RECORD(protseq->conn, RpcConnection_np, common); while (conn) { rpcrt4_conn_listen_pipe(conn); @@ -291,7 +296,7 @@ diff -prudN .\wine\dlls\rpcrt4/rpc_transport.c .\reactos\dll\win32\rpcrt4/rpc_tr (*count)++; conn = CONTAINING_RECORD(conn->common.Next, RpcConnection_np, common); } -@@ -685,7 +738,7 @@ static void *rpcrt4_protseq_np_get_wait_ +@@ -685,7 +743,7 @@ static void *rpcrt4_protseq_np_get_wait_ *count = 1; conn = CONTAINING_RECORD(protseq->conn, RpcConnection_np, common); while (conn) { @@ -300,7 +305,7 @@ diff -prudN .\wine\dlls\rpcrt4/rpc_transport.c .\reactos\dll\win32\rpcrt4/rpc_tr (*count)++; conn = CONTAINING_RECORD(conn->common.Next, RpcConnection_np, common); } -@@ -732,18 +785,12 @@ static int rpcrt4_protseq_np_wait_for_ne +@@ -732,18 +790,12 @@ static int rpcrt4_protseq_np_wait_for_ne EnterCriticalSection(&protseq->cs); conn = CONTAINING_RECORD(protseq->conn, RpcConnection_np, common); while (conn) { diff --git a/dll/win32/samsrv/samrpc.c b/dll/win32/samsrv/samrpc.c index 9bf30752883..6c0335bc930 100644 --- a/dll/win32/samsrv/samrpc.c +++ b/dll/win32/samsrv/samrpc.c @@ -8062,6 +8062,10 @@ SamrChangePasswordUser(IN SAMPR_HANDLE UserHandle, LARGE_INTEGER SystemTime; NTSTATUS Status; + DBG_UNREFERENCED_LOCAL_VARIABLE(StoredLmPresent); + DBG_UNREFERENCED_LOCAL_VARIABLE(StoredNtPresent); + DBG_UNREFERENCED_LOCAL_VARIABLE(StoredLmEmpty); + TRACE("(%p %u %p %p %u %p %p %u %p %u %p)\n", UserHandle, LmPresent, OldLmEncryptedWithNewLm, NewLmEncryptedWithOldLm, NtPresent, OldNtEncryptedWithNewNt, NewNtEncryptedWithOldNt, NtCrossEncryptionPresent, diff --git a/dll/win32/setupapi/CMakeLists.txt b/dll/win32/setupapi/CMakeLists.txt index 5f0c7365c4a..e4c3f4b8ff4 100644 --- a/dll/win32/setupapi/CMakeLists.txt +++ b/dll/win32/setupapi/CMakeLists.txt @@ -40,7 +40,7 @@ add_library(setupapi SHARED set_module_type(setupapi win32dll UNICODE) target_link_libraries(setupapi uuid wine ${PSEH_LIB}) -add_delay_importlibs(setupapi shell32 wintrust) +add_delay_importlibs(setupapi shell32 winspool wintrust) add_importlibs(setupapi msvcrt diff --git a/dll/win32/setupapi/dirid.c b/dll/win32/setupapi/dirid.c index e57a28cadba..f82eceb02cd 100644 --- a/dll/win32/setupapi/dirid.c +++ b/dll/win32/setupapi/dirid.c @@ -70,6 +70,7 @@ static const WCHAR *create_system_dirid( int dirid ) WCHAR buffer[MAX_PATH+32], *str; int len; + DWORD needed; switch(dirid) { @@ -122,8 +123,14 @@ static const WCHAR *create_system_dirid( int dirid ) return get_csidl_dir(CSIDL_PROFILE); case DIRID_LOADER: return C_Root; /* FIXME */ + case DIRID_PRINTPROCESSOR: + if (!GetPrintProcessorDirectoryW(NULL, NULL, 1, (LPBYTE)buffer, sizeof(buffer), &needed)) + { + WARN( "cannot retrieve print processor directory\n" ); + return get_unknown_dirid(); + } + break; case DIRID_COLOR: /* FIXME */ - case DIRID_PRINTPROCESSOR: /* FIXME */ default: FIXME( "unknown dirid %d\n", dirid ); return get_unknown_dirid(); diff --git a/dll/win32/setupapi/interface.c b/dll/win32/setupapi/interface.c index 32c8aa0b0a8..deaadd9a8cb 100644 --- a/dll/win32/setupapi/interface.c +++ b/dll/win32/setupapi/interface.c @@ -2,7 +2,7 @@ * SetupAPI interface-related functions * * Copyright 2000 Andreas Mohr for CodeWeavers - * 2005-2006 Herv Poussineau (hpoussin@reactos.org) + * 2005-2006 Herv� Poussineau (hpoussin@reactos.org) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -97,7 +97,8 @@ SETUP_CreateInterfaceList( hInterfaceKey = SetupDiOpenClassRegKeyExW(InterfaceGuid, KEY_ENUMERATE_SUB_KEYS, DIOCR_INTERFACE, MachineName, NULL); if (hInterfaceKey == INVALID_HANDLE_VALUE) { - rc = GetLastError(); + /* Key doesn't exist. Let's keep it empty */ + rc = ERROR_SUCCESS; goto cleanup; } diff --git a/dll/win32/setupapi/setupapi.spec b/dll/win32/setupapi/setupapi.spec index 2a6ad8d47e0..9ca79d212ed 100644 --- a/dll/win32/setupapi/setupapi.spec +++ b/dll/win32/setupapi/setupapi.spec @@ -604,31 +604,3 @@ @ stub pSetupVerifyQueuedCatalogs @ stub pSetupWriteLogEntry @ stub pSetupWriteLogError - -# Unknown functions, they are not present in Win2003 SP1 -@ stdcall AssertFail(str long str) -@ stub CM_Remove_Unmarked_Children -@ stub CM_Remove_Unmarked_Children_Ex -@ stub CM_Reset_Children_Marks -@ stub CM_Reset_Children_Marks_Ex -@ stdcall CaptureStringArg(wstr ptr) -@ stdcall DelayedMove(wstr wstr) -@ stub DelimStringToMultiSz -@ stub DestroyTextFileReadBuffer -@ stdcall FileExists(wstr ptr) -@ stub GetNewInfName -@ stdcall GetSetFileTimestamp(wstr ptr ptr ptr long) -@ stub LookUpStringInTable -@ stub MemoryInitialize -@ stub MultiSzFromSearchControl -@ stdcall QueryRegistryValue(long wstr ptr ptr ptr) -@ stub ReadAsciiOrUnicodeTextFile -# Yes, Microsoft really misspelled this one! -@ stdcall RetreiveFileSecurity(wstr ptr) -@ stub SearchForInfFile -@ stdcall StampFileSecurity(wstr ptr) -@ stdcall TakeOwnershipOfFile(wstr) -@ stub pSetupDirectoryIdToPath -@ stub pSetupGetOsLoaderDriveAndPath -@ stub pSetupGetVersionDatum -@ stub pSetupSetSystemSourceFlags diff --git a/dll/win32/setupapi/setupapi_private.h b/dll/win32/setupapi/setupapi_private.h index 80a818a66bf..21ff8b621cb 100644 --- a/dll/win32/setupapi/setupapi_private.h +++ b/dll/win32/setupapi/setupapi_private.h @@ -31,6 +31,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/dll/win32/shell32/CMakeLists.txt b/dll/win32/shell32/CMakeLists.txt index b59b679eb28..21a7b06bb92 100644 --- a/dll/win32/shell32/CMakeLists.txt +++ b/dll/win32/shell32/CMakeLists.txt @@ -77,6 +77,7 @@ list(APPEND SOURCE add_library(shell32 SHARED ${SOURCE} + vista.c shell32.rc ${CMAKE_CURRENT_BINARY_DIR}/shell32_stubs.c ${CMAKE_CURRENT_BINARY_DIR}/shell32.def) diff --git a/dll/win32/shell32/classes.cpp b/dll/win32/shell32/classes.cpp index 5b232a2c9a7..5d7d92f037d 100644 --- a/dll/win32/shell32/classes.cpp +++ b/dll/win32/shell32/classes.cpp @@ -34,7 +34,7 @@ BOOL HCR_MapTypeToValueW(LPCWSTR szExtension, LPWSTR szFileType, LONG len, BOOL /* added because we do not want to have double dots */ if (szExtension[0] == '.') - bPrependDot = 0; + bPrependDot = FALSE; if (bPrependDot) szTemp[0] = '.'; @@ -66,7 +66,7 @@ BOOL HCR_MapTypeToValueA(LPCSTR szExtension, LPSTR szFileType, LONG len, BOOL bP /* added because we do not want to have double dots */ if (szExtension[0] == '.') - bPrependDot = 0; + bPrependDot = FALSE; if (bPrependDot) szTemp[0] = '.'; @@ -109,7 +109,7 @@ BOOL HCR_GetDefaultVerbW(HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD le TRACE("%p %s %p\n", hkeyClass, debugstr_w(szVerb), szDest); - if (szVerb) + if (szVerb && *szVerb) { lstrcpynW(szDest, szVerb, len); return TRUE; @@ -173,7 +173,7 @@ BOOL HCR_GetExecuteCommandW(HKEY hkeyClass, LPCWSTR szClass, LPCWSTR szVerb, LPW return FALSE; ret = FALSE; - if (HCR_GetDefaultVerbW(hkeyClass, szVerb, sTempVerb, sizeof(sTempVerb))) + if (HCR_GetDefaultVerbW(hkeyClass, szVerb, sTempVerb, sizeof(sTempVerb)/sizeof(sTempVerb[0]))) { WCHAR sTemp[MAX_PATH]; wcscpy(sTemp, swShell); @@ -420,7 +420,7 @@ BOOL HCR_GetClassNameA(REFIID riid, LPSTR szDest, DWORD len) } } - TRACE("-- %s\n", szDest); + TRACE("-- (%s)\n", szDest); return ret; } diff --git a/dll/win32/shell32/defcontextmenu.cpp b/dll/win32/shell32/defcontextmenu.cpp index 6c5b2b84bee..2de0965d002 100644 --- a/dll/win32/shell32/defcontextmenu.cpp +++ b/dll/win32/shell32/defcontextmenu.cpp @@ -600,8 +600,13 @@ CDefaultContextMenu::AddStaticContextMenusToMenu( fState = MFS_ENABLED; mii.dwTypeData = NULL; + /* set first entry as default */ + if (pEntry == m_pStaticEntries) + fState |= MFS_DEFAULT; + if (!wcsicmp(pEntry->szVerb, L"open")) { + /* override default when open verb is found */ fState |= MFS_DEFAULT; idResource = IDS_OPEN_VERB; } diff --git a/dll/win32/shell32/desktop.cpp b/dll/win32/shell32/desktop.cpp index cc0b8d8808d..a4afb60f03f 100644 --- a/dll/win32/shell32/desktop.cpp +++ b/dll/win32/shell32/desktop.cpp @@ -261,8 +261,8 @@ HRESULT STDMETHODCALLTYPE CDesktopBrowser::TranslateAcceleratorSB(LPMSG lpmsg, W HRESULT STDMETHODCALLTYPE CDesktopBrowser::BrowseObject(LPCITEMIDLIST pidl, UINT wFlags) { - /* - * We should use IShellWindows interface here in order to attempt to + /* + * We should use IShellWindows interface here in order to attempt to * find an open shell window that shows the requested pidl and activate it */ @@ -422,6 +422,7 @@ LRESULT CALLBACK CDesktopBrowser::ProgmanWindowProc(IN HWND hwnd, IN UINT uMsg, rcDesktop.bottom = GetSystemMetrics(SM_CYVIRTUALSCREEN); /* FIXME: Update work area */ + DBG_UNREFERENCED_LOCAL_VARIABLE(rcDesktop); } break; diff --git a/dll/win32/shell32/openwithmenu.cpp b/dll/win32/shell32/openwithmenu.cpp index 02e5b9fd8c4..a2033f819c6 100644 --- a/dll/win32/shell32/openwithmenu.cpp +++ b/dll/win32/shell32/openwithmenu.cpp @@ -754,14 +754,15 @@ BOOL COpenWithList::SetDefaultHandler(SApp *pApp, LPCWSTR pwszFilename) } /* Copy static verbs from Classes\Applications key */ - LONG Result = RegCopyTreeW(hSrcKey, NULL, hDestKey); + /* FIXME: SHCopyKey does not copy the security attributes of the keys */ + LSTATUS Result = SHCopyKeyW(hSrcKey, NULL, hDestKey, 0); RegCloseKey(hDestKey); RegCloseKey(hSrcKey); RegCloseKey(hKey); if (Result != ERROR_SUCCESS) { - ERR("RegCopyTreeW failed\n"); + ERR("SHCopyKeyW failed\n"); return FALSE; } diff --git a/dll/win32/shell32/shell32_main.cpp b/dll/win32/shell32/shell32_main.cpp index aa2d299cffa..a38ef84521e 100644 --- a/dll/win32/shell32/shell32_main.cpp +++ b/dll/win32/shell32/shell32_main.cpp @@ -1075,7 +1075,7 @@ INT_PTR CALLBACK AboutAuthorsDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM /************************************************************************* * AboutDlgProc (internal) */ -INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) +static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) { static DWORD cxLogoBmp; static DWORD cyLogoBmp; diff --git a/dll/win32/shell32/shell32_main.h b/dll/win32/shell32/shell32_main.h index 7c6d8643c60..d3274f17515 100644 --- a/dll/win32/shell32/shell32_main.h +++ b/dll/win32/shell32/shell32_main.h @@ -53,7 +53,6 @@ BOOL HCR_GetIconA(LPCSTR szClass, LPSTR szDest, LPCSTR sName, DWORD len, int* pi BOOL HCR_GetClassNameA(REFIID riid, LPSTR szDest, DWORD len); BOOL HCR_GetFolderAttributes(LPCITEMIDLIST pidlFolder, LPDWORD dwAttributes); -INT_PTR CALLBACK AboutDlgProc(HWND,UINT,WPARAM,LPARAM); DWORD WINAPI ParseFieldA(LPCSTR src, DWORD nField, LPSTR dst, DWORD len); DWORD WINAPI ParseFieldW(LPCWSTR src, DWORD nField, LPWSTR dst, DWORD len); @@ -173,11 +172,6 @@ static LPWSTR __inline __SHCloneStrAtoW(WCHAR **target, const char *source) #define HINSTANCE_32(h16) ((HINSTANCE)(ULONG_PTR)(h16)) #define HINSTANCE_16(h32) (LOWORD(h32)) -typedef UINT_PTR (*SHELL_ExecuteW32)(const WCHAR *lpCmd, WCHAR *env, BOOL shWait, - const SHELLEXECUTEINFOW *sei, LPSHELLEXECUTEINFOW sei_out); - -BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc); - extern WCHAR swShell32Name[MAX_PATH]; BOOL UNIXFS_is_rooted_at_desktop(void); diff --git a/dll/win32/shell32/shellpath.cpp b/dll/win32/shell32/shellpath.cpp index de7e7e72ef7..7d2c2f0d8bb 100644 --- a/dll/win32/shell32/shellpath.cpp +++ b/dll/win32/shell32/shellpath.cpp @@ -1171,6 +1171,11 @@ static HRESULT _SHGetUserProfilePath(HANDLE hToken, DWORD dwFlags, BYTE folder, if (dwFlags & SHGFP_TYPE_DEFAULT) { + if (hToken != NULL && hToken != (HANDLE)-1) + { + FIXME("unsupported for user other than current or default\n"); + return E_FAIL; + } hr = _SHGetDefaultValue(folder, pszPath); } else diff --git a/dll/win32/shell32/shlexec.cpp b/dll/win32/shell32/shlexec.cpp index 7adbd0d0e03..41bae156ee3 100644 --- a/dll/win32/shell32/shlexec.cpp +++ b/dll/win32/shell32/shlexec.cpp @@ -28,6 +28,9 @@ static const WCHAR wszExe[] = L".exe"; #define SEE_MASK_CLASSALL (SEE_MASK_CLASSNAME | SEE_MASK_CLASSKEY) +typedef UINT_PTR (*SHELL_ExecuteW32)(const WCHAR *lpCmd, WCHAR *env, BOOL shWait, + const SHELLEXECUTEINFOW *sei, LPSHELLEXECUTEINFOW sei_out); + static void ParseNoTildeEffect(PWSTR &res, LPCWSTR &args, DWORD &len, DWORD &used, int argNum) { bool firstCharQuote = false; @@ -382,7 +385,12 @@ static BOOL SHELL_ArgifyW(WCHAR* out, DWORD len, const WCHAR* fmt, const WCHAR* } } - *res = '\0'; + used++; + if (res - out < static_cast(len)) + *res = '\0'; + else + out[len-1] = '\0'; + TRACE("used %i of %i space\n", used, len); if (out_len) *out_len = used; @@ -451,8 +459,8 @@ static UINT_PTR SHELL_ExecuteW(const WCHAR *lpCmd, WCHAR *env, BOOL shWait, startup.dwFlags = STARTF_USESHOWWINDOW; startup.wShowWindow = psei->nShow; dwCreationFlags = CREATE_UNICODE_ENVIRONMENT; - if (psei->fMask & SEE_MASK_NO_CONSOLE) - dwCreationFlags |= CREATE_NEW_CONSOLE; + if (!(psei->fMask & SEE_MASK_NO_CONSOLE)) + dwCreationFlags |= CREATE_NEW_CONSOLE; startup.lpTitle = (LPWSTR)(psei->fMask & (SEE_MASK_HASLINKNAME | SEE_MASK_HASTITLE) ? psei->lpClass : NULL); if (psei->fMask & SEE_MASK_HASLINKNAME) @@ -589,28 +597,46 @@ end: return found; } -static UINT SHELL_FindExecutableByOperation(LPCWSTR lpOperation, LPWSTR key, LPWSTR filetype, LPWSTR command, LONG commandlen) +/************************************************************************* + * SHELL_FindExecutableByVerb [Internal] + * + * called from SHELL_FindExecutable or SHELL_execute_class + * in/out: + * classname a buffer, big enough, to get the key name to do actually the + * command "WordPad.Document.1\\shell\\open\\command" + * passed as "WordPad.Document.1" + * in: + * lpVerb the operation on it (open) + * commandlen the size of command buffer (in bytes) + * out: + * command a buffer, to store the command to do the + * operation on the file + * key a buffer, big enough, to get the key name to do actually the + * command "WordPad.Document.1\\shell\\open\\command" + * Can be NULL + */ +static UINT SHELL_FindExecutableByVerb(LPCWSTR lpVerb, LPWSTR key, LPWSTR classname, LPWSTR command, LONG commandlen) { static const WCHAR wCommand[] = L"\\command"; HKEY hkeyClass; WCHAR verb[MAX_PATH]; - if (RegOpenKeyExW(HKEY_CLASSES_ROOT, filetype, 0, 0x02000000, &hkeyClass)) + if (RegOpenKeyExW(HKEY_CLASSES_ROOT, classname, 0, 0x02000000, &hkeyClass)) return SE_ERR_NOASSOC; - if (!HCR_GetDefaultVerbW(hkeyClass, lpOperation, verb, sizeof(verb) / sizeof(verb[0]))) + if (!HCR_GetDefaultVerbW(hkeyClass, lpVerb, verb, sizeof(verb) / sizeof(verb[0]))) return SE_ERR_NOASSOC; RegCloseKey(hkeyClass); /* Looking for ...buffer\shell\\command */ - wcscat(filetype, L"\\shell\\"); - wcscat(filetype, verb); - wcscat(filetype, wCommand); + wcscat(classname, L"\\shell\\"); + wcscat(classname, verb); + wcscat(classname, wCommand); - if (RegQueryValueW(HKEY_CLASSES_ROOT, filetype, command, + if (RegQueryValueW(HKEY_CLASSES_ROOT, classname, command, &commandlen) == ERROR_SUCCESS) { commandlen /= sizeof(WCHAR); - if (key) wcscpy(key, filetype); + if (key) wcscpy(key, classname); #if 0 LPWSTR tmp; WCHAR param[256]; @@ -624,10 +650,10 @@ static UINT SHELL_FindExecutableByOperation(LPCWSTR lpOperation, LPWSTR key, LPW */ /* Get the parameters needed by the application from the associated ddeexec key */ - tmp = strstrW(filetype, wCommand); + tmp = strstrW(classname, wCommand); tmp[0] = '\0'; - wcscat(filetype, wDdeexec); - if (RegQueryValueW(HKEY_CLASSES_ROOT, filetype, param, + wcscat(classname, wDdeexec); + if (RegQueryValueW(HKEY_CLASSES_ROOT, classname, param, ¶mlen) == ERROR_SUCCESS) { paramlen /= sizeof(WCHAR); @@ -651,7 +677,7 @@ static UINT SHELL_FindExecutableByOperation(LPCWSTR lpOperation, LPWSTR key, LPW * Utility for code sharing between FindExecutable and ShellExecute * in: * lpFile the name of a file - * lpOperation the operation on it (open) + * lpVerb the operation on it (open) * out: * lpResult a buffer, big enough :-(, to store the command to do the * operation on the file @@ -659,12 +685,12 @@ static UINT SHELL_FindExecutableByOperation(LPCWSTR lpOperation, LPWSTR key, LPW * command (it'll be used afterwards for more information * on the operation) */ -static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation, +static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpVerb, LPWSTR lpResult, DWORD resultLen, LPWSTR key, WCHAR **env, LPITEMIDLIST pidl, LPCWSTR args) { WCHAR *extension = NULL; /* pointer to file extension */ - WCHAR filetype[256]; /* registry name for this filetype */ - LONG filetypelen = sizeof(filetype); /* length of above */ + WCHAR classname[256]; /* registry name for this file type */ + LONG classnamelen = sizeof(classname); /* length of above */ WCHAR command[1024]; /* command from registry */ WCHAR wBuffer[256]; /* Used to GetProfileString */ UINT retval = SE_ERR_NOASSOC; @@ -699,7 +725,7 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOpera { TRACE("SearchPathW returned non-zero\n"); lpFile = xlpFile; - /* Hey, isn't this value ignored? Why make this call? Shouldn't we return here? --dank*/ + /* The file was found in the application-supplied default directory (or the system search path) */ } else if (lpPath && SearchPathW(NULL, lpFile, wszExe, sizeof(xlpFile)/sizeof(WCHAR), xlpFile, NULL)) { @@ -707,12 +733,11 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOpera lpFile = xlpFile; /* The file was found in one of the directories in the system-wide search path */ } - + attribs = GetFileAttributesW(lpFile); if (attribs != INVALID_FILE_ATTRIBUTES && (attribs & FILE_ATTRIBUTE_DIRECTORY)) { - wcscpy(filetype, L"Folder"); - filetypelen = 6; /* strlen("Folder") */ + wcscpy(classname, L"Folder"); } else { @@ -736,7 +761,7 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOpera /* Three places to check: */ /* 1. win.ini, [windows], programs (NB no leading '.') */ - /* 2. Registry, HKEY_CLASS_ROOT\\shell\open\command */ + /* 2. Registry, HKEY_CLASS_ROOT\\shell\open\command */ /* 3. win.ini, [extensions], extension (NB no leading '.' */ /* All I know of the order is that registry is checked before */ /* extensions; however, it'd make sense to check the programs */ @@ -773,28 +798,26 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOpera } /* Check registry */ - if (RegQueryValueW(HKEY_CLASSES_ROOT, extension, filetype, - &filetypelen) == ERROR_SUCCESS) + if (RegQueryValueW(HKEY_CLASSES_ROOT, extension, classname, + &classnamelen) == ERROR_SUCCESS) { - filetypelen /= sizeof(WCHAR); - if (filetypelen == sizeof(filetype) / sizeof(WCHAR)) - filetypelen--; + classnamelen /= sizeof(WCHAR); + if (classnamelen == sizeof(classname) / sizeof(WCHAR)) + classnamelen--; - filetype[filetypelen] = '\0'; - TRACE("File type: %s\n", debugstr_w(filetype)); + classname[classnamelen] = '\0'; + TRACE("File type: %s\n", debugstr_w(classname)); } else { - *filetype = '\0'; - filetypelen = 0; + *classname = '\0'; } } - if (*filetype) + if (*classname) { - /* pass the operation string to SHELL_FindExecutableByOperation() */ - filetype[filetypelen] = '\0'; - retval = SHELL_FindExecutableByOperation(lpOperation, key, filetype, command, sizeof(command)); + /* pass the verb string to SHELL_FindExecutableByVerb() */ + retval = SHELL_FindExecutableByVerb(lpVerb, key, classname, command, sizeof(command)); if (retval > 32) { @@ -882,20 +905,34 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec { WCHAR regkey[256]; WCHAR * endkey = regkey + wcslen(key); - WCHAR app[256], topic[256], ifexec[256], res[256]; + WCHAR app[256], topic[256], ifexec[256], static_res[256]; + WCHAR * dynamic_res=NULL; + WCHAR * res; LONG applen, topiclen, ifexeclen; WCHAR * exec; DWORD ddeInst = 0; DWORD tid; - DWORD resultLen; + DWORD resultLen, endkeyLen; HSZ hszApp, hszTopic; HCONV hConv; HDDEDATA hDdeData; unsigned ret = SE_ERR_NOASSOC; BOOL unicode = !(GetVersion() & 0x80000000); + if (strlenW(key) + 1 > sizeof(regkey) / sizeof(regkey[0])) + { + FIXME("input parameter %s larger than buffer\n", debugstr_w(key)); + return 2; + } wcscpy(regkey, key); - wcscpy(endkey, L"\\application"); + static const WCHAR wApplication[] = L"\\application"; + endkeyLen = sizeof(regkey) / sizeof(regkey[0]) - (endkey - regkey); + if (strlenW(wApplication) + 1 > endkeyLen) + { + FIXME("endkey %s overruns buffer\n", debugstr_w(wApplication)); + return 2; + } + wcscpy(endkey, wApplication); applen = sizeof(app); if (RegQueryValueW(HKEY_CLASSES_ROOT, regkey, app, &applen) != ERROR_SUCCESS) { @@ -908,6 +945,12 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec /* Get application command from start string and find filename of application */ if (*start == '"') { + if (strlenW(start + 1) + 1 > sizeof(command) / sizeof(command[0])) + { + FIXME("size of input parameter %s larger than buffer\n", + debugstr_w(start + 1)); + return 2; + } wcscpy(command, start + 1); if ((ptr = wcschr(command, '"'))) * ptr = 0; @@ -915,8 +958,9 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec } else { - LPWSTR p, space; - for (p = (LPWSTR)start; (space = const_cast(strchrW(p, ' '))); p = space + 1) + LPCWSTR p; + LPWSTR space; + for (p = start; (space = const_cast(strchrW(p, ' '))); p = space + 1) { int idx = space - start; memcpy(command, start, idx * sizeof(WCHAR)); @@ -933,6 +977,11 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec ERR("Unable to find application path for command %s\n", debugstr_w(start)); return ERROR_ACCESS_DENIED; } + if (strlenW(ptr) + 1 > sizeof(app) / sizeof(app[0])) + { + FIXME("size of found path %s larger than buffer\n", debugstr_w(ptr)); + return 2; + } wcscpy(app, ptr); /* Remove extensions (including .so) */ @@ -946,7 +995,13 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec *ptr = 0; } - wcscpy(endkey, L"\\topic"); + static const WCHAR wTopic[] = L"\\topic"; + if (strlenW(wTopic) + 1 > endkeyLen) + { + FIXME("endkey %s overruns buffer\n", debugstr_w(wTopic)); + return 2; + } + wcscpy(endkey, wTopic); topiclen = sizeof(topic); if (RegQueryValueW(HKEY_CLASSES_ROOT, regkey, topic, &topiclen) != ERROR_SUCCESS) { @@ -986,7 +1041,13 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec SetLastError(ERROR_DDE_FAIL); return 30; /* whatever */ } - strcpyW(endkey, L"\\ifexec"); + static const WCHAR wIfexec[] = L"\\ifexec"; + if (strlenW(wIfexec) + 1 > endkeyLen) + { + FIXME("endkey %s overruns buffer\n", debugstr_w(wIfexec)); + return 2; + } + strcpyW(endkey, wIfexec); ifexeclen = sizeof(ifexec); if (RegQueryValueW(HKEY_CLASSES_ROOT, regkey, ifexec, &ifexeclen) == ERROR_SUCCESS) { @@ -994,9 +1055,14 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec } } - SHELL_ArgifyW(res, sizeof(res) / sizeof(WCHAR), exec, lpFile, pidl, szCommandline, &resultLen); - if (resultLen > sizeof(res) / sizeof(WCHAR)) - ERR("Argify buffer not large enough, truncated\n"); + SHELL_ArgifyW(static_res, sizeof(static_res)/sizeof(WCHAR), exec, lpFile, pidl, szCommandline, &resultLen); + if (resultLen > sizeof(static_res)/sizeof(WCHAR)) + { + res = dynamic_res = static_cast(HeapAlloc(GetProcessHeap(), 0, resultLen * sizeof(WCHAR))); + SHELL_ArgifyW(dynamic_res, resultLen, exec, lpFile, pidl, szCommandline, NULL); + } + else + res = static_res; TRACE("%s %s => %s\n", debugstr_w(exec), debugstr_w(lpFile), debugstr_w(res)); /* It's documented in the KB 330337 that IE has a bug and returns @@ -1019,6 +1085,8 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec WARN("DdeClientTransaction failed with error %04x\n", DdeGetLastError(ddeInst)); ret = 33; + HeapFree(GetProcessHeap(), 0, dynamic_res); + DdeDisconnect(hConv); error: @@ -1296,7 +1364,7 @@ static HRESULT shellex_run_context_menu_default(IShellExtInit *obj, memset(&ici, 0, sizeof ici); ici.cbSize = sizeof ici; - ici.fMask = CMIC_MASK_UNICODE | (sei->fMask & (SEE_MASK_NOASYNC | SEE_MASK_ASYNCOK | SEE_MASK_FLAG_NO_UI)); + ici.fMask = CMIC_MASK_UNICODE | (sei->fMask & (SEE_MASK_NO_CONSOLE | SEE_MASK_NOASYNC | SEE_MASK_ASYNCOK | SEE_MASK_FLAG_NO_UI)); ici.nShow = sei->nShow; ici.lpVerb = MAKEINTRESOURCEA(def); ici.hwnd = sei->hwnd; @@ -1411,34 +1479,61 @@ static LONG ShellExecute_FromContextMenu( LPSHELLEXECUTEINFOW sei ) return r; } +static UINT_PTR SHELL_quote_and_execute(LPCWSTR wcmd, LPCWSTR wszParameters, LPCWSTR lpstrProtocol, LPCWSTR wszApplicationName, LPWSTR env, LPSHELLEXECUTEINFOW psei, LPSHELLEXECUTEINFOW psei_out, SHELL_ExecuteW32 execfunc); + static UINT_PTR SHELL_execute_class(LPCWSTR wszApplicationName, LPSHELLEXECUTEINFOW psei, LPSHELLEXECUTEINFOW psei_out, SHELL_ExecuteW32 execfunc) { - WCHAR execCmd[1024], wcmd[1024]; + WCHAR execCmd[1024], classname[1024]; /* launch a document by fileclass like 'WordPad.Document.1' */ /* the Commandline contains 'c:\Path\wordpad.exe "%1"' */ /* FIXME: wcmd should not be of a fixed size. Fixed to 1024, MAX_PATH is way too short! */ ULONG cmask = (psei->fMask & SEE_MASK_CLASSALL); DWORD resultLen; BOOL done; + UINT_PTR rslt; - HCR_GetExecuteCommandW((cmask == SEE_MASK_CLASSKEY) ? psei->hkeyClass : NULL, - (cmask == SEE_MASK_CLASSNAME) ? psei->lpClass : NULL, - psei->lpVerb, - execCmd, sizeof(execCmd)); - - /* FIXME: get the extension of lpFile, check if it fits to the lpClass */ - TRACE("SEE_MASK_CLASSNAME->%s, doc->%s\n", debugstr_w(execCmd), debugstr_w(wszApplicationName)); - - wcmd[0] = '\0'; - done = SHELL_ArgifyW(wcmd, sizeof(wcmd) / sizeof(WCHAR), execCmd, wszApplicationName, (LPITEMIDLIST)psei->lpIDList, NULL, &resultLen); - if (!done && wszApplicationName[0]) + /* FIXME: remove following block when SHELL_quote_and_execute supports hkeyClass parameter */ + if (cmask != SEE_MASK_CLASSNAME) { - strcatW(wcmd, L" "); - strcatW(wcmd, wszApplicationName); + WCHAR wcmd[1024]; + HCR_GetExecuteCommandW((cmask == SEE_MASK_CLASSKEY) ? psei->hkeyClass : NULL, + (cmask == SEE_MASK_CLASSNAME) ? psei->lpClass : NULL, + psei->lpVerb, + execCmd, sizeof(execCmd)); + + /* FIXME: get the extension of lpFile, check if it fits to the lpClass */ + TRACE("SEE_MASK_CLASSNAME->%s, doc->%s\n", debugstr_w(execCmd), debugstr_w(wszApplicationName)); + + wcmd[0] = '\0'; + done = SHELL_ArgifyW(wcmd, sizeof(wcmd) / sizeof(WCHAR), execCmd, wszApplicationName, (LPITEMIDLIST)psei->lpIDList, NULL, &resultLen); + if (!done && wszApplicationName[0]) + { + strcatW(wcmd, L" "); + if (*wszApplicationName != '"') + { + strcatW(wcmd, L"\""); + strcatW(wcmd, wszApplicationName); + strcatW(wcmd, L"\""); + } + else + strcatW(wcmd, wszApplicationName); + } + if (resultLen > sizeof(wcmd) / sizeof(WCHAR)) + ERR("Argify buffer not large enough... truncating\n"); + return execfunc(wcmd, NULL, FALSE, psei, psei_out); } - if (resultLen > sizeof(wcmd) / sizeof(WCHAR)) - ERR("Argify buffer not large enough... truncating\n"); - return execfunc(wcmd, NULL, FALSE, psei, psei_out); + + strcpyW(classname, psei->lpClass); + rslt = SHELL_FindExecutableByVerb(psei->lpVerb, NULL, classname, execCmd, sizeof(execCmd)); + + TRACE("SHELL_FindExecutableByVerb returned %u (%s, %s)\n", (unsigned int)rslt, debugstr_w(classname), debugstr_w(execCmd)); + if (33 > rslt) + return rslt; + rslt = SHELL_quote_and_execute( execCmd, L"", classname, + wszApplicationName, NULL, psei, + psei_out, execfunc ); + return rslt; + } static BOOL SHELL_translate_idlist(LPSHELLEXECUTEINFOW sei, LPWSTR wszParameters, DWORD parametersLen, LPWSTR wszApplicationName, DWORD dwApplicationNameLen) @@ -1448,7 +1543,7 @@ static BOOL SHELL_translate_idlist(LPSHELLEXECUTEINFOW sei, LPWSTR wszParameters BOOL appKnownSingular = FALSE; /* last chance to translate IDList: now also allow CLSID paths */ - if (SUCCEEDED(SHELL_GetPathFromIDListForExecuteW((LPCITEMIDLIST)sei->lpIDList, buffer, sizeof(buffer)))) { + if (SUCCEEDED(SHELL_GetPathFromIDListForExecuteW((LPCITEMIDLIST)sei->lpIDList, buffer, sizeof(buffer)/sizeof(WCHAR)))) { if (buffer[0] == ':' && buffer[1] == ':') { /* open shell folder for the specified class GUID */ if (strlenW(buffer) + 1 > parametersLen) @@ -1487,7 +1582,7 @@ static BOOL SHELL_translate_idlist(LPSHELLEXECUTEINFOW sei, LPWSTR wszParameters return appKnownSingular; } -static UINT_PTR SHELL_quote_and_execute(LPCWSTR wcmd, LPCWSTR wszParameters, LPCWSTR lpstrProtocol, LPCWSTR wszApplicationName, LPWSTR env, LPSHELLEXECUTEINFOW psei, LPSHELLEXECUTEINFOW psei_out, SHELL_ExecuteW32 execfunc) +static UINT_PTR SHELL_quote_and_execute(LPCWSTR wcmd, LPCWSTR wszParameters, LPCWSTR wszKeyname, LPCWSTR wszApplicationName, LPWSTR env, LPSHELLEXECUTEINFOW psei, LPSHELLEXECUTEINFOW psei_out, SHELL_ExecuteW32 execfunc) { UINT_PTR retval; DWORD len; @@ -1513,17 +1608,17 @@ static UINT_PTR SHELL_quote_and_execute(LPCWSTR wcmd, LPCWSTR wszParameters, LPC strcatW(wszQuotedCmd, wszParameters); } - TRACE("%s/%s => %s/%s\n", debugstr_w(wszApplicationName), debugstr_w(psei->lpVerb), debugstr_w(wszQuotedCmd), debugstr_w(lpstrProtocol)); + TRACE("%s/%s => %s/%s\n", debugstr_w(wszApplicationName), debugstr_w(psei->lpVerb), debugstr_w(wszQuotedCmd), debugstr_w(wszKeyname)); - if (*lpstrProtocol) - retval = execute_from_key(lpstrProtocol, wszApplicationName, env, psei->lpParameters, wcmd, execfunc, psei, psei_out); + if (*wszKeyname) + retval = execute_from_key(wszKeyname, wszApplicationName, env, psei->lpParameters, wcmd, execfunc, psei, psei_out); else retval = execfunc(wszQuotedCmd, env, FALSE, psei, psei_out); HeapFree(GetProcessHeap(), 0, wszQuotedCmd); return retval; } -static UINT_PTR SHELL_execute_url(LPCWSTR lpFile, LPCWSTR wFile, LPCWSTR wcmd, LPSHELLEXECUTEINFOW psei, LPSHELLEXECUTEINFOW psei_out, SHELL_ExecuteW32 execfunc) +static UINT_PTR SHELL_execute_url(LPCWSTR lpFile, LPCWSTR wcmd, LPSHELLEXECUTEINFOW psei, LPSHELLEXECUTEINFOW psei_out, SHELL_ExecuteW32 execfunc) { static const WCHAR wShell[] = L"\\shell\\"; static const WCHAR wCommand[] = L"\\command"; @@ -1540,9 +1635,9 @@ static UINT_PTR SHELL_execute_url(LPCWSTR lpFile, LPCWSTR wFile, LPCWSTR wcmd, L iSize = strlenW(lpFile); TRACE("Got URL: %s\n", debugstr_w(lpFile)); - /* Looking for ...protocol\shell\lpOperation\command */ + /* Looking for ...\shell\\command */ len = iSize + lstrlenW(wShell) + lstrlenW(wCommand) + 1; - if (psei->lpVerb) + if (psei->lpVerb && *psei->lpVerb) len += lstrlenW(psei->lpVerb); else len += lstrlenW(wszOpen); @@ -1550,23 +1645,16 @@ static UINT_PTR SHELL_execute_url(LPCWSTR lpFile, LPCWSTR wFile, LPCWSTR wcmd, L memcpy(lpstrProtocol, lpFile, iSize * sizeof(WCHAR)); lpstrProtocol[iSize] = '\0'; strcatW(lpstrProtocol, wShell); - strcatW(lpstrProtocol, psei->lpVerb ? psei->lpVerb : wszOpen); + strcatW(lpstrProtocol, psei->lpVerb && *psei->lpVerb ? psei->lpVerb : wszOpen); strcatW(lpstrProtocol, wCommand); - /* Remove File Protocol from lpFile */ - /* In the case file://path/file */ - if (!strncmpiW(lpFile, wFile, iSize)) - { - lpFile += iSize; - while (*lpFile == ':') lpFile++; - } retval = execute_from_key(lpstrProtocol, lpFile, NULL, psei->lpParameters, wcmd, execfunc, psei, psei_out); HeapFree(GetProcessHeap(), 0, lpstrProtocol); return retval; } -void do_error_dialog(UINT_PTR retval, HWND hwnd, WCHAR* filename) +static void do_error_dialog(UINT_PTR retval, HWND hwnd, WCHAR* filename) { WCHAR msg[2048]; DWORD_PTR msgArguments[3] = { (DWORD_PTR)filename, 0, 0 }; @@ -1591,7 +1679,7 @@ void do_error_dialog(UINT_PTR retval, HWND hwnd, WCHAR* filename) /************************************************************************* * SHELL_execute [Internal] */ -BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc) +static BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc) { static const DWORD unsupportedFlags = SEE_MASK_INVOKEIDLIST | SEE_MASK_ICON | SEE_MASK_HOTKEY | @@ -1608,7 +1696,7 @@ BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc) SHELLEXECUTEINFOW sei_tmp; /* modifiable copy of SHELLEXECUTEINFO struct */ WCHAR wfileName[MAX_PATH]; WCHAR *env; - WCHAR lpstrProtocol[256]; + WCHAR wszKeyname[256]; LPCWSTR lpFile; UINT_PTR retval = SE_ERR_NOASSOC; BOOL appKnownSingular = FALSE; @@ -1747,6 +1835,7 @@ BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc) Info.oaifInFlags = OAIF_ALLOW_REGISTRATION | OAIF_EXEC; //if (SHOpenWithDialog(sei_tmp.hwnd, &Info) != S_OK) + DBG_UNREFERENCED_LOCAL_VARIABLE(Info); do_error_dialog(retval, sei_tmp.hwnd, wszApplicationName); } HeapFree(GetProcessHeap(), 0, wszApplicationName); @@ -1766,36 +1855,40 @@ BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc) dwApplicationNameLen ); } - /* expand environment strings */ - len = ExpandEnvironmentStringsW(sei_tmp.lpFile, NULL, 0); - if (len > 0) + /* convert file URLs */ + if (UrlIsFileUrlW(sei_tmp.lpFile)) { LPWSTR buf; - buf = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR)); + DWORD size; + + size = MAX_PATH; + buf = static_cast(HeapAlloc(GetProcessHeap(), 0, size * sizeof(WCHAR))); + if (!buf || FAILED(PathCreateFromUrlW(sei_tmp.lpFile, buf, &size, 0))) + { + HeapFree(GetProcessHeap(), 0, buf); + return SE_ERR_OOM; + } - ExpandEnvironmentStringsW(sei_tmp.lpFile, buf, len + 1); HeapFree(GetProcessHeap(), 0, wszApplicationName); - dwApplicationNameLen = len + 1; + dwApplicationNameLen = lstrlenW(buf) + 1; wszApplicationName = buf; - /* appKnownSingular unmodified */ - sei_tmp.lpFile = wszApplicationName; } - - if (*sei_tmp.lpParameters) + else /* or expand environment strings (not both!) */ { - len = ExpandEnvironmentStringsW(sei_tmp.lpParameters, NULL, 0); + len = ExpandEnvironmentStringsW(sei_tmp.lpFile, NULL, 0); if (len > 0) { LPWSTR buf; - len++; - buf = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); - ExpandEnvironmentStringsW(sei_tmp.lpParameters, buf, len); - if (wszParameters != parametersBuffer) - HeapFree(GetProcessHeap(), 0, wszParameters); - wszParameters = buf; - parametersLen = len; - sei_tmp.lpParameters = wszParameters; + buf = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR)); + + ExpandEnvironmentStringsW(sei_tmp.lpFile, buf, len + 1); + HeapFree(GetProcessHeap(), 0, wszApplicationName); + dwApplicationNameLen = len + 1; + wszApplicationName = buf; + /* appKnownSingular unmodified */ + + sei_tmp.lpFile = wszApplicationName; } } @@ -1849,6 +1942,7 @@ BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc) /* terminate previous command string after the quote character */ *end = L'\0'; + lpFile = wfileName; } else { @@ -1880,13 +1974,11 @@ BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc) } } - lstrcpynW(wfileName, sei_tmp.lpFile, sizeof(wfileName) / sizeof(WCHAR)); + lpFile = sei_tmp.lpFile; } } else - lstrcpynW(wfileName, sei_tmp.lpFile, sizeof(wfileName) / sizeof(WCHAR)); - - lpFile = wfileName; + lpFile = sei_tmp.lpFile; wcmd = wcmdBuffer; len = lstrlenW(wszApplicationName) + 3; @@ -1919,10 +2011,10 @@ BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc) /* Else, try to find the executable */ wcmd[0] = L'\0'; - retval = SHELL_FindExecutable(sei_tmp.lpDirectory, lpFile, sei_tmp.lpVerb, wcmd, wcmdLen, lpstrProtocol, &env, (LPITEMIDLIST)sei_tmp.lpIDList, sei_tmp.lpParameters); + retval = SHELL_FindExecutable(sei_tmp.lpDirectory, lpFile, sei_tmp.lpVerb, wcmd, wcmdLen, wszKeyname, &env, (LPITEMIDLIST)sei_tmp.lpIDList, sei_tmp.lpParameters); if (retval > 32) /* Found */ { - retval = SHELL_quote_and_execute(wcmd, wszParameters, lpstrProtocol, + retval = SHELL_quote_and_execute(wcmd, wszParameters, wszKeyname, wszApplicationName, env, &sei_tmp, sei, execfunc); HeapFree(GetProcessHeap(), 0, env); @@ -1941,7 +2033,7 @@ BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc) { swprintf(lpQuotedFile, L"\"%s\"", lpFile); retval = SHELL_quote_and_execute(wExec, lpQuotedFile, - lpstrProtocol, + wszKeyname, wszApplicationName, env, &sei_tmp, sei, execfunc); HeapFree(GetProcessHeap(), 0, env); @@ -1953,12 +2045,12 @@ BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc) } else if (PathIsURLW(lpFile)) /* File not found, check for URL */ { - retval = SHELL_execute_url(lpFile, L"file", wcmd, &sei_tmp, sei, execfunc ); + retval = SHELL_execute_url(lpFile, wcmd, &sei_tmp, sei, execfunc ); } /* Check if file specified is in the form www.??????.*** */ else if (!strncmpiW(lpFile, L"www", 3)) { - /* if so, append lpFile http:// and call ShellExecute */ + /* if so, prefix lpFile with http:// and call ShellExecute */ WCHAR lpstrTmpFile[256]; strcpyW(lpstrTmpFile, L"http://"); strcatW(lpstrTmpFile, lpFile); @@ -1979,6 +2071,7 @@ BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc) Info.oaifInFlags = OAIF_ALLOW_REGISTRATION | OAIF_EXEC; //if (SHOpenWithDialog(sei_tmp.hwnd, &Info) != S_OK) + DBG_UNREFERENCED_LOCAL_VARIABLE(Info); do_error_dialog(retval, sei_tmp.hwnd, wszApplicationName); } @@ -1998,19 +2091,19 @@ BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc) /************************************************************************* * ShellExecuteA [SHELL32.290] */ -HINSTANCE WINAPI ShellExecuteA(HWND hWnd, LPCSTR lpOperation, LPCSTR lpFile, +HINSTANCE WINAPI ShellExecuteA(HWND hWnd, LPCSTR lpVerb, LPCSTR lpFile, LPCSTR lpParameters, LPCSTR lpDirectory, INT iShowCmd) { SHELLEXECUTEINFOA sei; TRACE("%p,%s,%s,%s,%s,%d\n", - hWnd, debugstr_a(lpOperation), debugstr_a(lpFile), + hWnd, debugstr_a(lpVerb), debugstr_a(lpFile), debugstr_a(lpParameters), debugstr_a(lpDirectory), iShowCmd); sei.cbSize = sizeof(sei); sei.fMask = SEE_MASK_FLAG_NO_UI; sei.hwnd = hWnd; - sei.lpVerb = lpOperation; + sei.lpVerb = lpVerb; sei.lpFile = lpFile; sei.lpParameters = lpParameters; sei.lpDirectory = lpDirectory; @@ -2090,10 +2183,10 @@ ShellExecuteExW(LPSHELLEXECUTEINFOW sei) /************************************************************************* * ShellExecuteW [SHELL32.294] * from shellapi.h - * WINSHELLAPI HINSTANCE APIENTRY ShellExecuteW(HWND hwnd, LPCWSTR lpOperation, + * WINSHELLAPI HINSTANCE APIENTRY ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, * LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd); */ -HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpOperation, LPCWSTR lpFile, +HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd) { SHELLEXECUTEINFOW sei; @@ -2102,7 +2195,7 @@ HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpOperation, LPCWSTR lpFile, sei.cbSize = sizeof(sei); sei.fMask = SEE_MASK_FLAG_NO_UI; sei.hwnd = hwnd; - sei.lpVerb = lpOperation; + sei.lpVerb = lpVerb; sei.lpFile = lpFile; sei.lpParameters = lpParameters; sei.lpDirectory = lpDirectory; @@ -2122,14 +2215,14 @@ HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpOperation, LPCWSTR lpFile, * * FIXME: the callback function most likely doesn't work the same way on Windows. */ -EXTERN_C HINSTANCE WINAPI WOWShellExecute(HWND hWnd, LPCSTR lpOperation, LPCSTR lpFile, +EXTERN_C HINSTANCE WINAPI WOWShellExecute(HWND hWnd, LPCSTR lpVerb, LPCSTR lpFile, LPCSTR lpParameters, LPCSTR lpDirectory, INT iShowCmd, void *callback) { SHELLEXECUTEINFOW seiW; WCHAR *wVerb = NULL, *wFile = NULL, *wParameters = NULL, *wDirectory = NULL; HANDLE hProcess = 0; - seiW.lpVerb = lpOperation ? __SHCloneStrAtoW(&wVerb, lpOperation) : NULL; + seiW.lpVerb = lpVerb ? __SHCloneStrAtoW(&wVerb, lpVerb) : NULL; seiW.lpFile = lpFile ? __SHCloneStrAtoW(&wFile, lpFile) : NULL; seiW.lpParameters = lpParameters ? __SHCloneStrAtoW(&wParameters, lpParameters) : NULL; seiW.lpDirectory = lpDirectory ? __SHCloneStrAtoW(&wDirectory, lpDirectory) : NULL; diff --git a/dll/win32/shell32/vista.c b/dll/win32/shell32/vista.c new file mode 100644 index 00000000000..93ec06c07b4 --- /dev/null +++ b/dll/win32/shell32/vista.c @@ -0,0 +1,220 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: Copied from advapi32/reg/reg.c + * PURPOSE: Registry functions + * PROGRAMMER: Ariadne ( ariadne@xs4all.nl) + * Thomas Weidenmueller + * UPDATE HISTORY: + * Created 01/11/98 + * 19990309 EA Stubs + * 20050502 Fireball imported some stuff from WINE + */ + +/* FIXME: This file should go away once we properly handle Vista+ APIs */ + +#include + +#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + +#include +#include +#include +#include +#define NTOS_MODE_USER +#include + +#include +#include + +WINE_DEFAULT_DEBUG_CHANNEL(shell); + +/****************************************************************************** + * load_string [Internal] + * + * This is basically a copy of user32/resource.c's LoadStringW. Necessary to + * avoid importing user32, which is higher level than advapi32. Helper for + * RegLoadMUIString. + */ +static int load_string(HINSTANCE hModule, UINT resId, LPWSTR pwszBuffer, INT cMaxChars) +{ + HGLOBAL hMemory; + HRSRC hResource; + WCHAR *pString; + int idxString; + + /* Negative values have to be inverted. */ + if (HIWORD(resId) == 0xffff) + resId = (UINT)(-((INT)resId)); + + /* Load the resource into memory and get a pointer to it. */ + hResource = FindResourceW(hModule, MAKEINTRESOURCEW(LOWORD(resId >> 4) + 1), (LPWSTR)RT_STRING); + if (!hResource) return 0; + hMemory = LoadResource(hModule, hResource); + if (!hMemory) return 0; + pString = LockResource(hMemory); + + /* Strings are length-prefixed. Lowest nibble of resId is an index. */ + idxString = resId & 0xf; + while (idxString--) pString += *pString + 1; + + /* If no buffer is given, return length of the string. */ + if (!pwszBuffer) return *pString; + + /* Else copy over the string, respecting the buffer size. */ + cMaxChars = (*pString < cMaxChars) ? *pString : (cMaxChars - 1); + if (cMaxChars >= 0) + { + memcpy(pwszBuffer, pString+1, cMaxChars * sizeof(WCHAR)); + pwszBuffer[cMaxChars] = L'\0'; + } + + return cMaxChars; +} + +/************************************************************************ + * RegLoadMUIStringW + * + * @implemented + */ +LONG WINAPI +RegLoadMUIStringW(IN HKEY hKey, + IN LPCWSTR pszValue OPTIONAL, + OUT LPWSTR pszOutBuf, + IN DWORD cbOutBuf, + OUT LPDWORD pcbData OPTIONAL, + IN DWORD Flags, + IN LPCWSTR pszDirectory OPTIONAL) +{ + DWORD dwValueType, cbData; + LPWSTR pwszTempBuffer = NULL, pwszExpandedBuffer = NULL; + LONG result; + + /* Parameter sanity checks. */ + if (!hKey || !pszOutBuf) + return ERROR_INVALID_PARAMETER; + + if (pszDirectory && *pszDirectory) + { + FIXME("BaseDir parameter not yet supported!\n"); + return ERROR_INVALID_PARAMETER; + } + + /* Check for value existence and correctness of it's type, allocate a buffer and load it. */ + result = RegQueryValueExW(hKey, pszValue, NULL, &dwValueType, NULL, &cbData); + if (result != ERROR_SUCCESS) goto cleanup; + if (!(dwValueType == REG_SZ || dwValueType == REG_EXPAND_SZ) || !cbData) + { + result = ERROR_FILE_NOT_FOUND; + goto cleanup; + } + pwszTempBuffer = HeapAlloc(GetProcessHeap(), 0, cbData); + if (!pwszTempBuffer) + { + result = ERROR_NOT_ENOUGH_MEMORY; + goto cleanup; + } + result = RegQueryValueExW(hKey, pszValue, NULL, &dwValueType, (LPBYTE)pwszTempBuffer, &cbData); + if (result != ERROR_SUCCESS) goto cleanup; + + /* Expand environment variables, if appropriate, or copy the original string over. */ + if (dwValueType == REG_EXPAND_SZ) + { + cbData = ExpandEnvironmentStringsW(pwszTempBuffer, NULL, 0) * sizeof(WCHAR); + if (!cbData) goto cleanup; + pwszExpandedBuffer = HeapAlloc(GetProcessHeap(), 0, cbData); + if (!pwszExpandedBuffer) + { + result = ERROR_NOT_ENOUGH_MEMORY; + goto cleanup; + } + ExpandEnvironmentStringsW(pwszTempBuffer, pwszExpandedBuffer, cbData); + } + else + { + pwszExpandedBuffer = HeapAlloc(GetProcessHeap(), 0, cbData); + memcpy(pwszExpandedBuffer, pwszTempBuffer, cbData); + } + + /* If the value references a resource based string, parse the value and load the string. + * Else just copy over the original value. */ + result = ERROR_SUCCESS; + if (*pwszExpandedBuffer != L'@') /* '@' is the prefix for resource based string entries. */ + { + lstrcpynW(pszOutBuf, pwszExpandedBuffer, cbOutBuf / sizeof(WCHAR)); + } + else + { + WCHAR *pComma = wcsrchr(pwszExpandedBuffer, L','); + UINT uiStringId; + HMODULE hModule; + + /* Format of the expanded value is 'path_to_dll,-resId' */ + if (!pComma || pComma[1] != L'-') + { + result = ERROR_BADKEY; + goto cleanup; + } + + uiStringId = _wtoi(pComma+2); + *pComma = L'\0'; + + hModule = LoadLibraryExW(pwszExpandedBuffer + 1, NULL, LOAD_LIBRARY_AS_DATAFILE); + if (!hModule || !load_string(hModule, uiStringId, pszOutBuf, cbOutBuf / sizeof(WCHAR))) + result = ERROR_BADKEY; + FreeLibrary(hModule); + } + +cleanup: + HeapFree(GetProcessHeap(), 0, pwszTempBuffer); + HeapFree(GetProcessHeap(), 0, pwszExpandedBuffer); + return result; +} + +/************************************************************************ + * RegLoadMUIStringA + * + * @implemented + */ +LONG WINAPI +RegLoadMUIStringA(IN HKEY hKey, + IN LPCSTR pszValue OPTIONAL, + OUT LPSTR pszOutBuf, + IN DWORD cbOutBuf, + OUT LPDWORD pcbData OPTIONAL, + IN DWORD Flags, + IN LPCSTR pszDirectory OPTIONAL) +{ + UNICODE_STRING valueW, baseDirW; + WCHAR *pwszBuffer; + DWORD cbData = cbOutBuf * sizeof(WCHAR); + LONG result; + + valueW.Buffer = baseDirW.Buffer = pwszBuffer = NULL; + if (!RtlCreateUnicodeStringFromAsciiz(&valueW, pszValue) || + !RtlCreateUnicodeStringFromAsciiz(&baseDirW, pszDirectory) || + !(pwszBuffer = HeapAlloc(GetProcessHeap(), 0, cbData))) + { + result = ERROR_NOT_ENOUGH_MEMORY; + goto cleanup; + } + + result = RegLoadMUIStringW(hKey, valueW.Buffer, pwszBuffer, cbData, NULL, Flags, + baseDirW.Buffer); + + if (result == ERROR_SUCCESS) + { + cbData = WideCharToMultiByte(CP_ACP, 0, pwszBuffer, -1, pszOutBuf, cbOutBuf, NULL, NULL); + if (pcbData) + *pcbData = cbData; + } + +cleanup: + HeapFree(GetProcessHeap(), 0, pwszBuffer); + RtlFreeUnicodeString(&baseDirW); + RtlFreeUnicodeString(&valueW); + + return result; +} diff --git a/dll/win32/windowscodecs/regsvr.c b/dll/win32/windowscodecs/regsvr.c index 3a6bc60b0b7..0ca18c0be31 100644 --- a/dll/win32/windowscodecs/regsvr.c +++ b/dll/win32/windowscodecs/regsvr.c @@ -18,6 +18,8 @@ #include "wincodecs_private.h" +#include + /*********************************************************************** * interface for self-registering */ @@ -374,11 +376,11 @@ static HRESULT unregister_decoders(struct regsvr_decoder const *list) for (; res == ERROR_SUCCESS && list->clsid; ++list) { StringFromGUID2(list->clsid, buf, 39); - res = RegDeleteTreeW(coclass_key, buf); + res = SHDeleteKeyW(coclass_key, buf); if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; - res = RegDeleteTreeW(instance_key, buf); + res = SHDeleteKeyW(instance_key, buf); if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; } @@ -552,11 +554,11 @@ static HRESULT unregister_encoders(struct regsvr_encoder const *list) for (; res == ERROR_SUCCESS && list->clsid; ++list) { StringFromGUID2(list->clsid, buf, 39); - res = RegDeleteTreeW(coclass_key, buf); + res = SHDeleteKeyW(coclass_key, buf); if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; - res = RegDeleteTreeW(instance_key, buf); + res = SHDeleteKeyW(instance_key, buf); if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; } @@ -709,11 +711,11 @@ static HRESULT unregister_converters(struct regsvr_converter const *list) for (; res == ERROR_SUCCESS && list->clsid; ++list) { StringFromGUID2(list->clsid, buf, 39); - res = RegDeleteTreeW(coclass_key, buf); + res = SHDeleteKeyW(coclass_key, buf); if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; - res = RegDeleteTreeW(instance_key, buf); + res = SHDeleteKeyW(instance_key, buf); if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; } @@ -919,11 +921,11 @@ static HRESULT unregister_metadatareaders(struct regsvr_metadatareader const *li for (; res == ERROR_SUCCESS && list->clsid; ++list) { StringFromGUID2(list->clsid, buf, 39); - res = RegDeleteTreeW(coclass_key, buf); + res = SHDeleteKeyW(coclass_key, buf); if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; - res = RegDeleteTreeW(instance_key, buf); + res = SHDeleteKeyW(instance_key, buf); if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; } @@ -1094,11 +1096,11 @@ static HRESULT unregister_pixelformats(struct regsvr_pixelformat const *list) for (; res == ERROR_SUCCESS && list->clsid; ++list) { StringFromGUID2(list->clsid, buf, 39); - res = RegDeleteTreeW(coclass_key, buf); + res = SHDeleteKeyW(coclass_key, buf); if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; - res = RegDeleteTreeW(instance_key, buf); + res = SHDeleteKeyW(instance_key, buf); if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; } @@ -2009,14 +2011,14 @@ static HRESULT unregister_categories(const struct regsvr_category *list) for (; res == ERROR_SUCCESS && list->clsid; list++) { StringFromGUID2(list->clsid, buf, 39); - res = RegDeleteTreeW(instance_key, buf); + res = SHDeleteKeyW(instance_key, buf); } RegCloseKey(instance_key); RegCloseKey(categories_key); StringFromGUID2(&CLSID_WICImagingCategories, buf, 39); - res = RegDeleteTreeW(coclass_key, buf); + res = SHDeleteKeyW(coclass_key, buf); RegCloseKey(coclass_key); diff --git a/dll/win32/winmm/CMakeLists.txt b/dll/win32/winmm/CMakeLists.txt index 507427c6829..6123003f1ca 100644 --- a/dll/win32/winmm/CMakeLists.txt +++ b/dll/win32/winmm/CMakeLists.txt @@ -28,3 +28,7 @@ add_importlibs(winmm advapi32 user32 msvcrt kernel32 ntdll) add_pch(winmm winemm.h SOURCE) add_subdirectory(midimap) add_cd_file(TARGET winmm DESTINATION reactos/system32 FOR all) + +if(NOT MSVC) + add_target_compile_flags(winmm "-Wno-unused-but-set-variable") +endif() diff --git a/dll/win32/ws2_32/misc/ns.c b/dll/win32/ws2_32/misc/ns.c index 9c37bbcf9ff..1ac0bc83811 100644 --- a/dll/win32/ws2_32/misc/ns.c +++ b/dll/win32/ws2_32/misc/ns.c @@ -1596,6 +1596,7 @@ getaddrinfo(const char FAR * nodename, struct addrinfo *ret = NULL, *ai; ULONG addr; USHORT port; + PCHAR pc; struct servent *se; char *proto; LPPROTOENT pent; @@ -1624,9 +1625,9 @@ getaddrinfo(const char FAR * nodename, if (servname) { /* converting port number */ - port = strtoul(servname, NULL, 10); + port = strtoul(servname, &pc, 10); /* service name was specified? */ - if (port == 0) + if (*pc != ANSI_NULL) { /* protocol was specified? */ if (hints && hints->ai_protocol) diff --git a/dll/win32/ws2_32/misc/stubs.c b/dll/win32/ws2_32/misc/stubs.c index de16a1c2125..edcfe005095 100644 --- a/dll/win32/ws2_32/misc/stubs.c +++ b/dll/win32/ws2_32/misc/stubs.c @@ -11,6 +11,7 @@ #include "ws2_32.h" #include +#include /* * @implemented @@ -895,6 +896,16 @@ getnameinfo(const struct sockaddr FAR * sa, DWORD servlen, INT flags) { + if (!host && serv && flags & NI_NUMERICSERV) + { + const struct sockaddr_in *sa_in = (const struct sockaddr_in *)sa; + if (salen >= sizeof(*sa_in) && sa->sa_family == AF_INET) + { + StringCbPrintfA(serv, servlen, "%u", sa_in->sin_port); + return 0; + } + } + UNIMPLEMENTED WSASetLastError(WSASYSCALLFAILURE); diff --git a/drivers/crypto/ksecdd/CMakeLists.txt b/drivers/crypto/ksecdd/CMakeLists.txt index 1ffccb4c892..790ca1cf705 100644 --- a/drivers/crypto/ksecdd/CMakeLists.txt +++ b/drivers/crypto/ksecdd/CMakeLists.txt @@ -1,7 +1,6 @@ spec2def(ksecdd.sys ksecdd.spec) - include_directories( ${REACTOS_SOURCE_DIR}/include/reactos/drivers/ksecdd ${REACTOS_SOURCE_DIR}/lib/cryptlib) @@ -11,7 +10,8 @@ list(APPEND SOURCE dispatch.c random.c stubs.c - ksecdd.rc) + ksecdd.rc + ${CMAKE_CURRENT_BINARY_DIR}/ksecdd.def) add_library(ksecdd SHARED ${SOURCE}) target_link_libraries(ksecdd cryptlib pseh) diff --git a/drivers/crypto/ksecdd/stubs.c b/drivers/crypto/ksecdd/stubs.c index 1a031e2f1ca..176b4acb9f9 100644 --- a/drivers/crypto/ksecdd/stubs.c +++ b/drivers/crypto/ksecdd/stubs.c @@ -208,6 +208,15 @@ InitializeSecurityContextW( return 0; } +PSecurityFunctionTableW +SEC_ENTRY +InitSecurityInterfaceW(void) +{ + + UNIMPLEMENTED_DBGBREAK(); + return NULL; +} + VOID SEC_ENTRY KSecRegisterSecurityProvider(VOID) diff --git a/drivers/hid/hidparse/hidparse.c b/drivers/hid/hidparse/hidparse.c index 0fc78430fb5..6daed49bb56 100644 --- a/drivers/hid/hidparse/hidparse.c +++ b/drivers/hid/hidparse/hidparse.c @@ -70,7 +70,7 @@ CopyFunction( } VOID -NTAPI +__cdecl DebugFunction( IN LPCSTR FormatStr, ...) { diff --git a/drivers/ksfilter/ks/filterfactory.c b/drivers/ksfilter/ks/filterfactory.c index 5ad12916f46..d5bc6fd3361 100644 --- a/drivers/ksfilter/ks/filterfactory.c +++ b/drivers/ksfilter/ks/filterfactory.c @@ -542,7 +542,7 @@ KsFilterFactoryUpdateCacheData( PLIST_ENTRY Entry; PSYMBOLIC_LINK_ENTRY SymEntry; BOOLEAN Found; - HKEY hKey; + HANDLE hKey; NTSTATUS Status = STATUS_SUCCESS; IKsFilterFactoryImpl * Factory = (IKsFilterFactoryImpl*)CONTAINING_RECORD(FilterFactory, IKsFilterFactoryImpl, FilterFactory); @@ -742,5 +742,5 @@ KsFilterFactoryUpdateCacheData( /* done */ return Status; -} +} diff --git a/drivers/storage/ide/uniata/id_ata.cpp b/drivers/storage/ide/uniata/id_ata.cpp index 122431b1447..fc3edfe180b 100644 --- a/drivers/storage/ide/uniata/id_ata.cpp +++ b/drivers/storage/ide/uniata/id_ata.cpp @@ -7820,7 +7820,7 @@ default_no_prep: } else { RtlZeroMemory(modeData, sizeof(MODE_POWER_CONDITION_PAGE)); modeData->PageCode = MODE_PAGE_POWER_CONDITION; - modeData->PageLength = sizeof(MODE_PAGE_POWER_CONDITION)-sizeof(MODE_PARAMETER_HEADER); + modeData->PageLength = sizeof(MODE_POWER_CONDITION_PAGE)-sizeof(MODE_PARAMETER_HEADER); modeData->Byte3.Fields.Idle = LunExt->PowerState <= StartStop_Power_Idle; modeData->Byte3.Fields.Standby = LunExt->PowerState == StartStop_Power_Standby; Srb->DataTransferLength = sizeof(MODE_POWER_CONDITION_PAGE); diff --git a/drivers/storage/ide/uniata/warningfixes.diff b/drivers/storage/ide/uniata/warningfixes.diff deleted file mode 100644 index db828d8b556..00000000000 --- a/drivers/storage/ide/uniata/warningfixes.diff +++ /dev/null @@ -1,589 +0,0 @@ -Index: atapi.h -=================================================================== ---- atapi.h (revision 38451) -+++ atapi.h (working copy) -@@ -138,6 +138,10 @@ - - #else // _DEBUG - -+#ifdef KdPrint -+#undef KdPrint -+#endif -+ - #define PRINT_PREFIX "UniATA: " - - //#define KdPrint3(_x_) {if(LOG_ON_RAISED_IRQL_W2K || MajorVersion < 0x05 || KeGetCurrentIrql() <= 2){/*DbgPrint("%x: ", PsGetCurrentThread()) ;*/ DbgPrint _x_ ; if(g_LogToDisplay){ PrintNtConsole _x_ ;} }} -@@ -1063,8 +1067,8 @@ - - ULONG - AtapiParseArgumentString( -- IN PCHAR String, -- IN PCHAR KeyWord -+ IN PCCH String, -+ IN PCCH KeyWord - ); - - BOOLEAN -@@ -1202,15 +1206,15 @@ - IN PVOID HwDeviceExtension, - IN ULONG chan, - IN ULONG dev, -- IN PWSTR Name, -+ IN PCWSTR Name, - IN ULONG Default - ); - - extern ULONG - AtapiRegCheckParameterValue( - IN PVOID HwDeviceExtension, -- IN PWSTR PathSuffix, -- IN PWSTR Name, -+ IN PCWSTR PathSuffix, -+ IN PCWSTR Name, - IN ULONG Default - ); - -@@ -1220,7 +1224,7 @@ - VOID - _cdecl - _PrintNtConsole( -- PCHAR DebugMessage, -+ PCCH DebugMessage, - ... - ); - -Index: id_sata.cpp -=================================================================== ---- id_sata.cpp (revision 38451) -+++ id_sata.cpp (working copy) -@@ -7,7 +7,7 @@ - ) - { - PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension; -- ULONG Channel = deviceExtension->Channel + lChannel; -+ //ULONG Channel = deviceExtension->Channel + lChannel; - PHW_CHANNEL chan = &deviceExtension->chan[lChannel]; - SATA_SSTATUS_REG SStatus; - ULONG i; -@@ -126,7 +126,7 @@ - { - PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension; - PHW_CHANNEL chan = &deviceExtension->chan[lChannel]; -- ULONG ChipFlags = deviceExtension->HwFlags & CHIPFLAG_MASK; -+ //ULONG ChipFlags = deviceExtension->HwFlags & CHIPFLAG_MASK; - SATA_SSTATUS_REG SStatus; - SATA_SERROR_REG SError; - -Index: ntddk_ex.h -=================================================================== ---- ntddk_ex.h (revision 38451) -+++ ntddk_ex.h (working copy) -@@ -1,15 +1,12 @@ - #ifndef __NTDDK_EX__H__ - #define __NTDDK_EX__H__ - --#ifndef __REACTOS__ -+#ifdef ASSERT - #undef ASSERT --#define ASSERT --#else --#undef ASSERT --#define ASSERT //(x) if (!(x)) {RtlAssert("#x",__FILE__,__LINE__, ""); } --#endif //__REACTOS__ -+#define ASSERT(x) ((void)0) -+// #define ASSERT(x) if (!(x)) { RtlAssert("#x",__FILE__,__LINE__, ""); } -+#endif - -- - #ifndef FILE_CHARACTERISTIC_PNP_DEVICE // DDK 2003 - - #define FILE_CHARACTERISTIC_PNP_DEVICE 0x00000800 -Index: id_dma.cpp -=================================================================== ---- id_dma.cpp (revision 38451) -+++ id_dma.cpp (working copy) -@@ -219,7 +219,7 @@ - PHW_CHANNEL chan = &(deviceExtension->chan[lChannel]); - PATA_REQ AtaReq = (PATA_REQ)(Srb->SrbExtension); - BOOLEAN use_DB_IO = FALSE; -- BOOLEAN use_AHCI = FALSE; -+ //BOOLEAN use_AHCI = FALSE; - ULONG orig_count = count; - ULONG max_entries = (deviceExtension->HwFlags & UNIATA_AHCI) ? ATA_AHCI_DMA_ENTRIES : ATA_DMA_ENTRIES; - -@@ -281,7 +281,7 @@ - if(!dma_count || ((LONG)(dma_base) == -1)) { - KdPrint2((PRINT_PREFIX "AtapiDmaSetup: No 1st block\n" )); - //AtaReq->dma_base = NULL; -- AtaReq->ahci_base64 = NULL; -+ AtaReq->ahci_base64 = 0; - return FALSE; - } - -@@ -303,7 +303,7 @@ - if (i >= max_entries) { - KdPrint2((PRINT_PREFIX "too many segments in DMA table\n" )); - //AtaReq->dma_base = NULL; -- AtaReq->ahci_base64 = NULL; -+ AtaReq->ahci_base64 = 0; - return FALSE; - } - KdPrint2((PRINT_PREFIX " get Phys(data[n]=%x)\n", data )); -@@ -321,7 +321,7 @@ - } else - if(!dma_count || !dma_base || ((LONG)(dma_base) == -1)) { - //AtaReq->dma_base = NULL; -- AtaReq->ahci_base64 = NULL; -+ AtaReq->ahci_base64 = 0; - KdPrint2((PRINT_PREFIX "AtapiDmaSetup: No NEXT block\n" )); - return FALSE; - } -@@ -596,7 +596,7 @@ - ) - { - PHW_LU_EXTENSION LunExt = &(deviceExtension->lun[ldev]); -- CHAR apiomode; -+ SCHAR apiomode; - - apiomode = (CHAR)AtaPioMode(&(LunExt->IdentifyData)); - -@@ -612,7 +612,7 @@ - } - - if((deviceExtension->HbaCtrlFlags & HBAFLAGS_DMA_DISABLED_LBA48) && -- (AtaReq->lba >= ATA_MAX_LBA28) && -+ (AtaReq->lba >= (LONGLONG)ATA_MAX_LBA28) && - (LunExt->TransferMode > ATA_PIO5) ) { - KdPrint2((PRINT_PREFIX - "AtapiDmaReinit: FORCE_DOWNRATE on Device %d for LBA48\n", ldev & 1)); -@@ -623,7 +623,7 @@ - if(AtaReq->Flags & REQ_FLAG_FORCE_DOWNRATE) { - KdPrint2((PRINT_PREFIX - "AtapiDmaReinit: FORCE_DOWNRATE on Device %d\n", ldev & 1)); -- if(AtaReq->lba >= ATA_MAX_LBA28) { -+ if(AtaReq->lba >= (LONGLONG)ATA_MAX_LBA28) { - limit_lba48: - LunExt->DeviceFlags |= REQ_FLAG_FORCE_DOWNRATE_LBA48; - limit_pio: -@@ -754,9 +754,9 @@ - IN ULONG DeviceNumber, - IN ULONG lChannel, // logical channel, - // is always 0 except simplex-only controllers -- IN CHAR apiomode, -- IN CHAR wdmamode, -- IN CHAR udmamode -+ IN SCHAR apiomode, -+ IN SCHAR wdmamode, -+ IN SCHAR udmamode - ) - { - PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension; -@@ -1488,7 +1488,7 @@ - AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode); - - SetPciConfig1(mreg, mode | (mask & 0x11)); -- SetPciConfig2(ureg - 0x8, sil_pio_modes[i]); -+ SetPciConfig2(ureg - 0x8, sil_pio_modes[apiomode]); - return; - - } else { -@@ -1538,7 +1538,7 @@ - /*******/ - /* SiS */ - /*******/ -- PULONG sis_modes; -+ PULONG sis_modes = NULL; - static const ULONG sis_modes_new133[] = - { 0x28269008, 0x0c266008, 0x04263008, 0x0c0a3008, 0x05093008, - 0x22196008, 0x0c0a3008, 0x05093008, 0x050939fc, 0x050936ac, -@@ -1553,9 +1553,9 @@ - { 0x00cb, 0x0067, 0x0044, 0x0033, 0x0031, 0x0044, 0x0033, 0x0031, - 0x8b31, 0x8731, 0x8531, 0x8431, 0x8231, 0x8131 }; - -- ULONG reg; -+ ULONG reg = 0; - UCHAR reg57; -- ULONG reg_size; -+ ULONG reg_size = 0; - ULONG offs; - - switch(ChipType) { -@@ -1731,8 +1731,8 @@ - AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode); - ChangePciConfig1(0x50, a | (1 << (dev + 3)) ); - GetPciConfig1(0x54 + offset, reg54); -- if(reg54 < chtiming[i]) { -- SetPciConfig1(0x54 + offset, chtiming[i]); -+ if(reg54 < chtiming[apiomode]) { -+ SetPciConfig1(0x54 + offset, chtiming[apiomode]); - } - return; - } -@@ -1901,7 +1901,7 @@ - ULONG ChipType = deviceExtension->HwFlags & CHIPTYPE_MASK; - //ULONG ChipFlags = deviceExtension->HwFlags & CHIPFLAG_MASK; - -- ULONG timing; -+ ULONG timing = 0; - - if(mode == ATA_PIO5) - mode = ATA_PIO4; -Index: id_badblock.cpp -=================================================================== ---- id_badblock.cpp (revision 38451) -+++ id_badblock.cpp (working copy) -@@ -159,7 +159,11 @@ - L"UniATA\\Parameters\\BadBlocks", - QueryTable, 0, 0); - -+#ifdef _DEBUG - KdPrint(( "InitBadBlocks returned: %#x\n", status)); -+#else -+ UNREFERENCED_PARAMETER(status); -+#endif - } else { - - KdPrint(( "InitBadBlocks local\n")); -Index: id_init.cpp -=================================================================== ---- id_init.cpp (revision 38451) -+++ id_init.cpp (working copy) -@@ -52,11 +52,11 @@ - ) - { - PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension; -- ULONG slotNumber = deviceExtension->slotNumber; -- ULONG SystemIoBusNumber = deviceExtension->SystemIoBusNumber; -+ //ULONG slotNumber = deviceExtension->slotNumber; -+ //ULONG SystemIoBusNumber = deviceExtension->SystemIoBusNumber; - ULONG VendorID = deviceExtension->DevID & 0xffff; -- ULONG DeviceID = (deviceExtension->DevID >> 16) & 0xffff; -- ULONG RevID = deviceExtension->RevID; -+ //ULONG DeviceID = (deviceExtension->DevID >> 16) & 0xffff; -+ //ULONG RevID = deviceExtension->RevID; - ULONG ChipType = deviceExtension->HwFlags & CHIPTYPE_MASK; - ULONG ChipFlags= deviceExtension->HwFlags & CHIPFLAG_MASK; - -@@ -216,7 +216,7 @@ - PCI_DEV_HW_SPEC_BM( 0730, 1039, 0x00, ATA_UDMA5, "SiS 730" , SIS100OLD ), - - PCI_DEV_HW_SPEC_BM( 0646, 1039, 0x00, ATA_UDMA6, "SiS 645DX", SIS133NEW ), --/* PCI_DEV_HW_SPEC_BM( 0645, 1039, 0x00, ATA_UDMA6, "SiS 645" , SIS133NEW ), -+/* PCI_DEV_HW_SPEC_BM( 0645, 1039, 0x00, ATA_UDMA6, "SiS 645" , SIS133NEW ),*/ - /* PCI_DEV_HW_SPEC_BM( 0640, 1039, 0x00, ATA_UDMA4, "SiS 640" , SIS_SOUTH ),*/ - PCI_DEV_HW_SPEC_BM( 0635, 1039, 0x00, ATA_UDMA5, "SiS 635" , SIS100NEW ), - PCI_DEV_HW_SPEC_BM( 0633, 1039, 0x00, ATA_UDMA5, "SiS 633" , SIS100NEW ), -@@ -419,7 +419,7 @@ - BaseIoAddressBM = AtapiGetIoRange(HwDeviceExtension, ConfigInfo, pciData, SystemIoBusNumber, - 4, 0, deviceExtension->NumberChannels*sizeof(IDE_BUSMASTER_REGISTERS)); - for(c=0; cNumberChannels; c++) { -- ULONG unit01 = (c & 1); -+ //ULONG unit01 = (c & 1); - ULONG unit10 = (c & 2); - chan = &deviceExtension->chan[c]; - -@@ -987,7 +987,7 @@ - IN ULONG slotNumber - ) - { -- PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension; -+ //PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension; - PCI_COMMON_CONFIG pciData; - ULONG funcNumber; - ULONG busDataRead; -@@ -1039,7 +1039,7 @@ - IN ULONG c - ) - { -- PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension; -+ //PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension; - PCI_COMMON_CONFIG pciData; - ULONG funcNumber; - ULONG busDataRead; -@@ -1174,7 +1174,7 @@ - ULONG slotNumber = deviceExtension->slotNumber; - ULONG SystemIoBusNumber = deviceExtension->SystemIoBusNumber; - -- ULONG ChipType = deviceExtension->HwFlags & CHIPTYPE_MASK; -+ //ULONG ChipType = deviceExtension->HwFlags & CHIPTYPE_MASK; - PHW_CHANNEL chan; - ULONG c; // logical channel (for Compatible Mode controllers) - UCHAR tmp8; -@@ -1332,7 +1332,9 @@ - ULONG slotNumber = deviceExtension->slotNumber; - ULONG SystemIoBusNumber = deviceExtension->SystemIoBusNumber; - ULONG VendorID = deviceExtension->DevID & 0xffff; -+#ifdef _DEBUG - ULONG DeviceID = (deviceExtension->DevID >> 16) & 0xffff; -+#endif - ULONG RevID = deviceExtension->RevID; - // ULONG i; - // BUSMASTER_CONTROLLER_INFORMATION* DevTypeInfo; -Index: id_ata.cpp -=================================================================== ---- id_ata.cpp (revision 38451) -+++ id_ata.cpp (working copy) -@@ -1864,7 +1864,9 @@ - ULONG slotNumber = deviceExtension->slotNumber; - ULONG SystemIoBusNumber = deviceExtension->SystemIoBusNumber; - ULONG VendorID = deviceExtension->DevID & 0xffff; -+#ifdef _DEBUG - ULONG DeviceID = (deviceExtension->DevID >> 16) & 0xffff; -+#endif - //ULONG RevID = deviceExtension->RevID; - ULONG ChipFlags = deviceExtension->HwFlags & CHIPFLAG_MASK; - UCHAR tmp8; -@@ -2859,12 +2861,12 @@ - --*/ - ULONG - AtapiParseArgumentString( -- IN PCHAR String, -- IN PCHAR KeyWord -+ IN PCCH String, -+ IN PCCH KeyWord - ) - { -- PCHAR cptr; -- PCHAR kptr; -+ PCCH cptr; -+ PCCH kptr; - ULONG value; - ULONG stringLength = 0; - ULONG keyWordLength = 0; -@@ -2877,24 +2879,15 @@ - return 0; - } - -- // Calculate the string length and lower case all characters. -+ // Calculate the string length. - cptr = String; -- while (*cptr) { -- if (*cptr >= 'A' && *cptr <= 'Z') { -- *cptr = *cptr + ('a' - 'A'); -- } -- cptr++; -+ while (*cptr++) { - stringLength++; - } - -- // Calculate the keyword length and lower case all characters. -- cptr = KeyWord; -- while (*cptr) { -- -- if (*cptr >= 'A' && *cptr <= 'Z') { -- *cptr = *cptr + ('a' - 'A'); -- } -- cptr++; -+ // Calculate the keyword length. -+ kptr = KeyWord; -+ while (*kptr++) { - keyWordLength++; - } - -@@ -2920,18 +2913,21 @@ - } - - kptr = KeyWord; -- while (*cptr++ == *kptr++) { -+ while ((*cptr == *kptr) || -+ (*cptr <= 'Z' && *cptr + ('a' - 'A') == *kptr) || -+ (*cptr >= 'a' && *cptr - ('a' - 'A') == *kptr)) { -+ cptr++; -+ kptr++; - -- if (*(cptr - 1) == '\0') { -+ if (*cptr == '\0') { - // end of string - return 0; - } - } - -- if (*(kptr - 1) == '\0') { -+ if (*kptr == '\0') { - - // May have a match backup and check for blank or equals. -- cptr--; - while (*cptr == ' ' || *cptr == '\t') { - cptr++; - } -@@ -2967,7 +2963,7 @@ - } - - value = 0; -- if ((*cptr == '0') && (*(cptr + 1) == 'x')) { -+ if ((*cptr == '0') && ((*(cptr + 1) == 'x') || (*(cptr + 1) == 'X'))) { - // Value is in Hex. Skip the "0x" - cptr += 2; - for (index = 0; *(cptr + index); index++) { -@@ -2983,6 +2979,8 @@ - } else { - if ((*(cptr + index) >= 'a') && (*(cptr + index) <= 'f')) { - value = (16 * value) + (*(cptr + index) - 'a' + 10); -+ } else if ((*(cptr + index) >= 'A') && (*(cptr + index) <= 'F')) { -+ value = (16 * value) + (*(cptr + index) - 'A' + 10); - } else { - // Syntax error, return not found. - return 0; -@@ -8752,10 +8750,10 @@ - ULONG - AtapiRegCheckDevLunValue( - IN PVOID HwDeviceExtension, -- IN PWCHAR NamePrefix, -+ IN PCWCH NamePrefix, - IN ULONG chan, - IN ULONG dev, -- IN PWSTR Name, -+ IN PCWSTR Name, - IN ULONG Default - ) - { -@@ -8822,7 +8820,7 @@ - IN PVOID HwDeviceExtension, - IN ULONG chan, - IN ULONG dev, -- IN PWSTR Name, -+ IN PCWSTR Name, - IN ULONG Default - ) - { -@@ -8940,8 +8938,8 @@ - ULONG - AtapiRegCheckParameterValue( - IN PVOID HwDeviceExtension, -- IN PWSTR PathSuffix, -- IN PWSTR Name, -+ IN PCWSTR PathSuffix, -+ IN PCWSTR Name, - IN ULONG Default - ) - { -@@ -9108,7 +9106,7 @@ - VOID - _cdecl - _PrintNtConsole( -- PCHAR DebugMessage, -+ PCCH DebugMessage, - ... - ) - { -Index: id_probe.cpp -=================================================================== ---- id_probe.cpp (revision 38451) -+++ id_probe.cpp (working copy) -@@ -76,7 +76,6 @@ - VOID - AtapiDoNothing(VOID) - { -- ULONG i = 0; - return; - } // end AtapiDoNothing() - -@@ -504,8 +503,8 @@ - /* if(known) { - RtlCopyMemory(newBMListPtr, (PVOID)&(BusMasterAdapters[i]), sizeof(BUSMASTER_CONTROLLER_INFORMATION)); - } else {*/ -- sprintf((PCHAR)vendorStrPtr, "%4.4x", VendorID); -- sprintf((PCHAR)deviceStrPtr, "%4.4x", DeviceID); -+ sprintf((PCHAR)vendorStrPtr, "%4.4lx", VendorID); -+ sprintf((PCHAR)deviceStrPtr, "%4.4lx", DeviceID); - - RtlCopyMemory(&(newBMListPtr->VendorIdStr), (PCHAR)vendorStrPtr, 4); - RtlCopyMemory(&(newBMListPtr->DeviceIdStr), (PCHAR)deviceStrPtr, 4); -@@ -874,7 +873,11 @@ - BOOLEAN found = FALSE; - BOOLEAN MasterDev; - BOOLEAN simplexOnly = FALSE; -+#ifndef UNIATA_CORE -+#ifdef UNIATA_INIT_ON_PROBE - BOOLEAN skip_find_dev = FALSE; -+#endif -+#endif - BOOLEAN AltInit = FALSE; - - SCSI_PHYSICAL_ADDRESS IoBasePort1; -@@ -1712,7 +1715,7 @@ - ) - { - PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension; -- PHW_CHANNEL chan = NULL; -+ //PHW_CHANNEL chan = NULL; - // this buffer must be global for UNIATA_CORE build - PCI_COMMON_CONFIG pciData; - -@@ -1743,8 +1746,8 @@ - BOOLEAN found = FALSE; - BOOLEAN MasterDev; - BOOLEAN simplexOnly = FALSE; -- BOOLEAN skip_find_dev = FALSE; -- BOOLEAN AltInit = FALSE; -+ //BOOLEAN skip_find_dev = FALSE; -+ //BOOLEAN AltInit = FALSE; - - PIDE_BUSMASTER_REGISTERS BaseIoAddressBM_0 = NULL; - -@@ -1797,7 +1800,7 @@ - &pciData, - PCI_COMMON_HDR_LENGTH); - -- if (busDataRead < PCI_COMMON_HDR_LENGTH) { -+ if (busDataRead < (ULONG)PCI_COMMON_HDR_LENGTH) { - KdPrint2((PRINT_PREFIX "busDataRead < PCI_COMMON_HDR_LENGTH => SP_RETURN_ERROR\n")); - goto exit_error; - } -@@ -2207,7 +2210,7 @@ - PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension; - PHW_CHANNEL chan; - PULONG adapterCount = (PULONG)Context; -- PUCHAR ioSpace; -+ PUCHAR ioSpace = NULL; - ULONG i; - ULONG irq=0; - ULONG portBase; -@@ -2217,7 +2220,7 @@ - BOOLEAN preConfig = FALSE; - // - PIDE_REGISTERS_1 BaseIoAddress1; -- PIDE_REGISTERS_2 BaseIoAddress2; -+ PIDE_REGISTERS_2 BaseIoAddress2 = NULL; - - // The following table specifies the ports to be checked when searching for - // an IDE controller. A zero entry terminates the search. -Index: bm_devs.h -=================================================================== ---- bm_devs.h (revision 38451) -+++ bm_devs.h (working copy) -@@ -482,7 +482,7 @@ - { #idlo, 4, 0x##idlo, #idhi, 4, 0x##idhi, rev, mode, name, flags} - #else - #define PCI_DEV_HW_SPEC_BM(idhi, idlo, rev, mode, name, flags) \ -- { #idlo, 4, 0x##idlo, #idhi, 4, 0x##idhi, rev, mode, NULL, flags} -+ { (PCHAR) #idlo, 4, 0x##idlo, (PCHAR) #idhi, 4, 0x##idhi, rev, mode, NULL, flags} - #endif - - #define BMLIST_TERMINATOR (0xffffffffL) -Index: bsmaster.h -=================================================================== ---- bsmaster.h (revision 38451) -+++ bsmaster.h (working copy) -@@ -987,7 +987,7 @@ - BOOLEAN opt_AtapiDmaRawRead; // default TRUE - BOOLEAN opt_AtapiDmaReadWrite; // default TRUE - -- PCHAR FullDevName; -+ PCCH FullDevName; - - } HW_DEVICE_EXTENSION, *PHW_DEVICE_EXTENSION; - -@@ -1172,9 +1172,9 @@ - IN ULONG DeviceNumber, - IN ULONG lChannel, // logical channel, - // is always 0 except simplex-only controllers -- IN CHAR apiomode, -- IN CHAR wdmamode, -- IN CHAR udmamode -+ IN SCHAR apiomode, -+ IN SCHAR wdmamode, -+ IN SCHAR udmamode - ); - - extern BOOLEAN NTAPI diff --git a/include/asm/CMakeLists.txt b/include/asm/CMakeLists.txt index e111190e574..2c07cc38184 100644 --- a/include/asm/CMakeLists.txt +++ b/include/asm/CMakeLists.txt @@ -11,17 +11,19 @@ else() endif() if(ARCH STREQUAL "i386") - set(_filename ks386) + set(_filename ks386.inc) elseif(ARCH STREQUAL "amd64") - set(_filename ksamd64) + set(_filename ksamd64.inc) +elseif(ARCH STREQUAL "arm") + set(_filename ksarm.h) endif() get_target_property(genincdata_dll genincdata LOCATION) add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_filename}.inc - COMMAND native-geninc ${genincdata_dll} ${CMAKE_CURRENT_BINARY_DIR}/${_filename}.inc ${OPT_MS} + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_filename} + COMMAND native-geninc ${genincdata_dll} ${CMAKE_CURRENT_BINARY_DIR}/${_filename} ${OPT_MS} DEPENDS genincdata native-geninc) add_custom_target(asm - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_filename}.inc) + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_filename}) diff --git a/include/asm/genincdata.c b/include/asm/genincdata.c index bfd99090104..0824b620869 100644 --- a/include/asm/genincdata.c +++ b/include/asm/genincdata.c @@ -74,15 +74,18 @@ __attribute__ ((section(".asmdef"))) ASMGENDATA Table[] = { - +#if defined (_M_IX86) || defined (M_AMD64) /* PORTABLE CONSTANTS ********************************************************/ #include "ksx.template.h" +#endif /* ARCHITECTURE SPECIFIC CONTSTANTS ******************************************/ #ifdef _M_IX86 #include "ks386.template.h" #elif defined(_M_AMD64) #include "ksamd64.template.h" +#elif defined(_M_ARM) +#include "ksarm.template.h" #endif /* End of list */ diff --git a/include/asm/ks386.template.h b/include/asm/ks386.template.h index 77085d1bcc4..77ac3f8c306 100644 --- a/include/asm/ks386.template.h +++ b/include/asm/ks386.template.h @@ -347,7 +347,7 @@ OFFSET(CONTEXT_SEGSS, CONTEXT, SegSs), //OFFSET(CONTEXT_FLOAT_SAVE_STATUS_WORD CONTEXT_FLOAT_SAVE + FP_STATUS_WORD //OFFSET(CONTEXT_FLOAT_SAVE_TAG_WORD CONTEXT_FLOAT_SAVE + FP_TAG_WORD //OFFSET(CONTEXT_FRAME_LENGTH 0x2D0 -SIZE(CONTEXT_FRAME_LENGTH, CONTEXT), +SIZE(CONTEXT_FRAME_LENGTH, CONTEXT), HEADER("FIBER"), OFFSET(FIBER_PARAMETER, FIBER, Parameter), @@ -387,7 +387,7 @@ OFFSET(EXCEPTION_RECORD_NUMBER_PARAMETERS, EXCEPTION_RECORD, NumberParameters), OFFSET(EXCEPTION_RECORD_EXCEPTION_ADDRESS, EXCEPTION_RECORD, ExceptionAddress), SIZE(SIZEOF_EXCEPTION_RECORD, EXCEPTION_RECORD), CONSTANT(EXCEPTION_RECORD_LENGTH), - + //#define EXCEPTION_RECORD_LENGTH 0x50 HEADER("KTHREAD"), @@ -463,6 +463,5 @@ CONSTANT(EXCEPTION_EXECUTE_HANDLER), CONSTANT(STATUS_CALLBACK_POP_STACK), CONSTANT(CONTEXT_ALIGNED_SIZE), CONSTANT(PROCESSOR_FEATURE_FXSR), - - +CONSTANT(KUSER_SHARED_SYSCALL_RET), diff --git a/include/asm/ksarm.template.h b/include/asm/ksarm.template.h new file mode 100644 index 00000000000..28533f6e1c7 --- /dev/null +++ b/include/asm/ksarm.template.h @@ -0,0 +1,105 @@ + +RAW(""), +RAW("#include "), +RAW(""), + +HEADER("CPSR Values"), +CONSTANT(CPSR_THUMB_ENABLE), +CONSTANT(CPSR_FIQ_DISABLE), +CONSTANT(CPSR_IRQ_DISABLE), +CONSTANT(CPSR_USER_MODE), +CONSTANT(CPSR_FIQ_MODE), +CONSTANT(CPSR_IRQ_MODE), +CONSTANT(CPSR_SVC_MODE), +CONSTANT(CPSR_ABORT_MODE), +CONSTANT(CPSR_UND_MODE), +CONSTANT(CPSR_MODES), + +HEADER("C1 Register Values"), +CONSTANT(C1_MMU_CONTROL), +CONSTANT(C1_ALIGNMENT_CONTROL), +CONSTANT(C1_DCACHE_CONTROL), +CONSTANT(C1_ICACHE_CONTROL), +CONSTANT(C1_VECTOR_CONTROL), + +HEADER("Loader Parameter Block Offsets"), +OFFSET(LpbKernelStack, LOADER_PARAMETER_BLOCK, KernelStack), +OFFSET(LpbPanicStack, LOADER_PARAMETER_BLOCK, u.Arm.PanicStack), +OFFSET(LpbInterruptStack, LOADER_PARAMETER_BLOCK, u.Arm.InterruptStack), + +HEADER("Trap Frame offsets"), +OFFSET(TrDbgArgMark, KTRAP_FRAME, DbgArgMark), +OFFSET(TrR0, KTRAP_FRAME, R0), +OFFSET(TrR1, KTRAP_FRAME, R1), +OFFSET(TrR2, KTRAP_FRAME, R2), +OFFSET(TrR3, KTRAP_FRAME, R3), +OFFSET(TrR4, KTRAP_FRAME, R4), +OFFSET(TrR5, KTRAP_FRAME, R5), +OFFSET(TrR6, KTRAP_FRAME, R6), +OFFSET(TrR7, KTRAP_FRAME, R7), +OFFSET(TrR8, KTRAP_FRAME, R8), +OFFSET(TrR9, KTRAP_FRAME, R9), +OFFSET(TrR10, KTRAP_FRAME, R10), +OFFSET(TrR11, KTRAP_FRAME, R11), +OFFSET(TrR12, KTRAP_FRAME, R12), +OFFSET(TrUserSp, KTRAP_FRAME, UserSp), +OFFSET(TrUserLr, KTRAP_FRAME, UserLr), +OFFSET(TrSvcSp, KTRAP_FRAME, SvcSp), +OFFSET(TrSvcLr, KTRAP_FRAME, SvcLr), +OFFSET(TrPc, KTRAP_FRAME, Pc), +OFFSET(TrSpsr, KTRAP_FRAME, Spsr), +SIZE(TrapFrameLength, KTRAP_FRAME), + +HEADER("Exception Frame offsets"), +OFFSET(ExR4, KEXCEPTION_FRAME, R4), +OFFSET(ExR5, KEXCEPTION_FRAME, R5), +OFFSET(ExR6, KEXCEPTION_FRAME, R6), +OFFSET(ExR7, KEXCEPTION_FRAME, R7), +OFFSET(ExR8, KEXCEPTION_FRAME, R8), +OFFSET(ExR9, KEXCEPTION_FRAME, R9), +OFFSET(ExR10, KEXCEPTION_FRAME, R10), +OFFSET(ExR11, KEXCEPTION_FRAME, R11), +OFFSET(ExLr, KEXCEPTION_FRAME, Lr), +OFFSET(ExSpsr, KEXCEPTION_FRAME, Psr), // name? +SIZE(ExceptionFrameLength, KEXCEPTION_FRAME), + +HEADER("PCR"), +CONSTANTX(KiPcr, 0xFFFFF000), + +HEADER("PCR Offsets"), +//OFFSET(PcCurrentIrql, KPCR, CurrentIrql), + +HEADER("KTHREAD Offsets"), +OFFSET(ThKernelStack, KTHREAD, KernelStack), + +HEADER("CONTEXT Offsets"), +OFFSET(CsContextFlags, CONTEXT, ContextFlags), +OFFSET(CsR0, CONTEXT, R0), +OFFSET(CsR1, CONTEXT, R1), +OFFSET(CsR2, CONTEXT, R2), +OFFSET(CsR3, CONTEXT, R3), +OFFSET(CsR4, CONTEXT, R4), +OFFSET(CsR5, CONTEXT, R5), +OFFSET(CsR6, CONTEXT, R6), +OFFSET(CsR7, CONTEXT, R7), +OFFSET(CsR8, CONTEXT, R8), +OFFSET(CsR9, CONTEXT, R9), +OFFSET(CsR10, CONTEXT, R10), +OFFSET(CsR11, CONTEXT, R11), +OFFSET(CsR12, CONTEXT, R12), +OFFSET(CsSp, CONTEXT, Sp), +OFFSET(CsLr, CONTEXT, Lr), +OFFSET(CsPc, CONTEXT, Pc), +OFFSET(CsPsr, CONTEXT, Psr), + +CONSTANT(CONTEXT_FULL), + +HEADER("DebugService Control Types"), +CONSTANT(BREAKPOINT_BREAK), +CONSTANT(BREAKPOINT_PRINT), +CONSTANT(BREAKPOINT_PROMPT), +CONSTANT(BREAKPOINT_LOAD_SYMBOLS), +CONSTANT(BREAKPOINT_UNLOAD_SYMBOLS), +CONSTANT(BREAKPOINT_COMMAND_STRING), + + diff --git a/ntoskrnl/include/internal/arm/kxarm.h b/include/asm/kxarm.h similarity index 68% rename from ntoskrnl/include/internal/arm/kxarm.h rename to include/asm/kxarm.h index cede87c6763..50928e75815 100644 --- a/ntoskrnl/include/internal/arm/kxarm.h +++ b/include/asm/kxarm.h @@ -1,22 +1,103 @@ + +#ifdef _MSC_VER + + /* Globals */ + GBLS AreaName + GBLS FuncName + GBLS PrologName + GBLS FuncEndName +AreaName SETS "|.text|" + + MACRO + TEXTAREA + AREA |.text|,ALIGN=2,CODE,READONLY +AreaName SETS "|.text|" + MEND + + MACRO + NESTED_ENTRY $Name +FuncName SETS "$Name" +PrologName SETS "$Name":CC:"_Prolog" +FuncEndName SETS "$Name":CC:"_end" + AREA |.pdata|,ALIGN=2,PDATA + ALIGN 2 + EXPORT $FuncName [FUNC] +$FuncName + ROUT + MEND + + MACRO + PROLOG_END +$PrologName + MEND + + MACRO + ENTRY_END $Name +$FuncEndName + MEND + + MACRO + LEAF_ENTRY $Name +FuncName SETS "$Name" +PrologName SETS "Invalid Prolog" +FuncEndName SETS "$Name":CC:"_end" + ALIGN 2 + EXPORT $FuncName [FUNC] +$FuncName + ROUT + MEND + + MACRO + LEAF_END $Name +$FuncEndName + MEND + + MACRO + TRAP_PROLOG $Abort + fixme + MEND + + MACRO + SYSCALL_PROLOG $Abort + fixme + MEND + + MACRO + TRAP_EPILOG $SystemCall + fixme + MEND + +#else + +/* Compatibility define */ +#define EQU .equ + +.macro IMPORT Name + /* Ignore */ +.endm + .macro TEXTAREA .section .text, "rx" .align 2 .endm .macro NESTED_ENTRY Name - .global &Name +FuncName .equ &Name +PrologName .equ &Name&_Prolog +FuncEndName .equ &Name&_end + .global &FuncName .align 2 - .func &Name - &Name: + .func &FuncName + &FuncName: .endm -.macro PROLOG_END Name - prolog_&Name: +.macro PROLOG_END + \PrologName: .endm .macro ENTRY_END Name - end_&Name: + &FuncEndName: .endfunc .endm @@ -30,57 +111,39 @@ sub lr, lr, #4 .endif - // // Save the bottom 4 registers - // stmdb sp, {r0-r3} - - // + // Save the abort lr, sp, spsr, cpsr - // mov r0, lr mov r1, sp mrs r2, cpsr mrs r3, spsr - - // + // Switch to SVC mode - // bic r2, r2, #CPSR_MODES orr r2, r2, #CPSR_SVC_MODE msr cpsr_c, r2 - - // + // Save the SVC sp before we modify it - // mov r2, sp - - // + // Make space for the trap frame - // sub sp, sp, #TrapFrameLength - - // + // Save abt32 state - // str r0, [sp, #TrPc] str lr, [sp, #TrSvcLr] - str r2, [sp, #TrSvcSp] - - // + str r2, [sp, #TrSvcSp] + // Restore the saved SPSR - // msr spsr_all, r3 - - // + // Restore our 4 registers - // ldmdb r1, {r0-r3} - - // + // Build trap frame // FIXME: Change to stmdb later - // str r0, [sp, #TrR0] str r1, [sp, #TrR1] str r2, [sp, #TrR2] @@ -102,17 +165,13 @@ ldr r0, =0xBADB0D00 str r0, [sp, #TrDbgArgMark] .endm - + .macro SYSCALL_PROLOG - // // Make space for the trap frame - // sub sp, sp, #TrapFrameLength - - // + // Build trap frame // FIXME: Change to stmdb later - // str r0, [sp, #TrR0] str r1, [sp, #TrR1] str r2, [sp, #TrR2] @@ -136,26 +195,20 @@ ldr r0, =0xBADB0D00 str r0, [sp, #TrDbgArgMark] .endm - + .macro TRAP_EPILOG SystemCall - // // ASSERT(TrapFrame->DbgArgMark == 0xBADB0D00) - // ldr r0, [sp, #TrDbgArgMark] ldr r1, =0xBADB0D00 cmp r0, r1 bne 1f - - // + // Get the SPSR and restore it - // ldr r0, [sp, #TrSpsr] msr spsr_all, r0 - - // + // Restore the registers // FIXME: Use LDMIA later - // mov r0, sp add r0, r0, #TrUserSp ldm r0, {sp, lr}^ @@ -172,10 +225,8 @@ ldr r10, [sp, #TrR10] ldr r11, [sp, #TrR11] ldr r12, [sp, #TrR12] - - // + // Restore program execution state - // .if \SystemCall ldr lr, [sp, #TrPc] add sp, sp, #TrapFrameLength @@ -187,3 +238,7 @@ 1: b . .endm + +#endif + + diff --git a/include/crt/_mingw.h b/include/crt/_mingw.h index 40b8b11ed39..4ee69fcb46b 100644 --- a/include/crt/_mingw.h +++ b/include/crt/_mingw.h @@ -56,7 +56,7 @@ #elif defined(_MSC_VER) # define __CRT_INLINE __inline #elif defined(__GNUC__) -# if ( __MINGW_GNUC_PREREQ(4, 3) && __STDC_VERSION__ >= 199901L) +# if defined(__clang__) || ( __MINGW_GNUC_PREREQ(4, 3) && __STDC_VERSION__ >= 199901L) # define __CRT_INLINE extern inline __attribute__((__always_inline__,__gnu_inline__)) # else # define __CRT_INLINE extern __inline__ __attribute__((__always_inline__)) diff --git a/include/crt/conio.h b/include/crt/conio.h index 74dcf45ae00..e260cf1969a 100644 --- a/include/crt/conio.h +++ b/include/crt/conio.h @@ -416,10 +416,10 @@ extern "C" { int _Ch); #if (defined(_X86_) && !defined(__x86_64)) - _CRT_NONSTDC_DEPRECATE(_inp) _CRTIMP int __cdecl inp(unsigned short); - _CRT_NONSTDC_DEPRECATE(_inpw) _CRTIMP unsigned short __cdecl inpw(unsigned short); - _CRT_NONSTDC_DEPRECATE(_outp) _CRTIMP int __cdecl outp(unsigned short,int); - _CRT_NONSTDC_DEPRECATE(_outpw) _CRTIMP unsigned short __cdecl outpw(unsigned short,unsigned short); + _CRT_NONSTDC_DEPRECATE(_inp) int __cdecl inp(unsigned short); + _CRT_NONSTDC_DEPRECATE(_inpw) unsigned short __cdecl inpw(unsigned short); + _CRT_NONSTDC_DEPRECATE(_outp) int __cdecl outp(unsigned short,int); + _CRT_NONSTDC_DEPRECATE(_outpw) unsigned short __cdecl outpw(unsigned short,unsigned short); #endif #endif /* !NO_OLDNAMES */ diff --git a/include/crt/crtdefs.h b/include/crt/crtdefs.h index be4d08ee539..b76dbf5682b 100644 --- a/include/crt/crtdefs.h +++ b/include/crt/crtdefs.h @@ -20,6 +20,10 @@ #endif #endif +#undef _CRT_PACKING +#define _CRT_PACKING 8 +#pragma pack(push,_CRT_PACKING) + /* Disable non-ANSI C definitions if compiling with __STDC__ */ //HACK: Disabled //#if __STDC__ @@ -29,10 +33,6 @@ /** Properties ***************************************************************/ -#undef _CRT_PACKING -#define _CRT_PACKING 8 -#pragma pack(push,_CRT_PACKING) - #ifndef _CRT_STRINGIZE #define __CRT_STRINGIZE(_Value) #_Value #define _CRT_STRINGIZE(_Value) __CRT_STRINGIZE(_Value) @@ -237,9 +237,11 @@ #define _TRUNCATE ((size_t)-1) #endif +#ifndef __REACTOS__ #define __STDC_SECURE_LIB__ 200411L #define __GOT_SECURE_LIB__ __STDC_SECURE_LIB__ #define _SECURECRT_FILL_BUFFER_PATTERN 0xFD +#endif /** Type definitions *********************************************************/ @@ -325,6 +327,22 @@ extern "C" { typedef unsigned short wctype_t; #endif +#ifdef __GNUC__ +#ifndef __GNUC_VA_LIST +#define __GNUC_VA_LIST + typedef __builtin_va_list __gnuc_va_list; +#endif +#endif + +#ifndef _VA_LIST_DEFINED +#define _VA_LIST_DEFINED +#if defined(__GNUC__) + typedef __gnuc_va_list va_list; +#elif defined(_MSC_VER) + typedef _Writable_bytes_(_Inexpressible_("length varies")) char * va_list; +#endif +#endif + #ifndef _ERRCODE_DEFINED #define _ERRCODE_DEFINED typedef int errcode; diff --git a/include/crt/excpt.h b/include/crt/excpt.h index 355a077b738..23a4477527f 100644 --- a/include/crt/excpt.h +++ b/include/crt/excpt.h @@ -53,7 +53,7 @@ typedef enum _EXCEPTION_DISPOSITION _Inout_ struct _DISPATCHER_CONTEXT *_DispatcherContext, _In_ unsigned __int64 _GlobalPointer); -#elif defined(__x86_64) +#elif defined(__x86_64) || defined(_M_ARM) struct _EXCEPTION_RECORD; struct _CONTEXT; diff --git a/include/crt/mingw32/intrin_x86.h b/include/crt/mingw32/intrin_x86.h index c7a71455442..d9dcced3002 100644 --- a/include/crt/mingw32/intrin_x86.h +++ b/include/crt/mingw32/intrin_x86.h @@ -70,6 +70,7 @@ extern "C" { #endif /*** memcopy must be memmove ***/ +void* memmove(void*, const void*, size_t); __INTRIN_INLINE void* memcpy(void* dest, const void* source, size_t num) { return memmove(dest, source, num); @@ -149,6 +150,8 @@ __INTRIN_INLINE char _InterlockedCompareExchange8(volatile char * const Destinat __INTRIN_INLINE short _InterlockedCompareExchange16(volatile short * const Destination, const short Exchange, const short Comperand); __INTRIN_INLINE long _InterlockedCompareExchange(volatile long * const Destination, const long Exchange, const long Comperand); __INTRIN_INLINE void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand); +__INTRIN_INLINE char _InterlockedExchange8(volatile char * const Target, const char Value); +__INTRIN_INLINE short _InterlockedExchange16(volatile short * const Target, const short Value); __INTRIN_INLINE long _InterlockedExchange(volatile long * const Target, const long Value); __INTRIN_INLINE void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value); __INTRIN_INLINE long _InterlockedExchangeAdd16(volatile short * const Addend, const short Value); @@ -198,6 +201,20 @@ __INTRIN_INLINE void * _InterlockedCompareExchangePointer(void * volatile * cons return (void *)__sync_val_compare_and_swap(Destination, Comperand, Exchange); } +__INTRIN_INLINE char _InterlockedExchange8(volatile char * const Target, const char Value) +{ + /* NOTE: __sync_lock_test_and_set would be an acquire barrier, so we force a full barrier */ + __sync_synchronize(); + return __sync_lock_test_and_set(Target, Value); +} + +__INTRIN_INLINE short _InterlockedExchange16(volatile short * const Target, const short Value) +{ + /* NOTE: __sync_lock_test_and_set would be an acquire barrier, so we force a full barrier */ + __sync_synchronize(); + return __sync_lock_test_and_set(Target, Value); +} + __INTRIN_INLINE long _InterlockedExchange(volatile long * const Target, const long Value) { /* NOTE: __sync_lock_test_and_set would be an acquire barrier, so we force a full barrier */ @@ -216,7 +233,7 @@ __INTRIN_INLINE long long _InterlockedExchange64(volatile long long * const Targ __INTRIN_INLINE void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value) { - /* NOTE: ditto */ + /* NOTE: __sync_lock_test_and_set would be an acquire barrier, so we force a full barrier */ __sync_synchronize(); return (void *)__sync_lock_test_and_set(Target, Value); } @@ -346,6 +363,8 @@ __INTRIN_INLINE char _InterlockedCompareExchange8(volatile char * const Destinat __INTRIN_INLINE short _InterlockedCompareExchange16(volatile short * const Destination, const short Exchange, const short Comperand); __INTRIN_INLINE long _InterlockedCompareExchange(volatile long * const Destination, const long Exchange, const long Comperand); __INTRIN_INLINE void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand); +__INTRIN_INLINE char _InterlockedExchange8(volatile char * const Target, const char Value); +__INTRIN_INLINE short _InterlockedExchange16(volatile short * const Target, const short Value); __INTRIN_INLINE long _InterlockedExchange(volatile long * const Target, const long Value); __INTRIN_INLINE void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value); __INTRIN_INLINE long _InterlockedExchangeAdd16(volatile short * const Addend, const short Value); @@ -396,6 +415,20 @@ __INTRIN_INLINE void * _InterlockedCompareExchangePointer(void * volatile * cons return retval; } +__INTRIN_INLINE char _InterlockedExchange8(volatile char * const Target, const char Value) +{ + char retval = Value; + __asm__("xchgb %[retval], %[Target]" : [retval] "+r" (retval) : [Target] "m" (*Target) : "memory"); + return retval; +} + +__INTRIN_INLINE short _InterlockedExchange16(volatile short * const Target, const short Value) +{ + short retval = Value; + __asm__("xchgw %[retval], %[Target]" : [retval] "+r" (retval) : [Target] "m" (*Target) : "memory"); + return retval; +} + __INTRIN_INLINE long _InterlockedExchange(volatile long * const Target, const long Value) { long retval = Value; @@ -1003,6 +1036,7 @@ __INTRIN_INLINE unsigned char _bittestandset(long * const a, const long b); __INTRIN_INLINE unsigned char _rotl8(unsigned char value, unsigned char shift); __INTRIN_INLINE unsigned short _rotl16(unsigned short value, unsigned char shift); __INTRIN_INLINE unsigned int _rotl(unsigned int value, int shift); +__INTRIN_INLINE unsigned __int64 _rotl64(unsigned __int64 value, int shift); __INTRIN_INLINE unsigned int _rotr(unsigned int value, int shift); __INTRIN_INLINE unsigned char _rotr8(unsigned char value, unsigned char shift); __INTRIN_INLINE unsigned short _rotr16(unsigned short value, unsigned char shift); @@ -1114,6 +1148,21 @@ __INTRIN_INLINE unsigned int _rotl(unsigned int value, int shift) return retval; } +#ifdef _M_AMD64 +__INTRIN_INLINE unsigned __int64 _rotl64(unsigned __int64 value, int shift) +{ + unsigned __int64 retval; + __asm__("rolq %b[shift], %k[retval]" : [retval] "=rm" (retval) : "[retval]" (value), [shift] "Nc" (shift)); + return retval; +} +#else +__INTRIN_INLINE unsigned __int64 _rotl64(unsigned __int64 value, int shift) +{ + /* FIXME: this is probably not optimal */ + return (value << shift) | (value >> (64 - shift)); +} +#endif + __INTRIN_INLINE unsigned int _rotr(unsigned int value, int shift) { unsigned long retval; diff --git a/include/crt/msc/intrin.h b/include/crt/msc/intrin.h index c85463f6db2..f991c356df1 100644 --- a/include/crt/msc/intrin.h +++ b/include/crt/msc/intrin.h @@ -29,52 +29,84 @@ void _mm_lfence(void); #pragma intrinsic(_mm_lfence) void _mm_sfence(void); #pragma intrinsic(_mm_sfence) +void __nvreg_restore_fence(void); +void __nvreg_save_fence(void); #endif -#ifdef _M_AMD64 +#if defined(_M_AMD64) void __faststorefence(void); #pragma intrinsic(__faststorefence) +#elif defined(_M_ARM) +__int16 __iso_volatile_load16(const volatile __int16 *); +#pragma intrinsic(__iso_volatile_load16) +__int32 __iso_volatile_load32(const volatile __int32 *); +#pragma intrinsic(__iso_volatile_load32) +__int64 __iso_volatile_load64(const volatile __int64 *); +#pragma intrinsic(__iso_volatile_load64) +__int8 __iso_volatile_load8(const volatile __int8 *); +#pragma intrinsic(__iso_volatile_load8) +void __iso_volatile_store16(volatile __int16 *, __int16); +#pragma intrinsic(__iso_volatile_store16) +void __iso_volatile_store32(volatile __int32 *, __int32); +#pragma intrinsic(__iso_volatile_store32) +void __iso_volatile_store64(volatile __int64 *, __int64); +#pragma intrinsic(__iso_volatile_store64) +void __iso_volatile_store8(volatile __int8 *, __int8); +#pragma intrinsic(__iso_volatile_store8) #endif /*** Atomic operations ***/ -long _InterlockedCompareExchange(volatile long * Destination, long Exchange, long Comperand); +long _InterlockedCompareExchange(_Interlocked_operand_ volatile long * Destination, long Exchange, long Comperand); #pragma intrinsic(_InterlockedCompareExchange) -long _InterlockedExchange(volatile long * Target, long Value); +char _InterlockedCompareExchange8(_Interlocked_operand_ char volatile * Destination, char Exchange, char Comparand); +#pragma intrinsic(_InterlockedCompareExchange8) +short _InterlockedCompareExchange16(_Interlocked_operand_ short volatile * Destination, short Exchange, short Comparand); +#pragma intrinsic(_InterlockedCompareExchange16) +__int64 _InterlockedCompareExchange64(_Interlocked_operand_ volatile __int64 * Destination, __int64 Exchange, __int64 Comperand); +#pragma intrinsic(_InterlockedCompareExchange64) +long _InterlockedExchange(_Interlocked_operand_ volatile long * Target, long Value); #pragma intrinsic(_InterlockedExchange) -long _InterlockedExchangeAdd(volatile long * Addend, long Value); +char _InterlockedExchange8(_Interlocked_operand_ char volatile * Target, char Value); +#pragma intrinsic(_InterlockedExchange8) +short _InterlockedExchange16(_Interlocked_operand_ short volatile * Target, short Value); +#pragma intrinsic(_InterlockedExchange16) +long _InterlockedExchangeAdd(_Interlocked_operand_ volatile long * Addend, long Value); #pragma intrinsic(_InterlockedExchangeAdd) -char _InterlockedAnd8(volatile char * value, char mask); +char _InterlockedExchangeAdd8(_Interlocked_operand_ char volatile * Addend, char Value); +#pragma intrinsic(_InterlockedExchangeAdd8) +short _InterlockedExchangeAdd16(_Interlocked_operand_ short volatile * Addend, short Value); +#pragma intrinsic(_InterlockedExchangeAdd16) +char _InterlockedAnd8(_Interlocked_operand_ volatile char * value, char mask); #pragma intrinsic(_InterlockedAnd8) -short _InterlockedAnd16(volatile short * value, short mask); +short _InterlockedAnd16(_Interlocked_operand_ volatile short * value, short mask); #pragma intrinsic(_InterlockedAnd16) -long _InterlockedAnd(volatile long * value, long mask); +long _InterlockedAnd(_Interlocked_operand_ volatile long * value, long mask); #pragma intrinsic(_InterlockedAnd) -char _InterlockedOr8(volatile char * value, char mask); +char _InterlockedOr8(_Interlocked_operand_ volatile char * value, char mask); #pragma intrinsic(_InterlockedOr8) -short _InterlockedOr16(volatile short * value, short mask); +short _InterlockedOr16(_Interlocked_operand_ volatile short * value, short mask); #pragma intrinsic(_InterlockedOr16) -long _InterlockedOr(volatile long * value, long mask); +long _InterlockedOr(_Interlocked_operand_ volatile long * value, long mask); #pragma intrinsic(_InterlockedOr) -char _InterlockedXor8(volatile char * value, char mask); +char _InterlockedXor8(_Interlocked_operand_ volatile char * value, char mask); #pragma intrinsic(_InterlockedXor8) -short _InterlockedXor16(volatile short * value, short mask); +short _InterlockedXor16(_Interlocked_operand_ volatile short * value, short mask); #pragma intrinsic(_InterlockedXor16) -long _InterlockedXor(volatile long * value, long mask); +long _InterlockedXor(_Interlocked_operand_ volatile long * value, long mask); #pragma intrinsic(_InterlockedXor) -long _InterlockedDecrement(volatile long * lpAddend); +long _InterlockedDecrement(_Interlocked_operand_ volatile long * lpAddend); #pragma intrinsic(_InterlockedDecrement) -long _InterlockedIncrement(volatile long * lpAddend); +long _InterlockedIncrement(_Interlocked_operand_ volatile long * lpAddend); #pragma intrinsic(_InterlockedIncrement) -short _InterlockedDecrement16(volatile short * lpAddend); +short _InterlockedDecrement16(_Interlocked_operand_ volatile short * lpAddend); #pragma intrinsic(_InterlockedDecrement16) -short _InterlockedIncrement16(volatile short * lpAddend); +short _InterlockedIncrement16(_Interlocked_operand_ volatile short * lpAddend); #pragma intrinsic(_InterlockedIncrement16) unsigned char _interlockedbittestandreset(volatile long * a, long b); #pragma intrinsic(_interlockedbittestandreset) unsigned char _interlockedbittestandset(volatile long * a, long b); #pragma intrinsic(_interlockedbittestandset) - #if defined(_M_IX86) -long _InterlockedAddLargeStatistic(volatile __int64 * Addend, long Value); +long _InterlockedAddLargeStatistic(_Interlocked_operand_ volatile __int64 * Addend, long Value); #pragma intrinsic(_InterlockedAddLargeStatistic) #elif defined(_M_AMD64) __int64 _InterlockedExchange64(volatile __int64 * Target, __int64 Value); @@ -85,12 +117,12 @@ void * _InterlockedCompareExchangePointer(void * volatile * Destination, void * #pragma intrinsic(_InterlockedCompareExchangePointer) void * _InterlockedExchangePointer(void * volatile * Target, void * Value); #pragma intrinsic(_InterlockedExchangePointer) +unsigned char _InterlockedCompareExchange128(_Interlocked_operand_ volatile __int64 * Destination, __int64 ExchangeHigh, __int64 ExchangeLow, __int64 * ComparandResult); +#pragma intrinsic(_InterlockedCompareExchange128) __int64 _InterlockedAnd64(volatile __int64 * value, __int64 mask); #pragma intrinsic(_InterlockedAnd64) __int64 _InterlockedOr64(volatile __int64 * value, __int64 mask); #pragma intrinsic(_InterlockedOr64) -__int64 _InterlockedCompareExchange64(volatile __int64 * Destination, __int64 Exchange, __int64 Comperand); -#pragma intrinsic(_InterlockedCompareExchange64) __int64 _InterlockedDecrement64(volatile __int64 * lpAddend); #pragma intrinsic(_InterlockedDecrement64) __int64 _InterlockedIncrement64(volatile __int64 * lpAddend); @@ -99,10 +131,161 @@ unsigned char _interlockedbittestandreset64(volatile __int64 * a, __int64 b); #pragma intrinsic(_interlockedbittestandreset64) unsigned char _interlockedbittestandset64(volatile __int64 * a, __int64 b); #pragma intrinsic(_interlockedbittestandset64) +long _InterlockedAnd_np(volatile long * Value, long Mask); +#pragma intrinsic(_InterlockedAnd_np) +char _InterlockedAnd8_np(volatile char * Value, char Mask); +#pragma intrinsic(_InterlockedAnd8_np) +short _InterlockedAnd16_np(volatile short * Value, short Mask); +#pragma intrinsic(_InterlockedAnd16_np) +__int64 _InterlockedAnd64_np(volatile __int64 * Value, __int64 Mask); +#pragma intrinsic(_InterlockedAnd64_np) +short _InterlockedCompareExchange16_np(volatile short * Destination, short Exchange, short Comparand); +#pragma intrinsic(_InterlockedCompareExchange16_np) +__int64 _InterlockedCompareExchange64_np(volatile __int64 * Destination, __int64 Exchange, __int64 Comparand); +#pragma intrinsic(_InterlockedCompareExchange64_np) +unsigned char _InterlockedCompareExchange128_np(volatile __int64 * Destination, __int64 ExchangeHigh, __int64 ExchangeLow, __int64 * ComparandResult); +#pragma intrinsic(_InterlockedCompareExchange128_np) +void * _InterlockedCompareExchangePointer_np(void * volatile * Destination, void * Exchange, void * Comparand); +#pragma intrinsic(_InterlockedCompareExchangePointer_np) +long _InterlockedCompareExchange_np(volatile long * Destination, long Exchange, long Comparand); +#pragma intrinsic(_InterlockedCompareExchange_np) +short _InterlockedOr16_np(volatile short * Value, short Mask); +#pragma intrinsic(_InterlockedOr16_np) +char _InterlockedOr8_np(volatile char * Value, char Mask); +#pragma intrinsic(_InterlockedOr8_np) +long _InterlockedOr_np(volatile long * Value, long Mask); +#pragma intrinsic(_InterlockedOr_np) +short _InterlockedXor16_np(volatile short * Value, short Mask); +#pragma intrinsic(_InterlockedXor16_np) +__int64 _InterlockedXor64_np(volatile __int64 * Value, __int64 Mask); +#pragma intrinsic(_InterlockedXor64_np) +char _InterlockedXor8_np(volatile char * Value, char Mask); +#pragma intrinsic(_InterlockedXor8_np) +long _InterlockedXor_np(volatile long * Value, long Mask); +#pragma intrinsic(_InterlockedXor_np) +__int64 _InterlockedOr64_np(volatile __int64 * Value, __int64 Mask); +#pragma intrinsic(_InterlockedOr64_np) +#elif defined(_M_ARM) +long _InterlockedAdd(_Interlocked_operand_ long volatile * Addend, long Value); +__int64 _InterlockedAdd64(_Interlocked_operand_ __int64 volatile * Addend, __int64 Value); +__int64 _InterlockedAdd64_acq(__int64 volatile * Addend, __int64 Value); +__int64 _InterlockedAdd64_nf(__int64 volatile * Addend, __int64 Value); +__int64 _InterlockedAdd64_rel(__int64 volatile * Addend, __int64 Value); +long _InterlockedAdd_acq(long volatile * Addend, long Value); +long _InterlockedAdd_nf(long volatile * Addend, long Value); +long _InterlockedAdd_rel(long volatile * Addend, long Value); +short _InterlockedAnd16_acq(short volatile * Value, short Mask); +short _InterlockedAnd16_nf(short volatile * Value, short Mask); +short _InterlockedAnd16_rel(short volatile * Value, short Mask); +__int64 _InterlockedAnd64_acq(__int64 volatile * Value, __int64 Mask); +__int64 _InterlockedAnd64_nf(__int64 volatile * Value, __int64 Mask); +__int64 _InterlockedAnd64_rel(__int64 volatile * Value, __int64 Mask); +char _InterlockedAnd8_acq(char volatile * Value, char Mask); +char _InterlockedAnd8_nf(char volatile * Value, char Mask); +char _InterlockedAnd8_rel(char volatile * Value, char Mask); +long _InterlockedAnd_acq(long volatile * Value, long Mask); +long _InterlockedAnd_nf(long volatile * Value, long Mask); +long _InterlockedAnd_rel(long volatile * Value, long Mask); +short _InterlockedCompareExchange16_acq(short volatile * Destination, short Exchange, short Comparand); +short _InterlockedCompareExchange16_nf(short volatile * Destination, short Exchange, short Comparand); +short _InterlockedCompareExchange16_rel(short volatile * Destination, short Exchange, short Comparand); +__int64 _InterlockedCompareExchange64_acq(__int64 volatile * Destination, __int64 Exchange, __int64 Comparand); +__int64 _InterlockedCompareExchange64_nf(__int64 volatile * Destination, __int64 Exchange, __int64 Comparand); +__int64 _InterlockedCompareExchange64_rel(__int64 volatile * Destination, __int64 Exchange, __int64 Comparand); +char _InterlockedCompareExchange8_acq(char volatile * Destination, char Exchange, char Comparand); +char _InterlockedCompareExchange8_nf(char volatile * Destination, char Exchange, char Comparand); +char _InterlockedCompareExchange8_rel(char volatile * Destination, char Exchange, char Comparand); +void * _InterlockedCompareExchangePointer_acq(void * volatile * Destination, void * Exchange, void * Comparand); +void * _InterlockedCompareExchangePointer_nf(void * volatile * Destination, void * Exchange, void * Comparand); +void * _InterlockedCompareExchangePointer_rel(void * volatile * Destination, void * Exchange, void * Comparand); +long _InterlockedCompareExchange_acq(long volatile * Destination, long Exchange, long Comparand); +long _InterlockedCompareExchange_nf(long volatile * Destination, long Exchange, long Comparand); +long _InterlockedCompareExchange_rel(long volatile * Destination, long Exchange, long Comparand); +short _InterlockedDecrement16_acq(short volatile * Addend); +short _InterlockedDecrement16_nf(short volatile * Addend); +short _InterlockedDecrement16_rel(short volatile * Addend); +__int64 _InterlockedDecrement64_acq(__int64 volatile * Addend); +__int64 _InterlockedDecrement64_nf(__int64 volatile * Addend); +__int64 _InterlockedDecrement64_rel(__int64 volatile * Addend); +long _InterlockedDecrement_acq(long volatile * Addend); +long _InterlockedDecrement_nf(long volatile * Addend); +long _InterlockedDecrement_rel(long volatile * Addend); +short _InterlockedExchange16_acq(short volatile * Target, short Value); +short _InterlockedExchange16_nf(short volatile * Target, short Value); +__int64 _InterlockedExchange64_acq(__int64 volatile * Target, __int64 Value); +__int64 _InterlockedExchange64_nf(__int64 volatile * Target, __int64 Value); +char _InterlockedExchange8_acq(char volatile * Target, char Value); +char _InterlockedExchange8_nf(char volatile * Target, char Value); +short _InterlockedExchangeAdd16_acq(short volatile * Addend, short Value); +short _InterlockedExchangeAdd16_nf(short volatile * Addend, short Value); +short _InterlockedExchangeAdd16_rel(short volatile * Addend, short Value); +__int64 _InterlockedExchangeAdd64_acq(__int64 volatile * Addend, __int64 Value); +__int64 _InterlockedExchangeAdd64_nf(__int64 volatile * Addend, __int64 Value); +__int64 _InterlockedExchangeAdd64_rel(__int64 volatile * Addend, __int64 Value); +char _InterlockedExchangeAdd8_acq(char volatile * Addend, char Value); +char _InterlockedExchangeAdd8_nf(char volatile * Addend, char Value); +char _InterlockedExchangeAdd8_rel(char volatile * Addend, char Value); +long _InterlockedExchangeAdd_acq(long volatile * Addend, long Value); +long _InterlockedExchangeAdd_nf(long volatile * Addend, long Value); +long _InterlockedExchangeAdd_rel(long volatile * Addend, long Value); +void * _InterlockedExchangePointer_acq(void * volatile * Target, void * Value); +void * _InterlockedExchangePointer_nf(void * volatile * Target, void * Value); +long _InterlockedExchange_acq(long volatile * Target, long Value); +long _InterlockedExchange_nf(long volatile * Target, long Value); +short _InterlockedIncrement16_acq(short volatile * Addend); +short _InterlockedIncrement16_nf(short volatile * Addend); +short _InterlockedIncrement16_rel(short volatile * Addend); +__int64 _InterlockedIncrement64_acq(__int64 volatile * Addend); +__int64 _InterlockedIncrement64_nf(__int64 volatile * Addend); +__int64 _InterlockedIncrement64_rel(__int64 volatile * Addend); +long _InterlockedIncrement_acq(long volatile * Addend); +long _InterlockedIncrement_nf(long volatile * Addend); +long _InterlockedIncrement_rel(long volatile * Addend); +short _InterlockedOr16_acq(short volatile * Value, short Mask); +short _InterlockedOr16_nf(short volatile * Value, short Mask); +short _InterlockedOr16_rel(short volatile * Value, short Mask); +__int64 _InterlockedOr64_acq(__int64 volatile * Value, __int64 Mask); +__int64 _InterlockedOr64_nf(__int64 volatile * Value, __int64 Mask); +__int64 _InterlockedOr64_rel(__int64 volatile * Value, __int64 Mask); +char _InterlockedOr8_acq(char volatile * Value, char Mask); +char _InterlockedOr8_nf(char volatile * Value, char Mask); +char _InterlockedOr8_rel(char volatile * Value, char Mask); +long _InterlockedOr_acq(long volatile * Value, long Mask); +long _InterlockedOr_nf(long volatile * Value, long Mask); +long _InterlockedOr_rel(long volatile * Value, long Mask); +short _InterlockedXor16_acq(short volatile * Value, short Mask); +short _InterlockedXor16_nf(short volatile * Value, short Mask); +short _InterlockedXor16_rel(short volatile * Value, short Mask); +__int64 _InterlockedXor64_acq(__int64 volatile * Value, __int64 Mask); +__int64 _InterlockedXor64_nf(__int64 volatile * Value, __int64 Mask); +__int64 _InterlockedXor64_rel(_Interlocked_operand_ __int64 volatile * Value, __int64 Mask); +char _InterlockedXor8_acq(char volatile * Value, char Mask); +char _InterlockedXor8_nf(char volatile * Value, char Mask); +char _InterlockedXor8_rel(char volatile * Value, char Mask); +long _InterlockedXor_acq(long volatile * Value, long Mask); +long _InterlockedXor_nf(long volatile * Value, long Mask); +long _InterlockedXor_rel(long volatile * Value, long Mask); +unsigned char _interlockedbittestandreset_acq(long volatile *, long); +unsigned char _interlockedbittestandreset_nf(long volatile *, long); +unsigned char _interlockedbittestandreset_rel(long volatile *, long); +unsigned char _interlockedbittestandset_acq(long volatile *, long); +unsigned char _interlockedbittestandset_nf(long volatile *, long); +unsigned char _interlockedbittestandset_rel(long volatile *, long); +#endif +#if defined(_M_AMD64) || defined(_M_ARM) +__int64 _InterlockedAnd64(_Interlocked_operand_ __int64 volatile * Value, __int64 Mask); +void * _InterlockedCompareExchangePointer(_Interlocked_operand_ void * volatile * Destination, void * Exchange, void * Comparand); +__int64 _InterlockedDecrement64(_Interlocked_operand_ __int64 volatile * Addend); +__int64 _InterlockedExchange64(_Interlocked_operand_ __int64 volatile * Target, __int64 Value); +__int64 _InterlockedExchangeAdd64(_Interlocked_operand_ __int64 volatile * Addend, __int64 Value); +void * _InterlockedExchangePointer(_Interlocked_operand_ void * volatile * Target, void * Value); +__int64 _InterlockedIncrement64(_Interlocked_operand_ __int64 volatile * Addend); +__int64 _InterlockedOr64(_Interlocked_operand_ __int64 volatile * Value, __int64 Mask); +__int64 _InterlockedXor64(_Interlocked_operand_ __int64 volatile * Value, __int64 Mask); #endif -#if defined(_M_IX86) || defined(_M_AMD64) /*** String operations ***/ +#if defined(_M_IX86) || defined(_M_AMD64) void __stosb(unsigned char * Dest, unsigned char Data, size_t Count); #pragma intrinsic(__stosb) void __stosw(unsigned short * Dest, unsigned short Data, size_t Count); @@ -123,8 +306,8 @@ void __movsq(unsigned __int64 * Destination, unsigned __int64 const * Source, si #pragma intrinsic(__movsq) #endif -#if defined(_M_AMD64) /*** GS segment addressing ***/ +#if defined(_M_AMD64) void __writegsbyte(unsigned long Offset, unsigned char Data); #pragma intrinsic(__writegsbyte) void __writegsword(unsigned long Offset, unsigned short Data); @@ -147,24 +330,28 @@ void __incgsword(unsigned long Offset); #pragma intrinsic(__incgsword) void __incgsdword(unsigned long Offset); #pragma intrinsic(__incgsdword) +void __incgsqword(unsigned long); +#pragma intrinsic(__incgsqword) void __addgsbyte(unsigned long Offset, unsigned char Data); #pragma intrinsic(__addgsbyte) void __addgsword(unsigned long Offset, unsigned short Data); #pragma intrinsic(__addgsword) -void __addgsdword(unsigned long Offset, unsigned int Data); +void __addgsdword(unsigned long Offset, unsigned long Data); #pragma intrinsic(__addgsdword) void __addgsqword(unsigned long Offset, unsigned __int64 Data); #pragma intrinsic(__addgsqword) #endif -#if defined(_M_IX86) /*** FS segment addressing ***/ +#if defined(_M_IX86) void __writefsbyte(unsigned long Offset, unsigned char Data); #pragma intrinsic(__writefsbyte) void __writefsword(unsigned long Offset, unsigned short Data); #pragma intrinsic(__writefsword) void __writefsdword(unsigned long Offset, unsigned long Data); #pragma intrinsic(__writefsdword) +void __writefsqword(unsigned long Offset, unsigned __int64 Data); +#pragma intrinsic(__writefsdword) unsigned char __readfsbyte(unsigned long Offset); #pragma intrinsic(__readfsbyte) unsigned short __readfsword(unsigned long Offset); @@ -181,11 +368,10 @@ void __addfsbyte(unsigned long Offset, unsigned char Data); #pragma intrinsic(__addfsbyte) void __addfsword(unsigned long Offset, unsigned short Data); #pragma intrinsic(__addfsword) -void __addfsdword(unsigned long Offset, unsigned int Data); +void __addfsdword(unsigned long Offset, unsigned long Data); #pragma intrinsic(__addfsdword) #endif - /*** Bit manipulation ***/ unsigned char _BitScanForward(unsigned long * Index, unsigned long Mask); #pragma intrinsic(_BitScanForward) @@ -209,14 +395,22 @@ unsigned char _rotl8(unsigned char value, unsigned char shift); #pragma intrinsic(_rotl8) unsigned short _rotl16(unsigned short value, unsigned char shift); #pragma intrinsic(_rotl16) -unsigned int _rotl(unsigned int value, int shift); +_Check_return_ unsigned int _rotl(unsigned int value, int shift); #pragma intrinsic(_rotl) -unsigned int _rotr(unsigned int value, int shift); -#pragma intrinsic(_rotr) +_Check_return_ unsigned __int64 __cdecl _rotl64(_In_ unsigned __int64 Value, _In_ int Shift); +#pragma intrinsic(_rotl64) +_Check_return_ unsigned long __cdecl _lrotl(_In_ unsigned long, _In_ int); +#pragma intrinsic(_lrotl) unsigned char _rotr8(unsigned char value, unsigned char shift); #pragma intrinsic(_rotr8) unsigned short _rotr16(unsigned short value, unsigned char shift); #pragma intrinsic(_rotr16) +_Check_return_ unsigned int _rotr(unsigned int value, int shift); +#pragma intrinsic(_rotr) +_Check_return_ unsigned __int64 __cdecl _rotr64(_In_ unsigned __int64 Value, _In_ int Shift); +#pragma intrinsic(_rotr64) +_Check_return_ unsigned long __cdecl _lrotr(_In_ unsigned long, _In_ int); +#pragma intrinsic(_lrotr) unsigned short _byteswap_ushort(unsigned short value); #pragma intrinsic(_byteswap_ushort) unsigned long _byteswap_ulong(unsigned long value); @@ -230,26 +424,86 @@ __int64 __ll_rshift(__int64 Mask, int Bit); #pragma intrinsic(__ll_rshift) unsigned __int64 __ull_rshift(unsigned __int64 Mask, int Bit); #pragma intrinsic(__ull_rshift) +unsigned int __lzcnt(unsigned int Value); +#pragma intrinsic(__lzcnt) +unsigned short __lzcnt16(unsigned short Value); +#pragma intrinsic(__lzcnt16) +unsigned int __popcnt(unsigned int Value); +#pragma intrinsic(__popcnt) +unsigned short __popcnt16(unsigned short Value); +#pragma intrinsic(__popcnt16) #endif #ifdef _M_AMD64 +unsigned __int64 __shiftleft128(unsigned __int64 LowPart, unsigned __int64 HighPart, unsigned char Shift); +#pragma intrinsic(__shiftleft128) +unsigned __int64 __shiftright128(unsigned __int64 LowPart, unsigned __int64 HighPart, unsigned char Shift); +#pragma intrinsic(__shiftright128) unsigned char _bittest64(__int64 const *a, __int64 b); #pragma intrinsic(_bittest64) +unsigned char _bittestandcomplement64(__int64 *a, __int64 b); +#pragma intrinsic(_bittestandcomplement64) +unsigned char _bittestandreset64(__int64 *a, __int64 b); +#pragma intrinsic(_bittestandreset64) +unsigned char _bittestandset64(__int64 *a, __int64 b); +#pragma intrinsic(_bittestandset64) +unsigned __int64 __lzcnt64(unsigned __int64 Value); +#pragma intrinsic(__lzcnt64) +unsigned __int64 __popcnt64(unsigned __int64 Value); +#pragma intrinsic(__popcnt64) +#elif defined(_M_ARM) +unsigned int _CountLeadingOnes(unsigned long Value); +unsigned int _CountLeadingOnes64(unsigned __int64 Value); +unsigned int _CountLeadingSigns(long Value); +unsigned int _CountLeadingSigns64(__int64 Value); +unsigned int _CountLeadingZeros(unsigned long Value); +unsigned int _CountLeadingZeros64(unsigned __int64 Value); +unsigned int _CountOneBits(unsigned long Value); +unsigned int _CountOneBits64(unsigned __int64 Value); #endif +/*** 64/128-bit math ***/ +__int64 __cdecl _abs64(__int64); +#pragma intrinsic(_abs64) #if defined(_M_IX86) || defined(_M_AMD64) -/*** 64-bit math ***/ __int64 __emul(int a, int b); #pragma intrinsic(__emul) unsigned __int64 __emulu(unsigned int a, unsigned int b); #pragma intrinsic(__emulu) #endif #ifdef _M_AMD64 +__int64 __mulh(__int64 a, __int64 b); +#pragma intrinsic(__mulh) unsigned __int64 __umulh(unsigned __int64 a, unsigned __int64 b); #pragma intrinsic(__umulh) +__int64 _mul128(__int64 Multiplier, __int64 Multiplicand, __int64 * HighProduct); +#pragma intrinsic(_mul128) +unsigned __int64 _umul128(unsigned __int64 Multiplier, unsigned __int64 Multiplicand, unsigned __int64 * HighProduct); +#pragma intrinsic(_umul128) +#elif defined(_M_ARM) +long _MulHigh(long Multiplier, long Multiplicand); +#pragma intrinsic(_MulHigh) +unsigned long _MulUnsignedHigh(unsigned long Multiplier, unsigned long Multiplicand); +#pragma intrinsic(_MulUnsignedHigh) +#endif + +/** Floating point stuff **/ +#if defined(_M_ARM) +int _isunordered(double arg1, double arg2); +#pragma intrinsic(_isunordered) +int _isunorderedf(float arg1, float arg2); +#pragma intrinsic(_isunorderedf) +double _CopyDoubleFromInt64(__int64); +#pragma intrinsic(_CopyDoubleFromInt64) +float _CopyFloatFromInt32(__int32); +#pragma intrinsic(_CopyFloatFromInt32) +__int32 _CopyInt32FromFloat(float); +#pragma intrinsic(_CopyInt32FromFloat) +__int64 _CopyInt64FromDouble(double); +#pragma intrinsic(_CopyInt64FromDouble) #endif -#if defined(_M_IX86) || defined(_M_AMD64) /*** Port I/O ***/ +#if defined(_M_IX86) || defined(_M_AMD64) unsigned char __inbyte(unsigned short Port); #pragma intrinsic(__inbyte) unsigned short __inword(unsigned short Port); @@ -274,21 +528,49 @@ void __outwordstring(unsigned short Port, unsigned short * Buffer, unsigned long #pragma intrinsic(__outwordstring) void __outdwordstring(unsigned short Port, unsigned long * Buffer, unsigned long Count); #pragma intrinsic(__outdwordstring) +int __cdecl _inp(unsigned short Port); +#pragma intrinsic(_inp) +unsigned long __cdecl _inpd(unsigned short Port); +#pragma intrinsic(_inpd) +unsigned short __cdecl _inpw(unsigned short Port); +#pragma intrinsic(_inpw) +int __cdecl inp(unsigned short Port); +#pragma intrinsic(inp) +unsigned long __cdecl inpd(unsigned short Port); +#pragma intrinsic(inpd) +unsigned short __cdecl inpw(unsigned short Port); +#pragma intrinsic(inpw) +int __cdecl _outp(unsigned short Port, int Value); +#pragma intrinsic(_outp) +unsigned long __cdecl _outpd(unsigned short Port, unsigned long Value); +#pragma intrinsic(_outpd) +unsigned short __cdecl _outpw(unsigned short Port, unsigned short Value); +#pragma intrinsic(_outpw) +int __cdecl outp(unsigned short Port, int Value); +#pragma intrinsic(outp) +unsigned long __cdecl outpd(unsigned short Port, unsigned long Value); +#pragma intrinsic(outpd) +unsigned short __cdecl outpw(unsigned short Port, unsigned short Value); +#pragma intrinsic(outpw) #endif -#if defined(_M_IX86) || defined(_M_AMD64) /*** System information ***/ -void __cpuid(int CPUInfo[], int InfoType); +#if defined(_M_IX86) || defined(_M_AMD64) +void __cpuid(int CPUInfo[4], int InfoType); #pragma intrinsic(__cpuid) +void __cpuidex(int CPUInfo[4], int InfoType, int ECXValue); +#pragma intrinsic(__cpuidex) unsigned __int64 __rdtsc(void); #pragma intrinsic(__rdtsc) +unsigned __int64 __rdtscp(unsigned int *); +#pragma intrinsic(__rdtscp) void __writeeflags(uintptr_t Value); #pragma intrinsic(__writeeflags) uintptr_t __readeflags(void); #pragma intrinsic(__readeflags) #endif -/*** Interrupts ***/ +/*** Interrupts and traps ***/ void __debugbreak(void); #pragma intrinsic(__debugbreak) void _disable(void); @@ -300,49 +582,46 @@ void __int2c(void); #pragma intrinsic(__int2c) void __halt(void); #pragma intrinsic(__halt) +void __ud2(void); +#pragma intrinsic(__ud2) +#if (_MSC_VER >= 1700) +__declspec(noreturn) void __fastfail(unsigned int Code); +#pragma intrinsic(__fastfail) +#endif +#endif +#if defined(_M_ARM) +int __trap(int Arg1, ...); #endif /*** Protected memory management ***/ #if defined(_M_IX86) || defined(_M_AMD64) -void __writecr0(unsigned __int64 Data); +void __writecr0(uintptr_t Data); #pragma intrinsic(__writecr0) -void __writecr3(unsigned __int64 Data); +void __writecr3(uintptr_t Data); #pragma intrinsic(__writecr3) -void __writecr4(unsigned __int64 Data); +void __writecr4(uintptr_t Data); #pragma intrinsic(__writecr4) -#endif -#ifdef _M_AMD64 -void __writecr8(unsigned __int64 Data); +void __writecr8(uintptr_t Data); #pragma intrinsic(__writecr8) -unsigned __int64 __readcr0(void); -#pragma intrinsic(__readcr0) -unsigned __int64 __readcr2(void); -#pragma intrinsic(__readcr2) -unsigned __int64 __readcr3(void); -#pragma intrinsic(__readcr3) -unsigned __int64 __readcr4(void); -#pragma intrinsic(__readcr4) -unsigned __int64 __readcr8(void); -#pragma intrinsic(__readcr8) -unsigned __int64 __readdr(unsigned int reg); -#pragma intrinsic(__readdr) -void __writedr(unsigned reg, unsigned __int64 value); -#pragma intrinsic(__writedr) -#elif defined(_M_IX86) +#endif +#if defined(_M_IX86) unsigned long __readcr0(void); +#pragma intrinsic(__readcr0) unsigned long __readcr2(void); +#pragma intrinsic(__readcr2) unsigned long __readcr3(void); +#pragma intrinsic(__readcr3) //unsigned long __readcr4(void); //#pragma intrinsic(__readcr4) // HACK: MSVC is broken unsigned long ___readcr4(void); #define __readcr4 ___readcr4 - +unsigned long __readcr8(void); +#pragma intrinsic(__readcr8) unsigned int __readdr(unsigned int reg); +#pragma intrinsic(__readdr) void __writedr(unsigned reg, unsigned int value); -#endif - -#ifdef _M_IX86 +#pragma intrinsic(__writedr) // This intrinsic is broken and generates wrong opcodes, // when optimization is enabled! #pragma warning(push) @@ -362,15 +641,33 @@ void __forceinline __invlpg_fixed(void * Address) #elif defined(_M_AMD64) void __invlpg(void * Address); #pragma intrinsic(__invlpg) +#elif defined(_M_AMD64) +unsigned __int64 __readcr0(void); +#pragma intrinsic(__readcr0) +unsigned __int64 __readcr2(void); +#pragma intrinsic(__readcr2) +unsigned __int64 __readcr3(void); +#pragma intrinsic(__readcr3) +unsigned __int64 __readcr4(void); +#pragma intrinsic(__readcr4) +unsigned __int64 __readcr8(void); +#pragma intrinsic(__readcr8) +unsigned __int64 __readdr(unsigned int reg); +#pragma intrinsic(__readdr) +void __writedr(unsigned reg, unsigned __int64 value); +#pragma intrinsic(__writedr) +#elif defined(_M_ARM) +void __cdecl __prefetch(const void *); +#pragma intrinsic(__prefetch) #endif /*** System operations ***/ #if defined(_M_IX86) || defined(_M_AMD64) -unsigned __int64 __readmsr(int reg); +unsigned __int64 __readmsr(unsigned long reg); #pragma intrinsic(__readmsr) void __writemsr(unsigned long Register, unsigned __int64 Value); #pragma intrinsic(__writemsr) -unsigned __int64 __readpmc(int counter); +unsigned __int64 __readpmc(unsigned long counter); #pragma intrinsic(__readpmc) unsigned long __segmentlimit(unsigned long a); #pragma intrinsic(__segmentlimit) @@ -383,6 +680,95 @@ void __sidt(void *Destination); void _mm_pause(void); #pragma intrinsic(_mm_pause) #endif +#if defined(_M_ARM) +unsigned int _MoveFromCoprocessor(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int); +#pragma intrinsic(_MoveFromCoprocessor) +unsigned int _MoveFromCoprocessor2(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int); +#pragma intrinsic(_MoveFromCoprocessor2) +unsigned __int64 _MoveFromCoprocessor64(unsigned int, unsigned int, unsigned int); +#pragma intrinsic(_MoveFromCoprocessor64) +void _MoveToCoprocessor(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int); +#pragma intrinsic(_MoveToCoprocessor) +void _MoveToCoprocessor2(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int); +#pragma intrinsic(_MoveToCoprocessor2) +void _MoveToCoprocessor64(unsigned __int64, unsigned int, unsigned int, unsigned int); +#pragma intrinsic(_MoveToCoprocessor64) +int _ReadStatusReg(int); +#pragma intrinsic(_ReadStatusReg) +void _WriteStatusReg(int, int, int); +#pragma intrinsic(_WriteStatusReg) +void __yield(void); +#pragma intrinsic(__yield) +void __wfe(void); +#pragma intrinsic(__wfe) +void __wfi(void); +#pragma intrinsic(__wfi) +unsigned int __swi(unsigned int, ...); +#pragma intrinsic(__swi) +unsigned int __hvc(unsigned int, ...); +#pragma intrinsic(__hvc) +__int64 __ldrexd(__int64 volatile *); +#pragma intrinsic(__ldrexd) +unsigned __int64 __rdpmccntr64(void); +#pragma intrinsic(__rdpmccntr64) +void __sev(void); +#pragma intrinsic(__sev) +#endif + +/** Secure virtual machine **/ +#if defined(_M_IX86) || defined(_M_AMD64) +void __svm_clgi(void); +#pragma intrinsic(__svm_clgi) +void __svm_invlpga(void * Va, int Asid); +#pragma intrinsic(__svm_invlpga) +void __svm_skinit(int Slb); +#pragma intrinsic(__svm_skinit) +void __svm_stgi(void); +#pragma intrinsic(__svm_stgi) +void __svm_vmload(uintptr_t VmcbPhysicalAddress); +#pragma intrinsic(__svm_vmload) +void __svm_vmrun(uintptr_t VmcbPhysicalAddress); +#pragma intrinsic(__svm_vmrun) +void __svm_vmsave(uintptr_t VmcbPhysicalAddress); +#pragma intrinsic(__svm_vmsave) +#endif + +/** Virtual machine extension **/ +#if defined(_M_IX86) || defined(_M_AMD64) +void __vmx_off(void); +void __vmx_vmptrst(unsigned __int64 * VmcsPhysicalAddress ); +#endif +#if defined(_M_AMD64) +unsigned char __vmx_on(unsigned __int64 * VmsSupportPhysicalAddress); +unsigned char __vmx_vmclear(unsigned __int64 * VmcsPhysicalAddress); +unsigned char __vmx_vmlaunch(void); +unsigned char __vmx_vmptrld(unsigned __int64 *VmcsPhysicalAddress ); +unsigned char __vmx_vmread(size_t Field, size_t *FieldValue); +unsigned char __vmx_vmresume(void); +unsigned char __vmx_vmwrite(size_t Field, size_t FieldValue); +#endif + +/** Misc **/ +void __nop(void); +#pragma intrinsic(__nop) +#if (_MSC_VER >= 1700) +void __code_seg(const char *); +#pragma intrinsic(__code_seg) +#endif +#ifdef _M_ARM +int _AddSatInt(int, int); +#pragma intrinsic(_AddSatInt) +int _DAddSatInt(int, int); +#pragma intrinsic(_DAddSatInt) +int _DSubSatInt(int, int); +#pragma intrinsic(_DSubSatInt) +int _SubSatInt(int, int); +#pragma intrinsic(_SubSatInt) +void __emit(unsigned __int32); +#pragma intrinsic(__emit) +void __static_assert(int, const char *); +#pragma intrinsic(__static_assert) +#endif #ifdef __cplusplus } diff --git a/include/crt/stdarg.h b/include/crt/stdarg.h index 046d0605d8d..fe1bdb9035a 100644 --- a/include/crt/stdarg.h +++ b/include/crt/stdarg.h @@ -28,124 +28,18 @@ Boston, MA 02110-1301, USA. */ * ISO C Standard: 7.15 Variable arguments */ +#pragma once + #ifndef _INC_STDARG #define _INC_STDARG + +#include +#include + #ifndef _WIN32 #error Only Win32 target is supported! #endif -#ifndef _STDARG_H -#ifndef _ANSI_STDARG_H_ -#ifndef __need___va_list -#define _STDARG_H -#define _ANSI_STDARG_H_ -#endif /* not __need___va_list */ -#undef __need___va_list - -/* Define __gnuc_va_list. */ - -#ifdef __GNUC__ -#ifndef __GNUC_VA_LIST -#define __GNUC_VA_LIST -typedef __builtin_va_list __gnuc_va_list; -#endif -#endif - -/* Define the standard macros for the user, - if this invocation was from the user program. */ -#ifdef _STDARG_H - -#ifdef __GNUC__ -#define va_start(v,l) __builtin_va_start(v,l) -#define va_end(v) __builtin_va_end(v) -#define va_arg(v,l) __builtin_va_arg(v,l) -#if !defined(__STRICT_ANSI__) || __STDC_VERSION__ + 0 >= 199900L -#define va_copy(d,s) __builtin_va_copy(d,s) -#endif -#define __va_copy(d,s) __builtin_va_copy(d,s) -#endif - -/* Define va_list, if desired, from __gnuc_va_list. */ -/* We deliberately do not define va_list when called from - stdio.h, because ANSI C says that stdio.h is not supposed to define - va_list. stdio.h needs to have access to that data type, - but must not use that name. It should use the name __gnuc_va_list, - which is safe because it is reserved for the implementation. */ - -#ifdef _HIDDEN_VA_LIST /* On OSF1, this means varargs.h is "half-loaded". */ -#undef _VA_LIST -#endif - -#ifdef _BSD_VA_LIST -#undef _BSD_VA_LIST -#endif - -#ifdef __GNUC__ -#if defined(__svr4__) || (defined(_SCO_DS) && !defined(__VA_LIST)) -/* SVR4.2 uses _VA_LIST for an internal alias for va_list, - so we must avoid testing it and setting it here. - SVR4 uses _VA_LIST as a flag in stdarg.h, but we should - have no conflict with that. */ -#ifndef _VA_LIST_ -#define _VA_LIST_ -#ifdef __i860__ -#ifndef _VA_LIST -#define _VA_LIST va_list -#endif -#endif /* __i860__ */ -typedef __gnuc_va_list va_list; -#ifdef _SCO_DS -#define __VA_LIST -#endif -#endif /* _VA_LIST_ */ -#else /* not __svr4__ || _SCO_DS */ - -/* The macro _VA_LIST_ is the same thing used by this file in Ultrix. - But on BSD NET2 we must not test or define or undef it. - (Note that the comments in NET 2's ansi.h - are incorrect for _VA_LIST_--see stdio.h!) */ -#if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__) || defined(WINNT) -/* The macro _VA_LIST_DEFINED is used in Windows NT 3.5 */ -#ifndef _VA_LIST_DEFINED -/* The macro _VA_LIST is used in SCO Unix 3.2. */ -#ifndef _VA_LIST -/* The macro _VA_LIST_T_H is used in the Bull dpx2 */ -#ifndef _VA_LIST_T_H -/* The macro __va_list__ is used by BeOS. */ -#ifndef __va_list__ -typedef __gnuc_va_list va_list; -#endif /* not __va_list__ */ -#endif /* not _VA_LIST_T_H */ -#endif /* not _VA_LIST */ -#endif /* not _VA_LIST_DEFINED */ -#if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__)) -#define _VA_LIST_ -#endif -#ifndef _VA_LIST -#define _VA_LIST -#endif -#ifndef _VA_LIST_DEFINED -#define _VA_LIST_DEFINED -#endif -#ifndef _VA_LIST_T_H -#define _VA_LIST_T_H -#endif -#ifndef __va_list__ -#define __va_list__ -#endif - -#endif /* not _VA_LIST_, except on certain systems */ - -#endif /* not __svr4__ */ - -#endif /* __GNUC__ */ -#endif /* _STDARG_H */ - -#endif /* not _ANSI_STDARG_H_ */ -#endif /* not _STDARG_H */ - -#include - #ifndef va_start #define va_start _crt_va_start #endif diff --git a/include/crt/vadefs.h b/include/crt/vadefs.h index 5cd9553cfc7..190e7e6a802 100644 --- a/include/crt/vadefs.h +++ b/include/crt/vadefs.h @@ -20,39 +20,6 @@ extern "C" { #endif -#ifndef _UINTPTR_T_DEFINED -#define _UINTPTR_T_DEFINED -#ifndef __uintptr_t_defined -#define __uintptr_t_defined -#undef uintptr_t -#ifdef _WIN64 -#if defined(__GNUC__) && defined(__STRICT_ANSI__) - typedef unsigned int uintptr_t __attribute__ ((mode (DI))); -#else - __MINGW_EXTENSION typedef unsigned __int64 uintptr_t; -#endif -#else - typedef unsigned long uintptr_t; -#endif -#endif -#endif - -#ifdef __GNUC__ -#ifndef __GNUC_VA_LIST -#define __GNUC_VA_LIST - typedef __builtin_va_list __gnuc_va_list; -#endif -#endif - -#ifndef _VA_LIST_DEFINED -#define _VA_LIST_DEFINED -#if defined(__GNUC__) - typedef __gnuc_va_list va_list; -#elif defined(_MSC_VER) - typedef char * va_list; -#endif -#endif - #ifdef __cplusplus #define _ADDRESSOF(v) (&reinterpret_cast(v)) #else diff --git a/include/ndk/arm/ketypes.h b/include/ndk/arm/ketypes.h index 04b0ebc045e..9ecdd43fd92 100644 --- a/include/ndk/arm/ketypes.h +++ b/include/ndk/arm/ketypes.h @@ -27,6 +27,29 @@ extern "C" { // Dependencies // +// +// CPSR Values +// +#define CPSR_THUMB_ENABLE 0x20 +#define CPSR_FIQ_DISABLE 0x40 +#define CPSR_IRQ_DISABLE 0x80 +#define CPSR_USER_MODE 0x10 +#define CPSR_FIQ_MODE 0x11 +#define CPSR_IRQ_MODE 0x12 +#define CPSR_SVC_MODE 0x13 +#define CPSR_ABORT_MODE 0x17 +#define CPSR_UND_MODE 0x1B +#define CPSR_MODES 0x1F + +// +// C1 Register Values +// +#define C1_MMU_CONTROL 0x01 +#define C1_ALIGNMENT_CONTROL 0x02 +#define C1_DCACHE_CONTROL 0x04 +#define C1_ICACHE_CONTROL 0x1000 +#define C1_VECTOR_CONTROL 0x2000 + // // IPI Types // diff --git a/include/psdk/basetsd.h b/include/psdk/basetsd.h index 9bafa25e4e3..1dd0c7f5fc5 100644 --- a/include/psdk/basetsd.h +++ b/include/psdk/basetsd.h @@ -1,5 +1,8 @@ -#ifndef _BASETSD_H -#define _BASETSD_H +#ifndef _BASETSD_H_ +#define _BASETSD_H_ +#pragma once + +#include #ifndef _M_AMD64 #if !defined(__ROS_LONG64__) @@ -23,30 +26,7 @@ #error Not supported. #endif -#if !defined(_X86_) && !defined(_AMD64_) && !defined(_IA64_) && !defined(_ALPHA_) && \ - !defined(_ARM_) && !defined(_PPC_) && !defined(_MIPS_) && !defined(_68K_) - -#if defined(_M_AMD64) || defined(__x86_64__) -#define _AMD64_ -#elif defined(_M_IX86) || defined(__i386__) -#define _X86_ -#elif defined(_M_IA64) || defined(__ia64__) -#define _IA64_ -#elif defined(_M_ALPHA) || defined(__alpha__) -#define _ALPHA_ -#elif defined(_M_ARM) || defined(__arm__) -#define _ARM_ -#elif defined(_M_PPC) || defined(__powerpc__) -#define _PPC_ -#elif defined(_M_MRX000) || defined(__mips__) -#define _MIPS_ -#elif defined(_M_M68K) || defined(__68k__) -#define _68K_ -#endif - -#endif - -#if !defined(MIDL_PASS) && !defined(RC_INVOKED) +#if defined(_MSC_VER) && !defined(MIDL_PASS) && !defined(RC_INVOKED) #define POINTER_64 __ptr64 #if defined(_WIN64) #define POINTER_32 __ptr32 @@ -56,7 +36,7 @@ #else #define POINTER_64 #define POINTER_32 -#endif /* !defined(MIDL_PASS) && !defined(RC_INVOKED) */ +#endif /* defined(_MSC_VER) && !defined(MIDL_PASS) && !defined(RC_INVOKED) */ #if defined(_M_MRX000) || defined(_M_AMD64) || defined(_M_IA64) typedef unsigned __int64 POINTER_64_INT; @@ -64,6 +44,12 @@ typedef unsigned long POINTER_64_INT; #endif +#if defined(_IA64_) || defined(_AMD64_) + #define FIRMWARE_PTR +#else + #define FIRMWARE_PTR POINTER_32 +#endif + #if 0 /* Not supported yet */ #define POINTER_SIGNED __sptr #define POINTER_UNSIGNED __uptr @@ -214,4 +200,4 @@ typedef KAFFINITY *PKAFFINITY; #endif #endif /* !RC_INVOKED */ -#endif /* _BASETSD_H */ +#endif /* _BASETSD_H_ */ diff --git a/include/psdk/basetyps.h b/include/psdk/basetyps.h index a8dc59ed430..94739736cbc 100644 --- a/include/psdk/basetyps.h +++ b/include/psdk/basetyps.h @@ -1,5 +1,9 @@ + #ifndef _BASETYPS_H #define _BASETYPS_H +#pragma once + +#include #ifndef __OBJC__ # ifdef __cplusplus @@ -29,6 +33,7 @@ # endif #endif +#ifndef STDMETHODCALLTYPE #define STDMETHODCALLTYPE __stdcall #define STDMETHODVCALLTYPE __cdecl #define STDAPICALLTYPE __stdcall @@ -41,6 +46,7 @@ #define STDAPIV_(t) EXTERN_C t STDAPIVCALLTYPE #define STDMETHODIMPV HRESULT STDMETHODVCALLTYPE #define STDMETHODIMPV_(t) t STDMETHODVCALLTYPE +#endif /* !STDMETHODCALLTYPE */ #if defined(__cplusplus) && !defined(CINTERFACE) # define interface struct @@ -72,8 +78,6 @@ # define DECLARE_INTERFACE_(i,b) DECLARE_INTERFACE(i) #endif -#include - #ifndef _ERROR_STATUS_T_DEFINED #define _ERROR_STATUS_T_DEFINED typedef unsigned long error_status_t; diff --git a/include/psdk/guiddef.h b/include/psdk/guiddef.h index be843cc085f..22e532b7cf5 100644 --- a/include/psdk/guiddef.h +++ b/include/psdk/guiddef.h @@ -18,6 +18,7 @@ #ifndef GUID_DEFINED #define GUID_DEFINED + typedef struct _GUID { #ifdef _MSC_VER @@ -31,6 +32,10 @@ typedef struct _GUID } GUID; #endif +#ifndef FAR +#define FAR +#endif + #ifndef DECLSPEC_SELECTANY #define DECLSPEC_SELECTANY __declspec(selectany) #endif @@ -109,6 +114,8 @@ typedef GUID FMTID,*LPFMTID; #define REFFMTID const FMTID* __MIDL_CONST #endif /* !defined(__cplusplus) && !defined(CINTERFACE) */ +#if !defined(__midl) && !defined(__WIDL__) +#include #if defined(__cplusplus) && !defined(CINTERFACE) __inline int InlineIsEqualGUID(REFGUID rguid1, REFGUID rguid2) @@ -131,6 +138,7 @@ __inline int InlineIsEqualGUID(REFGUID rguid1, REFGUID rguid2) #define IsEqualGUID(rguid1, rguid2) (!memcmp(rguid1, rguid2, sizeof(GUID))) #endif /* defined(__cplusplus) && !defined(CINTERFACE) */ +#endif /* __midl && __WIDL__ */ #if defined(__cplusplus) && !defined(CINTERFACE) #include diff --git a/include/psdk/ntdef.h b/include/psdk/ntdef.h index 4b419969be3..d713c81b6fe 100644 --- a/include/psdk/ntdef.h +++ b/include/psdk/ntdef.h @@ -20,24 +20,25 @@ #ifndef _NTDEF_ #define _NTDEF_ +#pragma once /* Dependencies */ #include #include +#include #include #include #include +#include -// FIXME: Shouldn't be included! -#include -#include +#ifdef __cplusplus +extern "C" { +#endif -/* Helper macro to enable gcc's extension. */ -#ifndef __GNU_EXTENSION -#ifdef __GNUC__ -#define __GNU_EXTENSION __extension__ -#else -#define __GNU_EXTENSION +/* Default to strict */ +#ifndef NO_STRICT +#ifndef STRICT +#define STRICT 1 #endif #endif @@ -63,16 +64,6 @@ #define CRITICAL #endif -#ifndef FAR -#define FAR -#endif - - -/* Defines the "size" of an any-size array */ -#ifndef ANYSIZE_ARRAY -#define ANYSIZE_ARRAY 1 -#endif - /* Constant modifier */ #ifndef CONST #define CONST const @@ -93,26 +84,22 @@ #endif #endif /* NULL */ +/* Defines the "size" of an any-size array */ +#ifndef ANYSIZE_ARRAY +#define ANYSIZE_ARRAY 1 +#endif -// -// FIXME -// We should use the -fms-extensions compiler flag for gcc, -// and clean up the mess. -// -#ifndef __ANONYMOUS_DEFINED -#define __ANONYMOUS_DEFINED - -#ifndef NONAMELESSUNION +/* Helper macro to enable gcc's extension. */ +#ifndef __GNU_EXTENSION #ifdef __GNUC__ -#define _ANONYMOUS_UNION __GNU_EXTENSION -#define _ANONYMOUS_STRUCT __GNU_EXTENSION -#elif defined(__WATCOMC__) || defined(_MSC_VER) -#define _ANONYMOUS_UNION -#define _ANONYMOUS_STRUCT -#endif /* __GNUC__/__WATCOMC__ */ -#endif /* NONAMELESSUNION */ +#define __GNU_EXTENSION __extension__ +#else +#define __GNU_EXTENSION +#endif +#endif -#ifndef _ANONYMOUS_UNION +#ifndef DUMMYUNIONNAME +#if defined(NONAMELESSUNION)// || !defined(_MSC_EXTENSIONS) #define _ANONYMOUS_UNION #define _UNION_NAME(x) x #define DUMMYUNIONNAME u @@ -124,7 +111,9 @@ #define DUMMYUNIONNAME6 u6 #define DUMMYUNIONNAME7 u7 #define DUMMYUNIONNAME8 u8 +#define DUMMYUNIONNAME9 u9 #else +#define _ANONYMOUS_UNION __GNU_EXTENSION #define _UNION_NAME(x) #define DUMMYUNIONNAME #define DUMMYUNIONNAME1 @@ -135,9 +124,12 @@ #define DUMMYUNIONNAME6 #define DUMMYUNIONNAME7 #define DUMMYUNIONNAME8 -#endif +#define DUMMYUNIONNAME9 +#endif /* NONAMELESSUNION */ +#endif /* !DUMMYUNIONNAME */ -#ifndef _ANONYMOUS_STRUCT +#ifndef DUMMYSTRUCTNAME +#if defined(NONAMELESSUNION)// || !defined(_MSC_EXTENSIONS) #define _ANONYMOUS_STRUCT #define _STRUCT_NAME(x) x #define DUMMYSTRUCTNAME s @@ -147,6 +139,7 @@ #define DUMMYSTRUCTNAME4 s4 #define DUMMYSTRUCTNAME5 s5 #else +#define _ANONYMOUS_STRUCT __GNU_EXTENSION #define _STRUCT_NAME(x) #define DUMMYSTRUCTNAME #define DUMMYSTRUCTNAME1 @@ -154,11 +147,14 @@ #define DUMMYSTRUCTNAME3 #define DUMMYSTRUCTNAME4 #define DUMMYSTRUCTNAME5 +#endif /* NONAMELESSUNION */ +#endif /* DUMMYSTRUCTNAME */ + +#if defined(STRICT_GS_ENABLED) +#pragma strict_gs_check(push, on) #endif -#endif /* __ANONYMOUS_DEFINED */ - -#if defined(_M_MRX000) || defined(_M_ALPHA) || defined(_M_PPC) || defined(_M_IA64) || defined(_M_AMD64) +#if defined(_M_MRX000) || defined(_M_ALPHA) || defined(_M_PPC) || defined(_M_IA64) || defined(_M_AMD64) || defined(_M_ARM) #define ALIGNMENT_MACHINE #define UNALIGNED __unaligned #if defined(_WIN64) @@ -203,7 +199,7 @@ #endif /* Returns the type's alignment */ -#if defined(_MSC_VER) && (_MSC_VER >= 1300) +#if defined(_MSC_VER) #define TYPE_ALIGNMENT(t) __alignof(t) #else #define TYPE_ALIGNMENT(t) FIELD_OFFSET(struct { char x; t test; }, test) @@ -217,8 +213,20 @@ #error "unknown architecture" #endif +#if defined(_WIN64) +#define PROBE_ALIGNMENT32(_s) TYPE_ALIGNMENT(ULONG) +#endif + +#ifdef __cplusplus +#define EXTERN_C extern "C" +#else +#define EXTERN_C extern +#endif + /* Calling Conventions */ -#if defined(_M_IX86) +#if defined(_MANAGED) +#define FASTCALL __stdcall +#elif defined(_M_IX86) #define FASTCALL __fastcall #else #define FASTCALL @@ -226,6 +234,30 @@ #define NTAPI __stdcall +#ifndef STDMETHODCALLTYPE +#define STDMETHODCALLTYPE __stdcall +#define STDMETHODVCALLTYPE __cdecl +#define STDAPICALLTYPE __stdcall +#define STDAPIVCALLTYPE __cdecl +#define STDAPI EXTERN_C HRESULT STDAPICALLTYPE +#define STDAPI_(t) EXTERN_C t STDAPICALLTYPE +#define STDMETHODIMP HRESULT STDMETHODCALLTYPE +#define STDMETHODIMP_(t) t STDMETHODCALLTYPE +#define STDAPIV EXTERN_C HRESULT STDAPIVCALLTYPE +#define STDAPIV_(t) EXTERN_C t STDAPIVCALLTYPE +#define STDMETHODIMPV HRESULT STDMETHODVCALLTYPE +#define STDMETHODIMPV_(t) t STDMETHODVCALLTYPE +#endif /* !STDMETHODCALLTYPE */ + +#define STDOVERRIDEMETHODIMP __override STDMETHODIMP +#define STDOVERRIDEMETHODIMP_(t) __override STDMETHODIMP_(t) +#define IFACEMETHODIMP __override STDMETHODIMP +#define IFACEMETHODIMP_(t) __override STDMETHODIMP_(t) +#define STDOVERRIDEMETHODIMPV __override STDMETHODIMPV +#define STDOVERRIDEMETHODIMPV_(t) __override STDMETHODIMPV_(t) +#define IFACEMETHODIMPV __override STDMETHODIMPV +#define IFACEMETHODIMPV_(t) __override STDMETHODIMPV_(t) + /* Import and Export Specifiers */ @@ -234,15 +266,23 @@ #define DECLSPEC_NORETURN __declspec(noreturn) #ifndef DECLSPEC_ADDRSAFE -#if (_MSC_VER >= 1200) && (defined(_M_ALPHA) || defined(_M_AXP64)) +#if defined(_MSC_VER) && (defined(_M_ALPHA) || defined(_M_AXP64)) #define DECLSPEC_ADDRSAFE __declspec(address_safe) #else #define DECLSPEC_ADDRSAFE #endif #endif /* DECLSPEC_ADDRSAFE */ +#ifndef DECLSPEC_NOTHROW +#if !defined(MIDL_PASS) +#define DECLSPEC_NOTHROW __declspec(nothrow) +#else +#define DECLSPEC_NOTHROW +#endif +#endif + #ifndef NOP_FUNCTION -#if (_MSC_VER >= 1210) +#if defined(_MSC_VER) #define NOP_FUNCTION __noop #else #define NOP_FUNCTION (void)0 @@ -263,16 +303,12 @@ /* Inlines */ #ifndef FORCEINLINE -#if defined(_MSC_VER) && (_MSC_VER >= 1200) +#if defined(_MSC_VER) #define FORCEINLINE __forceinline -#elif defined(_MSC_VER) -#define FORCEINLINE __inline -#else /* __GNUC__ */ -# if ( __MINGW_GNUC_PREREQ(4, 3) && __STDC_VERSION__ >= 199901L) -# define FORCEINLINE extern inline __attribute__((__always_inline__,__gnu_inline__)) -# else -# define FORCEINLINE extern __inline__ __attribute__((__always_inline__)) -# endif +#elif ( __MINGW_GNUC_PREREQ(4, 3) && __STDC_VERSION__ >= 199901L) +# define FORCEINLINE extern inline __attribute__((__always_inline__,__gnu_inline__)) +#else +# define FORCEINLINE extern __inline__ __attribute__((__always_inline__)) #endif #endif /* FORCEINLINE */ @@ -287,17 +323,17 @@ #endif /* DECLSPEC_NOINLINE */ #if !defined(_M_CEE_PURE) -#define NTAPI_INLINE NTAPI +#define NTAPI_INLINE NTAPI #else #define NTAPI_INLINE #endif /* Use to specify structure alignment */ #ifndef DECLSPEC_ALIGN -#if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS) +#if defined(_MSC_VER) && !defined(MIDL_PASS) #define DECLSPEC_ALIGN(x) __declspec(align(x)) #elif defined(__GNUC__) -#define DECLSPEC_ALIGN(x) __attribute__ ((__aligned__ (x))) +#define DECLSPEC_ALIGN(x) __attribute__ ((__aligned__(x))) #else #define DECLSPEC_ALIGN(x) #endif @@ -315,14 +351,55 @@ #define DECLSPEC_CACHEALIGN DECLSPEC_ALIGN(SYSTEM_CACHE_ALIGNMENT_SIZE) #endif +#ifndef DECLSPEC_UUID +#if defined(_MSC_VER) && defined(__cplusplus) +#define DECLSPEC_UUID(x) __declspec(uuid(x)) +#else +#define DECLSPEC_UUID(x) +#endif +#endif + +#ifndef DECLSPEC_NOVTABLE +#if defined(_MSC_VER) && defined(__cplusplus) +#define DECLSPEC_NOVTABLE __declspec(novtable) +#else +#define DECLSPEC_NOVTABLE +#endif +#endif + #ifndef DECLSPEC_SELECTANY -#if (_MSC_VER >= 1100) || defined(__GNUC__) -#define DECLSPEC_SELECTANY __declspec(selectany) +#if defined(_MSC_VER) || defined(__GNUC__) +#define DECLSPEC_SELECTANY __declspec(selectany) #else #define DECLSPEC_SELECTANY #endif #endif +#ifndef DECLSPEC_DEPRECATED +#if (defined(_MSC_VER) || defined(__GNUC__)) && !defined(MIDL_PASS) +#define DECLSPEC_DEPRECATED __declspec(deprecated) +#define DEPRECATE_SUPPORTED +#else +#define DECLSPEC_DEPRECATED +#undef DEPRECATE_SUPPORTED +#endif +#endif + +#ifdef DEPRECATE_DDK_FUNCTIONS +#ifdef _NTDDK_ +#define DECLSPEC_DEPRECATED_DDK DECLSPEC_DEPRECATED +#ifdef DEPRECATE_SUPPORTED +#define PRAGMA_DEPRECATED_DDK 1 +#endif +#else +#define DECLSPEC_DEPRECATED_DDK +#define PRAGMA_DEPRECATED_DDK 1 +#endif +#else +#define DECLSPEC_DEPRECATED_DDK +#define PRAGMA_DEPRECATED_DDK 0 +#endif + /* Use to silence unused variable warnings when it is intentional */ #define UNREFERENCED_PARAMETER(P) {(P)=(P);} #define UNREFERENCED_LOCAL_VARIABLE(L) ((void)(L)) @@ -347,18 +424,15 @@ /* Void Pointers */ typedef void *PVOID; -//typedef void * POINTER_64 PVOID64; -typedef PVOID PVOID64; // FIXME! +typedef void * POINTER_64 PVOID64; /* Handle Type */ +typedef void *HANDLE, **PHANDLE;; #ifdef STRICT -typedef void *HANDLE; -#define DECLARE_HANDLE(n) typedef struct n##__{int i;}*n +#define DECLARE_HANDLE(n) typedef struct n##__{int unused;} *n #else -typedef PVOID HANDLE; #define DECLARE_HANDLE(n) typedef HANDLE n #endif -typedef HANDLE *PHANDLE; /* Upper-Case Versions of Some Standard C Types */ #ifndef VOID @@ -370,52 +444,62 @@ typedef long LONG; typedef int INT; #endif #endif -typedef double DOUBLE; + +/* Avoid redefinition in windef.h */ +#define BASETYPES /* Unsigned Types */ typedef unsigned char UCHAR, *PUCHAR; typedef unsigned short USHORT, *PUSHORT; typedef unsigned long ULONG, *PULONG; + typedef CONST UCHAR *PCUCHAR; typedef CONST USHORT *PCUSHORT; typedef CONST ULONG *PCULONG; -typedef UCHAR FCHAR; -typedef USHORT FSHORT; -typedef ULONG FLONG; -typedef UCHAR BOOLEAN, *PBOOLEAN; -typedef ULONG LOGICAL; -typedef ULONG *PLOGICAL; + +typedef double DOUBLE; /* Signed Types */ typedef SHORT *PSHORT; typedef LONG *PLONG; -typedef _Return_type_success_(return >= 0) LONG NTSTATUS; -typedef NTSTATUS *PNTSTATUS; -typedef signed char SCHAR; -typedef SCHAR *PSCHAR; + +/* Flag types */ +typedef unsigned char FCHAR; +typedef unsigned short FSHORT; +typedef unsigned long FLONG; + +typedef unsigned char BOOLEAN, *PBOOLEAN; +typedef ULONG LOGICAL, *PLOGICAL; +typedef _Return_type_success_(return >= 0) LONG NTSTATUS, *PNTSTATUS;; +typedef signed char SCHAR, *PSCHAR; #ifndef _HRESULT_DEFINED #define _HRESULT_DEFINED -typedef LONG HRESULT; +typedef _Return_type_success_(return >= 0) LONG HRESULT; #endif /* 64-bit types */ +#define _ULONGLONG_ __GNU_EXTENSION typedef __int64 LONGLONG, *PLONGLONG; __GNU_EXTENSION typedef unsigned __int64 ULONGLONG, *PULONGLONG; +#define _DWORDLONG_ typedef ULONGLONG DWORDLONG, *PDWORDLONG; /* Update Sequence Number */ typedef LONGLONG USN; /* ANSI (Multi-byte Character) types */ -typedef CHAR *PCHAR, *LPCH, *PCH; -typedef CONST CHAR *LPCCH, *PCCH; +typedef CHAR *PCHAR, *LPCH, *PCH, *PNZCH; +typedef CONST CHAR *LPCCH, *PCCH, *PCNZCH; typedef _Null_terminated_ CHAR *NPSTR, *LPSTR, *PSTR; typedef _Null_terminated_ PSTR *PZPSTR; typedef _Null_terminated_ CONST PSTR *PCZPSTR; typedef _Null_terminated_ CONST CHAR *LPCSTR, *PCSTR; typedef _Null_terminated_ PCSTR *PZPCSTR; +typedef _NullNull_terminated_ CHAR *PZZSTR; +typedef _NullNull_terminated_ CONST CHAR *PCZZSTR; + /* Pointer to an Asciiz string */ typedef _Null_terminated_ CHAR *PSZ; typedef _Null_terminated_ CONST char *PCSZ; @@ -431,27 +515,99 @@ typedef _Null_terminated_ WCHAR UNALIGNED *LPUWSTR, *PUWSTR; typedef _Null_terminated_ CONST WCHAR *LPCWSTR, *PCWSTR; typedef _Null_terminated_ PCWSTR *PZPCWSTR; typedef _Null_terminated_ CONST WCHAR UNALIGNED *LPCUWSTR, *PCUWSTR; + typedef _NullNull_terminated_ WCHAR *PZZWSTR; +typedef _NullNull_terminated_ CONST WCHAR *PCZZWSTR; +typedef _NullNull_terminated_ WCHAR UNALIGNED *PUZZWSTR; +typedef _NullNull_terminated_ CONST WCHAR UNALIGNED *PCUZZWSTR; + +typedef WCHAR *PNZWCH; +typedef CONST WCHAR *PCNZWCH; +typedef WCHAR UNALIGNED *PUNZWCH; +typedef CONST WCHAR UNALIGNED *PCUNZWCH; + +#if (_WIN32_WINNT >= 0x0600) || (defined(__cplusplus) && defined(WINDOWS_ENABLE_CPLUSPLUS)) +typedef CONST WCHAR *LPCWCHAR, *PCWCHAR; +typedef CONST WCHAR UNALIGNED *LPCUWCHAR, *PCUWCHAR; +typedef unsigned long UCSCHAR, *PUCSCHAR, *PUCSSTR; +typedef const UCSCHAR *PCUCSCHAR, *PCUCSSTR; +typedef UCSCHAR UNALIGNED *PUUCSCHAR, *PUUCSSTR; +typedef const UCSCHAR UNALIGNED *PCUUCSCHAR, *PCUUCSSTR; +#define UCSCHAR_INVALID_CHARACTER (0xffffffff) +#define MIN_UCSCHAR (0) +#define MAX_UCSCHAR (0x0010FFFF) +#endif /* _WIN32_WINNT >= 0x0600 */ + +#ifdef UNICODE + +#ifndef _TCHAR_DEFINED +typedef WCHAR TCHAR, *PTCHAR; +typedef WCHAR TUCHAR, *PTUCHAR; +#define _TCHAR_DEFINED +#endif /* !_TCHAR_DEFINED */ +typedef LPWCH LPTCH, PTCH; +typedef LPCWCH LPCTCH, PCTCH; +typedef LPWSTR PTSTR, LPTSTR; +typedef LPCWSTR PCTSTR, LPCTSTR; +typedef LPUWSTR PUTSTR, LPUTSTR; +typedef LPCUWSTR PCUTSTR, LPCUTSTR; +typedef LPWSTR LP; +typedef PZZWSTR PZZTSTR; +typedef PCZZWSTR PCZZTSTR; +typedef PUZZWSTR PUZZTSTR; +typedef PCUZZWSTR PCUZZTSTR; +typedef PZPWSTR PZPTSTR; +typedef PNZWCH PNZTCH; +typedef PCNZWCH PCNZTCH; +typedef PUNZWCH PUNZTCH; +typedef PCUNZWCH PCUNZTCH; +#define __TEXT(quote) L##quote + +#else /* UNICODE */ + +#ifndef _TCHAR_DEFINED +typedef char TCHAR, *PTCHAR; +typedef unsigned char TUCHAR, *PTUCHAR; +#define _TCHAR_DEFINED +#endif /* !_TCHAR_DEFINED */ +typedef LPCH LPTCH, PTCH; +typedef LPCCH LPCTCH, PCTCH; +typedef LPSTR PTSTR, LPTSTR, PUTSTR, LPUTSTR; +typedef LPCSTR PCTSTR, LPCTSTR, PCUTSTR, LPCUTSTR; +typedef PZZSTR PZZTSTR, PUZZTSTR; +typedef PCZZSTR PCZZTSTR, PCUZZTSTR; +typedef PZPSTR PZPTSTR; +typedef PNZCH PNZTCH, PUNZTCH; +typedef PCNZCH PCNZTCH, PCUNZTCH; +#define __TEXT(quote) quote // r_winnt + +#endif /* UNICODE */ // r_winnt +#define TEXT(quote) __TEXT(quote) // r_winnt /* Cardinal Data Types */ -typedef char CCHAR, *PCCHAR; +typedef char CCHAR; +typedef CCHAR *PCCHAR; typedef short CSHORT, *PCSHORT; typedef ULONG CLONG, *PCLONG; /* NLS basics (Locale and Language Ids) */ -typedef ULONG LCID; -typedef PULONG PLCID; -typedef USHORT LANGID; +typedef unsigned long LCID, *PLCID; +typedef unsigned short LANGID; -typedef enum { - UNSPECIFIED_COMPARTMENT_ID = 0, - DEFAULT_COMPARTMENT_ID +#ifndef __COMPARTMENT_ID_DEFINED__ +#define __COMPARTMENT_ID_DEFINED__ +typedef enum +{ + UNSPECIFIED_COMPARTMENT_ID = 0, + DEFAULT_COMPARTMENT_ID } COMPARTMENT_ID, *PCOMPARTMENT_ID; +#endif /* __COMPARTMENT_ID_DEFINED__ */ #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable:4201) #endif + /* Used to store a non-float 8 byte aligned structure */ typedef struct _QUAD { @@ -522,9 +678,14 @@ typedef struct _LUID { typedef struct _UNICODE_STRING { USHORT Length; USHORT MaximumLength; - PWSTR Buffer; +#ifdef MIDL_PASS + [size_is(MaximumLength / 2), length_is((Length) / 2)] PUSHORT Buffer; +#else + _Field_size_bytes_part_(MaximumLength, Length) PWCH Buffer; +#endif } UNICODE_STRING, *PUNICODE_STRING; typedef const UNICODE_STRING* PCUNICODE_STRING; + #define UNICODE_NULL ((WCHAR)0) #define UNICODE_STRING_MAX_BYTES ((USHORT) 65534) #define UNICODE_STRING_MAX_CHARS (32767) @@ -569,23 +730,6 @@ typedef struct _STRING64 { UNICODE_STRING64, *PUNICODE_STRING64, ANSI_STRING64, *PANSI_STRING64; -/* LangID and NLS */ -#define MAKELANGID(p, s) ((((USHORT)(s)) << 10) | (USHORT)(p)) -#define PRIMARYLANGID(lgid) ((USHORT)(lgid) & 0x3ff) -#define SUBLANGID(lgid) ((USHORT)(lgid) >> 10) - -#define NLS_VALID_LOCALE_MASK 0x000fffff - -#define MAKELCID(lgid, srtid) ((ULONG)((((ULONG)((USHORT)(srtid))) << 16) | \ - ((ULONG)((USHORT)(lgid))))) -#define MAKESORTLCID(lgid, srtid, ver) \ - ((ULONG)((MAKELCID(lgid, srtid)) | \ - (((ULONG)((USHORT)(ver))) << 20))) -#define LANGIDFROMLCID(lcid) ((USHORT)(lcid)) -#define SORTIDFROMLCID(lcid) ((USHORT)((((ULONG)(lcid)) >> 16) & 0xf)) -#define SORTVERSIONFROMLCID(lcid) ((USHORT)((((ULONG)(lcid)) >> 20) & 0xf)) - - /* Object Attributes */ typedef struct _OBJECT_ATTRIBUTES { ULONG Length; @@ -597,27 +741,59 @@ typedef struct _OBJECT_ATTRIBUTES { } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES; typedef CONST OBJECT_ATTRIBUTES *PCOBJECT_ATTRIBUTES; +typedef struct _OBJECT_ATTRIBUTES32 { + ULONG Length; + ULONG RootDirectory; + ULONG ObjectName; + ULONG Attributes; + ULONG SecurityDescriptor; + ULONG SecurityQualityOfService; +} OBJECT_ATTRIBUTES32, *POBJECT_ATTRIBUTES32; +typedef CONST OBJECT_ATTRIBUTES32 *PCOBJECT_ATTRIBUTES32; + +typedef struct _OBJECT_ATTRIBUTES64 { + ULONG Length; + ULONG64 RootDirectory; + ULONG64 ObjectName; + ULONG Attributes; + ULONG64 SecurityDescriptor; + ULONG64 SecurityQualityOfService; +} OBJECT_ATTRIBUTES64, *POBJECT_ATTRIBUTES64; +typedef CONST OBJECT_ATTRIBUTES64 *PCOBJECT_ATTRIBUTES64; + /* Values for the Attributes member */ -#define OBJ_INHERIT 0x00000002 -#define OBJ_PERMANENT 0x00000010 -#define OBJ_EXCLUSIVE 0x00000020 -#define OBJ_CASE_INSENSITIVE 0x00000040 -#define OBJ_OPENIF 0x00000080 -#define OBJ_OPENLINK 0x00000100 -#define OBJ_KERNEL_HANDLE 0x00000200 -#define OBJ_FORCE_ACCESS_CHECK 0x00000400 -#define OBJ_VALID_ATTRIBUTES 0x000007F2 +#define OBJ_INHERIT 0x00000002L +#define OBJ_PERMANENT 0x00000010L +#define OBJ_EXCLUSIVE 0x00000020L +#define OBJ_CASE_INSENSITIVE 0x00000040L +#define OBJ_OPENIF 0x00000080L +#define OBJ_OPENLINK 0x00000100L +#define OBJ_KERNEL_HANDLE 0x00000200L +#define OBJ_FORCE_ACCESS_CHECK 0x00000400L +#define OBJ_VALID_ATTRIBUTES 0x000007F2L /* Helper Macro */ #define InitializeObjectAttributes(p,n,a,r,s) { \ (p)->Length = sizeof(OBJECT_ATTRIBUTES); \ (p)->RootDirectory = (r); \ - (p)->Attributes = (a); \ (p)->ObjectName = (n); \ + (p)->Attributes = (a); \ (p)->SecurityDescriptor = (s); \ (p)->SecurityQualityOfService = NULL; \ } +#define RTL_CONSTANT_OBJECT_ATTRIBUTES(n,a) { \ + sizeof(OBJECT_ATTRIBUTES), \ + NULL, \ + RTL_CONST_CAST(PUNICODE_STRING)(n), \ + a, \ + NULL, \ + NULL \ +} + +#define RTL_INIT_OBJECT_ATTRIBUTES(n, a) \ + RTL_CONSTANT_OBJECT_ATTRIBUTES(n, a) + /* Product Types */ typedef enum _NT_PRODUCT_TYPE { NtProductWinNt = 1, @@ -661,24 +837,31 @@ typedef struct _SINGLE_LIST_ENTRY { struct _SINGLE_LIST_ENTRY *Next; } SINGLE_LIST_ENTRY, *PSINGLE_LIST_ENTRY; +typedef struct _SINGLE_LIST_ENTRY32 { + ULONG Next; +} SINGLE_LIST_ENTRY32, *PSINGLE_LIST_ENTRY32; + typedef struct _PROCESSOR_NUMBER { USHORT Group; UCHAR Number; UCHAR Reserved; } PROCESSOR_NUMBER, *PPROCESSOR_NUMBER; -struct _CONTEXT; -struct _EXCEPTION_RECORD; +#define ALL_PROCESSOR_GROUPS 0xffff _IRQL_requires_same_ _Function_class_(EXCEPTION_ROUTINE) -typedef EXCEPTION_DISPOSITION -(NTAPI *PEXCEPTION_ROUTINE)( +typedef +EXCEPTION_DISPOSITION +NTAPI +EXCEPTION_ROUTINE( _Inout_ struct _EXCEPTION_RECORD *ExceptionRecord, _In_ PVOID EstablisherFrame, _Inout_ struct _CONTEXT *ContextRecord, _In_ PVOID DispatcherContext); +typedef EXCEPTION_ROUTINE *PEXCEPTION_ROUTINE; + typedef struct _GROUP_AFFINITY { KAFFINITY Mask; USHORT Group; @@ -691,7 +874,22 @@ typedef struct _GROUP_AFFINITY { #define RTL_BITS_OF(sizeOfArg) (sizeof(sizeOfArg) * 8) #define RTL_BITS_OF_FIELD(type, field) (RTL_BITS_OF(RTL_FIELD_TYPE(type, field))) -#define RTL_CONSTANT_STRING(s) { sizeof(s)-sizeof((s)[0]), sizeof(s), s } +#ifdef __cplusplus +extern "C++" template struct _RTL_remove_const_template; +extern "C++" template struct _RTL_remove_const_template { typedef _Type type; }; +#define _RTL_CONSTANT_STRING_remove_const_macro(s) \ + (const_cast<_RTL_remove_const_template::type*>(s)) +extern "C++" template struct _RTL_CONSTANT_STRING_type_check_template; +extern "C++" template struct _RTL_CONSTANT_STRING_type_check_template { typedef char type; }; +#define _RTL_CONSTANT_STRING_type_check(s) _RTL_CONSTANT_STRING_type_check_template::type +#else +#define _RTL_CONSTANT_STRING_remove_const_macro(s) (s) +char _RTL_CONSTANT_STRING_type_check(const void *s); +#endif +#define RTL_CONSTANT_STRING(s) { \ + sizeof(s)-sizeof((s)[0]), \ + sizeof(s) / sizeof(_RTL_CONSTANT_STRING_type_check(s)), \ + _RTL_CONSTANT_STRING_remove_const_macro(s) } #define RTL_FIELD_SIZE(type, field) (sizeof(((type *)0)->field)) @@ -702,13 +900,37 @@ typedef struct _GROUP_AFFINITY { ( (((PCHAR)(&(Struct)->Field)) + sizeof((Struct)->Field)) <= (((PCHAR)(Struct))+(Size)) ) #define RTL_NUMBER_OF_V1(A) (sizeof(A)/sizeof((A)[0])) + +#ifdef __GNUC__ +#define RTL_NUMBER_OF_V2(A) \ + (({ int _check_array_type[__builtin_types_compatible_p(typeof(A), typeof(&A[0])) ? -1 : 1]; (void)_check_array_type; }), \ + RTL_NUMBER_OF_V1(A)) +#else +/// \todo implement security checks for cplusplus / MSVC #define RTL_NUMBER_OF_V2(A) RTL_NUMBER_OF_V1(A) +#endif + #ifdef ENABLE_RTL_NUMBER_OF_V2 #define RTL_NUMBER_OF(A) RTL_NUMBER_OF_V2(A) #else #define RTL_NUMBER_OF(A) RTL_NUMBER_OF_V1(A) #endif #define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A) +#define _ARRAYSIZE(A) RTL_NUMBER_OF_V1(A) + +#define RTL_NUMBER_OF_FIELD(type, field) \ + (RTL_NUMBER_OF(RTL_FIELD_TYPE(type, field))) + +#define RTL_PADDING_BETWEEN_FIELDS(type, field1, field2) \ + ((FIELD_OFFSET(type, field2) > FIELD_OFFSET(type, field1)) \ + ? (FIELD_OFFSET(type, field2) - FIELD_OFFSET(type, field1) - RTL_FIELD_SIZE(type, field1)) \ + : (FIELD_OFFSET(type, field1) - FIELD_OFFSET(type, field2) - RTL_FIELD_SIZE(type, field2))) + +#if defined(__cplusplus) +#define RTL_CONST_CAST(type) const_cast +#else +#define RTL_CONST_CAST(type) (type) +#endif /* Type Limits */ #define MINCHAR 0x80 @@ -722,18 +944,40 @@ typedef struct _GROUP_AFFINITY { #define MAXULONG 0xffffffff #define MAXLONGLONG (0x7fffffffffffffffLL) -/* Multiplication and Shift Operations */ -#define Int32x32To64(a,b) ((LONGLONG)(a)*(LONGLONG)(b)) -#define UInt32x32To64(a,b) ((DWORDLONG)(a)*(DWORDLONG)(b)) -#define Int64ShllMod32(a,b) ((DWORDLONG)(a)<<(b)) -#define Int64ShraMod32(a,b) ((LONGLONG)(a)>>(b)) -#define Int64ShrlMod32(a,b) ((DWORDLONG)(a)>>(b)) +/* Multiplication and Shift Operations. Note: we don't use inline + asm functions, the compiler can optimize this better. */ +#define Int32x32To64(a,b) (((__int64)(long)(a))*((__int64)(long)(b))) +#define UInt32x32To64(a,b) ((unsigned __int64)(unsigned int)(a)*(unsigned __int64)(unsigned int)(b)) + +#if defined(MIDL_PASS)|| defined(RC_INVOKED) || defined(_M_CEE_PURE) +/* Use native math */ +#define Int64ShllMod32(a,b) ((unsigned __int64)(a)<<(b)) +#define Int64ShraMod32(a,b) (((__int64)(a))>>(b)) +#define Int64ShrlMod32(a,b) (((unsigned __int64)(a))>>(b)) +#else +/* Use intrinsics */ +#define Int64ShllMod32(a,b) __ll_lshift(a,b) +#define Int64ShraMod32(a,b) __ll_rshift(a,b) +#define Int64ShrlMod32(a,b) __ull_rshift(a,b) +#endif + +#define RotateLeft32 _rotl +#define RotateLeft64 _rotl64 +#define RotateRight32 _rotr +#define RotateRight64 _rotr64 + +#if defined(_M_AMD64) +#define RotateLeft8 _rotl8 +#define RotateLeft16 _rotl16 +#define RotateRight8 _rotr8 +#define RotateRight16 _rotr16 +#endif /* _M_AMD64 */ /* C_ASSERT Definition */ #define C_ASSERT(expr) extern char (*c_assert(void)) [(expr) ? 1 : -1] /* Eliminate Microsoft C/C++ compiler warning 4715 */ -#if defined(_MSC_VER) && (_MSC_VER > 1200) +#if defined(_MSC_VER) # define DEFAULT_UNREACHABLE default: __assume(0) #elif defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)))) # define DEFAULT_UNREACHABLE default: __builtin_unreachable() @@ -760,10 +1004,120 @@ typedef struct _GROUP_AFFINITY { #define VER_SUITE_COMPUTE_SERVER 0x00004000 #define VER_SUITE_WH_SERVER 0x00008000 +#define PRODUCT_UNDEFINED 0x00000000 +#define PRODUCT_ULTIMATE 0x00000001 +#define PRODUCT_HOME_BASIC 0x00000002 +#define PRODUCT_HOME_PREMIUM 0x00000003 +#define PRODUCT_ENTERPRISE 0x00000004 +#define PRODUCT_HOME_BASIC_N 0x00000005 +#define PRODUCT_BUSINESS 0x00000006 +#define PRODUCT_STANDARD_SERVER 0x00000007 +#define PRODUCT_DATACENTER_SERVER 0x00000008 +#define PRODUCT_SMALLBUSINESS_SERVER 0x00000009 +#define PRODUCT_ENTERPRISE_SERVER 0x0000000A +#define PRODUCT_STARTER 0x0000000B +#define PRODUCT_DATACENTER_SERVER_CORE 0x0000000C +#define PRODUCT_STANDARD_SERVER_CORE 0x0000000D +#define PRODUCT_ENTERPRISE_SERVER_CORE 0x0000000E +#define PRODUCT_ENTERPRISE_SERVER_IA64 0x0000000F +#define PRODUCT_BUSINESS_N 0x00000010 +#define PRODUCT_WEB_SERVER 0x00000011 +#define PRODUCT_CLUSTER_SERVER 0x00000012 +#define PRODUCT_HOME_SERVER 0x00000013 +#define PRODUCT_STORAGE_EXPRESS_SERVER 0x00000014 +#define PRODUCT_STORAGE_STANDARD_SERVER 0x00000015 +#define PRODUCT_STORAGE_WORKGROUP_SERVER 0x00000016 +#define PRODUCT_STORAGE_ENTERPRISE_SERVER 0x00000017 +#define PRODUCT_SERVER_FOR_SMALLBUSINESS 0x00000018 +#define PRODUCT_SMALLBUSINESS_SERVER_PREMIUM 0x00000019 +#define PRODUCT_HOME_PREMIUM_N 0x0000001A +#define PRODUCT_ENTERPRISE_N 0x0000001B +#define PRODUCT_ULTIMATE_N 0x0000001C +#define PRODUCT_WEB_SERVER_CORE 0x0000001D +#define PRODUCT_MEDIUMBUSINESS_SERVER_MANAGEMENT 0x0000001E +#define PRODUCT_MEDIUMBUSINESS_SERVER_SECURITY 0x0000001F +#define PRODUCT_MEDIUMBUSINESS_SERVER_MESSAGING 0x00000020 +#define PRODUCT_SERVER_FOUNDATION 0x00000021 +#define PRODUCT_HOME_PREMIUM_SERVER 0x00000022 +#define PRODUCT_SERVER_FOR_SMALLBUSINESS_V 0x00000023 +#define PRODUCT_STANDARD_SERVER_V 0x00000024 +#define PRODUCT_DATACENTER_SERVER_V 0x00000025 +#define PRODUCT_ENTERPRISE_SERVER_V 0x00000026 +#define PRODUCT_DATACENTER_SERVER_CORE_V 0x00000027 +#define PRODUCT_STANDARD_SERVER_CORE_V 0x00000028 +#define PRODUCT_ENTERPRISE_SERVER_CORE_V 0x00000029 +#define PRODUCT_HYPERV 0x0000002A +#define PRODUCT_STORAGE_EXPRESS_SERVER_CORE 0x0000002B +#define PRODUCT_STORAGE_STANDARD_SERVER_CORE 0x0000002C +#define PRODUCT_STORAGE_WORKGROUP_SERVER_CORE 0x0000002D +#define PRODUCT_STORAGE_ENTERPRISE_SERVER_CORE 0x0000002E +#define PRODUCT_STARTER_N 0x0000002F +#define PRODUCT_PROFESSIONAL 0x00000030 +#define PRODUCT_PROFESSIONAL_N 0x00000031 +#define PRODUCT_SB_SOLUTION_SERVER 0x00000032 +#define PRODUCT_SERVER_FOR_SB_SOLUTIONS 0x00000033 +#define PRODUCT_STANDARD_SERVER_SOLUTIONS 0x00000034 +#define PRODUCT_STANDARD_SERVER_SOLUTIONS_CORE 0x00000035 +#define PRODUCT_SB_SOLUTION_SERVER_EM 0x00000036 +#define PRODUCT_SERVER_FOR_SB_SOLUTIONS_EM 0x00000037 +#define PRODUCT_SOLUTION_EMBEDDEDSERVER 0x00000038 +#define PRODUCT_SOLUTION_EMBEDDEDSERVER_CORE 0x00000039 +#define PRODUCT_ESSENTIALBUSINESS_SERVER_MGMT 0x0000003B +#define PRODUCT_ESSENTIALBUSINESS_SERVER_ADDL 0x0000003C +#define PRODUCT_ESSENTIALBUSINESS_SERVER_MGMTSVC 0x0000003D +#define PRODUCT_ESSENTIALBUSINESS_SERVER_ADDLSVC 0x0000003E +#define PRODUCT_SMALLBUSINESS_SERVER_PREMIUM_CORE 0x0000003F +#define PRODUCT_CLUSTER_SERVER_V 0x00000040 +#define PRODUCT_EMBEDDED 0x00000041 +#define PRODUCT_STARTER_E 0x00000042 +#define PRODUCT_HOME_BASIC_E 0x00000043 +#define PRODUCT_HOME_PREMIUM_E 0x00000044 +#define PRODUCT_PROFESSIONAL_E 0x00000045 +#define PRODUCT_ENTERPRISE_E 0x00000046 +#define PRODUCT_ULTIMATE_E 0x00000047 +#define PRODUCT_ENTERPRISE_EVALUATION 0x00000048 +#define PRODUCT_MULTIPOINT_STANDARD_SERVER 0x0000004C +#define PRODUCT_MULTIPOINT_PREMIUM_SERVER 0x0000004D +#define PRODUCT_STANDARD_EVALUATION_SERVER 0x0000004F +#define PRODUCT_DATACENTER_EVALUATION_SERVER 0x00000050 +#define PRODUCT_ENTERPRISE_N_EVALUATION 0x00000054 +#define PRODUCT_EMBEDDED_AUTOMOTIVE 0x00000055 +#define PRODUCT_EMBEDDED_INDUSTRY_A 0x00000056 +#define PRODUCT_THINPC 0x00000057 +#define PRODUCT_EMBEDDED_A 0x00000058 +#define PRODUCT_EMBEDDED_INDUSTRY 0x00000059 +#define PRODUCT_EMBEDDED_E 0x0000005A +#define PRODUCT_EMBEDDED_INDUSTRY_E 0x0000005B +#define PRODUCT_EMBEDDED_INDUSTRY_A_E 0x0000005C +#define PRODUCT_STORAGE_WORKGROUP_EVALUATION_SERVER 0x0000005F +#define PRODUCT_STORAGE_STANDARD_EVALUATION_SERVER 0x00000060 +#define PRODUCT_CORE_ARM 0x00000061 +#define PRODUCT_CORE_N 0x00000062 +#define PRODUCT_CORE_COUNTRYSPECIFIC 0x00000063 +#define PRODUCT_CORE_SINGLELANGUAGE 0x00000064 +#define PRODUCT_CORE 0x00000065 +#define PRODUCT_PROFESSIONAL_WMC 0x00000067 +#define PRODUCT_UNLICENSED 0xABCDABCD + +/* LangID and NLS */ +#define MAKELANGID(p, s) ((((USHORT)(s)) << 10) | (USHORT)(p)) +#define PRIMARYLANGID(lgid) ((USHORT)(lgid) & 0x3ff) +#define SUBLANGID(lgid) ((USHORT)(lgid) >> 10) +#define MAKELCID(lgid, srtid) ((ULONG)((((ULONG)((USHORT)(srtid))) << 16) | \ + ((ULONG)((USHORT)(lgid))))) +#define MAKESORTLCID(lgid, srtid, ver) \ + ((ULONG)((MAKELCID(lgid, srtid)) | \ + (((ULONG)((USHORT)(ver))) << 20))) +#define LANGIDFROMLCID(lcid) ((USHORT)(lcid)) +#define SORTIDFROMLCID(lcid) ((USHORT)((((ULONG)(lcid)) >> 16) & 0xf)) +#define SORTVERSIONFROMLCID(lcid) ((USHORT)((((ULONG)(lcid)) >> 20) & 0xf)) + +#define NLS_VALID_LOCALE_MASK 0x000fffff +#define LOCALE_NAME_MAX_LENGTH 85 + /* Primary language IDs. */ #define LANG_NEUTRAL 0x00 #define LANG_INVARIANT 0x7f - #define LANG_AFRIKAANS 0x36 #define LANG_ALBANIAN 0x1c #define LANG_ALSATIAN 0x84 @@ -772,6 +1126,8 @@ typedef struct _GROUP_AFFINITY { #define LANG_ARMENIAN 0x2b #define LANG_ASSAMESE 0x4d #define LANG_AZERI 0x2c +#define LANG_AZERBAIJANI 0x2c +#define LANG_BANGLA 0x45 #define LANG_BASHKIR 0x6d #define LANG_BASQUE 0x2d #define LANG_BELARUSIAN 0x23 @@ -781,6 +1137,8 @@ typedef struct _GROUP_AFFINITY { #define LANG_BOSNIAN_NEUTRAL 0x781a #define LANG_BULGARIAN 0x02 #define LANG_CATALAN 0x03 +#define LANG_CENTRAL_KURDISH 0x92 +#define LANG_CHEROKEE 0x5c #define LANG_CHINESE 0x04 #define LANG_CHINESE_SIMPLIFIED 0x04 #define LANG_CHINESE_TRADITIONAL 0x7c04 @@ -799,6 +1157,7 @@ typedef struct _GROUP_AFFINITY { #define LANG_FINNISH 0x0b #define LANG_FRENCH 0x0c #define LANG_FRISIAN 0x62 +#define LANG_FULAH 0x67 #define LANG_GALICIAN 0x56 #define LANG_GEORGIAN 0x37 #define LANG_GERMAN 0x07 @@ -806,6 +1165,7 @@ typedef struct _GROUP_AFFINITY { #define LANG_GREENLANDIC 0x6f #define LANG_GUJARATI 0x47 #define LANG_HAUSA 0x68 +#define LANG_HAWAIIAN 0x75 #define LANG_HEBREW 0x0d #define LANG_HINDI 0x39 #define LANG_HUNGARIAN 0x0e @@ -843,18 +1203,22 @@ typedef struct _GROUP_AFFINITY { #define LANG_NEPALI 0x61 #define LANG_NORWEGIAN 0x14 #define LANG_OCCITAN 0x82 +#define LANG_ODIA 0x48 #define LANG_ORIYA 0x48 #define LANG_PASHTO 0x63 #define LANG_PERSIAN 0x29 #define LANG_POLISH 0x15 #define LANG_PORTUGUESE 0x16 +#define LANG_PULAR 0x67 #define LANG_PUNJABI 0x46 #define LANG_QUECHUA 0x6b #define LANG_ROMANIAN 0x18 #define LANG_ROMANSH 0x17 #define LANG_RUSSIAN 0x19 +#define LANG_SAKHA 0x85 #define LANG_SAMI 0x3b #define LANG_SANSKRIT 0x4f +#define LANG_SCOTTISH_GAELIC 0x91 #define LANG_SERBIAN 0x1a #define LANG_SERBIAN_NEUTRAL 0x7c1a #define LANG_SINDHI 0x59 @@ -874,6 +1238,7 @@ typedef struct _GROUP_AFFINITY { #define LANG_THAI 0x1e #define LANG_TIBETAN 0x51 #define LANG_TIGRIGNA 0x73 +#define LANG_TIGRINYA 0x73 #define LANG_TSWANA 0x32 #define LANG_TURKISH 0x1f #define LANG_TURKMEN 0x42 @@ -882,6 +1247,7 @@ typedef struct _GROUP_AFFINITY { #define LANG_UPPER_SORBIAN 0x2e #define LANG_URDU 0x20 #define LANG_UZBEK 0x43 +#define LANG_VALENCIAN 0x03 #define LANG_VIETNAMESE 0x2a #define LANG_WELSH 0x52 #define LANG_WOLOF 0x88 @@ -891,4 +1257,283 @@ typedef struct _GROUP_AFFINITY { #define LANG_YORUBA 0x6a #define LANG_ZULU 0x35 +#define SUBLANG_NEUTRAL 0x00 +#define SUBLANG_DEFAULT 0x01 +#define SUBLANG_SYS_DEFAULT 0x02 +#define SUBLANG_CUSTOM_DEFAULT 0x03 +#define SUBLANG_CUSTOM_UNSPECIFIED 0x04 +#define SUBLANG_UI_CUSTOM_DEFAULT 0x05 +#define SUBLANG_AFRIKAANS_SOUTH_AFRICA 0x01 +#define SUBLANG_ALBANIAN_ALBANIA 0x01 +#define SUBLANG_ALSATIAN_FRANCE 0x01 +#define SUBLANG_AMHARIC_ETHIOPIA 0x01 +#define SUBLANG_ARABIC_SAUDI_ARABIA 0x01 +#define SUBLANG_ARABIC_IRAQ 0x02 +#define SUBLANG_ARABIC_EGYPT 0x03 +#define SUBLANG_ARABIC_LIBYA 0x04 +#define SUBLANG_ARABIC_ALGERIA 0x05 +#define SUBLANG_ARABIC_MOROCCO 0x06 +#define SUBLANG_ARABIC_TUNISIA 0x07 +#define SUBLANG_ARABIC_OMAN 0x08 +#define SUBLANG_ARABIC_YEMEN 0x09 +#define SUBLANG_ARABIC_SYRIA 0x0a +#define SUBLANG_ARABIC_JORDAN 0x0b +#define SUBLANG_ARABIC_LEBANON 0x0c +#define SUBLANG_ARABIC_KUWAIT 0x0d +#define SUBLANG_ARABIC_UAE 0x0e +#define SUBLANG_ARABIC_BAHRAIN 0x0f +#define SUBLANG_ARABIC_QATAR 0x10 +#define SUBLANG_ARMENIAN_ARMENIA 0x01 +#define SUBLANG_ASSAMESE_INDIA 0x01 +#define SUBLANG_AZERI_LATIN 0x01 +#define SUBLANG_AZERI_CYRILLIC 0x02 +#define SUBLANG_AZERBAIJANI_AZERBAIJAN_LATIN 0x01 +#define SUBLANG_AZERBAIJANI_AZERBAIJAN_CYRILLIC 0x02 +#define SUBLANG_BANGLA_INDIA 0x01 +#define SUBLANG_BANGLA_BANGLADESH 0x02 +#define SUBLANG_BASHKIR_RUSSIA 0x01 +#define SUBLANG_BASQUE_BASQUE 0x01 +#define SUBLANG_BELARUSIAN_BELARUS 0x01 +#define SUBLANG_BENGALI_INDIA 0x01 +#define SUBLANG_BENGALI_BANGLADESH 0x02 +#define SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_LATIN 0x05 +#define SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_CYRILLIC 0x08 +#define SUBLANG_BRETON_FRANCE 0x01 +#define SUBLANG_BULGARIAN_BULGARIA 0x01 +#define SUBLANG_CATALAN_CATALAN 0x01 +#define SUBLANG_CENTRAL_KURDISH_IRAQ 0x01 +#define SUBLANG_CHEROKEE_CHEROKEE 0x01 +#define SUBLANG_CHINESE_TRADITIONAL 0x01 +#define SUBLANG_CHINESE_SIMPLIFIED 0x02 +#define SUBLANG_CHINESE_HONGKONG 0x03 +#define SUBLANG_CHINESE_SINGAPORE 0x04 +#define SUBLANG_CHINESE_MACAU 0x05 +#define SUBLANG_CORSICAN_FRANCE 0x01 +#define SUBLANG_CZECH_CZECH_REPUBLIC 0x01 +#define SUBLANG_CROATIAN_CROATIA 0x01 +#define SUBLANG_CROATIAN_BOSNIA_HERZEGOVINA_LATIN 0x04 +#define SUBLANG_DANISH_DENMARK 0x01 +#define SUBLANG_DARI_AFGHANISTAN 0x01 +#define SUBLANG_DIVEHI_MALDIVES 0x01 +#define SUBLANG_DUTCH 0x01 +#define SUBLANG_DUTCH_BELGIAN 0x02 +#define SUBLANG_ENGLISH_US 0x01 +#define SUBLANG_ENGLISH_UK 0x02 +#define SUBLANG_ENGLISH_AUS 0x03 +#define SUBLANG_ENGLISH_CAN 0x04 +#define SUBLANG_ENGLISH_NZ 0x05 +#define SUBLANG_ENGLISH_EIRE 0x06 +#define SUBLANG_ENGLISH_SOUTH_AFRICA 0x07 +#define SUBLANG_ENGLISH_JAMAICA 0x08 +#define SUBLANG_ENGLISH_CARIBBEAN 0x09 +#define SUBLANG_ENGLISH_BELIZE 0x0a +#define SUBLANG_ENGLISH_TRINIDAD 0x0b +#define SUBLANG_ENGLISH_ZIMBABWE 0x0c +#define SUBLANG_ENGLISH_PHILIPPINES 0x0d +#define SUBLANG_ENGLISH_INDIA 0x10 +#define SUBLANG_ENGLISH_MALAYSIA 0x11 +#define SUBLANG_ENGLISH_SINGAPORE 0x12 +#define SUBLANG_ESTONIAN_ESTONIA 0x01 +#define SUBLANG_FAEROESE_FAROE_ISLANDS 0x01 +#define SUBLANG_FILIPINO_PHILIPPINES 0x01 +#define SUBLANG_FINNISH_FINLAND 0x01 +#define SUBLANG_FRENCH 0x01 +#define SUBLANG_FRENCH_BELGIAN 0x02 +#define SUBLANG_FRENCH_CANADIAN 0x03 +#define SUBLANG_FRENCH_SWISS 0x04 +#define SUBLANG_FRENCH_LUXEMBOURG 0x05 +#define SUBLANG_FRENCH_MONACO 0x06 +#define SUBLANG_FRISIAN_NETHERLANDS 0x01 +#define SUBLANG_FULAH_SENEGAL 0x02 +#define SUBLANG_GALICIAN_GALICIAN 0x01 +#define SUBLANG_GEORGIAN_GEORGIA 0x01 +#define SUBLANG_GERMAN 0x01 +#define SUBLANG_GERMAN_SWISS 0x02 +#define SUBLANG_GERMAN_AUSTRIAN 0x03 +#define SUBLANG_GERMAN_LUXEMBOURG 0x04 +#define SUBLANG_GERMAN_LIECHTENSTEIN 0x05 +#define SUBLANG_GREEK_GREECE 0x01 +#define SUBLANG_GREENLANDIC_GREENLAND 0x01 +#define SUBLANG_GUJARATI_INDIA 0x01 +#define SUBLANG_HAUSA_NIGERIA_LATIN 0x01 +#define SUBLANG_HAWAIIAN_US 0x01 +#define SUBLANG_HEBREW_ISRAEL 0x01 +#define SUBLANG_HINDI_INDIA 0x01 +#define SUBLANG_HUNGARIAN_HUNGARY 0x01 +#define SUBLANG_ICELANDIC_ICELAND 0x01 +#define SUBLANG_IGBO_NIGERIA 0x01 +#define SUBLANG_INDONESIAN_INDONESIA 0x01 +#define SUBLANG_INUKTITUT_CANADA 0x01 +#define SUBLANG_INUKTITUT_CANADA_LATIN 0x02 +#define SUBLANG_IRISH_IRELAND 0x02 +#define SUBLANG_ITALIAN 0x01 +#define SUBLANG_ITALIAN_SWISS 0x02 +#define SUBLANG_JAPANESE_JAPAN 0x01 +#define SUBLANG_KANNADA_INDIA 0x01 +#define SUBLANG_KASHMIRI_SASIA 0x02 +#define SUBLANG_KASHMIRI_INDIA 0x02 +#define SUBLANG_KAZAK_KAZAKHSTAN 0x01 +#define SUBLANG_KHMER_CAMBODIA 0x01 +#define SUBLANG_KICHE_GUATEMALA 0x01 +#define SUBLANG_KINYARWANDA_RWANDA 0x01 +#define SUBLANG_KONKANI_INDIA 0x01 +#define SUBLANG_KOREAN 0x01 +#define SUBLANG_KYRGYZ_KYRGYZSTAN 0x01 +#define SUBLANG_LAO_LAO 0x01 +#define SUBLANG_LATVIAN_LATVIA 0x01 +#define SUBLANG_LITHUANIAN 0x01 +#define SUBLANG_LOWER_SORBIAN_GERMANY 0x02 +#define SUBLANG_LUXEMBOURGISH_LUXEMBOURG 0x01 +#define SUBLANG_MACEDONIAN_MACEDONIA 0x01 +#define SUBLANG_MALAY_MALAYSIA 0x01 +#define SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02 +#define SUBLANG_MALAYALAM_INDIA 0x01 +#define SUBLANG_MALTESE_MALTA 0x01 +#define SUBLANG_MAORI_NEW_ZEALAND 0x01 +#define SUBLANG_MAPUDUNGUN_CHILE 0x01 +#define SUBLANG_MARATHI_INDIA 0x01 +#define SUBLANG_MOHAWK_MOHAWK 0x01 +#define SUBLANG_MONGOLIAN_CYRILLIC_MONGOLIA 0x01 +#define SUBLANG_MONGOLIAN_PRC 0x02 +#define SUBLANG_NEPALI_INDIA 0x02 +#define SUBLANG_NEPALI_NEPAL 0x01 +#define SUBLANG_NORWEGIAN_BOKMAL 0x01 +#define SUBLANG_NORWEGIAN_NYNORSK 0x02 +#define SUBLANG_OCCITAN_FRANCE 0x01 +#define SUBLANG_ODIA_INDIA 0x01 +#define SUBLANG_ORIYA_INDIA 0x01 +#define SUBLANG_PASHTO_AFGHANISTAN 0x01 +#define SUBLANG_PERSIAN_IRAN 0x01 +#define SUBLANG_POLISH_POLAND 0x01 +#define SUBLANG_PORTUGUESE 0x02 +#define SUBLANG_PORTUGUESE_BRAZILIAN 0x01 +#define SUBLANG_PULAR_SENEGAL 0x02 +#define SUBLANG_PUNJABI_INDIA 0x01 +#define SUBLANG_PUNJABI_PAKISTAN 0x02 +#define SUBLANG_QUECHUA_BOLIVIA 0x01 +#define SUBLANG_QUECHUA_ECUADOR 0x02 +#define SUBLANG_QUECHUA_PERU 0x03 +#define SUBLANG_ROMANIAN_ROMANIA 0x01 +#define SUBLANG_ROMANSH_SWITZERLAND 0x01 +#define SUBLANG_RUSSIAN_RUSSIA 0x01 +#define SUBLANG_SAKHA_RUSSIA 0x01 +#define SUBLANG_SAMI_NORTHERN_NORWAY 0x01 +#define SUBLANG_SAMI_NORTHERN_SWEDEN 0x02 +#define SUBLANG_SAMI_NORTHERN_FINLAND 0x03 +#define SUBLANG_SAMI_LULE_NORWAY 0x04 +#define SUBLANG_SAMI_LULE_SWEDEN 0x05 +#define SUBLANG_SAMI_SOUTHERN_NORWAY 0x06 +#define SUBLANG_SAMI_SOUTHERN_SWEDEN 0x07 +#define SUBLANG_SAMI_SKOLT_FINLAND 0x08 +#define SUBLANG_SAMI_INARI_FINLAND 0x09 +#define SUBLANG_SANSKRIT_INDIA 0x01 +#define SUBLANG_SCOTTISH_GAELIC 0x01 +#define SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_LATIN 0x06 +#define SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_CYRILLIC 0x07 +#define SUBLANG_SERBIAN_MONTENEGRO_LATIN 0x0b +#define SUBLANG_SERBIAN_MONTENEGRO_CYRILLIC 0x0c +#define SUBLANG_SERBIAN_SERBIA_LATIN 0x09 +#define SUBLANG_SERBIAN_SERBIA_CYRILLIC 0x0a +#define SUBLANG_SERBIAN_CROATIA 0x01 +#define SUBLANG_SERBIAN_LATIN 0x02 +#define SUBLANG_SERBIAN_CYRILLIC 0x03 +#define SUBLANG_SINDHI_INDIA 0x01 +#define SUBLANG_SINDHI_PAKISTAN 0x02 +#define SUBLANG_SINDHI_AFGHANISTAN 0x02 +#define SUBLANG_SINHALESE_SRI_LANKA 0x01 +#define SUBLANG_SOTHO_NORTHERN_SOUTH_AFRICA 0x01 +#define SUBLANG_SLOVAK_SLOVAKIA 0x01 +#define SUBLANG_SLOVENIAN_SLOVENIA 0x01 +#define SUBLANG_SPANISH 0x01 +#define SUBLANG_SPANISH_MEXICAN 0x02 +#define SUBLANG_SPANISH_MODERN 0x03 +#define SUBLANG_SPANISH_GUATEMALA 0x04 +#define SUBLANG_SPANISH_COSTA_RICA 0x05 +#define SUBLANG_SPANISH_PANAMA 0x06 +#define SUBLANG_SPANISH_DOMINICAN_REPUBLIC 0x07 +#define SUBLANG_SPANISH_VENEZUELA 0x08 +#define SUBLANG_SPANISH_COLOMBIA 0x09 +#define SUBLANG_SPANISH_PERU 0x0a +#define SUBLANG_SPANISH_ARGENTINA 0x0b +#define SUBLANG_SPANISH_ECUADOR 0x0c +#define SUBLANG_SPANISH_CHILE 0x0d +#define SUBLANG_SPANISH_URUGUAY 0x0e +#define SUBLANG_SPANISH_PARAGUAY 0x0f +#define SUBLANG_SPANISH_BOLIVIA 0x10 +#define SUBLANG_SPANISH_EL_SALVADOR 0x11 +#define SUBLANG_SPANISH_HONDURAS 0x12 +#define SUBLANG_SPANISH_NICARAGUA 0x13 +#define SUBLANG_SPANISH_PUERTO_RICO 0x14 +#define SUBLANG_SPANISH_US 0x15 +#define SUBLANG_SWAHILI_KENYA 0x01 +#define SUBLANG_SWEDISH 0x01 +#define SUBLANG_SWEDISH_FINLAND 0x02 +#define SUBLANG_SYRIAC_SYRIA 0x01 +#define SUBLANG_TAJIK_TAJIKISTAN 0x01 +#define SUBLANG_TAMAZIGHT_ALGERIA_LATIN 0x02 +#define SUBLANG_TAMAZIGHT_MOROCCO_TIFINAGH 0x04 +#define SUBLANG_TAMIL_INDIA 0x01 +#define SUBLANG_TAMIL_SRI_LANKA 0x02 +#define SUBLANG_TATAR_RUSSIA 0x01 +#define SUBLANG_TELUGU_INDIA 0x01 +#define SUBLANG_THAI_THAILAND 0x01 +#define SUBLANG_TIBETAN_PRC 0x01 +#define SUBLANG_TIGRIGNA_ERITREA 0x02 +#define SUBLANG_TIGRINYA_ERITREA 0x02 +#define SUBLANG_TIGRINYA_ETHIOPIA 0x01 +#define SUBLANG_TSWANA_BOTSWANA 0x02 +#define SUBLANG_TSWANA_SOUTH_AFRICA 0x01 +#define SUBLANG_TURKISH_TURKEY 0x01 +#define SUBLANG_TURKMEN_TURKMENISTAN 0x01 +#define SUBLANG_UIGHUR_PRC 0x01 +#define SUBLANG_UKRAINIAN_UKRAINE 0x01 +#define SUBLANG_UPPER_SORBIAN_GERMANY 0x01 +#define SUBLANG_URDU_PAKISTAN 0x01 +#define SUBLANG_URDU_INDIA 0x02 +#define SUBLANG_UZBEK_LATIN 0x01 +#define SUBLANG_UZBEK_CYRILLIC 0x02 +#define SUBLANG_VALENCIAN_VALENCIA 0x02 +#define SUBLANG_VIETNAMESE_VIETNAM 0x01 +#define SUBLANG_WELSH_UNITED_KINGDOM 0x01 +#define SUBLANG_WOLOF_SENEGAL 0x01 +#define SUBLANG_XHOSA_SOUTH_AFRICA 0x01 +#define SUBLANG_YAKUT_RUSSIA 0x01 +#define SUBLANG_YI_PRC 0x01 +#define SUBLANG_YORUBA_NIGERIA 0x01 +#define SUBLANG_ZULU_SOUTH_AFRICA 0x01 + +#define SORT_DEFAULT 0x0 +#define SORT_INVARIANT_MATH 0x1 +#define SORT_JAPANESE_XJIS 0x0 +#define SORT_JAPANESE_UNICODE 0x1 +#define SORT_JAPANESE_RADICALSTROKE 0x4 +#define SORT_CHINESE_BIG5 0x0 +#define SORT_CHINESE_PRCP 0x0 +#define SORT_CHINESE_UNICODE 0x1 +#define SORT_CHINESE_PRC 0x2 +#define SORT_CHINESE_BOPOMOFO 0x3 +#define SORT_CHINESE_RADICALSTROKE 0x4 +#define SORT_KOREAN_KSC 0x0 +#define SORT_KOREAN_UNICODE 0x1 +#define SORT_GERMAN_PHONE_BOOK 0x1 +#define SORT_HUNGARIAN_DEFAULT 0x0 +#define SORT_HUNGARIAN_TECHNICAL 0x1 +#define SORT_GEORGIAN_TRADITIONAL 0x0 +#define SORT_GEORGIAN_MODERN 0x1 + +#define LANG_SYSTEM_DEFAULT MAKELANGID(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT)) +#define LANG_USER_DEFAULT MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT)) + +#define LOCALE_SYSTEM_DEFAULT MAKELCID(LANG_SYSTEM_DEFAULT, SORT_DEFAULT) +#define LOCALE_USER_DEFAULT MAKELCID(LANG_USER_DEFAULT, SORT_DEFAULT) +#define LOCALE_CUSTOM_DEFAULT MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_CUSTOM_DEFAULT), SORT_DEFAULT) +#define LOCALE_CUSTOM_UNSPECIFIED MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_CUSTOM_UNSPECIFIED), SORT_DEFAULT) +#define LOCALE_CUSTOM_UI_DEFAULT MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_UI_CUSTOM_DEFAULT), SORT_DEFAULT) +#define LOCALE_NEUTRAL MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), SORT_DEFAULT) +#define LOCALE_INVARIANT MAKELCID(MAKELANGID(LANG_INVARIANT, SUBLANG_NEUTRAL), SORT_DEFAULT) + +#ifdef __cplusplus +} // extern "C" +#endif + #endif /* _NTDEF_ */ diff --git a/include/psdk/ras.h b/include/psdk/ras.h index a0bc80d63e8..aa070afb5da 100644 --- a/include/psdk/ras.h +++ b/include/psdk/ras.h @@ -13,7 +13,7 @@ extern "C" /* TODO include from winnt.h so that this typedef is not necessary */ -#ifndef _BASETSD_H +#ifndef _BASETSD_H_ typedef unsigned long ULONG_PTR, *PULONG_PTR; #endif @@ -787,7 +787,7 @@ typedef struct tagRASCOMMSETTINGS typedef DWORD (WINAPI *PFNRASSETCOMMSETTINGS) (HANDLE hPort,RASCOMMSETTINGS *pRasCommSettings,PVOID pvReserved); typedef struct tagRASCUSTOMSCRIPTEXTENSIONS { - DWORD dwSize; + DWORD dwSize; PFNRASSETCOMMSETTINGS pfnRasSetCommSettings; } RASCUSTOMSCRIPTEXTENSIONS; #endif /*(WINVER >= 0x501)*/ diff --git a/include/psdk/wingdi.h b/include/psdk/wingdi.h index 762d3f9ceb5..f04e784be39 100644 --- a/include/psdk/wingdi.h +++ b/include/psdk/wingdi.h @@ -2894,11 +2894,17 @@ typedef UINT (CALLBACK *LPFNDEVMODE)(HWND,HMODULE,LPDEVMODEA,LPSTR,LPSTR,LPDEVMO typedef DWORD (CALLBACK *LPFNDEVCAPS)(LPSTR,LPSTR,UINT,LPSTR,LPDEVMODEA); -#define RGB(r,g,b) ((DWORD)(((BYTE)(r)|((WORD)(g)<<8))|(((DWORD)(BYTE)(b))<<16))) +#define GetRValue(rgb) ((BYTE)(rgb)) +#define GetGValue(rgb) ((BYTE)(((WORD)(rgb)) >> 8)) +#define GetBValue(rgb) ((BYTE)((rgb)>>16)) + +#define RGB(r,g,b) ((COLORREF)(((BYTE)(r)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(b))<<16))) +#define PALETTERGB(r,g,b) (0x02000000 | RGB(r,g,b)) +#define PALETTEINDEX(i) ((COLORREF)(0x01000000 | (DWORD)(WORD)(i))) + #define MAKEPOINTS(l) (*((POINTS*)&(l))) -#define MAKEROP4(f,b) (DWORD)((((b)<<8)&0xFF000000)|(f)) -#define PALETTEINDEX(i) ((0x01000000|(COLORREF)(WORD)(i))) -#define PALETTERGB(r,g,b) (0x02000000|RGB(r,g,b)) +#define MAKEROP4(f,b) (DWORD)((((b)<<8)&0xFF000000)|(f)) + int WINAPI AbortDoc(_In_ HDC); BOOL WINAPI AbortPath(_In_ HDC); int WINAPI AddFontResourceA(LPCSTR); @@ -3197,14 +3203,13 @@ GdiGradientFill( BOOL WINAPI GdiTransparentBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT); BOOL WINAPI GdiIsMetaFileDC(HDC); -#define GetCValue(cmyk) ((BYTE)(cmyk)) -#define GetMValue(cmyk) ((BYTE)((cmyk)>> 8)) -#define GetYValue(cmyk) ((BYTE)((cmyk)>>16)) -#define GetKValue(cmyk) ((BYTE)((cmyk)>>24)) -#define CMYK(c,m,y,k) ((COLORREF)((((BYTE)(c)|((WORD)((BYTE)(m))<<8))|(((DWORD)(BYTE)(y))<<16))|(((DWORD)(BYTE)(k))<<24))) -#define GetRValue(c) ((BYTE)(c)) -#define GetGValue(c) ((BYTE)(((WORD)(c))>>8)) -#define GetBValue(c) ((BYTE)((c)>>16)) + +#define GetKValue(cmyk) ((BYTE)(cmyk)) +#define GetYValue(cmyk) ((BYTE)((cmyk)>> 8)) +#define GetMValue(cmyk) ((BYTE)((cmyk)>>16)) +#define GetCValue(cmyk) ((BYTE)((cmyk)>>24)) +#define CMYK(c,m,y,k) ((COLORREF)((((BYTE)(k)|((WORD)((BYTE)(y))<<8))|(((DWORD)(BYTE)(m))<<16))|(((DWORD)(BYTE)(c))<<24))) + int WINAPI GetArcDirection(_In_ HDC); BOOL WINAPI GetAspectRatioFilterEx(_In_ HDC, _Out_ LPSIZE); diff --git a/include/psdk/winnls.h b/include/psdk/winnls.h index 7a9eb2b13a7..4a1e55d07be 100644 --- a/include/psdk/winnls.h +++ b/include/psdk/winnls.h @@ -116,45 +116,57 @@ extern "C" { #define LOCALE_SABBREVMONTHNAME13 0x100F #define LOCALE_SPOSITIVESIGN 80 #define LOCALE_SNEGATIVESIGN 81 -#define LOCALE_SSCRIPTS 108 +#define LOCALE_SSCRIPTS 108 // FIXME #define LOCALE_IPOSSIGNPOSN 82 #define LOCALE_INEGSIGNPOSN 83 #define LOCALE_IPOSSYMPRECEDES 84 #define LOCALE_IPOSSEPBYSPACE 85 #define LOCALE_INEGSYMPRECEDES 86 #define LOCALE_INEGSEPBYSPACE 87 -#if (WINVER >= 0x0400) #define LOCALE_FONTSIGNATURE 88 #define LOCALE_SISO639LANGNAME 89 #define LOCALE_SISO3166CTRYNAME 90 -#define LOCALE_SNAME 92 -#endif -#if (WINVER >= 0x0600) -#define LOCALE_SSCRIPTS 108 -#endif -#define LOCALE_SYSTEM_DEFAULT 0x800 -#define LOCALE_USER_DEFAULT 0x400 +#define LOCALE_SNAME 92 // FIXME +#if (WINVER >= 0x0600) +#define LOCALE_SNAME 92 +#define LOCALE_SDURATION 93 +#define LOCALE_SKEYBOARDSTOINSTALL 94 +#define LOCALE_SSHORTESTDAYNAME1 96 +#define LOCALE_SSHORTESTDAYNAME2 97 +#define LOCALE_SSHORTESTDAYNAME3 98 +#define LOCALE_SSHORTESTDAYNAME4 99 +#define LOCALE_SSHORTESTDAYNAME5 100 +#define LOCALE_SSHORTESTDAYNAME6 101 +#define LOCALE_SSHORTESTDAYNAME7 102 +#define LOCALE_SISO639LANGNAME2 103 +#define LOCALE_SISO3166CTRYNAME2 104 +#define LOCALE_SNAN 105 +#define LOCALE_SPOSINFINITY 106 +#define LOCALE_SNEGINFINITY 107 +#define LOCALE_SSCRIPTS 108 +#define LOCALE_SPARENT 109 +#define LOCALE_SCONSOLEFALLBACKNAME 110 +#endif /* (WINVER >= 0x0600) */ + +//#if (WINVER >= _WIN32_WINNT_WIN7) #define LOCALE_IREADINGLAYOUT 0x0070 #define LOCALE_INEUTRAL 0x0071 +#define LOCALE_INEGATIVEPERCENT 0x0074 +#define LOCALE_IPOSITIVEPERCENT 0x0075 +#define LOCALE_SPERCENT 0x0076 +#define LOCALE_SPERMILLE 0x0077 +#define LOCALE_SMONTHDAY 0x0078 +#define LOCALE_SSHORTTIME 0x0079 +#define LOCALE_SOPENTYPELANGUAGETAG 0x007a +#define LOCALE_SSORTLOCALE 0x007b +//#endif /* (WINVER >= _WIN32_WINNT_WIN7) */ -#if defined(__GNUC__) -# define LOCALE_NAME_INVARIANT (const WCHAR []){ 0 } -#elif defined(_MSC_VER) -# define LOCALE_NAME_INVARIANT L"" -#else -static const WCHAR LOCALE_NAME_INVARIANT[] = { 0 }; -#endif - -#if defined(__GNUC__) -# define LOCALE_NAME_SYSTEM_DEFAULT (const WCHAR []){'!','s','y','s','-','d','e','f','a','u','l','t','-','l','o','c','a','l','e',0} -#elif defined(_MSC_VER) -# define LOCALE_NAME_SYSTEM_DEFAULT L"!sys-default-locale" -#else -static const WCHAR LOCALE_NAME_SYSTEM_DEFAULT[] = {'!','s','y','s','-','d','e','f','a','u','l','t','-','l','o','c','a','l','e',0}; -#endif - +#if (WINVER >= 0x0600) #define LOCALE_NAME_USER_DEFAULT NULL +#define LOCALE_NAME_INVARIANT L"" +#define LOCALE_NAME_SYSTEM_DEFAULT L"!sys-default-locale" +#endif #define LOCALE_IDEFAULTUNIXCODEPAGE 0x1030 /* Wine extension */ @@ -473,7 +485,7 @@ static const WCHAR LOCALE_NAME_SYSTEM_DEFAULT[] = {'!','s','y','s','-','d','e',' #define VS_ALLOW_LATIN 0x1 #define GSS_ALLOW_INHERITED_COMMON 0x1 #endif -#ifndef _BASETSD_H +#ifndef _BASETSD_H_ typedef long LONG_PTR; #endif diff --git a/include/psdk/winnt.h b/include/psdk/winnt.h index d2e277b09b7..ed716378f5f 100644 --- a/include/psdk/winnt.h +++ b/include/psdk/winnt.h @@ -1460,6 +1460,8 @@ typedef enum { #define LANGIDFROMLCID(l) ((WORD)(l)) #define LANG_SYSTEM_DEFAULT MAKELANGID(LANG_NEUTRAL,SUBLANG_SYS_DEFAULT) #define LANG_USER_DEFAULT MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT) +#define LOCALE_SYSTEM_DEFAULT MAKELCID(LANG_SYSTEM_DEFAULT, SORT_DEFAULT) +#define LOCALE_USER_DEFAULT MAKELCID(LANG_USER_DEFAULT, SORT_DEFAULT) #define LOCALE_NEUTRAL MAKELCID(MAKELANGID(LANG_NEUTRAL,SUBLANG_NEUTRAL),SORT_DEFAULT) #define LOCALE_INVARIANT MAKELCID(MAKELANGID(LANG_INVARIANT, SUBLANG_NEUTRAL), SORT_DEFAULT) #define LOCALE_NAME_MAX_LENGTH 85 @@ -3310,7 +3312,7 @@ typedef struct _CONTEXT { DWORD Fill[2]; } CONTEXT; -#elif defined(ARM) +#elif defined(_ARM_) #ifndef PAGE_SIZE #define PAGE_SIZE 0x1000 // FIXME: This should probably go elsewhere diff --git a/include/reactos/arm/armddk.h b/include/reactos/arm/armddk.h index 8def891f857..814f64b82af 100644 --- a/include/reactos/arm/armddk.h +++ b/include/reactos/arm/armddk.h @@ -228,6 +228,7 @@ extern volatile struct _KSYSTEM_TIME KeTickCount; #define RESULT_NEGATIVE 1 #define RESULT_POSITIVE 2 +#if 0 DECLSPEC_IMPORT VOID __fastcall @@ -240,6 +241,7 @@ KIRQL __fastcall KfAcquireSpinLock( IN OUT ULONG_PTR* SpinLock); +#endif #ifndef _WINNT_ // diff --git a/include/reactos/idl/ms-dtyp.idl b/include/reactos/idl/ms-dtyp.idl index 592d9dabb48..301da1a4e2f 100644 --- a/include/reactos/idl/ms-dtyp.idl +++ b/include/reactos/idl/ms-dtyp.idl @@ -7,7 +7,7 @@ typedef int BOOL, *PBOOL, *LPBOOL; typedef unsigned char BYTE, *PBYTE, *LPBYTE; typedef unsigned long DWORD, *PDWORD, *LPDWORD; cpp_quote("#endif") -cpp_quote("#ifndef _BASETSD_H") +cpp_quote("#ifndef _BASETSD_H_") typedef unsigned int DWORD32; typedef unsigned __int64 DWORD64; cpp_quote("#endif") @@ -15,13 +15,13 @@ cpp_quote("#endif") cpp_quote("#ifndef _WINDEF_H") typedef int INT, *LPINT; cpp_quote("#endif") -cpp_quote("#ifndef _BASETSD_H") +cpp_quote("#ifndef _BASETSD_H_") typedef signed char INT8; typedef signed short INT16; typedef signed int INT32; typedef signed __int64 INT64; cpp_quote("#endif") -cpp_quote("#ifndef _BASETSD_H") +cpp_quote("#ifndef _BASETSD_H_") typedef signed int LONG32; typedef signed __int64 LONG64; cpp_quote("#endif") @@ -37,7 +37,7 @@ cpp_quote("#endif") cpp_quote("#ifndef _WINDEF_H") typedef unsigned int UINT; cpp_quote("#endif") -cpp_quote("#ifndef _BASETSD_H") +cpp_quote("#ifndef _BASETSD_H_") typedef unsigned char UINT8; typedef unsigned short UINT16; typedef unsigned int UINT32; @@ -46,7 +46,7 @@ cpp_quote("#endif") cpp_quote("#ifndef _WINNT_") typedef unsigned long ULONG, *PULONG; cpp_quote("#endif") -cpp_quote("#ifndef _BASETSD_H") +cpp_quote("#ifndef _BASETSD_H_") typedef unsigned int ULONG32; typedef unsigned __int64 ULONG64; cpp_quote("#endif") @@ -77,7 +77,7 @@ cpp_quote("#endif") cpp_quote("#ifndef _WINNT_") typedef BYTE BOOLEAN, *PBOOLEAN; cpp_quote("#endif") -cpp_quote("#ifndef _BASETSD_H") +cpp_quote("#ifndef _BASETSD_H_") #ifdef _WIN64 typedef __int64 LONG_PTR; typedef unsigned __int64 ULONG_PTR; diff --git a/include/reactos/idl/pnp.idl b/include/reactos/idl/pnp.idl index 62473d6dadb..49e4943883a 100644 --- a/include/reactos/idl/pnp.idl +++ b/include/reactos/idl/pnp.idl @@ -792,73 +792,6 @@ cpp_quote("#if _WIN32_WINNT >= 0x0501") [out] DWORD *pulSSDIFlags, [in] DWORD ulFlags); -cpp_quote("#if _WIN32_WINNT >= 0x0600") - - /* Function 65 */ - DWORD PNP_GetObjectPropKeys( - [in] handle_t hBinding, - [in, string, ref] LPWSTR ObjectName, - [in] DWORD ObjectType, - [in, string, unique] LPWSTR PropertyCultureName, - [in, out] PNP_PROP_COUNT *PropertyCount, - [out] PNP_PROP_COUNT *TransferLen, - [out, size_is(*PropertyCount), length_is(*TransferLen)] DEVPROPKEY *PropertyKeys, - [in] DWORD Flags); - - /* Function 66 */ - DWORD PNP_GetObjectProp( - [in] handle_t hBinding, - [in, string, ref] LPWSTR ObjectName, - [in] DWORD ObjectType, - [in, string, unique] LPWSTR PropertyCultureName, - [in] const DEVPROPKEY *PropertyKey, - [out] DEVPROPTYPE *PropertyType, - [in, out] PNP_PROP_SIZE *PropertySize, - [out] PNP_PROP_SIZE *TransferLen, - [out, size_is(*PropertySize), length_is(*TransferLen)] BYTE *PropertyBuffer, - [in] DWORD Flags); - - /* Function 67 */ - DWORD PNP_SetObjectProp( - [in] handle_t hBinding, - [in, string, ref] LPWSTR ObjectName, - [in] DWORD ObjectType, - [in, string, unique] LPWSTR PropertyCultureName, - [in] const DEVPROPKEY *PropertyKey, - [in] DEVPROPTYPE PropertyType, - [in] PNP_PROP_SIZE PropertySize, - [in, unique, size_is(PropertySize)] BYTE *PropertyBuffer, - [in] DWORD Flags); - - /* Function 68 */ - DWORD PNP_InstallDevInst( - [in] handle_t hBinding); /* FIXME */ - - /* Function 69 */ - DWORD PNP_ApplyPowerSettings( - [in] handle_t hBinding); /* FIXME */ - - /* Function 70 */ - DWORD PNP_DriverStoreAddDriverPackage( - [in] handle_t hBinding); /* FIXME */ - - /* Function 71 */ - DWORD PNP_DriverStoreDeleteDriverPackage( - [in] handle_t hBinding); /* FIXME */ - - /* Function 72 */ - DWORD PNP_RegisterServiceNotification( - [in] handle_t hBinding); /* FIXME */ - - /* Function 73 */ - DWORD PNP_SetActiveService( - [in] handle_t hBinding); /* FIXME */ - - /* Function 74 */ - DWORD PNP_DeleteServiceDevices( - [in] handle_t hBinding); /* FIXME */ - -cpp_quote("#endif /* WIN32_WINNT >= 0x0600 */") cpp_quote("#endif /* WIN32_WINNT >= 0x0501 */") } diff --git a/include/reactos/libs/fast486/fast486.h b/include/reactos/libs/fast486/fast486.h index 5fa729159fb..434f06cee03 100644 --- a/include/reactos/libs/fast486/fast486.h +++ b/include/reactos/libs/fast486/fast486.h @@ -251,6 +251,7 @@ typedef struct _FAST486_SEG_REG ULONG DirConf : 1; ULONG Executable : 1; ULONG SystemType : 1; + ULONG Rpl : 2; ULONG Dpl : 2; ULONG Present : 1; ULONG Size : 1; diff --git a/include/reactos/msvctarget.h b/include/reactos/msvctarget.h index 9514d907455..6b2241f3016 100644 --- a/include/reactos/msvctarget.h +++ b/include/reactos/msvctarget.h @@ -1,19 +1,52 @@ -#ifndef _MSC_VER -#ifndef __GNUC__ -#error Unsupported compiler -#endif + +#pragma once /* translate GCC target defines to MS equivalents. */ -#if defined(__i686__) && !defined(_M_IX86) -#define _M_IX86 600 -#undef __i686__ -#elif defined(__i586__) && !defined(_M_IX86) -#define _M_IX86 500 -#undef __i586__ -#elif defined(__i486__) && !defined(_M_IX86) -#define _M_IX86 400 -#undef __i486__ -#elif defined(__i386__) && !defined(_M_IX86) -#define _M_IX86 300 -#endif +#if defined(__i386__) + #if !defined(_X86_) + #define _X86_ 1 + #endif + #if !defined(_M_IX86) + #define _M_IX86 1 + #endif +#elif defined(__x86_64__) || defined(__x86_64) + #if !defined(_AMD64_) + #define _AMD64_ 1 + #endif + #if !defined(_M_AMD64) + #define _M_AMD64 1 + #endif + #if !defined(_M_X64) + #define _M_X64 1 + #endif +#elif defined(__arm__) + #if !defined(_ARM_) + #define _ARM_ 1 + #endif + #if !defined(_M_ARM) + #define _M_ARM 1 + #endif +#elif defined(__ia64__) + #if !defined(_IA64_) + #define _IA64_ 1 + #endif + #if !defined(_M_IA64) + #define _M_IA64 1 + #endif +#elif defined(__alpha__) + #if !defined(_ALPHA_) + #define _ALPHA_ 1 + #endif + #if !defined(_M_ALPHA) + #define _M_ALPHA 1 + #endif +#elif defined(__powerpc__) + #if !defined(_PPC_) + #define _PPC_ 1 + #endif + #if !defined(_M_PPC) + #define _M_PPC 1 + #endif +#else +#error Unknown architecture #endif diff --git a/include/reactos/wine/exception.h b/include/reactos/wine/exception.h index 611316b50e0..5a5e7f7e9dd 100644 --- a/include/reactos/wine/exception.h +++ b/include/reactos/wine/exception.h @@ -25,10 +25,16 @@ extern "C" { #define EXCEPTION_VM86_PICRETURN 0x80000112 #ifndef _RTLTYPES_H -typedef EXCEPTION_DISPOSITION (*PEXCEPTION_HANDLER) - (struct _EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*); - struct _EXCEPTION_REGISTRATION_RECORD; + +typedef +DWORD +(*PEXCEPTION_HANDLER)( + struct _EXCEPTION_RECORD*, + struct _EXCEPTION_REGISTRATION_RECORD *, + struct _CONTEXT*, + struct _EXCEPTION_REGISTRATION_RECORD**); + typedef struct _EXCEPTION_REGISTRATION_RECORD EXCEPTION_REGISTRATION_RECORD, *PEXCEPTION_REGISTRATION_RECORD; struct _EXCEPTION_REGISTRATION_RECORD diff --git a/include/reactos/wine/test.h b/include/reactos/wine/test.h index fae1487bbd1..e0253f7ced3 100644 --- a/include/reactos/wine/test.h +++ b/include/reactos/wine/test.h @@ -68,7 +68,7 @@ extern LONG winetest_get_failures(void); extern void winetest_add_failures( LONG new_failures ); extern void winetest_wait_child_process( HANDLE process ); -extern const char *wine_dbgstr_wn( const WCHAR *str, int n ); +extern const char *wine_dbgstr_wn( const WCHAR *str, intptr_t n ); extern const char *wine_dbgstr_guid( const GUID *guid ); static inline const char *wine_dbgstr_w( const WCHAR *s ) { return wine_dbgstr_wn( s, -1 ); } @@ -486,7 +486,7 @@ void winetest_wait_child_process( HANDLE process ) } } -const char *wine_dbgstr_wn( const WCHAR *str, int n ) +const char *wine_dbgstr_wn( const WCHAR *str, intptr_t n ) { char *dst, *res; size_t size; diff --git a/lib/3rdparty/libmpg123/CMakeLists.txt b/lib/3rdparty/libmpg123/CMakeLists.txt index 9a9b11a90fe..3731927f62e 100644 --- a/lib/3rdparty/libmpg123/CMakeLists.txt +++ b/lib/3rdparty/libmpg123/CMakeLists.txt @@ -44,3 +44,7 @@ list(APPEND SOURCE add_library(libmpg123 ${SOURCE}) add_dependencies(libmpg123 psdk) add_pch(libmpg123 precomp.h SOURCE) + +if(NOT MSVC) + add_target_compile_flags(libmpg123 "-Wno-unused-but-set-variable") +endif() diff --git a/lib/3rdparty/stlport/src/stdio_streambuf.cpp b/lib/3rdparty/stlport/src/stdio_streambuf.cpp index 45aad790a6c..d49e10ad287 100644 --- a/lib/3rdparty/stlport/src/stdio_streambuf.cpp +++ b/lib/3rdparty/stlport/src/stdio_streambuf.cpp @@ -34,7 +34,7 @@ _STLP_MOVE_TO_PRIV_NAMESPACE #if defined (_STLP_USE_DEFAULT_FILE_OFFSET) || \ (!defined(_LARGEFILE_SOURCE) && !defined(_LARGEFILE64_SOURCE)) -# if !defined (_STLP_MSVC) || (_STLP_MSVC < 1400) || defined(_STLP_WCE) +# if !defined (_STLP_MSVC) || (_STLP_MSVC < 1400) || defined(_STLP_WCE) || defined(__REACTOS__) # define FSEEK fseek # else # define FSEEK _fseeki64 diff --git a/lib/atl/statreg.h b/lib/atl/statreg.h index 33f219a4779..44bbe0d8908 100644 --- a/lib/atl/statreg.h +++ b/lib/atl/statreg.h @@ -272,7 +272,7 @@ private: { len = MultiByteToWideChar(CP_ACP, 0, regstra, filelen, NULL, 0) + 1; regstrw = reinterpret_cast(HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len * sizeof(WCHAR))); - if (regstra == NULL) + if (regstrw == NULL) { HeapFree(GetProcessHeap(), 0, regstra); return E_OUTOFMEMORY; diff --git a/lib/cmlib/hivewrt.c b/lib/cmlib/hivewrt.c index 330ff81f0ff..61108065a38 100644 --- a/lib/cmlib/hivewrt.c +++ b/lib/cmlib/hivewrt.c @@ -14,8 +14,8 @@ HvpWriteLog( PHHIVE RegistryHive) { ULONG FileOffset; - ULONG BufferSize; - ULONG BitmapSize; + UINT32 BufferSize; + UINT32 BitmapSize; PUCHAR Buffer; PUCHAR Ptr; ULONG BlockIndex; @@ -42,7 +42,7 @@ HvpWriteLog( BufferSize = HV_LOG_HEADER_SIZE + sizeof(ULONG) + BitmapSize; BufferSize = ROUND_UP(BufferSize, HV_BLOCK_SIZE); - DPRINT("Bitmap size %lu buffer size: %lu\n", BitmapSize, BufferSize); + DPRINT("Bitmap size %u buffer size: %u\n", BitmapSize, BufferSize); Buffer = RegistryHive->Allocate(BufferSize, TRUE, TAG_CM); if (Buffer == NULL) diff --git a/lib/drivers/hidparser/hidparser.h b/lib/drivers/hidparser/hidparser.h index 636fd66c326..581193a319f 100644 --- a/lib/drivers/hidparser/hidparser.h +++ b/lib/drivers/hidparser/hidparser.h @@ -17,7 +17,7 @@ typedef PVOID (NTAPI *PHIDPARSER_ALLOC_FUNCTION)(ULONG Size); typedef VOID (NTAPI *PHIDPARSER_FREE_FUNCTION)(PVOID Item); typedef VOID (NTAPI *PHIDPARSER_ZERO_FUNCTION)(PVOID Item, ULONG Size); typedef VOID (NTAPI *PHIDPARSER_COPY_FUNCTION)(PVOID Target, PVOID Source, ULONG Size); -typedef VOID (NTAPI *PHIDPARSER_DEBUG_FUNCTION)(LPCSTR Src, ...); +typedef VOID (__cdecl *PHIDPARSER_DEBUG_FUNCTION)(LPCSTR Src, ...); // // status code diff --git a/lib/fast486/common.c b/lib/fast486/common.c index 36f026ec331..4babb2d366b 100644 --- a/lib/fast486/common.c +++ b/lib/fast486/common.c @@ -65,7 +65,7 @@ Fast486ReadMemory(PFAST486_STATE State, return FALSE; } - if ((!InstFetch && (GET_SEGMENT_RPL(CachedDescriptor->Selector) > CachedDescriptor->Dpl)) + if ((!InstFetch && (CachedDescriptor->Rpl > CachedDescriptor->Dpl)) || (Fast486GetCurrentPrivLevel(State) > CachedDescriptor->Dpl)) { Fast486Exception(State, FAST486_EXCEPTION_GP); @@ -132,7 +132,7 @@ Fast486WriteMemory(PFAST486_STATE State, return FALSE; } - if ((GET_SEGMENT_RPL(CachedDescriptor->Selector) > CachedDescriptor->Dpl) + if ((CachedDescriptor->Rpl > CachedDescriptor->Dpl) || (Fast486GetCurrentPrivLevel(State) > CachedDescriptor->Dpl)) { Fast486Exception(State, FAST486_EXCEPTION_GP); @@ -164,14 +164,26 @@ BOOLEAN Fast486InterruptInternal(PFAST486_STATE State, USHORT SegmentSelector, ULONG Offset, - BOOLEAN InterruptGate) + ULONG GateType) { + BOOLEAN GateSize = (GateType == FAST486_IDT_INT_GATE_32) + || (GateType == FAST486_IDT_TRAP_GATE_32); + /* Check for protected mode */ if (State->ControlRegisters[FAST486_REG_CR0] & FAST486_CR0_PE) { FAST486_TSS Tss; USHORT OldSs = State->SegmentRegs[FAST486_REG_SS].Selector; ULONG OldEsp = State->GeneralRegs[FAST486_REG_ESP].Long; + + if (GateSize != (State->SegmentRegs[FAST486_REG_CS].Size)) + { + /* + * The gate size doesn't match the current operand size, so toggle + * the OPSIZE flag. + */ + State->PrefixFlags ^= FAST486_PREFIX_OPSIZE; + } /* Check if the interrupt handler is more privileged */ if (Fast486GetCurrentPrivLevel(State) > GET_SEGMENT_RPL(SegmentSelector)) @@ -257,7 +269,7 @@ Fast486InterruptInternal(PFAST486_STATE State, /* Push the instruction pointer */ if (!Fast486StackPush(State, State->InstPtr.Long)) return FALSE; - if (InterruptGate) + if ((GateType == FAST486_IDT_INT_GATE) || (GateType == FAST486_IDT_INT_GATE_32)) { /* Disable interrupts after a jump to an interrupt gate handler */ State->Flags.If = FALSE; @@ -270,7 +282,7 @@ Fast486InterruptInternal(PFAST486_STATE State, return FALSE; } - if (State->SegmentRegs[FAST486_REG_CS].Size) + if (GateSize) { /* 32-bit code segment, use EIP */ State->InstPtr.Long = Offset; diff --git a/lib/fast486/common.h b/lib/fast486/common.h index 1bfdb311ef2..677bd19b378 100644 --- a/lib/fast486/common.h +++ b/lib/fast486/common.h @@ -159,7 +159,7 @@ Fast486InterruptInternal PFAST486_STATE State, USHORT SegmentSelector, ULONG Offset, - BOOLEAN InterruptGate + ULONG GateType ); VOID diff --git a/lib/fast486/common.inl b/lib/fast486/common.inl index fff8fc01474..a558ed461e9 100644 --- a/lib/fast486/common.inl +++ b/lib/fast486/common.inl @@ -542,24 +542,32 @@ Fast486LoadSegment(PFAST486_STATE State, { /* Loading a data segment */ - if (!GdtEntry.SystemType) + if (GET_SEGMENT_INDEX(Selector) != 0) { - /* This is a special descriptor */ - Fast486ExceptionWithErrorCode(State, FAST486_EXCEPTION_GP, Selector); - return FALSE; - } + if (!GdtEntry.SystemType) + { + /* This is a special descriptor */ + Fast486ExceptionWithErrorCode(State, FAST486_EXCEPTION_GP, Selector); + return FALSE; + } - if ((GET_SEGMENT_RPL(Selector) > GdtEntry.Dpl) - || (Fast486GetCurrentPrivLevel(State) > GdtEntry.Dpl)) - { - Fast486ExceptionWithErrorCode(State, FAST486_EXCEPTION_GP, Selector); - return FALSE; - } + if ((GET_SEGMENT_RPL(Selector) > GdtEntry.Dpl) + || (Fast486GetCurrentPrivLevel(State) > GdtEntry.Dpl)) + { + Fast486ExceptionWithErrorCode(State, FAST486_EXCEPTION_GP, Selector); + return FALSE; + } - if (!GdtEntry.Present) + if (!GdtEntry.Present) + { + Fast486ExceptionWithErrorCode(State, FAST486_EXCEPTION_NP, Selector); + return FALSE; + } + } + else { - Fast486ExceptionWithErrorCode(State, FAST486_EXCEPTION_NP, Selector); - return FALSE; + /* This is a NULL selector */ + RtlZeroMemory(&GdtEntry, sizeof(GdtEntry)); } } @@ -572,6 +580,7 @@ Fast486LoadSegment(PFAST486_STATE State, CachedDescriptor->DirConf = GdtEntry.DirConf; CachedDescriptor->Executable = GdtEntry.Executable; CachedDescriptor->SystemType = GdtEntry.SystemType; + CachedDescriptor->Rpl = GET_SEGMENT_RPL(Selector); CachedDescriptor->Dpl = GdtEntry.Dpl; CachedDescriptor->Present = GdtEntry.Present; CachedDescriptor->Size = GdtEntry.Size; diff --git a/lib/fast486/opcodes.c b/lib/fast486/opcodes.c index 1a8f1260484..e6f91a94d98 100644 --- a/lib/fast486/opcodes.c +++ b/lib/fast486/opcodes.c @@ -3702,9 +3702,9 @@ FAST486_OPCODE_HANDLER(Fast486OpcodePushImm) } else { - USHORT Data; + SHORT Data; - if (!Fast486FetchWord(State, &Data)) + if (!Fast486FetchWord(State, (PUSHORT)&Data)) { /* Exception occurred */ return FALSE; @@ -3837,12 +3837,12 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeImulModrmImm) FAST486_OPCODE_HANDLER(Fast486OpcodePushByteImm) { - UCHAR Data; + CHAR Data; /* Make sure this is the right instruction */ ASSERT(Opcode == 0x6A); - if (!Fast486FetchByte(State, &Data)) + if (!Fast486FetchByte(State, (PUCHAR)&Data)) { /* Exception occurred */ return FALSE; diff --git a/lib/fast486/opgroups.c b/lib/fast486/opgroups.c index 264fa66ba2c..efcaa1641ae 100644 --- a/lib/fast486/opgroups.c +++ b/lib/fast486/opgroups.c @@ -2018,10 +2018,13 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroup0F01) { UCHAR TableReg[6]; FAST486_MOD_REG_RM ModRegRm; - BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size; + BOOLEAN OperandSize, AddressSize; FAST486_SEG_REGS Segment = FAST486_REG_DS; + OperandSize = AddressSize = State->SegmentRegs[FAST486_REG_CS].Size; + NO_LOCK_PREFIX(); + TOGGLE_OPSIZE(OperandSize); TOGGLE_ADSIZE(AddressSize); if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm)) @@ -2117,6 +2120,9 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroup0F01) State->Gdtr.Size = *((PUSHORT)TableReg); State->Gdtr.Address = *((PULONG)&TableReg[sizeof(USHORT)]); + /* In 16-bit mode the highest byte is masked out */ + if (!OperandSize) State->Gdtr.Address &= 0x00FFFFFF; + return TRUE; } @@ -2153,6 +2159,9 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroup0F01) State->Idtr.Size = *((PUSHORT)TableReg); State->Idtr.Address = *((PULONG)&TableReg[sizeof(USHORT)]); + /* In 16-bit mode the highest byte is masked out */ + if (!OperandSize) State->Idtr.Address &= 0x00FFFFFF; + return TRUE; } diff --git a/lib/pseh/CMakeLists.txt b/lib/pseh/CMakeLists.txt index 1c26807e8d1..84ea2a2758f 100644 --- a/lib/pseh/CMakeLists.txt +++ b/lib/pseh/CMakeLists.txt @@ -29,14 +29,13 @@ else() list(APPEND ASM_SOURCE i386/seh.s i386/seh_prolog.s) - list(APPEND SOURCE dummy.c) elseif(ARCH STREQUAL "amd64") list(APPEND ASM_SOURCE amd64/seh.s amd64/seh_prolog.s) - list(APPEND SOURCE dummy.c) endif() + list(APPEND SOURCE dummy.c) add_asm_files(pseh_asm ${ASM_SOURCE}) add_library(pseh ${SOURCE} ${pseh_asm}) add_dependencies(pseh asm) diff --git a/lib/rtl/bitmap.c b/lib/rtl/bitmap.c index 350e182191c..c7aa880bc1e 100644 --- a/lib/rtl/bitmap.c +++ b/lib/rtl/bitmap.c @@ -30,6 +30,9 @@ typedef ULONG64 BITMAP_BUFFER, *PBITMAP_BUFFER; #undef BitScanForward #define BitScanForward(Index, Mask) \ do { unsigned long tmp; BitScanForward64(&tmp, Mask); *Index = tmp; } while (0) +#undef BitScanReverse +#define BitScanReverse(Index, Mask) \ + do { unsigned long tmp; BitScanReverse64(&tmp, Mask); *Index = tmp; } while (0) #define RtlFillMemoryUlong RtlFillMemoryUlonglong #define RtlInitializeBitMap RtlInitializeBitMap64 @@ -734,7 +737,7 @@ RtlFindFirstRunClear( return RtlFindNextForwardRunClear(BitMapHeader, 0, StartingIndex); } -ULONG +BITMAP_INDEX NTAPI RtlFindLastBackwardRunClear( _In_ PRTL_BITMAP BitMapHeader, @@ -771,7 +774,7 @@ RtlFindLastBackwardRunClear( BitScanReverse(&BitPos, InvValue); /* Calculate last bit position */ - FromIndex = (Buffer + 1 - BitMapHeader->Buffer) * _BITCOUNT + BitPos; + FromIndex = (BITMAP_INDEX)((Buffer + 1 - BitMapHeader->Buffer) * _BITCOUNT + BitPos); Value = ~InvValue << ((_BITCOUNT - 1) - BitPos) >> ((_BITCOUNT - 1) - BitPos); @@ -787,7 +790,7 @@ RtlFindLastBackwardRunClear( BitScanReverse(&BitPos, Value); /* Calculate Starting Index */ - *StartingRunIndex = (Buffer + 1 - BitMapHeader->Buffer) * _BITCOUNT + BitPos + 1; + *StartingRunIndex = (BITMAP_INDEX)((Buffer + 1 - BitMapHeader->Buffer) * _BITCOUNT + BitPos + 1); } else { @@ -796,7 +799,7 @@ RtlFindLastBackwardRunClear( } /* Return length of the run */ - return FromIndex - *StartingRunIndex; + return (FromIndex - *StartingRunIndex); } diff --git a/lib/sdk/crt/crt.cmake b/lib/sdk/crt/crt.cmake index eae70e5d520..60aeb56b642 100644 --- a/lib/sdk/crt/crt.cmake +++ b/lib/sdk/crt/crt.cmake @@ -306,6 +306,7 @@ list(APPEND CRT_SOURCE string/wtoi.c string/wtoi64.c string/wtol.c + string/winesup.c sys_stat/systime.c time/asctime.c time/clock.c diff --git a/lib/sdk/crt/except/stack.c b/lib/sdk/crt/except/stack.c index 0fc725c6e50..61416121ff6 100644 --- a/lib/sdk/crt/except/stack.c +++ b/lib/sdk/crt/except/stack.c @@ -38,7 +38,8 @@ void _chkesp_failed(void) int CDECL _resetstkoflw(void) { int stack_addr; + DWORD oldprot; /* causes stack fault that updates NtCurrentTeb()->Tib.StackLimit */ - return VirtualProtect( &stack_addr, 1, PAGE_GUARD|PAGE_READWRITE, NULL ); + return VirtualProtect(&stack_addr, 1, PAGE_GUARD|PAGE_READWRITE, &oldprot); } diff --git a/lib/sdk/crt/include/internal/locale.h b/lib/sdk/crt/include/internal/locale.h index 148bea673da..23c618ff2cf 100644 --- a/lib/sdk/crt/include/internal/locale.h +++ b/lib/sdk/crt/include/internal/locale.h @@ -18,7 +18,7 @@ typedef struct MSVCRT_threadlocaleinfostruct { int *lconv_intl_refcount; int *lconv_num_refcount; int *lconv_mon_refcount; - struct MSVCRT_lconv *lconv; + struct lconv *lconv; int *ctype1_refcount; unsigned short *ctype1; const unsigned short *pctype; @@ -37,26 +37,7 @@ typedef struct MSVCRT_threadmbcinfostruct { char mbcasemap[256]; } MSVCRT_threadmbcinfo; -struct MSVCRT_lconv { - char* decimal_point; - char* thousands_sep; - char* grouping; - char* int_curr_symbol; - char* currency_symbol; - char* mon_decimal_point; - char* mon_thousands_sep; - char* mon_grouping; - char* positive_sign; - char* negative_sign; - char int_frac_digits; - char frac_digits; - char p_cs_precedes; - char p_sep_by_space; - char n_cs_precedes; - char n_sep_by_space; - char p_sign_posn; - char n_sign_posn; -}; +#define MSVCRT_lconv lconv typedef struct MSVCRT_threadlocaleinfostruct *MSVCRT_pthreadlocinfo; typedef struct MSVCRT_threadmbcinfostruct *MSVCRT_pthreadmbcinfo; diff --git a/lib/sdk/crt/libcntpr.cmake b/lib/sdk/crt/libcntpr.cmake index 487c92e3a60..6477dfeea38 100644 --- a/lib/sdk/crt/libcntpr.cmake +++ b/lib/sdk/crt/libcntpr.cmake @@ -59,6 +59,7 @@ list(APPEND LIBCNTPR_SOURCE string/wtoi64.c string/wtoi.c string/wtol.c + string/winesup.c wstring/wcsicmp.c wstring/wcslwr.c wstring/wcsnicmp.c diff --git a/lib/sdk/crt/stdio/file.c b/lib/sdk/crt/stdio/file.c index 299e2ddf7ab..0debf16feaf 100644 --- a/lib/sdk/crt/stdio/file.c +++ b/lib/sdk/crt/stdio/file.c @@ -553,6 +553,29 @@ int CDECL _isatty(int fd) return TRUE; } +/* INTERNAL: Allocate temporary buffer for stdout and stderr */ +static BOOL add_std_buffer(FILE *file) +{ + static char buffers[2][BUFSIZ]; + + if((file->_file!=STDOUT_FILENO && file->_file!=STDERR_FILENO) + || !_isatty(file->_file) || file->_bufsiz) + return FALSE; + + file->_ptr = file->_base = buffers[file->_file == STDOUT_FILENO ? 0 : 1]; + file->_bufsiz = file->_cnt = BUFSIZ; + return TRUE; +} + +/* INTERNAL: Removes temporary buffer from stdout or stderr */ +/* Only call this function when add_std_buffer returned TRUE */ +static void remove_std_buffer(FILE *file) +{ + flush_buffer(file); + file->_ptr = file->_base = NULL; + file->_bufsiz = file->_cnt = 0; +} + /* INTERNAL: Convert integer to base32 string (0-9a-v), 0 becomes "" */ static int int_to_base32(int num, char *str) { @@ -3416,34 +3439,9 @@ LONG CDECL ftell(FILE* file) */ int CDECL fgetpos(FILE* file, fpos_t *pos) { - int off=0; - - _lock_file(file); - *pos = _lseeki64(file->_file,0,SEEK_CUR); - if(*pos == -1) { - _unlock_file(file); + *pos = _ftelli64(file); + if(*pos == -1) return -1; - } - if(file->_bufsiz) { - if( file->_flag & _IOWRT ) { - off = file->_ptr - file->_base; - } else { - off = -file->_cnt; - if (get_ioinfo(file->_file)->wxflag & WX_TEXT) { - /* Black magic correction for CR removal */ - int i; - for (i=0; i_cnt; i++) { - if (file->_ptr[i] == '\n') - off--; - } - /* Black magic when reading CR at buffer boundary*/ - if(get_ioinfo(file->_file)->wxflag & WX_READCR) - off--; - } - } - } - *pos += off; - _unlock_file(file); return 0; } @@ -3452,23 +3450,13 @@ int CDECL fgetpos(FILE* file, fpos_t *pos) */ int CDECL fputs(const char *s, FILE* file) { - size_t i, len = strlen(s); + size_t len = strlen(s); int ret; _lock_file(file); - if (!(get_ioinfo(file->_file)->wxflag & WX_TEXT)) { - ret = fwrite(s,sizeof(*s),len,file) == len ? 0 : EOF; - _unlock_file(file); - return ret; - } - for (i=0; i=0;i--) { - if(pp[i] != ungetc(pp[i],file)) { + + if((get_ioinfo(file->_file)->exflag & (EF_UTF8 | EF_UTF16)) + || !(get_ioinfo(file->_file)->wxflag & WX_TEXT)) { + unsigned char * pp = (unsigned char *)&mwc; + int i; + + for(i=sizeof(wchar_t)-1;i>=0;i--) { + if(pp[i] != ungetc(pp[i],file)) { + _unlock_file(file); + return WEOF; + } + } + }else { + char mbs[MB_LEN_MAX]; + int len; + + len = wctomb(mbs, mwc); + if(len == -1) { _unlock_file(file); return WEOF; } + + for(len--; len>=0; len--) { + if(mbs[len] != ungetc(mbs[len], file)) { + _unlock_file(file); + return WEOF; + } + } } _unlock_file(file); diff --git a/lib/sdk/crt/string/scanf.c b/lib/sdk/crt/string/scanf.c index 57c56d0c263..8951f86357c 100644 --- a/lib/sdk/crt/string/scanf.c +++ b/lib/sdk/crt/string/scanf.c @@ -23,13 +23,15 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -#include +#include +#include -// HACK for LIBCNT -#ifndef debugstr_a -#define debugstr_a -#endif +#include +#include + +#include "winesup.h" + +WINE_DEFAULT_DEBUG_CHANNEL(msvcrt); //extern FILE _iob[]; @@ -56,78 +58,83 @@ static int wchar2digit(wchar_t c, int base) { } #ifndef _LIBCNT_ -/* vfscanf */ +/* vfscanf_l */ #undef WIDE_SCANF #undef CONSOLE #undef STRING +#undef SECURE #include "scanf.h" -/* vfwscanf */ +/* vfwscanf_l */ #define WIDE_SCANF 1 #undef CONSOLE #undef STRING +#undef SECURE #include "scanf.h" -#endif +#endif /* !_LIBCNT_ */ -/* vsscanf */ +/* vsscanf_l */ #undef WIDE_SCANF #undef CONSOLE #define STRING 1 +#undef SECURE #include "scanf.h" -/* vswscanf */ +/* vswscanf_l */ #define WIDE_SCANF 1 #undef CONSOLE #define STRING 1 +#undef SECURE #include "scanf.h" #ifndef _LIBCNT_ -/* vcscanf */ +/* vcscanf_l */ #undef WIDE_SCANF #define CONSOLE 1 #undef STRING +#undef SECURE #include "scanf.h" /********************************************************************* * fscanf (MSVCRT.@) */ -int fscanf(FILE *file, const char *format, ...) +int CDECL fscanf(FILE *file, const char *format, ...) { - va_list valist; + __ms_va_list valist; int res; - va_start(valist, format); - res = vfscanf(file, format, valist); - va_end(valist); + __ms_va_start(valist, format); + res = vfscanf_l(file, format, NULL, valist); + __ms_va_end(valist); return res; } /********************************************************************* * scanf (MSVCRT.@) */ -int scanf(const char *format, ...) +int CDECL scanf(const char *format, ...) { - va_list valist; + __ms_va_list valist; int res; - va_start(valist, format); - res = vfscanf(stdin, format, valist); - va_end(valist); + __ms_va_start(valist, format); + res = vfscanf_l(stdin, format, NULL, valist); + __ms_va_end(valist); return res; } /********************************************************************* * fwscanf (MSVCRT.@) */ -int fwscanf(FILE *file, const wchar_t *format, ...) +int CDECL fwscanf(FILE *file, const wchar_t *format, ...) { - va_list valist; + __ms_va_list valist; int res; - va_start(valist, format); - res = vfwscanf(file, format, valist); - va_end(valist); + __ms_va_start(valist, format); + res = vfwscanf_l(file, format, NULL, valist); + __ms_va_end(valist); return res; } @@ -135,30 +142,30 @@ int fwscanf(FILE *file, const wchar_t *format, ...) /********************************************************************* * wscanf (MSVCRT.@) */ -int wscanf(const wchar_t *format, ...) +int CDECL wscanf(const wchar_t *format, ...) { - va_list valist; + __ms_va_list valist; int res; - va_start(valist, format); - res = vfwscanf(stdin, format, valist); - va_end(valist); + __ms_va_start(valist, format); + res = vfwscanf_l(stdin, format, NULL, valist); + __ms_va_end(valist); return res; } -#endif +#endif /* !_LIBCNT_ */ /********************************************************************* * sscanf (MSVCRT.@) */ -int sscanf(const char *str, const char *format, ...) +int CDECL sscanf(const char *str, const char *format, ...) { - va_list valist; + __ms_va_list valist; int res; - va_start(valist, format); - res = vsscanf(str, format, valist); - va_end(valist); + __ms_va_start(valist, format); + res = vsscanf_l(str, format, NULL, valist); + __ms_va_end(valist); return res; } @@ -168,12 +175,12 @@ int sscanf(const char *str, const char *format, ...) */ int CDECL swscanf(const wchar_t *str, const wchar_t *format, ...) { - va_list valist; + __ms_va_list valist; int res; - va_start(valist, format); - res = vswscanf(str, format, valist); - va_end(valist); + __ms_va_start(valist, format); + res = vswscanf_l(str, format, NULL, valist); + __ms_va_end(valist); return res; } @@ -183,12 +190,12 @@ int CDECL swscanf(const wchar_t *str, const wchar_t *format, ...) */ int CDECL _cscanf(const char *format, ...) { - va_list valist; + __ms_va_list valist; int res; - va_start(valist, format); - res = vcscanf(format, valist); - va_end(valist); + __ms_va_start(valist, format); + res = vcscanf_l(format, NULL, valist); + __ms_va_end(valist); return res; } #endif diff --git a/lib/sdk/crt/string/scanf.h b/lib/sdk/crt/string/scanf.h index 4aada82b6b9..4a28c921c20 100644 --- a/lib/sdk/crt/string/scanf.h +++ b/lib/sdk/crt/string/scanf.h @@ -37,8 +37,8 @@ #define _CHAR_ char #define _EOF_ EOF #define _EOF_RET EOF -#define _ISSPACE_(c) isspace((unsigned char)(c)) -#define _ISDIGIT_(c) isdigit((unsigned char)(c)) +#define _ISSPACE_(c) isspace(c) +#define _ISDIGIT_(c) isdigit(c) #define _WIDE2SUPPORTED_(c) c /* FIXME: convert wide char to char */ #define _CHAR2SUPPORTED_(c) c /* No conversion needed (char to char) */ #define _CHAR2DIGIT_(c, base) char2digit((c), (base)) @@ -48,32 +48,89 @@ #ifdef CONSOLE #define _GETC_(file) (consumed++, _getch()) #define _UNGETC_(nch, file) do { _ungetch(nch); consumed--; } while(0) -#define _FUNCTION_ int vcscanf(const char *format, va_list ap) +#define _LOCK_FILE_(file) _lock_file(stdin) +#define _UNLOCK_FILE_(file) _unlock_file(stdin) +#ifdef WIDE_SCANF +#ifdef SECURE +#define _FUNCTION_ static int vcwscanf_s_l(const char *format, _locale_t locale, __ms_va_list ap) +#else /* SECURE */ +#define _FUNCTION_ static int vcwscanf_l(const char *format, _locale_t locale, __ms_va_list ap) +#endif /* SECURE */ +#else /* WIDE_SCANF */ +#ifdef SECURE +#define _FUNCTION_ static int vcscanf_s_l(const char *format, _locale_t locale, __ms_va_list ap) +#else /* SECURE */ +#define _FUNCTION_ static int vcscanf_l(const char *format, _locale_t locale, __ms_va_list ap) +#endif /* SECURE */ +#endif /* WIDE_SCANF */ #else #ifdef STRING #undef _EOF_ #define _EOF_ 0 +#ifdef STRING_LEN +#define _GETC_(file) (consumed==length ? '\0' : (consumed++, *file++)) +#define _UNGETC_(nch, file) do { file--; consumed--; } while(0) +#define _LOCK_FILE_(file) do {} while(0) +#define _UNLOCK_FILE_(file) do {} while(0) +#ifdef WIDE_SCANF +#ifdef SECURE +#define _FUNCTION_ static int vsnwscanf_s_l(const wchar_t *file, size_t length, const wchar_t *format, _locale_t locale, __ms_va_list ap) +#else /* SECURE */ +#define _FUNCTION_ static int vsnwscanf_l(const wchar_t *file, size_t length, const wchar_t *format, _locale_t locale, __ms_va_list ap) +#endif /* SECURE */ +#else /* WIDE_SCANF */ +#ifdef SECURE +#define _FUNCTION_ static int vsnscanf_s_l(const char *file, size_t length, const char *format, _locale_t locale, __ms_va_list ap) +#else /* SECURE */ +#define _FUNCTION_ static int vsnscanf_l(const char *file, size_t length, const char *format, _locale_t locale, __ms_va_list ap) +#endif /* SECURE */ +#endif /* WIDE_SCANF */ +#else /* STRING_LEN */ #define _GETC_(file) (consumed++, *file++) #define _UNGETC_(nch, file) do { file--; consumed--; } while(0) +#define _LOCK_FILE_(file) do {} while(0) +#define _UNLOCK_FILE_(file) do {} while(0) #ifdef WIDE_SCANF -#define _FUNCTION_ int vswscanf(const wchar_t *file, const wchar_t *format, va_list ap) +#ifdef SECURE +#define _FUNCTION_ static int vswscanf_s_l(const wchar_t *file, const wchar_t *format, _locale_t locale, __ms_va_list ap) +#else /* SECURE */ +#define _FUNCTION_ static int vswscanf_l(const wchar_t *file, const wchar_t *format, _locale_t locale, __ms_va_list ap) +#endif /* SECURE */ #else /* WIDE_SCANF */ -#define _FUNCTION_ int vsscanf(const char *file, const char *format, va_list ap) +#ifdef SECURE +#define _FUNCTION_ static int vsscanf_s_l(const char *file, const char *format, _locale_t locale, __ms_va_list ap) +#else /* SECURE */ +#define _FUNCTION_ static int vsscanf_l(const char *file, const char *format, _locale_t locale, __ms_va_list ap) +#endif /* SECURE */ #endif /* WIDE_SCANF */ +#endif /* STRING_LEN */ #else /* STRING */ #ifdef WIDE_SCANF #define _GETC_(file) (consumed++, fgetwc(file)) #define _UNGETC_(nch, file) do { ungetwc(nch, file); consumed--; } while(0) -#define _FUNCTION_ int vfwscanf(FILE* file, const wchar_t *format, va_list ap) +#define _LOCK_FILE_(file) _lock_file(file) +#define _UNLOCK_FILE_(file) _unlock_file(file) +#ifdef SECURE +#define _FUNCTION_ static int vfwscanf_s_l(FILE* file, const wchar_t *format, _locale_t locale, __ms_va_list ap) +#else /* SECURE */ +#define _FUNCTION_ static int vfwscanf_l(FILE* file, const wchar_t *format, _locale_t locale, __ms_va_list ap) +#endif /* SECURE */ #else /* WIDE_SCANF */ #define _GETC_(file) (consumed++, fgetc(file)) #define _UNGETC_(nch, file) do { ungetc(nch, file); consumed--; } while(0) -#define _FUNCTION_ int vfscanf(FILE* file, const char *format, va_list ap) +#define _LOCK_FILE_(file) _lock_file(file) +#define _UNLOCK_FILE_(file) _unlock_file(file) +#ifdef SECURE +#define _FUNCTION_ static int vfscanf_s_l(FILE* file, const char *format, _locale_t locale, __ms_va_list ap) +#else /* SECURE */ +#define _FUNCTION_ static int vfscanf_l(FILE* file, const char *format, _locale_t locale, __ms_va_list ap) +#endif /* SECURE */ #endif /* WIDE_SCANF */ #endif /* STRING */ #endif /* CONSOLE */ _FUNCTION_ { + pthreadlocinfo locinfo; int rd = 0, consumed = 0; int nch; if (!*format) return 0; @@ -82,18 +139,25 @@ _FUNCTION_ { TRACE("(%s):\n", debugstr_a(format)); #else /* CONSOLE */ #ifdef STRING - TRACE("%s (%s)\n", file, debugstr_a(format)); + TRACE("%s (%s)\n", debugstr_a(file), debugstr_a(format)); #else /* STRING */ TRACE("%p (%s)\n", file, debugstr_a(format)); #endif /* STRING */ #endif /* CONSOLE */ #endif /* WIDE_SCANF */ + _LOCK_FILE_(file); nch = _GETC_(file); if (nch == _EOF_) { + _UNLOCK_FILE_(file); return _EOF_RET; } + if(!locale) + locinfo = get_locinfo(); + else + locinfo = locale->locinfo; + while (*format) { /* a whitespace character in the format string causes scanf to read, * but not store, all consecutive white-space characters in the input @@ -179,7 +243,7 @@ _FUNCTION_ { base = 0; number: { /* read an integer */ - __int64 cur = 0; + ULONGLONG cur = 0; int negative = 0; int seendigit=0; /* skip initial whitespace */ @@ -233,7 +297,7 @@ _FUNCTION_ { if (!seendigit) break; /* not a valid number */ st = 1; if (!suppress) { -#define _SET_NUMBER_(type) *va_arg(ap, type*) = (type)(negative ? -cur : cur) +#define _SET_NUMBER_(type) *va_arg(ap, type*) = negative ? -cur : cur if (I64_prefix) _SET_NUMBER_(LONGLONG); else if (l_prefix) _SET_NUMBER_(LONG); else if (h_prefix == 1) _SET_NUMBER_(short int); @@ -246,8 +310,12 @@ _FUNCTION_ { case 'f': case 'g': case 'G': { /* read a float */ - long double cur = 0; - int negative = 0; + //long double cur = 1, expcnt = 10; + ULONGLONG d, hlp; + int exp = 0, negative = 0; + //unsigned fpcontrol; + //BOOL negexp; + /* skip initial whitespace */ while ((nch!=_EOF_) && _ISSPACE_(nch)) nch = _GETC_(file); @@ -259,69 +327,112 @@ _FUNCTION_ { if (width==0) break; nch = _GETC_(file); } - /* get first digit. */ - if ('.' != nch) { - if (!_ISDIGIT_(nch)) break; - cur = (nch - '0'); - nch = _GETC_(file); - if (width>0) width--; - /* read until no more digits */ - while (width!=0 && (nch!=_EOF_) && _ISDIGIT_(nch)) { - cur = cur*10 + (nch - '0'); - nch = _GETC_(file); - if (width>0) width--; - } - } else { - cur = 0; /* MaxPayneDemo Fix: .8 -> 0.8 */ - } - /* handle decimals */ - if (width!=0 && nch == '.') { - long double dec = 1; + + /* get first digit. */ + if (*locinfo->lconv->decimal_point != nch) { + if (!_ISDIGIT_(nch)) break; + d = nch - '0'; nch = _GETC_(file); if (width>0) width--; + /* read until no more digits */ + while (width!=0 && (nch!=_EOF_) && _ISDIGIT_(nch)) { + hlp = d*10 + nch - '0'; + nch = _GETC_(file); + if (width>0) width--; + if(d > (ULONGLONG)-1/10 || hlp0) width--; + } + } else { + d = 0; /* Fix: .8 -> 0.8 */ + } + + /* handle decimals */ + if (width!=0 && nch == *locinfo->lconv->decimal_point) { + nch = _GETC_(file); + if (width>0) width--; + + while (width!=0 && (nch!=_EOF_) && _ISDIGIT_(nch)) { + hlp = d*10 + nch - '0'; + nch = _GETC_(file); + if (width>0) width--; + if(d > (ULONGLONG)-1/10 || hlp0) width--; } } - /* handle exponent */ - if (width!=0 && (nch == 'e' || nch == 'E')) { - int exponent = 0, negexp = 0; - double expcnt, shift; + + /* handle exponent */ + if (width!=0 && (nch == 'e' || nch == 'E')) { + int sign = 1, e = 0; + nch = _GETC_(file); if (width>0) width--; - /* possible sign on the exponent */ - if (width!=0 && (nch=='+' || nch=='-')) { - negexp = (nch=='-'); - nch = _GETC_(file); - if (width>0) width--; - } - /* exponent digits */ - while (width!=0 && (nch!=_EOF_) && _ISDIGIT_(nch)) { - exponent *= 10; - exponent += (nch - '0'); + if (width!=0 && (nch=='+' || nch=='-')) { + if(nch == '-') + sign = -1; nch = _GETC_(file); if (width>0) width--; } - /* update 'cur' with this exponent. */ - expcnt = 10; - shift = 1.0; - while (exponent!=0) { - if (exponent&1) - shift *= expcnt; - exponent/=2; - expcnt=expcnt*expcnt; - } - cur = (negexp ? cur / shift : cur * shift); - } + + /* exponent digits */ + while (width!=0 && (nch!=_EOF_) && _ISDIGIT_(nch)) { + if(e > INT_MAX/10 || (e = e*10 + nch - '0')<0) + e = INT_MAX; + nch = _GETC_(file); + if (width>0) width--; + } + e *= sign; + + if(exp<0 && e<0 && e+exp>0) exp = INT_MIN; + else if(exp>0 && e>0 && e+exp<0) exp = INT_MAX; + else exp += e; + } + +#ifdef __REACTOS__ + /* ReactOS: don't inline float processing (kernel/freeldr don't like that! */ + _internal_handle_float(negative, exp, suppress, d, l_prefix || L_prefix, &ap); + st = 1; +#else + fpcontrol = _control87(0, 0); + _control87(MSVCRT__EM_DENORMAL|MSVCRT__EM_INVALID|MSVCRT__EM_ZERODIVIDE + |MSVCRT__EM_OVERFLOW|MSVCRT__EM_UNDERFLOW|MSVCRT__EM_INEXACT, 0xffffffff); + + negexp = (exp < 0); + if(negexp) + exp = -exp; + /* update 'cur' with this exponent. */ + while(exp) { + if(exp & 1) + cur *= expcnt; + exp /= 2; + expcnt = expcnt*expcnt; + } + cur = (negexp ? d/cur : d*cur); + + _control87(fpcontrol, 0xffffffff); + st = 1; if (!suppress) { - if (L_prefix) _SET_NUMBER_(long double); + if (L_prefix) _SET_NUMBER_(double); else if (l_prefix) _SET_NUMBER_(double); else _SET_NUMBER_(float); } +#endif /* __REACTOS__ */ } break; /* According to msdn, @@ -348,12 +459,26 @@ _FUNCTION_ { #endif /* WIDE_SCANF */ charstring: { /* read a word into a char */ char *sptr = suppress ? NULL : va_arg(ap, char*); + char *sptr_beg = sptr; +#ifdef SECURE + unsigned size = suppress ? UINT_MAX : va_arg(ap, unsigned); +#else + unsigned size = UINT_MAX; +#endif /* skip initial whitespace */ while ((nch!=_EOF_) && _ISSPACE_(nch)) nch = _GETC_(file); /* read until whitespace */ while (width!=0 && (nch!=_EOF_) && !_ISSPACE_(nch)) { - if (!suppress) *sptr++ = _CHAR2SUPPORTED_(nch); + if (!suppress) { + *sptr++ = _CHAR2SUPPORTED_(nch); + if(size>1) size--; + else { + _UNLOCK_FILE_(file); + *sptr_beg = 0; + return rd; + } + } st++; nch = _GETC_(file); if (width>0) width--; @@ -364,12 +489,26 @@ _FUNCTION_ { break; widecharstring: { /* read a word into a wchar_t* */ wchar_t *sptr = suppress ? NULL : va_arg(ap, wchar_t*); + wchar_t *sptr_beg = sptr; +#ifdef SECURE + unsigned size = suppress ? UINT_MAX : va_arg(ap, unsigned); +#else + unsigned size = UINT_MAX; +#endif /* skip initial whitespace */ while ((nch!=_EOF_) && _ISSPACE_(nch)) nch = _GETC_(file); /* read until whitespace */ while (width!=0 && (nch!=_EOF_) && !_ISSPACE_(nch)) { - if (!suppress) *sptr++ = _WIDE2SUPPORTED_(nch); + if (!suppress) { + *sptr++ = _WIDE2SUPPORTED_(nch); + if(size>1) size--; + else { + _UNLOCK_FILE_(file); + *sptr_beg = 0; + return rd; + } + } st++; nch = _GETC_(file); if (width>0) width--; @@ -398,10 +537,24 @@ _FUNCTION_ { #endif /* WIDE_SCANF */ character: { /* read single character into char */ char *str = suppress ? NULL : va_arg(ap, char*); + char *pstr = str; +#ifdef SECURE + unsigned size = suppress ? UINT_MAX : va_arg(ap, unsigned)/sizeof(char); +#else + unsigned size = UINT_MAX; +#endif if (width == -1) width = 1; - while ((width != 0) && (nch != _EOF_)) + while (width && (nch != _EOF_)) { - if (!suppress) *str++ = _CHAR2SUPPORTED_(nch); + if (!suppress) { + *str++ = _CHAR2SUPPORTED_(nch); + if(size) size--; + else { + _UNLOCK_FILE_(file); + *pstr = 0; + return rd; + } + } st++; width--; nch = _GETC_(file); @@ -410,10 +563,24 @@ _FUNCTION_ { break; widecharacter: { /* read single character into a wchar_t */ wchar_t *str = suppress ? NULL : va_arg(ap, wchar_t*); + wchar_t *pstr = str; +#ifdef SECURE + unsigned size = suppress ? UINT_MAX : va_arg(ap, unsigned)/sizeof(wchar_t); +#else + unsigned size = UINT_MAX; +#endif if (width == -1) width = 1; - while ((width != 0) && (nch != _EOF_)) + while (width && (nch != _EOF_)) { - if (!suppress) *str++ = _WIDE2SUPPORTED_(nch); + if (!suppress) { + *str++ = _WIDE2SUPPORTED_(nch); + if(size) size--; + else { + _UNLOCK_FILE_(file); + *pstr = 0; + return rd; + } + } st++; width--; nch = _GETC_(file); @@ -446,14 +613,15 @@ _FUNCTION_ { RTL_BITMAP bitMask; ULONG *Mask; int invert = 0; /* Set if we are NOT to find the chars */ - - /* Init our bitmap */ -#ifdef _LIBCNT_ - Mask = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, _BITMAPSIZE_/8); +#ifdef SECURE + unsigned size = suppress ? UINT_MAX : va_arg(ap, unsigned)/sizeof(_CHAR_); #else - Mask = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, _BITMAPSIZE_/8); + unsigned size = UINT_MAX; #endif - RtlInitializeBitMap(&bitMask, Mask, _BITMAPSIZE_); + + /* Init our bitmap */ + Mask = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, _BITMAPSIZE_/8); + RtlInitializeBitMap(&bitMask, Mask, _BITMAPSIZE_); /* Read the format */ format++; @@ -472,7 +640,7 @@ _FUNCTION_ { if ((*(format - 1)) < *(format + 1)) RtlSetBits(&bitMask, *(format - 1) +1 , *(format + 1) - *(format - 1)); else - RtlSetBits(&bitMask, *(format + 1) , *(format - 1) - *(format + 1)); + RtlSetBits(&bitMask, *(format + 1) , *(format - 1) - *(format + 1)); format++; } else RtlSetBits(&bitMask, *format, 1); @@ -494,14 +662,16 @@ _FUNCTION_ { st++; nch = _GETC_(file); if (width>0) width--; + if(size>1) size--; + else { + _UNLOCK_FILE_(file); + *str = 0; + return rd; + } } /* terminate */ if (!suppress) *sptr = 0; -#ifdef _LIBCNT_ - RtlFreeHeap(RtlGetProcessHeap(), 0, Mask); -#else - HeapFree(GetProcessHeap(), 0, Mask); -#endif + HeapFree(GetProcessHeap(), 0, Mask); } break; default: @@ -539,6 +709,7 @@ _FUNCTION_ { } TRACE("returning %d\n", rd); + _UNLOCK_FILE_(file); return rd; } @@ -552,5 +723,7 @@ _FUNCTION_ { #undef _CHAR2DIGIT_ #undef _GETC_ #undef _UNGETC_ +#undef _LOCK_FILE_ +#undef _UNLOCK_FILE_ #undef _FUNCTION_ #undef _BITMAPSIZE_ diff --git a/lib/sdk/crt/string/winesup.c b/lib/sdk/crt/string/winesup.c new file mode 100644 index 00000000000..860fe85cdb4 --- /dev/null +++ b/lib/sdk/crt/string/winesup.c @@ -0,0 +1,102 @@ + +#include "precomp.h" +#include "winesup.h" + +#ifdef _LIBCNT_ + +static struct lconv _LIBCNT_lconv = +{ + ".", // char* decimal_point; + ",", // char* thousands_sep; + " ", // char* grouping; + "$", // char* int_curr_symbol; + "$", // char* currency_symbol; + ".", // char* mon_decimal_point; + "?", // char* mon_thousands_sep; + "/", // char* mon_grouping; + "+", // char* positive_sign; + "-", // char* negative_sign; + 4, // char int_frac_digits; + 4, // char frac_digits; + 4, // char p_cs_precedes; + 1, // char p_sep_by_space; + 0, // char n_cs_precedes; + 1, // char n_sep_by_space; + 1, // char p_sign_posn; + 1, // char n_sign_posn; +}; + +threadlocinfo _LIBCNT_locinfo = +{ + 2, // LONG refcount; + 0, // CP_ACP, // unsigned int lc_codepage; + 0, // unsigned int lc_collate_cp; + {0}, // unsigned long lc_handle[6]; + {{0}}, // LC_ID lc_id[6]; + + // struct { + // char *locale; + // wchar_t *wlocale; + // int *refcount; + // int *wrefcount; + // } lc_category[6]; + {{0}}, + + 0, // int lc_clike; + 2, // int mb_cur_max; + 0, // int *lconv_intl_refcount; + 0, // int *lconv_num_refcount; + 0, // int *lconv_mon_refcount; + &_LIBCNT_lconv, // struct MSVCRT_lconv *lconv; + 0, // int *ctype1_refcount; + 0, // unsigned short *ctype1; + 0, // const unsigned short *pctype; + 0, // unsigned char *pclmap; + 0, // unsigned char *pcumap; + 0, // struct __lc_time_data *lc_time_curr; +}; + +#define get_locinfo() (&_LIBCNT_locinfo) + +#endif + +#define _SET_NUMBER_(type) *va_arg((*ap), type*) = negative ? -cur : cur + +void +__declspec(noinline) +_internal_handle_float( + int negative, + int exp, + int suppress, + ULONGLONG d, + int l_or_L_prefix, + va_list *ap) +{ + long double cur = 1, expcnt = 10; + unsigned fpcontrol; + BOOL negexp; + + fpcontrol = _control87(0, 0); + _control87(_EM_DENORMAL|_EM_INVALID|_EM_ZERODIVIDE + |_EM_OVERFLOW|_EM_UNDERFLOW|_EM_INEXACT, 0xffffffff); + + negexp = (exp < 0); + if(negexp) + exp = -exp; + /* update 'cur' with this exponent. */ + while(exp) { + if(exp & 1) + cur *= expcnt; + exp /= 2; + expcnt = expcnt*expcnt; + } + cur = (negexp ? d/cur : d*cur); + + _control87(fpcontrol, 0xffffffff); + + if (!suppress) { + if (l_or_L_prefix) _SET_NUMBER_(double); + else _SET_NUMBER_(float); + } +} +#undef _SET_NUMBER_ diff --git a/lib/sdk/crt/string/winesup.h b/lib/sdk/crt/string/winesup.h new file mode 100644 index 00000000000..7bc3ed7810a --- /dev/null +++ b/lib/sdk/crt/string/winesup.h @@ -0,0 +1,45 @@ +#pragma once + +#include +#include +#include +#include +#include + +#undef NtCurrentPeb +#define NtCurrentPeb() (NtCurrentTeb()->Peb) +#define GetProcessHeap() (NtCurrentPeb()->ProcessHeap) + +#define HeapAlloc(_Heap, _Flags, _Size) RtlAllocateHeap(_Heap, _Flags, _Size) +#define HeapFree(_Heap, _Flags, _Ptr) RtlFreeHeap(_Heap, _Flags, _Ptr) + +#ifdef _LIBCNT_ +static inline unsigned int __control87(unsigned int new, unsigned int mask) +{ + return 0; +} +#define _control87 __control87 +extern threadlocinfo _LIBCNT_locinfo; +#define get_locinfo() (&_LIBCNT_locinfo) +#else +#define get_locinfo() ((pthreadlocinfo)get_locinfo()) +#endif + +void +__declspec(noinline) +_internal_handle_float( + int negative, + int exp, + int suppress, + ULONGLONG d, + int l_or_L_prefix, + va_list *ap); + +//#include + +#define __WINE_DEBUG_H +#undef WINE_DEFAULT_DEBUG_CHANNEL +#define WINE_DEFAULT_DEBUG_CHANNEL(_Ch) +#undef TRACE +#define TRACE(...) /* DPRINT(__VA_ARGS__) */ +#define debugstr_a(format) format diff --git a/media/doc/3rd Party Files.txt b/media/doc/3rd Party Files.txt index af7379e8b77..41dcea0758a 100644 --- a/media/doc/3rd Party Files.txt +++ b/media/doc/3rd Party Files.txt @@ -10,6 +10,14 @@ Title: DejaVu Fonts Used Version: 2.34 Website: http://dejavu.sourceforge.net +Title: Ubuntu Fonts +Used Version: 0.80 +Website: http://font.ubuntu.com + +Title: Open Sans Fonts +Used Version: 1.10 +Website: http://www.google.com/fonts/specimen/Open+Sans + Title: DXTN OpenGL Compression Libs Used Version: 1.1 Website: http://www.geocities.com/dborca/opengl/tc.html diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 781541477d4..fa5845e65e7 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -277,7 +277,7 @@ msvcrt - reactos/lib/sdk/crt/except/cpp.c # Synced at 20080528 reactos/lib/sdk/crt/except/cppexcept.c # Synced at 20071111 reactos/lib/sdk/crt/signal/xcptinfo.c # Synced to Wine-1.7.17 - reactos/lib/sdk/crt/string/scanf.c/h # Synced to Wine-1_1_27 + reactos/lib/sdk/crt/string/scanf.c/h # Synced to Wine-1.7.17 reactos/lib/sdk/crt/strings/wcs.c # Synced at 20080611 reactos/lib/sdk/crt/wine/heap.c # Synced at 20080529 reactos/lib/sdk/crt/wine/undname.c # Synced at 20081130 diff --git a/media/fonts/CMakeLists.txt b/media/fonts/CMakeLists.txt index 53345f35a4e..3aacdc7292f 100644 --- a/media/fonts/CMakeLists.txt +++ b/media/fonts/CMakeLists.txt @@ -47,9 +47,35 @@ list(APPEND FONT_FILES LiberationSerif-Italic.ttf LiberationSerif-Regular.ttf Marlett.ttf + OpenSans-Bold.ttf + OpenSans-BoldItalic.ttf + OpenSans-CondBold.ttf + OpenSans-CondLight.ttf + OpenSans-CondLightItalic.ttf + OpenSans-ExtraBold.ttf + OpenSans-ExtraBoldItalic.ttf + OpenSans-Italic.ttf + OpenSans-Light.ttf + OpenSans-LightItalic.ttf + OpenSans-Regular.ttf + OpenSans-Semibold.ttf + OpenSans-SemiboldItalic.ttf symbol.ttf tahoma.ttf tahomabd.ttf + Ubuntu-B.ttf + Ubuntu-BI.ttf + Ubuntu-C.ttf + Ubuntu-L.ttf + Ubuntu-LI.ttf + Ubuntu-M.ttf + Ubuntu-MI.ttf + UbuntuMono-B.ttf + UbuntuMono-BI.ttf + UbuntuMono-R.ttf + UbuntuMono-RI.ttf + Ubuntu-R.ttf + Ubuntu-RI.ttf UniVGA16.ttf ) diff --git a/media/fonts/OpenSans-Bold.ttf b/media/fonts/OpenSans-Bold.ttf new file mode 100644 index 00000000000..fd79d43bea0 Binary files /dev/null and b/media/fonts/OpenSans-Bold.ttf differ diff --git a/media/fonts/OpenSans-BoldItalic.ttf b/media/fonts/OpenSans-BoldItalic.ttf new file mode 100644 index 00000000000..9bc800958a4 Binary files /dev/null and b/media/fonts/OpenSans-BoldItalic.ttf differ diff --git a/media/fonts/OpenSans-CondBold.ttf b/media/fonts/OpenSans-CondBold.ttf new file mode 100644 index 00000000000..83966f21381 Binary files /dev/null and b/media/fonts/OpenSans-CondBold.ttf differ diff --git a/media/fonts/OpenSans-CondLight.ttf b/media/fonts/OpenSans-CondLight.ttf new file mode 100644 index 00000000000..97c355b9f67 Binary files /dev/null and b/media/fonts/OpenSans-CondLight.ttf differ diff --git a/media/fonts/OpenSans-CondLightItalic.ttf b/media/fonts/OpenSans-CondLightItalic.ttf new file mode 100644 index 00000000000..0b45898db8e Binary files /dev/null and b/media/fonts/OpenSans-CondLightItalic.ttf differ diff --git a/media/fonts/OpenSans-ExtraBold.ttf b/media/fonts/OpenSans-ExtraBold.ttf new file mode 100644 index 00000000000..21f6f84a079 Binary files /dev/null and b/media/fonts/OpenSans-ExtraBold.ttf differ diff --git a/media/fonts/OpenSans-ExtraBoldItalic.ttf b/media/fonts/OpenSans-ExtraBoldItalic.ttf new file mode 100644 index 00000000000..31cb688340e Binary files /dev/null and b/media/fonts/OpenSans-ExtraBoldItalic.ttf differ diff --git a/media/fonts/OpenSans-Italic.ttf b/media/fonts/OpenSans-Italic.ttf new file mode 100644 index 00000000000..c90da48ff3b Binary files /dev/null and b/media/fonts/OpenSans-Italic.ttf differ diff --git a/media/fonts/OpenSans-Light.ttf b/media/fonts/OpenSans-Light.ttf new file mode 100644 index 00000000000..0d381897da2 Binary files /dev/null and b/media/fonts/OpenSans-Light.ttf differ diff --git a/media/fonts/OpenSans-LightItalic.ttf b/media/fonts/OpenSans-LightItalic.ttf new file mode 100644 index 00000000000..68299c4bc6b Binary files /dev/null and b/media/fonts/OpenSans-LightItalic.ttf differ diff --git a/media/fonts/OpenSans-Regular.ttf b/media/fonts/OpenSans-Regular.ttf new file mode 100644 index 00000000000..db433349b70 Binary files /dev/null and b/media/fonts/OpenSans-Regular.ttf differ diff --git a/media/fonts/OpenSans-Semibold.ttf b/media/fonts/OpenSans-Semibold.ttf new file mode 100644 index 00000000000..1a7679e3949 Binary files /dev/null and b/media/fonts/OpenSans-Semibold.ttf differ diff --git a/media/fonts/OpenSans-SemiboldItalic.ttf b/media/fonts/OpenSans-SemiboldItalic.ttf new file mode 100644 index 00000000000..59b6d16b065 Binary files /dev/null and b/media/fonts/OpenSans-SemiboldItalic.ttf differ diff --git a/media/fonts/Ubuntu-B.ttf b/media/fonts/Ubuntu-B.ttf new file mode 100644 index 00000000000..c0142fea093 Binary files /dev/null and b/media/fonts/Ubuntu-B.ttf differ diff --git a/media/fonts/Ubuntu-BI.ttf b/media/fonts/Ubuntu-BI.ttf new file mode 100644 index 00000000000..12e4c7df7bf Binary files /dev/null and b/media/fonts/Ubuntu-BI.ttf differ diff --git a/media/fonts/Ubuntu-C.ttf b/media/fonts/Ubuntu-C.ttf new file mode 100644 index 00000000000..8d3e8676575 Binary files /dev/null and b/media/fonts/Ubuntu-C.ttf differ diff --git a/media/fonts/Ubuntu-L.ttf b/media/fonts/Ubuntu-L.ttf new file mode 100644 index 00000000000..7b7ac7dd51f Binary files /dev/null and b/media/fonts/Ubuntu-L.ttf differ diff --git a/media/fonts/Ubuntu-LI.ttf b/media/fonts/Ubuntu-LI.ttf new file mode 100644 index 00000000000..e36de452d42 Binary files /dev/null and b/media/fonts/Ubuntu-LI.ttf differ diff --git a/media/fonts/Ubuntu-M.ttf b/media/fonts/Ubuntu-M.ttf new file mode 100644 index 00000000000..443ec8b76d6 Binary files /dev/null and b/media/fonts/Ubuntu-M.ttf differ diff --git a/media/fonts/Ubuntu-MI.ttf b/media/fonts/Ubuntu-MI.ttf new file mode 100644 index 00000000000..321eccf73cf Binary files /dev/null and b/media/fonts/Ubuntu-MI.ttf differ diff --git a/media/fonts/Ubuntu-R.ttf b/media/fonts/Ubuntu-R.ttf new file mode 100644 index 00000000000..45a038bade5 Binary files /dev/null and b/media/fonts/Ubuntu-R.ttf differ diff --git a/media/fonts/Ubuntu-RI.ttf b/media/fonts/Ubuntu-RI.ttf new file mode 100644 index 00000000000..6f819f69c68 Binary files /dev/null and b/media/fonts/Ubuntu-RI.ttf differ diff --git a/media/fonts/UbuntuMono-B.ttf b/media/fonts/UbuntuMono-B.ttf new file mode 100644 index 00000000000..7bd66657657 Binary files /dev/null and b/media/fonts/UbuntuMono-B.ttf differ diff --git a/media/fonts/UbuntuMono-BI.ttf b/media/fonts/UbuntuMono-BI.ttf new file mode 100644 index 00000000000..6c5b8ba023e Binary files /dev/null and b/media/fonts/UbuntuMono-BI.ttf differ diff --git a/media/fonts/UbuntuMono-R.ttf b/media/fonts/UbuntuMono-R.ttf new file mode 100644 index 00000000000..fdd309d7166 Binary files /dev/null and b/media/fonts/UbuntuMono-R.ttf differ diff --git a/media/fonts/UbuntuMono-RI.ttf b/media/fonts/UbuntuMono-RI.ttf new file mode 100644 index 00000000000..18f81a29258 Binary files /dev/null and b/media/fonts/UbuntuMono-RI.ttf differ diff --git a/media/fonts/doc/OpenSans/Apache License.txt b/media/fonts/doc/OpenSans/Apache License.txt new file mode 100644 index 00000000000..989e2c59e97 --- /dev/null +++ b/media/fonts/doc/OpenSans/Apache License.txt @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/media/fonts/doc/Ubuntu/CONTRIBUTING.txt b/media/fonts/doc/Ubuntu/CONTRIBUTING.txt new file mode 100644 index 00000000000..15bdc0c0b09 --- /dev/null +++ b/media/fonts/doc/Ubuntu/CONTRIBUTING.txt @@ -0,0 +1,21 @@ +The Ubuntu Font Family is very long-term endeavour, and the first time +that a professionally-designed font has been funded specifically with +the intent of being an on-going community expanded project: + + http://font.ubuntu.com/ + +Development of the Ubuntu Font Family is undertaken on Launchpad: + + http://launchpad.net/ubuntu-font-family/ + +and this is where milestones, bug management and releases are handled. + +Contributions are welcomed. Your work will be used on millions of +computers every single day! Following the initial bootstrapping of +Latin, Cyrillic, Greek, Arabic and Hebrew expansion will be undertaken +by font designers from the font design and Ubuntu communities. + +To ensure that the Ubuntu Font Family can be re-licensed to future +widely-used libre font licences, copyright assignment is being required: + + https://launchpad.net/~uff-contributors diff --git a/media/fonts/doc/Ubuntu/FONTLOG.txt b/media/fonts/doc/Ubuntu/FONTLOG.txt new file mode 100644 index 00000000000..35beb4fb72c --- /dev/null +++ b/media/fonts/doc/Ubuntu/FONTLOG.txt @@ -0,0 +1,274 @@ +This is the FONTLOG file for the Ubuntu Font Family and attempts to follow +the recommendations at: http://scripts.sil.org/OFL-FAQ_web#43cecb44 + + +Overview + +The new Ubuntu Font Family was started to enable the personality of +Ubuntu to be seen and felt in every menu, button and dialog. +The typeface is sans-serif, uses OpenType features and is manually +hinted for clarity on desktop and mobile computing screens. + +The scope of the Ubuntu Font Family includes all the languages used by +the various Ubuntu users around the world in tune with Ubuntu's +philosophy which states that every user should be able to use their +software in the language of their choice. So the Ubuntu Font Family +project will be extended to cover many more written languages. + + +History + +The Ubuntu Font Family has been creating during 2010 and 2011. As of +September 2011 coverage is provided for Latin, Cyrillic and Greek across +Regular, Italic, Bold and Bold-Italic. + + +ChangeLog + +2011-09-22 (Paul Sladen) Ubuntu Font Family version 0.80 + + [Vincent Connare/Dalton Maag] + * Wish for addition of a monospaced member to the family (LP: #640382) + * Mono: No hinting yet - Ubuntu Beta Mono font looks jagged in + Netbeans and terrible with ClearType (LP: #820493) + * Emacs: choosing normal monospace font in Emacs but gives bold-italic + (LP: #791076) + * PUA: ensure that Ubuntu Circle of Friends logo is full size: (LP: #853855) + + U+E0FF becomes large size in proportionals, remains small width in + monospaces + + U+F0FF becomes small size (proportionals only) + + U+F200 is full ubuntu logomark (proportionals only) + + [Paul Sladen] + * Monospace: Patch Family Name to be "Ubuntu Mono" + * Monospace: Patch U+EFFD version debugging glyph to be '0.8' + + [Cody Boisclair] + * Monospace: Force .null HDMX advance to 500 + * Monospace: Remap ASCII box-drawing characters (LP: #788757) + + [Júlio Reis] + * Date corrections to 'FONTLOG' (LP: #836595) + +2011-03-08 (Paul Sladen) Ubuntu Font Family version 0.71.2 + + * (Production) Adjust Medium WeightClass to 500 (Md, MdIt) (LP: #730912) + +2011-03-07 (Paul Sladen) Ubuntu Font Family version 0.71.1 + + * (Design) Add Capitalised version of glyphs and kern. (Lt, LtIt, + Md, MdIt) DM (LP: #677446) + * (Design) Re-space and tighen Regular and Italic by amount specified + by Mark Shuttleworth (minus 4 FUnits). (Rg, It) (LP: #677149) + * (Design) Design: Latin (U+0192) made straight more like l/c f with + tail (LP: #670768) + * (Design) (U+01B3) should have hook on right, as the lowercase + (U+01B4) (LP: #681026) + * (Design) Tail of Light Italic germandbls, longs and lowercase 'f' + to match Italic/BoldItalic (LP: #623925) + * (Production) Update feature (Lt, LtIt, Md, MdIt). DM + (LP: #676538, #676539) + * (Production) Remove Bulgarian locl feature for Italics. (LP: #708578) + * (Production) Update Description information with new string: + "The Ubuntu Font Family are libre fonts funded by Canonical Ltd + on behalf of the Ubuntu project. The font design work and + technical implementation is being undertaken by Dalton Maag. The + typeface is sans-serif, uses OpenType features and is manually + hinted for clarity on desktop and mobile computing screens. The + scope of the Ubuntu Font Family includes all the languages used + by the various Ubuntu users around the world in tune with + Ubuntu's philosophy which states that every user should be able + to use their software in the language of their choice. The + project is ongoing, and we expect the family will be extended to + cover many written languages in the coming years." + (Rg, It, Bd, BdIt, Lt, LtIt, Md, MdIt) (LP: #690590) + * (Production) Pixel per em indicator added at U+F000 (Lt, LtIt, Md, + MdIt) (LP: #615787) + * (Production) Version number indicator added at U+EFFD (Lt, LtIt, Md, + MdIt) (LP: #640623) + * (Production) fstype bit set to 0 - Editable (Lt, LtIt, Md, MdIt) + (LP: #648406) + * (Production) Localisation of name table has been removed because + of problems with Mac OS/X interpretation of localisation. DM + (LP: #730785) + * (Hinting) Regular '?' dot non-circular (has incorrect control + value). (LP: #654336) + * (Hinting) Too much space after latin capital 'G' in 13pt + regular. Now reduced. (LP: #683437) + * (Hinting) Balance Indian Rupee at 18,19pt (LP: #662177) + * (Hinting) Make Regular '£' less ambiguous at 13-15 ppm (LP: #685562) + * (Hinting) Regular capital 'W' made symmetrical at 31 ppem (LP: #686168) + +2010-12-14 (Paul Sladen) Ubuntu Font Family version 0.70.1 + + Packaging, rebuilt from '2010-12-08 UbuntuFontsSourceFiles_070.zip': + * (Midstream) Fstype bit != 0 (LP: #648406) + * (Midstream) Add unit test to validate fstype bits (LP: #648406) + * (Midstream) Add unit test to validate licence + +2010-12-14 (Paul Sladen) Ubuntu Font Family version 0.70 + + Release notes 0.70: + * (Design) Add Capitalised version of glyphs and kern. (Rg, It, Bd, + BdIt) DM (LP: #676538, #677446) + * (Design) Give acute and grave a slight upright move to more match + the Hungarian double acute angle. (Rg, It, Bd, BdIt) (LP: #656647) + * (Design) Shift Bold Italic accent glyphs to be consistent with the + Italic. (BdIt only) DM (LP: #677449) + * (Design) Check spacing and kerning of dcaron, lcaron and + tcaron. (Rg, It, Bd, BdIt) (LP: #664722) + * (Design) Add positive kerning to () {} [] to open out the + combinations so they are less like a closed box. (Rg, It, Bd, + BdIt) (LP: #671228) + * (Design) Change design of acute.asc and check highest points (Bd + and BdIt only) DM + * (Production) Update feature. DM (LP: #676538, #676539) + * (Production) Remove Romanian locl feature. (Rg, It, Bd, BdIt) + (LP: #635615) + * (Production) Update Copyright information with new + strings. "Copyright 2010 Canonical Ltd. Licensed under the Ubuntu + Font Licence 1.0" Trademark string "Ubuntu and Canonical are + registered trademarks of Canonical Ltd." (Rg, It, Bd, BdIt) DM + (LP: #677450) + * (Design) Check aligning of hyphen, math signs em, en, check braces + and other brackets. 16/11 (LP: #676465) + * (Production) Pixel per em indicator added at U+F000 (Rg, It, Bd, + BdIt) (LP: #615787) + * (Production) Version number indicator added at U+EFFD (Rg, It, Bd, + BdIt) (LP: #640623) + * (Production) fstype bit set to 0 - Editable (Rg, It, Bd, BdIt) + (LP: #648406) + +2010-10-05 (Paul Sladen) Ubuntu Font Family version 0.69 + + [Dalton Maag] + * Italic, + - Hinting on lowercase Italic l amended 19ppm (LP: #632451) + - Hinting on lowercase Italic u amended 12ppm (LP: #626376) + + * Regular, Italic, Bold, BoldItalic + - New Rupee Sign added @ U+20B9 (LP: #645987) + - Ubuntu Roundel added @ U+E0FF (LP: #651606) + + [Paul Sladen] + * All + - Removed "!ubu" GSUB.calt ligature for U+E0FF (LP: #651606) + + +Acknowledgements + +If you make modifications be sure to add your name (N), email (E), +web-address (if you have one) (W) and description (D). This list is in +alphabetical order. + +N: Ryan Abdullah +W: http://www.rayan.de/ +D: Arabic calligraphy and design in collaboration with Dalton Maag +D: Arabic testing + +N: Cody Boisclair +D: Monospace low-level debugging and patching ('fixboxdrawing-ft.py') + +N: Amélie Bonet +W: http://ameliebonet.com/ +D: Type design with Dalton Maag, particularly Ubuntu Mono and Ubuntu Condensed + +N: Jason Campbell +W: http://www.campbellgraphics.com/design/fonts.shtml +D: Monospace hinting (first phase) at Dalton Maag + +N: Pilar Cano +W: http://www.pilarcano.com/ +D: Hebrew realisation with Dalton Maag + +N: Fernando Caro +D: Type design with Dalton Maag, particularly Ubuntu Condensed + +N: Ron Carpenter +W: http://www.daltonmaag.com/ +D: Type design with Dalton Maag +D: Arabic realisation in collaboration with Ryan Abdullah + +N: Vincent Connare +W: http://www.connare.com/ +D: Type design, and engineering with Dalton Maag +D: Monospace hinting (second phase) at Dalton Maag + +N: Dave Crossland +E: dave@understandingfonts.com +W: http://understandingfonts.com/ +D: Documentation and libre licensing guidance +D: Google Webfont integration at Google + +N: Steve Edwards +W: http://www.madebymake.com/ +D: font.ubuntu.com revamp implementation with Canonical Web Team + +N: Iain Farrell +W: http://www.flickr.com/photos/iain +D: Ubuntu Font Family delivery for the Ubuntu UX team at Canonical + +N: Shiraaz Gabru +W: http://www.daltonmaag.com/ +D: Ubuntu Font Family project management at Dalton Maag + +N: Marcus Haslam +W: http://design.canonical.com/author/marcus-haslam/ +D: Creative inspiration + +N: Ben Laenen +D: Inspiration behind the pixels-per-em (PPEM) readout debugging glyph at U+F000 + (for this font the concept was re-implemented from scratch by Dalton-Maag) + +N: Bruno Maag +W: http://www.daltonmaag.com/ +D: Stylistic direction of the Ubuntu Font Family, as head of Dalton Maag + +N: Ivanka Majic +W: http://www.ivankamajic.com/ +D: Guiding the UX team and Cyrillic feedback + +N: David Marshall +W: http://www.daltonmaag.com/ +D: Technical guidance and administration at Dalton Maag + +N: Malcolm Wooden +W: http://www.daltonmaag.com/ +D: Font Engineering at Dalton Maag + +N: Lukas Paltram +W: http://www.daltonmaag.com/ +D: Type design with Dalton Maag + +N: Júlio Reis +D: Date fixes to the documentation + +N: Rodrigo Rivas +D: Indian Rupee Sign glyph + +N: Mark Shuttleworth +E: mark@ubuntu.com +W: http://www.markshuttleworth.com/ +D: Executive quality-control and funding + +N: Paul Sladen +E: ubuntu@paul.sladen.org +W: http://www.paul.sladen.org/ +D: Bug triaging, packaging at Ubuntu and Canonical + +N: Nicolas Spalinger +W: http://planet.open-fonts.org +D: Continuous guidance on libre/open font licensing, best practises in source + tree layout, release and packaging (pkg-fonts Debian team) + +N: Kenneth Wimer +D: Initial PPA packaging + +* Canonical Ltd is the primary commercial sponsor of the Ubuntu and + Kubuntu operating systems +* Dalton Maag are a custom type foundry headed by Bruno Maag + +For further documentation, information on contributors, source code +downloads and those involved with the Ubuntu Font Family, visit: + + http://font.ubuntu.com/ diff --git a/media/fonts/doc/Ubuntu/LICENCE-FAQ.txt b/media/fonts/doc/Ubuntu/LICENCE-FAQ.txt new file mode 100644 index 00000000000..776a25edf13 --- /dev/null +++ b/media/fonts/doc/Ubuntu/LICENCE-FAQ.txt @@ -0,0 +1,177 @@ + Ubuntu Font Family Licensing FAQ + + Stylistic Foundations + + The Ubuntu Font Family is the first time that a libre typeface has been + designed professionally and explicitly with the intent of developing a + public and long-term community-based development process. + + When developing an open project, it is generally necessary to have firm + foundations: a font needs to maintain harmony within itself even across + many type designers and writing systems. For the [1]Ubuntu Font Family, + the process has been guided with the type foundry Dalton Maag setting + the project up with firm stylistic foundation covering several + left-to-right scripts: Latin, Greek and Cyrillic; and right-to-left + scripts: Arabic and Hebrew (due in 2011). + + With this starting point the community will, under the supervision of + [2]Canonical and [3]Dalton Maag, be able to build on the existing font + sources to expand their character coverage. Ultimately everybody will + be able to use the Ubuntu Font Family in their own written languages + across the whole of Unicode (and this will take some time!). + + Licensing + + The licence chosen by any free software project is one of the + foundational decisions that sets out how derivatives and contributions + can occur, and in turn what kind of community will form around the + project. + + Using a licence that is compatible with other popular licences is a + powerful constraint because of the [4]network effects: the freedom to + share improvements between projects allows free software to reach + high-quality over time. Licence-proliferation leads to many + incompatible licences, undermining the network effect, the freedom to + share and ultimately making the libre movement that Ubuntu is a part of + less effective. For all kinds of software, writing a new licence is not + to be taken lightly and is a choice that needs to be thoroughly + justified if this path is taken. + + Today it is not clear to Canonical what the best licence for a font + project like the Ubuntu Font Family is: one that starts life designed + by professionals and continues with the full range of community + development, from highly commercial work in new directions to curious + beginners' experimental contributions. The fast and steady pace of the + Ubuntu release cycle means that an interim libre licence has been + necessary to enable the consideration of the font family as part of + Ubuntu 10.10 operating system release. + + Before taking any decision on licensing, Canonical as sponsor and + backer of the project has reviewed the many existing licenses used for + libre/open fonts and engaged the stewards of the most popular licenses + in detailed discussions. The current interim licence is the first step + in progressing the state-of-the-art in licensing for libre/open font + development. + + The public discussion must now involve everyone in the (comparatively + new) area of the libre/open font community; including font users, + software freedom advocates, open source supporters and existing libre + font developers. Most importantly, the minds and wishes of professional + type designers considering entering the free software business + community must be taken on board. + + Conversations and discussion has taken place, privately, with + individuals from the following groups (generally speaking personally on + behalf of themselves, rather than their affiliations): + * [5]SIL International + * [6]Open Font Library + * [7]Software Freedom Law Center + * [8]Google Font API + + Document embedding + + One issue highlighted early on in the survey of existing font licences + is that of document embedding. Almost all font licences, both free and + unfree, permit embedding a font into a document to a certain degree. + Embedding a font with other works that make up a document creates a + "combined work" and copyleft would normally require the whole document + to be distributed under the terms of the font licence. As beautiful as + the font might be, such a licence makes a font too restrictive for + useful general purpose digital publishing. + + The situation is not entirely unique to fonts and is encountered also + with tools such as GNU Bison: a vanilla GNU GPL licence would require + anything generated with Bison to be made available under the terms of + the GPL as well. To avoid this, Bison is [9]published with an + additional permission to the GPL which allows the output of Bison to be + made available under any licence. + + The conflict between licensing of fonts and licensing of documents, is + addressed in two popular libre font licences, the SIL OFL and GNU GPL: + * [10]SIL Open Font Licence: When OFL fonts are embedded in a + document, the OFL's terms do not apply to that document. (See + [11]OFL-FAQ for details. + * [12]GPL Font Exception: The situation is resolved by granting an + additional permission to allow documents to not be covered by the + GPL. (The exception is being reviewed). + + The Ubuntu Font Family must also resolve this conflict, ensuring that + if the font is embedded and then extracted it is once again clearly + under the terms of its libre licence. + + Long-term licensing + + Those individuals involved, especially from Ubuntu and Canonical, are + interested in finding a long-term libre licence that finds broad favour + across the whole libre/open font community. The deliberation during the + past months has been on how to licence the Ubuntu Font Family in the + short-term, while knowingly encouraging everyone to pursue a long-term + goal. + * [13]Copyright assignment will be required so that the Ubuntu Font + Family's licensing can be progressively expanded to one (or more) + licences, as best practice continues to evolve within the + libre/open font community. + * Canonical will support and fund legal work on libre font licensing. + It is recognised that the cost and time commitments required are + likely to be significant. We invite other capable parties to join + in supporting this activity. + + The GPL version 3 (GPLv3) will be used for Ubuntu Font Family build + scripts and the CC-BY-SA for associated documentation and non-font + content: all items which do not end up embedded in general works and + documents. + +Ubuntu Font Licence + + For the short-term only, the initial licence is the [14]Ubuntu Font + License (UFL). This is loosely inspired from the work on the SIL + OFL 1.1, and seeks to clarify the issues that arose during discussions + and legal review, from the perspective of the backers, Canonical Ltd. + Those already using established licensing models such as the GPL, OFL + or Creative Commons licensing should have no worries about continuing + to use them. The Ubuntu Font Licence (UFL) and the SIL Open Font + Licence (SIL OFL) are not identical and should not be confused with + each other. Please read the terms precisely. The UFL is only intended + as an interim license, and the overriding aim is to support the + creation of a more suitable and generic libre font licence. As soon as + such a licence is developed, the Ubuntu Font Family will migrate to + it—made possible by copyright assignment in the interium. Between the + OFL 1.1, and the UFL 1.0, the following changes are made to produce the + Ubuntu Font Licence: + * Clarification: + + 1. Document embedding (see [15]embedding section above). + 2. Apply at point of distribution, instead of receipt + 3. Author vs. copyright holder disambiguation (type designers are + authors, with the copyright holder normally being the funder) + 4. Define "Propagate" (for internationalisation, similar to the GPLv3) + 5. Define "Substantially Changed" + 6. Trademarks are explicitly not transferred + 7. Refine renaming requirement + + Streamlining: + 8. Remove "not to be sold separately" clause + 9. Remove "Reserved Font Name(s)" declaration + + A visual demonstration of how these points were implemented can be + found in the accompanying coloured diff between SIL OFL 1.1 and the + Ubuntu Font Licence 1.0: [16]ofl-1.1-ufl-1.0.diff.html + +References + + 1. http://font.ubuntu.com/ + 2. http://www.canonical.com/ + 3. http://www.daltonmaag.com/ + 4. http://en.wikipedia.org/wiki/Network_effect + 5. http://scripts.sil.org/ + 6. http://openfontlibrary.org/ + 7. http://www.softwarefreedom.org/ + 8. http://code.google.com/webfonts + 9. http://www.gnu.org/licenses/gpl-faq.html#CanIUseGPLToolsForNF + 10. http://scripts.sil.org/OFL_web + 11. http://scripts.sil.org/OFL-FAQ_web + 12. http://www.gnu.org/licenses/gpl-faq.html#FontException + 13. https://launchpad.net/~uff-contributors + 14. http://font.ubuntu.com/ufl/ubuntu-font-licence-1.0.txt + 15. http://font.ubuntu.com/ufl/FAQ.html#embedding + 16. http://font.ubuntu.com/ufl/ofl-1.1-ufl-1.0.diff.html diff --git a/media/fonts/doc/Ubuntu/LICENCE.txt b/media/fonts/doc/Ubuntu/LICENCE.txt new file mode 100644 index 00000000000..ae78a8f94ea --- /dev/null +++ b/media/fonts/doc/Ubuntu/LICENCE.txt @@ -0,0 +1,96 @@ +------------------------------- +UBUNTU FONT LICENCE Version 1.0 +------------------------------- + +PREAMBLE +This licence allows the licensed fonts to be used, studied, modified and +redistributed freely. The fonts, including any derivative works, can be +bundled, embedded, and redistributed provided the terms of this licence +are met. The fonts and derivatives, however, cannot be released under +any other licence. The requirement for fonts to remain under this +licence does not require any document created using the fonts or their +derivatives to be published under this licence, as long as the primary +purpose of the document is not to be a vehicle for the distribution of +the fonts. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this licence and clearly marked as such. This may +include source files, build scripts and documentation. + +"Original Version" refers to the collection of Font Software components +as received under this licence. + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to +a new environment. + +"Copyright Holder(s)" refers to all individuals and companies who have a +copyright ownership of the Font Software. + +"Substantially Changed" refers to Modified Versions which can be easily +identified as dissimilar to the Font Software by users of the Font +Software comparing the Original Version with the Modified Version. + +To "Propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification and with or without charging +a redistribution fee), making available to the public, and in some +countries other activities as well. + +PERMISSION & CONDITIONS +This licence does not grant any rights under trademark law and all such +rights are reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of the Font Software, to propagate the Font Software, subject to +the below conditions: + +1) Each copy of the Font Software must contain the above copyright +notice and this licence. These can be included either as stand-alone +text files, human-readable headers or in the appropriate machine- +readable metadata fields within text or binary files as long as those +fields can be easily viewed by the user. + +2) The font name complies with the following: +(a) The Original Version must retain its name, unmodified. +(b) Modified Versions which are Substantially Changed must be renamed to +avoid use of the name of the Original Version or similar names entirely. +(c) Modified Versions which are not Substantially Changed must be +renamed to both (i) retain the name of the Original Version and (ii) add +additional naming elements to distinguish the Modified Version from the +Original Version. The name of such Modified Versions must be the name of +the Original Version, with "derivative X" where X represents the name of +the new work, appended to that name. + +3) The name(s) of the Copyright Holder(s) and any contributor to the +Font Software shall not be used to promote, endorse or advertise any +Modified Version, except (i) as required by this licence, (ii) to +acknowledge the contribution(s) of the Copyright Holder(s) or (iii) with +their explicit written permission. + +4) The Font Software, modified or unmodified, in part or in whole, must +be distributed entirely under this licence, and must not be distributed +under any other licence. The requirement for fonts to remain under this +licence does not affect any document created using the Font Software, +except any version of the Font Software extracted from a document +created using the Font Software may only be distributed under this +licence. + +TERMINATION +This licence becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF +COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER +DEALINGS IN THE FONT SOFTWARE. diff --git a/media/fonts/doc/Ubuntu/README.txt b/media/fonts/doc/Ubuntu/README.txt new file mode 100644 index 00000000000..292d4ade693 --- /dev/null +++ b/media/fonts/doc/Ubuntu/README.txt @@ -0,0 +1,15 @@ + ---------------------- + Ubuntu Font Family + ====================== + +The Ubuntu Font Family are a set of matching new libre/open fonts in +development during 2010--2011. The development is being funded by +Canonical Ltd on behalf the wider Free Software community and the +Ubuntu project. The technical font design work and implementation is +being undertaken by Dalton Maag. + +Both the final font Truetype/OpenType files and the design files used +to produce the font family are distributed under an open licence and +you are expressly encouraged to experiment, modify, share and improve. + + http://font.ubuntu.com/ diff --git a/media/fonts/doc/Ubuntu/TRADEMARKS.txt b/media/fonts/doc/Ubuntu/TRADEMARKS.txt new file mode 100644 index 00000000000..d34265bc853 --- /dev/null +++ b/media/fonts/doc/Ubuntu/TRADEMARKS.txt @@ -0,0 +1,4 @@ +Ubuntu and Canonical are registered trademarks of Canonical Ltd. + +The licence accompanying these works does not grant any rights +under trademark law and all such rights are reserved. diff --git a/media/fonts/doc/Ubuntu/copyright.txt b/media/fonts/doc/Ubuntu/copyright.txt new file mode 100644 index 00000000000..77340703a42 --- /dev/null +++ b/media/fonts/doc/Ubuntu/copyright.txt @@ -0,0 +1,5 @@ +Copyright 2010,2011 Canonical Ltd. + +This Font Software is licensed under the Ubuntu Font Licence, Version +1.0. https://launchpad.net/ubuntu-font-licence + diff --git a/media/inf/NET_NIC.inf b/media/inf/NET_NIC.inf index 0b21b832069..614c28e44af 100644 Binary files a/media/inf/NET_NIC.inf and b/media/inf/NET_NIC.inf differ diff --git a/media/inf/bth.inf b/media/inf/bth.inf index bff8acc1da9..6f76a2c0998 100644 Binary files a/media/inf/bth.inf and b/media/inf/bth.inf differ diff --git a/media/inf/c_image.inf b/media/inf/c_image.inf index 0d6ba858e26..d009d535d6b 100644 Binary files a/media/inf/c_image.inf and b/media/inf/c_image.inf differ diff --git a/media/inf/flpydisk.inf b/media/inf/flpydisk.inf index a6e0177e440..57e665bc1cb 100644 Binary files a/media/inf/flpydisk.inf and b/media/inf/flpydisk.inf differ diff --git a/media/inf/keyboard.inf b/media/inf/keyboard.inf index 8fe2e0b3f89..afc54cc2ff8 100644 Binary files a/media/inf/keyboard.inf and b/media/inf/keyboard.inf differ diff --git a/media/inf/monitor.inf b/media/inf/monitor.inf index 4415a116376..d7997607c45 100644 Binary files a/media/inf/monitor.inf and b/media/inf/monitor.inf differ diff --git a/media/inf/unknown.inf b/media/inf/unknown.inf index 9bc33cedfe5..e330dc82180 100644 Binary files a/media/inf/unknown.inf and b/media/inf/unknown.inf differ diff --git a/media/themes/lautus.msstyles/textfiles/ExtraLargeNormal.INI b/media/themes/lautus.msstyles/textfiles/ExtraLargeNormal.INI index 493f982ffff..6b19e6e1429 100644 Binary files a/media/themes/lautus.msstyles/textfiles/ExtraLargeNormal.INI and b/media/themes/lautus.msstyles/textfiles/ExtraLargeNormal.INI differ diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index 2eda3458e1b..22e0cfc6886 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -1,6 +1,4 @@ -if(NOT ARCH STREQUAL "amd64") - if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/rostests/) add_subdirectory(rostests) endif() @@ -12,5 +10,3 @@ endif() if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/wallpaper/) add_subdirectory(wallpaper) endif() - -endif() diff --git a/ntoskrnl/cache/section/data.c b/ntoskrnl/cache/section/data.c index 0156ec69306..63219199558 100644 --- a/ntoskrnl/cache/section/data.c +++ b/ntoskrnl/cache/section/data.c @@ -636,7 +636,8 @@ _MiMapViewOfSegment(PMMSUPPORT AddressSpace, &MArea, FALSE, AllocationType, - PAGE_SIZE); + *BaseAddress ? + PAGE_SIZE : MM_ALLOCATION_GRANULARITY); if (!NT_SUCCESS(Status)) { diff --git a/ntoskrnl/config/cmapi.c b/ntoskrnl/config/cmapi.c index ed2eda03410..a75f0286e18 100644 --- a/ntoskrnl/config/cmapi.c +++ b/ntoskrnl/config/cmapi.c @@ -5,6 +5,7 @@ * PURPOSE: Configuration Manager - Internal Registry APIs * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) * Eric Kohl + * Aleksandar Andrejevic */ /* INCLUDES ******************************************************************/ @@ -2120,3 +2121,234 @@ CmCountOpenSubKeys(IN PCM_KEY_CONTROL_BLOCK RootKcb, return SubKeys; } + +HCELL_INDEX +NTAPI +CmpCopyCell(IN PHHIVE SourceHive, + IN HCELL_INDEX SourceCell, + IN PHHIVE DestinationHive, + IN HSTORAGE_TYPE StorageType) +{ + PCELL_DATA SourceData; + PCELL_DATA DestinationData = NULL; + HCELL_INDEX DestinationCell = HCELL_NIL; + LONG DataSize; + PAGED_CODE(); + + /* Get the data and the size of the source cell */ + SourceData = HvGetCell(SourceHive, SourceCell); + DataSize = HvGetCellSize(SourceHive, SourceData); + + /* Allocate a new cell in the destination hive */ + DestinationCell = HvAllocateCell(DestinationHive, + DataSize, + StorageType, + HCELL_NIL); + if (DestinationCell == HCELL_NIL) goto Cleanup; + + /* Get the data of the destination cell */ + DestinationData = HvGetCell(DestinationHive, DestinationCell); + + /* Copy the data from the source cell to the destination cell */ + RtlMoveMemory(DestinationData, SourceData, DataSize); + +Cleanup: + + /* Release the cells */ + if (SourceData) HvReleaseCell(SourceHive, SourceCell); + if (DestinationData) HvReleaseCell(DestinationHive, DestinationCell); + + /* Return the destination cell index */ + return DestinationCell; +} + +static +NTSTATUS +NTAPI +CmpDeepCopyKeyInternal(IN PHHIVE SourceHive, + IN HCELL_INDEX SrcKeyCell, + IN PHHIVE DestinationHive, + IN HCELL_INDEX Parent, + IN HSTORAGE_TYPE StorageType, + OUT PHCELL_INDEX DestKeyCell OPTIONAL) +{ + NTSTATUS Status; + PCM_KEY_NODE SrcNode, DestNode; + HCELL_INDEX NewKeyCell, SubKey, NewSubKey; + ULONG Index, SubKeyCount; + PAGED_CODE(); + + DPRINT("CmpDeepCopyKeyInternal(0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X)\n", + SourceHive, + SrcKeyCell, + DestinationHive, + Parent, + StorageType, + DestKeyCell); + + /* Get the source cell node */ + SrcNode = HvGetCell(SourceHive, SrcKeyCell); + + /* Sanity check */ + ASSERT(SrcNode->Signature == CM_KEY_NODE_SIGNATURE); + + /* Create a simple copy of the source key */ + NewKeyCell = CmpCopyCell(SourceHive, + SrcKeyCell, + DestinationHive, + StorageType); + if (NewKeyCell == HCELL_NIL) + { + /* Not enough storage space */ + Status = STATUS_INSUFFICIENT_RESOURCES; + goto Cleanup; + } + + /* Get the destination cell node */ + DestNode = HvGetCell(DestinationHive, NewKeyCell); + + /* Set the parent */ + DestNode->Parent = Parent; + + // TODO: These should also be copied! + DestNode->Security = DestNode->Class = HCELL_NIL; + + /* Copy the value list */ + Status = CmpCopyKeyValueList(SourceHive, + &SrcNode->ValueList, + DestinationHive, + &DestNode->ValueList, + StorageType); + if (!NT_SUCCESS(Status)) goto Cleanup; + + /* Clear the invalid subkey index */ + DestNode->SubKeyCounts[Stable] = DestNode->SubKeyCounts[Volatile] = 0; + DestNode->SubKeyLists[Stable] = DestNode->SubKeyLists[Volatile] = HCELL_NIL; + + /* Calculate the total number of subkeys */ + SubKeyCount = SrcNode->SubKeyCounts[Stable] + SrcNode->SubKeyCounts[Volatile]; + + /* Loop through all the subkeys */ + for (Index = 0; Index < SubKeyCount; Index++) + { + /* Get the subkey */ + SubKey = CmpFindSubKeyByNumber(SourceHive, SrcNode, Index); + ASSERT(SubKey != HCELL_NIL); + + /* Call the function recursively for the subkey */ + Status = CmpDeepCopyKeyInternal(SourceHive, + SubKey, + DestinationHive, + NewKeyCell, + StorageType, + &NewSubKey); + if (!NT_SUCCESS(Status)) goto Cleanup; + + /* Add the copy of the subkey to the new key */ + if (!CmpAddSubKey(DestinationHive, + NewKeyCell, + NewSubKey)) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto Cleanup; + } + } + + /* Set the cell index if requested and return success */ + if (DestKeyCell) *DestKeyCell = NewKeyCell; + Status = STATUS_SUCCESS; + +Cleanup: + + /* Release the cells */ + if (SrcNode) HvReleaseCell(SourceHive, SrcKeyCell); + if (DestNode) HvReleaseCell(DestinationHive, NewKeyCell); + + return Status; +} + +NTSTATUS +NTAPI +CmpDeepCopyKey(IN PHHIVE SourceHive, + IN HCELL_INDEX SrcKeyCell, + IN PHHIVE DestinationHive, + IN HSTORAGE_TYPE StorageType, + OUT PHCELL_INDEX DestKeyCell OPTIONAL) +{ + /* Call the internal function */ + return CmpDeepCopyKeyInternal(SourceHive, + SrcKeyCell, + DestinationHive, + HCELL_NIL, + StorageType, + DestKeyCell); +} + +NTSTATUS +NTAPI +CmSaveKey(IN PCM_KEY_CONTROL_BLOCK Kcb, + IN HANDLE FileHandle, + IN ULONG Flags) +{ + NTSTATUS Status = STATUS_SUCCESS; + PCMHIVE KeyHive = NULL; + PAGED_CODE(); + + DPRINT("CmSaveKey(0x%08X, 0x%08X, %lu)\n", Kcb, FileHandle, Flags); + + /* Lock the registry and KCB */ + CmpLockRegistry(); + CmpAcquireKcbLockShared(Kcb); + + if (Kcb->Delete) + { + /* The source key has been deleted, do nothing */ + Status = STATUS_KEY_DELETED; + goto Cleanup; + } + + if (Kcb->KeyHive == &CmiVolatileHive->Hive) + { + /* Keys that are directly in the master hive can't be saved */ + Status = STATUS_ACCESS_DENIED; + goto Cleanup; + } + + /* Create a new hive that will hold the key */ + Status = CmpInitializeHive(&KeyHive, + HINIT_CREATE, + HIVE_VOLATILE, + HFILE_TYPE_PRIMARY, + NULL, + NULL, + NULL, + NULL, + NULL, + 0); + if (!NT_SUCCESS(Status)) goto Cleanup; + + /* Copy the key recursively into the new hive */ + Status = CmpDeepCopyKey(Kcb->KeyHive, + Kcb->KeyCell, + &KeyHive->Hive, + Stable, + &KeyHive->Hive.BaseBlock->RootCell); + if (!NT_SUCCESS(Status)) goto Cleanup; + + /* Set the primary handle of the hive */ + KeyHive->FileHandles[HFILE_TYPE_PRIMARY] = FileHandle; + + /* Dump the hive into the file */ + HvWriteHive(&KeyHive->Hive); + +Cleanup: + + /* Free the hive */ + if (KeyHive) CmpDestroyHive(KeyHive); + + /* Release the locks */ + CmpReleaseKcbLock(Kcb); + CmpUnlockRegistry(); + + return Status; +} diff --git a/ntoskrnl/config/cmcheck.c b/ntoskrnl/config/cmcheck.c index d166ff48d60..4172dddc332 100644 --- a/ntoskrnl/config/cmcheck.c +++ b/ntoskrnl/config/cmcheck.c @@ -22,5 +22,6 @@ CmCheckRegistry(IN PCMHIVE RegistryHive, IN ULONG Flags) { /* FIXME: HACK! */ + DPRINT1("CmCheckRegistry(0x%p, %lu) is UNIMPLEMENTED!\n", RegistryHive, Flags); return 0; } diff --git a/ntoskrnl/config/cminit.c b/ntoskrnl/config/cminit.c index 897e58460ce..147ba73d993 100644 --- a/ntoskrnl/config/cminit.c +++ b/ntoskrnl/config/cminit.c @@ -214,7 +214,8 @@ CmpInitializeHive(OUT PCMHIVE *RegistryHive, (OperationType == HINIT_MAPFILE)) { /* Verify integrity */ - if (CmCheckRegistry((PCMHIVE)Hive, TRUE)) + ULONG CheckStatus = CmCheckRegistry(Hive, CheckFlags); + if (CheckStatus != 0) { /* Cleanup allocations and fail */ ExFreePoolWithTag(Hive->FlusherLock, TAG_CM); @@ -238,6 +239,28 @@ CmpInitializeHive(OUT PCMHIVE *RegistryHive, return STATUS_SUCCESS; } +NTSTATUS +NTAPI +CmpDestroyHive(IN PCMHIVE CmHive) +{ + /* Remove the hive from the list */ + ExAcquirePushLockExclusive(&CmpHiveListHeadLock); + RemoveEntryList(&CmHive->HiveList); + ExReleasePushLock(&CmpHiveListHeadLock); + + /* Delete the flusher lock */ + ExDeleteResourceLite(CmHive->FlusherLock); + ExFreePoolWithTag(CmHive->FlusherLock, TAG_CM); + + /* Delete the view lock */ + ExFreePoolWithTag(CmHive->ViewLock, TAG_CM); + + /* Free the hive */ + HvFree(&CmHive->Hive); + + return STATUS_SUCCESS; +} + NTSTATUS NTAPI CmpOpenHiveFiles(IN PCUNICODE_STRING BaseName, diff --git a/ntoskrnl/config/cmkcbncb.c b/ntoskrnl/config/cmkcbncb.c index 77e4e83312b..199102264a0 100644 --- a/ntoskrnl/config/cmkcbncb.c +++ b/ntoskrnl/config/cmkcbncb.c @@ -1164,7 +1164,7 @@ CmpFlushNotifiesOnKeyBodyList(IN PCM_KEY_CONTROL_BLOCK Kcb, { /* Get the key body */ KeyBody = CONTAINING_RECORD(NextEntry, CM_KEY_BODY, KeyBodyList); - ASSERT(KeyBody->Type == '20yk'); + ASSERT(KeyBody->Type == CM_KEY_BODY_TYPE); /* Check for notifications */ if (KeyBody->NotifyBlock) diff --git a/ntoskrnl/config/cmparse.c b/ntoskrnl/config/cmparse.c index acf5e2416fe..67e2f3b2408 100644 --- a/ntoskrnl/config/cmparse.c +++ b/ntoskrnl/config/cmparse.c @@ -286,7 +286,7 @@ CmpDoCreateChild(IN PHHIVE Hive, /* Setup the key body */ KeyBody = (PCM_KEY_BODY)(*Object); - KeyBody->Type = '20yk'; + KeyBody->Type = CM_KEY_BODY_TYPE; KeyBody->KeyControlBlock = NULL; /* Check if we had a class */ @@ -691,7 +691,7 @@ CmpDoOpen(IN PHHIVE Hive, /* Get the key body and fill it out */ KeyBody = (PCM_KEY_BODY)(*Object); KeyBody->KeyControlBlock = Kcb; - KeyBody->Type = '20yk'; + KeyBody->Type = CM_KEY_BODY_TYPE; KeyBody->ProcessID = PsGetCurrentProcessId(); KeyBody->NotifyBlock = NULL; diff --git a/ntoskrnl/config/cmsysini.c b/ntoskrnl/config/cmsysini.c index 45242d28388..f41d27b042c 100644 --- a/ntoskrnl/config/cmsysini.c +++ b/ntoskrnl/config/cmsysini.c @@ -129,7 +129,7 @@ CmpDeleteKeyObject(PVOID DeletedObject) CmpLockRegistry(); /* Make sure this is a valid key body */ - if (KeyBody->Type == '20yk') + if (KeyBody->Type == CM_KEY_BODY_TYPE) { /* Get the KCB */ Kcb = KeyBody->KeyControlBlock; @@ -166,7 +166,7 @@ CmpCloseKeyObject(IN PEPROCESS Process OPTIONAL, if (SystemHandleCount > 1) return; /* Make sure we're a valid key body */ - if (KeyBody->Type == '20yk') + if (KeyBody->Type == CM_KEY_BODY_TYPE) { /* Don't do anything if we don't have a notify block */ if (!KeyBody->NotifyBlock) return; @@ -358,7 +358,7 @@ CmpInitHiveFromFile(IN PCUNICODE_STRING HiveName, LogHandle, NULL, HiveName, - 0); + CheckFlags); if (!NT_SUCCESS(Status)) { /* Fail */ @@ -370,7 +370,7 @@ CmpInitHiveFromFile(IN PCUNICODE_STRING HiveName, /* Success, return hive */ *Hive = NewHive; - /* ROS: Init root key cell and prepare the hive */ + /* HACK: ROS: Init root key cell and prepare the hive */ if (Operation == HINIT_CREATE) CmCreateRootNode(&NewHive->Hive, L""); /* Duplicate the hive name */ @@ -1052,11 +1052,15 @@ CmpCreateRegistryRoot(VOID) NULL, 0, &KeyName); - if (!Kcb) return FALSE; + if (!Kcb) + { + ObDereferenceObject(RootKey); + return FALSE; + } /* Initialize the object */ RootKey->KeyControlBlock = Kcb; - RootKey->Type = '20yk'; + RootKey->Type = CM_KEY_BODY_TYPE; RootKey->NotifyBlock = NULL; RootKey->ProcessID = PsGetCurrentProcessId(); @@ -1070,7 +1074,11 @@ CmpCreateRegistryRoot(VOID) 0, NULL, &CmpRegistryRootHandle); - if (!NT_SUCCESS(Status)) return FALSE; + if (!NT_SUCCESS(Status)) + { + ObDereferenceObject(RootKey); + return FALSE; + } /* Reference the key again so that we never lose it */ Status = ObReferenceObjectByHandle(CmpRegistryRootHandle, @@ -1079,7 +1087,11 @@ CmpCreateRegistryRoot(VOID) KernelMode, (PVOID*)&RootKey, NULL); - if (!NT_SUCCESS(Status)) return FALSE; + if (!NT_SUCCESS(Status)) + { + ObDereferenceObject(RootKey); + return FALSE; + } /* Completely sucessful */ return TRUE; diff --git a/ntoskrnl/config/cmvalue.c b/ntoskrnl/config/cmvalue.c index 0c401e67863..30fd6229127 100644 --- a/ntoskrnl/config/cmvalue.c +++ b/ntoskrnl/config/cmvalue.c @@ -361,3 +361,62 @@ CmpRemoveValueFromList(IN PHHIVE Hive, ChildList->Count = Count; return STATUS_SUCCESS; } + +NTSTATUS +NTAPI +CmpCopyKeyValueList(IN PHHIVE SourceHive, + IN PCHILD_LIST SrcValueList, + IN PHHIVE DestinationHive, + IN OUT PCHILD_LIST DestValueList, + IN HSTORAGE_TYPE StorageType) + +{ + NTSTATUS Status = STATUS_SUCCESS; + HCELL_INDEX CellIndex = HCELL_NIL; + ULONG Index; + PCELL_DATA SrcListData = NULL; + PCELL_DATA DestListData = NULL; + + PAGED_CODE(); + + /* Set the count */ + DestValueList->Count = SrcValueList->Count; + + /* Check if the list is empty */ + if (!DestValueList->Count) + { + DestValueList->List = HCELL_NIL; + return STATUS_SUCCESS; + } + + /* Create a simple copy of the list */ + CellIndex = CmpCopyCell(SourceHive, + SrcValueList->List, + DestinationHive, + StorageType); + if (CellIndex == HCELL_NIL) return STATUS_INSUFFICIENT_RESOURCES; + + /* Get the source and the destination value list */ + SrcListData = HvGetCell(SourceHive, SrcValueList->List); + DestListData = HvGetCell(DestinationHive, CellIndex); + + /* Copy the actual values */ + for (Index = 0; Index < SrcValueList->Count; Index++) + { + DestListData->u.KeyList[Index] = CmpCopyCell(SourceHive, + SrcListData->u.KeyList[Index], + DestinationHive, + StorageType); + if (DestListData->u.KeyList[Index] == HCELL_NIL) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + break; + } + } + + /* Release the cells */ + if (SrcListData) HvReleaseCell(SourceHive, SrcValueList->List); + if (DestListData) HvReleaseCell(DestinationHive, CellIndex); + + return Status; +} diff --git a/ntoskrnl/config/ntapi.c b/ntoskrnl/config/ntapi.c index fe72872388b..b3bf0ece98d 100644 --- a/ntoskrnl/config/ntapi.c +++ b/ntoskrnl/config/ntapi.c @@ -1148,8 +1148,8 @@ NTAPI NtSaveKey(IN HANDLE KeyHandle, IN HANDLE FileHandle) { - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; + /* Call the extended API */ + return NtSaveKeyEx(KeyHandle, FileHandle, REG_STANDARD_FORMAT); } NTSTATUS @@ -1158,8 +1158,43 @@ NtSaveKeyEx(IN HANDLE KeyHandle, IN HANDLE FileHandle, IN ULONG Flags) { - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; + NTSTATUS Status; + PCM_KEY_BODY KeyObject; + KPROCESSOR_MODE PreviousMode = ExGetPreviousMode(); + + PAGED_CODE(); + + DPRINT("NtSaveKeyEx(0x%08X, 0x%08X, %lu)\n", KeyHandle, FileHandle, Flags); + + /* Verify the flags */ + if ((Flags != REG_STANDARD_FORMAT) + && (Flags != REG_LATEST_FORMAT) + && (Flags != REG_NO_COMPRESSION)) + { + /* Only one of these values can be specified */ + return STATUS_INVALID_PARAMETER; + } + + /* Check for the SeBackupPrivilege */ + if (!SeSinglePrivilegeCheck(SeBackupPrivilege, PreviousMode)) + { + return STATUS_PRIVILEGE_NOT_HELD; + } + + /* Verify that the handle is valid and is a registry key */ + Status = ObReferenceObjectByHandle(KeyHandle, + KEY_READ, + CmpKeyObjectType, + PreviousMode, + (PVOID*)&KeyObject, + NULL); + if (!NT_SUCCESS(Status)) return Status; + + /* Call the internal API */ + Status = CmSaveKey(KeyObject->KeyControlBlock, FileHandle, Flags); + + ObDereferenceObject(KeyObject); + return Status; } NTSTATUS diff --git a/ntoskrnl/ex/init.c b/ntoskrnl/ex/init.c index 1d5b644247f..04f8e785d10 100644 --- a/ntoskrnl/ex/init.c +++ b/ntoskrnl/ex/init.c @@ -846,7 +846,7 @@ ExpLoadBootSymbols(IN PLOADER_PARAMETER_BLOCK LoaderBlock) /* Load the symbols */ DbgLoadImageSymbols(&SymbolString, LdrEntry->DllBase, - (ULONG_PTR)ZwCurrentProcess()); + (ULONG_PTR)PsGetCurrentProcessId()); } } diff --git a/ntoskrnl/include/internal/arm/ksarm.h b/ntoskrnl/include/internal/arm/ksarm.h deleted file mode 100644 index 91adf08672e..00000000000 --- a/ntoskrnl/include/internal/arm/ksarm.h +++ /dev/null @@ -1,146 +0,0 @@ -/* - * PROJECT: ReactOS Kernel - * LICENSE: BSD - See COPYING.ARM in the top level directory - * FILE: ntoskrnl/include/internal/arm/ksarm.h - * PURPOSE: Definitions and offsets for ARM Assembly and C code - * PROGRAMMERS: ReactOS Portable Systems Group - */ - -#ifdef _ASM_ - -/* - * CPSR Values - */ -.equ CPSR_THUMB_ENABLE, 0x20 -.equ CPSR_FIQ_DISABLE, 0x40 -.equ CPSR_IRQ_DISABLE, 0x80 -.equ CPSR_USER_MODE, 0x10 -.equ CPSR_FIQ_MODE, 0x11 -.equ CPSR_IRQ_MODE, 0x12 -.equ CPSR_SVC_MODE, 0x13 -.equ CPSR_ABORT_MODE, 0x17 -.equ CPSR_UND_MODE, 0x1B -.equ CPSR_MODES, 0x1F - - -/* - * C1 Register Values - */ -.equ C1_MMU_CONTROL, 0x01 -.equ C1_ALIGNMENT_CONTROL, 0x02 -.equ C1_DCACHE_CONTROL, 0x04 -.equ C1_ICACHE_CONTROL, 0x1000 -.equ C1_VECTOR_CONTROL, 0x2000 - -/* - * Loader Parameter Block Offsets - */ -.equ LpbKernelStack, 0x18 -.equ LpbPanicStack, 0x74 -.equ LpbInterruptStack, 0x5C - -/* - * Trap Frame offsets - */ -.equ TrDbgArgMark, 0x00 -.equ TrR0, 0x04 -.equ TrR1, 0x08 -.equ TrR2, 0x0C -.equ TrR3, 0x10 -.equ TrR4, 0x14 -.equ TrR5, 0x18 -.equ TrR6, 0x1C -.equ TrR7, 0x20 -.equ TrR8, 0x24 -.equ TrR9, 0x28 -.equ TrR10, 0x2C -.equ TrR11, 0x30 -.equ TrR12, 0x34 -.equ TrUserSp, 0x38 -.equ TrUserLr, 0x3C -.equ TrSvcSp, 0x40 -.equ TrSvcLr, 0x44 -.equ TrPc, 0x48 -.equ TrSpsr, 0x4C -.equ TrapFrameLength, (23 * 0x04) - -/* - * Exception Frame offsets - */ -.equ ExR4, 0x00 -.equ ExR5, 0x04 -.equ ExR6, 0x08 -.equ ExR7, 0x0C -.equ ExR8, 0x10 -.equ ExR9, 0x14 -.equ ExR10, 0x18 -.equ ExR11, 0x1C -.equ ExLr, 0x20 -.equ ExSpsr, 0x24 -.equ ExceptionFrameLength, (10 * 0x04) - -/* - * PCR - */ -.equ KiPcr, 0xFFFFF000 - -/* - * PCR Offsets - */ -.equ PcCurrentIrql, 0x14C - -/* - * KTHREAD Offsets - */ -.equ ThKernelStack, 0x20 - -/* - * CONTEXT Offsets - */ -.equ CONTEXT_FULL, 0x43 -.equ CsContextFlags, 0x00 -.equ CsR0, 0x04 -.equ CsR1, 0x08 -.equ CsR2, 0x0C -.equ CsR3, 0x10 -.equ CsR4, 0x14 -.equ CsR5, 0x18 -.equ CsR6, 0x1C -.equ CsR7, 0x20 -.equ CsR8, 0x24 -.equ CsR9, 0x28 -.equ CsR10, 0x2C -.equ CsR11, 0x30 -.equ CsR12, 0x34 -.equ CsSp, 0x38 -.equ CsLr, 0x3C -.equ CsPc, 0x40 -.equ CsPsr, 0x44 - -/* - * DebugService Control Types - */ -.equ BREAKPOINT_BREAK, 0 -.equ BREAKPOINT_PRINT, 1 -.equ BREAKPOINT_PROMPT, 2 -.equ BREAKPOINT_LOAD_SYMBOLS, 3 -.equ BREAKPOINT_UNLOAD_SYMBOLS, 4 -.equ BREAKPOINT_COMMAND_STRING, 5 - -#else - -/* - * CPSR Values - */ -#define CPSR_THUMB_ENABLE 0x20 -#define CPSR_FIQ_DISABLE 0x40 -#define CPSR_IRQ_DISABLE 0x80 -#define CPSR_USER_MODE 0x10 -#define CPSR_FIQ_MODE 0x11 -#define CPSR_IRQ_MODE 0x12 -#define CPSR_SVC_MODE 0x13 -#define CPSR_ABORT_MODE 0x17 -#define CPSR_UND_MODE 0x1B -#define CPSR_MODES 0x1F - -#endif diff --git a/ntoskrnl/include/internal/cm.h b/ntoskrnl/include/internal/cm.h index d34f5b32bb2..90c6fd15ac5 100644 --- a/ntoskrnl/include/internal/cm.h +++ b/ntoskrnl/include/internal/cm.h @@ -60,6 +60,11 @@ #define CM_KCB_INVALID_CACHED_INFO 0x40 #define CM_KCB_READ_ONLY_KEY 0x80 +// +// CM_KEY_BODY Types +// +#define CM_KEY_BODY_TYPE 0x6B793032 + // // CM_KEY_VALUE Types // @@ -786,6 +791,12 @@ CmpInitializeHive( IN ULONG CheckFlags ); +NTSTATUS +NTAPI +CmpDestroyHive( + IN PCMHIVE CmHive +); + PSECURITY_DESCRIPTOR NTAPI CmpHiveRootSecurityDescriptor( @@ -1322,6 +1333,16 @@ CmpGetValueData( OUT PHCELL_INDEX CellToRelease ); +NTSTATUS +NTAPI +CmpCopyKeyValueList( + IN PHHIVE SourceHive, + IN PCHILD_LIST SrcValueList, + IN PHHIVE DestinationHive, + IN OUT PCHILD_LIST DestValueList, + IN HSTORAGE_TYPE StorageType +); + // // Boot Routines // @@ -1527,6 +1548,33 @@ CmCountOpenSubKeys( IN BOOLEAN RemoveEmptyCacheEntries ); +HCELL_INDEX +NTAPI +CmpCopyCell( + IN PHHIVE SourceHive, + IN HCELL_INDEX SourceCell, + IN PHHIVE DestinationHive, + IN HSTORAGE_TYPE StorageType +); + +NTSTATUS +NTAPI +CmpDeepCopyKey( + IN PHHIVE SourceHive, + IN HCELL_INDEX SrcKeyCell, + IN PHHIVE DestinationHive, + IN HSTORAGE_TYPE StorageType, + OUT PHCELL_INDEX DestKeyCell OPTIONAL +); + +NTSTATUS +NTAPI +CmSaveKey( + IN PCM_KEY_CONTROL_BLOCK Kcb, + IN HANDLE FileHandle, + IN ULONG Flags +); + // // Startup and Shutdown // diff --git a/ntoskrnl/include/internal/i386/asmmacro.S b/ntoskrnl/include/internal/i386/asmmacro.S index 2ab3bdfd6ff..4a6b009d5fc 100644 --- a/ntoskrnl/include/internal/i386/asmmacro.S +++ b/ntoskrnl/include/internal/i386/asmmacro.S @@ -83,7 +83,7 @@ MACRO(KiEnterTrap, Flags) if (Flags AND KI_FAST_SYSTEM_CALL) /* SYSENTER requires us to build a complete ring transition trap frame */ - FrameSize = KTRAP_FRAME_V86_ES + FrameSize = KTRAP_FRAME_EIP /* Fixup fs. cx is free to clobber */ mov cx, KGDT_R0_PCR @@ -95,6 +95,13 @@ MACRO(KiEnterTrap, Flags) /* Get a stack pointer */ mov esp, [ecx + KTSS_ESP0] + /* Set up a fake hardware trap frame */ + push KGDT_R3_DATA or RPL_MASK + push edx + pushfd + push KGDT_R3_CODE or RPL_MASK + push dword ptr ds:[KUSER_SHARED_SYSCALL_RET] + elseif (Flags AND KI_SOFTWARE_TRAP) /* Software traps need a complete non-ring transition trap frame */ @@ -183,7 +190,19 @@ set_sane_segs: mov es, ax /* Fast system calls have fs already fixed */ - if (NOT (Flags AND KI_FAST_SYSTEM_CALL)) + if (Flags AND KI_FAST_SYSTEM_CALL) + + /* Enable interrupts and set a sane FS value */ + or dword ptr [esp + KTRAP_FRAME_EFLAGS], EFLAGS_INTERRUPT_MASK + mov dword ptr [esp + KTRAP_FRAME_FS], KGDT_R3_TEB or RPL_MASK + + /* Set sane active EFLAGS */ + push 2 + popfd + + /* Point edx to the usermode parameters */ + add edx, 8 + else /* Otherwise fix fs now */ mov ax, KGDT_R0_PCR mov fs, ax diff --git a/ntoskrnl/kd64/kdinit.c b/ntoskrnl/kd64/kdinit.c index 723a18ca323..18ea337ee36 100644 --- a/ntoskrnl/kd64/kdinit.c +++ b/ntoskrnl/kd64/kdinit.c @@ -356,7 +356,7 @@ KdInitSystem(IN ULONG BootPhase, RtlInitString(&ImageName, NameBuffer); DbgLoadImageSymbols(&ImageName, LdrEntry->DllBase, - (ULONG_PTR)ZwCurrentProcess()); + (ULONG_PTR)PsGetCurrentProcessId()); /* Go to the next entry */ NextEntry = NextEntry->Flink; diff --git a/ntoskrnl/ke/i386/cpu.c b/ntoskrnl/ke/i386/cpu.c index 2d741ab6144..09568113b65 100644 --- a/ntoskrnl/ke/i386/cpu.c +++ b/ntoskrnl/ke/i386/cpu.c @@ -1432,7 +1432,8 @@ KeSaveFloatingPointState(OUT PKFLOATING_SAVE Save) #else __asm { - fnsave [FpState] + mov eax, [FpState] + fnsave [eax] }; #endif @@ -1458,7 +1459,8 @@ KeRestoreFloatingPointState(IN PKFLOATING_SAVE Save) __asm { fnclex - frstor [FpState] + mov eax, [FpState] + frstor [eax] }; #endif diff --git a/ntoskrnl/ke/i386/trap.s b/ntoskrnl/ke/i386/trap.s index 272886d4891..733451d7db3 100644 --- a/ntoskrnl/ke/i386/trap.s +++ b/ntoskrnl/ke/i386/trap.s @@ -142,14 +142,20 @@ PUBLIC _KiSystemService KiCallHandler @KiSystemServiceHandler@8 .ENDP -EXTERN @KiFastCallEntryHandler@8:PROC PUBLIC _KiFastCallEntry .PROC _KiFastCallEntry FPO 0, 0, 0, 0, 1, FRAME_TRAP KiEnterTrap (KI_FAST_SYSTEM_CALL OR KI_NONVOLATILES_ONLY OR KI_DONT_SAVE_SEGS) - KiCallHandler @KiFastCallEntryHandler@8 + KiCallHandler @KiSystemServiceHandler@8 .ENDP +PUBLIC _KiFastCallEntryWithSingleStep +.PROC _KiFastCallEntryWithSingleStep + FPO 0, 0, 0, 0, 1, FRAME_TRAP + KiEnterTrap (KI_FAST_SYSTEM_CALL OR KI_NONVOLATILES_ONLY OR KI_DONT_SAVE_SEGS) + or dword ptr [ecx + KTRAP_FRAME_EFLAGS], EFLAGS_TF + KiCallHandler @KiSystemServiceHandler@8 +.ENDP PUBLIC _KiEndUnexpectedRange@0 _KiEndUnexpectedRange@0: diff --git a/ntoskrnl/ke/i386/traphdlr.c b/ntoskrnl/ke/i386/traphdlr.c index d98109a21ac..568c4892d42 100644 --- a/ntoskrnl/ke/i386/traphdlr.c +++ b/ntoskrnl/ke/i386/traphdlr.c @@ -12,6 +12,9 @@ #define NDEBUG #include +VOID KiFastCallEntry(VOID); +VOID KiFastCallEntryWithSingleStep(VOID); + /* GLOBALS ********************************************************************/ UCHAR KiTrapPrefixTable[] = @@ -417,13 +420,26 @@ KiTrap01Handler(IN PKTRAP_FRAME TrapFrame) { /* Save trap frame */ KiEnterTrap(TrapFrame); - + /* Check for VDM trap */ ASSERT((KiVdmTrap(TrapFrame)) == FALSE); + /* Check if this was a single step after sysenter */ + if (TrapFrame->Eip == (ULONG)KiFastCallEntry) + { + /* Disable single stepping */ + TrapFrame->EFlags &= ~EFLAGS_TF; + + /* Re-enter at the alternative sysenter entry point */ + TrapFrame->Eip = (ULONG)KiFastCallEntryWithSingleStep; + + /* End this trap */ + KiEoiHelper(TrapFrame); + } + /* Enable interrupts if the trap came from user-mode */ if (KiUserTrap(TrapFrame)) _enable(); - + /* Mask out trap flag and dispatch the exception */ TrapFrame->EFlags &= ~EFLAGS_TF; KiDispatchException0Args(STATUS_SINGLE_STEP, @@ -1521,11 +1537,11 @@ KiDbgPostServiceHook(ULONG SystemCallNumber, ULONG_PTR Result) return Result; } -FORCEINLINE DECLSPEC_NORETURN VOID -KiSystemCall(IN PKTRAP_FRAME TrapFrame, - IN PVOID Arguments) +FASTCALL +KiSystemServiceHandler(IN PKTRAP_FRAME TrapFrame, + IN PVOID Arguments) { PKTHREAD Thread; PKSERVICE_TABLE_DESCRIPTOR DescriptorTable; @@ -1658,38 +1674,6 @@ ExitCall: KiServiceExit(TrapFrame, Result); } -DECLSPEC_NORETURN -VOID -FASTCALL -KiSystemServiceHandler(IN PKTRAP_FRAME TrapFrame, - IN PVOID Arguments) -{ - /* Call the shared handler (inline) */ - KiSystemCall(TrapFrame, Arguments); -} - -DECLSPEC_NORETURN -VOID -FASTCALL -KiFastCallEntryHandler(IN PKTRAP_FRAME TrapFrame, - IN PVOID Arguments) -{ - /* Set up a fake INT Stack and enable interrupts */ - TrapFrame->HardwareSegSs = KGDT_R3_DATA | RPL_MASK; - TrapFrame->HardwareEsp = (ULONG_PTR)Arguments; - TrapFrame->EFlags = __readeflags() | EFLAGS_INTERRUPT_MASK; - TrapFrame->SegCs = KGDT_R3_CODE | RPL_MASK; - TrapFrame->Eip = SharedUserData->SystemCallReturn; - TrapFrame->SegFs = KGDT_R3_TEB | RPL_MASK; - __writeeflags(0x2); - - /* Arguments are actually 2 frames down (because of the double indirection) */ - Arguments = (PVOID)(TrapFrame->HardwareEsp + 8); - - /* Call the shared handler (inline) */ - KiSystemCall(TrapFrame, Arguments); -} - /* * @implemented */ diff --git a/ntoskrnl/lpc/complete.c b/ntoskrnl/lpc/complete.c index 5134757f269..0f9f7f27682 100644 --- a/ntoskrnl/lpc/complete.c +++ b/ntoskrnl/lpc/complete.c @@ -55,6 +55,8 @@ NtAcceptConnectPort(OUT PHANDLE PortHandle, PEPROCESS ClientProcess; PETHREAD ClientThread; LARGE_INTEGER SectionOffset; + CLIENT_ID ClientId; + ULONG MessageId; PAGED_CODE(); LPCTRACE(LPC_COMPLETE_DEBUG, "Context: %p. Message: %p. Accept: %lx. Views: %p/%p\n", @@ -64,22 +66,81 @@ NtAcceptConnectPort(OUT PHANDLE PortHandle, ClientView, ServerView); - /* Validate the size of the server view */ - if ((ServerView) && (ServerView->Length != sizeof(PORT_VIEW))) + /* Check if the call comes from user mode */ + if (PreviousMode != KernelMode) { - /* Invalid size */ - return STATUS_INVALID_PARAMETER; - } + /* Enter SEH for probing the parameters */ + _SEH2_TRY + { + ProbeForWriteHandle(PortHandle); - /* Validate the size of the client view */ - if ((ClientView) && (ClientView->Length != sizeof(REMOTE_PORT_VIEW))) + /* Probe the basic ReplyMessage structure */ + ProbeForRead(ReplyMessage, sizeof(PORT_MESSAGE), sizeof(ULONG)); + + /* Grab some values */ + ClientId = ReplyMessage->ClientId; + MessageId = ReplyMessage->MessageId; + ConnectionInfoLength = ReplyMessage->u1.s1.DataLength; + + /* Probe the connection info */ + ProbeForRead(ReplyMessage + 1, ConnectionInfoLength, 1); + + /* The following parameters are optional */ + if (ServerView != NULL) + { + ProbeForWrite(ServerView, sizeof(PORT_VIEW), sizeof(ULONG)); + + /* Validate the size of the server view */ + if (ServerView->Length != sizeof(PORT_VIEW)) + { + /* Invalid size */ + _SEH2_YIELD(return STATUS_INVALID_PARAMETER); + } + } + + if (ClientView != NULL) + { + ProbeForWrite(ClientView, sizeof(REMOTE_PORT_VIEW), sizeof(ULONG)); + + /* Validate the size of the client view */ + if (ClientView->Length != sizeof(REMOTE_PORT_VIEW)) + { + /* Invalid size */ + _SEH2_YIELD(return STATUS_INVALID_PARAMETER); + } + } + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + /* There was an exception, return the exception code */ + _SEH2_YIELD(return _SEH2_GetExceptionCode()); + } + _SEH2_END; + } + else { - /* Invalid size */ - return STATUS_INVALID_PARAMETER; + /* Grab some values */ + ClientId = ReplyMessage->ClientId; + MessageId = ReplyMessage->MessageId; + ConnectionInfoLength = ReplyMessage->u1.s1.DataLength; + + /* Validate the size of the server view */ + if ((ServerView) && (ServerView->Length != sizeof(PORT_VIEW))) + { + /* Invalid size */ + return STATUS_INVALID_PARAMETER; + } + + /* Validate the size of the client view */ + if ((ClientView) && (ClientView->Length != sizeof(REMOTE_PORT_VIEW))) + { + /* Invalid size */ + return STATUS_INVALID_PARAMETER; + } } /* Get the client process and thread */ - Status = PsLookupProcessThreadByCid(&ReplyMessage->ClientId, + Status = PsLookupProcessThreadByCid(&ClientId, &ClientProcess, &ClientThread); if (!NT_SUCCESS(Status)) return Status; @@ -89,8 +150,8 @@ NtAcceptConnectPort(OUT PHANDLE PortHandle, /* Make sure that the client wants a reply, and this is the right one */ if (!(LpcpGetMessageFromThread(ClientThread)) || - !(ReplyMessage->MessageId) || - (ClientThread->LpcReplyMessageId != ReplyMessage->MessageId)) + !(MessageId) || + (ClientThread->LpcReplyMessageId != MessageId)) { /* Not the reply asked for, or no reply wanted, fail */ KeReleaseGuardedMutex(&LpcpLock); @@ -125,8 +186,7 @@ NtAcceptConnectPort(OUT PHANDLE PortHandle, ConnectMessage->ClientPort = NULL; KeReleaseGuardedMutex(&LpcpLock); - /* Get the connection information length */ - ConnectionInfoLength = ReplyMessage->u1.s1.DataLength; + /* Check the connection information length */ if (ConnectionInfoLength > ConnectionPort->MaxConnectionInfoLength) { /* Normalize it since it's too large */ @@ -142,16 +202,26 @@ NtAcceptConnectPort(OUT PHANDLE PortHandle, /* Setup the reply message */ Message->Request.u2.s2.Type = LPC_REPLY; Message->Request.u2.s2.DataInfoOffset = 0; - Message->Request.ClientId = ReplyMessage->ClientId; - Message->Request.MessageId = ReplyMessage->MessageId; + Message->Request.ClientId = ClientId; + Message->Request.MessageId = MessageId; Message->Request.ClientViewSize = 0; - RtlCopyMemory(ConnectMessage + 1, ReplyMessage + 1, ConnectionInfoLength); + + _SEH2_TRY + { + RtlCopyMemory(ConnectMessage + 1, ReplyMessage + 1, ConnectionInfoLength); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + _SEH2_YIELD(goto Cleanup); + } + _SEH2_END; /* At this point, if the caller refused the connection, go to cleanup */ if (!AcceptConnection) { DPRINT1("LPC connection was refused\n"); - goto Cleanup; + goto Cleanup; } /* Otherwise, create the actual port */ @@ -259,16 +329,30 @@ NtAcceptConnectPort(OUT PHANDLE PortHandle, goto Cleanup; } - /* Check if the caller gave a client view */ - if (ClientView) + /* Enter SEH to write back the results */ + _SEH2_TRY { - /* Fill it out */ - ClientView->ViewBase = ConnectMessage->ClientView.ViewRemoteBase; - ClientView->ViewSize = ConnectMessage->ClientView.ViewSize; - } + /* Check if the caller gave a client view */ + if (ClientView) + { + /* Fill it out */ + ClientView->ViewBase = ConnectMessage->ClientView.ViewRemoteBase; + ClientView->ViewSize = ConnectMessage->ClientView.ViewSize; + } + + /* Return the handle to user mode */ + *PortHandle = Handle; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + /* Cleanup and return the exception code */ + ObCloseHandle(Handle, UserMode); + ObDereferenceObject(ServerPort); + Status = _SEH2_GetExceptionCode(); + _SEH2_YIELD(goto Cleanup); + } + _SEH2_END; - /* Return the handle to user mode */ - *PortHandle = Handle; LPCTRACE(LPC_COMPLETE_DEBUG, "Handle: %p. Messages: %p/%p. Ports: %p/%p/%p\n", Handle, diff --git a/ntoskrnl/lpc/create.c b/ntoskrnl/lpc/create.c index b4fb88589e9..10ab79023b9 100644 --- a/ntoskrnl/lpc/create.c +++ b/ntoskrnl/lpc/create.c @@ -49,9 +49,44 @@ LpcpCreatePort(OUT PHANDLE PortHandle, KPROCESSOR_MODE PreviousMode = KeGetPreviousMode(); NTSTATUS Status; PLPCP_PORT_OBJECT Port; + HANDLE Handle; + PUNICODE_STRING ObjectName; + BOOLEAN NoName; PAGED_CODE(); LPCTRACE(LPC_CREATE_DEBUG, "Name: %wZ\n", ObjectAttributes->ObjectName); + /* Check if the call comes from user mode */ + if (PreviousMode != KernelMode) + { + _SEH2_TRY + { + /* Probe the PortHandle */ + ProbeForWriteHandle(PortHandle); + + /* Probe the ObjectAttributes */ + ProbeForRead(ObjectAttributes, sizeof(OBJECT_ATTRIBUTES), sizeof(ULONG)); + + /* Get the object name and probe the unicode string */ + ObjectName = ObjectAttributes->ObjectName; + ProbeForRead(ObjectName, sizeof(UNICODE_STRING), 1); + + /* Check if we have no name */ + NoName = (ObjectName->Buffer == NULL) || (ObjectName->Length == 0); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + /* Return the exception code */ + _SEH2_YIELD(return _SEH2_GetExceptionCode()); + } + _SEH2_END; + } + else + { + /* Check if we have no name */ + NoName = (ObjectAttributes->ObjectName->Buffer == NULL) || + (ObjectAttributes->ObjectName->Length == 0); + } + /* Create the Object */ Status = ObCreateObject(PreviousMode, LpcPortObjectType, @@ -72,7 +107,7 @@ LpcpCreatePort(OUT PHANDLE PortHandle, InitializeListHead(&Port->LpcReplyChainHead); /* Check if we don't have a name */ - if (!ObjectAttributes->ObjectName->Buffer) + if (NoName) { /* Set up for an unconnected port */ Port->Flags = LPCP_UNCONNECTED_PORT; @@ -140,10 +175,24 @@ LpcpCreatePort(OUT PHANDLE PortHandle, PORT_ALL_ACCESS, 0, NULL, - PortHandle); + &Handle); + if (NT_SUCCESS(Status)) + { + _SEH2_TRY + { + /* Write back the handle, pointer was already probed */ + *PortHandle = Handle; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + ObCloseHandle(Handle, UserMode); + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; + } /* Return success or the error */ - LPCTRACE(LPC_CREATE_DEBUG, "Port: %p. Handle: %p\n", Port, *PortHandle); + LPCTRACE(LPC_CREATE_DEBUG, "Port: %p. Handle: %p\n", Port, Handle); return Status; } diff --git a/ntoskrnl/mm/ARM3/miarm.h b/ntoskrnl/mm/ARM3/miarm.h index d1cfbb4a24d..6e803aeb7d0 100644 --- a/ntoskrnl/mm/ARM3/miarm.h +++ b/ntoskrnl/mm/ARM3/miarm.h @@ -1100,11 +1100,11 @@ MI_WS_OWNER(IN PEPROCESS Process) /* Check if this process is the owner, and that the thread owns the WS */ if (PsGetCurrentThread()->OwnsProcessWorkingSetExclusive == 0) { - DPRINT1("Thread: %p is not an owner\n", PsGetCurrentThread()); + DPRINT("Thread: %p is not an owner\n", PsGetCurrentThread()); } if (KeGetCurrentThread()->ApcState.Process != &Process->Pcb) { - DPRINT1("Current thread %p is attached to another process %p\n", PsGetCurrentThread(), Process); + DPRINT("Current thread %p is attached to another process %p\n", PsGetCurrentThread(), Process); } return ((KeGetCurrentThread()->ApcState.Process == &Process->Pcb) && ((PsGetCurrentThread()->OwnsProcessWorkingSetExclusive) || diff --git a/ntoskrnl/mm/ARM3/section.c b/ntoskrnl/mm/ARM3/section.c index c69efc605ac..f8ae660db29 100644 --- a/ntoskrnl/mm/ARM3/section.c +++ b/ntoskrnl/mm/ARM3/section.c @@ -1185,7 +1185,7 @@ MiLoadUserSymbols(IN PCONTROL_AREA ControlArea, Status = RtlUnicodeStringToAnsiString(&FileNameA, FileName, TRUE); if (NT_SUCCESS(Status)) { - DbgLoadImageSymbols(&FileNameA, BaseAddress, (ULONG_PTR)Process); + DbgLoadImageSymbols(&FileNameA, BaseAddress, (ULONG_PTR)Process->UniqueProcessId); RtlFreeAnsiString(&FileNameA); } } @@ -2655,9 +2655,15 @@ MmMapViewOfArm3Section(IN PVOID SectionObject, ASSERT(Section->u.Flags.Image == 0); ASSERT(Section->u.Flags.NoCache == 0); ASSERT(Section->u.Flags.WriteCombined == 0); - ASSERT((AllocationType & MEM_RESERVE) == 0); ASSERT(ControlArea->u.Flags.PhysicalMemory == 0); + /* FIXME */ + if ((AllocationType & MEM_RESERVE) != 0) + { + DPRINT1("MmMapViewOfArm3Section called with MEM_RESERVE, this is not implemented yet!!!\n"); + return STATUS_NOT_IMPLEMENTED; + } + /* Check if the mapping protection is compatible with the create */ if (!MiIsProtectionCompatible(Section->InitialPageProtection, Protect)) { diff --git a/ntoskrnl/mm/ARM3/sysldr.c b/ntoskrnl/mm/ARM3/sysldr.c index 3175b0330cb..de123958b22 100644 --- a/ntoskrnl/mm/ARM3/sysldr.c +++ b/ntoskrnl/mm/ARM3/sysldr.c @@ -928,7 +928,7 @@ MmUnloadSystemImage(IN PVOID ImageHandle) /* Unload the symbols */ DbgUnLoadImageSymbols(&TempName, BaseAddress, - (ULONG_PTR)ZwCurrentProcess()); + (ULONG_PTR)PsGetCurrentProcessId()); RtlFreeAnsiString(&TempName); } } @@ -3309,7 +3309,7 @@ LoaderScan: /* Notify the debugger */ DbgLoadImageSymbols(&AnsiTemp, LdrEntry->DllBase, - (ULONG_PTR)ZwCurrentProcess()); + (ULONG_PTR)PsGetCurrentProcessId()); LdrEntry->Flags |= LDRP_DEBUG_SYMBOLS_LOADED; } diff --git a/ntoskrnl/mm/ARM3/virtual.c b/ntoskrnl/mm/ARM3/virtual.c index 935fc971dda..fc8762971a4 100644 --- a/ntoskrnl/mm/ARM3/virtual.c +++ b/ntoskrnl/mm/ARM3/virtual.c @@ -1261,6 +1261,11 @@ MiGetPageProtection(IN PMMPTE PointerPte) { MMPTE TempPte; PMMPFN Pfn; + PEPROCESS CurrentProcess; + PETHREAD CurrentThread; + BOOLEAN WsSafe, WsShared; + ULONG Protect; + KIRQL OldIrql; PAGED_CODE(); /* Copy this PTE's contents */ @@ -1270,12 +1275,79 @@ MiGetPageProtection(IN PMMPTE PointerPte) ASSERT(TempPte.u.Long); /* Check for a special prototype format */ - if (TempPte.u.Soft.Valid == 0 && - TempPte.u.Soft.Prototype == 1) + if ((TempPte.u.Soft.Valid == 0) && + (TempPte.u.Soft.Prototype == 1)) { - /* Unsupported now */ - UNIMPLEMENTED; - ASSERT(FALSE); + /* Check if the prototype PTE is not yet pointing to a PTE */ + if (TempPte.u.Soft.PageFileHigh == MI_PTE_LOOKUP_NEEDED) + { + /* The prototype PTE contains the protection */ + return MmProtectToValue[TempPte.u.Soft.Protection]; + } + + /* Get a pointer to the underlying shared PTE */ + PointerPte = MiProtoPteToPte(&TempPte); + + /* Since the PTE we want to read can be paged out at any time, we need + to release the working set lock first, so that it can be paged in */ + CurrentThread = PsGetCurrentThread(); + CurrentProcess = PsGetCurrentProcess(); + MiUnlockProcessWorkingSetForFault(CurrentProcess, + CurrentThread, + &WsSafe, + &WsShared); + + /* Now read the PTE value */ + TempPte = *PointerPte; + + /* Check if that one is invalid */ + if (!TempPte.u.Hard.Valid) + { + /* We get the protection directly from this PTE */ + Protect = MmProtectToValue[TempPte.u.Soft.Protection]; + } + else + { + /* The PTE is valid, so we might need to get the protection from + the PFN. Lock the PFN database */ + OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock); + + /* Check if the PDE is still valid */ + if (MiAddressToPte(PointerPte)->u.Hard.Valid == 0) + { + /* It's not, make it valid */ + MiMakeSystemAddressValidPfn(PointerPte, OldIrql); + } + + /* Now it's safe to read the PTE value again */ + TempPte = *PointerPte; + ASSERT(TempPte.u.Long != 0); + + /* Check again if the PTE is invalid */ + if (!TempPte.u.Hard.Valid) + { + /* The PTE is not valid, so we can use it's protection field */ + Protect = MmProtectToValue[TempPte.u.Soft.Protection]; + } + else + { + /* The PTE is valid, so we can find the protection in the + OriginalPte field of the PFN */ + Pfn = MI_PFN_ELEMENT(TempPte.u.Hard.PageFrameNumber); + Protect = MmProtectToValue[Pfn->OriginalPte.u.Soft.Protection]; + } + + /* Release the PFN database */ + KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql); + } + + /* Lock the working set again */ + MiLockProcessWorkingSetForFault(CurrentProcess, + CurrentThread, + WsSafe, + WsShared); + + return Protect; } /* In the easy case of transition or demand zero PTE just return its protection */ @@ -1291,10 +1363,10 @@ MiGetPageProtection(IN PMMPTE PointerPte) } /* This is software PTE */ - DPRINT1("Prototype PTE: %lx %p\n", TempPte.u.Hard.PageFrameNumber, Pfn); - DPRINT1("VA: %p\n", MiPteToAddress(&TempPte)); - DPRINT1("Mask: %lx\n", TempPte.u.Soft.Protection); - DPRINT1("Mask2: %lx\n", Pfn->OriginalPte.u.Soft.Protection); + DPRINT("Prototype PTE: %lx %p\n", TempPte.u.Hard.PageFrameNumber, Pfn); + DPRINT("VA: %p\n", MiPteToAddress(&TempPte)); + DPRINT("Mask: %lx\n", TempPte.u.Soft.Protection); + DPRINT("Mask2: %lx\n", Pfn->OriginalPte.u.Soft.Protection); return MmProtectToValue[TempPte.u.Soft.Protection]; } @@ -4326,6 +4398,9 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle, } } + DPRINT("NtAllocateVirtualMemory: Process 0x%p, Address 0x%p, Zerobits %lu , RegionSize 0x%x, Allocation type 0x%x, Protect 0x%x.\n", + Process, PBaseAddress, ZeroBits, PRegionSize, AllocationType, Protect); + // // Check for large page allocations and make sure that the required privilege // is being held, before attempting to handle them. @@ -4584,6 +4659,7 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle, // } _SEH2_END; + DPRINT("Reserved %x bytes at %p.\n", PRegionSize, StartingAddress); return STATUS_SUCCESS; } @@ -4593,8 +4669,8 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle, // on the user input, and then compute the actual region size once all the // alignments have been done. // - StartingAddress = (ULONG_PTR)PAGE_ALIGN(PBaseAddress); EndingAddress = (((ULONG_PTR)PBaseAddress + PRegionSize - 1) | (PAGE_SIZE - 1)); + StartingAddress = (ULONG_PTR)PAGE_ALIGN(PBaseAddress); PRegionSize = EndingAddress - StartingAddress + 1; // @@ -4700,6 +4776,12 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle, { // // Make sure it's okay to touch it + // Note: The Windows 2003 kernel has a bug here, passing the + // unaligned base address together with the aligned size, + // potentially covering a region larger than the actual allocation. + // Might be exposed through NtGdiCreateDIBSection w/ section handle + // For now we keep this behavior. + // TODO: analyze possible implications, create test case // Status = MiCheckSecuredVad(FoundVad, PBaseAddress, @@ -5075,6 +5157,9 @@ NtFreeVirtualMemory(IN HANDLE ProcessHandle, } } + DPRINT("NtFreeVirtualMemory: Process 0x%p, Adress 0x%p, size 0x%x, FreeType %x.\n", + Process, PBaseAddress, PRegionSize, FreeType); + // // Lock the address space // @@ -5258,7 +5343,7 @@ NtFreeVirtualMemory(IN HANDLE ProcessHandle, ASSERT(Vad->StartingVpn << PAGE_SHIFT == (ULONG_PTR)MemoryArea->StartingAddress); ASSERT((Vad->EndingVpn + 1) << PAGE_SHIFT == (ULONG_PTR)MemoryArea->EndingAddress); Vad->EndingVpn = ((ULONG_PTR)StartingAddress - 1) >> PAGE_SHIFT; - MemoryArea->EndingAddress = (PVOID)(((Vad->EndingVpn + 1) << PAGE_SHIFT) - 1); + MemoryArea->EndingAddress = (PVOID)(StartingAddress); } else { diff --git a/ntoskrnl/mm/marea.c b/ntoskrnl/mm/marea.c index 5deec1abb9b..12a7afae3ac 100644 --- a/ntoskrnl/mm/marea.c +++ b/ntoskrnl/mm/marea.c @@ -399,7 +399,6 @@ MmInsertMemoryArea( Vad->EndingVpn = Vad->StartingVpn; } Vad->u.VadFlags.Spare = 1; - Vad->u.VadFlags.PrivateMemory = 1; Vad->u.VadFlags.Protection = MiMakeProtectionMask(marea->Protect); /* Insert the VAD */ @@ -988,6 +987,7 @@ MmCreateMemoryArea(PMMSUPPORT AddressSpace, { ULONG_PTR tmpLength; PMEMORY_AREA MemoryArea; + ULONG_PTR EndingAddress; DPRINT("MmCreateMemoryArea(Type 0x%lx, BaseAddress %p, " "*BaseAddress %p, Length %p, AllocationFlags %x, " @@ -997,7 +997,7 @@ MmCreateMemoryArea(PMMSUPPORT AddressSpace, if ((*BaseAddress) == 0 && !FixedAddress) { - tmpLength = (ULONG_PTR)MM_ROUND_UP(Length, Granularity); + tmpLength = (ULONG_PTR)MM_ROUND_UP(Length, PAGE_SIZE); *BaseAddress = MmFindGap(AddressSpace, tmpLength, Granularity, @@ -1010,10 +1010,9 @@ MmCreateMemoryArea(PMMSUPPORT AddressSpace, } else { - tmpLength = Length + ((ULONG_PTR) *BaseAddress - - (ULONG_PTR) MM_ROUND_DOWN(*BaseAddress, Granularity)); - tmpLength = (ULONG_PTR)MM_ROUND_UP(tmpLength, Granularity); - *BaseAddress = MM_ROUND_DOWN(*BaseAddress, Granularity); + EndingAddress = ((ULONG_PTR)*BaseAddress + Length - 1) | (PAGE_SIZE - 1); + *BaseAddress = ALIGN_DOWN_POINTER_BY(*BaseAddress, Granularity); + tmpLength = EndingAddress + 1 - (ULONG_PTR)*BaseAddress; if (!MmGetAddressSpaceOwner(AddressSpace) && *BaseAddress < MmSystemRangeStart) { diff --git a/ntoskrnl/mm/section.c b/ntoskrnl/mm/section.c index af8719277e5..e30cc2a0f86 100644 --- a/ntoskrnl/mm/section.c +++ b/ntoskrnl/mm/section.c @@ -4090,15 +4090,22 @@ MmUnmapViewOfSegment(PMMSUPPORT AddressSpace, return(STATUS_UNSUCCESSFUL); } - MemoryArea->DeleteInProgress = TRUE; Section = MemoryArea->Data.SectionData.Section; Segment = MemoryArea->Data.SectionData.Segment; #ifdef NEWCC - if (Segment->Flags & MM_DATAFILE_SEGMENT) - return MmUnmapViewOfCacheSegment(AddressSpace, BaseAddress); + if (Segment->Flags & MM_DATAFILE_SEGMENT) + { + MmUnlockAddressSpace(AddressSpace); + Status = MmUnmapViewOfCacheSegment(AddressSpace, BaseAddress); + MmLockAddressSpace(AddressSpace); + + return Status; + } #endif + MemoryArea->DeleteInProgress = TRUE; + MmLockSectionSegment(Segment); RegionListHead = &MemoryArea->Data.SectionData.RegionListHead; @@ -4151,7 +4158,8 @@ MiRosUnmapViewOfSection(IN PEPROCESS Process, MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, BaseAddress); if (MemoryArea == NULL || - MemoryArea->Type != MEMORY_AREA_SECTION_VIEW || + ((MemoryArea->Type != MEMORY_AREA_SECTION_VIEW) && + (MemoryArea->Type != MEMORY_AREA_CACHE)) || MemoryArea->DeleteInProgress) { if (MemoryArea) NT_ASSERT(MemoryArea->Type != MEMORY_AREA_OWNED_BY_ARM3); @@ -4159,11 +4167,9 @@ MiRosUnmapViewOfSection(IN PEPROCESS Process, return STATUS_NOT_MAPPED_VIEW; } - MemoryArea->DeleteInProgress = TRUE; - Section = MemoryArea->Data.SectionData.Section; - if (Section->AllocationAttributes & SEC_IMAGE) + if ((Section != NULL) && (Section->AllocationAttributes & SEC_IMAGE)) { ULONG i; ULONG NrSegments; @@ -4176,6 +4182,8 @@ MiRosUnmapViewOfSection(IN PEPROCESS Process, SectionSegments = ImageSectionObject->Segments; NrSegments = ImageSectionObject->NrSegments; + MemoryArea->DeleteInProgress = TRUE; + /* Search for the current segment within the section segments * and calculate the image base address */ for (i = 0; i < NrSegments; i++) diff --git a/ntoskrnl/ps/query.c b/ntoskrnl/ps/query.c index 4cc554f19cc..b3701915096 100644 --- a/ntoskrnl/ps/query.c +++ b/ntoskrnl/ps/query.c @@ -151,7 +151,7 @@ NtQueryInformationProcess(IN HANDLE ProcessHandle, ProcessBasicInfo->UniqueProcessId = (ULONG_PTR)Process-> UniqueProcessId; ProcessBasicInfo->InheritedFromUniqueProcessId = - (ULONG)Process->InheritedFromUniqueProcessId; + (ULONG_PTR)Process->InheritedFromUniqueProcessId; ProcessBasicInfo->BasePriority = Process->Pcb.BasePriority; } diff --git a/ntoskrnl/rtl/libsupp.c b/ntoskrnl/rtl/libsupp.c index b83519ed289..b5099a5f2de 100644 --- a/ntoskrnl/rtl/libsupp.c +++ b/ntoskrnl/rtl/libsupp.c @@ -695,6 +695,7 @@ NTSTATUS find_entry( PVOID BaseAddress, LDR_RESOURCE_INFO *info, root = RtlImageDirectoryEntryToData( BaseAddress, TRUE, IMAGE_DIRECTORY_ENTRY_RESOURCE, &size ); if (!root) return STATUS_RESOURCE_DATA_NOT_FOUND; + if (size < sizeof(*resdirptr)) return STATUS_RESOURCE_DATA_NOT_FOUND; resdirptr = root; if (!level--) goto done; diff --git a/subsystems/ntvdm/bios/bios.h b/subsystems/ntvdm/bios/bios.h index 9b47f163a0d..21eee31eea9 100644 --- a/subsystems/ntvdm/bios/bios.h +++ b/subsystems/ntvdm/bios/bios.h @@ -76,7 +76,8 @@ typedef struct WORD KeybdBufferEnd; // 0x82 BYTE ScreenRows; // 0x84 WORD CharacterHeight; // 0x85 - BYTE EGAFlags[2]; // 0x87 + BYTE VGAOptions; // 0x87 + BYTE VGASwitches; // 0x88 BYTE VGAFlags[2]; // 0x89 DWORD Reserved3; // 0x8b BYTE Reserved4; // 0x8f diff --git a/subsystems/ntvdm/bios/vidbios.c b/subsystems/ntvdm/bios/vidbios.c index c5d94e061c2..8f50d32f97e 100644 --- a/subsystems/ntvdm/bios/vidbios.c +++ b/subsystems/ntvdm/bios/vidbios.c @@ -1572,6 +1572,10 @@ BOOLEAN VidBiosInitialize(VOID) ((PULONG)BaseAddress)[0x43] = (ULONG)NULL; ((PULONG)BaseAddress)[0x44] = (ULONG)NULL; + /* Initialize the VGA BDA data */ + Bda->VGAOptions = 0x30; /* 256 KB Video RAM */ + Bda->VGASwitches = 0x09; /* High-resolution */ + // // FIXME: At the moment we always set a VGA mode. In the future, // we should set this mode **only** when: diff --git a/subsystems/ntvdm/dos/dos32krnl/dos.c b/subsystems/ntvdm/dos/dos32krnl/dos.c index 353fa6d3c22..a9aa39d6e52 100644 --- a/subsystems/ntvdm/dos/dos32krnl/dos.c +++ b/subsystems/ntvdm/dos/dos32krnl/dos.c @@ -442,6 +442,10 @@ static WORD DosCopyEnvironmentBlock(LPCVOID Environment, LPCSTR ProgramName) /* Set the final zero */ *(DestBuffer++) = 0; + /* Store the special program name tag */ + *(DestBuffer++) = LOBYTE(DOS_PROGRAM_NAME_TAG); + *(DestBuffer++) = HIBYTE(DOS_PROGRAM_NAME_TAG); + /* Copy the program name after the environment block */ strcpy(DestBuffer, ProgramName); @@ -911,6 +915,7 @@ DWORD DosLoadExecutable(IN DOS_EXEC_TYPE LoadType, PIMAGE_DOS_HEADER Header; PDWORD RelocationTable; PWORD RelocWord; + LPSTR CmdLinePtr = (LPSTR)CommandLine; DPRINT1("DosLoadExecutable(%d, %s, %s, %s, 0x%08X, 0x%08X)\n", LoadType, @@ -927,8 +932,8 @@ DWORD DosLoadExecutable(IN DOS_EXEC_TYPE LoadType, } /* NULL-terminate the command line by removing the return carriage character */ - while (*CommandLine && *CommandLine != '\r') CommandLine++; - *(LPSTR)CommandLine = '\0'; + while (*CmdLinePtr && *CmdLinePtr != '\r') CmdLinePtr++; + *CmdLinePtr = '\0'; /* Open a handle to the executable */ FileHandle = CreateFileA(ExecutablePath, diff --git a/subsystems/ntvdm/dos/dos32krnl/dos.h b/subsystems/ntvdm/dos/dos32krnl/dos.h index e2f0cef368c..abbef7e142d 100644 --- a/subsystems/ntvdm/dos/dos32krnl/dos.h +++ b/subsystems/ntvdm/dos/dos32krnl/dos.h @@ -47,6 +47,7 @@ #define DOS_DIR_LENGTH 64 #define NUM_DRIVES ('Z' - 'A' + 1) #define DOS_CHAR_ATTRIBUTE 0x07 +#define DOS_PROGRAM_NAME_TAG 0x0001 enum DOS_ALLOC_STRATEGY { diff --git a/subsystems/ntvdm/hardware/vga.c b/subsystems/ntvdm/hardware/vga.c index 590ff058407..4593a5d5188 100644 --- a/subsystems/ntvdm/hardware/vga.c +++ b/subsystems/ntvdm/hardware/vga.c @@ -171,6 +171,32 @@ static CONST COLORREF VgaDefaultPalette[VGA_MAX_COLORS] = #endif +/* + * Default 16-color palette for foreground and background + * (corresponding flags in comments). + * Taken from subsystems/win32/winsrv/consrv/frontends/gui/conwnd.c + */ +static const COLORREF ConsoleColors[16] = +{ + RGB(0, 0, 0), // (Black) + RGB(0, 0, 128), // BLUE + RGB(0, 128, 0), // GREEN + RGB(0, 128, 128), // BLUE | GREEN + RGB(128, 0, 0), // RED + RGB(128, 0, 128), // BLUE | RED + RGB(128, 128, 0), // GREEN | RED + RGB(192, 192, 192), // BLUE | GREEN | RED + + RGB(128, 128, 128), // (Grey) INTENSITY + RGB(0, 0, 255), // BLUE | INTENSITY + RGB(0, 255, 0), // GREEN | INTENSITY + RGB(0, 255, 255), // BLUE | GREEN | INTENSITY + RGB(255, 0, 0), // RED | INTENSITY + RGB(255, 0, 255), // BLUE | RED | INTENSITY + RGB(255, 255, 0), // GREEN | RED | INTENSITY + RGB(255, 255, 255) // BLUE | GREEN | RED | INTENSITY +}; + /* * Console interface -- VGA-mode-agnostic */ @@ -184,6 +210,7 @@ C_ASSERT(sizeof(CHAR_CELL) == 2); static LPVOID ConsoleFramebuffer = NULL; // Active framebuffer, points to // either TextFramebuffer or a valid // graphics framebuffer. +static HPALETTE TextPaletteHandle = NULL; static HPALETTE PaletteHandle = NULL; static HANDLE StartEvent = NULL; @@ -774,7 +801,7 @@ static VOID VgaWriteCrtc(BYTE Data) static VOID VgaWriteDac(BYTE Data) { - INT PaletteIndex; + INT i, PaletteIndex; PALETTEENTRY Entry; /* Set the value */ @@ -789,8 +816,20 @@ static VOID VgaWriteDac(BYTE Data) Entry.peBlue = VGA_DAC_TO_COLOR(VgaDacRegisters[PaletteIndex * 3 + 2]); Entry.peFlags = 0; - /* Update the palette entry and set the palette change flag */ + /* Update the palette entry */ SetPaletteEntries(PaletteHandle, PaletteIndex, 1, &Entry); + + /* Check which text palette entries are affected */ + for (i = 0; i <= VGA_AC_PAL_F_REG; i++) + { + if (VgaAcRegisters[i] == PaletteIndex) + { + /* Update the text palette entry */ + SetPaletteEntries(TextPaletteHandle, i, 1, &Entry); + } + } + + /* Set the palette changed flag */ PaletteChanged = TRUE; /* Update the index */ @@ -800,6 +839,8 @@ static VOID VgaWriteDac(BYTE Data) static VOID VgaWriteAc(BYTE Data) { + PALETTEENTRY Entry; + ASSERT(VgaAcIndex < VGA_AC_MAX_REG); /* Save the value */ @@ -810,8 +851,17 @@ static VOID VgaWriteAc(BYTE Data) // DbgPrint(" AC Palette Writing %d to index %d\n", Data, VgaAcIndex); if (VgaAcRegisters[VgaAcIndex] != Data) { - /* Update the AC register and set the palette change flag */ + /* Update the AC register */ VgaAcRegisters[VgaAcIndex] = Data; + + /* Fill the entry structure */ + Entry.peRed = VGA_DAC_TO_COLOR(VgaDacRegisters[Data * 3]); + Entry.peGreen = VGA_DAC_TO_COLOR(VgaDacRegisters[Data * 3 + 1]); + Entry.peBlue = VGA_DAC_TO_COLOR(VgaDacRegisters[Data * 3 + 2]); + Entry.peFlags = 0; + + /* Update the palette entry and set the palette change flag */ + SetPaletteEntries(TextPaletteHandle, VgaAcIndex, 1, &Entry); PaletteChanged = TRUE; } } @@ -843,33 +893,62 @@ static VOID VgaRestoreDefaultPalette(PPALETTEENTRY Entries, USHORT NumOfEntries) static BOOLEAN VgaInitializePalette(VOID) { - LPLOGPALETTE Palette; + INT i; + BOOLEAN Result = FALSE; + LPLOGPALETTE Palette, TextPalette; - /* Allocate storage space for the palette */ + /* Allocate storage space for the palettes */ Palette = (LPLOGPALETTE)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(LOGPALETTE) + - VGA_MAX_COLORS * sizeof(PALETTEENTRY)); - if (Palette == NULL) return FALSE; + VGA_MAX_COLORS * sizeof(PALETTEENTRY)); + TextPalette = (LPLOGPALETTE)HeapAlloc(GetProcessHeap(), + HEAP_ZERO_MEMORY, + sizeof(LOGPALETTE) + + (VGA_AC_PAL_F_REG + 1) * sizeof(PALETTEENTRY)); + if ((Palette == NULL) || (TextPalette == NULL)) goto Cleanup; - /* Initialize the palette */ - Palette->palVersion = 0x0300; + /* Initialize the palettes */ + Palette->palVersion = TextPalette->palVersion = 0x0300; Palette->palNumEntries = VGA_MAX_COLORS; + TextPalette->palNumEntries = VGA_AC_PAL_F_REG + 1; - /* Restore the default palette */ + /* Restore the default graphics palette */ VgaRestoreDefaultPalette(Palette->palPalEntry, Palette->palNumEntries); - /* Create the palette */ + /* Set the default text palette */ + for (i = 0; i < TextPalette->palNumEntries; i++) + { + /* Set the palette entries */ + TextPalette->palPalEntry[i].peRed = GetRValue(ConsoleColors[i]); + TextPalette->palPalEntry[i].peGreen = GetGValue(ConsoleColors[i]); + TextPalette->palPalEntry[i].peBlue = GetBValue(ConsoleColors[i]); + TextPalette->palPalEntry[i].peFlags = 0; + } + + /* Create the palettes */ PaletteHandle = CreatePalette(Palette); + TextPaletteHandle = CreatePalette(TextPalette); - /* Free the palette */ - HeapFree(GetProcessHeap(), 0, Palette); + if (PaletteHandle != NULL && TextPaletteHandle != NULL) + { + /* The palettes have been created successfully */ + Result = TRUE; + } - /* Fail if the palette wasn't successfully created... */ - if (PaletteHandle == NULL) return FALSE; +Cleanup: + /* Free the palettes */ + if (Palette) HeapFree(GetProcessHeap(), 0, Palette); + if (TextPalette) HeapFree(GetProcessHeap(), 0, TextPalette); - /* ... otherwise return success */ - return TRUE; + if (!Result) + { + /* Something failed, delete the palettes */ + if (PaletteHandle) DeleteObject(PaletteHandle); + if (TextPaletteHandle) DeleteObject(TextPaletteHandle); + } + + return Result; } static BOOL VgaEnterGraphicsMode(PCOORD Resolution) @@ -1001,7 +1080,7 @@ static BOOL VgaEnterTextMode(PCOORD Resolution) * screen-buffers, which is a new feature on ReactOS). */ SetConsolePalette(TextConsoleBuffer, - PaletteHandle, + TextPaletteHandle, SYSPAL_NOSTATIC256); /* Set the screen mode flag */ diff --git a/subsystems/ntvdm/lang/pl-PL.rc b/subsystems/ntvdm/lang/pl-PL.rc index 84701cf04ee..ab931ef77bc 100644 --- a/subsystems/ntvdm/lang/pl-PL.rc +++ b/subsystems/ntvdm/lang/pl-PL.rc @@ -11,6 +11,6 @@ END STRINGTABLE BEGIN - IDS_VDM_DUMPMEM, "Dump &Memory" + IDS_VDM_DUMPMEM, "Zrzut &Pamięci" IDS_VDM_QUIT , "&Wyjdź z ReactOS VDM" END diff --git a/subsystems/win32/csrsrv/api.h b/subsystems/win32/csrsrv/api.h index bf83165c90a..81b979a2315 100644 --- a/subsystems/win32/csrsrv/api.h +++ b/subsystems/win32/csrsrv/api.h @@ -153,8 +153,6 @@ NTSTATUS NTAPI CsrInitializeProcessStructure(VOID); -// NTSTATUS WINAPI CsrEnumProcesses(CSRSS_ENUM_PROCESS_PROC EnumProc, -// PVOID Context); PCSR_THREAD NTAPI CsrLocateThreadInProcess(IN PCSR_PROCESS CsrProcess OPTIONAL, diff --git a/subsystems/win32/csrsrv/csrsrv.spec b/subsystems/win32/csrsrv/csrsrv.spec index 2f968e6ebad..218703d1023 100644 --- a/subsystems/win32/csrsrv/csrsrv.spec +++ b/subsystems/win32/csrsrv/csrsrv.spec @@ -12,7 +12,6 @@ @ stdcall CsrDereferenceWait(ptr) @ stdcall CsrDestroyProcess(ptr long) @ stdcall CsrDestroyThread(ptr) -;@ stdcall CsrEnumProcesses(ptr ptr) ;;;;;;; Temporary hack used in win32csr, to be removed @ stdcall CsrExecServerThread(ptr long) @ stdcall CsrGetProcessLuid(ptr ptr) @ stdcall CsrImpersonateClient(ptr) diff --git a/subsystems/win32/csrsrv/procsup.c b/subsystems/win32/csrsrv/procsup.c index 451f2697d45..af89f6e97d9 100644 --- a/subsystems/win32/csrsrv/procsup.c +++ b/subsystems/win32/csrsrv/procsup.c @@ -96,109 +96,6 @@ CsrSetToShutdownPriority(VOID) } } -/*++ - * @name FindProcessForShutdown - * - * The FindProcessForShutdown routine returns a CSR Process which is ready - * to be shutdown, and sets the appropriate shutdown flags for it. - * - * @param CallerLuid - * Pointer to the LUID of the CSR Process calling this routine. - * - * @return Pointer to a CSR Process which is ready to be shutdown. - * - * @remarks None. - * - *--*/ -PCSR_PROCESS -NTAPI -FindProcessForShutdown(IN PLUID CallerLuid) -{ - PCSR_PROCESS CsrProcess, ReturnCsrProcess = NULL; - // PCSR_THREAD CsrThread; - NTSTATUS Status; - ULONG Level = 0; - LUID ProcessLuid; - LUID SystemLuid = SYSTEM_LUID; - // BOOLEAN IsSystemLuid = FALSE, IsOurLuid = FALSE; - PLIST_ENTRY NextEntry; - - /* Set the List Pointers */ - NextEntry = CsrRootProcess->ListLink.Flink; - while (NextEntry != &CsrRootProcess->ListLink) - { - /* Get the process */ - CsrProcess = CONTAINING_RECORD(NextEntry, CSR_PROCESS, ListLink); - - /* Move to the next entry */ - NextEntry = NextEntry->Flink; - - /* Skip this process if it's already been processed */ - if (CsrProcess->Flags & CsrProcessSkipShutdown) continue; - - /* Get the LUID of this Process */ - Status = CsrGetProcessLuid(CsrProcess->ProcessHandle, &ProcessLuid); - - /* Check if we didn't get access to the LUID */ - if (Status == STATUS_ACCESS_DENIED) - { - /* FIXME: Check if we have any threads */ -/* - /\* Check if we have any threads *\/ - if (CsrProcess->ThreadCount) - { - /\* Impersonate one of the threads and retry *\/ - CsrThread = CONTAINING_RECORD(CsrProcess->ThreadList.Flink, - CSR_THREAD, - Link); - CsrImpersonateClient(CsrThread); - Status = CsrGetProcessLuid(NULL, &ProcessLuid); - CsrRevertToSelf(); - } -*/ - } - - if (!NT_SUCCESS(Status)) - { - /* We didn't have access, so skip it */ - CsrProcess->Flags |= CsrProcessSkipShutdown; - continue; - } - - /* Check if this is the System LUID */ - if ((/*IsSystemLuid =*/ RtlEqualLuid(&ProcessLuid, &SystemLuid))) - { - /* Mark this process */ - CsrProcess->ShutdownFlags |= CsrShutdownSystem; - } - else if (!(/*IsOurLuid =*/ RtlEqualLuid(&ProcessLuid, CallerLuid))) - { - /* Our LUID doesn't match with the caller's */ - CsrProcess->ShutdownFlags |= CsrShutdownOther; - } - - /* Check if we're past the previous level */ - // FIXME: if ((CsrProcess->ShutdownLevel > Level) || !(ReturnCsrProcess)) - if (CsrProcess->ShutdownLevel > Level /* || !ReturnCsrProcess */) - { - /* Update the level */ - Level = CsrProcess->ShutdownLevel; - - /* Set the final process */ - ReturnCsrProcess = CsrProcess; - } - } - - /* Check if we found a process */ - if (ReturnCsrProcess) - { - /* Skip this one next time */ - ReturnCsrProcess->Flags |= CsrProcessSkipShutdown; - } - - return ReturnCsrProcess; -} - /*++ * @name CsrProcessRefcountZero * @@ -1243,6 +1140,110 @@ CsrSetForegroundPriority(IN PCSR_PROCESS CsrProcess) sizeof(PriorityClass)); } +/*++ + * @name FindProcessForShutdown + * + * The FindProcessForShutdown routine returns a CSR Process which is ready + * to be shutdown, and sets the appropriate shutdown flags for it. + * + * @param CallerLuid + * Pointer to the LUID of the CSR Process calling this routine. + * + * @return Pointer to a CSR Process which is ready to be shutdown. + * + * @remarks None. + * + *--*/ +PCSR_PROCESS +NTAPI +FindProcessForShutdown(IN PLUID CallerLuid) +{ + PCSR_PROCESS CsrProcess, ReturnCsrProcess = NULL; + PCSR_THREAD CsrThread; + NTSTATUS Status; + ULONG Level = 0; + LUID ProcessLuid; + LUID SystemLuid = SYSTEM_LUID; + PLIST_ENTRY NextEntry; + + /* Set the List Pointers */ + NextEntry = CsrRootProcess->ListLink.Flink; + while (NextEntry != &CsrRootProcess->ListLink) + { + /* Get the process */ + CsrProcess = CONTAINING_RECORD(NextEntry, CSR_PROCESS, ListLink); + + /* Move to the next entry */ + NextEntry = NextEntry->Flink; + + /* Skip this process if it's already been processed */ + if (CsrProcess->Flags & CsrProcessSkipShutdown) continue; + + /* Get the LUID of this process */ + Status = CsrGetProcessLuid(CsrProcess->ProcessHandle, &ProcessLuid); + + /* Check if we didn't get access to the LUID */ + if (Status == STATUS_ACCESS_DENIED) + { + /* Check if we have any threads */ + if (CsrProcess->ThreadCount) + { + /* Impersonate one of the threads and retry */ + CsrThread = CONTAINING_RECORD(CsrProcess->ThreadList.Flink, + CSR_THREAD, + Link); + if (CsrImpersonateClient(CsrThread)) + { + Status = CsrGetProcessLuid(NULL, &ProcessLuid); + CsrRevertToSelf(); + } + else + { + Status = STATUS_BAD_IMPERSONATION_LEVEL; + } + } + } + + if (!NT_SUCCESS(Status)) + { + /* We didn't have access, so skip it */ + CsrProcess->Flags |= CsrProcessSkipShutdown; + continue; + } + + /* Check if this is the System LUID */ + if (RtlEqualLuid(&ProcessLuid, &SystemLuid)) + { + /* Mark this process */ + CsrProcess->ShutdownFlags |= CsrShutdownSystem; + } + else if (!RtlEqualLuid(&ProcessLuid, CallerLuid)) + { + /* Our LUID doesn't match with the caller's */ + CsrProcess->ShutdownFlags |= CsrShutdownOther; + } + + /* Check if we're past the previous level */ + if ((CsrProcess->ShutdownLevel > Level) || !ReturnCsrProcess) + { + /* Update the level */ + Level = CsrProcess->ShutdownLevel; + + /* Set the final process */ + ReturnCsrProcess = CsrProcess; + } + } + + /* Check if we found a process */ + if (ReturnCsrProcess) + { + /* Skip this one next time */ + ReturnCsrProcess->Flags |= CsrProcessSkipShutdown; + } + + return ReturnCsrProcess; +} + /*++ * @name CsrShutdownProcesses * @implemented NT4 @@ -1273,7 +1274,7 @@ CsrShutdownProcesses(IN PLUID CallerLuid, BOOLEAN FirstTry; ULONG i; PCSR_SERVER_DLL ServerDll; - ULONG Result = 0; /* Intentionally invalid enumeratee to silence compiler warning */ + ULONG Result = 0; /* Acquire process lock */ CsrAcquireProcessLock(); @@ -1353,7 +1354,7 @@ CsrShutdownProcesses(IN PLUID CallerLuid, } /* No matches during the first try, so loop again */ - if ((FirstTry) && (Result == CsrShutdownNonCsrProcess)) + if (FirstTry && (Result == CsrShutdownNonCsrProcess)) { FirstTry = FALSE; continue; @@ -1378,100 +1379,6 @@ Quickie: return Status; } -/* HACK: Temporary hack. This is really "CsrShutdownProcesses", mostly. Used by winsrv */ -#if 0 -NTSTATUS -WINAPI -CsrEnumProcesses(IN CSRSS_ENUM_PROCESS_PROC EnumProc, - IN PVOID Context) -{ - PVOID* RealContext = (PVOID*)Context; - PLUID CallerLuid = RealContext[0]; - PCSR_PROCESS CsrProcess = NULL; - NTSTATUS Status = STATUS_UNSUCCESSFUL; - BOOLEAN FirstTry; - PLIST_ENTRY NextEntry; - ULONG Result = 0; - - /* Acquire process lock */ - CsrAcquireProcessLock(); - - /* Get the list pointers */ - NextEntry = CsrRootProcess->ListLink.Flink; - while (NextEntry != &CsrRootProcess->ListLink) - { - /* Get the Process */ - CsrProcess = CONTAINING_RECORD(NextEntry, CSR_PROCESS, ListLink); - - /* Move to the next entry */ - NextEntry = NextEntry->Flink; - - /* Remove the skip flag, set shutdown flags to 0 */ - CsrProcess->Flags &= ~CsrProcessSkipShutdown; - CsrProcess->ShutdownFlags = 0; - } - - /* Set shudown Priority */ - CsrSetToShutdownPriority(); - - /* Loop all processes */ - //DPRINT1("Enumerating for LUID: %lx %lx\n", CallerLuid->HighPart, CallerLuid->LowPart); - - /* Start looping */ - while (TRUE) - { - /* Find the next process to shutdown */ - FirstTry = TRUE; - if (!(CsrProcess = FindProcessForShutdown(CallerLuid))) - { - /* Done, quit */ - CsrReleaseProcessLock(); - Status = STATUS_SUCCESS; - goto Quickie; - } - -LoopAgain: - /* Release the lock, make the callback, and acquire it back */ - //DPRINT1("Found process: %lx\n", CsrProcess->ClientId.UniqueProcess); - CsrReleaseProcessLock(); - Result = (ULONG)EnumProc(CsrProcess, (PVOID)((ULONG_PTR)Context | FirstTry)); - CsrAcquireProcessLock(); - - /* Check the result */ - //DPRINT1("Result: %d\n", Result); - if (Result == CsrShutdownCsrProcess) - { - /* The callback unlocked the process */ - break; - } - else if (Result == CsrShutdownNonCsrProcess) - { - /* A non-CSR process, the callback didn't touch it */ - //continue; - } - else if (Result == CsrShutdownCancelled) - { - /* Shutdown was cancelled, unlock and exit */ - CsrReleaseProcessLock(); - Status = STATUS_CANCELLED; - goto Quickie; - } - - /* No matches during the first try, so loop again */ - if (FirstTry && Result == CsrShutdownNonCsrProcess) - { - FirstTry = FALSE; - goto LoopAgain; - } - } - -Quickie: - /* Return to normal priority */ - CsrSetToNormalPriority(); - return Status; -} -#endif - /*++ * @name CsrUnlockProcess * @implemented NT4 diff --git a/toolchain-msvc.cmake b/toolchain-msvc.cmake index 3d692605fca..cf675a5a975 100644 --- a/toolchain-msvc.cmake +++ b/toolchain-msvc.cmake @@ -9,11 +9,20 @@ set(CMAKE_SYSTEM_PROCESSOR i686) # which compilers to use for C and C++ set(CMAKE_C_COMPILER cl) + +if(ARCH STREQUAL "arm") + include(CMakeForceCompiler) + CMAKE_FORCE_CXX_COMPILER(cl MSVC) +else() set(CMAKE_CXX_COMPILER cl) +endif() + set(CMAKE_MC_COMPILER mc) set(CMAKE_RC_COMPILER rc) if(ARCH STREQUAL "amd64") set(CMAKE_ASM_COMPILER ml64) +elseif(ARCH STREQUAL "arm") + set(CMAKE_ASM_COMPILER armasm) else() set(CMAKE_ASM_COMPILER ml) endif() diff --git a/win32ss/drivers/font/bmfd/glyph.c b/win32ss/drivers/font/bmfd/glyph.c index da4642a0c82..ebc5f06e824 100644 --- a/win32ss/drivers/font/bmfd/glyph.c +++ b/win32ss/drivers/font/bmfd/glyph.c @@ -118,8 +118,8 @@ BmfdQueryGlyphAndBitmap( } else { - cxDst = cxSrc * yScale; - cyDst = cySrc * xScale; + cxDst = cxSrc * xScale; + cyDst = cySrc * yScale; } cjDstRow = (cxDst + 7) / 8; @@ -154,7 +154,7 @@ BmfdQueryGlyphAndBitmap( } /* Fill GLYPHBITS structure */ - pgb->ptlOrigin.x = yScale * pface->wA; + pgb->ptlOrigin.x = xScale * pface->wA; pgb->ptlOrigin.y = - yScale * pface->wAscent; pgb->sizlBitmap.cx = cxDst; pgb->sizlBitmap.cy = cyDst; diff --git a/win32ss/gdi/dib/stretchblt.c b/win32ss/gdi/dib/stretchblt.c index f8272aadb58..55f80575942 100644 --- a/win32ss/gdi/dib/stretchblt.c +++ b/win32ss/gdi/dib/stretchblt.c @@ -29,6 +29,8 @@ BOOLEAN DIB_XXBPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, SURFOBJ *Ma LONG DstWidth; LONG SrcHeight; LONG SrcWidth; + LONG MaskCy; + LONG SourceCy; ULONG Color; ULONG Dest, Source = 0, Pattern = 0; @@ -56,6 +58,7 @@ BOOLEAN DIB_XXBPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, SURFOBJ *Ma if (UsesSource) { + SourceCy = abs(SourceSurf->sizlBitmap.cy); fnSource_GetPixel = DibFunctionsForBitmapFormat[SourceSurf->iBitmapFormat].DIB_GetPixel; DPRINT("Source BPP: %u, srcRect: (%d,%d)-(%d,%d)\n", BitsPerFormat(SourceSurf->iBitmapFormat), SourceRect->left, SourceRect->top, SourceRect->right, SourceRect->bottom); @@ -64,6 +67,7 @@ BOOLEAN DIB_XXBPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, SURFOBJ *Ma if (MaskSurf) { fnMask_GetPixel = DibFunctionsForBitmapFormat[MaskSurf->iBitmapFormat].DIB_GetPixel; + MaskCy = abs(MaskSurf->sizlBitmap.cy); } DstHeight = DestRect->bottom - DestRect->top; @@ -124,7 +128,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 || MaskCy < sy || fnMask_GetPixel(MaskSurf, sx, sy) != 0) { CanDraw = FALSE; @@ -135,7 +139,7 @@ BOOLEAN DIB_XXBPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, SURFOBJ *Ma { sx = SourceRect->left+(DesX - DestRect->left) * SrcWidth / DstWidth; if (sx >= 0 && sy >= 0 && - SourceSurf->sizlBitmap.cx > sx && SourceSurf->sizlBitmap.cy > sy) + SourceSurf->sizlBitmap.cx > sx && SourceCy > sy) { Source = XLATEOBJ_iXlate(ColorTranslation, fnSource_GetPixel(SourceSurf, sx, sy)); } diff --git a/win32ss/gdi/eng/driverobj.c b/win32ss/gdi/eng/driverobj.c index db2e8e3e39a..fff1ddad1b9 100644 --- a/win32ss/gdi/eng/driverobj.c +++ b/win32ss/gdi/eng/driverobj.c @@ -19,8 +19,9 @@ /*! * \brief DRIVEROBJ cleanup function */ -BOOL NTAPI -DRIVEROBJ_Cleanup(PVOID pObject) +VOID +NTAPI +DRIVEROBJ_vCleanup(PVOID pObject) { PEDRIVEROBJ pedo = pObject; FREEOBJPROC pFreeProc; @@ -28,10 +29,8 @@ DRIVEROBJ_Cleanup(PVOID pObject) pFreeProc = pedo->drvobj.pFreeProc; if (pFreeProc) { - return pFreeProc(pedo->drvobj.pvObj); + NT_VERIFY(pFreeProc(pedo->drvobj.pvObj)); } - - return TRUE; } /** Public interface **********************************************************/ diff --git a/win32ss/gdi/eng/driverobj.h b/win32ss/gdi/eng/driverobj.h index 25961e461ad..254a0cfec30 100644 --- a/win32ss/gdi/eng/driverobj.h +++ b/win32ss/gdi/eng/driverobj.h @@ -11,7 +11,7 @@ typedef struct _EDRIVEROBJ typedef DRIVEROBJ *PDRIVEROBJ; /* Cleanup function */ -BOOL NTAPI DRIVEROBJ_Cleanup(PVOID pObject); +VOID NTAPI DRIVEROBJ_vCleanup(PVOID pObject); #define DRIVEROBJ_AllocObjectWithHandle() ((PEDRIVEROBJ)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_DRIVEROBJ, sizeof(EDRIVEROBJ))) diff --git a/win32ss/gdi/eng/floatobj.h b/win32ss/gdi/eng/floatobj.h index 91fe93e399b..8101c5fdb33 100644 --- a/win32ss/gdi/eng/floatobj.h +++ b/win32ss/gdi/eng/floatobj.h @@ -63,8 +63,8 @@ extern const FLOATOBJ gef16; #define FLOATOBJ_16 {0x40000000, 0x00000006} #define FLOATOBJ_1_16 {0x40000000, 0xfffffffe} -#define FLOATOBJ_Set0(fo) (fo)->ul1 = 0; (fo)->ul2 = 0; -#define FLOATOBJ_Set1(fo) (fo)->ul1 = 0x40000000; (fo)->ul2 = 2; +#define FLOATOBJ_Set0(fo) do { (fo)->ul1 = 0; (fo)->ul2 = 0; } while (0) +#define FLOATOBJ_Set1(fo) do { (fo)->ul1 = 0x40000000; (fo)->ul2 = 2; } while (0) #else diff --git a/win32ss/gdi/eng/ldevobj.c b/win32ss/gdi/eng/ldevobj.c index ff1927d4ebc..2dcac3fb704 100644 --- a/win32ss/gdi/eng/ldevobj.c +++ b/win32ss/gdi/eng/ldevobj.c @@ -382,7 +382,7 @@ EngLoadImageEx( if (pldev->pGdiDriverInfo) { /* Check for match (case insensative) */ - if (RtlEqualUnicodeString(&pldev->pGdiDriverInfo->DriverName, &strDriverName, 1)) + if (RtlEqualUnicodeString(&pldev->pGdiDriverInfo->DriverName, &strDriverName, TRUE)) { /* Image found in LDEV list */ break; diff --git a/win32ss/gdi/eng/surface.c b/win32ss/gdi/eng/surface.c index 364fa226e9c..4f34a616898 100644 --- a/win32ss/gdi/eng/surface.c +++ b/win32ss/gdi/eng/surface.c @@ -62,9 +62,9 @@ BitmapFormat(ULONG cBits, ULONG iCompression) } } -BOOL +VOID NTAPI -SURFACE_Cleanup(PVOID ObjectBody) +SURFACE_vCleanup(PVOID ObjectBody) { PSURFACE psurf = (PSURFACE)ObjectBody; PVOID pvBits = psurf->SurfObj.pvBits; @@ -108,8 +108,6 @@ SURFACE_Cleanup(PVOID ObjectBody) { PALETTE_ShareUnlockPalette(psurf->ppal); } - - return TRUE; } diff --git a/win32ss/gdi/eng/surface.h b/win32ss/gdi/eng/surface.h index 2ab6037f947..99c70e723c8 100644 --- a/win32ss/gdi/eng/surface.h +++ b/win32ss/gdi/eng/surface.h @@ -111,9 +111,9 @@ ULONG FASTCALL BitmapFormat(ULONG cBits, ULONG iCompression); -BOOL +VOID NTAPI -SURFACE_Cleanup(PVOID ObjectBody); +SURFACE_vCleanup(PVOID ObjectBody); PSURFACE NTAPI diff --git a/win32ss/gdi/gdi32/misc/gdientry.c b/win32ss/gdi/gdi32/misc/gdientry.c index ac6545a28eb..8f37312bd37 100644 --- a/win32ss/gdi/gdi32/misc/gdientry.c +++ b/win32ss/gdi/gdi32/misc/gdientry.c @@ -1029,7 +1029,7 @@ DdGetDriverInfo(LPDDHAL_GETDRIVERINFODATA pData) pData->dwFlags = pDrvInfoData.dwFlags; pUserColorControl->dwSize = DDCOLORCONTROLCALLBACKSSIZE; - pUserColorControl->dwFlags = pUserColorControl->dwFlags; + pUserColorControl->dwFlags = pColorControl.dwFlags; if (pColorControl.ColorControl != NULL) { diff --git a/win32ss/gdi/ntgdi/bitblt.c b/win32ss/gdi/ntgdi/bitblt.c index a567290dbda..e27c5e239b3 100644 --- a/win32ss/gdi/ntgdi/bitblt.c +++ b/win32ss/gdi/ntgdi/bitblt.c @@ -47,6 +47,12 @@ NtGdiAlphaBlend( return FALSE; } + if ((hDCDest == NULL) || (hDCSrc == NULL)) + { + EngSetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + TRACE("Locking DCs\n"); ahDC[0] = hDCDest; ahDC[1] = hDCSrc ; @@ -161,14 +167,14 @@ NtGdiBitBlt( return NtGdiStretchBlt(hDCDest, XDest, YDest, - Width, + Width, Height, hDCSrc, XSrc, YSrc, Width, Height, - ROP, + ROP, crBackColor); dwTRop = ROP & ~(NOMIRRORBITMAP|CAPTUREBLT); @@ -213,6 +219,12 @@ NtGdiTransparentBlt( BOOL Ret = FALSE; EXLATEOBJ exlo; + if ((hdcDst == NULL) || (hdcSrc == NULL)) + { + EngSetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + TRACE("Locking DCs\n"); ahDC[0] = hdcDst; ahDC[1] = hdcSrc ; diff --git a/win32ss/gdi/ntgdi/brush.c b/win32ss/gdi/ntgdi/brush.c index ec40791e08e..b079a288046 100644 --- a/win32ss/gdi/ntgdi/brush.c +++ b/win32ss/gdi/ntgdi/brush.c @@ -114,9 +114,9 @@ BRUSH_vFreeBrushAttr(PBRUSH pbr) pbr->pBrushAttr = &pbr->BrushAttr; } -BOOL +VOID NTAPI -BRUSH_Cleanup(PVOID ObjectBody) +BRUSH_vCleanup(PVOID ObjectBody) { PBRUSH pbrush = (PBRUSH)ObjectBody; if (pbrush->hbmPattern) @@ -136,8 +136,6 @@ BRUSH_Cleanup(PVOID ObjectBody) { ExFreePool(pbrush->pStyle); } - - return TRUE; } INT diff --git a/win32ss/gdi/ntgdi/brush.h b/win32ss/gdi/ntgdi/brush.h index 79a2e0edf83..fe6cf34082c 100644 --- a/win32ss/gdi/ntgdi/brush.h +++ b/win32ss/gdi/ntgdi/brush.h @@ -94,7 +94,7 @@ typedef struct _EBRUSHOBJ #define BRUSH_ShareUnlockBrush(pBrush) GDIOBJ_vDereferenceObject((POBJ)pBrush) INT FASTCALL BRUSH_GetObject (PBRUSH GdiObject, INT Count, LPLOGBRUSH Buffer); -BOOL NTAPI BRUSH_Cleanup(PVOID ObjectBody); +VOID NTAPI BRUSH_vCleanup(PVOID ObjectBody); extern HSURF gahsurfHatch[HS_DDI_MAX]; diff --git a/win32ss/gdi/ntgdi/dc.h b/win32ss/gdi/ntgdi/dc.h index a1a11701cf9..a65e7a3d64c 100644 --- a/win32ss/gdi/ntgdi/dc.h +++ b/win32ss/gdi/ntgdi/dc.h @@ -194,7 +194,7 @@ INIT_FUNCTION NTSTATUS NTAPI InitDcImpl(VOID); PPDEVOBJ FASTCALL IntEnumHDev(VOID); PDC NTAPI DC_AllocDcWithHandle(VOID); BOOL NTAPI DC_bAllocDcAttr(PDC pdc); -BOOL NTAPI DC_Cleanup(PVOID ObjectBody); +VOID NTAPI DC_vCleanup(PVOID ObjectBody); BOOL FASTCALL IntGdiDeleteDC(HDC, BOOL); BOOL FASTCALL DC_InvertXform(const XFORM *xformSrc, XFORM *xformDest); diff --git a/win32ss/gdi/ntgdi/dclife.c b/win32ss/gdi/ntgdi/dclife.c index 16a628a4998..3a8a35954db 100644 --- a/win32ss/gdi/ntgdi/dclife.c +++ b/win32ss/gdi/ntgdi/dclife.c @@ -344,9 +344,9 @@ DC_vInitDc( } } -BOOL +VOID NTAPI -DC_Cleanup(PVOID ObjectBody) +DC_vCleanup(PVOID ObjectBody) { PDC pdc = (PDC)ObjectBody; @@ -391,8 +391,6 @@ DC_Cleanup(PVOID ObjectBody) SURFACE_ShareUnlockSurface(pdc->dclevel.pSurface); PDEVOBJ_vRelease(pdc->ppdev) ; - - return TRUE; } VOID diff --git a/win32ss/gdi/ntgdi/freetype.c b/win32ss/gdi/ntgdi/freetype.c index c30b46b038d..5ac3b60af37 100644 --- a/win32ss/gdi/ntgdi/freetype.c +++ b/win32ss/gdi/ntgdi/freetype.c @@ -19,6 +19,8 @@ #include #include +#include + #define NDEBUG #include @@ -3228,6 +3230,7 @@ GreExtTextOutW( USHORT DxShift; PMATRIX pmxWorldToDevice; LONG fixAscender, fixDescender; + FLOATOBJ Scale; // TODO: Write test-cases to exactly match real Windows in different // bad parameters (e.g. does Windows check the DC or the RECT first?). @@ -3671,8 +3674,13 @@ GreExtTextOutW( } else { - TextLeft += Dx[i<mxWorldToDevice.efM11; + if (_FLOATOBJ_Equal0(&Scale)) + FLOATOBJ_Set1(&Scale); + + FLOATOBJ_MulLong(&Scale, Dx[i<IndexedColors && pPal->IndexedColors != pPal->apalColors) { ExFreePoolWithTag(pPal->IndexedColors, TAG_PALETTE); } - - return TRUE; } INT @@ -702,15 +700,15 @@ NtGdiGetNearestColor( EngSetLastError(ERROR_INVALID_HANDLE); return CLR_INVALID; } - + if(dc->dclevel.pSurface == NULL) ppal = gppalMono; else ppal = dc->dclevel.pSurface->ppal; - + /* Translate the color to the DC format */ Color = TranslateCOLORREF(dc, Color); - + /* XLATE it back to RGB color space */ EXLATEOBJ_vInitialize(&exlo, ppal, @@ -718,11 +716,11 @@ NtGdiGetNearestColor( 0, RGB(0xff, 0xff, 0xff), RGB(0, 0, 0)); - + nearest = XLATEOBJ_iXlate(&exlo.xlo, Color); - + EXLATEOBJ_vCleanup(&exlo); - + /* We're done */ DC_UnlockDc(dc); @@ -771,7 +769,7 @@ IntGdiRealizePalette(HDC hDC) { goto cleanup; } - + if(pdc->dctype == DCTYPE_DIRECT) { UNIMPLEMENTED; diff --git a/win32ss/gdi/ntgdi/palette.h b/win32ss/gdi/ntgdi/palette.h index 3dd16dbb271..4dd591d80db 100644 --- a/win32ss/gdi/ntgdi/palette.h +++ b/win32ss/gdi/ntgdi/palette.h @@ -117,9 +117,9 @@ PALETTE_vGetBitMasks( PPALETTE ppal, PULONG pulColors); -BOOL +VOID NTAPI -PALETTE_Cleanup(PVOID ObjectBody); +PALETTE_vCleanup(PVOID ObjectBody); FORCEINLINE ULONG diff --git a/win32ss/gdi/ntgdi/patblt.c b/win32ss/gdi/ntgdi/patblt.c deleted file mode 100644 index b809395f3eb..00000000000 --- a/win32ss/gdi/ntgdi/patblt.c +++ /dev/null @@ -1,972 +0,0 @@ -/* - * COPYRIGHT: GNU GPL, See COPYING in the top level directory - * PROJECT: ReactOS kernel - * PURPOSE: Bit blit functions - * FILE: subsys/win32k/objects/bitblt.c - * PROGRAMER: Unknown - */ - -#include - -#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( - HDC hDCDest, - LONG XOriginDest, - LONG YOriginDest, - LONG WidthDest, - LONG HeightDest, - HDC hDCSrc, - LONG XOriginSrc, - LONG YOriginSrc, - LONG WidthSrc, - LONG HeightSrc, - BLENDFUNCTION BlendFunc, - HANDLE hcmXform) -{ - PDC DCDest; - PDC DCSrc; - HDC ahDC[2]; - PGDIOBJ apObj[2]; - SURFACE *BitmapDest, *BitmapSrc; - RECTL DestRect, SourceRect; - BOOL bResult; - EXLATEOBJ exlo; - BLENDOBJ BlendObj; - BlendObj.BlendFunction = BlendFunc; - - if (WidthDest < 0 || HeightDest < 0 || WidthSrc < 0 || HeightSrc < 0) - { - EngSetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - - DPRINT("Locking DCs\n"); - ahDC[0] = hDCDest; - ahDC[1] = hDCSrc ; - if (!GDIOBJ_bLockMultipleObjects(2, ahDC, apObj, GDIObjType_DC_TYPE)) - { - DPRINT1("Invalid dc handle (dest=0x%08x, src=0x%08x) passed to NtGdiAlphaBlend\n", hDCDest, hDCSrc); - EngSetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - DCDest = apObj[0]; - DCSrc = apObj[1]; - - if (DCDest->dctype == DC_TYPE_INFO || DCDest->dctype == DCTYPE_INFO) - { - GDIOBJ_vUnlockObject(&DCSrc->BaseObject); - GDIOBJ_vUnlockObject(&DCDest->BaseObject); - /* Yes, Windows really returns TRUE in this case */ - return TRUE; - } - - DestRect.left = XOriginDest; - DestRect.top = YOriginDest; - DestRect.right = XOriginDest + WidthDest; - DestRect.bottom = YOriginDest + HeightDest; - 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; - - SourceRect.left = XOriginSrc; - SourceRect.top = YOriginSrc; - SourceRect.right = XOriginSrc + WidthSrc; - SourceRect.bottom = YOriginSrc + HeightSrc; - IntLPtoDP(DCSrc, (LPPOINT)&SourceRect, 2); - - SourceRect.left += DCSrc->ptlDCOrig.x; - SourceRect.top += DCSrc->ptlDCOrig.y; - SourceRect.right += DCSrc->ptlDCOrig.x; - SourceRect.bottom += DCSrc->ptlDCOrig.y; - - if (!DestRect.right || - !DestRect.bottom || - !SourceRect.right || - !SourceRect.bottom) - { - GDIOBJ_vUnlockObject(&DCSrc->BaseObject); - GDIOBJ_vUnlockObject(&DCDest->BaseObject); - return TRUE; - } - - /* Prepare DCs for blit */ - DPRINT("Preparing DCs for blit\n"); - DC_vPrepareDCsForBlit(DCDest, DestRect, DCSrc, SourceRect); - - /* Determine surfaces to be used in the bitblt */ - BitmapDest = DCDest->dclevel.pSurface; - if (!BitmapDest) - { - bResult = FALSE ; - goto leave ; - } - - BitmapSrc = DCSrc->dclevel.pSurface; - if (!BitmapSrc) - { - bResult = FALSE; - goto leave; - } - - /* Create the XLATEOBJ. */ - EXLATEOBJ_vInitXlateFromDCs(&exlo, DCSrc, DCDest); - - /* Perform the alpha blend operation */ - DPRINT("Performing the alpha blend\n"); - bResult = IntEngAlphaBlend(&BitmapDest->SurfObj, - &BitmapSrc->SurfObj, - DCDest->rosdc.CombinedClip, - &exlo.xlo, - &DestRect, - &SourceRect, - &BlendObj); - - EXLATEOBJ_vCleanup(&exlo); -leave : - DPRINT("Finishing blit\n"); - DC_vFinishBlit(DCDest, DCSrc); - GDIOBJ_vUnlockObject(&DCSrc->BaseObject); - GDIOBJ_vUnlockObject(&DCDest->BaseObject); - - return bResult; -} - -BOOL APIENTRY -NtGdiBitBlt( - HDC hDCDest, - INT XDest, - INT YDest, - INT Width, - INT Height, - HDC hDCSrc, - INT XSrc, - INT YSrc, - DWORD ROP, - IN DWORD crBackColor, - IN FLONG fl) -{ - /* 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 -NtGdiTransparentBlt( - HDC hdcDst, - INT xDst, - INT yDst, - INT cxDst, - INT cyDst, - HDC hdcSrc, - INT xSrc, - INT ySrc, - INT cxSrc, - INT cySrc, - COLORREF TransColor) -{ - PDC DCDest, DCSrc; - HDC ahDC[2]; - PGDIOBJ apObj[2]; - RECTL rcDest, rcSrc; - SURFACE *BitmapDest, *BitmapSrc = NULL; - ULONG TransparentColor = 0; - BOOL Ret = FALSE; - EXLATEOBJ exlo; - - DPRINT("Locking DCs\n"); - ahDC[0] = hdcDst; - ahDC[1] = hdcSrc ; - if (!GDIOBJ_bLockMultipleObjects(2, ahDC, apObj, GDIObjType_DC_TYPE)) - { - DPRINT1("Invalid dc handle (dest=0x%08x, src=0x%08x) passed to NtGdiAlphaBlend\n", hdcDst, hdcSrc); - EngSetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - DCDest = apObj[0]; - DCSrc = apObj[1]; - - if (DCDest->dctype == DC_TYPE_INFO || DCDest->dctype == DCTYPE_INFO) - { - GDIOBJ_vUnlockObject(&DCSrc->BaseObject); - GDIOBJ_vUnlockObject(&DCDest->BaseObject); - /* Yes, Windows really returns TRUE in this case */ - return TRUE; - } - - rcDest.left = xDst; - rcDest.top = yDst; - rcDest.right = rcDest.left + cxDst; - rcDest.bottom = rcDest.top + cyDst; - IntLPtoDP(DCDest, (LPPOINT)&rcDest, 2); - - rcDest.left += DCDest->ptlDCOrig.x; - rcDest.top += DCDest->ptlDCOrig.y; - rcDest.right += DCDest->ptlDCOrig.x; - rcDest.bottom += DCDest->ptlDCOrig.y; - - rcSrc.left = xSrc; - rcSrc.top = ySrc; - rcSrc.right = rcSrc.left + cxSrc; - rcSrc.bottom = rcSrc.top + cySrc; - IntLPtoDP(DCSrc, (LPPOINT)&rcSrc, 2); - - rcSrc.left += DCSrc->ptlDCOrig.x; - rcSrc.top += DCSrc->ptlDCOrig.y; - rcSrc.right += DCSrc->ptlDCOrig.x; - rcSrc.bottom += DCSrc->ptlDCOrig.y; - - /* Prepare for blit */ - DC_vPrepareDCsForBlit(DCDest, rcDest, DCSrc, rcSrc); - - BitmapDest = DCDest->dclevel.pSurface; - if (!BitmapDest) - { - goto done; - } - - BitmapSrc = DCSrc->dclevel.pSurface; - if (!BitmapSrc) - { - goto done; - } - - /* Translate Transparent (RGB) Color to the source palette */ - EXLATEOBJ_vInitialize(&exlo, &gpalRGB, BitmapSrc->ppal, 0, 0, 0); - TransparentColor = XLATEOBJ_iXlate(&exlo.xlo, (ULONG)TransColor); - EXLATEOBJ_vCleanup(&exlo); - - EXLATEOBJ_vInitXlateFromDCs(&exlo, DCSrc, DCDest); - - Ret = IntEngTransparentBlt(&BitmapDest->SurfObj, &BitmapSrc->SurfObj, - DCDest->rosdc.CombinedClip, &exlo.xlo, &rcDest, &rcSrc, - TransparentColor, 0); - - EXLATEOBJ_vCleanup(&exlo); - -done: - DC_vFinishBlit(DCDest, DCSrc); - GDIOBJ_vUnlockObject(&DCDest->BaseObject); - GDIOBJ_vUnlockObject(&DCSrc->BaseObject); - - return Ret; -} - -BOOL APIENTRY -NtGdiMaskBlt( - HDC hdcDest, - INT nXDest, - INT nYDest, - INT nWidth, - INT nHeight, - HDC hdcSrc, - INT nXSrc, - INT nYSrc, - HBITMAP hbmMask, - INT xMask, - INT yMask, - DWORD dwRop, - IN DWORD crBackColor) -{ - 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; - - FIXUP_ROP(dwRop); - - UsesMask = ROP_USES_MASK(dwRop); - - //DPRINT1("dwRop : 0x%08x\n", dwRop); - if (!hdcDest || (UsesSource && !hdcSrc)) - { - EngSetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - - /* Take care of mask bitmap */ - if(hbmMask) - { - psurfMask = SURFACE_ShareLockSurface(hbmMask); - if(!psurfMask) - { - EngSetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - } - - if(UsesMask) - { - if(!psurfMask) - { - EngSetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - if(gajBitsPerFormat[psurfMask->SurfObj.iBitmapFormat] != 1) - { - EngSetLastError(ERROR_INVALID_PARAMETER); - SURFACE_ShareUnlockSurface(psurfMask); - return FALSE; - } - } - else if(psurfMask) - { - DPRINT1("Getting Mask bitmap without needing it?\n"); - SURFACE_ShareUnlockSurface(psurfMask); - psurfMask = NULL; - } - MaskPoint.x = xMask; - MaskPoint.y = yMask; - - /* Take care of source and destination bitmap */ - DPRINT("Locking DCs\n"); - ahDC[0] = hdcDest; - ahDC[1] = UsesSource ? hdcSrc : NULL; - if (!GDIOBJ_bLockMultipleObjects(2, ahDC, apObj, GDIObjType_DC_TYPE)) - { - DPRINT1("Invalid dc handle (dest=0x%08x, src=0x%08x) passed to NtGdiAlphaBlend\n", hdcDest, hdcSrc); - EngSetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - DCDest = apObj[0]; - DCSrc = apObj[1]; - - ASSERT(DCDest); - if (NULL == DCDest) - { - if(DCSrc) DC_UnlockDc(DCSrc); - DPRINT("Invalid destination dc handle (0x%08x) passed to NtGdiBitBlt\n", hdcDest); - return FALSE; - } - - if (DCDest->dctype == DC_TYPE_INFO) - { - if(DCSrc) DC_UnlockDc(DCSrc); - DC_UnlockDc(DCDest); - /* Yes, Windows really returns TRUE in this case */ - return TRUE; - } - - if (UsesSource) - { - ASSERT(DCSrc); - if (DCSrc->dctype == DC_TYPE_INFO) - { - DC_UnlockDc(DCDest); - DC_UnlockDc(DCSrc); - /* Yes, Windows really returns TRUE in this case */ - return TRUE; - } - } - - pdcattr = DCDest->pdcattr; - - DestRect.left = nXDest; - DestRect.top = nYDest; - DestRect.right = nXDest + nWidth; - DestRect.bottom = nYDest + nHeight; - 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 = nXSrc; - SourcePoint.y = nYSrc; - - 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, - 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_ShareUnlockSurface(psurfMask); - - return Status; -} - -BOOL -APIENTRY -NtGdiPlgBlt( - IN HDC hdcTrg, - IN LPPOINT pptlTrg, - IN HDC hdcSrc, - IN INT xSrc, - IN INT ySrc, - IN INT cxSrc, - IN INT cySrc, - IN HBITMAP hbmMask, - IN INT xMask, - IN INT yMask, - IN DWORD crBackColor) -{ - UNIMPLEMENTED; - return FALSE; -} - -BOOL APIENTRY -GreStretchBltMask( - HDC hDCDest, - INT XOriginDest, - INT YOriginDest, - INT WidthDest, - INT HeightDest, - HDC hDCSrc, - INT XOriginSrc, - INT YOriginSrc, - INT WidthSrc, - INT HeightSrc, - DWORD ROP, - IN DWORD dwBackColor, - HDC hDCMask, - INT XOriginMask, - INT YOriginMask) -{ - PDC DCDest; - PDC DCSrc = NULL; - PDC DCMask = NULL; - HDC ahDC[3]; - PGDIOBJ apObj[3]; - PDC_ATTR pdcattr; - SURFACE *BitmapDest, *BitmapSrc = NULL; - SURFACE *BitmapMask = NULL; - RECTL DestRect; - RECTL SourceRect; - POINTL MaskPoint; - BOOL Status = FALSE; - EXLATEOBJ exlo; - XLATEOBJ *XlateObj = NULL; - POINTL BrushOrigin; - BOOL UsesSource; - BOOL UsesMask; - - FIXUP_ROP(ROP); - UsesSource = ROP_USES_SOURCE(ROP); - UsesMask = ROP_USES_MASK(ROP); - - if (0 == WidthDest || 0 == HeightDest || 0 == WidthSrc || 0 == HeightSrc) - { - EngSetLastError(ERROR_INVALID_PARAMETER); - return TRUE; - } - - if (!hDCDest || (UsesSource && !hDCSrc) || (UsesMask && !hDCMask)) - { - EngSetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - - ahDC[0] = hDCDest; - ahDC[1] = UsesSource ? hDCSrc : NULL; - ahDC[2] = UsesMask ? hDCMask : NULL; - if (!GDIOBJ_bLockMultipleObjects(3, ahDC, apObj, GDIObjType_DC_TYPE)) - { - DPRINT1("Invalid dc handle (dest=0x%08x, src=0x%08x) passed to NtGdiAlphaBlend\n", hDCDest, hDCSrc); - EngSetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - DCDest = apObj[0]; - DCSrc = apObj[1]; - DCMask = apObj[2]; - - if (DCDest->dctype == DC_TYPE_INFO) - { - if(DCSrc) GDIOBJ_vUnlockObject(&DCSrc->BaseObject); - if(DCMask) GDIOBJ_vUnlockObject(&DCMask->BaseObject); - GDIOBJ_vUnlockObject(&DCDest->BaseObject); - /* Yes, Windows really returns TRUE in this case */ - return TRUE; - } - - if (UsesSource) - { - if (DCSrc->dctype == DC_TYPE_INFO) - { - GDIOBJ_vUnlockObject(&DCDest->BaseObject); - GDIOBJ_vUnlockObject(&DCSrc->BaseObject); - if(DCMask) GDIOBJ_vUnlockObject(&DCMask->BaseObject); - /* Yes, Windows really returns TRUE in this case */ - return TRUE; - } - } - - pdcattr = DCDest->pdcattr; - - DestRect.left = XOriginDest; - DestRect.top = YOriginDest; - DestRect.right = XOriginDest+WidthDest; - DestRect.bottom = YOriginDest+HeightDest; - 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; - - SourceRect.left = XOriginSrc; - SourceRect.top = YOriginSrc; - SourceRect.right = XOriginSrc+WidthSrc; - SourceRect.bottom = YOriginSrc+HeightSrc; - - if (UsesSource) - { - IntLPtoDP(DCSrc, (LPPOINT)&SourceRect, 2); - - SourceRect.left += DCSrc->ptlDCOrig.x; - SourceRect.top += DCSrc->ptlDCOrig.y; - SourceRect.right += DCSrc->ptlDCOrig.x; - SourceRect.bottom += DCSrc->ptlDCOrig.y; - } - - BrushOrigin.x = 0; - BrushOrigin.y = 0; - - /* Only prepare Source and Dest, hdcMask represents a DIB */ - 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 == NULL) - goto failed; - if (UsesSource) - { - BitmapSrc = DCSrc->dclevel.pSurface; - if (BitmapSrc == NULL) - goto failed; - - /* Create the XLATEOBJ. */ - EXLATEOBJ_vInitXlateFromDCs(&exlo, DCSrc, DCDest); - XlateObj = &exlo.xlo; - } - - /* Offset the brush */ - BrushOrigin.x += DCDest->ptlDCOrig.x; - BrushOrigin.y += DCDest->ptlDCOrig.y; - - /* Make mask surface for source surface */ - if (BitmapSrc && DCMask) - { - BitmapMask = DCMask->dclevel.pSurface; - if (BitmapMask && - (BitmapMask->SurfObj.sizlBitmap.cx < WidthSrc || - BitmapMask->SurfObj.sizlBitmap.cy < HeightSrc)) - { - DPRINT1("%dx%d mask is smaller than %dx%d bitmap\n", - BitmapMask->SurfObj.sizlBitmap.cx, BitmapMask->SurfObj.sizlBitmap.cy, - WidthSrc, HeightSrc); - EXLATEOBJ_vCleanup(&exlo); - goto failed; - } - /* Create mask offset point */ - MaskPoint.x = XOriginMask; - MaskPoint.y = YOriginMask; - IntLPtoDP(DCMask, &MaskPoint, 1); - MaskPoint.x += DCMask->ptlDCOrig.x; - MaskPoint.y += DCMask->ptlDCOrig.y; - } - - /* Perform the bitblt operation */ - Status = IntEngStretchBlt(&BitmapDest->SurfObj, - &BitmapSrc->SurfObj, - BitmapMask ? &BitmapMask->SurfObj : NULL, - DCDest->rosdc.CombinedClip, - XlateObj, - &DestRect, - &SourceRect, - BitmapMask ? &MaskPoint : NULL, - &DCDest->eboFill.BrushObject, - &BrushOrigin, - ROP_TO_ROP4(ROP)); - if (UsesSource) - { - EXLATEOBJ_vCleanup(&exlo); - } - -failed: - DC_vFinishBlit(DCDest, DCSrc); - if (UsesSource) - { - DC_UnlockDc(DCSrc); - } - if (DCMask) - { - DC_UnlockDc(DCMask); - } - DC_UnlockDc(DCDest); - - return Status; -} - - -BOOL APIENTRY -NtGdiStretchBlt( - HDC hDCDest, - INT XOriginDest, - INT YOriginDest, - INT WidthDest, - INT HeightDest, - HDC hDCSrc, - INT XOriginSrc, - INT YOriginSrc, - INT WidthSrc, - INT HeightSrc, - DWORD ROP, - IN DWORD dwBackColor) -{ - return GreStretchBltMask( - hDCDest, - XOriginDest, - YOriginDest, - WidthDest, - HeightDest, - hDCSrc, - XOriginSrc, - YOriginSrc, - WidthSrc, - HeightSrc, - ROP, - dwBackColor, - NULL, - 0, - 0); -} - - -BOOL FASTCALL -IntPatBlt( - PDC pdc, - INT XLeft, - INT YLeft, - INT Width, - INT Height, - DWORD dwRop, - PBRUSH pbrush) -{ - RECTL DestRect; - SURFACE *psurf; - EBRUSHOBJ eboFill ; - POINTL BrushOrigin; - BOOL ret; - - ASSERT(pbrush); - - FIXUP_ROP(dwRop); - - if (pbrush->flAttrs & GDIBRUSH_IS_NULL) - { - return TRUE; - } - - if (Width > 0) - { - DestRect.left = XLeft; - DestRect.right = XLeft + Width; - } - else - { - DestRect.left = XLeft + Width + 1; - DestRect.right = XLeft + 1; - } - - if (Height > 0) - { - DestRect.top = YLeft; - DestRect.bottom = YLeft + Height; - } - else - { - DestRect.top = YLeft + Height + 1; - DestRect.bottom = YLeft + 1; - } - - IntLPtoDP(pdc, (LPPOINT)&DestRect, 2); - - DestRect.left += pdc->ptlDCOrig.x; - DestRect.top += pdc->ptlDCOrig.y; - DestRect.right += pdc->ptlDCOrig.x; - DestRect.bottom += pdc->ptlDCOrig.y; -#ifdef _USE_DIBLIB_ - BrushOrigin.x = pbrush->ptOrigin.x + pdc->ptlDCOrig.x + XLeft; - BrushOrigin.y = pbrush->ptOrigin.y + pdc->ptlDCOrig.y + YLeft; -#else - BrushOrigin.x = pbrush->ptOrigin.x + pdc->ptlDCOrig.x; - BrushOrigin.y = pbrush->ptOrigin.y + pdc->ptlDCOrig.y; -#endif - - DC_vPrepareDCsForBlit(pdc, DestRect, NULL, DestRect); - - psurf = pdc->dclevel.pSurface; - - if (pdc->pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY)) - DC_vUpdateFillBrush(pdc); - - EBRUSHOBJ_vInit(&eboFill, pbrush, pdc); - - ret = IntEngBitBlt( - &psurf->SurfObj, - NULL, - NULL, - pdc->rosdc.CombinedClip, - NULL, - &DestRect, - NULL, - NULL, - &eboFill.BrushObject, - &BrushOrigin, - ROP_TO_ROP4(dwRop)); - - DC_vFinishBlit(pdc, NULL); - - EBRUSHOBJ_vCleanup(&eboFill); - - return ret; -} - -BOOL FASTCALL -IntGdiPolyPatBlt( - HDC hDC, - DWORD dwRop, - PPATRECT pRects, - INT cRects, - ULONG Reserved) -{ - INT i; - PBRUSH pbrush; - PDC pdc; - - pdc = DC_LockDc(hDC); - if (!pdc) - { - EngSetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - - if (pdc->dctype == DC_TYPE_INFO) - { - DC_UnlockDc(pdc); - /* Yes, Windows really returns TRUE in this case */ - return TRUE; - } - - for (i = 0; i < cRects; i++) - { - pbrush = BRUSH_ShareLockBrush(pRects->hBrush); - if(pbrush != NULL) - { - IntPatBlt( - pdc, - pRects->r.left, - pRects->r.top, - pRects->r.right, - pRects->r.bottom, - dwRop, - pbrush); - BRUSH_ShareUnlockBrush(pbrush); - } - pRects++; - } - - DC_UnlockDc(pdc); - - return TRUE; -} - -BOOL APIENTRY -NtGdiPatBlt( - HDC hDC, - INT XLeft, - INT YLeft, - INT Width, - INT Height, - DWORD ROP) -{ - PBRUSH pbrush; - DC *dc; - PDC_ATTR pdcattr; - BOOL ret; - - BOOL UsesSource = ROP_USES_SOURCE(ROP); - if (UsesSource) - { - /* In this case we call on GdiMaskBlt */ - return NtGdiMaskBlt(hDC, XLeft, YLeft, Width, Height, 0,0,0,0,0,0,ROP,0); - } - - dc = DC_LockDc(hDC); - if (dc == NULL) - { - EngSetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - if (dc->dctype == DC_TYPE_INFO) - { - DC_UnlockDc(dc); - DPRINT1("NtGdiPatBlt on info DC!\n"); - /* Yes, Windows really returns TRUE in this case */ - return TRUE; - } - - pdcattr = dc->pdcattr; - - if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY)) - DC_vUpdateFillBrush(dc); - - pbrush = BRUSH_ShareLockBrush(pdcattr->hbrush); - if (pbrush == NULL) - { - EngSetLastError(ERROR_INVALID_HANDLE); - DC_UnlockDc(dc); - return FALSE; - } - - ret = IntPatBlt(dc, XLeft, YLeft, Width, Height, ROP, pbrush); - - BRUSH_ShareUnlockBrush(pbrush); - DC_UnlockDc(dc); - - return ret; -} - -BOOL APIENTRY -NtGdiPolyPatBlt( - HDC hDC, - DWORD dwRop, - IN PPOLYPATBLT pRects, - IN DWORD cRects, - IN DWORD Mode) -{ - PPATRECT rb = NULL; - NTSTATUS Status = STATUS_SUCCESS; - BOOL Ret; - - if (cRects > 0) - { - rb = ExAllocatePoolWithTag(PagedPool, sizeof(PATRECT) * cRects, GDITAG_PLGBLT_DATA); - if (!rb) - { - EngSetLastError(ERROR_NOT_ENOUGH_MEMORY); - return FALSE; - } - _SEH2_TRY - { - ProbeForRead(pRects, - cRects * sizeof(PATRECT), - 1); - RtlCopyMemory(rb, - pRects, - cRects * sizeof(PATRECT)); - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - Status = _SEH2_GetExceptionCode(); - } - _SEH2_END; - - if (!NT_SUCCESS(Status)) - { - ExFreePoolWithTag(rb, GDITAG_PLGBLT_DATA); - SetLastNtError(Status); - return FALSE; - } - } - - Ret = IntGdiPolyPatBlt(hDC, dwRop, rb, cRects, Mode); - - if (cRects > 0) - ExFreePoolWithTag(rb, GDITAG_PLGBLT_DATA); - - return Ret; -} diff --git a/win32ss/gdi/ntgdi/region.c b/win32ss/gdi/ntgdi/region.c index d1cf0671f13..ce79722837c 100644 --- a/win32ss/gdi/ntgdi/region.c +++ b/win32ss/gdi/ntgdi/region.c @@ -2275,8 +2275,8 @@ IntSysCreateRectRgn(INT LeftRect, INT TopRect, INT RightRect, INT BottomRect) return hrgn; } -BOOL NTAPI -REGION_Cleanup(PVOID ObjectBody) +VOID NTAPI +REGION_vCleanup(PVOID ObjectBody) { PROSRGNDATA pRgn = (PROSRGNDATA)ObjectBody; PPROCESSINFO ppi = PsGetCurrentProcessWin32Process(); @@ -2288,7 +2288,6 @@ REGION_Cleanup(PVOID ObjectBody) if (pRgn->Buffer && pRgn->Buffer != &pRgn->rdh.rcBound) ExFreePoolWithTag(pRgn->Buffer, TAG_REGION); - return TRUE; } VOID FASTCALL diff --git a/win32ss/gdi/ntgdi/region.h b/win32ss/gdi/ntgdi/region.h index 778dd294d91..b11f31da8ee 100644 --- a/win32ss/gdi/ntgdi/region.h +++ b/win32ss/gdi/ntgdi/region.h @@ -29,7 +29,7 @@ INT FASTCALL REGION_GetRgnBox(PROSRGNDATA Rgn, RECTL *pRect); BOOL FASTCALL REGION_RectInRegion(PROSRGNDATA Rgn, const RECTL *rc); BOOL FASTCALL REGION_CropAndOffsetRegion(PROSRGNDATA rgnDst, PROSRGNDATA rgnSrc, const RECTL *rect, const POINT *off); VOID FASTCALL REGION_SetRectRgn(PROSRGNDATA pRgn, INT LeftRect, INT TopRect, INT RightRect, INT BottomRect); -BOOL NTAPI REGION_Cleanup(PVOID ObjectBody); +VOID NTAPI REGION_vCleanup(PVOID ObjectBody); extern PROSRGNDATA prgnDefault; extern HRGN hrgnDefault; diff --git a/win32ss/include/ntuser.h b/win32ss/include/ntuser.h index fb39f5ab11d..3a80945126a 100644 --- a/win32ss/include/ntuser.h +++ b/win32ss/include/ntuser.h @@ -70,7 +70,6 @@ typedef enum _USERTHREADINFOCLASS UserThreadWOWInformation, UserThreadHungStatus, UserThreadInitiateShutdown, - UserThreadEndShutdown, UserThreadUseActiveDesktop, UserThreadUseDesktop, @@ -306,6 +305,9 @@ C_ASSERT(sizeof(CLIENTINFO) <= sizeof(((PTEB)0)->Win32ClientInfo)); /* Menu Item fType. */ #define MFT_RTOL 0x6000 +/* Menu Item fState. */ +#define MFS_HBMMENUBMP 0x20000000 + typedef struct tagITEM { UINT fType; @@ -345,6 +347,8 @@ typedef struct tagMENULIST #define MNF_DESKTOPMN 0x0040 #define MNF_SYSDESKMN 0x0080 #define MNF_SYSSUBMENU 0x0100 +// Hack +#define MNF_SYSMENU 0x0200 typedef struct tagMENU { @@ -3380,7 +3384,6 @@ typedef struct tagKMDDELPARAM #define MSQ_STATE_MENUOWNER 0x4 #define MSQ_STATE_MOVESIZE 0x5 #define MSQ_STATE_CARET 0x6 -#define TWOPARAM_ROUTINE_SETCARETPOS 0xfffd0060 #define TWOPARAM_ROUTINE_ROS_UPDATEUISTATE 0x1004 #define HWNDPARAM_ROUTINE_ROS_NOTIFYWINEVENT 0x1005 diff --git a/win32ss/user/ntuser/desktop.c b/win32ss/user/ntuser/desktop.c index 384b47780fb..835af417c11 100644 --- a/win32ss/user/ntuser/desktop.c +++ b/win32ss/user/ntuser/desktop.c @@ -51,7 +51,7 @@ IntDesktopObjectParse(IN PVOID ParseObject, OBJECT_ATTRIBUTES ObjectAttributes; PLIST_ENTRY NextEntry, ListHead; PWINSTATION_OBJECT WinStaObject = (PWINSTATION_OBJECT)ParseObject; - PUNICODE_STRING DesktopName; + UNICODE_STRING DesktopName; PBOOLEAN pContext = (PBOOLEAN) Context; if(pContext) @@ -65,43 +65,40 @@ IntDesktopObjectParse(IN PVOID ParseObject, /* Get the current desktop */ Desktop = CONTAINING_RECORD(NextEntry, DESKTOP, ListEntry); - /// @todo Don't mess around with the object headers! - /* Get its name */ - _PRAGMA_WARNING_SUPPRESS(__WARNING_DEREF_NULL_PTR) - DesktopName = GET_DESKTOP_NAME(Desktop); - if (DesktopName) + /* Get the desktop name */ + ASSERT(Desktop->pDeskInfo != NULL); + RtlInitUnicodeString(&DesktopName, Desktop->pDeskInfo->szDesktopName); + + /* Compare the name */ + if (RtlEqualUnicodeString(RemainingName, + &DesktopName, + (Attributes & OBJ_CASE_INSENSITIVE) != 0)) { - /* Compare the name */ - if (RtlEqualUnicodeString(RemainingName, - DesktopName, - (Attributes & OBJ_CASE_INSENSITIVE))) + /* We found a match. Did this come from a create? */ + if (Context) { - /* We found a match. Did this come from a create? */ - if (Context) + /* Unless OPEN_IF was given, fail with an error */ + if (!(Attributes & OBJ_OPENIF)) { - /* Unless OPEN_IF was given, fail with an error */ - if (!(Attributes & OBJ_OPENIF)) - { - /* Name collision */ - return STATUS_OBJECT_NAME_COLLISION; - } - else - { - /* Otherwise, return with a warning only */ - Status = STATUS_OBJECT_NAME_EXISTS; - } + /* Name collision */ + return STATUS_OBJECT_NAME_COLLISION; } else { - /* This was a real open, so this is OK */ - Status = STATUS_SUCCESS; + /* Otherwise, return with a warning only */ + Status = STATUS_OBJECT_NAME_EXISTS; } - - /* Reference the desktop and return it */ - ObReferenceObject(Desktop); - *Object = Desktop; - return Status; } + else + { + /* This was a real open, so this is OK */ + Status = STATUS_SUCCESS; + } + + /* Reference the desktop and return it */ + ObReferenceObject(Desktop); + *Object = Desktop; + return Status; } /* Go to the next desktop */ @@ -522,7 +519,7 @@ IntSetFocusMessageQueue(PUSER_MESSAGE_QUEUE NewQueue) { gpqForeground = pdo->ActiveMessageQueue; } - else + else { gpqForeground = NULL; ERR("ptiLastInput is CLEARED!!\n"); diff --git a/win32ss/user/ntuser/desktop.h b/win32ss/user/ntuser/desktop.h index 56c721ae212..cdf160fc0ab 100644 --- a/win32ss/user/ntuser/desktop.h +++ b/win32ss/user/ntuser/desktop.h @@ -10,6 +10,11 @@ typedef struct _DESKTOP /* Pointer to the associated window station. */ struct _WINSTATION_OBJECT *rpwinstaParent; DWORD dwDTFlags; + DWORD_PTR dwDesktopId; + PMENU spmenuSys; + PMENU spmenuDialogSys; + PMENU spmenuHScroll; + PMENU spmenuVScroll; PWND spwndForeground; PWND spwndTray; PWND spwndMessage; @@ -174,11 +179,6 @@ HDC FASTCALL UserGetDesktopDC(ULONG,BOOL,BOOL); #define IntIsActiveDesktop(Desktop) \ ((Desktop)->rpwinstaParent->ActiveDesktop == (Desktop)) -#define GET_DESKTOP_NAME(d) \ - OBJECT_HEADER_TO_NAME_INFO(OBJECT_TO_OBJECT_HEADER(d)) ? \ - &(OBJECT_HEADER_TO_NAME_INFO(OBJECT_TO_OBJECT_HEADER(d))->Name) : \ - NULL - HWND FASTCALL IntGetMessageWindow(VOID); PWND FASTCALL UserGetMessageWindow(VOID); diff --git a/win32ss/user/ntuser/focus.c b/win32ss/user/ntuser/focus.c index bf1a32d259d..c2d39a2340d 100644 --- a/win32ss/user/ntuser/focus.c +++ b/win32ss/user/ntuser/focus.c @@ -102,10 +102,12 @@ co_IntSendActivateMessages(PWND WindowPrev, PWND Window, BOOL MouseActivate, BOO PTHREADINFO pti, ptiOld, ptiNew; BOOL InAAPM = FALSE; + //ERR("SendActivateMessages\n"); + + pti = PsGetCurrentThreadWin32Thread(); + if (Window) { - pti = PsGetCurrentThreadWin32Thread(); - UserRefObjectCo(Window, &Ref); if (WindowPrev) UserRefObjectCo(WindowPrev, &RefPrev); @@ -163,56 +165,62 @@ co_IntSendActivateMessages(PWND WindowPrev, PWND Window, BOOL MouseActivate, BOO ExFreePool(phwndTopLevel); } } - //// - OldTID = WindowPrev ? IntGetWndThreadId(WindowPrev) : NULL; - NewTID = IntGetWndThreadId(Window); - ptiOld = WindowPrev ? WindowPrev->head.pti : NULL; - ptiNew = Window->head.pti; + } + //// + OldTID = WindowPrev ? IntGetWndThreadId(WindowPrev) : NULL; + NewTID = Window ? IntGetWndThreadId(Window) : NULL; + ptiOld = WindowPrev ? WindowPrev->head.pti : NULL; + ptiNew = Window ? Window->head.pti : NULL; - //ERR("SendActivateMessage Old -> %x, New -> %x\n", OldTID, NewTID); + //ERR("SendActivateMessage Old -> %x, New -> %x\n", OldTID, NewTID); - if (!(pti->TIF_flags & TIF_INACTIVATEAPPMSG) && - (!WindowPrev || OldTID != NewTID) ) + if (!(pti->TIF_flags & TIF_INACTIVATEAPPMSG) && + (!WindowPrev || OldTID != NewTID) ) + { + PWND cWindow; + HWND *List, *phWnd; + + List = IntWinListChildren(UserGetDesktopWindow()); + if ( List ) { - PWND cWindow; - HWND *List, *phWnd; - - List = IntWinListChildren(UserGetDesktopWindow()); - if ( List ) + if ( OldTID ) { - if ( OldTID ) + ptiOld->TIF_flags |= TIF_INACTIVATEAPPMSG; + // Note: Do not set pci flags, this does crash! + for (phWnd = List; *phWnd; ++phWnd) { - ptiOld->TIF_flags |= TIF_INACTIVATEAPPMSG; - // Note: Do not set pci flags, this does crash! - for (phWnd = List; *phWnd; ++phWnd) - { - cWindow = ValidateHwndNoErr(*phWnd); - if (cWindow && cWindow->head.pti == ptiOld) - { // FALSE if the window is being deactivated, - // ThreadId that owns the window being activated. - co_IntSendMessageNoWait(*phWnd, WM_ACTIVATEAPP, FALSE, (LPARAM)NewTID); - } - } - ptiOld->TIF_flags &= ~TIF_INACTIVATEAPPMSG; - } - if ( NewTID ) - { //// Prevents a resource crash due to reentrance! - InAAPM = TRUE; - pti->TIF_flags |= TIF_INACTIVATEAPPMSG; - //// - for (phWnd = List; *phWnd; ++phWnd) - { - cWindow = ValidateHwndNoErr(*phWnd); - if (cWindow && cWindow->head.pti == ptiNew) - { // TRUE if the window is being activated, - // ThreadId that owns the window being deactivated. - co_IntSendMessageNoWait(*phWnd, WM_ACTIVATEAPP, TRUE, (LPARAM)OldTID); - } + cWindow = ValidateHwndNoErr(*phWnd); + if (cWindow && cWindow->head.pti == ptiOld) + { // FALSE if the window is being deactivated, + // ThreadId that owns the window being activated. + //ERR("SendActivateMessage Old\n"); + co_IntSendMessageNoWait(*phWnd, WM_ACTIVATEAPP, FALSE, (LPARAM)NewTID); } } - ExFreePoolWithTag(List, USERTAG_WINDOWLIST); + ptiOld->TIF_flags &= ~TIF_INACTIVATEAPPMSG; } + if ( NewTID ) + { //// Prevents a resource crash due to reentrance! + InAAPM = TRUE; + pti->TIF_flags |= TIF_INACTIVATEAPPMSG; + //// + for (phWnd = List; *phWnd; ++phWnd) + { + cWindow = ValidateHwndNoErr(*phWnd); + if (cWindow && cWindow->head.pti == ptiNew) + { // TRUE if the window is being activated, + // ThreadId that owns the window being deactivated. + //ERR("SendActivateMessage New\n"); + co_IntSendMessageNoWait(*phWnd, WM_ACTIVATEAPP, TRUE, (LPARAM)OldTID); + } + } + } + ExFreePoolWithTag(List, USERTAG_WINDOWLIST); } + } + + if (Window) + { if (WindowPrev) UserDerefObjectCo(WindowPrev); // Now allow the previous window to die. @@ -533,7 +541,7 @@ IntFindChildWindowToOwner(PWND Root, PWND Owner) for(Child = Root->spwndChild; Child; Child = Child->spwndNext) { - OwnerWnd = Child->spwndOwner; + OwnerWnd = Child->spwndOwner; if(!OwnerWnd) continue; diff --git a/win32ss/user/ntuser/menu.c b/win32ss/user/ntuser/menu.c index a155c9ff1e5..61f7d455898 100644 --- a/win32ss/user/ntuser/menu.c +++ b/win32ss/user/ntuser/menu.c @@ -178,15 +178,7 @@ PMENU FASTCALL VerifyMenu(PMENU pMenu) BOOL IntDestroyMenu( PMENU pMenu, BOOL bRecurse, BOOL RemoveFromProcess) { - /* DestroyMenu should not destroy system menu popup owner */ - if ((pMenu->fFlags & (MNF_POPUP | MNF_SYSSUBMENU)) == MNF_POPUP && pMenu->hWnd) - { - //PWND pWnd = ValidateHwndNoErr(pMenu->hWnd); - ERR("FIXME Pop up menu window thing'ie\n"); - - //co_UserDestroyWindow( pWnd ); - //pMenu->hWnd = 0; - } + PMENU SubMenu; if (pMenu->rgItems) /* recursively destroy submenus */ { @@ -194,33 +186,46 @@ BOOL IntDestroyMenu( PMENU pMenu, BOOL bRecurse, BOOL RemoveFromProcess) ITEM *item = pMenu->rgItems; for (i = pMenu->cItems; i > 0; i--, item++) { - pMenu->cItems--; //// I hate recursion logic! (jt) 4/2014. See r63028 comment for IntDeleteMenuItems. + SubMenu = item->spSubMenu; + item->spSubMenu = NULL; + + /* Remove Item Text */ FreeMenuText(pMenu,item); - if (bRecurse && item->spSubMenu)//VerifyMenu(item->spSubMenu)) + + /* Remove Item Bitmap and set it for this process */ + if (item->hbmp && !(item->fState & MFS_HBMMENUBMP)) { - IntDestroyMenu(item->spSubMenu, bRecurse, RemoveFromProcess); - item->spSubMenu = NULL; + GreSetObjectOwner(item->hbmp, GDI_OBJ_HMGR_POWNED); + item->hbmp = NULL; + } + + /* Remove Item submenu */ + if (bRecurse && SubMenu)//VerifyMenu(SubMenu)) + { + /* Release submenu since it was referenced when inserted */ + IntReleaseMenuObject(SubMenu); + IntDestroyMenuObject(SubMenu, bRecurse, RemoveFromProcess); } } + /* Free the Item */ DesktopHeapFree(pMenu->head.rpdesk, pMenu->rgItems ); pMenu->rgItems = NULL; - pMenu->cItems = 0; //// What ever~! + pMenu->cItems = 0; } return TRUE; } BOOL FASTCALL -IntDestroyMenuObject(PMENU Menu, - BOOL bRecurse, BOOL RemoveFromProcess) +IntDestroyMenuObject(PMENU Menu, BOOL bRecurse, BOOL RemoveFromProcess) { if(Menu) { PWND Window; - + /* Remove all menu items */ IntDestroyMenu( Menu, bRecurse, RemoveFromProcess); - if(RemoveFromProcess) + if (RemoveFromProcess) { RemoveEntryList(&Menu->ListEntry); } @@ -234,9 +239,17 @@ IntDestroyMenuObject(PMENU Menu, if (Window) { Window->IDMenu = 0; + + /* DestroyMenu should not destroy system menu popup owner */ + if ((Menu->fFlags & (MNF_POPUP | MNF_SYSSUBMENU)) == MNF_POPUP) + { + // Should we check it to see if it has Class? + ERR("FIXME Pop up menu window thing'ie\n"); + //co_UserDestroyWindow( Window ); + //Menu->hWnd = 0; + } } } - //UserDereferenceObject(Menu); ret = UserDeleteObject(Menu->head.h, TYPE_MENU); if (!ret) { // Make sure it is really dead or just marked for deletion. @@ -338,7 +351,7 @@ PITEM FASTCALL MENU_FindItem( PMENU *pmenu, UINT *nPos, UINT wFlags ) BOOL FASTCALL IntRemoveMenuItem( PMENU pMenu, UINT nPos, UINT wFlags, BOOL bRecurse ) { - PITEM item, NewItems; + PITEM item; TRACE("(menu=%p pos=%04x flags=%04x)\n",pMenu, nPos, wFlags); if (!(item = MENU_FindItem( &pMenu, &nPos, wFlags ))) return FALSE; @@ -364,10 +377,7 @@ IntRemoveMenuItem( PMENU pMenu, UINT nPos, UINT wFlags, BOOL bRecurse ) item++; nPos++; } - NewItems = DesktopHeapAlloc(pMenu->head.rpdesk, pMenu->cItems * sizeof(ITEM)); - RtlCopyMemory(NewItems, pMenu->rgItems, pMenu->cItems * sizeof(ITEM)); - DesktopHeapFree(pMenu->head.rpdesk, pMenu->rgItems); - pMenu->rgItems = NewItems; + pMenu->rgItems = DesktopHeapReAlloc(pMenu->head.rpdesk, pMenu->rgItems, pMenu->cItems * sizeof(ITEM)); } return TRUE; } @@ -819,6 +829,10 @@ IntSetMenuItemInfo(PMENU MenuObject, PITEM MenuItem, PROSMENUITEMINFO lpmii, PUN if(lpmii->fMask & MIIM_BITMAP) { MenuItem->hbmp = lpmii->hbmpItem; + if (MenuItem->hbmp <= HBMMENU_POPUP_MINIMIZE && MenuItem->hbmp >= HBMMENU_CALLBACK) + MenuItem->fState |= MFS_HBMMENUBMP; + else + MenuItem->fState &= ~MFS_HBMMENUBMP; } if(lpmii->fMask & MIIM_CHECKMARKS) { @@ -858,6 +872,7 @@ IntSetMenuItemInfo(PMENU MenuObject, PITEM MenuItem, PROSMENUITEMINFO lpmii, PUN ERR("Pop Up Menu Double Trouble!\n"); SubMenuObject = IntCreateMenu(&hMenu, FALSE); // It will be marked. if (!SubMenuObject) return FALSE; + IntReleaseMenuObject(SubMenuObject); // This will be referenced again after insertion. circref = TRUE; } if ( MENU_depth( SubMenuObject, 0) > MAXMENUDEPTH ) @@ -915,7 +930,7 @@ IntSetMenuItemInfo(PMENU MenuObject, PITEM MenuItem, PROSMENUITEMINFO lpmii, PUN } } - if( !(MenuObject->fFlags & MNF_SYSDESKMN) && + if( !(MenuObject->fFlags & MNF_SYSMENU) && !MenuItem->Xlpstr && !lpmii->dwTypeData && !(MenuItem->fType & MFT_OWNERDRAW) && @@ -1430,7 +1445,7 @@ HMENU FASTCALL UserCreateMenu(BOOL PopupMenu) return (HMENU)0; } Menu = IntCreateMenu(&Handle, !PopupMenu); - if (Menu->head.rpdesk->rpwinstaParent != WinStaObject) + if (Menu && Menu->head.rpdesk->rpwinstaParent != WinStaObject) { ERR("Desktop Window Station does not match Process one!\n"); } @@ -1658,6 +1673,183 @@ IntGetMenuItemRect( return TRUE; } +PMENU FASTCALL MENU_GetSystemMenu(PWND Window, PMENU Popup) +{ + PMENU Menu, NewMenu = NULL, SysMenu = NULL; + HMENU hSysMenu, hNewMenu = NULL; + ROSMENUITEMINFO ItemInfoSet = {0}; + ROSMENUITEMINFO ItemInfo = {0}; + UNICODE_STRING MenuName; + + hSysMenu = UserCreateMenu(FALSE); + if (NULL == hSysMenu) + { + return NULL; + } + SysMenu = IntGetMenuObject(hSysMenu); + if (NULL == SysMenu) + { + UserDestroyMenu(hSysMenu); + return NULL; + } + + SysMenu->fFlags |= MNF_SYSMENU; + SysMenu->hWnd = Window->head.h; + + if (!Popup) + { + //hNewMenu = co_IntLoadSysMenuTemplate(); + if ( Window->ExStyle & WS_EX_MDICHILD ) + { + RtlInitUnicodeString( &MenuName, L"SYSMENUMDI"); + hNewMenu = co_IntCallLoadMenu( hModClient, &MenuName); + } + else + { + RtlInitUnicodeString( &MenuName, L"SYSMENU"); + hNewMenu = co_IntCallLoadMenu( hModClient, &MenuName); + //ERR("%wZ\n",&MenuName); + } + if (!hNewMenu) + { + ERR("No Menu!!\n"); + IntReleaseMenuObject(SysMenu); + UserDestroyMenu(hSysMenu); + return NULL; + } + Menu = IntGetMenuObject(hNewMenu); + if (!Menu) + { + IntReleaseMenuObject(SysMenu); + UserDestroyMenu(hSysMenu); + return NULL; + } + + // Do the rest in here. + + Menu->fFlags |= MNS_CHECKORBMP | MNF_SYSMENU | MNF_POPUP; + + ItemInfoSet.cbSize = sizeof( MENUITEMINFOW); + ItemInfoSet.fMask = MIIM_BITMAP; + ItemInfoSet.hbmpItem = HBMMENU_POPUP_CLOSE; + IntMenuItemInfo(Menu, SC_CLOSE, FALSE, &ItemInfoSet, TRUE, NULL); + ItemInfoSet.hbmpItem = HBMMENU_POPUP_RESTORE; + IntMenuItemInfo(Menu, SC_RESTORE, FALSE, &ItemInfoSet, TRUE, NULL); + ItemInfoSet.hbmpItem = HBMMENU_POPUP_MAXIMIZE; + IntMenuItemInfo(Menu, SC_MAXIMIZE, FALSE, &ItemInfoSet, TRUE, NULL); + ItemInfoSet.hbmpItem = HBMMENU_POPUP_MINIMIZE; + IntMenuItemInfo(Menu, SC_MINIMIZE, FALSE, &ItemInfoSet, TRUE, NULL); + + NewMenu = IntCloneMenu(Menu); + + IntReleaseMenuObject(NewMenu); + UserSetMenuDefaultItem(NewMenu, SC_CLOSE, FALSE); + + IntDestroyMenuObject(Menu, FALSE, TRUE); + } + else + { + NewMenu = Popup; + } + if (NewMenu) + { + NewMenu->fFlags |= MNF_SYSMENU | MNF_POPUP; + + if (Window->pcls->style & CS_NOCLOSE) + IntRemoveMenuItem(NewMenu, SC_CLOSE, MF_BYCOMMAND, TRUE); + + ItemInfo.cbSize = sizeof(MENUITEMINFOW); + ItemInfo.fMask = MIIM_FTYPE | MIIM_STRING | MIIM_STATE | MIIM_SUBMENU; + ItemInfo.fType = 0; + ItemInfo.fState = MFS_ENABLED; + ItemInfo.dwTypeData = NULL; + ItemInfo.cch = 0; + ItemInfo.hSubMenu = UserHMGetHandle(NewMenu); + IntInsertMenuItem(SysMenu, (UINT) -1, TRUE, &ItemInfo, NULL); + + return SysMenu; + } + ERR("failed to load system menu!\n"); + return NULL; +} + +PMENU FASTCALL +IntGetSystemMenu(PWND Window, BOOL bRevert) +{ + PMENU Menu; + + if (bRevert) + { + if (Window->SystemMenu) + { + Menu = UserGetMenuObject(Window->SystemMenu); + if (Menu && !(Menu->fFlags & MNF_SYSDESKMN)) + { + IntDestroyMenuObject(Menu, TRUE, TRUE); + Window->SystemMenu = NULL; + } + } + } + else + { + Menu = Window->SystemMenu ? UserGetMenuObject(Window->SystemMenu) : NULL; + if ((!Window->SystemMenu || Menu->fFlags & MNF_SYSDESKMN) && Window->style & WS_SYSMENU) + { + Menu = MENU_GetSystemMenu(Window, NULL); + Window->SystemMenu = Menu ? UserHMGetHandle(Menu) : NULL; + } + } + + if (Window->SystemMenu) + { + HMENU hMenu = IntGetSubMenu( Window->SystemMenu, 0); + /* Store the dummy sysmenu handle to facilitate the refresh */ + /* of the close button if the SC_CLOSE item change */ + Menu = UserGetMenuObject(hMenu); + if (Menu) + { + Menu->spwndNotify = Window; + Menu->fFlags |= MNF_SYSSUBMENU; + } + return Menu; + } + return NULL; +} + +BOOL FASTCALL +IntSetSystemMenu(PWND Window, PMENU Menu) +{ + PMENU OldMenu; + + if (!(Window->style & WS_SYSMENU)) return FALSE; + + if (Window->SystemMenu) + { + OldMenu = UserGetMenuObject(Window->SystemMenu); + if (OldMenu) + { + OldMenu->fFlags &= ~MNF_SYSMENU; + IntDestroyMenuObject(OldMenu, TRUE, TRUE); + } + } + + OldMenu = MENU_GetSystemMenu(Window, Menu); + if (OldMenu) + { // Use spmenuSys too! + Window->SystemMenu = UserHMGetHandle(OldMenu); + } + else + Window->SystemMenu = NULL; + + if (Menu && Window != Menu->spwndNotify) + { + Menu->spwndNotify = Window; + } + + return TRUE; +} + + /* FUNCTIONS *****************************************************************/ /* @@ -1716,6 +1908,107 @@ CLEANUP: END_CLEANUP; } +/* + * NtUserGetSystemMenu + * + * The NtUserGetSystemMenu function allows the application to access the + * window menu (also known as the system menu or the control menu) for + * copying and modifying. + * + * Parameters + * hWnd + * Handle to the window that will own a copy of the window menu. + * bRevert + * Specifies the action to be taken. If this parameter is FALSE, + * NtUserGetSystemMenu returns a handle to the copy of the window menu + * currently in use. The copy is initially identical to the window menu + * but it can be modified. + * If this parameter is TRUE, GetSystemMenu resets the window menu back + * to the default state. The previous window menu, if any, is destroyed. + * + * Return Value + * If the bRevert parameter is FALSE, the return value is a handle to a + * copy of the window menu. If the bRevert parameter is TRUE, the return + * value is NULL. + * + * Status + * @implemented + */ + +HMENU APIENTRY +NtUserGetSystemMenu(HWND hWnd, BOOL bRevert) +{ + PWND Window; + PMENU Menu; + DECLARE_RETURN(HMENU); + + TRACE("Enter NtUserGetSystemMenu\n"); + UserEnterShared(); + + if (!(Window = UserGetWindowObject(hWnd))) + { + RETURN(NULL); + } + + if (!(Menu = IntGetSystemMenu(Window, bRevert))) + { + RETURN(NULL); + } + + RETURN(Menu->head.h); + +CLEANUP: + TRACE("Leave NtUserGetSystemMenu, ret=%p\n", _ret_); + UserLeave(); + END_CLEANUP; +} + +/* + * NtUserSetSystemMenu + * + * Status + * @implemented + */ + +BOOL APIENTRY +NtUserSetSystemMenu(HWND hWnd, HMENU hMenu) +{ + BOOL Result = FALSE; + PWND Window; + PMENU Menu; + DECLARE_RETURN(BOOL); + + TRACE("Enter NtUserSetSystemMenu\n"); + UserEnterExclusive(); + + if (!(Window = UserGetWindowObject(hWnd))) + { + RETURN( FALSE); + } + + if (hMenu) + { + /* + * Assign new menu handle and Up the Lock Count. + */ + if (!(Menu = IntGetMenuObject(hMenu))) + { + RETURN( FALSE); + } + + Result = IntSetSystemMenu(Window, Menu); + } + else + EngSetLastError(ERROR_INVALID_MENU_HANDLE); + + RETURN( Result); + +CLEANUP: + TRACE("Leave NtUserSetSystemMenu, ret=%i\n",_ret_); + UserLeave(); + END_CLEANUP; +} + /* * @implemented */ @@ -1908,7 +2201,7 @@ NtUserGetMenuBarInfo( break; case OBJID_SYSMENU: if (!(pWnd->style & WS_SYSMENU)) RETURN(FALSE); - Menu = IntGetSystemMenu(pWnd, FALSE, FALSE); + Menu = IntGetSystemMenu(pWnd, FALSE); hMenu = Menu->head.h; break; default: diff --git a/win32ss/user/ntuser/menu.h b/win32ss/user/ntuser/menu.h index 0a63e49f562..dffc55a2a45 100644 --- a/win32ss/user/ntuser/menu.h +++ b/win32ss/user/ntuser/menu.h @@ -41,7 +41,7 @@ BOOL FASTCALL IntInsertMenuItem(_In_ PMENU MenuObject, UINT uItem, BOOL fByPosition, PROSMENUITEMINFO ItemInfo, PUNICODE_STRING lpstr); PMENU FASTCALL -IntGetSystemMenu(PWND Window, BOOL bRevert, BOOL RetMenu); +IntGetSystemMenu(PWND Window, BOOL bRevert); UINT FASTCALL IntFindSubMenu(HMENU *hMenu, HMENU hSubTarget ); UINT FASTCALL IntGetMenuState( HMENU hMenu, UINT uId, UINT uFlags); diff --git a/win32ss/user/ntuser/msgqueue.c b/win32ss/user/ntuser/msgqueue.c index e6f31cb62b4..94b2b39639b 100644 --- a/win32ss/user/ntuser/msgqueue.c +++ b/win32ss/user/ntuser/msgqueue.c @@ -1369,7 +1369,7 @@ BOOL co_IntProcessMouseMessage(MSG* msg, BOOL* RemoveMessages, UINT first, UINT } else { - pwndMsg = co_WinPosWindowFromPoint(NULL, &msg->pt, &hittest, TRUE); + pwndMsg = co_WinPosWindowFromPoint(NULL, &msg->pt, &hittest, FALSE);//TRUE); } TRACE("Got mouse message for %p, hittest: 0x%x\n", msg->hwnd, hittest); diff --git a/win32ss/user/ntuser/painting.c b/win32ss/user/ntuser/painting.c index 72e6287c092..4259a0b3385 100644 --- a/win32ss/user/ntuser/painting.c +++ b/win32ss/user/ntuser/painting.c @@ -2141,7 +2141,13 @@ NtUserInvalidateRect( CONST RECT *lpUnsafeRect, BOOL bErase) { - return NtUserRedrawWindow(hWnd, lpUnsafeRect, NULL, RDW_INVALIDATE | (bErase? RDW_ERASE : 0)); + UINT flags = RDW_INVALIDATE | (bErase ? RDW_ERASE : 0); + if (!hWnd) + { + flags = RDW_ALLCHILDREN | RDW_INVALIDATE | RDW_FRAME | RDW_ERASE | RDW_ERASENOW; + lpUnsafeRect = NULL; + } + return NtUserRedrawWindow(hWnd, lpUnsafeRect, NULL, flags); } BOOL @@ -2151,6 +2157,11 @@ NtUserInvalidateRgn( HRGN hRgn, BOOL bErase) { + if (!hWnd) + { + EngSetLastError( ERROR_INVALID_WINDOW_HANDLE ); + return FALSE; + } return NtUserRedrawWindow(hWnd, NULL, hRgn, RDW_INVALIDATE | (bErase? RDW_ERASE : 0)); } @@ -2197,11 +2208,13 @@ NtUserValidateRect( HWND hWnd, const RECT *lpRect) { - if (hWnd) + UINT flags = RDW_VALIDATE; + if (!hWnd) { - return NtUserRedrawWindow(hWnd, lpRect, NULL, RDW_VALIDATE ); + flags = RDW_ALLCHILDREN | RDW_INVALIDATE | RDW_FRAME | RDW_ERASE | RDW_ERASENOW; + lpRect = NULL; } - return NtUserRedrawWindow(hWnd, lpRect, NULL, RDW_INVALIDATE|RDW_ERASE|RDW_ERASENOW|RDW_ALLCHILDREN); + return NtUserRedrawWindow(hWnd, lpRect, NULL, flags); } /* EOF */ diff --git a/win32ss/user/ntuser/window.c b/win32ss/user/ntuser/window.c index b5386d76102..de3b4bd0c34 100644 --- a/win32ss/user/ntuser/window.c +++ b/win32ss/user/ntuser/window.c @@ -895,148 +895,6 @@ co_DestroyThreadWindows(struct _ETHREAD *Thread) } } -PMENU FASTCALL -IntGetSystemMenu(PWND Window, BOOL bRevert, BOOL RetMenu) -{ - PMENU Menu, NewMenu = NULL, SysMenu = NULL, ret = NULL; - PTHREADINFO W32Thread; - HMENU hNewMenu, hSysMenu; - ROSMENUITEMINFO ItemInfoSet = {0}; - ROSMENUITEMINFO ItemInfo = {0}; - UNICODE_STRING MenuName; - - if(bRevert) - { - W32Thread = PsGetCurrentThreadWin32Thread(); - - if(!W32Thread->rpdesk) - return NULL; - - if(Window->SystemMenu) - { - Menu = UserGetMenuObject(Window->SystemMenu); - if(Menu) - { - IntDestroyMenuObject(Menu, TRUE, TRUE); - Window->SystemMenu = (HMENU)0; - } - } - - if(W32Thread->rpdesk->rpwinstaParent->SystemMenuTemplate) - { - /* Clone system menu */ - Menu = UserGetMenuObject(W32Thread->rpdesk->rpwinstaParent->SystemMenuTemplate); - if(!Menu) - return NULL; - - NewMenu = IntCloneMenu(Menu); - if(NewMenu) - { // Use spmenuSys - Window->SystemMenu = NewMenu->head.h; - NewMenu->fFlags |= MNF_SYSDESKMN; - NewMenu->hWnd = Window->head.h; - ret = NewMenu; - //IntReleaseMenuObject(NewMenu); - } - } - else - { - hSysMenu = UserCreateMenu(FALSE); - if (NULL == hSysMenu) - { - return NULL; - } - SysMenu = IntGetMenuObject(hSysMenu); - if (NULL == SysMenu) - { - UserDestroyMenu(hSysMenu); - return NULL; - } - SysMenu->fFlags |= MNF_SYSDESKMN; - SysMenu->hWnd = Window->head.h; - //hNewMenu = co_IntLoadSysMenuTemplate(); - //if ( Window->ExStyle & WS_EX_MDICHILD ) - //{ - // RtlInitUnicodeString( &MenuName, L"SYSMENUMDI"); - // hNewMenu = co_IntCallLoadMenu( hModClient, &MenuName); - //} - //else - { - RtlInitUnicodeString( &MenuName, L"SYSMENU"); - hNewMenu = co_IntCallLoadMenu( hModClient, &MenuName); - //ERR("%wZ\n",&MenuName); - } - if(!hNewMenu) - { - ERR("No Menu!!\n"); - IntReleaseMenuObject(SysMenu); - UserDestroyMenu(hSysMenu); - return NULL; - } - Menu = IntGetMenuObject(hNewMenu); - if(!Menu) - { - IntReleaseMenuObject(SysMenu); - UserDestroyMenu(hSysMenu); - return NULL; - } - - // Do the rest in here. - - Menu->fFlags |= MNS_CHECKORBMP | MNF_SYSDESKMN | MNF_POPUP; - - ItemInfoSet.cbSize = sizeof( MENUITEMINFOW); - ItemInfoSet.fMask = MIIM_BITMAP; - ItemInfoSet.hbmpItem = HBMMENU_POPUP_CLOSE; - IntMenuItemInfo(Menu, SC_CLOSE, FALSE, &ItemInfoSet, TRUE, NULL); - ItemInfoSet.hbmpItem = HBMMENU_POPUP_RESTORE; - IntMenuItemInfo(Menu, SC_RESTORE, FALSE, &ItemInfoSet, TRUE, NULL); - ItemInfoSet.hbmpItem = HBMMENU_POPUP_MAXIMIZE; - IntMenuItemInfo(Menu, SC_MAXIMIZE, FALSE, &ItemInfoSet, TRUE, NULL); - ItemInfoSet.hbmpItem = HBMMENU_POPUP_MINIMIZE; - IntMenuItemInfo(Menu, SC_MINIMIZE, FALSE, &ItemInfoSet, TRUE, NULL); - - NewMenu = IntCloneMenu(Menu); - if(NewMenu) - { - NewMenu->fFlags |= MNF_SYSDESKMN | MNF_POPUP; - // Do not set MNS_CHECKORBMP it breaks menus, also original code destroyed the style anyway. - IntReleaseMenuObject(NewMenu); - UserSetMenuDefaultItem(NewMenu, SC_CLOSE, FALSE); - - if (Window->pcls->style & CS_NOCLOSE) - IntRemoveMenuItem(NewMenu, SC_CLOSE, MF_BYCOMMAND, TRUE); - - ItemInfo.cbSize = sizeof(MENUITEMINFOW); - ItemInfo.fMask = MIIM_FTYPE | MIIM_STRING | MIIM_STATE | MIIM_SUBMENU; - ItemInfo.fType = 0; - ItemInfo.fState = MFS_ENABLED; - ItemInfo.dwTypeData = NULL; - ItemInfo.cch = 0; - ItemInfo.hSubMenu = NewMenu->head.h; - IntInsertMenuItem(SysMenu, (UINT) -1, TRUE, &ItemInfo, NULL); - - Window->SystemMenu = SysMenu->head.h; - - ret = SysMenu; - } - IntDestroyMenuObject(Menu, FALSE, TRUE); - } - if(RetMenu) - return ret; - else - return NULL; - } - else - { - if(Window->SystemMenu) - return IntGetMenuObject((HMENU)Window->SystemMenu); - else - return NULL; - } -} - - BOOL FASTCALL IntIsChildWindow(PWND Parent, PWND BaseWindow) { @@ -1450,32 +1308,6 @@ co_UserSetParent(HWND hWndChild, HWND hWndNewParent) return( hWndOldParent); } -BOOL FASTCALL -IntSetSystemMenu(PWND Window, PMENU Menu) -{ - PMENU OldMenu; - if(Window->SystemMenu) - { - OldMenu = IntGetMenuObject(Window->SystemMenu); - if(OldMenu) - { - OldMenu->fFlags &= ~ MNF_SYSDESKMN; - IntReleaseMenuObject(OldMenu); - } - } - - if(Menu) - { - /* FIXME: Check window style, propably return FALSE? */ - Window->SystemMenu = Menu->head.h; - Menu->fFlags |= MNF_SYSDESKMN; - } - else // Use spmenuSys too! - Window->SystemMenu = (HMENU)0; - - return TRUE; -} - /* Unlink the window from siblings. children and parent are kept in place. */ VOID FASTCALL IntUnlinkWindow(PWND Wnd) @@ -1784,7 +1616,6 @@ PWND FASTCALL IntCreateWindow(CREATESTRUCTW* Cs, PWND pWnd = NULL; HWND hWnd; PTHREADINFO pti = NULL; - PMENU SystemMenu; BOOL MenuChanged; BOOL bUnicodeWindow; @@ -2012,22 +1843,13 @@ PWND FASTCALL IntCreateWindow(CREATESTRUCTW* Cs, if (!(pWnd->style & (WS_CHILD | WS_POPUP))) pWnd->state |= WNDS_SENDSIZEMOVEMSGS; - /* Create system menu */ - if ((Cs->style & WS_SYSMENU)) // && (dwStyle & WS_CAPTION) == WS_CAPTION) - { - SystemMenu = IntGetSystemMenu(pWnd, TRUE, TRUE); - if(SystemMenu) - { // spmenuSys - pWnd->SystemMenu = SystemMenu->head.h; - IntReleaseMenuObject(SystemMenu); - } - } - /* Set the window menu */ if ((Cs->style & (WS_CHILD | WS_POPUP)) != WS_CHILD) { - if (Cs->hMenu) + if (Cs->hMenu) + { IntSetMenu(pWnd, Cs->hMenu, &MenuChanged); + } else if (pWnd->pcls->lpszMenuName) // Take it from the parent. { UNICODE_STRING MenuName; @@ -2338,15 +2160,15 @@ co_UserCreateWindowEx(CREATESTRUCTW* Cs, Window->rcWindow.top = Cs->y; Window->rcWindow.right = Cs->x + Size.cx; Window->rcWindow.bottom = Cs->y + Size.cy; -/* + /* if (0 != (Window->style & WS_CHILD) && ParentWindow) { -// ERR("co_UserCreateWindowEx(): Offset rcWindow\n"); + ERR("co_UserCreateWindowEx(): Offset rcWindow\n"); RECTL_vOffsetRect(&Window->rcWindow, ParentWindow->rcClient.left, ParentWindow->rcClient.top); } -*/ + */ /* correct child window coordinates if mirroring on parent is enabled */ if (ParentWindow != NULL) { @@ -3679,105 +3501,6 @@ CLEANUP: END_CLEANUP; } -/* - * NtUserGetSystemMenu - * - * The NtUserGetSystemMenu function allows the application to access the - * window menu (also known as the system menu or the control menu) for - * copying and modifying. - * - * Parameters - * hWnd - * Handle to the window that will own a copy of the window menu. - * bRevert - * Specifies the action to be taken. If this parameter is FALSE, - * NtUserGetSystemMenu returns a handle to the copy of the window menu - * currently in use. The copy is initially identical to the window menu - * but it can be modified. - * If this parameter is TRUE, GetSystemMenu resets the window menu back - * to the default state. The previous window menu, if any, is destroyed. - * - * Return Value - * If the bRevert parameter is FALSE, the return value is a handle to a - * copy of the window menu. If the bRevert parameter is TRUE, the return - * value is NULL. - * - * Status - * @implemented - */ - -HMENU APIENTRY -NtUserGetSystemMenu(HWND hWnd, BOOL bRevert) -{ - PWND Window; - PMENU Menu; - DECLARE_RETURN(HMENU); - - TRACE("Enter NtUserGetSystemMenu\n"); - UserEnterShared(); - - if (!(Window = UserGetWindowObject(hWnd))) - { - RETURN(NULL); - } - - if (!(Menu = IntGetSystemMenu(Window, bRevert, FALSE))) - { - RETURN(NULL); - } - - RETURN(Menu->head.h); - -CLEANUP: - TRACE("Leave NtUserGetSystemMenu, ret=%p\n", _ret_); - UserLeave(); - END_CLEANUP; -} - -/* - * NtUserSetSystemMenu - * - * Status - * @implemented - */ - -BOOL APIENTRY -NtUserSetSystemMenu(HWND hWnd, HMENU hMenu) -{ - BOOL Result = FALSE; - PWND Window; - PMENU Menu; - DECLARE_RETURN(BOOL); - - TRACE("Enter NtUserSetSystemMenu\n"); - UserEnterExclusive(); - - if (!(Window = UserGetWindowObject(hWnd))) - { - RETURN( FALSE); - } - - if (hMenu) - { - /* - * Assign new menu handle. - */ - if (!(Menu = UserGetMenuObject(hMenu))) - { - RETURN( FALSE); - } - - Result = IntSetSystemMenu(Window, Menu); - } - - RETURN( Result); - -CLEANUP: - TRACE("Leave NtUserSetSystemMenu, ret=%i\n",_ret_); - UserLeave(); - END_CLEANUP; -} - // Fixes wine Win test_window_styles and todo tests... static BOOL FASTCALL IntCheckFrameEdge(ULONG Style, ULONG ExStyle) diff --git a/win32ss/user/ntuser/winpos.c b/win32ss/user/ntuser/winpos.c index f11f57c6553..87c6806bd4a 100644 --- a/win32ss/user/ntuser/winpos.c +++ b/win32ss/user/ntuser/winpos.c @@ -198,7 +198,7 @@ PWND FASTCALL IntGetLastTopMostWindow(VOID) } // -// This helps with bug 6751 forcing modal dialog active when another app is minimized or closed. +// This helps with CORE-6129 forcing modal dialog active when another app is minimized or closed. // BOOL FASTCALL ActivateOtherWindowMin(PWND Wnd) { @@ -362,135 +362,6 @@ done: if (WndTo) UserDerefObjectCo(WndTo); } -UINT -FASTCALL -co_WinPosArrangeIconicWindows(PWND parent) -{ - RECTL rectParent; - INT i, x, y, xspacing, yspacing, sx, sy; - HWND *List = IntWinListChildren(parent); - - ASSERT_REFS_CO(parent); - - /* Check if we found any children */ - if(List == NULL) - { - return 0; - } - - IntGetClientRect( parent, &rectParent ); - // FIXME: Support gspv.mm.iArrange. - x = rectParent.left; - y = rectParent.bottom; - - xspacing = (UserGetSystemMetrics(SM_CXMINSPACING)/2)+UserGetSystemMetrics(SM_CXBORDER); - yspacing = (UserGetSystemMetrics(SM_CYMINSPACING)/2)+UserGetSystemMetrics(SM_CYBORDER); - - //ERR("X:%d Y:%d XS:%d YS:%d\n",x,y,xspacing,yspacing); - - for(i = 0; List[i]; i++) - { - PWND Child; - - if (!(Child = ValidateHwndNoErr(List[i]))) - continue; - - if((Child->style & WS_MINIMIZE) != 0 ) - { - USER_REFERENCE_ENTRY Ref; - UserRefObjectCo(Child, &Ref); - - sx = x + UserGetSystemMetrics(SM_CXBORDER); - sy = y - yspacing - UserGetSystemMetrics(SM_CYBORDER); - - co_WinPosSetWindowPos( Child, 0, sx, sy, 0, 0, - SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE ); - - Child->InternalPos.IconPos.x = sx; - Child->InternalPos.IconPos.y = sy; - Child->InternalPos.flags |= WPF_MININIT; - Child->InternalPos.flags &= ~WPF_SETMINPOSITION; - - UserDerefObjectCo(Child); - - if (x <= (rectParent.right - UserGetSystemMetrics(SM_CXMINSPACING))) - x += xspacing; - else - { - x = rectParent.left; - y -= yspacing; - } - //ERR("X:%d Y:%d\n",x,y); - } - } - ExFreePoolWithTag(List, USERTAG_WINDOWLIST); - return yspacing; -} - -static VOID FASTCALL -WinPosFindIconPos(PWND Window, POINT *Pos) -{ - RECT rectParent; - PWND pwndChild, pwndParent; - int x, y, xspacing, yspacing; - - pwndParent = Window->spwndParent; - if (pwndParent == UserGetDesktopWindow()) - { - //ERR("Parent is Desktop, Min off screen!\n"); - /* ReactOS doesn't support iconic minimize to desktop */ - Pos->x = Pos->y = -32000; - Window->InternalPos.flags |= WPF_MININIT; - Window->InternalPos.IconPos.x = Pos->x; - Window->InternalPos.IconPos.y = Pos->y; - return; - } - - IntGetClientRect( pwndParent, &rectParent ); - // FIXME: Support gspv.mm.iArrange. - x = rectParent.left; - y = rectParent.bottom; - - xspacing = (UserGetSystemMetrics(SM_CXMINSPACING)/2)+UserGetSystemMetrics(SM_CXBORDER); - yspacing = (UserGetSystemMetrics(SM_CYMINSPACING)/2)+UserGetSystemMetrics(SM_CYBORDER); - - //ERR("X:%d Y:%d XS:%d YS:%d\n",Pos->x,Pos->y,xspacing,yspacing); - - // Set to default position when minimized. - Pos->x = x + UserGetSystemMetrics(SM_CXBORDER); - Pos->y = y - yspacing - UserGetSystemMetrics(SM_CYBORDER); - - for (pwndChild = pwndParent->spwndChild; pwndChild; pwndChild = pwndChild->spwndNext) - { - if (pwndChild == Window) continue; - - if (pwndChild->style & WS_VISIBLE) - { - //ERR("Loop!\n"); - continue; - } - //ERR("Pos Child X %d Y %d!\n", pwndChild->InternalPos.IconPos.x, pwndChild->InternalPos.IconPos.y); - if ( pwndChild->InternalPos.IconPos.x == Pos->x && - pwndChild->InternalPos.IconPos.y == Pos->y ) - { - if (x <= rectParent.right - UserGetSystemMetrics(SM_CXMINSPACING)) - x += xspacing; - else - { - x = rectParent.left; - y -= yspacing; - } - Pos->x = x + UserGetSystemMetrics(SM_CXBORDER); - Pos->y = y - yspacing - UserGetSystemMetrics(SM_CYBORDER); - } - } - Window->InternalPos.IconPos.x = Pos->x; - Window->InternalPos.IconPos.y = Pos->y; - Window->InternalPos.flags |= WPF_MININIT; - //ERR("Position is set! X:%d Y:%d\n",Pos->x,Pos->y); - return; -} - VOID FASTCALL WinPosInitInternalPos(PWND Wnd, RECTL *RestoreRect) { @@ -740,6 +611,120 @@ IntSetWindowPlacement(PWND Wnd, WINDOWPLACEMENT *wpl, UINT Flags) return TRUE; } +UINT +FASTCALL +co_WinPosArrangeIconicWindows(PWND parent) +{ + RECTL rectParent; + PWND Child; + INT x, y, xspacing, yspacing, sx, sy; + + ASSERT_REFS_CO(parent); + + IntGetClientRect( parent, &rectParent ); + // FIXME: Support Minimize Metrics gspv.mm.iArrange. + // Default: ARW_BOTTOMLEFT + x = rectParent.left; + y = rectParent.bottom; + + xspacing = UserGetSystemMetrics(SM_CXMINIMIZED); + yspacing = UserGetSystemMetrics(SM_CYMINIMIZED); + + Child = parent->spwndChild; + while(Child) + { + if((Child->style & WS_MINIMIZE) != 0 ) + { + USER_REFERENCE_ENTRY Ref; + UserRefObjectCo(Child, &Ref); + + sx = x + UserGetSystemMetrics(SM_CXBORDER); + sy = y - yspacing - UserGetSystemMetrics(SM_CYBORDER); + + Child->InternalPos.IconPos.x = sx; + Child->InternalPos.IconPos.y = sy; + Child->InternalPos.flags |= WPF_MININIT; + + co_WinPosSetWindowPos( Child, 0, sx, sy, xspacing, yspacing, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOCOPYBITS | SWP_ASYNCWINDOWPOS); + + UserDerefObjectCo(Child); + + if (x <= rectParent.right - xspacing) + x += xspacing; + else + { + x = rectParent.left; + y -= yspacing; + } + } + Child = Child->spwndNext; + } + return yspacing; +} + +static VOID FASTCALL +WinPosFindIconPos(PWND Window, POINT *Pos) +{ + RECT rectParent; + PWND pwndChild, pwndParent; + int x, y, xspacing, yspacing; + + pwndParent = Window->spwndParent; + if (pwndParent == UserGetDesktopWindow()) + { + //ERR("Parent is Desktop, Min off screen!\n"); + /* ReactOS doesn't support iconic minimize to desktop */ + Pos->x = Pos->y = -32000; + Window->InternalPos.flags |= WPF_MININIT; + Window->InternalPos.IconPos.x = Pos->x; + Window->InternalPos.IconPos.y = Pos->y; + return; + } + + IntGetClientRect( pwndParent, &rectParent ); + // FIXME: Support Minimize Metrics gspv.mm.iArrange. + // Default: ARW_BOTTOMLEFT + x = rectParent.left; + y = rectParent.bottom; + + xspacing = UserGetSystemMetrics(SM_CXMINIMIZED); + yspacing = UserGetSystemMetrics(SM_CYMINIMIZED); + + // Set to default position when minimized. + Pos->x = x + UserGetSystemMetrics(SM_CXBORDER); + Pos->y = y - yspacing - UserGetSystemMetrics(SM_CYBORDER); + + for (pwndChild = pwndParent->spwndChild; pwndChild; pwndChild = pwndChild->spwndNext) + { + if (pwndChild == Window) continue; + + if ((pwndChild->style & (WS_VISIBLE|WS_MINIMIZE)) != (WS_VISIBLE|WS_MINIMIZE) ) + { + continue; + } + + if ( pwndChild->InternalPos.IconPos.x != Pos->x && pwndChild->InternalPos.IconPos.y != Pos->y ) + { + break; + } + if (x <= rectParent.right - xspacing) + x += xspacing; + else + { + x = rectParent.left; + y -= yspacing; + } + Pos->x = x + UserGetSystemMetrics(SM_CXBORDER); + Pos->y = y - yspacing - UserGetSystemMetrics(SM_CYBORDER); + } + + Window->InternalPos.IconPos.x = Pos->x; + Window->InternalPos.IconPos.y = Pos->y; + Window->InternalPos.flags |= WPF_MININIT; + TRACE("Position is set! X:%d Y:%d\n",Pos->x,Pos->y); + return; +} + UINT FASTCALL co_WinPosMinMaximize(PWND Wnd, UINT ShowFlag, RECT* NewPos) { @@ -793,8 +778,7 @@ co_WinPosMinMaximize(PWND Wnd, UINT ShowFlag, RECT* NewPos) old_style = IntSetStyle( Wnd, WS_MINIMIZE, WS_MAXIMIZE ); - co_UserRedrawWindow(Wnd, NULL, 0, RDW_VALIDATE | RDW_NOERASE | - RDW_NOINTERNALPAINT); + co_UserRedrawWindow(Wnd, NULL, 0, RDW_VALIDATE | RDW_NOERASE | RDW_NOINTERNALPAINT); if (!(Wnd->InternalPos.flags & WPF_SETMINPOSITION)) Wnd->InternalPos.flags &= ~WPF_MININIT; @@ -803,15 +787,9 @@ co_WinPosMinMaximize(PWND Wnd, UINT ShowFlag, RECT* NewPos) if (!(old_style & WS_MINIMIZE)) SwpFlags |= SWP_STATECHANGED; - /*ERR("Minimize: %d,%d %dx%d\n", - wpl.ptMinPosition.x, wpl.ptMinPosition.y, UserGetSystemMetrics(SM_CXMINIMIZED), - UserGetSystemMetrics(SM_CYMINIMIZED)); - */ RECTL_vSetRect(NewPos, wpl.ptMinPosition.x, wpl.ptMinPosition.y, -// wpl.ptMinPosition.x + UserGetSystemMetrics(SM_CXMINIMIZED), -// wpl.ptMinPosition.y + UserGetSystemMetrics(SM_CYMINIMIZED)); - UserGetSystemMetrics(SM_CXMINIMIZED), - UserGetSystemMetrics(SM_CYMINIMIZED)); + wpl.ptMinPosition.x + UserGetSystemMetrics(SM_CXMINIMIZED), + wpl.ptMinPosition.y + UserGetSystemMetrics(SM_CYMINIMIZED)); SwpFlags |= SWP_NOCOPYBITS; break; } @@ -833,7 +811,7 @@ co_WinPosMinMaximize(PWND Wnd, UINT ShowFlag, RECT* NewPos) if (!(old_style & WS_MAXIMIZE)) SwpFlags |= SWP_STATECHANGED; RECTL_vSetRect(NewPos, wpl.ptMaxPosition.x, wpl.ptMaxPosition.y, -// wpl.ptMaxPosition.x + Size.x, wpl.ptMaxPosition.y + Size.y); + //wpl.ptMaxPosition.x + Size.x, wpl.ptMaxPosition.y + Size.y); Size.x, Size.y); break; } @@ -854,20 +832,13 @@ co_WinPosMinMaximize(PWND Wnd, UINT ShowFlag, RECT* NewPos) co_WinPosGetMinMaxInfo(Wnd, &Size, &wpl.ptMaxPosition, NULL, NULL); IntSetStyle( Wnd, WS_MAXIMIZE, 0 ); SwpFlags |= SWP_STATECHANGED; - /*ERR("Restore to Max: %d,%d %dx%d\n", - wpl.ptMaxPosition.x, wpl.ptMaxPosition.y, Size.x, Size.y); - */ RECTL_vSetRect(NewPos, wpl.ptMaxPosition.x, wpl.ptMaxPosition.y, -// wpl.ptMaxPosition.x + Size.x, wpl.ptMaxPosition.y + Size.y); - Size.x, Size.y); + wpl.ptMaxPosition.x + Size.x, wpl.ptMaxPosition.y + Size.y); break; } else { *NewPos = wpl.rcNormalPosition; - /*ERR("Restore Max: %d,%d %dx%d\n", - NewPos->left, NewPos->top, NewPos->right - NewPos->left, NewPos->bottom - NewPos->top); - */ NewPos->right -= NewPos->left; NewPos->bottom -= NewPos->top; break; @@ -882,9 +853,6 @@ co_WinPosMinMaximize(PWND Wnd, UINT ShowFlag, RECT* NewPos) SwpFlags |= SWP_STATECHANGED; Wnd->InternalPos.flags &= ~WPF_RESTORETOMAXIMIZED; *NewPos = wpl.rcNormalPosition; - /*ERR("Restore Min: %d,%d %dx%d\n", - NewPos->left, NewPos->top, NewPos->right - NewPos->left, NewPos->bottom - NewPos->top); - */ NewPos->right -= NewPos->left; NewPos->bottom -= NewPos->top; break; @@ -1212,12 +1180,9 @@ co_WinPosDoNCCALCSize(PWND Window, PWINDOWPOS WinPos, RECTL* WindowRect, RECTL* Parent = Window->spwndParent; if (0 != (Window->style & WS_CHILD) && Parent) { - RECTL_vOffsetRect(&(params.rgrc[0]), - Parent->rcClient.left, - - Parent->rcClient.top); - RECTL_vOffsetRect(&(params.rgrc[1]), - Parent->rcClient.left, - - Parent->rcClient.top); - RECTL_vOffsetRect(&(params.rgrc[2]), - Parent->rcClient.left, - - Parent->rcClient.top); + RECTL_vOffsetRect(&(params.rgrc[0]), - Parent->rcClient.left, - Parent->rcClient.top); + RECTL_vOffsetRect(&(params.rgrc[1]), - Parent->rcClient.left, - Parent->rcClient.top); + RECTL_vOffsetRect(&(params.rgrc[2]), - Parent->rcClient.left, - Parent->rcClient.top); } params.lppos = &winposCopy; @@ -1232,8 +1197,7 @@ co_WinPosDoNCCALCSize(PWND Window, PWINDOWPOS WinPos, RECTL* WindowRect, RECTL* *ClientRect = params.rgrc[0]; // First rectangle contains the coordinates of the new client rectangle resulting from the move or resize if ((Window->style & WS_CHILD) && Parent) { - RECTL_vOffsetRect(ClientRect, Parent->rcClient.left, - Parent->rcClient.top); + RECTL_vOffsetRect(ClientRect, Parent->rcClient.left, Parent->rcClient.top); } FixClientRect(ClientRect, WindowRect); } @@ -1244,16 +1208,14 @@ co_WinPosDoNCCALCSize(PWND Window, PWINDOWPOS WinPos, RECTL* WindowRect, RECTL* WinPos->flags &= ~SWP_NOCLIENTMOVE; } - if (ClientRect->right - ClientRect->left != - Window->rcClient.right - Window->rcClient.left) + if (ClientRect->right - ClientRect->left != Window->rcClient.right - Window->rcClient.left) { WinPos->flags &= ~SWP_NOCLIENTSIZE; } else wvrFlags &= ~WVR_HREDRAW; - if (ClientRect->bottom - ClientRect->top != - Window->rcClient.bottom - Window->rcClient.top) + if (ClientRect->bottom - ClientRect->top != Window->rcClient.bottom - Window->rcClient.top) { WinPos->flags &= ~SWP_NOCLIENTSIZE; } @@ -1308,8 +1270,8 @@ co_WinPosDoWinPosChanging(PWND Window, { if (Window->style & WS_MINIMIZE) { - WindowRect->right = WindowRect->left + UserGetSystemMetrics(SM_CXICON); - WindowRect->bottom = WindowRect->top + UserGetSystemMetrics(SM_CYICON); + WindowRect->right = WindowRect->left + UserGetSystemMetrics(SM_CXMINIMIZED); + WindowRect->bottom = WindowRect->top + UserGetSystemMetrics(SM_CYMINIMIZED); } else { @@ -1317,44 +1279,24 @@ co_WinPosDoWinPosChanging(PWND Window, WindowRect->bottom = WindowRect->top + WinPos->cy; } } -#if 0 - if (!(WinPos->flags & SWP_NOMOVE)) - { - WindowRect->left = WinPos->x; - WindowRect->top = WinPos->y; - WindowRect->right += WinPos->x - Window->rcWindow.left; - WindowRect->bottom += WinPos->y - Window->rcWindow.top; - RECTL_vOffsetRect(ClientRect, - WinPos->x - Window->rcWindow.left, - WinPos->y - Window->rcWindow.top); - } - - *WindowRect = Window->rcWindow; - *ClientRect = Window->rcClient; - - if (!(WinPos->flags & SWP_NOSIZE)) - { - WindowRect->right = WindowRect->left + WinPos->cx; - WindowRect->bottom = WindowRect->top + WinPos->cy; - } -#endif if (!(WinPos->flags & SWP_NOMOVE)) { INT X, Y; PWND Parent; X = WinPos->x; Y = WinPos->y; - //ERR("Not SWP_NOMOVE\n"); + Parent = Window->spwndParent; + if (((Window->style & WS_CHILD) != 0) && Parent && Parent != Window->head.rpdesk->pDeskInfo->spwnd) { - //ERR("Not SWP_NOMOVE 1 Parent client offset X %d Y %d\n",X,Y); + TRACE("Not SWP_NOMOVE 1 Parent client offset X %d Y %d\n",X,Y); X += Parent->rcClient.left; Y += Parent->rcClient.top; - //ERR("Not SWP_NOMOVE 2 Parent client offset X %d Y %d\n",X,Y); + TRACE("Not SWP_NOMOVE 2 Parent client offset X %d Y %d\n",X,Y); } WindowRect->left = X; @@ -1365,12 +1307,13 @@ co_WinPosDoWinPosChanging(PWND Window, RECTL_vOffsetRect(ClientRect, X - Window->rcWindow.left, Y - Window->rcWindow.top); } - WinPos->flags |= SWP_NOCLIENTMOVE | SWP_NOCLIENTSIZE; TRACE( "hwnd %p, after %p, swp %d,%d %dx%d flags %08x\n", WinPos->hwnd, WinPos->hwndInsertAfter, WinPos->x, WinPos->y, WinPos->cx, WinPos->cy, WinPos->flags ); + TRACE("WindowRect: %d %d %d %d\n", WindowRect->left,WindowRect->top,WindowRect->right,WindowRect->bottom); + TRACE("ClientRect: %d %d %d %d\n", ClientRect->left,ClientRect->top,ClientRect->right,ClientRect->bottom); return TRUE; } @@ -1533,6 +1476,7 @@ WinPosInternalMoveWindow(PWND Window, INT MoveX, INT MoveY) PWND Child; ASSERT(Window != Window->spwndChild); + TRACE("InternalMoveWin X %d Y %d\n", MoveX, MoveY); Window->rcWindow.left += MoveX; Window->rcWindow.right += MoveX; @@ -1591,7 +1535,7 @@ WinPosFixupFlags(WINDOWPOS *WinPos, PWND Wnd) pt.x = WinPos->x; pt.y = WinPos->y; IntClientToScreen( Parent, &pt ); - //ERR("WPFU C2S wpx %d wpy %d ptx %d pty %d\n",WinPos->x,WinPos->y,pt.x,pt.y); + TRACE("WPFU C2S wpx %d wpy %d ptx %d pty %d\n",WinPos->x,WinPos->y,pt.x,pt.y); /* Check for right position */ if (Wnd->rcWindow.left == pt.x && Wnd->rcWindow.top == pt.y) { @@ -1846,12 +1790,11 @@ co_WinPosSetWindowPos( OldWindowRect = Window->rcWindow; OldClientRect = Window->rcClient; - //ERR("SetWindowPos OldWindowRect: %d %d %d %d\n", OldWindowRect.left,OldWindowRect.top,OldWindowRect.right,OldWindowRect.bottom); - //ERR("SetWindowPos OldClientRect: %d %d %d %d\n", OldClientRect.left,OldClientRect.top,OldClientRect.right,OldClientRect.bottom); if (NewClientRect.left != OldClientRect.left || NewClientRect.top != OldClientRect.top) { + // Move child window if their parent is moved. Keep Child window relative to Parent... WinPosInternalMoveWindow(Window, NewClientRect.left - OldClientRect.left, NewClientRect.top - OldClientRect.top); @@ -1860,9 +1803,6 @@ co_WinPosSetWindowPos( Window->rcWindow = NewWindowRect; Window->rcClient = NewClientRect; - //ERR("SetWindowPos NewWindowRect: %d %d %d %d\n", NewWindowRect.left,NewWindowRect.top,NewWindowRect.right,NewWindowRect.bottom); - //ERR("SetWindowPos NewClientRect: %d %d %d %d\n", NewClientRect.left,NewClientRect.top,NewClientRect.right,NewClientRect.bottom); - /* erase parent when hiding or resizing child */ if (WinPos.flags & SWP_HIDEWINDOW) { @@ -2209,10 +2149,10 @@ co_WinPosShowWindow(PWND Wnd, INT Cmd) LONG style; PWND Parent; PTHREADINFO pti; - // HRGN VisibleRgn; - //ERR("co_WinPosShowWindow START\n"); + //HRGN VisibleRgn; BOOL ShowOwned = FALSE; ASSERT_REFS_CO(Wnd); + //ERR("co_WinPosShowWindow START\n"); pti = PsGetCurrentThreadWin32Thread(); WasVisible = (Wnd->style & WS_VISIBLE) != 0; @@ -2374,7 +2314,8 @@ co_WinPosShowWindow(PWND Wnd, INT Cmd) Swp |= SWP_NOACTIVATE | SWP_NOZORDER; } -#if 0 // Explorer issues with common controls. Someone does not know how CS_SAVEBITS works. +#if 0 // Explorer issues with common controls? Someone does not know how CS_SAVEBITS works. + // Breaks startup and shutdown active window... if ((Wnd->style & (WS_POPUP|WS_CHILD)) != WS_CHILD && Wnd->pcls->style & CS_SAVEBITS && ((Cmd == SW_SHOW) || (Cmd == SW_NORMAL))) diff --git a/win32ss/user/ntuser/winsta.c b/win32ss/user/ntuser/winsta.c index f4fe81a017e..8fcc7b7a9a2 100644 --- a/win32ss/user/ntuser/winsta.c +++ b/win32ss/user/ntuser/winsta.c @@ -451,10 +451,8 @@ NtUserCreateWindowStation( /* Initialize the window station */ RtlZeroMemory(WindowStationObject, sizeof(WINSTATION_OBJECT)); - KeInitializeSpinLock(&WindowStationObject->Lock); InitializeListHead(&WindowStationObject->DesktopListHead); Status = RtlCreateAtomTable(37, &WindowStationObject->AtomTable); - WindowStationObject->SystemMenuTemplate = (HANDLE)0; WindowStationObject->Name = WindowStationName; WindowStationObject->dwSessionId = NtCurrentPeb()->SessionId; @@ -1204,13 +1202,12 @@ BuildDesktopNameList( { NTSTATUS Status; PWINSTATION_OBJECT WindowStation; - KIRQL OldLevel; PLIST_ENTRY DesktopEntry; PDESKTOP DesktopObject; DWORD EntryCount; ULONG ReturnLength; WCHAR NullWchar; - PUNICODE_STRING DesktopName; + UNICODE_STRING DesktopName; Status = IntValidateWindowStationHandle(hWindowStation, KernelMode, @@ -1221,8 +1218,6 @@ BuildDesktopNameList( return Status; } - KeAcquireSpinLock(&WindowStation->Lock, &OldLevel); - /* * Count the required size of buffer. */ @@ -1233,8 +1228,8 @@ BuildDesktopNameList( DesktopEntry = DesktopEntry->Flink) { DesktopObject = CONTAINING_RECORD(DesktopEntry, DESKTOP, ListEntry); - DesktopName = GET_DESKTOP_NAME(DesktopObject); - if (DesktopName) ReturnLength += DesktopName->Length + sizeof(WCHAR); + RtlInitUnicodeString(&DesktopName, DesktopObject->pDeskInfo->szDesktopName); + ReturnLength += DesktopName.Length + sizeof(WCHAR); EntryCount++; } TRACE("Required size: %lu Entry count: %lu\n", ReturnLength, EntryCount); @@ -1243,7 +1238,6 @@ BuildDesktopNameList( Status = MmCopyToCaller(pRequiredSize, &ReturnLength, sizeof(ULONG)); if (! NT_SUCCESS(Status)) { - KeReleaseSpinLock(&WindowStation->Lock, OldLevel); ObDereferenceObject(WindowStation); return STATUS_BUFFER_TOO_SMALL; } @@ -1254,7 +1248,6 @@ BuildDesktopNameList( */ if (dwSize < ReturnLength) { - KeReleaseSpinLock(&WindowStation->Lock, OldLevel); ObDereferenceObject(WindowStation); return STATUS_BUFFER_TOO_SMALL; } @@ -1265,7 +1258,6 @@ BuildDesktopNameList( Status = MmCopyToCaller(lpBuffer, &EntryCount, sizeof(DWORD)); if (! NT_SUCCESS(Status)) { - KeReleaseSpinLock(&WindowStation->Lock, OldLevel); ObDereferenceObject(WindowStation); return Status; } @@ -1277,22 +1269,17 @@ BuildDesktopNameList( DesktopEntry = DesktopEntry->Flink) { DesktopObject = CONTAINING_RECORD(DesktopEntry, DESKTOP, ListEntry); - _PRAGMA_WARNING_SUPPRESS(__WARNING_DEREF_NULL_PTR) - DesktopName = GET_DESKTOP_NAME(DesktopObject);/// @todo Don't mess around with the object headers! - if (!DesktopName) continue; - - Status = MmCopyToCaller(lpBuffer, DesktopName->Buffer, DesktopName->Length); + RtlInitUnicodeString(&DesktopName, DesktopObject->pDeskInfo->szDesktopName); + Status = MmCopyToCaller(lpBuffer, DesktopName.Buffer, DesktopName.Length); if (! NT_SUCCESS(Status)) { - KeReleaseSpinLock(&WindowStation->Lock, OldLevel); ObDereferenceObject(WindowStation); return Status; } - lpBuffer = (PVOID) ((PCHAR)lpBuffer + DesktopName->Length); + lpBuffer = (PVOID) ((PCHAR)lpBuffer + DesktopName.Length); Status = MmCopyToCaller(lpBuffer, &NullWchar, sizeof(WCHAR)); if (! NT_SUCCESS(Status)) { - KeReleaseSpinLock(&WindowStation->Lock, OldLevel); ObDereferenceObject(WindowStation); return Status; } @@ -1300,11 +1287,9 @@ BuildDesktopNameList( } /* - * Clean up + * Clean up and return */ - KeReleaseSpinLock(&WindowStation->Lock, OldLevel); ObDereferenceObject(WindowStation); - return STATUS_SUCCESS; } diff --git a/win32ss/user/ntuser/winsta.h b/win32ss/user/ntuser/winsta.h index 799db1efe9c..04fd0078001 100644 --- a/win32ss/user/ntuser/winsta.h +++ b/win32ss/user/ntuser/winsta.h @@ -11,11 +11,9 @@ typedef struct _WINSTATION_OBJECT { DWORD dwSessionId; - KSPIN_LOCK Lock; UNICODE_STRING Name; LIST_ENTRY DesktopListHead; PRTL_ATOM_TABLE AtomTable; - HANDLE SystemMenuTemplate; HANDLE ShellWindow; HANDLE ShellListView; diff --git a/win32ss/user/user32/controls/appswitch.c b/win32ss/user/user32/controls/appswitch.c index 4b2800b0a0d..5e1f7ce1f4d 100644 --- a/win32ss/user/user32/controls/appswitch.c +++ b/win32ss/user/user32/controls/appswitch.c @@ -17,7 +17,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(user32); #define MAX_WINDOWS 120 // Global variables -HWND switchdialog; +HWND switchdialog = NULL; HFONT dialogFont; int selectedWindow = 0; BOOL isOpen = FALSE; @@ -334,19 +334,26 @@ void ProcessHotKey() LRESULT WINAPI DoAppSwitch( WPARAM wParam, LPARAM lParam ) { - HWND hwnd; + HWND hwnd, hwndActive; MSG msg; BOOL Esc = FALSE; INT Count = 0; WCHAR Text[1024]; - switchdialog = NULL; + // Already in the loop. + if (switchdialog) return 0; + + hwndActive = GetActiveWindow(); + // Nothing is active so exit. + if (!hwndActive) return 0; + // Capture current active window. + SetCapture( hwndActive ); switch (lParam) { case VK_TAB: - if( !CreateSwitcherWindow(User32Instance) ) return 0; - if( !GetDialogFont() ) return 0; + if( !CreateSwitcherWindow(User32Instance) ) goto Exit; + if( !GetDialogFont() ) goto Exit; ProcessHotKey(); break; @@ -354,7 +361,7 @@ LRESULT WINAPI DoAppSwitch( WPARAM wParam, LPARAM lParam ) windowCount = 0; Count = 0; EnumWindowsZOrder(EnumerateCallback, 0); - if (windowCount < 2) return 0; + if (windowCount < 2) goto Exit; if (wParam == SC_NEXTWINDOW) Count = 1; else @@ -373,7 +380,7 @@ LRESULT WINAPI DoAppSwitch( WPARAM wParam, LPARAM lParam ) break; default: - return 0; + goto Exit; } // Main message loop: while (1) @@ -471,6 +478,7 @@ LRESULT WINAPI DoAppSwitch( WPARAM wParam, LPARAM lParam ) } } Exit: + ReleaseCapture(); if (switchdialog) DestroyWindow(switchdialog); switchdialog = NULL; selectedWindow = 0; diff --git a/win32ss/user/user32/lang/bg-BG.rc b/win32ss/user/user32/lang/bg-BG.rc index dc2d0686511..8c63abc8f3d 100644 --- a/win32ss/user/user32/lang/bg-BG.rc +++ b/win32ss/user/user32/lang/bg-BG.rc @@ -37,7 +37,20 @@ BEGIN MENUITEM "С&маляване", SC_MINIMIZE MENUITEM "У&големяване", SC_MAXIMIZE MENUITEM SEPARATOR - MENUITEM "&Затваряне\tAlt-F4", SC_CLOSE + MENUITEM "&Затваряне\tAlt+F4", SC_CLOSE +END + +SYSMENUMDI MENU +BEGIN + MENUITEM "&Възстановяване", SC_RESTORE + MENUITEM "&Преместване", SC_MOVE + MENUITEM "&Размер", SC_SIZE + MENUITEM "С&маляване", SC_MINIMIZE + MENUITEM "У&големяване", SC_MAXIMIZE + MENUITEM SEPARATOR + MENUITEM "&Затваряне\tCtrl+F4", SC_CLOSE + MENUITEM SEPARATOR + MENUITEM "На&пред\tCtrl+F6", SC_NEXTWINDOW END /* Strings */ diff --git a/win32ss/user/user32/lang/cs-CZ.rc b/win32ss/user/user32/lang/cs-CZ.rc index 99676bc4c8c..874b557f90a 100644 --- a/win32ss/user/user32/lang/cs-CZ.rc +++ b/win32ss/user/user32/lang/cs-CZ.rc @@ -42,7 +42,20 @@ BEGIN MENUITEM "Mi&nimalizovat", SC_MINIMIZE MENUITEM "Ma&ximalizovat", SC_MAXIMIZE MENUITEM SEPARATOR - MENUITEM "&Zavřít\tAlt-F4", SC_CLOSE + MENUITEM "&Zavřít\tAlt+F4", SC_CLOSE +END + +SYSMENUMDI MENU +BEGIN + MENUITEM "&Obnovit", SC_RESTORE + MENUITEM "&Přesunout", SC_MOVE + MENUITEM "&Velikost", SC_SIZE + MENUITEM "Mi&nimalizovat", SC_MINIMIZE + MENUITEM "Ma&ximalizovat", SC_MAXIMIZE + MENUITEM SEPARATOR + MENUITEM "&Zavřít\tCtrl+F4", SC_CLOSE + MENUITEM SEPARATOR + MENUITEM "Následující\tCtrl+F6", SC_NEXTWINDOW END /* Strings */ diff --git a/win32ss/user/user32/lang/da-DK.rc b/win32ss/user/user32/lang/da-DK.rc index 72e4dbced50..9a09cc4e804 100644 --- a/win32ss/user/user32/lang/da-DK.rc +++ b/win32ss/user/user32/lang/da-DK.rc @@ -37,7 +37,20 @@ BEGIN MENUITEM "M&inimere", SC_MINIMIZE MENUITEM "Ma&ksimere", SC_MAXIMIZE MENUITEM SEPARATOR - MENUITEM "&Luk\tAlt-F4", SC_CLOSE + MENUITEM "&Luk\tAlt+F4", SC_CLOSE +END + +SYSMENUMDI MENU +BEGIN + MENUITEM "&Gendan", SC_RESTORE + MENUITEM "&Flyt", SC_MOVE + MENUITEM "&Størrelse", SC_SIZE + MENUITEM "M&inimere", SC_MINIMIZE + MENUITEM "Ma&ksimere", SC_MAXIMIZE + MENUITEM SEPARATOR + MENUITEM "&Luk\tCtrl+F4", SC_CLOSE + MENUITEM SEPARATOR + MENUITEM "Næs&te\tCtrl+F6", SC_NEXTWINDOW END /* Strings */ diff --git a/win32ss/user/user32/lang/de-DE.rc b/win32ss/user/user32/lang/de-DE.rc index a451e73bde5..6857d7a0d52 100644 --- a/win32ss/user/user32/lang/de-DE.rc +++ b/win32ss/user/user32/lang/de-DE.rc @@ -42,6 +42,19 @@ BEGIN MENUITEM "S&chließen\tAlt+F4", SC_CLOSE END +SYSMENUMDI MENU +BEGIN + MENUITEM "&Wiederherstellen", SC_RESTORE + MENUITEM "&Verschieben", SC_MOVE + MENUITEM "&Größe", SC_SIZE + MENUITEM "Mi&nimieren", SC_MINIMIZE + MENUITEM "Ma&ximieren", SC_MAXIMIZE + MENUITEM SEPARATOR + MENUITEM "S&chließen\tStrg+F4", SC_CLOSE + MENUITEM SEPARATOR + MENUITEM "Nächs&ter\tStrg+F6", SC_NEXTWINDOW +END + /* Strings */ STRINGTABLE diff --git a/win32ss/user/user32/lang/el-GR.rc b/win32ss/user/user32/lang/el-GR.rc index cdc241a4db2..3443d8ba87d 100644 --- a/win32ss/user/user32/lang/el-GR.rc +++ b/win32ss/user/user32/lang/el-GR.rc @@ -37,7 +37,20 @@ BEGIN MENUITEM "Ε&λαχιστοποίηση", SC_MINIMIZE MENUITEM "Με&γιστοποίηση", SC_MAXIMIZE MENUITEM SEPARATOR - MENUITEM "&Κλείσημο\tAlt-F4", SC_CLOSE + MENUITEM "&Κλείσημο\tAlt+F4", SC_CLOSE +END + +SYSMENUMDI MENU +BEGIN + MENUITEM "&Επαναφορά", SC_RESTORE + MENUITEM "&Μετακίνηση", SC_MOVE + MENUITEM "Μέ&γεθος", SC_SIZE + MENUITEM "Ε&λαχιστοποίηση", SC_MINIMIZE + MENUITEM "Με&γιστοποίηση", SC_MAXIMIZE + MENUITEM SEPARATOR + MENUITEM "&Κλείσημο\tCtrl+F4", SC_CLOSE + MENUITEM SEPARATOR + MENUITEM "&Επόμενο\tCtrl+F6", SC_NEXTWINDOW END /* Strings */ diff --git a/win32ss/user/user32/lang/en-US.rc b/win32ss/user/user32/lang/en-US.rc index fbf23071e05..79e64259f0c 100644 --- a/win32ss/user/user32/lang/en-US.rc +++ b/win32ss/user/user32/lang/en-US.rc @@ -40,6 +40,19 @@ BEGIN MENUITEM "&Close\tAlt+F4", SC_CLOSE END +SYSMENUMDI MENU +{ + MENUITEM "&Restore", SC_RESTORE + MENUITEM "&Move", SC_MOVE + MENUITEM "&Size", SC_SIZE + MENUITEM "Mi&nimize", SC_MINIMIZE + MENUITEM "Ma&ximize", SC_MAXIMIZE + MENUITEM SEPARATOR + MENUITEM "&Close\tCtrl+F4", SC_CLOSE + MENUITEM SEPARATOR + MENUITEM "Nex&t\tCtrl+F6", SC_NEXTWINDOW +} + /* Strings */ STRINGTABLE diff --git a/win32ss/user/user32/lang/es-ES.rc b/win32ss/user/user32/lang/es-ES.rc index 0f22e7a1ef0..bba5362264b 100644 --- a/win32ss/user/user32/lang/es-ES.rc +++ b/win32ss/user/user32/lang/es-ES.rc @@ -37,7 +37,20 @@ BEGIN MENUITEM "Mi&nimizar", SC_MINIMIZE MENUITEM "Ma&ximizar", SC_MAXIMIZE MENUITEM SEPARATOR - MENUITEM "&Cerrar\tAlt-F4", SC_CLOSE + MENUITEM "&Cerrar\tAlt+F4", SC_CLOSE +END + +SYSMENUMDI MENU +BEGIN + MENUITEM "&Restaurar", SC_RESTORE + MENUITEM "&Mover", SC_MOVE + MENUITEM "Tamaño", SC_SIZE + MENUITEM "Mi&nimizar", SC_MINIMIZE + MENUITEM "Ma&ximizar", SC_MAXIMIZE + MENUITEM SEPARATOR + MENUITEM "&Cerrar\tCtrl+F4", SC_CLOSE + MENUITEM SEPARATOR + MENUITEM "Siguien&te\t\tCtrl+F6", SC_NEXTWINDOW END /* Strings */ diff --git a/win32ss/user/user32/lang/fr-FR.rc b/win32ss/user/user32/lang/fr-FR.rc index 34b0d3fa549..6be621c4372 100644 --- a/win32ss/user/user32/lang/fr-FR.rc +++ b/win32ss/user/user32/lang/fr-FR.rc @@ -39,7 +39,20 @@ BEGIN MENUITEM "Réd&uire", SC_MINIMIZE MENUITEM "Agra&ndir", SC_MAXIMIZE MENUITEM SEPARATOR - MENUITEM "&Fermer\tAlt-F4", SC_CLOSE + MENUITEM "&Fermer\tAlt+F4", SC_CLOSE +END + +SYSMENUMDI MENU +BEGIN + MENUITEM "&Restaurer", SC_RESTORE + MENUITEM "Dép&lacer", SC_MOVE + MENUITEM "&Taille", SC_SIZE + MENUITEM "Réd&uire", SC_MINIMIZE + MENUITEM "Agra&ndir", SC_MAXIMIZE + MENUITEM SEPARATOR + MENUITEM "&Fermer\tCtrl+F4", SC_CLOSE + MENUITEM SEPARATOR + MENUITEM "Sui&vant\tCtrl+F6", SC_NEXTWINDOW END /* Strings */ diff --git a/win32ss/user/user32/lang/he-IL.rc b/win32ss/user/user32/lang/he-IL.rc index 4cb31f059b8..dba178e8576 100644 --- a/win32ss/user/user32/lang/he-IL.rc +++ b/win32ss/user/user32/lang/he-IL.rc @@ -37,7 +37,20 @@ BEGIN MENUITEM "&מזער", SC_MINIMIZE MENUITEM "&הגדל", SC_MAXIMIZE MENUITEM SEPARATOR - MENUITEM "&סגור\tAlt-F4", SC_CLOSE + MENUITEM "&סגור\tAlt+F4", SC_CLOSE +END + +SYSMENUMDI MENU +BEGIN + MENUITEM "&שחזר", SC_RESTORE + MENUITEM "&הזז", SC_MOVE + MENUITEM "&שנה גודל", SC_SIZE + MENUITEM "&מזער", SC_MINIMIZE + MENUITEM "&הגדל", SC_MAXIMIZE + MENUITEM SEPARATOR + MENUITEM "&סגור\tCtrl+F4", SC_CLOSE + MENUITEM SEPARATOR + MENUITEM "ה&בא\tCtrl+F6", SC_NEXTWINDOW END /* Strings */ diff --git a/win32ss/user/user32/lang/hu-HU.rc b/win32ss/user/user32/lang/hu-HU.rc index 3fa5279917e..e2818592999 100644 --- a/win32ss/user/user32/lang/hu-HU.rc +++ b/win32ss/user/user32/lang/hu-HU.rc @@ -39,7 +39,20 @@ BEGIN MENUITEM "&Kis méret", SC_MINIMIZE MENUITEM "&Nagy méret", SC_MAXIMIZE MENUITEM SEPARATOR - MENUITEM "&Bezár\tAlt-F4", SC_CLOSE + MENUITEM "&Bezár\tAlt+F4", SC_CLOSE +END + +SYSMENUMDI MENU +BEGIN + MENUITEM "&Vissza állít", SC_RESTORE + MENUITEM "Át &helyez", SC_MOVE + MENUITEM "&Méret", SC_SIZE + MENUITEM "&Kis méret", SC_MINIMIZE + MENUITEM "&Nagy méret", SC_MAXIMIZE + MENUITEM SEPARATOR + MENUITEM "&Bezár\tCtrl+F4", SC_CLOSE + MENUITEM SEPARATOR + MENUITEM "&Előre\tCtrl+F6", SC_NEXTWINDOW END /* Strings */ diff --git a/win32ss/user/user32/lang/id-ID.rc b/win32ss/user/user32/lang/id-ID.rc index d8c92159e23..5ef794e2b4a 100644 --- a/win32ss/user/user32/lang/id-ID.rc +++ b/win32ss/user/user32/lang/id-ID.rc @@ -37,7 +37,20 @@ BEGIN MENUITEM "Ke&cilkan", SC_MINIMIZE MENUITEM "Maksi&malkan", SC_MAXIMIZE MENUITEM SEPARATOR - MENUITEM "&Tutup\tAlt-F4", SC_CLOSE + MENUITEM "&Tutup\tAlt+F4", SC_CLOSE +END + +SYSMENUMDI MENU +BEGIN + MENUITEM "&Kembalikan", SC_RESTORE + MENUITEM "&Pindahkan", SC_MOVE + MENUITEM "&Ukuran", SC_SIZE + MENUITEM "Ke&cilkan", SC_MINIMIZE + MENUITEM "Maksi&malkan", SC_MAXIMIZE + MENUITEM SEPARATOR + MENUITEM "&Tutup\tCrtl+F4", SC_CLOSE + MENUITEM SEPARATOR + MENUITEM "&Berikutnya\tCtrl+F6", SC_NEXTWINDOW END /* Strings */ diff --git a/win32ss/user/user32/lang/it-IT.rc b/win32ss/user/user32/lang/it-IT.rc index 184b4efbc08..8710f168243 100644 --- a/win32ss/user/user32/lang/it-IT.rc +++ b/win32ss/user/user32/lang/it-IT.rc @@ -37,7 +37,20 @@ BEGIN MENUITEM "Mi&nimizza", SC_MINIMIZE MENUITEM "Ma&ssimizza", SC_MAXIMIZE MENUITEM SEPARATOR - MENUITEM "&Chiudi\tAlt-F4", SC_CLOSE + MENUITEM "&Chiudi\tAlt+F4", SC_CLOSE +END + +SYSMENUMDI MENU +BEGIN + MENUITEM "&Ripristina", SC_RESTORE + MENUITEM "&Muove", SC_MOVE + MENUITEM "&Dimensione", SC_SIZE + MENUITEM "Mi&nimizza", SC_MINIMIZE + MENUITEM "Ma&ssimizza", SC_MAXIMIZE + MENUITEM SEPARATOR + MENUITEM "&Chiudi\tCtrl+F4", SC_CLOSE + MENUITEM SEPARATOR + MENUITEM "&Prossimo\tCtrl+F6", SC_NEXTWINDOW END /* Strings */ diff --git a/win32ss/user/user32/lang/ja-JP.rc b/win32ss/user/user32/lang/ja-JP.rc index 8f7848fd805..def7aaac8d6 100644 --- a/win32ss/user/user32/lang/ja-JP.rc +++ b/win32ss/user/user32/lang/ja-JP.rc @@ -37,7 +37,20 @@ BEGIN MENUITEM "最小化(&N)", SC_MINIMIZE MENUITEM "最大化(&X)", SC_MAXIMIZE MENUITEM SEPARATOR - MENUITEM "閉じる(&C)\tAlt-F4", SC_CLOSE + MENUITEM "閉じる(&C)\tAlt+F4", SC_CLOSE +END + +SYSMENUMDI MENU +BEGIN + MENUITEM "元のサイズに戻す(&R)", SC_RESTORE + MENUITEM "移動(&M)", SC_MOVE + MENUITEM "サイズ変更(&S)", SC_SIZE + MENUITEM "最小化(&N)", SC_MINIMIZE + MENUITEM "最大化(&X)", SC_MAXIMIZE + MENUITEM SEPARATOR + MENUITEM "閉じる(&C)\tCtrl+F4", SC_CLOSE + MENUITEM SEPARATOR + MENUITEM "次のウィンドウ(&T)\tCtrl+F6", SC_NEXTWINDOW END /* Strings */ diff --git a/win32ss/user/user32/lang/lt-LT.rc b/win32ss/user/user32/lang/lt-LT.rc index 556a16928cf..5cec6b176cd 100644 --- a/win32ss/user/user32/lang/lt-LT.rc +++ b/win32ss/user/user32/lang/lt-LT.rc @@ -39,7 +39,20 @@ BEGIN MENUITEM "Su&skleisti", SC_MINIMIZE MENUITEM "Pa&didint", SC_MAXIMIZE MENUITEM SEPARATOR - MENUITEM "&Uþverti\tAlt-F4", SC_CLOSE + MENUITEM "&Uþverti\tAlt+F4", SC_CLOSE +END + +SYSMENUMDI MENU +BEGIN + MENUITEM "A&tkurti", SC_RESTORE + MENUITEM "Pe&rkelti", SC_MOVE + MENUITEM "D&ydis", SC_SIZE + MENUITEM "Su&skleisti", SC_MINIMIZE + MENUITEM "Pa&didint", SC_MAXIMIZE + MENUITEM SEPARATOR + MENUITEM "&Uþverti\tVald-F4", SC_CLOSE + MENUITEM SEPARATOR + MENUITEM "Ki&tas\tVald+F6", SC_NEXTWINDOW END /* Strings */ diff --git a/win32ss/user/user32/lang/nl-NL.rc b/win32ss/user/user32/lang/nl-NL.rc index 6c2db93e320..27fbae95e92 100644 --- a/win32ss/user/user32/lang/nl-NL.rc +++ b/win32ss/user/user32/lang/nl-NL.rc @@ -37,7 +37,20 @@ BEGIN MENUITEM "Mi&nimaliseren", SC_MINIMIZE MENUITEM "Ma&ximaliseren", SC_MAXIMIZE MENUITEM SEPARATOR - MENUITEM "&Afsluiten\tAlt-F4", SC_CLOSE + MENUITEM "&Afsluiten\tAlt+F4", SC_CLOSE +END + +SYSMENUMDI MENU +BEGIN + MENUITEM "&Herstellen", SC_RESTORE + MENUITEM "&Verplaatsen", SC_MOVE + MENUITEM "&Grootte", SC_SIZE + MENUITEM "Mi&nimaliseren", SC_MINIMIZE + MENUITEM "Ma&ximaliseren", SC_MAXIMIZE + MENUITEM SEPARATOR + MENUITEM "&Afsluiten\tCtrl+F4", SC_CLOSE + MENUITEM SEPARATOR + MENUITEM "Volgende\tCtrl+F6", SC_NEXTWINDOW END /* Strings */ diff --git a/win32ss/user/user32/lang/no-NO.rc b/win32ss/user/user32/lang/no-NO.rc index 480c3cf588d..2b7215102e5 100644 --- a/win32ss/user/user32/lang/no-NO.rc +++ b/win32ss/user/user32/lang/no-NO.rc @@ -37,7 +37,20 @@ BEGIN MENUITEM "Mi&nimer", SC_MINIMIZE MENUITEM "&Maksimer", SC_MAXIMIZE MENUITEM SEPARATOR - MENUITEM "&Lukk\tAlt-F4", SC_CLOSE + MENUITEM "&Lukk\tAlt+F4", SC_CLOSE +END + +SYSMENUMDI MENU +BEGIN + MENUITEM "&Gjenopprett", SC_RESTORE + MENUITEM "&Flytt", SC_MOVE + MENUITEM "&Størrelse", SC_SIZE + MENUITEM "Mi&nimer", SC_MINIMIZE + MENUITEM "&Maksimer", SC_MAXIMIZE + MENUITEM SEPARATOR + MENUITEM "&Lukk\tCtrl+F4", SC_CLOSE + MENUITEM SEPARATOR + MENUITEM "Nes&e\tCtrl + F6", SC_NEXTWINDOW END /* Strings */ diff --git a/win32ss/user/user32/lang/pl-PL.rc b/win32ss/user/user32/lang/pl-PL.rc index 8dd2e9f20a3..2d35da0354c 100644 --- a/win32ss/user/user32/lang/pl-PL.rc +++ b/win32ss/user/user32/lang/pl-PL.rc @@ -42,7 +42,20 @@ BEGIN MENUITEM "&Minimalizuj", SC_MINIMIZE MENUITEM "Mak&symalizuj", SC_MAXIMIZE MENUITEM SEPARATOR - MENUITEM "Zam&knij\tAlt-F4", SC_CLOSE + MENUITEM "Zam&knij\tAlt+F4", SC_CLOSE +END + +SYSMENUMDI MENU +BEGIN + MENUITEM "&Przywróć", SC_RESTORE + MENUITEM "Prz&enieś", SC_MOVE + MENUITEM "&Rozmiar", SC_SIZE + MENUITEM "&Minimalizuj", SC_MINIMIZE + MENUITEM "Mak&symalizuj", SC_MAXIMIZE + MENUITEM SEPARATOR + MENUITEM "Zam&knij\tCtrl+F4", SC_CLOSE + MENUITEM SEPARATOR + MENUITEM "Nas&tępny\tCtrl+F6", SC_NEXTWINDOW END /* Strings */ diff --git a/win32ss/user/user32/lang/pt-BR.rc b/win32ss/user/user32/lang/pt-BR.rc index 3d504e9a07c..e33dbc0828f 100644 --- a/win32ss/user/user32/lang/pt-BR.rc +++ b/win32ss/user/user32/lang/pt-BR.rc @@ -39,7 +39,20 @@ BEGIN MENUITEM "Mi&nimizar", SC_MINIMIZE MENUITEM "Ma&ximizar", SC_MAXIMIZE MENUITEM SEPARATOR - MENUITEM "&Fechar\tAlt-F4", SC_CLOSE + MENUITEM "&Fechar\tAlt+F4", SC_CLOSE +END + +SYSMENUMDI MENU +BEGIN + MENUITEM "&Restaurar", SC_RESTORE + MENUITEM "&Mover", SC_MOVE + MENUITEM "&Tamanho", SC_SIZE + MENUITEM "Mi&nimizar", SC_MINIMIZE + MENUITEM "Ma&ximizar", SC_MAXIMIZE + MENUITEM SEPARATOR + MENUITEM "&Fechar\tCtrl+F4", SC_CLOSE + MENUITEM SEPARATOR + MENUITEM "&Próximo\tCtrl+F6", SC_NEXTWINDOW END /* Strings */ diff --git a/win32ss/user/user32/lang/ro-RO.rc b/win32ss/user/user32/lang/ro-RO.rc index 41619ad8334..6f3645cf3bb 100644 --- a/win32ss/user/user32/lang/ro-RO.rc +++ b/win32ss/user/user32/lang/ro-RO.rc @@ -39,7 +39,20 @@ BEGIN MENUITEM "Mi&nimizează", SC_MINIMIZE MENUITEM "Ma&ximizează", SC_MAXIMIZE MENUITEM SEPARATOR - MENUITEM "Închid&e\tAlt-F4", SC_CLOSE + MENUITEM "Închid&e\tAlt+F4", SC_CLOSE +END + +SYSMENUMDI MENU +BEGIN + MENUITEM "&Restabilește", SC_RESTORE + MENUITEM "&Mută", SC_MOVE + MENUITEM "Re&dimensionează", SC_SIZE + MENUITEM "Mi&nimizează", SC_MINIMIZE + MENUITEM "Ma&ximizează", SC_MAXIMIZE + MENUITEM SEPARATOR + MENUITEM "Închid&e\tCtrl+F4", SC_CLOSE + MENUITEM SEPARATOR + MENUITEM "Înain&te\tCtrl+F6", SC_NEXTWINDOW END /* Strings */ diff --git a/win32ss/user/user32/lang/ru-RU.rc b/win32ss/user/user32/lang/ru-RU.rc index 24b4d628fd2..642f33187af 100644 --- a/win32ss/user/user32/lang/ru-RU.rc +++ b/win32ss/user/user32/lang/ru-RU.rc @@ -37,7 +37,20 @@ BEGIN MENUITEM "&Свернуть", SC_MINIMIZE MENUITEM "&Развернуть", SC_MAXIMIZE MENUITEM SEPARATOR - MENUITEM "&Закрыть\tAlt-F4", SC_CLOSE + MENUITEM "&Закрыть\tAlt+F4", SC_CLOSE +END + +SYSMENUMDI MENU +BEGIN + MENUITEM "&Востановить", SC_RESTORE + MENUITEM "&Переместить", SC_MOVE + MENUITEM "Р&азмер", SC_SIZE + MENUITEM "&Свернуть", SC_MINIMIZE + MENUITEM "&Развернуть", SC_MAXIMIZE + MENUITEM SEPARATOR + MENUITEM "&Закрыть\tCtrl+F4", SC_CLOSE + MENUITEM SEPARATOR + MENUITEM "С&ледующее\tCtrl+F6", SC_NEXTWINDOW END /* Strings */ diff --git a/win32ss/user/user32/lang/sk-SK.rc b/win32ss/user/user32/lang/sk-SK.rc index f7ca522ebb5..6d9c8e39f44 100644 --- a/win32ss/user/user32/lang/sk-SK.rc +++ b/win32ss/user/user32/lang/sk-SK.rc @@ -39,7 +39,20 @@ BEGIN MENUITEM "&Minimalizovať", SC_MINIMIZE MENUITEM "M&aximalizovať", SC_MAXIMIZE MENUITEM SEPARATOR - MENUITEM "&Zavrieť\tAlt-F4", SC_CLOSE + MENUITEM "&Zavrieť\tAlt+F4", SC_CLOSE +END + +SYSMENUMDI MENU +BEGIN + MENUITEM "&Obnoviť", SC_RESTORE + MENUITEM "&Premiestniť", SC_MOVE + MENUITEM "&Veľkosť", SC_SIZE + MENUITEM "&Minimalizovať", SC_MINIMIZE + MENUITEM "M&aximalizovať", SC_MAXIMIZE + MENUITEM SEPARATOR + MENUITEM "&Zavrieť\tCtrl+F4", SC_CLOSE + MENUITEM SEPARATOR + MENUITEM "&Ďalej\tCtrl+F6", SC_NEXTWINDOW END /* Strings */ diff --git a/win32ss/user/user32/lang/sv-SE.rc b/win32ss/user/user32/lang/sv-SE.rc index 06af11fd40e..61f4a64de64 100644 --- a/win32ss/user/user32/lang/sv-SE.rc +++ b/win32ss/user/user32/lang/sv-SE.rc @@ -39,7 +39,20 @@ BEGIN MENUITEM "&Minimera", SC_MINIMIZE MENUITEM "Ma&ximera", SC_MAXIMIZE MENUITEM SEPARATOR - MENUITEM "&Stäng\tAlt-F4", SC_CLOSE + MENUITEM "&Stäng\tAlt+F4", SC_CLOSE +END + +SYSMENUMDI MENU +BEGIN + MENUITEM "&Återställ", SC_RESTORE + MENUITEM "&Flytta", SC_MOVE + MENUITEM "S&torlek", SC_SIZE + MENUITEM "&Minimera", SC_MINIMIZE + MENUITEM "Ma&ximera", SC_MAXIMIZE + MENUITEM SEPARATOR + MENUITEM "&Stäng\tCtrl+F4", SC_CLOSE + MENUITEM SEPARATOR + MENUITEM "&Nästa\tCtrl+F6", SC_NEXTWINDOW END /* Strings */ diff --git a/win32ss/user/user32/lang/tr-TR.rc b/win32ss/user/user32/lang/tr-TR.rc index a45051b2b99..0be1bfb8c8a 100644 --- a/win32ss/user/user32/lang/tr-TR.rc +++ b/win32ss/user/user32/lang/tr-TR.rc @@ -39,7 +39,20 @@ BEGIN MENUITEM "&Simge Durumuna Küçült", SC_MINIMIZE MENUITEM "&Ekranı Kapla", SC_MAXIMIZE MENUITEM SEPARATOR - MENUITEM "&Kapat\tAlt-F4", SC_CLOSE + MENUITEM "&Kapat\tAlt+F4", SC_CLOSE +END + +SYSMENUMDI MENU +BEGIN + MENUITEM "Ö&nceki Boyut", SC_RESTORE + MENUITEM "&Taşı", SC_MOVE + MENUITEM "&Boyut", SC_SIZE + MENUITEM "&Simge Durumuna Küçült", SC_MINIMIZE + MENUITEM "&Ekranı Kapla", SC_MAXIMIZE + MENUITEM SEPARATOR + MENUITEM "&Kapat\tCtrl+F4", SC_CLOSE + MENUITEM SEPARATOR + MENUITEM "İle&ri\tCtrl+F6", SC_NEXTWINDOW END /* Strings */ diff --git a/win32ss/user/user32/lang/uk-UA.rc b/win32ss/user/user32/lang/uk-UA.rc index 2986e1d03e7..278a20957c6 100644 --- a/win32ss/user/user32/lang/uk-UA.rc +++ b/win32ss/user/user32/lang/uk-UA.rc @@ -37,7 +37,20 @@ BEGIN MENUITEM "З&горнути", SC_MINIMIZE MENUITEM "&Розгорнути", SC_MAXIMIZE MENUITEM SEPARATOR - MENUITEM "&Закрити\tAlt-F4", SC_CLOSE + MENUITEM "&Закрити\tAlt+F4", SC_CLOSE +END + +SYSMENUMDI MENU +BEGIN + MENUITEM "&Відновити", SC_RESTORE + MENUITEM "П&еремістити", SC_MOVE + MENUITEM "Роз&мір", SC_SIZE + MENUITEM "З&горнути", SC_MINIMIZE + MENUITEM "&Розгорнути", SC_MAXIMIZE + MENUITEM SEPARATOR + MENUITEM "&Закрити\tCtrl+F4", SC_CLOSE + MENUITEM SEPARATOR + MENUITEM "Нас&тупний\tCtrl+F6", SC_NEXTWINDOW END /* Strings */ diff --git a/win32ss/user/user32/lang/zh-CN.rc b/win32ss/user/user32/lang/zh-CN.rc index 8e625eb5f86..e59cbc0cb60 100644 --- a/win32ss/user/user32/lang/zh-CN.rc +++ b/win32ss/user/user32/lang/zh-CN.rc @@ -40,6 +40,19 @@ BEGIN MENUITEM "关闭(&C)\tAlt+F4", SC_CLOSE END +SYSMENUMDI MENU +BEGIN + MENUITEM "还原(&R)", SC_RESTORE + MENUITEM "移动(&M)", SC_MOVE + MENUITEM "大小(&S)", SC_SIZE + MENUITEM "最小化(&n)", SC_MINIMIZE + MENUITEM "最大化(&x)", SC_MAXIMIZE + MENUITEM SEPARATOR + MENUITEM "关闭(&C)\tCtrl+F4", SC_CLOSE + MENUITEM SEPARATOR + MENUITEM "下一步(&T)\tCtrl+F6", SC_NEXTWINDOW +END + /* Strings */ STRINGTABLE diff --git a/win32ss/user/user32/misc/dde.c b/win32ss/user/user32/misc/dde.c index 30498d13c11..d600ba47876 100644 --- a/win32ss/user/user32/misc/dde.c +++ b/win32ss/user/user32/misc/dde.c @@ -36,7 +36,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ddeml); static WDML_INSTANCE* WDML_InstanceList = NULL; static LONG WDML_MaxInstanceID = 0; /* OK for present, have to worry about wrap-around later */ -const WCHAR WDML_szEventClass[] = {'D','d','e','E','v','e','n','t','C','l','a','s','s',0}; +const WCHAR WDML_szEventClass[] = {'D','D','E','M','L','E','v','e','n','t',0}; /* protection for instance list */ CRITICAL_SECTION WDML_CritSect; @@ -91,7 +91,7 @@ LPARAM WINAPI PackDDElParam(UINT msg, UINT_PTR uiLo, UINT_PTR uiHi) return uiHi; default: - return MAKELPARAM(uiLo, uiHi); + return MAKELONG(uiLo, uiHi); } } @@ -229,7 +229,7 @@ BOOL WINAPI ImpersonateDdeClientWindow(HWND hWndClient, HWND hWndServer) * DdeSetQualityOfService (USER32.@) */ -BOOL WINAPI DdeSetQualityOfService(HWND hwndClient, CONST SECURITY_QUALITY_OF_SERVICE *pqosNew, +BOOL WINAPI DdeSetQualityOfService(HWND hwndClient, const SECURITY_QUALITY_OF_SERVICE *pqosNew, PSECURITY_QUALITY_OF_SERVICE pqosPrev) { FIXME("(%p %p %p): stub\n", hwndClient, pqosNew, pqosPrev); @@ -238,535 +238,10 @@ BOOL WINAPI DdeSetQualityOfService(HWND hwndClient, CONST SECURITY_QUALITY_OF_SE /* ================================================================ * - * Instance management + * WDML Error management * * ================================================================ */ -/****************************************************************************** - * IncrementInstanceId - * - * generic routine to increment the max instance Id and allocate a new application instance - */ -static void WDML_IncrementInstanceId(WDML_INSTANCE* pInstance) -{ - DWORD id = InterlockedIncrement(&WDML_MaxInstanceID); - - pInstance->instanceID = id; - TRACE("New instance id %d allocated\n", id); -} - -/****************************************************************** - * WDML_EventProc - * - * - */ -static LRESULT CALLBACK WDML_EventProc(HWND hwndEvent, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - WDML_INSTANCE* pInstance; - HSZ hsz1, hsz2; - - switch (uMsg) - { - case WM_WDML_REGISTER: - pInstance = WDML_GetInstanceFromWnd(hwndEvent); - /* try calling the Callback */ - if (pInstance && !(pInstance->CBFflags & CBF_SKIP_REGISTRATIONS)) - { - hsz1 = WDML_MakeHszFromAtom(pInstance, wParam); - hsz2 = WDML_MakeHszFromAtom(pInstance, lParam); - WDML_InvokeCallback(pInstance, XTYP_REGISTER, 0, 0, hsz1, hsz2, 0, 0, 0); - WDML_DecHSZ(pInstance, hsz1); - WDML_DecHSZ(pInstance, hsz2); - } - break; - - case WM_WDML_UNREGISTER: - pInstance = WDML_GetInstanceFromWnd(hwndEvent); - if (pInstance && !(pInstance->CBFflags & CBF_SKIP_UNREGISTRATIONS)) - { - hsz1 = WDML_MakeHszFromAtom(pInstance, wParam); - hsz2 = WDML_MakeHszFromAtom(pInstance, lParam); - WDML_InvokeCallback(pInstance, XTYP_UNREGISTER, 0, 0, hsz1, hsz2, 0, 0, 0); - WDML_DecHSZ(pInstance, hsz1); - WDML_DecHSZ(pInstance, hsz2); - } - break; - - case WM_WDML_CONNECT_CONFIRM: - pInstance = WDML_GetInstanceFromWnd(hwndEvent); - if (pInstance && !(pInstance->CBFflags & CBF_SKIP_CONNECT_CONFIRMS)) - { - WDML_CONV* pConv; - /* confirm connection... - * lookup for this conv handle - */ - HWND client = (HWND)wParam; - HWND server = (HWND)lParam; - for (pConv = pInstance->convs[WDML_SERVER_SIDE]; pConv != NULL; pConv = pConv->next) - { - if (pConv->hwndClient == client && pConv->hwndServer == server) - break; - } - if (pConv) - { - pConv->wStatus |= ST_ISLOCAL; - - WDML_InvokeCallback(pInstance, XTYP_CONNECT_CONFIRM, 0, (HCONV)pConv, - pConv->hszTopic, pConv->hszService, 0, 0, - (pConv->wStatus & ST_ISSELF) ? 1 : 0); - } - } - break; - default: - return DefWindowProcW(hwndEvent, uMsg, wParam, lParam); - } - return 0; -} - -/****************************************************************** - * WDML_Initialize - * - * - */ -UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback, - DWORD afCmd, DWORD ulRes, BOOL bUnicode) -{ - WDML_INSTANCE* pInstance; - WDML_INSTANCE* reference_inst; - UINT ret; - WNDCLASSEXW wndclass; - - TRACE("(%p,%p,0x%x,%d,0x%x)\n", - pidInst, pfnCallback, afCmd, ulRes, bUnicode); - - if (ulRes) - { - ERR("Reserved value not zero? What does this mean?\n"); - /* trap this and no more until we know more */ - return DMLERR_NO_ERROR; - } - - /* grab enough heap for one control struct - not really necessary for re-initialise - * but allows us to use same validation routines */ - pInstance = HeapAlloc(GetProcessHeap(), 0, sizeof(WDML_INSTANCE)); - if (pInstance == NULL) - { - /* catastrophe !! warn user & abort */ - ERR("Instance create failed - out of memory\n"); - return DMLERR_SYS_ERROR; - } - pInstance->next = NULL; - pInstance->monitor = (afCmd | APPCLASS_MONITOR); - - /* messy bit, spec implies that 'Client Only' can be set in 2 different ways, catch 1 here */ - - pInstance->clientOnly = afCmd & APPCMD_CLIENTONLY; - pInstance->instanceID = *pidInst; /* May need to add calling proc Id */ - pInstance->threadID = GetCurrentThreadId(); - pInstance->callback = *pfnCallback; - pInstance->unicode = bUnicode; - pInstance->nodeList = NULL; /* node will be added later */ - pInstance->monitorFlags = afCmd & MF_MASK; - pInstance->wStatus = 0; - pInstance->lastError = DMLERR_NO_ERROR; - pInstance->servers = NULL; - pInstance->convs[0] = NULL; - pInstance->convs[1] = NULL; - pInstance->links[0] = NULL; - pInstance->links[1] = NULL; - - /* isolate CBF flags in one go, expect this will go the way of all attempts to be clever !! */ - - pInstance->CBFflags = afCmd^((afCmd&MF_MASK)|((afCmd&APPCMD_MASK)|(afCmd&APPCLASS_MASK))); - - if (!pInstance->clientOnly) - { - /* Check for other way of setting Client-only !! */ - pInstance->clientOnly = - (pInstance->CBFflags & CBF_FAIL_ALLSVRXACTIONS) == CBF_FAIL_ALLSVRXACTIONS; - } - - TRACE("instance created - checking validity\n"); - - if (*pidInst == 0) - { - /* Initialisation of new Instance Identifier */ - TRACE("new instance, callback %p flags %X\n",pfnCallback,afCmd); - - EnterCriticalSection(&WDML_CritSect); - - if (WDML_InstanceList == NULL) - { - /* can't be another instance in this case, assign to the base pointer */ - WDML_InstanceList = pInstance; - - /* since first must force filter of XTYP_CONNECT and XTYP_WILDCONNECT for - * present - * ------------------------------- NOTE NOTE NOTE -------------------------- - * - * the manual is not clear if this condition - * applies to the first call to DdeInitialize from an application, or the - * first call for a given callback !!! - */ - - pInstance->CBFflags = pInstance->CBFflags|APPCMD_FILTERINITS; - TRACE("First application instance detected OK\n"); - /* allocate new instance ID */ - WDML_IncrementInstanceId(pInstance); - } - else - { - /* really need to chain the new one in to the latest here, but after checking conditions - * such as trying to start a conversation from an application trying to monitor */ - reference_inst = WDML_InstanceList; - TRACE("Subsequent application instance - starting checks\n"); - while (reference_inst->next != NULL) - { - /* - * This set of tests will work if application uses same instance Id - * at application level once allocated - which is what manual implies - * should happen. If someone tries to be - * clever (lazy ?) it will fail to pick up that later calls are for - * the same application - should we trust them ? - */ - if (pInstance->instanceID == reference_inst->instanceID) - { - /* Check 1 - must be same Client-only state */ - - if (pInstance->clientOnly != reference_inst->clientOnly) - { - ret = DMLERR_DLL_USAGE; - goto theError; - } - - /* Check 2 - cannot use 'Monitor' with any non-monitor modes */ - - if (pInstance->monitor != reference_inst->monitor) - { - ret = DMLERR_INVALIDPARAMETER; - goto theError; - } - - /* Check 3 - must supply different callback address */ - - if (pInstance->callback == reference_inst->callback) - { - ret = DMLERR_DLL_USAGE; - goto theError; - } - } - reference_inst = reference_inst->next; - } - /* All cleared, add to chain */ - - TRACE("Application Instance checks finished\n"); - WDML_IncrementInstanceId(pInstance); - reference_inst->next = pInstance; - } - LeaveCriticalSection(&WDML_CritSect); - - *pidInst = pInstance->instanceID; - - /* for deadlock issues, windows must always be created when outside the critical section */ - wndclass.cbSize = sizeof(wndclass); - wndclass.style = 0; - wndclass.lpfnWndProc = WDML_EventProc; - wndclass.cbClsExtra = 0; - wndclass.cbWndExtra = sizeof(ULONG_PTR); - wndclass.hInstance = 0; - wndclass.hIcon = 0; - wndclass.hCursor = 0; - wndclass.hbrBackground = 0; - wndclass.lpszMenuName = NULL; - wndclass.lpszClassName = WDML_szEventClass; - wndclass.hIconSm = 0; - - RegisterClassExW(&wndclass); - - pInstance->hwndEvent = CreateWindowW(WDML_szEventClass, NULL, - WS_POPUP, 0, 0, 0, 0, - 0, 0, 0, 0); - - SetWindowLongPtrW(pInstance->hwndEvent, GWL_WDML_INSTANCE, (ULONG_PTR)pInstance); - - TRACE("New application instance processing finished OK\n"); - } - else - { - /* Reinitialisation situation --- FIX */ - TRACE("reinitialisation of (%p,%p,0x%x,%d): stub\n", pidInst, pfnCallback, afCmd, ulRes); - - EnterCriticalSection(&WDML_CritSect); - - if (WDML_InstanceList == NULL) - { - ret = DMLERR_INVALIDPARAMETER; - goto theError; - } - /* can't reinitialise if we have initialised nothing !! */ - reference_inst = WDML_InstanceList; - /* must first check if we have been given a valid instance to re-initialise !! how do we do that ? */ - /* - * MS allows initialisation without specifying a callback, should we allow addition of the - * callback by a later call to initialise ? - if so this lot will have to change - */ - while (reference_inst->next != NULL) - { - if (*pidInst == reference_inst->instanceID && pfnCallback == reference_inst->callback) - { - /* Check 1 - cannot change client-only mode if set via APPCMD_CLIENTONLY */ - - if (reference_inst->clientOnly) - { - if ((reference_inst->CBFflags & CBF_FAIL_ALLSVRXACTIONS) != CBF_FAIL_ALLSVRXACTIONS) - { - /* i.e. Was set to Client-only and through APPCMD_CLIENTONLY */ - - if (!(afCmd & APPCMD_CLIENTONLY)) - { - ret = DMLERR_INVALIDPARAMETER; - goto theError; - } - } - } - /* Check 2 - cannot change monitor modes */ - - if (pInstance->monitor != reference_inst->monitor) - { - ret = DMLERR_INVALIDPARAMETER; - goto theError; - } - - /* Check 3 - trying to set Client-only via APPCMD when not set so previously */ - - if ((afCmd&APPCMD_CLIENTONLY) && !reference_inst->clientOnly) - { - ret = DMLERR_INVALIDPARAMETER; - goto theError; - } - break; - } - reference_inst = reference_inst->next; - } - if (reference_inst->next == NULL) - { - ret = DMLERR_INVALIDPARAMETER; - goto theError; - } - /* All checked - change relevant flags */ - - reference_inst->CBFflags = pInstance->CBFflags; - reference_inst->clientOnly = pInstance->clientOnly; - reference_inst->monitorFlags = pInstance->monitorFlags; - - HeapFree(GetProcessHeap(), 0, pInstance); /* finished - release heap space used as work store */ - - LeaveCriticalSection(&WDML_CritSect); - } - - return DMLERR_NO_ERROR; - theError: - HeapFree(GetProcessHeap(), 0, pInstance); - LeaveCriticalSection(&WDML_CritSect); - return ret; -} - -/****************************************************************************** - * DdeInitializeA (USER32.@) - * - * See DdeInitializeW. - */ -UINT WINAPI DdeInitializeA(LPDWORD pidInst, PFNCALLBACK pfnCallback, - DWORD afCmd, DWORD ulRes) -{ - return WDML_Initialize(pidInst, pfnCallback, afCmd, ulRes, FALSE); -} - -/****************************************************************************** - * DdeInitializeW [USER32.@] - * Registers an application with the DDEML - * - * PARAMS - * pidInst [I] Pointer to instance identifier - * pfnCallback [I] Pointer to callback function - * afCmd [I] Set of command and filter flags - * ulRes [I] Reserved - * - * RETURNS - * Success: DMLERR_NO_ERROR - * Failure: DMLERR_DLL_USAGE, DMLERR_INVALIDPARAMETER, DMLERR_SYS_ERROR - */ -UINT WINAPI DdeInitializeW(LPDWORD pidInst, PFNCALLBACK pfnCallback, - DWORD afCmd, DWORD ulRes) -{ - return WDML_Initialize(pidInst, pfnCallback, afCmd, ulRes, TRUE); -} - -/***************************************************************** - * DdeUninitialize [USER32.@] Frees DDEML resources - * - * PARAMS - * idInst [I] Instance identifier - * - * RETURNS - * Success: TRUE - * Failure: FALSE - */ - -BOOL WINAPI DdeUninitialize(DWORD idInst) -{ - /* Stage one - check if we have a handle for this instance - */ - WDML_INSTANCE* pInstance; - WDML_CONV* pConv; - WDML_CONV* pConvNext; - - TRACE("(%d)\n", idInst); - - /* First check instance - */ - pInstance = WDML_GetInstance(idInst); - if (pInstance == NULL) - { - /* - * Needs something here to record NOT_INITIALIZED ready for DdeGetLastError - */ - return FALSE; - } - - /* first terminate all conversations client side - * this shall close existing links... - */ - for (pConv = pInstance->convs[WDML_CLIENT_SIDE]; pConv != NULL; pConv = pConvNext) - { - pConvNext = pConv->next; - DdeDisconnect((HCONV)pConv); - } - if (pInstance->convs[WDML_CLIENT_SIDE]) - FIXME("still pending conversations\n"); - - /* then unregister all known service names */ - DdeNameService(idInst, 0, 0, DNS_UNREGISTER); - - /* Free the nodes that were not freed by this instance - * and remove the nodes from the list of HSZ nodes. - */ - WDML_FreeAllHSZ(pInstance); - - DestroyWindow(pInstance->hwndEvent); - - /* OK now delete the instance handle itself */ - - if (WDML_InstanceList == pInstance) - { - /* special case - the first/only entry */ - WDML_InstanceList = pInstance->next; - } - else - { - /* general case, remove entry */ - WDML_INSTANCE* inst; - - for (inst = WDML_InstanceList; inst->next != pInstance; inst = inst->next); - inst->next = pInstance->next; - } - /* release the heap entry - */ - HeapFree(GetProcessHeap(), 0, pInstance); - - return TRUE; -} - -/****************************************************************** - * WDML_NotifyThreadExit - * - * - */ -void WDML_NotifyThreadDetach(void) -{ - WDML_INSTANCE* pInstance; - WDML_INSTANCE* next; - DWORD tid = GetCurrentThreadId(); - - EnterCriticalSection(&WDML_CritSect); - for (pInstance = WDML_InstanceList; pInstance != NULL; pInstance = next) - { - next = pInstance->next; - if (pInstance->threadID == tid) - { - LeaveCriticalSection(&WDML_CritSect); - DdeUninitialize(pInstance->instanceID); - EnterCriticalSection(&WDML_CritSect); - } - } - LeaveCriticalSection(&WDML_CritSect); -} - -/****************************************************************** - * WDML_InvokeCallback - * - * - */ -HDDEDATA WDML_InvokeCallback(WDML_INSTANCE* pInstance, UINT uType, UINT uFmt, HCONV hConv, - HSZ hsz1, HSZ hsz2, HDDEDATA hdata, - ULONG_PTR dwData1, ULONG_PTR dwData2) -{ - HDDEDATA ret; - - if (pInstance == NULL) - return NULL; - - TRACE("invoking CB[%p] (%x %x %p %p %p %p %lx %lx)\n", - pInstance->callback, uType, uFmt, - hConv, hsz1, hsz2, hdata, dwData1, dwData2); - ret = pInstance->callback(uType, uFmt, hConv, hsz1, hsz2, hdata, dwData1, dwData2); - TRACE("done => %p\n", ret); - return ret; -} - -/***************************************************************************** - * WDML_GetInstance - * - * generic routine to return a pointer to the relevant DDE_HANDLE_ENTRY - * for an instance Id, or NULL if the entry does not exist - * - */ -WDML_INSTANCE* WDML_GetInstance(DWORD instId) -{ - WDML_INSTANCE* pInstance; - - EnterCriticalSection(&WDML_CritSect); - - for (pInstance = WDML_InstanceList; pInstance != NULL; pInstance = pInstance->next) - { - if (pInstance->instanceID == instId) - { - if (GetCurrentThreadId() != pInstance->threadID) - { - FIXME("Tried to get instance from wrong thread\n"); - continue; - } - break; - } - } - - LeaveCriticalSection(&WDML_CritSect); - - if (!pInstance) - WARN("Instance entry missing for id %04x\n", instId); - return pInstance; -} - -/****************************************************************** - * WDML_GetInstanceFromWnd - * - * - */ -WDML_INSTANCE* WDML_GetInstanceFromWnd(HWND hWnd) -{ - return (WDML_INSTANCE*)GetWindowLongPtrW(hWnd, GWL_WDML_INSTANCE); -} - /****************************************************************************** * DdeGetLastError [USER32.@] Gets most recent error code * @@ -1258,6 +733,545 @@ INT WINAPI DdeCmpStringHandles(HSZ hsz1, HSZ hsz2) return ret; } +/* ================================================================ + * + * Instance management + * + * ================================================================ */ + +/****************************************************************************** + * IncrementInstanceId + * + * generic routine to increment the max instance Id and allocate a new application instance + */ +static void WDML_IncrementInstanceId(WDML_INSTANCE* pInstance) +{ + DWORD id = InterlockedIncrement(&WDML_MaxInstanceID); + + pInstance->instanceID = id; + TRACE("New instance id %d allocated\n", id); +} + +/****************************************************************** + * WDML_EventProc + * + * + */ +static LRESULT CALLBACK WDML_EventProc(HWND hwndEvent, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + WDML_INSTANCE* pInstance; + HSZ hsz1, hsz2; + + switch (uMsg) + { + case WM_WDML_REGISTER: + pInstance = WDML_GetInstanceFromWnd(hwndEvent); + /* try calling the Callback */ + if (pInstance && !(pInstance->CBFflags & CBF_SKIP_REGISTRATIONS)) + { + hsz1 = WDML_MakeHszFromAtom(pInstance, wParam); + hsz2 = WDML_MakeHszFromAtom(pInstance, lParam); + WDML_InvokeCallback(pInstance, XTYP_REGISTER, 0, 0, hsz1, hsz2, 0, 0, 0); + WDML_DecHSZ(pInstance, hsz1); + WDML_DecHSZ(pInstance, hsz2); + } + break; + + case WM_WDML_UNREGISTER: + pInstance = WDML_GetInstanceFromWnd(hwndEvent); + if (pInstance && !(pInstance->CBFflags & CBF_SKIP_UNREGISTRATIONS)) + { + hsz1 = WDML_MakeHszFromAtom(pInstance, wParam); + hsz2 = WDML_MakeHszFromAtom(pInstance, lParam); + WDML_InvokeCallback(pInstance, XTYP_UNREGISTER, 0, 0, hsz1, hsz2, 0, 0, 0); + WDML_DecHSZ(pInstance, hsz1); + WDML_DecHSZ(pInstance, hsz2); + } + break; + + case WM_WDML_CONNECT_CONFIRM: + pInstance = WDML_GetInstanceFromWnd(hwndEvent); + if (pInstance && !(pInstance->CBFflags & CBF_SKIP_CONNECT_CONFIRMS)) + { + WDML_CONV* pConv; + /* confirm connection... + * lookup for this conv handle + */ + HWND client = (HWND)wParam; + HWND server = (HWND)lParam; + for (pConv = pInstance->convs[WDML_SERVER_SIDE]; pConv != NULL; pConv = pConv->next) + { + if (pConv->hwndClient == client && pConv->hwndServer == server) + break; + } + if (pConv) + { + pConv->wStatus |= ST_ISLOCAL; + + WDML_InvokeCallback(pInstance, XTYP_CONNECT_CONFIRM, 0, (HCONV)pConv, + pConv->hszTopic, pConv->hszService, 0, 0, + (pConv->wStatus & ST_ISSELF) ? 1 : 0); + } + } + break; + default: + return DefWindowProcW(hwndEvent, uMsg, wParam, lParam); + } + return 0; +} + +/****************************************************************** + * WDML_Initialize + * + * + */ +UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback, + DWORD afCmd, DWORD ulRes, BOOL bUnicode) +{ + WDML_INSTANCE* pInstance; + WDML_INSTANCE* reference_inst; + UINT ret; + WNDCLASSEXW wndclass; + + TRACE("(%p,%p,0x%x,%d,0x%x)\n", + pidInst, pfnCallback, afCmd, ulRes, bUnicode); + + if (ulRes) + { + ERR("Reserved value not zero? What does this mean?\n"); + /* trap this and no more until we know more */ + return DMLERR_INVALIDPARAMETER; + } + + /* grab enough heap for one control struct - not really necessary for re-initialise + * but allows us to use same validation routines */ + pInstance = HeapAlloc(GetProcessHeap(), 0, sizeof(WDML_INSTANCE)); + if (pInstance == NULL) + { + /* catastrophe !! warn user & abort */ + ERR("Instance create failed - out of memory\n"); + return DMLERR_SYS_ERROR; + } + pInstance->next = NULL; + pInstance->monitor = (afCmd | APPCLASS_MONITOR); + + /* messy bit, spec implies that 'Client Only' can be set in 2 different ways, catch 1 here */ + + pInstance->clientOnly = afCmd & APPCMD_CLIENTONLY; + pInstance->instanceID = *pidInst; /* May need to add calling proc Id */ + pInstance->threadID = GetCurrentThreadId(); + pInstance->callback = *pfnCallback; + pInstance->unicode = bUnicode; + pInstance->nodeList = NULL; /* node will be added later */ + pInstance->monitorFlags = afCmd & MF_MASK; + pInstance->wStatus = 0; + pInstance->lastError = DMLERR_NO_ERROR; + pInstance->servers = NULL; + pInstance->convs[0] = NULL; + pInstance->convs[1] = NULL; + pInstance->links[0] = NULL; + pInstance->links[1] = NULL; + + /* isolate CBF flags in one go, expect this will go the way of all attempts to be clever !! */ + + pInstance->CBFflags = afCmd^((afCmd&MF_MASK)|((afCmd&APPCMD_MASK)|(afCmd&APPCLASS_MASK))); + + if (!pInstance->clientOnly) + { + /* Check for other way of setting Client-only !! */ + pInstance->clientOnly = + (pInstance->CBFflags & CBF_FAIL_ALLSVRXACTIONS) == CBF_FAIL_ALLSVRXACTIONS; + } + + ERR("instance created - checking validity\n"); + + if (*pidInst == 0) + { + /* Initialisation of new Instance Identifier */ + ERR("new instance, callback %p flags %X\n",pfnCallback,afCmd); + + EnterCriticalSection(&WDML_CritSect); + + if (WDML_InstanceList == NULL) + { + /* can't be another instance in this case, assign to the base pointer */ + WDML_InstanceList = pInstance; + + /* since first must force filter of XTYP_CONNECT and XTYP_WILDCONNECT for + * present + * ------------------------------- NOTE NOTE NOTE -------------------------- + * + * the manual is not clear if this condition + * applies to the first call to DdeInitialize from an application, or the + * first call for a given callback !!! + */ + + pInstance->CBFflags = pInstance->CBFflags|APPCMD_FILTERINITS; + ERR("First application instance detected OK\n"); + /* allocate new instance ID */ + WDML_IncrementInstanceId(pInstance); + } + else + { + /* really need to chain the new one in to the latest here, but after checking conditions + * such as trying to start a conversation from an application trying to monitor */ + reference_inst = WDML_InstanceList; + ERR("Subsequent application instance - starting checks\n"); + while (reference_inst->next != NULL) + { + /* + * This set of tests will work if application uses same instance Id + * at application level once allocated - which is what manual implies + * should happen. If someone tries to be + * clever (lazy ?) it will fail to pick up that later calls are for + * the same application - should we trust them ? + */ + if (pInstance->instanceID == reference_inst->instanceID) + { + /* Check 1 - must be same Client-only state */ + + if (pInstance->clientOnly != reference_inst->clientOnly) + { + ERR("WDML_Initialize Mustbe Client-only\n"); + ret = DMLERR_DLL_USAGE; + goto theError; + } + + /* Check 2 - cannot use 'Monitor' with any non-monitor modes */ + + if (pInstance->monitor != reference_inst->monitor) + { + ERR("WDML_Initialize cannot use monitor w/any modes\n"); + ret = DMLERR_INVALIDPARAMETER; + goto theError; + } + + /* Check 3 - must supply different callback address */ + + if (pInstance->callback == reference_inst->callback) + { + ret = DMLERR_DLL_USAGE; + goto theError; + } + } + reference_inst = reference_inst->next; + } + /* All cleared, add to chain */ + + ERR("Application Instance checks finished\n"); + WDML_IncrementInstanceId(pInstance); + reference_inst->next = pInstance; + } + LeaveCriticalSection(&WDML_CritSect); + + *pidInst = pInstance->instanceID; + + /* for deadlock issues, windows must always be created when outside the critical section */ + wndclass.cbSize = sizeof(wndclass); + wndclass.style = 0; + wndclass.lpfnWndProc = WDML_EventProc; + wndclass.cbClsExtra = 0; + wndclass.cbWndExtra = sizeof(ULONG_PTR); + wndclass.hInstance = 0; + wndclass.hIcon = 0; + wndclass.hCursor = 0; + wndclass.hbrBackground = 0; + wndclass.lpszMenuName = NULL; + wndclass.lpszClassName = WDML_szEventClass; + wndclass.hIconSm = 0; + + RegisterClassExW(&wndclass); + + pInstance->hwndEvent = CreateWindowW(WDML_szEventClass, NULL, + WS_POPUP, 0, 0, 0, 0, + 0, 0, 0, 0); + + SetWindowLongPtrW(pInstance->hwndEvent, GWL_WDML_INSTANCE, (ULONG_PTR)pInstance); + + ERR("New application instance processing finished OK\n"); + } + else + { + /* Reinitialisation situation --- FIX */ + ERR("reinitialisation of (%p,%p,0x%x,%d): stub\n", pidInst, pfnCallback, afCmd, ulRes); + + EnterCriticalSection(&WDML_CritSect); + + if (WDML_InstanceList == NULL) + { + ERR("WDML_Initialize No instance list\n"); + ret = DMLERR_INVALIDPARAMETER; + goto theError; + } + /* can't reinitialise if we have initialised nothing !! */ + reference_inst = WDML_InstanceList; + /* must first check if we have been given a valid instance to re-initialise !! how do we do that ? */ + /* + * MS allows initialisation without specifying a callback, should we allow addition of the + * callback by a later call to initialise ? - if so this lot will have to change + */ + while (reference_inst->next != NULL) + { + if (*pidInst == reference_inst->instanceID && pfnCallback == reference_inst->callback) + { + /* Check 1 - cannot change client-only mode if set via APPCMD_CLIENTONLY */ + + if (reference_inst->clientOnly) + { + if ((reference_inst->CBFflags & CBF_FAIL_ALLSVRXACTIONS) != CBF_FAIL_ALLSVRXACTIONS) + { + /* i.e. Was set to Client-only and through APPCMD_CLIENTONLY */ + + if (!(afCmd & APPCMD_CLIENTONLY)) + { + ERR("WDML_Initialize AppCmd Client-only 2\n"); + ret = DMLERR_INVALIDPARAMETER; + goto theError; + } + } + } + /* Check 2 - cannot change monitor modes */ + + if (pInstance->monitor != reference_inst->monitor) + { + ERR("WDML_Initialize cannot change monitor modes 2\n"); + ret = DMLERR_INVALIDPARAMETER; + goto theError; + } + + /* Check 3 - trying to set Client-only via APPCMD when not set so previously */ + + if ((afCmd&APPCMD_CLIENTONLY) && !reference_inst->clientOnly) + { + ERR("WDML_Initialize trying to set Client-only via APPCMD\n"); + ret = DMLERR_INVALIDPARAMETER; + goto theError; + } + break; + } + reference_inst = reference_inst->next; + } + if (reference_inst->next == NULL) + { + ERR("WDML_Initialize Nothing Next\n"); + ret = DMLERR_INVALIDPARAMETER; + goto theError; + } + /* All checked - change relevant flags */ + + reference_inst->CBFflags = pInstance->CBFflags; + reference_inst->clientOnly = pInstance->clientOnly; + reference_inst->monitorFlags = pInstance->monitorFlags; + + HeapFree(GetProcessHeap(), 0, pInstance); /* finished - release heap space used as work store */ + + LeaveCriticalSection(&WDML_CritSect); + } + + return DMLERR_NO_ERROR; + theError: + ERR("WDML_Initialize error %x\n",ret); + HeapFree(GetProcessHeap(), 0, pInstance); + LeaveCriticalSection(&WDML_CritSect); + return ret; +} + +/****************************************************************************** + * DdeInitializeA (USER32.@) + * + * See DdeInitializeW. + */ +UINT WINAPI DdeInitializeA(LPDWORD pidInst, PFNCALLBACK pfnCallback, + DWORD afCmd, DWORD ulRes) +{ + return WDML_Initialize(pidInst, pfnCallback, afCmd, ulRes, FALSE); +} + +/****************************************************************************** + * DdeInitializeW [USER32.@] + * Registers an application with the DDEML + * + * PARAMS + * pidInst [I] Pointer to instance identifier + * pfnCallback [I] Pointer to callback function + * afCmd [I] Set of command and filter flags + * ulRes [I] Reserved + * + * RETURNS + * Success: DMLERR_NO_ERROR + * Failure: DMLERR_DLL_USAGE, DMLERR_INVALIDPARAMETER, DMLERR_SYS_ERROR + */ +UINT WINAPI DdeInitializeW(LPDWORD pidInst, PFNCALLBACK pfnCallback, + DWORD afCmd, DWORD ulRes) +{ + return WDML_Initialize(pidInst, pfnCallback, afCmd, ulRes, TRUE); +} + +/***************************************************************** + * DdeUninitialize [USER32.@] Frees DDEML resources + * + * PARAMS + * idInst [I] Instance identifier + * + * RETURNS + * Success: TRUE + * Failure: FALSE + */ + +BOOL WINAPI DdeUninitialize(DWORD idInst) +{ + /* Stage one - check if we have a handle for this instance + */ + WDML_INSTANCE* pInstance; + WDML_CONV* pConv; + WDML_CONV* pConvNext; + + TRACE("(%d)\n", idInst); + + /* First check instance + */ + pInstance = WDML_GetInstance(idInst); + if (pInstance == NULL) + { + /* + * Needs something here to record NOT_INITIALIZED ready for DdeGetLastError + */ + return FALSE; + } + + /* first terminate all conversations client side + * this shall close existing links... + */ + for (pConv = pInstance->convs[WDML_CLIENT_SIDE]; pConv != NULL; pConv = pConvNext) + { + pConvNext = pConv->next; + DdeDisconnect((HCONV)pConv); + } + if (pInstance->convs[WDML_CLIENT_SIDE]) + FIXME("still pending conversations\n"); + + /* then unregister all known service names */ + DdeNameService(idInst, 0, 0, DNS_UNREGISTER); + + /* Free the nodes that were not freed by this instance + * and remove the nodes from the list of HSZ nodes. + */ + WDML_FreeAllHSZ(pInstance); + + DestroyWindow(pInstance->hwndEvent); + + /* OK now delete the instance handle itself */ + + if (WDML_InstanceList == pInstance) + { + /* special case - the first/only entry */ + WDML_InstanceList = pInstance->next; + } + else + { + /* general case, remove entry */ + WDML_INSTANCE* inst; + + for (inst = WDML_InstanceList; inst->next != pInstance; inst = inst->next); + inst->next = pInstance->next; + } + /* release the heap entry + */ + HeapFree(GetProcessHeap(), 0, pInstance); + + return TRUE; +} + +/****************************************************************** + * WDML_NotifyThreadExit + * + * + */ +void WDML_NotifyThreadDetach(void) +{ + WDML_INSTANCE* pInstance; + WDML_INSTANCE* next; + DWORD tid = GetCurrentThreadId(); + + EnterCriticalSection(&WDML_CritSect); + for (pInstance = WDML_InstanceList; pInstance != NULL; pInstance = next) + { + next = pInstance->next; + if (pInstance->threadID == tid) + { + LeaveCriticalSection(&WDML_CritSect); + DdeUninitialize(pInstance->instanceID); + EnterCriticalSection(&WDML_CritSect); + } + } + LeaveCriticalSection(&WDML_CritSect); +} + +/****************************************************************** + * WDML_InvokeCallback + * + * + */ +HDDEDATA WDML_InvokeCallback(WDML_INSTANCE* pInstance, UINT uType, UINT uFmt, HCONV hConv, + HSZ hsz1, HSZ hsz2, HDDEDATA hdata, + ULONG_PTR dwData1, ULONG_PTR dwData2) +{ + HDDEDATA ret; + + if (pInstance == NULL) + return NULL; + + TRACE("invoking CB[%p] (%x %x %p %p %p %p %lx %lx)\n", + pInstance->callback, uType, uFmt, + hConv, hsz1, hsz2, hdata, dwData1, dwData2); + ret = pInstance->callback(uType, uFmt, hConv, hsz1, hsz2, hdata, dwData1, dwData2); + TRACE("done => %p\n", ret); + return ret; +} + +/***************************************************************************** + * WDML_GetInstance + * + * generic routine to return a pointer to the relevant DDE_HANDLE_ENTRY + * for an instance Id, or NULL if the entry does not exist + * + */ +WDML_INSTANCE* WDML_GetInstance(DWORD instId) +{ + WDML_INSTANCE* pInstance; + + EnterCriticalSection(&WDML_CritSect); + + for (pInstance = WDML_InstanceList; pInstance != NULL; pInstance = pInstance->next) + { + if (pInstance->instanceID == instId) + { + if (GetCurrentThreadId() != pInstance->threadID) + { + FIXME("Tried to get instance from wrong thread\n"); + continue; + } + break; + } + } + + LeaveCriticalSection(&WDML_CritSect); + + if (!pInstance) + WARN("Instance entry missing for id %04x\n", instId); + return pInstance; +} + +/****************************************************************** + * WDML_GetInstanceFromWnd + * + * + */ +WDML_INSTANCE* WDML_GetInstanceFromWnd(HWND hWnd) +{ + return (WDML_INSTANCE*)GetWindowLongPtrW(hWnd, GWL_WDML_INSTANCE); +} + /* ================================================================ * * Data handle management @@ -1459,7 +1473,7 @@ BOOL WINAPI DdeFreeDataHandle(HDDEDATA hData) /* 1 is the handle value returned by an asynchronous operation. */ if (hData == (HDDEDATA)1) - return TRUE; + return TRUE; return GlobalFree(hData) == 0; } @@ -1514,7 +1528,7 @@ HDDEDATA WDML_Global2DataHandle(WDML_CONV* pConv, HGLOBAL hMem, WINE_DDEH default: FIXME("Unsupported format (%04x) for data %p, passing raw information\n", pDd->cfFormat, hMem); - /* fall thru */ + /* fall through */ case 0: case CF_TEXT: ret = DdeCreateDataHandle(pConv->instance->instanceID, pDd->Value, size, 0, 0, pDd->cfFormat, 0); @@ -1573,7 +1587,7 @@ HGLOBAL WDML_DataHandle2Global(HDDEDATA hDdeData, BOOL fResponse, BOOL fRelease, default: FIXME("Unsupported format (%04x) for data %p, passing raw information\n", pDdh->cfFormat, hDdeData); - /* fall thru */ + /* fall through */ case 0: case CF_TEXT: hMem = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, sizeof(WINE_DDEHEAD) + dwSize); @@ -1736,6 +1750,259 @@ WDML_SERVER* WDML_FindServer(WDML_INSTANCE* pInstance, HSZ hszService, HSZ hszTo return NULL; } +/* ================================================================ + * + * Link (hot & warm) management + * + * ================================================================ */ + +/****************************************************************** + * WDML_AddLink + * + * + */ +void WDML_AddLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side, + UINT wType, HSZ hszItem, UINT wFmt) +{ + WDML_LINK* pLink; + + pLink = HeapAlloc(GetProcessHeap(), 0, sizeof(WDML_LINK)); + if (pLink == NULL) + { + ERR("OOM\n"); + return; + } + + pLink->hConv = hConv; + pLink->transactionType = wType; + WDML_IncHSZ(pInstance, pLink->hszItem = hszItem); + pLink->uFmt = wFmt; + pLink->next = pInstance->links[side]; + pInstance->links[side] = pLink; +} + +/****************************************************************** + * WDML_RemoveLink + * + * + */ +void WDML_RemoveLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side, + HSZ hszItem, UINT uFmt) +{ + WDML_LINK* pPrev = NULL; + WDML_LINK* pCurrent = NULL; + + pCurrent = pInstance->links[side]; + + while (pCurrent != NULL) + { + if (pCurrent->hConv == hConv && + DdeCmpStringHandles(pCurrent->hszItem, hszItem) == 0 && + pCurrent->uFmt == uFmt) + { + if (pCurrent == pInstance->links[side]) + { + pInstance->links[side] = pCurrent->next; + } + else + { + pPrev->next = pCurrent->next; + } + + WDML_DecHSZ(pInstance, pCurrent->hszItem); + HeapFree(GetProcessHeap(), 0, pCurrent); + break; + } + + pPrev = pCurrent; + pCurrent = pCurrent->next; + } +} + +/* this function is called to remove all links related to the conv. + It should be called from both client and server when terminating + the conversation. +*/ +/****************************************************************** + * WDML_RemoveAllLinks + * + * + */ +void WDML_RemoveAllLinks(WDML_INSTANCE* pInstance, WDML_CONV* pConv, WDML_SIDE side) +{ + WDML_LINK* pPrev = NULL; + WDML_LINK* pCurrent = NULL; + WDML_LINK* pNext = NULL; + + pCurrent = pInstance->links[side]; + + while (pCurrent != NULL) + { + if (pCurrent->hConv == (HCONV)pConv) + { + if (pCurrent == pInstance->links[side]) + { + pInstance->links[side] = pCurrent->next; + pNext = pCurrent->next; + } + else + { + pPrev->next = pCurrent->next; + pNext = pCurrent->next; + } + + WDML_DecHSZ(pInstance, pCurrent->hszItem); + + HeapFree(GetProcessHeap(), 0, pCurrent); + pCurrent = NULL; + } + + if (pCurrent) + { + pPrev = pCurrent; + pCurrent = pCurrent->next; + } + else + { + pCurrent = pNext; + } + } +} + +/****************************************************************** + * WDML_FindLink + * + * + */ +WDML_LINK* WDML_FindLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side, + HSZ hszItem, BOOL use_fmt, UINT uFmt) +{ + WDML_LINK* pCurrent = NULL; + + for (pCurrent = pInstance->links[side]; pCurrent != NULL; pCurrent = pCurrent->next) + { + /* we don't need to check for transaction type as it can be altered */ + + if (pCurrent->hConv == hConv && + DdeCmpStringHandles(pCurrent->hszItem, hszItem) == 0 && + (!use_fmt || pCurrent->uFmt == uFmt)) + { + break; + } + + } + + return pCurrent; +} + +/* ================================================================ + * + * Transaction management + * + * ================================================================ */ + +/****************************************************************** + * WDML_AllocTransaction + * + * Alloc a transaction structure for handling the message ddeMsg + */ +WDML_XACT* WDML_AllocTransaction(WDML_INSTANCE* pInstance, UINT ddeMsg, + UINT wFmt, HSZ hszItem) +{ + WDML_XACT* pXAct; + static WORD tid = 1; /* FIXME: wrap around */ + + pXAct = HeapAlloc(GetProcessHeap(), 0, sizeof(WDML_XACT)); + if (!pXAct) + { + pInstance->lastError = DMLERR_MEMORY_ERROR; + return NULL; + } + + pXAct->xActID = tid++; + pXAct->ddeMsg = ddeMsg; + pXAct->hDdeData = 0; + pXAct->hUser = 0; + pXAct->next = NULL; + pXAct->wType = 0; + pXAct->wFmt = wFmt; + if ((pXAct->hszItem = hszItem)) WDML_IncHSZ(pInstance, pXAct->hszItem); + pXAct->atom = 0; + pXAct->hMem = 0; + pXAct->lParam = 0; + + return pXAct; +} + +/****************************************************************** + * WDML_QueueTransaction + * + * Adds a transaction to the list of transaction + */ +void WDML_QueueTransaction(WDML_CONV* pConv, WDML_XACT* pXAct) +{ + WDML_XACT** pt; + + /* advance to last in queue */ + for (pt = &pConv->transactions; *pt != NULL; pt = &(*pt)->next); + *pt = pXAct; +} + +/****************************************************************** + * WDML_UnQueueTransaction + * + * + */ +BOOL WDML_UnQueueTransaction(WDML_CONV* pConv, WDML_XACT* pXAct) +{ + WDML_XACT** pt; + + for (pt = &pConv->transactions; *pt; pt = &(*pt)->next) + { + if (*pt == pXAct) + { + *pt = pXAct->next; + return TRUE; + } + } + return FALSE; +} + +/****************************************************************** + * WDML_FreeTransaction + * + * + */ +void WDML_FreeTransaction(WDML_INSTANCE* pInstance, WDML_XACT* pXAct, BOOL doFreePmt) +{ + /* free pmt(s) in pXAct too. check against one for not deleting TRUE return values */ + if (doFreePmt && (ULONG_PTR)pXAct->hMem > 1) + { + GlobalFree(pXAct->hMem); + } + if (pXAct->hszItem) WDML_DecHSZ(pInstance, pXAct->hszItem); + + HeapFree(GetProcessHeap(), 0, pXAct); +} + +/****************************************************************** + * WDML_FindTransaction + * + * + */ +WDML_XACT* WDML_FindTransaction(WDML_CONV* pConv, DWORD tid) +{ + WDML_XACT* pXAct; + + tid = HIWORD(tid); + for (pXAct = pConv->transactions; pXAct; pXAct = pXAct->next) + { + if (pXAct->xActID == tid) + break; + } + return pXAct; +} + /* ================================================================ * * Conversation management @@ -1876,7 +2143,7 @@ static BOOL WDML_EnableCallback(WDML_CONV *pConv, UINT wCmd) } if (wCmd == EC_QUERYWAITING) - return pConv->transactions ? TRUE : FALSE; + return pConv->transactions != NULL; if (wCmd != EC_ENABLEALL && wCmd != EC_ENABLEONE) { @@ -2201,259 +2468,6 @@ UINT WINAPI DdeQueryConvInfo(HCONV hConv, DWORD id, PCONVINFO lpConvInfo) return ret; } -/* ================================================================ - * - * Link (hot & warm) management - * - * ================================================================ */ - -/****************************************************************** - * WDML_AddLink - * - * - */ -void WDML_AddLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side, - UINT wType, HSZ hszItem, UINT wFmt) -{ - WDML_LINK* pLink; - - pLink = HeapAlloc(GetProcessHeap(), 0, sizeof(WDML_LINK)); - if (pLink == NULL) - { - ERR("OOM\n"); - return; - } - - pLink->hConv = hConv; - pLink->transactionType = wType; - WDML_IncHSZ(pInstance, pLink->hszItem = hszItem); - pLink->uFmt = wFmt; - pLink->next = pInstance->links[side]; - pInstance->links[side] = pLink; -} - -/****************************************************************** - * WDML_RemoveLink - * - * - */ -void WDML_RemoveLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side, - HSZ hszItem, UINT uFmt) -{ - WDML_LINK* pPrev = NULL; - WDML_LINK* pCurrent = NULL; - - pCurrent = pInstance->links[side]; - - while (pCurrent != NULL) - { - if (pCurrent->hConv == hConv && - DdeCmpStringHandles(pCurrent->hszItem, hszItem) == 0 && - pCurrent->uFmt == uFmt) - { - if (pCurrent == pInstance->links[side]) - { - pInstance->links[side] = pCurrent->next; - } - else - { - pPrev->next = pCurrent->next; - } - - WDML_DecHSZ(pInstance, pCurrent->hszItem); - HeapFree(GetProcessHeap(), 0, pCurrent); - break; - } - - pPrev = pCurrent; - pCurrent = pCurrent->next; - } -} - -/* this function is called to remove all links related to the conv. - It should be called from both client and server when terminating - the conversation. -*/ -/****************************************************************** - * WDML_RemoveAllLinks - * - * - */ -void WDML_RemoveAllLinks(WDML_INSTANCE* pInstance, WDML_CONV* pConv, WDML_SIDE side) -{ - WDML_LINK* pPrev = NULL; - WDML_LINK* pCurrent = NULL; - WDML_LINK* pNext = NULL; - - pCurrent = pInstance->links[side]; - - while (pCurrent != NULL) - { - if (pCurrent->hConv == (HCONV)pConv) - { - if (pCurrent == pInstance->links[side]) - { - pInstance->links[side] = pCurrent->next; - pNext = pCurrent->next; - } - else - { - pPrev->next = pCurrent->next; - pNext = pCurrent->next; - } - - WDML_DecHSZ(pInstance, pCurrent->hszItem); - - HeapFree(GetProcessHeap(), 0, pCurrent); - pCurrent = NULL; - } - - if (pCurrent) - { - pPrev = pCurrent; - pCurrent = pCurrent->next; - } - else - { - pCurrent = pNext; - } - } -} - -/****************************************************************** - * WDML_FindLink - * - * - */ -WDML_LINK* WDML_FindLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side, - HSZ hszItem, BOOL use_fmt, UINT uFmt) -{ - WDML_LINK* pCurrent = NULL; - - for (pCurrent = pInstance->links[side]; pCurrent != NULL; pCurrent = pCurrent->next) - { - /* we don't need to check for transaction type as it can be altered */ - - if (pCurrent->hConv == hConv && - DdeCmpStringHandles(pCurrent->hszItem, hszItem) == 0 && - (!use_fmt || pCurrent->uFmt == uFmt)) - { - break; - } - - } - - return pCurrent; -} - -/* ================================================================ - * - * Transaction management - * - * ================================================================ */ - -/****************************************************************** - * WDML_AllocTransaction - * - * Alloc a transaction structure for handling the message ddeMsg - */ -WDML_XACT* WDML_AllocTransaction(WDML_INSTANCE* pInstance, UINT ddeMsg, - UINT wFmt, HSZ hszItem) -{ - WDML_XACT* pXAct; - static WORD tid = 1; /* FIXME: wrap around */ - - pXAct = HeapAlloc(GetProcessHeap(), 0, sizeof(WDML_XACT)); - if (!pXAct) - { - pInstance->lastError = DMLERR_MEMORY_ERROR; - return NULL; - } - - pXAct->xActID = tid++; - pXAct->ddeMsg = ddeMsg; - pXAct->hDdeData = 0; - pXAct->hUser = 0; - pXAct->next = NULL; - pXAct->wType = 0; - pXAct->wFmt = wFmt; - if ((pXAct->hszItem = hszItem)) WDML_IncHSZ(pInstance, pXAct->hszItem); - pXAct->atom = 0; - pXAct->hMem = 0; - pXAct->lParam = 0; - - return pXAct; -} - -/****************************************************************** - * WDML_QueueTransaction - * - * Adds a transaction to the list of transaction - */ -void WDML_QueueTransaction(WDML_CONV* pConv, WDML_XACT* pXAct) -{ - WDML_XACT** pt; - - /* advance to last in queue */ - for (pt = &pConv->transactions; *pt != NULL; pt = &(*pt)->next); - *pt = pXAct; -} - -/****************************************************************** - * WDML_UnQueueTransaction - * - * - */ -BOOL WDML_UnQueueTransaction(WDML_CONV* pConv, WDML_XACT* pXAct) -{ - WDML_XACT** pt; - - for (pt = &pConv->transactions; *pt; pt = &(*pt)->next) - { - if (*pt == pXAct) - { - *pt = pXAct->next; - return TRUE; - } - } - return FALSE; -} - -/****************************************************************** - * WDML_FreeTransaction - * - * - */ -void WDML_FreeTransaction(WDML_INSTANCE* pInstance, WDML_XACT* pXAct, BOOL doFreePmt) -{ - /* free pmt(s) in pXAct too. check against one for not deleting TRUE return values */ - if (doFreePmt && (ULONG_PTR)pXAct->hMem > 1) - { - GlobalFree(pXAct->hMem); - } - if (pXAct->hszItem) WDML_DecHSZ(pInstance, pXAct->hszItem); - - HeapFree(GetProcessHeap(), 0, pXAct); -} - -/****************************************************************** - * WDML_FindTransaction - * - * - */ -WDML_XACT* WDML_FindTransaction(WDML_CONV* pConv, DWORD tid) -{ - WDML_XACT* pXAct; - - tid = HIWORD(tid); - for (pXAct = pConv->transactions; pXAct; pXAct = pXAct->next) - { - if (pXAct->xActID == tid) - break; - } - return pXAct; -} - /* ================================================================ * * Information broadcast across DDEML implementations diff --git a/win32ss/user/user32/misc/ddeclient.c b/win32ss/user/user32/misc/ddeclient.c index 723a1b1b9e4..1a7ca94a927 100644 --- a/win32ss/user/user32/misc/ddeclient.c +++ b/win32ss/user/user32/misc/ddeclient.c @@ -30,8 +30,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(ddeml); static LRESULT CALLBACK WDML_ClientProc(HWND, UINT, WPARAM, LPARAM); /* only for one client, not conv list */ -const char WDML_szClientConvClassA[] = "DdeClientAnsi"; -const WCHAR WDML_szClientConvClassW[] = {'D','d','e','C','l','i','e','n','t','U','n','i','c','o','d','e',0}; +const char WDML_szClientConvClassA[] = "DDEMLAnsiClient"; +const WCHAR WDML_szClientConvClassW[] = {'D','D','E','M','L','U','n','i','c','o','d','e','C','l','i','e','n','t',0}; /****************************************************************************** * DdeConnectList [USER32.@] Establishes conversation with DDE servers @@ -91,7 +91,7 @@ HCONV WINAPI DdeConnect(DWORD idInst, HSZ hszService, HSZ hszTopic, WDML_CONV* pConv = NULL; ATOM aSrv = 0, aTpc = 0; - TRACE("(0x%x,%p,%p,%p)\n", idInst, hszService, hszTopic, pCC); + ERR("(0x%x,%p,%p,%p)\n", idInst, hszService, hszTopic, pCC); pInstance = WDML_GetInstance(idInst); if (!pInstance) @@ -166,7 +166,7 @@ HCONV WINAPI DdeConnect(DWORD idInst, HSZ hszService, HSZ hszTopic, /* note: sent messages shall not use packing */ SendMessageTimeoutW( HWND_BROADCAST, WM_DDE_INITIATE, (WPARAM)hwndClient, MAKELPARAM(aSrv, aTpc), - SMTO_ABORTIFHUNG, 2000, NULL ); + SMTO_ABORTIFHUNG, 0, NULL ); pInstance = WDML_GetInstance(idInst); if (!pInstance) @@ -180,12 +180,12 @@ HCONV WINAPI DdeConnect(DWORD idInst, HSZ hszService, HSZ hszTopic, pConv = WDML_GetConvFromWnd(hwndClient); if (pConv == NULL || pConv->hwndServer == 0) { - WARN("Done with INITIATE, but no Server window available\n"); + ERR("Done with INITIATE, but no Server window available %p\n", (pConv ? pConv->hwndServer : NULL)); pConv = NULL; pInstance->lastError = DMLERR_NO_CONV_ESTABLISHED; goto theEnd; } - TRACE("Connected to Server window (%p)\n", pConv->hwndServer); + ERR("Connected to Server window (%p)\n", pConv->hwndServer); pConv->wConvst = XST_CONNECTED; /* finish init of pConv */ @@ -312,8 +312,8 @@ static WDML_XACT* WDML_ClientQueueAdvise(WDML_CONV* pConv, UINT wType, UINT wFmt /* pack DdeAdvise */ pDdeAdvise = GlobalLock(pXAct->hMem); - pDdeAdvise->fAckReq = (wType & XTYPF_ACKREQ) ? TRUE : FALSE; - pDdeAdvise->fDeferUpd = (wType & XTYPF_NODATA) ? TRUE : FALSE; + pDdeAdvise->fAckReq = (wType & XTYPF_ACKREQ) != 0; + pDdeAdvise->fDeferUpd = (wType & XTYPF_NODATA) != 0; pDdeAdvise->cfFormat = wFmt; GlobalUnlock(pXAct->hMem); @@ -848,7 +848,7 @@ static WDML_QUEUE_STATE WDML_HandleIncomingData(WDML_CONV* pConv, MSG* msg, HDDE * XTYP_ADVDATA and callback should return the proper status. */ pLink = WDML_FindLink(pConv->instance, (HCONV)pConv, WDML_CLIENT_SIDE, hsz, - uiLo ? TRUE : FALSE, wdh.cfFormat); + uiLo != 0, wdh.cfFormat); if (!pLink) { WDML_DecHSZ(pConv->instance, hsz); @@ -1008,22 +1008,20 @@ static WDML_QUEUE_STATE WDML_HandleReply(WDML_CONV* pConv, MSG* msg, HDDEDATA* h */ static HDDEDATA WDML_SyncWaitTransactionReply(HCONV hConv, DWORD dwTimeout, const WDML_XACT* pXAct, DWORD *ack) { - DWORD dwTime; + DWORD start, elapsed; DWORD err; WDML_CONV* pConv; - TRACE("Starting wait for a timeout of %d ms\n", dwTimeout); + ERR("Starting wait for a timeout of %d ms\n", dwTimeout); - /* FIXME: time 32 bit wrap around */ - dwTimeout += GetCurrentTime(); - - while ((dwTime = GetCurrentTime()) < dwTimeout) + start = GetTickCount(); + while ((elapsed = GetTickCount() - start) < dwTimeout) { /* we cannot be in the crit sect all the time because when client and server run in a * single process they need to share the access to the internal data */ if (MsgWaitForMultipleObjects(0, NULL, FALSE, - dwTimeout - dwTime, QS_POSTMESSAGE) == WAIT_OBJECT_0) + dwTimeout - elapsed, QS_POSTMESSAGE) == WAIT_OBJECT_0) { MSG msg; @@ -1034,16 +1032,18 @@ static HDDEDATA WDML_SyncWaitTransactionReply(HCONV hConv, DWORD dwTimeout, cons pConv = WDML_GetConv(hConv, FALSE); if (pConv == NULL) { + ERR("conversation no longer available\n"); /* conversation no longer available... return failure */ return 0; } + ERR("Msg hWnd %p & Client %p\n",msg.hwnd,pConv->hwndClient); if (msg.hwnd == pConv->hwndClient) { /* check that either pXAct has been processed or no more xActions are pending */ BOOL ret = (pConv->transactions == pXAct); if (WDML_HandleReply(pConv, &msg, &hdd, ack) == WDML_QS_HANDLED) { - TRACE("WDML_HandleReply returned WDML_QS_HANDLED\n"); + ERR("WDML_HandleReply returned WDML_QS_HANDLED\n"); ret = TRUE; } else @@ -1057,13 +1057,14 @@ static HDDEDATA WDML_SyncWaitTransactionReply(HCONV hConv, DWORD dwTimeout, cons } else { + ERR("Dispatching message\n"); DispatchMessageW(&msg); } } } } - TRACE("Timeout !!\n"); + ERR("Timeout !!\n"); pConv = WDML_GetConv(hConv, FALSE); if (pConv != NULL) @@ -1143,6 +1144,7 @@ HDDEDATA WINAPI DdeClientTransaction(LPBYTE pData, DWORD cbData, HCONV hConv, HS if (pConv == NULL) { /* cannot set error... cannot get back to DDE instance */ + ERR("No Conv!\n"); return 0; } @@ -1237,14 +1239,18 @@ BOOL WINAPI DdeAbandonTransaction(DWORD idInst, HCONV hConv, DWORD idTransaction { if ((pConv = WDML_GetConv(hConv, TRUE)) && pConv->instance == pInstance) { - for (pXAct = pConv->transactions; pXAct; pXAct = pXAct->next) - { + + pXAct = pConv->transactions; + while (pXAct) { + WDML_XACT *nextXAct = pXAct->next; + if (pXAct->dwTimeout == TIMEOUT_ASYNC && (idTransaction == 0 || pXAct->xActID == idTransaction)) { WDML_UnQueueTransaction(pConv, pXAct); WDML_FreeTransaction(pInstance, pXAct, TRUE); } + pXAct = nextXAct; } } } @@ -1253,13 +1259,16 @@ BOOL WINAPI DdeAbandonTransaction(DWORD idInst, HCONV hConv, DWORD idTransaction for (pConv = pInstance->convs[WDML_CLIENT_SIDE]; pConv; pConv = pConv->next) { if (!(pConv->wStatus & ST_CONNECTED)) continue; - for (pXAct = pConv->transactions; pXAct; pXAct = pXAct->next) - { + pXAct = pConv->transactions; + while (pXAct) { + WDML_XACT *nextXAct = pXAct->next; + if (pXAct->dwTimeout == TIMEOUT_ASYNC) { WDML_UnQueueTransaction(pConv, pXAct); WDML_FreeTransaction(pInstance, pXAct, TRUE); } + pXAct = nextXAct; } } } @@ -1278,16 +1287,18 @@ static LRESULT CALLBACK WDML_ClientProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPA UINT uiLo, uiHi; WDML_CONV* pConv = NULL; HSZ hszSrv, hszTpc; + char buf[256]; + WDML_INSTANCE* pInstance; - TRACE("%p %04x %08lx %08lx\n", hwnd, iMsg, wParam , lParam); + ERR("%p %04x %08lx %08lx\n", hwnd, iMsg, wParam , lParam); - if (iMsg == WM_DDE_ACK && /* in the initial WM_INITIATE sendmessage */ - ((pConv = WDML_GetConvFromWnd(hwnd)) == NULL || pConv->wStatus == XST_INIT1)) + if (iMsg == WM_DDE_ACK && + (!(pConv = WDML_GetConvFromWnd(hwnd)) || pConv->wStatus == XST_INIT1)) { + + ERR("WM_DDE_ACK\n"); /* In response to WM_DDE_INITIATE, save server window */ - char buf[256]; - WDML_INSTANCE* pInstance; /* note: sent messages do not need packing */ uiLo = LOWORD(lParam); diff --git a/win32ss/user/user32/misc/ddeserver.c b/win32ss/user/user32/misc/ddeserver.c index 087431a8931..711fbc24c4e 100644 --- a/win32ss/user/user32/misc/ddeserver.c +++ b/win32ss/user/user32/misc/ddeserver.c @@ -30,8 +30,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(ddeml); static const WCHAR szServerNameClass[] = {'D','d','e','S','e','r','v','e','r','N','a','m','e',0}; -const char WDML_szServerConvClassA[] = "DdeServerConvAnsi"; -const WCHAR WDML_szServerConvClassW[] = {'D','d','e','S','e','r','v','e','r','C','o','n','v','U','n','i','c','o','d','e',0}; +const char WDML_szServerConvClassA[] = "DdeServerConvA"; +const WCHAR WDML_szServerConvClassW[] = {'D','d','e','S','e','r','v','e','r','C','o','n','v','W',0}; static LRESULT CALLBACK WDML_ServerNameProc(HWND, UINT, WPARAM, LPARAM); static LRESULT CALLBACK WDML_ServerConvProc(HWND, UINT, WPARAM, LPARAM); @@ -62,7 +62,7 @@ BOOL WINAPI DdePostAdvise(DWORD idInst, HSZ hszTopic, HSZ hszItem) pInstance = WDML_GetInstance(idInst); - if (pInstance == NULL || pInstance->links == NULL) + if (pInstance == NULL) return FALSE; atom = WDML_MakeAtomFromHsz(hszItem); @@ -135,7 +135,7 @@ BOOL WINAPI DdePostAdvise(DWORD idInst, HSZ hszTopic, HSZ hszItem) return TRUE; theError: - if (atom) GlobalDeleteAtom(atom); + GlobalDeleteAtom(atom); return FALSE; } @@ -380,12 +380,12 @@ static LRESULT CALLBACK WDML_ServerNameProc(HWND hwndServer, UINT iMsg, WPARAM w LOWORD(lParam) -- application atom HIWORD(lParam) -- topic atom */ - TRACE("WM_DDE_INITIATE message received!\n"); + ERR("WM_DDE_INITIATE message received!\n"); hwndClient = (HWND)wParam; pInstance = WDML_GetInstanceFromWnd(hwndServer); - TRACE("idInst=%d, threadID=0x%x\n", pInstance->instanceID, GetCurrentThreadId()); if (!pInstance) return 0; + ERR("idInst=%d, threadID=0x%x\n", pInstance->instanceID, GetCurrentThreadId()); /* don't free DDEParams, since this is a broadcast */ UnpackDDElParam(WM_DDE_INITIATE, lParam, &uiLo, &uiHi); @@ -708,7 +708,7 @@ static WDML_QUEUE_STATE WDML_ServerHandleUnadvise(WDML_CONV* pConv, WDML_XACT* p pXAct->hszItem, TRUE, pXAct->wFmt); if (pLink == NULL) { - ERR("Couln'd find link for %p, dropping request\n", pXAct->hszItem); + ERR("Couldn't find link for %p, dropping request\n", pXAct->hszItem); FreeDDElParam(WM_DDE_UNADVISE, pXAct->lParam); return WDML_QS_ERROR; } @@ -748,6 +748,54 @@ static WDML_XACT* WDML_ServerQueueExecute(WDML_CONV* pConv, LPARAM lParam) return pXAct; } +static BOOL data_looks_unicode( const WCHAR *data, DWORD size ) +{ + DWORD i; + + if (size % sizeof(WCHAR)) return FALSE; + for (i = 0; i < size / sizeof(WCHAR); i++) if (data[i] > 255) return FALSE; + return TRUE; +} + +/* convert data to Unicode, unless it looks like it's already Unicode */ +static HDDEDATA map_A_to_W( DWORD instance, void *ptr, DWORD size ) +{ + HDDEDATA ret; + DWORD len; + const char *end; + + if (!data_looks_unicode( ptr, size )) + { + if ((end = memchr( ptr, 0, size ))) size = end + 1 - (const char *)ptr; + len = MultiByteToWideChar( CP_ACP, 0, ptr, size, NULL, 0 ); + ret = DdeCreateDataHandle( instance, NULL, len * sizeof(WCHAR), 0, 0, CF_TEXT, 0); + MultiByteToWideChar( CP_ACP, 0, ptr, size, (WCHAR *)DdeAccessData(ret, NULL), len ); + } + else ret = DdeCreateDataHandle( instance, ptr, size, 0, 0, CF_TEXT, 0 ); + + return ret; +} + +/* convert data to ASCII, unless it looks like it's not in Unicode format */ +static HDDEDATA map_W_to_A( DWORD instance, void *ptr, DWORD size ) +{ + HDDEDATA ret; + DWORD len; + const WCHAR *end; + + if (data_looks_unicode( ptr, size )) + { + size /= sizeof(WCHAR); + if ((end = memchrW( ptr, 0, size ))) size = end + 1 - (const WCHAR *)ptr; + len = WideCharToMultiByte( CP_ACP, 0, ptr, size, NULL, 0, NULL, NULL ); + ret = DdeCreateDataHandle( instance, NULL, len, 0, 0, CF_TEXT, 0); + WideCharToMultiByte( CP_ACP, 0, ptr, size, (char *)DdeAccessData(ret, NULL), len, NULL, NULL ); + } + else ret = DdeCreateDataHandle( instance, ptr, size, 0, 0, CF_TEXT, 0 ); + + return ret; +} + /****************************************************************** * WDML_ServerHandleExecute * @@ -761,11 +809,16 @@ static WDML_QUEUE_STATE WDML_ServerHandleExecute(WDML_CONV* pConv, WDML_XACT* pX if (!(pConv->instance->CBFflags & CBF_FAIL_EXECUTES)) { LPVOID ptr = GlobalLock(pXAct->hMem); + DWORD size = GlobalSize(pXAct->hMem); if (ptr) { - hDdeData = DdeCreateDataHandle(pConv->instance->instanceID, ptr, GlobalSize(pXAct->hMem), - 0, 0, CF_TEXT, 0); + if (pConv->instance->unicode) /* Unicode server, try to map A->W */ + hDdeData = map_A_to_W( pConv->instance->instanceID, ptr, size ); + else if (!IsWindowUnicode( pConv->hwndClient )) /* ASCII server and client, try to map W->A */ + hDdeData = map_W_to_A( pConv->instance->instanceID, ptr, size ); + else + hDdeData = DdeCreateDataHandle(pConv->instance->instanceID, ptr, size, 0, 0, CF_TEXT, 0); GlobalUnlock(pXAct->hMem); } hDdeData = WDML_InvokeCallback(pConv->instance, XTYP_EXECUTE, 0, (HCONV)pConv, diff --git a/win32ss/user/user32/windows/font.c b/win32ss/user/user32/windows/font.c index 7b5e1431f0d..dc4c9a14dd8 100644 --- a/win32ss/user/user32/windows/font.c +++ b/win32ss/user/user32/windows/font.c @@ -636,8 +636,9 @@ static void TEXT_WordBreak (HDC hdc, WCHAR *str, unsigned int max_str, DT_EDITCONTROL) { /* break the word after the last character that fits (there must be - * at least one; none is caught earlier). - */ + * at least one). */ + if (!chars_fit) + ++chars_fit; *len_str = chars_fit; *chars_used = chars_fit; diff --git a/win32ss/user/user32/windows/mdi.c b/win32ss/user/user32/windows/mdi.c index ae867416199..7fdfee0c734 100644 --- a/win32ss/user/user32/windows/mdi.c +++ b/win32ss/user/user32/windows/mdi.c @@ -860,8 +860,8 @@ static void MDITile( HWND client, MDICLIENTINFO *ci, WPARAM wParam ) for (r = 1; r <= rows && *pWnd; r++, i++) { LONG posOptions = SWP_DRAWFRAME | SWP_NOACTIVATE | SWP_NOZORDER; - LONG style = GetWindowLongW(win_array[i], GWL_STYLE); - if (!(style & WS_SIZEBOX)) posOptions |= SWP_NOSIZE; + LONG style = GetWindowLongW(win_array[i], GWL_STYLE); + if (!(style & WS_SIZEBOX)) posOptions |= SWP_NOSIZE; SetWindowPos(*pWnd, 0, x, y, xsize, ysize, posOptions); y += ysize; @@ -1091,9 +1091,9 @@ static void MDI_UpdateFrameText( HWND frame, HWND hClient, BOOL repaint, LPCWSTR DefWindowProcW( frame, WM_SETTEXT, 0, (LPARAM)lpBuffer ); - if (repaint) - SetWindowPos( frame, 0,0,0,0,0, SWP_FRAMECHANGED | - SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER ); + if (repaint) + SetWindowPos( frame, 0,0,0,0,0, SWP_FRAMECHANGED | + SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER ); } @@ -1830,7 +1830,7 @@ void WINAPI CalcChildScroll( HWND hwnd, INT scroll ) return; } - ERR("CalcChildScroll 1\n"); + TRACE("CalcChildScroll 1\n"); if ((list = WIN_ListChildren( hwnd ))) { int i; @@ -1851,14 +1851,14 @@ void WINAPI CalcChildScroll( HWND hwnd, INT scroll ) OffsetRect(&rect, -WindowInfo.rcClient.left, -WindowInfo.rcClient.top); //WIN_GetRectangles( list[i], COORDS_PARENT, &rect, NULL ); - ERR("CalcChildScroll L\n"); + TRACE("CalcChildScroll L\n"); UnionRect( &childRect, &rect, &childRect ); } } HeapFree( GetProcessHeap(), 0, list ); } UnionRect( &childRect, &clientRect, &childRect ); - ERR("CalcChildScroll 3\n"); + TRACE("CalcChildScroll 3\n"); /* set common info values */ info.cbSize = sizeof(info); info.fMask = SIF_POS | SIF_RANGE | SIF_PAGE; @@ -1883,12 +1883,12 @@ void WINAPI CalcChildScroll( HWND hwnd, INT scroll ) SetScrollInfo(hwnd, SB_HORZ, &info, TRUE); if (scroll == SB_HORZ) { - ERR("CalcChildScroll H\n"); + TRACE("CalcChildScroll H\n"); break; } else { - ERR("CalcChildScroll B\n"); + TRACE("CalcChildScroll B\n"); } /* fall through */ case SB_VERT: @@ -1898,7 +1898,7 @@ void WINAPI CalcChildScroll( HWND hwnd, INT scroll ) info.nPage = 1 + clientRect.bottom - clientRect.top; //info.nMax = childRect.bottom - clientRect.bottom; //info.nPos = clientRect.top - childRect.top; - ERR("CalcChildScroll V\n"); + TRACE("CalcChildScroll V\n"); if (ci->initialStyle & WS_VSCROLL) SetScrollInfo(hwnd, SB_VERT, &info, TRUE); break; @@ -2029,7 +2029,7 @@ TileWindows (HWND hwndParent, UINT wFlags, LPCRECT lpRect, * TileChildWindows (USER32.@) */ WORD WINAPI TileChildWindows( HWND parent, UINT flags ) -{ +{ return TileWindows( parent, flags, NULL, 0, NULL ); } diff --git a/win32ss/user/user32/windows/menu.c b/win32ss/user/user32/windows/menu.c index 5298c6c90ac..37f241c59ef 100644 --- a/win32ss/user/user32/windows/menu.c +++ b/win32ss/user/user32/windows/menu.c @@ -70,10 +70,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(menu); #define IS_MAGIC_BITMAP(id) ((id) && ((INT_PTR)(id) < 12) && ((INT_PTR)(id) >= -1)) #define IS_SYSTEM_MENU(MenuInfo) \ - (0 == ((MenuInfo)->fFlags & MNF_POPUP) && 0 != ((MenuInfo)->fFlags & MNF_SYSDESKMN)) + (0 == ((MenuInfo)->fFlags & MNF_POPUP) && 0 != ((MenuInfo)->fFlags & MNF_SYSMENU)) #define IS_SYSTEM_POPUP(MenuInfo) \ - (0 != ((MenuInfo)->fFlags & MNF_POPUP) && 0 != ((MenuInfo)->fFlags & MNF_SYSDESKMN)) + (0 != ((MenuInfo)->fFlags & MNF_POPUP) && 0 != ((MenuInfo)->fFlags & MNF_SYSMENU)) #define IS_BITMAP_ITEM(flags) (MF_BITMAP == MENU_ITEM_TYPE(flags)) @@ -902,7 +902,7 @@ static UINT FASTCALL MENU_FindItemByKey(HWND WndOwner, HMENU hmenu, } Flags |= menu->fFlags & MNF_POPUP ? MF_POPUP : 0; - Flags |= menu->fFlags & MNF_SYSDESKMN ? MF_SYSMENU : 0; + Flags |= menu->fFlags & MNF_SYSMENU ? MF_SYSMENU : 0; MenuChar = SendMessageW( WndOwner, WM_MENUCHAR, MAKEWPARAM(Key, Flags), (LPARAM) hmenu); @@ -1257,7 +1257,11 @@ static UINT MENU_GetMaxPopupHeight(PROSMENUINFO lppop) { if (lppop->cyMax) + { + //ERR("MGMaxPH cyMax %d\n",lppop->cyMax); return lppop->cyMax; + } + //ERR("MGMaxPH SyMax %d\n",GetSystemMetrics(SM_CYSCREEN) - GetSystemMetrics(SM_CYBORDER)); return GetSystemMetrics(SM_CYSCREEN) - GetSystemMetrics(SM_CYBORDER); } @@ -1844,13 +1848,14 @@ static void FASTCALL MenuDrawMenuItem(HWND hWnd, PROSMENUINFO MenuInfo, HWND Wnd /* process text if present */ if (lpitem->lpstr) { - register int i = 0; + int i = 0; HFONT hfontOld = 0; + UINT uFormat = menuBar ? DT_CENTER | DT_VCENTER | DT_SINGLELINE : DT_LEFT | DT_VCENTER | DT_SINGLELINE; - if((MenuInfo->dwStyle & MNS_CHECKORBMP)) + if ((MenuInfo->dwStyle & MNS_CHECKORBMP)) rect.left += max(0, (int)(MenuInfo->cxTextAlign - GetSystemMetrics(SM_CXMENUCHECK))); else rect.left += MenuInfo->cxTextAlign; @@ -1861,8 +1866,13 @@ static void FASTCALL MenuDrawMenuItem(HWND hWnd, PROSMENUINFO MenuInfo, HWND Wnd } if (menuBar) { - rect.left += MENU_BAR_ITEMS_SPACE / 2; - rect.right -= MENU_BAR_ITEMS_SPACE / 2; + if( lpitem->hbmpItem) + rect.left += lpitem->maxBmpSize.cx; + if( !(lpitem->hbmpItem == HBMMENU_CALLBACK)) + rect.left += MenuCharSize.cx; + rect.right -= MenuCharSize.cx; + //rect.left += MENU_BAR_ITEMS_SPACE / 2; + //rect.right -= MENU_BAR_ITEMS_SPACE / 2; } Text = lpitem->lpstr; @@ -1911,8 +1921,8 @@ static void FASTCALL MenuDrawMenuItem(HWND hWnd, PROSMENUINFO MenuInfo, HWND Wnd --rect.left; --rect.top; --rect.right; --rect.bottom; } SetTextColor(hdc, RGB(0x80, 0x80, 0x80)); - } - DrawTextW( hdc, Text + i + 1, -1, &rect, uFormat ); + } + DrawTextW( hdc, Text + i + 1, -1, &rect, uFormat ); } if (hfontOld) @@ -1961,6 +1971,7 @@ static void FASTCALL MenuDrawPopupMenu(HWND hwnd, HDC hdc, HMENU hmenu ) UINT u; MenuInitRosMenuItemInfo(&ItemInfo); + //for (u = MenuInfo.cItems; u > 0; u--, item++) for (u = 0; u < MenuInfo.cItems; u++) { if (MenuGetRosMenuItemInfo(MenuInfo.Self, u, &ItemInfo)) @@ -1972,7 +1983,9 @@ static void FASTCALL MenuDrawPopupMenu(HWND hwnd, HDC hdc, HMENU hmenu ) } /* draw scroll arrows */ if (MenuInfo.dwArrowsOn) + { MENU_DrawScrollArrows(&MenuInfo, hdc); + } MenuSetRosMenuInfo(&MenuInfo); MenuCleanupRosMenuItemInfo(&ItemInfo); @@ -2013,7 +2026,7 @@ UINT MenuDrawMenuBar( HDC hDC, LPRECT lprect, HWND hwnd, if (hfontOld) SelectObject( hDC, hfontOld); return lppop.cyMenu; } - else + else return DrawMenuBarTemp(hwnd, hDC, lprect, hMenu, NULL); } @@ -2185,6 +2198,7 @@ MENU_EnsureMenuItemVisible(PROSMENUINFO lppop, PROSMENUITEMINFO item, HDC hdc) ScrollWindow(lppop->Wnd, 0, nOldPos - lppop->iTop, &rc, &rc); MENU_DrawScrollArrows(lppop, hdc); } + MenuSetRosMenuInfo(lppop); } } @@ -2248,7 +2262,7 @@ static void FASTCALL MenuSelectItem(HWND hwndOwner, PROSMENUINFO hmenu, UINT wIn WPARAM wParam = MAKEWPARAM( ItemInfo.hSubMenu ? wIndex : ItemInfo.wID, ItemInfo.fType | ItemInfo.fState | (ItemInfo.hSubMenu ? MF_POPUP : 0) | - (hmenu->fFlags & MNF_SYSDESKMN ? MF_SYSMENU : 0 ) ); + (hmenu->fFlags & MNF_SYSMENU ? MF_SYSMENU : 0 ) ); SendMessageW(hwndOwner, WM_MENUSELECT, wParam, (LPARAM) hmenu->Self); } @@ -2267,7 +2281,7 @@ static void FASTCALL MenuSelectItem(HWND hwndOwner, PROSMENUINFO hmenu, UINT wIn { WPARAM wParam = MAKEWPARAM( Pos, ItemInfo.fType | ItemInfo.fState | (ItemInfo.hSubMenu ? MF_POPUP : 0) | - (TopMenuInfo.fFlags & MNF_SYSDESKMN ? MF_SYSMENU : 0 ) ); + (TopMenuInfo.fFlags & MNF_SYSMENU ? MF_SYSMENU : 0 ) ); SendMessageW(hwndOwner, WM_MENUSELECT, wParam, (LPARAM) topmenu); } @@ -3065,7 +3079,7 @@ MenuExecFocusedItem(MTRACKER *Mt, PROSMENUINFO MenuInfo, UINT Flags) do not send a message to the owner */ if (0 == (Flags & TPM_RETURNCMD)) { - if (0 != (MenuInfo->fFlags & MNF_SYSDESKMN)) + if (0 != (MenuInfo->fFlags & MNF_SYSMENU)) { PostMessageW(Mt->OwnerWnd, WM_SYSCOMMAND, ItemInfo.wID, MAKELPARAM((SHORT) Mt->Pt.x, (SHORT) Mt->Pt.y)); @@ -3250,7 +3264,7 @@ MENU_PtMenu(HMENU hMenu, POINT pt) if (ht != HTNOWHERE && ht != HTERROR) ret = hMenu; } else if (ht == HTSYSMENU) - ret = NtUserGetSystemMenu(menu->hWnd, FALSE); + ret = get_win_sys_menu(menu->hWnd); else if (ht == HTMENU) ret = GetMenu( menu->hWnd ); } @@ -3398,7 +3412,7 @@ MenuDoNextMenu(MTRACKER* Mt, UINT Vk, UINT wFlags) else if (0 != (Style & WS_SYSMENU)) { /* switch to the system menu */ - NewMenu = NtUserGetSystemMenu(NewWnd, FALSE); + NewMenu = get_win_sys_menu(NewWnd); } else { @@ -3415,10 +3429,10 @@ MenuDoNextMenu(MTRACKER* Mt, UINT Vk, UINT wFlags) DWORD Style = GetWindowLongPtrW(NewWnd, GWL_STYLE); if (0 != (Style & WS_SYSMENU) - && GetSystemMenu(NewWnd, FALSE) == NewMenu) + && get_win_sys_menu(NewWnd) == NewMenu) { /* get the real system menu */ - NewMenu = NtUserGetSystemMenu(NewWnd, FALSE); + NewMenu = get_win_sys_menu(NewWnd); } else if (0 != (Style & WS_CHILD) || GetMenu(NewWnd) != NewMenu) { @@ -4081,7 +4095,7 @@ static BOOL FASTCALL MenuInitTracking(HWND hWnd, HMENU hMenu, BOOL bPopup, UINT IntNotifyWinEvent( EVENT_SYSTEM_MENUSTART, hWnd, - MenuInfo.fFlags & MNF_SYSDESKMN ? OBJID_SYSMENU : OBJID_MENU, + MenuInfo.fFlags & MNF_SYSMENU ? OBJID_SYSMENU : OBJID_MENU, CHILDID_SELF, 0); return TRUE; } @@ -4108,7 +4122,7 @@ static BOOL FASTCALL MenuExitTracking(HWND hWnd, BOOL bPopup) */ VOID MenuTrackMouseMenuBar( HWND hWnd, ULONG ht, POINT pt) { - HMENU hMenu = (ht == HTSYSMENU) ? NtUserGetSystemMenu( hWnd, FALSE) : GetMenu(hWnd); + HMENU hMenu = (ht == HTSYSMENU) ? get_win_sys_menu( hWnd ) : GetMenu(hWnd); UINT wFlags = TPM_BUTTONDOWN | TPM_LEFTALIGN | TPM_LEFTBUTTON; TRACE("wnd=%p ht=0x%04x (%ld,%ld)\n", hWnd, ht, pt.x, pt.y); @@ -4124,6 +4138,8 @@ VOID MenuTrackMouseMenuBar( HWND hWnd, ULONG ht, POINT pt) } MenuInitTracking(hWnd, hMenu, FALSE, wFlags); + /* fetch the window menu again, it may have changed */ + hMenu = (ht == HTSYSMENU) ? get_win_sys_menu( hWnd ) : GetMenu( hWnd ); MenuTrackMenu(hMenu, wFlags, pt.x, pt.y, hWnd, NULL); MenuExitTracking(hWnd, FALSE); } @@ -4155,7 +4171,7 @@ VOID MenuTrackKbdMenuBar(HWND hwnd, UINT wParam, WCHAR wChar) if (!hTrackMenu || IsIconic(hwnd) || wChar == ' ' ) { if (!(GetWindowLongPtrW( hwnd, GWL_STYLE ) & WS_SYSMENU)) return; - hTrackMenu = NtUserGetSystemMenu(hwnd, FALSE); + hTrackMenu = get_win_sys_menu(hwnd); uItem = 0; wParam |= HTSYSMENU; /* prevent item lookup */ } @@ -4432,6 +4448,44 @@ MenuCleanup(VOID) } } +HMENU FASTCALL MENU_LoadSystemMenu(BOOL mdi) +{ + HMENU hmenu = LoadMenuW(User32Instance, L"SYSMENU"); + + if (hmenu) + { + MENUINFO menuinfo = {0}; + MENUITEMINFOW info = {0}; + //WCHAR buf[128]; + + // removing space for checkboxes from menu + menuinfo.cbSize = sizeof(menuinfo); + menuinfo.fMask = MIM_STYLE; + GetMenuInfo(hmenu, &menuinfo); + menuinfo.dwStyle |= MNS_CHECKORBMP; + SetMenuInfo(hmenu, &menuinfo); + + // adding bitmaps to menu items + info.cbSize = sizeof(info); + info.fMask |= MIIM_BITMAP; + info.hbmpItem = HBMMENU_POPUP_MINIMIZE; + SetMenuItemInfoW(hmenu, SC_MINIMIZE, FALSE, &info); + info.hbmpItem = HBMMENU_POPUP_RESTORE; + SetMenuItemInfoW(hmenu, SC_RESTORE, FALSE, &info); + info.hbmpItem = HBMMENU_POPUP_MAXIMIZE; + SetMenuItemInfoW(hmenu, SC_MAXIMIZE, FALSE, &info); + info.hbmpItem = HBMMENU_POPUP_CLOSE; + SetMenuItemInfoW(hmenu, SC_CLOSE, FALSE, &info); + if (mdi) + { + AppendMenuW(hmenu, MF_SEPARATOR, 0, NULL); + //LoadStringW(User32Instance, IDS_MDI_NEXT, buf, sizeof(buf)/sizeof(WCHAR)); + //AppendMenuW(hmenu, MF_STRING, SC_NEXTWINDOW, buf); + } + } + return hmenu; +} + NTSTATUS WINAPI User32LoadSysMenuTemplateForKernel(PVOID Arguments, ULONG ArgumentLength) { @@ -5023,11 +5077,7 @@ GetSystemMenu( HWND hWnd, BOOL bRevert) { - HMENU TopMenu; - - TopMenu = NtUserGetSystemMenu(hWnd, bRevert); - - return NULL == TopMenu ? NULL : GetSubMenu(TopMenu, 0); + return NtUserGetSystemMenu(hWnd, bRevert); } /* diff --git a/win32ss/user/user32/windows/message.c b/win32ss/user/user32/windows/message.c index f3a729155cb..2e7a737c72d 100644 --- a/win32ss/user/user32/windows/message.c +++ b/win32ss/user/user32/windows/message.c @@ -245,7 +245,7 @@ DWORD FASTCALL get_input_codepage( void ) if (!ret) cp = CP_ACP; return cp; } - + static WPARAM FASTCALL map_wparam_char_WtoA( WPARAM wParam, DWORD len ) { WCHAR wch = wParam; @@ -253,7 +253,7 @@ static WPARAM FASTCALL map_wparam_char_WtoA( WPARAM wParam, DWORD len ) DWORD cp = get_input_codepage(); len = WideCharToMultiByte( cp, 0, &wch, 1, (LPSTR)ch, len, NULL, NULL ); - if (len == 2) + if (len == 2) return MAKEWPARAM( (ch[0] << 8) | ch[1], HIWORD(wParam) ); else return MAKEWPARAM( ch[0], HIWORD(wParam) ); @@ -743,9 +743,9 @@ MsgiAnsiToUnicodeMessage(HWND hwnd, LPMSG UnicodeMsg, LPMSG AnsiMsg) case WM_CHARTOITEM: case WM_MENUCHAR: - case WM_CHAR: + case WM_CHAR: case WM_DEADCHAR: - case WM_SYSCHAR: + case WM_SYSCHAR: case WM_SYSDEADCHAR: case EM_SETPASSWORDCHAR: case WM_IME_CHAR: @@ -1139,14 +1139,14 @@ MsgiUnicodeToAnsiMessage(HWND hwnd, LPMSG AnsiMsg, LPMSG UnicodeMsg) } case WM_GETDLGCODE: - if (UnicodeMsg->lParam) + if (UnicodeMsg->lParam) { MSG newmsg = *(MSG *)UnicodeMsg->lParam; switch(newmsg.message) { case WM_CHAR: case WM_DEADCHAR: - case WM_SYSCHAR: + case WM_SYSCHAR: case WM_SYSDEADCHAR: newmsg.wParam = map_wparam_char_WtoA( newmsg.wParam, 1 ); break; @@ -1169,9 +1169,9 @@ MsgiUnicodeToAnsiMessage(HWND hwnd, LPMSG AnsiMsg, LPMSG UnicodeMsg) break; case WM_CHARTOITEM: - case WM_MENUCHAR: - case WM_DEADCHAR: - case WM_SYSCHAR: + case WM_MENUCHAR: + case WM_DEADCHAR: + case WM_SYSCHAR: case WM_SYSDEADCHAR: case EM_SETPASSWORDCHAR: AnsiMsg->wParam = map_wparam_char_WtoA(UnicodeMsg->wParam,1); @@ -1303,7 +1303,7 @@ MsgiUnicodeToAnsiReply(LPMSG AnsiMsg, LPMSG UnicodeMsg, LRESULT *Result) { DWORD len = AnsiMsg->wParam;// * 2; if (len) - { + { if (*Result) { RtlMultiByteToUnicodeN( UBuffer, AnsiMsg->wParam*sizeof(WCHAR), &len, Buffer, strlen(Buffer)+1 ); @@ -2404,7 +2404,7 @@ SendMessageW(HWND Wnd, if ( Window != NULL && Window->head.pti == ti && - !ISITHOOKED(WH_CALLWNDPROC) && + !ISITHOOKED(WH_CALLWNDPROC) && !ISITHOOKED(WH_CALLWNDPROCRET) && !(Window->state & WNDS_SERVERSIDEWINDOWPROC) ) { @@ -2468,7 +2468,7 @@ SendMessageA(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam) if ( Window != NULL && Window->head.pti == ti && - !ISITHOOKED(WH_CALLWNDPROC) && + !ISITHOOKED(WH_CALLWNDPROC) && !ISITHOOKED(WH_CALLWNDPROCRET) && !(Window->state & WNDS_SERVERSIDEWINDOWPROC) ) { @@ -2935,7 +2935,7 @@ User32CallWindowProcFromKernel(PVOID Arguments, ULONG ArgumentLength) case WM_SIZING: { PRECT prect = (PRECT) KMMsg.lParam; - ERR("WM_SIZING 1 t %d l %d r %d b %d\n",prect->top,prect->left,prect->right,prect->bottom); + TRACE("WM_SIZING 1 t %d l %d r %d b %d\n",prect->top,prect->left,prect->right,prect->bottom); break; } default: @@ -2983,7 +2983,7 @@ User32CallWindowProcFromKernel(PVOID Arguments, ULONG ArgumentLength) case WM_SIZING: { PRECT prect = (PRECT) KMMsg.lParam; - ERR("WM_SIZING 2 t %d l %d r %d b %d\n",prect->top,prect->left,prect->right,prect->bottom); + TRACE("WM_SIZING 2 t %d l %d r %d b %d\n",prect->top,prect->left,prect->right,prect->bottom); break; } default: diff --git a/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c b/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c index 0b6b2f52b20..88799e48653 100644 --- a/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c +++ b/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c @@ -12,7 +12,7 @@ /* INCLUDES *******************************************************************/ #include - +#include #include #define NDEBUG @@ -250,7 +250,8 @@ AppendMenuItems(HMENU hMenu, } while (!(Items[i].uID == 0 && Items[i].SubMenu == NULL && Items[i].wCmdID == 0)); } -static VOID +//static +VOID CreateSysMenu(HWND hWnd) { MENUITEMINFOW mii; @@ -301,7 +302,9 @@ Copy(PGUI_CONSOLE_DATA GuiData); static VOID Paste(PGUI_CONSOLE_DATA GuiData); static VOID -UpdateSelection(PGUI_CONSOLE_DATA GuiData, PCOORD coord); +UpdateSelection(PGUI_CONSOLE_DATA GuiData, + PCOORD SelectionAnchor OPTIONAL, + PCOORD coord); static VOID Mark(PGUI_CONSOLE_DATA GuiData) @@ -309,30 +312,28 @@ Mark(PGUI_CONSOLE_DATA GuiData) PCONSOLE_SCREEN_BUFFER ActiveBuffer = GuiData->ActiveBuffer; /* Clear the old selection */ - // UpdateSelection(GuiData, NULL); GuiData->Selection.dwFlags = CONSOLE_NO_SELECTION; /* Restart a new selection */ - GuiData->dwSelectionCursor.X = ActiveBuffer->ViewOrigin.X; - GuiData->dwSelectionCursor.Y = ActiveBuffer->ViewOrigin.Y; - GuiData->Selection.dwSelectionAnchor = GuiData->dwSelectionCursor; - UpdateSelection(GuiData, &GuiData->Selection.dwSelectionAnchor); + GuiData->dwSelectionCursor = ActiveBuffer->ViewOrigin; + UpdateSelection(GuiData, + &GuiData->dwSelectionCursor, + &GuiData->dwSelectionCursor); } static VOID SelectAll(PGUI_CONSOLE_DATA GuiData) { PCONSOLE_SCREEN_BUFFER ActiveBuffer = GuiData->ActiveBuffer; + COORD SelectionAnchor; /* Clear the old selection */ - // UpdateSelection(GuiData, NULL); GuiData->Selection.dwFlags = CONSOLE_NO_SELECTION; /* * The selection area extends to the whole screen buffer's width. */ - GuiData->Selection.dwSelectionAnchor.X = 0; - GuiData->Selection.dwSelectionAnchor.Y = 0; + SelectionAnchor.X = SelectionAnchor.Y = 0; GuiData->dwSelectionCursor.X = ActiveBuffer->ScreenBufferSize.X - 1; /* @@ -358,7 +359,7 @@ SelectAll(PGUI_CONSOLE_DATA GuiData) /* Restart a new selection */ GuiData->Selection.dwFlags |= CONSOLE_MOUSE_SELECTION; - UpdateSelection(GuiData, &GuiData->dwSelectionCursor); + UpdateSelection(GuiData, &SelectionAnchor, &GuiData->dwSelectionCursor); } static LRESULT @@ -587,7 +588,8 @@ OnNcCreate(HWND hWnd, LPCREATESTRUCTW Create) SetWindowLongPtrW(GuiData->hWindow, GWLP_USERDATA, (DWORD_PTR)GuiData); SetTimer(GuiData->hWindow, CONGUI_UPDATE_TIMER, CONGUI_UPDATE_TIME, NULL); - CreateSysMenu(GuiData->hWindow); + // FIXME: HACK: Potential HACK for CORE-8129; see revision 63595. + //CreateSysMenu(GuiData->hWindow); DPRINT("OnNcCreate - setting start event\n"); SetEvent(GuiData->hGuiInitEvent); @@ -678,18 +680,162 @@ SmallRectToRect(PGUI_CONSOLE_DATA GuiData, PRECT Rect, PSMALL_RECT SmallRect) Rect->bottom = (SmallRect->Bottom + 1 - Buffer->ViewOrigin.Y) * HeightUnit; } +VOID +GetSelectionBeginEnd(PCOORD Begin, PCOORD End, + PCOORD SelectionAnchor, + PSMALL_RECT SmallRect) +{ + if (Begin == NULL || End == NULL) return; + + *Begin = *SelectionAnchor; + End->X = (SelectionAnchor->X == SmallRect->Left) ? SmallRect->Right + /* Case X != Left, must be == Right */ : SmallRect->Left; + End->Y = (SelectionAnchor->Y == SmallRect->Top ) ? SmallRect->Bottom + /* Case Y != Top, must be == Bottom */ : SmallRect->Top; + + /* Exchange Begin / End if Begin > End lexicographically */ + if (Begin->Y > End->Y || (Begin->Y == End->Y && Begin->X > End->X)) + { + End->X = _InterlockedExchange16(&Begin->X, End->X); + End->Y = _InterlockedExchange16(&Begin->Y, End->Y); + } +} + +static HRGN +CreateSelectionRgn(PGUI_CONSOLE_DATA GuiData, + BOOL LineSelection, + PCOORD SelectionAnchor, + PSMALL_RECT SmallRect) +{ + if (!LineSelection) + { + RECT rect; + SmallRectToRect(GuiData, &rect, SmallRect); + return CreateRectRgnIndirect(&rect); + } + else + { + HRGN SelRgn; + COORD Begin, End; + + GetSelectionBeginEnd(&Begin, &End, SelectionAnchor, SmallRect); + + if (Begin.Y == End.Y) + { + SMALL_RECT sr; + RECT r ; + + sr.Left = Begin.X; + sr.Top = Begin.Y; + sr.Right = End.X; + sr.Bottom = End.Y; + + // Debug thingie to see whether I can put this corner case + // together with the previous one. + if (SmallRect->Left != sr.Left || + SmallRect->Top != sr.Top || + SmallRect->Right != sr.Right || + SmallRect->Bottom != sr.Bottom) + { + DPRINT1("\n" + "SmallRect = (%d, %d, %d, %d)\n" + "sr = (%d, %d, %d, %d)\n" + "\n", + SmallRect->Left, SmallRect->Top, SmallRect->Right, SmallRect->Bottom, + sr.Left, sr.Top, sr.Right, sr.Bottom); + } + + SmallRectToRect(GuiData, &r, &sr); + SelRgn = CreateRectRgnIndirect(&r); + } + else + { + PCONSOLE_SCREEN_BUFFER ActiveBuffer = GuiData->ActiveBuffer; + + HRGN rg1, rg2, rg3; + SMALL_RECT sr1, sr2, sr3; + RECT r1 , r2 , r3 ; + + sr1.Left = Begin.X; + sr1.Top = Begin.Y; + sr1.Right = ActiveBuffer->ScreenBufferSize.X - 1; + sr1.Bottom = Begin.Y; + + sr2.Left = 0; + sr2.Top = Begin.Y + 1; + sr2.Right = ActiveBuffer->ScreenBufferSize.X - 1; + sr2.Bottom = End.Y - 1; + + sr3.Left = 0; + sr3.Top = End.Y; + sr3.Right = End.X; + sr3.Bottom = End.Y; + + SmallRectToRect(GuiData, &r1, &sr1); + SmallRectToRect(GuiData, &r2, &sr2); + SmallRectToRect(GuiData, &r3, &sr3); + + rg1 = CreateRectRgnIndirect(&r1); + rg2 = CreateRectRgnIndirect(&r2); + rg3 = CreateRectRgnIndirect(&r3); + + CombineRgn(rg1, rg1, rg2, RGN_XOR); + CombineRgn(rg1, rg1, rg3, RGN_XOR); + DeleteObject(rg3); + DeleteObject(rg2); + + SelRgn = rg1; + } + + return SelRgn; + } +} + static VOID -UpdateSelection(PGUI_CONSOLE_DATA GuiData, PCOORD coord) +PaintSelectionRect(PGUI_CONSOLE_DATA GuiData, PPAINTSTRUCT pps) +{ + HRGN rgnPaint = CreateRectRgnIndirect(&pps->rcPaint); + HRGN rgnSel = CreateSelectionRgn(GuiData, GuiData->LineSelection, + &GuiData->Selection.dwSelectionAnchor, + &GuiData->Selection.srSelection); + + /* Invert the selection */ + + int ErrorCode = CombineRgn(rgnPaint, rgnPaint, rgnSel, RGN_AND); + if (ErrorCode != ERROR && ErrorCode != NULLREGION) + { + InvertRgn(pps->hdc, rgnPaint); + } + + DeleteObject(rgnSel); + DeleteObject(rgnPaint); +} + +static VOID +UpdateSelection(PGUI_CONSOLE_DATA GuiData, + PCOORD SelectionAnchor OPTIONAL, + PCOORD coord) { PCONSOLE Console = GuiData->Console; - RECT oldRect; + HRGN oldRgn = CreateSelectionRgn(GuiData, GuiData->LineSelection, + &GuiData->Selection.dwSelectionAnchor, + &GuiData->Selection.srSelection); - SmallRectToRect(GuiData, &oldRect, &GuiData->Selection.srSelection); + /* Update the anchor if needed (use the old one if NULL) */ + if (SelectionAnchor) + GuiData->Selection.dwSelectionAnchor = *SelectionAnchor; if (coord != NULL) { - RECT newRect; SMALL_RECT rc; + HRGN newRgn; + + /* + * Pressing the Control key while selecting text, allows us to enter + * into line-selection mode, the selection mode of *nix terminals. + */ + BOOL OldLineSel = GuiData->LineSelection; + GuiData->LineSelection = !!(GetKeyState(VK_CONTROL) & 0x8000); /* Exchange left/top with right/bottom if required */ rc.Left = min(GuiData->Selection.dwSelectionAnchor.X, coord->X); @@ -697,64 +843,72 @@ UpdateSelection(PGUI_CONSOLE_DATA GuiData, PCOORD coord) rc.Right = max(GuiData->Selection.dwSelectionAnchor.X, coord->X); rc.Bottom = max(GuiData->Selection.dwSelectionAnchor.Y, coord->Y); - SmallRectToRect(GuiData, &newRect, &rc); + newRgn = CreateSelectionRgn(GuiData, GuiData->LineSelection, + &GuiData->Selection.dwSelectionAnchor, + &rc); if (GuiData->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY) { - if (memcmp(&rc, &GuiData->Selection.srSelection, sizeof(SMALL_RECT)) != 0) + if (OldLineSel != GuiData->LineSelection || + memcmp(&rc, &GuiData->Selection.srSelection, sizeof(SMALL_RECT)) != 0) { - HRGN rgn1, rgn2; - /* Calculate the region that needs to be updated */ - if ((rgn1 = CreateRectRgnIndirect(&oldRect))) + if (oldRgn && newRgn && CombineRgn(newRgn, newRgn, oldRgn, RGN_XOR) != ERROR) { - if ((rgn2 = CreateRectRgnIndirect(&newRect))) - { - if (CombineRgn(rgn1, rgn2, rgn1, RGN_XOR) != ERROR) - { - InvalidateRgn(GuiData->hWindow, rgn1, FALSE); - } - DeleteObject(rgn2); - } - DeleteObject(rgn1); + InvalidateRgn(GuiData->hWindow, newRgn, FALSE); } } } else { - InvalidateRect(GuiData->hWindow, &newRect, FALSE); + InvalidateRgn(GuiData->hWindow, newRgn, FALSE); } + DeleteObject(newRgn); + GuiData->Selection.dwFlags |= CONSOLE_SELECTION_NOT_EMPTY; GuiData->Selection.srSelection = rc; GuiData->dwSelectionCursor = *coord; if ((GuiData->Selection.dwFlags & CONSOLE_SELECTION_IN_PROGRESS) == 0) { - LPWSTR SelectionType, WindowTitle = NULL; - SIZE_T Length = 0; + LPWSTR SelTypeStr = NULL , WindowTitle = NULL; + SIZE_T SelTypeStrLength = 0, Length = 0; /* Clear the old selection */ if (GuiData->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY) { - InvalidateRect(GuiData->hWindow, &oldRect, FALSE); + InvalidateRgn(GuiData->hWindow, oldRgn, FALSE); } - if (GuiData->Selection.dwFlags & CONSOLE_MOUSE_SELECTION) - { - SelectionType = L"Selection - "; - } - else - { - SelectionType = L"Mark - "; - } + /* + * When passing a zero-length buffer size, LoadString(...) returns + * a read-only pointer buffer to the program's resource string. + */ + SelTypeStrLength = + LoadStringW(ConSrvDllInstance, + (GuiData->Selection.dwFlags & CONSOLE_MOUSE_SELECTION) + ? IDS_SELECT_TITLE : IDS_MARK_TITLE, + (LPWSTR)&SelTypeStr, 0); - Length = Console->Title.Length + wcslen(SelectionType) + 1; - WindowTitle = ConsoleAllocHeap(0, Length * sizeof(WCHAR)); - wcscpy(WindowTitle, SelectionType); - wcscat(WindowTitle, Console->Title.Buffer); - SetWindowText(GuiData->hWindow, WindowTitle); - ConsoleFreeHeap(WindowTitle); + /* + * Prepend the selection type string to the current console title + * if we succeeded in retrieving a valid localized string. + */ + if (SelTypeStr) + { + // 3 for " - " and 1 for NULL + Length = Console->Title.Length + (SelTypeStrLength + 3 + 1) * sizeof(WCHAR); + WindowTitle = ConsoleAllocHeap(0, Length); + + wcsncpy(WindowTitle, SelTypeStr, SelTypeStrLength); + WindowTitle[SelTypeStrLength] = L'\0'; + wcscat(WindowTitle, L" - "); + wcscat(WindowTitle, Console->Title.Buffer); + + SetWindowText(GuiData->hWindow, WindowTitle); + ConsoleFreeHeap(WindowTitle); + } GuiData->Selection.dwFlags |= CONSOLE_SELECTION_IN_PROGRESS; ConioPause(Console, PAUSED_FROM_SELECTION); @@ -765,14 +919,17 @@ UpdateSelection(PGUI_CONSOLE_DATA GuiData, PCOORD coord) /* Clear the selection */ if (GuiData->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY) { - InvalidateRect(GuiData->hWindow, &oldRect, FALSE); + InvalidateRgn(GuiData->hWindow, oldRgn, FALSE); } GuiData->Selection.dwFlags = CONSOLE_NO_SELECTION; ConioUnpause(Console, PAUSED_FROM_SELECTION); + /* Restore the console title */ SetWindowText(GuiData->hWindow, Console->Title.Buffer); } + + DeleteObject(oldRgn); } @@ -826,15 +983,10 @@ OnPaint(PGUI_CONSOLE_DATA GuiData) rcPaint.top, SRCCOPY); + /* Draw the selection region if needed */ if (GuiData->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY) { - SmallRectToRect(GuiData, &rcPaint, &GuiData->Selection.srSelection); - - /* Invert the selection */ - if (IntersectRect(&rcPaint, &ps.rcPaint, &rcPaint)) - { - InvertRect(ps.hdc, &rcPaint); - } + PaintSelectionRect(GuiData, &ps); } LeaveCriticalSection(&GuiData->Lock); @@ -911,10 +1063,10 @@ OnKey(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam) goto Quit; } else if ( VirtualKeyCode == VK_ESCAPE || - (VirtualKeyCode == 'C' && GetKeyState(VK_CONTROL) & 0x8000) ) + (VirtualKeyCode == 'C' && (GetKeyState(VK_CONTROL) & 0x8000)) ) { /* Cancel selection if ESC or Ctrl-C are pressed */ - UpdateSelection(GuiData, NULL); + UpdateSelection(GuiData, NULL, NULL); goto Quit; } @@ -922,7 +1074,7 @@ OnKey(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam) { /* Keyboard selection mode */ BOOL Interpreted = FALSE; - BOOL MajPressed = (GetKeyState(VK_SHIFT) & 0x8000); + BOOL MajPressed = !!(GetKeyState(VK_SHIFT) & 0x8000); switch (VirtualKeyCode) { @@ -1003,10 +1155,9 @@ OnKey(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam) if (Interpreted) { - if (!MajPressed) - GuiData->Selection.dwSelectionAnchor = GuiData->dwSelectionCursor; - - UpdateSelection(GuiData, &GuiData->dwSelectionCursor); + UpdateSelection(GuiData, + !MajPressed ? &GuiData->dwSelectionCursor : NULL, + &GuiData->dwSelectionCursor); } else if (!IsSystemKey(VirtualKeyCode)) { @@ -1023,7 +1174,7 @@ OnKey(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam) if (!IsSystemKey(VirtualKeyCode)) { /* Clear the selection and send the key into the input buffer */ - UpdateSelection(GuiData, NULL); + UpdateSelection(GuiData, NULL, NULL); } else { @@ -1273,27 +1424,26 @@ OnMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam) case WM_LBUTTONDOWN: { /* Clear the old selection */ - // UpdateSelection(GuiData, NULL); GuiData->Selection.dwFlags = CONSOLE_NO_SELECTION; /* Restart a new selection */ - GuiData->Selection.dwSelectionAnchor = PointToCoord(GuiData, lParam); + GuiData->dwSelectionCursor = PointToCoord(GuiData, lParam); SetCapture(GuiData->hWindow); GuiData->Selection.dwFlags |= CONSOLE_MOUSE_SELECTION | CONSOLE_MOUSE_DOWN; - UpdateSelection(GuiData, &GuiData->Selection.dwSelectionAnchor); + UpdateSelection(GuiData, + &GuiData->dwSelectionCursor, + &GuiData->dwSelectionCursor); break; } case WM_LBUTTONUP: { - // COORD c; - if (!(GuiData->Selection.dwFlags & CONSOLE_MOUSE_DOWN)) break; - // c = PointToCoord(GuiData, lParam); + // GuiData->dwSelectionCursor = PointToCoord(GuiData, lParam); GuiData->Selection.dwFlags &= ~CONSOLE_MOUSE_DOWN; - // UpdateSelection(GuiData, &c); + // UpdateSelection(GuiData, NULL, &GuiData->dwSelectionCursor); ReleaseCapture(); break; @@ -1305,10 +1455,7 @@ OnMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam) if (GetType(Buffer) == TEXTMODE_BUFFER) { -#ifdef IS_WHITESPACE -#undef IS_WHITESPACE -#endif -#define IS_WHITESPACE(c) \ +#define IS_WORD_SEP(c) \ ((c) == L'\0' || (c) == L' ' || (c) == L'\t' || (c) == L'\r' || (c) == L'\n') PTEXTMODE_SCREEN_BUFFER TextBuffer = (PTEXTMODE_SCREEN_BUFFER)Buffer; @@ -1320,15 +1467,15 @@ OnMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam) ptrL = ptrR = ConioCoordToPointer(TextBuffer, cL.X, cL.Y); /* Enlarge the selection by checking for whitespace */ - while ((0 < cL.X) && !IS_WHITESPACE(ptrL->Char.UnicodeChar) - && !IS_WHITESPACE((ptrL-1)->Char.UnicodeChar)) + while ((0 < cL.X) && !IS_WORD_SEP(ptrL->Char.UnicodeChar) + && !IS_WORD_SEP((ptrL-1)->Char.UnicodeChar)) { --cL.X; --ptrL; } while ((cR.X < TextBuffer->ScreenBufferSize.X - 1) && - !IS_WHITESPACE(ptrR->Char.UnicodeChar) && - !IS_WHITESPACE((ptrR+1)->Char.UnicodeChar)) + !IS_WORD_SEP(ptrR->Char.UnicodeChar) && + !IS_WORD_SEP((ptrR+1)->Char.UnicodeChar)) { ++cR.X; ++ptrR; @@ -1338,11 +1485,8 @@ OnMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam) * Update the selection started with the single * left-click that preceded this double-click. */ - GuiData->Selection.dwSelectionAnchor = cL; - GuiData->dwSelectionCursor = cR; - GuiData->Selection.dwFlags |= CONSOLE_MOUSE_SELECTION | CONSOLE_MOUSE_DOWN; - UpdateSelection(GuiData, &GuiData->dwSelectionCursor); + UpdateSelection(GuiData, &cL, &cR); /* Ignore the next mouse move signal */ GuiData->IgnoreNextMouseSignal = TRUE; @@ -1370,13 +1514,12 @@ OnMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam) case WM_MOUSEMOVE: { - COORD c; - if (!(wParam & MK_LBUTTON)) break; if (!(GuiData->Selection.dwFlags & CONSOLE_MOUSE_DOWN)) break; - c = PointToCoord(GuiData, lParam); /* TODO: Scroll buffer to bring c into view */ - UpdateSelection(GuiData, &c); + // TODO: Scroll buffer to bring SelectionCursor into view + GuiData->dwSelectionCursor = PointToCoord(GuiData, lParam); + UpdateSelection(GuiData, NULL, &GuiData->dwSelectionCursor); break; } @@ -1546,7 +1689,7 @@ Copy(PGUI_CONSOLE_DATA GuiData) } /* Clear the selection */ - UpdateSelection(GuiData, NULL); + UpdateSelection(GuiData, NULL, NULL); } VOID diff --git a/win32ss/user/winsrv/consrv/frontends/gui/conwnd.h b/win32ss/user/winsrv/consrv/frontends/gui/conwnd.h index a6be0cf1146..f6caa6d57f5 100644 --- a/win32ss/user/winsrv/consrv/frontends/gui/conwnd.h +++ b/win32ss/user/winsrv/consrv/frontends/gui/conwnd.h @@ -65,6 +65,7 @@ typedef struct _GUI_CONSOLE_DATA PCONSOLE_SCREEN_BUFFER ActiveBuffer; /* Pointer to the active screen buffer (then maybe the previous Console member is redundant?? Or not...) */ CONSOLE_SELECTION_INFO Selection; /* Contains information about the selection */ COORD dwSelectionCursor; /* Selection cursor position, most of the time different from Selection.dwSelectionAnchor */ + BOOL LineSelection; /* TRUE if line-oriented selection (a la *nix terminals), FALSE if block-oriented selection (default on Windows) */ GUI_CONSOLE_INFO GuiInfo; /* GUI terminal settings */ } GUI_CONSOLE_DATA, *PGUI_CONSOLE_DATA; diff --git a/win32ss/user/winsrv/consrv/frontends/gui/graphics.c b/win32ss/user/winsrv/consrv/frontends/gui/graphics.c index 730ed130cb6..37111b3f415 100644 --- a/win32ss/user/winsrv/consrv/frontends/gui/graphics.c +++ b/win32ss/user/winsrv/consrv/frontends/gui/graphics.c @@ -34,7 +34,7 @@ GuiCopyFromGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer, selWidth = GuiData->Selection.srSelection.Right - GuiData->Selection.srSelection.Left + 1; selHeight = GuiData->Selection.srSelection.Bottom - GuiData->Selection.srSelection.Top + 1; - DPRINT1("Selection is (%d|%d) to (%d|%d)\n", + DPRINT("Selection is (%d|%d) to (%d|%d)\n", GuiData->Selection.srSelection.Left, GuiData->Selection.srSelection.Top, GuiData->Selection.srSelection.Right, diff --git a/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c b/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c index ce078cd20e8..6fb343a324d 100644 --- a/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c +++ b/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c @@ -140,7 +140,8 @@ InvalidateCell(PGUI_CONSOLE_DATA GuiData, VOID SwitchFullScreen(PGUI_CONSOLE_DATA GuiData, BOOL FullScreen); - +VOID +CreateSysMenu(HWND hWnd); static LRESULT CALLBACK GuiConsoleNotifyWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { @@ -199,6 +200,9 @@ GuiConsoleNotifyWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) GuiConsoleMoveWindow(GuiData); // FIXME: This MUST be done via the CreateWindowExW call. SendMessageW(GuiData->hWindow, PM_RESIZE_TERMINAL, 0, 0); + // FIXME: HACK: Potential HACK for CORE-8129; see revision 63595. + CreateSysMenu(GuiData->hWindow); + /* Switch to full-screen mode if necessary */ // FIXME: Move elsewhere, it cause misdrawings of the window. if (GuiData->GuiInfo.FullScreen) SwitchFullScreen(GuiData, TRUE); @@ -533,8 +537,11 @@ GuiInitFrontEnd(IN OUT PFRONTEND This, GuiData->CmdIdLow = GuiData->CmdIdHigh = 0; /* Initialize the selection */ - RtlZeroMemory(&GuiData->Selection, sizeof(CONSOLE_SELECTION_INFO)); + RtlZeroMemory(&GuiData->Selection, sizeof(GuiData->Selection)); GuiData->Selection.dwFlags = CONSOLE_NO_SELECTION; + RtlZeroMemory(&GuiData->dwSelectionCursor, sizeof(GuiData->dwSelectionCursor)); + GuiData->LineSelection = FALSE; // Default to block selection + // TODO: Retrieve the selection mode via the registry. /* * We need to wait until the GUI has been fully initialized diff --git a/win32ss/user/winsrv/consrv/frontends/gui/lang/bg-BG.rc b/win32ss/user/winsrv/consrv/frontends/gui/lang/bg-BG.rc index fd09239166f..6f56be272fa 100644 --- a/win32ss/user/winsrv/consrv/frontends/gui/lang/bg-BG.rc +++ b/win32ss/user/winsrv/consrv/frontends/gui/lang/bg-BG.rc @@ -22,3 +22,9 @@ BEGIN */ IDS_TERMINAL_TITLE "ReactOS Console" END + +STRINGTABLE +BEGIN + IDS_MARK_TITLE "Mark" + IDS_SELECT_TITLE "Select" +END diff --git a/win32ss/user/winsrv/consrv/frontends/gui/lang/cs-CZ.rc b/win32ss/user/winsrv/consrv/frontends/gui/lang/cs-CZ.rc index b40524ac78d..6cf5faf594d 100644 --- a/win32ss/user/winsrv/consrv/frontends/gui/lang/cs-CZ.rc +++ b/win32ss/user/winsrv/consrv/frontends/gui/lang/cs-CZ.rc @@ -24,3 +24,9 @@ BEGIN */ IDS_TERMINAL_TITLE "ReactOS Console" END + +STRINGTABLE +BEGIN + IDS_MARK_TITLE "Mark" + IDS_SELECT_TITLE "Select" +END diff --git a/win32ss/user/winsrv/consrv/frontends/gui/lang/de-DE.rc b/win32ss/user/winsrv/consrv/frontends/gui/lang/de-DE.rc index fcac4773c35..31ee03f3cd8 100644 --- a/win32ss/user/winsrv/consrv/frontends/gui/lang/de-DE.rc +++ b/win32ss/user/winsrv/consrv/frontends/gui/lang/de-DE.rc @@ -22,3 +22,9 @@ BEGIN */ IDS_TERMINAL_TITLE "ReactOS Eingabeaufforderung" END + +STRINGTABLE +BEGIN + IDS_MARK_TITLE "Mark" + IDS_SELECT_TITLE "Select" +END diff --git a/win32ss/user/winsrv/consrv/frontends/gui/lang/el-GR.rc b/win32ss/user/winsrv/consrv/frontends/gui/lang/el-GR.rc index 696823bef64..4ed65aa232c 100644 --- a/win32ss/user/winsrv/consrv/frontends/gui/lang/el-GR.rc +++ b/win32ss/user/winsrv/consrv/frontends/gui/lang/el-GR.rc @@ -22,3 +22,9 @@ BEGIN */ IDS_TERMINAL_TITLE "ReactOS Console" END + +STRINGTABLE +BEGIN + IDS_MARK_TITLE "Mark" + IDS_SELECT_TITLE "Select" +END diff --git a/win32ss/user/winsrv/consrv/frontends/gui/lang/en-US.rc b/win32ss/user/winsrv/consrv/frontends/gui/lang/en-US.rc index d1d81746519..1a32b4882e7 100644 --- a/win32ss/user/winsrv/consrv/frontends/gui/lang/en-US.rc +++ b/win32ss/user/winsrv/consrv/frontends/gui/lang/en-US.rc @@ -22,3 +22,9 @@ BEGIN */ IDS_TERMINAL_TITLE "ReactOS Console" END + +STRINGTABLE +BEGIN + IDS_MARK_TITLE "Mark" + IDS_SELECT_TITLE "Select" +END diff --git a/win32ss/user/winsrv/consrv/frontends/gui/lang/es-ES.rc b/win32ss/user/winsrv/consrv/frontends/gui/lang/es-ES.rc index ca10531bbdb..60d1bdcbe88 100644 --- a/win32ss/user/winsrv/consrv/frontends/gui/lang/es-ES.rc +++ b/win32ss/user/winsrv/consrv/frontends/gui/lang/es-ES.rc @@ -24,3 +24,9 @@ BEGIN */ IDS_TERMINAL_TITLE "ReactOS Console" END + +STRINGTABLE +BEGIN + IDS_MARK_TITLE "Mark" + IDS_SELECT_TITLE "Select" +END diff --git a/win32ss/user/winsrv/consrv/frontends/gui/lang/fr-FR.rc b/win32ss/user/winsrv/consrv/frontends/gui/lang/fr-FR.rc index 7b6f76aa1c7..0dde5099530 100644 --- a/win32ss/user/winsrv/consrv/frontends/gui/lang/fr-FR.rc +++ b/win32ss/user/winsrv/consrv/frontends/gui/lang/fr-FR.rc @@ -24,3 +24,9 @@ BEGIN */ IDS_TERMINAL_TITLE "ReactOS Console" END + +STRINGTABLE +BEGIN + IDS_MARK_TITLE "Marquage" + IDS_SELECT_TITLE "Sélection" +END diff --git a/win32ss/user/winsrv/consrv/frontends/gui/lang/he-IL.rc b/win32ss/user/winsrv/consrv/frontends/gui/lang/he-IL.rc index 513298c53cd..26e9a424118 100644 --- a/win32ss/user/winsrv/consrv/frontends/gui/lang/he-IL.rc +++ b/win32ss/user/winsrv/consrv/frontends/gui/lang/he-IL.rc @@ -22,3 +22,9 @@ BEGIN */ IDS_TERMINAL_TITLE "ReactOS Console" END + +STRINGTABLE +BEGIN + IDS_MARK_TITLE "Mark" + IDS_SELECT_TITLE "Select" +END diff --git a/win32ss/user/winsrv/consrv/frontends/gui/lang/id-ID.rc b/win32ss/user/winsrv/consrv/frontends/gui/lang/id-ID.rc index 97904b68e7f..6020733fd58 100644 --- a/win32ss/user/winsrv/consrv/frontends/gui/lang/id-ID.rc +++ b/win32ss/user/winsrv/consrv/frontends/gui/lang/id-ID.rc @@ -22,3 +22,9 @@ BEGIN */ IDS_TERMINAL_TITLE "ReactOS Console" END + +STRINGTABLE +BEGIN + IDS_MARK_TITLE "Mark" + IDS_SELECT_TITLE "Select" +END diff --git a/win32ss/user/winsrv/consrv/frontends/gui/lang/it-IT.rc b/win32ss/user/winsrv/consrv/frontends/gui/lang/it-IT.rc index 5c2e0ce20e8..e5da7b6d9c9 100644 --- a/win32ss/user/winsrv/consrv/frontends/gui/lang/it-IT.rc +++ b/win32ss/user/winsrv/consrv/frontends/gui/lang/it-IT.rc @@ -24,3 +24,9 @@ BEGIN */ IDS_TERMINAL_TITLE "ReactOS Console" END + +STRINGTABLE +BEGIN + IDS_MARK_TITLE "Mark" + IDS_SELECT_TITLE "Select" +END diff --git a/win32ss/user/winsrv/consrv/frontends/gui/lang/ja-JP.rc b/win32ss/user/winsrv/consrv/frontends/gui/lang/ja-JP.rc index b94590d7b1e..701e292e90b 100644 --- a/win32ss/user/winsrv/consrv/frontends/gui/lang/ja-JP.rc +++ b/win32ss/user/winsrv/consrv/frontends/gui/lang/ja-JP.rc @@ -22,3 +22,9 @@ BEGIN */ IDS_TERMINAL_TITLE "ReactOS Console" END + +STRINGTABLE +BEGIN + IDS_MARK_TITLE "Mark" + IDS_SELECT_TITLE "Select" +END diff --git a/win32ss/user/winsrv/consrv/frontends/gui/lang/no-NO.rc b/win32ss/user/winsrv/consrv/frontends/gui/lang/no-NO.rc index 776e90965bd..b73c535f2eb 100644 --- a/win32ss/user/winsrv/consrv/frontends/gui/lang/no-NO.rc +++ b/win32ss/user/winsrv/consrv/frontends/gui/lang/no-NO.rc @@ -22,3 +22,9 @@ BEGIN */ IDS_TERMINAL_TITLE "ReactOS Console" END + +STRINGTABLE +BEGIN + IDS_MARK_TITLE "Mark" + IDS_SELECT_TITLE "Select" +END diff --git a/win32ss/user/winsrv/consrv/frontends/gui/lang/pl-PL.rc b/win32ss/user/winsrv/consrv/frontends/gui/lang/pl-PL.rc index b20c766a3f7..4a6594b48d7 100644 --- a/win32ss/user/winsrv/consrv/frontends/gui/lang/pl-PL.rc +++ b/win32ss/user/winsrv/consrv/frontends/gui/lang/pl-PL.rc @@ -4,6 +4,7 @@ * https://sourceforge.net/projects/reactospl * Translation update by Olaf Siejka (Caemyr), Apr 2011 * UTF-8 conversion by Caemyr (May, 2011) + * Update by wojo664 (June 2014) */ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT @@ -30,3 +31,9 @@ BEGIN */ IDS_TERMINAL_TITLE "Konsola ReactOS" END + +STRINGTABLE +BEGIN + IDS_MARK_TITLE "Zaznacz" + IDS_SELECT_TITLE "Wybierz" +END diff --git a/win32ss/user/winsrv/consrv/frontends/gui/lang/pt-BR.rc b/win32ss/user/winsrv/consrv/frontends/gui/lang/pt-BR.rc index f4b90ecaaa1..c58d17576f8 100644 --- a/win32ss/user/winsrv/consrv/frontends/gui/lang/pt-BR.rc +++ b/win32ss/user/winsrv/consrv/frontends/gui/lang/pt-BR.rc @@ -24,3 +24,9 @@ BEGIN */ IDS_TERMINAL_TITLE "ReactOS Console" END + +STRINGTABLE +BEGIN + IDS_MARK_TITLE "Mark" + IDS_SELECT_TITLE "Select" +END diff --git a/win32ss/user/winsrv/consrv/frontends/gui/lang/ro-RO.rc b/win32ss/user/winsrv/consrv/frontends/gui/lang/ro-RO.rc index 46c2de95ad8..2de14516e74 100644 --- a/win32ss/user/winsrv/consrv/frontends/gui/lang/ro-RO.rc +++ b/win32ss/user/winsrv/consrv/frontends/gui/lang/ro-RO.rc @@ -24,3 +24,9 @@ BEGIN */ IDS_TERMINAL_TITLE "Consola ReactOS" END + +STRINGTABLE +BEGIN + IDS_MARK_TITLE "Mark" + IDS_SELECT_TITLE "Select" +END diff --git a/win32ss/user/winsrv/consrv/frontends/gui/lang/ru-RU.rc b/win32ss/user/winsrv/consrv/frontends/gui/lang/ru-RU.rc index dcdc2b30060..826cefb4d69 100644 --- a/win32ss/user/winsrv/consrv/frontends/gui/lang/ru-RU.rc +++ b/win32ss/user/winsrv/consrv/frontends/gui/lang/ru-RU.rc @@ -22,3 +22,9 @@ BEGIN */ IDS_TERMINAL_TITLE "ReactOS Console" END + +STRINGTABLE +BEGIN + IDS_MARK_TITLE "Mark" + IDS_SELECT_TITLE "Select" +END diff --git a/win32ss/user/winsrv/consrv/frontends/gui/lang/sk-SK.rc b/win32ss/user/winsrv/consrv/frontends/gui/lang/sk-SK.rc index a586c3907bc..22890783534 100644 --- a/win32ss/user/winsrv/consrv/frontends/gui/lang/sk-SK.rc +++ b/win32ss/user/winsrv/consrv/frontends/gui/lang/sk-SK.rc @@ -27,3 +27,9 @@ BEGIN */ IDS_TERMINAL_TITLE "ReactOS Console" END + +STRINGTABLE +BEGIN + IDS_MARK_TITLE "Mark" + IDS_SELECT_TITLE "Select" +END diff --git a/win32ss/user/winsrv/consrv/frontends/gui/lang/sv-SE.rc b/win32ss/user/winsrv/consrv/frontends/gui/lang/sv-SE.rc index 35255a8dece..466ea208629 100644 --- a/win32ss/user/winsrv/consrv/frontends/gui/lang/sv-SE.rc +++ b/win32ss/user/winsrv/consrv/frontends/gui/lang/sv-SE.rc @@ -24,3 +24,9 @@ BEGIN */ IDS_TERMINAL_TITLE "ReactOS Console" END + +STRINGTABLE +BEGIN + IDS_MARK_TITLE "Mark" + IDS_SELECT_TITLE "Select" +END diff --git a/win32ss/user/winsrv/consrv/frontends/gui/lang/tr-TR.rc b/win32ss/user/winsrv/consrv/frontends/gui/lang/tr-TR.rc index aba643bdbba..9632005db14 100644 --- a/win32ss/user/winsrv/consrv/frontends/gui/lang/tr-TR.rc +++ b/win32ss/user/winsrv/consrv/frontends/gui/lang/tr-TR.rc @@ -24,3 +24,9 @@ BEGIN */ IDS_TERMINAL_TITLE "ReactOS Console" END + +STRINGTABLE +BEGIN + IDS_MARK_TITLE "Mark" + IDS_SELECT_TITLE "Select" +END diff --git a/win32ss/user/winsrv/consrv/frontends/gui/lang/uk-UA.rc b/win32ss/user/winsrv/consrv/frontends/gui/lang/uk-UA.rc index bafa79d530c..b0ecb8ee6a5 100644 --- a/win32ss/user/winsrv/consrv/frontends/gui/lang/uk-UA.rc +++ b/win32ss/user/winsrv/consrv/frontends/gui/lang/uk-UA.rc @@ -24,3 +24,9 @@ BEGIN */ IDS_TERMINAL_TITLE "ReactOS Console" END + +STRINGTABLE +BEGIN + IDS_MARK_TITLE "Mark" + IDS_SELECT_TITLE "Select" +END diff --git a/win32ss/user/winsrv/consrv/frontends/gui/lang/zh-CN.rc b/win32ss/user/winsrv/consrv/frontends/gui/lang/zh-CN.rc index 57ac95b01a8..c0d14a2cd94 100644 --- a/win32ss/user/winsrv/consrv/frontends/gui/lang/zh-CN.rc +++ b/win32ss/user/winsrv/consrv/frontends/gui/lang/zh-CN.rc @@ -22,3 +22,9 @@ BEGIN */ IDS_TERMINAL_TITLE "ReactOS Console" END + +STRINGTABLE +BEGIN + IDS_MARK_TITLE "Mark" + IDS_SELECT_TITLE "Select" +END diff --git a/win32ss/user/winsrv/consrv/frontends/gui/lang/zh-TW.rc b/win32ss/user/winsrv/consrv/frontends/gui/lang/zh-TW.rc index 2b62adb4810..5848be04f47 100644 --- a/win32ss/user/winsrv/consrv/frontends/gui/lang/zh-TW.rc +++ b/win32ss/user/winsrv/consrv/frontends/gui/lang/zh-TW.rc @@ -22,3 +22,9 @@ BEGIN */ IDS_TERMINAL_TITLE "ReactOS Console" END + +STRINGTABLE +BEGIN + IDS_MARK_TITLE "Mark" + IDS_SELECT_TITLE "Select" +END diff --git a/win32ss/user/winsrv/consrv/frontends/gui/resource.h b/win32ss/user/winsrv/consrv/frontends/gui/resource.h index 1b79e6e8ac1..2762cd9eee9 100644 --- a/win32ss/user/winsrv/consrv/frontends/gui/resource.h +++ b/win32ss/user/winsrv/consrv/frontends/gui/resource.h @@ -18,17 +18,18 @@ #define ID_SYSTEM_DEFAULTS 0xFFF6 #define ID_SYSTEM_PROPERTIES 0xFFF7 -#define NCPOPUP_MENU 103 +#define IDS_EDIT 204 +#define IDS_MARK 205 +#define IDS_COPY 206 +#define IDS_PASTE 207 +#define IDS_SELECTALL 208 +#define IDS_SCROLL 209 +#define IDS_FIND 210 +#define IDS_DEFAULTS 211 +#define IDS_PROPERTIES 212 -#define IDS_EDIT 204 -#define IDS_MARK 205 -#define IDS_COPY 206 -#define IDS_PASTE 207 -#define IDS_SELECTALL 208 -#define IDS_SCROLL 209 -#define IDS_FIND 210 -#define IDS_DEFAULTS 211 -#define IDS_PROPERTIES 212 +#define IDS_MARK_TITLE 220 +#define IDS_SELECT_TITLE 221 // Scrollbar resource ids. Unused. /* diff --git a/win32ss/user/winsrv/consrv/frontends/gui/text.c b/win32ss/user/winsrv/consrv/frontends/gui/text.c index 84d0101d8af..078cb40fe03 100644 --- a/win32ss/user/winsrv/consrv/frontends/gui/text.c +++ b/win32ss/user/winsrv/consrv/frontends/gui/text.c @@ -18,6 +18,10 @@ #include "guiterm.h" +/* GLOBALS ********************************************************************/ + +#define IS_WHITESPACE(c) ((c) == L'\0' || (c) == L' ' || (c) == L'\t') + /* FUNCTIONS ******************************************************************/ COLORREF PaletteRGBFromAttrib(PCONSOLE Console, WORD Attribute) @@ -31,38 +35,33 @@ COLORREF PaletteRGBFromAttrib(PCONSOLE Console, WORD Attribute) return PALETTERGB(pe.peRed, pe.peGreen, pe.peBlue); } -VOID -GuiCopyFromTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer, - PGUI_CONSOLE_DATA GuiData) +static VOID +CopyBlock(PTEXTMODE_SCREEN_BUFFER Buffer, + PSMALL_RECT Selection) { - /* - * This function supposes that the system clipboard was opened. - */ - /* * Pressing the Shift key while copying text, allows us to copy * text without newline characters (inline-text copy mode). */ - BOOL InlineCopyMode = (GetKeyState(VK_SHIFT) & 0x8000); + BOOL InlineCopyMode = !!(GetKeyState(VK_SHIFT) & 0x8000); HANDLE hData; PCHAR_INFO ptr; LPWSTR data, dstPos; ULONG selWidth, selHeight; - ULONG xPos, yPos, size; + ULONG xPos, yPos; + ULONG size; - selWidth = GuiData->Selection.srSelection.Right - GuiData->Selection.srSelection.Left + 1; - selHeight = GuiData->Selection.srSelection.Bottom - GuiData->Selection.srSelection.Top + 1; - DPRINT("Selection is (%d|%d) to (%d|%d)\n", - GuiData->Selection.srSelection.Left, - GuiData->Selection.srSelection.Top, - GuiData->Selection.srSelection.Right, - GuiData->Selection.srSelection.Bottom); + DPRINT("CopyBlock(%u, %u, %u, %u)\n", + Selection->Left, Selection->Top, Selection->Right, Selection->Bottom); -#ifdef IS_WHITESPACE -#undef IS_WHITESPACE -#endif -#define IS_WHITESPACE(c) ((c) == L'\0' || (c) == L' ' || (c) == L'\t') + /* Prevent against empty blocks */ + if (Selection == NULL) return; + if (Selection->Left > Selection->Right || Selection->Top > Selection->Bottom) + return; + + selWidth = Selection->Right - Selection->Left + 1; + selHeight = Selection->Bottom - Selection->Top + 1; /* Basic size for one line... */ size = selWidth; @@ -75,6 +74,11 @@ GuiCopyFromTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer, */ size += (selWidth + (!InlineCopyMode ? 2 : 0)) * (selHeight - 1); } + else + { + DPRINT1("This case must never happen, because selHeight is at least == 1\n"); + } + size += 1; /* Null-termination */ size *= sizeof(WCHAR); @@ -97,8 +101,8 @@ GuiCopyFromTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer, ULONG length = selWidth; ptr = ConioCoordToPointer(Buffer, - GuiData->Selection.srSelection.Left, - GuiData->Selection.srSelection.Top + yPos); + Selection->Left, + Selection->Top + yPos); /* Trim whitespace from the right */ while (length > 0) @@ -116,16 +120,15 @@ GuiCopyFromTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer, * Sometimes, applications can put NULL chars into the screen-buffer * (this behaviour is allowed). Detect this and replace by a space. */ - dstPos[xPos] = (ptr[xPos].Char.UnicodeChar ? ptr[xPos].Char.UnicodeChar : L' '); + *dstPos++ = (ptr[xPos].Char.UnicodeChar ? ptr[xPos].Char.UnicodeChar : L' '); } - dstPos += length; /* Add newline characters if we are not in inline-text copy mode */ if (!InlineCopyMode) { if (yPos != (selHeight - 1)) { - wcscat(data, L"\r\n"); + wcscat(dstPos, L"\r\n"); dstPos += 2; } } @@ -138,6 +141,127 @@ GuiCopyFromTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer, SetClipboardData(CF_UNICODETEXT, hData); } +static VOID +CopyLines(PTEXTMODE_SCREEN_BUFFER Buffer, + PCOORD Begin, + PCOORD End) +{ + HANDLE hData; + PCHAR_INFO ptr; + LPWSTR data, dstPos; + ULONG NumChars, size; + ULONG xPos, yPos, xBeg, xEnd; + + DPRINT("CopyLines((%u, %u) ; (%u, %u))\n", + Begin->X, Begin->Y, End->X, End->Y); + + /* Prevent against empty blocks... */ + if (Begin == NULL || End == NULL) return; + /* ... or malformed blocks */ + if (Begin->Y > End->Y || (Begin->Y == End->Y && Begin->X > End->X)) return; + + /* Compute the number of characters to copy */ + if (End->Y == Begin->Y) // top == bottom + { + NumChars = End->X - Begin->X + 1; + } + else // if (End->Y > Begin->Y) + { + NumChars = Buffer->ScreenBufferSize.X - Begin->X; + + if (End->Y >= Begin->Y + 2) + { + NumChars += (End->Y - Begin->Y - 1) * Buffer->ScreenBufferSize.X; + } + + NumChars += End->X + 1; + } + + size = (NumChars + 1) * sizeof(WCHAR); /* Null-terminated */ + + /* Allocate some memory area to be given to the clipboard, so it will not be freed here */ + hData = GlobalAlloc(GMEM_MOVEABLE | GMEM_ZEROINIT, size); + if (hData == NULL) return; + + data = GlobalLock(hData); + if (data == NULL) + { + GlobalFree(hData); + return; + } + + DPRINT("Copying %d characters\n", NumChars); + dstPos = data; + + /* + * We need to walk per-lines, and not just looping in the big screen-buffer + * array, because of the way things are stored inside it. The downside is + * that it makes the code more complicated. + */ + for (yPos = Begin->Y; (yPos <= End->Y) && (NumChars > 0); yPos++) + { + xBeg = (yPos == Begin->Y ? Begin->X : 0); + xEnd = (yPos == End->Y ? End->X : Buffer->ScreenBufferSize.X - 1); + + ptr = ConioCoordToPointer(Buffer, 0, yPos); + + /* Copy only the characters, leave attributes alone */ + for (xPos = xBeg; (xPos <= xEnd) && (NumChars-- > 0); xPos++) + { + /* + * Sometimes, applications can put NULL chars into the screen-buffer + * (this behaviour is allowed). Detect this and replace by a space. + */ + *dstPos++ = (ptr[xPos].Char.UnicodeChar ? ptr[xPos].Char.UnicodeChar : L' '); + } + } + + DPRINT("Setting data <%S> to clipboard\n", data); + GlobalUnlock(hData); + + EmptyClipboard(); + SetClipboardData(CF_UNICODETEXT, hData); +} + + +VOID +GetSelectionBeginEnd(PCOORD Begin, PCOORD End, + PCOORD SelectionAnchor, + PSMALL_RECT SmallRect); + +VOID +GuiCopyFromTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer, + PGUI_CONSOLE_DATA GuiData) +{ + /* + * This function supposes that the system clipboard was opened. + */ + + BOOL LineSelection = GuiData->LineSelection; + + DPRINT("Selection is (%d|%d) to (%d|%d) in %s mode\n", + GuiData->Selection.srSelection.Left, + GuiData->Selection.srSelection.Top, + GuiData->Selection.srSelection.Right, + GuiData->Selection.srSelection.Bottom, + (LineSelection ? "line" : "block")); + + if (!LineSelection) + { + CopyBlock(Buffer, &GuiData->Selection.srSelection); + } + else + { + COORD Begin, End; + + GetSelectionBeginEnd(&Begin, &End, + &GuiData->Selection.dwSelectionAnchor, + &GuiData->Selection.srSelection); + + CopyLines(Buffer, &Begin, &End); + } +} + VOID GuiPasteToTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer, PGUI_CONSOLE_DATA GuiData) diff --git a/win32ss/user/winsrv/init.c b/win32ss/user/winsrv/init.c index 877cdc3f8d2..4b3ec92d635 100644 --- a/win32ss/user/winsrv/init.c +++ b/win32ss/user/winsrv/init.c @@ -32,6 +32,7 @@ KeyboardHookProc(int nCode, WPARAM wParam, LPARAM lParam) { + DPRINT1("KeyboardHookProc Processing!\n"); return CallNextHookEx(hhk, nCode, wParam, lParam); } /*** END - HACK from win32csr... ***/