diff --git a/CMakeLists.txt b/CMakeLists.txt index 0746eda4b1e..d1f8eb3276f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 2.6) -if(${CMAKE_VERSION} VERSION_GREATER "2.8.3") +if(POLICY CMP0017) # Shadow cmake provided modules cmake_policy(SET CMP0017 OLD) endif() @@ -13,6 +13,7 @@ include(include/reactos/version.cmake) # Don't escape preprocessor definition values added via add_definitions cmake_policy(SET CMP0005 OLD) +cmake_policy(SET CMP0002 NEW) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON) @@ -20,7 +21,7 @@ set(CMAKE_SHARED_LIBRARY_PREFIX "") set(CMAKE_SKIP_PREPROCESSED_SOURCE_RULES TRUE) set(CMAKE_SKIP_ASSEMBLY_SOURCE_RULES TRUE) set(CMAKE_COLOR_MAKEFILE OFF) -set_property(GLOBAL PROPERTY RULE_MESSAGES OFF) +#set_property(GLOBAL PROPERTY RULE_MESSAGES OFF) if(NOT ARCH) set(ARCH i386) @@ -71,6 +72,9 @@ else() set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER) + + #useful stuff! + include(CMakeParseArguments) # Do some cleanup file(REMOVE @@ -102,10 +106,6 @@ else() # IDL macros for widl/midl include(cmake/idl-support.cmake) - #Some useful variables - set(LIVECD_DIR "${REACTOS_BINARY_DIR}/boot/livecd") - set(BOOTCD_DIR "${REACTOS_BINARY_DIR}/boot/bootcd") - # Activate support for assembly source files enable_language(ASM) @@ -185,8 +185,9 @@ else() include(baseaddress.cmake) - add_subdirectory(base) + #begin with boot so reactos_cab target is defined before all other modules add_subdirectory(boot) + add_subdirectory(base) add_subdirectory(dll) add_subdirectory(drivers) add_subdirectory(hal) @@ -200,9 +201,6 @@ else() file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/importlibs) - #bootcd and livecd - include(ros_cd.cmake) - add_dependency_footer() endif() diff --git a/CMakeMacros.cmake b/CMakeMacros.cmake index 1e7510893c4..85849dcf95b 100644 --- a/CMakeMacros.cmake +++ b/CMakeMacros.cmake @@ -22,7 +22,6 @@ macro(CreateBootSectorTarget _target_name _asm_file _object_file) DEPENDS ${_asm_file}) set_source_files_properties(${_object_file} PROPERTIES GENERATED TRUE) add_custom_target(${_target_name} ALL DEPENDS ${_object_file}) - add_minicd(${_object_file} loader ${OBJECT_NAME}) endmacro() else() @@ -32,21 +31,6 @@ endmacro() endif() -macro(add_minicd_target _targetname _dir) # optional parameter: _nameoncd - if("${ARGN}" STREQUAL "") - get_target_property(FILENAME ${_targetname} LOCATION) - get_filename_component(_nameoncd ${FILENAME} NAME) - else() - set(_nameoncd ${ARGN}) - endif() - - file(APPEND ${REACTOS_BINARY_DIR}/boot/ros_minicd_target.txt "${_targetname}\t${_dir}\t${_nameoncd}\n") -endmacro() - -macro(add_minicd FILENAME _dir _nameoncd) - file(APPEND ${REACTOS_BINARY_DIR}/boot/ros_minicd.txt "${FILENAME}\t${_dir}\t${_nameoncd}\n") -endmacro() - macro(set_cpp) include_directories(BEFORE ${REACTOS_SOURCE_DIR}/include/c++/stlport) set(IS_CPP 1) @@ -55,68 +39,6 @@ macro(set_cpp) -DNATIVE_C_INCLUDE=${REACTOS_SOURCE_DIR}/include/crt) endmacro() -macro(add_livecd_target _targetname _dir )# optional parameter : _nameoncd - if("${ARGN}" STREQUAL "") - get_target_property(FILENAME ${_targetname} LOCATION) - get_filename_component(_nameoncd ${FILENAME} NAME) - else() - set(_nameoncd ${ARGN}) - endif() - - file(APPEND ${REACTOS_BINARY_DIR}/boot/ros_livecd_target.txt "${_targetname}\t${_dir}\t${_nameoncd}\n") -endmacro() - -macro(add_livecd FILENAME _dir)# optional parameter : _nameoncd - if("${ARGN}" STREQUAL "") - get_filename_component(_nameoncd ${FILENAME} NAME) - else() - set(_nameoncd ${ARGN}) - endif() - file(APPEND ${REACTOS_BINARY_DIR}/boot/ros_livecd.txt "${FILENAME}\t${_dir}\t${_nameoncd}\n") -endmacro() - -macro(cab_to_dir _dir_num _var_name) -# 1 = system32 -# 2 = system32\drivers -# 3 = Fonts -# 4 = -# 5 = system32\drivers\etc -# 6 = inf -# 7 = bin -# 8 = media - if(${_dir_num} STREQUAL "1") - set(${_var_name} "reactos/system32") - elseif(${_dir_num} STREQUAL "2") - set(${_var_name} "reactos/system32/drivers") - elseif(${_dir_num} STREQUAL "3") - set(${_var_name} "reactos/fonts") - elseif(${_dir_num} STREQUAL "4") - set(${_var_name} "reactos") - elseif(${_dir_num} STREQUAL "5") - set(${_var_name} "reactos/system32/drivers/etc") - elseif(${_dir_num} STREQUAL "6") - set(${_var_name} "reactos/inf") - elseif(${_dir_num} STREQUAL "7") - set(${_var_name} "reactos/bin") - elseif(${_dir_num} STREQUAL "8") - set(${_var_name} "reactos/system32/drivers") - else() - message(FATAL_ERROR "Wrong directory ${_dir_num}") - endif() -endmacro() - -macro(add_cab_target _targetname _num ) - file(APPEND ${REACTOS_BINARY_DIR}/boot/ros_cab_target.txt "${_targetname}\t${_num}\n") - cab_to_dir(${_num} _dir) - add_livecd_target(${_targetname} ${_dir}) -endmacro() - -macro(add_cab FILENAME _num) - file(APPEND ${REACTOS_BINARY_DIR}/boot/ros_cab.txt "${FILENAME}\t${_num}\n") - cab_to_dir(${_num} _dir) - add_livecd(${FILENAME} ${_dir}) -endmacro() - macro(add_dependency_node _node) if(GENERATE_DEPENDENCY_GRAPH) get_target_property(_type ${_node} TYPE) @@ -159,3 +81,102 @@ macro(add_message_headers) endforeach() endmacro() +macro(dir_to_num dir var) + if(${dir} STREQUAL reactos/system32) + set(${var} 1) + elseif(${dir} STREQUAL reactos/system32/drivers) + set(${var} 2) + elseif(${dir} STREQUAL reactos/Fonts) + set(${var} 3) + elseif(${dir} STREQUAL reactos) + set(${var} 4) + elseif(${dir} STREQUAL reactos/system32/drivers/etc) + set(${var} 5) + elseif(${dir} STREQUAL reactos/inf) + set(${var} 6) + elseif(${dir} STREQUAL reactos/bin) + set(${var} 7) + elseif(${dir} STREQUAL reactos/media) + set(${var} 8) + else() + message(ERROR "Wrong destination: ${dir}") + endif() +endmacro() + +function(add_cd_file) + cmake_parse_arguments(_CD "NO_CAB" "DESTINATION;NAME_ON_CD;TARGET" "FILE;FOR" ${ARGN}) + if(NOT (_CD_TARGET OR _CD_FILE)) + message(FATAL_ERROR "You must provide a target or a file to install!") + endif() + + if(NOT _CD_DESTINATION) + message(FATAL_ERROR "You must provide a destination") + elseif(${_CD_DESTINATION} STREQUAL root) + set(_CD_DESTINATION "") + endif() + + if(NOT _CD_FOR) + message(FATAL_ERROR "You must provide a cd name (or "all" for all of them) to install the file on!") + endif() + + #get file if we need to + if(NOT _CD_FILE) + get_target_property(_CD_FILE ${_CD_TARGET} LOCATION) + endif() + + #do we add it to all CDs? + if(_CD_FOR STREQUAL all) + set(_CD_FOR "bootcd;livecd;regtest") + endif() + + #do we add it to bootcd? + list(FIND _CD_FOR bootcd __cd) + if(NOT __cd EQUAL -1) + #whether or not we should put it in reactos.cab or directly on cd + if(_CD_NO_CAB) + #directly on cd + foreach(item ${_CD_FILE}) + file(APPEND ${REACTOS_BINARY_DIR}/boot/bootcd.cmake "file(COPY \"${item}\" DESTINATION \"\${CD_DIR}/${_CD_DESTINATION}\")\n") + endforeach() + if(_CD_NAME_ON_CD) + get_filename_component(__file ${_CD_FILE} NAME) + #rename it in the cd tree + file(APPEND ${REACTOS_BINARY_DIR}/boot/bootcd.cmake "file(RENAME \${CD_DIR}/${_CD_DESTINATION}/${__file} \${CD_DIR}/${_CD_DESTINATION}/${_CD_NAME_ON_CD})\n") + endif() + if(_CD_TARGET) + #manage dependency + add_dependencies(bootcd ${_CD_TARGET}) + endif() + else() + #add it in reactos.cab + dir_to_num(${_CD_DESTINATION} _num) + if(CMAKE_HOST_SYSTEM_NAME MATCHES Windows) + file(APPEND ${REACTOS_BINARY_DIR}/boot/bootdata/packages/reactos.dff.dyn "${_CD_FILE} ${_num}\n") + else() + file(APPEND ${REACTOS_BINARY_DIR}/boot/bootdata/packages/reactos.dff.dyn "\"${_CD_FILE}\" ${_num}\n") + endif() + if(_CD_TARGET) + #manage dependency + add_dependencies(reactos_cab ${_CD_TARGET}) + endif() + endif() + endif() #end bootcd + + #do we add it to livecd? + list(FIND _CD_FOR livecd __cd) + if(NOT __cd EQUAL -1) + #manage dependency + if(_CD_TARGET) + add_dependencies(livecd ${_CD_TARGET}) + endif() + foreach(item ${_CD_FILE}) + file(APPEND ${REACTOS_BINARY_DIR}/boot/livecd.cmake "file(COPY \"${item}\" DESTINATION \"\${CD_DIR}/${_CD_DESTINATION}\")\n") + endforeach() + if(_CD_NAME_ON_CD) + get_filename_component(__file ${_CD_FILE} NAME) + #rename it in the cd tree + file(APPEND ${REACTOS_BINARY_DIR}/boot/livecd.cmake "file(RENAME \${CD_DIR}/${_CD_DESTINATION}/${__file} \${CD_DIR}/${_CD_DESTINATION}/${_CD_NAME_ON_CD})\n") + endif() + endif() #end livecd + +endfunction() diff --git a/base/applications/CMakeLists.txt b/base/applications/CMakeLists.txt index 7ff5a0bc294..0540d69e2e3 100644 --- a/base/applications/CMakeLists.txt +++ b/base/applications/CMakeLists.txt @@ -16,7 +16,7 @@ add_subdirectory(logoff) add_subdirectory(magnify) add_subdirectory(mmc) add_subdirectory(mplay32) -add_subdirectory(msconfig) +# add_subdirectory(msconfig) add_subdirectory(mscutils) add_subdirectory(mstsc) add_subdirectory(network) diff --git a/base/applications/cacls/CMakeLists.txt b/base/applications/cacls/CMakeLists.txt index 6ec1bc55b84..cfb03ed2377 100644 --- a/base/applications/cacls/CMakeLists.txt +++ b/base/applications/cacls/CMakeLists.txt @@ -12,4 +12,4 @@ add_pch(cacls ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE}) set_module_type(cacls win32cui) add_importlibs(cacls advapi32 user32 shell32 msvcrt kernel32) -add_cab_target(cacls 1) +add_cd_file(TARGET cacls DESTINATION reactos/system32 FOR all) diff --git a/base/applications/calc/CMakeLists.txt b/base/applications/calc/CMakeLists.txt index cfa99b5b52e..3e1372e0752 100644 --- a/base/applications/calc/CMakeLists.txt +++ b/base/applications/calc/CMakeLists.txt @@ -19,4 +19,4 @@ if(MSVC) add_importlibs(calc ntdll) endif() -add_cab_target(calc 1) +add_cd_file(TARGET calc DESTINATION reactos/system32 FOR all) diff --git a/base/applications/calc/convert.c b/base/applications/calc/convert.c index 26383080328..06c4523ac7c 100644 --- a/base/applications/calc/convert.c +++ b/base/applications/calc/convert.c @@ -50,7 +50,7 @@ typedef struct { static const conv_t conv_ANGLE[] = { DECLARE_CONV_UNIT(ANGLE, DEGREES, "$", "$") DECLARE_CONV_UNIT(ANGLE, GRADIANS, "$*0.9", "$/0.9") - DECLARE_CONV_UNIT(ANGLE, RADIANS, "$*180/P", "$*P/180") + DECLARE_CONV_UNIT(ANGLE, RADIANS, "$/P*180", "$*P/180") DECLARE_CONV_END }; @@ -355,7 +355,7 @@ static const conv_t conv_TIME[] = { */ static const conv_t conv_TEMPERATURE[] = { DECLARE_CONV_UNIT(TEMPERATURE, CELSIUS, "$+273.15", "$-273.15") - DECLARE_CONV_UNIT(TEMPERATURE, FAHRENHEIT, "($-459.67)*5/9", "$*9/5-459.67") + DECLARE_CONV_UNIT(TEMPERATURE, FAHRENHEIT, "($+459.67)*5/9", "$*9/5-459.67") DECLARE_CONV_UNIT(TEMPERATURE, KELVIN, "$", "$") DECLARE_CONV_UNIT(TEMPERATURE, RANKINE, "$*5/9", "$*9/5") DECLARE_CONV_END diff --git a/base/applications/calc/resource.rc b/base/applications/calc/resource.rc index 88209d392ad..fa35d39ce5b 100644 --- a/base/applications/calc/resource.rc +++ b/base/applications/calc/resource.rc @@ -52,7 +52,7 @@ IDB_BITMAP_ROS BITMAP DISCARDABLE "res/ROS_logo.bmp" #include "lang/es-ES.rc" #include "lang/fr-FR.rc" #include "lang/it-IT.rc" -//#include "lang/ja-JP.rc" FIXME: iconv issue +#include "lang/ja-JP.rc" #include "lang/ko-KR.rc" #include "lang/nl-NL.rc" #include "lang/no-NO.rc" diff --git a/base/applications/charmap/CMakeLists.txt b/base/applications/charmap/CMakeLists.txt index e2b52019263..a63a7da7343 100644 --- a/base/applications/charmap/CMakeLists.txt +++ b/base/applications/charmap/CMakeLists.txt @@ -19,4 +19,4 @@ set_module_type(charmap win32gui) add_importlibs(charmap user32 gdi32 comctl32 kernel32 msvcrt) -add_cab_target(charmap 1) +add_cd_file(TARGET charmap DESTINATION reactos/system32 FOR all) diff --git a/base/applications/charmap/charmap.c b/base/applications/charmap/charmap.c index 6f91d5b4ef9..5b4b4026dc5 100644 --- a/base/applications/charmap/charmap.c +++ b/base/applications/charmap/charmap.c @@ -11,7 +11,17 @@ #define ID_ABOUT 0x1 +typedef struct { + BOOL IsAdvancedView; +} SETTINGS; + HINSTANCE hInstance; +HWND hCharmapDlg; +HWND hAdvancedDlg; +HWND hStatusWnd; +HICON hSmIcon; +HICON hBgIcon; +SETTINGS Settings; /* Font-enumeration callback */ static @@ -226,76 +236,91 @@ AddCharToSelection(HWND hDlg, WCHAR ch) } +static +void +UpdateSettings(HWND hDlg) +{ + if (hDlg == hCharmapDlg) + { + Settings.IsAdvancedView = + SendDlgItemMessage(hDlg, IDC_CHECK_ADVANCED, BM_GETCHECK, 0, 0); + } + + if (hDlg == hAdvancedDlg) + { + } +} + +static +void +ChangeView(HWND hWnd) +{ + RECT rcCharmap; + RECT rcAdvanced; + RECT rcPanelExt; + RECT rcPanelInt; + RECT rcStatus; + UINT DeX, DeY; + UINT xPos, yPos; + UINT Width, Height; + UINT DeskTopWidth, DeskTopHeight; + + GetClientRect(hCharmapDlg, &rcCharmap); + GetClientRect(hAdvancedDlg, &rcAdvanced); + GetWindowRect(hWnd, &rcPanelExt); + GetClientRect(hWnd, &rcPanelInt); + GetClientRect(hStatusWnd, &rcStatus); + + DeskTopWidth = GetSystemMetrics(SM_CXFULLSCREEN); + DeskTopHeight = GetSystemMetrics(SM_CYFULLSCREEN); + + DeX = (rcPanelExt.right - rcPanelExt.left) - rcPanelInt.right; + DeY = (rcPanelExt.bottom - rcPanelExt.top) - rcPanelInt.bottom; + + MoveWindow(hCharmapDlg, 0, 0, rcCharmap.right, rcCharmap.bottom, FALSE); + MoveWindow(hAdvancedDlg, 0, rcCharmap.bottom, rcAdvanced.right, rcAdvanced.bottom, FALSE); + + ShowWindow(hAdvancedDlg, (Settings.IsAdvancedView) ? SW_SHOW : SW_HIDE); + + xPos = rcPanelExt.left; + yPos = rcPanelExt.top; + + Width = DeX + rcCharmap.right; + Height = DeY + rcCharmap.bottom + rcStatus.bottom; + + if (Settings.IsAdvancedView) + Height += rcAdvanced.bottom; + + if ((xPos + Width) > DeskTopWidth) + xPos += DeskTopWidth - (xPos + Width); + + if ((yPos + Height) > DeskTopHeight) + yPos += DeskTopHeight - (yPos + Height); + + MoveWindow(hWnd, + xPos, yPos, + Width, Height, + TRUE); +} + static INT_PTR CALLBACK -DlgProc(HWND hDlg, - UINT Message, - WPARAM wParam, - LPARAM lParam) +CharMapDlgProc(HWND hDlg, + UINT Message, + WPARAM wParam, + LPARAM lParam) { - static HICON hSmIcon; - static HICON hBgIcon; - LPWSTR lpAboutText = NULL; - switch(Message) { case WM_INITDIALOG: { - HMENU hSysMenu; DWORD evMask; - hSmIcon = LoadImageW(hInstance, - MAKEINTRESOURCEW(IDI_ICON), - IMAGE_ICON, - 16, - 16, - 0); - if (hSmIcon) - { - SendMessageW(hDlg, - WM_SETICON, - ICON_SMALL, - (LPARAM)hSmIcon); - } - - hBgIcon = LoadImageW(hInstance, - MAKEINTRESOURCEW(IDI_ICON), - IMAGE_ICON, - 32, - 32, - 0); - if (hBgIcon) - { - SendMessageW(hDlg, - WM_SETICON, - ICON_BIG, - (LPARAM)hBgIcon); - } - FillFontStyleComboList(GetDlgItem(hDlg, IDC_FONTCOMBO)); ChangeMapFont(hDlg); - hSysMenu = GetSystemMenu(hDlg, - FALSE); - if (hSysMenu != NULL) - { - if (LoadStringW(hInstance, - IDS_ABOUT, - lpAboutText, - 0)) - { - AppendMenuW(hSysMenu, - MF_SEPARATOR, - 0, - NULL); - AppendMenuW(hSysMenu, - MF_STRING, - ID_ABOUT, - lpAboutText); - } - } // Configure Richedi control for sending notification changes. evMask = SendDlgItemMessage(hDlg, IDC_TEXTBOX, EM_GETEVENTMASK, 0, 0); @@ -344,35 +369,33 @@ DlgProc(HWND hDlg, CopyCharacters(hDlg); break; - case IDOK: - if (hSmIcon) - DestroyIcon(hSmIcon); - if (hBgIcon) - DestroyIcon(hBgIcon); - EndDialog(hDlg, 0); + case IDC_CHECK_ADVANCED: + UpdateSettings(hDlg); + ChangeView(GetParent(hDlg)); break; } } break; - case WM_SYSCOMMAND: - { - switch(wParam) - { - case ID_ABOUT: - ShowAboutDlg(hDlg); - break; - } - } - break; - - case WM_CLOSE: - if (hSmIcon) - DestroyIcon(hSmIcon); - if (hBgIcon) - DestroyIcon(hBgIcon); - EndDialog(hDlg, 0); + default: break; + } + + return FALSE; +} + +static +INT_PTR +CALLBACK +AdvancedDlgProc(HWND hDlg, + UINT Message, + WPARAM wParam, + LPARAM lParam) +{ + switch(Message) + { + case WM_INITDIALOG: + return TRUE; default: return FALSE; @@ -381,6 +404,142 @@ DlgProc(HWND hDlg, return FALSE; } +static int +OnCreate(HWND hWnd, WPARAM wParam, LPARAM lParam) +{ + HMENU hSysMenu; + WCHAR lpAboutText[256]; + + hCharmapDlg = CreateDialog(hInstance, + MAKEINTRESOURCE(IDD_CHARMAP), + hWnd, + CharMapDlgProc); + + hAdvancedDlg = CreateDialog(hInstance, + MAKEINTRESOURCE(IDD_ADVANCED), + hWnd, + AdvancedDlgProc); + + hStatusWnd = CreateWindow(STATUSCLASSNAME, + NULL, + WS_CHILD | WS_VISIBLE, + 0, 0, 0, 0, + hWnd, + (HMENU)IDD_STATUSBAR, + hInstance, + NULL); + + // Set the status bar for multiple parts output + SendMessage(hStatusWnd, SB_SIMPLE, (WPARAM)FALSE, (LPARAM)0); + + ChangeView(hWnd); + + hSysMenu = GetSystemMenu(hWnd, FALSE); + + if (hSysMenu != NULL) + { + if (LoadStringW(hInstance, IDS_ABOUT, lpAboutText, SIZEOF(lpAboutText))) + { + AppendMenuW(hSysMenu, MF_SEPARATOR, 0, NULL); + AppendMenuW(hSysMenu, MF_STRING, ID_ABOUT, lpAboutText); + } + } + + return 0; +} + +static LRESULT CALLBACK +PanelWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch (msg) { + case WM_CREATE: + return OnCreate(hWnd, wParam, lParam); + + case WM_CLOSE: + DestroyWindow(hWnd); + return 0; + + case WM_SIZE: + SendMessage(hStatusWnd, msg, wParam, lParam); + break; + + case WM_DESTROY: + PostQuitMessage(0); + return 0; + + case WM_SYSCOMMAND: + switch(wParam) { + case ID_ABOUT: + ShowAboutDlg(hWnd); + break; + } + break; + + } + + return DefWindowProc(hWnd, msg, wParam, lParam); +} + +static HWND +InitInstance(HINSTANCE hInst) +{ + WCHAR szClass[] = L"CharMap"; + WCHAR szTitle[256]; + WNDCLASSEXW wc; + HWND hWnd; + + LoadStringW(hInst, IDS_TITLE, szTitle, SIZEOF(szTitle)); + + hSmIcon = LoadImage(hInstance, + MAKEINTRESOURCE(IDI_ICON), + IMAGE_ICON, + 16, + 16, + 0); + + hBgIcon = LoadImage(hInstance, + MAKEINTRESOURCE(IDI_ICON), + IMAGE_ICON, + 32, + 32, + 0); + + // Create workspace + ZeroMemory(&wc, sizeof(wc)); + + wc.cbSize = sizeof(wc); + wc.lpfnWndProc = PanelWndProc; + wc.hInstance = hInst; + wc.hIcon = hBgIcon; + wc.hCursor = LoadCursor(NULL, IDC_ARROW); + wc.hbrBackground = (HBRUSH)GetStockObject(NULL_BRUSH); + wc.lpszMenuName = NULL; + wc.lpszClassName = szClass; + wc.hIconSm = hSmIcon; + + RegisterClassExW(&wc); + + hWnd = CreateWindowW( + szClass, + szTitle, + WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX, + CW_USEDEFAULT, + CW_USEDEFAULT, + CW_USEDEFAULT, + CW_USEDEFAULT, + NULL, + NULL, + hInst, + NULL); + + if (hWnd != NULL) + { + ShowWindow(hWnd, SW_SHOW); + UpdateWindow(hWnd); + } + + return hWnd; +} INT WINAPI @@ -392,6 +551,7 @@ wWinMain(HINSTANCE hInst, INITCOMMONCONTROLSEX iccx; INT Ret = 1; HMODULE hRichEd20; + MSG Msg; hInstance = hInst; @@ -405,10 +565,19 @@ wWinMain(HINSTANCE hInst, if (hRichEd20 != NULL) { - Ret = DialogBoxW(hInstance, - MAKEINTRESOURCEW(IDD_CHARMAP), - NULL, - DlgProc) >= 0; + InitInstance(hInst); + + for (;;) + { + if (GetMessage(&Msg, NULL, 0, 0) <= 0) + { + Ret = Msg.wParam; + break; + } + + TranslateMessage(&Msg); + DispatchMessage(&Msg); + } FreeLibrary(hRichEd20); } diff --git a/base/applications/charmap/lang/bg-BG.rc b/base/applications/charmap/lang/bg-BG.rc index a4c203b4e9f..860ca4bd464 100644 --- a/base/applications/charmap/lang/bg-BG.rc +++ b/base/applications/charmap/lang/bg-BG.rc @@ -1,9 +1,8 @@ LANGUAGE LANG_BULGARIAN, SUBLANG_DEFAULT -IDD_CHARMAP DIALOGEX 6, 6, 293, 205 //233 -CAPTION "Çíàêîâ èçáîðíèê" +IDD_CHARMAP DIALOGEX 6, 6, 292, 224 FONT 8,"MS Shell Dlg",0,0 -STYLE DS_SHELLFONT | WS_BORDER | WS_VISIBLE | WS_SYSMENU | WS_MINIMIZEBOX +STYLE DS_SHELLFONT | WS_CHILD | WS_VISIBLE BEGIN LTEXT "Øðèôò :", IDC_STATIC, 6, 7, 24, 9 COMBOBOX IDC_FONTCOMBO, 36, 5, 210, 210, WS_CHILD | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_SORT | CBS_HASSTRINGS @@ -13,8 +12,22 @@ BEGIN CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "Èçáîð", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "Çàïîìíÿíå", IDC_COPY, 242, 186, 44, 13, WS_DISABLED - //AUTOCHECKBOX "Ðaçøèðåí èçãëåä", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP - //EDITTEXT IDC_DISPLAY, 8, 217, 278, 13, WS_VISIBLE | WS_TABSTOP | ES_READONLY + CONTROL "Advanced view",IDC_CHECK_ADVANCED,"Button", BS_AUTOCHECKBOX | WS_TABSTOP, 8, 208, 95, 10 +END + +IDD_ADVANCED DIALOGEX 0, 0, 292, 64 +STYLE DS_SHELLFONT | WS_CHILD +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Charset:",IDC_STATIC,8,8,48,8 + COMBOBOX IDC_COMBO_CHARSET,72,4,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Group by:",IDC_STATIC,8,28,50,8 + COMBOBOX IDC_COMBO_GROUPBY,72,24,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Search",IDC_BUTTON_SEARCH,200,44,50,14 + EDITTEXT IDC_EDIT_SEARCH,72,44,116,14,ES_AUTOHSCROLL + LTEXT "Search for:",IDC_STATIC,8,48,42,8 + LTEXT "Unicode:",IDC_STATIC,200,8,30,8 + EDITTEXT IDC_EDIT_UNICODE,236,4,28,12,ES_AUTOHSCROLL END IDD_ABOUTBOX DIALOGEX 22,16,210,182 @@ -32,4 +45,5 @@ STRINGTABLE DISCARDABLE BEGIN IDS_LICENSE "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\r\n\r\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." IDS_ABOUT "&Çà..." + IDS_TITLE "Character Map" END diff --git a/base/applications/charmap/lang/ca-ES.rc b/base/applications/charmap/lang/ca-ES.rc index 102e1ceb4f7..19a4157dc0c 100644 --- a/base/applications/charmap/lang/ca-ES.rc +++ b/base/applications/charmap/lang/ca-ES.rc @@ -1,9 +1,8 @@ LANGUAGE LANG_CATALAN, SUBLANG_DEFAULT -IDD_CHARMAP DIALOGEX 6, 6, 293, 205 //233 -CAPTION "Mapa de caràcters" +IDD_CHARMAP DIALOGEX 6, 6, 292, 224 FONT 8,"MS Shell Dlg",0,0 -STYLE DS_SHELLFONT | WS_BORDER | WS_VISIBLE | WS_SYSMENU | WS_MINIMIZEBOX +STYLE DS_SHELLFONT | WS_CHILD | WS_VISIBLE BEGIN LTEXT "Font :", IDC_STATIC, 6, 7, 24, 9 COMBOBOX IDC_FONTCOMBO, 36, 5, 210, 210, WS_CHILD | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_SORT | CBS_HASSTRINGS @@ -13,8 +12,22 @@ BEGIN CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "Selecciona", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "Copia", IDC_COPY, 242, 186, 44, 13, WS_DISABLED - //AUTOCHECKBOX "Vista avançada", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP - //EDITTEXT IDC_DISPLAY, 8, 217, 278, 13, WS_VISIBLE | WS_TABSTOP | ES_READONLY + CONTROL "Advanced view",IDC_CHECK_ADVANCED,"Button", BS_AUTOCHECKBOX | WS_TABSTOP, 8, 208, 95, 10 +END + +IDD_ADVANCED DIALOGEX 0, 0, 292, 64 +STYLE DS_SHELLFONT | WS_CHILD +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Charset:",IDC_STATIC,8,8,48,8 + COMBOBOX IDC_COMBO_CHARSET,72,4,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Group by:",IDC_STATIC,8,28,50,8 + COMBOBOX IDC_COMBO_GROUPBY,72,24,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Search",IDC_BUTTON_SEARCH,200,44,50,14 + EDITTEXT IDC_EDIT_SEARCH,72,44,116,14,ES_AUTOHSCROLL + LTEXT "Search for:",IDC_STATIC,8,48,42,8 + LTEXT "Unicode:",IDC_STATIC,200,8,30,8 + EDITTEXT IDC_EDIT_UNICODE,236,4,28,12,ES_AUTOHSCROLL END IDD_ABOUTBOX DIALOGEX 22,16,210,182 @@ -32,4 +45,5 @@ STRINGTABLE DISCARDABLE BEGIN IDS_LICENSE "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\r\n\r\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." IDS_ABOUT "&En quant a..." + IDS_TITLE "Character Map" END diff --git a/base/applications/charmap/lang/cs-CZ.rc b/base/applications/charmap/lang/cs-CZ.rc index d31df8eb885..ff50115013d 100644 --- a/base/applications/charmap/lang/cs-CZ.rc +++ b/base/applications/charmap/lang/cs-CZ.rc @@ -5,10 +5,9 @@ LANGUAGE LANG_CZECH, SUBLANG_DEFAULT -IDD_CHARMAP DIALOGEX 6, 6, 293, 205 //233 -CAPTION "Mapa znakù" +IDD_CHARMAP DIALOGEX 6, 6, 292, 224 FONT 8,"MS Shell Dlg",0,0 -STYLE DS_SHELLFONT | WS_BORDER | WS_VISIBLE | WS_SYSMENU | WS_MINIMIZEBOX +STYLE DS_SHELLFONT | WS_CHILD | WS_VISIBLE BEGIN LTEXT "Písmo:", IDC_STATIC, 6, 7, 24, 9 COMBOBOX IDC_FONTCOMBO, 36, 5, 210, 210, WS_CHILD | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_SORT | CBS_HASSTRINGS @@ -18,8 +17,22 @@ BEGIN CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "Oznaèit", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "Kopírovat", IDC_COPY, 242, 186, 44, 13, WS_DISABLED - //AUTOCHECKBOX "Pokroèilé zobrazení", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP - //EDITTEXT IDC_DISPLAY, 8, 217, 278, 13, WS_VISIBLE | WS_TABSTOP | ES_READONLY + CONTROL "Advanced view",IDC_CHECK_ADVANCED,"Button", BS_AUTOCHECKBOX | WS_TABSTOP, 8, 208, 95, 10 +END + +IDD_ADVANCED DIALOGEX 0, 0, 292, 64 +STYLE DS_SHELLFONT | WS_CHILD +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Charset:",IDC_STATIC,8,8,48,8 + COMBOBOX IDC_COMBO_CHARSET,72,4,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Group by:",IDC_STATIC,8,28,50,8 + COMBOBOX IDC_COMBO_GROUPBY,72,24,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Search",IDC_BUTTON_SEARCH,200,44,50,14 + EDITTEXT IDC_EDIT_SEARCH,72,44,116,14,ES_AUTOHSCROLL + LTEXT "Search for:",IDC_STATIC,8,48,42,8 + LTEXT "Unicode:",IDC_STATIC,200,8,30,8 + EDITTEXT IDC_EDIT_UNICODE,236,4,28,12,ES_AUTOHSCROLL END IDD_ABOUTBOX DIALOGEX 22,16,210,182 @@ -37,4 +50,5 @@ STRINGTABLE DISCARDABLE BEGIN IDS_LICENSE "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\r\n\r\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." IDS_ABOUT "&O programu..." + IDS_TITLE "Character Map" END diff --git a/base/applications/charmap/lang/de-DE.rc b/base/applications/charmap/lang/de-DE.rc index cecf8fe2621..d1feda73713 100644 --- a/base/applications/charmap/lang/de-DE.rc +++ b/base/applications/charmap/lang/de-DE.rc @@ -1,20 +1,33 @@ LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL -IDD_CHARMAP DIALOGEX 6, 6, 293, 205 //233 -CAPTION "Zeichentabelle" +IDD_CHARMAP DIALOGEX 6, 6, 292, 224 FONT 8,"MS Shell Dlg",0,0 -STYLE DS_SHELLFONT | WS_BORDER | WS_VISIBLE | WS_SYSMENU | WS_MINIMIZEBOX +STYLE DS_SHELLFONT | WS_CHILD | WS_VISIBLE BEGIN LTEXT "Schrift:", IDC_STATIC, 6, 7, 24, 9 COMBOBOX IDC_FONTCOMBO, 36, 5, 210, 210, WS_CHILD | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_SORT | CBS_HASSTRINGS - PUSHBUTTON "Hilfe", IDC_CMHELP, 249, 5, 35, 13 + PUSHBUTTON "&Hilfe", IDC_CMHELP, 249, 5, 35, 13 CONTROL "", IDC_FONTMAP, "FontMapWnd", WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL, 20, 22, 266, 156 - LTEXT "Zeichenauswahl:", IDC_STATIC, 6, 188, 66, 9 + LTEXT "Zeichenaus&wahl:", IDC_STATIC, 6, 188, 66, 9 CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 - DEFPUSHBUTTON "Auswählen", IDC_SELECT, 194, 186, 44, 13 - PUSHBUTTON "Kopieren", IDC_COPY, 242, 186, 44, 13, WS_DISABLED - //AUTOCHECKBOX "Erweiterte Ansicht", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP - //EDITTEXT IDC_DISPLAY, 8, 217, 278, 13, WS_VISIBLE | WS_TABSTOP | ES_READONLY + DEFPUSHBUTTON "&Auswählen", IDC_SELECT, 194, 186, 44, 13 + PUSHBUTTON "&Kopieren", IDC_COPY, 242, 186, 44, 13, WS_DISABLED + CONTROL "&Erweiterte Ansicht",IDC_CHECK_ADVANCED,"Button", BS_AUTOCHECKBOX | WS_TABSTOP, 8, 208, 95, 10 +END + +IDD_ADVANCED DIALOGEX 0, 0, 292, 64 +STYLE DS_SHELLFONT | WS_CHILD +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "&Zeichensatz:",IDC_STATIC,8,8,48,8 + COMBOBOX IDC_COMBO_CHARSET,72,4,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "&Gruppieren nach:",IDC_STATIC,8,28,58,8 + COMBOBOX IDC_COMBO_GROUPBY,72,24,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "&Suchen",IDC_BUTTON_SEARCH,200,44,50,14 + EDITTEXT IDC_EDIT_SEARCH,72,44,116,14,ES_AUTOHSCROLL + LTEXT "Su&chen nach:",IDC_STATIC,8,48,46,8 + LTEXT "&Unicode:",IDC_STATIC,200,8,30,8 + EDITTEXT IDC_EDIT_UNICODE,236,4,28,12,ES_AUTOHSCROLL END IDD_ABOUTBOX DIALOGEX 22,16,210,182 @@ -32,4 +45,5 @@ STRINGTABLE DISCARDABLE BEGIN IDS_LICENSE "Dieses Programm ist kostenlos; Sie können es frei verteilen mit od. ohne Änderungen unter der GNU Lesser General Public License wie es von der Free Software Foundation veröffentlicht wurde; entweder Version 2.1 der Lizenz, oder eine spätere Version (ihrer Wahl).\r\n\r\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." IDS_ABOUT "Ü&ber..." + IDS_TITLE "Zeichentabelle" END diff --git a/base/applications/charmap/lang/el-GR.rc b/base/applications/charmap/lang/el-GR.rc index 4ad6c2764cb..46fa157868a 100644 --- a/base/applications/charmap/lang/el-GR.rc +++ b/base/applications/charmap/lang/el-GR.rc @@ -1,9 +1,8 @@ LANGUAGE LANG_GREEK, SUBLANG_DEFAULT -IDD_CHARMAP DIALOGEX 6, 6, 293, 205 -STYLE DS_SHELLFONT | WS_MINIMIZEBOX | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Ðßíáêáò ÷áñáêôÞñùí" -FONT 8, "MS Shell Dlg" +IDD_CHARMAP DIALOGEX 6, 6, 292, 224 +FONT 8,"MS Shell Dlg",0,0 +STYLE DS_SHELLFONT | WS_CHILD | WS_VISIBLE BEGIN LTEXT "ÃñáììáôïóåéñÜ :",IDC_STATIC,6,7,60,9 COMBOBOX IDC_FONTCOMBO,65,5,181,210,CBS_DROPDOWNLIST | CBS_SORT | @@ -15,6 +14,22 @@ BEGIN CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "ÅðéëïãÞ",IDC_SELECT,194,186,44,13 PUSHBUTTON "ÁíôéãñáöÞ",IDC_COPY,242,186,44,13,WS_DISABLED + CONTROL "Advanced view",IDC_CHECK_ADVANCED,"Button", BS_AUTOCHECKBOX | WS_TABSTOP, 8, 208, 95, 10 +END + +IDD_ADVANCED DIALOGEX 0, 0, 292, 64 +STYLE DS_SHELLFONT | WS_CHILD +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Charset:",IDC_STATIC,8,8,48,8 + COMBOBOX IDC_COMBO_CHARSET,72,4,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Group by:",IDC_STATIC,8,28,50,8 + COMBOBOX IDC_COMBO_GROUPBY,72,24,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Search",IDC_BUTTON_SEARCH,200,44,50,14 + EDITTEXT IDC_EDIT_SEARCH,72,44,116,14,ES_AUTOHSCROLL + LTEXT "Search for:",IDC_STATIC,8,48,42,8 + LTEXT "Unicode:",IDC_STATIC,200,8,30,8 + EDITTEXT IDC_EDIT_UNICODE,236,4,28,12,ES_AUTOHSCROLL END IDD_ABOUTBOX DIALOGEX 22, 16, 210, 182 @@ -34,4 +49,5 @@ STRINGTABLE DISCARDABLE BEGIN IDS_LICENSE "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\r\n\r\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." IDS_ABOUT "&Ðëçñïöïñßåò..." + IDS_TITLE "Character Map" END diff --git a/base/applications/charmap/lang/en-US.rc b/base/applications/charmap/lang/en-US.rc index 9cf7dfc5347..6e9e5f51d5f 100644 --- a/base/applications/charmap/lang/en-US.rc +++ b/base/applications/charmap/lang/en-US.rc @@ -1,9 +1,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -IDD_CHARMAP DIALOGEX 6, 6, 293, 205 //233 -CAPTION "Character Map" +IDD_CHARMAP DIALOGEX 6, 6, 292, 224 FONT 8,"MS Shell Dlg",0,0 -STYLE DS_SHELLFONT | WS_BORDER | WS_VISIBLE | WS_SYSMENU | WS_MINIMIZEBOX +STYLE DS_SHELLFONT | WS_CHILD | WS_VISIBLE BEGIN LTEXT "Font:", IDC_STATIC, 6, 7, 24, 9 COMBOBOX IDC_FONTCOMBO, 36, 5, 210, 210, WS_CHILD | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_SORT | CBS_HASSTRINGS @@ -13,8 +12,22 @@ BEGIN CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "Select", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "Copy", IDC_COPY, 242, 186, 44, 13, WS_DISABLED - //AUTOCHECKBOX "Advanced view", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP - //EDITTEXT IDC_DISPLAY, 8, 217, 278, 13, WS_VISIBLE | WS_TABSTOP | ES_READONLY + CONTROL "Advanced view",IDC_CHECK_ADVANCED,"Button", BS_AUTOCHECKBOX | WS_TABSTOP, 8, 208, 95, 10 +END + +IDD_ADVANCED DIALOGEX 0, 0, 292, 64 +STYLE DS_SHELLFONT | WS_CHILD +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Charset:",IDC_STATIC,8,8,48,8 + COMBOBOX IDC_COMBO_CHARSET,72,4,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Group by:",IDC_STATIC,8,28,50,8 + COMBOBOX IDC_COMBO_GROUPBY,72,24,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Search",IDC_BUTTON_SEARCH,200,44,50,14 + EDITTEXT IDC_EDIT_SEARCH,72,44,116,14,ES_AUTOHSCROLL + LTEXT "Search for:",IDC_STATIC,8,48,42,8 + LTEXT "Unicode:",IDC_STATIC,200,8,30,8 + EDITTEXT IDC_EDIT_UNICODE,236,4,28,12,ES_AUTOHSCROLL END IDD_ABOUTBOX DIALOGEX 22,16,210,182 @@ -32,4 +45,5 @@ STRINGTABLE DISCARDABLE BEGIN IDS_LICENSE "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\r\n\r\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." IDS_ABOUT "A&bout..." + IDS_TITLE "Character Map" END diff --git a/base/applications/charmap/lang/es-ES.rc b/base/applications/charmap/lang/es-ES.rc index ada78f80c69..a15d8b3fe70 100644 --- a/base/applications/charmap/lang/es-ES.rc +++ b/base/applications/charmap/lang/es-ES.rc @@ -1,9 +1,8 @@ LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL -IDD_CHARMAP DIALOGEX 6, 6, 293, 205 //233 -CAPTION "Mapa de Caracteres" +IDD_CHARMAP DIALOGEX 6, 6, 292, 224 FONT 8,"MS Shell Dlg",0,0 -STYLE DS_SHELLFONT | WS_BORDER | WS_VISIBLE | WS_SYSMENU | WS_MINIMIZEBOX +STYLE DS_SHELLFONT | WS_CHILD | WS_VISIBLE BEGIN LTEXT "Fuente :", IDC_STATIC, 6, 7, 24, 9 COMBOBOX IDC_FONTCOMBO, 36, 5, 210, 210, WS_CHILD | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_SORT | CBS_HASSTRINGS @@ -13,8 +12,22 @@ BEGIN CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "Seleccionar", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "Copiar", IDC_COPY, 242, 186, 44, 13, WS_DISABLED - //AUTOCHECKBOX "Vista Avanzada", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP - //EDITTEXT IDC_DISPLAY, 8, 217, 278, 13, WS_VISIBLE | WS_TABSTOP | ES_READONLY + CONTROL "Advanced view",IDC_CHECK_ADVANCED,"Button", BS_AUTOCHECKBOX | WS_TABSTOP, 8, 208, 95, 10 +END + +IDD_ADVANCED DIALOGEX 0, 0, 292, 64 +STYLE DS_SHELLFONT | WS_CHILD +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Charset:",IDC_STATIC,8,8,48,8 + COMBOBOX IDC_COMBO_CHARSET,72,4,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Group by:",IDC_STATIC,8,28,50,8 + COMBOBOX IDC_COMBO_GROUPBY,72,24,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Search",IDC_BUTTON_SEARCH,200,44,50,14 + EDITTEXT IDC_EDIT_SEARCH,72,44,116,14,ES_AUTOHSCROLL + LTEXT "Search for:",IDC_STATIC,8,48,42,8 + LTEXT "Unicode:",IDC_STATIC,200,8,30,8 + EDITTEXT IDC_EDIT_UNICODE,236,4,28,12,ES_AUTOHSCROLL END IDD_ABOUTBOX DIALOGEX 22,16,210,182 @@ -32,4 +45,5 @@ STRINGTABLE DISCARDABLE BEGIN IDS_LICENSE "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\r\n\r\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." IDS_ABOUT "&Acerca de ..." + IDS_TITLE "Character Map" END diff --git a/base/applications/charmap/lang/fr-FR.rc b/base/applications/charmap/lang/fr-FR.rc index 9a2a206726e..910b6df3746 100644 --- a/base/applications/charmap/lang/fr-FR.rc +++ b/base/applications/charmap/lang/fr-FR.rc @@ -1,9 +1,8 @@ LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL -IDD_CHARMAP DIALOGEX 6, 6, 293, 205 //233 -CAPTION "Table des Caractères" +IDD_CHARMAP DIALOGEX 6, 6, 292, 224 FONT 8,"MS Shell Dlg",0,0 -STYLE DS_SHELLFONT | WS_BORDER | WS_VISIBLE | WS_SYSMENU | WS_MINIMIZEBOX +STYLE DS_SHELLFONT | WS_CHILD | WS_VISIBLE BEGIN LTEXT "Police :", IDC_STATIC, 6, 7, 24, 9 COMBOBOX IDC_FONTCOMBO, 36, 5, 210, 210, WS_CHILD | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_SORT | CBS_HASSTRINGS @@ -13,8 +12,22 @@ BEGIN CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "Sélectionner", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "Copier", IDC_COPY, 242, 186, 44, 13, WS_DISABLED - //AUTOCHECKBOX "Vue avancée", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP - //EDITTEXT IDC_DISPLAY, 8, 217, 278, 13, WS_VISIBLE | WS_TABSTOP | ES_READONLY + CONTROL "Advanced view",IDC_CHECK_ADVANCED,"Button", BS_AUTOCHECKBOX | WS_TABSTOP, 8, 208, 95, 10 +END + +IDD_ADVANCED DIALOGEX 0, 0, 292, 64 +STYLE DS_SHELLFONT | WS_CHILD +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Charset:",IDC_STATIC,8,8,48,8 + COMBOBOX IDC_COMBO_CHARSET,72,4,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Group by:",IDC_STATIC,8,28,50,8 + COMBOBOX IDC_COMBO_GROUPBY,72,24,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Search",IDC_BUTTON_SEARCH,200,44,50,14 + EDITTEXT IDC_EDIT_SEARCH,72,44,116,14,ES_AUTOHSCROLL + LTEXT "Search for:",IDC_STATIC,8,48,42,8 + LTEXT "Unicode:",IDC_STATIC,200,8,30,8 + EDITTEXT IDC_EDIT_UNICODE,236,4,28,12,ES_AUTOHSCROLL END IDD_ABOUTBOX DIALOGEX 22,16,210,182 @@ -32,4 +45,5 @@ STRINGTABLE DISCARDABLE BEGIN IDS_LICENSE "Ce programme est un logiciel libre ; vous pouvez le redistribuer et/ou le modifier tout en respectant les termes de la ""GNU General Public License"" publiée par la Free Software Foundation; dans sa version 2 (ou selon votre préférence) toute version ultérieure.\r\n\r\nCe programme est distribué dans l'espoir qu'il sera utile, cependant SANS GARANTIE D'AUCUNE SORTE ; sans même une garantie implicite de COMMERCIABILITÉ ou DE CONFORMITÉ À UNE UTILISATION PARTICULIÈRE. \r\n\r\nVoir la Licence Publique Générale GNU pour plus de détails. Vous devriez avoir reçu un exemplaire de la Licence Publique Générale GNU avec ce programme ; si ce n'est pas le cas, écrivez à la Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." IDS_ABOUT "À propos..." + IDS_TITLE "Character Map" END diff --git a/base/applications/charmap/lang/id-ID.rc b/base/applications/charmap/lang/id-ID.rc index 790bf651bef..a2c2cae4b96 100644 --- a/base/applications/charmap/lang/id-ID.rc +++ b/base/applications/charmap/lang/id-ID.rc @@ -1,9 +1,8 @@ LANGUAGE LANG_INDONESIAN, SUBLANG_DEFAULT -IDD_CHARMAP DIALOGEX 6, 6, 293, 205 //233 -CAPTION "Peta Karakter" +IDD_CHARMAP DIALOGEX 6, 6, 292, 224 FONT 8,"MS Shell Dlg",0,0 -STYLE DS_SHELLFONT | WS_BORDER | WS_VISIBLE | WS_SYSMENU | WS_MINIMIZEBOX +STYLE DS_SHELLFONT | WS_CHILD | WS_VISIBLE BEGIN LTEXT "Font :", IDC_STATIC, 6, 7, 24, 9 COMBOBOX IDC_FONTCOMBO, 36, 5, 210, 210, WS_CHILD | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_SORT | CBS_HASSTRINGS @@ -13,8 +12,22 @@ BEGIN CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "Pilih", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "Copy", IDC_COPY, 242, 186, 44, 13, WS_DISABLED - //AUTOCHECKBOX "Advanced view", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP - //EDITTEXT IDC_DISPLAY, 8, 217, 278, 13, WS_VISIBLE | WS_TABSTOP | ES_READONLY + CONTROL "Advanced view",IDC_CHECK_ADVANCED,"Button", BS_AUTOCHECKBOX | WS_TABSTOP, 8, 208, 95, 10 +END + +IDD_ADVANCED DIALOGEX 0, 0, 292, 64 +STYLE DS_SHELLFONT | WS_CHILD +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Charset:",IDC_STATIC,8,8,48,8 + COMBOBOX IDC_COMBO_CHARSET,72,4,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Group by:",IDC_STATIC,8,28,50,8 + COMBOBOX IDC_COMBO_GROUPBY,72,24,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Search",IDC_BUTTON_SEARCH,200,44,50,14 + EDITTEXT IDC_EDIT_SEARCH,72,44,116,14,ES_AUTOHSCROLL + LTEXT "Search for:",IDC_STATIC,8,48,42,8 + LTEXT "Unicode:",IDC_STATIC,200,8,30,8 + EDITTEXT IDC_EDIT_UNICODE,236,4,28,12,ES_AUTOHSCROLL END IDD_ABOUTBOX DIALOGEX 22,16,210,182 @@ -32,4 +45,5 @@ STRINGTABLE DISCARDABLE BEGIN IDS_LICENSE "Program ini adalah software bebas; anda dapat mendistribusikan dan/atau mengubahnya di bawah term GNU General Public License seperti dipublikasikan oleh Free Software Foundation; baik Lisensi versi 2, atau (menurut opini anda) setiap versi berikutnya.\r\n\r\nProgram ini didistribusikan dengan harapan ia akan berguna, tetapi TANPA JAMINAN APAPUN; bahkan tanpa jaminan berarti dari MERCANTABILITAS atau KECUKUPAN UNTUK KEPERLUAN TERTENTU. Lihat GNU General Public License untuk lebih jelasnya.\r\n\r\nAnda seharusnya menerima duplikat GNU General Public License bersamaan dengan program ini; jika tidak, tulis ke Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." IDS_ABOUT "Te&ntang..." + IDS_TITLE "Character Map" END diff --git a/base/applications/charmap/lang/it-IT.rc b/base/applications/charmap/lang/it-IT.rc index f7f44bb2453..e4a66dea8f1 100644 --- a/base/applications/charmap/lang/it-IT.rc +++ b/base/applications/charmap/lang/it-IT.rc @@ -1,11 +1,10 @@ LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL -IDD_CHARMAP DIALOGEX 6, 6, 293, 205 //233 -CAPTION "Character Map" +IDD_CHARMAP DIALOGEX 6, 6, 292, 224 FONT 8,"MS Shell Dlg",0,0 -STYLE DS_SHELLFONT | WS_BORDER | WS_VISIBLE | WS_SYSMENU | WS_MINIMIZEBOX +STYLE DS_SHELLFONT | WS_CHILD | WS_VISIBLE BEGIN - LTEXT "Font :", IDC_STATIC, 6, 7, 24, 9 + LTEXT "Font:", IDC_STATIC, 6, 7, 24, 9 COMBOBOX IDC_FONTCOMBO, 36, 5, 210, 210, WS_CHILD | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_SORT | CBS_HASSTRINGS PUSHBUTTON "Aiuto", IDC_CMHELP, 249, 5, 35, 13 CONTROL "", IDC_FONTMAP, "FontMapWnd", WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL, 20, 22, 266, 156 @@ -13,8 +12,22 @@ BEGIN CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "Selezionare", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "Copiare", IDC_COPY, 242, 186, 44, 13, WS_DISABLED - //AUTOCHECKBOX "Visualizzazione avanzata", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP - //EDITTEXT IDC_DISPLAY, 8, 217, 278, 13, WS_VISIBLE | WS_TABSTOP | ES_READONLY + CONTROL "Visualizzazione avanzata",IDC_CHECK_ADVANCED,"Button", BS_AUTOCHECKBOX | WS_TABSTOP, 8, 208, 95, 10 +END + +IDD_ADVANCED DIALOGEX 0, 0, 292, 64 +STYLE DS_SHELLFONT | WS_CHILD +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Set di caratteri:",IDC_STATIC,8,8,48,8 + COMBOBOX IDC_COMBO_CHARSET,72,4,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Raggruppa per:",IDC_STATIC,8,28,50,8 + COMBOBOX IDC_COMBO_GROUPBY,72,24,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Ce&rca",IDC_BUTTON_SEARCH,200,44,50,14 + EDITTEXT IDC_EDIT_SEARCH,72,44,116,14,ES_AUTOHSCROLL + LTEXT "C&erca:",IDC_STATIC,8,48,22,8 + LTEXT "Unicode:",IDC_STATIC,200,8,30,8 + EDITTEXT IDC_EDIT_UNICODE,236,4,28,12,ES_AUTOHSCROLL END IDD_ABOUTBOX DIALOGEX 22,16,210,182 @@ -22,7 +35,7 @@ CAPTION "Informazioni su Character Map" FONT 8,"MS Shell Dlg",0,0 STYLE DS_SHELLFONT | WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME BEGIN - LTEXT "Character Map v0.1\nCopyright (C) 2007 Ged Murphy (gedmurphy@reactos.org)", IDC_STATIC, 48, 7, 150, 36 + LTEXT "Mappa caratteri v0.1\nCopyright (C) 2007 Ged Murphy (gedmurphy@reactos.org)", IDC_STATIC, 48, 7, 150, 36 PUSHBUTTON "Chiudi", IDOK, 75, 162, 44, 15 ICON IDI_ICON, IDC_STATIC, 10, 10, 7, 30 EDITTEXT IDC_LICENSE_EDIT, 8, 44, 194, 107, WS_VISIBLE | WS_VSCROLL | WS_TABSTOP | ES_READONLY | ES_MULTILINE @@ -32,4 +45,5 @@ STRINGTABLE DISCARDABLE BEGIN IDS_LICENSE, "Questo programma è software libero; può redistribuirlo e/o modificarlo sotto\ni termini della licenza pubblica GNU come pubblicata dalla Free Software Foundation; sia la versione 2 sia una versione successiva (a sua scelta).\r\n\r\nQuesto programma è distribuito\nnella speranza che sia utile, ma SENZA ALCUNA GARANZIA; senza neanche la garanzia implicita\ndi NEGOZIABILITA' o APPLICABILITA' per un particolare scopo. Si veda la licenza generale pubblica GNU per maggiori dettagli.\r\n\r\nDovrebbe aver ricevuto una copia assieme a questo programma; se così non fosse, scriva alla Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." IDS_ABOUT "&Informazioni su..." + IDS_TITLE "Mappa caratteri" END diff --git a/base/applications/charmap/lang/ja-JP.rc b/base/applications/charmap/lang/ja-JP.rc index e5e426d2674..b97f0a48f5c 100644 --- a/base/applications/charmap/lang/ja-JP.rc +++ b/base/applications/charmap/lang/ja-JP.rc @@ -1,9 +1,8 @@ LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT -IDD_CHARMAP DIALOGEX 6, 6, 293, 205 //233 -CAPTION "•¶ŽšƒR[ƒh•\\" +IDD_CHARMAP DIALOGEX 6, 6, 292, 224 FONT 9,"MS UI Gothic",0,0 -STYLE DS_SHELLFONT | WS_BORDER | WS_VISIBLE | WS_SYSMENU | WS_MINIMIZEBOX +STYLE DS_SHELLFONT | WS_CHILD | WS_VISIBLE BEGIN LTEXT "ƒtƒHƒ“ƒg:", IDC_STATIC, 6, 7, 24, 9 COMBOBOX IDC_FONTCOMBO, 36, 5, 210, 210, WS_CHILD | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_SORT | CBS_HASSTRINGS @@ -13,8 +12,22 @@ BEGIN CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "‘I‘ð", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "ƒRƒs[", IDC_COPY, 242, 186, 44, 13, WS_DISABLED - //AUTOCHECKBOX "Úו\\Ž¦", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP - //EDITTEXT IDC_DISPLAY, 8, 217, 278, 13, WS_VISIBLE | WS_TABSTOP | ES_READONLY + CONTROL "Advanced view",IDC_CHECK_ADVANCED,"Button", BS_AUTOCHECKBOX | WS_TABSTOP, 8, 208, 95, 10 +END + +IDD_ADVANCED DIALOGEX 0, 0, 292, 64 +STYLE DS_SHELLFONT | WS_CHILD +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Charset:",IDC_STATIC,8,8,48,8 + COMBOBOX IDC_COMBO_CHARSET,72,4,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Group by:",IDC_STATIC,8,28,50,8 + COMBOBOX IDC_COMBO_GROUPBY,72,24,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Search",IDC_BUTTON_SEARCH,200,44,50,14 + EDITTEXT IDC_EDIT_SEARCH,72,44,116,14,ES_AUTOHSCROLL + LTEXT "Search for:",IDC_STATIC,8,48,42,8 + LTEXT "Unicode:",IDC_STATIC,200,8,30,8 + EDITTEXT IDC_EDIT_UNICODE,236,4,28,12,ES_AUTOHSCROLL END IDD_ABOUTBOX DIALOGEX 22,16,210,182 @@ -32,4 +45,5 @@ STRINGTABLE DISCARDABLE BEGIN IDS_LICENSE "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\r\n\r\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." IDS_ABOUT "ƒo[ƒWƒ‡ƒ“î•ñ(&B)..." + IDS_TITLE "Character Map" END diff --git a/base/applications/charmap/lang/ko-KR.rc b/base/applications/charmap/lang/ko-KR.rc index b700764d09a..a99a7f7ebc3 100644 --- a/base/applications/charmap/lang/ko-KR.rc +++ b/base/applications/charmap/lang/ko-KR.rc @@ -3,10 +3,9 @@ */ LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT -IDD_CHARMAP DIALOGEX 6, 6, 293, 205 //233 -CAPTION "¹®ÀÚÇ¥" +IDD_CHARMAP DIALOGEX 6, 6, 292, 224 FONT 8,"MS Shell Dlg",0,0 -STYLE DS_SHELLFONT | WS_BORDER | WS_VISIBLE | WS_SYSMENU | WS_MINIMIZEBOX +STYLE DS_SHELLFONT | WS_CHILD | WS_VISIBLE BEGIN LTEXT "±Û²Ã:", IDC_STATIC, 6, 7, 24, 9 COMBOBOX IDC_FONTCOMBO, 36, 5, 210, 210, WS_CHILD | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_SORT | CBS_HASSTRINGS @@ -16,8 +15,22 @@ BEGIN CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "¼±ÅÃ", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "º¹»ç", IDC_COPY, 242, 186, 44, 13, WS_DISABLED - //AUTOCHECKBOX "È®Àå ¸ðµå", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP - //EDITTEXT IDC_DISPLAY, 8, 217, 278, 13, WS_VISIBLE | WS_TABSTOP | ES_READONLY + CONTROL "Advanced view",IDC_CHECK_ADVANCED,"Button", BS_AUTOCHECKBOX | WS_TABSTOP, 8, 208, 95, 10 +END + +IDD_ADVANCED DIALOGEX 0, 0, 292, 64 +STYLE DS_SHELLFONT | WS_CHILD +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Charset:",IDC_STATIC,8,8,48,8 + COMBOBOX IDC_COMBO_CHARSET,72,4,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Group by:",IDC_STATIC,8,28,50,8 + COMBOBOX IDC_COMBO_GROUPBY,72,24,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Search",IDC_BUTTON_SEARCH,200,44,50,14 + EDITTEXT IDC_EDIT_SEARCH,72,44,116,14,ES_AUTOHSCROLL + LTEXT "Search for:",IDC_STATIC,8,48,42,8 + LTEXT "Unicode:",IDC_STATIC,200,8,30,8 + EDITTEXT IDC_EDIT_UNICODE,236,4,28,12,ES_AUTOHSCROLL END IDD_ABOUTBOX DIALOGEX 22,16,210,182 @@ -35,4 +48,5 @@ STRINGTABLE DISCARDABLE BEGIN IDS_LICENSE "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\r\n\r\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." IDS_ABOUT "Á¤º¸(&A)" + IDS_TITLE "Character Map" END diff --git a/base/applications/charmap/lang/lt-LT.rc b/base/applications/charmap/lang/lt-LT.rc index 9fec37413ed..67ba5fb1132 100644 --- a/base/applications/charmap/lang/lt-LT.rc +++ b/base/applications/charmap/lang/lt-LT.rc @@ -9,10 +9,9 @@ LANGUAGE LANG_LITHUANIAN, SUBLANG_DEFAULT -IDD_CHARMAP DIALOGEX 6, 6, 293, 205 //233 -CAPTION "Simboliø lentelë" +IDD_CHARMAP DIALOGEX 6, 6, 292, 224 FONT 8,"MS Shell Dlg",0,0 -STYLE DS_SHELLFONT | WS_BORDER | WS_VISIBLE | WS_SYSMENU | WS_MINIMIZEBOX +STYLE DS_SHELLFONT | WS_CHILD | WS_VISIBLE BEGIN LTEXT "Ðriftas:", IDC_STATIC, 6, 7, 24, 9 COMBOBOX IDC_FONTCOMBO, 36, 5, 210, 210, WS_CHILD | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_SORT | CBS_HASSTRINGS @@ -22,8 +21,22 @@ BEGIN CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "Parinkti", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "Kopijuoti", IDC_COPY, 242, 186, 44, 13, WS_DISABLED - //AUTOCHECKBOX "Advanced view", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP - //EDITTEXT IDC_DISPLAY, 8, 217, 278, 13, WS_VISIBLE | WS_TABSTOP | ES_READONLY + CONTROL "Advanced view",IDC_CHECK_ADVANCED,"Button", BS_AUTOCHECKBOX | WS_TABSTOP, 8, 208, 95, 10 +END + +IDD_ADVANCED DIALOGEX 0, 0, 292, 64 +STYLE DS_SHELLFONT | WS_CHILD +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Charset:",IDC_STATIC,8,8,48,8 + COMBOBOX IDC_COMBO_CHARSET,72,4,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Group by:",IDC_STATIC,8,28,50,8 + COMBOBOX IDC_COMBO_GROUPBY,72,24,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Search",IDC_BUTTON_SEARCH,200,44,50,14 + EDITTEXT IDC_EDIT_SEARCH,72,44,116,14,ES_AUTOHSCROLL + LTEXT "Search for:",IDC_STATIC,8,48,42,8 + LTEXT "Unicode:",IDC_STATIC,200,8,30,8 + EDITTEXT IDC_EDIT_UNICODE,236,4,28,12,ES_AUTOHSCROLL END IDD_ABOUTBOX DIALOGEX 22,16,210,182 @@ -41,4 +54,5 @@ STRINGTABLE DISCARDABLE BEGIN IDS_LICENSE "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\r\n\r\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." IDS_ABOUT "&Apie..." + IDS_TITLE "Character Map" END diff --git a/base/applications/charmap/lang/nl-NL.rc b/base/applications/charmap/lang/nl-NL.rc index 6389f34f2d0..3e8673c1be6 100644 --- a/base/applications/charmap/lang/nl-NL.rc +++ b/base/applications/charmap/lang/nl-NL.rc @@ -1,9 +1,8 @@ LANGUAGE LANG_DUTCH, SUBLANG_NEUTRAL -IDD_CHARMAP DIALOGEX 6, 6, 293, 205 //233 -CAPTION "Speciale tekens" +IDD_CHARMAP DIALOGEX 6, 6, 292, 224 FONT 8,"MS Shell Dlg",0,0 -STYLE DS_SHELLFONT | WS_BORDER | WS_VISIBLE | WS_SYSMENU | WS_MINIMIZEBOX +STYLE DS_SHELLFONT | WS_CHILD | WS_VISIBLE BEGIN LTEXT "Lettertype:", IDC_STATIC, 6, 7, 24, 9 COMBOBOX IDC_FONTCOMBO, 36, 5, 210, 210, WS_CHILD | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_SORT | CBS_HASSTRINGS @@ -13,8 +12,22 @@ BEGIN CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "Selecteren", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "Kopiëren", IDC_COPY, 242, 186, 44, 13, WS_DISABLED - //AUTOCHECKBOX "Geavanceerde weergave", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP - //EDITTEXT IDC_DISPLAY, 8, 217, 278, 13, WS_VISIBLE | WS_TABSTOP | ES_READONLY + CONTROL "Advanced view",IDC_CHECK_ADVANCED,"Button", BS_AUTOCHECKBOX | WS_TABSTOP, 8, 208, 95, 10 +END + +IDD_ADVANCED DIALOGEX 0, 0, 292, 64 +STYLE DS_SHELLFONT | WS_CHILD +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Charset:",IDC_STATIC,8,8,48,8 + COMBOBOX IDC_COMBO_CHARSET,72,4,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Group by:",IDC_STATIC,8,28,50,8 + COMBOBOX IDC_COMBO_GROUPBY,72,24,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Search",IDC_BUTTON_SEARCH,200,44,50,14 + EDITTEXT IDC_EDIT_SEARCH,72,44,116,14,ES_AUTOHSCROLL + LTEXT "Search for:",IDC_STATIC,8,48,42,8 + LTEXT "Unicode:",IDC_STATIC,200,8,30,8 + EDITTEXT IDC_EDIT_UNICODE,236,4,28,12,ES_AUTOHSCROLL END IDD_ABOUTBOX DIALOGEX 22,16,210,182 @@ -32,4 +45,5 @@ STRINGTABLE DISCARDABLE BEGIN IDS_LICENSE "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\r\n\r\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." IDS_ABOUT "Over..." + IDS_TITLE "Character Map" END diff --git a/base/applications/charmap/lang/no-NO.rc b/base/applications/charmap/lang/no-NO.rc index 8fd7c204e0b..67ff7c9c102 100644 --- a/base/applications/charmap/lang/no-NO.rc +++ b/base/applications/charmap/lang/no-NO.rc @@ -1,9 +1,8 @@ LANGUAGE LANG_NORWEGIAN, SUBLANG_NEUTRAL -IDD_CHARMAP DIALOGEX 6, 6, 293, 205 //233 -CAPTION "Tegnkart" +IDD_CHARMAP DIALOGEX 6, 6, 292, 224 FONT 8,"MS Shell Dlg",0,0 -STYLE DS_SHELLFONT | WS_BORDER | WS_VISIBLE | WS_SYSMENU | WS_MINIMIZEBOX +STYLE DS_SHELLFONT | WS_CHILD | WS_VISIBLE BEGIN LTEXT "Skrift:", IDC_STATIC, 6, 7, 24, 9 COMBOBOX IDC_FONTCOMBO, 36, 5, 210, 210, WS_CHILD | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_SORT | CBS_HASSTRINGS @@ -13,8 +12,22 @@ BEGIN CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "Velg", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "Kopier", IDC_COPY, 242, 186, 44, 13, WS_DISABLED - //AUTOCHECKBOX "Avansert visning", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP - //EDITTEXT IDC_DISPLAY, 8, 217, 278, 13, WS_VISIBLE | WS_TABSTOP | ES_READONLY + CONTROL "Advanced view",IDC_CHECK_ADVANCED,"Button", BS_AUTOCHECKBOX | WS_TABSTOP, 8, 208, 95, 10 +END + +IDD_ADVANCED DIALOGEX 0, 0, 292, 64 +STYLE DS_SHELLFONT | WS_CHILD +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Charset:",IDC_STATIC,8,8,48,8 + COMBOBOX IDC_COMBO_CHARSET,72,4,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Group by:",IDC_STATIC,8,28,50,8 + COMBOBOX IDC_COMBO_GROUPBY,72,24,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Search",IDC_BUTTON_SEARCH,200,44,50,14 + EDITTEXT IDC_EDIT_SEARCH,72,44,116,14,ES_AUTOHSCROLL + LTEXT "Search for:",IDC_STATIC,8,48,42,8 + LTEXT "Unicode:",IDC_STATIC,200,8,30,8 + EDITTEXT IDC_EDIT_UNICODE,236,4,28,12,ES_AUTOHSCROLL END IDD_ABOUTBOX DIALOGEX 22,16,210,182 @@ -32,4 +45,5 @@ STRINGTABLE DISCARDABLE BEGIN IDS_LICENSE "Dette programmet er gratis programvare; du kan distribuere det og/eller endre det under betingelsene av GNU General Public License som er utgitt av Free Software Foundation; version 2 av lisensen, eller (etter din mening) alle senere versjoner.\r\n\r\nDette programmet er utgitt i håp for at det skal kunne brukes, men DET ER INGEN GARANTIER; uten heller forutsatt garantier av SALGBARHET eller SIKKETHET FOR EN ENKELTHET FORMÅL. Se på GNU General Public Lisensen for mere detaljer.\r\n\r\nDu skal ha motatt en kopi av GNU General Public Lisensen sammen med denne programmet; hvis du ikke har motatt det, skriv til Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." IDS_ABOUT "O&m..." + IDS_TITLE "Character Map" END diff --git a/base/applications/charmap/lang/pl-PL.rc b/base/applications/charmap/lang/pl-PL.rc index 75dce3c7064..ab354758d78 100644 --- a/base/applications/charmap/lang/pl-PL.rc +++ b/base/applications/charmap/lang/pl-PL.rc @@ -2,14 +2,14 @@ * translated by xrogers * xxrogers@users.sourceforge.net * https://sourceforge.net/projects/reactospl +* updated by Olaf Siejka (May, 2011) */ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT -IDD_CHARMAP DIALOGEX 6, 6, 293, 205 //233 -CAPTION "Tablica znaków" +IDD_CHARMAP DIALOGEX 6, 6, 292, 224 FONT 8,"MS Shell Dlg",0,0 -STYLE DS_SHELLFONT | WS_BORDER | WS_VISIBLE | WS_SYSMENU | WS_MINIMIZEBOX +STYLE DS_SHELLFONT | WS_CHILD | WS_VISIBLE BEGIN LTEXT "Czci&onka:", IDC_STATIC, 6, 7, 24, 9 COMBOBOX IDC_FONTCOMBO, 36, 5, 210, 210, WS_CHILD | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_SORT | CBS_HASSTRINGS @@ -19,8 +19,22 @@ BEGIN CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "Wy&bierz", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "&Kopiuj", IDC_COPY, 242, 186, 44, 13, WS_DISABLED - //AUTOCHECKBOX "Widok z&aawansowany", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP - //EDITTEXT IDC_DISPLAY, 8, 217, 278, 13, WS_VISIBLE | WS_TABSTOP | ES_READONLY + CONTROL "Widok zaawansowany",IDC_CHECK_ADVANCED,"Button", BS_AUTOCHECKBOX | WS_TABSTOP, 8, 208, 95, 10 +END + +IDD_ADVANCED DIALOGEX 0, 0, 292, 64 +STYLE DS_SHELLFONT | WS_CHILD +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Zestaw znaków:",IDC_STATIC,8,8,48,8 + COMBOBOX IDC_COMBO_CHARSET,72,4,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Grupowanie wed³ug:",IDC_STATIC,8,28,50,8 + COMBOBOX IDC_COMBO_GROUPBY,72,24,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Szukaj",IDC_BUTTON_SEARCH,200,44,50,14 + EDITTEXT IDC_EDIT_SEARCH,72,44,116,14,ES_AUTOHSCROLL + LTEXT "Wyszukaj:",IDC_STATIC,8,48,42,8 + LTEXT "Symbol Unicode:",IDC_STATIC,200,8,30,8 + EDITTEXT IDC_EDIT_UNICODE,236,4,28,12,ES_AUTOHSCROLL END IDD_ABOUTBOX DIALOGEX 22,16,210,182 @@ -38,4 +52,5 @@ STRINGTABLE DISCARDABLE BEGIN IDS_LICENSE "Niniejszy program jest wolnym oprogramowaniem; mo¿esz go rozprowadzaæ dalej i/lub modyfikowaæ na warunkach Powszechnej Licencji Publicznej GNU, wydanej przez Fundacjê Wolnego Oprogramowania - wed³ug wersji 2 tej Licencji lub (wed³ug twojego wyboru) którejœ z póŸniejszych wersji.\r\n\r\nNiniejszy program rozpowszechniany jest z nadziej¹, i¿ bêdzie on u¿yteczny - jednak BEZ JAKIEJKOLWIEK GWARANCJI, nawet domyœlnej gwarancji PRZYDATNOŒCI HANDLOWEJ albo PRZYDATNOŒCI DO OKREŒLONYCH ZASTOSOWAÑ. W celu uzyskania bli¿szych informacji siêgnij do Powszechnej Licencji Publicznej GNU.\r\n\r\nZ pewnoœci¹ wraz z niniejszym programem otrzyma³eœ te¿ egzemplarz Powszechnej Licencji Publicznej GNU (GNU General Public License); jeœli nie - napisz do Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." IDS_ABOUT "&O programie..." + IDS_TITLE "Tablica znaków" END diff --git a/base/applications/charmap/lang/pt-BR.rc b/base/applications/charmap/lang/pt-BR.rc index 6a86e180307..c3046153c3f 100644 --- a/base/applications/charmap/lang/pt-BR.rc +++ b/base/applications/charmap/lang/pt-BR.rc @@ -1,9 +1,8 @@ LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL -IDD_CHARMAP DIALOGEX 6, 6, 293, 205 //233 -CAPTION "Mapa de caracteres" +IDD_CHARMAP DIALOGEX 6, 6, 292, 224 FONT 8,"MS Shell Dlg",0,0 -STYLE DS_SHELLFONT | WS_BORDER | WS_VISIBLE | WS_SYSMENU | WS_MINIMIZEBOX +STYLE DS_SHELLFONT | WS_CHILD | WS_VISIBLE BEGIN LTEXT "Fonte :", IDC_STATIC, 6, 7, 24, 9 COMBOBOX IDC_FONTCOMBO, 36, 5, 210, 210, WS_CHILD | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_SORT | CBS_HASSTRINGS @@ -13,8 +12,22 @@ BEGIN CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "Selecionar", IDC_SELECT, 194, 186, 46, 13 PUSHBUTTON "Copiar", IDC_COPY, 244, 186, 46, 13, WS_DISABLED - //AUTOCHECKBOX "Modo de exibição avançado", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP - //EDITTEXT IDC_DISPLAY, 8, 217, 278, 13, WS_VISIBLE | WS_TABSTOP | ES_READONLY + CONTROL "Advanced view",IDC_CHECK_ADVANCED,"Button", BS_AUTOCHECKBOX | WS_TABSTOP, 8, 208, 95, 10 +END + +IDD_ADVANCED DIALOGEX 0, 0, 292, 64 +STYLE DS_SHELLFONT | WS_CHILD +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Charset:",IDC_STATIC,8,8,48,8 + COMBOBOX IDC_COMBO_CHARSET,72,4,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Group by:",IDC_STATIC,8,28,50,8 + COMBOBOX IDC_COMBO_GROUPBY,72,24,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Search",IDC_BUTTON_SEARCH,200,44,50,14 + EDITTEXT IDC_EDIT_SEARCH,72,44,116,14,ES_AUTOHSCROLL + LTEXT "Search for:",IDC_STATIC,8,48,42,8 + LTEXT "Unicode:",IDC_STATIC,200,8,30,8 + EDITTEXT IDC_EDIT_UNICODE,236,4,28,12,ES_AUTOHSCROLL END IDD_ABOUTBOX DIALOGEX 22,16,210,182 @@ -32,4 +45,5 @@ STRINGTABLE DISCARDABLE BEGIN IDS_LICENSE "Este programa é software livre; você pode redistribuí-lo e/ou modificá-lo sob os termos da GNU General Public License conforme publicada pela Free Software Foundation; quer a versão 2 da licença, ou (conforme você escolha) qualquer versão posterior.\r\n\r\nEste programa é distribuído com a esperança de que seja útil, mas SEM QUALQUER GARANTIA; mesmo sem a garantia implícita de MERCANTIBILIDADE OU ADEQUAÇÃO A UM DETERMINADO PROPÓSITO. Para mais detalhes, veja a GNU General Public License.\r\n\r\nVocê deve ter recebido uma cópia da GNU General Public License juntamente com este programa; caso contrário, escreva para a Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA." IDS_ABOUT "So&bre..." + IDS_TITLE "Character Map" END diff --git a/base/applications/charmap/lang/ru-RU.rc b/base/applications/charmap/lang/ru-RU.rc index 1a6bc939526..c52593abcb1 100644 --- a/base/applications/charmap/lang/ru-RU.rc +++ b/base/applications/charmap/lang/ru-RU.rc @@ -2,10 +2,9 @@ LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT -IDD_CHARMAP DIALOGEX 6, 6, 293, 205 //233 -CAPTION "Òàáëèöà ñèìâîëîâ" +IDD_CHARMAP DIALOGEX 6, 6, 292, 224 FONT 8,"MS Shell Dlg",0,0 -STYLE DS_SHELLFONT | WS_BORDER | WS_VISIBLE | WS_SYSMENU | WS_MINIMIZEBOX +STYLE DS_SHELLFONT | WS_CHILD | WS_VISIBLE BEGIN LTEXT "Øðèôò:", IDC_STATIC, 6, 7, 27, 9 COMBOBOX IDC_FONTCOMBO, 36, 5, 210, 210, WS_CHILD | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_SORT | CBS_HASSTRINGS @@ -15,8 +14,22 @@ BEGIN CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "Âûáðàòü", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "Êîïèðîâàòü", IDC_COPY, 242, 186, 44, 13, WS_DISABLED - //AUTOCHECKBOX "Advanced view", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP - //EDITTEXT IDC_DISPLAY, 8, 217, 278, 13, WS_VISIBLE | WS_TABSTOP | ES_READONLY + CONTROL "Advanced view",IDC_CHECK_ADVANCED,"Button", BS_AUTOCHECKBOX | WS_TABSTOP, 8, 208, 95, 10 +END + +IDD_ADVANCED DIALOGEX 0, 0, 292, 64 +STYLE DS_SHELLFONT | WS_CHILD +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Charset:",IDC_STATIC,8,8,48,8 + COMBOBOX IDC_COMBO_CHARSET,72,4,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Group by:",IDC_STATIC,8,28,50,8 + COMBOBOX IDC_COMBO_GROUPBY,72,24,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Search",IDC_BUTTON_SEARCH,200,44,50,14 + EDITTEXT IDC_EDIT_SEARCH,72,44,116,14,ES_AUTOHSCROLL + LTEXT "Search for:",IDC_STATIC,8,48,42,8 + LTEXT "Unicode:",IDC_STATIC,200,8,30,8 + EDITTEXT IDC_EDIT_UNICODE,236,4,28,12,ES_AUTOHSCROLL END IDD_ABOUTBOX DIALOGEX 22,16,210,182 @@ -34,4 +47,5 @@ STRINGTABLE DISCARDABLE BEGIN IDS_LICENSE "Ýòà ïðîãðàììà ÿâëÿåòñÿ ñâîáîäíî ðàñïðîñòðàíÿåìîé; Âû ìîæåòå ðàñïðîñòðàíÿòü åå ïîâòîðíî è (èëè) èçìåíÿòü, ñîáëþäàÿ óñëîâèÿ Îòêðûòîãî ëèöåíçèîííîãî ñîãëàøåíèÿ GNU, îïóáëèêîâàííîãî Ôîíäîì ñâîáîäíî ðàñïðîñòðàíÿåìîãî ïðîãðàììíîãî îáåñïå÷åíèÿ; ëèáî ðåäàêöèè 2 Ñîãëàøåíèÿ, ëèáî (íà âàøå óñìîòðåíèå) ëþáîé ðåäàêöèè, âûïóùåííîé ïîçæå.\r\n\r\nÝòà ïðîãðàììà ðàñïðîñòðàíÿåòñÿ â íàäåæäå íà òî, ÷òî îíà îêàæåòñÿ ïîëåçíîé, íî ÁÅÇ ÊÀÊÈÕ-ËÈÁÎ ÃÀÐÀÍÒÈÉ, âêëþ÷àÿ ïîäðàçóìåâàåìóþ ãàðàíòèþ ÊÀ×ÅÑÒÂÀ ëèáî ÏÐÈÃÎÄÍÎÑÒÈ ÄËß ÎÏÐÅÄÅËÅÍÍÛÕ ÖÅËÅÉ. Ïîäðîáíîñòè ñîäåðæàòñÿ â Îòêðûòîì ëèöåíçèîííîì ñîãëàøåíèè GNU.\r\n\r\nÂìåñòå ñ ýòîé ïðîãðàììîé äîëæåí ðàñïðîñòðàíÿòüñÿ ýêçåìïëÿð Îòêðûòîãî ëèöåíçèîííîãî ñîãëàøåíèÿ GNU, åñëè îí îòñóòñòâóåò, ñîîáùèòå îá ýòîì â Ôîíä ñâîáîäíî ðàñïðîñòðàíÿåìîãî ïðîãðàììíîãî îáåñïå÷åíèÿ (Free Software Foundation, Inc.), 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." IDS_ABOUT "&Î ïðîãðàììå..." + IDS_TITLE "Character Map" END diff --git a/base/applications/charmap/lang/sk-SK.rc b/base/applications/charmap/lang/sk-SK.rc index 7ab74b1715e..868f97e72ba 100644 --- a/base/applications/charmap/lang/sk-SK.rc +++ b/base/applications/charmap/lang/sk-SK.rc @@ -9,10 +9,9 @@ LANGUAGE LANG_SLOVAK, SUBLANG_DEFAULT -IDD_CHARMAP DIALOGEX 6, 6, 293, 205 //233 -CAPTION "Mapa znakov" +IDD_CHARMAP DIALOGEX 6, 6, 292, 224 FONT 8,"MS Shell Dlg",0,0 -STYLE DS_SHELLFONT | WS_BORDER | WS_VISIBLE | WS_SYSMENU | WS_MINIMIZEBOX +STYLE DS_SHELLFONT | WS_CHILD | WS_VISIBLE BEGIN LTEXT "Pís&mo:", IDC_STATIC, 6, 7, 24, 9 COMBOBOX IDC_FONTCOMBO, 36, 5, 210, 210, WS_CHILD | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_SORT | CBS_HASSTRINGS @@ -22,8 +21,22 @@ BEGIN CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "&Vybra", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "&Kopírova", IDC_COPY, 242, 186, 44, 13, WS_DISABLED - //AUTOCHECKBOX "R&ozšírené zobrazenie", IDC_ADVVIEW, 10, 204, 75, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP - //EDITTEXT IDC_DISPLAY, 8, 217, 278, 13, WS_VISIBLE | WS_TABSTOP | ES_READONLY + CONTROL "Advanced view",IDC_CHECK_ADVANCED,"Button", BS_AUTOCHECKBOX | WS_TABSTOP, 8, 208, 95, 10 +END + +IDD_ADVANCED DIALOGEX 0, 0, 292, 64 +STYLE DS_SHELLFONT | WS_CHILD +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Charset:",IDC_STATIC,8,8,48,8 + COMBOBOX IDC_COMBO_CHARSET,72,4,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Group by:",IDC_STATIC,8,28,50,8 + COMBOBOX IDC_COMBO_GROUPBY,72,24,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Search",IDC_BUTTON_SEARCH,200,44,50,14 + EDITTEXT IDC_EDIT_SEARCH,72,44,116,14,ES_AUTOHSCROLL + LTEXT "Search for:",IDC_STATIC,8,48,42,8 + LTEXT "Unicode:",IDC_STATIC,200,8,30,8 + EDITTEXT IDC_EDIT_UNICODE,236,4,28,12,ES_AUTOHSCROLL END IDD_ABOUTBOX DIALOGEX 22,16,210,182 @@ -41,4 +54,5 @@ STRINGTABLE DISCARDABLE BEGIN IDS_LICENSE, "Tento program je vo¾ný softvér; môžete ho šíri a/alebo modifikova pod¾a podmienok GNU Všeobecnej verejnej licencie (GNU General Public License) ako bola zverejnená nadáciou Free Software Foundation; buï verzie 2 tejto licencie, alebo (pod¾a Vášho uváženia) niektorej neskoršej verzie.\r\n\r\nTento program je distribuovaný v nádeji, že bude užitoèný, avšak BEZ AKEJKO¼VEK ZÁRUKY; rovnako bez záruky PREDAJNOSTI alebo VHODNOSTI PRE URÈITÝ ÚÈEL. Pre viac detailov si pozrite GNU Všeobecnú verejnú licenciu (GNU General Public License).\r\n\r\nKópiu Všeobecnej verejnej licencie GNU ste mali dosta spolu s týmto programom; ak nie, napíšte si o òu na Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." IDS_ABOUT "È&o je Mapa znakov" + IDS_TITLE "Character Map" END diff --git a/base/applications/charmap/lang/sv-SE.rc b/base/applications/charmap/lang/sv-SE.rc index 3b314d05fe7..bd5da0a1a24 100644 --- a/base/applications/charmap/lang/sv-SE.rc +++ b/base/applications/charmap/lang/sv-SE.rc @@ -3,7 +3,8 @@ * FILE: \base\applications\charmap\lang\sv-SE.rc * PURPOSE: Swedish resource file * Translation: Jaix Bly - */LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL + */ + LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL IDD_CHARMAP DIALOGEX 6, 6, 293, 205 //233 CAPTION "Teckenuppsättning" diff --git a/base/applications/charmap/lang/uk-UA.rc b/base/applications/charmap/lang/uk-UA.rc index cabd820e41d..a76da186bec 100644 --- a/base/applications/charmap/lang/uk-UA.rc +++ b/base/applications/charmap/lang/uk-UA.rc @@ -8,10 +8,9 @@ LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT -IDD_CHARMAP DIALOGEX 6, 6, 293, 205 //233 -CAPTION "Òàáëèöÿ ñèìâîë³â" +IDD_CHARMAP DIALOGEX 6, 6, 292, 224 FONT 8,"MS Shell Dlg",0,0 -STYLE DS_SHELLFONT | WS_BORDER | WS_VISIBLE | WS_SYSMENU | WS_MINIMIZEBOX +STYLE DS_SHELLFONT | WS_CHILD | WS_VISIBLE BEGIN LTEXT "Øðèôò :", IDC_STATIC, 6, 7, 24, 9 COMBOBOX IDC_FONTCOMBO, 36, 5, 210, 210, WS_CHILD | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_SORT | CBS_HASSTRINGS @@ -21,8 +20,22 @@ BEGIN CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "Âèáðàòè", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "Êîï³þâàòè", IDC_COPY, 242, 186, 44, 13, WS_DISABLED - //AUTOCHECKBOX "Ðîçøèðåíèé âèãëÿä", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP - //EDITTEXT IDC_DISPLAY, 8, 217, 278, 13, WS_VISIBLE | WS_TABSTOP | ES_READONLY + CONTROL "Advanced view",IDC_CHECK_ADVANCED,"Button", BS_AUTOCHECKBOX | WS_TABSTOP, 8, 208, 95, 10 +END + +IDD_ADVANCED DIALOGEX 0, 0, 292, 64 +STYLE DS_SHELLFONT | WS_CHILD +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Charset:",IDC_STATIC,8,8,48,8 + COMBOBOX IDC_COMBO_CHARSET,72,4,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Group by:",IDC_STATIC,8,28,50,8 + COMBOBOX IDC_COMBO_GROUPBY,72,24,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Search",IDC_BUTTON_SEARCH,200,44,50,14 + EDITTEXT IDC_EDIT_SEARCH,72,44,116,14,ES_AUTOHSCROLL + LTEXT "Search for:",IDC_STATIC,8,48,42,8 + LTEXT "Unicode:",IDC_STATIC,200,8,30,8 + EDITTEXT IDC_EDIT_UNICODE,236,4,28,12,ES_AUTOHSCROLL END IDD_ABOUTBOX DIALOGEX 22,16,210,182 @@ -40,4 +53,5 @@ STRINGTABLE DISCARDABLE BEGIN IDS_LICENSE "Òàáëèöÿ ñèìâîë³â - â³ëüíå ïðîãðàìíå çàáåçïå÷åííÿ; Âè ìîæåòå ðîçïîâñþäæóâàòè ¿¿ òà çì³íþâàòè, äîòðèìóþ÷èñü óìîâè ³äêðèòî¿ ë³öåíç³éíî¿ óãîäè GNU, îïóáë³êîâàíî¿ Ôîíäîì â³ëüíîãî ïðîãðàìíîãî çàáåçïå÷åííÿ; àáî ðåäàêö³¿ 2 Óãîäè, àáî áóäü-ÿêî¿ ðåäàêö³¿, âèïóùåíî¿ ï³çí³øå.\r\n\r\nÖÿ ïðîãðàìà ðîçïîâñþäæóºòüñÿ â íà䳿 íà òå, ùî âîíà âèÿâèòüñÿ êîðèñíîþ, àëå ÁÅÇ ÁÓÄÜ-ßÊÈÕ ÃÀÐÀÍÒ²É, âêëþ÷àþ÷è ÓßÂÍÎÞ ÃÀÐÀÍÒ²ªÞ ßÊÎÑÒ² àáî ÏÐÈÄÀÒÍÎÑÒ² äëÿ ïåâíèõ ö³ëåé. Ïîäðîáèö³ ì³ñòÿòüñÿ ó ³äêðèò³é ë³öåíç³éí³é óãîä³ GNU.\r\n\r\nÐàçîì ç ö³ºþ ïðîãðàìîþ ïîâèíåí ïîøèðþâàòèñÿ ïðèì³ðíèê ³äêðèòî¿ ë³öåíç³éíî¿ óãîäè GNU. ßêùî â³í â³äñóòí³é, ïîâ³äîìòå ïðî öå â Ôîíä â³ëüíîãî ïðîãðàìíîãî çàáåçïå÷åííÿ (Free Software Foundation, Inc.), 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." IDS_ABOUT "&Ïðî ïðîãðàìó..." + IDS_TITLE "Character Map" END diff --git a/base/applications/charmap/lang/zh-CN.rc b/base/applications/charmap/lang/zh-CN.rc index 7fdfffd1a1f..7385d597667 100644 --- a/base/applications/charmap/lang/zh-CN.rc +++ b/base/applications/charmap/lang/zh-CN.rc @@ -2,10 +2,9 @@ LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED -IDD_CHARMAP DIALOGEX 6, 6, 293, 205 //233 -CAPTION "×Ö·û±í" +IDD_CHARMAP DIALOGEX 6, 6, 292, 224 FONT 8,"MS Shell Dlg",0,0 -STYLE DS_SHELLFONT | WS_BORDER | WS_VISIBLE | WS_SYSMENU | WS_MINIMIZEBOX +STYLE DS_SHELLFONT | WS_CHILD | WS_VISIBLE BEGIN LTEXT "×ÖÌå:", IDC_STATIC, 6, 7, 24, 9 COMBOBOX IDC_FONTCOMBO, 36, 5, 210, 210, WS_CHILD | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_SORT | CBS_HASSTRINGS @@ -15,8 +14,22 @@ BEGIN CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "Ñ¡Ôñ", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "¸´ÖÆ", IDC_COPY, 242, 186, 44, 13, WS_DISABLED - //AUTOCHECKBOX "Advanced view", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP - //EDITTEXT IDC_DISPLAY, 8, 217, 278, 13, WS_VISIBLE | WS_TABSTOP | ES_READONLY + CONTROL "Advanced view",IDC_CHECK_ADVANCED,"Button", BS_AUTOCHECKBOX | WS_TABSTOP, 8, 208, 95, 10 +END + +IDD_ADVANCED DIALOGEX 0, 0, 292, 64 +STYLE DS_SHELLFONT | WS_CHILD +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Charset:",IDC_STATIC,8,8,48,8 + COMBOBOX IDC_COMBO_CHARSET,72,4,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Group by:",IDC_STATIC,8,28,50,8 + COMBOBOX IDC_COMBO_GROUPBY,72,24,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Search",IDC_BUTTON_SEARCH,200,44,50,14 + EDITTEXT IDC_EDIT_SEARCH,72,44,116,14,ES_AUTOHSCROLL + LTEXT "Search for:",IDC_STATIC,8,48,42,8 + LTEXT "Unicode:",IDC_STATIC,200,8,30,8 + EDITTEXT IDC_EDIT_UNICODE,236,4,28,12,ES_AUTOHSCROLL END IDD_ABOUTBOX DIALOGEX 22,16,210,182 @@ -34,4 +47,5 @@ STRINGTABLE DISCARDABLE BEGIN IDS_LICENSE "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\r\n\r\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA." IDS_ABOUT "¹ØÓÚ(&A)..." + IDS_TITLE "Character Map" END diff --git a/base/applications/charmap/lang/zh-TW.rc b/base/applications/charmap/lang/zh-TW.rc index ba36b67fb70..5bb325887ba 100644 --- a/base/applications/charmap/lang/zh-TW.rc +++ b/base/applications/charmap/lang/zh-TW.rc @@ -2,10 +2,9 @@ LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL -IDD_CHARMAP DIALOGEX 6, 6, 293, 205 //233 -CAPTION "¦r²Åªí" +IDD_CHARMAP DIALOGEX 6, 6, 292, 224 FONT 8,"MS Shell Dlg",0,0 -STYLE DS_SHELLFONT | WS_BORDER | WS_VISIBLE | WS_SYSMENU | WS_MINIMIZEBOX +STYLE DS_SHELLFONT | WS_CHILD | WS_VISIBLE BEGIN LTEXT "¦rÅé¡G", IDC_STATIC, 6, 7, 24, 9 COMBOBOX IDC_FONTCOMBO, 36, 5, 210, 210, WS_CHILD | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_SORT | CBS_HASSTRINGS @@ -15,8 +14,22 @@ BEGIN CONTROL "",IDC_TEXTBOX,RICHEDIT_CLASS,ES_AUTOHSCROLL | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 74, 186, 114, 13 DEFPUSHBUTTON "¿ï¾Ü", IDC_SELECT, 194, 186, 44, 13 PUSHBUTTON "½Æ»s", IDC_COPY, 242, 186, 44, 13, WS_DISABLED - //AUTOCHECKBOX "Advanced view", IDC_ADVVIEW, 10, 204, 64, 9, WS_CHILD | WS_VISIBLE | WS_TABSTOP - //EDITTEXT IDC_DISPLAY, 8, 217, 278, 13, WS_VISIBLE | WS_TABSTOP | ES_READONLY + CONTROL "Advanced view",IDC_CHECK_ADVANCED,"Button", BS_AUTOCHECKBOX | WS_TABSTOP, 8, 208, 95, 10 +END + +IDD_ADVANCED DIALOGEX 0, 0, 292, 64 +STYLE DS_SHELLFONT | WS_CHILD +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Charset:",IDC_STATIC,8,8,48,8 + COMBOBOX IDC_COMBO_CHARSET,72,4,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Group by:",IDC_STATIC,8,28,50,8 + COMBOBOX IDC_COMBO_GROUPBY,72,24,116,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Search",IDC_BUTTON_SEARCH,200,44,50,14 + EDITTEXT IDC_EDIT_SEARCH,72,44,116,14,ES_AUTOHSCROLL + LTEXT "Search for:",IDC_STATIC,8,48,42,8 + LTEXT "Unicode:",IDC_STATIC,200,8,30,8 + EDITTEXT IDC_EDIT_UNICODE,236,4,28,12,ES_AUTOHSCROLL END IDD_ABOUTBOX DIALOGEX 22,16,210,182 @@ -34,4 +47,5 @@ STRINGTABLE DISCARDABLE BEGIN IDS_LICENSE "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\r\n\r\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA." IDS_ABOUT "Ãö©ó(&A)..." + IDS_TITLE "Character Map" END diff --git a/base/applications/charmap/precomp.h b/base/applications/charmap/precomp.h index 597d9f20967..9825aa47560 100644 --- a/base/applications/charmap/precomp.h +++ b/base/applications/charmap/precomp.h @@ -1,13 +1,16 @@ #ifndef __CHARMAP_PRECOMP_H #define __CHARMAP_PRECOMP_H +#define WIN32_LEAN_AND_MEAN +#include #include #include -#include #include #include #include "resource.h" +#define SIZEOF(_v) (sizeof(_v) / sizeof(*_v)) + #define XCELLS 20 #define YCELLS 10 #define XLARGE 45 diff --git a/base/applications/charmap/resource.h b/base/applications/charmap/resource.h index b174903ab8a..07828054f69 100644 --- a/base/applications/charmap/resource.h +++ b/base/applications/charmap/resource.h @@ -1,19 +1,28 @@ -#define IDC_STATIC -1 +#define IDC_STATIC -1 -#define IDI_ICON 100 +#define IDI_ICON 100 -#define IDD_CHARMAP 200 -#define IDD_ABOUTBOX 201 +#define IDD_CHARMAP 200 +#define IDD_ABOUTBOX 201 +#define IDD_STATUSBAR 202 +#define IDD_ADVANCED 203 -#define IDC_FONTCOMBO 1001 -#define IDC_CMHELP 1002 -#define IDC_FONTMAP 1003 -#define IDC_TEXTBOX 1004 -#define IDC_SELECT 1005 -#define IDC_COPY 1006 -#define IDC_ADVVIEW 1007 -#define IDC_DISPLAY 1008 -#define IDC_LICENSE_EDIT 1009 +#define IDC_FONTCOMBO 1001 +#define IDC_CMHELP 1002 +#define IDC_FONTMAP 1003 +#define IDC_TEXTBOX 1004 +#define IDC_SELECT 1005 +#define IDC_COPY 1006 +#define IDC_ADVVIEW 1007 +#define IDC_DISPLAY 1008 +#define IDC_LICENSE_EDIT 1009 +#define IDC_COMBO_CHARSET 1000 +#define IDC_COMBO_GROUPBY 1001 +#define IDC_BUTTON_SEARCH 1002 +#define IDC_EDIT_SEARCH 1003 +#define IDC_EDIT_UNICODE 1004 +#define IDC_CHECK_ADVANCED 1007 -#define IDS_LICENSE 1010 -#define IDS_ABOUT 1011 +#define IDS_LICENSE 1010 +#define IDS_ABOUT 1011 +#define IDS_TITLE 1012 diff --git a/base/applications/cmdutils/dbgprint/CMakeLists.txt b/base/applications/cmdutils/dbgprint/CMakeLists.txt index 5a3ce00f410..728678d3d5c 100644 --- a/base/applications/cmdutils/dbgprint/CMakeLists.txt +++ b/base/applications/cmdutils/dbgprint/CMakeLists.txt @@ -2,4 +2,4 @@ add_executable(dbgprint dbgprint.c) set_module_type(dbgprint win32cui) add_importlibs(dbgprint msvcrt kernel32) -add_cab_target(dbgprint 1) +add_cd_file(TARGET dbgprint DESTINATION reactos/system32 FOR all) diff --git a/base/applications/cmdutils/doskey/CMakeLists.txt b/base/applications/cmdutils/doskey/CMakeLists.txt index 62f86c5a478..09805d87b2d 100644 --- a/base/applications/cmdutils/doskey/CMakeLists.txt +++ b/base/applications/cmdutils/doskey/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(doskey doskey.c doskey.rc) set_module_type(doskey win32cui) add_importlibs(doskey user32 msvcrt kernel32) -add_cab_target(doskey 1) +add_cd_file(TARGET doskey DESTINATION reactos/system32 FOR all) diff --git a/base/applications/cmdutils/find/CMakeLists.txt b/base/applications/cmdutils/find/CMakeLists.txt index 30acb795067..f94e42eee18 100644 --- a/base/applications/cmdutils/find/CMakeLists.txt +++ b/base/applications/cmdutils/find/CMakeLists.txt @@ -4,4 +4,4 @@ add_executable(find find.c find.rc) set_module_type(find win32cui) add_importlibs(find user32 msvcrt kernel32) -add_cab_target(find 1) +add_cd_file(TARGET find DESTINATION reactos/system32 FOR all) diff --git a/base/applications/cmdutils/find/lang/sv-SE.rc b/base/applications/cmdutils/find/lang/sv-SE.rc index 12b9fa58391..6d5518ed3c5 100644 --- a/base/applications/cmdutils/find/lang/sv-SE.rc +++ b/base/applications/cmdutils/find/lang/sv-SE.rc @@ -5,7 +5,7 @@ BEGIN IDS_USAGE, "FIND: Skriver ut alla rader i en fil som innehåller en sträng.\n\n\ FIND [ /C ] [ /I ] [ /N ] [ /V ] ""sträng"" [ fil... ]\n\ - /C Räkna nummren av linjer som innehåller en strängen\n\ + /C Räkna antalet rader som innehåller en strängen\n\ /I Ignorera skiftläge\n\ /N Antal visade rader, börjar på 1\n\ /V Skriver ut rader som inte innehåller strängen" diff --git a/base/applications/cmdutils/hostname/CMakeLists.txt b/base/applications/cmdutils/hostname/CMakeLists.txt index 5c715b72657..528d64f04ec 100644 --- a/base/applications/cmdutils/hostname/CMakeLists.txt +++ b/base/applications/cmdutils/hostname/CMakeLists.txt @@ -4,4 +4,4 @@ add_executable(hostname hostname.c hostname.rc) set_module_type(hostname win32cui) add_importlibs(hostname msvcrt kernel32) -add_cab_target(hostname 1) +add_cd_file(TARGET hostname DESTINATION reactos/system32 FOR all) diff --git a/base/applications/cmdutils/lodctr/CMakeLists.txt b/base/applications/cmdutils/lodctr/CMakeLists.txt index 2495c35b8e5..9e2fa8b4a67 100644 --- a/base/applications/cmdutils/lodctr/CMakeLists.txt +++ b/base/applications/cmdutils/lodctr/CMakeLists.txt @@ -5,4 +5,4 @@ add_executable(lodctr lodctr_main.c) set_module_type(lodctr win32cui) add_importlibs(lodctr loadperf msvcrt kernel32) -add_cab_target(lodctr 1) +add_cd_file(TARGET lodctr DESTINATION reactos/system32 FOR all) diff --git a/base/applications/cmdutils/more/CMakeLists.txt b/base/applications/cmdutils/more/CMakeLists.txt index 2b8deb1a7f2..34b841a09e2 100644 --- a/base/applications/cmdutils/more/CMakeLists.txt +++ b/base/applications/cmdutils/more/CMakeLists.txt @@ -3,4 +3,4 @@ add_executable(more more.c more.rc) set_module_type(more win32cui) add_importlibs(more user32 msvcrt kernel32) -add_cab_target(more 1) +add_cd_file(TARGET more DESTINATION reactos/system32 FOR all) diff --git a/base/applications/cmdutils/reg/CMakeLists.txt b/base/applications/cmdutils/reg/CMakeLists.txt index 4e7fddbaac0..d33a5dc270c 100644 --- a/base/applications/cmdutils/reg/CMakeLists.txt +++ b/base/applications/cmdutils/reg/CMakeLists.txt @@ -8,4 +8,4 @@ add_executable(reg reg.c rsrc.rc) set_module_type(reg win32cui) add_importlibs(reg advapi32 user32 msvcrt kernel32) -add_cab_target(reg 1) +add_cd_file(TARGET reg DESTINATION reactos/system32 FOR all) diff --git a/base/applications/cmdutils/xcopy/CMakeLists.txt b/base/applications/cmdutils/xcopy/CMakeLists.txt index 7624c0c2ac5..6ef21593877 100644 --- a/base/applications/cmdutils/xcopy/CMakeLists.txt +++ b/base/applications/cmdutils/xcopy/CMakeLists.txt @@ -7,4 +7,4 @@ target_link_libraries(xcopy wine) set_module_type(xcopy win32cui) add_importlibs(xcopy shell32 user32 msvcrt kernel32 ntdll) -add_cab_target(xcopy 1) +add_cd_file(TARGET xcopy DESTINATION reactos/system32 FOR all) diff --git a/base/applications/control/CMakeLists.txt b/base/applications/control/CMakeLists.txt index bb6d2e0d4be..1ad30337427 100644 --- a/base/applications/control/CMakeLists.txt +++ b/base/applications/control/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(control control.c control.rc) set_module_type(control win32gui) add_importlibs(control advapi32 shell32 msvcrt kernel32) -add_cab_target(control 1) +add_cd_file(TARGET control DESTINATION reactos/system32 FOR all) diff --git a/base/applications/dxdiag/CMakeLists.txt b/base/applications/dxdiag/CMakeLists.txt index e5fcc0f841b..d234cc13f6a 100644 --- a/base/applications/dxdiag/CMakeLists.txt +++ b/base/applications/dxdiag/CMakeLists.txt @@ -30,4 +30,4 @@ target_link_libraries(dxdiag dxguid) add_importlibs(dxdiag user32 advapi32 comctl32 dinput8 setupapi dsound ddraw version gdi32 winmm d3d9 msvcrt kernel32 ntdll) -add_cab_target(dxdiag 1) +add_cd_file(TARGET dxdiag DESTINATION reactos/system32 FOR all) diff --git a/base/applications/dxdiag/lang/sv-SE.rc b/base/applications/dxdiag/lang/sv-SE.rc index eb27eb55359..bf737dda281 100644 --- a/base/applications/dxdiag/lang/sv-SE.rc +++ b/base/applications/dxdiag/lang/sv-SE.rc @@ -25,9 +25,9 @@ STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "MS Shell Dlg" BEGIN LTEXT "Detta verktyget rapporterar detaljerad information om ReactX komponenter och enheter som är installerade på ditt system.", -1, 10, 10, 443, 17 - LTEXT "Om du vet vilket område som skapar problemer, välger du den aktuella kategorin ovanför. Om inte, kan du använda knappen ""Nästa sida"" nedanför för att besöka alla sidorna sekventiellt.", -1, 10, 30, 443, 25 + LTEXT "Om du vet vilket område som skapar problem, kan du klicka på motsvarande flik ovanför. Om inte, kan du använda knappen ""Nästa sida"" nedanför för att besöka alla sidorna sekventiellt.", -1, 10, 30, 443, 25 GROUPBOX "System Information", -1, 10, 55, 443, 130, SS_RIGHT - LTEXT "Nuvarende Datum/Tid:", -1, 70, 70, 80, 10, SS_RIGHT + LTEXT "Aktuellt Datum/Tid:", -1, 70, 70, 80, 10, SS_RIGHT LTEXT "Datornamn:", -1, 70, 80, 80, 10, SS_RIGHT LTEXT "Operativsystem:", -1, 70, 90, 80, 10, SS_RIGHT LTEXT "Språk:", -1, 70, 100, 80, 10, SS_RIGHT @@ -191,8 +191,8 @@ BEGIN IDS_FORMAT_UNIPROC "%s (%u processor)" IDS_FORMAT_MPPROC "%s (%u procesorer)" IDS_VERSION_UNKNOWN "Okänd version" - IDS_DEVICE_STATUS_ATTACHED "Kopplad till" - IDS_DEVICE_STATUS_MISSING "Kopplad från" + IDS_DEVICE_STATUS_ATTACHED "Ansluten" + IDS_DEVICE_STATUS_MISSING "Saknas" IDS_DEVICE_STATUS_UNKNOWN "Okänd" IDS_DEVICE_NAME "Enhetsnamn" IDS_DEVICE_STATUS "Status" @@ -210,10 +210,10 @@ BEGIN IDS_DIRECTPLAY8_SERIALSP "DirectPlay8 Serial Service Provider" IDS_DIRECTPLAY8_IPXSP "DirectPlay8 IPX Service Provider" IDS_DIRECTPLAY8_TCPSP "DirectPlay8-TCP/IP Service Provider" - IDS_DIRECTPLAY_TCPCONN "Internet TCP/IP koppling for DirectPlay" - IDS_DIRECTPLAY_IPXCONN "IPX koppling for DirectPlay" - IDS_DIRECTPLAY_MODEMCONN "Modem koppling for DirectPlay" - IDS_DIRECTPLAY_SERIALCONN "Serial kopplig for DirectPlay" + IDS_DIRECTPLAY_TCPCONN "Internet TCP/IP koppling för DirectPlay" + IDS_DIRECTPLAY_IPXCONN "IPX koppling för DirectPlay" + IDS_DIRECTPLAY_MODEMCONN "Modemkoppling för DirectPlay" + IDS_DIRECTPLAY_SERIALCONN "Seriell kopplig för DirectPlay" IDS_REG_SUCCESS "OK" IDS_REG_FAIL "Fel" IDS_DDTEST_ERROR "Testet misslyckes!" diff --git a/base/applications/dxdiag/rsrc.rc b/base/applications/dxdiag/rsrc.rc index d2a28b44448..b0539e32d04 100644 --- a/base/applications/dxdiag/rsrc.rc +++ b/base/applications/dxdiag/rsrc.rc @@ -10,7 +10,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL #include "lang/en-US.rc" #include "lang/es-ES.rc" #include "lang/fr-FR.rc" -//#include "lang/ja-JP.rc" FIXME: iconv issue +#include "lang/ja-JP.rc" #include "lang/ko-KR.rc" #include "lang/nl-NL.rc" #include "lang/no-NO.rc" diff --git a/base/applications/extrac32/CMakeLists.txt b/base/applications/extrac32/CMakeLists.txt index 1770afa59f0..f9699b878a9 100644 --- a/base/applications/extrac32/CMakeLists.txt +++ b/base/applications/extrac32/CMakeLists.txt @@ -7,4 +7,4 @@ target_link_libraries(extrac32 wine) set_module_type(extrac32 win32gui) add_importlibs(extrac32 shell32 setupapi shlwapi user32 msvcrt kernel32 ntdll) -add_cab_target(extrac32 1) +add_cd_file(TARGET extrac32 DESTINATION reactos/system32 FOR all) diff --git a/base/applications/findstr/CMakeLists.txt b/base/applications/findstr/CMakeLists.txt index af3cdbfbc49..68b0e741727 100644 --- a/base/applications/findstr/CMakeLists.txt +++ b/base/applications/findstr/CMakeLists.txt @@ -7,4 +7,4 @@ add_executable(findstr set_module_type(findstr win32cui) add_importlibs(findstr user32 msvcrt kernel32) -add_cab_target(findstr 1) +add_cd_file(TARGET findstr DESTINATION reactos/system32 FOR all) diff --git a/base/applications/fontview/CMakeLists.txt b/base/applications/fontview/CMakeLists.txt index 8be0dea160e..b22915098d0 100644 --- a/base/applications/fontview/CMakeLists.txt +++ b/base/applications/fontview/CMakeLists.txt @@ -8,4 +8,4 @@ add_executable(fontview set_module_type(fontview win32gui) add_importlibs(fontview gdi32 shell32 user32 msvcrt kernel32) -add_cab_target(fontview 1) +add_cd_file(TARGET fontview DESTINATION reactos/system32 FOR all) diff --git a/base/applications/games/solitaire/CMakeLists.txt b/base/applications/games/solitaire/CMakeLists.txt index 938a32eebc5..c0daaa0ebeb 100644 --- a/base/applications/games/solitaire/CMakeLists.txt +++ b/base/applications/games/solitaire/CMakeLists.txt @@ -17,4 +17,4 @@ set_module_type(sol win32gui) add_importlibs(sol advapi32 comctl32 user32 gdi32 kernel32 msvcrt) -add_cab_target(sol 1) +add_cd_file(TARGET sol DESTINATION reactos/system32 FOR all) diff --git a/base/applications/games/spider/CMakeLists.txt b/base/applications/games/spider/CMakeLists.txt index acbd76f282b..560c6d5b18e 100644 --- a/base/applications/games/spider/CMakeLists.txt +++ b/base/applications/games/spider/CMakeLists.txt @@ -17,4 +17,4 @@ set_module_type(spider win32gui) add_importlibs(spider advapi32 comctl32 user32 gdi32 kernel32 msvcrt) -add_cab_target(spider 1) +add_cd_file(TARGET spider DESTINATION reactos/system32 FOR all) diff --git a/base/applications/games/winmine/CMakeLists.txt b/base/applications/games/winmine/CMakeLists.txt index 63d7e6eaee9..f4e99a16789 100644 --- a/base/applications/games/winmine/CMakeLists.txt +++ b/base/applications/games/winmine/CMakeLists.txt @@ -12,4 +12,4 @@ set_module_type(winmine win32gui) target_link_libraries(winmine wine) add_importlibs(winmine user32 gdi32 advapi32 shell32 msvcrt kernel32 ntdll) -add_cab_target(winmine 1) +add_cd_file(TARGET winmine DESTINATION reactos/system32 FOR all) diff --git a/base/applications/hh/CMakeLists.txt b/base/applications/hh/CMakeLists.txt index 3b78ce5a911..5de0b1a0282 100644 --- a/base/applications/hh/CMakeLists.txt +++ b/base/applications/hh/CMakeLists.txt @@ -3,4 +3,4 @@ set_rc_compiler() add_executable(hh main.c hh.rc) set_module_type(hh win32gui) add_importlibs(hh gdi32 user32 msvcrt kernel32) -add_cab_target(hh 4) +add_cd_file(TARGET hh DESTINATION reactos FOR all) diff --git a/base/applications/iexplore/CMakeLists.txt b/base/applications/iexplore/CMakeLists.txt index fd2c6f162e0..b86174114db 100644 --- a/base/applications/iexplore/CMakeLists.txt +++ b/base/applications/iexplore/CMakeLists.txt @@ -3,4 +3,4 @@ set_rc_compiler() add_executable(iexplore main.c iexplore.rc) set_module_type(iexplore win32gui) add_importlibs(iexplore shdocvw msvcrt kernel32) -add_cab_target(iexplore 4) +add_cd_file(TARGET iexplore DESTINATION reactos FOR all) diff --git a/base/applications/kbswitch/CMakeLists.txt b/base/applications/kbswitch/CMakeLists.txt index f48cd9cfbfa..19374115fa4 100644 --- a/base/applications/kbswitch/CMakeLists.txt +++ b/base/applications/kbswitch/CMakeLists.txt @@ -7,5 +7,5 @@ add_executable(kbswitch kbswitch.c kbswitch.rc) set_module_type(kbswitch win32gui) add_importlibs(kbswitch advapi32 user32 shell32 gdi32 msvcrt kernel32) -add_cab_target(kbswitch 1) +add_cd_file(TARGET kbswitch DESTINATION reactos/system32 FOR all) add_subdirectory(kbsdll) diff --git a/base/applications/kbswitch/kbsdll/CMakeLists.txt b/base/applications/kbswitch/kbsdll/CMakeLists.txt index 135969e6929..1f51b602899 100644 --- a/base/applications/kbswitch/kbsdll/CMakeLists.txt +++ b/base/applications/kbswitch/kbsdll/CMakeLists.txt @@ -12,4 +12,4 @@ add_library(kbsdll SHARED ${SOURCE}) set_module_type(kbsdll win32dll) add_importlibs(kbsdll user32 comctl32 kernel32 msvcrt) -add_cab_target(kbsdll 1) +add_cd_file(TARGET kbsdll DESTINATION reactos/system32 FOR all) diff --git a/base/applications/logoff/CMakeLists.txt b/base/applications/logoff/CMakeLists.txt index c7cbb7f70ea..c560717531a 100644 --- a/base/applications/logoff/CMakeLists.txt +++ b/base/applications/logoff/CMakeLists.txt @@ -12,4 +12,4 @@ add_pch(logoff ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE}) set_module_type(logoff win32cui) add_importlibs(logoff advapi32 user32 msvcrt kernel32) -add_cab_target(logoff 1) +add_cd_file(TARGET logoff DESTINATION reactos/system32 FOR all) diff --git a/base/applications/magnify/CMakeLists.txt b/base/applications/magnify/CMakeLists.txt index b4641891244..e7ab404c53c 100644 --- a/base/applications/magnify/CMakeLists.txt +++ b/base/applications/magnify/CMakeLists.txt @@ -8,4 +8,4 @@ add_executable(magnify set_module_type(magnify win32gui) add_importlibs(magnify user32 gdi32 advapi32 shell32 msvcrt kernel32) -add_cab_target(magnify 1) +add_cd_file(TARGET magnify DESTINATION reactos/system32 FOR all) diff --git a/base/applications/mplay32/CMakeLists.txt b/base/applications/mplay32/CMakeLists.txt index 549df475a5e..5cacd87cf4d 100644 --- a/base/applications/mplay32/CMakeLists.txt +++ b/base/applications/mplay32/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(mplay32 mplay32.c mplay32.rc) set_module_type(mplay32 win32gui) add_importlibs(mplay32 advapi32 comctl32 comdlg32 user32 gdi32 winmm shell32 msvcrt kernel32) -add_cab_target(mplay32 1) +add_cd_file(TARGET mplay32 DESTINATION reactos/system32 FOR all) diff --git a/base/applications/mplay32/lang/sv-SE.rc b/base/applications/mplay32/lang/sv-SE.rc new file mode 100644 index 00000000000..42f5dc336d7 --- /dev/null +++ b/base/applications/mplay32/lang/sv-SE.rc @@ -0,0 +1,35 @@ +/* + * PROJECT: ReactOS RAPPS + * FILE: \base\applications\mplay32\lang\sv-SE.rc + * PURPOSE: Swedish resource file + * Translation: Jaix Bly + */ +LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL + +IDR_MAINMENU MENU +BEGIN + POPUP "&Arkiv" + BEGIN + MENUITEM "&Öppna...", IDM_OPEN_FILE + MENUITEM "&Stäng", IDM_CLOSE_FILE + MENUITEM SEPARATOR + MENUITEM "&Avsluta", IDM_EXIT + END + POPUP "&Hjälp" + BEGIN + MENUITEM "&Om...", IDM_ABOUT + END +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALL_TYPES_FILTER "Alla kompaktibla filer (*.wav, *.cda, *.midi, *.mid, *.avi)\0*.wav;*.cda;*.midi;*.mid;*.avi\0" + IDS_TOOLTIP_PLAY "Spela upp" + IDS_TOOLTIP_STOP "Stopp" + IDS_TOOLTIP_EJECT "Mata ut" + IDS_TOOLTIP_BACKWARD "Spola tillbaka" + IDS_TOOLTIP_SEEKBACK "Sök bakåt" + IDS_TOOLTIP_SEEKFORW "Sök framåt" + IDS_TOOLTIP_FORWARD "Spola fremåt" + IDS_APPTITLE "ReactOS Multimediaspelare" +END diff --git a/base/applications/mplay32/rsrc.rc b/base/applications/mplay32/rsrc.rc index 1bab33205be..0b15dfb63e4 100644 --- a/base/applications/mplay32/rsrc.rc +++ b/base/applications/mplay32/rsrc.rc @@ -8,10 +8,11 @@ #include "lang/es-ES.rc" #include "lang/fr-FR.rc" #include "lang/it-IT.rc" -// #include "lang/ja-JP.rc" FIXME: iconv issue +#include "lang/ja-JP.rc" #include "lang/nl-NL.rc" #include "lang/no-NO.rc" #include "lang/pl-PL.rc" #include "lang/ru-RU.rc" #include "lang/sk-SK.rc" +#include "lang/sv-SE.rc" #include "lang/uk-UA.rc" diff --git a/base/applications/msconfig/CMakeLists.txt b/base/applications/msconfig/CMakeLists.txt index 56134895e06..cf9c7e0d1ed 100644 --- a/base/applications/msconfig/CMakeLists.txt +++ b/base/applications/msconfig/CMakeLists.txt @@ -18,4 +18,4 @@ add_pch(msconfig ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE}) set_module_type(msconfig win32gui) add_importlibs(msconfig user32 advapi32 version comctl32 shell32 shlwapi msvcrt kernel32) -add_cab_target(msconfig 1) +add_cd_file(TARGET msconfig DESTINATION reactos/system32 FOR all) diff --git a/base/applications/msconfig/lang/sv-SE.rc b/base/applications/msconfig/lang/sv-SE.rc new file mode 100644 index 00000000000..927417287c1 --- /dev/null +++ b/base/applications/msconfig/lang/sv-SE.rc @@ -0,0 +1,180 @@ +/* + * PROJECT: ReactOS APPS + * FILE: \base\applications\msconfig\lang\sv-SE.rc + * PURPOSE: Swedish resource file + * Translation: Jaix Bly + */ +LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL + +IDD_MSCONFIG_DIALOG DIALOGEX DISCARDABLE 0, 0, 378, 220 +STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | + WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | + WS_THICKFRAME +CAPTION "Systemkonfigurastion" +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "Tab1",IDC_TAB,"SysTabControl32",WS_TABSTOP,2,2,374,195 + DEFPUSHBUTTON "OK", IDOK, 211, 201, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + PUSHBUTTON "&Hjälp", IDC_BTN_HELP, 2, 201, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + PUSHBUTTON "Avbryt", IDCANCEL, 267, 201, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + PUSHBUTTON "Verkställ", IDC_BTN_APPLY, 323, 201, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP +END + +IDD_STARTUP_PAGE DIALOGEX DISCARDABLE 0, 0, 362, 175 +STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "List3",IDC_STARTUP_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP, 2, 1, 360, 148 + PUSHBUTTON "&Aktivera allt",IDC_BTN_STARTUP_ACTIVATE,223,155,66,14 + PUSHBUTTON "&Inaktivera allt",IDC_BTN_STARTUP_DEACTIVATE,295,155,66,14 +END + +IDD_SYSTEM_PAGE DIALOGEX DISCARDABLE 0, 0, 362, 175 +STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "", 237, "SysTreeView32", TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_EDITLABELS | TVS_SHOWSELALWAYS | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 2, 1, 280, 148 + PUSHBUTTON "Flytta &upp", IDC_BTN_SYSTEM_UP, 290, 5, 66, 14 + PUSHBUTTON "Flytta &ner", IDC_BTN_SYSTEM_DOWN, 290, 25, 66, 14 + + PUSHBUTTON "&Aktivera", IDC_BTN_SYSTEM_ENABLE, 290, 50, 66, 14 + PUSHBUTTON "I&naktivera", IDC_BTN_SYSTEM_DISABLE, 290, 70, 66, 14 + + PUSHBUTTON "&Sök", IDC_BTN_SYSTEM_FIND, 290, 95, 66, 14 + PUSHBUTTON "&Ny", IDC_BTN_SYSTEM_NEW, 290, 115, 66, 14 + PUSHBUTTON "Re&digera", IDC_BTN_SYSTEM_EDIT, 290, 135, 66, 14 + + PUSHBUTTON "A&ktivera allt", IDC_BTN_SYSTEM_ACTIVATE, 123, 155, 66, 14 + PUSHBUTTON "I&naktivera allt",IDC_BTN_SYSTEM_DEACTIVATE, 195, 155, 66, 14 +END + +IDD_TOOLS_PAGE DIALOGEX DISCARDABLE 0, 0, 362, 175 +STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "List2",IDC_TOOLS_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP, 2, 1, 360, 134 + EDITTEXT IDC_TOOLS_CMDLINE, 1, 139, 360, 12, ES_READONLY + PUSHBUTTON "&Kör", IDC_BTN_RUN, 311, 155, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP +END + +IDD_SERVICES_PAGE DIALOGEX DISCARDABLE 0, 0, 362, 175 +STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "List1",IDC_SERVICES_LIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP,2,1,360,148 + PUSHBUTTON "&Aktivera allt",IDC_BTN_SERVICES_ACTIVATE,223,155,66,14 + PUSHBUTTON "&Inaktivera allt",IDC_BTN_SERVICES_DEACTIVATE,295,155,66,14 +END + +IDD_GENERAL_PAGE DIALOGEX DISCARDABLE 0, 0, 362, 175 +STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "MS Shell Dlg" +BEGIN + GROUPBOX "Uppstartsval", -1, 10, 10, 340, 150,0,WS_EX_TRANSPARENT + CONTROL "&Normal uppstart - ladda in alla drivrutiner och tjänster", IDC_CBX_NORMAL_START, "Button", 0x50010009, 20, 30, 236, 10 + CONTROL "&Diagnostisk uppstart - ladda bara in grundläggande drivrutiner och tjänster", IDC_CBX_DIAGNOSTIC_START, "Button", 0x50010009, 20, 45, 236, 10 + CONTROL "&Selektiv uppstart", IDC_CBX_SELECTIVE_STARTUP, "Button", 0x50010009, 20, 60, 70, 10 + AUTOCHECKBOX "L&adda in SYSTEM.INI Filen", IDC_CBX_SYSTEM_INI, 30, 80, 95, 10 + AUTOCHECKBOX "&Ladda in Systemtjänster", IDC_CBX_SYSTEM_SERVICE, 30, 95, 105, 10 + AUTOCHECKBOX "La&dda in uppstartsprylar", IDC_CBX_STARTUP_ITEM, 30, 110, 105, 10 +END + +IDD_FREELDR_PAGE DIALOGEX DISCARDABLE 0, 0, 362, 175 +STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "", IDC_LIST_BOX, "ListBox", 0x50010141, 10, 10, 340, 50, 0x00000200 + PUSHBUTTON "&Undersök alla bootvägar", IDC_BTN_CHECK_BOOT_PATH, 10, 65, 75, 12 + PUSHBUTTON "&Sätt som standard", IDC_BTN_SET_DEFAULT_BOOT, 100, 65, 70, 12 + PUSHBUTTON "Flytta &upp", IDC_BTN_MOVE_UP_BOOT_OPTION, 190, 65, 70, 12 + PUSHBUTTON "Flytta &ner", IDC_BTN_MOVE_DOWN_BOOT_OPTION, 280, 65, 70, 12 + GROUPBOX "Uppstarts alternativ", -1, 10, 80, 250, 95,0,WS_EX_TRANSPARENT + CHECKBOX "/Sä&ker uppstart", IDC_CBX_SAFE_BOOT, 15, 90, 95, 10 + CHECKBOX "/&Ingen grafisk uppstart", IDC_CBX_NO_GUI_BOOT, 15, 105, 95, 10 + CHECKBOX "/&Uppstartslogg", IDC_CBX_BOOT_LOG, 15, 120, 80, 10 + CHECKBOX "/Enkel &grafik", IDC_CBX_BASE_VIDEO, 15, 135, 95, 10 + CHECKBOX "/H&jälp", IDC_CBX_SOS, 15, 150, 50, 10 + PUSHBUTTON "Av&ancerade alternativ...", IDC_BTN_ADVANCED_OPTIONS, 100, 150, 93, 12 + LTEXT "&Timeout:", -1, 280, 91, 70, 10 + EDITTEXT IDC_TXT_BOOT_TIMEOUT, 280, 100, 25, 12, ES_LEFT + LTEXT "sekunder", -1, 310, 100, 85, 10 +END + +IDD_FREELDR_ADVANCED_PAGE DIALOGEX DISCARDABLE 0, 0, 175, 175 +STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "MS Shell Dlg" +BEGIN + CHECKBOX "/&Maximalt minnestorlek:=", IDC_CBX_MAX_MEM, 10, 10, 50, 10 + EDITTEXT IDC_TXT_MAX_MEM, 80, 10, 60, 12 + CONTROL "",IDC_SCR_MAX_MEM, "msctls_updown32", 0x50000000, 140, 10, 11, 11 + CHECKBOX "/&Antal processorer:=", IDC_CBX_NUM_PROC, 10, 25, 50, 10 + COMBOBOX IDC_DRP_NUM_PROC, 80, 25, 60, 10, CBS_DROPDOWNLIST | CBS_SORT | WS_CHILD | WS_VISIBLE | WS_TABSTOP + CHECKBOX "/&PCILOCK", IDC_CBX_PCI_LOCK, 10, 40, 50, 10 + CHECKBOX "/P&ROFIL", IDC_CBX_PROFILE, 10, 55, 50, 10 + CHECKBOX "/&IRQ", IDC_CBX_IRQ, 10, 70, 40, 12 + EDITTEXT IDC_TXT_IRQ, 80, 70, 60, 12, ES_LEFT + CHECKBOX "/&DEBUG", IDC_CBX_DEBUG, 10, 85, 40, 10 + CHECKBOX "/D&EBUGPORT", IDC_CBX_DEBUG_PORT, 20, 100, 60, 10 + COMBOBOX IDC_DRP_DEBUG_PORT, 80, 100, 60, 10, CBS_DROPDOWNLIST | CBS_SORT | WS_CHILD | WS_VISIBLE | WS_TABSTOP + CHECKBOX "/&BAUDRATE", IDC_CBX_BAUD_RATE, 20, 115, 50, 10 + COMBOBOX IDC_DRP_DRP_BAUD_RATE, 80, 115, 60, 10, CBS_DROPDOWNLIST | CBS_SORT | WS_CHILD | WS_VISIBLE | WS_TABSTOP + CHECKBOX "/&Kanal", IDC_CBX_CHANNEL, 20, 130, 50, 10 + EDITTEXT IDC_TXT_CHANNEL, 80, 130, 60, 12, ES_LEFT + CONTROL "",IDC_SCR_CHANNEL, "msctls_updown32", 0x50000000, 140, 130, 11, 11 + PUSHBUTTON "Ok", IDC_OK, 20, 160, 50, 12 + PUSHBUTTON "Avbryt", IDC_CANCEL, 100, 160, 50, 12 +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_MSCONFIG "Systemkonfiguration" + IDS_TAB_GENERAL "Generellt" + IDS_TAB_SYSTEM "SYSTEM.INI" + IDS_TAB_FREELDR "FREELDR.INI" + IDS_TAB_SERVICES "Tjänster" + IDS_TAB_STARTUP "Uppstart" + IDS_TAB_TOOLS "Verktyg" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICES_COLUMN_SERVICE "Tjänst" + IDS_SERVICES_COLUMN_REQ "Viktigt" + IDS_SERVICES_COLUMN_VENDOR "Tillverkare" + IDS_SERVICES_COLUMN_STATUS "Status" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_TOOLS_COLUMN_NAME "Namn" + IDS_TOOLS_COLUMN_DESCR "Beskrivning" + + IDS_TOOLS_CMD_NAME "Kommando prompt" + IDS_TOOLS_CMD_DESCR "Kommando tolk för att kontrollera systemet" + IDS_TOOLS_CMD_CMD "cmd.exe" + + IDS_TOOLS_INFO_NAME "Version" + IDS_TOOLS_INFO_DESCR "Visa version information." + IDS_TOOLS_INFO_CMD "winver.exe" + + IDS_TOOLS_REGEDIT_NAME "Registereditor" + IDS_TOOLS_REGEDIT_DESCR "Öppna registereditorn." + IDS_TOOLS_REGEDIT_CMD "regedit.exe" + + IDS_TOOLS_SYSDM_NAME "Systemegenskaper" + IDS_TOOLS_SYSDM_DESCR "Visa information om denna datorn." + IDS_TOOLS_SYSDM_CMD "control.exe" + IDS_TOOLS_SYSDM_PARAM "sysdm.cpl" + + IDS_STARTUP_COLUMN_ELEMENT "Element" + IDS_STARTUP_COLUMN_CMD "Kommando" + IDS_STARTUP_COLUMN_PATH "Plassering" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICES_STATUS_RUNNING "Körs" + IDS_SERVICES_STATUS_STOPPED "Stoppad" + IDS_SERVICES_YES "Ja" + IDS_SERVICES_UNKNOWN "Okänt" +END diff --git a/base/applications/msconfig/msconfig.c b/base/applications/msconfig/msconfig.c index 49f2e31229e..7f68f98c923 100644 --- a/base/applications/msconfig/msconfig.c +++ b/base/applications/msconfig/msconfig.c @@ -212,6 +212,13 @@ MsConfigWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) } break; + case WM_SYSCOLORCHANGE: + /* Forward WM_SYSCOLORCHANGE to common controls */ + SendMessage(hServicesListCtrl, WM_SYSCOLORCHANGE, 0, 0); + SendMessage(hStartupListCtrl, WM_SYSCOLORCHANGE, 0, 0); + SendMessage(hToolsListCtrl, WM_SYSCOLORCHANGE, 0, 0); + break; + case WM_DESTROY: if (hToolsPage) DestroyWindow(hToolsPage); diff --git a/base/applications/msconfig/rsrc.rc b/base/applications/msconfig/rsrc.rc index c4bee6fafd1..7acc79c64e3 100644 --- a/base/applications/msconfig/rsrc.rc +++ b/base/applications/msconfig/rsrc.rc @@ -28,6 +28,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL #include "lang/ro-RO.rc" #include "lang/ru-RU.rc" #include "lang/sk-SK.rc" +#include "lang/sv-SE.rc" #include "lang/th-TH.rc" #include "lang/uk-UA.rc" #include "lang/zh-CN.rc" diff --git a/base/applications/mscutils/devmgmt/CMakeLists.txt b/base/applications/mscutils/devmgmt/CMakeLists.txt index 26d97b28387..703c0e1dceb 100644 --- a/base/applications/mscutils/devmgmt/CMakeLists.txt +++ b/base/applications/mscutils/devmgmt/CMakeLists.txt @@ -15,4 +15,4 @@ add_pch(devmgmt ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE}) set_module_type(devmgmt win32gui) add_importlibs(devmgmt setupapi gdi32 user32 comctl32 advapi32 devmgr msvcrt kernel32) -add_cab_target(devmgmt 1) +add_cd_file(TARGET devmgmt DESTINATION reactos/system32 FOR all) diff --git a/base/applications/mscutils/devmgmt/lang/sv-SE.rc b/base/applications/mscutils/devmgmt/lang/sv-SE.rc new file mode 100644 index 00000000000..84b0652bbe6 --- /dev/null +++ b/base/applications/mscutils/devmgmt/lang/sv-SE.rc @@ -0,0 +1,88 @@ +/* + * PROJECT: ReactOS APPS + * FILE: \base\applications\mscutils\devmgmt\lang\sv-SE.rc + * PURPOSE: Swedish resource file + * Translation: Jaix Bly + */ +LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL + +IDR_MAINMENU MENU +BEGIN + POPUP "&Arkiv" + BEGIN + MENUITEM "A&vsluta", IDC_EXIT + END + POPUP "Åtgärd" + BEGIN + MENUITEM "Skriv ut", IDC_PRINT, GRAYED + MENUITEM SEPARATOR + MENUITEM "Egenskaper", IDC_PROP, GRAYED + MENUITEM SEPARATOR + MENUITEM "Hjälp", IDC_PROGHELP, GRAYED + END + POPUP "Visa" + BEGIN + MENUITEM "Enheter efter typ", IDC_DEVBYTYPE, CHECKED + MENUITEM "Enheter efter koppling", IDC_STATIC, GRAYED + MENUITEM "Resurcer efter typ", IDC_STATIC, GRAYED + MENUITEM "Resurcer efter koppling", IDC_STATIC, GRAYED + END + POPUP "Hjälp" + BEGIN + MENUITEM "Hjälp", IDC_PROGHELP + MENUITEM "Om", IDC_ABOUT + END +END + +IDR_POPUP MENU +BEGIN + POPUP "popup" + BEGIN + MENUITEM "Egenskaper", IDC_PROP, GRAYED + MENUITEM SEPARATOR + MENUITEM "Hjälp", IDC_PROGHELP + END +END + +IDD_ABOUTBOX DIALOGEX 22,16,190,182 +CAPTION "Om Enhetshanteraren" +FONT 8,"MS Shell Dlg",0,0 +STYLE DS_SHELLFONT | WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME +BEGIN + LTEXT "Enhetshanteraren v0.1\nCopyright (C) 2006\nby Ged Murphy (gedmurphy@gmail.com)", IDC_STATIC, 48, 7, 130, 30 + PUSHBUTTON "Stäng", IDOK, 75, 162, 44, 15 + ICON IDI_MAIN_ICON, IDC_STATIC, 10, 10, 7, 30 + EDITTEXT IDC_LICENSE_EDIT, 8, 44, 174, 107, WS_VISIBLE | WS_VSCROLL | WS_TABSTOP | ES_READONLY | ES_MULTILINE +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_LICENSE "Detta programmet är fri programvara; du kan distribuera det och/eller ändra det under villkoren enligt GNU General Public License som är utgivet av Free Software Foundation; version 2, eller (om du så önskar) alla senare versioner.\r\n\r\nDette programmet er utgivet i hopp om att det skall kunne användas, men DET FINNS INGA GARANTIER; även utan underförstådd garanti om SÄLJBARHET eller LÄMPLIGHET FÖR ETT VISST ÄNDAMÅL. Se på GNU General Public Licensen för mer detaljer.\r\n\r\nDu skall ha motagit en kopia av GNU General Public Licensen tillsammans med detta programmet; om du inte har fått det, skriv til Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_TOOLTIP_PROP "Egenskaper" + IDS_TOOLTIP_REFRESH "Uppdater" + IDS_TOOLTIP_HELP "Hjälp" + IDS_TOOLTIP_EXIT "Avsluta" +END + +/* Hints */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_APPNAME "ReactOS Enhetshanterare" + IDS_HINT_BLANK " " + IDS_HINT_EXIT " Avsluta programmet." + IDS_HINT_REFRESH " Uppdatera tjänstelistan." + IDS_HINT_PROP " Öppna egenskaper för markerat val." + IDS_HINT_HELP " Visa hjälpfönstret." + IDS_HINT_ABOUT " Om ReactOS Enhetshanterare." + + IDS_HINT_SYS_RESTORE " Återställ detta fönstret till normal storlek." + IDS_HINT_SYS_MOVE " Flytta detta fönstret." + IDS_HINT_SYS_SIZE " Ändra storleken på detta fönstret." + IDS_HINT_SYS_MINIMIZE " Minimera detta fönstret till en ikon." + IDS_HINT_SYS_MAXIMIZE " Maximera dette fönstret så det fyller hela skärmen." + IDS_HINT_SYS_CLOSE " Stäng detta fönstret." +END diff --git a/base/applications/mscutils/devmgmt/rsrc.rc b/base/applications/mscutils/devmgmt/rsrc.rc index b4cec35fbf3..8a264bdc40e 100644 --- a/base/applications/mscutils/devmgmt/rsrc.rc +++ b/base/applications/mscutils/devmgmt/rsrc.rc @@ -20,13 +20,13 @@ IDB_EXIT BITMAP DISCARDABLE "res/exit.bmp" #include "lang/fr-FR.rc" #include "lang/id-ID.rc" #include "lang/it-IT.rc" -//#include "lang/ja-JP.rc" FIXME: iconv issue +#include "lang/ja-JP.rc" #include "lang/ko-KR.rc" #include "lang/no-NO.rc" #include "lang/pl-PL.rc" #include "lang/ro-RO.rc" #include "lang/ru-RU.rc" #include "lang/sk-SK.rc" +#include "lang/sv-SE.rc" #include "lang/th-TH.rc" #include "lang/uk-UA.rc" - diff --git a/base/applications/mscutils/eventvwr/CMakeLists.txt b/base/applications/mscutils/eventvwr/CMakeLists.txt index 0e138af7910..ca96c17e8ae 100644 --- a/base/applications/mscutils/eventvwr/CMakeLists.txt +++ b/base/applications/mscutils/eventvwr/CMakeLists.txt @@ -10,4 +10,4 @@ if(MSVC) add_importlibs(eventvwr ntdll) endif() -add_cab_target(eventvwr 1) +add_cd_file(TARGET eventvwr DESTINATION reactos/system32 FOR all) diff --git a/base/applications/mscutils/eventvwr/eventvwr.c b/base/applications/mscutils/eventvwr/eventvwr.c index 658e4c280c4..7f0a5e51e2e 100644 --- a/base/applications/mscutils/eventvwr/eventvwr.c +++ b/base/applications/mscutils/eventvwr/eventvwr.c @@ -267,7 +267,7 @@ GetEventCategory(IN LPCWSTR KeyName, } else { - wcscpy(CategoryName, L"None"); + LoadStringW(hInst, IDS_NONE, CategoryName, MAX_PATH); } if (hLibrary != NULL) @@ -281,7 +281,7 @@ GetEventCategory(IN LPCWSTR KeyName, } } - wcscpy(CategoryName, L"None"); + LoadStringW(hInst, IDS_NONE, CategoryName, MAX_PATH); return FALSE; } @@ -597,9 +597,9 @@ QueryEventMessages(LPWSTR lpMachineName, while (dwRead > 0) { - wcscpy(szUsername , L"N/A"); - wcscpy(szEventText , L"N/A"); - wcscpy(szCategory , L"None"); + LoadStringW(hInst, IDS_NOT_AVAILABLE, szUsername, MAX_PATH); + LoadStringW(hInst, IDS_NOT_AVAILABLE, szEventText, MAX_PATH); + LoadStringW(hInst, IDS_NONE, szCategory, MAX_PATH); // Get the event source name. lpSourceName = (LPWSTR)((LPBYTE)pevlr + sizeof(EVENTLOGRECORD)); @@ -1142,6 +1142,7 @@ DisplayEvent(HWND hDlg) SetDlgItemTextW(hDlg, IDC_EVENTDATESTATIC, szDate); SetDlgItemTextW(hDlg, IDC_EVENTTIMESTATIC, szTime); + SetDlgItemTextW(hDlg, IDC_EVENTUSERSTATIC, szUser); SetDlgItemTextW(hDlg, IDC_EVENTSOURCESTATIC, szSource); SetDlgItemTextW(hDlg, IDC_EVENTCOMPUTERSTATIC, szComputer); diff --git a/base/applications/mscutils/eventvwr/lang/bg-BG.rc b/base/applications/mscutils/eventvwr/lang/bg-BG.rc index c8e9e673a85..638bd578411 100644 --- a/base/applications/mscutils/eventvwr/lang/bg-BG.rc +++ b/base/applications/mscutils/eventvwr/lang/bg-BG.rc @@ -108,3 +108,9 @@ BEGIN IDS_COLUMNCOMPUTER "Êîìïþòúð" IDS_COLUMNEVENTDATA "Äàííè çà ñúáèòèåòî" END + +STRINGTABLE +BEGIN + IDS_NONE "None" + IDS_NOT_AVAILABLE "N/A" +END diff --git a/base/applications/mscutils/eventvwr/lang/de-DE.rc b/base/applications/mscutils/eventvwr/lang/de-DE.rc index 58dada9aa8b..a52269f750d 100644 --- a/base/applications/mscutils/eventvwr/lang/de-DE.rc +++ b/base/applications/mscutils/eventvwr/lang/de-DE.rc @@ -115,3 +115,9 @@ BEGIN IDS_COLUMNCOMPUTER "Computer" IDS_COLUMNEVENTDATA "Ereignisdaten" END + +STRINGTABLE +BEGIN + IDS_NONE "Keine" + IDS_NOT_AVAILABLE "Nicht verfügbar" +END diff --git a/base/applications/mscutils/eventvwr/lang/el-GR.rc b/base/applications/mscutils/eventvwr/lang/el-GR.rc index abbd7922319..48c8aa4a38e 100644 --- a/base/applications/mscutils/eventvwr/lang/el-GR.rc +++ b/base/applications/mscutils/eventvwr/lang/el-GR.rc @@ -115,3 +115,9 @@ BEGIN IDS_COLUMNCOMPUTER "Computer" IDS_COLUMNEVENTDATA "Event Data" END + +STRINGTABLE +BEGIN + IDS_NONE "None" + IDS_NOT_AVAILABLE "N/A" +END diff --git a/base/applications/mscutils/eventvwr/lang/en-US.rc b/base/applications/mscutils/eventvwr/lang/en-US.rc index fc19d72139f..396bc14c017 100644 --- a/base/applications/mscutils/eventvwr/lang/en-US.rc +++ b/base/applications/mscutils/eventvwr/lang/en-US.rc @@ -115,3 +115,9 @@ BEGIN IDS_COLUMNCOMPUTER "Computer" IDS_COLUMNEVENTDATA "Event Data" END + +STRINGTABLE +BEGIN + IDS_NONE "None" + IDS_NOT_AVAILABLE "N/A" +END diff --git a/base/applications/mscutils/eventvwr/lang/es-ES.rc b/base/applications/mscutils/eventvwr/lang/es-ES.rc index 2de3ec360b8..486746ddb15 100644 --- a/base/applications/mscutils/eventvwr/lang/es-ES.rc +++ b/base/applications/mscutils/eventvwr/lang/es-ES.rc @@ -115,3 +115,9 @@ BEGIN IDS_COLUMNCOMPUTER "Computadora" IDS_COLUMNEVENTDATA "Datos del evento" END + +STRINGTABLE +BEGIN + IDS_NONE "Ninguna" + IDS_NOT_AVAILABLE "N/A" +END diff --git a/base/applications/mscutils/eventvwr/lang/fr-FR.rc b/base/applications/mscutils/eventvwr/lang/fr-FR.rc index 54ad9cae749..2c9eeac7d73 100644 --- a/base/applications/mscutils/eventvwr/lang/fr-FR.rc +++ b/base/applications/mscutils/eventvwr/lang/fr-FR.rc @@ -115,3 +115,9 @@ BEGIN IDS_COLUMNCOMPUTER "Ordinateur" IDS_COLUMNEVENTDATA "Données" END + +STRINGTABLE +BEGIN + IDS_NONE "None" + IDS_NOT_AVAILABLE "N/A" +END diff --git a/base/applications/mscutils/eventvwr/lang/it-IT.rc b/base/applications/mscutils/eventvwr/lang/it-IT.rc index 6bfa290275c..0f0166c68ea 100644 --- a/base/applications/mscutils/eventvwr/lang/it-IT.rc +++ b/base/applications/mscutils/eventvwr/lang/it-IT.rc @@ -43,7 +43,7 @@ CAPTION "Informazioni su" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN ICON IDI_EVENTVWR,IDC_MYICON,14,9,21,20 - LTEXT "ReactOS Visualizzatore eventi Version 1.0",IDC_STATIC,49,10,119,8,SS_NOPREFIX + LTEXT "ReactOS Visualizzatore eventi Versione 1.0",IDC_STATIC,49,10,119,8,SS_NOPREFIX LTEXT "Copyright (C) 2007 Marc Piulachs (marc.piulachs@codexchange.net)",IDC_STATIC,49,20,119,22 DEFPUSHBUTTON "OK",IDOK,90,48,42,16,WS_GROUP END @@ -115,3 +115,9 @@ BEGIN IDS_COLUMNCOMPUTER "Computer" IDS_COLUMNEVENTDATA "Dati Evento" END + +STRINGTABLE +BEGIN + IDS_NONE "Nessuna" + IDS_NOT_AVAILABLE "N/A" +END diff --git a/base/applications/mscutils/eventvwr/lang/ja-JP.rc b/base/applications/mscutils/eventvwr/lang/ja-JP.rc index ffd1e6a86e5..29552903f71 100644 --- a/base/applications/mscutils/eventvwr/lang/ja-JP.rc +++ b/base/applications/mscutils/eventvwr/lang/ja-JP.rc @@ -115,3 +115,9 @@ BEGIN IDS_COLUMNCOMPUTER "Computer" IDS_COLUMNEVENTDATA "Event Data" END + +STRINGTABLE +BEGIN + IDS_NONE "None" + IDS_NOT_AVAILABLE "N/A" +END diff --git a/base/applications/mscutils/eventvwr/lang/ko-KR.rc b/base/applications/mscutils/eventvwr/lang/ko-KR.rc index ba1228a040d..843a2319f17 100644 --- a/base/applications/mscutils/eventvwr/lang/ko-KR.rc +++ b/base/applications/mscutils/eventvwr/lang/ko-KR.rc @@ -111,3 +111,9 @@ BEGIN IDS_COLUMNCOMPUTER "Computer" IDS_COLUMNEVENTDATA "Event Data" END + +STRINGTABLE +BEGIN + IDS_NONE "None" + IDS_NOT_AVAILABLE "N/A" +END diff --git a/base/applications/mscutils/eventvwr/lang/no-NO.rc b/base/applications/mscutils/eventvwr/lang/no-NO.rc index 3c6561bb9e7..3022d16cac7 100644 --- a/base/applications/mscutils/eventvwr/lang/no-NO.rc +++ b/base/applications/mscutils/eventvwr/lang/no-NO.rc @@ -115,3 +115,9 @@ BEGIN IDS_COLUMNCOMPUTER "Computer" IDS_COLUMNEVENTDATA "Event Data" END + +STRINGTABLE +BEGIN + IDS_NONE "None" + IDS_NOT_AVAILABLE "N/A" +END diff --git a/base/applications/mscutils/eventvwr/lang/pl-PL.rc b/base/applications/mscutils/eventvwr/lang/pl-PL.rc index 05c7c256f08..8ddf4c83248 100644 --- a/base/applications/mscutils/eventvwr/lang/pl-PL.rc +++ b/base/applications/mscutils/eventvwr/lang/pl-PL.rc @@ -4,7 +4,7 @@ * FILE: base/applications/mscutils/eventvwr/lang/en-US.rc * PURPOSE: English Language File for ReactOS Event Viewer * - * translated by Caemyr - Olaf Siejka (Dec,2007) + * translated by Caemyr - Olaf Siejka (Dec,2007;May,2011) * Use ReactOS forum PM or IRC to contact me * http://www.reactos.org * IRC: irc.freenode.net #reactos-pl; @@ -119,3 +119,9 @@ BEGIN IDS_COLUMNCOMPUTER "Komputer" IDS_COLUMNEVENTDATA "Dane zdarzenia" END + +STRINGTABLE +BEGIN + IDS_NONE "Brak" + IDS_NOT_AVAILABLE "N/A" +END diff --git a/base/applications/mscutils/eventvwr/lang/ro-RO.rc b/base/applications/mscutils/eventvwr/lang/ro-RO.rc index 7014f5b4937..0d70d059739 100644 --- a/base/applications/mscutils/eventvwr/lang/ro-RO.rc +++ b/base/applications/mscutils/eventvwr/lang/ro-RO.rc @@ -115,3 +115,9 @@ BEGIN IDS_COLUMNCOMPUTER "Computer" IDS_COLUMNEVENTDATA "Event Data" END + +STRINGTABLE +BEGIN + IDS_NONE "None" + IDS_NOT_AVAILABLE "N/A" +END diff --git a/base/applications/mscutils/eventvwr/lang/ru-RU.rc b/base/applications/mscutils/eventvwr/lang/ru-RU.rc index 59dce435d37..e2c6cb2f714 100644 --- a/base/applications/mscutils/eventvwr/lang/ru-RU.rc +++ b/base/applications/mscutils/eventvwr/lang/ru-RU.rc @@ -115,3 +115,9 @@ BEGIN IDS_COLUMNCOMPUTER "Computer" IDS_COLUMNEVENTDATA "Event Data" END + +STRINGTABLE +BEGIN + IDS_NONE "None" + IDS_NOT_AVAILABLE "N/A" +END diff --git a/base/applications/mscutils/eventvwr/lang/sk-SK.rc b/base/applications/mscutils/eventvwr/lang/sk-SK.rc index a0a6817edf3..8f57f621095 100644 --- a/base/applications/mscutils/eventvwr/lang/sk-SK.rc +++ b/base/applications/mscutils/eventvwr/lang/sk-SK.rc @@ -112,3 +112,9 @@ BEGIN IDS_COLUMNCOMPUTER "Computer" IDS_COLUMNEVENTDATA "Event Data" END + +STRINGTABLE +BEGIN + IDS_NONE "None" + IDS_NOT_AVAILABLE "N/A" +END diff --git a/base/applications/mscutils/eventvwr/lang/sv-SE.rc b/base/applications/mscutils/eventvwr/lang/sv-SE.rc new file mode 100644 index 00000000000..7dbd9718a69 --- /dev/null +++ b/base/applications/mscutils/eventvwr/lang/sv-SE.rc @@ -0,0 +1,123 @@ +/* + * PROJECT: ReactOS Event Viewer + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/applications/mscutils/eventvwr/lang/en-US.rc + * PURPOSE: Swedish Language File for ReactOS Event Viewer + * TRANSLATORS: Jaix Bly + */ + +LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL + +IDC_EVENTVWR MENU +BEGIN + POPUP "&Logg" + BEGIN + MENUITEM "&Applikation", ID_LOG_APPLICATION + MENUITEM "&Säkerhet", ID_LOG_SECURITY + MENUITEM "&System", ID_LOG_SYSTEM + MENUITEM SEPARATOR + MENUITEM "A&vsluta", IDM_EXIT + END + POPUP "&Visa" + BEGIN + MENUITEM "&Uppdatera", IDM_REFRESH + END + MENUITEM "&Åtgärd", ID_OPTIONS + POPUP "&Hjälp" + BEGIN + MENUITEM "Hj&älp", IDM_HELP + MENUITEM SEPARATOR + MENUITEM "&Om...", IDM_ABOUT + END +END + +IDC_EVENTVWR ACCELERATORS +BEGIN + "?", IDM_ABOUT, ASCII, ALT + "/", IDM_ABOUT, ASCII, ALT +END + +IDD_ABOUTBOX DIALOGEX 0, 0, 230, 75 +STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "Om" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + ICON IDI_EVENTVWR,IDC_MYICON,14,9,21,20 + LTEXT "ReactOS Händelselogg Versjon 1.0",IDC_STATIC,49,10,119,8,SS_NOPREFIX + LTEXT "Copyright (C) 2007 Marc Piulachs (marc.piulachs@codexchange.net)",IDC_STATIC,49,20,119,22 + DEFPUSHBUTTON "OK",IDOK,90,48,42,16,WS_GROUP +END + +IDD_PROGRESSBOX DIALOGEX 0, 0, 230, 40 +STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER +CAPTION "Vänta.." +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + CTEXT "Laddar in Händelseloggen. Vänligen vänta...",IDC_STATIC,0,15,230,8,SS_NOPREFIX +END + +IDD_EVENTDETAILDIALOG DIALOGEX 0, 0, 276, 282 +STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTEXTHELP +CAPTION "Händelsedetaljer" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + DEFPUSHBUTTON "&Stäng",IDOK,12,258,50,14 + PUSHBUTTON "&Föregående",IDPREVIOUS,78,258,50,14 + PUSHBUTTON "&Näste",IDNEXT,144,258,50,14 + PUSHBUTTON "&Hjälp",IDHELP,210,258,50,14 + EDITTEXT IDC_EVENTTEXTEDIT,14,81,247,108,ES_MULTILINE | ES_READONLY + LTEXT "&Beskrivning:",IDC_STATIC,15,70,39,8 + LTEXT "Datum:",IDC_STATIC,14,14,36,8 + LTEXT "Static",IDC_EVENTDATESTATIC,56,14,72,8 + LTEXT "Tid:",IDC_STATIC,14,27,36,8 + LTEXT "Static",IDC_EVENTTIMESTATIC,56,27,72,8 + LTEXT "&Användare:",IDC_STATIC,14,41,36,8 + LTEXT "Static",IDC_EVENTUSERSTATIC,56,41,72,8 + LTEXT "&Dator:",IDC_STATIC,14,54,36,8 + LTEXT "Static",IDC_EVENTCOMPUTERSTATIC,56,54,72,8 + LTEXT "Händelse ID:",IDC_STATIC,133,15,36,8 + LTEXT "Static",IDC_EVENTIDSTATIC,175,15,87,8 + LTEXT "Källa:",IDC_STATIC,133,28,36,8 + LTEXT "Static",IDC_EVENTSOURCESTATIC,175,28,87,8 + LTEXT "Type:",IDC_STATIC,133,42,36,8 + LTEXT "Static",IDC_EVENTTYPESTATIC,175,42,87,8 + LTEXT "Kategori:",IDC_STATIC,133,55,36,8 + LTEXT "Static",IDC_EVENTCATEGORYSTATIC,175,55,87,8 + EDITTEXT IDC_EVENTDATAEDIT,14,204,247,44,ES_MULTILINE | ES_READONLY + LTEXT "D&ata",IDC_STATIC,14,194,20,8 + CONTROL "&Byte",IDC_BYTESRADIO,"Button",BS_AUTORADIOBUTTON,39,194,34,10 + CONTROL "&Ord",IDC_WORDRADIO,"Button",BS_AUTORADIOBUTTON,77,194,33,10 +END + +STRINGTABLE +BEGIN + IDS_APP_TITLE "Händelselogg" + IDS_EVENTSTRINGIDNOTFOUND "Beskrivning av Händelse ID ( %lu ) i källan ( %s ) kan inte hittas. Lokal dator har inte nödvendig registerinformation eller meddelander DLL filer for å vise meddelander från en fjärr dator." + IDS_EVENTLOG_ERROR_TYPE "Fel" + IDS_EVENTLOG_WARNING_TYPE "Varning" + IDS_EVENTLOG_INFORMATION_TYPE "Information" + IDS_EVENTLOG_AUDIT_SUCCESS "Revision lyckades" + IDS_EVENTLOG_AUDIT_FAILURE "Revision misslyckades" + IDS_EVENTLOG_SUCCESS "Uppgift lyckades" + IDS_EVENTLOG_UNKNOWN_TYPE "Okänd händelse" +END + +STRINGTABLE +BEGIN + IDS_COLUMNTYPE "Typ" + IDS_COLUMNDATE "Datum" + IDS_COLUMNTIME "Tid" + IDS_COLUMNSOURCE "Källa" + IDS_COLUMNCATEGORY "Kategori" + IDS_COLUMNEVENT "Händelse" + IDS_COLUMNUSER "Användare" + IDS_COLUMNCOMPUTER "Dator" + IDS_COLUMNEVENTDATA "Händelsedata" +END + +STRINGTABLE +BEGIN + IDS_NONE "None" + IDS_NOT_AVAILABLE "N/A" +END diff --git a/base/applications/mscutils/eventvwr/lang/uk-UA.rc b/base/applications/mscutils/eventvwr/lang/uk-UA.rc index 55f31d90528..8a703aecf5c 100644 --- a/base/applications/mscutils/eventvwr/lang/uk-UA.rc +++ b/base/applications/mscutils/eventvwr/lang/uk-UA.rc @@ -115,3 +115,9 @@ BEGIN IDS_COLUMNCOMPUTER "Êîìï'þòåð" IDS_COLUMNEVENTDATA "Äàí³ ïî䳿" END + +STRINGTABLE +BEGIN + IDS_NONE "None" + IDS_NOT_AVAILABLE "N/A" +END diff --git a/base/applications/mscutils/eventvwr/resource.h b/base/applications/mscutils/eventvwr/resource.h index b6869b22fc0..93f2a868264 100644 --- a/base/applications/mscutils/eventvwr/resource.h +++ b/base/applications/mscutils/eventvwr/resource.h @@ -64,3 +64,6 @@ #define IDS_COLUMNCOMPUTER 307 #define IDS_COLUMNEVENTDATA 308 +#define IDS_NONE 320 +#define IDS_NOT_AVAILABLE 321 + diff --git a/base/applications/mscutils/eventvwr/rsrc.rc b/base/applications/mscutils/eventvwr/rsrc.rc index b109367a7e6..a3b864ed86a 100644 --- a/base/applications/mscutils/eventvwr/rsrc.rc +++ b/base/applications/mscutils/eventvwr/rsrc.rc @@ -16,12 +16,13 @@ IDI_ERRORICON ICON "res/error.ico" #include "lang/es-ES.rc" #include "lang/fr-FR.rc" #include "lang/it-IT.rc" -//#include "lang/ja-JP.rc" FIXME: iconv issue +#include "lang/ja-JP.rc" #include "lang/ko-KR.rc" #include "lang/no-NO.rc" -//#include "lang/pl-PL.rc" FIXME: iconv issue +#include "lang/pl-PL.rc" #include "lang/ro-RO.rc" #include "lang/ru-RU.rc" #include "lang/sk-SK.rc" +#include "lang/sv-SE.rc" #include "lang/uk-UA.rc" diff --git a/base/applications/mscutils/servman/CMakeLists.txt b/base/applications/mscutils/servman/CMakeLists.txt index 3cf667b7290..87bd84b08d1 100644 --- a/base/applications/mscutils/servman/CMakeLists.txt +++ b/base/applications/mscutils/servman/CMakeLists.txt @@ -32,4 +32,4 @@ set_module_type(servman win32gui) add_importlibs(servman user32 gdi32 advapi32 version comctl32 shell32 comdlg32 msvcrt kernel32) -add_cab_target(servman 1) +add_cd_file(TARGET servman DESTINATION reactos/system32 FOR all) diff --git a/base/applications/mscutils/servman/lang/sv-SE.rc b/base/applications/mscutils/servman/lang/sv-SE.rc new file mode 100644 index 00000000000..39553bacfbf --- /dev/null +++ b/base/applications/mscutils/servman/lang/sv-SE.rc @@ -0,0 +1,288 @@ +/* + * PROJECT: ReactOS APPS + * FILE: \base\applications\mscutils\servman\lang\sv-SE.rc + * PURPOSE: Swedish resource file + * Translation: Jaix Bly + */ +LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL + +IDR_MAINMENU MENU +BEGIN + POPUP "&Arkiv" + BEGIN + MENUITEM "Exportera...", ID_EXPORT + MENUITEM SEPARATOR + MENUITEM "A&vsluta", ID_EXIT + END + POPUP "Åtgärd" + BEGIN + MENUITEM "Koppla till...", ID_CONNECT, GRAYED + MENUITEM SEPARATOR + MENUITEM "Starta", ID_START, GRAYED + MENUITEM "Stoppa", ID_STOP, GRAYED + MENUITEM "Pausa", ID_PAUSE, GRAYED + MENUITEM "Fortsätta", ID_RESUME, GRAYED + MENUITEM "Starta om", ID_RESTART, GRAYED + MENUITEM SEPARATOR + MENUITEM "Uppdatera", ID_REFRESH + MENUITEM SEPARATOR + MENUITEM "Redigera...", ID_EDIT, GRAYED + MENUITEM "Skapa...", ID_CREATE, GRAYED + MENUITEM "Ta bort...", ID_DELETE, GRAYED + MENUITEM SEPARATOR + MENUITEM "Egenskaper...", ID_PROP, GRAYED + END + POPUP "Visa" + BEGIN + MENUITEM "Stora ikoner", ID_VIEW_LARGE + MENUITEM "Små ikoner", ID_VIEW_SMALL + MENUITEM "Lista", ID_VIEW_LIST + MENUITEM "Detaljer", ID_VIEW_DETAILS + MENUITEM SEPARATOR + MENUITEM "Anpassa...",ID_VIEW_CUST, GRAYED + END + POPUP "Hjälp" + BEGIN + MENUITEM "Hjälp", ID_HELP + MENUITEM "Om", ID_ABOUT + END +END + +IDR_POPUP MENU +BEGIN + POPUP "popup" + BEGIN + MENUITEM "Starta", ID_START, GRAYED + MENUITEM "Stoppa", ID_STOP, GRAYED + MENUITEM "Pausa", ID_PAUSE, GRAYED + MENUITEM "Fortsätta", ID_RESUME, GRAYED + MENUITEM "Starta om", ID_RESTART, GRAYED + MENUITEM SEPARATOR + MENUITEM "Uppdatera", ID_REFRESH + MENUITEM SEPARATOR + MENUITEM "Redigera...", ID_EDIT, GRAYED + MENUITEM "Ta bort...", ID_DELETE, GRAYED + MENUITEM SEPARATOR + MENUITEM "Egenskaper...", ID_PROP, GRAYED + MENUITEM SEPARATOR + MENUITEM "Hjälp...", ID_HELP + END +END + +IDD_ABOUTBOX DIALOGEX 22,16,190,182 +CAPTION "Om Tjänster" +FONT 8, "MS Shell Dlg",0,0 +STYLE DS_SHELLFONT | WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME +BEGIN + LTEXT "Tjänster v0.8\nCopyright (C) 2005-2007\nby Ged Murphy (gedmurphy@reactos.org)", IDC_STATIC, 48, 7, 135, 30 + PUSHBUTTON "Stäng", IDOK, 75, 162, 44, 15 + ICON IDI_SM_ICON, IDC_STATIC, 10, 10, 7, 30 + EDITTEXT IDC_LICENSE_EDIT, 8, 44, 174, 107, WS_VISIBLE | WS_VSCROLL | WS_TABSTOP | ES_READONLY | ES_MULTILINE +END + +IDD_DLG_GENERAL DIALOGEX 6, 6, 253, 232 +CAPTION "Allmännt" +FONT 8, "MS Shell Dlg",0,0 +STYLE DS_SHELLFONT | WS_BORDER | WS_VISIBLE | WS_DLGFRAME | WS_SYSMENU | WS_THICKFRAME | WS_GROUP | WS_TABSTOP +BEGIN + LTEXT "", IDC_SERV_NAME, 70,11,176,11, WS_CHILD | WS_VISIBLE + EDITTEXT IDC_DISP_NAME, 70, 29, 176, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_READONLY + EDITTEXT IDC_DESCRIPTION, 70, 46, 176, 24, WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP | ES_MULTILINE | ES_READONLY + EDITTEXT IDC_EXEPATH, 6, 86, 240, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_READONLY + COMBOBOX IDC_START_TYPE, 70, 107, 176, 40, WS_CHILD | WS_VISIBLE | WS_TABSTOP | CBS_DROPDOWNLIST + PUSHBUTTON "Starta", IDC_START, 6, 155, 54, 15, WS_DISABLED + PUSHBUTTON "Stoppa", IDC_STOP, 68, 155, 54, 15, WS_DISABLED + PUSHBUTTON "Pausa", IDC_PAUSE , 130, 155, 54, 15, WS_DISABLED + PUSHBUTTON "Fortsätta", IDC_RESUME, 192, 155, 54, 15, WS_DISABLED + LTEXT "Tjänstenamn:", IDC_STATIC, 4, 11, 53, 11 + LTEXT "Visningsnamn:", IDC_STATIC, 4, 29, 53, 11 + LTEXT "Beskrivning:", IDC_STATIC, 4, 51, 53, 11 + LTEXT "Väg till körbar fil:", IDC_STATIC, 6, 73, 82, 9 + LTEXT "Startmetod:", IDC_STATIC, 6, 108, 53, 11 + LTEXT "Tjänstestatus:", IDC_STATIC, 4, 138, 53, 11 + LTEXT "", IDC_SERV_STATUS, 70, 138, 176, 11, WS_CHILD | WS_VISIBLE + LTEXT "Du kan ange startparametrar som gäller när du startar tjänsten härifrån.",IDC_STATIC, 6,177,240,15 + LTEXT "startparametrar:", IDC_STATIC, 6, 200, 58, 11 + EDITTEXT IDC_START_PARAM, 68, 199, 178, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP + PUSHBUTTON "Redigera", IDC_EDIT, 192, 215, 54, 15, WS_DISABLED +END + +IDD_DLG_DEPEND DIALOGEX 6,6,253,225 +CAPTION "Beroenden" +FONT 8, "MS Shell Dlg",0,0 +STYLE DS_SHELLFONT | WS_BORDER | WS_VISIBLE | WS_DLGFRAME | WS_SYSMENU | WS_THICKFRAME | WS_GROUP | WS_TABSTOP +BEGIN + CONTROL "", IDC_DEPEND_TREE1, "SysTreeView32" , WS_BORDER | WS_CHILDWINDOW | WS_VISIBLE | WS_TABSTOP | TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_DISABLEDRAGDROP, 8, 70, 236, 68 + CONTROL "", IDC_DEPEND_TREE2, "SysTreeView32", WS_BORDER | WS_CHILDWINDOW | WS_VISIBLE | WS_TABSTOP | TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_DISABLEDRAGDROP, 8, 151, 234, 67 + LTEXT "Några tjänster är beroende av andra tjänster, systemdrivrutiner och laddsystemsgrupper. Om systemkomponenten är stoppad eller inte kör korrekt, kan tjänster som är beroende av den bli påverkade.", IDC_STATIC,8, 7, 238, 26 + LTEXT "Denna tjänsten är beroende av följande komponenter", IDC_STATIC, 8, 57, 236, 9 + LTEXT "", IDC_DEPEND_SERVICE, 8, 38, 236, 13 +END + +IDD_DLG_CREATE DIALOGEX 6,6,225,209 +CAPTION "Skapa en tjänst" +FONT 8, "MS Shell Dlg",0,0 +STYLE DS_SHELLFONT | WS_BORDER | WS_VISIBLE | WS_DLGFRAME | WS_SYSMENU | WS_THICKFRAME | WS_GROUP | WS_TABSTOP +BEGIN + EDITTEXT IDC_CREATE_SERVNAME, 72, 12, 150, 11, WS_CHILD | WS_VISIBLE | WS_EX_CLIENTEDGE + EDITTEXT IDC_CREATE_DISPNAME, 72, 31, 150, 11, WS_CHILD | WS_VISIBLE + EDITTEXT IDC_CREATE_PATH, 10, 62, 210, 13, WS_CHILD | WS_VISIBLE + EDITTEXT IDC_CREATE_DESC, 10, 97, 210, 48, WS_CHILD | WS_VISIBLE + EDITTEXT IDC_CREATE_OPTIONS, 10, 162, 210, 13, WS_CHILD | WS_VISIBLE + LTEXT "*Tjänstenamn:", IDC_STATIC, 12, 12, 54, 9 + LTEXT "*Visningsnamn:", IDC_STATIC, 12, 33, 54, 9 + LTEXT "*Väg till körbar fil:", IDC_STATIC, 10, 51, 68, 9 + LTEXT "Beskrivning:", IDC_STATIC, 12, 86, 44, 9 + PUSHBUTTON "OK", IDOK, 126, 192, 44, 13 + PUSHBUTTON "Avbryt", IDCANCEL, 176, 192, 46, 13 + LTEXT "'Ytterligere val (klicka hjälp för detaljer)", IDC_STATIC, 10, 151, 134, 9 + PUSHBUTTON "Hjälp", ID_CREATE_HELP, 10, 192, 44, 13 +END + +IDD_DLG_DELETE DIALOGEX 6,6,185,148 +CAPTION "Ta bort en tjänt" +FONT 8, "MS Shell Dlg",0,0 +STYLE DS_SHELLFONT | WS_BORDER | WS_DLGFRAME | DS_MODALFRAME +BEGIN + ICON IDI_WARNING, IDC_STATIC, 10, 8, 24, 22 + LTEXT "Är du säker på att du vill ta bort denna tjänsten? Detta kan inte ångras när den blivit raderad!", IDC_STATIC, 50, 6, 125, 25 + LTEXT "Tjönstenamn:",IDC_STATIC, 6, 40, 80, 9 + LTEXT "", IDC_DEL_NAME, 15, 53, 160, 15 + EDITTEXT IDC_DEL_DESC, 6, 73, 174, 48, WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_EX_STATICEDGE | ES_MULTILINE | ES_READONLY + PUSHBUTTON "Ja", IDOK, 26, 129, 54, 13 + DEFPUSHBUTTON "Nej", IDCANCEL, 102, 129, 54, 13 +END + +IDD_DLG_DEPEND_STOP DIALOGEX 6,6,240,148 +CAPTION "Stoppa Annan Tjänst" +FONT 8, "MS Shell Dlg",0,0 +STYLE DS_SHELLFONT | WS_BORDER | WS_DLGFRAME | DS_MODALFRAME +BEGIN + ICON IDI_WARNING, IDC_STATIC, 10, 8, 24, 22 + LTEXT "", IDC_STOP_DEPENDS, 40, 8, 170, 25 + LISTBOX IDC_STOP_DEPENDS_LB, 15, 40, 210, 70, WS_CHILD | WS_VISIBLE | WS_EX_STATICEDGE | LBS_NOSEL + LTEXT "Vill du stoppa dessa tjänster?",IDC_STATIC, 15, 110, 150, 10 + DEFPUSHBUTTON "Ja", IDOK, 60, 129, 54, 14 + PUSHBUTTON "Nej", IDCANCEL, 120, 129, 54, 14 +END + +IDD_DLG_HELP_OPTIONS DIALOGEX 6,6,200,150 +CAPTION "Val" +FONT 8, "MS Shell Dlg",0,0 +STYLE 0x10CF0000 +BEGIN + LTEXT "", IDC_CREATE_HELP, 6, 5, 200, 150 + PUSHBUTTON "Ok", IDOK, 75, 130, 44, 13 +END + +IDD_DLG_PROGRESS DIALOGEX 6,6,255,89 +CAPTION "Tjänst kontroll" +FONT 8, "MS Shell Dlg",0,0 +STYLE DS_SHELLFONT | WS_BORDER | WS_DLGFRAME | WS_SYSMENU | WS_VISIBLE | DS_MODALFRAME +EXSTYLE WS_EX_TOOLWINDOW +BEGIN + CONTROL "", IDC_SERVCON_PROGRESS, "msctls_progress32", 0x50000000, 8, 46, 238, 13 + LTEXT "", IDC_SERVCON_INFO, 8, 5, 236, 11 + LTEXT "", IDC_SERVCON_NAME, 8, 25, 66, 11 + PUSHBUTTON "&Stäng", IDOK, 100, 70, 54, 13 +END + + + +STRINGTABLE DISCARDABLE +BEGIN + IDS_FIRSTCOLUMN "Namn" + IDS_SECONDCOLUMN "Beskrivning" + IDS_THIRDCOLUMN "Status" + IDS_FOURTHCOLUMN "Startmetod" + IDS_FITHCOLUMN "Logga på som" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICES_STARTED "Startad" + IDS_SERVICES_STOPPED "Stoppad" + IDS_SERVICES_AUTO "Automatisk" + IDS_SERVICES_MAN "Manuell" + IDS_SERVICES_DIS "Inaktiverad" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_NUM_SERVICES "Num tjänster: %d" + IDS_STOP_DEPENDS "När %s stoppas, kommer också dessa tjänster att stanna" + IDS_NO_DEPENDS "" + IDS_LICENSE "Detta programmet är fri programvara; du kan distribuera det och/eller ändra det under villkoren enligt GNU General Public License som är utgivet av Free Software Foundation; version 2, eller (om du så önskar) alla senare versioner.\r\n\r\nDette programmet er utgivet i hopp om att det skall kunne användas, men DET FINNS INGA GARANTIER; även utan underförstådd garanti om SÄLJBARHET eller LÄMPLIGHET FÖR ETT VISST ÄNDAMÅL. Se på GNU General Public Licensen för mer detaljer.\r\n\r\nDu skall ha motagit en kopia av GNU General Public Licensen tillsammans med detta programmet; om du inte har fått det, skriv til Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_TOOLTIP_PROP "Egenskaper" + IDS_TOOLTIP_REFRESH "Uppdatera" + IDS_TOOLTIP_EXPORT "Exportera lista" + IDS_TOOLTIP_CREATE "Skapa en ny tjänst" + IDS_TOOLTIP_DELETE "Tar bort en exiterande tjänst" + IDS_TOOLTIP_START "Starta tjänest" + IDS_TOOLTIP_STOP "Stoppa tjänst" + IDS_TOOLTIP_PAUSE "Pausa tjänst" + IDS_TOOLTIP_RESTART "Starta om tjänest" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_PROGRESS_INFO_START "ReactOS försöker att starta följande tjänst" + IDS_PROGRESS_INFO_STOP "ReactOS försöker att stoppa följande tjänst" + IDS_PROGRESS_INFO_PAUSE "ReactOS försöker att pausa följande tjänst" + IDS_PROGRESS_INFO_RESUME "ReactOS försöker att fortsätta följende tjänst" + IDS_CREATE_SUCCESS "Tjänsten blev skapad" + IDS_DELETE_SUCCESS "Tjänsten togs bort" + IDS_CREATE_REQ "Fält markerade med en\nasterisk är obligatoriska" + IDS_DELETE_STOP "Du måste manuellt stoppa tjänsten före den kan raderas!" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_HELP_OPTIONS "CREATE OPTIONS:\r\nNOTE: The option name includes the equal sign.\r\n type= \r\n (default = own)\r\n start= \r\n (default = demand) \r\n error= \r\n (default = normal)\r\n group= \r\n tag= \r\n depend= \r\n obj= \r\n (default = LocalSystem)\r\n password= \r\n" +END + +/* Hints */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_HINT_BLANK " " + IDS_HINT_EXPORT " Exportera nuvarende lista till en fil." + IDS_HINT_EXIT " Avsluta programmet." + + IDS_HINT_CONNECT " Kontrollera en annan dator." + IDS_HINT_START " Starta valda tjänster." + IDS_HINT_STOP " Stoppa valda tjänster." + IDS_HINT_PAUSE " Pausa valda tjänster." + IDS_HINT_RESUME " Fortsätt valda tjänster." + IDS_HINT_RESTART " Stoppa och starta valda tjänster." + IDS_HINT_REFRESH " Uppdatera tjänstelistan." + IDS_HINT_EDIT " Editera egenskaperna för den valda tjänsten." + IDS_HINT_CREATE " Skapa en ny tjänst." + IDS_HINT_DELETE " Radera valda tjänster." + IDS_HINT_PROP " Öppna egenskaperna för nuvarande val." + + IDS_HINT_LARGE " Visa objekt med store ikoner." + IDS_HINT_SMALL " Visa objekt med mindre ikoner." + IDS_HINT_LIST " Visa objekt i en liste." + IDS_HINT_DETAILS " Visa information om varje objekt i ett fönster." + IDS_HINT_CUST " Anpassa vy." + + IDS_HINT_HELP " Visa hjälpfönstret." + IDS_HINT_ABOUT " Om ReactOS tjänster." + + IDS_HINT_SYS_RESTORE " Återställ fönstret till normal storlek." + IDS_HINT_SYS_MOVE " Flytta detta fönstret." + IDS_HINT_SYS_SIZE " Ändra storleken på dette fönstret." + IDS_HINT_SYS_MINIMIZE " Minimera dette fönstret till en ikon." + IDS_HINT_SYS_MAXIMIZE " Maximera dette fönstret till fullskärm." + IDS_HINT_SYS_CLOSE " Stäng detta fönstret." +END + +/* Application title */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_APPNAME "ReactOS tjänster" +END diff --git a/base/applications/mscutils/servman/rsrc.rc b/base/applications/mscutils/servman/rsrc.rc index 63b5dfbc32f..2b1aed54411 100644 --- a/base/applications/mscutils/servman/rsrc.rc +++ b/base/applications/mscutils/servman/rsrc.rc @@ -28,12 +28,13 @@ IDI_DRIVER ICON "res/driver.ico" #include "lang/fr-FR.rc" #include "lang/id-ID.rc" #include "lang/it-IT.rc" -//#include "lang/ja-JP.rc" FIXME: iconv issue +#include "lang/ja-JP.rc" #include "lang/ko-KR.rc" #include "lang/no-NO.rc" #include "lang/pl-PL.rc" #include "lang/ro-RO.rc" #include "lang/ru-RU.rc" #include "lang/sk-SK.rc" +#include "lang/sv-SE.rc" #include "lang/th-TH.rc" #include "lang/uk-UA.rc" diff --git a/base/applications/mspaint/CMakeLists.txt b/base/applications/mspaint/CMakeLists.txt index c1bfeb5729c..dee6aa9f405 100644 --- a/base/applications/mspaint/CMakeLists.txt +++ b/base/applications/mspaint/CMakeLists.txt @@ -18,4 +18,4 @@ add_executable(mspaint set_module_type(mspaint win32gui) add_importlibs(mspaint comdlg32 shell32 user32 gdi32 advapi32 comctl32 msvcrt kernel32) -add_cab_target(mspaint 1) +add_cd_file(TARGET mspaint DESTINATION reactos/system32 FOR all) diff --git a/base/applications/mspaint/winproc.c b/base/applications/mspaint/winproc.c index 23e1855824a..213efaffd58 100644 --- a/base/applications/mspaint/winproc.c +++ b/base/applications/mspaint/winproc.c @@ -692,6 +692,14 @@ WindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) // menu and button events + case WM_SYSCOLORCHANGE: + { + /* Redirect message to common controls */ + HWND hToolbar = FindWindowEx(hToolBoxContainer, NULL, TOOLBARCLASSNAME, NULL); + SendMessage(hToolbar, WM_SYSCOLORCHANGE, 0, 0); + break; + } + case WM_COMMAND: switch (LOWORD(wParam)) { diff --git a/base/applications/mstsc/CMakeLists.txt b/base/applications/mstsc/CMakeLists.txt index bba3bb36696..ef37c8fd823 100644 --- a/base/applications/mstsc/CMakeLists.txt +++ b/base/applications/mstsc/CMakeLists.txt @@ -31,4 +31,4 @@ set_module_type(mstsc win32gui) add_importlibs(mstsc user32 gdi32 comctl32 ws2_32 advapi32 shell32 ole32 comdlg32 msvcrt kernel32) -add_cab_target(mstsc 1) +add_cd_file(TARGET mstsc DESTINATION reactos/system32 FOR all) diff --git a/base/applications/mstsc/lang/sv-SE.rc b/base/applications/mstsc/lang/sv-SE.rc new file mode 100644 index 00000000000..cd50843b379 --- /dev/null +++ b/base/applications/mstsc/lang/sv-SE.rc @@ -0,0 +1,69 @@ +/* + * PROJECT: ReactOS RAPPS + * FILE: \base\applications\mstsc\lang\sv-SE.rc + * PURPOSE: Swedish resource file + * Translation: Jaix Bly + */ +LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL + +IDD_GENERAL DIALOGEX 0, 0, 242, 175 +STYLE DS_SHELLFONT | WS_CHILD +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + GROUPBOX "Inloggningsinställningar",IDC_STATIC,7,7,228,89 + GROUPBOX "Anslutningsinställningar",IDC_STATIC,7,103,228,65 + ICON "", IDC_LOGONICON, 15,19,20,20 + LTEXT "Skriv in serveradressen",IDC_STATIC,47,24,81,8 + LTEXT "Server:",IDC_STATIC,47,41,25,8 + LTEXT "Användarnamn:",IDC_STATIC,47,58,38,8 + COMBOBOX IDC_SERVERCOMBO,79,39,141,150,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Spara",IDC_SAVE,67,139,50,14 + PUSHBUTTON "Spara som...",IDC_SAVEAS,123,139,50,14 + PUSHBUTTON "Öppna...",IDC_OPEN,177,139,50,14 + ICON "", IDC_CONNICON, 16,114,20,20 + LTEXT "Spara nuvarende anslutningsinställing eller öppna lagrad anslutning",IDC_STATIC,50,115,172,20 +END + +IDD_DISPLAY DIALOGEX 0, 0, 242, 175 +STYLE DS_SHELLFONT | WS_CHILD +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + GROUPBOX "Storlek på fjärrskrivbord",IDC_STATIC,7,7,228,68 + GROUPBOX "Färger",IDC_STATIC,7,83,228,85 + ICON "", IDC_REMICON, 15,19,20,20 + ICON "", IDC_COLORSICON, 15,98,20,20 + LTEXT "Välj din skärmstorlek på fjärrskrivbordet. Dra glidreglaget helt till höger för att få fullskärmsvisning.",IDC_STATIC,53,22,175,21 + CONTROL "", IDC_GEOSLIDER, "msctls_trackbar32", TBS_AUTOTICKS | WS_TABSTOP, 56, 42, 124, 17 + COMBOBOX IDC_BPPCOMBO,56,102,128,80, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP + CONTROL "",IDC_COLORIMAGE,"Static",SS_OWNERDRAW | SS_SUNKEN, 56,121,127,10 + LTEXT "OBS: Inställingen på fjärdatorn kan ersätta denna inställingen.",IDC_STATIC,56,143,165,18 + LTEXT "Mindre",IDC_STATIC,35,42,22,8 + LTEXT "Större",IDC_STATIC,189,42,19,8 + LTEXT "", IDC_SETTINGS_RESOLUTION_TEXT, 56, 62, 120, 10, SS_CENTER +END + +IDD_CONNECTDIALOG DIALOGEX 0, 0, 260, 262 +STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Anslutning till fjärrskrivbord" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + DEFPUSHBUTTON "Anslut",IDOK,147,245,50,14 + PUSHBUTTON "Avbryt",IDCANCEL,203,245,50,14 + CONTROL "",IDC_TAB,"SysTabControl32",0x0,7,50,246,190 +END + + +STRINGTABLE +BEGIN + IDS_TAB_GENERAL "Allmännt" + IDS_TAB_DISPLAY "Skärm" + IDS_256COLORS "256 Färger" + IDS_HIGHCOLOR15 "32,768 Färger (15 bit)" + IDS_HIGHCOLOR16 "65,536 Färger (16 bit)" + IDS_HIGHCOLOR24 "16,777,216 Färger (24 bit)" + IDS_PIXEL "%lux%lu Pixlar" + IDS_FULLSCREEN "Fullskärm" + IDS_BROWSESERVER "" + IDS_HEADERTEXT1 "Fjärrskrivbord" + IDS_HEADERTEXT2 "Anslutning" +END diff --git a/base/applications/mstsc/rsrc.rc b/base/applications/mstsc/rsrc.rc index 6d1bedcd8b1..d933a50afac 100644 --- a/base/applications/mstsc/rsrc.rc +++ b/base/applications/mstsc/rsrc.rc @@ -20,11 +20,12 @@ IDB_SPECT BITMAP "res/spectrum.bmp" #include "lang/es-ES.rc" #include "lang/fr-FR.rc" #include "lang/it-IT.rc" -//#include "lang/ja-JP.rc" FIXME: iconv issue +#include "lang/ja-JP.rc" #include "lang/ko-KR.rc" #include "lang/lt-LT.rc" #include "lang/no-NO.rc" #include "lang/pl-PL.rc" #include "lang/ru-RU.rc" #include "lang/sk-SK.rc" +#include "lang/sv-SE.rc" #include "lang/uk-UA.rc" diff --git a/base/applications/network/arp/CMakeLists.txt b/base/applications/network/arp/CMakeLists.txt index 7c0c0919ad5..31e3066e219 100644 --- a/base/applications/network/arp/CMakeLists.txt +++ b/base/applications/network/arp/CMakeLists.txt @@ -5,4 +5,4 @@ set_module_type(arp win32cui) add_importlibs(arp iphlpapi ws2_32 shlwapi msvcrt kernel32) -add_cab_target(arp 1) +add_cd_file(TARGET arp DESTINATION reactos/system32 FOR all) diff --git a/base/applications/network/dwnl/CMakeLists.txt b/base/applications/network/dwnl/CMakeLists.txt index 195a9681b1a..b1aff5f18b6 100644 --- a/base/applications/network/dwnl/CMakeLists.txt +++ b/base/applications/network/dwnl/CMakeLists.txt @@ -13,4 +13,4 @@ if(MSVC) add_importlibs(dwnl ntdll) endif() -add_cab_target(dwnl 1) +add_cd_file(TARGET dwnl DESTINATION reactos/system32 FOR all) diff --git a/base/applications/network/finger/CMakeLists.txt b/base/applications/network/finger/CMakeLists.txt index 9ac4d9e11f8..88e1076475f 100644 --- a/base/applications/network/finger/CMakeLists.txt +++ b/base/applications/network/finger/CMakeLists.txt @@ -12,4 +12,4 @@ add_executable(finger set_module_type(finger win32cui) add_importlibs(finger ws2_32 msvcrt kernel32) -add_cab_target(finger 1) +add_cd_file(TARGET finger DESTINATION reactos/system32 FOR all) diff --git a/base/applications/network/ftp/CMakeLists.txt b/base/applications/network/ftp/CMakeLists.txt index 0d74b9ae47b..522da951bec 100644 --- a/base/applications/network/ftp/CMakeLists.txt +++ b/base/applications/network/ftp/CMakeLists.txt @@ -21,4 +21,4 @@ if(MSVC) add_importlibs(ftp ntdll) endif() -add_cab_target(ftp 1) +add_cd_file(TARGET ftp DESTINATION reactos/system32 FOR all) diff --git a/base/applications/network/ipconfig/CMakeLists.txt b/base/applications/network/ipconfig/CMakeLists.txt index ec18cf5bb14..d772922feed 100644 --- a/base/applications/network/ipconfig/CMakeLists.txt +++ b/base/applications/network/ipconfig/CMakeLists.txt @@ -2,4 +2,4 @@ add_executable(ipconfig ipconfig.c ipconfig.rc) set_module_type(ipconfig win32cui) add_importlibs(ipconfig user32 iphlpapi advapi32 msvcrt kernel32) -add_cab_target(ipconfig 1) +add_cd_file(TARGET ipconfig DESTINATION reactos/system32 FOR all) diff --git a/base/applications/network/ipconfig/ipconfig.rc b/base/applications/network/ipconfig/ipconfig.rc index 7627a1de6a2..04af25042a1 100644 --- a/base/applications/network/ipconfig/ipconfig.rc +++ b/base/applications/network/ipconfig/ipconfig.rc @@ -19,6 +19,7 @@ #include "lang/pl-PL.rc" #include "lang/ru-RU.rc" #include "lang/sk-SK.rc" +#include "lang/sv-SE.rc" #include "lang/uk-UA.rc" diff --git a/base/applications/network/ipconfig/lang/sv-SE.rc b/base/applications/network/ipconfig/lang/sv-SE.rc new file mode 100644 index 00000000000..35f7e1814b2 --- /dev/null +++ b/base/applications/network/ipconfig/lang/sv-SE.rc @@ -0,0 +1,71 @@ +/* + * PROJECT: ReactOS RAPPS + * FILE: \base\applications\network\ipconfig\lang\sv-SE.rc + * PURPOSE: Swedish resource file + * Translation: Jaix Bly + */ +LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL + +STRINGTABLE DISCARDABLE +BEGIN + IDS_BCAST "Broadcast" + IDS_P2P "Peer To Peer" + IDS_MIXED "Mixad" + IDS_HYBRID "Hybrid" + IDS_UNKNOWN "Okänd" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_OTHER "Annan Typ av Adapter" + IDS_ETH "Ethernet Adapter" + IDS_TOKEN "Token Ring Adapter" + IDS_FDDI "FDDI Adapter" + IDS_PPP "PPP Adapter" + IDS_LOOP "Loopback Adapter" + IDS_SLIP "SLIP Adapter" +END + +STRINGTABLE DISCARDABLE +BEGIN +/* Please keep the spacing/formatting as per En.rc when translating */ + IDS_USAGE + "\nSYNTAX:\n \ + ipconfig [/? | /all | /renew [kort] | /release [kort] |\n \ + /flushdns | /displaydns | /registerdns |\n \ + /showclassid kort |\n \ + /setclassid kort [classid] ]\n \ + \n \ + där\n \ + kort Anslutningssnamn\n \ + (jokertecken * och ? är tillåtet, se exempeln)\n \ + \n \ + Alternativ:\n \ + /? Visar detta hjälpmeddelandet\n \ + /all Visar detaljerd information.\n \ + /release Frigör IP adressen för det angivna kortet.\n \ + /renew Förnya alla IP adresser för det angivna kortet.\n \ + /flushdns Tömmer DNS Resolver-buffern.\n \ + /registerdns Uppdaterar alla DHCP leaseavtal och registerer DNS namn på nytt.\n \ + /displaydns Visar inhåll i DNS Resolver-bufferen.\n \ + /showclassid Visar alla klass-ID:na för DHCP som är tillåtet för kortet.\n \ + /setclassid Ändrar DHCP-klass-ID:t.\n \ + \n \ + Som standard visas bara IP-adressen, nätsmasken och\n \ + standardgateway för varje nätverkskort som är bundet till TCP/IP.\n \ + \n \ + Om inget nätverkskort angetts för Release och Renew, kommer IP-adresserna\n \ + för alla nätverkskort som är bundna till TCP/IP att frigöras eller förnyas.\n \ + \n \ + Om inget klass-ID har angetts för Setclassid tas klass-ID:t bort.\n \ + \n \ + Exempel:\n \ + > ipconfig ... Visar informastion.\n \ + > ipconfig /all ... Visar detaljerd information\n \ + > ipconfig /renew ... Förnyar alla kort\n \ + > ipconfig /renew EL* ... Förnyar alle kort med navn som\n \ + börjar med EL\n \ + > ipconfig /release *Ans* ... frigör alla matchande anslutningar,\n \ + t.ex. ""Anslutning till lokalt nätverk 1"" eller\n \ + ""Anslutning till lokalt nätverk 2""\n \ " +END diff --git a/base/applications/network/net/CMakeLists.txt b/base/applications/network/net/CMakeLists.txt index aacb24749ce..215d6a58d35 100644 --- a/base/applications/network/net/CMakeLists.txt +++ b/base/applications/network/net/CMakeLists.txt @@ -12,4 +12,4 @@ add_executable(net ${SOURCE}) set_module_type(net win32cui) add_importlibs(net ws2_32 msvcrt kernel32) -add_cab_target(net 1) +add_cd_file(TARGET net DESTINATION reactos/system32 FOR all) diff --git a/base/applications/network/netstat/CMakeLists.txt b/base/applications/network/netstat/CMakeLists.txt index ee63313e407..055e28f50c9 100644 --- a/base/applications/network/netstat/CMakeLists.txt +++ b/base/applications/network/netstat/CMakeLists.txt @@ -2,4 +2,4 @@ add_executable(netstat netstat.c netstat.rc) set_module_type(netstat win32cui) add_importlibs(netstat user32 ws2_32 snmpapi iphlpapi msvcrt kernel32) -add_cab_target(netstat 1) +add_cd_file(TARGET netstat DESTINATION reactos/system32 FOR all) diff --git a/base/applications/network/nslookup/CMakeLists.txt b/base/applications/network/nslookup/CMakeLists.txt index 5d1c17fa01d..bc6fe21eaa0 100644 --- a/base/applications/network/nslookup/CMakeLists.txt +++ b/base/applications/network/nslookup/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(nslookup set_module_type(nslookup win32cui) add_importlibs(nslookup user32 ws2_32 snmpapi iphlpapi msvcrt kernel32) -add_cab_target(nslookup 1) +add_cd_file(TARGET nslookup DESTINATION reactos/system32 FOR all) diff --git a/base/applications/network/ping/CMakeLists.txt b/base/applications/network/ping/CMakeLists.txt index c9ef4c20fb7..db5e7fc7206 100644 --- a/base/applications/network/ping/CMakeLists.txt +++ b/base/applications/network/ping/CMakeLists.txt @@ -13,4 +13,4 @@ if(MSVC) add_importlibs(ping ntdll) endif() -add_cab_target(ping 1) +add_cd_file(TARGET ping DESTINATION reactos/system32 FOR all) diff --git a/base/applications/network/ping/lang/sv-SE.rc b/base/applications/network/ping/lang/sv-SE.rc new file mode 100644 index 00000000000..135126c98a9 --- /dev/null +++ b/base/applications/network/ping/lang/sv-SE.rc @@ -0,0 +1,41 @@ +/* + * PROJECT: ReactOS RAPPS + * FILE: \base\applications\network\ping\lang\sv-SE.rc + * PURPOSE: Swedish resource file + * Translation: Jaix Bly + */ +LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL + +STRINGTABLE DISCARDABLE +BEGIN + IDS_USAGE "\nSYNTAX: ping [-t] [-n antal] [-l storlek] [-w timeout] värddator\n\n\ +Alternativ:\n\ + -t Pinga den angivna datorn tills kommandor stoppas.\n\ + För att stoppa - tryck Ctrl-C.\n\ + -n antal Antal ekobegäranden som ska skickas.\n\ + -l storlek Sändniningsbuffertens storlek.\n\ + -w timeout Timeout i millisekunder att vänta på varje svar.\n\n\0" + + IDS_PING_WITH_BYTES "\nPingar %1 [%2] med %3!d! bytes data:\n\n\0" + IDS_PING_STATISTICS "\nPing statistk för %1:\n\0" + IDS_PACKETS_SENT_RECEIVED_LOST " Packet: Sända = %1!d!, Mottagna = %2!d!, Förlorade = %3!d! (%4!d!%% förlust),\n\0" + IDS_APPROXIMATE_ROUND_TRIP "Ungefärliga slingtider i millisekunder:\n\0" + IDS_MIN_MAX_AVERAGE " Minimum = %1, Maximum = %2, Genomsnittlig = %3\n\0" + IDS_NOT_ENOUGH_RESOURCES "Inte tillräckliga resurser tillgänliga.\n\0" + IDS_UNKNOWN_HOST "Okänd Värd %1.\n\0" + IDS_SETSOCKOPT_FAILED "setsockopt misslyckades (%1!d!).\n\0" + IDS_COULD_NOT_CREATE_SOCKET "Kunde inte skapa socket (#%1!d!).\n\0" + IDS_COULD_NOT_INIT_WINSOCK "Kunde inte initialisera winsock dll.\n\0" + IDS_DEST_MUST_BE_SPECIFIED "Namn eller IP adress till värd måste anges.\n\0" + IDS_BAD_PARAMETER "Ogiltig parameter %1.\n\0" + IDS_BAD_OPTION_FORMAT "Ogiltigt format på alternativ %1.\n\0" + IDS_BAD_OPTION "Ogiltigt alternativ %1.\n\0" + IDS_BAD_VALUE_OPTION_L "Ogiltigt värde för alternativ -l, giltig intervall är från 0 till %1!d!.\n\0" + IDS_REPLY_FROM "Svar från %1: bytes=%2!d! tid%3%4 TTL=%5!d!\n\0" + IDS_DEST_UNREACHABLE "Värddatorn går inte att nå.\n\0" + IDS_COULD_NOT_TRANSMIT "Kunde inte sända data (%1!d!).\n\0" + IDS_COULD_NOT_RECV "Kunde inte ta emot data (%1!d!).\n\0" + IDS_REQUEST_TIMEOUT "Förfrågan gjorde timeout.\n\0" + IDS_MS "ms\0" + IDS_1MS "1ms\0" +END diff --git a/base/applications/network/ping/ping.rc b/base/applications/network/ping/ping.rc index b47c1744474..e406d71dee4 100644 --- a/base/applications/network/ping/ping.rc +++ b/base/applications/network/ping/ping.rc @@ -12,6 +12,7 @@ #include "lang/de-DE.rc" #include "lang/en-US.rc" #include "lang/fr-FR.rc" -#include "lang/pl-PL.rc" #include "lang/it-IT.rc" +#include "lang/pl-PL.rc" +#include "lang/sv-SE.rc" #include "lang/uk-UA.rc" diff --git a/base/applications/network/route/CMakeLists.txt b/base/applications/network/route/CMakeLists.txt index dd04f7366b8..7dde646d9ff 100644 --- a/base/applications/network/route/CMakeLists.txt +++ b/base/applications/network/route/CMakeLists.txt @@ -7,4 +7,4 @@ add_executable(route route.c route.rc) set_module_type(route win32cui) add_importlibs(route ws2_32 iphlpapi msvcrt kernel32) -add_cab_target(route 1) +add_cd_file(TARGET route DESTINATION reactos/system32 FOR all) diff --git a/base/applications/network/telnet/CMakeLists.txt b/base/applications/network/telnet/CMakeLists.txt index 2fe276431a9..eb4962e2f6c 100644 --- a/base/applications/network/telnet/CMakeLists.txt +++ b/base/applications/network/telnet/CMakeLists.txt @@ -29,4 +29,4 @@ add_executable(telnet set_module_type(telnet win32cui) add_importlibs(telnet ws2_32 user32 kernel32 msvcrt) -add_cab_target(telnet 1) +add_cd_file(TARGET telnet DESTINATION reactos/system32 FOR all) diff --git a/base/applications/network/tracert/CMakeLists.txt b/base/applications/network/tracert/CMakeLists.txt index 9d6ad656787..9b55089ec37 100644 --- a/base/applications/network/tracert/CMakeLists.txt +++ b/base/applications/network/tracert/CMakeLists.txt @@ -10,4 +10,4 @@ if(MSVC) add_importlibs(tracert ntdll) endif() -add_cab_target(tracert 1) +add_cd_file(TARGET tracert DESTINATION reactos/system32 FOR all) diff --git a/base/applications/network/whois/CMakeLists.txt b/base/applications/network/whois/CMakeLists.txt index 66dab043aa6..fb67240d921 100644 --- a/base/applications/network/whois/CMakeLists.txt +++ b/base/applications/network/whois/CMakeLists.txt @@ -5,4 +5,4 @@ add_executable(whois whois.c whois.rc) set_module_type(whois win32cui) add_importlibs(whois ws2_32 msvcrt kernel32) -add_cab_target(whois 1) +add_cd_file(TARGET whois DESTINATION reactos/system32 FOR all) diff --git a/base/applications/notepad/CMakeLists.txt b/base/applications/notepad/CMakeLists.txt index b0fbb920694..c59cd26f2bb 100644 --- a/base/applications/notepad/CMakeLists.txt +++ b/base/applications/notepad/CMakeLists.txt @@ -14,4 +14,4 @@ add_executable(notepad ${CMAKE_CURRENT_BINARY_DIR}/notepad_notepad.h.gch ${SOURC set_module_type(notepad win32gui) add_importlibs(notepad user32 gdi32 comctl32 comdlg32 advapi32 shell32 msvcrt kernel32) -add_cab_target(notepad 1) +add_cd_file(TARGET notepad DESTINATION reactos/system32 FOR all) diff --git a/base/applications/notepad/lang/no-NO.rc b/base/applications/notepad/lang/no-NO.rc index ab8f4ae9f0b..d047342f5e2 100644 --- a/base/applications/notepad/lang/no-NO.rc +++ b/base/applications/notepad/lang/no-NO.rc @@ -150,9 +150,9 @@ CAPTION "Om ReactOS Notisblokk" FONT 8, "MS Shell Dlg" BEGIN CONTROL "ReactOS Notisblokk v1.0\r\nenerett 1997,98 Marcel Baur \r\nEnerett 2000 Mike McCormack \r\nEnerett 2002 Sylvain Petreolle \r\nEnerett 2002 Andriy Palamarchuk\r\n", - -1,"Statisk",SS_LEFTNOWORDWRAP | WS_GROUP,46,7,232,39 + -1,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,46,7,232,39 CONTROL " ", - -1,"Statisk",0x50000000,8,48,272,11 + -1,"Static",0x50000000,8,48,272,11 DEFPUSHBUTTON "Avslutt",IDOK,114,149,44,15,WS_GROUP ICON IDI_NPICON,-1,12,9,20,30 EDITTEXT IDC_LICENSE,8,64,272,81,ES_MULTILINE | diff --git a/base/applications/notepad/lang/sv-SE.rc b/base/applications/notepad/lang/sv-SE.rc index ffaed196900..70fe042e3af 100644 --- a/base/applications/notepad/lang/sv-SE.rc +++ b/base/applications/notepad/lang/sv-SE.rc @@ -67,8 +67,8 @@ BEGIN MENUITEM SEPARATOR MENUITEM "Sök...", CMD_SEARCH MENUITEM "&Sök nästa\tF3", CMD_SEARCH_NEXT - MENUITEM "Replace\tCtrl+H", CMD_REPLACE - MENUITEM "Go To...\tCtrl+G", CMD_GOTO + MENUITEM "Ersätt\tCtrl+H", CMD_REPLACE + MENUITEM "Gå Till...\tCtrl+G", CMD_GOTO MENUITEM SEPARATOR MENUITEM "Markera &allt", CMD_SELECT_ALL MENUITEM "&Tid/datum\tF5", CMD_TIME_DATE @@ -78,9 +78,9 @@ BEGIN MENUITEM "&Automatiskt radbyte", CMD_WRAP MENUITEM "&Font...", CMD_FONT END - POPUP "&View" + POPUP "&Visa" BEGIN - MENUITEM "Status&bar", CMD_STATUSBAR + MENUITEM "Status&rad", CMD_STATUSBAR END POPUP "&Hjälp" BEGIN @@ -88,7 +88,7 @@ BEGIN MENUITEM "&Sök...", CMD_HELP_SEARCH MENUITEM "Anvisningar för hjälpen", CMD_HELP_ON_HELP MENUITEM SEPARATOR - MENUITEM "&About", CMD_ABOUT + MENUITEM "Om &Anteckningar", CMD_ABOUT MENUITEM "Inf&ormation...", CMD_ABOUT_WINE END END @@ -100,9 +100,9 @@ STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU FONT 8, "MS Shell Dlg" CAPTION "Skrivarinställningar" BEGIN -LTEXT "&Huvudnot:", 0x140, 10, 07, 40, 15 +LTEXT "&Sidhuvud:", 0x140, 10, 07, 40, 15 EDITTEXT 0x141, 60, 05,110, 12, WS_BORDER | WS_TABSTOP -LTEXT "&Fotnot:", 0x142, 10, 24, 40, 15 +LTEXT "&Sidfot:", 0x142, 10, 24, 40, 15 EDITTEXT 0x143, 60, 22,110, 12, WS_BORDER | WS_TABSTOP GROUPBOX "Marginaler:", 0x144, 10, 43,160, 45 @@ -125,36 +125,36 @@ DIALOG_ENCODING DIALOGEX 0, 0, 256, 44 STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS | WS_CAPTION | WS_SYSMENU FONT 8, "MS Shell Dlg" -CAPTION "Encoding" +CAPTION "Kodning" BEGIN COMBOBOX ID_ENCODING,54,0,156,80,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP -LTEXT "Encoding:",0x155,5,2,41,12 +LTEXT "Kodning:",0x155,5,2,41,12 COMBOBOX ID_EOLN,54,18,156,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP -LTEXT "Endlines:",0x156,5,20,41,12 +LTEXT "Slutrader:",0x156,5,20,41,12 END /* Dialog 'Go To' */ DIALOG_GOTO DIALOGEX 0,0,165,50 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU FONT 8, "MS Shell Dlg" -CAPTION "Goto line" +CAPTION "Gå till rad" BEGIN EDITTEXT ID_LINENUMBER,54,10,106,12,WS_CHILD | WS_BORDER | WS_TABSTOP -LTEXT "Line number:",0x155,5,12,41,12,WS_CHILD | WS_TABSTOP | ES_NUMBER +LTEXT "Radnummer:",0x155,5,12,41,12,WS_CHILD | WS_TABSTOP | ES_NUMBER DEFPUSHBUTTON "OK", IDOK, 75, 30, 40, 15, WS_CHILD | WS_TABSTOP -PUSHBUTTON "Cancel", IDCANCEL, 120, 30, 40, 15, WS_CHILD | WS_TABSTOP +PUSHBUTTON "Avbryt", IDCANCEL, 120, 30, 40, 15, WS_CHILD | WS_TABSTOP END IDD_ABOUTBOX DIALOGEX DISCARDABLE 22,16,284,170 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU -CAPTION "About ReactOS Notepad" +CAPTION "Om ReactOS Anteckningar" FONT 8, "MS Shell Dlg" BEGIN - CONTROL "ReactOS Notepad v1.0\r\nCopyright 1997,98 Marcel Baur \r\nCopyright 2000 Mike McCormack \r\nCopyright 2002 Sylvain Petreolle \r\nCopyright 2002 Andriy Palamarchuk\r\n ", + CONTROL "ReactOS Anteckningar v1.0\r\nCopyright 1997,98 Marcel Baur \r\nCopyright 2000 Mike McCormack \r\nCopyright 2002 Sylvain Petreolle \r\nCopyright 2002 Andriy Palamarchuk\r\n ", -1,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,46,7,232,39 CONTROL " ", -1,"Static",0x50000000,8,48,272,11 - DEFPUSHBUTTON "Close",IDOK,114,149,44,15,WS_GROUP + DEFPUSHBUTTON "Stäng",IDOK,114,149,44,15,WS_GROUP ICON IDI_NPICON,-1,12,9,20,30 EDITTEXT IDC_LICENSE,8,64,272,81,ES_MULTILINE | ES_READONLY | WS_VSCROLL diff --git a/base/applications/notepad/rsrc.rc b/base/applications/notepad/rsrc.rc index 535a52c8404..d33e548317b 100644 --- a/base/applications/notepad/rsrc.rc +++ b/base/applications/notepad/rsrc.rc @@ -48,7 +48,7 @@ IDI_NPICON ICON "res/notepad.ico" #include "lang/hy-AM.rc" #include "lang/id-ID.rc" #include "lang/it-IT.rc" -//#include "lang/ja-JP.rc" FIXME: iconv issue +#include "lang/ja-JP.rc" #include "lang/lt-LT.rc" #include "lang/nl-NL.rc" #include "lang/no-NO.rc" diff --git a/base/applications/rapps/CMakeLists.txt b/base/applications/rapps/CMakeLists.txt index f49f70d5c15..e3a053e5519 100644 --- a/base/applications/rapps/CMakeLists.txt +++ b/base/applications/rapps/CMakeLists.txt @@ -32,4 +32,4 @@ target_link_libraries(rapps uuid) add_importlibs(rapps advapi32 comctl32 gdi32 urlmon user32 shell32 shlwapi kernel32 msvcrt ntdll) add_dependencies(rapps rappsmsg) add_message_headers(rappsmsg.mc) -add_cab_target(rapps 1) +add_cd_file(TARGET rapps DESTINATION reactos/system32 FOR all) diff --git a/base/applications/rapps/lang/ja-JP.rc b/base/applications/rapps/lang/ja-JP.rc index ba55c75320e..59c06704a67 100644 --- a/base/applications/rapps/lang/ja-JP.rc +++ b/base/applications/rapps/lang/ja-JP.rc @@ -4,26 +4,26 @@ LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT IDR_MAINMENU MENU BEGIN - POPUP "ƒtƒ@ƒCƒ‹(&F)" + POPUP "ファイル(&F)" BEGIN - MENUITEM "Ý’è(&S)", ID_SETTINGS + MENUITEM "設定(&S)", ID_SETTINGS MENUITEM SEPARATOR - MENUITEM "I—¹(&X)", ID_EXIT + MENUITEM "終了(&X)", ID_EXIT END - POPUP "ƒvƒƒOƒ‰ƒ€(&P)" + POPUP "プログラム(&P)" BEGIN - MENUITEM "ƒCƒ“ƒXƒg[ƒ‹(&I)", ID_INSTALL - MENUITEM "ƒAƒ“ƒCƒ“ƒXƒg[ƒ‹(&U)",ID_UNINSTALL - MENUITEM "•ÏX(&M)", ID_MODIFY + MENUITEM "インストール(&I)", ID_INSTALL + MENUITEM "アンインストール(&U)",ID_UNINSTALL + MENUITEM "変更(&M)", ID_MODIFY MENUITEM SEPARATOR - MENUITEM "ƒŒƒWƒXƒgƒŠ‚©‚çíœ(&R)",ID_REGREMOVE + MENUITEM "レジストリã‹ã‚‰å‰Šé™¤(&R)",ID_REGREMOVE MENUITEM SEPARATOR - MENUITEM "XV(&R)", ID_REFRESH + MENUITEM "æ›´æ–°(&R)", ID_REFRESH END - POPUP "ƒwƒ‹ƒv" + POPUP "ヘルプ" BEGIN - MENUITEM "ƒwƒ‹ƒv", ID_HELP, GRAYED - MENUITEM "ƒo[ƒWƒ‡ƒ“î•ñ", ID_ABOUT + MENUITEM "ヘルプ", ID_HELP, GRAYED + MENUITEM "ãƒãƒ¼ã‚¸ãƒ§ãƒ³æƒ…å ±", ID_ABOUT END END @@ -31,8 +31,8 @@ IDR_LINKMENU MENU BEGIN POPUP "popup" BEGIN - MENUITEM "ƒuƒ‰ƒEƒU‚ŃŠƒ“ƒN‚ðŠJ‚­(&O)", ID_OPEN_LINK - MENUITEM "ƒNƒŠƒbƒvƒ{[ƒh‚ɃRƒs[‚·‚é(&C)", ID_COPY_LINK + MENUITEM "ブラウザã§ãƒªãƒ³ã‚¯ã‚’é–‹ã(&O)", ID_OPEN_LINK + MENUITEM "クリップボードã«ã‚³ãƒ”ーã™ã‚‹(&C)", ID_COPY_LINK END END @@ -40,156 +40,156 @@ IDR_APPLICATIONMENU MENU BEGIN POPUP "popup" BEGIN - MENUITEM "ƒCƒ“ƒXƒg[ƒ‹(&I)", ID_INSTALL - MENUITEM "ƒAƒ“ƒCƒ“ƒXƒg[ƒ‹(&U)", ID_UNINSTALL - MENUITEM "•ÏX(&M)", ID_MODIFY + MENUITEM "インストール(&I)", ID_INSTALL + MENUITEM "アンインストール(&U)", ID_UNINSTALL + MENUITEM "変更(&M)", ID_MODIFY MENUITEM SEPARATOR - MENUITEM "ƒŒƒWƒXƒgƒŠ‚©‚çíœ(&R)", ID_REGREMOVE + MENUITEM "レジストリã‹ã‚‰å‰Šé™¤(&R)", ID_REGREMOVE MENUITEM SEPARATOR - MENUITEM "XV(&R)", ID_REFRESH + MENUITEM "æ›´æ–°(&R)", ID_REFRESH END END IDD_SETTINGS_DIALOG DIALOGEX DISCARDABLE 0, 0, 250, 144 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Ý’è" +CAPTION "設定" FONT 9, "MS UI Gothic" BEGIN - GROUPBOX "‘S”Ê", -1, 4, 2, 240, 61 - AUTOCHECKBOX "ƒEƒBƒ“ƒhƒE‚Ìꊂð•Û‘¶‚·‚é(&S)", IDC_SAVE_WINDOW_POS, 15, 12, 219, 12 - AUTOCHECKBOX "‹N“®Žž‚É—˜—p‚Å‚«‚éƒvƒƒOƒ‰ƒ€‚̃ŠƒXƒg‚ðXV‚·‚é(&U)", IDC_UPDATE_AVLIST, 15, 29, 219, 12 - AUTOCHECKBOX "ƒvƒƒOƒ‰ƒ€‚̃Cƒ“ƒXƒg[ƒ‹‚Æ휂ð‹L˜^‚·‚é(&L)", IDC_LOG_ENABLED, 15, 46, 219, 12 + GROUPBOX "全般", -1, 4, 2, 240, 61 + AUTOCHECKBOX "ウィンドウã®å ´æ‰€ã‚’ä¿å­˜ã™ã‚‹(&S)", IDC_SAVE_WINDOW_POS, 15, 12, 219, 12 + AUTOCHECKBOX "起動時ã«åˆ©ç”¨ã§ãるプログラムã®ãƒªã‚¹ãƒˆã‚’æ›´æ–°ã™ã‚‹(&U)", IDC_UPDATE_AVLIST, 15, 29, 219, 12 + AUTOCHECKBOX "プログラムã®ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã¨å‰Šé™¤ã‚’記録ã™ã‚‹(&L)", IDC_LOG_ENABLED, 15, 46, 219, 12 - GROUPBOX "ƒ_ƒEƒ“ƒ[ƒhˆ—", -1, 4, 65, 240, 51 - LTEXT "ƒ_ƒEƒ“ƒ[ƒh‚·‚éƒtƒHƒ‹ƒ_:", -1, 16, 75, 100, 9 + GROUPBOX "ダウンロード処ç†", -1, 4, 65, 240, 51 + LTEXT "ダウンロードã™ã‚‹ãƒ•ã‚©ãƒ«ãƒ€:", -1, 16, 75, 100, 9 EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP - PUSHBUTTON "‘I‘ð(&C)", IDC_CHOOSE, 187, 85, 50, 14 - AUTOCHECKBOX "ƒCƒ“ƒXƒg[ƒ‹Œã‚ɃvƒƒOƒ‰ƒ€‚̃Cƒ“ƒXƒg[ƒ‰‚ð휂·‚é(&D)", IDC_DEL_AFTER_INSTALL, 16, 100, 218, 12 + PUSHBUTTON "é¸æŠž(&C)", IDC_CHOOSE, 187, 85, 50, 14 + AUTOCHECKBOX "インストール後ã«ãƒ—ログラムã®ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ©ã‚’削除ã™ã‚‹(&D)", IDC_DEL_AFTER_INSTALL, 16, 100, 218, 12 - PUSHBUTTON "ƒfƒtƒHƒ‹ƒg", IDC_DEFAULT_SETTINGS, 8, 124, 60, 14 + PUSHBUTTON "デフォルト", IDC_DEFAULT_SETTINGS, 8, 124, 60, 14 PUSHBUTTON "OK", IDOK, 116, 124, 60, 14 - PUSHBUTTON "ƒLƒƒƒ“ƒZƒ‹", IDCANCEL, 181, 124, 60, 14 + PUSHBUTTON "キャンセル", IDCANCEL, 181, 124, 60, 14 END IDD_INSTALL_DIALOG DIALOGEX DISCARDABLE 0, 0, 216, 97 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "ƒvƒƒOƒ‰ƒ€‚̃Cƒ“ƒXƒg[ƒ‹" +CAPTION "プログラムã®ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«" FONT 9, "MS UI Gothic" BEGIN LTEXT "...", IDC_INSTALL_TEXT, 4, 5, 209, 35 - AUTORADIOBUTTON "ƒfƒBƒXƒN‚©‚çƒCƒ“ƒXƒg[ƒ‹ (CD ‚â DVD)(&I)", IDC_CD_INSTALL, 10, 46, 197, 11, WS_GROUP - AUTORADIOBUTTON "ƒ_ƒEƒ“ƒ[ƒh‚µ‚ăCƒ“ƒXƒg[ƒ‹(&D)", IDC_DOWNLOAD_INSTALL, 10, 59, 197, 11, NOT WS_TABSTOP + AUTORADIOBUTTON "ディスクã‹ã‚‰ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ« (CD ã‚„ DVD)(&I)", IDC_CD_INSTALL, 10, 46, 197, 11, WS_GROUP + AUTORADIOBUTTON "ダウンロードã—ã¦ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«(&D)", IDC_DOWNLOAD_INSTALL, 10, 59, 197, 11, NOT WS_TABSTOP PUSHBUTTON "OK", IDOK, 86, 78, 60, 14 - PUSHBUTTON "ƒLƒƒƒ“ƒZƒ‹", IDCANCEL, 150, 78, 60, 14 + PUSHBUTTON "キャンセル", IDCANCEL, 150, 78, 60, 14 END IDD_DOWNLOAD_DIALOG DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 76 STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE -CAPTION "ƒ_ƒEƒ“ƒ[ƒh..." +CAPTION "ダウンロード..." FONT 9, "MS UI Gothic" BEGIN CONTROL "Progress1", IDC_DOWNLOAD_PROGRESS, "msctls_progress32", WS_BORDER | PBS_SMOOTH, 10, 10, 200, 12 LTEXT "", IDC_DOWNLOAD_STATUS, 10, 30, 200, 10, SS_CENTER - PUSHBUTTON "ƒLƒƒƒ“ƒZƒ‹", IDCANCEL, 85, 58, 50, 15, WS_GROUP | WS_TABSTOP + PUSHBUTTON "キャンセル", IDCANCEL, 85, 58, 50, 15, WS_GROUP | WS_TABSTOP END IDD_ABOUT_DIALOG DIALOGEX 22, 16, 190, 66 STYLE DS_SHELLFONT | WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME -CAPTION "ƒo[ƒWƒ‡ƒ“î•ñ" +CAPTION "ãƒãƒ¼ã‚¸ãƒ§ãƒ³æƒ…å ±" FONT 9, "MS UI Gothic" BEGIN - LTEXT "ReactOS ƒAƒvƒŠƒP[ƒVƒ‡ƒ“ ƒ}ƒl[ƒWƒƒ\nCopyright (C) 2009\nby Dmitry Chapyshev (dmitry@reactos.org)", IDC_STATIC, 48, 7, 130, 39 - PUSHBUTTON "•Â‚¶‚é", IDOK, 133, 46, 50, 14 + LTEXT "ReactOS アプリケーション マãƒãƒ¼ã‚¸ãƒ£\nCopyright (C) 2009\nby Dmitry Chapyshev (dmitry@reactos.org)", IDC_STATIC, 48, 7, 130, 39 + PUSHBUTTON "é–‰ã˜ã‚‹", IDOK, 133, 46, 50, 14 ICON IDI_MAIN, IDC_STATIC, 10, 10, 7, 30 END STRINGTABLE DISCARDABLE BEGIN - IDS_TOOLTIP_INSTALL "ƒCƒ“ƒXƒg[ƒ‹" - IDS_TOOLTIP_UNINSTALL "ƒAƒ“ƒCƒ“ƒXƒg[ƒ‹" - IDS_TOOLTIP_MODIFY "•ÏX" - IDS_TOOLTIP_SETTINGS "Ý’è" - IDS_TOOLTIP_REFRESH "XV" - IDS_TOOLTIP_EXIT "I—¹" + IDS_TOOLTIP_INSTALL "インストール" + IDS_TOOLTIP_UNINSTALL "アンインストール" + IDS_TOOLTIP_MODIFY "変更" + IDS_TOOLTIP_SETTINGS "設定" + IDS_TOOLTIP_REFRESH "æ›´æ–°" + IDS_TOOLTIP_EXIT "終了" END STRINGTABLE DISCARDABLE BEGIN - IDS_APP_NAME "–¼‘O" - IDS_APP_INST_VERSION "ƒo[ƒWƒ‡ƒ“" - IDS_APP_DESCRIPTION "ŠT—v" + IDS_APP_NAME "åå‰" + IDS_APP_INST_VERSION "ãƒãƒ¼ã‚¸ãƒ§ãƒ³" + IDS_APP_DESCRIPTION "概è¦" END STRINGTABLE DISCARDABLE BEGIN - IDS_INFO_VERSION "\nƒo[ƒWƒ‡ƒ“: " - IDS_INFO_DESCRIPTION "\nŠT—v: " - IDS_INFO_PUBLISHER "\n”­sŒ³: " - IDS_INFO_HELPLINK "\nƒwƒ‹ƒv‚ւ̃Šƒ“ƒN: " - IDS_INFO_HELPPHONE "\nƒwƒ‹ƒv‚Ì“d˜b”Ô†: " - IDS_INFO_README "\nReadme‚̈ʒu: " - IDS_INFO_REGOWNER "\n“o˜^‚³‚ꂽŠ—LŽÒ: " - IDS_INFO_PRODUCTID "\nƒvƒƒ_ƒNƒgID: " - IDS_INFO_CONTACT "\n˜A—æ: " - IDS_INFO_UPDATEINFO "\nƒAƒbƒvƒf[ƒgî•ñ: " - IDS_INFO_INFOABOUT "\n‚±‚ê‚ÉŠÖ‚·‚éî•ñ: " - IDS_INFO_COMMENTS "\nƒRƒƒ“ƒg: " - IDS_INFO_INSTLOCATION "\nƒCƒ“ƒXƒg[ƒ‹êŠ: " - IDS_INFO_INSTALLSRC "\nƒCƒ“ƒXƒg[ƒ‹Œ³: " - IDS_INFO_UNINSTALLSTR "\nƒAƒ“ƒCƒ“ƒXƒg[ƒ‹‚ÉŽg—p‚·‚镶Žš—ñ: " - IDS_INFO_MODIFYPATH "\n•ÏX‚ÉŽg—p‚·‚éƒpƒX: " - IDS_INFO_INSTALLDATE "\nƒCƒ“ƒXƒg[ƒ‹‚µ‚½“ú•t: " + IDS_INFO_VERSION "\nãƒãƒ¼ã‚¸ãƒ§ãƒ³: " + IDS_INFO_DESCRIPTION "\n概è¦: " + IDS_INFO_PUBLISHER "\n発行元: " + IDS_INFO_HELPLINK "\nヘルプã¸ã®ãƒªãƒ³ã‚¯: " + IDS_INFO_HELPPHONE "\nヘルプã®é›»è©±ç•ªå·: " + IDS_INFO_README "\nReadmeã®ä½ç½®: " + IDS_INFO_REGOWNER "\n登録ã•ã‚ŒãŸæ‰€æœ‰è€…: " + IDS_INFO_PRODUCTID "\nプロダクトID: " + IDS_INFO_CONTACT "\n連絡先: " + IDS_INFO_UPDATEINFO "\nアップデート情報: " + IDS_INFO_INFOABOUT "\nã“ã‚Œã«é–¢ã™ã‚‹æƒ…å ±: " + IDS_INFO_COMMENTS "\nコメント: " + IDS_INFO_INSTLOCATION "\nインストール場所: " + IDS_INFO_INSTALLSRC "\nインストール元: " + IDS_INFO_UNINSTALLSTR "\nアンインストールã«ä½¿ç”¨ã™ã‚‹æ–‡å­—列: " + IDS_INFO_MODIFYPATH "\n変更ã«ä½¿ç”¨ã™ã‚‹ãƒ‘ス: " + IDS_INFO_INSTALLDATE "\nインストールã—ãŸæ—¥ä»˜: " END STRINGTABLE DISCARDABLE BEGIN - IDS_AINFO_VERSION "\nƒo[ƒWƒ‡ƒ“: " - IDS_AINFO_DESCRIPTION "\nŠT—v: " - IDS_AINFO_SIZE "\nƒTƒCƒY: " - IDS_AINFO_URLSITE "\nƒz[ƒ€ƒy[ƒW: " - IDS_AINFO_LICENCE "\nƒ‰ƒCƒZƒ“ƒX: " + IDS_AINFO_VERSION "\nãƒãƒ¼ã‚¸ãƒ§ãƒ³: " + IDS_AINFO_DESCRIPTION "\n概è¦: " + IDS_AINFO_SIZE "\nサイズ: " + IDS_AINFO_URLSITE "\nホームページ: " + IDS_AINFO_LICENCE "\nライセンス: " END STRINGTABLE DISCARDABLE BEGIN - IDS_CAT_AUDIO "ƒI[ƒfƒBƒI" - IDS_CAT_DEVEL "ŠJ”­" - IDS_CAT_DRIVERS "ƒhƒ‰ƒCƒo" - IDS_CAT_EDU "‹³ˆç" - IDS_CAT_ENGINEER "HŠw" - IDS_CAT_FINANCE "Œo‰c" - IDS_CAT_GAMES "ƒQ[ƒ€‚Æ‚¨Šy‚µ‚Ý" - IDS_CAT_GRAPHICS "ƒOƒ‰ƒtƒBƒbƒNƒX" - IDS_CAT_INTERNET "ƒCƒ“ƒ^[ƒlƒbƒg‚ƃlƒbƒgƒ[ƒN" - IDS_CAT_LIBS "ƒ‰ƒCƒuƒ‰ƒŠ" - IDS_CAT_OFFICE "ƒIƒtƒBƒX" - IDS_CAT_OTHER "‚»‚Ì‘¼" - IDS_CAT_SCIENCE "‰ÈŠw" - IDS_CAT_TOOLS "ƒc[ƒ‹" - IDS_CAT_VIDEO "ƒrƒfƒI" + IDS_CAT_AUDIO "オーディオ" + IDS_CAT_DEVEL "開発" + IDS_CAT_DRIVERS "ドライãƒ" + IDS_CAT_EDU "教育" + IDS_CAT_ENGINEER "工学" + IDS_CAT_FINANCE "経営" + IDS_CAT_GAMES "ゲームã¨ãŠæ¥½ã—ã¿" + IDS_CAT_GRAPHICS "グラフィックス" + IDS_CAT_INTERNET "インターãƒãƒƒãƒˆã¨ãƒãƒƒãƒˆãƒ¯ãƒ¼ã‚¯" + IDS_CAT_LIBS "ライブラリ" + IDS_CAT_OFFICE "オフィス" + IDS_CAT_OTHER "ãã®ä»–" + IDS_CAT_SCIENCE "科学" + IDS_CAT_TOOLS "ツール" + IDS_CAT_VIDEO "ビデオ" END STRINGTABLE DISCARDABLE BEGIN - IDS_APPTITLE "ReactOS ƒAƒvƒŠƒP[ƒVƒ‡ƒ“ ƒ}ƒl[ƒWƒƒ" - IDS_SEARCH_TEXT "ŒŸõ..." - IDS_INSTALL "ƒCƒ“ƒXƒg[ƒ‹" - IDS_UNINSTALL "ƒAƒ“ƒCƒ“ƒXƒg[ƒ‹" - IDS_MODIFY "•ÏX" - IDS_APPS_COUNT "ƒAƒvƒŠƒP[ƒVƒ‡ƒ“”: %d" - IDS_WELCOME_TITLE "ReactOS ƒAƒvƒŠƒP[ƒVƒ‡ƒ“ ƒ}ƒl[ƒWƒƒ‚ւ悤‚±‚»!\n\n" - IDS_WELCOME_TEXT "¶‘¤‚©‚çƒJƒeƒSƒŠ‚ð‘I‘ð‚µAƒCƒ“ƒXƒg[ƒ‹–”‚̓Aƒ“ƒCƒ“ƒXƒg[ƒ‹‚·‚éƒAƒvƒŠƒP[ƒVƒ‡ƒ“‚ð‘I‚ñ‚Å‚­‚¾‚³‚¢B\nReactOS ƒEƒFƒu ƒTƒCƒg: " + IDS_APPTITLE "ReactOS アプリケーション マãƒãƒ¼ã‚¸ãƒ£" + IDS_SEARCH_TEXT "検索..." + IDS_INSTALL "インストール" + IDS_UNINSTALL "アンインストール" + IDS_MODIFY "変更" + IDS_APPS_COUNT "アプリケーション数: %d" + IDS_WELCOME_TITLE "ReactOS アプリケーション マãƒãƒ¼ã‚¸ãƒ£ã¸ã‚ˆã†ã“ã!\n\n" + IDS_WELCOME_TEXT "å·¦å´ã‹ã‚‰ã‚«ãƒ†ã‚´ãƒªã‚’é¸æŠžã—ã€ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«åˆã¯ã‚¢ãƒ³ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã™ã‚‹ã‚¢ãƒ—リケーションをé¸ã‚“ã§ãã ã•ã„。\nReactOS ウェブ サイト: " IDS_WELCOME_URL "http://www.reactos.org" - IDS_INSTALLED "ƒCƒ“ƒXƒg[ƒ‹Ï‚Ý" - IDS_AVAILABLEFORINST "ƒCƒ“ƒXƒg[ƒ‹‰Â”\\" - IDS_UPDATES "ƒAƒbƒvƒf[ƒg" - IDS_APPLICATIONS "ƒAƒvƒŠƒP[ƒVƒ‡ƒ“" - IDS_CHOOSE_FOLDER_TEXT "ƒvƒƒOƒ‰ƒ€‚̃_ƒEƒ“ƒ[ƒh‚ÉŽg—p‚·‚éƒtƒHƒ‹ƒ_‚ð‘I‘ð‚µ‚Ä‚­‚¾‚³‚¢:" - IDS_CHOOSE_FOLDER_ERROR "Žw’肳‚ꂽƒtƒHƒ‹ƒ_‚Í‘¶Ý‚µ‚Ü‚¹‚ñ!" - IDS_USER_NOT_ADMIN """ReactOS ƒAƒvƒŠƒP[ƒVƒ‡ƒ“ ƒ}ƒl[ƒWƒƒ"" ‚ð‹N“®‚·‚é‚É‚ÍŠÇ—ŽÒŒ ŒÀ‚Å‚ ‚é•K—v‚ª‚ ‚è‚Ü‚·!" - IDS_APP_REG_REMOVE "ƒŒƒWƒXƒgƒŠ‚©‚çƒCƒ“ƒXƒg[ƒ‹‚³‚ꂽƒvƒƒOƒ‰ƒ€‚ÉŠÖ‚·‚éƒf[ƒ^‚ð휂µ‚Ä‚à‚æ‚낵‚¢‚Å‚·‚©?" - IDS_INFORMATION "î•ñ" - IDS_UNABLE_TO_REMOVE "ƒŒƒWƒXƒgƒŠ‚©‚炱‚̃vƒƒOƒ‰ƒ€‚ÉŠÖ‚·‚éƒf[ƒ^‚ð휂ł«‚Ü‚¹‚ñ!" + IDS_INSTALLED "インストール済ã¿" + IDS_AVAILABLEFORINST "インストールå¯èƒ½" + IDS_UPDATES "アップデート" + IDS_APPLICATIONS "アプリケーション" + IDS_CHOOSE_FOLDER_TEXT "プログラムã®ãƒ€ã‚¦ãƒ³ãƒ­ãƒ¼ãƒ‰ã«ä½¿ç”¨ã™ã‚‹ãƒ•ã‚©ãƒ«ãƒ€ã‚’é¸æŠžã—ã¦ãã ã•ã„:" + IDS_CHOOSE_FOLDER_ERROR "指定ã•ã‚ŒãŸãƒ•ã‚©ãƒ«ãƒ€ã¯å­˜åœ¨ã—ã¾ã›ã‚“!" + IDS_USER_NOT_ADMIN """ReactOS アプリケーション マãƒãƒ¼ã‚¸ãƒ£"" ã‚’èµ·å‹•ã™ã‚‹ã«ã¯ç®¡ç†è€…権é™ã§ã‚ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™!" + IDS_APP_REG_REMOVE "レジストリã‹ã‚‰ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•ã‚ŒãŸãƒ—ログラムã«é–¢ã™ã‚‹ãƒ‡ãƒ¼ã‚¿ã‚’削除ã—ã¦ã‚‚よã‚ã—ã„ã§ã™ã‹?" + IDS_INFORMATION "情報" + IDS_UNABLE_TO_REMOVE "レジストリã‹ã‚‰ã“ã®ãƒ—ログラムã«é–¢ã™ã‚‹ãƒ‡ãƒ¼ã‚¿ã‚’削除ã§ãã¾ã›ã‚“!" END diff --git a/base/applications/rapps/lang/sv-SE.rc b/base/applications/rapps/lang/sv-SE.rc index 181bcf45f3a..9f1fed1529d 100644 --- a/base/applications/rapps/lang/sv-SE.rc +++ b/base/applications/rapps/lang/sv-SE.rc @@ -1,8 +1,8 @@ /* * PROJECT: ReactOS RAPPS - * FILE: \base\applications\rapps\lang\sv-SE.rc + * FILE: \base\applications\rapps\lang\sv-SE.rc * PURPOSE: Swedish resource file - * Translation: Jaix Bly + * Translation: Jaix Bly */ #pragma code_page(65001) // UTF-8 @@ -23,9 +23,9 @@ BEGIN MENUITEM "&Avinstallera",ID_UNINSTALL MENUITEM "&Ändra", ID_MODIFY MENUITEM SEPARATOR - MENUITEM "&Ta bort frÃ¥n Registret", ID_REGREMOVE + MENUITEM "&Ta bort frĺn Registret", ID_REGREMOVE MENUITEM SEPARATOR - MENUITEM "&Uppdatere", ID_REFRESH + MENUITEM "&Uppdatera", ID_REFRESH END POPUP "Hjälp" BEGIN @@ -38,8 +38,8 @@ IDR_LINKMENU MENU BEGIN POPUP "popup" BEGIN - MENUITEM "&Öppne länk i webläsare", ID_OPEN_LINK - MENUITEM "&Kopier länk till urklipp", ID_COPY_LINK + MENUITEM "&Öppna länk i webläsare", ID_OPEN_LINK + MENUITEM "&Kopiera länk till urklipp", ID_COPY_LINK END END @@ -49,9 +49,9 @@ BEGIN BEGIN MENUITEM "&Installera", ID_INSTALL MENUITEM "&Avinstallera", ID_UNINSTALL - MENUITEM "&Ändre", ID_MODIFY + MENUITEM "&Ändra", ID_MODIFY MENUITEM SEPARATOR - MENUITEM "&Ta bort frÃ¥n Registret", ID_REGREMOVE + MENUITEM "&Ta bort frĺn Registret", ID_REGREMOVE MENUITEM SEPARATOR MENUITEM "&Uppdatera", ID_REFRESH END @@ -63,7 +63,7 @@ CAPTION "Inställningar" FONT 8, "MS Shell Dlg" BEGIN GROUPBOX "Allmänna", -1, 4, 2, 240, 61 - AUTOCHECKBOX "&Spara fönster position", IDC_SAVE_WINDOW_POS, 15, 12, 219, 12 + AUTOCHECKBOX "&Spara fönsterposition", IDC_SAVE_WINDOW_POS, 15, 12, 219, 12 AUTOCHECKBOX "&Uppdatera listan med tillgängliga program vid start", IDC_UPDATE_AVLIST, 15, 29, 219, 12 AUTOCHECKBOX "&Logga ur installation och borttagning program", IDC_LOG_ENABLED, 15, 46, 219, 12 @@ -71,9 +71,9 @@ BEGIN LTEXT "Mapp för nerladdningar:", -1, 16, 75, 100, 9 EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP PUSHBUTTON "&Välj", IDC_CHOOSE, 187, 85, 50, 14 - AUTOCHECKBOX "&Ta bort programms installerare efter installation", IDC_DEL_AFTER_INSTALL, 16, 100, 218, 12 + AUTOCHECKBOX "&Ta bort programinstallerare efter installation", IDC_DEL_AFTER_INSTALL, 16, 100, 218, 12 - PUSHBUTTON "Förinställd", IDC_DEFAULT_SETTINGS, 8, 124, 60, 14 + PUSHBUTTON "Standard", IDC_DEFAULT_SETTINGS, 8, 124, 60, 14 PUSHBUTTON "OK", IDOK, 116, 124, 60, 14 PUSHBUTTON "Avbryt", IDCANCEL, 181, 124, 60, 14 END @@ -85,7 +85,7 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "...", IDC_INSTALL_TEXT, 4, 5, 209, 35 - AUTORADIOBUTTON "&Installera frÃ¥n disk (CD or DVD)", IDC_CD_INSTALL, 10, 46, 197, 11, WS_GROUP + AUTORADIOBUTTON "&Installera frĺn disk (CD or DVD)", IDC_CD_INSTALL, 10, 46, 197, 11, WS_GROUP AUTORADIOBUTTON "&Ladda ner och installera", IDC_DOWNLOAD_INSTALL, 10, 59, 197, 11, NOT WS_TABSTOP PUSHBUTTON "OK", IDOK, 86, 78, 60, 14 @@ -187,16 +187,16 @@ BEGIN IDS_MODIFY "Ändra" IDS_APPS_COUNT "Programantal: %d" IDS_WELCOME_TITLE "Välkommen till ReactOS programhanterare!\n\n" - IDS_WELCOME_TEXT "Välj en kategori till vänstre, och sedan ett program för att installera eller avinstallera.\nReactOS Web sida: " + IDS_WELCOME_TEXT "Välj en kategori till vänster, och sedan ett program för att installera eller avinstallera.\nReactOS Web sida: " IDS_WELCOME_URL "http://www.reactos.org" IDS_INSTALLED "Installerat" IDS_AVAILABLEFORINST "Tillgängliga for installation" IDS_UPDATES "Uppdateringar" IDS_APPLICATIONS "Program" IDS_CHOOSE_FOLDER_TEXT "Välj en mapp som kommer att användas för nerladdning av program:" - IDS_CHOOSE_FOLDER_ERROR "Du har specificrat en obefintlig mapp!" - IDS_USER_NOT_ADMIN "Du mÃ¥ste vara administratör för att starta ""ReactOS programhanterare""!" - IDS_APP_REG_REMOVE "Är du säker pÃ¥ att du vill ta bort data det installerade programmets data frÃ¥n registret?" + IDS_CHOOSE_FOLDER_ERROR "Du har specificrat en ej existerande mapp! Vill du skapa den?" + IDS_USER_NOT_ADMIN "Du mĺste vara administratör för att starta ""ReactOS programhanterare""!" + IDS_APP_REG_REMOVE "Är du säker pĺ att du vill ta bort data det installerade programmets data frĺn registret?" IDS_INFORMATION "Information" - IDS_UNABLE_TO_REMOVE "Det gick ej att ta bort programmets data frÃ¥n registret!" + IDS_UNABLE_TO_REMOVE "Det gick ej att ta bort programmets data frĺn registret!" END diff --git a/base/applications/rapps/rapps/abyss.txt b/base/applications/rapps/rapps/abyss.txt index 89e0d78ba54..5dbbe7c11b7 100644 --- a/base/applications/rapps/rapps/abyss.txt +++ b/base/applications/rapps/rapps/abyss.txt @@ -14,6 +14,9 @@ CDPath = none [Section.0407] Description = Abyss Web Server ermöglicht es Webseiten auf Ihrem Computer zu hosten. Er unterstützt sichere SSL/TLS Verbindungen (HTTPS) sowie eine Vielfalt an Web Technologien. Er kann ebenfalls PHP, Perl, Python, ASP, ASP.NET, und Ruby on Rails Web Anwendungen ausführen, welche von Datenbanken, wie MySQL, SQLite, MS SQL Server, MS Access, oder Oracle unterstützt werden können. +[Section.040a] +Description = Abyss Web Server le permite alojar sitios Web en su ordenador. Soporta conexiones seguras SSL / TLS (HTTPS) así como una gran cantidad de tecnología web. También puede ejecutar aplicaciones web PHP, Perl, Python, ASP, ASP.Net, Ruby y Ruby on Rails, que pueden ser asociadas con bases de datos tales como MySQL, SQLite, MS SQL Server, MS Access u Oracle. + [Section.040c] Description = Abyss Web Server vous permet d'héberger vos sites internet sur votre ordinateur. Il supporte les connexions sécurisées SSL/TLS (HTTPS) ainsi qu'un grand nombre de technologies web. Il peut également faire tourner des applications web PHP, Perl, Python, ASP, ASP.Net, Ruby et Ruby on Rails, qui peuvent être associées à des bases de données telles que MySQL, SQLite, MS SQL Server, MS Access ou Oracle. diff --git a/base/applications/rapps/rapps/fap.txt b/base/applications/rapps/rapps/fap.txt index 420e1cffa19..2ea6cf397dd 100644 --- a/base/applications/rapps/rapps/fap.txt +++ b/base/applications/rapps/rapps/fap.txt @@ -14,6 +14,9 @@ CDPath = none [Section.0407] Description = Kleiner und einfacher Mediaplayer. +[Section.040a] +Description = Reproductor de audio simple y ligero. + [Section.040c] Description = Lecteur audio simple et léger. diff --git a/base/applications/rapps/rapps/firefox2.txt b/base/applications/rapps/rapps/firefox2.txt index efb7f8b514c..ec5e692fb83 100644 --- a/base/applications/rapps/rapps/firefox2.txt +++ b/base/applications/rapps/rapps/firefox2.txt @@ -39,6 +39,12 @@ URLSite = http://www.mozilla-europe.org/pl/ Description = Один из Ñамых популÑрных и лучших беÑплатных браузеров. URLSite = http://www.mozilla-europe.org/ru/ +[Section.041b] +Description = Najpopulárnejší a jeden z najlepších slobodný webových prehliadaÄov. +Size = 6,1 MB +URLSite = http://www.mozilla-europe.org/sk/ +URLDownload = http://mozilla.mirrors.skynet.be/pub/ftp.mozilla.org/firefox/releases/2.0.0.20/win32/sk/Firefox%20Setup%202.0.0.20.exe + [Section.0422] Description = ÐайпопулÑрніший та один з кращих безплатних веб-браузерів. URLSite = http://www.mozilla-europe.org/uk/ diff --git a/base/applications/rapps/rapps/firefox3.txt b/base/applications/rapps/rapps/firefox3.txt index 065202dd921..52e8bc64f44 100644 --- a/base/applications/rapps/rapps/firefox3.txt +++ b/base/applications/rapps/rapps/firefox3.txt @@ -45,6 +45,12 @@ Description = Один из Ñамых популÑрных и лучших бе Size = 7.8M URLSite = http://www.mozilla-europe.org/ru/ +[Section.041b] +Description = Najpopulárnejší a jeden z najlepších slobodný webových prehliadaÄov. +Size = 7,5 MB +URLSite = http://www.mozilla-europe.org/sk/ +URLDownload = http://hyperion.zih.tu-dresden.de/moz/firefox/releases/3.0.19-real-real/win32/sk/Firefox%20Setup%203.0.19.exe + [Section.0422] Description = ÐайпопулÑрніший та один з кращих безплатних веб-браузерів. Size = 7.4M diff --git a/base/applications/rapps/rapps/firefox36.txt b/base/applications/rapps/rapps/firefox36.txt index 207565f77b1..af292db6042 100644 --- a/base/applications/rapps/rapps/firefox36.txt +++ b/base/applications/rapps/rapps/firefox36.txt @@ -47,6 +47,12 @@ Size = 8.5M URLSite = http://www.mozilla-europe.org/ru/ URLDownload = http://mozilla.cdn.leaseweb.com/firefox/releases/3.6.16/win32/ru/Firefox%20Setup%203.6.16.exe +[Section.041b] +Description = Najpopulárnejší a jeden z najlepších slobodný webových prehliadaÄov. +Size = 8,5 MB +URLSite = http://www.mozilla-europe.org/sk/ +URLDownload = http://mozilla.cdn.leaseweb.com/firefox/releases/3.6.16/win32/sk/Firefox%20Setup%203.6.16.exe + [Section.0422] Description = ÐайпопулÑрніший та один з кращих безплатних веб-браузерів. Size = 8.5M diff --git a/base/applications/rapps/rapps/kdewin.txt b/base/applications/rapps/rapps/kdewin.txt index d3b6383f61c..99e3de0ed5d 100644 --- a/base/applications/rapps/rapps/kdewin.txt +++ b/base/applications/rapps/rapps/kdewin.txt @@ -14,6 +14,9 @@ CDPath = none [Section.0407] Description = KDE für Windows. +[Section.040a] +Description = KDE para Windows. + [Section.040c] Description = KDE pour Windows. diff --git a/base/applications/rapps/rapps/mono2.txt b/base/applications/rapps/rapps/mono2.txt index 3b4b6c0dfad..a34a94fa8b0 100644 --- a/base/applications/rapps/rapps/mono2.txt +++ b/base/applications/rapps/rapps/mono2.txt @@ -11,6 +11,9 @@ URLSite = http://www.mono-project.com/Main_Page URLDownload = http://ftp.novell.com/pub/mono/archive/2.8.2/windows-installer/1/mono-2.8.2-gtksharp-2.12.10-win32-1.exe CDPath = none +[Section.040a] +Description = Versión open-source de .NET Framework + [Section.040c] Description = Framework .net open source. diff --git a/base/applications/rapps/rapps/mpc.txt b/base/applications/rapps/rapps/mpc.txt index 5c369cf8fd9..d844b2392c3 100644 --- a/base/applications/rapps/rapps/mpc.txt +++ b/base/applications/rapps/rapps/mpc.txt @@ -26,5 +26,8 @@ Description = Мультимедийный проигрыватель. [Section.0415] Description = Odtwarzacz multimediów. +[Section.041b] +Description = Multimediálny prehrávaÄ. + [Section.0422] Description = Мультимедійний програвач. diff --git a/base/applications/rapps/rapps/net11.txt b/base/applications/rapps/rapps/net11.txt index 4ba17e8c506..c2ea5087369 100644 --- a/base/applications/rapps/rapps/net11.txt +++ b/base/applications/rapps/rapps/net11.txt @@ -11,6 +11,9 @@ URLSite = http://www.microsoft.com/downloads/details.aspx?FamilyId=262D25E3-F589 URLDownload = http://download.microsoft.com/download/a/a/c/aac39226-8825-44ce-90e3-bf8203e74006/dotnetfx.exe CDPath = none +[Section.040a] +Description = Microsoft .NET Framework versión 1.1 - Paquete redistribuible. + [Section.040c] Description = Microsoft .NET Framework version 1.1 - Paquet redistribuable. diff --git a/base/applications/rapps/rapps/net20.txt b/base/applications/rapps/rapps/net20.txt index 3b01fbaf29b..48c2d8b2536 100644 --- a/base/applications/rapps/rapps/net20.txt +++ b/base/applications/rapps/rapps/net20.txt @@ -11,6 +11,9 @@ URLSite = http://www.microsoft.com/downloads/details.aspx?FamilyID=0856eacb-4362 URLDownload = http://download.microsoft.com/download/5/6/7/567758a3-759e-473e-bf8f-52154438565a/dotnetfx.exe CDPath = none +[Section.040a] +Description = Microsoft .NET Framework versión 2.0 - Paquete redistribuible. + [Section.040c] Description = Microsoft .NET Framework version 2.0 - Paquet redistribuable. diff --git a/base/applications/rapps/rapps/net20sp2.txt b/base/applications/rapps/rapps/net20sp2.txt index ef47b60270b..b7155dda584 100644 --- a/base/applications/rapps/rapps/net20sp2.txt +++ b/base/applications/rapps/rapps/net20sp2.txt @@ -11,6 +11,9 @@ URLSite = http://www.microsoft.com/downloads/details.aspx?familyid=5B2C0358-915B URLDownload = http://download.microsoft.com/download/c/6/e/c6e88215-0178-4c6c-b5f3-158ff77b1f38/NetFx20SP2_x86.exe CDPath = none +[Section.040a] +Description = Microsoft .NET Framework versión 2.0 Service Pack 2. + [Section.040c] Description = Microsoft .NET Framework version 2.0 Service Pack 2. diff --git a/base/applications/rapps/rapps/python.txt b/base/applications/rapps/rapps/python.txt index 40aa3ead5d8..2bb660df6e2 100644 --- a/base/applications/rapps/rapps/python.txt +++ b/base/applications/rapps/rapps/python.txt @@ -1,7 +1,7 @@ ; UTF-8 [Section] -Name = Python +Name = Python 2 Version = 2.7.1 Licence = GPL/LGPL Description = A remarkably powerful dynamic programming language. @@ -14,6 +14,9 @@ CDPath = none [Section.0407] Description = Eine sehr mächtige, dynamische Programmiersprache. +[Section.040a] +Description = Un lenguaje de programación dinámico sumamente potente. + [Section.040c] Description = Un langage de programmation dynamique remarquablement puissant. diff --git a/base/applications/rapps/rapps/python3.txt b/base/applications/rapps/rapps/python3.txt new file mode 100644 index 00000000000..d97ef7398ea --- /dev/null +++ b/base/applications/rapps/rapps/python3.txt @@ -0,0 +1,27 @@ +; UTF-8 + +[Section] +Name = Python 3 +Version = 3.2 +Licence = GPL/LGPL +Description = A remarkably powerful dynamic programming language. +Size = 17.2MB +Category = 7 +URLSite = http://www.python.org/ +URLDownload = http://www.python.org/ftp/python/3.2/python-3.2.msi +CDPath = none + +[Section.0407] +Description = Eine sehr mächtige, dynamische Programmiersprache. + +[Section.040a] +Description = Un lenguaje de programación dinámico sumamente potente. + +[Section.040c] +Description = Un langage de programmation dynamique remarquablement puissant. + +[Section.0415] +Description = Potęży i dynamiczny jÄ™zyk programowania. + +[Section.0422] +Description = Дуже потужна динамічна мова програмуваннÑ. diff --git a/base/applications/rapps/rapps/remood.txt b/base/applications/rapps/rapps/remood.txt index 7a05e5dc8f9..bb67d85364a 100644 --- a/base/applications/rapps/rapps/remood.txt +++ b/base/applications/rapps/rapps/remood.txt @@ -14,6 +14,9 @@ CDPath = none [Section.0407] Description = ReMooD ist ein Port des Doom Legacy Sources. Es versucht das klassische Legacy Erfahrung zusammen mit neuen Features und mehr Stabilität zu bieten. +[Section.040a] +Description = ReMood es un port de Doom Legacy. Su fin es proporcionar la clásica experiencia anterior con nuevas características y mayor estabilidad. + [Section.040c] Description = ReMood est un portage du source de Doom Legacy. Son but est de fournir l'expérience classique de Legacy avec de nouvelles fonctionnalités et plus de stabilité. diff --git a/base/applications/rapps/rapps/steam.txt b/base/applications/rapps/rapps/steam.txt index 615734a26d4..6306fde7903 100644 --- a/base/applications/rapps/rapps/steam.txt +++ b/base/applications/rapps/rapps/steam.txt @@ -14,6 +14,9 @@ CDPath = none [Section.0407] Description = Die STEAM Spieleplattform, die von viele Spielen verwendet wird. +[Section.040a] +Description = La plataforma de juego STEAM usada por muchos juegos actuales. + [Section.040c] Description = La plateforme de jeu STEAM utilisée par beaucoup de jeux de nos jours. diff --git a/base/applications/rapps/rapps/sumatrapdf.txt b/base/applications/rapps/rapps/sumatrapdf.txt index 1e142ed113a..a28ff505811 100644 --- a/base/applications/rapps/rapps/sumatrapdf.txt +++ b/base/applications/rapps/rapps/sumatrapdf.txt @@ -14,6 +14,12 @@ CDPath = none [Section.0407] Description = Sumatra PDF ist ein freies, schlankes, Open-Source PDF-Anzeigeprogramm. +[Section.040a] +Description = Sumatra PDF es un lector PDF ligero, libre y open-source. + +[Section.040c] +Description = Sumatra PDF est un lecteur PDF léger, libre et open-source. + [Section.0410] Description = Sumatra PDF è un visualizzatore di file PDF. E' molto leggero ed è open source. diff --git a/base/applications/rapps/rapps/superfinder.txt b/base/applications/rapps/rapps/superfinder.txt index 350ac49bc84..04d6b0f1ead 100644 --- a/base/applications/rapps/rapps/superfinder.txt +++ b/base/applications/rapps/rapps/superfinder.txt @@ -14,6 +14,9 @@ CDPath = none [Section.0407] Description = Eine schnelle und effektive Suchanwendung. +[Section.040a] +Description = Una aplicación de búsqueda rápida llena de opciones. + [Section.040c] Description = Une application de recherche rapide et riche en fonctionnalités. diff --git a/base/applications/rapps/rapps/tahoma.txt b/base/applications/rapps/rapps/tahoma.txt index 41addaf0e6a..5081cd4d3a4 100644 --- a/base/applications/rapps/rapps/tahoma.txt +++ b/base/applications/rapps/rapps/tahoma.txt @@ -15,6 +15,10 @@ CDPath = none Licence = Unbekannt Description = Tahoma Font pack, der von einigen Anwendungen benötigt wird (Steam). +[Section.040a] +Licence = Desconocida +Description = Paquete de fuente Tahoma, necesaria para ciertas aplicaciones (Steam). + [Section.040c] Licence = Inconnue Description = Package pour la police Tahoma, nécessaire pour certaines applications (Steam). diff --git a/base/applications/rapps/rapps/vlc.txt b/base/applications/rapps/rapps/vlc.txt index 0e35475c489..a5cf92e77c4 100644 --- a/base/applications/rapps/rapps/vlc.txt +++ b/base/applications/rapps/rapps/vlc.txt @@ -26,5 +26,8 @@ Description = Odtwarzacz multimediów. [Section.0419] Description = Мультимедийный проигрыватель. +[Section.041b] +Description = Multimediálny prehrávaÄ. + [Section.0422] Description = Мультимедійний програвач. diff --git a/base/applications/rapps/rapps/wme9.txt b/base/applications/rapps/rapps/wme9.txt index 994896f5907..cced38c3f0f 100644 --- a/base/applications/rapps/rapps/wme9.txt +++ b/base/applications/rapps/rapps/wme9.txt @@ -17,11 +17,14 @@ Licence = Unbekannt [Section.040a] Licence = Desconocida -[Section.040a] +[Section.040c] Licence = Inconnue [Section.0415] Licence = Nieznana +[Section.041b] +Description = Neznáma + [Section.0422] Licence = Ðевідома diff --git a/base/applications/rapps/rsrc.rc b/base/applications/rapps/rsrc.rc index 6b044639b71..bd235c70f2f 100644 --- a/base/applications/rapps/rsrc.rc +++ b/base/applications/rapps/rsrc.rc @@ -5,7 +5,7 @@ #include "lang/es-ES.rc" #include "lang/fr-FR.rc" #include "lang/it-IT.rc" -//#include "lang/ja-JP.rc" FIXME: iconv issue +#include "lang/ja-JP.rc" #include "lang/no-NO.rc" #include "lang/pl-PL.rc" #include "lang/ru-RU.rc" diff --git a/base/applications/rapps/winmain.c b/base/applications/rapps/winmain.c index 9f6a0fc65f7..599665f8b75 100644 --- a/base/applications/rapps/winmain.c +++ b/base/applications/rapps/winmain.c @@ -717,6 +717,16 @@ MainWindowProc(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) return TRUE; } + case WM_SYSCOLORCHANGE: + { + /* Forward WM_SYSCOLORCHANGE to common controls */ + SendMessage(hListView, WM_SYSCOLORCHANGE, 0, 0); + SendMessage(hTreeView, WM_SYSCOLORCHANGE, 0, 0); + SendMessage(hToolBar, WM_SYSCOLORCHANGE, 0, 0); + SendMessageW(hRichEdit, EM_SETBKGNDCOLOR, 0, GetSysColor(COLOR_BTNFACE)); + } + break; + case WM_DESTROY: { ShowWindow(hwnd, SW_HIDE); diff --git a/base/applications/regedit/CMakeLists.txt b/base/applications/regedit/CMakeLists.txt index 411aaeae7fb..4fb1946f698 100644 --- a/base/applications/regedit/CMakeLists.txt +++ b/base/applications/regedit/CMakeLists.txt @@ -34,4 +34,4 @@ add_importlibs(regedit user32 gdi32 advapi32 ole32 shell32 comctl32 comdlg32 shl #add_subdirectory(clb) -add_cab_target(regedit 4) +add_cd_file(TARGET regedit DESTINATION reactos FOR all) diff --git a/base/applications/regedit/childwnd.c b/base/applications/regedit/childwnd.c index fcf5db21a03..378d2e7e8ba 100644 --- a/base/applications/regedit/childwnd.c +++ b/base/applications/regedit/childwnd.c @@ -367,7 +367,8 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa { PostMessage(g_pChildWnd->hAddressBarWnd, WM_KEYUP, VK_RETURN, 0); } - else if (!_CmdWndProc(hWnd, message, wParam, lParam)) + + if (!_CmdWndProc(hWnd, message, wParam, lParam)) { goto def; } diff --git a/base/applications/regedit/clb/lang/fr-FR.rc b/base/applications/regedit/clb/lang/fr-FR.rc new file mode 100644 index 00000000000..a532465a262 --- /dev/null +++ b/base/applications/regedit/clb/lang/fr-FR.rc @@ -0,0 +1,32 @@ +/* * + * French Language Resource File * + * Traduit par : Jeisson Toscano en 2011 * + * */ + +LANGUAGE LANG_FRENCH, SUBLANG_DEFAULT + +IDD_COLUMNLISTBOXSTYLES DIALOGEX 0, 0, 227, 215 +STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Styles de Boites de la Liste de la Colonne" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + GROUPBOX "Styles des Colonne de la Liste", -1, 6, 7, 158, 71 + CHECKBOX "&Standard", 1710, 10, 20, 42, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "&Bordure", 1713, 10, 30, 34, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "&Ordre", 1705, 10, 40, 26, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "Notif&ier", 1706, 10, 50, 32, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "Barre de Déplac. V&ert.", 1707, 10, 60, 64, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "Sélection &Multiple", -1, 79, 20, 72, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP | WS_DISABLED + CHECKBOX "Sélection E&tendue", -1, 79, 30, 77, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP | WS_DISABLED + CHECKBOX "Montrer &Chevet", 1714, 79, 40, 68, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "Colonnes &Elastiques", 1715, 79, 50, 66, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + GROUPBOX "Styles Basiques", -1, 6, 80, 158, 34 + CHECKBOX "&Visible", 1701, 10, 92, 34, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "&Désactivé", 1702, 10, 102, 41, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "&Groupe", 1703, 79, 92, 32, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "Arrêter &Tab", 1704, 79, 102, 44, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + PUSHBUTTON "Accepter", IDOK, 37, 125, 40, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP + PUSHBUTTON "Annuler", IDCANCEL, 93, 125, 40, 14, BS_PUSHBUTTON | WS_GROUP | WS_TABSTOP + CHECKBOX "Dé&sactiver Non-Déplac.", 1708, 79, 60, 66, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP +END + diff --git a/base/applications/regedit/clb/rsrc.rc b/base/applications/regedit/clb/rsrc.rc index 56462377a84..176f4217132 100644 --- a/base/applications/regedit/clb/rsrc.rc +++ b/base/applications/regedit/clb/rsrc.rc @@ -32,6 +32,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL #include "lang/de-DE.rc" #include "lang/el-GR.rc" #include "lang/en-US.rc" +#include "lang/fr-FR.rc" #include "lang/es-ES.rc" #include "lang/id-ID.rc" #include "lang/it-IT.rc" diff --git a/base/applications/regedit/framewnd.c b/base/applications/regedit/framewnd.c index 5d9a68264c9..e37adbef08b 100644 --- a/base/applications/regedit/framewnd.c +++ b/base/applications/regedit/framewnd.c @@ -1177,6 +1177,11 @@ LRESULT CALLBACK FrameWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa case WM_MENUSELECT: OnMenuSelect(hWnd, LOWORD(wParam), HIWORD(wParam), (HMENU)lParam); break; + case WM_SYSCOLORCHANGE: + /* Forward WM_SYSCOLORCHANGE to common controls */ + SendMessage(g_pChildWnd->hListWnd, WM_SYSCOLORCHANGE, 0, 0); + SendMessage(g_pChildWnd->hTreeWnd, WM_SYSCOLORCHANGE, 0, 0); + break; case WM_DESTROY: WinHelp(hWnd, _T("regedit"), HELP_QUIT, 0); PostQuitMessage(0); diff --git a/base/applications/regedit/lang/sv-SE.rc b/base/applications/regedit/lang/sv-SE.rc index 70832d3e573..8a890d7a48d 100644 --- a/base/applications/regedit/lang/sv-SE.rc +++ b/base/applications/regedit/lang/sv-SE.rc @@ -1,7 +1,7 @@ /* * Regedit (Swedish resources) * - * Copyright 2005 Andreas Bjerkeholt + * Copyright 2005 Andreas Bjerkeholt modifierad 2011 Jaix Bly * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -54,8 +54,8 @@ BEGIN MENUITEM "&Exportera registerfil...", ID_REGISTRY_EXPORTREGISTRYFILE MENUITEM SEPARATOR - MENUITEM "Load Hive...", ID_REGISTRY_LOADHIVE, GRAYED - MENUITEM "Unload Hive...", ID_REGISTRY_UNLOADHIVE, GRAYED + MENUITEM "Läs in Registerdata...", ID_REGISTRY_LOADHIVE, GRAYED + MENUITEM "Ta bort Registerdata...", ID_REGISTRY_UNLOADHIVE, GRAYED MENUITEM SEPARATOR MENUITEM "&Anslut Nätverksregister...", ID_REGISTRY_CONNECTNETWORKREGISTRY @@ -72,15 +72,15 @@ BEGIN BEGIN MENUITEM "&Ändra", ID_EDIT_MODIFY MENUITEM SEPARATOR - POPUP "&Ny(tt)" + POPUP "&Nytt" BEGIN MENUITEM "&Nyckel", ID_EDIT_NEW_KEY MENUITEM SEPARATOR MENUITEM "&Strängvärde", ID_EDIT_NEW_STRINGVALUE MENUITEM "&Binärvärde", ID_EDIT_NEW_BINARYVALUE MENUITEM "&DWORD-värde", ID_EDIT_NEW_DWORDVALUE - MENUITEM "&Multi-String Value", ID_EDIT_NEW_MULTISTRINGVALUE - MENUITEM "&Expandable String Value", ID_EDIT_NEW_EXPANDABLESTRINGVALUE + MENUITEM "&Multisträngvärde", ID_EDIT_NEW_MULTISTRINGVALUE + MENUITEM "&Expanderbart Strängvärde", ID_EDIT_NEW_EXPANDABLESTRINGVALUE END MENUITEM SEPARATOR MENUITEM "B&ehörigheter...", ID_EDIT_PERMISSIONS @@ -90,7 +90,7 @@ BEGIN MENUITEM SEPARATOR MENUITEM "&Kopiera nyckelnamn", ID_EDIT_COPYKEYNAME MENUITEM SEPARATOR - MENUITEM "&Sök\tCtrl+F", ID_EDIT_FIND + MENUITEM "&Sök...\tCtrl+F", ID_EDIT_FIND MENUITEM "Sök N&ästa\tF3", ID_EDIT_FINDNEXT END POPUP "&Visa" @@ -126,15 +126,15 @@ BEGIN END POPUP "" BEGIN - POPUP "&Ny(tt)" + POPUP "&Nytt" BEGIN MENUITEM "&Nyckel", ID_EDIT_NEW_KEY MENUITEM SEPARATOR MENUITEM "&Strängvärde", ID_EDIT_NEW_STRINGVALUE MENUITEM "&Binärvärde", ID_EDIT_NEW_BINARYVALUE MENUITEM "&DWORD-värde", ID_EDIT_NEW_DWORDVALUE - MENUITEM "&Multi-String Value", ID_EDIT_NEW_MULTISTRINGVALUE - MENUITEM "&Expandable String Value", ID_EDIT_NEW_EXPANDABLESTRINGVALUE + MENUITEM "&Multisträngvärde", ID_EDIT_NEW_MULTISTRINGVALUE + MENUITEM "&Expanderbart Strängvalue", ID_EDIT_NEW_EXPANDABLESTRINGVALUE END END POPUP "" @@ -155,19 +155,19 @@ BEGIN MENUITEM "&Ta bort", ID_TREE_DELETE MENUITEM "&Byt namn", ID_TREE_RENAME MENUITEM SEPARATOR - MENUITEM "&Export", ID_TREE_EXPORT - MENUITEM "&Permissions...", ID_TREE_PERMISSIONS, GRAYED + MENUITEM "&Exportera", ID_TREE_EXPORT + MENUITEM "&Behörigheter...", ID_TREE_PERMISSIONS, GRAYED MENUITEM SEPARATOR MENUITEM "&Kopiera nyckelnamn", ID_EDIT_COPYKEYNAME END POPUP "" BEGIN - MENUITEM "C&ut", ID_HEXEDIT_CUT - MENUITEM "&Copy", ID_HEXEDIT_COPY - MENUITEM "&Paste", ID_HEXEDIT_PASTE - MENUITEM "&Delete", ID_HEXEDIT_DELETE + MENUITEM "Klipp &ut", ID_HEXEDIT_CUT + MENUITEM "&Kopiera", ID_HEXEDIT_COPY + MENUITEM "Klistra &in", ID_HEXEDIT_PASTE + MENUITEM "&Ta bort", ID_HEXEDIT_DELETE MENUITEM SEPARATOR - MENUITEM "Select &All", ID_HEXEDIT_SELECT_ALL + MENUITEM "Markera &Allt", ID_HEXEDIT_SELECT_ALL END END @@ -177,13 +177,13 @@ END */ IDD_LOADHIVE DIALOGEX DISCARDABLE 0, 0, 193, 34 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Load Hive" +CAPTION "Läs in registerdata" FONT 8, "Ms Shell Dlg" { - LTEXT "&Key:", IDC_STATIC, 4, 4, 15, 8, SS_LEFT + LTEXT "&Nyckel:", IDC_STATIC, 4, 4, 15, 8, SS_LEFT EDITTEXT IDC_EDIT_KEY, 23, 2, 167, 13 DEFPUSHBUTTON "OK", IDOK, 140, 17, 50, 14 - PUSHBUTTON "Cancel", IDCANCEL, 89, 17, 50, 14 + PUSHBUTTON "Avbryt", IDCANCEL, 89, 17, 50, 14 } IDD_EDIT_STRING DIALOGEX 32, 24, 252, 84 @@ -203,7 +203,7 @@ END IDD_EDIT_MULTI_STRING DIALOGEX 32, 24, 252, 174 STYLE DS_SHELLFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Ändra multi-sträng" +CAPTION "Ändra multisträng" FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Värde:",IDC_STATIC,6,6,134,8 @@ -285,9 +285,9 @@ BEGIN ID_REGISTRY_EXPORTREGISTRYFILE "Exporterar hela eller en del av registret till en textfil" ID_REGISTRY_LOADHIVE - "Loads a hive file into the registry" + "Läser in registerdatafil till registret" ID_REGISTRY_UNLOADHIVE - "Unloads a hive from the registry" + "Tar bort registerdatafil från registret" ID_REGISTRY_CONNECTNETWORKREGISTRY "Ansluter till en annan dators register" ID_REGISTRY_DISCONNECTNETWORKREGISTRY @@ -316,23 +316,23 @@ STRINGTABLE DISCARDABLE BEGIN IDS_ERROR "Fel" IDS_WARNING "Varning" - IDS_BAD_KEY "Can't query key '%s'" + IDS_BAD_KEY "Kan inte läsa nyckel '%s'" IDS_BAD_VALUE "Kan inte läsa värdet '%s'" IDS_UNSUPPORTED_TYPE "Kan inte ändra nycklar av typen %ld" IDS_TOO_BIG_VALUE "Värdet är för stort (%ld)" IDS_MULTI_SZ_EMPTY_STRING "Data av typen REG_MULTI_SZ kan inte innehålla tomma strängar.\nDe tomma strängarna har tagits bort från listan." - IDS_QUERY_DELETE_KEY_ONE "Are you sure you want to delete this key?" - IDS_QUERY_DELETE_KEY_MORE "Are you sure you want to delete these keys?" - IDS_QUERY_DELETE_KEY_CONFIRM "Confirm Key Delete" - IDS_QUERY_DELETE_ONE "Är du säker på att du vill ta bort detta värde?" - IDS_QUERY_DELETE_MORE "Är du säker på att du vill ta bort dessa värden?" + IDS_QUERY_DELETE_KEY_ONE "Är du säker på att du vill ta bort denna nyckeln?" + IDS_QUERY_DELETE_KEY_MORE "Är du säker på att du vill ta bort dessa nycklarna?" + IDS_QUERY_DELETE_KEY_CONFIRM "Bekärfta borttagning av nyckel" + IDS_QUERY_DELETE_ONE "Är du säker på att du vill ta bort detta värdet?" + IDS_QUERY_DELETE_MORE "Är du säker på att du vill ta bort dessa värdena?" IDS_QUERY_DELETE_CONFIRM "Bekräfta borttagning av värde" - IDS_ERR_DELVAL_CAPTION "Borttagning misslyckades" + IDS_ERR_DELVAL_CAPTION "Fel vid borttagning av värde" IDS_ERR_DELETEVALUE "Det gick inte att ta bort alla specificerade värden!" - IDS_ERR_RENVAL_CAPTION "Namnbyte misslyckades" + IDS_ERR_RENVAL_CAPTION "Fel vid namnändring av värde" IDS_ERR_RENVAL_TOEMPTY "Kunde inte byta namn på %s. Det specificerade värdenamnet är tomt. Ange ett annat namn och försök igen." - IDS_NEW_KEY "New Key #%d" - IDS_NEW_VALUE "New Value #%d" + IDS_NEW_KEY "Ny Nyckel #%d" + IDS_NEW_VALUE "Nytt Värde #%d" END STRINGTABLE DISCARDABLE @@ -344,14 +344,14 @@ BEGIN IDS_MY_COMPUTER "Den här datorn" IDS_IMPORT_REG_FILE "Importera registerfil" IDS_EXPORT_REG_FILE "Exportera registerfil" - IDS_LOAD_HIVE "Load Hive" - IDS_UNLOAD_HIVE "Unload Hive" + IDS_LOAD_HIVE "Läs in registerdatafil" + IDS_UNLOAD_HIVE "Ta bort registerdatafil" IDS_INVALID_DWORD "(felaktigt DWORD-värde)" END STRINGTABLE DISCARDABLE BEGIN - IDS_FLT_REGFILE "Registration File" + IDS_FLT_REGFILE "Registerfil" IDS_FLT_REGFILES "Registerfiler" IDS_FLT_REGFILES_FLT "*.reg" IDS_FLT_REGEDIT4 "Win9x/NT4-Registerfiler (REGEDIT4)" @@ -388,7 +388,7 @@ BEGIN IDS_EXPAND "&Visa nivå" IDS_COLLAPSE "&Dölj nivå" IDS_GOTO_SUGGESTED_KEY "&Go to '%s'" - IDS_FINISHEDFIND "Finished searching through the registry." + IDS_FINISHEDFIND "Slutfört sökningen av registret." END /*****************************************************************/ @@ -402,66 +402,66 @@ IDD_EXPORTRANGE DIALOGEX DISCARDABLE 50, 50, 370, 50 STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_BORDER FONT 8, "MS Shell Dlg" BEGIN - GROUPBOX "Export Range",IDC_STATIC,2,0,366,48 - CONTROL "&All",IDC_EXPORT_ALL,"Button",BS_AUTORADIOBUTTON,10,10, 29,11 - CONTROL "S&elected Branch",IDC_EXPORT_BRANCH,"Button",BS_AUTORADIOBUTTON,10,22, 100,11 + GROUPBOX "Exportera Intervall",IDC_STATIC,2,0,366,48 + CONTROL "&Alla",IDC_EXPORT_ALL,"Button",BS_AUTORADIOBUTTON,10,10, 29,11 + CONTROL "&Vald Gren",IDC_EXPORT_BRANCH,"Button",BS_AUTORADIOBUTTON,10,22, 100,11 EDITTEXT IDC_EXPORT_BRANCH_TEXT,30,34,335,12 END IDD_ADDFAVORITES DIALOGEX DISCARDABLE 0, 0, 186, 46 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Add to Favorites" +CAPTION "Lägg till i Favoriter" FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "OK",IDOK,129,7,50,14 - PUSHBUTTON "Cancel",IDCANCEL,129,24,50,14 - LTEXT "&Favorite Name:",IDC_STATIC,7,7,70,10 + PUSHBUTTON "Avbryt",IDCANCEL,129,24,50,14 + LTEXT "&Namn på Favorit:",IDC_STATIC,7,7,70,10 EDITTEXT IDC_FAVORITENAME,7,26,110,13,ES_AUTOHSCROLL END IDD_REMOVEFAVORITES DIALOGEX DISCARDABLE 0, 0, 164, 135 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Remove Favorites" +CAPTION "Ta bort Favoriter" FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "OK",IDOK,107,114,50,14 - PUSHBUTTON "Cancel",IDCANCEL,7,114,50,14 + PUSHBUTTON "Avbryt",IDCANCEL,7,114,50,14 CONTROL "List1",IDC_FAVORITESLIST,"SysListView32",LVS_LIST | WS_BORDER | WS_TABSTOP,7,20,150,90 - LTEXT "Select Favorite(s):",IDC_STATIC,7,7,99,12 + LTEXT "Välj Favorit(er):",IDC_STATIC,7,7,99,12 END IDD_FIND DIALOGEX DISCARDABLE 0, 0, 254, 82 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Find" +CAPTION "Sök" FONT 8, "MS Shell Dlg" BEGIN - DEFPUSHBUTTON "&Find Next",IDOK,197,7,50,14 - PUSHBUTTON "Cancel",IDCANCEL,197,24,50,14 - GROUPBOX "Look at",IDC_STATIC,7,25,63,51 - LTEXT "Fi&nd what:",IDC_STATIC,7,8,37,10 + DEFPUSHBUTTON "&Sök Nästa",IDOK,197,7,50,14 + PUSHBUTTON "Avbryt",IDCANCEL,197,24,50,14 + GROUPBOX "Sök i",IDC_STATIC,7,25,63,51 + LTEXT "&Sök efter:",IDC_STATIC,7,8,37,10 EDITTEXT IDC_FINDWHAT,47,7,142,13,ES_AUTOHSCROLL - CONTROL "&Keys",IDC_LOOKAT_KEYS,"Button",BS_AUTOCHECKBOX | + CONTROL "&Nycklar",IDC_LOOKAT_KEYS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,36,35,8 - CONTROL "&Values",IDC_LOOKAT_VALUES,"Button",BS_AUTOCHECKBOX | + CONTROL "&Värden",IDC_LOOKAT_VALUES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,48,36,8 CONTROL "&Data",IDC_LOOKAT_DATA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,60,42,8 - CONTROL "Match &whole string only",IDC_MATCHSTRING,"Button", + CONTROL "Matcha endast &hela strängar",IDC_MATCHSTRING,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,83,32,94,13 - CONTROL "Match &case",IDC_MATCHCASE,"Button",BS_AUTOCHECKBOX | + CONTROL "Matcha &shiftläge",IDC_MATCHCASE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,83,48,90,12 END IDD_FINDING DIALOGEX 0, 0, 145, 50 STYLE DS_SHELLFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Find" +CAPTION "Sök" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20 - DEFPUSHBUTTON "&Cancel",IDCANCEL,93,29,45,14 - LTEXT "Searching the registry...",IDC_STATIC,33,12,83,8 + DEFPUSHBUTTON "&Avbryt",IDCANCEL,93,29,45,14 + LTEXT "Sök i registret...",IDC_STATIC,33,12,83,8 END /* diff --git a/base/applications/regedit/rsrc.rc b/base/applications/regedit/rsrc.rc index 79db6af680c..ae770b56b95 100644 --- a/base/applications/regedit/rsrc.rc +++ b/base/applications/regedit/rsrc.rc @@ -38,7 +38,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL #include "lang/hu-HU.rc" #include "lang/id-ID.rc" #include "lang/it-IT.rc" -//#include "lang/ja-JP.rc" FIXME: iconv issue +#include "lang/ja-JP.rc" #include "lang/ko-KR.rc" #include "lang/nl-NL.rc" #include "lang/no-NO.rc" diff --git a/base/applications/regedt32/CMakeLists.txt b/base/applications/regedt32/CMakeLists.txt index 9dabef71530..563098cd4c7 100644 --- a/base/applications/regedt32/CMakeLists.txt +++ b/base/applications/regedt32/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(regedt32 regedt32.c resource.rc) set_module_type(regedt32 win32gui) add_importlibs(regedt32 shell32 shlwapi msvcrt kernel32) -add_cab_target(regedt32 1) +add_cd_file(TARGET regedt32 DESTINATION reactos/system32 FOR all) diff --git a/base/applications/sc/CMakeLists.txt b/base/applications/sc/CMakeLists.txt index 8de23372348..0854d5b229c 100644 --- a/base/applications/sc/CMakeLists.txt +++ b/base/applications/sc/CMakeLists.txt @@ -19,4 +19,4 @@ add_pch(sc ${CMAKE_CURRENT_SOURCE_DIR}/sc.h ${SOURCE}) set_module_type(sc win32cui) add_importlibs(sc advapi32 msvcrt kernel32) -add_cab_target(sc 1) +add_cd_file(TARGET sc DESTINATION reactos/system32 FOR all) diff --git a/base/applications/screensavers/3dtext/CMakeLists.txt b/base/applications/screensavers/3dtext/CMakeLists.txt index 3f816149b39..083b0b0304d 100644 --- a/base/applications/screensavers/3dtext/CMakeLists.txt +++ b/base/applications/screensavers/3dtext/CMakeLists.txt @@ -13,4 +13,4 @@ set_target_properties(3dtext PROPERTIES SUFFIX ".scr") target_link_libraries(3dtext scrnsave) add_importlibs(3dtext user32 gdi32 opengl32 glu32 advapi32 msvcrt kernel32) -add_cab_target(3dtext 1) +add_cd_file(TARGET 3dtext DESTINATION reactos/system32 FOR all) diff --git a/base/applications/screensavers/3dtext/lang/sv-SE.rc b/base/applications/screensavers/3dtext/lang/sv-SE.rc new file mode 100644 index 00000000000..d0a33b7d501 --- /dev/null +++ b/base/applications/screensavers/3dtext/lang/sv-SE.rc @@ -0,0 +1,17 @@ +LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL + +DLG_SCRNSAVECONFIGURE DIALOGEX 0, 0, 273, 178 +STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "3D Text skärmsläckarinställingar" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + DEFPUSHBUTTON "OK",IDOK,216,7,50,14 + PUSHBUTTON "Avbryt",IDCANCEL,216,24,50,14 + EDITTEXT IDC_MESSAGE_TEXT,18,28,122,14,ES_AUTOHSCROLL + LTEXT "Anpassa text",IDC_STATIC,18,17,65,8 +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_DESCRIPTION "3D Text skärmsläckare" +END diff --git a/base/applications/screensavers/3dtext/rsrc.rc b/base/applications/screensavers/3dtext/rsrc.rc index 5f555e2f5e7..7c30d422e8f 100644 --- a/base/applications/screensavers/3dtext/rsrc.rc +++ b/base/applications/screensavers/3dtext/rsrc.rc @@ -25,4 +25,5 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL #include "lang/pl-PL.rc" #include "lang/ru-RU.rc" #include "lang/sk-SK.rc" +#include "lang/sv-SE.rc" #include "lang/uk-UA.rc" diff --git a/base/applications/screensavers/logon/CMakeLists.txt b/base/applications/screensavers/logon/CMakeLists.txt index f909e2abdaf..0e0a02f9e58 100644 --- a/base/applications/screensavers/logon/CMakeLists.txt +++ b/base/applications/screensavers/logon/CMakeLists.txt @@ -9,4 +9,4 @@ set_target_properties(logon PROPERTIES SUFFIX ".scr") target_link_libraries(logon scrnsave) add_importlibs(logon user32 gdi32 msvcrt kernel32) -add_cab_target(logon 1) +add_cd_file(TARGET logon DESTINATION reactos/system32 FOR all) diff --git a/base/applications/screensavers/logon/lang/sv-SE.rc b/base/applications/screensavers/logon/lang/sv-SE.rc new file mode 100644 index 00000000000..7908353f741 --- /dev/null +++ b/base/applications/screensavers/logon/lang/sv-SE.rc @@ -0,0 +1,13 @@ +/* + * PROJECT: ReactOS RAPPS + * FILE: \base\applications\screensavers\logon\lang\sv-SE.rc + * PURPOSE: Swedish resource file + * Translation: Jaix Bly + */ +LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL + +STRINGTABLE DISCARDABLE +BEGIN + IDS_DESCRIPTION "Inloggingsskärmsläckare" + IDS_TEXT "Inga inställningar behövs." +END diff --git a/base/applications/screensavers/logon/logon.rc b/base/applications/screensavers/logon/logon.rc index 14464dc7547..088e5da99ef 100644 --- a/base/applications/screensavers/logon/logon.rc +++ b/base/applications/screensavers/logon/logon.rc @@ -20,12 +20,13 @@ IDB_SERVER BITMAP DISCARDABLE "res/1.bmp" #include "lang/es-ES.rc" #include "lang/eu-ES.rc" #include "lang/fr-FR.rc" -//#include "lang/ja-JP.rc" FIXME: iconv issue +#include "lang/ja-JP.rc" #include "lang/ko-KR.rc" #include "lang/lt-LT.rc" #include "lang/nl-NL.rc" #include "lang/no-NO.rc" #include "lang/ro-RO.rc" #include "lang/sk-SK.rc" +#include "lang/sv-SE.rc" #include "lang/uk-UA.rc" #include "lang/ru-RU.rc" diff --git a/base/applications/shutdown/CMakeLists.txt b/base/applications/shutdown/CMakeLists.txt index f72303ebbbb..196d558ce82 100644 --- a/base/applications/shutdown/CMakeLists.txt +++ b/base/applications/shutdown/CMakeLists.txt @@ -12,4 +12,4 @@ add_pch(shutdown ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE}) set_module_type(shutdown win32cui) add_importlibs(shutdown advapi32 user32 msvcrt kernel32) -add_cab_target(shutdown 1) +add_cd_file(TARGET shutdown DESTINATION reactos/system32 FOR all) diff --git a/base/applications/shutdown/lang/sv-SE.rc b/base/applications/shutdown/lang/sv-SE.rc new file mode 100644 index 00000000000..8c4f2c8f838 --- /dev/null +++ b/base/applications/shutdown/lang/sv-SE.rc @@ -0,0 +1,20 @@ +/* + * PROJECT: ReactOS RAPPS + * FILE: \base\applications\shutdown\lang\sv-SE.rc + * PURPOSE: Swedish resource file + * Translation: Jaix Bly + */ +LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL + +STRINGTABLE DISCARDABLE +BEGIN + +IDS_USAGE, "SYNTAX: shutdown [-?] [-l | -s | -r] [-f]\n\n\ + Ingen parameter eller -? Visar detta meddelandet.\n\ + -l\t\tLogga ut\n\ + -s\t\tStäng av datorn.\n\ + -r\t\tStäng av och starta datorn.\n\ + -f\t\tGör att program som körs avslutas utan att användare meddelas.\n\ + \t\tOm du inte angav någon annan parameter till detta kommandot\n\ + \t\tkommer användaren dessutom att loggas ut." +END diff --git a/base/applications/shutdown/rsrc.rc b/base/applications/shutdown/rsrc.rc index c06b62f28f9..a7dc8242bc0 100644 --- a/base/applications/shutdown/rsrc.rc +++ b/base/applications/shutdown/rsrc.rc @@ -16,5 +16,6 @@ #include "lang/pl-PL.rc" #include "lang/ru-RU.rc" #include "lang/sk-SK.rc" +#include "lang/sv-SE.rc" #include "lang/uk-UA.rc" diff --git a/base/applications/sndrec32/CMakeLists.txt b/base/applications/sndrec32/CMakeLists.txt index 464dd03497d..e189437896e 100644 --- a/base/applications/sndrec32/CMakeLists.txt +++ b/base/applications/sndrec32/CMakeLists.txt @@ -17,4 +17,4 @@ add_executable(sndrec32 target_link_libraries(sndrec32 stlport) set_module_type(sndrec32 win32gui) add_importlibs(sndrec32 winmm user32 msacm32 comctl32 comdlg32 gdi32 msvcrt kernel32) -add_cab_target(sndrec32 1) +add_cd_file(TARGET sndrec32 DESTINATION reactos/system32 FOR all) diff --git a/base/applications/sndrec32/lang/en-US.rc b/base/applications/sndrec32/lang/en-US.rc index 56ba98cb68a..35241be738b 100644 --- a/base/applications/sndrec32/lang/en-US.rc +++ b/base/applications/sndrec32/lang/en-US.rc @@ -8,11 +8,11 @@ END IDD_ABOUTBOX DIALOGEX 0, 0, 196, 75 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Information about reactOS_sndrec32" +CAPTION "Information about ReactOS Sound Recorder" FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN ICON 128,IDC_REACTOS_SNDREC32,19,14,21,20 - LTEXT "reactOS_sndrec32, version 1.0",IDC_STATIC,56,16,114,8,SS_NOPREFIX + LTEXT "ReactOS Sound Recorder, version 1.0",IDC_STATIC,56,16,114,8,SS_NOPREFIX LTEXT "Copyright (C) 2009",IDC_STATIC,55,25,114,8 DEFPUSHBUTTON "OK",IDOK,139,54,50,14,WS_GROUP END diff --git a/base/applications/sndrec32/lang/fr-FR.rc b/base/applications/sndrec32/lang/fr-FR.rc new file mode 100644 index 00000000000..403069e0793 --- /dev/null +++ b/base/applications/sndrec32/lang/fr-FR.rc @@ -0,0 +1,54 @@ +LANGUAGE LANG_FRENCH, SUBLANG_DEFAULT + +IDC_REACTOS_SNDREC32 ACCELERATORS +BEGIN + "?", IDM_ABOUT, ASCII, ALT + "/", IDM_ABOUT, ASCII, ALT +END + +IDD_ABOUTBOX DIALOGEX 0, 0, 196, 75 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Information à propos de l'Enregistreur de Son ReactOS" +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + ICON 128,IDC_REACTOS_SNDREC32,19,14,21,20 + LTEXT "Enregistreur de Son ReactOS, version 1.0",IDC_STATIC,56,16,114,8,SS_NOPREFIX + LTEXT "Copyright (C) 2009",IDC_STATIC,55,25,114,8 + DEFPUSHBUTTON "Accepter",IDOK,139,54,50,14,WS_GROUP +END + +IDR_MENU1 MENU +BEGIN + POPUP "Fichier" + BEGIN + MENUITEM "Nouveau", ID_NEW + MENUITEM "Ouvrir...", ID_FILE_OPEN + MENUITEM "Enregistrer", ID_FILE_SAVE, GRAYED + MENUITEM "Enregistrer sous...", ID_FILE_SAVEAS, GRAYED + MENUITEM SEPARATOR + MENUITEM "Sortir", ID_EXIT + END + MENUITEM "todo1", 0 + MENUITEM "todo2", 0 + POPUP "?" + BEGIN + MENUITEM "A propos...", ID__ABOUT + END +END + +STRINGTABLE +BEGIN + IDS_APP_TITLE "Enregistreur de son" + IDC_REACTOS_SNDREC32 "REACTOS_SNDREC32" +END + +STRINGTABLE +BEGIN + IDS_STRPOS "Position: %.2f s" + IDS_STRDUR "Durée: %.2f s" + IDS_STRBUF "Buffer: %.2f kb" + IDS_STRFMT "%.1f kHz %u bits" + IDS_STRMONO "mono" + IDS_STRSTEREO "stéréo" + IDS_STRCHAN "%s" +END diff --git a/base/applications/sndrec32/lang/sv-SE.rc b/base/applications/sndrec32/lang/sv-SE.rc new file mode 100644 index 00000000000..519a8f4d746 --- /dev/null +++ b/base/applications/sndrec32/lang/sv-SE.rc @@ -0,0 +1,60 @@ +/* + * PROJECT: ReactOS RAPPS + * FILE: \base\applications\sndrec32\lang\sv-SE.rc + * PURPOSE: Swedish resource file + * Translation: Jaix Bly + */ +LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL + +IDC_REACTOS_SNDREC32 ACCELERATORS +BEGIN + "?", IDM_ABOUT, ASCII, ALT + "/", IDM_ABOUT, ASCII, ALT +END + +IDD_ABOUTBOX DIALOGEX 0, 0, 196, 75 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Information om ReactOS_sndrec32" +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + ICON 128,IDC_REACTOS_SNDREC32,19,14,21,20 + LTEXT "ReactOS_sndrec32, version 1.0",IDC_STATIC,56,16,114,8,SS_NOPREFIX + LTEXT "Copyright (C) 2009",IDC_STATIC,55,25,114,8 + DEFPUSHBUTTON "OK",IDOK,139,54,50,14,WS_GROUP +END + +IDR_MENU1 MENU +BEGIN + POPUP "Arkiv" + BEGIN + MENUITEM "Ny", ID_NEW + MENUITEM "Öppna...", ID_FILE_OPEN + MENUITEM "Spara", ID_FILE_SAVE, GRAYED + MENUITEM "Spara som...", ID_FILE_SAVEAS, GRAYED + MENUITEM SEPARATOR + MENUITEM "Avsluta", ID_EXIT + END + MENUITEM "todo1", 0 + MENUITEM "todo2", 0 + POPUP "Hjälp" + BEGIN + MENUITEM "Om...", ID__ABOUT + END +END + +STRINGTABLE +BEGIN + IDS_APP_TITLE "Ljudinspelaren" + IDC_REACTOS_SNDREC32 "REACTOS_SNDREC32" +END + +STRINGTABLE +BEGIN + IDS_STRPOS "Position: %.2f s" + IDS_STRDUR "Längd: %.2f s" + IDS_STRBUF "Buffert: %.2f kb" + IDS_STRFMT "%.1f kHz %u bits" + IDS_STRMONO "mono" + IDS_STRSTEREO "stereo" + IDS_STRCHAN "%s" +END diff --git a/base/applications/sndrec32/rsrc.rc b/base/applications/sndrec32/rsrc.rc index ed4864a701d..7964e8e0be0 100644 --- a/base/applications/sndrec32/rsrc.rc +++ b/base/applications/sndrec32/rsrc.rc @@ -20,9 +20,11 @@ IDB_BITMAP2_STOP_DIS BITMAP "resources/but_stop_dis.bmp" #include "lang/de-DE.rc" #include "lang/en-US.rc" #include "lang/es-ES.rc" +#include "lang/fr-FR.rc" #include "lang/it-IT.rc" #include "lang/ja-JP.rc" #include "lang/pl-PL.rc" #include "lang/sk-SK.rc" +#include "lang/sv-SE.rc" #include "lang/uk-UA.rc" diff --git a/base/applications/sndvol32/CMakeLists.txt b/base/applications/sndvol32/CMakeLists.txt index 09af75801b5..9208072f08e 100644 --- a/base/applications/sndvol32/CMakeLists.txt +++ b/base/applications/sndvol32/CMakeLists.txt @@ -16,4 +16,4 @@ add_pch(sndvol32 ${CMAKE_CURRENT_SOURCE_DIR}/sndvol32.h ${SOURCE}) set_module_type(sndvol32 win32gui) add_importlibs(sndvol32 user32 advapi32 gdi32 comctl32 shell32 winmm msvcrt kernel32 ntdll) -add_cab_target(sndvol32 1) +add_cd_file(TARGET sndvol32 DESTINATION reactos/system32 FOR all) diff --git a/base/applications/sndvol32/lang/sv-SE.rc b/base/applications/sndvol32/lang/sv-SE.rc index f10445e2e95..7638ff9d833 100644 --- a/base/applications/sndvol32/lang/sv-SE.rc +++ b/base/applications/sndvol32/lang/sv-SE.rc @@ -1,7 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // Swedish (SE) resources /* - * Copyright 2005 David Nordenberg + * Copyright 2005 David Nordenberg + * completed and edited by Jaix Bly * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -55,7 +56,7 @@ BEGIN PUSHBUTTON "&Inspelning", IDC_RECORDING, 13,61,47,8, BS_AUTORADIOBUTTON PUSHBUTTON "&Andra:", IDC_OTHER, 13,80,42,8, BS_AUTORADIOBUTTON | WS_DISABLED COMBOBOX IDC_LINE, 55,80,155,50, CBS_DROPDOWNLIST | WS_TABSTOP | WS_DISABLED - LTEXT "Show the following volume controls:", IDC_LABELCONTROLS, 7, 109, 162, 8 + LTEXT "Visa följander volymekontroller:", IDC_LABELCONTROLS, 7, 109, 162, 8 CONTROL "", IDC_CONTROLS, "SysListView32", LVS_REPORT | LVS_NOCOLUMNHEADER | WS_TABSTOP | WS_BORDER, 7, 122, 211, 96 PUSHBUTTON "OK", IDOK, 114,226,50,14 @@ -66,12 +67,12 @@ IDD_VOLUME_CTRL DIALOG 0, 0, 90, 150 STYLE WS_POPUP | WS_BORDER FONT 8, "MS Shell Dlg" BEGIN - LTEXT "Master", IDC_LINE_NAME, 4, 7, 100, 15 + LTEXT "Huvud", IDC_LINE_NAME, 4, 7, 100, 15 CONTROL "", -1, "static", SS_ETCHEDHORZ | WS_CHILD | WS_VISIBLE, 4, 30, 82, 1 - LTEXT "Balance", -1, 4, 35, 80, 42 - LTEXT "Volume", -1, 4, 100, 77, 108 + LTEXT "Balanse", -1, 4, 35, 80, 42 + LTEXT "Volyme", -1, 4, 100, 77, 108 CONTROL "", IDC_LINE_SLIDER_HORZ, "msctls_trackbar32", TBS_HORZ | TBS_AUTOTICKS | TBS_BOTH | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 25, 55, 85, 30 CONTROL "", IDC_LINE_SLIDER_VERT, "msctls_trackbar32", TBS_VERT | TBS_AUTOTICKS | TBS_BOTH | TBS_DOWNISLEFT | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 32, 115, 30, 70 - CHECKBOX "&Mute", IDC_LINE_SWITCH, 4, 190, 90, 12, BS_AUTOCHECKBOX + CHECKBOX "&Tyst", IDC_LINE_SWITCH, 4, 190, 90, 12, BS_AUTOCHECKBOX CONTROL "", IDC_LINE_SEP, "static", SS_ETCHEDVERT | WS_CHILD | WS_VISIBLE, 130, 7, 1, 200 END diff --git a/base/applications/sndvol32/sndvol32.c b/base/applications/sndvol32/sndvol32.c index 87fc26a059e..ec16547f4af 100644 --- a/base/applications/sndvol32/sndvol32.c +++ b/base/applications/sndvol32/sndvol32.c @@ -574,6 +574,16 @@ DlgPreferencesProc(HWND hwndDlg, IDCANCEL); break; } + + case WM_SYSCOLORCHANGE: + { + HWND hwndControls; + + /* Forward WM_SYSCOLORCHANGE */ + hwndControls = GetDlgItem(hwndDlg, IDC_CONTROLS); + SendMessage(hwndControls, WM_SYSCOLORCHANGE, 0, 0); + break; + } } return 0; diff --git a/base/applications/taskmgr/CMakeLists.txt b/base/applications/taskmgr/CMakeLists.txt index 8a78ccc7f8d..b36860362e5 100644 --- a/base/applications/taskmgr/CMakeLists.txt +++ b/base/applications/taskmgr/CMakeLists.txt @@ -29,4 +29,4 @@ add_pch(taskmgr ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE}) set_module_type(taskmgr win32gui) add_importlibs(taskmgr advapi32 user32 gdi32 shell32 comctl32 msvcrt kernel32 ntdll) -add_cab_target(taskmgr 1) +add_cd_file(TARGET taskmgr DESTINATION reactos/system32 FOR all) diff --git a/base/applications/taskmgr/endproc.c b/base/applications/taskmgr/endproc.c index be080ffbddf..4e92a4e0fae 100644 --- a/base/applications/taskmgr/endproc.c +++ b/base/applications/taskmgr/endproc.c @@ -50,7 +50,7 @@ void ProcessPage_OnEndProcess(void) return; } - if (!TerminateProcess(hProcess, 0)) + if (!TerminateProcess(hProcess, 1)) { GetLastErrorText(strErrorText, 260); LoadStringW(hInst, IDS_MSG_UNABLETERMINATEPRO, szTitle, 256); diff --git a/base/applications/taskmgr/lang/pl-PL.rc b/base/applications/taskmgr/lang/pl-PL.rc index 1cbd872c3a7..3f594c2f650 100644 --- a/base/applications/taskmgr/lang/pl-PL.rc +++ b/base/applications/taskmgr/lang/pl-PL.rc @@ -184,9 +184,9 @@ FONT 8, "MS Shell Dlg" BEGIN CONTROL "List2",IDC_APPLIST,"SysListView32",LVS_REPORT | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,7,7,233,177 - PUSHBUTTON "&Nowe zadanie...",IDC_NEWTASK,187,189,53,14 - PUSHBUTTON "P&rze³¹cz na",IDC_SWITCHTO,131,189,53,14,WS_DISABLED - PUSHBUTTON "&Zakoñcz zadanie",IDC_ENDTASK,75,189,53,14,WS_DISABLED + PUSHBUTTON "&Nowe zadanie...",IDC_NEWTASK,175,189,65,14 + PUSHBUTTON "P&rze³¹cz na",IDC_SWITCHTO,107,189,65,14,WS_DISABLED + PUSHBUTTON "&Zakoñcz zadanie",IDC_ENDTASK,39,189,65,14,WS_DISABLED END IDD_PROCESS_PAGE DIALOGEX DISCARDABLE 0, 0, 247, 210 diff --git a/base/applications/taskmgr/procpage.c b/base/applications/taskmgr/procpage.c index 6b7ae3519fe..52769063567 100644 --- a/base/applications/taskmgr/procpage.c +++ b/base/applications/taskmgr/procpage.c @@ -435,6 +435,8 @@ void UpdateProcesses() LV_ITEM item; LPPROCESS_PAGE_LIST_ITEM pData; + SendMessage(hProcessPageListCtrl, WM_SETREDRAW, FALSE, 0); + /* Remove old processes */ for (i = 0; i < ListView_GetItemCount(hProcessPageListCtrl); i++) { @@ -464,6 +466,8 @@ void UpdateProcesses() { (void)ListView_SortItems(hProcessPageListCtrl, ProcessPageCompareFunc, NULL); } + + SendMessage(hProcessPageListCtrl, WM_SETREDRAW, TRUE, 0); } BOOL ProcessRunning(ULONG ProcessId) diff --git a/base/applications/taskmgr/taskmgr.c b/base/applications/taskmgr/taskmgr.c index c6d11c0e54d..6778db38931 100644 --- a/base/applications/taskmgr/taskmgr.c +++ b/base/applications/taskmgr/taskmgr.c @@ -396,6 +396,12 @@ TaskManagerWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) case WM_MENUSELECT: TaskManager_OnMenuSelect(hDlg, LOWORD(wParam), HIWORD(wParam), (HMENU)lParam); break; + case WM_SYSCOLORCHANGE: + /* Forward WM_SYSCOLORCHANGE to common controls */ + SendMessage(hApplicationPageListCtrl, WM_SYSCOLORCHANGE, 0, 0); + SendMessage(hProcessPageListCtrl, WM_SYSCOLORCHANGE, 0, 0); + SendMessage(hProcessPageHeaderCtrl, WM_SYSCOLORCHANGE, 0, 0); + break; } return 0; diff --git a/base/applications/winhlp32/CMakeLists.txt b/base/applications/winhlp32/CMakeLists.txt index 071c7684d72..8b1e1fe154f 100644 --- a/base/applications/winhlp32/CMakeLists.txt +++ b/base/applications/winhlp32/CMakeLists.txt @@ -23,4 +23,4 @@ set_module_type(winhlp32 win32gui) target_link_libraries(winhlp32 wine) add_importlibs(winhlp32 user32 gdi32 shell32 comctl32 comdlg32 msvcrt kernel32 ntdll) -add_cab_target(winhlp32 4) +add_cd_file(TARGET winhlp32 DESTINATION reactos FOR all) diff --git a/base/applications/winver/CMakeLists.txt b/base/applications/winver/CMakeLists.txt index 76bb3f2a588..005d1a3ce47 100644 --- a/base/applications/winver/CMakeLists.txt +++ b/base/applications/winver/CMakeLists.txt @@ -4,4 +4,4 @@ set_unicode() add_executable(winver winver.c) set_module_type(winver win32gui) add_importlibs(winver shell32 msvcrt kernel32) -add_cab_target(winver 1) +add_cd_file(TARGET winver DESTINATION reactos/system32 FOR all) diff --git a/base/applications/wordpad/CMakeLists.txt b/base/applications/wordpad/CMakeLists.txt index 6b13acb274e..e8f3906dda9 100644 --- a/base/applications/wordpad/CMakeLists.txt +++ b/base/applications/wordpad/CMakeLists.txt @@ -20,4 +20,4 @@ set_module_type(wordpad win32gui) target_link_libraries(wordpad wine uuid) add_importlibs(wordpad comdlg32 ole32 shell32 user32 gdi32 advapi32 comctl32 msvcrt kernel32 ntdll) -add_cab_target(wordpad 1) +add_cd_file(TARGET wordpad DESTINATION reactos/system32 FOR all) diff --git a/base/applications/write/CMakeLists.txt b/base/applications/write/CMakeLists.txt index a528a5ec846..4660a307f7a 100644 --- a/base/applications/write/CMakeLists.txt +++ b/base/applications/write/CMakeLists.txt @@ -4,4 +4,4 @@ set_unicode() add_executable(write write.c rsrc.rc) set_module_type(write win32gui) add_importlibs(write user32 gdi32 msvcrt kernel32) -add_cab_target(write 1) +add_cd_file(TARGET write DESTINATION reactos/system32 FOR all) diff --git a/base/services/audiosrv/CMakeLists.txt b/base/services/audiosrv/CMakeLists.txt index 55271c46b06..bd96bf7f3a6 100644 --- a/base/services/audiosrv/CMakeLists.txt +++ b/base/services/audiosrv/CMakeLists.txt @@ -12,4 +12,4 @@ add_executable(audiosrv set_module_type(audiosrv win32cui) add_importlibs(audiosrv advapi32 user32 setupapi msvcrt kernel32) -add_cab_target(audiosrv 1) +add_cd_file(TARGET audiosrv DESTINATION reactos/system32 FOR all) diff --git a/base/services/eventlog/CMakeLists.txt b/base/services/eventlog/CMakeLists.txt index 570c1c3e886..424606205c4 100644 --- a/base/services/eventlog/CMakeLists.txt +++ b/base/services/eventlog/CMakeLists.txt @@ -5,6 +5,7 @@ set_unicode() list(APPEND SOURCE eventlog.c + eventsource.c logport.c eventlog.rc rpc.c @@ -18,4 +19,4 @@ add_pch(eventlog ${CMAKE_CURRENT_SOURCE_DIR}/eventlog.h ${SOURCE}) set_module_type(eventlog win32cui) add_importlibs(eventlog advapi32 rpcrt4 msvcrt kernel32 ntdll) -add_cab_target(eventlog 1) +add_cd_file(TARGET eventlog DESTINATION reactos/system32 FOR all) diff --git a/base/services/eventlog/eventlog.c b/base/services/eventlog/eventlog.c index 70663351ab5..ee34a1d2e45 100644 --- a/base/services/eventlog/eventlog.c +++ b/base/services/eventlog/eventlog.c @@ -168,18 +168,21 @@ ServiceMain(DWORD argc, { DPRINT("Service started\n"); UpdateServiceStatus(SERVICE_RUNNING); + + LogfReportEvent(EVENTLOG_INFORMATION_TYPE, + 0, + EVENT_EventlogStarted); } DPRINT("ServiceMain() done\n"); } -BOOL LoadLogFile(HKEY hKey, WCHAR * LogName) +PLOGFILE LoadLogFile(HKEY hKey, WCHAR * LogName) { DWORD MaxValueLen, ValueLen, Type, ExpandedLen; WCHAR *Buf = NULL, *Expanded = NULL; LONG Result; - BOOL ret = TRUE; PLOGFILE pLogf; DPRINT("LoadLogFile: %S\n", LogName); @@ -188,11 +191,10 @@ BOOL LoadLogFile(HKEY hKey, WCHAR * LogName) NULL, NULL, &MaxValueLen, NULL, NULL); Buf = HeapAlloc(MyHeap, 0, MaxValueLen); - if (!Buf) { DPRINT1("Can't allocate heap!\n"); - return FALSE; + return NULL; } ValueLen = MaxValueLen; @@ -203,29 +205,27 @@ BOOL LoadLogFile(HKEY hKey, WCHAR * LogName) &Type, (LPBYTE) Buf, &ValueLen); - if (Result != ERROR_SUCCESS) { DPRINT1("RegQueryValueEx failed: %d\n", GetLastError()); HeapFree(MyHeap, 0, Buf); - return FALSE; + return NULL; } if (Type != REG_EXPAND_SZ && Type != REG_SZ) { DPRINT1("%S\\File - value of wrong type %x.\n", LogName, Type); HeapFree(MyHeap, 0, Buf); - return FALSE; + return NULL; } ExpandedLen = ExpandEnvironmentStrings(Buf, NULL, 0); Expanded = HeapAlloc(MyHeap, 0, ExpandedLen * sizeof(WCHAR)); - if (!Expanded) { DPRINT1("Can't allocate heap!\n"); HeapFree(MyHeap, 0, Buf); - return FALSE; + return NULL; } ExpandEnvironmentStrings(Buf, Expanded, ExpandedLen); @@ -237,12 +237,11 @@ BOOL LoadLogFile(HKEY hKey, WCHAR * LogName) if (pLogf == NULL) { DPRINT1("Failed to create %S!\n", Expanded); - ret = FALSE; } HeapFree(MyHeap, 0, Buf); HeapFree(MyHeap, 0, Expanded); - return ret; + return pLogf; } BOOL LoadLogFiles(HKEY eventlogKey) @@ -251,6 +250,7 @@ BOOL LoadLogFiles(HKEY eventlogKey) DWORD MaxLognameLen, LognameLen; WCHAR *Buf = NULL; INT i; + PLOGFILE pLogFile; RegQueryInfoKey(eventlogKey, NULL, NULL, NULL, NULL, @@ -288,10 +288,16 @@ BOOL LoadLogFiles(HKEY eventlogKey) return FALSE; } - if (!LoadLogFile(SubKey, Buf)) - DPRINT1("Failed to load %S\n", Buf); - else + pLogFile = LoadLogFile(SubKey, Buf); + if (pLogFile != NULL) + { DPRINT("Loaded %S\n", Buf); + LoadEventSources(SubKey, pLogFile); + } + else + { + DPRINT1("Failed to load %S\n", Buf); + } RegCloseKey(SubKey); LognameLen = MaxLognameLen; @@ -310,6 +316,7 @@ INT wmain() HKEY elogKey; LogfListInitialize(); + InitEventSourceList(); MyHeap = HeapCreate(0, 1024 * 256, 0); diff --git a/base/services/eventlog/eventlog.h b/base/services/eventlog/eventlog.h index 7b6640e4b8d..2ed6a4f50f2 100644 --- a/base/services/eventlog/eventlog.h +++ b/base/services/eventlog/eventlog.h @@ -13,6 +13,7 @@ #define WIN32_NO_STATUS #include +#include #include #include #include @@ -93,19 +94,17 @@ typedef struct _LOGFILE LIST_ENTRY ListEntry; } LOGFILE, *PLOGFILE; -#if 0 typedef struct _EVENTSOURCE { LIST_ENTRY EventSourceListEntry; PLOGFILE LogFile; - ULONG CurrentRecord; WCHAR szName[1]; } EVENTSOURCE, *PEVENTSOURCE; -#endif typedef struct _LOGHANDLE { LIST_ENTRY LogHandleListEntry; + PEVENTSOURCE EventSource; PLOGFILE LogFile; ULONG CurrentRecord; WCHAR szName[1]; @@ -179,6 +178,11 @@ PBYTE LogfAllocAndBuildNewRecord(LPDWORD lpRecSize, DWORD dwDataSize, LPVOID lpRawData); +VOID +LogfReportEvent(WORD wType, + WORD wCategory, + DWORD dwEventId); + /* eventlog.c */ extern HANDLE MyHeap; @@ -192,6 +196,17 @@ VOID EventTimeToSystemTime(DWORD EventTime, VOID SystemTimeToEventTime(SYSTEMTIME * pSystemTime, DWORD * pEventTime); +/* eventsource.c */ +VOID InitEventSourceList(VOID); + +BOOL +LoadEventSources(HKEY hKey, + PLOGFILE pLogFile); + +PEVENTSOURCE +GetEventSourceByName(LPCWSTR Name); + + /* logport.c */ NTSTATUS WINAPI PortThreadRoutine(PVOID Param); diff --git a/base/services/eventlog/eventsource.c b/base/services/eventlog/eventsource.c new file mode 100644 index 00000000000..61826668c38 --- /dev/null +++ b/base/services/eventlog/eventsource.c @@ -0,0 +1,150 @@ +/* + * PROJECT: ReactOS kernel + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/services/eventlog/eventsource.c + * PURPOSE: Event logging service + * COPYRIGHT: Copyright 2011 Eric Kohl + */ + +/* INCLUDES *****************************************************************/ + +#include "eventlog.h" + +static LIST_ENTRY EventSourceListHead; +static CRITICAL_SECTION EventSourceListCs; + +/* FUNCTIONS ****************************************************************/ + +VOID +InitEventSourceList(VOID) +{ + InitializeCriticalSection(&EventSourceListCs); + InitializeListHead(&EventSourceListHead); +} + + +static VOID +DumpEventSourceList(VOID) +{ + PLIST_ENTRY CurrentEntry; + PEVENTSOURCE EventSource; + + DPRINT("DumpEventSourceList()\n"); + EnterCriticalSection(&EventSourceListCs); + + CurrentEntry = EventSourceListHead.Flink; + while (CurrentEntry != &EventSourceListHead) + { + EventSource = CONTAINING_RECORD(CurrentEntry, + EVENTSOURCE, + EventSourceListEntry); + + DPRINT("EventSource->szName: %S\n", EventSource->szName); + + CurrentEntry = CurrentEntry->Flink; + } + + LeaveCriticalSection(&EventSourceListCs); + + DPRINT("Done\n"); +} + + +BOOL +LoadEventSources(HKEY hKey, + PLOGFILE pLogFile) +{ + PEVENTSOURCE lpEventSource; + DWORD dwMaxSubKeyLength; + DWORD dwEventSourceNameLength; + DWORD dwIndex; + WCHAR *Buf = NULL; + + DPRINT("LoadEventSources\n"); + + RegQueryInfoKeyW(hKey, NULL, NULL, NULL, NULL, &dwMaxSubKeyLength, NULL, + NULL, NULL, NULL, NULL, NULL); + + DPRINT("dwMaxSubKeyLength: %lu\n", dwMaxSubKeyLength); + + dwMaxSubKeyLength++; + + Buf = HeapAlloc(MyHeap, 0, dwMaxSubKeyLength * sizeof(WCHAR)); + if (!Buf) + { + DPRINT1("Error: can't allocate heap!\n"); + return FALSE; + } + + dwEventSourceNameLength = dwMaxSubKeyLength; + + dwIndex = 0; + while (RegEnumKeyExW(hKey, + dwIndex, + Buf, + &dwEventSourceNameLength, + NULL, NULL, NULL, NULL) == ERROR_SUCCESS) + { + DPRINT("Event Source: %S\n", Buf); + + lpEventSource = HeapAlloc(MyHeap, 0, sizeof(EVENTSOURCE) + wcslen(Buf) * sizeof(WCHAR)); + if (lpEventSource != NULL) + { + wcscpy(lpEventSource->szName, Buf); + lpEventSource->LogFile = pLogFile; + + DPRINT("Insert event source: %S\n", lpEventSource->szName); + + + EnterCriticalSection(&EventSourceListCs); + InsertTailList(&EventSourceListHead, + &lpEventSource->EventSourceListEntry); + LeaveCriticalSection(&EventSourceListCs); + } + + dwEventSourceNameLength = dwMaxSubKeyLength; + dwIndex++; + } + + HeapFree(MyHeap, 0, Buf); + + DumpEventSourceList(); + + return TRUE; +} + + +PEVENTSOURCE +GetEventSourceByName(LPCWSTR Name) +{ + PLIST_ENTRY CurrentEntry; + PEVENTSOURCE Result = NULL; + + DPRINT("GetEventSourceByName(%S)\n", Name); + EnterCriticalSection(&EventSourceListCs); + + CurrentEntry = EventSourceListHead.Flink; + while (CurrentEntry != &EventSourceListHead) + { + PEVENTSOURCE Item = CONTAINING_RECORD(CurrentEntry, + EVENTSOURCE, + EventSourceListEntry); + + DPRINT("Item->szName: %S\n", Item->szName); +// if ((*(Item->szName) != 0) && !_wcsicmp(Item->szName, Name)) + if (_wcsicmp(Item->szName, Name) == 0) + { + DPRINT("Found it\n"); + Result = Item; + break; + } + + CurrentEntry = CurrentEntry->Flink; + } + + LeaveCriticalSection(&EventSourceListCs); + + DPRINT("Done (Result: %p)\n", Result); + + return Result; +} diff --git a/base/services/eventlog/file.c b/base/services/eventlog/file.c index bc68d3dcad5..3dd38af0fb6 100644 --- a/base/services/eventlog/file.c +++ b/base/services/eventlog/file.c @@ -1049,3 +1049,53 @@ PBYTE LogfAllocAndBuildNewRecord(LPDWORD lpRecSize, *lpRecSize = dwRecSize; return Buffer; } + + +VOID +LogfReportEvent(WORD wType, + WORD wCategory, + DWORD dwEventId) +{ + WCHAR szComputerName[MAX_COMPUTERNAME_LENGTH + 1]; + DWORD dwComputerNameLength = MAX_COMPUTERNAME_LENGTH + 1; + PEVENTSOURCE pEventSource = NULL; + PBYTE logBuffer; + DWORD lastRec; + DWORD recSize; + DWORD dwError; + + if (!GetComputerNameW(szComputerName, &dwComputerNameLength)) + { + szComputerName[0] = 0; + } + + pEventSource = GetEventSourceByName(L"EventLog"); + if (pEventSource == NULL) + { + return; + } + + lastRec = LogfGetCurrentRecord(pEventSource->LogFile); + + logBuffer = LogfAllocAndBuildNewRecord(&recSize, + lastRec, + wType, + wCategory, + dwEventId, + pEventSource->szName, + (LPCWSTR)szComputerName, + 0, + NULL, + 0, //wNumStrings, + NULL, //lpStrings, + 0, //dwDataSize, + NULL); //lpRawData); + + dwError = LogfWriteData(pEventSource->LogFile, recSize, logBuffer); + if (!dwError) + { + DPRINT1("ERROR WRITING TO EventLog %S\n", pEventSource->LogFile->FileName); + } + + LogfFreeRecord(logBuffer); +} \ No newline at end of file diff --git a/base/services/eventlog/rpc.c b/base/services/eventlog/rpc.c index d0efdad7f83..cf855757292 100644 --- a/base/services/eventlog/rpc.c +++ b/base/services/eventlog/rpc.c @@ -49,6 +49,9 @@ PLOGHANDLE ElfCreateEventLogHandle(LPCWSTR Name, BOOL Create) PLOGHANDLE lpLogHandle; PLOGFILE currentLogFile = NULL; INT i, LogsActive; + PEVENTSOURCE pEventSource; + + DPRINT("ElfCreateEventLogHandle(Name: %S)\n", Name); lpLogHandle = HeapAlloc(GetProcessHeap(), 0, sizeof(LOGHANDLE) + ((wcslen(Name) + 1) * sizeof(WCHAR))); @@ -70,19 +73,36 @@ PLOGHANDLE ElfCreateEventLogHandle(LPCWSTR Name, BOOL Create) /* If Creating, default to the Application Log in case we fail, as documented on MSDN */ if (Create == TRUE) - lpLogHandle->LogFile = LogfListItemByName(L"Application"); + { + pEventSource = GetEventSourceByName(Name); + DPRINT("EventSource: %p\n", pEventSource); + if (pEventSource) + { + DPRINT("EventSource LogFile: %p\n", pEventSource->LogFile); + lpLogHandle->LogFile = pEventSource->LogFile; + } + else + { + DPRINT("EventSource LogFile: Application log file\n"); + lpLogHandle->LogFile = LogfListItemByName(L"Application"); + } + + DPRINT("LogHandle LogFile: %p\n", lpLogHandle->LogFile); + } else + { lpLogHandle->LogFile = NULL; - for (i = 1; i <= LogsActive; i++) - { - currentLogFile = LogfListItemByIndex(i); - - if (_wcsicmp(Name, currentLogFile->LogName) == 0) + for (i = 1; i <= LogsActive; i++) { - lpLogHandle->LogFile = LogfListItemByIndex(i); - lpLogHandle->CurrentRecord = LogfGetOldestRecord(lpLogHandle->LogFile); - break; + currentLogFile = LogfListItemByIndex(i); + + if (_wcsicmp(Name, currentLogFile->LogName) == 0) + { + lpLogHandle->LogFile = LogfListItemByIndex(i); + lpLogHandle->CurrentRecord = LogfGetOldestRecord(lpLogHandle->LogFile); + break; + } } } @@ -267,6 +287,8 @@ NTSTATUS ElfrRegisterEventSourceW( DWORD MinorVersion, IELF_HANDLE *LogHandle) { + DPRINT1("ElfrRegisterEventSourceW()\n"); + if ((MajorVersion != 1) || (MinorVersion != 1)) return STATUS_INVALID_PARAMETER; @@ -274,6 +296,8 @@ NTSTATUS ElfrRegisterEventSourceW( if (RegModuleName->Length > 0) return STATUS_INVALID_PARAMETER; + DPRINT1("ModuleName: %S\n", ModuleName->Buffer); + /*FIXME: UNCServerName must specify the server or empty for local */ /*FIXME: Must verify that caller has write access */ diff --git a/base/services/rpcss/CMakeLists.txt b/base/services/rpcss/CMakeLists.txt index 3ea2156b101..f84c816f951 100644 --- a/base/services/rpcss/CMakeLists.txt +++ b/base/services/rpcss/CMakeLists.txt @@ -17,5 +17,5 @@ target_link_libraries(rpcss epmrpc irotrpc ${PSEH_LIB} wine) set_module_type(rpcss win32cui) add_importlibs(rpcss advapi32 rpcrt4 msvcrt kernel32 ntdll) -add_cab_target(rpcss 1) +add_cd_file(TARGET rpcss DESTINATION reactos/system32 FOR all) add_dependencies(rpcss winesdk) diff --git a/base/services/spoolsv/CMakeLists.txt b/base/services/spoolsv/CMakeLists.txt index 99feb7174ef..2724ed06c4a 100644 --- a/base/services/spoolsv/CMakeLists.txt +++ b/base/services/spoolsv/CMakeLists.txt @@ -7,4 +7,4 @@ target_link_libraries(spoolsv wine) set_module_type(spoolsv win32cui) add_importlibs(spoolsv advapi32 msvcrt kernel32 ntdll) -add_cab_target(spoolsv 1) +add_cd_file(TARGET spoolsv DESTINATION reactos/system32 FOR all) diff --git a/base/services/svchost/CMakeLists.txt b/base/services/svchost/CMakeLists.txt index f4188a2e6c0..637b6931edd 100644 --- a/base/services/svchost/CMakeLists.txt +++ b/base/services/svchost/CMakeLists.txt @@ -3,4 +3,4 @@ add_executable(svchost svchost.c svchost.rc) set_module_type(svchost win32cui) add_importlibs(svchost advapi32 msvcrt kernel32 ntdll) -add_cab_target(svchost 1) +add_cd_file(TARGET svchost DESTINATION reactos/system32 FOR all) diff --git a/base/services/tcpsvcs/CMakeLists.txt b/base/services/tcpsvcs/CMakeLists.txt index b0810d17338..02439ab483a 100644 --- a/base/services/tcpsvcs/CMakeLists.txt +++ b/base/services/tcpsvcs/CMakeLists.txt @@ -19,5 +19,5 @@ set_module_type(tcpsvcs win32cui) add_importlibs(tcpsvcs ws2_32 advapi32 msvcrt kernel32 ntdll) -add_cab_target(tcpsvcs 1) -add_cab(${CMAKE_CURRENT_SOURCE_DIR}/quotes 5) \ No newline at end of file +add_cd_file(TARGET tcpsvcs DESTINATION reactos/system32 FOR all) +add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/quotes DESTINATION reactos/system32/drivers/etc FOR all) \ No newline at end of file diff --git a/base/services/telnetd/CMakeLists.txt b/base/services/telnetd/CMakeLists.txt index d803319da68..225696094d5 100644 --- a/base/services/telnetd/CMakeLists.txt +++ b/base/services/telnetd/CMakeLists.txt @@ -10,4 +10,4 @@ target_link_libraries(telnetd wine) set_module_type(telnetd win32cui) add_importlibs(telnetd advapi32 ws2_32 msvcrt kernel32 ntdll) -add_cab_target(telnetd 1) +add_cd_file(TARGET telnetd DESTINATION reactos/system32 FOR all) diff --git a/base/services/umpnpmgr/CMakeLists.txt b/base/services/umpnpmgr/CMakeLists.txt index 03ccbec6ab0..d02270ebe3f 100644 --- a/base/services/umpnpmgr/CMakeLists.txt +++ b/base/services/umpnpmgr/CMakeLists.txt @@ -11,4 +11,4 @@ target_link_libraries(umpnpmgr pnprpc wdmguid ${PSEH_LIB}) set_module_type(umpnpmgr win32cui) add_importlibs(umpnpmgr advapi32 rpcrt4 userenv msvcrt kernel32 ntdll) -add_cab_target(umpnpmgr 1) +add_cd_file(TARGET umpnpmgr DESTINATION reactos/system32 FOR all) diff --git a/base/services/wlansvc/CMakeLists.txt b/base/services/wlansvc/CMakeLists.txt index 284e925e6a0..91edbdaf48b 100644 --- a/base/services/wlansvc/CMakeLists.txt +++ b/base/services/wlansvc/CMakeLists.txt @@ -8,4 +8,4 @@ target_link_libraries(wlansvc wlansvcrpc ${PSEH_LIB}) set_module_type(wlansvc win32cui) add_importlibs(wlansvc advapi32 rpcrt4 iphlpapi msvcrt kernel32 ntdll) -add_cab_target(wlansvc 1) +add_cd_file(TARGET wlansvc DESTINATION reactos/system32 FOR all) diff --git a/base/setup/reactos/CMakeLists.txt b/base/setup/reactos/CMakeLists.txt index 3a0ceb6eb12..85abb83efba 100644 --- a/base/setup/reactos/CMakeLists.txt +++ b/base/setup/reactos/CMakeLists.txt @@ -8,4 +8,4 @@ target_link_libraries(reactos uuid) set_module_type(reactos win32gui) add_importlibs(reactos gdi32 user32 comctl32 setupapi msvcrt kernel32 ntdll) -add_minicd_target(reactos reactos) +add_cd_file(TARGET reactos DESTINATION reactos NO_CAB FOR bootcd) diff --git a/base/setup/reactos/lang/pl-PL.rc b/base/setup/reactos/lang/pl-PL.rc index dbb342a0167..7b1fdb25cfd 100644 --- a/base/setup/reactos/lang/pl-PL.rc +++ b/base/setup/reactos/lang/pl-PL.rc @@ -15,7 +15,7 @@ CAPTION "Instalator ReactOS" FONT 8, "MS Shell Dlg" BEGIN LTEXT "Witaj w Kreatorze instalacji ReactOS.", IDC_STARTTITLE, 115, 8, 195, 24 - LTEXT "Nie mo¿esz zainstalowaæ ReactOS bezpoœrednio! Uruchom ponownie komputer z tej p³yty aby zainstalowaæ ReactOS.", IDC_STATIC, 115, 40, 195, 100 + LTEXT "Nie mo¿esz zainstalowaæ ReactOS bezpoœrednio! Uruchom ponownie komputer z tej p³yty, aby zainstalowaæ ReactOS.", IDC_STATIC, 115, 40, 195, 100 LTEXT "Naciœnij przycisk aby zakoñczyæ pracê Instalatora.", IDC_STATIC, 115, 169, 195, 17 END @@ -29,7 +29,7 @@ BEGIN CONTROL "", IDC_LANGUAGES, "ComboBox", WS_VSCROLL | WS_TABSTOP | CBS_DROPDOWNLIST, 132, 107, 176, 142 CONTROL "Uk³ad klawiatury:", IDC_STATIC, "Static", WS_CHILD | WS_VISIBLE | WS_GROUP | SS_RIGHT, 20, 142, 106, 11 CONTROL "", IDC_KEYLAYOUT, "ComboBox", WS_VSCROLL | WS_TABSTOP | CBS_DROPDOWNLIST, 132, 141, 176, 81 - LTEXT "Naciœnij Dalej aby wybraæ rodzaj instalacji.", IDC_STATIC, 10, 180 ,297, 10 + LTEXT "Naciœnij Dalej, aby wybraæ rodzaj instalacji.", IDC_STATIC, 10, 180 ,297, 10 END IDD_TYPEPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193 @@ -40,7 +40,7 @@ BEGIN CONTROL "Rodzaj instalacji", IDC_STATIC, "Button", BS_GROUPBOX, 10,0,297,172 CONTROL "Zainstaluj ReactOS", IDC_INSTALL, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP, 20, 15, 277, 10 CONTROL "Napraw lub zaktualizuj zainstalowany wczeœniej ReactOS", IDC_SETUP, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP | WS_DISABLED , 20, 30, 277, 10 - LTEXT "Naciœnij Dalej aby zmieniæ ustawienia sprzêtu.", IDC_STATIC, 10, 180 ,297, 10 + LTEXT "Naciœnij Dalej, aby zmieniæ ustawienia sprzêtu.", IDC_STATIC, 10, 180 ,297, 10 END IDD_DEVICEPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193 @@ -55,7 +55,7 @@ BEGIN CONTROL "", IDC_DISPLAY, "ComboBox", WS_VSCROLL | WS_TABSTOP | CBS_DROPDOWNLIST , 100, 35, 150, 80 LTEXT "Klawiatura:", IDC_STATIC, 20,55, 80, 10 CONTROL "", IDC_KEYBOARD, "ComboBox", WS_VSCROLL | WS_TABSTOP | CBS_DROPDOWNLIST , 100, 55, 150, 80 - LTEXT "Naciœnij Dalej aby ustaliæ miejsce instalacji.", IDC_STATIC, 10, 180 ,277, 20 + LTEXT "Naciœnij Dalej, aby ustaliæ miejsce instalacji.", IDC_STATIC, 10, 180 ,277, 20 END IDD_DRIVEPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193 @@ -69,7 +69,7 @@ BEGIN PUSHBUTTON "&Usuñ", IDC_PARTDELETE, 76,155,50,15 PUSHBUTTON "s&terownik", IDC_DEVICEDRIVER, 162,155,50,15, WS_DISABLED PUSHBUTTON "&Opcje zaawansowane...", IDC_PARTMOREOPTS, 218,155,80,15 - LTEXT "Naciœnij Dalej aby rozpocz¹æ proces instalacji.", IDC_STATIC, 10, 180 ,277, 20 + LTEXT "Naciœnij Dalej, aby rozpocz¹æ proces instalacji.", IDC_STATIC, 10, 180 ,277, 20 END IDD_PARTITION DIALOGEX DISCARDABLE 0, 0, 145, 90 @@ -111,7 +111,7 @@ CAPTION "Instalator ReactOS" FONT 8, "MS Shell Dlg" BEGIN CONTROL "Podsumowanie instalacji", IDC_ACTION, "Button", BS_GROUPBOX, 10,0,297,172 - LTEXT "Kliknij Dalej aby rozpocz¹æ proces instalacji.", IDC_STATIC, 10, 180 ,277, 20 + LTEXT "Kliknij Dalej, aby rozpocz¹æ proces instalacji.", IDC_STATIC, 10, 180 ,277, 20 END IDD_PROCESSPAGE DIALOGEX 0, 0, 317, 193 @@ -136,7 +136,7 @@ BEGIN LTEXT "Po klikniêciu Zakoñcz ten komputer zostanie uruchomiony ponownie.", IDC_STATIC, 20, 80, 277, 10 CONTROL "", IDC_RESTART_PROGRESS, "msctls_progress32", PBS_SMOOTH | WS_CHILD | WS_VISIBLE | WS_BORDER, 20, 120, 277, 8 - LTEXT "Jeœli w napêdzie jest p³yta CD, wyci¹gnij j¹. Nastêpnie naciœnij Zakoñcz aby uruchomiæ ponownie Twój komputer.", IDC_STATIC, 10, 180, 297, 20 + LTEXT "Jeœli w napêdzie jest p³yta CD, wyci¹gnij j¹. Nastêpnie naciœnij Zakoñcz, aby uruchomiæ ponownie Twój komputer.", IDC_STATIC, 10, 180, 297, 20 END STRINGTABLE @@ -152,7 +152,7 @@ BEGIN IDS_PROCESSTITLE "Przygotuj partycjê, skopiuj pliki i zapisz ustawienia systemu" IDS_PROCESSSUBTITLE "Przygotuj i sformatuj partycjê, skopiuj pliki, skopiuj i zainstaluj bootloader" IDS_RESTARTTITLE "Pierwszy etap instalacji zakoñczony sukcesem" - IDS_RESTARTSUBTITLE "Pierwszy etap instalacji zosta³ zakoñczony, uruchom ponownie komputer aby przejœæ do drugiego etapu" + IDS_RESTARTSUBTITLE "Pierwszy etap instalacji zosta³ zakoñczony, uruchom ponownie komputer, aby przejœæ do drugiego etapu" IDS_SUMMARYTITLE "Podsumowanie instalacji" IDS_SUMMARYSUBTITLE "SprawdŸ ustawienia instalacji przed dokonaniem zmian na dysku" IDS_ABORTSETUP "Instalacja ReactOS nie zosta³a ukoñczona na tym komputerze. Jeœli teraz zakoñczysz instalacjê, bêdziesz musia³ uruchomiæ Instalator ponownie, aby zainstalowaæ Reactos. Na pewno zakoñczyæ?" diff --git a/base/setup/setup/CMakeLists.txt b/base/setup/setup/CMakeLists.txt index 27a9f644ef3..5bff8ecc28a 100644 --- a/base/setup/setup/CMakeLists.txt +++ b/base/setup/setup/CMakeLists.txt @@ -5,4 +5,4 @@ add_executable(setup setup.c setup.rc) set_module_type(setup win32gui) add_importlibs(setup userenv msvcrt kernel32 ntdll) -add_cab_target(setup 1) +add_cd_file(TARGET setup DESTINATION reactos/system32 FOR all) diff --git a/base/setup/usetup/CMakeLists.txt b/base/setup/usetup/CMakeLists.txt index 269fd741bab..a0f6410702c 100644 --- a/base/setup/usetup/CMakeLists.txt +++ b/base/setup/usetup/CMakeLists.txt @@ -44,4 +44,4 @@ endif() set_module_type(usetup nativecui) add_importlibs(usetup kernel32 ntdll) -add_minicd_target(usetup reactos/system32 smss.exe) +add_cd_file(TARGET usetup DESTINATION reactos/system32 NO_CAB NAME_ON_CD smss.exe FOR bootcd) diff --git a/base/setup/usetup/filesup.c b/base/setup/usetup/filesup.c index f0d8152e1f9..0051b0abed0 100644 --- a/base/setup/usetup/filesup.c +++ b/base/setup/usetup/filesup.c @@ -126,7 +126,7 @@ SetupCopyFile(PWCHAR SourceFileName, FILE_SEQUENTIAL_ONLY); if(!NT_SUCCESS(Status)) { - DPRINT1("NtOpenFile failed: %x\n", Status); + DPRINT1("NtOpenFile failed: %x, %wZ\n", Status, &FileName); goto done; } #else diff --git a/base/setup/usetup/interface/usetup.c b/base/setup/usetup/interface/usetup.c index 9fa6d32fdf3..e839735065a 100644 --- a/base/setup/usetup/interface/usetup.c +++ b/base/setup/usetup/interface/usetup.c @@ -2843,6 +2843,7 @@ AddSectionToCopyQueue(HINF InfFile, PWCHAR FileKeyValue; PWCHAR DirKeyValue; PWCHAR TargetFileName; + WCHAR CompleteOrigFileName[512]; if (SourceCabinet) return AddSectionToCopyQueueCab(InfFile, L"SourceFiles", SourceCabinet, DestinationPath, Ir); @@ -2901,10 +2902,14 @@ AddSectionToCopyQueue(HINF InfFile, break; } + wcscpy(CompleteOrigFileName, SourceRootDir.Buffer); + wcscat(CompleteOrigFileName, L"\\"); + wcscat(CompleteOrigFileName, DirKeyValue); + if (!SetupQueueCopy(SetupFileQueue, SourceCabinet, SourceRootPath.Buffer, - SourceRootDir.Buffer, + CompleteOrigFileName, FileKeyName, DirKeyValue, TargetFileName)) diff --git a/base/setup/usetup/lang/pl-PL.h b/base/setup/usetup/lang/pl-PL.h index ee8d9d8353e..7e3ad8aaf5a 100644 --- a/base/setup/usetup/lang/pl-PL.h +++ b/base/setup/usetup/lang/pl-PL.h @@ -108,7 +108,7 @@ static MUI_ENTRY plPLWelcomePageEntries[] = { 8, 21, - "\x07 Naci˜nij F3 aby wyj˜† bez instalacji systemu ReactOS.", + "\x07 Naci˜nij F3, aby wyj˜† bez instalacji systemu ReactOS.", TEXT_STYLE_NORMAL }, { @@ -208,13 +208,13 @@ static MUI_ENTRY plPLIntroPageEntries[] = { 8, 23, - "\x07 Naci˜nij ENTER aby zainstalowa† system ReactOS.", + "\x07 Naci˜nij ENTER, aby zainstalowa† system ReactOS.", TEXT_STYLE_NORMAL }, { 8, 25, - "\x07 Naci˜nij F3 aby wyj˜† bez instalacji systemu ReactOS.", + "\x07 Naci˜nij F3, aby wyj˜† bez instalacji systemu ReactOS.", TEXT_STYLE_NORMAL }, { @@ -407,13 +407,13 @@ static MUI_ENTRY plPLDevicePageEntries[] = { 6, 19, - "Mo¾esz zmieni† poszczeg¢lne ustawienia za pomoc¥ klawiszy GàRA i Dà", + "Mo¾esz zmieni† poszczeg¢lne ustawienia za pomoc¥ klawiszy GàRA i Dà,", TEXT_STYLE_NORMAL }, { 6, 20, - "aby wybra† kategori©. Potem naci˜nij ENTER by przej˜† do menu z ", + "aby wybra† kategori©. Potem naci˜nij ENTER, by przej˜† do menu z ", TEXT_STYLE_NORMAL }, { @@ -483,19 +483,19 @@ static MUI_ENTRY plPLRepairPageEntries[] = { 8, 17, - "\x07 Naci˜nij R by uruchomi† Konsol© Odtwarzania.", + "\x07 Naci˜nij R, by uruchomi† Konsol© Odtwarzania.", TEXT_STYLE_NORMAL }, { 8, 19, - "\x07 Naci˜nij ESC by powr¢ci† do gˆ¢wnego menu.", + "\x07 Naci˜nij ESC, by powr¢ci† do gˆ¢wnego menu.", TEXT_STYLE_NORMAL }, { 8, 21, - "\x07 Naci˜nij ENTER by zrestartowa† komputer.", + "\x07 Naci˜nij ENTER, by zrestartowa† komputer.", TEXT_STYLE_NORMAL }, { @@ -528,7 +528,7 @@ static MUI_ENTRY plPLComputerPageEntries[] = { 8, 10, - "\x07 Naci˜nij klawisz GàRA albo Dà by wybra† odpowiedni typ komputera.", + "\x07 Naci˜nij klawisz GàRA albo Dà, by wybra† odpowiedni typ komputera.", TEXT_STYLE_NORMAL }, { @@ -540,7 +540,7 @@ static MUI_ENTRY plPLComputerPageEntries[] = { 8, 13, - "\x07 Naci˜nij klawisz ESC aby powr¢ci† do poprzedniej strony bez zmiany", + "\x07 Naci˜nij klawisz ESC, aby powr¢ci† do poprzedniej strony bez zmiany", TEXT_STYLE_NORMAL }, { @@ -632,7 +632,7 @@ static MUI_ENTRY plPLQuitPageEntries[] = { 10, 11, - "Naci˜nij ENTER by zrestartowa† komputer.", + "Naci˜nij ENTER, by zrestartowa† komputer.", TEXT_STYLE_NORMAL }, { @@ -665,19 +665,19 @@ static MUI_ENTRY plPLDisplayPageEntries[] = }, { 8, 10, - "\x07 Naci˜nij klawisz GàRA albo Dà by wybra† rozdzielczo˜† i liczb©", + "\x07 Naci˜nij klawisz GàRA albo Dà, by wybra† rozdzielczo˜† i liczb©", TEXT_STYLE_NORMAL }, { 8, 11, - " kolor¢w a nast©pnie naci˜nij ENTER.", + " kolor¢w, a nast©pnie naci˜nij ENTER.", TEXT_STYLE_NORMAL }, { 8, 13, - "\x07 Naci˜nij ESC key aby powr¢ci† do poprzedniej strony bez zmiany", + "\x07 Naci˜nij ESC, aby powr¢ci† do poprzedniej strony bez zmiany", TEXT_STYLE_NORMAL }, { @@ -729,7 +729,7 @@ static MUI_ENTRY plPLSuccessPageEntries[] = { 10, 11, - "Naci˜nij ENTER by zrestartowa† komputer.", + "Naci˜nij ENTER, by zrestartowa† komputer.", TEXT_STYLE_NORMAL }, { @@ -816,25 +816,25 @@ static MUI_ENTRY plPLSelectPartitionEntries[] = { 8, 11, - "\x07 Naci˜nij GàRA lub Dà by wybra† pozycj© z listy.", + "\x07 Naci˜nij GàRA lub Dà, by wybra† pozycj© z listy.", TEXT_STYLE_NORMAL }, { 8, 13, - "\x07 Naci˜nij ENTER by zainstalowa† ReactOS na wybranej partycji.", + "\x07 Naci˜nij ENTER, by zainstalowa† ReactOS na wybranej partycji.", TEXT_STYLE_NORMAL }, { 8, 15, - "\x07 Naci˜nij C by stworzy† now¥ partycj©.", + "\x07 Naci˜nij C, by stworzy† now¥ partycj©.", TEXT_STYLE_NORMAL }, { 8, 17, - "\x07 Naci˜nij D by skasowa† istniej¥c¥ partycj©.", + "\x07 Naci˜nij D, by skasowa† istniej¥c¥ partycj©.", TEXT_STYLE_NORMAL }, { @@ -868,7 +868,7 @@ static MUI_ENTRY plPLFormatPartitionEntries[] = { 6, 10, - "Instalator sformatuje teraz partycj©. Naci˜nij ENTER aby kontynuowa†.", + "Instalator sformatuje teraz partycj©. Naci˜nij ENTER, aby kontynuowa†.", TEXT_STYLE_NORMAL }, { @@ -908,7 +908,7 @@ static MUI_ENTRY plPLInstallDirectoryEntries[] = { 6, 14, - "Aby zmieni† domy˜lny katalog, u¾yj klawisza BACKSPACE by skasowa†", + "Aby zmieni† domy˜lny katalog, u¾yj klawisza BACKSPACE, by skasowa†", TEXT_STYLE_NORMAL }, { @@ -1046,7 +1046,7 @@ static MUI_ENTRY plPLKeyboardSettingsEntries[] = { 8, 10, - "\x07 Naci˜nij klawisz GàRA albo Dà by wybra† odpowiedni typ klawiatury.", + "\x07 Naci˜nij klawisz GàRA albo Dà, by wybra† odpowiedni typ klawiatury.", TEXT_STYLE_NORMAL }, { @@ -1058,7 +1058,7 @@ static MUI_ENTRY plPLKeyboardSettingsEntries[] = { 8, 13, - "\x07 Naci˜nij ESC key aby powr¢ci† do poprzedniej strony bez zmiany", + "\x07 Naci˜nij ESC, aby powr¢ci† do poprzedniej strony bez zmiany", TEXT_STYLE_NORMAL }, { @@ -1098,7 +1098,7 @@ static MUI_ENTRY plPLLayoutSettingsEntries[] = { 8, 10, - "\x07 Naci˜nij klawisz GàRA albo Dà by wybra† odpowiedni ukˆad", + "\x07 Naci˜nij klawisz GàRA albo Dà, by wybra† odpowiedni ukˆad", TEXT_STYLE_NORMAL }, { @@ -1110,7 +1110,7 @@ static MUI_ENTRY plPLLayoutSettingsEntries[] = { 8, 13, - "\x07 Naci˜nij ESC key aby powr¢ci† do poprzedniej strony bez zmiany", + "\x07 Naci˜nij ESC, aby powr¢ci† do poprzedniej strony bez zmiany", TEXT_STYLE_NORMAL }, { @@ -1180,19 +1180,19 @@ static MUI_ENTRY plPLSelectFSEntries[] = { 8, 19, - "\x07 Naci˜nij klawisz GàRA alub Dà by wybra† system plik¢w.", + "\x07 Naci˜nij klawisz GàRA alub Dà, by wybra† system plik¢w.", 0 }, { 8, 21, - "\x07 Naci˜nij ENTER aby sformatowa† partycj©.", + "\x07 Naci˜nij ENTER, aby sformatowa† partycj©.", 0 }, { 8, 23, - "\x07 Naci˜nij ESC aby wybra† inn¥ partycj©.", + "\x07 Naci˜nij ESC, aby wybra† inn¥ partycj©.", 0 }, { @@ -1227,7 +1227,7 @@ static MUI_ENTRY plPLDeletePartitionEntries[] = { 8, 18, - "\x07 Naci˜nij D by skasowa† partycj©.", + "\x07 Naci˜nij D, by skasowa† partycj©.", TEXT_STYLE_NORMAL }, { @@ -1239,7 +1239,7 @@ static MUI_ENTRY plPLDeletePartitionEntries[] = { 8, 21, - "\x07 Naci˜nij ESC aby anulowa†.", + "\x07 Naci˜nij ESC, aby anulowa†.", TEXT_STYLE_NORMAL }, { @@ -1291,10 +1291,10 @@ MUI_ERROR plPLErrorEntries[] = //ERROR_NOT_INSTALLED "ReactOS nie zostaˆ w peˆni zainstalowany na twoim\n" "komputerze. Je˜li wyjdziesz teraz, trzeba b©dzie\n" - "ponownie uruchomi† instalator by zainstalowa† ReactOS.\n" + "ponownie uruchomi† instalator, by zainstalowa† ReactOS.\n" "\n" - " \x07 Naci˜nij ENTER aby kontynuowa† instalacj©.\n" - " \x07 Naci˜nij F3 aby wyj˜† z instalatora.", + " \x07 Naci˜nij ENTER, aby kontynuowa† instalacj©.\n" + " \x07 Naci˜nij F3, aby wyj˜† z instalatora.", "F3= Wyj˜cie ENTER = Kontynuacja" }, { @@ -1359,8 +1359,8 @@ MUI_ERROR plPLErrorEntries[] = "\n" "Tworzenie lub kasowanie partycji mo¾e zniszczy† caˆ¥ tablic© partycji.\n" "\n" - " \x07 Naci˜nij F3 aby wyj˜† z instalatora." - " \x07 Naci˜nij ENTER aby kontynuowa†.", + " \x07 Naci˜nij F3, aby wyj˜† z instalatora." + " \x07 Naci˜nij ENTER, aby kontynuowa†.", "F3= Wyj˜cie ENTER = Kontynuacja" }, { @@ -1368,14 +1368,14 @@ MUI_ERROR plPLErrorEntries[] = "Nie mo¾esz stworzy† nowej partycji w miejscu ju¾\n" "istniej¥cej!\n" "\n" - " * Naci˜nij dowolny klawisz aby kontynuowa†.", + " * Naci˜nij dowolny klawisz, aby kontynuowa†.", NULL }, { //ERROR_DELETE_SPACE, "Nie mo¾esz skasowa† pustej przestrzeni, gdzie nie ma ¾adnej partycji!\n" "\n" - " * Naci˜nij dowolny klawisz aby kontynuowa†.", + " * Naci˜nij dowolny klawisz, aby kontynuowa†.", NULL }, { @@ -1494,7 +1494,7 @@ MUI_ERROR plPLErrorEntries[] = { //ERROR_INSUFFICIENT_DISKSPACE, "Brak wystarczaj¥cej wolnej przestrzeni w wybranej partycji.\n" - " * Naci˜nij dowolny klawisz aby kontynuowa†.", + " * Naci˜nij dowolny klawisz, aby kontynuowa†.", NULL }, { diff --git a/base/setup/usetup/lang/sv-SE.h b/base/setup/usetup/lang/sv-SE.h index debbfc22b61..c4aeeadbb5c 100644 --- a/base/setup/usetup/lang/sv-SE.h +++ b/base/setup/usetup/lang/sv-SE.h @@ -1,3 +1,9 @@ +/* + * PROJECT: ReactOS Setup + * FILE: \base\setup\usetup\lang\sv-SE.h + * PURPOSE: Swedish resource file + * Translation: Jaix Bly plus perhaps GreatLord if blame and translate.reactos.se is consulted. + */ #pragma once MUI_LAYOUTS svSELayouts[] = @@ -30,7 +36,7 @@ static MUI_ENTRY svSELanguagePageEntries[] = { 8, 11, - " Then press ENTER.", + " Then Tryck ENTER.", TEXT_STYLE_NORMAL }, { @@ -42,7 +48,7 @@ static MUI_ENTRY svSELanguagePageEntries[] = { 0, 0, - " ENTER = Continue F3 = Quit", + " ENTER = Fortsätt F3 = Avsluta", TEXT_TYPE_STATUS }, { @@ -796,43 +802,43 @@ static MUI_ENTRY svSESelectPartitionEntries[] = { 6, 8, - "The list below shows existing partitions and unused disk", + "Lista nedan visar befintliga partitioner och oanvändt", TEXT_STYLE_NORMAL }, { 6, 9, - "space for new partitions.", + "diskutrymme för nya partitioner.", TEXT_STYLE_NORMAL }, { 8, 11, - "\x07 Press UP or DOWN to select a list entry.", + "\x07 Tryck UPP eller NER tangenten för att välja i listan.", TEXT_STYLE_NORMAL }, { 8, 13, - "\x07 Press ENTER to install ReactOS onto the selected partition.", + "\x07 Tryck ENTER för att installerara ReactOS till vald partition.", TEXT_STYLE_NORMAL }, { 8, 15, - "\x07 Press C to create a new partition.", + "\x07 Tryck C för att skapa en ny partition.", TEXT_STYLE_NORMAL }, { 8, 17, - "\x07 Press D to delete an existing partition.", + "\x07 Tryck D för att ta bort en befintlig partititon.", TEXT_STYLE_NORMAL }, { 0, 0, - " Please wait...", + " Var Vänlig Vänta...", TEXT_TYPE_STATUS }, { @@ -854,19 +860,19 @@ static MUI_ENTRY svSEFormatPartitionEntries[] = { 6, 8, - "Format partition", + "Formatera partition", TEXT_STYLE_NORMAL }, { 6, 10, - "Setup will now format the partition. Press ENTER to continue.", + "Partitionen kommer nu att formaters Tryck ENTER för att fortsätta.", TEXT_STYLE_NORMAL }, { 0, 0, - " ENTER = Continue F3 = Quit", + " ENTER = Fortsätt F3 = Avsluta", TEXT_TYPE_STATUS }, { @@ -888,37 +894,37 @@ static MUI_ENTRY svSEInstallDirectoryEntries[] = { 6, 8, - "Setup installs ReactOS files onto the selected partition. Choose a", + "ReactOS installeras till vald partition. Välj en", TEXT_STYLE_NORMAL }, { 6, 9, - "directory where you want ReactOS to be installed:", + "mapp som du vill installera ReactOS till.:", TEXT_STYLE_NORMAL }, { 6, 14, - "To change the suggested directory, press BACKSPACE to delete", + "För att ändra den föreslagna mappen, tryck BACKSTEG för att radera", TEXT_STYLE_NORMAL }, { 6, 15, - "characters and then type the directory where you want ReactOS to", + "bokstäver och skriv sedan in mappen dit du vill att ReactOS ska bli", TEXT_STYLE_NORMAL }, { 6, 16, - "be installed.", + "installerad.", TEXT_STYLE_NORMAL }, { 0, 0, - " ENTER = Continue F3 = Quit", + " ENTER = Fortsätt F3 = Avsluta", TEXT_TYPE_STATUS }, { @@ -940,25 +946,25 @@ static MUI_ENTRY svSEFileCopyEntries[] = { 11, 12, - "Please wait while ReactOS Setup copies files to your ReactOS", + "Var vänlig vänta medans ReactOS Setup kopieras till din ReactOS.", TEXT_STYLE_NORMAL }, { 30, 13, - "installation folder.", + "installationsmapp.", TEXT_STYLE_NORMAL }, { 20, 14, - "This may take several minutes to complete.", + "Detta kan ta flera minuter att fullfölja.", TEXT_STYLE_NORMAL }, { 0, 0, - " \xB3 Please wait... ", + " \xB3 Var Vänlig Vänta... ", TEXT_TYPE_STATUS }, { @@ -980,37 +986,37 @@ static MUI_ENTRY svSEBootLoaderEntries[] = { 6, 8, - "Setup is installing the boot loader", + "Setup installerar boot-loadern", TEXT_STYLE_NORMAL }, { 8, 12, - "Install bootloader on the harddisk (MBR and VBR).", + "Installera bootloadern till harddisken (MBR and VBR).", TEXT_STYLE_NORMAL }, { 8, 13, - "Install bootloader on the harddisk (VBR only).", + "Installera bootloadern till hårddisken (VBR only).", TEXT_STYLE_NORMAL }, { 8, 14, - "Install bootloader on a floppy disk.", + "Installera bootloadern till en diskett.", TEXT_STYLE_NORMAL }, { 8, 15, - "Skip install bootloader.", + "Skippa installation av bootloader.", TEXT_STYLE_NORMAL }, { 0, 0, - " ENTER = Continue F3 = Quit", + " ENTER = Fortsätt F3 = Avsluta", TEXT_TYPE_STATUS }, { @@ -1032,37 +1038,37 @@ static MUI_ENTRY svSEKeyboardSettingsEntries[] = { 6, 8, - "You want to change the type of keyboard to be installed.", + "Du vill ändra tangentbordstyp som ska intealleras.", TEXT_STYLE_NORMAL }, { 8, 10, - "\x07 Press the UP or DOWN key to select the desired keyboard type.", + "\x07 Tryck UP eller NER tangenten för att välja önskat tangentbordstyp.", TEXT_STYLE_NORMAL }, { 8, 11, - " Then press ENTER.", + " Tryck sedan ENTER.", TEXT_STYLE_NORMAL }, { 8, 13, - "\x07 Press the ESC key to return to the previous page without changing", + "\x07 Tryck ESC tangenten för att återgå till förra sidan utan att ändra något.", TEXT_STYLE_NORMAL }, { 8, 14, - " the keyboard type.", + " tangentbordstyp.", TEXT_STYLE_NORMAL }, { 0, 0, - " ENTER = Continue ESC = Cancel F3 = Quit", + " ENTER = Fortsätt ESC = Avbryt F3 = Avsluta", TEXT_TYPE_STATUS }, { @@ -1084,37 +1090,37 @@ static MUI_ENTRY svSELayoutSettingsEntries[] = { 6, 8, - "Please select a layout to be installed by default.", + "Var vänlig och välj layout du vill installera som standard.", TEXT_STYLE_NORMAL }, { 8, 10, - "\x07 Press the UP or DOWN key to select the desired keyboard", + "\x07 Tryck UPP eller NER tangenten för att välja önskad", TEXT_STYLE_NORMAL }, { 8, 11, - " layout. Then press ENTER.", + " tangentbordslayout. Tryck sedan ENTER.", TEXT_STYLE_NORMAL }, { 8, 13, - "\x07 Press the ESC key to return to the previous page without changing", + "\x07 Tryck ESC tangenten för att återgå till förra sidan utan att ändra", TEXT_STYLE_NORMAL }, { 8, 14, - " the keyboard layout.", + " tangentbordslayout.", TEXT_STYLE_NORMAL }, { 0, 0, - " ENTER = Continue ESC = Cancel F3 = Quit", + " ENTER = Fortsätt ESC = Avbryt F3 = Avsluta", TEXT_TYPE_STATUS }, { @@ -1137,13 +1143,13 @@ static MUI_ENTRY svSEPrepareCopyEntries[] = { 6, 8, - "Setup prepares your computer for copying the ReactOS files. ", + "Setup förbereder din dator för kopiering av ReactOS filer. ", TEXT_STYLE_NORMAL }, { 0, 0, - " Building the file copy list...", + " Sammanställer filkopieringslistan...", TEXT_TYPE_STATUS }, { @@ -1166,31 +1172,31 @@ static MUI_ENTRY svSESelectFSEntries[] = { 6, 17, - "Select a file system from the list below.", + "Välj ett filsystem i listan nedan.", 0 }, { 8, 19, - "\x07 Press UP or DOWN to select a file system.", + "\x07 Tryck UPP or NER tangenten för att välja filsystem.", 0 }, { 8, 21, - "\x07 Press ENTER to format the partition.", + "\x07 Tryck ENTER för att formatera partitionen.", 0 }, { 8, 23, - "\x07 Press ESC to select another partition.", + "\x07 Tryck ESC för att välja en annan partition.", 0 }, { 0, 0, - " ENTER = Continue ESC = Cancel F3 = Quit", + " ENTER = Fortsätt ESC = Avbryt F3 = Avsluta", TEXT_TYPE_STATUS }, @@ -1213,31 +1219,31 @@ static MUI_ENTRY svSEDeletePartitionEntries[] = { 6, 8, - "You have chosen to delete the partition", + "Du har valt att ta bort partitionen", TEXT_STYLE_NORMAL }, { 8, 18, - "\x07 Press D to delete the partition.", + "\x07 Tryck D för att ta bort partitionen.", TEXT_STYLE_NORMAL }, { 11, 19, - "WARNING: All data on this partition will be lost!", + "VARNING: Alla data på denna partition kommer att förloras!", TEXT_STYLE_NORMAL }, { 8, 21, - "\x07 Press ESC to cancel.", + "\x07 Tryck ESC för att avbryta.", TEXT_STYLE_NORMAL }, { 0, 0, - " D = Delete Partition ESC = Cancel F3 = Quit", + " D = Tar bort Partitionen ESC = Avbryt F3 = Avsluta", TEXT_TYPE_STATUS }, { @@ -1259,13 +1265,13 @@ static MUI_ENTRY svSERegistryEntries[] = { 6, 8, - "Setup is updating the system configuration. ", + "Setup uppdaterar systemkonfigurationen. ", TEXT_STYLE_NORMAL }, { 0, 0, - " Creating registry hives...", + " Skapar regististerdatafiler...", TEXT_TYPE_STATUS }, { @@ -1281,212 +1287,212 @@ MUI_ERROR svSEErrorEntries[] = { { //ERROR_NOT_INSTALLED - "ReactOS is not completely installed on your\n" - "computer. If you quit Setup now, you will need to\n" - "run Setup again to install ReactOS.\n" + "ReactOS installerades inte fullständigt på din\n" + "dator. Om du avslutar Setup nu, kommer du att behöva\n" + "köra Setup igen för att installera ReactOS.\n" "\n" - " \x07 Press ENTER to continue Setup.\n" - " \x07 Press F3 to quit Setup.", - "F3= Quit ENTER = Continue" + " \x07 Tryck ENTER för att fortsätta Setup.\n" + " \x07 Tryck F3 för att avsluta Setup.", + "F3= Avsluta ENTER = Fortsätta" }, { //ERROR_NO_HDD - "Setup could not find a harddisk.\n", - "ENTER = Reboot computer" + "Setup kunde inte hitta någon hårddisk.\n", + "ENTER = Starta om datorn" }, { //ERROR_NO_SOURCE_DRIVE - "Setup could not find its source drive.\n", - "ENTER = Reboot computer" + "Setup kunde inte hitta sin källdisk.\n", + "ENTER = Starta om datorn" }, { //ERROR_LOAD_TXTSETUPSIF - "Setup failed to load the file TXTSETUP.SIF.\n", - "ENTER = Reboot computer" + "Setup misslyckades att läsa in filen TXTSETUP.SIF.\n", + "ENTER = Starta om datorn" }, { //ERROR_CORRUPT_TXTSETUPSIF - "Setup found a corrupt TXTSETUP.SIF.\n", - "ENTER = Reboot computer" + "Setup fann en korrupt TXTSETUP.SIF.\n", + "ENTER = Starta om datorn" }, { //ERROR_SIGNATURE_TXTSETUPSIF, - "Setup found an invalid signature in TXTSETUP.SIF.\n", - "ENTER = Reboot computer" + "Setup hittade en ogiltig signatur i TXTSETUP.SIF.\n", + "ENTER = Starta om datorn" }, { //ERROR_DRIVE_INFORMATION - "Setup could not retrieve system drive information.\n", - "ENTER = Reboot computer" + "Setup kunde inte läsa in informationen om systemenheten.\n", + "ENTER = Starta om datorn" }, { //ERROR_WRITE_BOOT, - "Setup failed to install FAT bootcode on the system partition.", - "ENTER = Reboot computer" + "Setup misslyckades installera FAT bootkod på systempartitionen.", + "ENTER = Starta om datorn" }, { //ERROR_LOAD_COMPUTER, - "Setup failed to load the computer type list.\n", - "ENTER = Reboot computer" + "Setup misslyckades att läsa datortypslistan.\n", + "ENTER = Starta om datorn" }, { //ERROR_LOAD_DISPLAY, - "Setup failed to load the display settings list.\n", - "ENTER = Reboot computer" + "Setup misslyckades att läsa in skärminställningslistan.\n", + "ENTER = Starta om datorn" }, { //ERROR_LOAD_KEYBOARD, - "Setup failed to load the keyboard type list.\n", - "ENTER = Reboot computer" + "Setup misslyckades att läsa in tangentbordstypslistan.\n", + "ENTER = Starta om datorn" }, { //ERROR_LOAD_KBLAYOUT, - "Setup failed to load the keyboard layout list.\n", - "ENTER = Reboot computer" + "Setup misslyckades att läsa in tangentbordslayoutslistan.\n", + "ENTER = Starta om datorn" }, { //ERROR_WARN_PARTITION, - "Setup found that at least one harddisk contains an incompatible\n" - "partition table that can not be handled properly!\n" + "Setup fann att minst en hårdisk innehåller en partitionstabell\n" + "inte är kompatibel och inte kan hanteras korrekt!\n" "\n" - "Creating or deleting partitions can destroy the partiton table.\n" + "Skapa eller ta bort partitioner kan förstöra partitionstabellen.\n" "\n" - " \x07 Press F3 to quit Setup." - " \x07 Press ENTER to continue.", - "F3= Quit ENTER = Continue" + " \x07 Tryck F3 för att avsluta Setup." + " \x07 Tryck ENTER för att fortsätta.", + "F3= Avsluta ENTER = Fortsätt" }, { //ERROR_NEW_PARTITION, - "You can not create a new Partition inside\n" - "of an already existing Partition!\n" + "Du kan inte skapa en partition inuti\n" + "en redat befintlig partition!\n" "\n" - " * Press any key to continue.", + " * Tryck valfri tangent för att fortsätta.", NULL }, { //ERROR_DELETE_SPACE, - "You can not delete unpartitioned disk space!\n" + "Du kan inte ta bort opartitionerrat diskutrymme!\n" "\n" - " * Press any key to continue.", + " * Tryck valfri tangent för att fortsätta.", NULL }, { //ERROR_INSTALL_BOOTCODE, - "Setup failed to install the FAT bootcode on the system partition.", - "ENTER = Reboot computer" + "Setup misslyckades att installera FAT bootkoden på systempartitionen.", + "ENTER = Starta om datorn" }, { //ERROR_NO_FLOPPY, - "No disk in drive A:.", - "ENTER = Continue" + "Ingen disk i enhet A:.", + "ENTER = Fortsätt" }, { //ERROR_UPDATE_KBSETTINGS, - "Setup failed to update keyboard layout settings.", - "ENTER = Reboot computer" + "Setup misslyckades att updatera inställninarna för tangentbordslayout.", + "ENTER = Starta om datorn" }, { //ERROR_UPDATE_DISPLAY_SETTINGS, - "Setup failed to update display registry settings.", - "ENTER = Reboot computer" + "Setup misslyckades att uppdatera skärmregisterinställningen.", + "ENTER = Starta om datorn" }, { //ERROR_IMPORT_HIVE, - "Setup failed to import a hive file.", - "ENTER = Reboot computer" + "Setup misslyckades att improterea en registerdatafil.", + "ENTER = Starta om datorn" }, { //ERROR_FIND_REGISTRY - "Setup failed to find the registry data files.", - "ENTER = Reboot computer" + "Setup misslyckades att hitta registerdatafilerna.", + "ENTER = Starta om datorn" }, { //ERROR_CREATE_HIVE, - "Setup failed to create the registry hives.", - "ENTER = Reboot computer" + "Setup misslyckades att skapa registerdatafilerna.", + "ENTER = Starta om datorn" }, { //ERROR_INITIALIZE_REGISTRY, - "Setup failed to set the initialize the registry.", - "ENTER = Reboot computer" + "Setup misslyckades att initialisera registret.", + "ENTER = Starta om datorn" }, { //ERROR_INVALID_CABINET_INF, - "Cabinet has no valid inf file.\n", - "ENTER = Reboot computer" + "Kabinettet has inen giltig inf fil.\n", + "ENTER = Starta om datorn" }, { //ERROR_CABINET_MISSING, - "Cabinet not found.\n", - "ENTER = Reboot computer" + "Kabinettet hittades inte.\n", + "ENTER = Starta om datorn" }, { //ERROR_CABINET_SCRIPT, - "Cabinet has no setup script.\n", - "ENTER = Reboot computer" + "Kabinettet har inget installationsskript.\n", + "ENTER = Starta om datorn" }, { //ERROR_COPY_QUEUE, - "Setup failed to open the copy file queue.\n", - "ENTER = Reboot computer" + "Setup misslyckades att öppna filkopierningskön.\n", + "ENTER = Starta om datorn" }, { //ERROR_CREATE_DIR, - "Setup could not create install directories.", - "ENTER = Reboot computer" + "Setup kunnde inte skapa installationsmapparna.", + "ENTER = Starta om datorn" }, { //ERROR_TXTSETUP_SECTION, - "Setup failed to find the 'Directories' section\n" - "in TXTSETUP.SIF.\n", - "ENTER = Reboot computer" + "Setup misslyckades att hitta 'Directories' sektionen\n" + "i TXTSETUP.SIF.\n", + "ENTER = Starta om datorn" }, { //ERROR_CABINET_SECTION, - "Setup failed to find the 'Directories' section\n" - "in the cabinet.\n", - "ENTER = Reboot computer" + "Setup misslyckades att hitta 'Directories' sektionen\n" + "i kabinettet.\n", + "ENTER = Starta om datorn" }, { //ERROR_CREATE_INSTALL_DIR - "Setup could not create the install directory.", - "ENTER = Reboot computer" + "Setup kunnde inte skapa installationsmappen.", + "ENTER = Starta om datorn" }, { //ERROR_FIND_SETUPDATA, - "Setup failed to find the 'SetupData' section\n" - "in TXTSETUP.SIF.\n", - "ENTER = Reboot computer" + "Setup misslyckades att hitta 'SetupData' sektionen\n" + "i TXTSETUP.SIF.\n", + "ENTER = Starta om datorn" }, { //ERROR_WRITE_PTABLE, - "Setup failed to write partition tables.\n" - "ENTER = Reboot computer" + "Setup misslyckades att skriva partitionstabellen.\n" + "ENTER = Starta om datorn" }, { //ERROR_ADDING_CODEPAGE, - "Setup failed to add codepage to registry.\n" - "ENTER = Reboot computer" + "Setup misslyckades att lägga till vald codepage till registret.\n" + "ENTER = Starta om datorn" }, { //ERROR_UPDATE_LOCALESETTINGS, - "Setup could not set the system locale.\n" - "ENTER = Reboot computer" + "Setup kunnde inte ställa in 'system locale'.\n" + "ENTER = Starta om datorn" }, { //ERROR_ADDING_KBLAYOUTS, - "Setup failed to add keyboard layouts to registry.\n" - "ENTER = Reboot computer" + "Setup misslyckades att lägga till tangentbordslayouten till registret.\n" + "ENTER = Starta om datorn" }, { //ERROR_UPDATE_GEOID, - "Setup could not set the geo id.\n" - "ENTER = Reboot computer" + "Setup kunde inte stalla int 'geo id'.\n" + "ENTER = Starta om datorn" }, { //ERROR_INSUFFICIENT_DISKSPACE, - "Not enough free space in the selected partition.\n" - " * Press any key to continue.", + "Inte tillräckligt mycket fritt utrymme på den valda partitionen.\n" + " * Tryck valfri tangent för att fortsätta.", NULL }, { @@ -1598,103 +1604,103 @@ MUI_PAGE svSEPages[] = MUI_STRING svSEStrings[] = { {STRING_PLEASEWAIT, - " Please wait..."}, + " Var vänlig vänta..."}, {STRING_INSTALLCREATEPARTITION, - " ENTER = Install C = Create Partition F3 = Quit"}, + " ENTER = Installera C = Skapa Partition F3 = Avsluta"}, {STRING_INSTALLDELETEPARTITION, - " ENTER = Install D = Delete Partition F3 = Quit"}, + " ENTER = Installera D = Ta bort Partition F3 = Avsluta"}, {STRING_PARTITIONSIZE, - "Size of new partition:"}, + "Storlek på den nya partitionen:"}, {STRING_CHOOSENEWPARTITION, - "You have chosen to create a new partition on"}, + "Du har valt att skapa en ny partiton på"}, {STRING_HDDSIZE, - "Please enter the size of the new partition in megabytes."}, + "Vänligen skriv in storleken av den nya partitionen i megabytes."}, {STRING_CREATEPARTITION, - " ENTER = Create Partition ESC = Cancel F3 = Quit"}, + " ENTER = Skapa Partition ESC = Avbryt F3 = Avsluta"}, {STRING_PARTFORMAT, - "This Partition will be formatted next."}, + "Denna Partition kommer att bli formaterad härnäst."}, {STRING_NONFORMATTEDPART, - "You chose to install ReactOS on a new or unformatted Partition."}, + "Du valde att installera ReactOS på en oformaterad partition."}, {STRING_INSTALLONPART, - "Setup install ReactOS onto Partition"}, + "Setup installerar ReactOS till Partitionen"}, {STRING_CHECKINGPART, - "Setup is now checking the selected partition."}, + "Setup undersöker nu den valda partitionen."}, {STRING_QUITCONTINUE, - "F3= Quit ENTER = Continue"}, + "F3= Avsluta ENTER = Fortsätt"}, {STRING_REBOOTCOMPUTER, - "ENTER = Reboot computer"}, + "ENTER = Starta om datorn"}, {STRING_TXTSETUPFAILED, - "Setup failed to find the '%S' section\nin TXTSETUP.SIF.\n"}, + "Setup misslyckades att hitta '%S' sektionen\ni TXTSETUP.SIF.\n"}, {STRING_COPYING, - " Copying file: %S"}, + " Kopierar fil: %S"}, {STRING_SETUPCOPYINGFILES, - "Setup is copying files..."}, + "Setup kopierar filer..."}, {STRING_REGHIVEUPDATE, - " Updating registry hives..."}, + " Uppdaterar registerdatafiler..."}, {STRING_IMPORTFILE, - " Importing %S..."}, + " Importerar %S..."}, {STRING_DISPLAYETTINGSUPDATE, - " Updating display registry settings..."}, + " Uppdaterar skärmregisterinställningar..."}, {STRING_LOCALESETTINGSUPDATE, - " Updating locale settings..."}, + " Uppdaterar lokala inställningar..."}, {STRING_KEYBOARDSETTINGSUPDATE, - " Updating keyboard layout settings..."}, + " Uppdaterar tangentbordslayoutinställningar..."}, {STRING_CODEPAGEINFOUPDATE, - " Adding codepage information to registry..."}, + " Lägger till information om codepage till registret..."}, {STRING_DONE, - " Done..."}, + " Färdigt..."}, {STRING_REBOOTCOMPUTER2, - " ENTER = Reboot computer"}, + " ENTER = Starta om datorn"}, {STRING_CONSOLEFAIL1, - "Unable to open the console\n\n"}, + "Det går inte öppna Konsollen\n\n"}, {STRING_CONSOLEFAIL2, - "The most common cause of this is using an USB keyboard\n"}, + "Den vanligaste orsaken till detta är att ett USB tangentbord används\n"}, {STRING_CONSOLEFAIL3, - "USB keyboards are not fully supported yet\n"}, + "USB tangentbord är itne helt stött än\n"}, {STRING_FORMATTINGDISK, - "Setup is formatting your disk"}, + "Setup formaterar din disk"}, {STRING_CHECKINGDISK, - "Setup is checking your disk"}, + "Setup underöker din disk"}, {STRING_FORMATDISK1, - " Format partition as %S file system (quick format) "}, + " Formaterar partition som %S filsystem (snabbformatering) "}, {STRING_FORMATDISK2, - " Format partition as %S file system "}, + " Formaterar partition som %S filsystem "}, {STRING_KEEPFORMAT, - " Keep current file system (no changes) "}, + " Behåll nuvarande filsystem (inga förändringar) "}, {STRING_HDINFOPARTCREATE, - "%I64u %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu) on %wZ."}, + "%I64u %s Hårddisk %lu (Port=%hu, Bus=%hu, Id=%hu) på %wZ."}, {STRING_HDDINFOUNK1, - "%I64u %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu)."}, + "%I64u %s Hårddisk %lu (Port=%hu, Bus=%hu, Id=%hu)."}, {STRING_HDDINFOUNK2, - " %c%c Type %lu %I64u %s"}, + " %c%c Typ %lu %I64u %s"}, {STRING_HDINFOPARTDELETE, - "on %I64u %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu) on %wZ."}, + "on %I64u %s Hårddisk %lu (Port=%hu, Bus=%hu, Id=%hu) på %wZ."}, {STRING_HDDINFOUNK3, - "on %I64u %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu)."}, + "on %I64u %s Hårddisk %lu (Port=%hu, Bus=%hu, Id=%hu)."}, {STRING_HDINFOPARTZEROED, - "Harddisk %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."}, + "Hårddisk %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK4, - "%c%c Type %lu %I64u %s"}, + "%c%c Typ %lu %I64u %s"}, {STRING_HDINFOPARTEXISTS, - "on Harddisk %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."}, + "på Hårddisk %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."}, {STRING_HDDINFOUNK5, - "%c%c Type %-3u %6lu %s"}, + "%c%c Typ %-3u %6lu %s"}, {STRING_HDINFOPARTSELECT, - "%6lu %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu) on %S"}, + "%6lu %s Hårddisk %lu (Port=%hu, Bus=%hu, Id=%hu) på %S"}, {STRING_HDDINFOUNK6, - "%6lu %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu)"}, + "%6lu %s Hårddisk %lu (Port=%hu, Bus=%hu, Id=%hu)"}, {STRING_NEWPARTITION, - "Setup created a new partition on"}, + "Setup skapade en ny partition på"}, {STRING_UNPSPACE, - " Unpartitioned space %6lu %s"}, + " Opartitionerat utrymme %6lu %s"}, {STRING_MAXSIZE, "MB (max. %lu MB)"}, {STRING_UNFORMATTED, - "New (Unformatted)"}, + "Ny (Oformaterad)"}, {STRING_FORMATUNUSED, - "Unused"}, + "Oanvänt"}, {STRING_FORMATUNKNOWN, - "Unknown"}, + "Okänd"}, {STRING_KB, "KB"}, {STRING_MB, @@ -1702,6 +1708,6 @@ MUI_STRING svSEStrings[] = {STRING_GB, "GB"}, {STRING_ADDKBLAYOUTS, - "Adding keyboard layouts"}, + "Lägger till tangentbordslayouter"}, {0, 0} }; diff --git a/base/setup/vmwinst/CMakeLists.txt b/base/setup/vmwinst/CMakeLists.txt index 38ea15e5ffc..975d16d5dc4 100644 --- a/base/setup/vmwinst/CMakeLists.txt +++ b/base/setup/vmwinst/CMakeLists.txt @@ -18,4 +18,4 @@ add_importlibs(vmwinst kernel32 ntdll) -add_cab_target(vmwinst 1) +add_cd_file(TARGET vmwinst DESTINATION reactos/system32 FOR all) diff --git a/base/setup/vmwinst/lang/sv-SE.rc b/base/setup/vmwinst/lang/sv-SE.rc new file mode 100644 index 00000000000..a2aba4ddc6b --- /dev/null +++ b/base/setup/vmwinst/lang/sv-SE.rc @@ -0,0 +1,137 @@ +/* + * PROJECT: ReactOS RAPPS + * FILE: \base\setup\vmwinst\lang\sv-SE.rc + * PURPOSE: Swedish resource file + * Translation: Jaix Bly + */ +LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL + +IDD_WELCOMEPAGE DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Installation av Videodrivrutiner" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + LTEXT "ReactOS Setup har upptäckt att du kör ReactOS i VMware(r).", -1, 117, 8, 140, 24 + LTEXT "Om du vill installera VMware(r) SVGA drivrutin tryck 'Nästa', annars tryck 'Avbryt'.", -1, 117, 140, 140, 17 +END + +IDD_INSERT_VMWARE_TOOLS DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Installation av Videodrivrutiner" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + LTEXT "ReactOS Setup kommer inte med VMware(r) SVGA drivrutiner.\n\nGå därför till 'VM' i din VMware(r) workstation menyrad och välj 'Installera VMware verktyg...'\n\n\nTryck 'Nästa' för att fortsätta eller 'Avbryt' för att hoppa över SVGA drivrutinsinstallation.",-1,25,25,225,85 +END + +IDD_INSTALLING_VMWARE_TOOLS DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Installation av Videodrivrutiner" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + LTEXT "{STATUS}",IDC_INSTALLINGSTATUS,25,68,225,8 + CONTROL "", IDC_INSTALLINGPROGRESS, "msctls_progress32", PBS_MARQUEE | WS_CHILD | WS_VISIBLE | WS_BORDER, 25, 80, 225, 8 +END + +IDD_CONFIG DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Installation av Videodrivrutiner" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + LTEXT "Installationen av VMware(r) SVGA drivrutin har lyckats. Vänligen välj önskad skärmupplösning:",-1,25,5,225,20 + PUSHBUTTON "640x480", 1120, 25, 30, 65, 15, BS_AUTORADIOBUTTON + PUSHBUTTON "800x600", 1400, 25, 45, 65, 15, BS_AUTORADIOBUTTON + PUSHBUTTON "1024x768", 1792, 25, 60, 65, 15, BS_AUTORADIOBUTTON + PUSHBUTTON "1152x864", 2016, 25, 75, 65, 15, BS_AUTORADIOBUTTON + PUSHBUTTON "1280x960", 2240, 110, 30, 65, 15, BS_AUTORADIOBUTTON + PUSHBUTTON "1280x1024", 2304, 110, 45, 65, 15, BS_AUTORADIOBUTTON + PUSHBUTTON "1400x1050", 2450, 110, 60, 65, 15, BS_AUTORADIOBUTTON + PUSHBUTTON "1600x1200", 2800, 110, 75, 65, 15, BS_AUTORADIOBUTTON + PUSHBUTTON "1792x1344", 3136, 195, 30, 65, 15, BS_AUTORADIOBUTTON + PUSHBUTTON "1856x1392", 3248, 195, 45, 65, 15, BS_AUTORADIOBUTTON + PUSHBUTTON "1920x1440", 3360, 195, 60, 50, 15, BS_AUTORADIOBUTTON + LTEXT "Vänligen välj önskat färgdjup:", -1, 25, 93, 225, 12 + COMBOBOX IDC_COLORQUALITY, 25, 105, 75, 80, CBS_DROPDOWNLIST | WS_TABSTOP +END + +IDD_INSTALLATION_FAILED DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Installation av Videodrivrutiner" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + LTEXT "ReactOS Setup lyckades inte installera VMware(r) SVGA drivrutin.\n\n\nTryck 'Slutför' för att fortsätta installationsprosessen.",-1,25,25,225,85 +END + +IDD_CHOOSEACTION DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Installation av Videodrivrutiner" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + LTEXT "VMware(r) SVGA drivrutin är redan installerad.\n\nVänligen välj vad du vill göra:",-1,25,5,225,30 + PUSHBUTTON "Konfigurera skärminställingar", IDC_CONFIGSETTINGS, 25, 40, 200, 15, BS_AUTORADIOBUTTON + PUSHBUTTON "Använd en annan grafikdrivrutin", IDC_USEOTHERDRIVER, 25, 55, 200, 15, BS_AUTORADIOBUTTON + PUSHBUTTON "Avinstallera VMware(r) SVGA drivrutin", IDC_UNINSTALL, 25, 70, 200, 15, BS_AUTORADIOBUTTON + LTEXT "Tryck 'Nästa' för att fortsätta eller 'Avbryt' för att avsluta guiden.", -1, 25, 93, 225, 12 +END + +IDD_SELECTDRIVER DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Installation av Videodrivrutiner" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + LTEXT "Vänligen välj Grafikdrivrutin som du vill använda:",-1,25,25,225,15 + PUSHBUTTON "ReactOS VGA drivrutin", IDC_VGA, 25, 40, 225, 15, BS_AUTORADIOBUTTON + PUSHBUTTON "ReactOS VBE drivrutin (SVGA)", IDC_VBE, 25, 55, 225, 15, BS_AUTORADIOBUTTON + LTEXT "Tryck 'Slutför' för att avsluta eller 'Avbryt' för att avsluta installationen utan ändringar.", -1, 25, 93, 225, 20 +END + +IDD_DOUNINSTALL DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Installation av Videodrivrutiner" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + LTEXT "ReactOS Setup kommer att avinstallera din VMware(r) SVGA drivrutin!!!\n\n\nTryck 'Slutför' för att avinstallere drivrutinen eller 'Avbryt' for att lämna det som det är.",-1,25,25,225,85 +END + +STRINGTABLE +BEGIN + IDS_WIZARD_NAME "VMware(r) upptäckt" + IDS_FAILEDTOLOCATEDRIVERS "ReactOS Setup kunde inte hitta installationsfilerna.\nVänligen försäkra dig om att VMware(r) verktygs CD-ROM är monterad." + IDS_FAILEDTOCOPYFILES "ReactOS Setup misslyckades att kopiere nödvändiga filer.\nVänligen försäkra dig om att VMware(r) verktygs CD-ROM är monterad.\n" + IDS_FAILEDTOACTIVATEDRIVER "Misslyckades att aktivera VMware(r) SVGA drivrutin!" + IDS_FAILEDTOSELVGADRIVER "Misslyckades att aktivera ReactOS VGA drivrutin!" + IDS_FAILEDTOSELVBEDRIVER "Misslyckades att aktivera ReactOS VBE drivrutin!" + IDS_UNINSTNOTICE "VMware(r) SVGA drivrutins filer har inte ännu blivit raderade.\nVänligen radera dem manuellt efter att systemet startat om." + IDS_FAILEDTOADDREGENTRIES "Misslyckes att skapa registerinställninar för VMware(r) SVGA drivrutin!" +END + +STRINGTABLE +BEGIN + 10001 "Lägsta (8BPP)" + 10002 "Medel (16BPP)" + 10003 "Högsta (32BPP)" +END + +STRINGTABLE +BEGIN + IDS_SEARCHINGFORCDROM "Söker efter VMware(r) Vertygs CD-ROM..." + IDS_COPYINGFILES "Kopierar filer..." + IDS_ENABLINGDRIVER "Aktiverar VMware(r) SVGA drivrutiner..." +END + +STRINGTABLE +BEGIN + IDD_INSERT_VMWARE_TOOLSTITLE "Guide för installation av VMware (r) SVGA drivrutiner" + IDD_INSERT_VMWARE_TOOLSSUBTITLE "Vänligen sätt in VMware verktygs CD-Rom." + IDD_INSTALLING_VMWARE_TOOLSTITLE "Guide för installation av VMware (r) SVGA drivrutin" + IDD_INSTALLING_VMWARE_TOOLSSUBTITLE "Söker och kopierar VMware (r) SVGA drivrutin." + IDD_CONFIGTITLE "Guide för installation av VMware (r) SVGA drivrutin" + IDD_CONFIGSUBTITLE "Välj din favoritskärmsupplösning." + IDD_INSTALLATION_FAILEDTITLE "Guide för installation av VMware (r) SVGA drivrutin" + IDD_INSTALLATION_FAILEDSUBTITLE "VMware (r) SVGA drivrutinsinstallation misslyckades." + IDD_CHOOSEACTIONTITLE "Guide för installation av VMware (r) SVGA drivrutin" + IDD_CHOOSEACTIONSUBTITLE "Välj vad du vill göra." + IDD_SELECTDRIVERTITLE "Guide för installation av VMware (r) SVGA drivrutin" + IDD_SELECTDRIVERSUBTITLE "Välj en drivrutin." + IDD_DOUNINSTALLTITLE "Guide för installation av VMware (r) SVGA drivrutin" + IDD_DOUNINSTALLSUBTITLE "Avinstallerar drivrutinen." +END diff --git a/base/setup/vmwinst/rsrc.rc b/base/setup/vmwinst/rsrc.rc index db0396060d0..65ee2b880d3 100644 --- a/base/setup/vmwinst/rsrc.rc +++ b/base/setup/vmwinst/rsrc.rc @@ -23,10 +23,11 @@ IDB_HEADER BITMAP "resources/header.bmp" #include "lang/hu-HU.rc" #include "lang/id-ID.rc" #include "lang/it-IT.rc" -//#include "lang/ja-JP.rc" FIXME: iconv issue +#include "lang/ja-JP.rc" #include "lang/lt-LT.rc" #include "lang/no-NO.rc" #include "lang/pl-PL.rc" #include "lang/ru-RU.rc" +#include "lang/sv-SE.rc" #include "lang/uk-UA.rc" #include "lang/zh-CN.rc" diff --git a/base/setup/welcome/CMakeLists.txt b/base/setup/welcome/CMakeLists.txt index de502268d7a..f4252dbaa88 100644 --- a/base/setup/welcome/CMakeLists.txt +++ b/base/setup/welcome/CMakeLists.txt @@ -5,4 +5,4 @@ add_executable(welcome welcome.c welcome.rc) set_module_type(welcome win32gui) add_importlibs(welcome gdi32 user32 msvcrt kernel32 ntdll) -add_minicd_target(welcome reactos) +add_cd_file(TARGET welcome DESTINATION reactos NO_CAB FOR bootcd) diff --git a/base/setup/welcome/rsrc.rc b/base/setup/welcome/rsrc.rc index 89d1c126613..a05f295f6d4 100644 --- a/base/setup/welcome/rsrc.rc +++ b/base/setup/welcome/rsrc.rc @@ -51,7 +51,7 @@ END #include "lang/hu-HU.rc" #include "lang/id-ID.rc" #include "lang/it-IT.rc" -//#include "lang/ja-JP.rc" FIXME: iconv issue +#include "lang/ja-JP.rc" #include "lang/lt-LT.rc" #include "lang/no-NO.rc" #include "lang/nl-NL.rc" diff --git a/base/shell/cmd/CMakeLists.txt b/base/shell/cmd/CMakeLists.txt index 97692babe95..855d5fa458a 100644 --- a/base/shell/cmd/CMakeLists.txt +++ b/base/shell/cmd/CMakeLists.txt @@ -79,4 +79,4 @@ target_link_libraries(cmd wine) add_pch(cmd ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h SOURCE) set_module_type(cmd win32cui) add_importlibs(cmd advapi32 user32 msvcrt kernel32 ntdll) -add_cab_target(cmd 1) +add_cd_file(TARGET cmd DESTINATION reactos/system32 FOR all) diff --git a/base/shell/cmd/lang/sv-SE.rc b/base/shell/cmd/lang/sv-SE.rc new file mode 100644 index 00000000000..e2630f21ce9 --- /dev/null +++ b/base/shell/cmd/lang/sv-SE.rc @@ -0,0 +1,713 @@ +LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL +STRINGTABLE DISCARDABLE +BEGIN + +STRING_ASSOC_HELP, "Ändra assossierad filextention.\n\n\ +assoc [.ext[=[FileType]]]\n\ +\n\ +assoc (print all associations)\n\ +assoc .ext (print specific association)\n\ +assoc .ext= (remove specific association)\n\ +assoc .ext=FileType (add new association)\n" + +STRING_ATTRIB_HELP, "Visar eller ändrar filattributen.\n\n\ +ATTRIB [+R | -R] [+A | -A] [+S | -S] [+H | -H] fil ...\n\ + [/S [/D]]\n\n\ + + Sätter ett attribut\n\ + - Rensar ett attribut\n\ + R Attribut: Skrivskyddad.\n\ + A Attribut: Arkiverad.\n\ + S Attribut: System.\n\ + H Attribut: Dold.\n\ + /S Behandlar matchande filer i den aktuella mappen\n\ + och alla undermappar.\n\ + /D Bearbetar även mappar.\n\n\ +Skriv ATTRIB utan parametrar för att visa attributten för alla filer.\n" + +STRING_ALIAS_HELP, "Sätter, tar bort eller visar alias.\n\n\ +ALIAS [alias=[Kommando]]\n\n\ + alias Namn på ett alias.\n\ + Kommando Text som skall erstättas av ett alias.\n\n\ +för att lista alla alias:\n\ + ALIAS\n\n\ +För att sätta ett nytt eller ändra ett befintligt alias:\n\ + ALIAS da=dir a:\n\n\ +För att ta bort ett alias från listan:\n\ + kortnamn da=" + +STRING_BEEP_HELP, "Skickar en ljudsignal genom högtalaren.\n\nPIP\n" + +STRING_CALL_HELP, "Kallar ett batchprogram från ett annat.\n\n\ +CALL [enhet:][mapp]filnamn [batch-parameter]\n\n\ + batch-parameter Specificerar en kommandoradsinformation som batchprogrammet \n\ + behöver." + +STRING_CD_HELP, "Visar namnet på, eller ändrar aktuell mapp\n\n\ +CHDIR [/D][enhet:][mapp]\n\ +CHDIR[..|.]\n\ +CD [/D][enhet:][mapp]\n\ +CD[..|.]\n\n\ + .. överordnad mapp\n\ + . aktuell mapp\n\ + /D Vill ändra aktuell enhet och aktuell mapp.\n\n\ +Skriv CD enhet: för att visa aktuell mapp på specificerad enhet.\n\ +Skriv CD uten parametere för att visa aktuell enhet och mapp.\n" + +STRING_CHCP_HELP, "Visar eller väljer aktiv teckentabell.\n\n\ +CHCP [nnn]\n\n\ + nnn Anger nummer på teckentabell.\n\n\ +Skriv CHCP utan parametrar för att visa aktiv teckentabellnummer.\n" + +STRING_CHOICE_HELP, "Väntar på att användaren skall ange ett av alternativen.\n\n\ +CHOICE [/C[:]val][/N][/S][/T[:]c,nn][text]\n\n\ + /C[:]Val Anger lista med alternativ. Standard är JN.\n\ + /N Visa inte alternativen och ? vid slutet av frågan.\n\ + /S Behandle valgt alternativ med skiftlägeskänslighet.\n\ + /T[:]c,nn Standardval sätts till c efter nn sekunder.\n\ + text Textsträng som visas.\n\n\ +ERRORLEVEL sätts till nummer för knappen användaren väljer.\n" + +STRING_CLS_HELP, "Tömmer skärmen.\n\nCLS\n" + +STRING_CMD_HELP1, "\nInterna kommandon som är tillgängliga:\n" + +STRING_CMD_HELP2, "\nFunksjoner som är tillgängliga:" + +STRING_CMD_HELP3," [alias:er]" + +STRING_CMD_HELP4," [historik]" + +STRING_CMD_HELP5," [unix filnamnsavslutning]" + +STRING_CMD_HELP6," [mapplista]" + +STRING_CMD_HELP7," [omadressering och datakanaler]" + +STRING_CMD_HELP8, "Start ett ny instans av ReactOS kommandotolk.\n\n\ +CMD [/[C|K] kommando][/P][/Q][/T:bf]\n\n\ + /C kommando Kör angivet kommando och avslutar.\n\ + /K kommando Kör angivet kommando men avslutar inte.\n\ + /P CMD körs permanent och starter autoexec.bat\n\ + (kan inte avsluttes).\n\ + /T:bf Ställer in bakgrunn/forgrunn färg (se COLOR kommando).\n" + +STRING_COLOR_HELP1, "Ställer in standard forgrunns- och bakgrunnsfarger.\n\n\ +COLOR [attr [/-F]] \n\n\ + attr Anger fargeattributter for konsollteksten\n\ + /-F Fyller inte blank plass med fargeattributter\n\n\ +Det finns tre sätt att ange färgerna:\n\ +1) [bright] namn på [bright] namn (bara de tre första bokstäverna krävs)\n\ +2) decimal på decimal\n\ +3) to hexadecimala siffror\n\n\ +Färgerna är:\n\ +dec hex namn dec hex namn\n\ +0 0 Svart 8 8 Grå(ljus Svart)\n\ +1 1 Blå 9 9 Ljus Blå\n\ +2 2 Grön 10 A Ljus Grönn\n\ +3 3 Cyan 11 B Ljus Cyan\n\ +4 4 Röd 12 C Ljus Röd\n\ +5 5 Magenta 13 D Ljus Magenta\n\ +6 6 Gul 14 E Ljus Gult\n\ +7 7 Vit 15 F Ljus Vit\n" + +STRING_COPY_HELP1, "Vill du erstätta %s (Ja/Nej/Alla)? " + +STRING_COPY_HELP2, "Kopierar en eller flera filer till annan plats.\n\n\ +COPY [/V][/Y|/-Y][/A|/B] källa [/A|/B]\n\ + [+ källa [/A|/B] [+ ...]] [mål [/A|/B]]\n\n\ + källa Anger filen eller filerna som kopieras.\n\ + /A Anger att filen är en ASCII-textfil.\n\ + /B Anger att filen är en binär-fil.\n\ + mål Anger mappen och/eller filnamn för den nya filen/filerna.\n\ + /V Kontrollera att nya filer är korrekt skrivna.\n\ + /Y Undertrycker frågor om att godkänna om du önskar att skriva över\n\ + befintlig destinationsfil.\n\ + /-Y Frågar alltid om du vill skriva över\n\ + befintlig destinationsfil.\n\n\ +Växeln /Y kan läggas in i COPYCMD miljövariabel.\n\ +...\n" + +STRING_DATE_HELP1, "\nSkriv in nytt datum (mm%cdd%cyyyy): " + +STRING_DATE_HELP2, "\nSkriv in nytt datum (dd%cmm%cyyyy): " + +STRING_DATE_HELP3, "\nSkriv in nytt datum (yyyy%cmm%cdd): " + +STRING_DATE_HELP4, "Visa eller ändra datumet.\n\n\ +DATE [/T][datum]\n\n\ + /T Endast visa\n\n\ +Skriv DATE utan parametrar för att visa aktuella datum och\n\ +fråga om nytt datum. Tryck ENTER för att behålla samma datum.\n" + +STRING_DEL_HELP1, "Radera en eller flera filer.\n\n\ +DEL [/N /P /T /Q /S /W /Y /Z /A[[:]attribut]] fil ...\n\ +DELETE [/N /P /T /Q /S /W /Y /Z /A[[:]attribut]] fil ...\n\ +ERASE [/N /P /T /Q /S /W /Y /Z /A[[:]attribut]] fil ...\n\n\ + fil Anger fil(er) for radering.\n\n\ + /N Ingenting.\n\ + /P Fråga innan varje fil raderas.\n\ + /T Total. Visar totalt antal raderade filer och frigjort diskutrymme.\n\ + /Q Tyst läge, tar bort filer utan att fråga.\n\ + /W Säker borttagning. Skriv över fil med slumpmässig data före borttagning.\n\ + /Y Ja. Radera även *.* utan att fråga.\n\ + /F Framtvinga radering av dolda, skrivskyddade och systemfiler.\n\ + /S Submappar, radera filer från alla undermappar\n\ + /A Välj filer som skall raderas basert på filattribut.\n\ + attributter\n\ + R Skrivskyddade filer\n\ + S System filer\n\ + A Arkiv filer\n\ + H Dolda filer\n\ + - prefiks som betyder INTE. (f.eks -R)\n" + +STRING_DEL_HELP2, "Alla filer i mappen kommer att bli raderade!\nÄr du säker (J/N)?" +STRING_DEL_HELP3, " %lu fil raderade\n" +STRING_DEL_HELP4, " %lu filer raderade\n" + +STRING_DELAY_HELP, "paus i n sekunder eller mikrosekunder\n\ +DELAY [/m]n\n\n\ + /m anger at n är mikrosekunder\n\ + annars är n sekunder\n" + +STRING_DIR_HELP1, "DIR [enhet:][mapp][filnamn] [/A[[:]attribut]] [/B] [/C] [/D] [/L] [/N]\n\ + [/O[[:]sortering]] [/P] [/Q] [/S] [/T[[:]tidsfält]] [/W] [/X] [/4]\n\n\ + [enhet:][mapp][filnamn]\n\ + Anger enhet, mapp, och/eller filer som skall listes.\n\n\ + /A Vis filer ved att ange attributter.\n\ + attribut D mappar R Skrivskyddade filer\n\ + H Dolda filer A Filer klara för arkivering\n\ + S System filer - Prefiks som betyder INTE\n\ + /B Använder rent filnamnformat (utan överskrift och summering).\n\ + /C Visar tusenavskiljare i filstorleken. Dette är standard-\n\ + inställningen. Avnänd /-C för att deaktivera visning av skiljetecken.\n\ + /D Samme som fullt listformat, men filer sorteras i kolumner.\n\ + /L Använder små bokstäver.\n\ + /N Långt listformat där filenamnen vises längst åt höger.\n\ + /O Lista efter filer i sorterad ordning.\n\ + sortering N Efter namn (alfabetisk) S Efter storlek (minst först)\n\ + E Efter filändelse (alfabetisk) D Efter datum/tid (äldst först)\n\ + G Gruppera mappar först - Prefix för omvänd ordning\n\ + /P Pausa efter varje hel skärmbild.\n\ + /Q Viser vem som äger filen.\n\ + /S Viser alla filer i angiven mapp och alla undermappar.\n\ + /T Kontrollerar vilket tidsfält som visas eller blir använt för sortering\n\ + timefelt C Skapelse \n\ + A Senast läst\n\ + W Senast skriven\n\ + /W Använd brett listformat.\n\ + /X Visar kort namn (8+3) genererat för långa filnamn.\n\ + Formatet är som för /N med det korta namnet\n\ + före det långa namnet. Om det inte finns något kort namn blir tomt namn\n\ + på den platsen.\n\ + /4 Visar fyresiffriga årtal\n\n\ +Växlar kan ställas in på förhand i DIRCMD miljövariabel. Åtsidosätt\n\ +förinställda växlar med ett bindestreck (-) före, till exempel, /-W.\n" + +STRING_DIR_HELP2, " Volumen i enhet %c är %s\n" +STRING_DIR_HELP3, " Volumet i enhet %c är utan namn.\n" +STRING_DIR_HELP4, " Volymens serienummer är %04X-%04X\n" +STRING_DIR_HELP5, "\n Totalt filer listet:\n%16i fil(är)% 14s byte\n" +STRING_DIR_HELP6, "%16i mapp(ar)% 15s byte\n" +STRING_DIR_HELP7, "\n mapp av %s\n\n" +STRING_DIR_HELP8, "%16i fil(er)% 14s byte\n" + +STRING_DIRSTACK_HELP1, "Sparar aktuell mapp for användning av POPD kommandot, och\n\ +ändrar därefter till angiven mapp.\n\n\ +PUSHD [mapp | ..]\n\n\ + mapp ange mapp det ändra till.\n" + +STRING_DIRSTACK_HELP2, "Ändra till mapp som lagrats med PUSHD kommandot.\n\nPOPD" + +STRING_DIRSTACK_HELP3, "Skriver ut innehållet av en mapplista.\n\nDIRS" + +STRING_DIRSTACK_HELP4, "mapplistan är tom" + +STRING_ECHO_HELP1, "Visar meddelanden utan enter och radsprång.\n\n\ + ECHOS meddelande" + +STRING_ECHO_HELP2, "Visar ett meddelande skrivet till mottagare av felmeddelanden.\n\n\ + ECHOERR meddelande\n\ + ECHOERR. skriver en tom rad" + +STRING_ECHO_HELP3, "Skriver en meddelande till standardmottagaren av felmeddelanden utan enter och radsprång.\n\n\ + ECHOSERR meddelande" + +STRING_ECHO_HELP4, "Visar ett meddelande eller växlar kommandot echo på eller av.\n\n\ + ECHO [ON | OFF]\n\ + ECHO [meddelande]\n\ + ECHO. skriv en tom rad\n\n\ +Skriv ECHO utan parametar för att visa aktuell ECHO inställning." + +STRING_ECHO_HELP5, "ECHO är %s\n" + +STRING_EXIT_HELP, "Avsluta kommandotolken (cmd.exe).\n\nEXIT [/b] [ExitCode]\n\n\ + /B Avslutt bara en batchfil. \n\ + Om det körs utan en batch filkommer det avslutta cmd.exe\n\ + ExitCode Detta värdet kommer att skickas till ERRORLEVEL vid avslutning\n" + +STRING_FOR_HELP1, "Kör ett angivet kommando för varje fil i en grupp med filer\n\n\ +FOR %variabel IN (grupp) DO kommando [parametrar]\n\n\ + %variable Anger en utbytbar parameter (en enda bokstav).\n\ + (grupp) Anger en grupp med en eller flera filer. Jokertecken kan användas.\n\ + kommando Anger kommandot som skall användas för varje enskild fil.\n\ + parametrar Anger parametrarna eller växlarna för angivet kommando.\n\n\ +för att bruke FOR kommando i en batchfil, ange %%variabel istället för\n\ +%variabel.\n" + +STRING_FREE_HELP1, "\nVolum i enhet %s är %-11s\n\ + Serienummret är %s\n\ + %16s byte total lagringsutrymme\n\ + %16s byte använt\n\ + %16s byte ledigt\n" + +STRING_FREE_HELP2, "Visa enhetsinformation.\n\nFREE [enhet: ...]\n" + +STRING_IF_HELP1, "Utför villkorsstyrd bearbetning i batchprogram.\n\n\ + IF [NOT] ERRORLEVEL nummer kommando\n\ + IF [NOT] sträng1==sträng2 kommando\n\ + IF [NOT] EXIST filnamn kommando\n\ + IF [NOT] DEFINED variabel kommando\n\n\ +NOT Anger att CMD skall fortsätta kommando bara om\n\ + villkoret är falskt\n\ +ERRORLEVEL nummer Anger sant villkor om förra programkörningen returnerade\n\ + en avslutningskod större än eller lika med nummret angivet.\n\ +kommando Anger vilket kommando som skall utföres då villkoret uppfylls.\n\ +sträng1==sträng2 Anger ett uppfyllt villkor om textsträngarna är lika\n\ +EXIST filnamn Anger ett uppfyllt villkor om angivet filnamn existerar.\n\ +DEFINED variabel Anger ett uppfyllt villkor om angiven variabel är\n\ + definerad.\n" + +STRING_GOTO_HELP1, "Dirigerar CMD till en namngiven etikett i ett batchprogram.\n\n\ +GOTO etikett\n\n\ + etikett Anger en text sträng använt i ett batchprogram.\n\n\ +En etikett skapas på en egen rad genom att skriva kolon följt av namn på etiketten." + +STRING_LABEL_HELP1, "Skapar, tar bort eller ändrar etikett på enhet.\n\nLABEL [enhet:][etikett]\n" + +STRING_LABEL_HELP2, "Volymen i enhet %c: är %s\n" +STRING_LABEL_HELP3, "Volymen i enhet %c: är utan namn\n" +STRING_LABEL_HELP4, "Volymens serienummer är %04X-%04X\n" +STRING_LABEL_HELP5, "Volymnamn (11 tecken, Enter = inget namn)? " + +STRING_LOCALE_HELP1, "aktuell tid är" + +STRING_MKDIR_HELP, "Skapar en mapp.\n\n\ +MKDIR [enhet:]mapp\nMD [enhet:]mapp" + +STRING_MKLINK_HELP, "Skapar en filesystemslänk.\n\n\ +MKLINK [/D | /H | /J] linknamn mål\n\n\ + /D Anger att länkens mål är en mapp.\n\ + /H Skapar en hårdlänk i stället för en symbolisk länk.\n\ + /J Skapar en knutpunkt för en mapp sk. junction.\n\n\ +Om varken /H eller /J är angivna kommer en symbolisk länk att skapas." + +STRING_MEMMORY_HELP1, "Visar mängd systemminne.\n\nMEMORY" + +STRING_MEMMORY_HELP2, "\n %12s%% använt minne.\n\n\ + %13s byte totalt fysisk RAM-minne.\n\ + %13s byte tillgängligt fysisk RAM-minne.\n\n\ + %13s byte total sidväxlingsfil.\n\ + %13s byte tillgänglig sidväxlingsfil.\n\n\ + %13s byte totalt virtuell minne.\n\ + %13s byte tilgängeligt virtuellt minne.\n" + +STRING_MISC_HELP1, "Tryck en knapp för att fortsätta...\n" + +STRING_MOVE_HELP1, "Skriv över %s (Ja/Nej/Alla)? " + +STRING_MOVE_HELP2, "Flyttar filer, och byter namn på filer och mappar.\n\n\ +för att flytte en eller flera filer:\n\ +MOVE [/N][enhet:][mapp]filnamn1[,...] destination\n\n\ +för att ändra namn på en mapp:\n\ +MOVE [/N][enhet:][mapp]mappnamn1 mappnamn2\n\n\ + [enhet:][mapp]filnamn1 Anger placering och namn på fil\n\ + eller filer du önsker att flytta.\n\ + /N Ingenting. Gör allt utom att flytta filer eller mappar.\n\n\ +aktuell begränsningar:\n\ + - Du kan inte flytta en fil eller mapp från en enhet till en annan.\n" + +STRING_MSGBOX_HELP, "vis en meldingsboks och returner brukers svar\n\n\ +MSGBOX type ['tittel'] melding\n\n\ +type knapp vises\n\ + mulige verdier är: OK, OKCANCEL,\n\ + YESNO, YESNOCANCEL\n\ +tittel tittel på meldingsboks\n\ +melding text som vises i meldingsboks\n\n\n\ +ERRORLEVEL settes avhengig av hvilken knapp som trykkes:\n\n\ +JA : 10 | NEI : 11\n\ +OK : 10 | AVBRYT : 12\n" + +STRING_PATH_HELP1, "Viser eller setter en søkesti for kjørbare filer.\n\n\ +PATH [[enhet:]mapp[;...]]\nPATH ;\n\n\ +Skriv PATH; för att tømme alle søkemappar inställninar och angi at kommandoskallet\n\ +kun skal søke aktuell mapp.\n\ +Skriv PATH uten parameter för att visa aktuell søkesti.\n" + +STRING_PROMPT_HELP1, "Ändra kommandoledetekst.\n\n\ +PROMPT [text]\n\n\ + text Anger en nytt kommandoledetekst.\n\n\ +Ledeteksten kan bli satt sammen av normale tegn och følgende spesielle koder:\n\n\ + $A & (och-tegnet)\n\ + $B | (loddrett strek)\n\ + $C ( (venstreparentes)\n\ + $D aktuell dato\n\ + $E Escape-kode (ASCII kode 27)\n\ + $F ) (Høyreparentes)\n\ + $G > (større-enn symbol)\n\ + $H Tilbake (sletter forrige tegn)\n\ + $L < (mindre-enn symbol)\n\ + $N aktuell enhet\n\ + $P aktuell enhet och mapp\n\ + $Q = (likhetstegn)\n\ + $T aktuell klokkeslett\n\ + $V Versjonsnummer for ReactOS\n\ + $_ Retur och linjeskift\n\ + $$ $ (dollar tegn)\n" + +STRING_PAUSE_HELP1, "Stoppar eksekvering av satsvis fil och vis følgende melding:\n\ +'Tryck valfri tangent för att fortsette...' eller en användaren definert melding.\n\n\ +PAUSE [melding]" + +STRING_PROMPT_HELP2, " $+ Vis aktuell dybde av mappstakken" + +STRING_PROMPT_HELP3, "\nSkriv PROMPT uten parameter för att resette ledeteksten." + +STRING_REM_HELP, "Start en kommentarlinje i en satsvis fil.\n\nREM [Kommentar]" + +STRING_RMDIR_HELP, "Flytter en mapp.\n\n\ +RMDIR [enhet:]mapp\nRD [enhet:]mapp\n\ +/S Sletter alle filer och mappar innenfor målet\n\ +/Q Inte spør før sletting.\n" +STRING_RMDIR_HELP2, "mappn är inte tom!\n" + +STRING_REN_HELP1, "Ändra namn på fil/mapp eller filer/mappar.\n\n\ +ENDRE NAVN [/E /N /P /Q /S /T] gammelt_namn ... nytt_namn\n\ +REN [/E /N /P /Q /S /T] gammelt_namn ... nytt_namn\n\n\ + /E Ingen feilmeldinger.\n\ + /N Ingenting.\n\ + /P spørsmål om godkjenning før endring av namn på hver fil.\n\ + (Inte implementert enda!)\n\ + /Q Stille.\n\ + /S Ändra namn på undermapp.\n\ + /T Vis totalt antall endrede filer.\n\n\ +NB; du kan inte ange en ny destinasjon for filen/mappen. Bruk\n\ +MOVE kommando for det formålet.\n" + +STRING_REN_HELP2, " %lu fil endret namn\n" + +STRING_REN_HELP3, " %lu filer endret namn\n" + +STRING_REPLACE_HELP1, "Replaces files.\n\n\ +REPLACE [drive1:][path1]filename [drive2:][path2] [/A] [/P] [/R] [/W]\n\ +REPLACE [drive1:][path1]filename [drive2:][path2] [/P] [/R] [/S] [/W] [/U]\n\n\ + [drive1:][path1]filename Specifies the source file or files.\n\ + [drive2:][path2] Specifies the directory where files are to be\n\ + replaced.\n\ + /A Adds new files to destination directory. Cannot\n\ + use with /S or /U switches.\n\ + /P Prompts for confirmation before replacing a file or\n\ + adding a source file.\n\ + /R Replaces read-only files as well as unprotected\n\ + files.\n\ + /S Replaces files in all subdirectories of the\n\ + destination directory. Cannot use with the /A\n\ + switch.\n\ + /W Waits for you to insert a disk before beginning.\n\ + /U Replaces (updates) only files that are older than\n\ + source files. Cannot use with the /A switch.\n" + +STRING_REPLACE_HELP2, "Source path required\n" + +STRING_REPLACE_HELP3, "No files replaced\n" + +STRING_REPLACE_HELP4, "%lu file(s) replaced\n" + +STRING_REPLACE_HELP5, "Replacing %s\n" + +STRING_REPLACE_HELP6, "Replace %s\n" + +STRING_REPLACE_HELP7, "No files added\n" + +STRING_REPLACE_HELP8, "%lu file(s) added\n" + +STRING_REPLACE_HELP9, "Add %s (Y/N) " + +STRING_REPLACE_HELP10, "Replace %s (Y/N) " + +STRING_REPLACE_HELP11, "Adding %s\n" + + +STRING_SHIFT_HELP, "Ändra posisjon for erstattelig parameter i et satsvis fil.\n\n\ +SHIFT [NED]" + +STRING_SCREEN_HELP, "flytt markør och potensielt skriv ut text\n\n\ +SCREEN rad kol [text]\n\n\ + rad rad markør flyttes til\n\ + kol kolonne markør flyttes til" + +STRING_SET_HELP, "Vis, sett, eller fjern miljøvariabel.\n\n\ +SET [variabel[=][streng]]\n\n\ + variabel Anger miljøvariabel namn.\n\ + string Anger en serie av tegn til bestemme variabel.\n\n\ +Skriv SET uten parameter för att visa aktuell miljøvariabler.\n" + +STRING_START_HELP1, "Start en kommando.\n\n\ +START kommando\n\n\ + kommando Anger kommando för att kjøre.\n\n\ +NB; for øyeblikket blir alle kommandoer startet asynkront.\n" + +STRING_TITLE_HELP, "Velg vindustittel for kommandotolkvindu.\n\n\ +TITLE [streng]\n\n\ +streng Anger tittel for kommandotolkvindu.\n" + +STRING_TIME_HELP1, "Vis eller sett system tid.\n\n\ +TIME [/T][tid]\n\n\ + /T vis bare\n\n\ +Skriv TIME uten parametere för att visa aktuell tidsinställninar och et\n\ +spørsmål om en ny en. Tryck ENTER för att beholde samme tid.\n" + +STRING_TIME_HELP2, "Velg ny tid: " + +STRING_TIMER_HELP1, "Forløpt %d msecs\n" + +STRING_TIMER_HELP2, "Forløpt %02d%c%02d%c%02d%c%02d\n" + +STRING_TIMER_HELP3, "Tillater bruk av inntil ti stoppeklokker.\n\n\ +TIMER [ON|OFF] [/S] [/n] [/Fn]\n\n\ + ON start stoppeklokke\n\ + OFF Stoppar stoppeklokke\n\ + /S Del tiden. Retur stoppeklokke\n\ + tid uten att ändra dens verdi\n\ + /n Anger stoppeklokke nummer.\n\ + Stoppeklokke är tilgjengelig fra 0 til 9\n\ + Hvis inte det är spesifisert är standard lik 1\n\ + /Fn Format for utgående\n\ + n kan bli:\n\ + 0 mikrosekunder\n\ + 1 hh%cmm%css%cdd\n\n\ +hvis hverken ON, OFF eller /S är spesifisert\n\ +vil status for stoppeklokken veksles.\n\n" + +STRING_TYPE_HELP1, "Vis innholdet av tekstfiler.\n\nSkriv [enhet:][mapp]filnamn \n\ + /P Vis en full skjerm om gangen.\n" + +STRING_VERIFY_HELP1, "Denne kommandoen är bare en etterlikning!!\n\ +Anger om det skal bekreftes at dine filer är skrevet korrekt til disk \n\n\ +VERIFY [ON | OFF]\n\n\ +Skriv VERIFY uten parametre för att visa aktuell VERIFY inställninar.\n" + +STRING_VERIFY_HELP2, "VERIFY är %s.\n" + +STRING_VERIFY_HELP3, "Må ange ON eller OFF." + +STRING_VERSION_HELP1, "Vis Reactos versjonen\n\n\ +VER [/C][/R][/W]\n\n\ + /C Vis anerkjennelse.\n\ + /R Vis videreformidlingsinformasjon.\n\ + /W Vis garantiinformasjon." + +STRING_VERSION_HELP2, " kommer med ABSOLUTT INGEN GARANTI; for detaljer\n\ +Skriv: `ver /w'. Dette är gratis programvare, och du är velkommen til videreformidle\n\ +det under gitte betingelser; Skriv `ver /r' for detaljer. Skriv `ver /c' for en\n\ +liste av anerkjennelser." + +STRING_VERSION_HELP3, "\n Dette programet är fordelt i håpet som det vil bli brukbar,\n\ + men UTEN NOEN GARANTI; uten engang antydet garantid for \n\ + SALGBARHET eller BRUKBARHET FOR NOE MÅL. Se \n\ + GNU Generell Publikum Lisens for flere detaljer." + +STRING_VERSION_HELP4, "\n Dette programmet är gratis programvare; du kan videre-\n\ + formidle det och/eller modifisere det under betingelser av Generell Publikum \n\ + Lisens som utgivelses av Free Software Foundation; enten version 2 av \n\ + Lisens, eller (ved din mulighet) andre nyere version.\n" + +STRING_VERSION_HELP5, "\nSend bug rapporter til .\n\ +oppdateringer är tilgjengelig her: http://www.reactos.org" + +STRING_VERSION_HELP6, "\nFreeDOS version skrevet av:\n" + +STRING_VERSION_HELP7, "\nReactOS version skrevet av:\n" + +STRING_VOL_HELP1, " Volumet i enhet %c är %s\n" +STRING_VOL_HELP2, " Volumet i enhet %c har ingen namn.\n" +STRING_VOL_HELP3, " Volumet Serie nummer är %04X-%04X\n" +STRING_VOL_HELP4, "Vis disk volumet merke och serie nummer, hvis det eksisterer.\n\nVOL [enhet:]" + +STRING_WINDOW_HELP1, "ändra konsoll vindu aspekt\n\n\ +WINDOW [/POS[=]venstre,topp,bredde,høyde]\n\ + [MINI|MAKS|GJENOPPRETT] ['tittel']\n\n\ +/POS ange vindusposisjon och størrelse\n\ +MINI minimer vinduet\n\ +MAKS maksimer vinduet\n\ +GJENOPPRETT gjenopprett vinduet" + +STRING_WINDOW_HELP2, "ändra konsoll vindu aspekt\n\n\ +ACTIVATE 'window' [/POS[=]venstre,topp,bredde,høyde]\n\ + [MINI|MAKS|GJENOPPRETT] ['tittel']\n\n\ +vindu tittel av vindu på stad fullføre handlinger\n\ +/POS ange vindu plass och størrelse\n\ +MIN minimer vinduet\n\ +MAX maksimer vinduet\n\ +RESTORE gjenopprett vinduet\n\ +tittel ny tittel\n" + + +STRING_HELP1, "Liste av alle tilgjengelige kommandoer (+ beskrivelse)\n\n\ +kommando /? For mer informasjon om en bestemt kommando\n\n\ +? Lister alle tilgjengelige kommando uten beskrivelse).\n\ +ALIAS Sett, fjern eller vis alias.\n\ +ATTRIB Viser eller ändra fil attributter.\n\ +BEEP Piper i høyttaleren.\n\ +CALL Starte et satsvis program fra et annet.\n\ +CD Vis namnet på eller endrer aktuell mapp.\n\ +CHCP Viser eller anger nummer på aktiv tegntabell.\n\ +CHOICE Venter til bruken väljer en av et sett av val.\n\ +CLS Tømmer skjermen.\n\ +CMD Start en ny forekomst av ReactOS kommandotolk.\n\ +COLOR Anger standard forgrunn- och bakgrunnsfargr for konsollen.\n\ +COPY Kopierer en eller flere filer til en annen plassering.\n\ +DATE Viser eller anger datoen.\n\ +DELETE Sletter en eller flere filer.\n\ +DIR Viser en liste over filer och undermappar i en mapp.\n\ +ECHO Viser meldinger, eller slår kommandoecho på eller av.\n\ +ERASE Sletter en eller flere filer.\n\ +EXIT Avslutter programmet CMD.EXE program (kommandotolken).\n\ +FOR Kjør en bestemt kommando for hver fil i et sett av filer.\n\ +FREE Viser ledig diskplass.\n\ +GOTO Leder ReactOS kommandotolk til en merket linje i\n\ + et satsvis program.\n\ +HELP Viser hjelpeinformasjon for ReactOS-kommandoer.\n\ +HISTORY Lister alle kommandoer som har blitt brukt\n\ +IF Utføre betinget behandling i satsvise programmer.\n\ +LABEL Oppretter, endrer, eller sletter volumnamnet på en disk.\n\ +MD Oppretter en mapp.\n\ +MKDIR Oppretter en mapp.\n\ +MKLINK Creates a filesystem link object.\n\ +MOVE Flytter en eller flere filer fra en mapp til en annen.\n\ +PATH Vis eller sett en søkesti for kjørbare filer.\n\ +PAUSE Avbryter behandling av en satsvis fil, och viser en melding.\n\ +POPD Fjenoppretter den forige verdien av aktuell mapp, lagret av\n\ + PUSHD.\n\ +PROMPT Ändra kommandoledeteksten.\n\ +PUSHD Lagre aktuell mapp och endrer den etterpå.\n\ +RD Fjerner en mapp.\n\ +REM Anger kommentarer i satsvise filer.\n\ +REN Gir nytt namn til en eller flere filer.\n\ +RENAME Gir nytt namn til en eller flere filer.\n\ +RMDIR Fjerner en mapp.\n\ +SCREEN Flytter markør.\n\ +SET Vis, sett, eller fjern ReactOS miljøvariabel.\n\ +SHIFT Shift plass for erstattelige parameter i satsvise filer.\n" +STRING_HELP2, "START Start et separat vindu til att kjøre et spesifisert program eller kommando.\n\ + Utfører kommando.\n\ +TIME Vis eller sett system tid.\n\ +TIMER Håndtere stoppeklokker (maks 10 stk).\n\ +TITLE Sett vindustittel for CMD.EXE sesjon.\n\ +TYPE Vis innholdet i en text fil.\n\ +VER Viser ReactOS version.\n\ +VERIFY Forteller ReactOS om att bekrefte om dine filer är skrevet\n\ + riktig til disk.\n\ +VOL Vis et volums namn och serienummer.\n" + + +STRING_CHOICE_OPTION, "YN" +STRING_COPY_OPTION, "YNA" + +STRING_ASSOC_ERROR, "Fil association ble inte funnet for utvidelsen %s\n" +STRING_ALIAS_ERROR, "Kommando linje for lang etter alias utvidelse!\n" +STRING_BATCH_ERROR, "Feil ved åpning av satsvis fil\n" +STRING_CHCP_ERROR1, "Aktiv tegntabell: %u\n" +STRING_CHCP_ERROR4, "Ugyldig tegntabell\n" +STRING_CHOICE_ERROR, "Ugyldig val. Forventet format: /C[:]val" +STRING_CHOICE_ERROR_TXT, "Ugyldig val. Forventet format: /T[:]c,nn" +STRING_CHOICE_ERROR_OPTION, "Ulovlig operasjon: %s" +STRING_MD_ERROR, "En undermapp eller fil finnes allerede.\n" +STRING_MD_ERROR2, "Stien til den nye mappen eksisterer inte.\n" +STRING_CMD_ERROR1, "Kan inte videreføre inndata fra fil %s\n" +STRING_CMD_ERROR2, "Feil under oppretting av temporær fil for datakanal\n" +STRING_CMD_ERROR3, "Kan inte videreføre til fil %s\n" +STRING_CMD_ERROR4, "Kör %s...\n" +STRING_CMD_ERROR5, "Kör cmdexit.bat...\n" +STRING_COLOR_ERROR1, "Samme farge feil! (Bakgrunn och forgrunn kan inte ha samme farge)" +STRING_COLOR_ERROR2, "feil i farge spesifikasjon" +STRING_COLOR_ERROR3, "Farge %x\n" +STRING_COLOR_ERROR4, "samme farge feil!" +STRING_CONSOLE_ERROR, "Ukjent feil: %d\n" +STRING_COPY_ERROR1, "Feil: kan inte åpne kilden - %s!\n" +STRING_COPY_ERROR2, "Feil: kan inte kopiere til seg selv!\n" +STRING_COPY_ERROR3, "Feil ved skriving til destinasjon!\n" +STRING_COPY_ERROR4, "Feil: Inte implementert enda!\n" +STRING_DATE_ERROR, "Ugyldig dato." +STRING_DEL_ERROR5, "Filen %s vil bli slettet! " +STRING_DEL_ERROR6, "Er du sikker (J/N)?" +STRING_DEL_ERROR7, "Sletter: %s\n" +STRING_ERROR_ERROR1, "Ukjent feil! Feilkode: 0x%lx\n" +STRING_ERROR_ERROR2, "Syntaks feil" +STRING_FOR_ERROR1, "'in' tapt i FOR kommando." +STRING_FOR_ERROR2, "ingen brakett funnet." +STRING_FOR_ERROR3, "'gjøre' tapt." +STRING_FOR_ERROR4, "ingen kommando etter 'gjøre'." +STRING_FREE_ERROR1, "Ugyldig driver" +STRING_FREE_ERROR2, "utmerket" +STRING_GOTO_ERROR1, "Ingen merke spesifisert for GÅTIL" +STRING_GOTO_ERROR2, "merke '%s' inte funnet\n" + +STRING_MOVE_ERROR1, "[OK]\n" +STRING_MOVE_ERROR2, "[Feil]\n" + +STRING_REN_ERROR1, "MoveFile() mislykkes. Feil: %lu\n" + +STRING_START_ERROR1, "Ingen satsvis støtte for øyeblikket!" + +STRING_TIME_ERROR1, "Ugyldig tid." + +STRING_TYPE_ERROR1, "Ugyldig alternativ '/%s'\n" + +STRING_WINDOW_ERROR1, "vinduet ble inte funnet" + + +STRING_ERROR_PARAMETERF_ERROR, "Parameter format inte riktig - %c\n" +STRING_ERROR_INVALID_SWITCH, "Ugyldig bryter - /%c\n" +STRING_ERROR_TOO_MANY_PARAMETERS, "For mange parametere - %s\n" +STRING_ERROR_PATH_NOT_FOUND, "Stien ble inte funnet\n" +STRING_ERROR_FILE_NOT_FOUND, "Filen ble inte funnet\n" +STRING_ERROR_REQ_PARAM_MISSING, "Obligatorisk parameter mangler\n" +STRING_ERROR_INVALID_DRIVE, "Ugyldig enhet angitt\n" +STRING_ERROR_INVALID_PARAM_FORMAT, "Ugyldig parameter format - %s\n" +STRING_ERROR_BADCOMMAND, "Feil kommando eller filnamn - %s\n" +STRING_ERROR_OUT_OF_MEMORY, "Feil: Minne fullt.\n" +STRING_ERROR_CANNOTPIPE, "Feil! Kan inte bruke datakanal! Kan inte åpne midlertidig fil!\n" +STRING_ERROR_D_PAUSEMSG, "Tryck valfri tangent för att fortsette . . ." +STRING_ERROR_DRIVER_NOT_READY, "enheten är inte klar" + +STRING_PATH_ERROR, "CMD: Inte i miljøet '%s'\n" + +STRING_REPLACE_ERROR1, "Invalid switch - %s\n" +STRING_REPLACE_ERROR2, "Mappen ble inte funnet - %s\n" +STRING_REPLACE_ERROR3, "The filename, directory name, or volume label syntax is incorrect.\n" +STRING_REPLACE_ERROR4, "Invalid parameter combination\n" +STRING_REPLACE_ERROR5, "Tilgang nektet - %s\n" +STRING_REPLACE_ERROR6, "Ingen filer ble funnet - %s\n" +STRING_REPLACE_ERROR7, "Extended Error 32\n" + +STRING_REACTOS_VERSION, "ReactOS Operativsystem [Versjon %s-%s]\n" +STRING_CMD_SHELLINFO, "\nReactOS Kommandotolk\nVersjon %s %s" +STRING_VERSION_RUNVER, " körs på %s" +STRING_COPY_FILE , " %d file(r) kopiert\n" +STRING_DELETE_WIPE, "slettet" +STRING_FOR_ERROR, "ugyldig variabel spesifikasjon." +STRING_SCREEN_COL, "ugyldig verdi for kolonne" +STRING_SCREEN_ROW, "ugyldig verdi for rad" +STRING_TIMER_TIME "Stoppeklokke %d är %s: " +STRING_MKLINK_CREATED_SYMBOLIC, "Symbolic link created for %s <<===>> %s\n" +STRING_MKLINK_CREATED_HARD, "Hard link created for %s <<===>> %s\n" +STRING_MKLINK_CREATED_JUNCTION, "Junction created for %s <<===>> %s\n" +STRING_MORE, "More? " +STRING_CANCEL_BATCH_FILE, "\r\nCtrl-Break trykket. Avbryt batch filen? (Ja/Nei/Alt) " + +STRING_INVALID_OPERAND, "Ugyldig operand." +STRING_EXPECTED_CLOSE_PAREN, "Forventet ')'." +STRING_EXPECTED_NUMBER_OR_VARIABLE,"Forventet nummer eller variabel namn." +STRING_SYNTAX_COMMAND_INCORRECT, "Syntaks for kommandoen är feil." + +END diff --git a/base/shell/explorer-new/CMakeLists.txt b/base/shell/explorer-new/CMakeLists.txt index cd581cc9b2a..6066f89dc5a 100644 --- a/base/shell/explorer-new/CMakeLists.txt +++ b/base/shell/explorer-new/CMakeLists.txt @@ -38,4 +38,4 @@ add_importlibs(explorer_new kernel32 ntdll) -add_cab_target(explorer_new 4) +add_cd_file(TARGET explorer_new DESTINATION reactos FOR all) diff --git a/base/shell/explorer/CMakeLists.txt b/base/shell/explorer/CMakeLists.txt index 295e5b1305e..6f01f7ee00f 100644 --- a/base/shell/explorer/CMakeLists.txt +++ b/base/shell/explorer/CMakeLists.txt @@ -73,5 +73,5 @@ add_importlibs(explorer advapi32 gdi32 user32 ws2_32 msimg32 comctl32 ole32 olea set_image_base(explorer 0x00400000) add_dependencies(explorer psdk) -add_cab_target(explorer 4) -add_cab(${CMAKE_CURRENT_SOURCE_DIR}/explorer-cfg-template.xml 4) +add_cd_file(TARGET explorer DESTINATION reactos FOR all) +add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/explorer-cfg-template.xml DESTINATION reactos FOR all) diff --git a/base/shell/explorer/desktop/desktop.cpp b/base/shell/explorer/desktop/desktop.cpp index e7787055b8d..4c35f37243b 100644 --- a/base/shell/explorer/desktop/desktop.cpp +++ b/base/shell/explorer/desktop/desktop.cpp @@ -464,11 +464,12 @@ LRESULT DesktopWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) goto def; case WM_SYSCOLORCHANGE: - // redraw background window - InvalidateRect(g_Globals._hwndShellView, NULL, TRUE); + // redraw background window - it's done by system + //InvalidateRect(g_Globals._hwndShellView, NULL, TRUE); - // forward message to shell view window to redraw icon backgrounds - SendMessage(g_Globals._hwndShellView, WM_SYSCOLORCHANGE, wparam, lparam); + // forward message to common controls + SendMessage(g_Globals._hwndShellView, WM_SYSCOLORCHANGE, 0, 0); + SendMessage(_desktopBar, WM_SYSCOLORCHANGE, 0, 0);OutputDebugStringA("WM_SYSCOLORCHANGE desktop\n"); break; default: def: diff --git a/base/shell/explorer/explorer.cpp b/base/shell/explorer/explorer.cpp index f555010f142..4e6aee7fd60 100644 --- a/base/shell/explorer/explorer.cpp +++ b/base/shell/explorer/explorer.cpp @@ -968,7 +968,9 @@ int explorer_main(HINSTANCE hInstance, LPTSTR lpCmdLine, int cmdShow) } #endif - return Window::MessageLoop(); + Window::MessageLoop(); + + return 1; } diff --git a/base/shell/explorer/notifyhook/CMakeLists.txt b/base/shell/explorer/notifyhook/CMakeLists.txt index 4c3bda27a76..b3eda1e7589 100644 --- a/base/shell/explorer/notifyhook/CMakeLists.txt +++ b/base/shell/explorer/notifyhook/CMakeLists.txt @@ -14,4 +14,4 @@ set_module_type(notifyhook win32dll) add_importlibs(notifyhook user32 msvcrt kernel32) add_importlib_target(notifyhook.spec) -add_cab_target(notifyhook 1) +add_cd_file(TARGET notifyhook DESTINATION reactos/system32 FOR all) diff --git a/base/shell/explorer/shell/mainframe.cpp b/base/shell/explorer/shell/mainframe.cpp index d03efbfcd7e..b3cf599b214 100644 --- a/base/shell/explorer/shell/mainframe.cpp +++ b/base/shell/explorer/shell/mainframe.cpp @@ -372,6 +372,11 @@ bool MainFrameBase::ProcessMessage(UINT nmsg, WPARAM wparam, LPARAM lparam, LRES SendMessage(_hstatusbar, SB_SETTEXT, 0, lparam); break; + case WM_SYSCOLORCHANGE: + SendMessage(_hwndrebar, WM_SYSCOLORCHANGE, 0, 0); + SendMessage(_htoolbar, WM_SYSCOLORCHANGE, 0, 0); + break; + default: return false; } @@ -993,6 +998,20 @@ LRESULT MDIMainFrame::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) } return TRUE;} // success + case WM_SYSCOLORCHANGE: { + LRESULT res; + HWND hChild; + + /* Forward WM_SYSCOLORCHANGE to common controls */ + SendMessage(_hextrabar, WM_SYSCOLORCHANGE, 0, 0); + SendMessage(_hdrivebar, WM_SYSCOLORCHANGE, 0, 0); + + for(hChild = GetNextWindow(_hmdiclient,GW_CHILD); hChild; hChild = GetNextWindow(hChild, GW_HWNDNEXT)) + SendMessage(hChild, WM_SYSCOLORCHANGE, 0, 0); + + super::ProcessMessage(nmsg, wparam, lparam, &res); + break; } + default: { LRESULT res; diff --git a/base/shell/explorer/shell/shellbrowser.cpp b/base/shell/explorer/shell/shellbrowser.cpp index 17a23d01b52..44ba3750ff0 100644 --- a/base/shell/explorer/shell/shellbrowser.cpp +++ b/base/shell/explorer/shell/shellbrowser.cpp @@ -701,6 +701,12 @@ LRESULT MDIShellBrowserChild::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) } return TRUE;} + case WM_SYSCOLORCHANGE: + /* Forward WM_SYSCOLORCHANGE to common controls */ + SendMessage(_left_hwnd, WM_SYSCOLORCHANGE, 0, 0); + SendMessage(_right_hwnd, WM_SYSCOLORCHANGE, 0, 0); + break; + default: return super::WndProc(nmsg, wparam, lparam); } diff --git a/base/shell/explorer/taskbar/desktopbar.cpp b/base/shell/explorer/taskbar/desktopbar.cpp index f6988279d65..c52a1671a06 100644 --- a/base/shell/explorer/taskbar/desktopbar.cpp +++ b/base/shell/explorer/taskbar/desktopbar.cpp @@ -345,6 +345,15 @@ LRESULT DesktopBar::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) case PM_GET_NOTIFYAREA: return (LRESULT)(HWND)_hwndNotify; + case WM_SYSCOLORCHANGE:OutputDebugStringA("WM_SYSCOLORCHANGE desktopbar\n"); + /* Forward WM_SYSCOLORCHANGE to common controls */ +#ifndef _NO_REBAR + SendMessage(_hwndrebar, WM_SYSCOLORCHANGE, 0, 0); +#endif + SendMessage(_hwndQuickLaunch, WM_SYSCOLORCHANGE, 0, 0); + SendMessage(_hwndTaskBar, WM_SYSCOLORCHANGE, 0, 0); + break; + default: def: return super::WndProc(nmsg, wparam, lparam); } diff --git a/base/shell/explorer/taskbar/taskbar.cpp b/base/shell/explorer/taskbar/taskbar.cpp index 526c4c12759..d2c5144704d 100644 --- a/base/shell/explorer/taskbar/taskbar.cpp +++ b/base/shell/explorer/taskbar/taskbar.cpp @@ -202,6 +202,10 @@ LRESULT TaskBar::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) case PM_GET_LAST_ACTIVE: return (LRESULT)(HWND)_last_foreground_wnd; + case WM_SYSCOLORCHANGE: + SendMessage(_htoolbar, WM_SYSCOLORCHANGE, 0, 0); + break; + default: def: if (nmsg == WM_SHELLHOOK) { switch(wparam) { diff --git a/base/system/autochk/CMakeLists.txt b/base/system/autochk/CMakeLists.txt index c1846543d46..fe3a4cdc718 100644 --- a/base/system/autochk/CMakeLists.txt +++ b/base/system/autochk/CMakeLists.txt @@ -5,4 +5,4 @@ set_module_type(autochk nativecui) target_link_libraries(autochk mingw_common nt) add_importlibs(autochk kernel32 ntdll) -add_cab_target(autochk 1) +add_cd_file(TARGET autochk DESTINATION reactos/system32 FOR all) diff --git a/base/system/bootok/CMakeLists.txt b/base/system/bootok/CMakeLists.txt index 9d8b1048cf4..e59cd62ce20 100644 --- a/base/system/bootok/CMakeLists.txt +++ b/base/system/bootok/CMakeLists.txt @@ -7,4 +7,4 @@ add_executable(bootok bootok.c bootok.rc) set_module_type(bootok win32cui) add_importlibs(bootok advapi32 msvcrt kernel32 ntdll) -add_cab_target(bootok 1) +add_cd_file(TARGET bootok DESTINATION reactos/system32 FOR all) diff --git a/base/system/expand/CMakeLists.txt b/base/system/expand/CMakeLists.txt index cb393eb585c..d82276adcfc 100644 --- a/base/system/expand/CMakeLists.txt +++ b/base/system/expand/CMakeLists.txt @@ -7,4 +7,4 @@ add_executable(expand expand.c expand.rc) set_module_type(expand win32cui) add_importlibs(expand lz32 setupapi user32 msvcrt kernel32 ntdll) -add_cab_target(expand 1) +add_cd_file(TARGET expand DESTINATION reactos/system32 FOR all) diff --git a/base/system/format/CMakeLists.txt b/base/system/format/CMakeLists.txt index 6b4d2809d40..ba1aa8da7c5 100644 --- a/base/system/format/CMakeLists.txt +++ b/base/system/format/CMakeLists.txt @@ -8,4 +8,4 @@ add_executable(format format.c format.rc) set_module_type(format win32cui) add_importlibs(format user32 fmifs msvcrt kernel32 ntdll) -add_cab_target(format 1) +add_cd_file(TARGET format DESTINATION reactos/system32 FOR all) diff --git a/base/system/lsass/CMakeLists.txt b/base/system/lsass/CMakeLists.txt index 516f416405f..6411aa40460 100644 --- a/base/system/lsass/CMakeLists.txt +++ b/base/system/lsass/CMakeLists.txt @@ -7,4 +7,4 @@ add_executable(lsass lsass.c lsass.rc) set_module_type(lsass win32gui) add_importlibs(lsass advapi32 lsasrv msvcrt kernel32 ntdll) -add_cab_target(lsass 1) +add_cd_file(TARGET lsass DESTINATION reactos/system32 FOR all) diff --git a/base/system/msiexec/CMakeLists.txt b/base/system/msiexec/CMakeLists.txt index c2b6a247671..9e4c2562343 100644 --- a/base/system/msiexec/CMakeLists.txt +++ b/base/system/msiexec/CMakeLists.txt @@ -16,4 +16,4 @@ set_module_type(msiexec win32gui) target_link_libraries(msiexec uuid wine) add_importlibs(msiexec user32 advapi32 ole32 msi msvcrt kernel32 ntdll) -add_cab_target(msiexec 1) +add_cd_file(TARGET msiexec DESTINATION reactos/system32 FOR all) diff --git a/base/system/regsvr32/CMakeLists.txt b/base/system/regsvr32/CMakeLists.txt index e676c20de99..c784511eb63 100644 --- a/base/system/regsvr32/CMakeLists.txt +++ b/base/system/regsvr32/CMakeLists.txt @@ -9,4 +9,4 @@ add_executable(regsvr32 regsvr32.c regsvr32.rc) set_module_type(regsvr32 win32gui) add_importlibs(regsvr32 user32 shell32 ole32 msvcrt kernel32 ntdll) -add_cab_target(regsvr32 1) +add_cd_file(TARGET regsvr32 DESTINATION reactos/system32 FOR all) diff --git a/base/system/rundll32/CMakeLists.txt b/base/system/rundll32/CMakeLists.txt index bb43fc1b9c5..9f7d43f4232 100644 --- a/base/system/rundll32/CMakeLists.txt +++ b/base/system/rundll32/CMakeLists.txt @@ -7,4 +7,4 @@ add_executable(rundll32 rundll32.c rundll32.rc) set_module_type(rundll32 win32gui) add_importlibs(rundll32 user32 msvcrt kernel32 ntdll) -add_cab_target(rundll32 1) +add_cd_file(TARGET rundll32 DESTINATION reactos/system32 FOR all) diff --git a/base/system/runonce/CMakeLists.txt b/base/system/runonce/CMakeLists.txt index 62f759553f8..6fd8005a4ae 100644 --- a/base/system/runonce/CMakeLists.txt +++ b/base/system/runonce/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(runonce runonce.c runonce.rc) set_module_type(runonce win32gui) add_importlibs(runonce advapi32 user32 msvcrt kernel32 ntdll) -add_cab_target(runonce 1) +add_cd_file(TARGET runonce DESTINATION reactos/system32 FOR all) diff --git a/base/system/services/CMakeLists.txt b/base/system/services/CMakeLists.txt index ef34a52d19e..5384849da3c 100644 --- a/base/system/services/CMakeLists.txt +++ b/base/system/services/CMakeLists.txt @@ -24,4 +24,4 @@ add_pch(services ${CMAKE_CURRENT_SOURCE_DIR}/services.h ${SOURCE}) set_module_type(services win32cui) add_importlibs(services user32 advapi32 rpcrt4 msvcrt kernel32 ntdll) -add_cab_target(services 1) +add_cd_file(TARGET services DESTINATION reactos/system32 FOR all) diff --git a/base/system/smss/CMakeLists.txt b/base/system/smss/CMakeLists.txt index 2d9bd19d2e5..b1c77a3b491 100644 --- a/base/system/smss/CMakeLists.txt +++ b/base/system/smss/CMakeLists.txt @@ -35,4 +35,4 @@ add_pch(smss ${CMAKE_CURRENT_SOURCE_DIR}/smss.h ${SOURCE}) set_module_type(smss nativecui) add_importlibs(smss ntdll) -add_cab_target(smss 1) +add_cd_file(TARGET smss DESTINATION reactos/system32 FOR all) diff --git a/base/system/smss/init.c b/base/system/smss/init.c index 6d5bc643994..146a4418cf4 100644 --- a/base/system/smss/init.c +++ b/base/system/smss/init.c @@ -30,10 +30,10 @@ struct { {TRUE, SmInitDosDevices, "create dos device links"}, {TRUE, SmRunBootApplications, "run boot applications"}, {TRUE, SmProcessFileRenameList, "process the file rename list"}, + {FALSE, SmUpdateEnvironment, "update environment variables"}, {FALSE, SmLoadKnownDlls, "preload system DLLs"}, {TRUE, SmCreatePagingFiles, "create paging files"}, {TRUE, SmInitializeRegistry, "initialize the registry"}, - {FALSE, SmUpdateEnvironment, "update environment variables"}, {TRUE, SmInitializeClientManagement, "initialize client management"}, {TRUE, SmLoadSubsystems, "load subsystems"} }; diff --git a/base/system/smss/initenv.c b/base/system/smss/initenv.c index 24ccc3bb5c4..21874e366ff 100644 --- a/base/system/smss/initenv.c +++ b/base/system/smss/initenv.c @@ -227,10 +227,6 @@ SmSetEnvironmentVariables(VOID) goto done; } -done: - NtClose(EnvironmentKey); - - /* Set the 'PROCESSOR_IDENTIFIER' system environment variable */ RtlInitUnicodeString(&Identifier, NULL); RtlInitUnicodeString(&VendorIdentifier, NULL); @@ -251,25 +247,37 @@ done: QueryTable, NULL, NULL); - if (NT_SUCCESS(Status)) + if (!NT_SUCCESS(Status)) { - DPRINT("SM: szIdentifier: %wZ\n", &Identifier); - DPRINT("SM: szVendorIdentifier: %wZ\n", &VendorIdentifier); - - swprintf(Buffer, L"%wZ, %wZ", &Identifier, &VendorIdentifier); - - RtlWriteRegistryValue(RTL_REGISTRY_CONTROL, - L"Session Manager\\Environment", - L"PROCESSOR_IDENTIFIER", - REG_SZ, - Buffer, - (wcslen(Buffer) + 1) * sizeof(WCHAR)); + DPRINT1("SM: Failed to retrieve processor Identifier and/or VendorIdentifier (Status %08lx)", Status); + goto done; } - RtlFreeUnicodeString(&Identifier); - RtlFreeUnicodeString(&VendorIdentifier); + DPRINT("SM: szIdentifier: %wZ\n" , &Identifier); + DPRINT("SM: szVendorIdentifier: %wZ\n", &VendorIdentifier); - return STATUS_SUCCESS; + RtlInitUnicodeString(&VariableName, L"PROCESSOR_IDENTIFIER"); + swprintf(Buffer, L"%wZ, %wZ", &Identifier, &VendorIdentifier); + RtlFreeUnicodeString(&VendorIdentifier); + RtlFreeUnicodeString(&Identifier); + + Status = NtSetValueKey(EnvironmentKey, + &VariableName, + 0, + REG_SZ, + Buffer, + (wcslen(Buffer) + 1) * sizeof(WCHAR)); + if (!NT_SUCCESS(Status)) + { + DPRINT1("SM: Failed to set the PROCESSOR_IDENTIFIER environment variable (Status %08lx)", Status); + goto done; + } + +done: + /* Close the handle */ + NtClose(EnvironmentKey); + + return Status; } @@ -282,6 +290,10 @@ SmUpdateEnvironment(VOID) RTL_QUERY_REGISTRY_TABLE QueryTable[2]; WCHAR ValueBuffer[MAX_PATH]; NTSTATUS Status; +#ifndef NDEBUG + ULONG ii; + PWSTR envp; +#endif /* * The following environment variables must be set prior to reading @@ -317,6 +329,18 @@ SmUpdateEnvironment(VOID) &SmSystemEnvironment, SmSystemEnvironment); +#ifndef NDEBUG + /* Print all environment varaibles */ + ii = 0; + envp = SmSystemEnvironment; + DbgPrint("SmUpdateEnvironment:\n"); + while (*envp) + { + DbgPrint(" %u: %S\n", ii++, envp); + envp += wcslen(envp) + 1; + } +#endif + return Status; } diff --git a/base/system/subst/CMakeLists.txt b/base/system/subst/CMakeLists.txt index fd3997af62f..4319b5e9b34 100644 --- a/base/system/subst/CMakeLists.txt +++ b/base/system/subst/CMakeLists.txt @@ -1,8 +1,11 @@ +include_directories(.) +set_rc_compiler() + add_definitions(-D_DLL -D__USE_CRTIMP) add_executable(subst subst.c subst.rc) set_module_type(subst win32cui) -add_importlibs(subst msvcrt kernel32 ntdll) -add_cab_target(subst 1) +add_importlibs(subst msvcrt kernel32 user32 ntdll) +add_cd_file(TARGET subst DESTINATION reactos/system32 FOR all) diff --git a/base/system/subst/lang/en-US.rc b/base/system/subst/lang/en-US.rc new file mode 100644 index 00000000000..790555b2db2 --- /dev/null +++ b/base/system/subst/lang/en-US.rc @@ -0,0 +1,16 @@ +#include "resource.h" +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +STRINGTABLE +BEGIN + IDS_INCORRECT_PARAMETER_COUNT "Incorrect number of parameters - %s\n" + IDS_INVALID_PARAMETER "Incorrect number of parameters - %s\n" + IDS_INVALID_PARAMETER2 "Invalid parameter - %s\n" + IDS_DRIVE_ALREAD_SUBSTED "Drive already SUBSTed\n" + IDS_FAILED_WITH_ERROCODE "Failed with error code 0x%x: %s\n" + IDS_USAGE "Associates a path with a drive letter.\n\nSUBST [drive1: [drive2:]path]\nSUBST drive1: /D\n\n drive1: \ + Specifies a virtual drive to which you want to assign a path.\n \ + [drive2:]path Specifies a physical drive and path you want to assign to\n \ + a virtual drive.\n /D \ + Deletes a substituted (virtual) drive.\n\nType SUBST with no parameters to display a list of current virtual drives.\n" +END diff --git a/base/system/subst/lang/es-ES.rc b/base/system/subst/lang/es-ES.rc new file mode 100644 index 00000000000..7bbefe47299 --- /dev/null +++ b/base/system/subst/lang/es-ES.rc @@ -0,0 +1,16 @@ +#include "resource.h" +LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL + +STRINGTABLE +BEGIN + IDS_INCORRECT_PARAMETER_COUNT "Cantidad de parámetros incorrecta - %s\n" + IDS_INVALID_PARAMETER "Cantidad de parámetros incorrecta - %s\n" + IDS_INVALID_PARAMETER2 "Parámetro incorrecto - %s\n" + IDS_DRIVE_ALREAD_SUBSTED "Unidad ya sustituida\n" + IDS_FAILED_WITH_ERROCODE "Falla con código de error 0x%x: %s\n" + IDS_USAGE "Asocia una ruta con una letra de unidad.\n\nSUBST [unidad1: [unidad2:]ruta]\nSUBST unidad1: /D\n\n unidad1: \ + Especifica una unidad virtual a la cual se quiere asignar una ruta.\n \ + [unidad2:]ruta Especifica una unidad física y una ruta a la cual asignar\n \ + una unidad virtual.\n /D \ + Elimina una unidad (virtual) substituida.\n\nEscribir SUBST sin parámetros para mostrar una lista de las unidades virtuales actuales.\n" +END diff --git a/base/system/subst/lang/it-IT.rc b/base/system/subst/lang/it-IT.rc new file mode 100644 index 00000000000..5a2c1d3229a --- /dev/null +++ b/base/system/subst/lang/it-IT.rc @@ -0,0 +1,16 @@ +#include "resource.h" +LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL + +STRINGTABLE +BEGIN + IDS_INCORRECT_PARAMETER_COUNT "Numero di parametri errato - %s\n" + IDS_INVALID_PARAMETER "Numero di parametri errato - %s\n" + IDS_INVALID_PARAMETER2 "Parametro errato - %s\n" + IDS_DRIVE_ALREAD_SUBSTED "Unità già sostituita\n" + IDS_FAILED_WITH_ERROCODE "Interruzione con codice di errore 0x%x: %s\n" + IDS_USAGE "Associa un percorso ad una lettera di unità.\n\nSUBST [unità1: [unità2:]percorso]\nSUBST unità1: /D\n\n unità1: \ + Specifica un'unità virtuale alla quale assegnare un percorso.\n \ + [unità2:]percorso Specifica un'unità fisica e un percorso da assegnare ad una\n \ + unità virtuale.\n /D \ + Elimina un'unità (virtuale) sostituita.\n\nDigitare SUBST senza parametri per mostrare un elenco delle unità virtuali attuali.\n" +END diff --git a/base/system/subst/resource.h b/base/system/subst/resource.h new file mode 100644 index 00000000000..9baa5b31a61 --- /dev/null +++ b/base/system/subst/resource.h @@ -0,0 +1,11 @@ +#define RC_STRING_MAX_SIZE 2048 + +/* Strings */ +#define IDS_FAILED_WITH_ERROCODE 1001 +#define IDS_USAGE 1002 +#define IDS_INCORRECT_PARAMETER_COUNT 1003 +#define IDS_INVALID_PARAMETER 1004 +#define IDS_INVALID_PARAMETER2 1005 +#define IDS_DRIVE_ALREAD_SUBSTED 1006 + +/* EOF */ diff --git a/base/system/subst/rsrc.rc b/base/system/subst/rsrc.rc new file mode 100644 index 00000000000..f50bcd93ef0 --- /dev/null +++ b/base/system/subst/rsrc.rc @@ -0,0 +1,8 @@ +#include +#include "resource.h" + +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL + +#include "lang/en-US.rc" +#include "lang/es-ES.rc" +#include "lang/it-IT.rc" diff --git a/base/system/subst/subst.c b/base/system/subst/subst.c index 7cb92563eb8..3bfad0cae3e 100644 --- a/base/system/subst/subst.c +++ b/base/system/subst/subst.c @@ -14,11 +14,13 @@ #include #define NDEBUG #include +#include "resource.h" /* FUNCTIONS ****************************************************************/ void PrintError(DWORD ErrCode) { + TCHAR szFmtString[RC_STRING_MAX_SIZE] = {0}; TCHAR *buffer = (TCHAR*) calloc(2048, sizeof(TCHAR)); TCHAR *msg = NULL; @@ -32,9 +34,13 @@ void PrintError(DWORD ErrCode) (TCHAR*)&msg, 0, NULL); + LoadString(GetModuleHandle(NULL), + IDS_FAILED_WITH_ERROCODE, + szFmtString, + sizeof(szFmtString) / sizeof(szFmtString[0])); _sntprintf(buffer, 2048, - _T("Failed with error code 0x%x: %s\n"), + szFmtString, ErrCode, msg); _tprintf(_T("%s"), @@ -45,16 +51,15 @@ void PrintError(DWORD ErrCode) } } -void DisplaySubstUsage() +void DisplaySubstUsage(void) { - _tprintf(_T("Associates a path with a drive letter.\n\n")); - _tprintf(_T("SUBST [drive1: [drive2:]path]\n")); - _tprintf(_T("SUBST drive1: /D\n\n")); - _tprintf(_T(" drive1: Specifies a virtual drive to which you want to assign a path.\n")); - _tprintf(_T(" [drive2:]path Specifies a physical drive and path you want to assign to\n")); - _tprintf(_T(" a virtual drive.\n")); - _tprintf(_T(" /D Deletes a substituted (virtual) drive.\n\n")); - _tprintf(_T("Type SUBST with no parameters to display a list of current virtual drives.\n")); + TCHAR szHelp[RC_STRING_MAX_SIZE] = {0}; + + LoadString(GetModuleHandle(NULL), + IDS_USAGE, + szHelp, + sizeof(szHelp) / sizeof(szHelp[0])); + _tprintf(_T("%s"), szHelp); } BOOLEAN IsSubstedDrive(TCHAR *Drive) @@ -103,7 +108,7 @@ BOOLEAN IsSubstedDrive(TCHAR *Drive) return Result; } -void DumpSubstedDrives() +void DumpSubstedDrives(void) { TCHAR Drive[3] = _T("A:"); LPTSTR lpTargetPath = NULL; @@ -161,17 +166,23 @@ void DumpSubstedDrives() int DeleteSubst(TCHAR* Drive) { BOOL Result; + TCHAR szFmtString[RC_STRING_MAX_SIZE] = {0}; + + LoadString(GetModuleHandle(NULL), + IDS_INVALID_PARAMETER2, + szFmtString, + sizeof(szFmtString) / sizeof(szFmtString[0])); if (_tcslen(Drive) > 2) { - _tprintf(_T("Invalid parameter - %s\n"), + _tprintf(szFmtString, Drive); return 1; } if (! IsSubstedDrive(Drive)) { - _tprintf(_T("Invalid Parameter - %s\n"), + _tprintf(szFmtString, Drive); return 1; } @@ -190,17 +201,33 @@ int DeleteSubst(TCHAR* Drive) int AddSubst(TCHAR* Drive, TCHAR *Path) { BOOL Result; + TCHAR szFmtString[RC_STRING_MAX_SIZE] = {0}; - if (_tcslen(Drive) > 2) + LoadString(GetModuleHandle(NULL), + IDS_INVALID_PARAMETER2, + szFmtString, + sizeof(szFmtString) / sizeof(szFmtString[0])); + if (_tcslen(Drive) != 2) { - _tprintf(_T("Invalid parameter - %s\n"), + _tprintf(szFmtString, + Drive); + return 1; + } + + if (Drive[1] != _T(':')) + { + _tprintf(szFmtString, Drive); return 1; } if (IsSubstedDrive(Drive)) { - _tprintf(_T("Drive already SUBSTed\n")); + LoadString(GetModuleHandle(NULL), + IDS_DRIVE_ALREAD_SUBSTED, + szFmtString, + sizeof(szFmtString) / sizeof(szFmtString[0])); + _tprintf(szFmtString); return 1; } @@ -218,6 +245,7 @@ int AddSubst(TCHAR* Drive, TCHAR *Path) int _tmain(int argc, TCHAR* argv[]) { INT i; + TCHAR szFmtString[RC_STRING_MAX_SIZE] = {0}; for (i = 0; i < argc; i++) { @@ -232,7 +260,11 @@ int _tmain(int argc, TCHAR* argv[]) { if (argc >= 2) { - _tprintf(_T("Invalid parameter - %s\n"), + LoadString(GetModuleHandle(NULL), + IDS_INVALID_PARAMETER, + szFmtString, + sizeof(szFmtString) / sizeof(szFmtString[0])); + _tprintf(szFmtString, argv[1]); return 1; } @@ -242,7 +274,11 @@ int _tmain(int argc, TCHAR* argv[]) if (argc > 3) { - _tprintf(_T("Incorrect number of parameters - %s\n"), + LoadString(GetModuleHandle(NULL), + IDS_INCORRECT_PARAMETER_COUNT, + szFmtString, + sizeof(szFmtString) / sizeof(szFmtString[0])); + _tprintf(szFmtString, argv[3]); return 1; } diff --git a/base/system/subst/subst.rbuild b/base/system/subst/subst.rbuild index fe93acb95e1..8b77abd857d 100644 --- a/base/system/subst/subst.rbuild +++ b/base/system/subst/subst.rbuild @@ -1,9 +1,10 @@ - + include/reactos/wine . kernel32 + user32 subst.c subst.rc diff --git a/base/system/subst/subst.rc b/base/system/subst/subst.rc index b81ea2c6a7b..db0df66fd9d 100644 --- a/base/system/subst/subst.rc +++ b/base/system/subst/subst.rc @@ -3,3 +3,5 @@ #define REACTOS_STR_INTERNAL_NAME "subst\0" #define REACTOS_STR_ORIGINAL_FILENAME "subst.exe\0" #include + +#include "rsrc.rc" diff --git a/base/system/userinit/CMakeLists.txt b/base/system/userinit/CMakeLists.txt index 66bd8f9a30f..e2089b75e34 100644 --- a/base/system/userinit/CMakeLists.txt +++ b/base/system/userinit/CMakeLists.txt @@ -9,4 +9,4 @@ target_link_libraries(userinit wine) set_module_type(userinit win32gui) add_importlibs(userinit user32 gdi32 advapi32 shell32 shlwapi msvcrt kernel32 ntdll) -add_cab_target(userinit 1) +add_cd_file(TARGET userinit DESTINATION reactos/system32 FOR all) diff --git a/base/system/winlogon/CMakeLists.txt b/base/system/winlogon/CMakeLists.txt index b411d0dad49..945de9935fa 100644 --- a/base/system/winlogon/CMakeLists.txt +++ b/base/system/winlogon/CMakeLists.txt @@ -16,4 +16,4 @@ add_pch(winlogon ${CMAKE_CURRENT_SOURCE_DIR}/winlogon.h ${SOURCE}) set_module_type(winlogon win32gui) add_importlibs(winlogon user32 advapi32 userenv secur32 msvcrt kernel32 ntdll) -add_cab_target(winlogon 1) +add_cd_file(TARGET winlogon DESTINATION reactos/system32 FOR all) diff --git a/base/system/winlogon/rsrc.rc b/base/system/winlogon/rsrc.rc index fdfc56db8ab..a0215dea7a9 100644 --- a/base/system/winlogon/rsrc.rc +++ b/base/system/winlogon/rsrc.rc @@ -15,7 +15,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL #include "lang/hu-HU.rc" #include "lang/id-ID.rc" #include "lang/it-IT.rc" -//#include "lang/ja-JP.rc" FIXME: iconv issue +#include "lang/ja-JP.rc" #include "lang/lt-LT.rc" #include "lang/no-NO.rc" #include "lang/nl-NL.rc" diff --git a/base/system/winlogon/sas.c b/base/system/winlogon/sas.c index d394439b191..11035c16d4e 100644 --- a/base/system/winlogon/sas.c +++ b/base/system/winlogon/sas.c @@ -55,6 +55,37 @@ StartTaskManager( return ret; } +static BOOL +StartUserShell( + IN OUT PWLSESSION Session) +{ + LPVOID lpEnvironment = NULL; + BOOLEAN Old; + BOOL ret; + + /* Create environment block for the user */ + if (!CreateEnvironmentBlock(&lpEnvironment, Session->UserToken, TRUE)) + { + WARN("WL: CreateEnvironmentBlock() failed\n"); + return FALSE; + } + + /* Get privilege */ + /* FIXME: who should do it? winlogon or gina? */ + /* FIXME: reverting to lower privileges after creating user shell? */ + RtlAdjustPrivilege(SE_ASSIGNPRIMARYTOKEN_PRIVILEGE, TRUE, FALSE, &Old); + + ret = Session->Gina.Functions.WlxActivateUserShell( + Session->Gina.Context, + L"Default", + NULL, /* FIXME */ + lpEnvironment); + + DestroyEnvironmentBlock(lpEnvironment); + return ret; +} + + BOOL SetDefaultLanguage( IN BOOL UserProfile) @@ -167,8 +198,6 @@ HandleLogon( IN OUT PWLSESSION Session) { PROFILEINFOW ProfileInfo; - LPVOID lpEnvironment = NULL; - BOOLEAN Old; BOOL ret = FALSE; /* Loading personal settings */ @@ -211,13 +240,6 @@ HandleLogon( goto cleanup; } - /* Create environment block for the user */ - if (!CreateEnvironmentBlock(&lpEnvironment, Session->UserToken, TRUE)) - { - WARN("WL: CreateEnvironmentBlock() failed\n"); - goto cleanup; - } - DisplayStatusMessage(Session, Session->WinlogonDesktop, IDS_APPLYINGYOURPERSONALSETTINGS); UpdatePerUserSystemParameters(0, TRUE); @@ -228,16 +250,7 @@ HandleLogon( goto cleanup; } - /* Get privilege */ - /* FIXME: who should do it? winlogon or gina? */ - /* FIXME: reverting to lower privileges after creating user shell? */ - RtlAdjustPrivilege(SE_ASSIGNPRIMARYTOKEN_PRIVILEGE, TRUE, FALSE, &Old); - - if (!Session->Gina.Functions.WlxActivateUserShell( - Session->Gina.Context, - L"Default", - NULL, /* FIXME */ - lpEnvironment)) + if (!StartUserShell(Session)) { //WCHAR StatusMsg[256]; WARN("WL: WlxActivateUserShell() failed\n"); @@ -264,8 +277,6 @@ cleanup: { UnloadUserProfile(WLSession->UserToken, ProfileInfo.hProfile); } - if (lpEnvironment) - DestroyEnvironmentBlock(lpEnvironment); RemoveStatusMessage(Session); if (!ret) { @@ -942,12 +953,30 @@ SASWindowProc( { return HandleMessageBeep(lParam); } + case LN_SHELL_EXITED: + { + /* lParam is the exit code */ + if(lParam != 1) + { + SetTimer(hwndDlg, 1, 1000, NULL); + } + break; + } default: { ERR("WM_LOGONNOTIFY case %d is unimplemented\n", wParam); } } return 0; + } + case WM_TIMER: + { + if (wParam == 1) + { + KillTimer(hwndDlg, 1); + StartUserShell(Session); + } + break; } case WLX_WM_SAS: { diff --git a/boot/CMakeLists.txt b/boot/CMakeLists.txt index d19e3f138d4..3ab10be6768 100644 --- a/boot/CMakeLists.txt +++ b/boot/CMakeLists.txt @@ -1,28 +1,37 @@ +##bootcd +#clear it out +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/bootcd.cmake + "file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bootcd)\n") + +add_custom_target(bootcd + ${CMAKE_COMMAND} -D CD_DIR=${CMAKE_CURRENT_BINARY_DIR}/bootcd + -P ${CMAKE_CURRENT_BINARY_DIR}/bootcd.cmake + COMMAND native-cdmake -v -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/freeldr/bootsect/isoboot.bin ${CMAKE_CURRENT_BINARY_DIR}/bootcd REACTOS ${REACTOS_BINARY_DIR}/bootcd.iso + VERBATIM) + +##livecd +#clear it out +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake + "file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/livecd)\n") +#create profiles directories too +file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake + "file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/livecd/Profiles)\n") +file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake + "file(MAKE_DIRECTORY \"${CMAKE_CURRENT_BINARY_DIR}/livecd/Profiles/All Users\")\n") +file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake + "file(MAKE_DIRECTORY \"${CMAKE_CURRENT_BINARY_DIR}/livecd/Profiles/All Users/Desktop\")\n") +file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake + "file(MAKE_DIRECTORY \"${CMAKE_CURRENT_BINARY_DIR}/livecd/Profiles/Default User\")\n") +file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake + "file(MAKE_DIRECTORY \"${CMAKE_CURRENT_BINARY_DIR}/livecd/Profiles/Default User/Desktop\")\n") +file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake + "file(MAKE_DIRECTORY \"${CMAKE_CURRENT_BINARY_DIR}/livecd/Profiles/Default User/My Documents\")\n") + +add_custom_target(livecd + ${CMAKE_COMMAND} -D CD_DIR=${CMAKE_CURRENT_BINARY_DIR}/livecd + -P ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake + COMMAND native-cdmake -v -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/freeldr/bootsect/isoboot.bin ${CMAKE_CURRENT_BINARY_DIR}/livecd REACTOS ${REACTOS_BINARY_DIR}/livecd.iso + VERBATIM) add_subdirectory(freeldr) - -add_minicd(${CMAKE_CURRENT_SOURCE_DIR}/bootdata/txtsetup.sif reactos txtsetup.sif) -add_minicd(${CMAKE_CURRENT_SOURCE_DIR}/bootdata/bootcd.ini "" freeldr.ini) -add_minicd(${CMAKE_CURRENT_SOURCE_DIR}/bootdata/hivecls_${ARCH}.inf reactos hivecls.inf) -add_minicd(${CMAKE_CURRENT_SOURCE_DIR}/bootdata/hivedef_${ARCH}.inf reactos hivedef.inf) -add_minicd(${CMAKE_CURRENT_SOURCE_DIR}/bootdata/hivesft_${ARCH}.inf reactos hivesft.inf) -add_minicd(${CMAKE_CURRENT_SOURCE_DIR}/bootdata/hivesys_${ARCH}.inf reactos hivesys.inf) -add_minicd(${CMAKE_CURRENT_SOURCE_DIR}/bootdata/autorun.inf "" autorun.inf) -add_minicd(${CMAKE_CURRENT_SOURCE_DIR}/bootdata/icon.ico "" icon.ico) -add_minicd(${CMAKE_CURRENT_SOURCE_DIR}/bootdata/readme.txt "" readme.txt) -# Livecd files -list(APPEND LIVECD_HIVES - ${CMAKE_CURRENT_SOURCE_DIR}/bootdata/livecd.inf - ${CMAKE_CURRENT_SOURCE_DIR}/bootdata/hiveinst_${ARCH}.inf) - -add_custom_command( - OUTPUT ${LIVECD_DIR}/reactos/system32/config/sam - COMMAND native-mkhive ${CMAKE_CURRENT_SOURCE_DIR}/bootdata ${LIVECD_DIR}/reactos/system32/config ${ARCH} ${LIVECD_HIVES} - DEPENDS native-mkhive) - -add_custom_target(livecd_hives DEPENDS ${LIVECD_DIR}/reactos/system32/config/sam) - -add_livecd(${REACTOS_SOURCE_DIR}/boot/bootdata/livecd.ini "" freeldr.ini) - -#regtest -add_cab(${REACTOS_SOURCE_DIR}/boot/bootdata/bootcdregtest/regtest.cmd 7) +add_subdirectory(bootdata) diff --git a/boot/bootdata/CMakeLists.txt b/boot/bootdata/CMakeLists.txt new file mode 100644 index 00000000000..edf577bdccb --- /dev/null +++ b/boot/bootdata/CMakeLists.txt @@ -0,0 +1,47 @@ + +add_subdirectory(packages) + +add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/txtsetup.sif DESTINATION reactos NO_CAB FOR bootcd) +add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/hivecls_${ARCH}.inf DESTINATION reactos NO_CAB NAME_ON_CD hivecls.inf FOR bootcd) +add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/hivedef_${ARCH}.inf DESTINATION reactos NO_CAB NAME_ON_CD hivedef.inf FOR bootcd) +add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/hivesft_${ARCH}.inf DESTINATION reactos NO_CAB NAME_ON_CD hivesft.inf FOR bootcd) +add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/hivesys_${ARCH}.inf DESTINATION reactos NO_CAB NAME_ON_CD hivesys.inf FOR bootcd) + +# livecd hives +list(APPEND CD_HIVES + ${CMAKE_CURRENT_SOURCE_DIR}/livecd.inf + ${CMAKE_CURRENT_SOURCE_DIR}/hiveinst_${ARCH}.inf) + +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sam + ${CMAKE_CURRENT_BINARY_DIR}/default + ${CMAKE_CURRENT_BINARY_DIR}/security + ${CMAKE_CURRENT_BINARY_DIR}/software + ${CMAKE_CURRENT_BINARY_DIR}/system + COMMAND native-mkhive ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${ARCH} ${CD_HIVES} + DEPENDS native-mkhive ${CD_HIVES}) + +add_custom_target(livecd_hives + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/sam + ${CMAKE_CURRENT_BINARY_DIR}/default + ${CMAKE_CURRENT_BINARY_DIR}/security + ${CMAKE_CURRENT_BINARY_DIR}/software + ${CMAKE_CURRENT_BINARY_DIR}/system) + +add_cd_file( + FILE ${CMAKE_CURRENT_BINARY_DIR}/sam + ${CMAKE_CURRENT_BINARY_DIR}/default + ${CMAKE_CURRENT_BINARY_DIR}/security + ${CMAKE_CURRENT_BINARY_DIR}/software + ${CMAKE_CURRENT_BINARY_DIR}/system + TARGET livecd_hives + DESTINATION reactos/system32/config + FOR livecd) + +#regtest +add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/bootcdregtest/regtest.cmd DESTINATION reactos/bin FOR all) + +#freeldr.ini +add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/bootcd.ini DESTINATION root NO_CAB NAME_ON_CD freeldr.ini FOR bootcd) +add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/livecd.ini DESTINATION root NAME_ON_CD freeldr.ini FOR livecd) + diff --git a/boot/bootdata/hivesys_i386.inf b/boot/bootdata/hivesys_i386.inf index a5d1e4264cc..3561a0d9bff 100644 --- a/boot/bootdata/hivesys_i386.inf +++ b/boot/bootdata/hivesys_i386.inf @@ -1148,10 +1148,14 @@ HKLM,"SYSTEM\CurrentControlSet\Services\EventLog","Type",0x00010001,0x00000010 HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\Application",,0x00000010 HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\Application","File",0x00020000,"%SystemRoot%\system32\config\AppEvent.Evt" +HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\Application\Service Control Manager","EventMessageFile",0x00020000,"%SystemRoot%\system32\netevent.dll" +HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\Application\Service Control Manager","TypesSupported",0x00010001,0x00000007 HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\Security",,0x00000010 HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\Security","File",0x00020000,"%SystemRoot%\system32\config\SecEvent.Evt" HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\System",,0x00000010 HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\System","File",0x00020000,"%SystemRoot%\system32\config\SysEvent.Evt" +HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\System\EventLog","EventMessageFile",0x00020000,"%SystemRoot%\system32\netevent.dll" +HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\System\EventLog","TypesSupported",0x00010001,0x00000007 ; Floppy driver HKLM,"SYSTEM\CurrentControlSet\Services\Floppy","ErrorControl",0x00010001,0x00000000 diff --git a/boot/bootdata/packages/CMakeLists.txt b/boot/bootdata/packages/CMakeLists.txt new file mode 100644 index 00000000000..9f0ca7eac9a --- /dev/null +++ b/boot/bootdata/packages/CMakeLists.txt @@ -0,0 +1,45 @@ +#reactos.dff + +# reactos.dff is the concatenation of two files : +# - reactos.dff.in, which is a static one and can be altered to +# add custom modules/files to reactos.cab +# - reactos.dff.dyn (dyn as dynamic) which is generated at configure time by our cmake scripts +# If you want to slip-stream anything into the bootcd, then you want to alter reactos.dff.in + +# Idea taken from there : http://www.cmake.org/pipermail/cmake/2010-July/038028.html +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/concat.cmake " + file(READ \${SRC1} S1) + file(READ \${SRC2} S2) + file(WRITE \${DST} \"\${S1}\${S2}\") +") + +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff.dyn "") + +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff + COMMAND ${CMAKE_COMMAND} -D SRC1=${CMAKE_CURRENT_SOURCE_DIR}/reactos.dff.in + -D SRC2=${CMAKE_CURRENT_BINARY_DIR}/reactos.dff.dyn + -D DST=${CMAKE_CURRENT_BINARY_DIR}/reactos.dff + -P ${CMAKE_CURRENT_BINARY_DIR}/concat.cmake + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/reactos.dff.in + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff.dyn +) + +# And now we build reactos.cab +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf + COMMAND native-cabman -C ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff -L ${CMAKE_CURRENT_BINARY_DIR} -I -P ${REACTOS_SOURCE_DIR} + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff +) +# add_custom_command( + # OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/reactos.cab + # COMMAND native-cabman -C ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff -RC ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf -L ${CMAKE_CURRENT_BINARY_DIR} -N -P ${REACTOS_SOURCE_DIR} + # DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf +# ) + +add_custom_target(reactos_cab + native-cabman -C ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff -RC ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf -L ${CMAKE_CURRENT_BINARY_DIR} -N -P ${REACTOS_SOURCE_DIR} + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf + VERBATIM) + +add_cd_file(TARGET reactos_cab FILE ${CMAKE_CURRENT_BINARY_DIR}/reactos.cab ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf DESTINATION reactos NO_CAB FOR bootcd) diff --git a/boot/bootdata/packages/reactos.dff.in b/boot/bootdata/packages/reactos.dff.in index b5789d1ef85..cb44b08862a 100644 --- a/boot/bootdata/packages/reactos.dff.in +++ b/boot/bootdata/packages/reactos.dff.in @@ -1,3 +1,4 @@ + ; Main ReactOS package .Set DiskLabelTemplate="ReactOS" ; Label of disk diff --git a/boot/bootdata/txtsetup.sif b/boot/bootdata/txtsetup.sif index fb0937edbb2..183ee5b1089 100644 --- a/boot/bootdata/txtsetup.sif +++ b/boot/bootdata/txtsetup.sif @@ -39,7 +39,13 @@ pci.sys=,,,,,,,,,,,,4 scsiport.sys=,,,,,,x,,,,,,4 fastfat.sys=,,,,,,x,,,,,,4 ramdisk.sys=,,,,,,x,,,,,,4 -ext2.sys=,,,,,,x,,,,,,4 +ext2fs.sys=,,,,,,x,,,,,,4 +vgafonts.cab=,,,,,,,,,,,,1 +classpnp.sys=,,,,,,,,,,,,4 +pcix.sys=,,,,,,,,,,,,4 +pcmcia.sys=,,,,,,,,,,,,4 +swenum.sys=,,,,,,,,,,,,4 +ntdll.dll=,,,,,,,,,,,,2 [HardwareIdsDatabase] ;*PNP0A00 = isapnp diff --git a/boot/freeldr/bootsect/CMakeLists.txt b/boot/freeldr/bootsect/CMakeLists.txt index 2ef8f3aaffa..406799a62bf 100644 --- a/boot/freeldr/bootsect/CMakeLists.txt +++ b/boot/freeldr/bootsect/CMakeLists.txt @@ -4,4 +4,11 @@ CreateBootSectorTarget(ext2 ${CMAKE_CURRENT_SOURCE_DIR}/ext2.asm ${CMAKE_CURRENT CreateBootSectorTarget(fat32 ${CMAKE_CURRENT_SOURCE_DIR}/fat32.asm ${CMAKE_CURRENT_BINARY_DIR}/fat32.bin) CreateBootSectorTarget(fat ${CMAKE_CURRENT_SOURCE_DIR}/fat.asm ${CMAKE_CURRENT_BINARY_DIR}/fat.bin) CreateBootSectorTarget(isoboot ${CMAKE_CURRENT_SOURCE_DIR}/isoboot.asm ${CMAKE_CURRENT_BINARY_DIR}/isoboot.bin) -CreateBootSectorTarget(isobtrt ${CMAKE_CURRENT_SOURCE_DIR}/isobtrt.asm ${CMAKE_CURRENT_BINARY_DIR}/isobtrt.bin) \ No newline at end of file +CreateBootSectorTarget(isobtrt ${CMAKE_CURRENT_SOURCE_DIR}/isobtrt.asm ${CMAKE_CURRENT_BINARY_DIR}/isobtrt.bin) + +add_cd_file(TARGET dosmbr DESTINATION loader NO_CAB FILE ${CMAKE_CURRENT_BINARY_DIR}/dosmbr.bin FOR all) +add_cd_file(TARGET ext2 DESTINATION loader NO_CAB FILE ${CMAKE_CURRENT_BINARY_DIR}/ext2.bin FOR all) +add_cd_file(TARGET fat32 DESTINATION loader NO_CAB FILE ${CMAKE_CURRENT_BINARY_DIR}/fat32.bin FOR all) +add_cd_file(TARGET fat DESTINATION loader NO_CAB FILE ${CMAKE_CURRENT_BINARY_DIR}/fat.bin FOR all) +add_cd_file(TARGET isoboot DESTINATION loader NO_CAB FILE ${CMAKE_CURRENT_BINARY_DIR}/isoboot.bin FOR all) +add_cd_file(TARGET isobtrt DESTINATION loader NO_CAB FILE ${CMAKE_CURRENT_BINARY_DIR}/isobtrt.bin FOR all) \ No newline at end of file diff --git a/boot/freeldr/freeldr/CMakeLists.txt b/boot/freeldr/freeldr/CMakeLists.txt index 46db35cf98a..a231c69e032 100644 --- a/boot/freeldr/freeldr/CMakeLists.txt +++ b/boot/freeldr/freeldr/CMakeLists.txt @@ -31,6 +31,7 @@ if(ARCH MATCHES i386) arch/i386/i386cpu.S arch/i386/i386idt.S arch/i386/i386pnp.S + arch/i386/i386pxe.S arch/i386/i386trap.S arch/i386/int386.S arch/i386/linux.S @@ -65,6 +66,7 @@ list(APPEND FREELDR_BASE_SOURCE fs/fs.c fs/iso.c fs/ntfs.c + fs/pxe.c inifile/ini_init.c inifile/inifile.c inifile/parse.c @@ -152,6 +154,7 @@ endif() set_source_files_properties(${FREELDR_ARCH_SOURCE} PROPERTIES COMPILE_DEFINITIONS "_NTHAL_;_BLDR_;_NTSYSTEM_") add_library(freeldr_arch ${FREELDR_ARCH_SOURCE}) +add_dependencies(freeldr_arch bugcodes) list(APPEND FREELDR_SOURCE bootmgr.c @@ -190,6 +193,8 @@ target_link_libraries(freeldr add_pch(freeldr ${CMAKE_CURRENT_SOURCE_DIR}/include/freeldr.h ${FREELDR_SOURCE}) add_dependencies(freeldr asm) +add_cd_file(TARGET freeldr DESTINATION loader NO_CAB FOR all) + list(APPEND SETUPLDR_MAIN_SOURCE bootmgr.c inffile/inffile.c @@ -235,7 +240,5 @@ target_link_libraries(setupldr add_dependencies(setupldr asm) -# Bootcd files -add_minicd_target(setupldr loader setupldr.sys) -add_minicd_target(freeldr loader freeldr.sys) -add_livecd_target(setupldr loader) +add_cd_file(TARGET setupldr DESTINATION loader NO_CAB FOR all) + diff --git a/boot/freeldr/freeldr/arch/i386/i386pxe.S b/boot/freeldr/freeldr/arch/i386/i386pxe.S new file mode 100644 index 00000000000..71442135f36 --- /dev/null +++ b/boot/freeldr/freeldr/arch/i386/i386pxe.S @@ -0,0 +1,97 @@ +/* + * FreeLoader + * Copyright (C) 2011 Hervé Poussineau + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + .text + .code16 + +#define ASM + +#include + +/* + * U16 PxeCallApi(U16 Segment, U16 Offset, U16 Service, VOID *Parameter); + * + * RETURNS: + */ +_pxe_function: + .word 0 +_pxe_entry_point: + .long 0 +_pxe_buffer_segment: + .word 0 +_pxe_buffer_offset: + .word 0 +_pxe_result: + .word 0 + +EXTERN(_PxeCallApi) + .code32 + pushl %ebp + movl %esp,%ebp + + pushal + push %es + + /* copy entry point */ + movl 0x08(%ebp),%eax + shll $16,%eax + movw 0x0C(%ebp),%ax + movl %eax,_pxe_entry_point + + /* copy function */ + movw 0x10(%ebp),%ax + movw %ax,_pxe_function + + /* convert pointer to data buffer to segment/offset */ + movl 0x14(%ebp),%eax + shrl $4,%eax + andl $0xf000,%eax + movw %ax,_pxe_buffer_segment + movl 0x14(%ebp),%eax + andl $0xffff,%eax + movw %ax,_pxe_buffer_offset + + call switch_to_real + .code16 + + movw _pxe_buffer_segment,%ax + push %ax + movw _pxe_buffer_offset,%ax + push %ax + movw _pxe_function,%ax + push %ax + lcall *_pxe_entry_point + addw $6,%sp + movw %ax,_pxe_result + + call switch_to_prot + .code32 + + pop %es + popal + + movl %ebp,%esp + popl %ebp + + movw _pxe_result,%ax + + ret + +/* EOF */ + diff --git a/boot/freeldr/freeldr/arch/i386/machpc.c b/boot/freeldr/freeldr/arch/i386/machpc.c index 879e2029d6e..c585c97932d 100644 --- a/boot/freeldr/freeldr/arch/i386/machpc.c +++ b/boot/freeldr/freeldr/arch/i386/machpc.c @@ -43,7 +43,7 @@ PcMachInit(const char *CmdLine) MachVtbl.Beep = PcBeep; MachVtbl.PrepareForReactOS = PcPrepareForReactOS; MachVtbl.GetMemoryMap = PcMemGetMemoryMap; - MachVtbl.DiskGetBootPath = DiskGetBootPath; + MachVtbl.DiskGetBootPath = PcDiskGetBootPath; MachVtbl.DiskReadLogicalSectors = PcDiskReadLogicalSectors; MachVtbl.DiskGetDriveGeometry = PcDiskGetDriveGeometry; MachVtbl.DiskGetCacheableBlockCount = PcDiskGetCacheableBlockCount; diff --git a/boot/freeldr/freeldr/arch/i386/pcdisk.c b/boot/freeldr/freeldr/arch/i386/pcdisk.c index 304a8670107..4bde50c5839 100644 --- a/boot/freeldr/freeldr/arch/i386/pcdisk.c +++ b/boot/freeldr/freeldr/arch/i386/pcdisk.c @@ -367,4 +367,15 @@ PcDiskGetCacheableBlockCount(ULONG DriveNumber) } } +BOOLEAN +PcDiskGetBootPath(char *BootPath, unsigned Size) +{ + if (PxeInit()) + { + strcpy(BootPath, "net(0)"); + return 0; + } + return DiskGetBootPath(BootPath, Size); +} + /* EOF */ diff --git a/boot/freeldr/freeldr/disk/ramdisk.c b/boot/freeldr/freeldr/disk/ramdisk.c index fadf34182c3..19eaa78aff8 100644 --- a/boot/freeldr/freeldr/disk/ramdisk.c +++ b/boot/freeldr/freeldr/disk/ramdisk.c @@ -164,8 +164,11 @@ RamDiskLoadVirtualFile(IN PCHAR FileName) // Allocate memory for it // ChunkSize = 8 * 1024 * 1024; - Percent = PercentPerChunk = 100 / (gRamDiskSize / ChunkSize); - gRamDiskBase = MmAllocateMemory(gRamDiskSize); + if (gRamDiskSize < ChunkSize) + Percent = PercentPerChunk = 0; + else + Percent = PercentPerChunk = 100 / (gRamDiskSize / ChunkSize); + gRamDiskBase = MmAllocateMemoryWithType(gRamDiskSize, LoaderXIPRom); if (!gRamDiskBase) { UiMessageBox("Failed to allocate memory for RAM disk\n"); diff --git a/boot/freeldr/freeldr/fs/fs.c b/boot/freeldr/freeldr/fs/fs.c index eb23215f789..13ecf5ce38d 100644 --- a/boot/freeldr/freeldr/fs/fs.c +++ b/boot/freeldr/freeldr/fs/fs.c @@ -338,6 +338,10 @@ LONG ArcOpen(CHAR* Path, OPENMODE OpenMode, ULONG* FileId) FileData[DeviceId].FileFuncTable = NtfsMount(DeviceId); if (!FileData[DeviceId].FileFuncTable) FileData[DeviceId].FileFuncTable = Ext2Mount(DeviceId); +#endif +#ifdef _M_IX86 + if (!FileData[DeviceId].FileFuncTable) + FileData[DeviceId].FileFuncTable = PxeMount(DeviceId); #endif if (!FileData[DeviceId].FileFuncTable) { diff --git a/boot/freeldr/freeldr/fs/pxe.c b/boot/freeldr/freeldr/fs/pxe.c new file mode 100644 index 00000000000..1e7f3b5c6b9 --- /dev/null +++ b/boot/freeldr/freeldr/fs/pxe.c @@ -0,0 +1,362 @@ +/* + * FreeLoader + * Copyright (C) 2011 Hervé Poussineau + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include + +#define NDEBUG +#include + +#define NO_FILE ((ULONG)-1) + +static IP4 _ServerIP = { 0, }; +static ULONG _OpenFile = NO_FILE; +static ULONG _FileSize = 0; +static ULONG _FilePosition = 0; +static ULONG _PacketPosition = 0; +static UCHAR _Packet[4096]; +static UCHAR* _CachedFile = NULL; +static ULONG _CachedLength = 0; + +static PPXE +FindPxeStructure(VOID) +{ + PPXE Ptr; + UCHAR Checksum; + UCHAR i; + + /* Find the '!PXE' structure */ + Ptr = (PPXE)0xA0000; + while ((ULONG)Ptr > 0x10000) + { + Ptr = (PPXE)((ULONG)Ptr - 0x10); + + /* Look for signature */ + if (memcmp(Ptr, "!PXE", 4) != 0) + continue; + + /* Check size */ + if (Ptr->StructLength != sizeof(PXE)) + continue; + + /* Check checksum */ + Checksum = 0; + for (i = 0; i < Ptr->StructLength; i++) + Checksum += *((PUCHAR)Ptr + i); + if (Checksum != 0) + continue; + + DPRINTM(DPRINT_FILESYSTEM, "!PXE structure found at %p\n", Ptr); + return Ptr; + } + + return NULL; +} + +static PPXE GetPxeStructure(VOID) +{ + static PPXE pPxe = NULL; + static BOOLEAN bPxeSearched = FALSE; + if (!bPxeSearched) + { + pPxe = FindPxeStructure(); + bPxeSearched = TRUE; + } + return pPxe; +} + +extern PXENV_EXIT PxeCallApi(UINT16 Segment, UINT16 Offset, UINT16 Service, VOID *Parameter); +BOOLEAN CallPxe(UINT16 Service, PVOID Parameter) +{ + PPXE pxe; + PXENV_EXIT exit; + + pxe = GetPxeStructure(); + if (!pxe) + return FALSE; + + if (Service != PXENV_TFTP_READ) + { + // HACK: this delay shouldn't be necessary + KeStallExecutionProcessor(100 * 1000); // 100 ms + DPRINTM(DPRINT_FILESYSTEM, "PxeCall(0x%x, %p)\n", Service, Parameter); + } + + exit = PxeCallApi(pxe->EntryPointSP.segment, pxe->EntryPointSP.offset, Service, Parameter); + if (exit != PXENV_EXIT_SUCCESS) + { + DPRINTM(DPRINT_FILESYSTEM, "PxeCall(0x%x, %p) failed with exit=%d status=0x%x\n", + Service, Parameter, exit, *(PXENV_STATUS*)Parameter); + return FALSE; + } + if (*(PXENV_STATUS*)Parameter != PXENV_STATUS_SUCCESS) + { + DPRINTM(DPRINT_FILESYSTEM, "PxeCall(0x%x, %p) succeeded, but returned error status 0x%x\n", + Service, Parameter, *(PXENV_STATUS*)Parameter); + return FALSE; + } + return TRUE; +} + +static LONG PxeClose(ULONG FileId) +{ + t_PXENV_TFTP_CLOSE closeData; + + if (_OpenFile == NO_FILE || FileId != _OpenFile) + return EBADF; + + RtlZeroMemory(&closeData, sizeof(closeData)); + if (!CallPxe(PXENV_TFTP_CLOSE, &closeData)) + return EIO; + + _OpenFile = NO_FILE; + if (_CachedFile) + { + MmHeapFree(_CachedFile); + _CachedFile = NULL; + } + return ESUCCESS; +} + +static LONG PxeGetFileInformation(ULONG FileId, FILEINFORMATION* Information) +{ + if (_OpenFile == NO_FILE || FileId != _OpenFile) + return EBADF; + + RtlZeroMemory(Information, sizeof(FILEINFORMATION)); + Information->EndingAddress.LowPart = _FileSize; + Information->CurrentAddress.LowPart = _FilePosition; + + return ESUCCESS; +} + +static LONG PxeOpen(CHAR* Path, OPENMODE OpenMode, ULONG* FileId) +{ + t_PXENV_TFTP_GET_FSIZE sizeData; + t_PXENV_TFTP_OPEN openData; + + if (_OpenFile != NO_FILE) + return EIO; + if (OpenMode != OpenReadOnly) + return EACCES; + + RtlZeroMemory(&sizeData, sizeof(sizeData)); + sizeData.ServerIPAddress = _ServerIP; + strncpy((CHAR*)sizeData.FileName, Path, sizeof(sizeData.FileName)); + if (!CallPxe(PXENV_TFTP_GET_FSIZE, &sizeData)) + return EIO; + _FileSize = sizeData.FileSize; + if (_FileSize < 1024 * 1024) + { + _CachedFile = MmHeapAlloc(_FileSize); + // Don't check for allocation failure, we support _CachedFile = NULL + } + _CachedLength = 0; + + RtlZeroMemory(&openData, sizeof(openData)); + openData.ServerIPAddress = _ServerIP; + strncpy((CHAR*)openData.FileName, Path, sizeof(openData.FileName)); + openData.PacketSize = sizeof(_Packet); + + if (!CallPxe(PXENV_TFTP_OPEN, &openData)) + { + if (_CachedFile) + { + MmHeapFree(_CachedFile); + _CachedFile = NULL; + } + return ENOENT; + } + + _FilePosition = 0; + _PacketPosition = 0; + + _OpenFile = *FileId; + return ESUCCESS; +} + +static LONG PxeRead(ULONG FileId, VOID* Buffer, ULONG N, ULONG* Count) +{ + t_PXENV_TFTP_READ readData; + ULONG i; + + *Count = 0; + + if (_OpenFile == NO_FILE || FileId != _OpenFile) + return EBADF; + + RtlZeroMemory(&readData, sizeof(readData)); + readData.Buffer.segment = ((UINT32)_Packet & 0xf0000) / 16; + readData.Buffer.offset = (UINT32)_Packet & 0xffff; + + // Get new packets as required + while (N > 0) + { + if (N < _CachedLength - _FilePosition) + i = N; + else + i = _CachedLength - _FilePosition; + if (_CachedFile) + RtlCopyMemory(Buffer, _CachedFile + _FilePosition, i); + else + RtlCopyMemory(Buffer, _Packet + _FilePosition - _PacketPosition, i); + _FilePosition += i; + Buffer = (UCHAR*)Buffer + i; + *Count += i; + N -= i; + if (N == 0) + break; + + if (!CallPxe(PXENV_TFTP_READ, &readData)) + return EIO; + if (_CachedFile) + RtlCopyMemory(_CachedFile + _CachedLength, _Packet, readData.BufferSize); + _PacketPosition = _CachedLength; + _CachedLength += readData.BufferSize; + } + + return ESUCCESS; +} + +static LONG PxeSeek(ULONG FileId, LARGE_INTEGER* Position, SEEKMODE SeekMode) +{ + t_PXENV_TFTP_READ readData; + + if (_OpenFile == NO_FILE || FileId != _OpenFile) + return EBADF; + + if (Position->HighPart != 0 || SeekMode != SeekAbsolute) + return EINVAL; + + if (!_CachedFile && Position->LowPart < _FilePosition) + // We don't support backward seek without caching + return EINVAL; + + RtlZeroMemory(&readData, sizeof(readData)); + readData.Buffer.segment = ((UINT32)_Packet & 0xf0000) / 16; + readData.Buffer.offset = (UINT32)_Packet & 0xffff; + + // Get new packets as required + while (Position->LowPart > _CachedLength) + { + if (!CallPxe(PXENV_TFTP_READ, &readData)) + return EIO; + if (_CachedFile) + { + RtlCopyMemory(_CachedFile + _CachedLength, _Packet, readData.BufferSize); + } + _PacketPosition = _CachedLength; + _CachedLength += readData.BufferSize; + } + + _FilePosition = Position->LowPart; + return ESUCCESS; +} + +static const DEVVTBL PxeVtbl = { + PxeClose, + PxeGetFileInformation, + PxeOpen, + PxeRead, + PxeSeek, +}; + +const DEVVTBL* PxeMount(ULONG DeviceId) +{ + if (GetPxeStructure() == NULL) + return NULL; + return &PxeVtbl; +} + +static LONG PxeDiskClose(ULONG FileId) +{ + // Nothing to do + return ESUCCESS; +} + +static LONG PxeDiskGetFileInformation(ULONG FileId, FILEINFORMATION* Information) +{ + // Not implemented + return EINVAL; +} + +static LONG PxeDiskOpen(CHAR* Path, OPENMODE OpenMode, ULONG* FileId) +{ + // Nothing to do + return ESUCCESS; +} + +static LONG PxeDiskRead(ULONG FileId, VOID* Buffer, ULONG N, ULONG* Count) +{ + // Not implemented + return EINVAL; +} + +static LONG PxeDiskSeek(ULONG FileId, LARGE_INTEGER* Position, SEEKMODE SeekMode) +{ + // Not implemented + return EINVAL; +} + +static const DEVVTBL PxeDiskVtbl = { + PxeDiskClose, + PxeDiskGetFileInformation, + PxeDiskOpen, + PxeDiskRead, + PxeDiskSeek, +}; + +static BOOLEAN GetCachedInfo(VOID) +{ + t_PXENV_GET_CACHED_INFO Data; + BOOLEAN res; + UCHAR* Packet; + + RtlZeroMemory(&Data, sizeof(Data)); + Data.PacketType = PXENV_PACKET_TYPE_CACHED_REPLY; + + res = CallPxe(PXENV_GET_CACHED_INFO, &Data); + if (!res) + return FALSE; + if (Data.BufferSize < 36) + return FALSE; + Packet = (UCHAR*)((UINT32)(Data.Buffer.segment << 4) + Data.Buffer.offset); + RtlCopyMemory(&_ServerIP, Packet + 20, sizeof(IP4)); + return TRUE; +} + +BOOLEAN PxeInit(VOID) +{ + static BOOLEAN Initialized = FALSE; + static BOOLEAN Status = FALSE; + + // Do initialization only once + if (Initialized) + return Status; + Initialized = TRUE; + + // Check if PXE is available + if (GetPxeStructure() && GetCachedInfo()) + { + FsRegisterDevice("net(0)", &PxeDiskVtbl); + Status = TRUE; + } + + return Status; +} + diff --git a/boot/freeldr/freeldr/include/arch/i386/hardware.h b/boot/freeldr/freeldr/include/arch/i386/hardware.h index c97ba88e9b7..5974067cd2b 100644 --- a/boot/freeldr/freeldr/include/arch/i386/hardware.h +++ b/boot/freeldr/freeldr/include/arch/i386/hardware.h @@ -91,4 +91,7 @@ ULONG PnpBiosGetDeviceNodeCount(ULONG *NodeSize, ULONG PnpBiosGetDeviceNode(UCHAR *NodeId, UCHAR *NodeBuffer); +/* i386pxe.S */ +USHORT PxeCallApi(USHORT Segment, USHORT Offset, USHORT Service, VOID* Parameter); + /* EOF */ diff --git a/boot/freeldr/freeldr/include/arch/i386/machpc.h b/boot/freeldr/freeldr/include/arch/i386/machpc.h index 1cb40b24f10..e2af2118b8b 100644 --- a/boot/freeldr/freeldr/include/arch/i386/machpc.h +++ b/boot/freeldr/freeldr/include/arch/i386/machpc.h @@ -48,6 +48,7 @@ VOID PcPrepareForReactOS(IN BOOLEAN Setup); ULONG PcMemGetMemoryMap(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MaxMemoryMapSize); +BOOLEAN PcDiskGetBootPath(char *BootPath, unsigned Size); BOOLEAN PcDiskReadLogicalSectors(ULONG DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer); BOOLEAN PcDiskGetPartitionEntry(ULONG DriveNumber, ULONG PartitionNumber, PPARTITION_TABLE_ENTRY PartitionTableEntry); BOOLEAN PcDiskGetDriveGeometry(ULONG DriveNumber, PGEOMETRY DriveGeometry); diff --git a/boot/freeldr/freeldr/include/arch/i386/pxe.h b/boot/freeldr/freeldr/include/arch/i386/pxe.h new file mode 100644 index 00000000000..86f4cfe0bf4 --- /dev/null +++ b/boot/freeldr/freeldr/include/arch/i386/pxe.h @@ -0,0 +1,602 @@ +#ifndef _PXE_ +#define _PXE_ + +/* Basic types */ + +typedef UINT16 OFF16; +typedef UINT16 PXENV_EXIT; +typedef UINT16 PXENV_STATUS; +typedef UINT16 SEGSEL; +typedef UINT16 UDP_PORT; +typedef UINT32 ADDR32; + +#include + +#define IP_ADDR_LEN 4 +typedef union +{ + UINT32 num; + UINT8 array[IP_ADDR_LEN]; +} IP4; + +#define MAC_ADDR_LEN 16 +typedef UINT8 MAC_ADDR[MAC_ADDR_LEN]; + +typedef struct s_SEGDESC +{ + UINT16 segment_address; + UINT32 physical_address; + UINT16 seg_size; +} SEGDESC; + +typedef struct s_SEGOFF16 +{ + OFF16 offset; + SEGSEL segment; +} SEGOFF16; + +typedef struct s_PXE +{ + UINT8 Signature[4]; + UINT8 StructLength; + UINT8 StructCksum; + UINT8 StructRev; + UINT8 reserved1; + SEGOFF16 UNDIROMID; + SEGOFF16 BaseROMID; + SEGOFF16 EntryPointSP; + SEGOFF16 EntryPointESP; + SEGOFF16 StatusCallout; + UINT8 reserved2; + UINT8 SegDescCnt; + SEGSEL FirstSelector; + SEGDESC Stack; + SEGDESC UNDIData; + SEGDESC UNDICode; + SEGDESC UNDICodeWrite; + SEGDESC BC_Data; + SEGDESC BC_Code; + SEGDESC BC_CodeWrite; +} PXE, *PPXE; + +/* PXENV structures */ + +typedef struct s_PXENV_START_UNDI +{ + PXENV_STATUS Status; + UINT16 AX; + UINT16 BX; + UINT16 DX; + UINT16 DI; + UINT16 ES; +} t_PXENV_START_UNDI; + +typedef struct s_PXENV_UNDI_STARTUP +{ + PXENV_STATUS Status; +} t_PXENV_UNDI_STARTUP; + +typedef struct s_PXENV_UNDI_CLEANUP +{ + PXENV_STATUS Status; +} t_PXENV_UNDI_CLEANUP; + +typedef struct s_PXENV_UNDI_INITIALIZE +{ + PXENV_STATUS Status; + ADDR32 ProtocolIni; + UINT8 reserved[8]; +} t_PXENV_UNDI_INITIALIZE; + +#define MAXNUM_MCADDR 8 +typedef struct s_PXENV_UNDI_MCAST_ADDRESS +{ + UINT16 MCastAddrCount; + MAC_ADDR McastAddr[MAXNUM_MCADDR]; +} t_PXENV_UNDI_MCAST_ADDRESS; + +typedef struct s_PXENV_UNDI_RESET +{ + PXENV_STATUS Status; + t_PXENV_UNDI_MCAST_ADDRESS R_Mcast_Buf; +} t_PXENV_UNDI_RESET; + +typedef struct s_PXENV_UNDI_SHUTDOWN +{ + PXENV_STATUS Status; +} t_PXENV_UNDI_SHUTDOWN; + +typedef struct s_PXENV_UNDI_OPEN +{ + PXENV_STATUS Status; + UINT16 OpenFlag; + UINT16 PktFilter; +#define FLTR_DIRECTED 0x01 +#define FLTR_BRDCST 0x02 +#define FLTR_PRMSCS 0x04 +#define FLTR_SRC_RTG 0x08 + + t_PXENV_UNDI_MCAST_ADDRESS R_Mcast_Buf; +} t_PXENV_UNDI_OPEN; + +typedef struct s_PXENV_UNDI_CLOSE +{ + PXENV_STATUS Status; +} t_PXENV_UNDI_CLOSE; + +typedef struct s_PXENV_UNDI_TRANSMIT +{ + PXENV_STATUS Status; + UINT8 Protocol; +#define P_UNKNOWN 0 +#define P_IP 1 +#define P_ARP 2 +#define P_RARP 3 + + UINT8 XmitFlag; +#define XMT_DESTADDR 0x00 +#define XMT_BROADCAST 0x01 + + SEGOFF16 DestAddr; + SEGOFF16 TBD; + UINT32 Reserved[2]; +} t_PXENV_UNDI_TRANSMIT; + +#define MAX_DATA_BLKS 8 +typedef struct s_PXENV_UNDI_TBD +{ + UINT16 ImmedLength; + SEGOFF16 Xmit; + UINT16 DataBlkCount; + struct DataBlk + { + UINT8 TDPtrType; + UINT8 TDRsvdByte; + UINT8 TDDataLen; + SEGOFF16 TDDataPtr; + } DataBlock[MAX_DATA_BLKS]; +} t_PXENV_UNDI_TBD; + +typedef struct s_PXENV_UNDI_SET_MCAST_ADDRESS +{ + PXENV_STATUS Status; + t_PXENV_UNDI_MCAST_ADDRESS R_Mcast_Buf; +} t_PXENV_UNDI_SET_MCAST_ADDRESS; + +typedef struct s_PXENV_UNDI_SET_STATION_ADDRESS +{ + PXENV_STATUS Status; + MAC_ADDR StationAddress; +} t_PXENV_UNDI_SET_STATION_ADDRESS; + +typedef struct s_PXENV_UNDI_SET_PACKET_FILTER +{ + PXENV_STATUS Status; + UINT8 filter; +} t_PXENV_UNDI_SET_PACKET_FILTER; + +typedef struct s_PXENV_UNDI_GET_INFORMATION +{ + PXENV_STATUS Status; + UINT16 BaseIo; + UINT16 IntNumber; + UINT16 MaxTranUnit; + UINT16 HwType; +#define ETHER_TYPE 1 +#define EXP_ETHER_TYPE 2 +#define IEEE_TYPE 3 +#define ARCNET_TYPE 4 + + UINT16 HwAddrLen; + MAC_ADDR CurrentNodeAddress; + MAC_ADDR PermNodeAddress; + SEGSEL ROMAddress; + UINT16 RxBufCt; + UINT16 TxBufCt; +} t_PXENV_UNDI_GET_INFORMATION; + +typedef struct s_PXENV_UNDI_GET_STATISTICS +{ + PXENV_STATUS Status; + UINT32 XmtGoodFrames; + UINT32 RcvGoodFrames; + UINT32 RcvCRCErrors; + UINT32 RcvResourceErrors; +} t_PXENV_UNDI_GET_STATISTICS; + +typedef struct s_PXENV_UNDI_CLEAR_STATISTICS +{ + PXENV_STATUS Status; +} t_PXENV_UNDI_CLEAR_STATISTICS; + +typedef struct s_PXENV_UNDI_INITIATE_DIAGS +{ + PXENV_STATUS Status; +} t_PXENV_UNDI_INITIATE_DIAGS; + +typedef struct s_PXENV_UNDI_FORCE_INTERRUPT +{ + PXENV_STATUS Status; +} t_PXENV_UNDI_FORCE_INTERRUPT; + +typedef struct s_PXENV_UNDI_GET_MCAST_ADDRESS +{ + PXENV_STATUS Status; + IP4 InetAddr; + MAC_ADDR MediaAddr; +} t_PXENV_UNDI_GET_MCAST_ADDRESS; + +typedef struct s_PXENV_UNDI_GET_NIC_TYPE +{ + PXENV_STATUS Status; + UINT8 NicType; +#define PCI_NIC 2 +#define PnP_NIC 3 +#define CardBus_NIC 4 + + union + { + struct + { + UINT16 Vendor_ID; + UINT16 Dev_ID; + UINT8 Base_Class; + UINT8 Sub_Class; + UINT8 Prog_Intf; + UINT8 Rev; + UINT16 BusDevFunc; + UINT16 SubVendor_ID; + UINT16 SubDevice_ID; + } pci, cardbus; + struct + { + UINT32 EISA_Dev_ID; + UINT8 Base_Class; + UINT8 Sub_Class; + UINT8 Prog_Intf; + UINT16 CardSelNum; + } pnp; + } info; +} t_PXENV_UNDI_GET_NIC_TYPE; + +typedef struct s_PXENV_UNDI_GET_IFACE_INFO +{ + PXENV_STATUS Status; + UINT8 IfaceType[16]; + UINT32 LinkSpeed; + UINT32 ServiceFlags; + UINT32 Reserved[4]; +} t_PXENV_UNDI_GET_IFACE_INFO; + +typedef struct s_PXENV_UNDI_ISR +{ + PXENV_STATUS Status; + UINT16 FuncFlag; + UINT16 BufferLength; + UINT16 FrameLength; + UINT16 FrameHeaderLength; + SEGOFF16 Frame; + UINT8 ProtType; + UINT8 PktType; +} t_PXENV_UNDI_ISR; + +#define PXENV_UNDI_ISR_IN_START 1 +#define PXENV_UNDI_ISR_IN_PROCESS 2 +#define PXENV_UNDI_ISR_IN_GET_NEXT 3 + +/* One of these will be returned for PXENV_UNDI_ISR_IN_START */ +#define PXENV_UNDI_ISR_OUT_OURS 0 +#define PXENV_UNDI_ISR_OUT_NOT_OURS 1 + +/* One of these will be returned for PXENV_UNDI_ISR_IN_PROCESS and PXENV_UNDI_ISR_IN_GET_NEXT */ +#define PXENV_UNDI_ISR_OUT_DONE 0 +#define PXENV_UNDI_ISR_OUT_TRANSMIT 2 +#define PXENV_UNDI_ISR_OUT_RECEIVE 3 +#define PXENV_UNDI_ISR_OUT_BUSY 4 + +typedef struct s_PXENV_UNDI_GET_STATE +{ + PXENV_STATUS Status; +#define PXE_UNDI_GET_STATE_STARTED 1 +#define PXE_UNDI_GET_STATE_INITIALIZED 2 +#define PXE_UNDI_GET_STATE_OPENED 3 + UINT8 UNDIState; +} t_PXENV_UNDI_GET_STATE; + +typedef struct s_PXENV_STOP_UNDI +{ + PXENV_STATUS Status; +} t_PXENV_STOP_UNDI; + +typedef struct s_PXENV_TFTP_OPEN +{ + PXENV_STATUS Status; + IP4 ServerIPAddress; + IP4 GatewayIPAddress; + UINT8 FileName[128]; + UDP_PORT TFTPPort; + UINT16 PacketSize; +} t_PXENV_TFTP_OPEN; + +typedef struct s_PXENV_TFTP_CLOSE +{ + PXENV_STATUS Status; +} t_PXENV_TFTP_CLOSE; + +typedef struct s_PXENV_TFTP_READ +{ + PXENV_STATUS Status; + UINT16 PacketNumber; + UINT16 BufferSize; + SEGOFF16 Buffer; +} t_PXENV_TFTP_READ; + +typedef struct s_PXENV_TFTP_READ_FILE +{ + PXENV_STATUS Status; + UINT8 FileName[128]; + UINT32 BufferSize; + ADDR32 Buffer; + IP4 ServerIPAddress; + IP4 GatewayIPAddress; + IP4 McastIPAddress; + UDP_PORT TFTPClntPort; + UDP_PORT TFTPSvrPort; + UINT16 TFTPOpenTimeOut; + UINT16 TFTPReopenDelay; +} t_PXENV_TFTP_READ_FILE; + +typedef struct s_PXENV_TFTP_GET_FSIZE +{ + PXENV_STATUS Status; + IP4 ServerIPAddress; + IP4 GatewayIPAddress; + UINT8 FileName[128]; + UINT32 FileSize; +} t_PXENV_TFTP_GET_FSIZE; + +typedef struct s_PXENV_UDP_OPEN +{ + PXENV_STATUS Status; + IP4 src_ip; +} t_PXENV_UDP_OPEN; + +typedef struct s_PXENV_UDP_CLOSE +{ + PXENV_STATUS Status; +} t_PXENV_UDP_CLOSE; + +typedef struct s_PXENV_UDP_READ +{ + PXENV_STATUS Status; + IP4 ip; + IP4 dest_ip; + UDP_PORT s_port; + UDP_PORT d_port; + UINT16 buffer_size; + SEGOFF16 buffer; +} t_PXENV_UDP_READ; + +typedef struct s_PXENV_UDP_WRITE +{ + PXENV_STATUS Status; + IP4 ip; + IP4 gw; + UDP_PORT src_port; + UDP_PORT dst_port; + UINT16 buffer_size; + SEGOFF16 buffer; +} t_PXENV_UDP_WRITE; + +typedef struct s_PXENV_UNLOAD_STACK +{ + PXENV_STATUS Status; + UINT8 reserved[10]; +} t_PXENV_UNLOAD_STACK; + +typedef struct s_PXENV_GET_CACHED_INFO +{ + PXENV_STATUS Status; + UINT16 PacketType; +#define PXENV_PACKET_TYPE_DHCP_DISCOVER 1 +#define PXENV_PACKET_TYPE_DHCP_ACK 2 +#define PXENV_PACKET_TYPE_CACHED_REPLY 3 + UINT16 BufferSize; + SEGOFF16 Buffer; + UINT16 BufferLimit; +} t_PXENV_GET_CACHED_INFO; + +typedef struct s_PXENV_START_BASE +{ + PXENV_STATUS Status; +} t_PXENV_START_BASE; + +typedef struct s_PXENV_STOP_BASE +{ + PXENV_STATUS Status; +} t_PXENV_STOP_BASE; + +typedef struct bootph +{ + UINT8 opcode; +#define BOOTP_REQ 1 +#define BOOTP_REP 2 + + UINT8 Hardware; + UINT8 Hardlen; + UINT8 Gatehops; + UINT32 ident; + UINT16 seconds; + UINT16 Flags; +#define BOOTP_BCAST 0x8000 + + IP4 cip; + IP4 yip; + IP4 sip; + IP4 gip; + MAC_ADDR CAddr; + UINT8 Sname[64]; + UINT8 bootfile[128]; + union + { +#define BOOTP_DHCPVEND 1024 /* DHCP extended vendor field size */ + UINT8 d[BOOTP_DHCPVEND]; + struct + { + UINT8 magic[4]; +#define VM_RFC1048 0x63825363 + UINT32 flags; + UINT8 pad[56]; + } v; + } vendor; +} BOOTPLAYER; + +#include + +/* Exit codes returned in AX by a PXENV API service */ +#define PXENV_EXIT_SUCCESS 0x0000 +#define PXENV_EXIT_FAILURE 0x0001 + +/* Generic API status & error codes that are reported by the loader */ +#define PXENV_STATUS_SUCCESS 0x00 +#define PXENV_STATUS_FAILURE 0x01 /* General failure */ +#define PXENV_STATUS_BAD_FUNC 0x02 /* Invalid function number */ +#define PXENV_STATUS_UNSUPPORTED 0x03 /* Function is not yet supported */ +#define PXENV_STATUS_KEEP_UNDI 0x04 /* UNDI must not be unloaded from base memory */ +#define PXENV_STATUS_KEEP_ALL 0x05 +#define PXENV_STATUS_OUT_OF_RESOURCES 0x06 /* Base code and UNDI must not be unloaded from base memory */ + +/* ARP errors (0x10 to 0x1f) */ +#define PXENV_STATUS_ARP_TIMEOUT 0x11 + +/* Base code state errors */ +#define PXENV_STATUS_UDP_CLOSED 0x18 +#define PXENV_STATUS_UDP_OPEN 0x19 +#define PXENV_STATUS_TFTP_CLOSED 0x1a +#define PXENV_STATUS_TFTP_OPEN 0x1b + +/* BIOS/system errors (0x20 to 0x2f) */ +#define PXENV_STATUS_MCOPY_PROBLEM 0x20 +#define PXENV_STATUS_BIS_INTEGRITY_FAILURE 0x21 +#define PXENV_STATUS_BIS_VALIDATE_FAILURE 0x22 +#define PXENV_STATUS_BIS_INIT_FAILURE 0x23 +#define PXENV_STATUS_BIS_SHUTDOWN_FAILURE 0x24 +#define PXENV_STATUS_BIS_GBOA_FAILURE 0x25 +#define PXENV_STATUS_BIS_FREE_FAILURE 0x26 +#define PXENV_STATUS_BIS_GSI_FAILURE 0x27 +#define PXENV_STATUS_BIS_BAD_CKSUM 0x28 + +/* TFTP/MTFTP errors (0x30 to 0x3f) */ +#define PXENV_STATUS_TFTP_CANNOT_ARP_ADDRESS 0x30 +#define PXENV_STATUS_TFTP_OPEN_TIMEOUT 0x32 +#define PXENV_STATUS_TFTP_UNKNOWN_OPCODE 0x33 +#define PXENV_STATUS_TFTP_READ_TIMEOUT 0x35 +#define PXENV_STATUS_TFTP_ERROR_OPCODE 0x36 +#define PXENV_STATUS_TFTP_CANNOT_OPEN_CONNECTION 0x38 +#define PXENV_STATUS_TFTP_CANNOT_READ_FROM_CONNECTION 0x39 +#define PXENV_STATUS_TFTP_TOO_MANY_PACKAGES 0x3a +#define PXENV_STATUS_TFTP_FILE_NOT_FOUND 0x3b +#define PXENV_STATUS_TFTP_ACCESS_VIOLATION 0x3c +#define PXENV_STATUS_TFTP_NO_MCAST_ADDRESS 0x3d +#define PXENV_STATUS_TFTP_NO_FILESIZE 0x3e +#define PXENV_STATUS_TFTP_INVALID_PACKET_SIZE 0x3f + +/* Reserved errors (0x40 to 0x4f) */ + +/* DHCP/BOOTP errors (0x50 to 0x5f) */ +#define PXENV_STATUS_DHCP_TIMEOUT 0x51 +#define PXENV_STATUS_DHCP_NO_IP_ADDRESS 0x52 +#define PXENV_STATUS_DHCP_NO_BOOTFILE_NAME 0x53 +#define PXENV_STATUS_DHCP_BAD_IP_ADDRESS 0x54 + +/* Driver errors (0x60 to 0x6f) */ +/* These errors are for UNDI compatible NIC drivers */ +#define PXENV_STATUS_UNDI_INVALID_FUNCTION 0x60 +#define PXENV_STATUS_UNDI_MEDIATEST_FAILED 0x61 +#define PXENV_STATUS_UNDI_CANNOT_INIT_NIC_FOR_MCAST 0x62 +#define PXENV_STATUS_UNDI_CANNOT_INITIALIZE_NIC 0x63 +#define PXENV_STATUS_UNDI_CANNOT_INITIALIZE_PHY 0x64 +#define PXENV_STATUS_UNDI_CANNOT_READ_CONFIG_DATA 0x65 +#define PXENV_STATUS_UNDI_CANNOT_READ_INIT_DATA 0x66 +#define PXENV_STATUS_UNDI_BAD_MAC_ADDRESS 0x67 +#define PXENV_STATUS_UNDI_BAD_EEPROM_CHECKSUM 0x68 +#define PXENV_STATUS_UNDI_ERROR_SETTING_ISR 0x69 +#define PXENV_STATUS_UNDI_INVALID_STATE 0x6a +#define PXENV_STATUS_UNDI_TRANSMIT_ERROR 0x6b +#define PXENV_STATUS_UNDI_INVALID_PARAMETER 0x6c + +/* ROM and NBP bootstrap errors (0x70 to 0x7f) */ +#define PXENV_STATUS_BSTRAP_PROMPT_MENU 0x74 +#define PXENV_STATUS_BSTRAP_MCAST_ADDR 0x76 +#define PXENV_STATUS_BSTRAP_MISSING_LIST 0x77 +#define PXENV_STATUS_BSTRAP_NO_RESPONSE 0x78 +#define PXENV_STATUS_BSTRAP_FILE_TOO_BIG 0x79 + +/* Environment NBP errors (0x80 to 0x8f) */ + +/* Reserved errors (0x90 to 0x9f) */ + +/* Misc. errors (0xa0 to 0xaf) */ +#define PXENV_STATUS_BINL_CANCELED_BY_KEYSTROKE 0xa0 +#define PXENV_STATUS_BINL_NO_PXE_SERVER 0xa1 +#define PXENV_STATUS_NOT_AVAILABLE_IN_PMODE 0xa2 +#define PXENV_STATUS_NOT_AVAILABLE_IN_RMODE 0xa3 + +/* BUSD errors (0xb0 to 0xbf) */ +#define PXENV_STATUS_BUSD_DEVICE_NOT_SUPPORTED 0xb0 + +/* Loader errors (0xc0 to 0xcf) */ +#define PXENV_STATUS_LOADER_NO_FREE_BASE_MEMORY 0xc0 +#define PXENV_STATUS_LOADER_NO_BC_ROMID 0xc1 +#define PXENV_STATUS_LOADER_BAD_BC_ROMID 0xc2 +#define PXENV_STATUS_LOADER_BAD_BC_RUNTIME_IMAGE 0xc3 +#define PXENV_STATUS_LOADER_NO_UNDI_ROMID 0xc4 +#define PXENV_STATUS_LOADER_BAD_UNDI_ROMID 0xc5 +#define PXENV_STATUS_LOADER_BAD_UNDI_DRIVER_IMAGE 0xc6 +#define PXENV_STATUS_LOADER_NO_PXE_STRUCT 0xc8 +#define PXENV_STATUS_LOADER_NO_PXENV_STRUCT 0xc9 +#define PXENV_STATUS_LOADER_UNDI_START 0xca +#define PXENV_STATUS_LOADER_BC_START 0xcb + +/* Vendor errors (0xd0 to 0xff) */ + +/* PXENV API services */ +#define PXENV_START_UNDI 0x00 +#define PXENV_UNDI_STARTUP 0x01 +#define PXENV_UNDI_CLEANUP 0x02 +#define PXENV_UNDI_INITIALIZE 0x03 +#define PXENV_UNDI_RESET_ADAPTER 0x04 +#define PXENV_UNDI_SHUTDOWN 0x05 +#define PXENV_UNDI_OPEN 0x06 +#define PXENV_UNDI_CLOSE 0x07 +#define PXENV_UNDI_TRANSMIT 0x08 +#define PXENV_UNDI_SET_MCAST_ADDRESS 0x09 +#define PXENV_UNDI_SET_STATION_ADDRESS 0x0a +#define PXENV_UNDI_SET_PACKET_FILTER 0x0b +#define PXENV_UNDI_GET_INFORMATION 0x0c +#define PXENV_UNDI_GET_STATISTICS 0x0d +#define PXENV_UNDI_CLEAR_STATISTICS 0x0e +#define PXENV_UNDI_INITIATE_DIAGS 0x0f +#define PXENV_UNDI_FORCE_INTERRUPT 0x10 +#define PXENV_UNDI_GET_MCAST_ADDRESS 0x11 +#define PXENV_UNDI_GET_NIC_TYPE 0x12 +#define PXENV_UNDI_GET_IFACE_INFO 0x13 +#define PXENV_UNDI_ISR 0x14 +#define PXENV_UNDI_GET_STATE 0x15 +#define PXENV_STOP_UNDI 0x15 +#define PXENV_TFTP_OPEN 0x20 +#define PXENV_TFTP_CLOSE 0x21 +#define PXENV_TFTP_READ 0x22 +#define PXENV_TFTP_READ_FILE 0x23 +#define PXENV_TFTP_GET_FSIZE 0x25 +#define PXENV_UDP_OPEN 0x30 +#define PXENV_UDP_CLOSE 0x31 +#define PXENV_UDP_READ 0x32 +#define PXENV_UDP_WRITE 0x33 +#define PXENV_UNLOAD_STACK 0x70 +#define PXENV_GET_CACHED_INFO 0x71 +#define PXENV_RESTART_TFTP 0x73 +#define PXENV_START_BASE 0x75 +#define PXENV_STOP_BASE 0x76 + +#endif diff --git a/boot/freeldr/freeldr/include/freeldr.h b/boot/freeldr/freeldr/include/freeldr.h index eaea923c365..694c9c764a9 100644 --- a/boot/freeldr/freeldr/include/freeldr.h +++ b/boot/freeldr/freeldr/include/freeldr.h @@ -69,6 +69,7 @@ #include #include #include +#include /* ui support */ #include #include @@ -83,6 +84,7 @@ #include #include #include +#include #include #elif defined(_M_PPC) #include diff --git a/boot/freeldr/freeldr/include/fs/pxe.h b/boot/freeldr/freeldr/include/fs/pxe.h new file mode 100644 index 00000000000..5d2cc2abc42 --- /dev/null +++ b/boot/freeldr/freeldr/include/fs/pxe.h @@ -0,0 +1,27 @@ +/* + * FreeLoader PXE support + * Copyright (C) 2011 Hervé Poussineau + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef __PXE_H +#define __PXE_H + +const DEVVTBL* PxeMount(ULONG DeviceId); + +BOOLEAN PxeInit(VOID); + +#endif /* #defined __PXE_H */ diff --git a/boot/freeldr/freeldr/windows/setupldr2.c b/boot/freeldr/freeldr/windows/setupldr2.c index fd737752c90..58ee4d89d31 100644 --- a/boot/freeldr/freeldr/windows/setupldr2.c +++ b/boot/freeldr/freeldr/windows/setupldr2.c @@ -109,11 +109,11 @@ SetupLdrLoadNlsData(PLOADER_PARAMETER_BLOCK LoaderBlock, HINF InfHandle, LPCSTR VOID SetupLdrScanBootDrivers(PLOADER_PARAMETER_BLOCK LoaderBlock, HINF InfHandle, LPCSTR SearchPath) { - INFCONTEXT InfContext; + INFCONTEXT InfContext, dirContext; BOOLEAN Status; - LPCSTR Media, DriverName; + LPCSTR Media, DriverName, dirIndex, ImagePath; WCHAR ServiceName[256]; - WCHAR ImagePath[256]; + WCHAR ImagePathW[256]; /* Open inf section */ if (!InfFindFirstLine(InfHandle, "SourceDisksFiles", NULL, &InfContext)) @@ -123,23 +123,28 @@ SetupLdrScanBootDrivers(PLOADER_PARAMETER_BLOCK LoaderBlock, HINF InfHandle, LPC do { if (InfGetDataField(&InfContext, 7, &Media) && - InfGetDataField(&InfContext, 0, &DriverName)) + InfGetDataField(&InfContext, 0, &DriverName) && + InfGetDataField(&InfContext, 13, &dirIndex)) { - if (strcmp(Media, "x") == 0) + if ((strcmp(Media, "x") == 0) && + InfFindFirstLine(InfHandle, "Directories", dirIndex, &dirContext) && + InfGetDataField(&dirContext, 1, &ImagePath)) { /* Convert name to widechar */ swprintf(ServiceName, L"%S", DriverName); + /* Prepare image path */ + swprintf(ImagePathW, L"%S", ImagePath); + wcscat(ImagePathW, L"\\"); + wcscat(ImagePathW, ServiceName); + /* Remove .sys extension */ ServiceName[wcslen(ServiceName) - 4] = 0; - /* Prepare image path */ - swprintf(ImagePath, L"%S", DriverName); - /* Add it to the list */ Status = WinLdrAddDriverToList(&LoaderBlock->BootDriverListHead, L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\", - ImagePath, + ImagePathW, ServiceName); if (!Status) @@ -278,37 +283,46 @@ VOID LoadReactOSSetup2(VOID) /* Load kernel */ strcpy(FileName+strlen("\\ArcName\\"), BootPath); - strcat(FileName, "NTOSKRNL.EXE"); + strcat(FileName, "SYSTEM32\\NTOSKRNL.EXE"); Status = WinLdrLoadImage(FileName+strlen("\\ArcName\\"), LoaderSystemCode, &NtosBase); DPRINTM(DPRINT_WINDOWS, "Ntos loaded with status %d at %p\n", Status, NtosBase); - WinLdrAllocateDataTableEntry(LoaderBlock, "ntoskrnl.exe", + Status = WinLdrAllocateDataTableEntry(LoaderBlock, "ntoskrnl.exe", FileName, NtosBase, &KernelDTE); + DPRINTM(DPRINT_WINDOWS, "Ntos Data Table Entry allocated with status %d at %p\n", Status, KernelDTE); /* Load HAL */ strcpy(FileName+strlen("\\ArcName\\"), BootPath); - strcat(FileName, "HAL.DLL"); + strcat(FileName, "SYSTEM32\\HAL.DLL"); Status = WinLdrLoadImage(FileName+strlen("\\ArcName\\"), LoaderHalCode, &HalBase); DPRINTM(DPRINT_WINDOWS, "HAL loaded with status %d at %p\n", Status, HalBase); - WinLdrAllocateDataTableEntry(LoaderBlock, "hal.dll", + Status = WinLdrAllocateDataTableEntry(LoaderBlock, "hal.dll", FileName, HalBase, &HalDTE); + DPRINTM(DPRINT_WINDOWS, "HAL Data Table Entry allocated with status %d at %p\n", Status, HalDTE); /* Load kernel-debugger support dll */ strcpy(FileName+strlen("\\ArcName\\"), BootPath); - strcat(FileName, "KDCOM.DLL"); + strcat(FileName, "SYSTEM32\\KDCOM.DLL"); Status = WinLdrLoadImage(FileName+strlen("\\ArcName\\"), LoaderBootDriver, &KdComBase); DPRINTM(DPRINT_WINDOWS, "KdCom loaded with status %d at %p\n", Status, KdComBase); - WinLdrAllocateDataTableEntry(LoaderBlock, "kdcom.dll", + Status = WinLdrAllocateDataTableEntry(LoaderBlock, "kdcom.dll", FileName, KdComBase, &KdComDTE); + DPRINTM(DPRINT_WINDOWS, "KdCom Data Table Entry allocated with status %d at %p\n", Status, HalDTE); /* Load all referenced DLLs for kernel, HAL and kdcom.dll */ strcpy(SearchPath, BootPath); WinLdrScanImportDescriptorTable(LoaderBlock, SearchPath, KernelDTE); WinLdrScanImportDescriptorTable(LoaderBlock, SearchPath, HalDTE); + if (KdComDTE) + WinLdrScanImportDescriptorTable(LoaderBlock, SearchPath, KdComDTE); + /* In system32 too */ + strcpy(SearchPath + strlen(BootPath), "system32\\"); + WinLdrScanImportDescriptorTable(LoaderBlock, SearchPath, KernelDTE); + WinLdrScanImportDescriptorTable(LoaderBlock, SearchPath, HalDTE); if (KdComDTE) WinLdrScanImportDescriptorTable(LoaderBlock, SearchPath, KdComDTE); - /* Load NLS data */ - SetupLdrLoadNlsData(LoaderBlock, InfHandle, BootPath); + /* Load NLS data, they are in system32 */ + SetupLdrLoadNlsData(LoaderBlock, InfHandle, SearchPath); /* Get a list of boot drivers */ SetupLdrScanBootDrivers(LoaderBlock, InfHandle, BootPath); diff --git a/cmake/CMakeParseArguments.cmake b/cmake/CMakeParseArguments.cmake new file mode 100644 index 00000000000..7ce4c49ae5b --- /dev/null +++ b/cmake/CMakeParseArguments.cmake @@ -0,0 +1,138 @@ +# CMAKE_PARSE_ARGUMENTS( args...) +# +# CMAKE_PARSE_ARGUMENTS() is intended to be used in macros or functions for +# parsing the arguments given to that macro or function. +# It processes the arguments and defines a set of variables which hold the +# values of the respective options. +# +# The argument contains all options for the respective macro, +# i.e. keywords which can be used when calling the macro without any value +# following, like e.g. the OPTIONAL keyword of the install() command. +# +# The argument contains all keywords for this macro +# which are followed by one value, like e.g. DESTINATION keyword of the +# install() command. +# +# The argument contains all keywords for this macro +# which can be followed by more than one value, like e.g. the TARGETS or +# FILES keywords of the install() command. +# +# When done, CMAKE_PARSE_ARGUMENTS() will have defined for each of the +# keywords listed in , and +# a variable composed of the given +# followed by "_" and the name of the respective keyword. +# These variables will then hold the respective value from the argument list. +# For the keywords this will be TRUE or FALSE. +# +# All remaining arguments are collected in a variable +# _UNPARSED_ARGUMENTS, this can be checked afterwards to see whether +# your macro was called with unrecognized parameters. +# +# As an example here a my_install() macro, which takes similar arguments as the +# real install() command: +# +# function(MY_INSTALL) +# set(options OPTIONAL FAST) +# set(oneValueArgs DESTINATION RENAME) +# set(multiValueArgs TARGETS CONFIGURATIONS) +# cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) +# ... +# +# Assume my_install() has been called like this: +# my_install(TARGETS foo bar DESTINATION bin OPTIONAL blub) +# +# After the cmake_parse_arguments() call the macro will have set the following +# variables: +# MY_INSTALL_OPTIONAL = TRUE +# MY_INSTALL_FAST = FALSE (this option was not used when calling my_install() +# MY_INSTALL_DESTINATION = "bin" +# MY_INSTALL_RENAME = "" (was not used) +# MY_INSTALL_TARGETS = "foo;bar" +# MY_INSTALL_CONFIGURATIONS = "" (was not used) +# MY_INSTALL_UNPARSED_ARGUMENTS = "blub" (no value expected after "OPTIONAL" +# +# You can the continue and process these variables. +# +# Keywords terminate lists of values, e.g. if directly after a one_value_keyword +# another recognized keyword follows, this is interpreted as the beginning of +# the new option. +# E.g. my_install(TARGETS foo DESTINATION OPTIONAL) would result in +# MY_INSTALL_DESTINATION set to "OPTIONAL", but MY_INSTALL_DESTINATION would +# be empty and MY_INSTALL_OPTIONAL would be set to TRUE therefor. + +#============================================================================= +# Copyright 2010 Alexander Neundorf +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# 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. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + + +if(__CMAKE_PARSE_ARGUMENTS_INCLUDED) + return() +endif() +set(__CMAKE_PARSE_ARGUMENTS_INCLUDED TRUE) + + +function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgNames) + # first set all result variables to empty/FALSE + foreach(arg_name ${_singleArgNames} ${_multiArgNames}) + set(${prefix}_${arg_name}) + endforeach(arg_name) + + foreach(option ${_optionNames}) + set(${prefix}_${option} FALSE) + endforeach(option) + + set(${prefix}_UNPARSED_ARGUMENTS) + + set(insideValues FALSE) + set(currentArgName) + + # now iterate over all arguments and fill the result variables + foreach(currentArg ${ARGN}) + list(FIND _optionNames "${currentArg}" optionIndex) # ... then this marks the end of the arguments belonging to this keyword + list(FIND _singleArgNames "${currentArg}" singleArgIndex) # ... then this marks the end of the arguments belonging to this keyword + list(FIND _multiArgNames "${currentArg}" multiArgIndex) # ... then this marks the end of the arguments belonging to this keyword + + if(${optionIndex} EQUAL -1 AND ${singleArgIndex} EQUAL -1 AND ${multiArgIndex} EQUAL -1) + if(insideValues) + if("${insideValues}" STREQUAL "SINGLE") + set(${prefix}_${currentArgName} ${currentArg}) + set(insideValues FALSE) + elseif("${insideValues}" STREQUAL "MULTI") + list(APPEND ${prefix}_${currentArgName} ${currentArg}) + endif() + else(insideValues) + list(APPEND ${prefix}_UNPARSED_ARGUMENTS ${currentArg}) + endif(insideValues) + else() + if(NOT ${optionIndex} EQUAL -1) + set(${prefix}_${currentArg} TRUE) + set(insideValues FALSE) + elseif(NOT ${singleArgIndex} EQUAL -1) + set(currentArgName ${currentArg}) + set(${prefix}_${currentArgName}) + set(insideValues "SINGLE") + elseif(NOT ${multiArgIndex} EQUAL -1) + set(currentArgName ${currentArg}) + set(${prefix}_${currentArgName}) + set(insideValues "MULTI") + endif() + endif() + + endforeach(currentArg) + + # propagate the result variables to the caller: + foreach(arg_name ${_singleArgNames} ${_multiArgNames} ${_optionNames}) + set(${prefix}_${arg_name} ${${prefix}_${arg_name}} PARENT_SCOPE) + endforeach(arg_name) + set(${prefix}_UNPARSED_ARGUMENTS ${${prefix}_UNPARSED_ARGUMENTS} PARENT_SCOPE) + +endfunction(CMAKE_PARSE_ARGUMENTS _options _singleArgs _multiArgs) diff --git a/cmake/idl-support.cmake b/cmake/idl-support.cmake index 7ca60975695..a627d0c7d6a 100644 --- a/cmake/idl-support.cmake +++ b/cmake/idl-support.cmake @@ -3,7 +3,7 @@ if(MSVC) set(IDL_COMPILER midl) set(IDL_HEADER_ARG /h) #.h - set(IDL_HEADER_ARG2 /h) #.h + set(IDL_HEADER_ARG2 /header) #.h set(IDL_TYPELIB_ARG /tlb) #.tlb set(IDL_SERVER_ARG /sstub) #.c for stub server library set(IDL_CLIENT_ARG /cstub) #.c for stub client library @@ -21,9 +21,9 @@ else() set(IDL_HEADER_ARG -h -o) #.h set(IDL_HEADER_ARG2 -h -H) #.h set(IDL_TYPELIB_ARG -t -o) #.tlb - set(IDL_SERVER_ARG -s -S) #.c for server library - set(IDL_CLIENT_ARG -c -C) #.c for stub client library - set(IDL_PROXY_ARG -p -P) + set(IDL_SERVER_ARG -s -o) #.c for server library + set(IDL_CLIENT_ARG -c -o) #.c for stub client library + set(IDL_PROXY_ARG -p -o) set(IDL_INTERFACE_ARG -u -o) if(ARCH MATCHES i386) set(IDL_FLAGS -m32 --win32) @@ -80,38 +80,34 @@ macro(add_idl_headers TARGET) add_custom_target(${TARGET} ALL DEPENDS ${HEADERS}) endmacro() -macro(add_rpcproxy_library TARGET) +macro(add_rpcproxy_files) get_includes(INCLUDES) get_defines(DEFINES) + + if(MSVC) + set(DLLDATA_ARG /dlldata ${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c) + endif() foreach(FILE ${ARGN}) get_filename_component(NAME ${FILE} NAME_WE) - if(MSVC) - set(IDL_DLLDATA_ARG /dlldata ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c) - else() - set(IDL_DLLDATA_ARG "") + if(NOT MSVC) + list(APPEND IDLS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}) endif() add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.h ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.c - COMMAND ${IDL_COMPILER} ${INCLUDES} ${DEFINES} ${IDL_FLAGS} ${IDL_HEADER_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.h ${IDL_PROXY_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.c ${IDL_DLLDATA_ARG} ${CMAKE_CURRENT_SOURCE_DIR}/${FILE} + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.c + COMMAND ${IDL_COMPILER} ${INCLUDES} ${DEFINES} ${IDL_FLAGS} ${IDL_PROXY_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.c ${IDL_HEADER_ARG2} ${NAME}_p.h ${CMAKE_CURRENT_SOURCE_DIR}/${FILE} ${DLLDATA_ARG} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}) - set_source_files_properties( - ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_c.h ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.c - PROPERTIES GENERATED TRUE) - list(APPEND rpcproxy_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.c) - list(APPEND IDLS ${CMAKE_CURRENT_SOURCE_DIR}/${NAME}.idl) endforeach() - if(NOT MSVC) - # Extra pass to generate dlldata for widl + # Extra pass to generate dlldata + if(MSVC) + #nobody told how to generate it, so mark it as generated + set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c PROPERTIES GENERATED TRUE) + else() add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c - COMMAND ${IDL_COMPILER} ${INCLUDES} ${DEFINES} ${IDL_FLAGS} --dlldata-only -o ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c ${IDLS} + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c + COMMAND ${IDL_COMPILER} ${INCLUDES} ${DEFINES} ${IDL_FLAGS} --dlldata-only -o ${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c ${IDLS} DEPENDS ${IDLS}) endif() - set_source_files_properties( - ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c - PROPERTIES GENERATED TRUE) - add_library(${TARGET} ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c ${rpcproxy_SOURCES}) endmacro() macro(add_rpc_library TARGET) @@ -120,21 +116,15 @@ macro(add_rpc_library TARGET) foreach(FILE ${ARGN}) get_filename_component(NAME ${FILE} NAME_WE) add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_s.h ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_s.c + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_s.c COMMAND ${IDL_COMPILER} ${INCLUDES} ${DEFINES} ${IDL_FLAGS} ${IDL_HEADER_ARG2} ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_s.h ${IDL_SERVER_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_s.c ${CMAKE_CURRENT_SOURCE_DIR}/${FILE} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}) - set_source_files_properties( - ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_s.h ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_s.c - PROPERTIES GENERATED TRUE) list(APPEND server_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_s.c) add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_c.h ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_c.c + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_c.c COMMAND ${IDL_COMPILER} ${INCLUDES} ${DEFINES} ${IDL_FLAGS} ${IDL_HEADER_ARG2} ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_c.h ${IDL_CLIENT_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_c.c ${CMAKE_CURRENT_SOURCE_DIR}/${FILE} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}) - set_source_files_properties( - ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_c.h ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_c.c - PROPERTIES GENERATED TRUE) list(APPEND client_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_c.c) endforeach() add_library(${TARGET} ${server_SOURCES} ${client_SOURCES}) diff --git a/configure.sh b/configure.sh new file mode 100755 index 00000000000..6c0579c8339 --- /dev/null +++ b/configure.sh @@ -0,0 +1,37 @@ +#!/bin/bash +if [ "x$ROS_ARCH" == "x" ] +then + echo Could not detect RosBE. + exit 1 +fi + +BUILD_ENVIRONMENT=MinGW +ARCH=$ROS_ARCH +REACTOS_SOURCE_DIR=$(cd `dirname $0` && pwd) +REACTOS_OUTPUT_PATH=output-$BUILD_ENVIRONMENT-$ARCH + +if [ "$REACTOS_SOURCE_DIR" == "$PWD" ] +then + echo Creating directories in $REACTOS_OUTPUT_PATH + mkdir -p $REACTOS_OUTPUT_PATH + cd "$REACTOS_OUTPUT_PATH" +fi + +mkdir -p host-tools +mkdir -p reactos + +echo Preparing host tools... +cd host-tools +if [ -f CMakeCache.txt ] +then + rm -f CMakeCache.txt +fi + +REACTOS_BUILD_TOOLS_DIR="$PWD" +cmake -G "Unix Makefiles" -DARCH=$ARCH "$REACTOS_SOURCE_DIR" + +cd ../reactos +cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=toolchain-mingw32.cmake -DARCH=$ARCH -DREACTOS_BUILD_TOOLS_DIR="$REACTOS_BUILD_TOOLS_DIR" "$REACTOS_SOURCE_DIR" + +echo Configure script complete! Enter directories and execute appropriate build commands\(ex: make, makex, etc...\). + diff --git a/dll/3rdparty/dxtn/CMakeLists.txt b/dll/3rdparty/dxtn/CMakeLists.txt index 57497e825f5..d581cbc516b 100644 --- a/dll/3rdparty/dxtn/CMakeLists.txt +++ b/dll/3rdparty/dxtn/CMakeLists.txt @@ -16,4 +16,4 @@ add_importlibs(dxtn msvcrt) add_dependencies(dxtn psdk) -add_cab_target(dxtn 1) +add_cd_file(TARGET dxtn DESTINATION reactos/system32 FOR all) diff --git a/dll/3rdparty/libjpeg/CMakeLists.txt b/dll/3rdparty/libjpeg/CMakeLists.txt index 9c074e830fb..124a4fb7a82 100644 --- a/dll/3rdparty/libjpeg/CMakeLists.txt +++ b/dll/3rdparty/libjpeg/CMakeLists.txt @@ -70,4 +70,4 @@ add_importlibs(libjpeg msvcrt kernel32) add_dependencies(libjpeg psdk) -add_cab_target(libjpeg 1) +add_cd_file(TARGET libjpeg DESTINATION reactos/system32 FOR all) diff --git a/dll/3rdparty/libpng/CMakeLists.txt b/dll/3rdparty/libpng/CMakeLists.txt index 3a17e90deb3..a3704f37418 100644 --- a/dll/3rdparty/libpng/CMakeLists.txt +++ b/dll/3rdparty/libpng/CMakeLists.txt @@ -36,4 +36,4 @@ add_importlibs(libpng msvcrt kernel32) add_dependencies(libpng psdk) -add_cab_target(libpng 1) +add_cd_file(TARGET libpng DESTINATION reactos/system32 FOR all) diff --git a/dll/3rdparty/libtiff/CMakeLists.txt b/dll/3rdparty/libtiff/CMakeLists.txt index 0d4da92a6e1..9be13ae70dc 100644 --- a/dll/3rdparty/libtiff/CMakeLists.txt +++ b/dll/3rdparty/libtiff/CMakeLists.txt @@ -59,4 +59,4 @@ add_importlibs(libtiff user32 msvcrt kernel32) add_dependencies(libtiff psdk) -add_cab_target(libtiff 1) +add_cd_file(TARGET libtiff DESTINATION reactos/system32 FOR all) diff --git a/dll/3rdparty/libxslt/CMakeLists.txt b/dll/3rdparty/libxslt/CMakeLists.txt index 85a0f8fdbed..b56c8b4d1e3 100644 --- a/dll/3rdparty/libxslt/CMakeLists.txt +++ b/dll/3rdparty/libxslt/CMakeLists.txt @@ -43,4 +43,4 @@ endif() add_dependencies(libxslt psdk) -add_cab_target(libxslt 1) +add_cd_file(TARGET libxslt DESTINATION reactos/system32 FOR all) diff --git a/dll/3rdparty/mesa32/CMakeLists.txt b/dll/3rdparty/mesa32/CMakeLists.txt index cd76f199107..49e25ec7fb1 100644 --- a/dll/3rdparty/mesa32/CMakeLists.txt +++ b/dll/3rdparty/mesa32/CMakeLists.txt @@ -269,4 +269,4 @@ add_importlibs(mesa32 gdi32 user32 msvcrt kernel32 ntdll) add_dependencies(mesa32 psdk) -add_cab_target(mesa32 1) +add_cd_file(TARGET mesa32 DESTINATION reactos/system32 FOR all) diff --git a/dll/cpl/access/CMakeLists.txt b/dll/cpl/access/CMakeLists.txt index b76afa3226d..6ee6db7d6e7 100644 --- a/dll/cpl/access/CMakeLists.txt +++ b/dll/cpl/access/CMakeLists.txt @@ -24,4 +24,4 @@ add_importlibs(access comctl32 kernel32) -add_cab_target(access 1) +add_cd_file(TARGET access DESTINATION reactos/system32 FOR all) diff --git a/dll/cpl/appwiz/CMakeLists.txt b/dll/cpl/appwiz/CMakeLists.txt index f7423cff183..cf5b76fa428 100644 --- a/dll/cpl/appwiz/CMakeLists.txt +++ b/dll/cpl/appwiz/CMakeLists.txt @@ -23,4 +23,4 @@ add_importlibs(appwiz shell32 kernel32) -add_cab_target(appwiz 1) +add_cd_file(TARGET appwiz DESTINATION reactos/system32 FOR all) diff --git a/dll/cpl/console/CMakeLists.txt b/dll/cpl/console/CMakeLists.txt index e498349c804..a16f09aedb4 100644 --- a/dll/cpl/console/CMakeLists.txt +++ b/dll/cpl/console/CMakeLists.txt @@ -24,4 +24,4 @@ add_importlibs(console kernel32) add_pch(console ${CMAKE_CURRENT_SOURCE_DIR}/console.h ${SOURCE}) -add_cab_target(console 1) +add_cd_file(TARGET console DESTINATION reactos/system32 FOR all) diff --git a/dll/cpl/desk/CMakeLists.txt b/dll/cpl/desk/CMakeLists.txt index a9ae5cbc495..51909fc6525 100644 --- a/dll/cpl/desk/CMakeLists.txt +++ b/dll/cpl/desk/CMakeLists.txt @@ -47,4 +47,4 @@ add_importlibs(desk kernel32 ntdll) -add_cab_target(desk 1) +add_cd_file(TARGET desk DESTINATION reactos/system32 FOR all) diff --git a/dll/cpl/desk/appearance.c b/dll/cpl/desk/appearance.c index 65e9ad6890a..7670f4c9e00 100644 --- a/dll/cpl/desk/appearance.c +++ b/dll/cpl/desk/appearance.c @@ -115,12 +115,14 @@ AppearancePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) hwndDlg, AdvAppearanceDlgProc, (LPARAM)g) == IDOK) { PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - g->Theme = g->ThemeAdv; - g_GlobalData.desktop_color = g->Theme.crColor[COLOR_DESKTOP]; g->bHasChanged = TRUE; + g->Theme = g->ThemeAdv; g->ThemeId = -1; /* Customized */ + g_GlobalData.desktop_color = g->Theme.crColor[COLOR_DESKTOP]; + SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_COLORSCHEME, CB_SETCURSEL, (WPARAM)-1, 0); SetDlgItemText(hwndDlg, IDC_APPEARANCE_COLORSCHEME, TEXT("")); + SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->Theme); } break; @@ -136,6 +138,7 @@ AppearancePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { g->Theme = Theme; g->ThemeId = ThemeId; + g_GlobalData.desktop_color = g->Theme.crColor[COLOR_DESKTOP]; SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&Theme); } } diff --git a/dll/cpl/desk/lang/fr-FR.rc b/dll/cpl/desk/lang/fr-FR.rc index 0bdebbc73ed..d95e8b42f87 100644 --- a/dll/cpl/desk/lang/fr-FR.rc +++ b/dll/cpl/desk/lang/fr-FR.rc @@ -22,7 +22,7 @@ BEGIN CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP END -IDD_SCREENSAVER DIALOGEX 0, 0, 246, 204 +IDD_SCREENSAVER DIALOGEX 0, 0, 246, 212 STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Écran de veille" FONT 8, "MS Shell Dlg", 0, 0 @@ -41,9 +41,9 @@ BEGIN LTEXT "minutes", IDC_MINTEXT, 70, 125, 26, 9 CONTROL "À la reprise, demander un mot de &passe.",IDC_SCREENS_USEPASSCHK,"button", BS_AUTOCHECKBOX | WS_TABSTOP, 97, 120, 138, 19 - GROUPBOX "G&estion de l'alimentation du moniteur", IDC_SCREENS_DUMMY2, 6, 155, 232, 41 + GROUPBOX "G&estion de l'alimentation du moniteur", IDC_SCREENS_DUMMY2, 6, 155, 232, 43 LTEXT "Pour modifier les paramètres de l'alimentation du moniteur, cliquez sur Gestion de l'alimentation.", - IDC_STATIC, 14, 166, 140, 20 + IDC_STATIC, 14, 166, 140, 25 PUSHBUTTON "&Gestion de l'alimentation...", IDC_SCREENS_POWER_BUTTON, 140, 171, 93, 13 END @@ -98,66 +98,66 @@ BEGIN DEFPUSHBUTTON "OK", IDOK, 137, 220, 50, 14 END -IDD_EFFAPPEARANCE DIALOGEX DISCARDABLE 0, 0, 285, 185 +IDD_EFFAPPEARANCE DIALOGEX DISCARDABLE 0, 0, 340, 185 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_DLGMODALFRAME | WS_EX_WINDOWEDGE CAPTION "Effects" FONT 8, "MS Shell Dlg" BEGIN - CONTROL "&Use the following transition effect for menus and tooltips:",IDC_EFFAPPEARANCE_ANIMATION,"button", - BS_AUTOCHECKBOX | WS_TABSTOP, 10, 5, 285, 19 + CONTROL "&Utilisez l'effet de transition suivant pour les menus et les bulles d'aides:",IDC_EFFAPPEARANCE_ANIMATION,"button", + BS_AUTOCHECKBOX | WS_TABSTOP, 10, 5, 330, 19 COMBOBOX IDC_EFFAPPEARANCE_ANIMATIONTYPE, 20, 25, 80, 19 , CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_CHILD | WS_VSCROLL | WS_TABSTOP - CONTROL "U&se the following method to smooth edges of screen fonts:",IDC_EFFAPPEARANCE_SMOOTHING,"button", - BS_AUTOCHECKBOX | WS_TABSTOP | WS_DISABLED, 10, 42, 285, 19 + CONTROL "U&tilisez la méthode suivante pour aplanir les bords des polices d'écran:",IDC_EFFAPPEARANCE_SMOOTHING,"button", + BS_AUTOCHECKBOX | WS_TABSTOP | WS_DISABLED, 10, 42, 330, 19 COMBOBOX IDC_EFFAPPEARANCE_SMOOTHINGTYPE, 20, 62, 80, 19 , CBS_DROPDOWNLIST | CBS_HASSTRINGS | CBS_SORT | WS_VSCROLL | WS_TABSTOP | WS_DISABLED - CONTROL "Us&e large icons",IDC_EFFAPPEARANCE_LARGEICONS,"button", - BS_AUTOCHECKBOX | WS_TABSTOP | WS_DISABLED, 10, 80, 285, 19 - CONTROL "Show sh&adows under menus",IDC_EFFAPPEARANCE_SETDROPSHADOW,"button", - BS_AUTOCHECKBOX | WS_TABSTOP | WS_DISABLED, 10, 95, 285, 19 - CONTROL "Show &window contents while dragging",IDC_EFFAPPEARANCE_DRAGFULLWINDOWS,"button", - BS_AUTOCHECKBOX | WS_TABSTOP, 10, 110, 285, 19 - CONTROL "&Hide underlined letters for keyboard navigation until I press the Alt key",IDC_EFFAPPEARANCE_KEYBOARDCUES,"button", - BS_AUTOCHECKBOX | WS_TABSTOP, 10, 125, 285, 19 - PUSHBUTTON "Cancel", IDCANCEL, 226, 165, 50, 14 - DEFPUSHBUTTON "OK", IDOK, 172, 165, 50, 14 + CONTROL "Uti&liser de grandes icones",IDC_EFFAPPEARANCE_LARGEICONS,"button", + BS_AUTOCHECKBOX | WS_TABSTOP | WS_DISABLED, 10, 80, 330, 19 + CONTROL "&Montrer ombrage sous les menus",IDC_EFFAPPEARANCE_SETDROPSHADOW,"button", + BS_AUTOCHECKBOX | WS_TABSTOP | WS_DISABLED, 10, 95, 330, 19 + CONTROL "Montrer contenu des fenêtres lorsqu'elles sont bougés",IDC_EFFAPPEARANCE_DRAGFULLWINDOWS,"button", + BS_AUTOCHECKBOX | WS_TABSTOP, 10, 110, 330, 19 + CONTROL "&Cacher les lettres soulignées pour la navigation du clavier jusqu'à ce que j'appuie sur la touche Alt",IDC_EFFAPPEARANCE_KEYBOARDCUES,"button", + BS_AUTOCHECKBOX | WS_TABSTOP, 10, 125, 330, 19 + PUSHBUTTON "Annuler", IDCANCEL, 281, 165, 50, 14 + DEFPUSHBUTTON "Accepter", IDOK, 227, 165, 50, 14 END -IDD_SETTINGS DIALOGEX DISCARDABLE 0, 0, 246, 188 +IDD_SETTINGS DIALOGEX DISCARDABLE 0, 0, 246, 207 STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Paramètres" FONT 8, "MS Shell Dlg" BEGIN - LTEXT "Déplacez les icônes de moniteur pour qu'elles correspondent à l'arragement physique de vos moniteurs.",-1,3,3,240,10 - CONTROL "",IDC_SETTINGS_MONSEL,"MONITORSELWNDCLASS",WS_CHILD|WS_VISIBLE|WS_TABSTOP,3,16,240,82,WS_EX_CLIENTEDGE - LTEXT "&Affichage :",1820,3,100,30,8 - LTEXT "",IDC_SETTINGS_DEVICE,9,109,224,8 - GROUPBOX "&Résolution de l'affichage",1818,3,120,115,43 + LTEXT "Déplacez les icônes de moniteur pour qu'elles correspondent à l'arragement physique de vos moniteurs.",-1,3,3,240,16 + CONTROL "",IDC_SETTINGS_MONSEL,"MONITORSELWNDCLASS",WS_CHILD|WS_VISIBLE|WS_TABSTOP,3,26,240,82,WS_EX_CLIENTEDGE + LTEXT "&Affichage :",1820,3,110,30,8 + LTEXT "",IDC_SETTINGS_DEVICE,9,119,224,8 + GROUPBOX "&Résolution de l'affichage",1818,3,130,115,43 CONTROL "",IDC_SETTINGS_RESOLUTION,"msctls_trackbar32", - TBS_AUTOTICKS | WS_TABSTOP, 30, 130, 58, 17 - LTEXT "Moins",1815,9,130,15,8,NOT WS_GROUP - LTEXT "Plus",1816,93,130,21,8,NOT WS_GROUP + TBS_AUTOTICKS | WS_TABSTOP, 30, 140, 58, 17 + LTEXT "Moins",1815,9,140,15,8,NOT WS_GROUP + LTEXT "Plus",1816,93,140,21,8,NOT WS_GROUP LTEXT "",IDC_SETTINGS_RESOLUTION_TEXT,10,150,100,10,NOT WS_GROUP | SS_CENTER - GROUPBOX "&Couleurs",1817,125,120,115,43 - COMBOBOX IDC_SETTINGS_BPP,131,130,103,80,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | + GROUPBOX "&Couleurs",1817,125,130,115,43 + COMBOBOX IDC_SETTINGS_BPP,131,140,103,80,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_SETTINGS_SPECTRUM,"Static",SS_OWNERDRAW | SS_SUNKEN,131,148,103,9 - PUSHBUTTON "A&vancé...",IDC_SETTINGS_ADVANCED,170,165,70,14 + CONTROL "",IDC_SETTINGS_SPECTRUM,"Static",SS_OWNERDRAW | SS_SUNKEN,131,158,103,9 + PUSHBUTTON "A&vancé...",IDC_SETTINGS_ADVANCED,170,175,70,14 END -IDD_ADVANCED_GENERAL DIALOGEX DISCARDABLE 0, 0, 253, 204 +IDD_ADVANCED_GENERAL DIALOGEX DISCARDABLE 0, 0, 299, 204 STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Général" FONT 8, "MS Shell Dlg" BEGIN - GROUPBOX "Affichage", -1, 7, 6, 237, 56, WS_GROUP + GROUPBOX "Affichage", -1, 7, 6, 284, 56, WS_GROUP LTEXT "Taille de la police :", -1, 14, 20, 222, 8 COMBOBOX IDC_FONTSIZE_COMBO, 14, 30, 223, 80, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP LTEXT "", IDC_FONTSIZE_COSTOM, 14, 46, 223, 12 - GROUPBOX "Compatibilité", -1, 7, 67, 237, 97 - LTEXT "Quelques programmes peuvent mal fonctionner si vous ne redémarrez pas votre ordinateur après que vous ayiez changé les paramètres des couleurs.\r\n\nAprès que j'ai changé les paramètres des couleurs :", -1, 12, 78, 228, 34 - AUTORADIOBUTTON "&Redémarrer l'ordinateur avant d'appliquer les nouveaux paramètres des couleurs.", IDC_RESTART_RB, 14, 116, 224, 10 - AUTORADIOBUTTON "Appliquer les nouveaux paramètres des couleurs sans redémarrer.", IDC_WITHOUTREBOOT_RB, 14, 131, 224, 10 - AUTORADIOBUTTON "Me demander avant d'appliquer les nouveaux paramètres des couleurs.", IDC_ASKME_RB, 14, 146, 224, 10 + GROUPBOX "Compatibilité", -1, 7, 67, 284, 97 + LTEXT "Quelques programmes peuvent mal fonctionner si vous ne redémarrez pas votre ordinateur après que vous ayiez changé les paramètres des couleurs.\r\n\nAprès que j'ai changé les paramètres des couleurs :", -1, 12, 78, 274, 34 + AUTORADIOBUTTON "&Redémarrer l'ordinateur avant d'appliquer les nouveaux paramètres des couleurs.", IDC_RESTART_RB, 14, 116, 274, 10 + AUTORADIOBUTTON "Appliquer les nouveaux paramètres des couleurs sans redémarrer.", IDC_WITHOUTREBOOT_RB, 14, 131, 274, 10 + AUTORADIOBUTTON "Me demander avant d'appliquer les nouveaux paramètres des couleurs.", IDC_ASKME_RB, 14, 146, 274, 10 END IDR_PREVIEW_MENU MENU diff --git a/dll/cpl/desk/rsrc.rc b/dll/cpl/desk/rsrc.rc index 54e3dd13247..c27b561df3c 100644 --- a/dll/cpl/desk/rsrc.rc +++ b/dll/cpl/desk/rsrc.rc @@ -11,7 +11,7 @@ #include "lang/hu-HU.rc" #include "lang/id-ID.rc" #include "lang/it-IT.rc" -//#include "lang/ja-JP.rc" FIXME: iconv issue +#include "lang/ja-JP.rc" #include "lang/nl-NL.rc" #include "lang/no-NO.rc" #include "lang/pl-PL.rc" diff --git a/dll/cpl/hdwwiz/CMakeLists.txt b/dll/cpl/hdwwiz/CMakeLists.txt index 8082d0cfd6c..4102f024387 100644 --- a/dll/cpl/hdwwiz/CMakeLists.txt +++ b/dll/cpl/hdwwiz/CMakeLists.txt @@ -20,4 +20,4 @@ add_importlibs(hdwwiz kernel32 ntdll) -add_cab_target(hdwwiz 1) +add_cd_file(TARGET hdwwiz DESTINATION reactos/system32 FOR all) diff --git a/dll/cpl/input/CMakeLists.txt b/dll/cpl/input/CMakeLists.txt index de8c3f0ba16..f6da9712807 100644 --- a/dll/cpl/input/CMakeLists.txt +++ b/dll/cpl/input/CMakeLists.txt @@ -23,4 +23,4 @@ add_importlibs(input gdi32 kernel32) -add_cab_target(input 1) +add_cd_file(TARGET input DESTINATION reactos/system32 FOR all) diff --git a/dll/cpl/intl/CMakeLists.txt b/dll/cpl/intl/CMakeLists.txt index 6aaa0d3d0e6..cae9ec0d80e 100644 --- a/dll/cpl/intl/CMakeLists.txt +++ b/dll/cpl/intl/CMakeLists.txt @@ -32,4 +32,4 @@ add_importlibs(intl shell32 kernel32) -add_cab_target(intl 1) +add_cd_file(TARGET intl DESTINATION reactos/system32 FOR all) diff --git a/dll/cpl/joy/CMakeLists.txt b/dll/cpl/joy/CMakeLists.txt index c08cc5bbeb8..3377dcde1e6 100644 --- a/dll/cpl/joy/CMakeLists.txt +++ b/dll/cpl/joy/CMakeLists.txt @@ -19,4 +19,4 @@ add_importlibs(joy kernel32 ntdll) -add_cab_target(joy 1) +add_cd_file(TARGET joy DESTINATION reactos/system32 FOR all) diff --git a/dll/cpl/main/CMakeLists.txt b/dll/cpl/main/CMakeLists.txt index 38eb38e8c55..0f6a5f56840 100644 --- a/dll/cpl/main/CMakeLists.txt +++ b/dll/cpl/main/CMakeLists.txt @@ -26,4 +26,4 @@ add_importlibs(main gdi32 kernel32) -add_cab_target(main 1) +add_cd_file(TARGET main DESTINATION reactos/system32 FOR all) diff --git a/dll/cpl/mmsys/CMakeLists.txt b/dll/cpl/mmsys/CMakeLists.txt index 6384bb3fb7d..f0078e88a03 100644 --- a/dll/cpl/mmsys/CMakeLists.txt +++ b/dll/cpl/mmsys/CMakeLists.txt @@ -31,4 +31,4 @@ add_importlibs(mmsys ntdll kernel32) -add_cab_target(mmsys 1) +add_cd_file(TARGET mmsys DESTINATION reactos/system32 FOR all) diff --git a/dll/cpl/ncpa/CMakeLists.txt b/dll/cpl/ncpa/CMakeLists.txt index 66cc15d0cd3..f1a9d0434a9 100644 --- a/dll/cpl/ncpa/CMakeLists.txt +++ b/dll/cpl/ncpa/CMakeLists.txt @@ -13,4 +13,4 @@ add_importlibs(ncpa shell32 kernel32) -add_cab_target(ncpa 1) +add_cd_file(TARGET ncpa DESTINATION reactos/system32 FOR all) diff --git a/dll/cpl/odbccp32/CMakeLists.txt b/dll/cpl/odbccp32/CMakeLists.txt index e5f6fc05c4c..b1ca92fa203 100644 --- a/dll/cpl/odbccp32/CMakeLists.txt +++ b/dll/cpl/odbccp32/CMakeLists.txt @@ -8,4 +8,4 @@ add_library(odbccp32i SHARED odbccp32.c odbccp32.rc ${CMAKE_CURRENT_BINARY_DIR}/ set_module_type(odbccp32i cpl) add_importlibs(odbccp32i user32 comctl32 msvcrt kernel32) -add_cab_target(odbccp32i 1) +add_cd_file(TARGET odbccp32i DESTINATION reactos/system32 FOR all) diff --git a/dll/cpl/powercfg/CMakeLists.txt b/dll/cpl/powercfg/CMakeLists.txt index f6ac3d0b344..c0beaa6ecef 100644 --- a/dll/cpl/powercfg/CMakeLists.txt +++ b/dll/cpl/powercfg/CMakeLists.txt @@ -25,4 +25,4 @@ add_importlibs(powercfg kernel32 ntdll) -add_cab_target(powercfg 1) +add_cd_file(TARGET powercfg DESTINATION reactos/system32 FOR all) diff --git a/dll/cpl/powercfg/rsrc.rc b/dll/cpl/powercfg/rsrc.rc index c3af70abf0d..f9e7669231e 100644 --- a/dll/cpl/powercfg/rsrc.rc +++ b/dll/cpl/powercfg/rsrc.rc @@ -10,7 +10,7 @@ #include "lang/fr-FR.rc" #include "lang/id-ID.rc" #include "lang/it-IT.rc" -//#include "lang/ja-JP.rc" FIXME: iconv issue +#include "lang/ja-JP.rc" #include "lang/nl-NL.rc" #include "lang/no-NO.rc" #include "lang/pl-PL.rc" diff --git a/dll/cpl/sysdm/CMakeLists.txt b/dll/cpl/sysdm/CMakeLists.txt index 038c94f7194..14c585c0044 100644 --- a/dll/cpl/sysdm/CMakeLists.txt +++ b/dll/cpl/sysdm/CMakeLists.txt @@ -38,4 +38,4 @@ add_importlibs(sysdm ntdll) add_pch(sysdm ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE}) -add_cab_target(sysdm 1) +add_cd_file(TARGET sysdm DESTINATION reactos/system32 FOR all) diff --git a/dll/cpl/sysdm/rsrc.rc b/dll/cpl/sysdm/rsrc.rc index a5f97a86d2e..ee3e6ff485e 100644 --- a/dll/cpl/sysdm/rsrc.rc +++ b/dll/cpl/sysdm/rsrc.rc @@ -10,7 +10,7 @@ #include "lang/fr-FR.rc" #include "lang/id-ID.rc" #include "lang/it-IT.rc" -//#include "lang/ja-JP.rc" FIXME: iconv issue +#include "lang/ja-JP.rc" #include "lang/no-NO.rc" #include "lang/pl-PL.rc" #include "lang/ro-RO.rc" diff --git a/dll/cpl/telephon/CMakeLists.txt b/dll/cpl/telephon/CMakeLists.txt index f321a56e12e..5b7b8a81553 100644 --- a/dll/cpl/telephon/CMakeLists.txt +++ b/dll/cpl/telephon/CMakeLists.txt @@ -19,4 +19,4 @@ add_importlibs(telephon msvcrt kernel32) -add_cab_target(telephon 1) +add_cd_file(TARGET telephon DESTINATION reactos/system32 FOR all) diff --git a/dll/cpl/timedate/CMakeLists.txt b/dll/cpl/timedate/CMakeLists.txt index 48eb91ef8bd..9dbc98ee293 100644 --- a/dll/cpl/timedate/CMakeLists.txt +++ b/dll/cpl/timedate/CMakeLists.txt @@ -27,4 +27,4 @@ add_importlibs(timedate msvcrt kernel32) -add_cab_target(timedate 1) +add_cd_file(TARGET timedate DESTINATION reactos/system32 FOR all) diff --git a/dll/cpl/usrmgr/CMakeLists.txt b/dll/cpl/usrmgr/CMakeLists.txt index e1728b52c38..a1d0ec5e12a 100644 --- a/dll/cpl/usrmgr/CMakeLists.txt +++ b/dll/cpl/usrmgr/CMakeLists.txt @@ -31,4 +31,4 @@ add_importlibs(usrmgr ntdll) -add_cab_target(usrmgr 1) +add_cd_file(TARGET usrmgr DESTINATION reactos/system32 FOR all) diff --git a/dll/directx/amstream/CMakeLists.txt b/dll/directx/amstream/CMakeLists.txt index cfaaa1e8f4d..ef51b60ebf6 100644 --- a/dll/directx/amstream/CMakeLists.txt +++ b/dll/directx/amstream/CMakeLists.txt @@ -33,4 +33,4 @@ add_importlibs(amstream ntdll) add_dependencies(amstream dxsdk) -add_cab_target(amstream 1) +add_cd_file(TARGET amstream DESTINATION reactos/system32 FOR all) diff --git a/dll/directx/d3d8thk/CMakeLists.txt b/dll/directx/d3d8thk/CMakeLists.txt index 3a9544bc030..d3142b43293 100644 --- a/dll/directx/d3d8thk/CMakeLists.txt +++ b/dll/directx/d3d8thk/CMakeLists.txt @@ -9,4 +9,4 @@ add_importlibs(d3d8thk gdi32) add_dependencies(d3d8thk psdk) -add_cab_target(d3d8thk 1) +add_cd_file(TARGET d3d8thk DESTINATION reactos/system32 FOR all) diff --git a/dll/directx/devenum/CMakeLists.txt b/dll/directx/devenum/CMakeLists.txt index 2fe436d5919..c31eefaaf50 100644 --- a/dll/directx/devenum/CMakeLists.txt +++ b/dll/directx/devenum/CMakeLists.txt @@ -35,4 +35,4 @@ add_importlibs(devenum kernel32 ntdll) -add_cab_target(devenum 1) +add_cd_file(TARGET devenum DESTINATION reactos/system32 FOR all) diff --git a/dll/directx/dinput/CMakeLists.txt b/dll/directx/dinput/CMakeLists.txt index f61ec37f654..142e22d7b07 100644 --- a/dll/directx/dinput/CMakeLists.txt +++ b/dll/directx/dinput/CMakeLists.txt @@ -37,5 +37,5 @@ add_importlibs(dinput kernel32 ntdll) -add_cab_target(dinput 1) +add_cd_file(TARGET dinput DESTINATION reactos/system32 FOR all) add_importlib_target(dinput.spec) diff --git a/dll/directx/dinput8/CMakeLists.txt b/dll/directx/dinput8/CMakeLists.txt index ca384dbc1b5..5f2fab45510 100644 --- a/dll/directx/dinput8/CMakeLists.txt +++ b/dll/directx/dinput8/CMakeLists.txt @@ -32,5 +32,5 @@ add_importlibs(dinput8 add_dependencies(dinput8 psdk) -add_cab_target(dinput8 1) +add_cd_file(TARGET dinput8 DESTINATION reactos/system32 FOR all) add_importlib_target(dinput8.spec) diff --git a/dll/directx/dmusic/CMakeLists.txt b/dll/directx/dmusic/CMakeLists.txt index 5eed21cc0ac..df15dcf81f4 100644 --- a/dll/directx/dmusic/CMakeLists.txt +++ b/dll/directx/dmusic/CMakeLists.txt @@ -41,4 +41,4 @@ add_importlibs(dmusic add_dependencies(dmusic psdk) -add_cab_target(dmusic 1) +add_cd_file(TARGET dmusic DESTINATION reactos/system32 FOR all) diff --git a/dll/directx/dplay/CMakeLists.txt b/dll/directx/dplay/CMakeLists.txt index 57b30178dc9..1626bceb34d 100644 --- a/dll/directx/dplay/CMakeLists.txt +++ b/dll/directx/dplay/CMakeLists.txt @@ -27,5 +27,5 @@ add_importlibs(dplay add_dependencies(dplay psdk) -add_cab_target(dplay 1) +add_cd_file(TARGET dplay DESTINATION reactos/system32 FOR all) add_importlib_target(dplay.spec libdplayx) diff --git a/dll/directx/dplayx/CMakeLists.txt b/dll/directx/dplayx/CMakeLists.txt index 9ee83d44fb2..77c80743427 100644 --- a/dll/directx/dplayx/CMakeLists.txt +++ b/dll/directx/dplayx/CMakeLists.txt @@ -36,5 +36,5 @@ add_importlibs(dplayx kernel32 ntdll) -add_cab_target(dplayx 1) +add_cd_file(TARGET dplayx DESTINATION reactos/system32 FOR all) add_importlib_target(dplayx.spec) diff --git a/dll/directx/dsound/CMakeLists.txt b/dll/directx/dsound/CMakeLists.txt index 203b037409d..c4b7218871a 100644 --- a/dll/directx/dsound/CMakeLists.txt +++ b/dll/directx/dsound/CMakeLists.txt @@ -39,5 +39,5 @@ add_importlibs(dsound kernel32 ntdll) -add_cab_target(dsound 1) +add_cd_file(TARGET dsound DESTINATION reactos/system32 FOR all) add_importlib_target(dsound.spec) diff --git a/dll/directx/dxdiagn/CMakeLists.txt b/dll/directx/dxdiagn/CMakeLists.txt index 1ff42b55880..59b0dc31d47 100644 --- a/dll/directx/dxdiagn/CMakeLists.txt +++ b/dll/directx/dxdiagn/CMakeLists.txt @@ -25,4 +25,4 @@ add_importlibs(dxdiagn kernel32 ntdll) -add_cab_target(dxdiagn 1) +add_cd_file(TARGET dxdiagn DESTINATION reactos/system32 FOR all) diff --git a/dll/directx/ksproxy/CMakeLists.txt b/dll/directx/ksproxy/CMakeLists.txt index 49db65e8273..c1ab338b565 100644 --- a/dll/directx/ksproxy/CMakeLists.txt +++ b/dll/directx/ksproxy/CMakeLists.txt @@ -52,4 +52,4 @@ add_importlibs(ksproxy add_dependencies(ksproxy psdk) -add_cab_target(ksproxy 1) +add_cd_file(TARGET ksproxy DESTINATION reactos/system32 FOR all) diff --git a/dll/directx/ksuser/CMakeLists.txt b/dll/directx/ksuser/CMakeLists.txt index b892fac8ddb..5f3acb71205 100644 --- a/dll/directx/ksuser/CMakeLists.txt +++ b/dll/directx/ksuser/CMakeLists.txt @@ -7,5 +7,5 @@ set_module_type(ksuser win32dll) add_importlibs(ksuser advapi32 msvcrt kernel32 ntdll) add_dependencies(ksuser psdk bugcodes) -add_cab_target(ksuser 1) +add_cd_file(TARGET ksuser DESTINATION reactos/system32 FOR all) add_importlib_target(ksuser.spec) diff --git a/dll/directx/msdmo/CMakeLists.txt b/dll/directx/msdmo/CMakeLists.txt index 70413695741..91d6283324d 100644 --- a/dll/directx/msdmo/CMakeLists.txt +++ b/dll/directx/msdmo/CMakeLists.txt @@ -26,4 +26,4 @@ add_importlibs(msdmo add_dependencies(msdmo dxsdk psdk) -add_cab_target(msdmo 1) +add_cd_file(TARGET msdmo DESTINATION reactos/system32 FOR all) diff --git a/dll/directx/qedit/CMakeLists.txt b/dll/directx/qedit/CMakeLists.txt index ae717b531e1..2d393e1ae44 100644 --- a/dll/directx/qedit/CMakeLists.txt +++ b/dll/directx/qedit/CMakeLists.txt @@ -35,4 +35,4 @@ add_importlibs(qedit ntdll) add_dependencies(qedit dxsdk) -add_cab_target(qedit 1) +add_cd_file(TARGET qedit DESTINATION reactos/system32 FOR all) diff --git a/dll/directx/quartz/CMakeLists.txt b/dll/directx/quartz/CMakeLists.txt index 66c8e3507e0..946d73eba30 100644 --- a/dll/directx/quartz/CMakeLists.txt +++ b/dll/directx/quartz/CMakeLists.txt @@ -14,7 +14,7 @@ include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine) spec2def(quartz.dll quartz.spec) -add_rpcproxy_library(quartzproxy quartz_strmif.idl) +add_rpcproxy_files(quartz_strmif.idl) list(APPEND SOURCE avidec.c @@ -42,6 +42,8 @@ list(APPEND SOURCE control.c avisplit.c version.rc + ${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c + ${CMAKE_CURRENT_BINARY_DIR}/quartz_strmif_p.c ${CMAKE_CURRENT_BINARY_DIR}/quartz.def) add_library(quartz SHARED ${SOURCE}) @@ -49,7 +51,6 @@ add_library(quartz SHARED ${SOURCE}) set_module_type(quartz win32dll) target_link_libraries(quartz - quartzproxy strmiids uuid wine @@ -71,4 +72,4 @@ add_importlibs(quartz kernel32 ntdll) -add_cab_target(quartz 1) +add_cd_file(TARGET quartz DESTINATION reactos/system32 FOR all) diff --git a/dll/directx/wine/d3d8/CMakeLists.txt b/dll/directx/wine/d3d8/CMakeLists.txt index 9d061e41481..a8cc0a720d0 100644 --- a/dll/directx/wine/d3d8/CMakeLists.txt +++ b/dll/directx/wine/d3d8/CMakeLists.txt @@ -48,4 +48,4 @@ add_importlibs(d3d8 ntdll) add_dependencies(d3d8 wineheaders) -add_cab_target(d3d8 1) +add_cd_file(TARGET d3d8 DESTINATION reactos/system32 FOR all) diff --git a/dll/directx/wine/d3d9/CMakeLists.txt b/dll/directx/wine/d3d9/CMakeLists.txt index 789b441cede..bdd13db21b7 100644 --- a/dll/directx/wine/d3d9/CMakeLists.txt +++ b/dll/directx/wine/d3d9/CMakeLists.txt @@ -51,5 +51,5 @@ add_importlibs(d3d9 ntdll) add_dependencies(d3d9 wineheaders) -add_cab_target(d3d9 1) +add_cd_file(TARGET d3d9 DESTINATION reactos/system32 FOR all) add_importlib_target(d3d9.spec) diff --git a/dll/directx/wine/d3dx9_24/CMakeLists.txt b/dll/directx/wine/d3dx9_24/CMakeLists.txt index 9b66de1d449..39ce0ce0371 100644 --- a/dll/directx/wine/d3dx9_24/CMakeLists.txt +++ b/dll/directx/wine/d3dx9_24/CMakeLists.txt @@ -30,5 +30,5 @@ add_importlibs(d3dx9_24 ntdll) add_dependencies(d3dx9_24 wineheaders) -add_cab_target(d3dx9_24 1) +add_cd_file(TARGET d3dx9_24 DESTINATION reactos/system32 FOR all) add_importlib_target(d3dx9_24.spec libd3dx9_36) diff --git a/dll/directx/wine/d3dx9_25/CMakeLists.txt b/dll/directx/wine/d3dx9_25/CMakeLists.txt index b8daec5b2a0..98c9a7f9e79 100644 --- a/dll/directx/wine/d3dx9_25/CMakeLists.txt +++ b/dll/directx/wine/d3dx9_25/CMakeLists.txt @@ -31,5 +31,5 @@ add_importlibs(d3dx9_25 ntdll) add_dependencies(d3dx9_25 wineheaders) -add_cab_target(d3dx9_25 1) +add_cd_file(TARGET d3dx9_25 DESTINATION reactos/system32 FOR all) add_importlib_target(d3dx9_25.spec libd3dx9_24 libd3dx9_36) diff --git a/dll/directx/wine/d3dx9_26/CMakeLists.txt b/dll/directx/wine/d3dx9_26/CMakeLists.txt index 91c607ee2a6..82f45db4c0e 100644 --- a/dll/directx/wine/d3dx9_26/CMakeLists.txt +++ b/dll/directx/wine/d3dx9_26/CMakeLists.txt @@ -31,4 +31,4 @@ add_importlibs(d3dx9_26 ntdll) add_dependencies(d3dx9_26 wineheaders) -add_cab_target(d3dx9_26 1) +add_cd_file(TARGET d3dx9_26 DESTINATION reactos/system32 FOR all) diff --git a/dll/directx/wine/d3dx9_27/CMakeLists.txt b/dll/directx/wine/d3dx9_27/CMakeLists.txt index b5cdeb7a9c5..595fb303814 100644 --- a/dll/directx/wine/d3dx9_27/CMakeLists.txt +++ b/dll/directx/wine/d3dx9_27/CMakeLists.txt @@ -31,4 +31,4 @@ add_importlibs(d3dx9_27 ntdll) add_dependencies(d3dx9_27 wineheaders) -add_cab_target(d3dx9_27 1) +add_cd_file(TARGET d3dx9_27 DESTINATION reactos/system32 FOR all) diff --git a/dll/directx/wine/d3dx9_28/CMakeLists.txt b/dll/directx/wine/d3dx9_28/CMakeLists.txt index ec679aae287..1abdaf0b692 100644 --- a/dll/directx/wine/d3dx9_28/CMakeLists.txt +++ b/dll/directx/wine/d3dx9_28/CMakeLists.txt @@ -31,4 +31,4 @@ add_importlibs(d3dx9_28 ntdll) add_dependencies(d3dx9_28 wineheaders) -add_cab_target(d3dx9_28 1) +add_cd_file(TARGET d3dx9_28 DESTINATION reactos/system32 FOR all) diff --git a/dll/directx/wine/d3dx9_29/CMakeLists.txt b/dll/directx/wine/d3dx9_29/CMakeLists.txt index c51f0b021e2..431a7830835 100644 --- a/dll/directx/wine/d3dx9_29/CMakeLists.txt +++ b/dll/directx/wine/d3dx9_29/CMakeLists.txt @@ -31,4 +31,4 @@ add_importlibs(d3dx9_29 ntdll) add_dependencies(d3dx9_29 wineheaders) -add_cab_target(d3dx9_29 1) +add_cd_file(TARGET d3dx9_29 DESTINATION reactos/system32 FOR all) diff --git a/dll/directx/wine/d3dx9_30/CMakeLists.txt b/dll/directx/wine/d3dx9_30/CMakeLists.txt index d1c271fb705..d6d00c81cf3 100644 --- a/dll/directx/wine/d3dx9_30/CMakeLists.txt +++ b/dll/directx/wine/d3dx9_30/CMakeLists.txt @@ -31,4 +31,4 @@ add_importlibs(d3dx9_30 ntdll) add_dependencies(d3dx9_30 wineheaders) -add_cab_target(d3dx9_30 1) +add_cd_file(TARGET d3dx9_30 DESTINATION reactos/system32 FOR all) diff --git a/dll/directx/wine/d3dx9_31/CMakeLists.txt b/dll/directx/wine/d3dx9_31/CMakeLists.txt index 05480aa2c4e..aa45584de71 100644 --- a/dll/directx/wine/d3dx9_31/CMakeLists.txt +++ b/dll/directx/wine/d3dx9_31/CMakeLists.txt @@ -30,4 +30,4 @@ add_importlibs(d3dx9_31 ntdll) add_dependencies(d3dx9_31 wineheaders) -add_cab_target(d3dx9_31 1) +add_cd_file(TARGET d3dx9_31 DESTINATION reactos/system32 FOR all) diff --git a/dll/directx/wine/d3dx9_32/CMakeLists.txt b/dll/directx/wine/d3dx9_32/CMakeLists.txt index a20daaa1a95..249e8195303 100644 --- a/dll/directx/wine/d3dx9_32/CMakeLists.txt +++ b/dll/directx/wine/d3dx9_32/CMakeLists.txt @@ -30,4 +30,4 @@ add_importlibs(d3dx9_32 ntdll) add_dependencies(d3dx9_32 wineheaders) -add_cab_target(d3dx9_32 1) +add_cd_file(TARGET d3dx9_32 DESTINATION reactos/system32 FOR all) diff --git a/dll/directx/wine/d3dx9_33/CMakeLists.txt b/dll/directx/wine/d3dx9_33/CMakeLists.txt index 8475defcdff..cefe373c27c 100644 --- a/dll/directx/wine/d3dx9_33/CMakeLists.txt +++ b/dll/directx/wine/d3dx9_33/CMakeLists.txt @@ -30,4 +30,4 @@ add_importlibs(d3dx9_33 ntdll) add_dependencies(d3dx9_33 wineheaders) -add_cab_target(d3dx9_33 1) +add_cd_file(TARGET d3dx9_33 DESTINATION reactos/system32 FOR all) diff --git a/dll/directx/wine/d3dx9_34/CMakeLists.txt b/dll/directx/wine/d3dx9_34/CMakeLists.txt index 54a7a70ad79..7353481b206 100644 --- a/dll/directx/wine/d3dx9_34/CMakeLists.txt +++ b/dll/directx/wine/d3dx9_34/CMakeLists.txt @@ -30,4 +30,4 @@ add_importlibs(d3dx9_34 ntdll) add_dependencies(d3dx9_34 wineheaders) -add_cab_target(d3dx9_34 1) +add_cd_file(TARGET d3dx9_34 DESTINATION reactos/system32 FOR all) diff --git a/dll/directx/wine/d3dx9_35/CMakeLists.txt b/dll/directx/wine/d3dx9_35/CMakeLists.txt index cb283e7d3ce..361ffa4671e 100644 --- a/dll/directx/wine/d3dx9_35/CMakeLists.txt +++ b/dll/directx/wine/d3dx9_35/CMakeLists.txt @@ -29,4 +29,4 @@ add_importlibs(d3dx9_35 ntdll) add_dependencies(d3dx9_35 wineheaders) -add_cab_target(d3dx9_35 1) +add_cd_file(TARGET d3dx9_35 DESTINATION reactos/system32 FOR all) diff --git a/dll/directx/wine/d3dx9_36/CMakeLists.txt b/dll/directx/wine/d3dx9_36/CMakeLists.txt index 0ed897701c1..34ca20bf6a6 100644 --- a/dll/directx/wine/d3dx9_36/CMakeLists.txt +++ b/dll/directx/wine/d3dx9_36/CMakeLists.txt @@ -38,5 +38,5 @@ add_importlibs(d3dx9_36 ntdll) add_dependencies(d3dx9_36 wineheaders) -add_cab_target(d3dx9_36 1) +add_cd_file(TARGET d3dx9_36 DESTINATION reactos/system32 FOR all) add_importlib_target(d3dx9_36.spec) diff --git a/dll/directx/wine/d3dx9_37/CMakeLists.txt b/dll/directx/wine/d3dx9_37/CMakeLists.txt index 86b00133fa9..cd49aee8e97 100644 --- a/dll/directx/wine/d3dx9_37/CMakeLists.txt +++ b/dll/directx/wine/d3dx9_37/CMakeLists.txt @@ -29,4 +29,4 @@ add_importlibs(d3dx9_37 ntdll) add_dependencies(d3dx9_37 wineheaders) -add_cab_target(d3dx9_37 1) +add_cd_file(TARGET d3dx9_37 DESTINATION reactos/system32 FOR all) diff --git a/dll/directx/wine/d3dx9_38/CMakeLists.txt b/dll/directx/wine/d3dx9_38/CMakeLists.txt index 0358e8d0203..a5d8f25ac4a 100644 --- a/dll/directx/wine/d3dx9_38/CMakeLists.txt +++ b/dll/directx/wine/d3dx9_38/CMakeLists.txt @@ -29,4 +29,4 @@ add_importlibs(d3dx9_38 ntdll) add_dependencies(d3dx9_38 wineheaders) -add_cab_target(d3dx9_38 1) +add_cd_file(TARGET d3dx9_38 DESTINATION reactos/system32 FOR all) diff --git a/dll/directx/wine/d3dx9_39/CMakeLists.txt b/dll/directx/wine/d3dx9_39/CMakeLists.txt index 0f3df34a7d7..84597ea257c 100644 --- a/dll/directx/wine/d3dx9_39/CMakeLists.txt +++ b/dll/directx/wine/d3dx9_39/CMakeLists.txt @@ -29,4 +29,4 @@ add_importlibs(d3dx9_39 ntdll) add_dependencies(d3dx9_39 wineheaders) -add_cab_target(d3dx9_39 1) +add_cd_file(TARGET d3dx9_39 DESTINATION reactos/system32 FOR all) diff --git a/dll/directx/wine/d3dx9_40/CMakeLists.txt b/dll/directx/wine/d3dx9_40/CMakeLists.txt index 1522eb34165..c9cfe0ae082 100644 --- a/dll/directx/wine/d3dx9_40/CMakeLists.txt +++ b/dll/directx/wine/d3dx9_40/CMakeLists.txt @@ -29,4 +29,4 @@ add_importlibs(d3dx9_40 ntdll) add_dependencies(d3dx9_40 wineheaders) -add_cab_target(d3dx9_40 1) +add_cd_file(TARGET d3dx9_40 DESTINATION reactos/system32 FOR all) diff --git a/dll/directx/wine/d3dx9_41/CMakeLists.txt b/dll/directx/wine/d3dx9_41/CMakeLists.txt index 5e0c94f3826..e8fbf0eeee0 100644 --- a/dll/directx/wine/d3dx9_41/CMakeLists.txt +++ b/dll/directx/wine/d3dx9_41/CMakeLists.txt @@ -29,4 +29,4 @@ add_importlibs(d3dx9_41 ntdll) add_dependencies(d3dx9_41 wineheaders) -add_cab_target(d3dx9_41 1) +add_cd_file(TARGET d3dx9_41 DESTINATION reactos/system32 FOR all) diff --git a/dll/directx/wine/d3dx9_42/CMakeLists.txt b/dll/directx/wine/d3dx9_42/CMakeLists.txt index 1d7bda2e183..75ee61b765d 100644 --- a/dll/directx/wine/d3dx9_42/CMakeLists.txt +++ b/dll/directx/wine/d3dx9_42/CMakeLists.txt @@ -29,4 +29,4 @@ add_importlibs(d3dx9_42 ntdll) add_dependencies(d3dx9_42 wineheaders) -add_cab_target(d3dx9_42 1) +add_cd_file(TARGET d3dx9_42 DESTINATION reactos/system32 FOR all) diff --git a/dll/directx/wine/ddraw/CMakeLists.txt b/dll/directx/wine/ddraw/CMakeLists.txt index 361e85caf35..81732d6678b 100644 --- a/dll/directx/wine/ddraw/CMakeLists.txt +++ b/dll/directx/wine/ddraw/CMakeLists.txt @@ -54,5 +54,5 @@ add_importlibs(ddraw ntdll) add_dependencies(ddraw wineheaders) -add_cab_target(ddraw 1) +add_cd_file(TARGET ddraw DESTINATION reactos/system32 FOR all) add_importlib_target(ddraw.spec) diff --git a/dll/directx/wine/wined3d/CMakeLists.txt b/dll/directx/wine/wined3d/CMakeLists.txt index 840c321307a..4a45c3b7b58 100644 --- a/dll/directx/wine/wined3d/CMakeLists.txt +++ b/dll/directx/wine/wined3d/CMakeLists.txt @@ -74,5 +74,5 @@ add_importlibs(wined3d ntdll) add_dependencies(wined3d wineheaders) -add_cab_target(wined3d 1) +add_cd_file(TARGET wined3d DESTINATION reactos/system32 FOR all) add_importlib_target(wined3d.spec) diff --git a/dll/keyboard/kbda1/CMakeLists.txt b/dll/keyboard/kbda1/CMakeLists.txt index 7514406a42f..09a6bf03494 100644 --- a/dll/keyboard/kbda1/CMakeLists.txt +++ b/dll/keyboard/kbda1/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbda1 0) add_dependencies(kbda1 psdk) -add_cab_target(kbda1 1) +add_cd_file(TARGET kbda1 DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbda2/CMakeLists.txt b/dll/keyboard/kbda2/CMakeLists.txt index dce4448ae39..8f784b08118 100644 --- a/dll/keyboard/kbda2/CMakeLists.txt +++ b/dll/keyboard/kbda2/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbda2 0) add_dependencies(kbda2 psdk) -add_cab_target(kbda2 1) +add_cd_file(TARGET kbda2 DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbda3/CMakeLists.txt b/dll/keyboard/kbda3/CMakeLists.txt index 0a2cfd2c8f2..30e0d84ab9e 100644 --- a/dll/keyboard/kbda3/CMakeLists.txt +++ b/dll/keyboard/kbda3/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbda3 0) add_dependencies(kbda3 psdk) -add_cab_target(kbda3 1) +add_cd_file(TARGET kbda3 DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdal/CMakeLists.txt b/dll/keyboard/kbdal/CMakeLists.txt index 5d1abef93d4..59a2116dd1a 100644 --- a/dll/keyboard/kbdal/CMakeLists.txt +++ b/dll/keyboard/kbdal/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdal 0) add_dependencies(kbdal psdk) -add_cab_target(kbdal 1) +add_cd_file(TARGET kbdal DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdarme/CMakeLists.txt b/dll/keyboard/kbdarme/CMakeLists.txt index 60996756c5e..035020ad44d 100644 --- a/dll/keyboard/kbdarme/CMakeLists.txt +++ b/dll/keyboard/kbdarme/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdarme 0) add_dependencies(kbdarme psdk) -add_cab_target(kbdarme 1) +add_cd_file(TARGET kbdarme DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdarmw/CMakeLists.txt b/dll/keyboard/kbdarmw/CMakeLists.txt index bff4aa37f78..4f52189b797 100644 --- a/dll/keyboard/kbdarmw/CMakeLists.txt +++ b/dll/keyboard/kbdarmw/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdarmw 0) add_dependencies(kbdarmw psdk) -add_cab_target(kbdarmw 1) +add_cd_file(TARGET kbdarmw DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdaze/CMakeLists.txt b/dll/keyboard/kbdaze/CMakeLists.txt index b7407ac10b7..4f3f4fea775 100644 --- a/dll/keyboard/kbdaze/CMakeLists.txt +++ b/dll/keyboard/kbdaze/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdaze 0) add_dependencies(kbdaze psdk) -add_cab_target(kbdaze 1) +add_cd_file(TARGET kbdaze DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdazel/CMakeLists.txt b/dll/keyboard/kbdazel/CMakeLists.txt index 9a6d149582c..0944e992d08 100644 --- a/dll/keyboard/kbdazel/CMakeLists.txt +++ b/dll/keyboard/kbdazel/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdazel 0) add_dependencies(kbdazel psdk) -add_cab_target(kbdazel 1) +add_cd_file(TARGET kbdazel DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdbe/CMakeLists.txt b/dll/keyboard/kbdbe/CMakeLists.txt index ffac78d7f48..5d1c6a370ef 100644 --- a/dll/keyboard/kbdbe/CMakeLists.txt +++ b/dll/keyboard/kbdbe/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdbe 0) add_dependencies(kbdbe psdk) -add_cab_target(kbdbe 1) +add_cd_file(TARGET kbdbe DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdbga/CMakeLists.txt b/dll/keyboard/kbdbga/CMakeLists.txt index d881c5ff0e6..c009a41a2b5 100644 --- a/dll/keyboard/kbdbga/CMakeLists.txt +++ b/dll/keyboard/kbdbga/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdbga 0) add_dependencies(kbdbga psdk) -add_cab_target(kbdbga 1) +add_cd_file(TARGET kbdbga DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdbgm/CMakeLists.txt b/dll/keyboard/kbdbgm/CMakeLists.txt index c0dfee9b375..67820d98d7b 100644 --- a/dll/keyboard/kbdbgm/CMakeLists.txt +++ b/dll/keyboard/kbdbgm/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdbgm 0) add_dependencies(kbdbgm psdk) -add_cab_target(kbdbgm 1) +add_cd_file(TARGET kbdbgm DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdbgt/CMakeLists.txt b/dll/keyboard/kbdbgt/CMakeLists.txt index 814f52ab3c8..74a9f45511a 100644 --- a/dll/keyboard/kbdbgt/CMakeLists.txt +++ b/dll/keyboard/kbdbgt/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdbgt 0) add_dependencies(kbdbgt psdk) -add_cab_target(kbdbgt 1) +add_cd_file(TARGET kbdbgt DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdblr/CMakeLists.txt b/dll/keyboard/kbdblr/CMakeLists.txt index 704c5d8193b..0a2941d54e2 100644 --- a/dll/keyboard/kbdblr/CMakeLists.txt +++ b/dll/keyboard/kbdblr/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdblr 0) add_dependencies(kbdblr psdk) -add_cab_target(kbdblr 1) +add_cd_file(TARGET kbdblr DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdbr/CMakeLists.txt b/dll/keyboard/kbdbr/CMakeLists.txt index e51d229445b..f8ea3619f07 100644 --- a/dll/keyboard/kbdbr/CMakeLists.txt +++ b/dll/keyboard/kbdbr/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdbr 0) add_dependencies(kbdbr psdk) -add_cab_target(kbdbr 1) +add_cd_file(TARGET kbdbr DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdbur/CMakeLists.txt b/dll/keyboard/kbdbur/CMakeLists.txt index 6f42e873932..9800c1358f2 100644 --- a/dll/keyboard/kbdbur/CMakeLists.txt +++ b/dll/keyboard/kbdbur/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdbur 0) add_dependencies(kbdbur psdk) -add_cab_target(kbdbur 1) +add_cd_file(TARGET kbdbur DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdcan/CMakeLists.txt b/dll/keyboard/kbdcan/CMakeLists.txt index 3f2e43116fc..7c244ba201f 100644 --- a/dll/keyboard/kbdcan/CMakeLists.txt +++ b/dll/keyboard/kbdcan/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdcan 0) add_dependencies(kbdcan psdk) -add_cab_target(kbdcan 1) +add_cd_file(TARGET kbdcan DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdcr/CMakeLists.txt b/dll/keyboard/kbdcr/CMakeLists.txt index 25d4073545b..f69e7eaf0f5 100644 --- a/dll/keyboard/kbdcr/CMakeLists.txt +++ b/dll/keyboard/kbdcr/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdcr 0) add_dependencies(kbdcr psdk) -add_cab_target(kbdcr 1) +add_cd_file(TARGET kbdcr DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdcz/CMakeLists.txt b/dll/keyboard/kbdcz/CMakeLists.txt index 7b1a6425bb6..6321509342e 100644 --- a/dll/keyboard/kbdcz/CMakeLists.txt +++ b/dll/keyboard/kbdcz/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdcz 0) add_dependencies(kbdcz psdk) -add_cab_target(kbdcz 1) +add_cd_file(TARGET kbdcz DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdcz1/CMakeLists.txt b/dll/keyboard/kbdcz1/CMakeLists.txt index 8534f7a24a1..1e99681acea 100644 --- a/dll/keyboard/kbdcz1/CMakeLists.txt +++ b/dll/keyboard/kbdcz1/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdcz1 0) add_dependencies(kbdcz1 psdk) -add_cab_target(kbdcz1 1) +add_cd_file(TARGET kbdcz1 DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdda/CMakeLists.txt b/dll/keyboard/kbdda/CMakeLists.txt index 576a649ca18..98d9b5bc607 100644 --- a/dll/keyboard/kbdda/CMakeLists.txt +++ b/dll/keyboard/kbdda/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdda 0) add_dependencies(kbdda psdk) -add_cab_target(kbdda 1) +add_cd_file(TARGET kbdda DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbddv/CMakeLists.txt b/dll/keyboard/kbddv/CMakeLists.txt index 73f4300f6ff..04e6c0c0b0f 100644 --- a/dll/keyboard/kbddv/CMakeLists.txt +++ b/dll/keyboard/kbddv/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbddv 0) add_dependencies(kbddv psdk) -add_cab_target(kbddv 1) +add_cd_file(TARGET kbddv DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdes/CMakeLists.txt b/dll/keyboard/kbdes/CMakeLists.txt index 308f3a6318e..499266a7885 100644 --- a/dll/keyboard/kbdes/CMakeLists.txt +++ b/dll/keyboard/kbdes/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdes 0) add_dependencies(kbdes psdk) -add_cab_target(kbdes 1) +add_cd_file(TARGET kbdes DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdest/CMakeLists.txt b/dll/keyboard/kbdest/CMakeLists.txt index b770a04adad..58c6199aca7 100644 --- a/dll/keyboard/kbdest/CMakeLists.txt +++ b/dll/keyboard/kbdest/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdest 0) add_dependencies(kbdest psdk) -add_cab_target(kbdest 1) +add_cd_file(TARGET kbdest DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdfc/CMakeLists.txt b/dll/keyboard/kbdfc/CMakeLists.txt index c5a7d9225b0..ce7a5cf3770 100644 --- a/dll/keyboard/kbdfc/CMakeLists.txt +++ b/dll/keyboard/kbdfc/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdfc 0) add_dependencies(kbdfc psdk) -add_cab_target(kbdfc 1) +add_cd_file(TARGET kbdfc DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdfi/CMakeLists.txt b/dll/keyboard/kbdfi/CMakeLists.txt index 2ba96585d11..3b922e5a524 100644 --- a/dll/keyboard/kbdfi/CMakeLists.txt +++ b/dll/keyboard/kbdfi/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdfi 0) add_dependencies(kbdfi psdk) -add_cab_target(kbdfi 1) +add_cd_file(TARGET kbdfi DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdfr/CMakeLists.txt b/dll/keyboard/kbdfr/CMakeLists.txt index c62571b7819..85b13850923 100644 --- a/dll/keyboard/kbdfr/CMakeLists.txt +++ b/dll/keyboard/kbdfr/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdfr 0) add_dependencies(kbdfr psdk) -add_cab_target(kbdfr 1) +add_cd_file(TARGET kbdfr DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdgeo/CMakeLists.txt b/dll/keyboard/kbdgeo/CMakeLists.txt index ef49d0d560e..965855edf27 100644 --- a/dll/keyboard/kbdgeo/CMakeLists.txt +++ b/dll/keyboard/kbdgeo/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdgeo 0) add_dependencies(kbdgeo psdk) -add_cab_target(kbdgeo 1) +add_cd_file(TARGET kbdgeo DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdgerg/CMakeLists.txt b/dll/keyboard/kbdgerg/CMakeLists.txt index 538151f10f3..db17d6930fe 100644 --- a/dll/keyboard/kbdgerg/CMakeLists.txt +++ b/dll/keyboard/kbdgerg/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdgerg 0) add_dependencies(kbdgerg psdk) -add_cab_target(kbdgerg 1) +add_cd_file(TARGET kbdgerg DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdgneo/CMakeLists.txt b/dll/keyboard/kbdgneo/CMakeLists.txt index 71d540ca030..3227429ea93 100644 --- a/dll/keyboard/kbdgneo/CMakeLists.txt +++ b/dll/keyboard/kbdgneo/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdgneo 0) add_dependencies(kbdgneo psdk) -add_cab_target(kbdgneo 1) +add_cd_file(TARGET kbdgneo DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdgr/CMakeLists.txt b/dll/keyboard/kbdgr/CMakeLists.txt index 4b0669ef764..c488873b654 100644 --- a/dll/keyboard/kbdgr/CMakeLists.txt +++ b/dll/keyboard/kbdgr/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdgr 0) add_dependencies(kbdgr psdk) -add_cab_target(kbdgr 1) +add_cd_file(TARGET kbdgr DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdgrist/CMakeLists.txt b/dll/keyboard/kbdgrist/CMakeLists.txt index c5b599e6556..19ffbd7a056 100644 --- a/dll/keyboard/kbdgrist/CMakeLists.txt +++ b/dll/keyboard/kbdgrist/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdgrist 0) add_dependencies(kbdgrist psdk) -add_cab_target(kbdgrist 1) +add_cd_file(TARGET kbdgrist DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdhe/CMakeLists.txt b/dll/keyboard/kbdhe/CMakeLists.txt index 1b52a60c3e8..b9af2891de7 100644 --- a/dll/keyboard/kbdhe/CMakeLists.txt +++ b/dll/keyboard/kbdhe/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdhe 0) add_dependencies(kbdhe psdk) -add_cab_target(kbdhe 1) +add_cd_file(TARGET kbdhe DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdheb/CMakeLists.txt b/dll/keyboard/kbdheb/CMakeLists.txt index 9881bb54b1d..59e64bc2c30 100644 --- a/dll/keyboard/kbdheb/CMakeLists.txt +++ b/dll/keyboard/kbdheb/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdheb 0) add_dependencies(kbdheb psdk) -add_cab_target(kbdheb 1) +add_cd_file(TARGET kbdheb DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdhu/CMakeLists.txt b/dll/keyboard/kbdhu/CMakeLists.txt index 09b6eb197b6..a78195adbb9 100644 --- a/dll/keyboard/kbdhu/CMakeLists.txt +++ b/dll/keyboard/kbdhu/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdhu 0) add_dependencies(kbdhu psdk) -add_cab_target(kbdhu 1) +add_cd_file(TARGET kbdhu DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdic/CMakeLists.txt b/dll/keyboard/kbdic/CMakeLists.txt index 55c7762ca32..3d910a2a429 100644 --- a/dll/keyboard/kbdic/CMakeLists.txt +++ b/dll/keyboard/kbdic/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdic 0) add_dependencies(kbdic psdk) -add_cab_target(kbdic 1) +add_cd_file(TARGET kbdic DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdinasa/CMakeLists.txt b/dll/keyboard/kbdinasa/CMakeLists.txt index 43f337e6cbe..bd975973b68 100644 --- a/dll/keyboard/kbdinasa/CMakeLists.txt +++ b/dll/keyboard/kbdinasa/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdinasa 0) add_dependencies(kbdinasa psdk) -add_cab_target(kbdinasa 1) +add_cd_file(TARGET kbdinasa DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdinben/CMakeLists.txt b/dll/keyboard/kbdinben/CMakeLists.txt index 0fdc9c91ddf..9579cf1f6f0 100644 --- a/dll/keyboard/kbdinben/CMakeLists.txt +++ b/dll/keyboard/kbdinben/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdinben 0) add_dependencies(kbdinben psdk) -add_cab_target(kbdinben 1) +add_cd_file(TARGET kbdinben DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdindev/CMakeLists.txt b/dll/keyboard/kbdindev/CMakeLists.txt index b8dade8e8f8..624f7859457 100644 --- a/dll/keyboard/kbdindev/CMakeLists.txt +++ b/dll/keyboard/kbdindev/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdindev 0) add_dependencies(kbdindev psdk) -add_cab_target(kbdindev 1) +add_cd_file(TARGET kbdindev DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdinguj/CMakeLists.txt b/dll/keyboard/kbdinguj/CMakeLists.txt index 6b5ceba7dfc..e10c4d17540 100644 --- a/dll/keyboard/kbdinguj/CMakeLists.txt +++ b/dll/keyboard/kbdinguj/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdinguj 0) add_dependencies(kbdinguj psdk) -add_cab_target(kbdinguj 1) +add_cd_file(TARGET kbdinguj DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdinmal/CMakeLists.txt b/dll/keyboard/kbdinmal/CMakeLists.txt index d0c544d8f62..5bbfb8a68dc 100644 --- a/dll/keyboard/kbdinmal/CMakeLists.txt +++ b/dll/keyboard/kbdinmal/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdinmal 0) add_dependencies(kbdinmal psdk) -add_cab_target(kbdinmal 1) +add_cd_file(TARGET kbdinmal DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdir/CMakeLists.txt b/dll/keyboard/kbdir/CMakeLists.txt index 9a270b475c1..49817b73386 100644 --- a/dll/keyboard/kbdir/CMakeLists.txt +++ b/dll/keyboard/kbdir/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdir 0) add_dependencies(kbdir psdk) -add_cab_target(kbdir 1) +add_cd_file(TARGET kbdir DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdit/CMakeLists.txt b/dll/keyboard/kbdit/CMakeLists.txt index 19dae284d26..052f75b0c05 100644 --- a/dll/keyboard/kbdit/CMakeLists.txt +++ b/dll/keyboard/kbdit/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdit 0) add_dependencies(kbdit psdk) -add_cab_target(kbdit 1) +add_cd_file(TARGET kbdit DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdja/CMakeLists.txt b/dll/keyboard/kbdja/CMakeLists.txt index 05c8f04be96..af982889ebf 100644 --- a/dll/keyboard/kbdja/CMakeLists.txt +++ b/dll/keyboard/kbdja/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdja 0) add_dependencies(kbdja psdk) -add_cab_target(kbdja 1) +add_cd_file(TARGET kbdja DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdkaz/CMakeLists.txt b/dll/keyboard/kbdkaz/CMakeLists.txt index c9b491f4f02..587a4acfc96 100644 --- a/dll/keyboard/kbdkaz/CMakeLists.txt +++ b/dll/keyboard/kbdkaz/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdkaz 0) add_dependencies(kbdkaz psdk) -add_cab_target(kbdkaz 1) +add_cd_file(TARGET kbdkaz DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdko/CMakeLists.txt b/dll/keyboard/kbdko/CMakeLists.txt index 4509a1a84e1..d7525fd42d2 100644 --- a/dll/keyboard/kbdko/CMakeLists.txt +++ b/dll/keyboard/kbdko/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdko 0) add_dependencies(kbdko psdk) -add_cab_target(kbdko 1) +add_cd_file(TARGET kbdko DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdla/CMakeLists.txt b/dll/keyboard/kbdla/CMakeLists.txt index 4956a9a21b3..a34ab26e2c5 100644 --- a/dll/keyboard/kbdla/CMakeLists.txt +++ b/dll/keyboard/kbdla/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdla 0) add_dependencies(kbdla psdk) -add_cab_target(kbdla 1) +add_cd_file(TARGET kbdla DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdlt1/CMakeLists.txt b/dll/keyboard/kbdlt1/CMakeLists.txt index 23b2137383e..17cdce162d0 100644 --- a/dll/keyboard/kbdlt1/CMakeLists.txt +++ b/dll/keyboard/kbdlt1/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdlt1 0) add_dependencies(kbdlt1 psdk) -add_cab_target(kbdlt1 1) +add_cd_file(TARGET kbdlt1 DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdlv/CMakeLists.txt b/dll/keyboard/kbdlv/CMakeLists.txt index 2024d59c04d..31a5a3754d5 100644 --- a/dll/keyboard/kbdlv/CMakeLists.txt +++ b/dll/keyboard/kbdlv/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdlv 0) add_dependencies(kbdlv psdk) -add_cab_target(kbdlv 1) +add_cd_file(TARGET kbdlv DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdmac/CMakeLists.txt b/dll/keyboard/kbdmac/CMakeLists.txt index 48cbb452927..0c96cc0ff3d 100644 --- a/dll/keyboard/kbdmac/CMakeLists.txt +++ b/dll/keyboard/kbdmac/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdmac 0) add_dependencies(kbdmac psdk) -add_cab_target(kbdmac 1) +add_cd_file(TARGET kbdmac DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdne/CMakeLists.txt b/dll/keyboard/kbdne/CMakeLists.txt index 2c59d3aeb79..b9695b36e7d 100644 --- a/dll/keyboard/kbdne/CMakeLists.txt +++ b/dll/keyboard/kbdne/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdne 0) add_dependencies(kbdne psdk) -add_cab_target(kbdne 1) +add_cd_file(TARGET kbdne DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdno/CMakeLists.txt b/dll/keyboard/kbdno/CMakeLists.txt index cd8711923b3..7f971891fa8 100644 --- a/dll/keyboard/kbdno/CMakeLists.txt +++ b/dll/keyboard/kbdno/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdno 0) add_dependencies(kbdno psdk) -add_cab_target(kbdno 1) +add_cd_file(TARGET kbdno DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdpl1/CMakeLists.txt b/dll/keyboard/kbdpl1/CMakeLists.txt index f479f2456d7..2b482b47679 100644 --- a/dll/keyboard/kbdpl1/CMakeLists.txt +++ b/dll/keyboard/kbdpl1/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdpl1 0) add_dependencies(kbdpl1 psdk) -add_cab_target(kbdpl1 1) +add_cd_file(TARGET kbdpl1 DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdpo/CMakeLists.txt b/dll/keyboard/kbdpo/CMakeLists.txt index 600cf6e88b9..496d776f9a7 100644 --- a/dll/keyboard/kbdpo/CMakeLists.txt +++ b/dll/keyboard/kbdpo/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdpo 0) add_dependencies(kbdpo psdk) -add_cab_target(kbdpo 1) +add_cd_file(TARGET kbdpo DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdro/CMakeLists.txt b/dll/keyboard/kbdro/CMakeLists.txt index a69ec46e3a4..2d1d3d87c1e 100644 --- a/dll/keyboard/kbdro/CMakeLists.txt +++ b/dll/keyboard/kbdro/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdro 0) add_dependencies(kbdro psdk) -add_cab_target(kbdro 1) +add_cd_file(TARGET kbdro DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdru/CMakeLists.txt b/dll/keyboard/kbdru/CMakeLists.txt index 82eeb39be10..7c513274102 100644 --- a/dll/keyboard/kbdru/CMakeLists.txt +++ b/dll/keyboard/kbdru/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdru 0) add_dependencies(kbdru psdk) -add_cab_target(kbdru 1) +add_cd_file(TARGET kbdru DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdru1/CMakeLists.txt b/dll/keyboard/kbdru1/CMakeLists.txt index 330293d8d17..62b1672938f 100644 --- a/dll/keyboard/kbdru1/CMakeLists.txt +++ b/dll/keyboard/kbdru1/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdru1 0) add_dependencies(kbdru1 psdk) -add_cab_target(kbdru1 1) +add_cd_file(TARGET kbdru1 DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdsg/CMakeLists.txt b/dll/keyboard/kbdsg/CMakeLists.txt index ab0232ba1ca..2338afac9a6 100644 --- a/dll/keyboard/kbdsg/CMakeLists.txt +++ b/dll/keyboard/kbdsg/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdsg 0) add_dependencies(kbdsg psdk) -add_cab_target(kbdsg 1) +add_cd_file(TARGET kbdsg DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdsk/CMakeLists.txt b/dll/keyboard/kbdsk/CMakeLists.txt index 96e0dcc9245..3445d1d98cb 100644 --- a/dll/keyboard/kbdsk/CMakeLists.txt +++ b/dll/keyboard/kbdsk/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdsk 0) add_dependencies(kbdsk psdk) -add_cab_target(kbdsk 1) +add_cd_file(TARGET kbdsk DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdsk1/CMakeLists.txt b/dll/keyboard/kbdsk1/CMakeLists.txt index 458fe834b33..1860bede0a1 100644 --- a/dll/keyboard/kbdsk1/CMakeLists.txt +++ b/dll/keyboard/kbdsk1/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdsk1 0) add_dependencies(kbdsk1 psdk) -add_cab_target(kbdsk1 1) +add_cd_file(TARGET kbdsk1 DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdsw/CMakeLists.txt b/dll/keyboard/kbdsw/CMakeLists.txt index f3cfd32eec2..4bbda232c9b 100644 --- a/dll/keyboard/kbdsw/CMakeLists.txt +++ b/dll/keyboard/kbdsw/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdsw 0) add_dependencies(kbdsw psdk) -add_cab_target(kbdsw 1) +add_cd_file(TARGET kbdsw DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdtat/CMakeLists.txt b/dll/keyboard/kbdtat/CMakeLists.txt index d1dd9588d5a..0ee6b976f01 100644 --- a/dll/keyboard/kbdtat/CMakeLists.txt +++ b/dll/keyboard/kbdtat/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdtat 0) add_dependencies(kbdtat psdk) -add_cab_target(kbdtat 1) +add_cd_file(TARGET kbdtat DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdth0/CMakeLists.txt b/dll/keyboard/kbdth0/CMakeLists.txt index 80ebeb2991d..57b49fce51f 100644 --- a/dll/keyboard/kbdth0/CMakeLists.txt +++ b/dll/keyboard/kbdth0/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdth0 0) add_dependencies(kbdth0 psdk) -add_cab_target(kbdth0 1) +add_cd_file(TARGET kbdth0 DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdth1/CMakeLists.txt b/dll/keyboard/kbdth1/CMakeLists.txt index 893ecdc19ef..1ccaa3ec662 100644 --- a/dll/keyboard/kbdth1/CMakeLists.txt +++ b/dll/keyboard/kbdth1/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdth1 0) add_dependencies(kbdth1 psdk) -add_cab_target(kbdth1 1) +add_cd_file(TARGET kbdth1 DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdth2/CMakeLists.txt b/dll/keyboard/kbdth2/CMakeLists.txt index 59a6510efb1..54f7b675424 100644 --- a/dll/keyboard/kbdth2/CMakeLists.txt +++ b/dll/keyboard/kbdth2/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdth2 0) add_dependencies(kbdth2 psdk) -add_cab_target(kbdth2 1) +add_cd_file(TARGET kbdth2 DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdth3/CMakeLists.txt b/dll/keyboard/kbdth3/CMakeLists.txt index dd82ec66284..f40d878ed80 100644 --- a/dll/keyboard/kbdth3/CMakeLists.txt +++ b/dll/keyboard/kbdth3/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdth3 0) add_dependencies(kbdth3 psdk) -add_cab_target(kbdth3 1) +add_cd_file(TARGET kbdth3 DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdtuf/CMakeLists.txt b/dll/keyboard/kbdtuf/CMakeLists.txt index dd77769d6e8..7203a80d578 100644 --- a/dll/keyboard/kbdtuf/CMakeLists.txt +++ b/dll/keyboard/kbdtuf/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdtuf 0) add_dependencies(kbdtuf psdk) -add_cab_target(kbdtuf 1) +add_cd_file(TARGET kbdtuf DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdtuq/CMakeLists.txt b/dll/keyboard/kbdtuq/CMakeLists.txt index fc2fc716b65..da03c035551 100644 --- a/dll/keyboard/kbdtuq/CMakeLists.txt +++ b/dll/keyboard/kbdtuq/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdtuq 0) add_dependencies(kbdtuq psdk) -add_cab_target(kbdtuq 1) +add_cd_file(TARGET kbdtuq DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbduk/CMakeLists.txt b/dll/keyboard/kbduk/CMakeLists.txt index d8f254a30e5..6f92fcab0a2 100644 --- a/dll/keyboard/kbduk/CMakeLists.txt +++ b/dll/keyboard/kbduk/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbduk 0) add_dependencies(kbduk psdk) -add_cab_target(kbduk 1) +add_cd_file(TARGET kbduk DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdur/CMakeLists.txt b/dll/keyboard/kbdur/CMakeLists.txt index 9128a20895d..eb17d88e204 100644 --- a/dll/keyboard/kbdur/CMakeLists.txt +++ b/dll/keyboard/kbdur/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdur 0) add_dependencies(kbdur psdk) -add_cab_target(kbdur 1) +add_cd_file(TARGET kbdur DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdurs/CMakeLists.txt b/dll/keyboard/kbdurs/CMakeLists.txt index b6d900dd95f..1ab666a813c 100644 --- a/dll/keyboard/kbdurs/CMakeLists.txt +++ b/dll/keyboard/kbdurs/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdurs 0) add_dependencies(kbdurs psdk) -add_cab_target(kbdurs 1) +add_cd_file(TARGET kbdurs DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdus/CMakeLists.txt b/dll/keyboard/kbdus/CMakeLists.txt index 34b746c6d41..8eecc6db687 100644 --- a/dll/keyboard/kbdus/CMakeLists.txt +++ b/dll/keyboard/kbdus/CMakeLists.txt @@ -8,4 +8,4 @@ set_entrypoint(kbdus 0) add_dependencies(kbdus psdk) -add_cab_target(kbdus 1) +add_cd_file(TARGET kbdus DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdusa/CMakeLists.txt b/dll/keyboard/kbdusa/CMakeLists.txt index 33b1f8ef9f3..eb146859eef 100644 --- a/dll/keyboard/kbdusa/CMakeLists.txt +++ b/dll/keyboard/kbdusa/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdusa 0) add_dependencies(kbdusa psdk) -add_cab_target(kbdusa 1) +add_cd_file(TARGET kbdusa DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdusl/CMakeLists.txt b/dll/keyboard/kbdusl/CMakeLists.txt index 0b594bb8b60..e459e894fc8 100644 --- a/dll/keyboard/kbdusl/CMakeLists.txt +++ b/dll/keyboard/kbdusl/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdusl 0) add_dependencies(kbdusl psdk) -add_cab_target(kbdusl 1) +add_cd_file(TARGET kbdusl DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdusr/CMakeLists.txt b/dll/keyboard/kbdusr/CMakeLists.txt index 555a4276f64..8ae497238a7 100644 --- a/dll/keyboard/kbdusr/CMakeLists.txt +++ b/dll/keyboard/kbdusr/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdusr 0) add_dependencies(kbdusr psdk) -add_cab_target(kbdusr 1) +add_cd_file(TARGET kbdusr DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdusx/CMakeLists.txt b/dll/keyboard/kbdusx/CMakeLists.txt index c7cc26a28d4..1994501979d 100644 --- a/dll/keyboard/kbdusx/CMakeLists.txt +++ b/dll/keyboard/kbdusx/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdusx 0) add_dependencies(kbdusx psdk) -add_cab_target(kbdusx 1) +add_cd_file(TARGET kbdusx DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbduzb/CMakeLists.txt b/dll/keyboard/kbduzb/CMakeLists.txt index 7487124cb49..2ad14e5fcda 100644 --- a/dll/keyboard/kbduzb/CMakeLists.txt +++ b/dll/keyboard/kbduzb/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbduzb 0) add_dependencies(kbduzb psdk) -add_cab_target(kbduzb 1) +add_cd_file(TARGET kbduzb DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdvntc/CMakeLists.txt b/dll/keyboard/kbdvntc/CMakeLists.txt index 5ee06e9e026..d180991f214 100644 --- a/dll/keyboard/kbdvntc/CMakeLists.txt +++ b/dll/keyboard/kbdvntc/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdvntc 0) add_dependencies(kbdvntc psdk) -add_cab_target(kbdvntc 1) +add_cd_file(TARGET kbdvntc DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdycc/CMakeLists.txt b/dll/keyboard/kbdycc/CMakeLists.txt index ecbfad8f19b..2711771377a 100644 --- a/dll/keyboard/kbdycc/CMakeLists.txt +++ b/dll/keyboard/kbdycc/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdycc 0) add_dependencies(kbdycc psdk) -add_cab_target(kbdycc 1) +add_cd_file(TARGET kbdycc DESTINATION reactos/system32 FOR all) diff --git a/dll/keyboard/kbdycl/CMakeLists.txt b/dll/keyboard/kbdycl/CMakeLists.txt index 61687b7eb6c..5726970a10c 100644 --- a/dll/keyboard/kbdycl/CMakeLists.txt +++ b/dll/keyboard/kbdycl/CMakeLists.txt @@ -9,4 +9,4 @@ set_entrypoint(kbdycl 0) add_dependencies(kbdycl psdk) -add_cab_target(kbdycl 1) +add_cd_file(TARGET kbdycl DESTINATION reactos/system32 FOR all) diff --git a/dll/nls/idndl/CMakeLists.txt b/dll/nls/idndl/CMakeLists.txt index 94435b96e07..7604698f11d 100644 --- a/dll/nls/idndl/CMakeLists.txt +++ b/dll/nls/idndl/CMakeLists.txt @@ -18,4 +18,4 @@ add_importlibs(idndl kernel32) add_dependencies(idndl psdk) -add_livecd_target(idndl reactos) +add_cd_file(TARGET idndl DESTINATION reactos FOR all) diff --git a/dll/ntdll/CMakeLists.txt b/dll/ntdll/CMakeLists.txt index dff520c4a0d..31090630436 100644 --- a/dll/ntdll/CMakeLists.txt +++ b/dll/ntdll/CMakeLists.txt @@ -58,6 +58,5 @@ set_image_base(ntdll ${baseaddress_ntdll}) add_pch(ntdll ${CMAKE_CURRENT_SOURCE_DIR}/include/ntdll.h ${SOURCE}) add_dependencies(ntdll ntstatus asm) -add_minicd_target(ntdll reactos/system32 ntdll.dll) -add_cab_target(ntdll 1) +add_cd_file(TARGET ntdll DESTINATION reactos/system32 NO_CAB FOR all) add_importlib_target(def/ntdll.spec) diff --git a/dll/shellext/deskadp/CMakeLists.txt b/dll/shellext/deskadp/CMakeLists.txt index dae34eb69f7..23306b9a197 100644 --- a/dll/shellext/deskadp/CMakeLists.txt +++ b/dll/shellext/deskadp/CMakeLists.txt @@ -26,4 +26,4 @@ add_importlibs(deskadp add_pch(deskadp ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE}) -add_cab_target(deskadp 1) +add_cd_file(TARGET deskadp DESTINATION reactos/system32 FOR all) diff --git a/dll/shellext/deskmon/CMakeLists.txt b/dll/shellext/deskmon/CMakeLists.txt index 6b0f6552c61..c03afabbc07 100644 --- a/dll/shellext/deskmon/CMakeLists.txt +++ b/dll/shellext/deskmon/CMakeLists.txt @@ -27,4 +27,4 @@ add_importlibs(deskmon add_pch(deskmon ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE}) -add_cab_target(deskmon 1) +add_cd_file(TARGET deskmon DESTINATION reactos/system32 FOR all) diff --git a/dll/shellext/devcpux/CMakeLists.txt b/dll/shellext/devcpux/CMakeLists.txt index 5b63f59fae4..607019245ce 100644 --- a/dll/shellext/devcpux/CMakeLists.txt +++ b/dll/shellext/devcpux/CMakeLists.txt @@ -16,4 +16,4 @@ add_importlibs(devcpux kernel32 ntdll) -add_cab_target(devcpux 1) +add_cd_file(TARGET devcpux DESTINATION reactos/system32 FOR all) diff --git a/dll/shellext/fontext/CMakeLists.txt b/dll/shellext/fontext/CMakeLists.txt index d7583549ab7..cd57d0ed73e 100644 --- a/dll/shellext/fontext/CMakeLists.txt +++ b/dll/shellext/fontext/CMakeLists.txt @@ -25,4 +25,4 @@ add_importlibs(fontext kernel32 ntdll) -add_cab_target(fontext 1) +add_cd_file(TARGET fontext DESTINATION reactos/system32 FOR all) diff --git a/dll/shellext/slayer/CMakeLists.txt b/dll/shellext/slayer/CMakeLists.txt index 7ef277be0e1..5830f4649a0 100644 --- a/dll/shellext/slayer/CMakeLists.txt +++ b/dll/shellext/slayer/CMakeLists.txt @@ -27,4 +27,4 @@ add_importlibs(slayer add_pch(slayer ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE}) -add_cab_target(slayer 1) +add_cd_file(TARGET slayer DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/acledit/CMakeLists.txt b/dll/win32/acledit/CMakeLists.txt index 87d336c6032..5a923400e28 100644 --- a/dll/win32/acledit/CMakeLists.txt +++ b/dll/win32/acledit/CMakeLists.txt @@ -13,5 +13,5 @@ add_library(acledit SHARED ${SOURCE}) set_module_type(acledit win32dll) add_importlibs(acledit msvcrt kernel32 ntdll) -add_cab_target(acledit 1) +add_cd_file(TARGET acledit DESTINATION reactos/system32 FOR all) add_importlib_target(acledit.spec) diff --git a/dll/win32/aclui/CMakeLists.txt b/dll/win32/aclui/CMakeLists.txt index 11955dd6e4f..c41fcc3d89c 100644 --- a/dll/win32/aclui/CMakeLists.txt +++ b/dll/win32/aclui/CMakeLists.txt @@ -26,4 +26,4 @@ add_importlibs(aclui user32 gdi32 comctl32 ole32 oleaut32 advapi32 uxtheme msvcr add_pch(aclui ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE}) -add_cab_target(aclui 1) +add_cd_file(TARGET aclui DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/activeds/CMakeLists.txt b/dll/win32/activeds/CMakeLists.txt index 7fe72e854a8..a4c7b420813 100644 --- a/dll/win32/activeds/CMakeLists.txt +++ b/dll/win32/activeds/CMakeLists.txt @@ -18,4 +18,4 @@ target_link_libraries(activeds wine) add_importlibs(activeds msvcrt kernel32 ntdll) -add_cab_target(activeds 1) +add_cd_file(TARGET activeds DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/actxprxy/CMakeLists.txt b/dll/win32/actxprxy/CMakeLists.txt index a3ebbb895a9..41b0eb8b69d 100644 --- a/dll/win32/actxprxy/CMakeLists.txt +++ b/dll/win32/actxprxy/CMakeLists.txt @@ -4,7 +4,7 @@ include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine) spec2def(actxprxy.dll actxprxy.spec) -add_rpcproxy_library(actxprxylib +add_rpcproxy_files( actxprxy_activscp.idl actxprxy_comcat.idl actxprxy_docobj.idl @@ -18,6 +18,17 @@ add_rpcproxy_library(actxprxylib list(APPEND SOURCE usrmarshal.c + ${CMAKE_CURRENT_BINARY_DIR}/actxprxy_activscp_p.c + ${CMAKE_CURRENT_BINARY_DIR}/actxprxy_comcat_p.c + ${CMAKE_CURRENT_BINARY_DIR}/actxprxy_docobj_p.c + ${CMAKE_CURRENT_BINARY_DIR}/actxprxy_hlink_p.c + ${CMAKE_CURRENT_BINARY_DIR}/actxprxy_htiframe_p.c + ${CMAKE_CURRENT_BINARY_DIR}/actxprxy_objsafe_p.c + ${CMAKE_CURRENT_BINARY_DIR}/actxprxy_ocmm_p.c + ${CMAKE_CURRENT_BINARY_DIR}/actxprxy_servprov_p.c + ${CMAKE_CURRENT_BINARY_DIR}/actxprxy_shobjidl_p.c + ${CMAKE_CURRENT_BINARY_DIR}/actxprxy_urlhist_p.c + ${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c ${CMAKE_CURRENT_BINARY_DIR}/actxprxy.def) add_library(actxprxy SHARED ${SOURCE}) @@ -25,7 +36,6 @@ add_library(actxprxy SHARED ${SOURCE}) set_entrypoint(actxprxy 0) target_link_libraries(actxprxy - actxprxylib uuid wine ${PSEH_LIB}) @@ -39,4 +49,4 @@ add_importlibs(actxprxy add_definitions(-DREGISTER_PROXY_DLL -DPROXY_DELEGATION) -add_cab_target(actxprxy 1) +add_cd_file(TARGET actxprxy DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/advapi32/CMakeLists.txt b/dll/win32/advapi32/CMakeLists.txt index e7e29dbd5d4..114b75f0b2f 100644 --- a/dll/win32/advapi32/CMakeLists.txt +++ b/dll/win32/advapi32/CMakeLists.txt @@ -61,5 +61,5 @@ target_link_libraries(advapi32 add_importlibs(advapi32 rpcrt4 kernel32 ntdll msvcrt) add_pch(advapi32 ${CMAKE_CURRENT_SOURCE_DIR}/advapi32.h ${SOURCE}) -add_cab_target(advapi32 1) +add_cd_file(TARGET advapi32 DESTINATION reactos/system32 FOR all) add_importlib_target(advapi32.spec) diff --git a/dll/win32/advpack/CMakeLists.txt b/dll/win32/advpack/CMakeLists.txt index f988c613f23..b81a4895127 100644 --- a/dll/win32/advpack/CMakeLists.txt +++ b/dll/win32/advpack/CMakeLists.txt @@ -19,4 +19,4 @@ set_module_type(advpack win32dll) target_link_libraries(advpack wine) add_importlibs(advpack ole32 setupapi version advapi32 msvcrt kernel32 ntdll) -add_cab_target(advpack 1) +add_cd_file(TARGET advpack DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/atl/CMakeLists.txt b/dll/win32/atl/CMakeLists.txt index 459360cd1cd..3fc13e9ead8 100644 --- a/dll/win32/atl/CMakeLists.txt +++ b/dll/win32/atl/CMakeLists.txt @@ -40,4 +40,4 @@ add_importlibs(atl add_importlib_target(atl.spec) add_dependencies(atl atl_atliface_header) -add_cab_target(atl 1) +add_cd_file(TARGET atl DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/authz/CMakeLists.txt b/dll/win32/authz/CMakeLists.txt index 9ed0f104c30..bb652abec05 100644 --- a/dll/win32/authz/CMakeLists.txt +++ b/dll/win32/authz/CMakeLists.txt @@ -20,4 +20,4 @@ set_module_type(authz win32dll) add_pch(authz ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE}) add_importlibs(authz advapi32 msvcrt kernel32 ntdll) -add_cab_target(authz 1) +add_cd_file(TARGET authz DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/avicap32/CMakeLists.txt b/dll/win32/avicap32/CMakeLists.txt index c3fc804c4cf..268203e3d54 100644 --- a/dll/win32/avicap32/CMakeLists.txt +++ b/dll/win32/avicap32/CMakeLists.txt @@ -14,5 +14,5 @@ target_link_libraries(avicap32 wine) add_importlibs(avicap32 advapi32 user32 version msvcrt kernel32 ntdll) -add_cab_target(avicap32 1) +add_cd_file(TARGET avicap32 DESTINATION reactos/system32 FOR all) add_importlib_target(avicap32.spec) diff --git a/dll/win32/avifil32/CMakeLists.txt b/dll/win32/avifil32/CMakeLists.txt index ef6182ae7cd..6edb848c253 100644 --- a/dll/win32/avifil32/CMakeLists.txt +++ b/dll/win32/avifil32/CMakeLists.txt @@ -43,4 +43,4 @@ add_importlibs(avifil32 ntdll) add_importlib_target(avifil32.spec) -add_cab_target(avifil32 1) +add_cd_file(TARGET avifil32 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/batt/CMakeLists.txt b/dll/win32/batt/CMakeLists.txt index d6965054a47..d652c00b7ea 100644 --- a/dll/win32/batt/CMakeLists.txt +++ b/dll/win32/batt/CMakeLists.txt @@ -15,4 +15,4 @@ add_importlib_target(batt.spec) add_importlibs(batt msvcrt kernel32 ntdll) -add_cab_target(batt 1) +add_cd_file(TARGET batt DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/bcrypt/CMakeLists.txt b/dll/win32/bcrypt/CMakeLists.txt index 3079a7316a6..d618a818321 100644 --- a/dll/win32/bcrypt/CMakeLists.txt +++ b/dll/win32/bcrypt/CMakeLists.txt @@ -18,4 +18,4 @@ target_link_libraries(bcrypt wine) add_importlibs(bcrypt msvcrt kernel32 ntdll) -add_cab_target(bcrypt 1) +add_cd_file(TARGET bcrypt DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/beepmidi/CMakeLists.txt b/dll/win32/beepmidi/CMakeLists.txt index 742da7c9ae5..bac931cf584 100644 --- a/dll/win32/beepmidi/CMakeLists.txt +++ b/dll/win32/beepmidi/CMakeLists.txt @@ -14,4 +14,4 @@ add_importlibs(beepmidi winmm kernel32 ntdll msvcrt) add_importlib_target(beepmidi.spec) add_dependencies(beepmidi psdk) -add_cab_target(beepmidi 1) +add_cd_file(TARGET beepmidi DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/browseui/CMakeLists.txt b/dll/win32/browseui/CMakeLists.txt index 05c6542a95c..7b146884c4d 100644 --- a/dll/win32/browseui/CMakeLists.txt +++ b/dll/win32/browseui/CMakeLists.txt @@ -62,4 +62,4 @@ add_importlibs(browseui kernel32 ntdll) -add_cab_target(browseui 1) +add_cd_file(TARGET browseui DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/cabinet/CMakeLists.txt b/dll/win32/cabinet/CMakeLists.txt index 769d6822948..f85c5e0a4d5 100644 --- a/dll/win32/cabinet/CMakeLists.txt +++ b/dll/win32/cabinet/CMakeLists.txt @@ -23,4 +23,4 @@ add_importlibs(cabinet kernel32 ntdll) add_importlib_target(cabinet.spec) add_dependencies(cabinet psdk) -add_cab_target(cabinet 1) +add_cd_file(TARGET cabinet DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/cards/CMakeLists.txt b/dll/win32/cards/CMakeLists.txt index ff0bd904f51..1ef048fef2a 100644 --- a/dll/win32/cards/CMakeLists.txt +++ b/dll/win32/cards/CMakeLists.txt @@ -18,4 +18,4 @@ add_library(cards SHARED ${SOURCE}) set_module_type(cards win32dll) add_importlibs(cards user32 gdi32 msvcrt kernel32) add_importlib_target(cards.spec) -add_cab_target(cards 1) +add_cd_file(TARGET cards DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/cfgmgr32/CMakeLists.txt b/dll/win32/cfgmgr32/CMakeLists.txt index f60790671f7..ad1bdcb7ab1 100644 --- a/dll/win32/cfgmgr32/CMakeLists.txt +++ b/dll/win32/cfgmgr32/CMakeLists.txt @@ -11,4 +11,4 @@ add_library(cfgmgr32 SHARED ${SOURCE}) set_entrypoint(cfgmgr32 0) add_importlibs(cfgmgr32 setupapi kernel32 ntdll) add_dependencies(cfgmgr32 psdk) -add_cab_target(cfgmgr32 1) +add_cd_file(TARGET cfgmgr32 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/clusapi/CMakeLists.txt b/dll/win32/clusapi/CMakeLists.txt index 44bf9c54503..c80015b6efb 100644 --- a/dll/win32/clusapi/CMakeLists.txt +++ b/dll/win32/clusapi/CMakeLists.txt @@ -19,4 +19,4 @@ target_link_libraries(clusapi wine) add_importlibs(clusapi msvcrt kernel32 ntdll) -add_cab_target(clusapi 1) +add_cd_file(TARGET clusapi DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/comcat/CMakeLists.txt b/dll/win32/comcat/CMakeLists.txt index d4adb650ef5..29a60062079 100644 --- a/dll/win32/comcat/CMakeLists.txt +++ b/dll/win32/comcat/CMakeLists.txt @@ -22,4 +22,4 @@ target_link_libraries(comcat uuid wine) add_importlibs(comcat ole32 user32 advapi32 ntdll) add_dependencies(comcat psdk) -add_cab_target(comcat 1) +add_cd_file(TARGET comcat DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/comctl32/CMakeLists.txt b/dll/win32/comctl32/CMakeLists.txt index e45cc97322d..2bf968616b8 100644 --- a/dll/win32/comctl32/CMakeLists.txt +++ b/dll/win32/comctl32/CMakeLists.txt @@ -71,5 +71,5 @@ add_importlibs(comctl32 kernel32 ntdll) -add_cab_target(comctl32 1) +add_cd_file(TARGET comctl32 DESTINATION reactos/system32 FOR all) add_importlib_target(comctl32.spec) diff --git a/dll/win32/comctl32/comctl32_ros.diff b/dll/win32/comctl32/comctl32_ros.diff index 079c5972367..d15da082250 100644 --- a/dll/win32/comctl32/comctl32_ros.diff +++ b/dll/win32/comctl32/comctl32_ros.diff @@ -143,7 +143,15 @@ Index: listview.c =================================================================== --- listview.c (revision 51320) +++ listview.c (working copy) -@@ -1634,8 +1635,19 @@ +@@ -315,6 +315,7 @@ + COLORREF clrBk; + COLORREF clrText; + COLORREF clrTextBk; ++ BOOL bDefaultBkColor; + + /* font */ + HFONT hDefaultFont; +@@ -1635,8 +1636,19 @@ /* used to handle collapse main item column case */ static inline BOOL LISTVIEW_DrawFocusRect(const LISTVIEW_INFO *infoPtr, HDC hdc) { @@ -165,7 +173,7 @@ Index: listview.c } /* Listview invalidation functions: use _only_ these functions to invalidate */ -@@ -5041,7 +5053,11 @@ +@@ -5042,7 +5054,11 @@ /* Draw marquee rectangle if appropriate */ if (infoPtr->bMarqueeSelect) @@ -177,3 +185,65 @@ Index: listview.c if (cdmode & CDRF_NOTIFYPOSTPAINT) notify_postpaint(infoPtr, &nmlvcd); +@@ -7856,6 +7872,7 @@ + { + TRACE("(clrBk=%x)\n", clrBk); + ++ infoPtr->bDefaultBkColor = FALSE; + if(infoPtr->clrBk != clrBk) { + if (infoPtr->clrBk != CLR_NONE) DeleteObject(infoPtr->hBkBrush); + infoPtr->clrBk = clrBk; +@@ -9248,6 +9265,7 @@ + infoPtr->clrText = CLR_DEFAULT; + infoPtr->clrTextBk = CLR_DEFAULT; + LISTVIEW_SetBkColor(infoPtr, comctl32_color.clrWindow); ++ infoPtr->bDefaultBkColor = TRUE; + + /* set default values */ + infoPtr->nFocusedItem = -1; +@@ -11510,6 +11528,11 @@ + + case WM_SYSCOLORCHANGE: + COMCTL32_RefreshSysColors(); ++ if (infoPtr->bDefaultBkColor) ++ { ++ LISTVIEW_SetBkColor(infoPtr, comctl32_color.clrWindow); ++ infoPtr->bDefaultBkColor = TRUE; ++ } + return 0; + + /* case WM_TIMER: */ +Index: rebar.c +=================================================================== +--- rebar.c (revision 51320) ++++ rebar.c (working copy) +@@ -51,7 +51,6 @@ + * - WM_QUERYNEWPALETTE + * - WM_RBUTTONDOWN + * - WM_RBUTTONUP +- * - WM_SYSCOLORCHANGE + * - WM_VKEYTOITEM + * - WM_WININICHANGE + * Notifications: +@@ -2540,10 +2539,8 @@ + + /* initialize band */ + memset(lpBand, 0, sizeof(*lpBand)); +- lpBand->clrFore = infoPtr->clrText == CLR_NONE ? infoPtr->clrBtnText : +- infoPtr->clrText; +- lpBand->clrBack = infoPtr->clrBk == CLR_NONE ? infoPtr->clrBtnFace : +- infoPtr->clrBk; ++ lpBand->clrFore = infoPtr->clrText; ++ lpBand->clrBack = infoPtr->clrBk; + lpBand->iImage = -1; + + REBAR_CommonSetupBand(infoPtr->hwndSelf, lprbbi, lpBand); +@@ -3793,6 +3790,8 @@ + + case WM_SYSCOLORCHANGE: + COMCTL32_RefreshSysColors(); ++ infoPtr->clrBtnText = comctl32_color.clrBtnText; ++ infoPtr->clrBtnFace = comctl32_color.clrBtnFace; + return 0; + + /* case WM_VKEYTOITEM: supported according to ControlSpy */ diff --git a/dll/win32/comctl32/listview.c b/dll/win32/comctl32/listview.c index d545044ad86..d6da12d5a0a 100644 --- a/dll/win32/comctl32/listview.c +++ b/dll/win32/comctl32/listview.c @@ -315,6 +315,7 @@ typedef struct tagLISTVIEW_INFO COLORREF clrBk; COLORREF clrText; COLORREF clrTextBk; + BOOL bDefaultBkColor; /* font */ HFONT hDefaultFont; @@ -7871,6 +7872,7 @@ static BOOL LISTVIEW_SetBkColor(LISTVIEW_INFO *infoPtr, COLORREF clrBk) { TRACE("(clrBk=%x)\n", clrBk); + infoPtr->bDefaultBkColor = FALSE; if(infoPtr->clrBk != clrBk) { if (infoPtr->clrBk != CLR_NONE) DeleteObject(infoPtr->hBkBrush); infoPtr->clrBk = clrBk; @@ -9263,6 +9265,7 @@ static LRESULT LISTVIEW_NCCreate(HWND hwnd, const CREATESTRUCTW *lpcs) infoPtr->clrText = CLR_DEFAULT; infoPtr->clrTextBk = CLR_DEFAULT; LISTVIEW_SetBkColor(infoPtr, comctl32_color.clrWindow); + infoPtr->bDefaultBkColor = TRUE; /* set default values */ infoPtr->nFocusedItem = -1; @@ -11525,6 +11528,11 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_SYSCOLORCHANGE: COMCTL32_RefreshSysColors(); + if (infoPtr->bDefaultBkColor) + { + LISTVIEW_SetBkColor(infoPtr, comctl32_color.clrWindow); + infoPtr->bDefaultBkColor = TRUE; + } return 0; /* case WM_TIMER: */ diff --git a/dll/win32/comctl32/rebar.c b/dll/win32/comctl32/rebar.c index 8e9c38b7a79..d5771064883 100644 --- a/dll/win32/comctl32/rebar.c +++ b/dll/win32/comctl32/rebar.c @@ -51,7 +51,6 @@ * - WM_QUERYNEWPALETTE * - WM_RBUTTONDOWN * - WM_RBUTTONUP - * - WM_SYSCOLORCHANGE * - WM_VKEYTOITEM * - WM_WININICHANGE * Notifications: @@ -1524,9 +1523,10 @@ REBAR_SizeToHeight(REBAR_INFO *infoPtr, int height) for (i = prev_visible(infoPtr, infoPtr->uNumBands); i > 0; i = prev_visible(infoPtr, i)) { REBAR_BAND *lpBand = REBAR_GetBand(infoPtr, i); - int height = lpBand->rcBand.bottom - lpBand->rcBand.top; int cyBreakExtra; /* additional cy for the rebar after a RBBS_BREAK on this band */ + height = lpBand->rcBand.bottom - lpBand->rcBand.top; + if (infoPtr->dwStyle & RBS_VARHEIGHT) cyBreakExtra = lpBand->cyRowSoFar; /* 'height' => 'lpBand->cyRowSoFar' + 'height'*/ else @@ -1846,8 +1846,7 @@ REBAR_CommonSetupBand(HWND hwnd, const REBARBANDINFOW *lprbbi, REBAR_BAND *lpBan return uChanged; } -static LRESULT -REBAR_InternalEraseBkGnd (const REBAR_INFO *infoPtr, HDC hdc, const RECT *clip) +static LRESULT REBAR_EraseBkGnd (const REBAR_INFO *infoPtr, HDC hdc) /* Function: This erases the background rectangle by drawing */ /* each band with its background color (or the default) and */ /* draws each bands right separator if necessary. The row */ @@ -1950,14 +1949,10 @@ REBAR_InternalEraseBkGnd (const REBAR_INFO *infoPtr, HDC hdc, const RECT *clip) else { old = SetBkColor (hdc, new); - TRACE("%s background color=0x%06x, band (%d,%d)-(%d,%d), clip (%d,%d)-(%d,%d)\n", + TRACE("%s background color=0x%06x, band %s\n", (lpBand->clrBack == CLR_NONE) ? "none" : ((lpBand->clrBack == CLR_DEFAULT) ? "dft" : ""), - GetBkColor(hdc), - rcBand.left,rcBand.top, - rcBand.right,rcBand.bottom, - clip->left, clip->top, - clip->right, clip->bottom); + GetBkColor(hdc), wine_dbgstr_rect(&rcBand)); ExtTextOutW (hdc, 0, 0, ETO_OPAQUE, &rcBand, NULL, 0, 0); if (lpBand->clrBack != CLR_NONE) SetBkColor (hdc, old); @@ -2120,7 +2115,7 @@ REBAR_HandleUDDrag (REBAR_INFO *infoPtr, const POINT *ptsmove) REBAR_BAND *hitBand, *rowBeginBand; if(infoPtr->uNumBands <= 0) - ERR("There are no bands in this rebar"); + ERR("There are no bands in this rebar\n"); /* Up/down dragging can only occur when there is more than one * band in the rebar */ @@ -2544,10 +2539,8 @@ REBAR_InsertBandT(REBAR_INFO *infoPtr, INT iIndex, const REBARBANDINFOW *lprbbi, /* initialize band */ memset(lpBand, 0, sizeof(*lpBand)); - lpBand->clrFore = infoPtr->clrText == CLR_NONE ? infoPtr->clrBtnText : - infoPtr->clrText; - lpBand->clrBack = infoPtr->clrBk == CLR_NONE ? infoPtr->clrBtnFace : - infoPtr->clrBk; + lpBand->clrFore = infoPtr->clrText; + lpBand->clrBack = infoPtr->clrBk; lpBand->iImage = -1; REBAR_CommonSetupBand(infoPtr->hwndSelf, lprbbi, lpBand); @@ -3000,18 +2993,6 @@ REBAR_Destroy (REBAR_INFO *infoPtr) return 0; } - -static LRESULT -REBAR_EraseBkGnd (const REBAR_INFO *infoPtr, HDC hdc) -{ - RECT cliprect; - - if (GetClipBox ( hdc, &cliprect)) - return REBAR_InternalEraseBkGnd (infoPtr, hdc, &cliprect); - return 0; -} - - static LRESULT REBAR_GetFont (const REBAR_INFO *infoPtr) { @@ -3454,7 +3435,7 @@ REBAR_Paint (const REBAR_INFO *infoPtr, HDC hdc) TRACE("painting (%s)\n", wine_dbgstr_rect(&ps.rcPaint)); if (ps.fErase) { /* Erase area of paint if requested */ - REBAR_InternalEraseBkGnd (infoPtr, hdc, &ps.rcPaint); + REBAR_EraseBkGnd (infoPtr, hdc); } REBAR_Refresh (infoPtr, hdc); EndPaint (infoPtr->hwndSelf, &ps); @@ -3809,6 +3790,8 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_SYSCOLORCHANGE: COMCTL32_RefreshSysColors(); + infoPtr->clrBtnText = comctl32_color.clrBtnText; + infoPtr->clrBtnFace = comctl32_color.clrBtnFace; return 0; /* case WM_VKEYTOITEM: supported according to ControlSpy */ diff --git a/dll/win32/comdlg32/CMakeLists.txt b/dll/win32/comdlg32/CMakeLists.txt index 8d31d2d7748..83f46ae9056 100644 --- a/dll/win32/comdlg32/CMakeLists.txt +++ b/dll/win32/comdlg32/CMakeLists.txt @@ -42,5 +42,5 @@ add_importlibs(comdlg32 kernel32 ntdll) -add_cab_target(comdlg32 1) +add_cd_file(TARGET comdlg32 DESTINATION reactos/system32 FOR all) add_importlib_target(comdlg32.spec) diff --git a/dll/win32/compstui/CMakeLists.txt b/dll/win32/compstui/CMakeLists.txt index ed89e613ebd..c4fbafa2238 100644 --- a/dll/win32/compstui/CMakeLists.txt +++ b/dll/win32/compstui/CMakeLists.txt @@ -16,5 +16,5 @@ set_module_type(compstui win32dll) target_link_libraries(compstui wine) add_importlibs(compstui msvcrt kernel32 ntdll) -add_cab_target(compstui 1) +add_cd_file(TARGET compstui DESTINATION reactos/system32 FOR all) add_importlib_target(compstui.spec) diff --git a/dll/win32/credui/CMakeLists.txt b/dll/win32/credui/CMakeLists.txt index 92dfdb7134d..aa4783407c0 100644 --- a/dll/win32/credui/CMakeLists.txt +++ b/dll/win32/credui/CMakeLists.txt @@ -21,4 +21,4 @@ target_link_libraries(credui wine) add_importlibs(credui advapi32 user32 comctl32 msvcrt kernel32 ntdll) add_importlib_target(credui.spec) -add_cab_target(credui 1) +add_cd_file(TARGET credui DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/crtdll/CMakeLists.txt b/dll/win32/crtdll/CMakeLists.txt index f5f345c1b7b..f81cb48dc2f 100644 --- a/dll/win32/crtdll/CMakeLists.txt +++ b/dll/win32/crtdll/CMakeLists.txt @@ -32,4 +32,4 @@ target_link_libraries(crtdll add_importlibs(crtdll kernel32 ntdll) add_pch(crtdll ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE}) -add_cab_target(crtdll 1) +add_cd_file(TARGET crtdll DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/crypt32/CMakeLists.txt b/dll/win32/crypt32/CMakeLists.txt index 18c8f458417..c4492e3019e 100644 --- a/dll/win32/crypt32/CMakeLists.txt +++ b/dll/win32/crypt32/CMakeLists.txt @@ -55,5 +55,5 @@ target_link_libraries(crypt32 add_importlibs(crypt32 user32 advapi32 msvcrt kernel32 ntdll) -add_cab_target(crypt32 1) +add_cd_file(TARGET crypt32 DESTINATION reactos/system32 FOR all) add_importlib_target(crypt32.spec) diff --git a/dll/win32/cryptdlg/CMakeLists.txt b/dll/win32/cryptdlg/CMakeLists.txt index fe8f32b9ee5..8dc706b3603 100644 --- a/dll/win32/cryptdlg/CMakeLists.txt +++ b/dll/win32/cryptdlg/CMakeLists.txt @@ -28,4 +28,4 @@ add_importlibs(cryptdlg kernel32 ntdll) -add_cab_target(cryptdlg 1) +add_cd_file(TARGET cryptdlg DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/cryptdll/CMakeLists.txt b/dll/win32/cryptdll/CMakeLists.txt index bf100e582c5..8aa68a88bcc 100644 --- a/dll/win32/cryptdll/CMakeLists.txt +++ b/dll/win32/cryptdll/CMakeLists.txt @@ -15,4 +15,4 @@ add_library(cryptdll SHARED ${SOURCE}) set_module_type(cryptdll win32dll) target_link_libraries(cryptdll wine) add_importlibs(cryptdll advapi32 msvcrt kernel32 ntdll) -add_cab_target(cryptdll 1) +add_cd_file(TARGET cryptdll DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/cryptnet/CMakeLists.txt b/dll/win32/cryptnet/CMakeLists.txt index 79ba8dd3a8f..51200f6a14f 100644 --- a/dll/win32/cryptnet/CMakeLists.txt +++ b/dll/win32/cryptnet/CMakeLists.txt @@ -23,4 +23,4 @@ add_importlibs(cryptnet ntdll) add_importlib_target(cryptnet.spec) -add_cab_target(cryptnet 1) +add_cd_file(TARGET cryptnet DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/cryptui/CMakeLists.txt b/dll/win32/cryptui/CMakeLists.txt index 07cc7f8d19c..17682b820a3 100644 --- a/dll/win32/cryptui/CMakeLists.txt +++ b/dll/win32/cryptui/CMakeLists.txt @@ -36,4 +36,4 @@ add_importlibs(cryptui ntdll) add_importlib_target(cryptui.spec) -add_cab_target(cryptui 1) +add_cd_file(TARGET cryptui DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/dbghelp/CMakeLists.txt b/dll/win32/dbghelp/CMakeLists.txt index ffb43a4eb64..4b1c073b8a8 100644 --- a/dll/win32/dbghelp/CMakeLists.txt +++ b/dll/win32/dbghelp/CMakeLists.txt @@ -57,4 +57,4 @@ target_link_libraries(dbghelp add_importlibs(dbghelp psapi version msvcrt kernel32 ntdll) add_importlib_target(dbghelp.spec) -add_cab_target(dbghelp 1) +add_cd_file(TARGET dbghelp DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/dciman32/CMakeLists.txt b/dll/win32/dciman32/CMakeLists.txt index 9af2a57a5f3..038d75a7356 100644 --- a/dll/win32/dciman32/CMakeLists.txt +++ b/dll/win32/dciman32/CMakeLists.txt @@ -17,4 +17,4 @@ add_library(dciman32 SHARED ${SOURCE}) set_module_type(dciman32 win32dll) target_link_libraries(dciman32 wine) add_importlibs(dciman32 msvcrt kernel32 ntdll) -add_cab_target(dciman32 1) +add_cd_file(TARGET dciman32 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/devmgr/CMakeLists.txt b/dll/win32/devmgr/CMakeLists.txt index 6feb5bfca9d..024f8df3f2a 100644 --- a/dll/win32/devmgr/CMakeLists.txt +++ b/dll/win32/devmgr/CMakeLists.txt @@ -31,5 +31,5 @@ add_importlibs(devmgr add_pch(devmgr ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE}) -add_cab_target(devmgr 1) +add_cd_file(TARGET devmgr DESTINATION reactos/system32 FOR all) add_importlib_target(devmgr.spec) diff --git a/dll/win32/dhcpcsvc/CMakeLists.txt b/dll/win32/dhcpcsvc/CMakeLists.txt index a76c067bcd9..1d2323ab522 100644 --- a/dll/win32/dhcpcsvc/CMakeLists.txt +++ b/dll/win32/dhcpcsvc/CMakeLists.txt @@ -34,4 +34,4 @@ add_importlib_target(dhcpcsvc.spec) add_pch(dhcpcsvc ${CMAKE_CURRENT_SOURCE_DIR}/include/rosdhcp.h ${SOURCE}) -add_cab_target(dhcpcsvc 1) +add_cd_file(TARGET dhcpcsvc DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/dnsapi/CMakeLists.txt b/dll/win32/dnsapi/CMakeLists.txt index 437a781c91e..fbd465929de 100644 --- a/dll/win32/dnsapi/CMakeLists.txt +++ b/dll/win32/dnsapi/CMakeLists.txt @@ -35,5 +35,5 @@ endif() add_importlibs(dnsapi user32 ws2_32 iphlpapi msvcrt kernel32 ntdll) add_pch(dnsapi ${CMAKE_CURRENT_SOURCE_DIR}/dnsapi/precomp.h ${SOURCE}) add_dependencies(dnsapi psdk) -add_cab_target(dnsapi 1) +add_cd_file(TARGET dnsapi DESTINATION reactos/system32 FOR all) add_importlib_target(dnsapi.spec) diff --git a/dll/win32/dwmapi/CMakeLists.txt b/dll/win32/dwmapi/CMakeLists.txt index 5623a82a6f1..5f775cf2f77 100644 --- a/dll/win32/dwmapi/CMakeLists.txt +++ b/dll/win32/dwmapi/CMakeLists.txt @@ -18,4 +18,4 @@ add_library(dwmapi SHARED ${SOURCE}) set_module_type(dwmapi win32dll) target_link_libraries(dwmapi wine) add_importlibs(dwmapi msvcrt kernel32 ntdll) -add_cab_target(dwmapi 1) +add_cd_file(TARGET dwmapi DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/faultrep/CMakeLists.txt b/dll/win32/faultrep/CMakeLists.txt index b1f8499a666..38147a4ce28 100644 --- a/dll/win32/faultrep/CMakeLists.txt +++ b/dll/win32/faultrep/CMakeLists.txt @@ -17,4 +17,4 @@ add_library(faultrep SHARED ${SOURCE}) set_module_type(faultrep win32dll) target_link_libraries(faultrep wine) add_importlibs(faultrep advapi32 msvcrt kernel32 ntdll) -add_cab_target(faultrep 1) +add_cd_file(TARGET faultrep DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/fmifs/CMakeLists.txt b/dll/win32/fmifs/CMakeLists.txt index d54ef13ea65..6595fcaf519 100644 --- a/dll/win32/fmifs/CMakeLists.txt +++ b/dll/win32/fmifs/CMakeLists.txt @@ -21,5 +21,5 @@ set_entrypoint(fmifs InitializeFmIfs@12) add_importlibs(fmifs kernel32 ntdll) add_dependencies(fmifs psdk) -add_cab_target(fmifs 1) +add_cd_file(TARGET fmifs DESTINATION reactos/system32 FOR all) add_importlib_target(fmifs.spec) diff --git a/dll/win32/fusion/CMakeLists.txt b/dll/win32/fusion/CMakeLists.txt index 6d995a51e76..fc43e3f7bb2 100644 --- a/dll/win32/fusion/CMakeLists.txt +++ b/dll/win32/fusion/CMakeLists.txt @@ -22,4 +22,4 @@ add_library(fusion SHARED ${SOURCE}) set_module_type(fusion win32dll) target_link_libraries(fusion wine uuid) add_importlibs(fusion shlwapi advapi32 dbghelp user32 msvcrt kernel32 ntdll) -add_cab_target(fusion 1) +add_cd_file(TARGET fusion DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/gdi32/CMakeLists.txt b/dll/win32/gdi32/CMakeLists.txt index d5409c672ab..3f679a14dfa 100644 --- a/dll/win32/gdi32/CMakeLists.txt +++ b/dll/win32/gdi32/CMakeLists.txt @@ -60,5 +60,5 @@ target_link_libraries(gdi32 add_importlibs(gdi32 user32 advapi32 msvcrt kernel32 ntdll) add_pch(gdi32 ${CMAKE_CURRENT_SOURCE_DIR}/include/precomp.h ${SOURCE}) -add_cab_target(gdi32 1) +add_cd_file(TARGET gdi32 DESTINATION reactos/system32 FOR all) add_importlib_target(gdi32.spec) diff --git a/dll/win32/gdiplus/CMakeLists.txt b/dll/win32/gdiplus/CMakeLists.txt index 339345da0a9..696628e6114 100644 --- a/dll/win32/gdiplus/CMakeLists.txt +++ b/dll/win32/gdiplus/CMakeLists.txt @@ -51,4 +51,4 @@ if(ARCH MATCHES amd64) target_link_libraries(gdiplus crt) endif(ARCH MATCHES amd64) -add_cab_target(gdiplus 1) +add_cd_file(TARGET gdiplus DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/getuname/CMakeLists.txt b/dll/win32/getuname/CMakeLists.txt index 17b0539f533..c0b1308b3e2 100644 --- a/dll/win32/getuname/CMakeLists.txt +++ b/dll/win32/getuname/CMakeLists.txt @@ -13,4 +13,4 @@ add_library(getuname SHARED add_importlib_target(getuname.spec) set_module_type(getuname win32dll) add_importlibs(getuname msvcrt kernel32 ntdll) -add_cab_target(getuname 1) +add_cd_file(TARGET getuname DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/glu32/CMakeLists.txt b/dll/win32/glu32/CMakeLists.txt index 8354edae60e..0013b2d1af0 100644 --- a/dll/win32/glu32/CMakeLists.txt +++ b/dll/win32/glu32/CMakeLists.txt @@ -120,5 +120,5 @@ add_importlibs(glu32 kernel32 ntdll) -add_cab_target(glu32 1) +add_cd_file(TARGET glu32 DESTINATION reactos/system32 FOR all) add_importlib_target(glu32.spec) diff --git a/dll/win32/hhctrl.ocx/CMakeLists.txt b/dll/win32/hhctrl.ocx/CMakeLists.txt index 7c1d697e676..814b5c4fe05 100644 --- a/dll/win32/hhctrl.ocx/CMakeLists.txt +++ b/dll/win32/hhctrl.ocx/CMakeLists.txt @@ -38,4 +38,4 @@ add_importlibs(hhctrl kernel32 ntdll) -add_cab_target(hhctrl 1) +add_cd_file(TARGET hhctrl DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/hid/CMakeLists.txt b/dll/win32/hid/CMakeLists.txt index 8a22b0a86a7..646fe86a22a 100644 --- a/dll/win32/hid/CMakeLists.txt +++ b/dll/win32/hid/CMakeLists.txt @@ -17,4 +17,4 @@ set_module_type(hid win32dll) add_importlibs(hid msvcrt kernel32 ntdll) add_pch(hid ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE}) -add_cab_target(hid 1) +add_cd_file(TARGET hid DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/hlink/CMakeLists.txt b/dll/win32/hlink/CMakeLists.txt index e3d8d3f1b4d..4229f6dccb6 100644 --- a/dll/win32/hlink/CMakeLists.txt +++ b/dll/win32/hlink/CMakeLists.txt @@ -28,4 +28,4 @@ add_importlibs(hlink ntdll) add_importlib_target(hlink.spec) -add_cab_target(hlink 1) +add_cd_file(TARGET hlink DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/hnetcfg/CMakeLists.txt b/dll/win32/hnetcfg/CMakeLists.txt index 0be671c5b71..4f18dd6c391 100644 --- a/dll/win32/hnetcfg/CMakeLists.txt +++ b/dll/win32/hnetcfg/CMakeLists.txt @@ -32,4 +32,4 @@ add_importlibs(hnetcfg kernel32 ntdll) -add_cab_target(hnetcfg 1) +add_cd_file(TARGET hnetcfg DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/httpapi/CMakeLists.txt b/dll/win32/httpapi/CMakeLists.txt index c9c51a059ca..70e942e8ca9 100644 --- a/dll/win32/httpapi/CMakeLists.txt +++ b/dll/win32/httpapi/CMakeLists.txt @@ -15,4 +15,4 @@ add_library(httpapi SHARED ${SOURCE}) set_module_type(httpapi win32dll) target_link_libraries(httpapi wine) add_importlibs(httpapi msvcrt kernel32 ntdll) -add_cab_target(httpapi 1) +add_cd_file(TARGET httpapi DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/iccvid/CMakeLists.txt b/dll/win32/iccvid/CMakeLists.txt index f8f73e520aa..736e776272f 100644 --- a/dll/win32/iccvid/CMakeLists.txt +++ b/dll/win32/iccvid/CMakeLists.txt @@ -17,4 +17,4 @@ add_library(iccvid SHARED ${SOURCE}) set_module_type(iccvid win32dll) target_link_libraries(iccvid wine) add_importlibs(iccvid user32 msvcrt kernel32 ntdll) -add_cab_target(iccvid 1) +add_cd_file(TARGET iccvid DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/icmp/CMakeLists.txt b/dll/win32/icmp/CMakeLists.txt index 1ddcd636617..da27f38a60c 100644 --- a/dll/win32/icmp/CMakeLists.txt +++ b/dll/win32/icmp/CMakeLists.txt @@ -18,4 +18,4 @@ set_module_type(icmp win32dll) target_link_libraries(icmp wine) add_importlibs(icmp ws2_32 msvcrt kernel32 ntdll) add_importlib_target(icmp.spec) -add_cab_target(icmp 1) +add_cd_file(TARGET icmp DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/imaadp32.acm/CMakeLists.txt b/dll/win32/imaadp32.acm/CMakeLists.txt index 3679cae46cb..3693cd025ad 100644 --- a/dll/win32/imaadp32.acm/CMakeLists.txt +++ b/dll/win32/imaadp32.acm/CMakeLists.txt @@ -20,4 +20,4 @@ target_link_libraries(imaadp32.acm wine) add_importlibs(imaadp32.acm winmm user32 msvcrt kernel32 ntdll) add_dependencies(imaadp32.acm psdk) -add_cab_target(imaadp32.acm 1) +add_cd_file(TARGET imaadp32.acm DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/imagehlp/CMakeLists.txt b/dll/win32/imagehlp/CMakeLists.txt index a303c3ae569..d14eed603e5 100644 --- a/dll/win32/imagehlp/CMakeLists.txt +++ b/dll/win32/imagehlp/CMakeLists.txt @@ -29,4 +29,4 @@ add_importlib_target(imagehlp.spec) add_pch(imagehlp ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE}) -add_cab_target(imagehlp 1) +add_cd_file(TARGET imagehlp DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/imm32/CMakeLists.txt b/dll/win32/imm32/CMakeLists.txt index d4a3e79e054..dfdd313b82f 100644 --- a/dll/win32/imm32/CMakeLists.txt +++ b/dll/win32/imm32/CMakeLists.txt @@ -25,5 +25,5 @@ add_library(imm32 SHARED ${SOURCE}) set_module_type(imm32 win32dll) target_link_libraries(imm32 wine) add_importlibs(imm32 advapi32 user32 msvcrt kernel32 ntdll) -add_cab_target(imm32 1) +add_cd_file(TARGET imm32 DESTINATION reactos/system32 FOR all) add_importlib_target(imm32.spec) diff --git a/dll/win32/inetcomm/CMakeLists.txt b/dll/win32/inetcomm/CMakeLists.txt index 20b0af6c97d..0e0a1c7d589 100644 --- a/dll/win32/inetcomm/CMakeLists.txt +++ b/dll/win32/inetcomm/CMakeLists.txt @@ -37,4 +37,4 @@ add_importlibs(inetcomm ntdll) add_importlib_target(inetcomm.spec) -add_cab_target(inetcomm 1) +add_cd_file(TARGET inetcomm DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/inetmib1/CMakeLists.txt b/dll/win32/inetmib1/CMakeLists.txt index bd7a6732a6b..ac98360c7ea 100644 --- a/dll/win32/inetmib1/CMakeLists.txt +++ b/dll/win32/inetmib1/CMakeLists.txt @@ -25,4 +25,4 @@ add_importlibs(inetmib1 kernel32 ntdll) -add_cab_target(inetmib1 1) +add_cd_file(TARGET inetmib1 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/initpki/CMakeLists.txt b/dll/win32/initpki/CMakeLists.txt index 4b629eba47e..6133df72d0c 100644 --- a/dll/win32/initpki/CMakeLists.txt +++ b/dll/win32/initpki/CMakeLists.txt @@ -15,4 +15,4 @@ add_library(initpki SHARED ${SOURCE}) set_module_type(initpki win32dll) target_link_libraries(initpki wine) add_importlibs(initpki msvcrt kernel32 ntdll) -add_cab_target(initpki 1) +add_cd_file(TARGET initpki DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/inseng/CMakeLists.txt b/dll/win32/inseng/CMakeLists.txt index 757f87284da..69a69917248 100644 --- a/dll/win32/inseng/CMakeLists.txt +++ b/dll/win32/inseng/CMakeLists.txt @@ -27,4 +27,4 @@ add_importlibs(inseng kernel32 ntdll) -add_cab_target(inseng 1) +add_cd_file(TARGET inseng DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/iphlpapi/CMakeLists.txt b/dll/win32/iphlpapi/CMakeLists.txt index e9293a5591b..8bc6ca2132e 100644 --- a/dll/win32/iphlpapi/CMakeLists.txt +++ b/dll/win32/iphlpapi/CMakeLists.txt @@ -29,5 +29,5 @@ set_module_type(iphlpapi win32dll) target_link_libraries(iphlpapi wine tdilib) add_importlibs(iphlpapi dhcpcsvc advapi32 ws2_32 msvcrt kernel32 ntdll) -add_cab_target(iphlpapi 1) +add_cd_file(TARGET iphlpapi DESTINATION reactos/system32 FOR all) add_importlib_target(iphlpapi.spec) diff --git a/dll/win32/itircl/CMakeLists.txt b/dll/win32/itircl/CMakeLists.txt index c620b47d26b..57cc803e403 100644 --- a/dll/win32/itircl/CMakeLists.txt +++ b/dll/win32/itircl/CMakeLists.txt @@ -17,4 +17,4 @@ target_link_libraries(itircl wine) add_importlibs(itircl msvcrt kernel32 ntdll) add_dependencies(itircl psdk) -add_cab_target(itircl 1) +add_cd_file(TARGET itircl DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/itss/CMakeLists.txt b/dll/win32/itss/CMakeLists.txt index ebbd5fc470f..fd53de89a2b 100644 --- a/dll/win32/itss/CMakeLists.txt +++ b/dll/win32/itss/CMakeLists.txt @@ -36,4 +36,4 @@ add_importlibs(itss ntdll) add_dependencies(itss wineheaders) -add_cab_target(itss 1) +add_cd_file(TARGET itss DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/jscript/CMakeLists.txt b/dll/win32/jscript/CMakeLists.txt index b4e56d0e70b..08d53fc21e4 100644 --- a/dll/win32/jscript/CMakeLists.txt +++ b/dll/win32/jscript/CMakeLists.txt @@ -61,4 +61,4 @@ add_importlibs(jscript ntdll) add_dependencies(jscript jsglobal) -add_cab_target(jscript 1) +add_cd_file(TARGET jscript DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/kernel32/CMakeLists.txt b/dll/win32/kernel32/CMakeLists.txt index e2c8cc7f4e5..e94f5134b7d 100644 --- a/dll/win32/kernel32/CMakeLists.txt +++ b/dll/win32/kernel32/CMakeLists.txt @@ -121,5 +121,5 @@ target_link_libraries(kernel32 ${PSEH_LIB}) add_importlibs(kernel32 ntdll) add_pch(kernel32 ${CMAKE_CURRENT_SOURCE_DIR}/k32.h ${SOURCE}) add_dependencies(kernel32 psdk errcodes asm) -add_cab_target(kernel32 1) +add_cd_file(TARGET kernel32 DESTINATION reactos/system32 FOR all) add_importlib_target(kernel32.spec) diff --git a/dll/win32/kernel32/file/volume.c b/dll/win32/kernel32/file/volume.c index 0e336661a6b..1f64e0bbc79 100644 --- a/dll/win32/kernel32/file/volume.c +++ b/dll/win32/kernel32/file/volume.c @@ -29,41 +29,41 @@ DEBUG_CHANNEL(kernel32file); static HANDLE InternalOpenDirW(LPCWSTR DirName, - BOOLEAN Write) + BOOLEAN Write) { - UNICODE_STRING NtPathU; - OBJECT_ATTRIBUTES ObjectAttributes; - NTSTATUS errCode; - IO_STATUS_BLOCK IoStatusBlock; - HANDLE hFile; + UNICODE_STRING NtPathU; + OBJECT_ATTRIBUTES ObjectAttributes; + NTSTATUS errCode; + IO_STATUS_BLOCK IoStatusBlock; + HANDLE hFile; - if (!RtlDosPathNameToNtPathName_U(DirName, - &NtPathU, - NULL, - NULL)) + if (!RtlDosPathNameToNtPathName_U(DirName, + &NtPathU, + NULL, + NULL)) { - WARN("Invalid path\n"); - SetLastError(ERROR_BAD_PATHNAME); - return INVALID_HANDLE_VALUE; + WARN("Invalid path\n"); + SetLastError(ERROR_BAD_PATHNAME); + return INVALID_HANDLE_VALUE; } InitializeObjectAttributes(&ObjectAttributes, - &NtPathU, - OBJ_CASE_INSENSITIVE, - NULL, - NULL); + &NtPathU, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); errCode = NtCreateFile (&hFile, - Write ? FILE_GENERIC_WRITE : FILE_GENERIC_READ, - &ObjectAttributes, - &IoStatusBlock, - NULL, - 0, - FILE_SHARE_READ|FILE_SHARE_WRITE, - FILE_OPEN, - 0, - NULL, - 0); + Write ? FILE_GENERIC_WRITE : FILE_GENERIC_READ, + &ObjectAttributes, + &IoStatusBlock, + NULL, + 0, + FILE_SHARE_READ|FILE_SHARE_WRITE, + FILE_OPEN, + 0, + NULL, + 0); RtlFreeHeap(RtlGetProcessHeap(), 0, @@ -71,8 +71,8 @@ InternalOpenDirW(LPCWSTR DirName, if (!NT_SUCCESS(errCode)) { - SetLastErrorByStatus (errCode); - return INVALID_HANDLE_VALUE; + SetLastErrorByStatus (errCode); + return INVALID_HANDLE_VALUE; } return hFile; } @@ -84,34 +84,34 @@ InternalOpenDirW(LPCWSTR DirName, /* Synced to Wine-2008/12/28 */ DWORD WINAPI GetLogicalDriveStringsA(DWORD nBufferLength, - LPSTR lpBuffer) + LPSTR lpBuffer) { - DWORD drive, count; - DWORD dwDriveMap; - LPSTR p; + DWORD drive, count; + DWORD dwDriveMap; + LPSTR p; - dwDriveMap = GetLogicalDrives(); + dwDriveMap = GetLogicalDrives(); - for (drive = count = 0; drive < MAX_DOS_DRIVES; drive++) - { - if (dwDriveMap & (1< nBufferLength) return ((count * 4) + 1); + if ((count * 4) + 1 > nBufferLength) return ((count * 4) + 1); - p = lpBuffer; + p = lpBuffer; - for (drive = 0; drive < MAX_DOS_DRIVES; drive++) - if (dwDriveMap & (1< nBufferLength) return ((count * 4) + 1); @@ -161,24 +161,24 @@ GetLogicalDriveStringsW(DWORD nBufferLength, DWORD WINAPI GetLogicalDrives(VOID) { - NTSTATUS Status; - PROCESS_DEVICEMAP_INFORMATION ProcessDeviceMapInfo; + NTSTATUS Status; + PROCESS_DEVICEMAP_INFORMATION ProcessDeviceMapInfo; - /* Get the Device Map for this Process */ - Status = NtQueryInformationProcess(NtCurrentProcess(), - ProcessDeviceMap, - &ProcessDeviceMapInfo, - sizeof(ProcessDeviceMapInfo), - NULL); + /* Get the Device Map for this Process */ + Status = NtQueryInformationProcess(NtCurrentProcess(), + ProcessDeviceMap, + &ProcessDeviceMapInfo, + sizeof(ProcessDeviceMapInfo), + NULL); - /* Return the Drive Map */ - if (!NT_SUCCESS(Status)) - { - SetLastErrorByStatus(Status); - return 0; - } + /* Return the Drive Map */ + if (!NT_SUCCESS(Status)) + { + SetLastErrorByStatus(Status); + return 0; + } - return ProcessDeviceMapInfo.Query.DriveMap; + return ProcessDeviceMapInfo.Query.DriveMap; } @@ -187,26 +187,26 @@ GetLogicalDrives(VOID) */ BOOL WINAPI GetDiskFreeSpaceA ( - LPCSTR lpRootPathName, - LPDWORD lpSectorsPerCluster, - LPDWORD lpBytesPerSector, - LPDWORD lpNumberOfFreeClusters, - LPDWORD lpTotalNumberOfClusters - ) + LPCSTR lpRootPathName, + LPDWORD lpSectorsPerCluster, + LPDWORD lpBytesPerSector, + LPDWORD lpNumberOfFreeClusters, + LPDWORD lpTotalNumberOfClusters +) { - PWCHAR RootPathNameW=NULL; + PWCHAR RootPathNameW=NULL; - if (lpRootPathName) - { - if (!(RootPathNameW = FilenameA2W(lpRootPathName, FALSE))) - return FALSE; - } + if (lpRootPathName) + { + if (!(RootPathNameW = FilenameA2W(lpRootPathName, FALSE))) + return FALSE; + } - return GetDiskFreeSpaceW (RootPathNameW, - lpSectorsPerCluster, - lpBytesPerSector, - lpNumberOfFreeClusters, - lpTotalNumberOfClusters); + return GetDiskFreeSpaceW (RootPathNameW, + lpSectorsPerCluster, + lpBytesPerSector, + lpNumberOfFreeClusters, + lpTotalNumberOfClusters); } @@ -220,7 +220,7 @@ GetDiskFreeSpaceW( LPDWORD lpBytesPerSector, LPDWORD lpNumberOfFreeClusters, LPDWORD lpTotalNumberOfClusters - ) +) { FILE_FS_SIZE_INFORMATION FileFsSize; IO_STATUS_BLOCK IoStatusBlock; @@ -238,11 +238,11 @@ GetDiskFreeSpaceW( } RootPathName[3] = 0; - hFile = InternalOpenDirW(RootPathName, FALSE); - if (INVALID_HANDLE_VALUE == hFile) + hFile = InternalOpenDirW(RootPathName, FALSE); + if (INVALID_HANDLE_VALUE == hFile) { - SetLastError(ERROR_PATH_NOT_FOUND); - return FALSE; + SetLastError(ERROR_PATH_NOT_FOUND); + return FALSE; } errCode = NtQueryVolumeInformationFile(hFile, @@ -276,24 +276,24 @@ GetDiskFreeSpaceW( */ BOOL WINAPI GetDiskFreeSpaceExA ( - LPCSTR lpDirectoryName OPTIONAL, - PULARGE_INTEGER lpFreeBytesAvailableToCaller, - PULARGE_INTEGER lpTotalNumberOfBytes, - PULARGE_INTEGER lpTotalNumberOfFreeBytes - ) + LPCSTR lpDirectoryName OPTIONAL, + PULARGE_INTEGER lpFreeBytesAvailableToCaller, + PULARGE_INTEGER lpTotalNumberOfBytes, + PULARGE_INTEGER lpTotalNumberOfFreeBytes +) { - PWCHAR DirectoryNameW=NULL; + PWCHAR DirectoryNameW=NULL; - if (lpDirectoryName) - { - if (!(DirectoryNameW = FilenameA2W(lpDirectoryName, FALSE))) - return FALSE; - } + if (lpDirectoryName) + { + if (!(DirectoryNameW = FilenameA2W(lpDirectoryName, FALSE))) + return FALSE; + } - return GetDiskFreeSpaceExW (DirectoryNameW , - lpFreeBytesAvailableToCaller, - lpTotalNumberOfBytes, - lpTotalNumberOfFreeBytes); + return GetDiskFreeSpaceExW (DirectoryNameW , + lpFreeBytesAvailableToCaller, + lpTotalNumberOfBytes, + lpTotalNumberOfFreeBytes); } @@ -306,7 +306,7 @@ GetDiskFreeSpaceExW( PULARGE_INTEGER lpFreeBytesAvailableToCaller, PULARGE_INTEGER lpTotalNumberOfBytes, PULARGE_INTEGER lpTotalNumberOfFreeBytes - ) +) { union { @@ -417,12 +417,12 @@ GetDiskFreeSpaceExW( UINT WINAPI GetDriveTypeA(LPCSTR lpRootPathName) { - PWCHAR RootPathNameW; + PWCHAR RootPathNameW; - if (!(RootPathNameW = FilenameA2W(lpRootPathName, FALSE))) - return DRIVE_UNKNOWN; + if (!(RootPathNameW = FilenameA2W(lpRootPathName, FALSE))) + return DRIVE_UNKNOWN; - return GetDriveTypeW(RootPathNameW); + return GetDriveTypeW(RootPathNameW); } @@ -432,52 +432,105 @@ GetDriveTypeA(LPCSTR lpRootPathName) UINT WINAPI GetDriveTypeW(LPCWSTR lpRootPathName) { - FILE_FS_DEVICE_INFORMATION FileFsDevice; - IO_STATUS_BLOCK IoStatusBlock; + FILE_FS_DEVICE_INFORMATION FileFsDevice; + IO_STATUS_BLOCK IoStatusBlock; + HANDLE hFile; + NTSTATUS Status; + UNICODE_STRING NtPath; + OBJECT_ATTRIBUTES ObjectAttributes; + WCHAR Buffer[MAX_PATH+1]; - HANDLE hFile; - NTSTATUS errCode; + if (!lpRootPathName) + { + DWORD cBytes; - hFile = InternalOpenDirW(lpRootPathName, FALSE); - if (hFile == INVALID_HANDLE_VALUE) - { - return DRIVE_NO_ROOT_DIR; /* According to WINE regression tests */ - } - - errCode = NtQueryVolumeInformationFile (hFile, - &IoStatusBlock, - &FileFsDevice, - sizeof(FILE_FS_DEVICE_INFORMATION), - FileFsDeviceInformation); - if (!NT_SUCCESS(errCode)) - { - CloseHandle(hFile); - SetLastErrorByStatus (errCode); - return 0; - } - CloseHandle(hFile); - - switch (FileFsDevice.DeviceType) + /* Get current directory */ + cBytes = RtlGetCurrentDirectory_U(sizeof(Buffer), Buffer); + if(cBytes < sizeof(Buffer)) { - case FILE_DEVICE_CD_ROM: - case FILE_DEVICE_CD_ROM_FILE_SYSTEM: - return DRIVE_CDROM; - case FILE_DEVICE_VIRTUAL_DISK: - return DRIVE_RAMDISK; - case FILE_DEVICE_NETWORK_FILE_SYSTEM: - return DRIVE_REMOTE; - case FILE_DEVICE_DISK: - case FILE_DEVICE_DISK_FILE_SYSTEM: - if (FileFsDevice.Characteristics & FILE_REMOTE_DEVICE) - return DRIVE_REMOTE; - if (FileFsDevice.Characteristics & FILE_REMOVABLE_MEDIA) - return DRIVE_REMOVABLE; - return DRIVE_FIXED; - } + ASSERT(cBytes < MAX_PATH*sizeof(WCHAR)); + Buffer[cBytes/sizeof(WCHAR)] = L'\\'; + Buffer[cBytes/sizeof(WCHAR)+1] = L'\0'; + lpRootPathName = Buffer; + } /* else fail... should we allow longer current dirs? */ + } - ERR("Returning DRIVE_UNKNOWN for device type %d\n", FileFsDevice.DeviceType); + if (!RtlDosPathNameToNtPathName_U(lpRootPathName, &NtPath, NULL, NULL)) + { + WARN("Invalid path: %ls\n", lpRootPathName); + return DRIVE_NO_ROOT_DIR; + } - return DRIVE_UNKNOWN; + /* Path from RtlDosPathNameToNtPathName_U does not contain '/' and multiple '\\' in a row */ + if(!NtPath.Length || NtPath.Buffer[NtPath.Length/sizeof(WCHAR)-1] != L'\\') + { + /* Path must be ended by slash */ + WARN("Invalid path: %ls\n", NtPath.Buffer); + return DRIVE_NO_ROOT_DIR; + } + + /* Remove ending slash */ + NtPath.Length -= sizeof(WCHAR); + + InitializeObjectAttributes(&ObjectAttributes, + &NtPath, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); + + Status = NtCreateFile(&hFile, + FILE_GENERIC_READ, + &ObjectAttributes, + &IoStatusBlock, + NULL, + 0, + FILE_SHARE_READ|FILE_SHARE_WRITE, + FILE_OPEN, + 0, + NULL, + 0); + + RtlFreeUnicodeString(&NtPath); + + if (!NT_SUCCESS(Status)) + { + WARN("Invalid path: %ls\n", lpRootPathName); + return DRIVE_NO_ROOT_DIR; /* According to WINE regression tests */ + } + + Status = NtQueryVolumeInformationFile (hFile, + &IoStatusBlock, + &FileFsDevice, + sizeof(FILE_FS_DEVICE_INFORMATION), + FileFsDeviceInformation); + CloseHandle(hFile); + if (!NT_SUCCESS(Status)) + { + ERR("NtQueryVolumeInformationFile failed for %ls\n", lpRootPathName); + return DRIVE_UNKNOWN; + } + + switch (FileFsDevice.DeviceType) + { + case FILE_DEVICE_CD_ROM: + case FILE_DEVICE_CD_ROM_FILE_SYSTEM: + return DRIVE_CDROM; + case FILE_DEVICE_VIRTUAL_DISK: + return DRIVE_RAMDISK; + case FILE_DEVICE_NETWORK_FILE_SYSTEM: + return DRIVE_REMOTE; + case FILE_DEVICE_DISK: + case FILE_DEVICE_DISK_FILE_SYSTEM: + if (FileFsDevice.Characteristics & FILE_REMOTE_DEVICE) + return DRIVE_REMOTE; + if (FileFsDevice.Characteristics & FILE_REMOVABLE_MEDIA) + return DRIVE_REMOVABLE; + return DRIVE_FIXED; + } + + ERR("Returning DRIVE_UNKNOWN for device type %d\n", FileFsDevice.DeviceType); + + return DRIVE_UNKNOWN; } @@ -486,134 +539,134 @@ GetDriveTypeW(LPCWSTR lpRootPathName) */ BOOL WINAPI GetVolumeInformationA( - LPCSTR lpRootPathName, - LPSTR lpVolumeNameBuffer, - DWORD nVolumeNameSize, - LPDWORD lpVolumeSerialNumber, - LPDWORD lpMaximumComponentLength, - LPDWORD lpFileSystemFlags, - LPSTR lpFileSystemNameBuffer, - DWORD nFileSystemNameSize - ) + LPCSTR lpRootPathName, + LPSTR lpVolumeNameBuffer, + DWORD nVolumeNameSize, + LPDWORD lpVolumeSerialNumber, + LPDWORD lpMaximumComponentLength, + LPDWORD lpFileSystemFlags, + LPSTR lpFileSystemNameBuffer, + DWORD nFileSystemNameSize +) { - UNICODE_STRING FileSystemNameU; - UNICODE_STRING VolumeNameU = { 0, 0, NULL }; - ANSI_STRING VolumeName; - ANSI_STRING FileSystemName; - PWCHAR RootPathNameW; - BOOL Result; + UNICODE_STRING FileSystemNameU; + UNICODE_STRING VolumeNameU = { 0, 0, NULL }; + ANSI_STRING VolumeName; + ANSI_STRING FileSystemName; + PWCHAR RootPathNameW; + BOOL Result; - if (!(RootPathNameW = FilenameA2W(lpRootPathName, FALSE))) - return FALSE; + if (!(RootPathNameW = FilenameA2W(lpRootPathName, FALSE))) + return FALSE; - if (lpVolumeNameBuffer) + if (lpVolumeNameBuffer) { - VolumeNameU.MaximumLength = (USHORT)nVolumeNameSize * sizeof(WCHAR); - VolumeNameU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (), - 0, - VolumeNameU.MaximumLength); - if (VolumeNameU.Buffer == NULL) - { - goto FailNoMem; - } + VolumeNameU.MaximumLength = (USHORT)nVolumeNameSize * sizeof(WCHAR); + VolumeNameU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (), + 0, + VolumeNameU.MaximumLength); + if (VolumeNameU.Buffer == NULL) + { + goto FailNoMem; + } } - if (lpFileSystemNameBuffer) + if (lpFileSystemNameBuffer) { - FileSystemNameU.Length = 0; - FileSystemNameU.MaximumLength = (USHORT)nFileSystemNameSize * sizeof(WCHAR); - FileSystemNameU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (), - 0, - FileSystemNameU.MaximumLength); - if (FileSystemNameU.Buffer == NULL) - { - if (VolumeNameU.Buffer != NULL) - { - RtlFreeHeap(RtlGetProcessHeap(), - 0, - VolumeNameU.Buffer); - } + FileSystemNameU.Length = 0; + FileSystemNameU.MaximumLength = (USHORT)nFileSystemNameSize * sizeof(WCHAR); + FileSystemNameU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (), + 0, + FileSystemNameU.MaximumLength); + if (FileSystemNameU.Buffer == NULL) + { + if (VolumeNameU.Buffer != NULL) + { + RtlFreeHeap(RtlGetProcessHeap(), + 0, + VolumeNameU.Buffer); + } FailNoMem: - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return FALSE; - } + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } } - Result = GetVolumeInformationW (RootPathNameW, - lpVolumeNameBuffer ? VolumeNameU.Buffer : NULL, - nVolumeNameSize, - lpVolumeSerialNumber, - lpMaximumComponentLength, - lpFileSystemFlags, - lpFileSystemNameBuffer ? FileSystemNameU.Buffer : NULL, - nFileSystemNameSize); + Result = GetVolumeInformationW (RootPathNameW, + lpVolumeNameBuffer ? VolumeNameU.Buffer : NULL, + nVolumeNameSize, + lpVolumeSerialNumber, + lpMaximumComponentLength, + lpFileSystemFlags, + lpFileSystemNameBuffer ? FileSystemNameU.Buffer : NULL, + nFileSystemNameSize); - if (Result) + if (Result) { - if (lpVolumeNameBuffer) + if (lpVolumeNameBuffer) { - VolumeNameU.Length = wcslen(VolumeNameU.Buffer) * sizeof(WCHAR); - VolumeName.Length = 0; - VolumeName.MaximumLength = (USHORT)nVolumeNameSize; - VolumeName.Buffer = lpVolumeNameBuffer; - } + VolumeNameU.Length = wcslen(VolumeNameU.Buffer) * sizeof(WCHAR); + VolumeName.Length = 0; + VolumeName.MaximumLength = (USHORT)nVolumeNameSize; + VolumeName.Buffer = lpVolumeNameBuffer; + } - if (lpFileSystemNameBuffer) - { - FileSystemNameU.Length = wcslen(FileSystemNameU.Buffer) * sizeof(WCHAR); - FileSystemName.Length = 0; - FileSystemName.MaximumLength = (USHORT)nFileSystemNameSize; - FileSystemName.Buffer = lpFileSystemNameBuffer; - } + if (lpFileSystemNameBuffer) + { + FileSystemNameU.Length = wcslen(FileSystemNameU.Buffer) * sizeof(WCHAR); + FileSystemName.Length = 0; + FileSystemName.MaximumLength = (USHORT)nFileSystemNameSize; + FileSystemName.Buffer = lpFileSystemNameBuffer; + } - /* convert unicode strings to ansi (or oem) */ - if (bIsFileApiAnsi) + /* convert unicode strings to ansi (or oem) */ + if (bIsFileApiAnsi) { - if (lpVolumeNameBuffer) - { - RtlUnicodeStringToAnsiString (&VolumeName, - &VolumeNameU, - FALSE); - } - if (lpFileSystemNameBuffer) - { - RtlUnicodeStringToAnsiString (&FileSystemName, - &FileSystemNameU, - FALSE); - } - } - else + if (lpVolumeNameBuffer) + { + RtlUnicodeStringToAnsiString (&VolumeName, + &VolumeNameU, + FALSE); + } + if (lpFileSystemNameBuffer) + { + RtlUnicodeStringToAnsiString (&FileSystemName, + &FileSystemNameU, + FALSE); + } + } + else { - if (lpVolumeNameBuffer) - { - RtlUnicodeStringToOemString (&VolumeName, - &VolumeNameU, - FALSE); - } - if (lpFileSystemNameBuffer) - { - RtlUnicodeStringToOemString (&FileSystemName, - &FileSystemNameU, - FALSE); - } - } + if (lpVolumeNameBuffer) + { + RtlUnicodeStringToOemString (&VolumeName, + &VolumeNameU, + FALSE); + } + if (lpFileSystemNameBuffer) + { + RtlUnicodeStringToOemString (&FileSystemName, + &FileSystemNameU, + FALSE); + } + } } - if (lpVolumeNameBuffer) + if (lpVolumeNameBuffer) { - RtlFreeHeap (RtlGetProcessHeap (), - 0, - VolumeNameU.Buffer); + RtlFreeHeap (RtlGetProcessHeap (), + 0, + VolumeNameU.Buffer); } - if (lpFileSystemNameBuffer) + if (lpFileSystemNameBuffer) { - RtlFreeHeap (RtlGetProcessHeap (), - 0, - FileSystemNameU.Buffer); + RtlFreeHeap (RtlGetProcessHeap (), + 0, + FileSystemNameU.Buffer); } - return Result; + return Result; } #define FS_VOLUME_BUFFER_SIZE (MAX_PATH * sizeof(WCHAR) + sizeof(FILE_FS_VOLUME_INFORMATION)) @@ -633,106 +686,106 @@ GetVolumeInformationW( LPDWORD lpFileSystemFlags, LPWSTR lpFileSystemNameBuffer, DWORD nFileSystemNameSize - ) +) { - PFILE_FS_VOLUME_INFORMATION FileFsVolume; - PFILE_FS_ATTRIBUTE_INFORMATION FileFsAttribute; - IO_STATUS_BLOCK IoStatusBlock; - WCHAR RootPathName[MAX_PATH]; - UCHAR Buffer[max(FS_VOLUME_BUFFER_SIZE, FS_ATTRIBUTE_BUFFER_SIZE)]; + PFILE_FS_VOLUME_INFORMATION FileFsVolume; + PFILE_FS_ATTRIBUTE_INFORMATION FileFsAttribute; + IO_STATUS_BLOCK IoStatusBlock; + WCHAR RootPathName[MAX_PATH]; + UCHAR Buffer[max(FS_VOLUME_BUFFER_SIZE, FS_ATTRIBUTE_BUFFER_SIZE)]; - HANDLE hFile; - NTSTATUS errCode; + HANDLE hFile; + NTSTATUS errCode; - FileFsVolume = (PFILE_FS_VOLUME_INFORMATION)Buffer; - FileFsAttribute = (PFILE_FS_ATTRIBUTE_INFORMATION)Buffer; + FileFsVolume = (PFILE_FS_VOLUME_INFORMATION)Buffer; + FileFsAttribute = (PFILE_FS_ATTRIBUTE_INFORMATION)Buffer; - TRACE("FileFsVolume %p\n", FileFsVolume); - TRACE("FileFsAttribute %p\n", FileFsAttribute); + TRACE("FileFsVolume %p\n", FileFsVolume); + TRACE("FileFsAttribute %p\n", FileFsAttribute); - if (!lpRootPathName || !wcscmp(lpRootPathName, L"")) - { - GetCurrentDirectoryW (MAX_PATH, RootPathName); - } - else - { - wcsncpy (RootPathName, lpRootPathName, 3); - } - RootPathName[3] = 0; - - hFile = InternalOpenDirW(RootPathName, FALSE); - if (hFile == INVALID_HANDLE_VALUE) + if (!lpRootPathName || !wcscmp(lpRootPathName, L"")) { - return FALSE; + GetCurrentDirectoryW (MAX_PATH, RootPathName); + } + else + { + wcsncpy (RootPathName, lpRootPathName, 3); + } + RootPathName[3] = 0; + + hFile = InternalOpenDirW(RootPathName, FALSE); + if (hFile == INVALID_HANDLE_VALUE) + { + return FALSE; } - TRACE("hFile: %x\n", hFile); - errCode = NtQueryVolumeInformationFile(hFile, - &IoStatusBlock, - FileFsVolume, - FS_VOLUME_BUFFER_SIZE, - FileFsVolumeInformation); - if ( !NT_SUCCESS(errCode) ) + TRACE("hFile: %x\n", hFile); + errCode = NtQueryVolumeInformationFile(hFile, + &IoStatusBlock, + FileFsVolume, + FS_VOLUME_BUFFER_SIZE, + FileFsVolumeInformation); + if ( !NT_SUCCESS(errCode) ) { - WARN("Status: %x\n", errCode); - CloseHandle(hFile); - SetLastErrorByStatus (errCode); - return FALSE; + WARN("Status: %x\n", errCode); + CloseHandle(hFile); + SetLastErrorByStatus (errCode); + return FALSE; } - if (lpVolumeSerialNumber) - *lpVolumeSerialNumber = FileFsVolume->VolumeSerialNumber; + if (lpVolumeSerialNumber) + *lpVolumeSerialNumber = FileFsVolume->VolumeSerialNumber; - if (lpVolumeNameBuffer) + if (lpVolumeNameBuffer) { - if (nVolumeNameSize * sizeof(WCHAR) >= FileFsVolume->VolumeLabelLength + sizeof(WCHAR)) + if (nVolumeNameSize * sizeof(WCHAR) >= FileFsVolume->VolumeLabelLength + sizeof(WCHAR)) { - memcpy(lpVolumeNameBuffer, - FileFsVolume->VolumeLabel, - FileFsVolume->VolumeLabelLength); - lpVolumeNameBuffer[FileFsVolume->VolumeLabelLength / sizeof(WCHAR)] = 0; - } - else + memcpy(lpVolumeNameBuffer, + FileFsVolume->VolumeLabel, + FileFsVolume->VolumeLabelLength); + lpVolumeNameBuffer[FileFsVolume->VolumeLabelLength / sizeof(WCHAR)] = 0; + } + else { - CloseHandle(hFile); - SetLastError(ERROR_MORE_DATA); - return FALSE; - } + CloseHandle(hFile); + SetLastError(ERROR_MORE_DATA); + return FALSE; + } } - errCode = NtQueryVolumeInformationFile (hFile, - &IoStatusBlock, - FileFsAttribute, - FS_ATTRIBUTE_BUFFER_SIZE, - FileFsAttributeInformation); - CloseHandle(hFile); - if (!NT_SUCCESS(errCode)) + errCode = NtQueryVolumeInformationFile (hFile, + &IoStatusBlock, + FileFsAttribute, + FS_ATTRIBUTE_BUFFER_SIZE, + FileFsAttributeInformation); + CloseHandle(hFile); + if (!NT_SUCCESS(errCode)) { - WARN("Status: %x\n", errCode); - SetLastErrorByStatus (errCode); - return FALSE; + WARN("Status: %x\n", errCode); + SetLastErrorByStatus (errCode); + return FALSE; } - if (lpFileSystemFlags) - *lpFileSystemFlags = FileFsAttribute->FileSystemAttributes; - if (lpMaximumComponentLength) - *lpMaximumComponentLength = FileFsAttribute->MaximumComponentNameLength; - if (lpFileSystemNameBuffer) + if (lpFileSystemFlags) + *lpFileSystemFlags = FileFsAttribute->FileSystemAttributes; + if (lpMaximumComponentLength) + *lpMaximumComponentLength = FileFsAttribute->MaximumComponentNameLength; + if (lpFileSystemNameBuffer) { - if (nFileSystemNameSize * sizeof(WCHAR) >= FileFsAttribute->FileSystemNameLength + sizeof(WCHAR)) + if (nFileSystemNameSize * sizeof(WCHAR) >= FileFsAttribute->FileSystemNameLength + sizeof(WCHAR)) { - memcpy(lpFileSystemNameBuffer, - FileFsAttribute->FileSystemName, - FileFsAttribute->FileSystemNameLength); - lpFileSystemNameBuffer[FileFsAttribute->FileSystemNameLength / sizeof(WCHAR)] = 0; - } - else + memcpy(lpFileSystemNameBuffer, + FileFsAttribute->FileSystemName, + FileFsAttribute->FileSystemNameLength); + lpFileSystemNameBuffer[FileFsAttribute->FileSystemNameLength / sizeof(WCHAR)] = 0; + } + else { - SetLastError(ERROR_MORE_DATA); - return FALSE; - } + SetLastError(ERROR_MORE_DATA); + return FALSE; + } } - return TRUE; + return TRUE; } @@ -742,34 +795,34 @@ GetVolumeInformationW( BOOL WINAPI SetVolumeLabelA ( - LPCSTR lpRootPathName, - LPCSTR lpVolumeName /* NULL if deleting label */ - ) + LPCSTR lpRootPathName, + LPCSTR lpVolumeName /* NULL if deleting label */ +) { - PWCHAR RootPathNameW; - PWCHAR VolumeNameW = NULL; - BOOL Result; + PWCHAR RootPathNameW; + PWCHAR VolumeNameW = NULL; + BOOL Result; - if (!(RootPathNameW = FilenameA2W(lpRootPathName, FALSE))) - return FALSE; + if (!(RootPathNameW = FilenameA2W(lpRootPathName, FALSE))) + return FALSE; - if (lpVolumeName) - { - if (!(VolumeNameW = FilenameA2W(lpVolumeName, TRUE))) - return FALSE; - } + if (lpVolumeName) + { + if (!(VolumeNameW = FilenameA2W(lpVolumeName, TRUE))) + return FALSE; + } - Result = SetVolumeLabelW (RootPathNameW, - VolumeNameW); + Result = SetVolumeLabelW (RootPathNameW, + VolumeNameW); - if (VolumeNameW) - { - RtlFreeHeap (RtlGetProcessHeap (), - 0, - VolumeNameW ); - } + if (VolumeNameW) + { + RtlFreeHeap (RtlGetProcessHeap (), + 0, + VolumeNameW ); + } - return Result; + return Result; } @@ -778,61 +831,61 @@ SetVolumeLabelA ( */ BOOL WINAPI SetVolumeLabelW( - LPCWSTR lpRootPathName, - LPCWSTR lpVolumeName /* NULL if deleting label */ - ) + LPCWSTR lpRootPathName, + LPCWSTR lpVolumeName /* NULL if deleting label */ +) { - PFILE_FS_LABEL_INFORMATION LabelInfo; - IO_STATUS_BLOCK IoStatusBlock; - ULONG LabelLength; - HANDLE hFile; - NTSTATUS Status; + PFILE_FS_LABEL_INFORMATION LabelInfo; + IO_STATUS_BLOCK IoStatusBlock; + ULONG LabelLength; + HANDLE hFile; + NTSTATUS Status; - LabelLength = wcslen(lpVolumeName) * sizeof(WCHAR); - LabelInfo = RtlAllocateHeap(RtlGetProcessHeap(), - 0, - sizeof(FILE_FS_LABEL_INFORMATION) + - LabelLength); - if (LabelInfo == NULL) - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return FALSE; - } - LabelInfo->VolumeLabelLength = LabelLength; - memcpy(LabelInfo->VolumeLabel, - lpVolumeName, - LabelLength); - - hFile = InternalOpenDirW(lpRootPathName, TRUE); - if (INVALID_HANDLE_VALUE == hFile) - { - RtlFreeHeap(RtlGetProcessHeap(), - 0, - LabelInfo); + LabelLength = wcslen(lpVolumeName) * sizeof(WCHAR); + LabelInfo = RtlAllocateHeap(RtlGetProcessHeap(), + 0, + sizeof(FILE_FS_LABEL_INFORMATION) + + LabelLength); + if (LabelInfo == NULL) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); return FALSE; - } + } + LabelInfo->VolumeLabelLength = LabelLength; + memcpy(LabelInfo->VolumeLabel, + lpVolumeName, + LabelLength); - Status = NtSetVolumeInformationFile(hFile, - &IoStatusBlock, - LabelInfo, - sizeof(FILE_FS_LABEL_INFORMATION) + - LabelLength, - FileFsLabelInformation); + hFile = InternalOpenDirW(lpRootPathName, TRUE); + if (INVALID_HANDLE_VALUE == hFile) + { + RtlFreeHeap(RtlGetProcessHeap(), + 0, + LabelInfo); + return FALSE; + } - RtlFreeHeap(RtlGetProcessHeap(), - 0, - LabelInfo); + Status = NtSetVolumeInformationFile(hFile, + &IoStatusBlock, + LabelInfo, + sizeof(FILE_FS_LABEL_INFORMATION) + + LabelLength, + FileFsLabelInformation); - if (!NT_SUCCESS(Status)) - { - WARN("Status: %x\n", Status); - CloseHandle(hFile); - SetLastErrorByStatus(Status); - return FALSE; - } + RtlFreeHeap(RtlGetProcessHeap(), + 0, + LabelInfo); - CloseHandle(hFile); - return TRUE; + if (!NT_SUCCESS(Status)) + { + WARN("Status: %x\n", Status); + CloseHandle(hFile); + SetLastErrorByStatus(Status); + return FALSE; + } + + CloseHandle(hFile); + return TRUE; } /** @@ -856,217 +909,217 @@ SetVolumeLabelW( BOOL WINAPI GetVolumeNameForVolumeMountPointW( - IN LPCWSTR VolumeMountPoint, - OUT LPWSTR VolumeName, - IN DWORD VolumeNameLength) + IN LPCWSTR VolumeMountPoint, + OUT LPWSTR VolumeName, + IN DWORD VolumeNameLength) { - UNICODE_STRING NtFileName; - OBJECT_ATTRIBUTES ObjectAttributes; - HANDLE FileHandle; - IO_STATUS_BLOCK Iosb; - ULONG BufferLength; - PMOUNTDEV_NAME MountDevName; - PMOUNTMGR_MOUNT_POINT MountPoint; - ULONG MountPointSize; - PMOUNTMGR_MOUNT_POINTS MountPoints; - ULONG Index; - PUCHAR SymbolicLinkName; - BOOL Result; - NTSTATUS Status; + UNICODE_STRING NtFileName; + OBJECT_ATTRIBUTES ObjectAttributes; + HANDLE FileHandle; + IO_STATUS_BLOCK Iosb; + ULONG BufferLength; + PMOUNTDEV_NAME MountDevName; + PMOUNTMGR_MOUNT_POINT MountPoint; + ULONG MountPointSize; + PMOUNTMGR_MOUNT_POINTS MountPoints; + ULONG Index; + PUCHAR SymbolicLinkName; + BOOL Result; + NTSTATUS Status; - if (!VolumeMountPoint || !VolumeMountPoint[0]) - { - SetLastError(ERROR_PATH_NOT_FOUND); - return FALSE; - } + if (!VolumeMountPoint || !VolumeMountPoint[0]) + { + SetLastError(ERROR_PATH_NOT_FOUND); + return FALSE; + } - /* - * First step is to convert the passed volume mount point name to - * an NT acceptable name. - */ + /* + * First step is to convert the passed volume mount point name to + * an NT acceptable name. + */ - if (!RtlDosPathNameToNtPathName_U(VolumeMountPoint, &NtFileName, NULL, NULL)) - { - SetLastError(ERROR_PATH_NOT_FOUND); - return FALSE; - } + if (!RtlDosPathNameToNtPathName_U(VolumeMountPoint, &NtFileName, NULL, NULL)) + { + SetLastError(ERROR_PATH_NOT_FOUND); + return FALSE; + } - if (NtFileName.Length > sizeof(WCHAR) && - NtFileName.Buffer[(NtFileName.Length / sizeof(WCHAR)) - 1] == '\\') - { - NtFileName.Length -= sizeof(WCHAR); - } + if (NtFileName.Length > sizeof(WCHAR) && + NtFileName.Buffer[(NtFileName.Length / sizeof(WCHAR)) - 1] == '\\') + { + NtFileName.Length -= sizeof(WCHAR); + } - /* - * Query mount point device name which we will later use for determining - * the volume name. - */ + /* + * Query mount point device name which we will later use for determining + * the volume name. + */ - InitializeObjectAttributes(&ObjectAttributes, &NtFileName, 0, NULL, NULL); - Status = NtOpenFile(&FileHandle, FILE_READ_ATTRIBUTES | SYNCHRONIZE, - &ObjectAttributes, &Iosb, - FILE_SHARE_READ | FILE_SHARE_WRITE, - FILE_SYNCHRONOUS_IO_NONALERT); - RtlFreeUnicodeString(&NtFileName); - if (!NT_SUCCESS(Status)) - { - SetLastErrorByStatus(Status); - return FALSE; - } + InitializeObjectAttributes(&ObjectAttributes, &NtFileName, 0, NULL, NULL); + Status = NtOpenFile(&FileHandle, FILE_READ_ATTRIBUTES | SYNCHRONIZE, + &ObjectAttributes, &Iosb, + FILE_SHARE_READ | FILE_SHARE_WRITE, + FILE_SYNCHRONOUS_IO_NONALERT); + RtlFreeUnicodeString(&NtFileName); + if (!NT_SUCCESS(Status)) + { + SetLastErrorByStatus(Status); + return FALSE; + } - BufferLength = sizeof(MOUNTDEV_NAME) + 50 * sizeof(WCHAR); - do - { - MountDevName = RtlAllocateHeap(RtlGetProcessHeap(), 0, BufferLength); - if (MountDevName == NULL) - { - NtClose(FileHandle); - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return FALSE; - } - - Status = NtDeviceIoControlFile(FileHandle, NULL, NULL, NULL, &Iosb, - IOCTL_MOUNTDEV_QUERY_DEVICE_NAME, - NULL, 0, MountDevName, BufferLength); - if (!NT_SUCCESS(Status)) - { - RtlFreeHeap(GetProcessHeap(), 0, MountDevName); - if (Status == STATUS_BUFFER_OVERFLOW) - { - BufferLength = sizeof(MOUNTDEV_NAME) + MountDevName->NameLength; - continue; - } - else - { + BufferLength = sizeof(MOUNTDEV_NAME) + 50 * sizeof(WCHAR); + do + { + MountDevName = RtlAllocateHeap(RtlGetProcessHeap(), 0, BufferLength); + if (MountDevName == NULL) + { NtClose(FileHandle); - SetLastErrorByStatus(Status); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); return FALSE; - } - } - } - while (!NT_SUCCESS(Status)); + } - NtClose(FileHandle); - - /* - * Get the mount point information from mount manager. - */ - - MountPointSize = MountDevName->NameLength + sizeof(MOUNTMGR_MOUNT_POINT); - MountPoint = RtlAllocateHeap(GetProcessHeap(), 0, MountPointSize); - if (MountPoint == NULL) - { - RtlFreeHeap(GetProcessHeap(), 0, MountDevName); - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return FALSE; - } - RtlZeroMemory(MountPoint, sizeof(MOUNTMGR_MOUNT_POINT)); - MountPoint->DeviceNameOffset = sizeof(MOUNTMGR_MOUNT_POINT); - MountPoint->DeviceNameLength = MountDevName->NameLength; - RtlCopyMemory(MountPoint + 1, MountDevName->Name, MountDevName->NameLength); - RtlFreeHeap(RtlGetProcessHeap(), 0, MountDevName); - - RtlInitUnicodeString(&NtFileName, L"\\??\\MountPointManager"); - InitializeObjectAttributes(&ObjectAttributes, &NtFileName, 0, NULL, NULL); - Status = NtOpenFile(&FileHandle, FILE_GENERIC_READ | SYNCHRONIZE, &ObjectAttributes, - &Iosb, FILE_SHARE_READ | FILE_SHARE_WRITE, - FILE_SYNCHRONOUS_IO_NONALERT); - if (!NT_SUCCESS(Status)) - { - SetLastErrorByStatus(Status); - RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoint); - return FALSE; - } - - BufferLength = sizeof(MOUNTMGR_MOUNT_POINTS); - do - { - MountPoints = RtlAllocateHeap(RtlGetProcessHeap(), 0, BufferLength); - if (MountPoints == NULL) - { - RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoint); - NtClose(FileHandle); - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return FALSE; - } - - Status = NtDeviceIoControlFile(FileHandle, NULL, NULL, NULL, &Iosb, - IOCTL_MOUNTMGR_QUERY_POINTS, - MountPoint, MountPointSize, - MountPoints, BufferLength); - if (!NT_SUCCESS(Status)) - { - if (Status == STATUS_BUFFER_OVERFLOW) - { - BufferLength = MountPoints->Size; - RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoints); - continue; - } - else if (!NT_SUCCESS(Status)) - { - RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoint); - RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoints); - NtClose(FileHandle); - SetLastErrorByStatus(Status); - return FALSE; - } - } - } - while (!NT_SUCCESS(Status)); - - RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoint); - NtClose(FileHandle); - - /* - * Now we've gathered info about all mount points mapped to our device, so - * select the correct one and copy it into the output buffer. - */ - - for (Index = 0; Index < MountPoints->NumberOfMountPoints; Index++) - { - MountPoint = MountPoints->MountPoints + Index; - SymbolicLinkName = (PUCHAR)MountPoints + MountPoint->SymbolicLinkNameOffset; - - /* - * Check for "\\?\Volume{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}\" - * (with the last slash being optional) style symbolic links. - */ - - if (MountPoint->SymbolicLinkNameLength == 48 * sizeof(WCHAR) || - (MountPoint->SymbolicLinkNameLength == 49 * sizeof(WCHAR) && - SymbolicLinkName[48] == L'\\')) - { - if (RtlCompareMemory(SymbolicLinkName, L"\\??\\Volume{", - 11 * sizeof(WCHAR)) == 11 * sizeof(WCHAR) && - SymbolicLinkName[19] == L'-' && SymbolicLinkName[24] == L'-' && - SymbolicLinkName[29] == L'-' && SymbolicLinkName[34] == L'-' && - SymbolicLinkName[47] == L'}') - { - if (VolumeNameLength >= MountPoint->SymbolicLinkNameLength / sizeof(WCHAR)) + Status = NtDeviceIoControlFile(FileHandle, NULL, NULL, NULL, &Iosb, + IOCTL_MOUNTDEV_QUERY_DEVICE_NAME, + NULL, 0, MountDevName, BufferLength); + if (!NT_SUCCESS(Status)) + { + RtlFreeHeap(GetProcessHeap(), 0, MountDevName); + if (Status == STATUS_BUFFER_OVERFLOW) { - RtlCopyMemory(VolumeName, - (PUCHAR)MountPoints + MountPoint->SymbolicLinkNameOffset, - MountPoint->SymbolicLinkNameLength); - VolumeName[1] = L'\\'; - Result = TRUE; + BufferLength = sizeof(MOUNTDEV_NAME) + MountDevName->NameLength; + continue; } else { - SetLastError(ERROR_FILENAME_EXCED_RANGE); - Result = FALSE; + NtClose(FileHandle); + SetLastErrorByStatus(Status); + return FALSE; } + } + } + while (!NT_SUCCESS(Status)); - RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoints); + NtClose(FileHandle); - return Result; - } - } - } + /* + * Get the mount point information from mount manager. + */ - RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoints); - SetLastError(ERROR_INVALID_PARAMETER); + MountPointSize = MountDevName->NameLength + sizeof(MOUNTMGR_MOUNT_POINT); + MountPoint = RtlAllocateHeap(GetProcessHeap(), 0, MountPointSize); + if (MountPoint == NULL) + { + RtlFreeHeap(GetProcessHeap(), 0, MountDevName); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } + RtlZeroMemory(MountPoint, sizeof(MOUNTMGR_MOUNT_POINT)); + MountPoint->DeviceNameOffset = sizeof(MOUNTMGR_MOUNT_POINT); + MountPoint->DeviceNameLength = MountDevName->NameLength; + RtlCopyMemory(MountPoint + 1, MountDevName->Name, MountDevName->NameLength); + RtlFreeHeap(RtlGetProcessHeap(), 0, MountDevName); - return FALSE; + RtlInitUnicodeString(&NtFileName, L"\\??\\MountPointManager"); + InitializeObjectAttributes(&ObjectAttributes, &NtFileName, 0, NULL, NULL); + Status = NtOpenFile(&FileHandle, FILE_GENERIC_READ | SYNCHRONIZE, &ObjectAttributes, + &Iosb, FILE_SHARE_READ | FILE_SHARE_WRITE, + FILE_SYNCHRONOUS_IO_NONALERT); + if (!NT_SUCCESS(Status)) + { + SetLastErrorByStatus(Status); + RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoint); + return FALSE; + } + + BufferLength = sizeof(MOUNTMGR_MOUNT_POINTS); + do + { + MountPoints = RtlAllocateHeap(RtlGetProcessHeap(), 0, BufferLength); + if (MountPoints == NULL) + { + RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoint); + NtClose(FileHandle); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } + + Status = NtDeviceIoControlFile(FileHandle, NULL, NULL, NULL, &Iosb, + IOCTL_MOUNTMGR_QUERY_POINTS, + MountPoint, MountPointSize, + MountPoints, BufferLength); + if (!NT_SUCCESS(Status)) + { + if (Status == STATUS_BUFFER_OVERFLOW) + { + BufferLength = MountPoints->Size; + RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoints); + continue; + } + else if (!NT_SUCCESS(Status)) + { + RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoint); + RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoints); + NtClose(FileHandle); + SetLastErrorByStatus(Status); + return FALSE; + } + } + } + while (!NT_SUCCESS(Status)); + + RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoint); + NtClose(FileHandle); + + /* + * Now we've gathered info about all mount points mapped to our device, so + * select the correct one and copy it into the output buffer. + */ + + for (Index = 0; Index < MountPoints->NumberOfMountPoints; Index++) + { + MountPoint = MountPoints->MountPoints + Index; + SymbolicLinkName = (PUCHAR)MountPoints + MountPoint->SymbolicLinkNameOffset; + + /* + * Check for "\\?\Volume{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}\" + * (with the last slash being optional) style symbolic links. + */ + + if (MountPoint->SymbolicLinkNameLength == 48 * sizeof(WCHAR) || + (MountPoint->SymbolicLinkNameLength == 49 * sizeof(WCHAR) && + SymbolicLinkName[48] == L'\\')) + { + if (RtlCompareMemory(SymbolicLinkName, L"\\??\\Volume{", + 11 * sizeof(WCHAR)) == 11 * sizeof(WCHAR) && + SymbolicLinkName[19] == L'-' && SymbolicLinkName[24] == L'-' && + SymbolicLinkName[29] == L'-' && SymbolicLinkName[34] == L'-' && + SymbolicLinkName[47] == L'}') + { + if (VolumeNameLength >= MountPoint->SymbolicLinkNameLength / sizeof(WCHAR)) + { + RtlCopyMemory(VolumeName, + (PUCHAR)MountPoints + MountPoint->SymbolicLinkNameOffset, + MountPoint->SymbolicLinkNameLength); + VolumeName[1] = L'\\'; + Result = TRUE; + } + else + { + SetLastError(ERROR_FILENAME_EXCED_RANGE); + Result = FALSE; + } + + RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoints); + + return Result; + } + } + } + + RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoints); + SetLastError(ERROR_INVALID_PARAMETER); + + return FALSE; } /* @@ -1078,7 +1131,7 @@ GetVolumeNameForVolumeMountPointA( LPCSTR lpszVolumeMountPoint, LPSTR lpszVolumeName, DWORD cchBufferLength - ) +) { BOOL ret; WCHAR volumeW[50], *pathW = NULL; @@ -1102,9 +1155,9 @@ GetVolumeNameForVolumeMountPointA( HANDLE WINAPI FindFirstVolumeW( - LPWSTR volume, - DWORD len - ) + LPWSTR volume, + DWORD len +) { DWORD size = 1024; HANDLE mgr = CreateFileW( MOUNTMGR_DOS_DEVICE_NAME, 0, FILE_SHARE_READ|FILE_SHARE_WRITE, @@ -1151,9 +1204,9 @@ FindFirstVolumeW( HANDLE WINAPI FindFirstVolumeA( - LPSTR volume, - DWORD len - ) + LPSTR volume, + DWORD len +) { WCHAR *buffer = NULL; HANDLE handle; @@ -1187,7 +1240,7 @@ BOOL WINAPI FindVolumeClose( HANDLE hFindVolume - ) +) { return RtlFreeHeap(RtlGetProcessHeap(), 0, hFindVolume); } @@ -1275,12 +1328,12 @@ GetVolumePathNameW(LPCWSTR lpszFileName, } while (!GetVolumeNameForVolumeMountPointW(UnicodeFilePath.Buffer, - VolumeName, - MAX_PATH)) + VolumeName, + MAX_PATH)) { if (((UnicodeFilePath.Length == 4) && (UnicodeFilePath.Buffer[0] == '\\') && - (UnicodeFilePath.Buffer[1] == '\\')) || ((UnicodeFilePath.Length == 6) && - (UnicodeFilePath.Buffer[1] == ':'))) + (UnicodeFilePath.Buffer[1] == '\\')) || ((UnicodeFilePath.Length == 6) && + (UnicodeFilePath.Buffer[1] == ':'))) { break; } diff --git a/dll/win32/kernel32/misc/ldr.c b/dll/win32/kernel32/misc/ldr.c index 03c3ed1053d..b383f1dd6a1 100644 --- a/dll/win32/kernel32/misc/ldr.c +++ b/dll/win32/kernel32/misc/ldr.c @@ -275,7 +275,7 @@ BasepLoadLibraryAsDatafile(PWSTR Path, LPCWSTR Name, HMODULE *hModule) HANDLE hMapping; NTSTATUS Status; PVOID lpBaseAddress = NULL; - SIZE_T ViewSize; + SIZE_T ViewSize = 0; //PUNICODE_STRING OriginalName; //UNICODE_STRING dotDLL = RTL_CONSTANT_STRING(L".DLL"); diff --git a/dll/win32/loadperf/CMakeLists.txt b/dll/win32/loadperf/CMakeLists.txt index d3e547c4042..2e5d86ba3d0 100644 --- a/dll/win32/loadperf/CMakeLists.txt +++ b/dll/win32/loadperf/CMakeLists.txt @@ -12,5 +12,5 @@ add_library(loadperf SHARED set_module_type(loadperf win32dll) target_link_libraries(loadperf wine) add_importlibs(loadperf msvcrt kernel32 ntdll) -add_cab_target(loadperf 1) +add_cd_file(TARGET loadperf DESTINATION reactos/system32 FOR all) add_importlib_target(loadperf.spec) diff --git a/dll/win32/localspl/CMakeLists.txt b/dll/win32/localspl/CMakeLists.txt index fcc72bbbaf2..5ce1b18826f 100644 --- a/dll/win32/localspl/CMakeLists.txt +++ b/dll/win32/localspl/CMakeLists.txt @@ -32,4 +32,4 @@ add_importlibs(localspl kernel32 ntdll) -add_cab_target(localspl 1) +add_cd_file(TARGET localspl DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/localui/CMakeLists.txt b/dll/win32/localui/CMakeLists.txt index f1e179bd620..7221755ddfd 100644 --- a/dll/win32/localui/CMakeLists.txt +++ b/dll/win32/localui/CMakeLists.txt @@ -18,4 +18,4 @@ target_link_libraries(localui uuid wine) add_importlib_target(localui.spec) add_importlibs(localui winspool user32 msvcrt kernel32 ntdll) -add_cab_target(localui 1) +add_cd_file(TARGET localui DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/lpk/CMakeLists.txt b/dll/win32/lpk/CMakeLists.txt index 409dc2fbb64..3e5d6275d11 100644 --- a/dll/win32/lpk/CMakeLists.txt +++ b/dll/win32/lpk/CMakeLists.txt @@ -18,4 +18,4 @@ set_module_type(lpk win32dll) add_importlib_target(lpk.spec) add_importlibs(lpk user32 usp10 msvcrt kernel32 ntdll) -add_cab_target(lpk 1) +add_cd_file(TARGET lpk DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/lsasrv/CMakeLists.txt b/dll/win32/lsasrv/CMakeLists.txt index 641fe712062..e5165d4f653 100644 --- a/dll/win32/lsasrv/CMakeLists.txt +++ b/dll/win32/lsasrv/CMakeLists.txt @@ -30,5 +30,5 @@ target_link_libraries(lsasrv add_importlibs(lsasrv rpcrt4 kernel32 ntdll) add_dependencies(lsasrv psdk) -add_cab_target(lsasrv 1) +add_cd_file(TARGET lsasrv DESTINATION reactos/system32 FOR all) add_importlib_target(lsasrv.spec) diff --git a/dll/win32/lz32/CMakeLists.txt b/dll/win32/lz32/CMakeLists.txt index 0de9b6c7947..a120899e5d2 100644 --- a/dll/win32/lz32/CMakeLists.txt +++ b/dll/win32/lz32/CMakeLists.txt @@ -15,5 +15,5 @@ target_link_libraries(lz32 wine) add_importlibs(lz32 kernel32 ntdll) add_dependencies(lz32 psdk) -add_cab_target(lz32 1) +add_cd_file(TARGET lz32 DESTINATION reactos/system32 FOR all) add_importlib_target(lz32.spec) diff --git a/dll/win32/mapi32/CMakeLists.txt b/dll/win32/mapi32/CMakeLists.txt index 08edaacf5d1..5c1484e7485 100644 --- a/dll/win32/mapi32/CMakeLists.txt +++ b/dll/win32/mapi32/CMakeLists.txt @@ -23,4 +23,4 @@ set_module_type(mapi32 win32dll) target_link_libraries(mapi32 wine uuid) add_importlibs(mapi32 shlwapi shell32 user32 advapi32 msvcrt kernel32 ntdll) -add_cab_target(mapi32 1) +add_cd_file(TARGET mapi32 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/mciavi32/CMakeLists.txt b/dll/win32/mciavi32/CMakeLists.txt index 36879d4708c..1bb93315c1d 100644 --- a/dll/win32/mciavi32/CMakeLists.txt +++ b/dll/win32/mciavi32/CMakeLists.txt @@ -17,4 +17,4 @@ add_library(mciavi32 SHARED ${SOURCE}) set_module_type(mciavi32 win32dll) target_link_libraries(mciavi32 wine) add_importlibs(mciavi32 msvfw32 winmm user32 gdi32 msvcrt kernel32 ntdll) -add_cab_target(mciavi32 1) +add_cd_file(TARGET mciavi32 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/mcicda/CMakeLists.txt b/dll/win32/mcicda/CMakeLists.txt index 7c7e1605b9c..3c01576d126 100644 --- a/dll/win32/mcicda/CMakeLists.txt +++ b/dll/win32/mcicda/CMakeLists.txt @@ -14,4 +14,4 @@ set_entrypoint(mcicda 0) target_link_libraries(mcicda wine) add_importlibs(mcicda winmm user32 kernel32 ntdll) add_dependencies(mcicda psdk) -add_cab_target(mcicda 1) +add_cd_file(TARGET mcicda DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/mciqtz32/CMakeLists.txt b/dll/win32/mciqtz32/CMakeLists.txt index 76c85ab5490..ab86eedf627 100644 --- a/dll/win32/mciqtz32/CMakeLists.txt +++ b/dll/win32/mciqtz32/CMakeLists.txt @@ -15,4 +15,4 @@ set_module_type(mciqtz32 win32dll) target_link_libraries(mciqtz32 wine strmiids) add_importlibs(mciqtz32 winmm oleaut32 ole32 user32 gdi32 msvcrt kernel32 ntdll) -add_cab_target(mciqtz32 1) +add_cd_file(TARGET mciqtz32 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/mciseq/CMakeLists.txt b/dll/win32/mciseq/CMakeLists.txt index 3153b2b66e5..b6bba6b8e18 100644 --- a/dll/win32/mciseq/CMakeLists.txt +++ b/dll/win32/mciseq/CMakeLists.txt @@ -14,4 +14,4 @@ set_entrypoint(mciseq 0) target_link_libraries(mciseq wine) add_importlibs(mciseq winmm user32 kernel32 ntdll msvcrt) add_dependencies(mciseq psdk) -add_cab_target(mciseq 1) +add_cd_file(TARGET mciseq DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/mciwave/CMakeLists.txt b/dll/win32/mciwave/CMakeLists.txt index 268c44e0ae0..d425aa422ab 100644 --- a/dll/win32/mciwave/CMakeLists.txt +++ b/dll/win32/mciwave/CMakeLists.txt @@ -18,4 +18,4 @@ set_entrypoint(mciwave 0) target_link_libraries(mciwave wine) add_importlibs(mciwave user32 winmm msvcrt kernel32 ntdll) add_dependencies(mciwave psdk) -add_cab_target(mciwave 1) +add_cd_file(TARGET mciwave DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/mlang/CMakeLists.txt b/dll/win32/mlang/CMakeLists.txt index cfbb1c520f7..4808863868f 100644 --- a/dll/win32/mlang/CMakeLists.txt +++ b/dll/win32/mlang/CMakeLists.txt @@ -33,4 +33,4 @@ add_importlibs(mlang add_importlib_target(mlang.spec) add_dependencies(mlang psdk) -add_cab_target(mlang 1) +add_cd_file(TARGET mlang DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/mmdrv/CMakeLists.txt b/dll/win32/mmdrv/CMakeLists.txt index 410347f12ad..db775140f5c 100644 --- a/dll/win32/mmdrv/CMakeLists.txt +++ b/dll/win32/mmdrv/CMakeLists.txt @@ -20,4 +20,4 @@ add_library(mmdrv SHARED ${SOURCE}) set_entrypoint(mmdrv 0) add_importlibs(mmdrv winmm user32 kernel32 ntdll) add_dependencies(mmdrv psdk) -add_cab_target(mmdrv 1) +add_cd_file(TARGET mmdrv DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/modemui/CMakeLists.txt b/dll/win32/modemui/CMakeLists.txt index 50c536bcc4b..d4d7aac0b0a 100644 --- a/dll/win32/modemui/CMakeLists.txt +++ b/dll/win32/modemui/CMakeLists.txt @@ -14,4 +14,4 @@ add_library(modemui SHARED ${SOURCE}) set_module_type(modemui win32dll) add_importlibs(modemui msvcrt kernel32 ntdll) -add_cab_target(modemui 1) +add_cd_file(TARGET modemui DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/mpr/CMakeLists.txt b/dll/win32/mpr/CMakeLists.txt index 315efbebd45..65789654de2 100644 --- a/dll/win32/mpr/CMakeLists.txt +++ b/dll/win32/mpr/CMakeLists.txt @@ -26,5 +26,5 @@ set_module_type(mpr win32dll) target_link_libraries(mpr wine) add_importlibs(mpr advapi32 user32 msvcrt kernel32 ntdll) -add_cab_target(mpr 1) +add_cd_file(TARGET mpr DESTINATION reactos/system32 FOR all) add_importlib_target(mpr.spec) diff --git a/dll/win32/mprapi/CMakeLists.txt b/dll/win32/mprapi/CMakeLists.txt index bcdee43856b..95c08f67074 100644 --- a/dll/win32/mprapi/CMakeLists.txt +++ b/dll/win32/mprapi/CMakeLists.txt @@ -14,4 +14,4 @@ add_library(mprapi SHARED ${SOURCE}) set_module_type(mprapi win32dll) target_link_libraries(mprapi wine) add_importlibs(mprapi msvcrt kernel32 ntdll) -add_cab_target(mprapi 1) +add_cd_file(TARGET mprapi DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/msacm32/CMakeLists.txt b/dll/win32/msacm32/CMakeLists.txt index 4c6ad37aab2..c163adb51a2 100644 --- a/dll/win32/msacm32/CMakeLists.txt +++ b/dll/win32/msacm32/CMakeLists.txt @@ -28,7 +28,7 @@ target_link_libraries(msacm32 wine) add_importlibs(msacm32 msvcrt advapi32 user32 winmm kernel32 ntdll) add_dependencies(msacm32 psdk) -add_cab_target(msacm32 1) +add_cd_file(TARGET msacm32 DESTINATION reactos/system32 FOR all) add_importlib_target(msacm32.spec) add_subdirectory(msacm32.drv) diff --git a/dll/win32/msacm32/msacm32.drv/CMakeLists.txt b/dll/win32/msacm32/msacm32.drv/CMakeLists.txt index 3a3f1ad3ed4..d90da1ef907 100644 --- a/dll/win32/msacm32/msacm32.drv/CMakeLists.txt +++ b/dll/win32/msacm32/msacm32.drv/CMakeLists.txt @@ -15,4 +15,4 @@ target_link_libraries(msacm32.drv wine) add_importlibs(msacm32.drv msacm32 user32 winmm advapi32 kernel32 ntdll) add_dependencies(msacm32.drv psdk) -add_cab_target(msacm32.drv 1) \ No newline at end of file +add_cd_file(TARGET msacm32.drv DESTINATION reactos/system32 FOR all) \ No newline at end of file diff --git a/dll/win32/msadp32.acm/CMakeLists.txt b/dll/win32/msadp32.acm/CMakeLists.txt index 289d6a8e101..1c73fd654b1 100644 --- a/dll/win32/msadp32.acm/CMakeLists.txt +++ b/dll/win32/msadp32.acm/CMakeLists.txt @@ -18,4 +18,4 @@ set_target_properties(msadp32.acm PROPERTIES SUFFIX "") target_link_libraries(msadp32.acm wine) add_importlibs(msadp32.acm winmm user32 msvcrt kernel32 ntdll) add_dependencies(msadp32.acm psdk) -add_cab_target(msadp32.acm 1) +add_cd_file(TARGET msadp32.acm DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/msafd/CMakeLists.txt b/dll/win32/msafd/CMakeLists.txt index 8a2c0f7d27d..7b87ac897a2 100644 --- a/dll/win32/msafd/CMakeLists.txt +++ b/dll/win32/msafd/CMakeLists.txt @@ -25,4 +25,4 @@ set_module_type(msafd win32dll) add_pch(msafd ${CMAKE_CURRENT_SOURCE_DIR}/msafd.h ${SOURCE}) add_importlibs(msafd advapi32 msvcrt kernel32 ntdll) -add_cab_target(msafd 1) +add_cd_file(TARGET msafd DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/mscat32/CMakeLists.txt b/dll/win32/mscat32/CMakeLists.txt index a9b4ece7e60..091608a44fd 100644 --- a/dll/win32/mscat32/CMakeLists.txt +++ b/dll/win32/mscat32/CMakeLists.txt @@ -14,4 +14,4 @@ add_library(mscat32 SHARED ${SOURCE}) set_module_type(mscat32 win32dll) target_link_libraries(mscat32 wine) add_importlibs(mscat32 wintrust msvcrt kernel32 ntdll) -add_cab_target(mscat32 1) +add_cd_file(TARGET mscat32 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/mscms/CMakeLists.txt b/dll/win32/mscms/CMakeLists.txt index 5a77fedf661..8b3f6d9e74c 100644 --- a/dll/win32/mscms/CMakeLists.txt +++ b/dll/win32/mscms/CMakeLists.txt @@ -22,4 +22,4 @@ add_library(mscms SHARED ${SOURCE}) set_module_type(mscms win32dll) target_link_libraries(mscms wine) add_importlibs(mscms msvcrt advapi32 kernel32 ntdll) -add_cab_target(mscms 1) +add_cd_file(TARGET mscms DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/mscoree/CMakeLists.txt b/dll/win32/mscoree/CMakeLists.txt index 45cec4b9411..75d41f63ddb 100644 --- a/dll/win32/mscoree/CMakeLists.txt +++ b/dll/win32/mscoree/CMakeLists.txt @@ -15,4 +15,4 @@ add_library(mscoree SHARED ${SOURCE}) set_module_type(mscoree win32dll) target_link_libraries(mscoree wine uuid) add_importlibs(mscoree advapi32 shell32 msvcrt kernel32 ntdll) -add_cab_target(mscoree 1) +add_cd_file(TARGET mscoree DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/msctf/CMakeLists.txt b/dll/win32/msctf/CMakeLists.txt index 1b4aa4007f7..634e00dde1c 100644 --- a/dll/win32/msctf/CMakeLists.txt +++ b/dll/win32/msctf/CMakeLists.txt @@ -34,4 +34,4 @@ set_module_type(msctf win32dll) target_link_libraries(msctf uuid wine) add_importlibs(msctf ole32 oleaut32 user32 advapi32 msvcrt kernel32 ntdll) -add_cab_target(msctf 1) +add_cd_file(TARGET msctf DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/msftedit/CMakeLists.txt b/dll/win32/msftedit/CMakeLists.txt index 117ae3f05cc..89b40b56f31 100644 --- a/dll/win32/msftedit/CMakeLists.txt +++ b/dll/win32/msftedit/CMakeLists.txt @@ -18,4 +18,4 @@ set_module_type(msftedit win32dll) target_link_libraries(msftedit uuid wine) add_importlibs(msftedit riched20 msvcrt kernel32 ntdll) -add_cab_target(msftedit 1) +add_cd_file(TARGET msftedit DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/msg711.acm/CMakeLists.txt b/dll/win32/msg711.acm/CMakeLists.txt index 1e8a69b14b6..6f6deeb3192 100644 --- a/dll/win32/msg711.acm/CMakeLists.txt +++ b/dll/win32/msg711.acm/CMakeLists.txt @@ -19,4 +19,4 @@ set_target_properties(msg711.acm PROPERTIES SUFFIX "") target_link_libraries(msg711.acm wine) add_importlibs(msg711.acm winmm user32 msvcrt kernel32 ntdll) add_dependencies(msg711.acm psdk) -add_cab_target(msg711.acm 1) +add_cd_file(TARGET msg711.acm DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/msgina/CMakeLists.txt b/dll/win32/msgina/CMakeLists.txt index 0a9f0e0273d..61071b9a646 100644 --- a/dll/win32/msgina/CMakeLists.txt +++ b/dll/win32/msgina/CMakeLists.txt @@ -21,4 +21,4 @@ add_library(msgina SHARED ${SOURCE}) set_module_type(msgina win32dll) target_link_libraries(msgina wine) add_importlibs(msgina advapi32 user32 gdi32 userenv msvcrt kernel32 ntdll) -add_cab_target(msgina 1) +add_cd_file(TARGET msgina DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/msgsm32.acm/CMakeLists.txt b/dll/win32/msgsm32.acm/CMakeLists.txt index 1edc6f77e18..1de7b02958c 100644 --- a/dll/win32/msgsm32.acm/CMakeLists.txt +++ b/dll/win32/msgsm32.acm/CMakeLists.txt @@ -20,4 +20,4 @@ target_link_libraries(msgsm32.acm wine) add_importlibs(msgsm32.acm winmm user32 msvcrt kernel32 ntdll) add_dependencies(msgsm32.acm psdk) -add_cab_target(msgsm32.acm 1) +add_cd_file(TARGET msgsm32.acm DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/mshtml.tlb/CMakeLists.txt b/dll/win32/mshtml.tlb/CMakeLists.txt index 5958aa89955..9645d148f3c 100644 --- a/dll/win32/mshtml.tlb/CMakeLists.txt +++ b/dll/win32/mshtml.tlb/CMakeLists.txt @@ -11,4 +11,4 @@ add_library(mshtml.tlb SHARED rsrc.rc) set_entrypoint(mshtml.tlb 0) set_target_properties(mshtml.tlb PROPERTIES SUFFIX "") add_dependencies(mshtml.tlb mshtml_tlb) -add_cab_target(mshtml.tlb 1) +add_cd_file(TARGET mshtml.tlb DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/mshtml/CMakeLists.txt b/dll/win32/mshtml/CMakeLists.txt index 422df098702..4f174ee0bca 100644 --- a/dll/win32/mshtml/CMakeLists.txt +++ b/dll/win32/mshtml/CMakeLists.txt @@ -105,4 +105,4 @@ add_importlibs(mshtml ntdll) add_dependencies(mshtml mshtml_nsiface_header) -add_cab_target(mshtml 1) +add_cd_file(TARGET mshtml DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/mshtml/mshtml.inf b/dll/win32/mshtml/mshtml.inf index d7d242800bf..c76552ef328 100644 --- a/dll/win32/mshtml/mshtml.inf +++ b/dll/win32/mshtml/mshtml.inf @@ -91,7 +91,7 @@ HKCR,"CLSID\%CLSID_CRecalcEngine%\InProcServer32","ThreadingModel",,"Apartment" ;; CrSource HKCR,"CLSID\%CLSID_CrSource%",,,"Microsoft CrSource 4.0" HKCR,"CLSID\%CLSID_CrSource%\BrowseInPlace",,16 -HKCR,"CLSID\%CLSID_CrSource%\DefaultIcon",,0x00020000,"%16422%\Internet Explorer\iexplore.exe,1" +;;HKCR,"CLSID\%CLSID_CrSource%\DefaultIcon",,0x00020000,"%16422%\Internet Explorer\iexplore.exe,1" HKCR,"CLSID\%CLSID_CrSource%\EnablePlugin\.css",,,"PointPlus plugin" HKCR,"CLSID\%CLSID_CrSource%\InProcServer32",,,"mshtml.dll" HKCR,"CLSID\%CLSID_CrSource%\InProcServer32","ThreadingModel",,"Apartment" @@ -122,7 +122,7 @@ HKCR,"CLSID\%CLSID_HTADocument%\Version",,,"6.0" ;; HTMLDocument HKCR,"CLSID\%CLSID_HTMLDocument%",,,"HTML Document" HKCR,"CLSID\%CLSID_HTMLDocument%\BrowseInPlace",,16 -HKCR,"CLSID\%CLSID_HTMLDocument%\DefaultIcon",,0x00020000,"%16422%\Internet Explorer\iexplore.exe,1" +;;HKCR,"CLSID\%CLSID_HTMLDocument%\DefaultIcon",,0x00020000,"%16422%\Internet Explorer\iexplore.exe,1" HKCR,"CLSID\%CLSID_HTMLDocument%\InProcServer32",,,"mshtml.dll" HKCR,"CLSID\%CLSID_HTMLDocument%\InProcServer32","ThreadingModel",,"Apartment" HKCR,"CLSID\%CLSID_HTMLDocument%\MiscStatus",,,"2228625" @@ -215,7 +215,7 @@ HKCR,"CLSID\%CLSID_MailtoProtocol%\InProcServer32","ThreadingModel",,"Apartment" ;; MHTMLDocument HKCR,"CLSID\%CLSID_MHTMLDocument%",,,"MHTML Document" HKCR,"CLSID\%CLSID_MHTMLDocument%\BrowseInPlace",,16 -HKCR,"CLSID\%CLSID_MHTMLDocument%\DefaultIcon",,0x00020000,"%16422%\Internet Explorer\iexplore.exe,1" +;;HKCR,"CLSID\%CLSID_MHTMLDocument%\DefaultIcon",,0x00020000,"%16422%\Internet Explorer\iexplore.exe,1" HKCR,"CLSID\%CLSID_MHTMLDocument%\InProcServer32",,,"mshtml.dll" HKCR,"CLSID\%CLSID_MHTMLDocument%\InProcServer32","ThreadingModel",,"Apartment" HKCR,"CLSID\%CLSID_MHTMLDocument%\MiscStatus",,,"2228625" @@ -236,7 +236,7 @@ HKCR,"CLSID\%CLSID_Scriptlet%\MiscStatus",,,"0" HKCR,"CLSID\%CLSID_Scriptlet%\MiscStatus\1",,,"131473" HKCR,"CLSID\%CLSID_Scriptlet%\ProgID",,,"ScriptBridge.ScriptBridge.1" HKCR,"CLSID\%CLSID_Scriptlet%\Programmable",,16 -HKCR,"CLSID\%CLSID_Scriptlet%\ToolboxBitmap32",,,"%16422%\Internet Explorer\iexplore.exe,1" +;;HKCR,"CLSID\%CLSID_Scriptlet%\ToolboxBitmap32",,,"%16422%\Internet Explorer\iexplore.exe,1" HKCR,"CLSID\%CLSID_Scriptlet%\TypeLib",,,"%LIBID_MSHTML%" HKCR,"CLSID\%CLSID_Scriptlet%\Version",,,"4.0" HKCR,"CLSID\%CLSID_Scriptlet%\VersionIndependentProgID",,,"ScriptBridge.ScriptBridge" @@ -312,9 +312,9 @@ HKCR,".gif",,2,"giffile" HKCR,".gif","Content Type",,"image/gif" HKCR,"giffile",,,"GIF Image" HKCR,"giffile\CLSID",,,"%CLSID_HTMLDocument%" -HKCR,"giffile\shell\open\command",,,"""%16422%\Internet Explorer\iexplore.exe"" -nohome" +;;HKCR,"giffile\shell\open\command",,,"""%16422%\Internet Explorer\iexplore.exe"" -nohome" HKCR,"giffile\shell\open\ddeexec",,,"""file:%%1"",,-1,,,,," -HKCR,"giffile\shell\open\ddeexec\Application",,,"IExplore" +;;HKCR,"giffile\shell\open\ddeexec\Application",,,"IExplore" HKCR,"giffile\shell\open\ddeexec\Topic",,,"WWW_OpenURL" ;; HKCR,"giffile\DefaultIcon",,,"%16422%\Internet Explorer\iexplore.exe,9" @@ -339,7 +339,7 @@ HKCR,"htmlfile\shell\printto\command",,,"rundll32.exe mshtml.dll,PrintHTML ""%%1 HKCR,"htmlfile",,,"HTML Document" HKCR,"htmlfile\BrowseInPlace",,16 HKCR,"htmlfile\CLSID",,,"%CLSID_HTMLDocument%" -HKCR,"htmlfile\DefaultIcon",,0x00020000,"%16422%\Internet Explorer\iexplore.exe,1" +;;HKCR,"htmlfile\DefaultIcon",,0x00020000,"%16422%\Internet Explorer\iexplore.exe,1" HKCR,"htmlfile_FullWindowEmbed",,,"HTML Plugin Document" HKCR,"htmlfile_FullWindowEmbed\BrowseInPlace",,16 HKCR,"htmlfile_FullWindowEmbed\CLSID",,,"%CLSID_HTMLPluginDocument%" @@ -359,9 +359,9 @@ HKCR,".jpe",,2,"jpegfile" HKCR,".jpe","Content Type",,"image/jpeg" HKCR,"jpegfile",,,"JPEG Image" HKCR,"jpegfile\CLSID",,,"%CLSID_HTMLDocument%" -HKCR,"jpegfile\shell\open\command",,,"""%16422%\Internet Explorer\iexplore.exe"" -nohome" +;;HKCR,"jpegfile\shell\open\command",,,"""%16422%\Internet Explorer\iexplore.exe"" -nohome" HKCR,"jpegfile\shell\open\ddeexec",,,"""file:%%1"",,-1,,,,," -HKCR,"jpegfile\shell\open\ddeexec\Application",,,"IExplore" +;;HKCR,"jpegfile\shell\open\ddeexec\Application",,,"IExplore" HKCR,"jpegfile\shell\open\ddeexec\Topic",,,"WWW_OpenURL" ;; HKCR,"jpegfile\DefaultIcon",,,"%16422%\Internet Explorer\iexplore.exe,8" @@ -374,9 +374,9 @@ HKCR,".jpeg",,2,"jpegfile" HKCR,".jpeg","Content Type",,"image/jpeg" HKCR,"jpegfile",,,"JPEG Image" HKCR,"jpegfile\CLSID",,,"%CLSID_HTMLDocument%" -HKCR,"jpegfile\shell\open\command",,,"""%16422%\Internet Explorer\iexplore.exe"" -nohome" +;;HKCR,"jpegfile\shell\open\command",,,"""%16422%\Internet Explorer\iexplore.exe"" -nohome" HKCR,"jpegfile\shell\open\ddeexec",,,"""file:%%1"",,-1,,,,," -HKCR,"jpegfile\shell\open\ddeexec\Application",,,"IExplore" +;;HKCR,"jpegfile\shell\open\ddeexec\Application",,,"IExplore" HKCR,"jpegfile\shell\open\ddeexec\Topic",,,"WWW_OpenURL" ;; HKCR,"jpegfile\DefaultIcon",,,"%16422%\Internet Explorer\iexplore.exe,8" @@ -385,9 +385,9 @@ HKCR,".jpg",,2,"jpegfile" HKCR,".jpg","Content Type",,"image/jpeg" HKCR,"jpegfile",,,"JPEG Image" HKCR,"jpegfile\CLSID",,,"%CLSID_HTMLDocument%" -HKCR,"jpegfile\shell\open\command",,,"""%16422%\Internet Explorer\iexplore.exe"" -nohome" +;;HKCR,"jpegfile\shell\open\command",,,"""%16422%\Internet Explorer\iexplore.exe"" -nohome" HKCR,"jpegfile\shell\open\ddeexec",,,"""file:%%1"",,-1,,,,," -HKCR,"jpegfile\shell\open\ddeexec\Application",,,"IExplore" +;;HKCR,"jpegfile\shell\open\ddeexec\Application",,,"IExplore" HKCR,"jpegfile\shell\open\ddeexec\Topic",,,"WWW_OpenURL" ;; HKCR,"jpegfile\DefaultIcon",,,"%16422%\Internet Explorer\iexplore.exe,8" @@ -422,9 +422,9 @@ HKCR,".jfif",,2,"pjpegfile" HKCR,".jfif","Content Type",,"image/jpeg" HKCR,"pjpegfile",,,"JPEG Image" HKCR,"pjpegfile\CLSID",,,"%CLSID_HTMLDocument%" -HKCR,"pjpegfile\shell\open\command",,,"""%16422%\Internet Explorer\iexplore.exe"" -nohome" +;;HKCR,"pjpegfile\shell\open\command",,,"""%16422%\Internet Explorer\iexplore.exe"" -nohome" HKCR,"pjpegfile\shell\open\ddeexec",,,"""file:%%1"",,-1,,,,," -HKCR,"pjpegfile\shell\open\ddeexec\Application",,,"IExplore" +;;HKCR,"pjpegfile\shell\open\ddeexec\Application",,,"IExplore" HKCR,"pjpegfile\shell\open\ddeexec\Topic",,,"WWW_OpenURL" ;; HKCR,"pjpegfile\DefaultIcon",,,"%16422%\Internet Explorer\iexplore.exe,8" @@ -435,9 +435,9 @@ HKCR,".png",,2,"pngfile" HKCR,".png","Content Type",,"image/png" HKCR,"pngfile",,,"PNG Image" HKCR,"pngfile\CLSID",,,"%CLSID_HTMLDocument%" -HKCR,"pngfile\shell\open\command",,,"""%16422%\Internet Explorer\iexplore.exe""" -nohome" +;;HKCR,"pngfile\shell\open\command",,,"""%16422%\Internet Explorer\iexplore.exe""" -nohome" HKCR,"pngfile\shell\open\ddeexec",,,"""file:%%1"",,-1,,,,," -HKCR,"pngfile\shell\open\ddeexec\Application",,,"IExplore" +;;HKCR,"pngfile\shell\open\ddeexec\Application",,,"IExplore" HKCR,"pngfile\shell\open\ddeexec\Topic",,,"WWW_OpenURL" ;; HKCR,"pngfile\DefaultIcon",,,"%16422%\Internet Explorer\iexplore.exe,9" @@ -478,9 +478,9 @@ HKCR,"MIME\Database\Content Type\image/x-xbitmap","CLSID",,"%CLSID_HTMLDocument% HKCR,".xbm","Content Type",,"image/x-xbitmap" HKCR,"xbmfile",,,"XBM Image" HKCR,"xbmfile\CLSID",,,"%CLSID_HTMLDocument%" -HKCR,"xbmfile\shell\open\command",,,"""%16422%\Internet Explorer\iexplore.exe"" -nohome" +;;HKCR,"xbmfile\shell\open\command",,,"""%16422%\Internet Explorer\iexplore.exe"" -nohome" HKCR,"xbmfile\shell\open\ddeexec",,,"""file:%%1"",,-1,,,,," -HKCR,"xbmfile\shell\open\ddeexec\Application",,,"IExplore" +;;HKCR,"xbmfile\shell\open\ddeexec\Application",,,"IExplore" HKCR,"xbmfile\shell\open\ddeexec\Topic",,,"WWW_OpenURL" ;; HKCR,"xbmfile\DefaultIcon",,,"%16422%\Internet Explorer\iexplore.exe,9" diff --git a/dll/win32/msi/CMakeLists.txt b/dll/win32/msi/CMakeLists.txt index 34964e7f94e..c7d217c2906 100644 --- a/dll/win32/msi/CMakeLists.txt +++ b/dll/win32/msi/CMakeLists.txt @@ -95,5 +95,5 @@ add_importlibs(msi kernel32 ntdll) -add_cab_target(msi 1) +add_cd_file(TARGET msi DESTINATION reactos/system32 FOR all) add_importlib_target(msi.spec) diff --git a/dll/win32/msimg32/CMakeLists.txt b/dll/win32/msimg32/CMakeLists.txt index eeb8e2d03a5..f571b8b0114 100644 --- a/dll/win32/msimg32/CMakeLists.txt +++ b/dll/win32/msimg32/CMakeLists.txt @@ -13,5 +13,5 @@ add_library(msimg32 SHARED ${SOURCE}) set_module_type(msimg32 win32dll) target_link_libraries(msimg32 wine) add_importlibs(msimg32 gdi32 msvcrt kernel32 ntdll) -add_cab_target(msimg32 1) +add_cd_file(TARGET msimg32 DESTINATION reactos/system32 FOR all) add_importlib_target(msimg32.spec) diff --git a/dll/win32/msimtf/CMakeLists.txt b/dll/win32/msimtf/CMakeLists.txt index 698d01afcea..3832d3f787b 100644 --- a/dll/win32/msimtf/CMakeLists.txt +++ b/dll/win32/msimtf/CMakeLists.txt @@ -19,4 +19,4 @@ set_module_type(msimtf win32dll) target_link_libraries(msimtf uuid wine) add_importlibs(msimtf msvcrt imm32 kernel32 ntdll) -add_cab_target(msimtf 1) +add_cd_file(TARGET msimtf DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/msisip/CMakeLists.txt b/dll/win32/msisip/CMakeLists.txt index 0b1b4cb34b0..c212187aaf3 100644 --- a/dll/win32/msisip/CMakeLists.txt +++ b/dll/win32/msisip/CMakeLists.txt @@ -15,4 +15,4 @@ set_module_type(msisip win32dll) target_link_libraries(msisip wine) add_importlibs(msisip crypt32 ole32 msvcrt kernel32 ntdll) -add_cab_target(msisip 1) +add_cd_file(TARGET msisip DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/msisys.ocx/CMakeLists.txt b/dll/win32/msisys.ocx/CMakeLists.txt index 1c4997f6189..94bab9d2afd 100644 --- a/dll/win32/msisys.ocx/CMakeLists.txt +++ b/dll/win32/msisys.ocx/CMakeLists.txt @@ -13,4 +13,4 @@ add_library(msisys SHARED ${SOURCE}) set_module_type(msisys win32ocx) target_link_libraries(msisys uuid wine) add_importlibs(msisys msvcrt kernel32 ntdll) -add_cab_target(msisys 1) +add_cd_file(TARGET msisys DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/msnet32/CMakeLists.txt b/dll/win32/msnet32/CMakeLists.txt index 49a525471d1..2ed1cda1ebd 100644 --- a/dll/win32/msnet32/CMakeLists.txt +++ b/dll/win32/msnet32/CMakeLists.txt @@ -12,4 +12,4 @@ target_link_libraries(msnet32 wine) add_importlibs(msnet32 msvcrt kernel32 ntdll) -add_cab_target(msnet32 1) +add_cd_file(TARGET msnet32 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/msrle32/CMakeLists.txt b/dll/win32/msrle32/CMakeLists.txt index 6f8faa82fc8..9aedf677b8f 100644 --- a/dll/win32/msrle32/CMakeLists.txt +++ b/dll/win32/msrle32/CMakeLists.txt @@ -19,4 +19,4 @@ add_library(msrle32 SHARED ${SOURCE}) set_module_type(msrle32 win32dll) target_link_libraries(msrle32 wine) add_importlibs(msrle32 msvcrt winmm user32 kernel32 ntdll) -add_cab_target(msrle32 1) +add_cd_file(TARGET msrle32 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/mssign32/CMakeLists.txt b/dll/win32/mssign32/CMakeLists.txt index 22705b0c924..8b2312221f5 100644 --- a/dll/win32/mssign32/CMakeLists.txt +++ b/dll/win32/mssign32/CMakeLists.txt @@ -17,4 +17,4 @@ target_link_libraries(mssign32 wine) add_importlibs(mssign32 msvcrt kernel32 ntdll) -add_cab_target(mssign32 1) +add_cd_file(TARGET mssign32 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/mssip32/CMakeLists.txt b/dll/win32/mssip32/CMakeLists.txt index 9a33ec00c17..0e3d3eebedf 100644 --- a/dll/win32/mssip32/CMakeLists.txt +++ b/dll/win32/mssip32/CMakeLists.txt @@ -17,4 +17,4 @@ target_link_libraries(mssip32 wine) add_importlibs(mssip32 msvcrt kernel32 ntdll) -add_cab_target(mssip32 1) +add_cd_file(TARGET mssip32 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/mstask/CMakeLists.txt b/dll/win32/mstask/CMakeLists.txt index 58a350bea58..cf5b7571024 100644 --- a/dll/win32/mstask/CMakeLists.txt +++ b/dll/win32/mstask/CMakeLists.txt @@ -34,4 +34,4 @@ target_link_libraries(mstask uuid wine) add_importlibs(mstask ole32 msvcrt kernel32 ntdll) -add_cab_target(mstask 1) +add_cd_file(TARGET mstask DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/msvcrt/CMakeLists.txt b/dll/win32/msvcrt/CMakeLists.txt index 2490aa3b4de..3cf63aa2234 100644 --- a/dll/win32/msvcrt/CMakeLists.txt +++ b/dll/win32/msvcrt/CMakeLists.txt @@ -40,6 +40,6 @@ target_link_libraries(msvcrt add_pch(msvcrt ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE}) add_importlibs(msvcrt kernel32 ntdll) -add_cab_target(msvcrt 1) +add_cd_file(TARGET msvcrt DESTINATION reactos/system32 FOR all) add_importlib_target(msvcrt.spec) diff --git a/dll/win32/msvcrt20/CMakeLists.txt b/dll/win32/msvcrt20/CMakeLists.txt index 34c4fe0889c..fb3bc51dd93 100644 --- a/dll/win32/msvcrt20/CMakeLists.txt +++ b/dll/win32/msvcrt20/CMakeLists.txt @@ -17,4 +17,4 @@ target_link_libraries(msvcrt20 wine) add_importlibs(msvcrt20 msvcrt kernel32 ntdll) add_dependencies(msvcrt20 psdk) -add_cab_target(msvcrt20 1) +add_cd_file(TARGET msvcrt20 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/msvcrt40/CMakeLists.txt b/dll/win32/msvcrt40/CMakeLists.txt index a546da850c4..ac69cb56d38 100644 --- a/dll/win32/msvcrt40/CMakeLists.txt +++ b/dll/win32/msvcrt40/CMakeLists.txt @@ -18,4 +18,4 @@ target_link_libraries(msvcrt40 wine) add_importlibs(msvcrt40 msvcrt kernel32 ntdll) -add_cab_target(msvcrt40 1) +add_cd_file(TARGET msvcrt40 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/msvfw32/CMakeLists.txt b/dll/win32/msvfw32/CMakeLists.txt index c95dc4434e6..57367f75378 100644 --- a/dll/win32/msvfw32/CMakeLists.txt +++ b/dll/win32/msvfw32/CMakeLists.txt @@ -23,5 +23,5 @@ target_link_libraries(msvfw32 wine) add_importlibs(msvfw32 winmm version comctl32 user32 gdi32 advapi32 msvcrt kernel32 ntdll) -add_cab_target(msvfw32 1) +add_cd_file(TARGET msvfw32 DESTINATION reactos/system32 FOR all) add_importlib_target(msvfw32.spec) diff --git a/dll/win32/msvidc32/CMakeLists.txt b/dll/win32/msvidc32/CMakeLists.txt index 57e06368df5..8ab0e77c64b 100644 --- a/dll/win32/msvidc32/CMakeLists.txt +++ b/dll/win32/msvidc32/CMakeLists.txt @@ -17,4 +17,4 @@ add_library(msvidc32 SHARED ${SOURCE}) set_module_type(msvidc32 win32dll) target_link_libraries(msvidc32 wine) add_importlibs(msvidc32 user32 msvcrt kernel32 ntdll) -add_cab_target(msvidc32 1) +add_cd_file(TARGET msvidc32 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/mswsock/CMakeLists.txt b/dll/win32/mswsock/CMakeLists.txt index 28394667e93..8d501879f33 100644 --- a/dll/win32/mswsock/CMakeLists.txt +++ b/dll/win32/mswsock/CMakeLists.txt @@ -16,5 +16,5 @@ add_library(mswsock SHARED ${SOURCE}) set_module_type(mswsock win32dll) add_importlibs(mswsock ws2_32 msvcrt kernel32) -add_cab_target(mswsock 1) +add_cd_file(TARGET mswsock DESTINATION reactos/system32 FOR all) add_importlib_target(mswsock.spec) diff --git a/dll/win32/msxml3/CMakeLists.txt b/dll/win32/msxml3/CMakeLists.txt index a816dec6ed9..40052a11d9e 100644 --- a/dll/win32/msxml3/CMakeLists.txt +++ b/dll/win32/msxml3/CMakeLists.txt @@ -81,4 +81,4 @@ add_importlibs(msxml3 ntdll) add_dependencies(msxml3 msxml3_v1) -add_cab_target(msxml3 1) +add_cd_file(TARGET msxml3 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/nddeapi/CMakeLists.txt b/dll/win32/nddeapi/CMakeLists.txt index 696f5623d49..a085f6bf6d0 100644 --- a/dll/win32/nddeapi/CMakeLists.txt +++ b/dll/win32/nddeapi/CMakeLists.txt @@ -16,4 +16,4 @@ target_link_libraries(nddeapi wine) add_importlibs(nddeapi kernel32 ntdll) add_dependencies(nddeapi psdk) -add_cab_target(nddeapi 1) \ No newline at end of file +add_cd_file(TARGET nddeapi DESTINATION reactos/system32 FOR all) \ No newline at end of file diff --git a/dll/win32/netapi32/CMakeLists.txt b/dll/win32/netapi32/CMakeLists.txt index 65f7bf6ccc5..988a6461ed1 100644 --- a/dll/win32/netapi32/CMakeLists.txt +++ b/dll/win32/netapi32/CMakeLists.txt @@ -28,5 +28,5 @@ target_link_libraries(netapi32 wine) add_importlibs(netapi32 iphlpapi ws2_32 advapi32 msvcrt kernel32 ntdll) -add_cab_target(netapi32 1) +add_cd_file(TARGET netapi32 DESTINATION reactos/system32 FOR all) add_importlib_target(netapi32.spec) diff --git a/dll/win32/netcfgx/CMakeLists.txt b/dll/win32/netcfgx/CMakeLists.txt index 3286fdcab2c..fb2e955a563 100644 --- a/dll/win32/netcfgx/CMakeLists.txt +++ b/dll/win32/netcfgx/CMakeLists.txt @@ -24,4 +24,4 @@ target_link_libraries(netcfgx add_importlibs(netcfgx rpcrt4 setupapi advapi32 iphlpapi ole32 user32 comctl32 ws2_32 msvcrt kernel32 ntdll) -add_cab_target(netcfgx 1) +add_cd_file(TARGET netcfgx DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/netevent/CMakeLists.txt b/dll/win32/netevent/CMakeLists.txt index 1ea76ddc9c1..f0f4e5c8dff 100644 --- a/dll/win32/netevent/CMakeLists.txt +++ b/dll/win32/netevent/CMakeLists.txt @@ -3,13 +3,11 @@ set_unicode() include_directories(${REACTOS_BINARY_DIR}/include/reactos) -spec2def(netevent.dll netevent.spec) - -add_library(netevent SHARED netevent.c netevt.rc ${CMAKE_CURRENT_BINARY_DIR}/netevent.def) +add_library(netevent SHARED netevt.rc) set_module_type(netevent win32dll) add_importlibs(netevent msvcrt kernel32) add_dependencies(netevent neteventmsg) -add_cab_target(netevent 1) +add_cd_file(TARGET netevent DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/netevent/netevent.c b/dll/win32/netevent/netevent.c deleted file mode 100644 index 2534275adad..00000000000 --- a/dll/win32/netevent/netevent.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * PROJECT: ReactOS Network Event Handler - * LICENSE: GPL - See COPYING in the top level directory - * FILE: dll/win32/netevent/netevent.c - * PURPOSE: Dummy main file - * COPYRIGHT: Eric Kohl - */ - -#include - -BOOL -WINAPI -DllMain(IN HINSTANCE hinstDLL, - IN DWORD dwReason, - IN LPVOID lpvReserved) -{ - switch (dwReason) - { - case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls(hinstDLL); - break; - } - - return TRUE; -} diff --git a/dll/win32/netevent/netevent.spec b/dll/win32/netevent/netevent.spec deleted file mode 100644 index 785ff690182..00000000000 --- a/dll/win32/netevent/netevent.spec +++ /dev/null @@ -1 +0,0 @@ -# netevent.dll exports diff --git a/dll/win32/netid/CMakeLists.txt b/dll/win32/netid/CMakeLists.txt index 4e173342b3f..57bd8f59f2e 100644 --- a/dll/win32/netid/CMakeLists.txt +++ b/dll/win32/netid/CMakeLists.txt @@ -11,4 +11,4 @@ add_library(netid SHARED ${SOURCE}) set_module_type(netid win32dll) add_importlibs(netid user32 gdi32 comctl32 advapi32 netapi32 msvcrt kernel32 ntdll) -add_cab_target(netid 1) +add_cd_file(TARGET netid DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/netid/rsrc.rc b/dll/win32/netid/rsrc.rc index 5bcd0e1c57b..0d8989e0327 100644 --- a/dll/win32/netid/rsrc.rc +++ b/dll/win32/netid/rsrc.rc @@ -9,7 +9,7 @@ #include "lang/es-ES.rc" #include "lang/fr-FR.rc" #include "lang/id-ID.rc" -//#include "lang/ja-JP.rc" FIXME: iconv issue +#include "lang/ja-JP.rc" #include "lang/it-IT.rc" #include "lang/nl-NL.rc" #include "lang/no-NO.rc" diff --git a/dll/win32/netshell/CMakeLists.txt b/dll/win32/netshell/CMakeLists.txt index e1043b2cf0e..5e2890505bd 100644 --- a/dll/win32/netshell/CMakeLists.txt +++ b/dll/win32/netshell/CMakeLists.txt @@ -44,4 +44,4 @@ add_importlibs(netshell add_pch(netshell ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE}) -add_cab_target(netshell 1) +add_cd_file(TARGET netshell DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/netshell/netshell.rc b/dll/win32/netshell/netshell.rc index d0948666d2e..47f67ab2301 100644 --- a/dll/win32/netshell/netshell.rc +++ b/dll/win32/netshell/netshell.rc @@ -33,7 +33,7 @@ IDI_NET_TRANSREC ICON "res/nettrrec.ico" #include "lang/hu-HU.rc" #include "lang/id-ID.rc" #include "lang/it-IT.rc" -//#include "lang/ja-JP.rc" FIXME: iconv issue +#include "lang/ja-JP.rc" #include "lang/nl-NL.rc" #include "lang/no-NO.rc" #include "lang/pl-PL.rc" diff --git a/dll/win32/newdev/CMakeLists.txt b/dll/win32/newdev/CMakeLists.txt index 33e519bffaf..d8c112f149d 100644 --- a/dll/win32/newdev/CMakeLists.txt +++ b/dll/win32/newdev/CMakeLists.txt @@ -19,5 +19,5 @@ target_link_libraries(newdev wine) add_importlibs(newdev gdi32 comctl32 setupapi advapi32 user32 shell32 msvcrt kernel32 ntdll) -add_cab_target(newdev 1) +add_cd_file(TARGET newdev DESTINATION reactos/system32 FOR all) add_importlib_target(newdev.spec) diff --git a/dll/win32/ntdsapi/CMakeLists.txt b/dll/win32/ntdsapi/CMakeLists.txt index 2ddfabcdf4e..60f13dbc4d2 100644 --- a/dll/win32/ntdsapi/CMakeLists.txt +++ b/dll/win32/ntdsapi/CMakeLists.txt @@ -17,4 +17,4 @@ target_link_libraries(ntdsapi wine) add_importlibs(ntdsapi user32 kernel32 ntdll) add_importlib_target(ntdsapi.spec) add_dependencies(ntdsapi psdk) -add_cab_target(ntdsapi 1) +add_cd_file(TARGET ntdsapi DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/ntlanman/CMakeLists.txt b/dll/win32/ntlanman/CMakeLists.txt index c741c8aac1d..a97c616cb7a 100644 --- a/dll/win32/ntlanman/CMakeLists.txt +++ b/dll/win32/ntlanman/CMakeLists.txt @@ -17,4 +17,4 @@ target_link_libraries(ntlanman wine) add_importlibs(ntlanman netapi32 msvcrt kernel32 ntdll) -add_cab_target(ntlanman 1) +add_cd_file(TARGET ntlanman DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/ntmarta/CMakeLists.txt b/dll/win32/ntmarta/CMakeLists.txt index 2e7cb18a88e..6e98937dcc1 100644 --- a/dll/win32/ntmarta/CMakeLists.txt +++ b/dll/win32/ntmarta/CMakeLists.txt @@ -24,4 +24,4 @@ add_importlibs(ntmarta kernel32 ntdll) -add_cab_target(ntmarta 1) +add_cd_file(TARGET ntmarta DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/ntprint/CMakeLists.txt b/dll/win32/ntprint/CMakeLists.txt index 9bebbdb55a3..ff7d1681211 100644 --- a/dll/win32/ntprint/CMakeLists.txt +++ b/dll/win32/ntprint/CMakeLists.txt @@ -18,4 +18,4 @@ target_link_libraries(ntprint wine) add_importlibs(ntprint winspool msvcrt kernel32 ntdll) add_dependencies(ntprint psdk) -add_cab_target(ntprint 1) +add_cd_file(TARGET ntprint DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/objsel/CMakeLists.txt b/dll/win32/objsel/CMakeLists.txt index a6cee9b6204..d71651b29b9 100644 --- a/dll/win32/objsel/CMakeLists.txt +++ b/dll/win32/objsel/CMakeLists.txt @@ -29,4 +29,4 @@ add_importlibs(objsel kernel32 ntdll) -add_cab_target(objsel 1) +add_cd_file(TARGET objsel DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/odbc32/CMakeLists.txt b/dll/win32/odbc32/CMakeLists.txt index e4019cdff8d..84aeb39ce6d 100644 --- a/dll/win32/odbc32/CMakeLists.txt +++ b/dll/win32/odbc32/CMakeLists.txt @@ -24,4 +24,4 @@ add_importlibs(odbc32 ntdll) -add_cab_target(odbc32 1) +add_cd_file(TARGET odbc32 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/odbccp32/CMakeLists.txt b/dll/win32/odbccp32/CMakeLists.txt index 00b6696d375..3eb259b7afe 100644 --- a/dll/win32/odbccp32/CMakeLists.txt +++ b/dll/win32/odbccp32/CMakeLists.txt @@ -24,4 +24,4 @@ add_importlibs(odbccp32 ntdll) add_importlib_target(odbccp32.spec) -add_cab_target(odbccp32 1) +add_cd_file(TARGET odbccp32 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/ole32/CMakeLists.txt b/dll/win32/ole32/CMakeLists.txt index f0163bdd930..bb8ccfd6b56 100644 --- a/dll/win32/ole32/CMakeLists.txt +++ b/dll/win32/ole32/CMakeLists.txt @@ -20,7 +20,7 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR} ${REACTOS_SOURCE_DIR}/include/reactos/wine) -add_rpcproxy_library(ole32proxy +add_rpcproxy_files( dcom.idl ole32_unknwn.idl ole32_objidl.idl @@ -65,7 +65,12 @@ list(APPEND SOURCE usrmarshal.c ole32res.rc ${CMAKE_CURRENT_BINARY_DIR}/dcom_i.c + ${CMAKE_CURRENT_BINARY_DIR}/dcom_p.c + ${CMAKE_CURRENT_BINARY_DIR}/ole32_unknwn_p.c + ${CMAKE_CURRENT_BINARY_DIR}/ole32_objidl_p.c + ${CMAKE_CURRENT_BINARY_DIR}/ole32_oleidl_p.c ${CMAKE_CURRENT_BINARY_DIR}/ole32_stubs.c + ${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c ${CMAKE_CURRENT_BINARY_DIR}/ole32.def) add_library(ole32 SHARED ${SOURCE}) @@ -73,7 +78,6 @@ add_library(ole32 SHARED ${SOURCE}) set_module_type(ole32 win32dll) target_link_libraries(ole32 - ole32proxy wine irotrpc uuid @@ -82,5 +86,5 @@ target_link_libraries(ole32 add_importlibs(ole32 advapi32 user32 gdi32 rpcrt4 msvcrt kernel32 ntdll) add_dependencies(ole32 ole32idl) -add_cab_target(ole32 1) +add_cd_file(TARGET ole32 DESTINATION reactos/system32 FOR all) add_importlib_target(ole32.spec) diff --git a/dll/win32/oleacc/CMakeLists.txt b/dll/win32/oleacc/CMakeLists.txt index bf85a9a419a..e9948efb432 100644 --- a/dll/win32/oleacc/CMakeLists.txt +++ b/dll/win32/oleacc/CMakeLists.txt @@ -20,4 +20,4 @@ target_link_libraries(oleacc wine) add_importlibs(oleacc user32 msvcrt kernel32 ntdll) add_importlib_target(oleacc.spec) -add_cab_target(oleacc 1) +add_cd_file(TARGET oleacc DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/oleaut32/CMakeLists.txt b/dll/win32/oleaut32/CMakeLists.txt index 5c5db8bcae3..1a27084c2cb 100644 --- a/dll/win32/oleaut32/CMakeLists.txt +++ b/dll/win32/oleaut32/CMakeLists.txt @@ -20,6 +20,9 @@ list(APPEND SOURCE vartype.c oleaut32.rc ${CMAKE_CURRENT_BINARY_DIR}/oleaut32_stubs.c + ${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c + ${CMAKE_CURRENT_BINARY_DIR}/oleaut32_oaidl_p.c + ${CMAKE_CURRENT_BINARY_DIR}/oleaut32_ocidl_p.c ${CMAKE_CURRENT_BINARY_DIR}/oleaut32.def) remove_definitions(-D_WIN32_WINNT=0x502) @@ -47,14 +50,13 @@ include_directories( spec2def(oleaut32.dll oleaut32.spec) -add_rpcproxy_library(oleaut32proxy oleaut32_oaidl.idl oleaut32_ocidl.idl) +add_rpcproxy_files(oleaut32_oaidl.idl oleaut32_ocidl.idl) add_library(oleaut32 SHARED ${SOURCE}) set_module_type(oleaut32 win32dll) target_link_libraries(oleaut32 - oleaut32proxy wine wineldr uuid @@ -62,5 +64,5 @@ target_link_libraries(oleaut32 add_importlibs(oleaut32 windowscodecs ole32 rpcrt4 user32 gdi32 advapi32 comctl32 urlmon msvcrt kernel32 ntdll) -add_cab_target(oleaut32 1) +add_cd_file(TARGET oleaut32 DESTINATION reactos/system32 FOR all) add_importlib_target(oleaut32.spec) diff --git a/dll/win32/olecli32/CMakeLists.txt b/dll/win32/olecli32/CMakeLists.txt index dc69bc0039c..fa9032389e3 100644 --- a/dll/win32/olecli32/CMakeLists.txt +++ b/dll/win32/olecli32/CMakeLists.txt @@ -17,4 +17,4 @@ target_link_libraries(olecli32 wine) add_importlibs(olecli32 ole32 gdi32 kernel32 ntdll) add_dependencies(olecli32 psdk) -add_cab_target(olecli32 1) +add_cd_file(TARGET olecli32 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/oledlg/CMakeLists.txt b/dll/win32/oledlg/CMakeLists.txt index 00fdb6524c8..e4d838accc1 100644 --- a/dll/win32/oledlg/CMakeLists.txt +++ b/dll/win32/oledlg/CMakeLists.txt @@ -17,4 +17,4 @@ set_module_type(oledlg win32dll) target_link_libraries(oledlg wine) add_importlibs(oledlg ole32 comdlg32 user32 advapi32 msvcrt kernel32 ntdll) add_importlib_target(oledlg.spec) -add_cab_target(oledlg 1) +add_cd_file(TARGET oledlg DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/olepro32/CMakeLists.txt b/dll/win32/olepro32/CMakeLists.txt index 6605de3a6b5..3dda022eeb3 100644 --- a/dll/win32/olepro32/CMakeLists.txt +++ b/dll/win32/olepro32/CMakeLists.txt @@ -20,4 +20,4 @@ add_importlibs(olepro32 kernel32 ntdll) -add_cab_target(olepro32 1) +add_cd_file(TARGET olepro32 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/olesvr32/CMakeLists.txt b/dll/win32/olesvr32/CMakeLists.txt index de3af057ea8..a50cfd70edc 100644 --- a/dll/win32/olesvr32/CMakeLists.txt +++ b/dll/win32/olesvr32/CMakeLists.txt @@ -19,4 +19,4 @@ target_link_libraries(olesvr32 add_importlibs(olesvr32 kernel32 ntdll) add_dependencies(olesvr32 psdk) -add_cab_target(olesvr32 1) +add_cd_file(TARGET olesvr32 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/olethk32/CMakeLists.txt b/dll/win32/olethk32/CMakeLists.txt index 8e5c7c57576..1fa6589c538 100644 --- a/dll/win32/olethk32/CMakeLists.txt +++ b/dll/win32/olethk32/CMakeLists.txt @@ -19,4 +19,4 @@ target_link_libraries(olethk32 wine) add_importlibs(olethk32 msvcrt kernel32 ntdll) add_dependencies(olethk32 psdk) -add_cab_target(olethk32 1) +add_cd_file(TARGET olethk32 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/opengl32/CMakeLists.txt b/dll/win32/opengl32/CMakeLists.txt index 1cf8f188460..a395c5afd7d 100644 --- a/dll/win32/opengl32/CMakeLists.txt +++ b/dll/win32/opengl32/CMakeLists.txt @@ -30,5 +30,5 @@ add_importlibs(opengl32 add_pch(opengl32 ${CMAKE_CURRENT_SOURCE_DIR}/opengl32.h ${SOURCE}) -add_cab_target(opengl32 1) +add_cd_file(TARGET opengl32 DESTINATION reactos/system32 FOR all) add_importlib_target(opengl32.spec) diff --git a/dll/win32/pdh/CMakeLists.txt b/dll/win32/pdh/CMakeLists.txt index 5c8b40bbb97..6a814245ccb 100644 --- a/dll/win32/pdh/CMakeLists.txt +++ b/dll/win32/pdh/CMakeLists.txt @@ -21,4 +21,4 @@ target_link_libraries(pdh wine) add_importlibs(pdh kernel32 ntdll msvcrt) add_importlib_target(pdh.spec) -add_cab_target(pdh 1) +add_cd_file(TARGET pdh DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/pidgen/CMakeLists.txt b/dll/win32/pidgen/CMakeLists.txt index 81c1f7efacb..e175a586c1a 100644 --- a/dll/win32/pidgen/CMakeLists.txt +++ b/dll/win32/pidgen/CMakeLists.txt @@ -19,4 +19,4 @@ target_link_libraries(pidgen wine) add_importlibs(pidgen msvcrt kernel32 ntdll) -add_cab_target(pidgen 1) +add_cd_file(TARGET pidgen DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/powrprof/CMakeLists.txt b/dll/win32/powrprof/CMakeLists.txt index 79beb82cc3a..183a0cba732 100644 --- a/dll/win32/powrprof/CMakeLists.txt +++ b/dll/win32/powrprof/CMakeLists.txt @@ -14,4 +14,4 @@ target_link_libraries(powrprof wine) add_importlibs(powrprof advapi32 user32 comctl32 msvcrt kernel32 ntdll) add_importlib_target(powrprof.spec) -add_cab_target(powrprof 1) +add_cd_file(TARGET powrprof DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/printui/CMakeLists.txt b/dll/win32/printui/CMakeLists.txt index 5eab2d12d98..72777f17c6d 100644 --- a/dll/win32/printui/CMakeLists.txt +++ b/dll/win32/printui/CMakeLists.txt @@ -18,4 +18,4 @@ target_link_libraries(printui wine) add_importlibs(printui shell32 kernel32 ntdll) add_dependencies(printui psdk) -add_cab_target(printui 1) +add_cd_file(TARGET printui DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/psapi/CMakeLists.txt b/dll/win32/psapi/CMakeLists.txt index fe8bbe01a6d..f0666f0210f 100644 --- a/dll/win32/psapi/CMakeLists.txt +++ b/dll/win32/psapi/CMakeLists.txt @@ -16,4 +16,4 @@ target_link_libraries(psapi epsapi ${PSEH_LIB}) add_importlibs(psapi msvcrt kernel32 ntdll) add_importlib_target(psapi.spec) add_pch(psapi ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE}) -add_cab_target(psapi 1) +add_cd_file(TARGET psapi DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/pstorec/CMakeLists.txt b/dll/win32/pstorec/CMakeLists.txt index 88b23c64870..dc5aa64ce06 100644 --- a/dll/win32/pstorec/CMakeLists.txt +++ b/dll/win32/pstorec/CMakeLists.txt @@ -19,4 +19,4 @@ set_module_type(pstorec win32dll) target_link_libraries(pstorec uuid wine) add_importlibs(pstorec msvcrt kernel32 ntdll) add_dependencies(pstorec pstorec_tlb) -add_cab_target(pstorec 1) +add_cd_file(TARGET pstorec DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/qmgr/CMakeLists.txt b/dll/win32/qmgr/CMakeLists.txt index 15d4ad71c23..0cc4ba961e7 100644 --- a/dll/win32/qmgr/CMakeLists.txt +++ b/dll/win32/qmgr/CMakeLists.txt @@ -28,5 +28,5 @@ add_idl_headers(qmgr_idlheader qmgr_local.idl) set_module_type(qmgr win32dll) target_link_libraries(qmgr uuid wine) add_importlibs(qmgr ole32 wininet urlmon advapi32 msvcrt kernel32 ntdll) -add_cab_target(qmgr 1) +add_cd_file(TARGET qmgr DESTINATION reactos/system32 FOR all) add_dependencies(qmgr qmgr_idlheader) diff --git a/dll/win32/qmgrprxy/CMakeLists.txt b/dll/win32/qmgrprxy/CMakeLists.txt index 1659811fa60..c43b631744a 100644 --- a/dll/win32/qmgrprxy/CMakeLists.txt +++ b/dll/win32/qmgrprxy/CMakeLists.txt @@ -12,13 +12,15 @@ spec2def(qmgrprxy.dll qmgrprxy.spec) list(APPEND SOURCE version.rc ${CMAKE_CURRENT_BINARY_DIR}/qmgrprxy_i.c + ${CMAKE_CURRENT_BINARY_DIR}/qmgrprxy_p.c + ${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c ${CMAKE_CURRENT_BINARY_DIR}/qmgrprxy.def) -add_rpcproxy_library(qmgrprxylib qmgrprxy.idl) +add_rpcproxy_files(qmgrprxy.idl) add_library(qmgrprxy SHARED ${SOURCE}) set_module_type(qmgrprxy win32dll) -target_link_libraries(qmgrprxy qmgrprxylib ${PSEH_LIB} wine) +target_link_libraries(qmgrprxy ${PSEH_LIB} wine) add_importlibs(qmgrprxy rpcrt4 msvcrt kernel32 ntdll) -add_cab_target(qmgrprxy 1) +add_cd_file(TARGET qmgrprxy DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/query/CMakeLists.txt b/dll/win32/query/CMakeLists.txt index f934bf87666..3574784cccc 100644 --- a/dll/win32/query/CMakeLists.txt +++ b/dll/win32/query/CMakeLists.txt @@ -19,4 +19,4 @@ target_link_libraries(query add_importlibs(query msvcrt kernel32 ntdll) -add_cab_target(query 1) +add_cd_file(TARGET query DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/rasadhlp/CMakeLists.txt b/dll/win32/rasadhlp/CMakeLists.txt index 417d4e5ab9b..05b95a07f0a 100644 --- a/dll/win32/rasadhlp/CMakeLists.txt +++ b/dll/win32/rasadhlp/CMakeLists.txt @@ -16,4 +16,4 @@ set_module_type(rasadhlp win32dll) add_importlibs(rasadhlp ws2_32 msvcrt kernel32 ntdll) -add_cab_target(rasadhlp 1) +add_cd_file(TARGET rasadhlp DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/rasapi32/CMakeLists.txt b/dll/win32/rasapi32/CMakeLists.txt index 9acb46dee8b..f3d3728b568 100644 --- a/dll/win32/rasapi32/CMakeLists.txt +++ b/dll/win32/rasapi32/CMakeLists.txt @@ -18,4 +18,4 @@ target_link_libraries(rasapi32 wine) add_importlibs(rasapi32 kernel32 ntdll) add_importlib_target(rasapi32.spec) add_dependencies(rasapi32 psdk) -add_cab_target(rasapi32 1) +add_cd_file(TARGET rasapi32 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/rasdlg/CMakeLists.txt b/dll/win32/rasdlg/CMakeLists.txt index de31096c030..0079620d800 100644 --- a/dll/win32/rasdlg/CMakeLists.txt +++ b/dll/win32/rasdlg/CMakeLists.txt @@ -18,4 +18,4 @@ target_link_libraries(rasdlg add_importlibs(rasdlg msvcrt kernel32 ntdll) -add_cab_target(rasdlg 1) +add_cd_file(TARGET rasdlg DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/rasman/CMakeLists.txt b/dll/win32/rasman/CMakeLists.txt index 479dbb4e92d..626f7563172 100644 --- a/dll/win32/rasman/CMakeLists.txt +++ b/dll/win32/rasman/CMakeLists.txt @@ -17,4 +17,4 @@ target_link_libraries(rasman add_importlibs(rasman msvcrt kernel32 ntdll) -add_cab_target(rasman 1) +add_cd_file(TARGET rasman DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/resutils/CMakeLists.txt b/dll/win32/resutils/CMakeLists.txt index 4eb67fbb127..4592d25cbae 100644 --- a/dll/win32/resutils/CMakeLists.txt +++ b/dll/win32/resutils/CMakeLists.txt @@ -17,4 +17,4 @@ target_link_libraries(resutils wine) add_importlibs(resutils msvcrt kernel32 ntdll) -add_cab_target(resutils 1) +add_cd_file(TARGET resutils DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/riched20/CMakeLists.txt b/dll/win32/riched20/CMakeLists.txt index 1f00e6393b0..60362843d05 100644 --- a/dll/win32/riched20/CMakeLists.txt +++ b/dll/win32/riched20/CMakeLists.txt @@ -52,4 +52,4 @@ add_importlibs(riched20 add_importlib_target(riched20.spec) -add_cab_target(riched20 1) +add_cd_file(TARGET riched20 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/riched32/CMakeLists.txt b/dll/win32/riched32/CMakeLists.txt index e4117b39837..0ad88dad648 100644 --- a/dll/win32/riched32/CMakeLists.txt +++ b/dll/win32/riched32/CMakeLists.txt @@ -14,4 +14,4 @@ add_library(riched32 SHARED ${SOURCE}) set_module_type(riched32 win32dll) target_link_libraries(riched32 wine) add_importlibs(riched32 riched20 user32 msvcrt kernel32 ntdll) -add_cab_target(riched32 1) +add_cd_file(TARGET riched32 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/rpcrt4/CMakeLists.txt b/dll/win32/rpcrt4/CMakeLists.txt index df7cca5fcba..e54607353f2 100644 --- a/dll/win32/rpcrt4/CMakeLists.txt +++ b/dll/win32/rpcrt4/CMakeLists.txt @@ -49,5 +49,5 @@ target_link_libraries(rpcrt4 add_importlibs(rpcrt4 msvcrt user32 advapi32 secur32 iphlpapi ws2_32 kernel32 ntdll) add_dependencies(rpcrt4 winesdk) -add_cab_target(rpcrt4 1) +add_cd_file(TARGET rpcrt4 DESTINATION reactos/system32 FOR all) add_importlib_target(rpcrt4.spec) diff --git a/dll/win32/rsabase/CMakeLists.txt b/dll/win32/rsabase/CMakeLists.txt index 94f4aa2eba0..d9060f0e99d 100644 --- a/dll/win32/rsabase/CMakeLists.txt +++ b/dll/win32/rsabase/CMakeLists.txt @@ -13,4 +13,4 @@ add_library(rsabase SHARED ${SOURCE}) set_entrypoint(rsabase 0) target_link_libraries(rsabase wine) add_importlibs(rsabase rsaenh ntdll) -add_cab_target(rsabase 1) +add_cd_file(TARGET rsabase DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/rsaenh/CMakeLists.txt b/dll/win32/rsaenh/CMakeLists.txt index 960abe5cf22..50904526195 100644 --- a/dll/win32/rsaenh/CMakeLists.txt +++ b/dll/win32/rsaenh/CMakeLists.txt @@ -28,4 +28,4 @@ set_module_type(rsaenh win32dll) target_link_libraries(rsaenh wine) add_importlibs(rsaenh msvcrt crypt32 advapi32 kernel32 ntdll) add_importlib_target(rsaenh.spec) -add_cab_target(rsaenh 1) +add_cd_file(TARGET rsaenh DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/samlib/CMakeLists.txt b/dll/win32/samlib/CMakeLists.txt index ea648fa5664..5b2754ad93e 100644 --- a/dll/win32/samlib/CMakeLists.txt +++ b/dll/win32/samlib/CMakeLists.txt @@ -18,5 +18,5 @@ set_module_type(samlib win32dll) add_importlibs(samlib advapi32 msvcrt kernel32 ntdll) -add_cab_target(samlib 1) +add_cd_file(TARGET samlib DESTINATION reactos/system32 FOR all) add_importlib_target(samlib.spec) diff --git a/dll/win32/samsrv/CMakeLists.txt b/dll/win32/samsrv/CMakeLists.txt index 268c4449a82..c69aef6886c 100644 --- a/dll/win32/samsrv/CMakeLists.txt +++ b/dll/win32/samsrv/CMakeLists.txt @@ -13,4 +13,4 @@ add_library(samsrv SHARED ${SOURCE}) set_entrypoint(samsrv 0) add_importlibs(samsrv kernel32 ntdll) add_dependencies(samsrv psdk) -add_cab_target(samsrv 1) +add_cd_file(TARGET samsrv DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/sccbase/CMakeLists.txt b/dll/win32/sccbase/CMakeLists.txt index c0813c735c8..45f0a059c8b 100644 --- a/dll/win32/sccbase/CMakeLists.txt +++ b/dll/win32/sccbase/CMakeLists.txt @@ -17,4 +17,4 @@ target_link_libraries(sccbase wine) add_importlibs(sccbase msvcrt kernel32 ntdll) -add_cab_target(sccbase 1) +add_cd_file(TARGET sccbase DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/schannel/CMakeLists.txt b/dll/win32/schannel/CMakeLists.txt index 3301adb1b68..de83c952b78 100644 --- a/dll/win32/schannel/CMakeLists.txt +++ b/dll/win32/schannel/CMakeLists.txt @@ -20,4 +20,4 @@ target_link_libraries(schannel wine) add_importlibs(schannel secur32 msvcrt kernel32 ntdll) -add_cab_target(schannel 1) +add_cd_file(TARGET schannel DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/secur32/CMakeLists.txt b/dll/win32/secur32/CMakeLists.txt index 3db2d522a65..04ca218a1c6 100644 --- a/dll/win32/secur32/CMakeLists.txt +++ b/dll/win32/secur32/CMakeLists.txt @@ -25,5 +25,5 @@ target_link_libraries(secur32 lsalib) add_importlibs(secur32 advapi32 msvcrt kernel32 ntdll) add_pch(secur32 ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE}) -add_cab_target(secur32 1) +add_cd_file(TARGET secur32 DESTINATION reactos/system32 FOR all) add_importlib_target(secur32.spec) diff --git a/dll/win32/security/CMakeLists.txt b/dll/win32/security/CMakeLists.txt index 2488293ab2a..4ee112ec4c5 100644 --- a/dll/win32/security/CMakeLists.txt +++ b/dll/win32/security/CMakeLists.txt @@ -13,4 +13,4 @@ set_entrypoint(security 0) add_importlibs(security secur32 advapi32 ntdll kernel32) -add_cab_target(security 1) +add_cd_file(TARGET security DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/sensapi/CMakeLists.txt b/dll/win32/sensapi/CMakeLists.txt index fb05f6c02fe..9612da919a8 100644 --- a/dll/win32/sensapi/CMakeLists.txt +++ b/dll/win32/sensapi/CMakeLists.txt @@ -14,4 +14,4 @@ set_module_type(sensapi win32dll) target_link_libraries(sensapi wine) add_importlibs(sensapi msvcrt kernel32 ntdll) add_importlib_target(sensapi.spec) -add_cab_target(sensapi 1) +add_cd_file(TARGET sensapi DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/serialui/CMakeLists.txt b/dll/win32/serialui/CMakeLists.txt index 5ac1ed50fdc..6a2e990a0b9 100644 --- a/dll/win32/serialui/CMakeLists.txt +++ b/dll/win32/serialui/CMakeLists.txt @@ -12,4 +12,4 @@ add_library(serialui SHARED ${SOURCE}) set_module_type(serialui win32dll) add_importlibs(serialui user32 shlwapi msvcrt kernel32) -add_cab_target(serialui 1) +add_cd_file(TARGET serialui DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/setupapi/CMakeLists.txt b/dll/win32/setupapi/CMakeLists.txt index 49085837573..0858278e369 100644 --- a/dll/win32/setupapi/CMakeLists.txt +++ b/dll/win32/setupapi/CMakeLists.txt @@ -59,5 +59,5 @@ add_importlibs(setupapi ntdll) -add_cab_target(setupapi 1) +add_cd_file(TARGET setupapi DESTINATION reactos/system32 FOR all) add_importlib_target(setupapi.spec) diff --git a/dll/win32/sfc/CMakeLists.txt b/dll/win32/sfc/CMakeLists.txt index e17ddc8298b..b01fe34b46c 100644 --- a/dll/win32/sfc/CMakeLists.txt +++ b/dll/win32/sfc/CMakeLists.txt @@ -15,4 +15,4 @@ set_module_type(sfc win32dll) add_importlibs(sfc msvcrt kernel32 ntdll) add_pch(sfc ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE}) -add_cab_target(sfc 1) +add_cd_file(TARGET sfc DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/sfc_os/CMakeLists.txt b/dll/win32/sfc_os/CMakeLists.txt index 8840daf13fb..c50b8f26494 100644 --- a/dll/win32/sfc_os/CMakeLists.txt +++ b/dll/win32/sfc_os/CMakeLists.txt @@ -15,4 +15,4 @@ set_module_type(sfc_os win32dll) add_importlibs(sfc_os msvcrt kernel32 ntdll) add_pch(sfc_os ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE}) -add_cab_target(sfc_os 1) +add_cd_file(TARGET sfc_os DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/shdoclc/CMakeLists.txt b/dll/win32/shdoclc/CMakeLists.txt index 427164e824b..fe4dcba4daf 100644 --- a/dll/win32/shdoclc/CMakeLists.txt +++ b/dll/win32/shdoclc/CMakeLists.txt @@ -14,4 +14,4 @@ target_link_libraries(shdoclc wine) add_importlibs(shdoclc kernel32 ntdll) add_dependencies(shdoclc psdk) -add_cab_target(shdoclc 1) \ No newline at end of file +add_cd_file(TARGET shdoclc DESTINATION reactos/system32 FOR all) \ No newline at end of file diff --git a/dll/win32/shdocvw/CMakeLists.txt b/dll/win32/shdocvw/CMakeLists.txt index 125c4a544fa..db2f0c48a1f 100644 --- a/dll/win32/shdocvw/CMakeLists.txt +++ b/dll/win32/shdocvw/CMakeLists.txt @@ -54,5 +54,5 @@ add_importlibs(shdocvw ntdll) add_dependencies(shdocvw shdocvw_v1) -add_cab_target(shdocvw 1) +add_cd_file(TARGET shdocvw DESTINATION reactos/system32 FOR all) add_importlib_target(shdocvw.spec) diff --git a/dll/win32/shell32/CMakeLists.txt b/dll/win32/shell32/CMakeLists.txt index 9998bbca44b..9bdd9f16463 100644 --- a/dll/win32/shell32/CMakeLists.txt +++ b/dll/win32/shell32/CMakeLists.txt @@ -102,5 +102,5 @@ add_importlibs(shell32 msvcrt ntdll) -add_cab_target(shell32 1) +add_cd_file(TARGET shell32 DESTINATION reactos/system32 FOR all) add_importlib_target(shell32.spec) diff --git a/dll/win32/shell32/lang/sk-SK.rc b/dll/win32/shell32/lang/sk-SK.rc index 084351ce91f..dde08bb84d5 100644 --- a/dll/win32/shell32/lang/sk-SK.rc +++ b/dll/win32/shell32/lang/sk-SK.rc @@ -1,7 +1,7 @@ /* TRANSLATOR : Mário Kaèmár /Mario Kacmar/ aka Kario (kario@szm.sk) * NOTE : partially translated * TRANSLATED : 26-12-2007 - * LAST CHANGE: 31-05-2010 + * LAST CHANGE: 27-03-2011 */ /* @@ -336,7 +336,7 @@ BEGIN LTEXT "Ktoré používate¾ské konto chcete použi k spusteniu tohto programu?", -1, 10, 20, 220, 20 CHECKBOX "Aktuálny používate¾ %s", 14000, 10, 45, 150, 10 LTEXT "Chráni poèítaè a údaje pred neoprávnenými aktivitami programu", -1, 25, 57, 200, 10, WS_DISABLED - CHECKBOX "This option can prevent computer viruses from harming your computer or personal data, but selecting it might cause the program to function improperly.", 14001, 25, 68, 200, 30, WS_DISABLED | BS_MULTILINE + CHECKBOX "Táto možnos môže zabráni poèítaèovým vírusom aby poškodili poèítaè alebo osobné údaje, ale jej zvolenie môže spôsobi, že program nebude správne fungova.", 14001, 25, 68, 200, 30, WS_DISABLED | BS_MULTILINE CHECKBOX "Nasledujúci používate¾:", 14002, 10, 100, 90, 10 LTEXT "Meno používate¾a:", -1, 20, 118, 54, 10 COMBOBOX 14003, 75, 115, 100, 15, CBS_DROPDOWNLIST | WS_VSCROLL | WS_VISIBLE | WS_TABSTOP @@ -675,10 +675,10 @@ BEGIN IDS_LOGOFF_PROMPT "Naozaj sa chcete odhlási?" /* Run File dialog */ - IDS_RUNDLG_ERROR "Unable to display Run File dialog box (internal error)" - IDS_RUNDLG_BROWSE_ERROR "Unable to display Browse dialog box (internal error)" - IDS_RUNDLG_BROWSE_CAPTION "Browse" - IDS_RUNDLG_BROWSE_FILTER "Executable Files (*.exe)\0*.exe\0All Files (*.*)\0*.*\0" + IDS_RUNDLG_ERROR "Nemožno zobrazi dialogové okno Spusti súbor (vnútorná chyba)" + IDS_RUNDLG_BROWSE_ERROR "Nemožno zobrazi dialogové okno Preh¾adáva (vnútorná chyba)" + IDS_RUNDLG_BROWSE_CAPTION "Preh¾adáva" + IDS_RUNDLG_BROWSE_FILTER "Spustite¾né súbory (*.exe)\0*.exe\0Všetky súbory (*.*)\0*.*\0" /* shell folder path default values */ IDS_PROGRAMS "Ponuka Štart\\Programy" @@ -729,10 +729,10 @@ BEGIN IDS_RECYCLEBIN_DISKSPACE "Dostupné miesto" IDS_EMPTY_BITBUCKET "Vyprázdni Kôš" IDS_PICK_ICON_TITLE "Choose Icon" - IDS_PICK_ICON_FILTER "Súbory ikon (*.ico, *.icl, *.exe, *.dll)\0*.ico;*.icl;*.exe;*.dll\0All Files (*.*)\0*.*\0" - IDS_OPEN_WITH_FILTER "Spustite¾né súbory (*.exe)\0*.exe\0All Files (*.*)\0*.*\0" + IDS_PICK_ICON_FILTER "Súbory ikon (*.ico, *.icl, *.exe, *.dll)\0*.ico;*.icl;*.exe;*.dll\0Všetky súbory (*.*)\0*.*\0" + IDS_OPEN_WITH_FILTER "Spustite¾né súbory (*.exe)\0*.exe\0Všetky súbory (*.*)\0*.*\0" IDS_DIRECTORY "Prieèinok" - IDS_VIRTUAL_DRIVER "Virtual Device Driver" + IDS_VIRTUAL_DRIVER "Ovládaè virtuálneho zariadenia" IDS_BAT_FILE "Dávkový súbor systému ReactOS" IDS_CMD_FILE "Príkazový skript systému ReactOS" IDS_COM_FILE "DOS aplikácia" diff --git a/dll/win32/shell32/shell32.rc b/dll/win32/shell32/shell32.rc index 825f7e1ae0b..1a93be1865c 100644 --- a/dll/win32/shell32/shell32.rc +++ b/dll/win32/shell32/shell32.rc @@ -60,7 +60,7 @@ END #include "lang/fr-FR.rc" #include "lang/hu-HU.rc" #include "lang/it-IT.rc" -//#include "lang/ja-JP.rc" FIXME: iconv issue +#include "lang/ja-JP.rc" #include "lang/ko-KR.rc" #include "lang/nl-NL.rc" #include "lang/no-NO.rc" diff --git a/dll/win32/shell32/shlview.c b/dll/win32/shell32/shlview.c index ff05864eb80..2218504735d 100644 --- a/dll/win32/shell32/shlview.c +++ b/dll/win32/shell32/shlview.c @@ -1853,6 +1853,12 @@ static LRESULT CALLBACK ShellView_WndProc(HWND hWnd, UINT uMessage, WPARAM wPara (pThis->FolderSettings.fFlags & FWF_TRANSPARENT)) return SendMessageW(pThis->hWndParent, WM_ERASEBKGND, wParam, lParam); /* redirect to parent */ break; + + case WM_SYSCOLORCHANGE: + /* Forward WM_SYSCOLORCHANGE to common controls */ + SendMessage(pThis->hWndList, WM_SYSCOLORCHANGE, 0, 0); + break; + case CWM_GETISHELLBROWSER: return (LRESULT)pThis->pShellBrowser; } diff --git a/dll/win32/shfolder/CMakeLists.txt b/dll/win32/shfolder/CMakeLists.txt index dba58f784f5..92b32eb30ec 100644 --- a/dll/win32/shfolder/CMakeLists.txt +++ b/dll/win32/shfolder/CMakeLists.txt @@ -15,4 +15,4 @@ set_entrypoint(shfolder 0) target_link_libraries(shfolder wine) add_importlibs(shfolder shell32 kernel32 ntdll) add_dependencies(shfolder psdk) -add_cab_target(shfolder 1) +add_cd_file(TARGET shfolder DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/shimgvw/CMakeLists.txt b/dll/win32/shimgvw/CMakeLists.txt index 2976ddd3cf7..1514361c732 100644 --- a/dll/win32/shimgvw/CMakeLists.txt +++ b/dll/win32/shimgvw/CMakeLists.txt @@ -24,4 +24,4 @@ add_importlibs(shimgvw kernel32 ntdll) -add_cab_target(shimgvw 1) +add_cd_file(TARGET shimgvw DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/shimgvw/lang/fr-FR.rc b/dll/win32/shimgvw/lang/fr-FR.rc new file mode 100644 index 00000000000..6440bae798f --- /dev/null +++ b/dll/win32/shimgvw/lang/fr-FR.rc @@ -0,0 +1,17 @@ +LANGUAGE LANG_FRENCH, SUBLANG_DEFAULT + +STRINGTABLE +BEGIN + IDS_APPTITLE "Visionneuse d'Images et Fax de ReactOS" + IDS_SETASDESKBG "Définir comme Arrière-plan du Bureau" + + /* Tooltips */ + IDS_TOOLTIP_NEXT_PIC "Image Suivante" + IDS_TOOLTIP_PREV_PIC "Image Précédente" + IDS_TOOLTIP_ZOOM_IN "Augmenter (+)" + IDS_TOOLTIP_ZOOM_OUT "Diminuer (-)" + IDS_TOOLTIP_ROT_CLOCKW "Tourner dans le sens des aiguilles d'une montre (Ctrl+K)" + IDS_TOOLTIP_ROT_COUNCW "Tourner dans le sens opposé des aiguilles d'une montre (Ctrl+L)" + IDS_TOOLTIP_PRINT "Imprimer (Ctrl+P)" + IDS_TOOLTIP_SAVEAS "Enregistrer sous... (Ctrl+S)" +END diff --git a/dll/win32/shimgvw/rsrc.rc b/dll/win32/shimgvw/rsrc.rc index 3f4e96012fd..55f1bd3cb83 100644 --- a/dll/win32/shimgvw/rsrc.rc +++ b/dll/win32/shimgvw/rsrc.rc @@ -6,6 +6,7 @@ #include "lang/de-DE.rc" #include "lang/en-US.rc" #include "lang/es-ES.rc" +#include "lang/fr-FR.rc" #include "lang/it-IT.rc" #include "lang/no-NO.rc" #include "lang/lt-LT.rc" diff --git a/dll/win32/shimgvw/shimgvw.c b/dll/win32/shimgvw/shimgvw.c index f27db29d45c..e8796499fac 100644 --- a/dll/win32/shimgvw/shimgvw.c +++ b/dll/win32/shimgvw/shimgvw.c @@ -519,12 +519,6 @@ ImageView_PrintToW(HWND hwnd, HINSTANCE hInst, LPCWSTR path, int nShow) DPRINT("ImageView_PrintToW() not implemented\n"); } -VOID WINAPI -imageview_fullscreenW(HWND hwnd, HINSTANCE hInst, LPCWSTR path, int nShow) -{ - DPRINT("ImageView_fullscreenW() not implemented\n"); -} - BOOL WINAPI DllMain(IN HINSTANCE hinstDLL, IN DWORD dwReason, diff --git a/dll/win32/shimgvw/shimgvw.spec b/dll/win32/shimgvw/shimgvw.spec index 262cb50c7b2..427eaa4ca7c 100644 --- a/dll/win32/shimgvw/shimgvw.spec +++ b/dll/win32/shimgvw/shimgvw.spec @@ -5,7 +5,7 @@ @ stdcall ImageView_PrintTo(ptr ptr wstr long) @ stdcall ImageView_PrintToA(ptr ptr str long) @ stdcall ImageView_PrintToW(ptr ptr wstr long) -@ stdcall imageview_fullscreenW(ptr ptr wstr long) +@ stdcall imageview_fullscreenW(ptr ptr wstr long) ImageView_FullscreenW @ stub ConvertDIBSECTIONToThumbnail @ stub -private DllCanUnloadNow @ stub -private DllGetClassObject diff --git a/dll/win32/shlwapi/CMakeLists.txt b/dll/win32/shlwapi/CMakeLists.txt index eb444a985ca..f4d8ab7023b 100644 --- a/dll/win32/shlwapi/CMakeLists.txt +++ b/dll/win32/shlwapi/CMakeLists.txt @@ -52,6 +52,6 @@ add_importlibs(shlwapi msvcrt ntdll) -add_cab_target(shlwapi 1) +add_cd_file(TARGET shlwapi DESTINATION reactos/system32 FOR all) add_importlib_target(shlwapi.spec) diff --git a/dll/win32/slbcsp/CMakeLists.txt b/dll/win32/slbcsp/CMakeLists.txt index 67d8326a3fe..50fb9d944d9 100644 --- a/dll/win32/slbcsp/CMakeLists.txt +++ b/dll/win32/slbcsp/CMakeLists.txt @@ -17,4 +17,4 @@ target_link_libraries(slbcsp wine) add_importlibs(slbcsp msvcrt kernel32 ntdll) -add_cab_target(slbcsp 1) +add_cd_file(TARGET slbcsp DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/smdll/CMakeLists.txt b/dll/win32/smdll/CMakeLists.txt index 9d5d1cac1e9..cb850fc1bde 100644 --- a/dll/win32/smdll/CMakeLists.txt +++ b/dll/win32/smdll/CMakeLists.txt @@ -14,5 +14,5 @@ add_library(smdll SHARED ${SOURCE}) target_link_libraries(smdll smlib) add_importlibs(smdll ntdll) add_dependencies(smdll psdk) -add_cab_target(smdll 1) +add_cd_file(TARGET smdll DESTINATION reactos/system32 FOR all) add_importlib_target(smdll.spec) diff --git a/dll/win32/sndblst/CMakeLists.txt b/dll/win32/sndblst/CMakeLists.txt index b78fc3d5218..07dfe79864f 100644 --- a/dll/win32/sndblst/CMakeLists.txt +++ b/dll/win32/sndblst/CMakeLists.txt @@ -15,4 +15,4 @@ add_library(sndblst SHARED ${SOURCE}) set_module_type(sndblst win32dll) target_link_libraries(sndblst mment4 mmebuddy) add_importlibs(sndblst user32 winmm advapi32 msvcrt kernel32 ntdll) -add_cab_target(sndblst 1) +add_cd_file(TARGET sndblst DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/snmpapi/CMakeLists.txt b/dll/win32/snmpapi/CMakeLists.txt index 9bde5c48610..325d372ccf1 100644 --- a/dll/win32/snmpapi/CMakeLists.txt +++ b/dll/win32/snmpapi/CMakeLists.txt @@ -22,5 +22,5 @@ target_link_libraries(snmpapi wine) add_importlibs(snmpapi msvcrt kernel32 ntdll) -add_cab_target(snmpapi 1) +add_cd_file(TARGET snmpapi DESTINATION reactos/system32 FOR all) add_importlib_target(snmpapi.spec) diff --git a/dll/win32/softpub/CMakeLists.txt b/dll/win32/softpub/CMakeLists.txt index d2915a93779..a4fb73cfbea 100644 --- a/dll/win32/softpub/CMakeLists.txt +++ b/dll/win32/softpub/CMakeLists.txt @@ -13,4 +13,4 @@ target_link_libraries(softpub wine) add_importlibs(softpub wintrust) -add_cab_target(softpub 1) \ No newline at end of file +add_cd_file(TARGET softpub DESTINATION reactos/system32 FOR all) \ No newline at end of file diff --git a/dll/win32/spoolss/CMakeLists.txt b/dll/win32/spoolss/CMakeLists.txt index a7ad5df883b..771a63e5f36 100644 --- a/dll/win32/spoolss/CMakeLists.txt +++ b/dll/win32/spoolss/CMakeLists.txt @@ -19,4 +19,4 @@ target_link_libraries(spoolss wine) add_importlibs(spoolss winspool msvcrt kernel32 ntdll) add_importlib_target(spoolss.spec) -add_cab_target(spoolss 1) +add_cd_file(TARGET spoolss DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/srclient/CMakeLists.txt b/dll/win32/srclient/CMakeLists.txt index 3692f75e1fc..e6088bb1453 100644 --- a/dll/win32/srclient/CMakeLists.txt +++ b/dll/win32/srclient/CMakeLists.txt @@ -12,4 +12,4 @@ set_entrypoint(srclient 0) add_importlibs(srclient kernel32 ntdll) add_dependencies(srclient psdk) -add_cab_target(srclient 1) +add_cd_file(TARGET srclient DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/stdole2.tlb/CMakeLists.txt b/dll/win32/stdole2.tlb/CMakeLists.txt index 2c32ce8df82..16b15175704 100644 --- a/dll/win32/stdole2.tlb/CMakeLists.txt +++ b/dll/win32/stdole2.tlb/CMakeLists.txt @@ -15,4 +15,4 @@ add_library(stdole2.tlb SHARED ${SOURCE}) set_entrypoint(stdole2.tlb 0) set_target_properties(stdole2.tlb PROPERTIES SUFFIX "") add_dependencies(stdole2.tlb std_ole_v2) -add_cab_target(stdole2.tlb 1) +add_cd_file(TARGET stdole2.tlb DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/stdole32.tlb/CMakeLists.txt b/dll/win32/stdole32.tlb/CMakeLists.txt index 72d75bdbb94..b563d273fc5 100644 --- a/dll/win32/stdole32.tlb/CMakeLists.txt +++ b/dll/win32/stdole32.tlb/CMakeLists.txt @@ -16,4 +16,4 @@ set_entrypoint(stdole32.tlb 0) set_target_properties(stdole32.tlb PROPERTIES SUFFIX "") add_dependencies(stdole32.tlb std_ole_v1) -add_cab_target(stdole32.tlb 1) +add_cd_file(TARGET stdole32.tlb DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/sti/CMakeLists.txt b/dll/win32/sti/CMakeLists.txt index c1c7fa6aa14..9a06b70d782 100644 --- a/dll/win32/sti/CMakeLists.txt +++ b/dll/win32/sti/CMakeLists.txt @@ -16,16 +16,17 @@ list(APPEND SOURCE regsvr.c sti.c sti_main.c + ${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c + ${CMAKE_CURRENT_BINARY_DIR}/sti_wia_p.c ${CMAKE_CURRENT_BINARY_DIR}/sti.def) -add_rpcproxy_library(stiproxy sti_wia.idl) +add_rpcproxy_files(sti_wia.idl) add_library(sti SHARED ${SOURCE}) set_entrypoint(sti 0) target_link_libraries(sti - stiproxy wine uuid ${PSEH_LIB}) @@ -38,4 +39,4 @@ add_importlibs(sti kernel32 ntdll) -add_cab_target(sti 1) +add_cd_file(TARGET sti DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/sxs/CMakeLists.txt b/dll/win32/sxs/CMakeLists.txt index 5cdf08d64ef..74e5742fe6e 100644 --- a/dll/win32/sxs/CMakeLists.txt +++ b/dll/win32/sxs/CMakeLists.txt @@ -17,4 +17,4 @@ target_link_libraries(sxs wine) add_importlibs(sxs kernel32 ntdll) add_dependencies(sxs psdk) -add_cab_target(sxs 1) +add_cd_file(TARGET sxs DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/syssetup/CMakeLists.txt b/dll/win32/syssetup/CMakeLists.txt index 9cc967b4dd3..9f8ac236bd0 100644 --- a/dll/win32/syssetup/CMakeLists.txt +++ b/dll/win32/syssetup/CMakeLists.txt @@ -39,4 +39,4 @@ add_importlibs(syssetup ntdll) -add_cab_target(syssetup 1) +add_cd_file(TARGET syssetup DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/syssetup/syssetup.rc b/dll/win32/syssetup/syssetup.rc index bf10ebec37b..d13f09ba5eb 100644 --- a/dll/win32/syssetup/syssetup.rc +++ b/dll/win32/syssetup/syssetup.rc @@ -63,7 +63,7 @@ IDR_GPL RT_TEXT "COPYING" #include "lang/hu-HU.rc" #include "lang/id-ID.rc" #include "lang/it-IT.rc" -//#include "lang/ja-JP.rc" FIXME: iconv issue +#include "lang/ja-JP.rc" #include "lang/no-NO.rc" #include "lang/nl-NL.rc" #include "lang/pl-PL.rc" diff --git a/dll/win32/t2embed/CMakeLists.txt b/dll/win32/t2embed/CMakeLists.txt index 93bc2e74f54..c4b4d67a16f 100644 --- a/dll/win32/t2embed/CMakeLists.txt +++ b/dll/win32/t2embed/CMakeLists.txt @@ -19,4 +19,4 @@ target_link_libraries(t2embed wine) add_importlibs(t2embed gdi32 user32 advapi32 version msvcrt kernel32 ntdll) -add_cab_target(t2embed 1) +add_cd_file(TARGET t2embed DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/tapi32/CMakeLists.txt b/dll/win32/tapi32/CMakeLists.txt index 67e08061666..41017c22ee5 100644 --- a/dll/win32/tapi32/CMakeLists.txt +++ b/dll/win32/tapi32/CMakeLists.txt @@ -21,4 +21,4 @@ target_link_libraries(tapi32 wine) add_importlibs(tapi32 advapi32 kernel32 ntdll) add_dependencies(tapi32 psdk) -add_cab_target(tapi32 1) +add_cd_file(TARGET tapi32 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/tapiui/CMakeLists.txt b/dll/win32/tapiui/CMakeLists.txt index c24b27ddce9..a9bb4f5d442 100644 --- a/dll/win32/tapiui/CMakeLists.txt +++ b/dll/win32/tapiui/CMakeLists.txt @@ -4,4 +4,4 @@ set_rc_compiler() add_library(tapiui SHARED tapiui.rc) set_entrypoint(tapiui 0) add_dependencies(tapiui psdk) -add_cab_target(tapiui 1) +add_cd_file(TARGET tapiui DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/traffic/CMakeLists.txt b/dll/win32/traffic/CMakeLists.txt index 3ed8580638c..64764005630 100644 --- a/dll/win32/traffic/CMakeLists.txt +++ b/dll/win32/traffic/CMakeLists.txt @@ -17,4 +17,4 @@ target_link_libraries(traffic wine) add_importlibs(traffic msvcrt kernel32 ntdll) add_dependencies(traffic psdk) -add_cab_target(traffic 1) +add_cd_file(TARGET traffic DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/twain_32/CMakeLists.txt b/dll/win32/twain_32/CMakeLists.txt index a99d4a06f6f..5eb3ac68cf3 100644 --- a/dll/win32/twain_32/CMakeLists.txt +++ b/dll/win32/twain_32/CMakeLists.txt @@ -18,4 +18,4 @@ add_library(twain_32 SHARED ${SOURCE}) set_module_type(twain_32 win32dll) target_link_libraries(twain_32 wine) add_importlibs(twain_32 msvcrt kernel32 ntdll) -add_cab_target(twain_32 1) +add_cd_file(TARGET twain_32 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/uext2/CMakeLists.txt b/dll/win32/uext2/CMakeLists.txt index 624d7e2cfe8..19858c8f0b4 100644 --- a/dll/win32/uext2/CMakeLists.txt +++ b/dll/win32/uext2/CMakeLists.txt @@ -11,4 +11,4 @@ add_library(uext2 SHARED ${SOURCE}) set_module_type(uext2 win32dll) target_link_libraries(uext2 ext2lib) add_importlibs(uext2 msvcrt kernel32 ntdll) -add_cab_target(uext2 1) +add_cd_file(TARGET uext2 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/ufat/CMakeLists.txt b/dll/win32/ufat/CMakeLists.txt index 6c40b68cea4..658ab44fb36 100644 --- a/dll/win32/ufat/CMakeLists.txt +++ b/dll/win32/ufat/CMakeLists.txt @@ -11,4 +11,4 @@ add_library(ufat SHARED ${SOURCE}) set_module_type(ufat win32dll) target_link_libraries(ufat vfatlib) add_importlibs(ufat msvcrt kernel32 ntdll) -add_cab_target(ufat 1) +add_cd_file(TARGET ufat DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/ufatx/CMakeLists.txt b/dll/win32/ufatx/CMakeLists.txt index 79b262b89e8..8cf783e9fab 100644 --- a/dll/win32/ufatx/CMakeLists.txt +++ b/dll/win32/ufatx/CMakeLists.txt @@ -13,4 +13,4 @@ target_link_libraries(ufatx vfatxlib -lgcc) add_importlibs(ufatx kernel32 ntdll) add_importlib_target(ufatx.spec) add_dependencies(ufatx psdk) -add_cab_target(ufatx 1) +add_cd_file(TARGET ufatx DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/unicows/CMakeLists.txt b/dll/win32/unicows/CMakeLists.txt index e9e4f79a38e..27ecb838a7d 100644 --- a/dll/win32/unicows/CMakeLists.txt +++ b/dll/win32/unicows/CMakeLists.txt @@ -26,4 +26,4 @@ add_importlibs(unicows advapi32 kernel32 ntdll) -add_cab_target(unicows 1) +add_cd_file(TARGET unicows DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/untfs/CMakeLists.txt b/dll/win32/untfs/CMakeLists.txt index 88094935bbd..0416542d1e0 100644 --- a/dll/win32/untfs/CMakeLists.txt +++ b/dll/win32/untfs/CMakeLists.txt @@ -11,4 +11,4 @@ add_library(untfs SHARED ${SOURCE}) set_module_type(untfs win32dll) target_link_libraries(untfs ntfslib) add_importlibs(untfs msvcrt kernel32 ntdll) -add_cab_target(untfs 1) +add_cd_file(TARGET untfs DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/updspapi/CMakeLists.txt b/dll/win32/updspapi/CMakeLists.txt index ca28359f3ed..456ccde58f2 100644 --- a/dll/win32/updspapi/CMakeLists.txt +++ b/dll/win32/updspapi/CMakeLists.txt @@ -17,4 +17,4 @@ target_link_libraries(updspapi wine) add_importlibs(updspapi setupapi kernel32 ntdll) add_dependencies(updspapi psdk) -add_cab_target(updspapi 1) +add_cd_file(TARGET updspapi DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/url/CMakeLists.txt b/dll/win32/url/CMakeLists.txt index c98d150d208..ee901a062a3 100644 --- a/dll/win32/url/CMakeLists.txt +++ b/dll/win32/url/CMakeLists.txt @@ -17,4 +17,4 @@ target_link_libraries(url wine) add_importlibs(url shell32 shlwapi msvcrt kernel32 ntdll) -add_cab_target(url 1) +add_cd_file(TARGET url DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/urlmon/CMakeLists.txt b/dll/win32/urlmon/CMakeLists.txt index bb50265e14f..76abc2893e1 100644 --- a/dll/win32/urlmon/CMakeLists.txt +++ b/dll/win32/urlmon/CMakeLists.txt @@ -10,7 +10,7 @@ set_rc_compiler() spec2def(urlmon.dll urlmon.spec) -add_rpcproxy_library(urlmonproxy urlmon_urlmon.idl) +add_rpcproxy_files(urlmon_urlmon.idl) list(APPEND SOURCE bindctx.c @@ -36,6 +36,8 @@ list(APPEND SOURCE urlmon_main.c usrmarshal.c rsrc.rc + ${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c + ${CMAKE_CURRENT_BINARY_DIR}/urlmon_urlmon_p.c ${CMAKE_CURRENT_BINARY_DIR}/urlmon_stubs.c ${CMAKE_CURRENT_BINARY_DIR}/urlmon.def) @@ -45,7 +47,6 @@ add_library(urlmon SHARED ${SOURCE}) set_module_type(urlmon win32dll) target_link_libraries(urlmon - urlmonproxy uuid wine ${PSEH_LIB}) @@ -72,5 +73,5 @@ add_definitions( add_definitions(-DPROXY_CLSID_IS="{0x79EAC9F1,0xBAF9,0x11CE,{0x8C,0x82,0x00,0xAA,0x00,0x4B,0xA9,0x0B}}") -add_cab_target(urlmon 1) +add_cd_file(TARGET urlmon DESTINATION reactos/system32 FOR all) add_importlib_target(urlmon.spec) diff --git a/dll/win32/user32/CMakeLists.txt b/dll/win32/user32/CMakeLists.txt index 53293f8a18f..1be88006fc3 100644 --- a/dll/win32/user32/CMakeLists.txt +++ b/dll/win32/user32/CMakeLists.txt @@ -80,5 +80,5 @@ target_link_libraries(user32 add_pch(user32 ${CMAKE_CURRENT_SOURCE_DIR}/include/user32.h ${SOURCE}) add_importlibs(user32 gdi32 advapi32 imm32 msvcrt kernel32 ntdll) -add_cab_target(user32 1) +add_cd_file(TARGET user32 DESTINATION reactos/system32 FOR all) add_importlib_target(user32.spec) diff --git a/subsystems/win32/csrss/win32csr/appswitch.c b/dll/win32/user32/controls/appswitch.c similarity index 90% rename from subsystems/win32/csrss/win32csr/appswitch.c rename to dll/win32/user32/controls/appswitch.c index f816a8303ad..f9cfc445d45 100644 --- a/subsystems/win32/csrss/win32csr/appswitch.c +++ b/dll/win32/user32/controls/appswitch.c @@ -2,14 +2,15 @@ /* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries - * FILE: subsys/csrss/win32csr/appswitch.c + * FILE: dll/win32/user32/controls/appswitch.c * PURPOSE: app switching functionality * PROGRAMMERS: Johannes Anderwald (janderwald@reactos.org) */ -#define NDEBUG -#include "w32csr.h" -#include +#include + +#include +WINE_DEFAULT_DEBUG_CHANNEL(user32); typedef struct APPSWITCH_ITEM { @@ -55,7 +56,7 @@ EnumWindowEnumProc( hProcess = OpenProcess(PROCESS_QUERY_INFORMATION|PROCESS_VM_READ, FALSE, dwPid); if (hProcess) { - if (GetModuleFileNameExW(hProcess, NULL, szFileName, MAX_PATH)) +// if (GetModuleFileNameExW(hProcess, NULL, szFileName, MAX_PATH)) { szFileName[MAX_PATH-1] = L'\0'; PrivateExtractIconExW(szFileName, 0, &hIcon, NULL, 1); @@ -70,7 +71,7 @@ EnumWindowEnumProc( /* get the text length */ Length = SendMessageW(hwnd, WM_GETTEXTLENGTH, 0, 0); /* allocate item structure for it */ - pItem = (PAPPSWITCH_ITEM)HeapAlloc(Win32CsrApiHeap, HEAP_ZERO_MEMORY, sizeof(APPSWITCH_ITEM) + Length * sizeof(WCHAR)); +// pItem = (PAPPSWITCH_ITEM)HeapAlloc(Win32CsrApiHeap, HEAP_ZERO_MEMORY, sizeof(APPSWITCH_ITEM) + Length * sizeof(WCHAR)); if (!pItem) return TRUE; if (Length) @@ -165,7 +166,7 @@ KeyboardHookProc( /* FIXME * launch window */ - DPRINT1("launch alt-tab window\n"); + FIXME("launch alt-tab window\n"); } else { @@ -205,7 +206,7 @@ PaintAppWindows(HWND hwndDlg, HDC hDc) SetRect(&Rect, X-5, Y-5, X + XSize + 5, Y + YSize + 5); FillRect(hDc, &Rect, hBrush); DeleteObject((HGDIOBJ)hBrush); - SendDlgItemMessageW(hwndDlg, IDC_STATIC_CUR_APP, WM_SETTEXT, 0, (LPARAM)pCurItem->szText); +// SendDlgItemMessageW(hwndDlg, IDC_STATIC_CUR_APP, WM_SETTEXT, 0, (LPARAM)pCurItem->szText); } DrawIcon(hDc, X, Y, pCurItem->hIcon); @@ -223,7 +224,7 @@ DestroyAppWindows() { pNextItem = pCurItem->Next; DestroyIcon(pCurItem->hIcon); - HeapFree(Win32CsrApiHeap, 0, pCurItem); +// HeapFree(Win32CsrApiHeap, 0, pCurItem); pCurItem = pNextItem; } pRoot = NULL; @@ -265,5 +266,5 @@ WINAPI InitializeAppSwitchHook() { hhk = SetWindowsHookEx(WH_KEYBOARD_LL, KeyboardHookProc, NULL, 0); - DPRINT("InitializeAppSwitchHook hhk %p\n", hhk); + TRACE("InitializeAppSwitchHook hhk %p\n", hhk); } diff --git a/dll/win32/user32/windows/defwnd.c b/dll/win32/user32/windows/defwnd.c index edee49dac73..83155b66ca6 100644 --- a/dll/win32/user32/windows/defwnd.c +++ b/dll/win32/user32/windows/defwnd.c @@ -753,12 +753,12 @@ DefWndHandleSysCommand(HWND hWnd, WPARAM wParam, LPARAM lParam) { WINDOWPLACEMENT wp; POINT Pt; + LRESULT lResult; if (!IsWindowEnabled( hWnd )) return 0; if (ISITHOOKED(WH_CBT)) { - LRESULT lResult; NtUserMessageCall( hWnd, WM_SYSCOMMAND, wParam, lParam, (ULONG_PTR)&lResult, FNID_DEFWINDOWPROC, FALSE); if (lResult) return 0; } @@ -795,7 +795,7 @@ DefWndHandleSysCommand(HWND hWnd, WPARAM wParam, LPARAM lParam) break; case SC_CLOSE: return SendMessageW(hWnd, WM_CLOSE, 0, 0); - +// case SC_DEFAULT: case SC_MOUSEMENU: { Pt.x = (short)LOWORD(lParam); @@ -815,9 +815,40 @@ DefWndHandleSysCommand(HWND hWnd, WPARAM wParam, LPARAM lParam) } break; + case SC_SCREENSAVE: + NtUserMessageCall( hWnd, WM_SYSCOMMAND, wParam, lParam, (ULONG_PTR)&lResult, FNID_DEFWINDOWPROC, FALSE); + break; + + case SC_NEXTWINDOW: + case SC_PREVWINDOW: + FIXME("Implement Alt-Tab!!! wParam 0x%x lParam 0x%x\n",wParam,lParam); + break; + + case SC_HOTKEY: + { + HWND hwnd, hWndLastActive; + + hwnd = (HWND)lParam; + PWND pWnd = ValidateHwnd(hwnd); + if (pWnd) + { + hWndLastActive = GetLastActivePopup(hwnd); + if (hWndLastActive) + { + hwnd = hWndLastActive; + pWnd = ValidateHwnd(hwnd); + } + SetForegroundWindow(hwnd); + if (pWnd->style & WS_MINIMIZE) + { + PostMessage(hwnd, WM_SYSCOMMAND, SC_RESTORE, 0); + } + } + } + break; + default: - /* FIXME: Implement */ - UNIMPLEMENTED; + FIXME("Unimplemented DefWndHandleSysCommand wParam 0x%x\n",wParam); break; } @@ -1380,39 +1411,49 @@ User32DefWindowProc(HWND hWnd, if(wParam == VK_F10) iF10Key = VK_F10; break; - /* FIXME: This is also incomplete. */ case WM_SYSKEYDOWN: { if (HIWORD(lParam) & KEYDATA_ALT) - { - HWND top = GetAncestor(hWnd, GA_ROOT); - /* if( HIWORD(lParam) & ~KEYDATA_PREVSTATE ) */ - if ( (wParam == VK_MENU || wParam == VK_LMENU - || wParam == VK_RMENU) && !iMenuSysKey ) - iMenuSysKey = 1; - else - iMenuSysKey = 0; + { /* Previous state, if the key was down before this message, + this is a cheap way to ignore autorepeat keys. */ + if ( !(HIWORD(lParam) & KEYDATA_PREVSTATE) ) + { + if ( ( wParam == VK_MENU || + wParam == VK_LMENU || + wParam == VK_RMENU ) && !iMenuSysKey ) + iMenuSysKey = 1; + else + iMenuSysKey = 0; + } iF10Key = 0; if (wParam == VK_F4) /* Try to close the window */ { - if (!(GetClassLongPtrW(top, GCL_STYLE) & CS_NOCLOSE)) - { - if (bUnicode) - PostMessageW(top, WM_SYSCOMMAND, SC_CLOSE, 0); - else - PostMessageA(top, WM_SYSCOMMAND, SC_CLOSE, 0); - } + HWND top = GetAncestor(hWnd, GA_ROOT); + if (!(GetClassLongPtrW(top, GCL_STYLE) & CS_NOCLOSE)) + PostMessageW(top, WM_SYSCOMMAND, SC_CLOSE, 0); } - else if (wParam == VK_SNAPSHOT) + else if (wParam == VK_SNAPSHOT) // Alt-VK_SNAPSHOT? { - HWND hwnd = hWnd; - while (GetParent(hwnd) != NULL) - { - hwnd = GetParent(hwnd); - } - DefWndScreenshot(hwnd); + HWND hwnd = hWnd; + while (GetParent(hwnd) != NULL) + { + hwnd = GetParent(hwnd); + } + DefWndScreenshot(hwnd); + } + else if ( wParam == VK_ESCAPE || wParam == VK_TAB ) // Alt-Tab/ESC Alt-Shift-Tab/ESC + { + WPARAM wParamTmp; + HWND Active = GetActiveWindow(); // Noticed MDI problem. + if (!Active) + { + FIXME("WM_SYSKEYDOWN VK_ESCAPE no active\n"); + break; + } + wParamTmp = GetKeyState(VK_SHIFT) & 0x8000 ? SC_PREVWINDOW : SC_NEXTWINDOW; + SendMessageW( Active, WM_SYSCOMMAND, wParamTmp, wParam ); } } else if( wParam == VK_F10 ) @@ -1421,8 +1462,6 @@ User32DefWindowProc(HWND hWnd, SendMessageW( hWnd, WM_CONTEXTMENU, (WPARAM)hWnd, MAKELPARAM(-1, -1) ); iF10Key = 1; } - else if( wParam == VK_ESCAPE && (GetKeyState(VK_SHIFT) & 0x8000)) - SendMessageW( hWnd, WM_SYSCOMMAND, SC_KEYMENU, ' ' ); break; } @@ -1440,38 +1479,24 @@ User32DefWindowProc(HWND hWnd, case WM_SYSCHAR: { iMenuSysKey = 0; - if (wParam == '\r' && IsIconic(hWnd)) + if (wParam == VK_RETURN && IsIconic(hWnd)) { PostMessageW( hWnd, WM_SYSCOMMAND, SC_RESTORE, 0L ); break; } if ((HIWORD(lParam) & KEYDATA_ALT) && wParam) { - if (wParam == '\t' || wParam == '\x1b') break; - if (wParam == ' ' && (GetWindowLongPtrW( hWnd, GWL_STYLE ) & WS_CHILD)) + if (wParam == VK_TAB || wParam == VK_ESCAPE) break; + if (wParam == VK_SPACE && (GetWindowLongPtrW( hWnd, GWL_STYLE ) & WS_CHILD)) SendMessageW( GetParent(hWnd), Msg, wParam, lParam ); else SendMessageW( hWnd, WM_SYSCOMMAND, SC_KEYMENU, wParam ); } else /* check for Ctrl-Esc */ - if (wParam != '\x1b') MessageBeep(0); + if (wParam != VK_ESCAPE) MessageBeep(0); break; } - case WM_SHOWWINDOW: - { - if (lParam) // Call when it is necessary. - NtUserMessageCall( hWnd, Msg, wParam, lParam, 0, FNID_DEFWINDOWPROC, FALSE); - break; - } - - case WM_CLIENTSHUTDOWN: - { - LRESULT lResult; - NtUserMessageCall( hWnd, Msg, wParam, lParam, (ULONG_PTR)&lResult, FNID_DEFWINDOWPROC, FALSE); - return lResult; - } - case WM_CANCELMODE: { iMenuSysKey = 0; @@ -1800,6 +1825,17 @@ User32DefWindowProc(HWND hWnd, break; } +/* Move to win32k !*/ + case WM_SHOWWINDOW: + if (!lParam) break; // Call when it is necessary. + case WM_CLIENTSHUTDOWN: + case WM_GETHOTKEY: + case WM_SETHOTKEY: + { + LRESULT lResult; + NtUserMessageCall( hWnd, Msg, wParam, lParam, (ULONG_PTR)&lResult, FNID_DEFWINDOWPROC, !bUnicode); + return lResult; + } } return 0; } diff --git a/dll/win32/user32/windows/menu.c b/dll/win32/user32/windows/menu.c index 3408d73c3b4..34eaac9825c 100644 --- a/dll/win32/user32/windows/menu.c +++ b/dll/win32/user32/windows/menu.c @@ -511,57 +511,46 @@ static UINT FASTCALL MenuFindItemByKey(HWND WndOwner, PROSMENUINFO MenuInfo, TRACE("\tlooking for '%c' (0x%02x) in [%p]\n", (char) Key, Key, MenuInfo); if (NULL == MenuInfo || ! IsMenu(MenuInfo->Self)) - { + { if (MenuGetRosMenuInfo(&SysMenuInfo, GetSystemMenu(WndOwner, FALSE))) - { + { MenuInfo = &SysMenuInfo; - } + } else - { + { MenuInfo = NULL; - } - } + } + } if (NULL != MenuInfo) - { + { if (MenuGetAllRosMenuItemInfo(MenuInfo->Self, &Items) <= 0) - { + { return -1; - } - if (! ForceMenuChar) - { - Key = toupperW(Key); + } + if ( !ForceMenuChar ) + { ItemInfo = Items; for (i = 0; i < MenuInfo->MenuItemCount; i++, ItemInfo++) - { + { if ((ItemInfo->lpstr) && NULL != ItemInfo->dwTypeData) - { + { WCHAR *p = (WCHAR *) ItemInfo->dwTypeData - 2; do - { - p = strchrW(p + 2, '&'); - } - while (NULL != p && L'&' == p[1]); - if (NULL != p && (toupperW(p[1]) == Key)) - { - return i; - } - } - } - } + { + p = strchrW (p + 2, '&'); + } + while (p != NULL && p [1] == '&'); + if (p && (toupperW(p[1]) == toupperW(Key))) return i; + } + } + } MenuChar = SendMessageW(WndOwner, WM_MENUCHAR, MAKEWPARAM(Key, MenuInfo->Flags), (LPARAM) MenuInfo->Self); - if (2 == HIWORD(MenuChar)) - { - return LOWORD(MenuChar); - } - if (1 == HIWORD(MenuChar)) - { - return (UINT) (-2); - } + if (HIWORD(MenuChar) == MNC_EXECUTE) return LOWORD(MenuChar); + if (HIWORD(MenuChar) == MNC_CLOSE) return (UINT)(-2); } - return (UINT)(-1); } @@ -1576,12 +1565,12 @@ static BOOL FASTCALL MenuShowPopup(HWND hwndOwner, HMENU hmenu, UINT id, UINT fl MenuInfo.FocusedItem = NO_SELECTED_ITEM; } - /* ReactOS Check */ - if (!ValidateHwnd(hwndOwner)) - { // This window maybe already DEAD!!! + /* store the owner for DrawItem */ + if (!IsWindow(hwndOwner)) + { + SetLastError( ERROR_INVALID_WINDOW_HANDLE ); return FALSE; } - /* store the owner for DrawItem */ MenuInfo.WndOwner = hwndOwner; MenuSetRosMenuInfo(&MenuInfo); @@ -3673,7 +3662,7 @@ VOID MenuTrackKbdMenuBar(HWND hwnd, UINT wParam, WCHAR wChar) if( uItem == NO_SELECTED_ITEM ) MenuMoveSelection( hwnd, &MenuInfo, ITEM_NEXT ); else - PostMessageW( hwnd, WM_KEYDOWN, VK_DOWN, 0L ); + PostMessageW( hwnd, WM_KEYDOWN, VK_RETURN, 0 ); } track_menu: diff --git a/dll/win32/userenv/CMakeLists.txt b/dll/win32/userenv/CMakeLists.txt index 513c911f1b4..32d3bd41711 100644 --- a/dll/win32/userenv/CMakeLists.txt +++ b/dll/win32/userenv/CMakeLists.txt @@ -28,5 +28,5 @@ target_link_libraries(userenv uuid) add_importlibs(userenv advapi32 user32 msvcrt kernel32 ntdll) add_pch(userenv ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE}) -add_cab_target(userenv 1) +add_cd_file(TARGET userenv DESTINATION reactos/system32 FOR all) add_importlib_target(userenv.spec) diff --git a/dll/win32/usp10/CMakeLists.txt b/dll/win32/usp10/CMakeLists.txt index 1f385e85d76..17b66b15783 100644 --- a/dll/win32/usp10/CMakeLists.txt +++ b/dll/win32/usp10/CMakeLists.txt @@ -22,4 +22,4 @@ target_link_libraries(usp10 wine) add_importlibs(usp10 gdi32 msvcrt kernel32 ntdll) add_importlib_target(usp10.spec) -add_cab_target(usp10 1) +add_cd_file(TARGET usp10 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/uxtheme/CMakeLists.txt b/dll/win32/uxtheme/CMakeLists.txt index e745bcff013..30781aa28a4 100644 --- a/dll/win32/uxtheme/CMakeLists.txt +++ b/dll/win32/uxtheme/CMakeLists.txt @@ -27,5 +27,5 @@ target_link_libraries(uxtheme wine) add_importlibs(uxtheme user32 advapi32 gdi32 msimg32 msvcrt kernel32 ntdll) -add_cab_target(uxtheme 1) +add_cd_file(TARGET uxtheme DESTINATION reactos/system32 FOR all) add_importlib_target(uxtheme.spec) diff --git a/dll/win32/vdmdbg/CMakeLists.txt b/dll/win32/vdmdbg/CMakeLists.txt index ddc994f8b7e..a312742e646 100644 --- a/dll/win32/vdmdbg/CMakeLists.txt +++ b/dll/win32/vdmdbg/CMakeLists.txt @@ -14,4 +14,4 @@ add_library(vdmdbg SHARED set_module_type(vdmdbg win32dll) add_importlibs(vdmdbg msvcrt kernel32 ntdll) add_pch(vdmdbg ${CMAKE_CURRENT_SOURCE_DIR}/vdmdbg.h ${SOURCE}) -add_cab_target(vdmdbg 1) +add_cd_file(TARGET vdmdbg DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/version/CMakeLists.txt b/dll/win32/version/CMakeLists.txt index 98df5fa31b8..beaf8ba13cc 100644 --- a/dll/win32/version/CMakeLists.txt +++ b/dll/win32/version/CMakeLists.txt @@ -18,5 +18,5 @@ set_entrypoint(version 0) target_link_libraries(version wine) add_importlibs(version lz32 kernel32 ntdll) add_dependencies(version psdk) -add_cab_target(version 1) +add_cd_file(TARGET version DESTINATION reactos/system32 FOR all) add_importlib_target(version.spec) diff --git a/dll/win32/wdmaud.drv/CMakeLists.txt b/dll/win32/wdmaud.drv/CMakeLists.txt index b1a3e2c7eef..5272364e516 100644 --- a/dll/win32/wdmaud.drv/CMakeLists.txt +++ b/dll/win32/wdmaud.drv/CMakeLists.txt @@ -31,4 +31,4 @@ target_link_libraries(wdmaud.drv mmixer) add_importlibs(wdmaud.drv user32 winmm advapi32 msvcrt setupapi ksuser kernel32 ntdll) -add_cab_target(wdmaud.drv 1) +add_cd_file(TARGET wdmaud.drv DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/windowscodecs/CMakeLists.txt b/dll/win32/windowscodecs/CMakeLists.txt index 2d271c2813d..47ec0d9c422 100644 --- a/dll/win32/windowscodecs/CMakeLists.txt +++ b/dll/win32/windowscodecs/CMakeLists.txt @@ -46,4 +46,4 @@ target_link_libraries(windowscodecs wine uuid) add_importlibs(windowscodecs ole32 shlwapi advapi32 msvcrt kernel32 ntdll) add_importlib_target(windowscodecs.spec) -add_cab_target(windowscodecs 1) +add_cd_file(TARGET windowscodecs DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/winemp3.acm/CMakeLists.txt b/dll/win32/winemp3.acm/CMakeLists.txt index f2eada4edbe..44b35f18022 100644 --- a/dll/win32/winemp3.acm/CMakeLists.txt +++ b/dll/win32/winemp3.acm/CMakeLists.txt @@ -31,4 +31,4 @@ add_importlibs(winemp3.acm add_dependencies(winemp3.acm psdk) -add_cab_target(winemp3.acm 1) \ No newline at end of file +add_cd_file(TARGET winemp3.acm DESTINATION reactos/system32 FOR all) \ No newline at end of file diff --git a/dll/win32/winfax/CMakeLists.txt b/dll/win32/winfax/CMakeLists.txt index 9d466ac21ab..ced03a8fb41 100644 --- a/dll/win32/winfax/CMakeLists.txt +++ b/dll/win32/winfax/CMakeLists.txt @@ -12,4 +12,4 @@ set_entrypoint(winfax 0) add_importlibs(winfax kernel32 ntdll) add_dependencies(winfax psdk) -add_cab_target(winfax 1) +add_cd_file(TARGET winfax DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/wing32/CMakeLists.txt b/dll/win32/wing32/CMakeLists.txt index 03aedd4f53d..c7f1e6e1a23 100644 --- a/dll/win32/wing32/CMakeLists.txt +++ b/dll/win32/wing32/CMakeLists.txt @@ -13,4 +13,4 @@ set_entrypoint(wing32 0) add_importlibs(wing32 user32 gdi32 msvcrt) add_dependencies(wing32 psdk) -add_cab_target(wing32 1) +add_cd_file(TARGET wing32 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/winhttp/CMakeLists.txt b/dll/win32/winhttp/CMakeLists.txt index ddd3ca8c8ef..a5bff14ed9f 100644 --- a/dll/win32/winhttp/CMakeLists.txt +++ b/dll/win32/winhttp/CMakeLists.txt @@ -20,4 +20,4 @@ set_module_type(winhttp win32dll) target_link_libraries(winhttp wine) add_importlibs(winhttp shlwapi wininet ws2_32 msvcrt crypt32 advapi32 kernel32 ntdll) add_importlib_target(winhttp.spec) -add_cab_target(winhttp 1) +add_cd_file(TARGET winhttp DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/wininet/CMakeLists.txt b/dll/win32/wininet/CMakeLists.txt index 8beeff2b603..0351ba69925 100644 --- a/dll/win32/wininet/CMakeLists.txt +++ b/dll/win32/wininet/CMakeLists.txt @@ -33,5 +33,5 @@ target_link_libraries(wininet wine ${PSEH_LIB}) add_importlibs(wininet mpr shlwapi shell32 user32 advapi32 secur32 crypt32 ws2_32 msvcrt kernel32 ntdll) -add_cab_target(wininet 1) +add_cd_file(TARGET wininet DESTINATION reactos/system32 FOR all) add_importlib_target(wininet.spec) diff --git a/dll/win32/winmm/CMakeLists.txt b/dll/win32/winmm/CMakeLists.txt index 4bbc5885639..0f39831974a 100644 --- a/dll/win32/winmm/CMakeLists.txt +++ b/dll/win32/winmm/CMakeLists.txt @@ -32,5 +32,5 @@ add_importlibs(winmm advapi32 user32 msvcrt kernel32 ntdll) add_subdirectory(midimap) -add_cab_target(winmm 1) +add_cd_file(TARGET winmm DESTINATION reactos/system32 FOR all) add_importlib_target(winmm.spec) diff --git a/dll/win32/winmm/midimap/CMakeLists.txt b/dll/win32/winmm/midimap/CMakeLists.txt index 84c41bcf852..701c69e735f 100644 --- a/dll/win32/winmm/midimap/CMakeLists.txt +++ b/dll/win32/winmm/midimap/CMakeLists.txt @@ -14,5 +14,5 @@ target_link_libraries(midimap uuid wine) add_importlibs(midimap advapi32 user32 winmm kernel32 ntdll) add_dependencies(midimap psdk) -add_cab_target(midimap 1) +add_cd_file(TARGET midimap DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/winspool/CMakeLists.txt b/dll/win32/winspool/CMakeLists.txt index a6fa8b6ea04..ad8b6a29808 100644 --- a/dll/win32/winspool/CMakeLists.txt +++ b/dll/win32/winspool/CMakeLists.txt @@ -21,5 +21,5 @@ set_target_properties(winspool PROPERTIES SUFFIX ".drv") set_module_type(winspool win32dll) target_link_libraries(winspool wine) add_importlibs(winspool advapi32 shlwapi msvcrt kernel32 ntdll) -add_cab_target(winspool 1) +add_cd_file(TARGET winspool DESTINATION reactos/system32 FOR all) add_importlib_target(winspool.spec) diff --git a/dll/win32/winsta/CMakeLists.txt b/dll/win32/winsta/CMakeLists.txt index c4c04d4cba5..2d46896145f 100644 --- a/dll/win32/winsta/CMakeLists.txt +++ b/dll/win32/winsta/CMakeLists.txt @@ -20,4 +20,4 @@ set_module_type(winsta win32dll) target_link_libraries(winsta wine) add_importlibs(winsta msvcrt kernel32 ntdll) add_pch(winsta ${CMAKE_CURRENT_SOURCE_DIR}/winsta.h ${SOURCE}) -add_cab_target(winsta 1) +add_cd_file(TARGET winsta DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/wintrust/CMakeLists.txt b/dll/win32/wintrust/CMakeLists.txt index f433a1cc8a6..f4aebcd2b27 100644 --- a/dll/win32/wintrust/CMakeLists.txt +++ b/dll/win32/wintrust/CMakeLists.txt @@ -27,5 +27,5 @@ add_importlibs(wintrust crypt32 cryptui user32 advapi32 imagehlp msvcrt kernel32 add_importlib_target(wintrust.spec) -add_cab_target(wintrust 1) +add_cd_file(TARGET wintrust DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/wlanapi/CMakeLists.txt b/dll/win32/wlanapi/CMakeLists.txt index 708b17db377..eeaa6894daf 100644 --- a/dll/win32/wlanapi/CMakeLists.txt +++ b/dll/win32/wlanapi/CMakeLists.txt @@ -21,4 +21,4 @@ add_importlibs(wlanapi rpcrt4 kernel32 ntdll) add_importlib_target(wlanapi.spec) add_dependencies(wlanapi psdk) -add_cab_target(wlanapi 1) +add_cd_file(TARGET wlanapi DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/wldap32/CMakeLists.txt b/dll/win32/wldap32/CMakeLists.txt index da88ae89705..c97f5e443f7 100644 --- a/dll/win32/wldap32/CMakeLists.txt +++ b/dll/win32/wldap32/CMakeLists.txt @@ -38,4 +38,4 @@ target_link_libraries(wldap32 wine) add_importlibs(wldap32 user32 msvcrt kernel32 ntdll) add_importlib_target(wldap32.spec) -add_cab_target(wldap32 1) +add_cd_file(TARGET wldap32 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/wmi/CMakeLists.txt b/dll/win32/wmi/CMakeLists.txt index 34ea2fdd661..d80d3eedc3b 100644 --- a/dll/win32/wmi/CMakeLists.txt +++ b/dll/win32/wmi/CMakeLists.txt @@ -11,4 +11,4 @@ set_entrypoint(wmi 0) add_importlibs(wmi advapi32) add_dependencies(wmi psdk) -add_cab_target(wmi 1) +add_cd_file(TARGET wmi DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/ws2_32/CMakeLists.txt b/dll/win32/ws2_32/CMakeLists.txt index 34218b2dc52..a39c061f7d5 100644 --- a/dll/win32/ws2_32/CMakeLists.txt +++ b/dll/win32/ws2_32/CMakeLists.txt @@ -32,5 +32,5 @@ target_link_libraries(ws2_32 wine) add_importlibs(ws2_32 user32 advapi32 dnsapi ws2help msvcrt kernel32 ntdll) add_pch(ws2_32 ${CMAKE_CURRENT_SOURCE_DIR}/include/ws2_32.h ${SOURCE}) -add_cab_target(ws2_32 1) +add_cd_file(TARGET ws2_32 DESTINATION reactos/system32 FOR all) add_importlib_target(ws2_32.spec) diff --git a/dll/win32/ws2_32_new/CMakeLists.txt b/dll/win32/ws2_32_new/CMakeLists.txt index bf03fb499b5..5999316ca9a 100644 --- a/dll/win32/ws2_32_new/CMakeLists.txt +++ b/dll/win32/ws2_32_new/CMakeLists.txt @@ -52,4 +52,4 @@ add_library(ws2_32_new SHARED ${SOURCE}) set_module_type(ws2_32_new win32dll) target_link_libraries(ws2_32_new wine) add_importlibs(ws2_32_new user32 advapi32 dnsapi ws2help msvcrt kernel32 ntdll) -add_cab_target(ws2_32_new 1) +add_cd_file(TARGET ws2_32_new DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/ws2help/CMakeLists.txt b/dll/win32/ws2help/CMakeLists.txt index 15c4c2a886f..6de001c474c 100644 --- a/dll/win32/ws2help/CMakeLists.txt +++ b/dll/win32/ws2help/CMakeLists.txt @@ -15,5 +15,5 @@ add_library(ws2help SHARED ${SOURCE}) set_module_type(ws2help win32dll) add_importlibs(ws2help advapi32 ws2_32 msvcrt kernel32 ntdll) -add_cab_target(ws2help 1) +add_cd_file(TARGET ws2help DESTINATION reactos/system32 FOR all) add_importlib_target(ws2help.spec) diff --git a/dll/win32/wshirda/CMakeLists.txt b/dll/win32/wshirda/CMakeLists.txt index ca6ab12e09f..4bd87850cd2 100644 --- a/dll/win32/wshirda/CMakeLists.txt +++ b/dll/win32/wshirda/CMakeLists.txt @@ -12,4 +12,4 @@ add_library(wshirda SHARED ${SOURCE}) set_module_type(wshirda win32dll) add_importlibs(wshirda ws2_32 msvcrt kernel32 ntdll) -add_cab_target(wshirda 1) +add_cd_file(TARGET wshirda DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/wshtcpip/CMakeLists.txt b/dll/win32/wshtcpip/CMakeLists.txt index 95ee1824b7d..bea0689c300 100644 --- a/dll/win32/wshtcpip/CMakeLists.txt +++ b/dll/win32/wshtcpip/CMakeLists.txt @@ -17,4 +17,4 @@ set_entrypoint(wshtcpip 0) target_link_libraries(wshtcpip tdilib) add_importlibs(wshtcpip ws2_32 kernel32 ntdll) add_dependencies(wshtcpip psdk) -add_cab_target(wshtcpip 1) +add_cd_file(TARGET wshtcpip DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/wsock32/CMakeLists.txt b/dll/win32/wsock32/CMakeLists.txt index 543e9749329..3018af1f173 100644 --- a/dll/win32/wsock32/CMakeLists.txt +++ b/dll/win32/wsock32/CMakeLists.txt @@ -7,4 +7,4 @@ add_library(wsock32 SHARED stubs.c wsock32.rc wsock32.def ${CMAKE_CURRENT_BINARY set_module_type(wsock32 win32dll) add_importlibs(wsock32 mswsock ws2_32 msvcrt kernel32 ntdll) -add_cab_target(wsock32 1) +add_cd_file(TARGET wsock32 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/wtsapi32/CMakeLists.txt b/dll/win32/wtsapi32/CMakeLists.txt index abc1de6c6e6..deb123025f1 100644 --- a/dll/win32/wtsapi32/CMakeLists.txt +++ b/dll/win32/wtsapi32/CMakeLists.txt @@ -17,4 +17,4 @@ target_link_libraries(wtsapi32 wine) add_importlibs(wtsapi32 advapi32 msvcrt kernel32 ntdll) -add_cab_target(wtsapi32 1) +add_cd_file(TARGET wtsapi32 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/wuapi/CMakeLists.txt b/dll/win32/wuapi/CMakeLists.txt index 19fe67002ce..7d0fcc409a4 100644 --- a/dll/win32/wuapi/CMakeLists.txt +++ b/dll/win32/wuapi/CMakeLists.txt @@ -25,4 +25,4 @@ add_library(wuapi SHARED ${SOURCE}) set_module_type(wuapi win32dll) target_link_libraries(wuapi uuid wine wuguid) add_importlibs(wuapi ole32 advapi32 msvcrt kernel32 ntdll) -add_cab_target(wuapi 1) +add_cd_file(TARGET wuapi DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/xinput1_1/CMakeLists.txt b/dll/win32/xinput1_1/CMakeLists.txt index 24bd1d571fb..8b8e354842b 100644 --- a/dll/win32/xinput1_1/CMakeLists.txt +++ b/dll/win32/xinput1_1/CMakeLists.txt @@ -13,4 +13,4 @@ add_library(xinput1_1 SHARED ${SOURCE}) set_module_type(xinput1_1 win32dll) add_importlibs(xinput1_1 msvcrt kernel32 xinput1_3) -add_cab_target(xinput1_1 1) +add_cd_file(TARGET xinput1_1 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/xinput1_2/CMakeLists.txt b/dll/win32/xinput1_2/CMakeLists.txt index ab02343a360..3b3cc8295da 100644 --- a/dll/win32/xinput1_2/CMakeLists.txt +++ b/dll/win32/xinput1_2/CMakeLists.txt @@ -13,4 +13,4 @@ add_library(xinput1_2 SHARED ${SOURCE}) set_module_type(xinput1_2 win32dll) add_importlibs(xinput1_2 msvcrt kernel32 xinput1_3) -add_cab_target(xinput1_2 1) +add_cd_file(TARGET xinput1_2 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/xinput1_3/CMakeLists.txt b/dll/win32/xinput1_3/CMakeLists.txt index c245de9cf80..9d37edd1e66 100644 --- a/dll/win32/xinput1_3/CMakeLists.txt +++ b/dll/win32/xinput1_3/CMakeLists.txt @@ -15,4 +15,4 @@ add_importlib_target(xinput1_3.spec) set_module_type(xinput1_3 win32dll) target_link_libraries(xinput1_3 wine) add_importlibs(xinput1_3 msvcrt kernel32 ntdll) -add_cab_target(xinput1_3 1) +add_cd_file(TARGET xinput1_3 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/xinput9_1_0/CMakeLists.txt b/dll/win32/xinput9_1_0/CMakeLists.txt index 1d1efc01eef..a7e1479d1e5 100644 --- a/dll/win32/xinput9_1_0/CMakeLists.txt +++ b/dll/win32/xinput9_1_0/CMakeLists.txt @@ -13,4 +13,4 @@ add_library(xinput9_1_0 SHARED ${SOURCE}) set_module_type(xinput9_1_0 win32dll) add_importlibs(xinput9_1_0 msvcrt kernel32 xinput1_3) -add_cab_target(xinput9_1_0 1) +add_cd_file(TARGET xinput9_1_0 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/xmllite/CMakeLists.txt b/dll/win32/xmllite/CMakeLists.txt index 6849239ccce..855cd3a8e82 100644 --- a/dll/win32/xmllite/CMakeLists.txt +++ b/dll/win32/xmllite/CMakeLists.txt @@ -19,4 +19,4 @@ target_link_libraries(xmllite wine uuid) add_importlibs(xmllite msvcrt kernel32 ntdll) add_importlib_target(xmllite.spec) -add_cab_target(xmllite 1) +add_cd_file(TARGET xmllite DESTINATION reactos/system32 FOR all) diff --git a/drivers/base/beep/CMakeLists.txt b/drivers/base/beep/CMakeLists.txt index 8b88456e1e7..3cc31bc8c06 100644 --- a/drivers/base/beep/CMakeLists.txt +++ b/drivers/base/beep/CMakeLists.txt @@ -2,4 +2,4 @@ add_library(beep SHARED beep.c beep.rc) set_module_type(beep kernelmodedriver) add_importlibs(beep ntoskrnl hal) -add_cab_target(beep 2) +add_cd_file(TARGET beep DESTINATION reactos/system32/drivers FOR all) diff --git a/drivers/base/bootvid/CMakeLists.txt b/drivers/base/bootvid/CMakeLists.txt index 685ddb15637..3c23c82e2e0 100644 --- a/drivers/base/bootvid/CMakeLists.txt +++ b/drivers/base/bootvid/CMakeLists.txt @@ -25,6 +25,5 @@ set_image_base(bootvid 0x00010000) add_importlibs(bootvid ntoskrnl hal) add_pch(bootvid ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE}) add_dependencies(bootvid psdk bugcodes) -add_minicd_target(bootvid reactos bootvid.dll) -add_cab_target(bootvid 1) +add_cd_file(TARGET bootvid DESTINATION reactos/system32 NO_CAB FOR all) add_importlib_target(bootvid.spec) diff --git a/drivers/base/kdcom/CMakeLists.txt b/drivers/base/kdcom/CMakeLists.txt index b2a5dca3aa4..8e8a2e17ec8 100644 --- a/drivers/base/kdcom/CMakeLists.txt +++ b/drivers/base/kdcom/CMakeLists.txt @@ -19,6 +19,5 @@ set_image_base(kdcom 0x00010000) add_importlibs(kdcom ntoskrnl hal) add_dependencies(kdcom psdk bugcodes) -add_minicd_target(kdcom reactos kdcom.dll) -add_livecd_target(kdcom reactos/system32) +add_cd_file(TARGET kdcom DESTINATION reactos/system32 NO_CAB FOR all) add_importlib_target(kdcom.spec) diff --git a/drivers/base/nmidebug/CMakeLists.txt b/drivers/base/nmidebug/CMakeLists.txt index c81702260f6..3293f041905 100644 --- a/drivers/base/nmidebug/CMakeLists.txt +++ b/drivers/base/nmidebug/CMakeLists.txt @@ -4,5 +4,4 @@ add_library(nmidebug SHARED nmidebug.c nmidebug.rc) set_module_type(nmidebug kernelmodedriver) add_importlibs(nmidebug ntoskrnl hal) -add_minicd_target(nmidebug reactos) -add_cab_target(nmidebug 2) +add_cd_file(TARGET nmidebug DESTINATION reactos/system32/drivers NO_CAB FOR all) diff --git a/drivers/base/null/CMakeLists.txt b/drivers/base/null/CMakeLists.txt index 0130b33fdcb..b3f3b2d2f5f 100644 --- a/drivers/base/null/CMakeLists.txt +++ b/drivers/base/null/CMakeLists.txt @@ -6,4 +6,4 @@ target_link_libraries(null ${PSEH_LIB}) set_module_type(null kernelmodedriver) add_importlibs(null ntoskrnl hal) -add_cab_target(null 2) +add_cd_file(TARGET null DESTINATION reactos/system32/drivers FOR all) diff --git a/drivers/battery/battc/CMakeLists.txt b/drivers/battery/battc/CMakeLists.txt index 3bf4580b134..2cfea3ab8b0 100644 --- a/drivers/battery/battc/CMakeLists.txt +++ b/drivers/battery/battc/CMakeLists.txt @@ -11,5 +11,5 @@ add_library(battc SHARED set_module_type(battc kernelmodedriver) add_importlibs(battc ntoskrnl hal) -add_cab_target(battc 2) +add_cd_file(TARGET battc DESTINATION reactos/system32/drivers FOR all) add_importlib_target(battc.spec) diff --git a/drivers/bus/acpi/CMakeLists.txt b/drivers/bus/acpi/CMakeLists.txt index 0dfc388c978..1793c66bf8c 100644 --- a/drivers/bus/acpi/CMakeLists.txt +++ b/drivers/bus/acpi/CMakeLists.txt @@ -147,8 +147,7 @@ target_link_libraries(acpi add_importlibs(acpi ntoskrnl hal) -add_minicd_target(acpi reactos acpi.sys) -add_livecd_target(acpi reactos/system32/drivers) +add_cd_file(TARGET acpi DESTINATION reactos/system32/drivers NO_CAB FOR all) add_subdirectory(cmbatt) add_subdirectory(compbatt) diff --git a/drivers/bus/acpi/cmbatt/CMakeLists.txt b/drivers/bus/acpi/cmbatt/CMakeLists.txt index 751d84d27ff..461adfeba51 100644 --- a/drivers/bus/acpi/cmbatt/CMakeLists.txt +++ b/drivers/bus/acpi/cmbatt/CMakeLists.txt @@ -14,4 +14,4 @@ add_importlibs(cmbatt ntoskrnl hal battc wmilib) add_pch(cmbatt ${CMAKE_CURRENT_SOURCE_DIR}/cmbatt.h ${SOURCE}) -add_cab_target(cmbatt 2) \ No newline at end of file +add_cd_file(TARGET cmbatt DESTINATION reactos/system32/drivers FOR all) \ No newline at end of file diff --git a/drivers/bus/acpi/compbatt/CMakeLists.txt b/drivers/bus/acpi/compbatt/CMakeLists.txt index b985c6d16ab..00f05b73271 100644 --- a/drivers/bus/acpi/compbatt/CMakeLists.txt +++ b/drivers/bus/acpi/compbatt/CMakeLists.txt @@ -12,4 +12,4 @@ add_importlibs(compbatt ntoskrnl hal battc) add_pch(compbatt ${CMAKE_CURRENT_SOURCE_DIR}/compbatt.h ${SOURCE}) -add_cab_target(compbatt 2) \ No newline at end of file +add_cd_file(TARGET compbatt DESTINATION reactos/system32/drivers FOR all) \ No newline at end of file diff --git a/drivers/bus/isapnp/CMakeLists.txt b/drivers/bus/isapnp/CMakeLists.txt index 509ba189f0d..efb1f93256e 100644 --- a/drivers/bus/isapnp/CMakeLists.txt +++ b/drivers/bus/isapnp/CMakeLists.txt @@ -9,5 +9,4 @@ add_library(isapnp SHARED set_module_type(isapnp kernelmodedriver) add_importlibs(isapnp ntoskrnl hal) -add_minicd_target(isapnp reactos isapnp.sys) -add_livecd_target(isapnp reactos/system32/drivers) +add_cd_file(TARGET isapnp DESTINATION reactos/system32/drivers NO_CAB FOR all) diff --git a/drivers/bus/pci/CMakeLists.txt b/drivers/bus/pci/CMakeLists.txt index 0fe7e241b27..d9c7bbb1e22 100644 --- a/drivers/bus/pci/CMakeLists.txt +++ b/drivers/bus/pci/CMakeLists.txt @@ -8,5 +8,4 @@ add_library(pci SHARED set_module_type(pci kernelmodedriver) add_importlibs(pci ntoskrnl hal) -add_minicd_target(pci reactos pci.sys) -add_livecd_target(pci reactos/system32/drivers) +add_cd_file(TARGET pci DESTINATION reactos/system32/drivers NO_CAB FOR all) diff --git a/drivers/bus/pcix/CMakeLists.txt b/drivers/bus/pcix/CMakeLists.txt index c40008c4fd0..a805c580883 100644 --- a/drivers/bus/pcix/CMakeLists.txt +++ b/drivers/bus/pcix/CMakeLists.txt @@ -43,3 +43,5 @@ add_importlibs(pcix ntoskrnl hal) add_pch(pcix ${CMAKE_CURRENT_SOURCE_DIR}/pci.h ${SOURCE}) add_dependencies(pcix pciclass) + +add_cd_file(TARGET pcix DESTINATION reactos/system32/drivers NO_CAB FOR all) diff --git a/drivers/bus/pcmcia/CMakeLists.txt b/drivers/bus/pcmcia/CMakeLists.txt index 764b84a8dc4..9c4b1a34aac 100644 --- a/drivers/bus/pcmcia/CMakeLists.txt +++ b/drivers/bus/pcmcia/CMakeLists.txt @@ -8,5 +8,4 @@ add_library(pcmcia SHARED set_module_type(pcmcia kernelmodedriver) add_importlibs(pcmcia ntoskrnl hal) -add_minicd_target(pcmcia reactos pcmcia.sys) -add_livecd_target(pcmcia reactos/system32/drivers) +add_cd_file(TARGET pcmcia DESTINATION reactos/system32/drivers NO_CAB FOR all) diff --git a/drivers/directx/dxapi/CMakeLists.txt b/drivers/directx/dxapi/CMakeLists.txt index dda56228703..f45e93a5c77 100644 --- a/drivers/directx/dxapi/CMakeLists.txt +++ b/drivers/directx/dxapi/CMakeLists.txt @@ -11,4 +11,4 @@ add_library(dxapi SHARED set_module_type(dxapi kernelmodedriver) add_importlibs(dxapi ntoskrnl hal videoprt) -add_cab_target(dxapi 2) \ No newline at end of file +add_cd_file(TARGET dxapi DESTINATION reactos/system32/drivers FOR all) \ No newline at end of file diff --git a/drivers/directx/dxg/CMakeLists.txt b/drivers/directx/dxg/CMakeLists.txt index c142278e634..f4eb99c8e77 100644 --- a/drivers/directx/dxg/CMakeLists.txt +++ b/drivers/directx/dxg/CMakeLists.txt @@ -12,4 +12,4 @@ add_library(dxg SHARED set_module_type(dxg kernelmodedriver) add_importlibs(dxg dxgthk ntoskrnl) -add_cab_target(dxg 2) \ No newline at end of file +add_cd_file(TARGET dxg DESTINATION reactos/system32/drivers FOR all) \ No newline at end of file diff --git a/drivers/directx/dxgthk/CMakeLists.txt b/drivers/directx/dxgthk/CMakeLists.txt index 3e414315a43..cd1dbc827cc 100644 --- a/drivers/directx/dxgthk/CMakeLists.txt +++ b/drivers/directx/dxgthk/CMakeLists.txt @@ -13,4 +13,4 @@ set_module_type(dxgthk kernelmodedriver) add_importlibs(dxgthk win32k) add_importlib_target(dxgthk.spec) -add_cab_target(dxgthk 2) +add_cd_file(TARGET dxgthk DESTINATION reactos/system32/drivers FOR all) diff --git a/drivers/filesystems/cdfs/CMakeLists.txt b/drivers/filesystems/cdfs/CMakeLists.txt index 3578bfa8716..cc0fbc1b2f5 100644 --- a/drivers/filesystems/cdfs/CMakeLists.txt +++ b/drivers/filesystems/cdfs/CMakeLists.txt @@ -24,5 +24,4 @@ add_importlibs(cdfs ntoskrnl hal) add_pch(cdfs ${CMAKE_CURRENT_SOURCE_DIR}/cdfs.h ${SOURCE}) -add_minicd_target(cdfs reactos cdfs.sys) -add_livecd_target(cdfs reactos/system32/drivers cdfs.sys) +add_cd_file(TARGET cdfs DESTINATION reactos/system32/drivers NO_CAB FOR all) diff --git a/drivers/filesystems/ext2/CMakeLists.txt b/drivers/filesystems/ext2/CMakeLists.txt index 3ae0112c845..4917fb14311 100644 --- a/drivers/filesystems/ext2/CMakeLists.txt +++ b/drivers/filesystems/ext2/CMakeLists.txt @@ -28,5 +28,4 @@ target_link_libraries(ext2fs ${PSEH_LIB}) set_module_type(ext2fs kernelmodedriver) add_importlibs(ext2fs ntoskrnl hal) -add_minicd_target(ext2fs reactos ext2.sys) -add_livecd_target(ext2fs reactos/system32/drivers ext2.sys) +add_cd_file(TARGET ext2fs DESTINATION reactos/system32/drivers NO_CAB FOR all) diff --git a/drivers/filesystems/fastfat/CMakeLists.txt b/drivers/filesystems/fastfat/CMakeLists.txt index 85097eeddd1..5d8dd934611 100644 --- a/drivers/filesystems/fastfat/CMakeLists.txt +++ b/drivers/filesystems/fastfat/CMakeLists.txt @@ -30,5 +30,4 @@ add_importlibs(fastfat ntoskrnl hal) add_pch(fastfat ${CMAKE_CURRENT_SOURCE_DIR}/vfat.h ${SOURCE}) -add_minicd_target(fastfat reactos fastfat.sys) -add_livecd_target(fastfat reactos/system32/drivers) +add_cd_file(TARGET fastfat DESTINATION reactos/system32/drivers NO_CAB FOR all) diff --git a/drivers/filesystems/fs_rec/CMakeLists.txt b/drivers/filesystems/fs_rec/CMakeLists.txt index c9b55ccb053..14bfce865de 100644 --- a/drivers/filesystems/fs_rec/CMakeLists.txt +++ b/drivers/filesystems/fs_rec/CMakeLists.txt @@ -12,4 +12,4 @@ add_library(fs_rec SHARED set_module_type(fs_rec kernelmodedriver) add_importlibs(fs_rec ntoskrnl hal) -add_cab_target(fs_rec 2) +add_cd_file(TARGET fs_rec DESTINATION reactos/system32/drivers FOR all) diff --git a/drivers/filesystems/msfs/CMakeLists.txt b/drivers/filesystems/msfs/CMakeLists.txt index 40ca59ffd3f..ddf2bf5b112 100644 --- a/drivers/filesystems/msfs/CMakeLists.txt +++ b/drivers/filesystems/msfs/CMakeLists.txt @@ -14,4 +14,4 @@ add_importlibs(msfs ntoskrnl hal) add_pch(msfs ${CMAKE_CURRENT_SOURCE_DIR}/msfs.h ${SOURCE}) -add_cab_target(msfs 2) +add_cd_file(TARGET msfs DESTINATION reactos/system32/drivers FOR all) diff --git a/drivers/filesystems/mup/CMakeLists.txt b/drivers/filesystems/mup/CMakeLists.txt index 337ee4991a7..6ac375d8025 100644 --- a/drivers/filesystems/mup/CMakeLists.txt +++ b/drivers/filesystems/mup/CMakeLists.txt @@ -7,4 +7,4 @@ add_library(mup SHARED set_module_type(mup kernelmodedriver) add_importlibs(mup ntoskrnl hal) -add_cab_target(mup 2) \ No newline at end of file +add_cd_file(TARGET mup DESTINATION reactos/system32/drivers FOR all) \ No newline at end of file diff --git a/drivers/filesystems/npfs/CMakeLists.txt b/drivers/filesystems/npfs/CMakeLists.txt index a0b764bee7a..8f960fc81f7 100644 --- a/drivers/filesystems/npfs/CMakeLists.txt +++ b/drivers/filesystems/npfs/CMakeLists.txt @@ -16,4 +16,4 @@ target_link_libraries(npfs ${PSEH_LIB}) set_module_type(npfs kernelmodedriver) add_importlibs(npfs ntoskrnl hal) add_pch(npfs ${CMAKE_CURRENT_SOURCE_DIR}/npfs.h ${SOURCE}) -add_cab_target(npfs 2) +add_cd_file(TARGET npfs DESTINATION reactos/system32/drivers FOR all) diff --git a/drivers/filesystems/ntfs/CMakeLists.txt b/drivers/filesystems/ntfs/CMakeLists.txt index f96e6d09076..bef4973c8d9 100644 --- a/drivers/filesystems/ntfs/CMakeLists.txt +++ b/drivers/filesystems/ntfs/CMakeLists.txt @@ -24,5 +24,4 @@ add_importlibs(ntfs ntoskrnl hal) add_pch(ntfs ${CMAKE_CURRENT_SOURCE_DIR}/ntfs.h ${SOURCE}) -add_minicd_target(ntfs reactos) -add_livecd_target(ntfs reactos/system32/drivers) +add_cd_file(TARGET ntfs DESTINATION reactos/system32/drivers NO_CAB FOR all) diff --git a/drivers/input/i8042prt/CMakeLists.txt b/drivers/input/i8042prt/CMakeLists.txt index 2517d614dcd..1761b6111c5 100644 --- a/drivers/input/i8042prt/CMakeLists.txt +++ b/drivers/input/i8042prt/CMakeLists.txt @@ -17,5 +17,4 @@ add_library(i8042prt SHARED set_module_type(i8042prt kernelmodedriver) add_importlibs(i8042prt ntoskrnl hal) -add_minicd_target(i8042prt reactos) -add_livecd_target(i8042prt reactos/system32/drivers) \ No newline at end of file +add_cd_file(TARGET i8042prt DESTINATION reactos/system32/drivers NO_CAB FOR all) \ No newline at end of file diff --git a/drivers/input/kbdclass/CMakeLists.txt b/drivers/input/kbdclass/CMakeLists.txt index 04f839a4c45..e25e6307fa6 100644 --- a/drivers/input/kbdclass/CMakeLists.txt +++ b/drivers/input/kbdclass/CMakeLists.txt @@ -11,5 +11,4 @@ target_link_libraries(kbdclass ${PSEH_LIB}) add_importlibs(kbdclass ntoskrnl hal) -add_minicd_target(kbdclass reactos kbdclass.sys) -add_livecd_target(kbdclass reactos/system32/drivers) \ No newline at end of file +add_cd_file(TARGET kbdclass DESTINATION reactos/system32/drivers NO_CAB FOR all) \ No newline at end of file diff --git a/drivers/input/mouclass/CMakeLists.txt b/drivers/input/mouclass/CMakeLists.txt index 35e4ff68c76..13463ba849f 100644 --- a/drivers/input/mouclass/CMakeLists.txt +++ b/drivers/input/mouclass/CMakeLists.txt @@ -10,4 +10,4 @@ target_link_libraries(mouclass ${PSEH_LIB}) add_importlibs(mouclass ntoskrnl hal) -add_cab_target(mouclass 2) \ No newline at end of file +add_cd_file(TARGET mouclass DESTINATION reactos/system32/drivers FOR all) \ No newline at end of file diff --git a/drivers/input/sermouse/CMakeLists.txt b/drivers/input/sermouse/CMakeLists.txt index e9a2003a423..06a91c05f3d 100644 --- a/drivers/input/sermouse/CMakeLists.txt +++ b/drivers/input/sermouse/CMakeLists.txt @@ -12,4 +12,4 @@ add_library(sermouse SHARED set_module_type(sermouse kernelmodedriver) add_importlibs(sermouse ntoskrnl hal) -add_cab_target(sermouse 2) +add_cd_file(TARGET sermouse DESTINATION reactos/system32/drivers FOR all) diff --git a/drivers/ksfilter/ks/CMakeLists.txt b/drivers/ksfilter/ks/CMakeLists.txt index a4888e7cf76..712848b6b2f 100644 --- a/drivers/ksfilter/ks/CMakeLists.txt +++ b/drivers/ksfilter/ks/CMakeLists.txt @@ -44,5 +44,5 @@ target_link_libraries(ks ${PSEH_LIB}) add_importlibs(ks ntoskrnl hal) add_dependencies(ks psdk bugcodes) -add_cab_target(ks 2) +add_cd_file(TARGET ks DESTINATION reactos/system32/drivers FOR all) add_importlib_target(ks.spec) diff --git a/drivers/ksfilter/swenum/CMakeLists.txt b/drivers/ksfilter/swenum/CMakeLists.txt index fbf53f76f61..d9311417631 100644 --- a/drivers/ksfilter/swenum/CMakeLists.txt +++ b/drivers/ksfilter/swenum/CMakeLists.txt @@ -7,5 +7,4 @@ add_library(swenum SHARED ${SOURCE}) set_module_type(swenum kernelmodedriver) add_importlibs(swenum ks ntoskrnl hal) -add_minicd_target(swenum reactos) -add_livecd_target(swenum reactos/system32/drivers) +add_cd_file(TARGET swenum DESTINATION reactos/system32/drivers NO_CAB FOR all) diff --git a/drivers/network/afd/CMakeLists.txt b/drivers/network/afd/CMakeLists.txt index e01c8034d3f..22ef729c619 100644 --- a/drivers/network/afd/CMakeLists.txt +++ b/drivers/network/afd/CMakeLists.txt @@ -26,4 +26,4 @@ add_importlibs(afd ntoskrnl hal) add_pch(afd ${CMAKE_CURRENT_SOURCE_DIR}/include/afd.h ${SOURCE}) -add_cab_target(afd 2) +add_cd_file(TARGET afd DESTINATION reactos/system32/drivers FOR all) diff --git a/drivers/network/dd/ne2000/CMakeLists.txt b/drivers/network/dd/ne2000/CMakeLists.txt index dcdbd12a4fb..f11ebe95a9b 100644 --- a/drivers/network/dd/ne2000/CMakeLists.txt +++ b/drivers/network/dd/ne2000/CMakeLists.txt @@ -11,4 +11,4 @@ add_library(ne2000 SHARED ${SOURCE}) set_module_type(ne2000 kernelmodedriver) add_importlibs(ne2000 ndis ntoskrnl hal) -add_cab_target(ne2000 2) +add_cd_file(TARGET ne2000 DESTINATION reactos/system32/drivers FOR all) diff --git a/drivers/network/dd/pcnet/CMakeLists.txt b/drivers/network/dd/pcnet/CMakeLists.txt index b42819e08a9..7235782f5e0 100644 --- a/drivers/network/dd/pcnet/CMakeLists.txt +++ b/drivers/network/dd/pcnet/CMakeLists.txt @@ -15,4 +15,4 @@ add_library(pcnet SHARED ${SOURCE}) set_module_type(pcnet kernelmodedriver) add_importlibs(pcnet ndis ntoskrnl hal) -add_cab_target(pcnet 2) +add_cd_file(TARGET pcnet DESTINATION reactos/system32/drivers FOR all) diff --git a/drivers/network/ndis/CMakeLists.txt b/drivers/network/ndis/CMakeLists.txt index 16263ac4112..60b7bcc52f1 100644 --- a/drivers/network/ndis/CMakeLists.txt +++ b/drivers/network/ndis/CMakeLists.txt @@ -42,5 +42,5 @@ add_importlibs(ndis ntoskrnl hal) add_pch(ndis ${CMAKE_CURRENT_SOURCE_DIR}/include/ndissys.h ${SOURCE}) -add_cab_target(ndis 2) +add_cd_file(TARGET ndis DESTINATION reactos/system32/drivers FOR all) add_importlib_target(ndis.spec) diff --git a/drivers/network/tcpip/CMakeLists.txt b/drivers/network/tcpip/CMakeLists.txt index a0f0e7c28cf..30ec32176a8 100644 --- a/drivers/network/tcpip/CMakeLists.txt +++ b/drivers/network/tcpip/CMakeLists.txt @@ -40,4 +40,4 @@ add_importlibs(tcpip ndis ntoskrnl hal) add_pch(tcpip ${CMAKE_CURRENT_SOURCE_DIR}/include/precomp.h ${SOURCE}) -add_cab_target(tcpip 2) +add_cd_file(TARGET tcpip DESTINATION reactos/system32/drivers FOR all) diff --git a/drivers/network/tdi/CMakeLists.txt b/drivers/network/tdi/CMakeLists.txt index 1b57c6f1c4b..eeb5b468c0c 100644 --- a/drivers/network/tdi/CMakeLists.txt +++ b/drivers/network/tdi/CMakeLists.txt @@ -27,4 +27,4 @@ add_library(tdi SHARED ${SOURCE}) set_module_type(tdi kernelmodedriver) add_importlibs(tdi ntoskrnl hal) -add_cab_target(tdi 2) +add_cd_file(TARGET tdi DESTINATION reactos/system32/drivers FOR all) diff --git a/drivers/serial/serenum/CMakeLists.txt b/drivers/serial/serenum/CMakeLists.txt index 8066291325f..c31039222fe 100644 --- a/drivers/serial/serenum/CMakeLists.txt +++ b/drivers/serial/serenum/CMakeLists.txt @@ -10,4 +10,4 @@ add_library(serenum SHARED set_module_type(serenum kernelmodedriver) add_importlibs(serenum ntoskrnl hal) -add_cab_target(serenum 2) +add_cd_file(TARGET serenum DESTINATION reactos/system32/drivers FOR all) diff --git a/drivers/serial/serial/CMakeLists.txt b/drivers/serial/serial/CMakeLists.txt index 1065fc5d7e8..68ec42d9b40 100644 --- a/drivers/serial/serial/CMakeLists.txt +++ b/drivers/serial/serial/CMakeLists.txt @@ -17,4 +17,4 @@ add_library(serial SHARED set_module_type(serial kernelmodedriver) add_importlibs(serial ntoskrnl hal) -add_cab_target(serial 2) +add_cd_file(TARGET serial DESTINATION reactos/system32/drivers FOR all) diff --git a/drivers/setup/blue/CMakeLists.txt b/drivers/setup/blue/CMakeLists.txt index 2924d43c9d9..ae3c8f674be 100644 --- a/drivers/setup/blue/CMakeLists.txt +++ b/drivers/setup/blue/CMakeLists.txt @@ -6,5 +6,4 @@ add_library(blue SHARED blue.c font.c blue.rc) set_module_type(blue kernelmodedriver) add_importlibs(blue ntoskrnl hal) -add_minicd_target(blue reactos blue.sys) -add_livecd_target(blue reactos/system32/drivers) +add_cd_file(TARGET blue DESTINATION reactos/system32/drivers NO_CAB FOR all) diff --git a/drivers/storage/class/cdrom/CMakeLists.txt b/drivers/storage/class/cdrom/CMakeLists.txt index 884fcfbc204..3a21ad923b3 100644 --- a/drivers/storage/class/cdrom/CMakeLists.txt +++ b/drivers/storage/class/cdrom/CMakeLists.txt @@ -10,5 +10,4 @@ add_importlibs(cdrom ntoskrnl hal) -add_minicd_target(cdrom reactos cdrom.sys) -add_livecd_target(cdrom reactos/system32/drivers) +add_cd_file(TARGET cdrom DESTINATION reactos/system32/drivers NO_CAB FOR all) diff --git a/drivers/storage/class/class2/CMakeLists.txt b/drivers/storage/class/class2/CMakeLists.txt index 48ba7289551..8820226b9ce 100644 --- a/drivers/storage/class/class2/CMakeLists.txt +++ b/drivers/storage/class/class2/CMakeLists.txt @@ -15,5 +15,4 @@ set_module_type(class2 kernelmodedriver) add_importlibs(class2 scsiport ntoskrnl hal) add_importlib_target(class2.spec) -add_minicd_target(class2 reactos class2.sys) -add_livecd_target(class2 reactos/system32/drivers) +add_cd_file(TARGET class2 DESTINATION reactos/system32/drivers NO_CAB FOR all) diff --git a/drivers/storage/class/disk/CMakeLists.txt b/drivers/storage/class/disk/CMakeLists.txt index e3f89abc46f..dcddd4f2aaa 100644 --- a/drivers/storage/class/disk/CMakeLists.txt +++ b/drivers/storage/class/disk/CMakeLists.txt @@ -10,5 +10,4 @@ add_importlibs(disk ntoskrnl hal) -add_minicd_target(disk reactos disk.sys) -add_livecd_target(disk reactos/system32/drivers) +add_cd_file(TARGET disk DESTINATION reactos/system32/drivers NO_CAB FOR all) diff --git a/drivers/storage/class/ramdisk/CMakeLists.txt b/drivers/storage/class/ramdisk/CMakeLists.txt index 6f6f1342aa8..f6cee2bfe72 100644 --- a/drivers/storage/class/ramdisk/CMakeLists.txt +++ b/drivers/storage/class/ramdisk/CMakeLists.txt @@ -8,5 +8,4 @@ add_importlibs(ramdisk ntoskrnl hal) -add_minicd_target(ramdisk reactos ramdisk.sys) -add_livecd_target(ramdisk reactos/system32/drivers) +add_cd_file(TARGET ramdisk DESTINATION reactos/system32/drivers NO_CAB FOR all) diff --git a/drivers/storage/classpnp/CMakeLists.txt b/drivers/storage/classpnp/CMakeLists.txt index 0dfb6a4e15f..2c7c15e1e4d 100644 --- a/drivers/storage/classpnp/CMakeLists.txt +++ b/drivers/storage/classpnp/CMakeLists.txt @@ -43,5 +43,4 @@ target_link_libraries(classpnp ${PSEH_LIB} libcntpr) set_module_type(classpnp kernelmodedriver) add_importlibs(classpnp hal ntoskrnl) -add_minicd_target(classpnp reactos classpnp.sys) -add_livecd_target(classpnp reactos/system32/drivers) +add_cd_file(TARGET classpnp DESTINATION reactos/system32/drivers NO_CAB FOR all) diff --git a/drivers/storage/floppy/CMakeLists.txt b/drivers/storage/floppy/CMakeLists.txt index d1dcd34951c..6a2954f1806 100644 --- a/drivers/storage/floppy/CMakeLists.txt +++ b/drivers/storage/floppy/CMakeLists.txt @@ -12,5 +12,4 @@ target_link_libraries(floppy csq) set_module_type(floppy kernelmodedriver) add_importlibs(floppy hal ntoskrnl) -add_minicd_target(floppy reactos floppy.sys) -add_livecd_target(floppy reactos/system32/drivers) +add_cd_file(TARGET floppy DESTINATION reactos/system32/drivers NO_CAB FOR all) diff --git a/drivers/storage/ide/atapi/CMakeLists.txt b/drivers/storage/ide/atapi/CMakeLists.txt index 61b478aaade..73c2c8a0eef 100644 --- a/drivers/storage/ide/atapi/CMakeLists.txt +++ b/drivers/storage/ide/atapi/CMakeLists.txt @@ -6,5 +6,4 @@ target_link_libraries(atapi libcntpr) set_module_type(atapi kernelmodedriver) add_importlibs(atapi scsiport) -add_minicd_target(atapi reactos atapi.sys) -add_livecd_target(atapi reactos/system32/drivers) +add_cd_file(TARGET atapi DESTINATION reactos/system32/drivers NO_CAB FOR all) diff --git a/drivers/storage/ide/pciide/CMakeLists.txt b/drivers/storage/ide/pciide/CMakeLists.txt index add5953708a..064c861fc24 100644 --- a/drivers/storage/ide/pciide/CMakeLists.txt +++ b/drivers/storage/ide/pciide/CMakeLists.txt @@ -4,4 +4,4 @@ add_library(pciide SHARED pciide.c pciide.rc) set_module_type(pciide kernelmodedriver) add_importlibs(pciide pciidex ntoskrnl) -add_cab_target(pciide 2) +add_cd_file(TARGET pciide DESTINATION reactos/system32/drivers FOR all) diff --git a/drivers/storage/ide/pciidex/CMakeLists.txt b/drivers/storage/ide/pciidex/CMakeLists.txt index 1d70540319f..c81b63163c6 100644 --- a/drivers/storage/ide/pciidex/CMakeLists.txt +++ b/drivers/storage/ide/pciidex/CMakeLists.txt @@ -15,5 +15,5 @@ add_library(pciidex SHARED ${SOURCE}) set_module_type(pciidex kernelmodedriver) add_importlibs(pciidex ntoskrnl) -add_cab_target(pciidex 2) +add_cd_file(TARGET pciidex DESTINATION reactos/system32/drivers FOR all) add_importlib_target(pciidex.spec) diff --git a/drivers/storage/ide/uniata/CMakeLists.txt b/drivers/storage/ide/uniata/CMakeLists.txt index aaaeaac4d74..8052d7f0035 100644 --- a/drivers/storage/ide/uniata/CMakeLists.txt +++ b/drivers/storage/ide/uniata/CMakeLists.txt @@ -18,5 +18,4 @@ add_library(uniata SHARED set_module_type(uniata kernelmodedriver) add_importlibs(uniata scsiport ntoskrnl hal) -add_minicd_target(uniata reactos uniata.sys) -add_livecd_target(uniata reactos/system32/drivers) \ No newline at end of file +add_cd_file(TARGET uniata DESTINATION reactos/system32/drivers NO_CAB FOR all) \ No newline at end of file diff --git a/drivers/storage/port/buslogic/CMakeLists.txt b/drivers/storage/port/buslogic/CMakeLists.txt index 73bd52e189a..79917511364 100644 --- a/drivers/storage/port/buslogic/CMakeLists.txt +++ b/drivers/storage/port/buslogic/CMakeLists.txt @@ -8,5 +8,4 @@ target_link_libraries(buslogic libcntpr) set_module_type(buslogic kernelmodedriver) add_importlibs(buslogic scsiport) -add_minicd_target(buslogic reactos buslogic.sys) -add_livecd_target(buslogic reactos/system32/drivers) +add_cd_file(TARGET buslogic DESTINATION reactos/system32/drivers NO_CAB FOR all) diff --git a/drivers/storage/scsiport/CMakeLists.txt b/drivers/storage/scsiport/CMakeLists.txt index 861490c2c2a..2be2a018591 100644 --- a/drivers/storage/scsiport/CMakeLists.txt +++ b/drivers/storage/scsiport/CMakeLists.txt @@ -14,5 +14,4 @@ set_module_type(scsiport kernelmodedriver) add_importlibs(scsiport ntoskrnl hal) add_importlib_target(scsiport.spec) -add_minicd_target(scsiport reactos scsiport.sys) -add_livecd_target(scsiport reactos/system32/drivers) +add_cd_file(TARGET scsiport DESTINATION reactos/system32/drivers NO_CAB FOR all) diff --git a/drivers/usb/nt4compat/usbdriver/CMakeLists.txt b/drivers/usb/nt4compat/usbdriver/CMakeLists.txt index aa8511b9cb4..fcf92117880 100644 --- a/drivers/usb/nt4compat/usbdriver/CMakeLists.txt +++ b/drivers/usb/nt4compat/usbdriver/CMakeLists.txt @@ -32,4 +32,4 @@ add_importlibs(usbdriver ntoskrnl hal) add_pch(usbdriver ${CMAKE_CURRENT_SOURCE_DIR}/usbdriver.h ${SOURCE}) -add_cab_target(usbdriver 2) +add_cd_file(TARGET usbdriver DESTINATION reactos/system32/drivers FOR all) diff --git a/drivers/video/displays/framebuf/CMakeLists.txt b/drivers/video/displays/framebuf/CMakeLists.txt index b002cca9af5..2e7a143f0f7 100644 --- a/drivers/video/displays/framebuf/CMakeLists.txt +++ b/drivers/video/displays/framebuf/CMakeLists.txt @@ -16,4 +16,4 @@ set_image_base(framebuf 0x00010000) target_link_libraries(framebuf libcntpr) add_importlibs(framebuf win32k) add_dependencies(framebuf psdk bugcodes) -add_cab_target(framebuf 1) +add_cd_file(TARGET framebuf DESTINATION reactos/system32 FOR all) diff --git a/drivers/video/displays/vga/CMakeLists.txt b/drivers/video/displays/vga/CMakeLists.txt index 811c0d5a171..fa24aed85b1 100644 --- a/drivers/video/displays/vga/CMakeLists.txt +++ b/drivers/video/displays/vga/CMakeLists.txt @@ -22,4 +22,4 @@ set_image_base(vgaddi 0x00010000) add_importlibs(vgaddi win32k) target_link_libraries(vgaddi libcntpr) add_dependencies(vgaddi psdk bugcodes) -add_cab_target(vgaddi 1) \ No newline at end of file +add_cd_file(TARGET vgaddi DESTINATION reactos/system32 FOR all) \ No newline at end of file diff --git a/drivers/video/font/ftfd/CMakeLists.txt b/drivers/video/font/ftfd/CMakeLists.txt index cf7d5402d35..72458f71082 100644 --- a/drivers/video/font/ftfd/CMakeLists.txt +++ b/drivers/video/font/ftfd/CMakeLists.txt @@ -21,5 +21,5 @@ target_link_libraries(ftfd add_importlibs(ftfd win32k) add_dependencies(ftfd psdk) -add_cab_target(ftfd 1) +add_cd_file(TARGET ftfd DESTINATION reactos/system32 FOR all) add_importlib_target(ftfd.spec) diff --git a/drivers/video/miniport/vbe/CMakeLists.txt b/drivers/video/miniport/vbe/CMakeLists.txt index f6717eac842..590db9a20d6 100644 --- a/drivers/video/miniport/vbe/CMakeLists.txt +++ b/drivers/video/miniport/vbe/CMakeLists.txt @@ -9,4 +9,4 @@ add_importlibs(vbemp videoprt) target_link_libraries(vbemp libcntpr) -add_cab_target(vbemp 2) +add_cd_file(TARGET vbemp DESTINATION reactos/system32/drivers FOR all) diff --git a/drivers/video/miniport/vga/CMakeLists.txt b/drivers/video/miniport/vga/CMakeLists.txt index b002947d8a0..52fe270c1d8 100644 --- a/drivers/video/miniport/vga/CMakeLists.txt +++ b/drivers/video/miniport/vga/CMakeLists.txt @@ -10,4 +10,4 @@ set_module_type(vgamp kernelmodedriver) add_importlibs(vgamp videoprt) add_pch(vgamp ${CMAKE_CURRENT_SOURCE_DIR}/vgamp.h ${SOURCE}) -add_cab_target(vgamp 2) +add_cd_file(TARGET vgamp DESTINATION reactos/system32/drivers FOR all) diff --git a/drivers/video/miniport/vga_new/CMakeLists.txt b/drivers/video/miniport/vga_new/CMakeLists.txt index af382e9dfa6..dba2632b9dc 100644 --- a/drivers/video/miniport/vga_new/CMakeLists.txt +++ b/drivers/video/miniport/vga_new/CMakeLists.txt @@ -22,4 +22,4 @@ add_importlibs(vga videoprt) add_pch(vga ${CMAKE_CURRENT_SOURCE_DIR}/vga.h ${SOURCE}) -add_cab_target(vga 2) +add_cd_file(TARGET vga DESTINATION reactos/system32/drivers FOR all) diff --git a/drivers/video/videoprt/CMakeLists.txt b/drivers/video/videoprt/CMakeLists.txt index 492ca51edea..2485ada6020 100644 --- a/drivers/video/videoprt/CMakeLists.txt +++ b/drivers/video/videoprt/CMakeLists.txt @@ -29,5 +29,5 @@ set_module_type(videoprt kernelmodedriver) add_importlibs(videoprt ntoskrnl hal) add_pch(videoprt ${CMAKE_CURRENT_SOURCE_DIR}/videoprt.h ${SOURCE}) -add_cab_target(videoprt 2) +add_cd_file(TARGET videoprt DESTINATION reactos/system32/drivers FOR all) add_importlib_target(videoprt.spec) diff --git a/drivers/wdm/audio/backpln/portcls/CMakeLists.txt b/drivers/wdm/audio/backpln/portcls/CMakeLists.txt index 07d3645b348..ce2bc4d3dd3 100644 --- a/drivers/wdm/audio/backpln/portcls/CMakeLists.txt +++ b/drivers/wdm/audio/backpln/portcls/CMakeLists.txt @@ -70,4 +70,4 @@ set_target_properties(portcls PROPERTIES SUFFIX ".sys") add_importlibs(portcls ntoskrnl ks drmk hal) -add_cab_target(portcls 2) \ No newline at end of file +add_cd_file(TARGET portcls DESTINATION reactos/system32/drivers FOR all) \ No newline at end of file diff --git a/drivers/wdm/audio/drm/drmk/CMakeLists.txt b/drivers/wdm/audio/drm/drmk/CMakeLists.txt index a0afcdbd1ef..20bd61a8eee 100644 --- a/drivers/wdm/audio/drm/drmk/CMakeLists.txt +++ b/drivers/wdm/audio/drm/drmk/CMakeLists.txt @@ -26,4 +26,4 @@ set_entrypoint(drmk 0) add_importlibs(drmk ntoskrnl) add_importlib_target(drmk.spec) -add_cab_target(drmk 2) +add_cd_file(TARGET drmk DESTINATION reactos/system32/drivers FOR all) diff --git a/drivers/wdm/audio/filters/kmixer/CMakeLists.txt b/drivers/wdm/audio/filters/kmixer/CMakeLists.txt index 49b90ae7130..36da734090c 100644 --- a/drivers/wdm/audio/filters/kmixer/CMakeLists.txt +++ b/drivers/wdm/audio/filters/kmixer/CMakeLists.txt @@ -14,4 +14,4 @@ target_link_libraries(kmixer add_importlibs(kmixer ntoskrnl ks hal) -add_cab_target(kmixer 2) \ No newline at end of file +add_cd_file(TARGET kmixer DESTINATION reactos/system32/drivers FOR all) \ No newline at end of file diff --git a/drivers/wdm/audio/legacy/wdmaud/CMakeLists.txt b/drivers/wdm/audio/legacy/wdmaud/CMakeLists.txt index 2c3107cd206..ca4a76661a6 100644 --- a/drivers/wdm/audio/legacy/wdmaud/CMakeLists.txt +++ b/drivers/wdm/audio/legacy/wdmaud/CMakeLists.txt @@ -23,4 +23,4 @@ target_link_libraries(wdmaud add_importlibs(wdmaud ntoskrnl ks hal) -add_cab_target(wdmaud 2) \ No newline at end of file +add_cd_file(TARGET wdmaud DESTINATION reactos/system32/drivers FOR all) \ No newline at end of file diff --git a/drivers/wdm/audio/sysaudio/CMakeLists.txt b/drivers/wdm/audio/sysaudio/CMakeLists.txt index b8ee459371a..078f19d1c63 100644 --- a/drivers/wdm/audio/sysaudio/CMakeLists.txt +++ b/drivers/wdm/audio/sysaudio/CMakeLists.txt @@ -15,4 +15,4 @@ target_link_libraries(sysaudio libcntpr) add_importlibs(sysaudio ntoskrnl ks hal) -add_cab_target(sysaudio 2) \ No newline at end of file +add_cd_file(TARGET sysaudio DESTINATION reactos/system32/drivers FOR all) \ No newline at end of file diff --git a/drivers/wmi/CMakeLists.txt b/drivers/wmi/CMakeLists.txt index 7167673a862..0ca4443efe6 100644 --- a/drivers/wmi/CMakeLists.txt +++ b/drivers/wmi/CMakeLists.txt @@ -25,4 +25,4 @@ set_target_properties(wmilib PROPERTIES SUFFIX ".sys") add_importlibs(wmilib ntoskrnl) add_importlib_target(wmilib.spec) -add_cab_target(wmilib 2) +add_cd_file(TARGET wmilib DESTINATION reactos/system32/drivers FOR all) diff --git a/gcc.cmake b/gcc.cmake index 2c1e237c82a..58c58ec652f 100644 --- a/gcc.cmake +++ b/gcc.cmake @@ -19,10 +19,6 @@ set(CMAKE_RC_COMPILE_OBJECT "${WRC} -i -o " " -i -J res -O coff -o ") -if(NOT CMAKE_HOST_SYSTEM_NAME MATCHES Windows) - set(CMAKE_C_CREATE_STATIC_LIBRARY " crs ") -endif() - # Compiler Core add_definitions(-pipe -fms-extensions) @@ -170,7 +166,7 @@ endmacro() macro(set_module_type MODULE TYPE) - add_dependencies(${MODULE} psdk buildno_header) + add_dependencies(${MODULE} psdk) if(${IS_CPP}) target_link_libraries(${MODULE} stlport -lsupc++ -lgcc) endif() diff --git a/hal/halx86/CMakeLists.txt b/hal/halx86/CMakeLists.txt index 9d2362aef02..ebada96c389 100644 --- a/hal/halx86/CMakeLists.txt +++ b/hal/halx86/CMakeLists.txt @@ -101,8 +101,7 @@ if(ARCH MATCHES i386) add_importlibs(hal ntoskrnl) target_link_libraries(hal libcntpr) - add_minicd_target(hal reactos hal.dll) - add_livecd_target(hal reactos/system32) + add_cd_file(TARGET hal DESTINATION reactos/system32 NO_CAB FOR all) # mini_hal add_library(mini_hal ${MINI_HAL_SOURCE}) diff --git a/include/host/config.h b/include/host/config.h index 89e0eecdf82..0a30629b42c 100644 --- a/include/host/config.h +++ b/include/host/config.h @@ -5,6 +5,8 @@ #define __WINE_CONFIG_H +#define HAVE_SPAWNVP 1 + /* Define to 1 if you have the header file. */ #define HAVE_FLOAT_H 1 diff --git a/include/ndk/psfuncs.h b/include/ndk/psfuncs.h index 4b0a96f52af..a32fc3b036c 100644 --- a/include/ndk/psfuncs.h +++ b/include/ndk/psfuncs.h @@ -78,6 +78,21 @@ PsGetThreadWin32Thread( PETHREAD Thread ); +NTKERNELAPI +PVOID +NTAPI +PsGetProcessWin32WindowStation( + PEPROCESS Process +); + +NTKERNELAPI +VOID +NTAPI +PsSetProcessWindowStation( + PEPROCESS Process, + PVOID WindowStation +); + NTKERNELAPI PTEB NTAPI @@ -170,6 +185,13 @@ PsGetProcessInheritedFromUniqueProcessId( IN PEPROCESS Process ); +NTKERNELAPI +NTSTATUS +NTAPI +PsGetProcessExitStatus( + PEPROCESS Process +); + // // Quota Functions // diff --git a/include/psdk/devguid.h b/include/psdk/devguid.h index 9f4f9b0f51c..62bdcdc3f53 100644 --- a/include/psdk/devguid.h +++ b/include/psdk/devguid.h @@ -15,14 +15,48 @@ * */ -DEFINE_GUID(GUID_DEVCLASS_CDROM, 0x4D36E965, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); -DEFINE_GUID(GUID_DEVCLASS_DISPLAY, 0x4D36E968, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); -DEFINE_GUID(GUID_DEVCLASS_KEYBOARD, 0x4D36E96B, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); -DEFINE_GUID(GUID_DEVCLASS_MEDIA, 0x4D36E96C, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); -DEFINE_GUID(GUID_DEVCLASS_MOUSE, 0x4D36E96F, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); -DEFINE_GUID(GUID_DEVCLASS_NET, 0x4D36E972, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); -DEFINE_GUID(GUID_DEVCLASS_NETCLIENT, 0x4D36E973, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); -DEFINE_GUID(GUID_DEVCLASS_NETSERVICE, 0x4D36E974, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); -DEFINE_GUID(GUID_DEVCLASS_NETTRANS, 0x4D36E975, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); -DEFINE_GUID(GUID_DEVCLASS_DISKDRIVE, 0x4D36E967, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); -DEFINE_GUID(GUID_DEVCLASS_SOUND, 0x4d36e97C, 0xe325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); +DEFINE_GUID(GUID_DEVCLASS_1394, 0x6BDD1FC1, 0x810F, 0x11D0, 0xBE, 0xC7, 0x08, 0x00, 0x2B, 0xE2, 0x09, 0x2F); +DEFINE_GUID(GUID_DEVCLASS_ADAPTER, 0x4D36E964, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); +DEFINE_GUID(GUID_DEVCLASS_APMSUPPORT, 0xD45B1C18, 0xC8FA, 0x11D1, 0x9F, 0x77, 0x00, 0x00, 0xF8, 0x05, 0xF5, 0x30); +DEFINE_GUID(GUID_DEVCLASS_BATTERY, 0x72631E54, 0x78A4, 0x11D0, 0xBC, 0xF7, 0x00, 0xAA, 0x00, 0xB7, 0xB3, 0x2A); +DEFINE_GUID(GUID_DEVCLASS_BLUETOOTH, 0xE0CBF06C, 0xCD8B, 0x4647, 0xBB, 0x8A, 0x26, 0x3B, 0x43, 0xF0, 0xF9, 0x74); +DEFINE_GUID(GUID_DEVCLASS_CDROM, 0x4D36E965, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); +DEFINE_GUID(GUID_DEVCLASS_COMPUTER, 0x4D36E966, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); +DEFINE_GUID(GUID_DEVCLASS_DECODER, 0x6BDD1FC2, 0x810F, 0x11D0, 0xBE, 0xC7, 0x08, 0x00, 0x2B, 0xE2, 0x09, 0x2F); +DEFINE_GUID(GUID_DEVCLASS_DISKDRIVE, 0x4D36E967, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); +DEFINE_GUID(GUID_DEVCLASS_DISPLAY, 0x4D36E968, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); +DEFINE_GUID(GUID_DEVCLASS_FDC, 0x4D36E969, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); +DEFINE_GUID(GUID_DEVCLASS_FLOPPYDISK, 0x4D36E980, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); +DEFINE_GUID(GUID_DEVCLASS_GPS, 0x6BDD1FC3, 0x810F, 0x11D0, 0xBE, 0xC7, 0x08, 0x00, 0x2B, 0xE2, 0x09, 0x2F); +DEFINE_GUID(GUID_DEVCLASS_HDC, 0x4D36E96A, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); +DEFINE_GUID(GUID_DEVCLASS_HIDCLASS, 0x745A17A0, 0x74D3, 0x11D0, 0xB6, 0xFE, 0x00, 0xA0, 0xC9, 0x0F, 0x57, 0xDA); +DEFINE_GUID(GUID_DEVCLASS_IMAGE, 0x6BDD1FC6, 0x810F, 0x11D0, 0xBE, 0xC7, 0x08, 0x00, 0x2B, 0xE2, 0x09, 0x2F); +DEFINE_GUID(GUID_DEVCLASS_INFRARED, 0x6BDD1FC5, 0x810F, 0x11D0, 0xBE, 0xC7, 0x08, 0x00, 0x2B, 0xE2, 0x09, 0x2F); +DEFINE_GUID(GUID_DEVCLASS_KEYBOARD, 0x4D36E96B, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); +DEFINE_GUID(GUID_DEVCLASS_LEGACYDRIVER, 0x8ECC055D, 0x047F, 0x11D1, 0xA5, 0x37, 0x00, 0x00, 0xF8, 0x75, 0x3E, 0xD1); +DEFINE_GUID(GUID_DEVCLASS_MEDIA, 0x4D36E96C, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); +DEFINE_GUID(GUID_DEVCLASS_MEDIUM_CHANGER, 0xCE5939AE, 0xEBDE, 0x11D0, 0xB1, 0x81, 0x00, 0x00, 0xF8, 0x75, 0x3E, 0xC4); +DEFINE_GUID(GUID_DEVCLASS_MODEM, 0x4D36E96D, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); +DEFINE_GUID(GUID_DEVCLASS_MONITOR, 0x4D36E96E, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); +DEFINE_GUID(GUID_DEVCLASS_MOUSE, 0x4D36E96F, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); +DEFINE_GUID(GUID_DEVCLASS_MTD, 0x4D36E970, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); +DEFINE_GUID(GUID_DEVCLASS_MULTIFUNCTION, 0x4D36E971, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); +DEFINE_GUID(GUID_DEVCLASS_MULTIPORTSERIAL, 0x50906CB8, 0xBA12, 0x11D1, 0xBF, 0x5D, 0x00, 0x00, 0xF8, 0x05, 0xF5, 0x30); +DEFINE_GUID(GUID_DEVCLASS_NET, 0x4D36E972, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); +DEFINE_GUID(GUID_DEVCLASS_NETCLIENT, 0x4D36E973, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); +DEFINE_GUID(GUID_DEVCLASS_NETSERVICE, 0x4D36E974, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); +DEFINE_GUID(GUID_DEVCLASS_NETTRANS, 0x4D36E975, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); +DEFINE_GUID(GUID_DEVCLASS_NODRIVER, 0x4D36E976, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); +DEFINE_GUID(GUID_DEVCLASS_PCMCIA, 0x4D36E977, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); +DEFINE_GUID(GUID_DEVCLASS_PORTS, 0x4D36E978, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); +DEFINE_GUID(GUID_DEVCLASS_PRINTER, 0x4D36E979, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); +DEFINE_GUID(GUID_DEVCLASS_PRINTERUPGRADE, 0x4D36E97A, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); +DEFINE_GUID(GUID_DEVCLASS_PROCESSOR, 0x50127DC3, 0x0F36, 0x415E, 0xA6, 0xCC, 0x4C, 0xB3, 0xBE, 0x91, 0x0B, 0x65); +DEFINE_GUID(GUID_DEVCLASS_SCSIADAPTER, 0x4D36E97B, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); +DEFINE_GUID(GUID_DEVCLASS_SMARTCARDREADER, 0x50DD5230, 0xBA8A, 0x11D1, 0xBF, 0x5D, 0x00, 0x00, 0xF8, 0x05, 0xF5, 0x30); +DEFINE_GUID(GUID_DEVCLASS_SOUND, 0x4D36E97C, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); +DEFINE_GUID(GUID_DEVCLASS_SYSTEM, 0x4D36E97D, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); +DEFINE_GUID(GUID_DEVCLASS_TAPEDRIVE, 0x6D807884, 0x7D21, 0x11CF, 0x80, 0x1C, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); +DEFINE_GUID(GUID_DEVCLASS_UNKNOWN, 0x4D36E97E, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); +DEFINE_GUID(GUID_DEVCLASS_USB, 0x36FC9E60, 0xC465, 0x11CF, 0x80, 0x56, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00); +DEFINE_GUID(GUID_DEVCLASS_VOLUME, 0x71A27CDD, 0x812A, 0x11D0, 0xBE, 0xC7, 0x08, 0x00, 0x2B, 0xE2, 0x09, 0x2F); diff --git a/include/reactos/mc/neteventmsg.mc b/include/reactos/mc/neteventmsg.mc index ab32a9ee7dd..3800d163961 100644 --- a/include/reactos/mc/neteventmsg.mc +++ b/include/reactos/mc/neteventmsg.mc @@ -1,3 +1,7 @@ +; +; netevent.mc MESSAGE resources for netevent.dll +; + MessageIdTypedef=DWORD SeverityNames=(Success=0x0:STATUS_SEVERITY_SUCCESS @@ -11,6 +15,15 @@ FacilityNames=(System=0x0:FACILITY_SYSTEM LanguageNames=(English=0x409:MSG00409) + +; +; message definitions +; + +; Facility=System + +; Eventlog messages 6xxx- + MessageId=6005 Severity=Warning Facility=System @@ -30,12 +43,14 @@ The Event log service was stopped. MessageId=6009 Severity=Warning Facility=System -SymbolicName=EVENT_EventlogProductInfo +SymbolicName=EVENT_EventLogProductInfo Language=English ReactOS %1 %2 %3 %4. . +; transport messages + MessageId=9004 Severity=Error Facility=System diff --git a/include/reactos/rossym.h b/include/reactos/rossym.h index d65f9695a76..1f7bf2f660a 100644 --- a/include/reactos/rossym.h +++ b/include/reactos/rossym.h @@ -17,33 +17,86 @@ typedef struct _ROSSYM_ENTRY { ULONG SourceLine; } ROSSYM_ENTRY, *PROSSYM_ENTRY; +enum _ROSSYM_REGNAME { + ROSSYM_X86_EAX = 0, + ROSSYM_X86_ECX, + ROSSYM_X86_EDX, + ROSSYM_X86_EBX, + ROSSYM_X86_ESP, + ROSSYM_X86_EBP, + ROSSYM_X86_ESI, + ROSSYM_X86_EDI, + + ROSSYM_X64_RAX = 0, + ROSSYM_X64_RDX, + ROSSYM_X64_RCX, + ROSSYM_X64_RBX, + ROSSYM_X64_RSI, + ROSSYM_X64_RDI, + ROSSYM_X64_RBP, + ROSSYM_X64_RSP, + Rossym_X64_R8, + ROSSYM_X64_R9, + ROSSYM_X64_R10, + ROSSYM_X64_R11, + ROSSYM_X64_R12, + ROSSYM_X64_R13, + ROSSYM_X64_R14, + ROSSYM_X64_R15 +}; + +typedef struct _ROSSYM_REGISTERS { + ULONGLONG Registers[32]; +} ROSSYM_REGISTERS, *PROSSYM_REGISTERS; + +typedef struct _ROSSYM_PARAMETER { + ULONGLONG Value; + char *ValueName; +} ROSSYM_PARAMETER, *PROSSYM_PARAMETER; + +typedef enum _ROSSYM_LINEINFO_FLAGS { + ROSSYM_LINEINFO_HAS_REGISTERS = 1 +} ROSSYM_LINEINFO_FLAGS; + +typedef enum _ROSSYM_LINEINFO_TYPE { + ROSSYM_LINEINFO_UNKNOWN, + ROSSYM_LINEINFO_NARROW_STRING, + ROSSYM_LINEINFO_WIDE_STRING, + ROSSYM_LINEINFO_ANSI_STRING, + ROSSYM_LINEINFO_UNICODE_STRING, + ROSSYM_LINEINFO_HANDLE +} ROSSYM_LINEINFO_STRINGTYPE; + +typedef struct _ROSSYM_LINEINFO { + ROSSYM_LINEINFO_FLAGS Flags; + ULONG LineNumber; + char *FileName; + char *FunctionName; + ROSSYM_REGISTERS Registers; + ULONG NumParams; + ROSSYM_PARAMETER Parameters[16]; +} ROSSYM_LINEINFO, *PROSSYM_LINEINFO; + typedef struct _ROSSYM_CALLBACKS { PVOID (*AllocMemProc)(ULONG_PTR Size); VOID (*FreeMemProc)(PVOID Area); BOOLEAN (*ReadFileProc)(PVOID FileContext, PVOID Buffer, ULONG Size); BOOLEAN (*SeekFileProc)(PVOID FileContext, ULONG_PTR Position); + BOOLEAN (*MemGetProc)(PVOID FileContext, ULONG_PTR *Target, PVOID SourceMem, ULONG Size); } ROSSYM_CALLBACKS, *PROSSYM_CALLBACKS; -typedef struct _ROSSYM_OWN_FILECONTEXT { - BOOLEAN (*ReadFileProc)(PVOID FileContext, PVOID Buffer, ULONG Size); - BOOLEAN (*SeekFileProc)(PVOID FileContext, ULONG_PTR Position); -} ROSSYM_OWN_FILECONTEXT, *PROSSYM_OWN_FILECONTEXT; - struct Dwarf; typedef struct Dwarf *PROSSYM_INFO; VOID RosSymInit(PROSSYM_CALLBACKS Callbacks); -VOID RosSymInitKernelMode(VOID); VOID RosSymInitUserMode(VOID); -BOOLEAN RosSymCreateFromMem(PVOID ImageStart, ULONG_PTR ImageSize, - PROSSYM_INFO *RosSymInfo); BOOLEAN RosSymCreateFromFile(PVOID FileContext, PROSSYM_INFO *RosSymInfo); -BOOLEAN RosSymGetAddressInformation(PROSSYM_INFO RosSymInfo, - ULONG_PTR RelativeAddress, - ULONG *LineNumber, - char *FileName, - char *FunctionName); +BOOLEAN RosSymGetAddressInformation +(PROSSYM_INFO RosSymInfo, + ULONG_PTR RelativeAddress, + PROSSYM_LINEINFO RosSymLineInfo); +VOID RosSymFreeInfo(PROSSYM_LINEINFO RosSymLineInfo); VOID RosSymDelete(PROSSYM_INFO RosSymInfo); #endif /* REACTOS_ROSSYM_H_INCLUDED */ diff --git a/include/reactos/undocuser.h b/include/reactos/undocuser.h index 06312d7d34e..0fe8a816c1a 100644 --- a/include/reactos/undocuser.h +++ b/include/reactos/undocuser.h @@ -77,6 +77,7 @@ // // Definitions used by WM_LOGONNOTIFY // +#define LN_SHELL_EXITED 0x2 #define LN_START_TASK_MANAGER 0x4 #define LN_LOCK_WORKSTATION 0x5 #define LN_UNLOCK_WORKSTATION 0x6 diff --git a/include/reactos/win32k/ntuser.h b/include/reactos/win32k/ntuser.h index 71ea1772fc6..432390a5fc7 100644 --- a/include/reactos/win32k/ntuser.h +++ b/include/reactos/win32k/ntuser.h @@ -65,6 +65,8 @@ typedef struct _DESKTOPINFO HWND hProgmanWindow; HWND hShellWindow; + PPROCESSINFO ppiShellProcess; + union { UINT Dummy; diff --git a/lib/3rdparty/freetype/ChangeLog b/lib/3rdparty/freetype/ChangeLog index 83a7d53c6d4..b7aea521796 100644 --- a/lib/3rdparty/freetype/ChangeLog +++ b/lib/3rdparty/freetype/ChangeLog @@ -1,15 +1,15 @@ -2010-02-13 Werner Lemberg +2010-11-28 Werner Lemberg - * Version 2.3.12 released. - ========================== + * Version 2.4.4 released. + ========================= - Tag sources with `VER-2-3-12'. + Tag sources with `VER-2-4-4'. * docs/CHANGES: Updated. * docs/VERSION.DLL: Update documentation and bump version number to - 2.3.12. + 2.4.4 * README, Jamfile (RefDoc), builds/win32/vc2005/freetype.vcproj, builds/win32/vc2005/index.html, @@ -22,7917 +22,1529 @@ builds/wince/vc2005-ce/freetype.vcproj, builds/wince/vc2005-ce/index.html, builds/wince/vc2008-ce/freetype.vcproj, - builds/wince/vc2008-ce/index.html: s/2.3.11/2.3.12/, s/2311/2312/. - - * include/freetype/freetype.h (FREETYPE_PATCH): Set to 12. - - * builds/unix/configure.raw (version_info): Set to 10:0:4. - -2010-02-12 suzuki toshiya - - Improve autotool version checking to work with beta releases. - - * autogen.sh (check_tool_version): Improve the extraction of version - number from "tool --version" output. Some beta releases of - autotools have extra strings before version number. - -2010-02-12 suzuki toshiya - - Fix overallocating bug in FT_Outline_New_Internal(). - - * src/base/ftoutln.c (FT_Outline_New_Internal): The length of - FT_Outline->points[] should be numPoints, not 2 * numPoints. - Found by Paul Messmer, see - http://lists.gnu.org/archive/html/freetype-devel/2010-02/msg00003.html - -2010-02-10 Ken Sharp - - Really fix Savannah bug #28678 (part 2). - - Since we consider `sbw' for the horizontal direction only, we still have - to synthesize vertical metrics if the user wants to use the vertical - writing direction. - - * src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c - (cid_slot_load_glyph), src/type1/t1gload.c (T1_Load_Glyph): - Synthesize vertical metrics (only) if FT_LOAD_VERTICAL_LAYOUT is - set. - -2010-02-10 Ken Sharp - - Really fix Savannah bug #28678 (part 1). - - After long discussion, we now consider the character width vector - (wx,wy) returned by the `sbw' Type 1 operator as being part of *one* - direction only. For example, if you are using the horizontal - writing direction, you get the horizontal and vertical components of - the advance width for this direction. Note that OpenType and CFF fonts - don't have such a vertical component; instead, the GPOS table can be - used to generate two-dimensional advance widths (but this isn't - handled by FreeType). - - * include/freetype/ftincrem.h (FT_Incremental_MetricsRec): Add - `advance_v' field to hold the vertical component of the advance - value. - - * src/truetype/ttgload.c (tt_get_metrics), src/cff/cffgload.c - (cff_slot_load), src/type1/t1gload.c - (T1_Parse_Glyph_And_Get_Char_String), src/cid/cidgload.c - (cid_load_glyph): Use it. - -2010-02-08 Werner Lemberg - - * devel/ftoption.h [FT_CONFIG_OPTION_PIC]: Define. - -2010-02-04 suzuki toshiya - - Prevent NULL pointer dereference passed to FT_Module_Requester. - - * src/sfnt/sfdriver.c (sfnt_get_interface): Don't use `module'. - * src/psnames/psmodule.c (psnames_get_interface): Ditto. - - * src/cff/cffdrivr.c (cff_get_interface): Check NULL `driver'. - * src/truetype/ttdriver.c (tt_get_interface): Ditto. - -2010-01-29 suzuki toshiya - - Fix memory leaks in previous patch. - - * src/sfnt/sfobjs.c (sfnt_load_face): Don't overwrite the strings - allocated for face->root.family_name and style_name. - -2010-01-29 suzuki toshiya - - New parameters for FT_Open_Face() to ignore preferred family names. - - Preferred family names should be used for legacy systems that - can hold only a few faces (<= 4) for a family name. Suggested by - Andreas Heinrich. - http://lists.gnu.org/archive/html/freetype/2010-01/msg00001.html - - * include/freetype/ftsnames.h (FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY, - FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY): Define. - - * src/sfnt/sfobjs.h (sfnt_load_face): Check the arguments and - ignore preferred family and subfamily names if requested. - -2010-01-27 Ken Sharp - - Fix Savannah bug #28678. - - * src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c - (cid_load_glyph): Handle vertical metrics correctly. - - * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Handle - vertical metrics correctly. - (T1_Load_Glyph): Don't synthesize vertical metrics. - -2010-01-14 Werner Lemberg - - Make FT_Set_Transform work if no renderer is available. - - * src/base/ftobjs.c (FT_Load_Glyph): Apply `standard' transformation - if no renderer is compiled into the library. - -2010-01-14 Werner Lemberg - - Fix compilation warning. - - * src/base/ftbase.h: s/LOCAL_DEF/LOCAL/. - * src/base/ftobjc.s: Include ftbase.h conditionally. - -2010-01-11 Kwang Yul Seo - - Provide inline assembly code for RVCT compiler. - This is Savannah patch #7059. - - * include/freetype/config/ftconfig.h (FT_MULFIX_ASSEMBLER, - FT_MulFix_arm) [__CC_ARM || __ARM_CC]: Define. - -2010-01-08 Ken Sharp - - Fix Savannah bug #28521. - - Issue #28226 involved a work-around for a font which used the - `setcurrentpoint' operator in an invalid way; this operator is only - supposed to be used with the result of OtherSubrs, and the font used - it directly. The supplied patch removed the block of code which - checked this usage entirely. - - This turns out to be a Bad Thing. If `setcurrentpoint' is being - used correctly it should reset the flex flag in the decoder. If we - don't do this then the flag never gets reset and we omit any further - contours from the glyph (at least until we close the path or - similar). - - * src/psaux/t1decode.c (t1_decoder_parse_charstrings) - : Handle `flex_state' correctly. - -2010-01-05 Werner Lemberg - - Apply reports from clang static analyzer. - - * src/lzw/ftlzw.c (ft_lzw_file_init), src/base/ftstroke.c - (FT_Stroker_ParseOutline), src/base/ftsynth.c - (FT_GlyphSlot_Embolden): Remove dead code. - - * src/base/ftpatent.c (_tt_check_patents_in_table): Initialize - `offset_i' and `length_i'. - -2010-01-05 Ralph Giles - - Enable the incremental font interface by default. - - Ghostscript requires the incremental font interface for handling - some Postscript documents. It is moving to using FreeType as its - primary renderer; supporting this in the default build makes it - Ghostscript to be linked against the system FreeType when one is - available. - - * include/freetype/config/ftoption.h (FT_CONFIG_OPTION_INCREMENTAL): - Uncomment. - -2010-01-05 Werner Lemberg - - Fix Savannah bug #28395. - - * src/truetype/ttdriver.c (Load_Glyph), src/type1/t1gload.c - (T1_Loada_Glyph): Don't check `num_glyphs' if incremental interface - is used. - -2010-01-05 Ken Sharp - - Make Type 1 `seac' operator work with incremental interface. - This fixes Savannah bug #28480. - - * src/psaux/t1decode.c (t1operator_seac): Don't check `glyph_names' - if incremental interface is used. - -2010-01-04 Ken Sharp - - Make incremental interface work with TrueType fonts. - This fixes Savannah bug #28478. - - * src/truetype/ttgload.c (load_truetype_glyph): Don't check - `glyf_offset' if incremental interface is used. - -2009-12-31 Lars Abrahamsson - - Make compilation with FT_CONFIG_OPTION_PIC work again. - - * src/base/ftglyph.c (FT_Glyph_To_Bitmap) [FT_CONFIG_OPTION_PIC]: - Declare `library' for FT_BITMAP_GLYPH_CLASS_GET. - - * src/base/ftinit.c (ft_destroy_default_module_classes, - ft_create_default_module_classes): Use proper casts (needed for C++ - compilation). - - * src/sfnt/ttcmap.c (tt_cmap13_class_rec): Use FT_DEFINE_TT_CMAP. - -2009-12-22 Marc Kleine-Budde - - Make freetype-config aware of $SYSROOT. - This is Savannah patch #7040. - - * builds/unix/freetype-config.in: Decorate with ${SYSROOT} where - appropriate. - -2009-12-20 Werner Lemberg - - Fix compiler warning. - Reported by Sean. - - * src/base/ftdbgmem.c [!FT_DEBUG_MEMORY]: ANSI C doesn't like empty - source files; however, some compilers warn about an unused variable - declaration. This is now replaced with a typedef. - -2009-12-18 Werner Lemberg - - Fix Savannah bug #28320. - - There exist corrupt, subsetted fonts (embedded in PDF files) which - contain a private dict that ends with an unterminated floating point - number (no operator following). We now ignore this error (as - acrobat does). - - * src/cff/cffparse.c (cff_parser_run): Don't emit a syntax error for - unterminated floating point numbers. - -2009-12-16 Werner Lemberg - - Really fix compiler warnings. - Reported by Sean. - - * src/truetype/ttgxvar.c (GX_PT_POINTS_ARE_WORDS, - GX_PT_POINT_RUN_COUNT_MASK): Convert enum values to macros. - -2009-12-16 suzuki toshiya - - Improve configure.raw to copy some options from CFLAGS to LDFLAGS. - The linker of Mac OS X 10.6 is sensitive to the architecture. If - the architectures are specified explicitly for the C compiler, the - linker requires the architecture specifications too. - - * builds/unix/configure.raw: Replace `-isysroot' option parser by - more generic argument parser. - -2009-12-15 Werner Lemberg - - Fix compiler warnings. - Reported by Sean. - - * src/truetype/ttgxvar.c (ft_var_readpackeddeltas): Fix counter data - type. - -2009-12-14 Ken Sharp - - Ignore invalid `setcurrentpoint' operations in Type 1 fonts. - This fixes Savannah bug #28226. - - At least two wild PostScript files of unknown provenance contain - Type 1 fonts, apparently converted from TrueType fonts in earlier - PDF versions of the files, which use the `setcurrentpoint' operator - inappropriately. - - FreeType currently throws an error in this case, but Ghostscript and - Adobe Distiller both accept the fonts and ignore the problem. This - commit #ifdefs out the check so PostScript interpreters using - FreeType can render these files. - - The specification says `setcurrentpoint' should only be used to set - the point after a `Subr' call, but these fonts use it to set the - initial point to (0,0). Unnecessarily so, as they correctly use an - `hsbw' operation which implicitly sets the initial point. - - * src/psaux/t1decode.c (t1_decoder_parse_charstrings) - : Comment out code. - -2009-12-14 Bram Tassyns - - Fix parsing of /CIDFontVersion. - This fixes Savannah bug #28287. - - * src/cid/cidtoken.h: `cid_version' in CID_FaceInfoRec (in - t1tables.h) is of type FT_Fixed. - -2009-12-14 Werner Lemberg - - Trace glyph index in CID module. - Suggested in Savannah patch #7023. - - * src/cid/cidgload.c (cid_load_glyph): Add tracing message. - -2009-12-03 Werner Lemberg - - Fix compiler warnings. - - * src/truetype/ttgload.c (tt_get_metrics): Put `Exit' label into the - proper preprocessor conditional. - * src/pfr/pfrobjs.c (pfr_slot_load): Pacify gcc. - -2009-11-25 John Tytgat - - Better handling of start of `eexec' section. - This fixes Savannah bug #28090. - - * src/type1/t1parse.c (T1_Get_Private_Dict): Skip all whitespace - characters before start of `eexec' section. - -2009-11-20 Werner Lemberg - - Fix Savannah bug #27742. - - * src/base/ftstroke.c (ft_stroker_outside): Avoid silent division by - zero, using a threshold for `theta'. - -2009-11-20 Werner Lemberg - - Fix Savannah bug #28036. - - * src/type1/t1afm.c (t1_get_index): Fix comparison. - -2009-11-16 Werner Lemberg - - Fix compiler warnings. - Reported by Kevin Blenkinsopp . - - * src/sfnt/ttload.c (check_table_dir): Use proper data type. - -2009-11-15 Werner Lemberg - - Really fix FreeDesktop bug #21197. - This also fixes Savannah bug #28021. - - * src/autofit/aflatin.c (af_latin_metrics_check_digits), - src/autofit/aflatin2.c (af_latin2_metrics_check_digits): Fix loop. - -2009-11-15 Werner Lemberg - - Add tracing messages for advance values. - - * src/base/ftobjs.c (FT_Load_Glyph), src/truetype/ttgload.c - (TT_Get_HMetrics, TT_Get_VMetrics): Do it. - -2009-11-08 Werner Lemberg - - Fix compiler warning. - Reported by Jeremy Manson . - - * src/truetype/ttgload.c (load_truetype_glyph): Initialize `error'. - -2009-11-04 Werner Lemberg - - Remove compiler warning. - Reported by Sean McBride . - - * src/tools/apinames.c (read_header_file): Use a cast to - `int', as specified in the printf(3) man page. - -2009-11-04 Werner Lemberg - - Fix Savannah bug #27921. - - * src/cff/cffobjs.c (cff_face_init), src/cid/cidobjs.c - (cid_face_init), src/type1/t1afm.c (T1_Read_Metrics), - src/type1/t1objs.c (T1_Face_Init): Don't use unsigned constant - values for rounding if the argument can be negative. - -2009-11-03 Bram Tassyns - - Add basic support for Type1 charstrings in CFF. - This fixes Savannah bug #27922. - - * src/cff/cffgload.c (CFF_Operator, cff_argument_counts): Handle - `seac', `sbw', and `setcurrentpoint' opcodes. - (cff_compute_bias): Add parameter to indicate the charstring type. - Update all callers. - (cff_operator_seac): Add parameter for side bearing. - (cff_decoder_parse_charstrings): Updated for more Type1 support. - -2009-11-03 Werner Lemberg - - Return correct `linearHoriAdvance' value for embedded TT bitmaps too. - Reported by Jeremy Manson . - - src/truetype/ttgload.c (load_truetype_glyph): Add parameter to - quickly load the glyph header only. - Update all callers. - (tt_loader_init): Add parameter to quickly load the `glyf' table - only. - Update all callers. - (TT_Load_Glyph): Compute linear advance values for embedded bitmap - glyphs too. - -2009-11-03 Werner Lemberg - - Improve code readability. - - * src/ttgload.c (load_truetype_glyph): Move metrics calculation - to... - (tt_get_metrics): This new function. - -2009-10-26 Bram Tassyns - - Fix Savannah bug #27811. - - * src/truetype/ttxgvar.c (ft_var_readpackeddeltas): Fix - signed/unsigned mismatch. - -2009-10-19 Ning Dong - - Fix handling of `get' and `put' CFF instructions. - - * src/cff/cffgload.c (cff_decoder_parse_charstrings) : Appendix B of Adobe Technote #5177 limits the number of - elements for the `get' and `put' operators to 32. - * src/cff/cffgload.h (CFF_MAX_TRANS_ELEMENTS): Define. - (CFF_Decoder): Use it for `buildchar' and remove `len_buildchar'. - -2009-10-18 Werner Lemberg - - Fix handling of `dup' CFF instruction. - Problem and solution reported by Ning Dong . - - * src/cff/cffgload.c (cff_decoder_parse_charstrings) : - Increase `args' by 2, not 1. - -2009-10-10 Werner Lemberg - - * Version 2.3.11 released. - ========================== - - - Tag sources with `VER-2-3-11'. - - * docs/VERSION.DLL: Update documentation and bump version number to - 2.3.11. - - * README, Jamfile (RefDoc), builds/win32/visualc/index.html, - builds/win32/visualc/freetype.dsp, - builds/win32/visualc/freetype.vcproj, - builds/win32/visualce/index.html, - builds/win32/visualce/freetype.dsp, - builds/win32/visualce/freetype.vcproj: s/2.3.10/2.3.11/, s/2310/2311/. - - * include/freetype/freetype.h (FREETYPE_PATCH): Set to 11. - - * builds/unix/configure.raw (version_info): Set to 9:22:3. - -2009-10-10 Werner Lemberg - - * docs/CHANGES, docs/release: Updated. - -2009-10-10 suzuki toshiya - - * src/pcf/pcfread.c (pcf_get_properties): Fix a bug in the nprops - truncation. Reported by Martin von Gagern and Peter Volkov. - https://bugs.gentoo.org/288357 and https://bugs.gentoo.org/288256 - -2009-10-06 Werner Lemberg - - * Version 2.3.10 released. - ========================== - - - Tag sources with `VER-2-3-10'. - - * builds/toplevel.mk (major, minor, patch): Fix regexp to allow more - than a single digit. - (dist): We now use git. - - * docs/VERSION.DLL: Update documentation and bump version number to - 2.3.10. - - * README, Jamfile (RefDoc), builds/win32/visualc/index.html, - builds/win32/visualc/freetype.dsp, - builds/win32/visualc/freetype.vcproj, - builds/win32/visualce/index.html, - builds/win32/visualce/freetype.dsp, - builds/win32/visualce/freetype.vcproj: s/2.3.9/2.3.10/, s/239/2310/. - - * include/freetype/freetype.h (FREETYPE_PATCH): Set to 10. - - * builds/unix/configure.raw (version_info): Set to 9:21:3. - -2009-10-06 Werner Lemberg - - Fix `make multi'. - - * src/cache/ftccache.c, src/cache/ftcsbits.c (FT_COMPONENT): Define. - - * src/sfnt/sfdriver.c: Include FT_INTERNAL_DEBUG_H. - -2009-09-27 suzuki toshiya - - [cache] Fix Savannah bug #27441, clean up Redhat bugzilla #513582. - Tricky casts in FTC_{CACHE,GCACHE,MRULIST}_LOOKUP_CMP() are removed. - Now these functions should be called with FTC_Node or FTC_MruNode - variable, and the caller should cast them to appropriate pointers to - concrete data. These tricky casts can GCC-4.4 optimizer (-O2) - confused and the crashing binaries are generated. - - * src/cache/ftcmru.h (FTC_MRULIST_LOOKUP_CMP): Drop tricky cast. - Now the 4th argument `node' of this function should be typed as - FTC_MruNode. - - * src/cache/ftcglyph.h (FTC_GCACHE_LOOKUP_CMP): For inline - implementation, new temporal variable FTC_MruNode `_mrunode' to take - the pointer from FTC_MRULIST_LOOKUP_CMP(). For non-inline - implementation, tricky cast is dropped. - - * src/cache/ftcmanag.c (FTC_SIZE_NODE): New macro casting - to FTC_SizeNode. - (FTC_Manager_LookupSize): Replace FTC_SizeNode `node' by FTC_MruNode - `mrunode', and FTC_SIZE_NODE() is inserted. - (FTC_FACE_NODE): New macro casting to FTC_FaceNode. - (FTC_Manager_LookupFace) Replace FTC_FaceNode `node' by FTC_MruNode - `mrunode', and FTC_FACE_NODE() is inserted. - - * src/cache/ftcbasic.c (FTC_ImageCache_Lookup): Change the type of - `node' from FTC_INode to FTC_Node. Extra casting macro FTC_NODE() - is dropped. - (FTC_ImageCache_LookupScaler): Ditto. - (FTC_SBitCache_Lookup): Change the type of `node' from FTC_SNode to - FTC_Node. Extra casting macro FTC_NODE() is dropped. FTC_SNODE() - is inserted. - (FTC_SBitCache_LookupScaler): Ditto. - - * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Change the type of - `node' from FTC_CMapNode to FTC_Node. Extra casting macro - FTC_NODE() is dropped, FTC_CMAP_NODE() is inserted. - -2009-09-25 suzuki toshiya - - [cache, psaux, type1] Fix for multi build. - In multi build, some cpp functions are left as unresolved symbols. - - * src/cache/ftcbasic.c: Include FT_INTERNAL_DEBUG_H for FT_TRACE1(). - - * src/psaux/t1decode.c: Include FT_INTERNAL_CALC_H for - FIXED_TO_INT(). - * src/type1/t1gload.c: Ditto. - * src/type1/t1objs.c: Ditto. - -2009-09-25 suzuki toshiya - - [autofit] Fix for multi build. - - * src/autofit/afmodule.h: Include FT_INTERNAL_OBJECTS_H to use - FT_DECLARE_MODULE() macro in multi build. - - * src/autofit/aflatin.c: Include to handle - FT_ADVANCES_H correctly in multi build. - -2009-09-24 suzuki toshiya - - [cache] Check the face filled by FTC_Manager_LookupFace(). - - * src/cache/ftcbasic.c (ftc_basic_family_get_count): Return - immediately if FTC_Manager_LookupFace() fills face by NULL. Such - case can occur when the code is optimized by GCC-4.2.x. - -2009-09-23 Werner Lemberg - - * docs/CHANGES: Updated. - -2009-09-12 Werner Lemberg - - [raster] Fix 5-levels grayscale output. - This was broken since version 2.3.0. - - * src/raster/ftraster.c (count_table): Use pre-2.3.0 values (which - were then computed dynamically). - (Vertical_Gray_Sweep_Step): Updated. - - (ft_black_render): Initialize `worker->gray_lines' (problem found by - valgrind). - - (FT_RASTER_OPTION_ANTI_ALIASING, DEBUG_RASTER): Dont' #undef, just - comment out. - -2009-09-12 suzuki toshiya - - Improve configure.raw for cross build. - - * builds/unix/configure.raw: Remove temporal files created by the - suffix checking for CC_BUILD. Set XX_ANSIFLAGS and XX_CFLAGS when - cross compiler is GCC. AC_PROG_CC checks whether the cross compiler - is GCC, its result is stored in GCC. - -2009-09-12 suzuki toshiya - - [BDF] Modify hash API to take size_t value instead of void *. - - The hash API in BDF driver is designed to be generic, it takes - void * typed data. But BDF driver always gives an unsigned long - integer (the index to a property). To reduce non-essential - casts from unsigned long to void* and from void* to unsigned - long, the hash API is changed to take size_t integer. - The issue of incompatible cast between unsigned long and void* - on LLP64 platform is reported by NightStrike from MinGW-Win64 - project. See - http://lists.gnu.org/archive/html/freetype/2009-09/msg00000.html - - * src/bdf/bdf.h: The type of hashnode->data is changed from - void* to size_t. - - * src/bdf/bdflib.c (hash_insert): Get size_t data, instead of - void* data. - (bdf_create_property): Get the name length of new property by - size_t variable, with a cut-off at FT_ULONG_MAX. - (_bdf_set_default_spacing): Get the name length of the face by - size_t variable, with a cut-off at 256. - (bdf_get_property): Get the property id by size_t variable to - reduce the casts between 32-bit prop ID & hashnode->data during - simple copying. - (_bdf_add_property): Ditto. - (_bdf_parse_start): Calculate the index to the property array - by size_t variable. - (bdf_get_font_property): Drop a cast to unsigned long. - -2009-09-10 suzuki toshiya - - [Win64] Improve the computation of random seed from stack address. - - On LLP64 platform, the conversion from pointer to FT_Fixed need - to drop higher 32-bit. Explict casts are required. Reported by - NightStrike from MinGW-w64 project. See - http://lists.gnu.org/archive/html/freetype/2009-09/msg00000.html - - * src/cff/cffgload.c: Convert the pointers to FT_Fixed explicitly. - - * src/psaux/t1decode.c: Ditto. - - -2009-09-03 Werner Lemberg - - [raster] Improvements for stand-alone mode. - - * src/raster/rules.mk: Don't handle ftmisc.h. It is needed for - stand-alone mode only. - - * src/raster/ftmisc.h (FT_MemoryRec , FT_Alloc_Func, FT_Free_Func, - FT_Realloc_Func): Copy declarations from ftsystem.h. - -2009-09-02 Bram Tassyns - - Improve vertical metrics calculation (Savannah bug #27364). - - The calculation of `vertBearingX' is not defined in the OTF font - spec so FreeType does a `best effort' attempt. However, this value - is defined in the PDF and PostScript specs, and that algorithm is - better than the one FreeType currently uses: - - FreeType: Use the middle of the bounding box as the X coordinate - of the vertical origin. - - Adobe PDF spec: Use the middle of the horizontal advance vector as - the X coordinate of the vertical origin. - - FreeType's algorithm goes wrong if you have a really small glyph - (like the full-width, circle-like dot at the end of the sentence, as - used in CJK scripts) with large bearings. With the FreeType - algorithm this dot gets centered on the baseline; with the PDF - algorithm it gets the correct location (in the top right). Note - that this is a serious issue, it's like printing the dot at the end - of a Roman sentence at the center of the textline instead of on the - baseline like it should. So i believe the PDF spec's algorithm - should be used in FreeType as well. - - The `vertBearingY' value for such small glyphs is also very strange - if no `vmtx' information is present, since the height of the bbox is - not representable for the height of the glyph visually (the - whitespace up to the baseline is part of the glyph). The fix also - includes some code for a better estimate of `vertBearingY'. - - * src/base/ftobjs.c (ft_synthesize_vertical_metrics): `vertBearingX' - is now calculated as described by the Adobe PDF Spec. Estimate for - `vertBearingY' now works better for small glyphs completely above or - below the baseline into account. - - * src/cff/cffgload.c (cff_slot_load): `vertBearingX' is now - calculated as described by the Adobe PDF Spec. Vertical metrics - information was always ignored when FT_CONFIG_OPTION_OLD_INTERNALS - was not defined. - - * src/truetype/ttgload.c (compute_glyph_metrics): `vertBearingX' is - now calculated as described by the Adobe PDF Spec. - -2009-09-01 John Tytgat - - Fix custom cmap for empty Type 1 font (Savannah bug #27294). - - * include/freetype/internal/t1types.h (T1_EncodingRecRec_): Update - comment to reflect revised code_last meaning. - * src/type1/t1load.c (T1_Open_Face), src/type42/t42objs.c - (T42_Open_Face): Assign max_char as highest character code + 1 and - use this for T1_EncodingRecRec_::code_last. - * src/psaux/t1cmap.c (t1_cmap_custom_init): Follow revised - T1_EncodingRecRec_::code_last meaning. - -2009-08-25 Werner Lemberg - - Fix rendering of horizontally compressed CFFs. - Bug reported by Ivan Nincic . - - * src/cff/cffgload.c (cff_slot_load): Thinko: Check `xx' element of - `font_matrix' also. - - * docs/CHANGES: Updated. - -2009-08-03 suyu0925@gmail.com - - Don't call `ft_fseek' every time when executing `ft_fread'. - - * src/base/ftstream.c (FT_Stream_Seek), src/base/ftsystem.c - (ft_ansi_stream_io): Implement it. - -2009-07-31 suzuki toshiya - - sfnt: Cast a charcode to 32-bit in cmap format 14 parser. - - * src/sfnt/ttcmap.c (tt_cmap14_char_var_index, - tt_cmap14_char_var_isdefault, tt_cmap14_char_variants, - tt_cmap14_variant_chars): Correct mismatches from - FT_CMap_CharVarIndexFunc prototype, FT_ULong arguments - are replaced by FT_UInt32 arguments. - -2009-07-31 suzuki toshiya - - sfnt: Cast a charcode to 32-bit in cmap format 12 parser. - - * src/sfnt/ttcmap.c (tt_cmap12_char_next): - Insert explicit cast from FT_UFast to FT_UInt32 - for return value. - -2009-07-31 suzuki toshiya - - psaux: Fix a few casts to FT_Int32 value. - - * src/psaux/t1decode.c (t1_decoder_parse_charstrings): - Fix a few casts setting `value' from FT_Long to FT_Int32, - because `value' is typed as FT_Int32 since 2009-06-22. - -2009-07-31 suzuki toshiya - - sfnt: Fix a data type mismatching with its source. - - * src/sfnt/ttcmap.c (tt_cmap13_char_next): Fix the - type of `gindex' from FT_ULong to FT_UInt because - it is set by FT_UInt tt_cmap13_char_map_binary() or - TT_CMap13->cur_gindex. - -2009-07-31 suzuki toshiya - - sfnt: Extend a few local variables to load 32-bit values. - - * src/sfnt/ttkern.c (tt_face_load_kern): Extend `count' - and `kern' to load 32-bit values. - -2009-07-31 suzuki toshiya - - pfr: Extend `num_aux' to take 32-bit value. - - * src/pfr/pfrload.c (pfr_phy_font_load): Extend - `num_aux' to load 32-bit value. - -2009-07-31 suzuki toshiya - - pcf: Truncate FT_ULong `nprops' to fit to int PCF_Face->nprops. - - * src/pcf/pcfread.c (pcf_get_properties): Load `nprops' - as FT_ULong value from PCF file, but truncate it as - int to fit PCF_Face->nprops. The number of truncated - properties is shown in the trace message. - -2009-07-31 suzuki toshiya - - gxvalid: Extend a few local variables to reduce the casts. - - * src/gxvalid/gxvmorx.c (gxv_morx_subtables_validate): - Extend `type' and `rest' to take FT_ULong values. - -2009-07-31 suzuki toshiya - - gxvalid: Extend `settingTable' to take 32-bit offset. - - * src/gxvalid/gxvfeat.c (gxv_feat_name_validate): - Extend `settingTable' to take 32-bit offset. - -2009-07-31 suzuki toshiya - - autofit: Cast FT_Long glyph_count to compare with FT_UInt GID. - - * src/autofit/afglobal.c (af_face_globals_is_digit, - af_face_globals_compute_script_coverage): Cast FT_Long - globals->glyph_count to FT_ULong, to compare with FT_UInt - gindex. - -2009-07-31 suzuki toshiya - - smooth: Exclude 16-bit system in invalid pitch/height check. - - * src/smooth/ftsmooth.c (ft_smooth_render_generic): - pitch and height are typed as FT_UInt but checked to fit - 16-bit range, to avoid the overflows. On 16-bit system, - this checking inserts a conditional that never occurs. - -2009-07-03 suzuki toshiya - - cff: Type large constants > 0x7FFF as long for 16-bit systems. - - * src/cff/cffload.c (cff_charset_load): Type large - constants > 0x7FFF as long, because normal constants - are typed signed integer that is less than 0x8000 on - 16-bit systems. - -2009-07-31 suzuki toshiya - - base: Remove an unused variable. - - * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Remove an - unused variable `library'. glyph->library is used. - -2009-07-31 suzuki toshiya - - cache: Check higher bits in flags for non ILP32 systems. - - 4 public functions ought to take FT_ULong flags, but take - FT_UInt flags. To keep binary compatibility, we drop higher - bits on non ILP32 platforms, - ILP64 systems: No drop occurs. - LP64 systems: Higher bits are not used. - 16-bit systems: Drop can occur. - See - http://lists.gnu.org/archive/html/freetype-devel/2008-12/msg00065.html - These functions will be refined to take FT_ULong flags in - next bump with incompatible API change. - - * src/cache/ftcbasic.c (FTC_ImageCache_Lookup): - Check `flags' in `type', the 2nd argument. - (FTC_SBitCache_Lookup): Ditto. - (FTC_ImageCache_LookupScaler): Check `load_flags', - the 3rd argument. - (FTC_SBitCache_LookupScaler): Ditto. - -2009-07-31 suzuki toshiya - - sfnt: Ignore invalid GIDs in glyph name lookup. - - * include/freetype/internal/fttrace.h: - New trace module for sfdriver.c is added. - - * src/sfnt/sfdriver.c (sfnt_get_name_index): - Restrict glyph name lookup to FT_UInt GID. - Genuine TrueType can hold 16-bit glyphs. - -2009-07-31 suzuki toshiya - - pcf: Fix a comparison between FT_Long and FT_ULong. - - * src/pcf/pcfread.c (pcf_get_bitmaps): Return an error - if PCF_Face->nemetrics is negative. - -2009-07-31 suzuki toshiya - - gxvalid: Guarantee `nFeatureFlags' size up to 32-bit. - - * src/gxvalid/gxvmort.c (gxv_mort_featurearray_validate): - Extend the 3rd argument `nFeatureFlags' to FT_ULong. - * src/gxvalid/gxvmort.h: Ditto. - -2009-07-31 suzuki toshiya - - sfnt: Insert explicit cast for LP64 system. - - * src/sfnt/ttkern.c (tt_face_load_kern): Insert - cast from unsigned long to FT_UInt32. - -2009-07-31 suzuki toshiya - - gxvalid: Guarantee `just' table size upto 32-bit. - - * src/gxvalid/gxvjust.c (gxv_just_validate): - The type of `offset' is changed from FT_UInt to - FT_Offset, for 16-bit platforms. - -2009-07-31 suzuki toshiya - - gxvalid: Guarantee `trak' table size upto 32-bit. - - * src/gxvalid/gxvtrak.c (gxv_trak_validate): - The type of `offset' is changed from FT_UInt to - FT_Offset, for 16-bit platforms. - -2009-07-31 suzuki toshiya - - type1: Fix a data type mismatching with its source. - - * include/freetype/internal/t1types.h: The type of - T1_Face->buildchar is matched with T1_Decorder->top. - -2009-07-31 suzuki toshiya - - pfr: Fix a data type mismatching with its source. - - * src/pfr/pfrtypes.h: The type of PFR_KernItem->offset - is extended from FT_UInt32 to FT_Offset, because it is - calculated with the pointer difference, in - pfr_extra_item_load_kerning_pairs(). - -2009-07-31 suzuki toshiya - - pfr: Fix a data type mismatching with its source. - - * src/pfr/pfrtypes.h: The type of PFR_PhysFont->chars_offset - is extended from FT_UInt32 to FT_Offset, because it is - calculated with the pointer difference in pfr_phy_font_load(). - -2009-07-31 suzuki toshiya - - pfr: Fix a data type mismatching with its source. - - * src/pfr/pfrtypes.h: The type of PFR_PhyFont->bct_offset - is extended from FT_UInt32 to FT_Long, because it is - loaded by FT_STREAM_POS() in pfr_phy_font_load(). - -2009-07-31 suzuki toshiya - - smooth: Improve the format in debug message. - - * src/smooth/ftgrays.c (gray_dump_cells): Improve the - format specifications to dump variables. - -2009-07-31 suzuki toshiya - - sfnt: Fix a data type mismatching with its source. - - * src/sfnt/sfobjs.c (sfnt_load_face): The type of - local `flags' is matched with FT_Face->face_flags. - -2009-07-31 suzuki toshiya - - psaux: Fix a data type mismatching with its source. - - * include/freetype/internal/psaux.h: The type of - T1_DecorderRec.buildchar is matched with - T1_DecorderRec.top. - -2009-07-31 suzuki toshiya - - truetype: Extend TrueType GX packed deltas to FT_Offset. - - * src/truetype/ttgxvar.c (ft_var_readpackeddeltas): - The type of 2nd argument `delta_cnt' is changed from - FT_Int to FT_Offset, because its source can be cvt - table size calculated from stream position. - -2009-07-31 suzuki toshiya - - truetype: Extend mmvar_len to hold size_t values. - - * src/truetype/ttgxvar.h: The type of - GX_BlendRec.mmvar_len is changed from FT_Int to - FT_Offset, because TT_Get_MM_Var() calculates it - by sizeof() results. - -2009-07-31 suzuki toshiya - - truetype: Check invalid function number in IDEF instruction. - - * src/truetype/ttinterp.c (Ins_IDEF): Check - if the operand fits to 8-bit opcode limitation. - -2009-07-31 suzuki toshiya - - truetype: Check invalid function number in FDEF instruction. - - * src/truetype/ttinterp.c (Ins_FDEF): Check - if the operand fits 16-bit function number. - -2009-07-31 suzuki toshiya - - truetype: Truncate the deltas of composite glyph at 16-bit values. - - * src/truetype/ttgload.c (load_truetype_glyph): - Insert cast from FT_Long (deltas[i].{x,y}) to - FT_Int16 in the summation of deltas[] for composite - glyphs. Because deltas[i] is typed as FT_Pos, - its component x, y are typed as FT_Long, but - their sources are always FT_Int16 when they are - loaded by ft_var_readpackeddeltas(). However, - the limitation about the summed deltas is unclear. - -2009-07-31 suzuki toshiya - - truetype: Truncate the instructions upto 16-bit per a glyph. - - * src/truetype/ttgload.c (TT_Hint_Glyph): Truncate - the instructions upto 16-bit length per a glyph. - -2009-07-31 suzuki toshiya - - truetype: Cast the numerical operands to 32-bit for LP64 systems. - - * src/truetype/ttinterp.c (Ins_SPHIX, INS_MIAP, - Ins_MIRP): Insert cast from long (args[], the - operands passed to TrueType operator) to FT_Int32 - (the argument of TT_MulFix14()). - -2009-07-31 suzuki toshiya - - truetype: Cast the project vector to 32-bit for LP64 system. - - * src/truetype/ttinterp.c (Project, DualProject): - Insert casts from FT_Pos (the arguments `dx', `dy') - to FT_UInt32 (the argument to TT_DotFix14()). - -2009-07-31 suzuki toshiya - - truetype: Cast the scaling params to 32-bit for LP64 system. - - * src/truetype/ttgload.c (TT_Process_Composite_Component): - Insert casts from long (return value of FT_MulFix()) to - FT_Int32 (the argument to FT_SqrtFixed()). - -2009-07-31 suzuki toshiya - - sfnt: Cast a character code to FT_UInt32 for LP64 system. - - * src/sfnt/ttcmap.c (tt_cmap14_char_map_nondef_binary, - tt_cmap14_variants, tt_cmap14_char_variants, - tt_cmap14_def_char_count, tt_cmap14_get_def_chars, - tt_cmap14_get_nondef_chars, tt_cmap14_variant_chars) - Insert casts when FT_UInt32 variable is loaded by - TT_NEXT_{UINT24|ULONG}. Because most of them are - compared with FT_UInt32 values in public API, replacing - FT_UFast is not recommended. - -2009-07-31 suzuki toshiya - - sfnt: Cast a character code to FT_UInt32 for LP64 system. - - * src/sfnt/ttcmap.c (tt_cmap4_init, tt_cmap4_next): - Insert the casts from unsigned long constant to - FT_UInt32. - -2009-07-31 suzuki toshiya - - sfnt: Extend TT_BDF->strings_size to FT_ULong for huge BDF. - - * include/freetype/internal/tttypes.h: The type - of TT_BDF->string_size is extended from FT_UInt32 - to FT_ULong, because BDF specification does not - restrict the length of string. - * src/sfnt/ttbdf.c: The scratch variable `strings' - to load TT_BDF->string_size is matched with - TT_BDF->string_size. - -2009-07-31 suzuki toshiya - - psaux: Handle the string length by FT_Offset variables. - - * src/psaux/afmparse.c (afm_parser_next_key, - afm_tokenize, afm_parse_track_kern, - afm_parse_kern_pairs, afm_parse_kern_data, - afm_parser_skip_section, afm_parser_parse): - The length of key is handled by FT_Offset, - instead of FT_UInt. Although the length of - PostScript strings or name object is 16-bit, - AFM_STREAM_KEY_LEN() calculates the length - from the pointer difference. - - * src/psaux/afmparse.h (afm_parser_next_key): - Ditto. - -2009-07-31 suzuki toshiya - - pcf: Fix some data types mismatching with their sources. - - * src/pcf/pcfread.c (pcf_get_bitmaps): The types - of `nbitmaps', `i', `sizebitmaps' are matched with - the type of area FT_Bitmap.pitch * FT_Bitmap.rows. - -2009-07-31 suzuki toshiya - - pcf: Handle the string length by size_t variables. - - * src/pcf/pcfread.c (pcf_interpret_style): The types - of nn, len, lengths[4] are changed to size_t, because - they are loaded by (or compared with) ft_strlen(). - - * src/pcf/pcfutil.c (BitOrderInvert, TwoByteSwap, - FourByteSwap): The type of the 2nd argument `nbytes' - is changed to size_t, for similarity with ANSI C - string functions. - - * src/pcf/pcfdrivr.c (PCF_Glyph_Load): The type of - `bytes' is changed to FT_Offset, because it is passed - to FT_ALLOC(), via ft_glyphslot_alloc_bitmap(). At - least, using unsigned type is better. - -2009-07-31 suzuki toshiya - - pcf: Fix some data types mismatching with their sources. - - * src/pcf/pcfread.c (pcf_seek_to_table_type, - pcf_has_table_type): The type of 3rd argument - `ntables' is matched with PCF_Toc->count. - -2009-07-31 suzuki toshiya - - otvalid: Truncate the glyph index to 16-bit. - - * src/otvalid/otvalid.c (otv_validate): Checks - face->num_glyphs does not exceed 16-bit limit, - pass FT_UInt num_glyphs to backend functions - otv_{GPOS|GSUB|GDEF|JSTF|MATH}_validate(). - -2009-07-31 suzuki toshiya - - cache: Insert explict casts for LP64 systems. - - * src/cache/ftcbasic.c (FTC_ImageCache_Lookup, - FTC_SBitCache_Lookup): The type of FTC_ImageType->width - is FT_Int, so the cast to unsigned larger type FT_ULong - is introduced for the comparisons with 0x10000L for - LP64 platform. - -2009-07-31 suzuki toshiya - - cache: Fix some data types mismatching with their sources. - - * src/cache/ftccache.h: The type of return value - by FTC_Node_WeightFunc function is changed to - FT_Offset. The type of FTC_CacheClass->cache_size - is changed to FT_Offset, too. - - * src/cache/ftccback.h (ft_inode_weight, - ftc_snode_weight): Ditto. - - * src/cache/ftccmap.c (ftc_cmap_node_weight): Ditto. - - * src/cache/ftcimage.c (ftc_inode_weight, - FTC_INode_Weight): Ditto. - - * src/cache/ftcsbits.c (ftc_snode_weight, - FTC_SNode_Weight): Ditto. - - * src/cache/ftcmru.h: The type of - FTC_MruListClass->node_size is changed to FT_Offset, - because it is passed to FT_ALLOC() to specify the - size of buffer. - -2009-07-31 suzuki toshiya - - XXX_cmap_encoding_char_next() return FT_UInt32 values. - - * include/freetype/internal/services/svpscmap.h: - The size of the charcode value returned by - the function typed PS_Unicodes_CharNextFunc is - matched with its input charcode value. - - * src/cff/cffmap.c (cff_cmap_encoding_char_next, - cff_cmap_unicode_char_next): Ditto. - - * src/pfr/pfrmap.c (pfr_cmap_encoding_char_next): - Ditto. - - * src/psaux/t1cmap.c (t1_cmap_std_char_next, - t1_cmap_custom_char_next, t1_cmap_unicode_char_next): - Ditto. - - * src/psnames/psmodule.c (ps_unicodes_char_next): - Ditto. - - * src/winfonts/winfnt.c (fnt_cmap_char_next): - Ditto. - - * src/sfnt/ttcmap.c (tt_cmap0_char_next, - tt_cmap2_char_next, tt_cmap4_char_next, - tt_cmap6_char_next, tt_cmap10_char_next, - tt_cmap12_char_next, tt_cmap13_char_next): Ditto. - (tt_cmap14_char_variants): Handle base unicode - codepoint by FT_UInt32 variable to avoid overflow - on 16-bit platforms. - (tt_cmap14_ensure): The type of `num_results' is - extend to FT_UInt32, to cover unsigned 32-bit - `numVarSelectorRecords' in cmap14 table header. - -2009-07-31 suzuki toshiya - - truetype: Extend TT_Face->num_locations for broken TTFs. - - * include/freetype/internal/tttypes.h: - TT_Face->num_locations are extended from FT_UInt - to FT_ULong, to stand with broken huge loca table. - Some people insists there are broken TTF including - the glyphs over 16-bit limitation, in PRC market. - * src/truetype/ttpload.c (tt_face_load_loca): - Remove unrequired 16-bit truncation for FT_UInt - TT_Face->num_locations. - -2009-07-31 suzuki toshiya - - smooth: Fix some data types mismatching with their sources. - - * src/smooth/ftgrays.c: The type of `TCoord' is - matched to `TPos', because they are mixed in - gray_set_cell(). The type of TCell->x is extended - to `TPos', because gray_find_cell() sets it by - TWorker.ex. The type of TCell->cover is extended - to `TCoord', because gray_render_scanline() adds - TCoord value to it. The type of TWork.cover is matched - with TCell->cover. The types of - TWork.{max_cells,num_cells} are changed to FT_PtrDist, - because they are calculated from the memory addresses. - The type of TWork.ycount is changed to TPos, because - it is calculated from TPos variables. - (gray_find_cell): The type of `x' is matched with - its initial value ras.ex. - (gray_render_scanline): The types of `mod', `lift' - and `rem' are changed to TCoord, because their values - are set with explicit casts to TCoord. When ras.area - is updated by the differential values including - `delta', they are explicitly cast to TArea, because - the type of `delta' is not TArea but TCoord. - (gray_render_line): The type of `mod' is extended - from int to TCoord, because (TCoord)dy is added to mod. - (gray_hline): The argument `acount' is extended to - TCoord, to match with the parameters in the callers. - -2009-07-31 suzuki toshiya - - cff: Fix some data types mismatching with their sources. - - * src/cff/cffobjs.c (cff_face_init): The type of - `scaling' is matched with the scaling parameter - in FT_Matrix_Multiply_Scaled() and - FT_Vector_Transform_Scaled(). - - * src/cff/cffparse.c (cff_parse_real): The type of - `power_ten', `scaling', `exponent_add', - `integer_length', `fraction_length', - `new_fraction_length' and `shift' are matched with - the type of `exponent' to avoid unexpected truncation. - (cff_parse_fixed_scaled): The type of `scaling' is - matched with the `scaling' argument to - cff_parse_real(). - (cff_parse_fixed_dynamic): Ditto. - (cff_parse_font_matrix): The type of `scaling' is - matched with the `scaling' argument to - cff_parse_dynamic(). - -2009-07-31 suzuki toshiya - - autofit: Fix some data types mismatching with their sources. - - * src/autofit/afglobal.c: Correct the type of - AF_FaceGlobalsRec.glyph_count to match with - FT_Face->num_glyphs. - (af_face_globals_compute_script_coverage): - Insert explicit cast to compare - FT_Long AF_FaceGlobalsRec.glyph_count versus - FT_UInt gindex. The type of `nn' is changed - to scan glyph index upto AF_FaceGlobalsRec.glyph_count. - (af_face_globals_get_metrics): The type of `script_max' - is changed to cover size_t value. Insert explicit cast - to compare FT_Long AF_FaceGlobalsRec.glyph_count versus - FT_UInt gindex. - - * src/autofit/afhints.c (af_axis_hints_new_segment): - Insert explicit cast to calculate `big_max' from - integer and size_t values. - (af_axis_hints_new_edge): Ditto. - - * src/autofit/aflatin.c (af_latin_metrics_init_blues): - The type of `best_y' is matched to FT_Vector.y. - (af_latin_compute_stem_width): The type of `delta' is - matched to `dist' and `org_dist'. - -2009-07-31 suzuki toshiya - - autofit: Count the size of the memory object by ptrdiff_t. - - * src/autofit/afcjk.c (af_cjk_hint_edges): The - number of edges `n_edges' should be counted by - FT_PtrDist variable instead of FT_Int. - - * src/autofit/aflatin.c (af_latin_hint_edges): - Ditto. - - * src/autofit/aftypes.h: In AF_ScriptClassRec, - the size of metric `script_metrics_size' should - be counted by FT_Offset variable instead of FT_UInt. - - * src/autofit/afhints.c - (af_glyph_hints_align_strong_points): The cursors - for the edges `min', `max', `mid' in the memory - buffer should be typed FT_PtrDist. - -2009-07-31 suzuki toshiya - - autofit: Fix for unused variable `first'. - - * src/autofit/afhints.c (af_glyph_hints_reload): Insert - FT_UNUSED() to hide the unused variable warning. - -2009-07-31 suzuki toshiya - - Improve bitmap size or pixel variables for 16-bit systems. - - * include/freetype/config/ftstdlib.h: Introduce - FT_INT_MIN, to use in signed integer overflow in - 16-bit and 64-bit platforms. - - * include/freetype/internal/fttrace.h: Add a tracer - to ftsynth.c. - - * src/base/ftbitmap.c (FT_Bitmap_Embolden): Check - invalid strength causing integer overflow on 16-bit - platform. - - * src/base/ftcalc.c (ft_corner_orientation): Change - the internal calculation from FT_Int to FT_Long, to - avoid an overflow on 16-bit platforms. The caller of - this function should use only the sign of result, - so the cast to FT_Int is acceptable. - - * src/base/ftsynth.c: Introduce a tracer for synth module. - (FT_GlyphSlot_Embolden): Check invalid strength causing - integer overflow on 16-bit platform. - - * src/bdf/bdfdrivr.c (BDF_Face_Init): The glyph index - in FT2 API is typed as FT_UInt, although BDF driver - can handle unsigned long glyph index internally. To - avoid integer overflow on 16-bit platform, too large - glyph index should be excluded. - (BDF_Glyph_Load): The glyph pitch in FT2 is typed as - FT_UInt, although BDF driver can handle unsigned long - glyph pitch internally. To avoid integer overflow on - 16-bit platform, too large glyph pitch should not be - returned. - - * src/pfr/pfrsbit.c (pfr_slot_load_bitmap): The glyph - pitch in FT2 is typed as FT_UInt, although PFR font - format can include huge bitmap glyph with 24-bit pitch - (however, a glyph spends 16.7 pixel, it's not realistic). - To avoid integer overflow on 16-bit platform, huge - bitmap glyph should be excluded. - - * src/smooth/ftgrays.c (gray_hline): As FT_Span.x is - truncated to fit its type (16-bit short), FT_Span.y - should be truncated to fit its type (FT_Int). - - * src/cff/cffdrivr.c (cff_get_ros): CFF specification - defines the supplement in ROS as a real number. - Truncate it to fit public FT2 API. - - * src/cff/cffparse.c (cff_parse_cid_ros): Warn the - supplement if it is truncated or rounded in cff_get_ros(). - - * src/cff/cfftypes.h: Change the type of internal variable - `supplement' from FT_Long to FT_ULong to fit the signedness - to the type in public API. - -2009-07-31 suzuki toshiya - - psaux: Prevent invalid arguments to afm_parser_read_vals(). - - * src/psaux/afmparse.c (afm_parser_read_vals): Change - the type of `n' to prevent negative number how many - arguments should be parsed. - - * src/psaux/afmparse.h (afm_parser_read_vals): Ditto. - -2009-07-31 suzuki toshiya - - base: Prevent some overflows on LP64 systems. - - * src/base/ftadvance.c (FT_Get_Advances): Cast the - unsigned long constant FT_LOAD_ADVANCE_ONLY to FT_UInt32 - for LP64 platforms. - - * src/base/ftcalc.c (FT_Sqrt32): All internal variables - are changed to FT_UInt32 from FT_ULong. - (FT_MulDiv): Insert casts to FT_Int32 for LP64 platforms. - This function is designed for 32-bit integer, although - their arguments and return value are FT_Long. - - * src/base/ftobjs.c (FT_Get_Char_Index): Check `charcode' - is within unsigned 32-bit integer for LP64 platforms. - (FT_Face_GetCharVariantIndex): Check `charcode' and - `variantSelector' are within 32-bit integer for LP64 - platforms. - (FT_Face_GetCharsOfVariant): Check `variantSelector' is - within unsigned 32-bit integer for LP64 platforms. - - * src/base/fttrigon.c (ft_trig_downscale): The FT_Fixed - variable `val' and unsigned long constant FT_TRIG_SCALE - are cast to FT_UInt32, when calculates FT_UInt32. - (FT_Vector_Rotate): The long constant 1L is cast to - FT_Int32 to calculate FT_Int32 `half'. - -2009-07-31 suzuki toshiya - - cff: Cast the long variables to 32-bit for LP64 systems. - - * src/cff/cffdrivr.c (cff_get_advances): Insert - explicit cast to modify a 32-bit flag by unsigned - long constant. - - * src/cff/cffobjs.c (cff_face_init): Ditto. - - * src/cff/cffgload.c (cff_decoder_parse_charstrings): - Replace the casts to FT_Long by the casts to FT_Int32 - for LP64 platforms. - -2009-07-31 suzuki toshiya - - pcf: Improve PCF_PropertyRec.value names on LP64 platforms. - - * src/pcf/pcf.h: In PCF_PropertyRec.value, the member - `integer' is replaced by `l', `cardinal' is replaced - by `ul', to fix the difference between the name and - the types on LP64 platforms. - - * src/pcf/pcfdrivr.c (pcf_get_bdf_property): Reflect - PCF_PropertyRec.value change, with appropriate casts - to FT_Int32/FT_UInt32. Their destinations - BDF_PropertyRec.{integer|cardinal} are public and - explicitly defined as FT_Int32/FT_UInt32. - - * src/pcf/pcfread.c (pcf_get_properties, pcf_load_font): - Reflect PCF_PropertyRec.value change. - -2009-07-31 suzuki toshiya - - pcf: Fix some data types mismatching with their sources. - - * src/pcf/pcfdrivr.c (pcf_cmap_char_index): The type of - `code' is matched to PCF_Encoding->enc. - (pcf_cmap_char_next): The type of `charcode' is matched - to PCF_Encoding->enc. When *acharcode is set by charcode, - an overflow is checked and cast to unsigned 32-bit - integer. - -2009-07-31 suzuki toshiya - - bdf: Improve bdf_property_t.value names for LP64 platforms. - - * src/bdf/bdf.h: In bdf_property_t.value, the member - `int32' is replaced by `l', `card32' is replaced by - `ul', to fix the difference between the name and the - types on LP64 platforms. - - * src/bdf/bdfdrivr.c (BDF_Face_Init): Reflect - bdf_property_t.value change. - (bdf_get_bdf_property): Reflect bdf_property_t.value - change, with appropriate casts to FT_Int32/FT_UInt32. - Their destinations BDF_PropertyRec.{integer|cardinal} - are public and explicitly defined as FT_Int32/FT_UInt32. - - * src/bdf/bdflib.c (_bdf_add_property): Reflect - bdf_property_t.value change. - -2009-07-31 suzuki toshiya - - bdf: Fix some data types mismatching with their sources. - - * src/bdf/bdrdrivr.c (bdf_cmap_char_index): The type - of `code' is matched with BDF_encoding_el->enc. - (bdf_cmap_char_next): The type of `charcode' is - matched with BDF_encoding_el->enc. When *acharcode - is set by charcode, an overflow is checked and - cast to unsigned 32-bit integer. - -2009-07-31 suzuki toshiya - - autofit: Improve Unicode range definitions. - - * src/autofit/aftypes.h (AF_UNIRANGE_REC): New macro - to declare a range by two unsigned 32-bit integer, - to avoid 64-bit range definition on LP64 platforms. - - * src/autofit/aflatin.c (af_latin_uniranges): Ditto. - - * src/autofit/aflatin2.c (af_latin2_uniranges): Ditto. - - * src/autofit/afindic.c (af_indic_uniranges): Ditto. - - * src/autofit/afcjk.c (af_cjk_uniranges): Declare - the ranges by AF_UNIRANGE_REC. - -2009-07-31 suzuki toshiya - - smooth: Fix a data type mismatching with its source. - - * src/smooth/ftgrays.c (gray_sweep): The type of - `area' is matched with the 3rd argument `area' - of gray_hline(). - -2009-07-31 suzuki toshiya - - smooth: Fix a data type mismatching with its source. - - * src/smooth/ftgrays.c (gray_render_line): The type - of `area' is matched with TWorker.area. - -2009-07-31 suzuki toshiya - - cache: Disable the legacy compatibility if 16-bit system. - - * src/cache/ftcbasic.c (FTC_ImageCache_Lookup): Exclude - the legacy behaviour from 16-bit platform, because the - current hack cannot detect the caller uses this function - via legacy convension. - (FTC_SBitCache_Lookup): Ditto. - -2009-07-31 suzuki toshiya - - cache: Check 32-bit glyph index on 16-bit systems. - - * src/cache/ftcbasic.c (ftc_basic_family_get_count): - Check overflow caused by the face including large - number of glyphs > 64k. - -2009-07-31 suzuki toshiya - - cache: Fix some data types mismatching with their sources. - - * src/cache/ftccache.c (ftc_cache_resize): The types of - `p', `mask', `count' are matched with FTC_Cache->{p,mask}. - (FTC_Cache_Clear): The type of `old_index' is matched to - FTC_Cache->{p,mask}. - - * src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP): The type - of `_idx' is matched with FTC_Cache->{p,mask}. - -2009-07-31 suzuki toshiya - - cache: Fix some data types mismatching with their sources. - - * src/cache/ftcsbits.c (ftc_snode_load): The types - of `xadvance' and `yadvance' are matched with - FT_GlyphSlot->advance.{x|y}. - -2009-07-31 suzuki toshiya - - cache: Cast NULL to a required function type explicitly. - - * src/cache/ftcmanag.c (FTC_Manager_RemoveFaceID): - Insert explicit cast from NULL to function type. - -2009-07-31 suzuki toshiya - - fttypes.h: Cast FT_MAKE_TAG output to FT_Tag exlicitly. - - * include/freetype/fttypes.h (FT_MAKE_TAG): - Cast the result to FT_Tag. - -2009-07-31 suzuki toshiya - - psnames: Handle Unicode codepoints by FT_UInt32 variables. - - * src/psnames/psmodule.c (BASE_GLYPH): Cast the result - to unsigned 32-bit integer for LP64 platform. - (ps_unicode_value): Return the value by unsigned 32-bit - integer instead of unsigned long. - -2009-07-31 suzuki toshiya - - psaux: Use size_t variable to pass the buffer size. - - * src/psaux/psaux.h (to_bytes): The type of `max_bytes' - (the argument to pass the buffer size) is changed to - size_t, to match with ANSI C string functions. - - * src/psaux/psconv.h (PS_Conv_StringDecode, - PS_Conv_ASCIIHexDecode, PS_Conv_EexecDecode): Ditto. - - * src/psaux/psconv.c (PS_Conv_StringDecode, - PS_Conv_ASCIIHexDecode, PS_Conv_EexecDecode): Ditto. - - * src/psaux/psobjs.h (ps_parser_to_bytes): Ditto. - - * src/psaux/psobjs.c (ps_parser_to_bytes): Ditto. - -2009-07-31 suzuki toshiya - - type1: Use size_t variable to pass the string length. - - * psaux.h: The type of `len' (the argument to pass - the buffer size to the function in AFM_ParserRec) - is changed to size_t, to match with ANSI C string - functions. - - * t1afm.c (t1_get_index): Ditto. - - * test_afm.c (dummy_get_index): Ditto. - - * afmparse.c (afm_parser_read_vals): To call - AFM_ParserRec.get_index, the length of token - `len' is cast to size_t. - -2009-07-31 suzuki toshiya - - cid: Fix some data types mismatching with their sources. - - * src/cid/cidparse.c (cid_parser_new): The types of - `read_len' and `stream_len' are matched to - FT_Stream->size. Unrequired cast is removed. - -2009-07-31 suzuki toshiya - - cff: Fix for unused variable `rest'. - - * src/cff/cffparse.c (cff_parse_real): Insert - FT_UNUSED() to hide the unused variable warning. - -2009-07-31 suzuki toshiya - - cff: Fix some data types mismatching with their sources. - - * src/cff/cffgload.c (cff_slot_load): The types of - `top_upm' and `sub_upm' are matched with - CFF_FontRecDict->units_per_em. - - * src/cff/cffobjs.c (cff_size_select): Ditto. - (cff_size_request): Ditto. - -2009-07-31 suzuki toshiya - - bdf: Fix some data types mismatching with their sources. - - * bdflib.c (_bdf_list_ensure): The type of `num_items' - is matched with _bdf_list_t.used. Also the types of - `oldsize', `newsize', `bigsize' are matched too. - (_bdf_readstream): `cursor' is used as an offset to - the pointer, it should be typed as FT_Offset. Also - the types of `bytes', `start', `end', `avail' are matched. - - * bdfdrivr.c: The type of BDF_CMap->num_encodings is - matched with FT_CMap->clazz->size. - (bdf_cmap_char_index): The types of `min', `max', `mid' - are matched with BDF_CMap->num_encodings. The type of - `result' is matched with encoding->glyph. - (bdf_cmap_char_next): Ditto, the type of `code' is - matched with BDF_encoding_el.enc. - (bdf_interpret_style): The type of `lengths' is changed - to size_t, to take the value by ft_strlen(). Also the - types of `len', `nn', `mm' are matched. - -2009-07-31 suzuki toshiya - - sfnt: Count the size of the memory object by ptrdiff_t. - - * src/sfnt/ttbdf.c (tt_face_find_bdf_prop): The type of - `peroperty_len' is changed from FT_UInt to FT_Offset, - to match with size_t, which is appropriate type for the - object in the memory buffer. - -2009-07-31 suzuki toshiya - - lzw: Count the size of the memory object by ptrdiff_t. - - * src/lzw/ftzopen.h: The types of FT_LzwState->{buf_total, - stack_size} are changed from FT_UInt to FT_Offset, to match - with size_t, which is appropriate type for the object in - the memory buffer. - - * src/lzw/ftzopen.c (ft_lzwstate_stack_grow): The types of - `old_size' and `new_size' are changed from FT_UInt to - FT_Offset, to match with size_t, which is appropriate type - for the object in the memory buffer. - -2009-07-31 suzuki toshiya - - otvalid: Count the table size on memory by ptrdiff_t. - - * src/otvalid/otvgpos.c (otv_ValueRecord_validate): - Change the type of table size from FT_UInt to - FT_PtrDist because it is calculated by the memory - addresses. - -2009-07-31 suzuki toshiya - - otvalid: Prevent an overflow by GPOS/GSUB 32b-bit offset. - - * src/otvalid/otvgpos.c (otv_ExtensionPos_validate): - Extend ExtensionOffset from FT_UInt to FT_ULong, to - cover 32-bit offset on 16-bit platform. - - * src/otvalid/otvgsub.c (otv_ExtensionSubst_validate): - Ditto. - -2009-07-31 suzuki toshiya - - ftobjs.c: Prevent an overflow in glyph index handling. - - * src/base/ftobjs.c (FT_Face_GetCharsOfVariant): - Improve the cast in comparison to avoid the truncation. - -2009-07-31 suzuki toshiya - - Improve the variable types in raccess_make_file_name(). - - * src/base/ftrfork.c (raccess_make_file_name): - Change the type of cursor variable `tmp' to const char*, - to prevent the unexpected modification of original pathname. - (raccess_make_file_name): Change the type of new_length - to size_t. - -2009-07-31 suzuki toshiya - - ftpatent.c: Fix for unused variable `error'. - - * src/base/ftpatent.c (_tt_check_patents_in_range): - Fix warning for unused variable `error'. - -2009-07-31 suzuki toshiya - - type1: Check invalid string longer than PostScript limit. - - * src/type1/t1afm.c (t1_get_index): Check invalid string - which exceeds the limit of PostScript string/name objects. - -2009-07-31 suzuki toshiya - - gzip: Use FT2 zcalloc() & zfree() in ftgzip.c by default. - - * src/gzip/ftgzip.c (zcalloc, zcfree): Disable all - zcalloc() & zfree() by zlib in zutil.c, those in - ftgzip.c by FT2 are enabled by default. To use - zlib zcalloc() & zfree(), define USE_ZLIB_ZCALLOC. - See discussion: - http://lists.gnu.org/archive/html/freetype-devel/2009-02/msg00000.html - -2009-07-31 suzuki toshiya - - gzip: Distinguish PureC from TurboC on MSDOS. - - * src/gzip/zutil.c (zcalloc, zcfree): Enable only for - MSDOS platform. - -2009-07-31 suzuki toshiya - - gxvalid: Insert PureC pragma to allow unevaluated variables. - - * builds/atari/ATARI.H: Insert PureC pragma not to - warn against set-but-unevaluated variable in gxvalid - module. - -2009-07-31 suzuki toshiya - - gxvalid: Pass the union by the pointer instead of the value. - - * src/gxvalid/gxvcommn.h: - - Declare new type `GXV_LookupValueCPtr'. - - Update the type of the 2nd argument to pass GXV_LookupValueDesc - data to the function prototyped as GXV_Lookup_Value_Validate_Func, - from GXV_LookupValueDesc to GXV_LookupValueCPtr. - - Likewise for the function prototyped as - GXV_Lookup_Fmt4_Transit_Func. - - - Declare new type `GXV_StateTable_GlyphOffsetCPtr'. - - Update the type of the 3rd argument to pass - GXV_StateTable_GlyphOffsetDesc data to the function prototyped - as GXV_StateTable_Entry_Validate_Func, from - GXV_StateTable_GlyphOffsetDesc to GXV_StateTable_GlyphOffsetCPtr. - - - Declare new type `GXV_XStateTable_GlyphOffsetCPtr'. - - Update the type of the 3rd argument to pass - GXV_XStateTable_GlyphOffsetDesc data to the function prototyped - as GXV_XStateTable_Entry_Validate_Func, - from GXV_XStateTable_GlyphOffsetDesc - to GXV_XStateTable_GlyphOffsetCPtr. - - * src/gxvalid/gxvcommn.c (gxv_LookupTable_fmt0_validate, - gxv_XClassTable_lookupval_validate, - gxv_XClassTable_lookupfmt4_transit): - Update from GXV_LookupValueDesc to GXV_LookupValueCPtr. - - * src/gxvalid/gxvbsln.c (gxv_bsln_LookupValue_validate, - gxv_bsln_LookupFmt4_transit): Ditto. - - * src/gxvalid/gxvjust.c - (gxv_just_pcTable_LookupValue_entry_validate, - gxv_just_classTable_entry_validate, - gxv_just_wdcTable_LookupValue_validate): Ditto. - - * src/gxvalid/gxvkern.c - (gxv_kern_subtable_fmt1_entry_validate): Ditto. - - * src/gxvalid/gxvlcar.c (gxv_lcar_LookupValue_validate, - gxv_lcar_LookupFmt4_transit): Ditto. - - * src/gxvalid/gxvopbd.c (gxv_opbd_LookupValue_validate, - gxv_opbd_LookupFmt4_transit): Ditto. - - * src/gxvalid/gxvprop.c (gxv_prop_LookupValue_validate, - gxv_prop_LookupFmt4_transit): Ditto. - - * src/gxvalid/gxvmort4.c - (gxv_mort_subtable_type4_lookupval_validate): Ditto. - - * src/gxvalid/gxvmort0.c - (gxv_mort_subtable_type0_entry_validate): Update - from GXV_StateTable_GlyphOffsetDesc - to GXV_StateTable_GlyphOffsetCPtr. - - * src/gxvalid/gxvmort1.c - (gxv_mort_subtable_type1_entry_validate): Ditto. - - * src/gxvalid/gxvmort2.c - (gxv_mort_subtable_type2_entry_validate): Ditto. - - * src/gxvalid/gxvmort5.c - (gxv_mort_subtable_type5_entry_validate): Ditto. - - * src/gxvalid/gxvmorx2.c - (gxv_morx_subtable_type2_entry_validate): Ditto. - - * src/gxvalid/gxvmorx5.c - (gxv_morx_subtable_type5_entry_validate): Ditto. - - * src/gxvalid/gxvmorx1.c - (gxv_morx_subtable_type1_entry_validate): Ditto. - (gxv_morx_subtable_type1_LookupValue_validate, - gxv_morx_subtable_type1_LookupFmt4_transit): - Update from GXV_LookupValueDesc to GXV_LookupValueCPtr. - - * src/gxvalid/gxvmorx0.c - (gxv_morx_subtable_type0_entry_validate): Update - from GXV_XStateTable_GlyphOffsetDesc - to GXV_XStateTable_GlyphOffsetCPtr. - -2009-07-29 Fabrice Bellet - - Fix Redhat bugzilla #513582 and Savannah bug #26849. - - * src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP) : Fix - aliasing bug. - -2009-07-19 Werner Lemberg - - Document recent library changes. - - * docs/CHANGES: Do it. - -2009-07-17 Werner Lemberg - - Fix Savannah bug #23786. - - * src/truetype/ttobjs.c (tt_size_init_bytecode): Don't reset x_ppem - and y_ppem. Otherwise the `*_CVT_Stretched' functions in ttinterp.c - get never called. - An anonymous guy suggested this change on Savannah, and it seems to - be the right solution. - -2009-07-15 Werner Lemberg - - * docs/release: Updated. - -2009-07-15 Werner Lemberg - - README.CVS -> README.git - - * README.CVS: Renamed to... - * README.git: This. - Updated. - -2009-07-15 suzuki toshiya - - Borland C++ compiler patch proposed by Mirco Babin. - http://lists.gnu.org/archive/html/freetype/2009-07/msg00016.html. - - * builds/exports.mk: Delete unused flags, CCexe_{CFLAGS,LDFLAGS}. - Fix APINAMES_C and APINAMES_EXE pathnames to reflect the platform - specific pathname syntax. - * builds/compiler/bcc.mk: Remove unused flag, CCexe_LDFLAGS. - Define TE = `-e' separately (bcc32 cannot specify the pathname of - binary executable by T = `-o'). - Extend the large page size in linking freetype.lib. - Add extra CLEAN target to delete bcc specific temporary files. - * builds/compiler/bcc-dev.mk: Ditto. - -2009-07-14 Werner Lemberg - - Fix Savannah bug #27026. - - * builds/win32/vc2005/freetype.sln: Use correct version number. - -2009-07-12 suzuki toshiya - - Add a script to check the undefined and unused trace macros. - - * src/tools/chktrcmp.py: A script to check trace_XXXX macros - that are used in C source but undefined in fttrace.h, or - defined in fttrace.h but unused in C sources. See - http://lists.gnu.org/archive/html/freetype-devel/2009-07/msg00013.html. - * docs/DEBUG: Mention on chktrcmp.py. - * docs/release: Ditto. - -2009-07-09 Werner Lemberg - - [ftraster] Make it compile again with -D_STANDALONE_. - - * src/raster/ftraster.c [_STANDALONE_]: Define - FT_CONFIG_STANDARD_LIBRARY_H. - Include `string.h'. - Don't include `rastpic.h'. - Define FT_DEFINE_RASTER_FUNCS. - -2009-07-09 suzuki toshiya - - smooth: Check glyph size by width/height, instead of pitch/height. - Suggested by der Mouse . - - * src/smooth/ftsmooth.c (ft_smooth_render_generic): Improve - the check for too large glyph. Replace the pair of `pitch' and - `height' by the pair of `width' and `height'. `pitch' cannot - be greater than `height'. The required is checking the product - `pitch' * `height' <= FT_ULONG_MAX, but we use cheap checks for - the realistic case only. - -2009-07-09 suzuki toshiya - - Register 2 missing trace components, t1afm and ttbdf. - - * include/freetype/internal/fttrace.h: Add FT_TRACE_DEF( t1afm ) - and FT_TRACE_DEF( ttbdf ). See - http://lists.gnu.org/archive/html/freetype-devel/2009-07/msg00013.html - -2009-07-09 suzuki toshiya - - Register a trace component for ftgloadr.c. - - * include/freetype/internal/fttrace.h: Add FT_TRACE_DEF( gloader ). - The macro `trace_gloader' was already used in the initial version - on 2002-02-24. - -2009-07-08 suzuki toshiya - - Prevent the overflows by a glyph with too many points or contours. - The bug is reported by Boris Letocha . See - http://lists.gnu.org/archive/html/freetype-devel/2009-06/msg00031.html - http://lists.gnu.org/archive/html/freetype-devel/2009-07/msg00002.html - - * include/freetype/ftimage.h (FT_OUTLINE_CONTOURS_MAX, - FT_OUTLINE_POINTS_MAX): New macros to declare the maximum - values of FT_Outline.{n_contours,n_points}. - * src/base/ftgloadr.c (FT_GlyphLoader_CheckPoints): Check the - total numbers of points and contours cause no overflows in - FT_Outline.{n_contours,n_points}. - - * include/freetype/internal/ftgloadr.h (FT_GLYPHLOADER_CHECK_P, - FT_GLYPHLOADER_CHECK_C): Compare the numbers of points and - contours as unsigned long number, instead of signed int, to - prevent the overflows on 16-bit systems. - -2009-07-05 Bram Tassyns - - Improve compatibility to Acroread. - This fixes Savannah bug #26944. - - * src/cff/cffload.c (cff_charset_compute_cids): For multiple GID to - single CID mappings, make the lowest value win. - -2009-06-28 suzuki toshiya - - ftpatent: Fix a bug by wrong usage of service->table_info(). - http://lists.gnu.org/archive/html/freetype-devel/2008-12/msg00039.html - - * include/freetype/internal/services/svsfnt.h: Extend - FT_SFNT_TableInfoFunc() to take new argument to obtain the offset - to the specified table. - * src/sfnt/sfdriver.c (sfnt_table_info): Extend to return the - table-offset to the caller function. - * src/base/ftpatent.c (_tt_check_patents_in_table): Use new - service->table_info(). - * src/base/ftobjs.c (FT_Sfnt_Table_Info): Synchronize to new - service->table_info(). - -2009-06-28 Werner Lemberg - - [psaux, cff] Protect against nested `seac' calls. - - * include/freetype/internal/psaux.h (T1_Decoder), src/cff/cffgload.h - (CFF_Decoder): Add `seac' boolean variable. - - * src/cff/cffgload.c (cff_operator_seac), src/psaux/t1decode.c - (t1operator_seac): Use it. - -2009-06-28 Werner Lemberg - - Thinko. - - * src/psaux/t1decode.c (t1operator_seac) - [FT_CONFIG_OPTION_INCREMENTAL]: Test for existence of incremental - interface. - -2009-06-28 Werner Lemberg - - * devel/ftoption.h [FT_CONFIG_OPTION_INCREMENTAL]: Define. - -2009-06-27 suzuki toshiya - - Add tools to preprocess the source files for AtariST PureC. - - * builds/atari/deflinejoiner.awk: New file to filter C source files - for broken C preprocessor of PureC compiler. - - * builds/atari/gen-purec-patch.sh: New file to generate a patch set - for PureC, by using deflinejoiner.awk. - -2009-06-27 suzuki toshiya - - Keep existing modules.cfg in the building tree. - - * configure: If `configure' is executed outside of the source tree, - an existing `modules.cfg' file in the build directory should be - kept, not overwritten by the version in the source tree. - -2009-06-27 suzuki toshiya - - Filter --srcdir= option before invoking builds/unix/configure. - - * configure: If builds/unix/configure is invoked with --srcdir - option, the option should take `builds/unix' directory instead of - the top source directory. Thus the configure script in the top - directory should modify the --srcdir= option if - `builds/unix/configure' is invoked. - -2009-06-27 suzuki toshiya - - Improve configure.raw for cross-building on exe-suffixed systems. - - * builds/unix/configure.raw: Fix a bug in sed script to extract - native suffix for binary executables, patch by Peter Breitenlohner. - http://lists.gnu.org/archive/html/freetype-devel/2009-04/msg00036.html - -2009-06-26 Werner Lemberg - - [truetype] Remove TT_SubGlyphRec. - - * src/truetype/ttobjs.h (TT_SubGlyphRec): Removed, unused. - -2009-06-26 Werner Lemberg - - * */*: For warning messages, replace FT_ERROR with FT_TRACE0. - - FT_ERROR is now used only if a function produces a non-zero `error' - value. - - Formatting, improving and harmonizing debug strings. - -2009-06-25 Werner Lemberg - - Provide version information better. - - * src/base/ftinit.c (FT_Init_FreeType): Don't set version here - but... - * src/base/ftobjs.c (FT_New_Library): Here. - -2009-06-22 Werner Lemberg - - Use 16.16 format while parsing Type 1 charstrings. - This fixes Savannah bug #26867. - - Previously, only integers have been used which can lead to serious - rounding errors. - - However, fractional values are only used internally; after the - charstrings (of either Type 1 or 2) have been processed, the - resulting coordinates get rounded to integers currently -- before - applying scaling. This should be fixed; at the same time a new load - flag should be introduced, to be used in combination with - FT_LOAD_NO_SCALE, which indicates that font units are returned in - 16.16 format. Similarly, the incremental interface should be - extended to allow fractional values for metrics. - - * include/freetype/internal/psaux.h (T1_BuilderRec): Remove `shift' - field. - * include/freetype/internal/pshints.h (T1_Hints_SetStemFunc, - T1_Hints_SetStem3Func): Use FT_Fixed for coordinates. - - * src/psaux/psobjs.c: Include FT_INTERNAL_CALC_H. - (t1_build_add_point): Always convert fixed to integer. - * src/psaux/t1decode.c (t1_decoder_parse_charstrings): - Use 16.16 format everywhere (except for large integers followed by a - `div'). - [CAN_HANDLE_NON_INTEGRAL_T1_OPERANDS]: Remove #ifdef and activate - code uncoditionally. - Add support for random numbers and update remaining code - accordingly; this should work now. - (t1_operator_seac): Updated. - * src/psaux/pshrec.c: Include FT_INTERNAL_CALC_H. - (ps_hints_t1stem3, t1_hints_stem): Updated. - - * src/cid/cidgload.c: Include FT_INTERNAL_CALC_H. - (cid_load_glyph) [FT_CONFIG_OPTION_INCREMENTAL], - (cid_face_compute_max_advance, cid_slot_load_glyph): Updated. - - * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String) - [FT_CONFIG_OPTION_INCREMENTAL], (T1_Get_Advances, T1_Load_Glyph): - Updated. - * src/type1/t1load.c: Include FT_INTERNAL_CALC_H. - * src/type1/t1objs.c (T1_Face_Init): Updated. - -2009-06-21 Werner Lemberg - - * src/pshinter/pshrec.c: Use PSH_Err_Ok. - -2009-06-21 Werner Lemberg - - Code beautification. - - * src/type1/t1load.c (FT_INT_TO_FIXED): Removed. - Replace everywhere with INT_TO_FIXED. - (FT_FIXED_TO_INT): Move to ... - * include/freetype/internal/ftcalc.h (FIXED_TO_INT): Here. - Update all users. - -2009-06-20 Werner Lemberg - - Remove unused variables. - - * include/freetype/internal/psaux.h (T1_BuilderRec), - src/cff/cffgload.h (CFF_Builder): Remove `last'. - Update all users. - -2009-06-20 Werner Lemberg - - [psaux] Check large integers while parsing charstrings. - - * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Large - integers must be followed by a `div' operator. - -2009-06-20 Werner Lemberg - - [cff] Revert last change. - - * src/cff/cffgload.c (cff_decoder_parse_charstrings): Do it. - Next time, don't confuse Type 2 charstring opcodes with TOP DICT - values... - -2009-06-20 Werner Lemberg - - * src/autofit/aflatin.c (af_latin_metrics_check_digits): Fix - compiler warning. - -2009-06-20 Werner Lemberg - - * builds/compiler/gcc.mk (CFLAGS): Use -O3, not -O6. - -2009-06-19 Werner Lemberg - - [cff] Fix handling of reserved byte 0xFF. - - * src/cff/cffgload.c (cff_decoder_parse_charstrings): Abort if byte - 0xFF is encountered. - -2009-06-19 Werner Lemberg - - Improve debug messages for Type1 charstrings. - - * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Emit newlines - after instructions. - Prettify output. - -2009-06-19 Werner Lemberg - - More ftgray fixes for FT_STATIC_RASTER. - Problems reported by suyu@cooee.cn. - - * src/smooth/ftgrays.c (gray_move_to, gray_raster_render): Use - RAS_VAR. - -2009-06-18 Werner Lemberg - - * docs/CHANGES: Updated. - -2009-06-18 Werner Lemberg - - Fix B/W rasterization of subglyphs with different drop-out modes. - - Normally, the SCANMODE instruction (if present) to set the drop-out - mode in a TrueType font is located in the `prep' table only and thus - valid for all glyphs. However, there are fonts like `pala.ttf' - which additionally contain this instruction in the hinting code of - some glyphs (but not all). As a result it can happen that a - composite glyph needs multiple drop-out modes for its subglyphs - since the rendering state gets reset for each subglyph. - - FreeType collects the hinted outlines from all subglyphs, then it - sends the data to the rasterizer. It also sends the drop-out mode - -- after hinting has been applied -- and here is the error: It sends - the drop-out mode of the last subglyph only; drop-out modes of all - other subglyphs are lost. - - This patch fixes the problem; it adds a second, alternative - mechanism to pass the drop-out mode: For each contour, the - rasterizer now checks the first `tags' array element. If bit 2 is - set, bits 5-7 contain the contour's drop-out mode, overriding the - global drop-out mode. - - * include/freetype/ftimage.h (FT_CURVE_TAG_HAS_SCANMODE): New macro. - - * src/truetype/ttgload.c (TT_Hint_Glyph): Store drop-out mode in - `tags[0]'. - - * src/raster/ftraster.c (Flow_Up, Overshoot_Top, Overshoot_Bottom): - Use bits 3-5 instead of 0-2. - (New_Profile): Set the drop-out mode in the profile's `flags' field. - (Decompose_Curve): Check `tags[0]' and set `dropOutControl' if - necessary. - (Vertical_Sweep_Drop, Horizontal_Sweep_Drop, - Horizontal_Gray_Sweep_Drop, Draw_Sweep): Use the profile's drop-out - mode. - -2009-06-16 Werner Lemberg - - Improve scan conversion rules 4 and 6. - - Two new constraints are introduced to better identify a `stub' -- a - concept which is only vaguely described in the OpenType - specification. The old code was too rigorous and suppressed more - pixel than it should. - - . The intersection of the two profiles with the scanline is less - than a half pixel. Code related to this was already present in - the sources but has been commented out. - - . The endpoint of the original contour forming a profile has a - distance (`overshoot') less than half a pixel to the scanline. - - Note that the two additional conditions fix almost all differences - to the Windows rasterizer, but some problematic cases remain. - - * src/raster/ftraster.c (Overshoot_Top, Overshoot_Bottom): New - macros for the `flags' field in the `TProfile' structure. - (IS_BOTTOM_OVERSHOOT, IS_TOP_OVERSHOOT): New macros. - (New_Profile, End_Profile): Pass overshoot flag as an argument and - set it accordingly. - Update callers. - (Vertical_Sweep_Drop, Horizontal_Sweep_Drop): Implement the two new - constraints. - -2009-06-11 Werner Lemberg - - Increase precision for B/W rasterizer. - - * src/raster/ftraster.c (Set_High_Precision): Add two more bits to - the precision. This corrects rendering of some small glyphs, for - example, glyph `xi' in verdana.ttf at 13 ppem. Testing with ftbench - on my GNU/Linux box I don't see a performance degradation. - -2009-06-08 Michael Zucchi - - Handle FT_STROKER_LINECAP_BUTT. - This fixes Savannah bug #26757. - - * src/base/ftstroke.c (ft_stroker_cap): Implement it. - -2009-06-07 Harald Fernengel - - Fix some potential out-of-memory crashes. - - * src/base/ftobjs.c (ft_glyphslot_done): Check `slot->internal'. - * src/base/ftstream.c (FT_Stream_ReleaseFrame): Check `stream'. - * src/truetype/ttinterp.c (TT_New_Context): Avoid double-free of - `exec' in case of failure. - -2009-06-07 Werner Lemberg - - Simplify math. - Suggested by Alexei Podtelezhnikov . - - * src/raster/ftraster.c (Vertical_Sweep_Drop, Horizontal_Sweep_Drop, - Horizontal_Gray_Sweep_Drop): Do it. - -2009-06-04 Werner Lemberg - - Preparation for fixing scan conversion rules 4 and 6. - - * src/raster/ftraster.c (TFlow): Replace enumeration with... - (Flow_Up): This macro. - (TProfile): Replace `flow' member with `flags' bit field. - Update all affected code. - -2009-05-29 James Cloos - - Enable autohinting for glyphs rotated by multiples of 90°. - - * src/base/ftobjs.c (FT_Load_Glyph): Alter check for permitted - matrices to allow rotations by multiples of 90°, not only unrotated, - possibly slanted matrices. - -2009-05-28 Werner Lemberg - - Remove compiler warning. - Reported by Krzysztof Kowalczyk . - - * src/autofit/aflatin2.c (af_latin2_hint_edges): Move declaration of - `n_edges' into `#if' block. - -2009-05-28 Werner Lemberg - - Make compilation work with FT_CONFIG_OPTION_USE_ZLIB not defined. - Reported by Krzysztof Kowalczyk . - - * src/pcf/pcfdrivr.c (PCF_Face_Init) [!FT_CONFIG_OPTION_USE_ZLIB]: - Make it work. - Simplify #ifdef logic. - -2009-05-22 Werner Lemberg - - Improve b/w rasterizer. - Problem reported by Krzysztof Kotlenga . - - * src/raster/raster.c (Vertical_Sweep_Drop, Horizontal_Sweep_Drop, - Horizontal_Gray_Sweep_Drop): For smart drop-out mode, if - intersections are equally distant relative to next pixel center, - select the left pixel, not the right one. - -2009-05-19 Werner Lemberg - - Fix Savannah bug #26600. - - * src/type42/t42parse.c (t42_load_keyword): Handle - T1_FIELD_LOCATION_FONT_EXTRA. - -2009-04-30 Werner Lemberg - - Document recent changes to ftview. - - * docs/CHANGES: Do it. - -2009-04-27 Werner Lemberg - - autohinter: Don't change digit widths if all widths are the same. - This fixes FreeDesktop bug #21197. - - * src/autofit/afglobal.c (AF_DIGIT): New macro. - (af_face_globals_compute_script_coverage): Mark ASCII digits in - `glyph_scripts' array. - (af_face_globals_get_metrics): Updated. - (af_face_globals_is_digit): New function. - * src/autofit/afglobal.h: Updated. - (AF_ScriptMetricsRec): Add `digits_have_same_width' flag. - - * src/autofit/aflatin.c: Include FT_ADVANCES_H. - (af_latin_metrics_check_digits): New function. - (af_latin_metrics_init): Use it. - * src/autofit/aflatin.h: Updated. - * src/autofit/afcjk.c (af_cjk_metrics_init): Updated. - - * src/autofit/aflatin2.c: Similar changes as with aflatin.c. - - * src/autofit/afloader.c (af_loader_load_g): Test digit width. - - * docs/CHANGES: Document it. - -2009-04-26 Werner Lemberg - - Make ftgrays compile with _STANDALONE_ and FT_STATIC_RASTER again. - Problems reported by suyu@cooee.cn. - - * src/smooth/ftgrays.c (FT_DEFINE_OUTLINE_FUNCS, - FT_DEFINE_RASTER_FUNCS) [_STANDALONE_]: Define. - [!_STANDALONE_]: Include ftspic.h only here. - (ras): Define/declare after definition of `TWorker'. - Use `RAS_VAR_' where necessary. - -2009-04-21 Karl Berry - - Fix AC_CHECK_FT2. - - * builds/unix/freetype2.m4: Only check PATH for freetype-config if - we did not already find it from a prefix option. - -2009-04-05 Oran Agra - - Add #error to modules and files that do not support PIC yet. - - When FT_CONFIG_OPTION_PIC is defined the following files will - create #error: - * src/bdf/bdfdrivr.h - * src/cache/ftcmanag.c - * src/cid/cidriver.h - * src/gxvalid/gxvmod.h - * src/gzip/ftgzip.c - * src/lzw/ftlzw.c - * src/otvalid/otvmod.h - * src/pcf/pcfdrivr.h - * src/pfr/pfrdrivr.h - * src/psaux/psauxmod.h - * src/type1/t1driver.h - * src/type42/t42drivr.h - * src/winfonts/winfnt.h - -2009-04-05 Oran Agra - - Position Independent Code (PIC) support in autofit module. - - * include/freetype/internal/autohint.h add macros to init - instances of FT_AutoHinter_ServiceRec. - - * src/autofit/afmodule.h declare autofit_module_class - using macros from ftmodapi.h, - when FT_CONFIG_OPTION_PIC is defined create and destroy - functions will be declared. - * src/autofit/afmodule.c when FT_CONFIG_OPTION_PIC is defined - af_autofitter_service and autofit_module_class structs - will have functions to init or create and destroy them - instead of being allocated in the global scope. - And macros will be used from afpic.h in order to access them. - - * src/autofit/aftypes.h add macros to init and declare - instances of AF_ScriptClassRec. - - * src/autofit/afcjk.h declare af_cjk_script_class - using macros from aftypes.h, - when FT_CONFIG_OPTION_PIC is defined init function will be declared. - * src/autofit/afcjk.c when FT_CONFIG_OPTION_PIC is defined - af_cjk_script_class struct will have function to init it instead of - being allocated in the global scope. - - * src/autofit/afdummy.h declare af_dummy_script_class - using macros from aftypes.h, - when FT_CONFIG_OPTION_PIC is defined init function will be declared. - * src/autofit/afdummy.c when FT_CONFIG_OPTION_PIC is defined - af_dummy_script_class struct will have function to init it instead of - being allocated in the global scope. - - * src/autofit/afindic.h declare af_indic_script_class - using macros from aftypes.h, - when FT_CONFIG_OPTION_PIC is defined init function will be declared. - * src/autofit/afindic.c when FT_CONFIG_OPTION_PIC is defined - af_indic_script_class struct will have function to init it instead of - being allocated in the global scope. - - * src/autofit/aflatin.h declare af_latin_script_class - using macros from aftypes.h, - when FT_CONFIG_OPTION_PIC is defined init function will be declared. - * src/autofit/aflatin.c when FT_CONFIG_OPTION_PIC is defined - af_latin_script_class struct will have function to init it instead of - being allocated in the global scope. - Change af_latin_blue_chars to be PIC-compatible by being a two - dimentional array rather than array of pointers. - - - * src/autofit/aflatin2.h declare af_latin2_script_class - using macros from aftypes.h, - when FT_CONFIG_OPTION_PIC is defined init function will be declared. - * src/autofit/aflatin2.c when FT_CONFIG_OPTION_PIC is defined - af_latin2_script_class struct will have function to init it instead of - being allocated in the global scope. - Change af_latin2_blue_chars to be PIC-compatible by being a two - dimentional array rather than array of pointers. - - * src/autofit/afglobal.c when FT_CONFIG_OPTION_PIC is defined - af_script_classes array initialization was moved to afpic.c and - is later refered using macros defeined in afpic.h. - - New Files: - * src/autofit/afpic.h declare struct to hold PIC globals for autofit - module and macros to access them. - * src/autofit/afpic.c implement functions to allocate, destroy and - initialize PIC globals for autofit module. - - * src/autofit/autofit.c add new file to build: afpic.c. - * src/autofit/jamfile add new files to FT2_MULTI build: afpic.c. - -2009-04-05 Oran Agra - - Position Independent Code (PIC) support in pshinter module. - - * include/freetype/internal/pshints.h add macros to init - instances of PSHinter_Interface. - - * src/pshinter/pshmod.h declare pshinter_module_class - using macros from ftmodapi.h, - when FT_CONFIG_OPTION_PIC is defined create and destroy - functions will be declared. - * src/pshinter/pshmod.c when FT_CONFIG_OPTION_PIC is defined - pshinter_interface and pshinter_module_class structs - will have functions to init or create and destroy them - instead of being allocated in the global scope. - And macros will be used from pshpic.h in order to access them. - - New Files: - * src/pshinter/pshpic.h declare struct to hold PIC globals for pshinter - module and macros to access them. - * src/pshinter/pshpic.c implement functions to allocate, destroy and - initialize PIC globals for pshinter module. - - * src/pshinter/pshinter.c add new file to build: pshpic.c. - * src/pshinter/jamfile add new files to FT2_MULTI build: pshpic.c. - -2009-04-05 Oran Agra - - Position Independent Code (PIC) support in psnames module. - - * include/freetype/internal/services/svpscmap.h add macros to init - instances of FT_Service_PsCMapsRec. - - * src/psnames/psmodule.h declare psnames_module_class - using macros from ftmodapi.h, - when FT_CONFIG_OPTION_PIC is defined create and destroy - functions will be declared. - * src/psnames/psmodule.c when FT_CONFIG_OPTION_PIC is defined - pscmaps_interface and pscmaps_services structs - and psnames_module_class array - will have functions to init or create and destroy them - instead of being allocated in the global scope. - And macros will be used from pspic.h in order to access them. - - New Files: - * src/psnames/pspic.h declare struct to hold PIC globals for psnames - module and macros to access them. - * src/psnames/pspic.c implement functions to allocate, destroy and - initialize PIC globals for psnames module. - - * src/psnames/psnames.c add new file to build: pspic.c. - * src/psnames/jamfile add new files to FT2_MULTI build: pspic.c. - -2009-04-05 Oran Agra - - Position Independent Code (PIC) support in raster renderer. - - * src/raster/ftrend1.h declare ft_raster1_renderer_class - and ft_raster5_renderer_class - using macros from ftrender.h, - when FT_CONFIG_OPTION_PIC is defined create and destroy - functions will be declared. - * src/smooth/ftrend1.c when FT_CONFIG_OPTION_PIC is defined - ft_raster1_renderer_class and ft_raster5_renderer_class structs - will have functions to init or create and destroy them - instead of being allocated in the global scope. - Macros will be used from rastpic.h in order to access - ft_standard_raster from the pic_container (allocated in ftraster.c). - In ft_raster1_render when PIC is enabled, the last letter of - module_name is used to verfy the renderer class rather than the - class pointer. - - * src/raster/ftraster.c when FT_CONFIG_OPTION_PIC is defined - ft_standard_raster struct will have function to init it - instead of being allocated in the global scope. - - New Files: - * src/raster/rastpic.h declare struct to hold PIC globals for raster - renderer and macros to access them. - * src/raster/rastpic.c implement functions to allocate, destroy and - initialize PIC globals for raster renderer. - - * src/raster/raster.c add new file to build: rastpic.c. - * src/raster/jamfile add new files to FT2_MULTI build: rastpic.c. - -2009-04-05 Oran Agra - - Position Independent Code (PIC) support in smooth renderer. - - * src/smooth/ftsmooth.h declare ft_smooth_renderer_class, - ft_smooth_lcd_renderer_class and ft_smooth_lcd_v_renderer_class - using macros from ftrender.h, - when FT_CONFIG_OPTION_PIC is defined create and destroy - functions will be declared. - * src/smooth/ftsmooth.c when FT_CONFIG_OPTION_PIC is defined - the following structs: - ft_smooth_renderer_class, ft_smooth_lcd_renderer_class - and ft_smooth_lcd_v_renderer_class - will have functions to init or create and destroy them - instead of being allocated in the global scope. - And macros will be used from ftspic.h in order to access - ft_grays_raster from the pic_container (allocated in ftgrays.c). - - * src/smooth/ftgrays.h include FT_CONFIG_CONFIG_H - * src/smooth/ftgrays.c when FT_CONFIG_OPTION_PIC is NOT defined - func_interface was moved from gray_convert_glyph_inner function - to the global scope. - When FT_CONFIG_OPTION_PIC is defined - func_interface and ft_grays_raster structs - will have functions to init them - instead of being allocated in the global scope. - And func_interface will be allocated on the stack of - gray_convert_glyph_inner. - - New Files: - * src/smooth/ftspic.h declare struct to hold PIC globals for smooth - renderer and macros to access them. - * src/smooth/ftspic.c implement functions to allocate, destroy and - initialize PIC globals for smooth renderer. - - * src/smooth/smooth.c add new file to build: ftspic.c. - * src/smooth/jamfile add new files to FT2_MULTI build: ftspic.c. - -2009-04-05 Oran Agra - - Position Independent Code (PIC) support in cff driver. - - * include/freetype/internal/services/svcid.h add macros to init - instances of FT_Service_CIDRec. - * include/freetype/internal/services/svpsinfo.h add macros to init - instances of FT_Service_PsInfoRec. - - * src/cff/cffcmap.h declare cff_cmap_encoding_class_rec - and cff_cmap_unicode_class_rec using macros from - ftobjs.h, when FT_CONFIG_OPTION_PIC is defined create and destroy - functions will be declared. - * src/cff/cffcmap.c when FT_CONFIG_OPTION_PIC is defined - the following structs: - cff_cmap_encoding_class_rec and cff_cmap_unicode_class_rec - will have functions to init or create and destroy them - instead of being allocated in the global scope. - - * src/cff/cffdrivr.h declare cff_driver_class using macros from - ftdriver.h, when FT_CONFIG_OPTION_PIC is defined create and destroy - functions will be declared. - * src/cff/cffdrivr.c when FT_CONFIG_OPTION_PIC is defined - the following structs: - cff_service_glyph_dict, cff_service_ps_info, cff_service_ps_name - cff_service_get_cmap_info, cff_service_cid_info, cff_driver_class, - and cff_services array - will have functions to init or create and destroy them - instead of being allocated in the global scope. - And macros will be used from cffpic.h in order to access them - from the pic_container. - Use macros from cffpic.h in order to access the - structs allocated in cffcmap.c - - * src/cff/cffobjs.c Use macros from cffpic.h in order to access the - structs allocated in cffcmap.c - - * src/cff/parser.c when FT_CONFIG_OPTION_PIC is defined - implement functions to create and destroy cff_field_handlers array - instead of being allocated in the global scope. - And macros will be used from cffpic.h in order to access it - from the pic_container. - - New Files: - * src/cff/cffpic.h declare struct to hold PIC globals for cff - driver and macros to access them. - * src/cff/cffpic.c implement functions to allocate, destroy and - initialize PIC globals for cff driver. - - * src/cff/cff.c add new file to build: cffpic.c. - * src/cff/jamfile add new files to FT2_MULTI build: cffpic.c. - -2009-04-05 Oran Agra - - Position Independent Code (PIC) support in sfnt driver. - - * include/freetype/internal/services/svbdf.h add macros to init - instances of FT_Service_BDFRec. - * include/freetype/internal/services/svgldict.h add macros to init - instances of FT_Service_GlyphDictRec. - * include/freetype/internal/services/svpostnm.h add macros to init - instances of FT_Service_PsFontNameRec. - * include/freetype/internal/services/svsfnt.h add macros to init - instances of FT_Service_SFNT_TableRec. - * include/freetype/internal/services/svttcmap.h add macros to init - instances of FT_Service_TTCMapsRec. - * include/freetype/internal/sfnt.h add macros to init - instances of SFNT_Interface. - - * src/sfnt/sfdriver.h declare sfnt_module_class using macros from - ftmodapi.h, when FT_CONFIG_OPTION_PIC is defined create and destroy - functions will be declared. - * src/sfnt/sfdriver.c when FT_CONFIG_OPTION_PIC is defined - the following structs: - sfnt_service_sfnt_table, sfnt_service_glyph_dict, sfnt_service_ps_name - tt_service_get_cmap_info, sfnt_service_bdf, sfnt_interface, - sfnt_module_class, and sfnt_services array - will have functions to init or create and destroy them - instead of being allocated in the global scope. - And macros will be used from sfntpic.h in order to access them - from the pic_container. - - * src/sfnt/ttcmap.h add macros to init - instances of TT_CMap_ClassRec. - * src/sfnt/ttcmap.c when FT_CONFIG_OPTION_PIC is defined - the following structs: - tt_cmap0_class_rec, tt_cmap2_class_rec, tt_cmap4_class_rec - tt_cmap6_class_rec, tt_cmap8_class_rec, tt_cmap10_class_rec, - tt_cmap12_class_rec, tt_cmap14_class_rec and tt_cmap_classes array - will have functions to init or create and destroy them - instead of being allocated in the global scope. - And macros will be used from sfntpic.h in order to access them - from the pic_container. - The content of tt_cmap_classes is now described in the - new file 'ttcmapc.h'. - - New Files: - * src/sfnt/sfntpic.h declare struct to hold PIC globals for sfnt - driver and macros to access them. - * src/sfnt/sfntpic.c implement functions to allocate, destroy and - initialize PIC globals for sfnt driver. - * src/sfnt/ttcmapc.h describing the content of - tt_cmap_classes allocated in ttcmap.c - - * src/sfnt/sfnt.c add new file to build: sfntpic.c. - * src/sfnt/jamfile add new files to FT2_MULTI build: sfntpic.c. - -2009-04-05 Oran Agra - - Position Independent Code (PIC) support in truetype driver. - - * include/freetype/internal/services/svmm.h add macros to init - instances of FT_Service_MultiMastersRec. - * include/freetype/internal/services/svttglyf.h add macros to init - instances of FT_Service_TTGlyfRec. - - * src/truetype/ttdriver.h declare tt_driver_class using macros from - ftdriver.h, when FT_CONFIG_OPTION_PIC is defined create and destroy - functions will be declared. - * src/truetype/ttdriver.c when FT_CONFIG_OPTION_PIC is defined - the following structs: - tt_service_gx_multi_masters, tt_service_truetype_glyf, tt_driver_class - and tt_services array, - will have functions to init or create and destroy them - instead of being allocated in the global scope. - And macros will be used from ttpic.h in order to access them - from the pic_container. - * src/truetype/ttobjs.c change trick_names array to be - PIC-compatible by being a two dimentional array rather than array - of pointers. - - New Files: - * src/truetype/ttpic.h declare struct to hold PIC globals for truetype - driver and macros to access them. - * src/truetype/ttpic.c implement functions to allocate, destroy and - initialize PIC globals for truetype driver. - - * src/truetype/truetype.c add new file to build: ttpic.c. - * src/truetype/jamfile add new files to FT2_MULTI build: ttpic.c. - -2009-04-05 Oran Agra - - Position Independent Code (PIC) support and infrastructure in base. - - * include/freetype/config/ftoption.h add FT_CONFIG_OPTION_PIC - * include/freetype/internal/ftobjs.h Add pic_container member to - FT_LibraryRec. - Add macros to declare and init instances of FT_CMap_ClassRec. - Add macros to init instances of FT_Outline_Funcs and FT_Raster_Funcs. - Add macros to declare, allocate and initialize modules - (FT_Module_Class). - Add macros to declare, allocate and initialize renderers - (FT_Renderer_Class). - Add macro to init instances of FT_Glyph_Class. - Add macros to declare, allocate and initialize drivers - (FT_Driver_ClassRec). - * include/freetype/internal/ftpic.h new file to declare the - FT_PIC_Container struct and the functions to allocate and detroy it. - * include/freetype/internal/ftserv.h add macros to allocate and - destory arrays of FT_ServiceDescRec. - * include/freetype/internal/internal.h define macro to include - ftpic.h. - - New Files: - * src/base/ftpic.c implement functions to allocate and destory the - global pic_container. - * src/base/basepic.h declare struct to hold PIC globals for base and - macros to access them. - * src/base/basepic.c implement functions to allocate, destroy and - initialize PIC globals for base. - - * src/base/ftinit.c when FT_CONFIG_OPTION_PIC is defined implement - functions that allocate and destroy ft_default_modules according to - FT_CONFIG_MODULES_H in the pic_container instead of the global scope - and use macro from basepic.h to access it. - * src/base/ftobjs.c add calls to the functions that allocate and - destroy the global pic_container when the library is created and - destroyed. - - * src/base/jamfile add new files to FT2_MULTI build: - ftpic.c and basepic.c. - * src/base/ftbase.c add new files to build: - ftpic.c and basepic.c. - - * src/base/ftglyph.c when FT_CONFIG_OPTION_PIC is defined - ft_bitmap_glyph_class and ft_outline_glyph_class will be allocated - in the pic_container instead of the global scope and use macros from - basepic.h to access them. - * src/base/ftbbox.c allocate bbox_interface stract on the stack - instead of the global scope when FT_CONFIG_OPTION_PIC is defined. - * src/base/ftstroke.c access ft_outline_glyph_class allocated in - ftglyph.c via macros from basepic.h - -2009-04-05 Oran Agra - - Preparing changes in cff parser later needed for PIC version. - - * src/cff/cffload.c, src/cff/cffload.h, src/cff/cffobjs.c, - src/cff/cffparse.c, src/cff/cffparse.h: Add library pointer to - 'CFF_ParserRec' set by `cff_parser_init'. - Route library pointer from 'cff_face_init' to 'cff_subfont_load' - for `cff_parser_init'. - - * src/cff/cffparse.c (CFF_Field_Handler): Move it to... - * src/cff/cffparse.h: This file, to be used by other C files. - -2009-04-05 Oran Agra - - Minor change in ftstroke.c. - - * src/base/ftstroke.c (FT_StrokerRec): Replace `memory' member with - `library' needed for PIC version. - Update all callers. - -2009-04-04 Werner Lemberg - - ftnames.c -> ftsnames.c - - * src/base/ftnames.c: Rename to... - * src/base/ftsnames.c: This. - * src/base/Jamfile, src/base/rules.mk, src/base/ftbase.c: Updated. - -2009-04-04 Werner Lemberg - - Add support for cmap type 13. - - * devel/ftoption.h, include/freetype/config/ftoption.h - (TT_CONFIG_CMAP_FORMAT_13): New macro. - - * src/sfnt/ttcmap.c (TT_CMap13Rec, tt_cmap13_init, - tt_cmap13_validate, tt_cmap13_char_index, tt_cmap13_char_next, - tt_cmap13_get_info, tt_cmap13_char_map_def_binary, - tt_cmap14_class_rec): New functions and structures for cmap 13 - support. - (tt_cmap_classes): Register tt_cmap13_class_rec. - - * docs/CHANGES: Mention cmap 13 support. - -2009-04-01 Werner Lemberg - - Ignore empty contours in CFF glyphs. - - Problem reported by Albert Astals Cid . - - * src/cff/cffgload.c (cff_builder_close_contour): Synchronize with - t1_builder_close_contour. - -2009-03-21 Werner Lemberg - - Another redundant header inclusion. - - * src/truetype/ttgxvar.c: Fix Ghostscript Coverity issue #4041. - -2009-03-21 Werner Lemberg - - Remove redundant header inclusions. - - This covers many Ghostscript Coverity issues. - - * src/*: Do it. - -2009-03-21 Werner Lemberg - - Fix Ghostscript Coverity issue #3904. - - * src/truetype/ttgxvar.c (ft_var_readpackedpoints): Protect against - invalid values of `runcnt'. - -2009-03-20 Werner Lemberg - - Fix `make multi' run. - - * src/smooth/ftsmooth.h: Include FT_INTERNAL_DEBUG_H. - -2009-03-20 Werner Lemberg - - Fix Savannah bug #25923. - - * src/cache/ftccmap.c (FTC_CMAP_HASH): Fix typo. - -2009-03-20 Werner Lemberg - - Protect against too large glyphs. - - Problem reported by Tavis Ormandy . - - * src/smooth/ftsmooth.c (ft_smooth_render_generic): Don't allow - `pitch' or `height' to be larger than 0xFFFF. - -2009-03-20 Werner Lemberg - Tavis Ormandy - - Fix validation for various cmap table formats. - - * src/sfnt/ttcmap.c (tt_cmap8_validate, tt_cmap10_validate, - tt_cmap12_validate): Check `length' correctly. - (tt_cmap_14_validate): Check `length' and `numMappings' correctly. - -2009-03-20 Werner Lemberg - - Protect against malformed compressed data. - - * src/lzw/ftzopen.c (ft_lzwstate_io): Test whether `state->prefix' is - zero. - -2009-03-20 Werner Lemberg - - Protect against invalid SID values in CFFs. - - Problem reported by Tavis Ormandy . - - * src/cff/cffload.c (cff_charset_load): Reject SID values larger - than 64999. - -2009-03-19 Vincent Richomme - - Update WinCE Visual C project files. - - * builds/wince/vc2005-ce/freetype.vcproj, - builds/wince/vc2008-ce/freetype.vcproj: Add missing base extension - files. - -2009-03-19 Werner Lemberg - - Remove unused Win32 code. - - * builds/wince/ftdebug.c: Remove code guarded with `!_WIN32_WCE'. - Since Win32 is handled separately this is no longer needed. - -2009-03-19 Vincent Richomme - - Make `gzip' module compile on WinCE. - - * src/gzip/zconf.h [_WIN32_WCE]: Define NO_ERRNO_H. - -2009-03-19 Werner Lemberg - - Remove unused WinCE code. - - * builds/win32/ftdebug.c: Remove code guarded with `_WIN32_WCE'. - Since WinCE is handled separately this is no longer needed. - -2009-03-16 Werner Lemberg - - docmaker: Don't ignore single-line code blocks. - - * src/tools/docmaker/content.py (DocBlock::_init__): Fix change from - 2009-01-31. - -2009-03-15 Steve Langasek - - Use __asm__ for declaring assembly instead of asm. - - * builds/unix/ftconfig.in (FT_MulFix_arm): Use __asm__ instead of - asm on arm, fixing a build failure on armel with -pedantic. - -2009-03-14 Werner Lemberg - - Fix valgrind warning. - - * src/sfnt/ttsbit0.c (tt_sbit_decoder_load_bit_aligned): Don't read - past the end of the frame. - -2009-03-12 Werner Lemberg - - * Version 2.3.9 released. - ========================= - - - Tag sources with `VER-2-3-9'. - -2009-03-12 Werner Lemberg - - * builds/unix/freetype2.in: Move @FT2_EXTRA_LIBS@ to `Libs.private'. - -2009-03-12 Werner Lemberg - - Fix some FreeType Coverity issues as reported for Ghostscript. - - * src/base/ftobjs.c (FT_New_Face, FT_New_Memory_Face): Initialize - `args.stream' (#3874, #3875). - (open_face_PS_from_sfnt_stream): Improve error management (#3786). - * src/base/ftmm.c (ft_face_get_mm_service): Fix check of `aservice' - (#3870). - * src/base/ftstroke.c (ft_stroke_border_get_counts): Remove dead - code (#3790). - * src/base/ftrfork.c (raccess_guess_apple_generic): Check error - value of `FT_Stream_Skip' (#3784). - - * src/type1/t1gload.c (T1_Load_Glyph): Check `size' before accessing - it (#3872) - - * src/pcf/pcfdrivr.c (PCF_Glyph_Load): Check `face' before accessing - it (#3871). - * src/pcf/pcfread.c (pcf_get_metrics): Handle return value of - `pcf_get_metric' (#3789, #3782). - (pcf_get_properties): Use FT_STREAM_SKIP (#3783). - - * src/cache/ftcmanag.c (FTC_Manager_RegisterCache): Fix check of - `acache' (#3797) - - * src/cff/cffdrivr.c (cff_ps_get_font_info): Fix check of `cff' - (#3796). - * src/cff/cffgload.c (cff_decoder_prepare): Check `size' (#3795). - * src/cff/cffload.c (cff_index_get_pointers): Add comment (#3794). - - * src/bdf/bdflib.c (_bdf_add_property): Check `fp->value.atom' - (#3793). - (_bdf_parse_start): Add comment (#3792). - - * src/raster/ftraster.c (Finalize_Profile_Table): Check - `ras.fProfile' (#3791). - - * src/sfnt/ttsbit.c (Load_SBit_Image): Use FT_STREAM_SKIP (#3785). - - * src/gzip/ftgzip.c (ft_gzip_get_uncompressed_size): Properly ignore - seek error (#3781). - -2009-03-11 Michael Toftdal - - Extend CID service functions to handle CID-keyed CFFs as CID fonts. - - * include/freetype/ftcid.h (FT_Get_CID_Is_Internally_CID_keyed, - FT_Get_CID_From_Glyph_Index): New functions. - - * include/freetype/internal/services/svcid.h - (FT_CID_GetIsInternallyCIDKeyedFunc, - FT_CID_GetCIDFromGlyphIndexFunc): New function typedefs. - (CID Service): Use them. - - * src/base/ftcid.c: Include FT_CID_H. - (FT_Get_CID_Is_Internally_CID_keyed, FT_Get_CID_From_Glyph_Index): - New functions. - - * src/cff/cffdrivr.c (cff_get_is_cid, cff_get_cid_from_glyph_index): - New functions. - (cff_service_cid_info): Add them. - * src/cff/cffload.c (cff_font_load): Don't free `font->charset.sids' - -- it is needed for access as a CID-keyed font. It gets deleted - later on. - - * src/cid/cidriver.c (cid_get_is_cid, cid_get_cid_from_glyph_index): - New functions. - (cid_service_cid_info): Add them. - - * docs/CHANGES: Updated. - -2009-03-11 Bram Tassyns - - Fix Savannah bug #25597. - - * src/cff/cffparse.c (cff_parse_real): Don't allow fraction_length - to become larger than 9. - -2009-03-11 Werner Lemberg - - Fix Savannah bug #25814. - - * builds/unix/freetype2.in: As suggested in the bug report, move - @LIBZ@ to `Libs.private'. - -2009-03-11 Werner Lemberg - - Fix Savannah bug #25781. - We now simply check for a valid `offset', no longer handling `delta - = 1' specially. - - * src/sfnt/ttcmap.c (tt_cmap4_validate): Don't check `delta' for - last segment. - (tt_cmap4_set_range, tt_cmap4_char_map_linear, - tt_cmap4_char_map_binary): Check offset. - -2009-03-11 Werner Lemberg - - * src/base/Jamfile: Fix handling of ftadvanc.c. - Reported by Oran Agra . - -2009-03-10 Vincent Richomme - - Restructure Win32 and Wince compiler support. - - * src/builds/win32: Remove files for WinCE. - Move VC 2005 support to a separate directory. - Add directory for VC 2008 support. - - * src/builds/wince: New directory hierarchy for WinCE compilers - (VC 2005 and VC 2008). - -2009-03-09 Werner Lemberg - - More preparations for 2.3.9 release. - - * docs/CHANGES: Updated. - - * Jamfile, README: s/2.3.8/2.3.9/, s/238/239/. - -2009-03-09 Werner Lemberg - - * src/sfnt/rules.mk (SFNT_DRV_H): Add ttsbit0.c. - -2009-03-09 Alexey Kryukov - - Fix handling of EBDT formats 8 and 9 (part 2). - - This patch fixes the following problems in ttsbit0.c: - - . Bitmaps for compound glyphs were never allocated. - - . `SBitDecoder' refused to load metrics if some other metrics have - already been loaded. This condition certainly makes no sense for - recursive calls, so I've just disabled it. Another possibility - would be resetting `decoder->metrics_loaded' to false before - loading each composite component. However, we must restore the - original metrics after finishing the recursion; otherwise we can - get a misaligned glyph. - - . `tt_sbit_decoder_load_bit_aligned' incorrectly handled `x_pos', - causing some glyph components to be shifted too far to the right - (especially noticeable for small sizes). - - Note that support for grayscale bitmaps (not necessarily compound) is - completely broken in ttsbit0.c. - - * src/sfnt/tt_sbit_decoder_load_metrics: Always load metrics. - (tt_sbit_decoder_load_bit_aligned): Handle `x_pos' correctly in case - of `h == height'. - (tt_sbit_decoder_load_compound): Reset metrics after loading - components. - Allocate bitmap. - -2009-03-09 Werner Lemberg - - * builds/unix/configure.raw (version_info): Set to 9:20:3. - -2009-03-03 David Turner - - Protect SFNT kerning table parser against malformed tables. - - This closes Savannah BUG #25750. - - * src/sfnt/ttkern.c (tt_face_load_kern, tt_face_get_kerning): Fix a - bug where a malformed table would be successfully loaded but later - crash the engine during parsing. - -2009-03-03 David Turner - - Update documentation and bump version number to 2.3.9. - - * include/freetype/freetype.h: Bump patch version to 9. - * docs/CHANGES: Document the ABI break in 2.3.8. - * docs/VERSION.DLL: Update version numbers table for 2.3.9. - -2009-03-03 David Turner - - Remove ABI-breaking field in public PS_InfoFontRec definition. - - Instead, we define a new internal PS_FontExtraRec structure to - hold the additional field, then place it in various internal - positions of the corresponding FT_Face derived objects. - - * include/freetype/t1tables.h (PS_FontInfoRec): Remove the - `fs_type' field from the public structure. - * include/freetype/internal/psaux.h (T1_FieldLocation): New - enumeration `T1_FIELD_LOCATION_FONT_EXTRA'. - * include/freetype/internal/t1types.h (PS_FontExtraRec): New - structure. - (T1_FontRec, CID_FaceRec): Add it. - - * src/cid/cidload.c (cid_load_keyword): Handle - T1_FIELD_LOCATION_FONT_EXTRA. - * src/cid/cidtoken.h, src/type1/t1tokens.h, src/type42/t42parse.c: - Adjust FT_STRUCTURE and T1CODE properly to handle `FSType'. - * src/type1/t1load.c (t1_load_keyword): Handle - T1_FIELD_LOCATION_FONT_EXTRA. - - * include/freetype/internal/services/svpsinfo.h (PsInfo service): - Add `PS_GetFontExtraFunc' function typedef. - - * src/base/ftfstype.c: Include FT_INTERNAL_SERVICE_H and - FT_SERVICE_POSTSCRIPT_INFO_H. - (FT_Get_FSType_Flags): Use POSTSCRIPT_INFO service. - - * src/cff/cffdrivr.c (cff_service_ps_info): Updated. - * src/cid/cidriver.c (cid_ps_get_font_extra): New function. - (cid_service_ps_info): Updated. - * src/type1/t1driver.c (t1_ps_get_font_extra): New function. - (t1_service_ps_info): Updated. - * src/type42/t42drivr.c (t42_ps_get_font_extra): New function. - (t42_service_ps_info): Updated. - -2009-03-02 Alexey Kryukov - - Fix handling of EBDT formats 8 and 9. - - The main cycle in `blit_sbit' makes too many iterations: it actually - needs the count of lines in the source bitmap rather than in the - target image. - - * src/sfnt/ttsbit.c (blit_sbit) [FT_CONFIG_OPTION_OLD_INTERNALS]: - Add parameter `source_height' and use it for main loop. - (Load_SBit_Single) [FT_CONFIG_OPTION_OLD_INTERNALS]: Updated. - -2009-02-23 Werner Lemberg - - Fix Savannah bug #25669. - - * src/base/ftadvanc.h (FT_Get_Advances): Fix serious typo. - - * src/base/ftobjs.c (FT_Select_Metrics, FT_Request_Metrics): Fix - scaling factor for non-scalable fonts. - - * src/cff/cffdrivr.c (cff_get_advances): Use correct advance width - value to prevent incorrect scaling. - - * docs/CHANGES: Document it. - -2009-02-15 Matt Godbolt - - Fix Savannah bug #25588. - - * builds/unix/ftconfig.in (FT_MulFix_arm): Use correct syntax for - `orr' instruction. - -2009-02-11 Werner Lemberg - - * src/truetype/ttobjs.c (tt_check_trickyness): Add `DFKaiShu'. - Reported by David Bevan . - -2009-02-09 Werner Lemberg - - Fix Savannah bug #25495. - - * src/sfnt/sfobjs.c (sfnt_load_face): Test for bitmap strikes before - setting metrics and bbox values. This ensures that the check for a - font with neither a `glyf' table nor bitmap strikes can be performed - early enough to set metrics and bbox values too. - -2009-02-04 Werner Lemberg - - Fix Savannah bug #25480. - - * builds/unix/freetype-config.in: For --ftversion, don't use $prefix - but $includedir. - -2009-01-31 Werner Lemberg - - Minor docmaker improvements. - - * src/tools/docmaker/content.py (DocBlock::__init__): Ignore empty - code blocks. - -2009-01-25 Werner Lemberg - - Fix SCANCTRL handling in TTFs. - Problem reported by Alexey Kryukov . - - * src/truetype/ttinterp.c (Ins_SCANCTRL): Fix threshold handling. - -2009-01-23 Werner Lemberg - - Move FT_Get_FSType_Flags to a separate file. - Problem reported by Mickey Gabel . - - * src/base/ftobjs.c (FT_Get_FSType_Flags): Move to... - * src/base/ftfstype.c: This new file. - - * modules.cfg (BASE_EXTENSION): Add ftfstype.c. - - * docs/INSTALL.ANY: Updated. - - * builds/mac/*.txt, builds/amiga/*makefile*, - builds/win32/{visualc,visualce}/freetype.*, builds/symbian/*: - Updated. - -2009-01-22 suzuki toshiya - - * builds/unix/ftsystem.c (FT_Stream_Open): Fix 2 error - messages ending without "\n". - -2009-01-22 suzuki toshiya - - Fix Savannah bug #25347. - - * src/base/ftobjs.c (open_face_PS_from_sfnt_stream): Rewind - the stream to the original position passed to this function, - when ft_lookup_PS_in_sfnt_stream() failed. - (Mac_Read_sfnt_Resource): Rewind the stream to the head of - sfnt resource body, when open_face_PS_from_sfnt_stream() - failed. - -2009-01-19 Michael Lotz - - Fix Savannah bug #25355. - - * include/freetype/config/ftconfig.h (FT_MulFix_i386): Make - assembler code work with gcc 2.95.3 (as used by the Haiku project). - Add `cc' register to the clobber list. - -2009-01-18 Werner Lemberg - - Protect FT_Get_Next_Char. - - * src/sfnt/ttcmap.c (tt_cmap4_set_range): Apply fix similar to - change from 2008-07-22. - - Patch from Ronen Ghoshal . - -2009-01-18 Werner Lemberg - - Implement FT_Get_Name_Index for SFNT driver. - - * src/sfnt/sfdriver.c (sfnt_get_name_index): New function. - (sfnt_service_glyph_dict): Use it. - - Problem reported by Truc Truong . - -2009-01-18 Werner Lemberg - - * include/freetype/ftstroke.h (FT_Outline_GetInsideBorder): Fix - documentation. Problem reported by Truc Truong . - - * docs/CHANGES: Updated. - -2009-01-14 Werner Lemberg - - * Version 2.3.8 released. - ========================= - - - Tag sources with `VER-2-3-8'. - - * docs/VERSION.DLL: Update documentation and bump version number to - 2.3.8. - - * README, Jamfile (RefDoc), builds/win32/visualc/index.html, - builds/win32/visualc/freetype.dsp, - builds/win32/visualc/freetype.vcproj, - builds/win32/visualce/index.html, - builds/win32/visualce/freetype.dsp, - builds/win32/visualce/freetype.vcproj: s/2.3.7/2.3.8/, s/237/238/. - - * include/freetype/freetype.h (FREETYPE_PATCH): Set to 8. - - * builds/unix/configure.raw (version_info): Set to 9:19:3. - - * docs/release: Updated. - -2009-01-14 Werner Lemberg - - * builds/toplevel.mk (dist): Compress better. - -2009-01-13 Werner Lemberg - - * src/base/ftobjs.c (FT_Get_FSType_Flags): Cast for compilation - with C++. - -2009-01-13 Werner Lemberg - - Don't use stdlib.h and friends directly. - Reported by Mickey Gabel . - - * src/base/ftdbgmem.c: s//FT_CONFIG_STANDARD_LIBRARY_H/. - - * src/gzip/ftgzip.c, src/lzw/ftlzw.c, src/raster/ftmisc.h: - s//FT_CONFIG_STANDARD_LIBRARY_H/. - - * src/autofit/aftypes.h, src/autofit/afhints.c, - src/pshinter/pshalgo.c: s//FT_CONFIG_STANDARD_LIBRARY_H/ - - * src/lzw/ftlzw.c, src/base/ftdbgmem.c: Don't include stdio.h. - -2009-01-12 Werner Lemberg - - Avoid compiler warnings. - - * */*: s/do ; while ( 0 )/do { } while ( 0 )/. - Reported by Sean McBride . - -2009-01-12 Werner Lemberg - - Fix stdlib dependencies. - - Problem reported by Mickey Gabel . - - * include/freetype/config/ftstdlib.h (ft_exit): Removed. Unused. - - * src/autofit/afhints.c, src/base/ftlcdfil.c, src/smooth/ftsmooth.c: - s/memcpy/ft_memcpy/. - * src/psaux/t1decode.c: s/memset/ft_memset/, s/memcpy/ft_memcpy/. - -2009-01-11 Werner Lemberg - - * docs/formats.txt: Add link to PCF specification. - - * include/freetype/ftbdf.h (FT_Get_BDF_Property): Improve - documentation. - -2009-01-09 suzuki toshiya - - * src/base/ftadvanc.c (_ft_face_scale_advances, FT_Get_Advance, - FT_Get_Advances): Change the type of load_flags from FT_UInt32 to - FT_Int32, to match with the flags for FT_Load_Glyph(). - * src/cff/cffdrivr.c (cff_get_advances): Ditto. - * src/truetype/ttdriver.c (tt_get_advances): Ditto. - * include/freetype/ftadvanc.h (FT_Get_Advance, FT_Get_Advances): - Ditto. - * include/freetype/internal/ftdriver.h (FT_Face_GetAdvancesFunc): - Ditto. - -2009-01-09 Daniel Zimmermann - - * src/gxvalid/gxvmort.c (gxv_mort_feature_validate): Fix wrong - length check. From Savannah patch #6682. - -2009-01-09 Werner Lemberg - - Fix problem with T1_FIELD_{NUM,FIXED}_TABLE2. - - * src/psaux/psobjs.c (ps_parser_load_field_table): Don't handle - `count_offset' if it is zero (i.e., unused). Otherwise, the first - element of the structure which holds the data is erroneously - modified. Problem reported by Chi Nguyen . - -2009-01-09 suzuki toshiya - - * src/base/ftadvanc.c (_ft_face_scale_advances, FT_Get_Advance, - FT_Get_Advances): Extend the type of load_flags from FT_UInt to - FT_UInt32, to pass 32-bit flags on 16bit platforms. - * src/cff/cffdrivr.c (cff_get_advances): Ditto. - * src/truetype/ttdriver.c (tt_get_advances): Ditto. - * include/freetype/ftadvanc.h (FT_Get_Advance, FT_Get_Advances): - Ditto. - * include/freetype/internal/ftdriver.h (FT_Face_GetAdvancesFunc): - Ditto. - -2009-01-09 suzuki toshiya - - * src/base/ftobjs.c (FT_Done_Library): Issue an error message when - FT_Done_Face() cannot free all faces. If the list of the opened - faces includes broken face which FT_Done_Face() cannot free, - FT_Done_Library() retries FT_Done_Face() and it can fall into - an endless loop. See the discussion: - http://lists.gnu.org/archive/html/freetype-devel/2008-09/msg00047.html - http://lists.gnu.org/archive/html/freetype-devel/2008-10/msg00000.html - -2009-01-07 Werner Lemberg - - * docs/CHANGES: Document new key `a' in ftdiff. - -2009-01-06 Werner Lemberg - - * autogen.sh: Don't use GNUisms while calling sed. Problem reported - by Sean McBride. - -2009-01-06 Werner Lemberg - - * src/base/ftbitmap.c (FT_Bitmap_Convert): Handle FT_PIXEL_MODE_LCD - and FT_PIXEL_MODE_LCD_V. Problem reported by Chi Nguyen - . - -2009-01-06 Diego Pettenò - - * builds/unix/configure.raw: Don't call AC_CANONICAL_BUILD and - AC_CANONICAL_TARGET and use $host_os only. A nice explanation for - this change can be found at - http://blog.flameeyes.eu/s/canonical-target. - - From Savannah patch #6712. - -2009-01-06 Sean McBride - - * src/base/ftdbgmem.c (_debug_mem_dummy): Make it static. - - * src/base/ftmac.c: Remove some #undefs. - -2008-12-26 Werner Lemberg - - Set `face_index' field in FT_Face for all font formats. - - * cff/cffobjs.c (cff_face_init), winfonts/winfnt.c (FNT_Face_Init), - sfnt/sfobjs.c (sfnt_init_face): Do it. - - * docs/CHANGES: Document it. - -2008-12-22 Steve Grubb - - * builds/unix/ftsystem.c (FT_Stream_Open): Reject zero-length files. - Patch from Savannah bug #25151. - -2008-12-21 Werner Lemberg - - * src/pfr/pfrdrivr.c, src/winfonts/winfnt.c, src/cache/ftcmanag.c, - src/smooth/ftgrays.c, src/base/ftobjc.s, src/sfobjs.c: - s/_Err_Bad_Argument/_Err_Invalid_Argument/. The former is for - errors in the bytecode interpreter only. - -2008-12-21 Werner Lemberg - - * src/base/ftpfr.c (FT_Get_PFR_Metrics): Protect against NULL - arguments. - Fix return value for non-PFR fonts. Both problems reported by Chi - Nguyen . - -2008-12-21 anonymous - - FT_USE_MODULE declares things as: - - extern const FT_Module_Class - - (or similar for C++). However, the actual types of the variables - being declared are often different, e.g., FT_Driver_ClassRec or - FT_Renderer_Class. (Some are, indeed, FT_Module_Class.) - - This works with most C compilers (since those structs begin with an - FT_Module_Class struct), but technically it's undefined behavior. - - To quote the ISO/IEC 9899:TC2 final committee draft, section 6.2.7 - paragraph 2: - - All declarations that refer to the same object or function shall - have compatible type; otherwise, the behavior is undefined. - - (And they are not compatible types.) - - Most C compilers don't reject (or even detect!) code which has this - issue, but the GCC LTO development branch compiler does. (It - outputs the types of the objects while generating .o files, along - with a bunch of other information, then compares them when doing the - final link-time code generation pass.) - - Patch from Savannah bug #25133. - - * src/base/ftinit.c (FT_USE_MODULE): Include variable type. - - * builds/amiga/include/freetype/config/ftmodule.h, - include/freetype/config/ftmodule.h, */module.mk: Updated to declare - pass correct types to FT_USE_MODULE. - -2008-12-21 Hongbo Ni - - * src/autofit/aflatin.c (af_latin_hint_edges), - src/autofit/aflatin2.c (af_latin2_hint_edges), src/autofit/afcjk.c - (af_cjk_hint_edges): Protect against division by zero. This fixes - Savannah bug #25124. - -2008-12-18 Werner Lemberg - - * docs/CHANGES: Updated. - -2008-12-18 Bevan, David - - Provide API for accessing embedding and subsetting restriction - information. - - * include/freetype.h (FT_FSTYPE_INSTALLABLE_EMBEDDING, - FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING, - FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING, FT_FSTYPE_EDITABLE_EMBEDDING, - FT_FSTYPE_NO_SUBSETTING, FT_FSTYPE_BITMAP_EMBEDDING_ONLY): New - macros. - (FT_Get_FSType_Flags): New function declaration. - - * src/base/ftobjs.c (FT_Get_FSType_Flags): New function. - - * src/cid/cidtoken.h, src/type1/t1tokens.h, src/type42/t42parse.c - (t42_keywords): Handle `FSType'. - - * include/freetype/t1tables.h (PS_FontInfoRec): Add `fs_type' field. - -2008-12-17 Werner Lemberg - - * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Don't use internal - macros so that copying the source code into an application works - out of the box. - -2008-12-17 Werner Lemberg - - * include/freetype/ftsynth.h, src/base/ftsynth.c: Move - FT_GlyphSlot_Own_Bitmap to... - * include/freetype/ftbitmap.h, src/base/ftbitmap.c: These files. - - * docs/CHANGES: Document it. - -2008-12-10 Werner Lemberg - - Generalize the concept of `tricky' fonts by introducing - FT_FACE_FLAG_TRICKY to indicate that the font format's hinting - engine is necessary for correct rendering. - - At the same time, slightly modify the behaviour of tricky fonts: - FT_LOAD_NO_HINTING is now ignored. To really force raw loading - of tricky fonts (without hinting), both FT_LOAD_NO_HINTING and - FT_LOAD_NO_AUTOHINT must be used. - - Finally, tricky TrueType fonts always use the bytecode interpreter - even if the patented code is used. - - * include/freetype/freetype.h (FT_FACE_FLAG_TRICKY, FT_IS_TRICKY): - New macros. - - * src/truetype/ttdriver.c (Load_Glyph): Handle new load flags - semantics as described above. - - * src/truetype/ttobjs.c (tt_check_trickyness): New function, using - code of ... - (tt_face_init): This function, now simplified and updated to new - semantics. - - * src/base/ftobjs.c (FT_Load_Glyph): Don't use autohinter for tricky - fonts. - - * docs/CHANGES: Document it. - -2008-12-09 Werner Lemberg - - Really fix Savannah bug #25010: An SFNT font with neither outlines - nor bitmaps can be considered as containing space `glyphs' only. - - * src/truetype/ttpload.c (tt_face_load_loca): Handle the case where - a `glyf' table is missing. - - * src/truetype/ttgload.c (load_truetype_glyph): Abort if we have no - `glyf' table but a non-zero `loca' entry. - (tt_loader_init): Handle missing `glyf' table. - - * src/base/ftobjs.c (FT_Load_Glyph): Undo change 2008-12-05. - - * src/sfnt/sfobjs.c (sfnt_load_face): A font with neither outlines - nor bitmaps is scalable. - -2008-12-05 Werner Lemberg - - * src/autofit/aflatin.c (af_latin_uniranges): Add more ranges. This - fixes Savannah bug #21190 which also provides a basic patch. - -2008-12-05 Werner Lemberg - - * include/freetype/freetype.h (FT_LOAD_ADVANCE_ONLY): Use value - 0x100 instead of 0x10000; the latter value is already occupied by - FT_LOAD_TARGET_LIGHT. Bug reported by James Cloos. - - - Handle SFNT with neither outlines nor bitmaps. This fixes Savannah - bug #25010. - - * src/base/ftobjs.c (FT_Load_Glyph): Reject fonts with neither - outlines nor bitmaps. - - * src/sfnt/sfobjs.c (sfnt_load_face): Don't return an error if there - is no table with glyphs. - - - * src/sfnt/ttload.c (tt_face_lookup_table): Improve debugging - message. - -2008-12-01 Werner Lemberg - - GDEF tables need `glyph_count' too for validation. Problem reported - by Chi Nguyen . - - * src/otvalid/otvgdef.c (otv_GDEF_validate), src/otvalid/otvalid.h - (otv_GDEF_validate), src/otvalid/otvmod.c (otv_validate): Pass - `glyph_count'. - -2008-11-29 Werner Lemberg - - * src/autofit/afcjk.c, src/base/ftoutln.c, src/base/ftrfork.c, - src/bdf/bdfdrivr.c, src/gxvalid/gxvmorx.c, src/otvalid/otvmath.c, - src/pcf/pcfdrivr.c, src/psnames/pstables.h, src/smooth/ftgrays.c, - src/tools/glnames.py, src/truetype/ttinterp.c, src/type1/t1load.c, - src/type42/t42objs.c, src/winfonts/winfnt.c: Fix compiler warnings - (Atari PureC). - -2008-11-29 James Cloos - - * src/type/t1load.c (mm_axis_unmap): Revert previous patch and fix - it correctly by using FT_INT_TO_FIXED (FreeType expects 16.16 values - in the /BlendDesignMap space). - -2008-11-29 James Cloos - - * src/type1/t1load.c (mm_axis_unmap): `blend_points' is FT_Fixed*, - whereas `design_points' is FT_Long*. Therefore, return blend rather - than design points. - -2008-11-27 Werner Lemberg - - * src/cff/cffparse.c (cff_parse_real): Handle more than nine - significant digits correctly. This fixes Savannah bug #24953. - -2008-11-25 Daniel Zimmermann - - * src/base/ftstream.c (FT_Stream_ReadFields): Don't access stream - before the NULL check. From Savannah patch #6681. - -2008-11-24 Werner Lemberg - - Fixes from the gnuwin32 port. - - * src/base/ftlcdfil.c: s/EXPORT/EXPORT_DEF/. - - * src/base/ftotval.c: Include FT_OPENTYPE_VALIDATE_H. - - * src/psaux/psobjs.c (ps_table_add): Check `length'. - -2008-11-15 Werner Lemberg - - * src/truetype/ttinterp.c (tt_default_graphics_state): The default - value for `scan_type' is zero, as confirmed by Greg Hitchcock from - Microsoft. Problem reported by Michal Nowakowski - . - -2008-11-12 Tor Andersson - - * src/cff/cffdrivr.c (cff_get_cmap_info): Initialize `format' field. - This fixes Savannah bug #24819. - -2008-11-08 Werner Lemberg - - * src/sfnt/sfobjs.c (sfnt_load_face): Remove #if 0/#endif guards - since OpenType version 1.5 has been released. - - * include/ttnameid.h (TT_NAME_ID_WWS_FAMILY, - TT_NAME_ID_WWS_SUBFAMILY): New macros for OpenType 1.5. - (TT_URC_COPTIC, TT_URC_VAI, TT_URC_NKO, TT_URC_BALINESE, - TT_URC_PHAGSPA, TT_URC_NON_PLANE_0, TT_URC_PHOENICIAN, - TT_URC_TAI_LE, TT_URC_NEW_TAI_LUE, TT_URC_BUGINESE, - TT_URC_GLAGOLITIC, TT_URC_YIJING, TT_URC_SYLOTI_NAGRI, - TT_URC_LINEAR_B, TT_URC_ANCIENT_GREEK_NUMBERS, TT_URC_UGARITIC, - TT_URC_OLD_PERSIAN, TT_URC_SHAVIAN, TT_URC_OSMANYA, - TT_URC_CYPRIOT_SYLLABARY, TT_URC_KHAROSHTHI, TT_URC_TAI_XUAN_JING, - TT_URC_CUNEIFORM, TT_URC_COUNTING_ROD_NUMERALS, TT_URC_SUNDANESE, - TT_URC_LEPCHA, TT_URC_OL_CHIKI, TT_URC_SAURASHTRA, TT_URC_KAYAH_LI, - TT_URC_REJANG, TT_URC_CHAM, TT_URC_ANCIENT_SYMBOLS, - TT_URC_PHAISTOS_DISC, TT_URC_OLD_ANATOLIAN, TT_URC_GAME_TILES): New - macros for OpenType 1.5. - -2008-11-08 Wenlin Institute - - * src/base/ftobjs.c (ft_glyphslot_free_bitmap): Protect against - slot->internal == NULL. Reported by Graham Asher. - -2008-11-08 Werner Lemberg - - * src/sfnt/sfobjs.c (tt_face_get_name): Modified to return an error - code so that memory allocation problems can be distinguished from - missing table entries. Reported by Graham Asher. - (GET_NAME): New macro. - (sfnt_load_face): Use it. - -2008-11-05 Werner Lemberg - - * devel/ftoption.h, include/freetype/config/ftoption.h - [TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Undefine - TT_CONFIG_OPTION_UNPATENTED_HINTING. This fixes the return value of - `FT_Get_TrueType_Engine_Type' (and makes it work as documented). - Reported in bug #441638 of bugzilla.novell.com. - - * docs/CHANGES: Document it. - -2008-11-03 Werner Lemberg - - * src/type1/t1load.c (parse_subrs): Use an endless loop. There are - fonts (like HELVI.PFB version 003.001, used on OS/2) which define - some `subrs' elements more than once. Problem reported by Peter - Weilbacher . - -2008-10-15 Graham Asher - - * src/sfnt/ttpost.c (tt_post_default_names): Add `const'. - -2008-10-15 David Turner - - * src/truetype/ttgxvar.c (TT_Set_MM_Blend): Disambiguate for - meddlesome compilers' warning against `for ( ...; ...; ...) ;'. - -2008-10-14 Werner Lemberg - - * src/cff/cffobjs.c (cff_face_init): Remove compiler warning. - Suggested by Bram Tassyns in Savannah patch #6651. - -2008-10-12 Graham Asher - - * src/sfnt/sfobjs.c (sfnt_load_face): Fix computation of - `underline_position'. - -2008-10-12 Werner Lemberg - - * docs/CHANGES: Updated. - -2008-10-09 suzuki toshiya - - Fix Savannah bug #24468. - - According to include/freetype/internal/ftobjs.h, the appropriate - type to interchange single character codepoint is FT_UInt32. It - should be distinguished from FT_UInt which can be 16bit integer. - - * src/sfnt/ttcmap.c (tt_cmap4_char_map_linear): Change the type - of the second argument `pcharcode' from FT_UInt* to FT_UInt32*. - (tt_cmap4_char_map_binary): Ditto. - (tt_cmap14_get_nondef_chars): Change the type of return value - from FT_UInt* to FT_UInt32*. - -2008-10-08 John Tytgat - - Fix Savannah bug #24485. - - * src/type1/t1load.c (parse_charstrings): Assure that we always have - a .notdef glyph. - -2008-10-05 suzuki toshiya - - * src/base/ftmac.c: Include FT_TRUETYPE_TAGS_H for multi build. - * builds/mac/ftmac.c: Ditto. - -2008-10-05 suzuki toshiya - - * include/freetype/tttags.h (TTAG_TYP1, TTAG_typ1): Fix definitions. - * src/base/ftobjs.c: Include FT_TRUETYPE_TAGS_H. - -2008-10-05 suzuki toshiya - - * src/sfnt/sfobjs.c (sfnt_open_font): Allow `typ1' version tag in - the beginning of sfnt container. - * src/sfnt/ttload.c (check_table_dir): Return - `SFNT_Err_Table_Missing' when sfnt table directory structure is - correct but essential tables for TrueType fonts (`head', `bhed' or - `SING') are missing. Other errors are returned by - SFNT_Err_Unknown_File_Format. - - * src/base/ftobjs.c (FT_Open_Face): When TrueType driver returns - `FT_Err_Table_Missing', try `open_face_PS_from_sfnt_stream'. It is - enabled only when old mac font support is configured. - -2008-10-04 suzuki toshiya - - * include/freetype/tttags.h (TTAG_CID, TTAG_FOND, TTAG_LWFN, - TTAG_POST, TTAG_sfnt, TTAG_TYP1, TTAG_typ1): New tags to simplify - the repeated calculations of these values in ftobjs.c and ftmac.c. - * src/base/ftobjs.c: Replace all FT_MAKE_TAG by new tags. - * src/base/ftmac.c: Ditto. - * builds/mac/ftmac.c: Ditto. - -2008-10-04 suzuki toshiya - - * src/base/ftobjs.c (ft_lookup_PS_in_sfnt_stream): Remove wrong - initialization of *is_sfnt_cid. - -2008-10-04 Werner Lemberg - - * src/base/ftobjs.c (open_face_PS_from_sfnt_stream): Remove compiler - warnings. - -2008-10-04 suzuki toshiya - - * src/base/ftobjs.c (ft_lookup_PS_in_sfnt): Replaced by... - (ft_lookup_PS_in_sfnt_stream): This. - (open_face_PS_from_sfnt_stream): New function. It checks whether - the stream is sfnt-wrapped Type1 PS font or sfnt-wrapped CID-keyed - font, then try to open a face for given face_index. - (Mac_Read_sfnt_Resource): Replace the combination of - `ft_lookup_PS_in_sfnt' and `open_face_from_buffer' by - `open_face_PS_from_sfnt_stream'. - * src/base/ftmac.c (FT_New_Face_From_SFNT): Ditto. - * builds/mac/ftmac.c (FT_New_Face_From_SFNT): Ditto. - * src/base/ftbase.h: Remove `ft_lookup_PS_in_sfnt' and add - `open_face_PS_from_sfnt_stream'. - -2008-10-03 suzuki toshiya - - * src/base/ftobjs.c (ft_lookup_PS_in_sfnt): Set *is_sfnt_cid to - FALSE if neither `CID ' nor `TYP1' is found in the sfnt container. - -2008-10-03 suzuki toshiya - - * include/freetype/config/ftconfig.h: Define FT_MACINTOSH when SC or - MrC compiler of MPW is used. These compilers do not define the - macro __APPLE__ by themselves. - * builds/unix/ftconfig.in: Ditto. - * builds/vms/ftconfig.h: Ditto. - * src/base/ftbase.c: Use FT_MACINTOSH instead of __APPLE__, to - include ftmac.c if FreeType 2 is built by MPW. - * src/base/ftobjs.c: Use FT_MACINTOSH instead of __APPLE__, to - enable shared functions for ftmac.c if FreeType 2 is built by MPW. - - * builds/mac/ftmac.c: Include ftbase.h. - (memory_stream_close): Removed. - (new_memory_stream): Ditto. - (open_face_from_buffer): Removed. Use the implementation in - ftobjs.c. - (ft_lookup_PS_in_sfnt): Ditto. - - * builds/mac/FreeType.m68k_far.make.txt: Build ftmac.c as an - included part of ftbase.c, to share the functions in ftobjs.c. The - rule compiling ftmac.c separately is removed and the rule copying - ftbase.c from src/base/ftbase.c to builds/mac/ftbase.c is added. - * builds/mac/FreeType.m68k_cfm.make.txt: Ditto. - * builds/mac/FreeType.ppc_classic.make.txt: Ditto. - * builds/mac/FreeType.ppc_carbon.make.txt: Ditto. - -2008-10-02 Bram Tassyns - - * src/cff/cffgload.c (cff_slot_load): Map CID 0 to GID 0. This - fixes Savannah bug #24430. - -2008-10-02 Werner Lemberg - - * builds/freetype.mk (BASE_H): Rename to... - (INTERNAL_H): This. - (FREETYPE_H): Updated. - * src/base/rules.mk: (BASE_OBJ_S, OBJ_DIR/%.$O): Add BASE_H. - * src/bdf/rules.mk (BDF_DRV_H): Add bdferror.h. - * src/cache/rules.mk (CACHE_DRV_H): Add ftccache.h and ftcsbits.h. - * src/pcf/rules.mk (PCF_DRV_H): Add pcfread.h. - * src/raster/rules.mk (RASTER_DRV_H): Add ftmisc.h. - * src/type42/rules.mk (T42_DRV_H): Add t42types.h. - -2008-10-02 suzuki toshiya - - * src/base/ftbase.h: New file to declare the private utility - functions shared by the sources of base modules. Currently, - `ft_lookup_PS_in_sfnt' and `open_face_from_buffer' are declared to - share between ftobjs.c and ftmac.c. - - * src/base/rule.mk: Add ftbase.h. - - * src/base/ftobjs.c: Include ftbase.h. - (memory_stream_close): Build on any platform when old MacOS font - support is enabled. - (new_memory_stream): Ditto. - (open_face_from_buffer): Build on any platform when old MacOS font - support is enabled. The counting of the face in a font file is - slightly different between Carbon-dependent parser and Carbon-free - parser. They are merged with the platform-specific conditional. - (ft_lookup_PS_in_sfnt): Ditto. - - * src/base/ftmac.c: Include ftbase.h. - (memory_stream_close): Removed. - (new_memory_stream): Ditto. - (open_face_from_buffer): Removed. Use the implementation in - ftobjs.c. - (ft_lookup_PS_in_sfnt): Ditto. - -2008-10-02 Werner Lemberg - - * src/sfnt/sfobjs.c (sfnt_load_face): `psnames_error' is only needed - if TT_CONFIG_OPTION_POSTSCRIPT_NAMES is defined. - -2008-10-01 Werner Lemberg - - * src/truetype/ttobjs.c (tt_face_done), src/cff/cffobjs.c - (cff_face_done), src/pfr/pfrobjs.c (pfr_face_done), - src/pcf/pcfdrivr.c (PCF_Face_Done), src/cid/cidobjs.c - (cid_face_done), src/bdf/bdfdrivr. (BDF_Face_Done), - src/sfnt/sfobjs.c (sfnt_face_done): Protect against face == 0. - Reported by Graham Asher. - -2008-09-30 suzuki toshiya - - * src/base/rules.mk: Add conditional source to BASE_SRC, for `make - multi' on Mac OS X. If the macro $(ftmac_c) is defined, - $(BASE_DIR)/$(ftmac_c) is added to BASE_SRC. In a normal build, the - lack of ftmac.c in BASE_SRC is not serious because ftbase.c includes - ftmac.c. - * builds/unix/unix-def.in: Add a macro definition of $(ftmac_c). - * builds/unix/configure.raw: Add procedure to set up appropriate - value of $(ftmac_c) with the consideration of the availability of - Carbon framework. - -2008-09-30 suzuki toshiya - - * src/base/Jamfile: Add target for multi build by jam on Mac OS X. - * src/base/ftobjs.c (FT_New_Face): Fix the condition to include this - function for MPW building. It is synchronized the condition to - include ftmac.c source into ftbase.c. - -2008-09-22 Werner Lemberg - - * src/cff/cffgload.c (CFF_Operator, cff_argument_counts, - cff_decoder_parse_charstrings): Handle (invalid) - `callothersubr' and `pop' instructions. - -2008-09-22 John Tytgat - - Fix Savannah bug #24307. - - * include/freetype/internal/t1types.h (CID_FaceRec), - src/type42/t42types.h (T42_FaceRec): Comment out `afm_data'. - -2008-09-21 Werner Lemberg - - * src/smooth/ftgrays.c (gray_raster_render): Don't dereference - `target_map' if FT_RASTER_FLAG_DIRECT is set. Problem reported by - Stephan T. Lavavej . - -2008-09-21 suzuki toshiya - - * src/otvalid/Jamfile: Add missing target `otvmath' for multi build - by jam. - * src/sfnt/Jamfile: Add missing target `ttmtx' for multi build by - jam. - -2008-09-20 Werner Lemberg - - * src/smooth/ftgrays.c (gray_find_cell): Fix threshold. The values - passed to this function are already `normalized'. Problem reported - by Stephan T. Lavavej . - - * docs/CHANGES: Document it. - -2008-09-20 Werner Lemberg - - * src/base/ftoutln.c: Include FT_INTERNAL_DEBUG_H. - (FT_Outline_Decompose): Decorate with tracing messages. - - * src/smooth/ftgrays.c [DEBUG_GRAYS]: Replace with - FT_DEBUG_LEVEL_TRACE. - [_STANDALONE_ && FT_DEBUG_LEVEL_TRACE]: Include stdio.h and - stdarg.h. - - (FT_TRACE) [_STANDALONE_]: Remove. - (FT_Message) [_STANDALONE_ && FT_DEBUG_LEVEL_TRACE]: New function. - (FT_TRACE5, FT_TRACE7) [_STANDALONE_]: New macros. - (FT_ERROR) [_STANDALONE_]: Updated. - - (gray_hline) [FT_DEBUG_LEVEL_TRACE]: Fix condition. - Use FT_TRACE7. - (gray_dump_cells): Make it `static void'. - (gray_convert_glyph): Use FT_TRACE7. - - (FT_Outline_Decompose) [_STANDALONE_]: Synchronize with version in - ftoutln.c. - - * src/base/ftadvanc.c (FT_Get_Advance, FT_Get_Advances): Use - FT_ERROR_BASE. - - * docs/formats.txt: Updated. - -2008-09-19 suzuki toshiya - - * src/base/ftmac.c: Import sfnt-wrapped Type1 and sfnt-wrapped - CID-keyed font support. - * builds/mac/ftmac.c: Ditto. - -2008-09-19 suzuki toshiya - - * src/base/ftobjs.c (Mac_Read_sfnt_Resource): Fix double free bug in - sfnt-wrapped Type1 and sfnt-wrapped CID-keyed font support code. - `open_face_from_buffer' frees the passed buffer if it cannot open a - face from the buffer, so the caller must not free it. - -2008-09-19 suzuki toshiya - - * src/base/ftobjs.c (Mac_Read_sfnt_Resource): Add initial support - for sfnt-wrapped Type1 and sfnt-wrapped CID-keyed font. - (ft_lookup_PS_in_sfnt): New function to look up `TYP1' or `CID ' - table in sfnt table directory. It is used before loading TrueType - font driver. - - * docs/CHANGES: Add note about the current status of sfnt-wrapped - Type1 and sfnt-wrapped CID-keyed font support. - -2008-09-18 Werner Lemberg - - * src/base/ftsystem.c (FT_Done_Memory): Use ft_sfree directly for - orthogonality (ft_free and ft_sfree could belong to different memory - pools). This fixes Savannah bug #24297. - -2008-09-18 suzuki toshiya - - * src/cff/cffobjs.c (cff_face_init): Use TTAG_OTTO defined - in ttags.h instead of numerical value 0x4F54544FL. - -2008-09-16 Werner Lemberg - - * src/cff/cffgload.h, src/cff/cffgload.c - (cff_decoder_set_width_only): Eliminate function call. - -2008-09-15 George Williams - - Fix Savannah bug #24179, reported by Bram Tassyns. - - * src/type1/t1load.c (mm_axis_unmap, T1_Get_MM_Var): Fix computation - of default values. - -2008-09-15 Werner Lemberg - - * src/tools/glnames.py (main): Surround `ft_get_adobe_glyph_index' - and `ft_adobe_glyph_list' with FT_CONFIG_OPTION_ADOBE_GLYPH_LIST to - prevent unconditional definition. This fixes Savannah bug #24241. - - * src/psnames/pstables.h: Regenerated. - -2008-09-13 Werner Lemberg - - * autogen.sh, builds/unix/configure.raw, - include/freetype/config/ftconfig.h, builds/unix/ftconfig.in: Minor - beautifying. - - * include/freetype/ftadvanc.h, include/freetype/ftgasp.h, - include/freetype/ftlcdfil.h: Protect against FreeType 1. - Some other minor fixes. - - * devel/ftoption.h: Synchronize with - include/freetype/config/ftoption.h. - -2008-09-11 Werner Lemberg - - * src/base/ftbase.c: Include ftadvanc.c. - -2008-09-11 suzuki toshiya - - * builds/unix/ftconfig.in: Duplicate the cpp computation of - FT_SIZEOF_{INT|LONG} from include/freetype/config/ftconfig.h. - (FT_USE_AUTOCONF_SIZEOF_TYPES): New macro. If defined, the cpp - computation is disabled and the statically configured sizes are - used. This fixes Savannah bug #21250. - - * builds/unix/configure.raw: Add the checks to compare the cpp - computation results of the bit length of int and long versus the - sizes detected by running `configure'. If the results are - different, FT_USE_AUTOCONF_SIZEOF_TYPES is defined to prioritize the - results. - New option --{enable|disable}-biarch-config is added to define or - undefine FT_USE_AUTOCONF_SIZEOF_TYPES manually. - -2008-09-05 suzuki toshiya - - * builds/unix/configure.raw: Clear FT2_EXTRA_LIBS when Carbon or - ApplicationService framework is missing. Although this value is not - used in building of FreeType2, it is written in `freetype2.pc' and - `freetype-config'. - -2008-09-01 david turner - - * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Accept a negative cmap - index to mean `use default cached FT_Face's charmap'. This fixes - Savannah bug #22625. - * include/freetype/ftcache.h: Document it. - - - Make FT_MulFix an inlined function. This is done to speed up - FreeType a little (on x86 3% when loading+hinting, 10% when - rendering, ARM savings are more important though). Disable this by - undefining FT_CONFIG_OPTION_INLINE_MULFIX. - - Use of assembler code can now be controlled with - FT_CONFIG_OPTION_NO_ASSEMBLER. - - * include/freetype/config/ftconfig.h, builds/unix/ftconfig.in - [!FT_CONFIG_OPTION_NO_ASSEMBLER] (FT_MulFix_arm): New assembler - implementation. - [!FT_CONFIG_OPTION_NO_ASSEMBLER] (FT_MulFix_i386): Assembler - implementation taken from `ftcalc.c'. - [!FT_CONFIG_OPTION_NO_ASSEMBLER] (FT_MULFIX_ASSEMBLER): New macro - which is defined to the platform-specific assembler implementation - of FT_MulFix. - [FT_CONFIG_OPTION_INLINE_MULFIX && FT_MULFIX_ASSEMBLER] - (FT_MULFIX_INLINED): New macro. - - * include/freetype/config/ftoption.h (FT_CONFIG_OPTION_NO_ASSEMBLER, - FT_CONFIG_OPTION_INLINE_MULFIX): New macros. - - * include/freetype/freetype.h: Updated to handle FT_MULFIX_INLINED. - - * src/base/ftcalc.c: Updated to use FT_MULFIX_ASSEMBLER and - FT_MULFIX_INLINED. - - - Add a new header named FT_ADVANCES_H declaring some new APIs to - extract the advances of one or more glyphs without necessarily - loading their outlines. Also provide `fast loaders' for the - TrueType, Type1, and CFF font drivers (more to come later). - - * src/base/ftadvanc.c, include/freetype/ftadvanc.h: New files. - - * include/freetype/config/ftheader.h (FT_ADVANCES_H): New macro. - * include/freetype/freetype.h (FT_LOAD_ADVANCE_ONLY): New macro. - - * include/freetype/internal/ftdriver.h (FT_Face_GetAdvancesFunc): - `flags' and `advances' are now of type `FT_UInt' and `FT_Fixed', - respectively. - - * src/base/Jamfile (_sources), src/base/rules.mk (BASE_SRC): Add - ftadvanc.c. - - * src/cff/cffdrivr.c (cff_get_advances): New function. - (cff_driver_class): Register it. - - * src/cff/cffgload.c (cff_decoder_set_width_only): New function. - (cff_decoder_parse_charstrings): Handle `width_only'. - (cff_slot_load): Handle FT_LOAD_ADVANCE_ONLY. - - * src/cff/cffgload.h (cff_decoder): New element `width_only'. - (cff_decoder_set_width_only): New declaration. - - * src/truetype/ttdriver.c (tt_get_advances): New function. - (tt_driver_class): Register it. - - * src/truetype/ttgload.c (Get_HMetrics, Get_VMetrics): Renamed to... - (TT_Get_HMetrics, TT_Get_VMetrics): This. - Update callers. - * src/truetype/ttgload.h: Declare them. - - * src/type1/t1gload.h, src/type1/t1gload.c (T1_Get_Advances): New - function. - * src/type1/t1driver.c (t1_driver_class): Register T1_Get_Advances. - - - Add checks for minimum version of the `autotools' stuff. - - * autogen.sh: Implement it. - (get_major_version, get_minor_version, get_patch_version, - compare_to_minimum_version, check_tool_version): New auxiliary - functions. - - * README.CVS: Document it. - -2008-08-29 suzuki toshiya - - * src/sfnt/sfobjs.c (sfnt_open_font): Use TTAG_OTTO defined in - ttags.h instead of FT_MAKE_TAG( 'O', 'T', 'T', 'O' ). - -2008-08-28 Werner Lemberg - - * src/type1/t1load.c (parse_encoding): Protect against infinite - loop. This fixes Savannah bug #24150 (where a patch has been posted - too). - -2008-08-23 Werner Lemberg - - * src/type/t1afm.c (compare_kern_pairs), src/pxaux/afmparse.c - (afm_compare_kern_pairs): Fix comparison. This fixes Savannah bug - #24119. - -2008-08-19 suzuki toshiya - - * src/base/ftobjs.c (FT_Stream_New): Initialize *astream always, - even if passed library or arguments are invalid. This fixes a bug - that an uninitialized stream is freed when an invalid library handle - is passed. Originally proposed by Mike Fabian, 2008/08/18 on - freetype-devel. - (FT_Open_Face): Ditto (stream). - (load_face_in_embedded_rfork): Ditto (stream2). - -2008-08-18 suzuki toshiya - - * src/base/ftmac.c: Add a fallback to guess the availability of the - `ResourceIndex' type. It is used when built without configure - (e.g., a build with Jam). - * builds/mac/ftmac.c: Ditto. - * builds/unix/configure.raw: Set HAVE_TYPE_RESOURCE_INDEX to 1 or 0 - explicitly, even if `ResourceIndex' is unavailable. - -2008-08-18 suzuki toshiya - - * builds/unix/configure.raw: In checking of Mac OS X features, - all-in-one header file `Carbon.h' is replaced by the minimum - header file `CoreServices.h', similar to current src/base/ftmac.c. - -2008-08-18 suzuki toshiya - - * src/sfnt/ttcmap.c (tt_cmap2_validate): Skip the validation of - sub-header when its code_count is 0. Many Japanese Dynalab fonts - include such an empty sub-header (code_count == 0, first_code == 0 - delta == 0, but offset != 0) as the second sub-header in SJIS cmap. - -2008-08-04 Werner Lemberg - - * src/type1/t1tokens.h: Handle `ForceBold' keyword. This fixes - Savannah bug #23995. - - * src/cid/cidload.c (parse_expansion_factor): New callback function. - (cid_field_records): Use it for `ExpansionFactor'. - * src/cod/cidtoken.h: Handle `ForceBold' keyword. - Don't handle `ExpansionFactor'. - -2008-08-04 Bram Tassyns - - * src/cff/cffparse.c (cff_parse_fixed_scaled): Fix thinko which - resulted in incorrect scaling. This fixes Savannah bug #23973. - -2008-08-04 Werner Lemberg - - Be more tolerant w.r.t. invalid entries in SFNT table directory. - - * src/sfnt/ttload.c (check_table_dir): Ignore invalid entries and - adjust table count. - Add more trace messages. - (tt_face_load_font_dir): Updated. - -2008-07-30 Werner Lemberg - - * src/cff/cffgload.c (cff_decoder_parse_charstrings): No longer - assume that the first argument on the stack is the bottom-most - element. Two reasons: - - o According to people from Adobe it is missing in the Type 2 - specification that pushing of additional, superfluous arguments - on the stack is prohibited. - - o Acroread in general handles fonts differently, namely by popping - the number of arguments needed for a particular operand (as a PS - interpreter would do). In case of buggy fonts this causes a - different interpretation which of the elements on the stack are - superfluous and which not. - - Since there are CFF subfonts (embedded in PDFs) which rely on - Acroread's behaviour, FreeType now does the same. - -2008-07-27 Werner Lemberg - - Add extra mappings for `Tcommaaccent' and `tcommaaccent'. This - fixes Savannah bug #23940. - - * src/psnames/psmodule.c (WGL_EXTRA_LIST_SIZE): Rename to... - (EXTRA_GLYPH_LIST_SIZE): This. - Increase by 2. - (ft_wgl_extra_unicodes): Rename to... - (ft_extra_glyph_unicodes): This. - Add two code values. - (ft_wgl_extra_glyph_names): Rename to... - (ft_extra_glyph_names): This. - Add two glyphs. - (ft_wgl_extra_glyph_name_offsets): Rename to... - (ft_extra_glyph_name_offsets): This. - Add two offsets. - - (ps_check_wgl_name, ps_check_wgl_unicode): Rename to... - (ps_check_extra_glyph_name, ps_check_extra_glyph_unicode): This. - Updated. - (ps_unicodes_init): Updated. - -2008-07-26 Werner Lemberg - - * src/cff/cffgload.c (cff_decoder_prepare, - cff_decoder_parse_charstrings): Improve debug output. - -2008-07-22 Martin McBride - - * src/sfnt/ttcmap.c (tt_cmap4_validate, tt_cmap4_char_map_linear, - tt_cmap4_char_map_binary): Handle fonts which treat the last segment - specially. According to the specification, such fonts would be - invalid but acroread accepts them. - -2008-07-16 Jon Foster - - * src/pfr/pfrdrivr.c (pfr_get_advance): Fix off-by-one error. - - * src/base/ftcalc.c (FT_MulFix): Fix portability issue. - - * src/sfnt/ttpost.c (MAC_NAME) [!FT_CONFIG_OPTION_POSTSCRIPT_NAMES]: - Fix compiler warning. - -2008-07-16 Werner Lemberg - - Handle CID-keyed fonts wrapped in an SFNT (with cmaps) correctly. - - * src/cff/cffload.c (cff_font_load): Pass `pure_cff'. - Invert sids table only if `pure_cff' is set. - * src/cff/cffload.h: Udpated. - - * src/cff/cffobjs.c (cff_face_init): Updated. - Set FT_FACE_FLAG_CID_KEYED only if pure_cff is set. - - * docs/CHANGES: Updated. - -2008-07-09 Werner Lemberg - - * src/truetype/ttpload.c (tt_face_load_loca): Handle buggy fonts - where num_locations < num_glyphs. Problem reported by Ding Li. - -2008-07-05 Werner Lemberg - - Since FreeType uses `$(value ...)', we now need GNU make 3.80 or - newer. This fixes Savannah bug #23648. - - * configure: zsh doesn't like ${1+"$@"}. - Update needed GNU make version. - * builds/toplevel.mk: Check for `$(eval ...)'. - * docs/INSTALL.GNU, docs/INSTALL.CROSS, docs/INSTALL.UNIX: Document - it. - -2008-07-04 Werner Lemberg - - * src/raster/ftraster.c (Draw_Sweep): If span is smaller than one - pixel, only check for dropouts if neither start nor end point lies - on a pixel center. This fixes Savannah bug #23762. - -2008-06-29 Werner Lemberg - - * Version 2.3.7 released. - ========================= - - - Tag sources with `VER-2-3-7'. - - * docs/CHANGES, docs/VERSION.DLL: Update documentation and bump - version number to 2.3.7. - - * README, Jamfile (RefDoc), builds/win32/visualc/index.html, - builds/win32/visualc/freetype.dsp, - builds/win32/visualc/freetype.vcproj, - builds/win32/visualce/index.html, - builds/win32/visualce/freetype.dsp, - builds/win32/visualce/freetype.vcproj: s/2.3.6/2.3.7/, s/236/237/. - - * include/freetype/freetype.h (FREETYPE_PATCH): Set to 7. - - * builds/unix/configure.raw (version_info): Set to 9:18:3. - - * docs/release: Updated. - -2008-06-28 Werner Lemberg - - * src/ftglyph.c (FT_Matrix_Multiply, FT_Matrix_Invert): Move to... - * src/ftcalc.c: Here. This fixes Savannah bug #23729. - -2008-06-27 Werner Lemberg - - * src/raster/ftraster.c (Vertical_Sweep_Drop, Horizontal_Sweep_Drop, - Horizontal_Gray_Sweep_Drop): Test for intersections which - degenerate to a single point can be ignored; this has been confirmed - by Greg Hitchcock from Microsoft. (This was commented out code.) - -2008-06-26 Werner Lemberg - - Improve navigation in API reference. - - * src/tools/docmaker/tohtml.py (html_header_3): Renamed to... - (html_header_6): This. - (html_header_3, html_header_3i, html_header_4, html_header_5, - html_header_5t): New strings. - (toc_footer_start, toc_footer_end): New strings. - (HtmlFormatter::html_header): Updated. - (HtmlFormatter::html_index_header, HtmlFormatter::html_toc_header): - New strings. - (HtmlFormatter::index_enter): Use `html_index_header'. - (HtmlFormatter::index_exit): Print `html_footer'. - (HtmlFormatter::toc_enter): Use `html_toc_header'. - (HtmlFormatter::toc_exit): Print proper footer. - - Convert ~ to non-breakable space. - - * src/tools/docmaker/tohtml.py (make_html_para): Implement it. - Update header files accordingly. - -2008-06-24 suzuki toshiya - - * builds/unix/configure.raw: Check type `ResourceIndex' explicitly - and define HAVE_TYPE_RESOURCE_INDEX if it is defined. Mac OS X 10.5 - bundles 10.4u SDK with MAC_OS_X_VERSION_10_5 macro but without - ResourceIndex type definition. The macro does not inform the type - availability. - * src/base/ftmac.c: More parentheses are inserted to clarify the - conditionals to disable legacy APIs in `10.5 and later' cases. If - HAVE_TYPE_RESOURCE_INDEX is not defined, ResourceIndex is defined. - -2008-06-24 Werner Lemberg - - * src/truetype/ttinterp.c (Ins_SCANTYPE): Don't check rendering - mode. - - * src/raster/ftraster.c (Render_Glyph, Render_Gray_Glyph, - Draw_Sweep): No-dropout mode is value 2, not value 0. - (Draw_Sweep): Really skip dropout handling for no-dropout mode. - -2008-06-24 Werner Lemberg - - * src/psaux/psobjs.c (t1_builder_close_contour): Don't add contour - if it consists of one point only. Based on a patch from Savannah - bug #23683 (from John Tytgat). - -2008-06-22 Werner Lemberg - - * src/truetype/ttgload.c (TT_Load_Glyph): Protect bytecode stuff - with IS_HINTED. - - * docs/CHANGES: Updated. - -2008-06-22 suzuki toshiya - - * builds/unix/configure.raw: If CFLAGS has `-isysroot XXX' option - but LDFLAGS does not, import it to LDFLAGS. The option is used to - specify non-default SDK on Mac OS X (e.g., universal binary SDK for - Mac OS X 10.4 on PowerPC platform). Although Apple TechNote 2137 - recommends to add the option only to CFLAGS, LDFLAGS should include - it because libfreetype.la is built with -no-undefined. This fixes a - bug reported by Ryan Schmidt in MacPorts, - http://trac.macports.org/ticket/15331. - -2008-06-21 Werner Lemberg - - Enable access to the various dropout rules of the B&W rasterizer. - Pass dropout rules from the TT bytecode interpreter to the - rasterizer. - - * include/freetype/ftimage.h (FT_OUTLINE_SMART_DROPOUTS, - FT_OUTLINE_EXCLUDE_STUBS): New flags for for FT_Outline. - - * src/raster/ftraster.c (Vertical_Sweep_Drop, Horizontal_Sweep_Drop, - Horizontal_Gray_Sweep_Drop): Use same mode numbers as given in the - OpenType specification. - Fix mode 4 computation. - (Render_Glyph, Render_Gray_Glyph): Handle new outline flags. - - * src/truetype/ttgload.c (TT_Load_Glyph) Convert scan conversion - mode to FT_OUTLINE_XXX flags. - - * src/truetype/ttinterp.c (Ins_SCANCTRL): Enable ppem check. - -2008-06-19 Werner Lemberg - - * src/cff/cffobjs.c (cff_face_init): Compute final - `dict->units_per_em' value before assigning it to - `cffface->units_per_EM'. Otherwise, CFFs without subfonts are - scaled incorrectly if the font matrix is non-standard. This fixes - Savannah bug #23630. - - * docs/CHANGES: Updated. - -2008-06-19 Werner Lemberg - - * src/type/t1objs.c (T1_Face_Init): Slightly improve algorithm fix - from 2008-06-19. - -2008-06-18 Werner Lemberg - - * src/type/t1objs.c (T1_Face_Init): Fix change from 2008-03-21. - Reported by Peter Weilbacher . - - * docs/CHANGES: Updated. - -2008-06-15 George Williams - - * src/otvalid/otvgpos.c (otv_MarkBasePos_validate): Set - `valid->extra2' to 1. This is undocumented in the OpenType 1.5 - specification. - -2008-06-15 Werner Lemberg - - * src/base/ftcalc.c (FT_MulFix) : Protect registers correctly - from clobbering. Patch from Savannah bug report #23556. - - * docs/CHANGES: Document it. - -2008-06-10 Werner Lemberg - - * autogen.sh: Add option `--install' to libtoolize. - -2008-06-10 Werner Lemberg - - * Version 2.3.6 released. - ========================= - - - Tag sources with `VER-2-3-6'. - - * docs/CHANGES, docs/VERSION.DLL: Update documentation and bump - version number to 2.3.6. - - * README, Jamfile (RefDoc), builds/win32/visualc/index.html, - builds/win32/visualc/freetype.dsp, - builds/win32/visualc/freetype.vcproj, - builds/win32/visualce/index.html, - builds/win32/visualce/freetype.dsp, - builds/win32/visualce/freetype.vcproj: s/2.3.5/2.3.6/, s/235/236/. - - * include/freetype/freetype.h (FREETYPE_PATCH): Set to 6. - - * builds/unix/configure.raw (version_info): Set to 9:17:3. - - - * include/freetype/internal/psaux.h (T1_BuilderRec): Remove `scale_x' - and `scale_y'. - * src/cff/cffgload.h (CFF_Builder): Remove `scale_x' and `scale_y'. - - - * src/cff/cffparse.c: Include FT_INTERNAL_DEBUG_H. - * src/cff/cffobjs.h: Include FT_INTERNAL_POSTSCRIPT_HINTS_H. - -2008-06-10 Werner Lemberg - - * src/base/ftobjs.c (open_face): Check `clazz->init_face' and - `clazz->done_face'. - -2008-06-09 VaDiM - - Support debugging on WinCE. From Savannah patch #6536; this fixes - bug #23497. - - * builds/win32/ftdebug.c (OutputDebugStringEx): New function/macro - as a replacement for OutputDebugStringA (which WinCE doesn't have). - Update all callers. - (ft_debug_init) [_WIN32_CE]: WinCE apparently doesn't have - environment variables. - -2008-06-09 Werner Lemberg - - * README.CVS: Updated. - - * builds/unix/configure.raw, builds/unix/freetype-config.in: Updated - for newer versions of autoconf and friends. - -2008-06-08 Werner Lemberg - - * src/type1/t1parse.h (T1_ParserRec): Make `base_len' and - `private_len' unsigned. - - * src/type1/t1parse.c (read_pfb_tag): Make `asize' unsigned and read - it as such. - (T1_New_Parser, T1_Get_Private_Dict): Make `size' unsigned. - - - * src/base/ftstream.c (FT_Stream_Skip): Reject negative values. - - - * src/type1/t1load.c (parse_blend_design_positions): Check `n_axis' - for sane value. - Fix typo. - - - * src/psaux/psobjs.c (ps_table_add): Check `idx' correctly. - - - * src/truetype/ttinterp (Ins_SHC): Use BOUNDS() to check - `last_point'. - - - * src/sfnt/ttload.c (tt_face_load_max_profile): Limit - `maxTwilightPoints'. - -2008-06-06 Werner Lemberg - - * src/truetype/ttinterp.c (Ins_IP): Handle case `org_dist == 0' - correctly. This fixes glyphs `t' and `h' of Arial Narrow at 12ppem. - -2008-06-03 Werner Lemberg - - * include/freetype/ftcache.h (FTC_FaceID): Change type back to - FT_Pointer. Reported by Ian Britten . - -2008-06-02 Werner Lemberg - - Emit header info for defined FreeType objects in reference. - - * src/tools/docmaker/content.py (re_header_macro): New regexp. - (ContentProcessor::__init__): Initialize new dictionary `headers'. - (DocBlock::__init__): Collect macro header definitions. - - * src/tools/docmaker/tohtml.py (header_location_header, - header_location_footer): New strings. - (HtmlFormatter::__init__): Pass `headers' dictionary. - (HtmlFormatter::print_html_field): Don't emit paragraph tags. - (HtmlFormatter::print_html_field_list): Emit empty paragraph. - (HtmlFormatter::block_enter): Emit header info. - -2008-06-01 Werner Lemberg - - * include/freetype/config/ftheader.h (FT_UNPATENTED_HINTING_H, - FT_INCREMENTAL_H): Added. - -2008-05-28 Werner Lemberg - - * src/tools/docmaker/sources.py (SourceBlock::__init__): While - looking for markup tags, return immediately as soon a single one is - found. - -2008-05-28 Werner Lemberg - - * src/truetype/ttinterp.c (Ins_MD): The MD instruction also uses - original, unscaled input values. Confirmed by Greg Hitchcock from - Microsoft. - -2008-05-27 Werner Lemberg - - * src/tools/docmaker/tohtml.py (block_footer_start, - block_footer_middle): Beautify output. - -2008-05-25 Werner Lemberg - - * src/raster/ftraster.c (fc_black_render): Return 0 when we are - trying to render into a zero-width/height bitmap, not an error code. - - * src/truetype/ttgload.c (load_truetype_glyph): Move initialization - of the graphics state for subglyphs to... - (TT_Hint_Glyph): This function. - Hinting instructions for a composite glyph apparently refer to the - just hinted subglyphs, not the unhinted, unscaled outline. This - seems to fix Savannah bugs #20973 and (at least partially) #23310. - -2008-05-20 suzuki toshiya - - * src/base/ftmac.c (FT_New_Face_From_Suitcase): Check if valid - `aface' is returned by FT_New_Face_From_FOND(). The patch was - proposed by an anonymous reporter of Savannah bug #23204. - -2008-05-18 Werner Lemberg - - * src/pshinter/pshalgo.c (ps_hints_apply): Reset scale values after - correction for pixel boundary. Without this patch, the effect can - be cumulative under certain circumstances, making glyphs taller and - taller after each call. This fixes Savannah bug #19976. - -2008-05-18 Werner Lemberg - - * src/base/ftdebug.c (FT_Message, FT_Panic): Send output to stderr. - This fixes Savannah bug #23280. - - * docs/CHANGES: Updated. - -2008-05-18 David Turner - - * src/psnames/psmodule.c (ft_wgl_extra_unicodes, - ft_wgl_extra_glyph_names, ft_wgl_extra_glyph_name_offsets, - ps_check_wgl_name, ps_check_wgl_unicode): Use `static' to make - declarations non-global. - - * src/type1/t1load.c: Add missing comment. - -2008-05-17 Sam Hocevar - - * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Handle zero-contour - glyphs correctly. Patch from Savannah bug #23277. - -2008-05-16 Werner Lemberg - - * docs/CHANGES: Updated. - -2008-05-16 Sergey Tolstov - - Improve support for WGL4 encoded fonts. - - * src/psnames/psmodule.c (WGL_EXTRA_LIST_SIZE): New macro. - (ft_wgl_extra_unicodes, ft_wgl_extra_glyph_names, - ft_wgl_extra_glyph_name_offsets): New arrays. - (ps_check_wgl_name, ps_check_wgl_unicode): New functions. - (ps_unicodes_init): Use them to add additional Unicode mappings. - -2008-05-15 Werner Lemberg - - * src/psaux/t1decode.c (t1_decoder_parse_charstrings) - : `closepath' without a path is a no-op, not an error - (cf. the PS reference manual). - - Reported by Martin McBride. - -2008-05-15 Werner Lemberg - - * builds/toplevel.mk (CONFIG_GUESS, CONFIG_SUB): Updated. - -2008-05-15 Werner Lemberg - - * src/type1/t1load.c (parse_subrs): Accept fonts with a subrs array - which contains a single but empty entry. This is technically - invalid (since it must end with `return'), but... - - Reported by Martin McBride. - -2008-05-14 Werner Lemberg - - Finish fix of scaling bug of CID-keyed CFF subfonts. - - * include/freetype/internal/ftcalc.h, src/base/ftcalc.c - (FT_Matrix_Multiply_Scaled, FT_Vector_Transform_Scaled): New - functions. - - * src/cff/cffobjs.h (CFF_Internal): New struct. It is used to - provide global hinting data for both the top-font and all subfonts - (with proper scaling). - - * src/cff/cffobjs.c (cff_make_private_dict): New function, using - code from `cff_size_init'. - (cff_size_init, cff_size_done, cff_size_select, cff_size_request): - Use CFF_Internal and handle subfonts. - (cff_face_init): Handle top-dict and subfont matrices correctly; - apply some heuristic in case of unlikely matrix concatenation - results. This has been discussed with people from Adobe (thanks - goes mainly to David Lemon) who confirm that the CFF specs are fuzzy - and not correct. - - * src/cff/cffgload.h (cff_decoder_prepare): Add `size' argument. - - * src/cff/cffgload.c (cff_builder_init): Updated. - (cff_decoder_prepare): Handle hints globals for subfonts. - Update all callers. - (cff_slot_load): Handling scaling of subfonts properly. - - * src/cff/cffparse.c (cff_parse_fixed_dynamic): New function. - (cff_parse_font_matrix): Use it. - - * src/cff/cfftypes.h (CFF_FontDictRec): Make `units_per_em' - FT_ULong. - - * docs/CHANGES: Document it. - -2008-05-13 Werner Lemberg - - * src/winfonts/winfnt.c (fnt_face_get_dll_font, FNT_Face_Init): - Handle case `face_index < 0'. - * docs/CHANGES: Document it. - -2008-05-04 Werner Lemberg - - First steps to fix the scaling bug of CID-keyed CFF subfonts, - reported by Ding Li on 2008/03/28 on freetype-devel. - - * src/base/cff/cffparse.c (power_tens): New array. - (cff_parse_real): Rewritten to introduce a fourth parameter which - returns the `scaling' of the real number so that we have no - precision loss. This is not used yet. - Update all callers. - (cff_parse_fixed_thousand): Replace with... - (cff_parse_fixed_scaled): This function. Update all callers. - -2008-05-03 Werner Lemberg - - * src/base/ftobjs.c (FT_Load_Glyph): Call the auto-hinter without - transformation since it recursively calls FT_Load_Glyph. This fixes - Savannah bug #23143. - -2008-04-26 Werner Lemberg - - * include/freetype/internal/psaux.h (T1_BuilderRec): Mark `scale_x' - and `scale_y' as obsolete since they aren't used. - * src/psaux/psobjs.c (t1_builder_init): Updated. - - * src/cff/cffgload.h (CFF_Builder): Mark `scale_x' and `scale_y' as - obsolete since they aren't used. - * src/cff/cffgload.c (cff_builder_init): Updated. - -2008-04-14 Werner Lemberg - - * src/pcf/pcfdrivr.c (PCF_Face_Init): Protect call to - `FT_Stream_OpenLZW' with `FT_CONFIG_OPTION_USE_LZ'. From Savannah - bug #22909. - -2008-04-13 Werner Lemberg - - * src/psaux/psconv.c (PS_Conv_ToFixed): Increase precision if - integer part is zero. - -2008-04-01 Werner Lemberg - - Fix compilation with g++ 4.1 (with both `single' and `multi' - targets). - - * src/base/ftobjs.c (FT_Open_Face): Don't define a variable in block - which is crossed by a `goto'. - - * src/otvalid/otvalid.h (otv_MATH_validate): Add prototype. - -2008-03-31 Werner Lemberg - - Fix support for subsetted CID-keyed CFFs. - - * include/freetype/freetype.h (FT_FACE_FLAG_CID_KEYED, - FT_IS_CID_KEYED): New macros. - - * src/cff/cffobjs.c (cff_face_init): Set number of glyphs to the - maximum CID value in CID-keyed CFFs. - Handle FT_FACE_FLAG_CID_KEYED flag. - - * docs/CHANGES: Document it. - - - Fix CFF font matrix calculation and improve precision. - - * src/cff/cffparse.c (cff_parse_real): Increase precision if integer - part is zero. - (cff_parse_font_matrix): Simplify computation of `units_per_em'; - this prevents overflow also. - - - Support FT_Get_CID_Registry_Ordering_Supplement for PS CID fonts. - - * src/cid/cidriver.c: Include FT_SERVICE_CID_H. - (cid_get_ros): New function. - (cid_service_cid_info): New service structure. - (cid_services): Register it. - -2008-03-23 Werner Lemberg - - Adjustments for Visual C++ 8.0, as reported by Rainer Deyke. - - * builds/compiler/visualc.mk (CFLAGS): Remove /W5. - (ANSIFLAGS): Add _CRT_SECURE_NO_DEPRECATE. - -2008-03-21 Laurence Darby - - * src/type1/t1objs.c (T1_Face_Init): Use `/Weight'. Patch from - Savannah bug #22675. - -2008-03-13 Derek Clegg - - * src/truetype/ttgxvar.c (TT_Get_MM_Var): Fix named style loop. - Patch from Savannah bug #22541. - -2008-03-03 Masatoshi Kimura - - * src/sfnt/ttcmap.c (tt_cmap14_char_map_nondef_binary, - tt_cmap14_find_variant): Return correct value. - (tt_cmap14_variant_chars): Fix check for `di'. - -2008-02-29 Wermer Lemberg - - * docs/CHANGES: Updated. - -2008-02-29 Wolf - - Add build support for symbian platform. From Savannah bug #22440. - - * builds/symbian/*: New files. - -2008-02-21 suzuki toshiya - - * src/base/ftmac.c (parse_fond): Fix a bug of PostScript font name - synthesis. For any face of a specified FOND, always the name for - the first face was used. Except of a FOND that refers multiple - Type1 font files, wrong synthesized font names are not used at all, - so this is an invisible bug. A few limit checks are added too. - - * builds/mac/ftmac.c: Ditto. - -2008-02-21 suzuki toshiya - - * builds/unix/configure.raw: Split compiler option to link Carbon - frameworks to one option for CoreServices framework and another - option for ApplicationServices framework. The split options can be - managed by GNU libtool to avoid unrequired duplication when FreeType - is linked with other applications. Suggested by Daniel Macks, - Savannah bug #22366. - -2008-02-18 Victor Stinner - - * src/truetype/ttinterp.c (Ins_IUP): Check number of points. Fix - from Savannah bug #22356. - -2008-02-17 Jonathan Blow - - * src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph): - Check for valid callback pointers. - -2008-02-15 suzuki toshiya - - * src/base/ftmac.c (FT_New_Face_From_SFNT): Check the sfnt resource - handle by its value instead of ResError(), fix provided by Deron - Kazmaier. According to the Resource Manager Reference, - GetResource(), Get1Resource(), GetNamedResource(), - Get1NamedResource() and RGetResource() set noErr but return NULL - handle when they can not find the requested resource. These - functions never return undefined values, so it is sufficient to - check if the handle is not NULL. - - * builds/mac/ftmac.c (FT_New_Face_From_SFNT): Ditto. - -2008-02-14 suzuki toshiya - - * src/base/ftbase.c: is replaced by "ftmac.c" as other - inclusion styles. Now it always includes src/base/ftmac.c; - builds/mac/ftmac.c is never included in any configuration. - - * builds/unix/configure.raw: Print warning if configure is executed - with options to specify Carbon functionalities explicitly. - - * docs/INSTALL.MAC: Note that legacy builds/mac/ftmac.c is not - included automatically and manual replacement is required. - -2008-02-11 Werner Lemberg - - * builds/modules.mk (CLOSE_MODULE, REMOVE_MODULE), builds/detect.mk - (dos_setup), builds/freetype.mk (clean_project_dos, - distclean_project_dos): Don't use \ but $(SEP). Reported by Duncan - Murdoch. - -2008-01-18 Sylvain Pasche - - * src/base/ftlcdfil.c (_ft_lcd_filter_legacy): Updated comment to - mention intra-pixel algorithm. - - * include/freetype/freetype.h (FT_Render_Mode): Mention that - FT_Library_SetLcdFilter can be used to reduce fringes. - -2008-01-16 Werner Lemberg - - * src/raster/ftraster.c (ft_black_render): Check `outline' before - using it. Reported by Allan Yang. - -2008-01-12 Werner Lemberg - - * src/raster/ftraster.c (FT_CONFIG_OPTION_5_GRAY_LEVELS): Remove. - -2008-01-12 Allan Yang, Jian Hua - SH - - * src/raster/ftraster.c (ft_black_init) - [FT_RASTER_OPTION_ANTI_ALIASING]: Fix compilation. - -2008-01-10 Werner Lemberg - - * src/truetype/ttgload.c (load_truetype_glyph): Handle the case - where the number of contours in a simple glyph is zero (and which - does contain an entry in the `glyf' table). This fixes Savannah bug - #21990. - -2008-01-04 suzuki toshiya - - Formatting suggested by Sean McBride. - - * builds/mac/ftmac.c: Formatting (tab expanded). - * src/autofit/afindic.c: Ditto. - * src/base/ftcid.c: Ditto. - * src/base/ftmac.c: Ditto. - -2007-12-30 Werner Lemberg - - * src/smooth/ftgrays.c (gray_raster_render): Check `outline' - correctly. - -2007-12-21 suzuki toshiya - - Improvement of POSIX resource-fork accessor to load unsorted - references in a resource. In HelveLTMM (resource-fork PostScript - Type1 font bundled with Mac OS X since 10.3.x), the appearance order - of PFB chunks is not sorted; sorting the chunks by reference IDs is - required. - - * include/freetype/internal/ftrfork.h (FT_RFork_Ref): New structure - type to store a pair of reference ID and offset to the chunk. - - * src/base/ftrfork.c (ft_raccess_sort_ref_by_id): New function to - sort FT_RFork_Ref by their reference IDs. - - (FT_Raccess_Get_DataOffsets): Returns an array of offsets that is - sorted by reference ID. - -2007-12-14 Werner Lemberg - - * src/cff/cffparse.c (cff_parse_real): Don't apply `power_ten' - division too early; otherwise the most significant digit(s) of the - final result are lost as the value is truncated to an integer. This - fixes Savannah bug #21794 (where the patch has been posted too). - -2007-12-06 Fix <4d876b82@gmail.com> - - Pass options from one configure script to another as-is (not - expanded). This is needed for options like - --includedir='${prefix}/include'. - - * builds/unix/detect.mk, configure: Prevent argument expansion in - call to the (real) `configure' script. - -2007-12-06 Werner Lemberg - - * src/truetype/ttgload.c (load_truetype_glyph): Fix compilation if - TT_USE_BYTECODE_INTERPRETER isn't defined. - -2007-12-06 Werner Lemberg - - There exist CFFs which contain opcodes for the Type 1 operators - `hsbw' and `closepath' which are both invalid in Type 2 charstrings. - However, it doesn't harm to support them. - - * src/cff/cffgload.c (CFF_Operator): Add `cff_op_hsbw' and - `cff_op_closepath.' - (cff_argument_counts): Ditto. - - (cff_decoder_parse_charstrings): Handle Type 1 opcodes 9 (closepath) - and 13 (hsbw) which are invalid in Type 2 charstrings. - -2007-12-06 suzuki toshiya - - * src/base/ftrfork.c (raccess_guess_darwin_newvfs): New function to - support new pathname syntax `..namedfork/rsrc' to access a resource - fork on Mac OS X. The legacy syntax `/rsrc' does not work on - case-sensitive HFS+. - (raccess_guess_darwin_hfsplus): Fix a bug in the calculation of - buffer size to store a pathname. - * include/freetype/internal/ftrfork.h: Increment the number of - resource fork guessing rule. - -2007-12-06 suzuki toshiya - - * builds/unix/configure.raw: Improve the compile tests to search - Carbon functions. - * builds/mac/ftmac.c: Import fixes for Carbon incompatibilities - proposed by Sean McBride from src/base/ftmac.c (see 2007-11-16). - -2007-12-06 suzuki toshiya - - The documents and comments for Mac OS X are improved by Sean - McBride. - - * src/base/ftmac.c: Fix a comment. - * include/freetype/ftmac.h: Ditto. - * docs/INSTALL.MAC: Improve English and add comment on lowest - system version specified by MACOSX_DEPLOYMENT_TARGET. - -2007-12-04 Werner Lemberg - - * src/cff/cffload.c (cff_subfont_load): Don't use logical OR to - concatenate error codes. - * src/sfnt/ttsbit.c (Load_SBit_Range): Ditto. - -2007-12-04 Graham Asher - - * src/truetype/ttobjs.c (tt_face_init): Don't use logical OR to - concatenate error codes. - -2007-12-04 Sean McBride - - * src/pfr/pfrgload.c (pfr_glyph_load_compound): Remove compiler - warning. - -2007-11-20 suzuki toshiya - - Fix MacOS legacy font support by Masatake Yamato on Mac OS X. It is - not working since 2.3.5. In FT_Open_New(), if FT_New_Stream() - cannot mmap() the specified file and cannot seek to head of the - specified file, it returns NULL stream and FT_Open_New() returns the - error immediately. On MacOS, most legacy MacOS fonts fall into such - a scenario because their data forks are zero-sized and cannot be - sought. To proceed to guessing of resource fork fonts, the - functions for legacy MacOS font must properly handle the NULL stream - returned by FT_New_Stream(). - - * src/base/ftobjs.c (IsMacBinary): Return error - FT_Err_Invalid_Stream_Operation immediately when NULL stream is - passed. - (FT_Open_Face): Even when FT_New_Stream() returns an error, proceed - to fallback. Originally, legacy MacOS font is tested in the cases - of FT_Err_Invalid_Stream_Operation (occurs when data fork is empty) - or FT_Err_Unknown_File_Format (occurs when AppleSingle header or - .dfont header is combined). Now the case of - FT_Err_Cannot_Open_Stream is included. - - * src/base/ftrfork.c (FT_Raccess_Guess): When passed stream is NULL, - skip FT_Stream_Seek(), which seeks to the head of stream, and - proceed to unit testing of raccess_guess_XXX(). FT_Stream_Seek() - for a NULL stream causes a Bus error on Mac OS X. - (raccess_guess_apple_double): Return FT_Err_Cannot_Open_Stream - immediately if passed stream is NULL. - (raccess_guess_apple_single): Ditto. - -2007-11-16 suzuki toshiya - - Fix for Carbon incompatibilities since Mac OS X 10.5, - proposed by Sean McBride. - - * doc/INSTALL.MAC: Comment on MACOSX_DEPLOYMENT_TARGET. - - * include/freetype/ftmac.h: Deprecate FT_New_Face_From_FOND and - FT_GetFilePath_From_Mac_ATS_Name. Since Mac OS X 10.5, calling - Carbon functions from a forked process is classified as unsafe - by Apple. All Carbon-dependent functions should be deprecated. - - * src/base/ftmac.c: Use essential header files - and - instead of - all-in-one header file . - - Include and replace HFS_MAXPATHLEN by Apple - genuine macro PATH_MAX. - - Add fallback macro for kATSOptionFlagsUnRestrictedScope which - is not found in Mac OS X 10.0. - - Multi-character constants ('POST', 'sfnt' etc) are replaced by - 64bit constants calculated by FT_MAKE_TAG() macro. - - For the index in the segment of resource fork, new portable - type ResourceIndex is introduced for better compatibility. - This type is since Mac OS X 10.5, so it is defined as short - when built on older platforms. - - (FT_ATSFontGetFileReference): If build target is only the systems - 10.5 and newer, it calls Apple genuine ATSFontGetFileReference(). - - (FT_GetFile_From_Mac_ATS_Name): Return an error if system is 10.5 - and newer or 64bit platform, because legacy type FSSpec type is - removed completely. - - (FT_New_Face_From_FSSpec): Ditto. - -2007-11-01 Werner Lemberg - - * src/sfnt/sfobjs.c (sfnt_done_face): Check `sfnt' everywhere. This - fixes Savannah bug #21485. - -2007-10-29 Daniel Svoboda - - * src/winfonts/winfnt.c (FNT_Face_Init): Check first that the driver - can handle the font at all, then check `face_index'. Otherwise, the - driver might return the wrong error code. This fixes Savannah bug - #21468. - -2007-10-21 Werner Lemberg - - * src/sfnt/sfobjs.c (sfnt_load_face): Support bit 9 and prepare - support for bit 8 of the `fsSelection' field in the `OS/2' table. - MS is already using this; hopefully, this becomes part of OpenType - 1.5. - Prepare also support for `name' IDs 21 (WWS_FAMILY) and 22 - (WWS_SUBFAMILY). - -2007-10-20 Werner Lemberg - - * src/tools/docmaker/tohtml.py (html_header_2): Fix typo. - Add `td.left' element to CSS. - (toc_section_enter): Use it. - -2007-10-18 David Turner - - * include/freetype/freetype.h, src/base/ftobjs.c: Rename API - functions related to cmap type 14 support to the - `FT_Object_ActionName' scheme: - - FT_Get_Char_Variant_index -> FT_Face_GetCharVariantIndex - FT_Get_Char_Variant_IsDefault -> FT_Face_GetCharVariantIsDefault - FT_Get_Variant_Selectors -> FT_Face_GetVariantSelectors - FT_Get_Variants_Of_Char -> FT_Face_GetVariantsOfChar - FT_Get_Chars_Of_Variant -> FT_Face_GetCharsOfVariant - - Update documentation accordingly. - - * src/sfnt/ttcmap.c: Stronger cmap 14 validation. - Make the code a little more consistent with FreeType coding - conventions and modify the cmap14 functions that returned a newly - allocated array to use a persistent vector from the TT_CMap14 object - instead. - - (TT_CMap14Rec): Provide array and auxiliary data for result. - (tt_cmap14_done, tt_cmap14_ensure): New functions. - - (tt_cmap14_init, tt_cmap14_validate, tt_cmap14_char_map_def_binary, - tt_cmap14_char_map_nondef_binary, tt_cmap14_find_variant, - tt_cmap14_char_var_index, tt_cmap14_variants, - tt_cmap14_char_variants, tt_cmap14_def_char_count, - tt_cmap14_get_def_chars, tt_cmap14_get_nondef_chars, - tt_cmap14_variant_chars, tt_cmap14_class_rec): Updated and improved. - -2007-10-15 George Williams - - Add support for cmap type 14. - - * devel/ftoption.h, include/freetype/config/ftoption.h - (TT_CONFIG_CMAP_FORMAT_14): New macro. - - * include/freetype/internal/ftobjs.h (FT_CMap_CharVarIndexFunc, - FT_CMap_CharVarIsDefaultFunc, FT_CMap_VariantListFunc, - FT_CMap_CharVariantListFunc, FT_CMap_VariantCharListFunc): New - support function prototypes. - (FT_CMap_ClassRec): Add them. - Update all users. - - * include/freetype/ttnameid.h (TT_APPLE_ID_VARIANT_SELECTOR): New - macro. - - * include/freetype/freetype.h (FT_Get_Char_Variant_Index, - FT_Get_Char_Variant_IsDefault, FT_Get_Variant_Selectors, - FT_Get_Variants_Of_Char, FT_Get_Chars_Of_Variant): New API - functions. - - * src/base/ftobjs.c (find_variant_selector_charmap): New auxiliary - function. - (FT_Set_Charmap): Disallow cmaps of type 14. - (FT_Get_Char_Variant_Index, FT_Get_Char_Variant_IsDefault, - FT_Get_Variant_Selectors, FT_Get_Variants_Of_Char, - FT_Get_Chars_Of_Variant): New API functions. - - * src/sfnt/ttcmap.c (TT_PEEK_UINT24, TT_NEXT_UINT24): New macros. - - (TT_CMap14Rec, tt_cmap14_init, tt_cmap14_validate, - tt_cmap14_char_index, tt_cmap14_char_next, tt_cmap14_get_info, - tt_cmap14_char_map_def_binary, tt_cmap14_char_map_nondef_binary, - tt_cmap14_find_variant, tt_cmap14_char_var_index, - tt_cmap14_char_var_isdefault, tt_cmap14_variants, - tt_cmap14_char_variants, tt_cmap14_def_char_count, - tt_cmap14_get_def_chars, tt_cmap14_get_nondef_chars, - tt_cmap14_variant_chars, tt_cmap14_class_rec): New functions and - structures for cmap 14 support. - (tt_cmap_classes): Register tt_cmap14_class_rec. - (tt_face_build_cmaps): One more error message. - - * docs/CHANGES: Mention cmap 14 support. - -2007-10-01 Werner Lemberg - - * src/base/ftobjs.c (find_unicode_charmap): If search for a UCS-4 - charmap fails, do the loop again while searching a UCS-2 charmap. - This favours MS charmaps over Apple ones. - -2007-08-29 suzuki toshiya - - * src/base/ftmac.c: Introduction of abstract `short' data types, - ResFileRefNum and ResID. These types were introduced for Copland, - then backported to MPW. The variables exchanged with FileManager - QuickDraw frameworks are redefined by these data types. Patch was - proposed by Sean McBride. - * builds/mac/ftmac.c: Ditto. - -2007-08-18 Werner Lemberg - - * src/otvalid/otvcmmn.c (otv_x_y_ux_sy): Skip context glyphs. Found - by Imran Yousaf. Fixes Savannah bug #20773. - - (otv_Lookup_validate): Correct handling of LookupType. Found by - Imran Yousaf. Fixes Savannah bug #20782. - -2007-08-17 George Williams - - * src/otvalid/otvgsub.c (otv_SingleSubst_validate): Fix handling of - SingleSubstFormat1. - -2007-08-11 suzuki toshiya - - * builds/unix/configure.raw: Fix a bug which sets CC_BUILD by - ${build-gcc} (unchecked) instead of by ${build}-gcc (checked). - Found by Ryan Hill. - -2007-08-11 George Williams - - * src/otvalid/otvcommn.c, src/otvalid/otvcommn.h - (otv_Coverage_validate): Add fourth argument to pass an expected - count value. Update all users. - Check glyph IDs. - (otv_ClassDef_validate): Check `StartGlyph'. - - * src/otvalid/otvgsub.c (otv_SingleSubst_validate): More glyph ID - checks. - - * src/otvalid/otvmath.c (otv_MathConstants_validate): There are only - 56 constants. - (otv_GlyphAssembly_validate, otv_MathGlyphConstruction_validate): - Check glyph IDs. - -2007-08-08 Werner Lemberg - - * src/otvalid/otvbase.c, src/otvalid/otvcommn.c, - src/otvalid/otvgdef.c, src/otvalid/otvgpos.c, src/otvalid/otvgsub.c, - src/otvalid/otvjstf.c: s/FT_INVALID_DATA/FT_INVALID_FORMAT/ where - appropriate. Reported by George. - - * include/freetype/internal/fttrace.h: Define `trace_otvmath'. - - * src/otvalid/rules.mk (OTV_DRV_SRC): Add otvmath.c. - - * docs/CHANGES: Updated. - -2007-08-08 George Williams - - Add `MATH' validating support to otvalid module. - - * include/freetype/tttags.h (TTAG_MATH): New macro. - * include/freetype/ftotval.h (FT_VALIDATE_MATH): New macro. - (FT_VALIDATE_OT): Updated. - - * src/otvalid/otmath.c: New file. - - * src/otvalid/otvalid.c: Include otvmath.c. - * src/otvalid/otvmod.c (otv_validate): Handle `MATH' table. - -2007-08-04 Werner Lemberg - - * builds/unix/configure.raw: Add call to AC_LIBTOOL_WIN32_DLL. - Fixes Savannah bug #20686. - -2007-08-03 Werner Lemberg - - * src/psnames/psmodule.c: Fix usage of - FT_CONFIG_OPTION_POSTSCRIPT_NAMES macro. Reported by Graham Asher. - -2007-07-31 suzuki toshiya - - * src/base/ftmac.c (open_face_from_buffer): The argument - `driver_name' is typed as `const char*' to match with the - callers in FT_New_Face_From_LWFN and FT_New_Face_From_SFNT. - This is same with open_face_from_buffer in src/base/ftobjs.c. - Found and fixed by Sean McBride. - -2007-07-28 Werner Lemberg - - * src/raster/ftraster.c (count_table): Make it conditional. - * src/base/ftobjs.c (FT_New_Library): Check FT_RENDER_POOL_SIZE with - a preprocessor statement. - -2007-07-27 Werner Lemberg - - * src/base/ftoutln.c (FT_Outline_Translate): Check `outline' before - first usage. From Savannah patch #6115. - -2007-07-16 Werner Lemberg - - * docs/CHANGES: Updated. - -2007-07-16 Derek Clegg - - Add new service for getting the ROS from a CID font. - - * include/freetype/config/ftheader.h (FT_CID_H): New macro. - * include/freetype/ftcid.h: New file. - - * include/freetype/internal/ftserv.h (FT_SERVIVE_CID_H): New macro. - * include/freetype/internal/services/svcid.h: New file. - - * src/base/ftcid.c: New file. - - * src/cff/cffdrivr.c: Include FT_SERVICE_CID_H. - (cff_get_ros): New function. - (cff_service_cid_info): New service structure. - (cff_services): Register it. - - * src/cff/cffload.c (cff_font_done): Free registry and ordering. - - * src/cff/cfftypes.h (CFF_FontRec): Add `registry' and `ordering'. - - * modules.cfg (BASE_EXTENSIONS): Add ftcid.c. - -2007-07-11 Derek Clegg - - Add support for postscript name service to CFF driver. - - * src/cff/cffdrivr.c: Include FT_SERVICE_POSTSCRIPT_NAME_H. - (cff_get_ps_name): New function. - (cff_service_ps_name): New service structure. - (cff_services): Register it. - -2007-07-07 Werner Lemberg - - * src/base/ftglyph.c (FT_Glyph_Copy): Fix initialization of - `target'. Reported by Sean McBride. - -2007-07-06 Werner Lemberg - - * src/pfr/pfrcmap.c: Include pfrerror.h. - - * src/autofit/afindic.c: Add some external declarations to pacify - `make multi' compilation. - - * src/cid/cidgload.c (cid_load_glyph): Pacify compiler. - - * src/cff/cffdrivr.c (cff_ps_get_font_info), src/cff/cffobjs.c - (cff_strcpy), include/freetype/internal/ftmemory.h (FT_MEM_STRDUP), - src/autofit/aflatin.c (af_latin_hints_compute_edges), - src/autofit/afcjk.c (af_cjk_hints_compute_edges), src/sfnt/ttmtx.c - (tt_face_get_metrics), src/base/ftobjs.c (open_face) - [FT_CONFIG_OPTION_INCREMENTAL]: Fix compilation with C++ compiler. - - * docs/release: Mention test compilation targets. - -2007-07-04 Werner Lemberg - - * docs/PROBLEMS: Mention that some PS based fonts can't be - handled correctly by FreeType. - - * src/truetype/ttgload.c (load_truetype_glyph): Always allow a - recursion depth of 1. This was the maximum value in TrueType 1.0, - and some older fonts don't set this field correctly. - - * src/gxvalid/gxvmort1.c - (gxv_mort_subtable_type1_substTable_validate): Fix tracing message. - -2007-07-03 Werner Lemberg - - * src/autofit/aflatin.c (af_latin_metrics_init_blues): Initialize - `round' to pacify compiler. - -2007-07-02 Werner Lemberg - - - * Version 2.3.5 released. - ========================= - - - Tag sources with `VER-2-3-5'. - - * docs/CHANGES, docs/VERSION.DLL: Update documentation and bump - version number to 2.3.5. - - * README, Jamfile (RefDoc), builds/win32/visualc/index.html, - builds/win32/visualc/freetype.dsp, - builds/win32/visualc/freetype.vcproj, - builds/win32/visualce/index.html, - builds/win32/visualce/freetype.dsp, - builds/win32/visualce/freetype.vcproj: s/2.3.4/2.3.5/, s/234/235/. - - * include/freetype/freetype.h (FREETYPE_PATCH): Set to 5. - - * builds/unix/configure.raw (version_info): Set to 9:16:3. - -2007-07-01 David Turner - - * include/freetype/freetype.h, src/base/ftpatent.c - (FT_Face_SetUnpatentedHinting): New function to dynamically change - the setting after a face is created. - - * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Fix a small bug - that created distortions in the bytecode interpreter results. - -2007-06-30 David Turner - - * src/truetype/ttinterp.c (Ins_IUP): Add missing variable - initialization. - - * src/autofit/aflatin.c (af_latin_metric_init_blues): Get rid of an - infinite loop in the case of degenerate fonts. - -2007-06-26 Rahul Bhalerao - - Add autofit module for Indic scripts. This currently just reuses - the CJK-specific functions. - - * include/freetype/config/ftoption.h (AF_CONFIG_OPTION_INDIC): New - macro. - * devel/ftoption.h: Synchronize with - include/freetype/config/ftoption.h. - - * src/autofit/afindic.c, src/autofit/afindic.h: New files. - - * src/autofit/afglobal.c, src/autofit/aftypes.h, - src/autofit/autofit.c: Updated. - - * src/autofit/Jamfile (_sources), * src/autofit/rules.mk - (AUTOF_DRV_SRC): Updated. - -2007-06-23 David Turner - - * src/truetype/ttgload.c (TT_Load_Simple): Fix change from - 2007-06-16 that prevented the TrueType module from loading most - glyphs. - -2007-06-20 Werner Lemberg - - * src/cff/cffgload.c (cff_slot_load): Fix logic of 2007-05-28 - change. - -2007-06-19 Werner Lemberg - - * src/type1/t1load.c (parse_encoding): Handle one more error. - -2007-06-19 Dmitry Timoshkov - - * src/winfonts/winfnt.c (fnt_face_get_dll_font): Return error - FNT_Err_Invalid_File_Format if file format was recognized but - the file doesn't contain any FNT(NE) or RT_FONT(PE) resources. - Add verbose debug logs to make it easier to debug failing load - attempts. - (FNT_Face_Init): A single FNT font can't contain more than 1 face, - so return an error if requested face index is > 0. - Do not do further attempt to load fonts if a previous attempt has - failed but returned error FNT_Err_Invalid_File_Format, i.e., the - file format has been recognized but no fonts found in the file. - -2007-07-19 suzuki toshiya - - * src/base/ftmac.c: Apply patches proposed by Sean McBride. - (FT_GetFile_From_Mac_Name): Insert FT_UNUSED macros to fix - the compiler warnings against unused arguments. - (FT_ATSFontGetFileReference): Ditto. - (FT_GetFile_From_Mac_ATS_Name): Ditto. - (FT_New_Face_From_FSSpec): Ditto. - (lookup_lwfn_by_fond): Fix wrong comment. - Replace `const StringPtr' by more appropriate type - `ConstStr255Param'. - FSRefMakePathPath always returns UTF8 POSIX pathname in - Mach-O, thus HFS pathname support is dropped. - (count_faces): Remove HLock and HUnlock which is not - required on Mac OS X anymore. - (FT_New_Face_From_SFNT): Ditto. - (FT_New_Face_From_FOND): Ditto. - * builds/mac/ftmac.c: Synchronize to src/base/ftmac.c, - except of HFS pathname support and HLock/HUnlock. - They are required on classic CFM environment. - -2007-06-18 Werner Lemberg - - * src/psaux/psobjs.c (ps_parser_skip_PS_token): Remove incorrect - assertion. - (ps_parser_to_bytes): Fix error message. - - * src/type42/t42objs.c (T42_Open_Face): Handle one more error. - * src/type42/t42parse.c (t42_parse_sfnts): s/alloc/allocated/. - Don't allow mixed binary and hex strings. - Handle string_size == 0 and string_buf == 0. - (t42_parse_encoding): Handle one more error. - -2007-06-18 Werner Lemberg - - * src/psaux/psobjs.c (ps_tofixedarray, ps_tocoordarray): Fix exit - logic. - (ps_parser_load_field) : Skip delimiters - correctly. - (ps_parser_load_field_table): Use `fields->array_max' instead of - T1_MAX_TABLE_ELEMENTS to limit the number of arguments. - - * src/cff/cffgload.c (cff_decoder_prepare): Fix change from - 2007-06-06. - -2007-06-17 Werner Lemberg - - * src/tools/ftrandom.c (font_size): New global variable. - (TestFace): Use it. - (main): Handle new option `--size' to set `font_size'. - (Usage): Updated. - - * src/winfonts/winfnt.c (fnt_face_get_dll_font): Exit in case of - invalid font. - (FNT_Load_Glyph): Protect against invalid bitmap width. - -2007-06-16 David Turner - - * src/smooth/ftgrays.c (gray_find_cell, gray_set_cell, gray_hline): - Prevent integer overflows when rendering very large outlines. - - * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Check the - well-formedness of the contours array when loading a glyph. - - * src/truetype/ttinterp.c (TT_Load_Context): Initialize `zp0', `zp1', - and `zp2'. - (Ins_IP): Check argument ranges to reject bogus operations properly. - (IUP_WorkerRec): Add `max_points' member. - (_iup_worker_interpolate): Check argument ranges. - (Ins_IUP): Ignore empty outlines. - -2007-06-16 Dmitry Timoshkov - - * src/winfonts/winfnt.h: Add necessary structures for PE resource - parsing. - (WinPE32_HeaderRec): New structure. - (WinPE32_SectionRec): New structure. - (WinPE_RsrcDirRec): New structure. - (WinPE_RsrcDirEntryRec): New structure. - (WinPE_RsrcDataEntryRec): New structure. - (FNT_FontRec): Remove unused `size_shift' field. - - * src/winfonts/winfnt.c (fnt_face_get_dll_font): Add support for - loading bitmap .fon files in PE format. - -2007-06-15 Dmitry Timoshkov - - * builds/win32/ftdebug.c: Unify debug level handling with other - platforms. - -2007-06-14 Dmitry Timoshkov - - * builds/win32/ftdebug.c (FT_Message): Send debug output to the - console as well as to the debugger. - -2007-06-14 Werner Lemberg - - * src/autofit/aflatin.c (af_latin_uniranges): Expand structure to - cover all ranges which could possibly be handled by the aflatin - module (since the default fallback for unknown ranges is now the - afcjk module). It might be necessary to fine-tune this further by - splitting off modules for Greek, Cyrillic, or other blocks. - -2007-06-11 David Turner - - * src/autofit/aflatin.c (af_latin_hints_link_segments): Fix - incorrect segment linking computation. This was the root cause of - Savannah bug #19565. - - - * src/autofit/* [FT_OPTION_AUTOFIT2]: Some very experimental changes - to improve the Latin auto-hinter. Note that the new code is - disabled by default since it is not stabilized yet. - - * src/autofit/aflatin2.c, src/autofit/aflatin2.h: New files - (disabled currently). - - * src/autofit/afhints.c: Remove dead code. - (af_axis_hints_new_edge): Add argument to handle segment directions. - (af_edge_flags_to_string): New function. - (af_glyph_hints_dump_segments, af_glyph_hints_dump_edges): Handle - option flags. - (af_glyph_hints_reload): Add argument to handle inflections. - Simplify. - (af_direction_compute): Fine tuning. - (af_glyph_hints_align_edge_points): Fix logic. - (af_glyph_hints_align_strong_points): Do linear search for small - edge counts. - (af_glyph_hints_align_weak_points): Skip any touched neighbors. - (af_iup_shift): Handle zero `delta'. - - * src/autofit/afhints.h: Updated. - (AF_SORT_SEGMENTS): New macro (disabled). - (AF_AxisHintsRec) [AF_SORT_SEGMENTS]: New member `mid_segments'. - - * src/autofit/afglobal.c (af_face_globals_get_metrics): Add - argument to pass option flags for handling scripts. - * src/autofit/afglobal.h: Updated. - - * src/autofit/afcjk.c: Updated. - * src/autofit/aflatin.c: Updated. - (af_latin_metrics_scale_dim): Don't reduce scale by 2%. - - (af_latin_hints_compute_segments) [AF_HINT_METRICS]: Remove dead code. - (af_latin_hints_compute_edges) [AF_HINT_METRICS]: Remove dead code. - Don't set `edge->dir' - (af_latin_hint_edges): Add more logging. - - * src/autofit/afloader.c: Updated. - -2007-06-11 Werner Lemberg - - * docs/CHANGES: Document FT_Face_CheckTrueTypePatents. - -2007-06-10 David Turner - - * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Slight speed-up to - the TrueType glyph loader. - - * include/freetype/config/ftoption.h: Clarify documentation - regarding unpatented hinting. - - - Add new `FT_Face_CheckTrueTypePatents' API. - - * include/freetype/freetype.h (FT_Face_CheckTrueTypePatents): New - declaration. - - * include/freetype/internal/services/svttglyf.h, - src/base/ftpatent.c: New files. - - * include/freetype/internal/ftserv.h (FT_SERVICE_TRUETYPE_GLYF_H): - New macro. - - * src/truetype/ttdriver.c: Include FT_SERVICE_TRUETYPE_GLYF_H and - `ttpload.h'. - (tt_service_truetype_glyf): New service structure. - (tt_services): Register it. - - * modules.cfg (BASE_EXTENSIONS), src/base/Jamfile (_sources): Add - `ftpatent.c'. - -2007-06-08 Werner Lemberg - - * src/sfnt/sfobjs.c (sfnt_load_face): Undo change from 2007-04-28. - Fonts without a cmap must be handled correctly by FreeType (anything - else would be a bug). - - - * src/psaux/t1decode.c (t1_decoder_parse_charstrings) - [FT_DEBUG_LEVEL_TRACE]: Improve tracing message. - -2007-06-07 Werner Lemberg - - * src/sfnt/ttsbit0.c (tt_sbit_decoder_init, - tt_sbit_decoder_load_image): Protect against integer overflows. - - - * src/pfr/pfrgload.c (pfr_glyph_load_simple): More bounding checks - for `x_control' and `y_control'. - -2007-06-06 Werner Lemberg - - * src/base/ftoutln.c (FT_Outline_Decompose): Check `last'. - - - * src/pfr/pfrcmap.c (pfr_cmap_init): Convert assertion into normal - FreeType error. - - - * src/winfonts/winfnt.c (fnt_face_get_dll_font): Do a rough check of - `font_count'. - - - * src/type1/t1load.c (parse_font_matrix): Check `temp_scale'. - - - * src/cff/cffgload.c (cff_decoder_prepare): Change return type to - `FT_Error'. - Check `fd_index'. - (cff_slot_load): Updated. - * src/cff/cffgload.h: Updated. - -2007-06-05 Werner Lemberg - - * src/pfr/pfrgload.c (pfr_glyph_done): Comment out unused code. - (pfr_glyph_load_simple): Convert assertion into normal FreeType - error. - Check `idx'. - (pfr_glyph_load_compound, pfr_glyph_curve_to, pfr_glyph_line_to): - Convert assertion into normal FreeType error. - - * src/pfr/pfrtypes.h (PFR_GlyphRec): Comment out unused code. - - - * src/winfonts/winfnt.c (FNT_Face_Init): Check `family_size'. - - - * src/psaux/psobjs.c (ps_tocoordarray, ps_tofixedarray): Return -1 - in case of parsing error. - (ps_parser_load_field): Updated. - - * src/type1/t1load.c (parse_font_matrix): Updated. - -2007-06-04 Werner Lemberg - - * src/cid/cidgload.c (cid_load_glyph): Check `fd_select'. - - * src/tools/ftrandom/Makefile: Depend on `libfreetype.a'. - -2007-06-03 Werner Lemberg - - * src/tools/ftrandom/*: Add the `ftrandom' test program written by - George Williams (with some modifications). - -2007-06-03 Werner Lemberg - - * src/base/ftobjs.c (destroy_charmaps), src/type1/t1objs.c - (T1_Face_Done), src/winfonts/winfnt.c (FNT_Face_Done): Check for - face == NULL. Suggested by Graham Asher. - -2007-06-03 Ismail Dönmez - - * src/base/ftobjs.c (FT_Request_Metrics): Fix compiler warning. - -2007-06-02 Werner Lemberg - - * include/freetype/fterrdef.h (FT_Err_Corrupted_Font_Header, - FT_Err_Corrupted_Font_Glyphs): New error codes for BDF files. - - * src/bdf/bdflib.c (bdf_load_font): Use them. - - * src/bdf/bdflib.c (_bdf_parse_start): Check `FONT' better. - -2007-06-01 Werner Lemberg - - * src/base/ftobjs.c (FT_Request_Metrics), src/cache/ftccmap.c - (FTC_CMapCache_Lookup): Remove unused code. - -2007-06-01 Sean McBride - - * src/truetype/ttinterp.c (Null_Vector, NULL_Vector): Removed, - unused. - -2007-06-01 Werner Lemberg - - * src/cid/cidparse.c (cid_parser_new): Don't continue second search - pass for `StartData' if an error has occurred. - Exit properly if no `StartData' has been seen at all. - - * builds/unix/ftsystem.c (FT_Stream_Open): Don't use ULONG_MAX but - LONG_MAX to avoid compiler warning. Suggested by Sean McBride. - -2007-05-30 Werner Lemberg - - * src/type1/t1load.c (parse_subrs, parse_charstrings): Protect - against too small binary data strings. - - * src/bdf/bdflib.c (_bdf_parse_glyphs): Check `STARTCHAR' better. - -2007-05-28 David Turner - - * src/cff/cffgload.c (cff_slot_load): Do not apply the identity - transformation. This significantly reduces the loading time of CFF - glyphs. - - * docs/CHANGES: Updated. - - * src/autofit/afglobal.c (AF_SCRIPT_LIST_DEFAULT): Change default - hinting script to CJK, since it works well with more scripts than - latin. Thanks to Rahul Bhalerao for pointing - this out! - -2007-05-25 Werner Lemberg - - * docs/CHANGES: Updated. - -2007-05-24 Werner Lemberg - - * src/truetype/ttobjs.h (tt_size_ready_bytecode): Move declaration - into TT_USE_BYTECODE_INTERPRETER preprocessor block. - -2007-05-24 Graham Asher - - * src/truetype/ttobjs.c (tt_size_ready_bytecode) - [!TT_USE_BYTECODE_INTERPRETER]: Removed. Unused. - -2007-05-22 David Turner - - * src/truetype/ttgload.c (load_truetype_glyph): Fix last change to - avoid crashes in case the bytecode interpreter is not used. - - - Avoid heap blowup with very large .Z font files. This fixes - Savannah bug #19910. - - * src/lzw/ftzopen.h (FT_LzwStateRec): Remove `in_cursor', - `in_limit', `pad', `pad_bits', and `in_buff' members. - Add `buf_tab', `buf_offset', `buf_size', `buf_clear', and - `buf_total' members. - - * src/lzw/ftzopen.c (ft_lzwstate_get_code): Rewritten. It now takes - only one argument. - (ft_lzwstate_refill, ft_lzwstate_reset, ft_lzwstate_io): Updated. - -2007-05-20 Ismail Dönmez - - * src/pshinter/pshrec.c (ps_mask_table_set_bits): Add `const'. - (ps_dimension_set_mask_bits): Remove `const'. - -2007-05-19 Werner Lemberg - - * src/sfnt/ttmtx.c (tt_face_get_metrics) - [!FT_CONFIG_OPTION_OLD_INTERNALS]: Another type-punning fix. - -2007-05-19 Derek Clegg - - Savannah patch #5929. - - * include/freetype/tttables.h, src/base/ftobjcs.c - (FT_Get_CMap_Format): New function. - - * include/freetype/internal/services/svttcmap.c (TT_CMapInfo): Add - `format' member. - * src/sfnt/ttcmap.c (tt_cmap{0,2,4,6,8,10,12}_get_info): Set - cmap_info->format. - -2007-05-19 Werner Lemberg - - * src/truetype/ttgload.c (load_truetype_glyph): Save graphics state - before handling subglyphs so that it can be reinitialized each time. - This fixes Savannah bug #19859. - -2007-05-16 Werner Lemberg - - * src/cache/ftccache.c (ftc_node_mru_link, ftc_node_mru_unlink), - src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP), src/cache/ftcglyph.h - (FTC_GCACHE_LOOKUP_CMP), src/pshinter/pshmod.c (ps_hinter_init), - src/sfnt/ttmtx.c (tt_face_load_hmtx, tt_face_load_hhea, - tt_face_get_metrics): Fix type-punning issues. - -2007-05-15 David Turner - - * include/freetype/config/ftstdlib.h, - include/freetype/internal/ftobjs.h: As suggested by Graham Asher, - ensure that ft_isalnum, ft_isdigit, etc., use hard-coded values - instead on relying on the locale-dependent functions provided by - . - -2007-05-15 Graham Asher - - * src/autofit/afcjk.c (af_cjk_hints_compute_edges): Remove unused - variable. - * src/autofit/afloader.c (af_loader_load_g): Ditto. - - * src/base/ftobjs.c (ft_validator_error): Use `ft_jmp_buf'. - (open_face_from_buffer): Initialize `stream'. - (FT_Request_Metrics): Remove unused variable. - Remove redundant `break' statements. - (FT_Get_Track_Kerning): Remove unused variable. - - * src/psaux/afmparse.c (afm_parse_track_kern, afm_parse_kern_pairs, - afm_parse_kern_data): Remove redundant - `break' statements. - (afm_parser_parse): Ditto. - Don't use uninitialized variables. - - * src/psnames/psmodule.c (VARIANT_BIT): Define as unsigned long. - Use `|' operator instead of `^' to set it. - Update all users. - - * src/sfnt/ttcmap.c (tt_face_build_cmaps): Use `ft_jmp_buf'. - * src/sfnt/ttkern.c (tt_face_load_kern): Remove unused variable. - - * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Remove redundant - comparison. - (TT_Process_Simple_Glyph): Use FT_UInt for `n_points' and `i'. - (TT_Load_Glyph): Remove unused variable. - -2007-05-13 Derek Clegg - - * src/base/ftobjs.c (FT_New_Library): Only allocate rendering pool - if FT_RENDER_POOL_SIZE is > 0. From Savannah patch #5928. - -2007-05-11 David Turner - - * src/cache/ftbasic.c, include/freetype/ftcache.h - (FTC_ImageCache_LookupScaler, FTC_SBit_Cache_LookupScaler): Two new - functions that allow us to look up glyphs using an FTC_Scaler object - to specify the size, making it possible to use fractional pixel - sizes. - - * src/truetype/ttobjs.c (tt_size_ready_bytecode): Set - `size->cvt_ready'. Reported by Boris Letocha. - -2007-05-09 Graham Asher - - * src/truetype/ttinterp.c (Ins_IP), src/autofit/aflatin.c - (af_latin_metrics_scale_dim): Fix compiler warnings. - -2007-05-06 Werner Lemberg - - * builds/win32/visualce/freetype.sln: Removed, as requested by - Vincent. - -2007-05-04 Vincent RICHOMME - - * builds/win32/visualce/*: Add Visual C++ project files for Pocket - PC targets. - - * docs/CHANGES: Document them. - -2007-05-04 - - * builds/unix/ftsystem.c (FT_Stream_Open): Handle return value 0 of - mmap (which might happen on some RTOS). From Savannah patch #5909. - -2007-05-03 Werner Lemberg - - * src/base/ftobjs.c (FT_Set_Char_Size): Simplify code. - * include/freetype/freetype.h (FT_Set_Char_Size): Update - documentation. - -2007-04-28 Victor Stinner - - * src/sfnt/sfobjs.c (sfnt_load_face): Check error code after loading - `cmap'. - -2007-04-27 Werner Lemberg - - * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Check for negative - number of points in contours. Problem reported by Victor Stinner - . - (TT_Process_Simple_Glyph): Synchronize variable types. - -2007-04-26 Werner Lemberg - - * src/base/ftglyph.c (FT_Glyph_Copy): Always set second argument to - zero in case of error. This fixes Savannah bug #19689. - -2007-04-25 Boris Letocha - - * src/truetype/ttobjs.c: Fix a typo that created a speed regression - in the TrueType bytecode loader. - -2007-04-10 Martin Horak - - * src/sfnt/sfobjs.c (sfnt_load_face) [FT_CONFIG_OPTION_INCREMENTAL]: - Ignore `hhea' table. This fixes Savannah bug #19261. - -2007-04-09 Werner Lemberg - - - * Version 2.3.4 released. - ========================= - - - Tag sources with `VER-2-3-4'. - - * docs/CHANGES, docs/VERSION.DLL: Update documentation and bump - version number to 2.3.4. - - * README, Jamfile (RefDoc), builds/win32/visualc/index.html, - builds/win32/visualc/freetype.dsp, - builds/win32/visualc/freetype.vcproj: s/2.3.3/2.3.4/, s/233/234/. + builds/wince/vc2008-ce/index.html: s/2.4.3/2.4.4/, s/243/244/. * include/freetype/freetype.h (FREETYPE_PATCH): Set to 4. - * builds/unix/configure.raw (version_info): Set to 9:15:3. + * builds/unix/configure.raw (version_info): Set to 12:2:6. -2007-04-09 Martin Horak +2010-11-28 Alexei Podtelezhnikov - * src/truetype/ttgload.c (load_truetype_glyph): Save and restore - memory stream to avoid a crash with the incremental memory - interface (Savannah bug #19260). + [ftsmooth]: Minor code simplification. -2007-04-06 David Turner + * src/smooth/ftgrays (gray_render_cubic): Do only one comparison + instead of two. - * src/base/ftbimap.c (ft_bitmap_assure_buffer): Fix buffer-overwrite bug - (Savannah bug #19536). +2010-11-26 Johnson Y. Yan -2007-04-04 Werner Lemberg + [truetype] Better multi-threading support. + * src/truetype/ttinterp.c (TT_Load_Context): Reset glyph zone + references. - * Version 2.3.3 released. +2010-11-23 John Tytgat + + * src/psaux/t1decode.c (t1_decoder_parse_charstring): Expand + start_point, check_points, add_point, add_point1, close_contour + macros. + Remove add_contour macro. + Return error code from t1_builder_start_point and + t1_builder_check_points when there was one (instead of returning 0). + +2010-11-22 suzuki toshiya + + [truetype] Identify the tricky fonts by cvt/fpgm/prep checksums. + Some Latin TrueType fonts are still expected to be unhinted. + Fix Savannah bug #31645. + + * src/truetype/ttobjs.c (tt_check_trickyness): Divided to... + (tt_check_trickyness_family): this checking family name, and + (tt_check_trickyness_sfnt_ids): this checking cvt/fpgm/prep. + (tt_get_sfnt_checksum): Function to retrieve the sfnt checksum + for specified subtable even if cleared by lazy PDF generators. + (tt_synth_sfnt_checksum): Function to calculate the checksum. + +2010-11-18 Werner Lemberg + + [truetype] Fix `loca' handling for inconsistent number of glyphs. + Reported by Johnson Y. Yan . + + * src/truetype/ttpload.c (tt_face_load_loca): While sanitizing, + handle case where `loca' is the last table in the font. + +2010-11-18 Werner Lemberg + + [sfnt] Ignore all errors while loading `OS/2' table. + Suggested by Johnson Y. Yan . + + * src/sfnt/sfobjs.c (sfnt_load_face): Do it. + +2010-11-18 Johnson Y. Yan + + [type1] Fix matrix normalization. + + * src/type1/t1load.c (parse_font_matrix): Handle sign of scaling + factor. + +2010-11-18 Werner Lemberg + + [type1] Improve guard against malformed data. + Based on a patch submitted by Johnson Y. Yan + + + * src/type1/t1load.c (read_binary_data): Check `size'. + +2010-11-17 Werner Lemberg + + [sfnt] While tracing, output table checksums also. + + * src/sfnt/ttload.c (tt_face_load_font_dir): Do it. + +2010-11-04 suzuki toshiya + + [UVS] Fix find_variant_selector_charmap(), Savannah bug #31545. + + Since 2010-07-04, find_variant_selector_charmap() returns + the first cmap subtable always under rogue-compatible + configuration, it causes NULL pointer dereference and + make UVS-related functions crashed. + + * src/base/ftobjs.c (Fix find_variant_selector_charmap): + Returns UVS cmap correctly. + +2010-11-01 Alexei Podtelezhnikov + + [ftsmooth] Improve rendering. + + * src/smooth/ftsmooth.c (gray_render_conic): Since version 2.4.3, + cubic deviations have been estimated _after_ UPSCALE, whereas + conic ones have been evaluated _before_ UPSCALE, which produces + inferior rendering results. Fix this. + Partially undo change from 2010-10-15 by using ONE_PIXEL/4; this has + been tested with demo images sent to the mailing list. See + + http://lists.gnu.org/archive/html/freetype-devel/2010-10/msg00055.html + + and later mails in this thread. + +2010-10-28 Werner Lemberg + + [ftraster] Minor fixes. + + Reported by Tom Bishop . + + * src/raster/ftraster.c (ULong): Remove unused typedef. + (TWorker): Remove unused variable `precision_mask'. + +2010-10-28 Werner Lemberg + + [ftraster] Fix rendering. + + Problem reported by Tom Bishop ; see + thread starting with + + http://lists.gnu.org/archive/html/freetype/2010-10/msg00049.html + + * src/raster/ftraster.c (Line_Up): Replace FMulDiv with SMulDiv + since the involved multiplication exceeds 32 bits. + +2010-10-25 suzuki toshiya + + Revert a change of `_idx' type in FTC_CACHE_LOOKUP_CMP(). + + * src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP): Revert + the type of `_idx' from FT_PtrDist (by previous change) + to original FT_UFast, to match with FT_CacheRec. + +2010-10-24 suzuki toshiya + + [cache] Change the hash types to FT_PtrDist. + + On LLP64 platforms (e.g. Win64), FT_ULong (32-bit) + variables are inappropriate to calculate hash values + from the memory address (64-bit). The hash variables + are extended from FT_ULong to FT_PtrDist and new + hashing macro functions are introduced. The hash + values on 16-bit memory platforms are changed, but + ILP32 and LP64 are not changed. The hash value in + the cache subsystem is not reverted to the memory + address, so using signed type FT_PtrDist is safe. + + * src/cache/ftccache.h (_FTC_FACE_ID_HASH): New hash + function to replace FTC_FACE_ID_HASH() for portability. + * src/cache/ftcmanag.h (FTC_SCALER_HASH): Replace + FTC_FACE_ID_HASH() by _FTC_FACE_ID_HASH(). + * src/cache/ftccmap.c (FTC_CMAP_HASH): Ditto. + + * src/cache/ftccache.h (FTC_NodeRec): The type of the + member `hash' is changed from FT_UInt32 to FT_PtrDist. + + * src/cache/ftccache.h (FTC_Cache_Lookup): The type of the + argument `hash' is changed from FT_UInt32 to FT_PtrDist. + (FTC_Cache_NewNode): Ditto. + * src/cache/ftccache.c (ftc_cache_add): Ditto. + (FTC_Cache_Lookup): Ditto. (FTC_Cache_NewNode): Ditto. + * src/cache/ftcglyph.h (FTC_GCache_Lookup): Ditto. + * src/cache/ftcglyph.c (FTC_GCache_Lookup): Ditto. + + * src/cache/ftcbasic.c (FTC_ImageCache_Lookup): The type + of the internal variable `hash' is changed to FT_PtrDist + from FT_UInt32. (FTC_ImageCache_LookupScaler): Ditto. + (FTC_SBitCache_Lookup): Ditto. + (FTC_SBitCache_LookupScaler): Ditto. + * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Ditto. + * src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP): Ditto. + Also the type of the internal variable `_idx' is changed to + FT_PtrDist from FT_UFast for better pointer calculation. + +2010-10-24 suzuki toshiya + + [cache] Hide internal macros incompatible with LLP64. + + FT_POINTER_TO_ULONG(), FTC_FACE_ID_HASH() and + FTC_IMAGE_TYPE_HASH() are enclosed by + FT_CONFIG_OPTION_OLD_INTERNALS and hidden from + normal clients. + + For the history of these macros, see the investigation: + http://lists.gnu.org/archive/html/freetype/2010-10/msg00022.html + +2010-10-24 suzuki toshiya + + Change the type of FT_MEM_VAL() from FT_ULong to FT_PtrDist. + + On LLP64 platforms (e.g. Win64), unsigned long (32-bit) + cannot cover the memory address (64-bit). FT_MEM_VAL() is + used for hashing only and not dereferred, so using signed + type FT_PtrDist is safe. + + * src/base/ftdbgmem.c (FT_MEM_VAL): Change the type of the + return value from FT_ULong to FT_PtrDist. + (ft_mem_table_resize): The type of hash is changed to + FT_PtrDist. (ft_mem_table_get_nodep): Ditto. + +2010-10-24 suzuki toshiya + + Replace "%lx" for memory address by "%p", LLP64 platforms. + + On LLP64 platforms (e.g. Win64), long (32-bit) cannot cover + the memory address (64-bit). Also the casts from the pointer + type to long int should be removed to preserve the address + correctly. + + * src/raster/ftraster.c (New_Profile): Replace "%lx" by "%p". + (End_Profile) Ditto. + * src/truetype/ttinterp.c (Init_Context): Ditto. + +2010-10-15 Alexei Podtelezhnikov + + Fix thinko in spline flattening. + + FT_MAX_CURVE_DEVIATION is dependent on the value of ONE_PIXEL. + + * src/smooth/ftgrays.c (FT_MAX_CURVE_DEVIATION): Remove it and + replace it everywhere with ONE_PIXEL/8. + +2010-10-13 suzuki toshiya + + [raccess] Skip unrequired resource access rules by Darwin VFS. + + When a resource fork access rule by Darwin VFS could open the + resource fork but no font is found in it, the rest of rules + by Darwin VFS are skipped. It reduces the warnings of the + deprecated resource fork access method by recent Darwin kernel. + Fix MacPorts ticket #18859: + http://trac.macports.org/ticket/18859 + + * src/base/ftobjs.c (load_face_in_embedded_rfork): + When FT_Stream_New() returns FT_Err_Cannot_Open_Stream, it + means that the file is possible to be fopen()-ed but zero-sized. + Also there is a case that the resource fork is not zero-sized, + but no supported font exists in it. If a rule by Darwin VFS + falls into such cases, there is no need to try other Darwin VFS + rules anymore. Such cases are marked by vfs_rfork_has_no_font. + If it is TRUE, the Darwin VFS rules are skipped. + +2010-10-13 suzuki toshiya + + [raccess] Grouping resource access rules based on Darwin VFS. + + MacOS X/Darwin kernel supports a few tricky methods to access + a resource fork via ANSI C or POSIX interface. Current resource + fork accessor tries all possible methods to support all kernels. + But if a method could open a resource fork but no font is found, + there is no need to try other methods older than tested method. + To determine whether the rule index is for Darwin VFS, a local + function ftrfork.c::raccess_rule_by_darwin_vfs() is introduced. + To use this function in ftobjs.c etc but it should be inlined, + it is exposed by ftbase.h. + + * src/base/ftrfork.c (FT_RFork_Rule): New enum type to identify + the rules to access the resource fork. + (raccess_guess_rec): New structure to bind the rule function and + rule enum type. + (FT_Raccess_Guess): The list of the rule functions is replaced by + (raccess_guess_table): This. This is exposed to be used by other + intra module functions. + (raccess_rule_by_darwin_vfs): A function to return a boolean + if the rule specified by the rule index is based on Darwin VFS. + +2010-10-13 suzuki toshiya + + Prevent to open a FT_Stream for zero-sized file on non-Unix. + + builds/unix/ftsystem.c prevents to open an useless stream from + zero-sized file and returns FT_Err_Cannot_Open_Stream, but the + stream drivers for ANSI C, Amiga and VMS return useless streams. + For cross-platform consistency, all stream drivers should act + same. + + * src/base/ftsystem.c (FT_Stream_Open): If the size of the opened + file is zero, FT_Err_Cannot_Open_Stream is returned. + * builds/amiga/src/base/ftsystem.c (FT_Stream_Open): Ditto. + * src/vms/ftsystem.c (FT_Stream_Open): Ditto. + +2010-10-12 Werner Lemberg + + Fix Savannah bug #31310. + + * src/truetype/ttgxvar.c (ft_var_readpackedpoints): Protect against + invalid `runcnt' values. + +2010-10-08 Chris Liddell + + Fix Savannah bug #31275. + + * src/sfnt/ttpost.c: Include FT_INTERNAL_DEBUG_H. + +2010-10-06 Werner Lemberg + + [truetype] Improve error handling of `SHZ' bytecode instruction. + Problem reported by Chris Evans . + + * src/truetype/ttinterp.c (Ins_SHZ): Check `last_point'. + +2010-10-05 Werner Lemberg + + Fix Savannah bug #31253. + Patch submitted by an anonymous reporter. + + * configure: Use `awk' instead of `sed' to manipulate output of `ls + -id'. + +2010-10-03 Werner Lemberg + + * Version 2.4.3 released. ========================= - Tag sources with `VER-2-3-3'. + Tag sources with `VER-2-4-3'. - * docs/CHANGES: Mention CVE-2007-1351. + * docs/CHANGES: Updated. -2007-04-03 David Turner + * docs/VERSION.DLL: Update documentation and bump version number to + 2.4.3 - * src/base/ftobjs.c (FT_Set_Char_Size): As suggested by James Cloos, - if one of the resolution values is 0, treat it as if it were the - same as the other value. - -2007-04-02 David Turner - - Add special code to detect `extra-light' fonts and do not snap their - stem widths too much to avoid bizarre hinting effects. - - * src/autofit/aflatin.h (AF_LatinAxisRec): Add `standard_width' and - `extra_light' members. - - * src/autofit/aflatin.c (af_latin_metrics_init_widths): Initialize - them. - (af_latin_metrics_scale_dim): Set `extra_light'. - (af_latin_compute_stem_width): Use `extra_light'. - -2007-03-28 David Turner - - * src/base/ftbitmap.c (ft_bitmap_assure_buffer): Fix zero-ing of the - padding. - -2007-03-28 Werner Lemberg - - * src/bdf/bdflib.c (setsbit, sbitset): Handle values >= 128 - gracefully. - (_bdf_set_default_spacing): Increase `name' buffer size to 256 and - issue an error for longer names. This fixes CVE-2007-1351. - (_bdf_parse_glyphs): Limit allowed number of glyphs in font to the - number of code points in Unicode. - - * builds/win32/visualc/index.html, + * README, Jamfile (RefDoc), + builds/win32/vc2005/freetype.vcproj, builds/win32/vc2005/index.html, + builds/win32/vc2008/freetype.vcproj, builds/win32/vc2008/index.html, builds/win32/visualc/freetype.dsp, - builds/win32/visualc/freetype.vcproj, README: s/2.3.2/2.3.3/, - s/232/233/. - - * docs/CHANGES: Mention ftdiff. - -2007-03-26 David Turner - - * src/truetype/ttinterp.c [FIX_BYTECODE]: Remove it and - corresponding code. - (Ins_MD): Last regression fix. - - * src/autofit/aflatin.c (af_latin_metrics_init_blues): Fix blues - computations in order to ignore single-point contours. These are - never rasterized and correspond in certain fonts to mark-attach - points that are very far from the glyph's real outline, ruining the - computation. - - * src/autofit/afloader.c (af_loader_load_g): In the case of - monospaced fonts, always set `rsb_delta' and `lsb_delta' to 0. - Otherwise code that uses them will most certainly ruin the fixed - advance property. - - * docs/CHANGES, docs/VERSION.DLL, README, Jamfile (RefDoc): Update - documentation and bump version number to 2.3.3. + builds/win32/visualc/freetype.vcproj, + builds/win32/visualc/index.html, builds/win32/visualce/freetype.dsp, + builds/win32/visualce/freetype.vcproj, + builds/win32/visualce/index.html, + builds/wince/vc2005-ce/freetype.vcproj, + builds/wince/vc2005-ce/index.html, + builds/wince/vc2008-ce/freetype.vcproj, + builds/wince/vc2008-ce/index.html: s/2.4.2/2.4.3/, s/242/243/. * include/freetype/freetype.h (FREETYPE_PATCH): Set to 3. - * builds/unix/configure.raw (version_info): Set to 9:14:3. + * builds/unix/configure.raw (version_info): Set to 12:1:6. -2007-03-26 suzuki toshiya +2010-10-03 Werner Lemberg - * builds/unix/ftconfig.in: Disable Carbon framework dependency on - 64bit ABI on Mac OS X 10.4.x (ppc & i386). Found by Sean McBride. - * builds/vms/ftconfig.h: Ditto. - * include/freetype/config/ftconfig.h: Ditto. + Avoid `configure' issues with symbolic links. + Based on a patch from Alexander Stohr . -2007-03-22 suzuki toshiya + * configure: Compare directories using `ls -id'. + Check existence of `reference' subdirectory before creating it. - * builds/unix/ftsystem.c (FT_Stream_Open): Temporary fix to prevent - 32bit unsigned long overflow by 64bit filesize on LP64 platform, as - proposed by Sean McBride: - http://lists.gnu.org/archive/html/freetype-devel/2007-03/msg00032.html +2010-10-02 Werner Lemberg -2007-03-22 suzuki toshiya + Fix Savannah bug #31088 (sort of). - * builds/unix/ftconfig.in: Suppress SGI compiler's warning against - setjmp, proposed by Sean McBride: - http://lists.gnu.org/archive/html/freetype-devel/2007-03/msg00032.html + * src/sfnt/ttload.c (tt_face_load_maxp): Always allocate at least 64 + function entries. -2007-03-19 suzuki toshiya +2010-10-02 Werner Lemberg - * builds/unix/configure.raw: Dequote `OS_INLINE' in comment of - conftest.c, to avoid unexpected shell evaluation. Possibly it is a - bug or undocumented behaviour of autoconf. + [smooth] Fix splitting of cubics for negative values. -2007-03-18 David Turner + Reported by Róbert Márki ; see + http://lists.gnu.org/archive/html/freetype/2010-09/msg00019.html. - * src/truetype/ttinterp.c (Ins_MDRP): Another bytecode regression - fix; testing still needed. + * src/smooth/ftgrays.c (gray_render_cubic): Fix thinko. - * src/truetype/ttinterp.c (Ins_MD): Another bytecode regression fix. +2010-10-01 suzuki toshiya -2007-03-17 David Turner + Fix Savannah bug #31040. - * src/truetype/ttinterp.c (Ins_IP): Fix wrong handling of the - (undocumented) twilight zone special case. + * src/truetype/ttinterp.c (free_buffer_in_size): Remove. + (TT_RunIns): Updated. -2007-03-09 Werner Lemberg +2010-09-20 suzuki toshiya + [sfnt] Make error message filling NULL names less verbose. - * Version 2.3.2 released. + * src/sfnt/ttpost.c (load_format_20): Showing 1 summary message + when we fill `post' names by NULL, instead of per-entry message. + +2010-09-20 Graham Asher + David Bevan + + [smooth] Fix and improve spline flattening. + + This fixes the flattening of cubic, S-shaped curves and speeds up + the handling of both the conic and cubic arcs. + + See the discussions on the freetype-devel mailing list in late + August and September 2010 for details. + + * src/smooth/ftgrays.c (FT_MAX_CURVE_DEVIATION): New macro. + (TWorker): Remove `conic_level' and `cubic_level' elements. + (gray_render_conic): Simplify algorithm. + (gray_render_cubic): New algorithm; details are given in the code + comments. + (gray_convert_glyph): Remove heuristics. + +2010-09-19 Werner Lemberg + + Minor fixes. + + * src/cff/cffload.c (cff_charset_compute_cids): `charset->sids[i]' + is `FT_UShort'. + (cff_index_access_element): Don't use additions in comparison. + * src/sfnt/ttpost.c (load_format_20): Make `post_limit' of type + `FT_Long'. + Don't use additions in comparison. + Improve tracing messages. + (load_format_25, load_post_names): Make `post_limit' of type + `FT_Long'. + +2010-09-19 suzuki toshiya + + [cff] Truncate the element length at the end of the stream. + See Savannah bug #30975. + + * src/cff/cffload.c (cff_index_access_element): `off2', the offset + to the next element is truncated at the end of the stream to prevent + invalid I/O. As `off1', the offset to the requested element has + been checked by FT_STREAM_SEEK(), `off2' should be checked + similarly. + +2010-09-19 suzuki toshiya + + [cff] Ignore CID > 0xFFFFU. + See Savannah bug #30975. + + * src/cff/cffload.c (cff_charset_compute_cids): Ignore CID if + greater than 0xFFFFU. CFF font spec does not mention maximum CID in + the font, but PostScript and PDF spec define that maximum CID is + 0xFFFFU. + +2010-09-19 suzuki toshiya + + [cff] Make trace message in cff_charset_load() verbose. + See Savannah bug #30975. + + * src/cff/cffload.c (cff_charset_load): Report the original `nleft' + and truncated `nleft'. + +2010-09-19 suzuki toshiya + + [cff] Correct `max_cid' from CID array length to max CID. + See Savannah bug #30975. + + * src/cff/cffload.c (cff_charset_compute_cids): Don't increment + max_cid after detecting max CID. The array CFF_Charset->cids is + allocated by max_cid + 1. + (cff_charset_cid_to_gindex): Permit CID is less than or equal to + CFF_Charset->max_cid. + * src/cff/cffobjs.c (cff_face_init): FT_Face->num_glyphs is + calculated as CFF_Charset->max_cid + 1. + +2010-09-19 suzuki toshiya + + [truetype] Sanitize the broken offsets in `loca'. + See Savannah bug #31040. + + * src/truetype/ttpload.c (tt_face_get_location): If `pos1', the + offset to the requested entry in `glyf' exceeds the end of the + table, return offset=0, length=0. If `pos2', the offset to the next + entry in `glyf' exceeds the end of the table, truncate the entry + length at the end of `glyf' table. + +2010-09-19 suzuki toshiya + + [sfnt] Prevent overrunning in `post' table parser. + See Savannah bug #31040. + + * src/sfnt/ttpost.c (load_post_names): Get the length of `post' + table and pass the limit of `post' table to load_format_20() and + load_format_25(). + (load_format_20): Stop the parsing when we reached at the limit of + `post' table. If more glyph names are required, they are filled by + NULL names. + +2010-09-17 suzuki toshiya + + [truetype] Don't duplicate size->twilight structure to be freed. + See Savannah bug #31040 for detail. + + * src/truetype/ttinterp.c (free_buffer_in_size): Don't duplicate + FT_GlyphZoneRec size->twilight to be freed. If duplicated, + FT_FREE() erases the duplicated pointers only and leave original + pointers. They can cause the double-free crash when the burst + errors occur in TrueType interpreter and free_buffer_in_size() is + invoked repeatedly. + +2010-09-15 Werner Lemberg + + Make bytecode debugging with FontForge work again. + + * src/truetype/ttinterp.c (TT_RunIns): Don't call + `free_buffer_in_size' in case of error if a debugger is active. + +2010-09-14 Werner Lemberg + + Improve tracing messages. + + * src/truetype/ttinterp.c (TT_RunIns): Improve wording of tracing + message. + * src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep): Add + tracing message. + * src/truetype/ttgload.c (tt_loader_init): Add tracing message. + * src/cache/ftcsbits.c (ftc_snode_load): Emit tracing message if + glyph doesn't fit into a small bitmap container. + +2010-09-13 Werner Lemberg + + Fix minor issues reported by . + + * src/autofit/aflatin.c (af_latin_compute_stem_width): Remove + redundant conditional check. + * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Ditto. + * src/cff/cffload.c (cff_encoding_load): Remove conditional check + which always evaluates to `true'. + * src/pshinter/pshalgo.c (ps_glyph_interpolate_strong_points): + Ditto. + * src/truetype/ttinterp.c (Ins_IUP): Ditto. + * src/cid/cidgload.c (cid_slot_load_glyph): Don't check for NULL if + value is already dereferenced. + * src/winfonts/winfnt.c (FNT_Load_Glyph): Fix check of `face'. + +2010-08-31 suzuki toshiya + + Ignore the environmental setting of LIBTOOL. + Patch is suggested by Adrian Bunk, to prevent unexpected + reflection of environmental LIBTOOL. See: + http://savannah.nongnu.org/patch/?7290 + + * builds/unix/unix-cc.in: LIBTOOL is unconditionally set to + $(FT_LIBTOOL_DIR)/libtool. FT_LIBTOOL_DIR is set to $(BUILD_DIR) + by default. + * configure: When configured for the building out of source tee, + FT_LIBTOOL_DIR is set to $(OBJ_DIR). + +2010-08-31 suzuki toshiya + + [truetype] Decrease the trace level catching the interpreter error. + + * src/truetype/ttinterp.c (TT_RunIns): Decrease the trace level + showing the error when the interpreter returns with an error, + from FT_TRACE7() to FT_TRACE1(). + +2010-08-30 suzuki toshiya + + [truetype] Prevent bytecode reuse after the interpretation error. + + * src/truetype/ttinterp.c (free_buffer_in_size): New function to + free the buffer allocated during the interpretation of this glyph. + (TT_RunIns): Unset FT_Face->size->{cvt_ready,bytecode_ready} if + an error occurs in the bytecode interpretation. The interpretation + of invalid bytecode may break the function definitions and referring + them in later interpretation is danger. By unsetting these flags, + `fpgm' and `prep' tables are executed again in next interpretation. + + This fixes Savannah bug #30798, reported by Robert ÅšwiÄ™cki. + +2010-08-29 Werner Lemberg + + [ftraster] Pacify compiler. + + * src/raster/ftraster.c (ft_black_new) [_STANDALONE_]: `memory' is + not used. + +2010-08-29 Werner Lemberg + + [cff] Allow SIDs >= 65000. + + * src/cff/cffload.c (cff_charset_load): Fix change from 2009-03-20: + The threshold for SIDs is not applicable here. I misinterpreted the + `SID values 65000 and above are available for implementation use' + sentence in the CFF specification. + + Problem reported by Ivan NinÄić . + +2010-08-28 suzuki toshiya + + Force hinting when the font lacks its familyname. + + In Type42 or Type11 font embedded in PostScript & PDF, TrueType sfnt + stream may lack `name' table because they are not required. Hinting + for nameless fonts is safer for PDFs including embedded Chinese + fonts. Written by David Bevan, see: + + http://lists.gnu.org/archive/html/freetype-devel/2010-08/msg00021.html + http://lists.freedesktop.org/archives/poppler/2010-August/006310.html + + * src/truetype/ttobjs.c (tt_check_trickyness): If a NULL pointer by + nameless font is given, TRUE is returned to enable hinting. + +2010-08-28 suzuki toshiya + + Register yet another tricky TrueType font. + + * src/truetype/ttobjs.c (tt_check_trickyness): Add `HuaTianKaiTi?', + a Kaishu typeface paired with `HuaTianSongTi?' by Huatian + Information Industry. + +2010-08-17 Teijo Kinnunen + + Fix Savannah bug #30788. + + * src/cache/ftccache.c (FTC_Cache_Clear): Check `cache->buckets' for + NULL too. + +2010-08-10 Werner Lemberg + + Try to fix Savannah bug #30717 (and probably #30719 too). + + * src/smooth/ftsmooth.c (ft_smooth_render_generic): Add another + overflow test for `width' and `height'. + +2010-08-06 Werner Lemberg + + * Version 2.4.2 released. ========================= - Tag sources with `VER-2-3-2'. + Tag sources with `VER-2-4-2'. - * builds/win32/visualc/index.html, + * docs/CHANGES: Updated. + + * docs/VERSION.DLL: Update documentation and bump version number to + 2.4.2 + + * README, Jamfile (RefDoc), + builds/win32/vc2005/freetype.vcproj, builds/win32/vc2005/index.html, + builds/win32/vc2008/freetype.vcproj, builds/win32/vc2008/index.html, builds/win32/visualc/freetype.dsp, - builds/win32/visualc/freetype.vcproj, README: s/2.3.1/2.3.2/, - s/231/232/. - -2007-03-08 David Turner - - * docs/CHANGES, docs/VERSION.DLL: Updated for upcoming release. - - * builds/unix/configure.raw (version_info): Set to 9:13:3. + builds/win32/visualc/freetype.vcproj, + builds/win32/visualc/index.html, builds/win32/visualce/freetype.dsp, + builds/win32/visualce/freetype.vcproj, + builds/win32/visualce/index.html, + builds/wince/vc2005-ce/freetype.vcproj, + builds/wince/vc2005-ce/index.html, + builds/wince/vc2008-ce/freetype.vcproj, + builds/wince/vc2008-ce/index.html: s/2.4.1/2.4.2/, s/241/242/. * include/freetype/freetype.h (FREETYPE_PATCH): Set to 2. - * README, Jamfile (RefDoc): s/2.3.1/2.3.2/. + * builds/unix/configure.raw (version_info): Set to 12:0:6. - * src/base/ftutil.c (ft_mem_strcpyn): Fix a bug that prevented the - function to work properly, over-writing user-provided buffers in - some cases. Reported by James Cloos . +2010-08-06 suzuki toshiya + Fix Savannah bug #30648. -2007-03-05 Werner Lemberg + * src/base/ftobjs.c (FT_Done_Library): Specify the order of font + drivers during the face closing process. Type42 faces should be + closed before TrueType faces, because a Type42 face refers to + another internal TrueType face which is created from sfnt[] array on + the memory. - * include/freetype/config/ftstdlib.h (ft_strstr): New wrapper - macro for `strstr'. +2010-08-06 Yuriy Kaminskiy - * src/truetype/ttobjs.c (tt_face_init): Use ft_strstr for scanning - `trick_names', as suggested by Ivan Nincic. + [raster] Fix valgrind warning. -2007-03-05 David Turner + * src/raster/ftraster.c (Decompose_Curve) : Access point[0] + only if we don't hit `limit'. - * src/base/ftinit.c (FT_Init_FreeType): Fix a small memory leak in - case FT_Init_FreeType fails for some reason. Problem reported by - Maximilian Schwerin . +2010-08-06 suzuki toshiya - * src/truetype/ttobs.c (tt_size_init_bytecode): Clear the `x_ppem' - and `y_ppem' fields of the `TT_Size.metrics' structure, not those of - `TT_Size.root.metrics'. Problem reported by Daniel Glöckner - . + Fix Savannah bug #30658. - * src/type1/t1afm.c (T1_Read_PFM): Read kerning values as 16-bit - signed values, not unsigned ones. Problem reported by Johannes - Walther . + * src/base/ftobjs.c (Mac_Read_POST_Resource): Check that the total + length of collected POST segments does not overrun the allocated + buffer. -2007-02-21 David Turner +2010-08-06 Yuriy Kaminskiy - * src/pshinter/pshalgo.c (psh_hint_align): Fix a bug in the hinting - of small and ghost stems in the Postscript interpreter. + Fix conditional usage of FT_MulFix_i386. + With -ansi flag, gcc does not define `i386', only `__i386__'. -2007-02-20 suzuki toshiya + * include/freetype/config/ftconfig.h, builds/unix/ftconfig.in: + s/i386/__i386__/. - * src/base/ftmac.c (FT_GetFileRef_From_Mac_ATS_Name): Fix memory - leak, patch by "Jjgod Jiang" . - * builds/mac/ftmac.c (FT_GetFileRef_From_Mac_ATS_Name): Ditto. +2010-08-05 Werner Lemberg -2007-02-16 Werner Lemberg + Fix Savannah bug #30657. - * src/truetype/ttinterp.c (Ins_MD): Remove unused variable. - * src/autofit/aflatin.c (af_latin_hints_link_segments): Ditto. + * src/truetype/ttinterp.c (BOUNDSL): New macro. + Change `BOUNDS' to `BOUNDSL' where appropriate. -2007-02-14 David Turner + * src/truetype/ttinterp.h (TT_ExecContextRec): Fix type of + `cvtSize'. - It seems that the following changes fix most of the known - interpreter problems with my fonts, but more testing is needed, - though. +2010-08-05 Werner Lemberg - * src/truetype/ttinterp.c (FIX_BYTECODE): Activate. - (TT_MulFix14): Rewrite. - (Ins_MD, Ins_MDRP, Ins_IP) [FIX_BYTECODE]: Improved and updated. - (Ins_MIRP): Ditto. + Fix Savannah bug #30656. -2007-02-12 Werner Lemberg + * src/type42/t42parse.c (t42_parse_sfnts): Protect against negative + string_size. + Fix comparison. - * src/truetype/ttinterp.c (Project_x, Project_y): Remove compiler - warnings. +2010-08-05 suzuki toshiya - * src/pcf/pcfread.c (pcf_interpret_style), src/bdf/bdfdrivr.c - (bdf_interpret_style): Ditto. + [cff] Don't use any values in decoder after parsing error. -2007-02-12 David Turner + * src/cff/cffgload.c (cff_slot_load): Skip the evaluations + of the values in decoder, if cff_decoder_parse_charstrings() + returns any error. - Simplify projection and dual-projection code interface. +2010-08-04 Werner Lemberg - * src/truetype/ttinterp.h (TT_Project_Func): Use `FT_Pos', not - FT_Vector' as argument type. - * src/truetype/ttinterp.c (CUR_Func_project, CUR_Func_dualproj): - Updated. - (CUR_fast_project, CUR_fast_dualproj): New macros. - (Project, Dual_Project, Project_x, Project_y): Updated. - (Ins_GC, Ins_SCFS, Ins_MDAP, Ins_MIAP, Ins_IP): Use new `fast' - macros. + Fix Savannah bug #30644. + * src/base/ftstream.c (FT_Stream_EnterFrame): Fix comparison. - * src/autofit/afloader.c (af_loader_load_g): Improve spacing - adjustments for the non-light auto-hinted modes. Gets rid of - `inter-letter spacing is too wide' problems. +2010-08-04 Werner Lemberg - * src/autofit/aflatin.c (af_latin_hints_link_segments, - af_latin_hints_compute_edges): Slight optimization of the segment - linker and better handling of serif segments to get rid of broken - `9' in Arial at 9pt (96dpi). - - - Introduce new string functions and the corresponding macros to get - rid of various uses of strcpy and other `evil' functions, as well as - to simplify a few things. - - * include/freetype/internal/ftmemory.h (ft_mem_strdup, ft_mem_dup, - ft_mem_strcpyn): New declarations. - (FT_MEM_STRDUP, FT_STRDUP, FT_MEM_DUP, FT_DUP, FT_STRCPYN): New - macros. - * src/base/ftutil.c (ft_mem_dup, ft_mem_strdup, ft_mem_strcpyn): New - functions. - - * src/bfd/bfddrivr.c (bdf_interpret_style, BDF_Face_Init), - src/bdf/bdflib.c (_bdf_add_property), src/pcf/pcfread.c - (pcf_get_properties, pcf_interpret_style, pcf_load_font), - src/cff/cffdrivr.c (cff_get_glyph_name), src/cff/cffload.c - (cff_index_get_sid_string), src/cff/cffobjs.c (cff_strcpy), - src/sfnt/sfdriver.c (sfnt_get_glyph_name), src/type1/t1driver.c - (t1_get_glyph_name), src/type42/t42drivr.c (t42_get_glyph_name, - t42_get_name_index): Use new functions and simplify code. - - * builds/mac/ftmac.c (FT_FSPathMakeSpec): Don't use FT_MIN. - -2007-02-11 Werner Lemberg - - * src/autofit/afloader.c (af_loader_load_g): Don't change width for - non-spacing glyphs. - -2007-02-07 Tom Parker - - * src/cff/cffdrivr.c (cff_get_name_index): Protect against NULL - pointer. - -2007-02-05 suzuki toshiya - - * include/freetype/ftmac.h (FT_DEPRECATED_ATTRIBUTE): - Introduce __attribute((deprecated))__ to warn functions - which use non-ANSI data types in its interfaces. - (FT_GetFile_From_Mac_Name): Deprecated, using FSSpec. - (FT_GetFile_From_Mac_ATS_Name): Deprecated, using FSSpec. - (FT_New_Face_From_FSSpec): Deprecated, using FSSpec. - (FT_New_Face_From_FSRef): Deprecated, using FSRef. - - * src/base/ftmac.c: Predefine FT_DEPRECATED_ATTRIBUTE as void - to avoid warning in building FreeType. - * builds/mac/ftmac.c: Ditto. - -2007-02-05 suzuki toshiya - - * src/base/ftbase.c: Fix to use builds/mac/ftmac.c, if configured - `--with-fsspec' etc. Replace #include "ftmac.c" with - #include . - -2007-02-05 suzuki toshiya - - * include/freetype/ftmac.h (FT_GetFilePath_From_Mac_ATS_Name): - Introduced as replacement of FT_GetFile_From_Mac_ATS_Name. - * src/base/ftmac.c (FT_GetFilePath_From_Mac_ATS_Name): Ditto. - (FT_GetFile_From_Mac_ATS_Name): Rewritten as wrapper of - FT_GetFilePath_From_Mac_ATS_Name. - * builds/mac/ftmac.c: Ditto. - -2007-02-05 suzuki toshiya - - * include/freetype/ftmac.h: Fixed wrong comment: FSSpec of - FT_GetFile_From_Mac_Name, FT_GetFile_From_Mac_ATS_Name are - for passing to FT_New_Face_From_FSSpec. - -2007-02-05 suzuki toshiya - - * builds/unix/configure.raw: Check whether Mac OS X system headers - can be built under ANSI C mode. - - * src/base/ftmac.c (OS_INLINE): Redefine OS_INLINE by a version - compatible to ANSI C in case system headers are ANSI C incompatible. - * builds/mac/ftmac.c (OS_INLINE): Ditto. - -2007-02-01 Werner Lemberg - - * include/freetype/ttnameid.h (TT_MS_LANGID_DZONGHKA_BHUTAN): - Explain why applications shouldn't use it. Found by Alexei. - -2007-02-01 Alexei Podtelezhnikov - - * builds/unix/freetype2.m4 (AC_CHECK_FT2): Fix spelling of warning - message. - - * src/gxvalid/gxvmort1.c - (gxv_mort_subtable_type1_substTable_validate): Fix debugging - message. - -2007-01-31 Werner Lemberg - - - * Version 2.3.1 released. - ========================= - - - Tag sources with `VER-2-3-1-FINAL'. - - * builds/win32/visualc/freetype.dsp, - builds/win32/visualc/freetype.vcproj: s/230/231/. - * builds/win32/visualc/index.html: s/221/231/. - - * vms_make.com: Add `ftgasp'. - -2007-01-30 David Turner - - Tag sources with VER-2-3-1 to prepare release. - - * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1. - - * docs/VERSION.DLL, docs/release, README, Jamfile (RefDoc): - s/2.3.0/2.3.1/. - - * builds/unix/configure.raw (version_info): Set to 9:12:3. - - - * src/autofit/aftypes.h (AF_USE_WARPER), src/autofit/afloader.c - (af_loader_load_g): Disable the warper (i.e., the light hinting - improvements) to make a 2.3.1 bugfix release before introducing a - new feature. This should give us more time to tune and improve the - warper for the next release. - - * docs/CHANGES: Update accordingly. - -2007-01-25 David Turner - - For light auto-hinting, improve glyph advance widths and resurrect - normal/full hinting to its normal quality. - - * src/autofit/afhints.h (AF_GlyphHintsRec): New members `xmin_delta' - and `xmax_delta'. - * src/autofit/afhints.c (af_glyph_hints_reload): Reset `xmin_delta' - and `xmax_delta'. - - * src/autofit/afloader.c (af_loader_load_g) : Replace - preprocessor conditional with if-clause, handling both light and - normal mode. - - * src/autofit/afwarp.c (AF_WarpScore): Fine-tune again. - (af_warper_compute): Handle `xmin_delta' and `xmax_delta'. - -2007-01-25 Werner Lemberg - - * docs/release: Updated -- Savannah uses a new uploading scheme. - -2007-01-25 David Turner - - * src/cff/cffload.c (cff_index_get_pointers): Improve previous fix. - - * src/cff/cffgload.c (cff_decoder_parse_charstrings) - : Fix sanity check for empty - functions. - - * docs/CHANGES: Document light auto-hinting improvement. - -2007-01-25 Werner Lemberg - - * src/cff/cffload.c (cff_index_get_pointers): Handle last entry - correctly in a sanity check. Since this function is only used to - load local and global functions, any charstring that called the last - local/global function would fail otherwise. This fixes Savannah bug - #18867. - - * docs/CHANGES: Document it. - -2007-01-23 David Turner - - * src/truetype/ttobjs.c (tt_size_ready_bytecode): Fix typo that - prevented compilation when disabling both the unpatented and the - bytecode interpreter in the TrueType font driver. - - - Fix and enable the warper to improve `light' hinting mode. This is - not necessarily a final version, but it seems to work well. - - * src/autofit/aflatin.c (af_latin_hints_init) [AF_USE_WARPER]: - Disable code. - (af_latin_hints_apply) [AF_USE_WARPER]: Handle FT_RENDER_MODE_LIGHT. - * src/autofit/aftypes.h: Activate AF_USE_WARPER. - - * src/autofit/afwarp.c (AF_WarpScore): Tune table. - (af_warper_compute_line_best): Fix array size of `scores'. - (af_warper_compute): Better handling of border cases. - * src/autofit/afwarp.h (AF_WarperRec): Remove unused members `X1' - and `X2'. - -2007-01-21 Werner Lemberg - - * ChangeLog: Split off older entries into... - * ChangeLog.22: This new file. - -2007-01-21 Werner Lemberg - - * docs/CHANGES: Document SHZ fix. - -2007-01-21 George Williams - - * src/truetype/ttinterp.c (Ins_SHZ): SHZ doesn't move phantom - points. - -2007-01-21 Werner Lemberg - - * src/sfnt/ttmtx.c (tt_face_get_metrics) - [!FT_CONFIG_OPTION_OLD_INTERNALS]: Fix limit check. - -2007-01-17 Werner Lemberg - - - * Version 2.3.0 released. - ========================= - - - Tag sources with `VER-2-3-0-FINAL'. - -2007-01-17 Werner Lemberg - - * docs/release: Updated. - -2007-01-16 David Turner - - * src/autofit/aflatin.c (af_latin_hints_compute_segments), - src/cff/cffdriver.c (cff_ps_get_font_info), src/truetype/ttobjs.c - (tt_face_init), src/truetype/ttinterp.c (Ins_SHC): Fix compiler - warnings. - -2007-01-15 Detlef Würkner - - * builds/amiga/makefile, builds/amiga/makefile.os4, - builds/amiga/smakefile: Add `ftgasp.c' and `ftlcdfil.c'. - - * builds/amiga/include/freetype/config/ftconfig.h: Synchronize. - -2007-01-14 Detlef Würkner - - Fix various compiler warnings. - - * src/truetype/ttdriver.c (tt_size_select), src/cff/cffobjs.h, - src/cff/cffobjs.c (cff_size_request), src/type42/t42objs.h: - s/index/strike_index/. - * src/base/ftobjs.c (FT_Match_Size): s/index/size_index/. - - * src/gxvalid/gxvmorx5.c - (gxv_morx_subtable_type5_InsertList_validate): s/index/table_index/. - - * src/truetype/ttinterp.c (Compute_Point_Displacement), - src/pcf/pcfread.c (pcf_seek_to_table_type): Avoid possibly - uninitialized variables. - -2007-01-13 suzuki toshiya - - * docs/CHANGES, docs/INSTALL.MAC: Improvements. - -2007-01-13 Werner Lemberg - - * src/type1/t1afm.c (T1_Read_Metrics): MS Windows allows PFM - versions up to 0x3FF without complaining. - -2007-01-13 Derek Clegg - - Add FT_Get_PS_Font_Info interface to CFF driver. - - * src/cff/cfftypes.h: Include FT_TYPE1_TABLES_H. - (CFF_FontRec): Add `font_info' field. - - * src/cff/cffload.c: Include FT_TYPE1_TABLES_H. - (cff_font_done): Free font->font_info if necessary. - - * src/cff/cffdrvr.c (cff_ps_get_font_info): New function. - (cff_service_ps_info): Register cff_ps_get_font_info. - -2007-01-13 Werner Lemberg - - * src/base/ftoutln.c (FT_Outline_Get_Orientation): Fix compilation - with C++ compiler. - - * src/autofit/afhints.c (af_glyph_hints_dump_segments, - af_glyph_hints_dump_edges): Ditto. - - * src/base/rules.mk (BASE_SRC): Remove ftgasp.c (it's already in - `modules.cfg'). - - * src/sfnt/ttsbit0.h: Remove. - - * src/sfnt/rules.mk (SFNT_DRV_SRC): Don't include ttsbit0.c. - -2007-01-12 David Turner - - * src/base/ftbitmap.c (ft_bitmap_assure_buffer): Fix memory stomping - bug in the bitmap emboldener if the pitch of the source bitmap is - much larger than its width. - - * src/truetype/ttinterp.c (Update_Max): Fix aliasing-related - compilation warning. - -2007-01-12 Werner Lemberg - - * builds/unix/install-sh, builds/unix/mkinstalldirs: Updated from - `automake' CVS module from sources.redhat.com. - -2007-01-11 Werner Lemberg - - * src/type1/t1load.c (is_space): Removed. - (parse_encoding, parse_charstrings): Use IS_PS_DELIM. - (parse_charstrings): Use IS_PS_TOKEN. - - - * autogen.sh: Avoid bash specific syntax. - -2007-01-11 David Turner - - * docs/CHANGES: Small update. - - * builds/unix/configure.raw (version_info): Set to 9:11:3. - - * src/base/ftobjs.c (IsMacResource): Fix a small bug that caused a - crash with some Mac OS X .dfont files. Submitted by Masatake - Yamato. - - * autogen.sh: Small fix to get it working on Mac OS X properly: - The issue is that GNU libtool is called `glibtool' on this platform, - and we must call `glibtoolize', since `libtoolize' doesn't exist. - -2007-01-10 David Turner - - * all-sources: Tag all sources with VER-2-3-0-RC1 and - VER-2-3-0. - - * Jamfile (RefDoc), README, builds/win32/visualc/freetype.dsp, - builds/win32/visualc/freetype.vcproj, docs/VERSION.DLL: Update - version number to 2.3.0. - - * include/freetype/freetype.h (FREETYPE_MINOR): Set to 3. - (FREETYPE_PATCH): Set to 0. - - * include/freetype/ftchapters.h, include/freetype/ftgasp.h, - include/freetype/ftlcdfil.h: Update reference documentation with - GASP support and LCD filtering sections. - - * src/pshinter/pshalgo.c (psh_glyph_compute_inflections): Fix a typo - which created an endless loop with some malformed font files. - -2007-01-10 Derek Clegg - - * src/type1/t1load.c (T1_Get_MM_Var): Always return fixed point - values. - -2007-01-08 David Turner - - * docs/CHANGES: Updated. - - * include/freetype/ftgasp.h, src/base/ftgasp.c: New files which add - a new API `FT_Get_Gasp' to return entries of the `gasp' table - corresponding to a given character pixel size. - - * src/sfnt/ttload.c (tt_face_load_gasp): Add version check for the - `gasp' table, in order to avoid potential problems with later - versions. - - * include/freetype/config/ftheader.h (FT_GASP_H): New macro for - . - - * src/base/rules.mk (BASE_SRC), src/base/Jamfile (_sources), - modules.cfg (BASE_EXTENSIONS), builds/win32/visualc/freetype.dsp, - builds/win32/visualc/freetype.vcproj: Add src/base/ftgasp.c to the - default build. - -2007-01-07 Werner Lemberg - - * src/cid/cidparse.c (cid_parser_new): Improve error message for - Type 11 fonts. - Scan for `/sfnts' token. - -2007-01-07 Werner Lemberg - - * src/cid/cidparse.c (cid_parser_new): Reject Type 11 fonts. - -2007-01-06 Werner Lemberg - - * src/cff/cffload.c (cff_index_init): Remove unused variable. - (cff_index_read_offset): s/perror/errorp/ to avoid global shadowing. - -2007-01-04 David Turner - - * src/pfr/pfrobjs.c (pfr_face_init): Detect non-scalable fonts - correctly. This fixes Savannah bug #17876. - - - Do not allocate interpreter-specific tables in memory if we are not - going to load glyphs with the bytecode interpreter anyway. - - * src/truetype/ttgload.c (tt_loader_init): Load execution context - only if glyph is hinted. - Updated. - * src/truetype/ttobjs.h (TT_SizeRec): Add members `bytecode_ready' - and `cvs_ready'. - Add `tt_size_ready_bytecode' declaration. - * src/truetype/ttobjs.c (tt_size_done_bytecode, - tt_size_init_bytecode, tt_size_ready_bytecode): New functions. - (tt_size_init): Move most code into `tt_size_init_bytecode'. - (tt_size_done): Move most code into `tt_size_done_bytecode'. - (tt_size_reset): Move some code to `tt_size_ready_bytecode'. - - - Don't extract the metrics table from the SFNT font file. Instead, - reparse it on each glyph load. The runtime difference is not - noticeable, and it can save a lot of heap memory when memory-mapped - files are not used. - - * include/freetype/internal/tttypes.h (TT_FaceRec): Add members - `horz_metrics_offset' and `vert_metrics_ofset'. - * src/sfnt/ttmtx.c (tt_face_load_hmtx, tt_face_get_metrics): - Updated. - - - * src/sfnt/ttcmap.c (tt_cmap4_validate): Slight optimization. - - - Do not load the CFF index offsets into memory, since this wastes a - *lot* of heap memory with large Asian CFF fonts. There is no - significant performance loss. - - * src/cff/cffload.h: Add `cff_charset_cid_to_gindex' declaration. - * src/cff/cfftypes.h (CFF_IndexRec): Add fields `start' and - `data_size'. - (CFF_CharsetRec): Add field `num_glyphs'. - - * src/cff/cffload.c (cff_index_read_offset, cff_index_load_offsets, - cff_charset_cid_to_gindex): New functions. - (cff_new_index): Renamed to... - (cff_index_init): This. Update all callers. - Updated -- some code has been moved to `cff_index_load_offsets'. - (cff_done_index): Renamed to... - (cff_index_done): This. Update all callers. - (cff_index_get_pointers, cff_index_access_element): Updated to use - stream offsets. - (cff_charset_compute_cids): Set `num_glyphs' field. - (cff_encoding_load): Updated. - - * src/cff/cffgload.c (cff_slot_load): Updated. - -2007-01-04 David Turner - - * docs/INSTALL.UNIX: Simplify some parts, add reference to - autogen.sh and pointer to README.CVS. - - * README.CVS: Add common problem description and solution - when running autogen.sh. - - * docs/INSTALL: Add reference to MacOS X. - - * docs/MAKEPP, docs/INSTALL.MAC: New documentation files. - - * docs/TODO: Remove obsolete items. - - * src/raster/ftraster.c: (TRaster_Instance): Replace it with... - (TWorker): This. - Remove `count_table' and `memory'. - Make `grays' a pointer. - (TRaster): New structure. - (count_table): New static array. - (RAS_ARGS, RAS_ARG, RAS_VARS, RAS_VAR, FT_UNUSED_RASTER, cur_ras, - Vertical_Gray_Sweep_Step, ft_black_new, ft_black_done, - ft_black_set_mode, ft_black_render): Updated. - (ft_black_init): Don't initialize `count_table'. - (ft_black_reset): Use the render pool. This saves about 6KB of - heap space for each FT_Library instance. - - * src/smooth/ftgrays.c (TRaster): Replaced with... - (TWorker): This. - Remove `memory'. - (TRaster): New structure. - - (RAS_ARG_, RAS_ARG, RAS_VAR_, RAS_VAR, ras, gray_render_line, - gray_move_to, gray_line_to, gray_conic_to, gray_cubic_to, - gray_render_span, gray_raster_render): Updated. - (gray_raster_reset): Use the render pool. This saves about 6KB of - heap space for each FT_Library instance. - - * src/sfnt/sfobjs.c, src/sfnt/ttkern.c, src/sfnt/ttkern.h, - src/sfnt/ttmtx.c, src/sfnt/ttsbit.c, src/sfnt/ttsbit.h, - src/truetype/ttpload.c, include/freetype/config/ftoption.h: Remove - FT_OPTIMIZE_MEMORY macro (and code for !FT_OPTIMIZE_MEMORY) since - the optimization is no longer experimental. - - * src/pshinter/pshalgo.c (psh_glyph_interpolate_normal_points): - Remove a typo that results in no hinting and a memory leak with some - large Asian CFF fonts. - - * src/base/ftobjs.c (FT_Done_Library): Remove a subtle memory leak - which happens when FT_Done_Library is called with still opened - CFF_Faces in it. We need to close all faces before destroying the - modules, or else some bad things (memory leaks) may happen. - -2007-01-02 Werner Lemberg - - * src/gxvalid/gxvkern.c (gxv_kern_subtable_fmt0_pairs_validate): - Remove compiler warning. - -2007-01-02 David Turner - - * src/sfnt/sfobjs.c: Add documentation comment. - -2006-12-31 Masatake YAMATO - - * src/gxvalid/gxvkern.c (gxv_kern_subtable_fmt0_pairs_validate): New - function. - Check uniqueness of the gid pairs. - (gxv_kern_subtable_fmt0_validate): Move some code to - `gxv_kern_subtable_fmt0_pairs_validate'. - -2006-12-22 David Turner - - * src/autofit/aflatin.c, src/truetype/ttgload.c: Remove compiler - warnings. - - * builds/win32/visualc/freetype.vcproj: Add _CRT_SECURE_NO_DEPRECATE - to avoid deprecation warnings with Visual C++ 8. - -2006-12-16 Anders Kaseorg - - * src/base/ftlcdfil.c (FT_Library_SetLcdFilter) - [FT_FORCE_LIGHT_LCD_FILTER]: Fix typo. - -2006-12-15 suzuki toshiya - - * include/freetype/internal/services/svotval.h: Add `volatile' to - sync with the modification by Jens Claudius on 2006-08-22; cf. - http://cvs.savannah.gnu.org/viewcvs/freetype/freetype2/src/otvalid/otvmod.c?r1=1.4&r2=1.5 - -2006-12-15 suzuki toshiya - - * src/base/ftmac.c: Specialized for Mac OS X only. - * builds/unix/ftconfig.in: Fixed for ppc64 missing Carbon framework. - * builds/unix/configure.raw: Ditto. When explicit switches for - FSSpec/FSRef/QuickDraw/ATS availability are given to configure, - builds/mac/ftmac.c is used instead of default src/base/ftmac.c. - -2006-12-15 suzuki toshiya - - * builds/mac/ftmac.c: Copied src/base/ftmac.c for legacy system. - * builds/mac/FreeType.m68k_cfm.make.txt: Fix to use builds/mac/ftmac.c - instead of src/base/ftmac.c - * builds/mac/FreeType.ppc_carbon.make.txt: Ditto. - * builds/mac/FreeType.ppc_classic.make.txt: Ditto. - * builds/mac/FreeType.m68k_far.make.txt: Ditto, and exclude gxvalid.c - that cannot be built at present. - -2006-12-15 suzuki toshiya - - * src/base/ftobjs.c: Improvement of resource fork handler for - POSIX, cf. - http://lists.gnu.org/archive/html/freetype-devel/2006-10/msg00025.html - (Mac_Read_sfnt_Resource): Count only `sfnt' resource of suitcase font - format or .dfont, to simulate the face index number counted by ftmac.c. - (IsMacResource): Return the number of scalable faces correctly. - -2006-12-10 Werner Lemberg - - * builds/toplevel.mk (version): Protect against `distclean' target. - -2006-12-09 Werner Lemberg - - * builds/*/*def.mk, builds/*/detect.mk (CAT): Define to either `cat' - or `type'. - - * builds/freetype.mk (version): Extracted from freetype.h, using - GNU make's built-in string functions. - (refdoc): Use $(version) instead of static version number. - -2006-12-08 Werner Lemberg - - * builds/toplevel.mk (dist): Extract version number from freetype.h. - -2006-12-08 Vladimir Volovich - - * src/tools/apinames.c (State): Remove final comma in structure -- - xlc v5 under AIX 4.3 doesn't like this. - -2006-12-07 David Turner - - * src/autofit/afloader.c (af_loader_load_g): Small adjustment - to the spacing of auto-fitted glyphs. This only impacts rare - cases (e.g., Arial Bold at rather small character sizes). - -2006-12-03 Werner Lemberg - - * src/sfnt/rules.mk (SFNT_DRV_SRC): Add ttsbit0.c. - -2006-12-01 Werner Lemberg - - * src/sfnt/sfobjs.c (tt_face_get_name): All Unicode strings are - encoded in UTF-16BE. Patch from Rajeev Pahuja . - (tt_name_entry_ascii_from_ucs4): Removed. - - - * include/freetype/ftxf86.h: Fix and extend comment so that it - appears in the documentation. - - * include/freetype/ftchapters.h: Add `font_format' section. - - - * src/tools/docmaker/tohtml.py (HtmlFormatter::index_exit): Add link - to TOC in index page. - -2006-11-28 David Turner - - * src/smooth/ftgrays.c (gray_raster_render): Return 0 when we are - trying to render into a zero-width/height bitmap, not an error code. - - * src/truetype/ttobjs.c (tt_face_init): Fix typo in previous patch. - - * src/smooth/ftgrays.c: Remove hard-coded error values; use FreeType - ones instead. - - * src/autofit/afhints.c (af_glyph_hints_dump_segments): Remove unused - variable. - -2006-11-26 Pierre Hanser - - * src/truetype/ttobjs.c (tt_face_init): Protect against NULL pointer. - -2006-11-25 David Turner - - * src/autofit/afhints.c (af_glyph_hints_dump_points, - af_glyph_hints_dump_segments, af_glyph_hints_dumpedges) [!AF_DEBUG]: - Add stubs to link the `ftgrid' test program when debugging is - disabled in the auto-hinter. - -2006-11-23 David Turner - - * src/autofit/afhints.c, src/autofit/afhints.h, src/autofit/aflatin.c, - src/autofit/aftypes.h: Miscellaneous auto-hinter improvements. - - * src/autofit/afhints.c (af_glyph_hints_dump_segments) [AF_DEBUG]: - Emit more sensible information. - - * src/autofit/afhints.h (AF_SegmentRec): Add `height' member. - - * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Improve - rounding of blue values. - (af_latin_hints_compute_segments): Hint segment heights. - (af_latin_hints_link_segments): Reduce `len_score' value. - (af_latin_hints_compute_edges): Increase `segment_length_threshold' - value and use `height' member for comparisons. - (af_latin_hint_edges): Extend logging message. - Improve handling of remaining edges. - -2006-11-22 Werner Lemberg - - Fix Savannah bug #15553. - - * src/truetype/ttgload.c (tt_loader_init): Re-execute the CVT - program after a change from mono to grayscaling (and vice versa). - Use correct constant for comparison to get `exec->grayscale'. - -2006-11-18 Werner Lemberg - - Because FT_Load_Glyph expects CID values for CID-keyed fonts, the - test for a valid glyph index must be deferred to the font drivers. - This patch fixes Savannah bug #18301. - - * src/base/ftobjs.c (FT_Load_Glyph): Don't check `glyph_index'. - * src/bdf/bdfdrivr.c (BDF_Glyph_Load), src/cff/cffgload.c - (cff_slot_load), src/cid/cidgload.c (cid_slot_load_glyph), - src/pcf/pcfdrivr.c (PCF_Glyph_Load), src/pfr/pfrobjs.c - (pfr_slot_load), src/truetype/ttdriver.c (Load_Glyph), - src/type1/t1gload.c (T1_Load_Glyph), src/winfonts/winfnt.c - (FNT_Load_Glyph): Check validity of `glyph_index'. - -2006-11-13 David Turner - - * src/truetype/ttinterp.c (FIX_BYTECODE): Undefine. The interpreter - `enhancements' are still too buggy for general use. - - * src/base/ftlcdfil.c: Add support for FT_FORCE_LIGHT_LCD_FILTER and - FT_FORCE_LEGACY_LCD_FILTER at compile time. Define these macros - when building the library to change the default LCD filter to be - used. This is only useful for experimentation. - - * include/freetype/ftlcdfil.h: Update documentation. - -2006-11-10 David Turner - - * src/smooth/ftsmooth.c: API change for the LCD - filter. The FT_LcdFilter value is an enumeration describing which - filter to apply, with new values FT_LCD_FILTER_LIGHT and - FT_LCD_FILTER_LEGACY (the latter implements the LibXft original - algorithm which produces strong color fringes for everything - except very-well hinted text). - - * include/freetype/ftlcdfil.h (FT_Library_SetLcdFilter): Change - second parameter to an enum type. - - * src/base/ftlcdfil.c (USE_LEGACY): Define. - (_ft_lcd_filter): Rename to... - (_ft_lcd_filter_fir): This. - Update parameters. - (_ft_lcd_filter_legacy) [USE_LEGACY]: New filter function. - (FT_Library_Set_LcdFilter): Update parameters. - Handle new filter modes. - - * include/internal/ftobjs.h: Include FT_LCD_FILTER_H. - (FT_Bitmap_LcdFilterFunc): Change third argument to `FT_Library'. - (FT_LibraryRec) [FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Add filtering - callback and update other fields. - - * src/smooth/ftsmooth.c (ft_smooth_render_generic) - [FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Update. - Other minor improvements. - - * src/autofit/aflatin.c: Various tiny improvements that drastically - improve the handling of serif fonts and of LCD/LCD_V hinting modes. - (af_latin_hints_compute_edges): Fix typo. - (af_latin_compute_stem_width): Take better care of diagonal stems. - -2006-11-09 David Turner - - * src/pshinter/pshalgo.c (psh_glyph_compute_inflections): Fix - typo which created a variable-used-before-initialized bug. - -2006-11-07 Zhe Su - - * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Handle vertical layout - also. - -2006-11-03 Werner Lemberg - - * src/base/ftcalc.c: Don't use `long long' but `FT_Int64'. - -2006-11-02 David Turner - - Add a few tweaks to better handle serif fonts. - Add more debugging messages. - - * src/autofit/aflatin.c (af_latin_hints_compute_edges): Ignore - segments that are less than 1.5 pixels high. This gets rid of - *many* corner cases with serifs. - (af_latin_align_linked_edge): Add logging message. - (af_latin_hint_edges): Use AF_HINTS_DO_BLUES. - Add logging messages. - Handle AF_EDGE_FLAG flag specially. - - * src/autofit/afmodule.c [AF_DEBUG]: Add _af_debug, - _af_debug_disable_blue_hints, and _af_debug_hints variables. - - * src/autofit/aftypes.h (AF_LOG) [AF_DEBUG]: Use _af_debug. - Update external declarations. - (af_corner_orientation, af_corner_is_flat): Replaced by... - - * include/freetype/internal/ftcalc.h (ft_corner_orientation, - ft_corner_is_flat): These declarations. - - * src/autofit/afangles.c (af_corner_orientation, af_corner_is_flat): - Comment out. Replaced by... - - * src/base/ftcalc.h (ft_corner_orientation, ft_corner_is_flat): - These functions. Update all callers. - (FT_Add64) [!FT_LONG64]: Simplify. - - * src/autofit/afhints.c: Include FT_INTERNAL_CALC_H. - (af_direction_compute): Add a missing FT_ABS call. This bug caused - production of garbage by missing lots of segments. - - * src/autofit/afhints.h (AF_HINTS_DO_BLUES): New macro. - - * src/autofit/afloader.c (af_loader_init, af_loader_done) - [AF_DEBUG]: Set _af_debug_hints. - - - * src/pshinter/pshalgo.c: Include FT_INTERNAL_CALC_H. - (psh_corner_is_flat, psh_corner_orientation): Use ft_corner_is_flat - and ft_corner_orientation. - - - * src/gzip/inftrees.c (huft_build): Remove compiler warning. - -2006-10-24 Werner Lemberg - - * src/cff/cffload.c (cff_encoding_load): Remove unused variable. - - * src/base/ftobjs.c (FT_Select_Charmap): Disallow FT_ENCODING_NONE - as argument. - -2006-10-23 Zhe Su - - * src/base/ftoutln.c (FT_Outline_Get_Orientation): Re-implement to - better deal with broken Asian fonts with strange glyphs, having - self-intersections and other peculiarities. The used algorithm is - based on the nonzero winding rule. - -2006-10-23 David Turner - - Speed up the CFF font loader. With some large CFF fonts, - FT_Open_Face is now more than three times faster. - - * src/cff/cffload.c (cff_get_offset): Removed. - (cff_new_index): Inline functionality of `cff_get_offset'. - (cff_charset_compute_cids, cff_charset_free_cids): New functions. - (cff_charset_done): Call `cff_charset_free_cids'. - (cff_charset_load): Call `cff_charset_compute_cids'. - (cff_encoding_load) : Ditto, to replace inefficient loop. - - * src/sfnt/ttmtx.c (tt_face_load_hmtx): Replace calls to FT_GET_XXX - with FT_NEXT_XXX. - - - Speed up the Postscript hinter, with more than 100% speed increase - on my machine. - - * src/pshinter/pshalgo.c (psh_corner_is_flat, - psh_corner_orientation): New functions. - (psh_glyph_compute_inflections): Merge loops for efficiency. - Use `psh_corner_orientation'. - (psh_glyph_init): Use `psh_corner_is_flat'. - (psh_hint_table_find_strong_point): Renamed to... - (psh_hint_table_find_strong_points): This. - Rewrite, adding argument to handle all points at once. - Update all callers. - (PSH_MAX_STRONG_INTERNAL): New macro. - (psh_glyph_interpolate_normal_points): Rewrite for efficiency. - -2006-10-15 suzuki toshiya - - * src/base/ftmac.c (FT_New_Face_From_FOND): Initialize variable - `error' with FT_Err_Ok. - -2006-10-14 suzuki toshiya - - * docs/INSTALL.CROSS: New document file for cross-building. - - * builds/unix/configure.raw: Preliminary cross-building support. - Find native C compiler and pass it by CC_BUILD, and - find suffix for native executable and pass it by EXEEXT_BUILD. - Also suffix for target executable is passed by EXEEXT. - - * builds/unix/unix-cc.in (CCraw_build, E_BUILD): New variables to - build `apinames' which runs on building system. They are set by - CC_BUILD and EXEEXT_BUILD. - - * builds/exports.mk (APINAMES_EXE): Change the extension for - apinames from the suffix for target (E) to that for building host - (E_BUILD). - -2006-10-12 Werner Lemberg - - * docs/INSTALL.UNX, docs/UPGRADE.UNX: Renamed to... - * docs/INSTALL.UNIX, docs/UPGRADE.UNIX: This. Update all documents - which reference those files. - -2006-10-12 suzuki toshiya - - * builds/unix/configure.raw (FT2_EXTRA_LIBS): New variable. It is - embedded in freetype2.pc and freetype-config. Use it to record - Carbon dependency of MacOSX. - - * builds/unix/freetype2.in: Embed FT2_EXTRA_LIBS. - - * builds/unix/freetype-config.in: Ditto. - -2006-10-11 Werner Lemberg - - * devel/ftoption.h (FT_CONFIG_OPTION_SUBPIXEL_RENDERING): Define for - development. - -2006-10-03 Jens Claudius - - * include/freetype/config/ftstdlib.h: Cast away volatileness from - argument to ft_setjmp. - - * include/freetype/internal/ftvalid.h: Add comment that - ft_validator_run must not be used. - -2006-10-01 Werner Lemberg - - * src/base/ftbase.c: Undo change from 2006-09-30. - - * src/base/rules.mk (BASE_SRC): Remove `ftlcdfil.c'. - -2006-09-30 David Turner - - * include/freetype/internal/ftobjs.h (FT_Face_InternalRec): - s/unpatented_hinting/ignore_unpatented_hinter/. - Update all callers. - - * src/base/ftobjs.c (FT_Load_Glyph): Refine the algorithm whether - auto-hinting shall be used or not. - - * src/truetype/ttobjs.c (tt_face_init): Ditto. - -2006-09-30 Werner Lemberg - - * src/base/rules.mk (BASE_SRC): Remove `ftapi.c' (which is no longer - in use). - - * src/base/ftbase.c: Include `ftlcdfil.c'. - -2006-09-29 Werner Lemberg - - * src/sfnt/ttcmap.c (tt_cmap4_char_map_binary): Fix algorithm for - overlapping segments. Bug reported by Stefan Koch. - -2006-09-28 David Turner - - Fix a bug in the automatic unpatented hinting support which prevents - normal bytecode hinting to work properly. - - * include/freetype/internal/ftobjs.h (FT_Face_InternalRec): - s/force_autohint/unpatented_hinting/. Update all callers. - - * src/base/ftobjs.c (FT_Load_Glyph): Updated code. - - * src/autofit/aftypes.h (AF_DEBUG): Undefine to get rid of traces. - -2006-09-27 David Turner - - * include/freetype/freetype.h (FT_FREETYPE_PATCH): Set to 2. - - - Add a new API to support color filtering of subpixel glyph bitmaps. - In a default build, the function `FT_Library_SetLcdFilter' returns - `FT_Err_Unimplemented_Feature'; you need to #define - FT_CONFIG_OPTION_SUBPIXEL_RENDERING in ftoption.h to compile the - real implementation. - - * include/freetype/ftlcdfil.h, src/base/ftlcdfil.c: New files. - - * include/freetype/internal/ftobjs.h (FT_Bitmap_LcdFilterFunc): New - typedef. - (FT_LibraryRec) [FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: New members - `lcd_filter_weights' and `lcd_filter'. - - * src/smooth/ftsmooth.c (ft_smooth_render_generic): Remove arguments - `hmul' and `vmul'. - - Handle subpixel rendering. - Simplify function. - (ft_smooth_render_lcd): Use `FT_RENDER_MODE_LCD'. - (ft_smooth_render_lcd_v): Use `FT_RENDER_MODE_LCD_V'. - - * include/freetype/config/ftheader.h (FT_LCD_FILTER_H): New macro, - pointing to . - - * src/base/Jamfile (_sources), src/base/rules.mk (BASE_SRC), - vms_make.com: Add `ftlcdfil.c' to the list of compiled source files. - - * modules.cfg (BASE_EXTENSIONS): Add ftlcdfil.c. - -2006-09-26 David Bustin - - * src/pfr/pfrobjs.c (pfr_face_get_kerning): Skip adjustment bytes - correctly. Reported as Savannah bug #17843. - -2006-09-26 David Turner - - * src/autofit/afhints.h (AF_HINTS_DO_HORIZONTAL, - AF_HINTS_DO_VERTICAL, AF_HINTS_DO_ADVANCE): New macros to disable - horizontal and vertical hinting for the purpose of debugging the - auto-fitter. - - * src/autofit/afmodule.c (_af_debug_disable_horz_hints, - _af_debug_disable_vert_hints) [AF_DEBUG]: New global variables. - - * src/autofit/aftypes.h [AF_DEBUG]: Declare above variables. - - * include/freetype/config/ftoption.h, devel/ftoption.h - (FT_CONFIG_OPTION_SUBPIXEL_RENDERING): New macro to control whether - we want to compile LCD-optimized rendering code (à la ClearType) or - not. The macro *must* be disabled in default builds of the library - for patent reasons. - - * src/smooth/ftsmooth.c (ft_smooth_render_generic): Disable - LCD-specific rendering when FT_CONFIG_OPTION_SUBPIXEL_RENDERING - isn't defined at compile time. This only changes the content of the - rendered glyph to match the one of normal gray-level rendering, - hence clients should not need to be modified. - - * docs/CHANGES: Updated. - -2006-09-18 Garrick Meeker - - * src/base/ftmac.c (FT_New_Face_From_FOND): Fall back to SFNT if - LWFN fails and both are available. - -2006-09-11 David Turner - - * src/sfnt/sfobjs.c (tt_face_get_name): Support some fonts which - report their English names through an Apple Roman - (platform,encoding) pair, with language_id != English. - - If the font uses another name entry with language_id == English, it - will be selected correctly, though. - - * src/truetype/ttobjs.c (tt_face_init): Add unpatented hinting - selection for `mingli.ttf'. - -2006-09-05 Werner Lemberg - - * src/truetype/ttpload.c (tt_face_load_hdmx): Handle `record_size' - values which have the upper two bytes set to 0xFF instead of 0x00 - (as it happens in at least two CJKV fonts, `HAN NOM A.ttf' and - `HAN NOM B.ttf'). - - * src/smooth/ftgrays.c [GRAYS_USE_GAMMA]: Really remove all code. - -2006-09-05 David Turner - - Minor source cleanups and optimizations. - - * src/smooth/ftgrays.c (GRAYS_COMPACT): Removed. - (TRaster): Remove `count_ex' and `count_ey'. - (gray_find_cell): Remove 2nd and 3rd argument. - (gray_alloc_cell): Merged with `gray_find_cell'. - (gray_record_cell): Simplify. - (gray_set_cell): Rewrite. - (gray_start_cell): Apply offsets to `ras.ex' and `ras.ey'. - (gray_render_span): Don't use FT_MEM_SET for small values. - (gray_dump_cells) [DEBUG_GRAYS]: New function. - (gray_sweep): Avoid buffer overwrites when to drawing the end of a - bitmap scanline. - (gray_convert_glyph): Fix speed-up. - -2006-09-04 David Turner - - * src/smooth/ftgrays.c (gray_convert_glyphs): Make it work with - 64bit processors. - -2006-09-03 Werner Lemberg + `make devel' fails if FT_CONFIG_OPTION_OLD_INTERNALS is set. * devel/ftoption.h: Synchronize with include/freetype/config/ftoption.h. - * src/smooth/ftgrays.c (gray_record_cell): Remove shadowing - variable declaration. - (gray_convert_glyph): Fix compiler warnings. +2010-08-04 suzuki toshiya -2006-09-01 David Turner + [cff] Improve stack overflow test. - * src/truetype/ttobjs.c (tt_face_init): Update the TrueType loader - to recognize a few fonts that require the automatic unpatented - loader. + * src/cff/cffgload.c (cff_decoder_parse_charstrings): Check stack + after execution of operations too. - * src/smooth/ftgrays.c: Optmize the performance of the anti-aliased - rasterizer. The speed improvement is between 15% and 25%, depending - on the font data. +2010-07-18 Werner Lemberg - (GRAYS_USE_GAMMA, GRAYS_COMPACT): Removed, and all associated code. - (TCell): Redefine. - (TRaster): New members `buffer', `buffer_size', `ycells', `ycount'. - (gray_init_cells): Updated. - (gray_find_cell, gray_alloc_cell): New functions. - (gray_record_cell): Rewritten to use `gray_find_cell' and - `gray_alloc_cell'. - (PACK, LESS_THAN, SWAP_CELLS, DEBUG_SORT, QUICK_SORT, SHELL_SORT, - QSORT_THRESHOLD): + Add reference counters and to FT_Library and FT_Face objects. + + * include/freetype/freetype.h (FT_Reference_Face): New function. + * include/freetype/ftmodapi.h (FT_Rererence_Library): New function. + + * include/freetype/internal/ftobjs.h (FT_Face_InternalRec, + FT_LibraryRec): New field `refcount'. + + * src/base/ftobjs.c (FT_Open_Face, FT_New_Library): Handle + `refcount'. + (FT_Reference_Face, FT_Reference_Library): Implement new functions. + (FT_Done_Face, FT_Done_Library): Handle `refcount'. + + * docs/CHANGES: Updated. + +2010-07-18 Werner Lemberg + + * Version 2.4.1 released. + ========================= + + + Tag sources with `VER-2-4-1'. + + * docs/CHANGES: Updated. + + * docs/VERSION.DLL: Update documentation and bump version number to + 2.4.1. + + * README, Jamfile (RefDoc), + builds/win32/vc2005/freetype.vcproj, builds/win32/vc2005/index.html, + builds/win32/vc2008/freetype.vcproj, builds/win32/vc2008/index.html, + builds/win32/visualc/freetype.dsp, + builds/win32/visualc/freetype.vcproj, + builds/win32/visualc/index.html, builds/win32/visualce/freetype.dsp, + builds/win32/visualce/freetype.vcproj, + builds/win32/visualce/index.html, + builds/wince/vc2005-ce/freetype.vcproj, + builds/wince/vc2005-ce/index.html, + builds/wince/vc2008-ce/freetype.vcproj, + builds/wince/vc2008-ce/index.html: s/2.4.0/2.4.1/, s/240/241/. + + * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1. + + * builds/unix/configure.raw (version_info): Set to 11:1:5. + +2010-07-17 Werner Lemberg + + [cff] Final try to fix `hintmask' and `cntrmask' limit check. + + Problem reported by Tobias Wolf . + + * src/cff/cffgload.c (cff_decoder_parse_charstrings) + : Sigh. I'm apparently too silly to fix this + correctly in less than three tries. + +2010-07-12 Werner Lemberg + + * Version 2.4.0 released. + ========================= + + + Tag sources with `VER-2-4-0'. + + * docs/CHANGES: Updated. + + * docs/VERSION.DLL: Update documentation and bump version number to + 2.4.0. + + * README, Jamfile (RefDoc), + builds/win32/vc2005/freetype.vcproj, builds/win32/vc2005/index.html, + builds/win32/vc2008/freetype.vcproj, builds/win32/vc2008/index.html, + builds/win32/visualc/freetype.dsp, + builds/win32/visualc/freetype.vcproj, + builds/win32/visualc/index.html, builds/win32/visualce/freetype.dsp, + builds/win32/visualce/freetype.vcproj, + builds/win32/visualce/index.html, + builds/wince/vc2005-ce/freetype.vcproj, + builds/wince/vc2005-ce/index.html, + builds/wince/vc2008-ce/freetype.vcproj, + builds/wince/vc2008-ce/index.html: s/2.3.12/2.4.0/, s/2312/240/. + + * include/freetype/freetype.h (FREETYPE_MINOR): Set to 4. + (FREETYPE_PATCH): Set to 0. + + * builds/unix/configure.raw (version_info): Set to 11:0:5. + +2010-07-12 Werner Lemberg + + Remove C++ warnings. + + */*: Initialize pointers where necessary to make g++ happy. + +2010-07-12 malc + Richard Henderson + + Fix type-punning issues with C++. + + * include/freetype/internal/ftmemory.h (FT_ASSIGNP) [__cplusplus]: + Emulate a `typeof' operator with an inline template which uses + `static_cast'. + +2010-07-11 Werner Lemberg + + Fix C++ compilation issue. + + * src/tools/apinames.c (names_dump) : Fix + type of `dot' variable. + +2010-07-10 suzuki toshiya + + Fix another case reported in Savannah bug #30373. + Permit a face for Type1, Type42 and CFF without charmap, + patch by Tor Andersson. + + * src/type1/t1objs.c (T1_Face_Init): Reset the error if it + is FT_Err_No_Unicode_Glyph_Name. + * src/type42/t42objs.c (T42_Face_Init): Ditto. + * src/cff/cffobjs.c (cff_face_init): Ditto. + +2010-07-09 suzuki toshiya + + Use defined macros to set {platform,encoding}_id. + + * src/bdf/bdfdrivr.c: Include ttnameid.h and use macros to + set charmap.{platfom,encoding}_id. + * src/pcf/pcfdrivr.c: Ditto. + * src/winfonts/winfnt.c: Ditto. + * src/type1/t1objs.c: Ditto. + * src/type42/t42objs.c: Ditto. + * src/cff/cffobjs.c: Ditto. + * src/pfr/pfrobjs.c: Ditto. + +2010-07-09 suzuki toshiya + + Fix Savannah bug #30373. + Too serious check of errors by `FT_CMap_New' since 2010-07-04 + is fixed. Reported by Tor Andersson. + + * include/freetype/fterrdef.h + (PSnames_Err_No_Unicode_Glyph_Name): New error code to + indicate the Unicode charmap synthesis failed because + no Unicode glyph name is found. + + * src/psnames/psmodule.c (ps_unicodes_init): Return + PSnames_Err_No_Unicode_Glyph_Name when no Unicode glyph name + is found in the font. + * src/cff/cffcmap.c (cff_cmap_unicode_init): Return + CFF_Err_No_Unicode_Glyph_Name when no SID is available. + + * src/type1/t1objs.c (T1_Face_Init): Proceed if `FT_CMap_New' + is failed by the lack of Unicode glyph name. + * src/type42/t42objs.c (T42_Face_Init): Ditto. + * src/cff/cffobjs.c (cff_face_init): Ditto. + +2010-07-09 Ken Sharp + + Make ftraster.c compile in stand-alone mode with MSVC compiler. + + * src/raster/ftmisc.h (FT_Int64) [_WIN32, _WIN64]: Fix typedef + since there is no `inttypes.h' for MSVC. + +2010-07-08 Werner Lemberg + + Fix Savannah bug #30361. + + * src/truetype/ttinterp.c (Ins_IUP): Fix bounds check. + +2010-07-06 Werner Lemberg + + Pacify compiler. + + * src/cff/cffload.c (cff_index_get_pointers): Initialize + `new_bytes'. + +2010-07-05 Eugene A. Shatokhin + + Fix Savannah bug #27648. + + * src/base/ftobjs.c (ft_remove_renderer, FT_Add_Module): Call + `raster_done' only if we have an outline glyph format. + +2010-07-05 Werner Lemberg + + Fix Savannah bug #30030. + + * builds/win32/*/freetype.vcproj: Add ftxf86.c. + +2010-07-05 Werner Lemberg + + [cff] Next try to fix `hintmask' and `cntrmask' limit check. + + Problem reported by malc . + + * src/cff/cffgload.c (cff_decoder_parse_charstrings) + : It is possible that there is just a single byte + after the `hintmask' or `cntrmask', e.g., a `return' instruction. + +2010-07-04 suzuki toshiya + + Restrict the number of the charmaps in a rogue-compatible mode. + Fix for Savannah bug #30059. + + * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Replace `16' the + minimum character code passed by a legacy rogue client by... + * include/freetype/config/ftoption.h (FT_MAX_CHARMAP_CACHEABLE): + This. It is undefined when FT_CONFIG_OPTION_OLD_INTERNALS is + undefined (thus the rogue client compatibility is not required). + + * src/cff/cffobjs.c (cff_face_init): Abort the automatic + selection or synthesis of Unicode cmap subtable when the charmap + index exceeds FT_MAX_CHARMAP_CACHEABLE. + * src/sfnt/ttcmap.c (tt_face_build_cmaps): Issue error message + when the charmap index exceeds FT_MAX_CHARMAP_CACHEABLE. + + * src/base/ftobjs.c (find_unicode_charmap): When Unicode charmap + is found after FT_MAX_CHARMAP_CACHEABLE, ignore it and search + earlier one. + (find_variant_selector_charmap): When UVS charmap is found after + FT_MAX_CHARMAP_CACHEABLE, ignore it and search earlier one. + (FT_Select_Charmap): When a charmap matching with requested + encoding but after FT_MAX_CHARMAP_CACHEABLE, ignore and search + earlier one. + (FT_Set_Charmap): When a charmap matching with requested + charmap but after FT_MAX_CHARMAP_CACHEABLE, ignore and search + earlier one. + (FT_Get_Charmap_Index): When a requested charmap is found + after FT_MAX_CHARMAP_CACHEABLE, return the inverted charmap + index. + +2010-07-04 Werner Lemberg + + TrueType hinting is no longer patented. + + * include/freetype/config/ftoption.h, devel/ftoption.h + (TT_CONFIG_OPTION_BYTECODE_INTERPRETER): Define. + (TT_CONFIG_OPTION_UNPATENTED_HINTING): Undefine. + + * docs/CHANGES, docs/INSTALL, include/freetype/freetype.h: Updated. + * docs/TRUETYPE, docs/PATENTS: Removed. + +2010-07-04 suzuki toshiya + + Check error value by `FT_CMap_New'. + + * src/cff/cffobjs.c (cff_face_init): Check error value by + `FT_CMap_New'. + * src/pfr/pfrobjs.c (pfr_face_init): Ditto. + * src/type1/t1jobjs.c (T1_Face_Init): Ditto. + * src/type42/t42jobjs.c (T42_Face_Init): Ditto. + +2010-07-03 Werner Lemberg + + Make ftgrays.c compile stand-alone again. + + * src/smooth/ftgrays.c [_STANDALONE_]: Include `stddef.h'. + (FT_INT_MAX, FT_PtrDist)[_STANDALONE_]: Define. + +2010-07-02 suzuki toshiya + + Additional fix for Savannah bug #30306. + + * src/base/ftobjs.c (Mac_Read_POST_Resource): If the type of the + POST fragment is 0, the segment is completely ignored. The declared + length of the segment is not cared at all. According to Adobe + Technical Note 5040, type 0 segment is a comment only and should not + be loaded for the interpreter. Reported by Robert ÅšwiÄ™cki. + +2010-07-01 Werner Lemberg + + [truetype] Protect against code range underflow. + + * src/truetype/ttinterp.c (DO_JROT, DO_JMPR, DO_JROF): Don't allow + negative IP values. + +2010-07-01 Werner Lemberg + + [truetype] Add rudimentary tracing for bytecode instructions. + + * src/truetype/ttinterp.c (opcode_name) [FT_DEBUG_LEVEL_TRACE]: New + array. + (TT_RunIns): Trace opcodes. + +2010-06-30 Werner Lemberg + + Fix Savannah bug #30263. + + * src/smooth/ftgrays.c (gray_render_span): Use cast to `unsigned + int' to avoid integer overflow. + + * src/smooth/ftsmooth.c (ft_smooth_render_generic): Use smaller + threshold values for `width' and `height'. This is not directly + related to the bug fix but makes sense anyway. + +2010-07-01 suzuki toshiya + + Initial fix for Savannah bug #30306. + + * src/base/ftobjs.c (Mac_Read_POST_Resource): Check `rlen', the + length of fragment declared in the POST fragment header, and prevent + an underflow in length calculation. Some fonts set the length to + zero in spite of the existence of a following 16bit `type'. + Reported by Robert ÅšwiÄ™cki. + +2010-07-01 suzuki toshiya + + Additional fix for Savannah bug #30248 and #30249. + + * src/base/ftobjs.c (Mac_Read_POST_Resource): Check the buffer size + during gathering PFB fragments embedded in LaserWriter PS font for + Macintosh. Reported by Robert ÅšwiÄ™cki. + +2010-06-30 Alexei Podtelezhnikov + + Minor optimizations by avoiding divisions. + + * src/sfnt/ttkern.c (tt_face_load_kern, tt_face_get_kerning): + Replace divisions with multiplication in comparisons. + +2010-06-29 Werner Lemberg + + Fix minor tracing issues. + + * src/cff/cffgload.c, src/truetype/ttgload.c: Adjust tracing levels. + +2010-06-27 Werner Lemberg + + [cff] Really fix `hintmask' and `cntrmask' limit check. + + * src/cff/cffgload.c (cff_decoder_parse_charstrings) + : Fix thinko and handle tracing also. + +2010-06-27 Werner Lemberg + + Fix valgrind warning. + + * src/base/ftoutln.c (FT_Outline_Get_Orientation): Initialize + `result' array. + +2010-06-27 Werner Lemberg + + [cff] Fix memory leak. + + * src/cff/cffgload.c (cff_operator_seac): Free charstrings even in + case of errors. + +2010-06-27 Werner Lemberg + + [cff] Protect against invalid `hintmask' and `cntrmask' operators. + + * src/cff/cffgload.c (cff_decoder_parse_charstrings) + : Ensure that we don't exceed `limit' while parsing + the bit masks of the `hintmask' and `cntrmask' operators. + +2010-06-26 Werner Lemberg + + Fix PFR change 2010-06-24. + + * src/pfr/pfrgload.c (pfr_glyph_load_simple): Really protect against + invalid indices. + +2010-06-26 Werner Lemberg + + Improve PFR tracing messages. + + * src/pfr/pfrgload.c (pfr_glyph_load_rec): Emit tracing messages for + simple and compound glyph offsets. + +2010-06-26 Werner Lemberg + + Fix last PFR change. + + * src/pfr/pfrobjs.c (pfr_face_init): Fix rejection logic. + +2010-06-26 Werner Lemberg + + Fix Savannah bug #30262. + + * src/sfnt/ttload.c (tt_face_load_maxp): Limit `maxComponentDepth' + arbitrarily to 100 to avoid stack exhaustion. + +2010-06-26 Werner Lemberg + + Add some memory checks (mainly for debugging). + + * src/base/ftstream.c (FT_Stream_EnterFrame): Exit with error + if the frame size is larger than the stream size. + + * src/base/ftsystem.c (ft_ansi_stream_io): Exit with error if + seeking a position larger than the stream size. + +2010-06-25 Werner Lemberg + + Fix Savannah bug #30261. + + * src/pfr/pfrobjs.c (pfr_face_init): Reject fonts which contain + neither outline nor bitmap glyphs. + +2010-06-25 Werner Lemberg + + Fix Savannah bug #30254. + + * src/cff/cffload.c (cff_index_get_pointers): Do sanity check for + first offset also. + +2010-06-25 suzuki toshiya + + Initial fix for Savannah bug #30248 and #30249. + + * src/base/ftobjs.c (Mac_Read_POST_Resource): Check the error during + reading a PFB fragment embedded in LaserWriter PS font for Macintosh. + Reported by Robert ÅšwiÄ™cki. + +2010-06-24 Werner Lemberg + + Fix Savannah bug #30247. + + * src/pcf/pcfread.c (pcf_get_metrics): Disallow (invalid) fonts with + zero metrics. + +2010-06-24 Graham Asher + + * src/smooth/ftgrays.c (gray_render_cubic): Fix algorithm. + The previous version was too aggressive, as demonstrated in + http://lists.gnu.org/archive/html/freetype-devel/2010-06/msg00020.html. + +2010-06-24 Werner Lemberg + + */*: Use module specific error names where appropriate. + +2010-06-24 Werner Lemberg + + Fix Savannah bug #30236. + + * src/sfnt/ttcmap.c (tt_face_build_cmaps): Improve check for pointer + to `cmap_table'. + +2010-06-24 Werner Lemberg + + Fix Savannah bug #30235. + + * src/pfr/pfrgload.c (pfr_glyph_load_simple): Protect against + invalid indices if there aren't any coordinates for indexing. + +2010-06-24 Werner Lemberg + + [bdf]: Font properties are optional. + + * src/bdf/bdflib.c (_bdf_readstream): Use special error code to + indicate a redo operation. + (_bdf_parse_start): Handle `CHARS' keyword here too and pass current + input line to `_bdf_parse_glyph'. + +2010-06-23 Werner Lemberg + + Fix Savannah bug #30220. + + * include/freetype/fterrdef.h + (BDF_Err_Missing_Fontboundingbox_Field): New error code. + + * src/bdf/bdflib.c (_bdf_parse_start): Check for missing + `FONTBOUNDINGBOX' field. + Avoid memory leak if there are multiple `FONT' lines (which is + invalid but doesn't hurt). + +2010-06-21 Werner Lemberg + + Fix Savannah bug #30168. + + * src/pfr/pfrgload.c (pfr_glyph_load_compound): Limit the number of + subglyphs to avoid endless recursion. + +2010-06-20 Werner Lemberg + + Fix Savannah bug #30145. + + * src/psaux/psobjs.c (t1_builder_add_contour): Protect against + `outline == NULL' which might happen in invalid fonts. + +2010-06-19 Werner Lemberg + + Fix Savannah bug #30135. + + * src/bdf/bdflib.c (_bdf_list_join): Don't modify value in static + string `empty'. + (_bdf_parse_glyph): Avoid memory leak in case of error. + +2010-06-15 Werner Lemberg + + Fix Savannah bug #30108. + + * src/autofit/afglobal.c (af_face_globals_compute_script_coverage): + Properly mask AF_DIGIT bit in comparison. + +2010-06-11 Werner Lemberg + + Fix Savannah bug #30106. + + Point numbers for FreeType's implementation of hinting masks are + collected before the final number of points of a glyph has been + determined; in particular, the code for handling the `endchar' + opcode can reduce the number of points. + + * src/pshinter/pshalgo.c (psh_glyph_find_strong_points): Assure that + `end_point' is not larger than `glyph->num_points'. + +2010-06-11 Werner Lemberg + + [cff]: Improve debugging output. + + * src/cff/cffgload.c (cff_decoder_parse_charstrings) + : Implement it. + +2010-06-10 Graham Asher + + ftgrays: Speed up rendering of small cubic splines. + + * src/smooth/ftgrays.c (gray_render_cubic): Implement new, + simplified algorithm to find out whether the spline can be replaced + with two straight lines. See this thread for more: + + http://lists.gnu.org/archive/html/freetype-devel/2010-06/msg00000.html + +2010-06-09 Werner Lemberg + + Fix Savannah bug #30082. + + * src/cff/cffgload.c (cff_decoder_parse_charstrings) + : Protect against stack underflow. + +2010-06-08 Werner Lemberg + + Fix Savannah bug #30053. + + * src/cff/cffparse.c (cff_parse_real): Handle border case where + `fraction_length' has value 10. + +2010-06-07 Werner Lemberg + + Fix Savannah bug #30052. + This bug has been introduced with commit 2415cbf3. + + * src/base/ftobjs.c (FT_Get_First_Char, FT_Get_Next_Char): Protect + against endless loop in case of corrupted font header data. + +2010-05-26 Werner Lemberg + + Remove unused variable. + Found by Graham. + + * src/autofit/afhints.c (af_glyph_hints_reload): Remove unused + variable `first' in first block. + +2010-05-22 Werner Lemberg + + Fix various memory problems found by linuxtesting.org. + + * src/base/ftgxval.c (FT_TrueTypeGX_Free, FT_ClassicKern_Free), + src/base/ftotval.c (FT_OpenType_Free), src/base/ftpfr.c + (ft_pfr_check): Check `face'. + + * src/base/ftobjs.c (FT_Get_Charmap_Index): Check `charmap' and + `charmap->face'. + (FT_Render_Glyph): Check `slot->face'. + (FT_Get_SubGlyph_Info): Check `glyph->subglyphs'. + +2010-05-22 Werner Lemberg + + autofit: Remove dead code. + Suggested by Graham. + + * src/autofit/afhints.c (af_glyph_hints_compute_inflections): Removed. - (gray_shell_sort, gray_quick_sort, gray_check_sort, - gray_dump_cells): Removed. - (gray_sweep): Rewritten. - (gray_convert_glyph): Rewrite code which used one of the sorting - functions. - (gray_raster_render): Updated. + (af_glyph_hints_reload): Remove third argument. + Update all callers. -2006-08-29 Dr. Werner Fink +2010-05-21 Bram Tassyns - * configure: Make it possible to handle configure options which - have strings containing spaces. + Fix Savannah bug #27987. -2006-08-27 David Turner + * src/cff/cffobjs.c (remove_subset_prefix): New function. + (cff_face_init): Use it to adjust `cffface->family_name'. - * include/freetype/config/ftoption.h (TT_USE_BYTECODE_INTERPRETER): - New macro, defined if either TT_CONFIG_OPTION_BYTECODE_INTERPRETER - or TT_CONFIG_OPTION_UNPATENTED_HINTING is defined. +2010-05-20 Werner Lemberg - * include/freetype/internal/ftcalc.h, src/base/ftcalc.c, - src/truetype/truetype.c, src/truetype/ttdriver.c, - src/truetype/ttgload.c, src/truetype/ttgload.h, - src/truetype/ttinterp.c, src/truetype/ttobjs.c, - src/truetype/ttobjs.h, src/truetype/ttpload.c, src/type42/t42drivr.c: - s/TT_CONFIG_OPTION_BYTECODE_INTERPRETER/TT_USE_BYTECODE_INTERPRETER/. + TrueType: Make FreeType ignore maxSizeOfInstructions in `maxp'. - * include/freetype/internal/ftobjs.h (FT_Face_InternalRec): New - member `force_autohint'. + Acroread does the same. - * src/base/ftobjs.c (FT_Load_Glyph): Use `force_autohint'. + * src/truetype/ttgload.c (TT_Process_Composite_Glyph): Call + `Update_Max' to adjust size of instructions array if necessary and + add a rough safety check. - * src/truetype/ttobjs.c (tt_face_init): Prepare code for testing - against a list of font names which need the bytecode interpreter. + (load_truetype_glyph): Save `loader->byte_len' before recursive + call. -2006-08-27 Jens Claudius + * src/truetype/ttinterp.h, src/truetype/ttinterp.c (Update_Max): + Declare it as FT_LOCAL. - Fix miscellaneous compiler warnings. +2010-05-18 Hongbo Ni - * include/freetype/internal/ftobjs.h: Close comment with `*/' to - avoid `/* in comment' compiler warning. + Apply Savannah patch #7196. - * src/base/ftdbgmem.c (ft_mem_table_get_source): Turn cast - `(FT_UInt32)(void*)' into `(FT_UInt32)(FT_PtrDist)(void*)' since on - 64-bit platforms void* is larger than FT_UInt32. + * src/cff/cffgload.c (cff_slot_load): Prevent crash if CFF subfont + index is out of range. - * src/base/ftobjs.c (t_validator_error): Cast away - volatileness of argument to ft_longjmp. Spotted by Werner - `Putzfrau' Lemberg. +2010-05-11 Werner Lemberg - * src/bdf/bdflib.c (bdf_load_font): Initialize local - variable `lineno'. + * docs/formats.txt: Give pointer to PCF documentation. + Information provided by Alan Coopersmith + . - * src/gxvalid/gxvmod.c (classic_kern_validate): Mark local variable - `error' as volatile. +2010-05-10 Ken Sharp -2006-08-27 Werner Lemberg + Fix Savannah bug #29846. - * builds/unix/ftconfig.in: Synchronize with main ftconfig.h. - Reported by Jens. + Previously we discovered fonts which used `setcurrentpoint' to set + the initial point of a contour to 0,0. This caused FreeType to + raise an error, because the `setcurrentpoint' operator is only + supposed to be used with the results from an OtherSubr subroutine. -2006-08-22 Jens Claudius + This was fixed by simply ignoring the error and carrying on. - Fix for previous commit, which caused many compiler warnings/errors - about addresses of volatile objects passed as function arguments as - non-volatile pointers. + Now we have found a font which uses setcurrentpoint to actually + establish a non-zero point for a contour during the course of a + glyph program. FWIW, these files may be produced by an application + called `Intaglio' on the Mac, when converting TrueType fonts to + Type 1. - * include/freetype/internal/ftvalid.h: Make FT_Validator typedef a - pointer to a volatile object. + The fix allows the new invalid behaviour, the old invalid behaviour + and real proper usage of the operator to work the same way as Adobe + interpreters apparently do. - * src/gxvalid/gxvmod.c (gxv_load_table): Make function argument - `table' a pointer to a volatile object. + (t1_decoder_parse_charstrings): Make `setcurrentpoint' use the top + two elements of the stack to establish unconditionally the current x + and y coordinates. - * src/otvalid/otvmod.c (otv_load_table): Make function argument - `table' a pointer to a volatile object. + Make the `flex' subroutine handling (OtherSubr 0) put the current + x,y coordinates onto the stack, instead of two dummy uninitialised + values. -2006-08-18 Jens Claudius +2010-04-14 Ken Sharp - * src/gxvalid/gxvmod.c (GXV_TABLE_DECL): Mark local variable `_sfnt' - as volatile since it must keep its value across a call to ft_setjmp. - (gxv_validate): Same for local variables `memory' and `valid'. - (classic_kern_validate): Same for local variables `memory', - `ckern', and `valid'. + Fix Savannah bug #29444. - * src/otvalid/otvmod.c (otv_validate): Same for function parameter - `face' and local variables `base', `gdef', `gpos', `gsub', `jstf', - and 'valid'. + * src/psaux/psobjs.c (t1_builder_start_point): Accept (invalid) + `lineto' immediately after `hsbw', in accordance with Acrobat, GS, + and others. - * src/sfnt/ttcmap.c (tt_face_build_cmaps): Same for local variable - `cmap'. +2010-04-14 MichaÅ‚ CichoÅ„ -2006-08-16 David Turner + Fix Savannah bug #27999. - * src/cid/cidgload.c (cid_slot_load_glyph): Remove compiler - warnings. + * src/cache/ftcmanag.c (FTC_Manager_RemoveFaceID): Only remove + selected entry, not all. - * src/base/ftobjs.c (ft_validator_run): Disable function; it is - buggy by design. Always return -1. +2010-04-06 Jonathan Kew + Add overflow check to `fvar' table. - Improvements to native TrueType hinting. This is a first try, - controlled by the FIX_BYTECODE macro in src/truetype/ttinterp.c. + * src/truetype/ttgxvar.c (TT_Get_MM_Var): Check axis and instance + count. - * include/freetype/internal/ftgloadr.h (FT_GlyphLoadRec): Add member - `extra_points2'. +2010-04-05 Ken Sharp - * include/freetype/internal/tttypes.h (TT_GlyphZoneRec): Add member - `orus'. + Fix Savannah bug #29335. - * src/base/ftgloadr.c (FT_GlyphLoader_Reset, - FT_GlyphLoader_Adjust_Points, FT_GlyphLoader_CreateExtra, - FT_GlyphLoader_CheckPoints, FT_GlyphLoader_CopyPoints): Updated to - handle `extra_points2'. + * src/raster/ftraster.c (Line_Up): Use slow multiplication to + prevent overflow. This shouldn't have any serious impact on speed, + however. - * src/truetype/ttgload.c (tt_prepare_zone): Handle `orus'. - Remove compiler warning. - (cur_to_arg): Remove macro. - (TT_Hint_Glyph): Updated. - (TT_Process_Simple_Glyph): Handle `orus'. +2010-04-05 Werner Lemberg - * src/truetype/ttinterp.c (FIX_BYTECODE): New macro. - (Ins_MD, Ins_MDRP, Ins_IP) [FIX_BYTECODE]: Handle `orus'. - (LOC_Ins_IUP): Renamed to... - (IUP_WorkerRec): This. - Add `orus' member. - (Shift): Renamed to... - (_iup_worker_shift): This. - Updated. - (Interp): Renamed to... - (_iup_worker_interpolate): This. - Updated to handle `orus'. - (Ins_IUP): Updated. + Add new function `FT_Library_SetLcdFilterWeights'. - * src/truetype/ttobjs.c (tt_glyphzone_done, tt_glyphzone_new): - Handle `orus'. + This is based on code written by Lifter + . It fixes + FreeDesktop bug #27386. -2006-08-15 suzuki toshiya + * src/base/ftlcdfil.c (FT_Library_SetLcdFilterWeights): New + function. - * modules.cfg (BASE_EXTENSIONS): Compile in ftgxval.c by default to - build ftvalid in ft2demos. This has been inadvertedly changed - 2006-08-13. + * include/freetype/ftlcdfil.h: Updated. -2006-08-15 suzuki toshiya + * docs/CHANGES: Updated. - `ft_validator_run' wrapping `setjmp' can cause a crash, as found by - Jens: - http://lists.gnu.org/archive/html/freetype-devel/2006-08/msg00004.htm. +2010-04-01 John Tytgat - * src/otvalid/otvmod.c: Replace `ft_validator_run' by `ft_setjmp'. - It reverts the change introduced on 2005-08-20. + Fix Savannah bug #29404. - * src/gxvalid/gxvmod.c: Ditto. + * src/truetype/ttgload.c: Revert change 2752bd1a (check on bit 1 + of `head' table of TrueType fonts). -2006-08-13 Jens Claudius +2010-03-14 suzuki toshiya - * finclude/freetype/internal/psaux.h: (T1_TokenType): Add - T1_TOKEN_TYPE_KEY. - (T1_FieldRec): Add `dict'. - (T1_FIELD_DICT_FONTDICT, T1_FIELD_DICT_PRIVATE): New macros. - (T1_NEW_XXX, T1_FIELD_XXX): Update to take the dictionary where a PS - keyword is expected as an additional argument. + Fix `multi build' for Tytgat's CFF driver improvement. - * src/cid/cidload.c: (cid_field_records): Adjust invocations of - T1_FIELD_XXX. - - * src/cid/cidtoken.h: Adjust invocations of T1_FIELD_XXX. - - * src/psaux/psobjs.c: Add macro FT_COMPONENT for tracing. - (ps_parser_to_token): Report a PostScript key as T1_TOKEN_TYPE_KEY, - not T1_TOKEN_TYPE_ANY. - (ps_parser_load_field): Make sure a token that should be a string or - name is really a string or name. - Avoid memory leak if a keyword has been already encountered and its - value is overwritten. - * src/type1/t1load.c: (t1_keywords): Adjust invocations of - T1_FIELD_XXX. - (parse_dict): Ignore keywords that occur in the wrong dictionary - (e.g., in `Private' instead of `FontDict'). - - * src/type1/t1tokens.h: Adjust invocations of T1_FIELD_XXX. - - * src/type42/t42parse.c: (t42_keywords): Adjust invocations of - T1_FIELD_XXX. + * src/base/cffload.h (cff_index_get_name): Added. -2006-07-18 Jens Claudius - - Move creation of field `buildchar' of T1_DecoderRec out of - `t1_decoder_init' and let the caller of `t1_decoder_init' take care - of it. - - Call the finisher for T1_Decoder in `cid_face_compute_max_advance' - and `T1_Compute_Max_Advance'. - - * include/freetype/internal/psaux.h (T1_DecoderRec): Remove field - `face', add `len_buildchar'. - - * include/freetype/internal/t1types.h (T1_FaceRec): Add field - `buildchar'. - - * src/cid/cidgload.c (cid_face_compute_max_advance): Call finisher - for T1_Decoder. - (cid_slot_load_glyph): Do not ignore failure when initializing the - T1_Decoder. - - * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Updated. - (t1_decoder_init): Remove initialization of fields `buildchar' and - `len_buildchar'. - (t1_decoder_done): Remove deallocation of field `buildchar'. - - * freetype/src/type1/t1gload.c (T1_Compute_Max_Advance): Initialize - T1_Decoder's `buildchar' and `len_buildchar'; call finisher for - T1_Decoder. - (T1_Load_Glyph): Initialize T1_Decoder's `buildchar' and - `len_buildchar'; make sure to call finisher for T1_Decoder even in - case of error. - - * src/type1/t1load.c (T1_Open_Face): Allocate new field `buildchar' - of T1_FaceRec. - - * src/type1/t1objs.c (T1_Face_Done): Free new field `buildchar' of - T1_FaceRec. - -2006-07-14 Jens Claudius - - * include/freetype/internal/psaux.h: New macros IS_PS_NEWLINE, - IS_PS_SPACE, IS_PS_SPECIAL, IS_PS_DELIM, IS_PS_DIGIT, IS_PS_XDIGIT, - and IS_PS_BASE85 (from src/psaux/psconv.h). - (T1_FieldLocation): Add T1_FIELD_LOCATION_LOADER, - T1_FIELD_LOCATION_FACE, and T1_FIELD_LOCATION_BLEND. - (T1_DecoderRec): New fields `buildchar' and `face'. - (IS_PS_TOKEN): New macro. - - * include/freetype/internal/t1types.h (T1_FaceRec): New fields - `ndv_idx', `cdv_idx', and `len_buildchar'. - - * include/freetype/t1tables.h (PS_BlendRec): New fields - `default_design_vector' and `num_default_design_vector'. - - * src/psaux/psconv.h: Move macros IS_PS_NEWLINE, IS_PS_SPACE, - IS_PS_SPECIAL, IS_PS_DELIM, IS_PS_DIGIT, IS_PS_XDIGIT, and - IS_PS_BASE85 to include/freetype/internal/psaux.h. - - * src/psaux/psobjs.c (ps_parser_to_token_array): Allow `token' - argument to be NULL if we want only to count the number of tokens. - (ps_tocoordarray): Allow `coords' argument to be NULL if we just - want to skip the array. - (ps_tofixedarray): Allow `values' argument to be NULL if we just - want to skip the array. - - * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Add support - for (partially commented out) othersubrs 19-25, 27, and 28. - (t1_decoder_init): Initialize new fields `face' and `buildchar'. - (t1_decoder_done): Release new field `buildchar'. - - * src/type1/t1load.c (parse_buildchar, parse_private): New - functions. - (t1_keywords): Register them. - (t1_allocate_blend): Updated. - (t1_load_keyword): Handle field types T1_FIELD_LOCATION_LOADER, - T1_FIELD_LOCATION_FACE and T1_FIELD_LOCATION_BLEND. - (parse_dict): Remove `keyword_flags' argument. - Use new macro IS_PS_TOKEN. - Changed function so that later PostScript definitions override - earlier ones. - (t1_init_loader): Initialize new field `keywords_encountered'. - (T1_Open_Face): Initialize new fields `ndv_idx', `cdv_idx', and - `len_buildchar'. - Remove `keywords_flags'. - - * src/type1/t1load.h (T1_LoaderRect): New field - `keywords_encountered'. - (T1_PRIVATE, T1_FONTDIR_AFTER_PRIVATE): New macros. - - * src/type1/t1tokens.h [!T1_CONFIG_OPTION_NO_MM_SUPPORT]: New - entries for parsing /NDV, /CDV, and /DesignVector. - -2006-07-07 Werner Lemberg - - Add many checks to protect against malformed PCF files. - - * src/pcf/pcfdrivr.c (PCF_Face_Done): Protect against NULL pointers. - (PCF_Face_Init): Add calls to PCF_Face_Done in case of errors. - - * src/pcf/pcfread.c (pcf_read_TOC): Protect against malformed table - data and check that tables don't overlap (using a simple - bubblesort). - (PCF_METRIC_SIZE, PCF_COMPRESSED_METRIC_SIZE, PCF_PROPERTY_SIZE): - New macros which give the size of data structures in the data - stream. - (pcf_get_properties): Use rough estimates to get array size limits. - Assign `face->nprops' and `face->properties' earlier so that a call - to PCF_Face_Done can do the clean-up in case of error. - Protect against invalid string offsets. - (pcf_get_metrics): Clean up code. - Adjust tracing message levels. - Use rough estimate to get array size limit. - (pcf_get_bitmaps): Clean up code. - Adjust tracing message levels. - Use rough estimates to get offset limits. - (pcf_get_encodings): Adjust tracing message level. - (pcf_get_accel): Clean up code. - -2006-06-26 Werner Lemberg - - * src/bdf/bdfdrivr.c (BDF_Face_Init): Handle fonts correctly which - don't have a POINT_SIZE property. This fixes Savannah bug #16914. - -2006-06-26 Jens Claudius - - * src/psaux/t1decode.c (T1_Operator, t1_args_count): Add opcode 15. - (t1_decoder_parse_charstrings): Operator with - opcode 15 pops its two arguments. - Handle the case where the pops of an othersubr may be part of a - subroutine. - Handle unknown othersubrs gracefully: count their operands and let - the following pop operators push the operands as the results onto - the Type1 stack. - Improve handling of setcurrentpoint opcode. - -2006-06-25 Jens Claudius - - The Type 1 parser now skips over top-level procedures as required - for a `Simplified Parser'. This makes the parser more robust as it - doesn't poke around in PostScript code. Additionally, it makes the - FontDirectory hackery in src/type1/t1load.c unnecessary. - - * src/psaux/psobjs.c (IS_OCTAL_DIGIT): New macro. - (skip_literal_string): Add FT_Error as return value. - Handle escapes better. - (skip_string): Add FT_Error as return value. - Don't set `parser->error' but return error code directly. - (skip_procedure): New function. - (ps_parser_skip_PS_token): Handle procedures. - Update code. - (ps_parser_to_token): Update code. - (ps_parser_load_field_table): Handle bbox entries also. - - * src/type1/t1load.c (parse_dict): Remove FontDirectory hackery. - Add commented-out code for synthetic fonts. - -2006-06-24 Eugeniy Meshcheryakov - - Fix two hinting bugs as reported in - http://lists.gnu.org/archive/html/freetype-devel/2006-06/msg00057.html. - - * include/freetype/internal/tttypes.h (TT_GlyphZoneRec): Add - `first_point' member. - - * src/truetype/ttgload.c (tt_prepare_zone): Initialize - `first_point'. - (TT_Process_Composite_Glyph): Always untouch points. - - * src/truetype/ttinterp.c (Ins_SHC): Fix computation of - `first_point' and `last_point' in case of composite glyphs. - (Ins_IUP): Fix computation of `end_point'. - -2006-06-22 suzuki toshiya - - Insert EndianS16_BtoN and EndianS32_BtoN as workaround for Intel - Mac. The original patch was written by David Sachitano and Lawrence - Coopet, and modified by Sean McBride for MPW compatibility. Only - required data are converted; unused data are left in big endian. - - * src/base/ftmac.c: Include for byteorder macros for non - Mac OS X platforms. - (OS_INLINE): Undefine before definition. - (count_faces_sfnt): Insert EndianS16_BtoN to parse the header of - FontAssociation table in FOND resource. - (count_faces_scalable): Insert EndianS16_BtoN to parse the header - and fontSize at each entry of FontAssociation table in FOND - resource. - (parse_fond): Insert EndianS16_BtoN and EndianS32_BtoN to parse - ffStylOff of FamilyRecord header of FOND resource, the header, - fontSize, fontID at each entry of FontAssociation table, and - StyleMapping table. - (count_faces): Call `HUnlock' after all FOND utilization. - -2006-06-08 suzuki toshiya - - Public API of TrueTypeGX, OpenType, and classic kern table validator - should return `FT_Err_Unimplemented_Feature' if validation service - is unavailable (disabled in `modules.cfg'). It is originally - suggested by David Turner, cf. - http://lists.gnu.org/archive/html/freetype-devel/2005-11/msg00078.html - - * src/base/ftgxval.c (FT_TrueTypeGX_Validate): Return - FT_Err_Unimplemented_Feature if TrueTypeGX validation service is - unavailable. - (FT_ClassicKern_Validate): Return FT_Err_Unimplemented_Feature if - classic kern table validation service is unavailable. - - * src/base/ftotval.c (FT_OpenType_Validate): Return - FT_Err_Unimplemented_Feature if OpenType validation service is - unavailable. - -2006-06-08 Werner Lemberg - - * src/bdf/bdflib.c (bdf_load_font): Fix memory leaks in case of - errors. - -2006-06-07 David Turner - - * src/type1/t1afm.c (KERN_INDEX): Make it more robust. - (T1_Read_Metrics): Fix memory leak which happened when the metrics - file doesn't have kerning pairs. This fixes Savannah bug #16768. - -2006-06-06 David Turner - - Fix memory leak described in Savannah bug #16759. - - We change `ps_unicodes_init' so that it also takes a - `free_glyph_name' callback to release the glyph names returned by - `get_glyph_name' - - * include/freetype/internal/services/svpscmap.h (PS_Glyph_NameFunc): - Renamed to ... - (PS_GetGlyphNameFunc): This. - (PS_FreeGlyphNameFunc): New typedef. - (PS_Unicodes_InitFunc): Add variable for PS_FreeGlyphNameFunc. - - * src/cff/cffcmap.c (cff_sid_to_glyph_name): Use `TT_Face' for first - argument. - (cff_sid_free_glyph_name): New function. +2010-03-12 suzuki toshiya + + Remove duplicated inclusion of `FT_OUTLINE_H' in ftobjs.c. + + * src/base/ftobjs.c: Remove 2nd inclusion of `FT_OUTLINE_H'. + +2010-03-11 Chris Liddell + + Fix Savannah bug #27442. + + * src/raster/ftraster.c (ft_black_reset): Fix `buffer_size'. + +2010-03-09 Werner Lemberg + + Remove unused variable. + Reported by Graham. + + * src/cff/cffparse.c (cff_parse_real): Remove `rest'. + +2010-03-02 John Tytgat + + Improve CFF string (especially glyphname) lookup performance. + + We do this by avoiding memory allocation and file I/O. This is + Savannah patch #7104. + + * src/cff/cfftypes.h: Include PS cmaps service and + FT_INTERNAL_POSTSCRIPT_HINTS_H. + (CFF_SubFontRec): Remove `num_local_subrs'. + (CFF_FontRec): Add `num_strings', `strings', and `string_pool' + fields. + Remove `string_index' and `num_global_subrs' fields. + Use real types instead of `void' for `pshinter' and `psnames' fields. + + * src/cff/cffload.c: Don't include PS cmaps service. + (cff_index_get_pointers): Add `pool' parameter which allows to + insert an extra NUL character for each String INDEX entry. + (cff_index_get_name): Make it a local function. + (cff_index_get_string): New function. + (cff_subfont_load): Updated. + (cff_font_load): Initialize `num_strings', `strings', and + `string_pool' fields in the `CFF_FontRec' structure. + (cff_index_get_sid_string): Use `cff_index_get_string' instead of + `cff_index_get_name'. + (cff_font_done): Updated. + + * src/cff/cffload.h: Don't include PS cmaps service. + (cff_index_get_string): Added. + (cff_index_get_sid_string): Updated. + + * src/cff/cffobjs.c: Don't include PS cmaps service and + FT_INTERNAL_POSTSCRIPT_HINTS_H. + (cff_size_get_globals_funcs, cff_slot_init): Updated. + (cff_face_init): Follow `cff_index_get_name', + `cff_index_get_string', and `cff_index_get_sid_string' changes. + + * src/cff/cffcmap.c (cff_sid_free_glyph_name): Removed. + (cff_sid_to_glyph_name): Use `cff_index_get_cid_string'. (cff_cmap_unicode_init): Updated. - * src/psaux/t1cmap.c (t1_cmap_unicode_init): Updated. + * src/cff/cffdrivr.c: Don't include PS cmap service. + (cff_get_glyph_name): Avoid unnecessary lookup for POSTSCRIPT_CMAPS + service. + (cff_get_glyph_name, cff_ps_get_font_info, cff_get_ros): Follow API + `cff_index_get_sid_string' change. + (cff_get_name_index): Use `cff_index_get_string' instead of + `cff_index_get_name'. - * src/psnames/psmodule.c (ps_unicodes_init): Add variable for - PS_FreeGlyphNameFunc and use it. + * src/cff/cffgload.c: Don't include FT_INTERNAL_POSTSCRIPT_HINTS_H. + (cff_decoder_init, cff_decoder_prepare): Updated. +2010-02-27 Werner Lemberg -2006-06-04 David Turner + Simplify code. + Suggested by Behdad. - * src/base/ftutil.c (ft_mem_qrealloc): Fix the function to accept - `item_size == 0' as well -- though this sounds weird, it can - theoretically happen. This fixes Savannah bug #16669. + * src/base/ftobjs.c (FT_Get_First_Char): Don't use a loop since we + call FT_Get_Next_Char anyway if necessary. - * src/pfr/pfrobjs.c (pfr_face_init): Fix the computation - of `face->num_glyphs' which missed the last glyph, due to - the offset-by-1 computation, since the PFR format doesn't - guarantee that glyph index 0 corresponds to the `missing - glyph. This fixes Savannah bug #16668. +2010-02-26 Behdad Esfahbod -2006-05-25 Werner Lemberg + Improve handling of invalid glyph indices in char->index functions. - * builds/unix/unix-cc.in (LINK_LIBRARY): Don't comment out - `-no-undefined'. Reported by Christian Biesinger. + * src/base/ftobjs.c (FT_Get_First_Char, FT_Get_Next_Char): Use a + loop. -2006-05-19 Brian Weed +2010-02-18 Chris Liddell - * builds/win32/visualc/freetype.dsp: Release libraries no longer - have debug information, and debug libraries use `C7 compatible' - debug info. + Fix Savannah bug #28905. -2006-05-19 suzuki toshiya + Initialize phantom points before calling the incremental interface + to update glyph metrics. - Apply patch by Derek Clegg to fix two memory leaks in the MacOS - resource fork handler. This fixes Savannah bug #16631. - - * src/base/ftobjs.c (load_face_in_embedded_rfork): Replace - `FT_Stream_Close' by `FT_Stream_Free' to fix memory leak. - - * src/base/ftrfrk.c (raccess_guess_linux_double_from_file_name): - Replace `FT_Stream_Close' by `FT_Stream_Free' to fix memory leak. - -2006-05-19 suzuki toshiya - - * build/unix/configure.raw: Add a fallback to disable Carbon - dependency, if configured with no options on Mac OS X. - -2006-05-19 suzuki toshiya - - * src/base/ftmac.c (open_face_from_buffer): Deallocate stream when - its content cannot be parsed as supported font. This fixes - the second part of Savannah bug #16590. - -2006-05-18 Werner Lemberg - - * src/truetype/ttgload.c (TT_Load_Composite_Glyph) - [FT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Make it compilable again. - -2006-05-17 David Turner - - This is a major patch used to drastically improve the performance of - loading glyphs. This both speeds up loading the glyph vectors - themselves and the auto-fitter module. - - We now use inline assembler code with GCC to implement `FT_MulFix', - which is probably the most important function related to the - engine's performance. - - The resulting speed-up is about 25%. - - - * include/freetype/internal/tttypes.h (TT_LoaderRec): Add fields - `cursor' and `limit'. - - * src/autofit/afangles.c (af_corner_is_flat, af_corner_orientation): - New functions. - (AF_ATAN_BITS, af_arctan, af_angle_atan): Comment out. - [TEST]: Remove. - - * src/autofit/afcjk.c (AF_Script_UniRangeRec): Comment out test - code. - - * src/autofit/afhints.c (af_axis_hints_new_segment): Don't call - `FT_ZERO' - (af_direction_compute, af_glyph_hints_compute_inflections): Rewritten. - (af_glyph_hints_reload: Rewrite recognition of weak points. - - * src/autofit/aflatin.c (af_latin_hints_compute_segments): Move - constant values out of the loops. - - * src/autofit/aftypes.h: Updated. - - * src/base/ftcalc.c (FT_MulFix): Use inline assembler code. - - * src/base/ftoutln.c (FT_Outline_Get_Orientation): Use vector - product to get orientation. - - * src/gzip/ftgzip.c (ft_get_uncompressed_size): New function. - (FT_Stream_OpenGzip): Use it to handle small files directly in - memory. - - * src/psaux/psconv.c (PS_Conv_ASCIIHexDecode, PS_ConvEexecDecode): - Improve performance. - - * src/truetype/ttgload.c (TT_Access_Glyph_Frame): Set `cursor' and - `limit'. - - (TT_Load_Glyph_Header, TT_Load_Simple_Glyph, - TT_Load_Composite_Glyph): Updated. Add threshold to protect against - exceedingly large values of number of contours. Speed up by - reducing the number of loops. - - * src/type1/t1gload.c (T1_Load_Glyph): Don't apply unit matrix. - - - * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Change the threshold - used to detect rogue clients from 4 to 16. This is to prevent some - segmentation faults with fonts like `KozMinProVI-Regular.otf' which - comes from the Japanese Adobe Reader Asian Font pack. - -2007-05-17 Werner Lemberg - - * src/cff/cffload.c (cff_font_done): Deallocate subfont array. This - fixes the first part of Savannah bug #16590. - -2006-05-16 Werner Lemberg - - * docs/PROBLEMS: Updated icl issues. + * src/truetype/ttgload.c (tt_get_metrics_incr_overrides) + [FT_CONFIG_OPTION_INCREMENTAL]: New function, split off from... + (tt_get_metrics): This. + Updated. + (load_truetype_glyph): Use tt_get_metrics_incr_overrides. ---------------------------------------------------------------------------- -Copyright 2006, 2007, 2008, 2009, 2010 by +Copyright 2010 by David Turner, Robert Wilhelm, and Werner Lemberg. This file is part of the FreeType project, and may only be used, modified, diff --git a/lib/3rdparty/freetype/Jamfile b/lib/3rdparty/freetype/Jamfile index d8c1bbada29..0ef8b625094 100644 --- a/lib/3rdparty/freetype/Jamfile +++ b/lib/3rdparty/freetype/Jamfile @@ -1,6 +1,6 @@ # FreeType 2 top Jamfile. # -# Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by +# Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, @@ -194,7 +194,7 @@ rule RefDoc actions RefDoc { - python $(FT2_SRC)/tools/docmaker/docmaker.py --prefix=ft2 --title=FreeType-2.3.12 --output=$(DOC_DIR) $(FT2_INCLUDE)/freetype/*.h $(FT2_INCLUDE)/freetype/config/*.h + python $(FT2_SRC)/tools/docmaker/docmaker.py --prefix=ft2 --title=FreeType-2.4.4 --output=$(DOC_DIR) $(FT2_INCLUDE)/freetype/*.h $(FT2_INCLUDE)/freetype/config/*.h } RefDoc refdoc ; diff --git a/lib/3rdparty/freetype/README b/lib/3rdparty/freetype/README index 282791ef087..07c6f5fd752 100644 --- a/lib/3rdparty/freetype/README +++ b/lib/3rdparty/freetype/README @@ -9,8 +9,8 @@ is called `libttf'. They are *not* compatible! - FreeType 2.3.12 - =============== + FreeType 2.4.4 + ============== Please read the docs/CHANGES file, it contains IMPORTANT INFORMATION. @@ -26,9 +26,9 @@ and download one of the following files. - freetype-doc-2.3.12.tar.bz2 - freetype-doc-2.3.12.tar.gz - ftdoc2312.zip + freetype-doc-2.4.4.tar.bz2 + freetype-doc-2.4.4.tar.gz + ftdoc244.zip Bugs diff --git a/lib/3rdparty/freetype/README.git b/lib/3rdparty/freetype/README.git index bb36cf7b303..673200aa622 100644 --- a/lib/3rdparty/freetype/README.git +++ b/lib/3rdparty/freetype/README.git @@ -33,7 +33,7 @@ should work on all platforms which have GNU make (or makepp). ---------------------------------------------------------------------- -Copyright 2005, 2006, 2007, 2008, 2009 by +Copyright 2005, 2006, 2007, 2008, 2009, 2010 by David Turner, Robert Wilhelm, and Werner Lemberg. This file is part of the FreeType project, and may only be used, @@ -43,4 +43,4 @@ this file you indicate that you have read the license and understand and accept it fully. ---- end of README.CVS --- +--- end of README.git --- diff --git a/lib/3rdparty/freetype/configure b/lib/3rdparty/freetype/configure index 2efa2696797..b3975562410 100644 --- a/lib/3rdparty/freetype/configure +++ b/lib/3rdparty/freetype/configure @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright 2002, 2003, 2004, 2005, 2006, 2008, 2009 by +# Copyright 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, @@ -78,10 +78,15 @@ if test $# -gt 0; then done fi -# build a dummy Makefile if we are not building in the source tree +# build a dummy Makefile if we are not building in the source tree; +# we use inodes to avoid issues with symbolic links +inode_src=`ls -id $abs_ft2_dir | awk '{print $1}'` +inode_dst=`ls -id $abs_curr_dir | awk '{print $1}'` -if test "$abs_curr_dir" != "$abs_ft2_dir"; then - mkdir reference +if test $inode_src -ne $inode_dst; then + if test ! -d reference; then + mkdir reference + fi if test ! -r $abs_curr_dir/modules.cfg; then echo "Copying \`modules.cfg'" cp $abs_ft2_dir/modules.cfg $abs_curr_dir @@ -91,7 +96,7 @@ if test "$abs_curr_dir" != "$abs_ft2_dir"; then echo "OBJ_DIR := $abs_curr_dir" >> Makefile echo "OBJ_BUILD := \$(OBJ_DIR)" >> Makefile echo "DOC_DIR := \$(OBJ_DIR)/reference" >> Makefile - echo "LIBTOOL := \$(OBJ_DIR)/libtool" >> Makefile + echo "FT_LIBTOOL_DIR := \$(OBJ_DIR)" >> Makefile echo "ifndef FT2DEMOS" >> Makefile echo " include \$(TOP_DIR)/Makefile" >> Makefile echo "else" >> Makefile diff --git a/lib/3rdparty/freetype/devel/ftoption.h b/lib/3rdparty/freetype/devel/ftoption.h index 9c6c2fe4594..5392d1e87f1 100644 --- a/lib/3rdparty/freetype/devel/ftoption.h +++ b/lib/3rdparty/freetype/devel/ftoption.h @@ -488,8 +488,7 @@ FT_BEGIN_HEADER /*************************************************************************/ /* */ /* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */ - /* a bytecode interpreter in the TrueType driver. Note that there are */ - /* important patent issues related to the use of the interpreter. */ + /* a bytecode interpreter in the TrueType driver. */ /* */ /* By undefining this, you will only compile the code necessary to load */ /* TrueType glyphs without hinting. */ @@ -504,10 +503,13 @@ FT_BEGIN_HEADER /* */ /* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */ /* of the TrueType bytecode interpreter is used that doesn't implement */ - /* any of the patented opcodes and algorithms. Note that the */ - /* TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* if you define */ - /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words, either define */ - /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */ + /* any of the patented opcodes and algorithms. The patents related to */ + /* TrueType hinting have expired worldwide since May 2010; this option */ + /* is now deprecated. */ + /* */ + /* Note that the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* */ + /* if you define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words, */ + /* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */ /* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time. */ /* */ /* This macro is only useful for a small number of font files (mostly */ @@ -687,7 +689,28 @@ FT_BEGIN_HEADER * is recommended to disable the macro since it reduces the library's code * size and activates a few memory-saving optimizations as well. */ -/* #define FT_CONFIG_OPTION_OLD_INTERNALS */ +/* #define FT_CONFIG_OPTION_OLD_INTERNALS xxx */ + + + /* + * To detect legacy cache-lookup call from a rogue client (<= 2.1.7), + * we restrict the number of charmaps in a font. The current API of + * FTC_CMapCache_Lookup() takes cmap_index & charcode, but old API + * takes charcode only. To determine the passed value is for cmap_index + * or charcode, the possible cmap_index is restricted not to exceed + * the minimum possible charcode by a rogue client. It is also very + * unlikely that a rogue client is interested in Unicode values 0 to 15. + * + * NOTE: The original threshold was 4 deduced from popular number of + * cmap subtables in UCS-4 TrueType fonts, but now it is not + * irregular for OpenType fonts to have more than 4 subtables, + * because variation selector subtables are available for Apple + * and Microsoft platforms. + */ + +#ifdef FT_CONFIG_OPTION_OLD_INTERNALS +#define FT_MAX_CHARMAP_CACHEABLE 15 +#endif /* diff --git a/lib/3rdparty/freetype/freetype_ros.diff b/lib/3rdparty/freetype/freetype_ros.diff new file mode 100644 index 00000000000..6505a6cb06d --- /dev/null +++ b/lib/3rdparty/freetype/freetype_ros.diff @@ -0,0 +1,37 @@ +Index: src/base/ftbitmap.c +=================================================================== +--- src/base/ftbitmap.c (Revision 51535) ++++ src/base/ftbitmap.c (Arbeitskopie) +@@ -451,15 +451,15 @@ + { + FT_Int val = ss[0]; /* avoid a byte->int cast on each line */ + ++ tt[0] = (FT_Byte)( ( val & 0x80 ) ? 0xff : 0); ++ tt[1] = (FT_Byte)( ( val & 0x40 ) ? 0xff : 0); ++ tt[2] = (FT_Byte)( ( val & 0x20 ) ? 0xff : 0); ++ tt[3] = (FT_Byte)( ( val & 0x10 ) ? 0xff : 0); ++ tt[4] = (FT_Byte)( ( val & 0x08 ) ? 0xff : 0); ++ tt[5] = (FT_Byte)( ( val & 0x04 ) ? 0xff : 0); ++ tt[6] = (FT_Byte)( ( val & 0x02 ) ? 0xff : 0); ++ tt[7] = (FT_Byte)( ( val & 0x01 ) ? 0xff : 0); + +- tt[0] = (FT_Byte)( ( val & 0x80 ) >> 7 ); +- tt[1] = (FT_Byte)( ( val & 0x40 ) >> 6 ); +- tt[2] = (FT_Byte)( ( val & 0x20 ) >> 5 ); +- tt[3] = (FT_Byte)( ( val & 0x10 ) >> 4 ); +- tt[4] = (FT_Byte)( ( val & 0x08 ) >> 3 ); +- tt[5] = (FT_Byte)( ( val & 0x04 ) >> 2 ); +- tt[6] = (FT_Byte)( ( val & 0x02 ) >> 1 ); +- tt[7] = (FT_Byte)( val & 0x01 ); + + tt += 8; + ss += 1; +@@ -474,7 +474,7 @@ + + for ( ; j > 0; j-- ) + { +- tt[0] = (FT_Byte)( ( val & 0x80 ) >> 7); ++ tt[0] = (FT_Byte)( ( val & 0x80 ) ? 0xff : 0); + val <<= 1; + tt += 1; + } diff --git a/lib/3rdparty/freetype/include/freetype/config/ftconfig.h b/lib/3rdparty/freetype/include/freetype/config/ftconfig.h index 43d587e02b9..cbe30f26899 100644 --- a/lib/3rdparty/freetype/include/freetype/config/ftconfig.h +++ b/lib/3rdparty/freetype/include/freetype/config/ftconfig.h @@ -363,7 +363,7 @@ FT_BEGIN_HEADER #endif /* __arm__ && !__thumb__ && !( __CC_ARM || __ARMCC__ ) */ -#if defined( i386 ) +#if defined( __i386__ ) #define FT_MULFIX_ASSEMBLER FT_MulFix_i386 /* documentation is in freetype.h */ diff --git a/lib/3rdparty/freetype/include/freetype/config/ftoption.h b/lib/3rdparty/freetype/include/freetype/config/ftoption.h index 443c0d8bf4d..2b46259c152 100644 --- a/lib/3rdparty/freetype/include/freetype/config/ftoption.h +++ b/lib/3rdparty/freetype/include/freetype/config/ftoption.h @@ -317,7 +317,7 @@ FT_BEGIN_HEADER /* supply font data incrementally as the document is parsed, such */ /* as the Ghostscript interpreter for the PostScript language. */ /* */ -/* #define FT_CONFIG_OPTION_INCREMENTAL */ +#define FT_CONFIG_OPTION_INCREMENTAL /*************************************************************************/ @@ -488,8 +488,7 @@ FT_BEGIN_HEADER /*************************************************************************/ /* */ /* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */ - /* a bytecode interpreter in the TrueType driver. Note that there are */ - /* important patent issues related to the use of the interpreter. */ + /* a bytecode interpreter in the TrueType driver. */ /* */ /* By undefining this, you will only compile the code necessary to load */ /* TrueType glyphs without hinting. */ @@ -497,17 +496,20 @@ FT_BEGIN_HEADER /* Do not #undef this macro here, since the build system might */ /* define it for certain configurations only. */ /* */ -/* #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ +#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER /*************************************************************************/ /* */ /* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */ /* of the TrueType bytecode interpreter is used that doesn't implement */ - /* any of the patented opcodes and algorithms. Note that the */ - /* TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* if you define */ - /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words, either define */ - /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */ + /* any of the patented opcodes and algorithms. The patents related to */ + /* TrueType hinting have expired worldwide since May 2010; this option */ + /* is now deprecated. */ + /* */ + /* Note that the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* */ + /* if you define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words, */ + /* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */ /* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time. */ /* */ /* This macro is only useful for a small number of font files (mostly */ @@ -544,7 +546,7 @@ FT_BEGIN_HEADER /* ... */ /* } */ /* */ -//#define TT_CONFIG_OPTION_UNPATENTED_HINTING +/* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */ /*************************************************************************/ @@ -690,6 +692,27 @@ FT_BEGIN_HEADER #define FT_CONFIG_OPTION_OLD_INTERNALS + /* + * To detect legacy cache-lookup call from a rogue client (<= 2.1.7), + * we restrict the number of charmaps in a font. The current API of + * FTC_CMapCache_Lookup() takes cmap_index & charcode, but old API + * takes charcode only. To determine the passed value is for cmap_index + * or charcode, the possible cmap_index is restricted not to exceed + * the minimum possible charcode by a rogue client. It is also very + * unlikely that a rogue client is interested in Unicode values 0 to 15. + * + * NOTE: The original threshold was 4 deduced from popular number of + * cmap subtables in UCS-4 TrueType fonts, but now it is not + * irregular for OpenType fonts to have more than 4 subtables, + * because variation selector subtables are available for Apple + * and Microsoft platforms. + */ + +#ifdef FT_CONFIG_OPTION_OLD_INTERNALS +#define FT_MAX_CHARMAP_CACHEABLE 15 +#endif + + /* * This macro is defined if either unpatented or native TrueType * hinting is requested by the definitions above. diff --git a/lib/3rdparty/freetype/include/freetype/freetype.h b/lib/3rdparty/freetype/include/freetype/freetype.h index 942a740f00a..70c39008b8d 100644 --- a/lib/3rdparty/freetype/include/freetype/freetype.h +++ b/lib/3rdparty/freetype/include/freetype/freetype.h @@ -1952,6 +1952,9 @@ FT_BEGIN_HEADER /* Each new face object created with this function also owns a */ /* default @FT_Size object, accessible as `face->size'. */ /* */ + /* See the discussion of reference counters in the description of */ + /* @FT_Reference_Face. */ + /* */ FT_EXPORT( FT_Error ) FT_Open_Face( FT_Library library, const FT_Open_Args* args, @@ -2016,6 +2019,33 @@ FT_BEGIN_HEADER FT_Open_Args* parameters ); + /*************************************************************************/ + /* */ + /* */ + /* FT_Reference_Face */ + /* */ + /* */ + /* A counter gets initialized to~1 at the time an @FT_Face structure */ + /* is created. This function increments the counter. @FT_Done_Face */ + /* then only destroys a face if the counter is~1, otherwise it simply */ + /* decrements the counter. */ + /* */ + /* This function helps in managing life-cycles of structures which */ + /* reference @FT_Face objects. */ + /* */ + /* */ + /* face :: A handle to a target face object. */ + /* */ + /* */ + /* FreeType error code. 0~means success. */ + /* */ + /* */ + /* 2.4.2 */ + /* */ + FT_EXPORT( FT_Error ) + FT_Reference_Face( FT_Face face ); + + /*************************************************************************/ /* */ /* */ @@ -2031,6 +2061,10 @@ FT_BEGIN_HEADER /* */ /* FreeType error code. 0~means success. */ /* */ + /* */ + /* See the discussion of reference counters in the description of */ + /* @FT_Reference_Face. */ + /* */ FT_EXPORT( FT_Error ) FT_Done_Face( FT_Face face ); @@ -2997,7 +3031,7 @@ FT_BEGIN_HEADER * * @return: * The index into the array of character maps within the face to which - * `charmap' belongs. + * `charmap' belongs. If an error occurs, -1 is returned. * */ FT_EXPORT( FT_Int ) @@ -3773,8 +3807,8 @@ FT_BEGIN_HEADER * */ #define FREETYPE_MAJOR 2 -#define FREETYPE_MINOR 3 -#define FREETYPE_PATCH 12 +#define FREETYPE_MINOR 4 +#define FREETYPE_PATCH 4 /*************************************************************************/ @@ -3834,6 +3868,9 @@ FT_BEGIN_HEADER /* 1~if this is a TrueType font that uses one of the patented */ /* opcodes, 0~otherwise. */ /* */ + /* */ + /* Since May 2010, TrueType hinting is no longer patented. */ + /* */ /* */ /* 2.3.5 */ /* */ @@ -3861,6 +3898,9 @@ FT_BEGIN_HEADER /* an SFNT font, or if the unpatented hinter is not compiled in this */ /* instance of the library. */ /* */ + /* */ + /* Since May 2010, TrueType hinting is no longer patented. */ + /* */ /* */ /* 2.3.5 */ /* */ diff --git a/lib/3rdparty/freetype/include/freetype/ftcache.h b/lib/3rdparty/freetype/include/freetype/ftcache.h index 0916d70a37e..6af53062283 100644 --- a/lib/3rdparty/freetype/include/freetype/ftcache.h +++ b/lib/3rdparty/freetype/include/freetype/ftcache.h @@ -4,7 +4,7 @@ /* */ /* FreeType Cache subsystem (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -56,9 +56,12 @@ FT_BEGIN_HEADER * interpret them in any way. * * Second, the cache calls, only when needed, a client-provided function - * to convert a @FTC_FaceID into a new @FT_Face object. The latter is + * to convert an @FTC_FaceID into a new @FT_Face object. The latter is * then completely managed by the cache, including its termination - * through @FT_Done_Face. + * through @FT_Done_Face. To monitor termination of face objects, the + * finalizer callback in the `generic' field of the @FT_Face object can + * be used, which might also be used to store the @FTC_FaceID of the + * face. * * Clients are free to map face IDs to anything else. The most simple * usage is to associate them to a (pathname,face_index) pair that is @@ -211,12 +214,17 @@ FT_BEGIN_HEADER /* */ +#ifdef FT_CONFIG_OPTION_OLD_INTERNALS + + /* these macros are incompatible with LLP64, should not be used */ + #define FT_POINTER_TO_ULONG( p ) ( (FT_ULong)(FT_Pointer)(p) ) #define FTC_FACE_ID_HASH( i ) \ ((FT_UInt32)(( FT_POINTER_TO_ULONG( i ) >> 3 ) ^ \ ( FT_POINTER_TO_ULONG( i ) << 7 ) ) ) +#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ /*************************************************************************/ /*************************************************************************/ @@ -263,10 +271,10 @@ FT_BEGIN_HEADER /* reference-counted. A node with a count of~0 might be flushed */ /* out of a full cache whenever a lookup request is performed. */ /* */ - /* If you lookup nodes, you have the ability to `acquire' them, i.e., */ - /* to increment their reference count. This will prevent the node */ - /* from being flushed out of the cache until you explicitly `release' */ - /* it (see @FTC_Node_Unref). */ + /* If you look up nodes, you have the ability to `acquire' them, */ + /* i.e., to increment their reference count. This will prevent the */ + /* node from being flushed out of the cache until you explicitly */ + /* `release' it (see @FTC_Node_Unref). */ /* */ /* See also @FTC_SBitCache_Lookup and @FTC_ImageCache_Lookup. */ /* */ @@ -697,11 +705,17 @@ FT_BEGIN_HEADER (d1)->width == (d2)->width && \ (d1)->flags == (d2)->flags ) +#ifdef FT_CONFIG_OPTION_OLD_INTERNALS + + /* this macro is incompatible with LLP64, should not be used */ + #define FTC_IMAGE_TYPE_HASH( d ) \ (FT_UFast)( FTC_FACE_ID_HASH( (d)->face_id ) ^ \ ( (d)->width << 8 ) ^ (d)->height ^ \ ( (d)->flags << 4 ) ) +#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ + /*************************************************************************/ /* */ @@ -1093,6 +1107,7 @@ FT_BEGIN_HEADER (f1)->pix_width == (f2)->pix_width && \ (f1)->pix_height == (f2)->pix_height ) + /* this macro is incompatible with LLP64, should not be used */ #define FTC_FONT_HASH( f ) \ (FT_UInt32)( FTC_FACE_ID_HASH((f)->face_id) ^ \ ((f)->pix_width << 8) ^ \ diff --git a/lib/3rdparty/freetype/include/freetype/fterrdef.h b/lib/3rdparty/freetype/include/freetype/fterrdef.h index d7ad256bdb0..bf522206032 100644 --- a/lib/3rdparty/freetype/include/freetype/fterrdef.h +++ b/lib/3rdparty/freetype/include/freetype/fterrdef.h @@ -4,7 +4,7 @@ /* */ /* FreeType error codes (specification). */ /* */ -/* Copyright 2002, 2004, 2006, 2007 by */ +/* Copyright 2002, 2004, 2006, 2007, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -211,6 +211,9 @@ "argument stack underflow" ) FT_ERRORDEF_( Ignore, 0xA2, \ "ignore" ) + FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3, \ + "no Unicode glyph name found" ) + /* BDF errors */ @@ -220,19 +223,21 @@ "`FONT' field missing" ) FT_ERRORDEF_( Missing_Size_Field, 0xB2, \ "`SIZE' field missing" ) - FT_ERRORDEF_( Missing_Chars_Field, 0xB3, \ + FT_ERRORDEF_( Missing_Fontboundingbox_Field, 0xB3, \ + "`FONTBOUNDINGBOX' field missing" ) + FT_ERRORDEF_( Missing_Chars_Field, 0xB4, \ "`CHARS' field missing" ) - FT_ERRORDEF_( Missing_Startchar_Field, 0xB4, \ + FT_ERRORDEF_( Missing_Startchar_Field, 0xB5, \ "`STARTCHAR' field missing" ) - FT_ERRORDEF_( Missing_Encoding_Field, 0xB5, \ + FT_ERRORDEF_( Missing_Encoding_Field, 0xB6, \ "`ENCODING' field missing" ) - FT_ERRORDEF_( Missing_Bbx_Field, 0xB6, \ + FT_ERRORDEF_( Missing_Bbx_Field, 0xB7, \ "`BBX' field missing" ) - FT_ERRORDEF_( Bbx_Too_Big, 0xB7, \ + FT_ERRORDEF_( Bbx_Too_Big, 0xB8, \ "`BBX' too big" ) - FT_ERRORDEF_( Corrupted_Font_Header, 0xB8, \ + FT_ERRORDEF_( Corrupted_Font_Header, 0xB9, \ "Font header corrupted or missing fields" ) - FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xB9, \ + FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xBA, \ "Font glyphs corrupted or missing fields" ) diff --git a/lib/3rdparty/freetype/include/freetype/ftimage.h b/lib/3rdparty/freetype/include/freetype/ftimage.h index 0272e92d2b3..04b5e04f7bb 100644 --- a/lib/3rdparty/freetype/include/freetype/ftimage.h +++ b/lib/3rdparty/freetype/include/freetype/ftimage.h @@ -268,9 +268,21 @@ FT_BEGIN_HEADER /* flow. In all cases, the pitch is an offset to add */ /* to a bitmap pointer in order to go down one row. */ /* */ + /* Note that `padding' means the alignment of a */ + /* bitmap to a byte border, and FreeType functions */ + /* normally align to the smallest possible integer */ + /* value. */ + /* */ /* For the B/W rasterizer, `pitch' is always an even */ /* number. */ /* */ + /* To change the pitch of a bitmap (say, to make it a */ + /* multiple of 4), use @FT_Bitmap_Convert. */ + /* Alternatively, you might use callback functions to */ + /* directly render to the application's surface; see */ + /* the file `example2.cpp' in the tutorial for a */ + /* demonstration. */ + /* */ /* buffer :: A typeless pointer to the bitmap buffer. This */ /* value should be aligned on 32-bit boundaries in */ /* most cases. */ diff --git a/lib/3rdparty/freetype/include/freetype/ftlcdfil.h b/lib/3rdparty/freetype/include/freetype/ftlcdfil.h index c6201b38e99..0b55ebee65c 100644 --- a/lib/3rdparty/freetype/include/freetype/ftlcdfil.h +++ b/lib/3rdparty/freetype/include/freetype/ftlcdfil.h @@ -5,7 +5,7 @@ /* FreeType API for color filtering of subpixel bitmap glyphs */ /* (specification). */ /* */ -/* Copyright 2006, 2007, 2008 by */ +/* Copyright 2006, 2007, 2008, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -58,7 +58,7 @@ FT_BEGIN_HEADER /**************************************************************************** * - * @func: + * @enum: * FT_LcdFilter * * @description: @@ -161,6 +161,47 @@ FT_BEGIN_HEADER FT_Library_SetLcdFilter( FT_Library library, FT_LcdFilter filter ); + + /************************************************************************** + * + * @func: + * FT_Library_SetLcdFilterWeights + * + * @description: + * Use this function to override the filter weights selected by + * @FT_Library_SetLcdFilter. By default, FreeType uses the quintuple + * (0x00, 0x55, 0x56, 0x55, 0x00) for FT_LCD_FILTER_LIGHT, and (0x10, + * 0x40, 0x70, 0x40, 0x10) for FT_LCD_FILTER_DEFAULT and + * FT_LCD_FILTER_LEGACY. + * + * @input: + * library :: + * A handle to the target library instance. + * + * weights :: + * A pointer to an array; the function copies the first five bytes and + * uses them to specify the filter weights. + * + * @return: + * FreeType error code. 0~means success. + * + * @note: + * Due to *PATENTS* covering subpixel rendering, this function doesn't + * do anything except returning `FT_Err_Unimplemented_Feature' if the + * configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not + * defined in your build of the library, which should correspond to all + * default builds of FreeType. + * + * This function must be called after @FT_Library_SetLcdFilter to have + * any effect. + * + * @since: + * 2.4.0 + */ + FT_EXPORT( FT_Error ) + FT_Library_SetLcdFilterWeights( FT_Library library, + unsigned char *weights ); + /* */ diff --git a/lib/3rdparty/freetype/include/freetype/ftlist.h b/lib/3rdparty/freetype/include/freetype/ftlist.h index 93b05fc0d62..bb6f7f119d3 100644 --- a/lib/3rdparty/freetype/include/freetype/ftlist.h +++ b/lib/3rdparty/freetype/include/freetype/ftlist.h @@ -4,7 +4,7 @@ /* */ /* Generic list support for FreeType (specification). */ /* */ -/* Copyright 1996-2001, 2003, 2007 by */ +/* Copyright 1996-2001, 2003, 2007, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -255,6 +255,10 @@ FT_BEGIN_HEADER /* user :: A user-supplied field which is passed as the last */ /* argument to the destructor. */ /* */ + /* */ + /* This function expects that all nodes added by @FT_List_Add or */ + /* @FT_List_Insert have been dynamically allocated. */ + /* */ FT_EXPORT( void ) FT_List_Finalize( FT_List list, FT_List_Destructor destroy, diff --git a/lib/3rdparty/freetype/include/freetype/ftmodapi.h b/lib/3rdparty/freetype/include/freetype/ftmodapi.h index 3c9b876dfee..8f2e0179475 100644 --- a/lib/3rdparty/freetype/include/freetype/ftmodapi.h +++ b/lib/3rdparty/freetype/include/freetype/ftmodapi.h @@ -4,7 +4,7 @@ /* */ /* FreeType modules public interface (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2006, 2008, 2009 by */ +/* Copyright 1996-2001, 2002, 2003, 2006, 2008, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -249,6 +249,33 @@ FT_BEGIN_HEADER FT_Module module ); + /*************************************************************************/ + /* */ + /* */ + /* FT_Reference_Library */ + /* */ + /* */ + /* A counter gets initialized to~1 at the time an @FT_Library */ + /* structure is created. This function increments the counter. */ + /* @FT_Done_Library then only destroys a library if the counter is~1, */ + /* otherwise it simply decrements the counter. */ + /* */ + /* This function helps in managing life-cycles of structures which */ + /* reference @FT_Library objects. */ + /* */ + /* */ + /* library :: A handle to a target library object. */ + /* */ + /* */ + /* FreeType error code. 0~means success. */ + /* */ + /* */ + /* 2.4.2 */ + /* */ + FT_EXPORT( FT_Error ) + FT_Reference_Library( FT_Library library ); + + /*************************************************************************/ /* */ /* */ @@ -263,6 +290,9 @@ FT_BEGIN_HEADER /* @FT_Add_Default_Modules or a series of calls to @FT_Add_Module) */ /* instead of @FT_Init_FreeType to initialize the FreeType library. */ /* */ + /* Don't use @FT_Done_FreeType but @FT_Done_Library to destroy a */ + /* library instance. */ + /* */ /* */ /* memory :: A handle to the original memory object. */ /* */ @@ -272,6 +302,10 @@ FT_BEGIN_HEADER /* */ /* FreeType error code. 0~means success. */ /* */ + /* */ + /* See the discussion of reference counters in the description of */ + /* @FT_Reference_Library. */ + /* */ FT_EXPORT( FT_Error ) FT_New_Library( FT_Memory memory, FT_Library *alibrary ); @@ -292,6 +326,10 @@ FT_BEGIN_HEADER /* */ /* FreeType error code. 0~means success. */ /* */ + /* */ + /* See the discussion of reference counters in the description of */ + /* @FT_Reference_Library. */ + /* */ FT_EXPORT( FT_Error ) FT_Done_Library( FT_Library library ); @@ -394,8 +432,8 @@ FT_BEGIN_HEADER * * FT_TRUETYPE_ENGINE_TYPE_PATENTED :: * The library implements a bytecode interpreter that covers - * the full instruction set of the TrueType virtual machine. - * See the file `docs/PATENTS' for legal aspects. + * the full instruction set of the TrueType virtual machine (this + * was governed by patents until May 2010, hence the name). * * @since: * 2.2 diff --git a/lib/3rdparty/freetype/include/freetype/ftrender.h b/lib/3rdparty/freetype/include/freetype/ftrender.h index 41c31eac48c..e06a8142e65 100644 --- a/lib/3rdparty/freetype/include/freetype/ftrender.h +++ b/lib/3rdparty/freetype/include/freetype/ftrender.h @@ -4,7 +4,7 @@ /* */ /* FreeType renderer modules public interface (specification). */ /* */ -/* Copyright 1996-2001, 2005, 2006 by */ +/* Copyright 1996-2001, 2005, 2006, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -141,10 +141,6 @@ FT_BEGIN_HEADER /* raster_class :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. */ /* This is a pointer to its raster's class. */ /* */ - /* raster :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. */ - /* This is a pointer to the corresponding raster */ - /* object, if any. */ - /* */ typedef struct FT_Renderer_Class_ { FT_Module_Class root; diff --git a/lib/3rdparty/freetype/include/freetype/ftsystem.h b/lib/3rdparty/freetype/include/freetype/ftsystem.h index a95b2c76b61..e07460c55d4 100644 --- a/lib/3rdparty/freetype/include/freetype/ftsystem.h +++ b/lib/3rdparty/freetype/include/freetype/ftsystem.h @@ -4,7 +4,7 @@ /* */ /* FreeType low-level system interface definition (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2005 by */ +/* Copyright 1996-2001, 2002, 2005, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -240,7 +240,8 @@ FT_BEGIN_HEADER * * @note: * This function might be called to perform a seek or skip operation - * with a `count' of~0. + * with a `count' of~0. A non-zero return value then indicates an + * error. * */ typedef unsigned long @@ -301,7 +302,7 @@ FT_BEGIN_HEADER * The stream's input function. * * close :: - * The stream;s close function. + * The stream's close function. * * memory :: * The memory manager to use to preload frames. This is set diff --git a/lib/3rdparty/freetype/include/freetype/internal/ftmemory.h b/lib/3rdparty/freetype/include/freetype/internal/ftmemory.h index 2010ca90d7e..026aa63eaa9 100644 --- a/lib/3rdparty/freetype/include/freetype/internal/ftmemory.h +++ b/lib/3rdparty/freetype/include/freetype/internal/ftmemory.h @@ -4,7 +4,7 @@ /* */ /* The FreeType memory management macros (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2004, 2005, 2006, 2007 by */ +/* Copyright 1996-2001, 2002, 2004, 2005, 2006, 2007, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -58,15 +58,27 @@ FT_BEGIN_HEADER /* - * C++ refuses to handle statements like p = (void*)anything; where `p' - * is a typed pointer. Since we don't have a `typeof' operator in - * standard C++, we have to use ugly casts. + * C++ refuses to handle statements like p = (void*)anything, with `p' a + * typed pointer. Since we don't have a `typeof' operator in standard + * C++, we have to use a template to emulate it. */ #ifdef __cplusplus -#define FT_ASSIGNP( p, val ) *((void**)&(p)) = (val) + + extern "C++" + template inline T* + cplusplus_typeof( T*, + void *v ) + { + return static_cast ( v ); + } + +#define FT_ASSIGNP( p, val ) (p) = cplusplus_typeof( (p), (val) ) + #else + #define FT_ASSIGNP( p, val ) (p) = (val) + #endif diff --git a/lib/3rdparty/freetype/include/freetype/internal/ftobjs.h b/lib/3rdparty/freetype/include/freetype/internal/ftobjs.h index 574cf582967..670eb78a845 100644 --- a/lib/3rdparty/freetype/include/freetype/internal/ftobjs.h +++ b/lib/3rdparty/freetype/include/freetype/internal/ftobjs.h @@ -4,7 +4,7 @@ /* */ /* The FreeType private base classes (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -311,6 +311,12 @@ FT_BEGIN_HEADER /* in the case when the unpatented hinter is compiled within the */ /* library. */ /* */ + /* refcount :: */ + /* A counter initialized to~1 at the time an @FT_Face structure is */ + /* created. @FT_Reference_Face increments this counter, and */ + /* @FT_Done_Face only destroys a face if the counter is~1, */ + /* otherwise it simply decrements it. */ + /* */ typedef struct FT_Face_InternalRec_ { #ifdef FT_CONFIG_OPTION_OLD_INTERNALS @@ -328,6 +334,7 @@ FT_BEGIN_HEADER #endif FT_Bool ignore_unpatented_hinter; + FT_UInt refcount; } FT_Face_InternalRec; @@ -805,10 +812,28 @@ FT_BEGIN_HEADER /* */ /* debug_hooks :: XXX */ /* */ + /* lcd_filter :: If subpixel rendering is activated, the */ + /* selected LCD filter mode. */ + /* */ + /* lcd_extra :: If subpixel rendering is activated, the number */ + /* of extra pixels needed for the LCD filter. */ + /* */ + /* lcd_weights :: If subpixel rendering is activated, the LCD */ + /* filter weights, if any. */ + /* */ + /* lcd_filter_func :: If subpixel rendering is activated, the LCD */ + /* filtering callback function. */ + /* */ /* pic_container :: Contains global structs and tables, instead */ /* of defining them globallly. */ /* */ - + /* refcount :: A counter initialized to~1 at the time an */ + /* @FT_Library structure is created. */ + /* @FT_Reference_Library increments this counter, */ + /* and @FT_Done_Library only destroys a library */ + /* if the counter is~1, otherwise it simply */ + /* decrements it. */ + /* */ typedef struct FT_LibraryRec_ { FT_Memory memory; /* library's memory manager */ @@ -843,6 +868,8 @@ FT_BEGIN_HEADER FT_PIC_Container pic_container; #endif + FT_UInt refcount; + } FT_LibraryRec; diff --git a/lib/3rdparty/freetype/include/freetype/ttnameid.h b/lib/3rdparty/freetype/include/freetype/ttnameid.h index cbeac78db1e..66aef0432e0 100644 --- a/lib/3rdparty/freetype/include/freetype/ttnameid.h +++ b/lib/3rdparty/freetype/include/freetype/ttnameid.h @@ -64,7 +64,7 @@ FT_BEGIN_HEADER * MacOS systems (even if they contain a Microsoft charmap as well). * * TT_PLATFORM_ISO :: - * This value was used to specify Unicode charmaps. It is however + * This value was used to specify ISO/IEC 10646 charmaps. It is however * now deprecated. See @TT_ISO_ID_XXX for a list of corresponding * `encoding_id' values. * diff --git a/lib/3rdparty/freetype/include/freetype/tttables.h b/lib/3rdparty/freetype/include/freetype/tttables.h index c12b1726896..4610e501f27 100644 --- a/lib/3rdparty/freetype/include/freetype/tttables.h +++ b/lib/3rdparty/freetype/include/freetype/tttables.h @@ -5,7 +5,7 @@ /* Basic SFNT/TrueType tables definitions and interface */ /* (specification only). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2008, 2009 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2008, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -557,13 +557,13 @@ FT_BEGIN_HEADER /* */ typedef enum FT_Sfnt_Tag_ { - ft_sfnt_head = 0, - ft_sfnt_maxp = 1, - ft_sfnt_os2 = 2, - ft_sfnt_hhea = 3, - ft_sfnt_vhea = 4, - ft_sfnt_post = 5, - ft_sfnt_pclt = 6, + ft_sfnt_head = 0, /* TT_Header */ + ft_sfnt_maxp = 1, /* TT_MaxProfile */ + ft_sfnt_os2 = 2, /* TT_OS2 */ + ft_sfnt_hhea = 3, /* TT_HoriHeader */ + ft_sfnt_vhea = 4, /* TT_VertHeader */ + ft_sfnt_post = 5, /* TT_Postscript */ + ft_sfnt_pclt = 6, /* TT_PCLT */ sfnt_max /* internal end mark */ @@ -590,6 +590,9 @@ FT_BEGIN_HEADER /* error, or if the corresponding table was not found *OR* loaded */ /* from the file. */ /* */ + /* Use a typecast according to `tag' to access the structure */ + /* elements. */ + /* */ /* */ /* The table is owned by the face object and disappears with it. */ /* */ diff --git a/lib/3rdparty/freetype/src/autofit/afcjk.c b/lib/3rdparty/freetype/src/autofit/afcjk.c index bab0c42bade..f3b1067edf2 100644 --- a/lib/3rdparty/freetype/src/autofit/afcjk.c +++ b/lib/3rdparty/freetype/src/autofit/afcjk.c @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines for CJK script (body). */ /* */ -/* Copyright 2006, 2007, 2008, 2009 by */ +/* Copyright 2006, 2007, 2008, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -1371,7 +1371,7 @@ FT_UNUSED( metrics ); - error = af_glyph_hints_reload( hints, outline, 0 ); + error = af_glyph_hints_reload( hints, outline ); if ( error ) goto Exit; diff --git a/lib/3rdparty/freetype/src/autofit/afglobal.c b/lib/3rdparty/freetype/src/autofit/afglobal.c index ac293619d3d..178c884cd24 100644 --- a/lib/3rdparty/freetype/src/autofit/afglobal.c +++ b/lib/3rdparty/freetype/src/autofit/afglobal.c @@ -4,7 +4,7 @@ /* */ /* Auto-fitter routines to compute global hinting values (body). */ /* */ -/* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ +/* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -167,8 +167,11 @@ for ( nn = 0; nn < globals->glyph_count; nn++ ) { - if ( gscripts[nn] == AF_SCRIPT_LIST_NONE ) - gscripts[nn] = AF_SCRIPT_LIST_DEFAULT; + if ( ( gscripts[nn] & ~AF_DIGIT ) == AF_SCRIPT_LIST_NONE ) + { + gscripts[nn] &= ~AF_SCRIPT_LIST_NONE; + gscripts[nn] |= AF_SCRIPT_LIST_DEFAULT; + } } } @@ -183,7 +186,7 @@ { FT_Error error; FT_Memory memory; - AF_FaceGlobals globals; + AF_FaceGlobals globals = NULL; memory = face->memory; diff --git a/lib/3rdparty/freetype/src/autofit/afhints.c b/lib/3rdparty/freetype/src/autofit/afhints.c index fe38fba9954..c3497091dd6 100644 --- a/lib/3rdparty/freetype/src/autofit/afhints.c +++ b/lib/3rdparty/freetype/src/autofit/afhints.c @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines (body). */ /* */ -/* Copyright 2003, 2004, 2005, 2006, 2007, 2009 by */ +/* Copyright 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -377,120 +377,6 @@ } - /* compute all inflex points in a given glyph */ - - static void - af_glyph_hints_compute_inflections( AF_GlyphHints hints ) - { - AF_Point* contour = hints->contours; - AF_Point* contour_limit = contour + hints->num_contours; - - - /* do each contour separately */ - for ( ; contour < contour_limit; contour++ ) - { - AF_Point point = contour[0]; - AF_Point first = point; - AF_Point start = point; - AF_Point end = point; - AF_Point before; - AF_Point after; - FT_Pos in_x, in_y, out_x, out_y; - AF_Angle orient_prev, orient_cur; - FT_Int finished = 0; - - - /* compute first segment in contour */ - first = point; - - start = end = first; - do - { - end = end->next; - if ( end == first ) - goto Skip; - - in_x = end->fx - start->fx; - in_y = end->fy - start->fy; - - } while ( in_x == 0 && in_y == 0 ); - - /* extend the segment start whenever possible */ - before = start; - do - { - do - { - start = before; - before = before->prev; - if ( before == first ) - goto Skip; - - out_x = start->fx - before->fx; - out_y = start->fy - before->fy; - - } while ( out_x == 0 && out_y == 0 ); - - orient_prev = ft_corner_orientation( in_x, in_y, out_x, out_y ); - - } while ( orient_prev == 0 ); - - first = start; - - in_x = out_x; - in_y = out_y; - - /* now process all segments in the contour */ - do - { - /* first, extend current segment's end whenever possible */ - after = end; - do - { - do - { - end = after; - after = after->next; - if ( after == first ) - finished = 1; - - out_x = after->fx - end->fx; - out_y = after->fy - end->fy; - - } while ( out_x == 0 && out_y == 0 ); - - orient_cur = ft_corner_orientation( in_x, in_y, out_x, out_y ); - - } while ( orient_cur == 0 ); - - if ( ( orient_prev + orient_cur ) == 0 ) - { - /* we have an inflection point here */ - do - { - start->flags |= AF_FLAG_INFLECTION; - start = start->next; - - } while ( start != end ); - - start->flags |= AF_FLAG_INFLECTION; - } - - start = end; - end = after; - - orient_prev = orient_cur; - in_x = out_x; - in_y = out_y; - - } while ( !finished ); - - Skip: - ; - } - } - - FT_LOCAL_DEF( void ) af_glyph_hints_init( AF_GlyphHints hints, FT_Memory memory ) @@ -551,8 +437,7 @@ FT_LOCAL_DEF( FT_Error ) af_glyph_hints_reload( AF_GlyphHints hints, - FT_Outline* outline, - FT_Bool get_inflections ) + FT_Outline* outline ) { FT_Error error = AF_Err_Ok; AF_Point points; @@ -639,13 +524,11 @@ { FT_Vector* vec = outline->points; char* tag = outline->tags; - AF_Point first = points; AF_Point end = points + outline->contours[0]; AF_Point prev = end; FT_Int contour_index = 0; - FT_UNUSED( first ); for ( point = points; point < point_limit; point++, vec++, tag++ ) { point->fx = (FT_Short)vec->x; @@ -673,9 +556,8 @@ { if ( ++contour_index < outline->n_contours ) { - first = point + 1; - end = points + outline->contours[contour_index]; - prev = end; + end = points + outline->contours[contour_index]; + prev = end; } } } @@ -752,11 +634,6 @@ } } - /* compute inflection points -- */ - /* disabled due to no longer perceived benefits */ - if ( 0 && get_inflections ) - af_glyph_hints_compute_inflections( hints ); - Exit: return error; } diff --git a/lib/3rdparty/freetype/src/autofit/afhints.h b/lib/3rdparty/freetype/src/autofit/afhints.h index 675826835ae..10e673b3f5c 100644 --- a/lib/3rdparty/freetype/src/autofit/afhints.h +++ b/lib/3rdparty/freetype/src/autofit/afhints.h @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines (specification). */ /* */ -/* Copyright 2003, 2004, 2005, 2006, 2007, 2008 by */ +/* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -286,8 +286,7 @@ FT_BEGIN_HEADER FT_LOCAL( FT_Error ) af_glyph_hints_reload( AF_GlyphHints hints, - FT_Outline* outline, - FT_Bool get_inflections ); + FT_Outline* outline ); FT_LOCAL( void ) af_glyph_hints_save( AF_GlyphHints hints, diff --git a/lib/3rdparty/freetype/src/autofit/aflatin.c b/lib/3rdparty/freetype/src/autofit/aflatin.c index e6882d5e7b5..63491e31055 100644 --- a/lib/3rdparty/freetype/src/autofit/aflatin.c +++ b/lib/3rdparty/freetype/src/autofit/aflatin.c @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines for latin script (body). */ /* */ -/* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ +/* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -77,7 +77,7 @@ af_glyph_hints_rescale( hints, (AF_ScriptMetrics)dummy ); - error = af_glyph_hints_reload( hints, &face->glyph->outline, 0 ); + error = af_glyph_hints_reload( hints, &face->glyph->outline ); if ( error ) goto Exit; @@ -1534,21 +1534,18 @@ /* compare to standard width */ - if ( axis->width_count > 0 ) + delta = dist - axis->widths[0].cur; + + if ( delta < 0 ) + delta = -delta; + + if ( delta < 40 ) { - delta = dist - axis->widths[0].cur; + dist = axis->widths[0].cur; + if ( dist < 48 ) + dist = 48; - if ( delta < 0 ) - delta = -delta; - - if ( delta < 40 ) - { - dist = axis->widths[0].cur; - if ( dist < 48 ) - dist = 48; - - goto Done_Width; - } + goto Done_Width; } if ( dist < 3 * 64 ) @@ -2105,7 +2102,7 @@ int dim; - error = af_glyph_hints_reload( hints, outline, 1 ); + error = af_glyph_hints_reload( hints, outline ); if ( error ) goto Exit; diff --git a/lib/3rdparty/freetype/src/autofit/aflatin2.c b/lib/3rdparty/freetype/src/autofit/aflatin2.c index 5cbeb296b58..6546475a163 100644 --- a/lib/3rdparty/freetype/src/autofit/aflatin2.c +++ b/lib/3rdparty/freetype/src/autofit/aflatin2.c @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines for latin script (body). */ /* */ -/* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ +/* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -84,7 +84,7 @@ af_glyph_hints_rescale( hints, (AF_ScriptMetrics)dummy ); - error = af_glyph_hints_reload( hints, &face->glyph->outline, 0 ); + error = af_glyph_hints_reload( hints, &face->glyph->outline ); if ( error ) goto Exit; @@ -545,7 +545,8 @@ FT_Pos fitted = ( scaled + 40 ) & ~63; #if 1 - if ( scaled != fitted ) { + if ( scaled != fitted ) + { scale = FT_MulDiv( scale, fitted, scaled ); AF_LOG(( "== scaled x-top = %.2g fitted = %.2g, scaling = %.4g\n", scaled/64.0, fitted/64.0, (fitted*1.0)/scaled )); } @@ -2249,7 +2250,7 @@ int dim; - error = af_glyph_hints_reload( hints, outline, 1 ); + error = af_glyph_hints_reload( hints, outline ); if ( error ) goto Exit; diff --git a/lib/3rdparty/freetype/src/autofit/afpic.c b/lib/3rdparty/freetype/src/autofit/afpic.c index 76822c301a8..5b9aba69194 100644 --- a/lib/3rdparty/freetype/src/autofit/afpic.c +++ b/lib/3rdparty/freetype/src/autofit/afpic.c @@ -4,7 +4,7 @@ /* */ /* The FreeType position independent code services for autofit module. */ /* */ -/* Copyright 2009 by */ +/* Copyright 2009, 2010 by */ /* Oran Agra and Mickey Gabel. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -45,19 +45,21 @@ } } + FT_Error - autofit_module_class_pic_init( FT_Library library ) + autofit_module_class_pic_init( FT_Library library ) { - FT_PIC_Container* pic_container = &library->pic_container; - FT_UInt ss; - FT_Error error = FT_Err_Ok; - AFModulePIC* container; - FT_Memory memory = library->memory; + FT_PIC_Container* pic_container = &library->pic_container; + FT_UInt ss; + FT_Error error = AF_Err_Ok; + AFModulePIC* container; + FT_Memory memory = library->memory; + /* allocate pointer, clear and set global container pointer */ if ( FT_ALLOC ( container, sizeof ( *container ) ) ) return error; - FT_MEM_SET( container, 0, sizeof(*container) ); + FT_MEM_SET( container, 0, sizeof ( *container ) ); pic_container->autofit = container; /* initialize pointer table - this is how the module usually expects this data */ diff --git a/lib/3rdparty/freetype/src/base/ftbase.h b/lib/3rdparty/freetype/src/base/ftbase.h index 1dc49f3bdf6..6375613b2dd 100644 --- a/lib/3rdparty/freetype/src/base/ftbase.h +++ b/lib/3rdparty/freetype/src/base/ftbase.h @@ -49,6 +49,17 @@ FT_BEGIN_HEADER FT_Face *aface ); +#ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK + /* Mac OS X/Darwin kernel often changes recommended method to access */ + /* the resource fork and older methods makes the kernel issue the */ + /* warning of deprecated method. To calm it down, the methods based */ + /* on Darwin VFS should be grouped and skip the rest methods after */ + /* the case the resource is opened but found to lack a font in it. */ + FT_LOCAL( FT_Bool ) + raccess_rule_by_darwin_vfs( FT_UInt rule_index ); +#endif /* FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK */ + + FT_END_HEADER #endif /* __FTBASE_H__ */ diff --git a/lib/3rdparty/freetype/src/base/ftdbgmem.c b/lib/3rdparty/freetype/src/base/ftdbgmem.c index 160269d1929..12fed04bb94 100644 --- a/lib/3rdparty/freetype/src/base/ftdbgmem.c +++ b/lib/3rdparty/freetype/src/base/ftdbgmem.c @@ -47,7 +47,7 @@ typedef struct FT_MemTableRec_* FT_MemTable; -#define FT_MEM_VAL( addr ) ((FT_ULong)(FT_Pointer)( addr )) +#define FT_MEM_VAL( addr ) ((FT_PtrDist)(FT_Pointer)( addr )) /* * This structure holds statistics for a single allocation/release @@ -275,7 +275,7 @@ for ( i = 0; i < table->size; i++ ) { FT_MemNode node, next, *pnode; - FT_ULong hash; + FT_PtrDist hash; node = table->buckets[i]; @@ -430,7 +430,7 @@ ft_mem_table_get_nodep( FT_MemTable table, FT_Byte* address ) { - FT_ULong hash; + FT_PtrDist hash; FT_MemNode *pnode, node; diff --git a/lib/3rdparty/freetype/src/base/ftgloadr.c b/lib/3rdparty/freetype/src/base/ftgloadr.c index ac0010ddd88..8483450192c 100644 --- a/lib/3rdparty/freetype/src/base/ftgloadr.c +++ b/lib/3rdparty/freetype/src/base/ftgloadr.c @@ -4,7 +4,7 @@ /* */ /* The FreeType glyph loader (body). */ /* */ -/* Copyright 2002, 2003, 2004, 2005, 2006 by */ +/* Copyright 2002, 2003, 2004, 2005, 2006, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -69,7 +69,7 @@ FT_GlyphLoader_New( FT_Memory memory, FT_GlyphLoader *aloader ) { - FT_GlyphLoader loader; + FT_GlyphLoader loader = NULL; FT_Error error; diff --git a/lib/3rdparty/freetype/src/base/ftglyph.c b/lib/3rdparty/freetype/src/base/ftglyph.c index 3505d6dde9a..b22050800b7 100644 --- a/lib/3rdparty/freetype/src/base/ftglyph.c +++ b/lib/3rdparty/freetype/src/base/ftglyph.c @@ -4,7 +4,7 @@ /* */ /* FreeType convenience functions to handle glyphs (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2007, 2008 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2007, 2008, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -282,7 +282,7 @@ { FT_Memory memory = library->memory; FT_Error error; - FT_Glyph glyph; + FT_Glyph glyph = NULL; *aglyph = 0; diff --git a/lib/3rdparty/freetype/src/base/ftgxval.c b/lib/3rdparty/freetype/src/base/ftgxval.c index 32662bed872..aeeb8ce4fc9 100644 --- a/lib/3rdparty/freetype/src/base/ftgxval.c +++ b/lib/3rdparty/freetype/src/base/ftgxval.c @@ -4,7 +4,7 @@ /* */ /* FreeType API for validating TrueTyepGX/AAT tables (body). */ /* */ -/* Copyright 2004, 2005, 2006 by */ +/* Copyright 2004, 2005, 2006, 2010 by */ /* Masatake YAMATO, Redhat K.K, */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ @@ -73,9 +73,14 @@ FT_TrueTypeGX_Free( FT_Face face, FT_Bytes table ) { - FT_Memory memory = FT_FACE_MEMORY( face ); + FT_Memory memory; + if ( !face ) + return; + + memory = FT_FACE_MEMORY( face ); + FT_FREE( table ); } @@ -119,7 +124,13 @@ FT_ClassicKern_Free( FT_Face face, FT_Bytes table ) { - FT_Memory memory = FT_FACE_MEMORY( face ); + FT_Memory memory; + + + if ( !face ) + return; + + memory = FT_FACE_MEMORY( face ); FT_FREE( table ); diff --git a/lib/3rdparty/freetype/src/base/ftinit.c b/lib/3rdparty/freetype/src/base/ftinit.c index f94f25a83c1..305177a7e16 100644 --- a/lib/3rdparty/freetype/src/base/ftinit.c +++ b/lib/3rdparty/freetype/src/base/ftinit.c @@ -98,7 +98,8 @@ #undef FT_USE_MODULE #define FT_USE_MODULE( type, x ) MODULE_CLASS_##x, - enum { + enum + { #include FT_CONFIG_MODULES_H FT_NUM_MODULE_CLASSES }; diff --git a/lib/3rdparty/freetype/src/base/ftlcdfil.c b/lib/3rdparty/freetype/src/base/ftlcdfil.c index 80640111c4f..0da4ba160e3 100644 --- a/lib/3rdparty/freetype/src/base/ftlcdfil.c +++ b/lib/3rdparty/freetype/src/base/ftlcdfil.c @@ -4,7 +4,7 @@ /* */ /* FreeType API for color filtering of subpixel bitmap glyphs (body). */ /* */ -/* Copyright 2006, 2008, 2009 by */ +/* Copyright 2006, 2008, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -267,18 +267,31 @@ FT_EXPORT_DEF( FT_Error ) - FT_Library_SetLcdFilter( FT_Library library, - FT_LcdFilter filter ) + FT_Library_SetLcdFilterWeights( FT_Library library, + unsigned char *weights ) + { + if ( !library || !weights ) + return FT_Err_Invalid_Argument; + + ft_memcpy( library->lcd_weights, weights, 5 ); + + return FT_Err_Ok; + } + + + FT_EXPORT_DEF( FT_Error ) + FT_Library_SetLcdFilter( FT_Library library, + FT_LcdFilter filter ) { static const FT_Byte light_filter[5] = - { 0, 85, 86, 85, 0 }; + { 0x00, 0x55, 0x56, 0x55, 0x00 }; /* the values here sum up to a value larger than 256, */ /* providing a cheap gamma correction */ static const FT_Byte default_filter[5] = { 0x10, 0x40, 0x70, 0x40, 0x10 }; - if ( library == NULL ) + if ( !library ) return FT_Err_Invalid_Argument; switch ( filter ) @@ -330,11 +343,23 @@ } library->lcd_filter = filter; - return 0; + + return FT_Err_Ok; } #else /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */ + FT_EXPORT_DEF( FT_Error ) + FT_Library_SetLcdFilterWeights( FT_Library library, + unsigned char *weights ) + { + FT_UNUSED( library ); + FT_UNUSED( weights ); + + return FT_Err_Unimplemented_Feature; + } + + FT_EXPORT_DEF( FT_Error ) FT_Library_SetLcdFilter( FT_Library library, FT_LcdFilter filter ) diff --git a/lib/3rdparty/freetype/src/base/ftobjs.c b/lib/3rdparty/freetype/src/base/ftobjs.c index 46bcd3bb8b2..cb44b8cca43 100644 --- a/lib/3rdparty/freetype/src/base/ftobjs.c +++ b/lib/3rdparty/freetype/src/base/ftobjs.c @@ -29,7 +29,6 @@ #include FT_TRUETYPE_TABLES_H #include FT_TRUETYPE_TAGS_H #include FT_TRUETYPE_IDS_H -#include FT_OUTLINE_H #include FT_SERVICE_SFNT_H #include FT_SERVICE_POSTSCRIPT_NAME_H @@ -143,7 +142,7 @@ if ( !args ) return FT_Err_Invalid_Argument; - memory = library->memory; + memory = library->memory; if ( FT_NEW( stream ) ) goto Exit; @@ -230,11 +229,11 @@ static FT_Error ft_glyphslot_init( FT_GlyphSlot slot ) { - FT_Driver driver = slot->face->driver; - FT_Driver_Class clazz = driver->clazz; - FT_Memory memory = driver->root.memory; - FT_Error error = FT_Err_Ok; - FT_Slot_Internal internal; + FT_Driver driver = slot->face->driver; + FT_Driver_Class clazz = driver->clazz; + FT_Memory memory = driver->root.memory; + FT_Error error = FT_Err_Ok; + FT_Slot_Internal internal = NULL; slot->library = driver->root.library; @@ -992,6 +991,14 @@ ( cur[0]->platform_id == TT_PLATFORM_APPLE_UNICODE && cur[0]->encoding_id == TT_APPLE_ID_UNICODE_32 ) ) { +#ifdef FT_MAX_CHARMAP_CACHEABLE + if ( cur - first > FT_MAX_CHARMAP_CACHEABLE ) + { + FT_ERROR(( "find_unicode_charmap: UCS-4 cmap is found " + "at too late position (%d)\n", cur - first )); + continue; + } +#endif face->charmap = cur[0]; return FT_Err_Ok; } @@ -1006,6 +1013,14 @@ { if ( cur[0]->encoding == FT_ENCODING_UNICODE ) { +#ifdef FT_MAX_CHARMAP_CACHEABLE + if ( cur - first > FT_MAX_CHARMAP_CACHEABLE ) + { + FT_ERROR(( "find_unicode_charmap: UCS-2 cmap is found " + "at too late position (%d)\n", cur - first )); + continue; + } +#endif face->charmap = cur[0]; return FT_Err_Ok; } @@ -1047,7 +1062,17 @@ if ( cur[0]->platform_id == TT_PLATFORM_APPLE_UNICODE && cur[0]->encoding_id == TT_APPLE_ID_VARIANT_SELECTOR && FT_Get_CMap_Format( cur[0] ) == 14 ) + { +#ifdef FT_MAX_CHARMAP_CACHEABLE + if ( cur - first > FT_MAX_CHARMAP_CACHEABLE ) + { + FT_ERROR(( "find_unicode_charmap: UVS cmap is found " + "at too late position (%d)\n", cur - first )); + continue; + } +#endif return cur[0]; + } } return NULL; @@ -1548,11 +1573,26 @@ goto Exit; if ( FT_READ_USHORT( flags ) ) goto Exit; - rlen -= 2; /* the flags are part of the resource */ + FT_TRACE3(( "POST fragment[%d]: offsets=0x%08x, rlen=0x%08x, flags=0x%04x\n", + i, offsets[i], rlen, flags )); + + /* postpone the check of rlen longer than buffer until FT_Stream_Read() */ + if ( ( flags >> 8 ) == 0 ) /* Comment, should not be loaded */ + continue; + + /* the flags are part of the resource, so rlen >= 2. */ + /* but some fonts declare rlen = 0 for empty fragment */ + if ( rlen > 2 ) + rlen -= 2; + else + rlen = 0; + if ( ( flags >> 8 ) == type ) len += rlen; else { + if ( pfb_lenpos + 3 > pfb_len + 2 ) + goto Exit2; pfb_data[pfb_lenpos ] = (FT_Byte)( len ); pfb_data[pfb_lenpos + 1] = (FT_Byte)( len >> 8 ); pfb_data[pfb_lenpos + 2] = (FT_Byte)( len >> 16 ); @@ -1561,6 +1601,8 @@ if ( ( flags >> 8 ) == 5 ) /* End of font mark */ break; + if ( pfb_pos + 6 > pfb_len + 2 ) + goto Exit2; pfb_data[pfb_pos++] = 0x80; type = flags >> 8; @@ -1574,13 +1616,23 @@ pfb_data[pfb_pos++] = 0; } + error = FT_Err_Cannot_Open_Resource; + if ( pfb_pos > pfb_len || pfb_pos + rlen > pfb_len ) + goto Exit2; + error = FT_Stream_Read( stream, (FT_Byte *)pfb_data + pfb_pos, rlen ); + if ( error ) + goto Exit2; pfb_pos += rlen; } + if ( pfb_pos + 2 > pfb_len + 2 ) + goto Exit2; pfb_data[pfb_pos++] = 0x80; pfb_data[pfb_pos++] = 3; + if ( pfb_lenpos + 3 > pfb_len + 2 ) + goto Exit2; pfb_data[pfb_lenpos ] = (FT_Byte)( len ); pfb_data[pfb_lenpos + 1] = (FT_Byte)( len >> 8 ); pfb_data[pfb_lenpos + 2] = (FT_Byte)( len >> 16 ); @@ -1799,6 +1851,7 @@ char * file_names[FT_RACCESS_N_RULES]; FT_Long offsets[FT_RACCESS_N_RULES]; FT_Error errors[FT_RACCESS_N_RULES]; + FT_Bool is_darwin_vfs, vfs_rfork_has_no_font = FALSE; /* not tested */ FT_Open_Args args2; FT_Stream stream2 = 0; @@ -1809,6 +1862,15 @@ for ( i = 0; i < FT_RACCESS_N_RULES; i++ ) { + is_darwin_vfs = raccess_rule_by_darwin_vfs( i ); + if ( is_darwin_vfs && vfs_rfork_has_no_font ) + { + FT_TRACE3(( "Skip rule %d: darwin vfs resource fork" + " is already checked and" + " no font is found\n", i )); + continue; + } + if ( errors[i] ) { FT_TRACE3(( "Error[%d] has occurred in rule %d\n", errors[i], i )); @@ -1822,6 +1884,9 @@ i, args2.pathname, offsets[i] )); error = FT_Stream_New( library, &args2, &stream2 ); + if ( is_darwin_vfs && error == FT_Err_Cannot_Open_Stream ) + vfs_rfork_has_no_font = TRUE; + if ( error ) { FT_TRACE3(( "failed\n" )); @@ -1836,6 +1901,8 @@ if ( !error ) break; + else if ( is_darwin_vfs ) + vfs_rfork_has_no_font = TRUE; } for (i = 0; i < FT_RACCESS_N_RULES; i++) @@ -1915,9 +1982,9 @@ FT_Error error; FT_Driver driver; FT_Memory memory; - FT_Stream stream = 0; - FT_Face face = 0; - FT_ListNode node = 0; + FT_Stream stream = NULL; + FT_Face face = NULL; + FT_ListNode node = NULL; FT_Bool external_stream; FT_Module* cur; FT_Module* limit; @@ -2141,6 +2208,8 @@ internal->transform_delta.x = 0; internal->transform_delta.y = 0; + + internal->refcount = 1; } if ( aface ) @@ -2226,6 +2295,17 @@ } + /* documentation is in freetype.h */ + + FT_EXPORT_DEF( FT_Error ) + FT_Reference_Face( FT_Face face ) + { + face->internal->refcount++; + + return FT_Err_Ok; + } + + /* documentation is in freetype.h */ FT_EXPORT_DEF( FT_Error ) @@ -2240,22 +2320,29 @@ error = FT_Err_Invalid_Face_Handle; if ( face && face->driver ) { - driver = face->driver; - memory = driver->root.memory; - - /* find face in driver's list */ - node = FT_List_Find( &driver->faces_list, face ); - if ( node ) - { - /* remove face object from the driver's list */ - FT_List_Remove( &driver->faces_list, node ); - FT_FREE( node ); - - /* now destroy the object proper */ - destroy_face( memory, face, driver ); + face->internal->refcount--; + if ( face->internal->refcount > 0 ) error = FT_Err_Ok; + else + { + driver = face->driver; + memory = driver->root.memory; + + /* find face in driver's list */ + node = FT_List_Find( &driver->faces_list, face ); + if ( node ) + { + /* remove face object from the driver's list */ + FT_List_Remove( &driver->faces_list, node ); + FT_FREE( node ); + + /* now destroy the object proper */ + destroy_face( memory, face, driver ); + error = FT_Err_Ok; + } } } + return error; } @@ -2901,6 +2988,15 @@ { if ( cur[0]->encoding == encoding ) { +#ifdef FT_MAX_CHARMAP_CACHEABLE + if ( cur - face->charmaps > FT_MAX_CHARMAP_CACHEABLE ) + { + FT_ERROR(( "FT_Select_Charmap: requested charmap is found (%d), " + "but in too late position to cache\n", + cur - face->charmaps )); + continue; + } +#endif face->charmap = cur[0]; return 0; } @@ -2935,6 +3031,15 @@ { if ( cur[0] == charmap ) { +#ifdef FT_MAX_CHARMAP_CACHEABLE + if ( cur - face->charmaps > FT_MAX_CHARMAP_CACHEABLE ) + { + FT_ERROR(( "FT_Set_Charmap: requested charmap is found (%d), " + "but in too late position to cache\n", + cur - face->charmaps )); + continue; + } +#endif face->charmap = cur[0]; return 0; } @@ -2951,12 +3056,24 @@ FT_Int i; + if ( !charmap || !charmap->face ) + return -1; + for ( i = 0; i < charmap->face->num_charmaps; i++ ) if ( charmap->face->charmaps[i] == charmap ) break; FT_ASSERT( i < charmap->face->num_charmaps ); +#ifdef FT_MAX_CHARMAP_CACHEABLE + if ( i > FT_MAX_CHARMAP_CACHEABLE ) + { + FT_ERROR(( "FT_Get_Charmap_Index: requested charmap is found (%d), " + "but in too late position to cache\n", + i )); + return -i; + } +#endif return i; } @@ -3095,7 +3212,7 @@ } result = cmap->clazz->char_index( cmap, (FT_UInt32)charcode ); } - return result; + return result; } @@ -3109,14 +3226,14 @@ FT_UInt gindex = 0; - if ( face && face->charmap ) + if ( face && face->charmap && face->num_glyphs ) { gindex = FT_Get_Char_Index( face, 0 ); - if ( gindex == 0 ) + if ( gindex == 0 || gindex >= (FT_UInt)face->num_glyphs ) result = FT_Get_Next_Char( face, 0, &gindex ); } - if ( agindex ) + if ( agindex ) *agindex = gindex; return result; @@ -3134,13 +3251,16 @@ FT_UInt gindex = 0; - if ( face && face->charmap ) + if ( face && face->charmap && face->num_glyphs ) { FT_UInt32 code = (FT_UInt32)charcode; FT_CMap cmap = FT_CMAP( face->charmap ); - gindex = cmap->clazz->char_next( cmap, &code ); + do { + gindex = cmap->clazz->char_next( cmap, &code ); + } while ( gindex >= (FT_UInt)face->num_glyphs ); + result = ( gindex == 0 ) ? 0 : code; } @@ -3645,7 +3765,7 @@ FT_Library library = module->library; FT_Memory memory = library->memory; FT_Error error; - FT_ListNode node; + FT_ListNode node = NULL; if ( FT_NEW( node ) ) @@ -3661,7 +3781,7 @@ /* allocate raster object if needed */ if ( clazz->glyph_format == FT_GLYPH_FORMAT_OUTLINE && - clazz->raster_class->raster_new ) + clazz->raster_class->raster_new ) { error = clazz->raster_class->raster_new( memory, &render->raster ); if ( error ) @@ -3702,7 +3822,8 @@ /* release raster object, if any */ - if ( render->raster ) + if ( render->clazz->glyph_format == FT_GLYPH_FORMAT_OUTLINE && + render->raster ) render->clazz->raster_class->raster_done( render->raster ); /* remove from list */ @@ -3842,7 +3963,7 @@ FT_Library library; - if ( !slot ) + if ( !slot || !slot->face ) return FT_Err_Invalid_Argument; library = FT_FACE_LIBRARY( slot->face ); @@ -4029,7 +4150,8 @@ FT_Renderer renderer = FT_RENDERER( module ); - if ( renderer->raster ) + if ( renderer->clazz->glyph_format == FT_GLYPH_FORMAT_OUTLINE && + renderer->raster ) renderer->clazz->raster_class->raster_done( renderer->raster ); } @@ -4182,13 +4304,24 @@ /*************************************************************************/ + /* documentation is in ftmodapi.h */ + + FT_EXPORT_DEF( FT_Error ) + FT_Reference_Library( FT_Library library ) + { + library->refcount++; + + return FT_Err_Ok; + } + + /* documentation is in ftmodapi.h */ FT_EXPORT_DEF( FT_Error ) FT_New_Library( FT_Memory memory, FT_Library *alibrary ) { - FT_Library library = 0; + FT_Library library = NULL; FT_Error error; @@ -4224,6 +4357,8 @@ library->version_minor = FREETYPE_MINOR; library->version_patch = FREETYPE_PATCH; + library->refcount = 1; + /* That's ok now */ *alibrary = library; @@ -4280,40 +4415,64 @@ if ( !library ) return FT_Err_Invalid_Library_Handle; + library->refcount--; + if ( library->refcount > 0 ) + goto Exit; + memory = library->memory; /* Discard client-data */ if ( library->generic.finalizer ) library->generic.finalizer( library ); - /* Close all faces in the library. If we don't do - * this, we can have some subtle memory leaks. + /* + * Close all faces in the library. If we don't do this, we can have + * some subtle memory leaks. + * * Example: * * - the cff font driver uses the pshinter module in cff_size_done * - if the pshinter module is destroyed before the cff font driver, * opened FT_Face objects managed by the driver are not properly * destroyed, resulting in a memory leak + * + * Some faces are dependent on other faces, like Type42 faces that + * depend on TrueType faces synthesized internally. + * + * The order of drivers should be specified in driver_name[]. */ { - FT_UInt n; + FT_UInt m, n; + const char* driver_name[] = { "type42", NULL }; - for ( n = 0; n < library->num_modules; n++ ) + for ( m = 0; + m < sizeof ( driver_name ) / sizeof ( driver_name[0] ); + m++ ) { - FT_Module module = library->modules[n]; - FT_List faces; - - - if ( ( module->clazz->module_flags & FT_MODULE_FONT_DRIVER ) == 0 ) - continue; - - faces = &FT_DRIVER(module)->faces_list; - while ( faces->head ) + for ( n = 0; n < library->num_modules; n++ ) { - FT_Done_Face( FT_FACE( faces->head->data ) ); - if ( faces->head ) - FT_TRACE0(( "FT_Done_Library: failed to free some faces\n" )); + FT_Module module = library->modules[n]; + const char* module_name = module->clazz->module_name; + FT_List faces; + + + if ( driver_name[m] && + ft_strcmp( module_name, driver_name[m] ) != 0 ) + continue; + + if ( ( module->clazz->module_flags & FT_MODULE_FONT_DRIVER ) == 0 ) + continue; + + FT_TRACE7(( "FT_Done_Library: close faces for %s\n", module_name )); + + faces = &FT_DRIVER( module )->faces_list; + while ( faces->head ) + { + FT_Done_Face( FT_FACE( faces->head->data ) ); + if ( faces->head ) + FT_TRACE0(( "FT_Done_Library: failed to free some faces\n" )); + } } } } @@ -4355,6 +4514,8 @@ #endif FT_FREE( library ); + + Exit: return FT_Err_Ok; } @@ -4467,6 +4628,8 @@ #endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ + /* documentation is in freetype.h */ + FT_EXPORT_DEF( FT_Error ) FT_Get_SubGlyph_Info( FT_GlyphSlot glyph, FT_UInt sub_index, @@ -4479,7 +4642,8 @@ FT_Error error = FT_Err_Invalid_Argument; - if ( glyph != NULL && + if ( glyph && + glyph->subglyphs && glyph->format == FT_GLYPH_FORMAT_COMPOSITE && sub_index < glyph->num_subglyphs ) { diff --git a/lib/3rdparty/freetype/src/base/ftotval.c b/lib/3rdparty/freetype/src/base/ftotval.c index 20ed686eee6..694fd2b87a0 100644 --- a/lib/3rdparty/freetype/src/base/ftotval.c +++ b/lib/3rdparty/freetype/src/base/ftotval.c @@ -4,7 +4,7 @@ /* */ /* FreeType API for validating OpenType tables (body). */ /* */ -/* Copyright 2004, 2006, 2008 by */ +/* Copyright 2004, 2006, 2008, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -74,9 +74,14 @@ FT_OpenType_Free( FT_Face face, FT_Bytes table ) { - FT_Memory memory = FT_FACE_MEMORY( face ); + FT_Memory memory; + if ( !face ) + return; + + memory = FT_FACE_MEMORY( face ); + FT_FREE( table ); } diff --git a/lib/3rdparty/freetype/src/base/ftoutln.c b/lib/3rdparty/freetype/src/base/ftoutln.c index b69df84c04c..356b1561161 100644 --- a/lib/3rdparty/freetype/src/base/ftoutln.c +++ b/lib/3rdparty/freetype/src/base/ftoutln.c @@ -990,7 +990,8 @@ int i; FT_Pos ray_y[3]; - FT_Orientation result[3]; + FT_Orientation result[3] = + { FT_ORIENTATION_NONE, FT_ORIENTATION_NONE, FT_ORIENTATION_NONE }; if ( !outline || outline->n_points <= 0 ) diff --git a/lib/3rdparty/freetype/src/base/ftpfr.c b/lib/3rdparty/freetype/src/base/ftpfr.c index f9592bb1bba..3a0f92d07ae 100644 --- a/lib/3rdparty/freetype/src/base/ftpfr.c +++ b/lib/3rdparty/freetype/src/base/ftpfr.c @@ -4,7 +4,7 @@ /* */ /* FreeType API for accessing PFR-specific data (body). */ /* */ -/* Copyright 2002, 2003, 2004, 2008 by */ +/* Copyright 2002, 2003, 2004, 2008, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -24,10 +24,11 @@ static FT_Service_PfrMetrics ft_pfr_check( FT_Face face ) { - FT_Service_PfrMetrics service; + FT_Service_PfrMetrics service = NULL; - FT_FACE_LOOKUP_SERVICE( face, service, PFR_METRICS ); + if ( face ) + FT_FACE_LOOKUP_SERVICE( face, service, PFR_METRICS ); return service; } diff --git a/lib/3rdparty/freetype/src/base/ftrfork.c b/lib/3rdparty/freetype/src/base/ftrfork.c index 133c2de0575..6df2def7750 100644 --- a/lib/3rdparty/freetype/src/base/ftrfork.c +++ b/lib/3rdparty/freetype/src/base/ftrfork.c @@ -4,7 +4,7 @@ /* */ /* Embedded resource forks accessor (body). */ /* */ -/* Copyright 2004, 2005, 2006, 2007, 2008, 2009 by */ +/* Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010 by */ /* Masatake YAMATO and Redhat K.K. */ /* */ /* FT_Raccess_Get_HeaderInfo() and raccess_guess_darwin_hfsplus() are */ @@ -349,6 +349,42 @@ const char *insertion ); + typedef enum FT_RFork_Rule_ { + FT_RFork_Rule_invalid = -2, + FT_RFork_Rule_uknown, /* -1 */ + FT_RFork_Rule_apple_double, + FT_RFork_Rule_apple_single, + FT_RFork_Rule_darwin_ufs_export, + FT_RFork_Rule_darwin_newvfs, + FT_RFork_Rule_darwin_hfsplus, + FT_RFork_Rule_vfat, + FT_RFork_Rule_linux_cap, + FT_RFork_Rule_linux_double, + FT_RFork_Rule_linux_netatalk + } FT_RFork_Rule; + + /* For fast translation between rule index and rule type, + * the macros FT_RFORK_xxx should be kept consistent with + * the raccess_guess_funcs table + */ + typedef struct raccess_guess_rec_ { + raccess_guess_func func; + FT_RFork_Rule type; + } raccess_guess_rec; + + static raccess_guess_rec raccess_guess_table[FT_RACCESS_N_RULES] = + { + { raccess_guess_apple_double, FT_RFork_Rule_apple_double, }, + { raccess_guess_apple_single, FT_RFork_Rule_apple_single, }, + { raccess_guess_darwin_ufs_export, FT_RFork_Rule_darwin_ufs_export, }, + { raccess_guess_darwin_newvfs, FT_RFork_Rule_darwin_newvfs, }, + { raccess_guess_darwin_hfsplus, FT_RFork_Rule_darwin_hfsplus, }, + { raccess_guess_vfat, FT_RFork_Rule_vfat, }, + { raccess_guess_linux_cap, FT_RFork_Rule_linux_cap, }, + { raccess_guess_linux_double, FT_RFork_Rule_linux_double, }, + { raccess_guess_linux_netatalk, FT_RFork_Rule_linux_netatalk, }, + }; + FT_BASE_DEF( void ) FT_Raccess_Guess( FT_Library library, FT_Stream stream, @@ -360,19 +396,6 @@ FT_Long i; - raccess_guess_func funcs[FT_RACCESS_N_RULES] = - { - raccess_guess_apple_double, - raccess_guess_apple_single, - raccess_guess_darwin_ufs_export, - raccess_guess_darwin_newvfs, - raccess_guess_darwin_hfsplus, - raccess_guess_vfat, - raccess_guess_linux_cap, - raccess_guess_linux_double, - raccess_guess_linux_netatalk, - }; - for ( i = 0; i < FT_RACCESS_N_RULES; i++ ) { new_names[i] = NULL; @@ -384,14 +407,41 @@ if ( errors[i] ) continue ; - errors[i] = (funcs[i])( library, stream, base_name, - &(new_names[i]), &(offsets[i]) ); + errors[i] = (raccess_guess_table[i].func)( library, + stream, base_name, + &(new_names[i]), + &(offsets[i]) ); } return; } + static FT_RFork_Rule + raccess_get_rule_type_from_rule_index( FT_UInt rule_index ) + { + if ( rule_index >= FT_RACCESS_N_RULES ) + return FT_RFork_Rule_invalid; + + return raccess_guess_table[rule_index].type; + } + + + FT_LOCAL_DEF( FT_Bool ) + raccess_rule_by_darwin_vfs( FT_UInt rule_index ) + { + switch( raccess_get_rule_type_from_rule_index( rule_index ) ) + { + case FT_RFork_Rule_darwin_newvfs: + case FT_RFork_Rule_darwin_hfsplus: + return TRUE; + + default: + return FALSE; + } + } + + static FT_Error raccess_guess_apple_double( FT_Library library, FT_Stream stream, @@ -751,7 +801,7 @@ const char *original_name, const char *insertion ) { - char* new_name; + char* new_name = NULL; const char* tmp; const char* slash; size_t new_length; diff --git a/lib/3rdparty/freetype/src/base/ftstream.c b/lib/3rdparty/freetype/src/base/ftstream.c index b638599dbcf..210aaa48348 100644 --- a/lib/3rdparty/freetype/src/base/ftstream.c +++ b/lib/3rdparty/freetype/src/base/ftstream.c @@ -4,7 +4,7 @@ /* */ /* I/O stream support (body). */ /* */ -/* Copyright 2000-2001, 2002, 2004, 2005, 2006, 2008, 2009 by */ +/* Copyright 2000-2001, 2002, 2004, 2005, 2006, 2008, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -246,6 +246,18 @@ /* allocate the frame in memory */ FT_Memory memory = stream->memory; + + /* simple sanity check */ + if ( count > stream->size ) + { + FT_ERROR(( "FT_Stream_EnterFrame:" + " frame size (%lu) larger than stream size (%lu)\n", + count, stream->size )); + + error = FT_Err_Invalid_Stream_Operation; + goto Exit; + } + #ifdef FT_DEBUG_MEMORY /* assume _ft_debug_file and _ft_debug_lineno are already set */ stream->base = (unsigned char*)ft_mem_qalloc( memory, count, &error ); @@ -275,7 +287,7 @@ { /* check current and new position */ if ( stream->pos >= stream->size || - stream->pos + count > stream->size ) + stream->size - stream->pos < count ) { FT_ERROR(( "FT_Stream_EnterFrame:" " invalid i/o; pos = 0x%lx, count = %lu, size = 0x%lx\n", diff --git a/lib/3rdparty/freetype/src/base/ftsynth.c b/lib/3rdparty/freetype/src/base/ftsynth.c index ba3c633e28e..d4ec0da570a 100644 --- a/lib/3rdparty/freetype/src/base/ftsynth.c +++ b/lib/3rdparty/freetype/src/base/ftsynth.c @@ -90,7 +90,7 @@ if ( slot->format != FT_GLYPH_FORMAT_OUTLINE && - slot->format != FT_GLYPH_FORMAT_BITMAP ) + slot->format != FT_GLYPH_FORMAT_BITMAP ) return; /* some reasonable strength */ @@ -108,7 +108,7 @@ xstr = xstr * 2; ystr = xstr; } - else if ( slot->format == FT_GLYPH_FORMAT_BITMAP ) + else /* slot->format == FT_GLYPH_FORMAT_BITMAP */ { /* round to full pixels */ xstr &= ~63; diff --git a/lib/3rdparty/freetype/src/base/ftsystem.c b/lib/3rdparty/freetype/src/base/ftsystem.c index 4d06d6db5cc..66c5d76a9d0 100644 --- a/lib/3rdparty/freetype/src/base/ftsystem.c +++ b/lib/3rdparty/freetype/src/base/ftsystem.c @@ -4,7 +4,7 @@ /* */ /* ANSI-specific FreeType low-level system interface (body). */ /* */ -/* Copyright 1996-2001, 2002, 2006, 2008, 2009 by */ +/* Copyright 1996-2001, 2002, 2006, 2008, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -192,7 +192,9 @@ /* count :: The number of bytes to read from the stream. */ /* */ /* */ - /* The number of bytes actually read. */ + /* The number of bytes actually read. If `count' is zero (this is, */ + /* the function is used for seeking), a non-zero return value */ + /* indicates an error. */ /* */ FT_CALLBACK_DEF( unsigned long ) ft_ansi_stream_io( FT_Stream stream, @@ -203,6 +205,9 @@ FT_FILE* file; + if ( !count && offset > stream->size ) + return 1; + file = STREAM_FILE( stream ); if ( stream->pos != offset ) @@ -224,6 +229,13 @@ if ( !stream ) return FT_Err_Invalid_Stream_Handle; + stream->descriptor.pointer = NULL; + stream->pathname.pointer = (char*)filepathname; + stream->base = 0; + stream->pos = 0; + stream->read = NULL; + stream->close = NULL; + file = ft_fopen( filepathname, "rb" ); if ( !file ) { @@ -235,12 +247,16 @@ ft_fseek( file, 0, SEEK_END ); stream->size = ft_ftell( file ); + if ( !stream->size ) + { + FT_ERROR(( "FT_Stream_Open:" )); + FT_ERROR(( " opened `%s' but zero-sized\n", filepathname )); + ft_fclose( file ); + return FT_Err_Cannot_Open_Stream; + } ft_fseek( file, 0, SEEK_SET ); stream->descriptor.pointer = file; - stream->pathname.pointer = (char*)filepathname; - stream->pos = 0; - stream->read = ft_ansi_stream_io; stream->close = ft_ansi_stream_close; diff --git a/lib/3rdparty/freetype/src/bdf/bdfdrivr.c b/lib/3rdparty/freetype/src/bdf/bdfdrivr.c index 631ec460e7c..47d0eae89fe 100644 --- a/lib/3rdparty/freetype/src/bdf/bdfdrivr.c +++ b/lib/3rdparty/freetype/src/bdf/bdfdrivr.c @@ -30,6 +30,7 @@ THE SOFTWARE. #include FT_INTERNAL_STREAM_H #include FT_INTERNAL_OBJECTS_H #include FT_BDF_H +#include FT_TRUETYPE_IDS_H #include FT_SERVICE_BDF_H #include FT_SERVICE_XFREE86_NAME_H @@ -540,14 +541,15 @@ THE SOFTWARE. charmap.face = FT_FACE( face ); charmap.encoding = FT_ENCODING_NONE; - charmap.platform_id = 0; - charmap.encoding_id = 0; + /* initial platform/encoding should indicate unset status? */ + charmap.platform_id = TT_PLATFORM_APPLE_UNICODE; + charmap.encoding_id = TT_APPLE_ID_DEFAULT; if ( unicode_charmap ) { charmap.encoding = FT_ENCODING_UNICODE; - charmap.platform_id = 3; - charmap.encoding_id = 1; + charmap.platform_id = TT_PLATFORM_MICROSOFT; + charmap.encoding_id = TT_MS_ID_UNICODE_CS; } error = FT_CMap_New( &bdf_cmap_class, NULL, &charmap, NULL ); @@ -571,8 +573,8 @@ THE SOFTWARE. charmap.face = FT_FACE( face ); charmap.encoding = FT_ENCODING_ADOBE_STANDARD; - charmap.platform_id = 7; - charmap.encoding_id = 0; + charmap.platform_id = TT_PLATFORM_ADOBE; + charmap.encoding_id = TT_ADOBE_ID_STANDARD; error = FT_CMap_New( &bdf_cmap_class, NULL, &charmap, NULL ); diff --git a/lib/3rdparty/freetype/src/bdf/bdflib.c b/lib/3rdparty/freetype/src/bdf/bdflib.c index 5fa5868c715..21b8d9d40e1 100644 --- a/lib/3rdparty/freetype/src/bdf/bdflib.c +++ b/lib/3rdparty/freetype/src/bdf/bdflib.c @@ -1,6 +1,6 @@ /* * Copyright 2000 Computing Research Labs, New Mexico State University - * Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 + * Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 * Francesco Zappa Nardelli * * Permission is hereby granted, free of charge, to any person obtaining a @@ -470,6 +470,11 @@ } + /* An empty string for empty fields. */ + + static const char empty[1] = { 0 }; /* XXX eliminate this */ + + static char * _bdf_list_join( _bdf_list_t* list, int c, @@ -494,18 +499,14 @@ if ( i + 1 < list->used ) dp[j++] = (char)c; } - dp[j] = 0; + if ( dp != empty ) + dp[j] = 0; *alen = j; return dp; } - /* An empty string for empty fields. */ - - static const char empty[1] = { 0 }; /* XXX eliminate this */ - - static FT_Error _bdf_list_split( _bdf_list_t* list, char* separators, @@ -648,8 +649,9 @@ { if ( refill ) { - bytes = (ptrdiff_t)FT_Stream_TryRead( stream, (FT_Byte*)buf + cursor, - (FT_ULong)(buf_size - cursor) ); + bytes = (ptrdiff_t)FT_Stream_TryRead( + stream, (FT_Byte*)buf + cursor, + (FT_ULong)( buf_size - cursor ) ); avail = cursor + bytes; cursor = 0; refill = 0; @@ -719,6 +721,10 @@ { error = (*cb)( buf + start, end - start, lineno, (void*)&cb, client_data ); + /* Redo if we have encountered CHARS without properties. */ + if ( error == -1 ) + error = (*cb)( buf + start, end - start, lineno, + (void*)&cb, client_data ); if ( error ) break; } @@ -1371,7 +1377,8 @@ /* If the property happens to be a comment, then it doesn't need */ /* to be added to the internal hash table. */ - if ( ft_memcmp( name, "COMMENT", 7 ) != 0 ) { + if ( ft_memcmp( name, "COMMENT", 7 ) != 0 ) + { /* Add the property to the font property table. */ error = hash_insert( fp->name, font->props_used, @@ -1867,6 +1874,9 @@ error = BDF_Err_Invalid_File_Format; Exit: + if ( error && ( p->flags & _BDF_GLYPH ) ) + FT_FREE( p->glyph_name ); + return error; } @@ -2077,6 +2087,14 @@ /* Check for the start of the properties. */ if ( ft_memcmp( line, "STARTPROPERTIES", 15 ) == 0 ) { + if ( !( p->flags & _BDF_FONT_BBX ) ) + { + /* Missing the FONTBOUNDINGBOX field. */ + FT_ERROR(( "_bdf_parse_start: " ERRMSG1, lineno, "FONTBOUNDINGBOX" )); + error = BDF_Err_Missing_Fontboundingbox_Field; + goto Exit; + } + error = _bdf_list_split( &p->list, (char *)" +", line, linelen ); if ( error ) goto Exit; @@ -2095,7 +2113,7 @@ /* Check for the FONTBOUNDINGBOX field. */ if ( ft_memcmp( line, "FONTBOUNDINGBOX", 15 ) == 0 ) { - if ( !(p->flags & _BDF_SIZE ) ) + if ( !( p->flags & _BDF_SIZE ) ) { /* Missing the SIZE field. */ FT_ERROR(( "_bdf_parse_start: " ERRMSG1, lineno, "SIZE" )); @@ -2139,6 +2157,9 @@ goto Exit; } + /* Allowing multiple `FONT' lines (which is invalid) doesn't hurt... */ + FT_FREE( p->font->name ); + if ( FT_NEW_ARRAY( p->font->name, slen + 1 ) ) goto Exit; FT_MEM_COPY( p->font->name, s, slen + 1 ); @@ -2208,6 +2229,45 @@ goto Exit; } + /* Check for the CHARS field -- font properties are optional */ + if ( ft_memcmp( line, "CHARS", 5 ) == 0 ) + { + char nbuf[128]; + + + if ( !( p->flags & _BDF_FONT_BBX ) ) + { + /* Missing the FONTBOUNDINGBOX field. */ + FT_ERROR(( "_bdf_parse_start: " ERRMSG1, lineno, "FONTBOUNDINGBOX" )); + error = BDF_Err_Missing_Fontboundingbox_Field; + goto Exit; + } + + /* Add the two standard X11 properties which are required */ + /* for compiling fonts. */ + p->font->font_ascent = p->font->bbx.ascent; + ft_sprintf( nbuf, "%hd", p->font->bbx.ascent ); + error = _bdf_add_property( p->font, (char *)"FONT_ASCENT", nbuf ); + if ( error ) + goto Exit; + FT_TRACE2(( "_bdf_parse_properties: " ACMSG1, p->font->bbx.ascent )); + + p->font->font_descent = p->font->bbx.descent; + ft_sprintf( nbuf, "%hd", p->font->bbx.descent ); + error = _bdf_add_property( p->font, (char *)"FONT_DESCENT", nbuf ); + if ( error ) + goto Exit; + FT_TRACE2(( "_bdf_parse_properties: " ACMSG2, p->font->bbx.descent )); + + p->font->modified = 1; + + *next = _bdf_parse_glyphs; + + /* A special return value. */ + error = -1; + goto Exit; + } + error = BDF_Err_Invalid_File_Format; Exit: @@ -2229,7 +2289,7 @@ bdf_font_t* *font ) { unsigned long lineno = 0; /* make compiler happy */ - _bdf_parse_t *p; + _bdf_parse_t *p = NULL; FT_Memory memory = extmemory; FT_Error error = BDF_Err_Ok; @@ -2344,7 +2404,8 @@ /* Make sure the comments are NULL terminated if they exist. */ memory = p->font->memory; - if ( p->font->comments_len > 0 ) { + if ( p->font->comments_len > 0 ) + { if ( FT_RENEW_ARRAY( p->font->comments, p->font->comments_len, p->font->comments_len + 1 ) ) @@ -2448,8 +2509,8 @@ hash_free( &(font->proptbl), memory ); /* Free up the user defined properties. */ - for (prop = font->user_props, i = 0; - i < font->nuser_props; i++, prop++ ) + for ( prop = font->user_props, i = 0; + i < font->nuser_props; i++, prop++ ) { FT_FREE( prop->name ); if ( prop->format == BDF_ATOM ) diff --git a/lib/3rdparty/freetype/src/cache/ftcbasic.c b/lib/3rdparty/freetype/src/cache/ftcbasic.c index ebc8871ccc0..609ff78e564 100644 --- a/lib/3rdparty/freetype/src/cache/ftcbasic.c +++ b/lib/3rdparty/freetype/src/cache/ftcbasic.c @@ -4,7 +4,7 @@ /* */ /* The FreeType basic cache interface (body). */ /* */ -/* Copyright 2003, 2004, 2005, 2006, 2007, 2009 by */ +/* Copyright 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -318,7 +318,7 @@ FTC_BasicQueryRec query; FTC_Node node = 0; /* make compiler happy */ FT_Error error; - FT_UInt32 hash; + FT_PtrDist hash; /* some argument checks are delayed to FTC_Cache_Lookup */ @@ -414,7 +414,7 @@ FTC_BasicQueryRec query; FTC_Node node = 0; /* make compiler happy */ FT_Error error; - FT_UInt32 hash; + FT_PtrDist hash; /* some argument checks are delayed to FTC_Cache_Lookup */ @@ -656,7 +656,7 @@ FT_Error error; FTC_BasicQueryRec query; FTC_Node node = 0; /* make compiler happy */ - FT_UInt32 hash; + FT_PtrDist hash; if ( anode ) @@ -753,7 +753,7 @@ FT_Error error; FTC_BasicQueryRec query; FTC_Node node = 0; /* make compiler happy */ - FT_UInt32 hash; + FT_PtrDist hash; if ( anode ) @@ -834,7 +834,7 @@ if ( !desc ) - return FT_Err_Invalid_Argument; + return FTC_Err_Invalid_Argument; ftc_image_type_from_old_desc( &type0, desc ); diff --git a/lib/3rdparty/freetype/src/cache/ftccache.c b/lib/3rdparty/freetype/src/cache/ftccache.c index 463addd99be..a5a915e0894 100644 --- a/lib/3rdparty/freetype/src/cache/ftccache.c +++ b/lib/3rdparty/freetype/src/cache/ftccache.c @@ -4,7 +4,7 @@ /* */ /* The FreeType internal cache interface (body). */ /* */ -/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 by */ +/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -346,7 +346,7 @@ static void FTC_Cache_Clear( FTC_Cache cache ) { - if ( cache ) + if ( cache && cache->buckets ) { FTC_Manager manager = cache->manager; FT_UFast i; @@ -410,7 +410,7 @@ static void ftc_cache_add( FTC_Cache cache, - FT_UInt32 hash, + FT_PtrDist hash, FTC_Node node ) { node->hash = hash; @@ -438,7 +438,7 @@ FT_LOCAL_DEF( FT_Error ) FTC_Cache_NewNode( FTC_Cache cache, - FT_UInt32 hash, + FT_PtrDist hash, FT_Pointer query, FTC_Node *anode ) { @@ -477,7 +477,7 @@ FT_LOCAL_DEF( FT_Error ) FTC_Cache_Lookup( FTC_Cache cache, - FT_UInt32 hash, + FT_PtrDist hash, FT_Pointer query, FTC_Node *anode ) { @@ -485,13 +485,13 @@ FTC_Node* bucket; FTC_Node* pnode; FTC_Node node; - FT_Error error = 0; + FT_Error error = FTC_Err_Ok; FTC_Node_CompareFunc compare = cache->clazz.node_compare; if ( cache == NULL || anode == NULL ) - return FT_Err_Invalid_Argument; + return FTC_Err_Invalid_Argument; idx = hash & cache->mask; if ( idx < cache->p ) diff --git a/lib/3rdparty/freetype/src/cache/ftccache.h b/lib/3rdparty/freetype/src/cache/ftccache.h index 2082bc4f4f0..10830a9f8a4 100644 --- a/lib/3rdparty/freetype/src/cache/ftccache.h +++ b/lib/3rdparty/freetype/src/cache/ftccache.h @@ -4,7 +4,7 @@ /* */ /* FreeType internal cache interface (specification). */ /* */ -/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 by */ +/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -24,6 +24,9 @@ FT_BEGIN_HEADER +#define _FTC_FACE_ID_HASH( i ) \ + ((FT_PtrDist)(( (FT_PtrDist)(i) >> 3 ) ^ ( (FT_PtrDist)(i) << 7 ))) + /* handle to cache object */ typedef struct FTC_CacheRec_* FTC_Cache; @@ -56,7 +59,7 @@ FT_BEGIN_HEADER { FTC_MruNodeRec mru; /* circular mru list pointer */ FTC_Node link; /* used for hashing */ - FT_UInt32 hash; /* used for hashing too */ + FT_PtrDist hash; /* used for hashing too */ FT_UShort cache_index; /* index of cache the node belongs to */ FT_Short ref_count; /* reference count for this node */ @@ -168,14 +171,14 @@ FT_BEGIN_HEADER #ifndef FTC_INLINE FT_LOCAL( FT_Error ) FTC_Cache_Lookup( FTC_Cache cache, - FT_UInt32 hash, + FT_PtrDist hash, FT_Pointer query, FTC_Node *anode ); #endif FT_LOCAL( FT_Error ) FTC_Cache_NewNode( FTC_Cache cache, - FT_UInt32 hash, + FT_PtrDist hash, FT_Pointer query, FTC_Node *anode ); @@ -200,12 +203,12 @@ FT_BEGIN_HEADER FT_BEGIN_STMNT \ FTC_Node *_bucket, *_pnode, _node; \ FTC_Cache _cache = FTC_CACHE(cache); \ - FT_UInt32 _hash = (FT_UInt32)(hash); \ + FT_PtrDist _hash = (FT_PtrDist)(hash); \ FTC_Node_CompareFunc _nodcomp = (FTC_Node_CompareFunc)(nodecmp); \ FT_UFast _idx; \ \ \ - error = 0; \ + error = FTC_Err_Ok; \ node = NULL; \ _idx = _hash & _cache->mask; \ if ( _idx < _cache->p ) \ @@ -288,7 +291,7 @@ FT_BEGIN_HEADER #define FTC_CACHE_TRYLOOP_END() \ - if ( !error || error != FT_Err_Out_Of_Memory ) \ + if ( !error || error != FTC_Err_Out_Of_Memory ) \ break; \ \ _try_done = FTC_Manager_FlushN( _try_manager, _try_count ); \ diff --git a/lib/3rdparty/freetype/src/cache/ftccmap.c b/lib/3rdparty/freetype/src/cache/ftccmap.c index a802b0557c7..15060baf76a 100644 --- a/lib/3rdparty/freetype/src/cache/ftccmap.c +++ b/lib/3rdparty/freetype/src/cache/ftccmap.c @@ -4,7 +4,8 @@ /* */ /* FreeType CharMap cache (body) */ /* */ -/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ +/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */ +/* 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -86,7 +87,7 @@ /* compute a query/node hash */ #define FTC_CMAP_HASH( faceid, index, charcode ) \ - ( FTC_FACE_ID_HASH( faceid ) + 211 * (index) + \ + ( _FTC_FACE_ID_HASH( faceid ) + 211 * (index) + \ ( (charcode) / FTC_CMAP_INDICES_MAX ) ) /* the charmap query */ @@ -153,7 +154,7 @@ FTC_CMapQuery query = (FTC_CMapQuery)ftcquery; FT_Error error; FT_Memory memory = cache->memory; - FTC_CMapNode node; + FTC_CMapNode node = NULL; FT_UInt nn; @@ -286,7 +287,7 @@ FTC_Node node; FT_Error error; FT_UInt gindex = 0; - FT_UInt32 hash; + FT_PtrDist hash; FT_Int no_cmap_change = 0; @@ -310,19 +311,11 @@ #ifdef FT_CONFIG_OPTION_OLD_INTERNALS /* - * Detect a call from a rogue client that thinks it is linking - * to FreeType 2.1.7. This is possible because the third parameter - * is then a character code, and we have never seen any font with - * more than a few charmaps, so if the index is very large... - * - * It is also very unlikely that a rogue client is interested - * in Unicode values 0 to 15. - * - * NOTE: The original threshold was 4, but we found a font from the - * Adobe Acrobat Reader Pack, named `KozMinProVI-Regular.otf', - * which contains more than 5 charmaps. + * If cmap_index is greater than the maximum number of cachable + * charmaps, we assume the request is from a legacy rogue client + * using old internal header. See include/config/ftoption.h. */ - if ( cmap_index >= 16 && !no_cmap_change ) + if ( cmap_index > FT_MAX_CHARMAP_CACHEABLE && !no_cmap_change ) { FTC_OldCMapDesc desc = (FTC_OldCMapDesc) face_id; @@ -384,7 +377,7 @@ /* something rotten can happen with rogue clients */ if ( (FT_UInt)( char_code - FTC_CMAP_NODE( node )->first >= FTC_CMAP_INDICES_MAX ) ) - return 0; + return 0; /* XXX: should return appropriate error */ gindex = FTC_CMAP_NODE( node )->indices[char_code - FTC_CMAP_NODE( node )->first]; @@ -401,6 +394,12 @@ if ( error ) goto Exit; +#ifdef FT_MAX_CHARMAP_CACHEABLE + /* something rotten can happen with rogue clients */ + if ( cmap_index > FT_MAX_CHARMAP_CACHEABLE ) + return 0; /* XXX: should return appropriate error */ +#endif + if ( (FT_UInt)cmap_index < (FT_UInt)face->num_charmaps ) { FT_CharMap old, cmap = NULL; diff --git a/lib/3rdparty/freetype/src/cache/ftcglyph.c b/lib/3rdparty/freetype/src/cache/ftcglyph.c index a9ab0c319f7..a73e2431e66 100644 --- a/lib/3rdparty/freetype/src/cache/ftcglyph.c +++ b/lib/3rdparty/freetype/src/cache/ftcglyph.c @@ -175,7 +175,7 @@ FT_LOCAL_DEF( FT_Error ) FTC_GCache_Lookup( FTC_GCache cache, - FT_UInt32 hash, + FT_PtrDist hash, FT_UInt gindex, FTC_GQuery query, FTC_Node *anode ) diff --git a/lib/3rdparty/freetype/src/cache/ftcglyph.h b/lib/3rdparty/freetype/src/cache/ftcglyph.h index c18f9c3af31..2bc5624c6c5 100644 --- a/lib/3rdparty/freetype/src/cache/ftcglyph.h +++ b/lib/3rdparty/freetype/src/cache/ftcglyph.h @@ -254,7 +254,7 @@ FT_BEGIN_HEADER #ifndef FTC_INLINE FT_LOCAL( FT_Error ) FTC_GCache_Lookup( FTC_GCache cache, - FT_UInt32 hash, + FT_PtrDist hash, FT_UInt gindex, FTC_GQuery query, FTC_Node *anode ); diff --git a/lib/3rdparty/freetype/src/cache/ftcimage.c b/lib/3rdparty/freetype/src/cache/ftcimage.c index 417daf2aaea..c242ece021e 100644 --- a/lib/3rdparty/freetype/src/cache/ftcimage.c +++ b/lib/3rdparty/freetype/src/cache/ftcimage.c @@ -4,7 +4,7 @@ /* */ /* FreeType Image cache (body). */ /* */ -/* Copyright 2000-2001, 2003, 2004, 2006 by */ +/* Copyright 2000-2001, 2003, 2004, 2006, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -61,7 +61,7 @@ { FT_Memory memory = cache->memory; FT_Error error; - FTC_INode inode; + FTC_INode inode = NULL; if ( !FT_NEW( inode ) ) diff --git a/lib/3rdparty/freetype/src/cache/ftcmanag.c b/lib/3rdparty/freetype/src/cache/ftcmanag.c index f2a298e7d90..548ebe951fd 100644 --- a/lib/3rdparty/freetype/src/cache/ftcmanag.c +++ b/lib/3rdparty/freetype/src/cache/ftcmanag.c @@ -4,7 +4,7 @@ /* */ /* FreeType Cache Manager (body). */ /* */ -/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009 by */ +/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -670,7 +670,7 @@ * the face_id as well */ FTC_MruList_RemoveSelection( &manager->faces, - (FTC_MruNode_CompareFunc)NULL, + ftc_face_node_compare, face_id ); for ( nn = 0; nn < manager->num_caches; nn++ ) diff --git a/lib/3rdparty/freetype/src/cache/ftcmanag.h b/lib/3rdparty/freetype/src/cache/ftcmanag.h index 3fdc2c773b4..13f26bb108a 100644 --- a/lib/3rdparty/freetype/src/cache/ftcmanag.h +++ b/lib/3rdparty/freetype/src/cache/ftcmanag.h @@ -161,7 +161,7 @@ FT_BEGIN_HEADER (a)->y_res == (b)->y_res ) ) ) #define FTC_SCALER_HASH( q ) \ - ( FTC_FACE_ID_HASH( (q)->face_id ) + \ + ( _FTC_FACE_ID_HASH( (q)->face_id ) + \ (q)->width + (q)->height*7 + \ ( (q)->pixel ? 0 : ( (q)->x_res*33 ^ (q)->y_res*61 ) ) ) diff --git a/lib/3rdparty/freetype/src/cache/ftcmru.h b/lib/3rdparty/freetype/src/cache/ftcmru.h index 5739439f450..8c3797fb055 100644 --- a/lib/3rdparty/freetype/src/cache/ftcmru.h +++ b/lib/3rdparty/freetype/src/cache/ftcmru.h @@ -4,7 +4,7 @@ /* */ /* Simple MRU list-cache (specification). */ /* */ -/* Copyright 2000-2001, 2003, 2004, 2005, 2006 by */ +/* Copyright 2000-2001, 2003, 2004, 2005, 2006, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -166,7 +166,7 @@ FT_BEGIN_HEADER FTC_MruNode _first, _node; \ \ \ - error = 0; \ + error = FTC_Err_Ok; \ _first = *(_pfirst); \ _node = NULL; \ \ diff --git a/lib/3rdparty/freetype/src/cache/ftcsbits.c b/lib/3rdparty/freetype/src/cache/ftcsbits.c index 60d46aa7a06..83245af1e24 100644 --- a/lib/3rdparty/freetype/src/cache/ftcsbits.c +++ b/lib/3rdparty/freetype/src/cache/ftcsbits.c @@ -4,7 +4,7 @@ /* */ /* FreeType sbits manager (body). */ /* */ -/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2009 by */ +/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -160,7 +160,11 @@ !CHECK_CHAR( slot->bitmap_top ) || !CHECK_CHAR( xadvance ) || !CHECK_CHAR( yadvance ) ) + { + FT_TRACE2(( "ftc_snode_load:" + " glyph too large for small bitmap cache\n")); goto BadGlyph; + } sbit->width = (FT_Byte)bitmap->width; sbit->height = (FT_Byte)bitmap->rows; @@ -191,7 +195,7 @@ sbit->width = 255; sbit->height = 0; sbit->buffer = NULL; - error = 0; + error = FTC_Err_Ok; if ( asize ) *asize = 0; } @@ -218,7 +222,7 @@ total = clazz->family_get_count( family, cache->manager ); if ( total == 0 || gindex >= total ) { - error = FT_Err_Invalid_Argument; + error = FTC_Err_Invalid_Argument; goto Exit; } diff --git a/lib/3rdparty/freetype/src/cff/cffcmap.c b/lib/3rdparty/freetype/src/cff/cffcmap.c index 46d603e3a89..1298371105d 100644 --- a/lib/3rdparty/freetype/src/cff/cffcmap.c +++ b/lib/3rdparty/freetype/src/cff/cffcmap.c @@ -4,7 +4,7 @@ /* */ /* CFF character mapping table (cmap) support (body). */ /* */ -/* Copyright 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -120,27 +120,15 @@ /*************************************************************************/ FT_CALLBACK_DEF( const char* ) - cff_sid_to_glyph_name( TT_Face face, - FT_UInt idx ) + cff_sid_to_glyph_name( TT_Face face, + FT_UInt idx ) { - CFF_Font cff = (CFF_Font)face->extra.data; - CFF_Charset charset = &cff->charset; - FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)cff->psnames; - FT_UInt sid = charset->sids[idx]; + CFF_Font cff = (CFF_Font)face->extra.data; + CFF_Charset charset = &cff->charset; + FT_UInt sid = charset->sids[idx]; - return cff_index_get_sid_string( &cff->string_index, sid, psnames ); - } - - - FT_CALLBACK_DEF( void ) - cff_sid_free_glyph_name( TT_Face face, - const char* gname ) - { - FT_Memory memory = FT_FACE_MEMORY( face ); - - - FT_FREE( gname ); + return cff_index_get_sid_string( cff, sid ); } @@ -155,14 +143,15 @@ /* can't build Unicode map for CID-keyed font */ + /* because we don't know glyph names. */ if ( !charset->sids ) - return CFF_Err_Invalid_Argument; + return CFF_Err_No_Unicode_Glyph_Name; return psnames->unicodes_init( memory, unicodes, cff->num_glyphs, (PS_GetGlyphNameFunc)&cff_sid_to_glyph_name, - (PS_FreeGlyphNameFunc)&cff_sid_free_glyph_name, + (PS_FreeGlyphNameFunc)NULL, (FT_Pointer)face ); } diff --git a/lib/3rdparty/freetype/src/cff/cffdrivr.c b/lib/3rdparty/freetype/src/cff/cffdrivr.c index dad0b65d8b1..39f04ee1be9 100644 --- a/lib/3rdparty/freetype/src/cff/cffdrivr.c +++ b/lib/3rdparty/freetype/src/cff/cffdrivr.c @@ -4,7 +4,8 @@ /* */ /* OpenType font driver implementation (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */ +/* 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -22,7 +23,6 @@ #include FT_INTERNAL_STREAM_H #include FT_INTERNAL_SFNT_H #include FT_SERVICE_CID_H -#include FT_SERVICE_POSTSCRIPT_CMAPS_H #include FT_SERVICE_POSTSCRIPT_INFO_H #include FT_SERVICE_POSTSCRIPT_NAME_H #include FT_SERVICE_TT_CMAP_H @@ -228,16 +228,13 @@ FT_Pointer buffer, FT_UInt buffer_max ) { - CFF_Font font = (CFF_Font)face->extra.data; - FT_Memory memory = FT_FACE_MEMORY( face ); - FT_String* gname; - FT_UShort sid; - FT_Service_PsCMaps psnames; - FT_Error error; + CFF_Font font = (CFF_Font)face->extra.data; + FT_String* gname; + FT_UShort sid; + FT_Error error; - FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS ); - if ( !psnames ) + if ( !font->psnames ) { FT_ERROR(( "cff_get_glyph_name:" " cannot get glyph name from CFF & CEF fonts\n" @@ -251,12 +248,11 @@ sid = font->charset.sids[glyph_index]; /* now, lookup the name itself */ - gname = cff_index_get_sid_string( &font->string_index, sid, psnames ); + gname = cff_index_get_sid_string( font, sid ); if ( gname ) FT_STRCPYN( buffer, gname, buffer_max ); - FT_FREE( gname ); error = CFF_Err_Ok; Exit: @@ -271,11 +267,9 @@ CFF_Font cff; CFF_Charset charset; FT_Service_PsCMaps psnames; - FT_Memory memory = FT_FACE_MEMORY( face ); FT_String* name; FT_UShort sid; FT_UInt i; - FT_Int result; cff = (CFF_FontRec *)face->extra.data; @@ -290,19 +284,14 @@ sid = charset->sids[i]; if ( sid > 390 ) - name = cff_index_get_name( &cff->string_index, sid - 391 ); + name = cff_index_get_string( cff, sid - 391 ); else name = (FT_String *)psnames->adobe_std_strings( sid ); if ( !name ) continue; - result = ft_strcmp( glyph_name, name ); - - if ( sid > 390 ) - FT_FREE( name ); - - if ( !result ) + if ( !ft_strcmp( glyph_name, name ) ) return i; } @@ -333,35 +322,29 @@ PS_FontInfoRec* afont_info ) { CFF_Font cff = (CFF_Font)face->extra.data; - FT_Error error = FT_Err_Ok; + FT_Error error = CFF_Err_Ok; if ( cff && cff->font_info == NULL ) { - CFF_FontRecDict dict = &cff->top_font.font_dict; - PS_FontInfoRec *font_info; - FT_Memory memory = face->root.memory; - FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)cff->psnames; + CFF_FontRecDict dict = &cff->top_font.font_dict; + PS_FontInfoRec *font_info; + FT_Memory memory = face->root.memory; if ( FT_ALLOC( font_info, sizeof ( *font_info ) ) ) goto Fail; - font_info->version = cff_index_get_sid_string( &cff->string_index, - dict->version, - psnames ); - font_info->notice = cff_index_get_sid_string( &cff->string_index, - dict->notice, - psnames ); - font_info->full_name = cff_index_get_sid_string( &cff->string_index, - dict->full_name, - psnames ); - font_info->family_name = cff_index_get_sid_string( &cff->string_index, - dict->family_name, - psnames ); - font_info->weight = cff_index_get_sid_string( &cff->string_index, - dict->weight, - psnames ); + font_info->version = cff_index_get_sid_string( cff, + dict->version ); + font_info->notice = cff_index_get_sid_string( cff, + dict->notice ); + font_info->full_name = cff_index_get_sid_string( cff, + dict->full_name ); + font_info->family_name = cff_index_get_sid_string( cff, + dict->family_name ); + font_info->weight = cff_index_get_sid_string( cff, + dict->weight ); font_info->italic_angle = dict->italic_angle; font_info->is_fixed_pitch = dict->is_fixed_pitch; font_info->underline_position = (FT_Short)dict->underline_position; @@ -467,8 +450,7 @@ if ( cff ) { - CFF_FontRecDict dict = &cff->top_font.font_dict; - FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)cff->psnames; + CFF_FontRecDict dict = &cff->top_font.font_dict; if ( dict->cid_registry == 0xFFFFU ) @@ -480,18 +462,16 @@ if ( registry ) { if ( cff->registry == NULL ) - cff->registry = cff_index_get_sid_string( &cff->string_index, - dict->cid_registry, - psnames ); + cff->registry = cff_index_get_sid_string( cff, + dict->cid_registry ); *registry = cff->registry; } if ( ordering ) { if ( cff->ordering == NULL ) - cff->ordering = cff_index_get_sid_string( &cff->string_index, - dict->cid_ordering, - psnames ); + cff->ordering = cff_index_get_sid_string( cff, + dict->cid_ordering ); *ordering = cff->ordering; } diff --git a/lib/3rdparty/freetype/src/cff/cffgload.c b/lib/3rdparty/freetype/src/cff/cffgload.c index 9330c058823..e99ee706e38 100644 --- a/lib/3rdparty/freetype/src/cff/cffgload.c +++ b/lib/3rdparty/freetype/src/cff/cffgload.c @@ -22,7 +22,6 @@ #include FT_INTERNAL_STREAM_H #include FT_INTERNAL_SFNT_H #include FT_OUTLINE_H -#include FT_INTERNAL_POSTSCRIPT_HINTS_H #include "cffobjs.h" #include "cffload.h" @@ -394,7 +393,7 @@ /* initialize Type2 decoder */ decoder->cff = cff; - decoder->num_globals = cff->num_global_subrs; + decoder->num_globals = cff->global_subrs_index.count; decoder->globals = cff->global_subrs; decoder->globals_bias = cff_compute_bias( cff->top_font.font_dict.charstring_type, @@ -430,7 +429,7 @@ goto Exit; } - FT_TRACE4(( "glyph index %d (subfont %d):\n", glyph_index, fd_index )); + FT_TRACE3(( "glyph index %d (subfont %d):\n", glyph_index, fd_index )); sub = cff->subfonts[fd_index]; @@ -445,10 +444,10 @@ } #ifdef FT_DEBUG_LEVEL_TRACE else - FT_TRACE4(( "glyph index %d:\n", glyph_index )); + FT_TRACE3(( "glyph index %d:\n", glyph_index )); #endif - decoder->num_locals = sub->num_local_subrs; + decoder->num_locals = sub->local_subrs_index.count; decoder->locals = sub->local_subrs; decoder->locals_bias = cff_compute_bias( decoder->cff->top_font.font_dict.charstring_type, @@ -812,10 +811,10 @@ charstring_len ); decoder->seac = FALSE; + cff_free_glyph_data( face, &charstring, charstring_len ); + if ( error ) goto Exit; - - cff_free_glyph_data( face, &charstring, charstring_len ); } /* Save the left bearing, advance and glyph width of the base */ @@ -842,10 +841,10 @@ charstring_len ); decoder->seac = FALSE; + cff_free_glyph_data( face, &charstring, charstring_len ); + if ( error ) goto Exit; - - cff_free_glyph_data( face, &charstring, charstring_len ); } /* Restore the left side bearing, advance and glyph width */ @@ -1340,6 +1339,14 @@ decoder->num_hints += num_args / 2; } + /* In a valid charstring there must be at least one byte */ + /* after `hintmask' or `cntrmask' (e.g., for a `return' */ + /* instruction). Additionally, there must be space for */ + /* `num_hints' bits. */ + + if ( ( ip + ( ( decoder->num_hints + 7 ) >> 3 ) ) >= limit ) + goto Syntax_Error; + if ( hinter ) { if ( op == cff_op_hintmask ) @@ -1358,20 +1365,18 @@ FT_UInt maskbyte; - FT_TRACE4(( " (maskbytes: " )); + FT_TRACE4(( " (maskbytes:" )); for ( maskbyte = 0; - maskbyte < (FT_UInt)(( decoder->num_hints + 7 ) >> 3); + maskbyte < (FT_UInt)( ( decoder->num_hints + 7 ) >> 3 ); maskbyte++, ip++ ) - FT_TRACE4(( "0x%02X", *ip )); + FT_TRACE4(( " 0x%02X", *ip )); FT_TRACE4(( ")\n" )); } #else ip += ( decoder->num_hints + 7 ) >> 3; #endif - if ( ip >= limit ) - goto Syntax_Error; args = stack; break; @@ -2275,7 +2280,11 @@ /* subsequent `pop' operands should add the arguments, */ /* this is the implementation described for `unknown' other */ /* subroutines in the Type1 spec. */ + /* */ + /* XXX Fix return arguments (see discussion below). */ args -= 2 + ( args[-2] >> 16 ); + if ( args < stack ) + goto Stack_Underflow; break; case cff_op_pop: @@ -2285,6 +2294,22 @@ FT_TRACE4(( " pop (invalid op)\n" )); + /* XXX Increasing `args' is wrong: After a certain number of */ + /* `pop's we get a stack overflow. Reason for doing it is */ + /* code like this (actually found in a CFF font): */ + /* */ + /* 17 1 3 callothersubr */ + /* pop */ + /* callsubr */ + /* */ + /* Since we handle `callothersubr' as a no-op, and */ + /* `callsubr' needs at least one argument, `pop' can't be a */ + /* no-op too as it basically should be. */ + /* */ + /* The right solution would be to provide real support for */ + /* `callothersubr' as done in `t1decode.c', however, given */ + /* the fact that CFF fonts with `pop' are invalid, it is */ + /* questionable whether it is worth the time. */ args++; break; @@ -2448,7 +2473,10 @@ return CFF_Err_Unimplemented_Feature; } - decoder->top = args; + decoder->top = args; + + if ( decoder->top - stack >= CFF_MAX_OPERANDS ) + goto Stack_Overflow; } /* general operator processing */ @@ -2668,11 +2696,15 @@ /* this scaling is only relevant if the PS hinter isn't active */ if ( cff->num_subfonts ) { - FT_Byte fd_index = cff_fd_select_get( &cff->fd_select, - glyph_index ); + FT_ULong top_upm, sub_upm; + FT_Byte fd_index = cff_fd_select_get( &cff->fd_select, + glyph_index ); - FT_ULong top_upm = cff->top_font.font_dict.units_per_em; - FT_ULong sub_upm = cff->subfonts[fd_index]->font_dict.units_per_em; + if ( fd_index >= cff->num_subfonts ) + fd_index = cff->num_subfonts - 1; + + top_upm = cff->top_font.font_dict.units_per_em; + sub_upm = cff->subfonts[fd_index]->font_dict.units_per_em; font_matrix = cff->subfonts[fd_index]->font_dict.font_matrix; @@ -2717,48 +2749,53 @@ /* now load the unscaled outline */ error = cff_get_glyph_data( face, glyph_index, &charstring, &charstring_len ); - if ( !error ) - { - error = cff_decoder_prepare( &decoder, size, glyph_index ); - if ( !error ) - { - error = cff_decoder_parse_charstrings( &decoder, - charstring, - charstring_len ); + if ( error ) + goto Glyph_Build_Finished; - cff_free_glyph_data( face, &charstring, charstring_len ); + error = cff_decoder_prepare( &decoder, size, glyph_index ); + if ( error ) + goto Glyph_Build_Finished; + error = cff_decoder_parse_charstrings( &decoder, + charstring, + charstring_len ); + + cff_free_glyph_data( face, &charstring, charstring_len ); + + if ( error ) + goto Glyph_Build_Finished; #ifdef FT_CONFIG_OPTION_INCREMENTAL - /* Control data and length may not be available for incremental */ - /* fonts. */ - if ( face->root.internal->incremental_interface ) - { - glyph->root.control_data = 0; - glyph->root.control_len = 0; - } - else + /* Control data and length may not be available for incremental */ + /* fonts. */ + if ( face->root.internal->incremental_interface ) + { + glyph->root.control_data = 0; + glyph->root.control_len = 0; + } + else #endif /* FT_CONFIG_OPTION_INCREMENTAL */ - /* We set control_data and control_len if charstrings is loaded. */ - /* See how charstring loads at cff_index_access_element() in */ - /* cffload.c. */ - { - CFF_Index csindex = &cff->charstrings_index; + /* We set control_data and control_len if charstrings is loaded. */ + /* See how charstring loads at cff_index_access_element() in */ + /* cffload.c. */ + { + CFF_Index csindex = &cff->charstrings_index; - if ( csindex->offsets ) - { - glyph->root.control_data = csindex->bytes + - csindex->offsets[glyph_index] - 1; - glyph->root.control_len = charstring_len; - } - } + if ( csindex->offsets ) + { + glyph->root.control_data = csindex->bytes + + csindex->offsets[glyph_index] - 1; + glyph->root.control_len = charstring_len; } } - /* save new glyph tables */ - cff_builder_done( &decoder.builder ); + Glyph_Build_Finished: + /* save new glyph tables, if no error */ + if ( !error ) + cff_builder_done( &decoder.builder ); + /* XXX: anything to do for broken glyph entry? */ } #ifdef FT_CONFIG_OPTION_INCREMENTAL diff --git a/lib/3rdparty/freetype/src/cff/cffload.c b/lib/3rdparty/freetype/src/cff/cffload.c index 64d13957235..000cbe3ac5e 100644 --- a/lib/3rdparty/freetype/src/cff/cffload.c +++ b/lib/3rdparty/freetype/src/cff/cffload.c @@ -4,7 +4,8 @@ /* */ /* OpenType and CFF data/program tables loader (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */ +/* 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -20,7 +21,6 @@ #include FT_INTERNAL_DEBUG_H #include FT_INTERNAL_OBJECTS_H #include FT_INTERNAL_STREAM_H -#include FT_SERVICE_POSTSCRIPT_CMAPS_H #include FT_TRUETYPE_TAGS_H #include FT_TYPE1_TABLES_H @@ -251,7 +251,7 @@ if ( offsize < 1 || offsize > 4 ) { - error = FT_Err_Invalid_Table; + error = CFF_Err_Invalid_Table; goto Exit; } @@ -377,18 +377,21 @@ } - /* allocate a table containing pointers to an index's elements */ + /* Allocate a table containing pointers to an index's elements. */ + /* The `pool' argument makes this function convert the index */ + /* entries to C-style strings (this is, NULL-terminated). */ static FT_Error cff_index_get_pointers( CFF_Index idx, - FT_Byte*** table ) + FT_Byte*** table, + FT_Byte** pool ) { - FT_Error error = CFF_Err_Ok; - FT_Memory memory = idx->stream->memory; - FT_ULong n, offset, old_offset; + FT_Error error = CFF_Err_Ok; + FT_Memory memory = idx->stream->memory; FT_Byte** t; + FT_Byte* new_bytes = NULL; - *table = 0; + *table = NULL; if ( idx->offsets == NULL ) { @@ -397,28 +400,65 @@ goto Exit; } - if ( idx->count > 0 && !FT_NEW_ARRAY( t, idx->count + 1 ) ) + if ( idx->count > 0 && + !FT_NEW_ARRAY( t, idx->count + 1 ) && + ( !pool || !FT_ALLOC( new_bytes, + idx->data_size + idx->count ) ) ) { - old_offset = 1; - for ( n = 0; n <= idx->count; n++ ) + FT_ULong n, cur_offset; + FT_ULong extra = 0; + FT_Byte* org_bytes = idx->bytes; + + + /* at this point, `idx->offsets' can't be NULL */ + cur_offset = idx->offsets[0] - 1; + + /* sanity check */ + if ( cur_offset >= idx->data_size ) { - /* at this point, `idx->offsets' can't be NULL */ - offset = idx->offsets[n]; - if ( !offset ) - offset = old_offset; + FT_TRACE0(( "cff_index_get_pointers:" + " invalid first offset value %d set to zero\n", + cur_offset )); + cur_offset = 0; + } - /* two sanity checks for invalid offset tables */ - else if ( offset < old_offset ) - offset = old_offset; + if ( !pool ) + t[0] = org_bytes + cur_offset; + else + t[0] = new_bytes + cur_offset; - else if ( offset - 1 >= idx->data_size && n < idx->count ) - offset = old_offset; + for ( n = 1; n <= idx->count; n++ ) + { + FT_ULong next_offset = idx->offsets[n] - 1; - t[n] = idx->bytes + offset - 1; - old_offset = offset; + /* empty slot + two sanity checks for invalid offset tables */ + if ( next_offset == 0 || + next_offset < cur_offset || + ( next_offset >= idx->data_size && n < idx->count ) ) + next_offset = cur_offset; + + if ( !pool ) + t[n] = org_bytes + next_offset; + else + { + t[n] = new_bytes + next_offset + extra; + + if ( next_offset != cur_offset ) + { + FT_MEM_COPY( t[n - 1], org_bytes + cur_offset, t[n] - t[n - 1] ); + t[n][0] = '\0'; + t[n] += 1; + extra++; + } + } + + cur_offset = next_offset; } *table = t; + + if ( pool ) + *pool = new_bytes; } Exit: @@ -479,6 +519,18 @@ } } + /* XXX: should check off2 does not exceed the end of this entry; */ + /* at present, only truncate off2 at the end of this stream */ + if ( off2 > stream->size + 1 || + idx->data_offset > stream->size - off2 + 1 ) + { + FT_ERROR(( "cff_index_access_element:" + " offset to next entry (%d)" + " exceeds the end of stream (%d)\n", + off2, stream->size - idx->data_offset + 1 )); + off2 = stream->size - idx->data_offset + 1; + } + /* access element */ if ( off1 && off2 > off1 ) { @@ -526,10 +578,12 @@ } + /* get an entry from Name INDEX */ FT_LOCAL_DEF( FT_String* ) - cff_index_get_name( CFF_Index idx, - FT_UInt element ) + cff_index_get_name( CFF_Font font, + FT_UInt element ) { + CFF_Index idx = &font->name_index; FT_Memory memory = idx->stream->memory; FT_Byte* bytes; FT_ULong byte_len; @@ -553,42 +607,35 @@ } + /* get an entry from String INDEX */ FT_LOCAL_DEF( FT_String* ) - cff_index_get_sid_string( CFF_Index idx, - FT_UInt sid, - FT_Service_PsCMaps psnames ) + cff_index_get_string( CFF_Font font, + FT_UInt element ) + { + return ( element < font->num_strings ) + ? (FT_String*)font->strings[element] + : NULL; + } + + + FT_LOCAL_DEF( FT_String* ) + cff_index_get_sid_string( CFF_Font font, + FT_UInt sid ) { /* value 0xFFFFU indicates a missing dictionary entry */ if ( sid == 0xFFFFU ) - return 0; + return NULL; /* if it is not a standard string, return it */ if ( sid > 390 ) - return cff_index_get_name( idx, sid - 391 ); + return cff_index_get_string( font, sid - 391 ); /* CID-keyed CFF fonts don't have glyph names */ - if ( !psnames ) - return 0; + if ( !font->psnames ) + return NULL; - /* that's a standard string, fetch a copy from the PSName module */ - { - FT_String* name = 0; - const char* adobe_name = psnames->adobe_std_strings( sid ); - - - if ( adobe_name ) - { - FT_Memory memory = idx->stream->memory; - FT_Error error; - - - (void)FT_STRDUP( name, adobe_name ); - - FT_UNUSED( error ); - } - - return name; - } + /* this is a standard string */ + return (FT_String *)font->psnames->adobe_std_strings( sid ); } @@ -734,7 +781,7 @@ FT_UInt num_glyphs, FT_Memory memory ) { - FT_Error error = FT_Err_Ok; + FT_Error error = CFF_Err_Ok; FT_UInt i; FT_Long j; FT_UShort max_cid = 0; @@ -744,11 +791,12 @@ goto Exit; for ( i = 0; i < num_glyphs; i++ ) + { if ( charset->sids[i] > max_cid ) max_cid = charset->sids[i]; - max_cid++; + } - if ( FT_NEW_ARRAY( charset->cids, max_cid ) ) + if ( FT_NEW_ARRAY( charset->cids, (FT_ULong)max_cid + 1 ) ) goto Exit; /* When multiple GIDs map to the same CID, we choose the lowest */ @@ -772,7 +820,7 @@ FT_UInt result = 0; - if ( cid < charset->max_cid ) + if ( cid <= charset->max_cid ) result = charset->cids[cid]; return result; @@ -846,20 +894,7 @@ goto Exit; for ( j = 1; j < num_glyphs; j++ ) - { - FT_UShort sid = FT_GET_USHORT(); - - - /* this constant is given in the CFF specification */ - if ( sid < 65000L ) - charset->sids[j] = sid; - else - { - FT_TRACE0(( "cff_charset_load:" - " invalid SID value %d set to zero\n", sid )); - charset->sids[j] = 0; - } - } + charset->sids[j] = FT_GET_USHORT(); FT_FRAME_EXIT(); } @@ -892,18 +927,12 @@ goto Exit; } - /* check whether the range contains at least one valid glyph; */ - /* the constant is given in the CFF specification */ - if ( glyph_sid >= 65000L ) { - FT_ERROR(( "cff_charset_load: invalid SID range\n" )); - error = CFF_Err_Invalid_File_Format; - goto Exit; - } - /* try to rescue some of the SIDs if `nleft' is too large */ - if ( nleft > 65000L - 1L || glyph_sid >= 65000L - nleft ) { - FT_ERROR(( "cff_charset_load: invalid SID range trimmed\n" )); - nleft = ( FT_UInt )( 65000L - 1L - glyph_sid ); + if ( glyph_sid > 0xFFFFL - nleft ) + { + FT_ERROR(( "cff_charset_load: invalid SID range trimmed" + " nleft=%d -> %d\n", nleft, 0xFFFFL - glyph_sid )); + nleft = ( FT_UInt )( 0xFFFFL - glyph_sid ); } /* Fill in the range of sids -- `nleft + 1' glyphs. */ @@ -1240,9 +1269,7 @@ if ( gid != 0 ) { encoding->codes[j] = (FT_UShort)gid; - - if ( encoding->count < j + 1 ) - encoding->count = j + 1; + encoding->count = j + 1; } else { @@ -1361,9 +1388,8 @@ if ( error ) goto Exit; - font->num_local_subrs = font->local_subrs_index.count; error = cff_index_get_pointers( &font->local_subrs_index, - &font->local_subrs ); + &font->local_subrs, NULL ); if ( error ) goto Exit; } @@ -1409,9 +1435,11 @@ FT_Memory memory = stream->memory; FT_ULong base_offset; CFF_FontRecDict dict; + CFF_IndexRec string_index; FT_ZERO( font ); + FT_ZERO( &string_index ); font->stream = stream; font->memory = memory; @@ -1438,15 +1466,20 @@ /* read the name, top dict, string and global subrs index */ if ( FT_SET_ERROR( cff_index_init( &font->name_index, - stream, 0 ) ) || + stream, 0 ) ) || FT_SET_ERROR( cff_index_init( &font->font_dict_index, - stream, 0 ) ) || - FT_SET_ERROR( cff_index_init( &font->string_index, - stream, 0 ) ) || + stream, 0 ) ) || + FT_SET_ERROR( cff_index_init( &string_index, + stream, 1 ) ) || FT_SET_ERROR( cff_index_init( &font->global_subrs_index, - stream, 1 ) ) ) + stream, 1 ) ) || + FT_SET_ERROR( cff_index_get_pointers( &string_index, + &font->strings, + &font->string_pool ) ) ) goto Exit; + font->num_strings = string_index.count; + /* well, we don't really forget the `disabled' fonts... */ font->num_faces = font->name_index.count; if ( face_index >= (FT_Int)font->num_faces ) @@ -1542,12 +1575,10 @@ goto Exit; } - /* explicit the global subrs */ - font->num_global_subrs = font->global_subrs_index.count; - font->num_glyphs = font->charstrings_index.count; + font->num_glyphs = font->charstrings_index.count; error = cff_index_get_pointers( &font->global_subrs_index, - &font->global_subrs ) ; + &font->global_subrs, NULL ); if ( error ) goto Exit; @@ -1579,9 +1610,11 @@ /* get the font name (/CIDFontName for CID-keyed fonts, */ /* /FontName otherwise) */ - font->font_name = cff_index_get_name( &font->name_index, face_index ); + font->font_name = cff_index_get_name( font, face_index ); Exit: + cff_index_done( &string_index ); + return error; } @@ -1594,7 +1627,6 @@ cff_index_done( &font->global_subrs_index ); - cff_index_done( &font->string_index ); cff_index_done( &font->font_dict_index ); cff_index_done( &font->name_index ); cff_index_done( &font->charstrings_index ); @@ -1617,21 +1649,12 @@ CFF_Done_FD_Select( &font->fd_select, font->stream ); - if (font->font_info != NULL) - { - FT_FREE( font->font_info->version ); - FT_FREE( font->font_info->notice ); - FT_FREE( font->font_info->full_name ); - FT_FREE( font->font_info->family_name ); - FT_FREE( font->font_info->weight ); - FT_FREE( font->font_info ); - } + FT_FREE( font->font_info ); - FT_FREE( font->registry ); - FT_FREE( font->ordering ); - - FT_FREE( font->global_subrs ); FT_FREE( font->font_name ); + FT_FREE( font->global_subrs ); + FT_FREE( font->strings ); + FT_FREE( font->string_pool ); } diff --git a/lib/3rdparty/freetype/src/cff/cffload.h b/lib/3rdparty/freetype/src/cff/cffload.h index 2b313acf06e..c755de9a200 100644 --- a/lib/3rdparty/freetype/src/cff/cffload.h +++ b/lib/3rdparty/freetype/src/cff/cffload.h @@ -4,7 +4,7 @@ /* */ /* OpenType & CFF data/program tables loader (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2007, 2008 by */ +/* Copyright 1996-2001, 2002, 2003, 2007, 2008, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -22,7 +22,6 @@ #include #include "cfftypes.h" -#include FT_SERVICE_POSTSCRIPT_CMAPS_H FT_BEGIN_HEADER @@ -32,13 +31,12 @@ FT_BEGIN_HEADER FT_LOCAL( FT_String* ) - cff_index_get_name( CFF_Index idx, - FT_UInt element ); + cff_index_get_string( CFF_Font font, + FT_UInt element ); FT_LOCAL( FT_String* ) - cff_index_get_sid_string( CFF_Index idx, - FT_UInt sid, - FT_Service_PsCMaps psnames ); + cff_index_get_sid_string( CFF_Font font, + FT_UInt sid ); FT_LOCAL( FT_Error ) @@ -51,6 +49,10 @@ FT_BEGIN_HEADER cff_index_forget_element( CFF_Index idx, FT_Byte** pbytes ); + FT_LOCAL( FT_String* ) + cff_index_get_name( CFF_Font font, + FT_UInt element ); + FT_LOCAL( FT_UInt ) cff_charset_cid_to_gindex( CFF_Charset charset, diff --git a/lib/3rdparty/freetype/src/cff/cffobjs.c b/lib/3rdparty/freetype/src/cff/cffobjs.c index bd56c4ba11d..1cd35c96ca0 100644 --- a/lib/3rdparty/freetype/src/cff/cffobjs.c +++ b/lib/3rdparty/freetype/src/cff/cffobjs.c @@ -4,7 +4,8 @@ /* */ /* OpenType objects manager (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */ +/* 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -24,8 +25,6 @@ #include FT_TRUETYPE_IDS_H #include FT_TRUETYPE_TAGS_H #include FT_INTERNAL_SFNT_H -#include FT_SERVICE_POSTSCRIPT_CMAPS_H -#include FT_INTERNAL_POSTSCRIPT_HINTS_H #include "cffobjs.h" #include "cffload.h" #include "cffcmap.h" @@ -58,7 +57,7 @@ { CFF_Face face = (CFF_Face)size->root.face; CFF_Font font = (CFF_Font)face->extra.data; - PSHinter_Service pshinter = (PSHinter_Service)font->pshinter; + PSHinter_Service pshinter = font->pshinter; FT_Module module; @@ -349,7 +348,7 @@ { CFF_Face face = (CFF_Face)slot->face; CFF_Font font = (CFF_Font)face->extra.data; - PSHinter_Service pshinter = (PSHinter_Service)font->pshinter; + PSHinter_Service pshinter = font->pshinter; if ( pshinter ) @@ -395,6 +394,41 @@ } + /* Strip all subset prefixes of the form `ABCDEF+'. Usually, there */ + /* is only one, but font names like `APCOOG+JFABTD+FuturaBQ-Bold' */ + /* have been seen in the wild. */ + + static void + remove_subset_prefix( FT_String* name ) + { + FT_Int32 idx = 0; + FT_Int32 length = strlen( name ) + 1; + FT_Bool continue_search = 1; + + + while ( continue_search ) + { + if ( length >= 7 && name[6] == '+' ) + { + for ( idx = 0; idx < 6; idx++ ) + { + /* ASCII uppercase letters */ + if ( !( 'A' <= name[idx] && name[idx] <= 'Z' ) ) + continue_search = 0; + } + + if ( continue_search ) + { + for ( idx = 7; idx < length; idx++ ) + name[idx - 7] = name[idx]; + } + } + else + continue_search = 0; + } + } + + FT_LOCAL_DEF( FT_Error ) cff_face_init( FT_Stream stream, FT_Face cffface, /* CFF_Face */ @@ -412,14 +446,6 @@ FT_Library library = cffface->driver->root.library; -#if 0 - FT_FACE_FIND_GLOBAL_SERVICE( face, sfnt, SFNT ); - FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_NAMES ); - FT_FACE_FIND_GLOBAL_SERVICE( face, pshinter, POSTSCRIPT_HINTER ); - - if ( !sfnt ) - goto Bad_Format; -#else sfnt = (SFNT_Service)FT_Get_Module_Interface( library, "sfnt" ); if ( !sfnt ) @@ -429,7 +455,6 @@ pshinter = (PSHinter_Service)FT_Get_Module_Interface( library, "pshinter" ); -#endif /* create input stream from resource */ if ( FT_STREAM_SEEK( 0 ) ) @@ -514,7 +539,7 @@ goto Exit; cff->pshinter = pshinter; - cff->psnames = (void*)psnames; + cff->psnames = psnames; cffface->face_index = face_index; @@ -652,7 +677,7 @@ /* compute number of glyphs */ if ( dict->cid_registry != 0xFFFFU ) - cffface->num_glyphs = cff->charset.max_cid; + cffface->num_glyphs = cff->charset.max_cid + 1; else cffface->num_glyphs = cff->charstrings_index.count; @@ -678,24 +703,22 @@ (FT_Short)( dict->underline_thickness >> 16 ); /* retrieve font family & style name */ - cffface->family_name = cff_index_get_name( &cff->name_index, - face_index ); - + cffface->family_name = cff_index_get_name( cff, face_index ); if ( cffface->family_name ) { - char* full = cff_index_get_sid_string( &cff->string_index, - dict->full_name, - psnames ); + char* full = cff_index_get_sid_string( cff, + dict->full_name ); char* fullp = full; char* family = cffface->family_name; - char* family_name = 0; + char* family_name = NULL; + remove_subset_prefix( cffface->family_name ); + if ( dict->family_name ) { - family_name = cff_index_get_sid_string( &cff->string_index, - dict->family_name, - psnames); + family_name = cff_index_get_sid_string( cff, + dict->family_name ); if ( family_name ) family = family_name; } @@ -738,23 +761,18 @@ } break; } - - if ( family_name ) - FT_FREE( family_name ); - FT_FREE( full ); } } else { char *cid_font_name = - cff_index_get_sid_string( &cff->string_index, - dict->cid_font_name, - psnames ); + cff_index_get_sid_string( cff, + dict->cid_font_name ); /* do we have a `/FontName' for a CID-keyed font? */ if ( cid_font_name ) - cffface->family_name = cid_font_name; + cffface->family_name = cff_strcpy( memory, cid_font_name ); } if ( style_name ) @@ -797,16 +815,14 @@ flags |= FT_STYLE_FLAG_ITALIC; { - char *weight = cff_index_get_sid_string( &cff->string_index, - dict->weight, - psnames ); + char *weight = cff_index_get_sid_string( cff, + dict->weight ); if ( weight ) if ( !ft_strcmp( weight, "Bold" ) || !ft_strcmp( weight, "Black" ) ) flags |= FT_STYLE_FLAG_BOLD; - FT_FREE( weight ); } /* double check */ @@ -849,13 +865,14 @@ { cmap = cffface->charmaps[nn]; - /* Windows Unicode (3,1)? */ - if ( cmap->platform_id == 3 && cmap->encoding_id == 1 ) + /* Windows Unicode? */ + if ( cmap->platform_id == TT_PLATFORM_MICROSOFT && + cmap->encoding_id == TT_MS_ID_UNICODE_CS ) goto Skip_Unicode; - /* Deprecated Unicode platform id? */ - if ( cmap->platform_id == 0 ) - goto Skip_Unicode; /* Standard Unicode (deprecated) */ + /* Apple Unicode platform id? */ + if ( cmap->platform_id == TT_PLATFORM_APPLE_UNICODE ) + goto Skip_Unicode; /* Apple Unicode */ } /* since CID-keyed fonts don't contain glyph names, we can't */ @@ -863,28 +880,51 @@ if ( pure_cff && cff->top_font.font_dict.cid_registry != 0xFFFFU ) goto Exit; +#ifdef FT_MAX_CHARMAP_CACHEABLE + if ( nn + 1 > FT_MAX_CHARMAP_CACHEABLE ) + { + FT_ERROR(( "cff_face_init: no Unicode cmap is found, " + "and too many subtables (%d) to add synthesized cmap\n", + nn )); + goto Exit; + } +#endif + /* we didn't find a Unicode charmap -- synthesize one */ cmaprec.face = cffface; - cmaprec.platform_id = 3; - cmaprec.encoding_id = 1; + cmaprec.platform_id = TT_PLATFORM_MICROSOFT; + cmaprec.encoding_id = TT_MS_ID_UNICODE_CS; cmaprec.encoding = FT_ENCODING_UNICODE; nn = (FT_UInt)cffface->num_charmaps; - FT_CMap_New( &FT_CFF_CMAP_UNICODE_CLASS_REC_GET, NULL, &cmaprec, NULL ); + error = FT_CMap_New( &FT_CFF_CMAP_UNICODE_CLASS_REC_GET, NULL, + &cmaprec, NULL ); + if ( error && FT_Err_No_Unicode_Glyph_Name != error ) + goto Exit; + error = FT_Err_Ok; /* if no Unicode charmap was previously selected, select this one */ if ( cffface->charmap == NULL && nn != (FT_UInt)cffface->num_charmaps ) cffface->charmap = cffface->charmaps[nn]; Skip_Unicode: +#ifdef FT_MAX_CHARMAP_CACHEABLE + if ( nn > FT_MAX_CHARMAP_CACHEABLE ) + { + FT_ERROR(( "cff_face_init: Unicode cmap is found, " + "but too many preceding subtables (%d) to access\n", + nn - 1 )); + goto Exit; + } +#endif if ( encoding->count > 0 ) { FT_CMap_Class clazz; cmaprec.face = cffface; - cmaprec.platform_id = 7; /* Adobe platform id */ + cmaprec.platform_id = TT_PLATFORM_ADOBE; /* Adobe platform id */ if ( encoding->offset == 0 ) { @@ -905,7 +945,7 @@ clazz = &FT_CFF_CMAP_ENCODING_CLASS_REC_GET; } - FT_CMap_New( clazz, NULL, &cmaprec, NULL ); + error = FT_CMap_New( clazz, NULL, &cmaprec, NULL ); } } } diff --git a/lib/3rdparty/freetype/src/cff/cffparse.c b/lib/3rdparty/freetype/src/cff/cffparse.c index 01266a193d2..0d11a72786b 100644 --- a/lib/3rdparty/freetype/src/cff/cffparse.c +++ b/lib/3rdparty/freetype/src/cff/cffparse.c @@ -4,7 +4,7 @@ /* */ /* CFF token stream parser (body) */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2007, 2008, 2009 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2007, 2008, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -137,26 +137,23 @@ FT_UInt nib; FT_UInt phase; - FT_Long result, number, rest, exponent; + FT_Long result, number, exponent; FT_Int sign = 0, exponent_sign = 0; FT_Long exponent_add, integer_length, fraction_length; if ( scaling ) - *scaling = 0; + *scaling = 0; result = 0; number = 0; - rest = 0; exponent = 0; exponent_add = 0; integer_length = 0; fraction_length = 0; - FT_UNUSED( rest ); - /* First of all, read the integer part. */ phase = 4; @@ -332,11 +329,19 @@ goto Exit; /* Remove non-significant digits. */ - if ( integer_length < 0 ) { + if ( integer_length < 0 ) + { number /= power_tens[-integer_length]; fraction_length += integer_length; } + /* this can only happen if exponent was non-zero */ + if ( fraction_length == 10 ) + { + number /= 10; + fraction_length -= 1; + } + /* Convert into 16.16 format. */ if ( fraction_length > 0 ) { @@ -702,7 +707,7 @@ clazz[i].count_offset = 0; *output_class = clazz; - return FT_Err_Ok; + return CFF_Err_Ok; } diff --git a/lib/3rdparty/freetype/src/cff/cffpic.c b/lib/3rdparty/freetype/src/cff/cffpic.c index 568956d6a93..5d01bd45e17 100644 --- a/lib/3rdparty/freetype/src/cff/cffpic.c +++ b/lib/3rdparty/freetype/src/cff/cffpic.c @@ -4,7 +4,7 @@ /* */ /* The FreeType position independent code services for cff module. */ /* */ -/* Copyright 2009 by */ +/* Copyright 2009, 2010 by */ /* Oran Agra and Mickey Gabel. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -59,18 +59,20 @@ } } + FT_Error - cff_driver_class_pic_init( FT_Library library ) + cff_driver_class_pic_init( FT_Library library ) { - FT_PIC_Container* pic_container = &library->pic_container; - FT_Error error = FT_Err_Ok; - CffModulePIC* container; - FT_Memory memory = library->memory; + FT_PIC_Container* pic_container = &library->pic_container; + FT_Error error = CFF_Err_Ok; + CffModulePIC* container; + FT_Memory memory = library->memory; + /* allocate pointer, clear and set global container pointer */ if ( FT_ALLOC ( container, sizeof ( *container ) ) ) return error; - FT_MEM_SET( container, 0, sizeof(*container) ); + FT_MEM_SET( container, 0, sizeof ( *container ) ); pic_container->cff = container; /* initialize pointer table - this is how the module usually expects this data */ diff --git a/lib/3rdparty/freetype/src/cff/cfftypes.h b/lib/3rdparty/freetype/src/cff/cfftypes.h index df92e9a1ac3..d4053576574 100644 --- a/lib/3rdparty/freetype/src/cff/cfftypes.h +++ b/lib/3rdparty/freetype/src/cff/cfftypes.h @@ -5,7 +5,7 @@ /* Basic OpenType/CFF type definitions and interface (specification */ /* only). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2006, 2007, 2008 by */ +/* Copyright 1996-2001, 2002, 2003, 2006, 2007, 2008, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -24,6 +24,9 @@ #include #include FT_FREETYPE_H #include FT_TYPE1_TABLES_H +#include FT_INTERNAL_SERVICE_H +#include FT_SERVICE_POSTSCRIPT_CMAPS_H +#include FT_INTERNAL_POSTSCRIPT_HINTS_H FT_BEGIN_HEADER @@ -204,8 +207,7 @@ FT_BEGIN_HEADER CFF_PrivateRec private_dict; CFF_IndexRec local_subrs_index; - FT_UInt num_local_subrs; - FT_Byte** local_subrs; + FT_Byte** local_subrs; /* array of pointers into Local Subrs INDEX data */ } CFF_SubFontRec, *CFF_SubFont; @@ -229,7 +231,6 @@ FT_BEGIN_HEADER CFF_IndexRec name_index; CFF_IndexRec top_dict_index; - CFF_IndexRec string_index; CFF_IndexRec global_subrs_index; CFF_EncodingRec encoding; @@ -241,9 +242,15 @@ FT_BEGIN_HEADER CFF_IndexRec local_subrs_index; FT_String* font_name; - FT_UInt num_global_subrs; + + /* array of pointers into Global Subrs INDEX data */ FT_Byte** global_subrs; + /* array of pointers into String INDEX data stored at string_pool */ + FT_UInt num_strings; + FT_Byte** strings; + FT_Byte* string_pool; + CFF_SubFontRec top_font; FT_UInt num_subfonts; CFF_SubFont subfonts[CFF_MAX_CID_FONTS]; @@ -251,10 +258,10 @@ FT_BEGIN_HEADER CFF_FDSelectRec fd_select; /* interface to PostScript hinter */ - void* pshinter; + PSHinter_Service pshinter; /* interface to Postscript Names service */ - void* psnames; + FT_Service_PsCMaps psnames; /* since version 2.3.0 */ PS_FontInfoRec* font_info; /* font info dictionary */ diff --git a/lib/3rdparty/freetype/src/cid/cidgload.c b/lib/3rdparty/freetype/src/cid/cidgload.c index ea61b4e1283..81742d167a1 100644 --- a/lib/3rdparty/freetype/src/cid/cidgload.c +++ b/lib/3rdparty/freetype/src/cid/cidgload.c @@ -272,7 +272,6 @@ FT_Int32 load_flags ) { CID_GlyphSlot glyph = (CID_GlyphSlot)cidglyph; - CID_Size size = (CID_Size)cidsize; FT_Error error; T1_DecoderRec decoder; CID_Face face = (CID_Face)cidglyph->face; @@ -375,7 +374,7 @@ cidglyph->format = FT_GLYPH_FORMAT_OUTLINE; - if ( size && cidsize->metrics.y_ppem < 24 ) + if ( cidsize->metrics.y_ppem < 24 ) cidglyph->outline.flags |= FT_OUTLINE_HIGH_PRECISION; /* apply the font matrix */ diff --git a/lib/3rdparty/freetype/src/cid/cidobjs.c b/lib/3rdparty/freetype/src/cid/cidobjs.c index 82678af0d4b..eb82168888c 100644 --- a/lib/3rdparty/freetype/src/cid/cidobjs.c +++ b/lib/3rdparty/freetype/src/cid/cidobjs.c @@ -4,7 +4,7 @@ /* */ /* CID objects manager (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -131,7 +131,7 @@ cid_size_init( FT_Size cidsize ) /* CID_Size */ { CID_Size size = (CID_Size)cidsize; - FT_Error error = 0; + FT_Error error = CID_Err_Ok; PSH_Globals_Funcs funcs = cid_size_get_globals_funcs( size ); diff --git a/lib/3rdparty/freetype/src/gxvalid/gxvcommn.c b/lib/3rdparty/freetype/src/gxvalid/gxvcommn.c index de7ce6fdef1..211f97201ed 100644 --- a/lib/3rdparty/freetype/src/gxvalid/gxvcommn.c +++ b/lib/3rdparty/freetype/src/gxvalid/gxvcommn.c @@ -4,7 +4,7 @@ /* */ /* TrueTypeGX/AAT common tables validation (body). */ /* */ -/* Copyright 2004, 2005, 2009 */ +/* Copyright 2004, 2005, 2009, 2010 */ /* by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ @@ -908,7 +908,7 @@ nnames = FT_Get_Sfnt_Name_Count( valid->face ); for ( i = 0; i < nnames; i++ ) { - if ( FT_Get_Sfnt_Name( valid->face, i, &name ) != FT_Err_Ok ) + if ( FT_Get_Sfnt_Name( valid->face, i, &name ) != GXV_Err_Ok ) continue ; if ( name.name_id == name_index ) diff --git a/lib/3rdparty/freetype/src/gzip/ftgzip.c b/lib/3rdparty/freetype/src/gzip/ftgzip.c index 6f0c515723e..e914e56025f 100644 --- a/lib/3rdparty/freetype/src/gzip/ftgzip.c +++ b/lib/3rdparty/freetype/src/gzip/ftgzip.c @@ -8,7 +8,7 @@ /* parse compressed PCF fonts, as found with many X11 server */ /* distributions. */ /* */ -/* Copyright 2002, 2003, 2004, 2005, 2006, 2009 by */ +/* Copyright 2002, 2003, 2004, 2005, 2006, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -107,7 +107,7 @@ { FT_ULong sz = (FT_ULong)size * items; FT_Error error; - FT_Pointer p; + FT_Pointer p = NULL; (void)FT_ALLOC( p, sz ); @@ -390,7 +390,7 @@ ft_gzip_file_fill_output( FT_GZipFile zip ) { z_stream* zstream = &zip->zstream; - FT_Error error = 0; + FT_Error error = Gzip_Err_Ok; zip->cursor = zip->buffer; @@ -656,7 +656,7 @@ ft_gzip_file_io( zip, 0, NULL, 0 ); FT_FREE( zip_buff ); } - error = 0; + error = Gzip_Err_Ok; } } diff --git a/lib/3rdparty/freetype/src/lzw/ftlzw.c b/lib/3rdparty/freetype/src/lzw/ftlzw.c index 6e57dedb971..0b798fe54df 100644 --- a/lib/3rdparty/freetype/src/lzw/ftlzw.c +++ b/lib/3rdparty/freetype/src/lzw/ftlzw.c @@ -171,7 +171,7 @@ { FT_LzwState lzw = &zip->lzw; FT_ULong count; - FT_Error error = 0; + FT_Error error = LZW_Err_Ok; zip->cursor = zip->buffer; diff --git a/lib/3rdparty/freetype/src/otvalid/otvmath.c b/lib/3rdparty/freetype/src/otvalid/otvmath.c index 50ed10cf284..96f841f2a9c 100644 --- a/lib/3rdparty/freetype/src/otvalid/otvmath.c +++ b/lib/3rdparty/freetype/src/otvalid/otvmath.c @@ -248,7 +248,8 @@ otv_MathItalicsCorrectionInfo_validate( table + MathTopAccentAttachment, valid, FALSE ); - if ( ExtendedShapeCoverage ) { + if ( ExtendedShapeCoverage ) + { OTV_NAME_ENTER( "ExtendedShapeCoverage" ); otv_Coverage_validate( table + ExtendedShapeCoverage, valid, -1 ); OTV_EXIT; diff --git a/lib/3rdparty/freetype/src/otvalid/otvmod.c b/lib/3rdparty/freetype/src/otvalid/otvmod.c index 3248564560c..620e45233dd 100644 --- a/lib/3rdparty/freetype/src/otvalid/otvmod.c +++ b/lib/3rdparty/freetype/src/otvalid/otvmod.c @@ -214,7 +214,8 @@ *ot_jstf = (FT_Bytes)jstf; Exit: - if ( error ) { + if ( error ) + { FT_Memory memory = FT_FACE_MEMORY( face ); @@ -224,6 +225,7 @@ FT_FREE( gsub ); FT_FREE( jstf ); } + { FT_Memory memory = FT_FACE_MEMORY( face ); diff --git a/lib/3rdparty/freetype/src/pcf/pcfdrivr.c b/lib/3rdparty/freetype/src/pcf/pcfdrivr.c index b34e542aeb0..6c0aa0f9ee5 100644 --- a/lib/3rdparty/freetype/src/pcf/pcfdrivr.c +++ b/lib/3rdparty/freetype/src/pcf/pcfdrivr.c @@ -34,6 +34,7 @@ THE SOFTWARE. #include FT_LZW_H #include FT_ERRORS_H #include FT_BDF_H +#include FT_TRUETYPE_IDS_H #include "pcf.h" #include "pcfdrivr.h" @@ -227,7 +228,8 @@ THE SOFTWARE. { prop = &face->properties[i]; - if ( prop ) { + if ( prop ) + { FT_FREE( prop->name ); if ( prop->isString ) FT_FREE( prop->value.atom ); @@ -358,14 +360,15 @@ THE SOFTWARE. charmap.face = FT_FACE( face ); charmap.encoding = FT_ENCODING_NONE; - charmap.platform_id = 0; - charmap.encoding_id = 0; + /* initial platform/encoding should indicate unset status? */ + charmap.platform_id = TT_PLATFORM_APPLE_UNICODE; + charmap.encoding_id = TT_APPLE_ID_DEFAULT; if ( unicode_charmap ) { charmap.encoding = FT_ENCODING_UNICODE; - charmap.platform_id = 3; - charmap.encoding_id = 1; + charmap.platform_id = TT_PLATFORM_MICROSOFT; + charmap.encoding_id = TT_MS_ID_UNICODE_CS; } error = FT_CMap_New( &pcf_cmap_class, NULL, &charmap, NULL ); diff --git a/lib/3rdparty/freetype/src/pcf/pcfread.c b/lib/3rdparty/freetype/src/pcf/pcfread.c index 08becf99ce3..f7326238c00 100644 --- a/lib/3rdparty/freetype/src/pcf/pcfread.c +++ b/lib/3rdparty/freetype/src/pcf/pcfread.c @@ -2,7 +2,8 @@ FreeType font driver for pcf fonts - Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by + Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, + 2010 by Francesco Zappa Nardelli Permission is hereby granted, free of charge, to any person obtaining a copy @@ -607,6 +608,9 @@ THE SOFTWARE. face->nmetrics = nmetrics; + if ( !nmetrics ) + return PCF_Err_Invalid_Table; + FT_TRACE4(( "pcf_get_metrics:\n" )); FT_TRACE4(( " number of metrics: %d\n", nmetrics )); diff --git a/lib/3rdparty/freetype/src/pfr/pfrdrivr.c b/lib/3rdparty/freetype/src/pfr/pfrdrivr.c index 15cca9854e4..0053050a2ad 100644 --- a/lib/3rdparty/freetype/src/pfr/pfrdrivr.c +++ b/lib/3rdparty/freetype/src/pfr/pfrdrivr.c @@ -4,7 +4,7 @@ /* */ /* FreeType PFR driver interface (body). */ /* */ -/* Copyright 2002, 2003, 2004, 2006, 2008 by */ +/* Copyright 2002, 2003, 2004, 2006, 2008, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -84,7 +84,7 @@ if ( gindex < phys->num_chars ) { *anadvance = phys->chars[gindex].advance; - error = 0; + error = PFR_Err_Ok; } } diff --git a/lib/3rdparty/freetype/src/pfr/pfrgload.c b/lib/3rdparty/freetype/src/pfr/pfrgload.c index 6fe6e4225ab..6f65b01f5e9 100644 --- a/lib/3rdparty/freetype/src/pfr/pfrgload.c +++ b/lib/3rdparty/freetype/src/pfr/pfrgload.c @@ -4,7 +4,7 @@ /* */ /* FreeType PFR glyph loader (body). */ /* */ -/* Copyright 2002, 2003, 2005, 2007 by */ +/* Copyright 2002, 2003, 2005, 2007, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -248,7 +248,7 @@ FT_Byte* p, FT_Byte* limit ) { - FT_Error error = 0; + FT_Error error = PFR_Err_Ok; FT_Memory memory = glyph->loader->memory; FT_UInt flags, x_count, y_count, i, count, mask; FT_Int x; @@ -268,8 +268,8 @@ { PFR_CHECK( 1 ); count = PFR_NEXT_BYTE( p ); - x_count = ( count & 15 ); - y_count = ( count >> 4 ); + x_count = count & 15; + y_count = count >> 4; } else { @@ -388,7 +388,7 @@ case 2: /* horizontal line to */ FT_TRACE6(( "- horizontal line to cx.%d", format_low )); - if ( format_low > x_count ) + if ( format_low >= x_count ) goto Failure; pos[0].x = glyph->x_control[format_low]; pos[0].y = pos[3].y; @@ -398,7 +398,7 @@ case 3: /* vertical line to */ FT_TRACE6(( "- vertical line to cy.%d", format_low )); - if ( format_low > y_count ) + if ( format_low >= y_count ) goto Failure; pos[0].x = pos[3].x; pos[0].y = glyph->y_control[format_low]; @@ -440,7 +440,7 @@ case 0: /* 8-bit index */ PFR_CHECK( 1 ); idx = PFR_NEXT_BYTE( p ); - if ( idx > x_count ) + if ( idx >= x_count ) goto Failure; cur->x = glyph->x_control[idx]; FT_TRACE7(( " cx#%d", idx )); @@ -470,7 +470,7 @@ case 0: /* 8-bit index */ PFR_CHECK( 1 ); idx = PFR_NEXT_BYTE( p ); - if ( idx > y_count ) + if ( idx >= y_count ) goto Failure; cur->y = glyph->y_control[idx]; FT_TRACE7(( " cy#%d", idx )); @@ -558,7 +558,7 @@ FT_Byte* p, FT_Byte* limit ) { - FT_Error error = 0; + FT_Error error = PFR_Err_Ok; FT_GlyphLoader loader = glyph->loader; FT_Memory memory = loader->memory; PFR_SubGlyph subglyph; @@ -598,6 +598,16 @@ FT_UInt new_max = ( org_count + count + 3 ) & (FT_UInt)-4; + /* we arbitrarily limit the number of subglyphs */ + /* to avoid endless recursion */ + if ( new_max > 64 ) + { + error = PFR_Err_Invalid_Table; + FT_ERROR(( "pfr_glyph_load_compound:" + " too many compound glyphs components\n" )); + goto Exit; + } + if ( FT_RENEW_ARRAY( glyph->subs, glyph->max_subs, new_max ) ) goto Exit; @@ -743,6 +753,9 @@ count = glyph->num_subs - old_count; + FT_TRACE4(( "compound glyph with %d elements (offset %lu):\n", + count, offset )); + /* now, load each individual glyph */ for ( n = 0; n < count; n++ ) { @@ -750,6 +763,8 @@ PFR_SubGlyph subglyph; + FT_TRACE4(( "subglyph %d:\n", n )); + subglyph = glyph->subs + old_count + n; old_points = base->n_points; @@ -757,7 +772,7 @@ subglyph->gps_offset, subglyph->gps_size ); if ( error ) - goto Exit; + break; /* note that `glyph->subs' might have been re-allocated */ subglyph = glyph->subs + old_count + n; @@ -791,9 +806,13 @@ /* proceed to next sub-glyph */ } + + FT_TRACE4(( "end compound glyph with %d elements\n", count )); } else { + FT_TRACE4(( "simple glyph (offset %lu)\n", offset )); + /* load a simple glyph */ error = pfr_glyph_load_simple( glyph, p, limit ); @@ -805,9 +824,6 @@ } - - - FT_LOCAL_DEF( FT_Error ) pfr_glyph_load( PFR_Glyph glyph, FT_Stream stream, diff --git a/lib/3rdparty/freetype/src/pfr/pfrload.c b/lib/3rdparty/freetype/src/pfr/pfrload.c index bc5c035f3da..e919fa5b9fa 100644 --- a/lib/3rdparty/freetype/src/pfr/pfrload.c +++ b/lib/3rdparty/freetype/src/pfr/pfrload.c @@ -4,7 +4,7 @@ /* */ /* FreeType PFR loader (body). */ /* */ -/* Copyright 2002, 2003, 2004, 2005, 2007, 2009 by */ +/* Copyright 2002, 2003, 2004, 2005, 2007, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -49,7 +49,7 @@ PFR_ExtraItem item_list, FT_Pointer item_data ) { - FT_Error error = 0; + FT_Error error = PFR_Err_Ok; FT_Byte* p = *pp; FT_UInt num_items, item_type, item_size; @@ -353,7 +353,7 @@ PFR_Strike strike; FT_UInt flags0; FT_UInt n, count, size1; - FT_Error error = 0; + FT_Error error = PFR_Err_Ok; PFR_CHECK( 5 ); @@ -449,7 +449,7 @@ FT_Byte* limit, PFR_PhyFont phy_font ) { - FT_Error error = 0; + FT_Error error = PFR_Err_Ok; FT_Memory memory = phy_font->memory; FT_PtrDist len = limit - p; @@ -477,7 +477,7 @@ { FT_UInt count, num_vert, num_horz; FT_Int* snaps; - FT_Error error = 0; + FT_Error error = PFR_Err_Ok; FT_Memory memory = phy_font->memory; @@ -520,8 +520,8 @@ FT_Byte* limit, PFR_PhyFont phy_font ) { - PFR_KernItem item; - FT_Error error = 0; + PFR_KernItem item = NULL; + FT_Error error = PFR_Err_Ok; FT_Memory memory = phy_font->memory; @@ -631,7 +631,7 @@ FT_Memory memory, FT_String* *astring ) { - FT_Error error = 0; + FT_Error error = PFR_Err_Ok; FT_String* result = NULL; FT_UInt n, ok; diff --git a/lib/3rdparty/freetype/src/pfr/pfrobjs.c b/lib/3rdparty/freetype/src/pfr/pfrobjs.c index 56d617d880a..3e5e86e2109 100644 --- a/lib/3rdparty/freetype/src/pfr/pfrobjs.c +++ b/lib/3rdparty/freetype/src/pfr/pfrobjs.c @@ -4,7 +4,7 @@ /* */ /* FreeType PFR object methods (body). */ /* */ -/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */ +/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -23,6 +23,7 @@ #include "pfrsbit.h" #include FT_OUTLINE_H #include FT_INTERNAL_DEBUG_H +#include FT_TRUETYPE_IDS_H #include "pfrerror.h" @@ -147,7 +148,16 @@ break; if ( nn == phy_font->num_chars ) - pfrface->face_flags = 0; /* not scalable */ + { + if ( phy_font->num_strikes > 0 ) + pfrface->face_flags = 0; /* not scalable */ + else + { + FT_ERROR(( "pfr_face_init: font doesn't contain glyphs\n" )); + error = PFR_Err_Invalid_File_Format; + goto Exit; + } + } } if ( (phy_font->flags & PFR_PHY_PROPORTIONAL) == 0 ) @@ -243,11 +253,11 @@ charmap.face = pfrface; - charmap.platform_id = 3; - charmap.encoding_id = 1; + charmap.platform_id = TT_PLATFORM_MICROSOFT; + charmap.encoding_id = TT_MS_ID_UNICODE_CS; charmap.encoding = FT_ENCODING_UNICODE; - FT_CMap_New( &pfr_cmap_class_rec, NULL, &charmap, NULL ); + error = FT_CMap_New( &pfr_cmap_class_rec, NULL, &charmap, NULL ); #if 0 /* Select default charmap */ diff --git a/lib/3rdparty/freetype/src/pfr/pfrsbit.c b/lib/3rdparty/freetype/src/pfr/pfrsbit.c index d2f17dc9ceb..52bc2c8c39a 100644 --- a/lib/3rdparty/freetype/src/pfr/pfrsbit.c +++ b/lib/3rdparty/freetype/src/pfr/pfrsbit.c @@ -4,7 +4,7 @@ /* */ /* FreeType PFR bitmap loader (body). */ /* */ -/* Copyright 2002, 2003, 2006, 2009 by */ +/* Copyright 2002, 2003, 2006, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -353,7 +353,7 @@ FT_Long *aadvance, FT_UInt *aformat ) { - FT_Error error = 0; + FT_Error error = PFR_Err_Ok; FT_Byte flags; FT_Char b; FT_Byte* p = *pdata; @@ -484,7 +484,7 @@ FT_Bool decreasing, FT_Bitmap* target ) { - FT_Error error = 0; + FT_Error error = PFR_Err_Ok; PFR_BitWriterRec writer; diff --git a/lib/3rdparty/freetype/src/psaux/afmparse.c b/lib/3rdparty/freetype/src/psaux/afmparse.c index 91a17e2362e..d7de3736f7f 100644 --- a/lib/3rdparty/freetype/src/psaux/afmparse.c +++ b/lib/3rdparty/freetype/src/psaux/afmparse.c @@ -4,7 +4,7 @@ /* */ /* AFM parser (body). */ /* */ -/* Copyright 2006, 2007, 2008, 2009 by */ +/* Copyright 2006, 2007, 2008, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -527,7 +527,7 @@ FT_Byte* base, FT_Byte* limit ) { - AFM_Stream stream; + AFM_Stream stream = NULL; FT_Error error; diff --git a/lib/3rdparty/freetype/src/psaux/afmparse.h b/lib/3rdparty/freetype/src/psaux/afmparse.h index de2a530b2f0..35d96046c5d 100644 --- a/lib/3rdparty/freetype/src/psaux/afmparse.h +++ b/lib/3rdparty/freetype/src/psaux/afmparse.h @@ -56,7 +56,8 @@ FT_BEGIN_HEADER typedef struct AFM_ValueRec_ { enum AFM_ValueType_ type; - union { + union + { char* s; FT_Fixed f; FT_Int i; diff --git a/lib/3rdparty/freetype/src/psaux/psobjs.c b/lib/3rdparty/freetype/src/psaux/psobjs.c index fe8398ae388..45c7419141a 100644 --- a/lib/3rdparty/freetype/src/psaux/psobjs.c +++ b/lib/3rdparty/freetype/src/psaux/psobjs.c @@ -4,7 +4,8 @@ /* */ /* Auxiliary functions for PostScript fonts (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */ +/* 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -1588,6 +1589,13 @@ FT_Error error; + /* this might happen in invalid fonts */ + if ( !outline ) + { + FT_ERROR(( "t1_builder_add_contour: no outline to add points to\n" )); + return PSaux_Err_Invalid_File_Format; + } + if ( !builder->load_points ) { outline->n_contours++; @@ -1621,7 +1629,7 @@ if ( builder->parse_state == T1_Parse_Have_Path ) error = PSaux_Err_Ok; - else if ( builder->parse_state == T1_Parse_Have_Moveto ) + else { builder->parse_state = T1_Parse_Have_Path; error = t1_builder_add_contour( builder ); diff --git a/lib/3rdparty/freetype/src/psaux/t1decode.c b/lib/3rdparty/freetype/src/psaux/t1decode.c index 31554ff1ba7..ea31c51b174 100644 --- a/lib/3rdparty/freetype/src/psaux/t1decode.c +++ b/lib/3rdparty/freetype/src/psaux/t1decode.c @@ -373,15 +373,6 @@ #endif - /* we don't want to touch the source code -- use macro trick */ -#define start_point t1_builder_start_point -#define check_points t1_builder_check_points -#define add_point t1_builder_add_point -#define add_point1 t1_builder_add_point1 -#define add_contour t1_builder_add_contour -#define close_contour t1_builder_close_contour - - /* compute random seed from stack address of parameter */ seed = (FT_Fixed)( ( (FT_PtrDist)(char*)&seed ^ (FT_PtrDist)(char*)&decoder ^ @@ -739,8 +730,10 @@ decoder->flex_state = 1; decoder->num_flex_vectors = 0; - if ( start_point( builder, x, y ) || - check_points( builder, 6 ) ) + if ( ( error = t1_builder_start_point( builder, x, y ) ) + != PSaux_Err_Ok || + ( error = t1_builder_check_points( builder, 6 ) ) + != PSaux_Err_Ok ) goto Fail; break; @@ -757,10 +750,10 @@ /* point without adding any point to the outline */ idx = decoder->num_flex_vectors++; if ( idx > 0 && idx < 7 ) - add_point( builder, - x, - y, - (FT_Byte)( idx == 3 || idx == 6 ) ); + t1_builder_add_point( builder, + x, + y, + (FT_Byte)( idx == 3 || idx == 6 ) ); } break; @@ -777,6 +770,8 @@ } /* the two `results' are popped by the following setcurrentpoint */ + top[0] = x; + top[1] = y; known_othersubr_result_cnt = 2; break; @@ -1075,7 +1070,7 @@ case op_endchar: FT_TRACE4(( " endchar\n" )); - close_contour( builder ); + t1_builder_close_contour( builder ); /* close hints recording session */ if ( hinter ) @@ -1174,7 +1169,7 @@ /* if there is no path, `closepath' is a no-op */ if ( builder->parse_state == T1_Parse_Have_Path || builder->parse_state == T1_Parse_Have_Moveto ) - close_contour( builder ); + t1_builder_close_contour( builder ); builder->parse_state = T1_Parse_Have_Width; break; @@ -1182,7 +1177,8 @@ case op_hlineto: FT_TRACE4(( " hlineto" )); - if ( start_point( builder, x, y ) ) + if ( ( error = t1_builder_start_point( builder, x, y ) ) + != PSaux_Err_Ok ) goto Fail; x += top[0]; @@ -1203,30 +1199,34 @@ case op_hvcurveto: FT_TRACE4(( " hvcurveto" )); - if ( start_point( builder, x, y ) || - check_points( builder, 3 ) ) + if ( ( error = t1_builder_start_point( builder, x, y ) ) + != PSaux_Err_Ok || + ( error = t1_builder_check_points( builder, 3 ) ) + != PSaux_Err_Ok ) goto Fail; x += top[0]; - add_point( builder, x, y, 0 ); + t1_builder_add_point( builder, x, y, 0 ); x += top[1]; y += top[2]; - add_point( builder, x, y, 0 ); + t1_builder_add_point( builder, x, y, 0 ); y += top[3]; - add_point( builder, x, y, 1 ); + t1_builder_add_point( builder, x, y, 1 ); break; case op_rlineto: FT_TRACE4(( " rlineto" )); - if ( start_point( builder, x, y ) ) + if ( ( error = t1_builder_start_point( builder, x, y ) ) + != PSaux_Err_Ok ) goto Fail; x += top[0]; y += top[1]; Add_Line: - if ( add_point1( builder, x, y ) ) + if ( ( error = t1_builder_add_point1( builder, x, y ) ) + != PSaux_Err_Ok ) goto Fail; break; @@ -1246,43 +1246,48 @@ case op_rrcurveto: FT_TRACE4(( " rrcurveto" )); - if ( start_point( builder, x, y ) || - check_points( builder, 3 ) ) + if ( ( error = t1_builder_start_point( builder, x, y ) ) + != PSaux_Err_Ok || + ( error = t1_builder_check_points( builder, 3 ) ) + != PSaux_Err_Ok ) goto Fail; x += top[0]; y += top[1]; - add_point( builder, x, y, 0 ); + t1_builder_add_point( builder, x, y, 0 ); x += top[2]; y += top[3]; - add_point( builder, x, y, 0 ); + t1_builder_add_point( builder, x, y, 0 ); x += top[4]; y += top[5]; - add_point( builder, x, y, 1 ); + t1_builder_add_point( builder, x, y, 1 ); break; case op_vhcurveto: FT_TRACE4(( " vhcurveto" )); - if ( start_point( builder, x, y ) || - check_points( builder, 3 ) ) + if ( ( error = t1_builder_start_point( builder, x, y ) ) + != PSaux_Err_Ok || + ( error = t1_builder_check_points( builder, 3 ) ) + != PSaux_Err_Ok ) goto Fail; y += top[0]; - add_point( builder, x, y, 0 ); + t1_builder_add_point( builder, x, y, 0 ); x += top[1]; y += top[2]; - add_point( builder, x, y, 0 ); + t1_builder_add_point( builder, x, y, 0 ); x += top[3]; - add_point( builder, x, y, 1 ); + t1_builder_add_point( builder, x, y, 1 ); break; case op_vlineto: FT_TRACE4(( " vlineto" )); - if ( start_point( builder, x, y ) ) + if ( ( error = t1_builder_start_point( builder, x, y ) ) + != PSaux_Err_Ok ) goto Fail; y += top[0]; @@ -1480,8 +1485,12 @@ goto Syntax_Error; } else + ... #endif - decoder->flex_state = 0; + + x = top[0]; + y = top[1]; + decoder->flex_state = 0; break; case op_unknown15: diff --git a/lib/3rdparty/freetype/src/pshinter/pshalgo.c b/lib/3rdparty/freetype/src/pshinter/pshalgo.c index 417dcee547a..d798978914a 100644 --- a/lib/3rdparty/freetype/src/pshinter/pshalgo.c +++ b/lib/3rdparty/freetype/src/pshinter/pshalgo.c @@ -4,7 +4,8 @@ /* */ /* PostScript hinting algorithm (body). */ /* */ -/* Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ +/* Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 */ +/* by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used */ @@ -1690,7 +1691,10 @@ /* process secondary hints to `selected' points */ if ( num_masks > 1 && glyph->num_points > 0 ) { - first = mask->end_point; + /* the `endchar' op can reduce the number of points */ + first = mask->end_point > glyph->num_points + ? glyph->num_points + : mask->end_point; mask++; for ( ; num_masks > 1; num_masks--, mask++ ) { @@ -1698,7 +1702,9 @@ FT_Int count; - next = mask->end_point; + next = mask->end_point > glyph->num_points + ? glyph->num_points + : mask->end_point; count = next - first; if ( count > 0 ) { @@ -1856,12 +1862,10 @@ point->cur_u = hint->cur_pos + hint->cur_len + FT_MulFix( delta - hint->org_len, scale ); - else if ( hint->org_len > 0 ) + else /* hint->org_len > 0 */ point->cur_u = hint->cur_pos + FT_MulDiv( delta, hint->cur_len, hint->org_len ); - else - point->cur_u = hint->cur_pos; } psh_point_set_fitted( point ); } diff --git a/lib/3rdparty/freetype/src/pshinter/pshglob.c b/lib/3rdparty/freetype/src/pshinter/pshglob.c index 8a69aa1e845..31231ad0094 100644 --- a/lib/3rdparty/freetype/src/pshinter/pshglob.c +++ b/lib/3rdparty/freetype/src/pshinter/pshglob.c @@ -5,7 +5,7 @@ /* PostScript hinter global hinting management (body). */ /* Inspired by the new auto-hinter module. */ /* */ -/* Copyright 2001, 2002, 2003, 2004, 2006 by */ +/* Copyright 2001, 2002, 2003, 2004, 2006, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used */ @@ -624,7 +624,7 @@ T1_Private* priv, PSH_Globals *aglobals ) { - PSH_Globals globals; + PSH_Globals globals = NULL; FT_Error error; diff --git a/lib/3rdparty/freetype/src/pshinter/pshpic.c b/lib/3rdparty/freetype/src/pshinter/pshpic.c index 51a08798883..5efb4229489 100644 --- a/lib/3rdparty/freetype/src/pshinter/pshpic.c +++ b/lib/3rdparty/freetype/src/pshinter/pshpic.c @@ -4,7 +4,7 @@ /* */ /* The FreeType position independent code services for pshinter module. */ /* */ -/* Copyright 2009 by */ +/* Copyright 2009, 2010 by */ /* Oran Agra and Mickey Gabel. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -38,18 +38,20 @@ } } + FT_Error - pshinter_module_class_pic_init( FT_Library library ) + pshinter_module_class_pic_init( FT_Library library ) { - FT_PIC_Container* pic_container = &library->pic_container; - FT_Error error = FT_Err_Ok; - PSHinterPIC* container; - FT_Memory memory = library->memory; + FT_PIC_Container* pic_container = &library->pic_container; + FT_Error error = PSH_Err_Ok; + PSHinterPIC* container; + FT_Memory memory = library->memory; + /* allocate pointer, clear and set global container pointer */ if ( FT_ALLOC ( container, sizeof ( *container ) ) ) return error; - FT_MEM_SET( container, 0, sizeof(*container) ); + FT_MEM_SET( container, 0, sizeof ( *container ) ); pic_container->pshinter = container; /* add call to initialization function when you add new scripts */ diff --git a/lib/3rdparty/freetype/src/psnames/psmodule.c b/lib/3rdparty/freetype/src/psnames/psmodule.c index 35188504936..7528696938a 100644 --- a/lib/3rdparty/freetype/src/psnames/psmodule.c +++ b/lib/3rdparty/freetype/src/psnames/psmodule.c @@ -366,11 +366,13 @@ if ( count == 0 ) { + /* No unicode chars here! */ FT_FREE( table->maps ); if ( !error ) - error = PSnames_Err_Invalid_Argument; /* No unicode chars here! */ + error = PSnames_Err_No_Unicode_Glyph_Name; } - else { + else + { /* Reallocate if the number of used entries is much smaller. */ if ( count < num_glyphs / 2 ) { @@ -561,8 +563,7 @@ psnames_get_service( FT_Module module, const char* service_id ) { - FT_Library library = module->library; - FT_UNUSED(library); + FT_UNUSED( module ); return ft_service_list_lookup( FT_PSCMAPS_SERVICES_GET, service_id ); } diff --git a/lib/3rdparty/freetype/src/psnames/pspic.c b/lib/3rdparty/freetype/src/psnames/pspic.c index ed7dadda393..b9075d5a5a6 100644 --- a/lib/3rdparty/freetype/src/psnames/pspic.c +++ b/lib/3rdparty/freetype/src/psnames/pspic.c @@ -4,7 +4,7 @@ /* */ /* The FreeType position independent code services for psnames module. */ /* */ -/* Copyright 2009 by */ +/* Copyright 2009, 2010 by */ /* Oran Agra and Mickey Gabel. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -44,13 +44,15 @@ } } + FT_Error - psnames_module_class_pic_init( FT_Library library ) + psnames_module_class_pic_init( FT_Library library ) { - FT_PIC_Container* pic_container = &library->pic_container; - FT_Error error = FT_Err_Ok; - PSModulePIC* container; - FT_Memory memory = library->memory; + FT_PIC_Container* pic_container = &library->pic_container; + FT_Error error = PSnames_Err_Ok; + PSModulePIC* container; + FT_Memory memory = library->memory; + /* allocate pointer, clear and set global container pointer */ if ( FT_ALLOC ( container, sizeof ( *container ) ) ) diff --git a/lib/3rdparty/freetype/src/raster/ftmisc.h b/lib/3rdparty/freetype/src/raster/ftmisc.h index f04b5404bb8..7773924feb6 100644 --- a/lib/3rdparty/freetype/src/raster/ftmisc.h +++ b/lib/3rdparty/freetype/src/raster/ftmisc.h @@ -5,7 +5,7 @@ /* Miscellaneous macros for stand-alone rasterizer (specification */ /* only). */ /* */ -/* Copyright 2005, 2009 by */ +/* Copyright 2005, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used */ @@ -27,6 +27,7 @@ #ifndef __FTMISC_H__ #define __FTMISC_H__ + /* memset */ #include FT_CONFIG_STANDARD_LIBRARY_H @@ -35,6 +36,7 @@ #define FT_LOCAL_DEF( x ) static x + /* from include/freetype2/fttypes.h */ typedef unsigned char FT_Byte; @@ -77,12 +79,22 @@ } FT_MemoryRec; + /* from src/ftcalc.c */ -#include +#if ( defined _WIN32 || defined _WIN64 ) + + typedef __int64 FT_Int64; + +#else + +#include "inttypes.h" typedef int64_t FT_Int64; +#endif + + static FT_Long FT_MulDiv( FT_Long a, FT_Long b, diff --git a/lib/3rdparty/freetype/src/raster/ftraster.c b/lib/3rdparty/freetype/src/raster/ftraster.c index 23ad592653c..9638dfb026c 100644 --- a/lib/3rdparty/freetype/src/raster/ftraster.c +++ b/lib/3rdparty/freetype/src/raster/ftraster.c @@ -4,7 +4,7 @@ /* */ /* The FreeType glyph rasterizer (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2005, 2007, 2008, 2009 by */ +/* Copyright 1996-2001, 2002, 2003, 2005, 2007, 2008, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -302,7 +302,6 @@ typedef short Short; typedef unsigned short UShort, *PUShort; typedef long Long, *PLong; - typedef unsigned long ULong; typedef unsigned char Byte, *PByte; typedef char Bool; @@ -448,7 +447,6 @@ Int precision_bits; /* precision related variables */ Int precision; Int precision_half; - Long precision_mask; Int precision_shift; Int precision_step; Int precision_jitter; @@ -671,7 +669,6 @@ ras.precision = 1 << ras.precision_bits; ras.precision_half = ras.precision / 2; ras.precision_shift = ras.precision_bits - Pixel_Bits; - ras.precision_mask = -ras.precision; } @@ -725,13 +722,13 @@ if ( overshoot ) ras.cProfile->flags |= Overshoot_Bottom; - FT_TRACE6(( "New ascending profile = %lx\n", (long)ras.cProfile )); + FT_TRACE6(( "New ascending profile = %p\n", ras.cProfile )); break; case Descending_State: if ( overshoot ) ras.cProfile->flags |= Overshoot_Top; - FT_TRACE6(( "New descending profile = %lx\n", (long)ras.cProfile )); + FT_TRACE6(( "New descending profile = %p\n", ras.cProfile )); break; default: @@ -784,8 +781,8 @@ if ( h > 0 ) { - FT_TRACE6(( "Ending profile %lx, start = %ld, height = %ld\n", - (long)ras.cProfile, ras.cProfile->start, h )); + FT_TRACE6(( "Ending profile %p, start = %ld, height = %ld\n", + ras.cProfile, ras.cProfile->start, h )); ras.cProfile->height = h; if ( overshoot ) @@ -1094,7 +1091,7 @@ return SUCCESS; else { - x1 += FMulDiv( Dx, ras.precision - f1, Dy ); + x1 += SMulDiv( Dx, ras.precision - f1, Dy ); e1 += 1; } } @@ -1122,13 +1119,13 @@ if ( Dx > 0 ) { - Ix = ( ras.precision * Dx ) / Dy; + Ix = SMulDiv( ras.precision, Dx, Dy); Rx = ( ras.precision * Dx ) % Dy; Dx = 1; } else { - Ix = -( ( ras.precision * -Dx ) / Dy ); + Ix = SMulDiv( ras.precision, -Dx, Dy) * -1; Rx = ( ras.precision * -Dx ) % Dy; Dx = -1; } @@ -1931,18 +1928,21 @@ y1 = SCALED( point[-2].y ); x2 = SCALED( point[-1].x ); y2 = SCALED( point[-1].y ); - x3 = SCALED( point[ 0].x ); - y3 = SCALED( point[ 0].y ); if ( flipped ) { SWAP_( x1, y1 ); SWAP_( x2, y2 ); - SWAP_( x3, y3 ); } if ( point <= limit ) { + x3 = SCALED( point[0].x ); + y3 = SCALED( point[0].y ); + + if ( flipped ) + SWAP_( x3, y3 ); + if ( Cubic_To( RAS_VARS x1, y1, x2, y2, x3, y3 ) ) goto Fail; continue; @@ -2495,7 +2495,7 @@ PByte p; - p = bits - e1*ras.target.pitch; + p = bits - e1 * ras.target.pitch; if ( ras.target.pitch > 0 ) p += ( ras.target.rows - 1 ) * ras.target.pitch; @@ -3382,6 +3382,7 @@ FT_Raster *araster ) { static TRaster the_raster; + FT_UNUSED( memory ); *araster = (FT_Raster)&the_raster; @@ -3400,7 +3401,7 @@ } -#else /* _STANDALONE_ */ +#else /* !_STANDALONE_ */ static int @@ -3408,7 +3409,7 @@ PRaster *araster ) { FT_Error error; - PRaster raster; + PRaster raster = NULL; *araster = 0; @@ -3432,7 +3433,7 @@ } -#endif /* _STANDALONE_ */ +#endif /* !_STANDALONE_ */ static void @@ -3447,9 +3448,8 @@ PWorker worker = (PWorker)pool_base; - raster->buffer = pool_base + ( (sizeof ( *worker ) + 7 ) & ~7 ); - raster->buffer_size = ( ( pool_base + pool_size ) - - (char*)raster->buffer ) / sizeof ( Long ); + raster->buffer = pool_base + ( ( sizeof ( *worker ) + 7 ) & ~7 ); + raster->buffer_size = pool_base + pool_size - (char*)raster->buffer; raster->worker = worker; } else diff --git a/lib/3rdparty/freetype/src/raster/rastpic.c b/lib/3rdparty/freetype/src/raster/rastpic.c index 3c264877b6d..e31c5497633 100644 --- a/lib/3rdparty/freetype/src/raster/rastpic.c +++ b/lib/3rdparty/freetype/src/raster/rastpic.c @@ -4,7 +4,7 @@ /* */ /* The FreeType position independent code services for raster module. */ /* */ -/* Copyright 2009 by */ +/* Copyright 2009, 2010 by */ /* Oran Agra and Mickey Gabel. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -43,16 +43,17 @@ FT_Error - ft_raster1_renderer_class_pic_init( FT_Library library ) + ft_raster1_renderer_class_pic_init( FT_Library library ) { FT_PIC_Container* pic_container = &library->pic_container; - FT_Error error = FT_Err_Ok; - RasterPIC* container; - FT_Memory memory = library->memory; + FT_Error error = Raster_Err_Ok; + RasterPIC* container; + FT_Memory memory = library->memory; + /* since this function also serve raster5 renderer, it implements reference counting */ - if(pic_container->raster) + if ( pic_container->raster ) { ((RasterPIC*)pic_container->raster)->ref_count++; return error; diff --git a/lib/3rdparty/freetype/src/sfnt/sfdriver.c b/lib/3rdparty/freetype/src/sfnt/sfdriver.c index 1097efb86d7..b74679b31af 100644 --- a/lib/3rdparty/freetype/src/sfnt/sfdriver.c +++ b/lib/3rdparty/freetype/src/sfnt/sfdriver.c @@ -4,7 +4,7 @@ /* */ /* High-level SFNT driver interface (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -362,7 +362,7 @@ *acharset_registry = registry.u.atom; } else - error = FT_Err_Invalid_Argument; + error = SFNT_Err_Invalid_Argument; } } @@ -436,7 +436,7 @@ FT_UNUSED( face_index ); FT_UNUSED( header ); - return FT_Err_Unimplemented_Feature; + return SFNT_Err_Unimplemented_Feature; } @@ -449,7 +449,7 @@ FT_UNUSED( stream ); FT_UNUSED( header ); - return FT_Err_Unimplemented_Feature; + return SFNT_Err_Unimplemented_Feature; } @@ -460,7 +460,7 @@ FT_UNUSED( face ); FT_UNUSED( stream ); - return FT_Err_Unimplemented_Feature; + return SFNT_Err_Unimplemented_Feature; } @@ -513,7 +513,7 @@ * is only there for some rogue clients which would want to call it * directly (which doesn't make much sense). */ - return FT_Err_Unimplemented_Feature; + return SFNT_Err_Unimplemented_Feature; } @@ -534,7 +534,7 @@ FT_UNUSED( cmap ); FT_UNUSED( input ); - return FT_Err_Unimplemented_Feature; + return SFNT_Err_Unimplemented_Feature; } @@ -545,7 +545,7 @@ FT_UNUSED( face ); FT_UNUSED( cmap ); - return 0; + return SFNT_Err_Ok; } #endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ diff --git a/lib/3rdparty/freetype/src/sfnt/sfntpic.c b/lib/3rdparty/freetype/src/sfnt/sfntpic.c index fd3cf4e923e..53aca17b519 100644 --- a/lib/3rdparty/freetype/src/sfnt/sfntpic.c +++ b/lib/3rdparty/freetype/src/sfnt/sfntpic.c @@ -4,7 +4,7 @@ /* */ /* The FreeType position independent code services for sfnt module. */ /* */ -/* Copyright 2009 by */ +/* Copyright 2009, 2010 by */ /* Oran Agra and Mickey Gabel. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -60,15 +60,16 @@ FT_Error sfnt_module_class_pic_init( FT_Library library ) { - FT_PIC_Container* pic_container = &library->pic_container; - FT_Error error = FT_Err_Ok; - sfntModulePIC* container; - FT_Memory memory = library->memory; + FT_PIC_Container* pic_container = &library->pic_container; + FT_Error error = SFNT_Err_Ok; + sfntModulePIC* container; + FT_Memory memory = library->memory; + /* allocate pointer, clear and set global container pointer */ if ( FT_ALLOC ( container, sizeof ( *container ) ) ) return error; - FT_MEM_SET( container, 0, sizeof(*container) ); + FT_MEM_SET( container, 0, sizeof ( *container ) ); pic_container->sfnt = container; /* initialize pointer table - this is how the module usually expects this data */ diff --git a/lib/3rdparty/freetype/src/sfnt/sfobjs.c b/lib/3rdparty/freetype/src/sfnt/sfobjs.c index b74b1a93a9b..5a1d0031ed8 100644 --- a/lib/3rdparty/freetype/src/sfnt/sfobjs.c +++ b/lib/3rdparty/freetype/src/sfnt/sfobjs.c @@ -4,7 +4,7 @@ /* */ /* SFNT object management (base). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -50,9 +50,9 @@ tt_name_entry_ascii_from_utf16( TT_NameEntry entry, FT_Memory memory ) { - FT_String* string; + FT_String* string = NULL; FT_UInt len, code, n; - FT_Byte* read = (FT_Byte*)entry->string; + FT_Byte* read = (FT_Byte*)entry->string; FT_Error error; @@ -81,9 +81,9 @@ tt_name_entry_ascii_from_other( TT_NameEntry entry, FT_Memory memory ) { - FT_String* string; + FT_String* string = NULL; FT_UInt len, code, n; - FT_Byte* read = (FT_Byte*)entry->string; + FT_Byte* read = (FT_Byte*)entry->string; FT_Error error; @@ -160,7 +160,7 @@ /* According to the OpenType 1.3 specification, only Microsoft or */ /* Apple platform IDs might be used in the `name' table. The */ /* `Unicode' platform is reserved for the `cmap' table, and the */ - /* `Iso' one is deprecated. */ + /* `ISO' one is deprecated. */ /* */ /* However, the Apple TrueType specification doesn't say the same */ /* thing and goes to suggest that all Unicode `name' table entries */ @@ -691,9 +691,7 @@ LOAD_( os2 ); if ( error ) { - if ( error != SFNT_Err_Table_Missing ) - goto Exit; - + /* we treat the table as missing if there are any errors */ face->os2.version = 0xFFFFU; } } diff --git a/lib/3rdparty/freetype/src/sfnt/ttbdf.c b/lib/3rdparty/freetype/src/sfnt/ttbdf.c index 206cecee5ed..18845c39c2e 100644 --- a/lib/3rdparty/freetype/src/sfnt/ttbdf.c +++ b/lib/3rdparty/freetype/src/sfnt/ttbdf.c @@ -4,7 +4,7 @@ /* */ /* TrueType and OpenType embedded BDF properties (body). */ /* */ -/* Copyright 2005, 2006 by */ +/* Copyright 2005, 2006, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -74,7 +74,7 @@ length < 8 || FT_FRAME_EXTRACT( length, bdf->table ) ) { - error = FT_Err_Invalid_Table; + error = SFNT_Err_Invalid_Table; goto Exit; } @@ -131,7 +131,7 @@ BadTable: FT_FRAME_RELEASE( bdf->table ); FT_ZERO( bdf ); - error = FT_Err_Invalid_Table; + error = SFNT_Err_Invalid_Table; goto Exit; } @@ -143,7 +143,7 @@ { TT_BDF bdf = &face->bdf; FT_Size size = FT_FACE(face)->size; - FT_Error error = 0; + FT_Error error = SFNT_Err_Ok; FT_Byte* p; FT_UInt count; FT_Byte* strike; @@ -163,7 +163,7 @@ p = bdf->table + 8; strike = p + 4 * count; - error = FT_Err_Invalid_Argument; + error = SFNT_Err_Invalid_Argument; if ( size == NULL || property_name == NULL ) goto Exit; @@ -215,7 +215,7 @@ { aprop->type = BDF_PROPERTY_TYPE_ATOM; aprop->u.atom = (const char*)bdf->strings + value; - error = 0; + error = SFNT_Err_Ok; goto Exit; } break; @@ -223,13 +223,13 @@ case 0x02: aprop->type = BDF_PROPERTY_TYPE_INTEGER; aprop->u.integer = (FT_Int32)value; - error = 0; + error = SFNT_Err_Ok; goto Exit; case 0x03: aprop->type = BDF_PROPERTY_TYPE_CARDINAL; aprop->u.cardinal = value; - error = 0; + error = SFNT_Err_Ok; goto Exit; default: diff --git a/lib/3rdparty/freetype/src/sfnt/ttcmap.c b/lib/3rdparty/freetype/src/sfnt/ttcmap.c index b283f6d1621..544750ab17f 100644 --- a/lib/3rdparty/freetype/src/sfnt/ttcmap.c +++ b/lib/3rdparty/freetype/src/sfnt/ttcmap.c @@ -4,7 +4,7 @@ /* */ /* TrueType character mapping table (cmap) support (body). */ /* */ -/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ +/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -2689,7 +2689,7 @@ FT_Memory memory ) { FT_UInt32 old_max = cmap->max_results; - FT_Error error = 0; + FT_Error error = SFNT_Err_Ok; if ( num_results > cmap->max_results ) @@ -2787,7 +2787,8 @@ } /* and the non-default table (these glyphs are specified here) */ - if ( nondefOff != 0 ) { + if ( nondefOff != 0 ) + { FT_Byte* ndp = table + nondefOff; FT_ULong numMappings = TT_NEXT_ULONG( ndp ); FT_ULong i, lastUni = 0; @@ -3375,7 +3376,7 @@ clazz[i] = NULL; *output_class = clazz; - return FT_Err_Ok; + return SFNT_Err_Ok; } #endif /*FT_CONFIG_OPTION_PIC*/ @@ -3391,11 +3392,12 @@ FT_Byte* limit = table + face->cmap_size; FT_UInt volatile num_cmaps; FT_Byte* volatile p = table; - FT_Library library = FT_FACE_LIBRARY(face); - FT_UNUSED(library); + FT_Library library = FT_FACE_LIBRARY( face ); + + FT_UNUSED( library ); - if ( p + 4 > limit ) + if ( !p || p + 4 > limit ) return SFNT_Err_Invalid_Table; /* only recognize format 0 */ @@ -3409,6 +3411,12 @@ } num_cmaps = TT_NEXT_USHORT( p ); +#ifdef FT_MAX_CHARMAP_CACHEABLE + if ( num_cmaps > FT_MAX_CHARMAP_CACHEABLE ) + FT_ERROR(( "tt_face_build_cmaps: too many cmap subtables(%d) " + "subtable#%d and later are loaded but cannot be searched\n", + num_cmaps, FT_MAX_CHARMAP_CACHEABLE + 1 )); +#endif for ( ; num_cmaps > 0 && p + 8 <= limit; num_cmaps-- ) { diff --git a/lib/3rdparty/freetype/src/sfnt/ttkern.c b/lib/3rdparty/freetype/src/sfnt/ttkern.c index c1540802b87..46888988e4a 100644 --- a/lib/3rdparty/freetype/src/sfnt/ttkern.c +++ b/lib/3rdparty/freetype/src/sfnt/ttkern.c @@ -5,7 +5,7 @@ /* Load the basic TrueType kerning table. This doesn't handle */ /* kerning data within the GPOS table at the moment. */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -115,7 +115,7 @@ num_pairs = FT_NEXT_USHORT( p ); p += 6; - if ( ( p_next - p ) / 6 < (int)num_pairs ) /* handle broken count */ + if ( ( p_next - p ) < 6 * (int)num_pairs ) /* handle broken count */ num_pairs = (FT_UInt)( ( p_next - p ) / 6 ); avail |= mask; @@ -220,7 +220,7 @@ num_pairs = FT_NEXT_USHORT( p ); p += 6; - if ( ( next - p ) / 6 < (int)num_pairs ) /* handle broken count */ + if ( ( next - p ) < 6 * (int)num_pairs ) /* handle broken count */ num_pairs = (FT_UInt)( ( next - p ) / 6 ); switch ( coverage >> 8 ) diff --git a/lib/3rdparty/freetype/src/sfnt/ttload.c b/lib/3rdparty/freetype/src/sfnt/ttload.c index 3ad33bd6d86..20bac73d209 100644 --- a/lib/3rdparty/freetype/src/sfnt/ttload.c +++ b/lib/3rdparty/freetype/src/sfnt/ttload.c @@ -5,7 +5,8 @@ /* Load the basic TrueType tables, i.e., tables that can be either in */ /* TTF or OTF fonts (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */ +/* 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -77,7 +78,8 @@ { /* For compatibility with Windows, we consider */ /* zero-length tables the same as missing tables. */ - if ( entry->Tag == tag ) { + if ( entry->Tag == tag ) + { if ( entry->Length != 0 ) { FT_TRACE4(( "found table.\n" )); @@ -382,6 +384,10 @@ entry = face->dir_tables; + FT_TRACE2(( "\n" + " tag offset length checksum\n" + " ----------------------------------\n" )); + for ( nn = 0; nn < sfnt.num_tables; nn++ ) { entry->Tag = FT_GET_TAG4(); @@ -394,13 +400,14 @@ continue; else { - FT_TRACE2(( " %c%c%c%c - %08lx - %08lx\n", + FT_TRACE2(( " %c%c%c%c %08lx %08lx %08lx\n", (FT_Char)( entry->Tag >> 24 ), (FT_Char)( entry->Tag >> 16 ), (FT_Char)( entry->Tag >> 8 ), (FT_Char)( entry->Tag ), entry->Offset, - entry->Length )); + entry->Length, + entry->CheckSum )); entry++; } } @@ -678,9 +685,9 @@ /* broken fonts like `Keystrokes MT' :-( */ /* */ /* We allocate 64 function entries by default when */ - /* the maxFunctionDefs field is null. */ + /* the maxFunctionDefs value is smaller. */ - if ( maxProfile->maxFunctionDefs == 0 ) + if ( maxProfile->maxFunctionDefs < 64 ) maxProfile->maxFunctionDefs = 64; /* we add 4 phantom points later */ @@ -693,6 +700,15 @@ maxProfile->maxTwilightPoints = 0xFFFFU - 4; } + + /* we arbitrarily limit recursion to avoid stack exhaustion */ + if ( maxProfile->maxComponentDepth > 100 ) + { + FT_TRACE0(( "tt_face_load_maxp:" + " abnormally large component depth (%d) set to 100\n", + maxProfile->maxComponentDepth )); + maxProfile->maxComponentDepth = 100; + } } FT_TRACE3(( "numGlyphs: %u\n", maxProfile->numGlyphs )); diff --git a/lib/3rdparty/freetype/src/sfnt/ttpost.c b/lib/3rdparty/freetype/src/sfnt/ttpost.c index aa0bf1ec419..6f4bb1d0d32 100644 --- a/lib/3rdparty/freetype/src/sfnt/ttpost.c +++ b/lib/3rdparty/freetype/src/sfnt/ttpost.c @@ -5,7 +5,7 @@ /* Postcript name table processing for TrueType and OpenType fonts */ /* (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2006, 2007, 2008, 2009 by */ +/* Copyright 1996-2001, 2002, 2003, 2006, 2007, 2008, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -26,6 +26,7 @@ #include +#include FT_INTERNAL_DEBUG_H #include FT_INTERNAL_STREAM_H #include FT_TRUETYPE_TAGS_H #include "ttpost.h" @@ -153,7 +154,8 @@ static FT_Error load_format_20( TT_Face face, - FT_Stream stream ) + FT_Stream stream, + FT_Long post_limit ) { FT_Memory memory = stream->memory; FT_Error error; @@ -230,13 +232,46 @@ FT_UInt len; - if ( FT_READ_BYTE ( len ) || - FT_NEW_ARRAY( name_strings[n], len + 1 ) || - FT_STREAM_READ ( name_strings[n], len ) ) + if ( FT_STREAM_POS() >= post_limit ) + break; + else + { + FT_TRACE6(( "load_format_20: %d byte left in post table\n", + post_limit - FT_STREAM_POS() )); + + if ( FT_READ_BYTE( len ) ) + goto Fail1; + } + + if ( (FT_Int)len > post_limit || + FT_STREAM_POS() > post_limit - (FT_Int)len ) + { + FT_ERROR(( "load_format_20:" + " exceeding string length (%d)," + " truncating at end of post table (%d byte left)\n", + len, post_limit - FT_STREAM_POS() )); + len = FT_MAX( 0, post_limit - FT_STREAM_POS() ); + } + + if ( FT_NEW_ARRAY( name_strings[n], len + 1 ) || + FT_STREAM_READ( name_strings[n], len ) ) goto Fail1; name_strings[n][len] = '\0'; } + + if ( n < num_names ) + { + FT_ERROR(( "load_format_20:" + " all entries in post table are already parsed," + " using NULL names for gid %d - %d\n", + n, num_names - 1 )); + for ( ; n < num_names; n++ ) + if ( FT_NEW_ARRAY( name_strings[n], 1 ) ) + goto Fail1; + else + name_strings[n][0] = '\0'; + } } /* all right, set table fields and exit successfully */ @@ -271,7 +306,8 @@ static FT_Error load_format_25( TT_Face face, - FT_Stream stream ) + FT_Stream stream, + FT_Long post_limit ) { FT_Memory memory = stream->memory; FT_Error error; @@ -279,6 +315,8 @@ FT_Int num_glyphs; FT_Char* offset_table = 0; + FT_UNUSED( post_limit ); + /* UNDOCUMENTED! This value appears only in the Apple TT specs. */ if ( FT_READ_USHORT( num_glyphs ) ) @@ -338,16 +376,20 @@ FT_Stream stream; FT_Error error; FT_Fixed format; + FT_ULong post_len; + FT_Long post_limit; /* get a stream for the face's resource */ stream = face->root.stream; /* seek to the beginning of the PS names table */ - error = face->goto_table( face, TTAG_post, stream, 0 ); + error = face->goto_table( face, TTAG_post, stream, &post_len ); if ( error ) goto Exit; + post_limit = FT_STREAM_POS() + post_len; + format = face->postscript.FormatType; /* go to beginning of subtable */ @@ -356,9 +398,9 @@ /* now read postscript table */ if ( format == 0x00020000L ) - error = load_format_20( face, stream ); + error = load_format_20( face, stream, post_limit ); else if ( format == 0x00028000L ) - error = load_format_25( face, stream ); + error = load_format_25( face, stream, post_limit ); else error = SFNT_Err_Invalid_File_Format; diff --git a/lib/3rdparty/freetype/src/sfnt/ttsbit.c b/lib/3rdparty/freetype/src/sfnt/ttsbit.c index 833bb2add29..faa8f88fd7c 100644 --- a/lib/3rdparty/freetype/src/sfnt/ttsbit.c +++ b/lib/3rdparty/freetype/src/sfnt/ttsbit.c @@ -4,7 +4,8 @@ /* */ /* TrueType and OpenType embedded bitmap support (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */ +/* 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -417,7 +418,7 @@ tt_face_load_eblc( TT_Face face, FT_Stream stream ) { - FT_Error error = 0; + FT_Error error = SFNT_Err_Ok; FT_Memory memory = stream->memory; FT_Fixed version; FT_ULong num_strikes; diff --git a/lib/3rdparty/freetype/src/smooth/ftgrays.c b/lib/3rdparty/freetype/src/smooth/ftgrays.c index 846e454e667..a85e16086e7 100644 --- a/lib/3rdparty/freetype/src/smooth/ftgrays.c +++ b/lib/3rdparty/freetype/src/smooth/ftgrays.c @@ -4,7 +4,7 @@ /* */ /* A new `perfect' anti-aliasing renderer (body). */ /* */ -/* Copyright 2000-2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009 by */ +/* Copyright 2000-2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -103,10 +103,12 @@ #include #endif +#include #include #include #include #define FT_UINT_MAX UINT_MAX +#define FT_INT_MAX INT_MAX #define ft_memset memset @@ -114,6 +116,8 @@ #define ft_longjmp longjmp #define ft_jmp_buf jmp_buf +typedef ptrdiff_t FT_PtrDist; + #define ErrRaster_Invalid_Mode -2 #define ErrRaster_Invalid_Outline -1 @@ -183,7 +187,7 @@ shift_, \ delta_ \ }; - + #define FT_DEFINE_RASTER_FUNCS( class_, glyph_format_, \ raster_new_, raster_reset_, \ raster_set_mode_, raster_render_, \ @@ -350,8 +354,6 @@ int band_size; int band_shoot; - int conic_level; - int cubic_level; ft_jmp_buf jump_buffer; @@ -875,47 +877,7 @@ FT_Vector* arc; - dx = DOWNSCALE( ras.x ) + to->x - ( control->x << 1 ); - if ( dx < 0 ) - dx = -dx; - dy = DOWNSCALE( ras.y ) + to->y - ( control->y << 1 ); - if ( dy < 0 ) - dy = -dy; - if ( dx < dy ) - dx = dy; - - level = 1; - dx = dx / ras.conic_level; - while ( dx > 0 ) - { - dx >>= 2; - level++; - } - - /* a shortcut to speed things up */ - if ( level <= 1 ) - { - /* we compute the mid-point directly in order to avoid */ - /* calling gray_split_conic() */ - TPos to_x, to_y, mid_x, mid_y; - - - to_x = UPSCALE( to->x ); - to_y = UPSCALE( to->y ); - mid_x = ( ras.x + to_x + 2 * UPSCALE( control->x ) ) / 4; - mid_y = ( ras.y + to_y + 2 * UPSCALE( control->y ) ) / 4; - - gray_render_line( RAS_VAR_ mid_x, mid_y ); - gray_render_line( RAS_VAR_ to_x, to_y ); - - return; - } - - arc = ras.bez_stack; - levels = ras.lev_stack; - top = 0; - levels[0] = level; - + arc = ras.bez_stack; arc[0].x = UPSCALE( to->x ); arc[0].y = UPSCALE( to->y ); arc[1].x = UPSCALE( control->x ); @@ -923,6 +885,28 @@ arc[2].x = ras.x; arc[2].y = ras.y; + dx = FT_ABS( arc[2].x + arc[0].x - 2 * arc[1].x ); + dy = FT_ABS( arc[2].y + arc[0].y - 2 * arc[1].y ); + if ( dx < dy ) + dx = dy; + + if ( dx <= ONE_PIXEL / 4 ) + { + gray_render_line( RAS_VAR_ arc[0].x, arc[0].y ); + return; + } + + level = 0; + while ( dx > ONE_PIXEL / 4 ) + { + dx >>= 2; + level++; + } + + levels = ras.lev_stack; + levels[0] = level; + top = 0; + while ( top >= 0 ) { level = levels[top]; @@ -953,21 +937,9 @@ } Draw: - { - TPos to_x, to_y, mid_x, mid_y; - - - to_x = arc[0].x; - to_y = arc[0].y; - mid_x = ( ras.x + to_x + 2 * arc[1].x ) / 4; - mid_y = ( ras.y + to_y + 2 * arc[1].y ) / 4; - - gray_render_line( RAS_VAR_ mid_x, mid_y ); - gray_render_line( RAS_VAR_ to_x, to_y ); - - top--; - arc -= 2; - } + gray_render_line( RAS_VAR_ arc[0].x, arc[0].y ); + top--; + arc -= 2; } return; @@ -1007,59 +979,9 @@ const FT_Vector* control2, const FT_Vector* to ) { - TPos dx, dy, da, db; - int top, level; - int* levels; FT_Vector* arc; - dx = DOWNSCALE( ras.x ) + to->x - ( control1->x << 1 ); - if ( dx < 0 ) - dx = -dx; - dy = DOWNSCALE( ras.y ) + to->y - ( control1->y << 1 ); - if ( dy < 0 ) - dy = -dy; - if ( dx < dy ) - dx = dy; - da = dx; - - dx = DOWNSCALE( ras.x ) + to->x - 3 * ( control1->x + control2->x ); - if ( dx < 0 ) - dx = -dx; - dy = DOWNSCALE( ras.y ) + to->y - 3 * ( control1->x + control2->y ); - if ( dy < 0 ) - dy = -dy; - if ( dx < dy ) - dx = dy; - db = dx; - - level = 1; - da = da / ras.cubic_level; - db = db / ras.conic_level; - while ( da > 0 || db > 0 ) - { - da >>= 2; - db >>= 3; - level++; - } - - if ( level <= 1 ) - { - TPos to_x, to_y, mid_x, mid_y; - - - to_x = UPSCALE( to->x ); - to_y = UPSCALE( to->y ); - mid_x = ( ras.x + to_x + - 3 * UPSCALE( control1->x + control2->x ) ) / 8; - mid_y = ( ras.y + to_y + - 3 * UPSCALE( control1->y + control2->y ) ) / 8; - - gray_render_line( RAS_VAR_ mid_x, mid_y ); - gray_render_line( RAS_VAR_ to_x, to_y ); - return; - } - arc = ras.bez_stack; arc[0].x = UPSCALE( to->x ); arc[0].y = UPSCALE( to->y ); @@ -1070,60 +992,129 @@ arc[3].x = ras.x; arc[3].y = ras.y; - levels = ras.lev_stack; - top = 0; - levels[0] = level; - - while ( top >= 0 ) + for (;;) { - level = levels[top]; - if ( level > 1 ) + /* Check that the arc crosses the current band. */ + TPos min, max, y; + + + min = max = arc[0].y; + + y = arc[1].y; + if ( y < min ) + min = y; + if ( y > max ) + max = y; + + y = arc[2].y; + if ( y < min ) + min = y; + if ( y > max ) + max = y; + + y = arc[3].y; + if ( y < min ) + min = y; + if ( y > max ) + max = y; + + if ( TRUNC( min ) >= ras.max_ey || TRUNC( max ) < ras.min_ey ) + goto Draw; + + /* Decide whether to split or draw. See `Rapid Termination */ + /* Evaluation for Recursive Subdivision of Bezier Curves' by Thomas */ + /* F. Hain, at */ + /* http://www.cis.southalabama.edu/~hain/general/Publications/Bezier/Camera-ready%20CISST02%202.pdf */ + { - /* check that the arc crosses the current band */ - TPos min, max, y; + TPos dx, dy, dx_, dy_; + TPos dx1, dy1, dx2, dy2; + TPos L, s, s_limit; - min = max = arc[0].y; - y = arc[1].y; - if ( y < min ) min = y; - if ( y > max ) max = y; - y = arc[2].y; - if ( y < min ) min = y; - if ( y > max ) max = y; - y = arc[3].y; - if ( y < min ) min = y; - if ( y > max ) max = y; - if ( TRUNC( min ) >= ras.max_ey || TRUNC( max ) < 0 ) - goto Draw; - gray_split_cubic( arc ); - arc += 3; - top ++; - levels[top] = levels[top - 1] = level - 1; - continue; + /* dx and dy are x and y components of the P0-P3 chord vector. */ + dx = arc[3].x - arc[0].x; + dy = arc[3].y - arc[0].y; + + /* L is an (under)estimate of the Euclidean distance P0-P3. */ + /* */ + /* If dx >= dy, then r = sqrt(dx^2 + dy^2) can be overestimated */ + /* with least maximum error by */ + /* */ + /* r_upperbound = dx + (sqrt(2) - 1) * dy , */ + /* */ + /* where sqrt(2) - 1 can be (over)estimated by 107/256, giving an */ + /* error of no more than 8.4%. */ + /* */ + /* Similarly, some elementary calculus shows that r can be */ + /* underestimated with least maximum error by */ + /* */ + /* r_lowerbound = sqrt(2 + sqrt(2)) / 2 * dx */ + /* + sqrt(2 - sqrt(2)) / 2 * dy . */ + /* */ + /* 236/256 and 97/256 are (under)estimates of the two algebraic */ + /* numbers, giving an error of no more than 8.1%. */ + + dx_ = FT_ABS( dx ); + dy_ = FT_ABS( dy ); + + /* This is the same as */ + /* */ + /* L = ( 236 * FT_MAX( dx_, dy_ ) */ + /* + 97 * FT_MIN( dx_, dy_ ) ) >> 8; */ + L = ( dx_ > dy_ ? 236 * dx_ + 97 * dy_ + : 97 * dx_ + 236 * dy_ ) >> 8; + + /* Avoid possible arithmetic overflow below by splitting. */ + if ( L > 32767 ) + goto Split; + + /* Max deviation may be as much as (s/L) * 3/4 (if Hain's v = 1). */ + s_limit = L * (TPos)( ONE_PIXEL / 6 ); + + /* s is L * the perpendicular distance from P1 to the line P0-P3. */ + dx1 = arc[1].x - arc[0].x; + dy1 = arc[1].y - arc[0].y; + s = FT_ABS( dy * dx1 - dx * dy1 ); + + if ( s > s_limit ) + goto Split; + + /* s is L * the perpendicular distance from P2 to the line P0-P3. */ + dx2 = arc[2].x - arc[0].x; + dy2 = arc[2].y - arc[0].y; + s = FT_ABS( dy * dx2 - dx * dy2 ); + + if ( s > s_limit ) + goto Split; + + /* If P1 or P2 is outside P0-P3, split the curve. */ + if ( dy * dy1 + dx * dx1 < 0 || + dy * dy2 + dx * dx2 < 0 || + dy * (arc[3].y - arc[1].y) + dx * (arc[3].x - arc[1].x) < 0 || + dy * (arc[3].y - arc[2].y) + dx * (arc[3].x - arc[2].x) < 0 ) + goto Split; + + /* No reason to split. */ + goto Draw; } + Split: + gray_split_cubic( arc ); + arc += 3; + continue; + Draw: - { - TPos to_x, to_y, mid_x, mid_y; + gray_render_line( RAS_VAR_ arc[0].x, arc[0].y ); + if ( arc == ras.bez_stack ) + return; - to_x = arc[0].x; - to_y = arc[0].y; - mid_x = ( ras.x + to_x + 3 * ( arc[1].x + arc[2].x ) ) / 8; - mid_y = ( ras.y + to_y + 3 * ( arc[1].y + arc[2].y ) ) / 8; - - gray_render_line( RAS_VAR_ mid_x, mid_y ); - gray_render_line( RAS_VAR_ to_x, to_y ); - top --; - arc -= 3; - } + arc -= 3; } - - return; } - static int gray_move_to( const FT_Vector* to, PWorker worker ) @@ -1189,7 +1180,7 @@ /* first of all, compute the scanline offset */ p = (unsigned char*)map->buffer - y * map->pitch; if ( map->pitch >= 0 ) - p += ( map->rows - 1 ) * map->pitch; + p += (unsigned)( ( map->rows - 1 ) * map->pitch ); for ( ; count > 0; count--, spans++ ) { @@ -1759,25 +1750,6 @@ ras.count_ex = ras.max_ex - ras.min_ex; ras.count_ey = ras.max_ey - ras.min_ey; - /* simple heuristic used to speed up the bezier decomposition -- see */ - /* the code in gray_render_conic() and gray_render_cubic() for more */ - /* details */ - ras.conic_level = 32; - ras.cubic_level = 16; - - { - int level = 0; - - - if ( ras.count_ex > 24 || ras.count_ey > 24 ) - level++; - if ( ras.count_ex > 120 || ras.count_ey > 120 ) - level++; - - ras.conic_level <<= level; - ras.cubic_level <<= level; - } - /* set up vertical bands */ num_bands = (int)( ( ras.max_ey - ras.min_ey ) / ras.band_size ); if ( num_bands == 0 ) @@ -2003,14 +1975,14 @@ FT_UNUSED( raster ); } -#else /* _STANDALONE_ */ +#else /* !_STANDALONE_ */ static int gray_raster_new( FT_Memory memory, FT_Raster* araster ) { FT_Error error; - PRaster raster; + PRaster raster = NULL; *araster = 0; @@ -2033,7 +2005,7 @@ FT_FREE( raster ); } -#endif /* _STANDALONE_ */ +#endif /* !_STANDALONE_ */ static void diff --git a/lib/3rdparty/freetype/src/smooth/ftsmooth.c b/lib/3rdparty/freetype/src/smooth/ftsmooth.c index eed63531572..eb12f1802e8 100644 --- a/lib/3rdparty/freetype/src/smooth/ftsmooth.c +++ b/lib/3rdparty/freetype/src/smooth/ftsmooth.c @@ -4,7 +4,7 @@ /* */ /* Anti-aliasing renderer interface (body). */ /* */ -/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2009 by */ +/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -140,8 +140,26 @@ cbox.xMax = FT_PIX_CEIL( cbox.xMax ); cbox.yMax = FT_PIX_CEIL( cbox.yMax ); - width = (FT_UInt)( ( cbox.xMax - cbox.xMin ) >> 6 ); - height = (FT_UInt)( ( cbox.yMax - cbox.yMin ) >> 6 ); + if ( cbox.xMin < 0 && cbox.xMax > FT_INT_MAX + cbox.xMin ) + { + FT_ERROR(( "ft_smooth_render_generic: glyph too large:" + " xMin = %d, xMax = %d\n", + cbox.xMin >> 6, cbox.xMax >> 6 )); + return Smooth_Err_Raster_Overflow; + } + else + width = (FT_UInt)( ( cbox.xMax - cbox.xMin ) >> 6 ); + + if ( cbox.yMin < 0 && cbox.yMax > FT_INT_MAX + cbox.yMin ) + { + FT_ERROR(( "ft_smooth_render_generic: glyph too large:" + " yMin = %d, yMax = %d\n", + cbox.yMin >> 6, cbox.yMax >> 6 )); + return Smooth_Err_Raster_Overflow; + } + else + height = (FT_UInt)( ( cbox.yMax - cbox.yMin ) >> 6 ); + bitmap = &slot->bitmap; memory = render->root.memory; @@ -200,9 +218,9 @@ /* Required check is ( pitch * height < FT_ULONG_MAX ), */ /* but we care realistic cases only. Always pitch <= width. */ - if ( width > 0xFFFFU || height > 0xFFFFU ) + if ( width > 0x7FFFU || height > 0x7FFFU ) { - FT_ERROR(( "ft_smooth_render_generic: glyph too large: %d x %d\n", + FT_ERROR(( "ft_smooth_render_generic: glyph too large: %u x %u\n", width, height )); return Smooth_Err_Raster_Overflow; } diff --git a/lib/3rdparty/freetype/src/smooth/ftspic.c b/lib/3rdparty/freetype/src/smooth/ftspic.c index aa547fceb6d..7adaab17d2f 100644 --- a/lib/3rdparty/freetype/src/smooth/ftspic.c +++ b/lib/3rdparty/freetype/src/smooth/ftspic.c @@ -4,7 +4,7 @@ /* */ /* The FreeType position independent code services for smooth module. */ /* */ -/* Copyright 2009 by */ +/* Copyright 2009, 2010 by */ /* Oran Agra and Mickey Gabel. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -43,12 +43,13 @@ FT_Error - ft_smooth_renderer_class_pic_init( FT_Library library ) + ft_smooth_renderer_class_pic_init( FT_Library library ) { - FT_PIC_Container* pic_container = &library->pic_container; - FT_Error error = FT_Err_Ok; - SmoothPIC* container; - FT_Memory memory = library->memory; + FT_PIC_Container* pic_container = &library->pic_container; + FT_Error error = Smooth_Err_Ok; + SmoothPIC* container; + FT_Memory memory = library->memory; + /* since this function also serve smooth_lcd and smooth_lcdv renderers, it implements reference counting */ diff --git a/lib/3rdparty/freetype/src/tools/apinames.c b/lib/3rdparty/freetype/src/tools/apinames.c index 7f191e19c91..99e3028c934 100644 --- a/lib/3rdparty/freetype/src/tools/apinames.c +++ b/lib/3rdparty/freetype/src/tools/apinames.c @@ -10,7 +10,7 @@ * accepted if you are using GCC for compilation (and probably by * other compilers too). * - * Author: David Turner, 2005, 2006, 2008, 2009 + * Author: David Turner, 2005, 2006, 2008, 2009, 2010 * * This code is explicitly placed into the public domain. * @@ -126,6 +126,7 @@ names_dump( FILE* out, { int nn; + switch ( format ) { case OUTPUT_WINDOWS_DEF: @@ -151,22 +152,25 @@ names_dump( FILE* out, case OUTPUT_WATCOM_LBC: { /* we must omit the .dll suffix from the library name */ - char temp[512]; - char* dot; + char temp[512]; + const char* dot; + if ( dll_name == NULL ) { fprintf( stderr, - "you must provide a DLL name with the -d option !!\n" ); - exit(4); + "you must provide a DLL name with the -d option!\n" ); + exit( 4 ); } dot = strchr( dll_name, '.' ); if ( dot != NULL ) { - int len = (dot - dll_name); - if ( len > (int)(sizeof(temp)-1) ) - len = sizeof(temp)-1; + int len = dot - dll_name; + + + if ( len > (int)( sizeof( temp ) - 1 ) ) + len = sizeof ( temp ) - 1; memcpy( temp, dll_name, len ); temp[len] = 0; diff --git a/lib/3rdparty/freetype/src/truetype/ttgload.c b/lib/3rdparty/freetype/src/truetype/ttgload.c index 57ea0baa770..3a69b7be8d2 100644 --- a/lib/3rdparty/freetype/src/truetype/ttgload.c +++ b/lib/3rdparty/freetype/src/truetype/ttgload.c @@ -161,8 +161,31 @@ &top_bearing, &advance_height ); + loader->left_bearing = left_bearing; + loader->advance = advance_width; + loader->top_bearing = top_bearing; + loader->vadvance = advance_height; + + if ( !loader->linear_def ) + { + loader->linear_def = 1; + loader->linear = advance_width; + } + } + + #ifdef FT_CONFIG_OPTION_INCREMENTAL + static void + tt_get_metrics_incr_overrides( TT_Loader loader, + FT_UInt glyph_index ) + { + TT_Face face = (TT_Face)loader->face; + + FT_Short left_bearing = 0, top_bearing = 0; + FT_UShort advance_width = 0, advance_height = 0; + + /* If this is an incrementally loaded font check whether there are */ /* overriding metrics for this glyph. */ if ( face->root.internal->incremental_interface && @@ -172,9 +195,9 @@ FT_Error error; - metrics.bearing_x = left_bearing; + metrics.bearing_x = loader->left_bearing; metrics.bearing_y = 0; - metrics.advance = advance_width; + metrics.advance = loader->advance; metrics.advance_v = 0; error = face->root.internal->incremental_interface->funcs->get_glyph_metrics( @@ -190,8 +213,8 @@ /* GWW: Do I do the same for vertical metrics? */ metrics.bearing_x = 0; - metrics.bearing_y = top_bearing; - metrics.advance = advance_height; + metrics.bearing_y = loader->top_bearing; + metrics.advance = loader->vadvance; error = face->root.internal->incremental_interface->funcs->get_glyph_metrics( face->root.internal->incremental_interface->object, @@ -204,24 +227,24 @@ #endif /* 0 */ + loader->left_bearing = left_bearing; + loader->advance = advance_width; + loader->top_bearing = top_bearing; + loader->vadvance = advance_height; + + if ( !loader->linear_def ) + { + loader->linear_def = 1; + loader->linear = advance_width; + } } Exit: + return; + } #endif /* FT_CONFIG_OPTION_INCREMENTAL */ - loader->left_bearing = left_bearing; - loader->advance = advance_width; - loader->top_bearing = top_bearing; - loader->vadvance = advance_height; - - if ( !loader->linear_def ) - { - loader->linear_def = 1; - loader->linear = advance_width; - } - } - /*************************************************************************/ /* */ @@ -271,7 +294,7 @@ FT_UNUSED( glyph_index ); - FT_TRACE5(( "Glyph %ld\n", glyph_index )); + FT_TRACE4(( "Glyph %ld\n", glyph_index )); /* the following line sets the `error' variable through macros! */ if ( FT_STREAM_SEEK( offset ) || FT_FRAME_ENTER( byte_count ) ) @@ -367,7 +390,7 @@ if ( cont[0] <= prev_cont ) { /* unordered contours: this is invalid */ - error = FT_Err_Invalid_Table; + error = TT_Err_Invalid_Table; goto Fail; } prev_cont = cont[0]; @@ -1118,7 +1141,8 @@ { FT_Stream stream = loader->stream; - FT_UShort n_ins; + FT_UShort n_ins, max_ins; + FT_ULong tmp; /* TT_Load_Composite_Glyph only gives us the offset of instructions */ @@ -1130,12 +1154,27 @@ FT_TRACE5(( " Instructions size = %d\n", n_ins )); /* check it */ - if ( n_ins > ((TT_Face)loader->face)->max_profile.maxSizeOfInstructions ) + max_ins = ((TT_Face)loader->face)->max_profile.maxSizeOfInstructions; + if ( n_ins > max_ins ) { - FT_TRACE0(( "TT_Process_Composite_Glyph: too many instructions (%d)\n", - n_ins )); + /* acroread ignores this field, so we only do a rough safety check */ + if ( (FT_Int)n_ins > loader->byte_len ) + { + FT_TRACE1(( "TT_Process_Composite_Glyph: " + "too many instructions (%d) for glyph with length %d\n", + n_ins, loader->byte_len )); + return TT_Err_Too_Many_Hints; + } - return TT_Err_Too_Many_Hints; + tmp = loader->exec->glyphSize; + error = Update_Max( loader->exec->memory, + &tmp, + sizeof ( FT_Byte ), + (void*)&loader->exec->glyphIns, + n_ins ); + loader->exec->glyphSize = (FT_UShort)tmp; + if ( error ) + return error; } else if ( n_ins == 0 ) return TT_Err_Ok; @@ -1316,8 +1355,14 @@ if ( header_only ) goto Exit; + /* must initialize points before (possibly) overriding */ + /* glyph metrics from the incremental interface */ TT_LOADER_SET_PP( loader ); +#ifdef FT_CONFIG_OPTION_INCREMENTAL + tt_get_metrics_incr_overrides( loader, glyph_index ); +#endif + #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT if ( ((TT_Face)(loader->face))->doblend ) @@ -1353,8 +1398,14 @@ goto Exit; } + /* must initialize points before (possibly) overriding */ + /* glyph metrics from the incremental interface */ TT_LOADER_SET_PP( loader ); +#ifdef FT_CONFIG_OPTION_INCREMENTAL + tt_get_metrics_incr_overrides( loader, glyph_index ); +#endif + /***********************************************************************/ /***********************************************************************/ /***********************************************************************/ @@ -1481,6 +1532,7 @@ FT_UInt num_base_subgs = gloader->base.num_subglyphs; FT_Stream old_stream = loader->stream; + FT_Int old_byte_len = loader->byte_len; FT_GlyphLoader_Add( gloader ); @@ -1535,7 +1587,8 @@ num_base_points ); } - loader->stream = old_stream; + loader->stream = old_stream; + loader->byte_len = old_byte_len; /* process the glyph */ loader->ins_pos = ins_pos; @@ -1857,6 +1910,9 @@ FT_UInt i; + FT_TRACE4(( "tt_loader_init: grayscale change," + " re-executing `prep' table\n" )); + exec->grayscale = grayscale; for ( i = 0; i < size->cvt_size; i++ ) @@ -2031,9 +2087,11 @@ glyph->outline = loader.gloader->base.outline; glyph->outline.flags &= ~FT_OUTLINE_SINGLE_PASS; - /* In case bit 1 of the `flags' field in the `head' table isn't */ - /* set, translate array so that (0,0) is the glyph's origin. */ - if ( ( face->header.Flags & 2 ) == 0 && loader.pp1.x ) + /* Translate array so that (0,0) is the glyph's origin. Note */ + /* that this behaviour is independent on the value of bit 1 of */ + /* the `flags' field in the `head' table -- at least major */ + /* applications like Acroread indicate that. */ + if ( loader.pp1.x ) FT_Outline_Translate( &glyph->outline, -loader.pp1.x, 0 ); } diff --git a/lib/3rdparty/freetype/src/truetype/ttgxvar.c b/lib/3rdparty/freetype/src/truetype/ttgxvar.c index ef25aafb5bf..47bb9fcca44 100644 --- a/lib/3rdparty/freetype/src/truetype/ttgxvar.c +++ b/lib/3rdparty/freetype/src/truetype/ttgxvar.c @@ -4,7 +4,7 @@ /* */ /* TrueType GX Font Variation loader */ /* */ -/* Copyright 2004, 2005, 2006, 2007, 2008, 2009 by */ +/* Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010 by */ /* David Turner, Robert Wilhelm, Werner Lemberg, and George Williams. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -130,7 +130,7 @@ FT_Int j; FT_Int first; FT_Memory memory = stream->memory; - FT_Error error = TT_Err_Ok; + FT_Error error = TT_Err_Ok; FT_UNUSED( error ); @@ -154,7 +154,7 @@ runcnt = runcnt & GX_PT_POINT_RUN_COUNT_MASK; first = points[i++] = FT_GET_USHORT(); - if ( runcnt < 1 ) + if ( runcnt < 1 || i + runcnt >= n ) goto Exit; /* first point not included in runcount */ @@ -165,7 +165,7 @@ { first = points[i++] = FT_GET_BYTE(); - if ( runcnt < 1 ) + if ( runcnt < 1 || i + runcnt >= n ) goto Exit; for ( j = 0; j < runcnt; ++j ) @@ -210,12 +210,12 @@ ft_var_readpackeddeltas( FT_Stream stream, FT_Offset delta_cnt ) { - FT_Short *deltas; + FT_Short *deltas = NULL; FT_UInt runcnt; FT_Offset i; FT_UInt j; FT_Memory memory = stream->memory; - FT_Error error = TT_Err_Ok; + FT_Error error = TT_Err_Ok; FT_UNUSED( error ); @@ -682,7 +682,11 @@ if ( fvar_head.version != (FT_Long)0x00010000L || fvar_head.countSizePairs != 2 || fvar_head.axisSize != 20 || + /* axisCount limit implied by 16-bit instanceSize */ + fvar_head.axisCount > 0x3FFE || fvar_head.instanceSize != 4 + 4 * fvar_head.axisCount || + /* instanceCount limit implied by limited range of name IDs */ + fvar_head.instanceCount > 0x7EFF || fvar_head.offsetToData + fvar_head.axisCount * 20U + fvar_head.instanceCount * fvar_head.instanceSize > table_len ) { @@ -693,7 +697,7 @@ if ( FT_NEW( face->blend ) ) goto Exit; - /* XXX: TODO - check for overflows */ + /* cannot overflow 32-bit arithmetic because of limits above */ face->blend->mmvar_len = sizeof ( FT_MM_Var ) + fvar_head.axisCount * sizeof ( FT_Var_Axis ) + diff --git a/lib/3rdparty/freetype/src/truetype/ttinterp.c b/lib/3rdparty/freetype/src/truetype/ttinterp.c index 13aa9a27c4c..f55b8eeabfe 100644 --- a/lib/3rdparty/freetype/src/truetype/ttinterp.c +++ b/lib/3rdparty/freetype/src/truetype/ttinterp.c @@ -4,8 +4,9 @@ /* */ /* TrueType bytecode interpreter (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */ +/* 2010 */ +/* by David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ @@ -223,9 +224,10 @@ /*************************************************************************/ /* */ - /* A simple bounds-checking macro. */ + /* Two simple bounds-checking macros. */ /* */ -#define BOUNDS( x, n ) ( (FT_UInt)(x) >= (FT_UInt)(n) ) +#define BOUNDS( x, n ) ( (FT_UInt)(x) >= (FT_UInt)(n) ) +#define BOUNDSL( x, n ) ( (FT_ULong)(x) >= (FT_ULong)(n) ) #undef SUCCESS #define SUCCESS 0 @@ -476,8 +478,7 @@ return TT_Err_Ok; Fail_Memory: - FT_ERROR(( "Init_Context: not enough memory for 0x%08lx\n", - (FT_Long)exec )); + FT_ERROR(( "Init_Context: not enough memory for %p\n", exec )); TT_Done_Context( exec ); return error; @@ -508,7 +509,7 @@ /* */ /* FreeType error code. 0 means success. */ /* */ - static FT_Error + FT_LOCAL_DEF( FT_Error ) Update_Max( FT_Memory memory, FT_ULong* size, FT_Long multiplier, @@ -594,6 +595,12 @@ exec->storage = size->storage; exec->twilight = size->twilight; + + /* In case of multi-threading it can happen that the old size object */ + /* no longer exists, thus we must clear all glyph zone references. */ + ft_memset( &exec->zp0, 0, sizeof ( exec->zp0 ) ); + exec->zp1 = exec->zp0; + exec->zp2 = exec->zp0; } /* XXX: We reserve a little more elements on the stack to deal safely */ @@ -1111,6 +1118,287 @@ }; +#ifdef FT_DEBUG_LEVEL_TRACE + + static + const char* const opcode_name[256] = + { + "SVTCA y", + "SVTCA x", + "SPvTCA y", + "SPvTCA x", + "SFvTCA y", + "SFvTCA x", + "SPvTL ||", + "SPvTL +", + "SFvTL ||", + "SFvTL +", + "SPvFS", + "SFvFS", + "GPV", + "GFV", + "SFvTPv", + "ISECT", + + "SRP0", + "SRP1", + "SRP2", + "SZP0", + "SZP1", + "SZP2", + "SZPS", + "SLOOP", + "RTG", + "RTHG", + "SMD", + "ELSE", + "JMPR", + "SCvTCi", + "SSwCi", + "SSW", + + "DUP", + "POP", + "CLEAR", + "SWAP", + "DEPTH", + "CINDEX", + "MINDEX", + "AlignPTS", + "INS_$28", + "UTP", + "LOOPCALL", + "CALL", + "FDEF", + "ENDF", + "MDAP[0]", + "MDAP[1]", + + "IUP[0]", + "IUP[1]", + "SHP[0]", + "SHP[1]", + "SHC[0]", + "SHC[1]", + "SHZ[0]", + "SHZ[1]", + "SHPIX", + "IP", + "MSIRP[0]", + "MSIRP[1]", + "AlignRP", + "RTDG", + "MIAP[0]", + "MIAP[1]", + + "NPushB", + "NPushW", + "WS", + "RS", + "WCvtP", + "RCvt", + "GC[0]", + "GC[1]", + "SCFS", + "MD[0]", + "MD[1]", + "MPPEM", + "MPS", + "FlipON", + "FlipOFF", + "DEBUG", + + "LT", + "LTEQ", + "GT", + "GTEQ", + "EQ", + "NEQ", + "ODD", + "EVEN", + "IF", + "EIF", + "AND", + "OR", + "NOT", + "DeltaP1", + "SDB", + "SDS", + + "ADD", + "SUB", + "DIV", + "MUL", + "ABS", + "NEG", + "FLOOR", + "CEILING", + "ROUND[0]", + "ROUND[1]", + "ROUND[2]", + "ROUND[3]", + "NROUND[0]", + "NROUND[1]", + "NROUND[2]", + "NROUND[3]", + + "WCvtF", + "DeltaP2", + "DeltaP3", + "DeltaCn[0]", + "DeltaCn[1]", + "DeltaCn[2]", + "SROUND", + "S45Round", + "JROT", + "JROF", + "ROFF", + "INS_$7B", + "RUTG", + "RDTG", + "SANGW", + "AA", + + "FlipPT", + "FlipRgON", + "FlipRgOFF", + "INS_$83", + "INS_$84", + "ScanCTRL", + "SDVPTL[0]", + "SDVPTL[1]", + "GetINFO", + "IDEF", + "ROLL", + "MAX", + "MIN", + "ScanTYPE", + "InstCTRL", + "INS_$8F", + + "INS_$90", + "INS_$91", + "INS_$92", + "INS_$93", + "INS_$94", + "INS_$95", + "INS_$96", + "INS_$97", + "INS_$98", + "INS_$99", + "INS_$9A", + "INS_$9B", + "INS_$9C", + "INS_$9D", + "INS_$9E", + "INS_$9F", + + "INS_$A0", + "INS_$A1", + "INS_$A2", + "INS_$A3", + "INS_$A4", + "INS_$A5", + "INS_$A6", + "INS_$A7", + "INS_$A8", + "INS_$A9", + "INS_$AA", + "INS_$AB", + "INS_$AC", + "INS_$AD", + "INS_$AE", + "INS_$AF", + + "PushB[0]", + "PushB[1]", + "PushB[2]", + "PushB[3]", + "PushB[4]", + "PushB[5]", + "PushB[6]", + "PushB[7]", + "PushW[0]", + "PushW[1]", + "PushW[2]", + "PushW[3]", + "PushW[4]", + "PushW[5]", + "PushW[6]", + "PushW[7]", + + "MDRP[00]", + "MDRP[01]", + "MDRP[02]", + "MDRP[03]", + "MDRP[04]", + "MDRP[05]", + "MDRP[06]", + "MDRP[07]", + "MDRP[08]", + "MDRP[09]", + "MDRP[10]", + "MDRP[11]", + "MDRP[12]", + "MDRP[13]", + "MDRP[14]", + "MDRP[15]", + + "MDRP[16]", + "MDRP[17]", + "MDRP[18]", + "MDRP[19]", + "MDRP[20]", + "MDRP[21]", + "MDRP[22]", + "MDRP[23]", + "MDRP[24]", + "MDRP[25]", + "MDRP[26]", + "MDRP[27]", + "MDRP[28]", + "MDRP[29]", + "MDRP[30]", + "MDRP[31]", + + "MIRP[00]", + "MIRP[01]", + "MIRP[02]", + "MIRP[03]", + "MIRP[04]", + "MIRP[05]", + "MIRP[06]", + "MIRP[07]", + "MIRP[08]", + "MIRP[09]", + "MIRP[10]", + "MIRP[11]", + "MIRP[12]", + "MIRP[13]", + "MIRP[14]", + "MIRP[15]", + + "MIRP[16]", + "MIRP[17]", + "MIRP[18]", + "MIRP[19]", + "MIRP[20]", + "MIRP[21]", + "MIRP[22]", + "MIRP[23]", + "MIRP[24]", + "MIRP[25]", + "MIRP[26]", + "MIRP[27]", + "MIRP[28]", + "MIRP[29]", + "MIRP[30]", + "MIRP[31]" + }; + +#endif /* FT_DEBUG_LEVEL_TRACE */ + + static const FT_Char opcode_length[256] = { @@ -1727,7 +2015,8 @@ if ( distance && val < 0 ) val = 0; } - else { + else + { val = distance - compensation; if ( val > 0 ) val = 0; @@ -2892,24 +3181,30 @@ } -#define DO_JROT \ - if ( args[1] != 0 ) \ - { \ - CUR.IP += args[0]; \ - CUR.step_ins = FALSE; \ +#define DO_JROT \ + if ( args[1] != 0 ) \ + { \ + CUR.IP += args[0]; \ + if ( CUR.IP < 0 ) \ + CUR.error = TT_Err_Bad_Argument; \ + CUR.step_ins = FALSE; \ } -#define DO_JMPR \ - CUR.IP += args[0]; \ +#define DO_JMPR \ + CUR.IP += args[0]; \ + if ( CUR.IP < 0 ) \ + CUR.error = TT_Err_Bad_Argument; \ CUR.step_ins = FALSE; -#define DO_JROF \ - if ( args[1] == 0 ) \ - { \ - CUR.IP += args[0]; \ - CUR.step_ins = FALSE; \ +#define DO_JROF \ + if ( args[1] == 0 ) \ + { \ + CUR.IP += args[0]; \ + if ( CUR.IP < 0 ) \ + CUR.error = TT_Err_Bad_Argument; \ + CUR.step_ins = FALSE; \ } @@ -2992,39 +3287,39 @@ args[0] = FT_PIX_CEIL( args[0] ); -#define DO_RS \ - { \ - FT_ULong I = (FT_ULong)args[0]; \ - \ - \ - if ( BOUNDS( I, CUR.storeSize ) ) \ - { \ - if ( CUR.pedantic_hinting ) \ - { \ - ARRAY_BOUND_ERROR; \ - } \ - else \ - args[0] = 0; \ - } \ - else \ - args[0] = CUR.storage[I]; \ +#define DO_RS \ + { \ + FT_ULong I = (FT_ULong)args[0]; \ + \ + \ + if ( BOUNDSL( I, CUR.storeSize ) ) \ + { \ + if ( CUR.pedantic_hinting ) \ + { \ + ARRAY_BOUND_ERROR; \ + } \ + else \ + args[0] = 0; \ + } \ + else \ + args[0] = CUR.storage[I]; \ } -#define DO_WS \ - { \ - FT_ULong I = (FT_ULong)args[0]; \ - \ - \ - if ( BOUNDS( I, CUR.storeSize ) ) \ - { \ - if ( CUR.pedantic_hinting ) \ - { \ - ARRAY_BOUND_ERROR; \ - } \ - } \ - else \ - CUR.storage[I] = args[1]; \ +#define DO_WS \ + { \ + FT_ULong I = (FT_ULong)args[0]; \ + \ + \ + if ( BOUNDSL( I, CUR.storeSize ) ) \ + { \ + if ( CUR.pedantic_hinting ) \ + { \ + ARRAY_BOUND_ERROR; \ + } \ + } \ + else \ + CUR.storage[I] = args[1]; \ } @@ -3033,7 +3328,7 @@ FT_ULong I = (FT_ULong)args[0]; \ \ \ - if ( BOUNDS( I, CUR.cvtSize ) ) \ + if ( BOUNDSL( I, CUR.cvtSize ) ) \ { \ if ( CUR.pedantic_hinting ) \ { \ @@ -3052,7 +3347,7 @@ FT_ULong I = (FT_ULong)args[0]; \ \ \ - if ( BOUNDS( I, CUR.cvtSize ) ) \ + if ( BOUNDSL( I, CUR.cvtSize ) ) \ { \ if ( CUR.pedantic_hinting ) \ { \ @@ -3069,7 +3364,7 @@ FT_ULong I = (FT_ULong)args[0]; \ \ \ - if ( BOUNDS( I, CUR.cvtSize ) ) \ + if ( BOUNDSL( I, CUR.cvtSize ) ) \ { \ if ( CUR.pedantic_hinting ) \ { \ @@ -4390,7 +4685,7 @@ /* first of all, check the index */ F = args[0]; - if ( BOUNDS( F, CUR.maxFunc + 1 ) ) + if ( BOUNDSL( F, CUR.maxFunc + 1 ) ) goto Fail; /* Except for some old Apple fonts, all functions in a TrueType */ @@ -4466,7 +4761,7 @@ /* first of all, check the index */ F = args[1]; - if ( BOUNDS( F, CUR.maxFunc + 1 ) ) + if ( BOUNDSL( F, CUR.maxFunc + 1 ) ) goto Fail; /* Except for some old Apple fonts, all functions in a TrueType */ @@ -4569,7 +4864,7 @@ } def->opc = (FT_Byte)args[0]; - def->start = CUR.IP+1; + def->start = CUR.IP + 1; def->range = CUR.curRange; def->active = TRUE; @@ -4741,7 +5036,7 @@ L = (FT_ULong)args[0]; - if ( BOUNDS( L, CUR.zp2.n_points ) ) + if ( BOUNDSL( L, CUR.zp2.n_points ) ) { if ( CUR.pedantic_hinting ) { @@ -4825,8 +5120,8 @@ K = (FT_UShort)args[1]; L = (FT_UShort)args[0]; - if( BOUNDS( L, CUR.zp0.n_points ) || - BOUNDS( K, CUR.zp1.n_points ) ) + if ( BOUNDS( L, CUR.zp0.n_points ) || + BOUNDS( K, CUR.zp1.n_points ) ) { if ( CUR.pedantic_hinting ) { @@ -5480,12 +5775,12 @@ static void Ins_SHZ( INS_ARG ) { - TT_GlyphZoneRec zp; - FT_UShort refp; - FT_F26Dot6 dx, - dy; + TT_GlyphZoneRec zp; + FT_UShort refp; + FT_F26Dot6 dx, + dy; - FT_UShort last_point, i; + FT_UShort last_point, i; if ( BOUNDS( args[0], 2 ) ) @@ -5505,7 +5800,16 @@ if ( CUR.GS.gep2 == 0 && CUR.zp2.n_points > 0 ) last_point = (FT_UShort)( CUR.zp2.n_points - 1 ); else if ( CUR.GS.gep2 == 1 && CUR.zp2.n_contours > 0 ) + { last_point = (FT_UShort)( CUR.zp2.contours[CUR.zp2.n_contours - 1] ); + + if ( BOUNDS( last_point, CUR.zp2.n_points ) ) + { + if ( CUR.pedantic_hinting ) + CUR.error = TT_Err_Invalid_Reference; + return; + } + } else last_point = 0; @@ -5687,8 +5991,8 @@ cvtEntry = (FT_ULong)args[1]; point = (FT_UShort)args[0]; - if ( BOUNDS( point, CUR.zp0.n_points ) || - BOUNDS( cvtEntry, CUR.cvtSize ) ) + if ( BOUNDS( point, CUR.zp0.n_points ) || + BOUNDSL( cvtEntry, CUR.cvtSize ) ) { if ( CUR.pedantic_hinting ) CUR.error = TT_Err_Invalid_Reference; @@ -5880,7 +6184,7 @@ /* XXX: UNDOCUMENTED! cvt[-1] = 0 always */ if ( BOUNDS( point, CUR.zp1.n_points ) || - BOUNDS( cvtEntry, CUR.cvtSize + 1 ) || + BOUNDSL( cvtEntry, CUR.cvtSize + 1 ) || BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) ) { if ( CUR.pedantic_hinting ) @@ -6131,8 +6435,8 @@ p1 = (FT_UShort)args[0]; p2 = (FT_UShort)args[1]; - if ( BOUNDS( args[0], CUR.zp1.n_points ) || - BOUNDS( args[1], CUR.zp0.n_points ) ) + if ( BOUNDS( p1, CUR.zp1.n_points ) || + BOUNDS( p2, CUR.zp0.n_points ) ) { if ( CUR.pedantic_hinting ) CUR.error = TT_Err_Invalid_Reference; @@ -6466,8 +6770,8 @@ end_point = CUR.pts.contours[contour] - CUR.pts.first_point; first_point = point; - if ( CUR.pts.n_points <= end_point ) - end_point = CUR.pts.n_points; + if ( BOUNDS ( end_point, CUR.pts.n_points ) ) + end_point = CUR.pts.n_points - 1; while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) point++; @@ -6483,12 +6787,11 @@ { if ( ( CUR.pts.tags[point] & mask ) != 0 ) { - if ( point > 0 ) - _iup_worker_interpolate( &V, - cur_touched + 1, - point - 1, - cur_touched, - point ); + _iup_worker_interpolate( &V, + cur_touched + 1, + point - 1, + cur_touched, + point ); cur_touched = point; } @@ -6661,7 +6964,7 @@ A = (FT_ULong)CUR.stack[CUR.args + 1]; B = CUR.stack[CUR.args]; - if ( BOUNDS( A, CUR.cvtSize ) ) + if ( BOUNDSL( A, CUR.cvtSize ) ) { if ( CUR.pedantic_hinting ) { @@ -6771,7 +7074,7 @@ call = CUR.callStack + CUR.callTop++; call->Caller_Range = CUR.curRange; - call->Caller_IP = CUR.IP+1; + call->Caller_IP = CUR.IP + 1; call->Cur_Count = 1; call->Cur_Restart = def->start; @@ -7140,6 +7443,10 @@ { CUR.opcode = CUR.code[CUR.IP]; + FT_TRACE7(( " " )); + FT_TRACE7(( opcode_name[CUR.opcode] )); + FT_TRACE7(( "\n" )); + if ( ( CUR.length = opcode_length[CUR.opcode] ) < 0 ) { if ( CUR.IP + 1 > CUR.codeSize ) @@ -7834,6 +8141,15 @@ *exc = cur; #endif + /* If any errors have occurred, function tables may be broken. */ + /* Force a re-execution of `prep' and `fpgm' tables if no */ + /* bytecode debugger is run. */ + if ( CUR.error && !CUR.instruction_trap ) + { + FT_TRACE1(( " The interpreter returned error 0x%x\n", CUR.error )); + exc->size->cvt_ready = FALSE; + } + return CUR.error; } diff --git a/lib/3rdparty/freetype/src/truetype/ttinterp.h b/lib/3rdparty/freetype/src/truetype/ttinterp.h index 07a8972cb3d..c480dfa506e 100644 --- a/lib/3rdparty/freetype/src/truetype/ttinterp.h +++ b/lib/3rdparty/freetype/src/truetype/ttinterp.h @@ -4,7 +4,7 @@ /* */ /* TrueType bytecode interpreter (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -150,7 +150,7 @@ FT_BEGIN_HEADER FT_Bool step_ins; /* true if the interpreter must */ /* increment IP after ins. exec */ - FT_Long cvtSize; + FT_ULong cvtSize; FT_Long* cvt; FT_UInt glyphSize; /* glyph instructions buffer size */ @@ -239,6 +239,14 @@ FT_BEGIN_HEADER FT_Int range ); + FT_LOCAL( FT_Error ) + Update_Max( FT_Memory memory, + FT_ULong* size, + FT_Long multiplier, + void* _pbuff, + FT_ULong new_max ); + + /*************************************************************************/ /* */ /* */ diff --git a/lib/3rdparty/freetype/src/truetype/ttobjs.c b/lib/3rdparty/freetype/src/truetype/ttobjs.c index 11d662d2d49..8fe86ad10ee 100644 --- a/lib/3rdparty/freetype/src/truetype/ttobjs.c +++ b/lib/3rdparty/freetype/src/truetype/ttobjs.c @@ -4,7 +4,8 @@ /* */ /* Objects manager (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */ +/* 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -146,28 +147,28 @@ /* This list shall be expanded as we find more of them. */ static FT_Bool - tt_check_trickyness( FT_String* name ) + tt_check_trickyness_family( FT_String* name ) { + #define TRICK_NAMES_MAX_CHARACTERS 16 -#define TRICK_NAMES_COUNT 7 - static const char trick_names[TRICK_NAMES_COUNT][TRICK_NAMES_MAX_CHARACTERS+1] = +#define TRICK_NAMES_COUNT 8 + + static const char trick_names[TRICK_NAMES_COUNT] + [TRICK_NAMES_MAX_CHARACTERS + 1] = { "DFKaiSho-SB", /* dfkaisb.ttf */ "DFKaiShu", "DFKai-SB", /* kaiu.ttf */ + "HuaTianKaiTi?", /* htkt2.ttf */ "HuaTianSongTi?", /* htst3.ttf */ "MingLiU", /* mingliu.ttf & mingliu.ttc */ "PMingLiU", /* mingliu.ttc */ "MingLi43", /* mingli.ttf */ }; + int nn; - if ( !name ) - return FALSE; - - /* Note that we only check the face name at the moment; it might */ - /* be worth to do more checks for a few special cases. */ for ( nn = 0; nn < TRICK_NAMES_COUNT; nn++ ) if ( ft_strstr( name, trick_names[nn] ) ) return TRUE; @@ -176,6 +177,181 @@ } + /* XXX: This function should be in the `sfnt' module. */ + + /* Some PDF generators clear the checksums in the TrueType header table. */ + /* For example, Quartz ContextPDF clears all entries, or Bullzip PDF */ + /* Printer clears the entries for subsetted subtables. We thus have to */ + /* recalculate the checksums where necessary. */ + + static FT_UInt32 + tt_synth_sfnt_checksum( FT_Stream stream, + FT_ULong length ) + { + FT_Error error; + FT_UInt32 checksum = 0; + int i; + + + if ( FT_FRAME_ENTER( length ) ) + return 0; + + for ( ; length > 3; length -= 4 ) + checksum += (FT_UInt32)FT_GET_ULONG(); + + for ( i = 3; length > 0; length --, i-- ) + checksum += (FT_UInt32)( FT_GET_BYTE() << ( i * 8 ) ); + + FT_FRAME_EXIT(); + + return checksum; + } + + + /* XXX: This function should be in the `sfnt' module. */ + + static FT_ULong + tt_get_sfnt_checksum( TT_Face face, + FT_UShort i ) + { + if ( face->dir_tables[i].CheckSum ) + return face->dir_tables[i].CheckSum; + + else if ( !face->goto_table ) + return 0; + + else if ( !face->goto_table( face, + face->dir_tables[i].Tag, + face->root.stream, + NULL ) ) + return 0; + + return (FT_ULong)tt_synth_sfnt_checksum( face->root.stream, + face->dir_tables[i].Length ); + } + + + typedef struct tt_sfnt_id_rec_ + { + FT_ULong CheckSum; + FT_ULong Length; + + } tt_sfnt_id_rec; + + + static FT_Bool + tt_check_trickyness_sfnt_ids( TT_Face face ) + { +#define TRICK_SFNT_IDS_PER_FACE 3 +#define TRICK_SFNT_IDS_NUM_FACES 5 + + static const tt_sfnt_id_rec sfnt_id[TRICK_SFNT_IDS_NUM_FACES] + [TRICK_SFNT_IDS_PER_FACE] = { + +#define TRICK_SFNT_ID_cvt 0 +#define TRICK_SFNT_ID_fpgm 1 +#define TRICK_SFNT_ID_prep 2 + + { /* MingLiU 1995 */ + { 0x05bcf058, 0x000002e4 }, /* cvt */ + { 0x28233bf1, 0x000087c4 }, /* fpgm */ + { 0xa344a1ea, 0x000001e1 } /* prep */ + }, + { /* MingLiU 1996- */ + { 0x05bcf058, 0x000002e4 }, /* cvt */ + { 0x28233bf1, 0x000087c4 }, /* fpgm */ + { 0xa344a1eb, 0x000001e1 } /* prep */ + }, + { /* DFKaiShu */ + { 0x11e5ead4, 0x00000350 }, /* cvt */ + { 0x5a30ca3b, 0x00009063 }, /* fpgm */ + { 0x13a42602, 0x0000007e } /* prep */ + }, + { /* HuaTianKaiTi */ + { 0xfffbfffc, 0x00000008 }, /* cvt */ + { 0x9c9e48b8, 0x0000bea2 }, /* fpgm */ + { 0x70020112, 0x00000008 } /* prep */ + }, + { /* HuaTianSongTi */ + { 0xfffbfffc, 0x00000008 }, /* cvt */ + { 0x0a5a0483, 0x00017c39 }, /* fpgm */ + { 0x70020112, 0x00000008 } /* prep */ + } + }; + + FT_ULong checksum; + int num_matched_ids[TRICK_SFNT_IDS_NUM_FACES]; + int i, j, k; + + + FT_MEM_SET( num_matched_ids, 0, + sizeof( int ) * TRICK_SFNT_IDS_NUM_FACES ); + + for ( i = 0; i < face->num_tables; i++ ) + { + checksum = 0; + + switch( face->dir_tables[i].Tag ) + { + case TTAG_cvt: + k = TRICK_SFNT_ID_cvt; + break; + + case TTAG_fpgm: + k = TRICK_SFNT_ID_fpgm; + break; + + case TTAG_prep: + k = TRICK_SFNT_ID_prep; + break; + + default: + continue; + } + + for ( j = 0; j < TRICK_SFNT_IDS_NUM_FACES; j++ ) + if ( face->dir_tables[i].Length == sfnt_id[j][k].Length ) + { + if ( !checksum ) + checksum = tt_get_sfnt_checksum( face, i ); + + if ( sfnt_id[j][k].CheckSum == checksum ) + num_matched_ids[j]++; + + if ( num_matched_ids[j] == TRICK_SFNT_IDS_PER_FACE ) + return TRUE; + } + } + + return FALSE; + } + + + static FT_Bool + tt_check_trickyness( FT_Face face ) + { + if ( !face ) + return FALSE; + + /* First, check the face name. */ + if ( face->family_name ) + { + if ( tt_check_trickyness_family( face->family_name ) ) + return TRUE; + else + return FALSE; + } + + /* Type42 fonts may lack `name' tables, we thus try to identify */ + /* tricky fonts by checking the checksums of Type42-persistent */ + /* sfnt tables (`cvt', `fpgm', and `prep'). */ + if ( tt_check_trickyness_sfnt_ids( (TT_Face)face ) ) + return TRUE; + + return FALSE; + } + + /*************************************************************************/ /* */ /* */ @@ -250,7 +426,7 @@ if ( error ) goto Exit; - if ( tt_check_trickyness( ttface->family_name ) ) + if ( tt_check_trickyness( ttface ) ) ttface->face_flags |= FT_FACE_FLAG_TRICKY; error = tt_face_load_hdmx( face, stream ); @@ -458,7 +634,11 @@ error = TT_Goto_CodeRange( exec, tt_coderange_font, 0 ); if ( !error ) + { + FT_TRACE4(( "Executing `fpgm' table.\n" )); + error = face->interpreter( exec ); + } } else error = TT_Err_Ok; @@ -520,7 +700,11 @@ error = TT_Goto_CodeRange( exec, tt_coderange_cvt, 0 ); if ( !error && !size->debug ) + { + FT_TRACE4(( "Executing `prep' table.\n" )); + error = face->interpreter( exec ); + } } else error = TT_Err_Ok; diff --git a/lib/3rdparty/freetype/src/truetype/ttpic.c b/lib/3rdparty/freetype/src/truetype/ttpic.c index 27ec4a1d5e5..5d725742c78 100644 --- a/lib/3rdparty/freetype/src/truetype/ttpic.c +++ b/lib/3rdparty/freetype/src/truetype/ttpic.c @@ -4,7 +4,7 @@ /* */ /* The FreeType position independent code services for truetype module. */ /* */ -/* Copyright 2009 by */ +/* Copyright 2009, 2010 by */ /* Oran Agra and Mickey Gabel. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -45,13 +45,15 @@ } } + FT_Error - tt_driver_class_pic_init( FT_Library library ) + tt_driver_class_pic_init( FT_Library library ) { - FT_PIC_Container* pic_container = &library->pic_container; - FT_Error error = FT_Err_Ok; - TTModulePIC* container; - FT_Memory memory = library->memory; + FT_PIC_Container* pic_container = &library->pic_container; + FT_Error error = TT_Err_Ok; + TTModulePIC* container; + FT_Memory memory = library->memory; + /* allocate pointer, clear and set global container pointer */ if ( FT_ALLOC ( container, sizeof ( *container ) ) ) diff --git a/lib/3rdparty/freetype/src/truetype/ttpload.c b/lib/3rdparty/freetype/src/truetype/ttpload.c index a311b03c00c..68a54531504 100644 --- a/lib/3rdparty/freetype/src/truetype/ttpload.c +++ b/lib/3rdparty/freetype/src/truetype/ttpload.c @@ -4,7 +4,7 @@ /* */ /* TrueType-specific tables loader (body). */ /* */ -/* Copyright 1996-2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009 by */ +/* Copyright 1996-2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -137,6 +137,12 @@ dist = diff; } + if ( entry == limit ) + { + /* `loca' is the last table */ + dist = stream->size - pos; + } + if ( new_loca_len <= dist ) { face->num_locations = face->root.num_glyphs; @@ -203,6 +209,26 @@ } } + /* Check broken location data */ + if ( pos1 >= face->glyf_len ) + { + FT_TRACE1(( "tt_face_get_location:" + " too large offset=0x%08lx found for gid=0x%04lx," + " exceeding the end of glyf table (0x%08lx)\n", + pos1, gindex, face->glyf_len )); + *asize = 0; + return 0; + } + + if ( pos2 >= face->glyf_len ) + { + FT_TRACE1(( "tt_face_get_location:" + " too large offset=0x%08lx found for gid=0x%04lx," + " truncate at the end of glyf table (0x%08lx)\n", + pos2, gindex + 1, face->glyf_len )); + pos2 = face->glyf_len; + } + /* The `loca' table must be ordered; it refers to the length of */ /* an entry as the difference between the current and the next */ /* position. However, there do exist (malformed) fonts which */ @@ -287,7 +313,7 @@ FT_Short* limit = cur + face->cvt_size; - for ( ; cur < limit; cur++ ) + for ( ; cur < limit; cur++ ) *cur = FT_GET_SHORT(); } diff --git a/lib/3rdparty/freetype/src/type1/t1afm.c b/lib/3rdparty/freetype/src/type1/t1afm.c index ef343901a44..780ab33bf7e 100644 --- a/lib/3rdparty/freetype/src/type1/t1afm.c +++ b/lib/3rdparty/freetype/src/type1/t1afm.c @@ -4,7 +4,8 @@ /* */ /* AFM support for Type 1 fonts (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */ +/* 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -235,10 +236,10 @@ FT_Stream stream ) { PSAux_Service psaux; - FT_Memory memory = stream->memory; + FT_Memory memory = stream->memory; AFM_ParserRec parser; - AFM_FontInfo fi; - FT_Error error = T1_Err_Unknown_File_Format; + AFM_FontInfo fi = NULL; + FT_Error error = T1_Err_Unknown_File_Format; T1_Font t1_font = &( (T1_Face)t1_face )->type1; diff --git a/lib/3rdparty/freetype/src/type1/t1load.c b/lib/3rdparty/freetype/src/type1/t1load.c index d867e942c95..c9b6c1d0a20 100644 --- a/lib/3rdparty/freetype/src/type1/t1load.c +++ b/lib/3rdparty/freetype/src/type1/t1load.c @@ -4,7 +4,8 @@ /* */ /* Type 1 font loader (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */ +/* 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -1045,7 +1046,8 @@ if ( cur < limit && ft_isdigit( *cur ) ) { - *size = T1_ToInt( parser ); + FT_Long s = T1_ToInt( parser ); + T1_Skip_PS_Token( parser ); /* `RD' or `-|' or something else */ @@ -1053,8 +1055,12 @@ /* `RD' or `-|' token */ *base = parser->root.cursor + 1; - parser->root.cursor += *size + 1; - return !parser->root.error; + if ( s >= 0 && s < limit - *base ) + { + parser->root.cursor += s + 1; + *size = s; + return !parser->root.error; + } } FT_ERROR(( "read_binary_data: invalid size field\n" )); @@ -1111,7 +1117,7 @@ temp[2] = FT_DivFix( temp[2], temp_scale ); temp[4] = FT_DivFix( temp[4], temp_scale ); temp[5] = FT_DivFix( temp[5], temp_scale ); - temp[3] = 0x10000L; + temp[3] = temp[3] < 0 ? -0x10000L : 0x10000L; } matrix->xx = temp[0]; @@ -2180,7 +2186,7 @@ /* OK, we do the following: for each element in the encoding */ /* table, look up the index of the glyph having the same name */ /* the index is then stored in type1.encoding.char_index, and */ - /* a the name to type1.encoding.char_name */ + /* the name to type1.encoding.char_name */ min_char = 0; max_char = 0; diff --git a/lib/3rdparty/freetype/src/type1/t1objs.c b/lib/3rdparty/freetype/src/type1/t1objs.c index b1de6871967..58632109c74 100644 --- a/lib/3rdparty/freetype/src/type1/t1objs.c +++ b/lib/3rdparty/freetype/src/type1/t1objs.c @@ -494,14 +494,17 @@ charmap.face = root; /* first of all, try to synthesize a Unicode charmap */ - charmap.platform_id = 3; - charmap.encoding_id = 1; + charmap.platform_id = TT_PLATFORM_MICROSOFT; + charmap.encoding_id = TT_MS_ID_UNICODE_CS; charmap.encoding = FT_ENCODING_UNICODE; - FT_CMap_New( cmap_classes->unicode, NULL, &charmap, NULL ); + error = FT_CMap_New( cmap_classes->unicode, NULL, &charmap, NULL ); + if ( error && FT_Err_No_Unicode_Glyph_Name != error ) + goto Exit; + error = FT_Err_Ok; /* now, generate an Adobe Standard encoding when appropriate */ - charmap.platform_id = 7; + charmap.platform_id = TT_PLATFORM_ADOBE; clazz = NULL; switch ( type1->encoding_type ) @@ -535,7 +538,7 @@ } if ( clazz ) - FT_CMap_New( clazz, NULL, &charmap, NULL ); + error = FT_CMap_New( clazz, NULL, &charmap, NULL ); #if 0 /* Select default charmap */ diff --git a/lib/3rdparty/freetype/src/type42/t42objs.c b/lib/3rdparty/freetype/src/type42/t42objs.c index 9081ffc6d22..a5e0ee5e81f 100644 --- a/lib/3rdparty/freetype/src/type42/t42objs.c +++ b/lib/3rdparty/freetype/src/type42/t42objs.c @@ -21,6 +21,7 @@ #include "t42error.h" #include FT_INTERNAL_DEBUG_H #include FT_LIST_H +#include FT_TRUETYPE_IDS_H #undef FT_COMPONENT @@ -330,39 +331,42 @@ charmap.face = root; /* first of all, try to synthesize a Unicode charmap */ - charmap.platform_id = 3; - charmap.encoding_id = 1; + charmap.platform_id = TT_PLATFORM_MICROSOFT; + charmap.encoding_id = TT_MS_ID_UNICODE_CS; charmap.encoding = FT_ENCODING_UNICODE; - FT_CMap_New( cmap_classes->unicode, NULL, &charmap, NULL ); + error = FT_CMap_New( cmap_classes->unicode, NULL, &charmap, NULL ); + if ( error && FT_Err_No_Unicode_Glyph_Name != error ) + goto Exit; + error = FT_Err_Ok; /* now, generate an Adobe Standard encoding when appropriate */ - charmap.platform_id = 7; + charmap.platform_id = TT_PLATFORM_ADOBE; clazz = NULL; switch ( type1->encoding_type ) { case T1_ENCODING_TYPE_STANDARD: charmap.encoding = FT_ENCODING_ADOBE_STANDARD; - charmap.encoding_id = 0; + charmap.encoding_id = TT_ADOBE_ID_STANDARD; clazz = cmap_classes->standard; break; case T1_ENCODING_TYPE_EXPERT: charmap.encoding = FT_ENCODING_ADOBE_EXPERT; - charmap.encoding_id = 1; + charmap.encoding_id = TT_ADOBE_ID_EXPERT; clazz = cmap_classes->expert; break; case T1_ENCODING_TYPE_ARRAY: charmap.encoding = FT_ENCODING_ADOBE_CUSTOM; - charmap.encoding_id = 2; + charmap.encoding_id = TT_ADOBE_ID_CUSTOM; clazz = cmap_classes->custom; break; case T1_ENCODING_TYPE_ISOLATIN1: charmap.encoding = FT_ENCODING_ADOBE_LATIN_1; - charmap.encoding_id = 3; + charmap.encoding_id = TT_ADOBE_ID_LATIN_1; clazz = cmap_classes->unicode; break; @@ -371,7 +375,7 @@ } if ( clazz ) - FT_CMap_New( clazz, NULL, &charmap, NULL ); + error = FT_CMap_New( clazz, NULL, &charmap, NULL ); #if 0 /* Select default charmap */ diff --git a/lib/3rdparty/freetype/src/type42/t42parse.c b/lib/3rdparty/freetype/src/type42/t42parse.c index 13bda64c837..577426917bb 100644 --- a/lib/3rdparty/freetype/src/type42/t42parse.c +++ b/lib/3rdparty/freetype/src/type42/t42parse.c @@ -4,7 +4,7 @@ /* */ /* Type 42 font parser (body). */ /* */ -/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ +/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by */ /* Roberto Alameda. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -52,7 +52,8 @@ /* as Type42 fonts have no Private dict, */ /* we set the last argument of T1_FIELD_XXX to 0 */ static const - T1_FieldRec t42_keywords[] = { + T1_FieldRec t42_keywords[] = + { #undef FT_STRUCTURE #define FT_STRUCTURE T1_FontInfo @@ -268,7 +269,8 @@ temp_scale ) >> 16 ); /* we need to scale the values by 1.0/temp_scale */ - if ( temp_scale != 0x10000L ) { + if ( temp_scale != 0x10000L ) + { temp[0] = FT_DivFix( temp[0], temp_scale ); temp[1] = FT_DivFix( temp[1], temp_scale ); temp[2] = FT_DivFix( temp[2], temp_scale ); @@ -575,6 +577,12 @@ } string_size = T1_ToInt( parser ); + if ( string_size < 0 ) + { + FT_ERROR(( "t42_parse_sfnts: invalid string size\n" )); + error = T42_Err_Invalid_File_Format; + goto Fail; + } T1_Skip_PS_Token( parser ); /* `RD' */ if ( parser->root.error ) @@ -582,13 +590,14 @@ string_buf = parser->root.cursor + 1; /* one space after `RD' */ - parser->root.cursor += string_size + 1; - if ( parser->root.cursor >= limit ) + if ( limit - parser->root.cursor < string_size ) { FT_ERROR(( "t42_parse_sfnts: too many binary data\n" )); error = T42_Err_Invalid_File_Format; goto Fail; } + else + parser->root.cursor += string_size + 1; } if ( !string_buf ) diff --git a/lib/3rdparty/freetype/src/winfonts/winfnt.c b/lib/3rdparty/freetype/src/winfonts/winfnt.c index 6b3a4e17f20..ee17d16659b 100644 --- a/lib/3rdparty/freetype/src/winfonts/winfnt.c +++ b/lib/3rdparty/freetype/src/winfonts/winfnt.c @@ -4,7 +4,7 @@ /* */ /* FreeType font driver for Windows FNT/FON files */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* Copyright 2003 Huw D M Davies for Codeweavers */ /* Copyright 2007 Dmitry Timoshkov for Codeweavers */ @@ -23,6 +23,7 @@ #include FT_INTERNAL_DEBUG_H #include FT_INTERNAL_STREAM_H #include FT_INTERNAL_OBJECTS_H +#include FT_TRUETYPE_IDS_H #include "winfnt.h" #include "fnterrs.h" @@ -802,15 +803,16 @@ charmap.encoding = FT_ENCODING_NONE; - charmap.platform_id = 0; - charmap.encoding_id = 0; + /* initial platform/encoding should indicate unset status? */ + charmap.platform_id = TT_PLATFORM_APPLE_UNICODE; + charmap.encoding_id = TT_APPLE_ID_DEFAULT; charmap.face = root; if ( font->header.charset == FT_WinFNT_ID_MAC ) { charmap.encoding = FT_ENCODING_APPLE_ROMAN; - charmap.platform_id = 1; -/* charmap.encoding_id = 0; */ + charmap.platform_id = TT_PLATFORM_MACINTOSH; +/* charmap.encoding_id = TT_MAC_ID_ROMAN; */ } error = FT_CMap_New( fnt_cmap_class, @@ -942,7 +944,7 @@ FT_Int32 load_flags ) { FNT_Face face = (FNT_Face)FT_SIZE_FACE( size ); - FNT_Font font = face->font; + FNT_Font font; FT_Error error = FNT_Err_Ok; FT_Byte* p; FT_Int len; @@ -953,7 +955,15 @@ FT_UNUSED( load_flags ); - if ( !face || !font || + if ( !face ) + { + error = FNT_Err_Invalid_Argument; + goto Exit; + } + + font = face->font; + + if ( !font || glyph_index >= (FT_UInt)( FT_FACE( face )->num_glyphs ) ) { error = FNT_Err_Invalid_Argument; diff --git a/lib/3rdparty/mingw/crtdll.c b/lib/3rdparty/mingw/crtdll.c index f930f0d6a5a..001cbd7358f 100644 --- a/lib/3rdparty/mingw/crtdll.c +++ b/lib/3rdparty/mingw/crtdll.c @@ -179,34 +179,34 @@ __DllMainCRTStartup (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved) retcode = FALSE; goto i__leave; } + _pei386_runtime_relocator (); if (dwReason == DLL_PROCESS_ATTACH || dwReason == DLL_THREAD_ATTACH) { + retcode = _CRT_INIT (hDllHandle, dwReason, lpreserved); + if (!retcode) + goto i__leave; retcode = DllEntryPoint (hDllHandle, dwReason, lpreserved); - if (retcode) - retcode = _CRT_INIT (hDllHandle, dwReason, lpreserved); if (! retcode) - goto i__leave; + { + if (dwReason == DLL_PROCESS_ATTACH) + _CRT_INIT (hDllHandle, DLL_PROCESS_DETACH, lpreserved); + goto i__leave; + } } - _pei386_runtime_relocator (); - if (retcode && dwReason == DLL_PROCESS_ATTACH) + if (dwReason == DLL_PROCESS_ATTACH) __main (); retcode = DllMain(hDllHandle,dwReason,lpreserved); - if ((dwReason == DLL_PROCESS_ATTACH) && ! retcode) + if (dwReason == DLL_PROCESS_ATTACH && ! retcode) { DllMain (hDllHandle, DLL_PROCESS_DETACH, lpreserved); - _CRT_INIT (hDllHandle, DLL_PROCESS_DETACH, lpreserved); DllEntryPoint (hDllHandle, DLL_PROCESS_DETACH, lpreserved); + _CRT_INIT (hDllHandle, DLL_PROCESS_DETACH, lpreserved); } if (dwReason == DLL_PROCESS_DETACH || dwReason == DLL_THREAD_DETACH) { + retcode = DllEntryPoint (hDllHandle, dwReason, lpreserved); if (_CRT_INIT (hDllHandle, dwReason, lpreserved) == FALSE) - { - retcode = FALSE; - } - if (retcode) - { - retcode = DllEntryPoint (hDllHandle, dwReason, lpreserved); - } + retcode = FALSE; } i__leave: __native_dllmain_reason = UINT_MAX; diff --git a/lib/rossym/CMakeLists.txt b/lib/rossym/CMakeLists.txt index 2b05860e247..73387942ae8 100644 --- a/lib/rossym/CMakeLists.txt +++ b/lib/rossym/CMakeLists.txt @@ -5,7 +5,6 @@ else() add_definitions(-D_NTSYSTEM_) list(APPEND SOURCE delete.c - dwarf386.c dwarfabbrev.c dwarfaranges.c dwarfcfa.c @@ -16,9 +15,7 @@ list(APPEND SOURCE dwarfpubnames.c find.c fromfile.c - iofile.c init.c - initkm.c initum.c pe.c zwfile.c) diff --git a/lib/rossym/compat.h b/lib/rossym/compat.h index 64dc549f11c..375b498fa3e 100644 --- a/lib/rossym/compat.h +++ b/lib/rossym/compat.h @@ -32,6 +32,8 @@ void *RosSymRealloc(void *mem, ulong newsize); void xfree(void *v); #define werrstr(str, ...) DPRINT(str "\n" ,##__VA_ARGS__) +//#define werrstr(x, ...) printf("(%s:%d) " x "\n",__FILE__,__LINE__,##__VA_ARGS__) + #define malloc(x) RosSymAllocMem(x) #define mallocz(x,y) RosSymAllocMemZero(x,y) #define free(x) xfree(x) diff --git a/lib/rossym/dwarf.h b/lib/rossym/dwarf.h index 04689814bd7..7308d7deab0 100644 --- a/lib/rossym/dwarf.h +++ b/lib/rossym/dwarf.h @@ -6,6 +6,8 @@ typedef struct DwarfBlock DwarfBlock; typedef struct DwarfBuf DwarfBuf; typedef struct DwarfExpr DwarfExpr; typedef struct DwarfSym DwarfSym; +typedef struct DwarfStack DwarfStack; +typedef struct DwarfParam DwarfParam; typedef union DwarfVal DwarfVal; enum @@ -203,6 +205,16 @@ struct DwarfBlock ulong len; }; +struct DwarfParam +{ + char *name; + ulong unit; + ulong type; + ulong loctype; + ulong fde, len; + ulong value; +}; + /* not for consumer use */ struct DwarfBuf { @@ -372,19 +384,16 @@ struct DwarfExpr struct DwarfSym { - DwarfAttrs attrs; - + DwarfAttrs attrs; + /* not for consumer use... */ - DwarfBuf b; - ulong unit; - uint uoff; - ulong aoff; - int depth; - int allunits; - ulong nextunit; + uint num; + DwarfBuf b; + int depth; + ulong unit, childoff, nextunit; + ulong aoff; }; - struct _Pe; Dwarf *dwarfopen(struct _Pe *elf); void dwarfclose(Dwarf*); @@ -398,9 +407,11 @@ int dwarfenumunit(Dwarf*, ulong, DwarfSym*); int dwarfseeksym(Dwarf*, ulong, ulong, DwarfSym*); int dwarfenum(Dwarf*, DwarfSym*); int dwarfnextsym(Dwarf*, DwarfSym*); -int dwarfnextsymat(Dwarf*, DwarfSym*, int); -int dwarfpctoline(Dwarf*, ulong, char**, char**, char**, char **, ulong*, ulong*, ulong*); -int dwarfunwind(Dwarf*, ulong, DwarfExpr*, DwarfExpr*, DwarfExpr*, int); +int dwarfnextsymat(Dwarf*, DwarfSym *parent, DwarfSym *child); +int dwarfpctoline(Dwarf*, DwarfSym *proc, ulong, char**, char**, ulong *); +int dwarfgetarg(Dwarf *d, const char *name, DwarfBuf *locbuf, ulong cfa, PROSSYM_REGISTERS registers, ulong *value); +int dwarfgettype(Dwarf *d, DwarfSym *param, DwarfSym *type); + ulong dwarfget1(DwarfBuf*); ulong dwarfget2(DwarfBuf*); ulong dwarfget4(DwarfBuf*); @@ -411,7 +422,10 @@ ulong dwarfgetaddr(DwarfBuf*); int dwarfgetn(DwarfBuf*, uchar*, int); uchar *dwarfgetnref(DwarfBuf*, ulong); char *dwarfgetstring(DwarfBuf*); - +int dwarfcomputecfa(Dwarf *d, DwarfExpr *cfa, PROSSYM_REGISTERS registers, ulong *cfaLocation); +int dwarfregunwind(Dwarf *d, ulong pc, ulong fde, DwarfExpr *cfa, PROSSYM_REGISTERS registers); +int dwarfargvalue(Dwarf *d, DwarfSym *proc, ulong pc, ulong cfa, PROSSYM_REGISTERS registers, DwarfParam *parameters); +int dwarfgetparams(Dwarf *d, DwarfSym *s, ulong pc, int pnum, DwarfParam *paramblocks); typedef struct DwarfAbbrev DwarfAbbrev; typedef struct DwarfAttr DwarfAttr; @@ -449,6 +463,7 @@ struct Dwarf DwarfBlock pubtypes; DwarfBlock ranges; DwarfBlock str; + DwarfBlock loc; /* little cache */ struct { @@ -458,14 +473,15 @@ struct Dwarf } acache; }; +struct DwarfStack +{ + ulong storage[16]; // own storage + ulong *data; + ulong length, max; +}; + DwarfAbbrev *dwarfgetabbrev(Dwarf*, ulong, ulong); int dwarfgetinfounit(Dwarf*, ulong, DwarfBlock*); -extern int dwarf386nregs; -extern char *dwarf386regs[]; -extern char *dwarf386fp; - -#define SYMBOL_SIZE 18 #define MAXIMUM_DWARF_NAME_SIZE 64 -#define MAXIMUM_COFF_SYMBOL_LENGTH 256 diff --git a/lib/rossym/dwarfabbrev.c b/lib/rossym/dwarfabbrev.c index d21ca6a25d1..365d44232d4 100644 --- a/lib/rossym/dwarfabbrev.c +++ b/lib/rossym/dwarfabbrev.c @@ -25,117 +25,119 @@ DwarfAbbrev *dwarfgetabbrev(Dwarf*, ulong, ulong); static int loadabbrevs(Dwarf *d, ulong off, DwarfAbbrev **aa) { - int nattr, nabbrev; - DwarfAbbrev *abbrev; - DwarfAttr *attr; + int nattr, nabbrev; + DwarfAbbrev *abbrev; + DwarfAttr *attr; - if(d->acache.off == off && d->acache.na){ - *aa = d->acache.a; - return d->acache.na; - } + if(d->acache.off == off && d->acache.na){ + *aa = d->acache.a; + return d->acache.na; + } - /* two passes - once to count, then allocate, then a second to copy */ - if(parseabbrevs(d, off, nil, nil, &nabbrev, &nattr) < 0) { - return -1; - } + /* two passes - once to count, then allocate, then a second to copy */ + if(parseabbrevs(d, off, nil, nil, &nabbrev, &nattr) < 0) { + return -1; + } - abbrev = malloc(nabbrev*sizeof(DwarfAbbrev) + nattr*sizeof(DwarfAttr)); - attr = (DwarfAttr*)(abbrev+nabbrev); + abbrev = malloc(nabbrev*sizeof(DwarfAbbrev) + nattr*sizeof(DwarfAttr)); + attr = (DwarfAttr*)(abbrev+nabbrev); - if(parseabbrevs(d, off, abbrev, attr, nil, nil) < 0){ - free(abbrev); - return -1; - } + if(parseabbrevs(d, off, abbrev, attr, nil, nil) < 0){ + free(abbrev); + return -1; + } - free(d->acache.a); - d->acache.a = abbrev; - d->acache.na = nabbrev; - d->acache.off = off; + free(d->acache.a); + d->acache.a = abbrev; + d->acache.na = nabbrev; + d->acache.off = off; - *aa = abbrev; - return nabbrev; + *aa = abbrev; + return nabbrev; } static int parseabbrevs(Dwarf *d, ulong off, DwarfAbbrev *abbrev, DwarfAttr *attr, int *pnabbrev, int *pnattr) { - int i, nabbrev, nattr, haskids; - ulong num, tag, name, form; - DwarfBuf b; + int i, nabbrev, nattr, haskids; + ulong num, tag, name, form; + DwarfBuf b; - if(off >= d->abbrev.len){ - werrstr("bad abbrev section offset 0x%lux >= 0x%lux\n", off, d->abbrev.len); - return -1; - } + if(off >= d->abbrev.len){ + werrstr("bad abbrev section offset 0x%lux >= 0x%lux", off, d->abbrev.len); + return -1; + } - memset(&b, 0, sizeof b); - b.p = d->abbrev.data + off; - b.ep = d->abbrev.data + d->abbrev.len; + memset(&b, 0, sizeof b); + b.p = d->abbrev.data + off; + b.ep = d->abbrev.data + d->abbrev.len; - nabbrev = 0; - nattr = 0; - for(;;){ - if(b.p == nil){ - werrstr("malformed abbrev data"); - return -1; - } - num = dwarfget128(&b); - if(num == 0) - break; - tag = dwarfget128(&b); - haskids = dwarfget1(&b); - for(i=0;; i++){ - name = dwarfget128(&b); - form = dwarfget128(&b); - if(name == 0 && form == 0) - break; - if(attr){ - attr[i].name = name; - attr[i].form = form; - } - } - if(abbrev){ - abbrev->num = num; - abbrev->tag = tag; - abbrev->haskids = haskids; - abbrev->attr = attr; - abbrev->nattr = i; - abbrev++; - attr += i; - } - nabbrev++; - nattr += i; - } - if(pnabbrev) - *pnabbrev = nabbrev; - if(pnattr) - *pnattr = nattr; - return 0; + nabbrev = 0; + nattr = 0; + for(;;){ + if(b.p == nil){ + werrstr("malformed abbrev data"); + return -1; + } + num = dwarfget128(&b); + if(num == 0) + break; + tag = dwarfget128(&b); + DPRINT("num %d tag %x @ %x", num, tag, b.p - d->abbrev.data); + haskids = dwarfget1(&b); + for(i=0;; i++){ + name = dwarfget128(&b); + form = dwarfget128(&b); + assert(form < 0x3000); + if(name == 0 && form == 0) + break; + if(attr){ + attr[i].name = name; + attr[i].form = form; + } + } + if(abbrev){ + abbrev->num = num; + abbrev->tag = tag; + abbrev->haskids = haskids; + abbrev->attr = attr; + abbrev->nattr = i; + abbrev++; + attr += i; + } + nabbrev++; + nattr += i; + } + if(pnabbrev) + *pnabbrev = nabbrev; + if(pnattr) + *pnattr = nattr; + return 0; } static DwarfAbbrev* findabbrev(DwarfAbbrev *a, int na, ulong num) { - int i; + int i; - for(i=0; iaranges.data; - b.ep = b.p + d->aranges.len; + memset(&b, 0, sizeof b); + b.d = d; + b.p = d->aranges.data; + b.ep = b.p + d->aranges.len; - while(b.p < b.ep){ - start = b.p; - len = dwarfget4(&b); - if (!len) { b.ep = b.p - 4; return -1; } - if((id = dwarfget2(&b)) != 2){ - if(b.p == nil){ - underflow: - werrstr("buffer underflow reading address ranges header"); - }else - werrstr("bad dwarf version 0x%x in address ranges header", id); - return -1; - } - off = dwarfget4(&b); - b.addrsize = dwarfget1(&b); - if(d->addrsize == 0) - d->addrsize = b.addrsize; - segsize = dwarfget1(&b); - USED(segsize); /* what am i supposed to do with this? */ - if(b.p == nil) - goto underflow; - if((i = (b.p-start) % (2*b.addrsize)) != 0) - b.p += 2*b.addrsize - i; - end = start+4+len; - while(b.p!=nil && b.paddrsize == 0) + d->addrsize = b.addrsize; + segsize = dwarfget1(&b); + USED(segsize); /* what am i supposed to do with this? */ + if(b.p == nil) + goto underflow; + if((i = (b.p-start) % (2*b.addrsize)) != 0) + b.p += 2*b.addrsize - i; + end = start+4+len; + while(b.p!=nil && b.p +#include "pe.h" #include "dwarf.h" -#define trace 0 +#define trace 1 typedef struct State State; struct State @@ -71,7 +72,7 @@ dwarfunwind(Dwarf *d, ulong pc, DwarfExpr *cfa, DwarfExpr *ra, DwarfExpr *r, int memset(r, 0, nr*sizeof(r[0])); for(i=0; iiquantum = dwarfget128(&b); @@ -163,6 +165,7 @@ findfde(Dwarf *d, ulong pc, State *s, DwarfBuf *fde) }else{ /* FDE */ base = dwarfgetaddr(&b); size = dwarfgetaddr(&b); + if (trace) werrstr("FDE: base %x-%x (want pc %x)", base, base+size, pc); fde->p = b.p; fde->ep = next; s->loc = base; @@ -171,7 +174,7 @@ findfde(Dwarf *d, ulong pc, State *s, DwarfBuf *fde) return 0; } } - werrstr("cannot find call frame information for pc 0x%lux", pc); + werrstr("cannot find call frame information for pc 0x%lx", pc); return -1; } @@ -180,7 +183,7 @@ static int checkreg(State *s, long r) { if(r < 0 || r >= s->nr){ - werrstr("bad register number 0x%lux", r); + werrstr("bad register number 0x%lx", r); return -1; } return 0; @@ -197,20 +200,21 @@ dexec(DwarfBuf *b, State *s, int locstop) if(b->p == b->ep){ if(s->initr) s->loc = s->endloc; + werrstr("end dexec"); return 0; } c = dwarfget1(b); if(b->p == nil){ werrstr("ran out of instructions during cfa program"); - if(trace) werrstr("%r\n"); + if(trace) werrstr("%r"); return -1; } - if(trace) werrstr("+ loc=0x%lux op 0x%ux ", s->loc, c); + if(trace) werrstr("+ loc=0x%x op 0x%x ", s->loc, c); switch(c>>6){ case 1: /* advance location */ arg1 = c&0x3F; advance: - if(trace) werrstr("loc += %ld\n", arg1*s->iquantum); + if(trace) werrstr("loc += %ld", arg1*s->iquantum); s->loc += arg1 * s->iquantum; if(locstop) return 0; @@ -220,7 +224,7 @@ dexec(DwarfBuf *b, State *s, int locstop) arg1 = c&0x3F; arg2 = dwarfget128(b); offset: - if(trace) werrstr("r%ld += %ld\n", arg1, arg2*s->dquantum); + if(trace) werrstr("r%ld += %ld", arg1, arg2*s->dquantum); if(checkreg(s, arg1) < 0) return -1; s->r[arg1].type = RuleCfaOffset; @@ -230,7 +234,7 @@ dexec(DwarfBuf *b, State *s, int locstop) case 3: /* restore initial setting */ arg1 = c&0x3F; restore: - if(trace) werrstr("r%ld = init\n", arg1); + if(trace) werrstr("r%ld = init", arg1); if(checkreg(s, arg1) < 0) return -1; s->r[arg1] = s->initr[arg1]; @@ -239,12 +243,12 @@ dexec(DwarfBuf *b, State *s, int locstop) switch(c){ case 0: /* nop */ - if(trace) werrstr("nop\n"); + if(trace) werrstr("nop"); continue; case 0x01: /* set location */ s->loc = dwarfgetaddr(b); - if(trace) werrstr("loc = 0x%lux\n", s->loc); + if(trace) werrstr("loc = 0x%lx", s->loc); if(locstop) return 0; continue; @@ -272,7 +276,7 @@ dexec(DwarfBuf *b, State *s, int locstop) case 0x07: /* undefined */ arg1 = dwarfget128(b); - if(trace) werrstr("r%ld = undef\n", arg1); + if(trace) werrstr("r%ld = undef", arg1); if(checkreg(s, arg1) < 0) return -1; s->r[arg1].type = RuleUndef; @@ -280,7 +284,7 @@ dexec(DwarfBuf *b, State *s, int locstop) case 0x08: /* same value */ arg1 = dwarfget128(b); - if(trace) werrstr("r%ld = same\n", arg1); + if(trace) werrstr("r%ld = same", arg1); if(checkreg(s, arg1) < 0) return -1; s->r[arg1].type = RuleSame; @@ -289,7 +293,7 @@ dexec(DwarfBuf *b, State *s, int locstop) case 0x09: /* register */ arg1 = dwarfget128(b); arg2 = dwarfget128(b); - if(trace) werrstr("r%ld = r%ld\n", arg1, arg2); + if(trace) werrstr("r%ld = r%ld", arg1, arg2); if(checkreg(s, arg1) < 0 || checkreg(s, arg2) < 0) return -1; s->r[arg1].type = RuleRegister; @@ -298,7 +302,7 @@ dexec(DwarfBuf *b, State *s, int locstop) case 0x0A: /* remember state */ e = malloc(s->nr*sizeof(e[0])); - if(trace) werrstr("push\n"); + if(trace) werrstr("push"); if(e == nil) return -1; void *newstack = malloc(s->nstack*sizeof(s->stack[0])); @@ -319,7 +323,7 @@ dexec(DwarfBuf *b, State *s, int locstop) continue; case 0x0B: /* restore state */ - if(trace) werrstr("pop\n"); + if(trace) werrstr("pop"); if(s->nstack == 0){ werrstr("restore state underflow"); return -1; @@ -334,7 +338,7 @@ dexec(DwarfBuf *b, State *s, int locstop) arg1 = dwarfget128(b); arg2 = dwarfget128(b); defcfa: - if(trace) werrstr("cfa %ld(r%ld)\n", arg2, arg1); + if(trace) werrstr("cfa %ld(r%ld)", arg2, arg1); if(checkreg(s, arg1) < 0) return -1; s->cfa->type = RuleRegOff; @@ -344,7 +348,7 @@ dexec(DwarfBuf *b, State *s, int locstop) case 0x0D: /* def cfa register */ arg1 = dwarfget128(b); - if(trace) werrstr("cfa reg r%ld\n", arg1); + if(trace) werrstr("cfa reg r%ld", arg1); if(s->cfa->type != RuleRegOff){ werrstr("change CFA register but CFA not in register+offset form"); return -1; @@ -357,7 +361,7 @@ dexec(DwarfBuf *b, State *s, int locstop) case 0x0E: /* def cfa offset */ arg1 = dwarfget128(b); cfaoffset: - if(trace) werrstr("cfa off %ld\n", arg1); + if(trace) werrstr("cfa off %ld", arg1); if(s->cfa->type != RuleRegOff){ werrstr("change CFA offset but CFA not in register+offset form"); return -1; @@ -366,7 +370,7 @@ dexec(DwarfBuf *b, State *s, int locstop) continue; case 0x0F: /* def cfa expression */ - if(trace) werrstr("cfa expr\n"); + if(trace) werrstr("cfa expr"); s->cfa->type = RuleLocation; s->cfa->loc.len = dwarfget128(b); s->cfa->loc.data = dwarfgetnref(b, s->cfa->loc.len); @@ -374,7 +378,7 @@ dexec(DwarfBuf *b, State *s, int locstop) case 0x10: /* def reg expression */ arg1 = dwarfget128(b); - if(trace) werrstr("reg expr r%ld\n", arg1); + if(trace) werrstr("reg expr r%ld", arg1); if(checkreg(s, arg1) < 0) return -1; s->r[arg1].type = RuleLocation; @@ -397,11 +401,98 @@ dexec(DwarfBuf *b, State *s, int locstop) goto cfaoffset; default: /* unknown */ - werrstr("unknown opcode 0x%ux in cfa program", c); + werrstr("unknown opcode 0x%x in cfa program", c); return -1; } } /* not reached */ } +int dwarfcomputecfa(Dwarf *d, DwarfExpr *cfa, PROSSYM_REGISTERS registers, ulong *cfaLocation) +{ + switch (cfa->type) { + case RuleRegOff: + *cfaLocation = registers->Registers[cfa->reg] + cfa->offset; + werrstr("cfa reg %d (%x) offset %x = %x", cfa->reg, (ulong)registers->Registers[cfa->reg], cfa->offset, cfaLocation); + break; + default: + werrstr("cfa->type %x", cfa->type); + return -1; + } + return 0; +} + +int dwarfregunwind(Dwarf *d, ulong pc, ulong fde, DwarfExpr *cfa, PROSSYM_REGISTERS registers) +{ + int i; + State s = { }; + DwarfExpr initr[sizeof(registers->Registers) / sizeof(registers->Registers[0])] = { }; + DwarfExpr r[sizeof(registers->Registers) / sizeof(registers->Registers[0])] = { }; + DwarfExpr ra; + + int nr = s.nr = sizeof(registers->Registers) / sizeof(registers->Registers[0]); + s.initr = initr; + s.r = r; + for (i = 0; i < sizeof(r) / sizeof(r[0]); i++) { + r[i].type = RuleRegister; + r[i].offset = registers->Registers[i]; + r[i].reg = i; + } + + int res = dwarfunwind(d, pc, cfa, &ra, initr, sizeof(initr) / sizeof(initr[0])); + if (res == -1) return -1; + + ulong cfaLocation; + + if (dwarfcomputecfa(d, cfa, registers, &cfaLocation) == -1) + return -1; + + for (i = 0; i < nr; i++) { + switch (r[i].type) { + case RuleUndef: + werrstr("Undefined register slot %d", i); + assert(FALSE); + break; + case RuleSame: + break; + case RuleRegister: + registers->Registers[i] = registers->Registers[r[i].reg]; + break; + case RuleRegOff: { + BOOLEAN success = + RosSymCallbacks.MemGetProc + (d->pe->fd, + ®isters->Registers[i], + r[i].offset + registers->Registers[r[i].reg], + d->addrsize); + if (!success) return -1; + } break; + case RuleCfaOffset: + { + BOOLEAN success = + RosSymCallbacks.MemGetProc + (d->pe->fd, + ®isters->Registers[i], + r[i].offset + cfaLocation, + d->addrsize); + werrstr("reg[%d] = %x: cfa offset (cfa %x, offset %x) -> @%x", i, (ulong)registers->Registers[i], cfaLocation, initr[i].offset, r[i].offset + cfaLocation); + if (!success) return -1; + } break; + default: + werrstr("We don't yet support cfa rule %d in slot %d", r[i].type, i); + assert(FALSE); + break; + } + } + + ulong cfaSpace[4]; + for (i = 0; i < sizeof(cfaSpace) / sizeof(cfaSpace[0]); i++) { + RosSymCallbacks.MemGetProc + (d->pe->fd, &cfaSpace[i], cfaLocation + (i * 4), d->addrsize); + } + werrstr("CFA(%x) [%08x, %08x, %08x, %08x]", + cfaLocation, cfaSpace[0], cfaSpace[1], cfaSpace[2], cfaSpace[3]); + + return 0; +} diff --git a/lib/rossym/dwarfget.c b/lib/rossym/dwarfget.c index d32177cd1db..7787163a21b 100644 --- a/lib/rossym/dwarfget.c +++ b/lib/rossym/dwarfget.c @@ -139,7 +139,7 @@ dwarfgetaddr(DwarfBuf *b) return dwarfget8(b); default: if(++nbad == 1) - werrstr("dwarf: unexpected address size %lud in dwarfgetaddr\n", b->addrsize); + werrstr("dwarf: unexpected address size %lud in dwarfgetaddr", b->addrsize); b->p = nil; return 0; } @@ -190,7 +190,7 @@ dwarfget128(DwarfBuf *b) while(b->pep && *b->p&0x80) b->p++; if(++nbad == 1) - werrstr("dwarf: overflow during parsing of uleb128 integer\n"); + werrstr("dwarf: overflow during parsing of uleb128 integer"); return c; } diff --git a/lib/rossym/dwarfinfo.c b/lib/rossym/dwarfinfo.c index cc25499483a..397702f1180 100644 --- a/lib/rossym/dwarfinfo.c +++ b/lib/rossym/dwarfinfo.c @@ -13,649 +13,971 @@ #include #include "dwarf.h" +#include "pe.h" #include enum { - DwarfAttrSibling = 0x01, - DwarfAttrLocation = 0x02, - DwarfAttrName = 0x03, - DwarfAttrOrdering = 0x09, - DwarfAttrByteSize = 0x0B, - DwarfAttrBitOffset = 0x0C, - DwarfAttrBitSize = 0x0D, - DwarfAttrStmtList = 0x10, - DwarfAttrLowpc = 0x11, - DwarfAttrHighpc = 0x12, - DwarfAttrLanguage = 0x13, - DwarfAttrDiscr = 0x15, - DwarfAttrDiscrValue = 0x16, - DwarfAttrVisibility = 0x17, - DwarfAttrImport = 0x18, - DwarfAttrStringLength = 0x19, - DwarfAttrCommonRef = 0x1A, - DwarfAttrCompDir = 0x1B, - DwarfAttrConstValue = 0x1C, - DwarfAttrContainingType = 0x1D, - DwarfAttrDefaultValue = 0x1E, - DwarfAttrInline = 0x20, - DwarfAttrIsOptional = 0x21, - DwarfAttrLowerBound = 0x22, - DwarfAttrProducer = 0x25, - DwarfAttrPrototyped = 0x27, - DwarfAttrReturnAddr = 0x2A, - DwarfAttrStartScope = 0x2C, - DwarfAttrStrideSize = 0x2E, - DwarfAttrUpperBound = 0x2F, - DwarfAttrAbstractOrigin = 0x31, - DwarfAttrAccessibility = 0x32, - DwarfAttrAddrClass = 0x33, - DwarfAttrArtificial = 0x34, - DwarfAttrBaseTypes = 0x35, - DwarfAttrCalling = 0x36, - DwarfAttrCount = 0x37, - DwarfAttrDataMemberLoc = 0x38, - DwarfAttrDeclColumn = 0x39, - DwarfAttrDeclFile = 0x3A, - DwarfAttrDeclLine = 0x3B, - DwarfAttrDeclaration = 0x3C, - DwarfAttrDiscrList = 0x3D, - DwarfAttrEncoding = 0x3E, - DwarfAttrExternal = 0x3F, - DwarfAttrFrameBase = 0x40, - DwarfAttrFriend = 0x41, - DwarfAttrIdentifierCase = 0x42, - DwarfAttrMacroInfo = 0x43, - DwarfAttrNamelistItem = 0x44, - DwarfAttrPriority = 0x45, - DwarfAttrSegment = 0x46, - DwarfAttrSpecification = 0x47, - DwarfAttrStaticLink = 0x48, - DwarfAttrType = 0x49, - DwarfAttrUseLocation = 0x4A, - DwarfAttrVarParam = 0x4B, - DwarfAttrVirtuality = 0x4C, - DwarfAttrVtableElemLoc = 0x4D, - DwarfAttrAllocated = 0x4E, - DwarfAttrAssociated = 0x4F, - DwarfAttrDataLocation = 0x50, - DwarfAttrStride = 0x51, - DwarfAttrEntrypc = 0x52, - DwarfAttrUseUTF8 = 0x53, - DwarfAttrExtension = 0x54, - DwarfAttrRanges = 0x55, - DwarfAttrTrampoline = 0x56, - DwarfAttrCallColumn = 0x57, - DwarfAttrCallFile = 0x58, - DwarfAttrCallLine = 0x59, - DwarfAttrDescription = 0x5A, - DwarfAttrMax, + DwarfAttrSibling = 0x01, + DwarfAttrLocation = 0x02, + DwarfAttrName = 0x03, + DwarfAttrOrdering = 0x09, + DwarfAttrByteSize = 0x0B, + DwarfAttrBitOffset = 0x0C, + DwarfAttrBitSize = 0x0D, + DwarfAttrStmtList = 0x10, + DwarfAttrLowpc = 0x11, + DwarfAttrHighpc = 0x12, + DwarfAttrLanguage = 0x13, + DwarfAttrDiscr = 0x15, + DwarfAttrDiscrValue = 0x16, + DwarfAttrVisibility = 0x17, + DwarfAttrImport = 0x18, + DwarfAttrStringLength = 0x19, + DwarfAttrCommonRef = 0x1A, + DwarfAttrCompDir = 0x1B, + DwarfAttrConstValue = 0x1C, + DwarfAttrContainingType = 0x1D, + DwarfAttrDefaultValue = 0x1E, + DwarfAttrInline = 0x20, + DwarfAttrIsOptional = 0x21, + DwarfAttrLowerBound = 0x22, + DwarfAttrProducer = 0x25, + DwarfAttrPrototyped = 0x27, + DwarfAttrReturnAddr = 0x2A, + DwarfAttrStartScope = 0x2C, + DwarfAttrStrideSize = 0x2E, + DwarfAttrUpperBound = 0x2F, + DwarfAttrAbstractOrigin = 0x31, + DwarfAttrAccessibility = 0x32, + DwarfAttrAddrClass = 0x33, + DwarfAttrArtificial = 0x34, + DwarfAttrBaseTypes = 0x35, + DwarfAttrCalling = 0x36, + DwarfAttrCount = 0x37, + DwarfAttrDataMemberLoc = 0x38, + DwarfAttrDeclColumn = 0x39, + DwarfAttrDeclFile = 0x3A, + DwarfAttrDeclLine = 0x3B, + DwarfAttrDeclaration = 0x3C, + DwarfAttrDiscrList = 0x3D, + DwarfAttrEncoding = 0x3E, + DwarfAttrExternal = 0x3F, + DwarfAttrFrameBase = 0x40, + DwarfAttrFriend = 0x41, + DwarfAttrIdentifierCase = 0x42, + DwarfAttrMacroInfo = 0x43, + DwarfAttrNamelistItem = 0x44, + DwarfAttrPriority = 0x45, + DwarfAttrSegment = 0x46, + DwarfAttrSpecification = 0x47, + DwarfAttrStaticLink = 0x48, + DwarfAttrType = 0x49, + DwarfAttrUseLocation = 0x4A, + DwarfAttrVarParam = 0x4B, + DwarfAttrVirtuality = 0x4C, + DwarfAttrVtableElemLoc = 0x4D, + DwarfAttrAllocated = 0x4E, + DwarfAttrAssociated = 0x4F, + DwarfAttrDataLocation = 0x50, + DwarfAttrStride = 0x51, + DwarfAttrEntrypc = 0x52, + DwarfAttrUseUTF8 = 0x53, + DwarfAttrExtension = 0x54, + DwarfAttrRanges = 0x55, + DwarfAttrTrampoline = 0x56, + DwarfAttrCallColumn = 0x57, + DwarfAttrCallFile = 0x58, + DwarfAttrCallLine = 0x59, + DwarfAttrDescription = 0x5A, + DwarfAttrMax, - FormAddr = 0x01, - FormDwarfBlock2 = 0x03, - FormDwarfBlock4 = 0x04, - FormData2 = 0x05, - FormData4 = 0x06, - FormData8 = 0x07, - FormString = 0x08, - FormDwarfBlock = 0x09, - FormDwarfBlock1 = 0x0A, - FormData1 = 0x0B, - FormFlag = 0x0C, - FormSdata = 0x0D, - FormStrp = 0x0E, - FormUdata = 0x0F, - FormRefAddr = 0x10, - FormRef1 = 0x11, - FormRef2 = 0x12, - FormRef4 = 0x13, - FormRef8 = 0x14, - FormRefUdata = 0x15, - FormIndirect = 0x16 + FormAddr = 0x01, + FormDwarfBlock2 = 0x03, + FormDwarfBlock4 = 0x04, + FormData2 = 0x05, + FormData4 = 0x06, + FormData8 = 0x07, + FormString = 0x08, + FormDwarfBlock = 0x09, + FormDwarfBlock1 = 0x0A, + FormData1 = 0x0B, + FormFlag = 0x0C, + FormSdata = 0x0D, + FormStrp = 0x0E, + FormUdata = 0x0F, + FormRefAddr = 0x10, + FormRef1 = 0x11, + FormRef2 = 0x12, + FormRef4 = 0x13, + FormRef8 = 0x14, + FormRefUdata = 0x15, + FormIndirect = 0x16 }; -static int parseattrs(DwarfBuf*, ulong, DwarfAbbrev*, DwarfAttrs*); +static int parseattrs(Dwarf *d, DwarfBuf*, ulong, ulong, DwarfAbbrev*, DwarfAttrs*); static int getulong(DwarfBuf*, int, ulong, ulong*, int*); static int getuchar(DwarfBuf*, int, uchar*); -static int getstring(DwarfBuf*, int, char**); +static int getstring(Dwarf *d, DwarfBuf*, int, char**); static int getblock(DwarfBuf*, int, DwarfBlock*); -static int skipform(DwarfBuf*, int); -static int constblock(Dwarf*, DwarfBlock*, ulong*); +static int skipform(Dwarf *d, DwarfBuf*, int); int dwarflookupnameinunit(Dwarf *d, ulong unit, char *name, DwarfSym *s) { - if(dwarfenumunit(d, unit, s) < 0) - return -1; - - dwarfnextsymat(d, s, 0); /* s is now the CompileUnit */ - while(dwarfnextsymat(d, s, 1) == 1) - if(s->attrs.name && strcmp(s->attrs.name, name) == 0) - return 0; - werrstr("symbol '%s' not found", name); - return -1; + DwarfSym compunit = { }; + if(dwarfenumunit(d, unit, &compunit) < 0) + return -1; + while(dwarfnextsymat(d, &compunit, s) == 1) + if(s->attrs.name && strcmp(s->attrs.name, name) == 0) + return 0; + werrstr("symbol '%s' not found", name); + return -1; } - int dwarflookupsubname(Dwarf *d, DwarfSym *parent, char *name, DwarfSym *s) { - *s = *parent; - while(dwarfnextsymat(d, s, parent->depth+1)) - if(s->attrs.name && strcmp(s->attrs.name, name) == 0) - return 0; - werrstr("symbol '%s' not found", name); - return -1; + *s = *parent; + while(dwarfnextsymat(d, parent, s)) + if(s->attrs.name && strcmp(s->attrs.name, name) == 0) + return 0; + werrstr("symbol '%s' not found", name); + return -1; +} + +int +dwarflookupchildtag(Dwarf *d, DwarfSym *parent, ulong tag, DwarfSym *s) +{ + int rsym = dwarfnextsymat(d, parent, s); + while (rsym == 0 && s->attrs.tag != tag) { + if (s->attrs.haskids) { + DwarfSym p = *s; + int csym = dwarflookupchildtag(d, &p, tag, s); + if (csym == 0) { + return csym; + } + } + rsym = dwarfnextsym(d, s); + } + return rsym; } int dwarflookuptag(Dwarf *d, ulong unit, ulong tag, DwarfSym *s) { - if(dwarfenumunit(d, unit, s) < 0) { - return -1; - } - - dwarfnextsymat(d, s, 0); /* s is now the CompileUnit */ - if(s->attrs.tag == tag) { - return 0; - } - while(dwarfnextsymat(d, s, 1) == 1) - if(s->attrs.tag == tag) { - return 0; - } - werrstr("symbol with tag 0x%lux not found", tag); - return -1; + DwarfSym compunit = { }; + if (dwarfenumunit(d, unit, &compunit) < 0) { + return -1; + } + do { + if (compunit.attrs.tag == tag) { + *s = compunit; + return 0; + } + if (dwarflookupchildtag(d, &compunit, tag, s) == 0) + return 0; + } while(dwarfnextsym(d, &compunit) == 0); + werrstr("symbol with tag 0x%lux not found", tag); + return -1; } int dwarfseeksym(Dwarf *d, ulong unit, ulong off, DwarfSym *s) { - if(dwarfenumunit(d, unit, s) < 0) - return -1; - s->b.p = d->info.data + unit + off; - if(dwarfnextsymat(d, s, 0) != 1) - return -1; - return 0; + DwarfSym compunit = { }; + if(dwarfenumunit(d, unit, &compunit) < 0) + return -1; + s->b.p = d->info.data + unit + off; + if(dwarfnextsymat(d, &compunit, s) == -1) + return -1; + werrstr("dwarfseeksym: unit %x off %x, tag %x", unit, off, s->attrs.tag); + return 0; } int dwarflookupfn(Dwarf *d, ulong unit, ulong pc, DwarfSym *s) { - if(dwarfenumunit(d, unit, s) < 0) - return -1; - - if(dwarfnextsymat(d, s, 0) != 1) - return -1; - /* s is now the CompileUnit */ - - while(dwarfnextsymat(d, s, 1) == 1){ - if(s->attrs.tag != TagSubprogram) - continue; - if(s->attrs.lowpc <= pc && pc < s->attrs.highpc) - return 0; - } - werrstr("fn containing pc 0x%lux not found", pc); - return -1; + DwarfSym compunit = { }; + if(dwarfenumunit(d, unit, &compunit) < 0) + return -1; + while(dwarfnextsymat(d, &compunit, s) == 0){ + if(s->attrs.tag != TagSubprogram) + continue; + if(s->attrs.lowpc <= pc && pc < s->attrs.highpc) + return 0; + } + werrstr("fn containing pc 0x%lux not found", pc); + return -1; } int dwarfenumunit(Dwarf *d, ulong unit, DwarfSym *s) { - int i; - ulong aoff, len; + int i; + ulong aoff, len; - if(unit >= d->info.len){ - werrstr("dwarf unit address 0x%x >= 0x%x out of range", unit, d->info.len); - return -1; - } - memset(s, 0, sizeof *s); - memset(&s->b, 0, sizeof s->b); + if(unit >= d->info.len){ + werrstr("dwarf unit address 0x%x >= 0x%x out of range", unit, d->info.len); + return -1; + } + memset(s, 0, sizeof *s); + memset(&s->b, 0, sizeof s->b); - s->b.d = d; - s->b.p = d->info.data + unit; - s->b.ep = d->info.data + d->info.len; - len = dwarfget4(&s->b); - s->nextunit = unit + 4 + len; - - if(s->b.ep - s->b.p < len){ - badheader: - werrstr("bad dwarf unit header at unit 0x%lux", unit); - return -1; - } - s->b.ep = s->b.p+len; - if((i=dwarfget2(&s->b)) != 2) - goto badheader; - aoff = dwarfget4(&s->b); - s->b.addrsize = dwarfget1(&s->b); - if(d->addrsize == 0) - d->addrsize = s->b.addrsize; - if(s->b.p == nil) - goto badheader; - - s->aoff = aoff; + s->b.d = d; + s->b.p = d->info.data + unit; + s->b.ep = d->info.data + d->info.len; + len = dwarfget4(&s->b); s->unit = unit; - s->depth = 0; - return 0; -} + s->nextunit = unit + 4 + len; + s->b.ep = d->info.data + s->nextunit; -int -dwarfenum(Dwarf *d, DwarfSym *s) -{ - if(dwarfenumunit(d, 0, s) < 0) - return -1; - s->allunits = 1; - return 0; + if(s->b.ep - s->b.p < len){ + badheader: + werrstr("bad dwarf unit header at unit 0x%lux end %x start %x len %x", unit, s->b.ep - d->info.data, s->b.p - d->info.data, len); + return -1; + } + s->b.ep = s->b.p+len; + if((i=dwarfget2(&s->b)) != 2) + goto badheader; + aoff = dwarfget4(&s->b); + s->b.addrsize = dwarfget1(&s->b); + if(d->addrsize == 0) + d->addrsize = s->b.addrsize; + if(s->b.p == nil) + goto badheader; + + s->aoff = aoff; + + return dwarfnextsym(d, s); } int dwarfnextsym(Dwarf *d, DwarfSym *s) { - ulong num; - DwarfAbbrev *a; + ulong num; + DwarfAbbrev *a; - if(s->attrs.haskids) - s->depth++; -top: - if(s->b.p >= s->b.ep){ - if(s->allunits && s->nextunit < d->info.len){ - if(dwarfenumunit(d, s->nextunit, s) < 0) { - return -1; - } - s->allunits = 1; - goto top; - } - return 0; - } + num = dwarfget128(&s->b); + s->num = num; + if(num == 0){ + return -1; + } - s->uoff = s->b.p - (d->info.data+s->unit); - num = dwarfget128(&s->b); - if(num == 0){ - if(s->depth == 0) { - return 0; - } - if(s->depth > 0) - s->depth--; - goto top; - } + a = dwarfgetabbrev(d, s->aoff, num); + if(a == nil){ + werrstr("getabbrev %ud %ud for %ud,%ud", s->aoff, num, s->unit); + return -1; + } - a = dwarfgetabbrev(d, s->aoff, num); - if(a == nil){ - werrstr("getabbrev %ud %ud for %ud,%ud: %r\n", s->aoff, num, s->unit, s->uoff); - return -1; - } - if(parseattrs(&s->b, s->unit, a, &s->attrs) < 0) { - return -1; - } - return 1; + if(parseattrs(d, &s->b, s->attrs.tag, s->unit, a, &s->attrs) < 0) { + return -1; + } + + if (s->attrs.haskids) { + DwarfSym childSkip = { }; + s->childoff = s->b.p - d->info.data; + int r = dwarfnextsymat(d, s, &childSkip); + while (r == 0) { + r = dwarfnextsym(d, &childSkip); + } + s->b = childSkip.b; + } else { + s->childoff = 0; + } + return 0; } int -dwarfnextsymat(Dwarf *d, DwarfSym *s, int depth) +dwarfnextsymat(Dwarf *d, DwarfSym *parent, DwarfSym *child) { - int r; - DwarfSym t; - uint sib; + uint sib; - if(s->depth == depth && s->attrs.have.sibling){ - sib = s->attrs.sibling; - if(sib < d->info.len && d->info.data+sib >= s->b.p) - s->b.p = d->info.data+sib; - s->attrs.haskids = 0; - } + if (!parent->attrs.haskids || !parent->childoff) + return -1; - /* - * The funny game with t and s make sure that - * if we get to the end of a run of a particular - * depth, we leave s so that a call to nextsymat with depth-1 - * will actually produce the desired guy. We could change - * the interface to dwarfnextsym instead, but I'm scared - * to touch it. - */ - t = *s; - for(;;){ - if((r = dwarfnextsym(d, &t)) != 1) { - return r; - } - if(t.depth < depth){ - /* went too far - nothing to see */ - return 0; - } - *s = t; - if(t.depth == depth) { - return 1; - } - } + child->unit = parent->unit; + child->aoff = parent->aoff; + child->depth = parent->depth + 1; + if(child->attrs.have.sibling){ + sib = child->attrs.sibling; + if(sib < d->info.len && d->info.data+sib > child->b.p) + child->b.p = d->info.data+sib; + else if (sib >= d->info.len) { + werrstr("sibling reported as out of bounds %d vs %d", sib, d->info.len); + return -1; + } else if (d->info.data+sib+parent->unit < child->b.p) { + werrstr("subsequent sibling is listed before prev %d vs %d", sib+parent->unit, child->b.p - d->info.data); + return -1; + } + } + + // Uninitialized + if (!child->b.d) { + child->b = parent->b; + child->b.p = parent->childoff + parent->b.d->info.data; + } + + return dwarfnextsym(d, child); } typedef struct Parse Parse; struct Parse { - int name; - int off; - int haveoff; - int type; + int name; + int off; + int haveoff; + int type; }; #define OFFSET(x) offsetof(DwarfAttrs, x), offsetof(DwarfAttrs, have.x) static Parse plist[] = { /* Font Tab 4 */ - { DwarfAttrAbstractOrigin, OFFSET(abstractorigin), TReference }, - { DwarfAttrAccessibility, OFFSET(accessibility), TConstant }, - { DwarfAttrAddrClass, OFFSET(addrclass), TConstant }, - { DwarfAttrArtificial, OFFSET(isartificial), TFlag }, - { DwarfAttrBaseTypes, OFFSET(basetypes), TReference }, - { DwarfAttrBitOffset, OFFSET(bitoffset), TConstant }, - { DwarfAttrBitSize, OFFSET(bitsize), TConstant }, - { DwarfAttrByteSize, OFFSET(bytesize), TConstant }, - { DwarfAttrCalling, OFFSET(calling), TConstant }, - { DwarfAttrCommonRef, OFFSET(commonref), TReference }, - { DwarfAttrCompDir, OFFSET(compdir), TString }, - { DwarfAttrConstValue, OFFSET(constvalue), TString|TConstant|TBlock }, - { DwarfAttrContainingType, OFFSET(containingtype), TReference }, - { DwarfAttrCount, OFFSET(count), TConstant|TReference }, - { DwarfAttrDataMemberLoc, OFFSET(datamemberloc), TBlock|TConstant|TReference }, - { DwarfAttrDeclColumn, OFFSET(declcolumn), TConstant }, - { DwarfAttrDeclFile, OFFSET(declfile), TConstant }, - { DwarfAttrDeclLine, OFFSET(declline), TConstant }, - { DwarfAttrDeclaration, OFFSET(isdeclaration), TFlag }, - { DwarfAttrDefaultValue, OFFSET(defaultvalue), TReference }, - { DwarfAttrDiscr, OFFSET(discr), TReference }, - { DwarfAttrDiscrList, OFFSET(discrlist), TBlock }, - { DwarfAttrDiscrValue, OFFSET(discrvalue), TConstant }, - { DwarfAttrEncoding, OFFSET(encoding), TConstant }, - { DwarfAttrExternal, OFFSET(isexternal), TFlag }, - { DwarfAttrFrameBase, OFFSET(framebase), TBlock|TConstant }, - { DwarfAttrFriend, OFFSET(friend), TReference }, - { DwarfAttrHighpc, OFFSET(highpc), TAddress }, - { DwarfAttrEntrypc, OFFSET(entrypc), TAddress }, - { DwarfAttrIdentifierCase, OFFSET(identifiercase), TConstant }, - { DwarfAttrImport, OFFSET(import), TReference }, - { DwarfAttrInline, OFFSET(inlined), TConstant }, - { DwarfAttrIsOptional, OFFSET(isoptional), TFlag }, - { DwarfAttrLanguage, OFFSET(language), TConstant }, - { DwarfAttrLocation, OFFSET(location), TBlock|TConstant }, - { DwarfAttrLowerBound, OFFSET(lowerbound), TConstant|TReference }, - { DwarfAttrLowpc, OFFSET(lowpc), TAddress }, - { DwarfAttrMacroInfo, OFFSET(macroinfo), TConstant }, - { DwarfAttrName, OFFSET(name), TString }, - { DwarfAttrNamelistItem, OFFSET(namelistitem), TBlock }, - { DwarfAttrOrdering, OFFSET(ordering), TConstant }, - { DwarfAttrPriority, OFFSET(priority), TReference }, - { DwarfAttrProducer, OFFSET(producer), TString }, - { DwarfAttrPrototyped, OFFSET(isprototyped), TFlag }, - { DwarfAttrRanges, OFFSET(ranges), TReference }, - { DwarfAttrReturnAddr, OFFSET(returnaddr), TBlock|TConstant }, - { DwarfAttrSegment, OFFSET(segment), TBlock|TConstant }, - { DwarfAttrSibling, OFFSET(sibling), TReference }, - { DwarfAttrSpecification, OFFSET(specification), TReference }, - { DwarfAttrStartScope, OFFSET(startscope), TConstant }, - { DwarfAttrStaticLink, OFFSET(staticlink), TBlock|TConstant }, - { DwarfAttrStmtList, OFFSET(stmtlist), TConstant }, - { DwarfAttrStrideSize, OFFSET(stridesize), TConstant }, - { DwarfAttrStringLength, OFFSET(stringlength), TBlock|TConstant }, - { DwarfAttrType, OFFSET(type), TReference }, - { DwarfAttrUpperBound, OFFSET(upperbound), TConstant|TReference }, - { DwarfAttrUseLocation, OFFSET(uselocation), TBlock|TConstant }, - { DwarfAttrVarParam, OFFSET(isvarparam), TFlag }, - { DwarfAttrVirtuality, OFFSET(virtuality), TConstant }, - { DwarfAttrVisibility, OFFSET(visibility), TConstant }, - { DwarfAttrVtableElemLoc, OFFSET(vtableelemloc), TBlock|TReference }, - { } + { DwarfAttrAbstractOrigin, OFFSET(abstractorigin), TReference }, + { DwarfAttrAccessibility, OFFSET(accessibility), TConstant }, + { DwarfAttrAddrClass, OFFSET(addrclass), TConstant }, + { DwarfAttrArtificial, OFFSET(isartificial), TFlag }, + { DwarfAttrBaseTypes, OFFSET(basetypes), TReference }, + { DwarfAttrBitOffset, OFFSET(bitoffset), TConstant }, + { DwarfAttrBitSize, OFFSET(bitsize), TConstant }, + { DwarfAttrByteSize, OFFSET(bytesize), TConstant }, + { DwarfAttrCalling, OFFSET(calling), TConstant }, + { DwarfAttrCommonRef, OFFSET(commonref), TReference }, + { DwarfAttrCompDir, OFFSET(compdir), TString }, + { DwarfAttrConstValue, OFFSET(constvalue), TString|TConstant|TBlock }, + { DwarfAttrContainingType, OFFSET(containingtype), TReference }, + { DwarfAttrCount, OFFSET(count), TConstant|TReference }, + { DwarfAttrDataMemberLoc, OFFSET(datamemberloc), TBlock|TConstant|TReference }, + { DwarfAttrDeclColumn, OFFSET(declcolumn), TConstant }, + { DwarfAttrDeclFile, OFFSET(declfile), TConstant }, + { DwarfAttrDeclLine, OFFSET(declline), TConstant }, + { DwarfAttrDeclaration, OFFSET(isdeclaration), TFlag }, + { DwarfAttrDefaultValue, OFFSET(defaultvalue), TReference }, + { DwarfAttrDiscr, OFFSET(discr), TReference }, + { DwarfAttrDiscrList, OFFSET(discrlist), TBlock }, + { DwarfAttrDiscrValue, OFFSET(discrvalue), TConstant }, + { DwarfAttrEncoding, OFFSET(encoding), TConstant }, + { DwarfAttrExternal, OFFSET(isexternal), TFlag }, + { DwarfAttrFrameBase, OFFSET(framebase), TBlock|TConstant }, + { DwarfAttrFriend, OFFSET(friend), TReference }, + { DwarfAttrHighpc, OFFSET(highpc), TAddress }, + { DwarfAttrEntrypc, OFFSET(entrypc), TAddress }, + { DwarfAttrIdentifierCase, OFFSET(identifiercase), TConstant }, + { DwarfAttrImport, OFFSET(import), TReference }, + { DwarfAttrInline, OFFSET(inlined), TConstant }, + { DwarfAttrIsOptional, OFFSET(isoptional), TFlag }, + { DwarfAttrLanguage, OFFSET(language), TConstant }, + { DwarfAttrLocation, OFFSET(location), TReference|TBlock }, + { DwarfAttrLowerBound, OFFSET(lowerbound), TConstant|TReference }, + { DwarfAttrLowpc, OFFSET(lowpc), TAddress }, + { DwarfAttrMacroInfo, OFFSET(macroinfo), TConstant }, + { DwarfAttrName, OFFSET(name), TString }, + { DwarfAttrNamelistItem, OFFSET(namelistitem), TBlock }, + { DwarfAttrOrdering, OFFSET(ordering), TConstant }, + { DwarfAttrPriority, OFFSET(priority), TReference }, + { DwarfAttrProducer, OFFSET(producer), TString }, + { DwarfAttrPrototyped, OFFSET(isprototyped), TFlag }, + { DwarfAttrRanges, OFFSET(ranges), TReference }, + { DwarfAttrReturnAddr, OFFSET(returnaddr), TBlock|TConstant }, + { DwarfAttrSegment, OFFSET(segment), TBlock|TConstant }, + { DwarfAttrSibling, OFFSET(sibling), TReference }, + { DwarfAttrSpecification, OFFSET(specification), TReference }, + { DwarfAttrStartScope, OFFSET(startscope), TConstant }, + { DwarfAttrStaticLink, OFFSET(staticlink), TBlock|TConstant }, + { DwarfAttrStmtList, OFFSET(stmtlist), TConstant }, + { DwarfAttrStrideSize, OFFSET(stridesize), TConstant }, + { DwarfAttrStringLength, OFFSET(stringlength), TBlock|TConstant }, + { DwarfAttrType, OFFSET(type), TReference }, + { DwarfAttrUpperBound, OFFSET(upperbound), TConstant|TReference }, + { DwarfAttrUseLocation, OFFSET(uselocation), TBlock|TConstant }, + { DwarfAttrVarParam, OFFSET(isvarparam), TFlag }, + { DwarfAttrVirtuality, OFFSET(virtuality), TConstant }, + { DwarfAttrVisibility, OFFSET(visibility), TConstant }, + { DwarfAttrVtableElemLoc, OFFSET(vtableelemloc), TBlock|TReference }, + { } }; static Parse ptab[DwarfAttrMax]; static int -parseattrs(DwarfBuf *b, ulong unit, DwarfAbbrev *a, DwarfAttrs *attrs) +parseattrs(Dwarf *d, DwarfBuf *b, ulong tag, ulong unit, DwarfAbbrev *a, DwarfAttrs *attrs) { - int i, f, n, got; - static int nbad; - void *v; + int i, f, n, got; + static int nbad; + void *v; - /* initialize ptab first time through for quick access */ - if(ptab[DwarfAttrName].name != DwarfAttrName) - for(i=0; plist[i].name; i++) - ptab[plist[i].name] = plist[i]; + /* initialize ptab first time through for quick access */ + if(ptab[DwarfAttrName].name != DwarfAttrName) + for(i=0; plist[i].name; i++) + ptab[plist[i].name] = plist[i]; - memset(attrs, 0, sizeof *attrs); - attrs->tag = a->tag; - attrs->haskids = a->haskids; + memset(attrs, 0, sizeof *attrs); + attrs->tag = a->tag; + attrs->haskids = a->haskids; - for(i=0; inattr; i++){ - n = a->attr[i].name; - f = a->attr[i].form; - if(n < 0 || n >= DwarfAttrMax || ptab[n].name==0){ - if(++nbad == 1) - werrstr("dwarf parse attrs: unexpected attribute name 0x%x", n); - continue; //return -1; - } - v = (char*)attrs + ptab[n].off; - got = 0; - if(f == FormIndirect) - f = dwarfget128(b); - if((ptab[n].type&(TConstant|TReference|TAddress)) - && getulong(b, f, unit, v, &got) >= 0) - ; - else if((ptab[n].type&TFlag) && getuchar(b, f, v) >= 0) - got = TFlag; - else if((ptab[n].type&TString) && getstring(b, f, v) >= 0) - got = TString; - else if((ptab[n].type&TBlock) && getblock(b, f, v) >= 0) - got = TBlock; - else{ - if(skipform(b, f) < 0){ - if(++nbad == 1) - werrstr("dwarf parse attrs: cannot skip form %d", f); - return -1; - } - } - if(got == TBlock && (ptab[n].type&TConstant)) - got = constblock(b->d, v, v); - *((uchar*)attrs+ptab[n].haveoff) = got; - } - return 0; + for(i=0; inattr; i++){ + n = a->attr[i].name; + f = a->attr[i].form; + if(n < 0 || n >= DwarfAttrMax || ptab[n].name==0) { + if (skipform(d, b, f) < 0) { + if(++nbad == 1) + werrstr("dwarf parse attrs: cannot skip form %d", f); + return -1; + } + continue; + } + v = (char*)attrs + ptab[n].off; + got = 0; + if(f == FormIndirect) + f = dwarfget128(b); + if((ptab[n].type&(TConstant|TReference|TAddress)) + && getulong(b, f, unit, v, &got) >= 0) + ; + else if((ptab[n].type&TFlag) && getuchar(b, f, v) >= 0) + got = TFlag; + else if((ptab[n].type&TString) && getstring(d, b, f, v) >= 0) + got = TString; + else if((ptab[n].type&TBlock) && getblock(b, f, v) >= 0) + got = TBlock; + else { + if(skipform(d, b, f) < 0){ + if(++nbad == 1) + werrstr("dwarf parse attrs: cannot skip form %d", f); + return -1; + } + } +#if 0 + if(got == TBlock && (ptab[n].type&TConstant)) + got = constblock(b->d, v, v); +#endif + *((uchar*)attrs+ptab[n].haveoff) = got; + } + return 0; } static int getulong(DwarfBuf *b, int form, ulong unit, ulong *u, int *type) { - static int nbad; - uvlong uv; + static int nbad; + uvlong uv; - switch(form){ - default: - return -1; + switch(form){ + default: + return -1; /* addresses */ - case FormAddr: - *type = TAddress; - *u = dwarfgetaddr(b); - return 0; + case FormAddr: + *type = TAddress; + *u = dwarfgetaddr(b); + return 0; /* references */ - case FormRefAddr: - /* absolute ref in .debug_info */ - *type = TReference; - *u = dwarfgetaddr(b); - return 0; - case FormRef1: - *u = dwarfget1(b); - goto relativeref; - case FormRef2: - *u = dwarfget2(b); - goto relativeref; - case FormRef4: - *u = dwarfget4(b); - goto relativeref; - case FormRef8: - *u = dwarfget8(b); - goto relativeref; - case FormRefUdata: - *u = dwarfget128(b); - relativeref: - *u += unit; - *type = TReference; - return 0; + case FormRefAddr: + /* absolute ref in .debug_info */ + *type = TReference; + *u = dwarfgetaddr(b); + return 0; + case FormRef1: + *u = dwarfget1(b); + goto relativeref; + case FormRef2: + *u = dwarfget2(b); + goto relativeref; + case FormRef4: + *u = dwarfget4(b); + goto relativeref; + case FormRef8: + *u = dwarfget8(b); + goto relativeref; + case FormRefUdata: + *u = dwarfget128(b); + relativeref: + *u += unit; + *type = TReference; + return 0; /* constants */ - case FormData1: - *u = dwarfget1(b); - goto constant; - case FormData2: - *u = dwarfget2(b); - goto constant; - case FormData4: - *u = dwarfget4(b); - goto constant; - case FormData8: - uv = dwarfget8(b); - *u = uv; - if(uv != *u && ++nbad == 1) - werrstr("dwarf: truncating 64-bit attribute constants"); - goto constant; - case FormSdata: - *u = dwarfget128s(b); - goto constant; - case FormUdata: - *u = dwarfget128(b); - constant: - *type = TConstant; - return 0; - } + case FormData1: + *u = dwarfget1(b); + goto constant; + case FormData2: + *u = dwarfget2(b); + goto constant; + case FormData4: + *u = dwarfget4(b); + goto constant; + case FormData8: + uv = dwarfget8(b); + *u = uv; + if(uv != *u && ++nbad == 1) + werrstr("dwarf: truncating 64-bit attribute constants"); + goto constant; + case FormSdata: + *u = dwarfget128s(b); + goto constant; + case FormUdata: + *u = dwarfget128(b); + constant: + *type = TConstant; + return 0; + } } static int getuchar(DwarfBuf *b, int form, uchar *u) { - switch(form){ - default: - return -1; + switch(form){ + default: + return -1; - case FormFlag: - *u = dwarfget1(b); - return 0; - } + case FormFlag: + *u = dwarfget1(b); + return 0; + } } static int -getstring(DwarfBuf *b, int form, char **s) +getstring(Dwarf *d, DwarfBuf *b, int form, char **s) { - static int nbad; - ulong u; + static int nbad; + ulong u, x; - switch(form){ - default: - return -1; + switch(form){ + default: + return -1; - case FormString: - *s = dwarfgetstring(b); - return 0; + case FormString: + x = b->p - d->info.data; + *s = dwarfgetstring(b); + for (u = 0; (*s)[u]; u++) { + assert(isprint((*s)[u])); + } + return 0; - case FormStrp: - u = dwarfget4(b); - if(u >= b->d->str.len){ - if(++nbad == 1) - werrstr("dwarf: bad string pointer 0x%lux in attribute", u); - /* don't return error - maybe can proceed */ - *s = nil; - }else - *s = (char*)b->d->str.data + u; - return 0; + case FormStrp: + u = dwarfget4(b); + if(u >= b->d->str.len){ + if(++nbad == 1) + werrstr("dwarf: bad string pointer 0x%lux in attribute", u); + /* don't return error - maybe can proceed */ + *s = nil; + }else + *s = (char*)b->d->str.data + u; + return 0; - } + } } static int getblock(DwarfBuf *b, int form, DwarfBlock *bl) { - ulong n; + ulong n; - switch(form){ - default: - return -1; - case FormDwarfBlock: - n = dwarfget128(b); - goto copyn; - case FormDwarfBlock1: - n = dwarfget1(b); - goto copyn; - case FormDwarfBlock2: - n = dwarfget2(b); - goto copyn; - case FormDwarfBlock4: - n = dwarfget4(b); - copyn: - bl->data = dwarfgetnref(b, n); - bl->len = n; - if(bl->data == nil) - return -1; - return 0; - } -} - -static int -constblock(Dwarf *d, DwarfBlock *bl, ulong *pval) -{ - DwarfBuf b; - - memset(&b, 0, sizeof b); - b.p = bl->data; - b.ep = bl->data+bl->len; - b.d = d; - - switch(dwarfget1(&b)){ - case OpAddr: - *pval = dwarfgetaddr(&b); - return TConstant; - case OpConst1u: - *pval = dwarfget1(&b); - return TConstant; - case OpConst1s: - *pval = (schar)dwarfget1(&b); - return TConstant; - case OpConst2u: - *pval = dwarfget2(&b); - return TConstant; - case OpConst2s: - *pval = (s16int)dwarfget2(&b); - return TConstant; - case OpConst4u: - *pval = dwarfget4(&b); - return TConstant; - case OpConst4s: - *pval = (s32int)dwarfget4(&b); - return TConstant; - case OpConst8u: - *pval = (u64int)dwarfget8(&b); - return TConstant; - case OpConst8s: - *pval = (s64int)dwarfget8(&b); - return TConstant; - case OpConstu: - *pval = dwarfget128(&b); - return TConstant; - case OpConsts: - *pval = dwarfget128s(&b); - return TConstant; - case OpPlusUconst: - *pval = dwarfget128(&b); - return TConstant; - default: - return TBlock; - } + switch(form){ + default: + return -1; + case FormDwarfBlock: + n = dwarfget128(b); + goto copyn; + case FormDwarfBlock1: + n = dwarfget1(b); + goto copyn; + case FormDwarfBlock2: + n = dwarfget2(b); + goto copyn; + case FormDwarfBlock4: + n = dwarfget4(b); + copyn: + bl->data = dwarfgetnref(b, n); + bl->len = n; + if(bl->data == nil) + return -1; + return 0; + } } /* last resort */ static int -skipform(DwarfBuf *b, int form) +skipform(Dwarf *d, DwarfBuf *b, int form) { - int type; - DwarfVal val; + int type; + DwarfVal val; - if(getulong(b, form, 0, &val.c, &type) < 0 - && getuchar(b, form, (uchar*)&val) < 0 - && getstring(b, form, &val.s) < 0 - && getblock(b, form, &val.b) < 0) - return -1; - return 0; + if(getulong(b, form, 0, &val.c, &type) < 0 + && getuchar(b, form, (uchar*)&val) < 0 + && getstring(d, b, form, &val.s) < 0 + && getblock(b, form, &val.b) < 0) + return -1; + return 0; } +void stackinit(DwarfStack *stack) +{ + memset(stack, 0, sizeof(*stack)); + stack->data = stack->storage; + stack->length = 0; stack->max = sizeof(stack->storage) / sizeof(stack->storage[0]); +} + +void stackpush(DwarfStack *stack, ulong value) +{ + if (stack->length == stack->max) { + ulong *newstack = malloc(sizeof(ulong)*stack->max*2); + memcpy(newstack, stack->data, sizeof(ulong)*stack->length); + if (stack->data != stack->storage) + free(stack->data); + stack->data = newstack; + stack->max *= 2; + } + werrstr("stack[%d] = %x", stack->length, value); + stack->data[stack->length++] = value; +} + +ulong stackpop(DwarfStack *stack) +{ + ASSERT(stack->length > 0); + ulong val = stack->data[--stack->length]; + werrstr("pop stack[%d] -> %x", stack->length, val); + return val; +} + +void stackfree(DwarfStack *stack) +{ + if (stack->data != stack->storage) + free(stack->data); +} + +// Returns -1 on failure +int dwarfgetarg(Dwarf *d, const char *name, DwarfBuf *buf, ulong cfa, PROSSYM_REGISTERS registers, ulong *result) +{ + int ret = 0; + DwarfStack stack = { }; + stackinit(&stack); + while (buf->p < buf->ep) { + int opcode = dwarfget1(buf); + werrstr("opcode %x", opcode); + switch (opcode) { + case 0: + buf->p = buf->ep; + break; + case OpAddr: + if (d->addrsize == 4) { + stackpush(&stack, dwarfget4(buf)); + break; + } else { + werrstr("%s: we only support 4 byte addrs", name); + goto fatal; + } + case OpConst1s: { + signed char c = dwarfget1(buf); + stackpush(&stack, c); + } break; + case OpConst1u: + stackpush(&stack, dwarfget1(buf)); + break; + case OpConst2s: { + signed short s = dwarfget2(buf); + stackpush(&stack, s); + } break; + case OpConst2u: + stackpush(&stack, dwarfget2(buf)); + break; + case OpConst4s: { + signed int i = dwarfget4(buf); + stackpush(&stack, i); + } break; + case OpConst4u: + stackpush(&stack, dwarfget4(buf)); + break; + case OpConst8s: + case OpConst8u: + werrstr("const 8 not yet supported"); + goto fatal; + case OpConsts: + stackpush(&stack, dwarfget128s(buf)); + break; + case OpConstu: + stackpush(&stack, dwarfget128(buf)); + break; + case OpDup: { + ulong popped = stackpop(&stack); + stackpush(&stack, popped); + stackpush(&stack, popped); + } break; + case OpDrop: + stackpop(&stack); + break; + case OpOver: { + if (stack.length < 2) goto fatal; + stackpush(&stack, stack.data[stack.length-2]); + } break; + case OpPick: { + ulong arg = dwarfget1(buf); + if (arg >= stack.length) goto fatal; + arg = stack.data[stack.length-1-arg]; + stackpush(&stack, arg); + } break; + case OpSwap: { + ulong a = stackpop(&stack), b = stackpop(&stack); + stackpush(&stack, b); + stackpush(&stack, a); + } break; + case OpRot: { + ulong a = stackpop(&stack), b = stackpop(&stack), c = stackpop(&stack); + stackpush(&stack, b); + stackpush(&stack, c); + stackpush(&stack, a); + } break; + case OpXderef: + case OpXderefSize: + werrstr("Xderef not yet supported"); + goto fatal; + case OpAbs: { + long a = stackpop(&stack); + stackpush(&stack, a < 0 ? -a : a); + } break; + case OpAnd: + stackpush(&stack, stackpop(&stack) & stackpop(&stack)); + break; + case OpDiv: { + ulong a = stackpop(&stack), b = stackpop(&stack); + stackpush(&stack, b / a); + } break; + case OpMinus: { + ulong a = stackpop(&stack), b = stackpop(&stack); + stackpush(&stack, b - a); + } break; + case OpMod: { + ulong a = stackpop(&stack), b = stackpop(&stack); + stackpush(&stack, b % a); + } break; + case OpMul: + stackpush(&stack, stackpop(&stack) * stackpop(&stack)); + break; + case OpNeg: + stackpush(&stack, -stackpop(&stack)); + break; + case OpNot: + stackpush(&stack, ~stackpop(&stack)); + break; + case OpOr: + stackpush(&stack, stackpop(&stack) | stackpop(&stack)); + break; + case OpPlus: + stackpush(&stack, stackpop(&stack) + stackpop(&stack)); + break; + case OpPlusUconst: + stackpush(&stack, stackpop(&stack) + dwarfget128(buf)); + break; + case OpShl: { + ulong a = stackpop(&stack), b = stackpop(&stack); + stackpush(&stack, b << a); + } break; + case OpShr: { + ulong a = stackpop(&stack), b = stackpop(&stack); + stackpush(&stack, b >> a); + } break; + case OpShra: { + ulong a = stackpop(&stack); + long b = stackpop(&stack); + if (b < 0) + b = -(-b >> a); + else + b = b >> a; + stackpush(&stack, b); + } break; + case OpXor: + stackpush(&stack, stackpop(&stack) ^ stackpop(&stack)); + break; + case OpSkip: + buf->p += dwarfget2(buf); + break; + case OpBra: { + ulong a = dwarfget2(buf); + if (stackpop(&stack)) + buf->p += a; + } break; + case OpEq: + stackpush(&stack, stackpop(&stack) == stackpop(&stack)); + break; + case OpGe: { + ulong a = stackpop(&stack), b = stackpop(&stack); + stackpush(&stack, b >= a); + } break; + case OpGt: { + ulong a = stackpop(&stack), b = stackpop(&stack); + stackpush(&stack, b > a); + } break; + case OpLe: { + ulong a = stackpop(&stack), b = stackpop(&stack); + stackpush(&stack, b <= a); + } break; + case OpLt: { + ulong a = stackpop(&stack), b = stackpop(&stack); + stackpush(&stack, b < a); + } break; + case OpNe: + stackpush(&stack, stackpop(&stack) != stackpop(&stack)); + break; + case OpNop: + break; + case OpDeref: { + ulong val, addr = stackpop(&stack); + if (!RosSymCallbacks.MemGetProc + (d->pe->fd, + &val, + addr, + d->addrsize)) + goto fatal; + stackpush(&stack, val); + } break; + case OpDerefSize: { + ulong val, addr = stackpop(&stack), size = dwarfget1(buf); + if (!RosSymCallbacks.MemGetProc + (d->pe->fd, + &val, + addr, + size)) + goto fatal; + stackpush(&stack, val); + } break; + case OpFbreg: { + ulong val, addr = cfa, offset = dwarfget128s(buf); + werrstr("FBREG cfa %x offset %x", cfa, offset); + if (!RosSymCallbacks.MemGetProc + (d->pe->fd, + &val, + addr+offset, + d->addrsize)) + goto fatal; + stackpush(&stack, val); + } break; + case OpPiece: + werrstr("OpPiece not supported"); + goto fatal; + default: + if (opcode >= OpLit0 && opcode < OpReg0) + stackpush(&stack, opcode - OpLit0); + else if (opcode >= OpReg0 && opcode < OpBreg0) { + ulong reg = opcode - OpReg0; + werrstr("REG[%d] value %x", reg, (ulong)registers->Registers[reg]); + stackpush(&stack, registers->Registers[reg]); + } else if (opcode >= OpBreg0 && opcode < OpRegx) { + ulong val, + reg = opcode - OpBreg0, + addr = registers->Registers[reg], + offset = dwarfget128s(buf); + werrstr("BREG[%d] reg %x offset %x", reg, addr, offset); + if (!RosSymCallbacks.MemGetProc + (d->pe->fd, + &val, + addr + offset, + d->addrsize)) + goto fatal; + stackpush(&stack, val); + } else { + werrstr("opcode %x not supported", opcode); + goto fatal; + } + break; + } + } + if (stack.length < 1) goto fatal; + *result = stackpop(&stack); + werrstr("%s: value %x", name, *result); + goto finish; + +fatal: + ret = -1; + +finish: + stackfree(&stack); + return ret; +} + +int dwarfargvalue(Dwarf *d, DwarfSym *proc, ulong pc, ulong cfa, PROSSYM_REGISTERS registers, DwarfParam *parameter) +{ + int gotarg; + DwarfSym unit = { }; + + if (dwarfenumunit(d, proc->unit, &unit) == -1) + return -1; + + werrstr("lookup in unit %x-%x, pc %x", unit.attrs.lowpc, unit.attrs.highpc, pc); + pc -= unit.attrs.lowpc; + + werrstr("paramblock %s -> unit %x type %x fde %x len %d registers %x", + parameter->name, + parameter->unit, + parameter->type, + parameter->fde, + parameter->len, + registers); + + // Seek our range in loc + DwarfBuf locbuf; + DwarfBuf instream = { }; + + locbuf.d = d; + locbuf.addrsize = d->addrsize; + + if (parameter->loctype == TConstant) { + locbuf.p = d->loc.data + parameter->fde; + locbuf.ep = d->loc.data + d->loc.len; + ulong start, end, len; + do { + len = 0; + start = dwarfget4(&locbuf); + end = dwarfget4(&locbuf); + if (start && end) { + len = dwarfget2(&locbuf); + instream = locbuf; + instream.ep = instream.p + len; + locbuf.p = instream.ep; + } + werrstr("ip %x s %x e %x (%x bytes)", pc, start, end, len); + } while (start && end && (start > pc || end <= pc)); + } else if (parameter->loctype == TBlock) { + instream = locbuf; + instream.p = (void *)parameter->fde; + instream.ep = instream.p + parameter->len; + } else { + werrstr("Wrong block type for parameter %s", parameter->name); + return -1; + } + + gotarg = dwarfgetarg(d, parameter->name, &instream, cfa, registers, ¶meter->value); + if (gotarg == -1) + return -1; + + return 0; +} + +int +dwarfgetparams(Dwarf *d, DwarfSym *s, ulong pc, int pnum, DwarfParam *paramblocks) +{ + int ip = 0; + DwarfSym param = { }; + int res = dwarfnextsymat(d, s, ¶m); + while (res == 0 && ip < pnum) { + if (param.attrs.tag == TagFormalParameter && + param.attrs.have.name && + param.attrs.have.location) { + paramblocks[ip].name = malloc(strlen(param.attrs.name)+1); + strcpy(paramblocks[ip].name, param.attrs.name); + paramblocks[ip].unit = param.unit; + paramblocks[ip].type = param.attrs.type; + paramblocks[ip].loctype = param.attrs.have.location; + paramblocks[ip].len = param.attrs.location.b.len; + paramblocks[ip].fde = param.attrs.location.b.data; + werrstr("param[%d] block %s -> type %x loctype %x fde %x len %x", + ip, + paramblocks[ip].name, + paramblocks[ip].type, + paramblocks[ip].loctype, + paramblocks[ip].fde, + paramblocks[ip].len); + ip++; + } + res = dwarfnextsymat(d, s, ¶m); + } + return ip; +} diff --git a/lib/rossym/dwarfopen.c b/lib/rossym/dwarfopen.c index 9a5f20c80fa..b3ea2cd18d6 100644 --- a/lib/rossym/dwarfopen.c +++ b/lib/rossym/dwarfopen.c @@ -31,7 +31,8 @@ dwarfopen(Pe *pe) || pe->loadsection(pe, ".debug_aranges", &d->aranges) < 0 || pe->loadsection(pe, ".debug_line", &d->line) < 0 || pe->loadsection(pe, ".debug_pubnames", &d->pubnames) < 0 - || pe->loadsection(pe, ".debug_info", &d->info) < 0) + || pe->loadsection(pe, ".debug_info", &d->info) < 0 + || pe->loadsection(pe, ".debug_loc", &d->loc) < 0) goto err; pe->loadsection(pe, ".debug_frame", &d->frame); pe->loadsection(pe, ".debug_ranges", &d->ranges); @@ -49,6 +50,7 @@ err: free(d->ranges.data); free(d->str.data); free(d->info.data); + free(d->loc.data); free(d); return nil; } diff --git a/lib/rossym/dwarfpc.c b/lib/rossym/dwarfpc.c index 4edb5569ae9..ec41e10d16c 100644 --- a/lib/rossym/dwarfpc.c +++ b/lib/rossym/dwarfpc.c @@ -27,359 +27,389 @@ enum { - Isstmt = 1<<0, - BasicDwarfBlock = 1<<1, - EndSequence = 1<<2, - PrologueEnd = 1<<3, - EpilogueBegin = 1<<4 + Isstmt = 1<<0, + BasicDwarfBlock = 1<<1, + EndSequence = 1<<2, + PrologueEnd = 1<<3, + EpilogueBegin = 1<<4 }; typedef struct State State; struct State { - ulong addr; - ulong file; - ulong line; - ulong column; - ulong flags; - ulong isa; + ulong addr; + ulong file; + ulong line; + ulong column; + ulong flags; + ulong isa; }; int -dwarfpctoline(Dwarf *d, ulong pc, char **cdir, char **dir, char **file, char **function, ulong *line, ulong *mtime, ulong *length) +dwarfpctoline(Dwarf *d, DwarfSym *proc, ulong pc, char **file, char **function, ulong *line) { - uchar *prog, *opcount, *end, *dirs; - ulong off, unit, len, vers, x, start, lastline; - int i, first, firstline, op, a, l, quantum, isstmt, linebase, linerange, opcodebase, nf; - char *files, *s; - DwarfBuf b; - DwarfSym sym; - State emit, cur, reset; - uchar **f, **newf; + char *cdir; + uchar *prog, *opcount, *end, *dirs; + ulong off, unit, len, vers, x, start, lastline; + int i, first, firstline, op, a, l, quantum, isstmt, linebase, linerange, opcodebase, nf; + char *files, *s; + DwarfBuf b; + DwarfSym sym; + State emit, cur, reset; + char **f, **newf; - f = nil; + f = nil; + memset(proc, 0, sizeof(*proc)); - if(dwarfaddrtounit(d, pc, &unit) < 0 - || dwarflookuptag(d, unit, TagCompileUnit, &sym) < 0) - return -1; + int runit = dwarfaddrtounit(d, pc, &unit); + if (runit < 0) + return -1; + int rtag = dwarflookuptag(d, unit, TagCompileUnit, &sym); + if (rtag < 0) + return -1; - if(!sym.attrs.have.stmtlist){ - werrstr("no line mapping information for 0x%x", pc); - return -1; - } - off = sym.attrs.stmtlist; - if(off >= d->line.len){ - werrstr("bad stmtlist\n"); - goto bad; + if(!sym.attrs.have.stmtlist){ + werrstr("no line mapping information for 0x%x", pc); + return -1; + } + off = sym.attrs.stmtlist; + if(off >= d->line.len){ + werrstr("bad stmtlist"); + goto bad; + } + + if(trace) werrstr("unit 0x%x stmtlist 0x%x", unit, sym.attrs.stmtlist); + + memset(&b, 0, sizeof b); + b.d = d; + b.p = d->line.data + off; + b.ep = b.p + d->line.len; + b.addrsize = sym.b.addrsize; /* should i get this from somewhere else? */ + + len = dwarfget4(&b); + if(b.p==nil || b.p+len > b.ep || b.p+len < b.p){ + werrstr("bad len"); + goto bad; + } + + b.ep = b.p+len; + vers = dwarfget2(&b); + if(vers != 2){ + werrstr("bad dwarf version 0x%x", vers); + return -1; + } + + len = dwarfget4(&b); + if(b.p==nil || b.p+len > b.ep || b.p+len < b.p){ + werrstr("another bad len"); + goto bad; + } + prog = b.p+len; + + quantum = dwarfget1(&b); + isstmt = dwarfget1(&b); + linebase = (schar)dwarfget1(&b); + linerange = (schar)dwarfget1(&b); + opcodebase = dwarfget1(&b); + + opcount = b.p-1; + dwarfgetnref(&b, opcodebase-1); + if(b.p == nil){ + werrstr("bad opcode chart"); + goto bad; + } + + /* just skip the files and dirs for now; we'll come back */ + dirs = b.p; + while (b.p && *b.p) + dwarfgetstring(&b); + dwarfget1(&b); + + files = (char*)b.p; + while(b.p!=nil && *b.p!=0){ + dwarfgetstring(&b); + dwarfget128(&b); + dwarfget128(&b); + dwarfget128(&b); + } + dwarfget1(&b); + + /* move on to the program */ + if(b.p == nil || b.p > prog){ + werrstr("bad header"); + goto bad; + } + b.p = prog; + + reset.addr = 0; + reset.file = 1; + reset.line = 1; + reset.column = 0; + reset.flags = isstmt ? Isstmt : 0; + reset.isa = 0; + + cur = reset; + emit = reset; + nf = 0; + start = 0; + if(trace) werrstr("program @ %lu ... %.*H opbase = %d", b.p - d->line.data, b.ep-b.p, b.p, opcodebase); + first = 1; + while(b.p != nil){ + firstline = 0; + op = dwarfget1(&b); + if(trace) werrstr("\tline %lu, addr 0x%x, op %d %.10H", cur.line, cur.addr, op, b.p); + if(op >= opcodebase){ + a = (op - opcodebase) / linerange; + l = (op - opcodebase) % linerange + linebase; + cur.line += l; + cur.addr += a * quantum; + if(trace) werrstr(" +%d,%d", a, l); + emit: + if(first){ + if(cur.addr > pc){ + werrstr("found wrong line mapping 0x%x for pc 0x%x", cur.addr, pc); + /* This is an overzealous check. gcc can produce discontiguous ranges + and reorder statements, so it's possible for a future line to start + ahead of pc and still find a matching one. */ + /*goto out;*/ + firstline = 1; + } + first = 0; + start = cur.addr; + } + if(cur.addr > pc && !firstline) + break; + if(b.p == nil){ + werrstr("buffer underflow in line mapping"); + goto out; + } + emit = cur; + if(emit.flags & EndSequence){ + werrstr("found wrong line mapping 0x%x-0x%x for pc 0x%x", start, cur.addr, pc); + goto out; + } + cur.flags &= ~(BasicDwarfBlock|PrologueEnd|EpilogueBegin); + }else{ + switch(op){ + case 0: /* extended op code */ + if(trace) werrstr(" ext"); + len = dwarfget128(&b); + end = b.p+len; + if(b.p == nil || end > b.ep || end < b.p || len < 1) + goto bad; + switch(dwarfget1(&b)){ + case 1: /* end sequence */ + if(trace) werrstr(" end"); + cur.flags |= EndSequence; + goto emit; + case 2: /* set address */ + cur.addr = dwarfgetaddr(&b); + if(trace) werrstr(" set pc 0x%x", cur.addr); + break; + case 3: /* define file */ + newf = malloc(nf+1*sizeof(f[0])); + if (newf) + RtlMoveMemory(newf, f, nf*sizeof(f[0])); + if(newf == nil) + goto out; + free(f); + f = newf; + f[nf++] = s = dwarfgetstring(&b); + DPRINT1("str %s", s); + dwarfget128(&b); + dwarfget128(&b); + dwarfget128(&b); + if(trace) werrstr(" def file %s", s); + break; + } + if(b.p == nil || b.p > end) + goto bad; + b.p = end; + break; + case 1: /* emit */ + if(trace) werrstr(" emit"); + goto emit; + case 2: /* advance pc */ + a = dwarfget128(&b); + if(trace) werrstr(" advance pc + %lu", a*quantum); + cur.addr += a * quantum; + break; + case 3: /* advance line */ + l = dwarfget128s(&b); + if(trace) werrstr(" advance line + %ld", l); + cur.line += l; + break; + case 4: /* set file */ + if(trace) werrstr(" set file"); + cur.file = dwarfget128s(&b); + break; + case 5: /* set column */ + if(trace) werrstr(" set column"); + cur.column = dwarfget128(&b); + break; + case 6: /* negate stmt */ + if(trace) werrstr(" negate stmt"); + cur.flags ^= Isstmt; + break; + case 7: /* set basic block */ + if(trace) werrstr(" set basic block"); + cur.flags |= BasicDwarfBlock; + break; + case 8: /* const add pc */ + a = (255 - opcodebase) / linerange * quantum; + if(trace) werrstr(" const add pc + %d", a); + cur.addr += a; + break; + case 9: /* fixed advance pc */ + a = dwarfget2(&b); + if(trace) werrstr(" fixed advance pc + %d", a); + cur.addr += a; + break; + case 10: /* set prologue end */ + if(trace) werrstr(" set prologue end"); + cur.flags |= PrologueEnd; + break; + case 11: /* set epilogue begin */ + if(trace) werrstr(" set epilogue begin"); + cur.flags |= EpilogueBegin; + break; + case 12: /* set isa */ + if(trace) werrstr(" set isa"); + cur.isa = dwarfget128(&b); + break; + default: /* something new - skip it */ + if(trace) werrstr(" unknown %d", opcount[op]); + for(i=0; i 0 && b.p!=nil && *b.p!=0; i--){ + dwarfgetstring(&b); + dwarfget128(&b); + dwarfget128(&b); + dwarfget128(&b); + } + if(b.p == nil){ + werrstr("problem parsing file data second time (cannot happen)"); + goto bad; + } + if(*b.p == 0){ + if(i >= nf){ + werrstr("bad file index in mapping data"); + goto bad; + } + b.p = (uchar*)f[i]; + } + s = dwarfgetstring(&b); + *file = s; + i = dwarfget128(&b); /* directory */ + x = dwarfget128(&b); + x = dwarfget128(&b); + + /* fetch dir name */ + cdir = sym.attrs.have.compdir ? sym.attrs.compdir : 0; + + char *dwarfdir; + dwarfdir = nil; + b.p = dirs; + for (x = 1; b.p && *b.p; x++) { + dwarfdir = dwarfgetstring(&b); + if (x == i) break; } - if(trace) werrstr("unit 0x%x stmtlist 0x%x", unit, sym.attrs.stmtlist); - - memset(&b, 0, sizeof b); - b.d = d; - b.p = d->line.data + off; - b.ep = b.p + d->line.len; - b.addrsize = sym.b.addrsize; /* should i get this from somewhere else? */ - - len = dwarfget4(&b); - if(b.p==nil || b.p+len > b.ep || b.p+len < b.p){ - werrstr("bad len\n"); - goto bad; - } - - b.ep = b.p+len; - vers = dwarfget2(&b); - if(vers != 2){ - werrstr("bad dwarf version 0x%x", vers); - return -1; - } - - len = dwarfget4(&b); - if(b.p==nil || b.p+len > b.ep || b.p+len < b.p){ - werrstr("another bad len\n"); - goto bad; - } - prog = b.p+len; - - quantum = dwarfget1(&b); - isstmt = dwarfget1(&b); - linebase = (schar)dwarfget1(&b); - linerange = (schar)dwarfget1(&b); - opcodebase = dwarfget1(&b); - - opcount = b.p-1; - dwarfgetnref(&b, opcodebase-1); - if(b.p == nil){ - werrstr("bad opcode chart\n"); - goto bad; - } - - /* just skip the files and dirs for now; we'll come back */ - dirs = b.p; - while (b.p && *b.p) - dwarfgetstring(&b); - dwarfget1(&b); - - files = (char*)b.p; - while(b.p!=nil && *b.p!=0){ - dwarfgetstring(&b); - dwarfget128(&b); - dwarfget128(&b); - dwarfget128(&b); - } - dwarfget1(&b); - - /* move on to the program */ - if(b.p == nil || b.p > prog){ - werrstr("bad header\n"); - goto bad; - } - b.p = prog; - - reset.addr = 0; - reset.file = 1; - reset.line = 1; - reset.column = 0; - reset.flags = isstmt ? Isstmt : 0; - reset.isa = 0; - - cur = reset; - emit = reset; - nf = 0; - start = 0; - if(trace) werrstr("program @ %lu ... %.*H opbase = %d\n", b.p - d->line.data, b.ep-b.p, b.p, opcodebase); - first = 1; - while(b.p != nil){ - firstline = 0; - op = dwarfget1(&b); - if(trace) werrstr("\tline %lu, addr 0x%x, op %d %.10H", cur.line, cur.addr, op, b.p); - if(op >= opcodebase){ - a = (op - opcodebase) / linerange; - l = (op - opcodebase) % linerange + linebase; - cur.line += l; - cur.addr += a * quantum; - if(trace) werrstr(" +%d,%d\n", a, l); - emit: - if(first){ - if(cur.addr > pc){ - werrstr("found wrong line mapping 0x%x for pc 0x%x", cur.addr, pc); - /* This is an overzealous check. gcc can produce discontiguous ranges - and reorder statements, so it's possible for a future line to start - ahead of pc and still find a matching one. */ - /*goto out;*/ - firstline = 1; + if (!cdir && dwarfdir) + cdir = dwarfdir; + + char *filefull = malloc(strlen(cdir) + strlen(*file) + 2); + strcpy(filefull, cdir); + strcat(filefull, "/"); + strcat(filefull, *file); + *file = filefull; + + *function = nil; + lastline = 0; + + runit = dwarfaddrtounit(d, pc, &unit); + if (runit == 0) { + DwarfSym compunit = { }; + int renum = dwarfenumunit(d, unit, &compunit); + if (renum < 0) + return -1; + renum = dwarfnextsymat(d, &compunit, proc); + while (renum == 0) { + if (proc->attrs.tag == TagSubprogram && + proc->attrs.have.name) + { + if (proc->attrs.lowpc <= pc && proc->attrs.highpc > pc) { + *function = malloc(strlen(proc->attrs.name)+1); + strcpy(*function, proc->attrs.name); + goto done; } - first = 0; - start = cur.addr; } - if(cur.addr > pc && !firstline) - break; - if(b.p == nil){ - werrstr("buffer underflow in line mapping"); - goto out; - } - emit = cur; - if(emit.flags & EndSequence){ - werrstr("found wrong line mapping 0x%x-0x%x for pc 0x%x", start, cur.addr, pc); - goto out; - } - cur.flags &= ~(BasicDwarfBlock|PrologueEnd|EpilogueBegin); - }else{ - switch(op){ - case 0: /* extended op code */ - if(trace) werrstr(" ext"); - len = dwarfget128(&b); - end = b.p+len; - if(b.p == nil || end > b.ep || end < b.p || len < 1) - goto bad; - switch(dwarfget1(&b)){ - case 1: /* end sequence */ - if(trace) werrstr(" end\n"); - cur.flags |= EndSequence; - goto emit; - case 2: /* set address */ - cur.addr = dwarfgetaddr(&b); - if(trace) werrstr(" set pc 0x%x\n", cur.addr); - break; - case 3: /* define file */ - newf = malloc(nf+1*sizeof(f[0])); - if (newf) - RtlMoveMemory(newf, f, nf*sizeof(f[0])); - if(newf == nil) - goto out; - f[nf++] = b.p; - s = dwarfgetstring(&b); - dwarfget128(&b); - dwarfget128(&b); - dwarfget128(&b); - if(trace) werrstr(" def file %s\n", s); - break; + renum = dwarfnextsym(d, proc); + } + } + + // Next search by declaration + runit = dwarfaddrtounit(d, pc, &unit); + if (runit == 0) { + DwarfSym compunit = { }; + int renum = dwarfenumunit(d, unit, &compunit); + if (renum < 0) + return -1; + renum = dwarfnextsymat(d, &compunit, proc); + while (renum == 0) { + if (proc->attrs.tag == TagSubprogram && + proc->attrs.have.name && + proc->attrs.declfile == emit.file) + { + if (proc->attrs.declline <= *line && + proc->attrs.declline > lastline) { + free(*function); + *function = malloc(strlen(proc->attrs.name)+1); + strcpy(*function, proc->attrs.name); + goto done; } - if(b.p == nil || b.p > end) - goto bad; - b.p = end; - break; - case 1: /* emit */ - if(trace) werrstr(" emit\n"); - goto emit; - case 2: /* advance pc */ - a = dwarfget128(&b); - if(trace) werrstr(" advance pc + %lu\n", a*quantum); - cur.addr += a * quantum; - break; - case 3: /* advance line */ - l = dwarfget128s(&b); - if(trace) werrstr(" advance line + %ld\n", l); - cur.line += l; - break; - case 4: /* set file */ - if(trace) werrstr(" set file\n"); - cur.file = dwarfget128s(&b); - break; - case 5: /* set column */ - if(trace) werrstr(" set column\n"); - cur.column = dwarfget128(&b); - break; - case 6: /* negate stmt */ - if(trace) werrstr(" negate stmt\n"); - cur.flags ^= Isstmt; - break; - case 7: /* set basic block */ - if(trace) werrstr(" set basic block\n"); - cur.flags |= BasicDwarfBlock; - break; - case 8: /* const add pc */ - a = (255 - opcodebase) / linerange * quantum; - if(trace) werrstr(" const add pc + %d\n", a); - cur.addr += a; - break; - case 9: /* fixed advance pc */ - a = dwarfget2(&b); - if(trace) werrstr(" fixed advance pc + %d\n", a); - cur.addr += a; - break; - case 10: /* set prologue end */ - if(trace) werrstr(" set prologue end\n"); - cur.flags |= PrologueEnd; - break; - case 11: /* set epilogue begin */ - if(trace) werrstr(" set epilogue begin\n"); - cur.flags |= EpilogueBegin; - break; - case 12: /* set isa */ - if(trace) werrstr(" set isa\n"); - cur.isa = dwarfget128(&b); - break; - default: /* something new - skip it */ - if(trace) werrstr(" unknown %d\n", opcount[op]); - for(i=0; iattrs.declline; } - } - } - if(b.p == nil) - goto bad; - - /* finally! the data we seek is in "emit" */ - - if(emit.file == 0){ - werrstr("invalid file index in mapping data"); - goto out; - } - if(line) - *line = emit.line; - - /* skip over first emit.file-2 guys */ - b.p = (uchar*)files; - for(i=emit.file-1; i > 0 && b.p!=nil && *b.p!=0; i--){ - dwarfgetstring(&b); - dwarfget128(&b); - dwarfget128(&b); - dwarfget128(&b); - } - if(b.p == nil){ - werrstr("problem parsing file data second time (cannot happen)"); - goto bad; - } - if(*b.p == 0){ - if(i >= nf){ - werrstr("bad file index in mapping data"); - goto bad; - } - b.p = f[i]; - } - s = dwarfgetstring(&b); - if(file) - *file = s; - i = dwarfget128(&b); /* directory */ - x = dwarfget128(&b); - if(mtime) - *mtime = x; - x = dwarfget128(&b); - if(length) - *length = x; - - /* fetch dir name */ - if(cdir) - *cdir = sym.attrs.compdir; - - if(dir){ - *dir = nil; - b.p = dirs; - for (x = 1; b.p && *b.p; x++) - if (x == i) { - *dir = dwarfgetstring(&b); - break; - } - } - - *function = nil; - lastline = 0; -#if 0 - if (dwarfenumunit(d, unit, &proc) >= 0) { - dwarfnextsymat(d, &proc, 0); - while (dwarfnextsymat(d, &proc, 1) == 1) { - if (proc.attrs.tag == TagSubprogram && - proc.attrs.have.name && - proc.attrs.declfile == emit.file && - proc.attrs.declline <= *line && - proc.attrs.declline > lastline) { - lastline = proc.attrs.declline; - free(*function); - *function = malloc(strlen(proc.attrs.name)+1); - strcpy(*function, proc.attrs.name); - } - } - } -#elif 1 - ulong lastaddr = 0; - *function = NULL; - for (i = 0; i < d->pe->nsymbols; i++) { - if (d->pe->symtab[i].address > lastaddr && - d->pe->symtab[i].address <= pc - d->pe->imagebase && - d->pe->symtab[i].address < d->pe->imagesize) { - lastaddr = d->pe->symtab[i].address; - *function = d->pe->symtab[i].name; - } - } -#else - // *sigh* we get unrelocated low_pc and high_pc because the dwarf symbols - // are not 'loaded' in the PE sense. - if (dwarflookupfn(d, unit, pc, &proc) >= 0) { - *function = malloc(strlen(proc.attrs.name)+1); - strcpy(*function, proc.attrs.name); - } -#endif - - /* free at last, free at last */ - free(f); - return 0; + renum = dwarfnextsym(d, proc); + } + } + /* free at last, free at last */ +done: + free(f); + return 0; bad: - werrstr("corrupted line mapping for 0x%x", pc); + werrstr("corrupted line mapping for 0x%x", pc); out: - free(f); - return -1; + free(f); + return -1; } +VOID RosSymFreeInfo(PROSSYM_LINEINFO LineInfo) +{ + int i; + free(LineInfo->FileName); + LineInfo->FileName = NULL; + free(LineInfo->FunctionName); + LineInfo->FunctionName = NULL; + for (i = 0; i < sizeof(LineInfo->Parameters)/sizeof(LineInfo->Parameters[0]); i++) + free(LineInfo->Parameters[i].ValueName); +} diff --git a/lib/rossym/find.c b/lib/rossym/find.c index 5f613dc573d..9cc5aeeeece 100644 --- a/lib/rossym/find.c +++ b/lib/rossym/find.c @@ -47,40 +47,85 @@ #include "pe.h" BOOLEAN -RosSymGetAddressInformation(PROSSYM_INFO RosSymInfo, - ULONG_PTR RelativeAddress, - ULONG *LineNumber, - char *FileName, - char *FunctionName) +RosSymGetAddressInformation +(PROSSYM_INFO RosSymInfo, + ULONG_PTR RelativeAddress, + PROSSYM_LINEINFO RosSymLineInfo) { - char *cdir, *dir, *file, *function; - ulong line, mtime, length; + ROSSYM_REGISTERS registers; + DwarfParam params[sizeof(RosSymLineInfo->Parameters)/sizeof(RosSymLineInfo->Parameters[0])]; + DwarfSym proc = { }; + int i; int res = dwarfpctoline (RosSymInfo, + &proc, RelativeAddress + RosSymInfo->pe->imagebase, - &cdir, - &dir, - &file, - &function, - &line, - &mtime, - &length); - if (res != -1) { - *LineNumber = line; - FileName[0] = 0; - if (dir) { - strcpy(FileName, dir); - strcat(FileName, "/"); - } - if (file) - strcat(FileName, file); - FunctionName[0] = 0; - if (function) - strcpy(FunctionName, function); - return TRUE; - } else { + &RosSymLineInfo->FileName, + &RosSymLineInfo->FunctionName, + &RosSymLineInfo->LineNumber); + if (res == -1) { + werrstr("Could not get basic function info"); return FALSE; - } + } + + if (!(RosSymLineInfo->Flags & ROSSYM_LINEINFO_HAS_REGISTERS)) + return TRUE; + + registers = RosSymLineInfo->Registers; + + DwarfExpr cfa = { }; + ulong cfaLocation; + if (dwarfregunwind + (RosSymInfo, + RelativeAddress + RosSymInfo->pe->imagebase, + proc.attrs.framebase.c, + &cfa, + ®isters) == -1) { + werrstr("Can't get cfa location for %s", RosSymLineInfo->FunctionName); + return TRUE; + } + + res = dwarfgetparams + (RosSymInfo, + &proc, + RelativeAddress + RosSymInfo->pe->imagebase, + sizeof(params)/sizeof(params[0]), + params); + + if (res == -1) { + werrstr("%s: could not get params at all", RosSymLineInfo->FunctionName); + RosSymLineInfo->NumParams = 0; + return TRUE; + } + + werrstr("%s: res %d", RosSymLineInfo->FunctionName, res); + RosSymLineInfo->NumParams = res; + + res = dwarfcomputecfa(RosSymInfo, &cfa, ®isters, &cfaLocation); + if (res == -1) { + werrstr("%s: could not get our own cfa", RosSymLineInfo->FunctionName); + return TRUE; + } + + for (i = 0; i < RosSymLineInfo->NumParams; i++) { + werrstr("Getting arg %s, unit %x, type %x", + params[i].name, params[i].unit, params[i].type); + res = dwarfargvalue + (RosSymInfo, + &proc, + RelativeAddress + RosSymInfo->pe->imagebase, + cfaLocation, + ®isters, + ¶ms[i]); + if (res == -1) { RosSymLineInfo->NumParams = i; return TRUE; } + werrstr("%s: %x", params[i].name, params[i].value); + RosSymLineInfo->Parameters[i].ValueName = malloc(strlen(params[i].name)+1); + strcpy(RosSymLineInfo->Parameters[i].ValueName, params[i].name); + free(params[i].name); + RosSymLineInfo->Parameters[i].Value = params[i].value; + } + + return TRUE; } /* EOF */ diff --git a/lib/rossym/fromfile.c b/lib/rossym/fromfile.c index 00884a5a56b..c26ea3e2a80 100644 --- a/lib/rossym/fromfile.c +++ b/lib/rossym/fromfile.c @@ -20,191 +20,144 @@ #define NDEBUG #include +#define SYMBOL_SIZE 18 + extern NTSTATUS RosSymStatus; BOOLEAN RosSymCreateFromFile(PVOID FileContext, PROSSYM_INFO *RosSymInfo) { - IMAGE_DOS_HEADER DosHeader; - IMAGE_NT_HEADERS NtHeaders; - PIMAGE_SECTION_HEADER SectionHeaders; - unsigned SectionIndex; - unsigned SymbolTable, NumSymbols; + IMAGE_DOS_HEADER DosHeader; + IMAGE_NT_HEADERS NtHeaders; + PIMAGE_SECTION_HEADER SectionHeaders; + unsigned SectionIndex; + unsigned SymbolTable, NumSymbols; - /* Load DOS header */ - if (! RosSymSeekFile(FileContext, 0)) + /* Load DOS header */ + if (! RosSymSeekFile(FileContext, 0)) { - DPRINT1("Could not rewind file\n"); - return FALSE; - } - if (! RosSymReadFile(FileContext, &DosHeader, sizeof(IMAGE_DOS_HEADER))) - { - DPRINT1("Failed to read DOS header %x\n", RosSymStatus); - return FALSE; + werrstr("Could not rewind file\n"); + return FALSE; } - if (! ROSSYM_IS_VALID_DOS_HEADER(&DosHeader)) + if (! RosSymReadFile(FileContext, &DosHeader, sizeof(IMAGE_DOS_HEADER))) { - DPRINT1("Image doesn't have a valid DOS header\n"); - return FALSE; + werrstr("Failed to read DOS header %x\n", RosSymStatus); + return FALSE; + } + if (! ROSSYM_IS_VALID_DOS_HEADER(&DosHeader)) + { + werrstr("Image doesn't have a valid DOS header\n"); + return FALSE; } - /* Load NT headers */ - if (! RosSymSeekFile(FileContext, DosHeader.e_lfanew)) + /* Load NT headers */ + if (! RosSymSeekFile(FileContext, DosHeader.e_lfanew)) { - DPRINT1("Failed seeking to NT headers\n"); - return FALSE; + werrstr("Failed seeking to NT headers\n"); + return FALSE; } - if (! RosSymReadFile(FileContext, &NtHeaders, sizeof(IMAGE_NT_HEADERS))) + if (! RosSymReadFile(FileContext, &NtHeaders, sizeof(IMAGE_NT_HEADERS))) { - DPRINT1("Failed to read NT headers\n"); - return FALSE; + werrstr("Failed to read NT headers\n"); + return FALSE; } - if (! ROSSYM_IS_VALID_NT_HEADERS(&NtHeaders)) + if (! ROSSYM_IS_VALID_NT_HEADERS(&NtHeaders)) { - DPRINT1("Image doesn't have a valid PE header\n"); - return FALSE; + werrstr("Image doesn't have a valid PE header\n"); + return FALSE; } - SymbolTable = NtHeaders.FileHeader.PointerToSymbolTable; - NumSymbols = NtHeaders.FileHeader.NumberOfSymbols; + SymbolTable = NtHeaders.FileHeader.PointerToSymbolTable; + NumSymbols = NtHeaders.FileHeader.NumberOfSymbols; - if (!NumSymbols) + if (!NumSymbols) { - DPRINT1("Image doesn't have debug symbols\n"); - return FALSE; + werrstr("Image doesn't have debug symbols\n"); + return FALSE; } - DPRINT("SymbolTable %x NumSymbols %x\n", SymbolTable, NumSymbols); + DPRINT("SymbolTable %x NumSymbols %x\n", SymbolTable, NumSymbols); - /* Load section headers */ - if (! RosSymSeekFile(FileContext, (char *) IMAGE_FIRST_SECTION(&NtHeaders) - - (char *) &NtHeaders + DosHeader.e_lfanew)) + /* Load section headers */ + if (! RosSymSeekFile(FileContext, (char *) IMAGE_FIRST_SECTION(&NtHeaders) - + (char *) &NtHeaders + DosHeader.e_lfanew)) { - DPRINT1("Failed seeking to section headers\n"); - return FALSE; + werrstr("Failed seeking to section headers\n"); + return FALSE; } - DPRINT("Alloc section headers\n"); - SectionHeaders = RosSymAllocMem(NtHeaders.FileHeader.NumberOfSections - * sizeof(IMAGE_SECTION_HEADER)); - if (NULL == SectionHeaders) + DPRINT("Alloc section headers\n"); + SectionHeaders = RosSymAllocMem(NtHeaders.FileHeader.NumberOfSections + * sizeof(IMAGE_SECTION_HEADER)); + if (NULL == SectionHeaders) { - DPRINT1("Failed to allocate memory for %u section headers\n", - NtHeaders.FileHeader.NumberOfSections); - return FALSE; + werrstr("Failed to allocate memory for %u section headers\n", + NtHeaders.FileHeader.NumberOfSections); + return FALSE; } - if (! RosSymReadFile(FileContext, SectionHeaders, - NtHeaders.FileHeader.NumberOfSections - * sizeof(IMAGE_SECTION_HEADER))) + if (! RosSymReadFile(FileContext, SectionHeaders, + NtHeaders.FileHeader.NumberOfSections + * sizeof(IMAGE_SECTION_HEADER))) { - RosSymFreeMem(SectionHeaders); - DPRINT1("Failed to read section headers\n"); - return FALSE; + RosSymFreeMem(SectionHeaders); + werrstr("Failed to read section headers\n"); + return FALSE; } - // Convert names to ANSI_STRINGs - for (SectionIndex = 0; SectionIndex < NtHeaders.FileHeader.NumberOfSections; - SectionIndex++) - { - ANSI_STRING astr; - if (SectionHeaders[SectionIndex].Name[0] != '/') { - DPRINT("Short name string %d, %s\n", SectionIndex, SectionHeaders[SectionIndex].Name); - astr.Buffer = RosSymAllocMem(IMAGE_SIZEOF_SHORT_NAME); - memcpy(astr.Buffer, SectionHeaders[SectionIndex].Name, IMAGE_SIZEOF_SHORT_NAME); - astr.MaximumLength = IMAGE_SIZEOF_SHORT_NAME; - astr.Length = GetStrnlen(astr.Buffer, IMAGE_SIZEOF_SHORT_NAME); - } else { - UNICODE_STRING intConv; - NTSTATUS Status; - ULONG StringOffset; + // Convert names to ANSI_STRINGs + for (SectionIndex = 0; SectionIndex < NtHeaders.FileHeader.NumberOfSections; + SectionIndex++) + { + ANSI_STRING astr; + if (SectionHeaders[SectionIndex].Name[0] != '/') { + DPRINT("Short name string %d, %s\n", SectionIndex, SectionHeaders[SectionIndex].Name); + astr.Buffer = RosSymAllocMem(IMAGE_SIZEOF_SHORT_NAME); + memcpy(astr.Buffer, SectionHeaders[SectionIndex].Name, IMAGE_SIZEOF_SHORT_NAME); + astr.MaximumLength = IMAGE_SIZEOF_SHORT_NAME; + astr.Length = GetStrnlen(astr.Buffer, IMAGE_SIZEOF_SHORT_NAME); + } else { + UNICODE_STRING intConv; + NTSTATUS Status; + ULONG StringOffset; - Status = RtlCreateUnicodeStringFromAsciiz(&intConv, (PCSZ)SectionHeaders[SectionIndex].Name + 1); - if (!NT_SUCCESS(Status)) goto freeall; - Status = RtlUnicodeStringToInteger(&intConv, 10, &StringOffset); - RtlFreeUnicodeString(&intConv); - if (!NT_SUCCESS(Status)) goto freeall; - if (!RosSymSeekFile(FileContext, SymbolTable + NumSymbols * SYMBOL_SIZE + StringOffset)) - goto freeall; - astr.Buffer = RosSymAllocMem(MAXIMUM_DWARF_NAME_SIZE); - if (!RosSymReadFile(FileContext, astr.Buffer, MAXIMUM_DWARF_NAME_SIZE)) - goto freeall; - astr.Length = GetStrnlen(astr.Buffer, MAXIMUM_DWARF_NAME_SIZE); - astr.MaximumLength = MAXIMUM_DWARF_NAME_SIZE; - DPRINT("Long name %d, %s\n", SectionIndex, astr.Buffer); - } - *ANSI_NAME_STRING(&SectionHeaders[SectionIndex]) = astr; - } + Status = RtlCreateUnicodeStringFromAsciiz(&intConv, (PCSZ)SectionHeaders[SectionIndex].Name + 1); + if (!NT_SUCCESS(Status)) goto freeall; + Status = RtlUnicodeStringToInteger(&intConv, 10, &StringOffset); + RtlFreeUnicodeString(&intConv); + if (!NT_SUCCESS(Status)) goto freeall; + if (!RosSymSeekFile(FileContext, SymbolTable + NumSymbols * SYMBOL_SIZE + StringOffset)) + goto freeall; + astr.Buffer = RosSymAllocMem(MAXIMUM_DWARF_NAME_SIZE); + if (!RosSymReadFile(FileContext, astr.Buffer, MAXIMUM_DWARF_NAME_SIZE)) + goto freeall; + astr.Length = GetStrnlen(astr.Buffer, MAXIMUM_DWARF_NAME_SIZE); + astr.MaximumLength = MAXIMUM_DWARF_NAME_SIZE; + DPRINT("Long name %d, %s\n", SectionIndex, astr.Buffer); + } + *ANSI_NAME_STRING(&SectionHeaders[SectionIndex]) = astr; + } - DPRINT("Done with sections\n"); - Pe *pe = RosSymAllocMem(sizeof(*pe)); - pe->fd = FileContext; - pe->e2 = peget2; - pe->e4 = peget4; - pe->e8 = peget8; - pe->nsections = NtHeaders.FileHeader.NumberOfSections; - pe->sect = SectionHeaders; - pe->nsymbols = NtHeaders.FileHeader.NumberOfSymbols; - pe->symtab = malloc(pe->nsymbols * sizeof(CoffSymbol)); - SYMENT SymbolData; - int i, j; - DPRINT("Getting symbol data\n"); - ASSERT(sizeof(SymbolData) == 18); - for (i = 0, j = 0; i < pe->nsymbols; i++) { - if (!RosSymSeekFile - (FileContext, - NtHeaders.FileHeader.PointerToSymbolTable + i * sizeof(SymbolData))) - goto freeall; - if (!RosSymReadFile(FileContext, &SymbolData, sizeof(SymbolData))) - goto freeall; - if ((SymbolData.e_scnum < 1) || - (SymbolData.e_sclass != C_EXT && - SymbolData.e_sclass != C_STAT)) - continue; - int section = SymbolData.e_scnum - 1; - if (SymbolData.e.e.e_zeroes) { - pe->symtab[j].name = malloc(sizeof(SymbolData.e.e_name)+1); - memcpy(pe->symtab[j].name, SymbolData.e.e_name, sizeof(SymbolData.e.e_name)); - pe->symtab[j].name[sizeof(SymbolData.e.e_name)] = 0; - } else { - if (!RosSymSeekFile - (FileContext, - NtHeaders.FileHeader.PointerToSymbolTable + - (NtHeaders.FileHeader.NumberOfSymbols * 18) + - SymbolData.e.e.e_offset)) - goto freeall; - pe->symtab[j].name = malloc(MAXIMUM_COFF_SYMBOL_LENGTH+1); - pe->symtab[j].name[MAXIMUM_COFF_SYMBOL_LENGTH] = 0; - // It's possible that we've got a string just at the end of the file - // we'll skip that symbol if needed - if (!RosSymReadFile(FileContext, pe->symtab[j].name, MAXIMUM_COFF_SYMBOL_LENGTH)) { - free(pe->symtab[j].name); - continue; - } - } - if (pe->symtab[j].name[0] == '.') { - free(pe->symtab[j].name); - continue; - } - pe->symtab[j].address = pe->sect[section].VirtualAddress + SymbolData.e_value; - j++; - } - DPRINT("%d symbols\n", j); - pe->nsymbols = j; - pe->imagebase = pe->loadbase = NtHeaders.OptionalHeader.ImageBase; - pe->imagesize = NtHeaders.OptionalHeader.SizeOfImage; - pe->loadsection = loaddisksection; - DPRINT("do dwarfopen\n"); - *RosSymInfo = dwarfopen(pe); - DPRINT("done %x\n", *RosSymInfo); + DPRINT("Done with sections\n"); + Pe *pe = RosSymAllocMem(sizeof(*pe)); + pe->fd = FileContext; + pe->e2 = peget2; + pe->e4 = peget4; + pe->e8 = peget8; + pe->nsections = NtHeaders.FileHeader.NumberOfSections; + pe->sect = SectionHeaders; + pe->imagebase = pe->loadbase = NtHeaders.OptionalHeader.ImageBase; + pe->imagesize = NtHeaders.OptionalHeader.SizeOfImage; + pe->loadsection = loaddisksection; + *RosSymInfo = dwarfopen(pe); - return TRUE; + return TRUE; freeall: - for (SectionIndex = 0; SectionIndex < NtHeaders.FileHeader.NumberOfSections; - SectionIndex++) - RtlFreeAnsiString(ANSI_NAME_STRING(&SectionHeaders[SectionIndex])); - RosSymFreeMem(SectionHeaders); + for (SectionIndex = 0; SectionIndex < NtHeaders.FileHeader.NumberOfSections; + SectionIndex++) + RtlFreeAnsiString(ANSI_NAME_STRING(&SectionHeaders[SectionIndex])); + RosSymFreeMem(SectionHeaders); - return FALSE; + return FALSE; } /* EOF */ diff --git a/lib/rossym/initum.c b/lib/rossym/initum.c index 5a80fd37eef..eb59c0f185e 100644 --- a/lib/rossym/initum.c +++ b/lib/rossym/initum.c @@ -13,6 +13,7 @@ #include "rossympriv.h" #define NTOS_MODE_USER #include +#include #define NDEBUG #include @@ -29,6 +30,12 @@ RosSymFreeMemUM(PVOID Area) RtlFreeHeap(RtlGetProcessHeap(), 0, Area); } +static BOOLEAN +RosSymGetMemUM(ULONG_PTR *Target, PVOID SourceMem, ULONG Size) +{ + return FALSE; +} + VOID RosSymInitUserMode(VOID) { @@ -37,7 +44,8 @@ RosSymInitUserMode(VOID) RosSymAllocMemUM, RosSymFreeMemUM, RosSymZwReadFile, - RosSymZwSeekFile + RosSymZwSeekFile, + RosSymGetMemUM }; RosSymInit(&KmCallbacks); diff --git a/lib/rossym/pe.c b/lib/rossym/pe.c index a00716cd185..cace420fec2 100644 --- a/lib/rossym/pe.c +++ b/lib/rossym/pe.c @@ -111,10 +111,6 @@ void pefree(Pe *pe) { for (i = 0; i < pe->nsections; i++) { RtlFreeAnsiString(ANSI_NAME_STRING(&pe->sect[i])); } - for (i = 0; i < pe->nsymbols; i++) { - free(pe->symtab[i].name); - } - free(pe->symtab); free(pe->sect); free(pe); } diff --git a/lib/rossym/pe.h b/lib/rossym/pe.h index 5e659a216e9..6b5bbdaa8f4 100644 --- a/lib/rossym/pe.h +++ b/lib/rossym/pe.h @@ -6,49 +6,19 @@ struct DwarfBlock; typedef struct _IMAGE_SECTION_HEADER PeSect; -typedef struct _CoffSymbol { - ulong address; - char *name; -} CoffSymbol; - typedef struct _Pe { void *fd; u16int (*e2)(const unsigned char *data); u32int (*e4)(const unsigned char *data); u64int (*e8)(const unsigned char *data); ulong imagebase, imagesize, loadbase; - ulong nsymbols; - CoffSymbol *symtab; int (*loadsection)(struct _Pe *pe, char *name, struct DwarfBlock *b); int nsections; struct _IMAGE_SECTION_HEADER *sect; } Pe; -#define E_SYMNMLEN 8 -#include -typedef struct { - union { - char e_name[E_SYMNMLEN]; - struct { - unsigned long e_zeroes; - unsigned long e_offset; - } e; - } e; - unsigned long e_value; - short e_scnum; - unsigned short e_type; - unsigned char e_sclass; - unsigned char e_numaux; -} SYMENT, *PSYMENT; -#include - -#define C_EXT 2 -#define C_STAT 3 -#define DT_FCN 0x40 - Pe *peopen(const char *name); int loaddisksection(struct _Pe *pe, char *name, struct DwarfBlock *b); -int loadmemsection(struct _Pe *pe, char *name, struct DwarfBlock *b); u16int peget2(const unsigned char *ptr); u32int peget4(const unsigned char *ptr); u64int peget8(const unsigned char *ptr); diff --git a/lib/rossym/rossympriv.h b/lib/rossym/rossympriv.h index ffeb2ce6782..1a604ef3f47 100644 --- a/lib/rossym/rossympriv.h +++ b/lib/rossym/rossympriv.h @@ -9,19 +9,19 @@ #pragma once +#define HIGHBIT 0x80000000 + extern ROSSYM_CALLBACKS RosSymCallbacks; #define RosSymAllocMem(Size) (*RosSymCallbacks.AllocMemProc)(Size) #define RosSymFreeMem(Area) (*RosSymCallbacks.FreeMemProc)(Area) #define RosSymReadFile(FileContext, Buffer, Size) (*RosSymCallbacks.ReadFileProc)((FileContext), (Buffer), (Size)) #define RosSymSeekFile(FileContext, Position) (*RosSymCallbacks.SeekFileProc)((FileContext), (Position)) +#define RosSymGetMem(TargetAddress, Address, Size) (*RosSymCallbacks.MemGetProc)((TargetAddress), (Address), (Size)) extern BOOLEAN RosSymZwReadFile(PVOID FileContext, PVOID Buffer, ULONG Size); extern BOOLEAN RosSymZwSeekFile(PVOID FileContext, ULONG_PTR Position); -extern BOOLEAN RosSymIoReadFile(PVOID FileContext, PVOID Buffer, ULONG Size); -extern BOOLEAN RosSymIoSeekFile(PVOID FileContext, ULONG_PTR Position); - #define ROSSYM_IS_VALID_DOS_HEADER(DosHeader) (IMAGE_DOS_SIGNATURE == (DosHeader)->e_magic \ && 0L != (DosHeader)->e_lfanew) #define ROSSYM_IS_VALID_NT_HEADERS(NtHeaders) (IMAGE_NT_SIGNATURE == (NtHeaders)->Signature \ diff --git a/media/CMakeLists.txt b/media/CMakeLists.txt index c86b866b70f..87b64003cdb 100644 --- a/media/CMakeLists.txt +++ b/media/CMakeLists.txt @@ -3,11 +3,7 @@ add_subdirectory(inf) add_subdirectory(nls) add_subdirectory(vgafonts) -add_minicd(${CMAKE_CURRENT_SOURCE_DIR}/drivers/etc/hosts reactos hosts) -add_minicd(${CMAKE_CURRENT_SOURCE_DIR}/drivers/etc/KDBinit reactos KDBinit) -add_minicd(${CMAKE_CURRENT_SOURCE_DIR}/drivers/etc/services reactos services) - -add_cab(${CMAKE_CURRENT_SOURCE_DIR}/drivers/etc/hosts 5) -add_cab(${CMAKE_CURRENT_SOURCE_DIR}/drivers/etc/KDBinit 5) -add_cab(${CMAKE_CURRENT_SOURCE_DIR}/drivers/etc/services 5) -add_cab(${CMAKE_CURRENT_SOURCE_DIR}/sounds/ReactOS_LogOn.wav 8) \ No newline at end of file +add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/drivers/etc/hosts DESTINATION reactos/system32/drivers/etc FOR all) +add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/drivers/etc/KDBinit DESTINATION reactos/system32/drivers/etc FOR all) +add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/drivers/etc/services DESTINATION reactos/system32/drivers/etc FOR all) +add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/sounds/ReactOS_LogOn.wav DESTINATION reactos/media FOR all) \ No newline at end of file diff --git a/media/fonts/CMakeLists.txt b/media/fonts/CMakeLists.txt index b2e6f472204..d0836ac0622 100644 --- a/media/fonts/CMakeLists.txt +++ b/media/fonts/CMakeLists.txt @@ -34,5 +34,5 @@ list(APPEND FONT_FILES ) foreach(item ${FONT_FILES}) - add_cab("${CMAKE_CURRENT_SOURCE_DIR}/${item}" 3) + add_cd_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/${item}" DESTINATION reactos/Fonts FOR all) endforeach(item) \ No newline at end of file diff --git a/media/inf/CMakeLists.txt b/media/inf/CMakeLists.txt index 8237cc71930..f21f8eb15ba 100644 --- a/media/inf/CMakeLists.txt +++ b/media/inf/CMakeLists.txt @@ -30,7 +30,7 @@ list(APPEND INF_FILES ) foreach(item ${INF_FILES}) - add_cab("${CMAKE_CURRENT_SOURCE_DIR}/${item}" 6) + add_cd_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/${item}" DESTINATION reactos/inf FOR all) endforeach(item) -add_cab(${CMAKE_CURRENT_SOURCE_DIR}/syssetup.inf 6) \ No newline at end of file +add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/syssetup.inf DESTINATION reactos/inf FOR all) \ No newline at end of file diff --git a/media/nls/CMakeLists.txt b/media/nls/CMakeLists.txt index 3fd3a16545a..13007972da3 100644 --- a/media/nls/CMakeLists.txt +++ b/media/nls/CMakeLists.txt @@ -1,9 +1,6 @@ -add_minicd(${CMAKE_CURRENT_SOURCE_DIR}/l_intl.nls reactos l_intl.nls) -add_minicd(${CMAKE_CURRENT_SOURCE_DIR}/c_437.nls reactos c_437.nls) -add_minicd(${CMAKE_CURRENT_SOURCE_DIR}/c_1252.nls reactos c_1252.nls) -add_livecd(${CMAKE_CURRENT_SOURCE_DIR}/l_intl.nls reactos/system32) -add_livecd(${CMAKE_CURRENT_SOURCE_DIR}/c_437.nls reactos/system32 c_437.nls) -add_livecd(${CMAKE_CURRENT_SOURCE_DIR}/c_1252.nls reactos/system32 c_1252.nls) +add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/l_intl.nls DESTINATION reactos/system32 NO_CAB FOR all) +add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/c_437.nls DESTINATION reactos/system32 NO_CAB FOR all) +add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/c_1252.nls DESTINATION reactos/system32 NO_CAB FOR all) list(APPEND NLS_FILES c_037.nls @@ -67,5 +64,5 @@ list(APPEND NLS_FILES foreach(item ${NLS_FILES}) - add_cab("${CMAKE_CURRENT_SOURCE_DIR}/${item}" 1 ${item}) + add_cd_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/${item}" DESTINATION reactos/system32 FOR all) endforeach(item) diff --git a/media/vgafonts/CMakeLists.txt b/media/vgafonts/CMakeLists.txt index 069c830e347..b3ae7540c8e 100644 --- a/media/vgafonts/CMakeLists.txt +++ b/media/vgafonts/CMakeLists.txt @@ -16,5 +16,4 @@ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/vgafonts.cab add_custom_target(vgafonts DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/vgafonts.cab) -add_minicd(${CMAKE_CURRENT_BINARY_DIR}/vgafonts.cab reactos vgafonts.cab) -add_cab(${CMAKE_CURRENT_BINARY_DIR}/vgafonts.cab 4) \ No newline at end of file +add_cd_file(TARGET vgafonts FILE ${CMAKE_CURRENT_BINARY_DIR}/vgafonts.cab DESTINATION reactos NO_CAB FOR all) \ No newline at end of file diff --git a/msc.cmake b/msc.cmake index a09efaf74f7..baf8f5d7129 100644 --- a/msc.cmake +++ b/msc.cmake @@ -66,7 +66,7 @@ macro(set_image_base MODULE IMAGE_BASE) endmacro() macro(set_module_type MODULE TYPE) - add_dependencies(${MODULE} psdk buildno_header) + add_dependencies(${MODULE} psdk) if(${TYPE} MATCHES nativecui) set_subsystem(${MODULE} native) set_entrypoint(${MODULE} NtProcessStartup@4) diff --git a/ntoskrnl/CMakeLists.txt b/ntoskrnl/CMakeLists.txt index b2e740c62c0..ce0f992935d 100644 --- a/ntoskrnl/CMakeLists.txt +++ b/ntoskrnl/CMakeLists.txt @@ -446,10 +446,9 @@ target_link_libraries(ntoskrnl add_importlibs(ntoskrnl hal kdcom bootvid) add_pch(ntoskrnl ${CMAKE_CURRENT_SOURCE_DIR}/include/ntoskrnl.h ${SOURCE}) -add_dependencies(ntoskrnl psdk bugcodes kernel_zw kernel_napi asm) +add_dependencies(ntoskrnl psdk bugcodes asm) -add_minicd_target(ntoskrnl reactos ntoskrnl.exe) -add_livecd_target(ntoskrnl reactos/system32) +add_cd_file(TARGET ntoskrnl DESTINATION reactos/system32 NO_CAB FOR all) add_importlib_target(ntoskrnl.spec) add_library(ntdllsys ntdll.S) diff --git a/ntoskrnl/fstub/disksup.c b/ntoskrnl/fstub/disksup.c index 7c4f651f8ff..c4a67c3413f 100644 --- a/ntoskrnl/fstub/disksup.c +++ b/ntoskrnl/fstub/disksup.c @@ -64,17 +64,20 @@ HalpAssignDrive(IN PUNICODE_STRING PartitionName, if ((DriveNumber != AUTO_DRIVE) && (DriveNumber < 26)) { /* Force assignment */ + KeAcquireGuardedMutex(&ObpDeviceMapLock); if ((ObSystemDeviceMap->DriveMap & (1 << DriveNumber)) != 0) { DbgPrint("Drive letter already used!\n"); + KeReleaseGuardedMutex(&ObpDeviceMapLock); return FALSE; } + KeReleaseGuardedMutex(&ObpDeviceMapLock); } else { /* Automatic assignment */ DriveNumber = AUTO_DRIVE; - + KeAcquireGuardedMutex(&ObpDeviceMapLock); for (i = 2; i < 26; i++) { if ((ObSystemDeviceMap->DriveMap & (1 << i)) == 0) @@ -83,6 +86,7 @@ HalpAssignDrive(IN PUNICODE_STRING PartitionName, break; } } + KeReleaseGuardedMutex(&ObpDeviceMapLock); if (DriveNumber == AUTO_DRIVE) { @@ -93,10 +97,6 @@ HalpAssignDrive(IN PUNICODE_STRING PartitionName, DPRINT("DriveNumber %d\n", DriveNumber); - /* Update the System Device Map */ - ObSystemDeviceMap->DriveMap |= (1 << DriveNumber); - ObSystemDeviceMap->DriveType[DriveNumber] = DriveType; - /* Build drive name */ swprintf(DriveNameBuffer, L"\\??\\%C:", diff --git a/ntoskrnl/include/internal/kd.h b/ntoskrnl/include/internal/kd.h index 5bb1060b548..096416ac14c 100644 --- a/ntoskrnl/include/internal/kd.h +++ b/ntoskrnl/include/internal/kd.h @@ -75,15 +75,14 @@ KdbSymProcessSymbols( BOOLEAN KdbSymPrintAddress( - IN PVOID Address); + IN PVOID Address, + IN PKTRAP_FRAME Context); NTSTATUS KdbSymGetAddressInformation( IN PROSSYM_INFO RosSymInfo, IN ULONG_PTR RelativeAddress, - OUT PULONG LineNumber OPTIONAL, - OUT PCH FileName OPTIONAL, - OUT PCH FunctionName OPTIONAL + IN PROSSYM_LINEINFO RosSymLineInfo ); #endif diff --git a/ntoskrnl/include/internal/ob.h b/ntoskrnl/include/internal/ob.h index 521bf5834a4..532565ee390 100644 --- a/ntoskrnl/include/internal/ob.h +++ b/ntoskrnl/include/internal/ob.h @@ -578,6 +578,7 @@ ObGetProcessHandleCount( // extern ULONG ObpTraceLevel; extern KEVENT ObpDefaultObject; +extern KGUARDED_MUTEX ObpDeviceMapLock; extern POBJECT_TYPE ObpTypeObjectType; extern POBJECT_TYPE ObSymbolicLinkType; extern POBJECT_TYPE ObpTypeObjectType; diff --git a/ntoskrnl/kdbg/i386/i386-dis.c b/ntoskrnl/kdbg/i386/i386-dis.c index 95425a227a0..2e0619515d9 100644 --- a/ntoskrnl/kdbg/i386/i386-dis.c +++ b/ntoskrnl/kdbg/i386/i386-dis.c @@ -78,7 +78,7 @@ KdbpMemoryError(int Status, unsigned int Addr, static void KdbpPrintAddressInCode(unsigned int Addr, struct disassemble_info * Ignored) { - if (!KdbSymPrintAddress((void*)Addr)) + if (!KdbSymPrintAddress((void*)Addr, NULL)) { DbgPrint("<%08x>", Addr); } diff --git a/ntoskrnl/kdbg/kdb_cli.c b/ntoskrnl/kdbg/kdb_cli.c index a45009cf7c1..6d349f1658e 100644 --- a/ntoskrnl/kdbg/kdb_cli.c +++ b/ntoskrnl/kdbg/kdb_cli.c @@ -595,7 +595,7 @@ KdbpCmdDisassembleX( while (Count > 0) { - if (!KdbSymPrintAddress((PVOID)Address)) + if (!KdbSymPrintAddress((PVOID)Address, NULL)) KdbpPrint("<%x>:", Address); else KdbpPrint(":"); @@ -621,7 +621,7 @@ KdbpCmdDisassembleX( /* Disassemble */ while (Count-- > 0) { - if (!KdbSymPrintAddress((PVOID)Address)) + if (!KdbSymPrintAddress((PVOID)Address, NULL)) KdbpPrint("<%08x>: ", Address); else KdbpPrint(": "); @@ -794,6 +794,7 @@ KdbpCmdBackTrace( ULONGLONG Result = 0; ULONG_PTR Frame = KdbCurrentTrapFrame->Tf.Ebp; ULONG_PTR Address; + KTRAP_FRAME TrapFrame; if (Argc >= 2) { @@ -853,15 +854,19 @@ KdbpCmdBackTrace( KdbpPrint("Eip:\n"); /* Try printing the function at EIP */ - if (!KdbSymPrintAddress((PVOID)KdbCurrentTrapFrame->Tf.Eip)) + if (!KdbSymPrintAddress((PVOID)KdbCurrentTrapFrame->Tf.Eip, &KdbCurrentTrapFrame->Tf)) KdbpPrint("<%08x>\n", KdbCurrentTrapFrame->Tf.Eip); else KdbpPrint("\n"); } + TrapFrame = KdbCurrentTrapFrame->Tf; KdbpPrint("Frames:\n"); + for (;;) { + BOOLEAN GotNextFrame; + if (Frame == 0) break; @@ -871,8 +876,11 @@ KdbpCmdBackTrace( break; } + if ((GotNextFrame = NT_SUCCESS(KdbpSafeReadMemory(&Frame, (PVOID)Frame, sizeof (ULONG_PTR))))) + TrapFrame.Ebp = Frame; + /* Print the location of the call instruction */ - if (!KdbSymPrintAddress((PVOID)(Address - 5))) + if (!KdbSymPrintAddress((PVOID)(Address - 5), &TrapFrame)) KdbpPrint("<%08x>\n", Address); else KdbpPrint("\n"); @@ -882,7 +890,7 @@ KdbpCmdBackTrace( if (Address == 0) break; - if (!NT_SUCCESS(KdbpSafeReadMemory(&Frame, (PVOID)Frame, sizeof (ULONG_PTR)))) + if (!GotNextFrame) { KdbpPrint("Couldn't access memory at 0x%p!\n", Frame); break; @@ -2666,7 +2674,7 @@ KdbpCliMainLoop( if (EnteredOnSingleStep) { - if (!KdbSymPrintAddress((PVOID)KdbCurrentTrapFrame->Tf.Eip)) + if (!KdbSymPrintAddress((PVOID)KdbCurrentTrapFrame->Tf.Eip, &KdbCurrentTrapFrame->Tf)) { KdbpPrint("<%x>", KdbCurrentTrapFrame->Tf.Eip); } diff --git a/ntoskrnl/kdbg/kdb_symbols.c b/ntoskrnl/kdbg/kdb_symbols.c index 5b272609817..98176e36757 100644 --- a/ntoskrnl/kdbg/kdb_symbols.c +++ b/ntoskrnl/kdbg/kdb_symbols.c @@ -28,7 +28,6 @@ typedef struct _IMAGE_SYMBOL_INFO_CACHE IMAGE_SYMBOL_INFO_CACHE, *PIMAGE_SYMBOL_INFO_CACHE; typedef struct _ROSSYM_KM_OWN_CONTEXT { - ROSSYM_OWN_FILECONTEXT Rossym; LARGE_INTEGER FileOffset; PFILE_OBJECT FileObject; } ROSSYM_KM_OWN_CONTEXT, *PROSSYM_KM_OWN_CONTEXT; @@ -56,7 +55,7 @@ KdbpReadSymFile(PVOID FileContext, PVOID Buffer, ULONG Length) PROSSYM_KM_OWN_CONTEXT Context = (PROSSYM_KM_OWN_CONTEXT)FileContext; IO_STATUS_BLOCK Iosb; NTSTATUS Status = MiSimpleRead - (Context->FileObject, + (Context->FileObject, &Context->FileOffset, Buffer, Length, @@ -65,7 +64,7 @@ KdbpReadSymFile(PVOID FileContext, PVOID Buffer, ULONG Length) return NT_SUCCESS(Status); } -static PROSSYM_OWN_FILECONTEXT +static PROSSYM_KM_OWN_CONTEXT KdbpCaptureFileForSymbols(PFILE_OBJECT FileObject) { PROSSYM_KM_OWN_CONTEXT Context = ExAllocatePool(NonPagedPool, sizeof(*Context)); @@ -73,15 +72,12 @@ KdbpCaptureFileForSymbols(PFILE_OBJECT FileObject) ObReferenceObject(FileObject); Context->FileOffset.QuadPart = 0; Context->FileObject = FileObject; - Context->Rossym.ReadFileProc = KdbpReadSymFile; - Context->Rossym.SeekFileProc = KdbpSeekSymFile; - return &Context->Rossym; + return Context; } static VOID -KdbpReleaseFileForSymbols(PROSSYM_OWN_FILECONTEXT FileContext) +KdbpReleaseFileForSymbols(PROSSYM_KM_OWN_CONTEXT Context) { - PROSSYM_KM_OWN_CONTEXT Context = (PROSSYM_KM_OWN_CONTEXT)FileContext; ObDereferenceObject(Context->FileObject); ExFreePool(Context); } @@ -175,43 +171,87 @@ KdbpSymFindModule( */ BOOLEAN KdbSymPrintAddress( - IN PVOID Address) + IN PVOID Address, + IN PKTRAP_FRAME Context) { + int i; PMEMORY_AREA MemoryArea = NULL; PROS_SECTION_OBJECT SectionObject; PLDR_DATA_TABLE_ENTRY LdrEntry; - PROSSYM_OWN_FILECONTEXT FileContext; + PROSSYM_KM_OWN_CONTEXT FileContext; ULONG_PTR RelativeAddress; NTSTATUS Status; - ULONG LineNumber; - CHAR FileName[256]; - CHAR FunctionName[256]; + ROSSYM_LINEINFO LineInfo = { }; + + struct { + enum _ROSSYM_REGNAME regname; + size_t ctx_offset; + } regmap[] = { + { ROSSYM_X86_EDX, FIELD_OFFSET(KTRAP_FRAME, Edx) }, + { ROSSYM_X86_EAX, FIELD_OFFSET(KTRAP_FRAME, Eax) }, + { ROSSYM_X86_ECX, FIELD_OFFSET(KTRAP_FRAME, Ecx) }, + { ROSSYM_X86_EBX, FIELD_OFFSET(KTRAP_FRAME, Ebx) }, + { ROSSYM_X86_ESI, FIELD_OFFSET(KTRAP_FRAME, Esi) }, + { ROSSYM_X86_EDI, FIELD_OFFSET(KTRAP_FRAME, Edi) }, + { ROSSYM_X86_EBP, FIELD_OFFSET(KTRAP_FRAME, Ebp) }, + { ROSSYM_X86_ESP, FIELD_OFFSET(KTRAP_FRAME, HardwareEsp) } + }; + + if (Context) + { + DPRINT("Has Context %x (EBP %x)\n", Context, Context->Ebp); + LineInfo.Flags = ROSSYM_LINEINFO_HAS_REGISTERS; + + for (i = 0; i < sizeof(regmap) / sizeof(regmap[0]); i++) { + memcpy + (&LineInfo.Registers.Registers[regmap[i].regname], + ((PCHAR)Context)+regmap[i].ctx_offset, + sizeof(ULONG_PTR)); + DPRINT("DWARF REG[%d] -> %x\n", regmap[i].regname, LineInfo.Registers.Registers[regmap[i].regname]); + } + } if (!KdbpSymbolsInitialized || !KdbpSymFindModule(Address, NULL, -1, &LdrEntry)) return FALSE; RelativeAddress = (ULONG_PTR)Address - (ULONG_PTR)LdrEntry->DllBase; - Status = KdbSymGetAddressInformation(LdrEntry->PatchInformation, - RelativeAddress, - &LineNumber, - FileName, - FunctionName); + Status = KdbSymGetAddressInformation + (LdrEntry->PatchInformation, + RelativeAddress, + &LineInfo); + if (NT_SUCCESS(Status)) { DbgPrint("<%wZ:%x (%s:%d (%s))>", - &LdrEntry->BaseDllName, RelativeAddress, FileName, LineNumber, FunctionName); + &LdrEntry->BaseDllName, RelativeAddress, LineInfo.FileName, LineInfo.LineNumber, LineInfo.FunctionName); + if (Context) + { + int i; + char *comma = ""; + DbgPrint("("); + for (i = 0; i < LineInfo.NumParams; i++) { + DbgPrint + ("%s%s=%llx", + comma, + LineInfo.Parameters[i].ValueName, + LineInfo.Parameters[i].Value); + comma = ","; + } + DbgPrint(")"); + } + return TRUE; } else if (Address < MmSystemRangeStart) { MemoryArea = MmLocateMemoryAreaByAddress(&PsGetCurrentProcess()->Vm, Address); - if (!MemoryArea || MemoryArea->Type != MEMORY_AREA_SECTION_VIEW) + if (!MemoryArea || MemoryArea->Type != MEMORY_AREA_SECTION_VIEW) { goto end; } SectionObject = MemoryArea->Data.SectionData.Section; if (!(SectionObject->AllocationAttributes & SEC_IMAGE)) goto end; - if (MemoryArea->StartingAddress != KdbpImageBase) + if (MemoryArea->StartingAddress != (PVOID)KdbpImageBase) { if (KdbpRosSymInfo) { @@ -223,7 +263,7 @@ KdbSymPrintAddress( if ((FileContext = KdbpCaptureFileForSymbols(SectionObject->FileObject))) { if (RosSymCreateFromFile(FileContext, &KdbpRosSymInfo)) - KdbpImageBase = MemoryArea->StartingAddress; + KdbpImageBase = (ULONG_PTR)MemoryArea->StartingAddress; KdbpReleaseFileForSymbols(FileContext); } @@ -232,18 +272,37 @@ KdbSymPrintAddress( if (KdbpRosSymInfo) { RelativeAddress = (ULONG_PTR)Address - KdbpImageBase; + RosSymFreeInfo(&LineInfo); Status = KdbSymGetAddressInformation (KdbpRosSymInfo, RelativeAddress, - &LineNumber, - FileName, - FunctionName); + &LineInfo); if (NT_SUCCESS(Status)) { DbgPrint ("<%wZ:%x (%s:%d (%s))>", &SectionObject->FileObject->FileName, - RelativeAddress, FileName, LineNumber, FunctionName); + RelativeAddress, + LineInfo.FileName, + LineInfo.LineNumber, + LineInfo.FunctionName); + + if (Context) + { + int i; + char *comma = ""; + DbgPrint("("); + for (i = 0; i < LineInfo.NumParams; i++) { + DbgPrint + ("%s%s=%llx", + comma, + LineInfo.Parameters[i].ValueName, + LineInfo.Parameters[i].Value); + comma = ","; + } + DbgPrint(")"); + } + return TRUE; } } @@ -276,13 +335,11 @@ NTSTATUS KdbSymGetAddressInformation( IN PROSSYM_INFO RosSymInfo, IN ULONG_PTR RelativeAddress, - OUT PULONG LineNumber OPTIONAL, - OUT PCH FileName OPTIONAL, - OUT PCH FunctionName OPTIONAL) + IN PROSSYM_LINEINFO LineInfo) { if (!KdbpSymbolsInitialized || !RosSymInfo || - !RosSymGetAddressInformation(RosSymInfo, RelativeAddress, LineNumber, FileName, FunctionName)) + !RosSymGetAddressInformation(RosSymInfo, RelativeAddress, LineInfo)) { return STATUS_UNSUCCESSFUL; } @@ -429,7 +486,7 @@ KdbpSymLoadModuleSymbols( NTSTATUS Status; IO_STATUS_BLOCK IoStatusBlock; PFILE_OBJECT FileObject; - PROSSYM_OWN_FILECONTEXT FileContext; + PROSSYM_KM_OWN_CONTEXT FileContext; /* Allow KDB to break on module load */ KdbModuleLoaded(FileName); @@ -536,6 +593,26 @@ KdbDebugPrint( /* Nothing here */ } +static PVOID KdbpSymAllocMem(ULONG_PTR size) +{ + return ExAllocatePoolWithTag(NonPagedPool, size, 'RSYM'); +} + +static VOID KdbpSymFreeMem(PVOID Area) +{ + return ExFreePool(Area); +} + +static BOOLEAN KdbpSymReadMem(PVOID FileContext, PVOID TargetDebug, PVOID SourceMem, ULONG Size) +{ + return NT_SUCCESS(KdbpSafeReadMemory(TargetDebug, SourceMem, Size)); +} + +static ROSSYM_CALLBACKS KdbpRosSymCallbacks = { + KdbpSymAllocMem, KdbpSymFreeMem, + KdbpReadSymFile, KdbpSeekSymFile, + KdbpSymReadMem +}; /*! \brief Initializes the KDB symbols implementation. * @@ -621,7 +698,7 @@ KdbInitialize( p1 = p2; } - RosSymInitKernelMode(); + RosSymInit(&KdbpRosSymCallbacks); } else if (BootPhase == 3) { diff --git a/ntoskrnl/ke/bug.c b/ntoskrnl/ke/bug.c index 284f4252ccd..54a752842c2 100644 --- a/ntoskrnl/ke/bug.c +++ b/ntoskrnl/ke/bug.c @@ -266,7 +266,7 @@ KeRosDumpStackFrameArray(IN PULONG_PTR Frames, if (p) { #ifdef KDBG - if (!KdbSymPrintAddress((PVOID)Addr)) + if (!KdbSymPrintAddress((PVOID)Addr, NULL)) #endif { /* Print out the module name */ diff --git a/ntoskrnl/ke/i386/cpu.c b/ntoskrnl/ke/i386/cpu.c index 7f3358cdee9..0fd2dcc459d 100644 --- a/ntoskrnl/ke/i386/cpu.c +++ b/ntoskrnl/ke/i386/cpu.c @@ -41,7 +41,7 @@ ULONG KeDcacheFlushCount = 0; ULONG KeIcacheFlushCount = 0; ULONG KiDmaIoCoherency = 0; ULONG KePrefetchNTAGranularity = 32; -CHAR KeNumberProcessors; +CHAR KeNumberProcessors = 0; KAFFINITY KeActiveProcessors = 1; BOOLEAN KiI386PentiumLockErrataPresent; BOOLEAN KiSMTProcessorsPresent; diff --git a/ntoskrnl/ntoskrnl_i386.lnk b/ntoskrnl/ntoskrnl_i386.lnk index 8dac6c10fc1..788cda743c1 100644 --- a/ntoskrnl/ntoskrnl_i386.lnk +++ b/ntoskrnl/ntoskrnl_i386.lnk @@ -44,6 +44,13 @@ SECTIONS { *(.edata) } + /DISCARD/ : + { + *(.debug$S) + *(.debug$T) + *(.debug$F) + *(.drectve) + } .idata BLOCK(__section_alignment__) : { @@ -80,41 +87,13 @@ SECTIONS /* These zeroes mark the end of the reloc section. */ LONG (0); LONG (0); LONG (0); LONG (0); LONG (0); } - .debug_aranges BLOCK(__section_alignment__) : + .stab BLOCK(__section_alignment__) (NOLOAD) : { - *(.debug_aranges) + [ .stab ] } - .debug_abbrev BLOCK(__section_alignment__) : + .stabstr BLOCK(__section_alignment__) (NOLOAD) : { - *(.debug_abbrev) - } - .debug_frame BLOCK(__section_alignment__) : - { - *(.debug_frame) - } - .debug_info BLOCK(__section_alignment__) : - { - *(.debug_info) - } - .debug_line BLOCK(__section_alignment__) : - { - *(.debug_line) - } - .debug_loc BLOCK(__section_alignment__) : - { - *(.debug_loc) - } - .debug_pubnames BLOCK(__section_alignment__) : - { - *(.debug_pubnames) - } - .debug_ranges BLOCK(__section_alignment__) : - { - *(.debug_ranges) - } - .debug_str BLOCK(__section_alignment__) : - { - *(.debug_str) + [ .stabstr ] } INIT BLOCK(__section_alignment__) : { diff --git a/ntoskrnl/ob/obinit.c b/ntoskrnl/ob/obinit.c index 5a24101ed45..37d6f1bc761 100644 --- a/ntoskrnl/ob/obinit.c +++ b/ntoskrnl/ob/obinit.c @@ -169,6 +169,9 @@ ObInitSystem(VOID) /* Initialize the Default Event */ KeInitializeEvent(&ObpDefaultObject, NotificationEvent, TRUE); + /* Initialize the Dos Device Map mutex */ + KeInitializeGuardedMutex(&ObpDeviceMapLock); + /* Setup default access for the system process */ PsGetCurrentProcess()->GrantedAccess = PROCESS_ALL_ACCESS; PsGetCurrentThread()->GrantedAccess = THREAD_ALL_ACCESS; diff --git a/ntoskrnl/ob/oblife.c b/ntoskrnl/ob/oblife.c index f87e5948d36..ad4d9f10ca3 100644 --- a/ntoskrnl/ob/oblife.c +++ b/ntoskrnl/ob/oblife.c @@ -21,6 +21,7 @@ extern ULONG NtGlobalFlag; POBJECT_TYPE ObpTypeObjectType = NULL; KEVENT ObpDefaultObject; +KGUARDED_MUTEX ObpDeviceMapLock; GENERAL_LOOKASIDE ObpNameBufferLookasideList, ObpCreateInfoLookasideList; @@ -107,7 +108,7 @@ ObpDeallocateObject(IN PVOID Object) /* Add the SD charge too */ if (Header->Flags & OB_FLAG_SECURITY) PagedPoolCharge += 2048; } - + /* Return the quota */ DPRINT("FIXME: Should return quotas: %lx %lx\n", PagedPoolCharge, NonPagedPoolCharge); #if 0 @@ -115,7 +116,7 @@ ObpDeallocateObject(IN PVOID Object) PagedPoolCharge, NonPagedPoolCharge); #endif - + } } @@ -1261,14 +1262,14 @@ ObpDeleteObjectType(IN PVOID Object) { ULONG i; POBJECT_TYPE ObjectType = (PVOID)Object; - + /* Loop our locks */ for (i = 0; i < 4; i++) { /* Delete each one */ ExDeleteResourceLite(&ObjectType->ObjectLocks[i]); } - + /* Delete our main mutex */ ExDeleteResourceLite(&ObjectType->Mutex); } diff --git a/ntoskrnl/ob/oblink.c b/ntoskrnl/ob/oblink.c index 5b147474c0c..3648aa797a5 100644 --- a/ntoskrnl/ob/oblink.c +++ b/ntoskrnl/ob/oblink.c @@ -23,8 +23,160 @@ VOID NTAPI ObpDeleteSymbolicLinkName(IN POBJECT_SYMBOLIC_LINK SymbolicLink) { - /* FIXME: Device maps not supported yet */ + POBJECT_HEADER ObjectHeader; + POBJECT_HEADER_NAME_INFO ObjectNameInfo; + /* FIXME: Need to support Device maps */ + + /* Get header data */ + ObjectHeader = OBJECT_TO_OBJECT_HEADER(SymbolicLink); + ObjectNameInfo = ObpReferenceNameInfo(ObjectHeader); + + /* Check if we are not actually in a directory with a device map */ + if (!(ObjectNameInfo) || + !(ObjectNameInfo->Directory) /*|| + !(ObjectNameInfo->Directory->DeviceMap)*/) + { + ObpDereferenceNameInfo(ObjectNameInfo); + return; + } + + /* Check if it's a DOS drive letter, and remove the entry from drive map if needed */ + if (SymbolicLink->DosDeviceDriveIndex != 0 && + ObjectNameInfo->Name.Length == 2 * sizeof(WCHAR) && + ObjectNameInfo->Name.Buffer[1] == L':' && + ( (ObjectNameInfo->Name.Buffer[0] >= L'A' && + ObjectNameInfo->Name.Buffer[0] <= L'Z') || + (ObjectNameInfo->Name.Buffer[0] >= L'a' && + ObjectNameInfo->Name.Buffer[0] <= L'z') )) + { + /* Remove the drive entry */ + KeAcquireGuardedMutex(&ObpDeviceMapLock); + ObSystemDeviceMap->DriveType[SymbolicLink->DosDeviceDriveIndex-1] = + DOSDEVICE_DRIVE_UNKNOWN; + ObSystemDeviceMap->DriveMap &= + ~(1 << (SymbolicLink->DosDeviceDriveIndex-1)); + KeReleaseGuardedMutex(&ObpDeviceMapLock); + + /* Reset the drive index, valid drive index starts from 1 */ + SymbolicLink->DosDeviceDriveIndex = 0; + } + + ObpDereferenceNameInfo(ObjectNameInfo); +} + +NTSTATUS +NTAPI +ObpParseSymbolicLinkToIoDeviceObject(IN POBJECT_DIRECTORY SymbolicLinkDirectory, + IN OUT POBJECT_DIRECTORY *Directory, + IN OUT PUNICODE_STRING TargetPath, + IN OUT POBP_LOOKUP_CONTEXT Context, + OUT PVOID *Object) +{ + UNICODE_STRING Name; + BOOLEAN ManualUnlock; + + if (! TargetPath || ! Object || ! Context || ! Directory || + ! SymbolicLinkDirectory) + { + return STATUS_INVALID_PARAMETER; + } + + /* FIXME: Need to support Device maps */ + + /* Try walking the target path and open each part of the path */ + while (TargetPath->Length) + { + /* Strip '\' if present at the beginning of the target path */ + if (TargetPath->Length >= sizeof(OBJ_NAME_PATH_SEPARATOR)&& + TargetPath->Buffer[0] == OBJ_NAME_PATH_SEPARATOR) + { + TargetPath->Buffer++; + TargetPath->Length -= sizeof(OBJ_NAME_PATH_SEPARATOR); + } + + /* Remember the current component of the target path */ + Name = *TargetPath; + + /* Move forward to the next component of the target path */ + while (TargetPath->Length >= sizeof(OBJ_NAME_PATH_SEPARATOR)) + { + if (TargetPath->Buffer[0] != OBJ_NAME_PATH_SEPARATOR) + { + TargetPath->Buffer++; + TargetPath->Length -= sizeof(OBJ_NAME_PATH_SEPARATOR); + } + else + break; + } + + Name.Length -= TargetPath->Length; + + /* Finished processing the entire path, stop */ + if (! Name.Length) + break; + + /* + * Make sure a deadlock does not occur as an exclusive lock on a pushlock + * would have already taken one in ObpLookupObjectName() on the parent + * directory where the symlink is being created [ObInsertObject()]. + * Prevent recursive locking by faking lock state in the lookup context + * when the current directory is same as the parent directory where + * the symlink is being created. If the lock state is not faked, + * ObpLookupEntryDirectory() will try to get a recursive lock on the + * pushlock and hang. For e.g. this happens when a substed drive is pointed to + * another substed drive. + */ + if (*Directory == SymbolicLinkDirectory && ! Context->DirectoryLocked) + { + /* Fake lock state so that ObpLookupEntryDirectory() doesn't attempt a lock */ + ManualUnlock = TRUE; + Context->DirectoryLocked = TRUE; + } + else + ManualUnlock = FALSE; + + *Object = ObpLookupEntryDirectory(*Directory, + &Name, + 0, + FALSE, + Context); + + /* Locking was faked, undo it now */ + if (*Directory == SymbolicLinkDirectory && ManualUnlock) + Context->DirectoryLocked = FALSE; + + /* Lookup failed, stop */ + if (! *Object) + break; + + if (OBJECT_TO_OBJECT_HEADER(*Object)->Type == ObDirectoryType) + { + /* Make this current directory, and continue search */ + *Directory = (POBJECT_DIRECTORY)*Object; + } + else if (OBJECT_TO_OBJECT_HEADER(*Object)->Type == ObSymbolicLinkType && + (((POBJECT_SYMBOLIC_LINK)*Object)->DosDeviceDriveIndex == 0)) + { + /* Symlink points to another initialized symlink, ask caller to reparse */ + *Directory = ObpRootDirectoryObject; + TargetPath = &((POBJECT_SYMBOLIC_LINK)*Object)->LinkTarget; + return STATUS_REPARSE_OBJECT; + } + else + { + /* Neither directory or symlink, stop */ + break; + } + } + + /* Return a valid object, only if object type is IoDeviceObject */ + if (*Object && + OBJECT_TO_OBJECT_HEADER(*Object)->Type != IoDeviceObjectType) + { + *Object = NULL; + } + return STATUS_SUCCESS; } VOID @@ -33,23 +185,124 @@ ObpCreateSymbolicLinkName(IN POBJECT_SYMBOLIC_LINK SymbolicLink) { POBJECT_HEADER ObjectHeader; POBJECT_HEADER_NAME_INFO ObjectNameInfo; + PVOID Object = NULL; + POBJECT_DIRECTORY Directory; + UNICODE_STRING TargetPath; + NTSTATUS Status; + ULONG DriveType = DOSDEVICE_DRIVE_CALCULATE; + ULONG ReparseCnt; + const ULONG MaxReparseAttempts = 20; + OBP_LOOKUP_CONTEXT Context; + + /* FIXME: Need to support Device maps */ /* Get header data */ ObjectHeader = OBJECT_TO_OBJECT_HEADER(SymbolicLink); - ObjectNameInfo = OBJECT_HEADER_TO_NAME_INFO(ObjectHeader); + ObjectNameInfo = ObpReferenceNameInfo(ObjectHeader); /* Check if we are not actually in a directory with a device map */ if (!(ObjectNameInfo) || - !(ObjectNameInfo->Directory) || - !(ObjectNameInfo->Directory->DeviceMap)) + !(ObjectNameInfo->Directory) /*|| + !(ObjectNameInfo->Directory->DeviceMap)*/) { - /* There's nothing to do, return */ + ObpDereferenceNameInfo(ObjectNameInfo); return; } - /* FIXME: We don't support device maps yet */ - DPRINT1("Unhandled path!\n"); - ASSERT(FALSE); + /* Check if it's a DOS drive letter, and set the drive index accordingly */ + if (ObjectNameInfo->Name.Length == 2 * sizeof(WCHAR) && + ObjectNameInfo->Name.Buffer[1] == L':' && + ( (ObjectNameInfo->Name.Buffer[0] >= L'A' && + ObjectNameInfo->Name.Buffer[0] <= L'Z') || + (ObjectNameInfo->Name.Buffer[0] >= L'a' && + ObjectNameInfo->Name.Buffer[0] <= L'z') )) + { + SymbolicLink->DosDeviceDriveIndex = + RtlUpcaseUnicodeChar(ObjectNameInfo->Name.Buffer[0]) - L'A'; + /* The Drive index start from 1 */ + SymbolicLink->DosDeviceDriveIndex++; + + /* Initialize lookup context */ + ObpInitializeLookupContext(&Context); + + /* Start the search from the root */ + Directory = ObpRootDirectoryObject; + TargetPath = SymbolicLink->LinkTarget; + + /* + * Locate the IoDeviceObject if any this symbolic link points to. + * To prevent endless reparsing, setting an upper limit on the + * number of reparses. + */ + Status = STATUS_REPARSE_OBJECT; + ReparseCnt = 0; + while (Status == STATUS_REPARSE_OBJECT && + ReparseCnt < MaxReparseAttempts) + { + Status = + ObpParseSymbolicLinkToIoDeviceObject(ObjectNameInfo->Directory, + &Directory, + &TargetPath, + &Context, + &Object); + if (Status == STATUS_REPARSE_OBJECT) + ReparseCnt++; + } + + /* Cleanup lookup context */ + ObpReleaseLookupContext(&Context); + + /* Error, or max resparse attemtps exceeded */ + if (! NT_SUCCESS(Status) || ReparseCnt >= MaxReparseAttempts) + { + /* Cleanup */ + ObpDereferenceNameInfo(ObjectNameInfo); + return; + } + + if (Object) + { + /* Calculate the drive type */ + switch(((PDEVICE_OBJECT)Object)->DeviceType) + { + case FILE_DEVICE_VIRTUAL_DISK: + DriveType = DOSDEVICE_DRIVE_RAMDISK; + break; + case FILE_DEVICE_CD_ROM: + case FILE_DEVICE_CD_ROM_FILE_SYSTEM: + DriveType = DOSDEVICE_DRIVE_CDROM; + break; + case FILE_DEVICE_DISK: + case FILE_DEVICE_DISK_FILE_SYSTEM: + case FILE_DEVICE_FILE_SYSTEM: + if (((PDEVICE_OBJECT)Object)->Characteristics & FILE_REMOVABLE_MEDIA) + DriveType = DOSDEVICE_DRIVE_REMOVABLE; + else + DriveType = DOSDEVICE_DRIVE_FIXED; + break; + case FILE_DEVICE_NETWORK: + case FILE_DEVICE_NETWORK_FILE_SYSTEM: + DriveType = DOSDEVICE_DRIVE_REMOTE; + break; + default: + DPRINT1("Device Type %ld for %wZ is not known or unhandled\n", + ((PDEVICE_OBJECT)Object)->DeviceType, + &SymbolicLink->LinkTarget); + DriveType = DOSDEVICE_DRIVE_UNKNOWN; + } + } + + /* Add a new drive entry */ + KeAcquireGuardedMutex(&ObpDeviceMapLock); + ObSystemDeviceMap->DriveType[SymbolicLink->DosDeviceDriveIndex-1] = + (UCHAR)DriveType; + ObSystemDeviceMap->DriveMap |= + 1 << (SymbolicLink->DosDeviceDriveIndex-1); + KeReleaseGuardedMutex(&ObpDeviceMapLock); + } + + /* Cleanup */ + ObpDereferenceNameInfo(ObjectNameInfo); } /*++ diff --git a/ntoskrnl/ob/obname.c b/ntoskrnl/ob/obname.c index a514af7b195..e4f7e184985 100644 --- a/ntoskrnl/ob/obname.c +++ b/ntoskrnl/ob/obname.c @@ -113,24 +113,28 @@ VOID NTAPI ObDereferenceDeviceMap(IN PEPROCESS Process) { - //KIRQL OldIrql; - PDEVICE_MAP DeviceMap = Process->DeviceMap; + PDEVICE_MAP DeviceMap; - /* FIXME: We don't use Process Devicemaps yet */ + /* Get the pointer to this process devicemap and reset it + holding devicemap lock */ + KeAcquireGuardedMutex(&ObpDeviceMapLock); + DeviceMap = Process->DeviceMap; + Process->DeviceMap = NULL; + KeReleaseGuardedMutex(&ObpDeviceMapLock); + + /* Continue only if there is a devicemap to dereference */ if (DeviceMap) { - /* FIXME: Acquire the DeviceMap Spinlock */ - // KeAcquireSpinLock(DeviceMap->Lock, &OldIrql); + KeAcquireGuardedMutex(&ObpDeviceMapLock); /* Delete the device map link and dereference it */ - Process->DeviceMap = NULL; if (--DeviceMap->ReferenceCount) { /* Nobody is referencing it anymore, unlink the DOS directory */ DeviceMap->DosDevicesDirectory->DeviceMap = NULL; - /* FIXME: Release the DeviceMap Spinlock */ - // KeReleasepinLock(DeviceMap->Lock, OldIrql); + /* Release the devicemap lock */ + KeReleaseGuardedMutex(&ObpDeviceMapLock); /* Dereference the DOS Devices Directory and free the Device Map */ ObDereferenceObject(DeviceMap->DosDevicesDirectory); @@ -138,8 +142,8 @@ ObDereferenceDeviceMap(IN PEPROCESS Process) } else { - /* FIXME: Release the DeviceMap Spinlock */ - // KeReleasepinLock(DeviceMap->Lock, OldIrql); + /* Release the devicemap lock */ + KeReleaseGuardedMutex(&ObpDeviceMapLock); } } } @@ -1144,15 +1148,12 @@ NTAPI ObQueryDeviceMapInformation(IN PEPROCESS Process, IN PPROCESS_DEVICEMAP_INFORMATION DeviceMapInfo) { - //KIRQL OldIrql ; - /* * FIXME: This is an ugly hack for now, to always return the System Device Map * instead of returning the Process Device Map. Not important yet since we don't use it */ - /* FIXME: Acquire the DeviceMap Spinlock */ - // KeAcquireSpinLock(DeviceMap->Lock, &OldIrql); + KeAcquireGuardedMutex(&ObpDeviceMapLock); /* Make a copy */ DeviceMapInfo->Query.DriveMap = ObSystemDeviceMap->DriveMap; @@ -1160,8 +1161,7 @@ ObQueryDeviceMapInformation(IN PEPROCESS Process, ObSystemDeviceMap->DriveType, sizeof(ObSystemDeviceMap->DriveType)); - /* FIXME: Release the DeviceMap Spinlock */ - // KeReleasepinLock(DeviceMap->Lock, OldIrql); + KeReleaseGuardedMutex(&ObpDeviceMapLock); } /* EOF */ diff --git a/ros_cd.cmake b/ros_cd.cmake deleted file mode 100644 index 6b5382161aa..00000000000 --- a/ros_cd.cmake +++ /dev/null @@ -1,159 +0,0 @@ -#reactos.dff -add_custom_command( - OUTPUT ${REACTOS_BINARY_DIR}/boot/reactos.dff - COMMAND ${CMAKE_COMMAND} -E copy ${REACTOS_SOURCE_DIR}/boot/bootdata/packages/reactos.dff.in ${REACTOS_BINARY_DIR}/boot/reactos.dff - DEPENDS ${REACTOS_SOURCE_DIR}/boot/bootdata/packages/reactos.dff.in) - -file(STRINGS ${REACTOS_BINARY_DIR}/boot/ros_cab_target.txt CAB_TARGET_ENTRIES) -foreach(ENTRY ${CAB_TARGET_ENTRIES}) - string(REGEX REPLACE "^(.*)\t.*" "\\1" _targetname ${ENTRY}) - string(REGEX REPLACE "^.*\t(.)" "\\1" _dir_num ${ENTRY}) - get_target_property(_FILENAME ${_targetname} LOCATION) - if(NOT CMAKE_HOST_SYSTEM_NAME MATCHES Windows) - set(_FILENAME '\"${_FILENAME}\"') - endif() - add_custom_command( - OUTPUT ${REACTOS_BINARY_DIR}/boot/reactos.dff - COMMAND ${CMAKE_COMMAND} -E echo ${_FILENAME} ${_dir_num} >> ${REACTOS_BINARY_DIR}/boot/reactos.dff - DEPENDS ${_targetname} - APPEND) -endforeach() - -file(STRINGS ${REACTOS_BINARY_DIR}/boot/ros_cab.txt CAB_TARGET_ENTRIES) -foreach(ENTRY ${CAB_TARGET_ENTRIES}) - string(REGEX REPLACE "^(.*)\t.*" "\\1" _FILENAME ${ENTRY}) - string(REGEX REPLACE "^.*\t(.)" "\\1" _dir_num ${ENTRY}) - if(NOT CMAKE_HOST_SYSTEM_NAME MATCHES Windows) - set(QUOTED_FILENAME '\"${_FILENAME}\"') - else() - set(QUOTED_FILENAME ${_FILENAME}) - endif() - add_custom_command( - OUTPUT ${REACTOS_BINARY_DIR}/boot/reactos.dff - COMMAND ${CMAKE_COMMAND} -E echo ${QUOTED_FILENAME} ${_dir_num} >> ${REACTOS_BINARY_DIR}/boot/reactos.dff - DEPENDS ${_FILENAME} - APPEND) -endforeach() - -#reactos.cab -add_custom_command( - OUTPUT ${REACTOS_BINARY_DIR}/boot/reactos.inf - COMMAND native-cabman -C ${REACTOS_BINARY_DIR}/boot/reactos.dff -L ${REACTOS_BINARY_DIR}/boot -I -P ${REACTOS_SOURCE_DIR} - DEPENDS ${REACTOS_BINARY_DIR}/boot/reactos.dff) -add_custom_command( - OUTPUT ${REACTOS_BINARY_DIR}/boot/reactos.cab - COMMAND native-cabman -C ${REACTOS_BINARY_DIR}/boot/reactos.dff -RC ${REACTOS_BINARY_DIR}/boot/reactos.inf -L ${REACTOS_BINARY_DIR}/boot -N -P ${REACTOS_SOURCE_DIR} - DEPENDS ${REACTOS_BINARY_DIR}/boot/reactos.inf) - -#bootcd target -macro(create_bootcd_dir BOOTCD_DIR _target) - - file(MAKE_DIRECTORY - "${BOOTCD_DIR}" - "${BOOTCD_DIR}/loader" - "${BOOTCD_DIR}/reactos" - "${BOOTCD_DIR}/reactos/system32") - - file(STRINGS ${REACTOS_BINARY_DIR}/boot/ros_minicd_target.txt MINICD_TARGET_ENTRIES) - foreach(ENTRY ${MINICD_TARGET_ENTRIES}) - string(REGEX REPLACE "^(.*)\t.*\t.*" "\\1" _targetname ${ENTRY}) - string(REGEX REPLACE "^.*\t(.*)\t.*" "\\1" _DIR ${ENTRY}) - string(REGEX REPLACE "^.*\t.*\t(.*)" "\\1"_NAMEONCD ${ENTRY}) - get_target_property(_FILENAME ${_targetname} LOCATION) - set(filename ${BOOTCD_DIR}/${_DIR}/${_NAMEONCD}) - list(APPEND ${_target}_FILES ${filename}) - add_custom_command( - OUTPUT ${filename} - COMMAND ${CMAKE_COMMAND} -E copy ${_FILENAME} ${filename} - DEPENDS ${_targetname}) - endforeach() - - file(STRINGS ${REACTOS_BINARY_DIR}/boot/ros_minicd.txt MINICD_ENTRIES) - foreach(ENTRY ${MINICD_ENTRIES}) - string(REGEX REPLACE "^(.*)\t.*\t.*" "\\1" _FILENAME ${ENTRY}) - string(REGEX REPLACE "^.*\t(.*)\t.*" "\\1" _DIR ${ENTRY}) - string(REGEX REPLACE "^.*\t.*\t(.*)" "\\1"_NAMEONCD ${ENTRY}) - set(filename ${BOOTCD_DIR}/${_DIR}/${_NAMEONCD}) - list(APPEND ${_target}_FILES ${filename}) - add_custom_command( - OUTPUT ${filename} - COMMAND ${CMAKE_COMMAND} -E copy ${_FILENAME} ${filename} - DEPENDS ${_FILENAME}) - endforeach() - - add_custom_command( - OUTPUT ${BOOTCD_DIR}/reactos/reactos.inf ${BOOTCD_DIR}/reactos/reactos.cab - COMMAND ${CMAKE_COMMAND} -E copy ${REACTOS_BINARY_DIR}/boot/reactos.inf ${BOOTCD_DIR}/reactos/reactos.inf - COMMAND ${CMAKE_COMMAND} -E copy ${REACTOS_BINARY_DIR}/boot/reactos.cab ${BOOTCD_DIR}/reactos/reactos.cab - DEPENDS ${REACTOS_BINARY_DIR}/boot/reactos.cab) - list(APPEND ${_target}_FILES ${filename} ${BOOTCD_DIR}/reactos/reactos.inf ${BOOTCD_DIR}/reactos/reactos.cab) -endmacro() - -create_bootcd_dir(${REACTOS_BINARY_DIR}/boot/bootcd bootcd) -add_custom_target(bootcd - COMMAND native-cdmake -v -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/boot/freeldr/bootsect/isoboot.bin ${BOOTCD_DIR} REACTOS ${REACTOS_BINARY_DIR}/bootcd.iso - DEPENDS ${bootcd_FILES}) -add_dependencies(bootcd dosmbr ext2 fat32 fat isoboot isobtrt vgafonts) -set_directory_properties(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${REACTOS_BINARY_DIR}/bootcd.iso) - -#bootcdregtest target -create_bootcd_dir(${REACTOS_BINARY_DIR}/boot/bootcdregtest bootcdregtest) -add_custom_command( - OUTPUT ${REACTOS_BINARY_DIR}/boot/bootcdregtest/reactos/unattend.inf - COMMAND ${CMAKE_COMMAND} -E copy ${REACTOS_SOURCE_DIR}/boot/bootdata/bootcdregtest/unattend.inf ${REACTOS_BINARY_DIR}/boot/bootcdregtest/reactos/unattend.inf - DEPENDS ${REACTOS_SOURCE_DIR}/boot/bootdata/bootcdregtest/unattend.inf ${REACTOS_BINARY_DIR}/boot/bootcdregtest) -add_custom_target(bootcdregtest - COMMAND native-cdmake -v -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/boot/freeldr/bootsect/isoboot.bin ${REACTOS_BINARY_DIR}/boot/bootcdregtest REACTOS ${REACTOS_BINARY_DIR}/bootcdregtest.iso - DEPENDS ${REACTOS_BINARY_DIR}/boot/bootcdregtest/reactos/unattend.inf ${bootcdregtest_FILES}) -add_dependencies(bootcdregtest dosmbr ext2 fat32 fat isoboot isobtrt vgafonts) - - -#livecd target -file(MAKE_DIRECTORY - "${LIVECD_DIR}" - "${LIVECD_DIR}/loader" - "${LIVECD_DIR}/Profiles" - "${LIVECD_DIR}/Profiles/All Users" - "${LIVECD_DIR}/Profiles/All Users/Desktop" - "${LIVECD_DIR}/Profiles/Default User" - "${LIVECD_DIR}/Profiles/Default User/Desktop" - "${LIVECD_DIR}/Profiles/Default User/My Documents" - "${LIVECD_DIR}/reactos" - "${LIVECD_DIR}/reactos/inf" - "${LIVECD_DIR}/reactos/fonts" - "${LIVECD_DIR}/reactos/system32" - "${LIVECD_DIR}/reactos/system32/config") - -file(STRINGS ${REACTOS_BINARY_DIR}/boot/ros_livecd_target.txt LIVECD_TARGET_ENTRIES) -foreach(ENTRY ${LIVECD_TARGET_ENTRIES}) - string(REGEX REPLACE "^(.*)\t.*\t.*" "\\1" _targetname ${ENTRY}) - string(REGEX REPLACE "^.*\t(.*)\t.*" "\\1" _DIR ${ENTRY}) - string(REGEX REPLACE "^.*\t.*\t(.*)" "\\1"_NAMEONCD ${ENTRY}) - get_target_property(_FILENAME ${_targetname} LOCATION) - set(filename ${LIVECD_DIR}/${_DIR}/${_NAMEONCD}) - list(APPEND LIVECD_FILES ${filename}) - add_custom_command( - OUTPUT ${filename} - COMMAND ${CMAKE_COMMAND} -E copy ${_FILENAME} ${LIVECD_DIR}/${_DIR}/${_NAMEONCD} - DEPENDS ${_targetname}) -endforeach() -file(STRINGS ${REACTOS_BINARY_DIR}/boot/ros_livecd.txt LIVECD_ENTRIES) - -foreach(ENTRY ${LIVECD_ENTRIES}) - string(REGEX REPLACE "^(.*)\t.*\t.*" "\\1" _FILENAME ${ENTRY}) - string(REGEX REPLACE "^.*\t(.*)\t.*" "\\1" _DIR ${ENTRY}) - string(REGEX REPLACE "^.*\t.*\t(.*)" "\\1"_NAMEONCD ${ENTRY}) - set(filename ${LIVECD_DIR}/${_DIR}/${_NAMEONCD}) - list(APPEND LIVECD_FILES ${filename}) - add_custom_command( - OUTPUT ${filename} - COMMAND ${CMAKE_COMMAND} -E copy ${_FILENAME} ${LIVECD_DIR}/${_DIR}/${_NAMEONCD} - DEPENDS ${_FILENAME}) -endforeach() - -add_custom_target(livecd - COMMAND native-cdmake -v -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/boot/freeldr/bootsect/isoboot.bin ${LIVECD_DIR} REACTOS ${REACTOS_BINARY_DIR}/livecd.iso - DEPENDS ${LIVECD_FILES}) -add_dependencies(livecd isoboot livecd_hives vgafonts) - -set_directory_properties(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${REACTOS_BINARY_DIR}/livecd.iso) diff --git a/subsystems/ntvdm/CMakeLists.txt b/subsystems/ntvdm/CMakeLists.txt index 47d5755a7a0..a64fd05ee4e 100644 --- a/subsystems/ntvdm/CMakeLists.txt +++ b/subsystems/ntvdm/CMakeLists.txt @@ -16,4 +16,4 @@ target_link_libraries(ntvdm add_importlibs(ntvdm ntdll user32 gdi32 advapi32 kernel32 msvcrt) add_dependencies(ntvdm ndk bugcodes) -add_cab_target(ntvdm 1) \ No newline at end of file +add_cd_file(TARGET ntvdm DESTINATION reactos/system32 FOR all) \ No newline at end of file diff --git a/subsystems/win32/csrss/CMakeLists.txt b/subsystems/win32/csrss/CMakeLists.txt index 640062b5421..7d993c48c20 100644 --- a/subsystems/win32/csrss/CMakeLists.txt +++ b/subsystems/win32/csrss/CMakeLists.txt @@ -10,7 +10,7 @@ set_module_type(csrss nativecui) target_link_libraries(csrss nt) add_importlibs(csrss ntdll csrsrv) add_dependencies(csrss psdk bugcodes) -add_cab_target(csrss 1) +add_cd_file(TARGET csrss DESTINATION reactos/system32 FOR all) add_subdirectory(csrsrv) add_subdirectory(win32csr) diff --git a/subsystems/win32/csrss/csrsrv/CMakeLists.txt b/subsystems/win32/csrss/csrsrv/CMakeLists.txt index cf16e3e7c42..34944902ed3 100644 --- a/subsystems/win32/csrss/csrsrv/CMakeLists.txt +++ b/subsystems/win32/csrss/csrsrv/CMakeLists.txt @@ -29,5 +29,5 @@ add_importlibs(csrsrv ntdll smdll) add_pch(csrsrv ${CMAKE_CURRENT_SOURCE_DIR}/srv.h ${SOURCE}) add_dependencies(csrsrv psdk bugcodes) -add_cab_target(csrsrv 1) +add_cd_file(TARGET csrsrv DESTINATION reactos/system32 FOR all) add_importlib_target(csrsrv.spec) diff --git a/subsystems/win32/csrss/win32csr/CMakeLists.txt b/subsystems/win32/csrss/win32csr/CMakeLists.txt index 8422a9500c0..20f278a69e3 100644 --- a/subsystems/win32/csrss/win32csr/CMakeLists.txt +++ b/subsystems/win32/csrss/win32csr/CMakeLists.txt @@ -13,7 +13,6 @@ set_rc_compiler() list(APPEND SOURCE alias.c - appswitch.c coninput.c conoutput.c console.c @@ -42,4 +41,4 @@ add_importlibs(win32csr user32 gdi32 advapi32 psapi msvcrt kernel32 ntdll) add_pch(win32csr ${CMAKE_CURRENT_SOURCE_DIR}/w32csr.h ${SOURCE}) add_dependencies(win32csr bugcodes) -add_cab_target(win32csr 1) +add_cd_file(TARGET win32csr DESTINATION reactos/system32 FOR all) diff --git a/subsystems/win32/csrss/win32csr/dllmain.c b/subsystems/win32/csrss/win32csr/dllmain.c index 013b8b8556d..d8cfa8c8161 100644 --- a/subsystems/win32/csrss/win32csr/dllmain.c +++ b/subsystems/win32/csrss/win32csr/dllmain.c @@ -14,7 +14,6 @@ /* Not defined in any header file */ extern VOID WINAPI PrivateCsrssManualGuiCheck(LONG Check); -extern VOID WINAPI InitializeAppSwitchHook(); extern LIST_ENTRY DosDeviceHistory; extern RTL_CRITICAL_SECTION Win32CsrDefineDosDeviceCritSec; @@ -95,8 +94,20 @@ static CSRSS_API_DEFINITION Win32CsrApiDefinitions[] = { 0, 0, NULL } }; +static HHOOK hhk = NULL; + /* FUNCTIONS *****************************************************************/ +LRESULT +CALLBACK +KeyboardHookProc( + int nCode, + WPARAM wParam, + LPARAM lParam) +{ + return CallNextHookEx(hhk, nCode, wParam, lParam); +} + BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, @@ -105,7 +116,13 @@ DllMain(HANDLE hDll, if (DLL_PROCESS_ATTACH == dwReason) { Win32CsrDllHandle = hDll; - InitializeAppSwitchHook(); +// +// HACK HACK HACK ReactOS to BOOT! Initialization BUG ALERT! See bug 5655. +// + hhk = SetWindowsHookEx(WH_KEYBOARD_LL, KeyboardHookProc, NULL, 0); +// BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! +// BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! +// BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! } if (DLL_PROCESS_DETACH == dwReason) diff --git a/subsystems/win32/csrss/win32csr/file.c b/subsystems/win32/csrss/win32csr/file.c index 862a01480f3..982e8feec54 100644 --- a/subsystems/win32/csrss/win32csr/file.c +++ b/subsystems/win32/csrss/win32csr/file.c @@ -59,7 +59,7 @@ CSR_API(CsrDefineDosDevice) DWORD dwFlags; PWSTR lpBuffer; - DPRINT("CsrDefineDosDevice entered, Flags:%d, DeviceName:%wZ, TargetName:%wZ\n", + DPRINT("CsrDefineDosDevice entered, Flags:%d, DeviceName:%wZ, TargetName:%wZ\n", Request->Data.DefineDosDeviceRequest.dwFlags, &Request->Data.DefineDosDeviceRequest.DeviceName, &Request->Data.DefineDosDeviceRequest.TargetName); @@ -98,6 +98,17 @@ CSR_API(CsrDefineDosDevice) RequestLinkTarget = &Request->Data.DefineDosDeviceRequest.TargetName; + /* + * Strip off any trailing '\', if we leave a trailing slash the drive remains non-accessible. + * So working around it for now. + * FIXME: Need to fix this in the object manager ObpLookupObjectName()??, and remove this when the its fixed. + */ + while (RequestLinkTarget->Length >= sizeof(WCHAR) && + RequestLinkTarget->Buffer[(RequestLinkTarget->Length/sizeof(WCHAR)) - 1] == L'\\') + { + RequestLinkTarget->Length -= sizeof(WCHAR); + } + lpBuffer = (PWSTR) RtlAllocateHeap(Win32CsrApiHeap, HEAP_ZERO_MEMORY, RequestDeviceName.MaximumLength + 5 * sizeof(WCHAR)); @@ -146,7 +157,7 @@ CSR_API(CsrDefineDosDevice) &LinkTarget, &Length); } - + if (! NT_SUCCESS(Status)) { DPRINT1("NtQuerySymbolicLinkObject(%wZ) failed (Status %lx)\n", @@ -188,7 +199,7 @@ CSR_API(CsrDefineDosDevice) CONTAINING_RECORD(Entry, CSRSS_DOS_DEVICE_HISTORY_ENTRY, Entry); - Matched = + Matched = ! RtlCompareUnicodeString(&RequestDeviceName, &HistoryEntry->Device, FALSE); @@ -459,7 +470,7 @@ CSR_API(CsrDefineDosDevice) &DeviceName, Status); } } - _SEH2_FINALLY + _SEH2_FINALLY { (void) RtlLeaveCriticalSection(&Win32CsrDefineDosDeviceCritSec); if (DeviceName.Buffer) @@ -504,13 +515,13 @@ CSR_API(CsrDefineDosDevice) return Status; } -void CsrCleanupDefineDosDevice() +void CsrCleanupDefineDosDevice(void) { PLIST_ENTRY Entry, ListHead; PCSRSS_DOS_DEVICE_HISTORY_ENTRY HistoryEntry; (void) RtlDeleteCriticalSection(&Win32CsrDefineDosDeviceCritSec); - + ListHead = &DosDeviceHistory; Entry = ListHead->Flink; while (Entry != ListHead) diff --git a/subsystems/win32/csrss/win32csr/guiconsole.c b/subsystems/win32/csrss/win32csr/guiconsole.c index 8742538a1b2..e54e4dd9052 100644 --- a/subsystems/win32/csrss/win32csr/guiconsole.c +++ b/subsystems/win32/csrss/win32csr/guiconsole.c @@ -1370,6 +1370,109 @@ GuiConsoleMouseMove(HWND hWnd, WPARAM wParam, LPARAM lParam) GuiConsoleUpdateSelection(Console, &c); } +static VOID +GuiConsoleCopy(HWND hWnd, PCSRSS_CONSOLE Console) +{ + if (OpenClipboard(hWnd) == TRUE) + { + HANDLE hData; + PBYTE ptr; + LPSTR data, dstPos; + ULONG selWidth, selHeight; + ULONG xPos, yPos, size; + + selWidth = Console->Selection.srSelection.Right - Console->Selection.srSelection.Left + 1; + selHeight = Console->Selection.srSelection.Bottom - Console->Selection.srSelection.Top + 1; + DPRINT("Selection is (%d|%d) to (%d|%d)\n", + Console->Selection.srSelection.Left, + Console->Selection.srSelection.Top, + Console->Selection.srSelection.Right, + Console->Selection.srSelection.Bottom); + + /* Basic size for one line and termination */ + size = selWidth + 1; + if (selHeight > 0) + { + /* Multiple line selections have to get \r\n appended */ + size += ((selWidth + 2) * (selHeight - 1)); + } + + /* Allocate memory, it will be passed to the system and may not be freed here */ + hData = GlobalAlloc(GMEM_MOVEABLE | GMEM_ZEROINIT, size); + if (hData == NULL) + { + CloseClipboard(); + return; + } + data = GlobalLock(hData); + if (data == NULL) + { + CloseClipboard(); + return; + } + + DPRINT("Copying %dx%d selection\n", selWidth, selHeight); + dstPos = data; + + for (yPos = 0; yPos < selHeight; yPos++) + { + ptr = ConioCoordToPointer(Console->ActiveBuffer, + Console->Selection.srSelection.Left, + yPos + Console->Selection.srSelection.Top); + /* Copy only the characters, leave attributes alone */ + for (xPos = 0; xPos < selWidth; xPos++) + { + dstPos[xPos] = ptr[xPos * 2]; + } + dstPos += selWidth; + if (yPos != (selHeight - 1)) + { + strcat(data, "\r\n"); + dstPos += 2; + } + } + + DPRINT("Setting data <%s> to clipboard\n", data); + GlobalUnlock(hData); + + EmptyClipboard(); + SetClipboardData(CF_TEXT, hData); + CloseClipboard(); + } +} + +static VOID +GuiConsolePaste(HWND hWnd, PCSRSS_CONSOLE Console) +{ + if (OpenClipboard(hWnd) == TRUE) + { + HANDLE hData; + LPSTR str; + size_t len; + + hData = GetClipboardData(CF_TEXT); + if (hData == NULL) + { + CloseClipboard(); + return; + } + + str = GlobalLock(hData); + if (str == NULL) + { + CloseClipboard(); + return; + } + DPRINT("Got data <%s> from clipboard\n", str); + len = strlen(str); + + ConioWriteConsole(Console, Console->ActiveBuffer, str, len, TRUE); + + GlobalUnlock(hData); + CloseClipboard(); + } +} + static VOID GuiConsoleRightMouseDown(HWND hWnd) { @@ -1381,12 +1484,13 @@ GuiConsoleRightMouseDown(HWND hWnd) if (!(Console->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY)) { - /* FIXME - paste text from clipboard */ + GuiConsolePaste(hWnd, Console); } else { - /* FIXME - copy selection to clipboard */ + GuiConsoleCopy(hWnd, Console); + /* Clear the selection */ GuiConsoleUpdateSelection(Console, NULL); } @@ -1466,18 +1570,41 @@ GuiConsoleShowConsoleProperties(HWND hWnd, BOOL Defaults, PGUI_CONSOLE_DATA GuiD CPLFunc(hWnd, CPL_DBLCLK, (LPARAM)&SharedInfo, Defaults); } static LRESULT -GuiConsoleHandleSysMenuCommand(HWND hWnd, WPARAM wParam, LPARAM lParam, PGUI_CONSOLE_DATA GuiData) +GuiConsoleHandleSysMenuCommand(HWND hWnd, WPARAM wParam, LPARAM lParam) { LRESULT Ret = TRUE; + PCSRSS_CONSOLE Console; + PGUI_CONSOLE_DATA GuiData; + COORD bottomRight = { 0, 0 }; + + GuiConsoleGetDataPointers(hWnd, &Console, &GuiData); switch(wParam) { case ID_SYSTEM_EDIT_MARK: + DPRINT1("Marking not handled yet\n"); + break; + case ID_SYSTEM_EDIT_COPY: + GuiConsoleCopy(hWnd, Console); + break; + case ID_SYSTEM_EDIT_PASTE: + GuiConsolePaste(hWnd, Console); + break; + case ID_SYSTEM_EDIT_SELECTALL: + bottomRight.X = Console->Size.X - 1; + bottomRight.Y = Console->Size.Y - 1; + GuiConsoleUpdateSelection(Console, &bottomRight); + break; + case ID_SYSTEM_EDIT_SCROLL: + DPRINT1("Scrolling is not handled yet\n"); + break; + case ID_SYSTEM_EDIT_FIND: + DPRINT1("Finding is not handled yet\n"); break; case ID_SYSTEM_DEFAULTS: @@ -1895,7 +2022,7 @@ GuiConsoleWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) GuiConsoleMouseMove(hWnd, wParam, lParam); break; case WM_SYSCOMMAND: - Result = GuiConsoleHandleSysMenuCommand(hWnd, wParam, lParam, GuiData); + Result = GuiConsoleHandleSysMenuCommand(hWnd, wParam, lParam); break; case WM_HSCROLL: case WM_VSCROLL: diff --git a/subsystems/win32/csrss/win32csr/lang/sk-SK.rc b/subsystems/win32/csrss/win32csr/lang/sk-SK.rc index 3b9bcaa0483..6a0d7663c42 100644 --- a/subsystems/win32/csrss/win32csr/lang/sk-SK.rc +++ b/subsystems/win32/csrss/win32csr/lang/sk-SK.rc @@ -1,5 +1,6 @@ /* TRANSLATOR: Mário Kaèmár /Mario Kacmar/ aka Kario (kario@szm.sk) * DATE OF TR: 29-05-2008 + * LastChange: 12-04-2011 */ LANGUAGE LANG_SLOVAK, SUBLANG_DEFAULT @@ -58,5 +59,5 @@ BEGIN IDS_SCROLLUP "Rolova nahor" IDS_SCROLLDOWN "Rolova nadol" - IDS_COMMAND_PROMPT "Command Prompt" + IDS_COMMAND_PROMPT "Príkazový riadok" END diff --git a/subsystems/win32/csrss/win32csr/rsrc.rc b/subsystems/win32/csrss/win32csr/rsrc.rc index 32fe83a6667..bf2ce4067a4 100644 --- a/subsystems/win32/csrss/win32csr/rsrc.rc +++ b/subsystems/win32/csrss/win32csr/rsrc.rc @@ -13,7 +13,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL #include "lang/fr-FR.rc" #include "lang/id-ID.rc" #include "lang/it-IT.rc" -//#include "lang/ja-JP.rc" FIXME: iconv issue +#include "lang/ja-JP.rc" #include "lang/no-NO.rc" #include "lang/pl-PL.rc" #include "lang/ru-RU.rc" diff --git a/subsystems/win32/win32k/CMakeLists.txt b/subsystems/win32/win32k/CMakeLists.txt index 6de96b591c3..da0d3cba119 100644 --- a/subsystems/win32/win32k/CMakeLists.txt +++ b/subsystems/win32/win32k/CMakeLists.txt @@ -143,6 +143,7 @@ list(APPEND SOURCE objects/gdibatch.c objects/gdidbg.c objects/gdiobj.c + objects/gdipool.c objects/icm.c objects/line.c objects/metafile.c @@ -194,8 +195,7 @@ target_link_libraries(win32k add_importlibs(win32k ntoskrnl hal ftfd) add_pch(win32k ${CMAKE_CURRENT_SOURCE_DIR}/pch.h ${SOURCE}) -add_dependencies(win32k gendib_generated subsystem_napi) -add_cab_target(win32k 1) +add_cd_file(TARGET win32k DESTINATION reactos/system32 FOR all) add_importlib_target(win32k.spec) add_library(win32ksys sys-stubs.S) diff --git a/subsystems/win32/win32k/eng/driverobj.c b/subsystems/win32/win32k/eng/driverobj.c index cb6ff389450..3cd1f6fd02a 100644 --- a/subsystems/win32/win32k/eng/driverobj.c +++ b/subsystems/win32/win32k/eng/driverobj.c @@ -102,8 +102,9 @@ EngDeleteDriverObj( /* NOTE: We don't care about the bLocked param, as our handle manager allows freeing the object, while we hold any number of locks. */ - /* Free the object */ - return DRIVEROBJ_FreeObjectByHandle(hdo); + /* Delete the object */ + GDIOBJ_vDeleteObject(&pedo->baseobj); + return TRUE; } @@ -139,10 +140,11 @@ EngUnlockDriverObj( } /* Unlock object */ - cLocks = DRIVEROBJ_UnlockObject(pedo); + cLocks = pedo->baseobj.cExclusiveLock; + DRIVEROBJ_UnlockObject(pedo); /* Check if we still hold a lock */ - if (cLocks < 1) + if (cLocks < 2) { /* Object wasn't locked before, fail. */ return FALSE; diff --git a/subsystems/win32/win32k/eng/engbrush.c b/subsystems/win32/win32k/eng/engbrush.c index c61e0e47f9f..c52d8481b3e 100644 --- a/subsystems/win32/win32k/eng/engbrush.c +++ b/subsystems/win32/win32k/eng/engbrush.c @@ -37,7 +37,7 @@ EBRUSHOBJ_vInit(EBRUSHOBJ *pebo, PBRUSH pbrush, PDC pdc) ASSERT(pebo->psurfTrg->ppal); pebo->ppalSurf = pebo->psurfTrg->ppal; - GDIOBJ_IncrementShareCount(&pebo->ppalSurf->BaseObject); + GDIOBJ_vReferenceObjectByPointer(&pebo->ppalSurf->BaseObject); if (pbrush->flAttrs & GDIBRUSH_IS_NULL) { diff --git a/subsystems/win32/win32k/eng/engwindow.c b/subsystems/win32/win32k/eng/engwindow.c index 74f9ec99bb2..19d76be7aa3 100644 --- a/subsystems/win32/win32k/eng/engwindow.c +++ b/subsystems/win32/win32k/eng/engwindow.c @@ -117,7 +117,7 @@ IntEngWndUpdateClipObj( { DPRINT1("Warning: Couldn't lock visible region of window DC\n"); } - REGION_FreeRgnByHandle(hVisRgn); + GreDeleteObject(hVisRgn); } else { diff --git a/subsystems/win32/win32k/eng/pdevobj.c b/subsystems/win32/win32k/eng/pdevobj.c index 1acb8a55ec8..9d1ee125a7a 100644 --- a/subsystems/win32/win32k/eng/pdevobj.c +++ b/subsystems/win32/win32k/eng/pdevobj.c @@ -143,7 +143,6 @@ PDEVOBJ_bEnablePDEV( ppdev->gdiinfo.ulLogPixelsY = 96; /* Setup Palette */ - GDIOBJ_SetOwnership(ppdev->devinfo.hpalDefault, NULL); ppdev->ppalSurf = PALETTE_ShareLockPalette(ppdev->devinfo.hpalDefault); DPRINT("PDEVOBJ_bEnablePDEV - dhpdev = %p\n", ppdev->dhpdev); @@ -171,7 +170,7 @@ PDEVOBJ_pSurface( if (ppdev->pSurface) { /* Increment reference count */ - GDIOBJ_IncrementShareCount(&ppdev->pSurface->BaseObject); + GDIOBJ_vReferenceObjectByPointer(&ppdev->pSurface->BaseObject); } else { diff --git a/subsystems/win32/win32k/eng/surface.c b/subsystems/win32/win32k/eng/surface.c index 8e9c62871fc..fb59ff525a1 100644 --- a/subsystems/win32/win32k/eng/surface.c +++ b/subsystems/win32/win32k/eng/surface.c @@ -151,7 +151,7 @@ SURFACE_AllocSurface( } /* Allocate a SURFACE object */ - psurf = (PSURFACE)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_BITMAP); + psurf = (PSURFACE)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_BITMAP, sizeof(SURFACE)); if (psurf) { @@ -166,7 +166,7 @@ SURFACE_AllocSurface( /* Assign a default palette and increment its reference count */ psurf->ppal = appalSurfaceDefault[iFormat]; - GDIOBJ_IncrementShareCount(&psurf->ppal->BaseObject); + GDIOBJ_vReferenceObjectByPointer(&psurf->ppal->BaseObject); } return psurf; @@ -285,12 +285,12 @@ EngCreateBitmap( { /* Bail out if that failed */ DPRINT1("SURFACE_bSetBitmapBits failed.\n"); - SURFACE_FreeSurfaceByHandle(hbmp); + GDIOBJ_vDeleteObject(&psurf->BaseObject); return NULL; } /* Set public ownership */ - GDIOBJ_SetOwnership(hbmp, NULL); + GDIOBJ_vSetObjectOwner(&psurf->BaseObject, GDI_OBJ_HMGR_PUBLIC); /* Unlock the surface and return */ SURFACE_UnlockSurface(psurf); @@ -324,7 +324,7 @@ EngCreateDeviceBitmap( hbmp = (HBITMAP)psurf->SurfObj.hsurf; /* Set public ownership */ - GDIOBJ_SetOwnership(hbmp, NULL); + GDIOBJ_vSetObjectOwner(&psurf->BaseObject, GDI_OBJ_HMGR_PUBLIC); /* Unlock the surface and return */ SURFACE_UnlockSurface(psurf); @@ -355,7 +355,7 @@ EngCreateDeviceSurface( hsurf = psurf->SurfObj.hsurf; /* Set public ownership */ - GDIOBJ_SetOwnership(hsurf, NULL); + GDIOBJ_vSetObjectOwner(&psurf->BaseObject, GDI_OBJ_HMGR_PUBLIC); /* Unlock the surface and return */ SURFACE_UnlockSurface(psurf); @@ -448,8 +448,16 @@ BOOL APIENTRY EngDeleteSurface(IN HSURF hsurf) { - GDIOBJ_SetOwnership(hsurf, PsGetCurrentProcess()); - SURFACE_FreeSurfaceByHandle(hsurf); + PSURFACE psurf; + + psurf = SURFACE_ShareLockSurface(hsurf); + if (!psurf) + { + DPRINT1("Could not reference surface to delete\n"); + return FALSE; + } + + GDIOBJ_vDeleteObject(&psurf->BaseObject); return TRUE; } diff --git a/subsystems/win32/win32k/include/brush.h b/subsystems/win32/win32k/include/brush.h index 8c9a7a8b21f..7d3a73f9791 100644 --- a/subsystems/win32/win32k/include/brush.h +++ b/subsystems/win32/win32k/include/brush.h @@ -89,14 +89,11 @@ typedef struct _EBRUSHOBJ #define GDIBRUSH_CACHED_IS_SOLID 0x80000000 #define BRUSH_AllocBrush() ((PBRUSH) GDIOBJ_AllocObj(GDIObjType_BRUSH_TYPE)) -#define BRUSH_AllocBrushWithHandle() ((PBRUSH) GDIOBJ_AllocObjWithHandle (GDI_OBJECT_TYPE_BRUSH)) +#define BRUSH_AllocBrushWithHandle() ((PBRUSH) GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_BRUSH, sizeof(BRUSH))) #define BRUSH_FreeBrush(pBrush) GDIOBJ_FreeObj((POBJ)pBrush, GDIObjType_BRUSH_TYPE) #define BRUSH_FreeBrushByHandle(hBrush) GDIOBJ_FreeObjByHandle((HGDIOBJ)hBrush, GDI_OBJECT_TYPE_BRUSH) -#define BRUSH_LockBrush(hBrush) ((PBRUSH)GDIOBJ_LockObj((HGDIOBJ)hBrush, GDI_OBJECT_TYPE_BRUSH)) -#define BRUSH_UnlockBrush(pBrush) GDIOBJ_UnlockObjByPtr((POBJ)pBrush) - #define BRUSH_ShareLockBrush(hBrush) ((PBRUSH)GDIOBJ_ShareLockObj((HGDIOBJ)hBrush, GDI_OBJECT_TYPE_BRUSH)) -#define BRUSH_ShareUnlockBrush(pBrush) GDIOBJ_ShareUnlockObjByPtr((POBJ)pBrush) +#define BRUSH_ShareUnlockBrush(pBrush) GDIOBJ_vDereferenceObject((POBJ)pBrush) INT FASTCALL BRUSH_GetObject (PBRUSH GdiObject, INT Count, LPLOGBRUSH Buffer); BOOL INTERNAL_CALL BRUSH_Cleanup(PVOID ObjectBody); diff --git a/subsystems/win32/win32k/include/color.h b/subsystems/win32/win32k/include/color.h index 233412e6ccd..0d90d526f70 100644 --- a/subsystems/win32/win32k/include/color.h +++ b/subsystems/win32/win32k/include/color.h @@ -18,11 +18,11 @@ typedef struct _COLORSPACE #define COLORSPACEOBJ_AllocCS() ((PCOLORSPACE) GDIOBJ_AllocObj(GDIObjType_ICMLCS_TYPE)) -#define COLORSPACEOBJ_AllocCSWithHandle() ((PCOLORSPACE) GDIOBJ_AllocObjWithHandle (GDI_OBJECT_TYPE_COLORSPACE)) +#define COLORSPACEOBJ_AllocCSWithHandle() ((PCOLORSPACE) GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_COLORSPACE, sizeof(COLORSPACE))) #define COLORSPACEOBJ_FreeCS(pCS) GDIOBJ_FreeObj((POBJ)pCS, GDIObjType_ICMLCS_TYPE) #define COLORSPACEOBJ_FreeCSByHandle(hCS) GDIOBJ_FreeObjByHandle((HGDIOBJ)hCS, GDI_OBJECT_TYPE_COLORSPACE) -#define COLORSPACEOBJ_LockCS(hCS) ((PCOLORSPACE)GDIOBJ_LockObj((HGDIOBJ)hCS, GDI_OBJECT_TYPE_COLORSPACE)) -#define COLORSPACEOBJ_UnlockCS(pCS) GDIOBJ_UnlockObjByPtr((POBJ)pCS) +#define COLORSPACEOBJ_LockCS(hCS) ((PCOLORSPACE)GDIOBJ_LockObject((HGDIOBJ)hCS, GDIObjType_ICMLCS_TYPE)) +#define COLORSPACEOBJ_UnlockCS(pCS) GDIOBJ_vUnlockObject((POBJ)pCS) typedef struct _COLORTRANSFORMOBJ { diff --git a/subsystems/win32/win32k/include/dc.h b/subsystems/win32/win32k/include/dc.h index caf112b827e..a3c685e0dbb 100644 --- a/subsystems/win32/win32k/include/dc.h +++ b/subsystems/win32/win32k/include/dc.h @@ -149,18 +149,13 @@ typedef struct _DC /* Internal functions *********************************************************/ -#define DC_LockDc(hDC) \ - ((PDC) GDIOBJ_LockObj ((HGDIOBJ) hDC, GDI_OBJECT_TYPE_DC)) -#define DC_UnlockDc(pDC) \ - GDIOBJ_UnlockObjByPtr ((POBJ)pDC) - extern PDC defaultDCstate; INIT_FUNCTION NTSTATUS NTAPI InitDcImpl(VOID); PPDEVOBJ FASTCALL IntEnumHDev(VOID); PDC NTAPI DC_AllocDcWithHandle(VOID); VOID FASTCALL DC_InitDC(HDC DCToInit); -VOID FASTCALL DC_AllocateDcAttr(HDC); +BOOL NTAPI DC_bAllocDcAttr(PDC pdc); VOID FASTCALL DC_FreeDcAttr(HDC); BOOL INTERNAL_CALL DC_Cleanup(PVOID ObjectBody); BOOL FASTCALL DC_SetOwnership(HDC hDC, PEPROCESS Owner); @@ -203,6 +198,22 @@ BOOL FASTCALL IntGdiCleanDC(HDC hDC); VOID FASTCALL IntvGetDeviceCaps(PPDEVOBJ, PDEVCAPS); BOOL FASTCALL MakeInfoDC(PDC,BOOL); BOOL FASTCALL IntSetDefaultRegion(PDC); +BOOL NTAPI GreSetDCOwner(HDC hdc, ULONG ulOwner); + +FORCEINLINE +PDC +DC_LockDc(HDC hdc) +{ + //if (GDI_HANDLE_GET_TYPE(hdc) != GDILoObjType_LO_DC_TYPE) return NULL; ??? + return GDIOBJ_LockObject(hdc, GDIObjType_DC_TYPE); +} + +FORCEINLINE +VOID +DC_UnlockDc(PDC pdc) +{ + GDIOBJ_vUnlockObject(&pdc->BaseObject); +} VOID FORCEINLINE @@ -215,7 +226,7 @@ DC_vSelectSurface(PDC pdc, PSURFACE psurfNew) SURFACE_ShareUnlockSurface(psurfOld); } if (psurfNew) - GDIOBJ_IncrementShareCount((POBJ)psurfNew); + GDIOBJ_vReferenceObjectByPointer((POBJ)psurfNew); pdc->dclevel.pSurface = psurfNew; } @@ -227,7 +238,7 @@ DC_vSelectFillBrush(PDC pdc, PBRUSH pbrFill) if (pbrFillOld) BRUSH_ShareUnlockBrush(pbrFillOld); if (pbrFill) - GDIOBJ_IncrementShareCount((POBJ)pbrFill); + GDIOBJ_vReferenceObjectByPointer((POBJ)pbrFill); pdc->dclevel.pbrFill = pbrFill; } @@ -239,7 +250,7 @@ DC_vSelectLineBrush(PDC pdc, PBRUSH pbrLine) if (pbrLineOld) BRUSH_ShareUnlockBrush(pbrLineOld); if (pbrLine) - GDIOBJ_IncrementShareCount((POBJ)pbrLine); + GDIOBJ_vReferenceObjectByPointer((POBJ)pbrLine); pdc->dclevel.pbrLine = pbrLine; } @@ -251,7 +262,7 @@ DC_vSelectPalette(PDC pdc, PPALETTE ppal) if (ppalOld) PALETTE_ShareUnlockPalette(ppalOld); if (ppal) - GDIOBJ_IncrementShareCount((POBJ)ppal); + GDIOBJ_vReferenceObjectByPointer((POBJ)ppal); pdc->dclevel.ppal = ppal; } diff --git a/subsystems/win32/win32k/include/dib.h b/subsystems/win32/win32k/include/dib.h index 9d5b2b18462..42c4650f609 100644 --- a/subsystems/win32/win32k/include/dib.h +++ b/subsystems/win32/win32k/include/dib.h @@ -18,4 +18,4 @@ HPALETTE FASTCALL BuildDIBPalette (CONST BITMAPINFO *bmi); BITMAPINFO* FASTCALL DIB_ConvertBitmapInfo(CONST BITMAPINFO* bmi, DWORD Usage); -VOID FASTCALL DIB_FreeConvertedBitmapInfo(BITMAPINFO* converted, BITMAPINFO* orig); \ No newline at end of file +VOID FASTCALL DIB_FreeConvertedBitmapInfo(BITMAPINFO* converted, BITMAPINFO* orig); diff --git a/subsystems/win32/win32k/include/driverobj.h b/subsystems/win32/win32k/include/driverobj.h index 4056083528d..d40f662b70c 100644 --- a/subsystems/win32/win32k/include/driverobj.h +++ b/subsystems/win32/win32k/include/driverobj.h @@ -14,7 +14,13 @@ typedef struct _EDRIVEROBJ BOOL INTERNAL_CALL DRIVEROBJ_Cleanup(PVOID pObject); -#define DRIVEROBJ_AllocObjectWithHandle() ((PEDRIVEROBJ)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_DRIVEROBJ)) +#define DRIVEROBJ_AllocObjectWithHandle() ((PEDRIVEROBJ)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_DRIVEROBJ, sizeof(DRIVEROBJ))) #define DRIVEROBJ_FreeObjectByHandle(hdo) GDIOBJ_FreeObjByHandle((HGDIOBJ)hdo, GDI_OBJECT_TYPE_DRIVEROBJ) -#define DRIVEROBJ_LockObject(hdo) ((PEDRIVEROBJ)GDIOBJ_LockObj((HGDIOBJ)hdo, GDI_OBJECT_TYPE_DRIVEROBJ)) -#define DRIVEROBJ_UnlockObject(pdo) GDIOBJ_UnlockObjByPtr((POBJ)pdo) +#define DRIVEROBJ_UnlockObject(pdo) GDIOBJ_vUnlockObject((POBJ)pdo) + +FORCEINLINE +PEDRIVEROBJ +DRIVEROBJ_LockObject(HDRVOBJ hdo) +{ + return GDIOBJ_LockObject(hdo, GDIObjType_DRVOBJ_TYPE); +} diff --git a/subsystems/win32/win32k/include/gdidebug.h b/subsystems/win32/win32k/include/gdidebug.h index ffea26dcdc9..0f5221cc89f 100644 --- a/subsystems/win32/win32k/include/gdidebug.h +++ b/subsystems/win32/win32k/include/gdidebug.h @@ -1,12 +1,51 @@ #pragma once -extern ULONG gulDebugChannels; +typedef enum _LOG_EVENT_TYPE +{ + EVENT_ALLOCATE, + EVENT_CREATE_HANDLE, + EVENT_REFERENCE, + EVENT_DEREFERENCE, + EVENT_LOCK, + EVENT_UNLOCK, + EVENT_DELETE, + EVENT_FREE, + EVENT_SET_OWNER, +} LOG_EVENT_TYPE; -#define GDI_STACK_LEVELS 20 -extern ULONG_PTR GDIHandleAllocator[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; -extern ULONG_PTR GDIHandleLocker[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; -extern ULONG_PTR GDIHandleShareLocker[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; -extern ULONG_PTR GDIHandleDeleter[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; +typedef struct _LOGENTRY +{ + SLIST_ENTRY sleLink; + LOG_EVENT_TYPE nEventType; + DWORD dwProcessId; + DWORD dwThreadId; + ULONG ulUnique; + LPARAM lParam; + PVOID apvBackTrace[20]; + union + { + ULONG_PTR data1; + } data; +} LOGENTRY, *PLOGENTRY; + +#if DBG_ENABLE_EVENT_LOGGING +VOID NTAPI DbgDumpEventList(PSLIST_HEADER pslh); +VOID NTAPI DbgLogEvent(PSLIST_HEADER pslh, EVENT_TYPE nEventType, LPARAM lParam); +VOID NTAPI DbgCleanupEventList(PSLIST_HEADER pslh); +#define DBG_LOGEVENT(pslh, type, val) DbgLogEvent(pslh, type, (ULONG_PTR)val) +#define DBG_INITLOG(pslh) InitializeSListHead(pslh) +#define DBG_DUMP_EVENT_LIST(pslh) DbgDumpEventList(pslh) +#define DBG_CLEANUP_EVENT_LIST(pslh) DbgCleanupEventList(pslh) +#else +#define DBG_LOGEVENT(pslh, type, val) +#define DBG_INITLOG(pslh) +#define DBG_DUMP_EVENT_LIST(pslh) +#define DBG_CLEANUP_EVENT_LIST(pslh) +#endif + +extern ULONG gulLogUnique; + +extern ULONG gulDebugChannels; enum _DEBUGCHANNELS { @@ -17,73 +56,18 @@ enum _DEBUGCHANNELS DbgModeSwitch = 16, }; -void IntDumpHandleTable(PGDI_HANDLE_TABLE HandleTable); -ULONG CaptureStackBackTace(PVOID* pFrames, ULONG nFramesToCapture); -BOOL GdiDbgHTIntegrityCheck(VOID); -void GdiDbgDumpLockedHandles(VOID); +VOID NTAPI DbgDumpGdiHandleTable(VOID); +ULONG NTAPI DbgCaptureStackBackTace(PVOID* pFrames, ULONG nFramesToCapture); +BOOL NTAPI DbgGdiHTIntegrityCheck(VOID); +VOID NTAPI DbgDumpLockedGdiHandles(VOID); #define DBGENABLE(ch) gulDebugChannels |= (ch); #define DBGDISABLE(ch) gulDebugChannels &= ~(ch); #define DPRINTCH(ch) if (gulDebugChannels & (ch)) DbgPrint -#ifdef GDI_DEBUG - #define KeRosDumpStackFrames(Frames, Count) KdSystemDebugControl('DsoR', (PVOID)Frames, Count, NULL, 0, NULL, KernelMode) NTSYSAPI ULONG APIENTRY RtlWalkFrameChain(OUT PVOID *Callers, IN ULONG Count, IN ULONG Flags); -#define IS_HANDLE_VALID(idx) \ - ((GdiHandleTable->Entries[idx].Type & GDI_ENTRY_BASETYPE_MASK) != 0) - -#define GDIDBG_TRACECALLER() \ - DPRINT1("-> called from:\n"); \ - KeRosDumpStackFrames(NULL, 20); -#define GDIDBG_TRACEALLOCATOR(handle) \ - DPRINT1("-> allocated from:\n"); \ - KeRosDumpStackFrames(GDIHandleAllocator[GDI_HANDLE_GET_INDEX(handle)], GDI_STACK_LEVELS); -#define GDIDBG_TRACELOCKER(handle) \ - DPRINT1("-> locked from:\n"); \ - KeRosDumpStackFrames(GDIHandleLocker[GDI_HANDLE_GET_INDEX(handle)], GDI_STACK_LEVELS); -#define GDIDBG_TRACESHARELOCKER(handle) \ - DPRINT1("-> locked from:\n"); \ - KeRosDumpStackFrames(GDIHandleShareLocker[GDI_HANDLE_GET_INDEX(handle)], GDI_STACK_LEVELS); -#define GDIDBG_TRACEDELETER(handle) \ - DPRINT1("-> deleted from:\n"); \ - KeRosDumpStackFrames(GDIHandleDeleter[GDI_HANDLE_GET_INDEX(handle)], GDI_STACK_LEVELS); -#define GDIDBG_CAPTUREALLOCATOR(handle) \ - CaptureStackBackTace((PVOID*)GDIHandleAllocator[GDI_HANDLE_GET_INDEX(handle)], GDI_STACK_LEVELS); -#define GDIDBG_CAPTURELOCKER(handle) \ - CaptureStackBackTace((PVOID*)GDIHandleLocker[GDI_HANDLE_GET_INDEX(handle)], GDI_STACK_LEVELS); -#define GDIDBG_CAPTURESHARELOCKER(handle) \ - CaptureStackBackTace((PVOID*)GDIHandleShareLocker[GDI_HANDLE_GET_INDEX(handle)], GDI_STACK_LEVELS); -#define GDIDBG_CAPTUREDELETER(handle) \ - CaptureStackBackTace((PVOID*)GDIHandleDeleter[GDI_HANDLE_GET_INDEX(handle)], GDI_STACK_LEVELS); -#define GDIDBG_DUMPHANDLETABLE() \ - IntDumpHandleTable(GdiHandleTable) -#define GDIDBG_INITLOOPTRACE() \ - ULONG Attempts = 0; -#define GDIDBG_TRACELOOP(Handle, PrevThread, Thread) \ - if ((++Attempts % 20) == 0) \ - { \ - DPRINT1("[%d] Handle 0x%p Locked by 0x%x (we're 0x%x)\n", Attempts, Handle, PrevThread, Thread); \ - } - -#else - -#define GDIDBG_TRACECALLER() -#define GDIDBG_TRACEALLOCATOR(index) -#define GDIDBG_TRACELOCKER(index) -#define GDIDBG_TRACESHARELOCKER(index) -#define GDIDBG_CAPTUREALLOCATOR(index) -#define GDIDBG_CAPTURELOCKER(index) -#define GDIDBG_CAPTURESHARELOCKER(index) -#define GDIDBG_CAPTUREDELETER(handle) -#define GDIDBG_DUMPHANDLETABLE() -#define GDIDBG_INITLOOPTRACE() -#define GDIDBG_TRACELOOP(Handle, PrevThread, Thread) -#define GDIDBG_TRACEDELETER(handle) - -#endif /* GDI_DEBUG */ - #if DBG void NTAPI @@ -104,7 +88,6 @@ GdiDbgAssertNoLocks(char * pszFile, ULONG nLine) { DbgPrint("(%s:%ld) There are %ld exclusive locks!\n", pszFile, nLine, pti->cExclusiveLocks); - GdiDbgDumpLockedHandles(); ASSERT(FALSE); } } diff --git a/subsystems/win32/win32k/include/gdiobj.h b/subsystems/win32/win32k/include/gdiobj.h index 032acc2c523..de1e89b1959 100644 --- a/subsystems/win32/win32k/include/gdiobj.h +++ b/subsystems/win32/win32k/include/gdiobj.h @@ -9,7 +9,7 @@ #include #include "win32.h" -/* apparently the first 10 entries are never used in windows as they are empty */ +/* The first 10 entries are never used in windows, they are empty */ #define RESERVE_ENTRIES_COUNT 10 typedef struct _GDI_HANDLE_TABLE @@ -24,11 +24,7 @@ typedef struct _GDI_HANDLE_TABLE PVOID pvLangPack; // Language Pack. CFONT cfPublic[GDI_CFONT_MAX]; // Public Fonts. DWORD dwCFCount; -////////////////////////////////////////////////////////////////////////////// - PPAGED_LOOKASIDE_LIST LookasideLists; - ULONG FirstFree; - ULONG FirstUnused; } GDI_HANDLE_TABLE, *PGDI_HANDLE_TABLE; @@ -42,19 +38,19 @@ typedef BOOL (INTERNAL_CALL *GDICLEANUPPROC)(PVOID ObjectBody); * It's for thread locking. */ typedef struct _BASEOBJECT { - HGDIOBJ hHmgr; - ULONG ulShareCount; - USHORT cExclusiveLock; - USHORT BaseFlags; - PTHREADINFO Tid; - EX_PUSH_LOCK pushlock; + HGDIOBJ hHmgr; + union { + ULONG ulShareCount; /* For objects without a handle */ + DWORD dwThreadId; /* Exclusive lock owner */ + }; + USHORT cExclusiveLock; + USHORT BaseFlags; + EX_PUSH_LOCK pushlock; +#if DBG_ENABLE_EVENT_LOGGING + SLIST_HEADER slhLog; +#endif } BASEOBJECT, *POBJ; -typedef struct _CLIENTOBJ -{ - BASEOBJECT BaseObject; -} CLIENTOBJ, *PCLIENTOBJ; - enum BASEFLAGS { BASEFLAG_LOOKASIDE = 0x80, @@ -63,103 +59,125 @@ enum BASEFLAGS BASEFLAG_READY_TO_DIE = 0x1000 }; -BOOL INTERNAL_CALL GDIOBJ_OwnedByCurrentProcess(HGDIOBJ ObjectHandle); -BOOL INTERNAL_CALL GDIOBJ_SetOwnership(HGDIOBJ ObjectHandle, PEPROCESS Owner); -BOOL INTERNAL_CALL GDIOBJ_CopyOwnership(HGDIOBJ CopyFrom, HGDIOBJ CopyTo); -BOOL INTERNAL_CALL GDIOBJ_ConvertToStockObj(HGDIOBJ *hObj); -//VOID INTERNAL_CALL GDIOBJ_ShareUnlockObjByPtr(POBJ Object); -BOOL INTERNAL_CALL GDIOBJ_ValidateHandle(HGDIOBJ hObj, ULONG ObjectType); -POBJ INTERNAL_CALL GDIOBJ_AllocObj(UCHAR ObjectType); -POBJ INTERNAL_CALL GDIOBJ_AllocObjWithHandle(ULONG ObjectType); -VOID INTERNAL_CALL GDIOBJ_FreeObj (POBJ pObj, UCHAR ObjectType); -BOOL INTERNAL_CALL GDIOBJ_FreeObjByHandle (HGDIOBJ hObj, DWORD ObjectType); -PGDIOBJ INTERNAL_CALL GDIOBJ_LockObj (HGDIOBJ hObj, DWORD ObjectType); -PGDIOBJ INTERNAL_CALL GDIOBJ_ShareLockObj (HGDIOBJ hObj, DWORD ObjectType); -VOID INTERNAL_CALL GDIOBJ_LockMultipleObjs(ULONG ulCount, IN HGDIOBJ* ahObj, OUT PGDIOBJ* apObj); +typedef struct _CLIENTOBJ +{ + BASEOBJECT BaseObject; +} CLIENTOBJ, *PCLIENTOBJ; -PVOID INTERNAL_CALL GDI_MapHandleTable(PEPROCESS Process); +#define GDIOBJFLAG_DEFAULT (0x0) +#define GDIOBJFLAG_IGNOREPID (0x1) +#define GDIOBJFLAG_IGNORELOCK (0x2) INIT_FUNCTION NTSTATUS NTAPI InitGdiHandleTable(VOID); -#define GDIOBJ_GetObjectType(Handle) \ - GDI_HANDLE_GET_TYPE(Handle) +BOOL +NTAPI +GreIsHandleValid( + HGDIOBJ hobj); -#define GDIOBJFLAG_DEFAULT (0x0) -#define GDIOBJFLAG_IGNOREPID (0x1) -#define GDIOBJFLAG_IGNORELOCK (0x2) - -BOOL FASTCALL GreDeleteObject(HGDIOBJ hObject); -BOOL FASTCALL IsObjectDead(HGDIOBJ); -BOOL FASTCALL IntGdiSetDCOwnerEx( HDC, DWORD, BOOL); -BOOL FASTCALL IntGdiSetRegionOwner(HRGN,DWORD); - -/*! - * Release GDI object. Every object locked by GDIOBJ_LockObj() must be unlocked. - * You should unlock the object - * as soon as you don't need to have access to it's data. - - * \param Object Object pointer (as returned by GDIOBJ_LockObj). - */ -ULONG -FORCEINLINE -GDIOBJ_UnlockObjByPtr(POBJ Object) -{ -#if DBG - PTHREADINFO pti = (PTHREADINFO)PsGetCurrentThreadWin32Thread(); - if (pti) - { - if (pti->cExclusiveLocks < 1) - { - DbgPrint("cExclusiveLocks = %ld, object: %ld\n", - pti->cExclusiveLocks, Object->cExclusiveLock); - ASSERT(FALSE); - } - pti->cExclusiveLocks--; - } -#endif - INT cLocks = InterlockedDecrement((PLONG)&Object->cExclusiveLock); - ASSERT(cLocks >= 0); - return cLocks; -} +BOOL +NTAPI +GreDeleteObject( + HGDIOBJ hObject); ULONG -FORCEINLINE -GDIOBJ_ShareUnlockObjByPtr(POBJ Object) -{ - HGDIOBJ hobj = Object->hHmgr; - USHORT flags = Object->BaseFlags; - INT cLocks = InterlockedDecrement((PLONG)&Object->ulShareCount); - ASSERT(cLocks >= 0); - if ((flags & BASEFLAG_READY_TO_DIE) && (cLocks == 0)) - { - ASSERT(Object->cExclusiveLock == 0); - GDIOBJ_SetOwnership(hobj, PsGetCurrentProcess()); - GDIOBJ_FreeObjByHandle(hobj, GDI_OBJECT_TYPE_DONTCARE); - } - return cLocks; -} +NTAPI +GreGetObjectOwner( + HGDIOBJ hobj); -#ifdef GDI_DEBUG -ULONG FASTCALL GDIOBJ_IncrementShareCount(POBJ Object); -#else -ULONG -FORCEINLINE -GDIOBJ_IncrementShareCount(POBJ Object) -{ - INT cLocks = InterlockedIncrement((PLONG)&Object->ulShareCount); - ASSERT(cLocks >= 1); - return cLocks; -} -#endif +BOOL +NTAPI +GreSetObjectOwner( + HGDIOBJ hobj, + ULONG ulOwner); -INT FASTCALL GreGetObjectOwner(HGDIOBJ, GDIOBJTYPE); +INT +NTAPI +GreGetObject( + IN HGDIOBJ hobj, + IN INT cbCount, + IN PVOID pvBuffer); + +POBJ +NTAPI +GDIOBJ_AllocateObject( + UCHAR objt, + ULONG cjSize, + FLONG fl); + +VOID +NTAPI +GDIOBJ_vDeleteObject( + POBJ pobj); + +POBJ +NTAPI +GDIOBJ_ReferenceObjectByHandle( + HGDIOBJ hobj, + UCHAR objt); + +VOID +NTAPI +GDIOBJ_vReferenceObjectByPointer( + POBJ pobj); + +VOID +NTAPI +GDIOBJ_vDereferenceObject( + POBJ pobj); + +PGDIOBJ +NTAPI +GDIOBJ_LockObject( + HGDIOBJ hobj, + UCHAR objt); + +VOID +NTAPI +GDIOBJ_vUnlockObject( + POBJ pobj); + +VOID +NTAPI +GDIOBJ_vSetObjectOwner( + POBJ pobj, + ULONG ulOwner); + +BOOL +NTAPI +GDIOBJ_bLockMultipleObjects( + ULONG ulCount, + HGDIOBJ* ahObj, + PGDIOBJ* apObj, + UCHAR objt); + +HGDIOBJ +NTAPI +GDIOBJ_hInsertObject( + POBJ pobj, + ULONG ulOwner); + +VOID +NTAPI +GDIOBJ_vFreeObject( + POBJ pobj); + +VOID +NTAPI +GDIOBJ_vSetObjectAttr( + POBJ pobj, + PVOID pvObjAttr); + +PVOID +NTAPI +GDIOBJ_pvGetObjectAttr( + POBJ pobj); + +BOOL INTERNAL_CALL GDIOBJ_ConvertToStockObj(HGDIOBJ *hObj); +POBJ INTERNAL_CALL GDIOBJ_AllocObjWithHandle(ULONG ObjectType, ULONG cjSize); +PGDIOBJ INTERNAL_CALL GDIOBJ_ShareLockObj(HGDIOBJ hObj, DWORD ObjectType); +PVOID INTERNAL_CALL GDI_MapHandleTable(PEPROCESS Process); -#define GDIOBJ_GetKernelObj(Handle) \ - ((PGDI_TABLE_ENTRY)&GdiHandleTable->Entries[GDI_HANDLE_GET_INDEX(Handle)])->KernelData -#define GDI_ENTRY_TO_INDEX(ht, e) \ - (((ULONG_PTR)(e) - (ULONG_PTR)&((ht)->Entries[0])) / sizeof(GDI_TABLE_ENTRY)) -#define GDI_HANDLE_GET_ENTRY(HandleTable, h) \ - (&(HandleTable)->Entries[GDI_HANDLE_GET_INDEX((h))]) diff --git a/subsystems/win32/win32k/include/hotkey.h b/subsystems/win32/win32k/include/hotkey.h index 74f19a2b2a7..b8bbee9eb78 100644 --- a/subsystems/win32/win32k/include/hotkey.h +++ b/subsystems/win32/win32k/include/hotkey.h @@ -13,6 +13,8 @@ typedef struct _HOT_KEY_ITEM UINT vk; } HOT_KEY_ITEM, *PHOT_KEY_ITEM; +#define IDHOT_REACTOS (-9) + INIT_FUNCTION NTSTATUS NTAPI @@ -33,5 +35,9 @@ UnregisterWindowHotKeys(PWND Window); VOID FASTCALL UnregisterThreadHotKeys(struct _ETHREAD *Thread); +UINT FASTCALL +DefWndGetHotKey(HWND hwnd); +INT FASTCALL +DefWndSetHotKey( PWND pWnd, WPARAM wParam); /* EOF */ diff --git a/subsystems/win32/win32k/include/misc.h b/subsystems/win32/win32k/include/misc.h index 26a35d4925a..0a905b9b2c0 100644 --- a/subsystems/win32/win32k/include/misc.h +++ b/subsystems/win32/win32k/include/misc.h @@ -77,3 +77,63 @@ RegWriteUserSetting( VOID FASTCALL SetLastNtError( NTSTATUS Status); + +typedef struct _GDI_POOL *PGDI_POOL; + +PGDI_POOL +NTAPI +GdiPoolCreate( + ULONG cjAllocSize, + ULONG ulTag); + +VOID +NTAPI +GdiPoolDestroy(PGDI_POOL pPool); + +PVOID +NTAPI +GdiPoolAllocate( + PGDI_POOL pPool); + +VOID +NTAPI +GdiPoolFree( + PGDI_POOL pPool, + PVOID pvAlloc); + +FORCEINLINE +VOID +ExAcquirePushLockExclusive(PEX_PUSH_LOCK PushLock) +{ + /* Try acquiring the lock */ + if (InterlockedBitTestAndSet((PLONG)PushLock, EX_PUSH_LOCK_LOCK_V)) + { + /* Someone changed it, use the slow path */ + ExfAcquirePushLockExclusive(PushLock); + } +} + +FORCEINLINE +VOID +ExReleasePushLockExclusive(PEX_PUSH_LOCK PushLock) +{ + EX_PUSH_LOCK OldValue; + + /* Unlock the pushlock */ + OldValue.Value = InterlockedExchangeAddSizeT((PSIZE_T)PushLock, + -(SSIZE_T)EX_PUSH_LOCK_LOCK); + /* Check if anyone is waiting on it and it's not already waking */ + if ((OldValue.Waiting) && !(OldValue.Waking)) + { + /* Wake it up */ + ExfTryToWakePushLock(PushLock); + } +} + +FORCEINLINE +VOID +_ExInitializePushLock(PEX_PUSH_LOCK Lock) +{ + *(PULONG_PTR)Lock = 0; +} +#define ExInitializePushLock _ExInitializePushLock diff --git a/subsystems/win32/win32k/include/palette.h b/subsystems/win32/win32k/include/palette.h index 10d6dffbae6..faea86c18f4 100644 --- a/subsystems/win32/win32k/include/palette.h +++ b/subsystems/win32/win32k/include/palette.h @@ -65,13 +65,12 @@ HPALETTE FASTCALL PALETTE_AllocPaletteIndexedRGB(ULONG NumColors, CONST RGBQUAD *Colors); #define PALETTE_FreePalette(pPalette) GDIOBJ_FreeObj((POBJ)pPalette, GDIObjType_PAL_TYPE) #define PALETTE_FreePaletteByHandle(hPalette) GDIOBJ_FreeObjByHandle((HGDIOBJ)hPalette, GDI_OBJECT_TYPE_PALETTE) -#define PALETTE_LockPalette(hPalette) ((PPALETTE)GDIOBJ_LockObj((HGDIOBJ)hPalette, GDI_OBJECT_TYPE_PALETTE)) -#define PALETTE_UnlockPalette(pPalette) GDIOBJ_UnlockObjByPtr((POBJ)pPalette) +#define PALETTE_UnlockPalette(pPalette) GDIOBJ_vUnlockObject((POBJ)pPalette) #define PALETTE_ShareLockPalette(hpal) \ ((PPALETTE)GDIOBJ_ShareLockObj((HGDIOBJ)hpal, GDI_OBJECT_TYPE_PALETTE)) #define PALETTE_ShareUnlockPalette(ppal) \ - GDIOBJ_ShareUnlockObjByPtr(&ppal->BaseObject) + GDIOBJ_vDereferenceObject(&ppal->BaseObject) BOOL INTERNAL_CALL PALETTE_Cleanup(PVOID ObjectBody); INIT_FUNCTION NTSTATUS NTAPI InitPaletteImpl(VOID); diff --git a/subsystems/win32/win32k/include/path.h b/subsystems/win32/win32k/include/path.h index b8c17786fa9..451a5a27536 100644 --- a/subsystems/win32/win32k/include/path.h +++ b/subsystems/win32/win32k/include/path.h @@ -19,7 +19,7 @@ typedef enum tagGdiPathState typedef struct _PATH { BASEOBJECT BaseObject; - + RECTFX rcfxBoundBox; POINTFX ptfxSubPathStart; @@ -39,11 +39,11 @@ typedef struct _EPATHOBJ } EPATHOBJ, *PEPATHOBJ; #define PATH_AllocPath() ((PPATH) GDIOBJ_AllocObj(GDIObjType_PATH_TYPE)) -#define PATH_AllocPathWithHandle() ((PPATH) GDIOBJ_AllocObjWithHandle (GDI_OBJECT_TYPE_PATH)) +#define PATH_AllocPathWithHandle() ((PPATH) GDIOBJ_AllocObjWithHandle (GDI_OBJECT_TYPE_PATH, sizeof(PATH))) #define PATH_FreePath(pPath) GDIOBJ_FreeObj((POBJ)pPath, GDIObjType_PATH_TYPE) #define PATH_FreeExtPathByHandle(hPath) GDIOBJ_FreeObjByHandle((HGDIOBJ) hPath, GDI_OBJECT_TYPE_PATH) #define PATH_LockPath(hPath) ((PPATH)GDIOBJ_ShareLockObj((HGDIOBJ)hPath, GDI_OBJECT_TYPE_PATH)) -#define PATH_UnlockPath(pPath) GDIOBJ_ShareUnlockObjByPtr((POBJ)pPath) +#define PATH_UnlockPath(pPath) GDIOBJ_vDereferenceObject((POBJ)pPath) #define PATH_IsPathOpen(dclevel) ( ((dclevel).hPath) && ((dclevel).flPath & DCPATH_ACTIVE) ) diff --git a/subsystems/win32/win32k/include/pen.h b/subsystems/win32/win32k/include/pen.h index 7ca623dab54..29f07425e3a 100644 --- a/subsystems/win32/win32k/include/pen.h +++ b/subsystems/win32/win32k/include/pen.h @@ -6,27 +6,23 @@ /* Internal interface */ #define PEN_AllocPen() ((HPEN)GDIOBJ_AllocObj(GDIObjType_BRUSH_TYPE)) -#define PEN_AllocPenWithHandle() ((PBRUSH)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_PEN)) +#define PEN_AllocPenWithHandle() ((PBRUSH)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_PEN, sizeof(BRUSH))) #define PEN_FreePen(pBMObj) GDIOBJ_FreeObj((POBJ) pBMObj, GDIObjType_BRUSH_TYPE) #define PEN_FreePenByHandle(hBMObj) GDIOBJ_FreeObjByHandle((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_PEN) -//#define PEN_LockPen(hBMObj) ((PBRUSH)GDIOBJ_LockObj((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_PEN)) - #define PEN_AllocExtPen() ((PBRUSH)GDIOBJ_AllocObj(GDIObjType_BRUSH_TYPE)) -#define PEN_AllocExtPenWithHandle() ((PBRUSH)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_EXTPEN)) +#define PEN_AllocExtPenWithHandle() ((PBRUSH)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_EXTPEN, sizeof(BRUSH))) #define PEN_FreeExtPen(pBMObj) GDIOBJ_FreeObj((POBJ) pBMObj, GDIObjType_BRUSH_TYPE) #define PEN_FreeExtPenByHandle(hBMObj) GDIOBJ_FreeObjByHandle((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_EXTPEN) //#define PEN_LockExtPen(hBMObj) ((PBRUSH)GDIOBJ_LockObj((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_EXTPEN)) -#define PEN_UnlockPen(pPenObj) GDIOBJ_UnlockObjByPtr((POBJ)pPenObj) +#define PEN_UnlockPen(pPenObj) GDIOBJ_vUnlockObject((POBJ)pPenObj) -#define PEN_ShareUnlockPen(ppen) GDIOBJ_ShareUnlockObjByPtr((POBJ)ppen) +#define PEN_ShareUnlockPen(ppen) GDIOBJ_vDereferenceObject((POBJ)ppen) - -PBRUSH FASTCALL PEN_LockPen(HGDIOBJ); PBRUSH FASTCALL PEN_ShareLockPen(HGDIOBJ); INT APIENTRY PEN_GetObject(PBRUSH pPen, INT Count, PLOGPEN Buffer); diff --git a/subsystems/win32/win32k/include/region.h b/subsystems/win32/win32k/include/region.h index a7e531dff8b..91b3d5d935b 100644 --- a/subsystems/win32/win32k/include/region.h +++ b/subsystems/win32/win32k/include/region.h @@ -11,6 +11,8 @@ typedef struct _ROSRGNDATA /* Header for all gdi objects in the handle table. Do not (re)move this. */ BASEOBJECT BaseObject; + PRGN_ATTR prgnattr; + RGN_ATTR rgnattr; RGNDATAHEADER rdh; RECTL *Buffer; @@ -21,8 +23,6 @@ typedef struct _ROSRGNDATA #define REGION_FreeRgn(pRgn) GDIOBJ_FreeObj((POBJ)pRgn, GDIObjType_RGN_TYPE) #define REGION_FreeRgnByHandle(hRgn) GDIOBJ_FreeObjByHandle((HGDIOBJ)hRgn, GDI_OBJECT_TYPE_REGION) -#define REGION_LockRgn(hRgn) ((PROSRGNDATA)GDIOBJ_LockObj((HGDIOBJ)hRgn, GDI_OBJECT_TYPE_REGION)) -#define REGION_UnlockRgn(pRgn) GDIOBJ_UnlockObjByPtr((POBJ)pRgn) PROSRGNDATA FASTCALL REGION_AllocRgnWithHandle(INT n); PROSRGNDATA FASTCALL REGION_AllocUserRgnWithHandle(INT n); @@ -52,9 +52,28 @@ PROSRGNDATA FASTCALL RGNOBJAPI_Lock(HRGN,PRGN_ATTR *); VOID FASTCALL RGNOBJAPI_Unlock(PROSRGNDATA); HRGN FASTCALL IntSysCreateRectRgn(INT,INT,INT,INT); PROSRGNDATA FASTCALL IntSysCreateRectpRgn(INT,INT,INT,INT); +BOOL FASTCALL IntGdiSetRegionOwner(HRGN,DWORD); #define IntSysCreateRectRgnIndirect(prc) \ IntSysCreateRectRgn((prc)->left, (prc)->top, (prc)->right, (prc)->bottom) #define IntSysCreateRectpRgnIndirect(prc) \ IntSysCreateRectpRgn((prc)->left, (prc)->top, (prc)->right, (prc)->bottom) + +PROSRGNDATA +FASTCALL +IntSysCreateRectpRgn(INT LeftRect, INT TopRect, INT RightRect, INT BottomRect); + +FORCEINLINE +PREGION +REGION_LockRgn(HRGN hrgn) +{ + return GDIOBJ_LockObject(hrgn, GDIObjType_RGN_TYPE); +} + +FORCEINLINE +VOID +REGION_UnlockRgn(PREGION prgn) +{ + GDIOBJ_vUnlockObject(&prgn->BaseObject); +} diff --git a/subsystems/win32/win32k/include/surface.h b/subsystems/win32/win32k/include/surface.h index 26e512d9c29..4da75777dda 100644 --- a/subsystems/win32/win32k/include/surface.h +++ b/subsystems/win32/win32k/include/surface.h @@ -90,19 +90,17 @@ typedef struct _SURFACE /* Internal interface */ -#define SURFACE_AllocSurfaceWithHandle() ((PSURFACE) GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_BITMAP)) +#define SURFACE_AllocSurfaceWithHandle() ((PSURFACE) GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_BITMAP, sizeof(SURFACE))) #define SURFACE_FreeSurface(pBMObj) GDIOBJ_FreeObj((POBJ) pBMObj, GDIObjType_SURF_TYPE) #define SURFACE_FreeSurfaceByHandle(hBMObj) GDIOBJ_FreeObjByHandle((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_BITMAP) /* NOTE: Use shared locks! */ -#define SURFACE_LockSurface(hBMObj) \ - ((PSURFACE) GDIOBJ_LockObj ((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_BITMAP)) #define SURFACE_ShareLockSurface(hBMObj) \ ((PSURFACE) GDIOBJ_ShareLockObj ((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_BITMAP)) #define SURFACE_UnlockSurface(pBMObj) \ - GDIOBJ_UnlockObjByPtr ((POBJ)pBMObj) + GDIOBJ_vUnlockObject ((POBJ)pBMObj) #define SURFACE_ShareUnlockSurface(pBMObj) \ - GDIOBJ_ShareUnlockObjByPtr ((POBJ)pBMObj) + GDIOBJ_vDereferenceObject ((POBJ)pBMObj) BOOL INTERNAL_CALL SURFACE_Cleanup(PVOID ObjectBody); diff --git a/subsystems/win32/win32k/include/text.h b/subsystems/win32/win32k/include/text.h index 9dc6510fd6e..2be5cad6cbe 100644 --- a/subsystems/win32/win32k/include/text.h +++ b/subsystems/win32/win32k/include/text.h @@ -77,11 +77,11 @@ typedef struct /* Internal interface */ #define TEXTOBJ_AllocText() ((PTEXTOBJ) GDIOBJ_AllocObj(GDIObjType_LFONT_TYPE)) -#define TEXTOBJ_AllocTextWithHandle() ((PTEXTOBJ) GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_FONT)) +#define TEXTOBJ_AllocTextWithHandle() ((PTEXTOBJ) GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_FONT, sizeof(TEXTOBJ))) #define TEXTOBJ_FreeText(pBMObj) GDIOBJ_FreeObj((POBJ) pBMObj, GDILoObjType_LO_FONT_TYPE) #define TEXTOBJ_FreeTextByHandle(hBMObj) GDIOBJ_FreeObj((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_FONT) -#define TEXTOBJ_LockText(hBMObj) ((PTEXTOBJ) GDIOBJ_LockObj ((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_FONT)) -#define TEXTOBJ_UnlockText(pBMObj) GDIOBJ_UnlockObjByPtr ((POBJ)pBMObj) +#define TEXTOBJ_LockText(hBMObj) ((PTEXTOBJ) GDIOBJ_LockObject((HGDIOBJ) hBMObj, GDIObjType_LFONT_TYPE)) +#define TEXTOBJ_UnlockText(pBMObj) GDIOBJ_vUnlockObject ((POBJ)pBMObj) PTEXTOBJ FASTCALL RealizeFontInit(HFONT); NTSTATUS FASTCALL TextIntRealizeFont(HFONT,PTEXTOBJ); diff --git a/subsystems/win32/win32k/include/win32.h b/subsystems/win32/win32k/include/win32.h index 2e43ec1517f..0204ff96bf1 100644 --- a/subsystems/win32/win32k/include/win32.h +++ b/subsystems/win32/win32k/include/win32.h @@ -105,6 +105,9 @@ typedef struct _THREADINFO LIST_ENTRY W32CallbackListHead; SINGLE_LIST_ENTRY ReferencesList; ULONG cExclusiveLocks; +#if DBG + USHORT acExclusiveLockCount[GDIObjTypeTotal]; +#endif } THREADINFO; @@ -186,4 +189,7 @@ typedef struct _PROCESSINFO LIST_ENTRY DriverObjListHead; struct _KBL* KeyboardLayout; // THREADINFO only W32HEAP_USER_MAPPING HeapMappings; + struct _GDI_POOL *pPoolDcAttr; + struct _GDI_POOL *pPoolBrushAttr; + struct _GDI_POOL *pPoolRgnAttr; } PROCESSINFO; diff --git a/subsystems/win32/win32k/include/win32kp.h b/subsystems/win32/win32k/include/win32kp.h index 94bf3190b85..7c79d893c7b 100644 --- a/subsystems/win32/win32k/include/win32kp.h +++ b/subsystems/win32/win32k/include/win32kp.h @@ -18,6 +18,11 @@ #define INIT_FUNCTION #endif +/* Enable debugging features */ +#define GDI_DEBUG 0 +#define DBG_ENABLE_EVENT_LOGGING 0 +#define DBG_ENABLE_SERVICE_HOOKS 0 + /* Internal Win32k Headers */ #include #include diff --git a/subsystems/win32/win32k/main/dllmain.c b/subsystems/win32/win32k/main/dllmain.c index 59853171885..caa5ee314ed 100644 --- a/subsystems/win32/win32k/main/dllmain.c +++ b/subsystems/win32/win32k/main/dllmain.c @@ -114,12 +114,37 @@ Win32kProcessCallback(struct _EPROCESS *Process, Win32Process->peProcess = Process; /* setup process flags */ Win32Process->W32PF_flags = 0; + + /* Create pools for GDI object attributes */ + Win32Process->pPoolDcAttr = GdiPoolCreate(sizeof(DC_ATTR), 'acdG'); + Win32Process->pPoolBrushAttr = GdiPoolCreate(sizeof(BRUSH_ATTR), 'arbG'); + Win32Process->pPoolRgnAttr = GdiPoolCreate(sizeof(RGN_ATTR), 'agrG'); + ASSERT(Win32Process->pPoolDcAttr); + ASSERT(Win32Process->pPoolBrushAttr); + ASSERT(Win32Process->pPoolRgnAttr); } else { DPRINT("Destroying W32 process PID:%d at IRQ level: %lu\n", Process->UniqueProcessId, KeGetCurrentIrql()); Win32Process->W32PF_flags |= W32PF_TERMINATED; + /* Notify logon application to restart shell if needed */ + if(Win32Process->rpdeskStartup->pDeskInfo) + { + if(Win32Process->rpdeskStartup->pDeskInfo->ppiShellProcess == Win32Process) + { + DWORD ExitCode; + ExitCode = PsGetProcessExitStatus(Win32Process->peProcess); + + DPRINT1("Shell process is exiting (%d)\n", ExitCode); + + UserPostMessage(hwndSAS, + WM_LOGONNOTIFY, + LN_SHELL_EXITED, + ExitCode); + } + } + if (Win32Process->InputIdleEvent) { EngFreeMem((PVOID)Win32Process->InputIdleEvent); @@ -146,8 +171,19 @@ Win32kProcessCallback(struct _EPROCESS *Process, LogonProcess = NULL; } + /* Close the startup desktop */ + ASSERT(Win32Process->rpdeskStartup); + ASSERT(Win32Process->hdeskStartup); + ObDereferenceObject(Win32Process->rpdeskStartup); + ZwClose(Win32Process->hdeskStartup); + + /* Close the current window station */ UserSetProcessWindowStation(NULL); + /* Destroy GDI pools */ + GdiPoolDestroy(Win32Process->pPoolDcAttr); + GdiPoolDestroy(Win32Process->pPoolBrushAttr); + GdiPoolDestroy(Win32Process->pPoolRgnAttr); } RETURN( STATUS_SUCCESS); @@ -199,6 +235,7 @@ Win32kThreadCallback(struct _ETHREAD *Thread, HDESK hDesk = NULL; NTSTATUS Status; PUNICODE_STRING DesktopPath; + PDESKTOP pdesk; PRTL_USER_PROCESS_PARAMETERS ProcessParams = (Process->Peb ? Process->Peb->ProcessParameters : NULL); DPRINT("Creating W32 thread TID:%d at IRQ level: %lu\n", Thread->Cid.UniqueThread, KeGetCurrentIrql()); @@ -211,37 +248,6 @@ Win32kThreadCallback(struct _ETHREAD *Thread, InitializeListHead(&Win32Thread->aphkStart[i]); } - /* - * inherit the thread desktop and process window station (if not yet inherited) from the process startup - * info structure. See documentation of CreateProcess() - */ - DesktopPath = (ProcessParams ? ((ProcessParams->DesktopInfo.Length > 0) ? &ProcessParams->DesktopInfo : NULL) : NULL); - Status = IntParseDesktopPath(Process, - DesktopPath, - &hWinSta, - &hDesk); - if(NT_SUCCESS(Status)) - { - if(hWinSta != NULL) - { - if(!UserSetProcessWindowStation(hWinSta)) - { - DPRINT1("Failed to set process window station\n"); - } - } - - if (hDesk != NULL) - { - if (!IntSetThreadDesktop(hDesk, FALSE)) - { - DPRINT1("Unable to set thread desktop\n"); - } - } - } - else - { - DPRINT1("No Desktop handle for this Thread!\n"); - } Win32Thread->TIF_flags &= ~TIF_INCLEANUP; co_IntDestroyCaret(Win32Thread); Win32Thread->ppi = PsGetCurrentProcessWin32Process(); @@ -254,6 +260,59 @@ Win32kThreadCallback(struct _ETHREAD *Thread, } Win32Thread->MessageQueue = MsqCreateMessageQueue(Thread); Win32Thread->KeyboardLayout = W32kGetDefaultKeyLayout(); + Win32Thread->pEThread = Thread; + + /* HAAAAAAAACK! This should go to Win32kProcessCallback */ + if(Win32Thread->ppi->hdeskStartup == NULL) + { + /* + * inherit the thread desktop and process window station (if not yet inherited) from the process startup + * info structure. See documentation of CreateProcess() + */ + DesktopPath = (ProcessParams ? ((ProcessParams->DesktopInfo.Length > 0) ? &ProcessParams->DesktopInfo : NULL) : NULL); + Status = IntParseDesktopPath(Process, + DesktopPath, + &hWinSta, + &hDesk); + if(NT_SUCCESS(Status)) + { + if(hWinSta != NULL) + { + if(!UserSetProcessWindowStation(hWinSta)) + { + DPRINT1("Failed to set process window station\n"); + } + } + + if (hDesk != NULL) + { + /* Validate the new desktop. */ + Status = IntValidateDesktopHandle(hDesk, + UserMode, + 0, + &pdesk); + + if(NT_SUCCESS(Status)) + { + Win32Thread->ppi->hdeskStartup = hDesk; + Win32Thread->ppi->rpdeskStartup = pdesk; + } + } + } + else + { + DPRINT1("No Desktop handle for this Thread!\n"); + } + } + + if (Win32Thread->ppi->hdeskStartup != NULL) + { + if (!IntSetThreadDesktop(Win32Thread->ppi->hdeskStartup, FALSE)) + { + DPRINT1("Unable to set thread desktop\n"); + } + } + pTeb = NtCurrentTeb(); if (pTeb) { /* Attempt to startup client support which should have been initialized in IntSetThreadDesktop. */ @@ -281,7 +340,7 @@ Win32kThreadCallback(struct _ETHREAD *Thread, // System thread running! Now SendMessage should be okay. Win32Thread->pcti = &Win32Thread->cti; } - Win32Thread->pEThread = Thread; + GetW32ThreadInfo(); } else { @@ -440,7 +499,7 @@ DriverEntry( /* Register our per-process and per-thread structures. */ PsEstablishWin32Callouts((PWIN32_CALLOUTS_FPNS)&CalloutData); -#if 0 // DBG +#if DBG_ENABLE_SERVICE_HOOKS /* Register service hook callbacks */ KdSystemDebugControl('CsoR', DbgPreServiceHook, ID_Win32PreServiceHook, 0, 0, 0, 0); KdSystemDebugControl('CsoR', DbgPostServiceHook, ID_Win32PostServiceHook, 0, 0, 0, 0); diff --git a/subsystems/win32/win32k/ntddraw/dxeng.c b/subsystems/win32/win32k/ntddraw/dxeng.c index 0f9a1a797a1..ff7f7060eb2 100644 --- a/subsystems/win32/win32k/ntddraw/dxeng.c +++ b/subsystems/win32/win32k/ntddraw/dxeng.c @@ -727,7 +727,7 @@ BOOL APIENTRY DxEngSetDCOwner(HGDIOBJ hObject, DWORD OwnerMask) { DPRINT1("ReactX Calling : DxEngSetDCOwner \n"); - return IntGdiSetDCOwnerEx( hObject, OwnerMask, FALSE); + return GreSetDCOwner(hObject, OwnerMask); } /************************************************************************/ diff --git a/subsystems/win32/win32k/ntuser/cursoricon.c b/subsystems/win32/win32k/ntuser/cursoricon.c index 131d912cfc0..f749bda6dbd 100644 --- a/subsystems/win32/win32k/ntuser/cursoricon.c +++ b/subsystems/win32/win32k/ntuser/cursoricon.c @@ -413,13 +413,13 @@ IntDestroyCurIconObject(PCURICON_OBJECT CurIcon, BOOL ProcessCleanup) /* delete bitmaps */ if (bmpMask) { - GDIOBJ_SetOwnership(bmpMask, PsGetCurrentProcess()); + GreSetObjectOwner(bmpMask, GDI_OBJ_HMGR_POWNED); GreDeleteObject(bmpMask); CurIcon->IconInfo.hbmMask = NULL; } if (bmpColor) { - GDIOBJ_SetOwnership(bmpColor, PsGetCurrentProcess()); + GreSetObjectOwner(bmpColor, GDI_OBJ_HMGR_POWNED); GreDeleteObject(bmpColor); CurIcon->IconInfo.hbmColor = NULL; } @@ -934,13 +934,16 @@ NtUserSetCursorContents( /* Copy new IconInfo field */ CurIcon->IconInfo = IconInfo; - psurfBmp = SURFACE_ShareLockSurface(CurIcon->IconInfo.hbmColor); - if (psurfBmp) + if (CurIcon->IconInfo.hbmColor) { + psurfBmp = SURFACE_ShareLockSurface(CurIcon->IconInfo.hbmColor); + if (!psurfBmp) + goto done; + CurIcon->Size.cx = psurfBmp->SurfObj.sizlBitmap.cx; CurIcon->Size.cy = psurfBmp->SurfObj.sizlBitmap.cy; SURFACE_ShareUnlockSurface(psurfBmp); - GDIOBJ_SetOwnership(CurIcon->IconInfo.hbmColor, NULL); + GreSetObjectOwner(CurIcon->IconInfo.hbmColor, GDI_OBJ_HMGR_PUBLIC); } else { @@ -953,7 +956,7 @@ NtUserSetCursorContents( SURFACE_ShareUnlockSurface(psurfBmp); } - GDIOBJ_SetOwnership(CurIcon->IconInfo.hbmMask, NULL); + GreSetObjectOwner(CurIcon->IconInfo.hbmMask, GDI_OBJ_HMGR_PUBLIC); Ret = TRUE; @@ -1017,7 +1020,7 @@ NtUserSetCursorIconData( CurIcon->Size.cx = psurfBmp->SurfObj.sizlBitmap.cx; CurIcon->Size.cy = psurfBmp->SurfObj.sizlBitmap.cy; SURFACE_UnlockSurface(psurfBmp); - GDIOBJ_SetOwnership(GdiHandleTable, CurIcon->IconInfo.hbmMask, NULL); + GreSetObjectOwner(CurIcon->IconInfo.hbmMask, GDI_OBJ_HMGR_PUBLIC); } } if (CurIcon->IconInfo.hbmMask) @@ -1031,7 +1034,7 @@ NtUserSetCursorIconData( SURFACE_UnlockSurface(psurfBmp); } } - GDIOBJ_SetOwnership(GdiHandleTable, CurIcon->IconInfo.hbmMask, NULL); + GreSetObjectOwner(CurIcon->IconInfo.hbmMask, GDI_OBJ_HMGR_PUBLIC); } } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) @@ -1121,10 +1124,10 @@ done: if(Ret) { /* This icon is shared now */ - GDIOBJ_SetOwnership(CurIcon->IconInfo.hbmMask, NULL); + GreSetObjectOwner(CurIcon->IconInfo.hbmMask, GDI_OBJ_HMGR_PUBLIC); if(CurIcon->IconInfo.hbmColor) { - GDIOBJ_SetOwnership(CurIcon->IconInfo.hbmColor, NULL); + GreSetObjectOwner(CurIcon->IconInfo.hbmColor, GDI_OBJ_HMGR_PUBLIC); } } UserDereferenceObject(CurIcon); @@ -1170,12 +1173,12 @@ UserDrawIconEx( if (istepIfAniCur) DPRINT1("NtUserDrawIconEx: istepIfAniCur is not supported!\n"); - if (!hbmMask || !IntGdiGetObject(hbmMask, sizeof(BITMAP), (PVOID)&bm)) + if (!hbmMask || !GreGetObject(hbmMask, sizeof(BITMAP), (PVOID)&bm)) { return FALSE; } - if (hbmColor && !IntGdiGetObject(hbmColor, sizeof(BITMAP), (PVOID)&bmpColor)) + if (hbmColor && !GreGetObject(hbmColor, sizeof(BITMAP), (PVOID)&bmpColor)) { return FALSE; } diff --git a/subsystems/win32/win32k/ntuser/defwnd.c b/subsystems/win32/win32k/ntuser/defwnd.c index 88d82802f8f..c2560749508 100644 --- a/subsystems/win32/win32k/ntuser/defwnd.c +++ b/subsystems/win32/win32k/ntuser/defwnd.c @@ -97,6 +97,34 @@ IntClientShutdown( return lResult; } +LRESULT FASTCALL +DefWndHandleSysCommand(PWND pWnd, WPARAM wParam, LPARAM lParam) +{ + LRESULT lResult = 0; + BOOL Hook = FALSE; + + if (ISITHOOKED(WH_CBT) || (pWnd->head.rpdesk->pDeskInfo->fsHooks & HOOKID_TO_FLAG(WH_CBT))) + { + Hook = TRUE; + lResult = co_HOOK_CallHooks(WH_CBT, HCBT_SYSCOMMAND, wParam, lParam); + + if (lResult) return lResult; + } + + switch (wParam & 0xfff0) + { + case SC_SCREENSAVE: + DPRINT1("Screensaver Called!\n"); + break; + + default: + // We do not support anything else here so we should return normal even when sending a hook. + return 0; + } + + return(Hook ? 1 : 0); // Don't call us again from user space. +} + /* Win32k counterpart of User DefWindowProc */ @@ -117,7 +145,7 @@ IntDefWindowProc( case WM_SYSCOMMAND: { DPRINT1("hwnd %p WM_SYSCOMMAND %lx %lx\n", Wnd->head.h, wParam, lParam ); - lResult = co_HOOK_CallHooks(WH_CBT, HCBT_SYSCOMMAND, wParam, lParam); + lResult = DefWndHandleSysCommand(Wnd, wParam, lParam); break; } case WM_SHOWWINDOW: @@ -142,6 +170,12 @@ IntDefWindowProc( case WM_CLIENTSHUTDOWN: return IntClientShutdown(Wnd, wParam, lParam); + case WM_GETHOTKEY: + return DefWndGetHotKey(UserHMGetHandle(Wnd)); + case WM_SETHOTKEY: + return DefWndSetHotKey(Wnd, wParam); + + /* ReactOS only. */ case WM_CBT: { switch (wParam) diff --git a/subsystems/win32/win32k/ntuser/desktop.c b/subsystems/win32/win32k/ntuser/desktop.c index e414e7e55bf..3dbfdcf117e 100644 --- a/subsystems/win32/win32k/ntuser/desktop.c +++ b/subsystems/win32/win32k/ntuser/desktop.c @@ -168,7 +168,7 @@ IntDesktopObjectDelete(PWIN32_DELETEMETHOD_PARAMETERS Parameters) IntFreeDesktopHeap(Desktop); } -NTSTATUS NTAPI +NTSTATUS NTAPI IntDesktopOkToClose(PWIN32_OKAYTOCLOSEMETHOD_PARAMETERS Parameters) { PTHREADINFO pti; @@ -640,7 +640,7 @@ UserRedrawDesktop() { PWND Window = NULL; HRGN hRgn; - + Window = UserGetDesktopWindow(); hRgn = IntSysCreateRectRgnIndirect(&Window->rcWindow); @@ -650,8 +650,8 @@ UserRedrawDesktop() RDW_ERASE | RDW_INVALIDATE | RDW_ALLCHILDREN); - - REGION_FreeRgnByHandle(hRgn); + + GreDeleteObject(hRgn); } @@ -1831,7 +1831,7 @@ IntSetThreadDesktop(IN HDESK hDesktop, DPRINT("IntSetThreadDesktop() , FOF=%d\n", FreeOnFailure); MapHeap = (PsGetCurrentProcess() != PsInitialSystemProcess); W32Thread = PsGetCurrentThreadWin32Thread(); - + if(hDesktop != NULL) { /* Validate the new desktop. */ @@ -1943,7 +1943,7 @@ IntSetThreadDesktop(IN HDESK hDesktop, ObDereferenceObject(OldDesktop); } - + if (hOldDesktop != NULL) { ZwClose(hOldDesktop); @@ -1965,11 +1965,11 @@ NtUserSetThreadDesktop(HDESK hDesktop) BOOL ret; UserEnterExclusive(); - + ret = IntSetThreadDesktop(hDesktop, FALSE); - + UserLeave(); - + return ret; } diff --git a/subsystems/win32/win32k/ntuser/hotkey.c b/subsystems/win32/win32k/ntuser/hotkey.c index 1d5322e1a8a..7f20d32464a 100644 --- a/subsystems/win32/win32k/ntuser/hotkey.c +++ b/subsystems/win32/win32k/ntuser/hotkey.c @@ -61,7 +61,6 @@ InitHotkeyImpl(VOID) return STATUS_SUCCESS; } - #if 0 //not used NTSTATUS FASTCALL CleanupHotKeys(VOID) @@ -71,7 +70,6 @@ CleanupHotKeys(VOID) } #endif - BOOL FASTCALL GetHotKey (UINT fsModifiers, UINT vk, @@ -102,7 +100,6 @@ GetHotKey (UINT fsModifiers, return FALSE; } - VOID FASTCALL UnregisterWindowHotKeys(PWND Window) { @@ -119,7 +116,6 @@ UnregisterWindowHotKeys(PWND Window) } - VOID FASTCALL UnregisterThreadHotKeys(struct _ETHREAD *Thread) { @@ -136,7 +132,6 @@ UnregisterThreadHotKeys(struct _ETHREAD *Thread) } - static BOOL FASTCALL IsHotKey (UINT fsModifiers, UINT vk) @@ -154,7 +149,111 @@ IsHotKey (UINT fsModifiers, UINT vk) return FALSE; } +// +// Get/SetHotKey message support. +// +UINT FASTCALL +DefWndGetHotKey( HWND hwnd ) +{ + PHOT_KEY_ITEM HotKeyItem; + DPRINT1("DefWndGetHotKey\n"); + + if (IsListEmpty(&gHotkeyList)) return 0; + + LIST_FOR_EACH(HotKeyItem, &gHotkeyList, HOT_KEY_ITEM, ListEntry) + { + if ( HotKeyItem->hWnd == hwnd && + HotKeyItem->id == IDHOT_REACTOS ) + { + return MAKELONG(HotKeyItem->vk, HotKeyItem->fsModifiers); + } + } + return 0; +} + +INT FASTCALL +DefWndSetHotKey( PWND pWnd, WPARAM wParam ) +{ + UINT fsModifiers, vk; + PHOT_KEY_ITEM HotKeyItem; + HWND hWnd; + BOOL HaveSameWnd = FALSE; + INT Ret = 1; + + DPRINT1("DefWndSetHotKey wParam 0x%x\n", wParam); + + // A hot key cannot be associated with a child window. + if (pWnd->style & WS_CHILD) return 0; + + // VK_ESCAPE, VK_SPACE, and VK_TAB are invalid hot keys. + if ( LOWORD(wParam) == VK_ESCAPE || + LOWORD(wParam) == VK_SPACE || + LOWORD(wParam) == VK_TAB ) return -1; + + vk = LOWORD(wParam); + fsModifiers = HIWORD(wParam); + hWnd = UserHMGetHandle(pWnd); + + if (wParam) + { + LIST_FOR_EACH(HotKeyItem, &gHotkeyList, HOT_KEY_ITEM, ListEntry) + { + if ( HotKeyItem->fsModifiers == fsModifiers && + HotKeyItem->vk == vk && + HotKeyItem->id == IDHOT_REACTOS ) + { + if (HotKeyItem->hWnd != hWnd) + Ret = 2; // Another window already has the same hot key. + break; + } + } + } + + LIST_FOR_EACH(HotKeyItem, &gHotkeyList, HOT_KEY_ITEM, ListEntry) + { + if ( HotKeyItem->hWnd == hWnd && + HotKeyItem->id == IDHOT_REACTOS ) + { + HaveSameWnd = TRUE; + break; + } + } + + if (HaveSameWnd) + { + if (wParam == 0) + { // Setting wParam to NULL removes the hot key associated with a window. + UnregisterWindowHotKeys(pWnd); + } + else + { /* A window can only have one hot key. If the window already has a hot key + associated with it, the new hot key replaces the old one. */ + HotKeyItem->fsModifiers = fsModifiers; + HotKeyItem->vk = vk; + } + } + else // + { + if (wParam == 0) + return 1; // Do nothing, exit. + + HotKeyItem = ExAllocatePoolWithTag (PagedPool, sizeof(HOT_KEY_ITEM), USERTAG_HOTKEY); + if (HotKeyItem == NULL) + { + return 0; + } + + HotKeyItem->Thread = pWnd->head.pti->pEThread; + HotKeyItem->hWnd = hWnd; + HotKeyItem->id = IDHOT_REACTOS; // Don't care, these hot keys are unrelated to the hot keys set by RegisterHotKey. + HotKeyItem->fsModifiers = fsModifiers; + HotKeyItem->vk = vk; + + InsertHeadList (&gHotkeyList, &HotKeyItem->ListEntry); + } + return Ret; +} /* SYSCALLS *****************************************************************/ diff --git a/subsystems/win32/win32k/ntuser/input.c b/subsystems/win32/win32k/ntuser/input.c index 8e627548112..604ede7cabc 100644 --- a/subsystems/win32/win32k/ntuser/input.c +++ b/subsystems/win32/win32k/ntuser/input.c @@ -482,7 +482,7 @@ static VOID APIENTRY co_IntKeyboardSendAltKeyMsg() { DPRINT1("co_IntKeyboardSendAltKeyMsg\n"); - co_MsqPostKeyboardMessage(WM_SYSCOMMAND,SC_KEYMENU,0); +// co_MsqPostKeyboardMessage(WM_SYSCOMMAND,SC_KEYMENU,0); This sends everything into a msg loop! } static VOID APIENTRY @@ -794,7 +794,7 @@ KeyboardThreadMain(PVOID StartContext) if (ModifierState & MOD_ALT) { - lParam |= (1 << 29); + lParam |= (1 << 29); // wine -> (HIWORD(lParam) & KEYDATA_ALT) #define KEYDATA_ALT 0x2000 if (!(KeyInput.Flags & KEY_BREAK)) msg.message = WM_SYSKEYDOWN; @@ -1297,9 +1297,10 @@ IntKeyboardInput(KEYBDINPUT *ki, BOOL Injected) if (ki->dwFlags & KEYEVENTF_KEYUP) { Msg.message = WM_KEYUP; - if ((gQueueKeyStateTable[VK_MENU] & 0x80) && + if (((gQueueKeyStateTable[VK_MENU] & 0x80) && ((wVkStripped == VK_MENU) || (wVkStripped == VK_CONTROL) || !(gQueueKeyStateTable[VK_CONTROL] & 0x80))) + || (wVkStripped == VK_F10)) { if( TrackSysKey == VK_MENU || /* -down/-up sequence */ (wVkStripped != VK_MENU)) /* -down...-up */ @@ -1311,8 +1312,9 @@ IntKeyboardInput(KEYBDINPUT *ki, BOOL Injected) else { Msg.message = WM_KEYDOWN; - if ((gQueueKeyStateTable[VK_MENU] & 0x80 || wVkStripped == VK_MENU) && + if (((gQueueKeyStateTable[VK_MENU] & 0x80 || wVkStripped == VK_MENU) && !(gQueueKeyStateTable[VK_CONTROL] & 0x80 || wVkStripped == VK_CONTROL)) + || (wVkStripped == VK_F10)) { Msg.message = WM_SYSKEYDOWN; TrackSysKey = wVkStripped; diff --git a/subsystems/win32/win32k/ntuser/message.c b/subsystems/win32/win32k/ntuser/message.c index 2a2097f6703..fbe7a93d033 100644 --- a/subsystems/win32/win32k/ntuser/message.c +++ b/subsystems/win32/win32k/ntuser/message.c @@ -667,7 +667,7 @@ IntDispatchMessage(PMSG pMsg) /* send a WM_NCPAINT and WM_ERASEBKGND if the non-client area is still invalid */ HRGN hrgn = IntSysCreateRectRgn( 0, 0, 0, 0 ); co_UserGetUpdateRgn( Window, hrgn, TRUE ); - REGION_FreeRgnByHandle( hrgn ); + GreDeleteObject(hrgn); } return retval; @@ -735,7 +735,8 @@ co_IntPeekMessage( PMSG Msg, } /* Now check for normal messages. */ - if ((ProcessMask & QS_POSTMESSAGE) && + if (( (ProcessMask & QS_POSTMESSAGE) || + (ProcessMask & QS_HOTKEY) ) && MsqPeekMessage( ThreadQueue, RemoveMessages, Window, @@ -1217,7 +1218,6 @@ co_IntSendMessageTimeoutSingle( HWND hWnd, RETURN( FALSE); } - ObReferenceObject(Win32Thread->pEThread); Result = (ULONG_PTR)co_IntCallWindowProc( Window->lpfnWndProc, !Window->Unicode, hWnd, @@ -1230,8 +1230,6 @@ co_IntSendMessageTimeoutSingle( HWND hWnd, *uResult = Result; } - ObDereferenceObject(Win32Thread->pEThread); - IntCallWndProcRet( Window, hWnd, Msg, wParam, lParam, (LRESULT *)uResult); if (! NT_SUCCESS(UnpackParam(lParamPacked, Msg, wParam, lParam, FALSE))) @@ -1437,7 +1435,6 @@ co_IntSendMessageWithCallBack( HWND hWnd, IntCallWndProc( Window, hWnd, Msg, wParam, lParam); - ObReferenceObject(Win32Thread->pEThread); Result = (ULONG_PTR)co_IntCallWindowProc( Window->lpfnWndProc, !Window->Unicode, hWnd, @@ -1449,7 +1446,6 @@ co_IntSendMessageWithCallBack( HWND hWnd, { *uResult = Result; } - ObDereferenceObject(Win32Thread->pEThread); IntCallWndProcRet( Window, hWnd, Msg, wParam, lParam, (LRESULT *)uResult); @@ -1481,7 +1477,7 @@ co_IntSendMessageWithCallBack( HWND hWnd, } IntReferenceMessageQueue(Window->head.pti->MessageQueue); - /* Take reference on this MessageQueue if its a callback. It will be released + /* Take reference on this MessageQueue if its a callback. It will be released when message is processed or removed from target hwnd MessageQueue */ if (CompletionCallback) IntReferenceMessageQueue(Win32Thread->MessageQueue); diff --git a/subsystems/win32/win32k/ntuser/monitor.c b/subsystems/win32/win32k/ntuser/monitor.c index 83ea41a1b9b..01a9c5c3705 100644 --- a/subsystems/win32/win32k/ntuser/monitor.c +++ b/subsystems/win32/win32k/ntuser/monitor.c @@ -175,7 +175,7 @@ IntAttachMonitor(IN PDEVOBJ *pGdiDevice, } Monitor->Prev = p; } - + IntUpdateMonitorSize(pGdiDevice); return STATUS_SUCCESS; @@ -232,7 +232,7 @@ IntDetachMonitor(IN PDEVOBJ *pGdiDevice) } if (Monitor->hrgnMonitor) - REGION_FreeRgnByHandle(Monitor->hrgnMonitor); + GreDeleteObject(Monitor->hrgnMonitor); IntDestroyMonitorObject(Monitor); @@ -276,8 +276,8 @@ IntUpdateMonitorSize(IN PDEVOBJ *pGdiDevice) if (Monitor->hrgnMonitor) { - GDIOBJ_SetOwnership(Monitor->hrgnMonitor, PsGetCurrentProcess()); - REGION_FreeRgnByHandle(Monitor->hrgnMonitor); + GreSetObjectOwner(Monitor->hrgnMonitor, GDI_OBJ_HMGR_POWNED); + GreDeleteObject(Monitor->hrgnMonitor); } Monitor->hrgnMonitor = IntSysCreateRectRgnIndirect( &Monitor->rcMonitor ); @@ -413,7 +413,7 @@ IntGetMonitorsFromRect(OPTIONAL IN LPCRECTL pRect, if (monitorRectList != NULL) monitorRectList[iCount] = IntersectionRect; } - + /* Increase count of found monitors */ iCount++; } @@ -806,7 +806,7 @@ NtUserMonitorFromRect( return hMonitor; } - hMonitorList = ExAllocatePoolWithTag(PagedPool, + hMonitorList = ExAllocatePoolWithTag(PagedPool, sizeof(HMONITOR) * numMonitors, USERTAG_MONITORRECTS); if (hMonitorList == NULL) diff --git a/subsystems/win32/win32k/ntuser/msgqueue.c b/subsystems/win32/win32k/ntuser/msgqueue.c index 90b11a9f017..e34d0a3101b 100644 --- a/subsystems/win32/win32k/ntuser/msgqueue.c +++ b/subsystems/win32/win32k/ntuser/msgqueue.c @@ -52,8 +52,9 @@ DWORD FASTCALL UserGetKeyState(DWORD key) if( key < 0x100 ) { - ret = ((DWORD)(MessageQueue->KeyState[key] & KS_DOWN_BIT) << 8 ) | - (MessageQueue->KeyState[key] & KS_LOCK_BIT); + ret = (DWORD)MessageQueue->KeyState[key]; + if (MessageQueue->KeyState[key] & KS_DOWN_BIT) + ret |= 0xFF00; // If down, windows returns 0xFF80. } return ret; @@ -62,9 +63,11 @@ DWORD FASTCALL UserGetKeyState(DWORD key) /* change the input key state for a given key */ static void set_input_key_state( PUSER_MESSAGE_QUEUE MessageQueue, UCHAR key, BOOL down ) { + DPRINT("set_input_key_state key:%d, down:%d\n", key, down); + if (down) { - if (!(MessageQueue->KeyState[key] & KS_DOWN_BIT)) + if (!(MessageQueue->KeyState[key] & KS_DOWN_BIT)) { MessageQueue->KeyState[key] ^= KS_LOCK_BIT; } @@ -82,6 +85,8 @@ static void update_input_key_state( PUSER_MESSAGE_QUEUE MessageQueue, MSG* msg ) UCHAR key; BOOL down = 0; + DPRINT("update_input_key_state message:%d\n", msg->message); + switch (msg->message) { case WM_LBUTTONDOWN: @@ -106,9 +111,9 @@ static void update_input_key_state( PUSER_MESSAGE_QUEUE MessageQueue, MSG* msg ) down = 1; /* fall through */ case WM_XBUTTONUP: - if (msg->wParam == XBUTTON1) + if (msg->wParam == XBUTTON1) set_input_key_state( MessageQueue, VK_XBUTTON1, down ); - else if (msg->wParam == XBUTTON2) + else if (msg->wParam == XBUTTON2) set_input_key_state( MessageQueue, VK_XBUTTON2, down ); break; case WM_KEYDOWN: @@ -223,7 +228,7 @@ ClearMsgBitsMask(PUSER_MESSAGE_QUEUE Queue, UINT MessageBits) pti = Queue->Thread->Tcb.Win32Thread; if (MessageBits & QS_KEY) - { + { if (--Queue->nCntsQBits[QSRosKey] == 0) ClrMask |= QS_KEY; } if (MessageBits & QS_MOUSEMOVE) // ReactOS hard coded. @@ -347,7 +352,7 @@ co_MsqInsertMouseMessage(MSG* Msg, DWORD flags, ULONG_PTR dwExtraInfo, BOOL Hook if(Msg->hwnd != NULL) { pwnd = UserGetWindowObject(Msg->hwnd); - if ((pwnd->style & WS_VISIBLE) && + if ((pwnd->style & WS_VISIBLE) && IntPtInWindow(pwnd, Msg->pt.x, Msg->pt.y)) { pDesk->htEx = HTCLIENT; @@ -367,7 +372,7 @@ co_MsqInsertMouseMessage(MSG* Msg, DWORD flags, ULONG_PTR dwExtraInfo, BOOL Hook continue; } - if((pwnd->style & WS_VISIBLE) && + if((pwnd->style & WS_VISIBLE) && IntPtInWindow(pwnd, Msg->pt.x, Msg->pt.y)) { Msg->hwnd = pwnd->head.h; @@ -481,6 +486,8 @@ MsqPostHotKeyMessage(PVOID Thread, HWND hWnd, WPARAM wParam, LPARAM lParam) MSG Mesg; LARGE_INTEGER LargeTickCount; NTSTATUS Status; + INT id; + DWORD Type; Status = ObReferenceObjectByPointer (Thread, THREAD_ALL_ACCESS, @@ -503,14 +510,17 @@ MsqPostHotKeyMessage(PVOID Thread, HWND hWnd, WPARAM wParam, LPARAM lParam) return; } - Mesg.hwnd = hWnd; - Mesg.message = WM_HOTKEY; - Mesg.wParam = wParam; - Mesg.lParam = lParam; + id = wParam; // Check for hot keys unrelated to the hot keys set by RegisterHotKey. + + Mesg.hwnd = hWnd; + Mesg.message = id != IDHOT_REACTOS ? WM_HOTKEY : WM_SYSCOMMAND; + Mesg.wParam = id != IDHOT_REACTOS ? wParam : SC_HOTKEY; + Mesg.lParam = id != IDHOT_REACTOS ? lParam : (LPARAM)hWnd; + Type = id != IDHOT_REACTOS ? QS_HOTKEY : QS_POSTMESSAGE; KeQueryTickCount(&LargeTickCount); - Mesg.time = MsqCalculateMessageTime(&LargeTickCount); - Mesg.pt = gpsi->ptCursor; - MsqPostMessage(Window->head.pti->MessageQueue, &Mesg, FALSE, QS_HOTKEY); + Mesg.time = MsqCalculateMessageTime(&LargeTickCount); + Mesg.pt = gpsi->ptCursor; + MsqPostMessage(Window->head.pti->MessageQueue, &Mesg, FALSE, Type); UserDereferenceObject(Window); ObDereferenceObject (Thread); @@ -543,8 +553,8 @@ co_MsqDispatchOneSentMessage(PUSER_MESSAGE_QUEUE MessageQueue) { PUSER_SENT_MESSAGE SaveMsg, Message; PLIST_ENTRY Entry; - LRESULT Result; PTHREADINFO pti; + LRESULT Result = 0; if (IsListEmpty(&MessageQueue->SentMessagesListHead)) { @@ -811,7 +821,14 @@ co_MsqSendMessage(PUSER_MESSAGE_QUEUE MessageQueue, ptirec = MessageQueue->Thread->Tcb.Win32Thread; ASSERT(ThreadQueue != MessageQueue); ASSERT(ptirec->pcti); // Send must have a client side to receive it!!!! - + + /* Don't send from or to a dying thread */ + if (pti->TIF_flags & TIF_INCLEANUP || ptirec->TIF_flags & TIF_INCLEANUP) + { + *uResult = -1; + return STATUS_TIMEOUT; + } + Timeout.QuadPart = (LONGLONG) uTimeout * (LONGLONG) -10000; /* FIXME - increase reference counter of sender's message queue here */ @@ -990,6 +1007,8 @@ MsqPostMessage(PUSER_MESSAGE_QUEUE MessageQueue, MSG* Msg, BOOLEAN HardwareMessa { InsertTailList(&MessageQueue->HardwareMessagesListHead, &Message->ListEntry); + + update_input_key_state( MessageQueue, Msg ); } Message->QS_Flags = MessageBits; @@ -1028,7 +1047,7 @@ static void MsqSendParentNotify( PWND pwnd, WORD event, WORD idChild, POINT pt ) if (pwndParent == pwndDesktop) break; pt.x += pwnd->rcClient.left - pwndParent->rcClient.left; pt.y += pwnd->rcClient.top - pwndParent->rcClient.top; - + pwnd = pwndParent; co_IntSendMessage( UserHMGetHandle(pwnd), WM_PARENTNOTIFY, MAKEWPARAM( event, idChild ), MAKELPARAM( pt.x, pt.y ) ); @@ -1070,7 +1089,7 @@ BOOL co_IntProcessMouseMessage(MSG* msg, BOOL* RemoveMessages, UINT first, UINT } DPRINT("Got mouse message for 0x%x, hittest: 0x%x\n", msg->hwnd, hittest ); - + if (pwndMsg == NULL || pwndMsg->head.pti != pti) { /* Remove and ignore the message */ @@ -1140,7 +1159,7 @@ BOOL co_IntProcessMouseMessage(MSG* msg, BOOL* RemoveMessages, UINT first, UINT } } - if (!((first == 0 && last == 0) || (message >= first || message <= last))) + if (!((first == 0 && last == 0) || (message >= first || message <= last))) { DPRINT("Message out of range!!!\n"); RETURN(FALSE); @@ -1261,8 +1280,8 @@ BOOL co_IntProcessMouseMessage(MSG* msg, BOOL* RemoveMessages, UINT first, UINT if (pwndTop && pwndTop != pwndDesktop) { - LONG ret = co_IntSendMessage( msg->hwnd, - WM_MOUSEACTIVATE, + LONG ret = co_IntSendMessage( msg->hwnd, + WM_MOUSEACTIVATE, (WPARAM)UserHMGetHandle(pwndTop), MAKELONG( hittest, msg->message)); switch(ret) @@ -1321,6 +1340,10 @@ BOOL co_IntProcessKeyboardMessage(MSG* Msg, BOOL* RemoveMessages) case VK_LMENU: case VK_RMENU: Msg->wParam = VK_MENU; break; + case VK_F10: + if (Msg->message == WM_KEYUP) Msg->message = WM_SYSKEYUP; + if (Msg->message == WM_KEYDOWN) Msg->message = WM_SYSKEYDOWN; + break; } } @@ -1433,7 +1456,7 @@ co_MsqPeekHardwareMessage(IN PUSER_MESSAGE_QUEUE MessageQueue, CurrentMessage = CONTAINING_RECORD(CurrentEntry, USER_MESSAGE, ListEntry); - do + do { if (IsListEmpty(CurrentEntry)) break; if (!CurrentMessage) break; @@ -1448,9 +1471,9 @@ co_MsqPeekHardwareMessage(IN PUSER_MESSAGE_QUEUE MessageQueue, if (Remove) { - update_input_key_state(MessageQueue, pMsg); + update_input_key_state(MessageQueue, &msg); RemoveEntryList(&CurrentMessage->ListEntry); - ClearMsgBitsMask(MessageQueue, QS_INPUT); + ClearMsgBitsMask(MessageQueue, CurrentMessage->QS_Flags); MsqDestroyMessage(CurrentMessage); } @@ -1480,7 +1503,7 @@ MsqPeekMessage(IN PUSER_MESSAGE_QUEUE MessageQueue, PLIST_ENTRY CurrentEntry; PUSER_MESSAGE CurrentMessage; PLIST_ENTRY ListHead; - + CurrentEntry = MessageQueue->PostedMessagesListHead.Flink; ListHead = &MessageQueue->PostedMessagesListHead; @@ -1510,7 +1533,7 @@ MsqPeekMessage(IN PUSER_MESSAGE_QUEUE MessageQueue, if (Remove) { RemoveEntryList(&CurrentMessage->ListEntry); - ClearMsgBitsMask(MessageQueue, QS_POSTMESSAGE); + ClearMsgBitsMask(MessageQueue, CurrentMessage->QS_Flags); MsqDestroyMessage(CurrentMessage); } return(TRUE); @@ -1532,7 +1555,7 @@ co_MsqWaitForNewMessages(PUSER_MESSAGE_QUEUE MessageQueue, PWND WndFilter, ret = KeWaitForSingleObject( MessageQueue->NewMessages, UserRequest, UserMode, - FALSE, + FALSE, NULL ); UserEnterCo(); return ret; @@ -1604,7 +1627,7 @@ MsqCleanupMessageQueue(PUSER_MESSAGE_QUEUE MessageQueue) PUSER_MESSAGE CurrentMessage; PUSER_SENT_MESSAGE CurrentSentMessage; PTHREADINFO pti; - + pti = MessageQueue->Thread->Tcb.Win32Thread; @@ -1632,7 +1655,7 @@ MsqCleanupMessageQueue(PUSER_MESSAGE_QUEUE MessageQueue) DPRINT("Notify the sender and remove a message from the queue that had not been dispatched\n"); /* Only if the message has a sender was the message in the DispatchingList */ - if ((CurrentSentMessage->SenderQueue) + if ((CurrentSentMessage->SenderQueue) && (CurrentSentMessage->DispatchingListEntry.Flink != NULL)) { RemoveEntryList(&CurrentSentMessage->DispatchingListEntry); diff --git a/subsystems/win32/win32k/ntuser/ntstubs.c b/subsystems/win32/win32k/ntuser/ntstubs.c index e1ede5abb5f..281fe7190a1 100644 --- a/subsystems/win32/win32k/ntuser/ntstubs.c +++ b/subsystems/win32/win32k/ntuser/ntstubs.c @@ -519,6 +519,8 @@ NtUserSetSysColors( if (Ret) { UserSendNotifyMessage(HWND_BROADCAST, WM_SYSCOLORCHANGE, 0, 0); + + UserRedrawDesktop(); } UserLeave(); diff --git a/subsystems/win32/win32k/ntuser/painting.c b/subsystems/win32/win32k/ntuser/painting.c index 48919098be7..fcea7dc0043 100644 --- a/subsystems/win32/win32k/ntuser/painting.c +++ b/subsystems/win32/win32k/ntuser/painting.c @@ -157,7 +157,7 @@ IntGetNCUpdateRgn(PWND Window, BOOL Validate) hRgnWindow = IntCalcWindowRgn(Window, TRUE); if (hRgnWindow == NULL) { - REGION_FreeRgnByHandle(hRgnNonClient); + GreDeleteObject(hRgnNonClient); return HRGN_WINDOW; } @@ -165,14 +165,14 @@ IntGetNCUpdateRgn(PWND Window, BOOL Validate) hRgnWindow, RGN_DIFF); if (RgnType == ERROR) { - REGION_FreeRgnByHandle(hRgnWindow); - REGION_FreeRgnByHandle(hRgnNonClient); + GreDeleteObject(hRgnWindow); + GreDeleteObject(hRgnNonClient); return HRGN_WINDOW; } else if (RgnType == NULLREGION) { - REGION_FreeRgnByHandle(hRgnWindow); - REGION_FreeRgnByHandle(hRgnNonClient); + GreDeleteObject(hRgnWindow); + GreDeleteObject(hRgnNonClient); return NULL; } @@ -187,14 +187,14 @@ IntGetNCUpdateRgn(PWND Window, BOOL Validate) hRgnWindow, RGN_AND) == NULLREGION) { IntGdiSetRegionOwner(Window->hrgnUpdate, GDI_OBJ_HMGR_POWNED); - REGION_FreeRgnByHandle(Window->hrgnUpdate); + GreDeleteObject(Window->hrgnUpdate); Window->hrgnUpdate = NULL; if (!(Window->state & WNDS_INTERNALPAINT)) MsqDecPaintCountQueue(Window->head.pti->MessageQueue); } } - REGION_FreeRgnByHandle(hRgnWindow); + GreDeleteObject(hRgnWindow); return hRgnNonClient; } @@ -242,15 +242,9 @@ co_IntPaintWindows(PWND Wnd, ULONG Flags, BOOL Recurse) MsqDecPaintCountQueue(Wnd->head.pti->MessageQueue); co_IntSendMessage(hWnd, WM_NCPAINT, (WPARAM)TempRegion, 0); - if ( (HANDLE) 1 != TempRegion && - NULL != TempRegion) - { - /* NOTE: The region can already be deleted! */ - GDIOBJ_FreeObjByHandle(TempRegion, GDI_OBJECT_TYPE_REGION | GDI_OBJECT_TYPE_SILENT); - } } - if (Wnd->state & WNDS_ERASEBACKGROUND) + if (Wnd->state & WNDS_SENDERASEBACKGROUND) { if (Wnd->hrgnUpdate) { @@ -258,9 +252,11 @@ co_IntPaintWindows(PWND Wnd, ULONG Flags, BOOL Recurse) Wnd->hrgnUpdate, DCX_CACHE|DCX_USESTYLE|DCX_INTERSECTRGN|DCX_KEEPCLIPRGN); - if (co_IntSendMessage(hWnd, WM_ERASEBKGND, (WPARAM)hDC, 0)) + Wnd->state &= ~(WNDS_SENDERASEBACKGROUND|WNDS_ERASEBACKGROUND); + // Kill the loop, so Clear before we send. + if (!co_IntSendMessage(hWnd, WM_ERASEBKGND, (WPARAM)hDC, 0)) { - Wnd->state &= ~WNDS_ERASEBACKGROUND; + Wnd->state |= (WNDS_SENDERASEBACKGROUND|WNDS_ERASEBACKGROUND); } UserReleaseDC(Wnd, hDC, FALSE); } @@ -328,7 +324,7 @@ IntInvalidateWindows(PWND Wnd, HRGN hRgn, ULONG Flags) hRgnClient = IntSysCreateRectRgnIndirect(&Wnd->rcClient); RgnType = NtGdiCombineRgn(hRgn, hRgn, hRgnClient, RGN_AND); - REGION_FreeRgnByHandle(hRgnClient); + GreDeleteObject(hRgnClient); } /* @@ -341,7 +337,7 @@ IntInvalidateWindows(PWND Wnd, HRGN hRgn, ULONG Flags) hRgnWindow = IntSysCreateRectRgnIndirect(&Wnd->rcWindow); RgnType = NtGdiCombineRgn(hRgn, hRgn, hRgnWindow, RGN_AND); - REGION_FreeRgnByHandle(hRgnWindow); + GreDeleteObject(hRgnWindow); } else { @@ -378,14 +374,14 @@ IntInvalidateWindows(PWND Wnd, HRGN hRgn, ULONG Flags) hRgn, RGN_OR) == NULLREGION) { IntGdiSetRegionOwner(Wnd->hrgnUpdate, GDI_OBJ_HMGR_POWNED); - REGION_FreeRgnByHandle(Wnd->hrgnUpdate); + GreDeleteObject(Wnd->hrgnUpdate); Wnd->hrgnUpdate = NULL; } if (Flags & RDW_FRAME) Wnd->state |= WNDS_SENDNCPAINT; if (Flags & RDW_ERASE) - Wnd->state |= WNDS_ERASEBACKGROUND; + Wnd->state |= WNDS_SENDERASEBACKGROUND; Flags |= RDW_FRAME; } @@ -398,17 +394,17 @@ IntInvalidateWindows(PWND Wnd, HRGN hRgn, ULONG Flags) hRgn, RGN_DIFF) == NULLREGION) { IntGdiSetRegionOwner(Wnd->hrgnUpdate, GDI_OBJ_HMGR_POWNED); - REGION_FreeRgnByHandle(Wnd->hrgnUpdate); + GreDeleteObject(Wnd->hrgnUpdate); Wnd->hrgnUpdate = NULL; } } if (Wnd->hrgnUpdate == NULL) - Wnd->state &= ~WNDS_ERASEBACKGROUND; + Wnd->state &= ~(WNDS_SENDERASEBACKGROUND|WNDS_ERASEBACKGROUND); if (Flags & RDW_NOFRAME) Wnd->state &= ~WNDS_SENDNCPAINT; if (Flags & RDW_NOERASE) - Wnd->state &= ~WNDS_ERASEBACKGROUND; + Wnd->state &= ~(WNDS_SENDERASEBACKGROUND|WNDS_ERASEBACKGROUND); } if (Flags & RDW_INTERNALPAINT) @@ -440,7 +436,7 @@ IntInvalidateWindows(PWND Wnd, HRGN hRgn, ULONG Flags) HRGN hRgnTemp = IntSysCreateRectRgn(0, 0, 0, 0); NtGdiCombineRgn(hRgnTemp, hRgn, 0, RGN_COPY); IntInvalidateWindows(Child, hRgnTemp, Flags); - REGION_FreeRgnByHandle(hRgnTemp); + GreDeleteObject(hRgnTemp); } } @@ -540,7 +536,7 @@ co_UserRedrawWindow( hRgn = IntSysCreateRectRgn(0, 0, 0, 0); if (NtGdiCombineRgn(hRgn, UpdateRgn, NULL, RGN_COPY) == NULLREGION) { - REGION_FreeRgnByHandle(hRgn); + GreDeleteObject(hRgn); hRgn = NULL; } else @@ -595,7 +591,7 @@ co_UserRedrawWindow( if (hRgn != NULL) { - REGION_FreeRgnByHandle(hRgn); + GreDeleteObject(hRgn); } DPRINT("co_UserRedrawWindow exit\n"); @@ -825,10 +821,10 @@ NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* UnsafePs) Window->state &= ~WNDS_SENDNCPAINT; MsqDecPaintCountQueue(Window->head.pti->MessageQueue); co_IntSendMessage(hWnd, WM_NCPAINT, (WPARAM)hRgn, 0); - if (hRgn != (HANDLE)1 && hRgn != NULL) + if (hRgn != HRGN_WINDOW && hRgn != NULL && GreIsHandleValid(hRgn)) { /* NOTE: The region can already by deleted! */ - GDIOBJ_FreeObjByHandle(hRgn, GDI_OBJECT_TYPE_REGION | GDI_OBJECT_TYPE_SILENT); + GreDeleteObject(hRgn); } } @@ -860,10 +856,14 @@ NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* UnsafePs) Window->state &= ~WNDS_INTERNALPAINT; - if (Window->state & WNDS_ERASEBACKGROUND) + if (Window->state & WNDS_SENDERASEBACKGROUND) { - Window->state &= ~WNDS_ERASEBACKGROUND; + Window->state &= ~(WNDS_SENDERASEBACKGROUND|WNDS_ERASEBACKGROUND); Ps.fErase = !co_IntSendMessage(hWnd, WM_ERASEBKGND, (WPARAM)Ps.hdc, 0); + if ( Ps.fErase ) + { + Window->state |= (WNDS_SENDERASEBACKGROUND|WNDS_ERASEBACKGROUND); + } } else { @@ -1230,14 +1230,14 @@ UserScrollDC( could not be copied, because it was not visible */ if (hrgnUpdate || prcUpdate) { - HRGN hrgnOwn, hrgnVisible, hrgnTmp; + HRGN hrgnOwn, hrgnTmp; + PREGION prgnTmp; pDC = DC_LockDc(hDC); if (!pDC) { return FALSE; } - hrgnVisible = ((PROSRGNDATA)pDC->prgnVis)->BaseObject.hHmgr; // pDC->prgnRao? /* Begin with the shifted and then clipped scroll rect */ rcDst = rcScroll; @@ -1262,14 +1262,16 @@ UserScrollDC( NtGdiCombineRgn(hrgnOwn, hrgnOwn, hrgnTmp, RGN_OR); /* Substract the part of the dest that was visible in source */ - NtGdiCombineRgn(hrgnTmp, hrgnTmp, hrgnVisible, RGN_AND); + prgnTmp = RGNOBJAPI_Lock(hrgnTmp, NULL); + IntGdiCombineRgn(prgnTmp, prgnTmp, pDC->prgnVis, RGN_AND); + RGNOBJAPI_Unlock(prgnTmp); NtGdiOffsetRgn(hrgnTmp, dx, dy); Result = NtGdiCombineRgn(hrgnOwn, hrgnOwn, hrgnTmp, RGN_DIFF); /* DO NOT Unlock DC while messing with prgnVis! */ DC_UnlockDc(pDC); - REGION_FreeRgnByHandle(hrgnTmp); + GreDeleteObject(hrgnTmp); if (prcUpdate) { @@ -1278,7 +1280,7 @@ UserScrollDC( if (!hrgnUpdate) { - REGION_FreeRgnByHandle(hrgnOwn); + GreDeleteObject(hrgnOwn); } } else @@ -1491,9 +1493,9 @@ NtUserScrollWindowEx( NtGdiOffsetRgn(hrgnTemp, dx, dy); NtGdiCombineRgn(hrgnTemp, hrgnTemp, hrgnClip, RGN_AND); co_UserRedrawWindow(Window, NULL, hrgnTemp, RDW_INVALIDATE | RDW_ERASE); - REGION_FreeRgnByHandle(hrgnClip); + GreDeleteObject(hrgnClip); } - REGION_FreeRgnByHandle(hrgnTemp); + GreDeleteObject(hrgnTemp); if (flags & SW_SCROLLCHILDREN) { @@ -1566,7 +1568,7 @@ NtUserScrollWindowEx( CLEANUP: if (hrgnOwn && !hrgnUpdate) { - REGION_FreeRgnByHandle(hrgnOwn); + GreDeleteObject(hrgnOwn); } if (Window) diff --git a/subsystems/win32/win32k/ntuser/sysparams.c b/subsystems/win32/win32k/ntuser/sysparams.c index 518eb9955d5..c1ac0effdda 100644 --- a/subsystems/win32/win32k/ntuser/sysparams.c +++ b/subsystems/win32/win32k/ntuser/sysparams.c @@ -647,7 +647,7 @@ SpiSetWallpaper(PVOID pvParam, FLONG fl) SURFACE_ShareUnlockSurface(psurfBmp); /* Change the bitmap's ownership */ - GDIOBJ_SetOwnership(hbmp, NULL); + GreSetObjectOwner(hbmp, GDI_OBJ_HMGR_PUBLIC); /* Yes, Windows really loads the current setting from the registry. */ ulTile = SpiLoadInt(KEY_DESKTOP, L"TileWallpaper", 0); @@ -677,7 +677,7 @@ SpiSetWallpaper(PVOID pvParam, FLONG fl) if(hOldBitmap != NULL) { /* Delete the old wallpaper */ - GDIOBJ_SetOwnership(hOldBitmap, PsGetCurrentProcess()); + GreSetObjectOwner(hOldBitmap, GDI_OBJ_HMGR_POWNED); GreDeleteObject(hOldBitmap); } diff --git a/subsystems/win32/win32k/ntuser/vis.c b/subsystems/win32/win32k/ntuser/vis.c index 0bf5dc88e72..78939bd4025 100644 --- a/subsystems/win32/win32k/ntuser/vis.c +++ b/subsystems/win32/win32k/ntuser/vis.c @@ -69,25 +69,25 @@ VIS_ComputeVisibleRegion( CurrentWindow->state & WNDS_DESTROYED ) { DPRINT1("ATM the Current Window or Parent is dead!\n"); - if (VisRgn) REGION_FreeRgnByHandle(VisRgn); + if (VisRgn) GreDeleteObject(VisRgn); return NULL; } if (!(CurrentWindow->style & WS_VISIBLE)) { - if (VisRgn) REGION_FreeRgnByHandle(VisRgn); + if (VisRgn) GreDeleteObject(VisRgn); return NULL; } ClipRgn = IntSysCreateRectRgnIndirect(&CurrentWindow->rcClient); NtGdiCombineRgn(VisRgn, VisRgn, ClipRgn, RGN_AND); - REGION_FreeRgnByHandle(ClipRgn); + GreDeleteObject(ClipRgn); if ((PreviousWindow->style & WS_CLIPSIBLINGS) || (PreviousWindow == Wnd && ClipSiblings)) { CurrentSibling = CurrentWindow->spwndChild; - while ( CurrentSibling != NULL && + while ( CurrentSibling != NULL && CurrentSibling != PreviousWindow ) { if ((CurrentSibling->style & WS_VISIBLE) && @@ -102,7 +102,7 @@ VIS_ComputeVisibleRegion( NtGdiOffsetRgn(ClipRgn, CurrentSibling->rcWindow.left, CurrentSibling->rcWindow.top); } NtGdiCombineRgn(VisRgn, VisRgn, ClipRgn, RGN_DIFF); - REGION_FreeRgnByHandle(ClipRgn); + GreDeleteObject(ClipRgn); } CurrentSibling = CurrentSibling->spwndNext; } @@ -129,7 +129,7 @@ VIS_ComputeVisibleRegion( NtGdiOffsetRgn(ClipRgn, CurrentWindow->rcWindow.left, CurrentWindow->rcWindow.top); } NtGdiCombineRgn(VisRgn, VisRgn, ClipRgn, RGN_DIFF); - REGION_FreeRgnByHandle(ClipRgn); + GreDeleteObject(ClipRgn); } CurrentWindow = CurrentWindow->spwndNext; } @@ -172,7 +172,7 @@ co_VIS_WindowLayoutChanged( RDW_ALLCHILDREN); UserDerefObjectCo(Parent); } - REGION_FreeRgnByHandle(Temp); + GreDeleteObject(Temp); } /* EOF */ diff --git a/subsystems/win32/win32k/ntuser/windc.c b/subsystems/win32/win32k/ntuser/windc.c index 619f94b430a..5265ba24624 100644 --- a/subsystems/win32/win32k/ntuser/windc.c +++ b/subsystems/win32/win32k/ntuser/windc.c @@ -50,6 +50,7 @@ DceCreateDisplayDC(VOID) if (hDC && !defaultDCstate) // Ultra HAX! Dedicated to GvG! { // This is a cheesy way to do this. PDC dc = DC_LockDc ( hDC ); + ASSERT(dc); defaultDCstate = ExAllocatePoolWithTag(PagedPool, sizeof(DC), TAG_DC); RtlZeroMemory(defaultDCstate, sizeof(DC)); defaultDCstate->pdcattr = &defaultDCstate->dcattr; @@ -113,7 +114,7 @@ DceAllocDCE(PWND Window OPTIONAL, DCE_TYPE Type) else { DPRINT("FREE DCATTR!!!! NOT DCE_WINDOW_DC!!!!! hDC-> %x\n", pDce->hDC); - IntGdiSetDCOwnerEx( pDce->hDC, GDI_OBJ_HMGR_NONE, FALSE); + GreSetDCOwner(pDce->hDC, GDI_OBJ_HMGR_NONE); pDce->ptiOwner = NULL; } @@ -179,7 +180,7 @@ DceDeleteClipRgn(DCE* Dce) } else if (Dce->hrgnClip != NULL) { - GDIOBJ_FreeObjByHandle(Dce->hrgnClip, GDI_OBJECT_TYPE_REGION|GDI_OBJECT_TYPE_SILENT); + GreDeleteObject(Dce->hrgnClip); } Dce->hrgnClip = NULL; @@ -225,7 +226,7 @@ DceReleaseDC(DCE* dce, BOOL EndPaint) } dce->DCXFlags &= ~DCX_DCEBUSY; DPRINT("Exit!!!!! DCX_CACHE!!!!!! hDC-> %x \n", dce->hDC); - if (!IntGdiSetDCOwnerEx( dce->hDC, GDI_OBJ_HMGR_NONE, FALSE)) + if (!GreSetDCOwner(dce->hDC, GDI_OBJ_HMGR_NONE)) return 0; dce->ptiOwner = NULL; // Reset ownership. dce->ppiOwner = NULL; @@ -308,7 +309,7 @@ noparent: { if(hRgnVisible != NULL) { - REGION_FreeRgnByHandle(hRgnVisible); + GreDeleteObject(hRgnVisible); } hRgnVisible = IntSysCreateRectRgn(0, 0, 0, 0); } @@ -328,7 +329,7 @@ noparent: if (hRgnVisible != NULL) { - REGION_FreeRgnByHandle(hRgnVisible); + GreDeleteObject(hRgnVisible); } } @@ -521,7 +522,7 @@ UserGetDCEx(PWND Wnd OPTIONAL, HANDLE ClipRegion, ULONG Flags) return(NULL); } - if (!GDIOBJ_ValidateHandle(Dce->hDC, GDI_OBJECT_TYPE_DC)) + if (!GreIsHandleValid(Dce->hDC)) { DPRINT1("FIXME: Got DCE with invalid hDC! 0x%x\n", Dce->hDC); Dce->hDC = DceCreateDisplayDC(); @@ -568,7 +569,7 @@ UserGetDCEx(PWND Wnd OPTIONAL, HANDLE ClipRegion, ULONG Flags) if (Dce->hrgnClip != NULL) { DPRINT1("Should not be called!!\n"); - GDIOBJ_FreeObjByHandle(Dce->hrgnClip, GDI_OBJECT_TYPE_REGION|GDI_OBJECT_TYPE_SILENT); + GreDeleteObject(Dce->hrgnClip); Dce->hrgnClip = NULL; } Dce->hrgnClip = ClipRegion; @@ -582,7 +583,7 @@ UserGetDCEx(PWND Wnd OPTIONAL, HANDLE ClipRegion, ULONG Flags) { DPRINT("ENTER!!!!!! DCX_CACHE!!!!!! hDC-> %x\n", Dce->hDC); // Need to set ownership so Sync dcattr will work. - IntGdiSetDCOwnerEx( Dce->hDC, GDI_OBJ_HMGR_POWNED, FALSE); + GreSetDCOwner(Dce->hDC, GDI_OBJ_HMGR_POWNED); Dce->ptiOwner = GetW32ThreadInfo(); // Set the temp owning } @@ -621,13 +622,14 @@ DceFreeDCE(PDCE pdce, BOOLEAN Force) pdce->DCXFlags |= DCX_INDESTROY; - if (Force && !GDIOBJ_OwnedByCurrentProcess(pdce->hDC)) + if (Force && + GreGetObjectOwner(pdce->hDC) != GDI_OBJ_HMGR_POWNED) { DPRINT("Change ownership for DCE! -> %x\n" , pdce); // Note: Windows sets W32PF_OWNDCCLEANUP and moves on. - if (!IsObjectDead((HGDIOBJ) pdce->hDC)) + if (GreIsHandleValid(pdce->hDC)) { - DC_SetOwnership( pdce->hDC, PsGetCurrentProcess()); + GreSetDCOwner(pdce->hDC, GDI_OBJ_HMGR_POWNED); } else { @@ -637,15 +639,15 @@ DceFreeDCE(PDCE pdce, BOOLEAN Force) } else { - if (!GreGetObjectOwner(pdce->hDC, GDIObjType_DC_TYPE)) - DC_SetOwnership( pdce->hDC, PsGetCurrentProcess()); + if (GreGetObjectOwner(pdce->hDC) == GDI_OBJ_HMGR_PUBLIC) + GreSetDCOwner(pdce->hDC, GDI_OBJ_HMGR_POWNED); } if (!Hit) IntGdiDeleteDC(pdce->hDC, TRUE); if (pdce->hrgnClip && !(pdce->DCXFlags & DCX_KEEPCLIPRGN)) { - GDIOBJ_FreeObjByHandle(pdce->hrgnClip, GDI_OBJECT_TYPE_REGION|GDI_OBJECT_TYPE_SILENT); + GreDeleteObject(pdce->hrgnClip); pdce->hrgnClip = NULL; } @@ -712,7 +714,7 @@ DceFreeWindowDCE(PWND Window) pDCE->hwndCurrent = 0; DPRINT("POWNED DCE going Cheap!! DCX_CACHE!! hDC-> %x \n", pDCE->hDC); - if (!IntGdiSetDCOwnerEx( pDCE->hDC, GDI_OBJ_HMGR_NONE, FALSE)) + if (!GreSetDCOwner( pDCE->hDC, GDI_OBJ_HMGR_NONE)) { DPRINT1("Fail Owner Switch hDC-> %x \n", pDCE->hDC); break; @@ -837,7 +839,7 @@ DceResetActiveDCEs(PWND Window) } pLE = LEDce.Flink; pDCE = CONTAINING_RECORD(pLE, DCE, List); - if(!pDCE) return; // Another null test! + do { if(!pDCE) break; @@ -859,7 +861,7 @@ DceResetActiveDCEs(PWND Window) } } - if (!GDIOBJ_ValidateHandle(pDCE->hDC, GDI_OBJECT_TYPE_DC) || + if (!GreIsHandleValid(pDCE->hDC) || (dc = DC_LockDc(pDCE->hDC)) == NULL) { pLE = pDCE->List.Flink; diff --git a/subsystems/win32/win32k/ntuser/window.c b/subsystems/win32/win32k/ntuser/window.c index fe362174aa9..6fe58a5049f 100644 --- a/subsystems/win32/win32k/ntuser/window.c +++ b/subsystems/win32/win32k/ntuser/window.c @@ -101,18 +101,7 @@ PWND FASTCALL IntGetWindowObject(HWND hWnd) /* temp hack */ PWND FASTCALL UserGetWindowObject(HWND hWnd) { - PTHREADINFO ti; - PWND Window; - - if (PsGetCurrentProcess() != PsInitialSystemProcess) - { - ti = GetW32ThreadInfo(); - if (ti == NULL) - { - EngSetLastError(ERROR_ACCESS_DENIED); - return NULL; - } - } + PWND Window; if (!hWnd) { @@ -210,7 +199,7 @@ IntEnableWindow( HWND hWnd, BOOL bEnable ) } pWnd->style |= WS_DISABLED; } - + if (Update) { IntNotifyWinEvent(EVENT_OBJECT_STATECHANGE, pWnd, OBJID_WINDOW, CHILDID_SELF, 0); @@ -517,6 +506,7 @@ static LRESULT co_UserFreeWindow(PWND Window, if(Window->hrgnClip) { + IntGdiSetRegionOwner(Window->hrgnClip, GDI_OBJ_HMGR_POWNED); GreDeleteObject(Window->hrgnClip); Window->hrgnClip = NULL; } @@ -1554,7 +1544,15 @@ IntFixWindowCoordinates(CREATESTRUCTW* Cs, PWND ParentWindow, DWORD* dwShowMode) PRTL_USER_PROCESS_PARAMETERS ProcessParams; pMonitor = IntGetPrimaryMonitor(); - ASSERT(pMonitor); + + /* Check if we don't have a monitor attached yet */ + if(pMonitor == NULL) + { + Cs->x = Cs->y = 0; + Cs->cx = 800; + Cs->cy = 600; + return; + } ProcessParams = PsGetCurrentProcess()->Peb->ProcessParameters; @@ -1997,6 +1995,7 @@ co_UserCreateWindowEx(CREATESTRUCTW* Cs, hwndInsertAfter = HWND_TOP; UserRefObjectCo(Window, &Ref); + UserDereferenceObject(Window); ObDereferenceObject(WinSta); //// Check for a hook to eliminate overhead. //// @@ -2262,10 +2261,9 @@ cleanup: if (Window) { UserDerefObjectCo(Window); - UserDereferenceObject(Window); } if (ParentWindow) UserDerefObjectCo(ParentWindow); - + return ret; } @@ -3299,7 +3297,11 @@ NtUserSetShellWindowEx(HWND hwndShell, HWND hwndListView) WinStaObject->ShellListView = hwndListView; ti = GetW32ThreadInfo(); - if (ti->pDeskInfo) ti->pDeskInfo->hShellWindow = hwndShell; + if (ti->pDeskInfo) + { + ti->pDeskInfo->hShellWindow = hwndShell; + ti->pDeskInfo->ppiShellProcess = ti->ppi; + } UserDerefObjectCo(WndShell); diff --git a/subsystems/win32/win32k/ntuser/winpos.c b/subsystems/win32/win32k/ntuser/winpos.c index 7b9a6f6fa44..3e397d84827 100644 --- a/subsystems/win32/win32k/ntuser/winpos.c +++ b/subsystems/win32/win32k/ntuser/winpos.c @@ -1206,7 +1206,7 @@ co_WinPosSetWindowPos( { /* Nothing to copy, clean up */ RGNOBJAPI_Unlock(VisRgn); - REGION_FreeRgnByHandle(CopyRgn); + GreDeleteObject(CopyRgn); CopyRgn = NULL; } else if (OldWindowRect.left != NewWindowRect.left || @@ -1299,12 +1299,12 @@ co_WinPosSetWindowPos( RDW_ERASE | RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN); } } - REGION_FreeRgnByHandle(DirtyRgn); + GreDeleteObject(DirtyRgn); } if (CopyRgn != NULL) { - REGION_FreeRgnByHandle(CopyRgn); + GreDeleteObject(CopyRgn); } /* Expose what was covered before but not covered anymore */ @@ -1325,13 +1325,13 @@ co_WinPosSetWindowPos( { co_VIS_WindowLayoutChanged(Window, ExposedRgn); } - REGION_FreeRgnByHandle(ExposedRgn); - REGION_FreeRgnByHandle(VisBefore); + GreDeleteObject(ExposedRgn); + GreDeleteObject(VisBefore); } if (VisAfter != NULL) { - REGION_FreeRgnByHandle(VisAfter); + GreDeleteObject(VisAfter); } if (!(WinPos.flags & SWP_NOACTIVATE)) @@ -1421,7 +1421,7 @@ co_WinPosShowWindow(PWND Wnd, INT Cmd) // HRGN VisibleRgn; ASSERT_REFS_CO(Wnd); - + WasVisible = (Wnd->style & WS_VISIBLE) != 0; switch (Cmd) @@ -1640,7 +1640,7 @@ co_WinPosSearchChildren( UserDereferenceObject(ScopeWin); return NULL; } - + return ScopeWin; } @@ -1698,7 +1698,7 @@ IntDeferWindowPos( HDWP hdwp, SWP_HIDEWINDOW | SWP_FRAMECHANGED)) { EngSetLastError(ERROR_INVALID_PARAMETER); - return NULL; + return NULL; } if (!(pDWP = (PSMWP)UserGetObject(gHandleTable, hdwp, otSMWP))) @@ -1756,7 +1756,7 @@ IntDeferWindowPos( HDWP hdwp, pDWP->acvr[pDWP->ccvr].pos.cx = cx; pDWP->acvr[pDWP->ccvr].pos.cy = cy; pDWP->acvr[pDWP->ccvr].pos.flags = flags; - pDWP->acvr[pDWP->ccvr].hrgnClip = NULL; + pDWP->acvr[pDWP->ccvr].hrgnClip = NULL; pDWP->acvr[pDWP->ccvr].hrgnInterMonitor = NULL; pDWP->ccvr++; END: @@ -1917,7 +1917,7 @@ NtUserDeferWindowPos(HDWP WinPosInfo, if ( WndInsertAfter && WndInsertAfter != HWND_BOTTOM && - WndInsertAfter != HWND_TOPMOST && + WndInsertAfter != HWND_TOPMOST && WndInsertAfter != HWND_NOTOPMOST ) { pWndIA = UserGetWindowObject(WndInsertAfter); @@ -1934,7 +1934,7 @@ NtUserDeferWindowPos(HDWP WinPosInfo, Exit: DPRINT("Leave NtUserDeferWindowPos, ret=%i\n", Ret); UserLeave(); - return Ret; + return Ret; } /* @@ -1984,7 +1984,7 @@ NtUserSetWindowPos( if ( hWndInsertAfter && hWndInsertAfter != HWND_BOTTOM && - hWndInsertAfter != HWND_TOPMOST && + hWndInsertAfter != HWND_TOPMOST && hWndInsertAfter != HWND_NOTOPMOST ) { pWndIA = UserGetWindowObject(hWndInsertAfter); @@ -2051,7 +2051,7 @@ NtUserSetWindowRgn( if (hRgn) // The region will be deleted in user32. { - if (GDIOBJ_ValidateHandle(hRgn, GDI_OBJECT_TYPE_REGION)) + if (GreIsHandleValid(hRgn)) { hrgnCopy = IntSysCreateRectRgn(0, 0, 0, 0); @@ -2068,6 +2068,7 @@ NtUserSetWindowRgn( if (Window->hrgnClip) { /* Delete no longer needed region handle */ + IntGdiSetRegionOwner(Window->hrgnClip, GDI_OBJ_HMGR_POWNED); GreDeleteObject(Window->hrgnClip); } @@ -2198,7 +2199,7 @@ NtUserShowWindow(HWND hWnd, LONG nCmdShow) EngSetLastError(ERROR_INVALID_PARAMETER); RETURN(FALSE); } - + UserRefObjectCo(Window, &Ref); ret = co_WinPosShowWindow(Window, nCmdShow); UserDerefObjectCo(Window); diff --git a/subsystems/win32/win32k/ntuser/winsta.c b/subsystems/win32/win32k/ntuser/winsta.c index 2f44707b070..10150292b73 100644 --- a/subsystems/win32/win32k/ntuser/winsta.c +++ b/subsystems/win32/win32k/ntuser/winsta.c @@ -187,7 +187,7 @@ IntWinStaObjectParse(PWIN32_PARSEMETHOD_PARAMETERS Parameters) return STATUS_OBJECT_TYPE_MISMATCH; } -NTSTATUS NTAPI +NTSTATUS NTAPI IntWinstaOkToClose(PWIN32_OKAYTOCLOSEMETHOD_PARAMETERS Parameters) { PPROCESSINFO ppi; @@ -326,15 +326,15 @@ co_IntInitializeDesktopGraphics(VOID) IntDestroyPrimarySurface(); return FALSE; } - IntGdiSetDCOwnerEx(ScreenDeviceContext, GDI_OBJ_HMGR_PUBLIC, FALSE); + GreSetDCOwner(ScreenDeviceContext, GDI_OBJ_HMGR_PUBLIC); /* Setup the cursor */ co_IntLoadDefaultCursors(); hSystemBM = NtGdiCreateCompatibleDC(ScreenDeviceContext); - NtGdiSelectFont( hSystemBM, NtGdiGetStockObject(SYSTEM_FONT)); - IntGdiSetDCOwnerEx( hSystemBM, GDI_OBJ_HMGR_PUBLIC, FALSE); + NtGdiSelectFont(hSystemBM, NtGdiGetStockObject(SYSTEM_FONT)); + GreSetDCOwner(hSystemBM, GDI_OBJ_HMGR_PUBLIC); // FIXME! Move these to a update routine. gpsi->Planes = NtGdiGetDeviceCaps(ScreenDeviceContext, PLANES); @@ -353,8 +353,8 @@ IntEndDesktopGraphics(VOID) { if (NULL != ScreenDeviceContext) { // No need to allocate a new dcattr. - DC_SetOwnership(ScreenDeviceContext, PsGetCurrentProcess()); - NtGdiDeleteObjectApp(ScreenDeviceContext); + GreSetDCOwner(ScreenDeviceContext, GDI_OBJ_HMGR_POWNED); + GreDeleteObject(ScreenDeviceContext); ScreenDeviceContext = NULL; } IntHideDesktop(IntGetActiveDesktop()); @@ -438,7 +438,7 @@ NtUserCreateWindowStation( /* * No existing window station found, try to create new one */ - + /* Capture window station name */ _SEH2_TRY { @@ -621,7 +621,7 @@ NtUserCloseWindowStation( DPRINT("Closing window station handle (0x%X)\n", hWinSta); - Status = ZwClose(hWinSta); + Status = ObCloseHandle(hWinSta, UserMode); if (!NT_SUCCESS(Status)) { SetLastNtError(Status); @@ -940,6 +940,7 @@ UserSetProcessWindowStation(HWINSTA hWindowStation) ppi = PsGetCurrentProcessWin32Process(); + /* Reference the new window station */ if(hWindowStation !=NULL) { Status = IntValidateWindowStationHandle( hWindowStation, @@ -956,28 +957,29 @@ UserSetProcessWindowStation(HWINSTA hWindowStation) } OldWinSta = ppi->prpwinsta; - hwinstaOld = ppi->hwinsta; - - /* - * FIXME - don't allow changing the window station if there are threads that are attached to desktops and own gui objects - */ - - InterlockedExchangePointer(&PsGetCurrentProcess()->Win32WindowStation, hWindowStation); - - ppi->prpwinsta = NewWinSta; - ppi->hwinsta = hWindowStation; - + hwinstaOld = PsGetProcessWin32WindowStation(ppi->peProcess); + /* Dereference the previous window station */ if(OldWinSta != NULL) { ObDereferenceObject(OldWinSta); } - if(hwinstaOld != NULL) + /* Check if we have a stale handle (it should happen for console apps) */ + if(hwinstaOld != ppi->hwinsta) { - ZwClose(hwinstaOld); + ObCloseHandle(hwinstaOld, UserMode); } + /* + * FIXME - don't allow changing the window station if there are threads that are attached to desktops and own gui objects + */ + + PsSetProcessWindowStation(ppi->peProcess, hWindowStation); + + ppi->prpwinsta = NewWinSta; + ppi->hwinsta = hWindowStation; + return TRUE; } diff --git a/subsystems/win32/win32k/objects/arc.c b/subsystems/win32/win32k/objects/arc.c index 17d7f26d73e..eefccce1d62 100644 --- a/subsystems/win32/win32k/objects/arc.c +++ b/subsystems/win32/win32k/objects/arc.c @@ -46,7 +46,7 @@ IntArc( DC *dc, { PDC_ATTR pdcattr; RECTL RectBounds, RectSEpts; - PBRUSH pbrushPen; + PBRUSH pbrPen; SURFACE *psurf; BOOL ret = TRUE; LONG PenWidth, PenOrigWidth; @@ -71,18 +71,18 @@ IntArc( DC *dc, pdcattr = dc->pdcattr; - pbrushPen = PEN_LockPen(pdcattr->hpen); - if (!pbrushPen) + pbrPen = PEN_ShareLockPen(pdcattr->hpen); + if (!pbrPen) { DPRINT1("Arc Fail 1\n"); EngSetLastError(ERROR_INTERNAL_ERROR); return FALSE; } - PenOrigWidth = PenWidth = pbrushPen->ptPenWidth.x; - if (pbrushPen->ulPenStyle == PS_NULL) PenWidth = 0; + PenOrigWidth = PenWidth = pbrPen->ptPenWidth.x; + if (pbrPen->ulPenStyle == PS_NULL) PenWidth = 0; - if (pbrushPen->ulPenStyle == PS_INSIDEFRAME) + if (pbrPen->ulPenStyle == PS_INSIDEFRAME) { if (2*PenWidth > (Right - Left)) PenWidth = (Right -Left + 1)/2; if (2*PenWidth > (Bottom - Top)) PenWidth = (Bottom -Top + 1)/2; @@ -93,7 +93,7 @@ IntArc( DC *dc, } if (!PenWidth) PenWidth = 1; - pbrushPen->ptPenWidth.x = PenWidth; + pbrPen->ptPenWidth.x = PenWidth; RectBounds.left = Left; RectBounds.right = Right; @@ -156,13 +156,13 @@ IntArc( DC *dc, AngleStart, AngleEnd, arctype, - pbrushPen); + pbrPen); psurf = dc->dclevel.pSurface; if (NULL == psurf) { DPRINT1("Arc Fail 2\n"); - PEN_UnlockPen(pbrushPen); + PEN_ShareUnlockPen(pbrPen); EngSetLastError(ERROR_INTERNAL_ERROR); return FALSE; } @@ -175,8 +175,8 @@ IntArc( DC *dc, if (arctype == GdiTypeChord) PUTLINE(EfCx + CenterX, EfCy + CenterY, SfCx + CenterX, SfCy + CenterY, dc->eboLine); - pbrushPen->ptPenWidth.x = PenOrigWidth; - PEN_UnlockPen(pbrushPen); + pbrPen->ptPenWidth.x = PenOrigWidth; + PEN_ShareUnlockPen(pbrPen); DPRINT("IntArc Exit.\n"); return ret; } diff --git a/subsystems/win32/win32k/objects/bitblt.c b/subsystems/win32/win32k/objects/bitblt.c index 1fa1d550027..27444939482 100644 --- a/subsystems/win32/win32k/objects/bitblt.c +++ b/subsystems/win32/win32k/objects/bitblt.c @@ -64,23 +64,19 @@ NtGdiAlphaBlend( DPRINT("Locking DCs\n"); ahDC[0] = hDCDest; ahDC[1] = hDCSrc ; - GDIOBJ_LockMultipleObjs(2, ahDC, apObj); - DCDest = apObj[0]; - DCSrc = apObj[1]; - - if ((NULL == DCDest) || (NULL == DCSrc)) + 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); - if(DCSrc) GDIOBJ_UnlockObjByPtr(&DCSrc->BaseObject); - if(DCDest) GDIOBJ_UnlockObjByPtr(&DCDest->BaseObject); return FALSE; } + DCDest = apObj[0]; + DCSrc = apObj[1]; if (DCDest->dctype == DC_TYPE_INFO || DCDest->dctype == DCTYPE_INFO) { - GDIOBJ_UnlockObjByPtr(&DCSrc->BaseObject); - GDIOBJ_UnlockObjByPtr(&DCDest->BaseObject); + GDIOBJ_vUnlockObject(&DCSrc->BaseObject); + GDIOBJ_vUnlockObject(&DCDest->BaseObject); /* Yes, Windows really returns TRUE in this case */ return TRUE; } @@ -112,8 +108,8 @@ NtGdiAlphaBlend( !SourceRect.right || !SourceRect.bottom) { - GDIOBJ_UnlockObjByPtr(&DCSrc->BaseObject); - GDIOBJ_UnlockObjByPtr(&DCDest->BaseObject); + GDIOBJ_vUnlockObject(&DCSrc->BaseObject); + GDIOBJ_vUnlockObject(&DCDest->BaseObject); return TRUE; } @@ -153,8 +149,8 @@ NtGdiAlphaBlend( leave : DPRINT("Finishing blit\n"); DC_vFinishBlit(DCDest, DCSrc); - GDIOBJ_UnlockObjByPtr(&DCSrc->BaseObject); - GDIOBJ_UnlockObjByPtr(&DCDest->BaseObject); + GDIOBJ_vUnlockObject(&DCSrc->BaseObject); + GDIOBJ_vUnlockObject(&DCDest->BaseObject); return bResult; } @@ -216,23 +212,19 @@ NtGdiTransparentBlt( DPRINT("Locking DCs\n"); ahDC[0] = hdcDst; ahDC[1] = hdcSrc ; - GDIOBJ_LockMultipleObjs(2, ahDC, apObj); - DCDest = apObj[0]; - DCSrc = apObj[1]; - - if ((NULL == DCDest) || (NULL == DCSrc)) + 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); - if(DCSrc) GDIOBJ_UnlockObjByPtr(&DCSrc->BaseObject); - if(DCDest) GDIOBJ_UnlockObjByPtr(&DCDest->BaseObject); return FALSE; } + DCDest = apObj[0]; + DCSrc = apObj[1]; if (DCDest->dctype == DC_TYPE_INFO || DCDest->dctype == DCTYPE_INFO) { - GDIOBJ_UnlockObjByPtr(&DCSrc->BaseObject); - GDIOBJ_UnlockObjByPtr(&DCDest->BaseObject); + GDIOBJ_vUnlockObject(&DCSrc->BaseObject); + GDIOBJ_vUnlockObject(&DCDest->BaseObject); /* Yes, Windows really returns TRUE in this case */ return TRUE; } @@ -289,8 +281,8 @@ NtGdiTransparentBlt( done: DC_vFinishBlit(DCDest, DCSrc); - GDIOBJ_UnlockObjByPtr(&DCDest->BaseObject); - GDIOBJ_UnlockObjByPtr(&DCSrc->BaseObject); + GDIOBJ_vUnlockObject(&DCDest->BaseObject); + GDIOBJ_vUnlockObject(&DCSrc->BaseObject); return Ret; } @@ -330,11 +322,16 @@ NtGdiMaskBlt( 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_LockSurface(hbmMask); + psurfMask = SURFACE_ShareLockSurface(hbmMask); if(!psurfMask) { EngSetLastError(ERROR_INVALID_HANDLE); @@ -352,14 +349,14 @@ NtGdiMaskBlt( if(gajBitsPerFormat[psurfMask->SurfObj.iBitmapFormat] != 1) { EngSetLastError(ERROR_INVALID_PARAMETER); - SURFACE_UnlockSurface(psurfMask); + SURFACE_ShareUnlockSurface(psurfMask); return FALSE; } } else if(psurfMask) { DPRINT1("Getting Mask bitmap without needing it?\n"); - SURFACE_UnlockSurface(psurfMask); + SURFACE_ShareUnlockSurface(psurfMask); psurfMask = NULL; } MaskPoint.x = xMask; @@ -368,11 +365,17 @@ NtGdiMaskBlt( /* Take care of source and destination bitmap */ DPRINT("Locking DCs\n"); ahDC[0] = hdcDest; - ahDC[1] = hdcSrc ; - GDIOBJ_LockMultipleObjs(2, ahDC, apObj); + 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); @@ -390,12 +393,7 @@ NtGdiMaskBlt( if (UsesSource) { - if (NULL == DCSrc) - { - DC_UnlockDc(DCDest); - DPRINT("Invalid source dc handle (0x%08x) passed to NtGdiBitBlt\n", hdcSrc); - return FALSE; - } + ASSERT(DCSrc); if (DCSrc->dctype == DC_TYPE_INFO) { DC_UnlockDc(DCDest); @@ -404,12 +402,6 @@ NtGdiMaskBlt( return TRUE; } } - else if(DCSrc) - { - DPRINT("Getting a valid Source handle without using source!!!\n"); - DC_UnlockDc(DCSrc); - DCSrc = NULL ; - } pdcattr = DCDest->pdcattr; @@ -490,7 +482,7 @@ cleanup: DC_UnlockDc(DCSrc); } DC_UnlockDc(DCDest); - if(psurfMask) SURFACE_UnlockSurface(psurfMask); + if(psurfMask) SURFACE_ShareUnlockSurface(psurfMask); return Status; } @@ -547,9 +539,12 @@ GreStretchBltMask( EXLATEOBJ exlo; XLATEOBJ *XlateObj = NULL; POINTL BrushOrigin; - BOOL UsesSource = ROP_USES_SOURCE(ROP); + 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) { @@ -557,56 +552,45 @@ GreStretchBltMask( return FALSE; } - DPRINT("Locking DCs\n"); + if (!hDCDest || (UsesSource && !hDCSrc) || (UsesMask && !hDCMask)) + { + EngSetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + ahDC[0] = hDCDest; - ahDC[1] = hDCSrc ; - ahDC[2] = hDCMask ; - GDIOBJ_LockMultipleObjs(3, ahDC, apObj); + 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 (NULL == DCDest) - { - if(DCSrc) GDIOBJ_UnlockObjByPtr(&DCSrc->BaseObject); - if(DCMask) GDIOBJ_UnlockObjByPtr(&DCMask->BaseObject); - DPRINT("Invalid destination dc handle (0x%08x) passed to NtGdiBitBlt\n", hDCDest); - return FALSE; - } - if (DCDest->dctype == DC_TYPE_INFO) { - if(DCSrc) GDIOBJ_UnlockObjByPtr(&DCSrc->BaseObject); - if(DCMask) GDIOBJ_UnlockObjByPtr(&DCMask->BaseObject); - GDIOBJ_UnlockObjByPtr(&DCDest->BaseObject); + 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 (NULL == DCSrc) - { - GDIOBJ_UnlockObjByPtr(&DCDest->BaseObject); - if(DCMask) GDIOBJ_UnlockObjByPtr(&DCMask->BaseObject); - DPRINT("Invalid source dc handle (0x%08x) passed to NtGdiBitBlt\n", hDCSrc); - return FALSE; - } if (DCSrc->dctype == DC_TYPE_INFO) { - GDIOBJ_UnlockObjByPtr(&DCDest->BaseObject); - GDIOBJ_UnlockObjByPtr(&DCSrc->BaseObject); - if(DCMask) GDIOBJ_UnlockObjByPtr(&DCMask->BaseObject); + GDIOBJ_vUnlockObject(&DCDest->BaseObject); + GDIOBJ_vUnlockObject(&DCSrc->BaseObject); + if(DCMask) GDIOBJ_vUnlockObject(&DCMask->BaseObject); /* Yes, Windows really returns TRUE in this case */ return TRUE; } } - else if(DCSrc) - { - DPRINT1("Getting a valid Source handle without using source!!!\n"); - GDIOBJ_UnlockObjByPtr(&DCSrc->BaseObject); - DCSrc = NULL ; - } pdcattr = DCDest->pdcattr; @@ -867,7 +851,7 @@ IntGdiPolyPatBlt( for (i = 0; i < cRects; i++) { - pbrush = BRUSH_LockBrush(pRects->hBrush); + pbrush = BRUSH_ShareLockBrush(pRects->hBrush); if(pbrush != NULL) { IntPatBlt( @@ -878,7 +862,7 @@ IntGdiPolyPatBlt( pRects->r.bottom, dwRop, pbrush); - BRUSH_UnlockBrush(pbrush); + BRUSH_ShareUnlockBrush(pbrush); } pRects++; } @@ -928,7 +912,7 @@ NtGdiPatBlt( if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY)) DC_vUpdateFillBrush(dc); - pbrush = BRUSH_LockBrush(pdcattr->hbrush); + pbrush = BRUSH_ShareLockBrush(pdcattr->hbrush); if (pbrush == NULL) { EngSetLastError(ERROR_INVALID_HANDLE); @@ -938,7 +922,7 @@ NtGdiPatBlt( ret = IntPatBlt(dc, XLeft, YLeft, Width, Height, ROP, pbrush); - BRUSH_UnlockBrush(pbrush); + BRUSH_ShareUnlockBrush(pbrush); DC_UnlockDc(dc); return ret; diff --git a/subsystems/win32/win32k/objects/bitmaps.c b/subsystems/win32/win32k/objects/bitmaps.c index f99d1b4eab5..28dc28afb9a 100644 --- a/subsystems/win32/win32k/objects/bitmaps.c +++ b/subsystems/win32/win32k/objects/bitmaps.c @@ -114,7 +114,7 @@ GreCreateBitmapEx( if (!pvBits) { EngSetLastError(ERROR_NOT_ENOUGH_MEMORY); - SURFACE_FreeSurfaceByHandle(hbmp); + GDIOBJ_vDeleteObject(&psurf->BaseObject); return NULL; } DecompressBitmap(sizl, pvCompressedBits, pvBits, lDelta, iFormat); @@ -133,7 +133,7 @@ GreCreateBitmapEx( /* Bail out if that failed */ DPRINT1("SURFACE_bSetBitmapBits failed.\n"); EngSetLastError(ERROR_NOT_ENOUGH_MEMORY); - SURFACE_FreeSurfaceByHandle(hbmp); + GDIOBJ_vDeleteObject(&psurf->BaseObject); return NULL; } @@ -209,8 +209,7 @@ NtGdiCreateBitmap( } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { - SURFACE_UnlockSurface(psurf); - SURFACE_FreeSurfaceByHandle(hbmp); + GDIOBJ_vDeleteObject(&psurf->BaseObject); _SEH2_YIELD(return NULL;) } _SEH2_END @@ -274,7 +273,7 @@ IntCreateCompatibleBitmap( ASSERT(psurfBmp); /* Assign palette */ psurfBmp->ppal = psurf->ppal; - GDIOBJ_IncrementShareCount((POBJ)psurf->ppal); + GDIOBJ_vReferenceObjectByPointer((POBJ)psurf->ppal); /* Set flags */ psurfBmp->flags = API_BITMAP; psurfBmp->hdc = NULL; // Fixme @@ -316,7 +315,7 @@ IntCreateCompatibleBitmap( return 0; } - PalGDI = PALETTE_ShareLockPalette(psurf->ppal->BaseObject.hHmgr); + PalGDI = psurf->ppal; for (Index = 0; Index < 256 && Index < PalGDI->NumColors; @@ -327,7 +326,6 @@ IntCreateCompatibleBitmap( bi->bmiColors[Index].rgbBlue = PalGDI->IndexedColors[Index].peBlue; bi->bmiColors[Index].rgbReserved = 0; } - PALETTE_ShareUnlockPalette(PalGDI); } Bmp = DIB_CreateDIBSection(Dc, @@ -873,8 +871,8 @@ BITMAP_CopyBitmap(HBITMAP hBitmap) if (resBitmap) { IntSetBitmapBits(resBitmap, Bitmap->SurfObj.cjBits, Bitmap->SurfObj.pvBits); - GDIOBJ_IncrementShareCount(&Bitmap->ppal->BaseObject); - GDIOBJ_ShareUnlockObjByPtr(&resBitmap->ppal->BaseObject); + GDIOBJ_vReferenceObjectByPointer(&Bitmap->ppal->BaseObject); + GDIOBJ_vDereferenceObject(&resBitmap->ppal->BaseObject); resBitmap->ppal = Bitmap->ppal; SURFACE_ShareUnlockSurface(resBitmap); } diff --git a/subsystems/win32/win32k/objects/brush.c b/subsystems/win32/win32k/objects/brush.c index 72b7fd3864a..f72d7d1ddf7 100644 --- a/subsystems/win32/win32k/objects/brush.c +++ b/subsystems/win32/win32k/objects/brush.c @@ -35,180 +35,80 @@ static const ULONG HatchBrushes[NB_HATCH_STYLES][8] = {0x7E, 0xBD, 0xDB, 0xE7, 0xE7, 0xDB, 0xBD, 0x7E} /* HS_DIAGCROSS */ }; - -PVOID +BOOL FASTCALL -AllocateObjectAttr(VOID) +IntGdiSetBrushOwner(PBRUSH pbr, ULONG ulOwner) { - PTHREADINFO pti; - PPROCESSINFO ppi; - PVOID pAttr; - PGDI_OBJ_ATTR_FREELIST pGdiObjAttrFreeList; - PGDI_OBJ_ATTR_ENTRY pGdiObjAttrEntry; - int i; + // FIXME: + if (pbr->flAttrs & GDIBRUSH_IS_GLOBAL) return TRUE; - pti = PsGetCurrentThreadWin32Thread(); - if (pti->pgdiBrushAttr) - { - pAttr = pti->pgdiBrushAttr; // Get the free one. - pti->pgdiBrushAttr = NULL; - return pAttr; - } + if ((ulOwner == GDI_OBJ_HMGR_PUBLIC) || ulOwner == GDI_OBJ_HMGR_NONE) + { + // Deny user access to User Data. + GDIOBJ_vSetObjectAttr(&pbr->BaseObject, NULL); + // FIXME: deallocate brush attr + } - ppi = PsGetCurrentProcessWin32Process(); + if (ulOwner == GDI_OBJ_HMGR_POWNED) + { + // Allow user access to User Data. + GDIOBJ_vSetObjectAttr(&pbr->BaseObject, pbr->pBrushAttr); + // FIXME: allocate brush attr + } - if (!ppi->pBrushAttrList) // If set point is null, allocate new group. - { - pGdiObjAttrEntry = EngAllocUserMem(sizeof(GDI_OBJ_ATTR_ENTRY), 0); + GDIOBJ_vSetObjectOwner(&pbr->BaseObject, ulOwner); - if (!pGdiObjAttrEntry) - { - DPRINT1("Attr Failed User Allocation!\n"); - return NULL; - } - - DPRINT("AllocObjectAttr User 0x%x\n",pGdiObjAttrEntry); - - pGdiObjAttrFreeList = ExAllocatePoolWithTag( PagedPool, - sizeof(GDI_OBJ_ATTR_FREELIST), - GDITAG_BRUSH_FREELIST); - if ( !pGdiObjAttrFreeList ) - { - EngFreeUserMem(pGdiObjAttrEntry); - return NULL; - } - - RtlZeroMemory(pGdiObjAttrFreeList, sizeof(GDI_OBJ_ATTR_FREELIST)); - - DPRINT("AllocObjectAttr Ex 0x%x\n",pGdiObjAttrFreeList); - - InsertHeadList( &ppi->GDIBrushAttrFreeList, &pGdiObjAttrFreeList->Entry); - - pGdiObjAttrFreeList->nEntries = GDIOBJATTRFREE; - // Start at the bottom up and set end of free list point. - ppi->pBrushAttrList = &pGdiObjAttrEntry->Attr[GDIOBJATTRFREE-1]; - // Build the free attr list. - for ( i = 0; i < GDIOBJATTRFREE; i++) - { - pGdiObjAttrFreeList->AttrList[i] = &pGdiObjAttrEntry->Attr[i]; - } - } - - pAttr = ppi->pBrushAttrList; - pGdiObjAttrFreeList = (PGDI_OBJ_ATTR_FREELIST)ppi->GDIBrushAttrFreeList.Flink; - - // Free the list when it is full! - if ( pGdiObjAttrFreeList->nEntries-- == 1) - { // No more free entries, so yank the list. - RemoveEntryList( &pGdiObjAttrFreeList->Entry ); - - ExFreePoolWithTag( pGdiObjAttrFreeList, GDITAG_BRUSH_FREELIST ); - - if ( IsListEmpty( &ppi->GDIBrushAttrFreeList ) ) - { - ppi->pBrushAttrList = NULL; - return pAttr; - } - - pGdiObjAttrFreeList = (PGDI_OBJ_ATTR_FREELIST)ppi->GDIBrushAttrFreeList.Flink; - } - - ppi->pBrushAttrList = pGdiObjAttrFreeList->AttrList[pGdiObjAttrFreeList->nEntries-1]; - - return pAttr; -} - -VOID -FASTCALL -FreeObjectAttr(PVOID pAttr) -{ - PTHREADINFO pti; - PPROCESSINFO ppi; - PGDI_OBJ_ATTR_FREELIST pGdiObjAttrFreeList; - - pti = PsGetCurrentThreadWin32Thread(); - - if (!pti) return; - - if (!pti->pgdiBrushAttr) - { // If it is null, just cache it for the next time. - pti->pgdiBrushAttr = pAttr; - return; - } - - ppi = PsGetCurrentProcessWin32Process(); - - pGdiObjAttrFreeList = (PGDI_OBJ_ATTR_FREELIST)ppi->GDIBrushAttrFreeList.Flink; - - // We add to the list of free entries, so this will grows! - if ( IsListEmpty(&ppi->GDIBrushAttrFreeList) || - pGdiObjAttrFreeList->nEntries == GDIOBJATTRFREE ) - { - pGdiObjAttrFreeList = ExAllocatePoolWithTag( PagedPool, - sizeof(GDI_OBJ_ATTR_FREELIST), - GDITAG_BRUSH_FREELIST); - if ( !pGdiObjAttrFreeList ) - { - return; - } - InsertHeadList( &ppi->GDIBrushAttrFreeList, &pGdiObjAttrFreeList->Entry); - pGdiObjAttrFreeList->nEntries = 0; - } - // Up count, save the entry and set end of free list point. - ++pGdiObjAttrFreeList->nEntries; // Top Down... - pGdiObjAttrFreeList->AttrList[pGdiObjAttrFreeList->nEntries-1] = pAttr; - ppi->pBrushAttrList = pAttr; - - return; + return TRUE; } BOOL -FASTCALL -IntGdiSetBrushOwner(PBRUSH pbr, DWORD OwnerMask) +NTAPI +BRUSH_bAllocBrushAttr(PBRUSH pbr) { - HBRUSH hBR; - PEPROCESS Owner = NULL; - PGDI_TABLE_ENTRY pEntry = NULL; + PPROCESSINFO ppi; + BRUSH_ATTR *pBrushAttr; - if (!pbr) return FALSE; + ppi = PsGetCurrentProcessWin32Process(); + ASSERT(ppi); - hBR = pbr->BaseObject.hHmgr; - - if (!hBR || (GDI_HANDLE_GET_TYPE(hBR) != GDI_OBJECT_TYPE_BRUSH)) - return FALSE; - else - { - INT Index = GDI_HANDLE_GET_INDEX((HGDIOBJ)hBR); - pEntry = &GdiHandleTable->Entries[Index]; - } - - if (pbr->flAttrs & GDIBRUSH_IS_GLOBAL) - { - GDIOBJ_ShareUnlockObjByPtr((POBJ)pbr); - return TRUE; - } - - if ((OwnerMask == GDI_OBJ_HMGR_PUBLIC) || OwnerMask == GDI_OBJ_HMGR_NONE) - { - // Set this Brush to inaccessible mode and to an Owner of NONE. -// if (OwnerMask == GDI_OBJ_HMGR_NONE) Owner = OwnerMask; - - if (!GDIOBJ_SetOwnership((HGDIOBJ) hBR, Owner)) + pBrushAttr = GdiPoolAllocate(ppi->pPoolDcAttr); + if (!pBrushAttr) + { + DPRINT1("Could not allocate brush attr\n"); return FALSE; + } - // Deny user access to User Data. - pEntry->UserData = NULL; // This hBR is inaccessible! - } + /* Copy the content from the kernel mode dc attr */ + pbr->pBrushAttr = pBrushAttr; + *pbr->pBrushAttr = pbr->BrushAttr; - if (OwnerMask == GDI_OBJ_HMGR_POWNED) - { - if (!GDIOBJ_SetOwnership((HGDIOBJ) hBR, PsGetCurrentProcess() )) - return FALSE; + /* Set the object attribute in the handle table */ + GDIOBJ_vSetObjectAttr(&pbr->BaseObject, pBrushAttr); - // Allow user access to User Data. - pEntry->UserData = pbr->pBrushAttr; - } - return TRUE; + DPRINT("BRUSH_bAllocBrushAttr: pbr=%p, pbr->pdcattr=%p\n", pbr, pbr->pBrushAttr); + return TRUE; +} + + +VOID +NTAPI +BRUSH_vFreeBrushAttr(PBRUSH pbr) +{ +#if 0 + PPROCESSINFO ppi; + + if (pbrush->pBrushAttr == &pbrush->BrushAttr) return; + + /* Reset the object attribute in the handle table */ + GDIOBJ_vSetObjectAttr(&pbr->BaseObject, NULL); + + /* Free memory from the process gdi pool */ + ppi = PsGetCurrentProcessWin32Process(); + ASSERT(ppi); + GdiPoolFree(ppi->pPoolBrushAttr, pbr->pBrushAttr); +#endif + /* Reset to kmode brush attribute */ + pbr->pBrushAttr = &pbr->BrushAttr; } BOOL @@ -219,10 +119,16 @@ BRUSH_Cleanup(PVOID ObjectBody) if (pbrush->flAttrs & (GDIBRUSH_IS_HATCH | GDIBRUSH_IS_BITMAP)) { ASSERT(pbrush->hbmPattern); - GDIOBJ_SetOwnership(pbrush->hbmPattern, PsGetCurrentProcess()); + GreSetObjectOwner(pbrush->hbmPattern, GDI_OBJ_HMGR_POWNED); GreDeleteObject(pbrush->hbmPattern); } + /* Check if there is a usermode attribute */ + if (pbrush->pBrushAttr != &pbrush->BrushAttr) + { + BRUSH_vFreeBrushAttr(pbrush); + } + /* Free the kmode styles array of EXTPENS */ if (pbrush->pStyle) { @@ -339,9 +245,9 @@ IntGdiCreateDIBBrush( pbrush->hbmPattern = hPattern; /* FIXME: Fill in the rest of fields!!! */ - GDIOBJ_SetOwnership(hPattern, NULL); + GreSetObjectOwner(hPattern, GDI_OBJ_HMGR_PUBLIC); - BRUSH_UnlockBrush(pbrush); + GDIOBJ_vUnlockObject(&pbrush->BaseObject); return hBrush; } @@ -381,9 +287,9 @@ IntGdiCreateHatchBrush( pbrush->hbmPattern = hPattern; pbrush->BrushAttr.lbColor = Color & 0xFFFFFF; - GDIOBJ_SetOwnership(hPattern, NULL); + GreSetObjectOwner(hPattern, GDI_OBJ_HMGR_PUBLIC); - BRUSH_UnlockBrush(pbrush); + GDIOBJ_vUnlockObject(&pbrush->BaseObject); return hBrush; } @@ -417,9 +323,9 @@ IntGdiCreatePatternBrush( pbrush->hbmPattern = hPattern; /* FIXME: Fill in the rest of fields!!! */ - GDIOBJ_SetOwnership(hPattern, NULL); + GreSetObjectOwner(hPattern, GDI_OBJ_HMGR_PUBLIC); - BRUSH_UnlockBrush(pbrush); + GDIOBJ_vUnlockObject(&pbrush->BaseObject); return hBrush; } @@ -445,7 +351,7 @@ IntGdiCreateSolidBrush( pbrush->BrushAttr.lbColor = Color & 0x00FFFFFF; /* FIXME: Fill in the rest of fields!!! */ - BRUSH_UnlockBrush(pbrush); + GDIOBJ_vUnlockObject(&pbrush->BaseObject); return hBrush; } @@ -466,7 +372,7 @@ IntGdiCreateNullBrush(VOID) hBrush = pbrush->BaseObject.hHmgr; pbrush->flAttrs |= GDIBRUSH_IS_NULL; - BRUSH_UnlockBrush(pbrush); + GDIOBJ_vUnlockObject(&pbrush->BaseObject); return hBrush; } @@ -477,12 +383,12 @@ IntGdiSetSolidBrushColor(HBRUSH hBrush, COLORREF Color) { PBRUSH pbrush; - pbrush = BRUSH_LockBrush(hBrush); + pbrush = BRUSH_ShareLockBrush(hBrush); if (pbrush->flAttrs & GDIBRUSH_IS_SOLID) { pbrush->BrushAttr.lbColor = Color & 0xFFFFFF; } - BRUSH_UnlockBrush(pbrush); + BRUSH_ShareUnlockBrush(pbrush); } diff --git a/subsystems/win32/win32k/objects/cliprgn.c b/subsystems/win32/win32k/objects/cliprgn.c index bfe5248d10e..532d766a040 100644 --- a/subsystems/win32/win32k/objects/cliprgn.c +++ b/subsystems/win32/win32k/objects/cliprgn.c @@ -27,6 +27,7 @@ CLIPPING_UpdateGCRegion(DC* Dc) { PROSRGNDATA CombinedRegion; HRGN hRgnVis; + PREGION prgnClip, prgnGCClip; // would prefer this, but the rest of the code sucks // ASSERT(Dc->rosdc.hGCClipRgn); @@ -37,10 +38,18 @@ CLIPPING_UpdateGCRegion(DC* Dc) if (Dc->rosdc.hGCClipRgn == NULL) Dc->rosdc.hGCClipRgn = IntSysCreateRectRgn(0, 0, 0, 0); + prgnGCClip = REGION_LockRgn(Dc->rosdc.hGCClipRgn); + ASSERT(prgnGCClip); + if (Dc->rosdc.hClipRgn == NULL) - NtGdiCombineRgn(Dc->rosdc.hGCClipRgn, hRgnVis, 0, RGN_COPY); + IntGdiCombineRgn(prgnGCClip, Dc->prgnVis, NULL, RGN_COPY); else - NtGdiCombineRgn(Dc->rosdc.hGCClipRgn, Dc->rosdc.hClipRgn, hRgnVis, RGN_AND); + { + prgnClip = REGION_LockRgn(Dc->rosdc.hClipRgn); // FIXME: locking order, ugh + IntGdiCombineRgn(prgnGCClip, Dc->prgnVis, prgnClip, RGN_AND); + REGION_UnlockRgn(prgnClip); + } + REGION_UnlockRgn(prgnGCClip); NtGdiOffsetRgn(Dc->rosdc.hGCClipRgn, Dc->ptlDCOrig.x, Dc->ptlDCOrig.y); @@ -74,6 +83,7 @@ GdiSelectVisRgn(HDC hdc, HRGN hrgn) { int retval; DC *dc; + PREGION prgn; if (!hrgn) { @@ -90,10 +100,12 @@ GdiSelectVisRgn(HDC hdc, HRGN hrgn) ASSERT (dc->prgnVis != NULL); - retval = NtGdiCombineRgn(dc->prgnVis->BaseObject.hHmgr, hrgn, 0, RGN_COPY); + prgn = RGNOBJAPI_Lock(hrgn, NULL); + retval = prgn ? IntGdiCombineRgn(dc->prgnVis, prgn, NULL, RGN_COPY) : ERROR; + RGNOBJAPI_Unlock(prgn); if ( retval != ERROR ) { - NtGdiOffsetRgn(dc->prgnVis->BaseObject.hHmgr, -dc->ptlDCOrig.x, -dc->ptlDCOrig.y); + IntGdiOffsetRgn(dc->prgnVis, -dc->ptlDCOrig.x, -dc->ptlDCOrig.y); CLIPPING_UpdateGCRegion(dc); } DC_UnlockDc(dc); @@ -114,7 +126,7 @@ int FASTCALL GdiExtSelectClipRgn(PDC dc, { if (dc->rosdc.hClipRgn != NULL) { - REGION_FreeRgnByHandle(dc->rosdc.hClipRgn); + GreDeleteObject(dc->rosdc.hClipRgn); dc->rosdc.hClipRgn = NULL; } } @@ -213,7 +225,7 @@ GdiGetClipBox(HDC hDC, PRECTL rc) retval = REGION_GetRgnBox(pRgnNew, rc); - REGION_FreeRgnByHandle(pRgnNew->BaseObject.hHmgr); + REGION_Delete(pRgnNew); DC_UnlockDc(dc); if(Unlock) REGION_UnlockRgn(pRgn); @@ -266,7 +278,7 @@ int APIENTRY NtGdiExcludeClipRect(HDC hDC, { INT Result; RECTL Rect; - HRGN NewRgn; + PREGION prgnNew, prgnClip; PDC dc = DC_LockDc(hDC); if (!dc) @@ -282,8 +294,8 @@ int APIENTRY NtGdiExcludeClipRect(HDC hDC, IntLPtoDP(dc, (LPPOINT)&Rect, 2); - NewRgn = IntSysCreateRectRgnIndirect(&Rect); - if (!NewRgn) + prgnNew = IntSysCreateRectpRgnIndirect(&Rect); + if (!prgnNew) { Result = ERROR; } @@ -292,14 +304,18 @@ int APIENTRY NtGdiExcludeClipRect(HDC hDC, if (!dc->rosdc.hClipRgn) { dc->rosdc.hClipRgn = IntSysCreateRectRgn(0, 0, 0, 0); - NtGdiCombineRgn(dc->rosdc.hClipRgn, dc->prgnVis->BaseObject.hHmgr, NewRgn, RGN_DIFF); + prgnClip = REGION_LockRgn(dc->rosdc.hClipRgn); + IntGdiCombineRgn(prgnClip, dc->prgnVis, prgnNew, RGN_DIFF); + REGION_UnlockRgn(prgnClip); Result = SIMPLEREGION; } else { - Result = NtGdiCombineRgn(dc->rosdc.hClipRgn, dc->rosdc.hClipRgn, NewRgn, RGN_DIFF); + prgnClip = REGION_LockRgn(dc->rosdc.hClipRgn); + Result = IntGdiCombineRgn(prgnClip, prgnClip, prgnNew, RGN_DIFF); + REGION_UnlockRgn(prgnClip); } - REGION_FreeRgnByHandle(NewRgn); + REGION_Delete(prgnNew); } if (Result != ERROR) CLIPPING_UpdateGCRegion(dc); @@ -349,7 +365,7 @@ int APIENTRY NtGdiIntersectClipRect(HDC hDC, else { Result = NtGdiCombineRgn(dc->rosdc.hClipRgn, dc->rosdc.hClipRgn, NewRgn, RGN_AND); - REGION_FreeRgnByHandle(NewRgn); + GreDeleteObject(NewRgn); } if (Result != ERROR) CLIPPING_UpdateGCRegion(dc); @@ -476,13 +492,13 @@ IntGdiSetMetaRgn(PDC pDC) RGN_AND); if ( Ret ) { - GDIOBJ_ShareUnlockObjByPtr(&pDC->dclevel.prgnMeta->BaseObject); + GDIOBJ_vDereferenceObject(&pDC->dclevel.prgnMeta->BaseObject); if (!((PROSRGNDATA)pDC->dclevel.prgnMeta)->BaseObject.ulShareCount) REGION_Delete(pDC->dclevel.prgnMeta); pDC->dclevel.prgnMeta = TempRgn; - GDIOBJ_ShareUnlockObjByPtr(&pDC->dclevel.prgnClip->BaseObject); + GDIOBJ_vDereferenceObject(&pDC->dclevel.prgnClip->BaseObject); if (!((PROSRGNDATA)pDC->dclevel.prgnClip)->BaseObject.ulShareCount) REGION_Delete(pDC->dclevel.prgnClip); diff --git a/subsystems/win32/win32k/objects/dcattr.c b/subsystems/win32/win32k/objects/dcattr.c index 93673c77717..726fd0a86db 100644 --- a/subsystems/win32/win32k/objects/dcattr.c +++ b/subsystems/win32/win32k/objects/dcattr.c @@ -1,4 +1,4 @@ -/* +/* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel * PURPOSE: Functions for creation and destruction of DCs @@ -26,188 +26,39 @@ typedef struct _GDI_DC_ATTR_ENTRY } GDI_DC_ATTR_ENTRY, *PGDI_DC_ATTR_ENTRY; -PDC_ATTR -FASTCALL -AllocateDcAttr(VOID) -{ - PTHREADINFO pti; - PPROCESSINFO ppi; - PDC_ATTR pDc_Attr; - PGDI_DC_ATTR_FREELIST pGdiDcAttrFreeList; - PGDI_DC_ATTR_ENTRY pGdiDcAttrEntry; - int i; - - pti = PsGetCurrentThreadWin32Thread(); - if (pti->pgdiDcattr) - { - pDc_Attr = pti->pgdiDcattr; // Get the free one. - pti->pgdiDcattr = NULL; - return pDc_Attr; - } - - ppi = PsGetCurrentProcessWin32Process(); - - if (!ppi->pDCAttrList) // If set point is null, allocate new group. - { - pGdiDcAttrEntry = EngAllocUserMem(sizeof(GDI_DC_ATTR_ENTRY), 0); - - if (!pGdiDcAttrEntry) - { - DPRINT1("DcAttr Failed User Allocation!\n"); - return NULL; - } - - DPRINT("AllocDcAttr User 0x%x\n",pGdiDcAttrEntry); - - pGdiDcAttrFreeList = ExAllocatePoolWithTag( PagedPool, - sizeof(GDI_DC_ATTR_FREELIST), - GDITAG_DC_FREELIST); - if ( !pGdiDcAttrFreeList ) - { - EngFreeUserMem(pGdiDcAttrEntry); - return NULL; - } - - RtlZeroMemory(pGdiDcAttrFreeList, sizeof(GDI_DC_ATTR_FREELIST)); - - DPRINT("AllocDcAttr Ex 0x%x\n",pGdiDcAttrFreeList); - - InsertHeadList( &ppi->GDIDcAttrFreeList, &pGdiDcAttrFreeList->Entry); - - pGdiDcAttrFreeList->nEntries = GDIDCATTRFREE; - // Start at the bottom up and set end of free list point. - ppi->pDCAttrList = &pGdiDcAttrEntry->Attr[GDIDCATTRFREE-1]; - // Build the free attr list. - for ( i = 0; i < GDIDCATTRFREE; i++) - { - pGdiDcAttrFreeList->AttrList[i] = &pGdiDcAttrEntry->Attr[i]; - } - } - - pDc_Attr = ppi->pDCAttrList; - pGdiDcAttrFreeList = (PGDI_DC_ATTR_FREELIST)ppi->GDIDcAttrFreeList.Flink; - - // Free the list when it is full! - if ( pGdiDcAttrFreeList->nEntries-- == 1) - { // No more free entries, so yank the list. - RemoveEntryList( &pGdiDcAttrFreeList->Entry ); - - ExFreePoolWithTag( pGdiDcAttrFreeList, GDITAG_DC_FREELIST ); - - if ( IsListEmpty( &ppi->GDIDcAttrFreeList ) ) - { - ppi->pDCAttrList = NULL; - return pDc_Attr; - } - - pGdiDcAttrFreeList = (PGDI_DC_ATTR_FREELIST)ppi->GDIDcAttrFreeList.Flink; - } - - ppi->pDCAttrList = pGdiDcAttrFreeList->AttrList[pGdiDcAttrFreeList->nEntries-1]; - - return pDc_Attr; -} - -VOID -FASTCALL -FreeDcAttr(PDC_ATTR pDc_Attr) -{ - PTHREADINFO pti; - PPROCESSINFO ppi; - PGDI_DC_ATTR_FREELIST pGdiDcAttrFreeList; - - pti = PsGetCurrentThreadWin32Thread(); - - if (!pti) return; - - if (!pti->pgdiDcattr) - { // If it is null, just cache it for the next time. - pti->pgdiDcattr = pDc_Attr; - return; - } - - ppi = PsGetCurrentProcessWin32Process(); - - pGdiDcAttrFreeList = (PGDI_DC_ATTR_FREELIST)ppi->GDIDcAttrFreeList.Flink; - - // We add to the list of free entries, so this will grows! - if ( IsListEmpty(&ppi->GDIDcAttrFreeList) || - pGdiDcAttrFreeList->nEntries == GDIDCATTRFREE ) - { - pGdiDcAttrFreeList = ExAllocatePoolWithTag( PagedPool, - sizeof(GDI_DC_ATTR_FREELIST), - GDITAG_DC_FREELIST); - if ( !pGdiDcAttrFreeList ) - { - return; - } - InsertHeadList( &ppi->GDIDcAttrFreeList, &pGdiDcAttrFreeList->Entry); - pGdiDcAttrFreeList->nEntries = 0; - } - // Up count, save the entry and set end of free list point. - ++pGdiDcAttrFreeList->nEntries; // Top Down... - pGdiDcAttrFreeList->AttrList[pGdiDcAttrFreeList->nEntries-1] = pDc_Attr; - ppi->pDCAttrList = pDc_Attr; - - return; -} - BOOL -FASTCALL -DC_AllocDcAttr(PDC pdc) +NTAPI +DC_bAllocDcAttr(PDC pdc) { - DC_AllocateDcAttr(pdc->BaseObject.hHmgr); + PPROCESSINFO ppi; + PDC_ATTR pdcattr; + + ppi = PsGetCurrentProcessWin32Process(); + ASSERT(ppi); + + pdcattr = GdiPoolAllocate(ppi->pPoolDcAttr); + if (!pdcattr) + { + DPRINT1("Could not allocate DC attr\n"); + return FALSE; + } + + /* Copy the content from the kernel mode dc attr */ + pdc->pdcattr = pdcattr; *pdc->pdcattr = pdc->dcattr; + + /* Set the object attribute in the handle table */ + GDIOBJ_vSetObjectAttr(&pdc->BaseObject, pdcattr); + + DPRINT("DC_AllocDcAttr: pdc=%p, pdc->pdcattr=%p\n", pdc, pdc->pdcattr); return TRUE; } -// CHECK against current head -VOID -FASTCALL -DC_AllocateDcAttr(HDC hDC) -{ - PVOID NewMem = NULL; - PDC pDC; - HANDLE Pid = NtCurrentProcess(); - ULONG MemSize = sizeof(DC_ATTR); //PAGE_SIZE it will allocate that size - - NTSTATUS Status = ZwAllocateVirtualMemory(Pid, - &NewMem, - 0, - &MemSize, - MEM_COMMIT|MEM_RESERVE, - PAGE_READWRITE); - { - INT Index = GDI_HANDLE_GET_INDEX((HGDIOBJ)hDC); - PGDI_TABLE_ENTRY Entry = &GdiHandleTable->Entries[Index]; - // FIXME: dc could have been deleted!!! use GDIOBJ_InsertUserData - if (NT_SUCCESS(Status)) - { - RtlZeroMemory(NewMem, MemSize); - Entry->UserData = NewMem; - DPRINT("DC_ATTR allocated! 0x%x\n",NewMem); - } - else - { - DPRINT("DC_ATTR not allocated!\n"); - } - } - pDC = DC_LockDc(hDC); - ASSERT(pDC->pdcattr == &pDC->dcattr); - if(NewMem) - { - pDC->pdcattr = NewMem; // Store pointer - } - DC_UnlockDc(pDC); -} - VOID NTAPI DC_vFreeDcAttr(PDC pdc) { - HANDLE Pid = NtCurrentProcess(); - INT Index; - PGDI_TABLE_ENTRY pent; + PPROCESSINFO ppi; if (pdc->pdcattr == &pdc->dcattr) { @@ -215,69 +66,13 @@ DC_vFreeDcAttr(PDC pdc) return; } + /* Reset the object attribute in the handle table */ + GDIOBJ_vSetObjectAttr(&pdc->BaseObject, NULL); + + ppi = PsGetCurrentProcessWin32Process(); + ASSERT(ppi); + GdiPoolFree(ppi->pPoolDcAttr, pdc->pdcattr); + + /* Reset to kmode dcattr */ pdc->pdcattr = &pdc->dcattr; - - Index = GDI_HANDLE_GET_INDEX(pdc->BaseObject.hHmgr); - pent = &GdiHandleTable->Entries[Index]; - if(pent->UserData) - { - ULONG MemSize = sizeof(DC_ATTR); - NTSTATUS Status = ZwFreeVirtualMemory(Pid, - &pent->UserData, - &MemSize, - MEM_RELEASE); - if (!NT_SUCCESS(Status)) - { - DPRINT1("DC_FreeDC failed to free DC_ATTR 0x%p\n", pent->UserData); - ASSERT(FALSE); - } - pent->UserData = NULL; - } } - - -static -VOID -CopytoUserDcAttr(PDC dc, PDC_ATTR pdcattr) -{ - dc->dcattr.mxWorldToDevice = dc->dclevel.mxWorldToDevice; - dc->dcattr.mxDeviceToWorld = dc->dclevel.mxDeviceToWorld; - dc->dcattr.mxWorldToPage = dc->dclevel.mxWorldToPage; - - _SEH2_TRY - { - ProbeForWrite(pdcattr, sizeof(DC_ATTR), 1); - RtlCopyMemory(pdcattr, &dc->dcattr, sizeof(DC_ATTR)); - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - ASSERT(FALSE); - } - _SEH2_END; -} - -// FIXME: wtf? 2 functions, where one has a typo in the name???? -BOOL -FASTCALL -DCU_SyncDcAttrtoUser(PDC dc) -{ - PDC_ATTR pdcattr = dc->pdcattr; - - if (pdcattr == &dc->dcattr) return TRUE; // No need to copy self. - ASSERT(pdcattr); - CopytoUserDcAttr( dc, pdcattr); - return TRUE; -} -// LOL! DCU_ Sync hDc Attr to User,,, need it speeled out for you? -BOOL -FASTCALL -DCU_SynchDcAttrtoUser(HDC hDC) -{ - BOOL Ret; - PDC pDC = DC_LockDc ( hDC ); - if (!pDC) return FALSE; - Ret = DCU_SyncDcAttrtoUser(pDC); - DC_UnlockDc( pDC ); - return Ret; -} - diff --git a/subsystems/win32/win32k/objects/dclife.c b/subsystems/win32/win32k/objects/dclife.c index d0c86c88c3a..6b66f8c632d 100644 --- a/subsystems/win32/win32k/objects/dclife.c +++ b/subsystems/win32/win32k/objects/dclife.c @@ -80,7 +80,22 @@ NTAPI DC_AllocDcWithHandle() { PDC pdc; - pdc = (PDC)GDIOBJ_AllocObjWithHandle(GDILoObjType_LO_DC_TYPE); + + pdc = (PDC)GDIOBJ_AllocateObject(GDIObjType_DC_TYPE, + sizeof(DC), + BASEFLAG_LOOKASIDE); + if (!pdc) + { + DPRINT1("Could not allocate a DC.\n"); + return NULL; + } + + if (!GDIOBJ_hInsertObject(&pdc->BaseObject, GDI_OBJ_HMGR_POWNED)) + { + DPRINT1("Could not insert DC into handle table.\n"); + GDIOBJ_vFreeObject(&pdc->BaseObject); + return NULL; + } pdc->pdcattr = &pdc->dcattr; @@ -232,7 +247,6 @@ DC_vInitDc( /* Allocate a Vis region */ pdc->prgnVis = IntSysCreateRectpRgn(0, 0, pdc->dclevel.sizl.cx, pdc->dclevel.sizl.cy); ASSERT(pdc->prgnVis); - GDIOBJ_CopyOwnership(pdc->BaseObject.hHmgr, pdc->prgnVis->BaseObject.hHmgr); /* Setup palette */ pdc->dclevel.hpal = StockObjects[DEFAULT_PALETTE]; @@ -354,12 +368,16 @@ DC_Cleanup(PVOID ObjectBody) EBRUSHOBJ_vCleanup(&pdc->eboBackground); /* Free regions */ - if (pdc->rosdc.hClipRgn) + if (pdc->rosdc.hClipRgn && GreIsHandleValid(pdc->rosdc.hClipRgn)) GreDeleteObject(pdc->rosdc.hClipRgn); if (pdc->prgnVis) - REGION_FreeRgnByHandle(pdc->prgnVis->BaseObject.hHmgr); - if (pdc->rosdc.hGCClipRgn) + { + REGION_Delete(pdc->prgnVis); + } + if (pdc->rosdc.hGCClipRgn && GreIsHandleValid(pdc->rosdc.hGCClipRgn)) + { GreDeleteObject(pdc->rosdc.hGCClipRgn); + } if (NULL != pdc->rosdc.CombinedClip) IntEngDeleteClipRegion(pdc->rosdc.CombinedClip); @@ -373,72 +391,64 @@ DC_Cleanup(PVOID ObjectBody) return TRUE; } -BOOL -FASTCALL -DC_SetOwnership(HDC hDC, PEPROCESS Owner) +VOID +NTAPI +DC_vSetOwner(PDC pdc, ULONG ulOwner) { - INT Index; - PGDI_TABLE_ENTRY Entry; - PDC pDC; - BOOL ret = FALSE; - if (!GDIOBJ_SetOwnership(hDC, Owner)) + if (pdc->rosdc.hClipRgn) { - DPRINT1("GDIOBJ_SetOwnership failed\n"); - return FALSE; + IntGdiSetRegionOwner(pdc->rosdc.hClipRgn, ulOwner); } - pDC = DC_LockDc(hDC); - if (!pDC) + if (pdc->rosdc.hGCClipRgn) { - DPRINT1("Could not lock DC\n"); - return FALSE; + IntGdiSetRegionOwner(pdc->rosdc.hGCClipRgn, ulOwner); } - /* - System Regions: - These regions do not use attribute sections and when allocated, use - gdiobj level functions. - */ - if (pDC->rosdc.hClipRgn) - { // FIXME! HAX!!! - Index = GDI_HANDLE_GET_INDEX(pDC->rosdc.hClipRgn); - Entry = &GdiHandleTable->Entries[Index]; - if (Entry->UserData) FreeObjectAttr(Entry->UserData); - Entry->UserData = NULL; - // - if (!GDIOBJ_SetOwnership(pDC->rosdc.hClipRgn, Owner)) goto leave; - } - if (pDC->prgnVis) - { // FIXME! HAX!!! - Index = GDI_HANDLE_GET_INDEX(pDC->prgnVis->BaseObject.hHmgr); - Entry = &GdiHandleTable->Entries[Index]; - if (Entry->UserData) FreeObjectAttr(Entry->UserData); - Entry->UserData = NULL; - // - if (!GDIOBJ_SetOwnership(pDC->prgnVis->BaseObject.hHmgr, Owner)) goto leave; - } - if (pDC->rosdc.hGCClipRgn) - { // FIXME! HAX!!! - Index = GDI_HANDLE_GET_INDEX(pDC->rosdc.hGCClipRgn); - Entry = &GdiHandleTable->Entries[Index]; - if (Entry->UserData) FreeObjectAttr(Entry->UserData); - Entry->UserData = NULL; - // - if (!GDIOBJ_SetOwnership(pDC->rosdc.hGCClipRgn, Owner)) goto leave; - } - if (pDC->dclevel.hPath) + if (pdc->dclevel.hPath) { - if (!GDIOBJ_SetOwnership(pDC->dclevel.hPath, Owner)) goto leave; + GreSetObjectOwner(pdc->dclevel.hPath, ulOwner); } - ret = TRUE; -leave: - DC_UnlockDc(pDC); + IntGdiSetBrushOwner(pdc->dclevel.pbrFill, ulOwner); + IntGdiSetBrushOwner(pdc->dclevel.pbrLine, ulOwner); - return ret; + /* Allocate or free DC attribute */ + if (ulOwner == GDI_OBJ_HMGR_PUBLIC || ulOwner == GDI_OBJ_HMGR_NONE) + { + if (pdc->pdcattr != &pdc->dcattr) + DC_vFreeDcAttr(pdc); + } + else if (ulOwner == GDI_OBJ_HMGR_POWNED) + { + if (pdc->pdcattr == &pdc->dcattr) + DC_bAllocDcAttr(pdc); + } + + /* Set the DC's ownership */ + GDIOBJ_vSetObjectOwner(&pdc->BaseObject, ulOwner); } +BOOL +NTAPI +GreSetDCOwner(HDC hdc, ULONG ulOwner) +{ + PDC pdc; + + pdc = DC_LockDc(hdc); + if (!pdc) + { + DPRINT1("GreSetDCOwner: Could not lock DC\n"); + return FALSE; + } + + /* Call the internal DC function */ + DC_vSetOwner(pdc, ulOwner); + + DC_UnlockDc(pdc); + return TRUE; +} int FASTCALL CLIPPING_UpdateGCRegion(DC* Dc); @@ -609,7 +619,7 @@ GreOpenDCW( /* FIXME: HACK! */ DC_InitHack(pdc); - DC_AllocDcAttr(pdc); + DC_bAllocDcAttr(pdc); DC_UnlockDc(pdc); @@ -689,17 +699,17 @@ NtGdiOpenDCW( /* Call the internal function */ hdc = GreOpenDCW(pustrDevice ? &ustrDevice : NULL, pdmInit ? &dmInit : NULL, - NULL, // fixme pwszLogAddress + NULL, // FIXME: pwszLogAddress iType, bDisplay, hspool, - NULL, //FIXME: pDriverInfo2 + NULL, // FIXME: pDriverInfo2 pUMdhpdev ? &dhpdev : NULL); /* If we got a HDC and a UM dhpdev is requested,... */ if (hdc && pUMdhpdev) { - /* Copy dhpdev to caller (FIXME: use dhpdev?? */ + /* Copy dhpdev to caller (FIXME: use dhpdev?) */ _SEH2_TRY { /* Pointer was already probed */ @@ -772,7 +782,7 @@ NtGdiCreateCompatibleDC(HDC hdc) DC_InitHack(pdcNew); /* Allocate a dc attribute */ - DC_AllocDcAttr(pdcNew); + DC_bAllocDcAttr(pdcNew); // HACK! DC_vSelectSurface(pdcNew, psurfDefaultBitmap); @@ -825,11 +835,9 @@ IntGdiDeleteDC(HDC hDC, BOOL Force) DC_UnlockDc(DCToDelete); - if (!IsObjectDead(hDC)) + if (GreIsHandleValid(hDC)) { - DC_vFreeDcAttr(DCToDelete); // Plug a leak see bug 6119! - - if (!GDIOBJ_FreeObjByHandle(hDC, GDI_OBJECT_TYPE_DC)) + if (!GreDeleteObject(hDC)) { DPRINT1("DC_FreeDC failed\n"); } @@ -844,25 +852,24 @@ IntGdiDeleteDC(HDC hDC, BOOL Force) BOOL APIENTRY -NtGdiDeleteObjectApp(HANDLE DCHandle) +NtGdiDeleteObjectApp(HANDLE hobj) { /* Complete all pending operations */ - NtGdiFlushUserBatch(); + NtGdiFlushUserBatch(); // FIXME: we shouldn't need this - if (GDI_HANDLE_IS_STOCKOBJ(DCHandle)) return TRUE; + if (GDI_HANDLE_IS_STOCKOBJ(hobj)) return TRUE; - if (GDI_HANDLE_GET_TYPE(DCHandle) != GDI_OBJECT_TYPE_DC) - return GreDeleteObject((HGDIOBJ) DCHandle); - - if (IsObjectDead((HGDIOBJ)DCHandle)) return TRUE; - - if (!GDIOBJ_OwnedByCurrentProcess(DCHandle)) + if (GreGetObjectOwner(hobj) != GDI_OBJ_HMGR_POWNED) { EngSetLastError(ERROR_INVALID_HANDLE); return FALSE; } - return IntGdiDeleteDC(DCHandle, FALSE); + if (GDI_HANDLE_GET_TYPE(hobj) != GDI_OBJECT_TYPE_DC) + return GreDeleteObject(hobj); + + // FIXME: everything should be callback based + return IntGdiDeleteDC(hobj, FALSE); } BOOL @@ -975,45 +982,3 @@ IntGdiCreateDisplayDC(HDEV hDev, ULONG DcType, BOOL EmptyDC) return hDC; } -BOOL -FASTCALL -IntGdiSetDCOwnerEx( HDC hDC, DWORD OwnerMask, BOOL NoSetBrush) -{ - PDC pDC; - BOOL Ret = FALSE; - - if (!hDC || (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)) return FALSE; - - if ((OwnerMask == GDI_OBJ_HMGR_PUBLIC) || OwnerMask == GDI_OBJ_HMGR_NONE) - { - pDC = DC_LockDc ( hDC ); - MmCopyFromCaller(&pDC->dcattr, pDC->pdcattr, sizeof(DC_ATTR)); - DC_vFreeDcAttr(pDC); - DC_UnlockDc( pDC ); - - if (!DC_SetOwnership( hDC, NULL )) // This hDC is inaccessible! - return Ret; - } - - if (OwnerMask == GDI_OBJ_HMGR_POWNED) - { - pDC = DC_LockDc ( hDC ); - ASSERT(pDC->pdcattr == &pDC->dcattr); - DC_UnlockDc( pDC ); - - if (!DC_SetOwnership( hDC, PsGetCurrentProcess() )) return Ret; - - DC_AllocateDcAttr( hDC ); // Allocate new dcattr - - DCU_SynchDcAttrtoUser( hDC ); // Copy data from dc to dcattr - } - - if ((OwnerMask != GDI_OBJ_HMGR_NONE) && !NoSetBrush) - { - pDC = DC_LockDc ( hDC ); - if (IntGdiSetBrushOwner((PBRUSH)pDC->dclevel.pbrFill, OwnerMask)) - IntGdiSetBrushOwner((PBRUSH)pDC->dclevel.pbrLine, OwnerMask); - DC_UnlockDc( pDC ); - } - return TRUE; -} diff --git a/subsystems/win32/win32k/objects/dcobjs.c b/subsystems/win32/win32k/objects/dcobjs.c index 6a7cf20661b..39826dc5154 100644 --- a/subsystems/win32/win32k/objects/dcobjs.c +++ b/subsystems/win32/win32k/objects/dcobjs.c @@ -181,7 +181,8 @@ GdiSelectPalette( if(pdc->dctype == DCTYPE_MEMORY) { - IntGdiRealizePalette(pdc); + // This didn't work anyway + //IntGdiRealizePalette(hDC); } PALETTE_ShareUnlockPalette(ppal); @@ -364,7 +365,7 @@ NtGdiSelectBitmap( if (hVisRgn) { GdiSelectVisRgn(hdc, hVisRgn); - REGION_FreeRgnByHandle(hVisRgn); + GreDeleteObject(hVisRgn); } /* Return the old bitmap handle */ @@ -543,7 +544,12 @@ NtGdiGetRandomRgn( else if (pdc->dclevel.prgnMeta) hrgnSrc = pdc->dclevel.prgnMeta->BaseObject.hHmgr; break; case SYSRGN: - if (pdc->prgnVis) hrgnSrc = pdc->prgnVis->BaseObject.hHmgr; + if (pdc->prgnVis) + { + PREGION prgnDest = REGION_LockRgn(hrgnDest); + ret = IntGdiCombineRgn(prgnDest, pdc->prgnVis, 0, RGN_COPY) == ERROR ? -1 : 1; + REGION_UnlockRgn(prgnDest); + } break; default: hrgnSrc = NULL; diff --git a/subsystems/win32/win32k/objects/dcstate.c b/subsystems/win32/win32k/objects/dcstate.c index 9491db2ce6b..5af20526075 100644 --- a/subsystems/win32/win32k/objects/dcstate.c +++ b/subsystems/win32/win32k/objects/dcstate.c @@ -101,16 +101,12 @@ DC_vRestoreDC( IN PDC pdc, INT iSaveLevel) { - PEPROCESS pepCurrentProcess; HDC hdcSave; PDC pdcSave; ASSERT(iSaveLevel > 0); DPRINT("DC_vRestoreDC(%p, %ld)\n", pdc->BaseObject.hHmgr, iSaveLevel); - /* Get current process */ - pepCurrentProcess = PsGetCurrentProcess(); - /* Loop the save levels */ while (pdc->dclevel.lSaveDepth > iSaveLevel) { @@ -118,7 +114,7 @@ DC_vRestoreDC( DPRINT("RestoreDC = %p\n", hdcSave); /* Set us as the owner */ - if (!GDIOBJ_SetOwnership(hdcSave, pepCurrentProcess)) + if (!GreSetObjectOwner(hdcSave, GDI_OBJ_HMGR_POWNED)) { /* Could not get ownership. That's bad! */ DPRINT1("Could not get ownership of saved DC (%p) for hdc %p!\n", @@ -261,7 +257,7 @@ NtGdiSaveDC( /* Make it a kernel handle (FIXME: windows handles this different, see wiki)*/ - GDIOBJ_SetOwnership(hdcSave, NULL); + GreSetObjectOwner(hdcSave, GDI_OBJ_HMGR_PUBLIC); /* Copy the current state */ DC_vCopyState(pdc, pdcSave, TRUE); diff --git a/subsystems/win32/win32k/objects/dibobj.c b/subsystems/win32/win32k/objects/dibobj.c index 452e03d13fc..fdc8f92b416 100644 --- a/subsystems/win32/win32k/objects/dibobj.c +++ b/subsystems/win32/win32k/objects/dibobj.c @@ -164,7 +164,7 @@ IntSetDIBColorTable( return 0; } - PalGDI = PALETTE_ShareLockPalette(psurf->ppal->BaseObject.hHmgr); + PalGDI = psurf->ppal; for (Index = StartIndex; Index < StartIndex + Entries && Index < PalGDI->NumColors; @@ -174,7 +174,6 @@ IntSetDIBColorTable( PalGDI->IndexedColors[Index].peGreen = Colors[Index - StartIndex].rgbGreen; PalGDI->IndexedColors[Index].peBlue = Colors[Index - StartIndex].rgbBlue; } - PALETTE_ShareUnlockPalette(PalGDI); } else Entries = 0; @@ -559,7 +558,7 @@ Exit: if (pSourceSurf) EngUnlockSurface(pSourceSurf); if (hSourceBitmap) EngDeleteSurface((HSURF)hSourceBitmap); - if (hpalDIB) PALETTE_FreePaletteByHandle(hpalDIB); + if (hpalDIB) GreDeleteObject(hpalDIB); DC_UnlockDc(pDC); return ret; @@ -1639,7 +1638,7 @@ cleanup: if (res) { - SURFACE_FreeSurfaceByHandle(res); + GreDeleteObject(res); res = 0; } } diff --git a/subsystems/win32/win32k/objects/drawing.c b/subsystems/win32/win32k/objects/drawing.c index bac849ce9e9..794a6d0c0b5 100644 --- a/subsystems/win32/win32k/objects/drawing.c +++ b/subsystems/win32/win32k/objects/drawing.c @@ -1329,7 +1329,7 @@ IntFillArc( PDC dc, pdcattr = dc->pdcattr; - pbrush = BRUSH_LockBrush(pdcattr->hbrush); + pbrush = BRUSH_ShareLockBrush(pdcattr->hbrush); if (!pbrush) { DPRINT1("FillArc Fail\n"); @@ -1342,7 +1342,7 @@ IntFillArc( PDC dc, (dc->dclevel.flPath & DCPATH_CLOCKWISE) ? -Start : -End, pbrush, Chord); - BRUSH_UnlockBrush(pbrush); + BRUSH_ShareUnlockBrush(pbrush); return ret; } diff --git a/subsystems/win32/win32k/objects/fillshap.c b/subsystems/win32/win32k/objects/fillshap.c index 0fb1695c1b6..c1ff20183c0 100644 --- a/subsystems/win32/win32k/objects/fillshap.c +++ b/subsystems/win32/win32k/objects/fillshap.c @@ -248,7 +248,7 @@ NtGdiEllipse( if (pdcattr->ulDirty_ & (DIRTY_LINE | DC_PEN_DIRTY)) DC_vUpdateLineBrush(dc); - pbrush = PEN_LockPen(pdcattr->hpen); + pbrush = PEN_ShareLockPen(pdcattr->hpen); if (!pbrush) { DPRINT1("Ellipse Fail 1\n"); @@ -297,7 +297,7 @@ NtGdiEllipse( DPRINT("Ellipse 2: XLeft: %d, YLeft: %d, Width: %d, Height: %d\n", CenterX - RadiusX, CenterY + RadiusY, RadiusX*2, RadiusY*2); - pFillBrushObj = BRUSH_LockBrush(pdcattr->hbrush); + pFillBrushObj = BRUSH_ShareLockBrush(pdcattr->hbrush); if (NULL == pFillBrushObj) { DPRINT1("FillEllipse Fail\n"); @@ -317,7 +317,7 @@ NtGdiEllipse( RadiusX*2, // Width RadiusY*2, // Height &tmpFillBrushObj); - BRUSH_UnlockBrush(pFillBrushObj); + BRUSH_ShareUnlockBrush(pFillBrushObj); } if (ret) @@ -329,7 +329,7 @@ NtGdiEllipse( pbrush); pbrush->ptPenWidth.x = PenOrigWidth; - PEN_UnlockPen(pbrush); + PEN_ShareUnlockPen(pbrush); DC_UnlockDc(dc); DPRINT("Ellipse Exit.\n"); return ret; @@ -714,7 +714,7 @@ IntRoundRect( int yCurveDiameter) { PDC_ATTR pdcattr; - PBRUSH pbrushLine, pbrushFill; + PBRUSH pbrLine, pbrFill; RECTL RectBounds; LONG PenWidth, PenOrigWidth; BOOL ret = TRUE; // default to success @@ -748,18 +748,18 @@ IntRoundRect( if (pdcattr->ulDirty_ & (DIRTY_LINE | DC_PEN_DIRTY)) DC_vUpdateLineBrush(dc); - pbrushLine = PEN_LockPen(pdcattr->hpen); - if (!pbrushLine) + pbrLine = PEN_ShareLockPen(pdcattr->hpen); + if (!pbrLine) { /* Nothing to do, as we don't have a bitmap */ EngSetLastError(ERROR_INTERNAL_ERROR); return FALSE; } - PenOrigWidth = PenWidth = pbrushLine->ptPenWidth.x; - if (pbrushLine->ulPenStyle == PS_NULL) PenWidth = 0; + PenOrigWidth = PenWidth = pbrLine->ptPenWidth.x; + if (pbrLine->ulPenStyle == PS_NULL) PenWidth = 0; - if (pbrushLine->ulPenStyle == PS_INSIDEFRAME) + if (pbrLine->ulPenStyle == PS_INSIDEFRAME) { if (2*PenWidth > (Right - Left)) PenWidth = (Right -Left + 1)/2; if (2*PenWidth > (Bottom - Top)) PenWidth = (Bottom -Top + 1)/2; @@ -770,7 +770,7 @@ IntRoundRect( } if (!PenWidth) PenWidth = 1; - pbrushLine->ptPenWidth.x = PenWidth; + pbrLine->ptPenWidth.x = PenWidth; RectBounds.left = Left; RectBounds.top = Top; @@ -784,8 +784,8 @@ IntRoundRect( RectBounds.right += dc->ptlDCOrig.x; RectBounds.bottom += dc->ptlDCOrig.y; - pbrushFill = BRUSH_LockBrush(pdcattr->hbrush); - if (NULL == pbrushFill) + pbrFill = BRUSH_ShareLockBrush(pdcattr->hbrush); + if (!pbrFill) { DPRINT1("FillRound Fail\n"); EngSetLastError(ERROR_INTERNAL_ERROR); @@ -793,7 +793,7 @@ IntRoundRect( } else { - RtlCopyMemory(&brushTemp, pbrushFill, sizeof(brushTemp)); + RtlCopyMemory(&brushTemp, pbrFill, sizeof(brushTemp)); brushTemp.ptOrigin.x += RectBounds.left - Left; brushTemp.ptOrigin.y += RectBounds.top - Top; ret = IntFillRoundRect( dc, @@ -804,7 +804,7 @@ IntRoundRect( xCurveDiameter, yCurveDiameter, &brushTemp); - BRUSH_UnlockBrush(pbrushFill); + BRUSH_ShareUnlockBrush(pbrFill); } if (ret) @@ -815,10 +815,10 @@ IntRoundRect( RectBounds.bottom, xCurveDiameter, yCurveDiameter, - pbrushLine); + pbrLine); - pbrushLine->ptPenWidth.x = PenOrigWidth; - PEN_UnlockPen(pbrushLine); + pbrLine->ptPenWidth.x = PenOrigWidth; + PEN_ShareUnlockPen(pbrLine); return ret; } diff --git a/subsystems/win32/win32k/objects/gdibatch.c b/subsystems/win32/win32k/objects/gdibatch.c index 7ddb1fa24e1..dc604103e30 100644 --- a/subsystems/win32/win32k/objects/gdibatch.c +++ b/subsystems/win32/win32k/objects/gdibatch.c @@ -20,7 +20,7 @@ FASTCALL DoDeviceSync( SURFOBJ *Surface, PRECTL Rect, FLONG fl) { PPDEVOBJ Device = (PDEVOBJ*)Surface->hdev; -// No punting and "Handle to a surface, provided that the surface is device-managed. +// No punting and "Handle to a surface, provided that the surface is device-managed. // Otherwise, dhsurf is zero". if (!(Device->flFlags & PDEV_DRIVER_PUNTED_CALL) && (Surface->dhsurf)) { @@ -42,9 +42,9 @@ VOID FASTCALL SynchonizeDriver(FLONG Flags) { - SURFOBJ *SurfObj; + SURFOBJ *SurfObj; PPDEVOBJ Device; - + if (Flags & GCAPS2_SYNCFLUSH) Flags = DSS_FLUSH_EVENT; if (Flags & GCAPS2_SYNCTIMER) @@ -149,7 +149,7 @@ GdiFlushUserBatch(PDC dc, PGDIBATCHHDR pHdr) break; } - return Size; + return Size; } /* @@ -190,7 +190,7 @@ NtGdiFlushUserBatch(VOID) PCHAR pHdr = (PCHAR)&pTeb->GdiTebBatch.Buffer[0]; PDC pDC = NULL; - if (hDC && !IsObjectDead(hDC)) + if (GDI_HANDLE_GET_TYPE(hDC) == GDILoObjType_LO_DC_TYPE && GreIsHandleValid(hDC)) { pDC = DC_LockDc(hDC); } diff --git a/subsystems/win32/win32k/objects/gdidbg.c b/subsystems/win32/win32k/objects/gdidbg.c index bf46e2b5111..ca48ec72f22 100644 --- a/subsystems/win32/win32k/objects/gdidbg.c +++ b/subsystems/win32/win32k/objects/gdidbg.c @@ -12,23 +12,14 @@ #define NDEBUG #include +extern ULONG gulFirstFree; +extern ULONG gulFirstUnused; ULONG gulDebugChannels = 0; +ULONG gulLogUnique = 0; #ifdef GDI_DEBUG - -ULONG_PTR GDIHandleAllocator[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; -ULONG_PTR GDIHandleLocker[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; -ULONG_PTR GDIHandleShareLocker[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; -ULONG_PTR GDIHandleDeleter[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; -struct DbgOpenGDIHandle -{ - ULONG idx; - int count; -}; -#define MAX_BACKTRACES 1024 -static struct DbgOpenGDIHandle AllocatorTable[MAX_BACKTRACES]; - +#if 0 static BOOL CompareBacktraces(ULONG idx1, ULONG idx2) @@ -50,7 +41,9 @@ CompareBacktraces(ULONG idx1, ULONG idx2) return TRUE; } -void IntDumpHandleTable(PGDI_HANDLE_TABLE HandleTable) +VOID +NTAPI +DbgDumpGdiHandleTable(void) { static int leak_reported = 0; int i, j, idx, nTraces = 0; @@ -139,9 +132,11 @@ void IntDumpHandleTable(PGDI_HANDLE_TABLE HandleTable) ASSERT(FALSE); } +#endif ULONG -CaptureStackBackTace(PVOID* pFrames, ULONG nFramesToCapture) +NTAPI +DbgCaptureStackBackTace(PVOID* pFrames, ULONG nFramesToCapture) { ULONG nFrameCount; @@ -160,7 +155,8 @@ CaptureStackBackTace(PVOID* pFrames, ULONG nFramesToCapture) } BOOL -GdiDbgHTIntegrityCheck() +NTAPI +DbgGdiHTIntegrityCheck() { ULONG i, nDeleted = 0, nFree = 0, nUsed = 0; PGDI_TABLE_ENTRY pEntry; @@ -171,7 +167,7 @@ GdiDbgHTIntegrityCheck() /* FIXME: check reserved entries */ /* Now go through the deleted objects */ - i = GdiHandleTable->FirstFree & 0xffff; + i = gulFirstFree & 0xffff; while (i) { pEntry = &GdiHandleTable->Entries[i]; @@ -208,7 +204,7 @@ GdiDbgHTIntegrityCheck() i = (ULONG_PTR)pEntry->KernelData & 0xffff; }; - for (i = GdiHandleTable->FirstUnused; + for (i = gulFirstUnused; i < GDI_HANDLE_COUNT; i++) { @@ -280,40 +276,135 @@ GdiDbgHTIntegrityCheck() return r; } -ULONG -FASTCALL -GDIOBJ_IncrementShareCount(POBJ Object) -{ - INT cLocks = InterlockedIncrement((PLONG)&Object->ulShareCount); - GDIDBG_CAPTURESHARELOCKER(Object->hHmgr); - ASSERT(cLocks >= 1); - return cLocks; -} - #endif /* GDI_DEBUG */ -void -GdiDbgDumpLockedHandles() +VOID +NTAPI +DbgDumpLockedGdiHandles() { +#if 0 ULONG i; for (i = RESERVE_ENTRIES_COUNT; i < GDI_HANDLE_COUNT; i++) { - PGDI_TABLE_ENTRY pEntry = &GdiHandleTable->Entries[i]; + PENTRY pentry = &gpentHmgr[i]; - if (pEntry->Type & GDI_ENTRY_BASETYPE_MASK) + if (pentry->Objt) { - BASEOBJECT *pObject = pEntry->KernelData; - if (pObject->cExclusiveLock > 0) + POBJ pobj = pentry->einfo.pobj; + if (pobj->cExclusiveLock > 0) { DPRINT1("Locked object: %lx, type = %lx. allocated from:\n", - i, pEntry->Type); - GDIDBG_TRACEALLOCATOR(i); - DPRINT1("Locked from:\n"); - GDIDBG_TRACELOCKER(i); + i, pentry->Objt); + DBG_DUMP_EVENT_LIST(&pobj->slhLog); } } } +#endif +} + +VOID +NTAPI +DbgLogEvent(PSLIST_HEADER pslh, EVENT_TYPE nEventType, LPARAM lParam) +{ + PLOGENTRY pLogEntry; + + /* Log a maximum of 100 events */ + if (QueryDepthSList(pslh) >= 1000) return; + + /* Allocate a logentry */ + pLogEntry = EngAllocMem(0, sizeof(LOGENTRY), 'golG'); + if (!pLogEntry) return; + + /* Set type */ + pLogEntry->nEventType = nEventType; + pLogEntry->ulUnique = InterlockedIncrement((LONG*)&gulLogUnique); + pLogEntry->dwProcessId = HandleToUlong(PsGetCurrentProcessId()); + pLogEntry->dwThreadId = HandleToUlong(PsGetCurrentThreadId()); + pLogEntry->lParam = lParam; + + /* Capture a backtrace */ + DbgCaptureStackBackTace(pLogEntry->apvBackTrace, 20); + + switch (nEventType) + { + case EVENT_ALLOCATE: + case EVENT_CREATE_HANDLE: + case EVENT_REFERENCE: + case EVENT_DEREFERENCE: + case EVENT_LOCK: + case EVENT_UNLOCK: + case EVENT_DELETE: + case EVENT_FREE: + case EVENT_SET_OWNER: + default: + break; + } + + /* Push it on the list */ + InterlockedPushEntrySList(pslh, &pLogEntry->sleLink); +} + +#define REL_ADDR(va) ((ULONG_PTR)va - (ULONG_PTR)&__ImageBase) + +VOID +DbgPrintEvent(PLOGENTRY pLogEntry) +{ + PSTR pstr; + + switch (pLogEntry->nEventType) + { + case EVENT_ALLOCATE: pstr = "Allocate"; break; + case EVENT_CREATE_HANDLE: pstr = "CreatHdl"; break; + case EVENT_REFERENCE: pstr = "Ref"; break; + case EVENT_DEREFERENCE: pstr = "Deref"; break; + case EVENT_LOCK: pstr = "Lock"; break; + case EVENT_UNLOCK: pstr = "Unlock"; break; + case EVENT_DELETE: pstr = "Delete"; break; + case EVENT_FREE: pstr = "Free"; break; + case EVENT_SET_OWNER: pstr = "SetOwner"; break; + default: pstr = "Unknown"; break; + } + + DbgPrint("[%ld] %03x:%03x %.8s val=%p <%lx,%lx,%lx,%lx>\n", + pLogEntry->ulUnique, + pLogEntry->dwProcessId, + pLogEntry->dwThreadId, + pstr, + pLogEntry->lParam, + REL_ADDR(pLogEntry->apvBackTrace[2]), + REL_ADDR(pLogEntry->apvBackTrace[3]), + REL_ADDR(pLogEntry->apvBackTrace[4]), + REL_ADDR(pLogEntry->apvBackTrace[5])); +} + +VOID +NTAPI +DbgDumpEventList(PSLIST_HEADER pslh) +{ + PSLIST_ENTRY psle; + PLOGENTRY pLogEntry; + + while ((psle = InterlockedPopEntrySList(pslh))) + { + pLogEntry = CONTAINING_RECORD(psle, LOGENTRY, sleLink); + DbgPrintEvent(pLogEntry); + } + +} + +VOID +NTAPI +DbgCleanupEventList(PSLIST_HEADER pslh) +{ + PSLIST_ENTRY psle; + PLOGENTRY pLogEntry; + + while ((psle = InterlockedPopEntrySList(pslh))) + { + pLogEntry = CONTAINING_RECORD(psle, LOGENTRY, sleLink); + EngFreeMem(pLogEntry); + } } void @@ -323,9 +414,9 @@ DbgPreServiceHook(ULONG ulSyscallId, PULONG_PTR pulArguments) PTHREADINFO pti = (PTHREADINFO)PsGetCurrentThreadWin32Thread(); if (pti && pti->cExclusiveLocks != 0) { - DbgPrint("FATAL: Win32DbgPreServiceHook(%ld): There are %ld exclusive locks!\n", + DbgPrint("FATAL: Win32DbgPreServiceHook(0x%lx): There are %ld exclusive locks!\n", ulSyscallId, pti->cExclusiveLocks); - GdiDbgDumpLockedHandles(); + DbgDumpLockedGdiHandles(); ASSERT(FALSE); } @@ -338,9 +429,9 @@ DbgPostServiceHook(ULONG ulSyscallId, ULONG_PTR ulResult) PTHREADINFO pti = (PTHREADINFO)PsGetCurrentThreadWin32Thread(); if (pti && pti->cExclusiveLocks != 0) { - DbgPrint("FATAL: Win32DbgPostServiceHook(%ld): There are %ld exclusive locks!\n", + DbgPrint("FATAL: Win32DbgPostServiceHook(0x%lx): There are %ld exclusive locks!\n", ulSyscallId, pti->cExclusiveLocks); - GdiDbgDumpLockedHandles(); + DbgDumpLockedGdiHandles(); ASSERT(FALSE); } return ulResult; diff --git a/subsystems/win32/win32k/objects/gdiobj.c b/subsystems/win32/win32k/objects/gdiobj.c index a6d470a5aa2..2a5597ecf66 100644 --- a/subsystems/win32/win32k/objects/gdiobj.c +++ b/subsystems/win32/win32k/objects/gdiobj.c @@ -3,278 +3,259 @@ * LICENSE: GPL - See COPYING in the top level directory * FILE: subsystems/win32/win32k/objects/gdiobj.c * PURPOSE: General GDI object manipulation routines - * PROGRAMMERS: ... + * PROGRAMMERS: Timo Kreuzer */ -/** INCLUDES ******************************************************************/ +/* + * If you want to understand this code, you need to start thinking in portals. + * - gpaulRefCount is a global pointer to an allocated array of ULONG values, + * one for each handle. Bits 0 - 22 contain a reference count for the handle. + * It gets increased for each handle lock / reference. Bit 23 contains a valid + * bit. If this bit is 0, the handle got deleted and will be pushed to the free + * list, once all references are gone. Bits 24 - 31 contain the reuse value of + * the handle, which allows to check if the entry was changed before atomically + * exchanging the reference count. + * - Objects can exist with or without a handle + * - Objects with a handle can be locked either exclusively or shared. + * Both locks increase the handle reference count in gpaulRefCount. + * Exclusive locks also increase the BASEOBJECT's cExclusiveLock field + * and the first lock (can be acquired recursively) acquires a pushlock + * that is also stored in the BASEOBJECT. + * - Objects without a handle cannot have exclusive locks. Their reference + * count is tracked in the BASEOBJECT's ulShareCount field. + * - An object that is inserted in the handle table automatically has an + * exclusive lock. For objects that are "shared objects" (BRUSH, PALETTE, ...) + * this is the only way it can ever be exclusively locked. It prevents the + * object from being locked by another thread. A shared lock will simply fail, + * while an exclusive lock will succeed after the object was unlocked. + * + */ + +/* INCLUDES ******************************************************************/ #include #define NDEBUG #include -#define BASE_OBJTYPE_COUNT 32 +// move to gdidbg.h +#if DBG +#define DBG_INCREASE_LOCK_COUNT(pti, hobj) \ + if (pti) ((PTHREADINFO)pti)->acExclusiveLockCount[((ULONG_PTR)hobj >> 16) & 0x1f]++; +#define DBG_DECREASE_LOCK_COUNT(pti, hobj) \ + if (pti) ((PTHREADINFO)pti)->acExclusiveLockCount[((ULONG_PTR)hobj >> 16) & 0x1f]--; +#define ASSERT_SHARED_OBJECT_TYPE(objt) \ + ASSERT((objt) == GDIObjType_SURF_TYPE || \ + (objt) == GDIObjType_PAL_TYPE || \ + (objt) == GDIObjType_LFONT_TYPE || \ + (objt) == GDIObjType_PATH_TYPE || \ + (objt) == GDIObjType_BRUSH_TYPE) +#define ASSERT_EXCLUSIVE_OBJECT_TYPE(objt) \ + ASSERT((objt) == GDIObjType_DC_TYPE || \ + (objt) == GDIObjType_RGN_TYPE || \ + (objt) == GDIObjType_LFONT_TYPE) +#else +#define DBG_INCREASE_LOCK_COUNT(ppi, hobj) +#define DBG_DECREASE_LOCK_COUNT(x, y) +#define ASSERT_SHARED_OBJECT_TYPE(objt) +#define ASSERT_EXCLUSIVE_OBJECT_TYPE(objt) +#endif -#define DelayExecution() \ - DPRINT("%s:%i: Delay\n", __FILE__, __LINE__); \ - KeDelayExecutionThread(KernelMode, FALSE, &ShortDelay) +#define MmMapViewInSessionSpace MmMapViewInSystemSpace -static -BOOL INTERNAL_CALL GDI_CleanupDummy(PVOID ObjectBody); +#ifdef _M_IX86 +#define InterlockedOr16 _InterlockedOr16 +#endif -/** GLOBALS *******************************************************************/ +#define GDIOBJ_POOL_TAG(type) ('00hG' + ((objt & 0x1f) << 24)) -typedef struct +enum { - BOOL bUseLookaside; - ULONG_PTR ulBodySize; - ULONG Tag; - GDICLEANUPPROC CleanupProc; -} OBJ_TYPE_INFO, *POBJ_TYPE_INFO; - -static const -OBJ_TYPE_INFO ObjTypeInfo[BASE_OBJTYPE_COUNT] = -{ - {0, 0, 0, NULL}, /* 00 reserved entry */ - {1, sizeof(DC), TAG_DC, DC_Cleanup}, /* 01 DC */ - {1, 0, 0, NULL}, /* 02 UNUSED1 */ - {1, 0, 0, NULL}, /* 03 UNUSED2 */ - {1, sizeof(ROSRGNDATA), TAG_REGION, REGION_Cleanup}, /* 04 RGN */ - {1, sizeof(SURFACE), TAG_SURFACE, SURFACE_Cleanup}, /* 05 SURFACE */ - {1, sizeof(CLIENTOBJ), TAG_CLIENTOBJ, GDI_CleanupDummy}, /* 06 CLIENTOBJ: METADC,... */ - {1, sizeof(PATH), TAG_PATH, GDI_CleanupDummy}, /* 07 PATH */ - {1, sizeof(PALETTE), TAG_PALETTE, PALETTE_Cleanup}, /* 08 PAL */ - {1, sizeof(COLORSPACE), TAG_ICMLCS, GDI_CleanupDummy}, /* 09 ICMLCS, */ - {1, sizeof(TEXTOBJ), TAG_LFONT, GDI_CleanupDummy}, /* 0a LFONT */ - {0, 0, TAG_RFONT, NULL}, /* 0b RFONT, unused */ - {0, 0, TAG_PFE, NULL}, /* 0c PFE, unused */ - {0, 0, TAG_PFT, NULL}, /* 0d PFT, unused */ - {0, sizeof(GDICLRXFORM), TAG_ICMCXF, GDI_CleanupDummy}, /* 0e ICMCXF, */ - {0, 0, TAG_SPRITE, NULL}, /* 0f SPRITE, unused */ - {1, sizeof(BRUSH), TAG_BRUSH, BRUSH_Cleanup}, /* 10 BRUSH, PEN, EXTPEN */ - {0, 0, TAG_UMPD, NULL}, /* 11 UMPD, unused */ - {0, 0, 0, NULL}, /* 12 UNUSED4 */ - {0, 0, TAG_SPACE, NULL}, /* 13 SPACE, unused */ - {0, 0, 0, NULL}, /* 14 UNUSED5 */ - {0, 0, TAG_META, NULL}, /* 15 META, unused */ - {0, 0, TAG_EFSTATE, NULL}, /* 16 EFSTATE, unused */ - {0, 0, TAG_BMFD, NULL}, /* 17 BMFD, unused */ - {0, 0, TAG_VTFD, NULL}, /* 18 VTFD, unused */ - {0, 0, TAG_TTFD, NULL}, /* 19 TTFD, unused */ - {0, 0, TAG_RC, NULL}, /* 1a RC, unused */ - {0, 0, TAG_TEMP, NULL}, /* 1b TEMP, unused */ - {0, sizeof(EDRIVEROBJ), TAG_DRVOBJ, DRIVEROBJ_Cleanup},/* 1c DRVOBJ */ - {0, 0, TAG_DCIOBJ, NULL}, /* 1d DCIOBJ, unused */ - {0, 0, TAG_SPOOL, NULL}, /* 1e SPOOL, unused */ - {0, 0, 0, NULL}, /* 1f reserved entry */ + REF_MASK_REUSE = 0xff000000, + REF_INC_REUSE = 0x01000000, + REF_MASK_VALID = 0x00800000, + REF_MASK_COUNT = 0x007fffff, + REF_MASK_INUSE = 0x00ffffff, }; -static LARGE_INTEGER ShortDelay; -PGDI_HANDLE_TABLE GdiHandleTable = NULL; -static PSECTION_OBJECT GdiTableSection = NULL; +/* GLOBALS *******************************************************************/ -/** INTERNAL FUNCTIONS ********************************************************/ +/* Per session handle table globals */ +static PVOID gpvGdiHdlTblSection = NULL; +static PENTRY gpentHmgr; +static PULONG gpaulRefCount; +ULONG gulFirstFree; +ULONG gulFirstUnused; +static PPAGED_LOOKASIDE_LIST gpaLookasideList; -// Audit Functions -int tDC = 0; -int tBRUSH = 0; -int tBITMAP = 0; -int tFONT = 0; -int tRGN = 0; +static BOOL INTERNAL_CALL GDIOBJ_Cleanup(PVOID ObjectBody); -VOID -AllocTypeDataDump(INT TypeInfo) +static const +GDICLEANUPPROC +apfnCleanup[] = { - switch( TypeInfo & GDI_HANDLE_TYPE_MASK ) - { - case GDILoObjType_LO_BRUSH_TYPE: - tBRUSH++; - break; - case GDILoObjType_LO_DC_TYPE: - tDC++; - break; - case GDILoObjType_LO_BITMAP_TYPE: - tBITMAP++; - break; - case GDILoObjType_LO_FONT_TYPE: - tFONT++; - break; - case GDILoObjType_LO_REGION_TYPE: - tRGN++; - break; - } -} + NULL, /* 00 GDIObjType_DEF_TYPE */ + DC_Cleanup, /* 01 GDIObjType_DC_TYPE */ + NULL, /* 02 GDIObjType_UNUSED1_TYPE */ + NULL, /* 03 GDIObjType_UNUSED2_TYPE */ + REGION_Cleanup, /* 04 GDIObjType_RGN_TYPE */ + SURFACE_Cleanup, /* 05 GDIObjType_SURF_TYPE */ + GDIOBJ_Cleanup, /* 06 GDIObjType_CLIENTOBJ_TYPE */ + GDIOBJ_Cleanup, /* 07 GDIObjType_PATH_TYPE */ + PALETTE_Cleanup, /* 08 GDIObjType_PAL_TYPE */ + GDIOBJ_Cleanup, /* 09 GDIObjType_ICMLCS_TYPE */ + GDIOBJ_Cleanup, /* 0a GDIObjType_LFONT_TYPE */ + NULL, /* 0b GDIObjType_RFONT_TYPE, unused */ + NULL, /* 0c GDIObjType_PFE_TYPE, unused */ + NULL, /* 0d GDIObjType_PFT_TYPE, unused */ + GDIOBJ_Cleanup, /* 0e GDIObjType_ICMCXF_TYPE */ + NULL, /* 0f GDIObjType_SPRITE_TYPE, unused */ + BRUSH_Cleanup, /* 10 GDIObjType_BRUSH_TYPE, BRUSH, PEN, EXTPEN */ + NULL, /* 11 GDIObjType_UMPD_TYPE, unused */ + NULL, /* 12 GDIObjType_UNUSED4_TYPE */ + NULL, /* 13 GDIObjType_SPACE_TYPE, unused */ + NULL, /* 14 GDIObjType_UNUSED5_TYPE */ + NULL, /* 15 GDIObjType_META_TYPE, unused */ + NULL, /* 16 GDIObjType_EFSTATE_TYPE, unused */ + NULL, /* 17 GDIObjType_BMFD_TYPE, unused */ + NULL, /* 18 GDIObjType_VTFD_TYPE, unused */ + NULL, /* 19 GDIObjType_TTFD_TYPE, unused */ + NULL, /* 1a GDIObjType_RC_TYPE, unused */ + NULL, /* 1b GDIObjType_TEMP_TYPE, unused */ + DRIVEROBJ_Cleanup,/* 1c GDIObjType_DRVOBJ_TYPE */ + NULL, /* 1d GDIObjType_DCIOBJ_TYPE, unused */ + NULL, /* 1e GDIObjType_SPOOL_TYPE, unused */ + NULL, /* 1f reserved entry */ +}; -VOID -DeAllocTypeDataDump(INT TypeInfo) -{ - switch( TypeInfo & GDI_HANDLE_TYPE_MASK ) - { - case GDILoObjType_LO_BRUSH_TYPE: - tBRUSH--; - break; - case GDILoObjType_LO_DC_TYPE: - tDC--; - break; - case GDILoObjType_LO_BITMAP_TYPE: - tBITMAP--; - break; - case GDILoObjType_LO_FONT_TYPE: - tFONT--; - break; - case GDILoObjType_LO_REGION_TYPE: - tRGN--; - break; - } -} +/* INTERNAL FUNCTIONS ********************************************************/ -/* - * Dummy GDI Cleanup Callback - */ static BOOL INTERNAL_CALL -GDI_CleanupDummy(PVOID ObjectBody) +GDIOBJ_Cleanup(PVOID ObjectBody) { return TRUE; } -/*! - * Allocate GDI object table. - * \param Size - number of entries in the object table. -*/ -INIT_FUNCTION -PGDI_HANDLE_TABLE -INTERNAL_CALL -GDIOBJ_iAllocHandleTable(OUT PSECTION_OBJECT *SectionObject) +static +VOID +InitLookasideList(UCHAR objt, ULONG cjSize) { - PGDI_HANDLE_TABLE HandleTable = NULL; - LARGE_INTEGER htSize; - UINT ObjType; - ULONG ViewSize = 0; - NTSTATUS Status; - - ASSERT(SectionObject != NULL); - - htSize.QuadPart = sizeof(GDI_HANDLE_TABLE); - - Status = MmCreateSection((PVOID*)SectionObject, - SECTION_ALL_ACCESS, - NULL, - &htSize, - PAGE_READWRITE, - SEC_COMMIT, - NULL, - NULL); - if (!NT_SUCCESS(Status)) - return NULL; - - /* FIXME - use MmMapViewInSessionSpace once available! */ - Status = MmMapViewInSystemSpace(*SectionObject, - (PVOID*)&HandleTable, - &ViewSize); - if (!NT_SUCCESS(Status)) - { - ObDereferenceObject(*SectionObject); - *SectionObject = NULL; - return NULL; - } - - RtlZeroMemory(HandleTable, sizeof(GDI_HANDLE_TABLE)); - - HandleTable->LookasideLists = ExAllocatePoolWithTag(NonPagedPool, - BASE_OBJTYPE_COUNT * sizeof(PAGED_LOOKASIDE_LIST), - TAG_GDIHNDTBLE); - if (HandleTable->LookasideLists == NULL) - { - MmUnmapViewInSystemSpace(HandleTable); - ObDereferenceObject(*SectionObject); - *SectionObject = NULL; - return NULL; - } - - for (ObjType = 0; ObjType < BASE_OBJTYPE_COUNT; ObjType++) - { - if (ObjTypeInfo[ObjType].bUseLookaside) - { - ExInitializePagedLookasideList(HandleTable->LookasideLists + ObjType, - NULL, - NULL, - 0, - ObjTypeInfo[ObjType].ulBodySize, - ObjTypeInfo[ObjType].Tag, - 0); - } - } - - ShortDelay.QuadPart = -5000LL; /* FIXME - 0.5 ms? */ - - HandleTable->FirstFree = 0; - HandleTable->FirstUnused = RESERVE_ENTRIES_COUNT; - - return HandleTable; + ExInitializePagedLookasideList(&gpaLookasideList[objt], + NULL, + NULL, + 0, + cjSize, + GDITAG_HMGR_LOOKASIDE_START + (objt << 24), + 0); } INIT_FUNCTION NTSTATUS NTAPI -InitGdiHandleTable() +InitGdiHandleTable(void) { - /* Create the GDI handle table */ - GdiHandleTable = GDIOBJ_iAllocHandleTable(&GdiTableSection); - if (GdiHandleTable == NULL) + NTSTATUS status; + LARGE_INTEGER liSize; + PVOID pvSection; + SIZE_T cjViewSize = 0; + + /* Create a section for the shared handle table */ + liSize.QuadPart = sizeof(GDI_HANDLE_TABLE);//GDI_HANDLE_COUNT * sizeof(ENTRY); + status = MmCreateSection(&gpvGdiHdlTblSection, + SECTION_ALL_ACCESS, + NULL, + &liSize, + PAGE_READWRITE, + SEC_COMMIT, + NULL, + NULL); + if (!NT_SUCCESS(status)) { - DPRINT1("Failed to initialize the GDI handle table.\n"); - return STATUS_UNSUCCESSFUL; + DPRINT1("INITGDI: Could not allocate a GDI handle table.\n"); + return status; } + /* Map the section in session space */ + status = MmMapViewInSessionSpace(gpvGdiHdlTblSection, + (PVOID*)&gpentHmgr, + &cjViewSize); + if (!NT_SUCCESS(status)) + { + DPRINT1("INITGDI: Failed to map handle table section\n"); + ObDereferenceObject(gpvGdiHdlTblSection); + return status; + } + + /* Allocate memory for the reference counter table */ + gpaulRefCount = EngAllocSectionMem(&pvSection, + FL_ZERO_MEMORY, + GDI_HANDLE_COUNT * sizeof(ULONG), + 'frHG'); + if (!gpaulRefCount) + { + DPRINT1("INITGDI: Failed to allocate reference table.\n"); + ObDereferenceObject(gpvGdiHdlTblSection); + return STATUS_INSUFFICIENT_RESOURCES; + } + + gulFirstFree = 0; + gulFirstUnused = RESERVE_ENTRIES_COUNT; + + GdiHandleTable = (PVOID)gpentHmgr; + + /* Initialize the lookaside lists */ + gpaLookasideList = ExAllocatePoolWithTag(NonPagedPool, + GDIObjTypeTotal * sizeof(PAGED_LOOKASIDE_LIST), + TAG_GDIHNDTBLE); + + InitLookasideList(GDIObjType_DC_TYPE, sizeof(DC)); + InitLookasideList(GDIObjType_RGN_TYPE, sizeof(REGION)); + InitLookasideList(GDIObjType_SURF_TYPE, sizeof(SURFACE)); + InitLookasideList(GDIObjType_CLIENTOBJ_TYPE, sizeof(CLIENTOBJ)); + InitLookasideList(GDIObjType_PATH_TYPE, sizeof(PATH)); + InitLookasideList(GDIObjType_PAL_TYPE, sizeof(PALETTE)); + InitLookasideList(GDIObjType_ICMLCS_TYPE, sizeof(COLORSPACE)); + InitLookasideList(GDIObjType_LFONT_TYPE, sizeof(TEXTOBJ)); + InitLookasideList(GDIObjType_BRUSH_TYPE, sizeof(BRUSH)); + return STATUS_SUCCESS; } - -static void FASTCALL -LockErrorDebugOutput(HGDIOBJ hObj, PGDI_TABLE_ENTRY Entry, LPSTR Function) +FORCEINLINE +VOID +IncrementGdiHandleCount(void) { - if ((Entry->Type & GDI_ENTRY_BASETYPE_MASK) == 0) - { - DPRINT1("%s: Attempted to lock object 0x%x that is deleted!\n", Function, hObj); - GDIDBG_TRACEDELETER(hObj); - } - else if (GDI_HANDLE_GET_REUSECNT(hObj) != GDI_ENTRY_GET_REUSECNT(Entry->Type)) - { - DPRINT1("%s: Attempted to lock object 0x%x, wrong reuse counter (Handle: 0x%x, Entry: 0x%x)\n", - Function, hObj, GDI_HANDLE_GET_REUSECNT(hObj), GDI_ENTRY_GET_REUSECNT(Entry->Type)); - } - else if (GDI_HANDLE_GET_TYPE(hObj) != ((Entry->Type << GDI_ENTRY_UPPER_SHIFT) & GDI_HANDLE_TYPE_MASK)) - { - DPRINT1("%s: Attempted to lock object 0x%x, type mismatch (Handle: 0x%x, Entry: 0x%x)\n", - Function, hObj, GDI_HANDLE_GET_TYPE(hObj), (Entry->Type << GDI_ENTRY_UPPER_SHIFT) & GDI_HANDLE_TYPE_MASK); - } - else - { - DPRINT1("%s: Attempted to lock object 0x%x, something went wrong, typeinfo = 0x%x\n", - Function, hObj, Entry->Type); - } - GDIDBG_TRACECALLER(); + PPROCESSINFO ppi = PsGetCurrentProcessWin32Process(); + if (ppi) InterlockedIncrement((LONG*)&ppi->GDIHandleCount); } -ULONG -FASTCALL -InterlockedPopFreeEntry(VOID) +FORCEINLINE +VOID +DecrementGdiHandleCount(void) +{ + PPROCESSINFO ppi = PsGetCurrentProcessWin32Process(); + if (ppi) InterlockedDecrement((LONG*)&ppi->GDIHandleCount); +} + +static +PENTRY +ENTRY_pentPopFreeEntry(VOID) { ULONG iFirst, iNext, iPrev; - PGDI_TABLE_ENTRY pEntry; + PENTRY pentFree; DPRINT("Enter InterLockedPopFreeEntry\n"); do { /* Get the index and sequence number of the first free entry */ - iFirst = GdiHandleTable->FirstFree; + iFirst = gulFirstFree; /* Check if we have a free entry */ if (!(iFirst & GDI_HANDLE_INDEX_MASK)) { /* Increment FirstUnused and get the new index */ - iFirst = InterlockedIncrement((LONG*)&GdiHandleTable->FirstUnused) - 1; + iFirst = InterlockedIncrement((LONG*)&gulFirstUnused) - 1; /* Check if we have unused entries left */ if (iFirst >= GDI_HANDLE_COUNT) @@ -283,1585 +264,810 @@ InterlockedPopFreeEntry(VOID) return 0; } - /* Return the old index */ - return iFirst; + /* Return the old entry */ + return &gpentHmgr[iFirst]; } /* Get a pointer to the first free entry */ - pEntry = GdiHandleTable->Entries + (iFirst & GDI_HANDLE_INDEX_MASK); + pentFree = &gpentHmgr[iFirst & GDI_HANDLE_INDEX_MASK]; /* Create a new value with an increased sequence number */ - iNext = (USHORT)(ULONG_PTR)pEntry->KernelData; + iNext = (USHORT)(ULONG_PTR)pentFree->einfo.pobj; iNext |= (iFirst & ~GDI_HANDLE_INDEX_MASK) + 0x10000; /* Try to exchange the FirstFree value */ - iPrev = InterlockedCompareExchange((LONG*)&GdiHandleTable->FirstFree, + iPrev = InterlockedCompareExchange((LONG*)&gulFirstFree, iNext, iFirst); } while (iPrev != iFirst); /* Sanity check: is entry really free? */ - ASSERT(((ULONG_PTR)pEntry->KernelData & ~GDI_HANDLE_INDEX_MASK) == 0); + ASSERT(((ULONG_PTR)pentFree->einfo.pobj & ~GDI_HANDLE_INDEX_MASK) == 0); - return iFirst & GDI_HANDLE_INDEX_MASK; + return pentFree; } /* Pushes an entry of the handle table to the free list, - The entry must be unlocked and the base type field must be 0 */ + The entry must not have any references left */ +static VOID -FASTCALL -InterlockedPushFreeEntry(ULONG idxToFree) +ENTRY_vPushFreeEntry(PENTRY pentFree) { - ULONG iToFree, iFirst, iPrev; - PGDI_TABLE_ENTRY pFreeEntry; + ULONG iToFree, iFirst, iPrev, idxToFree; - DPRINT("Enter InterlockedPushFreeEntry\n"); + DPRINT("Enter ENTRY_vPushFreeEntry\n"); - pFreeEntry = GdiHandleTable->Entries + idxToFree; - ASSERT((pFreeEntry->Type & GDI_ENTRY_BASETYPE_MASK) == 0); - ASSERT(pFreeEntry->ProcessId == 0); - pFreeEntry->UserData = NULL; // FIXME - ASSERT(pFreeEntry->UserData == NULL); + idxToFree = pentFree - gpentHmgr; + ASSERT((gpaulRefCount[idxToFree] & REF_MASK_INUSE) == 0); + + /* Initialize entry */ + pentFree->Objt = GDIObjType_DEF_TYPE; + pentFree->ObjectOwner.ulObj = 0; + pentFree->pUser = NULL; + + /* Increase reuse counter in entry and reference counter */ + InterlockedExchangeAdd((LONG*)&gpaulRefCount[idxToFree], REF_INC_REUSE); + pentFree->FullUnique += 0x0100; do { /* Get the current first free index and sequence number */ - iFirst = GdiHandleTable->FirstFree; + iFirst = gulFirstFree; - /* Set the KernelData member to the index of the first free entry */ - pFreeEntry->KernelData = UlongToPtr(iFirst & GDI_HANDLE_INDEX_MASK); + /* Set the einfo.pobj member to the index of the first free entry */ + pentFree->einfo.pobj = UlongToPtr(iFirst & GDI_HANDLE_INDEX_MASK); /* Combine new index and increased sequence number in iToFree */ iToFree = idxToFree | ((iFirst & ~GDI_HANDLE_INDEX_MASK) + 0x10000); /* Try to atomically update the first free entry */ - iPrev = InterlockedCompareExchange((LONG*)&GdiHandleTable->FirstFree, + iPrev = InterlockedCompareExchange((LONG*)&gulFirstFree, iToFree, iFirst); } while (iPrev != iFirst); } - -BOOL -INTERNAL_CALL -GDIOBJ_ValidateHandle(HGDIOBJ hObj, ULONG ObjectType) +static +PENTRY +ENTRY_ReferenceEntryByHandle(HGDIOBJ hobj, FLONG fl) { - PGDI_TABLE_ENTRY Entry = GDI_HANDLE_GET_ENTRY(GdiHandleTable, hObj); - if ((((ULONG_PTR)hObj & GDI_HANDLE_TYPE_MASK) == ObjectType) && - (Entry->Type << GDI_ENTRY_UPPER_SHIFT) == GDI_HANDLE_GET_UPPER(hObj)) + ULONG ulIndex, cNewRefs, cOldRefs; + PENTRY pentry; + + /* Get the handle index and check if its too big */ + ulIndex = GDI_HANDLE_GET_INDEX(hobj); + if (ulIndex >= GDI_HANDLE_COUNT) return NULL; + + /* Get pointer to the entry */ + pentry = &gpentHmgr[ulIndex]; + + /* Get the current reference count */ + cOldRefs = gpaulRefCount[ulIndex]; + + do { - HANDLE pid = (HANDLE)((ULONG_PTR)Entry->ProcessId & ~0x1); - if (pid == NULL || pid == PsGetCurrentProcessId()) + /* Check if the slot is deleted */ + if ((cOldRefs & REF_MASK_VALID) == 0) { - return TRUE; + DPRINT("GDIOBJ: slot not valid: 0x%lx, hobh=%p\n", cOldRefs, hobj); + return NULL; } + + /* Check if the unique value matches */ + if (pentry->FullUnique != (USHORT)((ULONG_PTR)hobj >> 16)) + { + DPRINT("GDIOBJ: wrong unique value. Handle: 0x%4x, entry: 0x%4x\n", + (USHORT)((ULONG_PTR)hobj >> 16, pentry->FullUnique)); + return NULL; + } + + /* Check if the object owner is this process or public */ + if (!(fl & GDIOBJFLAG_IGNOREPID) && + pentry->ObjectOwner.ulObj != GDI_OBJ_HMGR_PUBLIC && + pentry->ObjectOwner.ulObj != PtrToUlong(PsGetCurrentProcessId())) + { + DPRINT("GDIOBJ: Cannot reference foreign handle %p, pentry=%p:%lx.\n", + hobj, pentry, pentry->ObjectOwner.ulObj); + return NULL; + } + + /* Try to atomically increment the reference count */ + cNewRefs = cOldRefs + 1; + cOldRefs = InterlockedCompareExchange((PLONG)&gpaulRefCount[ulIndex], + cNewRefs, + cOldRefs); } - return FALSE; + while (cNewRefs != cOldRefs + 1); + + /* Integrity checks */ + ASSERT((pentry->FullUnique & 0x1f) == pentry->Objt); + ASSERT(pentry->einfo.pobj && pentry->einfo.pobj->hHmgr == hobj); + + return pentry; } -POBJ INTERNAL_CALL -GDIOBJ_AllocObj(UCHAR BaseType) +static +HGDIOBJ +ENTRY_hInsertObject(PENTRY pentry, POBJ pobj, UCHAR objt, ULONG ulOwner) { - POBJ pObject; + ULONG ulIndex; - ASSERT((BaseType & ~GDIObjTypeTotal) == 0); -// BaseType &= GDI_HANDLE_BASETYPE_MASK; + /* Calculate the handle index */ + ulIndex = pentry - gpentHmgr; - if (ObjTypeInfo[BaseType].bUseLookaside) + /* Update the fields in the ENTRY */ + pentry->einfo.pobj = pobj; + pentry->Objt = objt & 0x1f; + pentry->FullUnique = (pentry->FullUnique & 0xff00) | objt; + pentry->ObjectOwner.ulObj = ulOwner; + + /* Make the handle valid with 1 reference */ + ASSERT((gpaulRefCount[ulIndex] & REF_MASK_INUSE) == 0); + InterlockedOr((LONG*)&gpaulRefCount[ulIndex], REF_MASK_VALID | 1); + + /* Return the handle */ + return (HGDIOBJ)(((ULONG_PTR)pentry->FullUnique << 16) | ulIndex); +} + +POBJ +NTAPI +GDIOBJ_AllocateObject(UCHAR objt, ULONG cjSize, FLONG fl) +{ + POBJ pobj; + + if (fl & BASEFLAG_LOOKASIDE) { - PPAGED_LOOKASIDE_LIST LookasideList; - - LookasideList = GdiHandleTable->LookasideLists + BaseType; - pObject = ExAllocateFromPagedLookasideList(LookasideList); + /* Allocate the object from a lookaside list */ + pobj = ExAllocateFromPagedLookasideList(&gpaLookasideList[objt & 0x1f]); } else { - pObject = ExAllocatePoolWithTag(PagedPool, - ObjTypeInfo[BaseType].ulBodySize, - ObjTypeInfo[BaseType].Tag); + /* Allocate the object from paged pool */ + pobj = ExAllocatePoolWithTag(PagedPool, cjSize, GDIOBJ_POOL_TAG(objt)); } - if (pObject) - { - RtlZeroMemory(pObject, ObjTypeInfo[BaseType].ulBodySize); - } + if (!pobj) return NULL; - return pObject; + /* Initialize the object */ + RtlZeroMemory(pobj, cjSize); + pobj->hHmgr = (HGDIOBJ)((ULONG_PTR)objt << 16); + pobj->cExclusiveLock = 0; + pobj->ulShareCount = 1; + pobj->BaseFlags = fl & 0xffff; + DBG_INITLOG(&pobj->slhLog); + DBG_LOGEVENT(&pobj->slhLog, EVENT_ALLOCATE, 0); + + return pobj; } - -/*! - * Allocate memory for GDI object and return handle to it. - * - * \param ObjectType - type of object \ref GDI object types - * - * \return Pointer to the allocated object, which is locked. -*/ -POBJ INTERNAL_CALL -GDIOBJ_AllocObjWithHandle(ULONG ObjectType) +VOID +NTAPI +GDIOBJ_vFreeObject(POBJ pobj) { - PPROCESSINFO W32Process; - POBJ newObject = NULL; - HANDLE CurrentProcessId, LockedProcessId; - UCHAR TypeIndex; - UINT Index; - PGDI_TABLE_ENTRY Entry; - LONG TypeInfo; + UCHAR objt; - GDIDBG_INITLOOPTRACE(); + DBG_CLEANUP_EVENT_LIST(&pobj->slhLog); - W32Process = PsGetCurrentProcessWin32Process(); - /* HACK HACK HACK: simplest-possible quota implementation - don't allow a process - to take too many GDI objects, itself. */ - if (W32Process && W32Process->GDIHandleCount >= 0x2710) + /* Get the object type */ + objt = ((ULONG_PTR)pobj->hHmgr >> 16) & 0x1f; + + /* Call the cleanup procedure */ + ASSERT(apfnCleanup[objt]); + apfnCleanup[objt](pobj); + + /* Check if the object is allocated from a lookaside list */ + if (pobj->BaseFlags & BASEFLAG_LOOKASIDE) { - DPRINT1("Too many objects for process!!!\n"); - DPRINT1("DC %d BRUSH %d BITMAP %d FONT %d RGN %d\n",tDC,tBRUSH,tBITMAP,tFONT,tRGN); - GDIDBG_DUMPHANDLETABLE(); - return NULL; - } - - ASSERT(ObjectType != GDI_OBJECT_TYPE_DONTCARE); - - TypeIndex = GDI_OBJECT_GET_TYPE_INDEX(ObjectType); - - newObject = GDIOBJ_AllocObj(TypeIndex); - if (!newObject) - { - DPRINT1("Not enough memory to allocate gdi object!\n"); - return NULL; - } - - CurrentProcessId = PsGetCurrentProcessId(); - LockedProcessId = (HANDLE)((ULONG_PTR)CurrentProcessId | 0x1); - -// RtlZeroMemory(newObject, ObjTypeInfo[TypeIndex].ulBodySize); - - /* On Windows the higher 16 bit of the type field don't contain the - full type from the handle, but the base type. - (type = BRSUH, PEN, EXTPEN, basetype = BRUSH) */ - TypeInfo = (ObjectType & GDI_HANDLE_BASETYPE_MASK) | (ObjectType >> GDI_ENTRY_UPPER_SHIFT); - - Index = InterlockedPopFreeEntry(); - if (Index != 0) - { - HANDLE PrevProcId; - - Entry = &GdiHandleTable->Entries[Index]; - -LockHandle: - PrevProcId = InterlockedCompareExchangePointer((PVOID*)&Entry->ProcessId, LockedProcessId, 0); - if (PrevProcId == NULL) - { - PTHREADINFO Thread = (PTHREADINFO)PsGetCurrentThreadWin32Thread(); - HGDIOBJ Handle; - - Entry->KernelData = newObject; - - /* copy the reuse-counter */ - TypeInfo |= Entry->Type & GDI_ENTRY_REUSE_MASK; - - /* we found a free entry, no need to exchange this field atomically - since we're holding the lock */ - Entry->Type = TypeInfo; - - /* Create a handle */ - Handle = (HGDIOBJ)((Index & 0xFFFF) | (TypeInfo << GDI_ENTRY_UPPER_SHIFT)); - - /* Initialize BaseObject fields */ - newObject->hHmgr = Handle; - newObject->ulShareCount = 0; - newObject->cExclusiveLock = 1; - newObject->Tid = Thread; -#if DBG - if (Thread) Thread->cExclusiveLocks++; -#endif - - AllocTypeDataDump(TypeInfo); - - /* unlock the entry */ - (void)InterlockedExchangePointer((PVOID*)&Entry->ProcessId, CurrentProcessId); - - GDIDBG_CAPTUREALLOCATOR(Index); - - if (W32Process != NULL) - { - InterlockedIncrement(&W32Process->GDIHandleCount); - } - - DPRINT("GDIOBJ_AllocObj: 0x%x ob: 0x%x\n", Handle, newObject); - return newObject; - } - else - { - GDIDBG_TRACELOOP(Index, PrevProcId, CurrentProcessId); - /* damn, someone is trying to lock the object even though it doesn't - even exist anymore, wait a little and try again! - FIXME - we shouldn't loop forever! Give up after some time! */ - DelayExecution(); - /* try again */ - goto LockHandle; - } - } - - GDIOBJ_FreeObj(newObject, TypeIndex); - - DPRINT1("Failed to insert gdi object into the handle table, no handles left!\n"); - GDIDBG_DUMPHANDLETABLE(); - - return NULL; -} - - -VOID INTERNAL_CALL -GDIOBJ_FreeObj(POBJ pObject, UCHAR BaseType) -{ - /* Object must not have a handle! */ - ASSERT(pObject->hHmgr == NULL); - - if (ObjTypeInfo[BaseType].bUseLookaside) - { - PPAGED_LOOKASIDE_LIST LookasideList; - - LookasideList = GdiHandleTable->LookasideLists + BaseType; - ExFreeToPagedLookasideList(LookasideList, pObject); + ExFreeToPagedLookasideList(&gpaLookasideList[objt], pobj); } else { - ExFreePool(pObject); - } -} - -/*! - * Free memory allocated for the GDI object. For each object type this function calls the - * appropriate cleanup routine. - * - * \param hObj - handle of the object to be deleted. - * - * \return Returns TRUE if succesful. - * \return Returns FALSE if the cleanup routine returned FALSE or the object doesn't belong - * to the calling process. - * - * \bug This function should return VOID and kill the object no matter what... -*/ -BOOL INTERNAL_CALL -GDIOBJ_FreeObjByHandle(HGDIOBJ hObj, DWORD ExpectedType) -{ - PGDI_TABLE_ENTRY Entry; - HANDLE ProcessId, LockedProcessId, PrevProcId; - ULONG HandleType, HandleUpper, TypeIndex; - BOOL Silent; - - GDIDBG_INITLOOPTRACE(); - - DPRINT("GDIOBJ_FreeObj: hObj: 0x%08x\n", hObj); - - if (GDI_HANDLE_IS_STOCKOBJ(hObj)) - { - DPRINT1("GDIOBJ_FreeObj() failed, can't delete stock object handle: 0x%x !!!\n", hObj); - GDIDBG_TRACECALLER(); - return FALSE; - } - - ProcessId = PsGetCurrentProcessId(); - LockedProcessId = (HANDLE)((ULONG_PTR)ProcessId | 0x1); - - Silent = (ExpectedType & GDI_OBJECT_TYPE_SILENT); - ExpectedType &= ~GDI_OBJECT_TYPE_SILENT; - - HandleType = GDI_HANDLE_GET_TYPE(hObj); - HandleUpper = GDI_HANDLE_GET_UPPER(hObj); - - /* Check if we have the requested type */ - if ( (ExpectedType != GDI_OBJECT_TYPE_DONTCARE && - HandleType != ExpectedType) || - HandleType == 0 ) - { - DPRINT1("Attempted to free object 0x%x of wrong type (Handle: 0x%x, expected: 0x%x)\n", - hObj, HandleType, ExpectedType); - GDIDBG_TRACECALLER(); - return FALSE; - } - - Entry = GDI_HANDLE_GET_ENTRY(GdiHandleTable, hObj); - -LockHandle: - /* lock the object, we must not delete global objects, so don't exchange the locking - process ID to zero when attempting to lock a global object... */ - PrevProcId = InterlockedCompareExchangePointer((PVOID*)&Entry->ProcessId, LockedProcessId, ProcessId); - if (PrevProcId == ProcessId) - { - if ( (Entry->KernelData != NULL) && - ((Entry->Type << GDI_ENTRY_UPPER_SHIFT) == HandleUpper) && - ((Entry->Type & GDI_ENTRY_BASETYPE_MASK) == (HandleUpper & GDI_ENTRY_BASETYPE_MASK)) ) - { - POBJ Object; - PTHREADINFO Thread = (PTHREADINFO)PsGetCurrentThreadWin32Thread(); - - Object = Entry->KernelData; - - if ((Object->cExclusiveLock == 0 || Object->Tid == Thread) && - Object->ulShareCount == 0) - { - BOOL Ret; - PPROCESSINFO W32Process = PsGetCurrentProcessWin32Process(); - - /* Clear the basetype field so when unlocking the handle it gets finally deleted and increment reuse counter */ - Entry->Type = (Entry->Type + GDI_ENTRY_REUSE_INC) & ~GDI_ENTRY_BASETYPE_MASK; - - /* unlock the handle slot */ - (void)InterlockedExchangePointer((PVOID*)&Entry->ProcessId, NULL); - - /* push this entry to the free list */ - InterlockedPushFreeEntry(GDI_ENTRY_TO_INDEX(GdiHandleTable, Entry)); - - Object->hHmgr = NULL; -#if DBG - if (Thread) - { - if (Thread->cExclusiveLocks < Object->cExclusiveLock) - { - DPRINT1("cExclusiveLocks = %ld, object: %ld\n", - Thread->cExclusiveLocks, Object->cExclusiveLock); - ASSERT(FALSE); - } - Thread->cExclusiveLocks -= Object->cExclusiveLock; - } -#endif - - if (W32Process != NULL) - { - InterlockedDecrement(&W32Process->GDIHandleCount); - } - - /* call the cleanup routine. */ - TypeIndex = GDI_OBJECT_GET_TYPE_INDEX(HandleType); - Ret = ObjTypeInfo[TypeIndex].CleanupProc(Object); - - DeAllocTypeDataDump(HandleType); - - /* Now it's time to free the memory */ - GDIOBJ_FreeObj(Object, TypeIndex); - - GDIDBG_CAPTUREDELETER(hObj); - return Ret; - } - else if (Object->ulShareCount != 0) - { - NTSTATUS Status; - PEPROCESS OldProcess; - Object->BaseFlags |= BASEFLAG_READY_TO_DIE; - DPRINT("Object %p, ulShareCount = %d\n", Object->hHmgr, Object->ulShareCount); - /* Set NULL owner. Do the work here to avoid race conditions */ - Status = PsLookupProcessByProcessId((HANDLE)((ULONG_PTR)PrevProcId & ~0x1), &OldProcess); - if (NT_SUCCESS(Status)) - { - PPROCESSINFO W32Process = (PPROCESSINFO)OldProcess->Win32Process; - if (W32Process != NULL) - { - InterlockedDecrement(&W32Process->GDIHandleCount); - } - ObDereferenceObject(OldProcess); - } - (void)InterlockedExchangePointer((PVOID*)&Entry->ProcessId, NULL); - /* Don't wait on shared locks */ - return FALSE; - } - else - { - /* - * The object is currently locked by another thread, so freeing is forbidden! - */ - DPRINT1("Object->cExclusiveLock = %d\n", Object->cExclusiveLock); - GDIDBG_TRACECALLER(); - GDIDBG_TRACELOCKER(hObj); - (void)InterlockedExchangePointer((PVOID*)&Entry->ProcessId, PrevProcId); - /* do not assert here for it will call again from dxg.sys it being call twice */ - - DelayExecution(); - goto LockHandle; - } - } - else - { - LockErrorDebugOutput(hObj, Entry, "GDIOBJ_FreeObj"); - (void)InterlockedExchangePointer((PVOID*)&Entry->ProcessId, PrevProcId); - } - } - else if (PrevProcId == LockedProcessId) - { - GDIDBG_TRACELOOP(hObj, PrevProcId, ProcessId); - - /* the object is currently locked, wait some time and try again. - FIXME - we shouldn't loop forever! Give up after some time! */ - DelayExecution(); - /* try again */ - goto LockHandle; - } - else - { - if (!Silent) - { - if ((Entry->Type & GDI_ENTRY_BASETYPE_MASK) == 0) - { - DPRINT1("Attempted to free gdi handle 0x%x that is already deleted!\n", hObj); - } - else if (((ULONG_PTR)PrevProcId & ~0x1) == 0) - { - DPRINT1("Attempted to free global gdi handle 0x%x, caller needs to get ownership first!!!\n", hObj); - } - else - { - DPRINT1("Attempted to free foreign handle: 0x%x Owner: 0x%x from Caller: 0x%x\n", hObj, (ULONG_PTR)PrevProcId & ~0x1, (ULONG_PTR)ProcessId & ~0x1); - } - DPRINT1("Type = 0x%lx, KernelData = 0x%p, ProcessId = 0x%p\n", Entry->Type, Entry->KernelData, Entry->ProcessId); - GDIDBG_TRACECALLER(); - GDIDBG_TRACEALLOCATOR(hObj); - } - } - - return FALSE; -} - -BOOL -FASTCALL -IsObjectDead(HGDIOBJ hObject) -{ - INT Index = GDI_HANDLE_GET_INDEX(hObject); - PGDI_TABLE_ENTRY Entry = &GdiHandleTable->Entries[Index]; - // We check to see if the objects are knocking on deaths door. - if ((Entry->Type & GDI_ENTRY_BASETYPE_MASK) != 0) - return FALSE; - else - { - DPRINT1("Object 0x%x currently being destroyed!!!\n",hObject); - return TRUE; // return true and move on. - } -} - -/* - * Process Environment Cached GDI Handles - * - * What types of GDI handle objects that are cached in the GDI handle buffer? - * Brushes set to BS_SOLID, Pens with widths of zero or set to PS_SOLID, and - * Regions that are set to NULLREGION or SIMPLEREGION. - */ -BOOL -FASTCALL -bPEBCacheHandle(HGDIOBJ Handle, int oType, PVOID pAttr) -{ - PGDIHANDLECACHE GdiHandleCache; - HGDIOBJ *hPtr; - HANDLE Lock; - int Number, Offset, MaxNum = CACHE_PEN_ENTRIES; - BOOL Ret = FALSE; - - GdiHandleCache = (PGDIHANDLECACHE)NtCurrentTeb()->ProcessEnvironmentBlock->GdiHandleBuffer; - - switch (oType) - { - case hctBrushHandle: - Offset = 0; - MaxNum = CACHE_BRUSH_ENTRIES; - break; - - case hctPenHandle: - Offset = CACHE_BRUSH_ENTRIES; - break; - - case hctRegionHandle: - Offset = CACHE_BRUSH_ENTRIES+CACHE_PEN_ENTRIES; - break; - - default: - return FALSE; - } - - Lock = InterlockedCompareExchangePointer( (PVOID*)&GdiHandleCache->ulLock, - NtCurrentTeb(), - NULL ); - if (Lock) return FALSE; - - _SEH2_TRY - { - Number = GdiHandleCache->ulNumHandles[oType]; - - hPtr = GdiHandleCache->Handle + Offset; - - if ( pAttr ) - { - if ( Number < MaxNum ) - { // This object is cached and waiting for it's resurrection by the users. - ((PRGN_ATTR)pAttr)->AttrFlags |= ATTR_CACHED; - hPtr[Number] = Handle; - GdiHandleCache->ulNumHandles[oType]++; - DPRINT("Put Handle Count %d PEB 0x%x\n", GdiHandleCache->ulNumHandles[oType], NtCurrentTeb()->ProcessEnvironmentBlock); - Ret = TRUE; - } - } - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - Ret = FALSE; - } - _SEH2_END; - - (void)InterlockedExchangePointer((PVOID*)&GdiHandleCache->ulLock, Lock); - return Ret; -} - -/*! - * Delete GDI object - * \param hObject object handle - * \return if the function fails the returned value is FALSE. -*/ -BOOL -FASTCALL -GreDeleteObject(HGDIOBJ hObject) -{ - INT Index; - PGDI_TABLE_ENTRY Entry; - DWORD dwObjectType; - INT ihct; - PVOID pAttr = NULL; - - DPRINT("NtGdiDeleteObject handle 0x%08x\n", hObject); - if (!IsObjectDead(hObject)) - { - dwObjectType = GDIOBJ_GetObjectType(hObject); - - Index = GDI_HANDLE_GET_INDEX(hObject); - Entry = &GdiHandleTable->Entries[Index]; - pAttr = Entry->UserData; - - switch (dwObjectType) - { - case GDI_OBJECT_TYPE_BRUSH: - ihct = hctBrushHandle; - break; - - case GDI_OBJECT_TYPE_PEN: - ihct = hctPenHandle; - break; - - case GDI_OBJECT_TYPE_REGION: - ihct = hctRegionHandle; - break; - } - - switch (dwObjectType) - { -// case GDI_OBJECT_TYPE_BRUSH: -// case GDI_OBJECT_TYPE_PEN: - case GDI_OBJECT_TYPE_REGION: - /* If pAttr NULL, the probability is high for System GDI handle object. */ - if ( pAttr && - bPEBCacheHandle(hObject, ihct, pAttr) ) - { /* User space handle only! */ - return TRUE; - } - if (pAttr) - { - FreeObjectAttr(pAttr); - Entry->UserData = NULL; - } - break; - - case GDI_OBJECT_TYPE_DC: -// DC_FreeDcAttr(hObject); - break; - } - - return NULL != hObject - ? GDIOBJ_FreeObjByHandle(hObject, dwObjectType) : FALSE; - } - else - { - DPRINT1("Attempt DeleteObject 0x%x currently being destroyed!!!\n",hObject); - return TRUE; // return true and move on. + ExFreePoolWithTag(pobj, GDIOBJ_POOL_TAG(objt)); } } VOID -FASTCALL -IntDeleteHandlesForProcess(struct _EPROCESS *Process, ULONG ObjectType) +NTAPI +GDIOBJ_vDereferenceObject(POBJ pobj) { - PGDI_TABLE_ENTRY Entry, End; - ULONG Index = RESERVE_ENTRIES_COUNT; - HANDLE ProcId; - PPROCESSINFO W32Process; + ULONG cRefs, ulIndex; - W32Process = (PPROCESSINFO)Process->Win32Process; - ASSERT(W32Process); - - if (W32Process->GDIHandleCount > 0) + /* Check if the object has a handle */ + if (GDI_HANDLE_GET_INDEX(pobj->hHmgr)) { - ProcId = Process->UniqueProcessId; + /* Calculate the index */ + ulIndex = GDI_HANDLE_GET_INDEX(pobj->hHmgr); - /* FIXME - Instead of building the handle here and delete it using GDIOBJ_FreeObj - we should delete it directly here! */ + /* Decrement reference count */ + ASSERT((gpaulRefCount[ulIndex] & REF_MASK_COUNT) > 0); + cRefs = InterlockedDecrement((LONG*)&gpaulRefCount[ulIndex]) & REF_MASK_INUSE; - End = &GdiHandleTable->Entries[GDI_HANDLE_COUNT]; - for (Entry = &GdiHandleTable->Entries[RESERVE_ENTRIES_COUNT]; - Entry != End; - Entry++, Index++) + /* Check if we reached 0 and handle bit is not set */ + if (cRefs == 0) { - /* ignore the lock bit */ - if ( (HANDLE)((ULONG_PTR)Entry->ProcessId & ~0x1) == ProcId) + /* Check if the handle was process owned */ + if (gpentHmgr[ulIndex].ObjectOwner.ulObj != GDI_OBJ_HMGR_PUBLIC && + gpentHmgr[ulIndex].ObjectOwner.ulObj != GDI_OBJ_HMGR_NONE) { - if ( (Entry->Type & GDI_ENTRY_BASETYPE_MASK) == ObjectType || - ObjectType == GDI_OBJECT_TYPE_DONTCARE) - { - HGDIOBJ ObjectHandle; - - /* Create the object handle for the entry, the lower(!) 16 bit of the - Type field includes the type of the object including the stock - object flag - but since stock objects don't have a process id we can - simply ignore this fact here. */ - ObjectHandle = (HGDIOBJ)(Index | (Entry->Type << GDI_ENTRY_UPPER_SHIFT)); - - if (!GDIOBJ_FreeObjByHandle(ObjectHandle, GDI_OBJECT_TYPE_DONTCARE)) - { - DPRINT1("Failed to delete object %p!\n", ObjectHandle); - } - - if (W32Process->GDIHandleCount == 0) - { - /* there are no more gdi handles for this process, bail */ - break; - } - } + /* Decrement the process handle count */ + ASSERT(gpentHmgr[ulIndex].ObjectOwner.ulObj == + HandleToUlong(PsGetCurrentProcessId())); + DecrementGdiHandleCount(); } + + /* Push entry to the free list */ + ENTRY_vPushFreeEntry(&gpentHmgr[ulIndex]); } } + else + { + /* Decrement the objects reference count */ + ASSERT(pobj->ulShareCount > 0); + cRefs = InterlockedDecrement((LONG*)&pobj->ulShareCount); + } + + DBG_LOGEVENT(&pobj->slhLog, EVENT_DEREFERENCE, cRefs); + + /* Check if we reached 0 */ + if (cRefs == 0) + { + /* Make sure it's ok to delete the object */ + ASSERT(pobj->BaseFlags & BASEFLAG_READY_TO_DIE); + + /* Free the object */ + GDIOBJ_vFreeObject(pobj); + } } - -/*! - * Internal function. Called when the process is destroyed to free the remaining GDI handles. - * \param Process - PID of the process that will be destroyed. -*/ -BOOL INTERNAL_CALL -GDI_CleanupForProcess(struct _EPROCESS *Process) +POBJ +NTAPI +GDIOBJ_ReferenceObjectByHandle( + HGDIOBJ hobj, + UCHAR objt) { - PEPROCESS CurrentProcess; - PPROCESSINFO W32Process; + PENTRY pentry; + POBJ pobj; - DPRINT("Starting CleanupForProcess prochandle %x Pid %d\n", Process, Process->UniqueProcessId); - CurrentProcess = PsGetCurrentProcess(); - if (CurrentProcess != Process) + /* Check if the handle type matches */ + ASSERT_SHARED_OBJECT_TYPE(objt); + if ((((ULONG_PTR)hobj >> 16) & 0x1f) != objt) { - KeAttachProcess(&Process->Pcb); + DPRINT("GDIOBJ: wrong type. handle=%p, type=%x\n", hobj, objt); + return NULL; } - W32Process = (PPROCESSINFO)CurrentProcess->Win32Process; - - /* Delete objects. Begin with types that are not referenced by other types */ - IntDeleteHandlesForProcess(Process, GDILoObjType_LO_DC_TYPE); - IntDeleteHandlesForProcess(Process, GDILoObjType_LO_BRUSH_TYPE); - IntDeleteHandlesForProcess(Process, GDILoObjType_LO_BITMAP_TYPE); - - /* Finally finish with what's left */ - IntDeleteHandlesForProcess(Process, GDI_OBJECT_TYPE_DONTCARE); - - if (CurrentProcess != Process) + /* Reference the handle entry */ + pentry = ENTRY_ReferenceEntryByHandle(hobj, 0); + if (!pentry) { - KeDetachProcess(); + DPRINT("GDIOBJ: requested handle 0x%p is not valid.\n", hobj); + return NULL; } -#ifdef GDI_DEBUG - GdiDbgHTIntegrityCheck(); -#endif + /* Get the pointer to the BASEOBJECT */ + pobj = pentry->einfo.pobj; - DPRINT("Completed cleanup for process %d\n", Process->UniqueProcessId); - if (W32Process->GDIHandleCount > 0) + /* Check if the object is exclusively locked */ + if (pobj->cExclusiveLock != 0) { - DPRINT1("Leaking %d handles!\n", W32Process->GDIHandleCount); + DPRINT1("GDIOBJ: Cannot reference oject %p with exclusive lock.\n", hobj); + GDIOBJ_vDereferenceObject(pobj); + DBG_DUMP_EVENT_LIST(&pobj->slhLog); + return NULL; + } + + DBG_LOGEVENT(&pobj->slhLog, EVENT_REFERENCE, gpaulRefCount[pentry - gpentHmgr]); + + /* All is well, return the object */ + return pobj; +} + +VOID +NTAPI +GDIOBJ_vReferenceObjectByPointer(POBJ pobj) +{ + ULONG cRefs; + + /* Must not be exclusively locked */ + ASSERT(pobj->cExclusiveLock == 0); + + /* Check if the object has a handle */ + if (GDI_HANDLE_GET_INDEX(pobj->hHmgr)) + { + /* Increase the handle's reference count */ + ULONG ulIndex = GDI_HANDLE_GET_INDEX(pobj->hHmgr); + ASSERT((gpaulRefCount[ulIndex] & REF_MASK_COUNT) > 0); + cRefs = InterlockedIncrement((LONG*)&gpaulRefCount[ulIndex]); + } + else + { + /* Increase the object's reference count */ + cRefs = InterlockedIncrement((LONG*)&pobj->ulShareCount); + } + + DBG_LOGEVENT(&pobj->slhLog, EVENT_REFERENCE, cRefs); +} + +PGDIOBJ +NTAPI +GDIOBJ_LockObject( + HGDIOBJ hobj, + UCHAR objt) +{ + PENTRY pentry; + POBJ pobj; + DWORD dwThreadId; + + /* Check if the handle type matches */ + ASSERT_EXCLUSIVE_OBJECT_TYPE(objt); + if ((((ULONG_PTR)hobj >> 16) & 0x1f) != objt) + { + DPRINT("wrong object type: hobj=0x%p, objt=0x%x\n", hobj, objt); + return NULL; + } + + /* Reference the handle entry */ + pentry = ENTRY_ReferenceEntryByHandle(hobj, 0); + if (!pentry) + { + DPRINT("GDIOBJ: requested handle 0x%p is not valid.\n", hobj); + return NULL; + } + + /* Get the pointer to the BASEOBJECT */ + pobj = pentry->einfo.pobj; + + /* Check if we already own the lock */ + dwThreadId = PtrToUlong(PsGetCurrentThreadId()); + if (pobj->dwThreadId != dwThreadId) + { + /* Disable APCs and acquire the push lock */ + KeEnterCriticalRegion(); + ExAcquirePushLockExclusive(&pobj->pushlock); + + /* Set us as lock owner */ + ASSERT(pobj->dwThreadId == 0); + pobj->dwThreadId = dwThreadId; + } + + /* Increase lock count */ + pobj->cExclusiveLock++; + DBG_INCREASE_LOCK_COUNT(PsGetCurrentProcessWin32Process(), hobj); + DBG_LOGEVENT(&pobj->slhLog, EVENT_LOCK, 0); + + /* Return the object */ + return pobj; +} + +VOID +NTAPI +GDIOBJ_vUnlockObject(POBJ pobj) +{ + ASSERT(pobj->cExclusiveLock > 0); + + /* Decrease lock count */ + pobj->cExclusiveLock--; + DBG_DECREASE_LOCK_COUNT(PsGetCurrentProcessWin32Process(), pobj->hHmgr); + + /* Check if this was the last lock */ + if (pobj->cExclusiveLock == 0) + { + /* Reset lock owner */ + pobj->dwThreadId = 0; + + /* Release the pushlock and reenable APCs */ + ExReleasePushLockExclusive(&pobj->pushlock); + KeLeaveCriticalRegion(); + } + + /* Dereference the object */ + DBG_LOGEVENT(&pobj->slhLog, EVENT_UNLOCK, 0); + GDIOBJ_vDereferenceObject(pobj); +} + +HGDIOBJ +NTAPI +GDIOBJ_hInsertObject( + POBJ pobj, + ULONG ulOwner) +{ + PENTRY pentry; + UCHAR objt; + + /* Must have no handle and only one reference */ + ASSERT(GDI_HANDLE_GET_INDEX(pobj->hHmgr) == 0); + ASSERT(pobj->cExclusiveLock == 0); + ASSERT(pobj->ulShareCount == 1); + + /* Get a free handle entry */ + pentry = ENTRY_pentPopFreeEntry(); + if (!pentry) + { + DPRINT1("GDIOBJ: could not get a free entry.\n"); + return NULL; + } + + /* Make the object exclusively locked */ + ExInitializePushLock(&pobj->pushlock); + KeEnterCriticalRegion(); + ExAcquirePushLockExclusive(&pobj->pushlock); + pobj->cExclusiveLock = 1; + pobj->dwThreadId = PtrToUlong(PsGetCurrentThreadId()); + DBG_INCREASE_LOCK_COUNT(PsGetCurrentProcessWin32Process(), pobj->hHmgr); + + /* Get object type from the hHmgr field */ + objt = ((ULONG_PTR)pobj->hHmgr >> 16) & 0xff; + ASSERT(objt != GDIObjType_DEF_TYPE); + + /* Check if current process is requested owner */ + if (ulOwner == GDI_OBJ_HMGR_POWNED) + { + /* Increment the process handle count */ + IncrementGdiHandleCount(); + + /* Use Process id */ + ulOwner = HandleToUlong(PsGetCurrentProcessId()); + } + + /* Insert the object into the handle table */ + pobj->hHmgr = ENTRY_hInsertObject(pentry, pobj, objt, ulOwner); + + /* Return the handle */ + DPRINT("GDIOBJ: Created handle: %p\n", pobj->hHmgr); + DBG_LOGEVENT(&pobj->slhLog, EVENT_CREATE_HANDLE, 0); + return pobj->hHmgr; +} + +VOID +NTAPI +GDIOBJ_vSetObjectOwner( + POBJ pobj, + ULONG ulOwner) +{ + PENTRY pentry; + + /* This is a ugly hack, need to fix IntGdiSetDCOwnerEx */ + if (GDI_HANDLE_IS_STOCKOBJ(pobj->hHmgr)) + { + DPRINT("Trying to set ownership of stock object %p to %lx\n", pobj->hHmgr, ulOwner); + return; + } + + /* Get the handle entry */ + ASSERT(GDI_HANDLE_GET_INDEX(pobj->hHmgr)); + pentry = &gpentHmgr[GDI_HANDLE_GET_INDEX(pobj->hHmgr)]; + + /* Is the current process requested? */ + if (ulOwner == GDI_OBJ_HMGR_POWNED) + { + /* Use process id */ + ulOwner = HandleToUlong(PsGetCurrentProcessId()); + if (pentry->ObjectOwner.ulObj != ulOwner) + { + IncrementGdiHandleCount(); + } + } + + // HACK + if (ulOwner == GDI_OBJ_HMGR_NONE) + ulOwner = GDI_OBJ_HMGR_PUBLIC; + + if (ulOwner == GDI_OBJ_HMGR_PUBLIC || + ulOwner == GDI_OBJ_HMGR_NONE) + { + /* Make sure we don't leak user mode memory */ + ASSERT(pentry->pUser == NULL); + if (pentry->ObjectOwner.ulObj != GDI_OBJ_HMGR_PUBLIC && + pentry->ObjectOwner.ulObj != GDI_OBJ_HMGR_NONE) + { + DecrementGdiHandleCount(); + } + } + + /* Set new owner */ + pentry->ObjectOwner.ulObj = ulOwner; +} + +/* Locks 2 or 3 objects at a time */ +BOOL +NTAPI +GDIOBJ_bLockMultipleObjects( + IN ULONG ulCount, + IN HGDIOBJ* ahObj, + OUT PGDIOBJ* apObj, + IN UCHAR objt) +{ + UINT auiIndices[3] = {0, 1, 2}; + UINT i, j, tmp; + + ASSERT(ulCount <= 3); + + /* Sort the handles */ + for (i = 0; i < ulCount - 1; i++) + { + for (j = i + 1; j < ulCount; j++) + { + if ((ULONG_PTR)ahObj[auiIndices[i]] < + (ULONG_PTR)ahObj[auiIndices[j]]) + { + tmp = auiIndices[i]; + auiIndices[i] = auiIndices[j]; + auiIndices[j] = tmp; + } + } + } + + /* Lock the objects in safe order */ + for (i = 0; i < ulCount; i++) + { + /* Skip NULL handles */ + if (ahObj[auiIndices[i]] == NULL) + { + apObj[auiIndices[i]] = NULL; + continue; + } + + /* Lock the object */ + apObj[auiIndices[i]] = GDIOBJ_LockObject(ahObj[auiIndices[i]], objt); + + /* Check for failure */ + if (apObj[auiIndices[i]] == NULL) + { + /* Cleanup */ + while (i--) + { + if (apObj[auiIndices[i]]) + GDIOBJ_vUnlockObject(apObj[auiIndices[i]]); + } + return FALSE; + } } return TRUE; } -/*! - * Return pointer to the object by handle. - * - * \param hObj Object handle - * \return Pointer to the object. - * - * \note Process can only get pointer to the objects it created or global objects. - * - * \todo Get rid of the ExpectedType parameter! -*/ -PGDIOBJ INTERNAL_CALL -GDIOBJ_LockObj(HGDIOBJ hObj, DWORD ExpectedType) +PVOID +NTAPI +GDIOBJ_pvGetObjectAttr(POBJ pobj) { - ULONG HandleIndex; - PGDI_TABLE_ENTRY Entry; - HANDLE ProcessId, HandleProcessId, LockedProcessId, PrevProcId; - POBJ Object = NULL; - ULONG HandleType, HandleUpper; - - /* Check for dummy call */ - if(hObj == NULL) - return NULL ; - - GDIDBG_INITLOOPTRACE(); - - HandleIndex = GDI_HANDLE_GET_INDEX(hObj); - HandleType = GDI_HANDLE_GET_TYPE(hObj); - HandleUpper = GDI_HANDLE_GET_UPPER(hObj); - - /* Check that the handle index is valid. */ - if (HandleIndex >= GDI_HANDLE_COUNT ) - return NULL; - - Entry = &GdiHandleTable->Entries[HandleIndex]; - - /* Check if we have the requested type */ - if ( (ExpectedType != GDI_OBJECT_TYPE_DONTCARE && - HandleType != ExpectedType) || - HandleType == 0 ) - { - DPRINT("Attempted to lock object 0x%x of wrong type (Handle: 0x%x, requested: 0x%x)\n", - hObj, HandleType, ExpectedType); - GDIDBG_TRACECALLER(); - GDIDBG_TRACEALLOCATOR(hObj); - GDIDBG_TRACEDELETER(hObj); - return NULL; - } - - ProcessId = (HANDLE)((ULONG_PTR)PsGetCurrentProcessId() & ~1); - - /* - * Prevent the thread from being terminated during the locking process. - * It would result in undesired effects and inconsistency of the global - * handle table. - */ - - KeEnterCriticalRegion(); - - /* - * Loop until we either successfully lock the handle entry & object or - * fail some of the check. - */ - - for (;;) - { - HandleProcessId = (HANDLE)((ULONG_PTR)Entry->ProcessId & ~1); - - /* Check for invalid owner. */ - if (ProcessId != HandleProcessId && HandleProcessId != NULL) - { - DPRINT1("Tried to lock object (0x%p) of wrong owner! ProcessId = %p, HandleProcessId = %p\n", hObj, ProcessId, HandleProcessId); - GDIDBG_TRACECALLER(); - GDIDBG_TRACEALLOCATOR(hObj); - break; - } - - /* Lock the handle table entry. */ - LockedProcessId = (HANDLE)((ULONG_PTR)HandleProcessId | 0x1); - PrevProcId = InterlockedCompareExchangePointer((PVOID*)&Entry->ProcessId, - LockedProcessId, - HandleProcessId); - - if (PrevProcId == HandleProcessId) - { - /* - * We're locking an object that belongs to our process or it's a - * global object if HandleProcessId is 0 here. - */ - - if ( (Entry->KernelData != NULL) && - ((Entry->Type << GDI_ENTRY_UPPER_SHIFT) == HandleUpper) ) - { - PTHREADINFO Thread = (PTHREADINFO)PsGetCurrentThreadWin32Thread(); - Object = Entry->KernelData; - - if (Object->cExclusiveLock == 0) - { - Object->Tid = Thread; - Object->cExclusiveLock = 1; - GDIDBG_CAPTURELOCKER(GDI_HANDLE_GET_INDEX(hObj)) -#if DBG - if (Thread) Thread->cExclusiveLocks++; -#endif - } - else - { - if (Object->Tid != Thread) - { - /* Unlock the handle table entry. */ - (void)InterlockedExchangePointer((PVOID*)&Entry->ProcessId, PrevProcId); - - DelayExecution(); - continue; - } - InterlockedIncrement((PLONG)&Object->cExclusiveLock); -#if DBG - if (Thread) Thread->cExclusiveLocks++; -#endif - } - } - else - { - /* - * Debugging code. Report attempts to lock deleted handles and - * locking type mismatches. - */ - LockErrorDebugOutput(hObj, Entry, "GDIOBJ_LockObj"); - } - - /* Unlock the handle table entry. */ - (void)InterlockedExchangePointer((PVOID*)&Entry->ProcessId, PrevProcId); - - break; - } - else - { - /* - * The handle is currently locked, wait some time and try again. - */ - GDIDBG_TRACELOOP(hObj, PrevProcId, NULL); - - DelayExecution(); - continue; - } - } - - KeLeaveCriticalRegion(); - - return Object; + ULONG ulIndex = GDI_HANDLE_GET_INDEX(pobj->hHmgr); + return gpentHmgr[ulIndex].pUser; } - -/*! - * Return pointer to the object by handle (and allow sharing of the handle - * across threads). - * - * \param hObj Object handle - * \return Pointer to the object. - * - * \note Process can only get pointer to the objects it created or global objects. - * - * \todo Get rid of the ExpectedType parameter! -*/ -PGDIOBJ INTERNAL_CALL -GDIOBJ_ShareLockObj(HGDIOBJ hObj, DWORD ExpectedType) -{ - ULONG HandleIndex; - PGDI_TABLE_ENTRY Entry; - HANDLE ProcessId, HandleProcessId, LockedProcessId, PrevProcId; - POBJ Object = NULL; - ULONG_PTR HandleType, HandleUpper; - - /* Check for dummy call */ - if(hObj == NULL) - return NULL ; - - HandleIndex = GDI_HANDLE_GET_INDEX(hObj); - HandleType = GDI_HANDLE_GET_TYPE(hObj); - HandleUpper = GDI_HANDLE_GET_UPPER(hObj); - - /* Check that the handle index is valid. */ - if (HandleIndex >= GDI_HANDLE_COUNT) - return NULL; - - /* Check if we have the requested type */ - if ( (ExpectedType != GDI_OBJECT_TYPE_DONTCARE && - HandleType != ExpectedType) || - HandleType == 0 ) - { - DPRINT1("Attempted to lock object 0x%x of wrong type (Handle: 0x%x, requested: 0x%x)\n", - hObj, HandleType, ExpectedType); - return NULL; - } - - Entry = &GdiHandleTable->Entries[HandleIndex]; - - ProcessId = (HANDLE)((ULONG_PTR)PsGetCurrentProcessId() & ~1); - HandleProcessId = (HANDLE)((ULONG_PTR)Entry->ProcessId & ~1); - - /* Check for invalid owner. */ - if (ProcessId != HandleProcessId && HandleProcessId != NULL) - { - return NULL; - } - - /* - * Prevent the thread from being terminated during the locking process. - * It would result in undesired effects and inconsistency of the global - * handle table. - */ - - KeEnterCriticalRegion(); - - /* - * Loop until we either successfully lock the handle entry & object or - * fail some of the check. - */ - - for (;;) - { - /* Lock the handle table entry. */ - LockedProcessId = (HANDLE)((ULONG_PTR)HandleProcessId | 0x1); - PrevProcId = InterlockedCompareExchangePointer((PVOID*)&Entry->ProcessId, - LockedProcessId, - HandleProcessId); - - if (PrevProcId == HandleProcessId) - { - /* - * We're locking an object that belongs to our process or it's a - * global object if HandleProcessId is 0 here. - */ - - if ( (Entry->KernelData != NULL) && - (HandleUpper == (Entry->Type << GDI_ENTRY_UPPER_SHIFT)) ) - { - Object = (POBJ)Entry->KernelData; - -GDIDBG_CAPTURESHARELOCKER(HandleIndex); -#ifdef GDI_DEBUG3 - if (InterlockedIncrement((PLONG)&Object->ulShareCount) == 1) - { - memset(GDIHandleLocker[HandleIndex], 0x00, GDI_STACK_LEVELS * sizeof(ULONG)); - RtlCaptureStackBackTrace(1, GDI_STACK_LEVELS, (PVOID*)GDIHandleShareLocker[HandleIndex], NULL); - } -#else - InterlockedIncrement((PLONG)&Object->ulShareCount); -#endif - } - else - { - /* - * Debugging code. Report attempts to lock deleted handles and - * locking type mismatches. - */ - LockErrorDebugOutput(hObj, Entry, "GDIOBJ_ShareLockObj"); - } - - /* Unlock the handle table entry. */ - (void)InterlockedExchangePointer((PVOID*)&Entry->ProcessId, PrevProcId); - - break; - } - else - { - /* - * The handle is currently locked, wait some time and try again. - */ - - DelayExecution(); - continue; - } - } - - KeLeaveCriticalRegion(); - - return Object; -} - -BOOL INTERNAL_CALL -GDIOBJ_OwnedByCurrentProcess(HGDIOBJ ObjectHandle) -{ - PGDI_TABLE_ENTRY Entry; - HANDLE ProcessId; - BOOL Ret; - - DPRINT("GDIOBJ_OwnedByCurrentProcess: ObjectHandle: 0x%08x\n", ObjectHandle); - - if (!GDI_HANDLE_IS_STOCKOBJ(ObjectHandle)) - { - ProcessId = PsGetCurrentProcessId(); - - Entry = GDI_HANDLE_GET_ENTRY(GdiHandleTable, ObjectHandle); - Ret = Entry->KernelData != NULL && - (Entry->Type & GDI_ENTRY_BASETYPE_MASK) != 0 && - (HANDLE)((ULONG_PTR)Entry->ProcessId & ~0x1) == ProcessId; - - return Ret; - } - - return FALSE; -} - -BOOL INTERNAL_CALL -GDIOBJ_ConvertToStockObj(HGDIOBJ *phObj) -{ - /* - * FIXME !!!!! THIS FUNCTION NEEDS TO BE FIXED - IT IS NOT SAFE WHEN OTHER THREADS - * MIGHT ATTEMPT TO LOCK THE OBJECT DURING THIS CALL!!! - */ - PGDI_TABLE_ENTRY Entry; - HANDLE ProcessId, LockedProcessId, PrevProcId; - PTHREADINFO Thread; - HGDIOBJ hObj; - - GDIDBG_INITLOOPTRACE(); - - ASSERT(phObj); - hObj = *phObj; - - DPRINT("GDIOBJ_ConvertToStockObj: hObj: 0x%08x\n", hObj); - - Thread = (PTHREADINFO)PsGetCurrentThreadWin32Thread(); - - if (!GDI_HANDLE_IS_STOCKOBJ(hObj)) - { - ProcessId = PsGetCurrentProcessId(); - LockedProcessId = (HANDLE)((ULONG_PTR)ProcessId | 0x1); - - Entry = GDI_HANDLE_GET_ENTRY(GdiHandleTable, hObj); - -LockHandle: - /* lock the object, we must not convert stock objects, so don't check!!! */ - PrevProcId = InterlockedCompareExchangePointer((PVOID*)&Entry->ProcessId, LockedProcessId, ProcessId); - if (PrevProcId == ProcessId) - { - LONG NewType, PrevType, OldType; - - /* we're locking an object that belongs to our process. First calculate - the new object type including the stock object flag and then try to - exchange it.*/ - /* On Windows the higher 16 bit of the type field don't contain the - full type from the handle, but the base type. - (type = BRSUH, PEN, EXTPEN, basetype = BRUSH) */ - OldType = ((ULONG)hObj & GDI_HANDLE_BASETYPE_MASK) | ((ULONG)hObj >> GDI_ENTRY_UPPER_SHIFT); - /* We are currently not using bits 24..31 (flags) of the type field, but for compatibility - we copy them as we can't get them from the handle */ - OldType |= Entry->Type & GDI_ENTRY_FLAGS_MASK; - - /* As the object should be a stock object, set it's flag, but only in the lower 16 bits */ - NewType = OldType | GDI_ENTRY_STOCK_MASK; - - /* Try to exchange the type field - but only if the old (previous type) matches! */ - PrevType = InterlockedCompareExchange(&Entry->Type, NewType, OldType); - if (PrevType == OldType && Entry->KernelData != NULL) - { - PTHREADINFO PrevThread; - POBJ Object; - - /* We successfully set the stock object flag. - KernelData should never be NULL here!!! */ - ASSERT(Entry->KernelData); - - Object = Entry->KernelData; - - PrevThread = Object->Tid; - if (Object->cExclusiveLock == 0 || PrevThread == Thread) - { - /* dereference the process' object counter */ - if (PrevProcId != GDI_GLOBAL_PROCESS) - { - PEPROCESS OldProcess; - PPROCESSINFO W32Process; - NTSTATUS Status; - - /* FIXME */ - Status = PsLookupProcessByProcessId((HANDLE)((ULONG_PTR)PrevProcId & ~0x1), &OldProcess); - if (NT_SUCCESS(Status)) - { - W32Process = (PPROCESSINFO)OldProcess->Win32Process; - if (W32Process != NULL) - { - InterlockedDecrement(&W32Process->GDIHandleCount); - } - ObDereferenceObject(OldProcess); - } - } - - hObj = (HGDIOBJ)((ULONG)(hObj) | GDI_HANDLE_STOCK_MASK); - *phObj = hObj; - Object->hHmgr = hObj; - - /* remove the process id lock and make it global */ - (void)InterlockedExchangePointer((PVOID*)&Entry->ProcessId, GDI_GLOBAL_PROCESS); - - /* we're done, successfully converted the object */ - return TRUE; - } - else - { - GDIDBG_TRACELOOP(hObj, PrevThread, Thread); - - /* WTF?! The object is already locked by a different thread! - Release the lock, wait a bit and try again! - FIXME - we should give up after some time unless we want to wait forever! */ - (void)InterlockedExchangePointer((PVOID*)&Entry->ProcessId, PrevProcId); - - DelayExecution(); - goto LockHandle; - } - } - else - { - DPRINT1("Attempted to convert object 0x%x that is deleted! Should never get here!!!\n", hObj); - DPRINT1("OldType = 0x%x, Entry->Type = 0x%x, NewType = 0x%x, Entry->KernelData = 0x%x\n", OldType, Entry->Type, NewType, Entry->KernelData); - } - } - else if (PrevProcId == LockedProcessId) - { - GDIDBG_TRACELOOP(hObj, PrevProcId, ProcessId); - - /* the object is currently locked, wait some time and try again. - FIXME - we shouldn't loop forever! Give up after some time! */ - DelayExecution(); - /* try again */ - goto LockHandle; - } - else - { - DPRINT1("Attempted to convert invalid handle: 0x%x\n", hObj); - } - } - - return FALSE; -} - -BOOL INTERNAL_CALL -GDIOBJ_SetOwnership(HGDIOBJ ObjectHandle, PEPROCESS NewOwner) -{ - PGDI_TABLE_ENTRY Entry; - HANDLE ProcessId, LockedProcessId, PrevProcId; - PTHREADINFO Thread; - BOOL Ret = TRUE; - - GDIDBG_INITLOOPTRACE(); - - DPRINT("GDIOBJ_SetOwnership: hObj: 0x%x, NewProcess: 0x%x\n", ObjectHandle, (NewOwner ? PsGetProcessId(NewOwner) : 0)); - - Thread = (PTHREADINFO)PsGetCurrentThreadWin32Thread(); - - if (!GDI_HANDLE_IS_STOCKOBJ(ObjectHandle)) - { - ProcessId = PsGetCurrentProcessId(); - LockedProcessId = (HANDLE)((ULONG_PTR)ProcessId | 0x1); - - Entry = GDI_HANDLE_GET_ENTRY(GdiHandleTable, ObjectHandle); - -LockHandle: - /* lock the object, we must not convert stock objects, so don't check!!! */ - PrevProcId = InterlockedCompareExchangePointer((PVOID*)&Entry->ProcessId, ProcessId, LockedProcessId); - if (PrevProcId == ProcessId) - { - PTHREADINFO PrevThread; - - if ((Entry->Type & GDI_ENTRY_BASETYPE_MASK) != 0) - { - POBJ Object = Entry->KernelData; - - PrevThread = Object->Tid; - if (Object->cExclusiveLock == 0 || PrevThread == Thread) - { - PEPROCESS OldProcess; - PPROCESSINFO W32Process; - NTSTATUS Status; - - if (NewOwner != NULL) - { - ProcessId = PsGetProcessId(NewOwner); - } - else - ProcessId = 0; - - if((ULONG_PTR)ProcessId == ((ULONG_PTR)PrevProcId & ~0x1)) - { - DPRINT("Setting same process than previous one, nothing to do\n"); - goto done; - } - - /* dereference the process' object counter */ - /* FIXME */ - if ((ULONG_PTR)PrevProcId & ~0x1) - { - Status = PsLookupProcessByProcessId((HANDLE)((ULONG_PTR)PrevProcId & ~0x1), &OldProcess); - if (NT_SUCCESS(Status)) - { - W32Process = (PPROCESSINFO)OldProcess->Win32Process; - if (W32Process != NULL) - { - InterlockedDecrement(&W32Process->GDIHandleCount); - } - ObDereferenceObject(OldProcess); - } - } - - if (NewOwner != NULL) - { - /* Increase the new process' object counter */ - W32Process = (PPROCESSINFO)NewOwner->Win32Process; - if (W32Process != NULL) - { - InterlockedIncrement(&W32Process->GDIHandleCount); - } - } - - done: - /* remove the process id lock and change it to the new process id */ - (void)InterlockedExchangePointer((PVOID*)&Entry->ProcessId, ProcessId); - - /* we're done! */ - return Ret; - } - else - { - GDIDBG_TRACELOOP(ObjectHandle, PrevThread, Thread); - - /* WTF?! The object is already locked by a different thread! - Release the lock, wait a bit and try again! DO reset the pid lock - so we make sure we don't access invalid memory in case the object is - being deleted in the meantime (because we don't have aquired a reference - at this point). - FIXME - we should give up after some time unless we want to wait forever! */ - (void)InterlockedExchangePointer((PVOID*)&Entry->ProcessId, PrevProcId); - - DelayExecution(); - goto LockHandle; - } - } - else - { - DPRINT1("Attempted to change ownership of an object 0x%x currently being destroyed!!!\n", ObjectHandle); - DPRINT1("Entry->Type = 0x%lx, Entry->KernelData = 0x%p\n", Entry->Type, Entry->KernelData); - Ret = FALSE; - } - } - else if (PrevProcId == LockedProcessId) - { - GDIDBG_TRACELOOP(ObjectHandle, PrevProcId, ProcessId); - - /* the object is currently locked, wait some time and try again. - FIXME - we shouldn't loop forever! Give up after some time! */ - DelayExecution(); - /* try again */ - goto LockHandle; - } - else if (((ULONG_PTR)PrevProcId & ~0x1) == 0) - { - /* allow changing ownership of global objects */ - ProcessId = NULL; - LockedProcessId = (HANDLE)((ULONG_PTR)ProcessId | 0x1); - goto LockHandle; - } - else if ((HANDLE)((ULONG_PTR)PrevProcId & ~0x1) != PsGetCurrentProcessId()) - { - DPRINT1("Attempted to change ownership of object 0x%x (pid: 0x%x) from pid 0x%x!!!\n", ObjectHandle, (ULONG_PTR)PrevProcId & ~0x1, PsGetCurrentProcessId()); - Ret = FALSE; - } - else - { - DPRINT1("Attempted to change owner of invalid handle: 0x%x\n", ObjectHandle); - Ret = FALSE; - } - } - return Ret; -} - -BOOL INTERNAL_CALL -GDIOBJ_CopyOwnership(HGDIOBJ CopyFrom, HGDIOBJ CopyTo) -{ - PGDI_TABLE_ENTRY FromEntry; - PTHREADINFO Thread; - HANDLE FromProcessId, FromLockedProcessId, FromPrevProcId; - BOOL Ret = TRUE; - - GDIDBG_INITLOOPTRACE(); - - DPRINT("GDIOBJ_CopyOwnership: from: 0x%x, to: 0x%x\n", CopyFrom, CopyTo); - - Thread = (PTHREADINFO)PsGetCurrentThreadWin32Thread(); - - if (!GDI_HANDLE_IS_STOCKOBJ(CopyFrom) && !GDI_HANDLE_IS_STOCKOBJ(CopyTo)) - { - FromEntry = GDI_HANDLE_GET_ENTRY(GdiHandleTable, CopyFrom); - - FromProcessId = (HANDLE)((ULONG_PTR)FromEntry->ProcessId & ~0x1); - FromLockedProcessId = (HANDLE)((ULONG_PTR)FromProcessId | 0x1); - -LockHandleFrom: - /* lock the object, we must not convert stock objects, so don't check!!! */ - FromPrevProcId = InterlockedCompareExchangePointer((PVOID*)&FromEntry->ProcessId, FromProcessId, FromLockedProcessId); - if (FromPrevProcId == FromProcessId) - { - PTHREADINFO PrevThread; - POBJ Object; - - if ((FromEntry->Type & GDI_ENTRY_BASETYPE_MASK) != 0) - { - Object = FromEntry->KernelData; - - /* save the pointer to the calling thread so we know it was this thread - that locked the object */ - PrevThread = Object->Tid; - if (Object->cExclusiveLock == 0 || PrevThread == Thread) - { - /* now let's change the ownership of the target object */ - - if (((ULONG_PTR)FromPrevProcId & ~0x1) != 0) - { - PEPROCESS ProcessTo; - /* FIXME */ - if (NT_SUCCESS(PsLookupProcessByProcessId((HANDLE)((ULONG_PTR)FromPrevProcId & ~0x1), &ProcessTo))) - { - GDIOBJ_SetOwnership(CopyTo, ProcessTo); - ObDereferenceObject(ProcessTo); - } - } - else - { - /* mark the object as global */ - GDIOBJ_SetOwnership(CopyTo, NULL); - } - - (void)InterlockedExchangePointer((PVOID*)&FromEntry->ProcessId, FromPrevProcId); - } - else - { - GDIDBG_TRACELOOP(CopyFrom, PrevThread, Thread); - - /* WTF?! The object is already locked by a different thread! - Release the lock, wait a bit and try again! DO reset the pid lock - so we make sure we don't access invalid memory in case the object is - being deleted in the meantime (because we don't have aquired a reference - at this point). - FIXME - we should give up after some time unless we want to wait forever! */ - (void)InterlockedExchangePointer((PVOID*)&FromEntry->ProcessId, FromPrevProcId); - - DelayExecution(); - goto LockHandleFrom; - } - } - else - { - DPRINT1("Attempted to copy ownership from an object 0x%x currently being destroyed!!!\n", CopyFrom); - Ret = FALSE; - } - } - else if (FromPrevProcId == FromLockedProcessId) - { - GDIDBG_TRACELOOP(CopyFrom, FromPrevProcId, FromProcessId); - - /* the object is currently locked, wait some time and try again. - FIXME - we shouldn't loop forever! Give up after some time! */ - DelayExecution(); - /* try again */ - goto LockHandleFrom; - } - else if ((HANDLE)((ULONG_PTR)FromPrevProcId & ~0x1) != PsGetCurrentProcessId()) - { - /* FIXME - should we really allow copying ownership from objects that we don't even own? */ - DPRINT1("WARNING! Changing copying ownership of object 0x%x (pid: 0x%x) to pid 0x%x!!!\n", CopyFrom, (ULONG_PTR)FromPrevProcId & ~0x1, PsGetCurrentProcessId()); - FromProcessId = (HANDLE)((ULONG_PTR)FromPrevProcId & ~0x1); - FromLockedProcessId = (HANDLE)((ULONG_PTR)FromProcessId | 0x1); - goto LockHandleFrom; - } - else - { - DPRINT1("Attempted to copy ownership from invalid handle: 0x%x\n", CopyFrom); - Ret = FALSE; - } - } - return Ret; -} - -PVOID INTERNAL_CALL -GDI_MapHandleTable(PEPROCESS Process) -{ - PVOID MappedView = NULL; - NTSTATUS Status; - LARGE_INTEGER Offset; - ULONG ViewSize = sizeof(GDI_HANDLE_TABLE); - - Offset.QuadPart = 0; - - ASSERT(GdiTableSection != NULL); - ASSERT(Process != NULL); - - Status = MmMapViewOfSection(GdiTableSection, - Process, - &MappedView, - 0, - 0, - &Offset, - &ViewSize, - ViewUnmap, - SEC_NO_CHANGE, - PAGE_READONLY); - - if (!NT_SUCCESS(Status)) - return NULL; - - return MappedView; -} - -/* Locks 2 or 3 objects at a time */ VOID -INTERNAL_CALL -GDIOBJ_LockMultipleObjs(ULONG ulCount, - IN HGDIOBJ* ahObj, - OUT PGDIOBJ* apObj) +NTAPI +GDIOBJ_vSetObjectAttr(POBJ pobj, PVOID pvObjAttr) { - UINT auiIndices[3] = {0,1,2}; - UINT i, tmp ; - BOOL bUnsorted = TRUE; + ULONG ulIndex; - /* First is greatest */ - while(bUnsorted) + ASSERT(pobj->hHmgr); + + /* Get the handle index */ + ulIndex = GDI_HANDLE_GET_INDEX(pobj->hHmgr); + + /* Set pointer to the usermode attribute */ + gpentHmgr[ulIndex].pUser = pvObjAttr; +} + +VOID +NTAPI +GDIOBJ_vDeleteObject(POBJ pobj) +{ + ULONG ulIndex; + + /* Set the object's delete flag */ + InterlockedOr16((SHORT*)&pobj->BaseFlags, BASEFLAG_READY_TO_DIE); + DBG_LOGEVENT(&pobj->slhLog, EVENT_DELETE, 0); + + /* Get the handle index */ + ulIndex = GDI_HANDLE_GET_INDEX(pobj->hHmgr); + if (ulIndex) { - bUnsorted = FALSE; - for(i=1; icExclusiveLock != 0) { - if((ULONG_PTR)ahObj[auiIndices[i-1]] < (ULONG_PTR)ahObj[auiIndices[i]]) - { - tmp = auiIndices[i-1]; - auiIndices[i-1] = auiIndices[i]; - auiIndices[i] = tmp; - bUnsorted = TRUE; - } + /* Reset lock owner and lock count */ + pobj->dwThreadId = 0; + pobj->cExclusiveLock = 0; + + /* Release the pushlock and reenable APCs */ + ExReleasePushLockExclusive(&pobj->pushlock); + KeLeaveCriticalRegion(); } } - for(i=0;iEntries[GDI_HANDLE_GET_INDEX(Handle)]; - - if (pEntry->ObjectType == ObjType) - { - if (pEntry->FullUnique == (GDI_HANDLE_GET_UPPER(Handle) >> GDI_ENTRY_UPPER_SHIFT)) - Ret = pEntry->ProcessId & ~1; - } - } - return Ret; -} - -W32KAPI -HANDLE -APIENTRY -NtGdiCreateClientObj( - IN ULONG ulType -) -{ - POBJ pObject; - HANDLE handle; - - /* Mask out everything that would change the type in a wrong manner */ - ulType &= (GDI_HANDLE_TYPE_MASK & ~GDI_HANDLE_BASETYPE_MASK); - - /* Allocate a new object */ - pObject = GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_CLIOBJ | ulType); - if (!pObject) - { - return NULL; - } - - /* get the handle */ - handle = pObject->hHmgr; - - /* Unlock it */ - GDIOBJ_UnlockObjByPtr(pObject); - - return handle; -} - -W32KAPI BOOL -APIENTRY -NtGdiDeleteClientObj( - IN HANDLE h -) +NTAPI +GreIsHandleValid(HGDIOBJ hobj) { - /* We first need to get the real type from the handle */ - ULONG type = GDI_HANDLE_GET_TYPE(h); + PENTRY pentry; - /* Check if it's really a CLIENTOBJ */ - if ((type & GDI_HANDLE_BASETYPE_MASK) != GDILoObjType_LO_CLIENTOBJ_TYPE) + pentry = ENTRY_ReferenceEntryByHandle(hobj, 0); + if (!pentry) return FALSE; + GDIOBJ_vDereferenceObject(pentry->einfo.pobj); + return TRUE; +} + +BOOL +NTAPI +GreDeleteObject(HGDIOBJ hobj) +{ + PENTRY pentry; + + /* Check for stock objects */ + if (GDI_HANDLE_IS_STOCKOBJ(hobj)) { - /* FIXME: SetLastError? */ + DPRINT1("GreDeleteObject: Cannot delete stock object %p.\n", hobj); return FALSE; } - return GDIOBJ_FreeObjByHandle(h, type); + + /* Reference the handle entry */ + pentry = ENTRY_ReferenceEntryByHandle(hobj, 0); + if (!pentry) + { + DPRINT1("GreDeleteObject: Trying to delete invalid object %p\n", hobj); + return FALSE; + } + + /* Check for public owner */ + if (pentry->ObjectOwner.ulObj == GDI_OBJ_HMGR_PUBLIC) + { + DPRINT1("GreDeleteObject: Trying to delete global object %p\n", hobj); + GDIOBJ_vDereferenceObject(pentry->einfo.pobj); + return FALSE; + } + + /* Delete the object */ + GDIOBJ_vDeleteObject(pentry->einfo.pobj); + return TRUE; +} + +ULONG +NTAPI +GreGetObjectOwner(HGDIOBJ hobj) +{ + ULONG ulIndex, ulOwner; + + /* Get the handle index */ + ulIndex = GDI_HANDLE_GET_INDEX(hobj); + + /* Check if the handle is valid */ + if (ulIndex >= GDI_HANDLE_COUNT || + gpentHmgr[ulIndex].Objt == GDIObjType_DEF_TYPE || + ((ULONG_PTR)hobj >> 16) != gpentHmgr[ulIndex].FullUnique) + { + DPRINT1("GreGetObjectOwner: invalid handle 0x%p.\n", hobj); + return GDI_OBJ_HMGR_RESTRICTED; + } + + /* Get the object owner */ + ulOwner = gpentHmgr[ulIndex].ObjectOwner.ulObj; + + if (ulOwner == HandleToUlong(PsGetCurrentProcessId())) + return GDI_OBJ_HMGR_POWNED; + + if (ulOwner == GDI_OBJ_HMGR_PUBLIC) + return GDI_OBJ_HMGR_PUBLIC; + + return GDI_OBJ_HMGR_RESTRICTED; +} + +BOOL +NTAPI +GreSetObjectOwner( + HGDIOBJ hobj, + ULONG ulOwner) +{ + PENTRY pentry; + + /* Check for stock objects */ + if (GDI_HANDLE_IS_STOCKOBJ(hobj)) + { + DPRINT("GreSetObjectOwner: got stock object %p\n", hobj); + return FALSE; + } + + /* Reference the handle entry */ + pentry = ENTRY_ReferenceEntryByHandle(hobj, 0); + if (!pentry) + { + DPRINT("GreSetObjectOwner: invalid handle 0x%p.\n", hobj); + return FALSE; + } + + /* Call internal function */ + GDIOBJ_vSetObjectOwner(pentry->einfo.pobj, ulOwner); + + /* Dereference the object */ + GDIOBJ_vDereferenceObject(pentry->einfo.pobj); + + return TRUE; } INT -FASTCALL -IntGdiGetObject(IN HANDLE Handle, - IN INT cbCount, - IN LPVOID lpBuffer) +NTAPI +GreGetObject( + IN HGDIOBJ hobj, + IN INT cbCount, + IN PVOID pvBuffer) { - PVOID pGdiObject; - INT Result = 0; - DWORD dwObjectType; + PVOID pvObj; + UCHAR objt; + INT iResult = 0; - pGdiObject = GDIOBJ_LockObj(Handle, GDI_OBJECT_TYPE_DONTCARE); - if (!pGdiObject) + /* Verify object type */ + objt = ((ULONG_PTR)hobj >> 16) & 0x1f; + if (objt != GDIObjType_BRUSH_TYPE && + objt != GDIObjType_SURF_TYPE && + objt != GDIObjType_LFONT_TYPE && + objt != GDIObjType_PAL_TYPE) { - EngSetLastError(ERROR_INVALID_HANDLE); - return 0; + DPRINT1("GreGetObject: invalid object type\n"); + return 0; } - dwObjectType = GDIOBJ_GetObjectType(Handle); - switch (dwObjectType) + pvObj = GDIOBJ_ReferenceObjectByHandle(hobj, objt); + if (!pvObj) { - case GDI_OBJECT_TYPE_PEN: - case GDI_OBJECT_TYPE_EXTPEN: - Result = PEN_GetObject((PBRUSH) pGdiObject, cbCount, (PLOGPEN) lpBuffer); // IntGdiCreatePenIndirect - break; + DPRINT("GreGetObject: Could not lock object\n"); + EngSetLastError(ERROR_INVALID_HANDLE); + return 0; + } - case GDI_OBJECT_TYPE_BRUSH: - Result = BRUSH_GetObject((PBRUSH ) pGdiObject, cbCount, (LPLOGBRUSH)lpBuffer); - break; + switch (GDI_HANDLE_GET_TYPE(hobj)) + { + case GDILoObjType_LO_PEN_TYPE: + case GDILoObjType_LO_EXTPEN_TYPE: + iResult = PEN_GetObject(pvObj, cbCount, pvBuffer); + break; - case GDI_OBJECT_TYPE_BITMAP: - Result = BITMAP_GetObject((SURFACE *) pGdiObject, cbCount, lpBuffer); - break; - case GDI_OBJECT_TYPE_FONT: - Result = FontGetObject((PTEXTOBJ) pGdiObject, cbCount, lpBuffer); + case GDILoObjType_LO_BRUSH_TYPE: + iResult = BRUSH_GetObject(pvObj, cbCount, pvBuffer); + break; + + case GDILoObjType_LO_BITMAP_TYPE: + iResult = BITMAP_GetObject(pvObj, cbCount, pvBuffer); + break; + case GDILoObjType_LO_FONT_TYPE: + iResult = FontGetObject(pvObj, cbCount, pvBuffer); #if 0 - // Fix the LOGFONT structure for the stock fonts - if (FIRST_STOCK_HANDLE <= Handle && Handle <= LAST_STOCK_HANDLE) - { - FixStockFontSizeW(Handle, cbCount, lpBuffer); - } + // Fix the LOGFONT structure for the stock fonts + if (FIRST_STOCK_HANDLE <= hobj && hobj <= LAST_STOCK_HANDLE) + { + FixStockFontSizeW(hobj, cbCount, pvBuffer); + } #endif - break; + break; - case GDI_OBJECT_TYPE_PALETTE: - Result = PALETTE_GetObject((PPALETTE) pGdiObject, cbCount, lpBuffer); - break; + case GDILoObjType_LO_PALETTE_TYPE: + iResult = PALETTE_GetObject(pvObj, cbCount, pvBuffer); + break; - default: - DPRINT1("GDI object type 0x%08x not implemented\n", dwObjectType); - break; + default: + DPRINT1("GDI object type of 0x%p not implemented\n", hobj); + break; } - GDIOBJ_UnlockObjByPtr(pGdiObject); - - return Result; + GDIOBJ_vDereferenceObject(pvObj); + return iResult; } - - W32KAPI INT APIENTRY -NtGdiExtGetObjectW(IN HANDLE hGdiObj, - IN INT cbCount, - OUT LPVOID lpBuffer) +NtGdiExtGetObjectW( + IN HANDLE hobj, + IN INT cbCount, + OUT LPVOID lpBuffer) { INT iRetCount = 0; INT cbCopyCount; @@ -1874,35 +1080,261 @@ NtGdiExtGetObjectW(IN HANDLE hGdiObj, LOGFONTW logfontw; EXTLOGFONTW extlogfontw; ENUMLOGFONTEXDVW enumlogfontexdvw; - } Object; + } object; - // Normalize to the largest supported object size - cbCount = min((UINT)cbCount, sizeof(Object)); + /* Normalize to the largest supported object size */ + cbCount = min((UINT)cbCount, sizeof(object)); - // Now do the actual call - iRetCount = IntGdiGetObject(hGdiObj, cbCount, lpBuffer ? &Object : NULL); + /* Now do the actual call */ + iRetCount = GreGetObject(hobj, cbCount, lpBuffer ? &object : NULL); cbCopyCount = min((UINT)cbCount, (UINT)iRetCount); - // Make sure we have a buffer and a copy size + /* Make sure we have a buffer and a copy size */ if ((cbCopyCount) && (lpBuffer)) { - // Enter SEH for buffer transfer + /* Enter SEH for buffer transfer */ _SEH2_TRY { // Probe the buffer and copy it ProbeForWrite(lpBuffer, cbCopyCount, sizeof(WORD)); - RtlCopyMemory(lpBuffer, &Object, cbCopyCount); + RtlCopyMemory(lpBuffer, &object, cbCopyCount); } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { - // Clear the return value. - // Do *NOT* set last error here! + /* Clear the return value. + * Do *NOT* set last error here! */ iRetCount = 0; } _SEH2_END; } - // Return the count + + /* Return the count */ return iRetCount; } -/* EOF */ +W32KAPI +HANDLE +APIENTRY +NtGdiCreateClientObj( + IN ULONG ulType) +{ + POBJ pObject; + HANDLE handle; + + /* Allocate a new object */ + pObject = GDIOBJ_AllocateObject(GDIObjType_CLIENTOBJ_TYPE, + sizeof(CLIENTOBJ), + BASEFLAG_LOOKASIDE); + if (!pObject) + { + DPRINT1("NtGdiCreateClientObj: Could not allocate a clientobj.\n"); + return NULL; + } + + /* Mask out everything that would change the type in a wrong manner */ + ulType &= (GDI_HANDLE_TYPE_MASK & ~GDI_HANDLE_BASETYPE_MASK); + + /* Set the real object type */ + pObject->hHmgr = UlongToHandle(ulType | GDILoObjType_LO_CLIENTOBJ_TYPE); + + /* Create a handle */ + handle = GDIOBJ_hInsertObject(pObject, GDI_OBJ_HMGR_POWNED); + if (!handle) + { + DPRINT1("NtGdiCreateClientObj Could not create a handle.\n"); + GDIOBJ_vFreeObject(pObject); + return NULL; + } + + /* Unlock it */ + GDIOBJ_vUnlockObject(pObject); + + return handle; +} + +W32KAPI +BOOL +APIENTRY +NtGdiDeleteClientObj( + IN HANDLE hobj) +{ + /* We first need to get the real type from the handle */ + ULONG ulType = GDI_HANDLE_GET_TYPE(hobj); + + /* Check if it's really a CLIENTOBJ */ + if ((ulType & GDI_HANDLE_BASETYPE_MASK) != GDILoObjType_LO_CLIENTOBJ_TYPE) + { + /* FIXME: SetLastError? */ + return FALSE; + } + + return GreDeleteObject(hobj); +} + + + +PGDI_HANDLE_TABLE GdiHandleTable = NULL; + +PGDIOBJ INTERNAL_CALL +GDIOBJ_ShareLockObj(HGDIOBJ hObj, DWORD ExpectedType) +{ + if (ExpectedType == GDI_OBJECT_TYPE_DONTCARE) + ExpectedType = GDI_HANDLE_GET_TYPE(hObj); + return GDIOBJ_ReferenceObjectByHandle(hObj, (ExpectedType >> 16) & 0x1f); +} + +// This function is not safe to use with concurrent deleting attempts +// That shouldn't be a problem, since we don't have any processes yet, +// that could delete the handle +BOOL +INTERNAL_CALL +GDIOBJ_ConvertToStockObj(HGDIOBJ *phObj) +{ + PENTRY pentry; + POBJ pobj; + + /* Reference the handle entry */ + pentry = ENTRY_ReferenceEntryByHandle(*phObj, 0); + if (!pentry) + { + DPRINT1("GDIOBJ: requested handle 0x%p is not valid.\n", *phObj); + return FALSE; + } + + /* Update the entry */ + pentry->FullUnique |= GDI_ENTRY_STOCK_MASK; + pentry->ObjectOwner.ulObj = 0; + + /* Get the pointer to the BASEOBJECT */ + pobj = pentry->einfo.pobj; + + /* Calculate the new handle */ + pobj->hHmgr = (HGDIOBJ)((ULONG_PTR)pobj->hHmgr | GDI_HANDLE_STOCK_MASK); + + /* Return the new handle */ + *phObj = pobj->hHmgr; + + /* Dereference the handle */ + GDIOBJ_vDereferenceObject(pobj); + + return TRUE; +} + +POBJ INTERNAL_CALL +GDIOBJ_AllocObjWithHandle(ULONG ObjectType, ULONG cjSize) +{ + POBJ pobj; + FLONG fl = 0; + UCHAR objt = ObjectType >> 16; + + if ((objt == GDIObjType_DC_TYPE && cjSize == sizeof(DC)) || + (objt == GDIObjType_PAL_TYPE && cjSize == sizeof(PALETTE)) || + (objt == GDIObjType_RGN_TYPE && cjSize == sizeof(REGION)) || + (objt == GDIObjType_SURF_TYPE && cjSize == sizeof(SURFACE)) || + (objt == GDIObjType_PATH_TYPE && cjSize == sizeof(PATH))) + { + fl |= BASEFLAG_LOOKASIDE; + } + + pobj = GDIOBJ_AllocateObject(objt, cjSize, fl); + if (!GDIOBJ_hInsertObject(pobj, GDI_OBJ_HMGR_POWNED)) + { + GDIOBJ_vFreeObject(pobj); + return NULL; + } + return pobj; +} + +PVOID INTERNAL_CALL +GDI_MapHandleTable(PEPROCESS pProcess) +{ + PVOID pvMappedView = NULL; + NTSTATUS Status; + LARGE_INTEGER liOffset; + ULONG cjViewSize = sizeof(GDI_HANDLE_TABLE); + + liOffset.QuadPart = 0; + + ASSERT(gpvGdiHdlTblSection != NULL); + ASSERT(pProcess != NULL); + + Status = MmMapViewOfSection(gpvGdiHdlTblSection, + pProcess, + &pvMappedView, + 0, + 0, + &liOffset, + &cjViewSize, + ViewUnmap, + SEC_NO_CHANGE, + PAGE_READONLY); + + if (!NT_SUCCESS(Status)) + return NULL; + + return pvMappedView; +} + +BOOL INTERNAL_CALL +GDI_CleanupForProcess(struct _EPROCESS *Process) +{ + PENTRY pentry; + ULONG ulIndex; + DWORD dwProcessId; + PPROCESSINFO ppi; + + DPRINT("CleanupForProcess prochandle %x Pid %d\n", + Process, Process->UniqueProcessId); + + ASSERT(Process == PsGetCurrentProcess()); + + /* Get the current process Id */ + dwProcessId = PtrToUlong(PsGetCurrentProcessId()); + + /* Loop all handles in the handle table */ + for (ulIndex = RESERVE_ENTRIES_COUNT; ulIndex < gulFirstUnused; ulIndex++) + { + pentry = &gpentHmgr[ulIndex]; + + /* Check if the object is owned by the process */ + if (pentry->ObjectOwner.ulObj == dwProcessId) + { + ASSERT(pentry->einfo.pobj->cExclusiveLock == 0); + + /* Reference the object and delete it */ + InterlockedIncrement((LONG*)&gpaulRefCount[ulIndex]); + GDIOBJ_vDeleteObject(pentry->einfo.pobj); + } + } + +//#ifdef GDI_DEBUG + DbgGdiHTIntegrityCheck(); +//#endif + + ppi = PsGetCurrentProcessWin32Process(); + DPRINT("Completed cleanup for process %d\n", Process->UniqueProcessId); + if (ppi->GDIHandleCount != 0) + { + DPRINT1("Leaking %d handles!\n", ppi->GDIHandleCount); + ASSERT(FALSE); + } + + /* Loop all handles in the handle table */ + for (ulIndex = RESERVE_ENTRIES_COUNT; ulIndex < gulFirstUnused; ulIndex++) + { + pentry = &gpentHmgr[ulIndex]; + + /* Check if the object is owned by the process */ + if (pentry->ObjectOwner.ulObj == dwProcessId) + { + DPRINT1("Leaking object. Index=%lx, type=0x%x, refcount=%lx\n", + ulIndex, pentry->Objt, gpaulRefCount[ulIndex]); + DBG_DUMP_EVENT_LIST(&pentry->einfo.pobj->slhLog); + //DBG_CLEANUP_EVENT_LIST(&pentry->einfo.pobj->slhLog); + ASSERT(FALSE); + } + } + + return TRUE; +} + diff --git a/subsystems/win32/win32k/objects/gdipool.c b/subsystems/win32/win32k/objects/gdipool.c index ebe81f25208..c78c789e215 100644 --- a/subsystems/win32/win32k/objects/gdipool.c +++ b/subsystems/win32/win32k/objects/gdipool.c @@ -1,7 +1,7 @@ /* * PROJECT: ReactOS win32 kernel mode subsystem * LICENSE: GPL - See COPYING in the top level directory - * FILE: subsystems/win32/win32k/objects/gdiobj.c + * FILE: subsystems/win32/win32k/objects/gdipool.c * PURPOSE: Static size allocator for user mode object attributes * PROGRAMMERS: Timo Kreuzer */ @@ -34,6 +34,9 @@ typedef struct _GDI_POOL ULONG cSlotsPerSection; ULONG cEmptySections; EX_PUSH_LOCK pushlock; // for pool growth +#if DBG_ENABLE_EVENT_LOGGING + SLIST_HEADER slhLog; +#endif LIST_ENTRY leInUseList; LIST_ENTRY leEmptyList; @@ -95,7 +98,13 @@ GdiPoolDeleteSection(PGDI_POOL pPool, PGDI_POOL_SECTION pSection) SIZE_T cjSize = 0; /* Should not have any allocations */ - ASSERT(pSection->cAllocCount == 0); + if (pSection->cAllocCount != 0) + { + DPRINT1("There are %ld allocations left, section=%p, pool=%p\n", + pSection->cAllocCount, pSection, pPool); + DBG_DUMP_EVENT_LIST(&pPool->slhLog); + ASSERT(FALSE); + } /* Release the virtual memory */ status = ZwFreeVirtualMemory(NtCurrentProcess(), @@ -186,8 +195,11 @@ GdiPoolAllocate( pSection->ulCommitBitmap |= ulPageBit; } - /* Increase alloc count and check if section is now busy */ + /* Increase alloc count */ pSection->cAllocCount++; + DBG_LOGEVENT(&pPool->slhLog, EVENT_ALLOCATE, pvAlloc); + + /* Check if section is now busy */ if (pSection->cAllocCount == pPool->cSlotsPerSection) { /* Remove the section from the ready list */ @@ -198,12 +210,11 @@ done: /* Release the pool lock and enable APCs */ ExReleasePushLockExclusive(&pPool->pushlock); KeLeaveCriticalRegion(); -DPRINT1("GdiPoolallocate: %p\n", pvAlloc); + DPRINT("GdiPoolallocate: %p\n", pvAlloc); return pvAlloc; } - VOID NTAPI GdiPoolFree( @@ -211,10 +222,10 @@ GdiPoolFree( PVOID pvAlloc) { PLIST_ENTRY ple; - PGDI_POOL_SECTION pSection; + PGDI_POOL_SECTION pSection = NULL; ULONG_PTR cjOffset; ULONG ulIndex; -DPRINT1("GdiPoolFree: %p\n", pvAlloc); + DPRINT("GdiPoolFree: %p\n", pvAlloc); /* Disable APCs and acquire the pool lock */ KeEnterCriticalRegion(); @@ -243,6 +254,7 @@ DPRINT1("GdiPoolFree: %p\n", pvAlloc); /* Decrease allocation count */ pSection->cAllocCount--; + DBG_LOGEVENT(&pPool->slhLog, EVENT_FREE, pvAlloc); /* Check if the section got valid now */ if (pSection->cAllocCount == pPool->cSlotsPerSection - 1) @@ -274,6 +286,8 @@ DPRINT1("GdiPoolFree: %p\n", pvAlloc); } } + DbgPrint("failed to free. pvAlloc=%p, base=%p, size=%lx\n", + pvAlloc, pSection->pvBaseAddress, pPool->cjSectionSize); ASSERT(FALSE); // KeBugCheck() @@ -305,6 +319,7 @@ GdiPoolCreate( pPool->ulTag = ulTag; pPool->cjSectionSize = GDI_POOL_ALLOCATION_GRANULARITY; pPool->cSlotsPerSection = pPool->cjSectionSize / cjAllocSize; + DBG_INITLOG(&pPool->slhLog); return pPool; } @@ -317,20 +332,24 @@ GdiPoolDestroy(PGDI_POOL pPool) PLIST_ENTRY ple; /* Loop all empty sections, removing them */ - while ((ple = RemoveHeadList(&pPool->leEmptyList))) + while (!IsListEmpty(&pPool->leEmptyList)) { /* Delete the section */ + ple = RemoveHeadList(&pPool->leEmptyList); pSection = CONTAINING_RECORD(ple, GDI_POOL_SECTION, leInUseLink); GdiPoolDeleteSection(pPool, pSection); } /* Loop all ready sections, removing them */ - while ((ple = RemoveHeadList(&pPool->leInUseList))) + while (!IsListEmpty(&pPool->leInUseList)) { /* Delete the section */ + ple = RemoveHeadList(&pPool->leInUseList); pSection = CONTAINING_RECORD(ple, GDI_POOL_SECTION, leInUseLink); GdiPoolDeleteSection(pPool, pSection); } + DBG_CLEANUP_EVENT_LIST(&pPool->slhLog); + EngFreeMem(pPool); } diff --git a/subsystems/win32/win32k/objects/icm.c b/subsystems/win32/win32k/objects/icm.c index f67ff9ca61a..8e76174de75 100644 --- a/subsystems/win32/win32k/objects/icm.c +++ b/subsystems/win32/win32k/objects/icm.c @@ -50,9 +50,10 @@ IntGdiDeleteColorSpace( { BOOL Ret = FALSE; - if ( hColorSpace != hStockColorSpace ) + if ( hColorSpace != hStockColorSpace && + GDI_HANDLE_GET_TYPE(hColorSpace) == GDILoObjType_LO_ICMLCS_TYPE) { - Ret = COLORSPACEOBJ_FreeCSByHandle(hColorSpace); + Ret = GreDeleteObject(hColorSpace); if ( !Ret ) EngSetLastError(ERROR_INVALID_PARAMETER); } return Ret; @@ -216,7 +217,7 @@ NtGdiSetColorSpace(IN HDC hdc, if (pDC->dclevel.pColorSpace) { - GDIOBJ_ShareUnlockObjByPtr((POBJ) pDC->dclevel.pColorSpace); + GDIOBJ_vDereferenceObject((POBJ) pDC->dclevel.pColorSpace); } pDC->dclevel.pColorSpace = pCS; diff --git a/subsystems/win32/win32k/objects/palette.c b/subsystems/win32/win32k/objects/palette.c index a283a85732c..6da9f41e738 100644 --- a/subsystems/win32/win32k/objects/palette.c +++ b/subsystems/win32/win32k/objects/palette.c @@ -144,27 +144,27 @@ VOID FASTCALL PALETTE_ValidateFlags(PALETTEENTRY* lpPalE, INT size) lpPalE[i].peFlags = PC_SYS_USED | (lpPalE[i].peFlags & 0x07); } -HPALETTE -FASTCALL -PALETTE_AllocPalette(ULONG Mode, +PPALETTE +NTAPI +PALETTE_AllocPalette2(ULONG Mode, ULONG NumColors, ULONG *Colors, ULONG Red, ULONG Green, ULONG Blue) { - HPALETTE NewPalette; PPALETTE PalGDI; - PalGDI = (PPALETTE)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_PALETTE); + PalGDI = (PPALETTE)GDIOBJ_AllocateObject(GDIObjType_PAL_TYPE, + sizeof(PALETTE), + BASEFLAG_LOOKASIDE); if (!PalGDI) { + DPRINT1("Could not allocate a palette.\n"); return NULL; } - NewPalette = PalGDI->BaseObject.hHmgr; - - PalGDI->Self = NewPalette; + PalGDI->Self = PalGDI->BaseObject.hHmgr; PalGDI->flFlags = Mode; if (NULL != Colors) @@ -174,8 +174,7 @@ PALETTE_AllocPalette(ULONG Mode, TAG_PALETTE); if (NULL == PalGDI->IndexedColors) { - PALETTE_UnlockPalette(PalGDI); - PALETTE_FreePaletteByHandle(NewPalette); + GDIOBJ_vDeleteObject(&PalGDI->BaseObject); return NULL; } RtlCopyMemory(PalGDI->IndexedColors, Colors, sizeof(PALETTEENTRY) * NumColors); @@ -201,9 +200,35 @@ PALETTE_AllocPalette(ULONG Mode, PalGDI->flFlags |= PAL_RGB; } - PALETTE_UnlockPalette(PalGDI); + return PalGDI; +} - return NewPalette; +HPALETTE +FASTCALL +PALETTE_AllocPalette(ULONG Mode, + ULONG NumColors, + ULONG *Colors, + ULONG Red, + ULONG Green, + ULONG Blue) +{ + PPALETTE ppal; + HPALETTE hpal; + + ppal = PALETTE_AllocPalette2(Mode, NumColors, Colors, Red, Green, Blue); + if (!ppal) return NULL; + + hpal = GDIOBJ_hInsertObject(&ppal->BaseObject, GDI_OBJ_HMGR_POWNED); + if (!hpal) + { + DPRINT1("Could not insert palette into handle table.\n"); + GDIOBJ_vFreeObject(&ppal->BaseObject); + return NULL; + } + + PALETTE_UnlockPalette(ppal); + + return hpal; } HPALETTE @@ -215,9 +240,19 @@ PALETTE_AllocPaletteIndexedRGB(ULONG NumColors, PPALETTE PalGDI; UINT i; - PalGDI = (PPALETTE)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_PALETTE); + PalGDI = (PPALETTE)GDIOBJ_AllocateObject(GDIObjType_PAL_TYPE, + sizeof(PALETTE), + BASEFLAG_LOOKASIDE); if (!PalGDI) { + DPRINT1("Could not allocate a palette.\n"); + return NULL; + } + + if (!GDIOBJ_hInsertObject(&PalGDI->BaseObject, GDI_OBJ_HMGR_POWNED)) + { + DPRINT1("Could not insert palette into handle table.\n"); + GDIOBJ_vFreeObject(&PalGDI->BaseObject); return NULL; } @@ -231,8 +266,7 @@ PALETTE_AllocPaletteIndexedRGB(ULONG NumColors, TAG_PALETTE); if (NULL == PalGDI->IndexedColors) { - PALETTE_UnlockPalette(PalGDI); - PALETTE_FreePaletteByHandle(NewPalette); + GDIOBJ_vDeleteObject(&PalGDI->BaseObject); return NULL; } @@ -390,22 +424,29 @@ ColorCorrection(PPALETTE PalGDI, PPALETTEENTRY PaletteEntry, ULONG Colors) HPALETTE APIENTRY EngCreatePalette( - ULONG Mode, - ULONG NumColors, - ULONG *Colors, - ULONG Red, - ULONG Green, - ULONG Blue) + ULONG iMode, + ULONG cColors, + ULONG *pulColors, + ULONG flRed, + ULONG flGreen, + ULONG flBlue) { - HPALETTE Palette; + PPALETTE ppal; + HPALETTE hpal; - Palette = PALETTE_AllocPalette(Mode, NumColors, Colors, Red, Green, Blue); - if (Palette != NULL) + ppal = PALETTE_AllocPalette2(iMode, cColors, pulColors, flRed, flGreen, flBlue); + if (!ppal) return NULL; + + hpal = GDIOBJ_hInsertObject(&ppal->BaseObject, GDI_OBJ_HMGR_PUBLIC); + if (!hpal) { - GDIOBJ_SetOwnership(Palette, NULL); + DPRINT1("Could not insert palette into handle table.\n"); + GDIOBJ_vFreeObject(&ppal->BaseObject); + return NULL; } - return Palette; + PALETTE_UnlockPalette(ppal); + return hpal; } /* @@ -413,11 +454,16 @@ EngCreatePalette( */ BOOL APIENTRY -EngDeletePalette(IN HPALETTE Palette) +EngDeletePalette(IN HPALETTE hpal) { - GDIOBJ_SetOwnership(Palette, PsGetCurrentProcess()); + PPALETTE ppal; - return PALETTE_FreePaletteByHandle(Palette); + ppal = PALETTE_ShareLockPalette(hpal); + if (!ppal) return FALSE; + + GDIOBJ_vDeleteObject(&ppal->BaseObject); + + return TRUE; } /* diff --git a/subsystems/win32/win32k/objects/path.c b/subsystems/win32/win32k/objects/path.c index 0b1a7aa512c..82ccf439920 100644 --- a/subsystems/win32/win32k/objects/path.c +++ b/subsystems/win32/win32k/objects/path.c @@ -70,8 +70,7 @@ PATH_Delete(HPATH hPath) pPath = PATH_LockPath( hPath ); if (!pPath) return FALSE; PATH_DestroyGdiPath( pPath ); - PATH_UnlockPath( pPath ); - PATH_FreeExtPathByHandle(hPath); + GDIOBJ_vDeleteObject(&pPath->BaseObject); return TRUE; } @@ -1527,7 +1526,7 @@ PATH_WidenPath(DC *dc) PATH_FlattenPath(pPath); - size = IntGdiGetObject( pdcattr->hpen, 0, NULL); + size = GreGetObject( pdcattr->hpen, 0, NULL); if (!size) { PATH_UnlockPath( pPath ); @@ -1536,9 +1535,9 @@ PATH_WidenPath(DC *dc) } elp = ExAllocatePoolWithTag(PagedPool, size, TAG_PATH); - (VOID) IntGdiGetObject( pdcattr->hpen, size, elp); + GreGetObject(pdcattr->hpen, size, elp); - obj_type = GDIOBJ_GetObjectType(pdcattr->hpen); + obj_type = GDI_HANDLE_GET_TYPE(pdcattr->hpen); if(obj_type == GDI_OBJECT_TYPE_PEN) { penStyle = ((LOGPEN*)elp)->lopnStyle; @@ -1865,6 +1864,7 @@ PATH_WidenPath(DC *dc) DPRINT1("Assign path failed\n"); PATH_DestroyGdiPath(pNewPath); ExFreePoolWithTag(pNewPath, TAG_PATH); + PATH_UnlockPath(pPath); return ret; } @@ -2120,6 +2120,7 @@ NtGdiAbortPath(HDC hDC) } pPath = PATH_LockPath(dc->dclevel.hPath); + if (!pPath) { DC_UnlockDc(dc); return FALSE; @@ -2128,6 +2129,8 @@ NtGdiAbortPath(HDC hDC) PATH_EmptyPath(pPath); PATH_UnlockPath(pPath); + dc->dclevel.flPath &= ~DCPATH_ACTIVE; + DC_UnlockDc ( dc ); return TRUE; } @@ -2182,7 +2185,7 @@ NtGdiBeginPath( HDC hDC ) DPRINT("BeginPath 2 h 0x%x p 0x%x\n", dc->dclevel.hPath, pPath); // Path handles are shared. Also due to recursion with in the same thread. - GDIOBJ_UnlockObjByPtr((POBJ)pPath); // Unlock + GDIOBJ_vUnlockObject((POBJ)pPath); // Unlock pPath = PATH_LockPath(dc->dclevel.hPath); // Share Lock. /* Make sure that path is empty */ diff --git a/subsystems/win32/win32k/objects/pen.c b/subsystems/win32/win32k/objects/pen.c index ef6944762b4..9c246b891e3 100644 --- a/subsystems/win32/win32k/objects/pen.c +++ b/subsystems/win32/win32k/objects/pen.c @@ -29,22 +29,15 @@ PBRUSH FASTCALL -PEN_LockPen(HGDIOBJ hBMObj) +PEN_ShareLockPen(HGDIOBJ hobj) { - if (GDI_HANDLE_GET_TYPE(hBMObj) == GDI_OBJECT_TYPE_EXTPEN) - return GDIOBJ_LockObj( hBMObj, GDI_OBJECT_TYPE_EXTPEN); - else - return GDIOBJ_LockObj( hBMObj, GDI_OBJECT_TYPE_PEN); -} + if (GDI_HANDLE_GET_TYPE(hobj) != GDILoObjType_LO_PEN_TYPE && + GDI_HANDLE_GET_TYPE(hobj) != GDILoObjType_LO_EXTPEN_TYPE) + { + return NULL; + } -PBRUSH -FASTCALL -PEN_ShareLockPen(HGDIOBJ hBMObj) -{ - if (GDI_HANDLE_GET_TYPE(hBMObj) == GDI_OBJECT_TYPE_EXTPEN) - return GDIOBJ_ShareLockObj( hBMObj, GDI_OBJECT_TYPE_EXTPEN); - else - return GDIOBJ_ShareLockObj( hBMObj, GDI_OBJECT_TYPE_PEN); + return (PBRUSH)GDIOBJ_ReferenceObjectByHandle(hobj, GDIObjType_BRUSH_TYPE); } HPEN APIENTRY @@ -189,27 +182,23 @@ IntGdiExtCreatePen( ExitCleanup: EngSetLastError(ERROR_INVALID_PARAMETER); pbrushPen->pStyle = NULL; - PEN_UnlockPen(pbrushPen); - if (bOldStylePen) - PEN_FreePenByHandle(hPen); - else - PEN_FreeExtPenByHandle(hPen); + GDIOBJ_vDeleteObject(&pbrushPen->BaseObject); return NULL; } VOID FASTCALL IntGdiSetSolidPenColor(HPEN hPen, COLORREF Color) { - PBRUSH pbrushPen; + PBRUSH pbrPen; - pbrushPen = PEN_LockPen(hPen); - if (pbrushPen) + pbrPen = PEN_ShareLockPen(hPen); + if (pbrPen) { - if (pbrushPen->flAttrs & GDIBRUSH_IS_SOLID) + if (pbrPen->flAttrs & GDIBRUSH_IS_SOLID) { - pbrushPen->BrushAttr.lbColor = Color & 0xFFFFFF; + pbrPen->BrushAttr.lbColor = Color & 0xFFFFFF; } - PEN_UnlockPen(pbrushPen); + PEN_ShareUnlockPen(pbrPen); } } diff --git a/subsystems/win32/win32k/objects/region.c b/subsystems/win32/win32k/objects/region.c index 9a267493002..99698c018f1 100644 --- a/subsystems/win32/win32k/objects/region.c +++ b/subsystems/win32/win32k/objects/region.c @@ -2032,9 +2032,19 @@ REGION_AllocRgnWithHandle(INT nReg) HRGN hReg; PROSRGNDATA pReg; - pReg = (PROSRGNDATA)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_REGION); - if(!pReg) + pReg = (PROSRGNDATA)GDIOBJ_AllocateObject(GDIObjType_RGN_TYPE, + sizeof(REGION), + BASEFLAG_LOOKASIDE); + if (!pReg) { + DPRINT1("Could not allocate a palette.\n"); + return NULL; + } + + if (!GDIOBJ_hInsertObject(&pReg->BaseObject, GDI_OBJ_HMGR_POWNED)) + { + DPRINT1("Could not insert palette into handle table.\n"); + GDIOBJ_vFreeObject(&pReg->BaseObject); return NULL; } @@ -2051,8 +2061,8 @@ REGION_AllocRgnWithHandle(INT nReg) pReg->Buffer = ExAllocatePoolWithTag(PagedPool, nReg * sizeof(RECT), TAG_REGION); if (!pReg->Buffer) { - RGNOBJAPI_Unlock(pReg); - GDIOBJ_FreeObjByHandle(hReg, GDI_OBJECT_TYPE_REGION); + DPRINT1("Could not allocate region buffer\n"); + GDIOBJ_vDeleteObject(&pReg->BaseObject); return NULL; } } @@ -2061,10 +2071,36 @@ REGION_AllocRgnWithHandle(INT nReg) pReg->rdh.dwSize = sizeof(RGNDATAHEADER); pReg->rdh.nCount = nReg; pReg->rdh.nRgnSize = nReg * sizeof(RECT); + pReg->prgnattr = &pReg->rgnattr; return pReg; } +BOOL +NTAPI +REGION_bAllocRgnAttr(PREGION prgn) +{ + PPROCESSINFO ppi; + PRGN_ATTR prgnattr; + + ppi = PsGetCurrentProcessWin32Process(); + ASSERT(ppi); + + prgnattr = GdiPoolAllocate(ppi->pPoolRgnAttr); + if (!prgnattr) + { + DPRINT1("Could not allocate RGN attr\n"); + return FALSE; + } + + /* Set the object attribute in the handle table */ + prgn->prgnattr = prgnattr; + GDIOBJ_vSetObjectAttr(&prgn->BaseObject, prgnattr); + + return TRUE; +} + + // // Allocate User Space Region Handle. // @@ -2072,34 +2108,31 @@ PROSRGNDATA FASTCALL REGION_AllocUserRgnWithHandle(INT nRgn) { - PROSRGNDATA pRgn; - PGDI_TABLE_ENTRY Entry; + PREGION prgn; - pRgn = REGION_AllocRgnWithHandle(nRgn); - if (pRgn) + prgn = REGION_AllocRgnWithHandle(nRgn); + if (!prgn) { - Entry = GDI_HANDLE_GET_ENTRY(GdiHandleTable, pRgn->BaseObject.hHmgr); - Entry->UserData = AllocateObjectAttr(); - RtlZeroMemory(Entry->UserData, sizeof(RGN_ATTR)); + return NULL; } - return pRgn; + + if (!REGION_bAllocRgnAttr(prgn)) + { + ASSERT(FALSE); + } + + return prgn; } -PROSRGNDATA -FASTCALL -RGNOBJAPI_Lock(HRGN hRgn, PRGN_ATTR *ppRgn_Attr) +VOID +NTAPI +REGION_vSyncRegion(PREGION pRgn) { - PGDI_TABLE_ENTRY Entry; - PRGN_ATTR pRgn_Attr; - BOOL Hit = FALSE; - PROSRGNDATA pRgn = NULL; + PRGN_ATTR pRgn_Attr = NULL; - pRgn = REGION_LockRgn(hRgn); - - if (pRgn && GDIOBJ_OwnedByCurrentProcess(hRgn)) + if (pRgn && pRgn->prgnattr != &pRgn->rgnattr) { - Entry = GDI_HANDLE_GET_ENTRY(GdiHandleTable, hRgn); - pRgn_Attr = Entry->UserData; + pRgn_Attr = GDIOBJ_pvGetObjectAttr(&pRgn->BaseObject); if ( pRgn_Attr ) { @@ -2126,30 +2159,29 @@ RGNOBJAPI_Lock(HRGN hRgn, PRGN_ATTR *ppRgn_Attr) pRgn_Attr->AttrFlags &= ~ATTR_RGN_DIRTY; } } - else - { // This object is cached an waiting for it's resurrection by the users. - Hit = TRUE; - } } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { } _SEH2_END; - - if (Hit) - { - REGION_UnlockRgn(pRgn); - return NULL; - } - if (ppRgn_Attr) - *ppRgn_Attr = pRgn_Attr; - } - else - { - if (ppRgn_Attr) - *ppRgn_Attr = NULL; } } + +} + +PROSRGNDATA +FASTCALL +RGNOBJAPI_Lock(HRGN hRgn, PRGN_ATTR *ppRgn_Attr) +{ + PROSRGNDATA pRgn = NULL; + + pRgn = REGION_LockRgn(hRgn); + + REGION_vSyncRegion(pRgn); + + if (ppRgn_Attr) + *ppRgn_Attr = pRgn->prgnattr; + return pRgn; } @@ -2157,13 +2189,11 @@ VOID FASTCALL RGNOBJAPI_Unlock(PROSRGNDATA pRgn) { - PGDI_TABLE_ENTRY Entry; PRGN_ATTR pRgn_Attr; - if (pRgn && GDIOBJ_OwnedByCurrentProcess(pRgn->BaseObject.hHmgr)) + if (pRgn && GreGetObjectOwner(pRgn->BaseObject.hHmgr) == GDI_OBJ_HMGR_POWNED) { - Entry = GDI_HANDLE_GET_ENTRY(GdiHandleTable, pRgn->BaseObject.hHmgr); - pRgn_Attr = Entry->UserData; + pRgn_Attr = GDIOBJ_pvGetObjectAttr(&pRgn->BaseObject); if ( pRgn_Attr ) { @@ -2199,42 +2229,69 @@ PROSRGNDATA FASTCALL IntSysCreateRectpRgn(INT LeftRect, INT TopRect, INT RightRect, INT BottomRect) { - PROSRGNDATA pRgn; + PREGION prgn; - pRgn = (PROSRGNDATA)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_REGION); - if (!pRgn) - { - return NULL; - } - pRgn->Buffer = &pRgn->rdh.rcBound; - REGION_SetRectRgn(pRgn, LeftRect, TopRect, RightRect, BottomRect); - REGION_UnlockRgn(pRgn); - return pRgn; + /* Allocate a region, witout a handle */ + prgn = (PREGION)GDIOBJ_AllocateObject(GDIObjType_RGN_TYPE, sizeof(REGION), 0); + if (!prgn) + { + return NULL; + } + + /* Initialize it */ + prgn->Buffer = &prgn->rdh.rcBound; + prgn->prgnattr = &prgn->rgnattr; + REGION_SetRectRgn(prgn, LeftRect, TopRect, RightRect, BottomRect); + + return prgn; } HRGN FASTCALL IntSysCreateRectRgn(INT LeftRect, INT TopRect, INT RightRect, INT BottomRect) { - PROSRGNDATA pRgn = IntSysCreateRectpRgn(LeftRect,TopRect,RightRect,BottomRect); - return (pRgn ? pRgn->BaseObject.hHmgr : NULL); + PREGION prgn; + HRGN hrgn; + + /* Allocate a region, witout a handle */ + prgn = (PREGION)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_REGION, sizeof(REGION)); + if (!prgn) + { + return NULL; + } + + /* Initialize it */ + prgn->Buffer = &prgn->rdh.rcBound; + REGION_SetRectRgn(prgn, LeftRect, TopRect, RightRect, BottomRect); + hrgn = prgn->BaseObject.hHmgr; + prgn->prgnattr = &prgn->rgnattr; + + REGION_UnlockRgn(prgn); + + return hrgn; } BOOL INTERNAL_CALL REGION_Cleanup(PVOID ObjectBody) { PROSRGNDATA pRgn = (PROSRGNDATA)ObjectBody; + PPROCESSINFO ppi = PsGetCurrentProcessWin32Process(); + ASSERT(ppi); + + ASSERT(pRgn->prgnattr); + if (pRgn->prgnattr != &pRgn->rgnattr) + GdiPoolFree(ppi->pPoolRgnAttr, pRgn->prgnattr); + if (pRgn->Buffer && pRgn->Buffer != &pRgn->rdh.rcBound) ExFreePoolWithTag(pRgn->Buffer, TAG_REGION); return TRUE; } -// use REGION_FreeRgnByHandle(hRgn); for systems regions. VOID FASTCALL REGION_Delete(PROSRGNDATA pRgn) { if ( pRgn == prgnDefault) return; - REGION_FreeRgn(pRgn); + GDIOBJ_vDeleteObject(&pRgn->BaseObject); } VOID FASTCALL @@ -2298,28 +2355,27 @@ BOOL FASTCALL IntGdiSetRegionOwner(HRGN hRgn, DWORD OwnerMask) { - INT Index; - PGDI_TABLE_ENTRY Entry; -/* - System Regions: - These regions do not use attribute sections and when allocated, use gdiobj - level functions. - */ - // FIXME! HAX!!! Remove this once we get everything right! - Index = GDI_HANDLE_GET_INDEX(hRgn); - Entry = &GdiHandleTable->Entries[Index]; - if (Entry->UserData) FreeObjectAttr(Entry->UserData); - Entry->UserData = NULL; - // - if ((OwnerMask == GDI_OBJ_HMGR_PUBLIC) || OwnerMask == GDI_OBJ_HMGR_NONE) - { - return GDIOBJ_SetOwnership(hRgn, NULL); - } - if (OwnerMask == GDI_OBJ_HMGR_POWNED) - { - return GDIOBJ_SetOwnership((HGDIOBJ) hRgn, PsGetCurrentProcess() ); - } - return FALSE; + PREGION prgn; + PRGN_ATTR prgnattr; + PPROCESSINFO ppi; + + prgn = REGION_LockRgn(hRgn); + if (!prgn) + { + return FALSE; + } + + prgnattr = GDIOBJ_pvGetObjectAttr(&prgn->BaseObject); + if (prgnattr) + { + GDIOBJ_vSetObjectAttr(&prgn->BaseObject, NULL); + prgn->prgnattr = NULL; + ppi = PsGetCurrentProcessWin32Process(); + GdiPoolFree(ppi->pPoolRgnAttr, prgnattr); + } + RGNOBJAPI_Unlock(prgn); + + return GreSetObjectOwner(hRgn, OwnerMask); } INT @@ -2366,6 +2422,7 @@ IntGdiCombineRgn(PROSRGNDATA destRgn, { DPRINT1("IntGdiCombineRgn requires hSrc2 != NULL for combine mode %d!\n", CombineMode); EngSetLastError(ERROR_INVALID_HANDLE); + ASSERT(FALSE); } } } @@ -2447,7 +2504,7 @@ IntGdiPaintRgn( if (!REGION_LPTODP(dc, tmpVisRgn, hRgn) || NtGdiOffsetRgn(tmpVisRgn, dc->ptlDCOrig.x, dc->ptlDCOrig.y) == ERROR) { - REGION_FreeRgnByHandle(tmpVisRgn); + GreDeleteObject(tmpVisRgn); return FALSE; } @@ -2456,7 +2513,7 @@ IntGdiPaintRgn( visrgn = RGNOBJAPI_Lock(tmpVisRgn, NULL); if (visrgn == NULL) { - REGION_FreeRgnByHandle(tmpVisRgn); + GreDeleteObject(tmpVisRgn); return FALSE; } @@ -2477,7 +2534,7 @@ IntGdiPaintRgn( 0xFFFF);//FIXME:don't know what to put here RGNOBJAPI_Unlock(visrgn); - REGION_FreeRgnByHandle(tmpVisRgn); + GreDeleteObject(tmpVisRgn); // Fill the region return bRet; @@ -3271,46 +3328,55 @@ IntRectInRegion( // INT APIENTRY -NtGdiCombineRgn(HRGN hDest, - HRGN hSrc1, - HRGN hSrc2, - INT CombineMode) +NtGdiCombineRgn( + IN HRGN hrgnDst, + IN HRGN hrgnSrc1, + IN HRGN hrgnSrc2, + IN INT iMode) { - INT result = ERROR; - PROSRGNDATA destRgn, src1Rgn, src2Rgn = NULL; + HRGN ahrgn[3]; + PREGION aprgn[3]; + INT iResult; - if ( CombineMode > RGN_COPY && CombineMode < RGN_AND) - { - EngSetLastError(ERROR_INVALID_PARAMETER); - return ERROR; - } + if (iMode < RGN_AND || iMode > RGN_COPY) + { + EngSetLastError(ERROR_INVALID_PARAMETER); + return ERROR; + } - destRgn = RGNOBJAPI_Lock(hDest, NULL); - if (!destRgn) - { - EngSetLastError(ERROR_INVALID_HANDLE); - return ERROR; - } + if (!hrgnDst || !hrgnSrc1 || (iMode != RGN_COPY && !hrgnSrc2)) + { + DPRINT1("NtGdiCombineRgn: %p, %p, %p, %d\n", + hrgnDst, hrgnSrc1, hrgnSrc2, iMode); + EngSetLastError(ERROR_INVALID_PARAMETER); + return ERROR; + } - src1Rgn = RGNOBJAPI_Lock(hSrc1, NULL); - if (!src1Rgn) - { - RGNOBJAPI_Unlock(destRgn); - EngSetLastError(ERROR_INVALID_HANDLE); - return ERROR; - } + /* Lock all regions */ + ahrgn[0] = hrgnDst; + ahrgn[1] = hrgnSrc1; + ahrgn[2] = iMode != RGN_COPY ? hrgnSrc2 : NULL; + if (!GDIOBJ_bLockMultipleObjects(3, ahrgn, (PVOID*)aprgn, GDIObjType_RGN_TYPE)) + { + DPRINT1("NtGdiCombineRgn: %p, %p, %p, %d\n", + hrgnDst, hrgnSrc1, hrgnSrc2, iMode); + EngSetLastError(ERROR_INVALID_PARAMETER); + return ERROR; + } - if (hSrc2) - src2Rgn = RGNOBJAPI_Lock(hSrc2, NULL); + /* HACK: Sync usermode attributes */ + REGION_vSyncRegion(aprgn[0]); + REGION_vSyncRegion(aprgn[1]); + if (aprgn[2]) REGION_vSyncRegion(aprgn[2]); - result = IntGdiCombineRgn( destRgn, src1Rgn, src2Rgn, CombineMode); + /* Call the internal function */ + iResult = IntGdiCombineRgn(aprgn[0], aprgn[1], aprgn[2], iMode); - if (src2Rgn) - RGNOBJAPI_Unlock(src2Rgn); - RGNOBJAPI_Unlock(src1Rgn); - RGNOBJAPI_Unlock(destRgn); - - return result; + /* Cleanup and return */ + REGION_UnlockRgn(aprgn[0]); + REGION_UnlockRgn(aprgn[1]); + if (aprgn[2]) REGION_UnlockRgn(aprgn[2]); + return iResult; } HRGN @@ -3678,13 +3744,13 @@ NtGdiFrameRgn( } if (!REGION_CreateFrameRgn(FrameRgn, hRgn, Width, Height)) { - REGION_FreeRgnByHandle(FrameRgn); + GreDeleteObject(FrameRgn); return FALSE; } Ret = NtGdiFillRgn(hDC, FrameRgn, hBrush); - REGION_FreeRgnByHandle(FrameRgn); + GreDeleteObject(FrameRgn); return Ret; } diff --git a/toolchain-mingw32.cmake b/toolchain-mingw32.cmake index e50a63d0424..4a0ca3324c4 100644 --- a/toolchain-mingw32.cmake +++ b/toolchain-mingw32.cmake @@ -35,6 +35,13 @@ set(CMAKE_RC_COMPILER ${MINGW_PREFIX}windres) set(CMAKE_ASM_COMPILER ${MINGW_PREFIX}gcc) set(CMAKE_ASM_COMPILE_OBJECT " -x assembler-with-cpp -o -I${REACTOS_SOURCE_DIR}/include/asm -I${REACTOS_BINARY_DIR}/include/asm -D__ASM__ -c ") +if(NOT CMAKE_HOST_SYSTEM_NAME MATCHES Windows) + set(CMAKE_AR ${MINGW_PREFIX}ar) + set(CMAKE_C_CREATE_STATIC_LIBRARY "${CMAKE_AR} crs ") + set(CMAKE_CXX_CREATE_STATIC_LIBRARY ${CMAKE_C_CREATE_STATIC_LIBRARY}) + set(CMAKE_ASM_CREATE_STATIC_LIBRARY ${CMAKE_C_CREATE_STATIC_LIBRARY}) +endif() + # Use stdcall fixups, and don't link with anything by default unless we say so set(CMAKE_C_STANDARD_LIBRARIES "-lgcc" CACHE STRING "Standard C Libraries") diff --git a/tools/pefixup.c b/tools/pefixup.c new file mode 100644 index 00000000000..d6ec1f47700 --- /dev/null +++ b/tools/pefixup.c @@ -0,0 +1,418 @@ +/* + * PE Fixup Utility + * Copyright (C) 2005 Filip Navara + * + * The purpose of this utility is fix PE binaries generated by binutils and + * to manipulate flags that can't be set by binutils. + * + * Currently two features are implemented: + * + * - Setting flags on PE sections for use by drivers. The sections + * .text, .data, .idata, .bss are marked as non-pageable and + * non-discarable, section PAGE is marked as pageable and section + * INIT is marked as discaradable. + * + * - Sorting of export name table in executables. DLLTOOL has bug + * in sorting algorithm when the --kill-at flag is used. The exports + * are sorted in the decorated form and so the fastcall symbols are + * incorrectly put at the beginning of export table. This option + * allow to correct sort the table, so binary search can be used + * to process them. + */ + +#include +#include +#include +#include +#include + +#ifndef O_BINARY +#define O_BINARY 0 +#endif + +/* The following definitions are ripped from MinGW W32API headers. We don't + use these headers directly in order to allow compilation on Linux hosts. */ + +typedef unsigned char BYTE, *PBYTE; +typedef unsigned short WORD; +typedef unsigned int DWORD; +typedef int LONG; +typedef long LONG_PTR; + +#define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16 +#define IMAGE_SIZEOF_SHORT_NAME 8 +#define IMAGE_DOS_SIGNATURE 0x5A4D +#define IMAGE_NT_SIGNATURE 0x00004550 +#define IMAGE_SCN_MEM_DISCARDABLE 0x2000000 +#define IMAGE_SCN_MEM_NOT_PAGED 0x8000000 +#define FIELD_OFFSET(t,f) ((LONG)(LONG_PTR)&(((t*)0)->f)) +#define IMAGE_FIRST_SECTION(h) ((PIMAGE_SECTION_HEADER) ((unsigned long)h+FIELD_OFFSET(IMAGE_NT_HEADERS,OptionalHeader)+((PIMAGE_NT_HEADERS)(h))->FileHeader.SizeOfOptionalHeader)) +#define IMAGE_DIRECTORY_ENTRY_EXPORT 0 + +#pragma pack(2) +typedef struct _IMAGE_DOS_HEADER { + WORD e_magic; + WORD e_cblp; + WORD e_cp; + WORD e_crlc; + WORD e_cparhdr; + WORD e_minalloc; + WORD e_maxalloc; + WORD e_ss; + WORD e_sp; + WORD e_csum; + WORD e_ip; + WORD e_cs; + WORD e_lfarlc; + WORD e_ovno; + WORD e_res[4]; + WORD e_oemid; + WORD e_oeminfo; + WORD e_res2[10]; + LONG e_lfanew; +} IMAGE_DOS_HEADER,*PIMAGE_DOS_HEADER; +#pragma pack(4) +#pragma pack(4) +typedef struct _IMAGE_EXPORT_DIRECTORY { + DWORD Characteristics; + DWORD TimeDateStamp; + WORD MajorVersion; + WORD MinorVersion; + DWORD Name; + DWORD Base; + DWORD NumberOfFunctions; + DWORD NumberOfNames; + DWORD AddressOfFunctions; + DWORD AddressOfNames; + DWORD AddressOfNameOrdinals; +} IMAGE_EXPORT_DIRECTORY,*PIMAGE_EXPORT_DIRECTORY; +typedef struct _IMAGE_FILE_HEADER { + WORD Machine; + WORD NumberOfSections; + DWORD TimeDateStamp; + DWORD PointerToSymbolTable; + DWORD NumberOfSymbols; + WORD SizeOfOptionalHeader; + WORD Characteristics; +} IMAGE_FILE_HEADER, *PIMAGE_FILE_HEADER; +typedef struct _IMAGE_DATA_DIRECTORY { + DWORD VirtualAddress; + DWORD Size; +} IMAGE_DATA_DIRECTORY,*PIMAGE_DATA_DIRECTORY; +typedef struct _IMAGE_OPTIONAL_HEADER { + WORD Magic; + BYTE MajorLinkerVersion; + BYTE MinorLinkerVersion; + DWORD SizeOfCode; + DWORD SizeOfInitializedData; + DWORD SizeOfUninitializedData; + DWORD AddressOfEntryPoint; + DWORD BaseOfCode; + DWORD BaseOfData; + DWORD ImageBase; + DWORD SectionAlignment; + DWORD FileAlignment; + WORD MajorOperatingSystemVersion; + WORD MinorOperatingSystemVersion; + WORD MajorImageVersion; + WORD MinorImageVersion; + WORD MajorSubsystemVersion; + WORD MinorSubsystemVersion; + DWORD Reserved1; + DWORD SizeOfImage; + DWORD SizeOfHeaders; + DWORD CheckSum; + WORD Subsystem; + WORD DllCharacteristics; + DWORD SizeOfStackReserve; + DWORD SizeOfStackCommit; + DWORD SizeOfHeapReserve; + DWORD SizeOfHeapCommit; + DWORD LoaderFlags; + DWORD NumberOfRvaAndSizes; + IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]; +} IMAGE_OPTIONAL_HEADER,*PIMAGE_OPTIONAL_HEADER; +typedef struct _IMAGE_NT_HEADERS { + DWORD Signature; + IMAGE_FILE_HEADER FileHeader; + IMAGE_OPTIONAL_HEADER OptionalHeader; +} IMAGE_NT_HEADERS,*PIMAGE_NT_HEADERS; +typedef struct _IMAGE_SECTION_HEADER { + BYTE Name[IMAGE_SIZEOF_SHORT_NAME]; + union { + DWORD PhysicalAddress; + DWORD VirtualSize; + } Misc; + DWORD VirtualAddress; + DWORD SizeOfRawData; + DWORD PointerToRawData; + DWORD PointerToRelocations; + DWORD PointerToLinenumbers; + WORD NumberOfRelocations; + WORD NumberOfLinenumbers; + DWORD Characteristics; +} IMAGE_SECTION_HEADER,*PIMAGE_SECTION_HEADER; +#pragma pack(4) + +/* End of ripped definitions */ + +typedef struct _export_t { + DWORD name; + WORD ordinal; +} export_t; + +unsigned char *buffer; +PIMAGE_DOS_HEADER dos_header; +PIMAGE_NT_HEADERS nt_header; + +static inline WORD dtohs(WORD in) +{ + PBYTE in_ptr = (PBYTE)∈ + return in_ptr[0] | (in_ptr[1] << 8); +} + +static inline WORD htods(WORD in) +{ + WORD out; + PBYTE out_ptr = (PBYTE)&out; + out_ptr[0] = in; out_ptr[1] = in >> 8; + return out; +} + +static inline DWORD dtohl(DWORD in) +{ + PBYTE in_ptr = (PBYTE)∈ + return in_ptr[0] | (in_ptr[1] << 8) | (in_ptr[2] << 16) | (in_ptr[3] << 24); +} + +static inline DWORD htodl(DWORD in) +{ + DWORD out; + PBYTE out_ptr = (PBYTE)&out; + out_ptr[0] = in ; out_ptr[1] = in >> 8; + out_ptr[2] = in >> 16; out_ptr[3] = in >> 24; + return out; +} + +void *rva_to_ptr(DWORD rva) +{ + PIMAGE_SECTION_HEADER section_header; + unsigned int i; + + for (i = 0, section_header = IMAGE_FIRST_SECTION(nt_header); + i < dtohl(nt_header->FileHeader.NumberOfSections); + i++, section_header++) + { + if (rva >= dtohl(section_header->VirtualAddress) && + rva < dtohl(section_header->VirtualAddress) + + dtohl(section_header->Misc.VirtualSize)) + { + return buffer + rva - dtohl(section_header->VirtualAddress) + + dtohl(section_header->PointerToRawData); + } + } + + return NULL; +} + +int export_compare_func(const void *a, const void *b) +{ + const export_t *ap = a; + const export_t *bp = b; + char *an = rva_to_ptr(ap->name); + char *bn = rva_to_ptr(bp->name); + return strcmp(an, bn); +} + +int main(int argc, char **argv) +{ + int fd_in, fd_out; + long len; + char hdrbuf[4] = { }, elfhdr[4] = { '\177', 'E', 'L', 'F' }; + PIMAGE_SECTION_HEADER section_header; + PIMAGE_DATA_DIRECTORY data_dir; + unsigned int i; + unsigned long checksum; + int fixup_exports = 0; + int fixup_sections = 0; + + /* + * Process parameters. + */ + + if (argc < 2) + { + printf("Usage: %s \n" + "Options:\n" + " -sections Sets section flags for PE image.\n" + " -exports Sort the names in export table.\n", + argv[0]); + return 1; + } + + for (i = 2; i < argc; i++) + { + if (!strcmp(argv[i], "-sections")) + fixup_sections = 1; + else if (!strcmp(argv[i], "-exports")) + fixup_exports = 1; + else + { fprintf(stderr, "Invalid option: %s\n", argv[i]); return 1; } + } + + /* + * Nothing to do. + */ + if (fixup_sections == 0 && fixup_exports == 0) + return 0; + + /* + * Read the whole file to memory. + */ + + fd_in = open(argv[1], O_RDONLY | O_BINARY); + if (fd_in == 0) + { + fprintf(stderr, "Can't open input file.\n"); + return 1; + } + + /* + * PowerPC ReactOS uses elf, so doesn't need pefixup + */ + len = read(fd_in, hdrbuf, sizeof(elfhdr)); + if (!memcmp(hdrbuf, elfhdr, sizeof(elfhdr))) + return 0; + + len = lseek(fd_in, 0, SEEK_END); + if (len < sizeof(IMAGE_DOS_HEADER)) + { + close(fd_in); + fprintf(stderr, "'%s' isn't a PE image (too short)\n", argv[1]); + return 1; + } + + /* Lower down we overwrite the byte at len, so here, we need at least + * one more byte than len. We'll be guaranteed one or two now. */ + buffer = malloc((len + 2) & ~1); + if (buffer == NULL) + { + close(fd_in); + fprintf(stderr, "Not enough memory available.\n"); + return 1; + } + + /* Read the whole input file into a buffer */ + lseek(fd_in, 0, SEEK_SET); + read(fd_in, buffer, len); + /* Here is where the block end overwrite was */ + if (len & 1) + buffer[len] = 0; + + close(fd_in); + + /* + * Check the headers and save pointers to them. + */ + + dos_header = (PIMAGE_DOS_HEADER)buffer; + nt_header = (PIMAGE_NT_HEADERS)(buffer + dtohl(dos_header->e_lfanew)); + + if (dtohs(dos_header->e_magic) != IMAGE_DOS_SIGNATURE || + dtohl(nt_header->Signature) != IMAGE_NT_SIGNATURE) + { + fprintf(stderr, "'%s' isn't a PE image (bad headers)\n", argv[1]); + free(buffer); + return 1; + } + + if (fixup_exports) + { + /* Sort export directory */ + data_dir = &nt_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT]; + if (dtohl(data_dir->Size) != 0) + { + PIMAGE_EXPORT_DIRECTORY export_directory; + DWORD *name_ptr; + WORD *ordinal_ptr; + export_t *exports; + + export_directory = (PIMAGE_EXPORT_DIRECTORY)rva_to_ptr(dtohl(data_dir->VirtualAddress)); + if (export_directory != NULL) + { + exports = malloc(sizeof(export_t) * dtohl(export_directory->NumberOfNames)); + if (exports == NULL) + { + fprintf(stderr, "Not enough memory.\n"); + free(buffer); + return 1; + } + + name_ptr = (DWORD *)rva_to_ptr(dtohl(export_directory->AddressOfNames)); + ordinal_ptr = (WORD *)rva_to_ptr(dtohl(export_directory->AddressOfNameOrdinals)); + + for (i = 0; i < dtohl(export_directory->NumberOfNames); i++) + { + exports[i].name = dtohl(name_ptr[i]); + exports[i].ordinal = dtohl(ordinal_ptr[i]); + } + + qsort(exports, dtohl(export_directory->NumberOfNames), sizeof(export_t), + export_compare_func); + + for (i = 0; i < dtohl(export_directory->NumberOfNames); i++) + { + name_ptr[i] = htodl(exports[i].name); + ordinal_ptr[i] = htodl(exports[i].ordinal); + } + + free(exports); + } + } + } + + if (fixup_sections) + { + /* Update section flags */ + for (i = 0, section_header = IMAGE_FIRST_SECTION(nt_header); + i < dtohl(nt_header->OptionalHeader.NumberOfRvaAndSizes); + i++, section_header++) + { + if (!strcmp((char*)section_header->Name, ".text") || + !strcmp((char*)section_header->Name, ".data") || + !strcmp((char*)section_header->Name, ".idata") || + !strcmp((char*)section_header->Name, ".rdata") || + !strcmp((char*)section_header->Name, ".bss")) + { + section_header->Characteristics |= htodl(IMAGE_SCN_MEM_NOT_PAGED); + section_header->Characteristics &= htodl(~IMAGE_SCN_MEM_DISCARDABLE); + } + else if (!strcmp((char*)section_header->Name, "INIT")) + { + section_header->Characteristics |= htodl(IMAGE_SCN_MEM_DISCARDABLE); + } + else if (!strcmp((char*)section_header->Name, "PAGE")) + { + section_header->Characteristics |= htodl(IMAGE_SCN_MEM_NOT_PAGED); + } + } + } + + /* Recalculate checksum */ + nt_header->OptionalHeader.CheckSum = 0; + checksum = 0; + for (i = 0; i < len; i += 2) + { + checksum += *(unsigned short *)(buffer + i); + checksum = (checksum + (checksum >> 16)) & 0xffff; + } + checksum += len; + nt_header->OptionalHeader.CheckSum = htods(checksum); + + /* Write the output file */ + fd_out = open(argv[1], O_WRONLY | O_BINARY); + write(fd_out, buffer, len); + close(fd_out); + + return 0; +}