diff --git a/reactos/CREDITS b/reactos/CREDITS index a99f87b813d..a6f22028cf1 100644 --- a/reactos/CREDITS +++ b/reactos/CREDITS @@ -9,6 +9,7 @@ Art Yerkes Ariadne Brandon Turner Brian Palmer +Cameron M. Gutman Casper S. Hornstrup Christoph von Wittich Daniel Reimer @@ -60,6 +61,7 @@ Richard Campbell Robert Bergkvist Robert Dickenson Royce Mitchell III +Samuel Serapiуn Saveliy Tretiakov Stefan Ginsberg Steven Edwards diff --git a/reactos/Makefile b/reactos/Makefile index dc823d59275..be31071b129 100644 --- a/reactos/Makefile +++ b/reactos/Makefile @@ -438,9 +438,6 @@ universe: ROS_OUTPUT=output-$(ARCH)-r \ world -sysregtest: - $(OUTPUT_)tools$(SEP)sysreg$(SEP)sysreg$(EXEPOSTFIX) tools$(SEP)sysreg$(SEP)txtmode.cfg - .PHONY: rgenstat rgenstat: $(RGENSTAT_TARGET) $(ECHO_RGENSTAT) diff --git a/reactos/ReactOS-arm.rbuild b/reactos/ReactOS-arm.rbuild index b073d425aa6..5f6e7b792c9 100644 --- a/reactos/ReactOS-arm.rbuild +++ b/reactos/ReactOS-arm.rbuild @@ -68,7 +68,7 @@ -Wno-attributes -fno-strict-aliasing - -s + --strip-debug -static diff --git a/reactos/base/applications/calc/calc.h b/reactos/base/applications/calc/calc.h index 36e8febcfdb..177e38e7362 100644 --- a/reactos/base/applications/calc/calc.h +++ b/reactos/base/applications/calc/calc.h @@ -42,7 +42,9 @@ #define IDC_STATIC ((DWORD)-1) #endif -#define CALC_VERSION TEXT("1.09") +#define CALC_VERSION TEXT("1.10") + +#define MAX_CALC_SIZE 256 /*#define USE_KEYBOARD_HOOK*/ @@ -144,7 +146,8 @@ typedef struct { #endif HWND hWnd; DWORD layout; - TCHAR buffer[256]; + TCHAR buffer[MAX_CALC_SIZE]; + TCHAR source[MAX_CALC_SIZE]; TCHAR *ptr; calc_number_t code; calc_number_t prev; diff --git a/reactos/base/applications/calc/calc.rbuild b/reactos/base/applications/calc/calc.rbuild index 0c9be44f64b..72739c62183 100644 --- a/reactos/base/applications/calc/calc.rbuild +++ b/reactos/base/applications/calc/calc.rbuild @@ -2,13 +2,13 @@ . - 1 + 1 0x0501 user32 gdi32 kernel32 about.c - convert.c + convert.c function.c rpn.c utl.c diff --git a/reactos/base/applications/calc/convert.c b/reactos/base/applications/calc/convert.c index 06107c81d4d..d281d444603 100644 --- a/reactos/base/applications/calc/convert.c +++ b/reactos/base/applications/calc/convert.c @@ -561,4 +561,3 @@ void ConvInit(HWND hWnd) ConvAdjust(hWnd, 0); } - diff --git a/reactos/base/applications/calc/lang/bg-BG.rc b/reactos/base/applications/calc/lang/bg-BG.rc index 8c78bbd6cf3..e334840408a 100644 --- a/reactos/base/applications/calc/lang/bg-BG.rc +++ b/reactos/base/applications/calc/lang/bg-BG.rc @@ -4,7 +4,7 @@ LANGUAGE LANG_BULGARIAN, SUBLANG_DEFAULT IDD_DIALOG_SCIENTIFIC DIALOGEX 0, 0, 316, 161 STYLE DS_SHELLFONT | WS_MINIMIZEBOX | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Изчислителян на РеактОС" +CAPTION "Изчислителят на РеактОС" MENU IDR_MENU_SCIENTIFIC_1 FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN @@ -444,31 +444,31 @@ END // types of conversion STRINGTABLE DISCARDABLE BEGIN - IDS_CONV_AREA "Area" - IDS_CONV_CONSUMPTION "Consumption (engines)" - IDS_CONV_CURRENCY "Currencies" - IDS_CONV_ENERGY "Energy" - IDS_CONV_LENGTH "Lenghts" - IDS_CONV_POWER "Power" - IDS_CONV_PRESSURE "Pressure" - IDS_CONV_TEMPERATURE "Temperature" - IDS_CONV_VELOCITY "Velocity" - IDS_CONV_VOLUME "Volume" - IDS_CONV_WEIGHT "Weights" + IDS_CONV_AREA "Площ" + IDS_CONV_CONSUMPTION "Потребление (двигатели)" + IDS_CONV_CURRENCY "Парични единици" + IDS_CONV_ENERGY "Енергия" + IDS_CONV_LENGTH "Дължини" + IDS_CONV_POWER "Мощност" + IDS_CONV_PRESSURE "Налягане" + IDS_CONV_TEMPERATURE "Температура" + IDS_CONV_VELOCITY "Скорост" + IDS_CONV_VOLUME "Обем" + IDS_CONV_WEIGHT "Тегло" END // TYPES OF AREAS STRINGTABLE DISCARDABLE BEGIN - IDS_AREA_ACRES "Acres" - IDS_AREA_ACRES_BRAZIL "Acres (Brazil)" - IDS_AREA_ACRES_FRANCE "Acres (France)" - IDS_AREA_ACRES_SCOTS "Acres (Scots)" - IDS_AREA_ACRES_US "Acres (US)" - IDS_AREA_ARES "Ares" + IDS_AREA_ACRES "Акри" + IDS_AREA_ACRES_BRAZIL "Акри (Бразилски)" + IDS_AREA_ACRES_FRANCE "Акри (Френски)" + IDS_AREA_ACRES_SCOTS "Акри (Шотландски)" + IDS_AREA_ACRES_US "Акри (САЩ)" + IDS_AREA_ARES "Арове" IDS_AREA_CHOU "Chou" IDS_AREA_DANBO "Danbo" - IDS_AREA_HECTARES "Hectares" + IDS_AREA_HECTARES "Хектари" IDS_AREA_JEONGBO "Jeongbo" IDS_AREA_MORGEN_HUNGARY "Morgen (Hungary)" IDS_AREA_MU "Mu" @@ -477,21 +477,21 @@ BEGIN IDS_AREA_PYEONGBANGJA "Pyeongbangja" IDS_AREA_RAI "Rai" IDS_AREA_SE "Se" - IDS_AREA_SQUARE_CENTIMETERS "Square centimeters" - IDS_AREA_SQUARE_CHR "Square chr" - IDS_AREA_SQUARE_FATHOMS "Square fathoms" - IDS_AREA_SQUARE_FATHOMS_HUNGARY "Square fathoms (Hungary)" - IDS_AREA_SQUARE_FEET "Square feet" - IDS_AREA_SQUARE_INCHES "Square inches" - IDS_AREA_SQUARE_KILOMETERS "Square kilometers" - IDS_AREA_SQUARE_LAR "Square lar" - IDS_AREA_SQUARE_METER "Square meter" - IDS_AREA_SQUARE_MILES "Square miles" - IDS_AREA_SQUARE_MILLIMETERS "Square millimeters" - IDS_AREA_SQUARE_SHAKU "Square shaku" - IDS_AREA_SQUARE_TSUEN "Square tsuen" - IDS_AREA_SQUARE_VA "Square va" - IDS_AREA_SQUARE_YARD "Square yard" + IDS_AREA_SQUARE_CENTIMETERS "Квадратни сантиметри" + IDS_AREA_SQUARE_CHR "Квадратни chr" + IDS_AREA_SQUARE_FATHOMS "Квадратни фадоми" + IDS_AREA_SQUARE_FATHOMS_HUNGARY "Квадратни фадоми (унгарски)" + IDS_AREA_SQUARE_FEET "Квадратни стъпки" + IDS_AREA_SQUARE_INCHES "Квадратни цолове" + IDS_AREA_SQUARE_KILOMETERS "Квадратни километри" + IDS_AREA_SQUARE_LAR "Квадратни lar" + IDS_AREA_SQUARE_METER "Квадратни метри" + IDS_AREA_SQUARE_MILES "Квадратни мили" + IDS_AREA_SQUARE_MILLIMETERS "Квадратни милиметри" + IDS_AREA_SQUARE_SHAKU "Квадратни shaku" + IDS_AREA_SQUARE_TSUEN "Квадратни tsuen" + IDS_AREA_SQUARE_VA "Квадратни va" + IDS_AREA_SQUARE_YARD "Квадратни ярдове" IDS_AREA_TAN "Tan" IDS_AREA_TSUBO "Tsubo" END @@ -499,10 +499,10 @@ END // TYPES OF COMSUMPTIONS STRINGTABLE DISCARDABLE BEGIN - IDS_CONSUMPTION_KM_PER_L "Kilometer/liter" - IDS_CONSUMPTION_L_PER_100_KM "Liters/100 kilometers" - IDS_CONSUMPTION_MILES_GALLON_UK "Miles/gallon (UK)" - IDS_CONSUMPTION_MILES_GALLON_US "Miles/gallon (US)" + IDS_CONSUMPTION_KM_PER_L "Километри/литър" + IDS_CONSUMPTION_L_PER_100_KM "Литри/100 километра" + IDS_CONSUMPTION_MILES_GALLON_UK "Мили/галон (ОК)" + IDS_CONSUMPTION_MILES_GALLON_US "Мили/галон (САЩ)" END // TYPES OF CURRENCIES @@ -529,54 +529,54 @@ END // TYPES OF ENERGIES STRINGTABLE DISCARDABLE BEGIN - IDS_ENERGY_15_C_CALORIES "15 ^C calories" - IDS_ENERGY_ERGS "Ergs" - IDS_ENERGY_IT_CALORIES "International Table calories" - IDS_ENERGY_JOULES "Joules" - IDS_ENERGY_KILOJOULES "Kilojoules" - IDS_ENERGY_KILOWATT_HOURS "Kilowatt hours" - IDS_ENERGY_NUTRITION_CALORIES "Nutrition calories" - IDS_ENERGY_TH_CALORIES "Thermochemical calorie" + IDS_ENERGY_15_C_CALORIES "15 ^C калории" + IDS_ENERGY_ERGS "Ергове" + IDS_ENERGY_IT_CALORIES "Международни таблични калории" + IDS_ENERGY_JOULES "Джаули" + IDS_ENERGY_KILOJOULES "Килоджаули" + IDS_ENERGY_KILOWATT_HOURS "Киловат/ часове" + IDS_ENERGY_NUTRITION_CALORIES "Хранителни калории" + IDS_ENERGY_TH_CALORIES "Топлинни калории" END // TYPES OF LENGTHS STRINGTABLE DISCARDABLE BEGIN - IDS_LENGTH_ANGSTROMS "Angstroms" + IDS_LENGTH_ANGSTROMS "Ангстрьоми" IDS_LENGTH_ASTRONOMILA_UNITS "Astronomila units" - IDS_LENGTH_BARLEYCORNS "Barleycorns" - IDS_LENGTH_CENTIMETERS "Centimeters" - IDS_LENGTH_CHAINS_UK "Chains (UK)" + IDS_LENGTH_BARLEYCORNS "Ечемичени зърна" + IDS_LENGTH_CENTIMETERS "Сантиметри" + IDS_LENGTH_CHAINS_UK "Вериги (ОК)" IDS_LENGTH_CHI "Chi" IDS_LENGTH_CHOU "Chou" IDS_LENGTH_CHR "Chr" IDS_LENGTH_CUN "Cun" - IDS_LENGTH_FATHOMS "Fathoms" - IDS_LENGTH_FATHOMS_HUNGARY "Fathoms (Hungary)" - IDS_LENGTH_FEET "Feet" - IDS_LENGTH_FURLONGS "Furlongs" + IDS_LENGTH_FATHOMS "Сажени" + IDS_LENGTH_FATHOMS_HUNGARY "Сажени (унгарски)" + IDS_LENGTH_FEET "Стъпки" + IDS_LENGTH_FURLONGS "Бразди" IDS_LENGTH_GAN "Gan" - IDS_LENGTH_HANDS "Hands" + IDS_LENGTH_HANDS "Длани" IDS_LENGTH_HUNH "Hunh" - IDS_LENGTH_INCHES "Inches" + IDS_LENGTH_INCHES "Цолове" IDS_LENGTH_JA "Ja" IDS_LENGTH_JEONG "Jeong" IDS_LENGTH_KABIET "Kabiet" IDS_LENGTH_KEN "Ken" IDS_LENGTH_KEUB "Keub" - IDS_LENGTH_KILOMETERS "Kilometers" + IDS_LENGTH_KILOMETERS "Километри" IDS_LENGTH_LAR "Lar" - IDS_LENGTH_LIGHT_YEARS "Light years" + IDS_LENGTH_LIGHT_YEARS "Светлинни години" IDS_LENGTH_LINKS_UK "Links (UK)" - IDS_LENGTH_METERS "Meters" - IDS_LENGTH_MILES "Miles" - IDS_LENGTH_MILLIMETERS "Millimeters" - IDS_LENGTH_NAUTICAL_MILES "Nautical miles" + IDS_LENGTH_METERS "Метри" + IDS_LENGTH_MILES "Мили" + IDS_LENGTH_MILLIMETERS "Милиметри" + IDS_LENGTH_NAUTICAL_MILES "Морски мили" IDS_LENGTH_NIEU "Nieu" - IDS_LENGTH_PARSECS "Parsecs" - IDS_LENGTH_PICAS "Picas" - IDS_LENGTH_RI_JAPAN "Ri (Japan)" - IDS_LENGTH_RI_KOREA "Ri (Korea)" + IDS_LENGTH_PARSECS "Парсеци" + IDS_LENGTH_PICAS "Дванадесетки (пики)" + IDS_LENGTH_RI_JAPAN "Ri (японски)" + IDS_LENGTH_RI_KOREA "Ri (корейски)" IDS_LENGTH_SAWK "Sawk" IDS_LENGTH_SEN "Sen" IDS_LENGTH_SHAKU "Shaku" @@ -584,7 +584,7 @@ BEGIN IDS_LENGTH_SUN "Sun" IDS_LENGTH_TSUEN "Tsuen" IDS_LENGTH_VA "Va" - IDS_LENGTH_YARDS "Yards" + IDS_LENGTH_YARDS "Ярдове" IDS_LENGTH_YOTE "Yote" IDS_LENGTH_ZHANG "Zhang" END @@ -592,74 +592,74 @@ END // TYPES OF POWERS STRINGTABLE DISCARDABLE BEGIN - IDS_POWER_HORSEPOWER "Horsepower" - IDS_POWER_KILOWATTS "Kilowatts" - IDS_POWER_MEGAWATTS "Megawatts" - IDS_POWER_WATTS "Watts" + IDS_POWER_HORSEPOWER "Конски сили" + IDS_POWER_KILOWATTS "Киловатове" + IDS_POWER_MEGAWATTS "Мегаватове" + IDS_POWER_WATTS "Ватове" END // TYPE OF PRESSURES STRINGTABLE DISCARDABLE BEGIN - IDS_PRESSURE_ATMOSPHERES "Atmospheres" - IDS_PRESSURE_BARS "Bars" - IDS_PRESSURE_MM_OF_MERCURY "Millimeters of mercury" - IDS_PRESSURE_PASCALS "Pascals" - IDS_PRESSURE_PSI "Pounds-force per square inch" + IDS_PRESSURE_ATMOSPHERES "Атмосфери" + IDS_PRESSURE_BARS "Барове" + IDS_PRESSURE_MM_OF_MERCURY "Милиметри живачен стълб" + IDS_PRESSURE_PASCALS "Паскали" + IDS_PRESSURE_PSI "Паундове на квадратен цол" END // TYPES OF TEMPERATURES STRINGTABLE DISCARDABLE BEGIN - IDS_TEMPERATURE_CELSIUS "Celsius" - IDS_TEMPERATURE_FAHRENHEIT "Fahrenheit" - IDS_TEMPERATURE_KELVIN "Kelvin" - IDS_TEMPERATURE_RANKINE "Rankine" + IDS_TEMPERATURE_CELSIUS "Целзий" + IDS_TEMPERATURE_FAHRENHEIT "Фаренхайт" + IDS_TEMPERATURE_KELVIN "Келвин" + IDS_TEMPERATURE_RANKINE "Ранкин" END // TYPES OF VELOCITIES STRINGTABLE DISCARDABLE BEGIN - IDS_VELOCITY_FEET_HOUR "Feet/hour" - IDS_VELOCITY_KILOMETERS_HOUR "Kilometers/hour" - IDS_VELOCITY_KNOTS "Knots" - IDS_VELOCITY_MACH "Mach" - IDS_VELOCITY_METERS_SECOND "Meters/second" - IDS_VELOCITY_MILES_HOUR "Miles/hour" + IDS_VELOCITY_FEET_HOUR "Стъпки/час" + IDS_VELOCITY_KILOMETERS_HOUR "Километри/час" + IDS_VELOCITY_KNOTS "Възли" + IDS_VELOCITY_MACH "Махове" + IDS_VELOCITY_METERS_SECOND "Метри/секунда" + IDS_VELOCITY_MILES_HOUR "Мили/час" END // TYPES OF VOLUMES STRINGTABLE DISCARDABLE BEGIN - IDS_VOLUME_BARRELS_UK "Barrels (UK)" - IDS_VOLUME_BARRELS_OIL "Barrels oil" + IDS_VOLUME_BARRELS_UK "Бъчви (барели) (ОК)" + IDS_VOLUME_BARRELS_OIL "Петролни бъчви" IDS_VOLUME_BUN "Bun" - IDS_VOLUME_BUSHELS_UK "Bushels (UK)" - IDS_VOLUME_BUSHELS_US "Bushels (US)" - IDS_VOLUME_CUBIC_CENTIMETERS "Cubic centimeters" - IDS_VOLUME_CUBIC_FEET "Cubic feet" - IDS_VOLUME_CUBIC_INCHES "Cubic inches" - IDS_VOLUME_CUBIC_METERS "Cubic meters" - IDS_VOLUME_CUBIC_YARDS "Cubic yards" + IDS_VOLUME_BUSHELS_UK "Бушели (ОК)" + IDS_VOLUME_BUSHELS_US "Бушели (САЩ)" + IDS_VOLUME_CUBIC_CENTIMETERS "Кубични сантиметри" + IDS_VOLUME_CUBIC_FEET "Кубични стъпки" + IDS_VOLUME_CUBIC_INCHES "Кубични цолове" + IDS_VOLUME_CUBIC_METERS "Кубични метри" + IDS_VOLUME_CUBIC_YARDS "Кубични ярдове" IDS_VOLUME_DOE "Doe" - IDS_VOLUME_FLUID_OUNCES_UK "Fluid ounces (UK)" - IDS_VOLUME_FLUID_OUNCES_US "Fluid ounces (US)" - IDS_VOLUME_GALLONS_UK "Gallons (UK)" - IDS_VOLUME_GALLONS_DRY_US "Gallons, dry (US)" - IDS_VOLUME_GALLONS_LIQUID_US "Gallons, liquid (US)" + IDS_VOLUME_FLUID_OUNCES_UK "Течни унции (ОК)" + IDS_VOLUME_FLUID_OUNCES_US "Течни унции (САЩ)" + IDS_VOLUME_GALLONS_UK "Галони (UK)" + IDS_VOLUME_GALLONS_DRY_US "Галони, сухи (САЩ)" + IDS_VOLUME_GALLONS_LIQUID_US "Галони, течни (САЩ)" IDS_VOLUME_GOU "Gou" IDS_VOLUME_HOP "Hop" IDS_VOLUME_ICCE "Icce" IDS_VOLUME_KWIAN "Kwian" - IDS_VOLUME_LITERS "Liters" + IDS_VOLUME_LITERS "Литри" IDS_VOLUME_MAL "Mal" - IDS_VOLUME_MILLILITERS "Milliliters" - IDS_VOLUME_PINTS_UK "Pints (UK)" - IDS_VOLUME_PINTS_DRY_US "Pints, dry (US)" - IDS_VOLUME_PINTS_LIQUID_US "Pints, liquid (US)" - IDS_VOLUME_QUARTS_UK "Quarts (UK)" - IDS_VOLUME_QUARTS_DRY_US "Quarts, dry (US)" - IDS_VOLUME_QUARTS_LIQUID_US "Quarts, liquid (US)" + IDS_VOLUME_MILLILITERS "Милиметри" + IDS_VOLUME_PINTS_UK "Пинти (ОК)" + IDS_VOLUME_PINTS_DRY_US "Пинти, сухи (САЩ)" + IDS_VOLUME_PINTS_LIQUID_US "Пинти, течни (САЩ)" + IDS_VOLUME_QUARTS_UK "Кварти (ОК)" + IDS_VOLUME_QUARTS_DRY_US "Кварти, сухи (САЩ)" + IDS_VOLUME_QUARTS_LIQUID_US "Кварти, течни (САЩ)" IDS_VOLUME_SEKI "Seki" IDS_VOLUME_SYOU "Syou" IDS_VOLUME_TANANLOUNG "Tananloung" @@ -671,29 +671,29 @@ END STRINGTABLE DISCARDABLE BEGIN IDS_WEIGHT_BAHT "Baht" - IDS_WEIGHT_CARATS "Carats" + IDS_WEIGHT_CARATS "Карати" IDS_WEIGHT_CHUNG "Chung" IDS_WEIGHT_DON "Don" IDS_WEIGHT_GEUN "Geun" IDS_WEIGHT_GRAMS "Grams" IDS_WEIGHT_GWAN "Gwan" IDS_WEIGHT_HARB "Harb" - IDS_WEIGHT_JIN_CHINA "Jin (China)" - IDS_WEIGHT_JIN_TAIWAN "Jin (Taiwan)" + IDS_WEIGHT_JIN_CHINA "Джинове (Китай)" + IDS_WEIGHT_JIN_TAIWAN "Джинове (Тайван)" IDS_WEIGHT_KAN "Kan" - IDS_WEIGHT_KILOGRAMS "Kilograms" + IDS_WEIGHT_KILOGRAMS "Килограми" IDS_WEIGHT_KIN "Kin" IDS_WEIGHT_LIANG_CHINA "Liang (China)" IDS_WEIGHT_LIANG_TAIWAN "Liang (Taiwan)" IDS_WEIGHT_MONME "Monme" - IDS_WEIGHT_OUNCES_AVOIRDUPOIS "Ounces, avoirdupois" - IDS_WEIGHT_OUNCES_TROY "Ounces, troy" - IDS_WEIGHT_POUNDS "Pounds" - IDS_WEIGHT_QUINTAL_METRIC "Quintal (metric)" + IDS_WEIGHT_OUNCES_AVOIRDUPOIS "Унции, avoirdupois" + IDS_WEIGHT_OUNCES_TROY "Унции, трой" + IDS_WEIGHT_POUNDS "Фунтове" + IDS_WEIGHT_QUINTAL_METRIC "Центнери (метрични)" IDS_WEIGHT_SALOUNG "Saloung" - IDS_WEIGHT_STONES "Stones" + IDS_WEIGHT_STONES "Камъни" IDS_WEIGHT_TAMLUNG "Tamlung" - IDS_WEIGHT_TONNES "Tonnes" - IDS_WEIGHT_TONS_UK "Tons (UK)" - IDS_WEIGHT_TONS_US "Tons (US)" + IDS_WEIGHT_TONNES "Тонове" + IDS_WEIGHT_TONS_UK "Тонове (ОК)" + IDS_WEIGHT_TONS_US "Тонове (САЩ)" END diff --git a/reactos/base/applications/calc/lang/no-NO.rc b/reactos/base/applications/calc/lang/no-NO.rc index b3df55a0a4e..ff5f0a5f830 100644 --- a/reactos/base/applications/calc/lang/no-NO.rc +++ b/reactos/base/applications/calc/lang/no-NO.rc @@ -9,14 +9,10 @@ MENU IDR_MENU_SCIENTIFIC_1 FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN GROUPBOX "",IDC_STATIC,4,16,132,21 - CONTROL "Heks",IDC_RADIO_HEX,"Button",BS_AUTORADIOBUTTON,8,24,29, - 10 - CONTROL "Des",IDC_RADIO_DEC,"Button",BS_AUTORADIOBUTTON,40,24,29, - 10 - CONTROL "Okt",IDC_RADIO_OCT,"Button",BS_AUTORADIOBUTTON,72,24,27, - 10 - CONTROL "Bin",IDC_RADIO_BIN,"Button",BS_AUTORADIOBUTTON,100,24, - 26,10 + CONTROL "Heks",IDC_RADIO_HEX,"Button",BS_AUTORADIOBUTTON,8,24,29,10 + CONTROL "Des",IDC_RADIO_DEC,"Button",BS_AUTORADIOBUTTON,40,24,29,10 + CONTROL "Okt",IDC_RADIO_OCT,"Button",BS_AUTORADIOBUTTON,72,24,27,10 + CONTROL "Bin",IDC_RADIO_BIN,"Button",BS_AUTORADIOBUTTON,100,24,26,10 GROUPBOX "",IDC_STATIC,4,36,76,21 CONTROL "Inv",IDC_CHECK_INV,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,44,26,10 @@ -150,7 +146,7 @@ BEGIN CONTROL "Radianer",IDC_RADIO_RAD,"Button",BS_AUTORADIOBUTTON,192, 24,42,10 CONTROL "Gradienter",IDC_RADIO_GRAD,"Button",BS_AUTORADIOBUTTON, - 236,24,44,10 + 236,24,48,10 PUSHBUTTON "C",IDC_BUTTON_CANC,272,40,40,17,BS_CENTER | BS_VCENTER | BS_NOTIFY | BS_OWNERDRAW | WS_TABSTOP PUSHBUTTON "CE",IDC_BUTTON_CE,228,40,40,17,BS_CENTER | BS_VCENTER | @@ -229,6 +225,84 @@ BEGIN DEFPUSHBUTTON "",IDC_BUTTON_FOCUS,0,0,5,5, NOT WS_VISIBLE END +IDD_DIALOG_CONVERSION DIALOGEX 0, 0, 320, 130 +STYLE WS_MINIMIZEBOX | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "ReactOS Kalkulator" +MENU IDR_MENU_STANDARD +FONT 8, "MS Shell Dlg" +BEGIN + PUSHBUTTON "Konverter",IDC_BUTTON_CONVERT,35,105,76,17 + COMBOBOX IDC_COMBO_CATEGORY,4,31,140,168,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP | CBS_SORT + LTEXT "Kategori:",IDC_STATIC,4,20,56,8 + COMBOBOX IDC_COMBO_FROM,4,60,140,168,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP | CBS_SORT + LTEXT "Konverter fra:",IDC_STATIC,4,49,56,8 + COMBOBOX IDC_COMBO_TO,4,87,140,168,CBS_DROPDOWNLIST | WS_VSCROLL | + WS_TABSTOP | CBS_SORT + LTEXT "Konverter til:",IDC_STATIC,4,76,56,8 + CONTROL "C",IDC_BUTTON_CANC,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,276,24,40,17 + CONTROL "CE",IDC_BUTTON_CE,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,232,24,40,17 + CONTROL "Tilbake",IDC_BUTTON_BACK,"Button",BS_OWNERDRAW | + BS_CENTER | BS_VCENTER | BS_NOTIFY | WS_TABSTOP,188,24, + 40,17 + RTEXT "",IDC_TEXT_OUTPUT,4,4,312,12,SS_CENTERIMAGE, + WS_EX_CLIENTEDGE + CONTROL "7",IDC_BUTTON_7,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,188,48,24,17 + CONTROL "4",IDC_BUTTON_4,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,188,67,24,17 + CONTROL "1",IDC_BUTTON_1,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,188,86,24,17 + CONTROL "0",IDC_BUTTON_0,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,188,105,24,17 + CONTROL "8",IDC_BUTTON_8,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,214,48,24,17 + CONTROL "5",IDC_BUTTON_5,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,214,67,24,17 + CONTROL "2",IDC_BUTTON_2,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,214,86,24,17 + CONTROL "+/-",IDC_BUTTON_SIGN,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,214,105,24,17 + CONTROL "9",IDC_BUTTON_9,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,240,48,24,17 + CONTROL "6",IDC_BUTTON_6,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,240,67,24,17 + CONTROL "3",IDC_BUTTON_3,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,240,86,24,17 + CONTROL ",",IDC_BUTTON_DOT,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,240,105,24,17 + CONTROL "/",IDC_BUTTON_DIV,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,266,48,24,17 + CONTROL "*",IDC_BUTTON_MULT,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,266,67,24,17 + CONTROL "-",IDC_BUTTON_SUB,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,266,86,24,17 + CONTROL "+",IDC_BUTTON_ADD,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,266,105,24,17 + CONTROL "Sqrt",IDC_BUTTON_SQRT,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,292,48,24,17 + CONTROL "%",IDC_BUTTON_PERCENT,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,292,67,24,17 + CONTROL "1/x",IDC_BUTTON_RX,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,292,86,24,17 + CONTROL "=",IDC_BUTTON_EQU,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,292,105,24,17 + CTEXT "",IDC_TEXT_MEMORY,152,24,24,17,SS_CENTERIMAGE, + WS_EX_CLIENTEDGE + CONTROL "MC",IDC_BUTTON_MC,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,152,48,24,17 + CONTROL "MR",IDC_BUTTON_MR,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,152,67,24,17 + CONTROL "MS",IDC_BUTTON_MS,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,152,86,24,17 + CONTROL "M+",IDC_BUTTON_MP,"Button",BS_OWNERDRAW | BS_CENTER | + BS_VCENTER | BS_NOTIFY | WS_TABSTOP,152,105,24,17 + DEFPUSHBUTTON "",IDC_BUTTON_FOCUS,0,0,5,5,NOT WS_VISIBLE +END + IDD_DIALOG_ABOUT DIALOGEX DISCARDABLE 0, 0, 264, 169 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Om ReactOS kalkulator" @@ -321,7 +395,7 @@ BEGIN MENUITEM "Word\tF3", IDM_VIEW_WORD, CHECKED MENUITEM "Tegn\tF4", IDM_VIEW_BYTE, CHECKED MENUITEM SEPARATOR - MENUITEM "Group digits", IDM_VIEW_GROUP, CHECKED + MENUITEM "Digital gruppe", IDM_VIEW_GROUP, CHECKED END POPUP "Hjelp" BEGIN @@ -363,3 +437,229 @@ BEGIN IDS_QUICKHELP "Rask hjelp" END +// types of conversion +STRINGTABLE DISCARDABLE +BEGIN + IDS_CONV_AREA "Omrеde" + IDS_CONV_CONSUMPTION "Forbruk (maskin)" + IDS_CONV_CURRENCY "Valuta" + IDS_CONV_ENERGY "Energi" + IDS_CONV_LENGTH "Lengde" + IDS_CONV_POWER "Strшm" + IDS_CONV_PRESSURE "Trykk" + IDS_CONV_TEMPERATURE "Temperatur" + IDS_CONV_VELOCITY "Hastighet" + IDS_CONV_VOLUME "Volum" + IDS_CONV_WEIGHT "Vekt" +END + +// TYPES OF AREAS +STRINGTABLE DISCARDABLE +BEGIN + IDS_AREA_ACRES "Acres" + IDS_AREA_ACRES_BRAZIL "Acres (Brazil)" + IDS_AREA_ACRES_FRANCE "Acres (France)" + IDS_AREA_ACRES_SCOTS "Acres (Scots)" + IDS_AREA_ACRES_US "Acres (US)" + IDS_AREA_ARES "Ares" + IDS_AREA_CHOU "Chou" + IDS_AREA_DANBO "Danbo" + IDS_AREA_HECTARES "Hectares" + IDS_AREA_JEONGBO "Jeongbo" + IDS_AREA_MORGEN_HUNGARY "Morgen (Hungary)" + IDS_AREA_MU "Mu" + IDS_AREA_PING "Ping" + IDS_AREA_PYEONG "Pyeong" + IDS_AREA_PYEONGBANGJA "Pyeongbangja" + IDS_AREA_RAI "Rai" + IDS_AREA_SE "Se" + IDS_AREA_SQUARE_CENTIMETERS "Square centimeters" + IDS_AREA_SQUARE_CHR "Square chr" + IDS_AREA_SQUARE_FATHOMS "Square fathoms" + IDS_AREA_SQUARE_FATHOMS_HUNGARY "Square fathoms (Hungary)" + IDS_AREA_SQUARE_FEET "Square feet" + IDS_AREA_SQUARE_INCHES "Square inches" + IDS_AREA_SQUARE_KILOMETERS "Square kilometers" + IDS_AREA_SQUARE_LAR "Square lar" + IDS_AREA_SQUARE_METER "Square meter" + IDS_AREA_SQUARE_MILES "Square miles" + IDS_AREA_SQUARE_MILLIMETERS "Square millimeters" + IDS_AREA_SQUARE_SHAKU "Square shaku" + IDS_AREA_SQUARE_TSUEN "Square tsuen" + IDS_AREA_SQUARE_VA "Square va" + IDS_AREA_SQUARE_YARD "Square yard" + IDS_AREA_TAN "Tan" + IDS_AREA_TSUBO "Tsubo" +END + +// TYPES OF COMSUMPTIONS +STRINGTABLE DISCARDABLE +BEGIN + IDS_CONSUMPTION_KM_PER_L "Kilometer/liter" + IDS_CONSUMPTION_L_PER_100_KM "Liters/100 kilometers" + IDS_CONSUMPTION_MILES_GALLON_UK "Miles/gallon (UK)" + IDS_CONSUMPTION_MILES_GALLON_US "Miles/gallon (US)" +END + +// TYPES OF CURRENCIES +STRINGTABLE DISCARDABLE +BEGIN + IDS_CURRENCY_AUSTRIAN_SCHILLING "Austrian schilling" + IDS_CURRENCY_BELGIAN_FRANC "Belgian franc" + IDS_CURRENCY_CYPRIOT_POUND "Cypriot pound" + IDS_CURRENCY_DEUTSCHE_MARK "Deutsche Mark" + IDS_CURRENCY_DUTCH_GUILDER "Dutch guilder" + IDS_CURRENCY_EURO "Euro" + IDS_CURRENCY_FINNISH_MARKKA "Finnish markka" + IDS_CURRENCY_FRENCH_FRANC "French franc" + IDS_CURRENCY_GREEK_DRACHMA "Greek Drachma" + IDS_CURRENCY_IRISH_POUND "Irish pound" + IDS_CURRENCY_ITALIAN_LIRA "Italian lira" + IDS_CURRENCY_LUXEMBOURG_FRANC "Luxembourg franc" + IDS_CURRENCY_MALTESE_LIRA "Maltese lira" + IDS_CURRENCY_PORTOGUESE_ESCUDO "Portoguese escudo" + IDS_CURRENCY_SLOVENIAN_TOLAR "Slovenian tolar" + IDS_CURRENCY_SPANISH_PESETA "Spanish peseta" +END + +// TYPES OF ENERGIES +STRINGTABLE DISCARDABLE +BEGIN + IDS_ENERGY_15_C_CALORIES "15 ^C calories" + IDS_ENERGY_ERGS "Ergs" + IDS_ENERGY_IT_CALORIES "International Table calories" + IDS_ENERGY_JOULES "Joules" + IDS_ENERGY_KILOJOULES "Kilojoules" + IDS_ENERGY_KILOWATT_HOURS "Kilowatt hours" + IDS_ENERGY_NUTRITION_CALORIES "Nutrition calories" + IDS_ENERGY_TH_CALORIES "Thermochemical calorie" +END + +// TYPES OF LENGTHS +STRINGTABLE DISCARDABLE +BEGIN + IDS_LENGTH_ANGSTROMS "Angstroms" + IDS_LENGTH_ASTRONOMILA_UNITS "Astronomila units" + IDS_LENGTH_BARLEYCORNS "Barleycorns" + IDS_LENGTH_CENTIMETERS "Centimeters" + IDS_LENGTH_CHAINS_UK "Chains (UK)" + IDS_LENGTH_CHI "Chi" + IDS_LENGTH_CHOU "Chou" + IDS_LENGTH_CHR "Chr" + IDS_LENGTH_CUN "Cun" + IDS_LENGTH_FATHOMS "Fathoms" + IDS_LENGTH_FATHOMS_HUNGARY "Fathoms (Hungary)" + IDS_LENGTH_FEET "Feet" + IDS_LENGTH_FURLONGS "Furlongs" + IDS_LENGTH_GAN "Gan" + IDS_LENGTH_HANDS "Hands" + IDS_LENGTH_HUNH "Hunh" + IDS_LENGTH_INCHES "Inches" + IDS_LENGTH_JA "Ja" + IDS_LENGTH_JEONG "Jeong" + IDS_LENGTH_KABIET "Kabiet" + IDS_LENGTH_KEN "Ken" + IDS_LENGTH_KEUB "Keub" + IDS_LENGTH_KILOMETERS "Kilometers" + IDS_LENGTH_LAR "Lar" + IDS_LENGTH_LIGHT_YEARS "Light years" + IDS_LENGTH_LINKS_UK "Links (UK)" + IDS_LENGTH_METERS "Meters" + IDS_LENGTH_MILES "Miles" + IDS_LENGTH_MILLIMETERS "Millimeters" + IDS_LENGTH_NAUTICAL_MILES "Nautical miles" + IDS_LENGTH_NIEU "Nieu" + IDS_LENGTH_PARSECS "Parsecs" + IDS_LENGTH_PICAS "Picas" + IDS_LENGTH_RI_JAPAN "Ri (Japan)" + IDS_LENGTH_RI_KOREA "Ri (Korea)" + IDS_LENGTH_SAWK "Sawk" + IDS_LENGTH_SEN "Sen" + IDS_LENGTH_SHAKU "Shaku" + IDS_LENGTH_SPAN "Span" + IDS_LENGTH_SUN "Sun" + IDS_LENGTH_TSUEN "Tsuen" + IDS_LENGTH_VA "Va" + IDS_LENGTH_YARDS "Yards" + IDS_LENGTH_YOTE "Yote" + IDS_LENGTH_ZHANG "Zhang" +END + +// TYPES OF POWERS +STRINGTABLE DISCARDABLE +BEGIN + IDS_POWER_HORSEPOWER "hestekrefter" + IDS_POWER_KILOWATTS "Kilowatt" + IDS_POWER_MEGAWATTS "Megawatt" + IDS_POWER_WATTS "Watt" +END + +// TYPE OF PRESSURES +STRINGTABLE DISCARDABLE +BEGIN + IDS_PRESSURE_ATMOSPHERES "Atmosfжretrykk" + IDS_PRESSURE_BARS "Bars" + IDS_PRESSURE_MM_OF_MERCURY "Millimeters of mercury" + IDS_PRESSURE_PASCALS "Pascals" + IDS_PRESSURE_PSI "Pounds-force per square inch" +END + +// TYPES OF TEMPERATURES +STRINGTABLE DISCARDABLE +BEGIN + IDS_TEMPERATURE_CELSIUS "Celsius" + IDS_TEMPERATURE_FAHRENHEIT "Fahrenheit" + IDS_TEMPERATURE_KELVIN "Kelvin" + IDS_TEMPERATURE_RANKINE "Rankine" +END + +// TYPES OF VELOCITIES +STRINGTABLE DISCARDABLE +BEGIN + IDS_VELOCITY_FEET_HOUR "Feet/time" + IDS_VELOCITY_KILOMETERS_HOUR "kilometer/time" + IDS_VELOCITY_KNOTS "Knot" + IDS_VELOCITY_MACH "Mach" + IDS_VELOCITY_METERS_SECOND "Meter/sekunder" + IDS_VELOCITY_MILES_HOUR "Mil/time" +END + +// TYPES OF VOLUMES +STRINGTABLE DISCARDABLE +BEGIN + IDS_VOLUME_BARRELS_UK "Barrels (UK)" + IDS_VOLUME_BARRELS_OIL "Barrels oil" + IDS_VOLUME_BUN "Bun" + IDS_VOLUME_BUSHELS_UK "Bushels (UK)" + IDS_VOLUME_BUSHELS_US "Bushels (US)" + IDS_VOLUME_CUBIC_CENTIMETERS "Cubic centimeters" + IDS_VOLUME_CUBIC_FEET "Cubic feet" + IDS_VOLUME_CUBIC_INCHES "Cubic inches" + IDS_VOLUME_CUBIC_METERS "Cubic meters" + IDS_VOLUME_CUBIC_YARDS "Cubic yards" + IDS_VOLUME_DOE "Doe" + IDS_VOLUME_FLUID_OUNCES_UK "Fluid ounces (UK)" + IDS_VOLUME_FLUID_OUNCES_US "Fluid ounces (US)" + IDS_VOLUME_GALLONS_UK "Gallons (UK)" + IDS_VOLUME_GALLONS_DRY_US "Gallons, dry (US)" + IDS_VOLUME_GALLONS_LIQUID_US "Gallons, liquid (US)" + IDS_VOLUME_GOU "Gou" + IDS_VOLUME_HOP "Hop" + IDS_VOLUME_ICCE "Icce" + IDS_VOLUME_KWIAN "Kwian" + IDS_VOLUME_LITERS "Liters" + IDS_VOLUME_MAL "Mal" + IDS_VOLUME_MILLILITERS "Milliliters" + IDS_VOLUME_PINTS_UK "Pints (UK)" + IDS_VOLUME_PINTS_DRY_US "Pints, dry (US)" + IDS_VOLUME_PINTS_LIQUID_US "Pints, liquid (US)" + IDS_VOLUME_QUARTS_UK "Quarts (UK)" + IDS_VOLUME_QUARTS_DRY_US "Quarts, dry (US)" + IDS_VOLUME_QUARTS_LIQUID_US "Quarts, liquid (US)" + IDS_VOLUME_SEKI "Seki" + IDS_VOLUME_SYOU "Syou" + IDS_VOLUME_TANANLOUNG "Tananloung" + IDS_VOLUME_TANG "Tang" + IDS_VOLUME_TO "To" +END + diff --git a/reactos/base/applications/calc/rpn.c b/reactos/base/applications/calc/rpn.c index 241464673bf..1435e8065ab 100644 --- a/reactos/base/applications/calc/rpn.c +++ b/reactos/base/applications/calc/rpn.c @@ -310,6 +310,8 @@ void run_operator(calc_node_t *result, operator_list[operation].op_p(&dc, &da, &db); } else operator_list[operation].op_f(&dc, &da, &db); + if (_finite(dc.f) == 0) + calc.is_nan = TRUE; } else { operator_list[operation].op_i(&dc, &da, &db); /* apply final limitator to result */ @@ -331,7 +333,6 @@ static void evalStack(calc_number_t *number) stack_node_t *op, ip; unsigned int prec; - percent_mode = FALSE; op = pop(); ip = *op; prec = operator_list[ip.node.operation].prec; @@ -373,6 +374,9 @@ int exec_infix2postfix(calc_number_t *number, unsigned int func) return 0; } + if (func == RPN_OPERATOR_PERCENT) + percent_mode = TRUE; + tmp.node.number = *number; tmp.node.base = calc.base; tmp.node.operation = func; diff --git a/reactos/base/applications/calc/rpn_mpfr.c b/reactos/base/applications/calc/rpn_mpfr.c index a6e8d70df20..d5dc95c805b 100644 --- a/reactos/base/applications/calc/rpn_mpfr.c +++ b/reactos/base/applications/calc/rpn_mpfr.c @@ -311,7 +311,6 @@ static void evalStack(calc_number_t *number) unsigned int prec; mpfr_init(ip.node.number.mf); - percent_mode = FALSE; op = pop(); node_copy(&ip, op); prec = operator_list[ip.node.operation].prec; @@ -355,6 +354,9 @@ int exec_infix2postfix(calc_number_t *number, unsigned int func) return 0; } + if (func == RPN_OPERATOR_PERCENT) + percent_mode = TRUE; + mpfr_init(tmp.node.number.mf); rpn_copy(&tmp.node.number, number); tmp.node.operation = func; diff --git a/reactos/base/applications/calc/whatsnew.txt b/reactos/base/applications/calc/whatsnew.txt index b4b7f596d61..930ffb94eac 100644 --- a/reactos/base/applications/calc/whatsnew.txt +++ b/reactos/base/applications/calc/whatsnew.txt @@ -1,3 +1,14 @@ +1.10 (20080813) +======================= +* Added Norvegian and Korean translations. +* Fixed Polish and Slovak translations. +* Fixed percent mode. +* Fixed some unsignaled overflow errors. +* Fixed conversion method, now scientific notation is recognized too. +* Added compilation for UNICODE executables. +* Plain MINGW toolchain do not support wWinMain function, so I switched to old WinMain if it is not under ReactOS' build tree. +* Detect error if UNICODE version is launched into Win9x (avoid the lock). + 1.09 (20080630) ======================= * Fixed bug with Conversion function: "Category" type must be found like "from" and "to" because the combobox sorts its items alphabetically. diff --git a/reactos/base/applications/calc/winmain.c b/reactos/base/applications/calc/winmain.c index 0727c15a39b..0b6cbbba75f 100644 --- a/reactos/base/applications/calc/winmain.c +++ b/reactos/base/applications/calc/winmain.c @@ -784,68 +784,18 @@ static void delete_stat_item(int n) static char *ReadConversion(const char *formula) { - unsigned int len = 256, n; - char *str; - char *code = NULL; - const char *p = formula; - char c; - calc_number_t x; - TCHAR buffer[SIZEOF(calc.buffer)]; -#ifdef UNICODE - char cbuffer[SIZEOF(calc.buffer)]; -#endif + int len = strlen(formula); + char *str = (char *)malloc(len+3); - str = (char *)malloc(len); if (str == NULL) return NULL; - /* prepare code string */ - rpn_alloc(&x); - convert_text2number(&x); - prepare_rpn_result(&x, - buffer, SIZEOF(buffer), - calc.base); - rpn_free(&x); - -#ifdef UNICODE - WideCharToMultiByte(CP_ACP, 0, buffer, -1, cbuffer, SIZEOF(cbuffer), NULL, NULL); -#endif - str[0] = '('; - n = 1; - while (1) { - if (code != NULL) { - c = *code++; - if (*code == '\0') - code = NULL; - } else - c = *p++; + memcpy(str+1, formula, len); + str[len+1] = ')'; + str[len+2] = '\0'; - if (c == '\0') { - str[n++] = ')'; - if (n >= len-1) { - str = (char *)realloc(str, len += 16); - if (str == NULL) - return NULL; - } - break; - } else - if (c == '$') { -#ifdef UNICODE - code = cbuffer; -#else - code = buffer; -#endif - continue; - } - str[n++] = c; - if (n >= len-1) { - str = (char *)realloc(str, len += 16); - if (str == NULL) - return NULL; - } - } - str[n] = '\0'; + _tcscpy(calc.source, (*calc.buffer == _T('\0')) ? _T("0") : calc.buffer); /* clear display content before proceeding */ calc.ptr = calc.buffer; @@ -991,6 +941,11 @@ static char *handle_sequence_input(HWND hwnd, sequence_t *seq) case 'Q': PostMessage(hwnd, WM_COMMAND, (WPARAM)IDC_BUTTON_CANC, 0); break; case 'R': PostMessage(hwnd, WM_COMMAND, (WPARAM)IDC_BUTTON_MR, 0); break; } + } else + if (ch == '$') { + calc.ptr = + _tcscpy(calc.buffer, calc.source) + + _tcslen(calc.source); } else { for (x=0; x #include #include +#include int _tmain(int argc, TCHAR ** argv) { @@ -29,30 +31,89 @@ int _tmain(int argc, TCHAR ** argv) return -1; } - buf = HeapAlloc(GetProcessHeap(), 0, (bufsize+1) * sizeof(TCHAR)); - if (!buf) + if (_tcsstr(argv[1], "--winetest") && (argc == 3)) { - return -1; - } + char psBuffer[128]; + char psBuffer2[128]; + char cmd[255]; + char test[300]; + FILE *pPipe; + FILE *pPipe2; - offset = 0; - for(i = 1; i < argc; i++) - { - int length = _tcslen(argv[i]); - _tcsncpy(&buf[offset], argv[i], length); - offset += length; - if (i + 1 < argc) + /* get available tests */ + pPipe = _tpopen(argv[2], "r"); + if (pPipe != NULL) { - buf[offset] = _T(' '); + while(fgets(psBuffer, 128, pPipe)) + { + if (psBuffer[0] == ' ') + { + strcpy(cmd, argv[2]); + strcat(cmd, " "); + strcat(cmd, psBuffer+4); + /* run the current test */ + strcpy(test, "\n\nRunning "); + strcat(test, cmd); + OutputDebugStringA(test); + pPipe2 = _tpopen(cmd, "r"); + if (pPipe2 != NULL) + { + while(fgets(psBuffer2, 128, pPipe2)) + { + char *nlptr2 = strchr(psBuffer2, '\n'); + if (nlptr2) + *nlptr2 = '\0'; + OutputDebugStringA(psBuffer2); + } + _pclose(pPipe2); + } + } + } + _pclose(pPipe); } - else - { - buf[offset] = _T('\n'); - buf[offset+1] = _T('\0'); - } - offset++; } - OutputDebugString(buf); - HeapFree(GetProcessHeap(), 0, buf); + else if (_tcsstr(argv[1], "--process") && (argc == 3)) + { + char psBuffer[128]; + FILE *pPipe; + + pPipe = _tpopen(argv[2], "r"); + if (pPipe != NULL) + { + while(fgets(psBuffer, 128, pPipe)) + { + OutputDebugStringA(psBuffer); + } + _pclose(pPipe); + } + } + else + { + buf = HeapAlloc(GetProcessHeap(), 0, (bufsize+1) * sizeof(TCHAR)); + if (!buf) + { + return -1; + } + + offset = 0; + for(i = 1; i < argc; i++) + { + int length = _tcslen(argv[i]); + _tcsncpy(&buf[offset], argv[i], length); + offset += length; + if (i + 1 < argc) + { + buf[offset] = _T(' '); + } + else + { + buf[offset] = _T('\n'); + buf[offset+1] = _T('\0'); + } + offset++; + } + OutputDebugString(buf); + HeapFree(GetProcessHeap(), 0, buf); + } return 0; } diff --git a/reactos/base/applications/cmdutils/more/lang/fr-FR.rc b/reactos/base/applications/cmdutils/more/lang/fr-FR.rc index 2b718376e03..fb9b5762d02 100644 --- a/reactos/base/applications/cmdutils/more/lang/fr-FR.rc +++ b/reactos/base/applications/cmdutils/more/lang/fr-FR.rc @@ -7,9 +7,9 @@ BEGIN Commande | MORE \n\ MORE [Lecteur:][Chemin]Nom du fichier\n\n\ [Lecteur:][Chemin]Nom du fichier Un fichier, dont le contenu sera affichй.\n\ - Commande\t\t Une commande, dont la sortie sera affichй.\n\n\ - А l'invite ""-- Continuer --"" you pouvez appuyer sur n'importe quelle touche pour afficher la page suivante.\n" + Commande\t\t Une commande, dont la sortie sera affichйe.\n\n\ + А l'invite ""-- Continuer --"" Vous pouvez appuyer sur n'importe quelle touche pour afficher la page suivante.\n" IDS_CONTINUE, " -- Continuer (100%) -- " - IDS_FILE_ACCESS, "Impossible d'accиder au fichier %s." + IDS_FILE_ACCESS, "Impossible d'accйder au fichier %s." END diff --git a/reactos/base/applications/dxdiag/lang/no-NO.rc b/reactos/base/applications/dxdiag/lang/no-NO.rc index edfb55829b1..3ce74d0a7ce 100644 --- a/reactos/base/applications/dxdiag/lang/no-NO.rc +++ b/reactos/base/applications/dxdiag/lang/no-NO.rc @@ -4,13 +4,13 @@ IDD_MAIN_DIALOG DIALOGEX DISCARDABLE 0, 0, 478, 280 STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -CAPTION "ReactX-Diagnostic program" +CAPTION "ReactX-diagnose program" FONT 8, "MS Shell Dlg" BEGIN CONTROL "Tab1",IDC_TAB_CONTROL,"SysTabControl32",WS_TABSTOP,2,2,474,250 PUSHBUTTON "&Hjelp", IDC_BUTTON_HELP, 2, 261, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP DEFPUSHBUTTON "&Neste side", IDC_BUTTON_NEXT, 257, 261, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP - PUSHBUTTON "&Lagre Alt Informasjon...", IDC_BUTTON_SAVE_INFO, 311, 261, 110, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + PUSHBUTTON "&Lagre alt informasjon...", IDC_BUTTON_SAVE_INFO, 311, 261, 110, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP PUSHBUTTON "&Avslutt", IDC_BUTTON_EXIT, 425, 261, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP END @@ -122,7 +122,7 @@ BEGIN RTEXT "Dato:", -1, 275, 45, 55, 10 RTEXT "WHQL-Logo:", -1, 275, 55, 55, 10 RTEXT "Andre filer:", -1, 275, 65, 55, 10 - RTEXT "Provider:", -1, 275, 75, 55, 10 + RTEXT "Fabrikant:", -1, 275, 75, 55, 10 LTEXT "", IDC_STATIC_DSOUND_DRIVER, 335, 25, 100, 10 LTEXT "", IDC_STATIC_DSOUND_VERSION, 335, 35, 100, 10 LTEXT "", IDC_STATIC_DSOUND_DATE, 335, 45, 100, 10 @@ -148,9 +148,9 @@ IDD_INPUT_DIALOG DIALOGEX DISCARDABLE 0, 0, 462, 220 STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "MS Shell Dlg" BEGIN - GROUPBOX "DirectInput Enheter", -1, 10, 10, 452, 80 + GROUPBOX "Direkteinndata enheter", -1, 10, 10, 452, 80 CONTROL "", IDC_LIST_DEVICE, "SysListView32", LVS_REPORT | WS_CHILD | WS_BORDER | WS_TABSTOP, 20, 22, 432, 60 - GROUPBOX "Input Enheter", -1, 10, 100, 452, 60 + GROUPBOX "Inndata enheter", -1, 10, 100, 452, 60 CONTROL "", IDC_TREE_PORT, "SysTreeView32", TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 20, 112, 432, 40, 0x00000200 GROUPBOX "Informasjon", -1, 10, 170, 452, 50 EDITTEXT IDC_RICH_INFO, 20, 182, 432, 30, WS_DISABLED | WS_TABSTOP @@ -160,7 +160,7 @@ IDD_NETWORK_DIALOG DIALOGEX DISCARDABLE 0, 0, 462, 220 STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "MS Shell Dlg" BEGIN - GROUPBOX "Registered DirectPlay Service Provider", -1, 10, 10, 452, 80 + GROUPBOX "Registert DirectPlay tjeneste leverandшr", -1, 10, 10, 452, 80 CONTROL "", IDC_LIST_PROVIDER, "SysListView32", LVS_REPORT | WS_CHILD | WS_BORDER | WS_TABSTOP, 20, 22, 432, 60 END @@ -177,13 +177,13 @@ BEGIN IDS_DISPLAY_DIALOG "Skjerm" IDS_SOUND_DIALOG "Lyd" IDS_MUSIC_DIALOG "Musikk" - IDS_INPUT_DIALOG "Input" + IDS_INPUT_DIALOG "Inndata" IDS_NETWORK_DIALOG "Nettverk" IDS_HELP_DIALOG "Hjelp" IDS_FORMAT_MB "%I64uMB RAM" IDS_FORMAT_SWAP "%I64u MB brukt, %I64u MB tilgjengelig" - IDS_FORMAT_UNIPROC "%s (%u CPU)" - IDS_FORMAT_MPPROC "%s (%u CPUs)" + IDS_FORMAT_UNIPROC "%s (%u prosessor)" + IDS_FORMAT_MPPROC "%s (%u prosesorer)" IDS_VERSION_UNKNOWN "Ukjent versjon" IDS_DEVICE_STATUS_ATTACHED "Koblet til" IDS_DEVICE_STATUS_MISSING "Koblet fra" diff --git a/reactos/base/applications/games/solitaire/lang/fr-FR.rc b/reactos/base/applications/games/solitaire/lang/fr-FR.rc index a062d927dad..b63d69cec38 100644 --- a/reactos/base/applications/games/solitaire/lang/fr-FR.rc +++ b/reactos/base/applications/games/solitaire/lang/fr-FR.rc @@ -22,7 +22,7 @@ BEGIN AUTORADIOBUTTON "En tirer trois", IDC_OPT_DRAWTHREE, 14, 32, 52, 10 AUTOCHECKBOX "Afficher le temp&s", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP | WS_DISABLED - AUTOCHECKBOX "Barre de s&tatus", IDC_OPT_STATUSBAR, 7, 66, 64, 10, WS_TABSTOP + AUTOCHECKBOX "Barre de s&tatut", IDC_OPT_STATUSBAR, 7, 66, 64, 10, WS_TABSTOP DEFPUSHBUTTON "OK", IDOK, 35, 97, 50, 14 PUSHBUTTON "Annuler", IDCANCEL, 101, 97, 50, 14 diff --git a/reactos/base/applications/kbswitch/kbsdll/kbsdll.c b/reactos/base/applications/kbswitch/kbsdll/kbsdll.c index 7933fcd0a45..e533ecb96f4 100644 --- a/reactos/base/applications/kbswitch/kbsdll/kbsdll.c +++ b/reactos/base/applications/kbswitch/kbsdll/kbsdll.c @@ -88,8 +88,8 @@ WinHookProc(int code, WPARAM wParam, LPARAM lParam) return CallNextHookEx(hWinHook, code, wParam, lParam); } -BOOL -KbSwitchSetHooks() +BOOL WINAPI +KbSwitchSetHooks(VOID) { hKeyboardHook = SetWindowsHookEx(WH_KEYBOARD, KeyboardHookProc, hInstance, 0); hLangHook = SetWindowsHookEx(WH_GETMESSAGE, LangHookProc, hInstance, 0); @@ -101,8 +101,8 @@ KbSwitchSetHooks() return FALSE; } -VOID -KbSwitchDeleteHooks() +VOID WINAPI +KbSwitchDeleteHooks(VOID) { if (hKeyboardHook) UnhookWindowsHookEx(hKeyboardHook); if (hLangHook) UnhookWindowsHookEx(hLangHook); diff --git a/reactos/base/applications/kbswitch/kbsdll/kbsdll.def b/reactos/base/applications/kbswitch/kbsdll/kbsdll.def deleted file mode 100644 index 99e8f342753..00000000000 --- a/reactos/base/applications/kbswitch/kbsdll/kbsdll.def +++ /dev/null @@ -1,7 +0,0 @@ -LIBRARY kbsdll.dll - -EXPORTS -KbSwitchSetHooks -KbSwitchDeleteHooks - -; EOF diff --git a/reactos/base/applications/kbswitch/kbsdll/kbsdll.rbuild b/reactos/base/applications/kbswitch/kbsdll/kbsdll.rbuild index 4e0bd705ae8..c84b3edc5aa 100644 --- a/reactos/base/applications/kbswitch/kbsdll/kbsdll.rbuild +++ b/reactos/base/applications/kbswitch/kbsdll/kbsdll.rbuild @@ -1,15 +1,15 @@ - + . 0x0500 0x0600 0x0600 - ntdll kernel32 user32 comctl32 kbsdll.c kbsdll.rc + kbsdll.spec diff --git a/reactos/base/applications/kbswitch/kbsdll/kbsdll.spec b/reactos/base/applications/kbswitch/kbsdll/kbsdll.spec new file mode 100644 index 00000000000..46a5a52f32a --- /dev/null +++ b/reactos/base/applications/kbswitch/kbsdll/kbsdll.spec @@ -0,0 +1,2 @@ +@ stdcall KbSwitchSetHooks() +@ stdcall KbSwitchDeleteHooks() diff --git a/reactos/base/applications/kbswitch/lang/it-IT.rc b/reactos/base/applications/kbswitch/lang/it-IT.rc new file mode 100644 index 00000000000..e61973e2107 --- /dev/null +++ b/reactos/base/applications/kbswitch/lang/it-IT.rc @@ -0,0 +1,11 @@ +LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL + +IDR_POPUP MENU +BEGIN + POPUP "popup" + BEGIN + MENUITEM "&Preferenze...", ID_PREFERENCES + MENUITEM SEPARATOR + MENUITEM "&Esci", ID_EXIT + END +END diff --git a/reactos/base/applications/kbswitch/rsrc.rc b/reactos/base/applications/kbswitch/rsrc.rc index b8eb13b6888..c8ead289907 100644 --- a/reactos/base/applications/kbswitch/rsrc.rc +++ b/reactos/base/applications/kbswitch/rsrc.rc @@ -4,6 +4,7 @@ #include "lang/en-US.rc" #include "lang/es-ES.rc" #include "lang/fr-FR.rc" +#include "lang/it-IT.rc" #include "lang/lt-LT.rc" #include "lang/no-NO.rc" #include "lang/pl-PL.rc" diff --git a/reactos/base/applications/msconfig/lang/fr-FR.rc b/reactos/base/applications/msconfig/lang/fr-FR.rc index e116455ce87..6ff3e099fc2 100644 --- a/reactos/base/applications/msconfig/lang/fr-FR.rc +++ b/reactos/base/applications/msconfig/lang/fr-FR.rc @@ -36,7 +36,7 @@ BEGIN PUSHBUTTON "Rechercher", IDC_BTN_SYSTEM_FIND, 290, 95, 66, 14 PUSHBUTTON "&Nouveau", IDC_BTN_SYSTEM_NEW, 290, 115, 66, 14 - PUSHBUTTON "Йdi&ter", IDC_BTN_SYSTEM_EDIT, 290, 135, 66, 14 + PUSHBUTTON "M&odifier", IDC_BTN_SYSTEM_EDIT, 290, 135, 66, 14 PUSHBUTTON "Activer tout", IDC_BTN_SYSTEM_ACTIVATE, 123, 155, 66, 14 PUSHBUTTON "Dйsactiver tout",IDC_BTN_SYSTEM_DEACTIVATE, 195, 155, 66, 14 @@ -64,11 +64,11 @@ 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 "Sйlection du Dйmarrage ", -1, 10, 10, 340, 150,0,WS_EX_TRANSPARENT - CONTROL "Dйmarrage &Normal - charge tous les drivers et services", IDC_CBX_NORMAL_START, "Button", 0x50010009, 20, 30, 185, 10 - CONTROL "Dйmarrage &Diagnostic - charge les pйriphйriques de base et services seulement", IDC_CBX_DIAGNOSTIC_START, "Button", 0x50010009, 20, 45, 260, 10 - CONTROL "Dйmarrage &Sйlectif", IDC_CBX_SELECTIVE_STARTUP, "Button", 0x50010009, 20, 60, 75, 10 - AUTOCHECKBOX "T&raiter le fichier SYSTEM.INI", IDC_CBX_SYSTEM_INI, 30, 80, 100, 10 + GROUPBOX "Sйlection du mode de dйmarrage ", -1, 10, 10, 340, 150,0,WS_EX_TRANSPARENT + CONTROL "Dйmarrage &normal - charge tous les pilotes et tous les services", IDC_CBX_NORMAL_START, "Button", 0x50010009, 20, 30, 185, 10 + CONTROL "Dйmarrage en mode &diagnostic - charge les pйriphйriques de base et les services seulement", IDC_CBX_DIAGNOSTIC_START, "Button", 0x50010009, 20, 45, 260, 10 + CONTROL "Dйmarrage &sйlectif", IDC_CBX_SELECTIVE_STARTUP, "Button", 0x50010009, 20, 60, 75, 10 + AUTOCHECKBOX "T&raiter le fichier System.ini", IDC_CBX_SYSTEM_INI, 30, 80, 100, 10 AUTOCHECKBOX "&Charger les Services Systиme", IDC_CBX_SYSTEM_SERVICE, 30, 95, 105, 10 AUTOCHECKBOX "Charger les йlйments de dйmarrage", IDC_CBX_STARTUP_ITEM, 30, 110, 75, 10 END @@ -78,7 +78,7 @@ 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 "&Cocher tous les chemins de dйmarrage", IDC_BTN_CHECK_BOOT_PATH, 10, 65, 70, 12 + PUSHBUTTON "&Vйrifier les chemins de dйmarrage", IDC_BTN_CHECK_BOOT_PATH, 10, 65, 70, 12 PUSHBUTTON "&Par Dйfaut", IDC_BTN_SET_DEFAULT_BOOT, 100, 65, 70, 12 PUSHBUTTON "&Monter", IDC_BTN_MOVE_UP_BOOT_OPTION, 190, 65, 70, 12 PUSHBUTTON "&Descendre", IDC_BTN_MOVE_DOWN_BOOT_OPTION, 280, 65, 70, 12 @@ -91,7 +91,7 @@ BEGIN PUSHBUTTON "Options A&vancйes...", IDC_BTN_ADVANCED_OPTIONS, 100, 150, 70, 12 LTEXT "&Dйlai:", -1, 280, 91, 30, 10 EDITTEXT IDC_TXT_BOOT_TIMEOUT, 310, 90, 25, 12, ES_LEFT - LTEXT "sec.", -1, 340, 91, 15, 10 + LTEXT "secondes", -1, 340, 91, 15, 10 END IDD_FREELDR_ADVANCED_PAGE DIALOGEX DISCARDABLE 0, 0, 175, 175 @@ -133,7 +133,7 @@ END STRINGTABLE DISCARDABLE BEGIN IDS_SERVICES_COLUMN_SERVICE "Service" - IDS_SERVICES_COLUMN_REQ "Requis" + IDS_SERVICES_COLUMN_REQ "Essentiel" IDS_SERVICES_COLUMN_VENDOR "Fabricant" IDS_SERVICES_COLUMN_STATUS "Йtat" END @@ -144,15 +144,15 @@ BEGIN IDS_TOOLS_COLUMN_DESCR "Description" IDS_TOOLS_CMD_NAME "Console" - IDS_TOOLS_CMD_DESCR "" + IDS_TOOLS_CMD_DESCR "Ouvre la console." IDS_TOOLS_CMD_CMD "cmd.exe" IDS_TOOLS_INFO_NAME "Version" - IDS_TOOLS_INFO_DESCR "Affiche les informations de version." + IDS_TOOLS_INFO_DESCR "Affiche la version de ReactOS." IDS_TOOLS_INFO_CMD "winver.exe" - IDS_TOOLS_REGEDIT_NAME "Editeur de Registre" - IDS_TOOLS_REGEDIT_DESCR "Ouvre l'йditeur de Registre" + IDS_TOOLS_REGEDIT_NAME "Editeur du Registre" + IDS_TOOLS_REGEDIT_DESCR "Ouvre l'йditeur du Registre" IDS_TOOLS_REGEDIT_CMD "regedit.exe" IDS_TOOLS_SYSDM_NAME "Propriйtйs systиme" @@ -160,14 +160,14 @@ BEGIN IDS_TOOLS_SYSDM_CMD "control.exe" IDS_TOOLS_SYSDM_PARAM "sysdm.cpl" - IDS_STARTUP_COLUMN_ELEMENT "Elйment" + IDS_STARTUP_COLUMN_ELEMENT "Йlйment" IDS_STARTUP_COLUMN_CMD "Commande" IDS_STARTUP_COLUMN_PATH "Chemin" END STRINGTABLE DISCARDABLE BEGIN - IDS_SERVICES_STATUS_RUNNING "En cours" + IDS_SERVICES_STATUS_RUNNING "En cours d'exйcution" IDS_SERVICES_STATUS_STOPPED "Arrкtй" IDS_SERVICES_YES "Oui" IDS_SERVICES_UNKNOWN "Inconnu" diff --git a/reactos/base/applications/msconfig/lang/no-NO.rc b/reactos/base/applications/msconfig/lang/no-NO.rc index 0229bcfd6c2..9b4ec2f3741 100644 --- a/reactos/base/applications/msconfig/lang/no-NO.rc +++ b/reactos/base/applications/msconfig/lang/no-NO.rc @@ -38,8 +38,8 @@ BEGIN PUSHBUTTON "&Ny", IDC_BTN_SYSTEM_NEW, 290, 115, 66, 14 PUSHBUTTON "Re&diger", IDC_BTN_SYSTEM_EDIT, 290, 135, 66, 14 - PUSHBUTTON "A&ktiver Alt", IDC_BTN_SYSTEM_ACTIVATE, 123, 155, 66, 14 - PUSHBUTTON "Dektiver A<",IDC_BTN_SYSTEM_DEACTIVATE, 195, 155, 66, 14 + PUSHBUTTON "A&ktiver alt", IDC_BTN_SYSTEM_ACTIVATE, 123, 155, 66, 14 + PUSHBUTTON "D&eaktiver alt",IDC_BTN_SYSTEM_DEACTIVATE, 195, 155, 66, 14 END IDD_TOOLS_PAGE DIALOGEX DISCARDABLE 0, 0, 362, 175 @@ -64,13 +64,13 @@ 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 "Oppstarts utvalg", -1, 10, 10, 340, 150,0,WS_EX_TRANSPARENT - CONTROL "&Normal oppstart - laste inn alle enhetsdrivere og tjenester", IDC_CBX_NORMAL_START, "Button", 0x50010009, 20, 30, 180, 10 - CONTROL "&Diagnose oppstart - last bare inn grunnleggende enheter og tjenester", IDC_CBX_DIAGNOSTIC_START, "Button", 0x50010009, 20, 45, 195, 10 + GROUPBOX "Oppstarts valg", -1, 10, 10, 340, 150,0,WS_EX_TRANSPARENT + CONTROL "&Normal oppstart - last inn alle enhetsdrivere og tjenester", IDC_CBX_NORMAL_START, "Button", 0x50010009, 20, 30, 236, 10 + CONTROL "&Diagnose oppstart - last bare inn grunnleggende enheter og tjenester", IDC_CBX_DIAGNOSTIC_START, "Button", 0x50010009, 20, 45, 236, 10 CONTROL "&Selektiv oppstart", IDC_CBX_SELECTIVE_STARTUP, "Button", 0x50010009, 20, 60, 70, 10 AUTOCHECKBOX "L&ast inn SYSTEM.INI Filen", IDC_CBX_SYSTEM_INI, 30, 80, 95, 10 - AUTOCHECKBOX "&Last inn System tjenester", IDC_CBX_SYSTEM_SERVICE, 30, 95, 90, 10 - AUTOCHECKBOX "Las&t inn oppstartselementet", IDC_CBX_STARTUP_ITEM, 30, 110, 75, 10 + AUTOCHECKBOX "&Last inn Systemtjenester", IDC_CBX_SYSTEM_SERVICE, 30, 95, 105, 10 + AUTOCHECKBOX "Las&t inn oppstartselementet", IDC_CBX_STARTUP_ITEM, 30, 110, 105, 10 END IDD_FREELDR_PAGE DIALOGEX DISCARDABLE 0, 0, 362, 175 @@ -78,20 +78,20 @@ 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 "&Sjekk alle oppstartsbaner", IDC_BTN_CHECK_BOOT_PATH, 10, 65, 70, 12 + PUSHBUTTON "&Sjekk oppstartsbaner", IDC_BTN_CHECK_BOOT_PATH, 10, 65, 75, 12 PUSHBUTTON "&Sett som standard", IDC_BTN_SET_DEFAULT_BOOT, 100, 65, 70, 12 - PUSHBUTTON "Flytt &Opp", IDC_BTN_MOVE_UP_BOOT_OPTION, 190, 65, 70, 12 - PUSHBUTTON "Flytt &Ned", IDC_BTN_MOVE_DOWN_BOOT_OPTION, 280, 65, 70, 12 - GROUPBOX "Oppstarts alternativer", -1, 10, 80, 250, 90,0,WS_EX_TRANSPARENT - CHECKBOX "/Sik&ker oppstart", IDC_CBX_SAFE_BOOT, 15, 90, 50, 10 - CHECKBOX "/&Ingen grafisk oppstart", IDC_CBX_NO_GUI_BOOT, 15, 105, 55, 10 - CHECKBOX "/&Oppstart logg", IDC_CBX_BOOT_LOG, 15, 120, 50, 10 - CHECKBOX "/Enkel& grafikk", IDC_CBX_BASE_VIDEO, 15, 135, 55, 10 + PUSHBUTTON "Flytt &opp", IDC_BTN_MOVE_UP_BOOT_OPTION, 190, 65, 70, 12 + PUSHBUTTON "Flytt &ned", IDC_BTN_MOVE_DOWN_BOOT_OPTION, 280, 65, 70, 12 + GROUPBOX "Oppstarts alternativer", -1, 10, 80, 250, 95,0,WS_EX_TRANSPARENT + CHECKBOX "/Sik&ker oppstart", IDC_CBX_SAFE_BOOT, 15, 90, 95, 10 + CHECKBOX "/&Ingen grafisk oppstart", IDC_CBX_NO_GUI_BOOT, 15, 105, 95, 10 + CHECKBOX "/&Oppstart logg", IDC_CBX_BOOT_LOG, 15, 120, 80, 10 + CHECKBOX "/Enkel &grafikk", IDC_CBX_BASE_VIDEO, 15, 135, 95, 10 CHECKBOX "/H&jelp", IDC_CBX_SOS, 15, 150, 50, 10 - PUSHBUTTON "Av&anserte alternativer...", IDC_BTN_ADVANCED_OPTIONS, 100, 150, 70, 12 - LTEXT "&Tidsavbrudd:", -1, 280, 91, 30, 10 - EDITTEXT IDC_TXT_BOOT_TIMEOUT, 310, 90, 25, 12, ES_LEFT - LTEXT "sek.", -1, 340, 91, 15, 10 + PUSHBUTTON "Av&anserte alternativer...", IDC_BTN_ADVANCED_OPTIONS, 100, 150, 93, 12 + LTEXT "&Tidsavbrudd:", -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 diff --git a/reactos/base/applications/mscutils/devmgmt/lang/fr-FR.rc b/reactos/base/applications/mscutils/devmgmt/lang/fr-FR.rc index 0eb862fa705..927cf7465ab 100644 --- a/reactos/base/applications/mscutils/devmgmt/lang/fr-FR.rc +++ b/reactos/base/applications/mscutils/devmgmt/lang/fr-FR.rc @@ -68,7 +68,7 @@ BEGIN IDS_APPNAME "Gestionnaire de pйriphйriques ReactOS" IDS_HINT_BLANK " " IDS_HINT_EXIT " Quitte le programme." - IDS_HINT_REFRESH " Actualise la liste des services." + IDS_HINT_REFRESH " Actualise la liste des pйriphйriques." IDS_HINT_PROP " Ouvre la feuille de propriйtйs pour la sйlection actuelle." IDS_HINT_HELP " Affiche la fenкtre d'aide." IDS_HINT_ABOUT " А propos du Gestionnaire de Pйriphйriques de ReactOS." diff --git a/reactos/base/applications/mscutils/eventvwr/lang/fr-FR.rc b/reactos/base/applications/mscutils/eventvwr/lang/fr-FR.rc index f4a38fddd61..ded893d5a6b 100644 --- a/reactos/base/applications/mscutils/eventvwr/lang/fr-FR.rc +++ b/reactos/base/applications/mscutils/eventvwr/lang/fr-FR.rc @@ -13,7 +13,7 @@ BEGIN POPUP "Journa&l" BEGIN MENUITEM "&Application", ID_LOG_APPLICATION, CHECKED - MENUITEM "&Securitй", ID_LOG_SECURITY + MENUITEM "&Sйcuritй", ID_LOG_SECURITY MENUITEM "&Systиme", ID_LOG_SYSTEM MENUITEM SEPARATOR MENUITEM "Quitter", IDM_EXIT @@ -76,7 +76,7 @@ BEGIN LTEXT "Static",IDC_EVENTUSERSTATIC,56,41,72,8 LTEXT "Ordinateur :",IDC_STATIC,14,54,36,8 LTEXT "Static",IDC_EVENTCOMPUTERSTATIC,56,54,72,8 - LTEXT "EventID :",IDC_STATIC,133,15,36,8 + LTEXT "Йvйnement :",IDC_STATIC,133,15,36,8 LTEXT "Static",IDC_EVENTIDSTATIC,175,15,87,8 LTEXT "Source :",IDC_STATIC,133,28,36,8 LTEXT "Static",IDC_EVENTSOURCESTATIC,175,28,87,8 @@ -86,19 +86,19 @@ BEGIN LTEXT "Static",IDC_EVENTCATEGORYSTATIC,175,55,87,8 EDITTEXT IDC_EVENTDATAEDIT,14,204,247,44,ES_MULTILINE | ES_READONLY LTEXT "Donnйes",IDC_STATIC,14,194,20,8 - CONTROL "&Bytes",IDC_BYTESRADIO,"Button",BS_AUTORADIOBUTTON,39,194,34,10 - CONTROL "&Word",IDC_WORDRADIO,"Button",BS_AUTORADIOBUTTON,77,194,33,10 + CONTROL "&Octets",IDC_BYTESRADIO,"Button",BS_AUTORADIOBUTTON,39,194,34,10 + CONTROL "&Mots",IDC_WORDRADIO,"Button",BS_AUTORADIOBUTTON,77,194,33,10 END STRINGTABLE BEGIN IDS_APP_TITLE "Visionneuse d'йvйnements" IDC_EVENTSTRINGIDNOTFOUND "La description pour l'йvйnement d'ID ( %lu ) dans la source ( %s ) ne peut кtre trouvйe. L'ordinateur local pourrait ne pas avoir les informations registres nйcйssaires ou les fichiers DLL de message pour afficher les messages depuis un ordinateur distant." - IDC_EVENTLOG_ERROR_TYPE "Error" - IDC_EVENTLOG_WARNING_TYPE "Warning" - IDC_EVENTLOG_INFORMATION_TYPE "Information" + IDC_EVENTLOG_ERROR_TYPE "Erreur" + IDC_EVENTLOG_WARNING_TYPE "Avertissement" + IDC_EVENTLOG_INFORMATION_TYPE "Informations" IDC_EVENTLOG_AUDIT_SUCCESS "Audit Success" IDC_EVENTLOG_AUDIT_FAILURE "Audit Failure" - IDC_EVENTLOG_SUCCESS "Success" - IDC_EVENTLOG_UNKNOWN_TYPE "Unknown Event" + IDC_EVENTLOG_SUCCESS "Succиs" + IDC_EVENTLOG_UNKNOWN_TYPE "Йvйnement Inconnu" END diff --git a/reactos/base/applications/mscutils/servman/lang/bg-BG.rc b/reactos/base/applications/mscutils/servman/lang/bg-BG.rc index 37fabc70cbb..72bb184af6b 100644 --- a/reactos/base/applications/mscutils/servman/lang/bg-BG.rc +++ b/reactos/base/applications/mscutils/servman/lang/bg-BG.rc @@ -131,7 +131,7 @@ BEGIN LTEXT "Описание :", IDC_STATIC, 12, 86, 44, 9 PUSHBUTTON "Добре", IDOK, 126, 192, 44, 13 PUSHBUTTON "Отказ", IDCANCEL, 176, 192, 46, 13 - LTEXT "Допълнителни настройки (натиснете 'Помощ' за подробности)", IDC_STATIC, 10, 151, 134, 9 + LTEXT "Допълнителни настройки (натиснете „Помощ“ за подробности)", IDC_STATIC, 10, 151, 134, 9 PUSHBUTTON "Помощ", ID_CREATE_HELP, 10, 192, 44, 13 END diff --git a/reactos/base/applications/mscutils/servman/lang/fr-FR.rc b/reactos/base/applications/mscutils/servman/lang/fr-FR.rc index 35e3894eaa2..7a204f3276c 100644 --- a/reactos/base/applications/mscutils/servman/lang/fr-FR.rc +++ b/reactos/base/applications/mscutils/servman/lang/fr-FR.rc @@ -15,8 +15,8 @@ BEGIN MENUITEM SEPARATOR MENUITEM "Dйmarrer", ID_START, GRAYED MENUITEM "Arrкter", ID_STOP, GRAYED - MENUITEM "Pause", ID_PAUSE, GRAYED - MENUITEM "Relancer", ID_RESUME, GRAYED + MENUITEM "Suspendre", ID_PAUSE, GRAYED + MENUITEM "Reprendre", ID_RESUME, GRAYED MENUITEM "Redйmarrer", ID_RESTART, GRAYED MENUITEM SEPARATOR MENUITEM "Rafraоchir", ID_REFRESH @@ -27,7 +27,7 @@ BEGIN MENUITEM SEPARATOR MENUITEM "Propriйtйs...", ID_PROP, GRAYED END - POPUP "Vue" + POPUP "Affichage" BEGIN MENUITEM "Grandes Icфnes", ID_VIEW_LARGE MENUITEM "Petites Icфnes", ID_VIEW_SMALL @@ -49,8 +49,8 @@ BEGIN BEGIN MENUITEM "Dйmarrer", ID_START, GRAYED MENUITEM "Arrкter", ID_STOP, GRAYED - MENUITEM "Pause", ID_PAUSE, GRAYED - MENUITEM "Relancer", ID_RESUME, GRAYED + MENUITEM "Suspendre", ID_PAUSE, GRAYED + MENUITEM "Reprendre", ID_RESUME, GRAYED MENUITEM "Redйmarrer", ID_RESTART, GRAYED MENUITEM SEPARATOR MENUITEM "Rafraоchir", ID_REFRESH @@ -87,17 +87,17 @@ BEGIN COMBOBOX IDC_START_TYPE, 70, 107, 176, 40, WS_CHILD | WS_VISIBLE | WS_TABSTOP | CBS_DROPDOWNLIST PUSHBUTTON "Dйmarrer", IDC_START, 6, 155, 54, 15, WS_DISABLED PUSHBUTTON "Arrкter", IDC_STOP, 68, 155, 54, 15, WS_DISABLED - PUSHBUTTON "Pause", IDC_PAUSE , 130, 155, 54, 15, WS_DISABLED - PUSHBUTTON "Relancer", IDC_RESUME, 192, 155, 54, 15, WS_DISABLED + PUSHBUTTON "Suspendre", IDC_PAUSE , 130, 155, 54, 15, WS_DISABLED + PUSHBUTTON "Reprendre", IDC_RESUME, 192, 155, 54, 15, WS_DISABLED LTEXT "Nom du service :", IDC_STATIC, 4, 11, 53, 11 - LTEXT "Nom long :", IDC_STATIC, 4, 29, 53, 11 + LTEXT "Nom complet :", IDC_STATIC, 4, 29, 53, 11 LTEXT "Description :", IDC_STATIC, 4, 51, 53, 11 LTEXT "Rйpertoire de l'exйcutable :", IDC_STATIC, 6, 73, 82, 9 - LTEXT "Dйmarrage :", IDC_STATIC, 6, 108, 53, 11 - LTEXT "Йtat du service :", IDC_STATIC, 4, 138, 53, 11 + LTEXT "Type de dйmarrage :", IDC_STATIC, 6, 108, 53, 11 + LTEXT "Statut du service :", IDC_STATIC, 4, 138, 53, 11 LTEXT "", IDC_SERV_STATUS, 70, 138, 176, 11, WS_CHILD | WS_VISIBLE LTEXT "Vous pouvez dйfinir les paramиtres passйs au service lorsque vous le dйmarrez.",IDC_STATIC, 6,177,240,15 - LTEXT "Paramиtres :", IDC_STATIC, 6, 200, 58, 11 + LTEXT "Paramиtres de dйmarrage :", IDC_STATIC, 6, 200, 58, 11 EDITTEXT IDC_START_PARAM, 68, 199, 178, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP PUSHBUTTON "Йditer", IDC_EDIT, 192, 215, 54, 15, WS_DISABLED END @@ -109,8 +109,8 @@ STYLE DS_SHELLFONT | WS_BORDER | WS_VISIBLE | WS_DLGFRAME | WS_SYSMENU | WS_THIC BEGIN CONTROL "", IDC_DEPEND_TREE1, "SysTreeView32" ,0x50010007, 8, 70, 236, 68, 0x00000200 CONTROL "", IDC_DEPEND_TREE2, "SysTreeView32", 0x50010007, 8, 151, 234, 67, 0x00000200 - LTEXT "Certains services dйpendent d'autres services, de pilotes systиme ou de leur groupe de dйmarrage. Si un composant systиme est arrкtй ou ne fonctionne pas correctement, les services qui en dйpendent peuvent кtre affectйs.", IDC_STATIC,8, 7, 238, 36 - LTEXT "Ce service dйpend des composants suivants", IDC_STATIC, 8, 57, 236, 9 + LTEXT "Certains services dйpendent d'autres services, pilotes systиme et groupes d'ordre de chargement. Si un composant systиme est arrкtй ou ne fonctionne pas correctement, les services dйpendants peuvent кtre affectйs.", IDC_STATIC,8, 7, 238, 36 + LTEXT "Ce service dйpend des composants systиme suivants", IDC_STATIC, 8, 57, 236, 9 LTEXT "", IDC_DEPEND_SERVICE, 8, 38, 236, 13 END @@ -125,12 +125,12 @@ BEGIN 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 "*Nom du service :", IDC_STATIC, 12, 12, 54, 9 - LTEXT "*Nom long :", IDC_STATIC, 12, 33, 54, 9 + LTEXT "*Nom complet :", IDC_STATIC, 12, 33, 54, 9 LTEXT "*Rйpertoire de l'exйcutable :", IDC_STATIC, 10, 51, 68, 9 LTEXT "Description :", IDC_STATIC, 12, 86, 44, 9 PUSHBUTTON "OK", IDOK, 126, 192, 44, 13 PUSHBUTTON "Annuler", IDCANCEL, 176, 192, 46, 13 - LTEXT "Options supplйmentaires (clicker sur aide pour plus de dйtails)", IDC_STATIC, 10, 151, 134, 9 + LTEXT "Options supplйmentaires (cliquer sur aide pour plus de dйtails)", IDC_STATIC, 10, 151, 134, 9 PUSHBUTTON "Aide", ID_CREATE_HELP, 10, 192, 44, 13 END @@ -171,7 +171,7 @@ END STRINGTABLE DISCARDABLE BEGIN - IDS_APPNAME "Gestionnaire de Service ReactOS" + IDS_APPNAME "Gestionnaire de Services ReactOS" END STRINGTABLE DISCARDABLE @@ -195,7 +195,7 @@ END STRINGTABLE DISCARDABLE BEGIN IDS_NUM_SERVICES "Services: %d" - 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 COMMERCIABILITE ou DE CONFORMITE A UNE UTILISATION PARTICULIERE. \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_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Й A 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." END STRINGTABLE DISCARDABLE diff --git a/reactos/base/applications/mstsc/lang/no-NO.rc b/reactos/base/applications/mstsc/lang/no-NO.rc index 21f0caf4a37..70585e74f8d 100644 --- a/reactos/base/applications/mstsc/lang/no-NO.rc +++ b/reactos/base/applications/mstsc/lang/no-NO.rc @@ -31,8 +31,8 @@ BEGIN 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: Innstillingen pе den eksterne datamaskinen kan overstyre denne innstillingen.",IDC_STATIC,56,143,165,18 - LTEXT "Mindre",IDC_STATIC,35,42,15,8 - LTEXT "Stшrre",IDC_STATIC,189,42,17,8 + 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 diff --git a/reactos/base/applications/network/ipconfig/lang/no-NO.rc b/reactos/base/applications/network/ipconfig/lang/no-NO.rc index df361e608b9..156878a0554 100644 --- a/reactos/base/applications/network/ipconfig/lang/no-NO.rc +++ b/reactos/base/applications/network/ipconfig/lang/no-NO.rc @@ -53,7 +53,7 @@ BEGIN \n \ For Setclassid, fjernes ClassId hvis det ikke angis en ClassId.\n \ \n \ - Examples:\n \ + Eksempler:\n \ > ipconfig ... Vis informasjon.\n \ > ipconfig /all ... Vis detaljert informasjon\n \ > ipconfig /renew ... Forny alle kort\n \ diff --git a/reactos/base/applications/network/ping/ping.c b/reactos/base/applications/network/ping/ping.c index da98c5cbaba..69fb94277f2 100644 --- a/reactos/base/applications/network/ping/ping.c +++ b/reactos/base/applications/network/ping/ping.c @@ -541,6 +541,7 @@ static BOOL Ping(VOID) } if (Status == SOCKET_ERROR) { + LostCount++; if (WSAGetLastError() == WSAEHOSTUNREACH) printf("Destination host unreachable.\n"); else @@ -567,6 +568,8 @@ static BOOL Ping(VOID) printf("\n"); #endif /* !NDEBUG */ } + else + LostCount++; if (Status == SOCKET_ERROR) { if (WSAGetLastError() != WSAETIMEDOUT) @@ -581,7 +584,6 @@ static BOOL Ping(VOID) if (Status == 0) { printf("Request timed out.\n"); - LostCount++; GlobalFree(Buffer); return TRUE; } @@ -644,9 +646,13 @@ int main(int argc, char* argv[]) printf("\nPing statistics for %s:\n", TargetIP); printf(" Packets: Sent = %d, Received = %d, Lost = %d (%d%% loss),\n", SentCount, SentCount - LostCount, LostCount, Count); - printf("Approximate round trip times in milli-seconds:\n"); - printf(" Minimum = %s, Maximum = %s, Average = %s\n", - MinTime, MaxTime, AvgTime); + /* Print approximate times or NO approximate times if 100% loss */ + if ((SentCount - LostCount) > 0) + { + printf("Approximate round trip times in milli-seconds:\n"); + printf(" Minimum = %s, Maximum = %s, Average = %s\n", + MinTime, MaxTime, AvgTime); + } } return 0; } diff --git a/reactos/base/applications/network/tracert/tracert.c b/reactos/base/applications/network/tracert/tracert.c index 0377d80b17d..f852bfd1fef 100644 --- a/reactos/base/applications/network/tracert/tracert.c +++ b/reactos/base/applications/network/tracert/tracert.c @@ -396,11 +396,7 @@ DecodeResponse(PAPPINFO pInfo) DebugPrint(_T("Rouge packet: header id, process id %d"), TTLExceedHdr->OrigIcmpHeader.id, GetCurrentProcessId()); return -1; } -#ifndef _WIN64 _tprintf(_T("%3lld ms"), (pInfo->lTimeEnd - pInfo->lTimeStart) / pInfo->TicksPerMs.QuadPart); -#else - _tprintf(_T("%3I64d ms"), (pInfo->lTimeEnd - pInfo->lTimeStart) / pInfo->TicksPerMs.QuadPart); -#endif return 0; case ECHO_REPLY : @@ -411,11 +407,7 @@ DecodeResponse(PAPPINFO pInfo) DebugPrint(_T("Rouge packet: header id %d, process id %d"), IcmpHdr->icmpheader.id, GetCurrentProcessId()); return -1; } -#ifndef _WIN64 _tprintf(_T("%3lld ms"), (pInfo->lTimeEnd - pInfo->lTimeStart) / pInfo->TicksPerMs.QuadPart); -#else - _tprintf(_T("%3I64d ms"), (pInfo->lTimeEnd - pInfo->lTimeStart) / pInfo->TicksPerMs.QuadPart); -#endif return 1; case DEST_UNREACHABLE : diff --git a/reactos/base/applications/regedit/regedit.rbuild b/reactos/base/applications/regedit/regedit.rbuild index 43dbf2fc8ee..fdd1bd78caa 100644 --- a/reactos/base/applications/regedit/regedit.rbuild +++ b/reactos/base/applications/regedit/regedit.rbuild @@ -1,7 +1,7 @@ - + . @@ -12,6 +12,7 @@ user32 gdi32 advapi32 + comdlg32 ole32 shell32 comctl32 diff --git a/reactos/base/applications/sc/query.c b/reactos/base/applications/sc/query.c index 128c587b3af..e15573b92f9 100644 --- a/reactos/base/applications/sc/query.c +++ b/reactos/base/applications/sc/query.c @@ -227,17 +227,11 @@ Query(LPCTSTR *ServiceArgs, LPCTSTR ServiceName = *ServiceArgs; pStatus = QueryService(ServiceName); - if (bExtended) + if (pStatus) { PrintService(ServiceName, pStatus, - TRUE); - } - else - { - PrintService(ServiceName, - pStatus, - FALSE); + bExtended); } } diff --git a/reactos/base/applications/screensavers/3dtext/lang/ko-KR.rc b/reactos/base/applications/screensavers/3dtext/lang/ko-KR.rc new file mode 100644 index 00000000000..3a6d609b8ce --- /dev/null +++ b/reactos/base/applications/screensavers/3dtext/lang/ko-KR.rc @@ -0,0 +1,21 @@ +/* + *Korean Translation by Seungju Kim(www.manatails007.org) manatails007* + */ + +LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT + +DLG_SCRNSAVECONFIGURE DIALOGEX 0, 0, 273, 178 +STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "3D ЕШЅєЖ® И­ёй єёИЈ±в јіБ¤" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + DEFPUSHBUTTON "И®АО",IDOK,216,7,50,14 + PUSHBUTTON "ГлјТ",IDCANCEL,216,24,50,14 + EDITTEXT IDC_MESSAGE_TEXT,18,28,122,14,ES_AUTOHSCROLL + LTEXT "ДїЅєЕТ ЕШЅєЖ®",IDC_STATIC,18,17,65,8 +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_DESCRIPTION "3D ЕШЅєЖ® И­ёй єёИЈ±в" +END diff --git a/reactos/base/applications/screensavers/3dtext/rsrc.rc b/reactos/base/applications/screensavers/3dtext/rsrc.rc index 6b9ded6e2f5..902f6e4479d 100644 --- a/reactos/base/applications/screensavers/3dtext/rsrc.rc +++ b/reactos/base/applications/screensavers/3dtext/rsrc.rc @@ -18,6 +18,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL #include "lang/eu-ES.rc" #include "lang/fr-FR.rc" #include "lang/it-IT.rc" +#include "lang/ko-KR.rc" #include "lang/lt-LT.rc" #include "lang/no-NO.rc" #include "lang/pl-PL.rc" diff --git a/reactos/base/applications/screensavers/logon/lang/ko-KR.rc b/reactos/base/applications/screensavers/logon/lang/ko-KR.rc new file mode 100644 index 00000000000..a5e8afe6f7f --- /dev/null +++ b/reactos/base/applications/screensavers/logon/lang/ko-KR.rc @@ -0,0 +1,11 @@ +/* + *Korean Translation by Seungju Kim(www.manatails007.org) manatails007* + */ + +LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT + +STRINGTABLE DISCARDABLE +BEGIN + IDS_DESCRIPTION "·О±ЧїВ И­ёй єёИЈ±в" + IDS_TEXT "јіБ¤ЗТ °НАМ ѕшЅАґПґЩ." +END diff --git a/reactos/base/applications/screensavers/logon/logon.rc b/reactos/base/applications/screensavers/logon/logon.rc index 5ab8c22d1b0..d954e935291 100644 --- a/reactos/base/applications/screensavers/logon/logon.rc +++ b/reactos/base/applications/screensavers/logon/logon.rc @@ -20,6 +20,7 @@ IDB_SERVER BITMAP DISCARDABLE "res/1.bmp" #include "lang/es-ES.rc" #include "lang/eu-ES.rc" #include "lang/fr-FR.rc" +#include "lang/ko-KR.rc" #include "lang/lt-LT.rc" #include "lang/nl-NL.rc" #include "lang/no-NO.rc" diff --git a/reactos/base/applications/shutdown/lang/it-IT.rc b/reactos/base/applications/shutdown/lang/it-IT.rc new file mode 100644 index 00000000000..b3c5c20fb6d --- /dev/null +++ b/reactos/base/applications/shutdown/lang/it-IT.rc @@ -0,0 +1,14 @@ +LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL + +STRINGTABLE DISCARDABLE +BEGIN + +IDS_USAGE, "Uso: shutdown [-?] [-l | -s | -r] [-f]\n\n\ + Senza parametri o con -?\tvisualizza questo messaggio\n\ + -l\t\t\tChiude la sessione\n\ + -s\t\t\tSpegnimento del computer\n\ + -r\t\t\tRiavvio del computer\n\ + -f\t\t\tArresta le applicazioni senza nessun avviso\n\ + \t\t\tSe non viene specificato nessun altro parametro verrа\n\ + \t\t\tchiusa la sessione" +END diff --git a/reactos/base/applications/shutdown/rsrc.rc b/reactos/base/applications/shutdown/rsrc.rc index 8424e473d5c..7b92abdbd7f 100644 --- a/reactos/base/applications/shutdown/rsrc.rc +++ b/reactos/base/applications/shutdown/rsrc.rc @@ -6,6 +6,7 @@ #include "lang/el-GR.rc" #include "lang/en-US.rc" #include "lang/fr-FR.rc" +#include "lang/it-IT.rc" #include "lang/ko-KR.rc" #include "lang/lt-LT.rc" #include "lang/no-NO.rc" diff --git a/reactos/base/applications/sndvol32/lang/ko-KR.rc b/reactos/base/applications/sndvol32/lang/ko-KR.rc new file mode 100644 index 00000000000..c03a63b592b --- /dev/null +++ b/reactos/base/applications/sndvol32/lang/ko-KR.rc @@ -0,0 +1,46 @@ +/* + *Korean Translation by Seungju Kim(www.manatails007.org) manatails007* + */ +LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT + +IDM_MAINMENU MENU DISCARDABLE +BEGIN + POPUP "їЙјЗ(&P)" + BEGIN + MENUITEM "јУјє(&R)", IDC_PROPERTIES + MENUITEM "°н±Ю ДБЖ®·С(&A)", IDC_ADVANCED_CONTROLS + MENUITEM SEPARATOR + MENUITEM "Бѕ·б(&X)", IDC_EXIT + END + POPUP "µµїтё»(&H)" + BEGIN + MENUITEM "µµїтё» ЗЧёс(&H)", IDC_HELP_TOPICS + MENUITEM SEPARATOR + MENUITEM "єј·э ДБЖ®·С Б¤єё(&A)", IDC_ABOUT + END +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SNDVOL32 "єј·э ДБЖ®·С" + IDS_NOMIXERDEVICES "»зїл °ЎґЙЗС №Нј­ АеДЎ°Ў ѕшЅАґПґЩ! АМ ЗБ·О±Ч·ҐАє Бѕ·бµЛґПґЩ." +END + +IDD_PREFERENCES DIALOGEX 0, 0, 224, 250 +STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "јУјє" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + LTEXT "№Нј­ АеДЎ(&M):", -1, 7,8,48,9 + COMBOBOX IDC_MIXERDEVICE, 55,8,162,80, CBS_DROPDOWNLIST | WS_TABSTOP + GROUPBOX "єј·э Б¶Аэ:", -1, 7,25,211,77 + PUSHBUTTON "Аз»э(&P)", IDC_PLAYBACK, 13,43,47,8, BS_AUTORADIOBUTTON + PUSHBUTTON "імАЅ(&R)", IDC_RECORDING, 13,61,47,8, BS_AUTORADIOBUTTON + PUSHBUTTON "±вЕё(&O):", IDC_OTHER, 13,80,42,8, BS_AUTORADIOBUTTON | WS_DISABLED + COMBOBOX IDC_LINE, 55,80,155,50, CBS_DROPDOWNLIST | WS_TABSTOP | WS_DISABLED + LTEXT "ґЩАЅ єј·э ДБЖ®·С ЗҐЅГ:", IDC_LABELCONTROLS, 7, 109, 162, 8 + CONTROL "", IDC_CONTROLS, "SysListView32", LVS_REPORT | LVS_NOCOLUMNHEADER | WS_TABSTOP | WS_BORDER, 7, 122, 211, 96 + + PUSHBUTTON "И®АО", IDOK, 114,226,50,14 + PUSHBUTTON "ГлјТ", IDCANCEL, 168,226,50,14 +END diff --git a/reactos/base/applications/sndvol32/rsrc.rc b/reactos/base/applications/sndvol32/rsrc.rc index a58d947ba2d..875fc670bd3 100644 --- a/reactos/base/applications/sndvol32/rsrc.rc +++ b/reactos/base/applications/sndvol32/rsrc.rc @@ -17,6 +17,7 @@ IDI_MAINAPP ICON DISCARDABLE resources/sndvol32.ico #include "lang/it-IT.rc" #include "lang/ja-JP.rc" #include "lang/lt-LT.rc" +#include "lang/ko-KR.rc" #include "lang/nl-NL.rc" #include "lang/no-NO.rc" #include "lang/pl-PL.rc" diff --git a/reactos/base/applications/taskmgr/lang/no-NO.rc b/reactos/base/applications/taskmgr/lang/no-NO.rc index f55298790fe..8afc8d6d63f 100644 --- a/reactos/base/applications/taskmgr/lang/no-NO.rc +++ b/reactos/base/applications/taskmgr/lang/no-NO.rc @@ -80,7 +80,7 @@ BEGIN MENUITEM "Sorter &vertikalt", ID_WINDOWS_TILEVERTICALLY MENUITEM "&Minimer", ID_WINDOWS_MINIMIZE MENUITEM "Ma&ksimer", ID_WINDOWS_MAXIMIZE - MENUITEM "&Cascade", ID_WINDOWS_CASCADE + MENUITEM "&Overlappet", ID_WINDOWS_CASCADE MENUITEM "&Plasser lengst frem", ID_WINDOWS_BRINGTOFRONT END @@ -193,8 +193,8 @@ BEGIN CONTROL "Liste2",IDC_APPLIST,"SysListView32",LVS_REPORT | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,7,7,233,177 PUSHBUTTON "&Ny oppgave...",IDC_NEWTASK,187,189,53,14 - PUSHBUTTON "&Bytt til",IDC_SWITCHTO,131,189,53,14,WS_DISABLED - PUSHBUTTON "&Avslutt oppgave",IDC_ENDTASK,75,189,53,14,WS_DISABLED + PUSHBUTTON "&Bytt til",IDC_SWITCHTO,129,189,53,14,WS_DISABLED + PUSHBUTTON "&Avslutt oppgave",IDC_ENDTASK,60,189,65,14,WS_DISABLED END IDD_PROCESS_PAGE DIALOGEX DISCARDABLE 0, 0, 247, 210 @@ -214,8 +214,8 @@ IDD_PERFORMANCE_PAGE DIALOGEX DISCARDABLE 0, 0, 247, 210 STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "MS Shell Dlg" BEGIN - GROUPBOX "Bruk av CPU",IDC_CPU_USAGE_FRAME,5,5,60,54,WS_TABSTOP, WS_EX_TRANSPARENT - GROUPBOX "Bruk av vekslefil",IDC_MEM_USAGE_FRAME,5,63,60,54,BS_LEFTTEXT, WS_EX_TRANSPARENT + GROUPBOX "Prosessorbruk",IDC_CPU_USAGE_FRAME,5,5,70,54,WS_TABSTOP, WS_EX_TRANSPARENT + GROUPBOX "Minnebruk",IDC_MEM_USAGE_FRAME,5,63,60,54,BS_LEFTTEXT, WS_EX_TRANSPARENT GROUPBOX "Totalt",IDC_TOTALS_FRAME,5,122,111,39,0,WS_EX_TRANSPARENT GROUPBOX "Tildelt minne (kb)",IDC_COMMIT_CHARGE_FRAME,5,166,111,39,0,WS_EX_TRANSPARENT GROUPBOX "Fysisk minne (kb)",IDC_PHYSICAL_MEMORY_FRAME,131,122,111,39,0,WS_EX_TRANSPARENT @@ -241,30 +241,30 @@ BEGIN LTEXT "Totalt",IDS_PHYSICAL_MEMORY_TOTAL,137,131,27,8 LTEXT "Tilgjengelig",IDS_PHYSICAL_MEMORY_AVAILABLE,137,140,40,8 LTEXT "Systembuffer",IDS_PHYSICAL_MEMORY_SYSTEM_CACHE,137,149,46,8 - EDITTEXT IDC_PHYSICAL_MEMORY_TOTAL,185,131,48,8,ES_RIGHT | + EDITTEXT IDC_PHYSICAL_MEMORY_TOTAL,187,131,48,8,ES_RIGHT | ES_READONLY | ES_NUMBER | NOT WS_BORDER - EDITTEXT IDC_PHYSICAL_MEMORY_AVAILABLE,185,140,48,8,ES_RIGHT | + EDITTEXT IDC_PHYSICAL_MEMORY_AVAILABLE,187,140,48,8,ES_RIGHT | ES_READONLY | ES_NUMBER | NOT WS_BORDER - EDITTEXT IDC_PHYSICAL_MEMORY_SYSTEM_CACHE,185,149,48,8,ES_RIGHT | + EDITTEXT IDC_PHYSICAL_MEMORY_SYSTEM_CACHE,187,149,48,8,ES_RIGHT | ES_READONLY | ES_NUMBER | NOT WS_BORDER LTEXT "Totalt",IDS_KERNEL_MEMORY_TOTAL,137,174,27,8 - LTEXT "Sidevekslet",IDS_KERNEL_MEMORY_PAGED,137,184,50,8 - LTEXT "Ikke sidevekslet",IDS_KERNEL_MEMORY_NONPAGED,137,193,75,8 - EDITTEXT IDC_KERNEL_MEMORY_TOTAL,185,174,48,8,ES_RIGHT | + LTEXT "Sidevekslet",IDS_KERNEL_MEMORY_PAGED,137,184,54,8 + LTEXT "Ikke sidevekslet",IDS_KERNEL_MEMORY_NONPAGED,137,193,85,8 + EDITTEXT IDC_KERNEL_MEMORY_TOTAL,187,174,48,8,ES_RIGHT | ES_READONLY | ES_NUMBER | NOT WS_BORDER - EDITTEXT IDC_KERNEL_MEMORY_PAGED,185,184,48,8,ES_RIGHT | + EDITTEXT IDC_KERNEL_MEMORY_PAGED,187,184,48,8,ES_RIGHT | ES_READONLY | ES_NUMBER | NOT WS_BORDER - EDITTEXT IDC_KERNEL_MEMORY_NONPAGED,185,193,48,8,ES_RIGHT | + EDITTEXT IDC_KERNEL_MEMORY_NONPAGED,187,193,48,8,ES_RIGHT | ES_READONLY | ES_NUMBER | NOT WS_BORDER - GROUPBOX "Bruk av CPU",IDC_CPU_USAGE_HISTORY_FRAME,74,5,168,54,0,WS_EX_TRANSPARENT - GROUPBOX "Logg for bruk av sidevekslingsfil",IDC_MEMORY_USAGE_HISTORY_FRAME,74,63,168,54,0,WS_EX_TRANSPARENT - PUSHBUTTON "Vis bruk av CPU",IDC_CPU_USAGE_GRAPH,12,17,47,37,0, + GROUPBOX "Logg for bruk av prosessor",IDC_CPU_USAGE_HISTORY_FRAME,74,5,168,54,0,WS_EX_TRANSPARENT + GROUPBOX "Logg for bruk av fysisk minne",IDC_MEMORY_USAGE_HISTORY_FRAME,74,63,168,54,0,WS_EX_TRANSPARENT + PUSHBUTTON "Vis prosessorbruk",IDC_CPU_USAGE_GRAPH,12,17,47,37,0, WS_EX_CLIENTEDGE - PUSHBUTTON "Vis bruk av MEM",IDC_MEM_USAGE_GRAPH,12,75,47,37,0, + PUSHBUTTON "Vis minnebruk",IDC_MEM_USAGE_GRAPH,12,75,47,37,0, WS_EX_CLIENTEDGE - PUSHBUTTON "Logg for bruk av CPU",IDC_CPU_USAGE_HISTORY_GRAPH,81,17, + PUSHBUTTON "Logg for prosessorbruk",IDC_CPU_USAGE_HISTORY_GRAPH,81,17, 153,37,0,WS_EX_CLIENTEDGE - PUSHBUTTON "MEM bruk historie",IDC_MEM_USAGE_HISTORY_GRAPH,81,75, + PUSHBUTTON "Minne bruk historie",IDC_MEM_USAGE_HISTORY_GRAPH,81,75, 153,37,0,WS_EX_CLIENTEDGE END @@ -356,21 +356,21 @@ END IDD_COLUMNS_DIALOG DIALOGEX DISCARDABLE 0, 0, 195, 199 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Velg spaltevis" +CAPTION "Velg kolonnene" FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "OK",IDOK,84,178,50,14 PUSHBUTTON "Avbryt",IDCANCEL,138,178,50,14 - LTEXT "Velg spaltevis det vil oppstе pе Prosess side av oppgavebehandler.", + LTEXT "Velg kolonnene som skal vises pе prosesssiden i Oppgavebehandling.", IDC_STATIC,7,7,181,17 - CONTROL "&Bilde navn",IDC_IMAGENAME,"Button",BS_AUTOCHECKBOX | + CONTROL "&Bildenavn",IDC_IMAGENAME,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,7,28,56,10 - CONTROL "&PID (Prosess identifikator)",IDC_PID,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,7,39,88,10 - CONTROL "&CPU brukt",IDC_CPUUSAGE,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,7,50,53,10 - CONTROL "CPU Ti&d",IDC_CPUTIME,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,7,61,48,10 + CONTROL "&PID (prosessidentifikator)",IDC_PID,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,39,93,10 + CONTROL "&Prosessorbruk",IDC_CPUUSAGE,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,7,50,60,10 + CONTROL "Prosessorti&d",IDC_CPUTIME,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,7,61,52,10 CONTROL "&Minne brukt",IDC_MEMORYUSAGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,72,63,10 CONTROL "Minne brukt &Delta",IDC_MEMORYUSAGEDELTA,"Button", @@ -378,40 +378,40 @@ BEGIN CONTROL "Ma&ks minne bruk",IDC_PEAKMEMORYUSAGE,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,7,94,82,10 CONTROL "Side &mangeler",IDC_PAGEFAULTS,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,7,105,53,10 + WS_TABSTOP,7,105,56,10 CONTROL "&Bruker objekt",IDC_USEROBJECTS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,116,62,10 - CONTROL "I/O Leser",IDC_IOREADS,"Button",BS_AUTOCHECKBOX | + CONTROL "I/O Lest",IDC_IOREADS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,127,49,10 - CONTROL "I/O Leser Bytes",IDC_IOREADBYTES,"Button", + CONTROL "I/O skrevet",IDC_IOREADBYTES,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,7,138,65,10 - CONTROL "&Sesjon ID",IDC_SESSIONID,"Button",BS_AUTOCHECKBOX | + CONTROL "&Шkt ID",IDC_SESSIONID,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,149,50,10 - CONTROL "Bruker &Navn",IDC_USERNAME,"Button",BS_AUTOCHECKBOX | + CONTROL "Bruker&navn",IDC_USERNAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,160,51,10 CONTROL "Side &mangel Delta",IDC_PAGEFAULTSDELTA,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,107,28,72,10 - CONTROL "&Virtuelt minne Stшrrelse",IDC_VIRTUALMEMORYSIZE,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,107,39,77,10 + CONTROL "&Virtuelt minne stшrrelse",IDC_VIRTUALMEMORYSIZE,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,107,39,86,10 CONTROL "Si&de innsats",IDC_PAGEDPOOL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,107,50,53,10 CONTROL "I&ngen-side innsats",IDC_NONPAGEDPOOL,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,107,61,67,10 - CONTROL "Base P&rioritet",IDC_BASEPRIORITY,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,107,61,72,10 + CONTROL "Basisp&rioritet",IDC_BASEPRIORITY,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,107,72,55,10 CONTROL "&Handle regne",IDC_HANDLECOUNT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,107,83,59,10 CONTROL "&Trеd medregne",IDC_THREADCOUNT,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,107,94,59,10 + WS_TABSTOP,107,94,65,10 CONTROL "GDI Objekt",IDC_GDIOBJECTS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,107,105,55,10 - CONTROL "I/O skriver",IDC_IOWRITES,"Button",BS_AUTOCHECKBOX | + CONTROL "I/O skrevet",IDC_IOWRITES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,107,116,49,10 - CONTROL "I/O skriver Bytes",IDC_IOWRITEBYTES,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,107,127,65,10 + CONTROL "I/O skrevne byte",IDC_IOWRITEBYTES,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,107,127,70,10 CONTROL "I/O Annet",IDC_IOOTHER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,107,138,46,10 - CONTROL "I/O Annet Byte",IDC_IOOTHERBYTES,"Button", + CONTROL "I/O Andre byte",IDC_IOOTHERBYTES,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,107,149,65,10 END @@ -544,39 +544,39 @@ END STRINGTABLE DISCARDABLE BEGIN ID_FILE_NEW "Kjшr et nytt program" - ID_OPTIONS_ALWAYSONTOP "Oppgavebehandler fortsette е vжre forran av alle andre vinduer uten minimert" + ID_OPTIONS_ALWAYSONTOP "Oppgavebehandler fortsette е vжre over alle andre vinduer med mindre de er minimert" ID_OPTIONS_MINIMIZEONUSE - "Oppgavebehandelen er minimert nеr en SwitchTo operasjon er oppfшrt" + "Oppgavebehandling er minimert nеr en 'Skift til' operasjon utfшres" ID_OPTIONS_HIDEWHENMINIMIZED "Skjule oppgavebehandelen nеr det er minimert" - ID_VIEW_REFRESH "Nшdvendighet for oppgavebehandelen е oppdateres nе, hensynslшs av oppdatering hastighet innstillingen" - ID_VIEW_LARGE "Vis oppgavene ved е bruke store ikoner" - ID_VIEW_SMALL "Vis oppgavene ved е bruke smе ikoner" - ID_VIEW_DETAILS "Vis informasjon om hver oppgave" + ID_VIEW_REFRESH "Oppdater nе, uahengig av innstillingene for oppdatering hastighet" + ID_VIEW_LARGE "Viser oppgavene ved е bruke store ikoner" + ID_VIEW_SMALL "Viser oppgavene ved е bruke smе ikoner" + ID_VIEW_DETAILS "Viser informasjon om hver oppgave" ID_VIEW_UPDATESPEED_HIGH "Oppdater skjermen to ganger per sekund" - ID_VIEW_UPDATESPEED_NORMAL "Oppdater skjermen hver to sekunds" - ID_VIEW_UPDATESPEED_LOW "Oppdater skjermen hver fire sekund" + ID_VIEW_UPDATESPEED_NORMAL "Oppdater skjermen annenhver sekund" + ID_VIEW_UPDATESPEED_LOW "Oppdater skjermen hvert fjerde sekund" END STRINGTABLE DISCARDABLE BEGIN - ID_VIEW_UPDATESPEED_PAUSED "Kan ikke automatisk oppdateres" + ID_VIEW_UPDATESPEED_PAUSED "Skjermen oppdaterer ikke automatisk" ID_WINDOWS_TILEHORIZONTALLY - "Tittel vindu horisontalt pе skrivebordet" - ID_WINDOWS_TILEVERTICALLY "Tittel vindu vertikalt pе skrivebordet" + "Viser tittel vindu horisontalt pе skrivebordet" + ID_WINDOWS_TILEVERTICALLY "Viser tittel vindu vertikalt pе skrivebordet" ID_WINDOWS_MINIMIZE "Minimalisere vinduet" ID_WINDOWS_MAXIMIZE "Maksimere vinduet" - ID_WINDOWS_CASCADE "Cascades vinduet diagonalt pе skrivebordet" - ID_WINDOWS_BRINGTOFRONT "Bringe vinduet front, men kan ikke bryter til det" - ID_HELP_TOPICS "Vis oppgavebehandler emner i hjelp" - ID_HELP_ABOUT "Vis program informasjon, versjon nummer, og enerett" - ID_FILE_EXIT "Avslutt oppgavebehandler applikasjon" + ID_WINDOWS_CASCADE "Overlapper vinduet diagonalt pе skrivebordet" + ID_WINDOWS_BRINGTOFRONT "Legger vinduet шverst, men kan ikke skifte til det" + ID_HELP_TOPICS "Viser emner i hjelp for oppgavebehandling" + ID_HELP_ABOUT "Viser program informasjon, versjon nummer, og enerett" + ID_FILE_EXIT "Avslutter oppgavebehandling" ID_OPTIONS_SHOW16BITTASKS - "Vis 16-bit oppgaver under assosiert ntvdm.exe" - ID_VIEW_SELECTCOLUMNS "Velg hva kolonner vil bli synlig pе Prosess side" - ID_VIEW_SHOWKERNELTIMES "Vis kernel tid i utfшrelse diagramer" + "Viser 16-biters oppgaver under tilknyttende ntvdm.exe" + ID_VIEW_SELECTCOLUMNS "Velg hvilken kolonner som vil bli synlig pе prosess siden" + ID_VIEW_SHOWKERNELTIMES "Viser kjerne tid i ytelses grafene" ID_VIEW_CPUHISTORY_ONEGRAPHALL - "En singel historie graf viser totalt CPU bruk" - ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU "Hver CPU har dems egene historie graf" + "En enkelt logg graf viser totalt prosessorbruk" + ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU "Hver prosessor har sin egen logg graf" ID_APPLICATION_PAGE_SWITCHTO "Skaffe en oppgave til forgrunn, endre fokus til den oppgaven" END @@ -617,10 +617,10 @@ BEGIN IDS_TAB_PID "PID" IDS_TAB_USERNAME "Brukernavn" IDS_TAB_SESSIONID "Sesjon ID" - IDS_TAB_CPU "CPU" - IDS_TAB_CPUTIME "CPU Tid" - IDS_TAB_MEMUSAGE "Bruk av vekslefil" - IDS_TAB_PEAKMEMUSAGE "Maks bruk av Mem" + IDS_TAB_CPU "Prosessor" + IDS_TAB_CPUTIME "Prosessor tid" + IDS_TAB_MEMUSAGE "Minnebruk" + IDS_TAB_PEAKMEMUSAGE "Maks minnebruk" IDS_TAB_MEMDELTA "Mem Delta" IDS_TAB_PAGEFAULT "Side mangel" IDS_TAB_PFDELTA "PF Delta" @@ -638,21 +638,21 @@ BEGIN IDS_TAB_IOREADBYTES "I/O Leser Byte" IDS_TAB_IOWRITESBYTES "I/O Skriver Byte" IDS_TAB_IOOTHERBYTES "I/O Annet Byte" - IDS_MENU_SELECTCOLUMNS "&Velg kollone..." + IDS_MENU_SELECTCOLUMNS "&Velg kolonner..." IDS_MENU_16BITTASK "&Vis 16-biter oppgave" IDS_MENU_WINDOWS "&Vinduer" - IDS_MENU_LARGEICONS "St&ore Ikoner" - IDS_MENU_SMALLICONS "S&mе Ikoner" + IDS_MENU_LARGEICONS "St&ore ikoner" + IDS_MENU_SMALLICONS "S&mе ikoner" IDS_MENU_DETAILS "&Detaljer" - IDS_MENU_ONEGRAPHALLCPUS "&En Graf, Alle CPU" - IDS_MENU_ONEGRAPHPERCPU "En Graf &Per CPU" - IDS_MENU_CPUHISTORY "&CPU Historie" - IDS_MENU_SHOWKERNELTIMES "&Vis Kernel tider" + IDS_MENU_ONEGRAPHALLCPUS "&En Graf, alle prosessorer" + IDS_MENU_ONEGRAPHPERCPU "En Graf &per prosessor" + IDS_MENU_CPUHISTORY "&Prosessor Historie" + IDS_MENU_SHOWKERNELTIMES "&Vis Kjerne tider" IDS_CREATENEWTASK "Opprett ny oppgave" - IDS_CREATENEWTASK_DESC "Skriv navnet av et program, mappe, dokument, eller Internett-ressursen, og oppgavebehandelen vil еpne det for deg." - IDS_MSG_ACCESSPROCESSAFF "Ikke i stand til tilgang eller sette Prosess slektskap" + IDS_CREATENEWTASK_DESC "Skriv navnet pе et program, mappe, dokument, eller Internett-ressursen, som oppgavebehandelen vil еpne for deg." + IDS_MSG_ACCESSPROCESSAFF "Ikke mulig е fo tilgang eller sette prosess slektskap" IDS_MSG_PROCESSONEPRO "Prosessen mе ha tiltrekning med minst en prosessor." - IDS_MSG_INVALIDOPTION "Ugyldig Operasjon" + IDS_MSG_INVALIDOPTION "Ugyldig operasjon" IDS_MSG_UNABLEDEBUGPROCESS "Ute av stand til feilsшking prosess" IDS_MSG_WARNINGDEBUG "ADVARSEL: Feilretning denne prosess kan fшlge е miste data.\nEr du sikker du vil tilknytte feilsшkingsprogramet?" IDS_MSG_TASKMGRWARNING "Oppgavebehandler advarsel" @@ -660,7 +660,7 @@ BEGIN IDS_MSG_UNABLETERMINATEPRO "Ikke i stand til е avslutte prosess" IDS_MSG_UNABLECHANGEPRIORITY "Ikke i stand til endre prioritet" IDS_MSG_WARNINGCHANGEPRIORITY "ADVARSEL: Endring av prioritet klasse av denne prosess kan\nforutsake uшnsket resultat inkluderer systemet kan bli ustabilt. Er du\nsikker pе at du vil endre prioritet klassen?" - IDS_MSG_TRAYICONCPUUSAGE "Bruk av CPU : %d%%" + IDS_MSG_TRAYICONCPUUSAGE "Bruk av CPU: %d%%" IDS_STATUS_MEMUSAGE "Tildelt minne: %dK / %dK" IDS_STATUS_CPUUSAGE "Bruk av CPU: %3d%%" IDS_STATUS_PROCESSES "Prosesser: %d" diff --git a/reactos/base/applications/taskmgr/taskmgr.rbuild b/reactos/base/applications/taskmgr/taskmgr.rbuild index 758b27d53ec..4b9022bbaa4 100644 --- a/reactos/base/applications/taskmgr/taskmgr.rbuild +++ b/reactos/base/applications/taskmgr/taskmgr.rbuild @@ -1,9 +1,10 @@ - + . 0x0501 0x0501 + msvcrt ntdll kernel32 advapi32 diff --git a/reactos/base/applications/wordpad/wordpad.rbuild b/reactos/base/applications/wordpad/wordpad.rbuild index a06949b8db8..586227095c7 100644 --- a/reactos/base/applications/wordpad/wordpad.rbuild +++ b/reactos/base/applications/wordpad/wordpad.rbuild @@ -10,6 +10,7 @@ shell32 user32 gdi32 + msvcrt advapi32 kernel32 comctl32 diff --git a/reactos/base/services/dhcp/adapter.c b/reactos/base/services/dhcp/adapter.c index f708998cd2f..a669bd25a5d 100644 --- a/reactos/base/services/dhcp/adapter.c +++ b/reactos/base/services/dhcp/adapter.c @@ -108,7 +108,7 @@ HKEY FindAdapterKey( PDHCP_ADAPTER Adapter ) { PCHAR TargetKeyName = NULL; PCHAR *EnumKeysLinkage = GetSubkeyNames( EnumKeyName, "\\Linkage" ); PCHAR *EnumKeysTop = GetSubkeyNames( EnumKeyName, "" ); - PCHAR RootDevice = NULL, DriverDesc = NULL; + PCHAR RootDevice = NULL; HKEY EnumKey, OutKey = NULL; DWORD Error = ERROR_SUCCESS; @@ -121,12 +121,9 @@ HKEY FindAdapterKey( PDHCP_ADAPTER Adapter ) { for( i = 0; EnumKeysLinkage[i]; i++ ) { RootDevice = RegReadString ( EnumKey, EnumKeysLinkage[i], "RootDevice" ); - DriverDesc = RegReadString - ( EnumKey, EnumKeysTop[i], "DriverDesc" ); - if( DriverDesc && - RootDevice && - !strcmp( DriverDesc, Adapter->DhclientInfo.name ) ) { + if( RootDevice && + !strcmp( RootDevice, Adapter->DhclientInfo.name ) ) { TargetKeyName = (CHAR*) malloc( strlen( TargetKeyNameStart ) + strlen( RootDevice ) + @@ -138,13 +135,11 @@ HKEY FindAdapterKey( PDHCP_ADAPTER Adapter ) { break; } else { free( RootDevice ); RootDevice = 0; - free( DriverDesc ); DriverDesc = 0; } } cleanup: if( RootDevice ) free( RootDevice ); - if( DriverDesc ) free( DriverDesc ); if( EnumKeysLinkage ) free( EnumKeysLinkage ); if( EnumKeysTop ) free( EnumKeysTop ); if( TargetKeyName ) free( TargetKeyName ); diff --git a/reactos/base/services/services.rbuild b/reactos/base/services/services.rbuild index e99db88c80f..190ed54801f 100644 --- a/reactos/base/services/services.rbuild +++ b/reactos/base/services/services.rbuild @@ -13,6 +13,9 @@ + + + diff --git a/reactos/base/services/spoolsv/spoolsv.c b/reactos/base/services/spoolsv/spoolsv.c new file mode 100644 index 00000000000..21640f19ec6 --- /dev/null +++ b/reactos/base/services/spoolsv/spoolsv.c @@ -0,0 +1,87 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: services/spoolsv/spoolsv.c + * PURPOSE: Printer spooler + * PROGRAMMER: Eric Kohl + */ + +/* INCLUDES *****************************************************************/ + +#define WIN32_NO_STATUS +#include + +#define NDEBUG +#include + +/* GLOBALS ******************************************************************/ + +#define SERVICE_NAME TEXT("Spooler") + +SERVICE_STATUS_HANDLE ServiceStatusHandle; + + +/* FUNCTIONS *****************************************************************/ + + +static DWORD WINAPI +ServiceControlHandler(DWORD dwControl, + DWORD dwEventType, + LPVOID lpEventData, + LPVOID lpContext) +{ + switch (dwControl) + { + case SERVICE_CONTROL_STOP: + case SERVICE_CONTROL_SHUTDOWN: + return ERROR_SUCCESS; + + default : + return ERROR_CALL_NOT_IMPLEMENTED; + } +} + + + +static VOID CALLBACK +ServiceMain(DWORD argc, LPTSTR *argv) +{ + UNREFERENCED_PARAMETER(argc); + UNREFERENCED_PARAMETER(argv); + + DPRINT("ServiceMain() called\n"); + + ServiceStatusHandle = RegisterServiceCtrlHandlerExW(SERVICE_NAME, + ServiceControlHandler, + NULL); + + + + DPRINT("ServiceMain() done\n"); +} + + +int +wmain(int argc, WCHAR *argv[]) +{ + SERVICE_TABLE_ENTRY ServiceTable[2] = + { + {SERVICE_NAME, ServiceMain}, + {NULL, NULL} + }; + + UNREFERENCED_PARAMETER(argc); + UNREFERENCED_PARAMETER(argv); + + DPRINT("Spoolsv: main() started\n"); + + StartServiceCtrlDispatcher(ServiceTable); + + DPRINT("Spoolsv: main() done\n"); + + ExitThread(0); + + return 0; +} + +/* EOF */ diff --git a/reactos/base/services/spoolsv/spoolsv.rbuild b/reactos/base/services/spoolsv/spoolsv.rbuild new file mode 100644 index 00000000000..ef53b83e372 --- /dev/null +++ b/reactos/base/services/spoolsv/spoolsv.rbuild @@ -0,0 +1,13 @@ + + + + . + 0x600 + 0x0500 + 0x0600 + ntdll + kernel32 + advapi32 + spoolsv.c + spoolsv.rc + diff --git a/reactos/base/services/spoolsv/spoolsv.rc b/reactos/base/services/spoolsv/spoolsv.rc new file mode 100644 index 00000000000..4eeb5b35cb8 --- /dev/null +++ b/reactos/base/services/spoolsv/spoolsv.rc @@ -0,0 +1,4 @@ +#define REACTOS_STR_FILE_DESCRIPTION "Spooler-Service\0" +#define REACTOS_STR_INTERNAL_NAME "Spoolsv\0" +#define REACTOS_STR_ORIGINAL_FILENAME "Spoolsv.exe\0" +#include diff --git a/reactos/base/services/svchost/svchost.c b/reactos/base/services/svchost/svchost.c index 3390aa666ec..f05955127e4 100644 --- a/reactos/base/services/svchost/svchost.c +++ b/reactos/base/services/svchost/svchost.c @@ -142,7 +142,7 @@ BOOL PrepareService(LPCTSTR ServiceName) return TRUE; } -VOID FreeServices() +VOID FreeServices(VOID) { while (FirstService) { diff --git a/reactos/base/services/tcpsvcs/chargen.c b/reactos/base/services/tcpsvcs/chargen.c index d4306f391ae..ea86f7a1aa9 100644 --- a/reactos/base/services/tcpsvcs/chargen.c +++ b/reactos/base/services/tcpsvcs/chargen.c @@ -32,16 +32,16 @@ SendLine(SOCKET sock, LPSTR lpLine) } else { - LogEvent(_T("Chargen: Not sent enough bytes"), 0, 0, LOG_FILE); + LogEvent(L"Chargen: Not sent enough bytes", 0, 0, LOG_FILE); } } else if (retVal == SOCKET_ERROR) { - LogEvent(_T("Chargen: Socket error\n"), WSAGetLastError(), 0, LOG_ERROR); + LogEvent(L"Chargen: Socket error\n", WSAGetLastError(), 0, LOG_ERROR); } else { - LogEvent(_T("Chargen: unknown error\n"), WSAGetLastError(), 0, LOG_ERROR); + LogEvent(L"Chargen: unknown error\n", WSAGetLastError(), 0, LOG_ERROR); } return bRet;; @@ -100,21 +100,21 @@ ChargenHandler(VOID* sock_) if (!GenerateChars(sock)) { - LogEvent(_T("Chargen: Char generation failed"), 0, 0, LOG_FILE); + LogEvent(L"Chargen: Char generation failed", 0, 0, LOG_FILE); retVal = 1; } - LogEvent(_T("Chargen: Shutting connection down..."), 0, 0, LOG_FILE); + LogEvent(L"Chargen: Shutting connection down...", 0, 0, LOG_FILE); if (ShutdownConnection(sock, FALSE)) { - LogEvent(_T("Chargen: Connection is down"), 0, 0, LOG_FILE); + LogEvent(L"Chargen: Connection is down", 0, 0, LOG_FILE); } else { - LogEvent(_T("Chargen: Connection shutdown failed"), 0, 0, LOG_FILE); + LogEvent(L"Chargen: Connection shutdown failed", 0, 0, LOG_FILE); retVal = 1; } - LogEvent(_T("Chargen: Terminating thread"), 0, 0, LOG_FILE); + LogEvent(L"Chargen: Terminating thread", 0, 0, LOG_FILE); ExitThread(retVal); } diff --git a/reactos/base/services/tcpsvcs/daytime.c b/reactos/base/services/tcpsvcs/daytime.c index c5e99384c77..0b4e2655a47 100644 --- a/reactos/base/services/tcpsvcs/daytime.c +++ b/reactos/base/services/tcpsvcs/daytime.c @@ -15,7 +15,7 @@ SendTime(SOCKET sock, CHAR *time) DWORD stringSize = strlen(time) + 1; if (send(sock, time, stringSize, 0) == SOCKET_ERROR) { - LogEvent(_T("DayTime: Error sending data"), WSAGetLastError(), 0, LOG_ERROR); + LogEvent(L"DayTime: Error sending data", WSAGetLastError(), 0, LOG_ERROR); return FALSE; } @@ -41,15 +41,15 @@ DaytimeHandler(VOID* Sock_) retVal = 1; } - LogEvent(_T("DayTime: Shutting connection down"), 0, 0, LOG_FILE); + LogEvent(L"DayTime: Shutting connection down", 0, 0, LOG_FILE); if (ShutdownConnection(Sock, FALSE)) - LogEvent(_T("DayTime: Connection is down"), 0, 0, LOG_FILE); + LogEvent(L"DayTime: Connection is down", 0, 0, LOG_FILE); else { - LogEvent(_T("DayTime: Connection shutdown failed"), 0, 0, LOG_FILE); + LogEvent(L"DayTime: Connection shutdown failed", 0, 0, LOG_FILE); retVal = 1; } - LogEvent(_T("DayTime: Terminating thread"), 0, 0, LOG_FILE); + LogEvent(L"DayTime: Terminating thread", 0, 0, LOG_FILE); ExitThread(retVal); } diff --git a/reactos/base/services/tcpsvcs/discard.c b/reactos/base/services/tcpsvcs/discard.c index 487059805e4..79822ea363b 100644 --- a/reactos/base/services/tcpsvcs/discard.c +++ b/reactos/base/services/tcpsvcs/discard.c @@ -14,7 +14,7 @@ static BOOL RecieveIncomingPackets(SOCKET sock) { - char readBuffer[BUFSIZE]; + CHAR readBuffer[BUFSIZE]; INT readBytes; do @@ -24,18 +24,18 @@ RecieveIncomingPackets(SOCKET sock) { TCHAR logBuf[256]; - _stprintf(logBuf, _T("Discard: Received %d bytes from client"), readBytes); + _swprintf(logBuf, L"Discard: Received %d bytes from client", readBytes); LogEvent(logBuf, 0, 0, LOG_FILE); } else if (readBytes == SOCKET_ERROR) { - LogEvent(_T("Discard: Socket Error"), WSAGetLastError(), 0, LOG_ERROR); + LogEvent(L"Discard: Socket Error", WSAGetLastError(), 0, LOG_ERROR); return FALSE; } } while ((readBytes > 0) && (!bShutdown)); if (!bShutdown) - LogEvent(_T("Discard: Connection closed by peer"), 0, 0, LOG_FILE); + LogEvent(L"Discard: Connection closed by peer", 0, 0, LOG_FILE); return TRUE; } @@ -48,21 +48,21 @@ DiscardHandler(VOID* sock_) if (!RecieveIncomingPackets(sock)) { - LogEvent(_T("Discard: RecieveIncomingPackets failed"), 0, 0, LOG_FILE); + LogEvent(L"Discard: RecieveIncomingPackets failed", 0, 0, LOG_FILE); retVal = 1; } - LogEvent(_T("Discard: Shutting connection down"), 0, 0, LOG_FILE); + LogEvent(L"Discard: Shutting connection down", 0, 0, LOG_FILE); if (ShutdownConnection(sock, TRUE)) { - LogEvent(_T("Discard: Connection is down."), 0, 0, LOG_FILE); + LogEvent(L"Discard: Connection is down.", 0, 0, LOG_FILE); } else { - LogEvent(_T("Discard: Connection shutdown failed"), 0, 0, LOG_FILE); + LogEvent(L"Discard: Connection shutdown failed", 0, 0, LOG_FILE); retVal = 1; } - LogEvent(_T("Discard: Terminating thread"), 0, 0, LOG_FILE); + LogEvent(L"Discard: Terminating thread", 0, 0, LOG_FILE); ExitThread(retVal); } diff --git a/reactos/base/services/tcpsvcs/echo.c b/reactos/base/services/tcpsvcs/echo.c index 7188286e46d..97743c074f6 100644 --- a/reactos/base/services/tcpsvcs/echo.c +++ b/reactos/base/services/tcpsvcs/echo.c @@ -15,7 +15,7 @@ static BOOL EchoIncomingPackets(SOCKET sock) { CHAR readBuffer[RECV_BUF]; - TCHAR logBuf[256]; + WCHAR logBuf[256]; INT totalSentBytes; INT readBytes; INT retVal; @@ -25,7 +25,7 @@ EchoIncomingPackets(SOCKET sock) readBytes = recv(sock, readBuffer, RECV_BUF, 0); if (readBytes > 0) { - _stprintf(logBuf, _T("Received %d bytes from client"), readBytes); + _swprintf(logBuf, L"Received %d bytes from client", readBytes); LogEvent(logBuf, 0, 0, LOG_FILE); totalSentBytes = 0; @@ -34,33 +34,33 @@ EchoIncomingPackets(SOCKET sock) retVal = send(sock, readBuffer + totalSentBytes, readBytes - totalSentBytes, 0); if (retVal > 0) { - _stprintf(logBuf, _T("Sent %d bytes back to client"), retVal); + _swprintf(logBuf, L"Sent %d bytes back to client", retVal); LogEvent(logBuf, 0, 0, LOG_FILE); totalSentBytes += retVal; } else if (retVal == SOCKET_ERROR) { - LogEvent(_T("Echo: socket error"), WSAGetLastError(), 0, LOG_ERROR); + LogEvent(L"Echo: socket error", WSAGetLastError(), 0, LOG_ERROR); return FALSE; } else { /* Client closed connection before we could reply to all the data it sent, so quit early. */ - LogEvent(_T("Peer unexpectedly dropped connection!"), 0, 0, LOG_FILE); + LogEvent(L"Peer unexpectedly dropped connection!", 0, 0, LOG_FILE); return FALSE; } } } else if (readBytes == SOCKET_ERROR) { - LogEvent(_T("Echo: socket error"), WSAGetLastError(), 0, LOG_ERROR); + LogEvent(L"Echo: socket error", WSAGetLastError(), 0, LOG_ERROR); return FALSE; } } while ((readBytes != 0) && (!bShutdown)); if (!bShutdown) - LogEvent(_T("Echo: Connection closed by peer"), 0, 0, LOG_FILE); + LogEvent(L"Echo: Connection closed by peer", 0, 0, LOG_FILE); return TRUE; } @@ -73,22 +73,22 @@ EchoHandler(VOID* sock_) if (!EchoIncomingPackets(sock)) { - LogEvent(_T("Echo: EchoIncomingPackets failed"), 0, 0, LOG_FILE); + LogEvent(L"Echo: EchoIncomingPackets failed", 0, 0, LOG_FILE); retVal = 1; } - LogEvent(_T("Echo: Shutting connection down"), 0, 0, LOG_FILE); + LogEvent(L"Echo: Shutting connection down", 0, 0, LOG_FILE); if (ShutdownConnection(sock, TRUE)) { - LogEvent(_T("Echo: Connection is down"), 0, 0, LOG_FILE); + LogEvent(L"Echo: Connection is down", 0, 0, LOG_FILE); } else { - LogEvent(_T("Echo: Connection shutdown failed"), 0, 0, LOG_FILE); + LogEvent(L"Echo: Connection shutdown failed", 0, 0, LOG_FILE); retVal = 1; } - LogEvent(_T("Echo: Terminating thread"), 0, 0, LOG_FILE); + LogEvent(L"Echo: Terminating thread", 0, 0, LOG_FILE); ExitThread(retVal); } diff --git a/reactos/base/services/tcpsvcs/log.c b/reactos/base/services/tcpsvcs/log.c index 8ef9066ffec..6b117244993 100644 --- a/reactos/base/services/tcpsvcs/log.c +++ b/reactos/base/services/tcpsvcs/log.c @@ -11,31 +11,34 @@ #define DEBUG -static LPTSTR lpEventSource = _T("tcpsvcs"); -static LPCTSTR lpLogFileName = _T("C:\\tcpsvcs_log.log"); -static HANDLE hLogFile; +static LPWSTR lpEventSource = L"tcpsvcs"; +static LPCWSTR lpLogFileName = L"C:\\tcpsvcs_log.log"; +static HANDLE hLogFile = NULL; + +static OVERLAPPED olWrite; + // needs work static VOID -LogToEventLog(LPCTSTR lpMsg, +LogToEventLog(LPCWSTR lpMsg, DWORD errNum, DWORD exitCode, UINT flags) { HANDLE hEventLog; - hEventLog = RegisterEventSource(NULL, lpEventSource); + hEventLog = RegisterEventSourceW(NULL, lpEventSource); if (hEventLog) { - ReportEvent(hEventLog, - (flags & LOG_ERROR) ? EVENTLOG_ERROR_TYPE : EVENTLOG_SUCCESS, - 0, - 0, - NULL, - 1, - 0, - &lpMsg, - NULL); + ReportEventW(hEventLog, + (flags & LOG_ERROR) ? EVENTLOG_ERROR_TYPE : EVENTLOG_SUCCESS, + 0, + 0, + NULL, + 1, + 0, + &lpMsg, + NULL); CloseEventLog(hEventLog); } @@ -44,45 +47,45 @@ LogToEventLog(LPCTSTR lpMsg, static BOOL OpenLogFile() { - hLogFile = CreateFile(lpLogFileName, - GENERIC_WRITE, - 0, - NULL, - OPEN_ALWAYS, - FILE_ATTRIBUTE_NORMAL, - NULL); - if (hLogFile == INVALID_HANDLE_VALUE) + hLogFile = CreateFileW(lpLogFileName, + GENERIC_WRITE, + FILE_SHARE_READ, + NULL, + OPEN_ALWAYS, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, + NULL); + if (hLogFile == INVALID_HANDLE_VALUE) + { + hLogFile = NULL; return FALSE; + } return TRUE; } static VOID -LogToFile(LPCTSTR lpMsg, +LogToFile(LPCWSTR lpMsg, DWORD errNum, DWORD exitCode, UINT flags) { - LPTSTR lpFullMsg = NULL; + LPWSTR lpFullMsg = NULL; DWORD msgLen; - if (!OpenLogFile()) - return; - - msgLen = _tcslen(lpMsg) + 1; + msgLen = wcslen(lpMsg) + 1; if (flags & LOG_ERROR) { LPVOID lpSysMsg; DWORD eMsgLen; - eMsgLen = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, - NULL, - errNum, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR)&lpSysMsg, - 0, - NULL); + eMsgLen = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, + NULL, + errNum, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPTSTR)&lpSysMsg, + 0, + NULL); msgLen = msgLen + eMsgLen + 40; @@ -91,9 +94,9 @@ LogToFile(LPCTSTR lpMsg, msgLen * sizeof(TCHAR)); if (lpFullMsg) { - _sntprintf(lpFullMsg, + _snwprintf(lpFullMsg, msgLen, - _T("%s : %s\tErrNum = %lu ExitCode = %lu\r\n"), + L"%s : %s\tErrNum = %lu ExitCode = %lu\r\n", lpMsg, lpSysMsg, errNum, @@ -112,9 +115,9 @@ LogToFile(LPCTSTR lpMsg, msgLen * sizeof(TCHAR)); if (lpFullMsg) { - _sntprintf(lpFullMsg, + _snwprintf(lpFullMsg, msgLen, - _T("%s\r\n"), + L"%s\r\n", lpMsg); } } @@ -122,17 +125,50 @@ LogToFile(LPCTSTR lpMsg, if (lpFullMsg) { DWORD bytesWritten; + DWORD dwRet; + BOOL bRet; - SetFilePointer(hLogFile, 0, NULL, FILE_END); - - WriteFile(hLogFile, - lpFullMsg, - _tcslen(lpFullMsg) * sizeof(TCHAR), - &bytesWritten, - NULL); - if (bytesWritten == 0) + bRet = WriteFile(hLogFile, + lpFullMsg, + wcslen(lpFullMsg) * sizeof(WCHAR), + &bytesWritten, + &olWrite); + if (!bRet) { - LogToEventLog(_T("Failed to write to log file"), + if (GetLastError() != ERROR_IO_PENDING) + { + bRet = FALSE; + } + else + { + // Write is pending + dwRet = WaitForSingleObject(olWrite.hEvent, INFINITE); + + switch (dwRet) + { + // event has been signaled + case WAIT_OBJECT_0: + { + bRet = GetOverlappedResult(hLogFile, + &olWrite, + &bytesWritten, + FALSE); + break; + } + + default: + // An error has occurred in WaitForSingleObject. + // This usually indicates a problem with the + // OVERLAPPED structure's event handle. + bRet = FALSE; + break; + } + } + } + + if (!bRet || bytesWritten == 0) + { + LogToEventLog(L"Failed to write to log file", GetLastError(), 0, LOG_EVENTLOG | LOG_ERROR); @@ -143,8 +179,6 @@ LogToFile(LPCTSTR lpMsg, lpFullMsg); } - CloseHandle(hLogFile); - if (exitCode > 0) ExitProcess(exitCode); } @@ -152,7 +186,7 @@ LogToFile(LPCTSTR lpMsg, VOID -LogEvent(LPCTSTR lpMsg, +LogEvent(LPCWSTR lpMsg, DWORD errNum, DWORD exitCode, UINT flags) @@ -165,39 +199,64 @@ LogEvent(LPCTSTR lpMsg, LogToEventLog(lpMsg, errNum, exitCode, flags); } -VOID +BOOL InitLogging() { - WCHAR wcBom = 0xFEFF; +#ifdef DEBUG + BOOL bRet = FALSE; - DeleteFile(lpLogFileName); - -#ifdef _UNICODE - if (OpenLogFile()) + ZeroMemory(&olWrite, sizeof(OVERLAPPED)); + olWrite.Offset = 0xFFFFFFFF; + olWrite.OffsetHigh = 0xFFFFFFFF; + olWrite.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); + if (olWrite.hEvent) { - DWORD bytesWritten; + DeleteFileW(lpLogFileName); - WriteFile(hLogFile, - &wcBom, - sizeof(WCHAR), - &bytesWritten, - NULL); - if (bytesWritten == 0) + if (OpenLogFile()) { - LogToEventLog(_T("Failed to write to log file"), - GetLastError(), - 0, - LOG_EVENTLOG | LOG_ERROR); - } + WCHAR wcBom = 0xFEFF; + DWORD bytesWritten; - CloseHandle(hLogFile); + bRet = WriteFile(hLogFile, + &wcBom, + sizeof(WCHAR), + &bytesWritten, + &olWrite); + if (!bRet) + { + if (GetLastError() != ERROR_IO_PENDING) + { + LogToEventLog(L"Failed to write to log file", + GetLastError(), + 0, + LOG_EVENTLOG | LOG_ERROR); + } + else + { + bRet = TRUE; + } + } + } } + + return bRet; +#else + return TRUE; #endif } VOID UninitLogging() { - FlushFileBuffers(hLogFile); - CloseHandle(hLogFile); + if (hLogFile) + { + FlushFileBuffers(hLogFile); + CloseHandle(hLogFile); + } + + if (olWrite.hEvent) + { + CloseHandle(olWrite.hEvent); + } } diff --git a/reactos/base/services/tcpsvcs/qotd.c b/reactos/base/services/tcpsvcs/qotd.c index 22cdda17769..536d6dc9590 100644 --- a/reactos/base/services/tcpsvcs/qotd.c +++ b/reactos/base/services/tcpsvcs/qotd.c @@ -9,7 +9,7 @@ #include "tcpsvcs.h" -static LPCTSTR lpFilePath = _T("\\drivers\\etc\\quotes"); +static WCHAR szFilePath[] = L"\\drivers\\etc\\quotes"; static BOOL SendQuote(SOCKET sock, char* Quote) @@ -25,33 +25,33 @@ static BOOL RetrieveQuote(SOCKET sock) { HANDLE hFile; - TCHAR lpFullPath[MAX_PATH + 20]; + WCHAR szFullPath[MAX_PATH + 20]; DWORD dwBytesRead; LPSTR lpQuotes; LPSTR lpStr; - DWORD quoteNum; - DWORD NumQuotes = 0; + INT quoteNum; + INT NumQuotes = 0; INT i; - if(!GetSystemDirectory(lpFullPath, MAX_PATH)) + if(!GetSystemDirectoryW(szFullPath, MAX_PATH)) { - LogEvent(_T("QOTD: Getting system path failed"), GetLastError(), 0, LOG_FILE); + LogEvent(L"QOTD: Getting system path failed", GetLastError(), 0, LOG_FILE); return FALSE; } - _tcscat(lpFullPath, lpFilePath); + wcscat(szFullPath, szFilePath); - LogEvent(_T("QOTD: Opening quotes file"), 0, 0, LOG_FILE); - hFile = CreateFile(lpFullPath, - GENERIC_READ, - 0, - NULL, - OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, - NULL); + LogEvent(L"QOTD: Opening quotes file", 0, 0, LOG_FILE); + hFile = CreateFileW(szFullPath, + GENERIC_READ, + 0, + NULL, + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL, + NULL); if (hFile == INVALID_HANDLE_VALUE) { - LogEvent(_T("QOTD: Error opening quotes file"), GetLastError(), 0, LOG_FILE); + LogEvent(L"QOTD: Error opening quotes file", GetLastError(), 0, LOG_FILE); } else { @@ -105,7 +105,7 @@ RetrieveQuote(SOCKET sock) /* send the quote */ if (!SendQuote(sock, lpStart)) - LogEvent(_T("QOTD: Error sending data"), 0, 0, LOG_FILE); + LogEvent(L"QOTD: Error sending data", 0, 0, LOG_FILE); break; } else @@ -133,22 +133,22 @@ QotdHandler(VOID* sock_) if (!RetrieveQuote(sock)) { - LogEvent(_T("QOTD: Error retrieving quote"), 0, 0, LOG_FILE); + LogEvent(L"QOTD: Error retrieving quote", 0, 0, LOG_FILE); retVal = 1; } - LogEvent(_T("QOTD: Shutting connection down"), 0, 0, LOG_FILE); + LogEvent(L"QOTD: Shutting connection down", 0, 0, LOG_FILE); if (ShutdownConnection(sock, FALSE)) { - LogEvent(_T("QOTD: Connection is down"), 0, 0, LOG_FILE); + LogEvent(L"QOTD: Connection is down", 0, 0, LOG_FILE); } else { - LogEvent(_T("QOTD: Connection shutdown failed"), 0, 0, LOG_FILE); - LogEvent(_T("QOTD: Terminating thread"), 0, 0, LOG_FILE); + LogEvent(L"QOTD: Connection shutdown failed", 0, 0, LOG_FILE); + LogEvent(L"QOTD: Terminating thread", 0, 0, LOG_FILE); retVal = 1; } - LogEvent(_T("QOTD: Terminating thread"), 0, 0, LOG_FILE); + LogEvent(L"QOTD: Terminating thread", 0, 0, LOG_FILE); ExitThread(retVal); } diff --git a/reactos/base/services/tcpsvcs/skelserver.c b/reactos/base/services/tcpsvcs/skelserver.c index b1b84a907b5..87b607d0d54 100644 --- a/reactos/base/services/tcpsvcs/skelserver.c +++ b/reactos/base/services/tcpsvcs/skelserver.c @@ -33,17 +33,17 @@ SetUpListener(USHORT Port) } else { - LogEvent(_T("listen() failed"), WSAGetLastError(), 0, LOG_ERROR); + LogEvent(L"listen() failed", WSAGetLastError(), 0, LOG_ERROR); } } else { - LogEvent(_T("bind() failed"), WSAGetLastError(), 0, LOG_ERROR); + LogEvent(L"bind() failed", WSAGetLastError(), 0, LOG_ERROR); } } else { - LogEvent(_T("socket() failed"), WSAGetLastError(), 0, LOG_ERROR); + LogEvent(L"socket() failed", WSAGetLastError(), 0, LOG_ERROR); } return bSetup ? sock : INVALID_SOCKET; @@ -53,14 +53,14 @@ SetUpListener(USHORT Port) static VOID AcceptConnections(SOCKET listeningSocket, LPTHREAD_START_ROUTINE lpService, - LPTSTR lpName) + LPWSTR lpName) { SOCKADDR_IN client; SOCKET sock; HANDLE hThread; TIMEVAL timeVal; FD_SET readFD; - TCHAR logBuf[256]; + WCHAR logBuf[256]; INT timeOut = 2000; timeVal.tv_sec = timeOut / 1000; @@ -83,14 +83,14 @@ AcceptConnections(SOCKET listeningSocket, sock = accept(listeningSocket, (SOCKADDR*)&client, &addrSize); if (sock != INVALID_SOCKET) { - _stprintf(logBuf, - _T("Accepted connection to %s server from %s:%d"), + _swprintf(logBuf, + L"Accepted connection to %s server from %S:%d", lpName, inet_ntoa(client.sin_addr), ntohs(client.sin_port)); LogEvent(logBuf, 0, 0, LOG_FILE); - _stprintf(logBuf, _T("Creating worker thread for %s"), lpName); + _swprintf(logBuf, L"Creating worker thread for %s", lpName); LogEvent(logBuf, 0, 0, LOG_FILE); if (!bShutdown) @@ -102,7 +102,7 @@ AcceptConnections(SOCKET listeningSocket, } else { - _stprintf(logBuf, _T("Failed to start worker thread for the %s server"), + _swprintf(logBuf, L"Failed to start worker thread for the %s server", lpName); LogEvent(logBuf, 0, 0, LOG_FILE); } @@ -110,13 +110,13 @@ AcceptConnections(SOCKET listeningSocket, } else { - LogEvent(_T("accept failed"), WSAGetLastError(), 0, LOG_ERROR); + LogEvent(L"accept failed", WSAGetLastError(), 0, LOG_ERROR); } } } else if (selRet == SOCKET_ERROR) { - LogEvent(_T("select failed"), WSAGetLastError(), 0, LOG_ERROR); + LogEvent(L"select failed", WSAGetLastError(), 0, LOG_ERROR); } } } @@ -125,14 +125,14 @@ BOOL ShutdownConnection(SOCKET sock, BOOL bRec) { - TCHAR logBuf[256]; + WCHAR logBuf[256]; /* Disallow any further data sends. This will tell the other side that we want to go away now. If we skip this step, we don't shut the connection down nicely. */ if (shutdown(sock, SD_SEND) == SOCKET_ERROR) { - LogEvent(_T("Error in shutdown()"), WSAGetLastError(), 0, LOG_ERROR); + LogEvent(L"Error in shutdown()", WSAGetLastError(), 0, LOG_ERROR); return FALSE; } @@ -148,7 +148,7 @@ ShutdownConnection(SOCKET sock, ret = recv(sock, readBuffer, BUF, 0); if (ret >= 0) { - _stprintf(logBuf, _T("FYI, received %d unexpected bytes during shutdown"), ret); + _swprintf(logBuf, L"FYI, received %d unexpected bytes during shutdown", ret); LogEvent(logBuf, 0, 0, LOG_FILE); } } while (ret > 0); @@ -169,7 +169,7 @@ StartServer(LPVOID lpParam) pServices = (PSERVICES)lpParam; - _stprintf(logBuf, _T("Starting %s server"), pServices->Name); + _swprintf(logBuf, L"Starting %s server", pServices->lpName); LogEvent(logBuf, 0, 0, LOG_FILE); if (!bShutdown) @@ -177,23 +177,23 @@ StartServer(LPVOID lpParam) listeningSocket = SetUpListener(htons(pServices->Port)); if (!bShutdown && listeningSocket != INVALID_SOCKET) { - _stprintf(logBuf, - _T("%s is waiting for connections on port %d"), - pServices->Name, + _swprintf(logBuf, + L"%s is waiting for connections on port %d", + pServices->lpName, pServices->Port); LogEvent(logBuf, 0, 0, LOG_FILE); - AcceptConnections(listeningSocket, pServices->Service, pServices->Name); + AcceptConnections(listeningSocket, pServices->lpService, pServices->lpName); } else { - LogEvent(_T("Socket error when setting up listener"), 0, 0, LOG_FILE); + LogEvent(L"Socket error when setting up listener", 0, 0, LOG_FILE); } } - _stprintf(logBuf, - _T("Exiting %s thread"), - pServices->Name); + _swprintf(logBuf, + L"Exiting %s thread", + pServices->lpName); LogEvent(logBuf, 0, 0, LOG_FILE); ExitThread(0); } diff --git a/reactos/base/services/tcpsvcs/tcpsvcs.c b/reactos/base/services/tcpsvcs/tcpsvcs.c index 70bad6a1658..f91e88b01d6 100644 --- a/reactos/base/services/tcpsvcs/tcpsvcs.c +++ b/reactos/base/services/tcpsvcs/tcpsvcs.c @@ -9,7 +9,7 @@ #include "tcpsvcs.h" -static LPTSTR ServiceName = _T("tcpsvcs"); +static WCHAR ServiceName[] = L"tcpsvcs"; volatile BOOL bShutdown = FALSE; volatile BOOL bPause = FALSE; @@ -23,11 +23,11 @@ typedef struct _ServiceInfo static SERVICES Services[NUM_SERVICES] = { - {ECHO_PORT, _T("Echo"), EchoHandler}, - {DISCARD_PORT, _T("Discard"), DiscardHandler}, - {DAYTIME_PORT, _T("Daytime"), DaytimeHandler}, - {QOTD_PORT, _T("QOTD"), QotdHandler}, - {CHARGEN_PORT, _T("Chargen"), ChargenHandler} + {ECHO_PORT, L"Echo", EchoHandler}, + {DISCARD_PORT, L"Discard", DiscardHandler}, + {DAYTIME_PORT, L"Daytime", DaytimeHandler}, + {QOTD_PORT, L"QOTD", QotdHandler}, + {CHARGEN_PORT, L"Chargen", ChargenHandler} }; @@ -36,7 +36,7 @@ UpdateStatus(PSERVICEINFO pServInfo, DWORD NewStatus, DWORD Check) { - TCHAR szSet[50]; + WCHAR szSet[50]; if (Check > 0) pServInfo->servStatus.dwCheckPoint += Check; @@ -46,15 +46,15 @@ UpdateStatus(PSERVICEINFO pServInfo, if (NewStatus > 0) pServInfo->servStatus.dwCurrentState = NewStatus; - _sntprintf(szSet, + _snwprintf(szSet, 49, - _T("Service state 0x%lu, CheckPoint %lu"), + L"Service state 0x%lu, CheckPoint %lu", pServInfo->servStatus.dwCurrentState, pServInfo->servStatus.dwCheckPoint); LogEvent(szSet, 0, 0, LOG_FILE); if (!SetServiceStatus(pServInfo->hStatus, &pServInfo->servStatus)) - LogEvent(_T("Cannot set service status"), GetLastError(), 0, LOG_ALL); + LogEvent(L"Cannot set service status", GetLastError(), 0, LOG_ALL); } @@ -64,25 +64,25 @@ CreateServers(PSERVICEINFO pServInfo) DWORD dwThreadId[NUM_SERVICES]; HANDLE hThread[NUM_SERVICES]; WSADATA wsaData; - TCHAR buf[256]; + WCHAR buf[256]; INT i; DWORD RetVal; if ((RetVal = WSAStartup(MAKEWORD(2, 2), &wsaData)) != 0) { - _stprintf(buf, _T("WSAStartup() failed : %lu\n"), RetVal); + _swprintf(buf, L"WSAStartup() failed : %lu\n", RetVal); LogEvent(buf, 0, 100, LOG_ALL); return FALSE; } UpdateStatus(pServInfo, 0, 1); - LogEvent(_T("\nCreating server Threads"), 0, 0, LOG_FILE); + LogEvent(L"\nCreating server Threads", 0, 0, LOG_FILE); /* Create worker threads. */ - for(i = 0; i < NUM_SERVICES; i++) + for (i = 0; i < NUM_SERVICES; i++) { - _stprintf(buf, _T("Creating thread for %s server"), Services[i].Name); + _swprintf(buf, L"Creating thread for %s server", Services[i].lpName); LogEvent(buf, 0, 0, LOG_FILE); hThread[i] = CreateThread(NULL, @@ -94,29 +94,30 @@ CreateServers(PSERVICEINFO pServInfo) if (hThread[i] == NULL) { - _stprintf(buf, _T("\nFailed to start %s server\n"), Services[i].Name); + _swprintf(buf, L"\nError creating %s server thread\n", Services[i].lpName); LogEvent(buf, GetLastError(), 0, LOG_ALL); + return FALSE; } UpdateStatus(pServInfo, 0, 1); } - LogEvent(_T("Setting service status to running"), 0, 0, LOG_FILE); + LogEvent(L"Setting service status to running", 0, 0, LOG_FILE); UpdateStatus(pServInfo, SERVICE_RUNNING, 0); /* Wait until all threads have terminated. */ WaitForMultipleObjects(NUM_SERVICES, hThread, TRUE, INFINITE); - for(i = 0; i < NUM_SERVICES; i++) + for (i = 0; i < NUM_SERVICES; i++) { if (hThread[i] != NULL) CloseHandle(hThread[i]); } - LogEvent(_T("Detaching Winsock2"), 0, 0, LOG_FILE); + LogEvent(L"Detaching Winsock2", 0, 0, LOG_FILE); WSACleanup(); - return 0; + return TRUE; } VOID WINAPI @@ -131,7 +132,7 @@ ServerCtrlHandler(DWORD dwControl, { case SERVICE_CONTROL_SHUTDOWN: case SERVICE_CONTROL_STOP: - LogEvent(_T("\nSetting the service to SERVICE_STOP_PENDING"), 0, 0, LOG_FILE); + LogEvent(L"\nSetting the service to SERVICE_STOP_PENDING", 0, 0, LOG_FILE); InterlockedExchange((LONG *)&bShutdown, TRUE); pServInfo->servStatus.dwWin32ExitCode = 0; pServInfo->servStatus.dwWaitHint = 0; @@ -139,13 +140,13 @@ ServerCtrlHandler(DWORD dwControl, break; case SERVICE_CONTROL_PAUSE: /* not yet implemented */ - LogEvent(_T("Setting the service to SERVICE_PAUSED"), 0, 0, LOG_FILE); + LogEvent(L"Setting the service to SERVICE_PAUSED", 0, 0, LOG_FILE); InterlockedExchange((LONG *)&bPause, TRUE); UpdateStatus(pServInfo, SERVICE_PAUSED, 0); break; case SERVICE_CONTROL_CONTINUE: - LogEvent(_T("Setting the service to SERVICE_RUNNING"), 0, 0, LOG_FILE); + LogEvent(L"Setting the service to SERVICE_RUNNING", 0, 0, LOG_FILE); InterlockedExchange((LONG *)&bPause, FALSE); UpdateStatus(pServInfo, SERVICE_RUNNING, 0); break; @@ -155,19 +156,19 @@ ServerCtrlHandler(DWORD dwControl, default: if (dwControl > 127 && dwControl < 256) /* user defined */ - LogEvent(_T("User defined control code"), 0, 0, LOG_FILE); + LogEvent(L"User defined control code", 0, 0, LOG_FILE); else - LogEvent(_T("ERROR: Bad control code"), 0, 0, LOG_FILE); + LogEvent(L"ERROR: Bad control code", 0, 0, LOG_FILE); break; } } VOID WINAPI -ServiceMain(DWORD argc, LPTSTR argv[]) +ServiceMain(DWORD argc, LPWSTR argv[]) { SERVICEINFO servInfo; - LogEvent (_T("Entering ServiceMain."), 0, 0, LOG_FILE); + LogEvent(L"Entering ServiceMain.", 0, 0, LOG_FILE); servInfo.servStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS; servInfo.servStatus.dwCurrentState = SERVICE_STOPPED; @@ -177,43 +178,45 @@ ServiceMain(DWORD argc, LPTSTR argv[]) servInfo.servStatus.dwCheckPoint = 0; servInfo.servStatus.dwWaitHint = 2 * CS_TIMEOUT; - LogEvent(_T("Registering service control handler"), 0, 0, LOG_FILE); - servInfo.hStatus = RegisterServiceCtrlHandlerEx(ServiceName, - (LPHANDLER_FUNCTION_EX)ServerCtrlHandler, - &servInfo); + LogEvent(L"Registering service control handler", 0, 0, LOG_FILE); + servInfo.hStatus = RegisterServiceCtrlHandlerExW(ServiceName, + (LPHANDLER_FUNCTION_EX)ServerCtrlHandler, + &servInfo); if (!servInfo.hStatus) - LogEvent(_T("Failed to register service\n"), GetLastError(), 100, LOG_ALL); + LogEvent(L"Failed to register service", GetLastError(), 100, LOG_ALL); UpdateStatus(&servInfo, SERVICE_START_PENDING, 1); if (!CreateServers(&servInfo)) { + LogEvent(L"Error creating servers", GetLastError(), 1, LOG_ALL); servInfo.servStatus.dwServiceSpecificExitCode = 1; UpdateStatus(&servInfo, SERVICE_STOPPED, 0); return; } - LogEvent(_T("Service threads shut down. Set SERVICE_STOPPED status"), 0, 0, LOG_FILE); + LogEvent(L"Service threads shut down. Set SERVICE_STOPPED status", 0, 0, LOG_FILE); UpdateStatus(&servInfo, SERVICE_STOPPED, 0); - LogEvent(_T("Leaving ServiceMain\n"), 0, 0, LOG_FILE); + LogEvent(L"Leaving ServiceMain\n", 0, 0, LOG_FILE); } int _tmain (int argc, LPTSTR argv []) { - SERVICE_TABLE_ENTRY ServiceTable[] = + SERVICE_TABLE_ENTRYW ServiceTable[] = { {ServiceName, ServiceMain}, {NULL, NULL } }; - InitLogging(); + if (InitLogging()) + { + if (!StartServiceCtrlDispatcherW(ServiceTable)) + LogEvent(L"failed to start the service control dispatcher", GetLastError(), 101, LOG_ALL); - if (!StartServiceCtrlDispatcher(ServiceTable)) - LogEvent(_T("failed to start the service control dispatcher"), GetLastError(), 101, LOG_ALL); - - UninitLogging(); + UninitLogging(); + } return 0; } diff --git a/reactos/base/services/tcpsvcs/tcpsvcs.h b/reactos/base/services/tcpsvcs/tcpsvcs.h index 1af8749d0a3..e1d3c987ab3 100644 --- a/reactos/base/services/tcpsvcs/tcpsvcs.h +++ b/reactos/base/services/tcpsvcs/tcpsvcs.h @@ -3,6 +3,10 @@ #include #include +#ifndef _MSC_VER +#define _swprintf swprintf +#endif + #define LOG_FILE 1 #define LOG_EVENTLOG 2 #define LOG_ERROR 4 @@ -20,19 +24,20 @@ /* data structure to pass to threads */ -typedef struct _Services { +typedef struct _Services +{ USHORT Port; - TCHAR *Name; - LPTHREAD_START_ROUTINE Service; + LPWSTR lpName; + LPTHREAD_START_ROUTINE lpService; } SERVICES, *PSERVICES; extern volatile BOOL bShutdown; extern volatile BOOL bPause; /* logging functions */ -VOID InitLogging(); +BOOL InitLogging(); VOID UninitLogging(); -VOID LogEvent(LPCTSTR lpMsg, DWORD errNum, DWORD exitCode, UINT flags); +VOID LogEvent(LPCWSTR lpMsg, DWORD errNum, DWORD exitCode, UINT flags); /* skelserver functions */ DWORD WINAPI StartServer(LPVOID lpParam); diff --git a/reactos/base/services/umpnpmgr/umpnpmgr.c b/reactos/base/services/umpnpmgr/umpnpmgr.c index 0253fc536c0..c778c228f68 100644 --- a/reactos/base/services/umpnpmgr/umpnpmgr.c +++ b/reactos/base/services/umpnpmgr/umpnpmgr.c @@ -2165,7 +2165,7 @@ PnpEventThread(LPVOID lpParameter) /* Process the pnp event */ DPRINT("Received PnP Event\n"); - if (UuidEqual(&PnpEvent->EventGuid, (UUID*)&GUID_DEVICE_ARRIVAL, &RpcStatus)) + if (UuidEqual(&PnpEvent->EventGuid, (UUID*)&GUID_DEVICE_ENUMERATED, &RpcStatus)) { DeviceInstallParams* Params; DWORD len; diff --git a/reactos/base/setup/reactos/lang/no-NO.rc b/reactos/base/setup/reactos/lang/no-NO.rc index 6e7550bb501..e2c3ead444b 100644 --- a/reactos/base/setup/reactos/lang/no-NO.rc +++ b/reactos/base/setup/reactos/lang/no-NO.rc @@ -2,11 +2,128 @@ LANGUAGE LANG_NORWEGIAN, SUBLANG_NEUTRAL -/* String Tables */ -STRINGTABLE DISCARDABLE +IDD_STARTPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193 +STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "ReactOS installering" +FONT 8, "MS Shell Dlg" BEGIN - IDS_CAPTION "ReactOS Installering" - IDS_TEXT "Du kan ikke installere ReactOS direkte fra denne CD!\n\nVennligst restart din datamaskin fra denne CD i anvisning for е installere ReactOS." + LTEXT "Velkommen til ReactOS installering veiviseren.", IDC_STARTTITLE, 115, 8, 220, 24 + LTEXT "Du kan ennе ikke installere ReactOS direkte fra denne CD-en! "\ + "Vennligst start datamaskinen pе nytt og start fra denne platen for е "\ + "installere ReactOS.", IDC_STATIC, 115, 40, 195, 100 + LTEXT "Trykk pе Fullfшrt for е avslutte installeringen.", IDC_STATIC, 115, 169, 195, 17 END +IDD_LANGSELPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193 +STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "ReactOS installering" +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "IDB_LOGO", IDB_ROSLOGO, "Static", WS_CHILD | WS_VISIBLE | SS_OWNERDRAW, 18, 0, 290, 99 + CONTROL "Installering sprеk:", IDC_STATIC, "Static", WS_CHILD | WS_VISIBLE | WS_GROUP | SS_RIGHT, 20, 109, 106, 11 + CONTROL "", IDC_LANGUAGES, "ComboBox", WS_VSCROLL | WS_TABSTOP | CBS_DROPDOWNLIST, 132, 107, 176, 142 + CONTROL "Tastatur eller inndatasprеk:", 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 "Trykk pе Neste for е velge installering type.", IDC_STATIC, 10, 180 ,297, 10 +END + +IDD_TYPEPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193 +STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "ReactOS installering" +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "Installeringsvalg", IDC_STATIC, "Button", BS_GROUPBOX, 10,0,297,172 + CONTROL "Installere ReactOS", IDC_INSTALL, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP, 20, 15, 277, 10 + CONTROL "Reparere eller oppdatere en installert ReactOS", IDC_SETUP, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP | WS_DISABLED , 20, 30, 277, 10 + LTEXT "Trykk pе Neste for installere enhetene.", IDC_STATIC, 10, 180 ,297, 10 +END + +IDD_DEVICEPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193 +STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "ReactOS installering" +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "Enhetsinnstillinger", IDC_STATIC, "Button", BS_GROUPBOX, 10,0,297,172 + LTEXT "Datamaskin:", IDC_STATIC, 20,15, 80, 10 + CONTROL "", IDC_COMPUTER, "ComboBox", WS_TABSTOP | CBS_DROPDOWNLIST , 100, 15, 150, 80 + LTEXT "Skjerm:", IDC_STATIC, 20,35, 80, 10 + CONTROL "", IDC_DISPLAY, "ComboBox", WS_TABSTOP | CBS_DROPDOWNLIST , 100, 35, 150, 80 + LTEXT "Tastatur:", IDC_STATIC, 20,55, 80, 10 + CONTROL "", IDC_KEYBOARD, "ComboBox", WS_TABSTOP | CBS_DROPDOWNLIST , 100, 55, 150, 80 + LTEXT "Trykk pе Neste for е installere enhetene.", IDC_STATIC, 10, 180 ,277, 20 +END + +IDD_DRIVEPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193 +STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "ReactOS installering" +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "ReactOS partisjon installasjon", IDC_STATIC, "Button", BS_GROUPBOX, 10,1,298,176 + LISTBOX IDC_PARTITION, 20,12,278,142,LBS_HASSTRINGS | WS_VSCROLL + PUSHBUTTON "&Opprett", IDC_PARTCREATE, 20,155,50,15 + PUSHBUTTON "&Slett", IDC_PARTDELETE, 76,155,50,15 + PUSHBUTTON "&Avansert valg...", IDC_PARTMOREOPTS, 218,155,80,15 + LTEXT "Trykk pе Neste for е starte installasjon prosessen.", IDC_STATIC, 10, 180 ,277, 20 +END + +IDD_BOOTOPTIONS DIALOGEX DISCARDABLE 0, 0, 305, 105 +STYLE WS_VISIBLE|WS_CAPTION|WS_SYSMENU|WS_THICKFRAME +CAPTION "Avansert partisjon innstillinger" +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "Installasjon mappe", IDC_STATIC, "Button", BS_GROUPBOX, 4,1,298,30 + EDITTEXT IDC_PATH, 10,11,278,13, WS_VISIBLE + + CONTROL "Oppstartslaster installasjon", IDC_STATIC, "Button", BS_GROUPBOX, 4,36,298,41 + + CONTROL "Installer oppstartslaster pе harddiskens (MBR)", IDC_INSTFREELDR, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP, 10,46,278,11 + CONTROL "Ikke installer oppstartslaster", IDC_NOINSTFREELDR, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP | WS_DISABLED , 10,57,278,11 +END + +IDD_PROCESSPAGE DIALOGEX 0, 0, 317, 193 +STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "ReactOS installering" +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "Installasjon handling", IDC_ACTION, "Button", BS_GROUPBOX, 10,0,297,172 + LTEXT "Installer filer...", IDC_ACTIVITY, 20, 50, 277, 10 + LTEXT "test.txt", IDC_ITEM, 30, 80, 257, 10 + CONTROL "", IDC_PROCESSPROGRESS, "msctls_progress32", + PBS_SMOOTH | WS_CHILD | WS_VISIBLE | WS_BORDER, 20, 120, 277, 8 +END + + +IDD_RESTARTPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193 +STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Fullfшrer ReactOS installering" +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "Fullfшrer fшrste steget av ReactOS installering", IDC_FINISHTITLE, "Button", BS_GROUPBOX, 10,0,297,172 + LTEXT "Du har nе fullfшrt fшrste steget av ReactOS installering.", IDC_STATIC, 20, 50, 277, 10 + + LTEXT "Nеr du trykker Fullfшrt, vil din datamaskin starte pе nytt.", 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 "Hvis du fortsatt har CD platen i stasjon, fjern denne. Ogsе, for е starte "\ + "din datamaskin pе nytt, trykk pе Fullfшrt.", IDC_STATIC, 10, 180, 297, 20 +END + + +STRINGTABLE +BEGIN + IDS_LANGTITLE "Sprеk valg" + IDS_LANGSUBTITLE "Velg sprеk for installering og til ferdig system." + IDS_TYPETITLE "Velkommen til ReactOS installering" + IDS_TYPESUBTITLE "Velg installering type." + IDS_DEVICETITLE "Installer grunnleggende enheter" + IDS_DEVICESUBTITLE "Velg innstillingene til skjermen og tastaturet." + IDS_DRIVETITLE "Valg av installasjon partisjon og system mappe" + IDS_DRIVESUBTITLE "Forbrede installasjon partisjon, system mappe og oppstartslaster." + IDS_PROCESSTITLE "Forbrede partisjon, kopiere filer og installere system" + IDS_PROCESSSUBTITLE "Opprett og formater partisjon, kopier filer, installere og sett opp oppstartlaster" + IDS_RESTARTTITLE "Fшrste steget av installering er fullfшrt" + IDS_RESTARTSUBTITLE "Fшrste steget av installering har blitt fullfшrt, start pе nytt for е fortsette til andre steget" + IDS_ABORTSETUP "ReactOS er ikke fullstendig installert pе datamaskinen. Hvis du avslutter nе, trenger du е kjшre installeringen pе nytt for е installere Reactos. Vil du virkelig avslutte?" + IDS_ABORTSETUP2 "Avbryt installasjonen?" +END /* EOF */ + diff --git a/reactos/base/setup/reactos/rsrc.rc b/reactos/base/setup/reactos/rsrc.rc index 217b12b5db4..2287b042eeb 100644 --- a/reactos/base/setup/reactos/rsrc.rc +++ b/reactos/base/setup/reactos/rsrc.rc @@ -7,6 +7,7 @@ #include "lang/de-DE.rc" //#include "lang/el-GR.rc" #include "lang/en-US.rc" +#include "lang/no-NO.rc" /*#include "lang/es-ES.rc" #include "lang/fi-FI.rc"*/ #include "lang/fr-FR.rc" @@ -15,7 +16,6 @@ #include "lang/it-IT.rc" #include "lang/ja-JP.rc" #include "lang/lt-LT.rc" -#include "lang/no-NO.rc" #include "lang/nl-NL.rc"*/ #include "lang/pl-PL.rc" /*#include "lang/pt-BR.rc"*/ diff --git a/reactos/base/setup/usetup/bootsup.c b/reactos/base/setup/usetup/bootsup.c index 5f7f135d1aa..9c3c9c93f71 100644 --- a/reactos/base/setup/usetup/bootsup.c +++ b/reactos/base/setup/usetup/bootsup.c @@ -387,6 +387,13 @@ CreateFreeLoaderIniForReactos(PWCHAR IniPath, INSERT_LAST, L"ReactOS_WinLdr", L"\"ReactOS (WinLdr)\""); + + /* ReactOS_Ram="ReactOS (RAM Disk)" */ + IniCacheInsertKey(IniSection, + NULL, + INSERT_LAST, + L"ReactOS_Ram", + L"\"ReactOS (RAM Disk)\""); #endif /* Create "ReactOS" section */ @@ -444,7 +451,7 @@ CreateFreeLoaderIniForReactos(PWCHAR IniPath, IniSection = IniCacheAppendSection(IniCache, L"ReactOS_WinLdr"); - /* BootType=ReactOS */ + /* BootType=Windows2003 */ IniCacheInsertKey(IniSection, NULL, INSERT_LAST, @@ -464,6 +471,31 @@ CreateFreeLoaderIniForReactos(PWCHAR IniPath, INSERT_LAST, L"Options", L"/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS"); + + /* Create "ReactOS_WinLdr" section */ + IniSection = IniCacheAppendSection(IniCache, + L"ReactOS_Ram"); + + /* BootType=ReactOS */ + IniCacheInsertKey(IniSection, + NULL, + INSERT_LAST, + L"BootType", + L"ReactOS"); + + /* SystemPath=ramdisk(0)\\ReactOS */ + IniCacheInsertKey(IniSection, + NULL, + INSERT_LAST, + L"SystemPath", + L"ramdisk(0)\\ReactOS"); + + /* Options=/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS /RDIMAGEPATH=reactos.img /RDIMAGEOFFSET=32256*/ + IniCacheInsertKey(IniSection, + NULL, + INSERT_LAST, + L"Options", + L"/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS /RDIMAGEPATH=reactos.img /RDIMAGEOFFSET=32256"); #endif /* Save the ini file */ @@ -947,7 +979,6 @@ InstallFat32BootCodeToFile(PWSTR SrcPath, NtClose(FileHandle); if (!NT_SUCCESS(Status)) { -CHECKPOINT1; RtlFreeHeap(ProcessHeap, 0, OrigBootSector); return(Status); } diff --git a/reactos/base/setup/usetup/interface/devinst.c b/reactos/base/setup/usetup/interface/devinst.c index f5ae9c0a1f4..a646624113f 100644 --- a/reactos/base/setup/usetup/interface/devinst.c +++ b/reactos/base/setup/usetup/interface/devinst.c @@ -366,7 +366,7 @@ EventThread(IN LPVOID lpParameter) /* Process the pnp event */ DPRINT("Received PnP Event\n"); - if (IsEqualIID(&PnpEvent->EventGuid, (REFGUID)&GUID_DEVICE_ARRIVAL)) + if (IsEqualIID(&PnpEvent->EventGuid, (REFGUID)&GUID_DEVICE_ENUMERATED)) { DPRINT1("Device arrival event: %S\n", PnpEvent->TargetDevice.DeviceIds); InstallDevice(hInf, hEnum, hServices, PnpEvent->TargetDevice.DeviceIds); diff --git a/reactos/base/setup/usetup/interface/usetup.c b/reactos/base/setup/usetup/interface/usetup.c index 26ece1e3823..2920793bf18 100644 --- a/reactos/base/setup/usetup/interface/usetup.c +++ b/reactos/base/setup/usetup/interface/usetup.c @@ -699,7 +699,7 @@ SetupStartPage(PINPUT_RECORD Ir) INFCONTEXT Context; PWCHAR Value; UINT ErrorLine; - ULONG ReturnSize; + SIZE_T ReturnSize; CONSOLE_SetStatusText(MUIGetString(STRING_PLEASEWAIT)); @@ -3752,10 +3752,6 @@ RunUSetup(VOID) } } - /// THE FOLLOWING DPRINT IS FOR THE SYSTEM REGRESSION TOOL - /// DO NOT REMOVE!!! - DPRINT1("SYSREG_CHECKPOINT:USETUP_COMPLETE\n"); - FreeConsole(); /* Avoid bugcheck */ diff --git a/reactos/base/setup/usetup/lang/bg-BG.h b/reactos/base/setup/usetup/lang/bg-BG.h index ca3889eed20..d418680ead7 100644 --- a/reactos/base/setup/usetup/lang/bg-BG.h +++ b/reactos/base/setup/usetup/lang/bg-BG.h @@ -4,6 +4,8 @@ MUI_LAYOUTS bgBGLayouts[] = { { L"0402", L"00000402" }, + { L"0402", L"00020402" }, + { L"0402", L"00030402" }, { L"0409", L"00000409" }, { NULL, NULL } }; @@ -1086,7 +1088,7 @@ static MUI_ENTRY bgBGLayoutSettingsEntries[] = { 6, 8, - "Please select a layout to be installed by default.", + "€§ЎҐаҐвҐ Ї®¤а §ЎЁа ­  Є« ўЁ вга­  Ї®¤аҐ¤Ў .", TEXT_STYLE_NORMAL }, { diff --git a/reactos/base/setup/usetup/partlist.c b/reactos/base/setup/usetup/partlist.c index e4807836c19..c78597e9cd1 100644 --- a/reactos/base/setup/usetup/partlist.c +++ b/reactos/base/setup/usetup/partlist.c @@ -906,7 +906,7 @@ CreatePartitionList (SHORT Left, OBJECT_ATTRIBUTES ObjectAttributes; SYSTEM_DEVICE_INFORMATION Sdi; IO_STATUS_BLOCK Iosb; - ULONG ReturnSize; + SIZE_T ReturnSize; NTSTATUS Status; ULONG DiskNumber; WCHAR Buffer[MAX_PATH]; diff --git a/reactos/base/setup/vmwinst/vmwinst.c b/reactos/base/setup/vmwinst/vmwinst.c index db1f63b49f6..80484c9e908 100644 --- a/reactos/base/setup/vmwinst/vmwinst.c +++ b/reactos/base/setup/vmwinst/vmwinst.c @@ -260,6 +260,7 @@ IsVmwSVGAEnabled(VOID) { return FALSE; } + Size = sizeof(DWORD); if(RegQueryValueEx(hReg, L"Start", 0, &Type, (BYTE*)&Value, &Size) != ERROR_SUCCESS || Type != REG_DWORD) { @@ -503,7 +504,7 @@ done: } cleanup: - hThread = (HANDLE)(ULONG_PTR)InterlockedExchange((LONG*)&hInstallationThread, 0); + hThread = (HANDLE)InterlockedExchange((LONG*)&hInstallationThread, 0); if(hThread != NULL) { CloseHandle(hThread); diff --git a/reactos/base/shell/cmd/alias.c b/reactos/base/shell/cmd/alias.c index 0c317f82d88..3a209843806 100644 --- a/reactos/base/shell/cmd/alias.c +++ b/reactos/base/shell/cmd/alias.c @@ -139,7 +139,7 @@ VOID ExpandAlias (LPTSTR cmd, INT maxlen) } -INT CommandAlias (LPTSTR cmd, LPTSTR param) +INT CommandAlias (LPTSTR param) { LPTSTR ptr; diff --git a/reactos/base/shell/cmd/attrib.c b/reactos/base/shell/cmd/attrib.c index c207657bb74..2778ba5cc0d 100644 --- a/reactos/base/shell/cmd/attrib.c +++ b/reactos/base/shell/cmd/attrib.c @@ -188,7 +188,7 @@ ChangeAttribute (LPTSTR pszPath, LPTSTR pszFile, DWORD dwMask, } -INT CommandAttrib (LPTSTR cmd, LPTSTR param) +INT CommandAttrib (LPTSTR param) { LPTSTR *arg; INT argc, i; diff --git a/reactos/base/shell/cmd/batch.c b/reactos/base/shell/cmd/batch.c index bbf1ff5a63f..2f0c613549c 100644 --- a/reactos/base/shell/cmd/batch.c +++ b/reactos/base/shell/cmd/batch.c @@ -194,6 +194,9 @@ VOID ExitBatch (LPTSTR msg) if (bc->ffind) cmd_free(bc->ffind); + UndoRedirection(bc->RedirList, NULL); + FreeRedirection(bc->RedirList); + /* Preserve echo state across batch calls */ bEcho = bc->bEcho; @@ -213,10 +216,9 @@ VOID ExitBatch (LPTSTR msg) * */ -BOOL Batch (LPTSTR fullname, LPTSTR firstword, LPTSTR param) +BOOL Batch (LPTSTR fullname, LPTSTR firstword, LPTSTR param, BOOL forcenew) { HANDLE hFile; - LPTSTR tmp; SetLastError(0); hFile = CreateFile (fullname, GENERIC_READ, FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | @@ -235,7 +237,7 @@ BOOL Batch (LPTSTR fullname, LPTSTR firstword, LPTSTR param) while (bc && bc->forvar) ExitBatch (NULL); - if (bc == NULL) + if (bc == NULL || forcenew) { /* No curent batch file, create a new context */ LPBATCH_CONTEXT n = (LPBATCH_CONTEXT)cmd_alloc (sizeof(BATCH_CONTEXT)); @@ -248,9 +250,7 @@ BOOL Batch (LPTSTR fullname, LPTSTR firstword, LPTSTR param) n->prev = bc; bc = n; - bc->In[0] = _T('\0'); - bc->Out[0] = _T('\0'); - bc->Err[0] = _T('\0'); + bc->RedirList = NULL; } else if (bc->hBatchFile != INVALID_HANDLE_VALUE) { @@ -263,16 +263,13 @@ BOOL Batch (LPTSTR fullname, LPTSTR firstword, LPTSTR param) cmd_free (bc->raw_params); } - GetFullPathName(fullname, sizeof(bc->BatchFilePath), bc->BatchFilePath, &tmp); - *tmp = '\0'; + GetFullPathName(fullname, sizeof(bc->BatchFilePath) / sizeof(TCHAR), bc->BatchFilePath, NULL); bc->hBatchFile = hFile; SetFilePointer (bc->hBatchFile, 0, NULL, FILE_BEGIN); bc->bEcho = bEcho; /* Preserve echo across batch calls */ bc->shiftlevel = 0; bc->bCmdBlock = -1; - bc->lCallPosition = 0; - bc->lCallPositionHigh = 0; bc->ffind = NULL; bc->forvar = _T('\0'); @@ -300,17 +297,23 @@ BOOL Batch (LPTSTR fullname, LPTSTR firstword, LPTSTR param) return TRUE; } -VOID AddBatchRedirection(TCHAR * ifn, TCHAR * ofn, TCHAR * efn) +VOID AddBatchRedirection(REDIRECTION **RedirList) { + REDIRECTION **ListEnd; + if(!bc) return; - if(_tcslen(ifn)) - _tcscpy(bc->In,ifn); - if(_tcslen(ofn)) - _tcscpy(bc->Out,ofn); - if(_tcslen(efn)) - _tcscpy(bc->Err,efn); + /* Prepend the list to the batch context's list */ + ListEnd = RedirList; + while (*ListEnd) + ListEnd = &(*ListEnd)->Next; + *ListEnd = bc->RedirList; + bc->RedirList = *RedirList; + + /* Null out the pointer so that the list will not be cleared prematurely. + * These redirections should persist until the batch file exits. */ + *RedirList = NULL; } /* @@ -325,10 +328,9 @@ VOID AddBatchRedirection(TCHAR * ifn, TCHAR * ofn, TCHAR * efn) * Set eflag to 0 if line is not to be echoed else 1 */ -LPTSTR ReadBatchLine (LPBOOL bLocalEcho) +LPTSTR ReadBatchLine () { LPTSTR first; - LPTSTR ip; /* No batch */ if (bc == NULL) @@ -421,8 +423,6 @@ LPTSTR ReadBatchLine (LPBOOL bLocalEcho) *dp = _T('\0'); - *bLocalEcho = bEcho; - return textline; } @@ -439,14 +439,7 @@ LPTSTR ReadBatchLine (LPBOOL bLocalEcho) } TRACE ("ReadBatchLine(): textline: \'%s\'\n", debugstr_aw(textline)); - /* Strip leading spaces and trailing space/control chars */ - for (first = textline; _istspace (*first); first++) - ; - - for (ip = first + _tcslen (first) - 1; _istspace (*ip) || _istcntrl (*ip); ip--) - ; - - *++ip = _T('\0'); + first = textline; /* cmd block over multiple lines (..) */ if (bc->bCmdBlock >= 0) @@ -481,22 +474,6 @@ LPTSTR ReadBatchLine (LPBOOL bLocalEcho) } } - /* ignore labels and empty lines */ - if (*first == _T(':') || *first == 0) - continue; - - if (*first == _T('@')) - { - /* don't echo this line */ - do - first++; - while (_istspace (*first)); - - *bLocalEcho = 0; - } - else - *bLocalEcho = bEcho; - break; } diff --git a/reactos/base/shell/cmd/batch.h b/reactos/base/shell/cmd/batch.h index 85e8edd7252..998f85cb026 100644 --- a/reactos/base/shell/cmd/batch.h +++ b/reactos/base/shell/cmd/batch.h @@ -19,14 +19,10 @@ typedef struct tagBATCHCONTEXT INT shiftlevel; BOOL bEcho; /* Preserve echo flag across batch calls */ HANDLE hFind; /* Preserve find handle when doing a for */ - TCHAR In[MAX_PATH]; - TCHAR Out[MAX_PATH]; - TCHAR Err[MAX_PATH]; + REDIRECTION *RedirList; TCHAR forvar; INT bCmdBlock; BOOL bExecuteBlock[MAX_PATH]; - LONG lCallPosition; /* store position where to return to after Call :Label */ - LONG lCallPositionHigh; } BATCH_CONTEXT, *LPBATCH_CONTEXT; @@ -45,8 +41,8 @@ extern TCHAR textline[BATCH_BUFFSIZE]; /* Buffer for reading Batch file lines */ LPTSTR FindArg (INT); LPTSTR BatchParams (LPTSTR, LPTSTR); VOID ExitBatch (LPTSTR); -BOOL Batch (LPTSTR, LPTSTR, LPTSTR); -LPTSTR ReadBatchLine (LPBOOL); -VOID AddBatchRedirection(TCHAR *, TCHAR *, TCHAR *); +BOOL Batch (LPTSTR, LPTSTR, LPTSTR, BOOL); +LPTSTR ReadBatchLine(); +VOID AddBatchRedirection(REDIRECTION **); #endif /* _BATCH_H_INCLUDED_ */ diff --git a/reactos/base/shell/cmd/beep.c b/reactos/base/shell/cmd/beep.c index 75546f62083..efe0473624e 100644 --- a/reactos/base/shell/cmd/beep.c +++ b/reactos/base/shell/cmd/beep.c @@ -29,7 +29,7 @@ #ifdef INCLUDE_CMD_BEEP -INT cmd_beep (LPTSTR cmd, LPTSTR param) +INT cmd_beep (LPTSTR param) { if (_tcsncmp (param, _T("/?"), 2) == 0) { diff --git a/reactos/base/shell/cmd/call.c b/reactos/base/shell/cmd/call.c index f90dfeeab9c..8b39e13f5b9 100644 --- a/reactos/base/shell/cmd/call.c +++ b/reactos/base/shell/cmd/call.c @@ -40,11 +40,11 @@ * context block. */ -INT cmd_call (LPTSTR cmd, LPTSTR param) +INT cmd_call (LPTSTR param) { LPBATCH_CONTEXT n = NULL; - TRACE ("cmd_call: (\'%s\',\'%s\')\n", debugstr_aw(cmd), debugstr_aw(param)); + TRACE ("cmd_call: (\'%s\')\n", debugstr_aw(param)); if (!_tcsncmp (param, _T("/?"), 2)) { ConOutResPaging(TRUE,STRING_CALL_HELP); @@ -53,9 +53,18 @@ INT cmd_call (LPTSTR cmd, LPTSTR param) if (*param == _T(':') && (bc)) { - bc->lCallPosition = SetFilePointer(bc->hBatchFile, 0, &bc->lCallPositionHigh, FILE_CURRENT); - cmd_goto(_T("goto"), param); - return 0; + TCHAR *first = param; + while (*param && !_istspace(*param)) + param++; + if (*param) + { + *param++ = _T('\0'); + while (_istspace(*param)) + param++; + } + if (!Batch(bc->BatchFilePath, first, param, TRUE)) + return 1; + return cmd_goto(first); } nErrorLevel = 0; @@ -76,19 +85,8 @@ INT cmd_call (LPTSTR cmd, LPTSTR param) bc->shiftlevel = 0; bc->forvar = 0; /* HBP004 */ bc->forproto = NULL; /* HBP004 */ + bc->RedirList = NULL; ParseCommandLine (param); - if (bc->prev) - { - _tcscpy(bc->In, bc->prev->In); - _tcscpy(bc->Out, bc->prev->Out); - _tcscpy(bc->Err, bc->prev->Err); - } - else - { - bc->In[0] = _T('\0'); - bc->Out[0] = _T('\0'); - bc->Err[0] = _T('\0'); - } /* Wasn't a batch file so remove conext */ diff --git a/reactos/base/shell/cmd/chcp.c b/reactos/base/shell/cmd/chcp.c index 2133f9a9b9a..b834f231b41 100644 --- a/reactos/base/shell/cmd/chcp.c +++ b/reactos/base/shell/cmd/chcp.c @@ -17,7 +17,7 @@ #ifdef INCLUDE_CMD_CHCP -INT CommandChcp (LPTSTR cmd, LPTSTR param) +INT CommandChcp (LPTSTR param) { LPTSTR *arg; INT args; diff --git a/reactos/base/shell/cmd/choice.c b/reactos/base/shell/cmd/choice.c index bf43b8f8e46..6b2c490ea27 100644 --- a/reactos/base/shell/cmd/choice.c +++ b/reactos/base/shell/cmd/choice.c @@ -100,7 +100,7 @@ IsKeyInString (LPTSTR lpString, TCHAR cKey, BOOL bCaseSensitive) INT -CommandChoice (LPTSTR cmd, LPTSTR param) +CommandChoice (LPTSTR param) { LPTSTR lpOptions; TCHAR Options[6]; diff --git a/reactos/base/shell/cmd/cls.c b/reactos/base/shell/cmd/cls.c index cbd5418a209..b821ad2a845 100644 --- a/reactos/base/shell/cmd/cls.c +++ b/reactos/base/shell/cmd/cls.c @@ -30,7 +30,7 @@ #ifdef INCLUDE_CMD_CLS -INT cmd_cls (LPTSTR cmd, LPTSTR param) +INT cmd_cls (LPTSTR param) { CONSOLE_SCREEN_BUFFER_INFO csbi; COORD coPos; diff --git a/reactos/base/shell/cmd/cmd.c b/reactos/base/shell/cmd/cmd.c index 10e5b86e8d0..1dbd4c996ef 100644 --- a/reactos/base/shell/cmd/cmd.c +++ b/reactos/base/shell/cmd/cmd.c @@ -307,10 +307,10 @@ static BOOL RunFile(LPTSTR filename) ret = (hShExt)(NULL, _T("open"), filename, NULL, NULL, SW_SHOWNORMAL); - TRACE ("RunFile: ShellExecuteA/W returned %d\n", ret); + TRACE ("RunFile: ShellExecuteA/W returned %d\n", (DWORD)ret); FreeLibrary(hShell32); - return (PtrToUlong(ret) > 32); + return (((DWORD)ret) > 32); } @@ -323,7 +323,7 @@ static BOOL RunFile(LPTSTR filename) * Rest - rest of command line */ -static VOID +static BOOL Execute (LPTSTR Full, LPTSTR First, LPTSTR Rest) { TCHAR *szFullName=NULL; @@ -345,7 +345,7 @@ Execute (LPTSTR Full, LPTSTR First, LPTSTR Rest) { error_out_of_memory(); nErrorLevel = 1; - return ; + return FALSE; } rest = cmd_alloc ( (_tcslen(Rest) + 512) * sizeof(TCHAR)); @@ -354,7 +354,7 @@ Execute (LPTSTR Full, LPTSTR First, LPTSTR Rest) cmd_free (first); error_out_of_memory(); nErrorLevel = 1; - return ; + return FALSE; } full = cmd_alloc ( (_tcslen(Full) + 512) * sizeof(TCHAR)); @@ -364,7 +364,7 @@ Execute (LPTSTR Full, LPTSTR First, LPTSTR Rest) cmd_free (rest); error_out_of_memory(); nErrorLevel = 1; - return ; + return FALSE; } szFullName = cmd_alloc ( (_tcslen(Full) + 512) * sizeof(TCHAR)); @@ -375,7 +375,7 @@ Execute (LPTSTR Full, LPTSTR First, LPTSTR Rest) cmd_free (full); error_out_of_memory(); nErrorLevel = 1; - return ; + return FALSE; } @@ -446,7 +446,7 @@ Execute (LPTSTR Full, LPTSTR First, LPTSTR Rest) cmd_free (full); cmd_free (szFullName); nErrorLevel = 1; - return; + return working; } /* get the PATH environment variable and parse it */ @@ -459,7 +459,7 @@ Execute (LPTSTR Full, LPTSTR First, LPTSTR Rest) cmd_free (full); cmd_free (szFullName); nErrorLevel = 1; - return; + return FALSE; } @@ -470,7 +470,7 @@ Execute (LPTSTR Full, LPTSTR First, LPTSTR Rest) if (dot && (!_tcsicmp (dot, _T(".bat")) || !_tcsicmp (dot, _T(".cmd")))) { TRACE ("[BATCH: %s %s]\n", debugstr_aw(szFullName), debugstr_aw(rest)); - Batch (szFullName, first, rest); + Batch (szFullName, first, rest, FALSE); } else { @@ -554,6 +554,7 @@ Execute (LPTSTR Full, LPTSTR First, LPTSTR Rest) cmd_free(rest); cmd_free(full); cmd_free (szFullName); + return nErrorLevel == 0; } @@ -566,7 +567,7 @@ Execute (LPTSTR Full, LPTSTR First, LPTSTR Rest) * */ -VOID +BOOL DoCommand (LPTSTR line) { TCHAR *com = NULL; /* the first word in the command */ @@ -575,6 +576,7 @@ DoCommand (LPTSTR line) LPTSTR rest; /* pointer to the rest of the command line */ INT cl; LPCOMMAND cmdptr; + BOOL ret = TRUE; TRACE ("DoCommand: (\'%s\')\n", debugstr_aw(line)); @@ -582,7 +584,7 @@ DoCommand (LPTSTR line) if (com == NULL) { error_out_of_memory(); - return; + return FALSE; } cp = com; @@ -640,13 +642,13 @@ DoCommand (LPTSTR line) /* If end of table execute ext cmd */ if (cmdptr->name == NULL) { - Execute (line, com, rest); + ret = Execute (line, com, rest); break; } if (!_tcscmp (com, cmdptr->name)) { - cmdptr->func (com, rest); + cmdptr->func (rest); break; } @@ -667,16 +669,14 @@ DoCommand (LPTSTR line) { /* OK its one of the specials...*/ - /* Terminate first word properly */ - com[cl] = _T('\0'); - /* Call with new rest */ - cmdptr->func (com, cstart + cl); + cmdptr->func (cstart + cl); break; } } } cmd_free(com); + return ret; } @@ -687,30 +687,28 @@ DoCommand (LPTSTR line) VOID ParseCommandLine (LPTSTR cmd) { - TCHAR cmdline[CMDLINE_LENGTH]; - LPTSTR s; + PARSED_COMMAND *Cmd = ParseCommand(cmd); + if (Cmd) + { + ExecuteCommand(Cmd); + FreeCommand(Cmd); + } +} + +static VOID +ExecutePipeline(PARSED_COMMAND *Cmd) +{ #ifdef FEATURE_REDIRECTION - TCHAR in[CMDLINE_LENGTH] = _T(""); - TCHAR out[CMDLINE_LENGTH] = _T(""); - TCHAR err[CMDLINE_LENGTH] = _T(""); TCHAR szTempPath[MAX_PATH] = _T(".\\"); TCHAR szFileName[2][MAX_PATH] = {_T(""), _T("")}; HANDLE hFile[2] = {INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE}; - LPTSTR t = NULL; - INT num = 0; - INT nRedirFlags = 0; INT Length; UINT Attributes; - BOOL bNewBatch = TRUE; HANDLE hOldConIn; HANDLE hOldConOut; - HANDLE hOldConErr; #endif /* FEATURE_REDIRECTION */ - _tcscpy (cmdline, cmd); - s = &cmdline[0]; - - TRACE ("ParseCommandLine: (\'%s\')\n", debugstr_aw(s)); + //TRACE ("ParseCommandLine: (\'%s\')\n", debugstr_aw(s)); #ifdef FEATURE_REDIRECTION /* find the temp path to store temporary files */ @@ -731,72 +729,16 @@ VOID ParseCommandLine (LPTSTR cmd) if (szTempPath[_tcslen (szTempPath) - 1] != _T('\\')) _tcscat (szTempPath, _T("\\")); - /* get the redirections from the command line */ - num = GetRedirection (s, in, out, err, &nRedirFlags); - - /* more efficient, but do we really need to do this? */ - for (t = in; _istspace (*t); t++) - ; - _tcscpy (in, t); - - for (t = out; _istspace (*t); t++) - ; - _tcscpy (out, t); - - for (t = err; _istspace (*t); t++) - ; - _tcscpy (err, t); - - if(bc && !_tcslen (in) && _tcslen (bc->In)) - _tcscpy(in, bc->In); - if(bc && !out[0] && _tcslen(bc->Out)) - { - nRedirFlags |= OUTPUT_APPEND; - _tcscpy(out, bc->Out); - } - if(bc && !_tcslen (err) && _tcslen (bc->Err)) - { - nRedirFlags |= ERROR_APPEND; - _tcscpy(err, bc->Err); - } - /* Set up the initial conditions ... */ - /* preserve STDIN, STDOUT and STDERR handles */ + /* preserve STDIN and STDOUT handles */ hOldConIn = GetStdHandle (STD_INPUT_HANDLE); hOldConOut = GetStdHandle (STD_OUTPUT_HANDLE); - hOldConErr = GetStdHandle (STD_ERROR_HANDLE); - - /* redirect STDIN */ - if (in[0]) - { - HANDLE hFile; - SECURITY_ATTRIBUTES sa = {sizeof(SECURITY_ATTRIBUTES), NULL, TRUE}; - - /* we need make sure the LastError msg is zero before calling CreateFile */ - SetLastError(0); - - /* Set up pipe for the standard input handler */ - hFile = CreateFile (in, GENERIC_READ, FILE_SHARE_READ, &sa, OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, NULL); - if (hFile == INVALID_HANDLE_VALUE) - { - ConErrResPrintf(STRING_CMD_ERROR1, in); - return; - } - - if (!SetStdHandle (STD_INPUT_HANDLE, hFile)) - { - ConErrResPrintf(STRING_CMD_ERROR1, in); - return; - } - TRACE ("Input redirected from: %s\n", debugstr_aw(in)); - } /* Now do all but the last pipe command */ *szFileName[0] = _T('\0'); hFile[0] = INVALID_HANDLE_VALUE; - while (num-- > 1) + while (Cmd->Type == C_PIPE) { SECURITY_ATTRIBUTES sa = {sizeof(SECURITY_ATTRIBUTES), NULL, TRUE}; @@ -818,7 +760,7 @@ VOID ParseCommandLine (LPTSTR cmd) SetStdHandle (STD_OUTPUT_HANDLE, hFile[1]); - DoCommand (s); + ExecuteCommand(Cmd->Subcommands); /* close stdout file */ SetStdHandle (STD_OUTPUT_HANDLE, hOldConOut); @@ -851,138 +793,18 @@ VOID ParseCommandLine (LPTSTR cmd) OPEN_EXISTING, FILE_ATTRIBUTE_TEMPORARY, NULL); SetStdHandle (STD_INPUT_HANDLE, hFile[0]); - s = s + _tcslen (s) + 1; + Cmd = Cmd->Subcommands->Next; } /* Now set up the end conditions... */ - /* redirect STDOUT */ - if (out[0]) - { - /* Final output to here */ - HANDLE hFile; - SECURITY_ATTRIBUTES sa = {sizeof(SECURITY_ATTRIBUTES), NULL, TRUE}; + SetStdHandle(STD_OUTPUT_HANDLE, hOldConOut); - /* we need make sure the LastError msg is zero before calling CreateFile */ - SetLastError(0); - - hFile = CreateFile (out, GENERIC_WRITE, FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE, &sa, - (nRedirFlags & OUTPUT_APPEND) ? OPEN_ALWAYS : CREATE_ALWAYS, - FILE_ATTRIBUTE_NORMAL | FILE_FLAG_WRITE_THROUGH, NULL); - - if (hFile == INVALID_HANDLE_VALUE) - { - INT size = _tcslen(out)-1; - - if (out[size] != _T(':')) - { - ConErrResPrintf(STRING_CMD_ERROR3, out); - return; - } - - out[size]=_T('\0'); - hFile = CreateFile (out, GENERIC_WRITE, FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE, &sa, - (nRedirFlags & OUTPUT_APPEND) ? OPEN_ALWAYS : CREATE_ALWAYS, - FILE_ATTRIBUTE_NORMAL | FILE_FLAG_WRITE_THROUGH, NULL); - - if (hFile == INVALID_HANDLE_VALUE) - { - ConErrResPrintf(STRING_CMD_ERROR3, out); - return; - } - - } - - if (!SetStdHandle (STD_OUTPUT_HANDLE, hFile)) - { - ConErrResPrintf(STRING_CMD_ERROR3, out); - return; - } - - if (nRedirFlags & OUTPUT_APPEND) - { - LONG lHighPos = 0; - - if (GetFileType (hFile) == FILE_TYPE_DISK) - SetFilePointer (hFile, 0, &lHighPos, FILE_END); - } - TRACE ("Output redirected to: %s\n", debugstr_aw(out)); - } - else if (hOldConOut != INVALID_HANDLE_VALUE) - { - /* Restore original stdout */ - HANDLE hOut = GetStdHandle (STD_OUTPUT_HANDLE); - SetStdHandle (STD_OUTPUT_HANDLE, hOldConOut); - if (hOldConOut != hOut) - CloseHandle (hOut); - hOldConOut = INVALID_HANDLE_VALUE; - } - - /* redirect STDERR */ - if (err[0]) - { - /* Final output to here */ - HANDLE hFile; - SECURITY_ATTRIBUTES sa = {sizeof(SECURITY_ATTRIBUTES), NULL, TRUE}; - - if (!_tcscmp (err, out)) - { - TRACE ("Stdout and stderr will use the same file!!\n"); - DuplicateHandle (GetCurrentProcess (), - GetStdHandle (STD_OUTPUT_HANDLE), - GetCurrentProcess (), - &hFile, 0, TRUE, DUPLICATE_SAME_ACCESS); - } - else - { - hFile = CreateFile (err, - GENERIC_WRITE, - FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE, - &sa, - (nRedirFlags & ERROR_APPEND) ? OPEN_ALWAYS : CREATE_ALWAYS, - FILE_ATTRIBUTE_NORMAL | FILE_FLAG_WRITE_THROUGH, - NULL); - if (hFile == INVALID_HANDLE_VALUE) - { - ConErrResPrintf(STRING_CMD_ERROR3, err); - return; - } - } - - if (!SetStdHandle (STD_ERROR_HANDLE, hFile)) - { - ConErrResPrintf(STRING_CMD_ERROR3, err); - return; - } - - if (nRedirFlags & ERROR_APPEND) - { - LONG lHighPos = 0; - - if (GetFileType (hFile) == FILE_TYPE_DISK) - SetFilePointer (hFile, 0, &lHighPos, FILE_END); - } - TRACE ("Error redirected to: %s\n", debugstr_aw(err)); - } - else if (hOldConErr != INVALID_HANDLE_VALUE) - { - /* Restore original stderr */ - HANDLE hErr = GetStdHandle (STD_ERROR_HANDLE); - SetStdHandle (STD_ERROR_HANDLE, hOldConErr); - if (hOldConErr != hErr) - CloseHandle (hErr); - hOldConErr = INVALID_HANDLE_VALUE; - } - - if(bc) - bNewBatch = FALSE; #endif /* process final command */ - DoCommand (s); + ExecuteCommand(Cmd); #ifdef FEATURE_REDIRECTION - if(bNewBatch && bc) - AddBatchRedirection(in, out, err); /* close old stdin file */ #if 0 /* buggy implementation */ SetStdHandle (STD_INPUT_HANDLE, hOldConIn); @@ -1038,30 +860,55 @@ VOID ParseCommandLine (LPTSTR cmd) } } } - - - /* Restore original STDOUT */ - if (hOldConOut != INVALID_HANDLE_VALUE) - { - HANDLE hOut = GetStdHandle (STD_OUTPUT_HANDLE); - SetStdHandle (STD_OUTPUT_HANDLE, hOldConOut); - if (hOldConOut != hOut) - CloseHandle (hOut); - hOldConOut = INVALID_HANDLE_VALUE; - } - - /* Restore original STDERR */ - if (hOldConErr != INVALID_HANDLE_VALUE) - { - HANDLE hErr = GetStdHandle (STD_ERROR_HANDLE); - SetStdHandle (STD_ERROR_HANDLE, hOldConErr); - if (hOldConErr != hErr) - CloseHandle (hErr); - hOldConErr = INVALID_HANDLE_VALUE; - } #endif /* FEATURE_REDIRECTION */ } +BOOL +ExecuteCommand(PARSED_COMMAND *Cmd) +{ + BOOL bNewBatch = TRUE; + PARSED_COMMAND *Sub; + BOOL Success = TRUE; + + if (!PerformRedirection(Cmd->Redirections)) + return FALSE; + + switch (Cmd->Type) + { + case C_COMMAND: + if(bc) + bNewBatch = FALSE; + + Success = DoCommand(Cmd->CommandLine); + + if(bNewBatch && bc) + AddBatchRedirection(&Cmd->Redirections); + break; + case C_QUIET: + case C_BLOCK: + case C_MULTI: + for (Sub = Cmd->Subcommands; Sub; Sub = Sub->Next) + Success = ExecuteCommand(Sub); + break; + case C_IFFAILURE: + case C_IFSUCCESS: + Sub = Cmd->Subcommands; + Success = ExecuteCommand(Sub); + if (Success == (Cmd->Type - C_IFFAILURE)) + { + Sub = Sub->Next; + Success = ExecuteCommand(Sub); + } + break; + case C_PIPE: + ExecutePipeline(Cmd); + break; + } + + UndoRedirection(Cmd->Redirections, NULL); + return Success; +} + BOOL GrowIfNecessary_dbg ( UINT needed, LPTSTR* ret, UINT* retlen, const char *file, int line ) { @@ -1177,14 +1024,16 @@ GetEnvVarOrSpecial ( LPCTSTR varName ) return NULL; } + + LPCTSTR GetBatchVar ( LPCTSTR varName, UINT* varNameLen ) { static LPTSTR ret = NULL; static UINT retlen = 0; + DWORD len; - if ( varNameLen ) - *varNameLen = 1; + *varNameLen = 1; switch ( *varName ) { @@ -1192,10 +1041,35 @@ GetBatchVar ( LPCTSTR varName, UINT* varNameLen ) varName++; if (_tcsncicmp(varName, _T("dp0"), 3) == 0) { - if ( varNameLen ) - *varNameLen = 4; - return bc->BatchFilePath; + *varNameLen = 4; + len = _tcsrchr(bc->BatchFilePath, _T('\\')) + 1 - bc->BatchFilePath; + if (!GrowIfNecessary(len + 1, &ret, &retlen)) + return NULL; + memcpy(ret, bc->BatchFilePath, len * sizeof(TCHAR)); + ret[len] = _T('\0'); + return ret; } + + *varNameLen = 2; + if (*varName >= _T('0') && *varName <= _T('9')) { + LPTSTR arg = FindArg(*varName - _T('0')); + + if (*arg != _T('"')) + return arg; + + /* Exclude the leading and trailing quotes */ + arg++; + len = _tcslen(arg); + if (arg[len - 1] == _T('"')) + len--; + + if (!GrowIfNecessary(len + 1, &ret, &retlen)) + return NULL; + memcpy(ret, arg, len * sizeof(TCHAR)); + ret[len] = _T('\0'); + return ret; + } + break; case _T('0'): case _T('1'): case _T('2'): @@ -1216,16 +1090,6 @@ GetBatchVar ( LPCTSTR varName, UINT* varNameLen ) case _T('%'): return _T("%"); - - case _T('?'): - /* TODO FIXME 10 is only max size for 32-bit */ - if ( !GrowIfNecessary ( 11, &ret, &retlen ) ) - return NULL; - _sntprintf ( ret, retlen, _T("%u"), nErrorLevel); - ret[retlen-1] = 0; - if ( varNameLen ) - *varNameLen = 1; - return ret; } return NULL; } @@ -1389,60 +1253,86 @@ too_long: * */ +BOOL bNoInteractive; +BOOL bIsBatch; + +BOOL +ReadLine (TCHAR *commandline, BOOL bMore) +{ + TCHAR readline[CMDLINE_LENGTH]; + LPTSTR ip; + + /* if no batch input then... */ + if (!(ip = ReadBatchLine())) + { + if (bNoInteractive) + { + bExit = TRUE; + return FALSE; + } + + if (bMore) + { + ConOutPrintf(_T("More? ")); + } + else + { + /* JPP 19980807 - if echo off, don't print prompt */ + if (bEcho) + PrintPrompt(); + } + + ReadCommand (readline, CMDLINE_LENGTH - 1); + if (CheckCtrlBreak(BREAK_INPUT)) + { + ConOutPuts(_T("\n")); + return FALSE; + } + ip = readline; + bIsBatch = FALSE; + } + else + { + bIsBatch = TRUE; + } + + if (!SubstituteVars(ip, commandline, _T('%'), bIsBatch)) + return FALSE; + + /* FIXME: !vars! should be substituted later, after parsing. */ + if (!SubstituteVars(commandline, readline, _T('!'), bIsBatch)) + return FALSE; + _tcscpy(commandline, readline); + + return TRUE; +} + static INT ProcessInput (BOOL bFlag) { - TCHAR commandline[CMDLINE_LENGTH]; - TCHAR readline[CMDLINE_LENGTH]; - LPTSTR ip; - BOOL bEchoThisLine; - BOOL bIsBatch; + PARSED_COMMAND *Cmd; + bNoInteractive = bFlag; do { - /* if no batch input then... */ - if (!(ip = ReadBatchLine (&bEchoThisLine))) - { - if (bFlag) - return nErrorLevel; - - ReadCommand (readline, CMDLINE_LENGTH); - ip = readline; - bEchoThisLine = FALSE; - bIsBatch = FALSE; - } - else - { - bIsBatch = TRUE; - } - - /* skip leading blanks */ - while ( _istspace(*ip) ) - ++ip; - - if (!SubstituteVars(ip, commandline, _T('%'), bIsBatch)) + Cmd = ParseCommand(NULL); + if (!Cmd) continue; /* JPP 19980807 */ /* Echo batch file line */ - if (bEchoThisLine) + if (bIsBatch && bEcho && Cmd->Type != C_QUIET) { PrintPrompt (); - ConOutPuts (commandline); + EchoCommand(Cmd); + ConOutChar(_T('\n')); } - /* FIXME: !vars! should be substituted later, after parsing. */ - if (!SubstituteVars(commandline, readline, _T('!'), bIsBatch)) - continue; - _tcscpy(commandline, readline); - - if (!CheckCtrlBreak(BREAK_INPUT) && *commandline) - { - ParseCommandLine (commandline); - if (bEcho && !bIgnoreEcho && (!bIsBatch || bEchoThisLine)) - ConOutChar ('\n'); - bIgnoreEcho = FALSE; - } + ExecuteCommand(Cmd); + if (bEcho && !bIgnoreEcho && (!bIsBatch || Cmd->Type != C_QUIET)) + ConOutChar ('\n'); + FreeCommand(Cmd); + bIgnoreEcho = FALSE; } while (!bCanExit || !bExit); @@ -1665,10 +1555,10 @@ Initialize (int argc, const TCHAR* argv[]) if (!IsExistingFile (_T("\\autoexec.bat"))) { #ifdef INCLUDE_CMD_DATE - cmd_date (_T(""), _T("")); + cmd_date (_T("")); #endif #ifdef INCLUDE_CMD_TIME - cmd_time (_T(""), _T("")); + cmd_time (_T("")); #endif } else diff --git a/reactos/base/shell/cmd/cmd.h b/reactos/base/shell/cmd/cmd.h index 2d7f68519c7..e89c3aeb7a8 100644 --- a/reactos/base/shell/cmd/cmd.h +++ b/reactos/base/shell/cmd/cmd.h @@ -68,39 +68,42 @@ extern OSVERSIONINFO osvi; /* Prototypes for ALIAS.C */ VOID ExpandAlias (LPTSTR, INT); -INT CommandAlias (LPTSTR, LPTSTR); +INT CommandAlias (LPTSTR); /* Prototypes for ATTRIB.C */ -INT CommandAttrib (LPTSTR, LPTSTR); +INT CommandAttrib (LPTSTR); /* Prototypes for BEEP.C */ -INT cmd_beep (LPTSTR, LPTSTR); +INT cmd_beep (LPTSTR); /* Prototypes for CALL.C */ -INT cmd_call (LPTSTR, LPTSTR); +INT cmd_call (LPTSTR); /* Prototypes for CHCP.C */ -INT CommandChcp (LPTSTR, LPTSTR); +INT CommandChcp (LPTSTR); /* Prototypes for CHOICE.C */ -INT CommandChoice (LPTSTR, LPTSTR); +INT CommandChoice (LPTSTR); /* Prototypes for CLS.C */ -INT cmd_cls (LPTSTR, LPTSTR); +INT cmd_cls (LPTSTR); /* Prototypes for CMD.C */ INT ConvertULargeInteger (ULARGE_INTEGER num, LPTSTR des, INT len, BOOL bPutSeperator); VOID ParseCommandLine (LPTSTR); +struct _PARSED_COMMAND; +BOOL ExecuteCommand(struct _PARSED_COMMAND *Cmd); LPCTSTR GetEnvVarOrSpecial ( LPCTSTR varName ); VOID AddBreakHandler (VOID); VOID RemoveBreakHandler (VOID); -VOID DoCommand (LPTSTR line); +BOOL DoCommand (LPTSTR line); +BOOL ReadLine(TCHAR *commandline, BOOL bMore); int cmd_main (int argc, const TCHAR *argv[]); extern HANDLE CMD_ModuleHandle; @@ -119,7 +122,7 @@ typedef struct tagCOMMAND { LPTSTR name; INT flags; - INT (*func) (LPTSTR, LPTSTR); + INT (*func)(LPTSTR); } COMMAND, *LPCOMMAND; extern COMMAND cmds[]; /* The internal command table */ @@ -132,7 +135,7 @@ LPCTSTR GetParsedEnvVar ( LPCTSTR varName, UINT* varNameLen, BOOL ModeSetA ); /* Prototypes for COLOR.C */ VOID SetScreenColor(WORD wArgColor, BOOL bFill); -INT CommandColor (LPTSTR, LPTSTR); +INT CommandColor (LPTSTR); VOID ConInDummy (VOID); VOID ConInDisable (VOID); @@ -166,39 +169,39 @@ VOID ConErrResPrintf (UINT resID, ...); VOID ConOutResPaging(BOOL NewPage, UINT resID); /* Prototypes for COPY.C */ -INT cmd_copy (LPTSTR, LPTSTR); +INT cmd_copy (LPTSTR); /* Prototypes for DATE.C */ -INT cmd_date (LPTSTR, LPTSTR); +INT cmd_date (LPTSTR); /* Prototypes for DEL.C */ -INT CommandDelete (LPTSTR, LPTSTR); +INT CommandDelete (LPTSTR); /* Prototypes for DELAY.C */ -INT CommandDelay (LPTSTR, LPTSTR); +INT CommandDelay (LPTSTR); /* Prototypes for DIR.C */ -INT CommandDir (LPTSTR, LPTSTR); +INT CommandDir (LPTSTR); /* Prototypes for DIRSTACK.C */ VOID InitDirectoryStack (VOID); VOID DestroyDirectoryStack (VOID); INT GetDirectoryStackDepth (VOID); -INT CommandPushd (LPTSTR, LPTSTR); -INT CommandPopd (LPTSTR, LPTSTR); -INT CommandDirs (LPTSTR, LPTSTR); +INT CommandPushd (LPTSTR); +INT CommandPopd (LPTSTR); +INT CommandDirs (LPTSTR); /* Prototypes for ECHO.C */ -INT CommandEcho (LPTSTR, LPTSTR); -INT CommandEchos (LPTSTR, LPTSTR); -INT CommandEchoerr (LPTSTR, LPTSTR); -INT CommandEchoserr (LPTSTR, LPTSTR); +INT CommandEcho (LPTSTR); +INT CommandEchos (LPTSTR); +INT CommandEchoerr (LPTSTR); +INT CommandEchoserr (LPTSTR); /* Prototypes for ERROR.C */ @@ -232,15 +235,15 @@ VOID CompleteFilename (LPTSTR, BOOL, LPTSTR, UINT); /* Prototypes for FOR.C */ -INT cmd_for (LPTSTR, LPTSTR); +INT cmd_for (LPTSTR); /* Prototypes for FREE.C */ -INT CommandFree (LPTSTR, LPTSTR); +INT CommandFree (LPTSTR); /* Prototypes for GOTO.C */ -INT cmd_goto (LPTSTR, LPTSTR); +INT cmd_goto (LPTSTR); /* Prototypes for HISTORY.C */ @@ -251,23 +254,23 @@ VOID History_move_to_bottom(VOID);/*F3*/ VOID InitHistory(VOID); VOID CleanHistory(VOID); VOID History_del_current_entry(LPTSTR str);/*CTRL-D*/ -INT CommandHistory (LPTSTR cmd, LPTSTR param); +INT CommandHistory (LPTSTR param); #endif /* Prototypes for INTERNAL.C */ VOID InitLastPath (VOID); VOID FreeLastPath (VOID); -INT cmd_chdir (LPTSTR, LPTSTR); -INT cmd_mkdir (LPTSTR, LPTSTR); -INT cmd_rmdir (LPTSTR, LPTSTR); -INT CommandExit (LPTSTR, LPTSTR); -INT CommandRem (LPTSTR, LPTSTR); -INT CommandShowCommands (LPTSTR, LPTSTR); -INT CommandShowCommandsDetail (LPTSTR, LPTSTR); +INT cmd_chdir (LPTSTR); +INT cmd_mkdir (LPTSTR); +INT cmd_rmdir (LPTSTR); +INT CommandExit (LPTSTR); +INT CommandRem (LPTSTR); +INT CommandShowCommands (LPTSTR); +INT CommandShowCommandsDetail (LPTSTR); /* Prototypes for LABEL.C */ -INT cmd_label (LPTSTR, LPTSTR); +INT cmd_label (LPTSTR); /* Prototypes for LOCALE.C */ @@ -289,7 +292,7 @@ extern UINT InputCodePage; extern UINT OutputCodePage; /* Prototypes for MEMORY.C */ -INT CommandMemory (LPTSTR, LPTSTR); +INT CommandMemory (LPTSTR); /* Prototypes for MISC.C */ @@ -301,6 +304,7 @@ BOOL add_entry (LPINT ac, LPTSTR **arg, LPCTSTR entry); LPTSTR *split (LPTSTR, LPINT, BOOL); VOID freep (LPTSTR *); LPTSTR _stpcpy (LPTSTR, LPCTSTR); +VOID StripQuotes(LPTSTR); BOOL IsValidPathName (LPCTSTR); BOOL IsExistingFile (LPCTSTR); BOOL IsExistingDirectory (LPCTSTR); @@ -318,50 +322,73 @@ INT FilePromptYNA (UINT); /* Prototypes for MOVE.C */ -INT cmd_move (LPTSTR, LPTSTR); +INT cmd_move (LPTSTR); /* Prototypes for MSGBOX.C */ -INT CommandMsgbox (LPTSTR, LPTSTR); +INT CommandMsgbox (LPTSTR); + + +/* Prototypes from PARSER.C */ +enum { C_COMMAND, C_QUIET, C_BLOCK, C_MULTI, C_IFFAILURE, C_IFSUCCESS, C_PIPE }; +typedef struct _PARSED_COMMAND +{ + struct _PARSED_COMMAND *Subcommands; + struct _PARSED_COMMAND *Next; + struct _REDIRECTION *Redirections; + TCHAR *Tail; + BYTE Type; + TCHAR CommandLine[]; +} PARSED_COMMAND; +PARSED_COMMAND *ParseCommand(LPTSTR Line); +VOID EchoCommand(PARSED_COMMAND *Cmd); +VOID FreeCommand(PARSED_COMMAND *Cmd); /* Prototypes from PATH.C */ -INT cmd_path (LPTSTR, LPTSTR); +INT cmd_path (LPTSTR); /* Prototypes from PROMPT.C */ VOID PrintPrompt (VOID); -INT cmd_prompt (LPTSTR, LPTSTR); +INT cmd_prompt (LPTSTR); /* Prototypes for REDIR.C */ -#define INPUT_REDIRECTION 1 -#define OUTPUT_REDIRECTION 2 -#define OUTPUT_APPEND 4 -#define ERROR_REDIRECTION 8 -#define ERROR_APPEND 16 -INT GetRedirection (LPTSTR, LPTSTR, LPTSTR, LPTSTR, LPINT); +enum { REDIR_READ, REDIR_WRITE, REDIR_APPEND }; +typedef struct _REDIRECTION +{ + struct _REDIRECTION *Next; + HANDLE OldHandle; + BYTE Number; + BYTE Type; + TCHAR Filename[]; +} REDIRECTION; +BOOL PerformRedirection(REDIRECTION *); +VOID UndoRedirection(REDIRECTION *, REDIRECTION *End); +INT GetRedirection(LPTSTR, REDIRECTION **); +VOID FreeRedirection(REDIRECTION *); /* Prototypes for REN.C */ -INT cmd_rename (LPTSTR, LPTSTR); +INT cmd_rename (LPTSTR); /* Prototypes for REN.C */ -INT cmd_replace (LPTSTR, LPTSTR); +INT cmd_replace (LPTSTR); /* Prototypes for SCREEN.C */ -INT CommandScreen (LPTSTR, LPTSTR); +INT CommandScreen (LPTSTR); /* Prototypes for SET.C */ -INT cmd_set (LPTSTR, LPTSTR); +INT cmd_set (LPTSTR); /* Prototypes for SETLOCAL.C */ -INT cmd_setlocal (LPTSTR, LPTSTR); -INT cmd_endlocal (LPTSTR, LPTSTR); +INT cmd_setlocal (LPTSTR); +INT cmd_endlocal (LPTSTR); /* Prototypes for START.C */ -INT cmd_start (LPTSTR, LPTSTR); +INT cmd_start (LPTSTR); /* Prototypes for STRTOCLR.C */ @@ -369,45 +396,45 @@ BOOL StringToColor (LPWORD, LPTSTR *); /* Prototypes for TIME.C */ -INT cmd_time (LPTSTR, LPTSTR); +INT cmd_time (LPTSTR); /* Prototypes for TIMER.C */ -INT CommandTimer (LPTSTR cmd, LPTSTR param); +INT CommandTimer (LPTSTR param); /* Prototypes for TITLE.C */ -INT cmd_title (LPTSTR, LPTSTR); +INT cmd_title (LPTSTR); /* Prototypes for TYPE.C */ -INT cmd_type (LPTSTR, LPTSTR); +INT cmd_type (LPTSTR); /* Prototypes for VER.C */ VOID ShortVersion (VOID); -INT cmd_ver (LPTSTR, LPTSTR); +INT cmd_ver (LPTSTR); /* Prototypes for VERIFY.C */ -INT cmd_verify (LPTSTR, LPTSTR); +INT cmd_verify (LPTSTR); /* Prototypes for VOL.C */ -INT cmd_vol (LPTSTR, LPTSTR); +INT cmd_vol (LPTSTR); /* Prototypes for WHERE.C */ BOOL SearchForExecutable (LPCTSTR, LPTSTR); /* Prototypes for WINDOW.C */ -INT CommandActivate (LPTSTR, LPTSTR); -INT CommandWindow (LPTSTR, LPTSTR); +INT CommandActivate (LPTSTR); +INT CommandWindow (LPTSTR); /* The MSDOS Batch Commands [MS-DOS 5.0 User's Guide and Reference p359] */ -int cmd_if(TCHAR *, TCHAR *); -int cmd_pause(TCHAR *, TCHAR *); -int cmd_shift(TCHAR *, TCHAR *); +int cmd_if(TCHAR *); +int cmd_pause(TCHAR *); +int cmd_shift(TCHAR *); #endif /* _CMD_H_INCLUDED_ */ diff --git a/reactos/base/shell/cmd/cmd.rbuild b/reactos/base/shell/cmd/cmd.rbuild index 12027af7208..2fc1444b7d1 100644 --- a/reactos/base/shell/cmd/cmd.rbuild +++ b/reactos/base/shell/cmd/cmd.rbuild @@ -44,6 +44,7 @@ misc.c move.c msgbox.c + parser.c path.c pause.c prompt.c diff --git a/reactos/base/shell/cmd/cmdinput.c b/reactos/base/shell/cmd/cmdinput.c index 573a21b62ac..fd3560a43b3 100644 --- a/reactos/base/shell/cmd/cmdinput.c +++ b/reactos/base/shell/cmd/cmdinput.c @@ -152,10 +152,6 @@ VOID ReadCommand (LPTSTR str, INT maxlen) /* get screen size */ GetScreenSize (&maxx, &maxy); - /* JPP 19980807 - if echo off, don't print prompt */ - if (bEcho) - PrintPrompt(); - GetCursorXY (&orgx, &orgy); GetCursorXY (&curx, &cury); @@ -431,6 +427,8 @@ VOID ReadCommand (LPTSTR str, INT maxlen) if (str[0]) History (0, str); #endif + str[charcount++] = _T('\n'); + str[charcount] = _T('\0'); ConInDummy (); ConOutChar (_T('\n')); bReturn = TRUE; diff --git a/reactos/base/shell/cmd/cmdtable.c b/reactos/base/shell/cmd/cmdtable.c index 2143d95fa15..516844fa312 100644 --- a/reactos/base/shell/cmd/cmdtable.c +++ b/reactos/base/shell/cmd/cmdtable.c @@ -93,11 +93,9 @@ COMMAND cmds[] = {_T("dirs"), 0, CommandDirs}, #endif - {_T("echo"), 0, CommandEcho}, - {_T("echo."), CMD_HIDE, CommandEcho}, + {_T("echo"), CMD_SPECIAL, CommandEcho}, {_T("echos"), 0, CommandEchos}, - {_T("echoerr"), 0, CommandEchoerr}, - {_T("echoerr."), CMD_HIDE, CommandEchoerr}, + {_T("echoerr"), CMD_SPECIAL, CommandEchoerr}, {_T("echoserr"), 0, CommandEchoserr}, {_T("endlocal"), 0, cmd_endlocal}, diff --git a/reactos/base/shell/cmd/color.c b/reactos/base/shell/cmd/color.c index 2ee1f44249d..7b6cea9e250 100644 --- a/reactos/base/shell/cmd/color.c +++ b/reactos/base/shell/cmd/color.c @@ -63,7 +63,7 @@ VOID SetScreenColor (WORD wColor, BOOL bNoFill) * * internal dir command */ -INT CommandColor (LPTSTR first, LPTSTR rest) +INT CommandColor (LPTSTR rest) { if (_tcsncmp (rest, _T("/?"), 2) == 0) { diff --git a/reactos/base/shell/cmd/copy.c b/reactos/base/shell/cmd/copy.c index 8526b437179..e01b725d6c2 100644 --- a/reactos/base/shell/cmd/copy.c +++ b/reactos/base/shell/cmd/copy.c @@ -290,7 +290,7 @@ static INT CopyOverwrite (LPTSTR fn) } -INT cmd_copy (LPTSTR cmd, LPTSTR param) +INT cmd_copy (LPTSTR param) { LPTSTR *arg; INT argc, i, nFiles, nOverwrite = 0, nSrc = -1, nDes = -1; diff --git a/reactos/base/shell/cmd/date.c b/reactos/base/shell/cmd/date.c index 53a4b5ba9a3..ef089447b83 100644 --- a/reactos/base/shell/cmd/date.c +++ b/reactos/base/shell/cmd/date.c @@ -176,7 +176,7 @@ ParseDate (LPTSTR s) } -INT cmd_date (LPTSTR cmd, LPTSTR param) +INT cmd_date (LPTSTR param) { LPTSTR *arg; INT argc; diff --git a/reactos/base/shell/cmd/del.c b/reactos/base/shell/cmd/del.c index 3785fc0956e..45d880f9fe3 100644 --- a/reactos/base/shell/cmd/del.c +++ b/reactos/base/shell/cmd/del.c @@ -354,7 +354,7 @@ ProcessDirectory(LPTSTR FileName, DWORD* dwFlags, DWORD dwAttrFlags) -INT CommandDelete (LPTSTR cmd, LPTSTR param) +INT CommandDelete (LPTSTR param) { /*cmd is the command that was given, in this case it will always be "del" or "delete" param is whatever is given after the command*/ diff --git a/reactos/base/shell/cmd/delay.c b/reactos/base/shell/cmd/delay.c index eebbaf01cfb..2f80958a9c1 100644 --- a/reactos/base/shell/cmd/delay.c +++ b/reactos/base/shell/cmd/delay.c @@ -14,7 +14,7 @@ #ifdef INCLUDE_CMD_DELAY -INT CommandDelay (LPTSTR cmd, LPTSTR param) +INT CommandDelay (LPTSTR param) { DWORD val; DWORD mul=1000; diff --git a/reactos/base/shell/cmd/dir.c b/reactos/base/shell/cmd/dir.c index 5968fe4df7e..9c3314e2601 100644 --- a/reactos/base/shell/cmd/dir.c +++ b/reactos/base/shell/cmd/dir.c @@ -1789,7 +1789,7 @@ ULARGE_INTEGER u64Temp; /* A temporary counter */ * internal dir command */ INT -CommandDir(LPTSTR first, LPTSTR rest) +CommandDir(LPTSTR rest) { TCHAR dircmd[256]; /* A variable to store the DIRCMD enviroment variable */ TCHAR path[MAX_PATH]; diff --git a/reactos/base/shell/cmd/dirstack.c b/reactos/base/shell/cmd/dirstack.c index 8c1e0189b2c..2aff845cabc 100644 --- a/reactos/base/shell/cmd/dirstack.c +++ b/reactos/base/shell/cmd/dirstack.c @@ -140,7 +140,7 @@ INT GetDirectoryStackDepth (VOID) /* * pushd command */ -INT CommandPushd (LPTSTR first, LPTSTR rest) +INT CommandPushd (LPTSTR rest) { TCHAR curPath[MAX_PATH]; TCHAR newPath[MAX_PATH]; @@ -174,7 +174,7 @@ INT CommandPushd (LPTSTR first, LPTSTR rest) /* * popd command */ -INT CommandPopd (LPTSTR first, LPTSTR rest) +INT CommandPopd (LPTSTR rest) { TCHAR szPath[MAX_PATH]; @@ -201,7 +201,7 @@ INT CommandPopd (LPTSTR first, LPTSTR rest) /* * dirs command */ -INT CommandDirs (LPTSTR first, LPTSTR rest) +INT CommandDirs (LPTSTR rest) { LPDIRENTRY lpDir; diff --git a/reactos/base/shell/cmd/echo.c b/reactos/base/shell/cmd/echo.c index 2ec644ca624..e6ea2d11cfa 100644 --- a/reactos/base/shell/cmd/echo.c +++ b/reactos/base/shell/cmd/echo.c @@ -29,24 +29,11 @@ #include -INT CommandEcho (LPTSTR cmd, LPTSTR param) +INT CommandEcho (LPTSTR param) { LPTSTR p1, p2; - TRACE ("CommandEcho '%s' : '%s'\n", debugstr_aw(cmd), debugstr_aw(param)); - - if (_tcsicmp (cmd, _T("echo.")) == 0) - { - if (param[0] == 0) - ConOutChar (_T('\n')); - else - ConOutPuts (param); - } - else - { - /* skip the first delimiter */ - if (_istspace(*param)) - param++; + TRACE ("CommandEcho: '%s'\n", debugstr_aw(param)); /* skip all spaces for the check of '/?', 'ON' and 'OFF' */ p1 = param; @@ -83,32 +70,22 @@ INT CommandEcho (LPTSTR cmd, LPTSTR param) } if (*p1 != _T('\0')) { - p1 = param; - while (NULL != (p1 = _tcschr(p1, _T('^')))) - { - memmove(p1, p1 + 1, (_tcslen(p1 + 1) + 1) * sizeof(TCHAR)); - if (*p1) - { - //skip past the char being escaped - p1++; - } - } - ConOutPuts (param); + /* skip the first character */ + ConOutPuts(param + 1); } else { ConOutResPrintf(STRING_ECHO_HELP5, bEcho ? D_ON : D_OFF); } - } return 0; } -INT CommandEchos (LPTSTR cmd, LPTSTR param) +INT CommandEchos (LPTSTR param) { - TRACE ("CommandEchos '%s' : '%s'\n", debugstr_aw(cmd), debugstr_aw(param)); + TRACE ("CommandEchos: '%s'\n", debugstr_aw(param)); if (!_tcsncmp (param, _T("/?"), 2)) { @@ -123,10 +100,10 @@ INT CommandEchos (LPTSTR cmd, LPTSTR param) } -INT CommandEchoerr (LPTSTR cmd, LPTSTR param) +INT CommandEchoerr (LPTSTR param) { - TRACE ("CommandEchoerr '%s' : '%s'\n", debugstr_aw(cmd), debugstr_aw(param)); + TRACE ("CommandEchoerr: '%s'\n", debugstr_aw(param)); if (!_tcsncmp (param, _T("/?"), 2)) { @@ -134,26 +111,16 @@ INT CommandEchoerr (LPTSTR cmd, LPTSTR param) return 0; } - if (_tcsicmp (cmd, _T("echoerr.")) == 0) - { - if (param[0] == 0) - ConErrChar (_T('\n')); - else - ConErrPuts (param); - } - else if (*param) - { - ConErrPuts (param); - } + ConErrPuts (param); return 0; } -INT CommandEchoserr (LPTSTR cmd, LPTSTR param) +INT CommandEchoserr (LPTSTR param) { - TRACE ("CommandEchoserr '%s' : '%s'\n", debugstr_aw(cmd), debugstr_aw(param)); + TRACE ("CommandEchoserr: '%s'\n", debugstr_aw(param)); if (!_tcsncmp (param, _T("/?"), 2)) { diff --git a/reactos/base/shell/cmd/for.c b/reactos/base/shell/cmd/for.c index 6800eab7ddd..e60ec383157 100644 --- a/reactos/base/shell/cmd/for.c +++ b/reactos/base/shell/cmd/for.c @@ -47,14 +47,14 @@ * per list element. */ -INT cmd_for (LPTSTR cmd, LPTSTR param) +INT cmd_for (LPTSTR param) { LPBATCH_CONTEXT lpNew; LPTSTR pp; TCHAR var; TCHAR szMsg[RC_STRING_MAX_SIZE]; - TRACE ("cmd_for (\'%s\', \'%s\'\n", debugstr_aw(cmd), debugstr_aw(param)); + TRACE ("cmd_for (\'%s\')\n", debugstr_aw(param)); if (!_tcsncmp (param, _T("/?"), 2)) { @@ -138,9 +138,7 @@ INT cmd_for (LPTSTR cmd, LPTSTR param) bc->bEcho = bc->prev->bEcho; else bc->bEcho = bEcho; - bc->In[0] = _T('\0'); - bc->Out[0] = _T('\0'); - bc->Err[0] = _T('\0'); + bc->RedirList = NULL; return 0; diff --git a/reactos/base/shell/cmd/free.c b/reactos/base/shell/cmd/free.c index 14002e1444e..c669d8c7cc4 100644 --- a/reactos/base/shell/cmd/free.c +++ b/reactos/base/shell/cmd/free.c @@ -84,7 +84,7 @@ PrintDiskInfo (LPTSTR szDisk) } -INT CommandFree (LPTSTR cmd, LPTSTR param) +INT CommandFree (LPTSTR param) { LPTSTR szParam; TCHAR szDefPath[MAX_PATH]; diff --git a/reactos/base/shell/cmd/goto.c b/reactos/base/shell/cmd/goto.c index 216a9997ef7..21217103f1b 100644 --- a/reactos/base/shell/cmd/goto.c +++ b/reactos/base/shell/cmd/goto.c @@ -36,13 +36,13 @@ * */ -INT cmd_goto (LPTSTR cmd, LPTSTR param) +INT cmd_goto (LPTSTR param) { TCHAR szMsg[RC_STRING_MAX_SIZE]; LPTSTR tmp, tmp2; LONG lNewPosHigh = 0; - TRACE ("cmd_goto (\'%s\', \'%s\'\n", debugstr_aw(cmd), debugstr_aw(param)); + TRACE ("cmd_goto (\'%s\')\n", debugstr_aw(param)); if (!_tcsncmp (param, _T("/?"), 2)) { @@ -75,15 +75,7 @@ INT cmd_goto (LPTSTR cmd, LPTSTR param) /* jump to end of the file */ if ( _tcsicmp( param, _T(":eof"))==0) { - /* when lCallPosition != 0 we have to return to the caller */ - if (bc->lCallPosition == 0) - SetFilePointer (bc->hBatchFile, 0, &lNewPosHigh, FILE_END); - else - { - SetFilePointer (bc->hBatchFile, (LONG)bc->lCallPosition, &bc->lCallPositionHigh, FILE_BEGIN); - bc->lCallPosition = 0; - bc->lCallPositionHigh = 0; - } + SetFilePointer (bc->hBatchFile, 0, &lNewPosHigh, FILE_END); return 0; } diff --git a/reactos/base/shell/cmd/history.c b/reactos/base/shell/cmd/history.c index 02f22169761..5a85527b225 100644 --- a/reactos/base/shell/cmd/history.c +++ b/reactos/base/shell/cmd/history.c @@ -74,7 +74,7 @@ VOID set_size(INT new_size); -INT CommandHistory (LPTSTR cmd, LPTSTR param) +INT CommandHistory (LPTSTR param) { LPTSTR tmp; INT tmp_int; diff --git a/reactos/base/shell/cmd/if.c b/reactos/base/shell/cmd/if.c index 153c7c7d127..061173bedd3 100644 --- a/reactos/base/shell/cmd/if.c +++ b/reactos/base/shell/cmd/if.c @@ -36,12 +36,12 @@ #define X_EXEC 1 #define X_EMPTY 0x80 -INT cmd_if (LPTSTR cmd, LPTSTR param) +INT cmd_if (LPTSTR param) { INT x_flag = 0; /* when set cause 'then' clause to be executed */ LPTSTR pp; - TRACE ("cmd_if: (\'%s\', \'%s\')\n", debugstr_aw(cmd), debugstr_aw(param)); + TRACE ("cmd_if: (\'%s\')\n", debugstr_aw(param)); if (!_tcsncmp (param, _T("/?"), 2)) { diff --git a/reactos/base/shell/cmd/internal.c b/reactos/base/shell/cmd/internal.c index b079e3e6502..afc553cb2a1 100644 --- a/reactos/base/shell/cmd/internal.c +++ b/reactos/base/shell/cmd/internal.c @@ -267,7 +267,7 @@ BOOL SetRootPath(TCHAR *InPath) * CD / CHDIR * */ -INT cmd_chdir (LPTSTR cmd, LPTSTR param) +INT cmd_chdir (LPTSTR param) { WIN32_FIND_DATA f; @@ -455,10 +455,9 @@ MakeFullPath(TCHAR * DirPath) * MD / MKDIR * */ -INT cmd_mkdir (LPTSTR cmd, LPTSTR param) +INT cmd_mkdir (LPTSTR param) { LPTSTR dir; /* pointer to the directory to change to */ - LPTSTR place; /* used to search for the \ when no space is used */ LPTSTR *p = NULL; INT argc; nErrorLevel = 0; @@ -469,28 +468,6 @@ INT cmd_mkdir (LPTSTR cmd, LPTSTR param) } - /* check if there is no space between the command and the path */ - if (param[0] == _T('\0')) - { - /* search for the \ or . so that both short & long names will work */ - for (place = cmd; *place; place++) - if (*place == _T('.') || *place == _T('\\')) - break; - - if (*place) - { - argc = 0; - if (add_entry(&argc, &p, place)) - dir = place; - else - dir = NULL; - } - else - /* signal that there are no parameters */ - dir = NULL; - } - else - { p = split (param, &argc, FALSE); if (argc > 1) { @@ -501,7 +478,6 @@ INT cmd_mkdir (LPTSTR cmd, LPTSTR param) } else dir = p[0]; - } if (!dir) { @@ -573,7 +549,7 @@ BOOL DeleteFolder(LPTSTR FileName) } return RemoveDirectory(FileName); } -INT cmd_rmdir (LPTSTR cmd, LPTSTR param) +INT cmd_rmdir (LPTSTR param) { TCHAR dir[MAX_PATH]; /* pointer to the directory to change to */ TCHAR ch; @@ -707,7 +683,7 @@ INT cmd_rmdir (LPTSTR cmd, LPTSTR param) * set the exitflag to true * */ -INT CommandExit (LPTSTR cmd, LPTSTR param) +INT CommandExit (LPTSTR param) { if (!_tcsncmp (param, _T("/?"), 2)) { @@ -741,7 +717,7 @@ INT CommandExit (LPTSTR cmd, LPTSTR param) * does nothing * */ -INT CommandRem (LPTSTR cmd, LPTSTR param) +INT CommandRem (LPTSTR param) { if (!_tcsncmp (param, _T("/?"), 2)) { @@ -753,13 +729,13 @@ INT CommandRem (LPTSTR cmd, LPTSTR param) #endif /* INCLUDE_CMD_REM */ -INT CommandShowCommands (LPTSTR cmd, LPTSTR param) +INT CommandShowCommands (LPTSTR param) { PrintCommandList (); return 0; } -INT CommandShowCommandsDetail (LPTSTR cmd, LPTSTR param) +INT CommandShowCommandsDetail (LPTSTR param) { /* If a param was send, display help of correspondent command */ if (_tcslen(param)) diff --git a/reactos/base/shell/cmd/label.c b/reactos/base/shell/cmd/label.c index 745ff900dcd..bd9eda38761 100644 --- a/reactos/base/shell/cmd/label.c +++ b/reactos/base/shell/cmd/label.c @@ -22,7 +22,7 @@ #ifdef INCLUDE_CMD_LABEL -INT cmd_label (LPTSTR cmd, LPTSTR param) +INT cmd_label (LPTSTR param) { TCHAR szRootPath[] = _T("A:\\"); TCHAR szLabel[80]; diff --git a/reactos/base/shell/cmd/lang/it-IT.rc b/reactos/base/shell/cmd/lang/it-IT.rc index 8a83fb716e0..3aef3da45ae 100644 --- a/reactos/base/shell/cmd/lang/it-IT.rc +++ b/reactos/base/shell/cmd/lang/it-IT.rc @@ -36,6 +36,7 @@ STRING_CALL_HELP, "Chiama un programma batch da un altro.\n\n\ CALL [disco:][percorso]nomefile [Parametri]\n\n\ Parametri Indicano le informazioni richieste per il programma batch." + STRING_CD_HELP, "Cambia la cartella corrente o ne visualizza nome\n\n\ CHDIR [/D][disco:][percorso]\n\ CHDIR[..|.]\n\ @@ -89,21 +90,21 @@ CMD [/[C|K] comando][/P][/Q][/T:bf]\n\n\ STRING_COLOR_HELP1, "Definisce i colori predefiniti di primo piano e sfondo.\n\n\ COLOR [attr [/-F]] \n\n\ attr Indica gli attributi di colore per i messaggi su console\n\ - /-F Non riempie lo spazio vuoto della consol con gli attributi di colore\n\n\ + /-F Non riempie lo spazio vuoto della console con gli attributi di colore\n\n\ Ci sono tre modi per indicare i colori:\n\ 1) [bright] nome su [bright] nome (sono necessarie solo le prime tre lettere)\n\ 2) decimale su decimale\n\ 3) due cifre esadecimali\n\n\ I colori sono:\n\ dec esa name dec esa nome\n\ -0 0 Black 8 8 Gray(Bright black)\n\ -1 1 Blue 9 9 Bright Blue\n\ -2 2 Green 10 A Bright Green\n\ -3 3 Cyan 11 B Bright Cyan\n\ -4 4 Red 12 C Bright Red\n\ -5 5 Magenta 13 D Bright Magenta\n\ -6 6 Yellow 14 E Bright Yellow\n\ -7 7 White 15 F Bright White\n" +0 0 Nero 8 8 Grigio (Nero acceso)\n\ +1 1 Blu 9 9 Blu acceso\n\ +2 2 Verde 10 A Verde acceso\n\ +3 3 Ciano 11 B Ciano acceso\n\ +4 4 Rosso 12 C Rosso acceso\n\ +5 5 Magenta 13 D Magenta acceso\n\ +6 6 Giallo 14 E Giallo acceso\n\ +7 7 Bianco 15 F Bianco acceso\n" STRING_COPY_HELP1, "Sovrascrivi %s (Si/No/Tutti)? " @@ -114,7 +115,7 @@ COPY [/V][/Y|/-Y][/A|/B] sorgente [/A|/B]\n\ /A Indica un file di testo ASCII.\n\ /B Indica un file binario.\n\ destinazione Indica la cartella e/o il nome di file per i nuovi/o file.\n\ - /V Verifies that new files are written correctly.\n\ + /V Verifica che i file sono stati scritti correttamente.\n\ /Y Elimina le richieste di conferma per le sovrascrittura\n\ di un file di destinazione giа esistente.\n\ /-Y Effettua le richieste di conferma per le sovrascrittura\n\ @@ -205,8 +206,8 @@ STRING_DIR_HELP6, "%16i Cartelle% 15s byte\n" STRING_DIR_HELP7, "\n Cartelle di %s\n\n" STRING_DIR_HELP8, "%16i File% 14s byte\n" -STRING_DIRSTACK_HELP1, "Salva la directory corrente per l'uso con il comando POPD, poi\n\ -cambia alla cartella indicata.\n\n\ +STRING_DIRSTACK_HELP1, "Salva la cartella corrente per l'uso con il comando POPD, poi\n\ +passa alla cartella indicata.\n\n\ PUSHD [percorso | ..]\n\n\ percorso Indica la cartella che deve diventare quella corrente\n" @@ -289,9 +290,8 @@ STRING_LABEL_HELP5, "Etichetta del disco (11 Caratteri, INVIO per nessuna)? " STRING_LOCALE_HELP1, "L'ora attuale и" -STRING_MKDIR_HELP, "Crea una directory.\n\n\ -MKDIR [disco:]percorso\n\ -MD [disco:]percorso" +STRING_MKDIR_HELP, "Crea una cartella.\n\n\ +MKDIR [disco:]percorso\nMD [disco:]percorso" STRING_MEMMORY_HELP1, "Visualizza la quantitа della memoria di sistema.\n\n\ MEMORY" @@ -311,7 +311,7 @@ STRING_MOVE_HELP1, "Sovrascrivi %s (Si/No/Tutti)? " STRING_MOVE_HELP2, "Sposta i file o cambia il nome a file e cartelle.\n\n\ Per spostare uno o piщ file:\n\ MOVE [/N][disco:][percorso]nomefile1[,...] destinazione\n\n\ -To rename a directory:\n\ +Per rinominare una cartella:\n\ MOVE [/N][disco:][percorso]]cartella1 cartella2\n\n\ [disco:][percorso]nomefile1 indica la posizione e il nome del file\n\ o dei file da spostare.\n\ @@ -395,6 +395,46 @@ STRING_REN_HELP2, " %lu file rinominato\n" STRING_REN_HELP3, " %lu files rinominati\n" +STRING_REPLACE_HELP1, "Sostituisce i file.\n\n\ +REPLACE [disco1:][percorso1]nomefile [disco2:][percorso2] [/A] [/P] [/R] [/W]\n\ +REPLACE [disco1:][percorso1]nomefile [disco2:][percorso2] [/P] [/R] [/S] [/W] [/U]\n\n\ + [drive1:][path1]nomefile Specifica il o i file sorgenti.\n\ + [disco2:][percorso2] Specifica la cartella dove i file devono essere\n\ + sostituiti.\n\ + /A Aggiunge i file alla cartella di destinazione. Non puт\n\ + essere usato con /S o /U .\n\ + /P Chiede conferma prima di sostituire o aggiungere\n\ + un file.\n\ + /R Sostituisce sia i file in sola lettura che quelli\n\ + non protetti.\n\ + /S Sostituisce i file in tutte le sottocartelle\n\ + della cartella di destinazione. Non puт essere\n\ + usato con /A .\n\ + /W Aspetta che sia inserito un disco prima di iniziare.\n\ + /U Sostituisce (aggiorna) solo i file piщ vecchi\n\ + dei file sorgenti. Non puт essere usato con /A .\n" + +STRING_REPLACE_HELP2, "Il percorso sorgente и obbligatorio\n" + +STRING_REPLACE_HELP3, "Nessun file sostituito\n" + +STRING_REPLACE_HELP4, "%lu file sostituiti\n" + +STRING_REPLACE_HELP5, "Sostituzione di %s in corso\n" + +STRING_REPLACE_HELP6, "Sostituzione di %s\n" + +STRING_REPLACE_HELP7, "Nessun file aggiunto\n" + +STRING_REPLACE_HELP8, "%lu file aggiunti\n" + +STRING_REPLACE_HELP9, "Aggiungere %s (S/N) " + +STRING_REPLACE_HELP10, "Sostituire %s (S/N) " + +STRING_REPLACE_HELP11, "Aggiunta di %s in corso\n" + + STRING_SHIFT_HELP, "Cambia la posizione dei parametri in un batch.\n\n\ SHIFT [DOWN]" @@ -490,16 +530,16 @@ STRING_VERSION_HELP7, "\nVersione ReactOS scritto da:\n" STRING_VOL_HELP1, " Il Volume del disco %c и %s\n" STRING_VOL_HELP2, " Il Volume del disco %c non ha etichetta\n" -STRING_VOL_HELP3, " Il numero diserie del Volume и %04X-%04X\n" +STRING_VOL_HELP3, " Il numero di serie del Volume и %04X-%04X\n" STRING_VOL_HELP4, "Visualizza l'etichetta del volume del disco e il numero di serie se disponibili.\n\n\ VOL [disco:]" STRING_WINDOW_HELP1, "cambia l'aspetto della finestra della console\n\n\ WINDOW [/POS[=]sinistra,alto,larghezza,altezza]\n\ [MIN|MAX|RESTORE] ['titolo']\n\n\ -/POS specify window placement and dimensions\n\ +/POS specifica la posizione e la dimensione della finestra\n\ MIN minimizza la finestra\n\ -MAX massimizzala finestra\n\ +MAX massimizza la finestra\n\ RESTORE ripristina la finestra" STRING_WINDOW_HELP2, "cambia l'aspetto della finestra della console\n\n\ @@ -508,7 +548,7 @@ ACTIVATE 'window' [/POS[=]sinistra,alto,larghezza,altezza]\n\ window finestra su cui eseguire l'azione\n\ /POS indica la posizione e la dimensione della finestra\n\ MIN minimizza la finestra\n\ -MAX massimizzala finestra\n\ +MAX massimizza la finestra\n\ RESTORE ripristina la finestra\n\ titolo il nuovo titolo\n" @@ -530,12 +570,12 @@ COPY Copia uno o pi DATE Visualizza o modifica la data.\n\ DELETE Cancella uno o piщ file.\n\ DIR Visualizza un elenco di file e sottocartelle in una cartella.\n\ -ECHO Visualizza messaggi, o abilita e disabilita la visualizzazione dei comandi.\n\ +ECHO Visualizza messaggi o abilita e disabilita la visualizzazione dei comandi.\n\ ERASE Cancella uno o piщ file.\n\ EXIT Esce dall'interprete dei comandi.\n\ FOR Esegue un comando per ognuno dei file indicati.\n\ FREE Spazio libero.\n\ -GOTO Salta a una etichettadurante l'esecuzione di un batch.\n\ +GOTO Salta a una etichetta durante l'esecuzione di un batch.\n\ HELP Fornisce informazioni sui comandi di ReactOS.\n\ HISTORY Elenco degli ultimi comandi usati\n\ IF Esegue elaborazioni condizionali in un batch.\n\ @@ -640,6 +680,14 @@ STRING_ERROR_DRIVER_NOT_READY, "Disco non pronto" STRING_PATH_ERROR, "CMD: Non nell'ambiente '%s'\n" +STRING_REPLACE_ERROR1, "Parametro non valido - %s\n" +STRING_REPLACE_ERROR2, "Percorso non trovato - %s\n" +STRING_REPLACE_ERROR3, "Il nome del file, della cartella o della etichetta di volume и errato.\n" +STRING_REPLACE_ERROR4, "Combinazione di parametri non valida\n" +STRING_REPLACE_ERROR5, "Accesso negato - %s\n" +STRING_REPLACE_ERROR6, "Nessun file trovato - %s\n" +STRING_REPLACE_ERROR7, "Errore esteso 32\n" + STRING_CMD_SHELLINFO, "\nInterprete di linea di comando di ReactOS" STRING_VERSION_RUNVER, " in esecuzione su %s" STRING_COPY_FILE , " %d file copiati\n" diff --git a/reactos/base/shell/cmd/memory.c b/reactos/base/shell/cmd/memory.c index e838f655b17..1a0a5664a2d 100644 --- a/reactos/base/shell/cmd/memory.c +++ b/reactos/base/shell/cmd/memory.c @@ -32,7 +32,7 @@ ConvertDWord (DWORD num, LPTSTR des, INT len, BOOL bSeparator) } -INT CommandMemory (LPTSTR cmd, LPTSTR param) +INT CommandMemory (LPTSTR param) { MEMORYSTATUS ms; TCHAR szMemoryLoad[20]; diff --git a/reactos/base/shell/cmd/misc.c b/reactos/base/shell/cmd/misc.c index 0a0ad75fc9f..3739cf996fa 100644 --- a/reactos/base/shell/cmd/misc.c +++ b/reactos/base/shell/cmd/misc.c @@ -411,6 +411,18 @@ LPTSTR _stpcpy (LPTSTR dest, LPCTSTR src) return (dest + _tcslen (src)); } +VOID +StripQuotes(TCHAR *in) +{ + TCHAR *out = in; + for (; *in; in++) + { + if (*in != _T('"')) + *out++ = *in; + } + *out = _T('\0'); +} + /* diff --git a/reactos/base/shell/cmd/move.c b/reactos/base/shell/cmd/move.c index dc4ec4fc684..015740514bc 100644 --- a/reactos/base/shell/cmd/move.c +++ b/reactos/base/shell/cmd/move.c @@ -83,7 +83,7 @@ void GetDirectory (LPTSTR wholepath, LPTSTR directory, BOOL CheckExisting) } -INT cmd_move (LPTSTR cmd, LPTSTR param) +INT cmd_move (LPTSTR param) { LPTSTR *arg; INT argc, i, nFiles; diff --git a/reactos/base/shell/cmd/msgbox.c b/reactos/base/shell/cmd/msgbox.c index 3e92f0ea2b5..31658e11683 100644 --- a/reactos/base/shell/cmd/msgbox.c +++ b/reactos/base/shell/cmd/msgbox.c @@ -22,7 +22,7 @@ #define _SYNTAX_CHECK -INT CommandMsgbox (LPTSTR cmd, LPTSTR param) +INT CommandMsgbox (LPTSTR param) { //used to parse command line diff --git a/reactos/base/shell/cmd/parser.c b/reactos/base/shell/cmd/parser.c new file mode 100644 index 00000000000..287110a2dfa --- /dev/null +++ b/reactos/base/shell/cmd/parser.c @@ -0,0 +1,530 @@ +#include + +#define C_OP_LOWEST C_MULTI +#define C_OP_HIGHEST C_PIPE +static const TCHAR OpString[][3] = { _T("&"), _T("||"), _T("&&"), _T("|") }; + +static const TCHAR RedirString[][3] = { _T("<"), _T(">"), _T(">>") }; + +static BOOL IsSeparator(TCHAR Char) +{ + /* These three characters act like spaces to the parser */ + return _istspace(Char) || (Char && _tcschr(_T(",;="), Char)); +} + +enum { TOK_END, TOK_NORMAL, TOK_OPERATOR, TOK_REDIRECTION, + TOK_BEGIN_BLOCK, TOK_END_BLOCK }; + +static BOOL bParseError; +static BOOL bLineContinuations; +static TCHAR ParseLine[CMDLINE_LENGTH]; +static TCHAR *ParsePos; +static TCHAR CurChar; + +static TCHAR CurrentToken[CMDLINE_LENGTH]; +static int CurrentTokenType; +static int InsideBlock; + +static TCHAR ParseChar() +{ + TCHAR Char; + + if (bParseError) + return CurChar = 0; + +restart: + /* Although CRs can be injected into a line via an environment + * variable substitution, the parser ignores them - they won't + * even separate tokens. */ + do + Char = *ParsePos++; + while (Char == _T('\r')); + + if (!Char) + { + ParsePos--; + if (bLineContinuations) + { + if (!ReadLine(ParseLine, TRUE)) + { + /* ^C pressed, or line was too long */ + bParseError = TRUE; + } + else if (*(ParsePos = ParseLine)) + { + goto restart; + } + } + } + return CurChar = Char; +} + +static void ParseError() +{ + if (CurrentTokenType == TOK_END) + ConOutResPuts(STRING_SYNTAX_COMMAND_INCORRECT); + else + ConOutPrintf(_T("%s was unexpected at this time.\n"), CurrentToken); + bParseError = TRUE; +} + +/* Yes, cmd has a Lexical Analyzer. Whenever the parser gives an "xxx was + * unexpected at this time." message, it shows what the last token read was */ +static int ParseToken(TCHAR ExtraEnd, BOOL PreserveSpace) +{ + TCHAR *Out = CurrentToken; + TCHAR Char = CurChar; + int Type; + BOOL bInQuote = FALSE; + + if (!PreserveSpace) + { + while (Char != _T('\n') && IsSeparator(Char)) + Char = ParseChar(); + } + + while (Char && Char != _T('\n')) + { + bInQuote ^= (Char == _T('"')); + if (!bInQuote) + { + /* Check for all the myriad ways in which this token + * may be brought to an untimely end. */ + if ((Char >= _T('0') && Char <= _T('9') && + (ParsePos == &ParseLine[1] || IsSeparator(ParsePos[-2])) + && (*ParsePos == _T('<') || *ParsePos == _T('>'))) + || _tcschr(_T(")&|<>") + (InsideBlock ? 0 : 1), Char) + || (!PreserveSpace && IsSeparator(Char)) + || (Char == ExtraEnd)) + { + break; + } + + if (Char == _T('^')) + { + Char = ParseChar(); + /* Eat up a \n, allowing line continuation */ + if (Char == _T('\n')) + Char = ParseChar(); + /* Next character is a forced literal */ + } + } + if (Out == &CurrentToken[CMDLINE_LENGTH - 1]) + break; + *Out++ = Char; + Char = ParseChar(); + } + + /* Check if we got at least one character before reaching a special one. + * If so, return them and leave the special for the next call. */ + if (Out != CurrentToken) + { + Type = TOK_NORMAL; + } + else if (Char == _T('(')) + { + Type = TOK_BEGIN_BLOCK; + *Out++ = Char; + ParseChar(); + } + else if (Char == _T(')')) + { + Type = TOK_END_BLOCK; + *Out++ = Char; + ParseChar(); + } + else if (Char == _T('&') || Char == _T('|')) + { + Type = TOK_OPERATOR; + *Out++ = Char; + Char = ParseChar(); + /* check for && or || */ + if (Char == Out[-1]) + { + *Out++ = Char; + ParseChar(); + } + } + else if ((Char >= _T('0') && Char <= _T('9')) + || (Char == _T('<') || Char == _T('>'))) + { + Type = TOK_REDIRECTION; + if (Char >= _T('0') && Char <= _T('9')) + { + *Out++ = Char; + Char = ParseChar(); + } + *Out++ = Char; + Char = ParseChar(); + if (Char == Out[-1]) + { + /* Strangely, the tokenizer allows << as well as >>... (it + * will cause an error when trying to parse it though) */ + *Out++ = Char; + Char = ParseChar(); + } + if (Char == _T('&')) + { + *Out++ = Char; + while (IsSeparator(Char = ParseChar())) + ; + if (Char >= _T('0') && Char <= _T('9')) + { + *Out++ = Char; + ParseChar(); + } + } + } + else + { + Type = TOK_END; + } + *Out = _T('\0'); + return CurrentTokenType = Type; +} + +static BOOL ParseRedirection(REDIRECTION **List) +{ + TCHAR *Tok = CurrentToken; + BYTE Number; + BYTE RedirType; + REDIRECTION *Redir; + + if (*Tok >= _T('0') && *Tok <= _T('9')) + Number = *Tok++ - _T('0'); + else + Number = *Tok == _T('<') ? 0 : 1; + + if (*Tok++ == _T('<')) + { + RedirType = REDIR_READ; + if (*Tok == _T('<')) + goto fail; + } + else + { + RedirType = REDIR_WRITE; + if (*Tok == _T('>')) + { + RedirType = REDIR_APPEND; + Tok++; + } + } + + if (!*Tok) + { + /* The file name was not part of this token, so it'll be the next one */ + if (ParseToken(0, FALSE) != TOK_NORMAL) + goto fail; + Tok = CurrentToken; + } + + /* If a redirection for this handle number already exists, delete it */ + while ((Redir = *List)) + { + if (Redir->Number == Number) + { + *List = Redir->Next; + cmd_free(Redir); + continue; + } + List = &Redir->Next; + } + + Redir = cmd_alloc(FIELD_OFFSET(REDIRECTION, Filename[_tcslen(Tok) + 1])); + Redir->Next = NULL; + Redir->OldHandle = INVALID_HANDLE_VALUE; + Redir->Number = Number; + Redir->Type = RedirType; + _tcscpy(Redir->Filename, Tok); + *List = Redir; + return TRUE; +fail: + ParseError(); + FreeRedirection(*List); + *List = NULL; + return FALSE; +} + +static PARSED_COMMAND *ParseCommandOp(int OpType); + +/* Parse a parenthesized block */ +static PARSED_COMMAND *ParseBlock(REDIRECTION *RedirList) +{ + PARSED_COMMAND *Cmd, *Sub, **NextPtr; + Cmd = cmd_alloc(sizeof(PARSED_COMMAND)); + Cmd->Type = C_BLOCK; + Cmd->Next = NULL; + Cmd->Subcommands = NULL; + Cmd->Redirections = RedirList; + + /* Read the block contents */ + NextPtr = &Cmd->Subcommands; + InsideBlock++; + while (1) + { + Sub = ParseCommandOp(C_OP_LOWEST); + if (Sub) + { + *NextPtr = Sub; + NextPtr = &Sub->Next; + } + else if (bParseError) + { + InsideBlock--; + FreeCommand(Cmd); + return NULL; + } + + if (CurrentTokenType == TOK_END_BLOCK) + break; + /* Skip past the \n */ + ParseChar(); + } + InsideBlock--; + + /* Process any trailing redirections */ + while (ParseToken(0, FALSE) == TOK_REDIRECTION) + { + if (!ParseRedirection(&Cmd->Redirections)) + { + FreeCommand(Cmd); + return NULL; + } + } + return Cmd; +} + +static PARSED_COMMAND *ParseCommandPart(void) +{ + TCHAR ParsedLine[CMDLINE_LENGTH]; + TCHAR *Pos; + DWORD TailOffset; + PARSED_COMMAND *Cmd; + REDIRECTION *RedirList = NULL; + int Type; + + while (IsSeparator(CurChar)) + { + if (CurChar == _T('\n')) + return NULL; + ParseChar(); + } + + if (!CurChar) + return NULL; + + if (CurChar == _T(':')) + { + /* "Ignore" the rest of the line. + * (Line continuations will still be parsed, though.) */ + while (ParseToken(0, TRUE) != TOK_END) + ; + return NULL; + } + + if (CurChar == _T('@')) + { + ParseChar(); + Cmd = cmd_alloc(sizeof(PARSED_COMMAND)); + Cmd->Type = C_QUIET; + Cmd->Next = NULL; + /* @ acts like a unary operator with low precedence, + * so call the top-level parser */ + Cmd->Subcommands = ParseCommandOp(C_OP_LOWEST); + Cmd->Redirections = NULL; + return Cmd; + } + + /* Get the head of the command */ + while (1) + { + Type = ParseToken(_T('('), FALSE); + if (Type == TOK_NORMAL) + { + Pos = _stpcpy(ParsedLine, CurrentToken); + break; + } + else if (Type == TOK_REDIRECTION) + { + if (!ParseRedirection(&RedirList)) + return NULL; + } + else if (Type == TOK_BEGIN_BLOCK) + { + return ParseBlock(RedirList); + } + else if (Type == TOK_END_BLOCK && !RedirList) + { + return NULL; + } + else + { + ParseError(); + FreeRedirection(RedirList); + return NULL; + } + } + TailOffset = Pos - ParsedLine; + + /* FIXME: FOR, IF, and REM need special processing by the parser. */ + + /* Now get the tail */ + while (1) + { + Type = ParseToken(0, TRUE); + if (Type == TOK_NORMAL) + { + if (Pos + _tcslen(CurrentToken) >= &ParsedLine[CMDLINE_LENGTH]) + { + ParseError(); + FreeRedirection(RedirList); + return NULL; + } + Pos = _stpcpy(Pos, CurrentToken); + } + else if (Type == TOK_REDIRECTION) + { + if (!ParseRedirection(&RedirList)) + return NULL; + } + else + { + break; + } + } + + Cmd = cmd_alloc(FIELD_OFFSET(PARSED_COMMAND, CommandLine[Pos + 1 - ParsedLine])); + Cmd->Type = C_COMMAND; + Cmd->Next = NULL; + Cmd->Subcommands = NULL; + Cmd->Redirections = RedirList; + _tcscpy(Cmd->CommandLine, ParsedLine); + Cmd->Tail = Cmd->CommandLine + TailOffset; + return Cmd; +} + +static PARSED_COMMAND *ParseCommandOp(int OpType) +{ + PARSED_COMMAND *Cmd, *Left, *Right; + + if (OpType == C_OP_HIGHEST) + Cmd = ParseCommandPart(); + else + Cmd = ParseCommandOp(OpType + 1); + + if (Cmd && !_tcscmp(CurrentToken, OpString[OpType - C_OP_LOWEST])) + { + Left = Cmd; + Right = ParseCommandOp(OpType); + if (!Right) + { + if (!bParseError) + { + /* & is allowed to have an empty RHS */ + if (OpType == C_MULTI) + return Left; + ParseError(); + } + FreeCommand(Left); + return NULL; + } + + Cmd = cmd_alloc(sizeof(PARSED_COMMAND)); + Cmd->Type = OpType; + Cmd->Next = NULL; + Cmd->Redirections = NULL; + Cmd->Subcommands = Left; + Left->Next = Right; + Right->Next = NULL; + } + + return Cmd; +} + +PARSED_COMMAND * +ParseCommand(LPTSTR Line) +{ + PARSED_COMMAND *Cmd; + + if (Line) + { + _tcscpy(ParseLine, Line); + bLineContinuations = FALSE; + } + else + { + if (!ReadLine(ParseLine, FALSE)) + return NULL; + bLineContinuations = TRUE; + } + bParseError = FALSE; + ParsePos = ParseLine; + CurChar = _T(' '); + + Cmd = ParseCommandOp(C_OP_LOWEST); + if (Cmd) + { + if (CurrentTokenType != TOK_END) + ParseError(); + if (bParseError) + { + FreeCommand(Cmd); + Cmd = NULL; + } + } + return Cmd; +} + +/* Reconstruct a parse tree into text form; + * used for echoing batch file commands */ +VOID +EchoCommand(PARSED_COMMAND *Cmd) +{ + PARSED_COMMAND *Sub; + REDIRECTION *Redir; + + switch (Cmd->Type) + { + case C_COMMAND: + ConOutPrintf(_T("%s"), Cmd->CommandLine); + break; + case C_QUIET: + return; + case C_BLOCK: + ConOutChar(_T('(')); + for (Sub = Cmd->Subcommands; Sub; Sub = Sub->Next) + { + EchoCommand(Sub); + ConOutChar(_T('\n')); + } + ConOutChar(_T(')')); + break; + case C_MULTI: + case C_IFFAILURE: + case C_IFSUCCESS: + case C_PIPE: + Sub = Cmd->Subcommands; + EchoCommand(Sub); + ConOutPrintf(_T(" %s "), OpString[Cmd->Type - C_OP_LOWEST]); + EchoCommand(Sub->Next); + break; + } + + for (Redir = Cmd->Redirections; Redir; Redir = Redir->Next) + { + ConOutPrintf(_T(" %c%s%s"), _T('0') + Redir->Number, + RedirString[Redir->Type], Redir->Filename); + } +} + +VOID +FreeCommand(PARSED_COMMAND *Cmd) +{ + if (Cmd->Subcommands) + FreeCommand(Cmd->Subcommands); + if (Cmd->Next) + FreeCommand(Cmd->Next); + FreeRedirection(Cmd->Redirections); + cmd_free(Cmd); +} diff --git a/reactos/base/shell/cmd/path.c b/reactos/base/shell/cmd/path.c index fc112d17b63..68a5c920351 100644 --- a/reactos/base/shell/cmd/path.c +++ b/reactos/base/shell/cmd/path.c @@ -33,7 +33,7 @@ #define ENV_BUFFER_SIZE 1024 -INT cmd_path (LPTSTR cmd, LPTSTR param) +INT cmd_path (LPTSTR param) { if (!_tcsncmp (param, _T("/?"), 2)) diff --git a/reactos/base/shell/cmd/pause.c b/reactos/base/shell/cmd/pause.c index 6c77b258a44..fc56c1399d8 100644 --- a/reactos/base/shell/cmd/pause.c +++ b/reactos/base/shell/cmd/pause.c @@ -34,10 +34,10 @@ * Remove all hardcode string to En.rc */ -INT cmd_pause (LPTSTR cmd, LPTSTR param) +INT cmd_pause (LPTSTR param) { - TRACE ("cmd_pause: \'%s\' : \'%s\')\n", debugstr_aw(cmd), debugstr_aw(param)); + TRACE ("cmd_pause: \'%s\')\n", debugstr_aw(param)); if (!_tcsncmp (param, _T("/?"), 2)) { diff --git a/reactos/base/shell/cmd/prompt.c b/reactos/base/shell/cmd/prompt.c index 399446c0c00..81e9d17764f 100644 --- a/reactos/base/shell/cmd/prompt.c +++ b/reactos/base/shell/cmd/prompt.c @@ -190,7 +190,7 @@ VOID PrintPrompt(VOID) #ifdef INCLUDE_CMD_PROMPT -INT cmd_prompt (LPTSTR cmd, LPTSTR param) +INT cmd_prompt (LPTSTR param) { if (!_tcsncmp (param, _T("/?"), 2)) { diff --git a/reactos/base/shell/cmd/redir.c b/reactos/base/shell/cmd/redir.c index 0d476e4ed2f..a550c055b52 100644 --- a/reactos/base/shell/cmd/redir.c +++ b/reactos/base/shell/cmd/redir.c @@ -30,250 +30,124 @@ #ifdef FEATURE_REDIRECTION -static BOOL -IsRedirection (TCHAR c) +/* cmd allows redirection of handles numbered 3-9 even though these don't + * correspond to any STD_ constant. */ +static HANDLE ExtraHandles[10 - 3]; + +static HANDLE GetHandle(UINT Number) { - return (c == _T('<')) || (c == _T('>')) || (c == _T('|')); + if (Number < 3) + return GetStdHandle(STD_INPUT_HANDLE - Number); + else + return ExtraHandles[Number - 3]; } - -/* - * Gets the redirection info from the command line and copies the - * file names into ifn, ofn and efn removing them from the command - * line. - * - * Converts remaining command line into a series of null terminated - * strings defined by the pipe char '|'. Each string corresponds - * to a single executable command. A double null terminates the - * command strings. - * - * Return number of command strings found. - * - */ - -INT GetRedirection (LPTSTR s, LPTSTR ifn, LPTSTR ofn, LPTSTR efn, LPINT lpnFlags) +static VOID SetHandle(UINT Number, HANDLE Handle) { - INT num = 1; - LPTSTR dp = s; - LPTSTR sp = s; + if (Number < 3) + SetStdHandle(STD_INPUT_HANDLE - Number, Handle); + else + ExtraHandles[Number - 3] = Handle; +} -#ifdef INCLUDE_CMD_REM +BOOL +PerformRedirection(REDIRECTION *RedirList) +{ + REDIRECTION *Redir; + TCHAR Filename[MAX_PATH]; + HANDLE hNew; + UINT DupNumber; + static SECURITY_ATTRIBUTES SecAttr = { sizeof(SECURITY_ATTRIBUTES), NULL, TRUE }; - TCHAR * line = s; + /* Some parameters used for read, write, and append, respectively */ + static const DWORD dwAccess[] = { + GENERIC_READ, + GENERIC_WRITE, + GENERIC_WRITE + }; + static const DWORD dwShareMode[] = { + FILE_SHARE_READ | FILE_SHARE_WRITE, + FILE_SHARE_READ, + FILE_SHARE_READ + }; + static const DWORD dwCreationDisposition[] = { + OPEN_EXISTING, + CREATE_ALWAYS, + OPEN_ALWAYS + }; - - while (_istspace (*line)) - line++; - - /*first thing first. check to see if this is "rem" and hope out*/ - if(!_tcsncmp (line, _T("rem "), 4)) + for (Redir = RedirList; Redir; Redir = Redir->Next) { - lpnFlags = 0; - *ifn=('\0'); - *ofn=('\0'); - *efn=_T('\0'); - return 1; - } -#endif - /* find and remove all the redirections first */ - while (*sp) - { - if (*sp == _T('^')) + *Filename = _T('\0'); + _tcsncat(Filename, Redir->Filename, MAX_PATH - 1); + StripQuotes(Filename); + + if (*Filename == _T('&')) { - *dp++ = *sp++; - *dp++ = *sp++; - continue; - } - if ((*sp == _T('"')) || (*sp == _T('\''))) - { - /* No redirects inside quotes */ - TCHAR qc = *sp; - - do - *dp++ = *sp++; - while (*sp && *sp != qc); - - *dp++ = *sp++; - } - else if ((*sp == _T('<')) || (*sp == _T('>')) || - (*sp == _T('1')) || (*sp == _T('2')) || (*sp == _T('&'))) - { - /* MS-DOS ignores multiple redirection symbols and uses the last */ - /* redirection, so we'll emulate that and not check */ - - if (*sp == _T('<')) + DupNumber = Filename[1] - _T('0'); + if (DupNumber >= 10 || + !DuplicateHandle(GetCurrentProcess(), + GetHandle(DupNumber), + GetCurrentProcess(), + &hNew, + 0, + TRUE, + DUPLICATE_SAME_ACCESS)) { - /* input redirection */ - *lpnFlags |= INPUT_REDIRECTION; - do sp++; - while( _istspace (*sp) ); - - /* copy file name */ - while (*sp && !IsRedirection (*sp) && !_istspace (*sp)) - *ifn++ = *sp++; - *ifn = _T('\0'); - } - else if (*sp == _T('>')) - { - /* output redirection */ - *lpnFlags |= OUTPUT_REDIRECTION; - sp++; - - /* append request ? */ - if (*sp == _T('>')) - { - *lpnFlags |= OUTPUT_APPEND; - sp++; - } - - while (_istspace (*sp)) - sp++; - - /* copy file name */ - while (*sp && !IsRedirection (*sp) && !_istspace (*sp)) - *ofn++ = *sp++; - *ofn = _T('\0'); - } - - else if (*sp == _T('1')) - { - /* output redirection */ - sp++; - - if (*sp == _T('>')) - { - /* output redirection */ - *lpnFlags |= OUTPUT_REDIRECTION; - sp++; - - /* append request ? */ - if (*sp == _T('>')) - { - *lpnFlags |= OUTPUT_APPEND; - sp++; - } - } - else - { - /* no redirection!! copy the '1' character! */ - sp--; - *dp++ = *sp++; - continue; - } - - while (_istspace (*sp)) - sp++; - - /* copy file name */ - while (*sp && !IsRedirection (*sp) && !_istspace (*sp)) - *ofn++ = *sp++; - *ofn = _T('\0'); - } - - else if (*sp == _T('2')) - { - /* error redirection */ - sp++; - - if (*sp == _T('>')) - { - *lpnFlags |= ERROR_REDIRECTION; - sp++; - - /* append request ? */ - if (*sp == _T('>')) - { - *lpnFlags |= ERROR_APPEND; - sp++; - } - } - else - { - /* no redirection!! copy the '2' character! */ - sp--; - *dp++ = *sp++; - continue; - } - - while (_istspace (*sp)) - sp++; - - /* copy file name */ - while (*sp && !IsRedirection (*sp) && !_istspace (*sp)) - *efn++ = *sp++; - *efn = _T('\0'); - } - else if (*sp == _T('&')) - { - /* output AND error redirection */ - sp++; - - if (*sp == _T('>')) - { - *lpnFlags |= (ERROR_REDIRECTION | OUTPUT_REDIRECTION); - sp++; - - /* append request ? */ - if (*sp == _T('>')) - { - *lpnFlags |= (ERROR_APPEND | OUTPUT_APPEND); - sp++; - } - } - else - { - /* no redirection!! copy the '&' character! */ - sp--; - *dp++ = *sp++; - continue; - } - - while (_istspace (*sp)) - sp++; - - /* copy file name */ - while (*sp && !IsRedirection (*sp) && !_istspace (*sp)) - *ofn++ = *efn++ = *sp++; - *ofn = *efn = _T('\0'); + hNew = INVALID_HANDLE_VALUE; } } else - *dp++ = *sp++; + { + hNew = CreateFile(Filename, + dwAccess[Redir->Type], + dwShareMode[Redir->Type], + &SecAttr, + dwCreationDisposition[Redir->Type], + 0, + NULL); + } + + if (hNew == INVALID_HANDLE_VALUE) + { + ConErrResPrintf(Redir->Type == REDIR_READ ? STRING_CMD_ERROR1 : STRING_CMD_ERROR3, + Filename); + /* Undo all the redirections before this one */ + UndoRedirection(RedirList, Redir); + return FALSE; + } + + if (Redir->Type == REDIR_APPEND) + SetFilePointer(hNew, 0, NULL, FILE_END); + Redir->OldHandle = GetHandle(Redir->Number); + SetHandle(Redir->Number, hNew); + + TRACE("%d redirected to: %s\n", Redir->Number, debugstr_aw(Filename)); } + return TRUE; +} - *dp++ = _T('\0'); - *dp = _T('\0'); - - /* now go for the pipes */ - sp = s; - while (*sp) +VOID +UndoRedirection(REDIRECTION *Redir, REDIRECTION *End) +{ + for (; Redir != End; Redir = Redir->Next) { - if (*sp == _T('^')) - { - sp++; - sp++; - continue; - } - else if ((*sp == _T('"')) || (*sp == _T('\''))) - { - TCHAR qc = *sp; - - do - sp++; - while (*sp && *sp != qc); - - sp++; - } - else if (*sp == _T('|')) - { - *sp++ = _T('\0'); - num++; - } - else - sp++; + CloseHandle(GetHandle(Redir->Number)); + SetHandle(Redir->Number, Redir->OldHandle); + Redir->OldHandle = INVALID_HANDLE_VALUE; } +} - return num; +VOID +FreeRedirection(REDIRECTION *Redir) +{ + REDIRECTION *Next; + for (; Redir; Redir = Next) + { + Next = Redir->Next; + ASSERT(Redir->OldHandle == INVALID_HANDLE_VALUE); + cmd_free(Redir); + } } #endif /* FEATURE_REDIRECTION */ diff --git a/reactos/base/shell/cmd/ren.c b/reactos/base/shell/cmd/ren.c index fb1267c533e..ad1e1de7977 100644 --- a/reactos/base/shell/cmd/ren.c +++ b/reactos/base/shell/cmd/ren.c @@ -40,7 +40,7 @@ enum * file rename internal command. * */ -INT cmd_rename (LPTSTR cmd, LPTSTR param) +INT cmd_rename (LPTSTR param) { LPTSTR *arg = NULL; INT args = 0; diff --git a/reactos/base/shell/cmd/replace.c b/reactos/base/shell/cmd/replace.c index 3c8e6c2c72a..dd3c168ae0d 100644 --- a/reactos/base/shell/cmd/replace.c +++ b/reactos/base/shell/cmd/replace.c @@ -358,7 +358,7 @@ INT recFindSubDirs(DWORD dwFlags, return filesReplaced; } -INT cmd_replace (LPTSTR cmd, LPTSTR param) +INT cmd_replace (LPTSTR param) { LPTSTR *arg; INT argc, i,filesReplaced = 0, nFiles, srcIndex = -1, destIndex = -1; diff --git a/reactos/base/shell/cmd/screen.c b/reactos/base/shell/cmd/screen.c index d3c08990f04..26e66a19f54 100644 --- a/reactos/base/shell/cmd/screen.c +++ b/reactos/base/shell/cmd/screen.c @@ -16,7 +16,7 @@ #ifdef INCLUDE_CMD_SCREEN -INT CommandScreen (LPTSTR cmd, LPTSTR param) +INT CommandScreen (LPTSTR param) { SHORT x,y; BOOL bSkipText = FALSE; diff --git a/reactos/base/shell/cmd/set.c b/reactos/base/shell/cmd/set.c index 07cb8c25c23..115b837787e 100644 --- a/reactos/base/shell/cmd/set.c +++ b/reactos/base/shell/cmd/set.c @@ -48,13 +48,33 @@ seta_eval ( LPCTSTR expr ); static LPCTSTR skip_ws ( LPCTSTR p ) { - return p + _tcsspn ( p, _T(" \t") ); + while (*p && *p <= _T(' ')) + p++; + return p; } -INT cmd_set (LPTSTR cmd, LPTSTR param) +/* Used to check for and handle: + * SET "var=value", SET /P "var=prompt", and SET /P var="prompt" */ +static LPTSTR +GetQuotedString(TCHAR *p) +{ + TCHAR *end; + if (*p == _T('"')) + { + p = (LPTSTR)skip_ws(p + 1); + /* If a matching quote is found, truncate the string */ + end = _tcsrchr(p, _T('"')); + if (end) + *end = _T('\0'); + } + return p; +} + +INT cmd_set (LPTSTR param) { - INT i; LPTSTR p; + LPTSTR lpEnv; + LPTSTR lpOutput; if ( !_tcsncmp (param, _T("/?"), 2) ) { @@ -62,35 +82,20 @@ INT cmd_set (LPTSTR cmd, LPTSTR param) return 0; } - /* remove escapes */ - if ( param[0] ) for ( i = 0; param[i+1]; i++ ) - { - if ( param[i] == _T('^') ) - { - memmove ( ¶m[i], ¶m[i+1], _tcslen(¶m[i]) * sizeof(TCHAR) ); - } - } + param = (LPTSTR)skip_ws(param); /* if no parameters, show the environment */ if (param[0] == _T('\0')) { - LPTSTR lpEnv; - LPTSTR lpOutput; - INT len; - lpEnv = (LPTSTR)GetEnvironmentStrings (); if (lpEnv) { lpOutput = lpEnv; while (*lpOutput) { - len = _tcslen(lpOutput); - if (len) - { - if (*lpOutput != _T('=')) - ConOutPuts (lpOutput); - lpOutput += (len + 1); - } + if (*lpOutput != _T('=')) + ConOutPuts(lpOutput); + lpOutput += _tcslen(lpOutput) + 1; } FreeEnvironmentStrings (lpEnv); } @@ -107,16 +112,35 @@ INT cmd_set (LPTSTR cmd, LPTSTR param) /*might seem random but this is what windows xp does */ nErrorLevel = 9165; } - /* TODO FIXME - what are we supposed to return? */ - return Success; + return !Success; } - if ( !_tcsnicmp (param, _T("/"), 1) ) + if (!_tcsnicmp(param, _T("/P"), 2)) { - ConErrResPrintf (STRING_SYNTAX_COMMAND_INCORRECT, param); + TCHAR value[1023]; + param = GetQuotedString((LPTSTR)skip_ws(param + 2)); + p = _tcschr(param, _T('=')); + if (!p) + { + ConErrResPuts(STRING_SYNTAX_COMMAND_INCORRECT); + nErrorLevel = 1; + return 1; + } + + *p++ = _T('\0'); + ConOutPrintf(_T("%s"), GetQuotedString(p)); + ConInString(value, 1023); + + if (!*value || !SetEnvironmentVariable(param, value)) + { + nErrorLevel = 1; + return 1; + } return 0; } + param = GetQuotedString(param); + p = _tcschr (param, _T('=')); if (p) { @@ -124,41 +148,53 @@ INT cmd_set (LPTSTR cmd, LPTSTR param) if (p == param) { /* handle set =val case */ - ConErrResPrintf (STRING_SYNTAX_COMMAND_INCORRECT, param); - return 0; + ConErrResPuts(STRING_SYNTAX_COMMAND_INCORRECT); + nErrorLevel = 1; + return 1; } - *p = _T('\0'); - p++; - if (*p == _T('\0')) + *p++ = _T('\0'); + if (!SetEnvironmentVariable(param, *p ? p : NULL)) { - p = NULL; + nErrorLevel = 1; + return 1; } - SetEnvironmentVariable (param, p); } else { - /* display environment variable */ - LPTSTR pszBuffer; - DWORD dwBuffer; + /* display all environment variable with the given prefix */ + BOOL bFound = FALSE; - pszBuffer = (LPTSTR)cmd_alloc (ENV_BUFFER_SIZE * sizeof(TCHAR)); - dwBuffer = GetEnvironmentVariable (param, pszBuffer, ENV_BUFFER_SIZE); - if (dwBuffer == 0) + while (_istspace(*param) || *param == _T(',') || *param == _T(';')) + param++; + + p = _tcsrchr(param, _T(' ')); + if (!p) + p = param + _tcslen(param); + *p = _T('\0'); + + lpEnv = GetEnvironmentStrings(); + if (lpEnv) + { + lpOutput = lpEnv; + while (*lpOutput) + { + if (!_tcsnicmp(lpOutput, param, p - param)) + { + ConOutPuts(lpOutput); + bFound = TRUE; + } + lpOutput += _tcslen(lpOutput) + 1; + } + FreeEnvironmentStrings(lpEnv); + } + + if (!bFound) { ConErrResPrintf (STRING_PATH_ERROR, param); - return 0; + nErrorLevel = 1; + return 1; } - else if (dwBuffer > ENV_BUFFER_SIZE) - { - pszBuffer = (LPTSTR)cmd_realloc (pszBuffer, dwBuffer * sizeof (TCHAR)); - GetEnvironmentVariable (param, pszBuffer, dwBuffer); - } - ConOutPrintf (_T("%s\n"), pszBuffer); - - cmd_free (pszBuffer); - - return 0; } return 0; diff --git a/reactos/base/shell/cmd/setlocal.c b/reactos/base/shell/cmd/setlocal.c index d939d0c53ed..4bf5022f47c 100644 --- a/reactos/base/shell/cmd/setlocal.c +++ b/reactos/base/shell/cmd/setlocal.c @@ -14,13 +14,13 @@ /* our current default is delayedexpansion */ -INT cmd_setlocal (LPTSTR cmd, LPTSTR param) +INT cmd_setlocal (LPTSTR param) { return 0; } /* endlocal doesn't take any params */ -INT cmd_endlocal (LPTSTR cmd, LPTSTR param) +INT cmd_endlocal (LPTSTR param) { return 0; } diff --git a/reactos/base/shell/cmd/shift.c b/reactos/base/shell/cmd/shift.c index 142a8fc53d3..8e97452546f 100644 --- a/reactos/base/shell/cmd/shift.c +++ b/reactos/base/shell/cmd/shift.c @@ -36,10 +36,10 @@ * */ -INT cmd_shift (LPTSTR cmd, LPTSTR param) +INT cmd_shift (LPTSTR param) { - TRACE ("cmd_shift: (\'%s\', \'%s\')\n", debugstr_aw(cmd), debugstr_aw(param)); + TRACE ("cmd_shift: (\'%s\')\n", debugstr_aw(param)); if (!_tcsncmp (param, _T("/?"), 2)) { diff --git a/reactos/base/shell/cmd/start.c b/reactos/base/shell/cmd/start.c index 5532c542268..dc680352c7c 100644 --- a/reactos/base/shell/cmd/start.c +++ b/reactos/base/shell/cmd/start.c @@ -34,18 +34,7 @@ static TCHAR *GetParameter(TCHAR **pPointer) return start - 1; } -static void StripQuotes(TCHAR *in) -{ - TCHAR *out = in; - for (; *in; in++) - { - if (*in != _T('"')) - *out++ = *in; - } - *out = _T('\0'); -} - -INT cmd_start (LPTSTR First, LPTSTR Rest) +INT cmd_start (LPTSTR Rest) { TCHAR szFullName[CMDLINE_LENGTH]; TCHAR rest[CMDLINE_LENGTH]; diff --git a/reactos/base/shell/cmd/time.c b/reactos/base/shell/cmd/time.c index b62f6417c97..00cbd7cf657 100644 --- a/reactos/base/shell/cmd/time.c +++ b/reactos/base/shell/cmd/time.c @@ -129,7 +129,7 @@ static BOOL ParseTime (LPTSTR s) } -INT cmd_time (LPTSTR cmd, LPTSTR param) +INT cmd_time (LPTSTR param) { LPTSTR *arg; INT argc; diff --git a/reactos/base/shell/cmd/timer.c b/reactos/base/shell/cmd/timer.c index db9c5096eaa..f189509d353 100644 --- a/reactos/base/shell/cmd/timer.c +++ b/reactos/base/shell/cmd/timer.c @@ -60,7 +60,7 @@ PrintElapsedTime (DWORD time,INT format) } -INT CommandTimer (LPTSTR cmd, LPTSTR param) +INT CommandTimer (LPTSTR param) { // all timers are kept static DWORD clksT[10]; diff --git a/reactos/base/shell/cmd/title.c b/reactos/base/shell/cmd/title.c index 7f56fd63485..5e1199fdeb0 100644 --- a/reactos/base/shell/cmd/title.c +++ b/reactos/base/shell/cmd/title.c @@ -14,7 +14,7 @@ #ifdef INCLUDE_CMD_TITLE -INT cmd_title (LPTSTR cmd, LPTSTR param) +INT cmd_title (LPTSTR param) { /* Do nothing if no args */ diff --git a/reactos/base/shell/cmd/type.c b/reactos/base/shell/cmd/type.c index 05ccc7b26f5..dd38a044206 100644 --- a/reactos/base/shell/cmd/type.c +++ b/reactos/base/shell/cmd/type.c @@ -31,7 +31,7 @@ #ifdef INCLUDE_CMD_TYPE -INT cmd_type (LPTSTR cmd, LPTSTR param) +INT cmd_type (LPTSTR param) { TCHAR buff[256]; HANDLE hFile, hConsoleOut; @@ -106,7 +106,7 @@ INT cmd_type (LPTSTR cmd, LPTSTR param) { if(bRet) { - if (ConOutPrintfPaging(bFirstTime, buff) == 1) + if (ConOutPrintfPaging(bFirstTime, _T("%s"), buff) == 1) { bCtrlBreak = FALSE; return 0; @@ -116,7 +116,7 @@ INT cmd_type (LPTSTR cmd, LPTSTR param) else { if(bRet) - ConOutPrintf(buff); + ConOutPrintf(_T("%s"), buff); } bFirstTime = FALSE; diff --git a/reactos/base/shell/cmd/ver.c b/reactos/base/shell/cmd/ver.c index 74f3c63b280..55cbd25da8e 100644 --- a/reactos/base/shell/cmd/ver.c +++ b/reactos/base/shell/cmd/ver.c @@ -57,7 +57,7 @@ VOID ShortVersion (VOID) * * */ -INT cmd_ver (LPTSTR cmd, LPTSTR param) +INT cmd_ver (LPTSTR param) { INT i; diff --git a/reactos/base/shell/cmd/verify.c b/reactos/base/shell/cmd/verify.c index af965cbdeab..dba702ea6e1 100644 --- a/reactos/base/shell/cmd/verify.c +++ b/reactos/base/shell/cmd/verify.c @@ -27,7 +27,7 @@ static BOOL bVerify = FALSE; -INT cmd_verify (LPTSTR cmd, LPTSTR param) +INT cmd_verify (LPTSTR param) { if (!_tcsncmp (param, _T("/?"), 2)) { diff --git a/reactos/base/shell/cmd/vol.c b/reactos/base/shell/cmd/vol.c index 7c1b23731ea..0402df8a43a 100644 --- a/reactos/base/shell/cmd/vol.c +++ b/reactos/base/shell/cmd/vol.c @@ -61,7 +61,7 @@ PrintVolumeHeader (LPTSTR pszRootPath) } -INT cmd_vol (LPTSTR cmd, LPTSTR param) +INT cmd_vol (LPTSTR param) { TCHAR szRootPath[] = _T("A:\\"); TCHAR szPath[MAX_PATH]; diff --git a/reactos/base/shell/cmd/window.c b/reactos/base/shell/cmd/window.c index a507504de8c..1fa23da30bc 100644 --- a/reactos/base/shell/cmd/window.c +++ b/reactos/base/shell/cmd/window.c @@ -173,7 +173,7 @@ static INT ServiceActivate (LPTSTR param, HWND hWnd) -INT CommandWindow (LPTSTR cmd, LPTSTR param) +INT CommandWindow (LPTSTR param) { HWND hwnd; @@ -189,7 +189,7 @@ INT CommandWindow (LPTSTR cmd, LPTSTR param) } -INT CommandActivate (LPTSTR cmd, LPTSTR param) +INT CommandActivate (LPTSTR param) { HWND hwnd; LPTSTR *arg; diff --git a/reactos/base/shell/explorer/utility/xmlstorage.cpp b/reactos/base/shell/explorer/utility/xmlstorage.cpp index 3dba1ba0fbf..b1a18ad6c63 100644 --- a/reactos/base/shell/explorer/utility/xmlstorage.cpp +++ b/reactos/base/shell/explorer/utility/xmlstorage.cpp @@ -666,9 +666,10 @@ const char* get_xmlsym_end_utf8(const char* p) for(; *p; ++p) { char c = *p; + // NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender if (c == '\xC3') // UTF-8 escape character ++p; //TODO only continue on umlaut characters - else if (!isalnum(c) && c!='_' && c!='-') + else if (!isalnum(c) && c!='.' && c!='-' && c!='_' && c!=':') break; } diff --git a/reactos/base/system/bootok/bootok.c b/reactos/base/system/bootok/bootok.c new file mode 100644 index 00000000000..f9aec2c9fe3 --- /dev/null +++ b/reactos/base/system/bootok/bootok.c @@ -0,0 +1,31 @@ +/* + * PROJECT: ReactOS Kernel + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/system/bootok/bootok.c + * PURPOSE: Boot Acceptance Application + * PROGRAMMERS: Eric Kohl + */ + +/* INCLUDES *****************************************************************/ + +#include +#include +#define WIN32_NO_STATUS +#include + +/* FUNCTIONS ****************************************************************/ + +int +_tmain(int argc, TCHAR *argv[]) +{ + UNREFERENCED_PARAMETER(argc); + UNREFERENCED_PARAMETER(argv); + + if (!NotifyBootConfigStatus(TRUE)) + { + _tprintf(_T("NotifyBootConfigStatus failed! (Error: %lu)\n"), + GetLastError()); + } + + return 0; +} diff --git a/reactos/base/system/bootok/bootok.rbuild b/reactos/base/system/bootok/bootok.rbuild new file mode 100644 index 00000000000..317b31d6112 --- /dev/null +++ b/reactos/base/system/bootok/bootok.rbuild @@ -0,0 +1,12 @@ + + + + . + 0x600 + 0x0500 + 0x0600 + kernel32 + advapi32 + bootok.c + bootok.rc + diff --git a/reactos/base/system/bootok/bootok.rc b/reactos/base/system/bootok/bootok.rc new file mode 100644 index 00000000000..c86155f6bc9 --- /dev/null +++ b/reactos/base/system/bootok/bootok.rc @@ -0,0 +1,4 @@ +#define REACTOS_STR_FILE_DESCRIPTION "Boot Acceptance Application for Registry\0" +#define REACTOS_STR_INTERNAL_NAME "bootok\0" +#define REACTOS_STR_ORIGINAL_FILENAME "bootok.exe\0" +#include diff --git a/reactos/base/system/services/database.c b/reactos/base/system/services/database.c index 9291b7ef3b7..3fd38d94ae6 100644 --- a/reactos/base/system/services/database.c +++ b/reactos/base/system/services/database.c @@ -172,10 +172,11 @@ ScmCreateNewServiceRecord(LPWSTR lpServiceName, /* Set the resume count */ lpService->dwResumeCount = dwResumeCount++; - /* Append service entry */ + /* Append service record */ InsertTailList(&ServiceListHead, &lpService->ServiceListEntry); + /* Initialize the service status */ lpService->Status.dwCurrentState = SERVICE_STOPPED; lpService->Status.dwControlsAccepted = 0; lpService->Status.dwWin32ExitCode = ERROR_SERVICE_NEVER_STARTED; @@ -187,6 +188,42 @@ ScmCreateNewServiceRecord(LPWSTR lpServiceName, } +VOID +ScmDeleteServiceRecord(PSERVICE lpService) +{ + DPRINT1("Deleting Service %S\n", lpService->lpServiceName); + + /* Delete the display name */ + if (lpService->lpDisplayName != NULL && + lpService->lpDisplayName != lpService->lpServiceName) + HeapFree(GetProcessHeap(), 0, lpService->lpDisplayName); + + /* Decrement the image reference counter */ + if (lpService->lpImage) + lpService->lpImage->dwServiceRefCount--; + + /* Decrement the group reference counter */ + if (lpService->lpGroup) + lpService->lpGroup->dwRefCount--; + + /* FIXME: SecurityDescriptor */ + + /* Close the control pipe */ + if (lpService->ControlPipeHandle != INVALID_HANDLE_VALUE) + CloseHandle(lpService->ControlPipeHandle); + + /* Remove the Service from the List */ + RemoveEntryList(&lpService->ServiceListEntry); + + DPRINT1("Deleted Service %S\n", lpService->lpServiceName); + + /* Delete the service record */ + HeapFree(GetProcessHeap(), 0, lpService); + + DPRINT1("Done\n"); +} + + static DWORD CreateServiceListEntry(LPWSTR lpServiceName, HKEY hServiceKey) @@ -859,8 +896,8 @@ ScmStartUserModeService(PSERVICE Service, StartupInfo.cbReserved2 = 0; StartupInfo.lpReserved2 = 0; - Result = CreateProcessW(ImagePath.Buffer, - NULL, + Result = CreateProcessW(NULL, + ImagePath.Buffer, NULL, NULL, FALSE, diff --git a/reactos/base/system/services/rpcserver.c b/reactos/base/system/services/rpcserver.c index 92be3aa5a1c..5e11db39dd8 100644 --- a/reactos/base/system/services/rpcserver.c +++ b/reactos/base/system/services/rpcserver.c @@ -6,7 +6,6 @@ * COPYRIGHT: Copyright 2005-2006 Eric Kohl * Copyright 2006-2007 Hervй Poussineau * Copyright 2007 Ged Murphy - * */ /* INCLUDES ****************************************************************/ @@ -152,6 +151,17 @@ ScmCreateManagerHandle(LPWSTR lpDatabaseName, if (lpDatabaseName == NULL) lpDatabaseName = SERVICES_ACTIVE_DATABASEW; + if (wcsicmp(lpDatabaseName,SERVICES_FAILED_DATABASEW)==0) + { + DPRINT1("Database %S, does not exist\n",lpDatabaseName); + return ERROR_DATABASE_DOES_NOT_EXIST; + } + else if (wcsicmp(lpDatabaseName, SERVICES_ACTIVE_DATABASEW) != 0) + { + DPRINT1("Invalid Database name %S.\n",lpDatabaseName); + return ERROR_INVALID_NAME; + } + Ptr = (MANAGER_HANDLE*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MANAGER_HANDLE) + wcslen(lpDatabaseName) * sizeof(WCHAR)); @@ -235,12 +245,171 @@ ScmAssignNewTag(PSERVICE lpService) } +/* Internal recursive function */ +/* Need to search for every dependency on every service */ +static DWORD +Int_EnumDependentServicesW(HKEY hServicesKey, + PSERVICE lpService, + DWORD dwServiceState, + PSERVICE *lpServices, + LPDWORD pcbBytesNeeded, + LPDWORD lpServicesReturned) +{ + DWORD dwError = ERROR_SUCCESS; + WCHAR szNameBuf[MAX_PATH]; + WCHAR szValueBuf[MAX_PATH]; + WCHAR *lpszNameBuf = szNameBuf; + WCHAR *lpszValueBuf = szValueBuf; + DWORD dwSize; + DWORD dwNumSubKeys; + DWORD dwIteration; + PSERVICE lpCurrentService; + HKEY hServiceEnumKey; + DWORD dwCurrentServiceState = SERVICE_ACTIVE; + DWORD dwDependServiceStrPtr = 0; + DWORD dwRequiredSize = 0; + + /* Get the number of service keys */ + dwError = RegQueryInfoKeyW(hServicesKey, + NULL, + NULL, + NULL, + &dwNumSubKeys, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL); + if (dwError != ERROR_SUCCESS) + { + DPRINT1("ERROR! Unable to get number of services keys.\n"); + return dwError; + } + + /* Iterate the service keys to see if another service depends on the this service */ + for (dwIteration = 0; dwIteration < dwNumSubKeys; dwIteration++) + { + dwSize = MAX_PATH; + dwError = RegEnumKeyExW(hServicesKey, + dwIteration, + lpszNameBuf, + &dwSize, + NULL, + NULL, + NULL, + NULL); + if (dwError != ERROR_SUCCESS) + return dwError; + + /* Open the Service key */ + dwError = RegOpenKeyExW(hServicesKey, + lpszNameBuf, + 0, + KEY_READ, + &hServiceEnumKey); + if (dwError != ERROR_SUCCESS) + return dwError; + + dwSize = MAX_PATH; + + /* Check for the DependOnService Value */ + dwError = RegQueryValueExW(hServiceEnumKey, + L"DependOnService", + NULL, + NULL, + (LPBYTE)lpszValueBuf, + &dwSize); + + /* FIXME: Handle load order. */ + + /* If the service found has a DependOnService value */ + if (dwError == ERROR_SUCCESS) + { + dwDependServiceStrPtr = 0; + + /* Can be more than one Dependencies in the DependOnService string */ + while (wcslen(lpszValueBuf + dwDependServiceStrPtr) > 0) + { + if (wcsicmp(lpszValueBuf + dwDependServiceStrPtr, lpService->lpServiceName) == 0) + { + /* Get the current enumed service pointer */ + lpCurrentService = ScmGetServiceEntryByName(lpszNameBuf); + + /* Check for valid Service */ + if (!lpCurrentService) + { + /* This should never happen! */ + DPRINT1("This should not happen at this point, report to Developer\n"); + return ERROR_NOT_FOUND; + } + + /* Determine state the service is in */ + if (lpCurrentService->Status.dwCurrentState == SERVICE_STOPPED) + dwCurrentServiceState = SERVICE_INACTIVE; + + /* If the ServiceState matches that requested or searching for SERVICE_STATE_ALL */ + if ((dwCurrentServiceState == dwServiceState) || + (dwServiceState == SERVICE_STATE_ALL)) + { + /* Calculate the required size */ + dwRequiredSize += sizeof(SERVICE_STATUS); + dwRequiredSize += ((wcslen(lpCurrentService->lpServiceName) + 1) * sizeof(WCHAR)); + dwRequiredSize += ((wcslen(lpCurrentService->lpDisplayName) + 1) * sizeof(WCHAR)); + + /* Add the size for service name and display name pointers */ + dwRequiredSize += (2 * sizeof(PVOID)); + + /* increase the BytesNeeded size */ + *pcbBytesNeeded = *pcbBytesNeeded + dwRequiredSize; + + /* Don't fill callers buffer yet, as MSDN read that the last service with dependency + comes first */ + + /* Recursive call to check for its dependencies */ + Int_EnumDependentServicesW(hServicesKey, + lpCurrentService, + dwServiceState, + lpServices, + pcbBytesNeeded, + lpServicesReturned); + + /* If the lpServices is valid set the service pointer */ + if (lpServices) + lpServices[*lpServicesReturned] = lpCurrentService; + + *lpServicesReturned = *lpServicesReturned + 1; + } + } + + dwDependServiceStrPtr += (wcslen(lpszValueBuf + dwDependServiceStrPtr) + 1); + } + } + else if (*pcbBytesNeeded) + { + dwError = ERROR_SUCCESS; + } + + RegCloseKey(hServiceEnumKey); + } + + return dwError; +} + + /* Function 0 */ DWORD RCloseServiceHandle( handle_t BindingHandle, LPSC_RPC_HANDLE hSCObject) { PMANAGER_HANDLE hManager; + PSERVICE_HANDLE hService; + PSERVICE lpService; + HKEY hServicesKey; + DWORD dwError; + DWORD pcbBytesNeeded = 0; + DWORD dwServicesReturned = 0; DPRINT("RCloseServiceHandle() called\n"); @@ -250,6 +419,7 @@ DWORD RCloseServiceHandle( return ERROR_INVALID_HANDLE; hManager = (PMANAGER_HANDLE)*hSCObject; + hService = (PSERVICE_HANDLE)*hSCObject; if (hManager->Handle.Tag == MANAGER_TAG) { DPRINT("Found manager handle\n"); @@ -257,24 +427,92 @@ DWORD RCloseServiceHandle( hManager->Handle.RefCount--; if (hManager->Handle.RefCount == 0) { - /* FIXME: add cleanup code */ + /* FIXME: add handle cleanup code */ HeapFree(GetProcessHeap(), 0, hManager); + hManager = NULL; } DPRINT("RCloseServiceHandle() done\n"); return ERROR_SUCCESS; } - else if (hManager->Handle.Tag == SERVICE_TAG) + else if (hService->Handle.Tag == SERVICE_TAG) { DPRINT("Found service handle\n"); - hManager->Handle.RefCount--; - if (hManager->Handle.RefCount == 0) - { - /* FIXME: add cleanup code */ + /* Get the pointer to the service record */ + lpService = hService->ServiceEntry; - HeapFree(GetProcessHeap(), 0, hManager); + ASSERT(hService->Handle.RefCount > 0); + + hService->Handle.RefCount--; + if (hService->Handle.RefCount == 0) + { + /* FIXME: add handle cleanup code */ + + /* Free the handle */ + HeapFree(GetProcessHeap(), 0, hService); + hService = NULL; + } + + ASSERT(lpService->dwRefCount > 0); + + lpService->dwRefCount--; + DPRINT1("CloseServiceHandle - lpService->dwRefCount %u\n", + lpService->dwRefCount); + + if (lpService->dwRefCount == 0) + { + /* If this service has been marked for deletion */ + if (lpService->bDeleted) + { + /* Open the Services Reg key */ + dwError = RegOpenKeyExW(HKEY_LOCAL_MACHINE, + L"System\\CurrentControlSet\\Services", + 0, + KEY_SET_VALUE | KEY_READ, + &hServicesKey); + if (dwError != ERROR_SUCCESS) + { + DPRINT1("Failed to open services key\n"); + return dwError; + } + + /* Call the internal function with NULL, just to get bytes we need */ + Int_EnumDependentServicesW(hServicesKey, + lpService, + SERVICE_ACTIVE, + NULL, + &pcbBytesNeeded, + &dwServicesReturned); + + /* if pcbBytesNeeded returned a value then there are services running that are dependent on this service*/ + if (pcbBytesNeeded) + { + DPRINT1("Deletion failed due to running dependencies.\n", + lpService->lpServiceName); + RegCloseKey(hServicesKey); + return ERROR_SUCCESS; + } + + /* There are no references and no runnning dependencies, + it is now safe to delete the service */ + + /* Delete the Service Key */ + dwError = RegDeleteKey(hServicesKey, + lpService->lpServiceName); + + RegCloseKey(hServicesKey); + + if (dwError != ERROR_SUCCESS) + { + DPRINT1("Failed to Delete the Service Registry key\n"); + return dwError; + } + + /* Delete the Service */ + ScmDeleteServiceRecord(lpService); + } } DPRINT("RCloseServiceHandle() done\n"); @@ -298,6 +536,9 @@ DWORD RControlService( PSERVICE lpService; ACCESS_MASK DesiredAccess; DWORD dwError = ERROR_SUCCESS; + DWORD pcbBytesNeeded = 0; + DWORD dwServicesReturned = 0; + HKEY hServicesKey = NULL; DPRINT("RControlService() called\n"); @@ -312,6 +553,14 @@ DWORD RControlService( return ERROR_INVALID_HANDLE; } + /* Check the service entry point */ + lpService = hSvc->ServiceEntry; + if (lpService == NULL) + { + DPRINT1("lpService == NULL!\n"); + return ERROR_INVALID_HANDLE; + } + /* Check access rights */ switch (dwControl) { @@ -344,12 +593,40 @@ DWORD RControlService( DesiredAccess)) return ERROR_ACCESS_DENIED; - /* Check the service entry point */ - lpService = hSvc->ServiceEntry; - if (lpService == NULL) + if (dwControl == SERVICE_CONTROL_STOP) { - DPRINT1("lpService == NULL!\n"); - return ERROR_INVALID_HANDLE; + /* Check if the service has dependencies running as windows + doesn't stop a service that does */ + + /* Open the Services Reg key */ + dwError = RegOpenKeyExW(HKEY_LOCAL_MACHINE, + L"System\\CurrentControlSet\\Services", + 0, + KEY_READ, + &hServicesKey); + if (dwError != ERROR_SUCCESS) + { + DPRINT1("Failed to open services key\n"); + return dwError; + } + + /* Call the internal function with NULL, just to get bytes we need */ + Int_EnumDependentServicesW(hServicesKey, + lpService, + SERVICE_ACTIVE, + NULL, + &pcbBytesNeeded, + &dwServicesReturned); + + RegCloseKey(hServicesKey); + + /* If pcbBytesNeeded is not zero then there are services running that + are dependent on this service */ + if (pcbBytesNeeded != 0) + { + DPRINT("Service has running dependencies. Failed to stop service.\n"); + return ERROR_DEPENDENT_SERVICES_RUNNING; + } } if (lpService->Status.dwServiceType & SERVICE_DRIVER) @@ -367,6 +644,9 @@ DWORD RControlService( lpServiceStatus); } + if ((dwError == ERROR_SUCCESS) && (pcbBytesNeeded)) + dwError = ERROR_DEPENDENT_SERVICES_RUNNING; + /* Return service status information */ RtlCopyMemory(lpServiceStatus, &lpService->Status, @@ -790,6 +1070,7 @@ DWORD RChangeServiceConfigW( PSERVICE_HANDLE hSvc; PSERVICE lpService = NULL; HKEY hServiceKey = NULL; + LPWSTR lpDisplayNameW = NULL; DPRINT("RChangeServiceConfigW() called\n"); DPRINT("dwServiceType = %lu\n", dwServiceType); @@ -849,7 +1130,21 @@ DWORD RChangeServiceConfigW( REG_SZ, (LPBYTE)lpDisplayName, (wcslen(lpDisplayName) + 1) * sizeof(WCHAR)); - /* FIXME: update lpService->lpDisplayName */ + + /* Update the display name */ + lpDisplayNameW = (LPWSTR)HeapAlloc(GetProcessHeap(), + 0, + (wcslen(lpDisplayName) + 1) * sizeof(WCHAR)); + if (lpDisplayNameW == NULL) + { + dwError = ERROR_NOT_ENOUGH_MEMORY; + goto done; + } + + if (lpService->lpDisplayName != lpService->lpServiceName) + HeapFree(GetProcessHeap(), 0, lpService->lpDisplayName); + + lpService->lpDisplayName = lpDisplayNameW; } if (dwServiceType != SERVICE_NO_CHANGE) @@ -942,7 +1237,7 @@ DWORD RChangeServiceConfigW( (wcslen(lpLoadOrderGroup) + 1) * sizeof(WCHAR)); if (dwError != ERROR_SUCCESS) goto done; - /* FIXME: update lpService->lpServiceGroup */ + /* FIXME: Update lpService->lpServiceGroup */ } if (lpdwTagId != NULL) @@ -989,6 +1284,7 @@ done: return dwError; } + /* Create a path suitable for the bootloader out of the full path */ DWORD ScmConvertToBootPathName(wchar_t *CanonName, wchar_t **RelativeName) @@ -1004,12 +1300,12 @@ ScmConvertToBootPathName(wchar_t *CanonName, wchar_t **RelativeName) DPRINT("ScmConvertToBootPathName %S\n", CanonName); ServiceNameLen = wcslen(CanonName); + /* First check, if it's already good */ if (ServiceNameLen > 12 && !wcsnicmp(L"\\SystemRoot\\", CanonName, 12)) { *RelativeName = LocalAlloc(LMEM_ZEROINIT, ServiceNameLen * sizeof(WCHAR) + sizeof(WCHAR)); - if (*RelativeName == NULL) { DPRINT1("Error allocating memory for boot driver name!\n"); @@ -1057,8 +1353,8 @@ ScmConvertToBootPathName(wchar_t *CanonName, wchar_t **RelativeName) Expanded = LocalAlloc(LMEM_ZEROINIT, BufferSize * sizeof(WCHAR) + sizeof(WCHAR)); if (!Expanded) { - DPRINT1("Error allocating memory for boot driver name!\n"); - return ERROR_NOT_ENOUGH_MEMORY; + DPRINT1("Error allocating memory for boot driver name!\n"); + return ERROR_NOT_ENOUGH_MEMORY; } /* Expand it */ @@ -1100,7 +1396,6 @@ ScmConvertToBootPathName(wchar_t *CanonName, wchar_t **RelativeName) /* Only \SystemRoot\ is missing */ *RelativeName = LocalAlloc(LMEM_ZEROINIT, (ServiceNameLen - ExpandedLen) * sizeof(WCHAR) + 13*sizeof(WCHAR)); - if (*RelativeName == NULL) { DPRINT1("Error allocating memory for boot driver name!\n"); @@ -1420,19 +1715,64 @@ DWORD RCreateServiceW( return ERROR_ACCESS_DENIED; } - /* Fail if the service already exists! */ - if (ScmGetServiceEntryByName(lpServiceName) != NULL) + if (wcslen(lpServiceName) == 0) + { + return ERROR_INVALID_NAME; + } + + if (wcslen(lpBinaryPathName) == 0) + { + return ERROR_INVALID_PARAMETER; + } + + if ((dwServiceType == (SERVICE_WIN32_OWN_PROCESS | SERVICE_INTERACTIVE_PROCESS)) && + (lpServiceStartName)) + { + return ERROR_INVALID_PARAMETER; + } + + if ((dwServiceType > SERVICE_WIN32_SHARE_PROCESS) && + (dwServiceType != (SERVICE_WIN32_OWN_PROCESS | SERVICE_INTERACTIVE_PROCESS)) && + (dwServiceType != (SERVICE_WIN32_SHARE_PROCESS | SERVICE_INTERACTIVE_PROCESS))) + { + return ERROR_INVALID_PARAMETER; + } + + if (dwStartType > SERVICE_DISABLED) + { + return ERROR_INVALID_PARAMETER; + } + + lpService = ScmGetServiceEntryByName(lpServiceName); + if (lpService) + { + /* check if it is marked for deletion */ + if (lpService->bDeleted) + return ERROR_SERVICE_MARKED_FOR_DELETE; + /* Return Error exist */ return ERROR_SERVICE_EXISTS; + } + + if (lpDisplayName != NULL && + ScmGetServiceEntryByDisplayName(lpDisplayName) != NULL) + return ERROR_DUPLICATE_SERVICE_NAME; if (dwServiceType & SERVICE_DRIVER) { dwError = ScmCanonDriverImagePath(dwStartType, - lpBinaryPathName, - &lpImagePath); - + lpBinaryPathName, + &lpImagePath); if (dwError != ERROR_SUCCESS) goto done; } + else + { + if (dwStartType == SERVICE_BOOT_START || + dwStartType == SERVICE_SYSTEM_START) + { + return ERROR_INVALID_PARAMETER; + } + } /* Allocate a new service entry */ dwError = ScmCreateNewServiceRecord(lpServiceName, @@ -1585,6 +1925,19 @@ DWORD RCreateServiceW( goto done; } + /* If a non driver and NULL for lpServiceName, write ObjectName as LocalSystem */ + if ((dwServiceType & SERVICE_WIN32) && (!lpServiceName)) + { + dwError = RegSetValueExW(hServiceKey, + L"ObjectName", + 0, + REG_SZ, + (LPBYTE)L"LocalSystem", + 24); + if (dwError != ERROR_SUCCESS) + goto done; + } + if (lpPassword != NULL) { /* FIXME: Write password */ @@ -1600,6 +1953,9 @@ DWORD RCreateServiceW( if (dwError != ERROR_SUCCESS) goto done; + lpService->dwRefCount = 1; + DPRINT1("CreateService - lpService->dwRefCount %u\n", lpService->dwRefCount); + done:; if (hServiceKey != NULL) RegCloseKey(hServiceKey); @@ -1650,12 +2006,120 @@ DWORD REnumDependentServicesW( LPBOUNDED_DWORD_256K lpServicesReturned) { DWORD dwError = ERROR_SUCCESS; + DWORD dwServicesReturned = 0; + DWORD dwServiceCount; + HKEY hServicesKey = NULL; + LPSC_RPC_HANDLE hSCObject; + PSERVICE_HANDLE hSvc; + PSERVICE lpService = NULL; + PSERVICE *lpServicesArray = NULL; + LPENUM_SERVICE_STATUSW lpServicesPtr = NULL; + LPWSTR lpStr; - UNIMPLEMENTED; *pcbBytesNeeded = 0; *lpServicesReturned = 0; - DPRINT1("REnumDependentServicesW() done (Error %lu)\n", dwError); + DPRINT("REnumDependentServicesW() called\n"); + + hSCObject = &hService; + hSvc = (PSERVICE_HANDLE) *hSCObject; + lpService = hSvc->ServiceEntry; + + /* Check access rights */ + if (!RtlAreAllAccessesGranted(hSvc->Handle.DesiredAccess, + SC_MANAGER_ENUMERATE_SERVICE)) + { + DPRINT1("Insufficient access rights! 0x%lx\n", + hSvc->Handle.DesiredAccess); + return ERROR_ACCESS_DENIED; + } + + /* Open the Services Reg key */ + dwError = RegOpenKeyExW(HKEY_LOCAL_MACHINE, + L"System\\CurrentControlSet\\Services", + 0, + KEY_READ, + &hServicesKey); + if (dwError != ERROR_SUCCESS) + return dwError; + + /* First determine the bytes needed and get the number of dependent services */ + dwError = Int_EnumDependentServicesW(hServicesKey, + lpService, + dwServiceState, + NULL, + pcbBytesNeeded, + &dwServicesReturned); + if (dwError != ERROR_SUCCESS) + goto Done; + + /* If buffer size is less than the bytes needed or pointer is null */ + if ((!lpServices) || (cbBufSize < *pcbBytesNeeded)) + { + dwError = ERROR_MORE_DATA; + goto Done; + } + + /* Allocate memory for array of service pointers */ + lpServicesArray = HeapAlloc(GetProcessHeap(), + 0, + (dwServicesReturned + 1) * sizeof(PSERVICE)); + if (!lpServicesArray) + { + DPRINT1("Could not allocate a buffer!!\n"); + dwError = ERROR_NOT_ENOUGH_MEMORY; + goto Done; + } + + dwServicesReturned = 0; + *pcbBytesNeeded = 0; + + dwError = Int_EnumDependentServicesW(hServicesKey, + lpService, + dwServiceState, + lpServicesArray, + pcbBytesNeeded, + &dwServicesReturned); + if (dwError != ERROR_SUCCESS) + { + goto Done; + } + + lpServicesPtr = (LPENUM_SERVICE_STATUSW) lpServices; + lpStr = (LPWSTR)(lpServices + (dwServicesReturned * sizeof(ENUM_SERVICE_STATUSW))); + + /* Copy EnumDepenedentService to Buffer */ + for (dwServiceCount = 0; dwServiceCount < dwServicesReturned; dwServiceCount++) + { + lpService = lpServicesArray[dwServiceCount]; + + /* Copy status info */ + memcpy(&lpServicesPtr->ServiceStatus, + &lpService->Status, + sizeof(SERVICE_STATUS)); + + /* Copy display name */ + wcscpy(lpStr, lpService->lpDisplayName); + lpServicesPtr->lpDisplayName = (LPWSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpServices); + lpStr += (wcslen(lpService->lpDisplayName) + 1); + + /* Copy service name */ + wcscpy(lpStr, lpService->lpServiceName); + lpServicesPtr->lpServiceName = (LPWSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpServices); + lpStr += (wcslen(lpService->lpServiceName) + 1); + + lpServicesPtr ++; + } + + *lpServicesReturned = dwServicesReturned; + +Done: + if (lpServicesArray != NULL) + HeapFree(GetProcessHeap(), 0, lpServicesArray); + + RegCloseKey(hServicesKey); + + DPRINT("REnumDependentServicesW() done (Error %lu)\n", dwError); return dwError; } @@ -1746,19 +2210,16 @@ DWORD REnumServicesStatusW( ((wcslen(CurrentService->lpServiceName) + 1) * sizeof(WCHAR)) + ((wcslen(CurrentService->lpDisplayName) + 1) * sizeof(WCHAR)); - if (dwRequiredSize + dwSize <= dwBufSize) - { - DPRINT("Service name: %S fit\n", CurrentService->lpServiceName); - dwRequiredSize += dwSize; - dwServiceCount++; - dwLastResumeCount = CurrentService->dwResumeCount; - } - else + if (dwRequiredSize + dwSize > dwBufSize) { DPRINT("Service name: %S no fit\n", CurrentService->lpServiceName); break; } + DPRINT("Service name: %S fit\n", CurrentService->lpServiceName); + dwRequiredSize += dwSize; + dwServiceCount++; + dwLastResumeCount = CurrentService->dwResumeCount; } DPRINT("dwRequiredSize: %lu\n", dwRequiredSize); @@ -1822,33 +2283,26 @@ DWORD REnumServicesStatusW( ((wcslen(CurrentService->lpServiceName) + 1) * sizeof(WCHAR)) + ((wcslen(CurrentService->lpDisplayName) + 1) * sizeof(WCHAR)); - if (dwRequiredSize + dwSize <= dwBufSize) - { - /* Copy the service name */ - wcscpy(lpStringPtr, - CurrentService->lpServiceName); - lpStatusPtr->lpServiceName = (LPWSTR)((ULONG_PTR)lpStringPtr - (ULONG_PTR)lpBuffer); - lpStringPtr += (wcslen(CurrentService->lpServiceName) + 1); - - /* Copy the display name */ - wcscpy(lpStringPtr, - CurrentService->lpDisplayName); - lpStatusPtr->lpDisplayName = (LPWSTR)((ULONG_PTR)lpStringPtr - (ULONG_PTR)lpBuffer); - lpStringPtr += (wcslen(CurrentService->lpDisplayName) + 1); - - /* Copy the status information */ - memcpy(&lpStatusPtr->ServiceStatus, - &CurrentService->Status, - sizeof(SERVICE_STATUS)); - - lpStatusPtr++; - dwRequiredSize += dwSize; - } - else - { + if (dwRequiredSize + dwSize > dwBufSize) break; - } + /* Copy the service name */ + wcscpy(lpStringPtr, CurrentService->lpServiceName); + lpStatusPtr->lpServiceName = (LPWSTR)((ULONG_PTR)lpStringPtr - (ULONG_PTR)lpBuffer); + lpStringPtr += (wcslen(CurrentService->lpServiceName) + 1); + + /* Copy the display name */ + wcscpy(lpStringPtr, CurrentService->lpDisplayName); + lpStatusPtr->lpDisplayName = (LPWSTR)((ULONG_PTR)lpStringPtr - (ULONG_PTR)lpBuffer); + lpStringPtr += (wcslen(CurrentService->lpDisplayName) + 1); + + /* Copy the status information */ + memcpy(&lpStatusPtr->ServiceStatus, + &CurrentService->Status, + sizeof(SERVICE_STATUS)); + + lpStatusPtr++; + dwRequiredSize += dwSize; } Done:; @@ -1936,6 +2390,9 @@ DWORD ROpenServiceW( if (!lpServiceHandle) return ERROR_INVALID_PARAMETER; + if (!lpServiceName) + return ERROR_INVALID_ADDRESS; + hManager = (PMANAGER_HANDLE)hSCManager; if (!hManager || hManager->Handle.Tag != MANAGER_TAG) { @@ -1972,6 +2429,9 @@ DWORD ROpenServiceW( return dwError; } + lpService->dwRefCount++; + DPRINT1("OpenService - lpService->dwRefCount %u\n",lpService->dwRefCount); + *lpServiceHandle = (unsigned long)hHandle; /* FIXME: 64 bit portability */ DPRINT("*hService = %p\n", *lpServiceHandle); @@ -1997,7 +2457,8 @@ DWORD RQueryServiceConfigW( LPWSTR lpImagePath = NULL; LPWSTR lpServiceStartName = NULL; DWORD dwRequiredSize; - LPQUERY_SERVICE_CONFIGW lpConfig; + LPQUERY_SERVICE_CONFIGW lpConfig = NULL; + WCHAR lpEmptyString[] = {0,0}; LPWSTR lpStr; DPRINT("RQueryServiceConfigW() called\n"); @@ -2048,17 +2509,25 @@ DWORD RQueryServiceConfigW( if (lpImagePath != NULL) dwRequiredSize += ((wcslen(lpImagePath) + 1) * sizeof(WCHAR)); + else + dwRequiredSize += 2 * sizeof(WCHAR); if (lpService->lpGroup != NULL) dwRequiredSize += ((wcslen(lpService->lpGroup->lpGroupName) + 1) * sizeof(WCHAR)); + else + dwRequiredSize += 2 * sizeof(WCHAR); /* FIXME: Add Dependencies length*/ if (lpServiceStartName != NULL) dwRequiredSize += ((wcslen(lpServiceStartName) + 1) * sizeof(WCHAR)); + else + dwRequiredSize += 2 * sizeof(WCHAR); if (lpService->lpDisplayName != NULL) dwRequiredSize += ((wcslen(lpService->lpDisplayName) + 1) * sizeof(WCHAR)); + else + dwRequiredSize += 2 * sizeof(WCHAR); if (lpServiceConfig == NULL || cbBufSize < dwRequiredSize) { @@ -2077,48 +2546,55 @@ DWORD RQueryServiceConfigW( if (lpImagePath != NULL) { wcscpy(lpStr, lpImagePath); - lpConfig->lpBinaryPathName = (LPWSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpConfig); - lpStr += (wcslen(lpImagePath) + 1); } else { - lpConfig->lpBinaryPathName = NULL; + wcscpy(lpStr, lpEmptyString); } + lpConfig->lpBinaryPathName = (LPWSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpConfig); + lpStr += (wcslen(lpStr) + 1); + if (lpService->lpGroup != NULL) { wcscpy(lpStr, lpService->lpGroup->lpGroupName); - lpConfig->lpLoadOrderGroup = (LPWSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpConfig); - lpStr += (wcslen(lpService->lpGroup->lpGroupName) + 1); } else { - lpConfig->lpLoadOrderGroup = NULL; + wcscpy(lpStr, lpEmptyString); } + lpConfig->lpLoadOrderGroup = (LPWSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpConfig); + lpStr += (wcslen(lpStr) + 1); + /* FIXME: Append Dependencies */ - lpConfig->lpDependencies = NULL; + wcscpy(lpStr, lpEmptyString); + + lpStr += (wcslen(lpStr) + 1); + lpConfig->lpDependencies = (LPWSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpConfig); if (lpServiceStartName != NULL) { wcscpy(lpStr, lpServiceStartName); - lpConfig->lpServiceStartName = (LPWSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpConfig); - lpStr += (wcslen(lpServiceStartName) + 1); } else { - lpConfig->lpServiceStartName = NULL; + wcscpy(lpStr, lpEmptyString); } + lpConfig->lpServiceStartName = (LPWSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpConfig); + lpStr += (wcslen(lpStr) + 1); + if (lpService->lpDisplayName != NULL) { wcscpy(lpStr, lpService->lpDisplayName); - lpConfig->lpDisplayName = (LPWSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpConfig); } else { - lpConfig->lpDisplayName = NULL; + wcscpy(lpStr, lpEmptyString); } + + lpConfig->lpDisplayName = (LPWSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpConfig); } if (pcbBytesNeeded != NULL) @@ -2241,15 +2717,37 @@ DWORD RGetServiceDisplayNameW( if (lpService == NULL) { DPRINT1("Could not find a service!\n"); + + /* If the service could not be found and lpcchBuffer is 0, windows + puts null in lpDisplayName and puts 1 in lpcchBuffer */ + if (*lpcchBuffer == 0) + { + *lpcchBuffer = 1; + *lpDisplayName = '\0'; + } + return ERROR_SERVICE_DOES_NOT_EXIST; } - dwLength = wcslen(lpService->lpDisplayName) + 1; - - if (lpDisplayName != NULL && - *lpcchBuffer >= dwLength) + if (!lpService->lpDisplayName) { - wcscpy(lpDisplayName, lpService->lpDisplayName); + dwLength = wcslen(lpService->lpServiceName); + + if (lpServiceName != NULL && + *lpcchBuffer > dwLength) + { + wcscpy(lpDisplayName, lpService->lpServiceName); + } + } + else + { + dwLength = wcslen(lpService->lpDisplayName); + + if (lpDisplayName != NULL && + *lpcchBuffer > dwLength) + { + wcscpy(lpDisplayName, lpService->lpDisplayName); + } } dwError = (*lpcchBuffer > dwLength) ? ERROR_SUCCESS : ERROR_INSUFFICIENT_BUFFER; @@ -2291,20 +2789,31 @@ DWORD RGetServiceKeyNameW( if (lpService == NULL) { DPRINT1("Could not find a service!\n"); + + /* If the service could not be found and lpcchBuffer is 0, windows + puts null in lpDisplayName and puts 2 in lpcchBuffer */ + if (*lpcchBuffer == 0) + { + *lpcchBuffer = 2; + *lpServiceName = '\0'; + } + return ERROR_SERVICE_DOES_NOT_EXIST; } - dwLength = wcslen(lpService->lpServiceName) + 1; + dwLength = wcslen(lpService->lpServiceName); if (lpServiceName != NULL && - *lpcchBuffer >= dwLength) + *lpcchBuffer > dwLength) { wcscpy(lpServiceName, lpService->lpServiceName); + *lpcchBuffer = dwLength; + return ERROR_SUCCESS; } dwError = (*lpcchBuffer > dwLength) ? ERROR_SUCCESS : ERROR_INSUFFICIENT_BUFFER; - *lpcchBuffer = dwLength; + *lpcchBuffer = dwLength * 2; return dwError; } @@ -2341,8 +2850,271 @@ DWORD RChangeServiceConfigA( DWORD dwPwSize, LPSTR lpDisplayName) { - UNIMPLEMENTED; - return ERROR_CALL_NOT_IMPLEMENTED; + DWORD dwError = ERROR_SUCCESS; + PSERVICE_HANDLE hSvc; + PSERVICE lpService = NULL; + HKEY hServiceKey = NULL; + LPWSTR lpDisplayNameW = NULL; + // LPWSTR lpBinaryPathNameW = NULL; + LPWSTR lpLoadOrderGroupW = NULL; + LPWSTR lpDependenciesW = NULL; + // LPWSTR lpPasswordW = NULL; + + DPRINT("RChangeServiceConfigA() called\n"); + DPRINT("dwServiceType = %lu\n", dwServiceType); + DPRINT("dwStartType = %lu\n", dwStartType); + DPRINT("dwErrorControl = %lu\n", dwErrorControl); + DPRINT("lpBinaryPathName = %s\n", lpBinaryPathName); + DPRINT("lpLoadOrderGroup = %s\n", lpLoadOrderGroup); + DPRINT("lpDisplayName = %s\n", lpDisplayName); + + if (ScmShutdown) + return ERROR_SHUTDOWN_IN_PROGRESS; + + hSvc = (PSERVICE_HANDLE)hService; + if (!hSvc || hSvc->Handle.Tag != SERVICE_TAG) + { + DPRINT1("Invalid handle tag!\n"); + return ERROR_INVALID_HANDLE; + } + + if (!RtlAreAllAccessesGranted(hSvc->Handle.DesiredAccess, + SERVICE_CHANGE_CONFIG)) + { + DPRINT1("Insufficient access rights! 0x%lx\n", hSvc->Handle.DesiredAccess); + return ERROR_ACCESS_DENIED; + } + + lpService = hSvc->ServiceEntry; + if (lpService == NULL) + { + DPRINT1("lpService == NULL!\n"); + return ERROR_INVALID_HANDLE; + } + + /* FIXME: Lock database exclusively */ + + if (lpService->bDeleted) + { + /* FIXME: Unlock database */ + DPRINT1("The service has already been marked for delete!\n"); + return ERROR_SERVICE_MARKED_FOR_DELETE; + } + + /* Open the service key */ + dwError = ScmOpenServiceKey(lpService->szServiceName, + KEY_SET_VALUE, + &hServiceKey); + if (dwError != ERROR_SUCCESS) + goto done; + + /* Write service data to the registry */ + + if (lpDisplayName != NULL && *lpDisplayName != 0) + { + /* Set the display name */ + lpDisplayNameW = HeapAlloc(GetProcessHeap(), + 0, + (strlen(lpDisplayName) + 1) * sizeof(WCHAR)); + if (lpDisplayNameW == NULL) + { + dwError = ERROR_NOT_ENOUGH_MEMORY; + goto done; + } + + MultiByteToWideChar(CP_ACP, + 0, + lpDisplayName, + -1, + lpDisplayNameW, + (wcslen(lpDisplayNameW) + 1) * sizeof(WCHAR)); + + RegSetValueExW(hServiceKey, + L"DisplayName", + 0, + REG_SZ, + (LPBYTE)lpDisplayNameW, + (wcslen(lpDisplayNameW) + 1) * sizeof(WCHAR)); + + /* Update lpService->lpDisplayName */ + if (lpService->lpDisplayName) + HeapFree(GetProcessHeap(), 0, lpService->lpDisplayName); + + lpService->lpDisplayName = lpDisplayNameW; + } + + if (dwServiceType != SERVICE_NO_CHANGE) + { + /* Set the service type */ + dwError = RegSetValueExW(hServiceKey, + L"Type", + 0, + REG_DWORD, + (LPBYTE)&dwServiceType, + sizeof(DWORD)); + if (dwError != ERROR_SUCCESS) + goto done; + + lpService->Status.dwServiceType = dwServiceType; + } + + if (dwStartType != SERVICE_NO_CHANGE) + { + /* Set the start value */ + dwError = RegSetValueExW(hServiceKey, + L"Start", + 0, + REG_DWORD, + (LPBYTE)&dwStartType, + sizeof(DWORD)); + if (dwError != ERROR_SUCCESS) + goto done; + + lpService->dwStartType = dwStartType; + } + + if (dwErrorControl != SERVICE_NO_CHANGE) + { + /* Set the error control value */ + dwError = RegSetValueExW(hServiceKey, + L"ErrorControl", + 0, + REG_DWORD, + (LPBYTE)&dwErrorControl, + sizeof(DWORD)); + if (dwError != ERROR_SUCCESS) + goto done; + + lpService->dwErrorControl = dwErrorControl; + } + +#if 0 + /* FIXME: set the new ImagePath value */ + + /* Set the image path */ + if (dwServiceType & SERVICE_WIN32) + { + if (lpBinaryPathName != NULL && *lpBinaryPathName != 0) + { + lpBinaryPathNameW=HeapAlloc(GetProcessHeap(),0, (strlen(lpBinaryPathName)+1) * sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, lpBinaryPathName, -1, lpBinaryPathNameW, (wcslen(lpBinaryPathNameW)+1) * sizeof(WCHAR)); + dwError = RegSetValueExW(hServiceKey, + L"ImagePath", + 0, + REG_EXPAND_SZ, + (LPBYTE)lpBinaryPathNameW, + (wcslen(lpBinaryPathNameW) + 1) * sizeof(WCHAR)); + if (dwError != ERROR_SUCCESS) + goto done; + } + } + else if (dwServiceType & SERVICE_DRIVER) + { + if (lpImagePath != NULL && *lpImagePath != 0) + { + dwError = RegSetValueExW(hServiceKey, + L"ImagePath", + 0, + REG_EXPAND_SZ, + (LPBYTE)lpImagePath, + (wcslen(lpImagePath) + 1) *sizeof(WCHAR)); + if (dwError != ERROR_SUCCESS) + goto done; + } + } +#endif + + /* Set the group name */ + if (lpLoadOrderGroup != NULL && *lpLoadOrderGroup != 0) + { + lpLoadOrderGroupW = HeapAlloc(GetProcessHeap(), + 0, + (strlen(lpLoadOrderGroup)+1) * sizeof(WCHAR)); + if (lpLoadOrderGroupW == NULL) + { + dwError = ERROR_NOT_ENOUGH_MEMORY; + goto done; + } + + MultiByteToWideChar(CP_ACP, + 0, + lpLoadOrderGroup, + -1, + lpLoadOrderGroupW, + (wcslen(lpLoadOrderGroupW) + 1) * sizeof(WCHAR)); + + dwError = RegSetValueExW(hServiceKey, + L"Group", + 0, + REG_SZ, + (LPBYTE)lpLoadOrderGroupW, + (wcslen(lpLoadOrderGroupW) + 1) * sizeof(WCHAR)); + if (dwError != ERROR_SUCCESS) + goto done; + + /* FIXME: Update lpService->lpServiceGroup */ + + HeapFree(GetProcessHeap(), 0, lpLoadOrderGroupW); + } + + if (lpdwTagId != NULL) + { + dwError = ScmAssignNewTag(lpService); + if (dwError != ERROR_SUCCESS) + goto done; + + dwError = RegSetValueExW(hServiceKey, + L"Tag", + 0, + REG_DWORD, + (LPBYTE)&lpService->dwTag, + sizeof(DWORD)); + if (dwError != ERROR_SUCCESS) + goto done; + + *lpdwTagId = lpService->dwTag; + } + + /* Write dependencies */ + if (lpDependencies != NULL && *lpDependencies != 0) + { + lpDependenciesW = HeapAlloc(GetProcessHeap(), + 0, + (strlen(lpDependencies)+1) * sizeof(WCHAR)); + if (lpDependenciesW == NULL) + { + dwError = ERROR_NOT_ENOUGH_MEMORY; + goto done; + } + + MultiByteToWideChar(CP_ACP, + 0, + lpDependencies, + dwDependSize, + lpDependenciesW, + (wcslen(lpDependenciesW)+1) * sizeof(WCHAR)); + + dwError = ScmWriteDependencies(hServiceKey, + (LPWSTR)lpDependenciesW, + dwDependSize); + + HeapFree(GetProcessHeap(), 0, lpDependenciesW); + } + + if (lpPassword != NULL) + { + /* FIXME: Write password */ + } + + /* FIXME: Unlock database */ + +done: + if (hServiceKey != NULL) + RegCloseKey(hServiceKey); + + DPRINT("RChangeServiceConfigA() done (Error %lu)\n", dwError); + + return dwError; } @@ -2381,10 +3153,141 @@ DWORD REnumDependentServicesA( LPBOUNDED_DWORD_256K pcbBytesNeeded, LPBOUNDED_DWORD_256K lpServicesReturned) { - UNIMPLEMENTED; + DWORD dwError = ERROR_SUCCESS; + DWORD dwServicesReturned = 0; + DWORD dwServiceCount; + HKEY hServicesKey = NULL; + LPSC_RPC_HANDLE hSCObject; + PSERVICE_HANDLE hSvc; + PSERVICE lpService = NULL; + PSERVICE *lpServicesArray = NULL; + LPENUM_SERVICE_STATUSA lpServicesPtr = NULL; + LPSTR lpStr; + *pcbBytesNeeded = 0; *lpServicesReturned = 0; - return ERROR_CALL_NOT_IMPLEMENTED; + + DPRINT("REnumDependentServicesA() called\n"); + + hSCObject = &hService; + hSvc = (PSERVICE_HANDLE) *hSCObject; + lpService = hSvc->ServiceEntry; + + /* Check access rights */ + if (!RtlAreAllAccessesGranted(hSvc->Handle.DesiredAccess, + SC_MANAGER_ENUMERATE_SERVICE)) + { + DPRINT1("Insufficient access rights! 0x%lx\n", + hSvc->Handle.DesiredAccess); + return ERROR_ACCESS_DENIED; + } + + /* Open the Services Reg key */ + dwError = RegOpenKeyExW(HKEY_LOCAL_MACHINE, + L"System\\CurrentControlSet\\Services", + 0, + KEY_READ, + &hServicesKey); + + if (dwError != ERROR_SUCCESS) return dwError; + + /* NOTE: Windows calculates the pcbBytesNeeded based on WCHAR strings for + both EnumDependentServicesA and EnumDependentServicesW. So returned pcbBytesNeeded + are the same for both. Verified in WINXP. */ + + /* First determine the bytes needed and get the number of dependent services*/ + dwError = Int_EnumDependentServicesW(hServicesKey, + lpService, + dwServiceState, + NULL, + pcbBytesNeeded, + &dwServicesReturned); + if (dwError != ERROR_SUCCESS) + goto Done; + + /* If buffer size is less than the bytes needed or pointer is null*/ + if ((!lpServices) || (cbBufSize < *pcbBytesNeeded)) + { + dwError = ERROR_MORE_DATA; + goto Done; + } + + /* Allocate memory for array of service pointers */ + lpServicesArray = HeapAlloc(GetProcessHeap(), + 0, + (dwServicesReturned + 1) * sizeof(PSERVICE)); + if (!lpServicesArray) + { + DPRINT1("Could not allocate a buffer!!\n"); + dwError = ERROR_NOT_ENOUGH_MEMORY; + goto Done; + } + + dwServicesReturned = 0; + *pcbBytesNeeded = 0; + + dwError = Int_EnumDependentServicesW(hServicesKey, + lpService, + dwServiceState, + lpServicesArray, + pcbBytesNeeded, + &dwServicesReturned); + if (dwError != ERROR_SUCCESS) + { + goto Done; + } + + lpServicesPtr = (LPENUM_SERVICE_STATUSA)lpServices; + lpStr = (LPSTR)(lpServices + (dwServicesReturned * sizeof(ENUM_SERVICE_STATUSA))); + + /* Copy EnumDepenedentService to Buffer */ + for (dwServiceCount = 0; dwServiceCount < dwServicesReturned; dwServiceCount++) + { + lpService = lpServicesArray[dwServiceCount]; + + /* Copy the status info */ + memcpy(&lpServicesPtr->ServiceStatus, + &lpService->Status, + sizeof(SERVICE_STATUS)); + + /* Copy display name */ + WideCharToMultiByte(CP_ACP, + 0, + lpService->lpDisplayName, + -1, + lpStr, + wcslen(lpService->lpDisplayName), + 0, + 0); + lpServicesPtr->lpDisplayName = (LPSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpServices); + lpStr += strlen(lpStr) + 1; + + /* Copy service name */ + WideCharToMultiByte(CP_ACP, + 0, + lpService->lpServiceName, + -1, + lpStr, + wcslen(lpService->lpServiceName), + 0, + 0); + lpServicesPtr->lpServiceName = (LPSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpServices); + lpStr += strlen(lpStr) + 1; + + lpServicesPtr ++; + } + + *lpServicesReturned = dwServicesReturned; + +Done: + if (lpServicesArray) + HeapFree(GetProcessHeap(), 0, lpServicesArray); + + RegCloseKey(hServicesKey); + + DPRINT("REnumDependentServicesA() done (Error %lu)\n", dwError); + + return dwError; } @@ -2428,10 +3331,10 @@ DWORD ROpenSCManagerA( lpDatabaseName); dwError = ROpenSCManagerW(BindingHandle, - lpMachineName ? MachineName.Buffer : NULL, - lpDatabaseName ? DatabaseName.Buffer : NULL, - dwDesiredAccess, - lpScHandle); + lpMachineName ? MachineName.Buffer : NULL, + lpDatabaseName ? DatabaseName.Buffer : NULL, + dwDesiredAccess, + lpScHandle); if (lpMachineName) RtlFreeUnicodeString(&MachineName); @@ -2456,16 +3359,18 @@ DWORD ROpenServiceA( DPRINT("ROpenServiceA() called\n"); - RtlCreateUnicodeStringFromAsciiz(&ServiceName, - lpServiceName); + if (lpServiceName) + RtlCreateUnicodeStringFromAsciiz(&ServiceName, + lpServiceName); dwError = ROpenServiceW(BindingHandle, - hSCManager, - ServiceName.Buffer, - dwDesiredAccess, - lpServiceHandle); + hSCManager, + lpServiceName ? ServiceName.Buffer : NULL, + dwDesiredAccess, + lpServiceHandle); - RtlFreeUnicodeString(&ServiceName); + if (lpServiceName) + RtlFreeUnicodeString(&ServiceName); return dwError; } @@ -2475,12 +3380,208 @@ DWORD ROpenServiceA( DWORD RQueryServiceConfigA( handle_t BindingHandle, SC_RPC_HANDLE hService, - LPQUERY_SERVICE_CONFIGA lpServiceConfig, + LPBYTE lpBuf, //LPQUERY_SERVICE_CONFIGA lpServiceConfig, DWORD cbBufSize, LPBOUNDED_DWORD_8K pcbBytesNeeded) { - UNIMPLEMENTED; - return ERROR_CALL_NOT_IMPLEMENTED; + LPQUERY_SERVICE_CONFIGA lpServiceConfig = (LPQUERY_SERVICE_CONFIGA)lpBuf; + DWORD dwError = ERROR_SUCCESS; + PSERVICE_HANDLE hSvc; + PSERVICE lpService = NULL; + HKEY hServiceKey = NULL; + LPWSTR lpImagePath = NULL; + LPWSTR lpServiceStartName = NULL; + DWORD dwRequiredSize; + LPQUERY_SERVICE_CONFIGA lpConfig = NULL; + CHAR lpEmptyString[]={0,0}; + LPSTR lpStr; + + DPRINT("RQueryServiceConfigA() called\n"); + + if (ScmShutdown) + return ERROR_SHUTDOWN_IN_PROGRESS; + + hSvc = (PSERVICE_HANDLE)hService; + if (!hSvc || hSvc->Handle.Tag != SERVICE_TAG) + { + DPRINT1("Invalid handle tag!\n"); + return ERROR_INVALID_HANDLE; + } + + if (!RtlAreAllAccessesGranted(hSvc->Handle.DesiredAccess, + SERVICE_QUERY_CONFIG)) + { + DPRINT1("Insufficient access rights! 0x%lx\n", hSvc->Handle.DesiredAccess); + return ERROR_ACCESS_DENIED; + } + + lpService = hSvc->ServiceEntry; + if (lpService == NULL) + { + DPRINT1("lpService == NULL!\n"); + return ERROR_INVALID_HANDLE; + } + + /* FIXME: Lock the service database shared */ + + dwError = ScmOpenServiceKey(lpService->lpServiceName, + KEY_READ, + &hServiceKey); + if (dwError != ERROR_SUCCESS) + goto Done; + + dwError = ScmReadString(hServiceKey, + L"ImagePath", + &lpImagePath); + if (dwError != ERROR_SUCCESS) + goto Done; + + ScmReadString(hServiceKey, + L"ObjectName", + &lpServiceStartName); + + dwRequiredSize = sizeof(QUERY_SERVICE_CONFIGW); + + if (lpImagePath != NULL) + dwRequiredSize += wcslen(lpImagePath) + 1; + else + dwRequiredSize += 2; + + if (lpService->lpGroup != NULL) + dwRequiredSize += wcslen(lpService->lpGroup->lpGroupName) + 1; + else + dwRequiredSize += 2; + + /* FIXME: Add Dependencies length*/ + dwRequiredSize += 2; + + if (lpServiceStartName != NULL) + dwRequiredSize += wcslen(lpServiceStartName) + 1; + else + dwRequiredSize += 2; + + if (lpService->lpDisplayName != NULL) + dwRequiredSize += wcslen(lpService->lpDisplayName) + 1; + else + dwRequiredSize += 2; + + if (lpServiceConfig == NULL || cbBufSize < dwRequiredSize) + { + dwError = ERROR_INSUFFICIENT_BUFFER; + } + else + { + lpConfig = (LPQUERY_SERVICE_CONFIGA)lpServiceConfig; + lpConfig->dwServiceType = lpService->Status.dwServiceType; + lpConfig->dwStartType = lpService->dwStartType; + lpConfig->dwErrorControl = lpService->dwErrorControl; + lpConfig->dwTagId = lpService->dwTag; + + lpStr = (LPSTR)(lpServiceConfig + 1); + + /* NOTE: Strings that are NULL for QUERY_SERVICE_CONFIG are pointers to empty strings. + Verified in WINXP*/ + + if (lpImagePath) + { + WideCharToMultiByte(CP_ACP, + 0, + lpImagePath, + -1, + lpStr, + wcslen(lpImagePath), + 0, + 0); + } + else + { + strcpy(lpStr, lpEmptyString); + } + + lpConfig->lpBinaryPathName = (LPSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpConfig); + lpStr += (strlen((LPSTR)lpStr) + 1); + + if (lpService->lpGroup) + { + WideCharToMultiByte(CP_ACP, + 0, + lpService->lpGroup->lpGroupName, + -1, + lpStr, + wcslen(lpService->lpGroup->lpGroupName), + 0, + 0); + } + else + { + strcpy(lpStr, lpEmptyString); + } + + lpConfig->lpLoadOrderGroup = (LPSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpConfig); + lpStr += (strlen(lpStr) + 1); + + /* FIXME: Append Dependencies */ + strcpy(lpStr, lpEmptyString); + + lpConfig->lpDependencies = (LPSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpConfig); + lpStr += (strlen(lpStr) + 1); + + if (lpServiceStartName) + { + WideCharToMultiByte(CP_ACP, + 0, + lpServiceStartName, + -1, + lpStr, + wcslen(lpServiceStartName), + 0, + 0); + } + else + { + strcpy(lpStr, lpEmptyString); + } + + lpConfig->lpServiceStartName = (LPSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpConfig); + lpStr += (strlen(lpStr) + 1); + + if (lpService->lpDisplayName) + { + WideCharToMultiByte(CP_ACP, + 0, + lpService->lpDisplayName, + -1, + lpStr, + wcslen(lpService->lpDisplayName), + 0, + 0); + } + else + { + strcpy(lpStr, lpEmptyString); + } + + lpConfig->lpDisplayName = (LPSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpConfig); + } + + if (pcbBytesNeeded != NULL) + *pcbBytesNeeded = dwRequiredSize; + +Done:; + if (lpImagePath != NULL) + HeapFree(GetProcessHeap(), 0, lpImagePath); + + if (lpServiceStartName != NULL) + HeapFree(GetProcessHeap(), 0, lpServiceStartName); + + if (hServiceKey != NULL) + RegCloseKey(hServiceKey); + + /* FIXME: Unlock the service database */ + + DPRINT("RQueryServiceConfigA() done\n"); + + return dwError; } @@ -2559,8 +3660,97 @@ DWORD RGetServiceDisplayNameA( LPSTR lpDisplayName, LPBOUNDED_DWORD_4K lpcchBuffer) { - UNIMPLEMENTED; - return ERROR_CALL_NOT_IMPLEMENTED; +// PMANAGER_HANDLE hManager; + PSERVICE lpService; + DWORD dwLength; + DWORD dwError; + LPWSTR lpServiceNameW; + + DPRINT("RGetServiceDisplayNameA() called\n"); + DPRINT("hSCManager = %p\n", hSCManager); + DPRINT("lpServiceName: %s\n", lpServiceName); + DPRINT("lpDisplayName: %p\n", lpDisplayName); + DPRINT("*lpcchBuffer: %lu\n", *lpcchBuffer); + +// hManager = (PMANAGER_HANDLE)hSCManager; +// if (hManager->Handle.Tag != MANAGER_TAG) +// { +// DPRINT1("Invalid manager handle!\n"); +// return ERROR_INVALID_HANDLE; +// } + + dwLength = strlen(lpServiceName) + 1; + lpServiceNameW = HeapAlloc(GetProcessHeap(), + HEAP_ZERO_MEMORY, + dwLength * sizeof(WCHAR)); + if (!lpServiceNameW) + return ERROR_NOT_ENOUGH_MEMORY; + + MultiByteToWideChar(CP_ACP, + 0, + lpServiceName, + strlen(lpServiceName), + lpServiceNameW, + dwLength); + + lpService = ScmGetServiceEntryByName(lpServiceNameW); + + HeapFree(GetProcessHeap(), 0, lpServiceNameW); + + if (lpService == NULL) + { + DPRINT1("Could not find a service!\n"); + + /* If the service could not be found and lpcchBuffer is 0, windows + puts null in lpDisplayName and puts 1 in lpcchBuffer */ + if (*lpcchBuffer == 0) + { + *lpcchBuffer = 1; + *lpDisplayName = '\0'; + } + return ERROR_SERVICE_DOES_NOT_EXIST; + } + + if (!lpService->lpDisplayName) + { + dwLength = wcslen(lpService->lpServiceName); + if (lpServiceName != NULL && + *lpcchBuffer > dwLength) + { + WideCharToMultiByte(CP_ACP, + 0, + lpService->lpServiceName, + wcslen(lpService->lpServiceName), + lpDisplayName, + *lpcchBuffer, + NULL, + NULL); + return ERROR_SUCCESS; + } + } + else + { + dwLength = wcslen(lpService->lpDisplayName); + if (lpDisplayName != NULL && + *lpcchBuffer > dwLength) + { + WideCharToMultiByte(CP_ACP, + 0, + lpService->lpDisplayName, + wcslen(lpService->lpDisplayName), + lpDisplayName, + *lpcchBuffer, + NULL, + NULL); + return ERROR_SUCCESS; + } + } + + dwError = (*lpcchBuffer > dwLength) ? ERROR_SUCCESS : ERROR_INSUFFICIENT_BUFFER; + + *lpcchBuffer = dwLength * 2; + + return dwError; } @@ -2569,11 +3759,73 @@ DWORD RGetServiceKeyNameA( handle_t BindingHandle, SC_RPC_HANDLE hSCManager, LPSTR lpDisplayName, - LPSTR lpKeyName, + LPSTR lpServiceName, LPBOUNDED_DWORD_4K lpcchBuffer) { - UNIMPLEMENTED; - return ERROR_CALL_NOT_IMPLEMENTED; + PSERVICE lpService; + DWORD dwLength; + DWORD dwError; + LPWSTR lpDisplayNameW; + + DPRINT("RGetServiceKeyNameA() called\n"); + DPRINT("hSCManager = %p\n", hSCManager); + DPRINT("lpDisplayName: %s\n", lpDisplayName); + DPRINT("lpServiceName: %p\n", lpServiceName); + DPRINT("*lpcchBuffer: %lu\n", *lpcchBuffer); + + dwLength = strlen(lpDisplayName) + 1; + lpDisplayNameW = HeapAlloc(GetProcessHeap(), + HEAP_ZERO_MEMORY, + dwLength * sizeof(WCHAR)); + if (!lpDisplayNameW) + return ERROR_NOT_ENOUGH_MEMORY; + + MultiByteToWideChar(CP_ACP, + 0, + lpDisplayName, + strlen(lpDisplayName), + lpDisplayNameW, + dwLength); + + lpService = ScmGetServiceEntryByDisplayName(lpDisplayNameW); + + HeapFree(GetProcessHeap(), 0, lpDisplayNameW); + + if (lpService == NULL) + { + DPRINT1("Could not find the service!\n"); + + /* If the service could not be found and lpcchBuffer is 0, + put null in lpDisplayName and puts 1 in lpcchBuffer, verified WINXP. */ + if (*lpcchBuffer == 0) + { + *lpcchBuffer = 1; + *lpServiceName = '\0'; + } + + return ERROR_SERVICE_DOES_NOT_EXIST; + } + + dwLength = wcslen(lpService->lpServiceName); + if (lpService != NULL && + *lpcchBuffer > dwLength) + { + WideCharToMultiByte(CP_ACP, + 0, + lpService->lpServiceName, + wcslen(lpService->lpServiceName), + lpServiceName, + dwLength, + NULL, + NULL); + return ERROR_SUCCESS; + } + + dwError = (*lpcchBuffer > dwLength) ? ERROR_SUCCESS : ERROR_INSUFFICIENT_BUFFER; + + *lpcchBuffer = dwLength * 2; + + return dwError; } @@ -2717,8 +3969,102 @@ DWORD RQueryServiceConfig2A( DWORD cbBufSize, LPBOUNDED_DWORD_8K pcbBytesNeeded) { - UNIMPLEMENTED; - return ERROR_CALL_NOT_IMPLEMENTED; + DWORD dwError = ERROR_SUCCESS; + PSERVICE_HANDLE hSvc; + PSERVICE lpService = NULL; + HKEY hServiceKey = NULL; + DWORD dwRequiredSize; + LPWSTR lpDescriptionW = NULL; + LPSTR lpDescription = NULL; + + DPRINT("RQueryServiceConfig2W() called\n"); + + if (!lpBuffer) + return ERROR_INVALID_ADDRESS; + + if (ScmShutdown) + return ERROR_SHUTDOWN_IN_PROGRESS; + + hSvc = (PSERVICE_HANDLE)hService; + if (!hSvc || hSvc->Handle.Tag != SERVICE_TAG) + { + DPRINT1("Invalid handle tag!\n"); + return ERROR_INVALID_HANDLE; + } + + if (!RtlAreAllAccessesGranted(hSvc->Handle.DesiredAccess, + SERVICE_QUERY_CONFIG)) + { + DPRINT1("Insufficient access rights! 0x%lx\n", hSvc->Handle.DesiredAccess); + return ERROR_ACCESS_DENIED; + } + + lpService = hSvc->ServiceEntry; + if (lpService == NULL) + { + DPRINT1("lpService == NULL!\n"); + return ERROR_INVALID_HANDLE; + } + + /* FIXME: Lock the service database shared */ + + dwError = ScmOpenServiceKey(lpService->lpServiceName, + KEY_READ, + &hServiceKey); + if (dwError != ERROR_SUCCESS) + goto done; + + if (dwInfoLevel & SERVICE_CONFIG_DESCRIPTION) + { + LPSERVICE_DESCRIPTIONA lpServiceDescription = (LPSERVICE_DESCRIPTIONA)lpBuffer; + LPSTR lpStr; + + dwError = ScmReadString(hServiceKey, + L"Description", + &lpDescriptionW); + if (dwError != ERROR_SUCCESS) + goto done; + + dwRequiredSize = sizeof(SERVICE_DESCRIPTIONA) + ((wcslen(lpDescriptionW) + 1)); + + if (cbBufSize < dwRequiredSize) + { + *pcbBytesNeeded = dwRequiredSize; + dwError = ERROR_INSUFFICIENT_BUFFER; + goto done; + } + + lpStr = (LPSTR)(lpServiceDescription + 1); + + WideCharToMultiByte(CP_ACP, + 0, + lpDescriptionW, + -1, + lpStr, + wcslen(lpDescriptionW), + NULL, + NULL); + lpServiceDescription->lpDescription = (LPSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpServiceDescription); + } + else if (dwInfoLevel & SERVICE_CONFIG_FAILURE_ACTIONS) + { + UNIMPLEMENTED; + dwError = ERROR_CALL_NOT_IMPLEMENTED; + goto done; + } + +done: + if (lpDescription != NULL) + HeapFree(GetProcessHeap(), 0, lpDescription); + + if (hServiceKey != NULL) + RegCloseKey(hServiceKey); + + /* FIXME: Unlock database */ + + DPRINT("RQueryServiceConfig2W() done (Error %lu)\n", dwError); + + return dwError; } @@ -2740,6 +4086,9 @@ DWORD RQueryServiceConfig2W( DPRINT("RQueryServiceConfig2W() called\n"); + if (!lpBuffer) + return ERROR_INVALID_ADDRESS; + if (ScmShutdown) return ERROR_SHUTDOWN_IN_PROGRESS; @@ -2791,12 +4140,10 @@ DWORD RQueryServiceConfig2W( dwError = ERROR_INSUFFICIENT_BUFFER; goto done; } - else - { - lpStr = (LPWSTR)(lpServiceDescription + 1); - wcscpy(lpStr, lpDescription); - lpServiceDescription->lpDescription = (LPWSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpServiceDescription); - } + + lpStr = (LPWSTR)(lpServiceDescription + 1); + wcscpy(lpStr, lpDescription); + lpServiceDescription->lpDescription = (LPWSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpServiceDescription); } else if (dwInfoLevel & SERVICE_CONFIG_FAILURE_ACTIONS) { diff --git a/reactos/base/system/services/services.h b/reactos/base/system/services/services.h index 72343acf553..9bfb452195f 100644 --- a/reactos/base/system/services/services.h +++ b/reactos/base/system/services/services.h @@ -40,6 +40,7 @@ typedef struct _SERVICE PSERVICE_IMAGE lpImage; BOOL bDeleted; DWORD dwResumeCount; + DWORD dwRefCount; CLIENT_HANDLE hClient; SERVICE_STATUS Status; @@ -109,6 +110,7 @@ PSERVICE ScmGetServiceEntryByResumeCount(DWORD dwResumeCount); PSERVICE ScmGetServiceEntryByClientHandle(ULONG ThreadId); DWORD ScmCreateNewServiceRecord(LPWSTR lpServiceName, PSERVICE *lpServiceRecord); +VOID ScmDeleteServiceRecord(PSERVICE lpService); DWORD ScmMarkServiceForDelete(PSERVICE pService); DWORD ScmControlService(PSERVICE Service, diff --git a/reactos/base/system/system.rbuild b/reactos/base/system/system.rbuild index c70e061d76c..61a76f48c95 100644 --- a/reactos/base/system/system.rbuild +++ b/reactos/base/system/system.rbuild @@ -4,6 +4,9 @@ + + + diff --git a/reactos/baseaddress.rbuild b/reactos/baseaddress.rbuild index 45bb2d5addd..a00d0205734 100644 --- a/reactos/baseaddress.rbuild +++ b/reactos/baseaddress.rbuild @@ -127,11 +127,12 @@ + - + @@ -147,6 +148,8 @@ + + diff --git a/reactos/boot/bootdata/hivecls_arm.inf b/reactos/boot/bootdata/hivecls_arm.inf index 8167b2d011f..e1ae338347a 100644 --- a/reactos/boot/bootdata/hivecls_arm.inf +++ b/reactos/boot/bootdata/hivecls_arm.inf @@ -211,9 +211,9 @@ HKCR,"xmlfile\shell\open\command","",0x00020000,"%SystemRoot%\system32\notepad.e ; MSI files HKCR,".msi","",0x00000000,"MSI.Package" HKCR,"Msi.Package\DefaultIcon","",0x00000000,"msiexec.exe" -HKCR,"Msi.Package\shell\Open\command","",0x00020000,"%SystemRoot%\system32\msiexec /i %1" -HKCR,"Msi.Package\shell\Repair\command","",0x00020000,"%SystemRoot%\system32\msiexec /f %1" -HKCR,"Msi.Package\shell\Uninstall\command","",0x00020000,"%SystemRoot%\system32\msiexec /x %1" +HKCR,"Msi.Package\shell\Open\command","",0x00020000,"%SystemRoot%\system32\msiexec /i ""%1""" +HKCR,"Msi.Package\shell\Repair\command","",0x00020000,"%SystemRoot%\system32\msiexec /f ""%1""" +HKCR,"Msi.Package\shell\Uninstall\command","",0x00020000,"%SystemRoot%\system32\msiexec /x ""%1""" HKCR,".pif","",0x00000000,"piffile" diff --git a/reactos/boot/bootdata/hivecls_i386.inf b/reactos/boot/bootdata/hivecls_i386.inf index 8167b2d011f..e1ae338347a 100644 --- a/reactos/boot/bootdata/hivecls_i386.inf +++ b/reactos/boot/bootdata/hivecls_i386.inf @@ -211,9 +211,9 @@ HKCR,"xmlfile\shell\open\command","",0x00020000,"%SystemRoot%\system32\notepad.e ; MSI files HKCR,".msi","",0x00000000,"MSI.Package" HKCR,"Msi.Package\DefaultIcon","",0x00000000,"msiexec.exe" -HKCR,"Msi.Package\shell\Open\command","",0x00020000,"%SystemRoot%\system32\msiexec /i %1" -HKCR,"Msi.Package\shell\Repair\command","",0x00020000,"%SystemRoot%\system32\msiexec /f %1" -HKCR,"Msi.Package\shell\Uninstall\command","",0x00020000,"%SystemRoot%\system32\msiexec /x %1" +HKCR,"Msi.Package\shell\Open\command","",0x00020000,"%SystemRoot%\system32\msiexec /i ""%1""" +HKCR,"Msi.Package\shell\Repair\command","",0x00020000,"%SystemRoot%\system32\msiexec /f ""%1""" +HKCR,"Msi.Package\shell\Uninstall\command","",0x00020000,"%SystemRoot%\system32\msiexec /x ""%1""" HKCR,".pif","",0x00000000,"piffile" diff --git a/reactos/boot/bootdata/hivesft_i386.inf b/reactos/boot/bootdata/hivesft_i386.inf index 550eec22d37..34fd6c9e53a 100644 --- a/reactos/boot/bootdata/hivesft_i386.inf +++ b/reactos/boot/bootdata/hivesft_i386.inf @@ -28,6 +28,11 @@ HKLM,SOFTWARE\Microsoft\Active Setup\Installed Components\{de5aed00-a4bf-11d1-99 ; Common shell folders HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders",,0x00000012 HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders",,0x00000012 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\DefragPath",,0x00000012 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\DefragPath","",0x00020000,"%systemroot%\system32\dfrg.msc %c:" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\BackupPath",,0x00000012 +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\BackupPath","",0x00020000,"%SystemRoot%\system32\ntbackup.exe" + HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce",,0x00000012 HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons",,0x00000012 HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu",,0x00000012 diff --git a/reactos/boot/bootdata/hivesys_i386.inf b/reactos/boot/bootdata/hivesys_i386.inf index dc907b5e224..dac699cb343 100644 --- a/reactos/boot/bootdata/hivesys_i386.inf +++ b/reactos/boot/bootdata/hivesys_i386.inf @@ -25,6 +25,10 @@ HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E975-E325-11CE-BFC1-08002BE103 HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E975-E325-11CE-BFC1-08002BE10318}","NoDisplayClass",0x00000000,"1" HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E975-E325-11CE-BFC1-08002BE10318}","NoInstallClass",0x00000000,"1" +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{9D6D66A6-0B0C-4563-9077-A0E9A7955AE4}",,0x00000000,"Ramdisk" +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{9D6D66A6-0B0C-4563-9077-A0E9A7955AE4}","Class",0x00000000,"Ramdisk" +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{9D6D66A6-0B0C-4563-9077-A0E9A7955AE4}","Icon",0x00000000,"-5" + ; Default computer name settings HKLM,"SYSTEM\CurrentControlSet\Control\ComputerName",,0x00000012 HKLM,"SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName","ComputerName",0x00000002,"COMPUTERNAME" @@ -691,6 +695,7 @@ HKLM,"SYSTEM\CurrentControlSet\Control\ServiceGroupOrder","List",0x00010000, \ "PNP_TDI", \ "TDI", \ "PlugPlay", \ + "SpoolerGroup", \ "Extended Base" ; Set the timeout for directx/ReactX graphic surface lock see _EDD_DIRECTDRAW_GLOBAL struct for more info @@ -1009,6 +1014,17 @@ HKLM,"SYSTEM\CurrentControlSet\Services\Scsiport","ImagePath",0x00020000,"system HKLM,"SYSTEM\CurrentControlSet\Services\Scsiport","Start",0x00010001,0x00000000 HKLM,"SYSTEM\CurrentControlSet\Services\Scsiport","Type",0x00010001,0x00000001 +; Spooler service +HKLM,"SYSTEM\CurrentControlSet\Services\Spooler","DependOnService",0x00010000,"RPCSS" +HKLM,"SYSTEM\CurrentControlSet\Services\Spooler","DisplayName",0x00000000,"Printer Spooler" +HKLM,"SYSTEM\CurrentControlSet\Services\Spooler","Description",0x00000000,"Printer Spooler" +HKLM,"SYSTEM\CurrentControlSet\Services\Spooler","ErrorControl",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\Spooler","Group",0x00000000,"SpoolerGroup" +HKLM,"SYSTEM\CurrentControlSet\Services\Spooler","ImagePath",0x00020000,"%SystemRoot%\system32\spoolsv.exe" +HKLM,"SYSTEM\CurrentControlSet\Services\Spooler","ObjectName",0x00000000,"LocalSystem" +HKLM,"SYSTEM\CurrentControlSet\Services\Spooler","Start",0x00010001,0x00000002 +HKLM,"SYSTEM\CurrentControlSet\Services\Spooler","Type",0x00010001,0x00000110 + ; Simple TCP services HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","Description",0x00000000,"Supports the following TCP/IP services: Chargen, Daytime, Discard, Echo, QOTD" HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","DisplayName",0x00000000,"Simple TCP/IP Services" @@ -1025,6 +1041,13 @@ HKLM,"SYSTEM\CurrentControlSet\Services\fastfat","ImagePath",0x00020000,"system3 HKLM,"SYSTEM\CurrentControlSet\Services\fastfat","Start",0x00010001,0x00000000 HKLM,"SYSTEM\CurrentControlSet\Services\fastfat","Type",0x00010001,0x00000002 +; RAM Disk class driver +HKLM,"SYSTEM\CurrentControlSet\Services\RamDisk","ErrorControl",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\RamDisk","Group",0x00000000,"Boot File System" +HKLM,"SYSTEM\CurrentControlSet\Services\RamDisk","ImagePath",0x00020000,"system32\drivers\ramdisk.sys" +HKLM,"SYSTEM\CurrentControlSet\Services\RamDisk","Start",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\RamDisk","Type",0x00010001,0x00000002 + ; EXT2 Filesystem driver HKLM,"SYSTEM\CurrentControlSet\Services\Ext2fs","ErrorControl",0x00010001,0x00000000 HKLM,"SYSTEM\CurrentControlSet\Services\Ext2fs","Group",0x00000000,"Boot File System" diff --git a/reactos/boot/bootdata/packages/reactos.dff b/reactos/boot/bootdata/packages/reactos.dff index 9d97b16a4ac..38c050cf6a5 100644 --- a/reactos/boot/bootdata/packages/reactos.dff +++ b/reactos/boot/bootdata/packages/reactos.dff @@ -74,9 +74,11 @@ Signature = "$ReactOS$" ;base\applications\winhlp32\winhlp32.exe 1 ;base\applications\wordpad\wordpad.exe 1 +;base\services\audiosrv\audiosrv.exe 1 ;base\services\dhcp\dhcp.exe 1 ;base\services\eventlog\eventlog.exe 1 ;base\services\rpcss\rpcss.exe 1 +;base\services\spoolsv\spoolsv.exe 1 ;base\services\tcpsvcs\tcpsvcs.exe 1 ;base\services\tcpsvcs\quotes 5 ;base\services\umpnpmgr\umpnpmgr.exe 1 @@ -92,6 +94,7 @@ Signature = "$ReactOS$" ;base\shell\explorer-new\explorer_new.exe 4 optional ;base\system\autochk\autochk.exe 1 +;base\system\bootok\bootok.exe 1 ;base\system\format\format.exe 1 ;base\system\lsass\lsass.exe 1 ;base\system\msiexec\msiexec.exe 1 @@ -286,6 +289,7 @@ Signature = "$ReactOS$" ;dll\win32\netapi32\netapi32.dll 1 ;dll\win32\netcfgx\netcfgx.dll 1 ;dll\win32\netid\netid.dll 1 +;dll\win32\netshell\netshell.dll 1 ;dll\win32\newdev\newdev.dll 1 ;dll\win32\ntdsapi\ntdsapi.dll 1 ;dll\win32\ntmarta\ntmarta.dll 1 @@ -317,6 +321,8 @@ Signature = "$ReactOS$" ;dll\win32\sensapi\sensapi.dll 1 ;dll\win32\serialui\serialui.dll 1 ;dll\win32\setupapi\setupapi.dll 1 +;dll\win32\sfc\sfc.dll 1 +;dll\win32\sfc_os\sfc_os.dll 1 ;dll\win32\shdocvw\shdocvw.dll 1 ;dll\win32\shell32\shell32.dll 1 ;dll\win32\shfolder\shfolder.dll 1 @@ -325,6 +331,7 @@ Signature = "$ReactOS$" ;dll\win32\smdll\smdll.dll 1 ;dll\win32\snmpapi\snmpapi.dll 1 ;dll\win32\stdole2.tlb\stdole2.tlb 1 +;dll\win32\sxs\sxs.dll 1 ;dll\win32\syssetup\syssetup.dll 1 ;dll\win32\tapi32\tapi32.dll 1 ;dll\win32\tapiui\tapiui.dll 1 @@ -673,3 +680,7 @@ tools\dbgprint\dbgprint.exe 7 optional ; Native libraries ;modules\windows\mfc42.dll 1 optional +;modules\windows\vmx_fb.dll 1 optional +;modules\windows\vmx_mode.dll 1 optional +;modules\windows\vmx_svga.sys 2 optional +;modules\windows\vmx_svga.inf 6 optional diff --git a/reactos/boot/bootdata/txtsetup.sif b/reactos/boot/bootdata/txtsetup.sif index 2677de59f1b..d04d9586b03 100644 --- a/reactos/boot/bootdata/txtsetup.sif +++ b/reactos/boot/bootdata/txtsetup.sif @@ -33,6 +33,7 @@ pci.sys=,,,,,,,,,,,,4 scsiport.sys=,,,,,,x,,,,,,4 uniata.sys=,,,,,,,,,,,,4 fastfat.sys=,,,,,,x,,,,,,4 +;ramdisk.sys=,,,,,,x,,,,,,4 ;ext2.sys=,,,,,,x,,,,,,4 [HardwareIdsDatabase] diff --git a/reactos/boot/freeldr/freeldr/arch/i386/loader.c b/reactos/boot/freeldr/freeldr/arch/i386/loader.c index 5b02add3707..8877b656388 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/loader.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/loader.c @@ -96,7 +96,7 @@ FrLdrSetupPae(ULONG Magic) __writecr3(PageDirectoryBaseAddress); /* Enable Paging and Write Protect*/ - __writecr0(__readcr0() | X86_CR0_PG | X86_CR0_WP); + __writecr0(__readcr0() | CR0_PG | CR0_WP); /* Jump to Kernel */ (*KernelEntryPoint)(Magic, &LoaderBlock); diff --git a/reactos/boot/freeldr/freeldr/bootmgr.c b/reactos/boot/freeldr/freeldr/bootmgr.c index fc3b9a2fddb..1762c33731c 100644 --- a/reactos/boot/freeldr/freeldr/bootmgr.c +++ b/reactos/boot/freeldr/freeldr/bootmgr.c @@ -37,14 +37,6 @@ VOID RunLoader(VOID) return; } - // - // Check if we have a virtual RAM disk - // This is for x86 emulation -- on real hardware, the RAM disk will be - // located in one of the hardware memory descriptors as well as on the - // freeldr command-line - // - RamDiskCheckForVirtualFile(); - if (!IniFileInitialize()) { UiMessageBoxCritical("Error initializing .ini file"); diff --git a/reactos/boot/freeldr/freeldr/disk/ramdisk.c b/reactos/boot/freeldr/freeldr/disk/ramdisk.c index 6dc7f68ad4c..a8211a706ea 100644 --- a/reactos/boot/freeldr/freeldr/disk/ramdisk.c +++ b/reactos/boot/freeldr/freeldr/disk/ramdisk.c @@ -27,7 +27,7 @@ RamDiskGetDataAtOffset(IN PVOID Offset) // // Return data from our RAM Disk // - assert(((ULONG_PTR)gRamDiskBase + (ULONG_PTR)Offset) < + ASSERT(((ULONG_PTR)gRamDiskBase + (ULONG_PTR)Offset) < ((ULONG_PTR)gRamDiskBase + (ULONG_PTR)gRamDiskSize)); return (PVOID)((ULONG_PTR)gRamDiskBase + (ULONG_PTR)(Offset)); } @@ -83,35 +83,41 @@ RamDiskReadLogicalSectors(IN ULONG Reserved, VOID NTAPI -RamDiskCheckForVirtualFile(VOID) +RamDiskLoadVirtualFile(IN PCHAR FileName) { PFILE RamFile; ULONG TotalRead, ChunkSize; - + PCHAR MsgBuffer = "Loading ramdisk..."; + ULONG PercentPerChunk, Percent; + + // + // Display progress + // + UiDrawProgressBarCenter(1, 100, MsgBuffer); + // // Try opening the ramdisk file (this assumes the boot volume was opened) - // - RamFile = FsOpenFile("reactos.img"); + // + RamFile = FsOpenFile(FileName); if (RamFile) { // // Get the file size // gRamDiskSize = FsGetFileSize(RamFile); - TuiPrintf("Found virtual ramdisk (%dKB)\n", gRamDiskSize / 1024); if (!gRamDiskSize) return; // // Allocate memory for it // ChunkSize = 8 * 1024 * 1024; + Percent = PercentPerChunk = 100 / (gRamDiskSize / ChunkSize); gRamDiskBase = MmAllocateMemory(gRamDiskSize); if (!gRamDiskBase) return; - + // // Read it in chunks // - TuiPrintf("Loading ramdisk @ 0x%x...", gRamDiskBase); for (TotalRead = 0; TotalRead < gRamDiskSize; TotalRead += ChunkSize) { // @@ -124,11 +130,17 @@ RamDiskCheckForVirtualFile(VOID) // ChunkSize = gRamDiskSize - TotalRead; } - + + // + // Draw progress + // + UiDrawProgressBarCenter(Percent, 100, MsgBuffer); + Percent += PercentPerChunk; + // // Copy the contents // - TuiPrintf("."); + if (!FsReadFile(RamFile, ChunkSize, NULL, @@ -137,10 +149,9 @@ RamDiskCheckForVirtualFile(VOID) // // Fail // - TuiPrintf("Failed to read ramdisk\n"); + UiMessageBox("Failed to read ramdisk\n"); } } - TuiPrintf("\n"); } } diff --git a/reactos/boot/freeldr/freeldr/include/freeldr.h b/reactos/boot/freeldr/freeldr/include/freeldr.h index f18ad73e381..de65a557159 100644 --- a/reactos/boot/freeldr/freeldr/include/freeldr.h +++ b/reactos/boot/freeldr/freeldr/include/freeldr.h @@ -47,6 +47,7 @@ #include #include /* NDK, needed for ReactOS/Windows loaders */ +#include #include #include #include diff --git a/reactos/boot/freeldr/freeldr/include/ramdisk.h b/reactos/boot/freeldr/freeldr/include/ramdisk.h index f53e8861584..08378adfb6d 100644 --- a/reactos/boot/freeldr/freeldr/include/ramdisk.h +++ b/reactos/boot/freeldr/freeldr/include/ramdisk.h @@ -20,8 +20,8 @@ RamDiskSwitchFromBios( VOID NTAPI -RamDiskCheckForVirtualFile( - VOID +RamDiskLoadVirtualFile( + IN PCHAR FileName ); extern PVOID gRamDiskBase; diff --git a/reactos/boot/freeldr/freeldr/reactos/binhive.c b/reactos/boot/freeldr/freeldr/reactos/binhive.c index 1bffa8634da..457d40d16c5 100644 --- a/reactos/boot/freeldr/freeldr/reactos/binhive.c +++ b/reactos/boot/freeldr/freeldr/reactos/binhive.c @@ -285,6 +285,7 @@ RegImportBinaryHive(PCHAR ChunkBase, NULL); if (!NT_SUCCESS(Status)) { + CmpFree(CmHive, 0); DbgPrint((DPRINT_REGISTRY, "Invalid hive Signature!\n")); return FALSE; } diff --git a/reactos/boot/freeldr/freeldr/reactos/reactos.c b/reactos/boot/freeldr/freeldr/reactos/reactos.c index d661f0a35e8..df29ede3689 100644 --- a/reactos/boot/freeldr/freeldr/reactos/reactos.c +++ b/reactos/boot/freeldr/freeldr/reactos/reactos.c @@ -40,7 +40,7 @@ char reactos_arc_hardware_data[HW_MAX_ARC_HEAP_SIZE] = {0}; CHAR szHalName[255]; CHAR szBootPath[255]; CHAR SystemRoot[255]; -static CHAR szLoadingMsg[] = "Loading ReactOS..."; +static CHAR szLoadingMsg[] = "ReactOS is loading files..."; BOOLEAN FrLdrBootType; ULONG_PTR KernelBase; ROS_KERNEL_ENTRY_POINT KernelEntryPoint; @@ -576,6 +576,11 @@ LoadAndBootReactOS(PCSTR OperatingSystemName) PVOID LoadBase; ULONG_PTR Base; ULONG Size; + + // + // Backdrop + // + UiDrawBackdrop(); // // Open the operating system section @@ -588,13 +593,40 @@ LoadAndBootReactOS(PCSTR OperatingSystemName) return; } - UiDrawBackdrop(); - UiDrawStatusText("Detecting Hardware..."); - UiDrawProgressBarCenter(1, 100, szLoadingMsg); + // + // Read the command line + // + if (IniReadSettingByName(SectionId, "Options", value, sizeof(value))) + { + // + // Check if a ramdisk file was given + // + PCHAR File; + File = strstr(value, "/RDIMAGEPATH="); + if (File) + { + // + // Copy the file name and everything else after it + // + strcpy(szFileName, File + 13); + + // + // Null-terminate + // + *strstr(szFileName, " ") = ANSI_NULL; + + // + // Load the ramdisk + // + RamDiskLoadVirtualFile(szFileName); + } + } /* * Setup multiboot information structure */ + UiDrawProgressBarCenter(1, 100, szLoadingMsg); + UiDrawStatusText("Detecting Hardware..."); LoaderBlock.CommandLine = reactos_kernel_cmdline; LoaderBlock.PageDirectoryStart = (ULONG_PTR)&PageDirectoryStart; LoaderBlock.PageDirectoryEnd = (ULONG_PTR)&PageDirectoryEnd; diff --git a/reactos/boot/freeldr/freeldr/ui/minitui.c b/reactos/boot/freeldr/freeldr/ui/minitui.c index 47bd56f135d..bbc36a82dd8 100644 --- a/reactos/boot/freeldr/freeldr/ui/minitui.c +++ b/reactos/boot/freeldr/freeldr/ui/minitui.c @@ -65,7 +65,7 @@ VOID MiniTuiDrawProgressBar(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UL // // Draw the "Loading..." text // - TuiDrawCenteredText(Left + 2, Top + 1, Right - 2, Top + 1, "ReactOS is loading files...", ATTR(7, 0)); + TuiDrawCenteredText(Left + 2, Top + 1, Right - 2, Top + 1, ProgressText, ATTR(7, 0)); // Draw the percent complete for (i=0; i<(Position*ProgressBarWidth)/Range; i++) diff --git a/reactos/boot/freeldr/freeldr/windows/winldr.c b/reactos/boot/freeldr/freeldr/windows/winldr.c index 4bd5ee5002f..5b2976e033b 100644 --- a/reactos/boot/freeldr/freeldr/windows/winldr.c +++ b/reactos/boot/freeldr/freeldr/windows/winldr.c @@ -332,16 +332,16 @@ WinLdrLoadBootDrivers(PLOADER_PARAMETER_BLOCK LoaderBlock, while (NextBd != &LoaderBlock->BootDriverListHead) { - BootDriver = CONTAINING_RECORD(NextBd, BOOT_DRIVER_LIST_ENTRY, ListEntry); + BootDriver = CONTAINING_RECORD(NextBd, BOOT_DRIVER_LIST_ENTRY, Link); DbgPrint((DPRINT_WINDOWS, "BootDriver %wZ DTE %08X RegPath: %wZ\n", &BootDriver->FilePath, - BootDriver->DataTableEntry, &BootDriver->RegistryPath)); + BootDriver->LdrEntry, &BootDriver->RegistryPath)); // Paths are relative (FIXME: Are they always relative?) // Load it Status = WinLdrLoadDeviceDriver(LoaderBlock, BootPath, &BootDriver->FilePath, - 0, &BootDriver->DataTableEntry); + 0, &BootDriver->LdrEntry); // If loading failed - cry loudly //FIXME: Maybe remove it from the list and try to continue? @@ -353,9 +353,9 @@ WinLdrLoadBootDrivers(PLOADER_PARAMETER_BLOCK LoaderBlock, // Convert the RegistryPath and DTE addresses to VA since we are not going to use it anymore BootDriver->RegistryPath.Buffer = PaToVa(BootDriver->RegistryPath.Buffer); - BootDriver->DataTableEntry = PaToVa(BootDriver->DataTableEntry); + BootDriver->LdrEntry = PaToVa(BootDriver->LdrEntry); - NextBd = BootDriver->ListEntry.Flink; + NextBd = BootDriver->Link.Flink; } return TRUE; @@ -620,12 +620,12 @@ WinLdrpDumpBootDriver(PLOADER_PARAMETER_BLOCK LoaderBlock) while (NextBd != &LoaderBlock->BootDriverListHead) { - BootDriver = CONTAINING_RECORD(NextBd, BOOT_DRIVER_LIST_ENTRY, ListEntry); + BootDriver = CONTAINING_RECORD(NextBd, BOOT_DRIVER_LIST_ENTRY, Link); DbgPrint((DPRINT_WINDOWS, "BootDriver %wZ DTE %08X RegPath: %wZ\n", &BootDriver->FilePath, - BootDriver->DataTableEntry, &BootDriver->RegistryPath)); + BootDriver->LdrEntry, &BootDriver->RegistryPath)); - NextBd = BootDriver->ListEntry.Flink; + NextBd = BootDriver->Link.Flink; } } diff --git a/reactos/boot/freeldr/freeldr/windows/wlregistry.c b/reactos/boot/freeldr/freeldr/windows/wlregistry.c index 026b61050cb..20693ed0e2d 100644 --- a/reactos/boot/freeldr/freeldr/windows/wlregistry.c +++ b/reactos/boot/freeldr/freeldr/windows/wlregistry.c @@ -685,7 +685,7 @@ WinLdrAddDriverToList(LIST_ENTRY *BootDriverListHead, return FALSE; // DTE will be filled during actual load of the driver - BootDriverEntry->DataTableEntry = NULL; + BootDriverEntry->LdrEntry = NULL; // Check - if we have a valid ImagePath, if not - we need to build it // like "System32\\Drivers\\blah.sys" @@ -768,7 +768,7 @@ WinLdrAddDriverToList(LIST_ENTRY *BootDriverListHead, return FALSE; // Insert entry at top of the list - InsertTailList(BootDriverListHead, &BootDriverEntry->ListEntry); + InsertTailList(BootDriverListHead, &BootDriverEntry->Link); return TRUE; } diff --git a/reactos/boot/freeldr/rules.mak b/reactos/boot/freeldr/rules.mak deleted file mode 100644 index 67729c97081..00000000000 --- a/reactos/boot/freeldr/rules.mak +++ /dev/null @@ -1,4 +0,0 @@ -include $(PATH_TO_TOP)/rules.mak - -BIN2C = ..$(SEP)tools$(SEP)bin2c -FREELDR_TOOLS_PATH = ..$(SEP)tools diff --git a/reactos/dll/cpl/access/lang/it-IT.rc b/reactos/dll/cpl/access/lang/it-IT.rc index 01f776becd6..4e95bac8a8a 100644 --- a/reactos/dll/cpl/access/lang/it-IT.rc +++ b/reactos/dll/cpl/access/lang/it-IT.rc @@ -274,7 +274,7 @@ CAPTION "Impostazione tasti da seriale" FONT 8, "MS Shell Dlg" BEGIN GROUPBOX "Tasti da seriale",-1,PROPSHEETPADDING(1),LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(10) - LTEXT "Choose the port where you connect an alternative input device.",-1,PROPSHEETPADDING(2),LABELLINE(2),PROPSHEETWIDTH-PROPSHEETPADDING(4),LABELLINE(2) + LTEXT "Scegliere la porta dove verrа connesso il dispositivo di input alternativo.",-1,PROPSHEETPADDING(2),LABELLINE(2),PROPSHEETWIDTH-PROPSHEETPADDING(4),LABELLINE(2) LTEXT "&Porta seriale:",-1,PROPSHEETPADDING(2),LABELLINE(3)+5,PROPSHEETWIDTH-PROPSHEETPADDING(4),LABELLINE(2) COMBOBOX IDC_SERIAL_PORT_COMBO, PROPSHEETPADDING(2), LABELLINE(4)+7, PROPSHEETWIDTH-PROPSHEETPADDING(4), LABELLINE(6), diff --git a/reactos/dll/cpl/access/lang/no-NO.rc b/reactos/dll/cpl/access/lang/no-NO.rc index 1c2914c47d2..92adee75ad2 100644 --- a/reactos/dll/cpl/access/lang/no-NO.rc +++ b/reactos/dll/cpl/access/lang/no-NO.rc @@ -223,7 +223,7 @@ STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Avanserte innstillinger for filtertaster" FONT 8, "MS Shell Dlg" BEGIN - GROUPBOX "Bounce Keys",-1,PROPSHEETPADDING(1),LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(5) + GROUPBOX "Gjentatt taster",-1,PROPSHEETPADDING(1),LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(5) LTEXT "&Ignorer tastetrykk som gjentas raskere enn:",-1,PROPSHEETPADDING(2),LABELLINE(2)+1,PROPSHEETWIDTH-PROPSHEETPADDING(4),LABELLINE(2) COMBOBOX IDC_BOUNCE_TIME_COMBO, PROPSHEETPADDING(2), LABELLINE(3)+5, PROPSHEETWIDTH-PROPSHEETPADDING(4), LABELLINE(6), CBS_DROPDOWNLIST | WS_VSCROLL | WS_VISIBLE | WS_TABSTOP @@ -241,7 +241,7 @@ STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Avanserte innstillinger for filtertaster" FONT 8, "MS Shell Dlg" BEGIN - GROUPBOX "Repeat Keys",-1,PROPSHEETPADDING(1),LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(12) + GROUPBOX "Repetisjontaster",-1,PROPSHEETPADDING(1),LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(12) LTEXT "Overstyr innstillingene under tastatur i kontrollpanel:",-1,PROPSHEETPADDING(2),LABELLINE(2),PROPSHEETWIDTH-PROPSHEETPADDING(4),LABELLINE(2) AUTORADIOBUTTON "&Ingen repetisjon",IDC_REPEAT_NOREPEAT_RADIO,PROPSHEETPADDING(2),LABELLINE(3)+3,78,LABELLINE(1),WS_GROUP diff --git a/reactos/dll/cpl/appwiz-new/lang/no-NO.rc b/reactos/dll/cpl/appwiz-new/lang/no-NO.rc index 1f9c89d3c49..b85a4fcb07f 100644 --- a/reactos/dll/cpl/appwiz-new/lang/no-NO.rc +++ b/reactos/dll/cpl/appwiz-new/lang/no-NO.rc @@ -26,8 +26,8 @@ CAPTION "Opprett snarvei" FONT 8, "MS Shell Dlg" BEGIN CONTROL "", IDB_WATERMARK, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 0, 0, WATERMARK_WIDTH, SHORTCUTDLG_HEIGHT - LTEXT "This wizard helps you to create shortcuts to local or network programs, files, folders, computers, or Internet addresses.", -1, 97, 7, 195, 28 - LTEXT "&Type the location of the item:", IDC_LOCATIONITEM, 98, 46, 196, 8 + LTEXT "Denne veiviseren vil hjelpe deg med е opprette en snarvei til lokale programmer eller nettverksprogrammer, filer, mapper, datamaskiner, eller internett addresser.", -1, 97, 7, 195, 28 + LTEXT "&Velg plasseringen for enheten:", IDC_LOCATIONITEM, 98, 46, 196, 8 EDITTEXT IDC_LOCITEMEDIT, 97, 58, 133, 14, ES_AUTOHSCROLL PUSHBUTTON "B&la gjennom...", IDC_LOCBROWSE, 233, 58, 60, 14 LTEXT "Klikk pе neste for е forsette.", -1, 97, 95, 198, 8 @@ -46,10 +46,10 @@ END IDD_SELPROGTITLE DIALOGEX 0, 0, SHORTCUTDLG_WIDTH, SHORTCUTDLG_HEIGHT STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION -CAPTION "Select a Title for the Program" +CAPTION "Velg en tittel for programmet" FONT 8, "MS Shell Dlg" BEGIN - LTEXT "&Type a name for this shortcut:", -1, 100, 10, 194, 10 + LTEXT "&Velg et navn for denne snarveien:", -1, 100, 10, 194, 10 EDITTEXT IDC_NAMESCEDIT, 100, 23, 194, 14, ES_AUTOHSCROLL CONTROL "", IDB_WATERMARK, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 0, 0, WATERMARK_WIDTH, SHORTCUTDLG_HEIGHT LTEXT "Klikk fullfшrt for е opprette snarveien.", -1, 100, 61, 194, 8 @@ -94,18 +94,18 @@ CAPTION "Endre bruker valg" FONT 8, "MS Shell Dlg" BEGIN CONTROL "", IDB_WATERMARK, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 0, 0, WATERMARK_WIDTH, SHORTCUTDLG_HEIGHT - LTEXT "You have the option to make this new program available to every User.", 1012, 101, 5, 194, 40 + LTEXT "Du har valget for е gjшre dette nye programmet tilgjengelig for alle brukere.", 1012, 101, 5, 194, 40 AUTORADIOBUTTON "Installere", IDC_INSTALLRB, 108, 51, 146, 14, BS_MULTILINE | WS_GROUP AUTORADIOBUTTON "Kjшr", IDC_LOCATIONITEM, 108, 74, 146, 14, BS_MULTILINE | NOT WS_TABSTOP END IDD_FINISHADMINST DIALOG 0, 0, SHORTCUTDLG_WIDTH, SHORTCUTDLG_HEIGHT STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION -CAPTION "Finish Admin Install" +CAPTION "Fullfшre admin installasjon" FONT 8, "MS Shell Dlg" BEGIN CONTROL "", IDB_WATERMARK, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 0, 0, WATERMARK_WIDTH, SHORTCUTDLG_HEIGHT - LTEXT "Change ini mapping back by clicking Finish.", IDC_HEADTEXT, 98, 7, 196, 40 + LTEXT "Endre ini mapper tilbake ved е trykke pе Fullfшrt.", IDC_HEADTEXT, 98, 7, 196, 40 END IDD_AFTERINST DIALOG 0, 0, SHORTCUTDLG_WIDTH, SHORTCUTDLG_HEIGHT @@ -122,8 +122,8 @@ STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION CAPTION "Kjшr installasjons program" FONT 8, "MS Shell Dlg" BEGIN - LTEXT "Please specify the uninstall program location.", IDC_UNINSTLOCTEXT, 9, 8, 235, 37 - LTEXT "&Command line for the uninstall program:", IDC_LOCATIONITEM, 9, 57, 237, 8 + LTEXT "Vennligst velg avinnstalleringsprogram plassering.", IDC_UNINSTLOCTEXT, 9, 8, 235, 37 + LTEXT "&Komando linje for avinnstalleringsprogrammet:", IDC_LOCATIONITEM, 9, 57, 237, 8 EDITTEXT IDC_LOCITEMEDIT, 7, 69, 165, 14, ES_AUTOHSCROLL PUSHBUTTON "B&la gjennom...", IDC_LOCBROWSE, 178, 69, 66, 14 DEFPUSHBUTTON "OK", IDOK, 118, 100, 60, 14 @@ -136,9 +136,9 @@ CAPTION "Advarsel" FONT 8, "MS Shell Dlg" BEGIN ICON "", IDC_WARNINGICON, 8, 10, 20, 20 - LTEXT "There are other users logged on to this computer.", -1, 37, 8, 214, 10 - LTEXT "If you uninstall this program while another user is running it, the program might not uninstall completely.", -1, 37, 23, 212, 22 - LTEXT "To properly change or remove this program, switch to and log off each user before you continue.", IDC_WARNINGTEXT, 37, 46, 212, 26 + LTEXT "Det er andre brukere som er logget pе denne datamaskinen.", -1, 37, 8, 214, 10 + LTEXT "Hvis du vil avinstallere dette programmet mens en annen bruker det, vil ikke programmet bli fjernet fullstendig.", -1, 37, 23, 212, 22 + LTEXT "For е fullstendig endre eller fjerne dette programmet, bytt til og logg av alle brukere fшr du fortsetter.", IDC_WARNINGTEXT, 37, 46, 212, 26 PUSHBUTTON "&Bytt bruker", IDC_SWITCHUSER, 61, 81, 60, 14 PUSHBUTTON "&Fortsett", IDOK, 125, 81, 60, 14 PUSHBUTTON "Avbryt", IDCANCEL, 189, 81, 60, 14 @@ -149,7 +149,7 @@ STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBL CAPTION "Fjern snarveier/mapper" FONT 8, "MS Shell Dlg" BEGIN - LTEXT "&To remove an item from the Start menu, select the item and click Remove.", IDC_UNINSTLOCTEXT, 10, 7, 204, 16 + LTEXT "&For е fjerne en enhet fra Start menyen, velg en enhet og trykk pе Fjern.", IDC_UNINSTLOCTEXT, 10, 7, 204, 16 CONTROL "", IDC_SELFOLDER, "SYSTREEVIEW32", WS_BORDER | WS_TABSTOP | 0x00000023, 10, 28, 200, 145 PUSHBUTTON "&Fjern", IDC_REMOVEBTN, 84, 182, 60, 14 DEFPUSHBUTTON "Lukk", IDOK, 151, 182, 60, 14 @@ -160,10 +160,10 @@ STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTERMOUSE | WS_POPUPWINDOW | WS_CAPTIO CAPTION "Legg til senere" FONT 8, "MS Shell Dlg" BEGIN - LTEXT "You may choose a date and time when you would like to add this program to your computer. For example, you can schedule this to happen when you are away from your computer.", IDC_UNINSTLOCTEXT, 7, 4, 208, 33 - AUTORADIOBUTTON "&Add program later", IDC_ADDPROGLATER, 7, 47, 207, 10, WS_GROUP + LTEXT "Du kan ha valgt en dato og tid nеr du vil legge til dette programmet til din datamaskin. For eksempel, kan du planlegge det som skal skje nеr du er borte din datamaskin.", IDC_UNINSTLOCTEXT, 7, 4, 208, 33 + AUTORADIOBUTTON "&Legg til et program senere", IDC_ADDPROGLATER, 7, 47, 207, 10, WS_GROUP CONTROL "Picker", 12368, "SYSDATETIMEPICK32", WS_BORDER | WS_TABSTOP | 0x0000000C, 29, 62, 107, 14 - AUTORADIOBUTTON "&Do not add program", IDC_NOTADDPROG, 7, 87, 208, 10 + AUTORADIOBUTTON "&Ikke legg til programmer", IDC_NOTADDPROG, 7, 87, 208, 10 DEFPUSHBUTTON "OK", IDOK, 89, 141, 60, 14, WS_GROUP PUSHBUTTON "Avbryt", IDCANCEL, 154, 141, 60, 14, NOT WS_TABSTOP END @@ -172,7 +172,7 @@ STRINGTABLE BEGIN IDS_CPLSYSTEMNAME "Legg til eller fjern programmer" IDS_CPLSYSTEMDESCRIPTION "Innstaller eller fjern programmer og ReactOS komponenter." - IDS_UNABLEOPEN_UNINSTKEY "Unable to open Uninstall Key" + IDS_UNABLEOPEN_UNINSTKEY "Ikke mulig е еpne avinnstallering nшkkel" IDS_LIST_TITLE "Liste" IDS_SIZE_TITLE "Stшrrelse (MB)" IDS_LAST_USED "Sist bruk" @@ -180,11 +180,11 @@ BEGIN IDS_PROGRAMS_ONLY "Bare programmer" IDS_UPDATES_ONLY "Bare oppdateringer" IDS_WELCOME_TITLE "Velkommen til assistenten for е legg til eller fjerne programmer" - IDS_WELCOME_MSG "Please choose a category on the left or select application on the list for removing or viewing information." + IDS_WELCOME_MSG "Venligst velg en kategori til venstre eller velg et program pе listen for е fjerne eller vise informasjon." IDS_SEARCH_TEXT "Sшk i listen..." IDS_REMOVE_BTN "&Fjern" IDS_MODIFY_BTN "&Endre" - IDS_UNABLEREAD_UNINSTSTR "Unable to read UninstallString. This entry is invalid or has been created by an MSI installer." + IDS_UNABLEREAD_UNINSTSTR "Ikke mulig е lese Avinnstallerings streng. Denne enheten er ugyldig eller har blitt opprettet av en MSI installering." IDS_INF_REG_OWNER "Registerert eier: " IDS_INF_PRODUCT_ID "Produkt ID: " IDS_INF_PUBLISHER "Utgiver: " @@ -193,7 +193,7 @@ BEGIN IDS_INF_SUP_INFO "Hjelp informasjon: " IDS_INF_SUP_PHONE "Hjelp telefon: " IDS_INF_PRODUCT_UPD "Produkt oppdateringer: " - IDS_INF_README "Readme: " + IDS_INF_README "Les meg: " IDS_INF_COMMENTS "Kommentarer: " IDS_NO_INFORMATION "Ingen informasjon om dette programmet." END diff --git a/reactos/dll/cpl/desk/lang/bg-BG.rc b/reactos/dll/cpl/desk/lang/bg-BG.rc index a3e0c427426..eedfe1ba9e8 100644 --- a/reactos/dll/cpl/desk/lang/bg-BG.rc +++ b/reactos/dll/cpl/desk/lang/bg-BG.rc @@ -42,7 +42,7 @@ BEGIN CONTROL "Искане на парола при изход",IDC_SCREENS_USEPASSCHK,"button", BS_AUTOCHECKBOX | WS_TABSTOP, 108, 120, 126, 19 GROUPBOX "&Енергоспестяващи възможности на монитора", IDC_SCREENS_DUMMY2, 6, 155, 232, 41 - LTEXT "За настройка захранването на монитора си, натиснете 'Захранване...'", + LTEXT "За настройка захранването на монитора си, натиснете „Захранване...“.", IDC_STATIC, 14, 166, 146 ,20 PUSHBUTTON "Захранване...", IDC_SCREENS_POWER_BUTTON, 176, 171, 60, 13 END diff --git a/reactos/dll/cpl/desk/lang/fr-FR.rc b/reactos/dll/cpl/desk/lang/fr-FR.rc index 7ef56de6a5e..24005bdd803 100644 --- a/reactos/dll/cpl/desk/lang/fr-FR.rc +++ b/reactos/dll/cpl/desk/lang/fr-FR.rc @@ -54,7 +54,7 @@ FONT 8, "MS Shell Dlg" BEGIN CONTROL "", IDC_APPEARANCE_PREVIEW, "PreviewWndClass", WS_VISIBLE | WS_BORDER, 7, 7, 232, 120 - LTEXT "Colorscheme", IDC_STATIC, 7, 140, 64, 7 + LTEXT "Modиle de couleurs", IDC_STATIC, 7, 140, 64, 7 COMBOBOX IDC_APPEARANCE_UI_ITEM, 7, 169, 120, 54, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "Avancй", IDC_APPEARANCE_ADVANCED, 182, 150, 56, 15 END @@ -81,7 +81,7 @@ BEGIN LTEXT "&2иme Couleur :", IDC_ADVAPPEARANCE_COLOR2_T, 216, 160, 40, 9 CHECKBOX "-", IDC_ADVAPPEARANCE_COLOR2_B, 216, 170, 28, 13, BS_PUSHLIKE | BS_BITMAP - LTEXT "Fonte :", IDC_ADVAPPEARANCE_FONT_T, 5, 190, 50, 8 + LTEXT "Police :", IDC_ADVAPPEARANCE_FONT_T, 5, 190, 50, 8 COMBOBOX IDC_ADVAPPEARANCE_FONT_C, 5, 200, 130, 90, CBS_DROPDOWN | CBS_HASSTRINGS | CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "Taille :", IDC_ADVAPPEARANCE_FONTSIZE_T, 142, 190, 39, 8 diff --git a/reactos/dll/cpl/desk/lang/no-NO.rc b/reactos/dll/cpl/desk/lang/no-NO.rc index a7a1e6d6d2b..c8dd590f63d 100644 --- a/reactos/dll/cpl/desk/lang/no-NO.rc +++ b/reactos/dll/cpl/desk/lang/no-NO.rc @@ -37,8 +37,8 @@ BEGIN UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 54, 123, 12, 13 LTEXT "minutter", IDC_MINTEXT, 70, 125, 26, 9 - CONTROL "Spшr etter &passord ved gjennopptakelse.",IDC_SCREENS_USEPASSCHK,"button", - BS_AUTOCHECKBOX | WS_TABSTOP, 108, 120, 104, 19 + CONTROL "Krev &passord ved gjenopptakelse.",IDC_SCREENS_USEPASSCHK,"button", + BS_AUTOCHECKBOX | WS_TABSTOP, 108, 120, 125, 19 GROUPBOX "&Strшmsparing funksjon", IDC_SCREENS_DUMMY2, 6, 155, 232, 41 LTEXT "For е tilpasse strшminnstillingene for din skjerm, klikk pе strшm innstillingene.", IDC_STATIC, 14, 166, 146 ,20 @@ -53,7 +53,7 @@ FONT 8, "MS Shell Dlg" BEGIN CONTROL "", IDC_APPEARANCE_PREVIEW, "PreviewWndClass", WS_VISIBLE | WS_BORDER, 7, 7, 232, 120 - LTEXT "Fargevalg", IDC_STATIC, 7, 140, 64, 7 + LTEXT "Fargevalg", IDC_STATIC, 7, 140, 64, 9 COMBOBOX IDC_APPEARANCE_COLORSCHEME, 7, 150, 134, 90 , CBS_DROPDOWNLIST | CBS_HASSTRINGS | CBS_SORT | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "Avansert", IDC_APPEARANCE_ADVANCED, 182, 150, 56, 15 END @@ -70,23 +70,23 @@ BEGIN LTEXT "Element:", 8, 5, 160, 50, 9 COMBOBOX IDC_ADVAPPEARANCE_ELEMENT, 5, 170, 130, 90, CBS_DROPDOWNLIST | CBS_HASSTRINGS | CBS_SORT | WS_CHILD | WS_VSCROLL | WS_TABSTOP - LTEXT "&Stшrrelse", IDC_ADVAPPEARANCE_SIZE_T, 142, 164, 20, 9 + LTEXT "&Stшrrelse", IDC_ADVAPPEARANCE_SIZE_T, 142, 160, 64, 9 EDITTEXT IDC_ADVAPPEARANCE_SIZE_E, 142, 170, 38, 13, ES_RIGHT | WS_GROUP CONTROL "", IDC_ADVAPPEARANCE_SIZE_UD, UPDOWN_CLASS, UDS_AUTOBUDDY | WS_BORDER | WS_GROUP | UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_SETBUDDYINT | WS_CHILD | WS_VISIBLE, 172, 170, 10, 13 - LTEXT "&Farge 1:", IDC_ADVAPPEARANCE_COLOR1_T, 184, 160, 40, 9 + LTEXT "&Farge 1:", IDC_ADVAPPEARANCE_COLOR1_T, 184, 160, 44, 9 CHECKBOX "-", IDC_ADVAPPEARANCE_COLOR1_B, 184, 170, 28, 13, BS_PUSHLIKE | BS_BITMAP - LTEXT "&Farge 2:", IDC_ADVAPPEARANCE_COLOR2_T, 216, 160, 40, 9 + LTEXT "&Farge 2:", IDC_ADVAPPEARANCE_COLOR2_T, 216, 160, 44, 9 CHECKBOX "-", IDC_ADVAPPEARANCE_COLOR2_B, 216, 170, 28, 13, BS_PUSHLIKE | BS_BITMAP - LTEXT "Skrift:", IDC_ADVAPPEARANCE_FONT_T, 5, 190, 50, 8 + LTEXT "Skrift:", IDC_ADVAPPEARANCE_FONT_T, 5, 190, 60, 8 COMBOBOX IDC_ADVAPPEARANCE_FONT_C, 5, 200, 130, 90, CBS_DROPDOWN | CBS_HASSTRINGS | CBS_SORT | WS_VSCROLL | WS_TABSTOP - LTEXT "Skrift stшrrelse:", IDC_ADVAPPEARANCE_FONTSIZE_T, 142, 190, 41, 8 + LTEXT "Stшrrelse:", IDC_ADVAPPEARANCE_FONTSIZE_T, 142, 190, 64, 8 COMBOBOX IDC_ADVAPPEARANCE_FONTSIZE_E, 142, 200, 38, 200, CBS_DROPDOWN | WS_VSCROLL - LTEXT "Farger:", IDC_ADVAPPEARANCE_FONTCOLOR_T, 184, 194, 20, 9 + LTEXT "Farger:", IDC_ADVAPPEARANCE_FONTCOLOR_T, 184, 190, 25, 9 CHECKBOX "", IDC_ADVAPPEARANCE_FONTCOLOR_B, 184, 200, 28, 13, BS_PUSHLIKE | BS_BITMAP AUTOCHECKBOX "B", IDC_ADVAPPEARANCE_FONTBOLD, 216, 200, 14, 13, BS_PUSHLIKE @@ -108,7 +108,7 @@ BEGIN GROUPBOX "&Skjermomrеde",1818,3,127,115,43 CONTROL "",IDC_SETTINGS_RESOLUTION,"msctls_trackbar32", TBS_AUTOTICKS | WS_TABSTOP, 30, 137, 58, 17 - LTEXT "Mindre",1815,9,137,15,8,NOT WS_GROUP + LTEXT "Mindre",1815,9,137,21,8,NOT WS_GROUP LTEXT "Mere",1816,93,137,21,8,NOT WS_GROUP LTEXT "",IDC_SETTINGS_RESOLUTION_TEXT,10,157,100,10,NOT WS_GROUP | SS_CENTER GROUPBOX "&Farger",1817,125,127,115,43 @@ -149,7 +149,7 @@ BEGIN MENUITEM "&Primary", ID_MENU_PRIMARY MENUITEM SEPARATOR MENUITEM "&Identify", ID_MENU_IDENTIFY - MENUITEM "P&roperties", ID_MENU_PROPERTIES + MENUITEM "E&genskaper", ID_MENU_PROPERTIES END END @@ -204,7 +204,7 @@ BEGIN IDS_ELEMENT_4 "Caption of active windows" IDS_ELEMENT_5 "Border of active windows" IDS_ELEMENT_6 "Meny" - IDS_ELEMENT_7 "Selected Items" + IDS_ELEMENT_7 "Valgt enhet" IDS_ELEMENT_8 "Vindu" IDS_ELEMENT_9 "Scrollbars" IDS_ELEMENT_10 "3D objects" diff --git a/reactos/dll/cpl/input/lang/bg-BG.rc b/reactos/dll/cpl/input/lang/bg-BG.rc index ac6fea2c55c..1386a665147 100644 --- a/reactos/dll/cpl/input/lang/bg-BG.rc +++ b/reactos/dll/cpl/input/lang/bg-BG.rc @@ -47,22 +47,22 @@ END IDD_CHANGE_KEY_SEQ DIALOGEX 5, 100, 230, 125 STYLE DS_SHELLFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION -CAPTION "Change Key Sequence" +CAPTION "Смяна на клавишното съчетание" FONT 8, "MS Shell Dlg" BEGIN GROUPBOX "", -1, 9, 5, 155, 110 - AUTOCHECKBOX "&Switch input languages", IDC_SWITCH_INPUT_LANG_CB, 15, 15, 105, 12 + AUTOCHECKBOX "&Смяна езика на въвеждане", IDC_SWITCH_INPUT_LANG_CB, 15, 15, 105, 12 LTEXT "Shift", -1, 73, 37, 27, 12 CTEXT "+", -1, 62, 37, 8, 9 AUTORADIOBUTTON "&Ctrl", IDC_CTRL_LANG, 29, 31, 30, 11 - AUTORADIOBUTTON "Left &ALT", IDC_LEFT_ALT_LANG, 29, 45, 46, 12 - AUTOCHECKBOX "S&witch keyboard layouts", IDC_SWITCH_KBLAYOUTS_CB, 16, 65, 141, 12 + AUTORADIOBUTTON "Ляв &ALT", IDC_LEFT_ALT_LANG, 29, 45, 46, 12 + AUTOCHECKBOX "С&мяна на подредбите", IDC_SWITCH_KBLAYOUTS_CB, 16, 65, 141, 12 LTEXT "Shift", -1, 74, 87, 27, 12 CTEXT "+", -1, 63, 87, 8, 9 AUTORADIOBUTTON "C&trl", IDC_CTRL_LAYOUT, 30, 81, 30, 11 - AUTORADIOBUTTON "Left A<", IDC_LEFT_ALT_LAYOUT, 30, 95, 44, 12 - DEFPUSHBUTTON "OK", IDOK, 172, 9, 50, 14 - PUSHBUTTON "Cancel", IDCANCEL, 172, 27, 50, 14 + AUTORADIOBUTTON "Ляв A<", IDC_LEFT_ALT_LAYOUT, 30, 95, 44, 12 + DEFPUSHBUTTON "Добре", IDOK, 172, 9, 50, 14 + PUSHBUTTON "Отказ", IDCANCEL, 172, 27, 50, 14 END IDD_INPUT_LANG_PROP DIALOGEX 20, 20, 227, 75 @@ -89,13 +89,13 @@ BEGIN IDS_WHATS_THIS "Какво е това?" IDS_LANGUAGE "Език" IDS_LAYOUT "Клавиатурна подредба" - IDS_REM_QUESTION "Do you want to remove selected keyboard layout?" - IDS_CONFIRMATION "Confirmation" - IDS_LAYOUT_EXISTS "This layout already exists." - IDS_LAYOUT_EXISTS2 "This layout already exists and can not be added." + IDS_REM_QUESTION "Искате ли да премахнете избраната подредба?" + IDS_CONFIRMATION "Потвърждение" + IDS_LAYOUT_EXISTS "Подредбата вече съществува." + IDS_LAYOUT_EXISTS2 "Подредбата вече съществува и не може да бъде добавена." IDS_CTRL_SHIFT "Ctrl+Shift" - IDS_LEFT_ALT_SHIFT "Left Alt+Shift" - IDS_SWITCH_BET_INLANG "Switch between input languages" + IDS_LEFT_ALT_SHIFT "Ляв Alt+Shift" + IDS_SWITCH_BET_INLANG "Превключване на езиците за въвеждане" END STRINGTABLE @@ -232,10 +232,10 @@ BEGIN IDS_DIVEHI_TYPEWRITER_LAYOUT, "Дхивехска малтийска" IDS_BULGARIAN_PHONETIC_CLASSIC_LAYOUT, "Българска ЯВЕРТЪ" IDS_BULGARIAN_PHONETIC_BDS_LAYOUT, "Българска ЧШЕРТЪ" - IDS_BULGARIAN_BDS_LAYOUT, "Bulgarian BDS 5237-1978" - IDS_GERMAN_RISTOME_LAYOUT, "German (RISTOME)" - IDS_GERMAN_NEO_11_LAYOUT, "German (NEO-1.1)" - IDS_GERMAN_DE_ERGO_LAYOUT, "German (de_ergo)" - IDS_BURMESE_LAYOUT, "Burmese" - IDS_UKRAINIAN_STUDENT_LAYOUT, "Ukrainian (Student)" + IDS_BULGARIAN_BDS_LAYOUT, "Българска 5237-1978" + IDS_GERMAN_RISTOME_LAYOUT, "Немска (RISTOME)" + IDS_GERMAN_NEO_11_LAYOUT, "Немска (NEO-1.1)" + IDS_GERMAN_DE_ERGO_LAYOUT, "Немска (de_ergo)" + IDS_BURMESE_LAYOUT, "Бирманска" + IDS_UKRAINIAN_STUDENT_LAYOUT, "Украинска (Student)" END diff --git a/reactos/dll/cpl/main/lang/no-NO.rc b/reactos/dll/cpl/main/lang/no-NO.rc index 01432755562..f7b9dab3c07 100644 --- a/reactos/dll/cpl/main/lang/no-NO.rc +++ b/reactos/dll/cpl/main/lang/no-NO.rc @@ -8,14 +8,14 @@ BEGIN GROUPBOX "Repetisjonshastighet", -1, 5, 5, 236, 135 ICON IDI_REPEAT_DELAY, IDC_ICON_REPEAT_DELAY, 13, 18, 15, 15 LTEXT "Repetisjon&forsinkelse:", -1, 40, 18, 100, 10 - LTEXT "Lang", -1, 40, 33, 20, 10 - LTEXT "Kort", -1, 200, 33, 20, 10 - CONTROL "",IDC_SLIDER_REPEAT_DELAY, "msctls_trackbar32", TBS_AUTOTICKS | WS_TABSTOP, 65, 33, 130, 17 + LTEXT "Lang", -1, 40, 33, 52, 10 + LTEXT "Kort", -1, 210, 33, 20, 10 + CONTROL "",IDC_SLIDER_REPEAT_DELAY, "msctls_trackbar32", TBS_AUTOTICKS | WS_TABSTOP, 75, 33, 130, 17 ICON IDI_REPEAT_RATE, IDC_ICON_REPEAT_RATE, 13, 70, 15, 15 LTEXT "&Repetisjonshastighet:", -1, 40, 70, 100, 10 - LTEXT "Langsom", -1, 40, 85, 20, 10 - LTEXT "Rask", -1, 200, 85, 20, 10 - CONTROL "",IDC_SLIDER_REPEAT_RATE, "msctls_trackbar32", TBS_AUTOTICKS | WS_TABSTOP, 65, 85, 130, 17 + LTEXT "Langsom", -1, 40, 85, 62, 10 + LTEXT "Rask", -1, 210, 85, 20, 10 + CONTROL "",IDC_SLIDER_REPEAT_RATE, "msctls_trackbar32", TBS_AUTOTICKS | WS_TABSTOP, 75, 85, 130, 17 LTEXT "Klikk her og hold nede en tast for е &teste repetisjonshastigheten:", -1, 15, 105, 216, 10 EDITTEXT IDC_EDIT_REPEAT_RATE, 15, 116, 216, 14, WS_CHILD | WS_VISIBLE | WS_GROUP GROUPBOX "Markшr&blinking:", -1, 5, 145, 236, 50 @@ -37,12 +37,12 @@ STYLE DS_SHELLFONT | WS_CAPTION | WS_SYSMENU CAPTION "Klikklеs" FONT 8, "MS Shell Dlg" BEGIN - LTEXT "Kort", -1, 50, 35, 27, 10 - LTEXT "Langt", -1, 157, 35, 27, 10 + LTEXT "Kort tid", -1, 50, 35, 40, 10 + LTEXT "Langt tid", -1, 157, 35, 40, 10 CONTROL "",IDC_SLIDER_CLICK_LOCK, "msctls_trackbar32", TBS_AUTOTICKS | WS_TABSTOP, 78, 35, 70, 17 PUSHBUTTON "&OK", IDOK, 110, 59, 60, 14 PUSHBUTTON "&Avbryt", IDCANCEL, 174, 59, 60, 14 - LTEXT "&Adjust how long you need to hold down a mouse or trackball button before your click is locked",-1,37,5,200,27 + LTEXT "&Juster hvor lenge du mе holde mus eller styrekuleknappen nede fшr klikket er lеst.",-1,37,5,200,27 ICON IDI_LOOK_KEY, IDC_ICON_CLICK_LOCK, 5, 5, 15, 15 END @@ -57,9 +57,10 @@ BEGIN LTEXT "Merk av i denne avmerkningsboksen for е gjшre knappen til hшyre til den du bruker til primжrfunksjoner som е velge е dra.", -1, 10, 36, 156, 30 GROUPBOX "Hastighet pе dobbeltklikking", -1, 5, 78, 236, 70 LTEXT "Dobbeltklikk mappen for е teste innstillingen. Hvis mappen ikke lukkes eller еpnes, kan du prшve med en langsommere innstilling.", -1, 10, 90, 156, 28 - LTEXT "Hastig&het: Langsom", -1, 10, 123, 50, 10 - LTEXT "Rask", -1, 136, 123, 24, 10 - CONTROL "",IDC_SLIDER_DOUBLE_CLICK_SPEED, "msctls_trackbar32", TBS_AUTOTICKS | WS_TABSTOP, 60, 123, 70, 17 + LTEXT "Hastig&het:", -1, 10, 123, 90, 10 + LTEXT "Langsom", -1, 10, 130, 90, 10 + LTEXT "Rask", -1, 140, 130, 24, 10 + CONTROL "",IDC_SLIDER_DOUBLE_CLICK_SPEED, "msctls_trackbar32", TBS_AUTOTICKS | WS_TABSTOP, 40, 130, 90, 17 CONTROL "", IDC_IMAGE_DOUBLE_CLICK_SPEED, "Static", SS_ICON | SS_NOTIFY | SS_CENTERIMAGE | WS_VISIBLE, 171, 87, 65, 57, WS_EX_STATICEDGE GROUPBOX "Klikklеs", -1, 5, 150, 236, 70 CHECKBOX "&Slе pе klikklеs", IDC_CHECK_CLICK_LOCK, 10, 160, 70, 20 @@ -86,10 +87,10 @@ END IDD_CURSOR_SCHEME_SAVEAS DIALOGEX 0, 0, 192, 53 STYLE DS_SHELLFONT | WS_CAPTION | WS_SYSMENU -CAPTION "Lagre Scheme" +CAPTION "Lagre oppsett" FONT 8, "MS Shell Dlg" BEGIN - LTEXT "Lagre denne cursor scheme som:", -1, 5, 5, 181, 10 + LTEXT "Lagre dette markшroppsettet som:", -1, 5, 5, 190, 10 EDITTEXT IDC_EDIT_SCHEME_NAME, 5, 15, 180, 15, WS_CHILD | WS_VISIBLE | WS_GROUP PUSHBUTTON "&OK", IDOK, 63, 35, 60, 14 PUSHBUTTON "&Avbryt", IDCANCEL, 126, 35, 60, 14 @@ -103,7 +104,7 @@ FONT 8, "MS Shell Dlg" BEGIN GROUPBOX "Bevegelse", -1, 5, 5, 236, 60 LTEXT "Ve&lg en pekehastighet:", -1, 52, 15, 110, 10 - LTEXT "Langsomt", -1, 60, 30, 20, 10 + LTEXT "Langsom", -1, 54, 30, 40, 10 CONTROL "",IDC_SLIDER_MOUSE_SPEED, "msctls_trackbar32", TBS_AUTOTICKS | WS_TABSTOP, 90, 30, 70, 17 LTEXT "Rask", -1, 170, 30, 20, 10 ICON IDI_MOUSE_SPEED, IDC_ICON_MOUSE_SPEED, 18, 20, 32, 32 @@ -134,7 +135,7 @@ BEGIN ICON IDI_MOUSE_WHEEL, IDC_ICON_WHEEL, 20, 20, 32, 32 LTEXT "Rull hjulet ett hakk for е rulle:", -1, 60, 15, 150, 10 RADIOBUTTON "Fшlgende &antall linjer om gangen:", IDC_RADIO_WHEEL_SCROLL_LINES, 60, 30, 150, 10, WS_VISIBLE | WS_GROUP | WS_TABSTOP - RADIOBUTTON "&En skjermhшyde av gangen", IDC_RADIO_WHEEL_SCROLL_PAGE, 60, 65, 90, 10 + RADIOBUTTON "&En skjermhшyde av gangen", IDC_RADIO_WHEEL_SCROLL_PAGE, 60, 65, 150, 10 EDITTEXT IDC_EDIT_WHEEL_SCROLL_LINES, 70, 45, 60, 15, ES_RIGHT | WS_VISIBLE | WS_GROUP | WS_TABSTOP CONTROL "", IDC_UPDOWN_WHEEL_SCROLL_LINES, UPDOWN_CLASS, UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER, 125, 45, 12, 12 END @@ -146,27 +147,27 @@ BEGIN IDS_CPLNAME_2 "Tastatur" IDS_CPLDESCRIPTION_2 "Endre tastatur innstillinger." IDS_ARROW "Vanlig merkering" - IDS_HELP "Hjelp valg" + IDS_HELP "Hjelpemerking" IDS_APPSTARTING "Arbeider i bakgrunnen" - IDS_WAIT "Busy" - IDS_CROSSHAIR "Precision Select" - IDS_IBEAM "Tekst valgt" - IDS_NWPEN "Handskriving" - IDS_NO "Utilgjengelig" - IDS_SIZENS "Vertical Resize" - IDS_SIZEWE "Horizontal Resize" - IDS_SIZENWSE "Diagonal Resize 1" - IDS_SIZENESW "Diagonal Resize 2" + IDS_WAIT "Opptatt" + IDS_CROSSHAIR "Presisjonsmerking" + IDS_IBEAM "Tekstmerking" + IDS_NWPEN "Handskrift" + IDS_NO "Ikke tilgjengelig" + IDS_SIZENS "Endre stшrrelse loddrett" + IDS_SIZEWE "Endre stшrrelse vannrett" + IDS_SIZENWSE "Endre stшrrelse diagonalt 1" + IDS_SIZENESW "Endre stшrrelse diagonalt 2" IDS_SIZEALL "Flytt" - IDS_UPARROW "Alternative Select" - IDS_HAND "Link Select" + IDS_UPARROW "Valg alternativ" + IDS_HAND "Koblingspeker" IDS_NONE "(Ingen)" - IDS_SYSTEM_SCHEME "(system scheme)" - IDS_BROWSE_FILTER "Cursors (*.ani, *.cur)\0*.ani;*.cur\0Animated Cursors (*.ani)\0*.ani\0Static Cursors (*.cur)\0*.cur\0All Files\0*.*\0\0" + IDS_SYSTEM_SCHEME "(systemoppsett)" + IDS_BROWSE_FILTER "Markшrer (*.ani, *.cur)\0*.ani;*.cur\0Animerte markшrer (*.ani)\0*.ani\0Statiske markшrer (*.cur)\0*.cur\0Alle filer\0*.*\0\0" IDS_BROWSE_TITLE "Bla gjennom" - IDS_REMOVE_TITLE "Confirm Cursor Scheme Removal" - IDS_REMOVE_TEXT "Are you sure you want to remove the cursor scheme '%s'?" - IDS_OVERWRITE_TITLE "Confirm Cursor Scheme Overwrite" - IDS_OVERWRITE_TEXT "The cursor scheme name you chose is already in use. Do you want to overwrite the existing cursor scheme?" - IDS_ANIMATE_CURSOR "Animated Cursor" + IDS_REMOVE_TITLE "Bekreft markшroppsett fjerning" + IDS_REMOVE_TEXT "Er du sikker pе at du vil fjerne the markшroppsett '%s'?" + IDS_OVERWRITE_TITLE "Bekreft markшroppsett overskrivning" + IDS_OVERWRITE_TEXT "Fшlgene markшroppsett navnet som du valgte er i bruk. Vil du overskrive eksisterende markшroppsett?" + IDS_ANIMATE_CURSOR "Animerte markшr" END diff --git a/reactos/dll/cpl/ncpa/tcpip_properties.c b/reactos/dll/cpl/ncpa/tcpip_properties.c index be5d92a553f..fd1eeb47121 100644 --- a/reactos/dll/cpl/ncpa/tcpip_properties.c +++ b/reactos/dll/cpl/ncpa/tcpip_properties.c @@ -238,6 +238,7 @@ InternTCPIPSettings(HWND Dlg, PTCPIP_PROPERTIES_DATA DlgData) { BOOL SetDnsByDhcp; TCHAR pszRegKey[MAX_PATH]; const char *AddressString; + char emptyString[]="\0"; DWORD Address = 0; LONG rc; HKEY hKey = NULL; @@ -282,7 +283,7 @@ InternTCPIPSettings(HWND Dlg, PTCPIP_PROPERTIES_DATA DlgData) { goto cleanup; if (DlgData->Dns1 == INADDR_NONE) { - rc = RegDeleteValue(hKey, _T("NameServer")); + rc = RegSetValueExA(hKey, "NameServer",0, REG_SZ, (const BYTE*)emptyString, strlen(emptyString) + 1); if (rc != ERROR_SUCCESS && rc != ERROR_FILE_NOT_FOUND) goto cleanup; } @@ -445,6 +446,7 @@ LoadDataFromInfo(PTCPIP_PROPERTIES_DATA DlgData, IP_ADAPTER_INFO *Info) char Dns[MAX_PATH]; DWORD Size; DWORD Type; + DWORD dwError; char *NextDnsServer; DlgData->AdapterName = Info->AdapterName; @@ -469,7 +471,15 @@ LoadDataFromInfo(PTCPIP_PROPERTIES_DATA DlgData, IP_ADAPTER_INFO *Info) swprintf(RegKey, L"SYSTEM\\CurrentControlSet\\Services\\TCPIP\\Parameters\\Interfaces\\%S", Info->AdapterName); - if (ERROR_SUCCESS == RegOpenKeyW(HKEY_LOCAL_MACHINE, RegKey, &hKey)) { + dwError = RegOpenKeyW(HKEY_LOCAL_MACHINE, RegKey, &hKey); + if (dwError != ERROR_SUCCESS) + { + /* Try and fall back on the NameServer in Parameters */ + swprintf(RegKey, + L"SYSTEM\\CurrentControlSet\\Services\\TCPIP\\Parameters\\"); + } + dwError = RegOpenKeyW(HKEY_LOCAL_MACHINE, RegKey, &hKey); + if (ERROR_SUCCESS == dwError) { Size = sizeof(Dns); RegQueryValueExA(hKey, "NameServer", NULL, &Type, (BYTE *)Dns, &Size); diff --git a/reactos/dll/cpl/sysdm/lang/no-NO.rc b/reactos/dll/cpl/sysdm/lang/no-NO.rc index b28e44c1db4..70ead201165 100644 --- a/reactos/dll/cpl/sysdm/lang/no-NO.rc +++ b/reactos/dll/cpl/sysdm/lang/no-NO.rc @@ -49,7 +49,7 @@ STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Avansert" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - LTEXT "Du mе vжre logget pе som administrator for е kunne endre de fleste av disse innstillingene.", IDC_STATIC, 12, 5, 236, 8 + LTEXT "Du mе vжre logget pе som administrator for е kunne endre innstillingene.", IDC_STATIC, 12, 5, 255, 8 GROUPBOX "Ytelse", IDC_STATIC, 6, 18, 244, 50 LTEXT "Visuelle effekter, prosesorplanlegging, minnebruk og virtuelt minne.", IDC_STATIC, 16, 29, 228, 17 PUSHBUTTON "Innstillinger", IDC_PERFOR, 194, 48, 50, 15 @@ -177,15 +177,15 @@ BEGIN LTEXT "Sidevekslingsfilstшrrelse (MB)", IDC_STATIC, 115, 5, 96, 9 LISTBOX IDC_PAGEFILELIST, 10, 16, 204, 52, LBS_NOTIFY | LBS_USETABSTOPS GROUPBOX "Sidevekslingsfilstшrrelse for valgte enhet", IDC_DRIVEGROUP, 10, 70, 204, 104 - LTEXT "Stasjon:", IDC_STATIC, 20, 80, 20, 8 - LTEXT "", IDC_DRIVE, 88, 81, 100, 9 - LTEXT "Tilgjengelig ledig plass:", IDC_STATIC, 20, 92, 56, 9 - LTEXT "", IDC_SPACEAVAIL, 88, 92, 104, 9 + LTEXT "Stasjon:", IDC_STATIC, 20, 80, 24, 8 + LTEXT "", IDC_DRIVE, 100, 81, 100, 9 + LTEXT "Tilgjengelig ledig plass:", IDC_STATIC, 20, 92, 75, 9 + LTEXT "", IDC_SPACEAVAIL, 100, 92, 104, 9 LTEXT "&Startstшrrelse (MB):", -1, 22, 118, 75, 9 LTEXT "Ma&ksimalt stшrrelse (MB):", -1, 22, 131, 75, 9 - AUTORADIOBUTTON "&Tilpass stшrrelse", IDC_CUSTOM, 20, 105, 54, 9, WS_GROUP + AUTORADIOBUTTON "&Tilpass stшrrelse", IDC_CUSTOM, 20, 105, 69, 9, WS_GROUP AUTORADIOBUTTON "S&ystem styrt stшrrelse", IDC_SYSMANSIZE, 20, 145, 88, 9 - AUTORADIOBUTTON "&Ingen sidevekslingsfil", IDC_NOPAGEFILE, 20, 158, 78,9 + AUTORADIOBUTTON "&Ingen sidevekslingsfil", IDC_NOPAGEFILE, 20, 158, 79,9 EDITTEXT IDC_INITIALSIZE, 100, 114, 44, 13, NOT WS_BORDER, WS_EX_CLIENTEDGE EDITTEXT IDC_MAXSIZE, 100, 129, 44, 13, NOT WS_BORDER, WS_EX_CLIENTEDGE PUSHBUTTON "Still", IDC_SET, 158, 155, 50, 13 @@ -234,9 +234,9 @@ STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS CAPTION "Rediger variabel" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - LTEXT "Variabel &Navn:", IDC_STATIC, 7, 14, 50, 8 + LTEXT "Variabel &navn:", IDC_STATIC, 7, 14, 50, 8 EDITTEXT IDC_VARIABLE_NAME, 75, 12, 145, 12, ES_AUTOHSCROLL - LTEXT "Variabel &Verdi:", IDC_STATIC, 7, 32, 50, 8 + LTEXT "Variabel &verdi:", IDC_STATIC, 7, 32, 50, 8 EDITTEXT IDC_VARIABLE_VALUE, 75, 30, 145, 12, ES_AUTOHSCROLL DEFPUSHBUTTON "OK", IDOK, 116, 50, 50, 14 PUSHBUTTON "Avbryt", IDCANCEL, 170, 50, 50, 14 @@ -256,12 +256,12 @@ END STRINGTABLE DISCARDABLE BEGIN IDS_CPLSYSTEMNAME "System" - IDS_CPLSYSTEMDESCRIPTION "See information about your computer and change various system and hardware settings." + IDS_CPLSYSTEMDESCRIPTION "Se informasjon om din datamaskin og endre forskjellig system og maskinvare innstilling." IDS_MEGABYTE "MB Systemminne" IDS_GIGABYTE "GB Systemminne" IDS_TERABYTE "TB Systemminne" IDS_PETABYTE "PB Systemminne" - IDS_VARIABLE "Variable" + IDS_VARIABLE "Variabel" IDS_VALUE "Verdi" IDS_NO_DUMP "(Ingen)" IDS_MINI_DUMP "Minidump(64KB)" diff --git a/reactos/dll/cpl/telephon/lang/no-NO.rc b/reactos/dll/cpl/telephon/lang/no-NO.rc new file mode 100644 index 00000000000..487979907a9 --- /dev/null +++ b/reactos/dll/cpl/telephon/lang/no-NO.rc @@ -0,0 +1,16 @@ +// Norwegian (no) resources by LMH1 + +LANGUAGE LANG_NORWEGIAN, SUBLANG_NEUTRAL + +IDD_PROPPAGE DIALOGEX 0, 0, 246, 230 +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "" +FONT 8, "MS Shell Dlg" +BEGIN +END + +STRINGTABLE +BEGIN + IDS_CPLSYSTEMNAME "Telefon og Modem valg" + IDS_CPLSYSTEMDESCRIPTION "Konfigurer din telefon nummerslеing regler og modem innstillinger." +END diff --git a/reactos/dll/cpl/telephon/rsrc.rc b/reactos/dll/cpl/telephon/rsrc.rc index 2d8985e87b5..e9def651aba 100644 --- a/reactos/dll/cpl/telephon/rsrc.rc +++ b/reactos/dll/cpl/telephon/rsrc.rc @@ -8,6 +8,7 @@ #include "lang/es-ES.rc" #include "lang/fr-FR.rc" #include "lang/it-IT.rc" +#include "lang/no-NO.rc" #include "lang/pl-PL.rc" #include "lang/ru-RU.rc" #include "lang/sk-SK.rc" diff --git a/reactos/dll/cpl/timedate/clock.c b/reactos/dll/cpl/timedate/clock.c index 351726034c6..b2f5b582071 100644 --- a/reactos/dll/cpl/timedate/clock.c +++ b/reactos/dll/cpl/timedate/clock.c @@ -28,16 +28,6 @@ typedef struct _CLOCKDATA static const WCHAR szClockWndClass[] = L"ClockWndClass"; -static VOID -SetIsotropic(HDC hdc, PCLOCKDATA pClockData) -{ - /* set isotropic mode */ - SetMapMode(hdc, MM_ISOTROPIC); - /* position axis in centre of window */ - SetViewportOrgEx(hdc, pClockData->cxClient / 2, pClockData->cyClient / 2, NULL); -} - - static VOID RotatePoint(POINT pt[], INT iNum, INT iAngle) { @@ -141,8 +131,7 @@ ClockWndProc(HWND hwnd, LPARAM lParam) { PCLOCKDATA pClockData; - HDC hdc, dcMem; - HBITMAP bmMem, bmOld; + HDC hdc, hdcMem; PAINTSTRUCT ps; pClockData = (PCLOCKDATA)GetWindowLongPtrW(hwnd, GWLP_USERDATA); @@ -169,7 +158,6 @@ ClockWndProc(HWND hwnd, case WM_TIMER: GetLocalTime(&pClockData->stCurrent); - //InvalidateRect(hwnd, NULL, TRUE); InvalidateRect(hwnd, NULL, FALSE); pClockData->stPrevious = pClockData->stCurrent; break; @@ -177,30 +165,61 @@ ClockWndProc(HWND hwnd, case WM_PAINT: hdc = BeginPaint(hwnd, &ps); - /* Use an offscreen dc to avoid flicker */ + hdcMem = CreateCompatibleDC(hdc); + if (hdcMem) + { + HBITMAP hBmp, hBmpOld; + + hBmp = CreateCompatibleBitmap(hdc, + pClockData->cxClient, + pClockData->cyClient); + if (hBmp) + { + HBRUSH hWinBrush, hWinBrushOld; + INT oldMap; + POINT oldOrg; - dcMem = CreateCompatibleDC(hdc); - bmMem = CreateCompatibleBitmap(hdc, ps.rcPaint.right - ps.rcPaint.left, ps.rcPaint.bottom - ps.rcPaint.top); + hBmpOld = SelectObject(hdcMem, hBmp); - bmOld = SelectObject(dcMem, bmMem); - SetViewportOrgEx(dcMem, -ps.rcPaint.left, -ps.rcPaint.top, NULL); - FillRect(dcMem, &ps.rcPaint, GetSysColorBrush(COLOR_BTNFACE)); + hWinBrush = GetSysColorBrush(COLOR_BTNFACE); + hWinBrushOld = SelectObject(hdcMem, hWinBrush); + PatBlt(hdcMem, + 0, + 0, + pClockData->cxClient, + pClockData->cyClient, + PATCOPY); - SetIsotropic(dcMem, pClockData); - DrawClock(dcMem, pClockData); - DrawHands(dcMem, &pClockData->stPrevious, TRUE); - - /* Blit the changes to the screen */ - BitBlt(hdc, - ps.rcPaint.left, ps.rcPaint.top, - ps.rcPaint.right - ps.rcPaint.left, ps.rcPaint.bottom - ps.rcPaint.top, - dcMem, - ps.rcPaint.left, ps.rcPaint.top, - SRCCOPY); + oldMap = SetMapMode(hdcMem, MM_ISOTROPIC); + SetViewportOrgEx(hdcMem, + pClockData->cxClient / 2, + pClockData->cyClient / 2, + &oldOrg); + + DrawClock(hdcMem, pClockData); + DrawHands(hdcMem, &pClockData->stPrevious, TRUE); + + SetMapMode(hdcMem, oldMap); + SetViewportOrgEx(hdcMem, oldOrg.x, oldOrg.y, NULL); + + BitBlt(hdc, + 0, + 0, + pClockData->cxClient, + pClockData->cyClient, + hdcMem, + 0, + 0, + SRCCOPY); + + SelectObject(hdcMem, hWinBrushOld); + SelectObject(hdcMem, hBmpOld); + DeleteObject(hBmp); + } + + DeleteDC(hdcMem); + } - SelectObject(dcMem, bmOld); - DeleteObject(bmMem); - DeleteObject(dcMem); EndPaint(hwnd, &ps); break; @@ -214,19 +233,20 @@ ClockWndProc(HWND hwnd, HeapFree(GetProcessHeap(), 0, pClockData); break; - case CLM_SETTIME: - /* Stop the timer if it is still running */ + case CLM_STOPCLOCK: if (pClockData->bTimer) { KillTimer(hwnd, ID_TIMER); pClockData->bTimer = FALSE; } + break; - /* Set the current time */ - CopyMemory(&pClockData->stPrevious, (LPSYSTEMTIME)lParam, sizeof(SYSTEMTIME)); - - /* Redraw the clock */ - InvalidateRect(hwnd, NULL, FALSE); + case CLM_STARTCLOCK: + if (!pClockData->bTimer) + { + SetTimer(hwnd, ID_TIMER, 1000, NULL); + pClockData->bTimer = TRUE; + } break; default: diff --git a/reactos/dll/cpl/timedate/dateandtime.c b/reactos/dll/cpl/timedate/dateandtime.c index 493f340afc0..750e895bce7 100644 --- a/reactos/dll/cpl/timedate/dateandtime.c +++ b/reactos/dll/cpl/timedate/dateandtime.c @@ -347,8 +347,8 @@ DateTimePageProc(HWND hwndDlg, KillTimer(hwndDlg, ID_TIMER); /* Tell the clock to stop ticking */ - SendDlgItemMessageW(hwndDlg, IDC_CLOCKWND, CLM_SETTIME, - 0, (LPARAM)&((LPNMDATETIMECHANGE)lpnm)->st); + SendDlgItemMessageW(hwndDlg, IDC_CLOCKWND, CLM_STOPCLOCK, + 0, 0); /* Enable the 'Apply' button */ PropSheet_Changed(GetParent(hwndDlg), hwndDlg); @@ -381,6 +381,10 @@ DateTimePageProc(HWND hwndDlg, case PSN_APPLY: SetLocalSystemTime(hwndDlg); SetTimer(hwndDlg, ID_TIMER, 1000, NULL); + + /* Tell the clock to start ticking */ + SendDlgItemMessageW(hwndDlg, IDC_CLOCKWND, CLM_STARTCLOCK, + 0, 0); return TRUE; } break; diff --git a/reactos/dll/cpl/timedate/timedate.h b/reactos/dll/cpl/timedate/timedate.h index 4f2fce67b7b..54915563b90 100644 --- a/reactos/dll/cpl/timedate/timedate.h +++ b/reactos/dll/cpl/timedate/timedate.h @@ -51,7 +51,8 @@ VOID DisplayWin32Error(DWORD dwErrorCode); /* clock.c */ -#define CLM_SETTIME (WM_USER + 1) +#define CLM_STOPCLOCK (WM_USER + 1) +#define CLM_STARTCLOCK (WM_USER + 2) BOOL RegisterClockControl(VOID); VOID UnregisterClockControl(VOID); diff --git a/reactos/dll/cpl/usrmgr/groupprops.c b/reactos/dll/cpl/usrmgr/groupprops.c index 78b7a055a0b..ac30a280c00 100644 --- a/reactos/dll/cpl/usrmgr/groupprops.c +++ b/reactos/dll/cpl/usrmgr/groupprops.c @@ -60,6 +60,252 @@ GetTextSid(PSID pSid, } +static VOID +InitGroupMembersList(HWND hwndDlg, + PGENERAL_GROUP_DATA pGroupData) +{ + HWND hwndLV; + LV_COLUMN column; + RECT rect; + TCHAR szStr[32]; + HIMAGELIST hImgList; + HICON hIcon; + + NET_API_STATUS netStatus; + PUSER_INFO_20 pUserBuffer; + DWORD entriesread; + DWORD totalentries; + DWORD resume_handle = 0; + DWORD i; + LV_ITEM lvi; + INT iItem; + + hwndLV = GetDlgItem(hwndDlg, IDC_USER_ADD_MEMBERSHIP_LIST); + GetClientRect(hwndLV, &rect); + + hImgList = ImageList_Create(16,16,ILC_COLOR8 | ILC_MASK,5,5); + hIcon = LoadImage(hApplet,MAKEINTRESOURCE(IDI_GROUP),IMAGE_ICON,16,16,LR_DEFAULTCOLOR); + ImageList_AddIcon(hImgList,hIcon); + DestroyIcon(hIcon); + hIcon = LoadImage(hApplet, MAKEINTRESOURCE(IDI_USER), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR); + ImageList_AddIcon(hImgList, hIcon); + DestroyIcon(hIcon); + hIcon = LoadImage(hApplet, MAKEINTRESOURCE(IDI_LOCKED_USER), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR); + ImageList_AddIcon(hImgList, hIcon); + DestroyIcon(hIcon); + + (void)ListView_SetImageList(hwndLV, hImgList, LVSIL_SMALL); + (void)ListView_SetExtendedListViewStyle(hwndLV, LVS_EX_FULLROWSELECT); + + memset(&column, 0x00, sizeof(column)); + column.mask = LVCF_FMT | LVCF_WIDTH | LVCF_SUBITEM | LVCF_TEXT; + column.fmt = LVCFMT_LEFT; + column.cx = (INT)((rect.right - rect.left) * 0.40); + column.iSubItem = 0; + LoadString(hApplet, IDS_NAME, szStr, sizeof(szStr) / sizeof(szStr[0])); + column.pszText = szStr; + (void)ListView_InsertColumn(hwndLV, 0, &column); + + column.cx = (INT)((rect.right - rect.left) * 0.60); + column.iSubItem = 1; + LoadString(hApplet, IDS_DESCRIPTION, szStr, sizeof(szStr) / sizeof(szStr[0])); + column.pszText = szStr; + (void)ListView_InsertColumn(hwndLV, 1, &column); + + /* TODO: Enumerate global groups and add them to the list! */ + + for (;;) + { + netStatus = NetUserEnum(NULL, 20, FILTER_NORMAL_ACCOUNT, + (LPBYTE*)&pUserBuffer, + 1024, &entriesread, + &totalentries, &resume_handle); + if (netStatus != NERR_Success && netStatus != ERROR_MORE_DATA) + break; + + for (i = 0; i < entriesread; i++) + { + memset(&lvi, 0x00, sizeof(lvi)); + lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_IMAGE; + lvi.pszText = pUserBuffer[i].usri20_name; + lvi.state = 0; + lvi.iImage = (pUserBuffer[i].usri20_flags & UF_ACCOUNTDISABLE) ? 2 : 1; + iItem = ListView_InsertItem(hwndLV, &lvi); + + ListView_SetItemText(hwndLV, iItem, 1, + pUserBuffer[i].usri20_full_name); + + ListView_SetItemText(hwndLV, iItem, 2, + pUserBuffer[i].usri20_comment); + } + + NetApiBufferFree(&pUserBuffer); + + /* No more data left */ + if (netStatus != ERROR_MORE_DATA) + break; + } +} + + +static BOOL +AddSelectedUsersToGroup(HWND hwndDlg, + PGENERAL_GROUP_DATA pGroupData) +{ + HWND hwndLV; + INT nSelectedItems; + INT nItem; + TCHAR szUserName[UNLEN]; + BOOL bResult = FALSE; + LOCALGROUP_MEMBERS_INFO_3 memberInfo; + NET_API_STATUS status; + + hwndLV = GetDlgItem(hwndDlg, IDC_USER_ADD_MEMBERSHIP_LIST); + + nSelectedItems = ListView_GetSelectedCount(hwndLV); + if (nSelectedItems > 0) + { + nItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED); + while (nItem != -1) + { + /* Get the new user name */ + ListView_GetItemText(hwndLV, + nItem, 0, + szUserName, + UNLEN); + + DebugPrintf(_TEXT("Selected user: %s"), szUserName); + + memberInfo.lgrmi3_domainandname = szUserName; + + status = NetLocalGroupAddMembers(NULL, pGroupData->szGroupName, 3, + (LPBYTE)&memberInfo, 1); + if (status != NERR_Success && status != ERROR_MEMBER_IN_ALIAS) + { + TCHAR szText[256]; + wsprintf(szText, TEXT("Error: %u"), status); + MessageBox(NULL, szText, TEXT("NetLocalGroupAddMembers"), MB_ICONERROR | MB_OK); + } + else + { + bResult = TRUE; + } + + nItem = ListView_GetNextItem(hwndLV, nItem, LVNI_SELECTED); + } + } + + return bResult; +} + + +INT_PTR CALLBACK +AddUsersToGroupDlgProc(HWND hwndDlg, + UINT uMsg, + WPARAM wParam, + LPARAM lParam) +{ + PGENERAL_GROUP_DATA pGroupData; + + UNREFERENCED_PARAMETER(wParam); + + pGroupData = (PGENERAL_GROUP_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER); + + switch (uMsg) + { + case WM_INITDIALOG: + pGroupData = (PGENERAL_GROUP_DATA)lParam; + SetWindowLongPtr(hwndDlg, DWLP_USER, (INT_PTR)pGroupData); + InitGroupMembersList(hwndDlg, pGroupData); + break; + + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case IDOK: + if (AddSelectedUsersToGroup(hwndDlg, pGroupData)) + EndDialog(hwndDlg, IDOK); + else + EndDialog(hwndDlg, IDCANCEL); + break; + + case IDCANCEL: + EndDialog(hwndDlg, IDCANCEL); + break; + } + break; + + default: + return FALSE; + } + + return TRUE; +} + + +static VOID +AddUsersToGroup(HWND hwndDlg, + PGENERAL_GROUP_DATA pGroupData) +{ + HWND hwndLV; +// NET_API_STATUS status; + PLOCALGROUP_MEMBERS_INFO_1 membersInfo = NULL; + DWORD dwRead; + DWORD dwTotal; + DWORD_PTR resumeHandle = 0; + DWORD i; + LV_ITEM lvi; + TCHAR szGroupName[256]; + + if (DialogBoxParam(hApplet, + MAKEINTRESOURCE(IDD_USER_ADD_MEMBERSHIP), + hwndDlg, + AddUsersToGroupDlgProc, + (LPARAM)pGroupData) == IDOK) + { + hwndLV = GetDlgItem(hwndDlg, IDC_GROUP_GENERAL_MEMBERS); + + (void)ListView_DeleteAllItems(hwndLV); + +// DebugPrintf(_T("Removed all users from the list!")); + + /* Set group members */ + NetLocalGroupGetMembers(NULL, pGroupData->szGroupName, 1, (LPBYTE*)&membersInfo, + MAX_PREFERRED_LENGTH, &dwRead, &dwTotal, + &resumeHandle); + + for (i = 0; i < dwRead; i++) + { + ZeroMemory(&lvi, sizeof(lvi)); + lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_IMAGE; + lvi.pszText = membersInfo[i].lgrmi1_name; + lvi.state = 0; + lvi.iImage = (membersInfo[i].lgrmi1_sidusage == SidTypeGroup || + membersInfo[i].lgrmi1_sidusage == SidTypeWellKnownGroup) ? 1 : 0; + + if (membersInfo[i].lgrmi1_sidusage == SidTypeWellKnownGroup) + { + TCHAR szSid[256]; + + GetTextSid(membersInfo[i].lgrmi1_sid, szSid); + + wsprintf(szGroupName, + TEXT("%s (%s)"), + membersInfo[i].lgrmi1_name, + szSid); + + lvi.pszText = szGroupName; + } + + + (void)ListView_InsertItem(hwndLV, &lvi); + } + + NetApiBufferFree(membersInfo); + } +} + + static VOID RemoveUserFromGroup(HWND hwndDlg, PGENERAL_GROUP_DATA pGroupData) @@ -161,11 +407,12 @@ GetGeneralGroupData(HWND hwndDlg, /* Create the image list */ hImgList = ImageList_Create(16, 16, ILC_COLOR8 | ILC_MASK, 5, 5); - hIcon = LoadImage(hApplet, MAKEINTRESOURCE(IDI_USER), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR); - ImageList_AddIcon(hImgList, hIcon); hIcon = LoadImage(hApplet, MAKEINTRESOURCE(IDI_GROUP), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR); ImageList_AddIcon(hImgList, hIcon); DestroyIcon(hIcon); + hIcon = LoadImage(hApplet, MAKEINTRESOURCE(IDI_USER), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR); + ImageList_AddIcon(hImgList, hIcon); + DestroyIcon(hIcon); (void)ListView_SetImageList(hwndLV, hImgList, LVSIL_SMALL); @@ -198,8 +445,16 @@ GetGeneralGroupData(HWND hwndDlg, lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_IMAGE; lvi.pszText = membersInfo[i].lgrmi1_name; lvi.state = 0; - lvi.iImage = (membersInfo[i].lgrmi1_sidusage == SidTypeGroup || - membersInfo[i].lgrmi1_sidusage == SidTypeWellKnownGroup) ? 1 : 0; + if (membersInfo[i].lgrmi1_sidusage == SidTypeGroup || + membersInfo[i].lgrmi1_sidusage == SidTypeWellKnownGroup) + { + lvi.iImage = 0; + } + else if (membersInfo[i].lgrmi1_sidusage == SidTypeUser) + { + /* FIXME: handle locked user properly! */ + lvi.iImage = 1; + } if (membersInfo[i].lgrmi1_sidusage == SidTypeWellKnownGroup) { @@ -208,7 +463,7 @@ GetGeneralGroupData(HWND hwndDlg, GetTextSid(membersInfo[i].lgrmi1_sid, szSid); wsprintf(szGroupName, - TEXT("%s\\%s (%s)"), + TEXT("%s (%s)"), membersInfo[i].lgrmi1_name, szSid); @@ -295,6 +550,10 @@ GroupGeneralPageProc(HWND hwndDlg, PropSheet_Changed(GetParent(hwndDlg), hwndDlg); break; + case IDC_GROUP_GENERAL_ADD: + AddUsersToGroup(hwndDlg, pGroupData); + break; + case IDC_GROUP_GENERAL_REMOVE: RemoveUserFromGroup(hwndDlg, pGroupData); break; diff --git a/reactos/dll/cpl/usrmgr/lang/en-US.rc b/reactos/dll/cpl/usrmgr/lang/en-US.rc index 88ef2e8aea9..1c33618ae8c 100644 --- a/reactos/dll/cpl/usrmgr/lang/en-US.rc +++ b/reactos/dll/cpl/usrmgr/lang/en-US.rc @@ -99,7 +99,7 @@ BEGIN LTEXT "Members:", -1, 7, 63, 45, 8 CONTROL "", IDC_GROUP_GENERAL_MEMBERS, "SysListView32", LVS_REPORT | LVS_NOCOLUMNHEADER | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP, 7, 74, 238, 117, WS_EX_CLIENTEDGE - PUSHBUTTON "Add...", IDC_GROUP_GENERAL_ADD, 7, 197, 50, 14, WS_DISABLED + PUSHBUTTON "Add...", IDC_GROUP_GENERAL_ADD, 7, 197, 50, 14 PUSHBUTTON "Remove", IDC_GROUP_GENERAL_REMOVE, 61, 197, 50, 14, WS_DISABLED END @@ -164,8 +164,8 @@ BEGIN LTEXT "Member of:", -1, 7, 7, 56, 8 CONTROL "", IDC_USER_ADD_MEMBERSHIP_LIST, "SysListView32", LVS_REPORT | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP, 7, 18, 238, 173, WS_EX_CLIENTEDGE - DEFPUSHBUTTON "OK",IDOK,156,197,50,14 - PUSHBUTTON "Cancel",IDCANCEL,210,197,50,14 + DEFPUSHBUTTON "OK",IDOK,141,197,50,14 + PUSHBUTTON "Cancel",IDCANCEL,195,197,50,14 END diff --git a/reactos/dll/directx/d3d9/adapter.c b/reactos/dll/directx/d3d9/adapter.c index 62ebf3f1087..513888f9303 100644 --- a/reactos/dll/directx/d3d9/adapter.c +++ b/reactos/dll/directx/d3d9/adapter.c @@ -10,10 +10,10 @@ #include "d3d9_common.h" #include #include -#include #include #include #include "d3d9_private.h" +#include "d3d9_helpers.h" #include "adapter.h" #define D3D9_CAPS1 (D3DCAPS_READ_SCANLINE) @@ -58,7 +58,7 @@ static BOOL GetDriverName(LPDISPLAY_DEVICEA pDisplayDevice, D3DADAPTER_IDENTIFIE if (ERROR_SUCCESS == RegQueryValueExA(hKey, "InstalledDisplayDrivers", 0, &Type, (LPBYTE)pIdentifier->Driver, &DriverNameLength)) { pIdentifier->Driver[DriverNameLength] = '\0'; - StringCbCatA(pIdentifier->Driver, MAX_DEVICE_IDENTIFIER_STRING, ".dll"); + SafeAppendString(pIdentifier->Driver, MAX_DEVICE_IDENTIFIER_STRING, ".dll"); bResult = TRUE; } diff --git a/reactos/dll/directx/d3d9/d3d9.c b/reactos/dll/directx/d3d9/d3d9.c index 0afc2476b8d..5953eb5e775 100644 --- a/reactos/dll/directx/d3d9/d3d9.c +++ b/reactos/dll/directx/d3d9/d3d9.c @@ -11,7 +11,6 @@ #include "d3d9_helpers.h" #include "d3d9_create.h" #include -#include #define DEBUG_MESSAGE_BUFFER_SIZE 512 @@ -25,31 +24,31 @@ static LPCSTR D3dError_WrongSdkVersion = "Recompile the application against the appropriate SDK for the installed runtime.\n" "\n"; -HRESULT Direct3DShaderValidatorCreate9(void) +HRESULT WINAPI Direct3DShaderValidatorCreate9(void) { UNIMPLEMENTED return 0; } -HRESULT PSGPError(void) +HRESULT WINAPI PSGPError(void) { UNIMPLEMENTED return 0; } -HRESULT PSGPSampleTexture(void) +HRESULT WINAPI PSGPSampleTexture(void) { UNIMPLEMENTED return 0; } -HRESULT DebugSetLevel(void) +HRESULT WINAPI DebugSetLevel(void) { UNIMPLEMENTED return 0; } -HRESULT DebugSetMute(DWORD dw1) +HRESULT WINAPI DebugSetMute(DWORD dw1) { UNIMPLEMENTED return 0; @@ -86,7 +85,7 @@ IDirect3D9* WINAPI Direct3DCreate9(UINT SDKVersion) if (SDKVersion & DX_D3D9_DEBUG) { HRESULT hResult; - hResult = StringCbPrintfA(DebugMessageBuffer, DEBUG_MESSAGE_BUFFER_SIZE, D3dError_WrongSdkVersion, NoDebugSDKVersion, D3D_SDK_VERSION); + hResult = SafeFormatString(DebugMessageBuffer, DEBUG_MESSAGE_BUFFER_SIZE, D3dError_WrongSdkVersion, NoDebugSDKVersion, D3D_SDK_VERSION); if (SUCCEEDED(hResult)) OutputDebugStringA(DebugMessageBuffer); } diff --git a/reactos/dll/directx/d3d9/d3d9.def b/reactos/dll/directx/d3d9/d3d9.def deleted file mode 100644 index 4ff82e14061..00000000000 --- a/reactos/dll/directx/d3d9/d3d9.def +++ /dev/null @@ -1,8 +0,0 @@ -LIBRARY d3d9 -EXPORTS - Direct3DShaderValidatorCreate9 - PSGPError - PSGPSampleTexture - DebugSetLevel - DebugSetMute - Direct3DCreate9@4 diff --git a/reactos/dll/directx/d3d9/d3d9.h b/reactos/dll/directx/d3d9/d3d9.h deleted file mode 100644 index ba1f5287713..00000000000 --- a/reactos/dll/directx/d3d9/d3d9.h +++ /dev/null @@ -1,3 +0,0 @@ -#include - -#define DLLAPI __declspec(dllexport) diff --git a/reactos/dll/directx/d3d9/d3d9.rbuild b/reactos/dll/directx/d3d9/d3d9.rbuild index c25fe8a88e2..c6693b1ae26 100644 --- a/reactos/dll/directx/d3d9/d3d9.rbuild +++ b/reactos/dll/directx/d3d9/d3d9.rbuild @@ -1,7 +1,7 @@ - + advapi32 kernel32 @@ -9,17 +9,23 @@ gdi32 uuid dxguid - strsafe version d3d8thk d3d9.c + d3d9_baseobject.c + d3d9_caps.c + d3d9_create.c + d3d9_cursor.c + d3d9_device.c + d3d9_haldevice.c d3d9_helpers.c d3d9_impl.c - d3d9_create.c - d3d9_caps.c - d3d9_device.c + d3d9_puredevice.c + d3d9_swapchain.c adapter.c + device.c format.c d3d9.rc + d3d9.spec diff --git a/reactos/dll/directx/d3d9/d3d9.spec b/reactos/dll/directx/d3d9/d3d9.spec new file mode 100644 index 00000000000..0be3067d594 --- /dev/null +++ b/reactos/dll/directx/d3d9/d3d9.spec @@ -0,0 +1,6 @@ +@ stdcall Direct3DShaderValidatorCreate9() +@ stdcall PSGPError() +@ stdcall PSGPSampleTexture() +@ stdcall DebugSetLevel() +@ stdcall DebugSetMute(long) +@ stdcall Direct3DCreate9(long) diff --git a/reactos/dll/directx/d3d9/d3d9_baseobject.c b/reactos/dll/directx/d3d9/d3d9_baseobject.c new file mode 100644 index 00000000000..41a7681316a --- /dev/null +++ b/reactos/dll/directx/d3d9/d3d9_baseobject.c @@ -0,0 +1,88 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS ReactX + * FILE: dll/directx/d3d9/d3d9_baseobject.c + * PURPOSE: Direct3D9's base object + * PROGRAMERS: Gregor Gullwi + */ +#include "d3d9_baseobject.h" +#include "d3d9_device.h" + +#include +#include "d3d9_helpers.h" + +VOID D3D9BaseObject_Destroy(D3D9BaseObject* pBaseObject, BOOL bFreeThis) +{ + if (bFreeThis) + { + AlignedFree((LPVOID*) pBaseObject); + } +} + +ID3D9BaseObjectVtbl D3D9BaseObject_Vtbl = +{ + /* D3D9BaseObject */ + D3D9BaseObject_Destroy +}; + +VOID InitD3D9BaseObject(D3D9BaseObject* pBaseObject, enum REF_TYPE RefType, IUnknown* pUnknown) +{ + pBaseObject->lpVtbl = &D3D9BaseObject_Vtbl; + pBaseObject->RefType = RefType; + pBaseObject->pUnknown = pUnknown; +} + +ULONG D3D9BaseObject_AddRef(D3D9BaseObject* pBaseObject) +{ + if (pBaseObject->pUnknown) + { + pBaseObject->pUnknown->lpVtbl->AddRef((IUnknown*) &pBaseObject->pUnknown->lpVtbl); + } + + return InterlockedIncrement(&pBaseObject->lRefCnt); +} + +ULONG D3D9BaseObject_Release(D3D9BaseObject* pBaseObject) +{ + ULONG Ref = 0; + + if (pBaseObject) + { + Ref = InterlockedDecrement(&pBaseObject->lRefCnt); + + if (Ref == 0) + { + if (pBaseObject->pUnknown) + { + pBaseObject->pUnknown->lpVtbl->Release((IUnknown*) &pBaseObject->pUnknown->lpVtbl); + } + } + } + + return Ref; +} + +HRESULT D3D9BaseObject_GetDevice(D3D9BaseObject* pBaseObject, IDirect3DDevice9** ppDevice) +{ + if (pBaseObject->pUnknown) + { + return pBaseObject->pUnknown->lpVtbl->QueryInterface((IUnknown*) &pBaseObject->pUnknown->lpVtbl, &IID_IDirect3DDevice9, (void**)ppDevice); + } + + return E_NOINTERFACE; +} + +HRESULT D3D9BaseObject_GetDeviceInt(D3D9BaseObject* pBaseObject, DIRECT3DDEVICE9_INT** ppDevice) +{ + if (pBaseObject->pUnknown) + { + LPDIRECT3DDEVICE9 pDevice; + if (FAILED(pBaseObject->pUnknown->lpVtbl->QueryInterface((IUnknown*) &pBaseObject->pUnknown->lpVtbl, &IID_IDirect3DDevice9, (void**)&pDevice))) + return E_NOINTERFACE; + + *ppDevice = IDirect3DDevice9ToImpl(pDevice); + return D3D_OK; + } + + return E_NOINTERFACE; +} diff --git a/reactos/dll/directx/d3d9/d3d9_baseobject.h b/reactos/dll/directx/d3d9/d3d9_baseobject.h new file mode 100644 index 00000000000..33a8f9e1a3d --- /dev/null +++ b/reactos/dll/directx/d3d9/d3d9_baseobject.h @@ -0,0 +1,48 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS ReactX + * FILE: dll/directx/d3d9/d3d9_baseobject.h + * PURPOSE: Direct3D9's base object + * PROGRAMERS: Gregor Gullwi + */ +#ifndef _D3D9_BASEOBJECT_H_ +#define _D3D9_BASEOBJECT_H_ + +#include "d3d9_common.h" +#include + +struct _D3D9BaseObject; +struct _Direct3DDevice9_INT; + +enum REF_TYPE +{ + RT_EXTERNAL, + RT_BUILTIN, + RT_INTERNAL, +}; + +typedef struct _D3D9BaseObjectVtbl +{ + VOID (*Destroy)(struct _D3D9BaseObject* pBaseObject, BOOL bFreeThis); +} ID3D9BaseObjectVtbl; + +typedef struct _D3D9BaseObject +{ +/* 0x0000 */ ID3D9BaseObjectVtbl* lpVtbl; +/* 0x0004 */ LONG lRefCnt; +/* 0x0008 */ DWORD dwNumUsed; +/* 0x000c */ IUnknown* pUnknown; +/* 0x0010 */ DWORD dwUnknown0010; // Index? Unique id? +/* 0x0014 */ HANDLE hKernelHandle; +/* 0x0018 */ LPDWORD dwUnknown0018; +/* 0x001c */ enum REF_TYPE RefType; +} D3D9BaseObject; + +VOID InitD3D9BaseObject(D3D9BaseObject* pBaseObject, enum REF_TYPE RefType, IUnknown* pUnknown); + +ULONG D3D9BaseObject_AddRef(D3D9BaseObject* pBaseObject); +ULONG D3D9BaseObject_Release(D3D9BaseObject* pBaseObject); +HRESULT D3D9BaseObject_GetDevice(D3D9BaseObject* pBaseObject, IDirect3DDevice9** ppDevice); +HRESULT D3D9BaseObject_GetDeviceInt(D3D9BaseObject* pBaseObject, struct _Direct3DDevice9_INT** ppDevice); + +#endif // _D3D9_BASEOBJECT_H_ diff --git a/reactos/dll/directx/d3d9/d3d9_caps.c b/reactos/dll/directx/d3d9/d3d9_caps.c index 03f206eb22e..65e81a2e478 100644 --- a/reactos/dll/directx/d3d9/d3d9_caps.c +++ b/reactos/dll/directx/d3d9/d3d9_caps.c @@ -7,7 +7,6 @@ #include #include #include -#include #include #include "d3d9_helpers.h" #include "d3d9_caps.h" @@ -98,7 +97,7 @@ static void CreateInternalDeviceData(HDC hDC, LPCSTR lpszDeviceName, D3D9_Unknow } - StringCbCopyA(pUnknown6BC->szDeviceName, CCHDEVICENAME, lpszDeviceName); + SafeCopyString(pUnknown6BC->szDeviceName, CCHDEVICENAME, lpszDeviceName); //pUnknown6BC->DeviceUniq = DdQueryDisplaySettingsUniqueness(); pUnknown6BC->DeviceType = DeviceType; diff --git a/reactos/dll/directx/d3d9/d3d9_create.c b/reactos/dll/directx/d3d9/d3d9_create.c index e33fa373d76..b92308f05e1 100644 --- a/reactos/dll/directx/d3d9/d3d9_create.c +++ b/reactos/dll/directx/d3d9/d3d9_create.c @@ -13,7 +13,6 @@ #include #include #include -#include static const GUID DISPLAY_GUID = { 0x67685559, 0x3106, 0x11D0, { 0xB9, 0x71, 0x00, 0xAA, 0x00, 0x34, 0x2F, 0x9F } }; @@ -113,21 +112,14 @@ void GetDisplayAdapterFromDevice(IN OUT LPDIRECT3D9_DISPLAYADAPTER pDisplayAdapt } } -static BOOL GetDirect3D9AdapterInfo(IN OUT LPDIRECT3D9_DISPLAYADAPTER pDisplayAdapters, IN DWORD AdapterIndex) +BOOL CreateD3D9DeviceData(IN LPDIRECT3D9_DISPLAYADAPTER pDisplayAdapter, IN LPD3D9_DEVICEDATA pDeviceData) { HDC hDC; - LPD3D9_DEVICEDATA pDeviceData; - LPDIRECT3D9_DISPLAYADAPTER pDisplayAdapter = &pDisplayAdapters[AdapterIndex]; /* Test DC creation for the display device */ if (NULL == (hDC = CreateDCA(NULL, pDisplayAdapter->szDeviceName, NULL, NULL))) - return FALSE; - - pDeviceData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(D3D9_DEVICEDATA)); - if (NULL == pDeviceData) { - DPRINT1("Out of memory, could not initialize Direct3D adapter"); - DeleteDC(hDC); + DPRINT1("Could not create dc for display adapter: %s", pDisplayAdapter->szDeviceName); return FALSE; } @@ -148,17 +140,39 @@ static BOOL GetDirect3D9AdapterInfo(IN OUT LPDIRECT3D9_DISPLAYADAPTER pDisplayAd if (FALSE == GetDeviceData(pDeviceData)) { - DeleteDC(hDC); - HeapFree(GetProcessHeap(), 0, pDeviceData->pUnknown6BC); - HeapFree(GetProcessHeap(), 0, pDeviceData); + DPRINT1("Could not get device data for display adapter: %s", pDisplayAdapter->szDeviceName); return FALSE; } - DeleteDC(hDC); + return TRUE; +} + +VOID DestroyD3D9DeviceData(IN LPD3D9_DEVICEDATA pDeviceData) +{ + DeleteDC(pDeviceData->hDC); + HeapFree(GetProcessHeap(), 0, pDeviceData->pUnknown6BC); +} + +static BOOL GetDirect3D9AdapterInfo(IN OUT LPDIRECT3D9_DISPLAYADAPTER pDisplayAdapters, IN DWORD AdapterIndex) +{ + LPD3D9_DEVICEDATA pDeviceData; + + pDeviceData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(D3D9_DEVICEDATA)); + if (NULL == pDeviceData) + { + DPRINT1("Out of memory, could not initialize Direct3D adapter"); + return FALSE; + } + + if (FALSE == CreateD3D9DeviceData(&pDisplayAdapters[AdapterIndex], pDeviceData)) + { + DPRINT1("Could not create device data for adapter: %d", AdapterIndex); + return FALSE; + } GetDisplayAdapterFromDevice(pDisplayAdapters, AdapterIndex, pDeviceData); - HeapFree(GetProcessHeap(), 0, pDeviceData->pUnknown6BC); + DestroyD3D9DeviceData(pDeviceData); HeapFree(GetProcessHeap(), 0, pDeviceData); return TRUE; @@ -233,9 +247,6 @@ HRESULT CreateD3D9(OUT LPDIRECT3D9 *ppDirect3D9, UINT SDKVersion) if (pDirect3D9 == 0) return DDERR_OUTOFMEMORY; - pDirect3D9->unknown000007 = 0; - pDirect3D9->lpInt = 0; - pDirect3D9->lpVtbl = &Direct3D9_Vtbl; pDirect3D9->dwProcessId = GetCurrentThreadId(); pDirect3D9->lRefCnt = 1; @@ -247,10 +258,15 @@ HRESULT CreateD3D9(OUT LPDIRECT3D9 *ppDirect3D9, UINT SDKVersion) InitializeCriticalSection(&pDirect3D9->d3d9_cs); - GetDisplayDeviceInfo(pDirect3D9); + if (FALSE == GetDisplayDeviceInfo(pDirect3D9)) + { + DPRINT1("Could not create Direct3D9 object"); + AlignedFree(pDirect3D9); + return DDERR_GENERIC; + } *ppDirect3D9 = (LPDIRECT3D9)&pDirect3D9->lpVtbl; - return ERROR_SUCCESS; + return D3D_OK; } diff --git a/reactos/dll/directx/d3d9/d3d9_create.h b/reactos/dll/directx/d3d9/d3d9_create.h index ce2c866c1cc..a9e31e3e0bd 100644 --- a/reactos/dll/directx/d3d9/d3d9_create.h +++ b/reactos/dll/directx/d3d9/d3d9_create.h @@ -15,4 +15,7 @@ /* Creates a Direct3D9 object */ HRESULT CreateD3D9(OUT LPDIRECT3D9 *ppDirect3D9, UINT SDKVersion); +BOOL CreateD3D9DeviceData(IN LPDIRECT3D9_DISPLAYADAPTER pDisplayAdapter, IN LPD3D9_DEVICEDATA pDeviceData); +VOID DestroyD3D9DeviceData(IN LPD3D9_DEVICEDATA pDeviceData); + #endif // _D3D9_CREATE_H_ diff --git a/reactos/dll/directx/d3d9/d3d9_cursor.c b/reactos/dll/directx/d3d9/d3d9_cursor.c new file mode 100644 index 00000000000..477eeb7775f --- /dev/null +++ b/reactos/dll/directx/d3d9/d3d9_cursor.c @@ -0,0 +1,34 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS ReactX + * FILE: dll/directx/d3d9/d3d9_cursor.h + * PURPOSE: d3d9.dll internal cursor methods + * PROGRAMERS: Gregor Gullwi + */ +#include "d3d9_cursor.h" + +#include +#include +#include "d3d9_private.h" +#include "adapter.h" +#include "d3d9_device.h" +#include "d3d9_swapchain.h" +#include "d3d9_helpers.h" + +D3D9Cursor* CreateD3D9Cursor(struct _Direct3DDevice9_INT* pBaseDevice, struct _Direct3DSwapChain9_INT* pSwapChain) +{ + D3D9Cursor* pCursor; + + if (FAILED(AlignedAlloc((LPVOID*)&pCursor, sizeof(D3D9Cursor)))) + { + DPRINT1("Failed to allocate D3D9Cursor"); + return NULL; + } + + pCursor->pBaseDevice = pBaseDevice; + pCursor->pSwapChain = pSwapChain; + pCursor->dwWidth = pSwapChain->dwWidth / 2; + pCursor->dwHeight = pSwapChain->dwHeight / 2; + + return pCursor; +} diff --git a/reactos/dll/directx/d3d9/d3d9_cursor.h b/reactos/dll/directx/d3d9/d3d9_cursor.h new file mode 100644 index 00000000000..a43280d3d47 --- /dev/null +++ b/reactos/dll/directx/d3d9/d3d9_cursor.h @@ -0,0 +1,34 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS ReactX + * FILE: dll/directx/d3d9/d3d9_cursor.h + * PURPOSE: d3d9.dll internal cursor methods + * PROGRAMERS: Gregor Gullwi + */ +#ifndef _D3D9_CURSOR_H +#define _D3D9_CURSOR_H + +#include "d3d9_common.h" + +typedef struct _D3D9Cursor +{ +/* 0x0000 */ DWORD dwUnknown0000; +/* 0x0004 */ DWORD dwUnknown0004; +/* 0x0008 */ DWORD dwUnknown0008; +/* 0x000c */ DWORD dwUnknown000c; +/* 0x0010 */ DWORD dwUnknown0010; +/* 0x0014 */ DWORD dwUnknown0014; +/* 0x0018 */ DWORD dwWidth; +/* 0x001c */ DWORD dwHeight; +/* 0x0020 */ DWORD dwUnknown0020[18]; +/* 0x0070 */ struct _Direct3DDevice9_INT* pBaseDevice; +/* 0x0074 */ struct _Direct3DSwapChain9_INT* pSwapChain; +/* 0x0078 */ DWORD dwUnknown0078; +/* 0x007c */ DWORD dwMonitorVirtualX; +/* 0x0080 */ DWORD dwMonitorVirtualY; +/* 0x0084 */ DWORD dwUnknown0084; +} D3D9Cursor; + +D3D9Cursor* CreateD3D9Cursor(struct _Direct3DDevice9_INT* pBaseDevice, struct _Direct3DSwapChain9_INT* pSwapChain); + +#endif // _D3D9_CURSOR_H diff --git a/reactos/dll/directx/d3d9/d3d9_device.c b/reactos/dll/directx/d3d9/d3d9_device.c index c922ea237bc..1023040fefb 100644 --- a/reactos/dll/directx/d3d9/d3d9_device.c +++ b/reactos/dll/directx/d3d9/d3d9_device.c @@ -8,24 +8,25 @@ #include "d3d9_device.h" #include "d3d9_helpers.h" #include "adapter.h" -#include "debug.h" +#include +#include "d3d9_create.h" #define LOCK_D3DDEVICE9() if (This->bLockDevice) EnterCriticalSection(&This->CriticalSection); #define UNLOCK_D3DDEVICE9() if (This->bLockDevice) LeaveCriticalSection(&This->CriticalSection); /* Convert a IDirect3D9 pointer safely to the internal implementation struct */ -LPDIRECT3DDEVICE9_INT impl_from_IDirect3DDevice9(LPDIRECT3DDEVICE9 iface) +LPDIRECT3DDEVICE9_INT IDirect3DDevice9ToImpl(LPDIRECT3DDEVICE9 iface) { - if (IsBadWritePtr(iface, sizeof(LPDIRECT3DDEVICE9_INT))) + if (NULL == iface) return NULL; return (LPDIRECT3DDEVICE9_INT)((ULONG_PTR)iface - FIELD_OFFSET(DIRECT3DDEVICE9_INT, lpVtbl)); } /* IDirect3DDevice9: IUnknown implementation */ -static HRESULT WINAPI IDirect3DDevice9Impl_QueryInterface(LPDIRECT3DDEVICE9 iface, REFIID riid, void** ppvObject) +HRESULT WINAPI IDirect3DDevice9Base_QueryInterface(LPDIRECT3DDEVICE9 iface, REFIID riid, void** ppvObject) { - LPDIRECT3DDEVICE9_INT This = impl_from_IDirect3DDevice9(iface); + LPDIRECT3DDEVICE9_INT This = IDirect3DDevice9ToImpl(iface); if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirect3DDevice9)) { @@ -38,23 +39,32 @@ static HRESULT WINAPI IDirect3DDevice9Impl_QueryInterface(LPDIRECT3DDEVICE9 ifac return E_NOINTERFACE; } -static ULONG WINAPI IDirect3DDevice9Impl_AddRef(LPDIRECT3DDEVICE9 iface) +ULONG WINAPI IDirect3DDevice9Base_AddRef(LPDIRECT3DDEVICE9 iface) { - LPDIRECT3DDEVICE9_INT This = impl_from_IDirect3DDevice9(iface); + LPDIRECT3DDEVICE9_INT This = IDirect3DDevice9ToImpl(iface); ULONG ref = InterlockedIncrement(&This->lRefCnt); return ref; } -static ULONG WINAPI IDirect3DDevice9Impl_Release(LPDIRECT3DDEVICE9 iface) +ULONG WINAPI IDirect3DDevice9Base_Release(LPDIRECT3DDEVICE9 iface) { - LPDIRECT3DDEVICE9_INT This = impl_from_IDirect3DDevice9(iface); + LPDIRECT3DDEVICE9_INT This = IDirect3DDevice9ToImpl(iface); ULONG ref = InterlockedDecrement(&This->lRefCnt); if (ref == 0) { + DWORD iAdapter; + EnterCriticalSection(&This->CriticalSection); + /* TODO: Free resources here */ + for (iAdapter = 0; iAdapter < This->NumAdaptersInDevice; iAdapter++) + { + DestroyD3D9DeviceData(&This->DeviceData[iAdapter]); + } + This->lpVtbl->VirtualDestructor(iface); + LeaveCriticalSection(&This->CriticalSection); AlignedFree(This); } @@ -62,8 +72,8 @@ static ULONG WINAPI IDirect3DDevice9Impl_Release(LPDIRECT3DDEVICE9 iface) return ref; } -/* IDirect3D9Device interface */ -static HRESULT WINAPI IDirect3DDevice9Impl_TestCooperativeLevel(LPDIRECT3DDEVICE9 iface) +/* IDirect3DDevice9 public interface */ +HRESULT WINAPI IDirect3DDevice9Base_TestCooperativeLevel(LPDIRECT3DDEVICE9 iface) { UNIMPLEMENTED @@ -74,7 +84,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_TestCooperativeLevel(LPDIRECT3DDEVICE * @name IDirect3DDevice9::GetAvailableTextureMem * @implemented * -* The function IDirect3DDevice9Impl_GetAvailableTextureMem returns a pointer to the IDirect3D9 object +* The function IDirect3DDevice9Base_GetAvailableTextureMem returns a pointer to the IDirect3D9 object * that created this device. * * @param LPDIRECT3D iface @@ -85,12 +95,12 @@ static HRESULT WINAPI IDirect3DDevice9Impl_TestCooperativeLevel(LPDIRECT3DDEVICE * to the nearest MB. Applications should NOT use this as an exact number. * */ -static UINT WINAPI IDirect3DDevice9Impl_GetAvailableTextureMem(LPDIRECT3DDEVICE9 iface) +UINT WINAPI IDirect3DDevice9Base_GetAvailableTextureMem(LPDIRECT3DDEVICE9 iface) { UINT AvailableTextureMemory = 0; D3D9_GETAVAILDRIVERMEMORYDATA d3d9GetAvailDriverMemoryData; - LPDIRECT3DDEVICE9_INT This = impl_from_IDirect3DDevice9(iface); + LPDIRECT3DDEVICE9_INT This = IDirect3DDevice9ToImpl(iface); LOCK_D3DDEVICE9(); memset(&d3d9GetAvailDriverMemoryData, 0, sizeof(d3d9GetAvailDriverMemoryData)); @@ -107,7 +117,7 @@ static UINT WINAPI IDirect3DDevice9Impl_GetAvailableTextureMem(LPDIRECT3DDEVICE9 return AvailableTextureMemory; } -static HRESULT WINAPI IDirect3DDevice9Impl_EvictManagedResources(LPDIRECT3DDEVICE9 iface) +HRESULT WINAPI IDirect3DDevice9Base_EvictManagedResources(LPDIRECT3DDEVICE9 iface) { UNIMPLEMENTED @@ -118,7 +128,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_EvictManagedResources(LPDIRECT3DDEVIC * @name IDirect3DDevice9::GetDirect3D * @implemented * -* The function IDirect3DDevice9Impl_GetDirect3D returns a pointer to the IDirect3D9 object +* The function IDirect3DDevice9Base_GetDirect3D returns a pointer to the IDirect3D9 object * that created this device. * * @param LPDIRECT3D iface @@ -132,13 +142,13 @@ static HRESULT WINAPI IDirect3DDevice9Impl_EvictManagedResources(LPDIRECT3DDEVIC * If ppD3D9 is a bad pointer, the return value will be D3DERR_INVALIDCALL. * */ -static HRESULT WINAPI IDirect3DDevice9Impl_GetDirect3D(LPDIRECT3DDEVICE9 iface, IDirect3D9** ppD3D9) +HRESULT WINAPI IDirect3DDevice9Base_GetDirect3D(LPDIRECT3DDEVICE9 iface, IDirect3D9** ppD3D9) { IDirect3D9* pDirect3D9; - LPDIRECT3DDEVICE9_INT This = impl_from_IDirect3DDevice9(iface); + LPDIRECT3DDEVICE9_INT This = IDirect3DDevice9ToImpl(iface); LOCK_D3DDEVICE9(); - if (IsBadWritePtr(ppD3D9, sizeof(IDirect3D9*))) + if (NULL == ppD3D9) { DPRINT1("Invalid ppD3D9 parameter specified"); UNLOCK_D3DDEVICE9(); @@ -157,7 +167,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetDirect3D(LPDIRECT3DDEVICE9 iface, * @name IDirect3DDevice9::GetDeviceCaps * @implemented * -* The function IDirect3DDevice9Impl_GetDeviceCaps fills the pCaps argument with the +* The function IDirect3DDevice9Base_GetDeviceCaps fills the pCaps argument with the * capabilities of the device. * * @param LPDIRECT3D iface @@ -171,12 +181,12 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetDirect3D(LPDIRECT3DDEVICE9 iface, * If pCaps is a bad pointer the return value will be D3DERR_INVALIDCALL. * */ -static HRESULT WINAPI IDirect3DDevice9Impl_GetDeviceCaps(LPDIRECT3DDEVICE9 iface, D3DCAPS9* pCaps) +HRESULT WINAPI IDirect3DDevice9Base_GetDeviceCaps(LPDIRECT3DDEVICE9 iface, D3DCAPS9* pCaps) { - LPDIRECT3DDEVICE9_INT This = impl_from_IDirect3DDevice9(iface); + LPDIRECT3DDEVICE9_INT This = IDirect3DDevice9ToImpl(iface); LOCK_D3DDEVICE9(); - if (IsBadWritePtr(pCaps, sizeof(D3DCAPS9))) + if (NULL == pCaps) { DPRINT1("Invalid pCaps parameter specified"); UNLOCK_D3DDEVICE9(); @@ -193,7 +203,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetDeviceCaps(LPDIRECT3DDEVICE9 iface * @name IDirect3DDevice9::GetDisplayMode * @implemented * -* The function IDirect3DDevice9Impl_GetDisplayMode fills the pMode argument with the +* The function IDirect3DDevice9Base_GetDisplayMode fills the pMode argument with the * display mode for the specified swap chain. * * @param LPDIRECT3D iface @@ -211,9 +221,9 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetDeviceCaps(LPDIRECT3DDEVICE9 iface * If iSwapChain is out of range or pMode is a bad pointer, the return value will be D3DERR_INVALIDCALL. * */ -static HRESULT WINAPI IDirect3DDevice9Impl_GetDisplayMode(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, D3DDISPLAYMODE* pMode) +HRESULT WINAPI IDirect3DDevice9Base_GetDisplayMode(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, D3DDISPLAYMODE* pMode) { - LPDIRECT3DDEVICE9_INT This = impl_from_IDirect3DDevice9(iface); + LPDIRECT3DDEVICE9_INT This = IDirect3DDevice9ToImpl(iface); LOCK_D3DDEVICE9(); if (iSwapChain >= IDirect3DDevice9_GetNumberOfSwapChains(iface)) @@ -223,7 +233,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetDisplayMode(LPDIRECT3DDEVICE9 ifac return D3DERR_INVALIDCALL; } - if (IsBadWritePtr(pMode, sizeof(D3DDISPLAYMODE))) + if (NULL == pMode) { DPRINT1("Invalid pMode parameter specified"); UNLOCK_D3DDEVICE9(); @@ -243,7 +253,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetDisplayMode(LPDIRECT3DDEVICE9 ifac * @name IDirect3DDevice9::GetCreationParameters * @implemented * -* The function IDirect3DDevice9Impl_GetCreationParameters fills the pParameters argument with the +* The function IDirect3DDevice9Base_GetCreationParameters fills the pParameters argument with the * parameters the device was created with. * * @param LPDIRECT3D iface @@ -258,12 +268,12 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetDisplayMode(LPDIRECT3DDEVICE9 ifac * If pParameters is a bad pointer, the return value will be D3DERR_INVALIDCALL. * */ -static HRESULT WINAPI IDirect3DDevice9Impl_GetCreationParameters(LPDIRECT3DDEVICE9 iface, D3DDEVICE_CREATION_PARAMETERS* pParameters) +HRESULT WINAPI IDirect3DDevice9Base_GetCreationParameters(LPDIRECT3DDEVICE9 iface, D3DDEVICE_CREATION_PARAMETERS* pParameters) { - LPDIRECT3DDEVICE9_INT This = impl_from_IDirect3DDevice9(iface); + LPDIRECT3DDEVICE9_INT This = IDirect3DDevice9ToImpl(iface); LOCK_D3DDEVICE9(); - if (IsBadWritePtr(pParameters, sizeof(D3DDEVICE_CREATION_PARAMETERS))) + if (NULL == pParameters) { DPRINT1("Invalid pParameters parameter specified"); UNLOCK_D3DDEVICE9(); @@ -279,26 +289,26 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetCreationParameters(LPDIRECT3DDEVIC return D3D_OK; } -static HRESULT WINAPI IDirect3DDevice9Impl_SetCursorProperties(LPDIRECT3DDEVICE9 iface, UINT XHotSpot, UINT YHotSpot, IDirect3DSurface9* pCursorBitmap) +HRESULT WINAPI IDirect3DDevice9Base_SetCursorProperties(LPDIRECT3DDEVICE9 iface, UINT XHotSpot, UINT YHotSpot, IDirect3DSurface9* pCursorBitmap) { UNIMPLEMENTED return D3D_OK; } -static void WINAPI IDirect3DDevice9Impl_SetCursorPosition(LPDIRECT3DDEVICE9 iface, int X, int Y, DWORD Flags) +VOID WINAPI IDirect3DDevice9Base_SetCursorPosition(LPDIRECT3DDEVICE9 iface, int X, int Y, DWORD Flags) { UNIMPLEMENTED } -static BOOL WINAPI IDirect3DDevice9Impl_ShowCursor(LPDIRECT3DDEVICE9 iface, BOOL bShow) +BOOL WINAPI IDirect3DDevice9Base_ShowCursor(LPDIRECT3DDEVICE9 iface, BOOL bShow) { UNIMPLEMENTED return TRUE; } -static HRESULT WINAPI IDirect3DDevice9Impl_CreateAdditionalSwapChain(LPDIRECT3DDEVICE9 iface, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain9** ppSwapChain) +HRESULT WINAPI IDirect3DDevice9Base_CreateAdditionalSwapChain(LPDIRECT3DDEVICE9 iface, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain9** ppSwapChain) { UNIMPLEMENTED @@ -309,7 +319,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_CreateAdditionalSwapChain(LPDIRECT3DD * @name IDirect3DDevice9::GetSwapChain * @implemented * -* The function IDirect3DDevice9Impl_GetSwapChain returns a pointer to a swap chain object. +* The function IDirect3DDevice9Base_GetSwapChain returns a pointer to a swap chain object. * * @param LPDIRECT3D iface * Pointer to the IDirect3DDevice9 object returned from IDirect3D9::CreateDevice() @@ -327,21 +337,23 @@ static HRESULT WINAPI IDirect3DDevice9Impl_CreateAdditionalSwapChain(LPDIRECT3DD * will be D3DERR_INVALIDCALL. * */ -static HRESULT WINAPI IDirect3DDevice9Impl_GetSwapChain(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, IDirect3DSwapChain9** ppSwapChain) +HRESULT WINAPI IDirect3DDevice9Base_GetSwapChain(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, IDirect3DSwapChain9** ppSwapChain) { - LPDIRECT3DDEVICE9_INT This = impl_from_IDirect3DDevice9(iface); + LPDIRECT3DDEVICE9_INT This = IDirect3DDevice9ToImpl(iface); LOCK_D3DDEVICE9(); - if (iSwapChain >= IDirect3DDevice9_GetNumberOfSwapChains(iface)) + if (NULL == ppSwapChain) { - DPRINT1("Invalid iSwapChain parameter specified"); + DPRINT1("Invalid ppSwapChain parameter specified"); UNLOCK_D3DDEVICE9(); return D3DERR_INVALIDCALL; } - if (IsBadWritePtr(ppSwapChain, sizeof(IDirect3DSwapChain9*))) + *ppSwapChain = NULL; + + if (iSwapChain >= IDirect3DDevice9_GetNumberOfSwapChains(iface)) { - DPRINT1("Invalid ppSwapChain parameter specified"); + DPRINT1("Invalid iSwapChain parameter specified"); UNLOCK_D3DDEVICE9(); return D3DERR_INVALIDCALL; } @@ -365,7 +377,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetSwapChain(LPDIRECT3DDEVICE9 iface, * @name IDirect3DDevice9::GetNumberOfSwapChains * @implemented * -* The function IDirect3DDevice9Impl_GetNumberOfSwapChains returns the number of swap chains +* The function IDirect3DDevice9Base_GetNumberOfSwapChains returns the number of swap chains * created by IDirect3D9::CreateDevice(). * * @param LPDIRECT3D iface @@ -378,11 +390,11 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetSwapChain(LPDIRECT3DDEVICE9 iface, * IDirect3DDevice9::CreateAdditionalSwapChain() method. * */ -static UINT WINAPI IDirect3DDevice9Impl_GetNumberOfSwapChains(LPDIRECT3DDEVICE9 iface) +UINT WINAPI IDirect3DDevice9Base_GetNumberOfSwapChains(LPDIRECT3DDEVICE9 iface) { UINT NumSwapChains; - LPDIRECT3DDEVICE9_INT This = impl_from_IDirect3DDevice9(iface); + LPDIRECT3DDEVICE9_INT This = IDirect3DDevice9ToImpl(iface); LOCK_D3DDEVICE9(); NumSwapChains = This->NumAdaptersInDevice; @@ -391,846 +403,156 @@ static UINT WINAPI IDirect3DDevice9Impl_GetNumberOfSwapChains(LPDIRECT3DDEVICE9 return NumSwapChains; } -static HRESULT WINAPI IDirect3DDevice9Impl_Reset(LPDIRECT3DDEVICE9 iface, D3DPRESENT_PARAMETERS* pPresentationParameters) +HRESULT WINAPI IDirect3DDevice9Base_Reset(LPDIRECT3DDEVICE9 iface, D3DPRESENT_PARAMETERS* pPresentationParameters) { UNIMPLEMENTED return D3D_OK; } -static HRESULT WINAPI IDirect3DDevice9Impl_Present(LPDIRECT3DDEVICE9 iface, CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion) +HRESULT WINAPI IDirect3DDevice9Base_Present(LPDIRECT3DDEVICE9 iface, CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion) { UNIMPLEMENTED return D3D_OK; } -static HRESULT WINAPI IDirect3DDevice9Impl_GetBackBuffer(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9** ppBackBuffer) +HRESULT WINAPI IDirect3DDevice9Base_GetBackBuffer(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9** ppBackBuffer) { UNIMPLEMENTED return D3D_OK; } -static HRESULT WINAPI IDirect3DDevice9Impl_GetRasterStatus(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, D3DRASTER_STATUS* pRasterStatus) +HRESULT WINAPI IDirect3DDevice9Base_GetRasterStatus(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, D3DRASTER_STATUS* pRasterStatus) { UNIMPLEMENTED return D3D_OK; } -static HRESULT WINAPI IDirect3DDevice9Impl_SetDialogBoxMode(LPDIRECT3DDEVICE9 iface, BOOL bEnableDialogs) +HRESULT WINAPI IDirect3DDevice9Base_SetDialogBoxMode(LPDIRECT3DDEVICE9 iface, BOOL bEnableDialogs) { UNIMPLEMENTED return D3D_OK; } -static void WINAPI IDirect3DDevice9Impl_SetGammaRamp(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, DWORD Flags, CONST D3DGAMMARAMP* pRamp) +VOID WINAPI IDirect3DDevice9Base_SetGammaRamp(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, DWORD Flags, CONST D3DGAMMARAMP* pRamp) { UNIMPLEMENTED } -static void WINAPI IDirect3DDevice9Impl_GetGammaRamp(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, D3DGAMMARAMP* pRamp) +VOID WINAPI IDirect3DDevice9Base_GetGammaRamp(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, D3DGAMMARAMP* pRamp) { UNIMPLEMENTED } -static HRESULT WINAPI IDirect3DDevice9Impl_CreateTexture(LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture9** ppTexture, HANDLE* pSharedHandle) +HRESULT WINAPI IDirect3DDevice9Base_CreateTexture(LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture9** ppTexture, HANDLE* pSharedHandle) { UNIMPLEMENTED return D3D_OK; } -static HRESULT WINAPI IDirect3DDevice9Impl_CreateVolumeTexture(LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture9** ppVolumeTexture, HANDLE* pSharedHandle) +HRESULT WINAPI IDirect3DDevice9Base_CreateVolumeTexture(LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture9** ppVolumeTexture, HANDLE* pSharedHandle) { UNIMPLEMENTED return D3D_OK; } -static HRESULT WINAPI IDirect3DDevice9Impl_CreateCubeTexture(LPDIRECT3DDEVICE9 iface, UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture9** ppCubeTexture, HANDLE* pSharedHandle) +HRESULT WINAPI IDirect3DDevice9Base_CreateCubeTexture(LPDIRECT3DDEVICE9 iface, UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture9** ppCubeTexture, HANDLE* pSharedHandle) { UNIMPLEMENTED return D3D_OK; } -static HRESULT WINAPI IDirect3DDevice9Impl_CreateVertexBuffer(LPDIRECT3DDEVICE9 iface, UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer9** ppVertexBuffer, HANDLE* pSharedHandle) +HRESULT WINAPI IDirect3DDevice9Base_CreateVertexBuffer(LPDIRECT3DDEVICE9 iface, UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer9** ppVertexBuffer, HANDLE* pSharedHandle) { UNIMPLEMENTED return D3D_OK; } -static HRESULT WINAPI IDirect3DDevice9Impl_CreateIndexBuffer(LPDIRECT3DDEVICE9 iface, UINT Length, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer9** ppIndexBuffer, HANDLE* pSharedHandle) +HRESULT WINAPI IDirect3DDevice9Base_CreateIndexBuffer(LPDIRECT3DDEVICE9 iface, UINT Length, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer9** ppIndexBuffer, HANDLE* pSharedHandle) { UNIMPLEMENTED return D3D_OK; } -static HRESULT WINAPI IDirect3DDevice9Impl_CreateRenderTarget(LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Lockable, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) +HRESULT WINAPI IDirect3DDevice9Base_CreateRenderTarget(LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Lockable, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) { UNIMPLEMENTED return D3D_OK; } -static HRESULT WINAPI IDirect3DDevice9Impl_CreateDepthStencilSurface(LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Discard, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) +HRESULT WINAPI IDirect3DDevice9Base_CreateDepthStencilSurface(LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Discard, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) { UNIMPLEMENTED return D3D_OK; } -static HRESULT WINAPI IDirect3DDevice9Impl_UpdateSurface(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestinationSurface, CONST POINT* pDestPoint) +HRESULT WINAPI IDirect3DDevice9Base_UpdateSurface(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestinationSurface, CONST POINT* pDestPoint) { UNIMPLEMENTED return D3D_OK; } -static HRESULT WINAPI IDirect3DDevice9Impl_UpdateTexture(LPDIRECT3DDEVICE9 iface, IDirect3DBaseTexture9* pSourceTexture, IDirect3DBaseTexture9* pDestinationTexture) +HRESULT WINAPI IDirect3DDevice9Base_UpdateTexture(LPDIRECT3DDEVICE9 iface, IDirect3DBaseTexture9* pSourceTexture, IDirect3DBaseTexture9* pDestinationTexture) { UNIMPLEMENTED return D3D_OK; } -static HRESULT WINAPI IDirect3DDevice9Impl_GetRenderTargetData(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pRenderTarget, IDirect3DSurface9* pDestSurface) +HRESULT WINAPI IDirect3DDevice9Base_GetRenderTargetData(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pRenderTarget, IDirect3DSurface9* pDestSurface) { UNIMPLEMENTED return D3D_OK; } -static HRESULT WINAPI IDirect3DDevice9Impl_GetFrontBufferData(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, IDirect3DSurface9* pDestSurface) +HRESULT WINAPI IDirect3DDevice9Base_GetFrontBufferData(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, IDirect3DSurface9* pDestSurface) { UNIMPLEMENTED return D3D_OK; } -static HRESULT WINAPI IDirect3DDevice9Impl_StretchRect(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestSurface, CONST RECT* pDestRect, D3DTEXTUREFILTERTYPE Filter) +HRESULT WINAPI IDirect3DDevice9Base_StretchRect(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestSurface, CONST RECT* pDestRect, D3DTEXTUREFILTERTYPE Filter) { UNIMPLEMENTED return D3D_OK; } -static HRESULT WINAPI IDirect3DDevice9Impl_ColorFill(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pSurface, CONST RECT* pRect, D3DCOLOR color) +HRESULT WINAPI IDirect3DDevice9Base_ColorFill(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pSurface, CONST RECT* pRect, D3DCOLOR color) { UNIMPLEMENTED return D3D_OK; } -static HRESULT WINAPI IDirect3DDevice9Impl_CreateOffscreenPlainSurface(LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) +HRESULT WINAPI IDirect3DDevice9Base_CreateOffscreenPlainSurface(LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) { UNIMPLEMENTED return D3D_OK; } -static HRESULT WINAPI IDirect3DDevice9Impl_SetRenderTarget(LPDIRECT3DDEVICE9 iface, DWORD RenderTargetIndex, IDirect3DSurface9* pRenderTarget) +/* IDirect3DDevice9 private interface */ +VOID WINAPI IDirect3DDevice9Base_Destroy(LPDIRECT3DDEVICE9 iface) { UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_GetRenderTarget(LPDIRECT3DDEVICE9 iface, DWORD RenderTargetIndex,IDirect3DSurface9** ppRenderTarget) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_SetDepthStencilSurface(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pNewZStencil) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_GetDepthStencilSurface(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9** ppZStencilSurface) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_BeginScene(LPDIRECT3DDEVICE9 iface) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_EndScene(LPDIRECT3DDEVICE9 iface) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_Clear(LPDIRECT3DDEVICE9 iface, DWORD Count, CONST D3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_SetTransform(LPDIRECT3DDEVICE9 iface, D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_GetTransform(LPDIRECT3DDEVICE9 iface, D3DTRANSFORMSTATETYPE State, D3DMATRIX* pMatrix) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_MultiplyTransform(LPDIRECT3DDEVICE9 iface, D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_SetViewport(LPDIRECT3DDEVICE9 iface, CONST D3DVIEWPORT9* pViewport) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_GetViewport(LPDIRECT3DDEVICE9 iface, D3DVIEWPORT9* pViewport) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_SetMaterial(LPDIRECT3DDEVICE9 iface, CONST D3DMATERIAL9* pMaterial) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_GetMaterial(LPDIRECT3DDEVICE9 iface, D3DMATERIAL9* pMaterial) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_SetLight(LPDIRECT3DDEVICE9 iface, DWORD Index, CONST D3DLIGHT9* pLight) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_GetLight(LPDIRECT3DDEVICE9 iface, DWORD Index, D3DLIGHT9* pLight) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_LightEnable(LPDIRECT3DDEVICE9 iface, DWORD Index, BOOL Enable) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_GetLightEnable(LPDIRECT3DDEVICE9 iface, DWORD Index, BOOL* pEnable) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_SetClipPlane(LPDIRECT3DDEVICE9 iface, DWORD Index, CONST float* pPlane) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_GetClipPlane(LPDIRECT3DDEVICE9 iface, DWORD Index, float* pPlane) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_SetRenderState(LPDIRECT3DDEVICE9 iface, D3DRENDERSTATETYPE State, DWORD Value) -{ - UNIMPLEMENTED - - return D3D_OK; } -static HRESULT WINAPI IDirect3DDevice9Impl_GetRenderState(LPDIRECT3DDEVICE9 iface, D3DRENDERSTATETYPE State, DWORD* pValue) +VOID WINAPI IDirect3DDevice9Base_VirtualDestructor(LPDIRECT3DDEVICE9 iface) { UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_CreateStateBlock(LPDIRECT3DDEVICE9 iface, D3DSTATEBLOCKTYPE Type, IDirect3DStateBlock9** ppSB) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_BeginStateBlock(LPDIRECT3DDEVICE9 iface) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_EndStateBlock(LPDIRECT3DDEVICE9 iface, IDirect3DStateBlock9** ppSB) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_SetClipStatus(LPDIRECT3DDEVICE9 iface, CONST D3DCLIPSTATUS9* pClipStatus) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_GetClipStatus(LPDIRECT3DDEVICE9 iface, D3DCLIPSTATUS9* pClipStatus) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_GetTexture(LPDIRECT3DDEVICE9 iface, DWORD Stage, IDirect3DBaseTexture9** ppTexture) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_SetTexture(LPDIRECT3DDEVICE9 iface, DWORD Stage, IDirect3DBaseTexture9* pTexture) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_GetTextureStageState(LPDIRECT3DDEVICE9 iface, DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_SetTextureStageState(LPDIRECT3DDEVICE9 iface, DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_GetSamplerState(LPDIRECT3DDEVICE9 iface, DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD* pValue) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_SetSamplerState(LPDIRECT3DDEVICE9 iface, DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_ValidateDevice(LPDIRECT3DDEVICE9 iface, DWORD* pNumPasses) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_SetPaletteEntries(LPDIRECT3DDEVICE9 iface, UINT PaletteNumber, CONST PALETTEENTRY* pEntries) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_GetPaletteEntries(LPDIRECT3DDEVICE9 iface, UINT PaletteNumber, PALETTEENTRY* pEntries) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_SetCurrentTexturePalette(LPDIRECT3DDEVICE9 iface, UINT PaletteNumber) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_GetCurrentTexturePalette(LPDIRECT3DDEVICE9 iface, UINT* pPaletteNumber) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_SetScissorRect(LPDIRECT3DDEVICE9 iface, CONST RECT* pRect) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_GetScissorRect(LPDIRECT3DDEVICE9 iface, RECT* pRect) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_SetSoftwareVertexProcessing(LPDIRECT3DDEVICE9 iface, BOOL bSoftware) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static BOOL WINAPI IDirect3DDevice9Impl_GetSoftwareVertexProcessing(LPDIRECT3DDEVICE9 iface) -{ - UNIMPLEMENTED - - return TRUE; } - -static HRESULT WINAPI IDirect3DDevice9Impl_SetNPatchMode(LPDIRECT3DDEVICE9 iface, float nSegments) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static float WINAPI IDirect3DDevice9Impl_GetNPatchMode(LPDIRECT3DDEVICE9 iface) -{ - UNIMPLEMENTED - - return 0.0f; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_DrawPrimitive(LPDIRECT3DDEVICE9 iface, D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_DrawIndexedPrimitive(LPDIRECT3DDEVICE9 iface, D3DPRIMITIVETYPE PrimitiveType, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_DrawPrimitiveUP(LPDIRECT3DDEVICE9 iface, D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_DrawIndexedPrimitiveUP(LPDIRECT3DDEVICE9 iface, D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertices, UINT PrimitiveCount, CONST void* pIndexData, D3DFORMAT IndexDataFormat, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_ProcessVertices(LPDIRECT3DDEVICE9 iface, UINT SrcStartIndex, UINT DestIndex, UINT VertexCount, IDirect3DVertexBuffer9* pDestBuffer, IDirect3DVertexDeclaration9* pVertexDecl, DWORD Flags) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_CreateVertexDeclaration(LPDIRECT3DDEVICE9 iface, CONST D3DVERTEXELEMENT9* pVertexElements, IDirect3DVertexDeclaration9** ppDecl) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_SetVertexDeclaration(LPDIRECT3DDEVICE9 iface, IDirect3DVertexDeclaration9* pDecl) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_GetVertexDeclaration(LPDIRECT3DDEVICE9 iface, IDirect3DVertexDeclaration9** ppDecl) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_SetFVF(LPDIRECT3DDEVICE9 iface, DWORD FVF) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_GetFVF(LPDIRECT3DDEVICE9 iface, DWORD* pFVF) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_CreateVertexShader(LPDIRECT3DDEVICE9 iface, CONST DWORD* pFunction, IDirect3DVertexShader9** ppShader) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_SetVertexShader(LPDIRECT3DDEVICE9 iface, IDirect3DVertexShader9* pShader) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_GetVertexShader(LPDIRECT3DDEVICE9 iface, IDirect3DVertexShader9** ppShader) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_SetVertexShaderConstantF(LPDIRECT3DDEVICE9 iface, UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_GetVertexShaderConstantF(LPDIRECT3DDEVICE9 iface, UINT StartRegister, float* pConstantData, UINT Vector4fCount) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_SetVertexShaderConstantI(LPDIRECT3DDEVICE9 iface, UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_GetVertexShaderConstantI(LPDIRECT3DDEVICE9 iface, UINT StartRegister, int* pConstantData, UINT Vector4iCount) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_SetVertexShaderConstantB(LPDIRECT3DDEVICE9 iface, UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_GetVertexShaderConstantB(LPDIRECT3DDEVICE9 iface, UINT StartRegister, BOOL* pConstantData, UINT BoolCount) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_SetStreamSource(LPDIRECT3DDEVICE9 iface, UINT StreamNumber, IDirect3DVertexBuffer9* pStreamData, UINT OffsetInBytes, UINT Stride) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_GetStreamSource(LPDIRECT3DDEVICE9 iface, UINT StreamNumber, IDirect3DVertexBuffer9** ppStreamData, UINT* pOffsetInBytes, UINT* pStride) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_SetStreamSourceFreq(LPDIRECT3DDEVICE9 iface, UINT StreamNumber,UINT Setting) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_GetStreamSourceFreq(LPDIRECT3DDEVICE9 iface, UINT StreamNumber, UINT* pSetting) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_SetIndices(LPDIRECT3DDEVICE9 iface, IDirect3DIndexBuffer9* pIndexData) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_GetIndices(LPDIRECT3DDEVICE9 iface, IDirect3DIndexBuffer9** ppIndexData) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_CreatePixelShader(LPDIRECT3DDEVICE9 iface, CONST DWORD* pFunction, IDirect3DPixelShader9** ppShader) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_SetPixelShader(LPDIRECT3DDEVICE9 iface, IDirect3DPixelShader9* pShader) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_GetPixelShader(LPDIRECT3DDEVICE9 iface, IDirect3DPixelShader9** ppShader) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_SetPixelShaderConstantF(LPDIRECT3DDEVICE9 iface, UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_GetPixelShaderConstantF(LPDIRECT3DDEVICE9 iface, UINT StartRegister, float* pConstantData, UINT Vector4fCount) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_SetPixelShaderConstantI(LPDIRECT3DDEVICE9 iface, UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_GetPixelShaderConstantI(LPDIRECT3DDEVICE9 iface, UINT StartRegister, int* pConstantData, UINT Vector4iCount) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_SetPixelShaderConstantB(LPDIRECT3DDEVICE9 iface, UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_GetPixelShaderConstantB(LPDIRECT3DDEVICE9 iface, UINT StartRegister, BOOL* pConstantData, UINT BoolCount) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_DrawRectPatch(LPDIRECT3DDEVICE9 iface, UINT Handle, CONST float* pNumSegs, CONST D3DRECTPATCH_INFO* pRectPatchInfo) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_DrawTriPatch(LPDIRECT3DDEVICE9 iface, UINT Handle, CONST float* pNumSegs, CONST D3DTRIPATCH_INFO* pTriPatchInfo) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_DeletePatch(LPDIRECT3DDEVICE9 iface, UINT Handle) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DDevice9Impl_CreateQuery(LPDIRECT3DDEVICE9 iface, D3DQUERYTYPE Type, IDirect3DQuery9** ppQuery) -{ - UNIMPLEMENTED - - return D3D_OK; -} - -IDirect3DDevice9Vtbl Direct3DDevice9_Vtbl = -{ - /* IUnknown */ - IDirect3DDevice9Impl_QueryInterface, - IDirect3DDevice9Impl_AddRef, - IDirect3DDevice9Impl_Release, - - /* IDirect3D9Device */ - IDirect3DDevice9Impl_TestCooperativeLevel, - IDirect3DDevice9Impl_GetAvailableTextureMem, - IDirect3DDevice9Impl_EvictManagedResources, - IDirect3DDevice9Impl_GetDirect3D, - IDirect3DDevice9Impl_GetDeviceCaps, - IDirect3DDevice9Impl_GetDisplayMode, - IDirect3DDevice9Impl_GetCreationParameters, - IDirect3DDevice9Impl_SetCursorProperties, - IDirect3DDevice9Impl_SetCursorPosition, - IDirect3DDevice9Impl_ShowCursor, - IDirect3DDevice9Impl_CreateAdditionalSwapChain, - IDirect3DDevice9Impl_GetSwapChain, - IDirect3DDevice9Impl_GetNumberOfSwapChains, - IDirect3DDevice9Impl_Reset, - IDirect3DDevice9Impl_Present, - IDirect3DDevice9Impl_GetBackBuffer, - IDirect3DDevice9Impl_GetRasterStatus, - IDirect3DDevice9Impl_SetDialogBoxMode, - IDirect3DDevice9Impl_SetGammaRamp, - IDirect3DDevice9Impl_GetGammaRamp, - IDirect3DDevice9Impl_CreateTexture, - IDirect3DDevice9Impl_CreateVolumeTexture, - IDirect3DDevice9Impl_CreateCubeTexture, - IDirect3DDevice9Impl_CreateVertexBuffer, - IDirect3DDevice9Impl_CreateIndexBuffer, - IDirect3DDevice9Impl_CreateRenderTarget, - IDirect3DDevice9Impl_CreateDepthStencilSurface, - IDirect3DDevice9Impl_UpdateSurface, - IDirect3DDevice9Impl_UpdateTexture, - IDirect3DDevice9Impl_GetRenderTargetData, - IDirect3DDevice9Impl_GetFrontBufferData, - IDirect3DDevice9Impl_StretchRect, - IDirect3DDevice9Impl_ColorFill, - IDirect3DDevice9Impl_CreateOffscreenPlainSurface, - IDirect3DDevice9Impl_SetRenderTarget, - IDirect3DDevice9Impl_GetRenderTarget, - IDirect3DDevice9Impl_SetDepthStencilSurface, - IDirect3DDevice9Impl_GetDepthStencilSurface, - IDirect3DDevice9Impl_BeginScene, - IDirect3DDevice9Impl_EndScene, - IDirect3DDevice9Impl_Clear, - IDirect3DDevice9Impl_SetTransform, - IDirect3DDevice9Impl_GetTransform, - IDirect3DDevice9Impl_MultiplyTransform, - IDirect3DDevice9Impl_SetViewport, - IDirect3DDevice9Impl_GetViewport, - IDirect3DDevice9Impl_SetMaterial, - IDirect3DDevice9Impl_GetMaterial, - IDirect3DDevice9Impl_SetLight, - IDirect3DDevice9Impl_GetLight, - IDirect3DDevice9Impl_LightEnable, - IDirect3DDevice9Impl_GetLightEnable, - IDirect3DDevice9Impl_SetClipPlane, - IDirect3DDevice9Impl_GetClipPlane, - IDirect3DDevice9Impl_SetRenderState, - IDirect3DDevice9Impl_GetRenderState, - IDirect3DDevice9Impl_CreateStateBlock, - IDirect3DDevice9Impl_BeginStateBlock, - IDirect3DDevice9Impl_EndStateBlock, - IDirect3DDevice9Impl_SetClipStatus, - IDirect3DDevice9Impl_GetClipStatus, - IDirect3DDevice9Impl_GetTexture, - IDirect3DDevice9Impl_SetTexture, - IDirect3DDevice9Impl_GetTextureStageState, - IDirect3DDevice9Impl_SetTextureStageState, - IDirect3DDevice9Impl_GetSamplerState, - IDirect3DDevice9Impl_SetSamplerState, - IDirect3DDevice9Impl_ValidateDevice, - IDirect3DDevice9Impl_SetPaletteEntries, - IDirect3DDevice9Impl_GetPaletteEntries, - IDirect3DDevice9Impl_SetCurrentTexturePalette, - IDirect3DDevice9Impl_GetCurrentTexturePalette, - IDirect3DDevice9Impl_SetScissorRect, - IDirect3DDevice9Impl_GetScissorRect, - IDirect3DDevice9Impl_SetSoftwareVertexProcessing, - IDirect3DDevice9Impl_GetSoftwareVertexProcessing, - IDirect3DDevice9Impl_SetNPatchMode, - IDirect3DDevice9Impl_GetNPatchMode, - IDirect3DDevice9Impl_DrawPrimitive, - IDirect3DDevice9Impl_DrawIndexedPrimitive, - IDirect3DDevice9Impl_DrawPrimitiveUP, - IDirect3DDevice9Impl_DrawIndexedPrimitiveUP, - IDirect3DDevice9Impl_ProcessVertices, - IDirect3DDevice9Impl_CreateVertexDeclaration, - IDirect3DDevice9Impl_SetVertexDeclaration, - IDirect3DDevice9Impl_GetVertexDeclaration, - IDirect3DDevice9Impl_SetFVF, - IDirect3DDevice9Impl_GetFVF, - IDirect3DDevice9Impl_CreateVertexShader, - IDirect3DDevice9Impl_SetVertexShader, - IDirect3DDevice9Impl_GetVertexShader, - IDirect3DDevice9Impl_SetVertexShaderConstantF, - IDirect3DDevice9Impl_GetVertexShaderConstantF, - IDirect3DDevice9Impl_SetVertexShaderConstantI, - IDirect3DDevice9Impl_GetVertexShaderConstantI, - IDirect3DDevice9Impl_SetVertexShaderConstantB, - IDirect3DDevice9Impl_GetVertexShaderConstantB, - IDirect3DDevice9Impl_SetStreamSource, - IDirect3DDevice9Impl_GetStreamSource, - IDirect3DDevice9Impl_SetStreamSourceFreq, - IDirect3DDevice9Impl_GetStreamSourceFreq, - IDirect3DDevice9Impl_SetIndices, - IDirect3DDevice9Impl_GetIndices, - IDirect3DDevice9Impl_CreatePixelShader, - IDirect3DDevice9Impl_SetPixelShader, - IDirect3DDevice9Impl_GetPixelShader, - IDirect3DDevice9Impl_SetPixelShaderConstantF, - IDirect3DDevice9Impl_GetPixelShaderConstantF, - IDirect3DDevice9Impl_SetPixelShaderConstantI, - IDirect3DDevice9Impl_GetPixelShaderConstantI, - IDirect3DDevice9Impl_SetPixelShaderConstantB, - IDirect3DDevice9Impl_GetPixelShaderConstantB, - IDirect3DDevice9Impl_DrawRectPatch, - IDirect3DDevice9Impl_DrawTriPatch, - IDirect3DDevice9Impl_DeletePatch, - IDirect3DDevice9Impl_CreateQuery, -}; - diff --git a/reactos/dll/directx/d3d9/d3d9_device.h b/reactos/dll/directx/d3d9/d3d9_device.h index 10436456860..37cf71f8f7b 100644 --- a/reactos/dll/directx/d3d9/d3d9_device.h +++ b/reactos/dll/directx/d3d9/d3d9_device.h @@ -10,161 +10,82 @@ #include "d3d9_common.h" #include +#include #include "d3d9_private.h" +#include "d3d9_swapchain.h" +#include "d3d9_surface.h" -extern struct IDirect3DDevice9Vtbl Direct3DDevice9_Vtbl; - -enum REF_TYPE +#if !defined(__cplusplus) || defined(CINTERFACE) +typedef struct _IDirect3DDevice9Vtbl_INT { - RT_EXTERNAL, - RT_BUILTIN, - RT_INTERNAL, -}; + struct IDirect3DDevice9Vtbl PublicInterface; -typedef struct _tagD3D9BaseObject_ + HRESULT (WINAPI *SetRenderStateWorker)(LPDIRECT3DDEVICE9 iface, D3DRENDERSTATETYPE State, DWORD Value); // Value = D3DDEGREETYPE Degree ); + HRESULT (WINAPI *SetTextureStageStateI)(LPDIRECT3DDEVICE9 iface, DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value); + HRESULT (WINAPI *SetSamplerStateI)(LPDIRECT3DDEVICE9 iface, DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value); + HRESULT (WINAPI *SetMaterial)(LPDIRECT3DDEVICE9 iface, CONST D3DMATERIAL9* pMaterial); + HRESULT (WINAPI *SetVertexShader)(LPDIRECT3DDEVICE9 iface, IDirect3DVertexShader9* pShader); + HRESULT (WINAPI *SetVertexShaderConstantF)(LPDIRECT3DDEVICE9 iface, UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount); + HRESULT (WINAPI *SetVertexShaderConstantI)(LPDIRECT3DDEVICE9 iface, UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount); + HRESULT (WINAPI *SetVertexShaderConstantB)(LPDIRECT3DDEVICE9 iface, UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount); + HRESULT (WINAPI *SetPixelShader)(LPDIRECT3DDEVICE9 iface, IDirect3DPixelShader9* pShader); + HRESULT (WINAPI *SetPixelShaderConstantF)(LPDIRECT3DDEVICE9 iface, UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount); + HRESULT (WINAPI *SetPixelShaderConstantI)(LPDIRECT3DDEVICE9 iface, UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount); + HRESULT (WINAPI *SetPixelShaderConstantB)(LPDIRECT3DDEVICE9 iface, UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount); + HRESULT (WINAPI *SetFVF)(LPDIRECT3DDEVICE9 iface, DWORD FVF); + HRESULT (WINAPI *SetTexture)(LPDIRECT3DDEVICE9 iface, DWORD Stage,IDirect3DBaseTexture9* pTexture); + HRESULT (WINAPI *SetIndices)(LPDIRECT3DDEVICE9 iface, IDirect3DIndexBuffer9* pIndexData); + HRESULT (WINAPI *SetStreamSource)(LPDIRECT3DDEVICE9 iface, UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride); + HRESULT (WINAPI *SetStreamSourceFreq)(LPDIRECT3DDEVICE9 iface, UINT StreamNumber,UINT Setting); + VOID (WINAPI *UpdateRenderState)(LPDIRECT3DDEVICE9 iface, DWORD Unknown1, DWORD Unknown2); + HRESULT (WINAPI *SetTransform)(LPDIRECT3DDEVICE9 iface, D3DTRANSFORMSTATETYPE State,CONST D3DMATRIX* pMatrix); + HRESULT (WINAPI *MultiplyTransform)(LPDIRECT3DDEVICE9 iface, D3DTRANSFORMSTATETYPE,CONST D3DMATRIX*); + HRESULT (WINAPI *SetClipPlane)(LPDIRECT3DDEVICE9 iface, DWORD Index,CONST float* pPlane); + VOID (WINAPI *UpdateDriverState)(LPDIRECT3DDEVICE9 iface); + HRESULT (WINAPI *SetViewport)(LPDIRECT3DDEVICE9 iface, CONST D3DVIEWPORT9* pViewport); + VOID (WINAPI *SetStreamSourceInt)(LPDIRECT3DDEVICE9 iface, LPVOID UnknownStreamData); + HRESULT (WINAPI *SetPixelShaderConstantFWorker)(LPDIRECT3DDEVICE9 iface, UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount); + HRESULT (WINAPI *SetPixelShaderConstantIWorker)(LPDIRECT3DDEVICE9 iface, UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount); + HRESULT (WINAPI *SetPixelShaderConstantBWorker)(LPDIRECT3DDEVICE9 iface, UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount); + VOID (WINAPI *DrawPrimitiveWorker)(LPDIRECT3DDEVICE9 iface, D3DPRIMITIVETYPE PrimitiveType,UINT StartVertex,UINT PrimitiveCount); + HRESULT (WINAPI *SetLight)(LPDIRECT3DDEVICE9 iface, DWORD Index,CONST D3DLIGHT9*); + HRESULT (WINAPI *LightEnable)(LPDIRECT3DDEVICE9 iface, DWORD Index,BOOL Enable); + HRESULT (WINAPI *SetRenderStateInt)(LPDIRECT3DDEVICE9 iface, D3DRENDERSTATETYPE State, DWORD Value ); // Value = D3DDEGREETYPE Degree ); + HRESULT (WINAPI *DrawPrimitiveUPInt)(LPDIRECT3DDEVICE9 iface, D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount); + HRESULT (WINAPI *Clear)(LPDIRECT3DDEVICE9 iface, DWORD Count,CONST D3DRECT* pRects,DWORD Flags,D3DCOLOR Color,float Z,DWORD Stencil); + VOID (WINAPI *DrawPrimitivesWorker)(LPDIRECT3DDEVICE9 iface); + VOID (WINAPI *UpdateVertexShader)(LPDIRECT3DDEVICE9 iface); + HRESULT (WINAPI *ValidateDrawCall)(LPDIRECT3DDEVICE9 iface, D3DPRIMITIVETYPE PrimitiveType, UINT Unknown1, UINT Unknown2, UINT Unknown3, INT Unknown4, UINT Unknown5, INT Unknown6); + HRESULT (WINAPI *Init)(LPDIRECT3DDEVICE9 iface); + VOID (WINAPI *InitState)(LPDIRECT3DDEVICE9 iface, INT State); + VOID (WINAPI *Destroy)(LPDIRECT3DDEVICE9 iface); + VOID (WINAPI *VirtualDestructor)(LPDIRECT3DDEVICE9 iface); +} IDirect3DDevice9Vtbl_INT; +#endif + +typedef struct _D3D9HeapTexture { -/* 0x0000 */ LPDWORD lpVtbl; -/* 0x0004 */ DWORD dwUnknown0004; -/* 0x0008 */ DWORD dwUnknown0008; -/* 0x000c */ struct _tagDirect3DDevice9_INT_* pBaseDevice; -/* 0x0010 */ DWORD dwUnknown0010; // Index? Unique id? -/* 0x0014 */ HANDLE hKernelHandle; -/* 0x0018 */ LPDWORD dwUnknown0018; -/* 0x001c */ enum REF_TYPE RefType; -} D3D9BaseObject; +/* 0x0000 */ DWORD dwUnknown00; +/* 0x0004 */ DWORD dwUnknown04; // 0x400 +/* 0x0008 */ LPDWORD pUnknown08; // malloc(dwUnknown04 * 2) +} D3D9HeapTexture; -typedef struct _tagD3D9BaseSurface_ -{ -/* 0x0000 */ LPDWORD lpVtbl; -/* 0x0024 */ D3DFORMAT DisplayFormat2; // Back buffer format? -/* 0x0028 */ DWORD dwUnknown0028; // Constant/ref count? (1) -/* 0x002c */ DWORD dwUnknown002c; // Refresh rate? -/* 0x0030 */ D3DPOOL SurfacePool; -/* 0x0034 */ DWORD dwUnknown0034; -/* 0x0038 */ DWORD dwUnknown0038; -/* 0x003c */ DWORD dwWidth; -/* 0x0040 */ DWORD dwHeight; -/* 0x0044 */ D3DPOOL ResourcePool; -/* 0x0048 */ D3DFORMAT DisplayFormat; -/* 0x004c */ DWORD dwUnknown004c; -/* 0x0050 */ DWORD dwUnknown0050; -/* 0x0054 */ DWORD dwUnknown0054; -/* 0x0058 */ DWORD dwBpp; -} D3D9BaseSurface; - -typedef struct _tagD3D9Surface_ -{ -/* 0x0000 */ D3D9BaseObject BaseObject; -/* 0x0020 */ D3D9BaseSurface BaseSurface; -} D3D9Surface; - -typedef struct _tagD3D9DriverSurface_ -{ -/* 0x0000 */ D3D9Surface BaseD3D9Surface; -/* 0x005c */ DWORD dwUnknown5c; -/* 0x0060 */ DWORD dwUnknown60; -/* 0x0064 */ struct _tagD3D9DriverSurface_* pPreviousDriverSurface; -/* 0x0068 */ struct _tagD3D9DriverSurface_* pNextDriverSurface; -/* 0x006c */ DWORD dwUnknown6c[8]; -} D3D9DriverSurface; - -typedef struct _tagD3D9TextureHeap_ -{ -/* 0x0000 */ DWORD NumTextures; -/* 0x0004 */ LPDWORD pFirstTexture; -} D3D9TextureHeap; - -typedef struct _tagD3D9ResourceManager_ +typedef struct _D3D9ResourceManager { #ifdef D3D_DEBUG_INFO /* N/A - 0x0000 */ DDSURFACEDESC SurfaceDesc[8]; #endif -/* 0x0000 - 0x0160 */ struct _tagDirect3DDevice9_INT_* pBaseDevice; +/* 0x0000 - 0x0160 */ struct _Direct3DDevice9_INT* pBaseDevice; /* 0x0004 - 0x0164 */ DWORD dwUnknown0004; /* 0x0008 - 0x0168 */ DWORD dwUnknown0008; /* 0x000c - 0x016c */ DWORD MaxSimultaneousTextures; /* 0x0010 - 0x0170 */ DWORD dwUnknown0010; -/* 0x0014 - 0x0174 */ LPDWORD pFirstHeapTexture; +/* 0x0014 - 0x0174 */ D3D9HeapTexture* pTextureHeap; } D3D9ResourceManager; -typedef struct _tagDirect3D9Cursor_ +typedef struct _Direct3DDevice9_INT { -/* 0x0000 */ DWORD dwUnknown0000; -/* 0x0004 */ DWORD dwUnknown0004; -/* 0x0008 */ DWORD dwUnknown0008; -/* 0x000c */ DWORD dwUnknown000c; -/* 0x0010 */ DWORD dwUnknown0010; -/* 0x0014 */ DWORD dwUnknown0014; -/* 0x0018 */ DWORD dwWidth; -/* 0x001c */ DWORD dwHeight; -/* 0x0020 */ DWORD dwUnknown0020[18]; -/* 0x0070 */ struct _tagD3D9BaseDevice_* pBaseDevice; -/* 0x0074 */ struct _tagD3D9SwapChain_* pSwapChain; -/* 0x0078 */ DWORD dwUnknown0078; -/* 0x007c */ DWORD dwMonitorVirtualX; -/* 0x0080 */ DWORD dwMonitorVirtualY; -/* 0x0084 */ DWORD dwUnknown0084; -} D3D9Cursor; - -typedef struct _tagDirect3DSwapChain9_INT_ -{ -/* 0x0000 */ D3D9BaseObject BaseObject; -/* 0x0020 */ struct IDirect3DSwapChain9Vtbl* lpVtbl; -/* 0x0024 */ DWORD dwUnknown0024; -/* 0x0028 */ D3D9Surface* pPrimarySurface; -/* 0x002c */ D3D9Surface* pExtendedPrimarySurface; -/* 0x0030 */ DWORD dwUnknown0030; -/* 0x0034 */ D3D9DriverSurface** ppBackBufferList; -/* 0x0038 */ DWORD dwNumBackBuffers; -/* 0x003c */ DWORD ChainIndex; -/* 0x0040 */ DWORD AdapterGroupIndex; -/* 0x0044 */ D3DPRESENT_PARAMETERS PresentParameters; -/* 0x007c */ DWORD dwUnknown007c; -/* 0x0080 */ DWORD dwUnknown0080[2]; /* Extended format? */ -/* 0x0088 */ D3D9Cursor* pCursor; -/* 0x008c */ DWORD dwUnknown008c[4]; -/* 0x009c */ D3D9_Unknown6BC* pUnknown6BC; -/* 0x00a0 */ LPDWORD dwUnknown00a0; -/* 0x00a4 */ DWORD dwUnknown00a4; -/* 0x00a8 */ DWORD dwUnknown00a8; -/* 0x00ac */ DWORD dwWidth; -/* 0x00b0 */ DWORD dwHeight; -/* 0x00b4 */ DWORD dwUnknown00b4; -/* 0x00b8 */ DWORD dwUnknown00b8; -/* 0x00bc */ DWORD dwUnknown00bc; -/* 0x00c0 */ DWORD dwWidth2; -/* 0x00c4 */ DWORD dwHeight2; -/* 0x00c8 */ DWORD dwUnknown00c8; -/* 0x00cc */ DWORD dwUnknown00cc; -/* 0x00d0 */ DWORD dwUnknown00d0; -/* 0x00d4 */ DWORD dwUnknown00d4; -/* 0x00d8 */ DWORD dwUnknown00d8; -/* 0x00dc */ DWORD dwUnknown00dc; -/* 0x00e0 */ DWORD dwDevModeScale; -/* 0x00e4 */ DWORD dwUnknown00e4; -/* 0x00e8 */ DWORD dwUnknown00e8; -/* 0x00ec */ DWORD dwUnknown00ec; -/* 0x00f0 */ DWORD dwUnknown00f0[27]; - -/* 0x015c */ LPDWORD pUnknown015c; -/* 0x0160 */ DWORD dwUnknown0160[4]; -/* 0x0170 */ HRESULT hResult; - -/* 0x0174 */ DWORD dwUnknown0174[26]; - -/* 0x01DC */ DWORD dwUnknownFlags; /* 1 = Show frame rate, 2 = Flip without vsync */ -/* 0x01E0 */ BOOL bForceRefreshRate; -/* 0x01E4 */ DWORD dwUnknown01dc[4]; - -/* 0x01f4 */ D3DSWAPEFFECT SwapEffect; -/* 0x01f8 */ DWORD dwUnknown01f8; -/* 0x01fc */ DWORD dwUnknown01fc; -/* 0x0200 */ DDGAMMARAMP GammaRamp; -} Direct3DSwapChain9_INT, FAR* LPDIRECT3DSWAPCHAIN9_INT; - -typedef struct _tagDirect3DDevice9_INT_ -{ -/* 0x0000 */ struct IDirect3DDevice9Vtbl* lpVtbl; +/* 0x0000 */ struct _IDirect3DDevice9Vtbl_INT* lpVtbl; /* 0x0004 */ CRITICAL_SECTION CriticalSection; #ifdef D3D_DEBUG_INFO /* N/A - 0x001c */ DWORD dbg0004; @@ -184,7 +105,7 @@ typedef struct _tagDirect3DDevice9_INT_ #endif /* 0x001c - 0x0054 */ BOOL bLockDevice; /* 0x0020 - 0x0058 */ DWORD dwProcessId; -/* 0x0024 - 0x005c */ struct _tagD3D9PUREDEVICE_* lpThis; +/* 0x0024 - 0x005c */ IUnknown* pUnknown; /* 0x0028 - 0x0060 */ DWORD dwDXVersion; /* 0x002c - 0x0064 */ DWORD unknown000011; /* 0x0030 - 0x0068 */ LONG lRefCnt; @@ -195,55 +116,11 @@ typedef struct _tagDirect3DDevice9_INT_ /* 0x0044 - 0x007c */ DWORD BehaviourFlags; /* 0x0048 - 0x0080 */ D3D9BaseSurface* pUnknown0010; /* 0x004c - 0x0084 */ DWORD NumAdaptersInDevice; -/* 0x0050 - 0x0088 */ D3DDISPLAYMODE CurrentDisplayMode; -/* 0x0060 - 0x0098 */ DWORD unknown000024; -/* 0x0064 - 0x009c */ DWORD unknown000025; -/* 0x0068 - 0x00a0 */ DWORD unknown000026; -/* 0x006c - 0x00a4 */ DWORD unknown000027; -/* 0x0070 - 0x00a8 */ DWORD unknown000028; -/* 0x0074 - 0x00ac */ DWORD unknown000029; -/* 0x0078 - 0x00b0 */ DWORD unknown000030; -/* 0x007c - 0x00b4 */ DWORD unknown000031; -/* 0x0080 - 0x00b8 */ DWORD unknown000032; -/* 0x0084 - 0x00bc */ DWORD unknown000033; -/* 0x0088 - 0x00c0 */ DWORD unknown000034; -/* 0x008c - 0x00c4 */ DWORD unknown000035; -/* 0x0090 - 0x00c8 */ DWORD unknown000036; -/* 0x0094 - 0x00cc */ DWORD unknown000037; -/* 0x0098 - 0x00d0 */ DWORD unknown000038; -/* 0x009c - 0x00d4 */ DWORD unknown000039; -/* 0x00a0 - 0x00d8 */ DWORD unknown000040; -/* 0x00a4 - 0x00dc */ DWORD unknown000041; -/* 0x00a8 - 0x00e0 */ DWORD unknown000042; -/* 0x00ac - 0x00e4 */ DWORD unknown000043; -/* 0x00b0 - 0x00e8 */ DWORD unknown000044; -/* 0x00b4 - 0x00ec */ DWORD unknown000045; -/* 0x00b8 - 0x00f0 */ DWORD unknown000046; -/* 0x00bc - 0x00f4 */ DWORD unknown000047; -/* 0x00c0 - 0x00f8 */ DWORD unknown000048; -/* 0x00c4 - 0x00fc */ DWORD unknown000049; -/* 0x00c8 - 0x0100 */ DWORD unknown000050; -/* 0x00cc - 0x0104 */ DWORD unknown000051; -/* 0x00d0 - 0x0108 */ DWORD unknown000052; -/* 0x00d4 - 0x010c */ DWORD unknown000053; -/* 0x00d8 - 0x0110 */ DWORD unknown000054; -/* 0x00dc - 0x0114 */ DWORD unknown000055; -/* 0x00e0 - 0x0118 */ DWORD unknown000056; -/* 0x00e4 - 0x011c */ DWORD unknown000057; -/* 0x00e8 - 0x0120 */ DWORD unknown000058; -/* 0x00ec - 0x0124 */ DWORD unknown000059; -/* 0x00f0 - 0x0128 */ DWORD unknown000060; -/* 0x00f4 - 0x012c */ DWORD unknown000061; -/* 0x00f8 - 0x0130 */ DWORD unknown000062; -/* 0x00fc - 0x0134 */ DWORD unknown000063; -/* 0x0100 - 0x0138 */ DWORD unknown000064; -/* 0x0104 - 0x013c */ DWORD unknown000065; -/* 0x0108 - 0x0140 */ DWORD unknown000066; -/* 0x010c - 0x0144 */ DWORD unknown000067; +/* 0x0050 - 0x0088 */ D3DDISPLAYMODE CurrentDisplayMode[D3D9_INT_MAX_NUM_ADAPTERS]; /* 0x0110 - 0x0148 */ DWORD AdapterIndexInGroup[D3D9_INT_MAX_NUM_ADAPTERS]; /* 0x0140 - 0x0178 */ D3D9_DEVICEDATA DeviceData[D3D9_INT_MAX_NUM_ADAPTERS]; -/* 0x1df0 - 0x1e28 */ LPDIRECT3DSWAPCHAIN9_INT pSwapChains[D3D9_INT_MAX_NUM_ADAPTERS]; -/* 0x1e20 */ LPDIRECT3DSWAPCHAIN9_INT pSwapChains2[D3D9_INT_MAX_NUM_ADAPTERS]; +/* 0x1df0 - 0x1e28 */ LPDIRECT3DSWAPCHAIN9_INT pSwapChains[D3D9_INT_MAX_NUM_ADAPTERS]; +/* 0x1e20 - 0x1e58 */ LPDIRECT3DSWAPCHAIN9_INT pSwapChains2[D3D9_INT_MAX_NUM_ADAPTERS]; /* 0x1e50 */ D3D9BaseSurface* pRenderTargetList; /* 0x1e54 */ DWORD unknown001941; /* 0x1e58 */ DWORD unknown001942; @@ -308,1318 +185,52 @@ typedef struct _tagDirect3DDevice9_INT_ /* 0x1f44 */ DWORD unknown002001; } DIRECT3DDEVICE9_INT, FAR* LPDIRECT3DDEVICE9_INT; -typedef struct _tagD3D9PUREDEVICE_ -{ -/* 0x0000 - 0x0000 */ DIRECT3DDEVICE9_INT BaseDevice; -/* 0x1f48 */ DWORD unknown002002; -/* 0x1f4c */ DWORD unknown002003; -/* 0x1f50 */ DWORD unknown002004; -/* 0x1f54 */ DWORD unknown002005; -/* 0x1f58 */ DWORD unknown002006; -/* 0x1f5c */ DWORD unknown002007; -/* 0x1f60 */ DWORD unknown002008; -/* 0x1f64 */ DWORD unknown002009; -/* 0x1f68 */ DWORD unknown002010; -/* 0x1f6c */ DWORD unknown002011; -/* 0x1f70 */ DWORD unknown002012; -/* 0x1f74 */ DWORD unknown002013; -/* 0x1f78 */ DWORD unknown002014; -/* 0x1f7c */ DWORD unknown002015; -/* 0x1f80 */ DWORD unknown002016; -/* 0x1f84 */ DWORD unknown002017; -/* 0x1f88 */ DWORD unknown002018; -/* 0x1f8c */ DWORD unknown002019; -/* 0x1f90 */ DWORD unknown002020; -/* 0x1f94 */ DWORD unknown002021; -/* 0x1f98 */ DWORD unknown002022; -/* 0x1f9c */ DWORD unknown002023; -/* 0x1fa0 */ DWORD unknown002024; -/* 0x1fa4 */ DWORD unknown002025; -/* 0x1fa8 - 0x1fe0 */ DWORD unknown002026; -/* 0x1fac */ DWORD unknown002027; -/* 0x1fb0 */ DWORD unknown002028; -/* 0x1fb4 */ DWORD unknown002029; -/* 0x1fb8 */ DWORD unknown002030; -/* 0x1fbc */ DWORD unknown002031; -/* 0x1fc0 */ DWORD unknown002032; -/* 0x1fc4 */ DWORD unknown002033; -/* 0x1fc8 */ DWORD unknown002034; -/* 0x1fcc */ DWORD unknown002035; -/* 0x1fd0 */ DWORD unknown002036; -/* 0x1fd4 */ DWORD unknown002037; -/* 0x1fd8 */ DWORD unknown002038; -/* 0x1fdc */ DWORD unknown002039; -/* 0x1fe0 */ DWORD unknown002040; -/* 0x1fe4 */ DWORD unknown002041; -/* 0x1fe8 */ DWORD unknown002042; -/* 0x1fec */ DWORD unknown002043; -/* 0x1ff0 */ DWORD unknown002044; -/* 0x1ff4 */ DWORD unknown002045; -/* 0x1ff8 */ DWORD unknown002046; -/* 0x1ffc */ DWORD unknown002047; -/* 0x2000 */ DWORD unknown002048; -/* 0x2004 */ DWORD unknown002049; -/* 0x2008 */ DWORD unknown002050; -/* 0x200c */ DWORD unknown002051; -/* 0x2010 */ DWORD unknown002052; -/* 0x2014 */ DWORD unknown002053; -/* 0x2018 */ DWORD unknown002054; -/* 0x201c */ DWORD unknown002055; -/* 0x2020 */ DWORD unknown002056; -/* 0x2024 */ DWORD unknown002057; -/* 0x2028 */ DWORD unknown002058; -/* 0x202c */ DWORD unknown002059; -/* 0x2030 */ DWORD unknown002060; -/* 0x2034 */ DWORD unknown002061; -/* 0x2038 */ DWORD unknown002062; -/* 0x203c */ DWORD unknown002063; -/* 0x2040 */ DWORD unknown002064; -/* 0x2044 */ DWORD unknown002065; -/* 0x2048 */ DWORD unknown002066; -/* 0x204c */ DWORD unknown002067; -/* 0x2050 */ DWORD unknown002068; -/* 0x2054 */ DWORD unknown002069; -/* 0x2058 */ DWORD unknown002070; -/* 0x205c */ DWORD unknown002071; -/* 0x2060 */ DWORD unknown002072; -/* 0x2064 */ DWORD unknown002073; -/* 0x2068 */ DWORD unknown002074; -/* 0x206c */ DWORD unknown002075; -/* 0x2070 */ DWORD unknown002076; -/* 0x2074 */ DWORD unknown002077; -/* 0x2078 */ DWORD unknown002078; -/* 0x207c */ DWORD unknown002079; -/* 0x2080 */ DWORD unknown002080; -/* 0x2084 */ DWORD unknown002081; -/* 0x2088 */ DWORD unknown002082; -/* 0x208c */ DWORD unknown002083; -/* 0x2090 */ DWORD unknown002084; -/* 0x2094 */ DWORD unknown002085; -/* 0x2098 */ DWORD unknown002086; -/* 0x209c */ DWORD unknown002087; -/* 0x20a0 */ DWORD unknown002088; -/* 0x20a4 */ DWORD unknown002089; -/* 0x20a8 */ DWORD unknown002090; -/* 0x20ac */ DWORD unknown002091; -/* 0x20b0 */ DWORD unknown002092; -/* 0x20b4 */ DWORD unknown002093; -/* 0x20b8 */ DWORD unknown002094; -/* 0x20bc */ DWORD unknown002095; -/* 0x20c0 */ DWORD unknown002096; -/* 0x20c4 */ DWORD unknown002097; -/* 0x20c8 */ DWORD unknown002098; -/* 0x20cc */ DWORD unknown002099; -/* 0x20d0 */ DWORD unknown002100; -/* 0x20d4 */ DWORD unknown002101; -/* 0x20d8 */ DWORD unknown002102; -/* 0x20dc */ DWORD unknown002103; -/* 0x20e0 */ DWORD unknown002104; -/* 0x20e4 */ DWORD unknown002105; -/* 0x20e8 */ DWORD unknown002106; -/* 0x20ec */ DWORD unknown002107; -/* 0x20f0 */ DWORD unknown002108; -/* 0x20f4 */ DWORD unknown002109; -/* 0x20f8 */ DWORD unknown002110; -/* 0x20fc */ DWORD unknown002111; -/* 0x2100 */ DWORD unknown002112; -/* 0x2104 */ DWORD unknown002113; -/* 0x2108 */ DWORD unknown002114; -/* 0x210c */ DWORD unknown002115; -/* 0x2110 */ DWORD unknown002116; -/* 0x2114 */ DWORD unknown002117; -/* 0x2118 */ DWORD unknown002118; -/* 0x211c */ DWORD unknown002119; -/* 0x2120 */ DWORD unknown002120; -/* 0x2124 */ DWORD unknown002121; -/* 0x2128 */ DWORD unknown002122; -/* 0x212c */ DWORD unknown002123; -/* 0x2130 */ DWORD unknown002124; -/* 0x2134 */ DWORD unknown002125; -/* 0x2138 */ DWORD unknown002126; -/* 0x213c */ DWORD unknown002127; -/* 0x2140 */ DWORD unknown002128; -/* 0x2144 */ DWORD unknown002129; -/* 0x2148 */ DWORD unknown002130; -/* 0x214c */ DWORD unknown002131; -/* 0x2150 */ DWORD unknown002132; -/* 0x2154 */ DWORD unknown002133; -/* 0x2158 */ DWORD unknown002134; -/* 0x215c */ DWORD unknown002135; -/* 0x2160 */ DWORD unknown002136; -/* 0x2164 */ DWORD unknown002137; -/* 0x2168 */ DWORD unknown002138; -/* 0x216c */ DWORD unknown002139; -/* 0x2170 */ DWORD unknown002140; -/* 0x2174 */ DWORD unknown002141; -/* 0x2178 */ DWORD unknown002142; -/* 0x217c */ DWORD unknown002143; -/* 0x2180 */ DWORD unknown002144; -/* 0x2184 */ DWORD unknown002145; -/* 0x2188 */ DWORD unknown002146; -/* 0x218c */ DWORD unknown002147; -/* 0x2190 */ DWORD unknown002148; -/* 0x2194 */ DWORD unknown002149; -/* 0x2198 */ DWORD unknown002150; -/* 0x219c */ DWORD unknown002151; -/* 0x21a0 */ DWORD unknown002152; -/* 0x21a4 */ DWORD unknown002153; -/* 0x21a8 */ DWORD unknown002154; -/* 0x21ac */ DWORD unknown002155; -/* 0x21b0 */ DWORD unknown002156; -/* 0x21b4 */ DWORD unknown002157; -/* 0x21b8 */ DWORD unknown002158; -/* 0x21bc */ DWORD unknown002159; -/* 0x21c0 */ DWORD unknown002160; -/* 0x21c4 */ DWORD unknown002161; -/* 0x21c8 */ DWORD unknown002162; -/* 0x21cc */ DWORD unknown002163; -/* 0x21d0 */ DWORD unknown002164; -/* 0x21d4 */ DWORD unknown002165; -/* 0x21d8 */ DWORD unknown002166; -/* 0x21dc */ DWORD unknown002167; -/* 0x21e0 */ DWORD unknown002168; -/* 0x21e4 */ DWORD unknown002169; -/* 0x21e8 */ DWORD unknown002170; -/* 0x21ec */ DWORD unknown002171; -/* 0x21f0 */ DWORD unknown002172; -/* 0x21f4 */ DWORD unknown002173; -/* 0x21f8 */ DWORD unknown002174; -/* 0x21fc */ DWORD unknown002175; -/* 0x2200 */ DWORD unknown002176; -/* 0x2204 */ DWORD unknown002177; -/* 0x2208 */ DWORD unknown002178; -/* 0x220c */ DWORD unknown002179; -/* 0x2210 */ DWORD unknown002180; -/* 0x2214 */ DWORD unknown002181; -/* 0x2218 */ DWORD unknown002182; -/* 0x221c */ DWORD unknown002183; -/* 0x2220 */ DWORD unknown002184; -/* 0x2224 */ DWORD unknown002185; -/* 0x2228 */ DWORD unknown002186; -/* 0x222c */ DWORD unknown002187; -/* 0x2230 */ DWORD unknown002188; -/* 0x2234 */ DWORD unknown002189; -/* 0x2238 */ DWORD unknown002190; -/* 0x223c */ DWORD unknown002191; -/* 0x2240 */ DWORD unknown002192; -/* 0x2244 */ DWORD unknown002193; -/* 0x2248 */ DWORD unknown002194; -/* 0x224c */ DWORD unknown002195; -/* 0x2250 */ DWORD unknown002196; -/* 0x2254 */ DWORD unknown002197; -/* 0x2258 */ DWORD unknown002198; -/* 0x225c */ DWORD unknown002199; -/* 0x2260 */ DWORD unknown002200; -/* 0x2264 */ DWORD unknown002201; -/* 0x2268 */ DWORD unknown002202; -/* 0x226c */ DWORD unknown002203; -/* 0x2270 */ DWORD unknown002204; -/* 0x2274 */ DWORD unknown002205; -/* 0x2278 */ DWORD unknown002206; -/* 0x227c */ DWORD unknown002207; -/* 0x2280 */ DWORD unknown002208; -/* 0x2284 */ DWORD unknown002209; -/* 0x2288 */ DWORD unknown002210; -/* 0x228c */ DWORD unknown002211; -/* 0x2290 */ DWORD unknown002212; -/* 0x2294 */ DWORD unknown002213; -/* 0x2298 */ DWORD unknown002214; -/* 0x229c */ DWORD unknown002215; -/* 0x22a0 */ DWORD unknown002216; -/* 0x22a4 */ DWORD unknown002217; -/* 0x22a8 */ DWORD unknown002218; -/* 0x22ac */ DWORD unknown002219; -/* 0x22b0 */ DWORD unknown002220; -/* 0x22b4 */ DWORD unknown002221; -/* 0x22b8 */ DWORD unknown002222; -/* 0x22bc */ DWORD unknown002223; -/* 0x22c0 */ DWORD unknown002224; -/* 0x22c4 */ DWORD unknown002225; -/* 0x22c8 */ DWORD unknown002226; -/* 0x22cc */ DWORD unknown002227; -/* 0x22d0 */ DWORD unknown002228; -/* 0x22d4 */ DWORD unknown002229; -/* 0x22d8 */ DWORD unknown002230; -/* 0x22dc */ DWORD unknown002231; -/* 0x22e0 */ DWORD unknown002232; -/* 0x22e4 */ DWORD unknown002233; -/* 0x22e8 */ DWORD unknown002234; -/* 0x22ec */ DWORD unknown002235; -/* 0x22f0 */ DWORD unknown002236; -/* 0x22f4 */ DWORD unknown002237; -/* 0x22f8 */ DWORD unknown002238; -/* 0x22fc */ DWORD unknown002239; -/* 0x2300 */ DWORD unknown002240; -/* 0x2304 */ DWORD unknown002241; -/* 0x2308 */ DWORD unknown002242; -/* 0x230c */ DWORD unknown002243; -/* 0x2310 */ DWORD unknown002244; -/* 0x2314 */ DWORD unknown002245; -/* 0x2318 */ DWORD unknown002246; -/* 0x231c */ DWORD unknown002247; -/* 0x2320 */ DWORD unknown002248; -/* 0x2324 */ DWORD unknown002249; -/* 0x2328 */ DWORD unknown002250; -/* 0x232c */ DWORD unknown002251; -/* 0x2330 */ DWORD unknown002252; -/* 0x2334 */ DWORD unknown002253; -/* 0x2338 */ DWORD unknown002254; -/* 0x233c */ DWORD unknown002255; -/* 0x2340 */ DWORD unknown002256; -/* 0x2344 */ DWORD unknown002257; -/* 0x2348 */ DWORD unknown002258; -/* 0x234c */ DWORD unknown002259; -/* 0x2350 */ DWORD unknown002260; -/* 0x2354 */ DWORD unknown002261; -/* 0x2358 */ DWORD unknown002262; -/* 0x235c */ DWORD unknown002263; -/* 0x2360 */ DWORD unknown002264; -/* 0x2364 */ DWORD unknown002265; -/* 0x2368 */ DWORD unknown002266; -/* 0x236c */ DWORD unknown002267; -/* 0x2370 */ DWORD unknown002268; -/* 0x2374 */ DWORD unknown002269; -/* 0x2378 */ DWORD unknown002270; -/* 0x237c */ DWORD unknown002271; -/* 0x2380 */ DWORD unknown002272; -/* 0x2384 */ DWORD unknown002273; -/* 0x2388 */ DWORD unknown002274; -/* 0x238c */ DWORD unknown002275; -/* 0x2390 */ DWORD unknown002276; -/* 0x2394 */ DWORD unknown002277; -/* 0x2398 */ DWORD unknown002278; -/* 0x239c */ DWORD unknown002279; -/* 0x23a0 */ DWORD unknown002280; -/* 0x23a4 */ DWORD unknown002281; -/* 0x23a8 */ DWORD unknown002282; -/* 0x23ac */ DWORD unknown002283; -/* 0x23b0 */ DWORD unknown002284; -/* 0x23b4 */ DWORD unknown002285; -/* 0x23b8 */ DWORD unknown002286; -/* 0x23bc */ DWORD unknown002287; -/* 0x23c0 */ DWORD unknown002288; -/* 0x23c4 */ DWORD unknown002289; -/* 0x23c8 */ DWORD unknown002290; -/* 0x23cc */ DWORD unknown002291; -/* 0x23d0 */ DWORD unknown002292; -/* 0x23d4 */ DWORD unknown002293; -/* 0x23d8 */ DWORD unknown002294; -/* 0x23dc */ DWORD unknown002295; -/* 0x23e0 */ DWORD unknown002296; -/* 0x23e4 */ DWORD unknown002297; -/* 0x23e8 */ DWORD unknown002298; -/* 0x23ec */ DWORD unknown002299; -/* 0x23f0 */ DWORD unknown002300; -/* 0x23f4 */ DWORD unknown002301; -/* 0x23f8 */ DWORD unknown002302; -/* 0x23fc */ DWORD unknown002303; -/* 0x2400 */ DWORD unknown002304; -/* 0x2404 */ DWORD unknown002305; -/* 0x2408 */ DWORD unknown002306; -/* 0x240c */ DWORD unknown002307; -/* 0x2410 */ DWORD unknown002308; -/* 0x2414 */ DWORD unknown002309; -/* 0x2418 */ DWORD unknown002310; -/* 0x241c */ DWORD unknown002311; -/* 0x2420 */ DWORD unknown002312; -/* 0x2424 */ DWORD unknown002313; -/* 0x2428 */ DWORD unknown002314; -/* 0x242c */ DWORD unknown002315; -/* 0x2430 */ DWORD unknown002316; -/* 0x2434 */ DWORD unknown002317; -} D3D9PUREDEVICE, FAR *LPD3D9PUREDEVICE; +/* Helper functions */ +LPDIRECT3DDEVICE9_INT IDirect3DDevice9ToImpl(LPDIRECT3DDEVICE9 iface); -typedef struct _tagD3D9HALDEVICE_ -{ -/* 0x0000 */ D3D9PUREDEVICE PureDevice; -#ifdef D3D_DEBUG_INFO -/* N/A - 0x0004 */ DWORD dbg0004; -/* N/A - 0x0008 */ DWORD dbg0008; -/* N/A - 0x000c */ DWORD dbg000c; -/* N/A - 0x0010 */ DWORD dbg0010; -/* N/A - 0x0014 */ DWORD dbg0014; -/* N/A - 0x0018 */ DWORD dbg0018; -/* N/A - 0x001c */ DWORD dbg001c; -/* N/A - 0x0020 */ DWORD dbg0020; -/* N/A - 0x0024 */ DWORD dbg0024; -/* N/A - 0x0028 */ DWORD dbg0028; -/* N/A - 0x002c */ DWORD dbg002c; -/* N/A - 0x0030 */ DWORD dbg0030; -/* N/A - 0x0034 */ DWORD dbg0034; -/* N/A - 0x0038 */ DWORD dbg0038; -#endif -/* 0x2438 */ DWORD unknown002438; -/* 0x243c */ DWORD unknown00243c; -/* 0x2440 */ DWORD unknown002440; -/* 0x2444 */ DWORD unknown002444; -/* 0x2448 */ DWORD unknown002448; -/* 0x244c */ DWORD unknown00244c; -/* 0x2450 */ DWORD unknown002450; -/* 0x2454 */ DWORD unknown002454; -/* 0x2458 */ DWORD unknown002458; -/* 0x245c */ DWORD unknown00245c; -/* 0x2460 */ DWORD unknown002460; -/* 0x2464 */ DWORD unknown002464; -/* 0x2468 */ DWORD unknown002468; -/* 0x246c */ DWORD unknown00246c; -/* 0x2470 */ DWORD unknown002470; -/* 0x2474 */ DWORD unknown002474; -/* 0x2478 */ DWORD unknown002478; -/* 0x247c */ DWORD unknown00247c; -/* 0x2480 */ DWORD unknown002480; -/* 0x2484 */ DWORD unknown002484; -/* 0x2488 */ DWORD unknown002488; -/* 0x248c */ DWORD unknown00248c; -/* 0x2490 */ DWORD unknown002490; -/* 0x2494 */ DWORD unknown002494; -/* 0x2498 */ DWORD unknown002498; -/* 0x249c */ DWORD unknown00249c; -/* 0x24a0 */ DWORD unknown0024a0; -/* 0x24a4 */ DWORD unknown0024a4; -/* 0x24a8 */ DWORD unknown0024a8; -/* 0x24ac */ DWORD unknown0024ac; -/* 0x24b0 */ DWORD unknown0024b0; -/* 0x24b4 */ DWORD unknown0024b4; -/* 0x24b8 */ DWORD unknown0024b8; -/* 0x24bc */ DWORD unknown0024bc; -/* 0x24c0 */ DWORD unknown0024c0; -/* 0x24c4 */ DWORD unknown0024c4; -/* 0x24c8 */ DWORD unknown0024c8; -/* 0x24cc */ DWORD unknown0024cc; -/* 0x24d0 */ DWORD unknown0024d0; -/* 0x24d4 */ DWORD unknown0024d4; -/* 0x24d8 */ DWORD unknown0024d8; -/* 0x24dc */ DWORD unknown0024dc; -/* 0x24e0 */ DWORD unknown0024e0; -/* 0x24e4 */ DWORD unknown0024e4; -/* 0x24e8 */ DWORD unknown0024e8; -/* 0x24ec */ DWORD unknown0024ec; -/* 0x24f0 */ DWORD unknown0024f0; -/* 0x24f4 */ DWORD unknown0024f4; -/* 0x24f8 */ DWORD unknown0024f8; -/* 0x24fc */ DWORD unknown0024fc; -/* 0x2500 */ DWORD unknown002500; -/* 0x2504 */ DWORD unknown002504; -/* 0x2508 */ DWORD unknown002508; -/* 0x250c */ DWORD unknown00250c; -/* 0x2510 */ DWORD unknown002510; -/* 0x2514 */ DWORD unknown002514; -/* 0x2518 */ DWORD unknown002518; -/* 0x251c */ DWORD unknown00251c; -/* 0x2520 */ DWORD unknown002520; -/* 0x2524 */ DWORD unknown002524; -/* 0x2528 */ DWORD unknown002528; -/* 0x252c */ DWORD unknown00252c; -/* 0x2530 */ DWORD unknown002530; -/* 0x2534 */ DWORD unknown002534; -/* 0x2538 */ DWORD unknown002538; -/* 0x253c */ DWORD unknown00253c; -/* 0x2540 */ DWORD unknown002540; -/* 0x2544 */ DWORD unknown002544; -/* 0x2548 */ DWORD unknown002548; -/* 0x254c */ DWORD unknown00254c; -/* 0x2550 */ DWORD unknown002550; -/* 0x2554 */ DWORD unknown002554; -/* 0x2558 */ DWORD unknown002558; -/* 0x255c */ DWORD unknown00255c; -/* 0x2560 */ DWORD unknown002560; -/* 0x2564 */ DWORD unknown002564; -/* 0x2568 */ DWORD unknown002568; -/* 0x256c */ DWORD unknown00256c; -/* 0x2570 */ DWORD unknown002570; -/* 0x2574 */ DWORD unknown002574; -/* 0x2578 */ DWORD unknown002578; -/* 0x257c */ DWORD unknown00257c; -/* 0x2580 */ DWORD unknown002580; -/* 0x2584 */ DWORD unknown002584; -/* 0x2588 */ DWORD unknown002588; -/* 0x258c */ DWORD unknown00258c; -/* 0x2590 */ DWORD unknown002590; -/* 0x2594 */ DWORD unknown002594; -/* 0x2598 */ DWORD unknown002598; -/* 0x259c */ DWORD unknown00259c; -/* 0x25a0 */ DWORD unknown0025a0; -/* 0x25a4 */ DWORD unknown0025a4; -/* 0x25a8 */ DWORD unknown0025a8; -/* 0x25ac */ DWORD unknown0025ac; -/* 0x25b0 */ DWORD unknown0025b0; -/* 0x25b4 */ DWORD unknown0025b4; -/* 0x25b8 */ DWORD unknown0025b8; -/* 0x25bc */ DWORD unknown0025bc; -/* 0x25c0 */ DWORD unknown0025c0; -/* 0x25c4 */ DWORD unknown0025c4; -/* 0x25c8 */ DWORD unknown0025c8; -/* 0x25cc */ DWORD unknown0025cc; -/* 0x25d0 */ DWORD unknown0025d0; -/* 0x25d4 */ DWORD unknown0025d4; -/* 0x25d8 */ DWORD unknown0025d8; -/* 0x25dc */ DWORD unknown0025dc; -/* 0x25e0 */ DWORD unknown0025e0; -/* 0x25e4 */ DWORD unknown0025e4; -/* 0x25e8 */ DWORD unknown0025e8; -/* 0x25ec */ DWORD unknown0025ec; -/* 0x25f0 */ DWORD unknown0025f0; -/* 0x25f4 */ DWORD unknown0025f4; -/* 0x25f8 */ DWORD unknown0025f8; -/* 0x25fc */ DWORD unknown0025fc; +/* IUnknown interface */ +HRESULT WINAPI IDirect3DDevice9Base_QueryInterface(LPDIRECT3DDEVICE9 iface, REFIID riid, void** ppvObject); +ULONG WINAPI IDirect3DDevice9Base_AddRef(LPDIRECT3DDEVICE9 iface); +ULONG WINAPI IDirect3DDevice9Base_Release(LPDIRECT3DDEVICE9 iface); -/* 0x2600 */ DWORD unknown002600; -/* 0x2604 */ DWORD unknown002604; -/* 0x2608 */ DWORD unknown002608; -/* 0x260c */ DWORD unknown00260c; -/* 0x2610 */ DWORD unknown002610; -/* 0x2614 */ DWORD unknown002614; -/* 0x2618 */ DWORD unknown002618; -/* 0x261c */ DWORD unknown00261c; -/* 0x2620 */ DWORD unknown002620; -/* 0x2624 */ DWORD unknown002624; -/* 0x2628 */ DWORD unknown002628; -/* 0x262c */ DWORD unknown00262c; -/* 0x2630 */ DWORD unknown002630; -/* 0x2634 */ DWORD unknown002634; -/* 0x2638 */ DWORD unknown002638; -/* 0x263c */ DWORD unknown00263c; -/* 0x2640 */ DWORD unknown002640; -/* 0x2644 */ DWORD unknown002644; -/* 0x2648 */ DWORD unknown002648; -/* 0x264c */ DWORD unknown00264c; -/* 0x2650 */ DWORD unknown002650; -/* 0x2654 */ DWORD unknown002654; -/* 0x2658 */ DWORD unknown002658; -/* 0x265c */ DWORD unknown00265c; -/* 0x2660 */ DWORD unknown002660; -/* 0x2664 */ DWORD unknown002664; -/* 0x2668 */ DWORD unknown002668; -/* 0x266c */ DWORD unknown00266c; -/* 0x2670 */ DWORD unknown002670; -/* 0x2674 */ DWORD unknown002674; -/* 0x2678 */ DWORD unknown002678; -/* 0x267c */ DWORD unknown00267c; -/* 0x2680 */ DWORD unknown002680; -/* 0x2684 */ DWORD unknown002684; -/* 0x2688 */ DWORD unknown002688; -/* 0x268c */ DWORD unknown00268c; -/* 0x2690 */ DWORD unknown002690; -/* 0x2694 */ DWORD unknown002694; -/* 0x2698 */ DWORD unknown002698; -/* 0x269c */ DWORD unknown00269c; -/* 0x26a0 */ DWORD unknown0026a0; -/* 0x26a4 */ DWORD unknown0026a4; -/* 0x26a8 */ DWORD unknown0026a8; -/* 0x26ac */ DWORD unknown0026ac; -/* 0x26b0 */ DWORD unknown0026b0; -/* 0x26b4 */ DWORD unknown0026b4; -/* 0x26b8 */ DWORD unknown0026b8; -/* 0x26bc */ DWORD unknown0026bc; -/* 0x26c0 */ DWORD unknown0026c0; -/* 0x26c4 */ DWORD unknown0026c4; -/* 0x26c8 */ DWORD unknown0026c8; -/* 0x26cc */ DWORD unknown0026cc; -/* 0x26d0 */ DWORD unknown0026d0; -/* 0x26d4 */ DWORD unknown0026d4; -/* 0x26d8 */ DWORD unknown0026d8; -/* 0x26dc */ DWORD unknown0026dc; -/* 0x26e0 */ DWORD unknown0026e0; -/* 0x26e4 */ DWORD unknown0026e4; -/* 0x26e8 */ DWORD unknown0026e8; -/* 0x26ec */ DWORD unknown0026ec; -/* 0x26f0 */ DWORD unknown0026f0; -/* 0x26f4 */ DWORD unknown0026f4; -/* 0x26f8 */ DWORD unknown0026f8; -/* 0x26fc */ DWORD unknown0026fc; +/* IDirect3DDevice9 public interface */ +HRESULT WINAPI IDirect3DDevice9Base_TestCooperativeLevel(LPDIRECT3DDEVICE9 iface); +UINT WINAPI IDirect3DDevice9Base_GetAvailableTextureMem(LPDIRECT3DDEVICE9 iface); +HRESULT WINAPI IDirect3DDevice9Base_EvictManagedResources(LPDIRECT3DDEVICE9 iface); +HRESULT WINAPI IDirect3DDevice9Base_GetDirect3D(LPDIRECT3DDEVICE9 iface, IDirect3D9** ppD3D9); +HRESULT WINAPI IDirect3DDevice9Base_GetDeviceCaps(LPDIRECT3DDEVICE9 iface, D3DCAPS9* pCaps); +HRESULT WINAPI IDirect3DDevice9Base_GetDisplayMode(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, D3DDISPLAYMODE* pMode); +HRESULT WINAPI IDirect3DDevice9Base_GetCreationParameters(LPDIRECT3DDEVICE9 iface, D3DDEVICE_CREATION_PARAMETERS* pParameters); +HRESULT WINAPI IDirect3DDevice9Base_SetCursorProperties(LPDIRECT3DDEVICE9 iface, UINT XHotSpot, UINT YHotSpot, IDirect3DSurface9* pCursorBitmap); +VOID WINAPI IDirect3DDevice9Base_SetCursorPosition(LPDIRECT3DDEVICE9 iface, int X, int Y, DWORD Flags); +BOOL WINAPI IDirect3DDevice9Base_ShowCursor(LPDIRECT3DDEVICE9 iface, BOOL bShow); +HRESULT WINAPI IDirect3DDevice9Base_CreateAdditionalSwapChain(LPDIRECT3DDEVICE9 iface, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain9** ppSwapChain); +HRESULT WINAPI IDirect3DDevice9Base_GetSwapChain(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, IDirect3DSwapChain9** ppSwapChain); +UINT WINAPI IDirect3DDevice9Base_GetNumberOfSwapChains(LPDIRECT3DDEVICE9 iface); +HRESULT WINAPI IDirect3DDevice9Base_Reset(LPDIRECT3DDEVICE9 iface, D3DPRESENT_PARAMETERS* pPresentationParameters); +HRESULT WINAPI IDirect3DDevice9Base_Present(LPDIRECT3DDEVICE9 iface, CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion); +HRESULT WINAPI IDirect3DDevice9Base_GetBackBuffer(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9** ppBackBuffer); +HRESULT WINAPI IDirect3DDevice9Base_GetRasterStatus(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, D3DRASTER_STATUS* pRasterStatus); +HRESULT WINAPI IDirect3DDevice9Base_SetDialogBoxMode(LPDIRECT3DDEVICE9 iface, BOOL bEnableDialogs); +VOID WINAPI IDirect3DDevice9Base_SetGammaRamp(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, DWORD Flags, CONST D3DGAMMARAMP* pRamp); +VOID WINAPI IDirect3DDevice9Base_GetGammaRamp(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, D3DGAMMARAMP* pRamp); +HRESULT WINAPI IDirect3DDevice9Base_CreateTexture(LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture9** ppTexture, HANDLE* pSharedHandle); +HRESULT WINAPI IDirect3DDevice9Base_CreateVolumeTexture(LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture9** ppVolumeTexture, HANDLE* pSharedHandle); +HRESULT WINAPI IDirect3DDevice9Base_CreateCubeTexture(LPDIRECT3DDEVICE9 iface, UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture9** ppCubeTexture, HANDLE* pSharedHandle); +HRESULT WINAPI IDirect3DDevice9Base_CreateVertexBuffer(LPDIRECT3DDEVICE9 iface, UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer9** ppVertexBuffer, HANDLE* pSharedHandle); +HRESULT WINAPI IDirect3DDevice9Base_CreateIndexBuffer(LPDIRECT3DDEVICE9 iface, UINT Length, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer9** ppIndexBuffer, HANDLE* pSharedHandle); +HRESULT WINAPI IDirect3DDevice9Base_CreateRenderTarget(LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Lockable, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle); +HRESULT WINAPI IDirect3DDevice9Base_CreateDepthStencilSurface(LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Discard, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle); +HRESULT WINAPI IDirect3DDevice9Base_UpdateSurface(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestinationSurface, CONST POINT* pDestPoint); +HRESULT WINAPI IDirect3DDevice9Base_UpdateTexture(LPDIRECT3DDEVICE9 iface, IDirect3DBaseTexture9* pSourceTexture, IDirect3DBaseTexture9* pDestinationTexture); +HRESULT WINAPI IDirect3DDevice9Base_GetRenderTargetData(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pRenderTarget, IDirect3DSurface9* pDestSurface); +HRESULT WINAPI IDirect3DDevice9Base_GetFrontBufferData(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, IDirect3DSurface9* pDestSurface); +HRESULT WINAPI IDirect3DDevice9Base_StretchRect(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestSurface, CONST RECT* pDestRect, D3DTEXTUREFILTERTYPE Filter); +HRESULT WINAPI IDirect3DDevice9Base_ColorFill(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pSurface, CONST RECT* pRect, D3DCOLOR color); +HRESULT WINAPI IDirect3DDevice9Base_CreateOffscreenPlainSurface(LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle); -/* 0x2700 */ DWORD unknown002700; -/* 0x2704 */ DWORD unknown002704; -/* 0x2708 */ DWORD unknown002708; -/* 0x270c */ DWORD unknown00270c; -/* 0x2710 */ DWORD unknown002710; -/* 0x2714 */ DWORD unknown002714; -/* 0x2718 */ DWORD unknown002718; -/* 0x271c */ DWORD unknown00271c; -/* 0x2720 */ DWORD unknown002720; -/* 0x2724 */ DWORD unknown002724; -/* 0x2728 */ DWORD unknown002728; -/* 0x272c */ DWORD unknown00272c; -/* 0x2730 */ DWORD unknown002730; -/* 0x2734 */ DWORD unknown002734; -/* 0x2738 */ DWORD unknown002738; -/* 0x273c */ DWORD unknown00273c; -/* 0x2740 */ DWORD unknown002740; -/* 0x2744 */ DWORD unknown002744; -/* 0x2748 */ DWORD unknown002748; -/* 0x274c */ DWORD unknown00274c; -/* 0x2750 */ DWORD unknown002750; -/* 0x2754 */ DWORD unknown002754; -/* 0x2758 */ DWORD unknown002758; -/* 0x275c */ DWORD unknown00275c; -/* 0x2760 */ DWORD unknown002760; -/* 0x2764 */ DWORD unknown002764; -/* 0x2768 */ DWORD unknown002768; -/* 0x276c */ DWORD unknown00276c; -/* 0x2770 */ DWORD unknown002770; -/* 0x2774 */ DWORD unknown002774; -/* 0x2778 */ DWORD unknown002778; -/* 0x277c */ DWORD unknown00277c; -/* 0x2780 */ DWORD unknown002780; -/* 0x2784 */ DWORD unknown002784; -/* 0x2788 */ DWORD unknown002788; -/* 0x278c */ DWORD unknown00278c; -/* 0x2790 */ DWORD unknown002790; -/* 0x2794 */ DWORD unknown002794; -/* 0x2798 */ DWORD unknown002798; -/* 0x279c */ DWORD unknown00279c; -/* 0x27a0 */ DWORD unknown0027a0; -/* 0x27a4 */ DWORD unknown0027a4; -/* 0x27a8 */ DWORD unknown0027a8; -/* 0x27ac */ DWORD unknown0027ac; -/* 0x27b0 */ DWORD unknown0027b0; -/* 0x27b4 */ DWORD unknown0027b4; -/* 0x27b8 */ DWORD unknown0027b8; -/* 0x27bc */ DWORD unknown0027bc; -/* 0x27c0 */ DWORD unknown0027c0; -/* 0x27c4 */ DWORD unknown0027c4; -/* 0x27c8 */ DWORD unknown0027c8; -/* 0x27cc */ DWORD unknown0027cc; -/* 0x27d0 */ DWORD unknown0027d0; -/* 0x27d4 */ DWORD unknown0027d4; -/* 0x27d8 */ DWORD unknown0027d8; -/* 0x27dc */ DWORD unknown0027dc; -/* 0x27e0 */ DWORD unknown0027e0; -/* 0x27e4 */ DWORD unknown0027e4; -/* 0x27e8 */ DWORD unknown0027e8; -/* 0x27ec */ DWORD unknown0027ec; -/* 0x27f0 */ DWORD unknown0027f0; -/* 0x27f4 */ DWORD unknown0027f4; -/* 0x27f8 */ DWORD unknown0027f8; -/* 0x27fc */ DWORD unknown0027fc; - -/* 0x2800 */ DWORD unknown002800; -/* 0x2804 */ DWORD unknown002804; -/* 0x2808 */ DWORD unknown002808; -/* 0x280c */ DWORD unknown00280c; -/* 0x2810 */ DWORD unknown002810; -/* 0x2814 */ DWORD unknown002814; -/* 0x2818 */ DWORD unknown002818; -/* 0x281c */ DWORD unknown00281c; -/* 0x2820 */ DWORD unknown002820; -/* 0x2824 */ DWORD unknown002824; -/* 0x2828 */ DWORD unknown002828; -/* 0x282c */ DWORD unknown00282c; -/* 0x2830 */ DWORD unknown002830; -/* 0x2834 */ DWORD unknown002834; -/* 0x2838 */ DWORD unknown002838; -/* 0x283c */ DWORD unknown00283c; -/* 0x2840 */ DWORD unknown002840; -/* 0x2844 */ DWORD unknown002844; -/* 0x2848 */ DWORD unknown002848; -/* 0x284c */ DWORD unknown00284c; -/* 0x2850 */ DWORD unknown002850; -/* 0x2854 */ DWORD unknown002854; -/* 0x2858 */ DWORD unknown002858; -/* 0x285c */ DWORD unknown00285c; -/* 0x2860 */ DWORD unknown002860; -/* 0x2864 */ DWORD unknown002864; -/* 0x2868 */ DWORD unknown002868; -/* 0x286c */ DWORD unknown00286c; -/* 0x2870 */ DWORD unknown002870; -/* 0x2874 */ DWORD unknown002874; -/* 0x2878 */ DWORD unknown002878; -/* 0x287c */ DWORD unknown00287c; -/* 0x2880 */ DWORD unknown002880; -/* 0x2884 */ DWORD unknown002884; -/* 0x2888 */ DWORD unknown002888; -/* 0x288c */ DWORD unknown00288c; -/* 0x2890 */ DWORD unknown002890; -/* 0x2894 */ DWORD unknown002894; -/* 0x2898 */ DWORD unknown002898; -/* 0x289c */ DWORD unknown00289c; -/* 0x28a0 */ DWORD unknown0028a0; -/* 0x28a4 */ DWORD unknown0028a4; -/* 0x28a8 */ DWORD unknown0028a8; -/* 0x28ac */ DWORD unknown0028ac; -/* 0x28b0 */ DWORD unknown0028b0; -/* 0x28b4 */ DWORD unknown0028b4; -/* 0x28b8 */ DWORD unknown0028b8; -/* 0x28bc */ DWORD unknown0028bc; -/* 0x28c0 */ DWORD unknown0028c0; -/* 0x28c4 */ DWORD unknown0028c4; -/* 0x28c8 */ DWORD unknown0028c8; -/* 0x28cc */ DWORD unknown0028cc; -/* 0x28d0 */ DWORD unknown0028d0; -/* 0x28d4 */ DWORD unknown0028d4; -/* 0x28d8 */ DWORD unknown0028d8; -/* 0x28dc */ DWORD unknown0028dc; -/* 0x28e0 */ DWORD unknown0028e0; -/* 0x28e4 */ DWORD unknown0028e4; -/* 0x28e8 */ DWORD unknown0028e8; -/* 0x28ec */ DWORD unknown0028ec; -/* 0x28f0 */ DWORD unknown0028f0; -/* 0x28f4 */ DWORD unknown0028f4; -/* 0x28f8 */ DWORD unknown0028f8; -/* 0x28fc */ DWORD unknown0028fc; - -/* 0x2900 */ DWORD unknown002900; -/* 0x2904 */ DWORD unknown002904; -/* 0x2908 */ DWORD unknown002908; -/* 0x290c */ DWORD unknown00290c; -/* 0x2910 */ DWORD unknown002910; -/* 0x2914 */ DWORD unknown002914; -/* 0x2918 */ DWORD unknown002918; -/* 0x291c */ DWORD unknown00291c; -/* 0x2920 */ DWORD unknown002920; -/* 0x2924 */ DWORD unknown002924; -/* 0x2928 */ DWORD unknown002928; -/* 0x292c */ DWORD unknown00292c; -/* 0x2930 */ DWORD unknown002930; -/* 0x2934 */ DWORD unknown002934; -/* 0x2938 */ DWORD unknown002938; -/* 0x293c */ DWORD unknown00293c; -/* 0x2940 */ DWORD unknown002940; -/* 0x2944 */ DWORD unknown002944; -/* 0x2948 */ DWORD unknown002948; -/* 0x294c */ DWORD unknown00294c; -/* 0x2950 */ DWORD unknown002950; -/* 0x2954 */ DWORD unknown002954; -/* 0x2958 */ DWORD unknown002958; -/* 0x295c */ DWORD unknown00295c; -/* 0x2960 */ DWORD unknown002960; -/* 0x2964 */ DWORD unknown002964; -/* 0x2968 */ DWORD unknown002968; -/* 0x296c */ DWORD unknown00296c; -/* 0x2970 */ DWORD unknown002970; -/* 0x2974 */ DWORD unknown002974; -/* 0x2978 */ DWORD unknown002978; -/* 0x297c */ DWORD unknown00297c; -/* 0x2980 */ DWORD unknown002980; -/* 0x2984 */ DWORD unknown002984; -/* 0x2988 */ DWORD unknown002988; -/* 0x298c */ DWORD unknown00298c; -/* 0x2990 */ DWORD unknown002990; -/* 0x2994 */ DWORD unknown002994; -/* 0x2998 */ DWORD unknown002998; -/* 0x299c */ DWORD unknown00299c; -/* 0x29a0 */ DWORD unknown0029a0; -/* 0x29a4 */ DWORD unknown0029a4; -/* 0x29a8 */ DWORD unknown0029a8; -/* 0x29ac */ DWORD unknown0029ac; -/* 0x29b0 */ DWORD unknown0029b0; -/* 0x29b4 */ DWORD unknown0029b4; -/* 0x29b8 */ DWORD unknown0029b8; -/* 0x29bc */ DWORD unknown0029bc; -/* 0x29c0 */ DWORD unknown0029c0; -/* 0x29c4 */ DWORD unknown0029c4; -/* 0x29c8 */ DWORD unknown0029c8; -/* 0x29cc */ DWORD unknown0029cc; -/* 0x29d0 */ DWORD unknown0029d0; -/* 0x29d4 */ DWORD unknown0029d4; -/* 0x29d8 */ DWORD unknown0029d8; -/* 0x29dc */ DWORD unknown0029dc; -/* 0x29e0 */ DWORD unknown0029e0; -/* 0x29e4 */ DWORD unknown0029e4; -/* 0x29e8 */ DWORD unknown0029e8; -/* 0x29ec */ DWORD unknown0029ec; -/* 0x29f0 */ DWORD unknown0029f0; -/* 0x29f4 */ DWORD unknown0029f4; -/* 0x29f8 */ DWORD unknown0029f8; -/* 0x29fc */ DWORD unknown0029fc; - -/* 0x2a00 */ DWORD unknown002a00; -/* 0x2a04 */ DWORD unknown002a04; -/* 0x2a08 */ DWORD unknown002a08; -/* 0x2a0c */ DWORD unknown002a0c; -/* 0x2a10 */ DWORD unknown002a10; -/* 0x2a14 */ DWORD unknown002a14; -/* 0x2a18 */ DWORD unknown002a18; -/* 0x2a1c */ DWORD unknown002a1c; -/* 0x2a20 */ DWORD unknown002a20; -/* 0x2a24 */ DWORD unknown002a24; -/* 0x2a28 */ DWORD unknown002a28; -/* 0x2a2c */ DWORD unknown002a2c; -/* 0x2a30 */ DWORD unknown002a30; -/* 0x2a34 */ DWORD unknown002a34; -/* 0x2a38 */ DWORD unknown002a38; -/* 0x2a3c */ DWORD unknown002a3c; -/* 0x2a40 */ DWORD unknown002a40; -/* 0x2a44 */ DWORD unknown002a44; -/* 0x2a48 */ DWORD unknown002a48; -/* 0x2a4c */ DWORD unknown002a4c; -/* 0x2a50 */ DWORD unknown002a50; -/* 0x2a54 */ DWORD unknown002a54; -/* 0x2a58 */ DWORD unknown002a58; -/* 0x2a5c */ DWORD unknown002a5c; -/* 0x2a60 */ DWORD unknown002a60; -/* 0x2a64 */ DWORD unknown002a64; -/* 0x2a68 */ DWORD unknown002a68; -/* 0x2a6c */ DWORD unknown002a6c; -/* 0x2a70 */ DWORD unknown002a70; -/* 0x2a74 */ DWORD unknown002a74; -/* 0x2a78 */ DWORD unknown002a78; -/* 0x2a7c */ DWORD unknown002a7c; -/* 0x2a80 */ DWORD unknown002a80; -/* 0x2a84 */ DWORD unknown002a84; -/* 0x2a88 */ DWORD unknown002a88; -/* 0x2a8c */ DWORD unknown002a8c; -/* 0x2a90 */ DWORD unknown002a90; -/* 0x2a94 */ DWORD unknown002a94; -/* 0x2a98 */ DWORD unknown002a98; -/* 0x2a9c */ DWORD unknown002a9c; -/* 0x2aa0 */ DWORD unknown002aa0; -/* 0x2aa4 */ DWORD unknown002aa4; -/* 0x2aa8 */ DWORD unknown002aa8; -/* 0x2aac */ DWORD unknown002aac; -/* 0x2ab0 */ DWORD unknown002ab0; -/* 0x2ab4 */ DWORD unknown002ab4; -/* 0x2ab8 */ DWORD unknown002ab8; -/* 0x2abc */ DWORD unknown002abc; -/* 0x2ac0 */ DWORD unknown002ac0; -/* 0x2ac4 */ DWORD unknown002ac4; -/* 0x2ac8 */ DWORD unknown002ac8; -/* 0x2acc */ DWORD unknown002acc; -/* 0x2ad0 */ DWORD unknown002ad0; -/* 0x2ad4 */ DWORD unknown002ad4; -/* 0x2ad8 */ DWORD unknown002ad8; -/* 0x2adc */ DWORD unknown002adc; -/* 0x2ae0 */ DWORD unknown002ae0; -/* 0x2ae4 */ DWORD unknown002ae4; -/* 0x2ae8 */ DWORD unknown002ae8; -/* 0x2aec */ DWORD unknown002aec; -/* 0x2af0 */ DWORD unknown002af0; -/* 0x2af4 */ DWORD unknown002af4; -/* 0x2af8 */ DWORD unknown002af8; -/* 0x2afc */ DWORD unknown002afc; - -/* 0x2b00 */ DWORD unknown002b00; -/* 0x2b04 */ DWORD unknown002b04; -/* 0x2b08 */ DWORD unknown002b08; -/* 0x2b0c */ DWORD unknown002b0c; -/* 0x2b10 */ DWORD unknown002b10; -/* 0x2b14 */ DWORD unknown002b14; -/* 0x2b18 */ DWORD unknown002b18; -/* 0x2b1c */ DWORD unknown002b1c; -/* 0x2b20 */ DWORD unknown002b20; -/* 0x2b24 */ DWORD unknown002b24; -/* 0x2b28 */ DWORD unknown002b28; -/* 0x2b2c */ DWORD unknown002b2c; -/* 0x2b30 */ DWORD unknown002b30; -/* 0x2b34 */ DWORD unknown002b34; -/* 0x2b38 */ DWORD unknown002b38; -/* 0x2b3c */ DWORD unknown002b3c; -/* 0x2b40 */ DWORD unknown002b40; -/* 0x2b44 */ DWORD unknown002b44; -/* 0x2b48 */ DWORD unknown002b48; -/* 0x2b4c */ DWORD unknown002b4c; -/* 0x2b50 */ DWORD unknown002b50; -/* 0x2b54 */ DWORD unknown002b54; -/* 0x2b58 */ DWORD unknown002b58; -/* 0x2b5c */ DWORD unknown002b5c; -/* 0x2b60 */ DWORD unknown002b60; -/* 0x2b64 */ DWORD unknown002b64; -/* 0x2b68 */ DWORD unknown002b68; -/* 0x2b6c */ DWORD unknown002b6c; -/* 0x2b70 */ DWORD unknown002b70; -/* 0x2b74 */ DWORD unknown002b74; -/* 0x2b78 */ DWORD unknown002b78; -/* 0x2b7c */ DWORD unknown002b7c; -/* 0x2b80 */ DWORD unknown002b80; -/* 0x2b84 */ DWORD unknown002b84; -/* 0x2b88 */ DWORD unknown002b88; -/* 0x2b8c */ DWORD unknown002b8c; -/* 0x2b90 */ DWORD unknown002b90; -/* 0x2b94 */ DWORD unknown002b94; -/* 0x2b98 */ DWORD unknown002b98; -/* 0x2b9c */ DWORD unknown002b9c; -/* 0x2ba0 */ DWORD unknown002ba0; -/* 0x2ba4 */ DWORD unknown002ba4; -/* 0x2ba8 */ DWORD unknown002ba8; -/* 0x2bac */ DWORD unknown002bac; -/* 0x2bb0 */ DWORD unknown002bb0; -/* 0x2bb4 */ DWORD unknown002bb4; -/* 0x2bb8 */ DWORD unknown002bb8; -/* 0x2bbc */ DWORD unknown002bbc; -/* 0x2bc0 */ DWORD unknown002bc0; -/* 0x2bc4 */ DWORD unknown002bc4; -/* 0x2bc8 */ DWORD unknown002bc8; -/* 0x2bcc */ DWORD unknown002bcc; -/* 0x2bd0 */ DWORD unknown002bd0; -/* 0x2bd4 */ DWORD unknown002bd4; -/* 0x2bd8 */ DWORD unknown002bd8; -/* 0x2bdc */ DWORD unknown002bdc; -/* 0x2be0 */ DWORD unknown002be0; -/* 0x2be4 */ DWORD unknown002be4; -/* 0x2be8 */ DWORD unknown002be8; -/* 0x2bec */ DWORD unknown002bec; -/* 0x2bf0 */ DWORD unknown002bf0; -/* 0x2bf4 */ DWORD unknown002bf4; -/* 0x2bf8 */ DWORD unknown002bf8; -/* 0x2bfc */ DWORD unknown002bfc; - -/* 0x2c00 */ DWORD unknown002c00; -/* 0x2c04 */ DWORD unknown002c04; -/* 0x2c08 */ DWORD unknown002c08; -/* 0x2c0c */ DWORD unknown002c0c; -/* 0x2c10 */ DWORD unknown002c10; -/* 0x2c14 */ DWORD unknown002c14; -/* 0x2c18 */ DWORD unknown002c18; -/* 0x2c1c */ DWORD unknown002c1c; -/* 0x2c20 */ DWORD unknown002c20; -/* 0x2c24 */ DWORD unknown002c24; -/* 0x2c28 */ DWORD unknown002c28; -/* 0x2c2c */ DWORD unknown002c2c; -/* 0x2c30 */ DWORD unknown002c30; -/* 0x2c34 */ DWORD unknown002c34; -/* 0x2c38 */ DWORD unknown002c38; -/* 0x2c3c */ DWORD unknown002c3c; -/* 0x2c40 */ DWORD unknown002c40; -/* 0x2c44 */ DWORD unknown002c44; -/* 0x2c48 */ DWORD unknown002c48; -/* 0x2c4c */ DWORD unknown002c4c; -/* 0x2c50 */ DWORD unknown002c50; -/* 0x2c54 */ DWORD unknown002c54; -/* 0x2c58 */ DWORD unknown002c58; -/* 0x2c5c */ DWORD unknown002c5c; -/* 0x2c60 */ DWORD unknown002c60; -/* 0x2c64 */ DWORD unknown002c64; -/* 0x2c68 */ DWORD unknown002c68; -/* 0x2c6c */ DWORD unknown002c6c; -/* 0x2c70 */ DWORD unknown002c70; -/* 0x2c74 */ DWORD unknown002c74; -/* 0x2c78 */ DWORD unknown002c78; -/* 0x2c7c */ DWORD unknown002c7c; -/* 0x2c80 */ DWORD unknown002c80; -/* 0x2c84 */ DWORD unknown002c84; -/* 0x2c88 */ DWORD unknown002c88; -/* 0x2c8c */ DWORD unknown002c8c; -/* 0x2c90 */ DWORD unknown002c90; -/* 0x2c94 */ DWORD unknown002c94; -/* 0x2c98 */ DWORD unknown002c98; -/* 0x2c9c */ DWORD unknown002c9c; -/* 0x2ca0 */ DWORD unknown002ca0; -/* 0x2ca4 */ DWORD unknown002ca4; -/* 0x2ca8 */ DWORD unknown002ca8; -/* 0x2cac */ DWORD unknown002cac; -/* 0x2cb0 */ DWORD unknown002cb0; -/* 0x2cb4 */ DWORD unknown002cb4; -/* 0x2cb8 */ DWORD unknown002cb8; -/* 0x2cbc */ DWORD unknown002cbc; -/* 0x2cc0 */ DWORD unknown002cc0; -/* 0x2cc4 */ DWORD unknown002cc4; -/* 0x2cc8 */ DWORD unknown002cc8; -/* 0x2ccc */ DWORD unknown002ccc; -/* 0x2cd0 */ DWORD unknown002cd0; -/* 0x2cd4 */ DWORD unknown002cd4; -/* 0x2cd8 */ DWORD unknown002cd8; -/* 0x2cdc */ DWORD unknown002cdc; -/* 0x2ce0 */ DWORD unknown002ce0; -/* 0x2ce4 */ DWORD unknown002ce4; -/* 0x2ce8 */ DWORD unknown002ce8; -/* 0x2cec */ DWORD unknown002cec; -/* 0x2cf0 */ DWORD unknown002cf0; -/* 0x2cf4 */ DWORD unknown002cf4; -/* 0x2cf8 */ DWORD unknown002cf8; -/* 0x2cfc */ DWORD unknown002cfc; - -/* 0x2d00 */ DWORD unknown002d00; -/* 0x2d04 */ DWORD unknown002d04; -/* 0x2d08 */ DWORD unknown002d08; -/* 0x2d0c */ DWORD unknown002d0c; -/* 0x2d10 */ DWORD unknown002d10; -/* 0x2d14 */ DWORD unknown002d14; -/* 0x2d18 */ DWORD unknown002d18; -/* 0x2d1c */ DWORD unknown002d1c; -/* 0x2d20 */ DWORD unknown002d20; -/* 0x2d24 */ DWORD unknown002d24; -/* 0x2d28 */ DWORD unknown002d28; -/* 0x2d2c */ DWORD unknown002d2c; -/* 0x2d30 */ DWORD unknown002d30; -/* 0x2d34 */ DWORD unknown002d34; -/* 0x2d38 */ DWORD unknown002d38; -/* 0x2d3c */ DWORD unknown002d3c; -/* 0x2d40 */ DWORD unknown002d40; -/* 0x2d44 */ DWORD unknown002d44; -/* 0x2d48 */ DWORD unknown002d48; -/* 0x2d4c */ DWORD unknown002d4c; -/* 0x2d50 */ DWORD unknown002d50; -/* 0x2d54 */ DWORD unknown002d54; -/* 0x2d58 */ DWORD unknown002d58; -/* 0x2d5c */ DWORD unknown002d5c; -/* 0x2d60 */ DWORD unknown002d60; -/* 0x2d64 */ DWORD unknown002d64; -/* 0x2d68 */ DWORD unknown002d68; -/* 0x2d6c */ DWORD unknown002d6c; -/* 0x2d70 */ DWORD unknown002d70; -/* 0x2d74 */ DWORD unknown002d74; -/* 0x2d78 */ DWORD unknown002d78; -/* 0x2d7c */ DWORD unknown002d7c; -/* 0x2d80 */ DWORD unknown002d80; -/* 0x2d84 */ DWORD unknown002d84; -/* 0x2d88 */ DWORD unknown002d88; -/* 0x2d8c */ DWORD unknown002d8c; -/* 0x2d90 */ DWORD unknown002d90; -/* 0x2d94 */ DWORD unknown002d94; -/* 0x2d98 */ DWORD unknown002d98; -/* 0x2d9c */ DWORD unknown002d9c; -/* 0x2da0 */ DWORD unknown002da0; -/* 0x2da4 */ DWORD unknown002da4; -/* 0x2da8 */ DWORD unknown002da8; -/* 0x2dac */ DWORD unknown002dac; -/* 0x2db0 */ DWORD unknown002db0; -/* 0x2db4 */ DWORD unknown002db4; -/* 0x2db8 */ DWORD unknown002db8; -/* 0x2dbc */ DWORD unknown002dbc; -/* 0x2dc0 */ DWORD unknown002dc0; -/* 0x2dc4 */ DWORD unknown002dc4; -/* 0x2dc8 */ DWORD unknown002dc8; -/* 0x2dcc */ DWORD unknown002dcc; -/* 0x2dd0 */ DWORD unknown002dd0; -/* 0x2dd4 */ DWORD unknown002dd4; -/* 0x2dd8 */ DWORD unknown002dd8; -/* 0x2ddc */ DWORD unknown002ddc; -/* 0x2de0 */ DWORD unknown002de0; -/* 0x2de4 */ DWORD unknown002de4; -/* 0x2de8 */ DWORD unknown002de8; -/* 0x2dec */ DWORD unknown002dec; -/* 0x2df0 */ DWORD unknown002df0; -/* 0x2df4 */ DWORD unknown002df4; -/* 0x2df8 */ DWORD unknown002df8; -/* 0x2dfc */ DWORD unknown002dfc; - -/* 0x2e00 */ DWORD unknown002e00; -/* 0x2e04 */ DWORD unknown002e04; -/* 0x2e08 */ DWORD unknown002e08; -/* 0x2e0c */ DWORD unknown002e0c; -/* 0x2e10 */ DWORD unknown002e10; -/* 0x2e14 */ DWORD unknown002e14; -/* 0x2e18 */ DWORD unknown002e18; -/* 0x2e1c */ DWORD unknown002e1c; -/* 0x2e20 */ DWORD unknown002e20; -/* 0x2e24 */ DWORD unknown002e24; -/* 0x2e28 */ DWORD unknown002e28; -/* 0x2e2c */ DWORD unknown002e2c; -/* 0x2e30 */ DWORD unknown002e30; -/* 0x2e34 */ DWORD unknown002e34; -/* 0x2e38 */ DWORD unknown002e38; -/* 0x2e3c */ DWORD unknown002e3c; -/* 0x2e40 */ DWORD unknown002e40; -/* 0x2e44 */ DWORD unknown002e44; -/* 0x2e48 */ DWORD unknown002e48; -/* 0x2e4c */ DWORD unknown002e4c; -/* 0x2e50 */ DWORD unknown002e50; -/* 0x2e54 */ DWORD unknown002e54; -/* 0x2e58 */ DWORD unknown002e58; -/* 0x2e5c */ DWORD unknown002e5c; -/* 0x2e60 */ DWORD unknown002e60; -/* 0x2e64 */ DWORD unknown002e64; -/* 0x2e68 */ DWORD unknown002e68; -/* 0x2e6c */ DWORD unknown002e6c; -/* 0x2e70 */ DWORD unknown002e70; -/* 0x2e74 */ DWORD unknown002e74; -/* 0x2e78 */ DWORD unknown002e78; -/* 0x2e7c */ DWORD unknown002e7c; -/* 0x2e80 */ DWORD unknown002e80; -/* 0x2e84 */ DWORD unknown002e84; -/* 0x2e88 */ DWORD unknown002e88; -/* 0x2e8c */ DWORD unknown002e8c; -/* 0x2e90 */ DWORD unknown002e90; -/* 0x2e94 */ DWORD unknown002e94; -/* 0x2e98 */ DWORD unknown002e98; -/* 0x2e9c */ DWORD unknown002e9c; -/* 0x2ea0 */ DWORD unknown002ea0; -/* 0x2ea4 */ DWORD unknown002ea4; -/* 0x2ea8 */ DWORD unknown002ea8; -/* 0x2eac */ DWORD unknown002eac; -/* 0x2eb0 */ DWORD unknown002eb0; -/* 0x2eb4 */ DWORD unknown002eb4; -/* 0x2eb8 */ DWORD unknown002eb8; -/* 0x2ebc */ DWORD unknown002ebc; -/* 0x2ec0 */ DWORD unknown002ec0; -/* 0x2ec4 */ DWORD unknown002ec4; -/* 0x2ec8 */ DWORD unknown002ec8; -/* 0x2ecc */ DWORD unknown002ecc; -/* 0x2ed0 */ DWORD unknown002ed0; -/* 0x2ed4 */ DWORD unknown002ed4; -/* 0x2ed8 */ DWORD unknown002ed8; -/* 0x2edc */ DWORD unknown002edc; -/* 0x2ee0 */ DWORD unknown002ee0; -/* 0x2ee4 */ DWORD unknown002ee4; -/* 0x2ee8 */ DWORD unknown002ee8; -/* 0x2eec */ DWORD unknown002eec; -/* 0x2ef0 */ DWORD unknown002ef0; -/* 0x2ef4 */ DWORD unknown002ef4; -/* 0x2ef8 */ DWORD unknown002ef8; -/* 0x2efc */ DWORD unknown002efc; - -/* 0x2f00 */ DWORD unknown002f00; -/* 0x2f04 */ DWORD unknown002f04; -/* 0x2f08 */ DWORD unknown002f08; -/* 0x2f0c */ DWORD unknown002f0c; -/* 0x2f10 */ DWORD unknown002f10; -/* 0x2f14 */ DWORD unknown002f14; -/* 0x2f18 */ DWORD unknown002f18; -/* 0x2f1c */ DWORD unknown002f1c; -/* 0x2f20 */ DWORD unknown002f20; -/* 0x2f24 */ DWORD unknown002f24; -/* 0x2f28 */ DWORD unknown002f28; -/* 0x2f2c */ DWORD unknown002f2c; -/* 0x2f30 */ DWORD unknown002f30; -/* 0x2f34 */ DWORD unknown002f34; -/* 0x2f38 */ DWORD unknown002f38; -/* 0x2f3c */ DWORD unknown002f3c; -/* 0x2f40 */ DWORD unknown002f40; -/* 0x2f44 */ DWORD unknown002f44; -/* 0x2f48 */ DWORD unknown002f48; -/* 0x2f4c */ DWORD unknown002f4c; -/* 0x2f50 */ DWORD unknown002f50; -/* 0x2f54 */ DWORD unknown002f54; -/* 0x2f58 */ DWORD unknown002f58; -/* 0x2f5c */ DWORD unknown002f5c; -/* 0x2f60 */ DWORD unknown002f60; -/* 0x2f64 */ DWORD unknown002f64; -/* 0x2f68 */ DWORD unknown002f68; -/* 0x2f6c */ DWORD unknown002f6c; -/* 0x2f70 */ DWORD unknown002f70; -/* 0x2f74 */ DWORD unknown002f74; -/* 0x2f78 */ DWORD unknown002f78; -/* 0x2f7c */ DWORD unknown002f7c; -/* 0x2f80 */ DWORD unknown002f80; -/* 0x2f84 */ DWORD unknown002f84; -/* 0x2f88 */ DWORD unknown002f88; -/* 0x2f8c */ DWORD unknown002f8c; -/* 0x2f90 */ DWORD unknown002f90; -/* 0x2f94 */ DWORD unknown002f94; -/* 0x2f98 */ DWORD unknown002f98; -/* 0x2f9c */ DWORD unknown002f9c; -/* 0x2fa0 */ DWORD unknown002fa0; -/* 0x2fa4 */ DWORD unknown002fa4; -/* 0x2fa8 */ DWORD unknown002fa8; -/* 0x2fac */ DWORD unknown002fac; -/* 0x2fb0 */ DWORD unknown002fb0; -/* 0x2fb4 */ DWORD unknown002fb4; -/* 0x2fb8 */ DWORD unknown002fb8; -/* 0x2fbc */ DWORD unknown002fbc; -/* 0x2fc0 */ DWORD unknown002fc0; -/* 0x2fc4 */ DWORD unknown002fc4; -/* 0x2fc8 */ DWORD unknown002fc8; -/* 0x2fcc */ DWORD unknown002fcc; -/* 0x2fd0 */ DWORD unknown002fd0; -/* 0x2fd4 */ DWORD unknown002fd4; -/* 0x2fd8 */ DWORD unknown002fd8; -/* 0x2fdc */ DWORD unknown002fdc; -/* 0x2fe0 */ DWORD unknown002fe0; -/* 0x2fe4 */ DWORD unknown002fe4; -/* 0x2fe8 */ DWORD unknown002fe8; -/* 0x2fec */ DWORD unknown002fec; -/* 0x2ff0 */ DWORD unknown002ff0; -/* 0x2ff4 */ DWORD unknown002ff4; -/* 0x2ff8 */ DWORD unknown002ff8; -/* 0x2ffc */ DWORD unknown002ffc; - -/* 0x3000 */ DWORD unknown003000; -/* 0x3004 */ DWORD unknown003004; -/* 0x3008 */ DWORD unknown003008; -/* 0x300c */ DWORD unknown00300c; -/* 0x3010 */ DWORD unknown003010; -/* 0x3014 */ DWORD unknown003014; -/* 0x3018 */ DWORD unknown003018; -/* 0x301c */ DWORD unknown00301c; -/* 0x3020 */ DWORD unknown003020; -/* 0x3024 */ DWORD unknown003024; -/* 0x3028 */ DWORD unknown003028; -/* 0x302c */ DWORD unknown00302c; -/* 0x3030 */ DWORD unknown003030; -/* 0x3034 */ DWORD unknown003034; -/* 0x3038 */ DWORD unknown003038; -/* 0x303c */ DWORD unknown00303c; -/* 0x3040 */ DWORD unknown003040; -/* 0x3044 */ DWORD unknown003044; -/* 0x3048 */ DWORD unknown003048; -/* 0x304c */ DWORD unknown00304c; -/* 0x3050 */ DWORD unknown003050; -/* 0x3054 */ DWORD unknown003054; -/* 0x3058 */ DWORD unknown003058; -/* 0x305c */ DWORD unknown00305c; -/* 0x3060 */ DWORD unknown003060; -/* 0x3064 */ DWORD unknown003064; -/* 0x3068 */ DWORD unknown003068; -/* 0x306c */ DWORD unknown00306c; -/* 0x3070 */ DWORD unknown003070; -/* 0x3074 */ DWORD unknown003074; -/* 0x3078 */ DWORD unknown003078; -/* 0x307c */ DWORD unknown00307c; -/* 0x3080 */ DWORD unknown003080; -/* 0x3084 */ DWORD unknown003084; -/* 0x3088 */ DWORD unknown003088; -/* 0x308c */ DWORD unknown00308c; -/* 0x3090 */ DWORD unknown003090; -/* 0x3094 */ DWORD unknown003094; -/* 0x3098 */ DWORD unknown003098; -/* 0x309c */ DWORD unknown00309c; -/* 0x30a0 */ DWORD unknown0030a0; -/* 0x30a4 */ DWORD unknown0030a4; -/* 0x30a8 */ DWORD unknown0030a8; -/* 0x30ac */ DWORD unknown0030ac; -/* 0x30b0 */ DWORD unknown0030b0; -/* 0x30b4 */ DWORD unknown0030b4; -/* 0x30b8 */ DWORD unknown0030b8; -/* 0x30bc */ DWORD unknown0030bc; -/* 0x30c0 */ DWORD unknown0030c0; -/* 0x30c4 */ DWORD unknown0030c4; -/* 0x30c8 */ DWORD unknown0030c8; -/* 0x30cc */ DWORD unknown0030cc; -/* 0x30d0 */ DWORD unknown0030d0; -/* 0x30d4 */ DWORD unknown0030d4; -/* 0x30d8 */ DWORD unknown0030d8; -/* 0x30dc */ DWORD unknown0030dc; -/* 0x30e0 */ DWORD unknown0030e0; -/* 0x30e4 */ DWORD unknown0030e4; -/* 0x30e8 */ DWORD unknown0030e8; -/* 0x30ec */ DWORD unknown0030ec; -/* 0x30f0 */ DWORD unknown0030f0; -/* 0x30f4 */ DWORD unknown0030f4; -/* 0x30f8 */ DWORD unknown0030f8; -/* 0x30fc */ DWORD unknown0030fc; - -/* 0x3100 */ DWORD unknown003100; -/* 0x3104 */ DWORD unknown003104; -/* 0x3108 */ DWORD unknown003108; -/* 0x310c */ DWORD unknown00310c; -/* 0x3110 */ DWORD unknown003110; -/* 0x3114 */ DWORD unknown003114; -/* 0x3118 */ DWORD unknown003118; -/* 0x311c */ DWORD unknown00311c; -/* 0x3120 */ DWORD unknown003120; -/* 0x3124 */ DWORD unknown003124; -/* 0x3128 */ DWORD unknown003128; -/* 0x312c */ DWORD unknown00312c; -/* 0x3130 */ DWORD unknown003130; -/* 0x3134 */ DWORD unknown003134; -/* 0x3138 */ DWORD unknown003138; -/* 0x313c */ DWORD unknown00313c; -/* 0x3140 */ DWORD unknown003140; -/* 0x3144 */ DWORD unknown003144; -/* 0x3148 */ DWORD unknown003148; -/* 0x314c */ DWORD unknown00314c; -/* 0x3150 */ DWORD unknown003150; -/* 0x3154 */ DWORD unknown003154; -/* 0x3158 */ DWORD unknown003158; -/* 0x315c */ DWORD unknown00315c; -/* 0x3160 */ DWORD unknown003160; -/* 0x3164 */ DWORD unknown003164; -/* 0x3168 */ DWORD unknown003168; -/* 0x316c */ DWORD unknown00316c; -/* 0x3170 */ DWORD unknown003170; -/* 0x3174 */ DWORD unknown003174; -/* 0x3178 */ DWORD unknown003178; -/* 0x317c */ DWORD unknown00317c; -/* 0x3180 */ DWORD unknown003180; -/* 0x3184 */ DWORD unknown003184; -/* 0x3188 */ DWORD unknown003188; -/* 0x318c */ DWORD unknown00318c; -/* 0x3190 */ DWORD unknown003190; -/* 0x3194 */ DWORD unknown003194; -/* 0x3198 */ DWORD unknown003198; -/* 0x319c */ DWORD unknown00319c; -/* 0x31a0 */ DWORD unknown0031a0; -/* 0x31a4 */ DWORD unknown0031a4; -/* 0x31a8 */ DWORD unknown0031a8; -/* 0x31ac */ DWORD unknown0031ac; -/* 0x31b0 */ DWORD unknown0031b0; -/* 0x31b4 */ DWORD unknown0031b4; -/* 0x31b8 */ DWORD unknown0031b8; -/* 0x31bc */ DWORD unknown0031bc; -/* 0x31c0 */ DWORD unknown0031c0; -/* 0x31c4 */ DWORD unknown0031c4; -/* 0x31c8 */ DWORD unknown0031c8; -/* 0x31cc */ DWORD unknown0031cc; -/* 0x31d0 */ DWORD unknown0031d0; -/* 0x31d4 */ DWORD unknown0031d4; -/* 0x31d8 */ DWORD unknown0031d8; -/* 0x31dc */ DWORD unknown0031dc; -/* 0x31e0 */ DWORD unknown0031e0; -/* 0x31e4 */ DWORD unknown0031e4; -/* 0x31e8 */ DWORD unknown0031e8; -/* 0x31ec */ DWORD unknown0031ec; -/* 0x31f0 */ DWORD unknown0031f0; -/* 0x31f4 */ DWORD unknown0031f4; -/* 0x31f8 */ DWORD unknown0031f8; -/* 0x31fc */ DWORD unknown0031fc; - -/* 0x3200 */ DWORD unknown003200; -/* 0x3204 */ DWORD unknown003204; -/* 0x3208 */ DWORD unknown003208; -/* 0x320c */ DWORD unknown00320c; -/* 0x3210 */ DWORD unknown003210; -/* 0x3214 */ DWORD unknown003214; -/* 0x3218 */ DWORD unknown003218; -/* 0x321c */ DWORD unknown00321c; -/* 0x3220 */ DWORD unknown003220; -/* 0x3224 */ DWORD unknown003224; -/* 0x3228 */ DWORD unknown003228; -/* 0x322c */ DWORD unknown00322c; -/* 0x3230 */ DWORD unknown003230; -/* 0x3234 */ DWORD unknown003234; -/* 0x3238 */ DWORD unknown003238; -/* 0x323c */ DWORD unknown00323c; -/* 0x3240 */ DWORD unknown003240; -/* 0x3244 */ DWORD unknown003244; -/* 0x3248 */ DWORD unknown003248; -/* 0x324c */ DWORD unknown00324c; -/* 0x3250 */ DWORD unknown003250; -/* 0x3254 */ DWORD unknown003254; -/* 0x3258 */ DWORD unknown003258; -/* 0x325c */ DWORD unknown00325c; -/* 0x3260 */ DWORD unknown003260; -/* 0x3264 */ DWORD unknown003264; -/* 0x3268 */ DWORD unknown003268; -/* 0x326c */ DWORD unknown00326c; -/* 0x3270 */ DWORD unknown003270; -/* 0x3274 */ DWORD unknown003274; -/* 0x3278 */ DWORD unknown003278; -/* 0x327c */ DWORD unknown00327c; -/* 0x3280 */ DWORD unknown003280; -/* 0x3284 */ DWORD unknown003284; -/* 0x3288 */ DWORD unknown003288; -/* 0x328c */ DWORD unknown00328c; -/* 0x3290 */ DWORD unknown003290; -/* 0x3294 */ DWORD unknown003294; -/* 0x3298 */ DWORD unknown003298; -/* 0x329c */ DWORD unknown00329c; -/* 0x32a0 */ DWORD unknown0032a0; -/* 0x32a4 */ DWORD unknown0032a4; -/* 0x32a8 */ DWORD unknown0032a8; -/* 0x32ac */ DWORD unknown0032ac; -/* 0x32b0 */ DWORD unknown0032b0; -/* 0x32b4 */ DWORD unknown0032b4; -/* 0x32b8 */ DWORD unknown0032b8; -/* 0x32bc */ DWORD unknown0032bc; -/* 0x32c0 */ DWORD unknown0032c0; -/* 0x32c4 */ DWORD unknown0032c4; -/* 0x32c8 */ DWORD unknown0032c8; -/* 0x32cc */ DWORD unknown0032cc; -/* 0x32d0 */ DWORD unknown0032d0; -/* 0x32d4 */ DWORD unknown0032d4; -/* 0x32d8 */ DWORD unknown0032d8; -/* 0x32dc */ DWORD unknown0032dc; -/* 0x32e0 */ DWORD unknown0032e0; -/* 0x32e4 */ DWORD unknown0032e4; -/* 0x32e8 */ DWORD unknown0032e8; -/* 0x32ec */ DWORD unknown0032ec; -/* 0x32f0 */ DWORD unknown0032f0; -/* 0x32f4 */ DWORD unknown0032f4; -/* 0x32f8 */ DWORD unknown0032f8; -/* 0x32fc */ DWORD unknown0032fc; - -/* 0x3300 */ DWORD unknown003300; -/* 0x3304 */ DWORD unknown003304; -/* 0x3308 */ DWORD unknown003308; -/* 0x330c */ DWORD unknown00330c; -/* 0x3310 */ DWORD unknown003310; -/* 0x3314 */ DWORD unknown003314; -/* 0x3318 */ DWORD unknown003318; -/* 0x331c */ DWORD unknown00331c; -/* 0x3320 */ DWORD unknown003320; -/* 0x3324 */ DWORD unknown003324; -/* 0x3328 */ DWORD unknown003328; -/* 0x332c */ DWORD unknown00332c; -} D3D9HALDEVICE, FAR *LPD3D9HALDEVICE; +/* IDirect3DDevice9 private interface */ +VOID WINAPI IDirect3DDevice9Base_Destroy(LPDIRECT3DDEVICE9 iface); +VOID WINAPI IDirect3DDevice9Base_VirtualDestructor(LPDIRECT3DDEVICE9 iface); #endif /* _D3D9_DEVICE_H_ */ diff --git a/reactos/dll/directx/d3d9/d3d9_haldevice.c b/reactos/dll/directx/d3d9/d3d9_haldevice.c new file mode 100644 index 00000000000..781573cd8a0 --- /dev/null +++ b/reactos/dll/directx/d3d9/d3d9_haldevice.c @@ -0,0 +1,596 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS ReactX + * FILE: dll/directx/d3d9/d3d9_haldevice.c + * PURPOSE: d3d9.dll internal HAL device functions + * PROGRAMERS: Gregor Gullwi + */ +#include "d3d9_haldevice.h" +#include + +#define LOCK_D3DDEVICE9() if (This->bLockDevice) EnterCriticalSection(&This->CriticalSection); +#define UNLOCK_D3DDEVICE9() if (This->bLockDevice) LeaveCriticalSection(&This->CriticalSection); + +/* Convert a IDirect3D9 pointer safely to the internal implementation struct */ +/*static LPD3D9HALDEVICE IDirect3DDevice9ToImpl(LPDIRECT3DDEVICE9 iface) +{ + if (NULL == iface) + return NULL; + + return (LPD3D9HALDEVICE)((ULONG_PTR)iface - FIELD_OFFSET(D3D9HALDEVICE, PureDevice.BaseDevice.lpVtbl)); +}*/ + +/* IDirect3DDevice9 public interface */ +HRESULT WINAPI IDirect3DDevice9HAL_GetTransform(LPDIRECT3DDEVICE9 iface, D3DTRANSFORMSTATETYPE State, D3DMATRIX* pMatrix) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_GetMaterial(LPDIRECT3DDEVICE9 iface, D3DMATERIAL9* pMaterial) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_GetLight(LPDIRECT3DDEVICE9 iface, DWORD Index, D3DLIGHT9* pLight) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_GetLightEnable(LPDIRECT3DDEVICE9 iface, DWORD Index, BOOL* pEnable) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_GetClipPlane(LPDIRECT3DDEVICE9 iface, DWORD Index, float* pPlane) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_SetRenderState(LPDIRECT3DDEVICE9 iface, D3DRENDERSTATETYPE State, DWORD Value) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_GetRenderState(LPDIRECT3DDEVICE9 iface, D3DRENDERSTATETYPE State, DWORD* pValue) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_SetClipStatus(LPDIRECT3DDEVICE9 iface, CONST D3DCLIPSTATUS9* pClipStatus) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_GetClipStatus(LPDIRECT3DDEVICE9 iface, D3DCLIPSTATUS9* pClipStatus) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_GetTextureStageState(LPDIRECT3DDEVICE9 iface, DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_GetSamplerState(LPDIRECT3DDEVICE9 iface, DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD* pValue) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_ValidateDevice(LPDIRECT3DDEVICE9 iface, DWORD* pNumPasses) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_SetSoftwareVertexProcessing(LPDIRECT3DDEVICE9 iface, BOOL bSoftware) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +BOOL WINAPI IDirect3DDevice9HAL_GetSoftwareVertexProcessing(LPDIRECT3DDEVICE9 iface) +{ + UNIMPLEMENTED + + return TRUE; +} + +HRESULT WINAPI IDirect3DDevice9HAL_ProcessVertices(LPDIRECT3DDEVICE9 iface, UINT SrcStartIndex, UINT DestIndex, UINT VertexCount, IDirect3DVertexBuffer9* pDestBuffer, IDirect3DVertexDeclaration9* pVertexDecl, DWORD Flags) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_GetVertexShader(LPDIRECT3DDEVICE9 iface, IDirect3DVertexShader9** ppShader) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_GetPixelShader(LPDIRECT3DDEVICE9 iface, IDirect3DPixelShader9** ppShader) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_GetPixelShaderConstantF(LPDIRECT3DDEVICE9 iface, UINT StartRegister, float* pConstantData, UINT Vector4fCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_GetPixelShaderConstantI(LPDIRECT3DDEVICE9 iface, UINT StartRegister, int* pConstantData, UINT Vector4iCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_GetPixelShaderConstantB(LPDIRECT3DDEVICE9 iface, UINT StartRegister, BOOL* pConstantData, UINT BoolCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +/* IDirect3DDevice9 private interface */ +HRESULT WINAPI IDirect3DDevice9HAL_SetRenderStateWorker(LPDIRECT3DDEVICE9 iface, D3DRENDERSTATETYPE State, DWORD Value) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_SetTextureStageStateInt(LPDIRECT3DDEVICE9 iface, DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_SetSamplerStateInt(LPDIRECT3DDEVICE9 iface, DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_SetMaterialInt(LPDIRECT3DDEVICE9 iface, CONST D3DMATERIAL9* pMaterial) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_SetVertexShaderInt(LPDIRECT3DDEVICE9 iface, IDirect3DVertexShader9* pShader) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_SetVertexShaderConstantFInt(LPDIRECT3DDEVICE9 iface, UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_SetVertexShaderConstantIInt(LPDIRECT3DDEVICE9 iface, UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_SetVertexShaderConstantBInt(LPDIRECT3DDEVICE9 iface, UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_SetPixelShaderInt(LPDIRECT3DDEVICE9 iface, IDirect3DPixelShader9* pShader) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_SetPixelShaderConstantFInt(LPDIRECT3DDEVICE9 iface, UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_SetPixelShaderConstantIInt(LPDIRECT3DDEVICE9 iface, UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_SetPixelShaderConstantBInt(LPDIRECT3DDEVICE9 iface, UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_SetFVFInt(LPDIRECT3DDEVICE9 iface, DWORD FVF) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_SetTextureInt(LPDIRECT3DDEVICE9 iface, DWORD Stage,IDirect3DBaseTexture9* pTexture) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_SetIndicesInt(LPDIRECT3DDEVICE9 iface, IDirect3DIndexBuffer9* pIndexData) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_SetStreamSourceInt(LPDIRECT3DDEVICE9 iface, UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_SetStreamSourceFreqInt(LPDIRECT3DDEVICE9 iface, UINT StreamNumber,UINT Setting) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +VOID WINAPI IDirect3DDevice9HAL_UpdateRenderState(LPDIRECT3DDEVICE9 iface, DWORD Unknown1, DWORD Unknown2) +{ + UNIMPLEMENTED +} + +HRESULT WINAPI IDirect3DDevice9HAL_SetTransformInt(LPDIRECT3DDEVICE9 iface, D3DTRANSFORMSTATETYPE State,CONST D3DMATRIX* pMatrix) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_MultiplyTransformInt(LPDIRECT3DDEVICE9 iface, D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_SetClipPlaneInt(LPDIRECT3DDEVICE9 iface, DWORD Index, CONST float* pPlane) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +VOID WINAPI IDirect3DDevice9HAL_UpdateDriverState(LPDIRECT3DDEVICE9 iface) +{ + UNIMPLEMENTED +} + +HRESULT WINAPI IDirect3DDevice9HAL_SetViewportInt(LPDIRECT3DDEVICE9 iface, CONST D3DVIEWPORT9* pViewport) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +VOID WINAPI IDirect3DDevice9HAL_SetStreamSourceWorker(LPDIRECT3DDEVICE9 iface, LPVOID UnknownStreamData) +{ + UNIMPLEMENTED +} + +HRESULT WINAPI IDirect3DDevice9HAL_SetPixelShaderConstantFWorker(LPDIRECT3DDEVICE9 iface, UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_SetPixelShaderConstantIWorker(LPDIRECT3DDEVICE9 iface, UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_SetPixelShaderConstantBWorker(LPDIRECT3DDEVICE9 iface, UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +VOID WINAPI IDirect3DDevice9HAL_DrawPrimitiveWorker(LPDIRECT3DDEVICE9 iface, D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount) +{ + UNIMPLEMENTED +} + +HRESULT WINAPI IDirect3DDevice9HAL_SetLightInt(LPDIRECT3DDEVICE9 iface, DWORD Index, CONST D3DLIGHT9* pLight) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_LightEnableInt(LPDIRECT3DDEVICE9 iface, DWORD Index, BOOL Enable) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_SetRenderStateInt(LPDIRECT3DDEVICE9 iface, D3DRENDERSTATETYPE State, DWORD Value) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_DrawPrimitiveUPInt(LPDIRECT3DDEVICE9 iface, D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_ClearInt(LPDIRECT3DDEVICE9 iface, DWORD Count, CONST D3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +VOID WINAPI IDirect3DDevice9HAL_DrawPrimitivesWorker(LPDIRECT3DDEVICE9 iface) +{ + UNIMPLEMENTED +} + +VOID WINAPI IDirect3DDevice9HAL_UpdateVertexShader(LPDIRECT3DDEVICE9 iface) +{ + UNIMPLEMENTED +} + +HRESULT WINAPI IDirect3DDevice9HAL_ValidateDrawCall(LPDIRECT3DDEVICE9 iface, D3DPRIMITIVETYPE PrimitiveType, UINT Unknown1, UINT Unknown2, UINT Unknown3, INT Unknown4, UINT Unknown5, INT Unknown6) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9HAL_Init(LPDIRECT3DDEVICE9 iface) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +VOID WINAPI IDirect3DDevice9HAL_InitState(LPDIRECT3DDEVICE9 iface, INT State) +{ + UNIMPLEMENTED +} + +VOID WINAPI IDirect3DDevice9HAL_Destroy(LPDIRECT3DDEVICE9 iface) +{ + UNIMPLEMENTED +} + +VOID WINAPI IDirect3DDevice9HAL_VirtualDestructor(LPDIRECT3DDEVICE9 iface) +{ + UNIMPLEMENTED +} + +IDirect3DDevice9Vtbl_INT Direct3DDevice9HAL_Vtbl = +{ + { + /* IUnknown */ + IDirect3DDevice9Base_QueryInterface, + IDirect3DDevice9Base_AddRef, + IDirect3DDevice9Base_Release, + + /* IDirect3DDevice9 public */ + IDirect3DDevice9Base_TestCooperativeLevel, + IDirect3DDevice9Base_GetAvailableTextureMem, + IDirect3DDevice9Base_EvictManagedResources, + IDirect3DDevice9Base_GetDirect3D, + IDirect3DDevice9Base_GetDeviceCaps, + IDirect3DDevice9Base_GetDisplayMode, + IDirect3DDevice9Base_GetCreationParameters, + IDirect3DDevice9Base_SetCursorProperties, + IDirect3DDevice9Base_SetCursorPosition, + IDirect3DDevice9Base_ShowCursor, + IDirect3DDevice9Base_CreateAdditionalSwapChain, + IDirect3DDevice9Base_GetSwapChain, + IDirect3DDevice9Base_GetNumberOfSwapChains, + IDirect3DDevice9Base_Reset, + IDirect3DDevice9Base_Present, + IDirect3DDevice9Base_GetBackBuffer, + IDirect3DDevice9Base_GetRasterStatus, + IDirect3DDevice9Base_SetDialogBoxMode, + IDirect3DDevice9Base_SetGammaRamp, + IDirect3DDevice9Base_GetGammaRamp, + IDirect3DDevice9Base_CreateTexture, + IDirect3DDevice9Base_CreateVolumeTexture, + IDirect3DDevice9Base_CreateCubeTexture, + IDirect3DDevice9Base_CreateVertexBuffer, + IDirect3DDevice9Base_CreateIndexBuffer, + IDirect3DDevice9Base_CreateRenderTarget, + IDirect3DDevice9Base_CreateDepthStencilSurface, + IDirect3DDevice9Base_UpdateSurface, + IDirect3DDevice9Base_UpdateTexture, + IDirect3DDevice9Base_GetRenderTargetData, + IDirect3DDevice9Base_GetFrontBufferData, + IDirect3DDevice9Base_StretchRect, + IDirect3DDevice9Base_ColorFill, + IDirect3DDevice9Base_CreateOffscreenPlainSurface, + IDirect3DDevice9Pure_SetRenderTarget, + IDirect3DDevice9Pure_GetRenderTarget, + IDirect3DDevice9Pure_SetDepthStencilSurface, + IDirect3DDevice9Pure_GetDepthStencilSurface, + IDirect3DDevice9Pure_BeginScene, + IDirect3DDevice9Pure_EndScene, + IDirect3DDevice9Pure_Clear, + IDirect3DDevice9Pure_SetTransform, + IDirect3DDevice9HAL_GetTransform, + IDirect3DDevice9Pure_MultiplyTransform, + IDirect3DDevice9Pure_SetViewport, + IDirect3DDevice9Pure_GetViewport, + IDirect3DDevice9Pure_SetMaterial, + IDirect3DDevice9HAL_GetMaterial, + IDirect3DDevice9Pure_SetLight, + IDirect3DDevice9HAL_GetLight, + IDirect3DDevice9Pure_LightEnable, + IDirect3DDevice9HAL_GetLightEnable, + IDirect3DDevice9Pure_SetClipPlane, + IDirect3DDevice9HAL_GetClipPlane, + IDirect3DDevice9HAL_SetRenderState, + IDirect3DDevice9HAL_GetRenderState, + IDirect3DDevice9Pure_CreateStateBlock, + IDirect3DDevice9Pure_BeginStateBlock, + IDirect3DDevice9Pure_EndStateBlock, + IDirect3DDevice9HAL_SetClipStatus, + IDirect3DDevice9HAL_GetClipStatus, + IDirect3DDevice9Pure_GetTexture, + IDirect3DDevice9Pure_SetTexture, + IDirect3DDevice9HAL_GetTextureStageState, + IDirect3DDevice9Pure_SetTextureStageState, + IDirect3DDevice9HAL_GetSamplerState, + IDirect3DDevice9Pure_SetSamplerState, + IDirect3DDevice9HAL_ValidateDevice, + IDirect3DDevice9Pure_SetPaletteEntries, + IDirect3DDevice9Pure_GetPaletteEntries, + IDirect3DDevice9Pure_SetCurrentTexturePalette, + IDirect3DDevice9Pure_GetCurrentTexturePalette, + IDirect3DDevice9Pure_SetScissorRect, + IDirect3DDevice9Pure_GetScissorRect, + IDirect3DDevice9HAL_SetSoftwareVertexProcessing, + IDirect3DDevice9HAL_GetSoftwareVertexProcessing, + IDirect3DDevice9Pure_SetNPatchMode, + IDirect3DDevice9Pure_GetNPatchMode, + IDirect3DDevice9Pure_DrawPrimitive, + IDirect3DDevice9Pure_DrawIndexedPrimitive, + IDirect3DDevice9Pure_DrawPrimitiveUP, + IDirect3DDevice9Pure_DrawIndexedPrimitiveUP, + IDirect3DDevice9HAL_ProcessVertices, + IDirect3DDevice9Pure_CreateVertexDeclaration, + IDirect3DDevice9Pure_SetVertexDeclaration, + IDirect3DDevice9Pure_GetVertexDeclaration, + IDirect3DDevice9Pure_SetFVF, + IDirect3DDevice9Pure_GetFVF, + IDirect3DDevice9Pure_CreateVertexShader, + IDirect3DDevice9Pure_SetVertexShader, + IDirect3DDevice9HAL_GetVertexShader, + IDirect3DDevice9Pure_SetVertexShaderConstantF, + IDirect3DDevice9Pure_GetVertexShaderConstantF, + IDirect3DDevice9Pure_SetVertexShaderConstantI, + IDirect3DDevice9Pure_GetVertexShaderConstantI, + IDirect3DDevice9Pure_SetVertexShaderConstantB, + IDirect3DDevice9Pure_GetVertexShaderConstantB, + IDirect3DDevice9Pure_SetStreamSource, + IDirect3DDevice9Pure_GetStreamSource, + IDirect3DDevice9Pure_SetStreamSourceFreq, + IDirect3DDevice9Pure_GetStreamSourceFreq, + IDirect3DDevice9Pure_SetIndices, + IDirect3DDevice9Pure_GetIndices, + IDirect3DDevice9Pure_CreatePixelShader, + IDirect3DDevice9Pure_SetPixelShader, + IDirect3DDevice9HAL_GetPixelShader, + IDirect3DDevice9Pure_SetPixelShaderConstantF, + IDirect3DDevice9HAL_GetPixelShaderConstantF, + IDirect3DDevice9Pure_SetPixelShaderConstantI, + IDirect3DDevice9HAL_GetPixelShaderConstantI, + IDirect3DDevice9Pure_SetPixelShaderConstantB, + IDirect3DDevice9HAL_GetPixelShaderConstantB, + IDirect3DDevice9Pure_DrawRectPatch, + IDirect3DDevice9Pure_DrawTriPatch, + IDirect3DDevice9Pure_DeletePatch, + IDirect3DDevice9Pure_CreateQuery, + }, + + /* IDirect3DDevice9 private */ + IDirect3DDevice9HAL_SetRenderStateWorker, + IDirect3DDevice9HAL_SetTextureStageStateInt, + IDirect3DDevice9HAL_SetSamplerStateInt, + IDirect3DDevice9HAL_SetMaterialInt, + IDirect3DDevice9HAL_SetVertexShaderInt, + IDirect3DDevice9HAL_SetVertexShaderConstantFInt, + IDirect3DDevice9HAL_SetVertexShaderConstantIInt, + IDirect3DDevice9HAL_SetVertexShaderConstantBInt, + IDirect3DDevice9HAL_SetPixelShaderInt, + IDirect3DDevice9HAL_SetPixelShaderConstantFInt, + IDirect3DDevice9HAL_SetPixelShaderConstantIInt, + IDirect3DDevice9HAL_SetPixelShaderConstantBInt, + IDirect3DDevice9HAL_SetFVFInt, + IDirect3DDevice9HAL_SetTextureInt, + IDirect3DDevice9HAL_SetIndicesInt, + IDirect3DDevice9HAL_SetStreamSourceInt, + IDirect3DDevice9HAL_SetStreamSourceFreqInt, + IDirect3DDevice9HAL_UpdateRenderState, + IDirect3DDevice9HAL_SetTransformInt, + IDirect3DDevice9HAL_MultiplyTransformInt, + IDirect3DDevice9HAL_SetClipPlaneInt, + IDirect3DDevice9HAL_UpdateDriverState, + IDirect3DDevice9HAL_SetViewportInt, + IDirect3DDevice9HAL_SetStreamSourceWorker, + IDirect3DDevice9HAL_SetPixelShaderConstantFWorker, + IDirect3DDevice9HAL_SetPixelShaderConstantIWorker, + IDirect3DDevice9HAL_SetPixelShaderConstantBWorker, + IDirect3DDevice9HAL_DrawPrimitiveWorker, + IDirect3DDevice9HAL_SetLightInt, + IDirect3DDevice9HAL_LightEnableInt, + IDirect3DDevice9HAL_SetRenderStateInt, + IDirect3DDevice9HAL_DrawPrimitiveUPInt, + IDirect3DDevice9HAL_ClearInt, + IDirect3DDevice9HAL_DrawPrimitivesWorker, + IDirect3DDevice9HAL_UpdateVertexShader, + IDirect3DDevice9HAL_ValidateDrawCall, + IDirect3DDevice9HAL_Init, + IDirect3DDevice9HAL_InitState, + IDirect3DDevice9HAL_Destroy, + IDirect3DDevice9HAL_VirtualDestructor, +}; + diff --git a/reactos/dll/directx/d3d9/d3d9_haldevice.h b/reactos/dll/directx/d3d9/d3d9_haldevice.h new file mode 100644 index 00000000000..42e73d990a3 --- /dev/null +++ b/reactos/dll/directx/d3d9/d3d9_haldevice.h @@ -0,0 +1,1010 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS ReactX + * FILE: dll/directx/d3d9/d3d9_haldevice.h + * PURPOSE: d3d9.dll internal HAL device structures + * PROGRAMERS: Gregor Gullwi + */ +#ifndef _D3D9_HALDEVICE_H_ +#define _D3D9_HALDEVICE_H_ + +#include "d3d9_puredevice.h" + +#if !defined(__cplusplus) || defined(CINTERFACE) +extern IDirect3DDevice9Vtbl_INT Direct3DDevice9HAL_Vtbl; +#endif + +typedef struct _D3D9HALDEVICE +{ +/* 0x0000 */ D3D9PUREDEVICE PureDevice; +#ifdef D3D_DEBUG_INFO +/* N/A - 0x0004 */ DWORD dbg0004; +/* N/A - 0x0008 */ DWORD dbg0008; +/* N/A - 0x000c */ DWORD dbg000c; +/* N/A - 0x0010 */ DWORD dbg0010; +/* N/A - 0x0014 */ DWORD dbg0014; +/* N/A - 0x0018 */ DWORD dbg0018; +/* N/A - 0x001c */ DWORD dbg001c; +/* N/A - 0x0020 */ DWORD dbg0020; +/* N/A - 0x0024 */ DWORD dbg0024; +/* N/A - 0x0028 */ DWORD dbg0028; +/* N/A - 0x002c */ DWORD dbg002c; +/* N/A - 0x0030 */ DWORD dbg0030; +/* N/A - 0x0034 */ DWORD dbg0034; +/* N/A - 0x0038 */ DWORD dbg0038; +#endif +/* 0x2438 */ DWORD unknown002438; +/* 0x243c */ DWORD unknown00243c; +/* 0x2440 */ DWORD unknown002440; +/* 0x2444 */ DWORD unknown002444; +/* 0x2448 */ DWORD unknown002448; +/* 0x244c */ DWORD unknown00244c; +/* 0x2450 */ DWORD unknown002450; +/* 0x2454 */ DWORD unknown002454; +/* 0x2458 */ DWORD unknown002458; +/* 0x245c */ DWORD unknown00245c; +/* 0x2460 */ DWORD unknown002460; +/* 0x2464 */ DWORD unknown002464; +/* 0x2468 */ DWORD unknown002468; +/* 0x246c */ DWORD unknown00246c; +/* 0x2470 */ DWORD unknown002470; +/* 0x2474 */ DWORD unknown002474; +/* 0x2478 */ DWORD unknown002478; +/* 0x247c */ DWORD unknown00247c; +/* 0x2480 */ DWORD unknown002480; +/* 0x2484 */ DWORD unknown002484; +/* 0x2488 */ DWORD unknown002488; +/* 0x248c */ DWORD unknown00248c; +/* 0x2490 */ DWORD unknown002490; +/* 0x2494 */ DWORD unknown002494; +/* 0x2498 */ DWORD unknown002498; +/* 0x249c */ DWORD unknown00249c; +/* 0x24a0 */ DWORD unknown0024a0; +/* 0x24a4 */ DWORD unknown0024a4; +/* 0x24a8 */ DWORD unknown0024a8; +/* 0x24ac */ DWORD unknown0024ac; +/* 0x24b0 */ DWORD unknown0024b0; +/* 0x24b4 */ DWORD unknown0024b4; +/* 0x24b8 */ DWORD unknown0024b8; +/* 0x24bc */ DWORD unknown0024bc; +/* 0x24c0 */ DWORD unknown0024c0; +/* 0x24c4 */ DWORD unknown0024c4; +/* 0x24c8 */ DWORD unknown0024c8; +/* 0x24cc */ DWORD unknown0024cc; +/* 0x24d0 */ DWORD unknown0024d0; +/* 0x24d4 */ DWORD unknown0024d4; +/* 0x24d8 */ DWORD unknown0024d8; +/* 0x24dc */ DWORD unknown0024dc; +/* 0x24e0 */ DWORD unknown0024e0; +/* 0x24e4 */ DWORD unknown0024e4; +/* 0x24e8 */ DWORD unknown0024e8; +/* 0x24ec */ DWORD unknown0024ec; +/* 0x24f0 */ DWORD unknown0024f0; +/* 0x24f4 */ DWORD unknown0024f4; +/* 0x24f8 */ DWORD unknown0024f8; +/* 0x24fc */ DWORD unknown0024fc; +/* 0x2500 */ DWORD unknown002500; +/* 0x2504 */ DWORD unknown002504; +/* 0x2508 */ DWORD unknown002508; +/* 0x250c */ DWORD unknown00250c; +/* 0x2510 */ DWORD unknown002510; +/* 0x2514 */ DWORD unknown002514; +/* 0x2518 */ DWORD unknown002518; +/* 0x251c */ DWORD unknown00251c; +/* 0x2520 */ DWORD unknown002520; +/* 0x2524 */ DWORD unknown002524; +/* 0x2528 */ DWORD unknown002528; +/* 0x252c */ DWORD unknown00252c; +/* 0x2530 */ DWORD unknown002530; +/* 0x2534 */ DWORD unknown002534; +/* 0x2538 */ DWORD unknown002538; +/* 0x253c */ DWORD unknown00253c; +/* 0x2540 */ DWORD unknown002540; +/* 0x2544 */ DWORD unknown002544; +/* 0x2548 */ DWORD unknown002548; +/* 0x254c */ DWORD unknown00254c; +/* 0x2550 */ DWORD unknown002550; +/* 0x2554 */ DWORD unknown002554; +/* 0x2558 */ DWORD unknown002558; +/* 0x255c */ DWORD unknown00255c; +/* 0x2560 */ DWORD unknown002560; +/* 0x2564 */ DWORD unknown002564; +/* 0x2568 */ DWORD unknown002568; +/* 0x256c */ DWORD unknown00256c; +/* 0x2570 */ DWORD unknown002570; +/* 0x2574 */ DWORD unknown002574; +/* 0x2578 */ DWORD unknown002578; +/* 0x257c */ DWORD unknown00257c; +/* 0x2580 */ DWORD unknown002580; +/* 0x2584 */ DWORD unknown002584; +/* 0x2588 */ DWORD unknown002588; +/* 0x258c */ DWORD unknown00258c; +/* 0x2590 */ DWORD unknown002590; +/* 0x2594 */ DWORD unknown002594; +/* 0x2598 */ DWORD unknown002598; +/* 0x259c */ DWORD unknown00259c; +/* 0x25a0 */ DWORD unknown0025a0; +/* 0x25a4 */ DWORD unknown0025a4; +/* 0x25a8 */ DWORD unknown0025a8; +/* 0x25ac */ DWORD unknown0025ac; +/* 0x25b0 */ DWORD unknown0025b0; +/* 0x25b4 */ DWORD unknown0025b4; +/* 0x25b8 */ DWORD unknown0025b8; +/* 0x25bc */ DWORD unknown0025bc; +/* 0x25c0 */ DWORD unknown0025c0; +/* 0x25c4 */ DWORD unknown0025c4; +/* 0x25c8 */ DWORD unknown0025c8; +/* 0x25cc */ DWORD unknown0025cc; +/* 0x25d0 */ DWORD unknown0025d0; +/* 0x25d4 */ DWORD unknown0025d4; +/* 0x25d8 */ DWORD unknown0025d8; +/* 0x25dc */ DWORD unknown0025dc; +/* 0x25e0 */ DWORD unknown0025e0; +/* 0x25e4 */ DWORD unknown0025e4; +/* 0x25e8 */ DWORD unknown0025e8; +/* 0x25ec */ DWORD unknown0025ec; +/* 0x25f0 */ DWORD unknown0025f0; +/* 0x25f4 */ DWORD unknown0025f4; +/* 0x25f8 */ DWORD unknown0025f8; +/* 0x25fc */ DWORD unknown0025fc; + +/* 0x2600 */ DWORD unknown002600; +/* 0x2604 */ DWORD unknown002604; +/* 0x2608 */ DWORD unknown002608; +/* 0x260c */ DWORD unknown00260c; +/* 0x2610 */ DWORD unknown002610; +/* 0x2614 */ DWORD unknown002614; +/* 0x2618 */ DWORD unknown002618; +/* 0x261c */ DWORD unknown00261c; +/* 0x2620 */ DWORD unknown002620; +/* 0x2624 */ DWORD unknown002624; +/* 0x2628 */ DWORD unknown002628; +/* 0x262c */ DWORD unknown00262c; +/* 0x2630 */ DWORD unknown002630; +/* 0x2634 */ DWORD unknown002634; +/* 0x2638 */ DWORD unknown002638; +/* 0x263c */ DWORD unknown00263c; +/* 0x2640 */ DWORD unknown002640; +/* 0x2644 */ DWORD unknown002644; +/* 0x2648 */ DWORD unknown002648; +/* 0x264c */ DWORD unknown00264c; +/* 0x2650 */ DWORD unknown002650; +/* 0x2654 */ DWORD unknown002654; +/* 0x2658 */ DWORD unknown002658; +/* 0x265c */ DWORD unknown00265c; +/* 0x2660 */ DWORD unknown002660; +/* 0x2664 */ DWORD unknown002664; +/* 0x2668 */ DWORD unknown002668; +/* 0x266c */ DWORD unknown00266c; +/* 0x2670 */ DWORD unknown002670; +/* 0x2674 */ DWORD unknown002674; +/* 0x2678 */ DWORD unknown002678; +/* 0x267c */ DWORD unknown00267c; +/* 0x2680 */ DWORD unknown002680; +/* 0x2684 */ DWORD unknown002684; +/* 0x2688 */ DWORD unknown002688; +/* 0x268c */ DWORD unknown00268c; +/* 0x2690 */ DWORD unknown002690; +/* 0x2694 */ DWORD unknown002694; +/* 0x2698 */ DWORD unknown002698; +/* 0x269c */ DWORD unknown00269c; +/* 0x26a0 */ DWORD unknown0026a0; +/* 0x26a4 */ DWORD unknown0026a4; +/* 0x26a8 */ DWORD unknown0026a8; +/* 0x26ac */ DWORD unknown0026ac; +/* 0x26b0 */ DWORD unknown0026b0; +/* 0x26b4 */ DWORD unknown0026b4; +/* 0x26b8 */ DWORD unknown0026b8; +/* 0x26bc */ DWORD unknown0026bc; +/* 0x26c0 */ DWORD unknown0026c0; +/* 0x26c4 */ DWORD unknown0026c4; +/* 0x26c8 */ DWORD unknown0026c8; +/* 0x26cc */ DWORD unknown0026cc; +/* 0x26d0 */ DWORD unknown0026d0; +/* 0x26d4 */ DWORD unknown0026d4; +/* 0x26d8 */ DWORD unknown0026d8; +/* 0x26dc */ DWORD unknown0026dc; +/* 0x26e0 */ DWORD unknown0026e0; +/* 0x26e4 */ DWORD unknown0026e4; +/* 0x26e8 */ DWORD unknown0026e8; +/* 0x26ec */ DWORD unknown0026ec; +/* 0x26f0 */ DWORD unknown0026f0; +/* 0x26f4 */ DWORD unknown0026f4; +/* 0x26f8 */ DWORD unknown0026f8; +/* 0x26fc */ DWORD unknown0026fc; + +/* 0x2700 */ DWORD unknown002700; +/* 0x2704 */ DWORD unknown002704; +/* 0x2708 */ DWORD unknown002708; +/* 0x270c */ DWORD unknown00270c; +/* 0x2710 */ DWORD unknown002710; +/* 0x2714 */ DWORD unknown002714; +/* 0x2718 */ DWORD unknown002718; +/* 0x271c */ DWORD unknown00271c; +/* 0x2720 */ DWORD unknown002720; +/* 0x2724 */ DWORD unknown002724; +/* 0x2728 */ DWORD unknown002728; +/* 0x272c */ DWORD unknown00272c; +/* 0x2730 */ DWORD unknown002730; +/* 0x2734 */ DWORD unknown002734; +/* 0x2738 */ DWORD unknown002738; +/* 0x273c */ DWORD unknown00273c; +/* 0x2740 */ DWORD unknown002740; +/* 0x2744 */ DWORD unknown002744; +/* 0x2748 */ DWORD unknown002748; +/* 0x274c */ DWORD unknown00274c; +/* 0x2750 */ DWORD unknown002750; +/* 0x2754 */ DWORD unknown002754; +/* 0x2758 */ DWORD unknown002758; +/* 0x275c */ DWORD unknown00275c; +/* 0x2760 */ DWORD unknown002760; +/* 0x2764 */ DWORD unknown002764; +/* 0x2768 */ DWORD unknown002768; +/* 0x276c */ DWORD unknown00276c; +/* 0x2770 */ DWORD unknown002770; +/* 0x2774 */ DWORD unknown002774; +/* 0x2778 */ DWORD unknown002778; +/* 0x277c */ DWORD unknown00277c; +/* 0x2780 */ DWORD unknown002780; +/* 0x2784 */ DWORD unknown002784; +/* 0x2788 */ DWORD unknown002788; +/* 0x278c */ DWORD unknown00278c; +/* 0x2790 */ DWORD unknown002790; +/* 0x2794 */ DWORD unknown002794; +/* 0x2798 */ DWORD unknown002798; +/* 0x279c */ DWORD unknown00279c; +/* 0x27a0 */ DWORD unknown0027a0; +/* 0x27a4 */ DWORD unknown0027a4; +/* 0x27a8 */ DWORD unknown0027a8; +/* 0x27ac */ DWORD unknown0027ac; +/* 0x27b0 */ DWORD unknown0027b0; +/* 0x27b4 */ DWORD unknown0027b4; +/* 0x27b8 */ DWORD unknown0027b8; +/* 0x27bc */ DWORD unknown0027bc; +/* 0x27c0 */ DWORD unknown0027c0; +/* 0x27c4 */ DWORD unknown0027c4; +/* 0x27c8 */ DWORD unknown0027c8; +/* 0x27cc */ DWORD unknown0027cc; +/* 0x27d0 */ DWORD unknown0027d0; +/* 0x27d4 */ DWORD unknown0027d4; +/* 0x27d8 */ DWORD unknown0027d8; +/* 0x27dc */ DWORD unknown0027dc; +/* 0x27e0 */ DWORD unknown0027e0; +/* 0x27e4 */ DWORD unknown0027e4; +/* 0x27e8 */ DWORD unknown0027e8; +/* 0x27ec */ DWORD unknown0027ec; +/* 0x27f0 */ DWORD unknown0027f0; +/* 0x27f4 */ DWORD unknown0027f4; +/* 0x27f8 */ DWORD unknown0027f8; +/* 0x27fc */ DWORD unknown0027fc; + +/* 0x2800 */ DWORD unknown002800; +/* 0x2804 */ DWORD unknown002804; +/* 0x2808 */ DWORD unknown002808; +/* 0x280c */ DWORD unknown00280c; +/* 0x2810 */ DWORD unknown002810; +/* 0x2814 */ DWORD unknown002814; +/* 0x2818 */ DWORD unknown002818; +/* 0x281c */ DWORD unknown00281c; +/* 0x2820 */ DWORD unknown002820; +/* 0x2824 */ DWORD unknown002824; +/* 0x2828 */ DWORD unknown002828; +/* 0x282c */ DWORD unknown00282c; +/* 0x2830 */ DWORD unknown002830; +/* 0x2834 */ DWORD unknown002834; +/* 0x2838 */ DWORD unknown002838; +/* 0x283c */ DWORD unknown00283c; +/* 0x2840 */ DWORD unknown002840; +/* 0x2844 */ DWORD unknown002844; +/* 0x2848 */ DWORD unknown002848; +/* 0x284c */ DWORD unknown00284c; +/* 0x2850 */ DWORD unknown002850; +/* 0x2854 */ DWORD unknown002854; +/* 0x2858 */ DWORD unknown002858; +/* 0x285c */ DWORD unknown00285c; +/* 0x2860 */ DWORD unknown002860; +/* 0x2864 */ DWORD unknown002864; +/* 0x2868 */ DWORD unknown002868; +/* 0x286c */ DWORD unknown00286c; +/* 0x2870 */ DWORD unknown002870; +/* 0x2874 */ DWORD unknown002874; +/* 0x2878 */ DWORD unknown002878; +/* 0x287c */ DWORD unknown00287c; +/* 0x2880 */ DWORD unknown002880; +/* 0x2884 */ DWORD unknown002884; +/* 0x2888 */ DWORD unknown002888; +/* 0x288c */ DWORD unknown00288c; +/* 0x2890 */ DWORD unknown002890; +/* 0x2894 */ DWORD unknown002894; +/* 0x2898 */ DWORD unknown002898; +/* 0x289c */ DWORD unknown00289c; +/* 0x28a0 */ DWORD unknown0028a0; +/* 0x28a4 */ DWORD unknown0028a4; +/* 0x28a8 */ DWORD unknown0028a8; +/* 0x28ac */ DWORD unknown0028ac; +/* 0x28b0 */ DWORD unknown0028b0; +/* 0x28b4 */ DWORD unknown0028b4; +/* 0x28b8 */ DWORD unknown0028b8; +/* 0x28bc */ DWORD unknown0028bc; +/* 0x28c0 */ DWORD unknown0028c0; +/* 0x28c4 */ DWORD unknown0028c4; +/* 0x28c8 */ DWORD unknown0028c8; +/* 0x28cc */ DWORD unknown0028cc; +/* 0x28d0 */ DWORD unknown0028d0; +/* 0x28d4 */ DWORD unknown0028d4; +/* 0x28d8 */ DWORD unknown0028d8; +/* 0x28dc */ DWORD unknown0028dc; +/* 0x28e0 */ DWORD unknown0028e0; +/* 0x28e4 */ DWORD unknown0028e4; +/* 0x28e8 */ DWORD unknown0028e8; +/* 0x28ec */ DWORD unknown0028ec; +/* 0x28f0 */ DWORD unknown0028f0; +/* 0x28f4 */ DWORD unknown0028f4; +/* 0x28f8 */ DWORD unknown0028f8; +/* 0x28fc */ DWORD unknown0028fc; + +/* 0x2900 */ DWORD unknown002900; +/* 0x2904 */ DWORD unknown002904; +/* 0x2908 */ DWORD unknown002908; +/* 0x290c */ DWORD unknown00290c; +/* 0x2910 */ DWORD unknown002910; +/* 0x2914 */ DWORD unknown002914; +/* 0x2918 */ DWORD unknown002918; +/* 0x291c */ DWORD unknown00291c; +/* 0x2920 */ DWORD unknown002920; +/* 0x2924 */ DWORD unknown002924; +/* 0x2928 */ DWORD unknown002928; +/* 0x292c */ DWORD unknown00292c; +/* 0x2930 */ DWORD unknown002930; +/* 0x2934 */ DWORD unknown002934; +/* 0x2938 */ DWORD unknown002938; +/* 0x293c */ DWORD unknown00293c; +/* 0x2940 */ DWORD unknown002940; +/* 0x2944 */ DWORD unknown002944; +/* 0x2948 */ DWORD unknown002948; +/* 0x294c */ DWORD unknown00294c; +/* 0x2950 */ DWORD unknown002950; +/* 0x2954 */ DWORD unknown002954; +/* 0x2958 */ DWORD unknown002958; +/* 0x295c */ DWORD unknown00295c; +/* 0x2960 */ DWORD unknown002960; +/* 0x2964 */ DWORD unknown002964; +/* 0x2968 */ DWORD unknown002968; +/* 0x296c */ DWORD unknown00296c; +/* 0x2970 */ DWORD unknown002970; +/* 0x2974 */ DWORD unknown002974; +/* 0x2978 */ DWORD unknown002978; +/* 0x297c */ DWORD unknown00297c; +/* 0x2980 */ DWORD unknown002980; +/* 0x2984 */ DWORD unknown002984; +/* 0x2988 */ DWORD unknown002988; +/* 0x298c */ DWORD unknown00298c; +/* 0x2990 */ DWORD unknown002990; +/* 0x2994 */ DWORD unknown002994; +/* 0x2998 */ DWORD unknown002998; +/* 0x299c */ DWORD unknown00299c; +/* 0x29a0 */ DWORD unknown0029a0; +/* 0x29a4 */ DWORD unknown0029a4; +/* 0x29a8 */ DWORD unknown0029a8; +/* 0x29ac */ DWORD unknown0029ac; +/* 0x29b0 */ DWORD unknown0029b0; +/* 0x29b4 */ DWORD unknown0029b4; +/* 0x29b8 */ DWORD unknown0029b8; +/* 0x29bc */ DWORD unknown0029bc; +/* 0x29c0 */ DWORD unknown0029c0; +/* 0x29c4 */ DWORD unknown0029c4; +/* 0x29c8 */ DWORD unknown0029c8; +/* 0x29cc */ DWORD unknown0029cc; +/* 0x29d0 */ DWORD unknown0029d0; +/* 0x29d4 */ DWORD unknown0029d4; +/* 0x29d8 */ DWORD unknown0029d8; +/* 0x29dc */ DWORD unknown0029dc; +/* 0x29e0 */ DWORD unknown0029e0; +/* 0x29e4 */ DWORD unknown0029e4; +/* 0x29e8 */ DWORD unknown0029e8; +/* 0x29ec */ DWORD unknown0029ec; +/* 0x29f0 */ DWORD unknown0029f0; +/* 0x29f4 */ DWORD unknown0029f4; +/* 0x29f8 */ DWORD unknown0029f8; +/* 0x29fc */ DWORD unknown0029fc; + +/* 0x2a00 */ DWORD unknown002a00; +/* 0x2a04 */ DWORD unknown002a04; +/* 0x2a08 */ DWORD unknown002a08; +/* 0x2a0c */ DWORD unknown002a0c; +/* 0x2a10 */ DWORD unknown002a10; +/* 0x2a14 */ DWORD unknown002a14; +/* 0x2a18 */ DWORD unknown002a18; +/* 0x2a1c */ DWORD unknown002a1c; +/* 0x2a20 */ DWORD unknown002a20; +/* 0x2a24 */ DWORD unknown002a24; +/* 0x2a28 */ DWORD unknown002a28; +/* 0x2a2c */ DWORD unknown002a2c; +/* 0x2a30 */ DWORD unknown002a30; +/* 0x2a34 */ DWORD unknown002a34; +/* 0x2a38 */ DWORD unknown002a38; +/* 0x2a3c */ DWORD unknown002a3c; +/* 0x2a40 */ DWORD unknown002a40; +/* 0x2a44 */ DWORD unknown002a44; +/* 0x2a48 */ DWORD unknown002a48; +/* 0x2a4c */ DWORD unknown002a4c; +/* 0x2a50 */ DWORD unknown002a50; +/* 0x2a54 */ DWORD unknown002a54; +/* 0x2a58 */ DWORD unknown002a58; +/* 0x2a5c */ DWORD unknown002a5c; +/* 0x2a60 */ DWORD unknown002a60; +/* 0x2a64 */ DWORD unknown002a64; +/* 0x2a68 */ DWORD unknown002a68; +/* 0x2a6c */ DWORD unknown002a6c; +/* 0x2a70 */ DWORD unknown002a70; +/* 0x2a74 */ DWORD unknown002a74; +/* 0x2a78 */ DWORD unknown002a78; +/* 0x2a7c */ DWORD unknown002a7c; +/* 0x2a80 */ DWORD unknown002a80; +/* 0x2a84 */ DWORD unknown002a84; +/* 0x2a88 */ DWORD unknown002a88; +/* 0x2a8c */ DWORD unknown002a8c; +/* 0x2a90 */ DWORD unknown002a90; +/* 0x2a94 */ DWORD unknown002a94; +/* 0x2a98 */ DWORD unknown002a98; +/* 0x2a9c */ DWORD unknown002a9c; +/* 0x2aa0 */ DWORD unknown002aa0; +/* 0x2aa4 */ DWORD unknown002aa4; +/* 0x2aa8 */ DWORD unknown002aa8; +/* 0x2aac */ DWORD unknown002aac; +/* 0x2ab0 */ DWORD unknown002ab0; +/* 0x2ab4 */ DWORD unknown002ab4; +/* 0x2ab8 */ DWORD unknown002ab8; +/* 0x2abc */ DWORD unknown002abc; +/* 0x2ac0 */ DWORD unknown002ac0; +/* 0x2ac4 */ DWORD unknown002ac4; +/* 0x2ac8 */ DWORD unknown002ac8; +/* 0x2acc */ DWORD unknown002acc; +/* 0x2ad0 */ DWORD unknown002ad0; +/* 0x2ad4 */ DWORD unknown002ad4; +/* 0x2ad8 */ DWORD unknown002ad8; +/* 0x2adc */ DWORD unknown002adc; +/* 0x2ae0 */ DWORD unknown002ae0; +/* 0x2ae4 */ DWORD unknown002ae4; +/* 0x2ae8 */ DWORD unknown002ae8; +/* 0x2aec */ DWORD unknown002aec; +/* 0x2af0 */ DWORD unknown002af0; +/* 0x2af4 */ DWORD unknown002af4; +/* 0x2af8 */ DWORD unknown002af8; +/* 0x2afc */ DWORD unknown002afc; + +/* 0x2b00 */ DWORD unknown002b00; +/* 0x2b04 */ DWORD unknown002b04; +/* 0x2b08 */ DWORD unknown002b08; +/* 0x2b0c */ DWORD unknown002b0c; +/* 0x2b10 */ DWORD unknown002b10; +/* 0x2b14 */ DWORD unknown002b14; +/* 0x2b18 */ DWORD unknown002b18; +/* 0x2b1c */ DWORD unknown002b1c; +/* 0x2b20 */ DWORD unknown002b20; +/* 0x2b24 */ DWORD unknown002b24; +/* 0x2b28 */ DWORD unknown002b28; +/* 0x2b2c */ DWORD unknown002b2c; +/* 0x2b30 */ DWORD unknown002b30; +/* 0x2b34 */ DWORD unknown002b34; +/* 0x2b38 */ DWORD unknown002b38; +/* 0x2b3c */ DWORD unknown002b3c; +/* 0x2b40 */ DWORD unknown002b40; +/* 0x2b44 */ DWORD unknown002b44; +/* 0x2b48 */ DWORD unknown002b48; +/* 0x2b4c */ DWORD unknown002b4c; +/* 0x2b50 */ DWORD unknown002b50; +/* 0x2b54 */ DWORD unknown002b54; +/* 0x2b58 */ DWORD unknown002b58; +/* 0x2b5c */ DWORD unknown002b5c; +/* 0x2b60 */ DWORD unknown002b60; +/* 0x2b64 */ DWORD unknown002b64; +/* 0x2b68 */ DWORD unknown002b68; +/* 0x2b6c */ DWORD unknown002b6c; +/* 0x2b70 */ DWORD unknown002b70; +/* 0x2b74 */ DWORD unknown002b74; +/* 0x2b78 */ DWORD unknown002b78; +/* 0x2b7c */ DWORD unknown002b7c; +/* 0x2b80 */ DWORD unknown002b80; +/* 0x2b84 */ DWORD unknown002b84; +/* 0x2b88 */ DWORD unknown002b88; +/* 0x2b8c */ DWORD unknown002b8c; +/* 0x2b90 */ DWORD unknown002b90; +/* 0x2b94 */ DWORD unknown002b94; +/* 0x2b98 */ DWORD unknown002b98; +/* 0x2b9c */ DWORD unknown002b9c; +/* 0x2ba0 */ DWORD unknown002ba0; +/* 0x2ba4 */ DWORD unknown002ba4; +/* 0x2ba8 */ DWORD unknown002ba8; +/* 0x2bac */ DWORD unknown002bac; +/* 0x2bb0 */ DWORD unknown002bb0; +/* 0x2bb4 */ DWORD unknown002bb4; +/* 0x2bb8 */ DWORD unknown002bb8; +/* 0x2bbc */ DWORD unknown002bbc; +/* 0x2bc0 */ DWORD unknown002bc0; +/* 0x2bc4 */ DWORD unknown002bc4; +/* 0x2bc8 */ DWORD unknown002bc8; +/* 0x2bcc */ DWORD unknown002bcc; +/* 0x2bd0 */ DWORD unknown002bd0; +/* 0x2bd4 */ DWORD unknown002bd4; +/* 0x2bd8 */ DWORD unknown002bd8; +/* 0x2bdc */ DWORD unknown002bdc; +/* 0x2be0 */ DWORD unknown002be0; +/* 0x2be4 */ DWORD unknown002be4; +/* 0x2be8 */ DWORD unknown002be8; +/* 0x2bec */ DWORD unknown002bec; +/* 0x2bf0 */ DWORD unknown002bf0; +/* 0x2bf4 */ DWORD unknown002bf4; +/* 0x2bf8 */ DWORD unknown002bf8; +/* 0x2bfc */ DWORD unknown002bfc; + +/* 0x2c00 */ DWORD unknown002c00; +/* 0x2c04 */ DWORD unknown002c04; +/* 0x2c08 */ DWORD unknown002c08; +/* 0x2c0c */ DWORD unknown002c0c; +/* 0x2c10 */ DWORD unknown002c10; +/* 0x2c14 */ DWORD unknown002c14; +/* 0x2c18 */ DWORD unknown002c18; +/* 0x2c1c */ DWORD unknown002c1c; +/* 0x2c20 */ DWORD unknown002c20; +/* 0x2c24 */ DWORD unknown002c24; +/* 0x2c28 */ DWORD unknown002c28; +/* 0x2c2c */ DWORD unknown002c2c; +/* 0x2c30 */ DWORD unknown002c30; +/* 0x2c34 */ DWORD unknown002c34; +/* 0x2c38 */ DWORD unknown002c38; +/* 0x2c3c */ DWORD unknown002c3c; +/* 0x2c40 */ DWORD unknown002c40; +/* 0x2c44 */ DWORD unknown002c44; +/* 0x2c48 */ DWORD unknown002c48; +/* 0x2c4c */ DWORD unknown002c4c; +/* 0x2c50 */ DWORD unknown002c50; +/* 0x2c54 */ DWORD unknown002c54; +/* 0x2c58 */ DWORD unknown002c58; +/* 0x2c5c */ DWORD unknown002c5c; +/* 0x2c60 */ DWORD unknown002c60; +/* 0x2c64 */ DWORD unknown002c64; +/* 0x2c68 */ DWORD unknown002c68; +/* 0x2c6c */ DWORD unknown002c6c; +/* 0x2c70 */ DWORD unknown002c70; +/* 0x2c74 */ DWORD unknown002c74; +/* 0x2c78 */ DWORD unknown002c78; +/* 0x2c7c */ DWORD unknown002c7c; +/* 0x2c80 */ DWORD unknown002c80; +/* 0x2c84 */ DWORD unknown002c84; +/* 0x2c88 */ DWORD unknown002c88; +/* 0x2c8c */ DWORD unknown002c8c; +/* 0x2c90 */ DWORD unknown002c90; +/* 0x2c94 */ DWORD unknown002c94; +/* 0x2c98 */ DWORD unknown002c98; +/* 0x2c9c */ DWORD unknown002c9c; +/* 0x2ca0 */ DWORD unknown002ca0; +/* 0x2ca4 */ DWORD unknown002ca4; +/* 0x2ca8 */ DWORD unknown002ca8; +/* 0x2cac */ DWORD unknown002cac; +/* 0x2cb0 */ DWORD unknown002cb0; +/* 0x2cb4 */ DWORD unknown002cb4; +/* 0x2cb8 */ DWORD unknown002cb8; +/* 0x2cbc */ DWORD unknown002cbc; +/* 0x2cc0 */ DWORD unknown002cc0; +/* 0x2cc4 */ DWORD unknown002cc4; +/* 0x2cc8 */ DWORD unknown002cc8; +/* 0x2ccc */ DWORD unknown002ccc; +/* 0x2cd0 */ DWORD unknown002cd0; +/* 0x2cd4 */ DWORD unknown002cd4; +/* 0x2cd8 */ DWORD unknown002cd8; +/* 0x2cdc */ DWORD unknown002cdc; +/* 0x2ce0 */ DWORD unknown002ce0; +/* 0x2ce4 */ DWORD unknown002ce4; +/* 0x2ce8 */ DWORD unknown002ce8; +/* 0x2cec */ DWORD unknown002cec; +/* 0x2cf0 */ DWORD unknown002cf0; +/* 0x2cf4 */ DWORD unknown002cf4; +/* 0x2cf8 */ DWORD unknown002cf8; +/* 0x2cfc */ DWORD unknown002cfc; + +/* 0x2d00 */ DWORD unknown002d00; +/* 0x2d04 */ DWORD unknown002d04; +/* 0x2d08 */ DWORD unknown002d08; +/* 0x2d0c */ DWORD unknown002d0c; +/* 0x2d10 */ DWORD unknown002d10; +/* 0x2d14 */ DWORD unknown002d14; +/* 0x2d18 */ DWORD unknown002d18; +/* 0x2d1c */ DWORD unknown002d1c; +/* 0x2d20 */ DWORD unknown002d20; +/* 0x2d24 */ DWORD unknown002d24; +/* 0x2d28 */ DWORD unknown002d28; +/* 0x2d2c */ DWORD unknown002d2c; +/* 0x2d30 */ DWORD unknown002d30; +/* 0x2d34 */ DWORD unknown002d34; +/* 0x2d38 */ DWORD unknown002d38; +/* 0x2d3c */ DWORD unknown002d3c; +/* 0x2d40 */ DWORD unknown002d40; +/* 0x2d44 */ DWORD unknown002d44; +/* 0x2d48 */ DWORD unknown002d48; +/* 0x2d4c */ DWORD unknown002d4c; +/* 0x2d50 */ DWORD unknown002d50; +/* 0x2d54 */ DWORD unknown002d54; +/* 0x2d58 */ DWORD unknown002d58; +/* 0x2d5c */ DWORD unknown002d5c; +/* 0x2d60 */ DWORD unknown002d60; +/* 0x2d64 */ DWORD unknown002d64; +/* 0x2d68 */ DWORD unknown002d68; +/* 0x2d6c */ DWORD unknown002d6c; +/* 0x2d70 */ DWORD unknown002d70; +/* 0x2d74 */ DWORD unknown002d74; +/* 0x2d78 */ DWORD unknown002d78; +/* 0x2d7c */ DWORD unknown002d7c; +/* 0x2d80 */ DWORD unknown002d80; +/* 0x2d84 */ DWORD unknown002d84; +/* 0x2d88 */ DWORD unknown002d88; +/* 0x2d8c */ DWORD unknown002d8c; +/* 0x2d90 */ DWORD unknown002d90; +/* 0x2d94 */ DWORD unknown002d94; +/* 0x2d98 */ DWORD unknown002d98; +/* 0x2d9c */ DWORD unknown002d9c; +/* 0x2da0 */ DWORD unknown002da0; +/* 0x2da4 */ DWORD unknown002da4; +/* 0x2da8 */ DWORD unknown002da8; +/* 0x2dac */ DWORD unknown002dac; +/* 0x2db0 */ DWORD unknown002db0; +/* 0x2db4 */ DWORD unknown002db4; +/* 0x2db8 */ DWORD unknown002db8; +/* 0x2dbc */ DWORD unknown002dbc; +/* 0x2dc0 */ DWORD unknown002dc0; +/* 0x2dc4 */ DWORD unknown002dc4; +/* 0x2dc8 */ DWORD unknown002dc8; +/* 0x2dcc */ DWORD unknown002dcc; +/* 0x2dd0 */ DWORD unknown002dd0; +/* 0x2dd4 */ DWORD unknown002dd4; +/* 0x2dd8 */ DWORD unknown002dd8; +/* 0x2ddc */ DWORD unknown002ddc; +/* 0x2de0 */ DWORD unknown002de0; +/* 0x2de4 */ DWORD unknown002de4; +/* 0x2de8 */ DWORD unknown002de8; +/* 0x2dec */ DWORD unknown002dec; +/* 0x2df0 */ DWORD unknown002df0; +/* 0x2df4 */ DWORD unknown002df4; +/* 0x2df8 */ DWORD unknown002df8; +/* 0x2dfc */ DWORD unknown002dfc; + +/* 0x2e00 */ DWORD unknown002e00; +/* 0x2e04 */ DWORD unknown002e04; +/* 0x2e08 */ DWORD unknown002e08; +/* 0x2e0c */ DWORD unknown002e0c; +/* 0x2e10 */ DWORD unknown002e10; +/* 0x2e14 */ DWORD unknown002e14; +/* 0x2e18 */ DWORD unknown002e18; +/* 0x2e1c */ DWORD unknown002e1c; +/* 0x2e20 */ DWORD unknown002e20; +/* 0x2e24 */ DWORD unknown002e24; +/* 0x2e28 */ DWORD unknown002e28; +/* 0x2e2c */ DWORD unknown002e2c; +/* 0x2e30 */ DWORD unknown002e30; +/* 0x2e34 */ DWORD unknown002e34; +/* 0x2e38 */ DWORD unknown002e38; +/* 0x2e3c */ DWORD unknown002e3c; +/* 0x2e40 */ DWORD unknown002e40; +/* 0x2e44 */ DWORD unknown002e44; +/* 0x2e48 */ DWORD unknown002e48; +/* 0x2e4c */ DWORD unknown002e4c; +/* 0x2e50 */ DWORD unknown002e50; +/* 0x2e54 */ DWORD unknown002e54; +/* 0x2e58 */ DWORD unknown002e58; +/* 0x2e5c */ DWORD unknown002e5c; +/* 0x2e60 */ DWORD unknown002e60; +/* 0x2e64 */ DWORD unknown002e64; +/* 0x2e68 */ DWORD unknown002e68; +/* 0x2e6c */ DWORD unknown002e6c; +/* 0x2e70 */ DWORD unknown002e70; +/* 0x2e74 */ DWORD unknown002e74; +/* 0x2e78 */ DWORD unknown002e78; +/* 0x2e7c */ DWORD unknown002e7c; +/* 0x2e80 */ DWORD unknown002e80; +/* 0x2e84 */ DWORD unknown002e84; +/* 0x2e88 */ DWORD unknown002e88; +/* 0x2e8c */ DWORD unknown002e8c; +/* 0x2e90 */ DWORD unknown002e90; +/* 0x2e94 */ DWORD unknown002e94; +/* 0x2e98 */ DWORD unknown002e98; +/* 0x2e9c */ DWORD unknown002e9c; +/* 0x2ea0 */ DWORD unknown002ea0; +/* 0x2ea4 */ DWORD unknown002ea4; +/* 0x2ea8 */ DWORD unknown002ea8; +/* 0x2eac */ DWORD unknown002eac; +/* 0x2eb0 */ DWORD unknown002eb0; +/* 0x2eb4 */ DWORD unknown002eb4; +/* 0x2eb8 */ DWORD unknown002eb8; +/* 0x2ebc */ DWORD unknown002ebc; +/* 0x2ec0 */ DWORD unknown002ec0; +/* 0x2ec4 */ DWORD unknown002ec4; +/* 0x2ec8 */ DWORD unknown002ec8; +/* 0x2ecc */ DWORD unknown002ecc; +/* 0x2ed0 */ DWORD unknown002ed0; +/* 0x2ed4 */ DWORD unknown002ed4; +/* 0x2ed8 */ DWORD unknown002ed8; +/* 0x2edc */ DWORD unknown002edc; +/* 0x2ee0 */ DWORD unknown002ee0; +/* 0x2ee4 */ DWORD unknown002ee4; +/* 0x2ee8 */ DWORD unknown002ee8; +/* 0x2eec */ DWORD unknown002eec; +/* 0x2ef0 */ DWORD unknown002ef0; +/* 0x2ef4 */ DWORD unknown002ef4; +/* 0x2ef8 */ DWORD unknown002ef8; +/* 0x2efc */ DWORD unknown002efc; + +/* 0x2f00 */ DWORD unknown002f00; +/* 0x2f04 */ DWORD unknown002f04; +/* 0x2f08 */ DWORD unknown002f08; +/* 0x2f0c */ DWORD unknown002f0c; +/* 0x2f10 */ DWORD unknown002f10; +/* 0x2f14 */ DWORD unknown002f14; +/* 0x2f18 */ DWORD unknown002f18; +/* 0x2f1c */ DWORD unknown002f1c; +/* 0x2f20 */ DWORD unknown002f20; +/* 0x2f24 */ DWORD unknown002f24; +/* 0x2f28 */ DWORD unknown002f28; +/* 0x2f2c */ DWORD unknown002f2c; +/* 0x2f30 */ DWORD unknown002f30; +/* 0x2f34 */ DWORD unknown002f34; +/* 0x2f38 */ DWORD unknown002f38; +/* 0x2f3c */ DWORD unknown002f3c; +/* 0x2f40 */ DWORD unknown002f40; +/* 0x2f44 */ DWORD unknown002f44; +/* 0x2f48 */ DWORD unknown002f48; +/* 0x2f4c */ DWORD unknown002f4c; +/* 0x2f50 */ DWORD unknown002f50; +/* 0x2f54 */ DWORD unknown002f54; +/* 0x2f58 */ DWORD unknown002f58; +/* 0x2f5c */ DWORD unknown002f5c; +/* 0x2f60 */ DWORD unknown002f60; +/* 0x2f64 */ DWORD unknown002f64; +/* 0x2f68 */ DWORD unknown002f68; +/* 0x2f6c */ DWORD unknown002f6c; +/* 0x2f70 */ DWORD unknown002f70; +/* 0x2f74 */ DWORD unknown002f74; +/* 0x2f78 */ DWORD unknown002f78; +/* 0x2f7c */ DWORD unknown002f7c; +/* 0x2f80 */ DWORD unknown002f80; +/* 0x2f84 */ DWORD unknown002f84; +/* 0x2f88 */ DWORD unknown002f88; +/* 0x2f8c */ DWORD unknown002f8c; +/* 0x2f90 */ DWORD unknown002f90; +/* 0x2f94 */ DWORD unknown002f94; +/* 0x2f98 */ DWORD unknown002f98; +/* 0x2f9c */ DWORD unknown002f9c; +/* 0x2fa0 */ DWORD unknown002fa0; +/* 0x2fa4 */ DWORD unknown002fa4; +/* 0x2fa8 */ DWORD unknown002fa8; +/* 0x2fac */ DWORD unknown002fac; +/* 0x2fb0 */ DWORD unknown002fb0; +/* 0x2fb4 */ DWORD unknown002fb4; +/* 0x2fb8 */ DWORD unknown002fb8; +/* 0x2fbc */ DWORD unknown002fbc; +/* 0x2fc0 */ DWORD unknown002fc0; +/* 0x2fc4 */ DWORD unknown002fc4; +/* 0x2fc8 */ DWORD unknown002fc8; +/* 0x2fcc */ DWORD unknown002fcc; +/* 0x2fd0 */ DWORD unknown002fd0; +/* 0x2fd4 */ DWORD unknown002fd4; +/* 0x2fd8 */ DWORD unknown002fd8; +/* 0x2fdc */ DWORD unknown002fdc; +/* 0x2fe0 */ DWORD unknown002fe0; +/* 0x2fe4 */ DWORD unknown002fe4; +/* 0x2fe8 */ DWORD unknown002fe8; +/* 0x2fec */ DWORD unknown002fec; +/* 0x2ff0 */ DWORD unknown002ff0; +/* 0x2ff4 */ DWORD unknown002ff4; +/* 0x2ff8 */ DWORD unknown002ff8; +/* 0x2ffc */ DWORD unknown002ffc; + +/* 0x3000 */ DWORD unknown003000; +/* 0x3004 */ DWORD unknown003004; +/* 0x3008 */ DWORD unknown003008; +/* 0x300c */ DWORD unknown00300c; +/* 0x3010 */ DWORD unknown003010; +/* 0x3014 */ DWORD unknown003014; +/* 0x3018 */ DWORD unknown003018; +/* 0x301c */ DWORD unknown00301c; +/* 0x3020 */ DWORD unknown003020; +/* 0x3024 */ DWORD unknown003024; +/* 0x3028 */ DWORD unknown003028; +/* 0x302c */ DWORD unknown00302c; +/* 0x3030 */ DWORD unknown003030; +/* 0x3034 */ DWORD unknown003034; +/* 0x3038 */ DWORD unknown003038; +/* 0x303c */ DWORD unknown00303c; +/* 0x3040 */ DWORD unknown003040; +/* 0x3044 */ DWORD unknown003044; +/* 0x3048 */ DWORD unknown003048; +/* 0x304c */ DWORD unknown00304c; +/* 0x3050 */ DWORD unknown003050; +/* 0x3054 */ DWORD unknown003054; +/* 0x3058 */ DWORD unknown003058; +/* 0x305c */ DWORD unknown00305c; +/* 0x3060 */ DWORD unknown003060; +/* 0x3064 */ DWORD unknown003064; +/* 0x3068 */ DWORD unknown003068; +/* 0x306c */ DWORD unknown00306c; +/* 0x3070 */ DWORD unknown003070; +/* 0x3074 */ DWORD unknown003074; +/* 0x3078 */ DWORD unknown003078; +/* 0x307c */ DWORD unknown00307c; +/* 0x3080 */ DWORD unknown003080; +/* 0x3084 */ DWORD unknown003084; +/* 0x3088 */ DWORD unknown003088; +/* 0x308c */ DWORD unknown00308c; +/* 0x3090 */ DWORD unknown003090; +/* 0x3094 */ DWORD unknown003094; +/* 0x3098 */ DWORD unknown003098; +/* 0x309c */ DWORD unknown00309c; +/* 0x30a0 */ DWORD unknown0030a0; +/* 0x30a4 */ DWORD unknown0030a4; +/* 0x30a8 */ DWORD unknown0030a8; +/* 0x30ac */ DWORD unknown0030ac; +/* 0x30b0 */ DWORD unknown0030b0; +/* 0x30b4 */ DWORD unknown0030b4; +/* 0x30b8 */ DWORD unknown0030b8; +/* 0x30bc */ DWORD unknown0030bc; +/* 0x30c0 */ DWORD unknown0030c0; +/* 0x30c4 */ DWORD unknown0030c4; +/* 0x30c8 */ DWORD unknown0030c8; +/* 0x30cc */ DWORD unknown0030cc; +/* 0x30d0 */ DWORD unknown0030d0; +/* 0x30d4 */ DWORD unknown0030d4; +/* 0x30d8 */ DWORD unknown0030d8; +/* 0x30dc */ DWORD unknown0030dc; +/* 0x30e0 */ DWORD unknown0030e0; +/* 0x30e4 */ DWORD unknown0030e4; +/* 0x30e8 */ DWORD unknown0030e8; +/* 0x30ec */ DWORD unknown0030ec; +/* 0x30f0 */ DWORD unknown0030f0; +/* 0x30f4 */ DWORD unknown0030f4; +/* 0x30f8 */ DWORD unknown0030f8; +/* 0x30fc */ DWORD unknown0030fc; + +/* 0x3100 */ DWORD unknown003100; +/* 0x3104 */ DWORD unknown003104; +/* 0x3108 */ DWORD unknown003108; +/* 0x310c */ DWORD unknown00310c; +/* 0x3110 */ DWORD unknown003110; +/* 0x3114 */ DWORD unknown003114; +/* 0x3118 */ DWORD unknown003118; +/* 0x311c */ DWORD unknown00311c; +/* 0x3120 */ DWORD unknown003120; +/* 0x3124 */ DWORD unknown003124; +/* 0x3128 */ DWORD unknown003128; +/* 0x312c */ DWORD unknown00312c; +/* 0x3130 */ DWORD unknown003130; +/* 0x3134 */ DWORD unknown003134; +/* 0x3138 */ DWORD unknown003138; +/* 0x313c */ DWORD unknown00313c; +/* 0x3140 */ DWORD unknown003140; +/* 0x3144 */ DWORD unknown003144; +/* 0x3148 */ DWORD unknown003148; +/* 0x314c */ DWORD unknown00314c; +/* 0x3150 */ DWORD unknown003150; +/* 0x3154 */ DWORD unknown003154; +/* 0x3158 */ DWORD unknown003158; +/* 0x315c */ DWORD unknown00315c; +/* 0x3160 */ DWORD unknown003160; +/* 0x3164 */ DWORD unknown003164; +/* 0x3168 */ DWORD unknown003168; +/* 0x316c */ DWORD unknown00316c; +/* 0x3170 */ DWORD unknown003170; +/* 0x3174 */ DWORD unknown003174; +/* 0x3178 */ DWORD unknown003178; +/* 0x317c */ DWORD unknown00317c; +/* 0x3180 */ DWORD unknown003180; +/* 0x3184 */ DWORD unknown003184; +/* 0x3188 */ DWORD unknown003188; +/* 0x318c */ DWORD unknown00318c; +/* 0x3190 */ DWORD unknown003190; +/* 0x3194 */ DWORD unknown003194; +/* 0x3198 */ DWORD unknown003198; +/* 0x319c */ DWORD unknown00319c; +/* 0x31a0 */ DWORD unknown0031a0; +/* 0x31a4 */ DWORD unknown0031a4; +/* 0x31a8 */ DWORD unknown0031a8; +/* 0x31ac */ DWORD unknown0031ac; +/* 0x31b0 */ DWORD unknown0031b0; +/* 0x31b4 */ DWORD unknown0031b4; +/* 0x31b8 */ DWORD unknown0031b8; +/* 0x31bc */ DWORD unknown0031bc; +/* 0x31c0 */ DWORD unknown0031c0; +/* 0x31c4 */ DWORD unknown0031c4; +/* 0x31c8 */ DWORD unknown0031c8; +/* 0x31cc */ DWORD unknown0031cc; +/* 0x31d0 */ DWORD unknown0031d0; +/* 0x31d4 */ DWORD unknown0031d4; +/* 0x31d8 */ DWORD unknown0031d8; +/* 0x31dc */ DWORD unknown0031dc; +/* 0x31e0 */ DWORD unknown0031e0; +/* 0x31e4 */ DWORD unknown0031e4; +/* 0x31e8 */ DWORD unknown0031e8; +/* 0x31ec */ DWORD unknown0031ec; +/* 0x31f0 */ DWORD unknown0031f0; +/* 0x31f4 */ DWORD unknown0031f4; +/* 0x31f8 */ DWORD unknown0031f8; +/* 0x31fc */ DWORD unknown0031fc; + +/* 0x3200 */ DWORD unknown003200; +/* 0x3204 */ DWORD unknown003204; +/* 0x3208 */ DWORD unknown003208; +/* 0x320c */ DWORD unknown00320c; +/* 0x3210 */ DWORD unknown003210; +/* 0x3214 */ DWORD unknown003214; +/* 0x3218 */ DWORD unknown003218; +/* 0x321c */ DWORD unknown00321c; +/* 0x3220 */ DWORD unknown003220; +/* 0x3224 */ DWORD unknown003224; +/* 0x3228 */ DWORD unknown003228; +/* 0x322c */ DWORD unknown00322c; +/* 0x3230 */ DWORD unknown003230; +/* 0x3234 */ DWORD unknown003234; +/* 0x3238 */ DWORD unknown003238; +/* 0x323c */ DWORD unknown00323c; +/* 0x3240 */ DWORD unknown003240; +/* 0x3244 */ DWORD unknown003244; +/* 0x3248 */ DWORD unknown003248; +/* 0x324c */ DWORD unknown00324c; +/* 0x3250 */ DWORD unknown003250; +/* 0x3254 */ DWORD unknown003254; +/* 0x3258 */ DWORD unknown003258; +/* 0x325c */ DWORD unknown00325c; +/* 0x3260 */ DWORD unknown003260; +/* 0x3264 */ DWORD unknown003264; +/* 0x3268 */ DWORD unknown003268; +/* 0x326c */ DWORD unknown00326c; +/* 0x3270 */ DWORD unknown003270; +/* 0x3274 */ DWORD unknown003274; +/* 0x3278 */ DWORD unknown003278; +/* 0x327c */ DWORD unknown00327c; +/* 0x3280 */ DWORD unknown003280; +/* 0x3284 */ DWORD unknown003284; +/* 0x3288 */ DWORD unknown003288; +/* 0x328c */ DWORD unknown00328c; +/* 0x3290 */ DWORD unknown003290; +/* 0x3294 */ DWORD unknown003294; +/* 0x3298 */ DWORD unknown003298; +/* 0x329c */ DWORD unknown00329c; +/* 0x32a0 */ DWORD unknown0032a0; +/* 0x32a4 */ DWORD unknown0032a4; +/* 0x32a8 */ DWORD unknown0032a8; +/* 0x32ac */ DWORD unknown0032ac; +/* 0x32b0 */ DWORD unknown0032b0; +/* 0x32b4 */ DWORD unknown0032b4; +/* 0x32b8 */ DWORD unknown0032b8; +/* 0x32bc */ DWORD unknown0032bc; +/* 0x32c0 */ DWORD unknown0032c0; +/* 0x32c4 */ DWORD unknown0032c4; +/* 0x32c8 */ DWORD unknown0032c8; +/* 0x32cc */ DWORD unknown0032cc; +/* 0x32d0 */ DWORD unknown0032d0; +/* 0x32d4 */ DWORD unknown0032d4; +/* 0x32d8 */ DWORD unknown0032d8; +/* 0x32dc */ DWORD unknown0032dc; +/* 0x32e0 */ DWORD unknown0032e0; +/* 0x32e4 */ DWORD unknown0032e4; +/* 0x32e8 */ DWORD unknown0032e8; +/* 0x32ec */ DWORD unknown0032ec; +/* 0x32f0 */ DWORD unknown0032f0; +/* 0x32f4 */ DWORD unknown0032f4; +/* 0x32f8 */ DWORD unknown0032f8; +/* 0x32fc */ DWORD unknown0032fc; + +/* 0x3300 */ DWORD unknown003300; +/* 0x3304 */ DWORD unknown003304; +/* 0x3308 */ DWORD unknown003308; +/* 0x330c */ DWORD unknown00330c; +/* 0x3310 */ DWORD unknown003310; +/* 0x3314 */ DWORD unknown003314; +/* 0x3318 */ DWORD unknown003318; +/* 0x331c */ DWORD unknown00331c; +/* 0x3320 */ DWORD unknown003320; +/* 0x3324 */ DWORD unknown003324; +/* 0x3328 */ DWORD unknown003328; +/* 0x332c */ DWORD unknown00332c; +} D3D9HALDEVICE, FAR *LPD3D9HALDEVICE; + +#endif // _D3D9_HALDEVICE_H_ diff --git a/reactos/dll/directx/d3d9/d3d9_helpers.c b/reactos/dll/directx/d3d9/d3d9_helpers.c index 82e3beb90a1..fac9ef4d267 100644 --- a/reactos/dll/directx/d3d9/d3d9_helpers.c +++ b/reactos/dll/directx/d3d9/d3d9_helpers.c @@ -38,6 +38,59 @@ BOOL ReadRegistryValue(IN DWORD ValueType, IN LPCSTR ValueName, OUT LPBYTE DataB return TRUE; } +HRESULT SafeFormatString(OUT LPSTR Buffer, IN DWORD BufferSize, IN LPCSTR FormatString, ... ) +{ + DWORD BytesWritten; + va_list vargs; + + if (BufferSize == 0) + return DDERR_INVALIDPARAMS; + + va_start(vargs, FormatString); + BytesWritten = _vsnprintf(Buffer, BufferSize-1, FormatString, vargs); + + if (BytesWritten < BufferSize) + return DDERR_GENERIC; + + Buffer[BufferSize-1] = '\0'; + + return ERROR_SUCCESS; +} + +HRESULT SafeCopyString(OUT LPSTR Dst, IN DWORD DstSize, IN LPCSTR Src) +{ + HRESULT hr = ERROR_SUCCESS; + + if (Dst == NULL || DstSize == 0 || Src == NULL) + return DDERR_INVALIDPARAMS; + + while (*Src != '\0' && DstSize > 0) + { + *Dst++ = *Src++; + --DstSize; + } + + if (DstSize == 0) + { + --Dst; + hr = DDERR_GENERIC; + } + + return hr; +} + +HRESULT SafeAppendString(IN OUT LPSTR Dst, IN DWORD DstSize, IN LPCSTR Src) +{ + size_t CurrentDstLength; + + if (Dst == NULL || DstSize == 0) + return DDERR_INVALIDPARAMS; + + CurrentDstLength = strlen(Dst); + + return SafeCopyString(Dst + CurrentDstLength, DstSize - CurrentDstLength, Src); +} + HRESULT AlignedAlloc(IN OUT LPVOID *ppObject, IN SIZE_T dwSize) { ULONG AddressOffset; diff --git a/reactos/dll/directx/d3d9/d3d9_helpers.h b/reactos/dll/directx/d3d9/d3d9_helpers.h index ce5e356bb54..a7556e9653f 100644 --- a/reactos/dll/directx/d3d9/d3d9_helpers.h +++ b/reactos/dll/directx/d3d9/d3d9_helpers.h @@ -15,6 +15,11 @@ /* Reads a registry value if it's of the correct value type */ BOOL ReadRegistryValue(IN DWORD ValueType, IN LPCSTR ValueName, OUT LPBYTE DataBuffer, IN OUT LPDWORD DataBufferSize); +/* Safe string formatting */ +HRESULT SafeFormatString(IN OUT LPSTR Buffer, IN DWORD BufferSize, IN LPCSTR FormatString, ... ); +HRESULT SafeCopyString(OUT LPSTR Dst, IN DWORD DstSize, IN LPCSTR Src); +HRESULT SafeAppendString(IN OUT LPSTR Dst, IN DWORD DstSize, IN LPCSTR Src); + /* Allocates memory and returns an aligned pointer */ HRESULT AlignedAlloc(IN OUT LPVOID *ppObject, IN SIZE_T dwSize); diff --git a/reactos/dll/directx/d3d9/d3d9_impl.c b/reactos/dll/directx/d3d9/d3d9_impl.c index e6bf562b695..b593383c4a3 100644 --- a/reactos/dll/directx/d3d9/d3d9_impl.c +++ b/reactos/dll/directx/d3d9/d3d9_impl.c @@ -11,15 +11,16 @@ #include #include "d3d9_helpers.h" #include "adapter.h" +#include "device.h" #include "format.h" #define LOCK_D3D9() EnterCriticalSection(&This->d3d9_cs); #define UNLOCK_D3D9() LeaveCriticalSection(&This->d3d9_cs); /* Convert a IDirect3D9 pointer safely to the internal implementation struct */ -static LPDIRECT3D9_INT impl_from_IDirect3D9(LPDIRECT3D9 iface) +static LPDIRECT3D9_INT IDirect3D9ToImpl(LPDIRECT3D9 iface) { - if (IsBadWritePtr(iface, sizeof(LPDIRECT3D9_INT))) + if (NULL == iface) return NULL; return (LPDIRECT3D9_INT)((ULONG_PTR)iface - FIELD_OFFSET(DIRECT3D9_INT, lpVtbl)); @@ -28,7 +29,7 @@ static LPDIRECT3D9_INT impl_from_IDirect3D9(LPDIRECT3D9 iface) /* IDirect3D9: IUnknown implementation */ static HRESULT WINAPI IDirect3D9Impl_QueryInterface(LPDIRECT3D9 iface, REFIID riid, LPVOID* ppvObject) { - LPDIRECT3D9_INT This = impl_from_IDirect3D9(iface); + LPDIRECT3D9_INT This = IDirect3D9ToImpl(iface); if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirect3D9)) { @@ -43,7 +44,7 @@ static HRESULT WINAPI IDirect3D9Impl_QueryInterface(LPDIRECT3D9 iface, REFIID ri static ULONG WINAPI IDirect3D9Impl_AddRef(LPDIRECT3D9 iface) { - LPDIRECT3D9_INT This = impl_from_IDirect3D9(iface); + LPDIRECT3D9_INT This = IDirect3D9ToImpl(iface); ULONG ref = InterlockedIncrement(&This->lRefCnt); return ref; @@ -51,7 +52,7 @@ static ULONG WINAPI IDirect3D9Impl_AddRef(LPDIRECT3D9 iface) static ULONG WINAPI IDirect3D9Impl_Release(LPDIRECT3D9 iface) { - LPDIRECT3D9_INT This = impl_from_IDirect3D9(iface); + LPDIRECT3D9_INT This = IDirect3D9ToImpl(iface); ULONG ref = InterlockedDecrement(&This->lRefCnt); if (ref == 0) @@ -90,7 +91,7 @@ static UINT WINAPI IDirect3D9Impl_GetAdapterCount(LPDIRECT3D9 iface) { UINT NumDisplayAdapters; - LPDIRECT3D9_INT This = impl_from_IDirect3D9(iface); + LPDIRECT3D9_INT This = IDirect3D9ToImpl(iface); LOCK_D3D9(); NumDisplayAdapters = This->NumDisplayAdapters; @@ -129,7 +130,7 @@ static UINT WINAPI IDirect3D9Impl_GetAdapterCount(LPDIRECT3D9 iface) HRESULT WINAPI IDirect3D9Impl_GetAdapterIdentifier(LPDIRECT3D9 iface, UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER9* pIdentifier) { - LPDIRECT3D9_INT This = impl_from_IDirect3D9(iface); + LPDIRECT3D9_INT This = IDirect3D9ToImpl(iface); LOCK_D3D9(); if (Adapter >= This->NumDisplayAdapters) @@ -146,7 +147,7 @@ HRESULT WINAPI IDirect3D9Impl_GetAdapterIdentifier(LPDIRECT3D9 iface, UINT Adapt return D3DERR_INVALIDCALL; } - if (IsBadWritePtr(pIdentifier, sizeof(D3DADAPTER_IDENTIFIER9))) + if (NULL == pIdentifier) { DPRINT1("Invalid pIdentifier parameter specified"); UNLOCK_D3D9(); @@ -192,7 +193,7 @@ static UINT WINAPI IDirect3D9Impl_GetAdapterModeCount(LPDIRECT3D9 iface, UINT Ad { UINT AdapterModeCount; - LPDIRECT3D9_INT This = impl_from_IDirect3D9(iface); + LPDIRECT3D9_INT This = IDirect3D9ToImpl(iface); LOCK_D3D9(); if (Adapter >= This->NumDisplayAdapters) @@ -257,7 +258,7 @@ static HRESULT WINAPI IDirect3D9Impl_EnumAdapterModes(LPDIRECT3D9 iface, UINT Ad UINT Mode, D3DDISPLAYMODE* pMode) { const D3DDISPLAYMODE* pMatchingDisplayFormat; - LPDIRECT3D9_INT This = impl_from_IDirect3D9(iface); + LPDIRECT3D9_INT This = IDirect3D9ToImpl(iface); LOCK_D3D9(); if (Adapter >= This->NumDisplayAdapters) @@ -267,7 +268,7 @@ static HRESULT WINAPI IDirect3D9Impl_EnumAdapterModes(LPDIRECT3D9 iface, UINT Ad return D3DERR_INVALIDCALL; } - if (IsBadWritePtr(pMode, sizeof(D3DDISPLAYMODE))) + if (NULL == pMode) { DPRINT1("Invalid pMode parameter specified"); UNLOCK_D3D9(); @@ -328,7 +329,7 @@ static HRESULT WINAPI IDirect3D9Impl_EnumAdapterModes(LPDIRECT3D9 iface, UINT Ad */ static HRESULT WINAPI IDirect3D9Impl_GetAdapterDisplayMode(LPDIRECT3D9 iface, UINT Adapter, D3DDISPLAYMODE* pMode) { - LPDIRECT3D9_INT This = impl_from_IDirect3D9(iface); + LPDIRECT3D9_INT This = IDirect3D9ToImpl(iface); LOCK_D3D9(); if (Adapter >= This->NumDisplayAdapters) @@ -338,7 +339,7 @@ static HRESULT WINAPI IDirect3D9Impl_GetAdapterDisplayMode(LPDIRECT3D9 iface, UI return D3DERR_INVALIDCALL; } - if (IsBadWritePtr(pMode, sizeof(D3DDISPLAYMODE))) + if (NULL == pMode) { DPRINT1("Invalid pMode parameter specified"); UNLOCK_D3D9(); @@ -392,7 +393,7 @@ static HRESULT WINAPI IDirect3D9Impl_CheckDeviceType(LPDIRECT3D9 iface, UINT Ada { HRESULT hResult; - LPDIRECT3D9_INT This = impl_from_IDirect3D9(iface); + LPDIRECT3D9_INT This = IDirect3D9ToImpl(iface); LOCK_D3D9(); if (Adapter >= This->NumDisplayAdapters) @@ -492,7 +493,7 @@ static HRESULT WINAPI IDirect3D9Impl_CheckDeviceFormat(LPDIRECT3D9 iface, UINT A BOOL bIsTextureRType = FALSE; HRESULT hResult; - LPDIRECT3D9_INT This = impl_from_IDirect3D9(iface); + LPDIRECT3D9_INT This = IDirect3D9ToImpl(iface); LOCK_D3D9(); if (Adapter >= This->NumDisplayAdapters) @@ -686,7 +687,7 @@ static HRESULT WINAPI IDirect3D9Impl_CheckDepthStencilMatch(LPDIRECT3D9 iface, U { HRESULT hResult; - LPDIRECT3D9_INT This = impl_from_IDirect3D9(iface); + LPDIRECT3D9_INT This = IDirect3D9ToImpl(iface); LOCK_D3D9(); if (Adapter >= This->NumDisplayAdapters) @@ -755,7 +756,7 @@ static HRESULT WINAPI IDirect3D9Impl_CheckDeviceFormatConversion(LPDIRECT3D9 ifa D3DFORMAT SourceFormat, D3DFORMAT TargetFormat) { HRESULT hResult; - LPDIRECT3D9_INT This = impl_from_IDirect3D9(iface); + LPDIRECT3D9_INT This = IDirect3D9ToImpl(iface); LOCK_D3D9(); if (Adapter >= This->NumDisplayAdapters) @@ -826,7 +827,7 @@ static HRESULT WINAPI IDirect3D9Impl_CheckDeviceFormatConversion(LPDIRECT3D9 ifa static HRESULT WINAPI IDirect3D9Impl_GetDeviceCaps(LPDIRECT3D9 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS9* pCaps) { HRESULT hResult; - LPDIRECT3D9_INT This = impl_from_IDirect3D9(iface); + LPDIRECT3D9_INT This = IDirect3D9ToImpl(iface); LOCK_D3D9(); if (Adapter >= This->NumDisplayAdapters) @@ -836,7 +837,7 @@ static HRESULT WINAPI IDirect3D9Impl_GetDeviceCaps(LPDIRECT3D9 iface, UINT Adapt return D3DERR_INVALIDCALL; } - if (IsBadWritePtr(pCaps, sizeof(D3DCAPS9))) + if (NULL == pCaps) { DPRINT1("Invalid pCaps parameter specified"); UNLOCK_D3D9(); @@ -872,7 +873,7 @@ static HMONITOR WINAPI IDirect3D9Impl_GetAdapterMonitor(LPDIRECT3D9 iface, UINT { HMONITOR hAdapterMonitor = NULL; - LPDIRECT3D9_INT This = impl_from_IDirect3D9(iface); + LPDIRECT3D9_INT This = IDirect3D9ToImpl(iface); LOCK_D3D9(); if (Adapter < This->NumDisplayAdapters) @@ -888,14 +889,55 @@ static HMONITOR WINAPI IDirect3D9Impl_GetAdapterMonitor(LPDIRECT3D9 iface, UINT return hAdapterMonitor; } +/*++ +* @name IDirect3D9::CreateDevice +* @implemented +* +* The function IDirect3D9Impl_CreateDevice creates an IDirect3DDevice9 object +* that represents the display adapter. +* +* @param LPDIRECT3D iface +* Pointer to the IDirect3D9 object returned from Direct3DCreate9() +* +* @param UINT Adapter +* Adapter index to get information about. D3DADAPTER_DEFAULT is the primary display. +* The maximum value for this is the value returned by IDirect3D::GetAdapterCount() - 1. +* +* @param D3DDEVTYPE DeviceType +* One of the D3DDEVTYPE enum members. +* +* @param HWND hFocusWindow +* A window handle that is used as a reference when Direct3D should switch between +* foreground mode and background mode. +* +* @param DWORD BehaviourFlags +* Any valid combination of the D3DCREATE constants. +* +* @param D3DPRESENT_PARAMETERS* pPresentationParameters +* Pointer to a D3DPRESENT_PARAMETERS structure describing the parameters for the device +* to be created. If D3DCREATE_ADAPTERGROUP_DEVICE is specified in the BehaviourFlags parameter, +* the pPresentationParameters is treated as an array. +* +* @param IDirect3DDevice9** ppReturnedDeviceInterface +* Return object that represents the created device. +* +* @return HRESULT +* If the method successfully creates a device and returns a valid ppReturnedDeviceInterface object, +* the return value is D3D_OK. +* If Adapter is out of range, DeviceType is invalid, hFocusWindow is not a valid, BehaviourFlags is invalid +* pPresentationParameters is invalid or ppReturnedDeviceInterface is a bad pointer, the return value +* will be D3DERR_INVALIDCALL. +* +*/ static HRESULT WINAPI IDirect3D9Impl_CreateDevice(LPDIRECT3D9 iface, UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviourFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, struct IDirect3DDevice9** ppReturnedDeviceInterface) { DWORD NumAdaptersToCreate; + HRESULT Ret; - LPDIRECT3D9_INT This = impl_from_IDirect3D9(iface); + LPDIRECT3D9_INT This = IDirect3D9ToImpl(iface); LOCK_D3D9(); if (Adapter >= This->NumDisplayAdapters) @@ -923,12 +965,47 @@ static HRESULT WINAPI IDirect3D9Impl_CreateDevice(LPDIRECT3D9 iface, UINT Adapte if (hFocusWindow != NULL && FALSE == IsWindow(hFocusWindow)) { - DPRINT1("Invalid hFocusWindow parameter specified"); + DPRINT1("Invalid hFocusWindow parameter specified, expected NULL or a valid HWND"); UNLOCK_D3D9(); return D3DERR_INVALIDCALL; } - if (IsBadWritePtr(ppReturnedDeviceInterface, sizeof(IDirect3DDevice9*))) + if (NULL == pPresentationParameters) + { + DPRINT1("Invalid pPresentationParameters parameter specified"); + UNLOCK_D3D9(); + return D3DERR_INVALIDCALL; + } + + if (pPresentationParameters->hDeviceWindow != NULL && FALSE == IsWindow(pPresentationParameters->hDeviceWindow)) + { + DPRINT1("Invalid pPresentationParameters->hDeviceWindow parameter specified, expected NULL or a valid HWND"); + UNLOCK_D3D9(); + return D3DERR_INVALIDCALL; + } + + if (FALSE == pPresentationParameters->Windowed && hFocusWindow == NULL) + { + DPRINT1("When pPresentationParameters->Windowed is not set, hFocusWindow must be a valid HWND"); + UNLOCK_D3D9(); + return D3DERR_INVALIDCALL; + } + + if (NULL == hFocusWindow && NULL == pPresentationParameters->hDeviceWindow) + { + DPRINT1("Any of pPresentationParameters->Windowed and hFocusWindow must be set to a valid HWND"); + UNLOCK_D3D9(); + return D3DERR_INVALIDCALL; + } + + if (Adapter > 0 && NULL == pPresentationParameters->hDeviceWindow) + { + DPRINT1("Invalid pPresentationParameters->hDeviceWindow, must be set to a valid unique HWND when Adapter is greater than 0"); + UNLOCK_D3D9(); + return D3DERR_INVALIDCALL; + } + + if (NULL == ppReturnedDeviceInterface) { DPRINT1("Invalid ppReturnedDeviceInterface parameter specified"); UNLOCK_D3D9(); @@ -942,9 +1019,10 @@ static HRESULT WINAPI IDirect3D9Impl_CreateDevice(LPDIRECT3D9 iface, UINT Adapte *ppReturnedDeviceInterface = 0; - UNIMPLEMENTED + Ret = CreateD3D9HalDevice(This, Adapter, hFocusWindow, BehaviourFlags, pPresentationParameters, NumAdaptersToCreate, ppReturnedDeviceInterface); - return D3D_OK; + UNLOCK_D3D9(); + return Ret; } IDirect3D9Vtbl Direct3D9_Vtbl = diff --git a/reactos/dll/directx/d3d9/d3d9_private.h b/reactos/dll/directx/d3d9/d3d9_private.h index e89dfbb6066..cba2c867d70 100644 --- a/reactos/dll/directx/d3d9/d3d9_private.h +++ b/reactos/dll/directx/d3d9/d3d9_private.h @@ -8,7 +8,7 @@ #ifndef _D3D9_PRIVATE_H_ #define _D3D9_PRIVATE_H_ -#include +#include "d3d9_common.h" #include #define D3D9_INT_MAX_NUM_ADAPTERS 12 @@ -25,14 +25,14 @@ typedef enum _D3D9_GETAVAILDRIVERMEMORY_TYPE typedef struct _D3D9_GETAVAILDRIVERMEMORYDATA { -/* 0x0000 */ struct _D3D9Unknown6BC_* pUnknown6BC; +/* 0x0000 */ struct _D3D9_Unknown6BC* pUnknown6BC; /* 0x0004 */ D3D9_GETAVAILDRIVERMEMORY_TYPE dwMemoryType; /* 0x0008 */ DWORD dwTextureType; /* 0x000c */ DWORD dwFree; } D3D9_GETAVAILDRIVERMEMORYDATA, FAR* LPD3D9_GETAVAILDRIVERMEMORYDATA; typedef BOOL (WINAPI FAR* LPD3D9_GETAVAILDRIVERMEMORY)(LPD3D9_GETAVAILDRIVERMEMORYDATA); -typedef struct _D3D9Unknown6BC_ +typedef struct _D3D9_Unknown6BC { /* 0x0000 */ HANDLE hDirectDrawLocal; /* 0x0004 */ LPDWORD pUnknown0004; @@ -78,7 +78,7 @@ typedef struct _D3D9Unknown6BC_ /* 0x00BC */ DDGAMMARAMP GammaRamp; } D3D9_Unknown6BC; -typedef struct _tagD3D9_DRIVERCAPS +typedef struct _D3D9_DRIVERCAPS { /* 0x0000 */ D3DCAPS9 DriverCaps9; /* 0x0130 */ DWORD dwDisplayWidth; @@ -147,20 +147,20 @@ typedef struct _tagD3D9_CALLBACKS /* 0x00a4 */ D3DDEVTYPE DeviceType; } D3D9_CALLBACKS; -typedef struct _tagD3D9_DEVICEDATA_ +typedef struct _D3D9_DEVICEDATA { /* 0x0000 */ D3D9_DRIVERCAPS DriverCaps; /* 0x0178 */ D3D9_CALLBACKS D3D9Callbacks; /* 0x0220 */ CHAR szDeviceName[CCHDEVICENAME]; /* 0x0240 */ HDC hDC; /* 0x0244 */ GUID DisplayGuid; -/* 0x0254 */ D3D9_Unknown6BC* pUnknown6BC; +/* 0x0254 */ struct _D3D9_Unknown6BC* pUnknown6BC; /* 0x0258 */ D3DDEVTYPE DeviceType; /* 0x025c */ HMODULE hD3DRefDll; /* 0x0260 */ DWORD unknown0152; } D3D9_DEVICEDATA, FAR *LPD3D9_DEVICEDATA; -typedef struct _tagDIRECT3D9DisplayAdapterInfo_ +typedef struct _Direct3D9DisplayAdapterInfo { /* 0x0000 */ GUID DisplayGuid; /* 0x0010 */ CHAR szDeviceName[MAX_PATH]; @@ -179,13 +179,13 @@ typedef struct _tagDIRECT3D9DisplayAdapterInfo_ /* 0x02b8 */ DWORD unknown000105; } Direct3D9DisplayAdapterInfo, FAR* LPDIRECT3D9_DISPLAYADAPTER; -typedef struct _tagDIRECT3D9_INT_ +typedef struct _DIRECT3D9_INT { /* 0x0000 */ struct IDirect3D9Vtbl *lpVtbl; /* LPDIRECTD3D9 function table */ /* 0x0004 */ CRITICAL_SECTION d3d9_cs; /* 0x001c */ DWORD unknown000007; /* 0x00000001 */ /* 0x0020 */ DWORD dwProcessId; -/* 0x0024 */ struct _tagDIRECT3D9_INT_ *lpInt; +/* 0x0024 */ struct _DIRECT3D9_INT *lpInt; /* 0x0028 */ LONG lRefCnt; /* Increases and decreases by AddRef() and Release() */ /* 0x002c */ UINT NumDisplayAdapters; /* 0x0030 */ Direct3D9DisplayAdapterInfo DisplayAdapters[D3D9_INT_MAX_NUM_ADAPTERS]; @@ -2667,6 +2667,6 @@ typedef struct _tagDIRECT3D9_INT_ /* 0x47ac */ DWORD unknown004587; /* 0x47b0 */ DWORD unknown004588; /* 0x47b4 */ UINT SDKVersion; -} DIRECT3D9_INT, *LPDIRECT3D9_INT; +} DIRECT3D9_INT, FAR *LPDIRECT3D9_INT; #endif // _D3D9_PRIVATE_H_ diff --git a/reactos/dll/directx/d3d9/d3d9_puredevice.c b/reactos/dll/directx/d3d9/d3d9_puredevice.c new file mode 100644 index 00000000000..a70aceeecea --- /dev/null +++ b/reactos/dll/directx/d3d9/d3d9_puredevice.c @@ -0,0 +1,859 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS ReactX + * FILE: dll/directx/d3d9/d3d9_puredevice.c + * PURPOSE: d3d9.dll internal device functions + * PROGRAMERS: Gregor Gullwi + */ +#include "d3d9_puredevice.h" +#include + +#define LOCK_D3DDEVICE9() if (This->bLockDevice) EnterCriticalSection(&This->CriticalSection); +#define UNLOCK_D3DDEVICE9() if (This->bLockDevice) LeaveCriticalSection(&This->CriticalSection); + +/* Convert a IDirect3D9 pointer safely to the internal implementation struct */ +/*static LPD3D9PUREDEVICE IDirect3DDevice9ToImpl(LPDIRECT3DDEVICE9 iface) +{ + if (NULL == iface) + return NULL; + + return (LPD3D9PUREDEVICE)((ULONG_PTR)iface - FIELD_OFFSET(D3D9PUREDEVICE, BaseDevice.lpVtbl)); +}*/ + +/* IDirect3DDevice9 public interface */ +HRESULT WINAPI IDirect3DDevice9Pure_SetRenderTarget(LPDIRECT3DDEVICE9 iface, DWORD RenderTargetIndex, IDirect3DSurface9* pRenderTarget) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_GetRenderTarget(LPDIRECT3DDEVICE9 iface, DWORD RenderTargetIndex,IDirect3DSurface9** ppRenderTarget) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetDepthStencilSurface(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pNewZStencil) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_GetDepthStencilSurface(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9** ppZStencilSurface) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_BeginScene(LPDIRECT3DDEVICE9 iface) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_EndScene(LPDIRECT3DDEVICE9 iface) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_Clear(LPDIRECT3DDEVICE9 iface, DWORD Count, CONST D3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetTransform(LPDIRECT3DDEVICE9 iface, D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_GetTransform(LPDIRECT3DDEVICE9 iface, D3DTRANSFORMSTATETYPE State, D3DMATRIX* pMatrix) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_MultiplyTransform(LPDIRECT3DDEVICE9 iface, D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetViewport(LPDIRECT3DDEVICE9 iface, CONST D3DVIEWPORT9* pViewport) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_GetViewport(LPDIRECT3DDEVICE9 iface, D3DVIEWPORT9* pViewport) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetMaterial(LPDIRECT3DDEVICE9 iface, CONST D3DMATERIAL9* pMaterial) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_GetMaterial(LPDIRECT3DDEVICE9 iface, D3DMATERIAL9* pMaterial) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetLight(LPDIRECT3DDEVICE9 iface, DWORD Index, CONST D3DLIGHT9* pLight) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_GetLight(LPDIRECT3DDEVICE9 iface, DWORD Index, D3DLIGHT9* pLight) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_LightEnable(LPDIRECT3DDEVICE9 iface, DWORD Index, BOOL Enable) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_GetLightEnable(LPDIRECT3DDEVICE9 iface, DWORD Index, BOOL* pEnable) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetClipPlane(LPDIRECT3DDEVICE9 iface, DWORD Index, CONST float* pPlane) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_GetClipPlane(LPDIRECT3DDEVICE9 iface, DWORD Index, float* pPlane) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetRenderState(LPDIRECT3DDEVICE9 iface, D3DRENDERSTATETYPE State, DWORD Value) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_GetRenderState(LPDIRECT3DDEVICE9 iface, D3DRENDERSTATETYPE State, DWORD* pValue) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_CreateStateBlock(LPDIRECT3DDEVICE9 iface, D3DSTATEBLOCKTYPE Type, IDirect3DStateBlock9** ppSB) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_BeginStateBlock(LPDIRECT3DDEVICE9 iface) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_EndStateBlock(LPDIRECT3DDEVICE9 iface, IDirect3DStateBlock9** ppSB) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetClipStatus(LPDIRECT3DDEVICE9 iface, CONST D3DCLIPSTATUS9* pClipStatus) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_GetClipStatus(LPDIRECT3DDEVICE9 iface, D3DCLIPSTATUS9* pClipStatus) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_GetTexture(LPDIRECT3DDEVICE9 iface, DWORD Stage, IDirect3DBaseTexture9** ppTexture) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetTexture(LPDIRECT3DDEVICE9 iface, DWORD Stage, IDirect3DBaseTexture9* pTexture) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_GetTextureStageState(LPDIRECT3DDEVICE9 iface, DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetTextureStageState(LPDIRECT3DDEVICE9 iface, DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_GetSamplerState(LPDIRECT3DDEVICE9 iface, DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD* pValue) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetSamplerState(LPDIRECT3DDEVICE9 iface, DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_ValidateDevice(LPDIRECT3DDEVICE9 iface, DWORD* pNumPasses) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetPaletteEntries(LPDIRECT3DDEVICE9 iface, UINT PaletteNumber, CONST PALETTEENTRY* pEntries) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_GetPaletteEntries(LPDIRECT3DDEVICE9 iface, UINT PaletteNumber, PALETTEENTRY* pEntries) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetCurrentTexturePalette(LPDIRECT3DDEVICE9 iface, UINT PaletteNumber) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_GetCurrentTexturePalette(LPDIRECT3DDEVICE9 iface, UINT* pPaletteNumber) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetScissorRect(LPDIRECT3DDEVICE9 iface, CONST RECT* pRect) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_GetScissorRect(LPDIRECT3DDEVICE9 iface, RECT* pRect) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetSoftwareVertexProcessing(LPDIRECT3DDEVICE9 iface, BOOL bSoftware) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +BOOL WINAPI IDirect3DDevice9Pure_GetSoftwareVertexProcessing(LPDIRECT3DDEVICE9 iface) +{ + UNIMPLEMENTED + + return TRUE; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetNPatchMode(LPDIRECT3DDEVICE9 iface, float nSegments) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +float WINAPI IDirect3DDevice9Pure_GetNPatchMode(LPDIRECT3DDEVICE9 iface) +{ + UNIMPLEMENTED + + return 0.0f; +} + +HRESULT WINAPI IDirect3DDevice9Pure_DrawPrimitive(LPDIRECT3DDEVICE9 iface, D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_DrawIndexedPrimitive(LPDIRECT3DDEVICE9 iface, D3DPRIMITIVETYPE PrimitiveType, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_DrawPrimitiveUP(LPDIRECT3DDEVICE9 iface, D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_DrawIndexedPrimitiveUP(LPDIRECT3DDEVICE9 iface, D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertices, UINT PrimitiveCount, CONST void* pIndexData, D3DFORMAT IndexDataFormat, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_ProcessVertices(LPDIRECT3DDEVICE9 iface, UINT SrcStartIndex, UINT DestIndex, UINT VertexCount, IDirect3DVertexBuffer9* pDestBuffer, IDirect3DVertexDeclaration9* pVertexDecl, DWORD Flags) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_CreateVertexDeclaration(LPDIRECT3DDEVICE9 iface, CONST D3DVERTEXELEMENT9* pVertexElements, IDirect3DVertexDeclaration9** ppDecl) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetVertexDeclaration(LPDIRECT3DDEVICE9 iface, IDirect3DVertexDeclaration9* pDecl) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_GetVertexDeclaration(LPDIRECT3DDEVICE9 iface, IDirect3DVertexDeclaration9** ppDecl) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetFVF(LPDIRECT3DDEVICE9 iface, DWORD FVF) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_GetFVF(LPDIRECT3DDEVICE9 iface, DWORD* pFVF) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_CreateVertexShader(LPDIRECT3DDEVICE9 iface, CONST DWORD* pFunction, IDirect3DVertexShader9** ppShader) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetVertexShader(LPDIRECT3DDEVICE9 iface, IDirect3DVertexShader9* pShader) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_GetVertexShader(LPDIRECT3DDEVICE9 iface, IDirect3DVertexShader9** ppShader) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetVertexShaderConstantF(LPDIRECT3DDEVICE9 iface, UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_GetVertexShaderConstantF(LPDIRECT3DDEVICE9 iface, UINT StartRegister, float* pConstantData, UINT Vector4fCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetVertexShaderConstantI(LPDIRECT3DDEVICE9 iface, UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_GetVertexShaderConstantI(LPDIRECT3DDEVICE9 iface, UINT StartRegister, int* pConstantData, UINT Vector4iCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetVertexShaderConstantB(LPDIRECT3DDEVICE9 iface, UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_GetVertexShaderConstantB(LPDIRECT3DDEVICE9 iface, UINT StartRegister, BOOL* pConstantData, UINT BoolCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetStreamSource(LPDIRECT3DDEVICE9 iface, UINT StreamNumber, IDirect3DVertexBuffer9* pStreamData, UINT OffsetInBytes, UINT Stride) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_GetStreamSource(LPDIRECT3DDEVICE9 iface, UINT StreamNumber, IDirect3DVertexBuffer9** ppStreamData, UINT* pOffsetInBytes, UINT* pStride) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetStreamSourceFreq(LPDIRECT3DDEVICE9 iface, UINT StreamNumber,UINT Setting) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_GetStreamSourceFreq(LPDIRECT3DDEVICE9 iface, UINT StreamNumber, UINT* pSetting) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetIndices(LPDIRECT3DDEVICE9 iface, IDirect3DIndexBuffer9* pIndexData) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_GetIndices(LPDIRECT3DDEVICE9 iface, IDirect3DIndexBuffer9** ppIndexData) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_CreatePixelShader(LPDIRECT3DDEVICE9 iface, CONST DWORD* pFunction, IDirect3DPixelShader9** ppShader) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetPixelShader(LPDIRECT3DDEVICE9 iface, IDirect3DPixelShader9* pShader) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_GetPixelShader(LPDIRECT3DDEVICE9 iface, IDirect3DPixelShader9** ppShader) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetPixelShaderConstantF(LPDIRECT3DDEVICE9 iface, UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_GetPixelShaderConstantF(LPDIRECT3DDEVICE9 iface, UINT StartRegister, float* pConstantData, UINT Vector4fCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetPixelShaderConstantI(LPDIRECT3DDEVICE9 iface, UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_GetPixelShaderConstantI(LPDIRECT3DDEVICE9 iface, UINT StartRegister, int* pConstantData, UINT Vector4iCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetPixelShaderConstantB(LPDIRECT3DDEVICE9 iface, UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_GetPixelShaderConstantB(LPDIRECT3DDEVICE9 iface, UINT StartRegister, BOOL* pConstantData, UINT BoolCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_DrawRectPatch(LPDIRECT3DDEVICE9 iface, UINT Handle, CONST float* pNumSegs, CONST D3DRECTPATCH_INFO* pRectPatchInfo) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_DrawTriPatch(LPDIRECT3DDEVICE9 iface, UINT Handle, CONST float* pNumSegs, CONST D3DTRIPATCH_INFO* pTriPatchInfo) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_DeletePatch(LPDIRECT3DDEVICE9 iface, UINT Handle) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_CreateQuery(LPDIRECT3DDEVICE9 iface, D3DQUERYTYPE Type, IDirect3DQuery9** ppQuery) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +/* IDirect3DDevice9 private interface */ +HRESULT WINAPI IDirect3DDevice9Pure_SetRenderStateWorker(LPDIRECT3DDEVICE9 iface, D3DRENDERSTATETYPE State, DWORD Value) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetTextureStageStateInt(LPDIRECT3DDEVICE9 iface, DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetSamplerStateInt(LPDIRECT3DDEVICE9 iface, DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetMaterialInt(LPDIRECT3DDEVICE9 iface, CONST D3DMATERIAL9* pMaterial) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetVertexShaderInt(LPDIRECT3DDEVICE9 iface, IDirect3DVertexShader9* pShader) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetVertexShaderConstantFInt(LPDIRECT3DDEVICE9 iface, UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetVertexShaderConstantIInt(LPDIRECT3DDEVICE9 iface, UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetVertexShaderConstantBInt(LPDIRECT3DDEVICE9 iface, UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetPixelShaderInt(LPDIRECT3DDEVICE9 iface, IDirect3DPixelShader9* pShader) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetPixelShaderConstantFInt(LPDIRECT3DDEVICE9 iface, UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetPixelShaderConstantIInt(LPDIRECT3DDEVICE9 iface, UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetPixelShaderConstantBInt(LPDIRECT3DDEVICE9 iface, UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetFVFInt(LPDIRECT3DDEVICE9 iface, DWORD FVF) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetTextureInt(LPDIRECT3DDEVICE9 iface, DWORD Stage,IDirect3DBaseTexture9* pTexture) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetIndicesInt(LPDIRECT3DDEVICE9 iface, IDirect3DIndexBuffer9* pIndexData) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetStreamSourceInt(LPDIRECT3DDEVICE9 iface, UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetStreamSourceFreqInt(LPDIRECT3DDEVICE9 iface, UINT StreamNumber,UINT Setting) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +VOID WINAPI IDirect3DDevice9Pure_UpdateRenderState(LPDIRECT3DDEVICE9 iface, DWORD Unknown1, DWORD Unknown2) +{ + UNIMPLEMENTED +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetTransformInt(LPDIRECT3DDEVICE9 iface, D3DTRANSFORMSTATETYPE State,CONST D3DMATRIX* pMatrix) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_MultiplyTransformInt(LPDIRECT3DDEVICE9 iface, D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetClipPlaneInt(LPDIRECT3DDEVICE9 iface, DWORD Index, CONST float* pPlane) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +VOID WINAPI IDirect3DDevice9Pure_UpdateDriverState(LPDIRECT3DDEVICE9 iface) +{ + UNIMPLEMENTED +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetViewportInt(LPDIRECT3DDEVICE9 iface, CONST D3DVIEWPORT9* pViewport) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +VOID WINAPI IDirect3DDevice9Pure_SetStreamSourceWorker(LPDIRECT3DDEVICE9 iface, LPVOID UnknownStreamData) +{ + UNIMPLEMENTED +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetPixelShaderConstantFWorker(LPDIRECT3DDEVICE9 iface, UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetPixelShaderConstantIWorker(LPDIRECT3DDEVICE9 iface, UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetPixelShaderConstantBWorker(LPDIRECT3DDEVICE9 iface, UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +VOID WINAPI IDirect3DDevice9Pure_DrawPrimitiveWorker(LPDIRECT3DDEVICE9 iface, D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount) +{ + UNIMPLEMENTED +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetLightInt(LPDIRECT3DDEVICE9 iface, DWORD Index, CONST D3DLIGHT9* pLight) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_LightEnableInt(LPDIRECT3DDEVICE9 iface, DWORD Index, BOOL Enable) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_SetRenderStateInt(LPDIRECT3DDEVICE9 iface, D3DRENDERSTATETYPE State, DWORD Value) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_DrawPrimitiveUPInt(LPDIRECT3DDEVICE9 iface, D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_ClearInt(LPDIRECT3DDEVICE9 iface, DWORD Count, CONST D3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +VOID WINAPI IDirect3DDevice9Pure_DrawPrimitivesWorker(LPDIRECT3DDEVICE9 iface) +{ + UNIMPLEMENTED +} + +VOID WINAPI IDirect3DDevice9Pure_UpdateVertexShader(LPDIRECT3DDEVICE9 iface) +{ + UNIMPLEMENTED +} + +HRESULT WINAPI IDirect3DDevice9Pure_ValidateDrawCall(LPDIRECT3DDEVICE9 iface, D3DPRIMITIVETYPE PrimitiveType, UINT Unknown1, UINT Unknown2, UINT Unknown3, INT Unknown4, UINT Unknown5, INT Unknown6) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +HRESULT WINAPI IDirect3DDevice9Pure_Init(LPDIRECT3DDEVICE9 iface) +{ + UNIMPLEMENTED + + return D3D_OK; +} + +VOID WINAPI IDirect3DDevice9Pure_InitState(LPDIRECT3DDEVICE9 iface, INT State) +{ + UNIMPLEMENTED +} + +VOID WINAPI IDirect3DDevice9Pure_Destroy(LPDIRECT3DDEVICE9 iface) +{ + UNIMPLEMENTED +} + +VOID WINAPI IDirect3DDevice9Pure_VirtualDestructor(LPDIRECT3DDEVICE9 iface) +{ + UNIMPLEMENTED +} diff --git a/reactos/dll/directx/d3d9/d3d9_puredevice.h b/reactos/dll/directx/d3d9/d3d9_puredevice.h new file mode 100644 index 00000000000..fea2d889288 --- /dev/null +++ b/reactos/dll/directx/d3d9/d3d9_puredevice.h @@ -0,0 +1,418 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS ReactX + * FILE: dll/directx/d3d9/d3d9_haldevice.h + * PURPOSE: d3d9.dll internal device structures + * PROGRAMERS: Gregor Gullwi + */ +#ifndef _D3D9_PUREDEVICE_H_ +#define _D3D9_PUREDEVICE_H_ + +#include "d3d9_device.h" + +typedef struct _D3D9PUREDEVICE +{ +/* 0x0000 - 0x0000 */ DIRECT3DDEVICE9_INT BaseDevice; +/* 0x1f48 */ DWORD unknown002002; +/* 0x1f4c */ DWORD unknown002003; +/* 0x1f50 */ DWORD unknown002004; +/* 0x1f54 */ DWORD unknown002005; +/* 0x1f58 */ DWORD unknown002006; +/* 0x1f5c */ DWORD unknown002007; +/* 0x1f60 */ DWORD unknown002008; +/* 0x1f64 */ DWORD unknown002009; +/* 0x1f68 */ DWORD unknown002010; +/* 0x1f6c */ DWORD unknown002011; +/* 0x1f70 */ DWORD unknown002012; +/* 0x1f74 */ DWORD unknown002013; +/* 0x1f78 */ DWORD unknown002014; +/* 0x1f7c */ DWORD unknown002015; +/* 0x1f80 */ DWORD unknown002016; +/* 0x1f84 */ DWORD unknown002017; +/* 0x1f88 */ DWORD unknown002018; +/* 0x1f8c */ DWORD unknown002019; +/* 0x1f90 */ DWORD unknown002020; +/* 0x1f94 */ DWORD unknown002021; +/* 0x1f98 */ DWORD unknown002022; +/* 0x1f9c */ DWORD unknown002023; +/* 0x1fa0 */ DWORD unknown002024; +/* 0x1fa4 */ DWORD unknown002025; +/* 0x1fa8 - 0x1fe0 */ DWORD unknown002026; +/* 0x1fac */ DWORD unknown002027; +/* 0x1fb0 */ LPDWORD unknown002028; +/* 0x1fb4 */ DWORD unknown002029; +/* 0x1fb8 */ DWORD unknown002030; +/* 0x1fbc */ DWORD unknown002031; +/* 0x1fc0 */ DWORD unknown002032; +/* 0x1fc4 */ DWORD unknown002033; +/* 0x1fc8 */ DWORD unknown002034; +/* 0x1fcc */ DWORD unknown002035; +/* 0x1fd0 */ DWORD unknown002036; +/* 0x1fd4 */ DWORD unknown002037; +/* 0x1fd8 */ DWORD unknown002038; +/* 0x1fdc */ DWORD unknown002039; +/* 0x1fe0 */ DWORD unknown002040; +/* 0x1fe4 */ DWORD unknown002041; +/* 0x1fe8 */ DWORD unknown002042; +/* 0x1fec */ DWORD unknown002043; +/* 0x1ff0 */ DWORD unknown002044; +/* 0x1ff4 */ DWORD unknown002045; +/* 0x1ff8 */ DWORD unknown002046; +/* 0x1ffc */ DWORD unknown002047; +/* 0x2000 */ DWORD unknown002048; +/* 0x2004 */ DWORD unknown002049; +/* 0x2008 */ DWORD unknown002050; +/* 0x200c */ DWORD unknown002051; +/* 0x2010 */ DWORD unknown002052; +/* 0x2014 */ DWORD unknown002053; +/* 0x2018 */ DWORD unknown002054; +/* 0x201c */ DWORD unknown002055; +/* 0x2020 */ DWORD unknown002056; +/* 0x2024 */ DWORD unknown002057; +/* 0x2028 */ DWORD unknown002058; +/* 0x202c */ DWORD unknown002059; +/* 0x2030 */ DWORD unknown002060; +/* 0x2034 */ DWORD unknown002061; +/* 0x2038 */ DWORD unknown002062; +/* 0x203c */ DWORD unknown002063; +/* 0x2040 */ DWORD unknown002064; +/* 0x2044 */ DWORD unknown002065; +/* 0x2048 */ DWORD unknown002066; +/* 0x204c */ DWORD unknown002067; +/* 0x2050 */ DWORD unknown002068; +/* 0x2054 */ DWORD unknown002069; +/* 0x2058 */ DWORD unknown002070; +/* 0x205c */ DWORD unknown002071; +/* 0x2060 */ DWORD unknown002072; +/* 0x2064 */ DWORD unknown002073; +/* 0x2068 */ DWORD unknown002074; +/* 0x206c */ DWORD unknown002075; +/* 0x2070 */ DWORD unknown002076; +/* 0x2074 */ DWORD unknown002077; +/* 0x2078 */ DWORD unknown002078; +/* 0x207c */ DWORD unknown002079; +/* 0x2080 */ DWORD unknown002080; +/* 0x2084 */ DWORD unknown002081; +/* 0x2088 */ DWORD unknown002082; +/* 0x208c */ DWORD unknown002083; // SurfaceManager? +/* 0x2090 */ DWORD unknown002084; +/* 0x2094 */ DWORD unknown002085; +/* 0x2098 */ DWORD unknown002086; +/* 0x209c */ DWORD unknown002087; +/* 0x20a0 */ DWORD unknown002088; +/* 0x20a4 */ DWORD unknown002089; +/* 0x20a8 */ DWORD unknown002090; +/* 0x20ac */ DWORD unknown002091; +/* 0x20b0 */ DWORD unknown002092; +/* 0x20b4 */ DWORD unknown002093; +/* 0x20b8 */ DWORD unknown002094; +/* 0x20bc */ DWORD unknown002095; +/* 0x20c0 */ DWORD unknown002096; +/* 0x20c4 */ DWORD unknown002097; +/* 0x20c8 */ DWORD unknown002098; +/* 0x20cc */ DWORD unknown002099; +/* 0x20d0 */ DWORD unknown002100; // VSOutputDecl? +/* 0x20d4 */ DWORD unknown002101; +/* 0x20d8 */ DWORD unknown002102; +/* 0x20dc */ DWORD unknown002103; +/* 0x20e0 */ DWORD unknown002104; +/* 0x20e4 */ DWORD unknown002105; +/* 0x20e8 */ DWORD unknown002106; +/* 0x20ec */ DWORD unknown002107; +/* 0x20f0 */ DWORD unknown002108; +/* 0x20f4 */ DWORD unknown002109; +/* 0x20f8 */ DWORD unknown002110; +/* 0x20fc */ DWORD unknown002111; +/* 0x2100 */ DWORD unknown002112; +/* 0x2104 */ DWORD unknown002113; +/* 0x2108 */ DWORD unknown002114; +/* 0x210c */ DWORD unknown002115; +/* 0x2110 */ DWORD unknown002116; +/* 0x2114 */ DWORD unknown002117; +/* 0x2118 */ DWORD unknown002118; +/* 0x211c */ DWORD unknown002119; +/* 0x2120 */ DWORD unknown002120; +/* 0x2124 */ DWORD unknown002121; +/* 0x2128 */ DWORD unknown002122; +/* 0x212c */ DWORD unknown002123; +/* 0x2130 */ DWORD unknown002124; +/* 0x2134 */ DWORD unknown002125; +/* 0x2138 */ DWORD unknown002126; +/* 0x213c */ DWORD unknown002127; +/* 0x2140 */ DWORD unknown002128; +/* 0x2144 */ DWORD unknown002129; +/* 0x2148 */ DWORD unknown002130; +/* 0x214c */ DWORD unknown002131; +/* 0x2150 */ DWORD unknown002132; +/* 0x2154 */ DWORD unknown002133; +/* 0x2158 */ DWORD unknown002134; +/* 0x215c */ DWORD unknown002135; +/* 0x2160 */ DWORD unknown002136; +/* 0x2164 */ DWORD unknown002137; +/* 0x2168 */ DWORD unknown002138; +/* 0x216c */ DWORD unknown002139; +/* 0x2170 */ DWORD unknown002140; +/* 0x2174 */ DWORD unknown002141; +/* 0x2178 */ DWORD unknown002142; +/* 0x217c */ DWORD unknown002143; +/* 0x2180 */ DWORD unknown002144; +/* 0x2184 */ DWORD unknown002145; +/* 0x2188 */ DWORD unknown002146; +/* 0x218c */ DWORD unknown002147; +/* 0x2190 */ DWORD unknown002148; +/* 0x2194 */ DWORD unknown002149; +/* 0x2198 */ DWORD unknown002150; +/* 0x219c */ DWORD unknown002151; +/* 0x21a0 */ DWORD unknown002152; +/* 0x21a4 */ DWORD unknown002153; +/* 0x21a8 */ DWORD unknown002154; +/* 0x21ac */ DWORD unknown002155; +/* 0x21b0 */ DWORD unknown002156; +/* 0x21b4 */ DWORD unknown002157; +/* 0x21b8 */ DWORD unknown002158; +/* 0x21bc */ DWORD unknown002159; +/* 0x21c0 */ DWORD unknown002160; +/* 0x21c4 */ DWORD unknown002161; +/* 0x21c8 */ DWORD unknown002162; +/* 0x21cc */ DWORD unknown002163; +/* 0x21d0 */ DWORD unknown002164; +/* 0x21d4 */ DWORD unknown002165; +/* 0x21d8 */ DWORD unknown002166; +/* 0x21dc */ DWORD unknown002167; +/* 0x21e0 */ DWORD unknown002168; +/* 0x21e4 */ DWORD unknown002169; +/* 0x21e8 */ DWORD unknown002170; +/* 0x21ec */ DWORD unknown002171; +/* 0x21f0 */ DWORD unknown002172; +/* 0x21f4 */ DWORD unknown002173; +/* 0x21f8 */ DWORD unknown002174; +/* 0x21fc */ DWORD unknown002175; +/* 0x2200 */ DWORD unknown002176; +/* 0x2204 */ DWORD unknown002177; +/* 0x2208 */ DWORD unknown002178; +/* 0x220c */ DWORD unknown002179; +/* 0x2210 */ DWORD unknown002180; +/* 0x2214 */ DWORD unknown002181; +/* 0x2218 */ DWORD unknown002182; +/* 0x221c */ DWORD unknown002183; +/* 0x2220 */ DWORD unknown002184; +/* 0x2224 */ DWORD unknown002185; +/* 0x2228 */ DWORD unknown002186; +/* 0x222c */ DWORD unknown002187; +/* 0x2230 */ DWORD unknown002188; +/* 0x2234 */ DWORD unknown002189; +/* 0x2238 */ DWORD unknown002190; +/* 0x223c */ DWORD unknown002191; +/* 0x2240 */ DWORD unknown002192; +/* 0x2244 */ DWORD unknown002193; +/* 0x2248 */ DWORD unknown002194; +/* 0x224c */ DWORD unknown002195; +/* 0x2250 */ DWORD unknown002196; +/* 0x2254 */ DWORD unknown002197; +/* 0x2258 */ DWORD unknown002198; +/* 0x225c */ DWORD unknown002199; +/* 0x2260 */ DWORD unknown002200; +/* 0x2264 */ DWORD unknown002201; +/* 0x2268 */ DWORD unknown002202; +/* 0x226c */ DWORD unknown002203; +/* 0x2270 */ DWORD unknown002204; +/* 0x2274 */ DWORD unknown002205; +/* 0x2278 */ DWORD unknown002206; +/* 0x227c */ DWORD unknown002207; +/* 0x2280 */ DWORD unknown002208; +/* 0x2284 */ DWORD unknown002209; +/* 0x2288 */ DWORD unknown002210; +/* 0x228c */ DWORD unknown002211; +/* 0x2290 */ DWORD unknown002212; +/* 0x2294 */ DWORD unknown002213; +/* 0x2298 */ DWORD unknown002214; +/* 0x229c */ DWORD unknown002215; +/* 0x22a0 */ DWORD unknown002216; +/* 0x22a4 */ DWORD unknown002217; +/* 0x22a8 */ DWORD unknown002218; +/* 0x22ac */ DWORD unknown002219; +/* 0x22b0 */ DWORD unknown002220; +/* 0x22b4 */ DWORD unknown002221; +/* 0x22b8 */ DWORD unknown002222; +/* 0x22bc */ DWORD unknown002223; +/* 0x22c0 */ DWORD unknown002224; +/* 0x22c4 */ DWORD unknown002225; +/* 0x22c8 */ DWORD unknown002226; +/* 0x22cc */ DWORD unknown002227; +/* 0x22d0 */ DWORD unknown002228; +/* 0x22d4 */ DWORD unknown002229; +/* 0x22d8 */ DWORD unknown002230; +/* 0x22dc */ DWORD unknown002231; +/* 0x22e0 */ DWORD unknown002232; +/* 0x22e4 */ DWORD unknown002233; +/* 0x22e8 */ DWORD unknown002234; +/* 0x22ec */ DWORD unknown002235; +/* 0x22f0 */ DWORD unknown002236; +/* 0x22f4 */ DWORD unknown002237; +/* 0x22f8 */ DWORD unknown002238; +/* 0x22fc */ DWORD unknown002239; +/* 0x2300 */ DWORD unknown002240; +/* 0x2304 */ DWORD unknown002241; +/* 0x2308 */ DWORD unknown002242; +/* 0x230c */ DWORD unknown002243; +/* 0x2310 */ DWORD unknown002244; +/* 0x2314 */ DWORD unknown002245; +/* 0x2318 */ DWORD unknown002246; +/* 0x231c */ DWORD unknown002247; +/* 0x2320 */ DWORD unknown002248; +/* 0x2324 */ DWORD unknown002249; +/* 0x2328 */ DWORD unknown002250; +/* 0x232c */ DWORD unknown002251; +/* 0x2330 */ DWORD unknown002252; +/* 0x2334 */ DWORD unknown002253; +/* 0x2338 */ DWORD unknown002254; +/* 0x233c */ DWORD unknown002255; +/* 0x2340 */ DWORD unknown002256; +/* 0x2344 */ DWORD unknown002257; +/* 0x2348 */ DWORD unknown002258; +/* 0x234c */ DWORD unknown002259; +/* 0x2350 */ DWORD unknown002260; +/* 0x2354 */ DWORD unknown002261; +/* 0x2358 */ DWORD unknown002262; +/* 0x235c */ DWORD unknown002263; +/* 0x2360 */ DWORD unknown002264; +/* 0x2364 */ DWORD unknown002265; +/* 0x2368 */ DWORD unknown002266; +/* 0x236c */ DWORD unknown002267; +/* 0x2370 */ DWORD unknown002268; +/* 0x2374 */ DWORD unknown002269; +/* 0x2378 */ DWORD unknown002270; +/* 0x237c */ DWORD unknown002271; +/* 0x2380 */ DWORD unknown002272; +/* 0x2384 */ DWORD unknown002273; +/* 0x2388 */ DWORD unknown002274; +/* 0x238c */ DWORD unknown002275; +/* 0x2390 */ DWORD unknown002276; +/* 0x2394 */ DWORD unknown002277; +/* 0x2398 */ DWORD unknown002278; +/* 0x239c */ DWORD unknown002279; +/* 0x23a0 */ DWORD unknown002280; +/* 0x23a4 */ DWORD unknown002281; +/* 0x23a8 */ DWORD unknown002282; +/* 0x23ac */ DWORD unknown002283; +/* 0x23b0 */ DWORD unknown002284; +/* 0x23b4 */ DWORD unknown002285; +/* 0x23b8 */ DWORD unknown002286; +/* 0x23bc */ DWORD unknown002287; +/* 0x23c0 */ DWORD unknown002288; +/* 0x23c4 */ DWORD unknown002289; +/* 0x23c8 */ DWORD unknown002290; +/* 0x23cc */ DWORD unknown002291; +/* 0x23d0 */ DWORD unknown002292; +/* 0x23d4 */ DWORD unknown002293; +/* 0x23d8 */ DWORD unknown002294; +/* 0x23dc */ DWORD unknown002295; +/* 0x23e0 */ DWORD unknown002296; +/* 0x23e4 */ DWORD unknown002297; +/* 0x23e8 */ DWORD unknown002298; +/* 0x23ec */ DWORD unknown002299; +/* 0x23f0 */ DWORD unknown002300; +/* 0x23f4 */ DWORD unknown002301; +/* 0x23f8 */ DWORD unknown002302; +/* 0x23fc */ DWORD unknown002303; +/* 0x2400 */ DWORD unknown002304; +/* 0x2404 */ DWORD unknown002305; +/* 0x2408 */ DWORD unknown002306; +/* 0x240c */ DWORD unknown002307; +/* 0x2410 */ DWORD unknown002308; +/* 0x2414 */ DWORD unknown002309; +/* 0x2418 */ DWORD unknown002310; +/* 0x241c */ DWORD unknown002311; +/* 0x2420 */ DWORD unknown002312; +/* 0x2424 */ DWORD unknown002313; +/* 0x2428 */ DWORD unknown002314; +/* 0x242c */ DWORD unknown002315; +/* 0x2430 */ DWORD unknown002316; +/* 0x2434 */ DWORD unknown002317; +} D3D9PUREDEVICE, FAR *LPD3D9PUREDEVICE; + +/* IDirect3D9Device public interface */ +HRESULT WINAPI IDirect3DDevice9Pure_SetRenderTarget(LPDIRECT3DDEVICE9 iface, DWORD RenderTargetIndex, IDirect3DSurface9* pRenderTarget); +HRESULT WINAPI IDirect3DDevice9Pure_GetRenderTarget(LPDIRECT3DDEVICE9 iface, DWORD RenderTargetIndex,IDirect3DSurface9** ppRenderTarget); +HRESULT WINAPI IDirect3DDevice9Pure_SetDepthStencilSurface(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pNewZStencil); +HRESULT WINAPI IDirect3DDevice9Pure_GetDepthStencilSurface(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9** ppZStencilSurface); +HRESULT WINAPI IDirect3DDevice9Pure_BeginScene(LPDIRECT3DDEVICE9 iface); +HRESULT WINAPI IDirect3DDevice9Pure_EndScene(LPDIRECT3DDEVICE9 iface); +HRESULT WINAPI IDirect3DDevice9Pure_Clear(LPDIRECT3DDEVICE9 iface, DWORD Count, CONST D3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil); +HRESULT WINAPI IDirect3DDevice9Pure_SetTransform(LPDIRECT3DDEVICE9 iface, D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix); +HRESULT WINAPI IDirect3DDevice9Pure_GetTransform(LPDIRECT3DDEVICE9 iface, D3DTRANSFORMSTATETYPE State, D3DMATRIX* pMatrix); +HRESULT WINAPI IDirect3DDevice9Pure_MultiplyTransform(LPDIRECT3DDEVICE9 iface, D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix); +HRESULT WINAPI IDirect3DDevice9Pure_SetViewport(LPDIRECT3DDEVICE9 iface, CONST D3DVIEWPORT9* pViewport); +HRESULT WINAPI IDirect3DDevice9Pure_GetViewport(LPDIRECT3DDEVICE9 iface, D3DVIEWPORT9* pViewport); +HRESULT WINAPI IDirect3DDevice9Pure_SetMaterial(LPDIRECT3DDEVICE9 iface, CONST D3DMATERIAL9* pMaterial); +HRESULT WINAPI IDirect3DDevice9Pure_GetMaterial(LPDIRECT3DDEVICE9 iface, D3DMATERIAL9* pMaterial); +HRESULT WINAPI IDirect3DDevice9Pure_SetLight(LPDIRECT3DDEVICE9 iface, DWORD Index, CONST D3DLIGHT9* pLight); +HRESULT WINAPI IDirect3DDevice9Pure_GetLight(LPDIRECT3DDEVICE9 iface, DWORD Index, D3DLIGHT9* pLight); +HRESULT WINAPI IDirect3DDevice9Pure_LightEnable(LPDIRECT3DDEVICE9 iface, DWORD Index, BOOL Enable); +HRESULT WINAPI IDirect3DDevice9Pure_GetLightEnable(LPDIRECT3DDEVICE9 iface, DWORD Index, BOOL* pEnable); +HRESULT WINAPI IDirect3DDevice9Pure_SetClipPlane(LPDIRECT3DDEVICE9 iface, DWORD Index, CONST float* pPlane); +HRESULT WINAPI IDirect3DDevice9Pure_GetClipPlane(LPDIRECT3DDEVICE9 iface, DWORD Index, float* pPlane); +HRESULT WINAPI IDirect3DDevice9Pure_SetRenderState(LPDIRECT3DDEVICE9 iface, D3DRENDERSTATETYPE State, DWORD Value); +HRESULT WINAPI IDirect3DDevice9Pure_GetRenderState(LPDIRECT3DDEVICE9 iface, D3DRENDERSTATETYPE State, DWORD* pValue); +HRESULT WINAPI IDirect3DDevice9Pure_CreateStateBlock(LPDIRECT3DDEVICE9 iface, D3DSTATEBLOCKTYPE Type, IDirect3DStateBlock9** ppSB); +HRESULT WINAPI IDirect3DDevice9Pure_BeginStateBlock(LPDIRECT3DDEVICE9 iface); +HRESULT WINAPI IDirect3DDevice9Pure_EndStateBlock(LPDIRECT3DDEVICE9 iface, IDirect3DStateBlock9** ppSB); +HRESULT WINAPI IDirect3DDevice9Pure_SetClipStatus(LPDIRECT3DDEVICE9 iface, CONST D3DCLIPSTATUS9* pClipStatus); +HRESULT WINAPI IDirect3DDevice9Pure_GetClipStatus(LPDIRECT3DDEVICE9 iface, D3DCLIPSTATUS9* pClipStatus); +HRESULT WINAPI IDirect3DDevice9Pure_GetTexture(LPDIRECT3DDEVICE9 iface, DWORD Stage, IDirect3DBaseTexture9** ppTexture); +HRESULT WINAPI IDirect3DDevice9Pure_SetTexture(LPDIRECT3DDEVICE9 iface, DWORD Stage, IDirect3DBaseTexture9* pTexture); +HRESULT WINAPI IDirect3DDevice9Pure_GetTextureStageState(LPDIRECT3DDEVICE9 iface, DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue); +HRESULT WINAPI IDirect3DDevice9Pure_SetTextureStageState(LPDIRECT3DDEVICE9 iface, DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value); +HRESULT WINAPI IDirect3DDevice9Pure_GetSamplerState(LPDIRECT3DDEVICE9 iface, DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD* pValue); +HRESULT WINAPI IDirect3DDevice9Pure_SetSamplerState(LPDIRECT3DDEVICE9 iface, DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value); +HRESULT WINAPI IDirect3DDevice9Pure_ValidateDevice(LPDIRECT3DDEVICE9 iface, DWORD* pNumPasses); +HRESULT WINAPI IDirect3DDevice9Pure_SetPaletteEntries(LPDIRECT3DDEVICE9 iface, UINT PaletteNumber, CONST PALETTEENTRY* pEntries); +HRESULT WINAPI IDirect3DDevice9Pure_GetPaletteEntries(LPDIRECT3DDEVICE9 iface, UINT PaletteNumber, PALETTEENTRY* pEntries); +HRESULT WINAPI IDirect3DDevice9Pure_SetCurrentTexturePalette(LPDIRECT3DDEVICE9 iface, UINT PaletteNumber); +HRESULT WINAPI IDirect3DDevice9Pure_GetCurrentTexturePalette(LPDIRECT3DDEVICE9 iface, UINT* pPaletteNumber); +HRESULT WINAPI IDirect3DDevice9Pure_SetScissorRect(LPDIRECT3DDEVICE9 iface, CONST RECT* pRect); +HRESULT WINAPI IDirect3DDevice9Pure_GetScissorRect(LPDIRECT3DDEVICE9 iface, RECT* pRect); +HRESULT WINAPI IDirect3DDevice9Pure_SetSoftwareVertexProcessing(LPDIRECT3DDEVICE9 iface, BOOL bSoftware); +BOOL WINAPI IDirect3DDevice9Pure_GetSoftwareVertexProcessing(LPDIRECT3DDEVICE9 iface); +HRESULT WINAPI IDirect3DDevice9Pure_SetNPatchMode(LPDIRECT3DDEVICE9 iface, float nSegments); +float WINAPI IDirect3DDevice9Pure_GetNPatchMode(LPDIRECT3DDEVICE9 iface); +HRESULT WINAPI IDirect3DDevice9Pure_DrawPrimitive(LPDIRECT3DDEVICE9 iface, D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount); +HRESULT WINAPI IDirect3DDevice9Pure_DrawIndexedPrimitive(LPDIRECT3DDEVICE9 iface, D3DPRIMITIVETYPE PrimitiveType, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount); +HRESULT WINAPI IDirect3DDevice9Pure_DrawPrimitiveUP(LPDIRECT3DDEVICE9 iface, D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride); +HRESULT WINAPI IDirect3DDevice9Pure_DrawIndexedPrimitiveUP(LPDIRECT3DDEVICE9 iface, D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertices, UINT PrimitiveCount, CONST void* pIndexData, D3DFORMAT IndexDataFormat, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride); +HRESULT WINAPI IDirect3DDevice9Pure_ProcessVertices(LPDIRECT3DDEVICE9 iface, UINT SrcStartIndex, UINT DestIndex, UINT VertexCount, IDirect3DVertexBuffer9* pDestBuffer, IDirect3DVertexDeclaration9* pVertexDecl, DWORD Flags); +HRESULT WINAPI IDirect3DDevice9Pure_CreateVertexDeclaration(LPDIRECT3DDEVICE9 iface, CONST D3DVERTEXELEMENT9* pVertexElements, IDirect3DVertexDeclaration9** ppDecl); +HRESULT WINAPI IDirect3DDevice9Pure_SetVertexDeclaration(LPDIRECT3DDEVICE9 iface, IDirect3DVertexDeclaration9* pDecl); +HRESULT WINAPI IDirect3DDevice9Pure_GetVertexDeclaration(LPDIRECT3DDEVICE9 iface, IDirect3DVertexDeclaration9** ppDecl); +HRESULT WINAPI IDirect3DDevice9Pure_SetFVF(LPDIRECT3DDEVICE9 iface, DWORD FVF); +HRESULT WINAPI IDirect3DDevice9Pure_GetFVF(LPDIRECT3DDEVICE9 iface, DWORD* pFVF); +HRESULT WINAPI IDirect3DDevice9Pure_CreateVertexShader(LPDIRECT3DDEVICE9 iface, CONST DWORD* pFunction, IDirect3DVertexShader9** ppShader); +HRESULT WINAPI IDirect3DDevice9Pure_SetVertexShader(LPDIRECT3DDEVICE9 iface, IDirect3DVertexShader9* pShader); +HRESULT WINAPI IDirect3DDevice9Pure_GetVertexShader(LPDIRECT3DDEVICE9 iface, IDirect3DVertexShader9** ppShader); +HRESULT WINAPI IDirect3DDevice9Pure_SetVertexShaderConstantF(LPDIRECT3DDEVICE9 iface, UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount); +HRESULT WINAPI IDirect3DDevice9Pure_GetVertexShaderConstantF(LPDIRECT3DDEVICE9 iface, UINT StartRegister, float* pConstantData, UINT Vector4fCount); +HRESULT WINAPI IDirect3DDevice9Pure_SetVertexShaderConstantI(LPDIRECT3DDEVICE9 iface, UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount); +HRESULT WINAPI IDirect3DDevice9Pure_GetVertexShaderConstantI(LPDIRECT3DDEVICE9 iface, UINT StartRegister, int* pConstantData, UINT Vector4iCount); +HRESULT WINAPI IDirect3DDevice9Pure_SetVertexShaderConstantB(LPDIRECT3DDEVICE9 iface, UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount); +HRESULT WINAPI IDirect3DDevice9Pure_GetVertexShaderConstantB(LPDIRECT3DDEVICE9 iface, UINT StartRegister, BOOL* pConstantData, UINT BoolCount); +HRESULT WINAPI IDirect3DDevice9Pure_SetStreamSource(LPDIRECT3DDEVICE9 iface, UINT StreamNumber, IDirect3DVertexBuffer9* pStreamData, UINT OffsetInBytes, UINT Stride); +HRESULT WINAPI IDirect3DDevice9Pure_GetStreamSource(LPDIRECT3DDEVICE9 iface, UINT StreamNumber, IDirect3DVertexBuffer9** ppStreamData, UINT* pOffsetInBytes, UINT* pStride); +HRESULT WINAPI IDirect3DDevice9Pure_SetStreamSourceFreq(LPDIRECT3DDEVICE9 iface, UINT StreamNumber,UINT Setting); +HRESULT WINAPI IDirect3DDevice9Pure_GetStreamSourceFreq(LPDIRECT3DDEVICE9 iface, UINT StreamNumber, UINT* pSetting); +HRESULT WINAPI IDirect3DDevice9Pure_SetIndices(LPDIRECT3DDEVICE9 iface, IDirect3DIndexBuffer9* pIndexData); +HRESULT WINAPI IDirect3DDevice9Pure_GetIndices(LPDIRECT3DDEVICE9 iface, IDirect3DIndexBuffer9** ppIndexData); +HRESULT WINAPI IDirect3DDevice9Pure_CreatePixelShader(LPDIRECT3DDEVICE9 iface, CONST DWORD* pFunction, IDirect3DPixelShader9** ppShader); +HRESULT WINAPI IDirect3DDevice9Pure_SetPixelShader(LPDIRECT3DDEVICE9 iface, IDirect3DPixelShader9* pShader); +HRESULT WINAPI IDirect3DDevice9Pure_GetPixelShader(LPDIRECT3DDEVICE9 iface, IDirect3DPixelShader9** ppShader); +HRESULT WINAPI IDirect3DDevice9Pure_SetPixelShaderConstantF(LPDIRECT3DDEVICE9 iface, UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount); +HRESULT WINAPI IDirect3DDevice9Pure_GetPixelShaderConstantF(LPDIRECT3DDEVICE9 iface, UINT StartRegister, float* pConstantData, UINT Vector4fCount); +HRESULT WINAPI IDirect3DDevice9Pure_SetPixelShaderConstantI(LPDIRECT3DDEVICE9 iface, UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount); +HRESULT WINAPI IDirect3DDevice9Pure_GetPixelShaderConstantI(LPDIRECT3DDEVICE9 iface, UINT StartRegister, int* pConstantData, UINT Vector4iCount); +HRESULT WINAPI IDirect3DDevice9Pure_SetPixelShaderConstantB(LPDIRECT3DDEVICE9 iface, UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount); +HRESULT WINAPI IDirect3DDevice9Pure_GetPixelShaderConstantB(LPDIRECT3DDEVICE9 iface, UINT StartRegister, BOOL* pConstantData, UINT BoolCount); +HRESULT WINAPI IDirect3DDevice9Pure_DrawRectPatch(LPDIRECT3DDEVICE9 iface, UINT Handle, CONST float* pNumSegs, CONST D3DRECTPATCH_INFO* pRectPatchInfo); +HRESULT WINAPI IDirect3DDevice9Pure_DrawTriPatch(LPDIRECT3DDEVICE9 iface, UINT Handle, CONST float* pNumSegs, CONST D3DTRIPATCH_INFO* pTriPatchInfo); +HRESULT WINAPI IDirect3DDevice9Pure_DeletePatch(LPDIRECT3DDEVICE9 iface, UINT Handle); +HRESULT WINAPI IDirect3DDevice9Pure_CreateQuery(LPDIRECT3DDEVICE9 iface, D3DQUERYTYPE Type, IDirect3DQuery9** ppQuery); + +#endif // _D3D9_PUREDEVICE_H_ diff --git a/reactos/dll/directx/d3d9/d3d9_surface.h b/reactos/dll/directx/d3d9/d3d9_surface.h new file mode 100644 index 00000000000..2a019811288 --- /dev/null +++ b/reactos/dll/directx/d3d9/d3d9_surface.h @@ -0,0 +1,60 @@ +#ifndef _D3D9_SURFACE_H_ +#define _D3D9_SURFACE_H_ + +#include "d3d9_baseobject.h" + +struct _D3D9BaseSurface; + +typedef struct _D3D9BaseSurfaceVtbl +{ + HRESULT (*QueryInterface)(struct _D3D9BaseSurface* iface, REFIID riid, LPVOID* ppvObject); + ULONG (*AddRef)(struct _D3D9BaseSurface* iface); + ULONG (*Release)(struct _D3D9BaseSurface* iface); + IDirect3DDevice9* (*GetDevice)(struct _D3D9BaseSurface* iface); + HRESULT (*SetPrivateData)(struct _D3D9BaseSurface* iface, REFIID riid, CONST LPVOID pData, DWORD DataSize, DWORD Flags); + HRESULT (*GetPrivateData)(struct _D3D9BaseSurface* iface, REFIID riid, LPVOID pData, DWORD* DataSize); + HRESULT (*FreePrivateData)(struct _D3D9BaseSurface* iface, REFIID riid); + DWORD (*SetPriority)(struct _D3D9BaseSurface* iface, DWORD NewPriority); + DWORD (*GetPriority)(struct _D3D9BaseSurface* iface); + VOID (*Load)(struct _D3D9BaseSurface* iface); + D3DRESOURCETYPE (*GetResourceType)(struct _D3D9BaseSurface* iface); + +} ID3D9BaseSurfaceVtbl; + + +typedef struct _D3D9BaseSurface +{ +/* 0x0020 */ ID3D9BaseSurfaceVtbl* lpVtbl; +/* 0x0024 */ D3DFORMAT DisplayFormat2; // Back buffer format? +/* 0x0028 */ DWORD dwUnknown0028; // Constant/ref count? (1) +/* 0x002c */ DWORD dwUnknown002c; // Refresh rate? +/* 0x0030 */ D3DPOOL SurfacePool; +/* 0x0034 */ DWORD dwUnknown0034; +/* 0x0038 */ DWORD dwUnknown0038; +/* 0x003c */ DWORD dwWidth; +/* 0x0040 */ DWORD dwHeight; +/* 0x0044 */ D3DPOOL ResourcePool; +/* 0x0048 */ D3DFORMAT DisplayFormat; +/* 0x004c */ DWORD dwUnknown004c; +/* 0x0050 */ DWORD dwUnknown0050; +/* 0x0054 */ DWORD dwUnknown0054; +/* 0x0058 */ DWORD dwBpp; +} D3D9BaseSurface; + +typedef struct _D3D9Surface +{ +/* 0x0000 */ D3D9BaseObject BaseObject; +/* 0x0020 */ D3D9BaseSurface BaseSurface; +} D3D9Surface; + +typedef struct _D3D9DriverSurface +{ +/* 0x0000 */ D3D9Surface BaseD3D9Surface; +/* 0x005c */ DWORD dwUnknown5c; +/* 0x0060 */ DWORD dwUnknown60; +/* 0x0064 */ struct _D3D9DriverSurface* pPreviousDriverSurface; +/* 0x0068 */ struct _D3D9DriverSurface* pNextDriverSurface; +/* 0x006c */ DWORD dwUnknown6c[8]; +} D3D9DriverSurface; + +#endif // _D3D9_SURFACE_H_ diff --git a/reactos/dll/directx/d3d9/d3d9_swapchain.c b/reactos/dll/directx/d3d9/d3d9_swapchain.c new file mode 100644 index 00000000000..28011da1354 --- /dev/null +++ b/reactos/dll/directx/d3d9/d3d9_swapchain.c @@ -0,0 +1,248 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS ReactX + * FILE: dll/directx/d3d9/d3d9_swapchain.c + * PURPOSE: Direct3D9's swap chain object + * PROGRAMERS: Gregor Gullwi + */ +#include "d3d9_swapchain.h" + +#include +#include + +#include "d3d9_helpers.h" +#include "d3d9_device.h" +#include "d3d9_cursor.h" + +#define LOCK_D3DDEVICE9() if (This->BaseObject.pUnknown && ((LPDIRECT3DDEVICE9_INT)This->BaseObject.pUnknown)->bLockDevice) \ + EnterCriticalSection(&((LPDIRECT3DDEVICE9_INT)This->BaseObject.pUnknown)->CriticalSection); +#define UNLOCK_D3DDEVICE9() if (This->BaseObject.pUnknown && ((LPDIRECT3DDEVICE9_INT)This->BaseObject.pUnknown)->bLockDevice) \ + LeaveCriticalSection(&((LPDIRECT3DDEVICE9_INT)This->BaseObject.pUnknown)->CriticalSection); + +/* Convert a IDirect3DSwapChain9 pointer safely to the internal implementation struct */ +static LPDIRECT3DSWAPCHAIN9_INT IDirect3DSwapChain9ToImpl(LPDIRECT3DSWAPCHAIN9 iface) +{ + if (NULL == iface) + return NULL; + + return (LPDIRECT3DSWAPCHAIN9_INT)((ULONG_PTR)iface - FIELD_OFFSET(Direct3DSwapChain9_INT, lpVtbl)); +} + +/* IDirect3DSwapChain9: IUnknown implementation */ +static HRESULT WINAPI Direct3DSwapChain9_QueryInterface(LPDIRECT3DSWAPCHAIN9 iface, REFIID riid, void** ppvObject) +{ + LPDIRECT3DSWAPCHAIN9_INT This = IDirect3DSwapChain9ToImpl(iface); + + if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirect3DSwapChain9)) + { + IUnknown_AddRef(iface); + *ppvObject = &This->lpVtbl; + return S_OK; + } + + *ppvObject = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI Direct3DSwapChain9_AddRef(LPDIRECT3DSWAPCHAIN9 iface) +{ + LPDIRECT3DSWAPCHAIN9_INT This = IDirect3DSwapChain9ToImpl(iface); + return D3D9BaseObject_AddRef((D3D9BaseObject*) &This->BaseObject.lpVtbl); +} + +static ULONG WINAPI Direct3DSwapChain9_Release(LPDIRECT3DSWAPCHAIN9 iface) +{ + LPDIRECT3DSWAPCHAIN9_INT This = IDirect3DSwapChain9ToImpl(iface); + return D3D9BaseObject_Release((D3D9BaseObject*) &This->BaseObject.lpVtbl); +} + +/* IDirect3DSwapChain9 interface */ +static HRESULT WINAPI Direct3DSwapChain9_Present(LPDIRECT3DSWAPCHAIN9 iface, CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion,DWORD dwFlags) +{ + UNIMPLEMENTED + return D3D_OK; +} + +static HRESULT WINAPI Direct3DSwapChain9_GetFrontBufferData(LPDIRECT3DSWAPCHAIN9 iface, IDirect3DSurface9* pDestSurface) +{ + UNIMPLEMENTED + return D3D_OK; +} + +static HRESULT WINAPI Direct3DSwapChain9_GetBackBuffer(LPDIRECT3DSWAPCHAIN9 iface, UINT iBackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface9** ppBackBuffer) +{ + UNIMPLEMENTED + return D3D_OK; +} + +static HRESULT WINAPI Direct3DSwapChain9_GetRasterStatus(LPDIRECT3DSWAPCHAIN9 iface, D3DRASTER_STATUS* pRasterStatus) +{ + UNIMPLEMENTED + return D3D_OK; +} + +static HRESULT WINAPI Direct3DSwapChain9_GetDisplayMode(LPDIRECT3DSWAPCHAIN9 iface, D3DDISPLAYMODE* pMode) +{ + UNIMPLEMENTED + return D3D_OK; +} + +/*++ +* @name IDirect3DSwapChain9::GetDevice +* @implemented +* +* The function Direct3DSwapChain9_GetDevice sets the ppDevice argument +* to the device connected to create the swap chain. +* +* @param LPDIRECT3DSWAPCHAIN9 iface +* Pointer to a IDirect3DSwapChain9 object returned from IDirect3D9Device::GetSwapChain() +* +* @param IDirect3DDevice9** ppDevice +* Pointer to a IDirect3DDevice9* structure to be set to the device object. +* +* @return HRESULT +* If the method successfully sets the ppDevice value, the return value is D3D_OK. +* If ppDevice is a bad pointer the return value will be D3DERR_INVALIDCALL. +* If the swap chain didn't contain any device, the return value will be D3DERR_INVALIDDEVICE. +* +*/ +static HRESULT WINAPI Direct3DSwapChain9_GetDevice(LPDIRECT3DSWAPCHAIN9 iface, IDirect3DDevice9** ppDevice) +{ + LPDIRECT3DSWAPCHAIN9_INT This = IDirect3DSwapChain9ToImpl(iface); + LOCK_D3DDEVICE9(); + + if (NULL == ppDevice) + { + DPRINT1("Invalid ppDevice parameter specified"); + UNLOCK_D3DDEVICE9(); + return D3DERR_INVALIDCALL; + } + + if (FAILED(D3D9BaseObject_GetDevice(&This->BaseObject, ppDevice))) + { + DPRINT1("Invalid This parameter speficied"); + UNLOCK_D3DDEVICE9(); + return D3DERR_INVALIDDEVICE; + } + + UNLOCK_D3DDEVICE9(); + return D3D_OK; +} + +/*++ +* @name IDirect3DSwapChain9::GetPresentParameters +* @implemented +* +* The function Direct3DSwapChain9_GetPresentParameters fills the pPresentationParameters +* argument with the D3DPRESENT_PARAMETERS parameters that was used to create the swap chain. +* +* @param LPDIRECT3DSWAPCHAIN9 iface +* Pointer to a IDirect3DSwapChain9 object returned from IDirect3D9Device::GetSwapChain() +* +* @param D3DPRESENT_PARAMETERS* pPresentationParameters +* Pointer to a D3DPRESENT_PARAMETERS structure to be filled with the creation parameters. +* +* @return HRESULT +* If the method successfully fills the pPresentationParameters structure, the return value is D3D_OK. +* If pPresentationParameters is a bad pointer the return value will be D3DERR_INVALIDCALL. +* +*/ +static HRESULT WINAPI Direct3DSwapChain9_GetPresentParameters(LPDIRECT3DSWAPCHAIN9 iface, D3DPRESENT_PARAMETERS* pPresentationParameters) +{ + LPDIRECT3DSWAPCHAIN9_INT This = IDirect3DSwapChain9ToImpl(iface); + LOCK_D3DDEVICE9(); + + if (NULL == pPresentationParameters) + { + DPRINT1("Invalid pPresentationParameters parameter specified"); + UNLOCK_D3DDEVICE9(); + return D3DERR_INVALIDCALL; + } + + *pPresentationParameters = This->PresentParameters; + + UNLOCK_D3DDEVICE9(); + return D3D_OK; +} + +static IDirect3DSwapChain9Vtbl Direct3DSwapChain9_Vtbl = +{ + /* IUnknown */ + Direct3DSwapChain9_QueryInterface, + Direct3DSwapChain9_AddRef, + Direct3DSwapChain9_Release, + + /* IDirect3DSwapChain9 */ + Direct3DSwapChain9_Present, + Direct3DSwapChain9_GetFrontBufferData, + Direct3DSwapChain9_GetBackBuffer, + Direct3DSwapChain9_GetRasterStatus, + Direct3DSwapChain9_GetDisplayMode, + Direct3DSwapChain9_GetDevice, + Direct3DSwapChain9_GetPresentParameters, +}; + +Direct3DSwapChain9_INT* CreateDirect3DSwapChain9(enum REF_TYPE RefType, struct _Direct3DDevice9_INT* pBaseDevice, DWORD ChainIndex) +{ + Direct3DSwapChain9_INT* pThisSwapChain; + if (FAILED(AlignedAlloc((LPVOID*)&pThisSwapChain, sizeof(Direct3DSwapChain9_INT)))) + { + DPRINT1("Could not create Direct3DSwapChain9_INT"); + return NULL; + } + + InitD3D9BaseObject((D3D9BaseObject*) &pThisSwapChain->BaseObject.lpVtbl, RefType, (IUnknown*) &pBaseDevice->lpVtbl); + + pThisSwapChain->lpVtbl = &Direct3DSwapChain9_Vtbl; + + pThisSwapChain->ChainIndex = ChainIndex; + pThisSwapChain->AdapterGroupIndex = ChainIndex; + pThisSwapChain->pUnknown6BC = pBaseDevice->DeviceData[ChainIndex].pUnknown6BC; + pThisSwapChain->pUnknown015c = (LPVOID)0xD3D9D3D9; + + return pThisSwapChain; +} + +VOID Direct3DSwapChain9_SetDisplayMode(Direct3DSwapChain9_INT* pThisSwapChain, D3DPRESENT_PARAMETERS* pPresentationParameters) +{ + pThisSwapChain->dwWidth = pPresentationParameters->BackBufferWidth; + pThisSwapChain->dwHeight = pPresentationParameters->BackBufferHeight; +} + +HRESULT Direct3DSwapChain9_Init(Direct3DSwapChain9_INT* pThisSwapChain, D3DPRESENT_PARAMETERS* pPresentationParameters) +{ + int i; + DIRECT3DDEVICE9_INT* pDevice; + + for (i = 0; i < 256; i++) + { + pThisSwapChain->GammaRamp.red[i] = + pThisSwapChain->GammaRamp.green[i] = + pThisSwapChain->GammaRamp.blue[i] = i; + } + + pThisSwapChain->PresentParameters = pPresentationParameters[pThisSwapChain->ChainIndex]; + pThisSwapChain->SwapEffect = pPresentationParameters->SwapEffect; + Direct3DSwapChain9_SetDisplayMode(pThisSwapChain, &pThisSwapChain->PresentParameters); + + if (FAILED(D3D9BaseObject_GetDeviceInt(&pThisSwapChain->BaseObject, &pDevice))) + { + DPRINT1("Could not get the swapchain device"); + return DDERR_GENERIC; + } + + pThisSwapChain->pCursor = CreateD3D9Cursor(pDevice, pThisSwapChain); + if (NULL == pThisSwapChain->pCursor) + { + DPRINT1("Could not allocate D3D9Cursor"); + return DDERR_OUTOFMEMORY; + } + + return Direct3DSwapChain9_Reset(pThisSwapChain, pPresentationParameters); +} + +HRESULT Direct3DSwapChain9_Reset(Direct3DSwapChain9_INT* pThisSwapChain, D3DPRESENT_PARAMETERS* pPresentationParameters) +{ + // TODO: Do all the dirty work... + return D3D_OK; +} diff --git a/reactos/dll/directx/d3d9/d3d9_swapchain.h b/reactos/dll/directx/d3d9/d3d9_swapchain.h new file mode 100644 index 00000000000..c6e76095fdc --- /dev/null +++ b/reactos/dll/directx/d3d9/d3d9_swapchain.h @@ -0,0 +1,81 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS ReactX + * FILE: dll/directx/d3d9/d3d9_swapchain.h + * PURPOSE: Direct3D9's swap chain object + * PROGRAMERS: Gregor Gullwi + */ +#ifndef _D3D9_SWAPCHAIN_H_ +#define _D3D9_SWAPCHAIN_H_ + +#include "d3d9_common.h" +#include +#include +#include "d3d9_baseobject.h" + +struct _Direct3DDevice9_INT; + +typedef struct _Direct3DSwapChain9_INT +{ +/* 0x0000 */ D3D9BaseObject BaseObject; +/* 0x0020 */ struct IDirect3DSwapChain9Vtbl* lpVtbl; +/* 0x0024 */ DWORD dwUnknown0024; +/* 0x0028 */ struct _D3D9Surface* pPrimarySurface; +/* 0x002c */ struct _D3D9Surface* pExtendedPrimarySurface; +/* 0x0030 */ DWORD dwUnknown0030; +/* 0x0034 */ struct _D3D9DriverSurface** ppBackBufferList; +/* 0x0038 */ DWORD dwNumBackBuffers; +/* 0x003c */ DWORD ChainIndex; +/* 0x0040 */ DWORD AdapterGroupIndex; +/* 0x0044 */ D3DPRESENT_PARAMETERS PresentParameters; +/* 0x007c */ DWORD dwUnknown007c; +/* 0x0080 */ DWORD dwUnknown0080[2]; /* Extended format? */ +/* 0x0088 */ struct _D3D9Cursor* pCursor; +/* 0x008c */ DWORD dwUnknown008c[4]; +/* 0x009c */ struct _D3D9_Unknown6BC* pUnknown6BC; +/* 0x00a0 */ LPDWORD dwUnknown00a0; +/* 0x00a4 */ DWORD dwUnknown00a4; +/* 0x00a8 */ DWORD dwUnknown00a8; +/* 0x00ac */ DWORD dwWidth; +/* 0x00b0 */ DWORD dwHeight; +/* 0x00b4 */ DWORD dwUnknown00b4; +/* 0x00b8 */ DWORD dwUnknown00b8; +/* 0x00bc */ DWORD dwUnknown00bc; +/* 0x00c0 */ DWORD dwWidth2; +/* 0x00c4 */ DWORD dwHeight2; +/* 0x00c8 */ DWORD dwUnknown00c8; +/* 0x00cc */ DWORD dwUnknown00cc; +/* 0x00d0 */ DWORD dwUnknown00d0; +/* 0x00d4 */ DWORD dwUnknown00d4; +/* 0x00d8 */ DWORD dwUnknown00d8; +/* 0x00dc */ DWORD dwUnknown00dc; +/* 0x00e0 */ DWORD dwDevModeScale; +/* 0x00e4 */ DWORD dwUnknown00e4; +/* 0x00e8 */ DWORD dwUnknown00e8; +/* 0x00ec */ DWORD dwUnknown00ec; +/* 0x00f0 */ DWORD dwUnknown00f0[27]; + +/* 0x015c */ LPVOID pUnknown015c; +/* 0x0160 */ DWORD dwUnknown0160[4]; +/* 0x0170 */ HRESULT hResult; + +/* 0x0174 */ DWORD dwUnknown0174[26]; + +/* 0x01DC */ DWORD dwUnknownFlags; /* 1 = Show frame rate, 2 = Flip without vsync */ +/* 0x01E0 */ BOOL bForceRefreshRate; +/* 0x01E4 */ DWORD dwUnknown01dc[4]; + +/* 0x01f4 */ D3DSWAPEFFECT SwapEffect; +/* 0x01f8 */ DWORD dwUnknown01f8; +/* 0x01fc */ DWORD dwUnknown01fc; +/* 0x0200 */ DDGAMMARAMP GammaRamp; +} Direct3DSwapChain9_INT, FAR* LPDIRECT3DSWAPCHAIN9_INT; + + +Direct3DSwapChain9_INT* CreateDirect3DSwapChain9(enum REF_TYPE RefType, struct _Direct3DDevice9_INT* pBaseDevice, DWORD ChainIndex); + +VOID Direct3DSwapChain9_SetDisplayMode(Direct3DSwapChain9_INT* pThisSwapChain, D3DPRESENT_PARAMETERS* pPresentationParameters); +HRESULT Direct3DSwapChain9_Init(Direct3DSwapChain9_INT* pThisSwapChain, D3DPRESENT_PARAMETERS* pPresentationParameters); +HRESULT Direct3DSwapChain9_Reset(Direct3DSwapChain9_INT* pThisSwapChain, D3DPRESENT_PARAMETERS* pPresentationParameters); + +#endif // _D3D9_SWAPCHAIN_H_ diff --git a/reactos/dll/directx/d3d9/device.c b/reactos/dll/directx/d3d9/device.c new file mode 100644 index 00000000000..049d3074e95 --- /dev/null +++ b/reactos/dll/directx/d3d9/device.c @@ -0,0 +1,120 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS ReactX + * FILE: dll/directx/d3d9/device.c + * PURPOSE: Direct3D9's device creation + * PROGRAMERS: Gregor Gullwi + */ + +#include "device.h" +#include +#include "d3d9_helpers.h" +#include "d3d9_create.h" + +static HRESULT InitD3D9ResourceManager(D3D9ResourceManager* pThisResourceManager, LPDIRECT3DDEVICE9_INT pDirect3DDevice9) +{ + DWORD MaxSimultaneousTextures; + + MaxSimultaneousTextures = max(1, pDirect3DDevice9->DeviceData[0].DriverCaps.DriverCaps9.MaxSimultaneousTextures); + + if (FAILED(AlignedAlloc((LPVOID *)&pThisResourceManager->pTextureHeap, sizeof(DWORD) + MaxSimultaneousTextures * sizeof(int) * 3))) + { + DPRINT1("Could not allocate texture heap"); + return DDERR_OUTOFMEMORY; + } + + // TODO: Init texture heap + + pThisResourceManager->MaxSimultaneousTextures = MaxSimultaneousTextures; + pThisResourceManager->pBaseDevice = pDirect3DDevice9; + + return D3D_OK; +} + +HRESULT InitD3D9BaseDevice(LPDIRECT3DDEVICE9_INT pThisBaseDevice, LPDIRECT3D9_INT pDirect3D9, + UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviourFlags, + D3DPRESENT_PARAMETERS* pPresentationParameters, DWORD NumAdaptersToCreate) +{ + D3D9ResourceManager* pResourceManager; + DWORD i; + + // Insert Reset/Ctor here + + if (FAILED(AlignedAlloc((LPVOID *)&pResourceManager, sizeof(D3D9ResourceManager))) || + FAILED(InitD3D9ResourceManager(pResourceManager, pThisBaseDevice))) + { + DPRINT1("Could not create resource manager"); + return DDERR_OUTOFMEMORY; + } + + pThisBaseDevice->pResourceManager = pResourceManager; + + pThisBaseDevice->lpVtbl = &Direct3DDevice9HAL_Vtbl; + pThisBaseDevice->lRefCnt = 1; + pThisBaseDevice->dwProcessId = GetCurrentThreadId(); + pThisBaseDevice->pUnknown = (IUnknown*) &pThisBaseDevice->lpVtbl; + InitializeCriticalSection(&pThisBaseDevice->CriticalSection); + + pThisBaseDevice->pDirect3D9 = pDirect3D9; + pThisBaseDevice->DeviceType = DeviceType; + pThisBaseDevice->hWnd = hFocusWindow; + pThisBaseDevice->AdjustedBehaviourFlags = BehaviourFlags; + pThisBaseDevice->BehaviourFlags = BehaviourFlags; + pThisBaseDevice->NumAdaptersInDevice = NumAdaptersToCreate; + + // TODO: Query driver for correct DX version + pThisBaseDevice->dwDXVersion = 9; + + for (i = 0; i < NumAdaptersToCreate; i++) + { + if (FALSE == CreateD3D9DeviceData(&pDirect3D9->DisplayAdapters[i], &pThisBaseDevice->DeviceData[i])) + { + DPRINT1("Failed to get device data for adapter: %d", i); + return DDERR_GENERIC; + } + + pThisBaseDevice->AdapterIndexInGroup[i] = i; + pThisBaseDevice->CurrentDisplayMode[i].Width = pDirect3D9->DisplayAdapters[i].DriverCaps.dwDisplayWidth; + pThisBaseDevice->CurrentDisplayMode[i].Height = pDirect3D9->DisplayAdapters[i].DriverCaps.dwDisplayHeight; + pThisBaseDevice->CurrentDisplayMode[i].RefreshRate = pDirect3D9->DisplayAdapters[i].DriverCaps.dwRefreshRate; + pThisBaseDevice->CurrentDisplayMode[i].Format = pDirect3D9->DisplayAdapters[i].DriverCaps.RawDisplayFormat; + + pThisBaseDevice->pSwapChains[i] = CreateDirect3DSwapChain9(RT_BUILTIN, pThisBaseDevice, i); + pThisBaseDevice->pSwapChains2[i] = pThisBaseDevice->pSwapChains[i]; + + if (FAILED(Direct3DSwapChain9_Init(pThisBaseDevice->pSwapChains[i], pPresentationParameters))) + { + DPRINT1("Failed to init swap chain: %d", i); + return DDERR_GENERIC; + } + } + + return D3D_OK; +} + +HRESULT CreateD3D9HalDevice(LPDIRECT3D9_INT pDirect3D9, UINT Adapter, + HWND hFocusWindow, DWORD BehaviourFlags, + D3DPRESENT_PARAMETERS* pPresentationParameters, + DWORD NumAdaptersToCreate, + struct IDirect3DDevice9** ppReturnedDeviceInterface) +{ + HRESULT Ret; + + if (FAILED(AlignedAlloc((LPVOID *)ppReturnedDeviceInterface, sizeof(D3D9HALDEVICE)))) + { + DPRINT1("Not enough memory to create HAL device"); + return DDERR_OUTOFMEMORY; + } + + Ret = InitD3D9BaseDevice((LPDIRECT3DDEVICE9_INT)*ppReturnedDeviceInterface, pDirect3D9, Adapter, + D3DDEVTYPE_HAL, hFocusWindow, BehaviourFlags, + pPresentationParameters, NumAdaptersToCreate); + + if (FAILED(Ret)) + { + AlignedFree((LPVOID)*ppReturnedDeviceInterface); + return Ret; + } + + return D3D_OK; +} diff --git a/reactos/dll/directx/d3d9/device.h b/reactos/dll/directx/d3d9/device.h new file mode 100644 index 00000000000..94058177f2f --- /dev/null +++ b/reactos/dll/directx/d3d9/device.h @@ -0,0 +1,20 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS ReactX + * FILE: dll/directx/d3d9/device.h + * PURPOSE: Direct3D9's device creation + * PROGRAMERS: Gregor Gullwi + */ + +#ifndef _DEVICE_H_ +#define _DEVICE_H_ + +#include "d3d9_haldevice.h" + +HRESULT CreateD3D9HalDevice(LPDIRECT3D9_INT pDirect3D9, UINT Adapter, + HWND hFocusWindow, DWORD BehaviourFlags, + D3DPRESENT_PARAMETERS* pPresentationParameters, + DWORD NumAdaptersToCreate, + struct IDirect3DDevice9** ppReturnedDeviceInterface); + +#endif // _DEVICE_H_ diff --git a/reactos/dll/directx/d3d9/format.c b/reactos/dll/directx/d3d9/format.c index 9d64c4a673e..3c9c0453fd0 100644 --- a/reactos/dll/directx/d3d9/format.c +++ b/reactos/dll/directx/d3d9/format.c @@ -9,6 +9,7 @@ #include "format.h" #include #include +#include BOOL IsBackBufferFormat(D3DFORMAT Format) { diff --git a/reactos/dll/keyboard/kbda1/kbda1.def b/reactos/dll/keyboard/kbda1/kbda1.def deleted file mode 100644 index 8bc15d20854..00000000000 --- a/reactos/dll/keyboard/kbda1/kbda1.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbda1.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbda1/kbda1.rbuild b/reactos/dll/keyboard/kbda1/kbda1.rbuild index 9313180bb3f..f4535a84a1d 100644 --- a/reactos/dll/keyboard/kbda1/kbda1.rbuild +++ b/reactos/dll/keyboard/kbda1/kbda1.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbda1.c kbda1.rc + kbda1.spec diff --git a/reactos/dll/keyboard/kbda1/kbda1.spec b/reactos/dll/keyboard/kbda1/kbda1.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbda1/kbda1.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbda2/kbda2.def b/reactos/dll/keyboard/kbda2/kbda2.def deleted file mode 100644 index 87fc02ac6f3..00000000000 --- a/reactos/dll/keyboard/kbda2/kbda2.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbda2.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbda2/kbda2.rbuild b/reactos/dll/keyboard/kbda2/kbda2.rbuild index 97dc1f5a08b..13c311dae83 100644 --- a/reactos/dll/keyboard/kbda2/kbda2.rbuild +++ b/reactos/dll/keyboard/kbda2/kbda2.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbda2.c kbda2.rc + kbda2.spec diff --git a/reactos/dll/keyboard/kbda2/kbda2.spec b/reactos/dll/keyboard/kbda2/kbda2.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbda2/kbda2.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbda3/kbda3.def b/reactos/dll/keyboard/kbda3/kbda3.def deleted file mode 100644 index 2307d7d0c97..00000000000 --- a/reactos/dll/keyboard/kbda3/kbda3.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbda3.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbda3/kbda3.rbuild b/reactos/dll/keyboard/kbda3/kbda3.rbuild index 1eb53a9cabf..b3d213c52aa 100644 --- a/reactos/dll/keyboard/kbda3/kbda3.rbuild +++ b/reactos/dll/keyboard/kbda3/kbda3.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbda3.c kbda3.rc + kbda3.spec diff --git a/reactos/dll/keyboard/kbda3/kbda3.spec b/reactos/dll/keyboard/kbda3/kbda3.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbda3/kbda3.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdal/kbdal.def b/reactos/dll/keyboard/kbdal/kbdal.def deleted file mode 100644 index 355652b15e6..00000000000 --- a/reactos/dll/keyboard/kbdal/kbdal.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdal.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdal/kbdal.rbuild b/reactos/dll/keyboard/kbdal/kbdal.rbuild index 63bfe56e911..e45eb3d8862 100644 --- a/reactos/dll/keyboard/kbdal/kbdal.rbuild +++ b/reactos/dll/keyboard/kbdal/kbdal.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdal.c kbdal.rc + kbdal.spec diff --git a/reactos/dll/keyboard/kbdal/kbdal.spec b/reactos/dll/keyboard/kbdal/kbdal.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdal/kbdal.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdarme/kbdarme.def b/reactos/dll/keyboard/kbdarme/kbdarme.def deleted file mode 100644 index c56d24b9308..00000000000 --- a/reactos/dll/keyboard/kbdarme/kbdarme.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdarme.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdarme/kbdarme.rbuild b/reactos/dll/keyboard/kbdarme/kbdarme.rbuild index d3e67d0c184..008efd44374 100644 --- a/reactos/dll/keyboard/kbdarme/kbdarme.rbuild +++ b/reactos/dll/keyboard/kbdarme/kbdarme.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdarme.c kbdarme.rc + kbdarme.spec diff --git a/reactos/dll/keyboard/kbdarme/kbdarme.spec b/reactos/dll/keyboard/kbdarme/kbdarme.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdarme/kbdarme.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdarmw/kbdarmw.def b/reactos/dll/keyboard/kbdarmw/kbdarmw.def deleted file mode 100644 index 4676a69a6dc..00000000000 --- a/reactos/dll/keyboard/kbdarmw/kbdarmw.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdarmw.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdarmw/kbdarmw.rbuild b/reactos/dll/keyboard/kbdarmw/kbdarmw.rbuild index 95f0ec39d78..37383830f23 100644 --- a/reactos/dll/keyboard/kbdarmw/kbdarmw.rbuild +++ b/reactos/dll/keyboard/kbdarmw/kbdarmw.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdarmw.c kbdarmw.rc + kbdarmw.spec diff --git a/reactos/dll/keyboard/kbdarmw/kbdarmw.spec b/reactos/dll/keyboard/kbdarmw/kbdarmw.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdarmw/kbdarmw.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdaze/kbdaze.def b/reactos/dll/keyboard/kbdaze/kbdaze.def deleted file mode 100644 index f4c189d5fbb..00000000000 --- a/reactos/dll/keyboard/kbdaze/kbdaze.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdaze.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdaze/kbdaze.rbuild b/reactos/dll/keyboard/kbdaze/kbdaze.rbuild index 8c0e518a9dd..fdeeb8af0e0 100644 --- a/reactos/dll/keyboard/kbdaze/kbdaze.rbuild +++ b/reactos/dll/keyboard/kbdaze/kbdaze.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdaze.c kbdaze.rc + kbdaze.spec diff --git a/reactos/dll/keyboard/kbdaze/kbdaze.spec b/reactos/dll/keyboard/kbdaze/kbdaze.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdaze/kbdaze.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdazel/kbdazel.def b/reactos/dll/keyboard/kbdazel/kbdazel.def deleted file mode 100644 index bcfe3e493dd..00000000000 --- a/reactos/dll/keyboard/kbdazel/kbdazel.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdazel.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdazel/kbdazel.rbuild b/reactos/dll/keyboard/kbdazel/kbdazel.rbuild index b10de660563..3011162513c 100644 --- a/reactos/dll/keyboard/kbdazel/kbdazel.rbuild +++ b/reactos/dll/keyboard/kbdazel/kbdazel.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdazel.c kbdazel.rc + kbdazel.spec diff --git a/reactos/dll/keyboard/kbdazel/kbdazel.spec b/reactos/dll/keyboard/kbdazel/kbdazel.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdazel/kbdazel.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdbe/kbdbe.def b/reactos/dll/keyboard/kbdbe/kbdbe.def deleted file mode 100644 index ea0271f832a..00000000000 --- a/reactos/dll/keyboard/kbdbe/kbdbe.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdbe.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdbe/kbdbe.rbuild b/reactos/dll/keyboard/kbdbe/kbdbe.rbuild index 6bc1bc70e29..d17d60ce6ca 100644 --- a/reactos/dll/keyboard/kbdbe/kbdbe.rbuild +++ b/reactos/dll/keyboard/kbdbe/kbdbe.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdbe.c kbdbe.rc + kbdbe.spec diff --git a/reactos/dll/keyboard/kbdbe/kbdbe.spec b/reactos/dll/keyboard/kbdbe/kbdbe.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdbe/kbdbe.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdbga/kbdbga.def b/reactos/dll/keyboard/kbdbga/kbdbga.def deleted file mode 100644 index 4858a5fb570..00000000000 --- a/reactos/dll/keyboard/kbdbga/kbdbga.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdbga.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdbga/kbdbga.rbuild b/reactos/dll/keyboard/kbdbga/kbdbga.rbuild index 1dc758883c6..70aabd09dd2 100644 --- a/reactos/dll/keyboard/kbdbga/kbdbga.rbuild +++ b/reactos/dll/keyboard/kbdbga/kbdbga.rbuild @@ -1,9 +1,11 @@ + + - + include - 0x0500 kbdbga.c kbdbga.rc - \ No newline at end of file + kbdbga.spec + diff --git a/reactos/dll/keyboard/kbdbga/kbdbga.spec b/reactos/dll/keyboard/kbdbga/kbdbga.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdbga/kbdbga.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdbgm/kbdbgm.def b/reactos/dll/keyboard/kbdbgm/kbdbgm.def deleted file mode 100644 index 79314113131..00000000000 --- a/reactos/dll/keyboard/kbdbgm/kbdbgm.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdbgm.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdbgm/kbdbgm.rbuild b/reactos/dll/keyboard/kbdbgm/kbdbgm.rbuild index 1eb705ceaa1..1bad67104e9 100644 --- a/reactos/dll/keyboard/kbdbgm/kbdbgm.rbuild +++ b/reactos/dll/keyboard/kbdbgm/kbdbgm.rbuild @@ -1,9 +1,11 @@ + + - + include - 0x0500 kbdbgm.c kbdbgm.rc + kbdbgm.spec diff --git a/reactos/dll/keyboard/kbdbgm/kbdbgm.spec b/reactos/dll/keyboard/kbdbgm/kbdbgm.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdbgm/kbdbgm.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdbgt/kbdbgt.def b/reactos/dll/keyboard/kbdbgt/kbdbgt.def deleted file mode 100644 index 4519422ee14..00000000000 --- a/reactos/dll/keyboard/kbdbgt/kbdbgt.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdbgt.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdbgt/kbdbgt.rbuild b/reactos/dll/keyboard/kbdbgt/kbdbgt.rbuild index 4dbc6c42bf3..43d911488c9 100644 --- a/reactos/dll/keyboard/kbdbgt/kbdbgt.rbuild +++ b/reactos/dll/keyboard/kbdbgt/kbdbgt.rbuild @@ -1,9 +1,11 @@ + + - + include - 0x0500 kbdbgt.c kbdbgt.rc - \ No newline at end of file + kbdbgt.spec + diff --git a/reactos/dll/keyboard/kbdbgt/kbdbgt.spec b/reactos/dll/keyboard/kbdbgt/kbdbgt.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdbgt/kbdbgt.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdblr/kbdblr.def b/reactos/dll/keyboard/kbdblr/kbdblr.def deleted file mode 100644 index 982da6f0d04..00000000000 --- a/reactos/dll/keyboard/kbdblr/kbdblr.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdblr.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdblr/kbdblr.rbuild b/reactos/dll/keyboard/kbdblr/kbdblr.rbuild index e9a4b2f5fd1..51303bb3408 100644 --- a/reactos/dll/keyboard/kbdblr/kbdblr.rbuild +++ b/reactos/dll/keyboard/kbdblr/kbdblr.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdblr.c kbdblr.rc + kbdblr.spec diff --git a/reactos/dll/keyboard/kbdblr/kbdblr.spec b/reactos/dll/keyboard/kbdblr/kbdblr.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdblr/kbdblr.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdbr/kbdbr.def b/reactos/dll/keyboard/kbdbr/kbdbr.def deleted file mode 100644 index 689997ab55f..00000000000 --- a/reactos/dll/keyboard/kbdbr/kbdbr.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdbr.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdbr/kbdbr.rbuild b/reactos/dll/keyboard/kbdbr/kbdbr.rbuild index a38a8caa49b..e0a2d6d7bb2 100644 --- a/reactos/dll/keyboard/kbdbr/kbdbr.rbuild +++ b/reactos/dll/keyboard/kbdbr/kbdbr.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdbr.c kbdbr.rc + kbdbr.spec diff --git a/reactos/dll/keyboard/kbdbr/kbdbr.spec b/reactos/dll/keyboard/kbdbr/kbdbr.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdbr/kbdbr.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdbur/kbdbur.def b/reactos/dll/keyboard/kbdbur/kbdbur.def deleted file mode 100644 index 3bf311d6b7d..00000000000 --- a/reactos/dll/keyboard/kbdbur/kbdbur.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdbur.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdbur/kbdbur.rbuild b/reactos/dll/keyboard/kbdbur/kbdbur.rbuild index 4d9c588410f..81efd760fcb 100644 --- a/reactos/dll/keyboard/kbdbur/kbdbur.rbuild +++ b/reactos/dll/keyboard/kbdbur/kbdbur.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdbur.c kbdbur.rc + kbdbur.spec diff --git a/reactos/dll/keyboard/kbdbur/kbdbur.spec b/reactos/dll/keyboard/kbdbur/kbdbur.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdbur/kbdbur.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdcan/kbdcan.def b/reactos/dll/keyboard/kbdcan/kbdcan.def deleted file mode 100644 index 3f0ed6f0168..00000000000 --- a/reactos/dll/keyboard/kbdcan/kbdcan.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdcan.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdcan/kbdcan.rbuild b/reactos/dll/keyboard/kbdcan/kbdcan.rbuild index 48bd041cbc3..9857e8f2f3b 100644 --- a/reactos/dll/keyboard/kbdcan/kbdcan.rbuild +++ b/reactos/dll/keyboard/kbdcan/kbdcan.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdcan.c kbdcan.rc + kbdcan.spec diff --git a/reactos/dll/keyboard/kbdcan/kbdcan.spec b/reactos/dll/keyboard/kbdcan/kbdcan.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdcan/kbdcan.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdcr/kbdcr.def b/reactos/dll/keyboard/kbdcr/kbdcr.def deleted file mode 100644 index 2f63ec4826c..00000000000 --- a/reactos/dll/keyboard/kbdcr/kbdcr.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdcr.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdcr/kbdcr.rbuild b/reactos/dll/keyboard/kbdcr/kbdcr.rbuild index 5ed8bb001ec..f709a9eb03c 100644 --- a/reactos/dll/keyboard/kbdcr/kbdcr.rbuild +++ b/reactos/dll/keyboard/kbdcr/kbdcr.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdcr.c kbdcr.rc + kbdcr.spec diff --git a/reactos/dll/keyboard/kbdcr/kbdcr.spec b/reactos/dll/keyboard/kbdcr/kbdcr.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdcr/kbdcr.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdcz1/kbdcz1.def b/reactos/dll/keyboard/kbdcz1/kbdcz1.def deleted file mode 100644 index 1a9a6c20957..00000000000 --- a/reactos/dll/keyboard/kbdcz1/kbdcz1.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdcz1.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdcz1/kbdcz1.rbuild b/reactos/dll/keyboard/kbdcz1/kbdcz1.rbuild index ed6e50ae887..c9d22a60f84 100644 --- a/reactos/dll/keyboard/kbdcz1/kbdcz1.rbuild +++ b/reactos/dll/keyboard/kbdcz1/kbdcz1.rbuild @@ -1,8 +1,11 @@ + + - + include 0x0500 kbdcz1.c kbdcz1.rc + kbdcz1.spec diff --git a/reactos/dll/keyboard/kbdcz1/kbdcz1.spec b/reactos/dll/keyboard/kbdcz1/kbdcz1.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdcz1/kbdcz1.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdda/kbdda.def b/reactos/dll/keyboard/kbdda/kbdda.def deleted file mode 100644 index 27d0cf710c0..00000000000 --- a/reactos/dll/keyboard/kbdda/kbdda.def +++ /dev/null @@ -1,3 +0,0 @@ -LIBRARY kbdda.dll -EXPORTS -KbdLayerDescriptor@0 diff --git a/reactos/dll/keyboard/kbdda/kbdda.rbuild b/reactos/dll/keyboard/kbdda/kbdda.rbuild index 158320d2718..b3582afa281 100644 --- a/reactos/dll/keyboard/kbdda/kbdda.rbuild +++ b/reactos/dll/keyboard/kbdda/kbdda.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdda.c kbdda.rc + kbdda.spec diff --git a/reactos/dll/keyboard/kbdda/kbdda.spec b/reactos/dll/keyboard/kbdda/kbdda.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdda/kbdda.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbddv/kbddv.def b/reactos/dll/keyboard/kbddv/kbddv.def deleted file mode 100644 index c5c76997bc9..00000000000 --- a/reactos/dll/keyboard/kbddv/kbddv.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbddv.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbddv/kbddv.rbuild b/reactos/dll/keyboard/kbddv/kbddv.rbuild index dadbcada6ed..89a765ca6a0 100644 --- a/reactos/dll/keyboard/kbddv/kbddv.rbuild +++ b/reactos/dll/keyboard/kbddv/kbddv.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbddv.c kbddv.rc + kbddv.spec diff --git a/reactos/dll/keyboard/kbddv/kbddv.spec b/reactos/dll/keyboard/kbddv/kbddv.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbddv/kbddv.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdes/kbdes.def b/reactos/dll/keyboard/kbdes/kbdes.def deleted file mode 100644 index e475fe442c0..00000000000 --- a/reactos/dll/keyboard/kbdes/kbdes.def +++ /dev/null @@ -1,4 +0,0 @@ -LIBRARY kbdes.dll - -EXPORTS -KbdLayerDescriptor@0 \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdes/kbdes.rbuild b/reactos/dll/keyboard/kbdes/kbdes.rbuild index b1f41d18836..45cfdf8cd34 100644 --- a/reactos/dll/keyboard/kbdes/kbdes.rbuild +++ b/reactos/dll/keyboard/kbdes/kbdes.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdes.c kbdes.rc + kbdes.spec diff --git a/reactos/dll/keyboard/kbdes/kbdes.spec b/reactos/dll/keyboard/kbdes/kbdes.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdes/kbdes.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdest/kbdest.def b/reactos/dll/keyboard/kbdest/kbdest.def deleted file mode 100644 index b3eae444615..00000000000 --- a/reactos/dll/keyboard/kbdest/kbdest.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdest.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdest/kbdest.rbuild b/reactos/dll/keyboard/kbdest/kbdest.rbuild index 1af9e6986ac..39c3b196b6b 100644 --- a/reactos/dll/keyboard/kbdest/kbdest.rbuild +++ b/reactos/dll/keyboard/kbdest/kbdest.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdest.c kbdest.rc + kbdest.spec diff --git a/reactos/dll/keyboard/kbdest/kbdest.spec b/reactos/dll/keyboard/kbdest/kbdest.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdest/kbdest.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdfc/kbdfc.def b/reactos/dll/keyboard/kbdfc/kbdfc.def deleted file mode 100644 index 6e55ed40d9b..00000000000 --- a/reactos/dll/keyboard/kbdfc/kbdfc.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdfc.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdfc/kbdfc.rbuild b/reactos/dll/keyboard/kbdfc/kbdfc.rbuild index 1830f18e6c0..7d20ce4c4b1 100644 --- a/reactos/dll/keyboard/kbdfc/kbdfc.rbuild +++ b/reactos/dll/keyboard/kbdfc/kbdfc.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdfc.c kbdfc.rc + kbdfc.spec diff --git a/reactos/dll/keyboard/kbdfc/kbdfc.spec b/reactos/dll/keyboard/kbdfc/kbdfc.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdfc/kbdfc.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdfi/kbdfi.def b/reactos/dll/keyboard/kbdfi/kbdfi.def deleted file mode 100644 index 4ad11b5df1b..00000000000 --- a/reactos/dll/keyboard/kbdfi/kbdfi.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdfi.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdfi/kbdfi.rbuild b/reactos/dll/keyboard/kbdfi/kbdfi.rbuild index cb801859e28..8def34916a1 100644 --- a/reactos/dll/keyboard/kbdfi/kbdfi.rbuild +++ b/reactos/dll/keyboard/kbdfi/kbdfi.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdfi.c kbdfi.rc + kbdfi.spec diff --git a/reactos/dll/keyboard/kbdfi/kbdfi.spec b/reactos/dll/keyboard/kbdfi/kbdfi.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdfi/kbdfi.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdfr/kbdfr.def b/reactos/dll/keyboard/kbdfr/kbdfr.def deleted file mode 100644 index a880573f8ca..00000000000 --- a/reactos/dll/keyboard/kbdfr/kbdfr.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdfr.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdfr/kbdfr.rbuild b/reactos/dll/keyboard/kbdfr/kbdfr.rbuild index dfd9e99d638..3b9251409c1 100644 --- a/reactos/dll/keyboard/kbdfr/kbdfr.rbuild +++ b/reactos/dll/keyboard/kbdfr/kbdfr.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdfr.c kbdfr.rc + kbdfr.spec diff --git a/reactos/dll/keyboard/kbdfr/kbdfr.spec b/reactos/dll/keyboard/kbdfr/kbdfr.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdfr/kbdfr.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdgeo/kbdgeo.def b/reactos/dll/keyboard/kbdgeo/kbdgeo.def deleted file mode 100644 index d32ef61a8d2..00000000000 --- a/reactos/dll/keyboard/kbdgeo/kbdgeo.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdgeo.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdgeo/kbdgeo.rbuild b/reactos/dll/keyboard/kbdgeo/kbdgeo.rbuild index 73ea7494b0b..cf930f80c1b 100644 --- a/reactos/dll/keyboard/kbdgeo/kbdgeo.rbuild +++ b/reactos/dll/keyboard/kbdgeo/kbdgeo.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdgeo.c kbdgeo.rc + kbdgeo.spec diff --git a/reactos/dll/keyboard/kbdgeo/kbdgeo.spec b/reactos/dll/keyboard/kbdgeo/kbdgeo.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdgeo/kbdgeo.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdgerg/kbdgerg.def b/reactos/dll/keyboard/kbdgerg/kbdgerg.def deleted file mode 100644 index fcc567eec63..00000000000 --- a/reactos/dll/keyboard/kbdgerg/kbdgerg.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdgerg.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdgerg/kbdgerg.rbuild b/reactos/dll/keyboard/kbdgerg/kbdgerg.rbuild index edb55b8c96b..5f282da5e46 100644 --- a/reactos/dll/keyboard/kbdgerg/kbdgerg.rbuild +++ b/reactos/dll/keyboard/kbdgerg/kbdgerg.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdgerg.c kbdgerg.rc + kbdgerg.spec diff --git a/reactos/dll/keyboard/kbdgerg/kbdgerg.spec b/reactos/dll/keyboard/kbdgerg/kbdgerg.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdgerg/kbdgerg.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdgneo/kbdgneo.def b/reactos/dll/keyboard/kbdgneo/kbdgneo.def deleted file mode 100644 index 56245f911c4..00000000000 --- a/reactos/dll/keyboard/kbdgneo/kbdgneo.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdgneo.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdgneo/kbdgneo.rbuild b/reactos/dll/keyboard/kbdgneo/kbdgneo.rbuild index 8356048e75d..44403a40538 100644 --- a/reactos/dll/keyboard/kbdgneo/kbdgneo.rbuild +++ b/reactos/dll/keyboard/kbdgneo/kbdgneo.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdgneo.c kbdgneo.rc + kbdgneo.spec diff --git a/reactos/dll/keyboard/kbdgneo/kbdgneo.spec b/reactos/dll/keyboard/kbdgneo/kbdgneo.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdgneo/kbdgneo.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdgr/kbdgr.def b/reactos/dll/keyboard/kbdgr/kbdgr.def deleted file mode 100644 index 7dc7cadfdad..00000000000 --- a/reactos/dll/keyboard/kbdgr/kbdgr.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdgr.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdgr/kbdgr.rbuild b/reactos/dll/keyboard/kbdgr/kbdgr.rbuild index defc5c6591b..d992f6ec3e7 100644 --- a/reactos/dll/keyboard/kbdgr/kbdgr.rbuild +++ b/reactos/dll/keyboard/kbdgr/kbdgr.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdgr.c kbdgr.rc + kbdgr.spec diff --git a/reactos/dll/keyboard/kbdgr/kbdgr.spec b/reactos/dll/keyboard/kbdgr/kbdgr.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdgr/kbdgr.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdgrist/kbdgrist.def b/reactos/dll/keyboard/kbdgrist/kbdgrist.def deleted file mode 100644 index 75a113eeab9..00000000000 --- a/reactos/dll/keyboard/kbdgrist/kbdgrist.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdgrist.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdgrist/kbdgrist.rbuild b/reactos/dll/keyboard/kbdgrist/kbdgrist.rbuild index 9e01bd02996..5f228231848 100644 --- a/reactos/dll/keyboard/kbdgrist/kbdgrist.rbuild +++ b/reactos/dll/keyboard/kbdgrist/kbdgrist.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdgrist.c kbdgrist.rc + kbdgrist.spec diff --git a/reactos/dll/keyboard/kbdgrist/kbdgrist.spec b/reactos/dll/keyboard/kbdgrist/kbdgrist.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdgrist/kbdgrist.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdhe/kbdhe.def b/reactos/dll/keyboard/kbdhe/kbdhe.def deleted file mode 100644 index 53beb921709..00000000000 --- a/reactos/dll/keyboard/kbdhe/kbdhe.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdhe.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdhe/kbdhe.rbuild b/reactos/dll/keyboard/kbdhe/kbdhe.rbuild index 167be200609..8dfa25cde1f 100644 --- a/reactos/dll/keyboard/kbdhe/kbdhe.rbuild +++ b/reactos/dll/keyboard/kbdhe/kbdhe.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdhe.c kbdhe.rc - \ No newline at end of file + kbdhe.spec + diff --git a/reactos/dll/keyboard/kbdhe/kbdhe.spec b/reactos/dll/keyboard/kbdhe/kbdhe.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdhe/kbdhe.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdheb/kbdheb.def b/reactos/dll/keyboard/kbdheb/kbdheb.def deleted file mode 100644 index 763d231df8e..00000000000 --- a/reactos/dll/keyboard/kbdheb/kbdheb.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdheb.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdheb/kbdheb.rbuild b/reactos/dll/keyboard/kbdheb/kbdheb.rbuild index 6dbb9de501d..f163665fc92 100644 --- a/reactos/dll/keyboard/kbdheb/kbdheb.rbuild +++ b/reactos/dll/keyboard/kbdheb/kbdheb.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdheb.c kbdheb.rc - \ No newline at end of file + kbdheb.spec + diff --git a/reactos/dll/keyboard/kbdheb/kbdheb.spec b/reactos/dll/keyboard/kbdheb/kbdheb.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdheb/kbdheb.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdhu/kbdhu.def b/reactos/dll/keyboard/kbdhu/kbdhu.def deleted file mode 100644 index ff47310dfc4..00000000000 --- a/reactos/dll/keyboard/kbdhu/kbdhu.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdhu.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdhu/kbdhu.rbuild b/reactos/dll/keyboard/kbdhu/kbdhu.rbuild index 89cb4f9f111..33d5a8ae5fa 100644 --- a/reactos/dll/keyboard/kbdhu/kbdhu.rbuild +++ b/reactos/dll/keyboard/kbdhu/kbdhu.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdhu.c kbdhu.rc + kbdhu.spec diff --git a/reactos/dll/keyboard/kbdhu/kbdhu.spec b/reactos/dll/keyboard/kbdhu/kbdhu.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdhu/kbdhu.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdic/kbdic.def b/reactos/dll/keyboard/kbdic/kbdic.def deleted file mode 100644 index 8dc0ec5bd0e..00000000000 --- a/reactos/dll/keyboard/kbdic/kbdic.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdic.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdic/kbdic.rbuild b/reactos/dll/keyboard/kbdic/kbdic.rbuild index 9dd1f98aacf..ca14176da38 100644 --- a/reactos/dll/keyboard/kbdic/kbdic.rbuild +++ b/reactos/dll/keyboard/kbdic/kbdic.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdic.c kbdic.rc + kbdic.spec diff --git a/reactos/dll/keyboard/kbdic/kbdic.spec b/reactos/dll/keyboard/kbdic/kbdic.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdic/kbdic.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdinasa/kbdinasa.def b/reactos/dll/keyboard/kbdinasa/kbdinasa.def deleted file mode 100644 index 83539cf11df..00000000000 --- a/reactos/dll/keyboard/kbdinasa/kbdinasa.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdinasa.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdinasa/kbdinasa.rbuild b/reactos/dll/keyboard/kbdinasa/kbdinasa.rbuild index 4e2d3508f03..eb093ceb3e8 100644 --- a/reactos/dll/keyboard/kbdinasa/kbdinasa.rbuild +++ b/reactos/dll/keyboard/kbdinasa/kbdinasa.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdinasa.c kbdinasa.rc + kbdinasa.spec diff --git a/reactos/dll/keyboard/kbdinasa/kbdinasa.spec b/reactos/dll/keyboard/kbdinasa/kbdinasa.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdinasa/kbdinasa.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdinben/kbdinben.def b/reactos/dll/keyboard/kbdinben/kbdinben.def deleted file mode 100644 index accfe832a9a..00000000000 --- a/reactos/dll/keyboard/kbdinben/kbdinben.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdinben.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdinben/kbdinben.rbuild b/reactos/dll/keyboard/kbdinben/kbdinben.rbuild index 80eef9e429b..418fbe7e0ae 100644 --- a/reactos/dll/keyboard/kbdinben/kbdinben.rbuild +++ b/reactos/dll/keyboard/kbdinben/kbdinben.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdinben.c kbdinben.rc + kbdinben.spec diff --git a/reactos/dll/keyboard/kbdinben/kbdinben.spec b/reactos/dll/keyboard/kbdinben/kbdinben.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdinben/kbdinben.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdindev/kbdindev.def b/reactos/dll/keyboard/kbdindev/kbdindev.def deleted file mode 100644 index 411f47f0f50..00000000000 --- a/reactos/dll/keyboard/kbdindev/kbdindev.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdindev.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdindev/kbdindev.rbuild b/reactos/dll/keyboard/kbdindev/kbdindev.rbuild index 7d9601e7401..67c41f377f3 100644 --- a/reactos/dll/keyboard/kbdindev/kbdindev.rbuild +++ b/reactos/dll/keyboard/kbdindev/kbdindev.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdindev.c kbdindev.rc + kbdindev.spec diff --git a/reactos/dll/keyboard/kbdindev/kbdindev.spec b/reactos/dll/keyboard/kbdindev/kbdindev.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdindev/kbdindev.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdinguj/kbdinguj.def b/reactos/dll/keyboard/kbdinguj/kbdinguj.def deleted file mode 100644 index 818755d1c79..00000000000 --- a/reactos/dll/keyboard/kbdinguj/kbdinguj.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdinguj.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdinguj/kbdinguj.rbuild b/reactos/dll/keyboard/kbdinguj/kbdinguj.rbuild index d9825e4f2bf..aca7a777e64 100644 --- a/reactos/dll/keyboard/kbdinguj/kbdinguj.rbuild +++ b/reactos/dll/keyboard/kbdinguj/kbdinguj.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdinguj.c kbdinguj.rc + kbdinguj.spec diff --git a/reactos/dll/keyboard/kbdinguj/kbdinguj.spec b/reactos/dll/keyboard/kbdinguj/kbdinguj.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdinguj/kbdinguj.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdinmal/kbdinmal.def b/reactos/dll/keyboard/kbdinmal/kbdinmal.def deleted file mode 100644 index 38f6b588943..00000000000 --- a/reactos/dll/keyboard/kbdinmal/kbdinmal.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdinmal.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdinmal/kbdinmal.rbuild b/reactos/dll/keyboard/kbdinmal/kbdinmal.rbuild index 08dcfd66a05..4d4f50b79fb 100644 --- a/reactos/dll/keyboard/kbdinmal/kbdinmal.rbuild +++ b/reactos/dll/keyboard/kbdinmal/kbdinmal.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdinmal.c kbdinmal.rc + kbdinmal.spec diff --git a/reactos/dll/keyboard/kbdinmal/kbdinmal.spec b/reactos/dll/keyboard/kbdinmal/kbdinmal.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdinmal/kbdinmal.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdir/kbdir.def b/reactos/dll/keyboard/kbdir/kbdir.def deleted file mode 100644 index 182d0ef4a8a..00000000000 --- a/reactos/dll/keyboard/kbdir/kbdir.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdir.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdir/kbdir.rbuild b/reactos/dll/keyboard/kbdir/kbdir.rbuild index 970766de56e..4d35719d649 100644 --- a/reactos/dll/keyboard/kbdir/kbdir.rbuild +++ b/reactos/dll/keyboard/kbdir/kbdir.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdir.c kbdir.rc + kbdir.spec diff --git a/reactos/dll/keyboard/kbdir/kbdir.spec b/reactos/dll/keyboard/kbdir/kbdir.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdir/kbdir.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdit/kbdit.def b/reactos/dll/keyboard/kbdit/kbdit.def deleted file mode 100644 index 502a2eb8c09..00000000000 --- a/reactos/dll/keyboard/kbdit/kbdit.def +++ /dev/null @@ -1,4 +0,0 @@ -LIBRARY kbdit.dll - -EXPORTS -KbdLayerDescriptor@0 diff --git a/reactos/dll/keyboard/kbdit/kbdit.rbuild b/reactos/dll/keyboard/kbdit/kbdit.rbuild index 949d2e7786d..eeca81895ee 100644 --- a/reactos/dll/keyboard/kbdit/kbdit.rbuild +++ b/reactos/dll/keyboard/kbdit/kbdit.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdit.c kbdit.rc + kbdit.spec diff --git a/reactos/dll/keyboard/kbdit/kbdit.spec b/reactos/dll/keyboard/kbdit/kbdit.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdit/kbdit.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdja/kbdja.def b/reactos/dll/keyboard/kbdja/kbdja.def deleted file mode 100644 index 6a67344ff6c..00000000000 --- a/reactos/dll/keyboard/kbdja/kbdja.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdja.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdja/kbdja.rbuild b/reactos/dll/keyboard/kbdja/kbdja.rbuild index a1397301245..3453ab78d76 100644 --- a/reactos/dll/keyboard/kbdja/kbdja.rbuild +++ b/reactos/dll/keyboard/kbdja/kbdja.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdja.c kbdja.rc + kbdja.spec diff --git a/reactos/dll/keyboard/kbdja/kbdja.spec b/reactos/dll/keyboard/kbdja/kbdja.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdja/kbdja.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdkaz/kbdkaz.def b/reactos/dll/keyboard/kbdkaz/kbdkaz.def deleted file mode 100644 index 39d5df95ba3..00000000000 --- a/reactos/dll/keyboard/kbdkaz/kbdkaz.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdkaz.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdkaz/kbdkaz.rbuild b/reactos/dll/keyboard/kbdkaz/kbdkaz.rbuild index fade6ac3aa8..646a0738040 100644 --- a/reactos/dll/keyboard/kbdkaz/kbdkaz.rbuild +++ b/reactos/dll/keyboard/kbdkaz/kbdkaz.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdkaz.c kbdkaz.rc + kbdkaz.spec diff --git a/reactos/dll/keyboard/kbdkaz/kbdkaz.spec b/reactos/dll/keyboard/kbdkaz/kbdkaz.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdkaz/kbdkaz.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdko/kbdko.def b/reactos/dll/keyboard/kbdko/kbdko.def deleted file mode 100644 index cff55c480be..00000000000 --- a/reactos/dll/keyboard/kbdko/kbdko.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdko.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdko/kbdko.rbuild b/reactos/dll/keyboard/kbdko/kbdko.rbuild index 195c2465803..f6ad227e060 100644 --- a/reactos/dll/keyboard/kbdko/kbdko.rbuild +++ b/reactos/dll/keyboard/kbdko/kbdko.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdko.c kbdko.rc + kbdko.spec diff --git a/reactos/dll/keyboard/kbdko/kbdko.spec b/reactos/dll/keyboard/kbdko/kbdko.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdko/kbdko.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdla/kbdla.def b/reactos/dll/keyboard/kbdla/kbdla.def deleted file mode 100644 index 6f99c63510b..00000000000 --- a/reactos/dll/keyboard/kbdla/kbdla.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdla.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdla/kbdla.rbuild b/reactos/dll/keyboard/kbdla/kbdla.rbuild index 8c0d35a99d5..f6eff54f57c 100644 --- a/reactos/dll/keyboard/kbdla/kbdla.rbuild +++ b/reactos/dll/keyboard/kbdla/kbdla.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdla.c kbdla.rc + kbdla.spec diff --git a/reactos/dll/keyboard/kbdla/kbdla.spec b/reactos/dll/keyboard/kbdla/kbdla.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdla/kbdla.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdlt/kbdlt.def b/reactos/dll/keyboard/kbdlt/kbdlt.def deleted file mode 100644 index 8076cd6bb01..00000000000 --- a/reactos/dll/keyboard/kbdlt/kbdlt.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdlt.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdlt/kbdlt.rbuild b/reactos/dll/keyboard/kbdlt/kbdlt.rbuild index c24958fd8b8..682e2fcb547 100644 --- a/reactos/dll/keyboard/kbdlt/kbdlt.rbuild +++ b/reactos/dll/keyboard/kbdlt/kbdlt.rbuild @@ -1,8 +1,11 @@ + + - + include 0x0500 kbdlt.c kbdlt.rc + kbdlt.spec diff --git a/reactos/dll/keyboard/kbdlt/kbdlt.spec b/reactos/dll/keyboard/kbdlt/kbdlt.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdlt/kbdlt.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdlv/kbdlv.def b/reactos/dll/keyboard/kbdlv/kbdlv.def deleted file mode 100644 index 22c07722923..00000000000 --- a/reactos/dll/keyboard/kbdlv/kbdlv.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdlv.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdlv/kbdlv.rbuild b/reactos/dll/keyboard/kbdlv/kbdlv.rbuild index 1ef428e3145..9d099e8dc9f 100644 --- a/reactos/dll/keyboard/kbdlv/kbdlv.rbuild +++ b/reactos/dll/keyboard/kbdlv/kbdlv.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdlv.c kbdlv.rc + kbdlv.spec diff --git a/reactos/dll/keyboard/kbdlv/kbdlv.spec b/reactos/dll/keyboard/kbdlv/kbdlv.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdlv/kbdlv.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdmac/kbdmac.def b/reactos/dll/keyboard/kbdmac/kbdmac.def deleted file mode 100644 index 020260e6796..00000000000 --- a/reactos/dll/keyboard/kbdmac/kbdmac.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdmac.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdmac/kbdmac.rbuild b/reactos/dll/keyboard/kbdmac/kbdmac.rbuild index 3aeb55c9716..ed855b1ed3c 100644 --- a/reactos/dll/keyboard/kbdmac/kbdmac.rbuild +++ b/reactos/dll/keyboard/kbdmac/kbdmac.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdmac.c kbdmac.rc + kbdmac.spec diff --git a/reactos/dll/keyboard/kbdmac/kbdmac.spec b/reactos/dll/keyboard/kbdmac/kbdmac.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdmac/kbdmac.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdne/kbdne.def b/reactos/dll/keyboard/kbdne/kbdne.def deleted file mode 100644 index 443b275ca2e..00000000000 --- a/reactos/dll/keyboard/kbdne/kbdne.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdne.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdne/kbdne.rbuild b/reactos/dll/keyboard/kbdne/kbdne.rbuild index 304736f25e5..926c5b01d61 100644 --- a/reactos/dll/keyboard/kbdne/kbdne.rbuild +++ b/reactos/dll/keyboard/kbdne/kbdne.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdne.c kbdne.rc + kbdne.spec diff --git a/reactos/dll/keyboard/kbdne/kbdne.spec b/reactos/dll/keyboard/kbdne/kbdne.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdne/kbdne.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdno/kbdno.def b/reactos/dll/keyboard/kbdno/kbdno.def deleted file mode 100644 index 0e90fbc0428..00000000000 --- a/reactos/dll/keyboard/kbdno/kbdno.def +++ /dev/null @@ -1,3 +0,0 @@ -LIBRARY kbdno.dll -EXPORTS -KbdLayerDescriptor@0 diff --git a/reactos/dll/keyboard/kbdno/kbdno.rbuild b/reactos/dll/keyboard/kbdno/kbdno.rbuild index da0ee5982b6..8c53f1afb43 100644 --- a/reactos/dll/keyboard/kbdno/kbdno.rbuild +++ b/reactos/dll/keyboard/kbdno/kbdno.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdno.c kbdno.rc + kbdno.spec diff --git a/reactos/dll/keyboard/kbdno/kbdno.spec b/reactos/dll/keyboard/kbdno/kbdno.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdno/kbdno.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdpl1/kbdpl1.def b/reactos/dll/keyboard/kbdpl1/kbdpl1.def deleted file mode 100644 index eb8b6eeb5be..00000000000 --- a/reactos/dll/keyboard/kbdpl1/kbdpl1.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdpl1.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdpl1/kbdpl1.rbuild b/reactos/dll/keyboard/kbdpl1/kbdpl1.rbuild index 175a0ba6484..c67bec16713 100644 --- a/reactos/dll/keyboard/kbdpl1/kbdpl1.rbuild +++ b/reactos/dll/keyboard/kbdpl1/kbdpl1.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdpl1.c kbdpl1.rc + kbdpl1.spec diff --git a/reactos/dll/keyboard/kbdpl1/kbdpl1.spec b/reactos/dll/keyboard/kbdpl1/kbdpl1.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdpl1/kbdpl1.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdpo/kbdpo.def b/reactos/dll/keyboard/kbdpo/kbdpo.def deleted file mode 100644 index 3d2b976bdcd..00000000000 --- a/reactos/dll/keyboard/kbdpo/kbdpo.def +++ /dev/null @@ -1,3 +0,0 @@ -LIBRARY kbdpo.dll -EXPORTS -KbdLayerDescriptor@0 diff --git a/reactos/dll/keyboard/kbdpo/kbdpo.rbuild b/reactos/dll/keyboard/kbdpo/kbdpo.rbuild index c325b8536cb..2610aff858f 100644 --- a/reactos/dll/keyboard/kbdpo/kbdpo.rbuild +++ b/reactos/dll/keyboard/kbdpo/kbdpo.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdpo.c kbdpo.rc + kbdpo.spec diff --git a/reactos/dll/keyboard/kbdpo/kbdpo.spec b/reactos/dll/keyboard/kbdpo/kbdpo.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdpo/kbdpo.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdro/kbdro.def b/reactos/dll/keyboard/kbdro/kbdro.def deleted file mode 100644 index fa55b031e4a..00000000000 --- a/reactos/dll/keyboard/kbdro/kbdro.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdro.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdro/kbdro.rbuild b/reactos/dll/keyboard/kbdro/kbdro.rbuild index 05b23d6cf23..15fee3807ef 100644 --- a/reactos/dll/keyboard/kbdro/kbdro.rbuild +++ b/reactos/dll/keyboard/kbdro/kbdro.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdro.c kbdro.rc + kbdro.spec diff --git a/reactos/dll/keyboard/kbdro/kbdro.spec b/reactos/dll/keyboard/kbdro/kbdro.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdro/kbdro.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdru/kbdru.def b/reactos/dll/keyboard/kbdru/kbdru.def deleted file mode 100644 index 6f2972c8b00..00000000000 --- a/reactos/dll/keyboard/kbdru/kbdru.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdru.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdru/kbdru.rbuild b/reactos/dll/keyboard/kbdru/kbdru.rbuild index d35756e1dc5..7d84ce5d932 100644 --- a/reactos/dll/keyboard/kbdru/kbdru.rbuild +++ b/reactos/dll/keyboard/kbdru/kbdru.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdru.c kbdru.rc + kbdru.spec diff --git a/reactos/dll/keyboard/kbdru/kbdru.spec b/reactos/dll/keyboard/kbdru/kbdru.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdru/kbdru.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdru1/kbdru1.def b/reactos/dll/keyboard/kbdru1/kbdru1.def deleted file mode 100644 index 6f4776c3980..00000000000 --- a/reactos/dll/keyboard/kbdru1/kbdru1.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdru1.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdru1/kbdru1.rbuild b/reactos/dll/keyboard/kbdru1/kbdru1.rbuild index ef96031a21a..104e57ba165 100644 --- a/reactos/dll/keyboard/kbdru1/kbdru1.rbuild +++ b/reactos/dll/keyboard/kbdru1/kbdru1.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdru1.c kbdru1.rc + kbdru1.spec diff --git a/reactos/dll/keyboard/kbdru1/kbdru1.spec b/reactos/dll/keyboard/kbdru1/kbdru1.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdru1/kbdru1.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdsg/kbdsg.def b/reactos/dll/keyboard/kbdsg/kbdsg.def deleted file mode 100644 index 529859364c2..00000000000 --- a/reactos/dll/keyboard/kbdsg/kbdsg.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdsg.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdsg/kbdsg.rbuild b/reactos/dll/keyboard/kbdsg/kbdsg.rbuild index 7b88c28d423..dfb5dcabe71 100644 --- a/reactos/dll/keyboard/kbdsg/kbdsg.rbuild +++ b/reactos/dll/keyboard/kbdsg/kbdsg.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdsg.c kbdsg.rc + kbdsg.spec diff --git a/reactos/dll/keyboard/kbdsg/kbdsg.spec b/reactos/dll/keyboard/kbdsg/kbdsg.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdsg/kbdsg.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdsk/kbdsk.def b/reactos/dll/keyboard/kbdsk/kbdsk.def deleted file mode 100644 index b0600ad2ee2..00000000000 --- a/reactos/dll/keyboard/kbdsk/kbdsk.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdsk.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdsk/kbdsk.rbuild b/reactos/dll/keyboard/kbdsk/kbdsk.rbuild index 1ca92a58d2f..db0938767a2 100644 --- a/reactos/dll/keyboard/kbdsk/kbdsk.rbuild +++ b/reactos/dll/keyboard/kbdsk/kbdsk.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdsk.c kbdsk.rc + kbdsk.spec diff --git a/reactos/dll/keyboard/kbdsk/kbdsk.spec b/reactos/dll/keyboard/kbdsk/kbdsk.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdsk/kbdsk.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdsk1/kbdsk1.def b/reactos/dll/keyboard/kbdsk1/kbdsk1.def deleted file mode 100644 index 2157030c0a9..00000000000 --- a/reactos/dll/keyboard/kbdsk1/kbdsk1.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdsk1.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdsk1/kbdsk1.rbuild b/reactos/dll/keyboard/kbdsk1/kbdsk1.rbuild index 49fc7a46bdb..e639566fd9c 100644 --- a/reactos/dll/keyboard/kbdsk1/kbdsk1.rbuild +++ b/reactos/dll/keyboard/kbdsk1/kbdsk1.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdsk1.c kbdsk1.rc + kbdsk1.spec diff --git a/reactos/dll/keyboard/kbdsk1/kbdsk1.spec b/reactos/dll/keyboard/kbdsk1/kbdsk1.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdsk1/kbdsk1.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdsw/kbdsw.def b/reactos/dll/keyboard/kbdsw/kbdsw.def deleted file mode 100644 index 6f6c4e514e0..00000000000 --- a/reactos/dll/keyboard/kbdsw/kbdsw.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdsw.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdsw/kbdsw.rbuild b/reactos/dll/keyboard/kbdsw/kbdsw.rbuild index 45570b4f788..70733e95c0a 100644 --- a/reactos/dll/keyboard/kbdsw/kbdsw.rbuild +++ b/reactos/dll/keyboard/kbdsw/kbdsw.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdsw.c kbdsw.rc + kbdsw.spec diff --git a/reactos/dll/keyboard/kbdsw/kbdsw.spec b/reactos/dll/keyboard/kbdsw/kbdsw.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdsw/kbdsw.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdtat/kbdtat.def b/reactos/dll/keyboard/kbdtat/kbdtat.def deleted file mode 100644 index 32dfbadd26e..00000000000 --- a/reactos/dll/keyboard/kbdtat/kbdtat.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdtat.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdtat/kbdtat.rbuild b/reactos/dll/keyboard/kbdtat/kbdtat.rbuild index 72678738cb7..b158a4bed4d 100644 --- a/reactos/dll/keyboard/kbdtat/kbdtat.rbuild +++ b/reactos/dll/keyboard/kbdtat/kbdtat.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdtat.c kbdtat.rc + kbdtat.spec diff --git a/reactos/dll/keyboard/kbdtat/kbdtat.spec b/reactos/dll/keyboard/kbdtat/kbdtat.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdtat/kbdtat.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdth0/kbdth0.def b/reactos/dll/keyboard/kbdth0/kbdth0.def deleted file mode 100644 index 9516ffc4327..00000000000 --- a/reactos/dll/keyboard/kbdth0/kbdth0.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdth0.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdth0/kbdth0.rbuild b/reactos/dll/keyboard/kbdth0/kbdth0.rbuild index 45318db0432..57dac75db54 100644 --- a/reactos/dll/keyboard/kbdth0/kbdth0.rbuild +++ b/reactos/dll/keyboard/kbdth0/kbdth0.rbuild @@ -1,10 +1,11 @@ - - + + include 0x0500 kbdth0.c kbdth0.rc + kbdth0.spec diff --git a/reactos/dll/keyboard/kbdth0/kbdth0.spec b/reactos/dll/keyboard/kbdth0/kbdth0.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdth0/kbdth0.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdth1/kbdth1.def b/reactos/dll/keyboard/kbdth1/kbdth1.def deleted file mode 100644 index 02ecd264f3d..00000000000 --- a/reactos/dll/keyboard/kbdth1/kbdth1.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdth1.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdth1/kbdth1.rbuild b/reactos/dll/keyboard/kbdth1/kbdth1.rbuild index 1b76f6fc5c0..918ccaef910 100644 --- a/reactos/dll/keyboard/kbdth1/kbdth1.rbuild +++ b/reactos/dll/keyboard/kbdth1/kbdth1.rbuild @@ -1,10 +1,11 @@ - - + + include 0x0500 kbdth1.c kbdth1.rc + kbdth1.spec diff --git a/reactos/dll/keyboard/kbdth1/kbdth1.spec b/reactos/dll/keyboard/kbdth1/kbdth1.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdth1/kbdth1.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdth2/kbdth2.def b/reactos/dll/keyboard/kbdth2/kbdth2.def deleted file mode 100644 index e04b8b8467d..00000000000 --- a/reactos/dll/keyboard/kbdth2/kbdth2.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdth2.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdth2/kbdth2.rbuild b/reactos/dll/keyboard/kbdth2/kbdth2.rbuild index e578b76c89a..23028cde79c 100644 --- a/reactos/dll/keyboard/kbdth2/kbdth2.rbuild +++ b/reactos/dll/keyboard/kbdth2/kbdth2.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdth2.c kbdth2.rc + kbdth2.spec diff --git a/reactos/dll/keyboard/kbdth2/kbdth2.spec b/reactos/dll/keyboard/kbdth2/kbdth2.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdth2/kbdth2.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdth3/kbdth3.def b/reactos/dll/keyboard/kbdth3/kbdth3.def deleted file mode 100644 index 8f3e4662a9b..00000000000 --- a/reactos/dll/keyboard/kbdth3/kbdth3.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdth3.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdth3/kbdth3.rbuild b/reactos/dll/keyboard/kbdth3/kbdth3.rbuild index 13266791d42..8d4599d7fbf 100644 --- a/reactos/dll/keyboard/kbdth3/kbdth3.rbuild +++ b/reactos/dll/keyboard/kbdth3/kbdth3.rbuild @@ -1,10 +1,11 @@ - - + + include 0x0500 kbdth3.c kbdth3.rc + kbdth3.spec diff --git a/reactos/dll/keyboard/kbdth3/kbdth3.spec b/reactos/dll/keyboard/kbdth3/kbdth3.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdth3/kbdth3.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdtuf/kbdtuf.def b/reactos/dll/keyboard/kbdtuf/kbdtuf.def deleted file mode 100644 index 6d1e5808f5e..00000000000 --- a/reactos/dll/keyboard/kbdtuf/kbdtuf.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdtuf.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdtuf/kbdtuf.rbuild b/reactos/dll/keyboard/kbdtuf/kbdtuf.rbuild index d57200cc540..5b0064c6adf 100644 --- a/reactos/dll/keyboard/kbdtuf/kbdtuf.rbuild +++ b/reactos/dll/keyboard/kbdtuf/kbdtuf.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdtuf.c kbdtuf.rc + kbdtuf.spec diff --git a/reactos/dll/keyboard/kbdtuf/kbdtuf.spec b/reactos/dll/keyboard/kbdtuf/kbdtuf.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdtuf/kbdtuf.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdtuq/kbdtuq.def b/reactos/dll/keyboard/kbdtuq/kbdtuq.def deleted file mode 100644 index 9846b631a03..00000000000 --- a/reactos/dll/keyboard/kbdtuq/kbdtuq.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdtuq.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdtuq/kbdtuq.rbuild b/reactos/dll/keyboard/kbdtuq/kbdtuq.rbuild index bf2c1f56157..1cc516fcce8 100644 --- a/reactos/dll/keyboard/kbdtuq/kbdtuq.rbuild +++ b/reactos/dll/keyboard/kbdtuq/kbdtuq.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdtuq.c kbdtuq.rc + kbdtuq.spec diff --git a/reactos/dll/keyboard/kbdtuq/kbdtuq.spec b/reactos/dll/keyboard/kbdtuq/kbdtuq.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdtuq/kbdtuq.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbduk/kbduk.def b/reactos/dll/keyboard/kbduk/kbduk.def deleted file mode 100644 index 984901486b1..00000000000 --- a/reactos/dll/keyboard/kbduk/kbduk.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbduk.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbduk/kbduk.rbuild b/reactos/dll/keyboard/kbduk/kbduk.rbuild index dd1c50acab7..50cc9b84b18 100644 --- a/reactos/dll/keyboard/kbduk/kbduk.rbuild +++ b/reactos/dll/keyboard/kbduk/kbduk.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbduk.c kbduk.rc + kbduk.spec diff --git a/reactos/dll/keyboard/kbduk/kbduk.spec b/reactos/dll/keyboard/kbduk/kbduk.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbduk/kbduk.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdur/kbdur.def b/reactos/dll/keyboard/kbdur/kbdur.def deleted file mode 100644 index 717b43c4bb0..00000000000 --- a/reactos/dll/keyboard/kbdur/kbdur.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdur.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdur/kbdur.rbuild b/reactos/dll/keyboard/kbdur/kbdur.rbuild index 47975b35eea..c38ab572c03 100644 --- a/reactos/dll/keyboard/kbdur/kbdur.rbuild +++ b/reactos/dll/keyboard/kbdur/kbdur.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdur.c kbdur.rc + kbdur.spec diff --git a/reactos/dll/keyboard/kbdur/kbdur.spec b/reactos/dll/keyboard/kbdur/kbdur.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdur/kbdur.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdurs/kbdurs.def b/reactos/dll/keyboard/kbdurs/kbdurs.def deleted file mode 100644 index 587658d268a..00000000000 --- a/reactos/dll/keyboard/kbdurs/kbdurs.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdurs.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdurs/kbdurs.rbuild b/reactos/dll/keyboard/kbdurs/kbdurs.rbuild index 08d7239f29a..91c94bdb1ef 100644 --- a/reactos/dll/keyboard/kbdurs/kbdurs.rbuild +++ b/reactos/dll/keyboard/kbdurs/kbdurs.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdurs.c kbdurs.rc + kbdurs.spec diff --git a/reactos/dll/keyboard/kbdurs/kbdurs.spec b/reactos/dll/keyboard/kbdurs/kbdurs.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdurs/kbdurs.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdus/kbdus.def b/reactos/dll/keyboard/kbdus/kbdus.def deleted file mode 100644 index 309f9bc6188..00000000000 --- a/reactos/dll/keyboard/kbdus/kbdus.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdus.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdus/kbdus.rbuild b/reactos/dll/keyboard/kbdus/kbdus.rbuild index 4e0e24fc27e..42c7ca0e090 100644 --- a/reactos/dll/keyboard/kbdus/kbdus.rbuild +++ b/reactos/dll/keyboard/kbdus/kbdus.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdus.c kbdus.rc + kbdus.spec diff --git a/reactos/dll/keyboard/kbdus/kbdus.spec b/reactos/dll/keyboard/kbdus/kbdus.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdus/kbdus.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdusa/kbdusa.def b/reactos/dll/keyboard/kbdusa/kbdusa.def deleted file mode 100644 index 1d065d8260c..00000000000 --- a/reactos/dll/keyboard/kbdusa/kbdusa.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdusa.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdusa/kbdusa.rbuild b/reactos/dll/keyboard/kbdusa/kbdusa.rbuild index ba81f601ace..c9dc1b90799 100644 --- a/reactos/dll/keyboard/kbdusa/kbdusa.rbuild +++ b/reactos/dll/keyboard/kbdusa/kbdusa.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdusa.c kbdusa.rc + kbdusa.spec diff --git a/reactos/dll/keyboard/kbdusa/kbdusa.spec b/reactos/dll/keyboard/kbdusa/kbdusa.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdusa/kbdusa.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdusl/kbdusl.def b/reactos/dll/keyboard/kbdusl/kbdusl.def deleted file mode 100644 index 1d5b0a9303e..00000000000 --- a/reactos/dll/keyboard/kbdusl/kbdusl.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdusl.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdusl/kbdusl.rbuild b/reactos/dll/keyboard/kbdusl/kbdusl.rbuild index 1b96f09024b..80de56da78a 100644 --- a/reactos/dll/keyboard/kbdusl/kbdusl.rbuild +++ b/reactos/dll/keyboard/kbdusl/kbdusl.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdusl.c kbdusl.rc + kbdusl.spec diff --git a/reactos/dll/keyboard/kbdusl/kbdusl.spec b/reactos/dll/keyboard/kbdusl/kbdusl.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdusl/kbdusl.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdusr/kbdusr.def b/reactos/dll/keyboard/kbdusr/kbdusr.def deleted file mode 100644 index a64407986e2..00000000000 --- a/reactos/dll/keyboard/kbdusr/kbdusr.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdusr.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdusr/kbdusr.rbuild b/reactos/dll/keyboard/kbdusr/kbdusr.rbuild index e45630ad744..3fa2412a282 100644 --- a/reactos/dll/keyboard/kbdusr/kbdusr.rbuild +++ b/reactos/dll/keyboard/kbdusr/kbdusr.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdusr.c kbdusr.rc + kbdusr.spec diff --git a/reactos/dll/keyboard/kbdusr/kbdusr.spec b/reactos/dll/keyboard/kbdusr/kbdusr.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdusr/kbdusr.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdusx/kbdusx.def b/reactos/dll/keyboard/kbdusx/kbdusx.def deleted file mode 100644 index 0620d16f7db..00000000000 --- a/reactos/dll/keyboard/kbdusx/kbdusx.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdusx.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdusx/kbdusx.rbuild b/reactos/dll/keyboard/kbdusx/kbdusx.rbuild index bab07196b9a..c2eb6e9bece 100644 --- a/reactos/dll/keyboard/kbdusx/kbdusx.rbuild +++ b/reactos/dll/keyboard/kbdusx/kbdusx.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdusx.c kbdusx.rc + kbdusx.spec diff --git a/reactos/dll/keyboard/kbdusx/kbdusx.spec b/reactos/dll/keyboard/kbdusx/kbdusx.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdusx/kbdusx.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbduzb/kbduzb.def b/reactos/dll/keyboard/kbduzb/kbduzb.def deleted file mode 100644 index d0ebc72497c..00000000000 --- a/reactos/dll/keyboard/kbduzb/kbduzb.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbduzb.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbduzb/kbduzb.rbuild b/reactos/dll/keyboard/kbduzb/kbduzb.rbuild index 24b1e7430ce..cf995a05315 100644 --- a/reactos/dll/keyboard/kbduzb/kbduzb.rbuild +++ b/reactos/dll/keyboard/kbduzb/kbduzb.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbduzb.c kbduzb.rc + kbduzb.spec diff --git a/reactos/dll/keyboard/kbduzb/kbduzb.spec b/reactos/dll/keyboard/kbduzb/kbduzb.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbduzb/kbduzb.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdvntc/kbdvntc.def b/reactos/dll/keyboard/kbdvntc/kbdvntc.def deleted file mode 100644 index c5850fa73c0..00000000000 --- a/reactos/dll/keyboard/kbdvntc/kbdvntc.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdvntc.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdvntc/kbdvntc.rbuild b/reactos/dll/keyboard/kbdvntc/kbdvntc.rbuild index 220e0aa1763..472e3f9ce11 100644 --- a/reactos/dll/keyboard/kbdvntc/kbdvntc.rbuild +++ b/reactos/dll/keyboard/kbdvntc/kbdvntc.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdvntc.c kbdvntc.rc + kbdvntc.spec diff --git a/reactos/dll/keyboard/kbdvntc/kbdvntc.spec b/reactos/dll/keyboard/kbdvntc/kbdvntc.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdvntc/kbdvntc.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdycc/kbdycc.def b/reactos/dll/keyboard/kbdycc/kbdycc.def deleted file mode 100644 index 20e1dd29d00..00000000000 --- a/reactos/dll/keyboard/kbdycc/kbdycc.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdycc.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdycc/kbdycc.rbuild b/reactos/dll/keyboard/kbdycc/kbdycc.rbuild index 55191d630af..bc81aa50ea5 100644 --- a/reactos/dll/keyboard/kbdycc/kbdycc.rbuild +++ b/reactos/dll/keyboard/kbdycc/kbdycc.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdycc.c kbdycc.rc + kbdycc.spec diff --git a/reactos/dll/keyboard/kbdycc/kbdycc.spec b/reactos/dll/keyboard/kbdycc/kbdycc.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdycc/kbdycc.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/keyboard/kbdycl/kbdycl.def b/reactos/dll/keyboard/kbdycl/kbdycl.def deleted file mode 100644 index 147c20aaa57..00000000000 --- a/reactos/dll/keyboard/kbdycl/kbdycl.def +++ /dev/null @@ -1,8 +0,0 @@ -; -; ReactOS Operating System -; -LIBRARY kbdycl.dll - -EXPORTS -KbdLayerDescriptor@0 -;EOF diff --git a/reactos/dll/keyboard/kbdycl/kbdycl.rbuild b/reactos/dll/keyboard/kbdycl/kbdycl.rbuild index 2a26e60817f..4da9d79adb4 100644 --- a/reactos/dll/keyboard/kbdycl/kbdycl.rbuild +++ b/reactos/dll/keyboard/kbdycl/kbdycl.rbuild @@ -1,10 +1,11 @@ - + include 0x0500 kbdycl.c kbdycl.rc + kbdycl.spec diff --git a/reactos/dll/keyboard/kbdycl/kbdycl.spec b/reactos/dll/keyboard/kbdycl/kbdycl.spec new file mode 100644 index 00000000000..e1c7a26c1c4 --- /dev/null +++ b/reactos/dll/keyboard/kbdycl/kbdycl.spec @@ -0,0 +1 @@ +@ stdcall KbdLayerDescriptor() \ No newline at end of file diff --git a/reactos/dll/ntdll/def/ntdll_arm.def b/reactos/dll/ntdll/def/ntdll_arm.def index 81c7cb19ee2..b14c729222f 100644 --- a/reactos/dll/ntdll/def/ntdll_arm.def +++ b/reactos/dll/ntdll/def/ntdll_arm.def @@ -292,6 +292,7 @@ NtWriteFileGather NtWriteRequestData NtWriteVirtualMemory NtYieldExecution +NtGetCurrentProcessorNumber ;PfxFindPrefix ;PfxInitialize ;PfxInsertPrefix diff --git a/reactos/dll/ntdll/def/ntdll_i386.def b/reactos/dll/ntdll/def/ntdll_i386.def index ad9b6cdfe2c..2e05d98f16b 100644 --- a/reactos/dll/ntdll/def/ntdll_i386.def +++ b/reactos/dll/ntdll/def/ntdll_i386.def @@ -1,4 +1,3 @@ -; $Id$ ; ; ReactOS Operating System ; @@ -23,11 +22,14 @@ CsrSetPriorityClass@8 DbgBreakPoint@0 DbgPrint DbgPrintEx +DbgPrintReturnControlC DbgPrompt@12 -DbgUiConvertStateChangeStructure@8 -DbgUiDebugActiveProcess@4 +DbgQueryDebugFilterState@8 +DbgSetDebugFilterState@12 DbgUiConnectToDbg@0 DbgUiContinue@8 +DbgUiConvertStateChangeStructure@8 +DbgUiDebugActiveProcess@4 DbgUiGetThreadDebugObject@0 DbgUiIssueRemoteBreakin@4 DbgUiRemoteBreakin@0 @@ -35,30 +37,89 @@ DbgUiSetThreadDebugObject@4 DbgUiStopDebugging@4 DbgUiWaitStateChange@8 DbgUserBreakPoint@0 +;EtwControlTraceA +;EtwControlTraceW +;EtwControlTraceW +;EtwCreateTraceInstanceId +;EtwEnableTrace +;EtwEnumerateTraceGuids +;EtwFlushTraceA +;EtwFlushTraceW +;EtwGetTraceEnableFlags +;EtwGetTraceEnableLevel +;EtwGetTraceLoggerHandle +;EtwNotificationRegistrationA +;EtwNotificationRegistrationW +;EtwQueryAllTracesA +;EtwQueryAllTracesW +;EtwQueryTraceA +;EtwQueryTraceW +;EtwReceiveNotificationsA +;EtwReceiveNotificationsW +;EtwRegisterTraceGuidsA +;EtwRegisterTraceGuidsW +;EtwStartTraceA +;EtwStartTraceW +;EtwStopTraceA +;EtwStopTraceW +;EtwTraceEvent +;EtwTraceEventInstance +;EtwTraceMessage +;EtwTraceMessageVa +;EtwUnregisterTraceGuids +;EtwUpdateTraceA +;EtwUpdateTraceW +;EtwpGetTraceBuffer +;EtwpSetHWConfigFunction +;ExpInterlockedPopEntrySListEnd +;ExpInterlockedPopEntrySListFault +;ExpInterlockedPopEntrySListResume +KiFastSystemCall@0 +KiFastSystemCallRet@0 +KiIntSystemCall@0 KiRaiseUserExceptionDispatcher@0 KiUserApcDispatcher@16 KiUserCallbackDispatcher@12 KiUserExceptionDispatcher@8 -KiIntSystemCall@0 -KiFastSystemCallRet@0 -KiFastSystemCall@0 +;LdrAccessOutOfProcessResource LdrAccessResource@16 LdrAddRefDll@8 +;LdrAlternateResourcesEnabled +;LdrCreateOutOfProcessImage +;LdrDestroyOutOfProcessImage LdrDisableThreadCalloutsForDll@4 LdrEnumResources@20 LdrFindEntryForAddress@8 +;LdrEnumerateLoadedModules +;LdrFindCreateProcessManifest +;LdrFindEntryForAddress LdrFindResourceDirectory_U@16 +;LdrFindResourceEx_U LdrFindResource_U@16 LdrGetDllHandle@16 +;LdrFlushAlternateResourceModules +;LdrGetDllHandle +;LdrGetDllHandleEx LdrGetProcedureAddress@16 +;LdrHotPatchRoutine +;LdrInitShimEngineDynamic LdrInitializeThunk@16 +;LdrLoadAlternateResourceModule LdrLoadDll@16 +;LdrLockLoaderLock +;LdrOpenImageFileOptionsKey LdrProcessRelocationBlock@16 LdrQueryImageFileExecutionOptions@24 +;LdrQueryImageFileExecutionOptionsEx +;LdrQueryImageFileKeyOption LdrQueryProcessModuleInformation@12 +;LdrSetAppCompatDllRedirectionCallback +;LdrSetDllManifestProber LdrShutdownProcess@0 LdrShutdownThread@0 +;LdrUnloadAlternateResourceModule LdrUnloadDll@4 +;LdrUnlockLoaderLock LdrVerifyImageMatchesChecksum@16 NlsAnsiCodePage DATA NlsMbCodePageTag DATA @@ -66,24 +127,36 @@ NlsMbOemCodePageTag DATA NtAcceptConnectPort@24 NtAccessCheck@32 NtAccessCheckAndAuditAlarm@44 +NtAccessCheckByType@44 +NtAccessCheckByTypeAndAuditAlarm@64 +NtAccessCheckByTypeResultList@44 +NtAccessCheckByTypeResultListAndAuditAlarm@64 +NtAccessCheckByTypeResultListAndAuditAlarmByHandle@68 NtAddAtom@12 NtAddBootEntry@8 +NtAddDriverEntry@8 NtAdjustGroupsToken@24 NtAdjustPrivilegesToken@24 NtAlertResumeThread@8 NtAlertThread@4 NtAllocateLocallyUniqueId@4 +NtAllocateUserPhysicalPages@12 NtAllocateUuids@16 NtAllocateVirtualMemory@24 +NtApphelpCacheControl@8 +NtAreMappedFilesTheSame@8 NtAssignProcessToJobObject@8 NtCallbackReturn@12 +NtCancelDeviceWakeupRequest@4 NtCancelIoFile@8 NtCancelTimer@8 NtClearEvent@4 NtClose@4 NtCloseObjectAuditAlarm@12 +NtCompactKeys@8 NtCompareTokens@12 NtCompleteConnectPort@4 +NtCompressKey@4 NtConnectPort@32 NtContinue@8 NtCreateDebugObject@16 @@ -93,13 +166,16 @@ NtCreateEventPair@12 NtCreateFile@44 NtCreateIoCompletion@16 NtCreateJobObject@12 +NtCreateJobSet@12 NtCreateKey@28 +NtCreateKeyedEvent@16 NtCreateMailslotFile@32 NtCreateMutant@16 NtCreateNamedPipeFile@56 NtCreatePagingFile@16 NtCreatePort@20 NtCreateProcess@32 +NtCreateProcessEx@36 NtCreateProfile@36 NtCreateSection@28 NtCreateSemaphore@20 @@ -109,9 +185,12 @@ NtCreateTimer@16 NtCreateToken@52 NtCreateWaitablePort@20 NtCurrentTeb=_NtCurrentTeb@0 +NtDebugActiveProcess@8 NtDebugContinue@12 NtDelayExecution@8 NtDeleteAtom@4 +NtDeleteBootEntry@4 +NtDeleteDriverEntry@4 NtDeleteFile@4 NtDeleteKey@4 NtDeleteObjectAuditAlarm@12 @@ -120,34 +199,54 @@ NtDeviceIoControlFile@40 NtDisplayString@4 NtDuplicateObject@28 NtDuplicateToken@24 +NtEnumerateBootEntries@8 +NtEnumerateDriverEntries@8 NtEnumerateKey@24 +NtEnumerateSystemEnvironmentValuesEx@12 NtEnumerateValueKey@24 NtExtendSection@8 +NtFilterToken@24 NtFindAtom@12 NtFlushBuffersFile@8 NtFlushInstructionCache@12 NtFlushKey@4 NtFlushVirtualMemory@16 NtFlushWriteBuffer@0 +NtFreeUserPhysicalPages@12 NtFreeVirtualMemory@16 NtFsControlFile@40 NtGetContextThread@8 +NtGetCurrentProcessorNumber@0 +NtGetDevicePowerState@8 NtGetPlugPlayEvent@16 +;NtGetTickCount +NtGetWriteWatch@28 NtImpersonateAnonymousToken@4 NtImpersonateClientOfPort@8 NtImpersonateThread@12 NtInitializeRegistry@4 +NtInitiatePowerAction@16 NtIsProcessInJob@8 +NtIsSystemResumeAutomatic@0 NtListenPort@8 NtLoadDriver@4 NtLoadKey@8 NtLoadKey2@12 +NtLoadKeyEx@16 NtLockFile@40 +NtLockProductActivationKeys@8 +NtLockRegistryKey@4 NtLockVirtualMemory@16 +NtMakePermanentObject@4 NtMakeTemporaryObject@4 +NtMapUserPhysicalPages@12 +NtMapUserPhysicalPagesScatter@12 NtMapViewOfSection@40 +NtModifyBootEntry@4 +NtModifyDriverEntry@4 NtNotifyChangeDirectoryFile@36 NtNotifyChangeKey@40 +NtNotifyChangeMultipleKeys@48 NtOpenDirectoryObject@12 NtOpenEvent@12 NtOpenEventPair@12 @@ -155,29 +254,35 @@ NtOpenFile@24 NtOpenIoCompletion@12 NtOpenJobObject@12 NtOpenKey@12 +NtOpenKeyedEvent@12 NtOpenMutant@12 NtOpenObjectAuditAlarm@48 NtOpenProcess@16 NtOpenProcessToken@12 +NtOpenProcessTokenEx@16 NtOpenSection@12 NtOpenSemaphore@12 NtOpenSymbolicLinkObject@12 NtOpenThread@16 NtOpenThreadToken@16 +NtOpenThreadTokenEx@20 NtOpenTimer@12 NtPlugPlayControl@12 NtPowerInformation@20 NtPrivilegeCheck@12 -NtPrivilegedServiceAuditAlarm@20 NtPrivilegeObjectAuditAlarm@24 +NtPrivilegedServiceAuditAlarm@20 NtProtectVirtualMemory@20 NtPulseEvent@8 NtQueryAttributesFile@8 +NtQueryBootEntryOrder@8 +NtQueryBootOptions@8 NtQueryDebugFilterState@8 NtQueryDefaultLocale@8 NtQueryDefaultUILanguage@4 NtQueryDirectoryFile@44 NtQueryDirectoryObject@28 +NtQueryDriverEntryOrder@8 NtQueryEaFile@36 NtQueryEvent@20 NtQueryFullAttributesFile@8 @@ -195,12 +300,17 @@ NtQueryKey@20 NtQueryMultipleValueKey@24 NtQueryMutant@20 NtQueryObject@20 +NtQueryOpenSubKeys@8 +NtQueryOpenSubKeysEx@16 NtQueryPerformanceCounter@8 +NtQueryPortInformationProcess@0 +NtQueryQuotaInformationFile@36 NtQuerySection@20 NtQuerySecurityObject@20 NtQuerySemaphore@20 NtQuerySymbolicLinkObject@12 NtQuerySystemEnvironmentValue@16 +NtQuerySystemEnvironmentValueEx@20 NtQuerySystemInformation@16 NtQuerySystemTime@4 NtQueryTimer@20 @@ -216,29 +326,41 @@ NtReadFileScatter@36 NtReadRequestData@24 NtReadVirtualMemory@20 NtRegisterThreadTerminatePort@4 +NtReleaseKeyedEvent@16 NtReleaseMutant@8 NtReleaseSemaphore@12 NtRemoveIoCompletion@20 +NtRemoveProcessDebug@8 +NtRenameKey@8 NtReplaceKey@12 NtReplyPort@8 NtReplyWaitReceivePort@16 NtReplyWaitReceivePortEx@20 NtReplyWaitReplyPort@8 +NtRequestDeviceWakeup@4 NtRequestPort@8 NtRequestWaitReplyPort@12 +NtRequestWakeupLatency@4 NtResetEvent@8 +NtResetWriteWatch@12 NtRestoreKey@12 NtResumeProcess@4 NtResumeThread@8 NtSaveKey@8 +NtSaveKeyEx@12 +NtSaveMergedKeys@12 NtSecureConnectPort@36 +NtSetBootEntryOrder@8 +NtSetBootOptions@8 NtSetContextThread@8 NtSetDebugFilterState@12 NtSetDefaultHardErrorPort@4 NtSetDefaultLocale@8 NtSetDefaultUILanguage@4 +NtSetDriverEntryOrder@8 NtSetEaFile@16 NtSetEvent@8 +NtSetEventBoostPriority@4 NtSetHighEventPair@4 NtSetHighWaitLowEventPair@4 NtSetInformationDebugObject@20 @@ -254,11 +376,14 @@ NtSetIoCompletion@20 NtSetLdtEntries@24 NtSetLowEventPair@4 NtSetLowWaitHighEventPair@4 +NtSetQuotaInformationFile@16 NtSetSecurityObject@12 NtSetSystemEnvironmentValue@8 +NtSetSystemEnvironmentValueEx@8 NtSetSystemInformation@12 NtSetSystemPowerState@12 NtSetSystemTime@8 +NtSetThreadExecutionState@8 NtSetTimer@28 NtSetTimerResolution@12 NtSetUuidSeed@4 @@ -275,14 +400,20 @@ NtTerminateJobObject@8 NtTerminateProcess@8 NtTerminateThread@8 NtTestAlert@0 +NtTraceEvent@16 +NtTranslateFilePath@16 NtUnloadDriver@4 NtUnloadKey@4 +NtUnloadKey2@8 +NtUnloadKeyEx@8 NtUnlockFile@20 NtUnlockVirtualMemory@16 NtUnmapViewOfSection@8 NtVdmControl@8 NtWaitForDebugEvent@16 +NtWaitForKeyedEvent@16 NtWaitForMultipleObjects@20 +NtWaitForMultipleObjects32@20 NtWaitForSingleObject@12 NtWaitHighEventPair@4 NtWaitLowEventPair@4 @@ -296,14 +427,17 @@ NtYieldExecution@0 ;PfxInsertPrefix ;PfxRemovePrefix ;PropertyLengthAsVariant -;RestoreEm87Context ;RtlAbortRXact RtlAbsoluteToSelfRelativeSD@12 RtlAcquirePebLock@0 +;RtlAcquirePrivilege RtlAcquireResourceExclusive@8 RtlAcquireResourceShared@8 RtlAcquireSRWLockExclusive@4 RtlAcquireSRWLockShared@4 +;RtlActivateActivationContext +;RtlActivateActivationContextEx +;RtlActivateActivationContextUnsafeFast RtlAddAccessAllowedAce@16 RtlAddAccessAllowedAceEx@20 RtlAddAccessAllowedObjectAce@28 @@ -319,9 +453,13 @@ RtlAddAuditAccessAceEx@28 RtlAddAuditAccessObjectAce@36 ;RtlAddCompoundAce RtlAddMandatoryAce@24 -RtlAddRange@36 +;RtlAddRefActivationContext +;RtlAddRefMemoryStream +;RtlAddVectoredContinueHandler RtlAddVectoredExceptionHandler@8 +;RtlAddressInSectionTable RtlAdjustPrivilege@16 +;RtlAllocateActivationContextStack RtlAllocateAndInitializeSid@44 RtlAllocateHandle@8 RtlAllocateHeap@12 @@ -329,6 +467,7 @@ RtlAnsiCharToUnicodeChar@4 RtlAnsiStringToUnicodeSize@4=RtlxAnsiStringToUnicodeSize@4 RtlAnsiStringToUnicodeString@12 RtlAppendAsciizToString@8 +;RtlAppendPathElement RtlAppendStringToString@8 RtlAppendUnicodeStringToString@8 RtlAppendUnicodeToString@8 @@ -339,11 +478,18 @@ RtlAreAnyAccessesGranted@8 RtlAreBitsClear@12 RtlAreBitsSet@12 RtlAssert@16 +;RtlCancelTimer +;RtlCaptureContext RtlCaptureStackBackTrace@16 +;RtlCaptureStackContext RtlCharToInteger@12 +;RtlCheckForOrphanedCriticalSections +;RtlCheckProcessParameters RtlCheckRegistryKey@8 RtlClearAllBits@4 RtlClearBits@12 +;RtlCloneMemoryStream +;RtlCommitMemoryStream RtlCompactHeap@8 RtlCompareMemory@12 RtlCompareMemoryUlong@12 @@ -351,30 +497,40 @@ RtlCompareString@12 RtlCompareUnicodeString@12 RtlCompressBuffer@32 RtlComputeCrc32@12 +;RtlComputeImportTableHash +;RtlComputePrivatizedDllName_U ;RtlConsoleMultiByteToUnicodeN RtlConvertExclusiveToShared@4 RtlConvertLongToLargeInteger@4 +;RtlConvertPropertyToVariant RtlConvertSharedToExclusive@4 RtlConvertSidToUnicodeString@12 +;RtlConvertToAutoInheritSecurityObject ;RtlConvertUiListToApiList RtlConvertUlongToLargeInteger@4 +;RtlConvertVariantToProperty RtlCopyLuid@8 RtlCopyLuidAndAttributesArray@12 -RtlCopyRangeList@8 +;RtlCopyMappedMemory +;RtlCopyMemoryStreamTo +;RtlCopyOutOfProcessMemoryStreamTo RtlCopySecurityDescriptor@8 RtlCopySid@12 RtlCopySidAndAttributesArray@28 RtlCopyString@8 RtlCopyUnicodeString@8 RtlCreateAcl@12 +;RtlCreateActivationContext ;RtlCreateAndSetSD RtlCreateAtomTable@8 +;RtlCreateBootStatusDataFile RtlCreateEnvironment@8 RtlCreateHeap@24 RtlCreateProcessParameters@40 RtlCreateQueryDebugBuffer@8 RtlCreateRegistryKey@8 RtlCreateSecurityDescriptor@8 +;RtlCreateSystemVolumeInformationFolder RtlCreateTagHeap@16 RtlCreateTimer@28 RtlCreateTimerQueue@4 @@ -386,9 +542,12 @@ RtlCreateUserThread@40 RtlCustomCPToUnicodeN@24 RtlCutoverTimeToSystemTime@16 RtlDeNormalizeProcessParams@4 +;RtlDeactivateActivationContext RtlDecodePointer=RtlEncodePointer@4 +;RtlDecodeSystemPointer RtlDecompressBuffer@24 RtlDecompressFragment@32 +;RtlDefaultNpAcl RtlDelete@4 RtlDeleteAce@8 RtlDeleteAtomFromAtomTable@8 @@ -396,8 +555,6 @@ RtlDeleteCriticalSection@4 RtlDeleteElementGenericTable@8 RtlDeleteElementGenericTableAvl@8 RtlDeleteNoSplay@8 -RtlDeleteOwnersRanges@8 -RtlDeleteRange@24 RtlDeleteRegistryValue@12 RtlDeleteResource@4 RtlDeleteSecurityObject@4 @@ -414,16 +571,23 @@ RtlDestroyProcessParameters@4 RtlDestroyQueryDebugBuffer@4 RtlDetermineDosPathNameType_U@4 RtlDllShutdownInProgress@0 +;RtlDnsHostNameToComputerName RtlDoesFileExists_U@4 +;RtlDosApplyFileIsolationRedirection_Ustr RtlDosPathNameToNtPathName_U@16 +;RtlDosPathNameToNtPathName_U_WithStatus RtlDosPathNameToRelativeNtPathName_U@16 +;RtlDosPathNameToRelativeNtPathName_U_WithStatus RtlDosSearchPath_U@24 +;RtlDosSearchPath_Ustr RtlDowncaseUnicodeChar@4 RtlDowncaseUnicodeString@12 RtlDumpResource@4 RtlDuplicateUnicodeString@12 RtlEmptyAtomTable@8 +;RtlEnableEarlyCriticalSectionEventCreation RtlEncodePointer@4 +;RtlEncodeSystemPointer RtlEnlargedIntegerMultiply@8 RtlEnlargedUnsignedDivide@16 RtlEnlargedUnsignedMultiply@8 @@ -450,47 +614,60 @@ RtlExtendedLargeIntegerDivide@16 RtlExtendedMagicDivide@20 RtlFillMemory@12 RtlFillMemoryUlong@12 +;RtlFinalReleaseOutOfProcessMemoryStream +;RtlFindActivationContextSectionGuid +;RtlFindActivationContextSectionString +;RtlFindCharInUnicodeString RtlFindClearBits@12 RtlFindClearBitsAndSet@12 RtlFindClearRuns@16 RtlFindLastBackwardRunClear@12 RtlFindLeastSignificantBit@8 RtlFindLongestRunClear@8 -RtlFindLongestRunSet@8 RtlFindMessage@20 RtlFindMostSignificantBit@8 RtlFindNextForwardRunClear@12 -RtlFindRange@48 RtlFindSetBits@12 RtlFindSetBitsAndClear@12 +;RtlFirstEntrySList RtlFirstFreeAce@8 +;RtlFlushSecureMemoryCache RtlFormatCurrentUserKeyPath@4 RtlFormatMessage@32 +;RtlFormatMessageEx +;RtlFreeActivationContextStack RtlFreeAnsiString@4 RtlFreeHandle@8 RtlFreeHeap@12 RtlFreeOemString@4 -RtlFreeRangeList@4 RtlFreeSid@4 +;RtlFreeThreadActivationContextStack RtlFreeUnicodeString@4 RtlFreeUserThreadStack@8 RtlGUIDFromString@8 RtlGenerate8dot3Name@16 RtlGetAce@12 +;RtlGetActiveActivationContext ;RtlGetCallersAddress RtlGetCompressionWorkSpaceSize@12 RtlGetControlSecurityDescriptor@12 +;RtlGetCriticalSectionRecursionCount RtlGetCurrentDirectory_U@8 +;RtlGetCurrentPeb +;RtlGetCurrentProcessorNumber RtlGetDaclSecurityDescriptor@16 RtlGetElementGenericTable@8 RtlGetElementGenericTableAvl@8 -RtlGetFirstRange@12 +;RtlGetFrame RtlGetFullPathName_U@16 +;RtlGetFullPathName_UstrEx RtlGetGroupSecurityDescriptor@12 RtlGetLastNtStatus@0 RtlGetLastWin32Error@0 +;RtlGetLengthWithoutLastFullDosOrNtPathElement +;RtlGetLengthWithoutTrailingPathSeperators RtlGetLongestNtPathLength@0 -RtlGetNextRange@12 +;RtlGetNativeSystemInformation RtlGetNtGlobalFlags@0 RtlGetNtProductType@4 RtlGetNtVersionNumbers@12 @@ -499,18 +676,24 @@ RtlGetProcessHeaps@8 RtlGetSaclSecurityDescriptor@16 RtlGetSecurityDescriptorRMControl@8 RtlGetSetBootStatusData@24 +;RtlGetThreadErrorMode +;RtlGetUnloadEventTrace RtlGetUserInfoHeap@20 RtlGetVersion@4 RtlHashUnicodeString@16 RtlIdentifierAuthoritySid@4 RtlImageDirectoryEntryToData@16 RtlImageNtHeader@4 +;RtlImageNtHeaderEx RtlImageRvaToSection@12 RtlImageRvaToVa@16 RtlImpersonateSelf@4 RtlInitAnsiString@8 +;RtlInitAnsiStringEx RtlInitCodePageTable@8 +;RtlInitMemoryStream RtlInitNlsTables@16 +;RtlInitOutOfProcessMemoryStream RtlInitString@8 RtlInitUnicodeString@8 RtlInitUnicodeStringEx@8 @@ -523,9 +706,9 @@ RtlInitializeCriticalSectionAndSpinCount@8 RtlInitializeGenericTable@20 RtlInitializeGenericTableAvl@20 RtlInitializeHandleTable@12 -RtlInitializeRangeList@4 -RtlInitializeResource@4 ;RtlInitializeRXact +RtlInitializeResource@4 +;RtlInitializeSListHead RtlInitializeSid@12 RtlInitializeSRWLock@4 RtlInsertElementGenericTable@16 @@ -535,7 +718,11 @@ RtlInsertElementGenericTableFullAvl@24 RtlInt64ToUnicodeString@16 RtlIntegerToChar@16 RtlIntegerToUnicodeString@12 -RtlInvertRangeList@8 +;RtlInterlockedCompareExchange64 +;RtlInterlockedFlushSList +;RtlInterlockedPopEntrySList +;RtlInterlockedPushEntrySList +;RtlInterlockedPushListSList RtlIpv4AddressToStringA@8 RtlIpv4AddressToStringExA@16 RtlIpv4AddressToStringExW@16 @@ -552,12 +739,15 @@ RtlIpv6StringToAddressA@12 RtlIpv6StringToAddressExA@16 RtlIpv6StringToAddressExW@16 RtlIpv6StringToAddressW@12 +;RtlIsActivationContextActive +;RtlIsCriticalSectionLocked +;RtlIsCriticalSectionLockedByThread RtlIsDosDeviceName_U@4 RtlIsGenericTableEmpty@4 RtlIsGenericTableEmptyAvl@4 RtlIsNameLegalDOS8Dot3@12 -RtlIsRangeAvailable@40 RtlIsTextUnicode@12 +;RtlIsThreadWithinLoaderCallout RtlIsValidHandle@8 RtlIsValidIndexHandle@12 RtlLargeIntegerAdd@16 @@ -575,6 +765,8 @@ RtlLengthSid@4 RtlLocalTimeToSystemTime@8 RtlLockBootStatusData@4 RtlLockHeap@4 +;RtlLockMemoryStreamRegion +;RtlLogStackBackTrace RtlLookupAtomInAtomTable@12 RtlLookupElementGenericTable@8 RtlLookupElementGenericTableAvl@8 @@ -582,16 +774,22 @@ RtlLookupElementGenericTableFull@16 RtlLookupElementGenericTableFullAvl@16 RtlMakeSelfRelativeSD@12 RtlMapGenericMask@8 -RtlMergeRangeLists@16 +;RtlMapSecurityErrorToNtStatus RtlMoveMemory@12 +;RtlMultiAppendUnicodeStringBuffer RtlMultiByteToUnicodeN@20 RtlMultiByteToUnicodeSize@12 +;RtlMultipleAllocateHeap +;RtlMultipleFreeHeap ;RtlNewInstanceSecurityObject ;RtlNewSecurityGrantedAccess RtlNewSecurityObject@24 +;RtlNewSecurityObjectEx +;RtlNewSecurityObjectWithMultipleInheritance RtlNormalizeProcessParams@4 RtlNtPathNameToDosPathName@16 RtlNtStatusToDosError@4 +;RtlNtStatusToDosErrorNoTeb RtlNumberGenericTableElements@4 RtlNumberGenericTableElementsAvl@4 RtlNumberOfClearBits@4 @@ -602,12 +800,19 @@ RtlOemToUnicodeN@20 RtlOpenCurrentUser@8 RtlPcToFileHeader@8 RtlPinAtomInAtomTable@8 +;RtlPopFrame RtlPrefixString@12 RtlPrefixUnicodeString@12 ;RtlProtectHeap +;RtlPushFrame RtlQueryAtomInAtomTable@24 +;RtlQueryDepthSList RtlQueryEnvironmentVariable_U@12 +;RtlQueryHeapInformation RtlQueryInformationAcl@16 +;RtlQueryInformationActivationContext +;RtlQueryInformationActiveActivationContext +;RtlQueryInterfaceMemoryStream ;RtlQueryProcessBackTraceInformation RtlQueryProcessDebugInformation@12 ;RtlQueryProcessHeapInformation @@ -616,30 +821,40 @@ RtlQueryRegistryValues@20 RtlQuerySecurityObject@20 RtlQueryTagHeap@20 RtlQueryTimeZoneInformation@4 +;RtlQueueApcWow64Thread RtlQueueWorkItem@12 RtlRaiseException@4 RtlRaiseStatus@4 RtlRandom@4 RtlRandomEx=RtlRandom@4 RtlReAllocateHeap@16 +;RtlReadMemoryStream +;RtlReadOutOfProcessMemoryStream RtlRealPredecessor@4 RtlRealSuccessor@4 +;RtlRegisterSecureMemoryCacheCallback RtlRegisterWait@24 +;RtlReleaseActivationContext +;RtlReleaseMemoryStream RtlReleasePebLock@0 +;RtlReleasePrivilege RtlReleaseRelativeName@4 RtlReleaseResource@4 RtlReleaseSRWLockExclusive@4 RtlReleaseSRWLockShared@4 ;RtlRemoteCall +;RtlRemoveVectoredContinueHandler RtlRemoveVectoredExceptionHandler@4 RtlResetRtlTranslations@4 RtlRestoreLastWin32Error@4=RtlSetLastWin32Error@4 +;RtlRevertMemoryStream RtlRunDecodeUnicodeString@8 RtlRunEncodeUnicodeString@8 RtlSecondsSince1970ToTime@8 RtlSecondsSince1980ToTime@8 -RtlSelfRelativeToAbsoluteSD2@8 +;RtlSeekMemoryStream RtlSelfRelativeToAbsoluteSD@44 +RtlSelfRelativeToAbsoluteSD2@8 RtlSetAllBits@4 RtlSetAttributesSecurityDescriptor@12 RtlSetBits@12 @@ -648,17 +863,27 @@ RtlSetCriticalSectionSpinCount@8 RtlSetCurrentDirectory_U@4 RtlSetCurrentEnvironment@8 RtlSetDaclSecurityDescriptor@16 +;RtlSetEnvironmentStrings RtlSetEnvironmentVariable@12 RtlSetGroupSecurityDescriptor@12 +;RtlSetHeapInformation RtlSetInformationAcl@16 +;RtlSetIoCompletionCallback RtlSetLastWin32Error@4 RtlSetLastWin32ErrorAndNtStatusFromNtStatus@4 +;RtlSetMemoryStreamSize RtlSetOwnerSecurityDescriptor@12 RtlSetProcessIsCritical@12 RtlSetSaclSecurityDescriptor@16 RtlSetSecurityDescriptorRMControl@8 RtlSetSecurityObject@20 +;RtlSetSecurityObjectEx +;RtlSetThreadErrorMode +;RtlSetThreadIsCritical +;RtlSetThreadPoolStartFunc RtlSetTimeZoneInformation@4 +;RtlSetTimer +;RtlSetUnhandledExceptionFilter ;RtlSetUnicodeCallouts RtlSetUserFlagsHeap@16 RtlSetUserValueHeap@16 @@ -667,6 +892,7 @@ RtlSleepConditionVariableCS@12 RtlSleepConditionVariableSRW@16 RtlSplay@4 ;RtlStartRXact +;RtlStatMemoryStream RtlStringFromGUID@8 RtlSubAuthorityCountSid@4 RtlSubAuthoritySid@8 @@ -678,10 +904,19 @@ RtlTimeToElapsedTimeFields@8 RtlTimeToSecondsSince1970@8 RtlTimeToSecondsSince1980@8 RtlTimeToTimeFields@8 +;RtlTraceDatabaseAdd +;RtlTraceDatabaseCreate +;RtlTraceDatabaseDestroy +;RtlTraceDatabaseEnumerate +;RtlTraceDatabaseFind +;RtlTraceDatabaseLock +;RtlTraceDatabaseUnlock +;RtlTraceDatabaseValidate RtlTryEnterCriticalSection@4 @RtlUlongByteSwap@4 @RtlUlonglongByteSwap@8 RtlUnhandledExceptionFilter@4 +;RtlUnhandledExceptionFilter2 RtlUnicodeStringToAnsiSize@4=RtlxUnicodeStringToAnsiSize@4 RtlUnicodeStringToAnsiString@12 RtlUnicodeStringToCountedOemString@12 @@ -695,6 +930,7 @@ RtlUnicodeToOemN@20 RtlUniform@4 RtlUnlockBootStatusData@4 RtlUnlockHeap@4 +;RtlUnlockMemoryStreamRegion RtlUnwind@16 RtlUpcaseUnicodeChar@4 RtlUpcaseUnicodeString@12 @@ -717,13 +953,21 @@ RtlValidateHeap@12 RtlValidateProcessHeaps@0 RtlValidateUnicodeString@8 RtlVerifyVersionInfo@16 +;RtlWalkFrameChain ;RtlWalkHeap +;RtlWow64EnableFsRedirection +;RtlWow64EnableFsRedirectionEx RtlWakeAllConditionVariable@4 RtlWakeConditionVariable@4 RtlWriteRegistryValue@24 +;RtlWriteMemoryStream +;RtlWriteRegistryValue ;RtlZeroHeap RtlZeroMemory@8 +;RtlZombifyActivationContext +;RtlpApplyLengthFunction RtlpEnsureBufferSize@12 +;RtlpNotOwnerCriticalSection RtlpNtCreateKey@24 RtlpNtEnumerateSubKey@16 RtlpNtMakeTemporaryKey@4 @@ -736,28 +980,39 @@ RtlxAnsiStringToUnicodeSize@4 RtlxOemStringToUnicodeSize@4 RtlxUnicodeStringToAnsiSize@4 RtlxUnicodeStringToOemSize@4 -;SaveEm87Context VerSetConditionMask@16 ZwAcceptConnectPort@24 ZwAccessCheck@32 ZwAccessCheckAndAuditAlarm@44 +ZwAccessCheckByType@44 +ZwAccessCheckByTypeAndAuditAlarm@64 +ZwAccessCheckByTypeResultList@44 +ZwAccessCheckByTypeResultListAndAuditAlarm@64 +ZwAccessCheckByTypeResultListAndAuditAlarmByHandle@68 ZwAddAtom@12 +ZwAddBootEntry@8 +ZwAddDriverEntry@8 ZwAdjustGroupsToken@24 ZwAdjustPrivilegesToken@24 ZwAlertResumeThread@8 ZwAlertThread@4 ZwAllocateLocallyUniqueId@4 +ZwAllocateUserPhysicalPages@12 ZwAllocateUuids@16 ZwAllocateVirtualMemory@24 +ZwApphelpCacheControl@8 ZwAssignProcessToJobObject@8 ZwCallbackReturn@12 +ZwCancelDeviceWakeupRequest@4 ZwCancelIoFile@8 ZwCancelTimer@8 ZwClearEvent@4 ZwClose@4 ZwCloseObjectAuditAlarm@12 +ZwCompactKeys@8 ZwCompareTokens@12 ZwCompleteConnectPort@4 +ZwCompressKey@4 ZwConnectPort@32 ZwContinue@8 ZwCreateDebugObject@16 @@ -767,13 +1022,16 @@ ZwCreateEventPair@12 ZwCreateFile@44 ZwCreateIoCompletion@16 ZwCreateJobObject@12 +ZwCreateJobSet@12 ZwCreateKey@28 +ZwCreateKeyedEvent@16 ZwCreateMailslotFile@32 ZwCreateMutant@16 ZwCreateNamedPipeFile@56 ZwCreatePagingFile@16 ZwCreatePort@20 ZwCreateProcess@32 +ZwCreateProcessEx@36 ZwCreateProfile@36 ZwCreateSection@28 ZwCreateSemaphore@20 @@ -782,9 +1040,12 @@ ZwCreateThread@32 ZwCreateTimer@16 ZwCreateToken@52 ZwCreateWaitablePort@20 +ZwDebugActiveProcess@8 ZwDebugContinue@12 ZwDelayExecution@8 ZwDeleteAtom@4 +ZwDeleteBootEntry@4 +ZwDeleteDriverEntry@4 ZwDeleteFile@4 ZwDeleteKey@4 ZwDeleteObjectAuditAlarm@12 @@ -793,9 +1054,13 @@ ZwDeviceIoControlFile@40 ZwDisplayString@4 ZwDuplicateObject@28 ZwDuplicateToken@24 +ZwEnumerateBootEntries@8 +ZwEnumerateDriverEntries@8 ZwEnumerateKey@24 +ZwEnumerateSystemEnvironmentValuesEx@12 ZwEnumerateValueKey@24 ZwExtendSection@8 +ZwFilterToken@24 ZwFindAtom@12 ZwFlushBuffersFile@8 ZwFlushInstructionCache@12 @@ -805,22 +1070,36 @@ ZwFlushWriteBuffer@0 ZwFreeVirtualMemory@16 ZwFsControlFile@40 ZwGetContextThread@8 +ZwGetCurrentProcessorNumber@0 +ZwGetDevicePowerState@8 ZwGetPlugPlayEvent@16 +ZwGetWriteWatch@28 ZwImpersonateAnonymousToken@4 ZwImpersonateClientOfPort@8 ZwImpersonateThread@12 ZwInitializeRegistry@4 +ZwInitiatePowerAction@16 ZwIsProcessInJob@8 +ZwIsSystemResumeAutomatic@0 ZwListenPort@8 ZwLoadDriver@4 ZwLoadKey@8 ZwLoadKey2@12 +ZwLoadKeyEx@16 ZwLockFile@40 +ZwLockProductActivationKeys@8 +ZwLockRegistryKey@4 ZwLockVirtualMemory@16 +ZwMakePermanentObject@4 ZwMakeTemporaryObject@4 +ZwMapUserPhysicalPages@12 +ZwMapUserPhysicalPagesScatter@12 ZwMapViewOfSection@40 +ZwModifyBootEntry@4 +ZwModifyDriverEntry@4 ZwNotifyChangeDirectoryFile@36 ZwNotifyChangeKey@40 +ZwNotifyChangeMultipleKeys@48 ZwOpenDirectoryObject@12 ZwOpenEvent@12 ZwOpenEventPair@12 @@ -828,29 +1107,35 @@ ZwOpenFile@24 ZwOpenIoCompletion@12 ZwOpenJobObject@12 ZwOpenKey@12 +ZwOpenKeyedEvent@12 ZwOpenMutant@12 ZwOpenObjectAuditAlarm@48 ZwOpenProcess@16 ZwOpenProcessToken@12 +ZwOpenProcessTokenEx@16 ZwOpenSection@12 ZwOpenSemaphore@12 ZwOpenSymbolicLinkObject@12 ZwOpenThread@16 ZwOpenThreadToken@16 +ZwOpenThreadTokenEx@20 ZwOpenTimer@12 ZwPlugPlayControl@12 ZwPowerInformation@20 ZwPrivilegeCheck@12 -ZwPrivilegedServiceAuditAlarm@20 ZwPrivilegeObjectAuditAlarm@24 +ZwPrivilegedServiceAuditAlarm@20 ZwProtectVirtualMemory@20 ZwPulseEvent@8 ZwQueryAttributesFile@8 +ZwQueryBootEntryOrder@8 +ZwQueryBootOptions@8 ZwQueryDebugFilterState@8 ZwQueryDefaultLocale@8 ZwQueryDefaultUILanguage@4 ZwQueryDirectoryFile@44 ZwQueryDirectoryObject@28 +ZwQueryDriverEntryOrder@8 ZwQueryEaFile@36 ZwQueryEvent@20 ZwQueryFullAttributesFile@8 @@ -868,12 +1153,17 @@ ZwQueryKey@20 ZwQueryMultipleValueKey@24 ZwQueryMutant@20 ZwQueryObject@20 +ZwQueryOpenSubKeys@8 +ZwQueryOpenSubKeysEx@16 ZwQueryPerformanceCounter@8 +ZwQueryPortInformationProcess@0 +ZwQueryQuotaInformationFile@36 ZwQuerySection@20 ZwQuerySecurityObject@20 ZwQuerySemaphore@20 ZwQuerySymbolicLinkObject@12 ZwQuerySystemEnvironmentValue@16 +ZwQuerySystemEnvironmentValueEx@20 ZwQuerySystemInformation@16 ZwQuerySystemTime@4 ZwQueryTimer@20 @@ -889,29 +1179,41 @@ ZwReadFileScatter@36 ZwReadRequestData@24 ZwReadVirtualMemory@20 ZwRegisterThreadTerminatePort@4 +ZwReleaseKeyedEvent@16 ZwReleaseMutant@8 ZwReleaseSemaphore@12 ZwRemoveIoCompletion@20 +ZwRemoveProcessDebug@8 +ZwRenameKey@8 ZwReplaceKey@12 ZwReplyPort@8 ZwReplyWaitReceivePort@16 ZwReplyWaitReceivePortEx@20 ZwReplyWaitReplyPort@8 +ZwRequestDeviceWakeup@4 ZwRequestPort@8 ZwRequestWaitReplyPort@12 +ZwRequestWakeupLatency@4 ZwResetEvent@8 +ZwResetWriteWatch@12 ZwRestoreKey@12 ZwResumeProcess@4 ZwResumeThread@8 ZwSaveKey@8 +ZwSaveKeyEx@12 +ZwSaveMergedKeys@12 ZwSecureConnectPort@36 +ZwSetBootEntryOrder@8 +ZwSetBootOptions@8 ZwSetContextThread@8 ZwSetDebugFilterState@12 ZwSetDefaultHardErrorPort@4 ZwSetDefaultLocale@8 ZwSetDefaultUILanguage@4 +ZwSetDriverEntryOrder@8 ZwSetEaFile@16 ZwSetEvent@8 +ZwSetEventBoostPriority@4 ZwSetHighEventPair@4 ZwSetHighWaitLowEventPair@4 ZwSetInformationDebugObject@20 @@ -927,11 +1229,14 @@ ZwSetIoCompletion@20 ZwSetLdtEntries@24 ZwSetLowEventPair@4 ZwSetLowWaitHighEventPair@4 +ZwSetQuotaInformationFile@16 ZwSetSecurityObject@12 ZwSetSystemEnvironmentValue@8 +ZwSetSystemEnvironmentValueEx@8 ZwSetSystemInformation@12 ZwSetSystemPowerState@12 ZwSetSystemTime@8 +ZwSetThreadExecutionState@8 ZwSetTimer@28 ZwSetTimerResolution@12 ZwSetUuidSeed@4 @@ -948,14 +1253,20 @@ ZwTerminateJobObject@8 ZwTerminateProcess@8 ZwTerminateThread@8 ZwTestAlert@0 +ZwTraceEvent@16 +ZwTranslateFilePath@16 ZwUnloadDriver@4 ZwUnloadKey@4 +ZwUnloadKey2@8 +ZwUnloadKeyEx@8 ZwUnlockFile@20 ZwUnlockVirtualMemory@16 ZwUnmapViewOfSection@8 ZwVdmControl@8 ZwWaitForDebugEvent@16 +ZwWaitForKeyedEvent@16 ZwWaitForMultipleObjects@20 +ZwWaitForMultipleObjects32@20 ZwWaitForSingleObject@12 ZwWaitHighEventPair@4 ZwWaitLowEventPair@4 @@ -964,11 +1275,17 @@ ZwWriteFileGather@36 ZwWriteRequestData@24 ZwWriteVirtualMemory@20 ZwYieldExecution@0 +;_CIcos +;_CIlog +;_CIpow +;_CIsin +;_CIsqrt __isascii __iscsym __iscsymf __toascii _alldiv +;_alldvrm _allmul _alloca_probe _allrem @@ -976,6 +1293,7 @@ _allshl _allshr _atoi64 _aulldiv +;_aulldvrm _aullrem _aullshr _chkstk @@ -1004,11 +1322,13 @@ _ui64toa _ui64tow _ultoa _ultow +;_vscwprintf _vsnprintf _vsnwprintf _wcsicmp _wcslwr _wcsnicmp +;_wcstoui64 _wcsupr _wtoi _wtoi64 @@ -1068,15 +1388,15 @@ strspn strstr strtol strtoul -strtoull swprintf tan tolower toupper towlower towupper -vsprintf +vDbgPrintEx@16 vDbgPrintExWithPrefix@20 +vsprintf wcscat wcschr wcscmp @@ -1093,4 +1413,3 @@ wcsstr wcstol wcstombs wcstoul -; EOF diff --git a/reactos/dll/ntdll/ntdll.rbuild b/reactos/dll/ntdll/ntdll.rbuild index 06759b12e99..fbd01ebe8a7 100644 --- a/reactos/dll/ntdll/ntdll.rbuild +++ b/reactos/dll/ntdll/ntdll.rbuild @@ -33,7 +33,7 @@ - stubs_asm.S + stubs_asm.s diff --git a/reactos/dll/win32/aclui/aclui_Bg.rc b/reactos/dll/win32/aclui/aclui_Bg.rc index 4a989469fdc..9497337b027 100644 --- a/reactos/dll/win32/aclui/aclui_Bg.rc +++ b/reactos/dll/win32/aclui/aclui_Bg.rc @@ -16,7 +16,7 @@ BEGIN LTEXT "Позволено", IDC_LABEL_ALLOW, 135, 107, 32, 8, SS_CENTER LTEXT "Забранено", IDC_LABEL_DENY, 176, 107, 32, 8, SS_CENTER CONTROL "", IDC_ACE_CHECKLIST, "CHECKLIST_ACLUI", WS_CHILD | WS_VISIBLE | WS_TABSTOP, 7, 117, 213, 72, WS_EX_CLIENTEDGE - LTEXT "За извънредни права или разширени настройки, натиснете 'Разширени'.", IDC_LABEL_ADVANCED, 7, 194, 153, 16, SS_LEFT + LTEXT "За извънредни права или разширени настройки, натиснете „Разширени“.", IDC_LABEL_ADVANCED, 7, 194, 153, 16, SS_LEFT PUSHBUTTON "Раз&ширени", IDC_ADVANCED, 165, 194, 55, 14 END diff --git a/reactos/dll/win32/advapi32/crypt/crypt.c b/reactos/dll/win32/advapi32/crypt/crypt.c index f80bac1d263..1c333372452 100644 --- a/reactos/dll/win32/advapi32/crypt/crypt.c +++ b/reactos/dll/win32/advapi32/crypt/crypt.c @@ -22,8 +22,7 @@ * TODO: * - Reference counting * - Thread-safing - * - Signature checking - */ + */ #include #include "crypt.h" @@ -49,9 +48,7 @@ VOID byteReverse(unsigned char *buf, unsigned longs) } while (--longs); } -HWND crypt_hWindow = 0; - -#define CRYPT_ReturnLastError(err) {SetLastError(err); return FALSE;} +static HWND crypt_hWindow = 0; #define CRYPT_Alloc(size) ((LPVOID)LocalAlloc(LMEM_ZEROINIT, size)) #define CRYPT_Free(buffer) (LocalFree((HLOCAL)buffer)) @@ -127,9 +124,10 @@ static inline BOOL CRYPT_UnicodeToANSI(LPCWSTR wstr, LPSTR* str, int strsize) return TRUE; } count = WideCharToMultiByte(CP_ACP, 0, wstr, -1, NULL, 0, NULL, NULL); - count = count < strsize ? count : strsize; if (strsize == -1) *str = CRYPT_Alloc(count * sizeof(CHAR)); + else + count = min( count, strsize ); if (*str) { WideCharToMultiByte(CP_ACP, 0, wstr, -1, *str, count, NULL, NULL); @@ -146,7 +144,7 @@ static inline BOOL CRYPT_UnicodeToANSI(LPCWSTR wstr, LPSTR* str, int strsize) */ static inline BOOL CRYPT_ANSIToUnicode(LPCSTR str, LPWSTR* wstr, int wstrsize) { - int wcount; + unsigned int wcount; if (!str) { @@ -154,9 +152,10 @@ static inline BOOL CRYPT_ANSIToUnicode(LPCSTR str, LPWSTR* wstr, int wstrsize) return TRUE; } wcount = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0); - wcount = wcount < wstrsize/(int)sizeof(WCHAR) ? wcount : wstrsize/(int)sizeof(WCHAR); if (wstrsize == -1) *wstr = CRYPT_Alloc(wcount * sizeof(WCHAR)); + else + wcount = min( wcount, wstrsize/sizeof(WCHAR) ); if (*wstr) { MultiByteToWideChar(CP_ACP, 0, str, -1, *wstr, wcount); @@ -264,6 +263,64 @@ error: #undef CRYPT_GetProvFunc #undef CRYPT_GetProvFuncOpt +static void CRYPT_CreateMachineGuid(void) +{ + static const WCHAR cryptographyW[] = { + 'S','o','f','t','w','a','r','e','\\', + 'M','i','c','r','o','s','o','f','t','\\', + 'C','r','y','p','t','o','g','r','a','p','h','y',0 }; + static const WCHAR machineGuidW[] = { + 'M','a','c','h','i','n','e','G','u','i','d',0 }; + LONG r; + HKEY key; + + r = RegOpenKeyExW(HKEY_LOCAL_MACHINE, cryptographyW, 0, KEY_ALL_ACCESS, + &key); + if (!r) + { + DWORD size; + + r = RegQueryValueExW(key, machineGuidW, NULL, NULL, NULL, &size); + if (r == ERROR_FILE_NOT_FOUND) + { + static const WCHAR rpcrt4[] = { + 'r','p','c','r','t','4',0 }; + HMODULE lib = LoadLibraryW(rpcrt4); + + if (lib) + { + RPC_STATUS (RPC_ENTRY *pUuidCreate)(UUID *); + UUID uuid; + WCHAR buf[37]; + RPC_STATUS rs; + static const WCHAR uuidFmt[] = { + '%','0','8','x','-','%','0','4','x','-', + '%','0','4','x','-','%','0','2','x', + '%','0','2','x','-','%','0','2','x', + '%','0','2','x','%','0','2','x', + '%','0','2','x','%','0','2','x', + '%','0','2','x',0 }; + + pUuidCreate = (LPVOID) GetProcAddress(lib, "UuidCreate"); + rs = pUuidCreate(&uuid); + if (rs == S_OK) + { + swprintf(buf, uuidFmt, + uuid.Data1, uuid.Data2, uuid.Data3, + uuid.Data4[0], uuid.Data4[1], + uuid.Data4[2], uuid.Data4[3], + uuid.Data4[4], uuid.Data4[5], + uuid.Data4[6], uuid.Data4[7] ); + RegSetValueExW(key, machineGuidW, 0, REG_SZ, + (const BYTE *)buf, + (lstrlenW(buf)+1)*sizeof(WCHAR)); + } + FreeLibrary(lib); + } + } + RegCloseKey(key); + } +} /****************************************************************************** * CryptAcquireContextW (ADVAPI32.@) @@ -308,6 +365,9 @@ BOOL WINAPI CryptAcquireContextW (HCRYPTPROV *phProv, LPCWSTR pszContainer, return FALSE; } + /* Make sure the MachineGuid value exists */ + CRYPT_CreateMachineGuid(); + if (!pszProvider || !*pszProvider) { /* No CSP name specified so try the user default CSP first @@ -566,12 +626,12 @@ BOOL WINAPI CryptContextAddRef (HCRYPTPROV hProv, DWORD *pdwReserved, DWORD dwFl * Success: TRUE * Failure: FALSE */ -BOOL WINAPI CryptReleaseContext (HCRYPTPROV hProv, DWORD dwFlags) +BOOL WINAPI CryptReleaseContext (HCRYPTPROV hProv, ULONG_PTR dwFlags) { PCRYPTPROV pProv = (PCRYPTPROV)hProv; BOOL ret = TRUE; - TRACE("(0x%lx, %08ld)\n", hProv, dwFlags); + TRACE("(0x%lx, %08lx)\n", hProv, dwFlags); if (!pProv) { @@ -579,10 +639,17 @@ BOOL WINAPI CryptReleaseContext (HCRYPTPROV hProv, DWORD dwFlags) return FALSE; } + if (pProv->dwMagic != MAGIC_CRYPTPROV) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + pProv->refcount--; if (pProv->refcount <= 0) { ret = pProv->pFuncs->pCPReleaseContext(pProv->hPrivate, dwFlags); + pProv->dwMagic = 0; FreeLibrary(pProv->hModule); #if 0 CRYPT_Free(pProv->pVTable->pContextInfo); @@ -619,10 +686,16 @@ BOOL WINAPI CryptGenRandom (HCRYPTPROV hProv, DWORD dwLen, BYTE *pbBuffer) TRACE("(0x%lx, %ld, %p)\n", hProv, dwLen, pbBuffer); if (!hProv) - CRYPT_ReturnLastError(ERROR_INVALID_HANDLE); + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } - if (prov->dwMagic != MAGIC_CRYPTPROV) - CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); + if (prov->dwMagic != MAGIC_CRYPTPROV) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } return prov->pFuncs->pCPGenRandom(prov->hPrivate, dwLen, pbBuffer); } @@ -656,13 +729,25 @@ BOOL WINAPI CryptCreateHash (HCRYPTPROV hProv, ALG_ID Algid, HCRYPTKEY hKey, TRACE("(0x%lx, 0x%x, 0x%lx, %08lx, %p)\n", hProv, Algid, hKey, dwFlags, phHash); if (!prov) - CRYPT_ReturnLastError(ERROR_INVALID_HANDLE); + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } if (!phHash || prov->dwMagic != MAGIC_CRYPTPROV) - CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } if (dwFlags) - CRYPT_ReturnLastError(NTE_BAD_FLAGS); - if (!(hash = CRYPT_Alloc(sizeof(CRYPTHASH)))) - CRYPT_ReturnLastError(ERROR_NOT_ENOUGH_MEMORY); + { + SetLastError(NTE_BAD_FLAGS); + return FALSE; + } + if ( !(hash = CRYPT_Alloc(sizeof(CRYPTHASH))) ) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } hash->pProvider = prov; @@ -706,8 +791,11 @@ BOOL WINAPI CryptDecrypt (HCRYPTKEY hKey, HCRYPTHASH hHash, BOOL Final, TRACE("(0x%lx, 0x%lx, %d, %08lx, %p, %p)\n", hKey, hHash, Final, dwFlags, pbData, pdwDataLen); - if (!key || !pbData || !pdwDataLen || key->pProvider->dwMagic != MAGIC_CRYPTPROV) - CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); + if (!key || !pbData || !pdwDataLen || !key->pProvider || key->pProvider->dwMagic != MAGIC_CRYPTPROV) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } prov = key->pProvider; return prov->pFuncs->pCPDecrypt(prov->hPrivate, key->hPrivate, hash ? hash->hPrivate : 0, @@ -740,11 +828,20 @@ BOOL WINAPI CryptDeriveKey (HCRYPTPROV hProv, ALG_ID Algid, HCRYPTHASH hBaseData TRACE("(0x%lx, 0x%08x, 0x%lx, 0x%08lx, %p)\n", hProv, Algid, hBaseData, dwFlags, phKey); if (!prov || !hash) - CRYPT_ReturnLastError(ERROR_INVALID_HANDLE); + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } if (!phKey || prov->dwMagic != MAGIC_CRYPTPROV) - CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); - if (!(key = CRYPT_Alloc(sizeof(CRYPTKEY)))) - CRYPT_ReturnLastError(ERROR_NOT_ENOUGH_MEMORY); + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + if ( !(key = CRYPT_Alloc(sizeof(CRYPTKEY))) ) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } key->pProvider = prov; if (prov->pFuncs->pCPDeriveKey(prov->hPrivate, Algid, hash->hPrivate, dwFlags, &key->hPrivate)) @@ -779,8 +876,17 @@ BOOL WINAPI CryptDestroyHash (HCRYPTHASH hHash) TRACE("(0x%lx)\n", hHash); - if (!hash || hash->pProvider->dwMagic != MAGIC_CRYPTPROV) - CRYPT_ReturnLastError(ERROR_INVALID_HANDLE); + if (!hash) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + + if (!hash->pProvider || hash->pProvider->dwMagic != MAGIC_CRYPTPROV) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } prov = hash->pProvider; ret = prov->pFuncs->pCPDestroyHash(prov->hPrivate, hash->hPrivate); @@ -809,10 +915,16 @@ BOOL WINAPI CryptDestroyKey (HCRYPTKEY hKey) TRACE("(0x%lx)\n", hKey); if (!key) - CRYPT_ReturnLastError(ERROR_INVALID_HANDLE); + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } - if (!key->pProvider || key->pProvider->dwMagic != MAGIC_CRYPTPROV) - CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); + if (!key->pProvider || key->pProvider->dwMagic != MAGIC_CRYPTPROV) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } prov = key->pProvider; ret = prov->pFuncs->pCPDestroyKey(prov->hPrivate, key->hPrivate); @@ -844,16 +956,25 @@ BOOL WINAPI CryptDuplicateHash (HCRYPTHASH hHash, DWORD *pdwReserved, TRACE("(0x%lx, %p, %08ld, %p)\n", hHash, pdwReserved, dwFlags, phHash); orghash = (PCRYPTHASH)hHash; - if (!orghash || pdwReserved || !phHash|| - orghash->pProvider->dwMagic != MAGIC_CRYPTPROV) - CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); + if (!orghash || pdwReserved || !phHash || !orghash->pProvider || + orghash->pProvider->dwMagic != MAGIC_CRYPTPROV) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } prov = orghash->pProvider; if (!prov->pFuncs->pCPDuplicateHash) - CRYPT_ReturnLastError(ERROR_CALL_NOT_IMPLEMENTED); + { + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; + } - if (!(newhash = CRYPT_Alloc(sizeof(CRYPTHASH)))) - CRYPT_ReturnLastError(ERROR_NOT_ENOUGH_MEMORY); + if ( !(newhash = CRYPT_Alloc(sizeof(CRYPTHASH))) ) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } newhash->pProvider = prov; if (prov->pFuncs->pCPDuplicateHash(prov->hPrivate, orghash->hPrivate, pdwReserved, dwFlags, &newhash->hPrivate)) @@ -888,15 +1009,25 @@ BOOL WINAPI CryptDuplicateKey (HCRYPTKEY hKey, DWORD *pdwReserved, DWORD dwFlags TRACE("(0x%lx, %p, %08ld, %p)\n", hKey, pdwReserved, dwFlags, phKey); orgkey = (PCRYPTKEY)hKey; - if (!orgkey || pdwReserved || !phKey || orgkey->pProvider->dwMagic != MAGIC_CRYPTPROV) - CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); + if (!orgkey || pdwReserved || !phKey || !orgkey->pProvider || + orgkey->pProvider->dwMagic != MAGIC_CRYPTPROV) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } prov = orgkey->pProvider; if (!prov->pFuncs->pCPDuplicateKey) - CRYPT_ReturnLastError(ERROR_CALL_NOT_IMPLEMENTED); + { + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; + } - if (!(newkey = CRYPT_Alloc(sizeof(CRYPTKEY)))) - CRYPT_ReturnLastError(ERROR_NOT_ENOUGH_MEMORY); + if ( !(newkey = CRYPT_Alloc(sizeof(CRYPTKEY))) ) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } newkey->pProvider = prov; if (prov->pFuncs->pCPDuplicateKey(prov->hPrivate, orgkey->hPrivate, pdwReserved, dwFlags, &newkey->hPrivate)) @@ -940,8 +1071,11 @@ BOOL WINAPI CryptEncrypt (HCRYPTKEY hKey, HCRYPTHASH hHash, BOOL Final, TRACE("(0x%lx, 0x%lx, %d, %08ld, %p, %p, %ld)\n", hKey, hHash, Final, dwFlags, pbData, pdwDataLen, dwBufLen); - if (!key || !pdwDataLen || key->pProvider->dwMagic != MAGIC_CRYPTPROV) - CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); + if (!key || !pdwDataLen || !key->pProvider || key->pProvider->dwMagic != MAGIC_CRYPTPROV) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } prov = key->pProvider; return prov->pFuncs->pCPEncrypt(prov->hPrivate, key->hPrivate, hash ? hash->hPrivate : 0, @@ -951,7 +1085,7 @@ BOOL WINAPI CryptEncrypt (HCRYPTKEY hKey, HCRYPTHASH hHash, BOOL Final, /****************************************************************************** * CryptEnumProvidersW (ADVAPI32.@) * - * Returns the next availabe CSP. + * Returns the next available CSP. * * PARAMS * dwIndex [I] Index of the next provider to be enumerated. @@ -979,14 +1113,23 @@ BOOL WINAPI CryptEnumProvidersW (DWORD dwIndex, DWORD *pdwReserved, pdwProvType, pszProvName, pcbProvName); if (pdwReserved || !pcbProvName) - CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } if (dwFlags) - CRYPT_ReturnLastError(NTE_BAD_FLAGS); + { + SetLastError(NTE_BAD_FLAGS); + return FALSE; + } if (RegOpenKeyW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Cryptography\\Defaults\\Provider", &hKey)) - CRYPT_ReturnLastError(NTE_FAIL); + { + SetLastError(NTE_FAIL); + return FALSE; + } if (!pszProvName) { @@ -997,16 +1140,21 @@ BOOL WINAPI CryptEnumProvidersW (DWORD dwIndex, DWORD *pdwReserved, NULL, NULL, NULL, NULL, NULL, NULL); if (!(provNameW = CRYPT_Alloc(*pcbProvName * sizeof(WCHAR)))) - CRYPT_ReturnLastError(ERROR_NOT_ENOUGH_MEMORY); + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } RegEnumKeyExW(hKey, dwIndex, provNameW, pcbProvName, NULL, NULL, NULL, NULL); + CRYPT_Free(provNameW); (*pcbProvName)++; *pcbProvName *= sizeof(WCHAR); - CRYPT_Free(provNameW); - if (dwIndex >= numkeys) - CRYPT_ReturnLastError(ERROR_NO_MORE_ITEMS); + { + SetLastError(ERROR_NO_MORE_ITEMS); + return FALSE; + } } else { @@ -1016,7 +1164,10 @@ BOOL WINAPI CryptEnumProvidersW (DWORD dwIndex, DWORD *pdwReserved, result = RegEnumKeyW(hKey, dwIndex, pszProvName, *pcbProvName / sizeof(WCHAR)); if (result) - CRYPT_ReturnLastError(result); + { + SetLastError(result); + return FALSE; + } if (RegOpenKeyW(hKey, pszProvName, &subkey)) return FALSE; if (RegQueryValueExW(subkey, L"Type", NULL, NULL, (BYTE*)pdwProvType, &size)) @@ -1044,12 +1195,15 @@ BOOL WINAPI CryptEnumProvidersA (DWORD dwIndex, DWORD *pdwReserved, if(!CryptEnumProvidersW(dwIndex, pdwReserved, dwFlags, pdwProvType, NULL, &bufsize)) return FALSE; - if (pszProvName && !(str = CRYPT_Alloc(bufsize))) - CRYPT_ReturnLastError(ERROR_NOT_ENOUGH_MEMORY); + if ( pszProvName && !(str = CRYPT_Alloc(bufsize)) ) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } ret = CryptEnumProvidersW(dwIndex, pdwReserved, dwFlags, pdwProvType, str, &bufsize); if (str) CRYPT_UnicodeToANSI(str, &pszProvName, *pcbProvName); - *pcbProvName = bufsize / sizeof(WCHAR); + *pcbProvName = bufsize / sizeof(WCHAR); /* FIXME: not correct */ if (str) { CRYPT_Free(str); @@ -1063,7 +1217,7 @@ BOOL WINAPI CryptEnumProvidersA (DWORD dwIndex, DWORD *pdwReserved, } /****************************************************************************** - * CryptEnumProviderTypesA (ADVAPI32i.@) + * CryptEnumProviderTypesW (ADVAPI32.@) * * Retrieves the next type of CSP supported. * @@ -1084,47 +1238,62 @@ BOOL WINAPI CryptEnumProvidersA (DWORD dwIndex, DWORD *pdwReserved, * If pszTypeName is NULL, CryptEnumProviderTypesA sets the size of the name * for memory allocation purposes. */ -BOOL WINAPI CryptEnumProviderTypesA (DWORD dwIndex, DWORD *pdwReserved, - DWORD dwFlags, DWORD *pdwProvType, LPSTR pszTypeName, DWORD *pcbTypeName) +BOOL WINAPI CryptEnumProviderTypesW (DWORD dwIndex, DWORD *pdwReserved, + DWORD dwFlags, DWORD *pdwProvType, LPWSTR pszTypeName, DWORD *pcbTypeName) { HKEY hKey, hSubkey; DWORD keylen, numkeys, dwType; - PSTR keyname, ch; + PWSTR keyname, ch; DWORD result; TRACE("(%ld, %p, %08ld, %p, %p, %p)\n", dwIndex, pdwReserved, dwFlags, pdwProvType, pszTypeName, pcbTypeName); if (pdwReserved || !pdwProvType || !pcbTypeName) - CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } if (dwFlags) - CRYPT_ReturnLastError(NTE_BAD_FLAGS); + { + SetLastError(NTE_BAD_FLAGS); + return FALSE; + } - if (RegOpenKeyA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Cryptography\\Defaults\\Provider Types", &hKey)) + if (RegOpenKeyW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Cryptography\\Defaults\\Provider Types", &hKey)) return FALSE; - RegQueryInfoKeyA(hKey, NULL, NULL, NULL, &numkeys, &keylen, NULL, NULL, NULL, NULL, NULL, NULL); + RegQueryInfoKeyW(hKey, NULL, NULL, NULL, &numkeys, &keylen, NULL, NULL, NULL, NULL, NULL, NULL); if (dwIndex >= numkeys) - CRYPT_ReturnLastError(ERROR_NO_MORE_ITEMS); + { + SetLastError(ERROR_NO_MORE_ITEMS); + return FALSE; + } keylen++; - if ( !(keyname = CRYPT_Alloc(keylen)) ) - CRYPT_ReturnLastError(ERROR_NOT_ENOUGH_MEMORY); - if ( RegEnumKeyA(hKey, dwIndex, keyname, keylen) ) + if ( !(keyname = CRYPT_Alloc(keylen*sizeof(WCHAR))) ) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } + if ( RegEnumKeyW(hKey, dwIndex, keyname, keylen) ) { CRYPT_Free(keyname); return FALSE; } - RegOpenKeyA(hKey, keyname, &hSubkey); - ch = keyname + strlen(keyname); + RegOpenKeyW(hKey, keyname, &hSubkey); + ch = keyname + wcslen(keyname); /* Convert "Type 000" to 0, etc/ */ *pdwProvType = *(--ch) - '0'; *pdwProvType += (*(--ch) - '0') * 10; *pdwProvType += (*(--ch) - '0') * 100; CRYPT_Free(keyname); - result = RegQueryValueExA(hSubkey, "TypeName", NULL, &dwType, (LPBYTE)pszTypeName, pcbTypeName); + result = RegQueryValueExW(hSubkey, L"TypeName", NULL, &dwType, (LPBYTE)pszTypeName, pcbTypeName); if (result) - CRYPT_ReturnLastError(result); + { + SetLastError(result); + return FALSE; + } RegCloseKey(hSubkey); RegCloseKey(hKey); @@ -1132,29 +1301,40 @@ BOOL WINAPI CryptEnumProviderTypesA (DWORD dwIndex, DWORD *pdwReserved, } /****************************************************************************** - * CryptEnumProviderTypesW (ADVAPI32.@) + * CryptEnumProviderTypesA (ADVAPI32.@) * - * see CryptEnumProviderTypesA + * see CryptEnumProviderTypesW. */ -BOOL WINAPI CryptEnumProviderTypesW (DWORD dwIndex, DWORD *pdwReserved, - DWORD dwFlags, DWORD *pdwProvType, LPWSTR pszTypeName, DWORD *pcbTypeName) +BOOL WINAPI CryptEnumProviderTypesA (DWORD dwIndex, DWORD *pdwReserved, + DWORD dwFlags, DWORD *pdwProvType, LPSTR pszTypeName, DWORD *pcbTypeName) { - PSTR str = NULL; - DWORD strlen; + PWSTR str = NULL; + DWORD bufsize; BOOL ret; TRACE("(%ld, %p, %08ld, %p, %p, %p)\n", dwIndex, pdwReserved, dwFlags, pdwProvType, pszTypeName, pcbTypeName); - strlen = *pcbTypeName / sizeof(WCHAR); - if (pszTypeName && !(str = CRYPT_Alloc(strlen))) - CRYPT_ReturnLastError(ERROR_NOT_ENOUGH_MEMORY); - ret = CryptEnumProviderTypesA(dwIndex, pdwReserved, dwFlags, pdwProvType, str, &strlen); + + if(!CryptEnumProviderTypesW(dwIndex, pdwReserved, dwFlags, pdwProvType, NULL, &bufsize)) + return FALSE; + if ( pszTypeName && !(str = CRYPT_Alloc(bufsize)) ) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } + ret = CryptEnumProviderTypesW(dwIndex, pdwReserved, dwFlags, pdwProvType, str, &bufsize); + if (str) + CRYPT_UnicodeToANSI(str, &pszTypeName, *pcbTypeName); + *pcbTypeName = bufsize / sizeof(WCHAR); if (str) { - CRYPT_ANSIToUnicode(str, &pszTypeName, *pcbTypeName); CRYPT_Free(str); + if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) + { + SetLastError(ERROR_MORE_DATA); + return FALSE; + } } - *pcbTypeName = strlen * sizeof(WCHAR); return ret; } @@ -1188,7 +1368,10 @@ BOOL WINAPI CryptExportKey (HCRYPTKEY hKey, HCRYPTKEY hExpKey, DWORD dwBlobType, TRACE("(0x%lx, 0x%lx, %ld, %08ld, %p, %p)\n", hKey, hExpKey, dwBlobType, dwFlags, pbData, pdwDataLen); if (!key || !pdwDataLen || !key->pProvider || key->pProvider->dwMagic != MAGIC_CRYPTPROV) - CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } prov = key->pProvider; return prov->pFuncs->pCPExportKey(prov->hPrivate, key->hPrivate, expkey ? expkey->hPrivate : 0, @@ -1218,11 +1401,20 @@ BOOL WINAPI CryptGenKey (HCRYPTPROV hProv, ALG_ID Algid, DWORD dwFlags, HCRYPTKE TRACE("(0x%lx, %d, %08ld, %p)\n", hProv, Algid, dwFlags, phKey); if (!prov) - CRYPT_ReturnLastError(ERROR_INVALID_HANDLE); - if (!phKey || prov->dwMagic != MAGIC_CRYPTPROV) - CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); - if (!(key = CRYPT_Alloc(sizeof(CRYPTKEY)))) - CRYPT_ReturnLastError(ERROR_NOT_ENOUGH_MEMORY); + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (!phKey || !prov || prov->dwMagic != MAGIC_CRYPTPROV) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + if ( !(key = CRYPT_Alloc(sizeof(CRYPTKEY))) ) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } key->pProvider = prov; @@ -1317,21 +1509,21 @@ BOOL WINAPI CryptGetDefaultProviderA (DWORD dwProvType, DWORD *pdwReserved, DWORD dwFlags, LPSTR pszProvName, DWORD *pcbProvName) { PWSTR str = NULL; - DWORD strlen; + DWORD bufsize; BOOL ret = FALSE; TRACE("(%d, %p, %08x, %p, %p)\n", dwProvType, pdwReserved, dwFlags, pszProvName, pcbProvName); - CryptGetDefaultProviderW(dwProvType, pdwReserved, dwFlags, NULL, &strlen); - if ( pszProvName && !(str = CRYPT_Alloc(strlen)) ) + CryptGetDefaultProviderW(dwProvType, pdwReserved, dwFlags, NULL, &bufsize); + if ( pszProvName && !(str = CRYPT_Alloc(bufsize)) ) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); return FALSE; } - ret = CryptGetDefaultProviderW(dwProvType, pdwReserved, dwFlags, str, &strlen); + ret = CryptGetDefaultProviderW(dwProvType, pdwReserved, dwFlags, str, &bufsize); if (str) CRYPT_UnicodeToANSI(str, &pszProvName, *pcbProvName); - *pcbProvName = strlen / sizeof(WCHAR); + *pcbProvName = bufsize / sizeof(WCHAR); if (str) { CRYPT_Free(str); @@ -1372,7 +1564,10 @@ BOOL WINAPI CryptGetHashParam (HCRYPTHASH hHash, DWORD dwParam, BYTE *pbData, TRACE("(0x%lx, %ld, %p, %p, %08ld)\n", hHash, dwParam, pbData, pdwDataLen, dwFlags); if (!hash || !pdwDataLen || !hash->pProvider || hash->pProvider->dwMagic != MAGIC_CRYPTPROV) - CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } prov = hash->pProvider; return prov->pFuncs->pCPGetHashParam(prov->hPrivate, hash->hPrivate, dwParam, @@ -1407,7 +1602,10 @@ BOOL WINAPI CryptGetKeyParam (HCRYPTKEY hKey, DWORD dwParam, BYTE *pbData, TRACE("(0x%lx, %ld, %p, %p, %08ld)\n", hKey, dwParam, pbData, pdwDataLen, dwFlags); if (!key || !pdwDataLen || !key->pProvider || key->pProvider->dwMagic != MAGIC_CRYPTPROV) - CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } prov = key->pProvider; return prov->pFuncs->pCPGetKeyParam(prov->hPrivate, key->hPrivate, dwParam, @@ -1440,8 +1638,11 @@ BOOL WINAPI CryptGetProvParam (HCRYPTPROV hProv, DWORD dwParam, BYTE *pbData, TRACE("(0x%lx, %ld, %p, %p, %08ld)\n", hProv, dwParam, pbData, pdwDataLen, dwFlags); - if (!prov || prov->dwMagic != MAGIC_CRYPTPROV) - CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); + if (!prov || prov->dwMagic != MAGIC_CRYPTPROV) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } return prov->pFuncs->pCPGetProvParam(prov->hPrivate, dwParam, pbData, pdwDataLen, dwFlags); } @@ -1468,11 +1669,20 @@ BOOL WINAPI CryptGetUserKey (HCRYPTPROV hProv, DWORD dwKeySpec, HCRYPTKEY *phUse TRACE("(0x%lx, %ld, %p)\n", hProv, dwKeySpec, phUserKey); if (!prov) - CRYPT_ReturnLastError(ERROR_INVALID_HANDLE); + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } if (!phUserKey || prov->dwMagic != MAGIC_CRYPTPROV) - CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); - if (!(key = CRYPT_Alloc(sizeof(CRYPTKEY)))) - CRYPT_ReturnLastError(ERROR_NOT_ENOUGH_MEMORY); + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + if ( !(key = CRYPT_Alloc(sizeof(CRYPTKEY))) ) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } key->pProvider = prov; @@ -1511,9 +1721,15 @@ BOOL WINAPI CryptHashData (HCRYPTHASH hHash, const BYTE *pbData, DWORD dwDataLen TRACE("(0x%lx, %p, %ld, %08ld)\n", hHash, pbData, dwDataLen, dwFlags); if (!hash) - CRYPT_ReturnLastError(ERROR_INVALID_HANDLE); + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } if (!hash->pProvider || hash->pProvider->dwMagic != MAGIC_CRYPTPROV) - CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } prov = hash->pProvider; return prov->pFuncs->pCPHashData(prov->hPrivate, hash->hPrivate, pbData, dwDataLen, dwFlags); @@ -1540,9 +1756,16 @@ BOOL WINAPI CryptHashSessionKey (HCRYPTHASH hHash, HCRYPTKEY hKey, DWORD dwFlags TRACE("(0x%lx, 0x%lx, %08ld)\n", hHash, hKey, dwFlags); if (!hash || !key) - CRYPT_ReturnLastError(ERROR_INVALID_HANDLE); - if (!hash->pProvider || hash->pProvider->dwMagic != MAGIC_CRYPTPROV) - CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + + if (!hash->pProvider || hash->pProvider->dwMagic != MAGIC_CRYPTPROV) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } prov = hash->pProvider; return prov->pFuncs->pCPHashSessionKey(prov->hPrivate, hash->hPrivate, key->hPrivate, dwFlags); @@ -1572,10 +1795,16 @@ BOOL WINAPI CryptImportKey (HCRYPTPROV hProv, CONST BYTE *pbData, DWORD dwDataLe TRACE("(0x%lx, %p, %ld, 0x%lx, %08ld, %p)\n", hProv, pbData, dwDataLen, hPubKey, dwFlags, phKey); if (!prov || !pbData || !dwDataLen || !phKey || prov->dwMagic != MAGIC_CRYPTPROV) - CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } - if (!(importkey = CRYPT_Alloc(sizeof(CRYPTKEY)))) - CRYPT_ReturnLastError(ERROR_NOT_ENOUGH_MEMORY); + if (!(importkey = CRYPT_Alloc(sizeof(CRYPTKEY))) ) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } importkey->pProvider = prov; if (prov->pFuncs->pCPImportKey(prov->hPrivate, pbData, dwDataLen, @@ -1635,9 +1864,15 @@ BOOL WINAPI CryptSignHashW (HCRYPTHASH hHash, DWORD dwKeySpec, LPCWSTR sDescript } if (!hash) - CRYPT_ReturnLastError(ERROR_INVALID_HANDLE); + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } if (!pdwSigLen || !hash->pProvider || hash->pProvider->dwMagic != MAGIC_CRYPTPROV) - CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } prov = hash->pProvider; return prov->pFuncs->pCPSignHash(prov->hPrivate, hash->hPrivate, dwKeySpec, NULL, @@ -1668,7 +1903,10 @@ BOOL WINAPI CryptSetHashParam (HCRYPTHASH hHash, DWORD dwParam, CONST BYTE *pbDa TRACE("(0x%lx, %ld, %p, %08ld)\n", hHash, dwParam, pbData, dwFlags); if (!hash || !pbData || !hash->pProvider || hash->pProvider->dwMagic != MAGIC_CRYPTPROV) - CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } prov = hash->pProvider; return prov->pFuncs->pCPSetHashParam(prov->hPrivate, hash->hPrivate, @@ -1698,7 +1936,10 @@ BOOL WINAPI CryptSetKeyParam (HCRYPTKEY hKey, DWORD dwParam, CONST BYTE *pbData, TRACE("(0x%lx, %ld, %p, %08ld)\n", hKey, dwParam, pbData, dwFlags); if (!key || !pbData || !key->pProvider || key->pProvider->dwMagic != MAGIC_CRYPTPROV) - CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } prov = key->pProvider; return prov->pFuncs->pCPSetKeyParam(prov->hPrivate, key->hPrivate, @@ -1868,9 +2109,15 @@ BOOL WINAPI CryptSetProvParam (HCRYPTPROV hProv, DWORD dwParam, CONST BYTE *pbDa TRACE("(0x%lx, %ld, %p, %08ld)\n", hProv, dwParam, pbData, dwFlags); if (!prov) - CRYPT_ReturnLastError(ERROR_INVALID_HANDLE); - if (prov->dwMagic != MAGIC_CRYPTPROV) - CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (prov->dwMagic != MAGIC_CRYPTPROV) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } if (dwFlags & PP_USE_HARDWARE_RNG) { FIXME("PP_USE_HARDWARE_RNG: What do I do with this?\n"); @@ -1930,13 +2177,8 @@ BOOL WINAPI CryptVerifySignatureA (HCRYPTHASH hHash, CONST BYTE *pbSignature, DW return CryptVerifySignatureW(hHash, pbSignature, dwSigLen, hPubKey, NULL, dwFlags); } -BOOL WINAPI -CryptVerifySignatureW (HCRYPTHASH hHash, - CONST BYTE *pbSignature, - DWORD dwSigLen, - HCRYPTKEY hPubKey, - LPCWSTR sDescription, - DWORD dwFlags) +BOOL WINAPI CryptVerifySignatureW (HCRYPTHASH hHash, CONST BYTE *pbSignature, DWORD dwSigLen, + HCRYPTKEY hPubKey, LPCWSTR sDescription, DWORD dwFlags) { PCRYPTHASH hash = (PCRYPTHASH)hHash; PCRYPTKEY key = (PCRYPTKEY)hPubKey; @@ -1945,17 +2187,14 @@ CryptVerifySignatureW (HCRYPTHASH hHash, TRACE("(0x%lx, %p, %d, 0x%lx, %s, %08x)\n", hHash, pbSignature, dwSigLen, hPubKey, debugstr_w(sDescription), dwFlags); - if (sDescription) + if (!hash || !key || + !hash->pProvider || hash->pProvider->dwMagic != MAGIC_CRYPTPROV || + !key->pProvider || key->pProvider->dwMagic != MAGIC_CRYPTPROV) { - WARN("The sDescription parameter is not supported (and no longer used). Ignoring.\n"); + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; } - if (!hash || !key || - !hash->pProvider || hash->pProvider->dwMagic != MAGIC_CRYPTPROV || - !key->pProvider || key->pProvider->dwMagic != MAGIC_CRYPTPROV) - CRYPT_ReturnLastError(ERROR_INVALID_PARAMETER); - - prov = hash->pProvider; return prov->pFuncs->pCPVerifySignature(prov->hPrivate, hash->hPrivate, pbSignature, dwSigLen, key->hPrivate, sDescription, dwFlags); diff --git a/reactos/dll/win32/advapi32/service/scm.c b/reactos/dll/win32/advapi32/service/scm.c index ae9046b4eb6..0ded2f30f59 100644 --- a/reactos/dll/win32/advapi32/service/scm.c +++ b/reactos/dll/win32/advapi32/service/scm.c @@ -78,6 +78,26 @@ HandleUnbind(VOID) #endif +static DWORD +ScmRpcStatusToWinError(RPC_STATUS Status) +{ + switch (Status) + { + case RPC_X_SS_IN_NULL_CONTEXT: + return ERROR_INVALID_HANDLE; + + case RPC_X_NULL_REF_POINTER: + return ERROR_INVALID_PARAMETER; + + case STATUS_ACCESS_VIOLATION: + return ERROR_INVALID_ADDRESS; + + default: + return (DWORD)Status; + } +} + + /********************************************************************** * ChangeServiceConfig2A * @@ -116,9 +136,18 @@ ChangeServiceConfig2A(SC_HANDLE hService, HandleBind(); - dwError = RChangeServiceConfig2A(BindingHandle, - (SC_RPC_HANDLE)(ULONG_PTR)hService, - Info); + _SEH_TRY + { + dwError = RChangeServiceConfig2A(BindingHandle, + (SC_RPC_HANDLE)(ULONG_PTR)hService, + Info); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; + if (dwError != ERROR_SUCCESS) { ERR("RChangeServiceConfig2A() failed (Error %lu)\n", dwError); @@ -170,9 +199,18 @@ ChangeServiceConfig2W(SC_HANDLE hService, HandleBind(); - dwError = RChangeServiceConfig2W(BindingHandle, - (SC_RPC_HANDLE)hService, - Info); + _SEH_TRY + { + dwError = RChangeServiceConfig2W(BindingHandle, + (SC_RPC_HANDLE)hService, + Info); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; + if (dwError != ERROR_SUCCESS) { ERR("RChangeServiceConfig2W() failed (Error %lu)\n", dwError); @@ -226,21 +264,30 @@ ChangeServiceConfigA(SC_HANDLE hService, HandleBind(); - /* Call to services.exe using RPC */ - dwError = RChangeServiceConfigA(BindingHandle, - (SC_RPC_HANDLE)hService, - dwServiceType, - dwStartType, - dwErrorControl, - (LPSTR)lpBinaryPathName, - (LPSTR)lpLoadOrderGroup, - lpdwTagId, - (LPSTR)lpDependencies, - dwDependenciesLength, - (LPSTR)lpServiceStartName, - NULL, /* FIXME: lpPassword */ - 0, /* FIXME: dwPasswordLength */ - (LPSTR)lpDisplayName); + _SEH_TRY + { + /* Call to services.exe using RPC */ + dwError = RChangeServiceConfigA(BindingHandle, + (SC_RPC_HANDLE)hService, + dwServiceType, + dwStartType, + dwErrorControl, + (LPSTR)lpBinaryPathName, + (LPSTR)lpLoadOrderGroup, + lpdwTagId, + (LPSTR)lpDependencies, + dwDependenciesLength, + (LPSTR)lpServiceStartName, + NULL, /* FIXME: lpPassword */ + 0, /* FIXME: dwPasswordLength */ + (LPSTR)lpDisplayName); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; + if (dwError != ERROR_SUCCESS) { ERR("RChangeServiceConfigA() failed (Error %lu)\n", dwError); @@ -294,21 +341,30 @@ ChangeServiceConfigW(SC_HANDLE hService, HandleBind(); - /* Call to services.exe using RPC */ - dwError = RChangeServiceConfigW(BindingHandle, - (SC_RPC_HANDLE)hService, - dwServiceType, - dwStartType, - dwErrorControl, - (LPWSTR)lpBinaryPathName, - (LPWSTR)lpLoadOrderGroup, - lpdwTagId, - (LPBYTE)lpDependencies, - dwDependenciesLength, - (LPWSTR)lpServiceStartName, - NULL, /* FIXME: lpPassword */ - 0, /* FIXME: dwPasswordLength */ - (LPWSTR)lpDisplayName); + _SEH_TRY + { + /* Call to services.exe using RPC */ + dwError = RChangeServiceConfigW(BindingHandle, + (SC_RPC_HANDLE)hService, + dwServiceType, + dwStartType, + dwErrorControl, + (LPWSTR)lpBinaryPathName, + (LPWSTR)lpLoadOrderGroup, + lpdwTagId, + (LPBYTE)lpDependencies, + dwDependenciesLength, + (LPWSTR)lpServiceStartName, + NULL, /* FIXME: lpPassword */ + 0, /* FIXME: dwPasswordLength */ + (LPWSTR)lpDisplayName); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; + if (dwError != ERROR_SUCCESS) { ERR("RChangeServiceConfigW() failed (Error %lu)\n", dwError); @@ -334,9 +390,18 @@ CloseServiceHandle(SC_HANDLE hSCObject) HandleBind(); - /* Call to services.exe using RPC */ - dwError = RCloseServiceHandle(BindingHandle, - (LPSC_RPC_HANDLE)&hSCObject); + _SEH_TRY + { + /* Call to services.exe using RPC */ + dwError = RCloseServiceHandle(BindingHandle, + (LPSC_RPC_HANDLE)&hSCObject); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; + if (dwError) { ERR("RCloseServiceHandle() failed (Error %lu)\n", dwError); @@ -367,11 +432,20 @@ ControlService(SC_HANDLE hService, HandleBind(); - /* Call to services.exe using RPC */ - dwError = RControlService(BindingHandle, - (SC_RPC_HANDLE)hService, - dwControl, - lpServiceStatus); + _SEH_TRY + { + /* Call to services.exe using RPC */ + dwError = RControlService(BindingHandle, + (SC_RPC_HANDLE)hService, + dwControl, + lpServiceStatus); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; + if (dwError != ERROR_SUCCESS) { ERR("RControlService() failed (Error %lu)\n", dwError); @@ -403,7 +477,6 @@ ControlServiceEx(IN SC_HANDLE hService, } - /********************************************************************** * CreateServiceA * @@ -616,24 +689,33 @@ CreateServiceW(SC_HANDLE hSCManager, HandleBind(); - /* Call to services.exe using RPC */ - dwError = RCreateServiceW(BindingHandle, - (SC_RPC_HANDLE)hSCManager, - (LPWSTR)lpServiceName, - (LPWSTR)lpDisplayName, - dwDesiredAccess, - dwServiceType, - dwStartType, - dwErrorControl, - (LPWSTR)lpBinaryPathName, - (LPWSTR)lpLoadOrderGroup, - lpdwTagId, - (LPBYTE)lpDependencies, - dwDependenciesLength, - (LPWSTR)lpServiceStartName, - NULL, /* FIXME: lpPassword */ - 0, /* FIXME: dwPasswordLength */ - (SC_RPC_HANDLE *)&hService); + _SEH_TRY + { + /* Call to services.exe using RPC */ + dwError = RCreateServiceW(BindingHandle, + (SC_RPC_HANDLE)hSCManager, + (LPWSTR)lpServiceName, + (LPWSTR)lpDisplayName, + dwDesiredAccess, + dwServiceType, + dwStartType, + dwErrorControl, + (LPWSTR)lpBinaryPathName, + (LPWSTR)lpLoadOrderGroup, + lpdwTagId, + (LPBYTE)lpDependencies, + dwDependenciesLength, + (LPWSTR)lpServiceStartName, + NULL, /* FIXME: lpPassword */ + 0, /* FIXME: dwPasswordLength */ + (SC_RPC_HANDLE *)&hService); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; + if (dwError != ERROR_SUCCESS) { ERR("RCreateServiceW() failed (Error %lu)\n", dwError); @@ -659,9 +741,18 @@ DeleteService(SC_HANDLE hService) HandleBind(); - /* Call to services.exe using RPC */ - dwError = RDeleteService(BindingHandle, - (SC_RPC_HANDLE)hService); + _SEH_TRY + { + /* Call to services.exe using RPC */ + dwError = RDeleteService(BindingHandle, + (SC_RPC_HANDLE)hService); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; + if (dwError != ERROR_SUCCESS) { ERR("RDeleteService() failed (Error %lu)\n", dwError); @@ -687,20 +778,28 @@ EnumDependentServicesA(SC_HANDLE hService, LPDWORD lpServicesReturned) { LPENUM_SERVICE_STATUSA lpStatusPtr; - DWORD dwError = ERROR_SUCCESS; + DWORD dwError; DWORD dwCount; TRACE("EnumServicesStatusA() called\n"); HandleBind(); - dwError = REnumDependentServicesA(BindingHandle, - (SC_RPC_HANDLE)hService, - dwServiceState, - (LPBYTE)lpServices, - cbBufSize, - pcbBytesNeeded, - lpServicesReturned); + _SEH_TRY + { + dwError = REnumDependentServicesA(BindingHandle, + (SC_RPC_HANDLE)hService, + dwServiceState, + (LPBYTE)lpServices, + cbBufSize, + pcbBytesNeeded, + lpServicesReturned); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; lpStatusPtr = (LPENUM_SERVICE_STATUSA)lpServices; for (dwCount = 0; dwCount < *lpServicesReturned; dwCount++) @@ -743,20 +842,28 @@ EnumDependentServicesW(SC_HANDLE hService, LPDWORD lpServicesReturned) { LPENUM_SERVICE_STATUSW lpStatusPtr; - DWORD dwError = ERROR_SUCCESS; + DWORD dwError; DWORD dwCount; TRACE("EnumServicesStatusW() called\n"); HandleBind(); - dwError = REnumDependentServicesW(BindingHandle, - (SC_RPC_HANDLE)hService, - dwServiceState, - (LPBYTE)lpServices, - cbBufSize, - pcbBytesNeeded, - lpServicesReturned); + _SEH_TRY + { + dwError = REnumDependentServicesW(BindingHandle, + (SC_RPC_HANDLE)hService, + dwServiceState, + (LPBYTE)lpServices, + cbBufSize, + pcbBytesNeeded, + lpServicesReturned); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; lpStatusPtr = (LPENUM_SERVICE_STATUSW)lpServices; for (dwCount = 0; dwCount < *lpServicesReturned; dwCount++) @@ -825,22 +932,30 @@ EnumServicesStatusA(SC_HANDLE hSCManager, LPDWORD lpResumeHandle) { LPENUM_SERVICE_STATUSA lpStatusPtr; - DWORD dwError = ERROR_SUCCESS; + DWORD dwError; DWORD dwCount; TRACE("EnumServicesStatusA() called\n"); HandleBind(); - dwError = REnumServicesStatusA(BindingHandle, - (SC_RPC_HANDLE)hSCManager, - dwServiceType, - dwServiceState, - (LPBYTE)lpServices, - cbBufSize, - pcbBytesNeeded, - lpServicesReturned, - lpResumeHandle); + _SEH_TRY + { + dwError = REnumServicesStatusA(BindingHandle, + (SC_RPC_HANDLE)hSCManager, + dwServiceType, + dwServiceState, + (LPBYTE)lpServices, + cbBufSize, + pcbBytesNeeded, + lpServicesReturned, + lpResumeHandle); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; lpStatusPtr = (LPENUM_SERVICE_STATUSA)lpServices; for (dwCount = 0; dwCount < *lpServicesReturned; dwCount++) @@ -885,22 +1000,30 @@ EnumServicesStatusW(SC_HANDLE hSCManager, LPDWORD lpResumeHandle) { LPENUM_SERVICE_STATUSW lpStatusPtr; - DWORD dwError = ERROR_SUCCESS; + DWORD dwError; DWORD dwCount; TRACE("EnumServicesStatusW() called\n"); HandleBind(); - dwError = REnumServicesStatusW(BindingHandle, - (SC_RPC_HANDLE)hSCManager, - dwServiceType, - dwServiceState, - (LPBYTE)lpServices, - cbBufSize, - pcbBytesNeeded, - lpServicesReturned, - lpResumeHandle); + _SEH_TRY + { + dwError = REnumServicesStatusW(BindingHandle, + (SC_RPC_HANDLE)hSCManager, + dwServiceType, + dwServiceState, + (LPBYTE)lpServices, + cbBufSize, + pcbBytesNeeded, + lpServicesReturned, + lpResumeHandle); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; lpStatusPtr = (LPENUM_SERVICE_STATUSW)lpServices; for (dwCount = 0; dwCount < *lpServicesReturned; dwCount++) @@ -947,24 +1070,32 @@ EnumServicesStatusExA(SC_HANDLE hSCManager, LPCSTR pszGroupName) { LPENUM_SERVICE_STATUS_PROCESSA lpStatusPtr; - DWORD dwError = ERROR_SUCCESS; + DWORD dwError; DWORD dwCount; TRACE("EnumServicesStatusExA() called\n"); HandleBind(); - dwError = REnumServicesStatusExA(BindingHandle, - (SC_RPC_HANDLE)hSCManager, - InfoLevel, - dwServiceType, - dwServiceState, - (LPBYTE)lpServices, - cbBufSize, - pcbBytesNeeded, - lpServicesReturned, - lpResumeHandle, - (LPSTR)pszGroupName); + _SEH_TRY + { + dwError = REnumServicesStatusExA(BindingHandle, + (SC_RPC_HANDLE)hSCManager, + InfoLevel, + dwServiceType, + dwServiceState, + (LPBYTE)lpServices, + cbBufSize, + pcbBytesNeeded, + lpServicesReturned, + lpResumeHandle, + (LPSTR)pszGroupName); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; if (dwError == ERROR_MORE_DATA) { @@ -1019,24 +1150,32 @@ EnumServicesStatusExW(SC_HANDLE hSCManager, LPCWSTR pszGroupName) { LPENUM_SERVICE_STATUS_PROCESSW lpStatusPtr; - DWORD dwError = ERROR_SUCCESS; + DWORD dwError; DWORD dwCount; TRACE("EnumServicesStatusExW() called\n"); HandleBind(); - dwError = REnumServicesStatusExW(BindingHandle, - (SC_RPC_HANDLE)hSCManager, - InfoLevel, - dwServiceType, - dwServiceState, - (LPBYTE)lpServices, - cbBufSize, - pcbBytesNeeded, - lpServicesReturned, - lpResumeHandle, - (LPWSTR)pszGroupName); + _SEH_TRY + { + dwError = REnumServicesStatusExW(BindingHandle, + (SC_RPC_HANDLE)hSCManager, + InfoLevel, + dwServiceType, + dwServiceState, + (LPBYTE)lpServices, + cbBufSize, + pcbBytesNeeded, + lpServicesReturned, + lpResumeHandle, + (LPWSTR)pszGroupName); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; if (dwError == ERROR_MORE_DATA) { @@ -1088,13 +1227,28 @@ GetServiceDisplayNameA(SC_HANDLE hSCManager, TRACE("GetServiceDisplayNameA() called\n"); + if (!lpDisplayName) + *lpcchBuffer = 0; + HandleBind(); - dwError = RGetServiceDisplayNameA(BindingHandle, - (SC_RPC_HANDLE)hSCManager, - (LPSTR)lpServiceName, - lpDisplayName, - lpcchBuffer); + _SEH_TRY + { + dwError = RGetServiceDisplayNameA(BindingHandle, + (SC_RPC_HANDLE)hSCManager, + (LPSTR)lpServiceName, + lpDisplayName, + lpcchBuffer); + } + _SEH_HANDLE + { + /* HACK: because of a problem with rpcrt4, rpcserver is hacked to return 6 for ERROR_SERVICE_DOES_NOT_EXIST */ + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + + + _SEH_END; + if (dwError != ERROR_SUCCESS) { ERR("RGetServiceDisplayNameA() failed (Error %lu)\n", dwError); @@ -1102,8 +1256,6 @@ GetServiceDisplayNameA(SC_HANDLE hSCManager, return FALSE; } - (*lpcchBuffer)--; - return TRUE; } @@ -1123,13 +1275,25 @@ GetServiceDisplayNameW(SC_HANDLE hSCManager, TRACE("GetServiceDisplayNameW() called\n"); + if (!lpDisplayName) + *lpcchBuffer = 0; + HandleBind(); - dwError = RGetServiceDisplayNameW(BindingHandle, - (SC_RPC_HANDLE)hSCManager, - (LPWSTR)lpServiceName, - lpDisplayName, - lpcchBuffer); + _SEH_TRY + { + dwError = RGetServiceDisplayNameW(BindingHandle, + (SC_RPC_HANDLE)hSCManager, + (LPWSTR)lpServiceName, + lpDisplayName, + lpcchBuffer); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; + if (dwError != ERROR_SUCCESS) { ERR("RGetServiceDisplayNameW() failed (Error %lu)\n", dwError); @@ -1137,8 +1301,6 @@ GetServiceDisplayNameW(SC_HANDLE hSCManager, return FALSE; } - (*lpcchBuffer)--; - return TRUE; } @@ -1158,13 +1320,25 @@ GetServiceKeyNameA(SC_HANDLE hSCManager, TRACE("GetServiceKeyNameA() called\n"); + if (!lpServiceName) + *lpcchBuffer = 0; + HandleBind(); - dwError = RGetServiceKeyNameA(BindingHandle, - (SC_RPC_HANDLE)hSCManager, - (LPSTR)lpDisplayName, - lpServiceName, - lpcchBuffer); + _SEH_TRY + { + dwError = RGetServiceKeyNameA(BindingHandle, + (SC_RPC_HANDLE)hSCManager, + (LPSTR)lpDisplayName, + lpServiceName, + lpcchBuffer); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; + if (dwError != ERROR_SUCCESS) { ERR("RGetServiceKeyNameA() failed (Error %lu)\n", dwError); @@ -1172,8 +1346,6 @@ GetServiceKeyNameA(SC_HANDLE hSCManager, return FALSE; } - (*lpcchBuffer)--; - return TRUE; } @@ -1193,13 +1365,25 @@ GetServiceKeyNameW(SC_HANDLE hSCManager, TRACE("GetServiceKeyNameW() called\n"); + if (!lpDisplayName) + *lpcchBuffer = 0; + HandleBind(); - dwError = RGetServiceKeyNameW(BindingHandle, - (SC_RPC_HANDLE)hSCManager, - (LPWSTR)lpDisplayName, - lpServiceName, - lpcchBuffer); + _SEH_TRY + { + dwError = RGetServiceKeyNameW(BindingHandle, + (SC_RPC_HANDLE)hSCManager, + (LPWSTR)lpDisplayName, + lpServiceName, + lpcchBuffer); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; + if (dwError != ERROR_SUCCESS) { ERR("RGetServiceKeyNameW() failed (Error %lu)\n", dwError); @@ -1207,8 +1391,6 @@ GetServiceKeyNameW(SC_HANDLE hSCManager, return FALSE; } - (*lpcchBuffer)--; - return TRUE; } @@ -1228,10 +1410,19 @@ LockServiceDatabase(SC_HANDLE hSCManager) HandleBind(); - /* Call to services.exe using RPC */ - dwError = RLockServiceDatabase(BindingHandle, - (SC_RPC_HANDLE)hSCManager, - (SC_RPC_LOCK *)&hLock); + _SEH_TRY + { + /* Call to services.exe using RPC */ + dwError = RLockServiceDatabase(BindingHandle, + (SC_RPC_HANDLE)hSCManager, + (SC_RPC_LOCK *)&hLock); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; + if (dwError != ERROR_SUCCESS) { ERR("RLockServiceDatabase() failed (Error %lu)\n", dwError); @@ -1305,12 +1496,21 @@ OpenSCManagerA(LPCSTR lpMachineName, HandleBind(); - /* Call to services.exe using RPC */ - dwError = ROpenSCManagerA(BindingHandle, - (LPSTR)lpMachineName, - (LPSTR)lpDatabaseName, - dwDesiredAccess, - (SC_RPC_HANDLE *)&hScm); + _SEH_TRY + { + /* Call to services.exe using RPC */ + dwError = ROpenSCManagerA(BindingHandle, + (LPSTR)lpMachineName, + (LPSTR)lpDatabaseName, + dwDesiredAccess, + (SC_RPC_HANDLE *)&hScm); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; + if (dwError != ERROR_SUCCESS) { ERR("ROpenSCManagerA() failed (Error %lu)\n", dwError); @@ -1344,12 +1544,21 @@ OpenSCManagerW(LPCWSTR lpMachineName, HandleBind(); - /* Call to services.exe using RPC */ - dwError = ROpenSCManagerW(BindingHandle, - (LPWSTR)lpMachineName, - (LPWSTR)lpDatabaseName, - dwDesiredAccess, - (SC_RPC_HANDLE *)&hScm); + _SEH_TRY + { + /* Call to services.exe using RPC */ + dwError = ROpenSCManagerW(BindingHandle, + (LPWSTR)lpMachineName, + (LPWSTR)lpDatabaseName, + dwDesiredAccess, + (SC_RPC_HANDLE *)&hScm); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; + if (dwError != ERROR_SUCCESS) { ERR("ROpenSCManagerW() failed (Error %lu)\n", dwError); @@ -1381,12 +1590,21 @@ OpenServiceA(SC_HANDLE hSCManager, HandleBind(); - /* Call to services.exe using RPC */ - dwError = ROpenServiceA(BindingHandle, - (SC_RPC_HANDLE)hSCManager, - (LPSTR)lpServiceName, - dwDesiredAccess, - (SC_RPC_HANDLE *)&hService); + _SEH_TRY + { + /* Call to services.exe using RPC */ + dwError = ROpenServiceA(BindingHandle, + (SC_RPC_HANDLE)hSCManager, + (LPSTR)lpServiceName, + dwDesiredAccess, + (SC_RPC_HANDLE *)&hService); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; + if (dwError != ERROR_SUCCESS) { ERR("ROpenServiceA() failed (Error %lu)\n", dwError); @@ -1418,12 +1636,21 @@ OpenServiceW(SC_HANDLE hSCManager, HandleBind(); - /* Call to services.exe using RPC */ - dwError = ROpenServiceW(BindingHandle, - (SC_RPC_HANDLE)hSCManager, - (LPWSTR)lpServiceName, - dwDesiredAccess, - (SC_RPC_HANDLE *)&hService); + _SEH_TRY + { + /* Call to services.exe using RPC */ + dwError = ROpenServiceW(BindingHandle, + (SC_RPC_HANDLE)hSCManager, + (LPWSTR)lpServiceName, + dwDesiredAccess, + (SC_RPC_HANDLE *)&hService); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; + if (dwError != ERROR_SUCCESS) { if (dwError == ERROR_SERVICE_DOES_NOT_EXIST) @@ -1458,12 +1685,21 @@ QueryServiceConfigA(SC_HANDLE hService, HandleBind(); - /* Call to services.exe using RPC */ - dwError = RQueryServiceConfigA(BindingHandle, - (SC_RPC_HANDLE)hService, - lpServiceConfig, - cbBufSize, - pcbBytesNeeded); + _SEH_TRY + { + /* Call to services.exe using RPC */ + dwError = RQueryServiceConfigA(BindingHandle, + (SC_RPC_HANDLE)hService, + (LPBYTE)lpServiceConfig, + cbBufSize, + pcbBytesNeeded); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; + if (dwError != ERROR_SUCCESS) { ERR("RQueryServiceConfigA() failed (Error %lu)\n", dwError); @@ -1521,12 +1757,21 @@ QueryServiceConfigW(SC_HANDLE hService, HandleBind(); - /* Call to services.exe using RPC */ - dwError = RQueryServiceConfigW(BindingHandle, - (SC_RPC_HANDLE)hService, - (LPBYTE)lpServiceConfig, - cbBufSize, - pcbBytesNeeded); + _SEH_TRY + { + /* Call to services.exe using RPC */ + dwError = RQueryServiceConfigW(BindingHandle, + (SC_RPC_HANDLE)hService, + (LPBYTE)lpServiceConfig, + cbBufSize, + pcbBytesNeeded); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; + if (dwError != ERROR_SUCCESS) { if (dwError == ERROR_INSUFFICIENT_BUFFER) @@ -1586,15 +1831,38 @@ QueryServiceConfig2A(SC_HANDLE hService, TRACE("QueryServiceConfig2A(%p, %lu, %p, %lu, %p)\n", hService, dwInfoLevel, lpBuffer, cbBufSize, pcbBytesNeeded); + if (dwInfoLevel != SERVICE_CONFIG_DESCRIPTION && + dwInfoLevel != SERVICE_CONFIG_FAILURE_ACTIONS) + { + SetLastError(ERROR_INVALID_LEVEL); + return FALSE; + } + + if ((lpBuffer == NULL && cbBufSize != 0) || + pcbBytesNeeded == NULL) + { + SetLastError(ERROR_INVALID_ADDRESS); + return FALSE; + } + HandleBind(); - /* Call to services.exe using RPC */ - dwError = RQueryServiceConfig2A(BindingHandle, - (SC_RPC_HANDLE)hService, - dwInfoLevel, - lpBuffer, - cbBufSize, - pcbBytesNeeded); + _SEH_TRY + { + /* Call to services.exe using RPC */ + dwError = RQueryServiceConfig2A(BindingHandle, + (SC_RPC_HANDLE)hService, + dwInfoLevel, + lpBuffer, + cbBufSize, + pcbBytesNeeded); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; + if (dwError != ERROR_SUCCESS) { ERR("RQueryServiceConfig2A() failed (Error %lu)\n", dwError); @@ -1661,15 +1929,38 @@ QueryServiceConfig2W(SC_HANDLE hService, TRACE("QueryServiceConfig2W(%p, %lu, %p, %lu, %p)\n", hService, dwInfoLevel, lpBuffer, cbBufSize, pcbBytesNeeded); + if (dwInfoLevel != SERVICE_CONFIG_DESCRIPTION && + dwInfoLevel != SERVICE_CONFIG_FAILURE_ACTIONS) + { + SetLastError(ERROR_INVALID_LEVEL); + return FALSE; + } + + if ((lpBuffer == NULL && cbBufSize != 0) || + pcbBytesNeeded == NULL) + { + SetLastError(ERROR_INVALID_ADDRESS); + return FALSE; + } + HandleBind(); - /* Call to services.exe using RPC */ - dwError = RQueryServiceConfig2W(BindingHandle, - (SC_RPC_HANDLE)hService, - dwInfoLevel, - lpBuffer, - cbBufSize, - pcbBytesNeeded); + _SEH_TRY + { + /* Call to services.exe using RPC */ + dwError = RQueryServiceConfig2W(BindingHandle, + (SC_RPC_HANDLE)hService, + dwInfoLevel, + lpBuffer, + cbBufSize, + pcbBytesNeeded); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; + if (dwError != ERROR_SUCCESS) { ERR("RQueryServiceConfig2W() failed (Error %lu)\n", dwError); @@ -1736,12 +2027,21 @@ QueryServiceLockStatusA(SC_HANDLE hSCManager, HandleBind(); - /* Call to services.exe using RPC */ - dwError = RQueryServiceLockStatusA(BindingHandle, - (SC_RPC_HANDLE)hSCManager, - lpLockStatus, - cbBufSize, - pcbBytesNeeded); + _SEH_TRY + { + /* Call to services.exe using RPC */ + dwError = RQueryServiceLockStatusA(BindingHandle, + (SC_RPC_HANDLE)hSCManager, + lpLockStatus, + cbBufSize, + pcbBytesNeeded); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; + if (dwError != ERROR_SUCCESS) { ERR("RQueryServiceLockStatusA() failed (Error %lu)\n", dwError); @@ -1778,12 +2078,21 @@ QueryServiceLockStatusW(SC_HANDLE hSCManager, HandleBind(); - /* Call to services.exe using RPC */ - dwError = RQueryServiceLockStatusW(BindingHandle, - (SC_RPC_HANDLE)hSCManager, - lpLockStatus, - cbBufSize, - pcbBytesNeeded); + _SEH_TRY + { + /* Call to services.exe using RPC */ + dwError = RQueryServiceLockStatusW(BindingHandle, + (SC_RPC_HANDLE)hSCManager, + lpLockStatus, + cbBufSize, + pcbBytesNeeded); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; + if (dwError != ERROR_SUCCESS) { ERR("RQueryServiceLockStatusW() failed (Error %lu)\n", dwError); @@ -1822,13 +2131,22 @@ QueryServiceObjectSecurity(SC_HANDLE hService, HandleBind(); - /* Call to services.exe using RPC */ - dwError = RQueryServiceObjectSecurity(BindingHandle, - (SC_RPC_HANDLE)hService, - dwSecurityInformation, - (LPBYTE)lpSecurityDescriptor, - cbBufSize, - pcbBytesNeeded); + _SEH_TRY + { + /* Call to services.exe using RPC */ + dwError = RQueryServiceObjectSecurity(BindingHandle, + (SC_RPC_HANDLE)hService, + dwSecurityInformation, + (LPBYTE)lpSecurityDescriptor, + cbBufSize, + pcbBytesNeeded); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; + if (dwError != ERROR_SUCCESS) { ERR("QueryServiceObjectSecurity() failed (Error %lu)\n", dwError); @@ -1883,12 +2201,20 @@ SetServiceObjectSecurity(SC_HANDLE hService, HandleBind(); - /* Call to services.exe using RPC */ - dwError = RSetServiceObjectSecurity(BindingHandle, - (SC_RPC_HANDLE)hService, - dwSecurityInformation, - (LPBYTE)SelfRelativeSD, - Length); + _SEH_TRY + { + /* Call to services.exe using RPC */ + dwError = RSetServiceObjectSecurity(BindingHandle, + (SC_RPC_HANDLE)hService, + dwSecurityInformation, + (LPBYTE)SelfRelativeSD, + Length); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; HeapFree(GetProcessHeap(), 0, SelfRelativeSD); @@ -1919,10 +2245,19 @@ QueryServiceStatus(SC_HANDLE hService, HandleBind(); - /* Call to services.exe using RPC */ - dwError = RQueryServiceStatus(BindingHandle, - (SC_RPC_HANDLE)hService, - lpServiceStatus); + _SEH_TRY + { + /* Call to services.exe using RPC */ + dwError = RQueryServiceStatus(BindingHandle, + (SC_RPC_HANDLE)hService, + lpServiceStatus); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; + if (dwError != ERROR_SUCCESS) { ERR("RQueryServiceStatus() failed (Error %lu)\n", dwError); @@ -1952,13 +2287,22 @@ QueryServiceStatusEx(SC_HANDLE hService, HandleBind(); - /* Call to services.exe using RPC */ - dwError = RQueryServiceStatusEx(BindingHandle, - (SC_RPC_HANDLE)hService, - InfoLevel, - lpBuffer, - cbBufSize, - pcbBytesNeeded); + _SEH_TRY + { + /* Call to services.exe using RPC */ + dwError = RQueryServiceStatusEx(BindingHandle, + (SC_RPC_HANDLE)hService, + InfoLevel, + lpBuffer, + cbBufSize, + pcbBytesNeeded); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; + if (dwError != ERROR_SUCCESS) { ERR("RQueryServiceStatusEx() failed (Error %lu)\n", dwError); @@ -1982,11 +2326,18 @@ StartServiceA(SC_HANDLE hService, { DWORD dwError; - dwError = RStartServiceA(BindingHandle, - (SC_RPC_HANDLE)hService, - dwNumServiceArgs, - (LPSTRING_PTRSA)lpServiceArgVectors); - + _SEH_TRY + { + dwError = RStartServiceA(BindingHandle, + (SC_RPC_HANDLE)hService, + dwNumServiceArgs, + (LPSTRING_PTRSA)lpServiceArgVectors); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; if (dwError != ERROR_SUCCESS) { @@ -2011,10 +2362,18 @@ StartServiceW(SC_HANDLE hService, { DWORD dwError; - dwError = RStartServiceW(BindingHandle, - (SC_RPC_HANDLE)hService, - dwNumServiceArgs, - (LPSTRING_PTRSW)lpServiceArgVectors); + _SEH_TRY + { + dwError = RStartServiceW(BindingHandle, + (SC_RPC_HANDLE)hService, + dwNumServiceArgs, + (LPSTRING_PTRSW)lpServiceArgVectors); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; if (dwError != ERROR_SUCCESS) { @@ -2041,9 +2400,18 @@ UnlockServiceDatabase(SC_LOCK ScLock) HandleBind(); - /* Call to services.exe using RPC */ - dwError = RUnlockServiceDatabase(BindingHandle, - (SC_RPC_LOCK)ScLock); + _SEH_TRY + { + /* Call to services.exe using RPC */ + dwError = RUnlockServiceDatabase(BindingHandle, + (SC_RPC_LOCK)ScLock); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; + if (dwError != ERROR_SUCCESS) { ERR("RUnlockServiceDatabase() failed (Error %lu)\n", dwError); @@ -2069,10 +2437,19 @@ NotifyBootConfigStatus(BOOL BootAcceptable) HandleBind(); - /* Call to services.exe using RPC */ - dwError = RNotifyBootConfigStatus(BindingHandle, - NULL, - BootAcceptable); + _SEH_TRY + { + /* Call to services.exe using RPC */ + dwError = RNotifyBootConfigStatus(BindingHandle, + NULL, + BootAcceptable); + } + _SEH_HANDLE + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + _SEH_END; + if (dwError != ERROR_SUCCESS) { ERR("NotifyBootConfigStatus() failed (Error %lu)\n", dwError); diff --git a/reactos/dll/win32/advapi32/token/token.c b/reactos/dll/win32/advapi32/token/token.c index 9bb6f6556dd..c7115b08398 100644 --- a/reactos/dll/win32/advapi32/token/token.c +++ b/reactos/dll/win32/advapi32/token/token.c @@ -670,4 +670,18 @@ GetSiteSidFromToken(IN HANDLE TokenHandle) return PSiteSid; } - +BOOL +WINAPI +CreateProcessWithTokenW(IN HANDLE hToken, + IN DWORD dwLogonFlags, + IN LPCWSTR lpApplicationName OPTIONAL, + IN OUT LPWSTR lpCommandLine OPTIONAL, + IN DWORD dwCreationFlags, + IN LPVOID lpEnvironment OPTIONAL, + IN LPCWSTR lpCurrentDirectory OPTIONAL, + IN LPSTARTUPINFOW lpStartupInfo, + OUT LPPROCESS_INFORMATION lpProcessInfo) +{ + UNIMPLEMENTED; + return FALSE; +} diff --git a/reactos/dll/win32/browseui/bandsite.c b/reactos/dll/win32/browseui/bandsite.c index 0630aa16a7c..125389464ac 100644 --- a/reactos/dll/win32/browseui/bandsite.c +++ b/reactos/dll/win32/browseui/bandsite.c @@ -1,7 +1,7 @@ /* * Rebar band site * - * Copyright 2007 Hervй Poussineua + * Copyright 2007 Hervй Poussineau * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/reactos/dll/win32/iphlpapi/iphlpapi_main.c b/reactos/dll/win32/iphlpapi/iphlpapi_main.c index 09555bc3bc0..f8dc48f7f74 100644 --- a/reactos/dll/win32/iphlpapi/iphlpapi_main.c +++ b/reactos/dll/win32/iphlpapi/iphlpapi_main.c @@ -88,6 +88,19 @@ DWORD WINAPI AddIPAddress(IPAddr Address, IPMask Netmask, DWORD IfIndex, PULONG return RtlNtStatusToDosError(addIPAddress(Address, Netmask, IfIndex, NteContext, NteInstance)); } +DWORD getInterfaceGatewayByIndex(DWORD index) +{ + DWORD ndx, retVal = 0, numRoutes = getNumRoutes(); + RouteTable *table = getRouteTable(); + + for (ndx = 0; ndx < numRoutes; ndx++) + { + if ((table->routes[ndx].ifIndex == (index - 1)) && (table->routes[ndx].dest == 0)) + retVal = table->routes[ndx].gateway; + } + HeapFree(GetProcessHeap(), 0, table); + return retVal; +} /****************************************************************** * AllocateAndGetIfTableFromStack (IPHLPAPI.@) @@ -640,6 +653,8 @@ DWORD WINAPI GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen) ptr->IpAddressList.IpAddress.String); toIPAddressString(getInterfaceMaskByIndex(table->indexes[ndx]), ptr->IpAddressList.IpMask.String); + toIPAddressString(getInterfaceGatewayByIndex(table->indexes[ndx]), + ptr->GatewayList.IpAddress.String); getDhcpInfoForAdapter(table->indexes[ndx], &dhcpEnabled, &dhcpServer, &ptr->LeaseObtained, &ptr->LeaseExpires); @@ -1160,7 +1175,7 @@ DWORD WINAPI GetIpForwardTable(PMIB_IPFORWARDTABLE pIpForwardTable, PULONG pdwSi pIpForwardTable->dwNumEntries = table->numRoutes; for (ndx = 0; ndx < numRoutes; ndx++) { pIpForwardTable->table[ndx].dwForwardIfIndex = - table->routes[ndx].ifIndex; + table->routes[ndx].ifIndex + 1; pIpForwardTable->table[ndx].dwForwardDest = table->routes[ndx].dest; pIpForwardTable->table[ndx].dwForwardMask = @@ -1190,7 +1205,7 @@ DWORD WINAPI GetIpForwardTable(PMIB_IPFORWARDTABLE pIpForwardTable, PULONG pdwSi sizeof(MIB_IPFORWARDROW), IpForwardTableSorter); ret = NO_ERROR; } - free(table); + HeapFree(GetProcessHeap(), 0, table); } else ret = ERROR_OUTOFMEMORY; diff --git a/reactos/dll/win32/kernel32/lang/bg-BG.mc b/reactos/dll/win32/kernel32/lang/bg-BG.mc new file mode 100644 index 00000000000..1e49b37947e --- /dev/null +++ b/reactos/dll/win32/kernel32/lang/bg-BG.mc @@ -0,0 +1,17492 @@ +; +; kernel32.mc MESSAGE resources for kernel32.dll +; + +MessageIdTypedef=ULONG + +SeverityNames=(Success=0x0:STATUS_SEVERITY_SUCCESS + Informational=0x1:STATUS_SEVERITY_INFORMATIONAL + Warning=0x2:STATUS_SEVERITY_WARNING + Error=0x3:STATUS_SEVERITY_ERROR + ) + +FacilityNames=(System=0x0:FACILITY_SYSTEM + ITF=0x4:FACILITY_ITF + WIN32=0x7:FACILITY_GENERAL + ) + +LanguageNames=(Bulgarian=0x419:MSG00419) + + +; +; message definitions +; + +; Facility=System + +MessageId=0 +Severity=Success +Facility=System +SymbolicName=ERROR_SUCCESS +Language=Bulgarian +ERROR_SUCCESS - Действието е завършено успешно. +. + +MessageId=1 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_FUNCTION +Language=Bulgarian +ERROR_INVALID_FUNCTION - Грешна функция. +. + +MessageId=2 +Severity=Success +Facility=System +SymbolicName=ERROR_FILE_NOT_FOUND +Language=Bulgarian +ERROR_FILE_NOT_FOUND - Файлът не е открит. +. + +MessageId=3 +Severity=Success +Facility=System +SymbolicName=ERROR_PATH_NOT_FOUND +Language=Bulgarian +ERROR_PATH_NOT_FOUND - Пътят не е открит. +. + +MessageId=4 +Severity=Success +Facility=System +SymbolicName=ERROR_TOO_MANY_OPEN_FILES +Language=Bulgarian +ERROR_TOO_MANY_OPEN_FILES - Твърде много отворени файлове. +. + +MessageId=5 +Severity=Success +Facility=System +SymbolicName=ERROR_ACCESS_DENIED +Language=Bulgarian +ERROR_ACCESS_DENIED - Достъпът е отказан. +. + +MessageId=6 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_HANDLE +Language=Bulgarian +ERROR_INVALID_HANDLE - Грешен държател. +. + +MessageId=7 +Severity=Success +Facility=System +SymbolicName=ERROR_ARENA_TRASHED +Language=Bulgarian +ERROR_ARENA_TRASHED - The storage control blocks were destroyed. +. + +MessageId=8 +Severity=Success +Facility=System +SymbolicName=ERROR_NOT_ENOUGH_MEMORY +Language=Bulgarian +ERROR_NOT_ENOUGH_MEMORY - Not enough storage is available to process this command. +. + +MessageId=9 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_BLOCK +Language=Bulgarian +ERROR_INVALID_BLOCK - The storage control block address is invalid. +. + +MessageId=10 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_ENVIRONMENT +Language=Bulgarian +ERROR_BAD_ENVIRONMENT - Средата е неправилна. +. + +MessageId=11 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_FORMAT +Language=Bulgarian +ERROR_BAD_FORMAT - Направен е опит за зареждане на приложение с неправилен формат. +. + +MessageId=12 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_ACCESS +Language=Bulgarian +ERROR_INVALID_ACCESS - Кодът за достъп е грешен. +. + +MessageId=13 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_DATA +Language=Bulgarian +ERROR_INVALID_DATA - Неправилни данни. +. + +MessageId=14 +Severity=Success +Facility=System +SymbolicName=ERROR_OUTOFMEMORY +Language=Bulgarian +ERROR_OUTOFMEMORY - Not enough storage is available to complete this operation. +. + +MessageId=15 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_DRIVE +Language=Bulgarian +ERROR_INVALID_DRIVE - Уредбата не може да намери указаното устройство. +. + +MessageId=16 +Severity=Success +Facility=System +SymbolicName=ERROR_CURRENT_DIRECTORY +Language=Bulgarian +ERROR_CURRENT_DIRECTORY - Изтриването на папката е невъзможно. +. + +MessageId=17 +Severity=Success +Facility=System +SymbolicName=ERROR_NOT_SAME_DEVICE +Language=Bulgarian +ERROR_NOT_SAME_DEVICE - Уредбата не може да премести файла на друго дисково устройство. +. + +MessageId=18 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_MORE_FILES +Language=Bulgarian +ERROR_NO_MORE_FILES - Няма повече файлове. +. + +MessageId=19 +Severity=Success +Facility=System +SymbolicName=ERROR_WRITE_PROTECT +Language=Bulgarian +ERROR_WRITE_PROTECT - Носителят е защитен против запис. +. + +MessageId=20 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_UNIT +Language=Bulgarian +ERROR_BAD_UNIT - Уредбата не може да намери указаното устройство. +. + +MessageId=21 +Severity=Success +Facility=System +SymbolicName=ERROR_NOT_READY +Language=Bulgarian +ERROR_NOT_READY - Устройството не е готово. +. + +MessageId=22 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_COMMAND +Language=Bulgarian +ERROR_BAD_COMMAND - Устройството не разпознава командата. +. + +MessageId=23 +Severity=Success +Facility=System +SymbolicName=ERROR_CRC +Language=Bulgarian +ERROR_CRC - Грешка в данните (проверка на цикличния остатък (crc)). +. + +MessageId=24 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_LENGTH +Language=Bulgarian +ERROR_BAD_LENGTH - Програмата издаде команда, но дължината на командата е грешна. +. + +MessageId=25 +Severity=Success +Facility=System +SymbolicName=ERROR_SEEK +Language=Bulgarian +ERROR_SEEK - УСтройството не може да открие определена област или пътечката от диска. +. + +MessageId=26 +Severity=Success +Facility=System +SymbolicName=ERROR_NOT_DOS_DISK +Language=Bulgarian +ERROR_NOT_DOS_DISK - Указаният диск или дискета не може да бъде достъпен. +. + +MessageId=27 +Severity=Success +Facility=System +SymbolicName=ERROR_SECTOR_NOT_FOUND +Language=Bulgarian +ERROR_SECTOR_NOT_FOUND - Устройството не може да намери заявения отсек (сектор). +. + +MessageId=28 +Severity=Success +Facility=System +SymbolicName=ERROR_OUT_OF_PAPER +Language=Bulgarian +ERROR_OUT_OF_PAPER - Хартията в печатача свърши. +. + +MessageId=29 +Severity=Success +Facility=System +SymbolicName=ERROR_WRITE_FAULT +Language=Bulgarian +ERROR_WRITE_FAULT - Уредбата не може да пише на указаното устройство. +. + +MessageId=30 +Severity=Success +Facility=System +SymbolicName=ERROR_READ_FAULT +Language=Bulgarian +ERROR_READ_FAULT - Уредбата не може да чете от указаното устройство.. + +MessageId=31 +Severity=Success +Facility=System +SymbolicName=ERROR_GEN_FAILURE +Language=Bulgarian +ERROR_GEN_FAILURE - A device attached to the system is not functioning. +. + +MessageId=32 +Severity=Success +Facility=System +SymbolicName=ERROR_SHARING_VIOLATION +Language=Bulgarian +ERROR_SHARING_VIOLATION - The process cannot access the file because it is being used by another process. +. + +MessageId=33 +Severity=Success +Facility=System +SymbolicName=ERROR_LOCK_VIOLATION +Language=Bulgarian +ERROR_LOCK_VIOLATION - The process cannot access the file because another process has locked a portion of the file. +. + +MessageId=34 +Severity=Success +Facility=System +SymbolicName=ERROR_WRONG_DISK +Language=Bulgarian +ERROR_WRONG_DISK - The wrong diskette is in the drive. Insert %2 (Volume Serial Number: %3) into drive %1. +. + +MessageId=36 +Severity=Success +Facility=System +SymbolicName=ERROR_SHARING_BUFFER_EXCEEDED +Language=Bulgarian +ERROR_SHARING_BUFFER_EXCEEDED - Too many files opened for sharing. +. + +MessageId=38 +Severity=Success +Facility=System +SymbolicName=ERROR_HANDLE_EOF +Language=Bulgarian +ERROR_HANDLE_EOF - Reached the end of the file. +. + +MessageId=39 +Severity=Success +Facility=System +SymbolicName=ERROR_HANDLE_DISK_FULL +Language=Bulgarian +ERROR_HANDLE_DISK_FULL - Дискът е пълен. +. + +MessageId=50 +Severity=Success +Facility=System +SymbolicName=ERROR_NOT_SUPPORTED +Language=Bulgarian +ERROR_NOT_SUPPORTED - Заявката не се поддържа. +. + +MessageId=51 +Severity=Success +Facility=System +SymbolicName=ERROR_REM_NOT_LIST +Language=Bulgarian +ERROR_REM_NOT_LIST - Windows cannot find the network path. Verify that the network path is correct and the destination computer is not busy or turned off. If Windows still cannot find the network path, contact your network administrator. +. + +MessageId=52 +Severity=Success +Facility=System +SymbolicName=ERROR_DUP_NAME +Language=Bulgarian +ERROR_DUP_NAME - You were not connected because a duplicate name exists on the network. Go to System in the Control Panel to change the computer name and try again. +. + +MessageId=53 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_NETPATH +Language=Bulgarian +ERROR_BAD_NETPATH - Мрежовият път не е открит. +. + +MessageId=54 +Severity=Success +Facility=System +SymbolicName=ERROR_NETWORK_BUSY +Language=Bulgarian +ERROR_NETWORK_BUSY - Мрежата е заета. +. + +MessageId=55 +Severity=Success +Facility=System +SymbolicName=ERROR_DEV_NOT_EXIST +Language=Bulgarian +ERROR_DEV_NOT_EXIST - The specified network resource or device is no longer available. +. + +MessageId=56 +Severity=Success +Facility=System +SymbolicName=ERROR_TOO_MANY_CMDS +Language=Bulgarian +ERROR_TOO_MANY_CMDS - The network BIOS command limit has been reached. +. + +MessageId=57 +Severity=Success +Facility=System +SymbolicName=ERROR_ADAP_HDW_ERR +Language=Bulgarian +ERROR_ADAP_HDW_ERR - A network adapter hardware error occurred. +. + +MessageId=58 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_NET_RESP +Language=Bulgarian +ERROR_BAD_NET_RESP - The specified server cannot perform the requested operation. +. + +MessageId=59 +Severity=Success +Facility=System +SymbolicName=ERROR_UNEXP_NET_ERR +Language=Bulgarian +ERROR_UNEXP_NET_ERR - An unexpected network error occurred. +. + +MessageId=60 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_REM_ADAP +Language=Bulgarian +ERROR_BAD_REM_ADAP - The remote adapter is not compatible. +. + +MessageId=61 +Severity=Success +Facility=System +SymbolicName=ERROR_PRINTQ_FULL +Language=Bulgarian +ERROR_PRINTQ_FULL - The printer queue is full. +. + +MessageId=62 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_SPOOL_SPACE +Language=Bulgarian +ERROR_NO_SPOOL_SPACE - Space to store the file waiting to be printed is not available on the server. +. + +MessageId=63 +Severity=Success +Facility=System +SymbolicName=ERROR_PRINT_CANCELLED +Language=Bulgarian +ERROR_PRINT_CANCELLED - Your file waiting to be printed was deleted. +. + +MessageId=64 +Severity=Success +Facility=System +SymbolicName=ERROR_NETNAME_DELETED +Language=Bulgarian +ERROR_NETNAME_DELETED - The specified network name is no longer available. +. + +MessageId=65 +Severity=Success +Facility=System +SymbolicName=ERROR_NETWORK_ACCESS_DENIED +Language=Bulgarian +ERROR_NETWORK_ACCESS_DENIED - Network access is denied. +. + +MessageId=66 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_DEV_TYPE +Language=Bulgarian +ERROR_BAD_DEV_TYPE - The network resource type is not correct. +. + +MessageId=67 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_NET_NAME +Language=Bulgarian +ERROR_BAD_NET_NAME - Сетевое имя не найдено. +. + +MessageId=68 +Severity=Success +Facility=System +SymbolicName=ERROR_TOO_MANY_NAMES +Language=Bulgarian +ERROR_TOO_MANY_NAMES - The name limit for the local computer network adapter card was exceeded. +. + +MessageId=69 +Severity=Success +Facility=System +SymbolicName=ERROR_TOO_MANY_SESS +Language=Bulgarian +ERROR_TOO_MANY_SESS - The network BIOS session limit was exceeded. +. + +MessageId=70 +Severity=Success +Facility=System +SymbolicName=ERROR_SHARING_PAUSED +Language=Bulgarian +ERROR_SHARING_PAUSED - The remote server has been paused or is in the process of being started. +. + +MessageId=71 +Severity=Success +Facility=System +SymbolicName=ERROR_REQ_NOT_ACCEP +Language=Bulgarian +ERROR_REQ_NOT_ACCEP - No more connections can be made to this remote computer at this time because there are already as many connections as the computer can accept. +. + +MessageId=72 +Severity=Success +Facility=System +SymbolicName=ERROR_REDIR_PAUSED +Language=Bulgarian +ERROR_REDIR_PAUSED - The specified printer or disk device has been paused. +. + +MessageId=80 +Severity=Success +Facility=System +SymbolicName=ERROR_FILE_EXISTS +Language=Bulgarian +ERROR_FILE_EXISTS - Файл существует. +. + +MessageId=82 +Severity=Success +Facility=System +SymbolicName=ERROR_CANNOT_MAKE +Language=Bulgarian +ERROR_CANNOT_MAKE - Не удалось создать файл или директорию. +. + +MessageId=83 +Severity=Success +Facility=System +SymbolicName=ERROR_FAIL_I24 +Language=Bulgarian +ERROR_FAIL_I24 - Fail on INT 24. +. + +MessageId=84 +Severity=Success +Facility=System +SymbolicName=ERROR_OUT_OF_STRUCTURES +Language=Bulgarian +ERROR_OUT_OF_STRUCTURES - Storage to process this request is not available. +. + +MessageId=85 +Severity=Success +Facility=System +SymbolicName=ERROR_ALREADY_ASSIGNED +Language=Bulgarian +ERROR_ALREADY_ASSIGNED - The local device name is already in use. +. + +MessageId=86 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_PASSWORD +Language=Bulgarian +ERROR_INVALID_PASSWORD - The specified network password is not correct. +. + +MessageId=87 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_PARAMETER +Language=Bulgarian +ERROR_INVALID_PARAMETER - Некорректный параметр. +. + +MessageId=88 +Severity=Success +Facility=System +SymbolicName=ERROR_NET_WRITE_FAULT +Language=Bulgarian +ERROR_NET_WRITE_FAULT - A write fault occurred on the network. +. + +MessageId=89 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_PROC_SLOTS +Language=Bulgarian +ERROR_NO_PROC_SLOTS - The system cannot start another process at this time. +. + +MessageId=100 +Severity=Success +Facility=System +SymbolicName=ERROR_TOO_MANY_SEMAPHORES +Language=Bulgarian +ERROR_TOO_MANY_SEMAPHORES - Cannot create another system semaphore. +. + +MessageId=101 +Severity=Success +Facility=System +SymbolicName=ERROR_EXCL_SEM_ALREADY_OWNED +Language=Bulgarian +ERROR_EXCL_SEM_ALREADY_OWNED - The exclusive semaphore is owned by another process. +. + +MessageId=102 +Severity=Success +Facility=System +SymbolicName=ERROR_SEM_IS_SET +Language=Bulgarian +ERROR_SEM_IS_SET - The semaphore is set and cannot be closed. +. + +MessageId=103 +Severity=Success +Facility=System +SymbolicName=ERROR_TOO_MANY_SEM_REQUESTS +Language=Bulgarian +ERROR_TOO_MANY_SEM_REQUESTS - The semaphore cannot be set again. +. + +MessageId=104 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_AT_INTERRUPT_TIME +Language=Bulgarian +ERROR_INVALID_AT_INTERRUPT_TIME - Cannot request exclusive semaphores at interrupt time. +. + +MessageId=105 +Severity=Success +Facility=System +SymbolicName=ERROR_SEM_OWNER_DIED +Language=Bulgarian +ERROR_SEM_OWNER_DIED - The previous ownership of this semaphore has ended. +. + +MessageId=106 +Severity=Success +Facility=System +SymbolicName=ERROR_SEM_USER_LIMIT +Language=Bulgarian +ERROR_SEM_USER_LIMIT - Вставте дискету в дисковод %1. +. + +MessageId=107 +Severity=Success +Facility=System +SymbolicName=ERROR_DISK_CHANGE +Language=Bulgarian +ERROR_DISK_CHANGE - The program stopped because an alternate diskette was not inserted. +. + +MessageId=108 +Severity=Success +Facility=System +SymbolicName=ERROR_DRIVE_LOCKED +Language=Bulgarian +ERROR_DRIVE_LOCKED - The disk is in use or locked by another process. +. + +MessageId=109 +Severity=Success +Facility=System +SymbolicName=ERROR_BROKEN_PIPE +Language=Bulgarian +ERROR_BROKEN_PIPE - The pipe has been ended. +. + +MessageId=110 +Severity=Success +Facility=System +SymbolicName=ERROR_OPEN_FAILED +Language=Bulgarian +ERROR_OPEN_FAILED - Системе не удалось открыть указанный файл или устройство. +. + +MessageId=111 +Severity=Success +Facility=System +SymbolicName=ERROR_BUFFER_OVERFLOW +Language=Bulgarian +ERROR_BUFFER_OVERFLOW - Имя файла слишком длинное. +. + +MessageId=112 +Severity=Success +Facility=System +SymbolicName=ERROR_DISK_FULL +Language=Bulgarian +ERROR_DISK_FULL - There is not enough space on the disk. +. + +MessageId=113 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_MORE_SEARCH_HANDLES +Language=Bulgarian +ERROR_NO_MORE_SEARCH_HANDLES - No more internal file identifiers available. +. + +MessageId=114 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_TARGET_HANDLE +Language=Bulgarian +ERROR_INVALID_TARGET_HANDLE - The target internal file identifier is incorrect. +. + +MessageId=117 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_CATEGORY +Language=Bulgarian +ERROR_INVALID_CATEGORY - The IOCTL call made by the application program is not correct. +. + +MessageId=118 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_VERIFY_SWITCH +Language=Bulgarian +ERROR_INVALID_VERIFY_SWITCH - The verify-on-write switch parameter value is not correct. +. + +MessageId=119 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_DRIVER_LEVEL +Language=Bulgarian +ERROR_BAD_DRIVER_LEVEL - The system does not support the command requested. +. + +MessageId=120 +Severity=Success +Facility=System +SymbolicName=ERROR_CALL_NOT_IMPLEMENTED +Language=Bulgarian +ERROR_CALL_NOT_IMPLEMENTED - Эта функция не поддерживается в данной системе. +. + +MessageId=121 +Severity=Success +Facility=System +SymbolicName=ERROR_SEM_TIMEOUT +Language=Bulgarian +ERROR_SEM_TIMEOUT - The semaphore timeout period has expired. +. + +MessageId=122 +Severity=Success +Facility=System +SymbolicName=ERROR_INSUFFICIENT_BUFFER +Language=Bulgarian +ERROR_INSUFFICIENT_BUFFER - The data area passed to a system call is too small. +. + +MessageId=123 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_NAME +Language=Bulgarian +ERROR_INVALID_NAME - Имя файла, директории или метки диска имеют неверный синтаксис. +. + +MessageId=124 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_LEVEL +Language=Bulgarian +ERROR_INVALID_LEVEL - The system call level is not correct. +. + +MessageId=125 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_VOLUME_LABEL +Language=Bulgarian +ERROR_NO_VOLUME_LABEL - Диск не имеет метки тома. +. + +MessageId=126 +Severity=Success +Facility=System +SymbolicName=ERROR_MOD_NOT_FOUND +Language=Bulgarian +ERROR_MOD_NOT_FOUND - Указанный модуль не найден. +. + +MessageId=127 +Severity=Success +Facility=System +SymbolicName=ERROR_PROC_NOT_FOUND +Language=Bulgarian +ERROR_PROC_NOT_FOUND - Указанная процедура не найдена. +. + +MessageId=128 +Severity=Success +Facility=System +SymbolicName=ERROR_WAIT_NO_CHILDREN +Language=Bulgarian +ERROR_WAIT_NO_CHILDREN - There are no child processes to wait for. +. + +MessageId=129 +Severity=Success +Facility=System +SymbolicName=ERROR_CHILD_NOT_COMPLETE +Language=Bulgarian +ERROR_CHILD_NOT_COMPLETE - Приложение %1 не может быть запущено в режиме Win32. +. + +MessageId=130 +Severity=Success +Facility=System +SymbolicName=ERROR_DIRECT_ACCESS_HANDLE +Language=Bulgarian +ERROR_DIRECT_ACCESS_HANDLE - Attempt to use a file handle to an open disk partition for an operation other than raw disk I/O. +. + +MessageId=131 +Severity=Success +Facility=System +SymbolicName=ERROR_NEGATIVE_SEEK +Language=Bulgarian +ERROR_NEGATIVE_SEEK - An attempt was made to move the file pointer before the beginning of the file. +. + +MessageId=132 +Severity=Success +Facility=System +SymbolicName=ERROR_SEEK_ON_DEVICE +Language=Bulgarian +ERROR_SEEK_ON_DEVICE - The file pointer cannot be set on the specified device or file. +. + +MessageId=133 +Severity=Success +Facility=System +SymbolicName=ERROR_IS_JOIN_TARGET +Language=Bulgarian +ERROR_IS_JOIN_TARGET - A JOIN or SUBST command cannot be used for a drive that contains previously joined drives. +. + +MessageId=134 +Severity=Success +Facility=System +SymbolicName=ERROR_IS_JOINED +Language=Bulgarian +ERROR_IS_JOINED - An attempt was made to use a JOIN or SUBST command on a drive that has already been joined. +. + +MessageId=135 +Severity=Success +Facility=System +SymbolicName=ERROR_IS_SUBSTED +Language=Bulgarian +ERROR_IS_SUBSTED - An attempt was made to use a JOIN or SUBST command on a drive that has already been substituted. +. + +MessageId=136 +Severity=Success +Facility=System +SymbolicName=ERROR_NOT_JOINED +Language=Bulgarian +ERROR_NOT_JOINED - The system tried to delete the JOIN of a drive that is not joined. +. + +MessageId=137 +Severity=Success +Facility=System +SymbolicName=ERROR_NOT_SUBSTED +Language=Bulgarian +ERROR_NOT_SUBSTED - The system tried to delete the substitution of a drive that is not substituted. +. + +MessageId=138 +Severity=Success +Facility=System +SymbolicName=ERROR_JOIN_TO_JOIN +Language=Bulgarian +ERROR_JOIN_TO_JOIN - The system tried to join a drive to a directory on a joined drive. +. + +MessageId=139 +Severity=Success +Facility=System +SymbolicName=ERROR_SUBST_TO_SUBST +Language=Bulgarian +ERROR_SUBST_TO_SUBST - The system tried to substitute a drive to a directory on a substituted drive. +. + +MessageId=140 +Severity=Success +Facility=System +SymbolicName=ERROR_JOIN_TO_SUBST +Language=Bulgarian +ERROR_JOIN_TO_SUBST - The system tried to join a drive to a directory on a substituted drive. +. + +MessageId=141 +Severity=Success +Facility=System +SymbolicName=ERROR_SUBST_TO_JOIN +Language=Bulgarian +ERROR_SUBST_TO_JOIN - The system tried to SUBST a drive to a directory on a joined drive. +. + +MessageId=142 +Severity=Success +Facility=System +SymbolicName=ERROR_BUSY_DRIVE +Language=Bulgarian +ERROR_BUSY_DRIVE - The system cannot perform a JOIN or SUBST at this time. +. + +MessageId=143 +Severity=Success +Facility=System +SymbolicName=ERROR_SAME_DRIVE +Language=Bulgarian +ERROR_SAME_DRIVE - The system cannot join or substitute a drive to or for a directory on the same drive. +. + +MessageId=144 +Severity=Success +Facility=System +SymbolicName=ERROR_DIR_NOT_ROOT +Language=Bulgarian +ERROR_DIR_NOT_ROOT - The directory is not a subdirectory of the root directory. +. + +MessageId=145 +Severity=Success +Facility=System +SymbolicName=ERROR_DIR_NOT_EMPTY +Language=Bulgarian +ERROR_DIR_NOT_EMPTY - Директория не пустая. +. + +MessageId=146 +Severity=Success +Facility=System +SymbolicName=ERROR_IS_SUBST_PATH +Language=Bulgarian +ERROR_IS_SUBST_PATH - The path specified is being used in a substitute. +. + +MessageId=147 +Severity=Success +Facility=System +SymbolicName=ERROR_IS_JOIN_PATH +Language=Bulgarian +ERROR_IS_JOIN_PATH - Not enough resources are available to process this command. +. + +MessageId=148 +Severity=Success +Facility=System +SymbolicName=ERROR_PATH_BUSY +Language=Bulgarian +ERROR_PATH_BUSY - Указанный путь не может быть использован в данное время. +. + +MessageId=149 +Severity=Success +Facility=System +SymbolicName=ERROR_IS_SUBST_TARGET +Language=Bulgarian +ERROR_IS_SUBST_TARGET - An attempt was made to join or substitute a drive for which a directory on the drive is the target of a previous substitute. +. + +MessageId=150 +Severity=Success +Facility=System +SymbolicName=ERROR_SYSTEM_TRACE +Language=Bulgarian +ERROR_SYSTEM_TRACE - System trace information was not specified in your CONFIG.SYS file, or tracing is disallowed. +. + +MessageId=151 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_EVENT_COUNT +Language=Bulgarian +ERROR_INVALID_EVENT_COUNT - The number of specified semaphore events for DosMuxSemWait is not correct. +. + +MessageId=152 +Severity=Success +Facility=System +SymbolicName=ERROR_TOO_MANY_MUXWAITERS +Language=Bulgarian +ERROR_TOO_MANY_MUXWAITERS - DosMuxSemWait did not execute; too many semaphores are already set. +. + +MessageId=153 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_LIST_FORMAT +Language=Bulgarian +ERROR_INVALID_LIST_FORMAT - The DosMuxSemWait list is not correct. +. + +MessageId=154 +Severity=Success +Facility=System +SymbolicName=ERROR_LABEL_TOO_LONG +Language=Bulgarian +ERROR_LABEL_TOO_LONG - The volume label you entered exceeds the label character limit of the target file system. +. + +MessageId=155 +Severity=Success +Facility=System +SymbolicName=ERROR_TOO_MANY_TCBS +Language=Bulgarian +ERROR_TOO_MANY_TCBS - Невозможно создать другой поток. +. + +MessageId=156 +Severity=Success +Facility=System +SymbolicName=ERROR_SIGNAL_REFUSED +Language=Bulgarian +ERROR_SIGNAL_REFUSED - The recipient process has refused the signal. +. + +MessageId=157 +Severity=Success +Facility=System +SymbolicName=ERROR_DISCARDED +Language=Bulgarian +ERROR_DISCARDED - The segment is already discarded and cannot be locked. +. + +MessageId=158 +Severity=Success +Facility=System +SymbolicName=ERROR_NOT_LOCKED +Language=Bulgarian +ERROR_NOT_LOCKED - The segment is already unlocked. +. + +MessageId=159 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_THREADID_ADDR +Language=Bulgarian +ERROR_BAD_THREADID_ADDR - The address for the thread ID is not correct. +. + +MessageId=160 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_ARGUMENTS +Language=Bulgarian +ERROR_BAD_ARGUMENTS - The argument string passed to DosExecPgm is not correct. +. + +MessageId=161 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_PATHNAME +Language=Bulgarian +ERROR_BAD_PATHNAME - Указанный путь неверный. +. + +MessageId=162 +Severity=Success +Facility=System +SymbolicName=ERROR_SIGNAL_PENDING +Language=Bulgarian +ERROR_SIGNAL_PENDING - A signal is already pending. +. + +MessageId=164 +Severity=Success +Facility=System +SymbolicName=ERROR_MAX_THRDS_REACHED +Language=Bulgarian +ERROR_MAX_THRDS_REACHED - No more threads can be created in the system. +. + +MessageId=167 +Severity=Success +Facility=System +SymbolicName=ERROR_LOCK_FAILED +Language=Bulgarian +ERROR_LOCK_FAILED - Unable to lock a region of a file. +. + +MessageId=170 +Severity=Success +Facility=System +SymbolicName=ERROR_BUSY +Language=Bulgarian +ERROR_BUSY - Требуемый ресурс уже используется. +. + +MessageId=173 +Severity=Success +Facility=System +SymbolicName=ERROR_CANCEL_VIOLATION +Language=Bulgarian +ERROR_CANCEL_VIOLATION - A lock request was not outstanding for the supplied cancel region. +. + +MessageId=174 +Severity=Success +Facility=System +SymbolicName=ERROR_ATOMIC_LOCKS_NOT_SUPPORTED +Language=Bulgarian +ERROR_ATOMIC_LOCKS_NOT_SUPPORTED - The file system does not support atomic changes to the lock type. +. + +MessageId=180 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_SEGMENT_NUMBER +Language=Bulgarian +ERROR_INVALID_SEGMENT_NUMBER - The system detected a segment number that was not correct. +. + +MessageId=182 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_ORDINAL +Language=Bulgarian +ERROR_INVALID_ORDINAL - Операционная система не может запустить %1. +. + +MessageId=183 +Severity=Success +Facility=System +SymbolicName=ERROR_ALREADY_EXISTS +Language=Bulgarian +ERROR_ALREADY_EXISTS - Cannot create a file when that file already exists. +. + +MessageId=186 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_FLAG_NUMBER +Language=Bulgarian +ERROR_INVALID_FLAG_NUMBER - The flag passed is not correct. +. + +MessageId=187 +Severity=Success +Facility=System +SymbolicName=ERROR_SEM_NOT_FOUND +Language=Bulgarian +ERROR_SEM_NOT_FOUND - The specified system semaphore name was not found. +. + +MessageId=188 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_STARTING_CODESEG +Language=Bulgarian +ERROR_INVALID_STARTING_CODESEG - Операционная система не может запустить %1. +. + +MessageId=189 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_STACKSEG +Language=Bulgarian +ERROR_INVALID_STACKSEG - Операционная система не может запустить %1. +. + +MessageId=190 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_MODULETYPE +Language=Bulgarian +ERROR_INVALID_MODULETYPE - Операционная система не может запустить %1. +. + +MessageId=191 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_EXE_SIGNATURE +Language=Bulgarian +ERROR_INVALID_EXE_SIGNATURE - Невозможно запустить %1 в режиме Win32. +. + +MessageId=192 +Severity=Success +Facility=System +SymbolicName=ERROR_EXE_MARKED_INVALID +Language=Bulgarian +ERROR_EXE_MARKED_INVALID - Операционная система не может запустить %1. +. + +MessageId=193 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_EXE_FORMAT +Language=Bulgarian +ERROR_BAD_EXE_FORMAT - %1 некорретное Win32 приложение. +. + +MessageId=194 +Severity=Success +Facility=System +SymbolicName=ERROR_ITERATED_DATA_EXCEEDS_64k +Language=Bulgarian +ERROR_ITERATED_DATA_EXCEEDS_64k - Операционная система не может запустить %1. +. + +MessageId=195 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_MINALLOCSIZE +Language=Bulgarian +ERROR_INVALID_MINALLOCSIZE - Операционная система не может запустить %1. +. + +MessageId=196 +Severity=Success +Facility=System +SymbolicName=ERROR_DYNLINK_FROM_INVALID_RING +Language=Bulgarian +ERROR_DYNLINK_FROM_INVALID_RING - The operating system cannot run this application program. +. + +MessageId=197 +Severity=Success +Facility=System +SymbolicName=ERROR_IOPL_NOT_ENABLED +Language=Bulgarian +ERROR_IOPL_NOT_ENABLED - The operating system is not presently configured to run this application. +. + +MessageId=198 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_SEGDPL +Language=Bulgarian +ERROR_INVALID_SEGDPL - Операционная система не может запустить %1. +. + +MessageId=199 +Severity=Success +Facility=System +SymbolicName=ERROR_AUTODATASEG_EXCEEDS_64k +Language=Bulgarian +ERROR_AUTODATASEG_EXCEEDS_64k - The operating system cannot run this application program. +. + +MessageId=200 +Severity=Success +Facility=System +SymbolicName=ERROR_RING2SEG_MUST_BE_MOVABLE +Language=Bulgarian +ERROR_RING2SEG_MUST_BE_MOVABLE - The code segment cannot be greater than or equal to 64K. +. + +MessageId=201 +Severity=Success +Facility=System +SymbolicName=ERROR_RELOC_CHAIN_XEEDS_SEGLIM +Language=Bulgarian +ERROR_RELOC_CHAIN_XEEDS_SEGLIM - Операционная система не может запустить %1. +. + +MessageId=202 +Severity=Success +Facility=System +SymbolicName=ERROR_INFLOOP_IN_RELOC_CHAIN +Language=Bulgarian +ERROR_INFLOOP_IN_RELOC_CHAIN - Операционная система не может запустить %1. +. + +MessageId=203 +Severity=Success +Facility=System +SymbolicName=ERROR_ENVVAR_NOT_FOUND +Language=Bulgarian +ERROR_ENVVAR_NOT_FOUND - The system could not find the environment option that was entered. +. + +MessageId=205 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_SIGNAL_SENT +Language=Bulgarian +ERROR_NO_SIGNAL_SENT - No process in the command subtree has a signal handler. +. + +MessageId=206 +Severity=Success +Facility=System +SymbolicName=ERROR_FILENAME_EXCED_RANGE +Language=Bulgarian +ERROR_FILENAME_EXCED_RANGE - Имя файла или расширение слишком длинные. +. + +MessageId=207 +Severity=Success +Facility=System +SymbolicName=ERROR_RING2_STACK_IN_USE +Language=Bulgarian +ERROR_RING2_STACK_IN_USE - The ring 2 stack is in use. +. + +MessageId=208 +Severity=Success +Facility=System +SymbolicName=ERROR_META_EXPANSION_TOO_LONG +Language=Bulgarian +ERROR_META_EXPANSION_TOO_LONG - The global filename characters, * or ?, are entered incorrectly or too many global filename characters are specified. +. + +MessageId=209 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_SIGNAL_NUMBER +Language=Bulgarian +ERROR_INVALID_SIGNAL_NUMBER - The signal being posted is not correct. +. + +MessageId=210 +Severity=Success +Facility=System +SymbolicName=ERROR_THREAD_1_INACTIVE +Language=Bulgarian +ERROR_THREAD_1_INACTIVE - The signal handler cannot be set. +. + +MessageId=212 +Severity=Success +Facility=System +SymbolicName=ERROR_LOCKED +Language=Bulgarian +ERROR_LOCKED - The segment is locked and cannot be reallocated. +. + +MessageId=214 +Severity=Success +Facility=System +SymbolicName=ERROR_TOO_MANY_MODULES +Language=Bulgarian +ERROR_TOO_MANY_MODULES - Too many dynamic-link modules are attached to this program or dynamic-link module. +. + +MessageId=215 +Severity=Success +Facility=System +SymbolicName=ERROR_NESTING_NOT_ALLOWED +Language=Bulgarian +ERROR_NESTING_NOT_ALLOWED - Cannot nest calls to LoadModule. +. + +MessageId=216 +Severity=Success +Facility=System +SymbolicName=ERROR_EXE_MACHINE_TYPE_MISMATCH +Language=Bulgarian +ERROR_EXE_MACHINE_TYPE_MISMATCH - The image file %1 is valid, but is for a machine type other than the current machine. +. + +MessageId=217 +Severity=Success +Facility=System +SymbolicName=ERROR_EXE_CANNOT_MODIFY_SIGNED_BINARY +Language=Bulgarian +ERROR_EXE_CANNOT_MODIFY_SIGNED_BINARY - The image file %1 is signed, unable to modify. +. + +MessageId=218 +Severity=Success +Facility=System +SymbolicName=ERRO_EXE_CANNOT_MODIFY_STRONG_SIGNED_BINARY +Language=Bulgarian +ERRO_EXE_CANNOT_MODIFY_STRONG_SIGNED_BINARY - The image file %1 is strong signed, unable to modify. +. + +MessageId=230 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_PIPE +Language=Bulgarian +ERROR_BAD_PIPE - The pipe state is invalid. +. + +MessageId=231 +Severity=Success +Facility=System +SymbolicName=ERROR_PIPE_BUSY +Language=Bulgarian +ERROR_PIPE_BUSY - All pipe instances are busy. +. + +MessageId=232 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_DATA +Language=Bulgarian +ERROR_NO_DATA - The pipe is being closed. +. + +MessageId=233 +Severity=Success +Facility=System +SymbolicName=ERROR_PIPE_NOT_CONNECTED +Language=Bulgarian +ERROR_PIPE_NOT_CONNECTED - No process is on the other end of the pipe. +. + +MessageId=234 +Severity=Success +Facility=System +SymbolicName=ERROR_MORE_DATA +Language=Bulgarian +ERROR_MORE_DATA - Другие данные недоступны. +. + +MessageId=240 +Severity=Success +Facility=System +SymbolicName=ERROR_VC_DISCONNECTED +Language=Bulgarian +ERROR_VC_DISCONNECTED - Сессия была отменена. +. + +MessageId=254 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_EA_NAME +Language=Bulgarian +ERROR_INVALID_EA_NAME - The specified extended attribute name was invalid. +. + +MessageId=255 +Severity=Success +Facility=System +SymbolicName=ERROR_EA_LIST_INCONSISTENT +Language=Bulgarian +ERROR_EA_LIST_INCONSISTENT - Расширенные атрибуты протеворечивы. +. + +MessageId=258 +Severity=Success +Facility=System +SymbolicName=WAIT_TIMEOUT +Language=Bulgarian +WAIT_TIMEOUT - The wait operation timed out. +. + +MessageId=259 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_MORE_ITEMS +Language=Bulgarian +ERROR_NO_MORE_ITEMS - No more data is available. +. + +MessageId=266 +Severity=Success +Facility=System +SymbolicName=ERROR_CANNOT_COPY +Language=Bulgarian +ERROR_CANNOT_COPY - Функция копирования не может быть использована. +. + +MessageId=267 +Severity=Success +Facility=System +SymbolicName=ERROR_DIRECTORY +Language=Bulgarian +ERROR_DIRECTORY - Неверное имя директории. +. + +MessageId=275 +Severity=Success +Facility=System +SymbolicName=ERROR_EAS_DIDNT_FIT +Language=Bulgarian +ERROR_EAS_DIDNT_FIT - The extended attributes did not fit in the buffer. +. + +MessageId=276 +Severity=Success +Facility=System +SymbolicName=ERROR_EA_FILE_CORRUPT +Language=Bulgarian +ERROR_EA_FILE_CORRUPT - The extended attribute file on the mounted file system is corrupt. +. + +MessageId=277 +Severity=Success +Facility=System +SymbolicName=ERROR_EA_TABLE_FULL +Language=Bulgarian +ERROR_EA_TABLE_FULL - The extended attribute table file is full. +. + +MessageId=278 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_EA_HANDLE +Language=Bulgarian +ERROR_INVALID_EA_HANDLE - The specified extended attribute handle is invalid. +. + +MessageId=282 +Severity=Success +Facility=System +SymbolicName=ERROR_EAS_NOT_SUPPORTED +Language=Bulgarian +ERROR_EAS_NOT_SUPPORTED - Смонтированная файловая система не поддерживает расширенные атрибуты. +. + +MessageId=288 +Severity=Success +Facility=System +SymbolicName=ERROR_NOT_OWNER +Language=Bulgarian +ERROR_NOT_OWNER - Attempt to release mutex not owned by caller. +. + +MessageId=298 +Severity=Success +Facility=System +SymbolicName=ERROR_TOO_MANY_POSTS +Language=Bulgarian +ERROR_TOO_MANY_POSTS - Too many posts were made to a semaphore. +. + +MessageId=299 +Severity=Success +Facility=System +SymbolicName=ERROR_PARTIAL_COPY +Language=Bulgarian +ERROR_PARTIAL_COPY - Only part of a ReadProcessMemory or WriteProcessMemory request was completed. +. + +MessageId=300 +Severity=Success +Facility=System +SymbolicName=ERROR_OPLOCK_NOT_GRANTED +Language=Bulgarian +ERROR_OPLOCK_NOT_GRANTED - The oplock request is denied. +. + +MessageId=301 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_OPLOCK_PROTOCOL +Language=Bulgarian +ERROR_INVALID_OPLOCK_PROTOCOL - An invalid oplock acknowledgment was received by the system. +. + +MessageId=302 +Severity=Success +Facility=System +SymbolicName=ERROR_DISK_TOO_FRAGMENTED +Language=Bulgarian +ERROR_DISK_TOO_FRAGMENTED - The volume is too fragmented to complete this operation. +. + +MessageId=303 +Severity=Success +Facility=System +SymbolicName=ERROR_DELETE_PENDING +Language=Bulgarian +ERROR_DELETE_PENDING - The file cannot be opened because it is in the process of being deleted. +. + +MessageId=317 +Severity=Success +Facility=System +SymbolicName=ERROR_MR_MID_NOT_FOUND +Language=Bulgarian +ERROR_MR_MID_NOT_FOUND - The system cannot find message text for message number 0x%1 in the message file for %2. +. + +MessageId=318 +Severity=Success +Facility=System +SymbolicName=ERROR_SCOPE_NOT_FOUND +Language=Bulgarian +ERROR_SCOPE_NOT_FOUND - The scope specified was not found. +. + +MessageId=487 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_ADDRESS +Language=Bulgarian +ERROR_INVALID_ADDRESS - Attempt to access invalid address. +. + +MessageId=534 +Severity=Success +Facility=System +SymbolicName=ERROR_ARITHMETIC_OVERFLOW +Language=Bulgarian +ERROR_ARITHMETIC_OVERFLOW - Arithmetic result exceeded 32 bits. +. + +MessageId=535 +Severity=Success +Facility=System +SymbolicName=ERROR_PIPE_CONNECTED +Language=Bulgarian +ERROR_PIPE_CONNECTED - There is a process on other end of the pipe. +. + +MessageId=536 +Severity=Success +Facility=System +SymbolicName=ERROR_PIPE_LISTENING +Language=Bulgarian +ERROR_PIPE_LISTENING - Waiting for a process to open the other end of the pipe. +. + +MessageId=537 +Severity=Success +Facility=System +SymbolicName=ERROR_ACPI_ERROR +Language=Bulgarian +ERROR_ACPI_ERROR - Произошла ошибка в подсистеме ACPI. +. + +MessageId=538 +Severity=Success +Facility=System +SymbolicName=ERROR_ABIOS_ERROR +Language=Bulgarian +ERROR_ABIOS_ERROR - Произошла ошибка в подсистеме ABIOS. +. + +MessageId=539 +Severity=Success +Facility=System +SymbolicName=ERROR_WX86_WARNING +Language=Bulgarian +ERROR_WX86_WARNING - A warning occurred in the WX86 subsystem. +. + +MessageId=540 +Severity=Success +Facility=System +SymbolicName=ERROR_WX86_ERROR +Language=Bulgarian +ERROR_WX86_ERROR - Произошла ошибка в подсистеме WX86. +. + +MessageId=541 +Severity=Success +Facility=System +SymbolicName=ERROR_TIMER_NOT_CANCELED +Language=Bulgarian +ERROR_TIMER_NOT_CANCELED - An attempt was made to cancel or set a timer that has an associated APC and the subject thread is not the thread that originally set the timer with an associated APC routine. +. + +MessageId=542 +Severity=Success +Facility=System +SymbolicName=ERROR_UNWIND +Language=Bulgarian +ERROR_UNWIND - Unwind exception code. +. + +MessageId=543 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_STACK +Language=Bulgarian +ERROR_BAD_STACK - An invalid or unaligned stack was encountered during an unwind operation. +. + +MessageId=544 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_UNWIND_TARGET +Language=Bulgarian +ERROR_INVALID_UNWIND_TARGET - An invalid unwind target was encountered during an unwind operation. +. + +MessageId=545 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_PORT_ATTRIBUTES +Language=Bulgarian +ERROR_INVALID_PORT_ATTRIBUTES - Invalid Object Attributes specified to NtCreatePort or invalid Port Attributes specified to NtConnectPort +. + +MessageId=546 +Severity=Success +Facility=System +SymbolicName=ERROR_PORT_MESSAGE_TOO_LONG +Language=Bulgarian +ERROR_PORT_MESSAGE_TOO_LONG - Length of message passed to NtRequestPort or NtRequestWaitReplyPort was longer than the maximum message allowed by the port. +. + +MessageId=547 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_QUOTA_LOWER +Language=Bulgarian +ERROR_INVALID_QUOTA_LOWER - An attempt was made to lower a quota limit below the current usage. +. + +MessageId=548 +Severity=Success +Facility=System +SymbolicName=ERROR_DEVICE_ALREADY_ATTACHED +Language=Bulgarian +ERROR_DEVICE_ALREADY_ATTACHED - An attempt was made to attach to a device that was already attached to another device. +. + +MessageId=549 +Severity=Success +Facility=System +SymbolicName=ERROR_INSTRUCTION_MISALIGNMENT +Language=Bulgarian +ERROR_INSTRUCTION_MISALIGNMENT - An attempt was made to execute an instruction at an unaligned address and the host system does not support unaligned instruction references. +. + +MessageId=550 +Severity=Success +Facility=System +SymbolicName=ERROR_PROFILING_NOT_STARTED +Language=Bulgarian +ERROR_PROFILING_NOT_STARTED - Profiling not started. +. + +MessageId=551 +Severity=Success +Facility=System +SymbolicName=ERROR_PROFILING_NOT_STOPPED +Language=Bulgarian +ERROR_PROFILING_NOT_STOPPED - Profiling not stopped. +. + +MessageId=552 +Severity=Success +Facility=System +SymbolicName=ERROR_COULD_NOT_INTERPRET +Language=Bulgarian +ERROR_COULD_NOT_INTERPRET - The passed ACL did not contain the minimum required information. +. + +MessageId=553 +Severity=Success +Facility=System +SymbolicName=ERROR_PROFILING_AT_LIMIT +Language=Bulgarian +ERROR_PROFILING_AT_LIMIT - The number of active profiling objects is at the maximum and no more may be started. +. + +MessageId=554 +Severity=Success +Facility=System +SymbolicName=ERROR_CANT_WAIT +Language=Bulgarian +ERROR_CANT_WAIT - Used to indicate that an operation cannot continue without blocking for I/O. +. + +MessageId=555 +Severity=Success +Facility=System +SymbolicName=ERROR_CANT_TERMINATE_SELF +Language=Bulgarian +ERROR_CANT_TERMINATE_SELF - Indicates that a thread attempted to terminate itself by default (called NtTerminateThread with NULL) and it was the last thread in the current process. +. + +MessageId=556 +Severity=Success +Facility=System +SymbolicName=ERROR_UNEXPECTED_MM_CREATE_ERR +Language=Bulgarian +ERROR_UNEXPECTED_MM_CREATE_ERR - If an MM error is returned which is not defined in the standard FsRtl filter, it is converted to one of the following errors which is guaranteed to be in the filter. In this case information is lost, however, the filter correctly handles the exception. +. + +MessageId=557 +Severity=Success +Facility=System +SymbolicName=ERROR_UNEXPECTED_MM_MAP_ERROR +Language=Bulgarian +ERROR_UNEXPECTED_MM_MAP_ERROR - If an MM error is returned which is not defined in the standard FsRtl filter, it is converted to one of the following errors which is guaranteed to be in the filter. In this case information is lost, however, the filter correctly handles the exception. +. + +MessageId=558 +Severity=Success +Facility=System +SymbolicName=ERROR_UNEXPECTED_MM_EXTEND_ERR +Language=Bulgarian +ERROR_UNEXPECTED_MM_EXTEND_ERR - If an MM error is returned which is not defined in the standard FsRtl filter, it is converted to one of the following errors which is guaranteed to be in the filter. In this case information is lost, however, the filter correctly handles the exception. +. + +MessageId=559 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_FUNCTION_TABLE +Language=Bulgarian +ERROR_BAD_FUNCTION_TABLE - A malformed function table was encountered during an unwind operation. +. + +MessageId=560 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_GUID_TRANSLATION +Language=Bulgarian +ERROR_NO_GUID_TRANSLATION - Indicates that an attempt was made to assign protection to a file system file or directory and one of the SIDs in the security descriptor could not be translated into a GUID that could be stored by the file system. This causes the protection attempt to fail, which may cause a file creation attempt to fail. +. + +MessageId=561 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_LDT_SIZE +Language=Bulgarian +ERROR_INVALID_LDT_SIZE - Indicates that an attempt was made to grow an LDT by setting its size, or that the size was not an even number of selectors. +. + +MessageId=563 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_LDT_OFFSET +Language=Bulgarian +ERROR_INVALID_LDT_OFFSET - Indicates that the starting value for the LDT information was not an integral multiple of the selector size. +. + +MessageId=564 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_LDT_DESCRIPTOR +Language=Bulgarian +ERROR_INVALID_LDT_DESCRIPTOR - Indicates that the user supplied an invalid descriptor when trying to set up Ldt descriptors. +. + +MessageId=565 +Severity=Success +Facility=System +SymbolicName=ERROR_TOO_MANY_THREADS +Language=Bulgarian +ERROR_TOO_MANY_THREADS - Indicates a process has too many threads to perform the requested action. For example, assignment of a primary token may only be performed when a process has zero or one threads. +. + +MessageId=566 +Severity=Success +Facility=System +SymbolicName=ERROR_THREAD_NOT_IN_PROCESS +Language=Bulgarian +ERROR_THREAD_NOT_IN_PROCESS - An attempt was made to operate on a thread within a specific process, but the thread specified is not in the process specified. +. + +MessageId=567 +Severity=Success +Facility=System +SymbolicName=ERROR_PAGEFILE_QUOTA_EXCEEDED +Language=Bulgarian +ERROR_PAGEFILE_QUOTA_EXCEEDED - Page file quota was exceeded. +. + +MessageId=568 +Severity=Success +Facility=System +SymbolicName=ERROR_LOGON_SERVER_CONFLICT +Language=Bulgarian +ERROR_LOGON_SERVER_CONFLICT - The Netlogon service cannot start because another Netlogon service running in the domain conflicts with the specified role. +. + +MessageId=569 +Severity=Success +Facility=System +SymbolicName=ERROR_SYNCHRONIZATION_REQUIRED +Language=Bulgarian +ERROR_SYNCHRONIZATION_REQUIRED - The SAM database on a Windows Server is significantly out of synchronization with the copy on the Domain Controller. A complete synchronization is required. +. + +MessageId=570 +Severity=Success +Facility=System +SymbolicName=ERROR_NET_OPEN_FAILED +Language=Bulgarian +ERROR_NET_OPEN_FAILED - The NtCreateFile API failed. This error should never be returned to an application, it is a place holder for the Windows Lan Manager Redirector to use in its internal error mapping routines. +. + +MessageId=571 +Severity=Success +Facility=System +SymbolicName=ERROR_IO_PRIVILEGE_FAILED +Language=Bulgarian +ERROR_IO_PRIVILEGE_FAILED - The I/O permissions for the process could not be changed. +. + +MessageId=572 +Severity=Success +Facility=System +SymbolicName=ERROR_CONTROL_C_EXIT +Language=Bulgarian +ERROR_CONTROL_C_EXIT - The application terminated as a result of a CTRL+C. +. + +MessageId=573 +Severity=Success +Facility=System +SymbolicName=ERROR_MISSING_SYSTEMFILE +Language=Bulgarian +ERROR_MISSING_SYSTEMFILE - The required system file %hs is bad or missing. +. + +MessageId=574 +Severity=Success +Facility=System +SymbolicName=ERROR_UNHANDLED_EXCEPTION +Language=Bulgarian +ERROR_UNHANDLED_EXCEPTION - The exception %s (0x%08lx) occurred in the application at location 0x%08lx. +. + +MessageId=575 +Severity=Success +Facility=System +SymbolicName=ERROR_APP_INIT_FAILURE +Language=Bulgarian +ERROR_APP_INIT_FAILURE - The application failed to initialize properly (0x%lx). Click on OK to terminate the application. +. + +MessageId=576 +Severity=Success +Facility=System +SymbolicName=ERROR_PAGEFILE_CREATE_FAILED +Language=Bulgarian +ERROR_PAGEFILE_CREATE_FAILED - The creation of the paging file %hs failed (%lx). The requested size was %ld. +. + +MessageId=578 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_PAGEFILE +Language=Bulgarian +ERROR_NO_PAGEFILE - No paging file was specified in the system configuration. +. + +MessageId=579 +Severity=Success +Facility=System +SymbolicName=ERROR_ILLEGAL_FLOAT_CONTEXT +Language=Bulgarian +ERROR_ILLEGAL_FLOAT_CONTEXT - A real-mode application issued a floating-point instruction and floating-point hardware is not present. +. + +MessageId=580 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_EVENT_PAIR +Language=Bulgarian +ERROR_NO_EVENT_PAIR - An event pair synchronization operation was performed using the thread specific client/server event pair object, but no event pair object was associated with the thread. +. + +MessageId=581 +Severity=Success +Facility=System +SymbolicName=ERROR_DOMAIN_CTRLR_CONFIG_ERROR +Language=Bulgarian +ERROR_DOMAIN_CTRLR_CONFIG_ERROR - A Windows Server has an incorrect configuration. +. + +MessageId=582 +Severity=Success +Facility=System +SymbolicName=ERROR_ILLEGAL_CHARACTER +Language=Bulgarian +ERROR_ILLEGAL_CHARACTER - An illegal character was encountered. For a multi-byte character set this includes a lead byte without a succeeding trail byte. For the Unicode character set this includes the characters 0xFFFF and 0xFFFE. +. + +MessageId=583 +Severity=Success +Facility=System +SymbolicName=ERROR_UNDEFINED_CHARACTER +Language=Bulgarian +ERROR_UNDEFINED_CHARACTER - The Unicode character is not defined in the Unicode character set installed on the system. +. + +MessageId=584 +Severity=Success +Facility=System +SymbolicName=ERROR_FLOPPY_VOLUME +Language=Bulgarian +ERROR_FLOPPY_VOLUME - The paging file cannot be created on a floppy diskette. +. + +MessageId=585 +Severity=Success +Facility=System +SymbolicName=ERROR_BIOS_FAILED_TO_CONNECT_INTERRUPT +Language=Bulgarian +ERROR_BIOS_FAILED_TO_CONNECT_INTERRUPT - The system bios failed to connect a system interrupt to the device or bus for which the device is connected. +. + +MessageId=586 +Severity=Success +Facility=System +SymbolicName=ERROR_BACKUP_CONTROLLER +Language=Bulgarian +ERROR_BACKUP_CONTROLLER - This operation is only allowed for the Primary Domain Controller of the domain. +. + +MessageId=587 +Severity=Success +Facility=System +SymbolicName=ERROR_MUTANT_LIMIT_EXCEEDED +Language=Bulgarian +ERROR_MUTANT_LIMIT_EXCEEDED - An attempt was made to acquire a mutant such that its maximum count would have been exceeded. +. + +MessageId=588 +Severity=Success +Facility=System +SymbolicName=ERROR_FS_DRIVER_REQUIRED +Language=Bulgarian +ERROR_FS_DRIVER_REQUIRED - A volume has been accessed for which a file system driver is required that has not yet been loaded. +. + +MessageId=589 +Severity=Success +Facility=System +SymbolicName=ERROR_CANNOT_LOAD_REGISTRY_FILE +Language=Bulgarian +ERROR_CANNOT_LOAD_REGISTRY_FILE - The registry cannot load the hive (file): %hs or its log or alternate. It is corrupt, absent, or not writable. +. + +MessageId=590 +Severity=Success +Facility=System +SymbolicName=ERROR_DEBUG_ATTACH_FAILED +Language=Bulgarian +ERROR_DEBUG_ATTACH_FAILED - An unexpected failure occurred while processing a DebugActiveProcess API request. You may choose OK to terminate the process, or Cancel to ignore the error. +. + +MessageId=591 +Severity=Success +Facility=System +SymbolicName=ERROR_SYSTEM_PROCESS_TERMINATED +Language=Bulgarian +ERROR_SYSTEM_PROCESS_TERMINATED - The %hs system process terminated unexpectedly with a status of 0x%08x (0x%08x 0x%08x). The system has been shut down. +. + +MessageId=592 +Severity=Success +Facility=System +SymbolicName=ERROR_DATA_NOT_ACCEPTED +Language=Bulgarian +ERROR_DATA_NOT_ACCEPTED - The TDI client could not handle the data received during an indication. +. + +MessageId=593 +Severity=Success +Facility=System +SymbolicName=ERROR_VDM_HARD_ERROR +Language=Bulgarian +ERROR_VDM_HARD_ERROR - NTVDM encountered a hard error. +. + +MessageId=594 +Severity=Success +Facility=System +SymbolicName=ERROR_DRIVER_CANCEL_TIMEOUT +Language=Bulgarian +ERROR_DRIVER_CANCEL_TIMEOUT - The driver %hs failed to complete a cancelled I/O request in the allotted time. +. + +MessageId=595 +Severity=Success +Facility=System +SymbolicName=ERROR_REPLY_MESSAGE_MISMATCH +Language=Bulgarian +ERROR_REPLY_MESSAGE_MISMATCH - An attempt was made to reply to an LPC message, but the thread specified by the client ID in the message was not waiting on that message. +. + +MessageId=596 +Severity=Success +Facility=System +SymbolicName=ERROR_LOST_WRITEBEHIND_DATA +Language=Bulgarian +ERROR_LOST_WRITEBEHIND_DATA - Windows was unable to save all the data for the file %hs. The data has been lost. This error may be caused by a failure of your computer hardware or network connection. Please try to save this file elsewhere. +. + +MessageId=597 +Severity=Success +Facility=System +SymbolicName=ERROR_CLIENT_SERVER_PARAMETERS_INVALID +Language=Bulgarian +ERROR_CLIENT_SERVER_PARAMETERS_INVALID - The parameter(s) passed to the server in the client/server shared memory window were invalid. Too much data may have been put in the shared memory window. +. + +MessageId=598 +Severity=Success +Facility=System +SymbolicName=ERROR_NOT_TINY_STREAM +Language=Bulgarian +ERROR_NOT_TINY_STREAM - The stream is not a tiny stream. +. + +MessageId=599 +Severity=Success +Facility=System +SymbolicName=ERROR_STACK_OVERFLOW_READ +Language=Bulgarian +ERROR_STACK_OVERFLOW_READ - The request must be handled by the stack overflow code. +. + +MessageId=600 +Severity=Success +Facility=System +SymbolicName=ERROR_CONVERT_TO_LARGE +Language=Bulgarian +ERROR_CONVERT_TO_LARGE - Internal OFS status codes indicating how an allocation operation is handled. Either it is retried after the containing onode is moved or the extent stream is converted to a large stream. +. + +MessageId=601 +Severity=Success +Facility=System +SymbolicName=ERROR_FOUND_OUT_OF_SCOPE +Language=Bulgarian +ERROR_FOUND_OUT_OF_SCOPE - The attempt to find the object found an object matching by ID on the volume but it is out of the scope of the handle used for the operation. +. + +MessageId=602 +Severity=Success +Facility=System +SymbolicName=ERROR_ALLOCATE_BUCKET +Language=Bulgarian +ERROR_ALLOCATE_BUCKET - The bucket array must be grown. Retry transaction after doing so. +. + +MessageId=603 +Severity=Success +Facility=System +SymbolicName=ERROR_MARSHALL_OVERFLOW +Language=Bulgarian +ERROR_MARSHALL_OVERFLOW - The user/kernel marshalling buffer has overflowed. +. + +MessageId=604 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_VARIANT +Language=Bulgarian +ERROR_INVALID_VARIANT - The supplied variant structure contains invalid data. +. + +MessageId=605 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_COMPRESSION_BUFFER +Language=Bulgarian +ERROR_BAD_COMPRESSION_BUFFER - The specified buffer contains ill-formed data. +. + +MessageId=606 +Severity=Success +Facility=System +SymbolicName=ERROR_AUDIT_FAILED +Language=Bulgarian +ERROR_AUDIT_FAILED - An attempt to generate a security audit failed. +. + +MessageId=607 +Severity=Success +Facility=System +SymbolicName=ERROR_TIMER_RESOLUTION_NOT_SET +Language=Bulgarian +ERROR_TIMER_RESOLUTION_NOT_SET - The timer resolution was not previously set by the current process. +. + +MessageId=608 +Severity=Success +Facility=System +SymbolicName=ERROR_INSUFFICIENT_LOGON_INFO +Language=Bulgarian +ERROR_INSUFFICIENT_LOGON_INFO - There is insufficient account information to log you on. +. + +MessageId=609 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_DLL_ENTRYPOINT +Language=Bulgarian +ERROR_BAD_DLL_ENTRYPOINT - The dynamic link library %hs is not written correctly. The stack pointer has been left in an inconsistent state. The entrypoint should be declared as WINAPI or STDCALL. Select YES to fail the DLL load. Select NO to continue execution. Selecting NO may cause the application to operate incorrectly. +. + +MessageId=610 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_SERVICE_ENTRYPOINT +Language=Bulgarian +ERROR_BAD_SERVICE_ENTRYPOINT - The %hs service is not written correctly. The stack pointer has been left in an inconsistent state. The callback entrypoint should be declared as WINAPI or STDCALL. Selecting OK will cause the service to continue operation. However, the service process may operate incorrectly. +. + +MessageId=611 +Severity=Success +Facility=System +SymbolicName=ERROR_IP_ADDRESS_CONFLICT1 +Language=Bulgarian +ERROR_IP_ADDRESS_CONFLICT1 - There is an IP address conflict with another system on the network +. + +MessageId=612 +Severity=Success +Facility=System +SymbolicName=ERROR_IP_ADDRESS_CONFLICT2 +Language=Bulgarian +ERROR_IP_ADDRESS_CONFLICT2 - There is an IP address conflict with another system on the network +. + +MessageId=613 +Severity=Success +Facility=System +SymbolicName=ERROR_REGISTRY_QUOTA_LIMIT +Language=Bulgarian +ERROR_REGISTRY_QUOTA_LIMIT - The system has reached the maximum size allowed for the system part of the registry. Additional storage requests will be ignored. +. + +MessageId=614 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_CALLBACK_ACTIVE +Language=Bulgarian +ERROR_NO_CALLBACK_ACTIVE - A callback return system service cannot be executed when no callback is active. +. + +MessageId=615 +Severity=Success +Facility=System +SymbolicName=ERROR_PWD_TOO_SHORT +Language=Bulgarian +ERROR_PWD_TOO_SHORT - The password provided is too short to meet the policy of your user account. Please choose a longer password. +. + +MessageId=616 +Severity=Success +Facility=System +SymbolicName=ERROR_PWD_TOO_RECENT +Language=Bulgarian +ERROR_PWD_TOO_RECENT - The policy of your user account does not allow you to change passwords too frequently. This is done to prevent users from changing back to a familiar, but potentially discovered, password. If you feel your password has been compromised then please contact your administrator immediately to have a new one assigned. +. + +MessageId=617 +Severity=Success +Facility=System +SymbolicName=ERROR_PWD_HISTORY_CONFLICT +Language=Bulgarian +ERROR_PWD_HISTORY_CONFLICT - You have attempted to change your password to one that you have used in the past. The policy of your user account does not allow this. Please select a password that you have not previously used. +. + +MessageId=618 +Severity=Success +Facility=System +SymbolicName=ERROR_UNSUPPORTED_COMPRESSION +Language=Bulgarian +ERROR_UNSUPPORTED_COMPRESSION - The specified compression format is unsupported. +. + +MessageId=619 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_HW_PROFILE +Language=Bulgarian +ERROR_INVALID_HW_PROFILE - The specified hardware profile configuration is invalid. +. + +MessageId=620 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_PLUGPLAY_DEVICE_PATH +Language=Bulgarian +ERROR_INVALID_PLUGPLAY_DEVICE_PATH - The specified Plug and Play registry device path is invalid. +. + +MessageId=621 +Severity=Success +Facility=System +SymbolicName=ERROR_QUOTA_LIST_INCONSISTENT +Language=Bulgarian +ERROR_QUOTA_LIST_INCONSISTENT - The specified quota list is internally inconsistent with its descriptor. +. + +MessageId=622 +Severity=Success +Facility=System +SymbolicName=ERROR_EVALUATION_EXPIRATION +Language=Bulgarian +ERROR_EVALUATION_EXPIRATION - The evaluation period for this installation of Windows has expired. This system will shutdown in 1 hour. To restore access to this installation of Windows, please upgrade this installation using a licensed distribution of this product. +. + +MessageId=623 +Severity=Success +Facility=System +SymbolicName=ERROR_ILLEGAL_DLL_RELOCATION +Language=Bulgarian +ERROR_ILLEGAL_DLL_RELOCATION - The system DLL %hs was relocated in memory. The application will not run properly. The relocation occurred because the DLL %hs occupied an address range reserved for Windows system DLLs. The vendor supplying the DLL should be contacted for a new DLL. +. + +MessageId=624 +Severity=Success +Facility=System +SymbolicName=ERROR_DLL_INIT_FAILED_LOGOFF +Language=Bulgarian +ERROR_DLL_INIT_FAILED_LOGOFF - The application failed to initialize because the window station is shutting down. +. + +MessageId=625 +Severity=Success +Facility=System +SymbolicName=ERROR_VALIDATE_CONTINUE +Language=Bulgarian +ERROR_VALIDATE_CONTINUE - The validation process needs to continue on to the next step. +. + +MessageId=626 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_MORE_MATCHES +Language=Bulgarian +ERROR_NO_MORE_MATCHES - There are no more matches for the current index enumeration. +. + +MessageId=627 +Severity=Success +Facility=System +SymbolicName=ERROR_RANGE_LIST_CONFLICT +Language=Bulgarian +ERROR_RANGE_LIST_CONFLICT - The range could not be added to the range list because of a conflict. +. + +MessageId=628 +Severity=Success +Facility=System +SymbolicName=ERROR_SERVER_SID_MISMATCH +Language=Bulgarian +ERROR_SERVER_SID_MISMATCH - The server process is running under a SID different than that required by client. +. + +MessageId=629 +Severity=Success +Facility=System +SymbolicName=ERROR_CANT_ENABLE_DENY_ONLY +Language=Bulgarian +ERROR_CANT_ENABLE_DENY_ONLY - A group marked use for deny only cannot be enabled. +. + +MessageId=630 +Severity=Success +Facility=System +SymbolicName=ERROR_FLOAT_MULTIPLE_FAULTS +Language=Bulgarian +ERROR_FLOAT_MULTIPLE_FAULTS - Multiple floating point faults. +. + +MessageId=631 +Severity=Success +Facility=System +SymbolicName=ERROR_FLOAT_MULTIPLE_TRAPS +Language=Bulgarian +ERROR_FLOAT_MULTIPLE_TRAPS - Multiple floating point traps. +. + +MessageId=632 +Severity=Success +Facility=System +SymbolicName=ERROR_NOINTERFACE +Language=Bulgarian +ERROR_NOINTERFACE - The requested interface is not supported. +. + +MessageId=633 +Severity=Success +Facility=System +SymbolicName=ERROR_DRIVER_FAILED_SLEEP +Language=Bulgarian +ERROR_DRIVER_FAILED_SLEEP - The driver %hs does not support standby mode. Updating this driver may allow the system to go to standby mode. +. + +MessageId=634 +Severity=Success +Facility=System +SymbolicName=ERROR_CORRUPT_SYSTEM_FILE +Language=Bulgarian +ERROR_CORRUPT_SYSTEM_FILE - The system file %1 has become corrupt and has been replaced. +. + +MessageId=635 +Severity=Success +Facility=System +SymbolicName=ERROR_COMMITMENT_MINIMUM +Language=Bulgarian +ERROR_COMMITMENT_MINIMUM - Your system is low on virtual memory. Windows is increasing the size of your virtual memory paging file. During this process, memory requests for some applications may be denied. For more information, see Help. +. + +MessageId=636 +Severity=Success +Facility=System +SymbolicName=ERROR_PNP_RESTART_ENUMERATION +Language=Bulgarian +ERROR_PNP_RESTART_ENUMERATION - A device was removed so enumeration must be restarted. +. + +MessageId=637 +Severity=Success +Facility=System +SymbolicName=ERROR_SYSTEM_IMAGE_BAD_SIGNATURE +Language=Bulgarian +ERROR_SYSTEM_IMAGE_BAD_SIGNATURE - The system image %s is not properly signed. The file has been replaced with the signed file. The system has been shut down. +. + +MessageId=638 +Severity=Success +Facility=System +SymbolicName=ERROR_PNP_REBOOT_REQUIRED +Language=Bulgarian +ERROR_PNP_REBOOT_REQUIRED - Device will not start without a reboot. +. + +MessageId=639 +Severity=Success +Facility=System +SymbolicName=ERROR_INSUFFICIENT_POWER +Language=Bulgarian +ERROR_INSUFFICIENT_POWER - There is not enough power to complete the requested operation. +. + +MessageId=641 +Severity=Success +Facility=System +SymbolicName=ERROR_SYSTEM_SHUTDOWN +Language=Bulgarian +ERROR_SYSTEM_SHUTDOWN - The system is in the process of shutting down. +. + +MessageId=642 +Severity=Success +Facility=System +SymbolicName=ERROR_PORT_NOT_SET +Language=Bulgarian +ERROR_PORT_NOT_SET - An attempt to remove a processes DebugPort was made, but a port was not already associated with the process. +. + +MessageId=643 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_VERSION_CHECK_FAILURE +Language=Bulgarian +ERROR_DS_VERSION_CHECK_FAILURE - This version of Windows is not compatible with the behavior version of directory forest, domain or domain controller. +. + +MessageId=644 +Severity=Success +Facility=System +SymbolicName=ERROR_RANGE_NOT_FOUND +Language=Bulgarian +ERROR_RANGE_NOT_FOUND - The specified range could not be found in the range list. +. + +MessageId=646 +Severity=Success +Facility=System +SymbolicName=ERROR_NOT_SAFE_MODE_DRIVER +Language=Bulgarian +ERROR_NOT_SAFE_MODE_DRIVER - The driver was not loaded because the system is booting into safe mode. +. + +MessageId=647 +Severity=Success +Facility=System +SymbolicName=ERROR_FAILED_DRIVER_ENTRY +Language=Bulgarian +ERROR_FAILED_DRIVER_ENTRY - The driver was not loaded because it failed it's initialization call. +. + +MessageId=648 +Severity=Success +Facility=System +SymbolicName=ERROR_DEVICE_ENUMERATION_ERROR +Language=Bulgarian +ERROR_DEVICE_ENUMERATION_ERROR - The \"%hs\" encountered an error while applying power or reading the device configuration. This may be caused by a failure of your hardware or by a poor connection. +. + +MessageId=649 +Severity=Success +Facility=System +SymbolicName=ERROR_MOUNT_POINT_NOT_RESOLVED +Language=Bulgarian +ERROR_MOUNT_POINT_NOT_RESOLVED - The create operation failed because the name contained at least one mount point which resolves to a volume to which the specified device object is not attached. +. + +MessageId=650 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_DEVICE_OBJECT_PARAMETER +Language=Bulgarian +ERROR_INVALID_DEVICE_OBJECT_PARAMETER - The device object parameter is either not a valid device object or is not attached to the volume specified by the file name. +. + +MessageId=651 +Severity=Success +Facility=System +SymbolicName=ERROR_MCA_OCCURED +Language=Bulgarian +ERROR_MCA_OCCURED - A Machine Check Error has occurred. Please check the system eventlog for additional information. +. + +MessageId=652 +Severity=Success +Facility=System +SymbolicName=ERROR_DRIVER_DATABASE_ERROR +Language=Bulgarian +ERROR_DRIVER_DATABASE_ERROR - There was error [%2] processing the driver database. +. + +MessageId=653 +Severity=Success +Facility=System +SymbolicName=ERROR_SYSTEM_HIVE_TOO_LARGE +Language=Bulgarian +ERROR_SYSTEM_HIVE_TOO_LARGE - System hive size has exceeded its limit. +. + +MessageId=654 +Severity=Success +Facility=System +SymbolicName=ERROR_DRIVER_FAILED_PRIOR_UNLOAD +Language=Bulgarian +ERROR_DRIVER_FAILED_PRIOR_UNLOAD - The driver could not be loaded because a previous version of the driver is still in memory. +. + +MessageId=655 +Severity=Success +Facility=System +SymbolicName=ERROR_VOLSNAP_PREPARE_HIBERNATE +Language=Bulgarian +ERROR_VOLSNAP_PREPARE_HIBERNATE - Please wait while the Volume Shadow Copy Service prepares volume %hs for hibernation. +. + +MessageId=656 +Severity=Success +Facility=System +SymbolicName=ERROR_HIBERNATION_FAILURE +Language=Bulgarian +ERROR_HIBERNATION_FAILURE - The system has failed to hibernate (The error code is %hs). Hibernation will be disabled until the system is restarted. +. + +MessageId=657 +Severity=Success +Facility=System +SymbolicName=ERROR_HUNG_DISPLAY_DRIVER_THREAD +Language=Bulgarian +ERROR_HUNG_DISPLAY_DRIVER_THREAD - The %hs display driver has stopped working normally. Save your work and reboot the system to restore full display functionality. The next time you reboot the machine a dialog will be displayed giving you a chance to report this failure to Microsoft. +. + +MessageId=665 +Severity=Success +Facility=System +SymbolicName=ERROR_FILE_SYSTEM_LIMITATION +Language=Bulgarian +ERROR_FILE_SYSTEM_LIMITATION - The requested operation could not be completed due to a file system limitation. +. + +MessageId=668 +Severity=Success +Facility=System +SymbolicName=ERROR_ASSERTION_FAILURE +Language=Bulgarian +ERROR_ASSERTION_FAILURE - An assertion failure has occurred. +. + +MessageId=669 +Severity=Success +Facility=System +SymbolicName=ERROR_VERIFIER_STOP +Language=Bulgarian +ERROR_VERIFIER_STOP - Application verifier has found an error in the current process. +. + +MessageId=670 +Severity=Success +Facility=System +SymbolicName=ERROR_WOW_ASSERTION +Language=Bulgarian +ERROR_WOW_ASSERTION - WOW Assertion Error. +. + +MessageId=671 +Severity=Success +Facility=System +SymbolicName=ERROR_PNP_BAD_MPS_TABLE +Language=Bulgarian +ERROR_PNP_BAD_MPS_TABLE - A device is missing in the system BIOS MPS table. This device will not be used. Please contact your system vendor for system BIOS update. +. + +MessageId=672 +Severity=Success +Facility=System +SymbolicName=ERROR_PNP_TRANSLATION_FAILED +Language=Bulgarian +ERROR_PNP_TRANSLATION_FAILED - A translator failed to translate resources. +. + +MessageId=673 +Severity=Success +Facility=System +SymbolicName=ERROR_PNP_IRQ_TRANSLATION_FAILED +Language=Bulgarian +ERROR_PNP_IRQ_TRANSLATION_FAILED - A IRQ translator failed to translate resources. +. + +MessageId=674 +Severity=Success +Facility=System +SymbolicName=ERROR_PNP_INVALID_ID +Language=Bulgarian +ERROR_PNP_INVALID_ID - Driver %2 returned invalid ID for a child device (%3). +. + +MessageId=675 +Severity=Success +Facility=System +SymbolicName=ERROR_WAKE_SYSTEM_DEBUGGER +Language=Bulgarian +ERROR_WAKE_SYSTEM_DEBUGGER - The system debugger was awakened by an interrupt. +. + +MessageId=676 +Severity=Success +Facility=System +SymbolicName=ERROR_HANDLES_CLOSED +Language=Bulgarian +ERROR_HANDLES_CLOSED - Handles to objects have been automatically closed as a result of the requested operation. +. + +MessageId=677 +Severity=Success +Facility=System +SymbolicName=ERROR_EXTRANEOUS_INFORMATION +Language=Bulgarian +ERROR_EXTRANEOUS_INFORMATION - he specified access control list (ACL) contained more information than was expected. +. + +MessageId=678 +Severity=Success +Facility=System +SymbolicName=ERROR_RXACT_COMMIT_NECESSARY +Language=Bulgarian +ERROR_RXACT_COMMIT_NECESSARY - This warning level status indicates that the transaction state already exists for the registry sub-tree, but that a transaction commit was previously aborted. The commit has NOT been completed, but has not been rolled back either (so it may still be committed if desired). +. + +MessageId=679 +Severity=Success +Facility=System +SymbolicName=ERROR_MEDIA_CHECK +Language=Bulgarian +ERROR_MEDIA_CHECK - The media may have changed. +. + +MessageId=680 +Severity=Success +Facility=System +SymbolicName=ERROR_GUID_SUBSTITUTION_MADE +Language=Bulgarian +ERROR_GUID_SUBSTITUTION_MADE - During the translation of a global identifier (GUID) to a Windows security ID (SID), no administratively-defined GUID prefix was found. A substitute prefix was used, which will not compromise system security. However, this may provide a more restrictive access than intended. +. + +MessageId=681 +Severity=Success +Facility=System +SymbolicName=ERROR_STOPPED_ON_SYMLINK +Language=Bulgarian +ERROR_STOPPED_ON_SYMLINK - The create operation stopped after reaching a symbolic link. +. + +MessageId=682 +Severity=Success +Facility=System +SymbolicName=ERROR_LONGJUMP +Language=Bulgarian +ERROR_LONGJUMP - A long jump has been executed. +. + +MessageId=683 +Severity=Success +Facility=System +SymbolicName=ERROR_PLUGPLAY_QUERY_VETOED +Language=Bulgarian +ERROR_PLUGPLAY_QUERY_VETOED - The Plug and Play query operation was not successful. +. + +MessageId=684 +Severity=Success +Facility=System +SymbolicName=ERROR_UNWIND_CONSOLIDATE +Language=Bulgarian +ERROR_UNWIND_CONSOLIDATE - A frame consolidation has been executed. +. + +MessageId=685 +Severity=Success +Facility=System +SymbolicName=ERROR_REGISTRY_HIVE_RECOVERED +Language=Bulgarian +ERROR_REGISTRY_HIVE_RECOVERED - Registry hive (file): %hs was corrupted and it has been recovered. Some data might have been lost. +. + +MessageId=686 +Severity=Success +Facility=System +SymbolicName=ERROR_DLL_MIGHT_BE_INSECURE +Language=Bulgarian +ERROR_DLL_MIGHT_BE_INSECURE - The application is attempting to run executable code from the module %hs. This may be insecure. An alternative, %hs, is available. Should the application use the secure module %hs? +. + +MessageId=687 +Severity=Success +Facility=System +SymbolicName=ERROR_DLL_MIGHT_BE_INCOMPATIBLE +Language=Bulgarian +ERROR_DLL_MIGHT_BE_INCOMPATIBLE - The application is loading executable code from the module %hs. This is secure, but may be incompatible with previous releases of the operating system. An alternative, %hs, is available. Should the application use the secure module %hs? +. + +MessageId=688 +Severity=Success +Facility=System +SymbolicName=ERROR_DBG_EXCEPTION_NOT_HANDLED +Language=Bulgarian +ERROR_DBG_EXCEPTION_NOT_HANDLED - Debugger did not handle the exception. +. + +MessageId=689 +Severity=Success +Facility=System +SymbolicName=ERROR_DBG_REPLY_LATER +Language=Bulgarian +ERROR_DBG_REPLY_LATER - Debugger will reply later. +. + +MessageId=690 +Severity=Success +Facility=System +SymbolicName=ERROR_DBG_UNABLE_TO_PROVIDE_HANDLE +Language=Bulgarian +ERROR_DBG_UNABLE_TO_PROVIDE_HANDLE - Debugger can not provide handle. +. + +MessageId=691 +Severity=Success +Facility=System +SymbolicName=ERROR_DBG_TERMINATE_THREAD +Language=Bulgarian +ERROR_DBG_TERMINATE_THREAD - Debugger terminated thread. +. + +MessageId=692 +Severity=Success +Facility=System +SymbolicName=ERROR_DBG_TERMINATE_PROCESS +Language=Bulgarian +ERROR_DBG_TERMINATE_PROCESS - Debugger terminated process. +. + +MessageId=693 +Severity=Success +Facility=System +SymbolicName=ERROR_DBG_CONTROL_C +Language=Bulgarian +ERROR_DBG_CONTROL_C - Debugger got control C. +. + +MessageId=694 +Severity=Success +Facility=System +SymbolicName=ERROR_DBG_PRINTEXCEPTION_C +Language=Bulgarian +ERROR_DBG_PRINTEXCEPTION_C - Debugger printed exception on control C. +. + +MessageId=695 +Severity=Success +Facility=System +SymbolicName=ERROR_DBG_RIPEXCEPTION +Language=Bulgarian +ERROR_DBG_RIPEXCEPTION - Debugger received RIP exception. +. + +MessageId=696 +Severity=Success +Facility=System +SymbolicName=ERROR_DBG_CONTROL_BREAK +Language=Bulgarian +ERROR_DBG_CONTROL_BREAK - Debugger received control break. +. + +MessageId=697 +Severity=Success +Facility=System +SymbolicName=ERROR_DBG_COMMAND_EXCEPTION +Language=Bulgarian +ERROR_DBG_COMMAND_EXCEPTION - Debugger command communication exception. +. + +MessageId=698 +Severity=Success +Facility=System +SymbolicName=ERROR_OBJECT_NAME_EXISTS +Language=Bulgarian +ERROR_OBJECT_NAME_EXISTS - An attempt was made to create an object and the object name already existed. +. + +MessageId=699 +Severity=Success +Facility=System +SymbolicName=ERROR_THREAD_WAS_SUSPENDED +Language=Bulgarian +ERROR_THREAD_WAS_SUSPENDED - A thread termination occurred while the thread was suspended. The thread was resumed, and termination proceeded. +. + +MessageId=700 +Severity=Success +Facility=System +SymbolicName=ERROR_IMAGE_NOT_AT_BASE +Language=Bulgarian +ERROR_IMAGE_NOT_AT_BASE - An image file could not be mapped at the address specified in the image file. Local fixups must be performed on this image. +. + +MessageId=701 +Severity=Success +Facility=System +SymbolicName=ERROR_RXACT_STATE_CREATED +Language=Bulgarian +ERROR_RXACT_STATE_CREATED - This informational level status indicates that a specified registry sub-tree transaction state did not yet exist and had to be created. +. + +MessageId=702 +Severity=Success +Facility=System +SymbolicName=ERROR_SEGMENT_NOTIFICATION +Language=Bulgarian +ERROR_SEGMENT_NOTIFICATION - A virtual DOS machine (VDM) is loading, unloading, or moving an MS-DOS or Win16 program segment image. An exception is raised so a debugger can load, unload or track symbols and breakpoints within these 16-bit segments. +. + +MessageId=703 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_CURRENT_DIRECTORY +Language=Bulgarian +ERROR_BAD_CURRENT_DIRECTORY - The process cannot switch to the startup current directory %hs. Select OK to set current directory to %hs, or select CANCEL to exit. +. + +MessageId=704 +Severity=Success +Facility=System +SymbolicName=ERROR_FT_READ_RECOVERY_FROM_BACKUP +Language=Bulgarian +ERROR_FT_READ_RECOVERY_FROM_BACKUP - To satisfy a read request, the NT fault-tolerant file system successfully read the requested data from a redundant copy. This was done because the file system encountered a failure on a member of the fault-tolerant volume, but was unable to reassign the failing area of the device. +. + +MessageId=705 +Severity=Success +Facility=System +SymbolicName=ERROR_FT_WRITE_RECOVERY +Language=Bulgarian +ERROR_FT_WRITE_RECOVERY - To satisfy a write request, the NT fault-tolerant file system successfully wrote a redundant copy of the information. This was done because the file system encountered a failure on a member of the fault-tolerant volume, but was not able to reassign the failing area of the device. +. + +MessageId=706 +Severity=Success +Facility=System +SymbolicName=ERROR_IMAGE_MACHINE_TYPE_MISMATCH +Language=Bulgarian +ERROR_IMAGE_MACHINE_TYPE_MISMATCH - The image file %hs is valid, but is for a machine type other than the current machine. Select OK to continue, or CANCEL to fail the DLL load. +. + +MessageId=707 +Severity=Success +Facility=System +SymbolicName=ERROR_RECEIVE_PARTIAL +Language=Bulgarian +ERROR_RECEIVE_PARTIAL - The network transport returned partial data to its client. The remaining data will be sent later. +. + +MessageId=708 +Severity=Success +Facility=System +SymbolicName=ERROR_RECEIVE_EXPEDITED +Language=Bulgarian +ERROR_RECEIVE_EXPEDITED - The network transport returned data to its client that was marked as expedited by the remote system. +. + +MessageId=709 +Severity=Success +Facility=System +SymbolicName=ERROR_RECEIVE_PARTIAL_EXPEDITED +Language=Bulgarian +ERROR_RECEIVE_PARTIAL_EXPEDITED - The network transport returned partial data to its client and this data was marked as expedited by the remote system. The remaining data will be sent later. +. + +MessageId=710 +Severity=Success +Facility=System +SymbolicName=ERROR_EVENT_DONE +Language=Bulgarian +ERROR_EVENT_DONE - The TDI indication has completed successfully. +. + +MessageId=711 +Severity=Success +Facility=System +SymbolicName=ERROR_EVENT_PENDING +Language=Bulgarian +ERROR_EVENT_PENDING - The TDI indication has entered the pending state. +. + +MessageId=712 +Severity=Success +Facility=System +SymbolicName=ERROR_CHECKING_FILE_SYSTEM +Language=Bulgarian +ERROR_CHECKING_FILE_SYSTEM - Checking file system on %wZ. +. + +MessageId=714 +Severity=Success +Facility=System +SymbolicName=ERROR_PREDEFINED_HANDLE +Language=Bulgarian +ERROR_PREDEFINED_HANDLE - The specified registry key is referenced by a predefined handle. +. + +MessageId=715 +Severity=Success +Facility=System +SymbolicName=ERROR_WAS_UNLOCKED +Language=Bulgarian +ERROR_WAS_UNLOCKED - The page protection of a locked page was changed to 'No Access' and the page was unlocked from memory and from the process. +. + +MessageId=717 +Severity=Success +Facility=System +SymbolicName=ERROR_WAS_LOCKED +Language=Bulgarian +ERROR_WAS_LOCKED - One of the pages to lock was already locked. +. + +MessageId=720 +Severity=Success +Facility=System +SymbolicName=ERROR_IMAGE_MACHINE_TYPE_MISMATCH_EXE +Language=Bulgarian +ERROR_IMAGE_MACHINE_TYPE_MISMATCH_EXE - The image file %hs is valid, but is for a machine type other than the current machine. +. + +MessageId=721 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_YIELD_PERFORMED +Language=Bulgarian +ERROR_NO_YIELD_PERFORMED - A yield execution was performed and no thread was available to run. +. + +MessageId=722 +Severity=Success +Facility=System +SymbolicName=ERROR_TIMER_RESUME_IGNORED +Language=Bulgarian +ERROR_TIMER_RESUME_IGNORED - The resumable flag to a timer API was ignored. +. + +MessageId=723 +Severity=Success +Facility=System +SymbolicName=ERROR_ARBITRATION_UNHANDLED +Language=Bulgarian +ERROR_ARBITRATION_UNHANDLED - The arbiter has deferred arbitration of these resources to its parent. +. + +MessageId=724 +Severity=Success +Facility=System +SymbolicName=ERROR_CARDBUS_NOT_SUPPORTED +Language=Bulgarian +ERROR_CARDBUS_NOT_SUPPORTED - The device \"%hs\" has detected a CardBus card in its slot, but the firmware on this system is not configured to allow the CardBus controller to be run in CardBus mode. The operating system will currently accept only 16-bit (R2) pc-cards on this controller. +. + +MessageId=725 +Severity=Success +Facility=System +SymbolicName=ERROR_MP_PROCESSOR_MISMATCH +Language=Bulgarian +ERROR_MP_PROCESSOR_MISMATCH - The CPUs in this multiprocessor system are not all the same revision level. To use all processors the operating system restricts itself to the features of the least capable processor in the system. Should problems occur with this system, contact the CPU manufacturer to see if this mix of processors is supported. +. + +MessageId=726 +Severity=Success +Facility=System +SymbolicName=ERROR_HIBERNATED +Language=Bulgarian +ERROR_HIBERNATED - The system was put into hibernation. +. + +MessageId=727 +Severity=Success +Facility=System +SymbolicName=ERROR_RESUME_HIBERNATION +Language=Bulgarian +ERROR_RESUME_HIBERNATION - The system was resumed from hibernation. +. + +MessageId=728 +Severity=Success +Facility=System +SymbolicName=ERROR_FIRMWARE_UPDATED +Language=Bulgarian +ERROR_FIRMWARE_UPDATED - Windows has detected that the system firmware (BIOS) was updated [previous firmware date = %2, current firmware date %3]. +. + +MessageId=729 +Severity=Success +Facility=System +SymbolicName=ERROR_DRIVERS_LEAKING_LOCKED_PAGES +Language=Bulgarian +ERROR_DRIVERS_LEAKING_LOCKED_PAGES - A device driver is leaking locked I/O pages causing system degradation. The system has automatically enabled tracking code in order to try and catch the culprit. +. + +MessageId=730 +Severity=Success +Facility=System +SymbolicName=ERROR_WAKE_SYSTEM +Language=Bulgarian +ERROR_WAKE_SYSTEM - The system has awoken +. + +MessageId=741 +Severity=Success +Facility=System +SymbolicName=ERROR_REPARSE +Language=Bulgarian +ERROR_REPARSE - A reparse should be performed by the Object Manager since the name of the file resulted in a symbolic link. +. + +MessageId=742 +Severity=Success +Facility=System +SymbolicName=ERROR_OPLOCK_BREAK_IN_PROGRESS +Language=Bulgarian +ERROR_OPLOCK_BREAK_IN_PROGRESS - An open/create operation completed while an oplock break is underway. +. + +MessageId=743 +Severity=Success +Facility=System +SymbolicName=ERROR_VOLUME_MOUNTED +Language=Bulgarian +ERROR_VOLUME_MOUNTED - A new volume has been mounted by a file system. +. + +MessageId=744 +Severity=Success +Facility=System +SymbolicName=ERROR_RXACT_COMMITTED +Language=Bulgarian +ERROR_RXACT_COMMITTED - This success level status indicates that the transaction state already exists for the registry sub-tree, but that a transaction commit was previously aborted. The commit has now been completed. +. + +MessageId=745 +Severity=Success +Facility=System +SymbolicName=ERROR_NOTIFY_CLEANUP +Language=Bulgarian +ERROR_NOTIFY_CLEANUP - This indicates that a notify change request has been completed due to closing the handle which made the notify change request. +. + +MessageId=746 +Severity=Success +Facility=System +SymbolicName=ERROR_PRIMARY_TRANSPORT_CONNECT_FAILED +Language=Bulgarian +ERROR_PRIMARY_TRANSPORT_CONNECT_FAILED - An attempt was made to connect to the remote server %hs on the primary transport, but the connection failed. The computer WAS able to connect on a secondary transport. +. + +MessageId=747 +Severity=Success +Facility=System +SymbolicName=ERROR_PAGE_FAULT_TRANSITION +Language=Bulgarian +ERROR_PAGE_FAULT_TRANSITION - Page fault was a transition fault. +. + +MessageId=748 +Severity=Success +Facility=System +SymbolicName=ERROR_PAGE_FAULT_DEMAND_ZERO +Language=Bulgarian +ERROR_PAGE_FAULT_DEMAND_ZERO - Page fault was a demand zero fault. +. + +MessageId=749 +Severity=Success +Facility=System +SymbolicName=ERROR_PAGE_FAULT_COPY_ON_WRITE +Language=Bulgarian +ERROR_PAGE_FAULT_COPY_ON_WRITE - Page fault was a demand zero fault. +. + +MessageId=750 +Severity=Success +Facility=System +SymbolicName=ERROR_PAGE_FAULT_GUARD_PAGE +Language=Bulgarian +ERROR_PAGE_FAULT_GUARD_PAGE - Page fault was a demand zero fault. +. + +MessageId=751 +Severity=Success +Facility=System +SymbolicName=ERROR_PAGE_FAULT_PAGING_FILE +Language=Bulgarian +ERROR_PAGE_FAULT_PAGING_FILE - Page fault was satisfied by reading from a secondary storage device. +. + +MessageId=752 +Severity=Success +Facility=System +SymbolicName=ERROR_CACHE_PAGE_LOCKED +Language=Bulgarian +ERROR_CACHE_PAGE_LOCKED - Cached page was locked during operation. +. + +MessageId=753 +Severity=Success +Facility=System +SymbolicName=ERROR_CRASH_DUMP +Language=Bulgarian +ERROR_CRASH_DUMP - Crash dump exists in paging file. +. + +MessageId=754 +Severity=Success +Facility=System +SymbolicName=ERROR_BUFFER_ALL_ZEROS +Language=Bulgarian +ERROR_BUFFER_ALL_ZEROS - Specified buffer contains all zeros. +. + +MessageId=755 +Severity=Success +Facility=System +SymbolicName=ERROR_REPARSE_OBJECT +Language=Bulgarian +ERROR_REPARSE_OBJECT - A reparse should be performed by the Object Manager since the name of the file resulted in a symbolic link. +. + +MessageId=756 +Severity=Success +Facility=System +SymbolicName=ERROR_RESOURCE_REQUIREMENTS_CHANGED +Language=Bulgarian +ERROR_RESOURCE_REQUIREMENTS_CHANGED - The device has succeeded a query-stop and its resource requirements have changed. +. + +MessageId=757 +Severity=Success +Facility=System +SymbolicName=ERROR_TRANSLATION_COMPLETE +Language=Bulgarian +ERROR_TRANSLATION_COMPLETE - The translator has translated these resources into the global space and no further translations should be performed. +. + +MessageId=758 +Severity=Success +Facility=System +SymbolicName=ERROR_NOTHING_TO_TERMINATE +Language=Bulgarian +ERROR_NOTHING_TO_TERMINATE - A process being terminated has no threads to terminate. +. + +MessageId=759 +Severity=Success +Facility=System +SymbolicName=ERROR_PROCESS_NOT_IN_JOB +Language=Bulgarian +ERROR_PROCESS_NOT_IN_JOB - The specified process is not part of a job. +. + +MessageId=760 +Severity=Success +Facility=System +SymbolicName=ERROR_PROCESS_IN_JOB +Language=Bulgarian +ERROR_PROCESS_IN_JOB - The specified process is part of a job. +. + +MessageId=761 +Severity=Success +Facility=System +SymbolicName=ERROR_VOLSNAP_HIBERNATE_READY +Language=Bulgarian +ERROR_VOLSNAP_HIBERNATE_READY - The system is now ready for hibernation. +. + +MessageId=762 +Severity=Success +Facility=System +SymbolicName=ERROR_FSFILTER_OP_COMPLETED_SUCCESSFULLY +Language=Bulgarian +ERROR_FSFILTER_OP_COMPLETED_SUCCESSFULLY - A file system or file system filter driver has successfully completed an FsFilter operation. +. + +MessageId=763 +Severity=Success +Facility=System +SymbolicName=ERROR_INTERRUPT_VECTOR_ALREADY_CONNECTED +Language=Bulgarian +ERROR_INTERRUPT_VECTOR_ALREADY_CONNECTED - The specified interrupt vector was already connected. +. + +MessageId=764 +Severity=Success +Facility=System +SymbolicName=ERROR_INTERRUPT_STILL_CONNECTED +Language=Bulgarian +ERROR_INTERRUPT_STILL_CONNECTED - The specified interrupt vector is still connected. +. + +MessageId=765 +Severity=Success +Facility=System +SymbolicName=ERROR_WAIT_FOR_OPLOCK +Language=Bulgarian +ERROR_WAIT_FOR_OPLOCK - An operation is blocked waiting for an oplock. +. + +MessageId=766 +Severity=Success +Facility=System +SymbolicName=ERROR_DBG_EXCEPTION_HANDLED +Language=Bulgarian +ERROR_DBG_EXCEPTION_HANDLED - Debugger handled exception. +. + +MessageId=767 +Severity=Success +Facility=System +SymbolicName=ERROR_DBG_CONTINUE +Language=Bulgarian +ERROR_DBG_CONTINUE - Debugger continued +. + +MessageId=768 +Severity=Success +Facility=System +SymbolicName=ERROR_CALLBACK_POP_STACK +Language=Bulgarian +ERROR_CALLBACK_POP_STACK - An exception occurred in a user mode callback and the kernel callback frame should be removed. +. + +MessageId=769 +Severity=Success +Facility=System +SymbolicName=ERROR_COMPRESSION_DISABLED +Language=Bulgarian +ERROR_COMPRESSION_DISABLED - Compression is disabled for this volume. +. + +MessageId=770 +Severity=Success +Facility=System +SymbolicName=ERROR_CANTFETCHBACKWARDS +Language=Bulgarian +ERROR_CANTFETCHBACKWARDS - The data provider cannot fetch backwards through a result set. +. + +MessageId=771 +Severity=Success +Facility=System +SymbolicName=ERROR_CANTSCROLLBACKWARDS +Language=Bulgarian +ERROR_CANTSCROLLBACKWARDS - The data provider cannot scroll backwards through a result set. +. + +MessageId=772 +Severity=Success +Facility=System +SymbolicName=ERROR_ROWSNOTRELEASED +Language=Bulgarian +ERROR_ROWSNOTRELEASED - The data provider requires that previously fetched data is released before asking for more data. +. + +MessageId=773 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_ACCESSOR_FLAGS +Language=Bulgarian +ERROR_BAD_ACCESSOR_FLAGS - The data provider was not able to interpret the flags set for a column binding in an accessor. +. + +MessageId=774 +Severity=Success +Facility=System +SymbolicName=ERROR_ERRORS_ENCOUNTERED +Language=Bulgarian +ERROR_ERRORS_ENCOUNTERED - One or more errors occurred while processing the request. +. + +MessageId=775 +Severity=Success +Facility=System +SymbolicName=ERROR_NOT_CAPABLE +Language=Bulgarian +ERROR_NOT_CAPABLE - The implementation is not capable of performing the request. +. + +MessageId=776 +Severity=Success +Facility=System +SymbolicName=ERROR_REQUEST_OUT_OF_SEQUENCE +Language=Bulgarian +ERROR_REQUEST_OUT_OF_SEQUENCE - The client of a component requested an operation which is not valid given the state of the component instance. +. + +MessageId=777 +Severity=Success +Facility=System +SymbolicName=ERROR_VERSION_PARSE_ERROR +Language=Bulgarian +ERROR_VERSION_PARSE_ERROR - A version number could not be parsed. +. + +MessageId=778 +Severity=Success +Facility=System +SymbolicName=ERROR_BADSTARTPOSITION +Language=Bulgarian +ERROR_BADSTARTPOSITION - The iterator's start position is invalid. +. + +MessageId=994 +Severity=Success +Facility=System +SymbolicName=ERROR_EA_ACCESS_DENIED +Language=Bulgarian +ERROR_EA_ACCESS_DENIED - Access to the extended attribute was denied. +. + +MessageId=995 +Severity=Success +Facility=System +SymbolicName=ERROR_OPERATION_ABORTED +Language=Bulgarian +ERROR_OPERATION_ABORTED - The I/O operation has been aborted because of either a thread exit or an application request. +. + +MessageId=996 +Severity=Success +Facility=System +SymbolicName=ERROR_IO_INCOMPLETE +Language=Bulgarian +ERROR_IO_INCOMPLETE - Overlapped I/O event is not in a signaled state. +. + +MessageId=997 +Severity=Success +Facility=System +SymbolicName=ERROR_IO_PENDING +Language=Bulgarian +ERROR_IO_PENDING - Overlapped I/O operation is in progress. +. + +MessageId=998 +Severity=Success +Facility=System +SymbolicName=ERROR_NOACCESS +Language=Bulgarian +ERROR_NOACCESS - Invalid access to memory location. +. + +MessageId=999 +Severity=Success +Facility=System +SymbolicName=ERROR_SWAPERROR +Language=Bulgarian +ERROR_SWAPERROR - Error performing inpage operation. +. + +MessageId=1001 +Severity=Success +Facility=System +SymbolicName=ERROR_STACK_OVERFLOW +Language=Bulgarian +ERROR_STACK_OVERFLOW - Recursion too deep; the stack overflowed. +. + +MessageId=1002 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_MESSAGE +Language=Bulgarian +ERROR_INVALID_MESSAGE - The window cannot act on the sent message. +. + +MessageId=1003 +Severity=Success +Facility=System +SymbolicName=ERROR_CAN_NOT_COMPLETE +Language=Bulgarian +ERROR_CAN_NOT_COMPLETE - Cannot complete this function. +. + +MessageId=1004 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_FLAGS +Language=Bulgarian +ERROR_INVALID_FLAGS - Invalid flags. +. + +MessageId=1005 +Severity=Success +Facility=System +SymbolicName=ERROR_UNRECOGNIZED_VOLUME +Language=Bulgarian +ERROR_UNRECOGNIZED_VOLUME - The volume does not contain a recognized file system. Please make sure that all required file system drivers are loaded and that the volume is not corrupted. +. + +MessageId=1006 +Severity=Success +Facility=System +SymbolicName=ERROR_FILE_INVALID +Language=Bulgarian +ERROR_FILE_INVALID - The volume for a file has been externally altered so that the opened file is no longer valid. +. + +MessageId=1007 +Severity=Success +Facility=System +SymbolicName=ERROR_FULLSCREEN_MODE +Language=Bulgarian +ERROR_FULLSCREEN_MODE - The requested operation cannot be performed in full-screen mode. +. + +MessageId=1008 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_TOKEN +Language=Bulgarian +ERROR_NO_TOKEN - An attempt was made to reference a token that does not exist. +. + +MessageId=1009 +Severity=Success +Facility=System +SymbolicName=ERROR_BADDB +Language=Bulgarian +ERROR_BADDB - The configuration registry database is corrupt. +. + +MessageId=1010 +Severity=Success +Facility=System +SymbolicName=ERROR_BADKEY +Language=Bulgarian +ERROR_BADKEY - The configuration registry key is invalid. +. + +MessageId=1011 +Severity=Success +Facility=System +SymbolicName=ERROR_CANTOPEN +Language=Bulgarian +ERROR_CANTOPEN - The configuration registry key could not be opened. +. + +MessageId=1012 +Severity=Success +Facility=System +SymbolicName=ERROR_CANTREAD +Language=Bulgarian +ERROR_CANTREAD - The configuration registry key could not be read. +. + +MessageId=1013 +Severity=Success +Facility=System +SymbolicName=ERROR_CANTWRITE +Language=Bulgarian +ERROR_CANTWRITE - The configuration registry key could not be written. +. + +MessageId=1014 +Severity=Success +Facility=System +SymbolicName=ERROR_REGISTRY_RECOVERED +Language=Bulgarian +ERROR_REGISTRY_RECOVERED - One of the files in the registry database had to be recovered by use of a log or alternate copy. The recovery was successful. +. + +MessageId=1015 +Severity=Success +Facility=System +SymbolicName=ERROR_REGISTRY_CORRUPT +Language=Bulgarian +ERROR_REGISTRY_CORRUPT - The registry is corrupted. The structure of one of the files containing registry data is corrupted, or the system's memory image of the file is corrupted, or the file could not be recovered because the alternate copy or log was absent or corrupted. +. + +MessageId=1016 +Severity=Success +Facility=System +SymbolicName=ERROR_REGISTRY_IO_FAILED +Language=Bulgarian +ERROR_REGISTRY_IO_FAILED - An I/O operation initiated by the registry failed unrecoverably. The registry could not read in, or write out, or flush, one of the files that contain the system's image of the registry. +. + +MessageId=1017 +Severity=Success +Facility=System +SymbolicName=ERROR_NOT_REGISTRY_FILE +Language=Bulgarian +ERROR_NOT_REGISTRY_FILE - The system has attempted to load or restore a file into the registry, but the specified file is not in a registry file format. +. + +MessageId=1018 +Severity=Success +Facility=System +SymbolicName=ERROR_KEY_DELETED +Language=Bulgarian +ERROR_KEY_DELETED - Illegal operation attempted on a registry key that has been marked for deletion. +. + +MessageId=1019 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_LOG_SPACE +Language=Bulgarian +ERROR_NO_LOG_SPACE - System could not allocate the required space in a registry log. +. + +MessageId=1020 +Severity=Success +Facility=System +SymbolicName=ERROR_KEY_HAS_CHILDREN +Language=Bulgarian +ERROR_KEY_HAS_CHILDREN - Cannot create a symbolic link in a registry key that already has subkeys or values. +. + +MessageId=1021 +Severity=Success +Facility=System +SymbolicName=ERROR_CHILD_MUST_BE_VOLATILE +Language=Bulgarian +ERROR_CHILD_MUST_BE_VOLATILE - Cannot create a stable subkey under a volatile parent key. +. + +MessageId=1022 +Severity=Success +Facility=System +SymbolicName=ERROR_NOTIFY_ENUM_DIR +Language=Bulgarian +ERROR_NOTIFY_ENUM_DIR - A notify change request is being completed and the information is not being returned in the caller's buffer. The caller now needs to enumerate the files to find the changes. +. + +MessageId=1051 +Severity=Success +Facility=System +SymbolicName=ERROR_DEPENDENT_SERVICES_RUNNING +Language=Bulgarian +ERROR_DEPENDENT_SERVICES_RUNNING - A stop control has been sent to a service that other running services are dependent on. +. + +MessageId=1052 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_SERVICE_CONTROL +Language=Bulgarian +ERROR_INVALID_SERVICE_CONTROL - The requested control is not valid for this service. +. + +MessageId=1053 +Severity=Success +Facility=System +SymbolicName=ERROR_SERVICE_REQUEST_TIMEOUT +Language=Bulgarian +ERROR_SERVICE_REQUEST_TIMEOUT - The service did not respond to the start or control request in a timely fashion. +. + +MessageId=1054 +Severity=Success +Facility=System +SymbolicName=ERROR_SERVICE_NO_THREAD +Language=Bulgarian +ERROR_SERVICE_NO_THREAD - A thread could not be created for the service. +. + +MessageId=1055 +Severity=Success +Facility=System +SymbolicName=ERROR_SERVICE_DATABASE_LOCKED +Language=Bulgarian +ERROR_SERVICE_DATABASE_LOCKED - The service database is locked. +. + +MessageId=1056 +Severity=Success +Facility=System +SymbolicName=ERROR_SERVICE_ALREADY_RUNNING +Language=Bulgarian +ERROR_SERVICE_ALREADY_RUNNING - An instance of the service is already running. +. + +MessageId=1057 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_SERVICE_ACCOUNT +Language=Bulgarian +ERROR_INVALID_SERVICE_ACCOUNT - The account name is invalid or does not exist, or the password is invalid for the account name specified. +. + +MessageId=1058 +Severity=Success +Facility=System +SymbolicName=ERROR_SERVICE_DISABLED +Language=Bulgarian +ERROR_SERVICE_DISABLED - The service cannot be started, either because it is disabled or because it has no enabled devices associated with it. +. + +MessageId=1059 +Severity=Success +Facility=System +SymbolicName=ERROR_CIRCULAR_DEPENDENCY +Language=Bulgarian +ERROR_CIRCULAR_DEPENDENCY - Circular service dependency was specified. +. + +MessageId=1060 +Severity=Success +Facility=System +SymbolicName=ERROR_SERVICE_DOES_NOT_EXIST +Language=Bulgarian +ERROR_SERVICE_DOES_NOT_EXIST - The specified service does not exist as an installed service. +. + +MessageId=1061 +Severity=Success +Facility=System +SymbolicName=ERROR_SERVICE_CANNOT_ACCEPT_CTRL +Language=Bulgarian +ERROR_SERVICE_CANNOT_ACCEPT_CTRL - The service cannot accept control messages at this time. +. + +MessageId=1062 +Severity=Success +Facility=System +SymbolicName=ERROR_SERVICE_NOT_ACTIVE +Language=Bulgarian +ERROR_SERVICE_NOT_ACTIVE - The service has not been started. +. + +MessageId=1063 +Severity=Success +Facility=System +SymbolicName=ERROR_FAILED_SERVICE_CONTROLLER_CONNECT +Language=Bulgarian +ERROR_FAILED_SERVICE_CONTROLLER_CONNECT - The service process could not connect to the service controller. +. + +MessageId=1064 +Severity=Success +Facility=System +SymbolicName=ERROR_EXCEPTION_IN_SERVICE +Language=Bulgarian +ERROR_EXCEPTION_IN_SERVICE - An exception occurred in the service when handling the control request. +. + +MessageId=1065 +Severity=Success +Facility=System +SymbolicName=ERROR_DATABASE_DOES_NOT_EXIST +Language=Bulgarian +ERROR_DATABASE_DOES_NOT_EXIST - The database specified does not exist. +. + +MessageId=1066 +Severity=Success +Facility=System +SymbolicName=ERROR_SERVICE_SPECIFIC_ERROR +Language=Bulgarian +ERROR_SERVICE_SPECIFIC_ERROR - The service has returned a service-specific error code. +. + +MessageId=1067 +Severity=Success +Facility=System +SymbolicName=ERROR_PROCESS_ABORTED +Language=Bulgarian +ERROR_PROCESS_ABORTED - The process terminated unexpectedly. +. + +MessageId=1068 +Severity=Success +Facility=System +SymbolicName=ERROR_SERVICE_DEPENDENCY_FAIL +Language=Bulgarian +ERROR_SERVICE_DEPENDENCY_FAIL - The dependency service or group failed to start. +. + +MessageId=1069 +Severity=Success +Facility=System +SymbolicName=ERROR_SERVICE_LOGON_FAILED +Language=Bulgarian +ERROR_SERVICE_LOGON_FAILED - The service did not start due to a logon failure. +. + +MessageId=1070 +Severity=Success +Facility=System +SymbolicName=ERROR_SERVICE_START_HANG +Language=Bulgarian +ERROR_SERVICE_START_HANG - After starting, the service hung in a start-pending state. +. + +MessageId=1071 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_SERVICE_LOCK +Language=Bulgarian +ERROR_INVALID_SERVICE_LOCK - The specified service database lock is invalid. +. + +MessageId=1072 +Severity=Success +Facility=System +SymbolicName=ERROR_SERVICE_MARKED_FOR_DELETE +Language=Bulgarian +ERROR_SERVICE_MARKED_FOR_DELETE - The specified service has been marked for deletion. +. + +MessageId=1073 +Severity=Success +Facility=System +SymbolicName=ERROR_SERVICE_EXISTS +Language=Bulgarian +ERROR_SERVICE_EXISTS - The specified service already exists. +. + +MessageId=1074 +Severity=Success +Facility=System +SymbolicName=ERROR_ALREADY_RUNNING_LKG +Language=Bulgarian +ERROR_ALREADY_RUNNING_LKG - The system is currently running with the last-known-good configuration. +. + +MessageId=1075 +Severity=Success +Facility=System +SymbolicName=ERROR_SERVICE_DEPENDENCY_DELETED +Language=Bulgarian +ERROR_SERVICE_DEPENDENCY_DELETED - The dependency service does not exist or has been marked for deletion. +. + +MessageId=1076 +Severity=Success +Facility=System +SymbolicName=ERROR_BOOT_ALREADY_ACCEPTED +Language=Bulgarian +ERROR_BOOT_ALREADY_ACCEPTED - The current boot has already been accepted for use as the last-known-good control set. +. + +MessageId=1077 +Severity=Success +Facility=System +SymbolicName=ERROR_SERVICE_NEVER_STARTED +Language=Bulgarian +ERROR_SERVICE_NEVER_STARTED - No attempts to start the service have been made since the last boot. +. + +MessageId=1078 +Severity=Success +Facility=System +SymbolicName=ERROR_DUPLICATE_SERVICE_NAME +Language=Bulgarian +ERROR_DUPLICATE_SERVICE_NAME - The name is already in use as either a service name or a service display name. +. + +MessageId=1079 +Severity=Success +Facility=System +SymbolicName=ERROR_DIFFERENT_SERVICE_ACCOUNT +Language=Bulgarian +ERROR_DIFFERENT_SERVICE_ACCOUNT - The account specified for this service is different from the account specified for other services running in the same process. +. + +MessageId=1080 +Severity=Success +Facility=System +SymbolicName=ERROR_CANNOT_DETECT_DRIVER_FAILURE +Language=Bulgarian +ERROR_CANNOT_DETECT_DRIVER_FAILURE - Failure actions can only be set for Win32 services, not for drivers. +. + +MessageId=1081 +Severity=Success +Facility=System +SymbolicName=ERROR_CANNOT_DETECT_PROCESS_ABORT +Language=Bulgarian +ERROR_CANNOT_DETECT_PROCESS_ABORT - This service runs in the same process as the service control manager. Therefore, the service control manager cannot take action if this service's process terminates unexpectedly. +. + +MessageId=1082 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_RECOVERY_PROGRAM +Language=Bulgarian +ERROR_NO_RECOVERY_PROGRAM - No recovery program has been configured for this service. +. + +MessageId=1083 +Severity=Success +Facility=System +SymbolicName=ERROR_SERVICE_NOT_IN_EXE +Language=Bulgarian +ERROR_SERVICE_NOT_IN_EXE - The executable program that this service is configured to run in does not implement the service. +. + +MessageId=1084 +Severity=Success +Facility=System +SymbolicName=ERROR_NOT_SAFEBOOT_SERVICE +Language=Bulgarian +ERROR_NOT_SAFEBOOT_SERVICE - This service cannot be started in Safe Mode. +. + +MessageId=1100 +Severity=Success +Facility=System +SymbolicName=ERROR_END_OF_MEDIA +Language=Bulgarian +ERROR_END_OF_MEDIA - The physical end of the tape has been reached. +. + +MessageId=1101 +Severity=Success +Facility=System +SymbolicName=ERROR_FILEMARK_DETECTED +Language=Bulgarian +ERROR_FILEMARK_DETECTED - A tape access reached a filemark. +. + +MessageId=1102 +Severity=Success +Facility=System +SymbolicName=ERROR_BEGINNING_OF_MEDIA +Language=Bulgarian +ERROR_BEGINNING_OF_MEDIA - The beginning of the tape or a partition was encountered. +. + +MessageId=1103 +Severity=Success +Facility=System +SymbolicName=ERROR_SETMARK_DETECTED +Language=Bulgarian +ERROR_SETMARK_DETECTED - A tape access reached the end of a set of files. +. + +MessageId=1104 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_DATA_DETECTED +Language=Bulgarian +ERROR_NO_DATA_DETECTED - No more data is on the tape. +. + +MessageId=1105 +Severity=Success +Facility=System +SymbolicName=ERROR_PARTITION_FAILURE +Language=Bulgarian +ERROR_PARTITION_FAILURE - Tape could not be partitioned. +. + +MessageId=1106 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_BLOCK_LENGTH +Language=Bulgarian +ERROR_INVALID_BLOCK_LENGTH - When accessing a new tape of a multivolume partition, the current block size is incorrect. +. + +MessageId=1107 +Severity=Success +Facility=System +SymbolicName=ERROR_DEVICE_NOT_PARTITIONED +Language=Bulgarian +ERROR_DEVICE_NOT_PARTITIONED - Tape partition information could not be found when loading a tape. +. + +MessageId=1108 +Severity=Success +Facility=System +SymbolicName=ERROR_UNABLE_TO_LOCK_MEDIA +Language=Bulgarian +ERROR_UNABLE_TO_LOCK_MEDIA - Unable to lock the media eject mechanism. +. + +MessageId=1109 +Severity=Success +Facility=System +SymbolicName=ERROR_UNABLE_TO_UNLOAD_MEDIA +Language=Bulgarian +ERROR_UNABLE_TO_UNLOAD_MEDIA - Unable to unload the media. +. + +MessageId=1110 +Severity=Success +Facility=System +SymbolicName=ERROR_MEDIA_CHANGED +Language=Bulgarian +ERROR_MEDIA_CHANGED - The media in the drive may have changed. +. + +MessageId=1111 +Severity=Success +Facility=System +SymbolicName=ERROR_BUS_RESET +Language=Bulgarian +ERROR_BUS_RESET - The I/O bus was reset. +. + +MessageId=1112 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_MEDIA_IN_DRIVE +Language=Bulgarian +ERROR_NO_MEDIA_IN_DRIVE - No media in drive. +. + +MessageId=1113 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_UNICODE_TRANSLATION +Language=Bulgarian +ERROR_NO_UNICODE_TRANSLATION - No mapping for the Unicode character exists in the target multi-byte code page. +. + +MessageId=1114 +Severity=Success +Facility=System +SymbolicName=ERROR_DLL_INIT_FAILED +Language=Bulgarian +ERROR_DLL_INIT_FAILED - A dynamic link library (DLL) initialization routine failed. +. + +MessageId=1115 +Severity=Success +Facility=System +SymbolicName=ERROR_SHUTDOWN_IN_PROGRESS +Language=Bulgarian +ERROR_SHUTDOWN_IN_PROGRESS - A system shutdown is in progress. +. + +MessageId=1116 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_SHUTDOWN_IN_PROGRESS +Language=Bulgarian +ERROR_NO_SHUTDOWN_IN_PROGRESS - Unable to abort the system shutdown because no shutdown was in progress. +. + +MessageId=1117 +Severity=Success +Facility=System +SymbolicName=ERROR_IO_DEVICE +Language=Bulgarian +ERROR_IO_DEVICE - The request could not be performed because of an I/O device error. +. + +MessageId=1118 +Severity=Success +Facility=System +SymbolicName=ERROR_SERIAL_NO_DEVICE +Language=Bulgarian +ERROR_SERIAL_NO_DEVICE - No serial device was successfully initialized. The serial driver will unload. +. + +MessageId=1119 +Severity=Success +Facility=System +SymbolicName=ERROR_IRQ_BUSY +Language=Bulgarian +ERROR_IRQ_BUSY - Unable to open a device that was sharing an interrupt request (IRQ) with other devices. At least one other device that uses that IRQ was already opened. +. + +MessageId=1120 +Severity=Success +Facility=System +SymbolicName=ERROR_MORE_WRITES +Language=Bulgarian +ERROR_MORE_WRITES - A serial I/O operation was completed by another write to the serial port. (The IOCTL_SERIAL_XOFF_COUNTER reached zero.) +. + +MessageId=1121 +Severity=Success +Facility=System +SymbolicName=ERROR_COUNTER_TIMEOUT +Language=Bulgarian +ERROR_COUNTER_TIMEOUT - A serial I/O operation completed because the timeout period expired. (The IOCTL_SERIAL_XOFF_COUNTER did not reach zero.) +. + +MessageId=1122 +Severity=Success +Facility=System +SymbolicName=ERROR_FLOPPY_ID_MARK_NOT_FOUND +Language=Bulgarian +ERROR_FLOPPY_ID_MARK_NOT_FOUND - No ID address mark was found on the floppy disk. +. + +MessageId=1123 +Severity=Success +Facility=System +SymbolicName=ERROR_FLOPPY_WRONG_CYLINDER +Language=Bulgarian +ERROR_FLOPPY_WRONG_CYLINDER - Mismatch between the floppy disk sector ID field and the floppy disk controller track address. +. + +MessageId=1124 +Severity=Success +Facility=System +SymbolicName=ERROR_FLOPPY_UNKNOWN_ERROR +Language=Bulgarian +ERROR_FLOPPY_UNKNOWN_ERROR - The floppy disk controller reported an error that is not recognized by the floppy disk driver. +. + +MessageId=1125 +Severity=Success +Facility=System +SymbolicName=ERROR_FLOPPY_BAD_REGISTERS +Language=Bulgarian +ERROR_FLOPPY_BAD_REGISTERS - The floppy disk controller returned inconsistent results in its registers. +. + +MessageId=1126 +Severity=Success +Facility=System +SymbolicName=ERROR_DISK_RECALIBRATE_FAILED +Language=Bulgarian +ERROR_DISK_RECALIBRATE_FAILED - While accessing the hard disk, a recalibrate operation failed, even after retries. +. + +MessageId=1127 +Severity=Success +Facility=System +SymbolicName=ERROR_DISK_OPERATION_FAILED +Language=Bulgarian +ERROR_DISK_OPERATION_FAILED - While accessing the hard disk, a disk operation failed even after retries. +. + +MessageId=1128 +Severity=Success +Facility=System +SymbolicName=ERROR_DISK_RESET_FAILED +Language=Bulgarian +ERROR_DISK_RESET_FAILED - While accessing the hard disk, a disk controller reset was needed, but even that failed. +. + +MessageId=1129 +Severity=Success +Facility=System +SymbolicName=ERROR_EOM_OVERFLOW +Language=Bulgarian +ERROR_EOM_OVERFLOW - Physical end of tape encountered. +. + +MessageId=1130 +Severity=Success +Facility=System +SymbolicName=ERROR_NOT_ENOUGH_SERVER_MEMORY +Language=Bulgarian +ERROR_NOT_ENOUGH_SERVER_MEMORY - Not enough server storage is available to process this command. +. + +MessageId=1131 +Severity=Success +Facility=System +SymbolicName=ERROR_POSSIBLE_DEADLOCK +Language=Bulgarian +ERROR_POSSIBLE_DEADLOCK - A potential deadlock condition has been detected. +. + +MessageId=1132 +Severity=Success +Facility=System +SymbolicName=ERROR_MAPPED_ALIGNMENT +Language=Bulgarian +ERROR_MAPPED_ALIGNMENT - The base address or the file offset specified does not have the proper alignment. +. + +MessageId=1140 +Severity=Success +Facility=System +SymbolicName=ERROR_SET_POWER_STATE_VETOED +Language=Bulgarian +ERROR_SET_POWER_STATE_VETOED - An attempt to change the system power state was vetoed by another application or driver. +. + +MessageId=1141 +Severity=Success +Facility=System +SymbolicName=ERROR_SET_POWER_STATE_FAILED +Language=Bulgarian +ERROR_SET_POWER_STATE_FAILED - The system BIOS failed an attempt to change the system power state. +. + +MessageId=1142 +Severity=Success +Facility=System +SymbolicName=ERROR_TOO_MANY_LINKS +Language=Bulgarian +ERROR_TOO_MANY_LINKS - An attempt was made to create more links on a file than the file system supports. +. + +MessageId=1150 +Severity=Success +Facility=System +SymbolicName=ERROR_OLD_WIN_VERSION +Language=Bulgarian +ERROR_OLD_WIN_VERSION - The specified program requires a newer version of Windows. +. + +MessageId=1151 +Severity=Success +Facility=System +SymbolicName=ERROR_APP_WRONG_OS +Language=Bulgarian +ERROR_APP_WRONG_OS - The specified program is not a Windows or MS-DOS program. +. + +MessageId=1152 +Severity=Success +Facility=System +SymbolicName=ERROR_SINGLE_INSTANCE_APP +Language=Bulgarian +ERROR_SINGLE_INSTANCE_APP - Cannot start more than one instance of the specified program. +. + +MessageId=1153 +Severity=Success +Facility=System +SymbolicName=ERROR_RMODE_APP +Language=Bulgarian +ERROR_RMODE_APP - The specified program was written for an earlier version of Windows. +. + +MessageId=1154 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_DLL +Language=Bulgarian +ERROR_INVALID_DLL - One of the library files needed to run this application is damaged. +. + +MessageId=1155 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_ASSOCIATION +Language=Bulgarian +ERROR_NO_ASSOCIATION - No application is associated with the specified file for this operation. +. + +MessageId=1156 +Severity=Success +Facility=System +SymbolicName=ERROR_DDE_FAIL +Language=Bulgarian +ERROR_DDE_FAIL - An error occurred in sending the command to the application. +. + +MessageId=1157 +Severity=Success +Facility=System +SymbolicName=ERROR_DLL_NOT_FOUND +Language=Bulgarian +ERROR_DLL_NOT_FOUND - One of the library files needed to run this application cannot be found. +. + +MessageId=1158 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_MORE_USER_HANDLES +Language=Bulgarian +ERROR_NO_MORE_USER_HANDLES - The current process has used all of its system allowance of handles for Window Manager objects. +. + +MessageId=1159 +Severity=Success +Facility=System +SymbolicName=ERROR_MESSAGE_SYNC_ONLY +Language=Bulgarian +ERROR_MESSAGE_SYNC_ONLY - The message can be used only with synchronous operations. +. + +MessageId=1160 +Severity=Success +Facility=System +SymbolicName=ERROR_SOURCE_ELEMENT_EMPTY +Language=Bulgarian +ERROR_SOURCE_ELEMENT_EMPTY - The indicated source element has no media. +. + +MessageId=1161 +Severity=Success +Facility=System +SymbolicName=ERROR_DESTINATION_ELEMENT_FULL +Language=Bulgarian +ERROR_DESTINATION_ELEMENT_FULL - The indicated destination element already contains media. +. + +MessageId=1162 +Severity=Success +Facility=System +SymbolicName=ERROR_ILLEGAL_ELEMENT_ADDRESS +Language=Bulgarian +ERROR_ILLEGAL_ELEMENT_ADDRESS - The indicated element does not exist. +. + +MessageId=1163 +Severity=Success +Facility=System +SymbolicName=ERROR_MAGAZINE_NOT_PRESENT +Language=Bulgarian +ERROR_MAGAZINE_NOT_PRESENT - The indicated element is part of a magazine that is not present. +. + +MessageId=1164 +Severity=Success +Facility=System +SymbolicName=ERROR_DEVICE_REINITIALIZATION_NEEDED +Language=Bulgarian +ERROR_DEVICE_REINITIALIZATION_NEEDED - The indicated device requires reinitialization due to hardware errors. +. + +MessageId=1165 +Severity=Success +Facility=System +SymbolicName=ERROR_DEVICE_REQUIRES_CLEANING +Language=Bulgarian +ERROR_DEVICE_REQUIRES_CLEANING - The device has indicated that cleaning is required before further operations are attempted. +. + +MessageId=1166 +Severity=Success +Facility=System +SymbolicName=ERROR_DEVICE_DOOR_OPEN +Language=Bulgarian +ERROR_DEVICE_DOOR_OPEN - The device has indicated that its door is open. +. + +MessageId=1167 +Severity=Success +Facility=System +SymbolicName=ERROR_DEVICE_NOT_CONNECTED +Language=Bulgarian +ERROR_DEVICE_NOT_CONNECTED - The device is not connected. +. + +MessageId=1168 +Severity=Success +Facility=System +SymbolicName=ERROR_NOT_FOUND +Language=Bulgarian +ERROR_NOT_FOUND - Element not found. +. + +MessageId=1169 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_MATCH +Language=Bulgarian +ERROR_NO_MATCH - There was no match for the specified key in the index. +. + +MessageId=1170 +Severity=Success +Facility=System +SymbolicName=ERROR_SET_NOT_FOUND +Language=Bulgarian +ERROR_SET_NOT_FOUND - The property set specified does not exist on the object. +. + +MessageId=1171 +Severity=Success +Facility=System +SymbolicName=ERROR_POINT_NOT_FOUND +Language=Bulgarian +ERROR_POINT_NOT_FOUND - The point passed to GetMouseMovePointsEx is not in the buffer. +. + +MessageId=1172 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_TRACKING_SERVICE +Language=Bulgarian +ERROR_NO_TRACKING_SERVICE - The tracking (workstation) service is not running. +. + +MessageId=1173 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_VOLUME_ID +Language=Bulgarian +ERROR_NO_VOLUME_ID - The Volume ID could not be found. +. + +MessageId=1175 +Severity=Success +Facility=System +SymbolicName=ERROR_UNABLE_TO_REMOVE_REPLACED +Language=Bulgarian +ERROR_UNABLE_TO_REMOVE_REPLACED - Unable to remove the file to be replaced. +. + +MessageId=1176 +Severity=Success +Facility=System +SymbolicName=ERROR_UNABLE_TO_MOVE_REPLACEMENT +Language=Bulgarian +ERROR_UNABLE_TO_MOVE_REPLACEMENT - Unable to move the replacement file to the file to be replaced. The file to be replaced has retained its original name. +. + +MessageId=1177 +Severity=Success +Facility=System +SymbolicName=ERROR_UNABLE_TO_MOVE_REPLACEMENT_2 +Language=Bulgarian +ERROR_UNABLE_TO_MOVE_REPLACEMENT_2 - Unable to move the replacement file to the file to be replaced. The file to be replaced has been renamed using the backup name. +. + +MessageId=1178 +Severity=Success +Facility=System +SymbolicName=ERROR_JOURNAL_DELETE_IN_PROGRESS +Language=Bulgarian +ERROR_JOURNAL_DELETE_IN_PROGRESS - The volume change journal is being deleted. +. + +MessageId=1179 +Severity=Success +Facility=System +SymbolicName=ERROR_JOURNAL_NOT_ACTIVE +Language=Bulgarian +ERROR_JOURNAL_NOT_ACTIVE - The volume change journal is not active. +. + +MessageId=1180 +Severity=Success +Facility=System +SymbolicName=ERROR_POTENTIAL_FILE_FOUND +Language=Bulgarian +ERROR_POTENTIAL_FILE_FOUND - A file was found, but it may not be the correct file. +. + +MessageId=1181 +Severity=Success +Facility=System +SymbolicName=ERROR_JOURNAL_ENTRY_DELETED +Language=Bulgarian +ERROR_JOURNAL_ENTRY_DELETED - The journal entry has been deleted from the journal. +. + +MessageId=1200 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_DEVICE +Language=Bulgarian +ERROR_BAD_DEVICE - The specified device name is invalid. +. + +MessageId=1201 +Severity=Success +Facility=System +SymbolicName=ERROR_CONNECTION_UNAVAIL +Language=Bulgarian +ERROR_CONNECTION_UNAVAIL - The device is not currently connected but it is a remembered connection. +. + +MessageId=1202 +Severity=Success +Facility=System +SymbolicName=ERROR_DEVICE_ALREADY_REMEMBERED +Language=Bulgarian +ERROR_DEVICE_ALREADY_REMEMBERED - The local device name has a remembered connection to another network resource. +. + +MessageId=1203 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_NET_OR_BAD_PATH +Language=Bulgarian +ERROR_NO_NET_OR_BAD_PATH - The network path was either typed incorrectly, does not exist, or the network provider is not currently available. Please try retyping the path or contact your network administrator. +. + +MessageId=1204 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_PROVIDER +Language=Bulgarian +ERROR_BAD_PROVIDER - The specified network provider name is invalid. +. + +MessageId=1205 +Severity=Success +Facility=System +SymbolicName=ERROR_CANNOT_OPEN_PROFILE +Language=Bulgarian +ERROR_CANNOT_OPEN_PROFILE - Unable to open the network connection profile. +. + +MessageId=1206 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_PROFILE +Language=Bulgarian +ERROR_BAD_PROFILE - The network connection profile is corrupted. +. + +MessageId=1207 +Severity=Success +Facility=System +SymbolicName=ERROR_NOT_CONTAINER +Language=Bulgarian +ERROR_NOT_CONTAINER - Cannot enumerate a noncontainer. +. + +MessageId=1208 +Severity=Success +Facility=System +SymbolicName=ERROR_EXTENDED_ERROR +Language=Bulgarian +ERROR_EXTENDED_ERROR - An extended error has occurred. +. + +MessageId=1209 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_GROUPNAME +Language=Bulgarian +ERROR_INVALID_GROUPNAME - The format of the specified group name is invalid. +. + +MessageId=1210 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_COMPUTERNAME +Language=Bulgarian +ERROR_INVALID_COMPUTERNAME - The format of the specified computer name is invalid. +. + +MessageId=1211 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_EVENTNAME +Language=Bulgarian +ERROR_INVALID_EVENTNAME - The format of the specified event name is invalid. +. + +MessageId=1212 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_DOMAINNAME +Language=Bulgarian +ERROR_INVALID_DOMAINNAME - The format of the specified domain name is invalid. +. + +MessageId=1213 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_SERVICENAME +Language=Bulgarian +ERROR_INVALID_SERVICENAME - The format of the specified service name is invalid. +. + +MessageId=1214 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_NETNAME +Language=Bulgarian +ERROR_INVALID_NETNAME - The format of the specified network name is invalid. +. + +MessageId=1215 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_SHARENAME +Language=Bulgarian +ERROR_INVALID_SHARENAME - The format of the specified share name is invalid. +. + +MessageId=1216 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_PASSWORDNAME +Language=Bulgarian +ERROR_INVALID_PASSWORDNAME - The format of the specified password is invalid. +. + +MessageId=1217 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_MESSAGENAME +Language=Bulgarian +ERROR_INVALID_MESSAGENAME - The format of the specified message name is invalid. +. + +MessageId=1218 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_MESSAGEDEST +Language=Bulgarian +ERROR_INVALID_MESSAGEDEST - The format of the specified message destination is invalid. +. + +MessageId=1219 +Severity=Success +Facility=System +SymbolicName=ERROR_SESSION_CREDENTIAL_CONFLICT +Language=Bulgarian +ERROR_SESSION_CREDENTIAL_CONFLICT - Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed. Disconnect all previous connections to the server or shared resource and try again. +. + +MessageId=1220 +Severity=Success +Facility=System +SymbolicName=ERROR_REMOTE_SESSION_LIMIT_EXCEEDED +Language=Bulgarian +ERROR_REMOTE_SESSION_LIMIT_EXCEEDED - An attempt was made to establish a session to a network server, but there are already too many sessions established to that server. +. + +MessageId=1221 +Severity=Success +Facility=System +SymbolicName=ERROR_DUP_DOMAINNAME +Language=Bulgarian +ERROR_DUP_DOMAINNAME - The workgroup or domain name is already in use by another computer on the network. +. + +MessageId=1222 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_NETWORK +Language=Bulgarian +ERROR_NO_NETWORK - The network is not present or not started. +. + +MessageId=1223 +Severity=Success +Facility=System +SymbolicName=ERROR_CANCELLED +Language=Bulgarian +ERROR_CANCELLED - The operation was canceled by the user. +. + +MessageId=1224 +Severity=Success +Facility=System +SymbolicName=ERROR_USER_MAPPED_FILE +Language=Bulgarian +ERROR_USER_MAPPED_FILE - The requested operation cannot be performed on a file with a user-mapped section open. +. + +MessageId=1225 +Severity=Success +Facility=System +SymbolicName=ERROR_CONNECTION_REFUSED +Language=Bulgarian +ERROR_CONNECTION_REFUSED - The remote system refused the network connection. +. + +MessageId=1226 +Severity=Success +Facility=System +SymbolicName=ERROR_GRACEFUL_DISCONNECT +Language=Bulgarian +ERROR_GRACEFUL_DISCONNECT - The network connection was gracefully closed. +. + +MessageId=1227 +Severity=Success +Facility=System +SymbolicName=ERROR_ADDRESS_ALREADY_ASSOCIATED +Language=Bulgarian +ERROR_ADDRESS_ALREADY_ASSOCIATED - The network transport endpoint already has an address associated with it. +. + +MessageId=1228 +Severity=Success +Facility=System +SymbolicName=ERROR_ADDRESS_NOT_ASSOCIATED +Language=Bulgarian +ERROR_ADDRESS_NOT_ASSOCIATED - An address has not yet been associated with the network endpoint. +. + +MessageId=1229 +Severity=Success +Facility=System +SymbolicName=ERROR_CONNECTION_INVALID +Language=Bulgarian +ERROR_CONNECTION_INVALID - An operation was attempted on a nonexistent network connection. +. + +MessageId=1230 +Severity=Success +Facility=System +SymbolicName=ERROR_CONNECTION_ACTIVE +Language=Bulgarian +ERROR_CONNECTION_ACTIVE - An invalid operation was attempted on an active network connection. +. + +MessageId=1231 +Severity=Success +Facility=System +SymbolicName=ERROR_NETWORK_UNREACHABLE +Language=Bulgarian +ERROR_NETWORK_UNREACHABLE - The network location cannot be reached. For information about network troubleshooting, see Windows Help. +. + +MessageId=1232 +Severity=Success +Facility=System +SymbolicName=ERROR_HOST_UNREACHABLE +Language=Bulgarian +ERROR_HOST_UNREACHABLE - The network location cannot be reached. For information about network troubleshooting, see Windows Help. +. + +MessageId=1233 +Severity=Success +Facility=System +SymbolicName=ERROR_PROTOCOL_UNREACHABLE +Language=Bulgarian +ERROR_PROTOCOL_UNREACHABLE - The network location cannot be reached. For information about network troubleshooting, see Windows Help. +. + +MessageId=1234 +Severity=Success +Facility=System +SymbolicName=ERROR_PORT_UNREACHABLE +Language=Bulgarian +ERROR_PORT_UNREACHABLE - No service is operating at the destination network endpoint on the remote system. +. + +MessageId=1235 +Severity=Success +Facility=System +SymbolicName=ERROR_REQUEST_ABORTED +Language=Bulgarian +ERROR_REQUEST_ABORTED - The request was aborted. +. + +MessageId=1236 +Severity=Success +Facility=System +SymbolicName=ERROR_CONNECTION_ABORTED +Language=Bulgarian +ERROR_CONNECTION_ABORTED - The network connection was aborted by the local system. +. + +MessageId=1237 +Severity=Success +Facility=System +SymbolicName=ERROR_RETRY +Language=Bulgarian +ERROR_RETRY - The operation could not be completed. A retry should be performed. +. + +MessageId=1238 +Severity=Success +Facility=System +SymbolicName=ERROR_CONNECTION_COUNT_LIMIT +Language=Bulgarian +ERROR_CONNECTION_COUNT_LIMIT - A connection to the server could not be made because the limit on the number of concurrent connections for this account has been reached. +. + +MessageId=1239 +Severity=Success +Facility=System +SymbolicName=ERROR_LOGIN_TIME_RESTRICTION +Language=Bulgarian +ERROR_LOGIN_TIME_RESTRICTION - Attempting to log in during an unauthorized time of day for this account. +. + +MessageId=1240 +Severity=Success +Facility=System +SymbolicName=ERROR_LOGIN_WKSTA_RESTRICTION +Language=Bulgarian +ERROR_LOGIN_WKSTA_RESTRICTION - The account is not authorized to log in from this station. +. + +MessageId=1241 +Severity=Success +Facility=System +SymbolicName=ERROR_INCORRECT_ADDRESS +Language=Bulgarian +ERROR_INCORRECT_ADDRESS - The network address could not be used for the operation requested. +. + +MessageId=1242 +Severity=Success +Facility=System +SymbolicName=ERROR_ALREADY_REGISTERED +Language=Bulgarian +ERROR_ALREADY_REGISTERED - The service is already registered. +. + +MessageId=1243 +Severity=Success +Facility=System +SymbolicName=ERROR_SERVICE_NOT_FOUND +Language=Bulgarian +ERROR_SERVICE_NOT_FOUND - The specified service does not exist. +. + +MessageId=1244 +Severity=Success +Facility=System +SymbolicName=ERROR_NOT_AUTHENTICATED +Language=Bulgarian +ERROR_NOT_AUTHENTICATED - The operation being requested was not performed because the user has not been authenticated. +. + +MessageId=1245 +Severity=Success +Facility=System +SymbolicName=ERROR_NOT_LOGGED_ON +Language=Bulgarian +ERROR_NOT_LOGGED_ON - The operation being requested was not performed because the user has not logged on to the network. The specified service does not exist. +. + +MessageId=1246 +Severity=Success +Facility=System +SymbolicName=ERROR_CONTINUE +Language=Bulgarian +ERROR_CONTINUE - Continue with work in progress. +. + +MessageId=1247 +Severity=Success +Facility=System +SymbolicName=ERROR_ALREADY_INITIALIZED +Language=Bulgarian +ERROR_ALREADY_INITIALIZED - An attempt was made to perform an initialization operation when initialization has already been completed. +. + +MessageId=1248 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_MORE_DEVICES +Language=Bulgarian +ERROR_NO_MORE_DEVICES - No more local devices. +. + +MessageId=1249 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_SUCH_SITE +Language=Bulgarian +ERROR_NO_SUCH_SITE - The specified site does not exist. +. + +MessageId=1250 +Severity=Success +Facility=System +SymbolicName=ERROR_DOMAIN_CONTROLLER_EXISTS +Language=Bulgarian +ERROR_DOMAIN_CONTROLLER_EXISTS - A domain controller with the specified name already exists. +. + +MessageId=1251 +Severity=Success +Facility=System +SymbolicName=ERROR_ONLY_IF_CONNECTED +Language=Bulgarian +ERROR_ONLY_IF_CONNECTED - This operation is supported only when you are connected to the server. +. + +MessageId=1252 +Severity=Success +Facility=System +SymbolicName=ERROR_OVERRIDE_NOCHANGES +Language=Bulgarian +ERROR_OVERRIDE_NOCHANGES - The group policy framework should call the extension even if there are no changes. +. + +MessageId=1253 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_USER_PROFILE +Language=Bulgarian +ERROR_BAD_USER_PROFILE - The specified user does not have a valid profile. +. + +MessageId=1254 +Severity=Success +Facility=System +SymbolicName=ERROR_NOT_SUPPORTED_ON_SBS +Language=Bulgarian +ERROR_NOT_SUPPORTED_ON_SBS - This operation is not supported on a computer running Windows Server 2003 for Small Business Server. +. + +MessageId=1255 +Severity=Success +Facility=System +SymbolicName=ERROR_SERVER_SHUTDOWN_IN_PROGRESS +Language=Bulgarian +ERROR_SERVER_SHUTDOWN_IN_PROGRESS - The server machine is shutting down. +. + +MessageId=1256 +Severity=Success +Facility=System +SymbolicName=ERROR_HOST_DOWN +Language=Bulgarian +ERROR_HOST_DOWN - The remote system is not available. For information about network troubleshooting, see Windows Help. +. + +MessageId=1257 +Severity=Success +Facility=System +SymbolicName=ERROR_NON_ACCOUNT_SID +Language=Bulgarian +ERROR_NON_ACCOUNT_SID - The security identifier provided is not from an account domain. +. + +MessageId=1258 +Severity=Success +Facility=System +SymbolicName=ERROR_NON_DOMAIN_SID +Language=Bulgarian +ERROR_NON_DOMAIN_SID - The security identifier provided does not have a domain component. +. + +MessageId=1259 +Severity=Success +Facility=System +SymbolicName=ERROR_APPHELP_BLOCK +Language=Bulgarian +ERROR_APPHELP_BLOCK - AppHelp dialog canceled thus preventing the application from starting. +. + +MessageId=1260 +Severity=Success +Facility=System +SymbolicName=ERROR_ACCESS_DISABLED_BY_POLICY +Language=Bulgarian +ERROR_ACCESS_DISABLED_BY_POLICY - Windows cannot open this program because it has been prevented by a software restriction policy. For more information, open Event Viewer or contact your system administrator. +. + +MessageId=1261 +Severity=Success +Facility=System +SymbolicName=ERROR_REG_NAT_CONSUMPTION +Language=Bulgarian +ERROR_REG_NAT_CONSUMPTION - A program attempt to use an invalid register value. Normally caused by an uninitialized register. This error is Itanium specific. +. + +MessageId=1262 +Severity=Success +Facility=System +SymbolicName=ERROR_CSCSHARE_OFFLINE +Language=Bulgarian +ERROR_CSCSHARE_OFFLINE - The share is currently offline or does not exist. +. + +MessageId=1263 +Severity=Success +Facility=System +SymbolicName=ERROR_PKINIT_FAILURE +Language=Bulgarian +ERROR_PKINIT_FAILURE - The kerberos protocol encountered an error while validating the KDC certificate during smartcard logon. +. + +MessageId=1264 +Severity=Success +Facility=System +SymbolicName=ERROR_SMARTCARD_SUBSYSTEM_FAILURE +Language=Bulgarian +ERROR_SMARTCARD_SUBSYSTEM_FAILURE - The kerberos protocol encountered an error while attempting to utilize the smartcard subsystem. +. + +MessageId=1265 +Severity=Success +Facility=System +SymbolicName=ERROR_DOWNGRADE_DETECTED +Language=Bulgarian +ERROR_DOWNGRADE_DETECTED - The system detected a possible attempt to compromise security. Please ensure that you can contact the server that authenticated you. +. + +MessageId=1266 +Severity=Success +Facility=System +SymbolicName=SEC_E_SMARTCARD_CERT_REVOKED +Language=Bulgarian +SEC_E_SMARTCARD_CERT_REVOKED - The smartcard certificate used for authentication has been revoked. Please contact your system administrator. There may be additional information in the event log. +. + +MessageId=1267 +Severity=Success +Facility=System +SymbolicName=SEC_E_ISSUING_CA_UNTRUSTED +Language=Bulgarian +SEC_E_ISSUING_CA_UNTRUSTED - An untrusted certificate authority was detected while processing the smartcard certificate used for authentication. Please contact your system administrator. +. + +MessageId=1268 +Severity=Success +Facility=System +SymbolicName=SEC_E_REVOCATION_OFFLINE_C +Language=Bulgarian +SEC_E_REVOCATION_OFFLINE_C - The revocation status of the smartcard certificate used for authentication could not be determined. Please contact your system administrator. +. + +MessageId=1269 +Severity=Success +Facility=System +SymbolicName=SEC_E_PKINIT_CLIENT_FAILUR +Language=Bulgarian +SEC_E_PKINIT_CLIENT_FAILUR - The smartcard certificate used for authentication was not trusted. Please contact your system administrator. +. + +MessageId=1270 +Severity=Success +Facility=System +SymbolicName=SEC_E_SMARTCARD_CERT_EXPIRED +Language=Bulgarian +SEC_E_SMARTCARD_CERT_EXPIRED - The smartcard certificate used for authentication has expired. Please contact your system administrator. +. + +MessageId=1271 +Severity=Success +Facility=System +SymbolicName=ERROR_MACHINE_LOCKED +Language=Bulgarian +ERROR_MACHINE_LOCKED - The machine is locked and cannot be shut down without the force option. +. + +MessageId=1273 +Severity=Success +Facility=System +SymbolicName=ERROR_CALLBACK_SUPPLIED_INVALID_DATA +Language=Bulgarian +ERROR_CALLBACK_SUPPLIED_INVALID_DATA - An application-defined callback gave invalid data when called. +. + +MessageId=1274 +Severity=Success +Facility=System +SymbolicName=ERROR_SYNC_FOREGROUND_REFRESH_REQUIRED +Language=Bulgarian +ERROR_SYNC_FOREGROUND_REFRESH_REQUIRED - The group policy framework should call the extension in the synchronous foreground policy refresh. +. + +MessageId=1275 +Severity=Success +Facility=System +SymbolicName=ERROR_DRIVER_BLOCKED +Language=Bulgarian +ERROR_DRIVER_BLOCKED - This driver has been blocked from loading. +. + +MessageId=1276 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_IMPORT_OF_NON_DLL +Language=Bulgarian +ERROR_INVALID_IMPORT_OF_NON_DLL - A dynamic link library (DLL) referenced a module that was neither a DLL nor the process's executable image. +. + +MessageId=1277 +Severity=Success +Facility=System +SymbolicName=ERROR_ACCESS_DISABLED_WEBBLADE +Language=Bulgarian +ERROR_ACCESS_DISABLED_WEBBLADE - Windows cannot open this program since it has been disabled. +. + +MessageId=1278 +Severity=Success +Facility=System +SymbolicName=ERROR_ACCESS_DISABLED_WEBBLADE_TAMPER +Language=Bulgarian +ERROR_ACCESS_DISABLED_WEBBLADE_TAMPER - Windows cannot open this program because the license enforcement system has been tampered with or become corrupted. +. + +MessageId=1279 +Severity=Success +Facility=System +SymbolicName=ERROR_RECOVERY_FAILURE +Language=Bulgarian +ERROR_RECOVERY_FAILURE - A transaction recovery failed. +. + +MessageId=1280 +Severity=Success +Facility=System +SymbolicName=ERROR_ALREADY_FIBER +Language=Bulgarian +ERROR_ALREADY_FIBER - The current thread has already been converted to a fiber. +. + +MessageId=1281 +Severity=Success +Facility=System +SymbolicName=ERROR_ALREADY_THREAD +Language=Bulgarian +ERROR_ALREADY_THREAD - The current thread has already been converted from a fiber. +. + +MessageId=1282 +Severity=Success +Facility=System +SymbolicName=ERROR_STACK_BUFFER_OVERRUN +Language=Bulgarian +ERROR_STACK_BUFFER_OVERRUN - The system detected an overrun of a stack-based buffer in this application. This overrun could potentially allow a malicious user to gain control of this application. +. + +MessageId=1283 +Severity=Success +Facility=System +SymbolicName=ERROR_PARAMETER_QUOTA_EXCEEDED +Language=Bulgarian +ERROR_PARAMETER_QUOTA_EXCEEDED - Data present in one of the parameters is more than the function can operate on. +. + +MessageId=1284 +Severity=Success +Facility=System +SymbolicName=ERROR_DEBUGGER_INACTIVE +Language=Bulgarian +ERROR_DEBUGGER_INACTIVE - An attempt to do an operation on a debug object failed because the object is in the process of being deleted. +. + +MessageId=1285 +Severity=Success +Facility=System +SymbolicName=ERROR_DELAY_LOAD_FAILED +Language=Bulgarian +ERROR_DELAY_LOAD_FAILED - An attempt to delay-load a .dll or get a function address in a delay-loaded .dll failed. +. + +MessageId=1286 +Severity=Success +Facility=System +SymbolicName=ERROR_VDM_DISALLOWED +Language=Bulgarian +ERROR_VDM_DISALLOWED - %1 is a 16-bit application. You do not have permissions to execute 16-bit applications. Check your permissions with your system administrator. +. + +MessageId=1287 +Severity=Success +Facility=System +SymbolicName=ERROR_UNIDENTIFIED_ERROR +Language=Bulgarian +ERROR_UNIDENTIFIED_ERROR - Insufficient information exists to identify the cause of failure. +. + +MessageId=1288 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_BANDWIDTH_PARAMETERS +Language=Bulgarian +ERROR_INVALID_BANDWIDTH_PARAMETERS - An invalid budget or period parameter was specified. +. + +MessageId=1289 +Severity=Success +Facility=System +SymbolicName=ERROR_AFFINITY_NOT_COMPATIBLE +Language=Bulgarian +ERROR_AFFINITY_NOT_COMPATIBLE - An attempt was made to join a thread to a reserve whose affinity did not intersect the reserve affinity or an attempt was made to associate a process with a reserve whose affinity did not intersect the reserve affinity. +. + +MessageId=1290 +Severity=Success +Facility=System +SymbolicName=ERROR_THREAD_ALREADY_IN_RESERVE +Language=Bulgarian +ERROR_THREAD_ALREADY_IN_RESERVE - An attempt was made to join a thread to a reserve which was already joined to another reserve. +. + +MessageId=1291 +Severity=Success +Facility=System +SymbolicName=ERROR_THREAD_NOT_IN_RESERVE +Language=Bulgarian +ERROR_THREAD_NOT_IN_RESERVE - An attempt was made to disjoin a thread from a reserve, but the thread was not joined to the reserve. +. + +MessageId=1292 +Severity=Success +Facility=System +SymbolicName=ERROR_THREAD_PROCESS_IN_RESERVE +Language=Bulgarian +ERROR_THREAD_PROCESS_IN_RESERVE - An attempt was made to disjoin a thread from a reserve whose process is associated with a reserve. +. + +MessageId=1293 +Severity=Success +Facility=System +SymbolicName=ERROR_PROCESS_ALREADY_IN_RESERVE +Language=Bulgarian +ERROR_PROCESS_ALREADY_IN_RESERVE - An attempt was made to associate a process with a reserve that was already associated with a reserve. +. + +MessageId=1294 +Severity=Success +Facility=System +SymbolicName=ERROR_PROCESS_NOT_IN_RESERVE +Language=Bulgarian +ERROR_PROCESS_NOT_IN_RESERVE - An attempt was made to disassociate a process from a reserve, but the process did not have an associated reserve. +. + +MessageId=1295 +Severity=Success +Facility=System +SymbolicName=ERROR_PROCESS_THREADS_IN_RESERVE +Language=Bulgarian +ERROR_PROCESS_THREADS_IN_RESERVE - An attempt was made to associate a process with a reserve, but the process contained thread joined to a reserve. +. + +MessageId=1296 +Severity=Success +Facility=System +SymbolicName=ERROR_AFFINITY_NOT_SET_IN_RESERVE +Language=Bulgarian +ERROR_AFFINITY_NOT_SET_IN_RESERVE - An attempt was made to set the affinity of a thread or a process, but the thread or process was joined or associated with a reserve. +. + +MessageId=1297 +Severity=Success +Facility=System +SymbolicName=ERROR_IMPLEMENTATION_LIMIT +Language=Bulgarian +ERROR_IMPLEMENTATION_LIMIT - An operation attempted to exceed an implementation-defined limit. +. + +MessageId=1298 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CACHE_ONLY +Language=Bulgarian +ERROR_DS_CACHE_ONLY - The requested object is for internal DS operations only. +. + +MessageId=1300 +Severity=Success +Facility=System +SymbolicName=ERROR_NOT_ALL_ASSIGNED +Language=Bulgarian +ERROR_NOT_ALL_ASSIGNED - Not all privileges referenced are assigned to the caller. +. + +MessageId=1301 +Severity=Success +Facility=System +SymbolicName=ERROR_SOME_NOT_MAPPED +Language=Bulgarian +ERROR_SOME_NOT_MAPPED - Some mapping between account names and security IDs was not done. +. + +MessageId=1302 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_QUOTAS_FOR_ACCOUNT +Language=Bulgarian +ERROR_NO_QUOTAS_FOR_ACCOUNT - No system quota limits are specifically set for this account. +. + +MessageId=1303 +Severity=Success +Facility=System +SymbolicName=ERROR_LOCAL_USER_SESSION_KEY +Language=Bulgarian +ERROR_LOCAL_USER_SESSION_KEY - No encryption key is available. A well-known encryption key was returned. +. + +MessageId=1304 +Severity=Success +Facility=System +SymbolicName=ERROR_NULL_LM_PASSWORD +Language=Bulgarian +ERROR_NULL_LM_PASSWORD - The password is too complex to be converted to a LAN Manager password. The LAN Manager password returned is a NULL string. +. + +MessageId=1305 +Severity=Success +Facility=System +SymbolicName=ERROR_UNKNOWN_REVISION +Language=Bulgarian +ERROR_UNKNOWN_REVISION - The revision level is unknown. +. + +MessageId=1306 +Severity=Success +Facility=System +SymbolicName=ERROR_REVISION_MISMATCH +Language=Bulgarian +ERROR_REVISION_MISMATCH - Indicates two revision levels are incompatible. +. + +MessageId=1307 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_OWNER +Language=Bulgarian +ERROR_INVALID_OWNER - This security ID may not be assigned as the owner of this object. +. + +MessageId=1308 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_PRIMARY_GROUP +Language=Bulgarian +ERROR_INVALID_PRIMARY_GROUP - This security ID may not be assigned as the primary group of an object. +. + +MessageId=1309 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_IMPERSONATION_TOKEN +Language=Bulgarian +ERROR_NO_IMPERSONATION_TOKEN - An attempt has been made to operate on an impersonation token by a thread that is not currently impersonating a client. +. + +MessageId=1310 +Severity=Success +Facility=System +SymbolicName=ERROR_CANT_DISABLE_MANDATORY +Language=Bulgarian +ERROR_CANT_DISABLE_MANDATORY - The group may not be disabled. +. + +MessageId=1311 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_LOGON_SERVERS +Language=Bulgarian +ERROR_NO_LOGON_SERVERS - There are currently no logon servers available to service the logon request. +. + +MessageId=1312 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_SUCH_LOGON_SESSION +Language=Bulgarian +ERROR_NO_SUCH_LOGON_SESSION - A specified logon session does not exist. It may already have been terminated. +. + +MessageId=1313 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_SUCH_PRIVILEGE +Language=Bulgarian +ERROR_NO_SUCH_PRIVILEGE - A specified privilege does not exist. +. + +MessageId=1314 +Severity=Success +Facility=System +SymbolicName=ERROR_PRIVILEGE_NOT_HELD +Language=Bulgarian +ERROR_PRIVILEGE_NOT_HELD - A required privilege is not held by the client. +. + +MessageId=1315 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_ACCOUNT_NAME +Language=Bulgarian +ERROR_INVALID_ACCOUNT_NAME - The name provided is not a properly formed account name. +. + +MessageId=1316 +Severity=Success +Facility=System +SymbolicName=ERROR_USER_EXISTS +Language=Bulgarian +ERROR_USER_EXISTS - The specified user already exists. +. + +MessageId=1317 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_SUCH_USER +Language=Bulgarian +ERROR_NO_SUCH_USER - The specified user does not exist. +. + +MessageId=1318 +Severity=Success +Facility=System +SymbolicName=ERROR_GROUP_EXISTS +Language=Bulgarian +ERROR_GROUP_EXISTS - The specified group already exists. +. + +MessageId=1319 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_SUCH_GROUP +Language=Bulgarian +ERROR_NO_SUCH_GROUP - The specified group does not exist. +. + +MessageId=1320 +Severity=Success +Facility=System +SymbolicName=ERROR_MEMBER_IN_GROUP +Language=Bulgarian +ERROR_MEMBER_IN_GROUP - Either the specified user account is already a member of the specified group, or the specified group cannot be deleted because it contains a member. +. + +MessageId=1321 +Severity=Success +Facility=System +SymbolicName=ERROR_MEMBER_NOT_IN_GROUP +Language=Bulgarian +ERROR_MEMBER_NOT_IN_GROUP - The specified user account is not a member of the specified group account. +. + +MessageId=1322 +Severity=Success +Facility=System +SymbolicName=ERROR_LAST_ADMIN +Language=Bulgarian +ERROR_LAST_ADMIN - The last remaining administration account cannot be disabled or deleted. +. + +MessageId=1323 +Severity=Success +Facility=System +SymbolicName=ERROR_WRONG_PASSWORD +Language=Bulgarian +ERROR_WRONG_PASSWORD - Unable to update the password. The value provided as the current password is incorrect. +. + +MessageId=1324 +Severity=Success +Facility=System +SymbolicName=ERROR_ILL_FORMED_PASSWORD +Language=Bulgarian +ERROR_ILL_FORMED_PASSWORD - Unable to update the password. The value provided for the new password contains values that are not allowed in passwords. +. + +MessageId=1325 +Severity=Success +Facility=System +SymbolicName=ERROR_PASSWORD_RESTRICTION +Language=Bulgarian +ERROR_PASSWORD_RESTRICTION - Unable to update the password. The value provided for the new password does not meet the length, complexity, or history requirement of the domain. +. + +MessageId=1326 +Severity=Success +Facility=System +SymbolicName=ERROR_LOGON_FAILURE +Language=Bulgarian +ERROR_LOGON_FAILURE - Logon failure: unknown user name or bad password. +. + +MessageId=1327 +Severity=Success +Facility=System +SymbolicName=ERROR_ACCOUNT_RESTRICTION +Language=Bulgarian +ERROR_ACCOUNT_RESTRICTION - Logon failure: user account restriction. Possible reasons are blank passwords not allowed, logon hour restrictions, or a policy restriction has been enforced. +. + +MessageId=1328 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_LOGON_HOURS +Language=Bulgarian +ERROR_INVALID_LOGON_HOURS - Logon failure: account logon time restriction violation. +. + +MessageId=1329 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_WORKSTATION +Language=Bulgarian +ERROR_INVALID_WORKSTATION - Logon failure: user not allowed to log on to this computer. +. + +MessageId=1330 +Severity=Success +Facility=System +SymbolicName=ERROR_PASSWORD_EXPIRED +Language=Bulgarian +ERROR_PASSWORD_EXPIRED - Logon failure: the specified account password has expired. +. + +MessageId=1331 +Severity=Success +Facility=System +SymbolicName=ERROR_ACCOUNT_DISABLED +Language=Bulgarian +ERROR_ACCOUNT_DISABLED - Logon failure: account currently disabled. +. + +MessageId=1332 +Severity=Success +Facility=System +SymbolicName=ERROR_NONE_MAPPED +Language=Bulgarian +ERROR_NONE_MAPPED - No mapping between account names and security IDs was done. +. + +MessageId=1333 +Severity=Success +Facility=System +SymbolicName=ERROR_TOO_MANY_LUIDS_REQUESTED +Language=Bulgarian +ERROR_TOO_MANY_LUIDS_REQUESTED - Too many local user identifiers (LUIDs) were requested at one time. +. + +MessageId=1334 +Severity=Success +Facility=System +SymbolicName=ERROR_LUIDS_EXHAUSTED +Language=Bulgarian +ERROR_LUIDS_EXHAUSTED - No more local user identifiers (LUIDs) are available. +. + +MessageId=1335 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_SUB_AUTHORITY +Language=Bulgarian +ERROR_INVALID_SUB_AUTHORITY - The subauthority part of a security ID is invalid for this particular use. +. + +MessageId=1336 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_ACL +Language=Bulgarian +ERROR_INVALID_ACL - The access control list (ACL) structure is invalid. +. + +MessageId=1337 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_SID +Language=Bulgarian +ERROR_INVALID_SID - The security ID structure is invalid. +. + +MessageId=1338 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_SECURITY_DESCR +Language=Bulgarian +ERROR_INVALID_SECURITY_DESCR - The security descriptor structure is invalid. +. + +MessageId=1340 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_INHERITANCE_ACL +Language=Bulgarian +ERROR_BAD_INHERITANCE_ACL - The inherited access control list (ACL) or access control entry (ACE) could not be built. +. + +MessageId=1341 +Severity=Success +Facility=System +SymbolicName=ERROR_SERVER_DISABLED +Language=Bulgarian +ERROR_SERVER_DISABLED - The server is currently disabled. +. + +MessageId=1342 +Severity=Success +Facility=System +SymbolicName=ERROR_SERVER_NOT_DISABLED +Language=Bulgarian +ERROR_SERVER_NOT_DISABLED - The server is currently enabled. +. + +MessageId=1343 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_ID_AUTHORITY +Language=Bulgarian +ERROR_INVALID_ID_AUTHORITY - The value provided was an invalid value for an identifier authority. +. + +MessageId=1344 +Severity=Success +Facility=System +SymbolicName=ERROR_ALLOTTED_SPACE_EXCEEDED +Language=Bulgarian +ERROR_ALLOTTED_SPACE_EXCEEDED - No more memory is available for security information updates. +. + +MessageId=1345 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_GROUP_ATTRIBUTES +Language=Bulgarian +ERROR_INVALID_GROUP_ATTRIBUTES - The specified attributes are invalid, or incompatible with the attributes for the group as a whole. +. + +MessageId=1346 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_IMPERSONATION_LEVEL +Language=Bulgarian +ERROR_BAD_IMPERSONATION_LEVEL - Either a required impersonation level was not provided, or the provided impersonation level is invalid. +. + +MessageId=1347 +Severity=Success +Facility=System +SymbolicName=ERROR_CANT_OPEN_ANONYMOUS +Language=Bulgarian +ERROR_CANT_OPEN_ANONYMOUS - Cannot open an anonymous level security token. +. + +MessageId=1348 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_VALIDATION_CLASS +Language=Bulgarian +ERROR_BAD_VALIDATION_CLASS - The validation information class requested was invalid. +. + +MessageId=1349 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_TOKEN_TYPE +Language=Bulgarian +ERROR_BAD_TOKEN_TYPE - The type of the token is inappropriate for its attempted use. +. + +MessageId=1350 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_SECURITY_ON_OBJECT +Language=Bulgarian +ERROR_NO_SECURITY_ON_OBJECT - Unable to perform a security operation on an object that has no associated security. +. + +MessageId=1351 +Severity=Success +Facility=System +SymbolicName=ERROR_CANT_ACCESS_DOMAIN_INFO +Language=Bulgarian +ERROR_CANT_ACCESS_DOMAIN_INFO - Configuration information could not be read from the domain controller, either because the machine is unavailable, or access has been denied. +. + +MessageId=1352 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_SERVER_STATE +Language=Bulgarian +ERROR_INVALID_SERVER_STATE - The security account manager (SAM) or local security authority (LSA) server was in the wrong state to perform the security operation. +. + +MessageId=1353 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_DOMAIN_STATE +Language=Bulgarian +ERROR_INVALID_DOMAIN_STATE - The domain was in the wrong state to perform the security operation. +. + +MessageId=1354 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_DOMAIN_ROLE +Language=Bulgarian +ERROR_INVALID_DOMAIN_ROLE - This operation is only allowed for the Primary Domain Controller of the domain. +. + +MessageId=1355 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_SUCH_DOMAIN +Language=Bulgarian +ERROR_NO_SUCH_DOMAIN - The specified domain either does not exist or could not be contacted. +. + +MessageId=1356 +Severity=Success +Facility=System +SymbolicName=ERROR_DOMAIN_EXISTS +Language=Bulgarian +ERROR_DOMAIN_EXISTS - The specified domain already exists. +. + +MessageId=1357 +Severity=Success +Facility=System +SymbolicName=ERROR_DOMAIN_LIMIT_EXCEEDED +Language=Bulgarian +ERROR_DOMAIN_LIMIT_EXCEEDED - An attempt was made to exceed the limit on the number of domains per server. +. + +MessageId=1358 +Severity=Success +Facility=System +SymbolicName=ERROR_INTERNAL_DB_CORRUPTION +Language=Bulgarian +ERROR_INTERNAL_DB_CORRUPTION - Unable to complete the requested operation because of either a catastrophic media failure or a data structure corruption on the disk. +. + +MessageId=1359 +Severity=Success +Facility=System +SymbolicName=ERROR_INTERNAL_ERROR +Language=Bulgarian +ERROR_INTERNAL_ERROR - An internal error occurred. +. + +MessageId=1360 +Severity=Success +Facility=System +SymbolicName=ERROR_GENERIC_NOT_MAPPED +Language=Bulgarian +ERROR_GENERIC_NOT_MAPPED - Generic access types were contained in an access mask which should already be mapped to nongeneric types. +. + +MessageId=1361 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_DESCRIPTOR_FORMAT +Language=Bulgarian +ERROR_BAD_DESCRIPTOR_FORMAT - A security descriptor is not in the right format (absolute or self-relative). +. + +MessageId=1362 +Severity=Success +Facility=System +SymbolicName=ERROR_NOT_LOGON_PROCESS +Language=Bulgarian +ERROR_NOT_LOGON_PROCESS - The requested action is restricted for use by logon processes only. The calling process has not registered as a logon process. +. + +MessageId=1363 +Severity=Success +Facility=System +SymbolicName=ERROR_LOGON_SESSION_EXISTS +Language=Bulgarian +ERROR_LOGON_SESSION_EXISTS - Cannot start a new logon session with an ID that is already in use. +. + +MessageId=1364 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_SUCH_PACKAGE +Language=Bulgarian +ERROR_NO_SUCH_PACKAGE - A specified authentication package is unknown. +. + +MessageId=1365 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_LOGON_SESSION_STATE +Language=Bulgarian +ERROR_BAD_LOGON_SESSION_STATE - The logon session is not in a state that is consistent with the requested operation. +. + +MessageId=1366 +Severity=Success +Facility=System +SymbolicName=ERROR_LOGON_SESSION_COLLISION +Language=Bulgarian +ERROR_LOGON_SESSION_COLLISION - The logon session ID is already in use. +. + +MessageId=1367 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_LOGON_TYPE +Language=Bulgarian +ERROR_INVALID_LOGON_TYPE - A logon request contained an invalid logon type value. +. + +MessageId=1368 +Severity=Success +Facility=System +SymbolicName=ERROR_CANNOT_IMPERSONATE +Language=Bulgarian +ERROR_CANNOT_IMPERSONATE - Unable to impersonate using a named pipe until data has been read from that pipe. +. + +MessageId=1369 +Severity=Success +Facility=System +SymbolicName=ERROR_RXACT_INVALID_STATE +Language=Bulgarian +ERROR_RXACT_INVALID_STATE - The transaction state of a registry subtree is incompatible with the requested operation. +. + +MessageId=1370 +Severity=Success +Facility=System +SymbolicName=ERROR_RXACT_COMMIT_FAILURE +Language=Bulgarian +ERROR_RXACT_COMMIT_FAILURE - An internal security database corruption has been encountered. +. + +MessageId=1371 +Severity=Success +Facility=System +SymbolicName=ERROR_SPECIAL_ACCOUNT +Language=Bulgarian +ERROR_SPECIAL_ACCOUNT - Cannot perform this operation on built-in accounts. +. + +MessageId=1372 +Severity=Success +Facility=System +SymbolicName=ERROR_SPECIAL_GROUP +Language=Bulgarian +ERROR_SPECIAL_GROUP - Cannot perform this operation on this built-in special group. +. + +MessageId=1373 +Severity=Success +Facility=System +SymbolicName=ERROR_SPECIAL_USER +Language=Bulgarian +ERROR_SPECIAL_USER - Cannot perform this operation on this built-in special user. +. + +MessageId=1374 +Severity=Success +Facility=System +SymbolicName=ERROR_MEMBERS_PRIMARY_GROUP +Language=Bulgarian +ERROR_MEMBERS_PRIMARY_GROUP - The user cannot be removed from a group because the group is currently the user's primary group. +. + +MessageId=1375 +Severity=Success +Facility=System +SymbolicName=ERROR_TOKEN_ALREADY_IN_USE +Language=Bulgarian +ERROR_TOKEN_ALREADY_IN_USE - The token is already in use as a primary token. +. + +MessageId=1376 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_SUCH_ALIAS +Language=Bulgarian +ERROR_NO_SUCH_ALIAS - The specified local group does not exist. +. + +MessageId=1377 +Severity=Success +Facility=System +SymbolicName=ERROR_MEMBER_NOT_IN_ALIAS +Language=Bulgarian +ERROR_MEMBER_NOT_IN_ALIAS - The specified account name is not a member of the local group. +. + +MessageId=1378 +Severity=Success +Facility=System +SymbolicName=ERROR_MEMBER_IN_ALIAS +Language=Bulgarian +ERROR_MEMBER_IN_ALIAS - The specified account name is already a member of the local group. +. + +MessageId=1379 +Severity=Success +Facility=System +SymbolicName=ERROR_ALIAS_EXISTS +Language=Bulgarian +ERROR_ALIAS_EXISTS - The specified local group already exists. +. + +MessageId=1380 +Severity=Success +Facility=System +SymbolicName=ERROR_LOGON_NOT_GRANTED +Language=Bulgarian +ERROR_LOGON_NOT_GRANTED - Logon failure: the user has not been granted the requested logon type at this computer. +. + +MessageId=1381 +Severity=Success +Facility=System +SymbolicName=ERROR_TOO_MANY_SECRETS +Language=Bulgarian +ERROR_TOO_MANY_SECRETS - The maximum number of secrets that may be stored in a single system has been exceeded. +. + +MessageId=1382 +Severity=Success +Facility=System +SymbolicName=ERROR_SECRET_TOO_LONG +Language=Bulgarian +ERROR_SECRET_TOO_LONG - The length of a secret exceeds the maximum length allowed. +. + +MessageId=1383 +Severity=Success +Facility=System +SymbolicName=ERROR_INTERNAL_DB_ERROR +Language=Bulgarian +ERROR_INTERNAL_DB_ERROR - The local security authority database contains an internal inconsistency. +. + +MessageId=1384 +Severity=Success +Facility=System +SymbolicName=ERROR_TOO_MANY_CONTEXT_IDS +Language=Bulgarian +ERROR_TOO_MANY_CONTEXT_IDS - During a logon attempt, the user's security context accumulated too many security IDs. +. + +MessageId=1385 +Severity=Success +Facility=System +SymbolicName=ERROR_LOGON_TYPE_NOT_GRANTED +Language=Bulgarian +ERROR_LOGON_TYPE_NOT_GRANTED - Logon failure: the user has not been granted the requested logon type at this computer. +. + +MessageId=1386 +Severity=Success +Facility=System +SymbolicName=ERROR_NT_CROSS_ENCRYPTION_REQUIRED +Language=Bulgarian +ERROR_NT_CROSS_ENCRYPTION_REQUIRED - A cross-encrypted password is necessary to change a user password. +. + +MessageId=1387 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_SUCH_MEMBER +Language=Bulgarian +ERROR_NO_SUCH_MEMBER - A new member could not be added to or removed from the local group because the member does not exist. +. + +MessageId=1388 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_MEMBER +Language=Bulgarian +ERROR_INVALID_MEMBER - A new member could not be added to a local group because the member has the wrong account type. +. + +MessageId=1389 +Severity=Success +Facility=System +SymbolicName=ERROR_TOO_MANY_SIDS +Language=Bulgarian +ERROR_TOO_MANY_SIDS - Too many security IDs have been specified. +. + +MessageId=1390 +Severity=Success +Facility=System +SymbolicName=ERROR_LM_CROSS_ENCRYPTION_REQUIRED +Language=Bulgarian +ERROR_LM_CROSS_ENCRYPTION_REQUIRED - A cross-encrypted password is necessary to change this user password. +. + +MessageId=1391 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_INHERITANCE +Language=Bulgarian +ERROR_NO_INHERITANCE - Indicates an ACL contains no inheritable components. +. + +MessageId=1392 +Severity=Success +Facility=System +SymbolicName=ERROR_FILE_CORRUPT +Language=Bulgarian +ERROR_FILE_CORRUPT - The file or directory is corrupted and unreadable. +. + +MessageId=1393 +Severity=Success +Facility=System +SymbolicName=ERROR_DISK_CORRUPT +Language=Bulgarian +ERROR_DISK_CORRUPT - The disk structure is corrupted and unreadable. +. + +MessageId=1394 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_USER_SESSION_KEY +Language=Bulgarian +ERROR_NO_USER_SESSION_KEY - There is no user session key for the specified logon session. +. + +MessageId=1395 +Severity=Success +Facility=System +SymbolicName=ERROR_LICENSE_QUOTA_EXCEEDED +Language=Bulgarian +ERROR_LICENSE_QUOTA_EXCEEDED - The service being accessed is licensed for a particular number of connections. No more connections can be made to the service at this time because there are already as many connections as the service can accept. +. + +MessageId=1396 +Severity=Success +Facility=System +SymbolicName=ERROR_WRONG_TARGET_NAME +Language=Bulgarian +ERROR_WRONG_TARGET_NAME - Logon Failure: The target account name is incorrect. +. + +MessageId=1397 +Severity=Success +Facility=System +SymbolicName=ERROR_MUTUAL_AUTH_FAILED +Language=Bulgarian +ERROR_MUTUAL_AUTH_FAILED - Mutual Authentication failed. The server's password is out of date at the domain controller. +. + +MessageId=1398 +Severity=Success +Facility=System +SymbolicName=ERROR_TIME_SKEW +Language=Bulgarian +ERROR_TIME_SKEW - There is a time and/or date difference between the client and server. +. + +MessageId=1399 +Severity=Success +Facility=System +SymbolicName=ERROR_CURRENT_DOMAIN_NOT_ALLOWED +Language=Bulgarian +ERROR_CURRENT_DOMAIN_NOT_ALLOWED - This operation cannot be performed on the current domain. +. + +MessageId=1400 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_WINDOW_HANDLE +Language=Bulgarian +ERROR_INVALID_WINDOW_HANDLE - Invalid window handle. +. + +MessageId=1401 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_MENU_HANDLE +Language=Bulgarian +ERROR_INVALID_MENU_HANDLE - Invalid menu handle. +. + +MessageId=1402 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_CURSOR_HANDLE +Language=Bulgarian +ERROR_INVALID_CURSOR_HANDLE - Invalid cursor handle. +. + +MessageId=1403 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_ACCEL_HANDLE +Language=Bulgarian +ERROR_INVALID_ACCEL_HANDLE - Invalid accelerator table handle. +. + +MessageId=1404 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_HOOK_HANDLE +Language=Bulgarian +ERROR_INVALID_HOOK_HANDLE - Invalid hook handle. +. + +MessageId=1405 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_DWP_HANDLE +Language=Bulgarian +ERROR_INVALID_DWP_HANDLE - Invalid handle to a multiple-window position structure. +. + +MessageId=1406 +Severity=Success +Facility=System +SymbolicName=ERROR_TLW_WITH_WSCHILD +Language=Bulgarian +ERROR_TLW_WITH_WSCHILD - Cannot create a top-level child window. +. + +MessageId=1407 +Severity=Success +Facility=System +SymbolicName=ERROR_CANNOT_FIND_WND_CLASS +Language=Bulgarian +ERROR_CANNOT_FIND_WND_CLASS - Cannot find window class. +. + +MessageId=1408 +Severity=Success +Facility=System +SymbolicName=ERROR_WINDOW_OF_OTHER_THREAD +Language=Bulgarian +ERROR_WINDOW_OF_OTHER_THREAD - Invalid window; it belongs to other thread. +. + +MessageId=1409 +Severity=Success +Facility=System +SymbolicName=ERROR_HOTKEY_ALREADY_REGISTERED +Language=Bulgarian +ERROR_HOTKEY_ALREADY_REGISTERED - Hot key is already registered. +. + +MessageId=1410 +Severity=Success +Facility=System +SymbolicName=ERROR_CLASS_ALREADY_EXISTS +Language=Bulgarian +ERROR_CLASS_ALREADY_EXISTS - Class already exists. +. + +MessageId=1411 +Severity=Success +Facility=System +SymbolicName=ERROR_CLASS_DOES_NOT_EXIST +Language=Bulgarian +ERROR_CLASS_DOES_NOT_EXIST - Class does not exist. +. + +MessageId=1412 +Severity=Success +Facility=System +SymbolicName=ERROR_CLASS_HAS_WINDOWS +Language=Bulgarian +ERROR_CLASS_HAS_WINDOWS - Class still has open windows. +. + +MessageId=1413 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_INDEX +Language=Bulgarian +ERROR_INVALID_INDEX - Invalid index. +. + +MessageId=1414 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_ICON_HANDLE +Language=Bulgarian +ERROR_INVALID_ICON_HANDLE - Invalid icon handle. +. + +MessageId=1415 +Severity=Success +Facility=System +SymbolicName=ERROR_PRIVATE_DIALOG_INDEX +Language=Bulgarian +ERROR_PRIVATE_DIALOG_INDEX - Using private DIALOG window words. +. + +MessageId=1416 +Severity=Success +Facility=System +SymbolicName=ERROR_LISTBOX_ID_NOT_FOUND +Language=Bulgarian +ERROR_LISTBOX_ID_NOT_FOUND - The list box identifier was not found. +. + +MessageId=1417 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_WILDCARD_CHARACTERS +Language=Bulgarian +ERROR_NO_WILDCARD_CHARACTERS - No wildcards were found. +. + +MessageId=1418 +Severity=Success +Facility=System +SymbolicName=ERROR_CLIPBOARD_NOT_OPEN +Language=Bulgarian +ERROR_CLIPBOARD_NOT_OPEN - Thread does not have a clipboard open. +. + +MessageId=1419 +Severity=Success +Facility=System +SymbolicName=ERROR_HOTKEY_NOT_REGISTERED +Language=Bulgarian +ERROR_HOTKEY_NOT_REGISTERED - Hot key is not registered. +. + +MessageId=1420 +Severity=Success +Facility=System +SymbolicName=ERROR_WINDOW_NOT_DIALOG +Language=Bulgarian +ERROR_WINDOW_NOT_DIALOG - The window is not a valid dialog window. +. + +MessageId=1421 +Severity=Success +Facility=System +SymbolicName=ERROR_CONTROL_ID_NOT_FOUND +Language=Bulgarian +ERROR_CONTROL_ID_NOT_FOUND - Control ID not found. +. + +MessageId=1422 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_COMBOBOX_MESSAGE +Language=Bulgarian +ERROR_INVALID_COMBOBOX_MESSAGE - Invalid message for a combo box because it does not have an edit control. +. + +MessageId=1423 +Severity=Success +Facility=System +SymbolicName=ERROR_WINDOW_NOT_COMBOBOX +Language=Bulgarian +ERROR_WINDOW_NOT_COMBOBOX - The window is not a combo box. +. + +MessageId=1424 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_EDIT_HEIGHT +Language=Bulgarian +ERROR_INVALID_EDIT_HEIGHT - Height must be less than 256. +. + +MessageId=1425 +Severity=Success +Facility=System +SymbolicName=ERROR_DC_NOT_FOUND +Language=Bulgarian +ERROR_DC_NOT_FOUND - Invalid device context (DC) handle. +. + +MessageId=1426 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_HOOK_FILTER +Language=Bulgarian +ERROR_INVALID_HOOK_FILTER - Invalid hook procedure type. +. + +MessageId=1427 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_FILTER_PROC +Language=Bulgarian +ERROR_INVALID_FILTER_PROC - Invalid hook procedure. +. + +MessageId=1428 +Severity=Success +Facility=System +SymbolicName=ERROR_HOOK_NEEDS_HMOD +Language=Bulgarian +ERROR_HOOK_NEEDS_HMOD - Cannot set nonlocal hook without a module handle. +. + +MessageId=1429 +Severity=Success +Facility=System +SymbolicName=ERROR_GLOBAL_ONLY_HOOK +Language=Bulgarian +ERROR_GLOBAL_ONLY_HOOK - This hook procedure can only be set globally. +. + +MessageId=1430 +Severity=Success +Facility=System +SymbolicName=ERROR_JOURNAL_HOOK_SET +Language=Bulgarian +ERROR_JOURNAL_HOOK_SET - The journal hook procedure is already installed. +. + +MessageId=1431 +Severity=Success +Facility=System +SymbolicName=ERROR_HOOK_NOT_INSTALLED +Language=Bulgarian +ERROR_HOOK_NOT_INSTALLED - The hook procedure is not installed. +. + +MessageId=1432 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_LB_MESSAGE +Language=Bulgarian +ERROR_INVALID_LB_MESSAGE - Invalid message for single-selection list box. +. + +MessageId=1433 +Severity=Success +Facility=System +SymbolicName=ERROR_SETCOUNT_ON_BAD_LB +Language=Bulgarian +ERROR_SETCOUNT_ON_BAD_LB - LB_SETCOUNT sent to non-lazy list box. +. + +MessageId=1434 +Severity=Success +Facility=System +SymbolicName=ERROR_LB_WITHOUT_TABSTOPS +Language=Bulgarian +ERROR_LB_WITHOUT_TABSTOPS - This list box does not support tab stops. +. + +MessageId=1435 +Severity=Success +Facility=System +SymbolicName=ERROR_DESTROY_OBJECT_OF_OTHER_THREAD +Language=Bulgarian +ERROR_DESTROY_OBJECT_OF_OTHER_THREAD - Cannot destroy object created by another thread. +. + +MessageId=1436 +Severity=Success +Facility=System +SymbolicName=ERROR_CHILD_WINDOW_MENU +Language=Bulgarian +ERROR_CHILD_WINDOW_MENU - Child windows cannot have menus. +. + +MessageId=1437 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_SYSTEM_MENU +Language=Bulgarian +ERROR_NO_SYSTEM_MENU - The window does not have a system menu. +. + +MessageId=1438 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_MSGBOX_STYLE +Language=Bulgarian +ERROR_INVALID_MSGBOX_STYLE - Invalid message box style. +. + +MessageId=1439 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_SPI_VALUE +Language=Bulgarian +ERROR_INVALID_SPI_VALUE - Invalid system-wide (SPI_*) parameter. +. + +MessageId=1440 +Severity=Success +Facility=System +SymbolicName=ERROR_SCREEN_ALREADY_LOCKED +Language=Bulgarian +ERROR_SCREEN_ALREADY_LOCKED - Screen already locked. +. + +MessageId=1441 +Severity=Success +Facility=System +SymbolicName=ERROR_HWNDS_HAVE_DIFF_PARENT +Language=Bulgarian +ERROR_HWNDS_HAVE_DIFF_PARENT - All handles to windows in a multiple-window position structure must have the same parent. +. + +MessageId=1442 +Severity=Success +Facility=System +SymbolicName=ERROR_NOT_CHILD_WINDOW +Language=Bulgarian +ERROR_NOT_CHILD_WINDOW - The window is not a child window. +. + +MessageId=1443 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_GW_COMMAND +Language=Bulgarian +ERROR_INVALID_GW_COMMAND - Invalid GW_* command. +. + +MessageId=1444 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_THREAD_ID +Language=Bulgarian +ERROR_INVALID_THREAD_ID - Invalid thread identifier. +. + +MessageId=1445 +Severity=Success +Facility=System +SymbolicName=ERROR_NON_MDICHILD_WINDOW +Language=Bulgarian +ERROR_NON_MDICHILD_WINDOW - Cannot process a message from a window that is not a multiple document interface (MDI) window. +. + +MessageId=1446 +Severity=Success +Facility=System +SymbolicName=ERROR_POPUP_ALREADY_ACTIVE +Language=Bulgarian +ERROR_POPUP_ALREADY_ACTIVE - Popup menu already active. +. + +MessageId=1447 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_SCROLLBARS +Language=Bulgarian +ERROR_NO_SCROLLBARS - The window does not have scroll bars. +. + +MessageId=1448 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_SCROLLBAR_RANGE +Language=Bulgarian +ERROR_INVALID_SCROLLBAR_RANGE - Scroll bar range cannot be greater than MAXLONG. +. + +MessageId=1449 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_SHOWWIN_COMMAND +Language=Bulgarian +ERROR_INVALID_SHOWWIN_COMMAND - Cannot show or remove the window in the way specified. +. + +MessageId=1450 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_SYSTEM_RESOURCES +Language=Bulgarian +ERROR_NO_SYSTEM_RESOURCES - Insufficient system resources exist to complete the requested service. +. + +MessageId=1451 +Severity=Success +Facility=System +SymbolicName=ERROR_NONPAGED_SYSTEM_RESOURCES +Language=Bulgarian +ERROR_NONPAGED_SYSTEM_RESOURCES - Insufficient system resources exist to complete the requested service. +. + +MessageId=1452 +Severity=Success +Facility=System +SymbolicName=ERROR_PAGED_SYSTEM_RESOURCES +Language=Bulgarian +ERROR_PAGED_SYSTEM_RESOURCES - Insufficient system resources exist to complete the requested service. +. + +MessageId=1453 +Severity=Success +Facility=System +SymbolicName=ERROR_WORKING_SET_QUOTA +Language=Bulgarian +ERROR_WORKING_SET_QUOTA - Insufficient quota to complete the requested service. +. + +MessageId=1454 +Severity=Success +Facility=System +SymbolicName=ERROR_PAGEFILE_QUOTA +Language=Bulgarian +ERROR_PAGEFILE_QUOTA - Insufficient quota to complete the requested service. +. + +MessageId=1455 +Severity=Success +Facility=System +SymbolicName=ERROR_COMMITMENT_LIMIT +Language=Bulgarian +ERROR_COMMITMENT_LIMIT - The paging file is too small for this operation to complete. +. + +MessageId=1456 +Severity=Success +Facility=System +SymbolicName=ERROR_MENU_ITEM_NOT_FOUND +Language=Bulgarian +ERROR_MENU_ITEM_NOT_FOUND - A menu item was not found. +. + +MessageId=1457 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_KEYBOARD_HANDLE +Language=Bulgarian +ERROR_INVALID_KEYBOARD_HANDLE - Invalid keyboard layout handle. +. + +MessageId=1458 +Severity=Success +Facility=System +SymbolicName=ERROR_HOOK_TYPE_NOT_ALLOWED +Language=Bulgarian +ERROR_HOOK_TYPE_NOT_ALLOWED - Hook type not allowed. +. + +MessageId=1459 +Severity=Success +Facility=System +SymbolicName=ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION +Language=Bulgarian +ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION - This operation requires an interactive window station. +. + +MessageId=1460 +Severity=Success +Facility=System +SymbolicName=ERROR_TIMEOUT +Language=Bulgarian +ERROR_TIMEOUT - This operation returned because the timeout period expired. +. + +MessageId=1461 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_MONITOR_HANDLE +Language=Bulgarian +ERROR_INVALID_MONITOR_HANDLE - Invalid monitor handle. +. + +MessageId=1500 +Severity=Success +Facility=System +SymbolicName=ERROR_EVENTLOG_FILE_CORRUPT +Language=Bulgarian +ERROR_EVENTLOG_FILE_CORRUPT - The event log file is corrupted. +. + +MessageId=1501 +Severity=Success +Facility=System +SymbolicName=ERROR_EVENTLOG_CANT_START +Language=Bulgarian +ERROR_EVENTLOG_CANT_START - No event log file could be opened, so the event logging service did not start. +. + +MessageId=1502 +Severity=Success +Facility=System +SymbolicName=ERROR_LOG_FILE_FULL +Language=Bulgarian +ERROR_LOG_FILE_FULL - The event log file is full. +. + +MessageId=1503 +Severity=Success +Facility=System +SymbolicName=ERROR_EVENTLOG_FILE_CHANGED +Language=Bulgarian +ERROR_EVENTLOG_FILE_CHANGED - The event log file has changed between read operations. +. + +MessageId=1601 +Severity=Success +Facility=System +SymbolicName=ERROR_INSTALL_SERVICE_FAILURE +Language=Bulgarian +ERROR_INSTALL_SERVICE_FAILURE - The Windows Installer service could not be accessed. This can occur if you are running Windows in safe mode, or if the Windows Installer is not correctly installed. Contact your support personnel for assistance. +. + +MessageId=1602 +Severity=Success +Facility=System +SymbolicName=ERROR_INSTALL_USEREXIT +Language=Bulgarian +ERROR_INSTALL_USEREXIT - User cancelled installation. +. + +MessageId=1603 +Severity=Success +Facility=System +SymbolicName=ERROR_INSTALL_FAILURE +Language=Bulgarian +ERROR_INSTALL_FAILURE - Fatal error during installation. +. + +MessageId=1604 +Severity=Success +Facility=System +SymbolicName=ERROR_INSTALL_SUSPEND +Language=Bulgarian +ERROR_INSTALL_SUSPEND - Installation suspended, incomplete. +. + +MessageId=1605 +Severity=Success +Facility=System +SymbolicName=ERROR_UNKNOWN_PRODUCT +Language=Bulgarian +ERROR_UNKNOWN_PRODUCT - This action is only valid for products that are currently installed. +. + +MessageId=1606 +Severity=Success +Facility=System +SymbolicName=ERROR_UNKNOWN_FEATURE +Language=Bulgarian +ERROR_UNKNOWN_FEATURE - Feature ID not registered. +. + +MessageId=1607 +Severity=Success +Facility=System +SymbolicName=ERROR_UNKNOWN_COMPONENT +Language=Bulgarian +ERROR_UNKNOWN_COMPONENT - Component ID not registered. +. + +MessageId=1608 +Severity=Success +Facility=System +SymbolicName=ERROR_UNKNOWN_PROPERTY +Language=Bulgarian +ERROR_UNKNOWN_PROPERTY - Unknown property. +. + +MessageId=1609 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_HANDLE_STATE +Language=Bulgarian +ERROR_INVALID_HANDLE_STATE - Handle is in an invalid state. +. + +MessageId=1610 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_CONFIGURATION +Language=Bulgarian +ERROR_BAD_CONFIGURATION - The configuration data for this product is corrupt. Contact your support personnel. +. + +MessageId=1611 +Severity=Success +Facility=System +SymbolicName=ERROR_INDEX_ABSENT +Language=Bulgarian +ERROR_INDEX_ABSENT - Component qualifier not present. +. + +MessageId=1612 +Severity=Success +Facility=System +SymbolicName=ERROR_INSTALL_SOURCE_ABSENT +Language=Bulgarian +ERROR_INSTALL_SOURCE_ABSENT - The installation source for this product is not available. Verify that the source exists and that you can access it. +. + +MessageId=1613 +Severity=Success +Facility=System +SymbolicName=ERROR_INSTALL_PACKAGE_VERSION +Language=Bulgarian +ERROR_INSTALL_PACKAGE_VERSION - This installation package cannot be installed by the Windows Installer service. You must install a Windows service pack that contains a newer version of the Windows Installer service. +. + +MessageId=1614 +Severity=Success +Facility=System +SymbolicName=ERROR_PRODUCT_UNINSTALLED +Language=Bulgarian +ERROR_PRODUCT_UNINSTALLED - Product is uninstalled. +. + +MessageId=1615 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_QUERY_SYNTAX +Language=Bulgarian +ERROR_BAD_QUERY_SYNTAX - SQL query syntax invalid or unsupported. +. + +MessageId=1616 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_FIELD +Language=Bulgarian +ERROR_INVALID_FIELD - Record field does not exist. +. + +MessageId=1617 +Severity=Success +Facility=System +SymbolicName=ERROR_DEVICE_REMOVED +Language=Bulgarian +ERROR_DEVICE_REMOVED - The device has been removed. +. + +MessageId=1618 +Severity=Success +Facility=System +SymbolicName=ERROR_INSTALL_ALREADY_RUNNING +Language=Bulgarian +ERROR_INSTALL_ALREADY_RUNNING - Another installation is already in progress. Complete that installation before proceeding with this install. +. + +MessageId=1619 +Severity=Success +Facility=System +SymbolicName=ERROR_INSTALL_PACKAGE_OPEN_FAILED +Language=Bulgarian +ERROR_INSTALL_PACKAGE_OPEN_FAILED - This installation package could not be opened. Verify that the package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer package. +. + +MessageId=1620 +Severity=Success +Facility=System +SymbolicName=ERROR_INSTALL_PACKAGE_INVALID +Language=Bulgarian +ERROR_INSTALL_PACKAGE_INVALID - This installation package could not be opened. Contact the application vendor to verify that this is a valid Windows Installer package. +. + +MessageId=1621 +Severity=Success +Facility=System +SymbolicName=ERROR_INSTALL_UI_FAILURE +Language=Bulgarian +ERROR_INSTALL_UI_FAILURE - There was an error starting the Windows Installer service user interface. Contact your support personnel. +. + +MessageId=1622 +Severity=Success +Facility=System +SymbolicName=ERROR_INSTALL_LOG_FAILURE +Language=Bulgarian +ERROR_INSTALL_LOG_FAILURE - Error opening installation log file. Verify that the specified log file location exists and that you can write to it. +. + +MessageId=1623 +Severity=Success +Facility=System +SymbolicName=ERROR_INSTALL_LANGUAGE_UNSUPPORTED +Language=Bulgarian +ERROR_INSTALL_LANGUAGE_UNSUPPORTED - The language of this installation package is not supported by your system. +. + +MessageId=1624 +Severity=Success +Facility=System +SymbolicName=ERROR_INSTALL_TRANSFORM_FAILURE +Language=Bulgarian +ERROR_INSTALL_TRANSFORM_FAILURE - Error applying transforms. Verify that the specified transform paths are valid. +. + +MessageId=1625 +Severity=Success +Facility=System +SymbolicName=ERROR_INSTALL_PACKAGE_REJECTED +Language=Bulgarian +ERROR_INSTALL_PACKAGE_REJECTED - This installation is forbidden by system policy. Contact your system administrator. +. + +MessageId=1626 +Severity=Success +Facility=System +SymbolicName=ERROR_FUNCTION_NOT_CALLED +Language=Bulgarian +ERROR_FUNCTION_NOT_CALLED - Function could not be executed. +. + +MessageId=1627 +Severity=Success +Facility=System +SymbolicName=ERROR_FUNCTION_FAILED +Language=Bulgarian +ERROR_FUNCTION_FAILED - Function failed during execution. +. + +MessageId=1628 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_TABLE +Language=Bulgarian +ERROR_INVALID_TABLE - Invalid or unknown table specified. +. + +MessageId=1629 +Severity=Success +Facility=System +SymbolicName=ERROR_DATATYPE_MISMATCH +Language=Bulgarian +ERROR_DATATYPE_MISMATCH - Data supplied is of wrong type. +. + +MessageId=1630 +Severity=Success +Facility=System +SymbolicName=ERROR_UNSUPPORTED_TYPE +Language=Bulgarian +ERROR_UNSUPPORTED_TYPE - Data of this type is not supported. +. + +MessageId=1631 +Severity=Success +Facility=System +SymbolicName=ERROR_CREATE_FAILED +Language=Bulgarian +ERROR_CREATE_FAILED - The Windows Installer service failed to start. Contact your support personnel. +. + +MessageId=1632 +Severity=Success +Facility=System +SymbolicName=ERROR_INSTALL_TEMP_UNWRITABLE +Language=Bulgarian +ERROR_INSTALL_TEMP_UNWRITABLE - The Temp folder is on a drive that is full or inaccessible. Free up space on the drive or verify that you have write permission on the Temp folder. +. + +MessageId=1633 +Severity=Success +Facility=System +SymbolicName=ERROR_INSTALL_PLATFORM_UNSUPPORTED +Language=Bulgarian +ERROR_INSTALL_PLATFORM_UNSUPPORTED - This installation package is not supported by this processor type. Contact your product vendor. +. + +MessageId=1634 +Severity=Success +Facility=System +SymbolicName=ERROR_INSTALL_NOTUSED +Language=Bulgarian +ERROR_INSTALL_NOTUSED - Component not used on this computer. +. + +MessageId=1635 +Severity=Success +Facility=System +SymbolicName=ERROR_PATCH_PACKAGE_OPEN_FAILED +Language=Bulgarian +ERROR_PATCH_PACKAGE_OPEN_FAILED - This patch package could not be opened. Verify that the patch package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer patch package. +. + +MessageId=1636 +Severity=Success +Facility=System +SymbolicName=ERROR_PATCH_PACKAGE_INVALID +Language=Bulgarian +ERROR_PATCH_PACKAGE_INVALID - This patch package could not be opened. Contact the application vendor to verify that this is a valid Windows Installer patch package. +. + +MessageId=1637 +Severity=Success +Facility=System +SymbolicName=ERROR_PATCH_PACKAGE_UNSUPPORTED +Language=Bulgarian +ERROR_PATCH_PACKAGE_UNSUPPORTED - This patch package cannot be processed by the Windows Installer service. You must install a Windows service pack that contains a newer version of the Windows Installer service. +. + +MessageId=1638 +Severity=Success +Facility=System +SymbolicName=ERROR_PRODUCT_VERSION +Language=Bulgarian +ERROR_PRODUCT_VERSION - Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Add/Remove Programs on the Control Panel. +. + +MessageId=1639 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_COMMAND_LINE +Language=Bulgarian +ERROR_INVALID_COMMAND_LINE - Invalid command line argument. Consult the Windows Installer SDK for detailed command line help. +. + +MessageId=1640 +Severity=Success +Facility=System +SymbolicName=ERROR_INSTALL_REMOTE_DISALLOWED +Language=Bulgarian +ERROR_INSTALL_REMOTE_DISALLOWED - Only administrators have permission to add, remove, or configure server software during a Terminal Services remote session. If you want to install or configure software on the server, contact your network administrator. +. + +MessageId=1641 +Severity=Success +Facility=System +SymbolicName=ERROR_SUCCESS_REBOOT_INITIATED +Language=Bulgarian +ERROR_SUCCESS_REBOOT_INITIATED - The requested operation completed successfully. The system will be restarted so the changes can take effect. +. + +MessageId=1642 +Severity=Success +Facility=System +SymbolicName=ERROR_PATCH_TARGET_NOT_FOUND +Language=Bulgarian +ERROR_PATCH_TARGET_NOT_FOUND - The upgrade patch cannot be installed by the Windows Installer service because the program to be upgraded may be missing, or the upgrade patch may update a different version of the program. Verify that the program to be upgraded exists on your computer and that you have the correct upgrade patch. +. + +MessageId=1643 +Severity=Success +Facility=System +SymbolicName=ERROR_PATCH_PACKAGE_REJECTED +Language=Bulgarian +ERROR_PATCH_PACKAGE_REJECTED - The patch package is not permitted by software restriction policy. +. + +MessageId=1644 +Severity=Success +Facility=System +SymbolicName=ERROR_INSTALL_TRANSFORM_REJECTED +Language=Bulgarian +ERROR_INSTALL_TRANSFORM_REJECTED - One or more customizations are not permitted by software restriction policy. +. + +MessageId=1645 +Severity=Success +Facility=System +SymbolicName=ERROR_INSTALL_REMOTE_PROHIBITED +Language=Bulgarian +ERROR_INSTALL_REMOTE_PROHIBITED - The Windows Installer does not permit installation from a Remote Desktop Connection. +. + +MessageId=1700 +Severity=Success +Facility=System +SymbolicName=RPC_S_INVALID_STRING_BINDING +Language=Bulgarian +RPC_S_INVALID_STRING_BINDING - The string binding is invalid. +. + +MessageId=1701 +Severity=Success +Facility=System +SymbolicName=RPC_S_WRONG_KIND_OF_BINDING +Language=Bulgarian +RPC_S_WRONG_KIND_OF_BINDING - The binding handle is not the correct type. +. + +MessageId=1702 +Severity=Success +Facility=System +SymbolicName=RPC_S_INVALID_BINDING +Language=Bulgarian +RPC_S_INVALID_BINDING - The binding handle is invalid. +. + +MessageId=1703 +Severity=Success +Facility=System +SymbolicName=RPC_S_PROTSEQ_NOT_SUPPORTED +Language=Bulgarian +RPC_S_PROTSEQ_NOT_SUPPORTED - The RPC protocol sequence is not supported. +. + +MessageId=1704 +Severity=Success +Facility=System +SymbolicName=RPC_S_INVALID_RPC_PROTSEQ +Language=Bulgarian +RPC_S_INVALID_RPC_PROTSEQ - The RPC protocol sequence is invalid. +. + +MessageId=1705 +Severity=Success +Facility=System +SymbolicName=RPC_S_INVALID_STRING_UUID +Language=Bulgarian +RPC_S_INVALID_STRING_UUID - The string universal unique identifier (UUID) is invalid. +. + +MessageId=1706 +Severity=Success +Facility=System +SymbolicName=RPC_S_INVALID_ENDPOINT_FORMAT +Language=Bulgarian +RPC_S_INVALID_ENDPOINT_FORMAT - The endpoint format is invalid. +. + +MessageId=1707 +Severity=Success +Facility=System +SymbolicName=RPC_S_INVALID_NET_ADDR +Language=Bulgarian +RPC_S_INVALID_NET_ADDR - The network address is invalid. +. + +MessageId=1708 +Severity=Success +Facility=System +SymbolicName=RPC_S_NO_ENDPOINT_FOUND +Language=Bulgarian +RPC_S_NO_ENDPOINT_FOUND - No endpoint was found. +. + +MessageId=1709 +Severity=Success +Facility=System +SymbolicName=RPC_S_INVALID_TIMEOUT +Language=Bulgarian +RPC_S_INVALID_TIMEOUT - The timeout value is invalid. +. + +MessageId=1710 +Severity=Success +Facility=System +SymbolicName=RPC_S_OBJECT_NOT_FOUND +Language=Bulgarian +RPC_S_OBJECT_NOT_FOUND - The object universal unique identifier (UUID) was not found. +. + +MessageId=1711 +Severity=Success +Facility=System +SymbolicName=RPC_S_ALREADY_REGISTERED +Language=Bulgarian +RPC_S_ALREADY_REGISTERED - The object universal unique identifier (UUID) has already been registered. +. + +MessageId=1712 +Severity=Success +Facility=System +SymbolicName=RPC_S_TYPE_ALREADY_REGISTERED +Language=Bulgarian +RPC_S_TYPE_ALREADY_REGISTERED - The type universal unique identifier (UUID) has already been registered. +. + +MessageId=1713 +Severity=Success +Facility=System +SymbolicName=RPC_S_ALREADY_LISTENING +Language=Bulgarian +RPC_S_ALREADY_LISTENING - The RPC server is already listening. +. + +MessageId=1714 +Severity=Success +Facility=System +SymbolicName=RPC_S_NO_PROTSEQS_REGISTERED +Language=Bulgarian +RPC_S_NO_PROTSEQS_REGISTERED - No protocol sequences have been registered. +. + +MessageId=1715 +Severity=Success +Facility=System +SymbolicName=RPC_S_NOT_LISTENING +Language=Bulgarian +RPC_S_NOT_LISTENING - The RPC server is not listening. +. + +MessageId=1716 +Severity=Success +Facility=System +SymbolicName=RPC_S_UNKNOWN_MGR_TYPE +Language=Bulgarian +RPC_S_UNKNOWN_MGR_TYPE - The manager type is unknown. +. + +MessageId=1717 +Severity=Success +Facility=System +SymbolicName=RPC_S_UNKNOWN_IF +Language=Bulgarian +RPC_S_UNKNOWN_IF - The interface is unknown. +. + +MessageId=1718 +Severity=Success +Facility=System +SymbolicName=RPC_S_NO_BINDINGS +Language=Bulgarian +RPC_S_NO_BINDINGS - There are no bindings. +. + +MessageId=1719 +Severity=Success +Facility=System +SymbolicName=RPC_S_NO_PROTSEQS +Language=Bulgarian +RPC_S_NO_PROTSEQS - There are no protocol sequences. +. + +MessageId=1720 +Severity=Success +Facility=System +SymbolicName=RPC_S_CANT_CREATE_ENDPOINT +Language=Bulgarian +RPC_S_CANT_CREATE_ENDPOINT - The endpoint cannot be created. +. + +MessageId=1721 +Severity=Success +Facility=System +SymbolicName=RPC_S_OUT_OF_RESOURCES +Language=Bulgarian +RPC_S_OUT_OF_RESOURCES - Not enough resources are available to complete this operation. +. + +MessageId=1722 +Severity=Success +Facility=System +SymbolicName=RPC_S_SERVER_UNAVAILABLE +Language=Bulgarian +RPC_S_SERVER_UNAVAILABLE - The RPC server is unavailable. +. + +MessageId=1723 +Severity=Success +Facility=System +SymbolicName=RPC_S_SERVER_TOO_BUSY +Language=Bulgarian +RPC_S_SERVER_TOO_BUSY - The RPC server is too busy to complete this operation. +. + +MessageId=1724 +Severity=Success +Facility=System +SymbolicName=RPC_S_INVALID_NETWORK_OPTIONS +Language=Bulgarian +RPC_S_INVALID_NETWORK_OPTIONS - The network options are invalid. +. + +MessageId=1725 +Severity=Success +Facility=System +SymbolicName=RPC_S_NO_CALL_ACTIVE +Language=Bulgarian +RPC_S_NO_CALL_ACTIVE - There are no remote procedure calls active on this thread. +. + +MessageId=1726 +Severity=Success +Facility=System +SymbolicName=RPC_S_CALL_FAILED +Language=Bulgarian +RPC_S_CALL_FAILED - The remote procedure call failed. +. + +MessageId=1727 +Severity=Success +Facility=System +SymbolicName=RPC_S_CALL_FAILED_DNE +Language=Bulgarian +RPC_S_CALL_FAILED_DNE - The remote procedure call failed and did not execute. +. + +MessageId=1728 +Severity=Success +Facility=System +SymbolicName=RPC_S_PROTOCOL_ERROR +Language=Bulgarian +RPC_S_PROTOCOL_ERROR - A remote procedure call (RPC) protocol error occurred. +. + +MessageId=1730 +Severity=Success +Facility=System +SymbolicName=RPC_S_UNSUPPORTED_TRANS_SYN +Language=Bulgarian +RPC_S_UNSUPPORTED_TRANS_SYN - The transfer syntax is not supported by the RPC server. +. + +MessageId=1732 +Severity=Success +Facility=System +SymbolicName=RPC_S_UNSUPPORTED_TYPE +Language=Bulgarian +RPC_S_UNSUPPORTED_TYPE - The universal unique identifier (UUID) type is not supported. +. + +MessageId=1733 +Severity=Success +Facility=System +SymbolicName=RPC_S_INVALID_TAG +Language=Bulgarian +RPC_S_INVALID_TAG - The tag is invalid. +. + +MessageId=1734 +Severity=Success +Facility=System +SymbolicName=RPC_S_INVALID_BOUND +Language=Bulgarian +RPC_S_INVALID_BOUND - The array bounds are invalid. +. + +MessageId=1735 +Severity=Success +Facility=System +SymbolicName=RPC_S_NO_ENTRY_NAME +Language=Bulgarian +RPC_S_NO_ENTRY_NAME - The binding does not contain an entry name. +. + +MessageId=1736 +Severity=Success +Facility=System +SymbolicName=RPC_S_INVALID_NAME_SYNTAX +Language=Bulgarian +RPC_S_INVALID_NAME_SYNTAX - The name syntax is invalid. +. + +MessageId=1737 +Severity=Success +Facility=System +SymbolicName=RPC_S_UNSUPPORTED_NAME_SYNTAX +Language=Bulgarian +RPC_S_UNSUPPORTED_NAME_SYNTAX - The name syntax is not supported. +. + +MessageId=1739 +Severity=Success +Facility=System +SymbolicName=RPC_S_UUID_NO_ADDRESS +Language=Bulgarian +RPC_S_UUID_NO_ADDRESS - No network address is available to use to construct a universal unique identifier (UUID). +. + +MessageId=1740 +Severity=Success +Facility=System +SymbolicName=RPC_S_DUPLICATE_ENDPOINT +Language=Bulgarian +RPC_S_DUPLICATE_ENDPOINT - The endpoint is a duplicate. +. + +MessageId=1741 +Severity=Success +Facility=System +SymbolicName=RPC_S_UNKNOWN_AUTHN_TYPE +Language=Bulgarian +RPC_S_UNKNOWN_AUTHN_TYPE - The authentication type is unknown. +. + +MessageId=1742 +Severity=Success +Facility=System +SymbolicName=RPC_S_MAX_CALLS_TOO_SMALL +Language=Bulgarian +RPC_S_MAX_CALLS_TOO_SMALL - The maximum number of calls is too small. +. + +MessageId=1743 +Severity=Success +Facility=System +SymbolicName=RPC_S_STRING_TOO_LONG +Language=Bulgarian +RPC_S_STRING_TOO_LONG - The string is too long. +. + +MessageId=1744 +Severity=Success +Facility=System +SymbolicName=RPC_S_PROTSEQ_NOT_FOUND +Language=Bulgarian +RPC_S_PROTSEQ_NOT_FOUND - The RPC protocol sequence was not found. +. + +MessageId=1745 +Severity=Success +Facility=System +SymbolicName=RPC_S_PROCNUM_OUT_OF_RANGE +Language=Bulgarian +RPC_S_PROCNUM_OUT_OF_RANGE - The procedure number is out of range. +. + +MessageId=1746 +Severity=Success +Facility=System +SymbolicName=RPC_S_BINDING_HAS_NO_AUTH +Language=Bulgarian +RPC_S_BINDING_HAS_NO_AUTH - The binding does not contain any authentication information. +. + +MessageId=1747 +Severity=Success +Facility=System +SymbolicName=RPC_S_UNKNOWN_AUTHN_SERVICE +Language=Bulgarian +RPC_S_UNKNOWN_AUTHN_SERVICE - The authentication service is unknown. +. + +MessageId=1748 +Severity=Success +Facility=System +SymbolicName=RPC_S_UNKNOWN_AUTHN_LEVEL +Language=Bulgarian +RPC_S_UNKNOWN_AUTHN_LEVEL - The authentication level is unknown. +. + +MessageId=1749 +Severity=Success +Facility=System +SymbolicName=RPC_S_INVALID_AUTH_IDENTITY +Language=Bulgarian +RPC_S_INVALID_AUTH_IDENTITY - The security context is invalid. +. + +MessageId=1750 +Severity=Success +Facility=System +SymbolicName=RPC_S_UNKNOWN_AUTHZ_SERVICE +Language=Bulgarian +RPC_S_UNKNOWN_AUTHZ_SERVICE - The authorization service is unknown. +. + +MessageId=1751 +Severity=Success +Facility=System +SymbolicName=EPT_S_INVALID_ENTRY +Language=Bulgarian +EPT_S_INVALID_ENTRY - The entry is invalid. +. + +MessageId=1752 +Severity=Success +Facility=System +SymbolicName=EPT_S_CANT_PERFORM_OP +Language=Bulgarian +EPT_S_CANT_PERFORM_OP - The server endpoint cannot perform the operation. +. + +MessageId=1753 +Severity=Success +Facility=System +SymbolicName=EPT_S_NOT_REGISTERED +Language=Bulgarian +EPT_S_NOT_REGISTERED - There are no more endpoints available from the endpoint mapper. +. + +MessageId=1754 +Severity=Success +Facility=System +SymbolicName=RPC_S_NOTHING_TO_EXPORT +Language=Bulgarian +RPC_S_NOTHING_TO_EXPORT - No interfaces have been exported. +. + +MessageId=1755 +Severity=Success +Facility=System +SymbolicName=RPC_S_INCOMPLETE_NAME +Language=Bulgarian +RPC_S_INCOMPLETE_NAME - The entry name is incomplete. +. + +MessageId=1756 +Severity=Success +Facility=System +SymbolicName=RPC_S_INVALID_VERS_OPTION +Language=Bulgarian +RPC_S_INVALID_VERS_OPTION - The version option is invalid. +. + +MessageId=1757 +Severity=Success +Facility=System +SymbolicName=RPC_S_NO_MORE_MEMBERS +Language=Bulgarian +RPC_S_NO_MORE_MEMBERS - There are no more members. +. + +MessageId=1758 +Severity=Success +Facility=System +SymbolicName=RPC_S_NOT_ALL_OBJS_UNEXPORTED +Language=Bulgarian +RPC_S_NOT_ALL_OBJS_UNEXPORTED - There is nothing to unexport. +. + +MessageId=1759 +Severity=Success +Facility=System +SymbolicName=RPC_S_INTERFACE_NOT_FOUND +Language=Bulgarian +RPC_S_INTERFACE_NOT_FOUND - The interface was not found. +. + +MessageId=1760 +Severity=Success +Facility=System +SymbolicName=RPC_S_ENTRY_ALREADY_EXISTS +Language=Bulgarian +RPC_S_ENTRY_ALREADY_EXISTS - The entry already exists. +. + +MessageId=1761 +Severity=Success +Facility=System +SymbolicName=RPC_S_ENTRY_NOT_FOUND +Language=Bulgarian +RPC_S_ENTRY_NOT_FOUND - The entry is not found. +. + +MessageId=1762 +Severity=Success +Facility=System +SymbolicName=RPC_S_NAME_SERVICE_UNAVAILABLE +Language=Bulgarian +RPC_S_NAME_SERVICE_UNAVAILABLE - The name service is unavailable. +. + +MessageId=1763 +Severity=Success +Facility=System +SymbolicName=RPC_S_INVALID_NAF_ID +Language=Bulgarian +RPC_S_INVALID_NAF_ID - The network address family is invalid. +. + +MessageId=1764 +Severity=Success +Facility=System +SymbolicName=RPC_S_CANNOT_SUPPORT +Language=Bulgarian +RPC_S_CANNOT_SUPPORT - The requested operation is not supported. +. + +MessageId=1765 +Severity=Success +Facility=System +SymbolicName=RPC_S_NO_CONTEXT_AVAILABLE +Language=Bulgarian +RPC_S_NO_CONTEXT_AVAILABLE - No security context is available to allow impersonation. +. + +MessageId=1766 +Severity=Success +Facility=System +SymbolicName=RPC_S_INTERNAL_ERROR +Language=Bulgarian +RPC_S_INTERNAL_ERROR - An internal error occurred in a remote procedure call (RPC). +. + +MessageId=1767 +Severity=Success +Facility=System +SymbolicName=RPC_S_ZERO_DIVIDE +Language=Bulgarian +RPC_S_ZERO_DIVIDE - The RPC server attempted an integer division by zero. +. + +MessageId=1768 +Severity=Success +Facility=System +SymbolicName=RPC_S_ADDRESS_ERROR +Language=Bulgarian +RPC_S_ADDRESS_ERROR - An addressing error occurred in the RPC server. +. + +MessageId=1769 +Severity=Success +Facility=System +SymbolicName=RPC_S_FP_DIV_ZERO +Language=Bulgarian +RPC_S_FP_DIV_ZERO - A floating-point operation at the RPC server caused a division by zero. +. + +MessageId=1770 +Severity=Success +Facility=System +SymbolicName=RPC_S_FP_UNDERFLOW +Language=Bulgarian +RPC_S_FP_UNDERFLOW - A floating-point underflow occurred at the RPC server. +. + +MessageId=1771 +Severity=Success +Facility=System +SymbolicName=RPC_S_FP_OVERFLOW +Language=Bulgarian +RPC_S_FP_OVERFLOW - A floating-point overflow occurred at the RPC server. +. + +MessageId=1772 +Severity=Success +Facility=System +SymbolicName=RPC_X_NO_MORE_ENTRIES +Language=Bulgarian +RPC_X_NO_MORE_ENTRIES - The list of RPC servers available for the binding of auto handles has been exhausted. +. + +MessageId=1773 +Severity=Success +Facility=System +SymbolicName=RPC_X_SS_CHAR_TRANS_OPEN_FAIL +Language=Bulgarian +RPC_X_SS_CHAR_TRANS_OPEN_FAIL - Unable to open the character translation table file. +. + +MessageId=1774 +Severity=Success +Facility=System +SymbolicName=RPC_X_SS_CHAR_TRANS_SHORT_FILE +Language=Bulgarian +RPC_X_SS_CHAR_TRANS_SHORT_FILE - The file containing the character translation table has fewer than 512 bytes. +. + +MessageId=1775 +Severity=Success +Facility=System +SymbolicName=RPC_X_SS_IN_NULL_CONTEXT +Language=Bulgarian +RPC_X_SS_IN_NULL_CONTEXT - A null context handle was passed from the client to the host during a remote procedure call. +. + +MessageId=1777 +Severity=Success +Facility=System +SymbolicName=RPC_X_SS_CONTEXT_DAMAGED +Language=Bulgarian +RPC_X_SS_CONTEXT_DAMAGED - The context handle changed during a remote procedure call. +. + +MessageId=1778 +Severity=Success +Facility=System +SymbolicName=RPC_X_SS_HANDLES_MISMATCH +Language=Bulgarian +RPC_X_SS_HANDLES_MISMATCH - The binding handles passed to a remote procedure call do not match. +. + +MessageId=1779 +Severity=Success +Facility=System +SymbolicName=RPC_X_SS_CANNOT_GET_CALL_HANDLE +Language=Bulgarian +RPC_X_SS_CANNOT_GET_CALL_HANDLE - The stub is unable to get the remote procedure call handle. +. + +MessageId=1780 +Severity=Success +Facility=System +SymbolicName=RPC_X_NULL_REF_POINTER +Language=Bulgarian +RPC_X_NULL_REF_POINTER - A null reference pointer was passed to the stub. +. + +MessageId=1781 +Severity=Success +Facility=System +SymbolicName=RPC_X_ENUM_VALUE_OUT_OF_RANGE +Language=Bulgarian +RPC_X_ENUM_VALUE_OUT_OF_RANGE - The enumeration value is out of range. +. + +MessageId=1782 +Severity=Success +Facility=System +SymbolicName=RPC_X_BYTE_COUNT_TOO_SMALL +Language=Bulgarian +RPC_X_BYTE_COUNT_TOO_SMALL - The byte count is too small. +. + +MessageId=1783 +Severity=Success +Facility=System +SymbolicName=RPC_X_BAD_STUB_DATA +Language=Bulgarian +RPC_X_BAD_STUB_DATA - The stub received bad data. +. + +MessageId=1784 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_USER_BUFFER +Language=Bulgarian +ERROR_INVALID_USER_BUFFER - The supplied user buffer is not valid for the requested operation. +. + +MessageId=1785 +Severity=Success +Facility=System +SymbolicName=ERROR_UNRECOGNIZED_MEDIA +Language=Bulgarian +ERROR_UNRECOGNIZED_MEDIA - The disk media is not recognized. It may not be formatted. +. + +MessageId=1786 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_TRUST_LSA_SECRET +Language=Bulgarian +ERROR_NO_TRUST_LSA_SECRET - The workstation does not have a trust secret. +. + +MessageId=1787 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_TRUST_SAM_ACCOUNT +Language=Bulgarian +ERROR_NO_TRUST_SAM_ACCOUNT - The security database on the server does not have a computer account for this workstation trust relationship. +. + +MessageId=1788 +Severity=Success +Facility=System +SymbolicName=ERROR_TRUSTED_DOMAIN_FAILURE +Language=Bulgarian +ERROR_TRUSTED_DOMAIN_FAILURE - The trust relationship between the primary domain and the trusted domain failed. +. + +MessageId=1789 +Severity=Success +Facility=System +SymbolicName=ERROR_TRUSTED_RELATIONSHIP_FAILURE +Language=Bulgarian +ERROR_TRUSTED_RELATIONSHIP_FAILURE - The trust relationship between this workstation and the primary domain failed. +. + +MessageId=1790 +Severity=Success +Facility=System +SymbolicName=ERROR_TRUST_FAILURE +Language=Bulgarian +ERROR_TRUST_FAILURE - The network logon failed. +. + +MessageId=1791 +Severity=Success +Facility=System +SymbolicName=RPC_S_CALL_IN_PROGRESS +Language=Bulgarian +RPC_S_CALL_IN_PROGRESS - A remote procedure call is already in progress for this thread. +. + +MessageId=1792 +Severity=Success +Facility=System +SymbolicName=ERROR_NETLOGON_NOT_STARTED +Language=Bulgarian +ERROR_NETLOGON_NOT_STARTED - An attempt was made to logon, but the network logon service was not started. +. + +MessageId=1793 +Severity=Success +Facility=System +SymbolicName=ERROR_ACCOUNT_EXPIRED +Language=Bulgarian +ERROR_ACCOUNT_EXPIRED - The user's account has expired. +. + +MessageId=1794 +Severity=Success +Facility=System +SymbolicName=ERROR_REDIRECTOR_HAS_OPEN_HANDLES +Language=Bulgarian +ERROR_REDIRECTOR_HAS_OPEN_HANDLES - The redirector is in use and cannot be unloaded. +. + +MessageId=1795 +Severity=Success +Facility=System +SymbolicName=ERROR_PRINTER_DRIVER_ALREADY_INSTALLED +Language=Bulgarian +ERROR_PRINTER_DRIVER_ALREADY_INSTALLED - The specified printer driver is already installed. +. + +MessageId=1796 +Severity=Success +Facility=System +SymbolicName=ERROR_UNKNOWN_PORT +Language=Bulgarian +ERROR_UNKNOWN_PORT - The specified port is unknown. +. + +MessageId=1797 +Severity=Success +Facility=System +SymbolicName=ERROR_UNKNOWN_PRINTER_DRIVER +Language=Bulgarian +ERROR_UNKNOWN_PRINTER_DRIVER - The printer driver is unknown. +. + +MessageId=1798 +Severity=Success +Facility=System +SymbolicName=ERROR_UNKNOWN_PRINTPROCESSOR +Language=Bulgarian +ERROR_UNKNOWN_PRINTPROCESSOR - The print processor is unknown. +. + +MessageId=1799 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_SEPARATOR_FILE +Language=Bulgarian +ERROR_INVALID_SEPARATOR_FILE - The specified separator file is invalid. +. + +MessageId=1800 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_PRIORITY +Language=Bulgarian +ERROR_INVALID_PRIORITY - The specified priority is invalid. +. + +MessageId=1801 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_PRINTER_NAME +Language=Bulgarian +ERROR_INVALID_PRINTER_NAME - The printer name is invalid. +. + +MessageId=1802 +Severity=Success +Facility=System +SymbolicName=ERROR_PRINTER_ALREADY_EXISTS +Language=Bulgarian +ERROR_PRINTER_ALREADY_EXISTS - The printer already exists. +. + +MessageId=1803 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_PRINTER_COMMAND +Language=Bulgarian +ERROR_INVALID_PRINTER_COMMAND - The printer command is invalid. +. + +MessageId=1804 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_DATATYPE +Language=Bulgarian +ERROR_INVALID_DATATYPE - The specified datatype is invalid. +. + +MessageId=1805 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_ENVIRONMENT +Language=Bulgarian +ERROR_INVALID_ENVIRONMENT - The environment specified is invalid. +. + +MessageId=1806 +Severity=Success +Facility=System +SymbolicName=RPC_S_NO_MORE_BINDINGS +Language=Bulgarian +RPC_S_NO_MORE_BINDINGS - There are no more bindings. +. + +MessageId=1807 +Severity=Success +Facility=System +SymbolicName=ERROR_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT +Language=Bulgarian +ERROR_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT - The account used is an interdomain trust account. Use your global user account or local user account to access this server. +. + +MessageId=1808 +Severity=Success +Facility=System +SymbolicName=ERROR_NOLOGON_WORKSTATION_TRUST_ACCOUNT +Language=Bulgarian +ERROR_NOLOGON_WORKSTATION_TRUST_ACCOUNT - The account used is a computer account. Use your global user account or local user account to access this server. +. + +MessageId=1809 +Severity=Success +Facility=System +SymbolicName=ERROR_NOLOGON_SERVER_TRUST_ACCOUNT +Language=Bulgarian +ERROR_NOLOGON_SERVER_TRUST_ACCOUNT - The account used is a server trust account. Use your global user account or local user account to access this server. +. + +MessageId=1810 +Severity=Success +Facility=System +SymbolicName=ERROR_DOMAIN_TRUST_INCONSISTENT +Language=Bulgarian +ERROR_DOMAIN_TRUST_INCONSISTENT - The name or security ID (SID) of the domain specified is inconsistent with the trust information for that domain. +. + +MessageId=1811 +Severity=Success +Facility=System +SymbolicName=ERROR_SERVER_HAS_OPEN_HANDLES +Language=Bulgarian +ERROR_SERVER_HAS_OPEN_HANDLES - The server is in use and cannot be unloaded. +. + +MessageId=1812 +Severity=Success +Facility=System +SymbolicName=ERROR_RESOURCE_DATA_NOT_FOUND +Language=Bulgarian +ERROR_RESOURCE_DATA_NOT_FOUND - The specified image file did not contain a resource section. +. + +MessageId=1813 +Severity=Success +Facility=System +SymbolicName=ERROR_RESOURCE_TYPE_NOT_FOUND +Language=Bulgarian +ERROR_RESOURCE_TYPE_NOT_FOUND - The specified resource type cannot be found in the image file. +. + +MessageId=1814 +Severity=Success +Facility=System +SymbolicName=ERROR_RESOURCE_NAME_NOT_FOUND +Language=Bulgarian +ERROR_RESOURCE_NAME_NOT_FOUND - The specified resource name cannot be found in the image file. +. + +MessageId=1815 +Severity=Success +Facility=System +SymbolicName=ERROR_RESOURCE_LANG_NOT_FOUND +Language=Bulgarian +ERROR_RESOURCE_LANG_NOT_FOUND - The specified resource language ID cannot be found in the image file. +. + +MessageId=1816 +Severity=Success +Facility=System +SymbolicName=ERROR_NOT_ENOUGH_QUOTA +Language=Bulgarian +ERROR_NOT_ENOUGH_QUOTA - Not enough quota is available to process this command. +. + +MessageId=1817 +Severity=Success +Facility=System +SymbolicName=RPC_S_NO_INTERFACES +Language=Bulgarian +RPC_S_NO_INTERFACES - No interfaces have been registered. +. + +MessageId=1818 +Severity=Success +Facility=System +SymbolicName=RPC_S_CALL_CANCELLED +Language=Bulgarian +RPC_S_CALL_CANCELLED - The remote procedure call was cancelled. +. + +MessageId=1819 +Severity=Success +Facility=System +SymbolicName=RPC_S_BINDING_INCOMPLETE +Language=Bulgarian +RPC_S_BINDING_INCOMPLETE - The binding handle does not contain all required information. +. + +MessageId=1820 +Severity=Success +Facility=System +SymbolicName=RPC_S_COMM_FAILURE +Language=Bulgarian +RPC_S_COMM_FAILURE - A communications failure occurred during a remote procedure call. +. + +MessageId=1821 +Severity=Success +Facility=System +SymbolicName=RPC_S_UNSUPPORTED_AUTHN_LEVEL +Language=Bulgarian +RPC_S_UNSUPPORTED_AUTHN_LEVEL - The requested authentication level is not supported. +. + +MessageId=1822 +Severity=Success +Facility=System +SymbolicName=RPC_S_NO_PRINC_NAME +Language=Bulgarian +RPC_S_NO_PRINC_NAME - No principal name registered. +. + +MessageId=1823 +Severity=Success +Facility=System +SymbolicName=RPC_S_NOT_RPC_ERROR +Language=Bulgarian +RPC_S_NOT_RPC_ERROR - The error specified is not a valid Windows RPC error code. +. + +MessageId=1824 +Severity=Success +Facility=System +SymbolicName=RPC_S_UUID_LOCAL_ONLY +Language=Bulgarian +RPC_S_UUID_LOCAL_ONLY - A UUID that is valid only on this computer has been allocated. +. + +MessageId=1825 +Severity=Success +Facility=System +SymbolicName=RPC_S_SEC_PKG_ERROR +Language=Bulgarian +RPC_S_SEC_PKG_ERROR - A security package specific error occurred. +. + +MessageId=1826 +Severity=Success +Facility=System +SymbolicName=RPC_S_NOT_CANCELLED +Language=Bulgarian +RPC_S_NOT_CANCELLED - Thread is not canceled. +. + +MessageId=1827 +Severity=Success +Facility=System +SymbolicName=RPC_X_INVALID_ES_ACTION +Language=Bulgarian +RPC_X_INVALID_ES_ACTION - Invalid operation on the encoding/decoding handle. +. + +MessageId=1828 +Severity=Success +Facility=System +SymbolicName=RPC_X_WRONG_ES_VERSION +Language=Bulgarian +RPC_X_WRONG_ES_VERSION - Incompatible version of the serializing package. +. + +MessageId=1829 +Severity=Success +Facility=System +SymbolicName=RPC_X_WRONG_STUB_VERSION +Language=Bulgarian +RPC_X_WRONG_STUB_VERSION - Incompatible version of the RPC stub. +. + +MessageId=1830 +Severity=Success +Facility=System +SymbolicName=RPC_X_INVALID_PIPE_OBJECT +Language=Bulgarian +RPC_X_INVALID_PIPE_OBJECT - The RPC pipe object is invalid or corrupted. +. + +MessageId=1831 +Severity=Success +Facility=System +SymbolicName=RPC_X_WRONG_PIPE_ORDER +Language=Bulgarian +RPC_X_WRONG_PIPE_ORDER - An invalid operation was attempted on an RPC pipe object. +. + +MessageId=1832 +Severity=Success +Facility=System +SymbolicName=RPC_X_WRONG_PIPE_VERSION +Language=Bulgarian +RPC_X_WRONG_PIPE_VERSION - Unsupported RPC pipe version. +. + +MessageId=1898 +Severity=Success +Facility=System +SymbolicName=RPC_S_GROUP_MEMBER_NOT_FOUND +Language=Bulgarian +RPC_S_GROUP_MEMBER_NOT_FOUND - The group member was not found. +. + +MessageId=1899 +Severity=Success +Facility=System +SymbolicName=EPT_S_CANT_CREATE +Language=Bulgarian +EPT_S_CANT_CREATE - The endpoint mapper database entry could not be created. +. + +MessageId=1900 +Severity=Success +Facility=System +SymbolicName=RPC_S_INVALID_OBJECT +Language=Bulgarian +RPC_S_INVALID_OBJECT - The object universal unique identifier (UUID) is the nil UUID. +. + +MessageId=1901 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_TIME +Language=Bulgarian +ERROR_INVALID_TIME - The specified time is invalid. +. + +MessageId=1902 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_FORM_NAME +Language=Bulgarian +ERROR_INVALID_FORM_NAME - The specified form name is invalid. +. + +MessageId=1903 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_FORM_SIZE +Language=Bulgarian +ERROR_INVALID_FORM_SIZE - The specified form size is invalid. +. + +MessageId=1904 +Severity=Success +Facility=System +SymbolicName=ERROR_ALREADY_WAITING +Language=Bulgarian +ERROR_ALREADY_WAITING - The specified printer handle is already being waited on +. + +MessageId=1905 +Severity=Success +Facility=System +SymbolicName=ERROR_PRINTER_DELETED +Language=Bulgarian +ERROR_PRINTER_DELETED - The specified printer has been deleted. +. + +MessageId=1906 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_PRINTER_STATE +Language=Bulgarian +ERROR_INVALID_PRINTER_STATE - The state of the printer is invalid. +. + +MessageId=1907 +Severity=Success +Facility=System +SymbolicName=ERROR_PASSWORD_MUST_CHANGE +Language=Bulgarian +ERROR_PASSWORD_MUST_CHANGE - The user's password must be changed before logging on the first time. +. + +MessageId=1908 +Severity=Success +Facility=System +SymbolicName=ERROR_DOMAIN_CONTROLLER_NOT_FOUND +Language=Bulgarian +ERROR_DOMAIN_CONTROLLER_NOT_FOUND - Could not find the domain controller for this domain. +. + +MessageId=1909 +Severity=Success +Facility=System +SymbolicName=ERROR_ACCOUNT_LOCKED_OUT +Language=Bulgarian +ERROR_ACCOUNT_LOCKED_OUT - The referenced account is currently locked out and may not be used to log on. +. + +MessageId=1910 +Severity=Success +Facility=System +SymbolicName=OR_INVALID_OXID +Language=Bulgarian +OR_INVALID_OXID - The object exporter specified was not found. +. + +MessageId=1911 +Severity=Success +Facility=System +SymbolicName=OR_INVALID_OID +Language=Bulgarian +OR_INVALID_OID - The object specified was not found. +. + +MessageId=1912 +Severity=Success +Facility=System +SymbolicName=OR_INVALID_SET +Language=Bulgarian +OR_INVALID_SET - The object resolver set specified was not found. +. + +MessageId=1913 +Severity=Success +Facility=System +SymbolicName=RPC_S_SEND_INCOMPLETE +Language=Bulgarian +RPC_S_SEND_INCOMPLETE - Some data remains to be sent in the request buffer. +. + +MessageId=1914 +Severity=Success +Facility=System +SymbolicName=RPC_S_INVALID_ASYNC_HANDLE +Language=Bulgarian +RPC_S_INVALID_ASYNC_HANDLE - Invalid asynchronous remote procedure call handle. +. + +MessageId=1915 +Severity=Success +Facility=System +SymbolicName=RPC_S_INVALID_ASYNC_CALL +Language=Bulgarian +RPC_S_INVALID_ASYNC_CALL - Invalid asynchronous RPC call handle for this operation. +. + +MessageId=1916 +Severity=Success +Facility=System +SymbolicName=RPC_X_PIPE_CLOSED +Language=Bulgarian +RPC_X_PIPE_CLOSED - The RPC pipe object has already been closed. +. + +MessageId=1917 +Severity=Success +Facility=System +SymbolicName=RPC_X_PIPE_DISCIPLINE_ERROR +Language=Bulgarian +RPC_X_PIPE_DISCIPLINE_ERROR - The RPC call completed before all pipes were processed. +. + +MessageId=1918 +Severity=Success +Facility=System +SymbolicName=RPC_X_PIPE_EMPTY +Language=Bulgarian +RPC_X_PIPE_EMPTY - No more data is available from the RPC pipe. +. + +MessageId=1919 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_SITENAME +Language=Bulgarian +ERROR_NO_SITENAME - No site name is available for this machine. +. + +MessageId=1920 +Severity=Success +Facility=System +SymbolicName=ERROR_CANT_ACCESS_FILE +Language=Bulgarian +ERROR_CANT_ACCESS_FILE - The file cannot be accessed by the system. +. + +MessageId=1921 +Severity=Success +Facility=System +SymbolicName=ERROR_CANT_RESOLVE_FILENAME +Language=Bulgarian +ERROR_CANT_RESOLVE_FILENAME - The name of the file cannot be resolved by the system. +. + +MessageId=1922 +Severity=Success +Facility=System +SymbolicName=RPC_S_ENTRY_TYPE_MISMATCH +Language=Bulgarian +RPC_S_ENTRY_TYPE_MISMATCH - The entry is not of the expected type. +. + +MessageId=1923 +Severity=Success +Facility=System +SymbolicName=RPC_S_NOT_ALL_OBJS_EXPORTED +Language=Bulgarian +RPC_S_NOT_ALL_OBJS_EXPORTED - Not all object UUIDs could be exported to the specified entry. +. + +MessageId=1924 +Severity=Success +Facility=System +SymbolicName=RPC_S_INTERFACE_NOT_EXPORTED +Language=Bulgarian +RPC_S_INTERFACE_NOT_EXPORTED - Interface could not be exported to the specified entry. +. + +MessageId=1925 +Severity=Success +Facility=System +SymbolicName=RPC_S_PROFILE_NOT_ADDED +Language=Bulgarian +RPC_S_PROFILE_NOT_ADDED - The specified profile entry could not be added. +. + +MessageId=1926 +Severity=Success +Facility=System +SymbolicName=RPC_S_PRF_ELT_NOT_ADDED +Language=Bulgarian +RPC_S_PRF_ELT_NOT_ADDED - The specified profile element could not be added. +. + +MessageId=1927 +Severity=Success +Facility=System +SymbolicName=RPC_S_PRF_ELT_NOT_REMOVED +Language=Bulgarian +RPC_S_PRF_ELT_NOT_REMOVED - The specified profile element could not be removed. +. + +MessageId=1928 +Severity=Success +Facility=System +SymbolicName=RPC_S_GRP_ELT_NOT_ADDED +Language=Bulgarian +RPC_S_GRP_ELT_NOT_ADDED - The group element could not be added. +. + +MessageId=1929 +Severity=Success +Facility=System +SymbolicName=RPC_S_GRP_ELT_NOT_REMOVED +Language=Bulgarian +RPC_S_GRP_ELT_NOT_REMOVED - The group element could not be removed. +. + +MessageId=1930 +Severity=Success +Facility=System +SymbolicName=ERROR_KM_DRIVER_BLOCKED +Language=Bulgarian +ERROR_KM_DRIVER_BLOCKED - The printer driver is not compatible with a policy enabled on your computer that blocks NT 4.0 drivers. +. + +MessageId=1931 +Severity=Success +Facility=System +SymbolicName=ERROR_CONTEXT_EXPIRED +Language=Bulgarian +ERROR_CONTEXT_EXPIRED - The context has expired and can no longer be used. +. + +MessageId=1932 +Severity=Success +Facility=System +SymbolicName=ERROR_PER_USER_TRUST_QUOTA_EXCEEDED +Language=Bulgarian +ERROR_PER_USER_TRUST_QUOTA_EXCEEDED - The current user's delegated trust creation quota has been exceeded. +. + +MessageId=1933 +Severity=Success +Facility=System +SymbolicName=ERROR_ALL_USER_TRUST_QUOTA_EXCEEDED +Language=Bulgarian +ERROR_ALL_USER_TRUST_QUOTA_EXCEEDED - The total delegated trust creation quota has been exceeded. +. + +MessageId=1934 +Severity=Success +Facility=System +SymbolicName=ERROR_USER_DELETE_TRUST_QUOTA_EXCEEDED +Language=Bulgarian +ERROR_USER_DELETE_TRUST_QUOTA_EXCEEDED - The current user's delegated trust deletion quota has been exceeded. +. + +MessageId=2000 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_PIXEL_FORMAT +Language=Bulgarian +ERROR_INVALID_PIXEL_FORMAT - The pixel format is invalid. +. + +MessageId=2001 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_DRIVER +Language=Bulgarian +ERROR_BAD_DRIVER - The specified driver is invalid. +. + +MessageId=2002 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_WINDOW_STYLE +Language=Bulgarian +ERROR_INVALID_WINDOW_STYLE - The window style or class attribute is invalid for this operation. +. + +MessageId=2003 +Severity=Success +Facility=System +SymbolicName=ERROR_METAFILE_NOT_SUPPORTED +Language=Bulgarian +ERROR_METAFILE_NOT_SUPPORTED - The requested metafile operation is not supported. +. + +MessageId=2004 +Severity=Success +Facility=System +SymbolicName=ERROR_TRANSFORM_NOT_SUPPORTED +Language=Bulgarian +ERROR_TRANSFORM_NOT_SUPPORTED - The requested transformation operation is not supported. +. + +MessageId=2005 +Severity=Success +Facility=System +SymbolicName=ERROR_CLIPPING_NOT_SUPPORTED +Language=Bulgarian +ERROR_CLIPPING_NOT_SUPPORTED - The requested clipping operation is not supported. +. + +MessageId=2010 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_CMM +Language=Bulgarian +ERROR_INVALID_CMM - The specified color management module is invalid. +. + +MessageId=2011 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_PROFILE +Language=Bulgarian +ERROR_INVALID_PROFILE - The specified color profile is invalid. +. + +MessageId=2012 +Severity=Success +Facility=System +SymbolicName=ERROR_TAG_NOT_FOUND +Language=Bulgarian +ERROR_TAG_NOT_FOUND - The specified tag was not found. +. + +MessageId=2013 +Severity=Success +Facility=System +SymbolicName=ERROR_TAG_NOT_PRESENT +Language=Bulgarian +ERROR_TAG_NOT_PRESENT - A required tag is not present. +. + +MessageId=2014 +Severity=Success +Facility=System +SymbolicName=ERROR_DUPLICATE_TAG +Language=Bulgarian +ERROR_DUPLICATE_TAG - The specified tag is already present. +. + +MessageId=2015 +Severity=Success +Facility=System +SymbolicName=ERROR_PROFILE_NOT_ASSOCIATED_WITH_DEVICE +Language=Bulgarian +ERROR_PROFILE_NOT_ASSOCIATED_WITH_DEVICE - The specified color profile is not associated with any device. +. + +MessageId=2016 +Severity=Success +Facility=System +SymbolicName=ERROR_PROFILE_NOT_FOUND +Language=Bulgarian +ERROR_PROFILE_NOT_FOUND - The specified color profile was not found. +. + +MessageId=2017 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_COLORSPACE +Language=Bulgarian +ERROR_INVALID_COLORSPACE - The specified color space is invalid. +. + +MessageId=2018 +Severity=Success +Facility=System +SymbolicName=ERROR_ICM_NOT_ENABLED +Language=Bulgarian +ERROR_ICM_NOT_ENABLED - Image Color Management is not enabled. +. + +MessageId=2019 +Severity=Success +Facility=System +SymbolicName=ERROR_DELETING_ICM_XFORM +Language=Bulgarian +ERROR_DELETING_ICM_XFORM - There was an error while deleting the color transform. +. + +MessageId=2020 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_TRANSFORM +Language=Bulgarian +ERROR_INVALID_TRANSFORM - The specified color transform is invalid. +. + +MessageId=2021 +Severity=Success +Facility=System +SymbolicName=ERROR_COLORSPACE_MISMATCH +Language=Bulgarian +ERROR_COLORSPACE_MISMATCH - The specified transform does not match the bitmap's color space. +. + +MessageId=2022 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_COLORINDEX +Language=Bulgarian +ERROR_INVALID_COLORINDEX - The specified named color index is not present in the profile. +. + +MessageId=2108 +Severity=Success +Facility=System +SymbolicName=ERROR_CONNECTED_OTHER_PASSWORD +Language=Bulgarian +ERROR_CONNECTED_OTHER_PASSWORD - The network connection was made successfully, but the user had to be prompted for a password other than the one originally specified. +. + +MessageId=2109 +Severity=Success +Facility=System +SymbolicName=ERROR_CONNECTED_OTHER_PASSWORD_DEFAULT +Language=Bulgarian +ERROR_CONNECTED_OTHER_PASSWORD_DEFAULT - The network connection was made successfully using default credentials. +. + +MessageId=2202 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_USERNAME +Language=Bulgarian +ERROR_BAD_USERNAME - The specified username is invalid. +. + +MessageId=2250 +Severity=Success +Facility=System +SymbolicName=ERROR_NOT_CONNECTED +Language=Bulgarian +ERROR_NOT_CONNECTED - This network connection does not exist. +. + +MessageId=2401 +Severity=Success +Facility=System +SymbolicName=ERROR_OPEN_FILES +Language=Bulgarian +ERROR_OPEN_FILES - This network connection has files open or requests pending. +. + +MessageId=2402 +Severity=Success +Facility=System +SymbolicName=ERROR_ACTIVE_CONNECTIONS +Language=Bulgarian +ERROR_ACTIVE_CONNECTIONS - Active connections still exist. +. + +MessageId=2404 +Severity=Success +Facility=System +SymbolicName=ERROR_DEVICE_IN_USE +Language=Bulgarian +ERROR_DEVICE_IN_USE - The device is in use by an active process and cannot be disconnected. +. + +MessageId=3000 +Severity=Success +Facility=System +SymbolicName=ERROR_UNKNOWN_PRINT_MONITOR +Language=Bulgarian +ERROR_UNKNOWN_PRINT_MONITOR - The specified print monitor is unknown. +. + +MessageId=3001 +Severity=Success +Facility=System +SymbolicName=ERROR_PRINTER_DRIVER_IN_USE +Language=Bulgarian +ERROR_PRINTER_DRIVER_IN_USE - The specified printer driver is currently in use. +. + +MessageId=3002 +Severity=Success +Facility=System +SymbolicName=ERROR_SPOOL_FILE_NOT_FOUND +Language=Bulgarian +ERROR_SPOOL_FILE_NOT_FOUND - The spool file was not found. +. + +MessageId=3003 +Severity=Success +Facility=System +SymbolicName=ERROR_SPL_NO_STARTDOC +Language=Bulgarian +ERROR_SPL_NO_STARTDOC - A StartDocPrinter call was not issued. +. + +MessageId=3004 +Severity=Success +Facility=System +SymbolicName=ERROR_SPL_NO_ADDJOB +Language=Bulgarian +ERROR_SPL_NO_ADDJOB - An AddJob call was not issued. +. + +MessageId=3005 +Severity=Success +Facility=System +SymbolicName=ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED +Language=Bulgarian +ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED - The specified print processor has already been installed. +. + +MessageId=3006 +Severity=Success +Facility=System +SymbolicName=ERROR_PRINT_MONITOR_ALREADY_INSTALLED +Language=Bulgarian +ERROR_PRINT_MONITOR_ALREADY_INSTALLED - The specified print monitor has already been installed. +. + +MessageId=3007 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_PRINT_MONITOR +Language=Bulgarian +ERROR_INVALID_PRINT_MONITOR - The specified print monitor does not have the required functions. +. + +MessageId=3008 +Severity=Success +Facility=System +SymbolicName=ERROR_PRINT_MONITOR_IN_USE +Language=Bulgarian +ERROR_PRINT_MONITOR_IN_USE - The specified print monitor is currently in use. +. + +MessageId=3009 +Severity=Success +Facility=System +SymbolicName=ERROR_PRINTER_HAS_JOBS_QUEUED +Language=Bulgarian +ERROR_PRINTER_HAS_JOBS_QUEUED - The requested operation is not allowed when there are jobs queued to the printer. +. + +MessageId=3010 +Severity=Success +Facility=System +SymbolicName=ERROR_SUCCESS_REBOOT_REQUIRED +Language=Bulgarian +ERROR_SUCCESS_REBOOT_REQUIRED - The requested operation is successful. Changes will not be effective until the system is rebooted. +. + +MessageId=3011 +Severity=Success +Facility=System +SymbolicName=ERROR_SUCCESS_RESTART_REQUIRED +Language=Bulgarian +ERROR_SUCCESS_RESTART_REQUIRED - The requested operation is successful. Changes will not be effective until the service is restarted. +. + +MessageId=3012 +Severity=Success +Facility=System +SymbolicName=ERROR_PRINTER_NOT_FOUND +Language=Bulgarian +ERROR_PRINTER_NOT_FOUND - No printers were found. +. + +MessageId=3013 +Severity=Success +Facility=System +SymbolicName=ERROR_PRINTER_DRIVER_WARNED +Language=Bulgarian +ERROR_PRINTER_DRIVER_WARNED - The printer driver is known to be unreliable. +. + +MessageId=3014 +Severity=Success +Facility=System +SymbolicName=ERROR_PRINTER_DRIVER_BLOCKED +Language=Bulgarian +ERROR_PRINTER_DRIVER_BLOCKED - The printer driver is known to harm the system. +. + +MessageId=3100 +Severity=Success +Facility=System +SymbolicName=ERROR_XML_UNDEFINED_ENTITY +Language=Bulgarian +ERROR_XML_UNDEFINED_ENTITY - The XML contains an entity reference to an undefined entity. +. + +MessageId=3101 +Severity=Success +Facility=System +SymbolicName=ERROR_XML_MALFORMED_ENTITY +Language=Bulgarian +ERROR_XML_MALFORMED_ENTITY - The XML contains a malformed entity reference. +. + +MessageId=3102 +Severity=Success +Facility=System +SymbolicName=ERROR_XML_CHAR_NOT_IN_RANGE +Language=Bulgarian +ERROR_XML_CHAR_NOT_IN_RANGE - The XML contains a character which is not permitted in XML. +. + +MessageId=3200 +Severity=Success +Facility=System +SymbolicName=ERROR_PCM_COMPILER_DUPLICATE_EXTERNAL_PROXY +Language=Bulgarian +ERROR_PCM_COMPILER_DUPLICATE_EXTERNAL_PROXY - The manifest contained a duplicate definition for external proxy stub %1 at (%1:%2,%3) +. + +MessageId=3201 +Severity=Success +Facility=System +SymbolicName=ERROR_PCM_COMPILER_DUPLICATE_ASSEMBLY_REFERENCE +Language=Bulgarian +ERROR_PCM_COMPILER_DUPLICATE_ASSEMBLY_REFERENCE - The manifest already contains a reference to %4 - a second reference was found at (%1:%2,%3) +. + +MessageId=3202 +Severity=Success +Facility=System +SymbolicName=ERROR_PCM_COMPILER_INVALID_ASSEMBLY_REFERENCE +Language=Bulgarian +ERROR_PCM_COMPILER_INVALID_ASSEMBLY_REFERENCE - The assembly reference at (%1:%2,%3) is invalid. +. + +MessageId=3203 +Severity=Success +Facility=System +SymbolicName=ERROR_PCM_COMPILER_INVALID_ASSEMBLY_DEFINITION +Language=Bulgarian +ERROR_PCM_COMPILER_INVALID_ASSEMBLY_DEFINITION - The assembly definition at (%1:%2,%3) is invalid. +. + +MessageId=3204 +Severity=Success +Facility=System +SymbolicName=ERROR_PCM_COMPILER_DUPLICATE_WINDOW_CLASS +Language=Bulgarian +ERROR_PCM_COMPILER_DUPLICATE_WINDOW_CLASS - The manifest already contained the window class %4, found a second declaration at (%1:%2,%3) +. + +MessageId=3205 +Severity=Success +Facility=System +SymbolicName=ERROR_PCM_COMPILER_DUPLICATE_PROGID +Language=Bulgarian +ERROR_PCM_COMPILER_DUPLICATE_PROGID - The manifest already declared the progId %4, found a second declaration at (%1:%2,%3) +. + +MessageId=3206 +Severity=Success +Facility=System +SymbolicName=ERROR_PCM_COMPILER_DUPLICATE_NOINHERIT +Language=Bulgarian +ERROR_PCM_COMPILER_DUPLICATE_NOINHERIT - Only one noInherit tag may be present in a manifest, found a second tag at (%1:%2,%3) +. + +MessageId=3207 +Severity=Success +Facility=System +SymbolicName=ERROR_PCM_COMPILER_DUPLICATE_NOINHERITABLE +Language=Bulgarian +ERROR_PCM_COMPILER_DUPLICATE_NOINHERITABLE - Only one noInheritable tag may be present in a manifest, found a second tag at (%1:%2,%3) +. + +MessageId=3208 +Severity=Success +Facility=System +SymbolicName=ERROR_PCM_COMPILER_DUPLICATE_COM_CLASS +Language=Bulgarian +ERROR_PCM_COMPILER_DUPLICATE_COM_CLASS - The manifest contained a duplicate declaration of COM class %4 at (%1:%2,%3) +. + +MessageId=3209 +Severity=Success +Facility=System +SymbolicName=ERROR_PCM_COMPILER_DUPLICATE_FILE_NAME +Language=Bulgarian +ERROR_PCM_COMPILER_DUPLICATE_FILE_NAME - The manifest already declared the file %4, a second definition was found at (%1:%2,%3) +. + +MessageId=3210 +Severity=Success +Facility=System +SymbolicName=ERROR_PCM_COMPILER_DUPLICATE_CLR_SURROGATE +Language=Bulgarian +ERROR_PCM_COMPILER_DUPLICATE_CLR_SURROGATE - CLR surrogate %1 was already defined, second definition at (%1:%2,%3) is invalid. +. + +MessageId=3211 +Severity=Success +Facility=System +SymbolicName=ERROR_PCM_COMPILER_DUPLICATE_TYPE_LIBRARY +Language=Bulgarian +ERROR_PCM_COMPILER_DUPLICATE_TYPE_LIBRARY - Type library %1 was already defined, second definition at (%1:%2,%3) is invalid. +. + +MessageId=3212 +Severity=Success +Facility=System +SymbolicName=ERROR_PCM_COMPILER_DUPLICATE_PROXY_STUB +Language=Bulgarian +ERROR_PCM_COMPILER_DUPLICATE_PROXY_STUB - Proxy stub definition %1 was already defined, second definition at (%1:%2,%3) is invalid. +. + +MessageId=3213 +Severity=Success +Facility=System +SymbolicName=ERROR_PCM_COMPILER_DUPLICATE_CATEGORY_NAME +Language=Bulgarian +ERROR_PCM_COMPILER_DUPLICATE_CATEGORY_NAME - Category friendly name %4 was already used, second definition was found at (%1:%2,%3) is invalid. +. + +MessageId=3214 +Severity=Success +Facility=System +SymbolicName=ERROR_PCM_COMPILER_DUPLICATE_TOP_LEVEL_IDENTITY_FOUND +Language=Bulgarian +ERROR_PCM_COMPILER_DUPLICATE_TOP_LEVEL_IDENTITY_FOUND - Only one top-level assemblyIdentity tag may be present in a manifest. A second tag with identity %4 was found at (%1:%2,%3) +. + +MessageId=3215 +Severity=Success +Facility=System +SymbolicName=ERROR_PCM_COMPILER_UNKNOWN_ROOT_ELEMENT +Language=Bulgarian +ERROR_PCM_COMPILER_UNKNOWN_ROOT_ELEMENT - The root element for a manifest found at (%1:%2,%3) was not expected or was of the wrong version. +. + +MessageId=3216 +Severity=Success +Facility=System +SymbolicName=ERROR_PCM_COMPILER_INVALID_ELEMENT +Language=Bulgarian +ERROR_PCM_COMPILER_INVALID_ELEMENT - The element found at (%1:%2,%3) was not expected according to the manifest schema. +. + +MessageId=3217 +Severity=Success +Facility=System +SymbolicName=ERROR_PCM_COMPILER_MISSING_REQUIRED_ATTRIBUTE +Language=Bulgarian +ERROR_PCM_COMPILER_MISSING_REQUIRED_ATTRIBUTE - The element found at (%1:%2,%3) was missing the required attribute '%4'. See the manifest schema for more information +. + +MessageId=3218 +Severity=Success +Facility=System +SymbolicName=ERROR_PCM_COMPILER_INVALID_ATTRIBUTE_VALUE +Language=Bulgarian +ERROR_PCM_COMPILER_INVALID_ATTRIBUTE_VALUE - The attribute value %4 at (%1:%2,%3) was invalid according to the schema. +. + +MessageId=3219 +Severity=Success +Facility=System +SymbolicName=ERROR_PCM_COMPILER_UNEXPECTED_PCDATA +Language=Bulgarian +ERROR_PCM_COMPILER_UNEXPECTED_PCDATA - PCDATA or CDATA found at (%1:%2,%3) in the source document was not expected in the parent element %4. +. + +MessageId=3220 +Severity=Success +Facility=System +SymbolicName=ERROR_PCM_DUPLICATE_STRING_TABLE_ENT +Language=Bulgarian +ERROR_PCM_DUPLICATE_STRING_TABLE_ENT - The string table entry with culture %4, name %5, and value '%6' at (%1:%2,%3) duplicated a previous entry. +. + +MessageId=4000 +Severity=Success +Facility=System +SymbolicName=ERROR_WINS_INTERNAL +Language=Bulgarian +ERROR_WINS_INTERNAL - WINS encountered an error while processing the command. +. + +MessageId=4001 +Severity=Success +Facility=System +SymbolicName=ERROR_CAN_NOT_DEL_LOCAL_WINS +Language=Bulgarian +ERROR_CAN_NOT_DEL_LOCAL_WINS - The local WINS cannot be deleted. +. + +MessageId=4002 +Severity=Success +Facility=System +SymbolicName=ERROR_STATIC_INIT +Language=Bulgarian +ERROR_STATIC_INIT - The importation from the file failed. +. + +MessageId=4003 +Severity=Success +Facility=System +SymbolicName=ERROR_INC_BACKUP +Language=Bulgarian +ERROR_INC_BACKUP - The backup failed. Was a full backup done before? +. + +MessageId=4004 +Severity=Success +Facility=System +SymbolicName=ERROR_FULL_BACKUP +Language=Bulgarian +ERROR_FULL_BACKUP - The backup failed. Check the directory to which you are backing the database. +. + +MessageId=4005 +Severity=Success +Facility=System +SymbolicName=ERROR_REC_NON_EXISTENT +Language=Bulgarian +ERROR_REC_NON_EXISTENT - The name does not exist in the WINS database. +. + +MessageId=4006 +Severity=Success +Facility=System +SymbolicName=ERROR_RPL_NOT_ALLOWED +Language=Bulgarian +ERROR_RPL_NOT_ALLOWED - Replication with a nonconfigured partner is not allowed. +. + +MessageId=4100 +Severity=Success +Facility=System +SymbolicName=ERROR_DHCP_ADDRESS_CONFLICT +Language=Bulgarian +ERROR_DHCP_ADDRESS_CONFLICT - The DHCP client has obtained an IP address that is already in use on the network. The local interface will be disabled until the DHCP client can obtain a new address. +. + +MessageId=4200 +Severity=Success +Facility=System +SymbolicName=ERROR_WMI_GUID_NOT_FOUND +Language=Bulgarian +ERROR_WMI_GUID_NOT_FOUND - The GUID passed was not recognized as valid by a WMI data provider. +. + +MessageId=4201 +Severity=Success +Facility=System +SymbolicName=ERROR_WMI_INSTANCE_NOT_FOUND +Language=Bulgarian +ERROR_WMI_INSTANCE_NOT_FOUND - The instance name passed was not recognized as valid by a WMI data provider. +. + +MessageId=4202 +Severity=Success +Facility=System +SymbolicName=ERROR_WMI_ITEMID_NOT_FOUND +Language=Bulgarian +ERROR_WMI_ITEMID_NOT_FOUND - The data item ID passed was not recognized as valid by a WMI data provider. +. + +MessageId=4203 +Severity=Success +Facility=System +SymbolicName=ERROR_WMI_TRY_AGAIN +Language=Bulgarian +ERROR_WMI_TRY_AGAIN - The WMI request could not be completed and should be retried. +. + +MessageId=4204 +Severity=Success +Facility=System +SymbolicName=ERROR_WMI_DP_NOT_FOUND +Language=Bulgarian +ERROR_WMI_DP_NOT_FOUND - The WMI data provider could not be located. +. + +MessageId=4205 +Severity=Success +Facility=System +SymbolicName=ERROR_WMI_UNRESOLVED_INSTANCE_REF +Language=Bulgarian +ERROR_WMI_UNRESOLVED_INSTANCE_REF - The WMI data provider references an instance set that has not been registered. +. + +MessageId=4206 +Severity=Success +Facility=System +SymbolicName=ERROR_WMI_ALREADY_ENABLED +Language=Bulgarian +ERROR_WMI_ALREADY_ENABLED - The WMI data block or event notification has already been enabled. +. + +MessageId=4207 +Severity=Success +Facility=System +SymbolicName=ERROR_WMI_GUID_DISCONNECTED +Language=Bulgarian +ERROR_WMI_GUID_DISCONNECTED - The WMI data block is no longer available. +. + +MessageId=4208 +Severity=Success +Facility=System +SymbolicName=ERROR_WMI_SERVER_UNAVAILABLE +Language=Bulgarian +ERROR_WMI_SERVER_UNAVAILABLE - The WMI data service is not available. +. + +MessageId=4209 +Severity=Success +Facility=System +SymbolicName=ERROR_WMI_DP_FAILED +Language=Bulgarian +ERROR_WMI_DP_FAILED - The WMI data provider failed to carry out the request. +. + +MessageId=4210 +Severity=Success +Facility=System +SymbolicName=ERROR_WMI_INVALID_MOF +Language=Bulgarian +ERROR_WMI_INVALID_MOF - The WMI MOF information is not valid. +. + +MessageId=4211 +Severity=Success +Facility=System +SymbolicName=ERROR_WMI_INVALID_REGINFO +Language=Bulgarian +ERROR_WMI_INVALID_REGINFO - The WMI registration information is not valid. +. + +MessageId=4212 +Severity=Success +Facility=System +SymbolicName=ERROR_WMI_ALREADY_DISABLED +Language=Bulgarian +ERROR_WMI_ALREADY_DISABLED - The WMI data block or event notification has already been disabled. +. + +MessageId=4213 +Severity=Success +Facility=System +SymbolicName=ERROR_WMI_READ_ONLY +Language=Bulgarian +ERROR_WMI_READ_ONLY - The WMI data item or data block is read only. +. + +MessageId=4214 +Severity=Success +Facility=System +SymbolicName=ERROR_WMI_SET_FAILURE +Language=Bulgarian +ERROR_WMI_SET_FAILURE - The WMI data item or data block could not be changed. +. + +MessageId=4300 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_MEDIA +Language=Bulgarian +ERROR_INVALID_MEDIA - The media identifier does not represent a valid medium. +. + +MessageId=4301 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_LIBRARY +Language=Bulgarian +ERROR_INVALID_LIBRARY - The library identifier does not represent a valid library. +. + +MessageId=4302 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_MEDIA_POOL +Language=Bulgarian +ERROR_INVALID_MEDIA_POOL - The media pool identifier does not represent a valid media pool. +. + +MessageId=4303 +Severity=Success +Facility=System +SymbolicName=ERROR_DRIVE_MEDIA_MISMATCH +Language=Bulgarian +ERROR_DRIVE_MEDIA_MISMATCH - The drive and medium are not compatible or exist in different libraries. +. + +MessageId=4304 +Severity=Success +Facility=System +SymbolicName=ERROR_MEDIA_OFFLINE +Language=Bulgarian +ERROR_MEDIA_OFFLINE - The medium currently exists in an offline library and must be online to perform this operation. +. + +MessageId=4305 +Severity=Success +Facility=System +SymbolicName=ERROR_LIBRARY_OFFLINE +Language=Bulgarian +ERROR_LIBRARY_OFFLINE - The operation cannot be performed on an offline library. +. + +MessageId=4306 +Severity=Success +Facility=System +SymbolicName=ERROR_EMPTY +Language=Bulgarian +ERROR_EMPTY - The library, drive, or media pool is empty. +. + +MessageId=4307 +Severity=Success +Facility=System +SymbolicName=ERROR_NOT_EMPTY +Language=Bulgarian +ERROR_NOT_EMPTY - The library, drive, or media pool must be empty to perform this operation. +. + +MessageId=4308 +Severity=Success +Facility=System +SymbolicName=ERROR_MEDIA_UNAVAILABLE +Language=Bulgarian +ERROR_MEDIA_UNAVAILABLE - No media is currently available in this media pool or library. +. + +MessageId=4309 +Severity=Success +Facility=System +SymbolicName=ERROR_RESOURCE_DISABLED +Language=Bulgarian +ERROR_RESOURCE_DISABLED - A resource required for this operation is disabled. +. + +MessageId=4310 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_CLEANER +Language=Bulgarian +ERROR_INVALID_CLEANER - The media identifier does not represent a valid cleaner. +. + +MessageId=4311 +Severity=Success +Facility=System +SymbolicName=ERROR_UNABLE_TO_CLEAN +Language=Bulgarian +ERROR_UNABLE_TO_CLEAN - The drive cannot be cleaned or does not support cleaning. +. + +MessageId=4312 +Severity=Success +Facility=System +SymbolicName=ERROR_OBJECT_NOT_FOUND +Language=Bulgarian +ERROR_OBJECT_NOT_FOUND - The object identifier does not represent a valid object. +. + +MessageId=4313 +Severity=Success +Facility=System +SymbolicName=ERROR_DATABASE_FAILURE +Language=Bulgarian +ERROR_DATABASE_FAILURE - Unable to read from or write to the database. +. + +MessageId=4314 +Severity=Success +Facility=System +SymbolicName=ERROR_DATABASE_FULL +Language=Bulgarian +ERROR_DATABASE_FULL - The database is full. +. + +MessageId=4315 +Severity=Success +Facility=System +SymbolicName=ERROR_MEDIA_INCOMPATIBLE +Language=Bulgarian +ERROR_MEDIA_INCOMPATIBLE - The medium is not compatible with the device or media pool. +. + +MessageId=4316 +Severity=Success +Facility=System +SymbolicName=ERROR_RESOURCE_NOT_PRESENT +Language=Bulgarian +ERROR_RESOURCE_NOT_PRESENT - The resource required for this operation does not exist. +. + +MessageId=4317 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_OPERATION +Language=Bulgarian +ERROR_INVALID_OPERATION - The operation identifier is not valid. +. + +MessageId=4318 +Severity=Success +Facility=System +SymbolicName=ERROR_MEDIA_NOT_AVAILABLE +Language=Bulgarian +ERROR_MEDIA_NOT_AVAILABLE - The media is not mounted or ready for use. +. + +MessageId=4319 +Severity=Success +Facility=System +SymbolicName=ERROR_DEVICE_NOT_AVAILABLE +Language=Bulgarian +ERROR_DEVICE_NOT_AVAILABLE - The device is not ready for use. +. + +MessageId=4320 +Severity=Success +Facility=System +SymbolicName=ERROR_REQUEST_REFUSED +Language=Bulgarian +ERROR_REQUEST_REFUSED - The operator or administrator has refused the request. +. + +MessageId=4321 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_DRIVE_OBJECT +Language=Bulgarian +ERROR_INVALID_DRIVE_OBJECT - The drive identifier does not represent a valid drive. +. + +MessageId=4322 +Severity=Success +Facility=System +SymbolicName=ERROR_LIBRARY_FULL +Language=Bulgarian +ERROR_LIBRARY_FULL - Library is full. No slot is available for use. +. + +MessageId=4323 +Severity=Success +Facility=System +SymbolicName=ERROR_MEDIUM_NOT_ACCESSIBLE +Language=Bulgarian +ERROR_MEDIUM_NOT_ACCESSIBLE - The transport cannot access the medium. +. + +MessageId=4324 +Severity=Success +Facility=System +SymbolicName=ERROR_UNABLE_TO_LOAD_MEDIUM +Language=Bulgarian +ERROR_UNABLE_TO_LOAD_MEDIUM - Unable to load the medium into the drive. +. + +MessageId=4325 +Severity=Success +Facility=System +SymbolicName=ERROR_UNABLE_TO_INVENTORY_DRIVE +Language=Bulgarian +ERROR_UNABLE_TO_INVENTORY_DRIVE - Unable to retrieve status about the drive. +. + +MessageId=4326 +Severity=Success +Facility=System +SymbolicName=ERROR_UNABLE_TO_INVENTORY_SLOT +Language=Bulgarian +ERROR_UNABLE_TO_INVENTORY_SLOT - Unable to retrieve status about the slot. +. + +MessageId=4327 +Severity=Success +Facility=System +SymbolicName=ERROR_UNABLE_TO_INVENTORY_TRANSPORT +Language=Bulgarian +ERROR_UNABLE_TO_INVENTORY_TRANSPORT - Unable to retrieve status about the transport. +. + +MessageId=4328 +Severity=Success +Facility=System +SymbolicName=ERROR_TRANSPORT_FULL +Language=Bulgarian +ERROR_TRANSPORT_FULL - Cannot use the transport because it is already in use. +. + +MessageId=4329 +Severity=Success +Facility=System +SymbolicName=ERROR_CONTROLLING_IEPORT +Language=Bulgarian +ERROR_CONTROLLING_IEPORT - Unable to open or close the inject/eject port. +. + +MessageId=4330 +Severity=Success +Facility=System +SymbolicName=ERROR_UNABLE_TO_EJECT_MOUNTED_MEDIA +Language=Bulgarian +ERROR_UNABLE_TO_EJECT_MOUNTED_MEDIA - Unable to eject the media because it is in a drive. +. + +MessageId=4331 +Severity=Success +Facility=System +SymbolicName=ERROR_CLEANER_SLOT_SET +Language=Bulgarian +ERROR_CLEANER_SLOT_SET - A cleaner slot is already reserved. +. + +MessageId=4332 +Severity=Success +Facility=System +SymbolicName=ERROR_CLEANER_SLOT_NOT_SET +Language=Bulgarian +ERROR_CLEANER_SLOT_NOT_SET - A cleaner slot is not reserved. +. + +MessageId=4333 +Severity=Success +Facility=System +SymbolicName=ERROR_CLEANER_CARTRIDGE_SPENT +Language=Bulgarian +ERROR_CLEANER_CARTRIDGE_SPENT - The cleaner cartridge has performed the maximum number of drive cleanings. +. + +MessageId=4334 +Severity=Success +Facility=System +SymbolicName=ERROR_UNEXPECTED_OMID +Language=Bulgarian +ERROR_UNEXPECTED_OMID - Unexpected on-medium identifier. +. + +MessageId=4335 +Severity=Success +Facility=System +SymbolicName=ERROR_CANT_DELETE_LAST_ITEM +Language=Bulgarian +ERROR_CANT_DELETE_LAST_ITEM - The last remaining item in this group or resource cannot be deleted. +. + +MessageId=4336 +Severity=Success +Facility=System +SymbolicName=ERROR_MESSAGE_EXCEEDS_MAX_SIZE +Language=Bulgarian +ERROR_MESSAGE_EXCEEDS_MAX_SIZE - The message provided exceeds the maximum size allowed for this parameter. +. + +MessageId=4337 +Severity=Success +Facility=System +SymbolicName=ERROR_VOLUME_CONTAINS_SYS_FILES +Language=Bulgarian +ERROR_VOLUME_CONTAINS_SYS_FILES - The volume contains system or paging files. +. + +MessageId=4338 +Severity=Success +Facility=System +SymbolicName=ERROR_INDIGENOUS_TYPE +Language=Bulgarian +ERROR_INDIGENOUS_TYPE - The media type cannot be removed from this library since at least one drive in the library reports it can support this media type. +. + +MessageId=4339 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_SUPPORTING_DRIVES +Language=Bulgarian +ERROR_NO_SUPPORTING_DRIVES - This offline media cannot be mounted on this system since no enabled drives are present which can be used. +. + +MessageId=4340 +Severity=Success +Facility=System +SymbolicName=ERROR_CLEANER_CARTRIDGE_INSTALLED +Language=Bulgarian +ERROR_CLEANER_CARTRIDGE_INSTALLED - A cleaner cartridge is present in the tape library. +. + +MessageId=4350 +Severity=Success +Facility=System +SymbolicName=ERROR_FILE_OFFLINE +Language=Bulgarian +ERROR_FILE_OFFLINE - The remote storage service was not able to recall the file. +. + +MessageId=4351 +Severity=Success +Facility=System +SymbolicName=ERROR_REMOTE_STORAGE_NOT_ACTIVE +Language=Bulgarian +ERROR_REMOTE_STORAGE_NOT_ACTIVE - The remote storage service is not operational at this time. +. + +MessageId=4352 +Severity=Success +Facility=System +SymbolicName=ERROR_REMOTE_STORAGE_MEDIA_ERROR +Language=Bulgarian +ERROR_REMOTE_STORAGE_MEDIA_ERROR - The remote storage service encountered a media error. +. + +MessageId=4390 +Severity=Success +Facility=System +SymbolicName=ERROR_NOT_A_REPARSE_POINT +Language=Bulgarian +ERROR_NOT_A_REPARSE_POINT - The file or directory is not a reparse point. +. + +MessageId=4391 +Severity=Success +Facility=System +SymbolicName=ERROR_REPARSE_ATTRIBUTE_CONFLICT +Language=Bulgarian +ERROR_REPARSE_ATTRIBUTE_CONFLICT - The reparse point attribute cannot be set because it conflicts with an existing attribute. +. + +MessageId=4392 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_REPARSE_DATA +Language=Bulgarian +ERROR_INVALID_REPARSE_DATA - The data present in the reparse point buffer is invalid. +. + +MessageId=4393 +Severity=Success +Facility=System +SymbolicName=ERROR_REPARSE_TAG_INVALID +Language=Bulgarian +ERROR_REPARSE_TAG_INVALID - The tag present in the reparse point buffer is invalid. +. + +MessageId=4394 +Severity=Success +Facility=System +SymbolicName=ERROR_REPARSE_TAG_MISMATCH +Language=Bulgarian +ERROR_REPARSE_TAG_MISMATCH - There is a mismatch between the tag specified in the request and the tag present in the reparse point. +. + +MessageId=4500 +Severity=Success +Facility=System +SymbolicName=ERROR_VOLUME_NOT_SIS_ENABLED +Language=Bulgarian +ERROR_VOLUME_NOT_SIS_ENABLED - Single Instance Storage is not available on this volume. +. + +MessageId=5001 +Severity=Success +Facility=System +SymbolicName=ERROR_DEPENDENT_RESOURCE_EXISTS +Language=Bulgarian +ERROR_DEPENDENT_RESOURCE_EXISTS - The cluster resource cannot be moved to another group because other resources are dependent on it. +. + +MessageId=5002 +Severity=Success +Facility=System +SymbolicName=ERROR_DEPENDENCY_NOT_FOUND +Language=Bulgarian +ERROR_DEPENDENCY_NOT_FOUND - The cluster resource dependency cannot be found. +. + +MessageId=5003 +Severity=Success +Facility=System +SymbolicName=ERROR_DEPENDENCY_ALREADY_EXISTS +Language=Bulgarian +ERROR_DEPENDENCY_ALREADY_EXISTS - The cluster resource cannot be made dependent on the specified resource because it is already dependent. +. + +MessageId=5004 +Severity=Success +Facility=System +SymbolicName=ERROR_RESOURCE_NOT_ONLINE +Language=Bulgarian +ERROR_RESOURCE_NOT_ONLINE - The cluster resource is not online. +. + +MessageId=5005 +Severity=Success +Facility=System +SymbolicName=ERROR_HOST_NODE_NOT_AVAILABLE +Language=Bulgarian +ERROR_HOST_NODE_NOT_AVAILABLE - A cluster node is not available for this operation. +. + +MessageId=5006 +Severity=Success +Facility=System +SymbolicName=ERROR_RESOURCE_NOT_AVAILABLE +Language=Bulgarian +ERROR_RESOURCE_NOT_AVAILABLE - The cluster resource is not available. +. + +MessageId=5007 +Severity=Success +Facility=System +SymbolicName=ERROR_RESOURCE_NOT_FOUND +Language=Bulgarian +ERROR_RESOURCE_NOT_FOUND - The cluster resource could not be found. +. + +MessageId=5008 +Severity=Success +Facility=System +SymbolicName=ERROR_SHUTDOWN_CLUSTER +Language=Bulgarian +ERROR_SHUTDOWN_CLUSTER - The cluster is being shut down. +. + +MessageId=5009 +Severity=Success +Facility=System +SymbolicName=ERROR_CANT_EVICT_ACTIVE_NODE +Language=Bulgarian +ERROR_CANT_EVICT_ACTIVE_NODE - A cluster node cannot be evicted from the cluster unless the node is down. +. + +MessageId=5010 +Severity=Success +Facility=System +SymbolicName=ERROR_OBJECT_ALREADY_EXISTS +Language=Bulgarian +ERROR_OBJECT_ALREADY_EXISTS - The object already exists. +. + +MessageId=5011 +Severity=Success +Facility=System +SymbolicName=ERROR_OBJECT_IN_LIST +Language=Bulgarian +ERROR_OBJECT_IN_LIST - The object is already in the list. +. + +MessageId=5012 +Severity=Success +Facility=System +SymbolicName=ERROR_GROUP_NOT_AVAILABLE +Language=Bulgarian +ERROR_GROUP_NOT_AVAILABLE - The cluster group is not available for any new requests. +. + +MessageId=5013 +Severity=Success +Facility=System +SymbolicName=ERROR_GROUP_NOT_FOUND +Language=Bulgarian +ERROR_GROUP_NOT_FOUND - The cluster group could not be found. +. + +MessageId=5014 +Severity=Success +Facility=System +SymbolicName=ERROR_GROUP_NOT_ONLINE +Language=Bulgarian +ERROR_GROUP_NOT_ONLINE - The operation could not be completed because the cluster group is not online. +. + +MessageId=5015 +Severity=Success +Facility=System +SymbolicName=ERROR_HOST_NODE_NOT_RESOURCE_OWNER +Language=Bulgarian +ERROR_HOST_NODE_NOT_RESOURCE_OWNER - The cluster node is not the owner of the resource. +. + +MessageId=5016 +Severity=Success +Facility=System +SymbolicName=ERROR_HOST_NODE_NOT_GROUP_OWNER +Language=Bulgarian +ERROR_HOST_NODE_NOT_GROUP_OWNER - The cluster node is not the owner of the group. +. + +MessageId=5017 +Severity=Success +Facility=System +SymbolicName=ERROR_RESMON_CREATE_FAILED +Language=Bulgarian +ERROR_RESMON_CREATE_FAILED - The cluster resource could not be created in the specified resource monitor. +. + +MessageId=5018 +Severity=Success +Facility=System +SymbolicName=ERROR_RESMON_ONLINE_FAILED +Language=Bulgarian +ERROR_RESMON_ONLINE_FAILED - The cluster resource could not be brought online by the resource monitor. +. + +MessageId=5019 +Severity=Success +Facility=System +SymbolicName=ERROR_RESOURCE_ONLINE +Language=Bulgarian +ERROR_RESOURCE_ONLINE - The operation could not be completed because the cluster resource is online. +. + +MessageId=5020 +Severity=Success +Facility=System +SymbolicName=ERROR_QUORUM_RESOURCE +Language=Bulgarian +ERROR_QUORUM_RESOURCE - The cluster resource could not be deleted or brought offline because it is the quorum resource. +. + +MessageId=5021 +Severity=Success +Facility=System +SymbolicName=ERROR_NOT_QUORUM_CAPABLE +Language=Bulgarian +ERROR_NOT_QUORUM_CAPABLE - The cluster could not make the specified resource a quorum resource because it is not capable of being a quorum resource. +. + +MessageId=5022 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_SHUTTING_DOWN +Language=Bulgarian +ERROR_CLUSTER_SHUTTING_DOWN - The cluster software is shutting down. +. + +MessageId=5023 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_STATE +Language=Bulgarian +ERROR_INVALID_STATE - The group or resource is not in the correct state to perform the requested operation. +. + +MessageId=5024 +Severity=Success +Facility=System +SymbolicName=ERROR_RESOURCE_PROPERTIES_STORED +Language=Bulgarian +ERROR_RESOURCE_PROPERTIES_STORED - The properties were stored but not all changes will take effect until the next time the resource is brought online. +. + +MessageId=5025 +Severity=Success +Facility=System +SymbolicName=ERROR_NOT_QUORUM_CLASS +Language=Bulgarian +ERROR_NOT_QUORUM_CLASS - The cluster could not make the specified resource a quorum resource because it does not belong to a shared storage class. +. + +MessageId=5026 +Severity=Success +Facility=System +SymbolicName=ERROR_CORE_RESOURCE +Language=Bulgarian +ERROR_CORE_RESOURCE - The cluster resource could not be deleted since it is a core resource. +. + +MessageId=5027 +Severity=Success +Facility=System +SymbolicName=ERROR_QUORUM_RESOURCE_ONLINE_FAILED +Language=Bulgarian +ERROR_QUORUM_RESOURCE_ONLINE_FAILED - The quorum resource failed to come online. +. + +MessageId=5028 +Severity=Success +Facility=System +SymbolicName=ERROR_QUORUMLOG_OPEN_FAILED +Language=Bulgarian +ERROR_QUORUMLOG_OPEN_FAILED - The quorum log could not be created or mounted successfully. +. + +MessageId=5029 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTERLOG_CORRUPT +Language=Bulgarian +ERROR_CLUSTERLOG_CORRUPT - The cluster log is corrupt. +. + +MessageId=5030 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTERLOG_RECORD_EXCEEDS_MAXSIZE +Language=Bulgarian +ERROR_CLUSTERLOG_RECORD_EXCEEDS_MAXSIZE - The record could not be written to the cluster log since it exceeds the maximum size. +. + +MessageId=5031 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTERLOG_EXCEEDS_MAXSIZE +Language=Bulgarian +ERROR_CLUSTERLOG_EXCEEDS_MAXSIZE - The cluster log exceeds its maximum size. +. + +MessageId=5032 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTERLOG_CHKPOINT_NOT_FOUND +Language=Bulgarian +ERROR_CLUSTERLOG_CHKPOINT_NOT_FOUND - No checkpoint record was found in the cluster log. +. + +MessageId=5033 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTERLOG_NOT_ENOUGH_SPACE +Language=Bulgarian +ERROR_CLUSTERLOG_NOT_ENOUGH_SPACE - The minimum required disk space needed for logging is not available. +. + +MessageId=5034 +Severity=Success +Facility=System +SymbolicName=ERROR_QUORUM_OWNER_ALIVE +Language=Bulgarian +ERROR_QUORUM_OWNER_ALIVE - The cluster node failed to take control of the quorum resource because the resource is owned by another active node. +. + +MessageId=5035 +Severity=Success +Facility=System +SymbolicName=ERROR_NETWORK_NOT_AVAILABLE +Language=Bulgarian +ERROR_NETWORK_NOT_AVAILABLE - A cluster network is not available for this operation. +. + +MessageId=5036 +Severity=Success +Facility=System +SymbolicName=ERROR_NODE_NOT_AVAILABLE +Language=Bulgarian +ERROR_NODE_NOT_AVAILABLE - A cluster node is not available for this operation. +. + +MessageId=5037 +Severity=Success +Facility=System +SymbolicName=ERROR_ALL_NODES_NOT_AVAILABLE +Language=Bulgarian +ERROR_ALL_NODES_NOT_AVAILABLE - All cluster nodes must be running to perform this operation. +. + +MessageId=5038 +Severity=Success +Facility=System +SymbolicName=ERROR_RESOURCE_FAILED +Language=Bulgarian +ERROR_RESOURCE_FAILED - A cluster resource failed. +. + +MessageId=5039 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_INVALID_NODE +Language=Bulgarian +ERROR_CLUSTER_INVALID_NODE - The cluster node is not valid. +. + +MessageId=5040 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_NODE_EXISTS +Language=Bulgarian +ERROR_CLUSTER_NODE_EXISTS - The cluster node already exists. +. + +MessageId=5041 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_JOIN_IN_PROGRESS +Language=Bulgarian +ERROR_CLUSTER_JOIN_IN_PROGRESS - A node is in the process of joining the cluster. +. + +MessageId=5042 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_NODE_NOT_FOUND +Language=Bulgarian +ERROR_CLUSTER_NODE_NOT_FOUND - The cluster node was not found. +. + +MessageId=5043 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_LOCAL_NODE_NOT_FOUND +Language=Bulgarian +ERROR_CLUSTER_LOCAL_NODE_NOT_FOUND - The cluster local node information was not found. +. + +MessageId=5044 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_NETWORK_EXISTS +Language=Bulgarian +ERROR_CLUSTER_NETWORK_EXISTS - The cluster network already exists. +. + +MessageId=5045 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_NETWORK_NOT_FOUND +Language=Bulgarian +ERROR_CLUSTER_NETWORK_NOT_FOUND - The cluster network was not found. +. + +MessageId=5046 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_NETINTERFACE_EXISTS +Language=Bulgarian +ERROR_CLUSTER_NETINTERFACE_EXISTS - The cluster network interface already exists. +. + +MessageId=5047 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_NETINTERFACE_NOT_FOUND +Language=Bulgarian +ERROR_CLUSTER_NETINTERFACE_NOT_FOUND - The cluster network interface was not found. +. + +MessageId=5048 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_INVALID_REQUEST +Language=Bulgarian +ERROR_CLUSTER_INVALID_REQUEST - The cluster request is not valid for this object. +. + +MessageId=5049 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_INVALID_NETWORK_PROVIDER +Language=Bulgarian +ERROR_CLUSTER_INVALID_NETWORK_PROVIDER - The cluster network provider is not valid. +. + +MessageId=5050 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_NODE_DOWN +Language=Bulgarian +ERROR_CLUSTER_NODE_DOWN - The cluster node is down. +. + +MessageId=5051 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_NODE_UNREACHABLE +Language=Bulgarian +ERROR_CLUSTER_NODE_UNREACHABLE - The cluster node is not reachable. +. + +MessageId=5052 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_NODE_NOT_MEMBER +Language=Bulgarian +ERROR_CLUSTER_NODE_NOT_MEMBER - The cluster node is not a member of the cluster. +. + +MessageId=5053 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_JOIN_NOT_IN_PROGRESS +Language=Bulgarian +ERROR_CLUSTER_JOIN_NOT_IN_PROGRESS - A cluster join operation is not in progress. +. + +MessageId=5054 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_INVALID_NETWORK +Language=Bulgarian +ERROR_CLUSTER_INVALID_NETWORK - The cluster network is not valid. +. + +MessageId=5056 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_NODE_UP +Language=Bulgarian +ERROR_CLUSTER_NODE_UP - The cluster node is up. +. + +MessageId=5057 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_IPADDR_IN_USE +Language=Bulgarian +ERROR_CLUSTER_IPADDR_IN_USE - The cluster IP address is already in use. +. + +MessageId=5058 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_NODE_NOT_PAUSED +Language=Bulgarian +ERROR_CLUSTER_NODE_NOT_PAUSED - The cluster node is not paused. +. + +MessageId=5059 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_NO_SECURITY_CONTEXT +Language=Bulgarian +ERROR_CLUSTER_NO_SECURITY_CONTEXT - No cluster security context is available. +. + +MessageId=5060 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_NETWORK_NOT_INTERNAL +Language=Bulgarian +ERROR_CLUSTER_NETWORK_NOT_INTERNAL - The cluster network is not configured for internal cluster communication. +. + +MessageId=5061 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_NODE_ALREADY_UP +Language=Bulgarian +ERROR_CLUSTER_NODE_ALREADY_UP - The cluster node is already up. +. + +MessageId=5062 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_NODE_ALREADY_DOWN +Language=Bulgarian +ERROR_CLUSTER_NODE_ALREADY_DOWN - The cluster node is already down. +. + +MessageId=5063 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_NETWORK_ALREADY_ONLINE +Language=Bulgarian +ERROR_CLUSTER_NETWORK_ALREADY_ONLINE - The cluster network is already online. +. + +MessageId=5064 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_NETWORK_ALREADY_OFFLINE +Language=Bulgarian +ERROR_CLUSTER_NETWORK_ALREADY_OFFLINE - The cluster network is already offline. +. + +MessageId=5065 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_NODE_ALREADY_MEMBER +Language=Bulgarian +ERROR_CLUSTER_NODE_ALREADY_MEMBER - The cluster node is already a member of the cluster. +. + +MessageId=5066 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_LAST_INTERNAL_NETWORK +Language=Bulgarian +ERROR_CLUSTER_LAST_INTERNAL_NETWORK - The cluster network is the only one configured for internal cluster communication between two or more active cluster nodes. The internal communication capability cannot be removed from the network. +. + +MessageId=5067 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_NETWORK_HAS_DEPENDENTS +Language=Bulgarian +ERROR_CLUSTER_NETWORK_HAS_DEPENDENTS - One or more cluster resources depend on the network to provide service to clients. The client access capability cannot be removed from the network. +. + +MessageId=5068 +Severity=Success +Facility=System +SymbolicName=ERROR_INVALID_OPERATION_ON_QUORUM +Language=Bulgarian +ERROR_INVALID_OPERATION_ON_QUORUM - This operation cannot be performed on the cluster resource as it the quorum resource. You may not bring the quorum resource offline or modify its possible owners list. +. + +MessageId=5069 +Severity=Success +Facility=System +SymbolicName=ERROR_DEPENDENCY_NOT_ALLOWED +Language=Bulgarian +ERROR_DEPENDENCY_NOT_ALLOWED - The cluster quorum resource is not allowed to have any dependencies. +. + +MessageId=5070 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_NODE_PAUSED +Language=Bulgarian +ERROR_CLUSTER_NODE_PAUSED - The cluster node is paused. +. + +MessageId=5071 +Severity=Success +Facility=System +SymbolicName=ERROR_NODE_CANT_HOST_RESOURCE +Language=Bulgarian +ERROR_NODE_CANT_HOST_RESOURCE - The cluster resource cannot be brought online. The owner node cannot run this resource. +. + +MessageId=5072 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_NODE_NOT_READY +Language=Bulgarian +ERROR_CLUSTER_NODE_NOT_READY - The cluster node is not ready to perform the requested operation. +. + +MessageId=5073 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_NODE_SHUTTING_DOWN +Language=Bulgarian +ERROR_CLUSTER_NODE_SHUTTING_DOWN - The cluster node is shutting down. +. + +MessageId=5074 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_JOIN_ABORTED +Language=Bulgarian +ERROR_CLUSTER_JOIN_ABORTED - The cluster join operation was aborted. +. + +MessageId=5075 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_INCOMPATIBLE_VERSIONS +Language=Bulgarian +ERROR_CLUSTER_INCOMPATIBLE_VERSIONS - The cluster join operation failed due to incompatible software versions between the joining node and its sponsor. +. + +MessageId=5076 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_MAXNUM_OF_RESOURCES_EXCEEDED +Language=Bulgarian +ERROR_CLUSTER_MAXNUM_OF_RESOURCES_EXCEEDED - This resource cannot be created because the cluster has reached the limit on the number of resources it can monitor. +. + +MessageId=5077 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_SYSTEM_CONFIG_CHANGED +Language=Bulgarian +ERROR_CLUSTER_SYSTEM_CONFIG_CHANGED - The system configuration changed during the cluster join or form operation. The join or form operation was aborted. +. + +MessageId=5078 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_RESOURCE_TYPE_NOT_FOUND +Language=Bulgarian +ERROR_CLUSTER_RESOURCE_TYPE_NOT_FOUND - The specified resource type was not found. +. + +MessageId=5079 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_RESTYPE_NOT_SUPPORTED +Language=Bulgarian +ERROR_CLUSTER_RESTYPE_NOT_SUPPORTED - The specified node does not support a resource of this type. This may be due to version inconsistencies or due to the absence of the resource DLL on this node. +. + +MessageId=5080 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_RESNAME_NOT_FOUND +Language=Bulgarian +ERROR_CLUSTER_RESNAME_NOT_FOUND - The specified resource name is supported by this resource DLL. This may be due to a bad (or changed) name supplied to the resource DLL. +. + +MessageId=5081 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_NO_RPC_PACKAGES_REGISTERED +Language=Bulgarian +ERROR_CLUSTER_NO_RPC_PACKAGES_REGISTERED - No authentication package could be registered with the RPC server. +. + +MessageId=5082 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_OWNER_NOT_IN_PREFLIST +Language=Bulgarian +ERROR_CLUSTER_OWNER_NOT_IN_PREFLIST - You cannot bring the group online because the owner of the group is not in the preferred list for the group. To change the owner node for the group, move the group. +. + +MessageId=5083 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_DATABASE_SEQMISMATCH +Language=Bulgarian +ERROR_CLUSTER_DATABASE_SEQMISMATCH - The join operation failed because the cluster database sequence number has changed or is incompatible with the locker node. This may happen during a join operation if the cluster database was changing during the join. +. + +MessageId=5084 +Severity=Success +Facility=System +SymbolicName=ERROR_RESMON_INVALID_STATE +Language=Bulgarian +ERROR_RESMON_INVALID_STATE - The resource monitor will not allow the fail operation to be performed while the resource is in its current state. This may happen if the resource is in a pending state. +. + +MessageId=5085 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_GUM_NOT_LOCKER +Language=Bulgarian +ERROR_CLUSTER_GUM_NOT_LOCKER - A non locker code got a request to reserve the lock for making global updates. +. + +MessageId=5086 +Severity=Success +Facility=System +SymbolicName=ERROR_QUORUM_DISK_NOT_FOUND +Language=Bulgarian +ERROR_QUORUM_DISK_NOT_FOUND - The quorum disk could not be located by the cluster service. +. + +MessageId=5087 +Severity=Success +Facility=System +SymbolicName=ERROR_DATABASE_BACKUP_CORRUPT +Language=Bulgarian +ERROR_DATABASE_BACKUP_CORRUPT - The backup up cluster database is possibly corrupt. +. + +MessageId=5088 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_NODE_ALREADY_HAS_DFS_ROOT +Language=Bulgarian +ERROR_CLUSTER_NODE_ALREADY_HAS_DFS_ROOT - A DFS root already exists in this cluster node. +. + +MessageId=5089 +Severity=Success +Facility=System +SymbolicName=ERROR_RESOURCE_PROPERTY_UNCHANGEABLE +Language=Bulgarian +ERROR_RESOURCE_PROPERTY_UNCHANGEABLE - An attempt to modify a resource property failed because it conflicts with another existing property. +. + +MessageId=5890 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_MEMBERSHIP_INVALID_STATE +Language=Bulgarian +ERROR_CLUSTER_MEMBERSHIP_INVALID_STATE - An operation was attempted that is incompatible with the current membership state of the node. +. + +MessageId=5891 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_QUORUMLOG_NOT_FOUND +Language=Bulgarian +ERROR_CLUSTER_QUORUMLOG_NOT_FOUND - The quorum resource does not contain the quorum log. +. + +MessageId=5892 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_MEMBERSHIP_HALT +Language=Bulgarian +ERROR_CLUSTER_MEMBERSHIP_HALT - The membership engine requested shutdown of the cluster service on this node. +. + +MessageId=5893 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_INSTANCE_ID_MISMATCH +Language=Bulgarian +ERROR_CLUSTER_INSTANCE_ID_MISMATCH - The join operation failed because the cluster instance ID of the joining node does not match the cluster instance ID of the sponsor node. +. + +MessageId=5894 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_NETWORK_NOT_FOUND_FOR_IP +Language=Bulgarian +ERROR_CLUSTER_NETWORK_NOT_FOUND_FOR_IP - A matching network for the specified IP address could not be found. Please also specify a subnet mask and a cluster network. +. + +MessageId=5895 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_PROPERTY_DATA_TYPE_MISMATCH +Language=Bulgarian +ERROR_CLUSTER_PROPERTY_DATA_TYPE_MISMATCH - The actual data type of the property did not match the expected data type of the property. +. + +MessageId=5896 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_EVICT_WITHOUT_CLEANUP +Language=Bulgarian +ERROR_CLUSTER_EVICT_WITHOUT_CLEANUP - The cluster node was evicted from the cluster successfully, but the node was not cleaned up. Extended status information explaining why the node was not cleaned up is available. +. + +MessageId=5897 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_PARAMETER_MISMATCH +Language=Bulgarian +ERROR_CLUSTER_PARAMETER_MISMATCH - Two or more parameter values specified for a resource's properties are in conflict. +. + +MessageId=5898 +Severity=Success +Facility=System +SymbolicName=ERROR_NODE_CANNOT_BE_CLUSTERED +Language=Bulgarian +ERROR_NODE_CANNOT_BE_CLUSTERED - This computer cannot be made a member of a cluster. +. + +MessageId=5899 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_WRONG_OS_VERSION +Language=Bulgarian +ERROR_CLUSTER_WRONG_OS_VERSION - This computer cannot be made a member of a cluster because it does not have the correct version of Windows installed. +. + +MessageId=5900 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_CANT_CREATE_DUP_CLUSTER_NAME +Language=Bulgarian +ERROR_CLUSTER_CANT_CREATE_DUP_CLUSTER_NAME - A cluster cannot be created with the specified cluster name because that cluster name is already in use. Specify a different name for the cluster. +. + +MessageId=5901 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSCFG_ALREADY_COMMITTED +Language=Bulgarian +ERROR_CLUSCFG_ALREADY_COMMITTED - The cluster configuration action has already been committed. +. + +MessageId=5902 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSCFG_ROLLBACK_FAILED +Language=Bulgarian +ERROR_CLUSCFG_ROLLBACK_FAILED - The cluster configuration action could not be rolled back. +. + +MessageId=5903 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSCFG_SYSTEM_DISK_DRIVE_LETTER_CONFLICT +Language=Bulgarian +ERROR_CLUSCFG_SYSTEM_DISK_DRIVE_LETTER_CONFLICT - The drive letter assigned to a system disk on one node conflicted with the driver letter assigned to a disk on another node. +. + +MessageId=5904 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_OLD_VERSION +Language=Bulgarian +ERROR_CLUSTER_OLD_VERSION - One or more nodes in the cluster are running a version of Windows that does not support this operation. +. + +MessageId=5905 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_MISMATCHED_COMPUTER_ACCT_NAME +Language=Bulgarian +ERROR_CLUSTER_MISMATCHED_COMPUTER_ACCT_NAME - The name of the corresponding computer account doesn't match the Network Name for this resource. +. + +MessageId=5906 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_NO_NET_ADAPTERS +Language=Bulgarian +ERROR_CLUSTER_NO_NET_ADAPTERS - No network adapters are available. +. + +MessageId=5907 +Severity=Success +Facility=System +SymbolicName=ERROR_CLUSTER_POISONED +Language=Bulgarian +ERROR_CLUSTER_POISONED - The cluster node has been poisoned. +. + +MessageId=6000 +Severity=Success +Facility=System +SymbolicName=ERROR_ENCRYPTION_FAILED +Language=Bulgarian +ERROR_ENCRYPTION_FAILED - The specified file could not be encrypted. +. + +MessageId=6001 +Severity=Success +Facility=System +SymbolicName=ERROR_DECRYPTION_FAILED +Language=Bulgarian +ERROR_DECRYPTION_FAILED - The specified file could not be decrypted. +. + +MessageId=6002 +Severity=Success +Facility=System +SymbolicName=ERROR_FILE_ENCRYPTED +Language=Bulgarian +ERROR_FILE_ENCRYPTED - The specified file is encrypted and the user does not have the ability to decrypt it. +. + +MessageId=6003 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_RECOVERY_POLICY +Language=Bulgarian +ERROR_NO_RECOVERY_POLICY - There is no valid encryption recovery policy configured for this system. +. + +MessageId=6004 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_EFS +Language=Bulgarian +ERROR_NO_EFS - The required encryption driver is not loaded for this system. +. + +MessageId=6005 +Severity=Success +Facility=System +SymbolicName=ERROR_WRONG_EFS +Language=Bulgarian +ERROR_WRONG_EFS - The file was encrypted with a different encryption driver than is currently loaded. +. + +MessageId=6006 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_USER_KEYS +Language=Bulgarian +ERROR_NO_USER_KEYS - There are no EFS keys defined for the user. +. + +MessageId=6007 +Severity=Success +Facility=System +SymbolicName=ERROR_FILE_NOT_ENCRYPTED +Language=Bulgarian +ERROR_FILE_NOT_ENCRYPTED - The specified file is not encrypted. +. + +MessageId=6008 +Severity=Success +Facility=System +SymbolicName=ERROR_NOT_EXPORT_FORMAT +Language=Bulgarian +ERROR_NOT_EXPORT_FORMAT - The specified file is not in the defined EFS export format. +. + +MessageId=6009 +Severity=Success +Facility=System +SymbolicName=ERROR_FILE_READ_ONLY +Language=Bulgarian +ERROR_FILE_READ_ONLY - The specified file is read only. +. + +MessageId=6010 +Severity=Success +Facility=System +SymbolicName=ERROR_DIR_EFS_DISALLOWED +Language=Bulgarian +ERROR_DIR_EFS_DISALLOWED - The directory has been disabled for encryption. +. + +MessageId=6011 +Severity=Success +Facility=System +SymbolicName=ERROR_EFS_SERVER_NOT_TRUSTED +Language=Bulgarian +ERROR_EFS_SERVER_NOT_TRUSTED - The server is not trusted for remote encryption operation. +. + +MessageId=6012 +Severity=Success +Facility=System +SymbolicName=ERROR_BAD_RECOVERY_POLICY +Language=Bulgarian +ERROR_BAD_RECOVERY_POLICY - Recovery policy configured for this system contains invalid recovery certificate. +. + +MessageId=6013 +Severity=Success +Facility=System +SymbolicName=ERROR_EFS_ALG_BLOB_TOO_BIG +Language=Bulgarian +ERROR_EFS_ALG_BLOB_TOO_BIG - The encryption algorithm used on the source file needs a bigger key buffer than the one on the destination file. +. + +MessageId=6014 +Severity=Success +Facility=System +SymbolicName=ERROR_VOLUME_NOT_SUPPORT_EFS +Language=Bulgarian +ERROR_VOLUME_NOT_SUPPORT_EFS - The disk partition does not support file encryption. +. + +MessageId=6015 +Severity=Success +Facility=System +SymbolicName=ERROR_EFS_DISABLED +Language=Bulgarian +ERROR_EFS_DISABLED - This machine is disabled for file encryption. +. + +MessageId=6016 +Severity=Success +Facility=System +SymbolicName=ERROR_EFS_VERSION_NOT_SUPPORT +Language=Bulgarian +ERROR_EFS_VERSION_NOT_SUPPORT - A newer system is required to decrypt this encrypted file. +. + +MessageId=6118 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_BROWSER_SERVERS_FOUND +Language=Bulgarian +ERROR_NO_BROWSER_SERVERS_FOUND - The list of servers for this workgroup is not currently available. +. + +MessageId=6200 +Severity=Success +Facility=System +SymbolicName=SCHED_E_SERVICE_NOT_LOCALSYSTEM +Language=Bulgarian +SCHED_E_SERVICE_NOT_LOCALSYSTEM - The Task Scheduler service must be configured to run in the System account to function properly. Individual tasks may be configured to run in other accounts. +. + +MessageId=7001 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_WINSTATION_NAME_INVALID +Language=Bulgarian +ERROR_CTX_WINSTATION_NAME_INVALID - The specified session name is invalid. +. + +MessageId=7002 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_INVALID_PD +Language=Bulgarian +ERROR_CTX_INVALID_PD - The specified protocol driver is invalid. +. + +MessageId=7003 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_PD_NOT_FOUND +Language=Bulgarian +ERROR_CTX_PD_NOT_FOUND - The specified protocol driver was not found in the system path. +. + +MessageId=7004 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_WD_NOT_FOUND +Language=Bulgarian +ERROR_CTX_WD_NOT_FOUND - The specified terminal connection driver was not found in the system path. +. + +MessageId=7005 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_CANNOT_MAKE_EVENTLOG_ENTRY +Language=Bulgarian +ERROR_CTX_CANNOT_MAKE_EVENTLOG_ENTRY - A registry key for event logging could not be created for this session. +. + +MessageId=7006 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_SERVICE_NAME_COLLISION +Language=Bulgarian +ERROR_CTX_SERVICE_NAME_COLLISION - A service with the same name already exists on the system. +. + +MessageId=7007 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_CLOSE_PENDING +Language=Bulgarian +ERROR_CTX_CLOSE_PENDING - A close operation is pending on the session. +. + +MessageId=7008 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_NO_OUTBUF +Language=Bulgarian +ERROR_CTX_NO_OUTBUF - There are no free output buffers available. +. + +MessageId=7009 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_MODEM_INF_NOT_FOUND +Language=Bulgarian +ERROR_CTX_MODEM_INF_NOT_FOUND - The MODEM.INF file was not found. +. + +MessageId=7010 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_INVALID_MODEMNAME +Language=Bulgarian +ERROR_CTX_INVALID_MODEMNAME - The modem name was not found in MODEM.INF. +. + +MessageId=7011 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_MODEM_RESPONSE_ERROR +Language=Bulgarian +ERROR_CTX_MODEM_RESPONSE_ERROR - The modem did not accept the command sent to it. Verify that the configured modem name matches the attached modem. +. + +MessageId=7012 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_MODEM_RESPONSE_TIMEOUT +Language=Bulgarian +ERROR_CTX_MODEM_RESPONSE_TIMEOUT - The modem did not respond to the command sent to it. Verify that the modem is properly cabled and powered on. +. + +MessageId=7013 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_MODEM_RESPONSE_NO_CARRIER +Language=Bulgarian +ERROR_CTX_MODEM_RESPONSE_NO_CARRIER - Carrier detect has failed or carrier has been dropped due to disconnect. +. + +MessageId=7014 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_MODEM_RESPONSE_NO_DIALTONE +Language=Bulgarian +ERROR_CTX_MODEM_RESPONSE_NO_DIALTONE - Dial tone not detected within the required time. Verify that the phone cable is properly attached and functional. +. + +MessageId=7015 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_MODEM_RESPONSE_BUSY +Language=Bulgarian +ERROR_CTX_MODEM_RESPONSE_BUSY - Busy signal detected at remote site on callback. +. + +MessageId=7016 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_MODEM_RESPONSE_VOICE +Language=Bulgarian +ERROR_CTX_MODEM_RESPONSE_VOICE - Voice detected at remote site on callback. +. + +MessageId=7017 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_TD_ERROR +Language=Bulgarian +ERROR_CTX_TD_ERROR - Transport driver error +. + +MessageId=7022 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_WINSTATION_NOT_FOUND +Language=Bulgarian +ERROR_CTX_WINSTATION_NOT_FOUND - The specified session cannot be found. +. + +MessageId=7023 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_WINSTATION_ALREADY_EXISTS +Language=Bulgarian +ERROR_CTX_WINSTATION_ALREADY_EXISTS - The specified session name is already in use. +. + +MessageId=7024 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_WINSTATION_BUSY +Language=Bulgarian +ERROR_CTX_WINSTATION_BUSY - The requested operation cannot be completed because the terminal connection is currently busy processing a connect, disconnect, reset, or delete operation. +. + +MessageId=7025 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_BAD_VIDEO_MODE +Language=Bulgarian +ERROR_CTX_BAD_VIDEO_MODE - An attempt has been made to connect to a session whose video mode is not supported by the current client. +. + +MessageId=7035 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_GRAPHICS_INVALID +Language=Bulgarian +ERROR_CTX_GRAPHICS_INVALID - The application attempted to enable DOS graphics mode. DOS graphics mode is not supported. +. + +MessageId=7037 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_LOGON_DISABLED +Language=Bulgarian +ERROR_CTX_LOGON_DISABLED - Your interactive logon privilege has been disabled. Please contact your administrator. +. + +MessageId=7038 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_NOT_CONSOLE +Language=Bulgarian +ERROR_CTX_NOT_CONSOLE - The requested operation can be performed only on the system console. This is most often the result of a driver or system DLL requiring direct console access. +. + +MessageId=7040 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_CLIENT_QUERY_TIMEOUT +Language=Bulgarian +ERROR_CTX_CLIENT_QUERY_TIMEOUT - The client failed to respond to the server connect message. +. + +MessageId=7041 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_CONSOLE_DISCONNECT +Language=Bulgarian +ERROR_CTX_CONSOLE_DISCONNECT - Disconnecting the console session is not supported. +. + +MessageId=7042 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_CONSOLE_CONNECT +Language=Bulgarian +ERROR_CTX_CONSOLE_CONNECT - Reconnecting a disconnected session to the console is not supported. +. + +MessageId=7044 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_SHADOW_DENIED +Language=Bulgarian +ERROR_CTX_SHADOW_DENIED - The request to control another session remotely was denied. +. + +MessageId=7045 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_WINSTATION_ACCESS_DENIED +Language=Bulgarian +ERROR_CTX_WINSTATION_ACCESS_DENIED - The requested session access is denied. +. + +MessageId=7049 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_INVALID_WD +Language=Bulgarian +ERROR_CTX_INVALID_WD - The specified terminal connection driver is invalid. +. + +MessageId=7050 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_SHADOW_INVALID +Language=Bulgarian +ERROR_CTX_SHADOW_INVALID - The requested session cannot be controlled remotely. This may be because the session is disconnected or does not currently have a user logged on. +. + +MessageId=7051 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_SHADOW_DISABLED +Language=Bulgarian +ERROR_CTX_SHADOW_DISABLED - The requested session is not configured to allow remote control. +. + +MessageId=7052 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_CLIENT_LICENSE_IN_USE +Language=Bulgarian +ERROR_CTX_CLIENT_LICENSE_IN_USE - Your request to connect to this Terminal Server has been rejected. Your Terminal Server client license number is currently being used by another user. Please call your system administrator to obtain a unique license number. +. + +MessageId=7053 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_CLIENT_LICENSE_NOT_SET +Language=Bulgarian +ERROR_CTX_CLIENT_LICENSE_NOT_SET - Your request to connect to this Terminal Server has been rejected. Your Terminal Server client license number has not been entered for this copy of the Terminal Server client. Please contact your system administrator. +. + +MessageId=7054 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_LICENSE_NOT_AVAILABLE +Language=Bulgarian +ERROR_CTX_LICENSE_NOT_AVAILABLE - The system has reached its licensed logon limit. Please try again later. +. + +MessageId=7055 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_LICENSE_CLIENT_INVALID +Language=Bulgarian +ERROR_CTX_LICENSE_CLIENT_INVALID - The client you are using is not licensed to use this system. Your logon request is denied. +. + +MessageId=7056 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_LICENSE_EXPIRED +Language=Bulgarian +ERROR_CTX_LICENSE_EXPIRED - The system license has expired. Your logon request is denied. +. + +MessageId=7057 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_SHADOW_NOT_RUNNING +Language=Bulgarian +ERROR_CTX_SHADOW_NOT_RUNNING - Remote control could not be terminated because the specified session is not currently being remotely controlled. +. + +MessageId=7058 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_SHADOW_ENDED_BY_MODE_CHANGE +Language=Bulgarian +ERROR_CTX_SHADOW_ENDED_BY_MODE_CHANGE - The remote control of the console was terminated because the display mode was changed. Changing the display mode in a remote control session is not supported. +. + +MessageId=7059 +Severity=Success +Facility=System +SymbolicName=ERROR_ACTIVATION_COUNT_EXCEEDED +Language=Bulgarian +ERROR_ACTIVATION_COUNT_EXCEEDED - Activation has already been reset the maximum number of times for this installation. Your activation timer will not be cleared. +. + +MessageId=7060 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_WINSTATIONS_DISABLED +Language=Bulgarian +ERROR_CTX_WINSTATIONS_DISABLED - Remote logins are currently disabled. +. + +MessageId=7061 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_ENCRYPTION_LEVEL_REQUIRED +Language=Bulgarian +ERROR_CTX_ENCRYPTION_LEVEL_REQUIRED - You do not have the proper encryption level to access this Session. +. + +MessageId=7062 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_SESSION_IN_USE +Language=Bulgarian +ERROR_CTX_SESSION_IN_USE - The user %s\\%s is currently logged on to this computer. Only the current user or an administrator can log on to this computer. +. + +MessageId=7063 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_NO_FORCE_LOGOFF +Language=Bulgarian +ERROR_CTX_NO_FORCE_LOGOFF - The user %s\\%s is already logged on to the console of this computer. You do not have permission to log in at this time. To resolve this issue, contact %s\\%s and have them log off. +. + +MessageId=7064 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_ACCOUNT_RESTRICTION +Language=Bulgarian +ERROR_CTX_ACCOUNT_RESTRICTION - Unable to log you on because of an account restriction. +. + +MessageId=7065 +Severity=Success +Facility=System +SymbolicName=ERROR_RDP_PROTOCOL_ERROR +Language=Bulgarian +ERROR_RDP_PROTOCOL_ERROR - The RDP protocol component %2 detected an error in the protocol stream and has disconnected the client. +. + +MessageId=7066 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_CDM_CONNECT +Language=Bulgarian +ERROR_CTX_CDM_CONNECT - The Client Drive Mapping Service Has Connected on Terminal Connection. +. + +MessageId=7067 +Severity=Success +Facility=System +SymbolicName=ERROR_CTX_CDM_DISCONNECT +Language=Bulgarian +ERROR_CTX_CDM_DISCONNECT - The Client Drive Mapping Service Has Disconnected on Terminal Connection. +. + +MessageId=8001 +Severity=Success +Facility=System +SymbolicName=FRS_ERR_INVALID_API_SEQUENCE +Language=Bulgarian +FRS_ERR_INVALID_API_SEQUENCE - The file replication service API was called incorrectly. +. + +MessageId=8002 +Severity=Success +Facility=System +SymbolicName=FRS_ERR_STARTING_SERVICE +Language=Bulgarian +FRS_ERR_STARTING_SERVICE - The file replication service cannot be started. +. + +MessageId=8003 +Severity=Success +Facility=System +SymbolicName=FRS_ERR_STOPPING_SERVICE +Language=Bulgarian +FRS_ERR_STOPPING_SERVICE - The file replication service cannot be stopped. +. + +MessageId=8004 +Severity=Success +Facility=System +SymbolicName=FRS_ERR_INTERNAL_API +Language=Bulgarian +FRS_ERR_INTERNAL_API - The file replication service API terminated the request. The event log may have more information. +. + +MessageId=8005 +Severity=Success +Facility=System +SymbolicName=FRS_ERR_INTERNAL +Language=Bulgarian +FRS_ERR_INTERNAL - The file replication service terminated the request. The event log may have more information. +. + +MessageId=8006 +Severity=Success +Facility=System +SymbolicName=FRS_ERR_SERVICE_COMM +Language=Bulgarian +FRS_ERR_SERVICE_COMM - The file replication service cannot be contacted. The event log may have more information. +. + +MessageId=8007 +Severity=Success +Facility=System +SymbolicName=FRS_ERR_INSUFFICIENT_PRIV +Language=Bulgarian +FRS_ERR_INSUFFICIENT_PRIV - The file replication service cannot satisfy the request because the user has insufficient privileges. The event log may have more information. +. + +MessageId=8008 +Severity=Success +Facility=System +SymbolicName=FRS_ERR_AUTHENTICATION +Language=Bulgarian +FRS_ERR_AUTHENTICATION - The file replication service cannot satisfy the request because authenticated RPC is not available. The event log may have more information. +. + +MessageId=8009 +Severity=Success +Facility=System +SymbolicName=FRS_ERR_PARENT_INSUFFICIENT_PRIV +Language=Bulgarian +FRS_ERR_PARENT_INSUFFICIENT_PRIV - The file replication service cannot satisfy the request because the user has insufficient privileges on the domain controller. The event log may have more information. +. + +MessageId=8010 +Severity=Success +Facility=System +SymbolicName=FRS_ERR_PARENT_AUTHENTICATION +Language=Bulgarian +FRS_ERR_PARENT_AUTHENTICATION - The file replication service cannot satisfy the request because authenticated RPC is not available on the domain controller. The event log may have more information. +. + +MessageId=8011 +Severity=Success +Facility=System +SymbolicName=FRS_ERR_CHILD_TO_PARENT_COMM +Language=Bulgarian +FRS_ERR_CHILD_TO_PARENT_COMM - The file replication service cannot communicate with the file replication service on the domain controller. The event log may have more information. +. + +MessageId=8012 +Severity=Success +Facility=System +SymbolicName=FRS_ERR_PARENT_TO_CHILD_COMM +Language=Bulgarian +FRS_ERR_PARENT_TO_CHILD_COMM - The file replication service on the domain controller cannot communicate with the file replication service on this computer. The event log may have more information. +. + +MessageId=8013 +Severity=Success +Facility=System +SymbolicName=FRS_ERR_SYSVOL_POPULATE +Language=Bulgarian +FRS_ERR_SYSVOL_POPULATE - The file replication service cannot populate the system volume because of an internal error. The event log may have more information. +. + +MessageId=8014 +Severity=Success +Facility=System +SymbolicName=FRS_ERR_SYSVOL_POPULATE_TIMEOUT +Language=Bulgarian +FRS_ERR_SYSVOL_POPULATE_TIMEOUT - The file replication service cannot populate the system volume because of an internal timeout. The event log may have more information. +. + +MessageId=8015 +Severity=Success +Facility=System +SymbolicName=FRS_ERR_SYSVOL_IS_BUSY +Language=Bulgarian +FRS_ERR_SYSVOL_IS_BUSY - The file replication service cannot process the request. The system volume is busy with a previous request. +. + +MessageId=8016 +Severity=Success +Facility=System +SymbolicName=FRS_ERR_SYSVOL_DEMOTE +Language=Bulgarian +FRS_ERR_SYSVOL_DEMOTE - The file replication service cannot stop replicating the system volume because of an internal error. The event log may have more information. +. + +MessageId=8017 +Severity=Success +Facility=System +SymbolicName=FRS_ERR_INVALID_SERVICE_PARAMETER +Language=Bulgarian +FRS_ERR_INVALID_SERVICE_PARAMETER - The file replication service detected an invalid parameter. +. + +MessageId=8200 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NOT_INSTALLED +Language=Bulgarian +ERROR_DS_NOT_INSTALLED - An error occurred while installing the directory service. For more information, see the event log. +. + +MessageId=8201 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_MEMBERSHIP_EVALUATED_LOCALLY +Language=Bulgarian +ERROR_DS_MEMBERSHIP_EVALUATED_LOCALLY - The directory service evaluated group memberships locally. +. + +MessageId=8202 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NO_ATTRIBUTE_OR_VALUE +Language=Bulgarian +ERROR_DS_NO_ATTRIBUTE_OR_VALUE - The specified directory service attribute or value does not exist. +. + +MessageId=8203 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_INVALID_ATTRIBUTE_SYNTAX +Language=Bulgarian +ERROR_DS_INVALID_ATTRIBUTE_SYNTAX - The attribute syntax specified to the directory service is invalid. +. + +MessageId=8204 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_ATTRIBUTE_TYPE_UNDEFINED +Language=Bulgarian +ERROR_DS_ATTRIBUTE_TYPE_UNDEFINED - The attribute type specified to the directory service is not defined. +. + +MessageId=8205 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_ATTRIBUTE_OR_VALUE_EXISTS +Language=Bulgarian +ERROR_DS_ATTRIBUTE_OR_VALUE_EXISTS - The specified directory service attribute or value already exists. +. + +MessageId=8206 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_BUSY +Language=Bulgarian +ERROR_DS_BUSY - The directory service is busy. +. + +MessageId=8207 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_UNAVAILABLE +Language=Bulgarian +ERROR_DS_UNAVAILABLE - The directory service is unavailable. +. + +MessageId=8208 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NO_RIDS_ALLOCATED +Language=Bulgarian +ERROR_DS_NO_RIDS_ALLOCATED - The directory service was unable to allocate a relative identifier. +. + +MessageId=8209 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NO_MORE_RIDS +Language=Bulgarian +ERROR_DS_NO_MORE_RIDS - The directory service has exhausted the pool of relative identifiers. +. + +MessageId=8210 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_INCORRECT_ROLE_OWNER +Language=Bulgarian +ERROR_DS_INCORRECT_ROLE_OWNER - The requested operation could not be performed because the directory service is not the master for that type of operation. +. + +MessageId=8211 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_RIDMGR_INIT_ERROR +Language=Bulgarian +ERROR_DS_RIDMGR_INIT_ERROR - The directory service was unable to initialize the subsystem that allocates relative identifiers. +. + +MessageId=8212 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_OBJ_CLASS_VIOLATION +Language=Bulgarian +ERROR_DS_OBJ_CLASS_VIOLATION - The requested operation did not satisfy one or more constraints associated with the class of the object. +. + +MessageId=8213 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_ON_NON_LEAF +Language=Bulgarian +ERROR_DS_CANT_ON_NON_LEAF - The directory service can perform the requested operation only on a leaf object. +. + +MessageId=8214 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_ON_RDN +Language=Bulgarian +ERROR_DS_CANT_ON_RDN - The directory service cannot perform the requested operation on the RDN attribute of an object. +. + +MessageId=8215 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_MOD_OBJ_CLASS +Language=Bulgarian +ERROR_DS_CANT_MOD_OBJ_CLASS - The directory service detected an attempt to modify the object class of an object. +. + +MessageId=8216 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CROSS_DOM_MOVE_ERROR +Language=Bulgarian +ERROR_DS_CROSS_DOM_MOVE_ERROR - The requested cross-domain move operation could not be performed. +. + +MessageId=8217 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_GC_NOT_AVAILABLE +Language=Bulgarian +ERROR_DS_GC_NOT_AVAILABLE - Unable to contact the global catalog server. +. + +MessageId=8218 +Severity=Success +Facility=System +SymbolicName=ERROR_SHARED_POLICY +Language=Bulgarian +ERROR_SHARED_POLICY - The policy object is shared and can only be modified at the root. +. + +MessageId=8219 +Severity=Success +Facility=System +SymbolicName=ERROR_POLICY_OBJECT_NOT_FOUND +Language=Bulgarian +ERROR_POLICY_OBJECT_NOT_FOUND - The policy object does not exist. +. + +MessageId=8220 +Severity=Success +Facility=System +SymbolicName=ERROR_POLICY_ONLY_IN_DS +Language=Bulgarian +ERROR_POLICY_ONLY_IN_DS - The requested policy information is only in the directory service. +. + +MessageId=8221 +Severity=Success +Facility=System +SymbolicName=ERROR_PROMOTION_ACTIVE +Language=Bulgarian +ERROR_PROMOTION_ACTIVE - A domain controller promotion is currently active. +. + +MessageId=8222 +Severity=Success +Facility=System +SymbolicName=ERROR_NO_PROMOTION_ACTIVE +Language=Bulgarian +ERROR_NO_PROMOTION_ACTIVE - A domain controller promotion is not currently active +. + +MessageId=8224 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_OPERATIONS_ERROR +Language=Bulgarian +ERROR_DS_OPERATIONS_ERROR - An operations error occurred. +. + +MessageId=8225 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_PROTOCOL_ERROR +Language=Bulgarian +ERROR_DS_PROTOCOL_ERROR - A protocol error occurred. +. + +MessageId=8226 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_TIMELIMIT_EXCEEDED +Language=Bulgarian +ERROR_DS_TIMELIMIT_EXCEEDED - The time limit for this request was exceeded. +. + +MessageId=8227 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_SIZELIMIT_EXCEEDED +Language=Bulgarian +ERROR_DS_SIZELIMIT_EXCEEDED - The size limit for this request was exceeded. +. + +MessageId=8228 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_ADMIN_LIMIT_EXCEEDED +Language=Bulgarian +ERROR_DS_ADMIN_LIMIT_EXCEEDED - The administrative limit for this request was exceeded. +. + +MessageId=8229 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_COMPARE_FALSE +Language=Bulgarian +ERROR_DS_COMPARE_FALSE - The compare response was false. +. + +MessageId=8230 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_COMPARE_TRUE +Language=Bulgarian +ERROR_DS_COMPARE_TRUE - The compare response was true. +. + +MessageId=8231 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_AUTH_METHOD_NOT_SUPPORTED +Language=Bulgarian +ERROR_DS_AUTH_METHOD_NOT_SUPPORTED - The requested authentication method is not supported by the server. +. + +MessageId=8232 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_STRONG_AUTH_REQUIRED +Language=Bulgarian +ERROR_DS_STRONG_AUTH_REQUIRED - A more secure authentication method is required for this server. +. + +MessageId=8233 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_INAPPROPRIATE_AUTH +Language=Bulgarian +ERROR_DS_INAPPROPRIATE_AUTH - Inappropriate authentication. +. + +MessageId=8234 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_AUTH_UNKNOWN +Language=Bulgarian +ERROR_DS_AUTH_UNKNOWN - The authentication mechanism is unknown. +. + +MessageId=8235 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_REFERRAL +Language=Bulgarian +ERROR_DS_REFERRAL - A referral was returned from the server. +. + +MessageId=8236 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_UNAVAILABLE_CRIT_EXTENSION +Language=Bulgarian +ERROR_DS_UNAVAILABLE_CRIT_EXTENSION - The server does not support the requested critical extension. +. + +MessageId=8237 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CONFIDENTIALITY_REQUIRED +Language=Bulgarian +ERROR_DS_CONFIDENTIALITY_REQUIRED - This request requires a secure connection. +. + +MessageId=8238 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_INAPPROPRIATE_MATCHING +Language=Bulgarian +ERROR_DS_INAPPROPRIATE_MATCHING - Inappropriate matching. +. + +MessageId=8239 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CONSTRAINT_VIOLATION +Language=Bulgarian +ERROR_DS_CONSTRAINT_VIOLATION - A constraint violation occurred. +. + +MessageId=8240 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NO_SUCH_OBJECT +Language=Bulgarian +ERROR_DS_NO_SUCH_OBJECT - There is no such object on the server. +. + +MessageId=8241 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_ALIAS_PROBLEM +Language=Bulgarian +ERROR_DS_ALIAS_PROBLEM - There is an alias problem. +. + +MessageId=8242 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_INVALID_DN_SYNTAX +Language=Bulgarian +ERROR_DS_INVALID_DN_SYNTAX - An invalid dn syntax has been specified. +. + +MessageId=8243 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_IS_LEAF +Language=Bulgarian +ERROR_DS_IS_LEAF - The object is a leaf object. +. + +MessageId=8244 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_ALIAS_DEREF_PROBLEM +Language=Bulgarian +ERROR_DS_ALIAS_DEREF_PROBLEM - There is an alias dereferencing problem. +. + +MessageId=8245 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_UNWILLING_TO_PERFORM +Language=Bulgarian +ERROR_DS_UNWILLING_TO_PERFORM - The server is unwilling to process the request. +. + +MessageId=8246 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_LOOP_DETECT +Language=Bulgarian +ERROR_DS_LOOP_DETECT - A loop has been detected. +. + +MessageId=8247 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NAMING_VIOLATION +Language=Bulgarian +ERROR_DS_NAMING_VIOLATION - There is a naming violation. +. + +MessageId=8248 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_OBJECT_RESULTS_TOO_LARGE +Language=Bulgarian +ERROR_DS_OBJECT_RESULTS_TOO_LARGE - The result set is too large. +. + +MessageId=8249 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_AFFECTS_MULTIPLE_DSAS +Language=Bulgarian +ERROR_DS_AFFECTS_MULTIPLE_DSAS - The operation affects multiple DSAs +. + +MessageId=8250 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_SERVER_DOWN +Language=Bulgarian +ERROR_DS_SERVER_DOWN - The server is not operational. +. + +MessageId=8251 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_LOCAL_ERROR +Language=Bulgarian +ERROR_DS_LOCAL_ERROR - A local error has occurred. +. + +MessageId=8252 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_ENCODING_ERROR +Language=Bulgarian +ERROR_DS_ENCODING_ERROR - An encoding error has occurred. +. + +MessageId=8253 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DECODING_ERROR +Language=Bulgarian +ERROR_DS_DECODING_ERROR - A decoding error has occurred. +. + +MessageId=8254 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_FILTER_UNKNOWN +Language=Bulgarian +ERROR_DS_FILTER_UNKNOWN - The search filter cannot be recognized. +. + +MessageId=8255 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_PARAM_ERROR +Language=Bulgarian +ERROR_DS_PARAM_ERROR - One or more parameters are illegal. +. + +MessageId=8256 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NOT_SUPPORTED +Language=Bulgarian +ERROR_DS_NOT_SUPPORTED - The specified method is not supported. +. + +MessageId=8257 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NO_RESULTS_RETURNED +Language=Bulgarian +ERROR_DS_NO_RESULTS_RETURNED - No results were returned. +. + +MessageId=8258 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CONTROL_NOT_FOUND +Language=Bulgarian +ERROR_DS_CONTROL_NOT_FOUND - The specified control is not supported by the server. +. + +MessageId=8259 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CLIENT_LOOP +Language=Bulgarian +ERROR_DS_CLIENT_LOOP - A referral loop was detected by the client. +. + +MessageId=8260 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_REFERRAL_LIMIT_EXCEEDED +Language=Bulgarian +ERROR_DS_REFERRAL_LIMIT_EXCEEDED - The preset referral limit was exceeded. +. + +MessageId=8261 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_SORT_CONTROL_MISSING +Language=Bulgarian +ERROR_DS_SORT_CONTROL_MISSING - The search requires a SORT control. +. + +MessageId=8262 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_OFFSET_RANGE_ERROR +Language=Bulgarian +ERROR_DS_OFFSET_RANGE_ERROR - The search results exceed the offset range specified. +. + +MessageId=8301 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_ROOT_MUST_BE_NC +Language=Bulgarian +ERROR_DS_ROOT_MUST_BE_NC - The root object must be the head of a naming context. The root object cannot have an instantiated parent. +. + +MessageId=8302 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_ADD_REPLICA_INHIBITED +Language=Bulgarian +ERROR_DS_ADD_REPLICA_INHIBITED - The add replica operation cannot be performed. The naming context must be writeable in order to create the replica. +. + +MessageId=8303 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_ATT_NOT_DEF_IN_SCHEMA +Language=Bulgarian +ERROR_DS_ATT_NOT_DEF_IN_SCHEMA - A reference to an attribute that is not defined in the schema occurred. +. + +MessageId=8304 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_MAX_OBJ_SIZE_EXCEEDED +Language=Bulgarian +ERROR_DS_MAX_OBJ_SIZE_EXCEEDED - The maximum size of an object has been exceeded. +. + +MessageId=8305 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_OBJ_STRING_NAME_EXISTS +Language=Bulgarian +ERROR_DS_OBJ_STRING_NAME_EXISTS - An attempt was made to add an object to the directory with a name that is already in use. +. + +MessageId=8306 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NO_RDN_DEFINED_IN_SCHEMA +Language=Bulgarian +ERROR_DS_NO_RDN_DEFINED_IN_SCHEMA - An attempt was made to add an object of a class that does not have an RDN defined in the schema. +. + +MessageId=8307 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_RDN_DOESNT_MATCH_SCHEMA +Language=Bulgarian +ERROR_DS_RDN_DOESNT_MATCH_SCHEMA - An attempt was made to add an object using an RDN that is not the RDN defined in the schema. +. + +MessageId=8308 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NO_REQUESTED_ATTS_FOUND +Language=Bulgarian +ERROR_DS_NO_REQUESTED_ATTS_FOUND - None of the requested attributes were found on the objects. +. + +MessageId=8309 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_USER_BUFFER_TO_SMALL +Language=Bulgarian +ERROR_DS_USER_BUFFER_TO_SMALL - The user buffer is too small. +. + +MessageId=8310 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_ATT_IS_NOT_ON_OBJ +Language=Bulgarian +ERROR_DS_ATT_IS_NOT_ON_OBJ - The attribute specified in the operation is not present on the object. +. + +MessageId=8311 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_ILLEGAL_MOD_OPERATION +Language=Bulgarian +ERROR_DS_ILLEGAL_MOD_OPERATION - Illegal modify operation. Some aspect of the modification is not permitted. +. + +MessageId=8312 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_OBJ_TOO_LARGE +Language=Bulgarian +ERROR_DS_OBJ_TOO_LARGE - The specified object is too large. +. + +MessageId=8313 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_BAD_INSTANCE_TYPE +Language=Bulgarian +ERROR_DS_BAD_INSTANCE_TYPE - The specified instance type is not valid. +. + +MessageId=8314 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_MASTERDSA_REQUIRED +Language=Bulgarian +ERROR_DS_MASTERDSA_REQUIRED - The operation must be performed at a master DSA. +. + +MessageId=8315 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_OBJECT_CLASS_REQUIRED +Language=Bulgarian +ERROR_DS_OBJECT_CLASS_REQUIRED - The object class attribute must be specified. +. + +MessageId=8316 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_MISSING_REQUIRED_ATT +Language=Bulgarian +ERROR_DS_MISSING_REQUIRED_ATT - A required attribute is missing. +. + +MessageId=8317 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_ATT_NOT_DEF_FOR_CLASS +Language=Bulgarian +ERROR_DS_ATT_NOT_DEF_FOR_CLASS - An attempt was made to modify an object to include an attribute that is not legal for its class +. + +MessageId=8318 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_ATT_ALREADY_EXISTS +Language=Bulgarian +ERROR_DS_ATT_ALREADY_EXISTS - The specified attribute is already present on the object. +. + +MessageId=8320 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_ADD_ATT_VALUES +Language=Bulgarian +ERROR_DS_CANT_ADD_ATT_VALUES - The specified attribute is not present, or has no values. +. + +MessageId=8321 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_SINGLE_VALUE_CONSTRAINT +Language=Bulgarian +ERROR_DS_SINGLE_VALUE_CONSTRAINT - Multiple values were specified for an attribute that can have only one value. +. + +MessageId=8322 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_RANGE_CONSTRAINT +Language=Bulgarian +ERROR_DS_RANGE_CONSTRAINT - A value for the attribute was not in the acceptable range of values. +. + +MessageId=8323 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_ATT_VAL_ALREADY_EXISTS +Language=Bulgarian +ERROR_DS_ATT_VAL_ALREADY_EXISTS - The specified value already exists. +. + +MessageId=8324 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_REM_MISSING_ATT +Language=Bulgarian +ERROR_DS_CANT_REM_MISSING_ATT - The attribute cannot be removed because it is not present on the object. +. + +MessageId=8325 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_REM_MISSING_ATT_VAL +Language=Bulgarian +ERROR_DS_CANT_REM_MISSING_ATT_VAL - The attribute value cannot be removed because it is not present on the object. +. + +MessageId=8326 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_ROOT_CANT_BE_SUBREF +Language=Bulgarian +ERROR_DS_ROOT_CANT_BE_SUBREF - The specified root object cannot be a subref. +. + +MessageId=8327 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NO_CHAINING +Language=Bulgarian +ERROR_DS_NO_CHAINING - Chaining is not permitted. +. + +MessageId=8328 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NO_CHAINED_EVAL +Language=Bulgarian +ERROR_DS_NO_CHAINED_EVAL - Chained evaluation is not permitted. +. + +MessageId=8329 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NO_PARENT_OBJECT +Language=Bulgarian +ERROR_DS_NO_PARENT_OBJECT - The operation could not be performed because the object's parent is either uninstantiated or deleted. +. + +MessageId=8330 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_PARENT_IS_AN_ALIAS +Language=Bulgarian +ERROR_DS_PARENT_IS_AN_ALIAS - Having a parent that is an alias is not permitted. Aliases are leaf objects. +. + +MessageId=8331 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_MIX_MASTER_AND_REPS +Language=Bulgarian +ERROR_DS_CANT_MIX_MASTER_AND_REPS - The object and parent must be of the same type, either both masters or both replicas. +. + +MessageId=8332 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CHILDREN_EXIST +Language=Bulgarian +ERROR_DS_CHILDREN_EXIST - The operation cannot be performed because child objects exist. This operation can only be performed on a leaf object. +. + +MessageId=8333 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_OBJ_NOT_FOUND +Language=Bulgarian +ERROR_DS_OBJ_NOT_FOUND - Directory object not found. +. + +MessageId=8334 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_ALIASED_OBJ_MISSING +Language=Bulgarian +ERROR_DS_ALIASED_OBJ_MISSING - The aliased object is missing. +. + +MessageId=8335 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_BAD_NAME_SYNTAX +Language=Bulgarian +ERROR_DS_BAD_NAME_SYNTAX - The object name has bad syntax. +. + +MessageId=8336 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_ALIAS_POINTS_TO_ALIAS +Language=Bulgarian +ERROR_DS_ALIAS_POINTS_TO_ALIAS - It is not permitted for an alias to refer to another alias. +. + +MessageId=8337 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_DEREF_ALIAS +Language=Bulgarian +ERROR_DS_CANT_DEREF_ALIAS - The alias cannot be dereferenced. +. + +MessageId=8338 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_OUT_OF_SCOPE +Language=Bulgarian +ERROR_DS_OUT_OF_SCOPE - The operation is out of scope. +. + +MessageId=8339 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_OBJECT_BEING_REMOVED +Language=Bulgarian +ERROR_DS_OBJECT_BEING_REMOVED - The operation cannot continue because the object is in the process of being removed. +. + +MessageId=8340 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_DELETE_DSA_OBJ +Language=Bulgarian +ERROR_DS_CANT_DELETE_DSA_OBJ - The DSA object cannot be deleted. +. + +MessageId=8341 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_GENERIC_ERROR +Language=Bulgarian +ERROR_DS_GENERIC_ERROR - A directory service error has occurred. +. + +MessageId=8342 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DSA_MUST_BE_INT_MASTER +Language=Bulgarian +ERROR_DS_DSA_MUST_BE_INT_MASTER - The operation can only be performed on an internal master DSA object. +. + +MessageId=8343 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CLASS_NOT_DSA +Language=Bulgarian +ERROR_DS_CLASS_NOT_DSA - The object must be of class DSA. +. + +MessageId=8344 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_INSUFF_ACCESS_RIGHTS +Language=Bulgarian +ERROR_DS_INSUFF_ACCESS_RIGHTS - Insufficient access rights to perform the operation. +. + +MessageId=8345 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_ILLEGAL_SUPERIOR +Language=Bulgarian +ERROR_DS_ILLEGAL_SUPERIOR - The object cannot be added because the parent is not on the list of possible superiors. +. + +MessageId=8346 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_ATTRIBUTE_OWNED_BY_SAM +Language=Bulgarian +ERROR_DS_ATTRIBUTE_OWNED_BY_SAM - Access to the attribute is not permitted because the attribute is owned by the Security Accounts Manager (SAM). +. + +MessageId=8347 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NAME_TOO_MANY_PARTS +Language=Bulgarian +ERROR_DS_NAME_TOO_MANY_PARTS - The name has too many parts. +. + +MessageId=8348 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NAME_TOO_LONG +Language=Bulgarian +ERROR_DS_NAME_TOO_LONG - The name is too long. +. + +MessageId=8349 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NAME_VALUE_TOO_LONG +Language=Bulgarian +ERROR_DS_NAME_VALUE_TOO_LONG - The name value is too long. +. + +MessageId=8350 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NAME_UNPARSEABLE +Language=Bulgarian +ERROR_DS_NAME_UNPARSEABLE - The directory service encountered an error parsing a name. +. + +MessageId=8351 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NAME_TYPE_UNKNOWN +Language=Bulgarian +ERROR_DS_NAME_TYPE_UNKNOWN - The directory service cannot get the attribute type for a name. +. + +MessageId=8352 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NOT_AN_OBJECT +Language=Bulgarian +ERROR_DS_NOT_AN_OBJECT - The name does not identify an object; the name identifies a phantom. +. + +MessageId=8353 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_SEC_DESC_TOO_SHORT +Language=Bulgarian +ERROR_DS_SEC_DESC_TOO_SHORT - The security descriptor is too short. +. + +MessageId=8354 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_SEC_DESC_INVALID +Language=Bulgarian +ERROR_DS_SEC_DESC_INVALID - The security descriptor is invalid. +. + +MessageId=8355 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NO_DELETED_NAME +Language=Bulgarian +ERROR_DS_NO_DELETED_NAME - Failed to create name for deleted object. +. + +MessageId=8356 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_SUBREF_MUST_HAVE_PARENT +Language=Bulgarian +ERROR_DS_SUBREF_MUST_HAVE_PARENT - The parent of a new subref must exist. +. + +MessageId=8357 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NCNAME_MUST_BE_NC +Language=Bulgarian +ERROR_DS_NCNAME_MUST_BE_NC - The object must be a naming context. +. + +MessageId=8358 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_ADD_SYSTEM_ONLY +Language=Bulgarian +ERROR_DS_CANT_ADD_SYSTEM_ONLY - It is not permitted to add an attribute which is owned by the system. +. + +MessageId=8359 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CLASS_MUST_BE_CONCRETE +Language=Bulgarian +ERROR_DS_CLASS_MUST_BE_CONCRETE - The class of the object must be structural; you cannot instantiate an abstract class. +. + +MessageId=8360 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_INVALID_DMD +Language=Bulgarian +ERROR_DS_INVALID_DMD - The schema object could not be found. +. + +MessageId=8361 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_OBJ_GUID_EXISTS +Language=Bulgarian +ERROR_DS_OBJ_GUID_EXISTS - A local object with this GUID (dead or alive) already exists. +. + +MessageId=8362 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NOT_ON_BACKLINK +Language=Bulgarian +ERROR_DS_NOT_ON_BACKLINK - The operation cannot be performed on a back link. +. + +MessageId=8363 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NO_CROSSREF_FOR_NC +Language=Bulgarian +ERROR_DS_NO_CROSSREF_FOR_NC - The cross reference for the specified naming context could not be found. +. + +MessageId=8364 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_SHUTTING_DOWN +Language=Bulgarian +ERROR_DS_SHUTTING_DOWN - The operation could not be performed because the directory service is shutting down. +. + +MessageId=8365 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_UNKNOWN_OPERATION +Language=Bulgarian +ERROR_DS_UNKNOWN_OPERATION - The directory service request is invalid. +. + +MessageId=8366 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_INVALID_ROLE_OWNER +Language=Bulgarian +ERROR_DS_INVALID_ROLE_OWNER - The role owner attribute could not be read. +. + +MessageId=8367 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_COULDNT_CONTACT_FSMO +Language=Bulgarian +ERROR_DS_COULDNT_CONTACT_FSMO - The requested FSMO operation failed. The current FSMO holder could not be reached. +. + +MessageId=8368 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CROSS_NC_DN_RENAME +Language=Bulgarian +ERROR_DS_CROSS_NC_DN_RENAME - Modification of a DN across a naming context is not permitted. +. + +MessageId=8369 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_MOD_SYSTEM_ONLY +Language=Bulgarian +ERROR_DS_CANT_MOD_SYSTEM_ONLY - The attribute cannot be modified because it is owned by the system. +. + +MessageId=8370 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_REPLICATOR_ONLY +Language=Bulgarian +ERROR_DS_REPLICATOR_ONLY - Only the replicator can perform this function. +. + +MessageId=8371 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_OBJ_CLASS_NOT_DEFINED +Language=Bulgarian +ERROR_DS_OBJ_CLASS_NOT_DEFINED - The specified class is not defined. +. + +MessageId=8372 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_OBJ_CLASS_NOT_SUBCLASS +Language=Bulgarian +ERROR_DS_OBJ_CLASS_NOT_SUBCLASS - The specified class is not a subclass. +. + +MessageId=8373 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NAME_REFERENCE_INVALID +Language=Bulgarian +ERROR_DS_NAME_REFERENCE_INVALID - The name reference is invalid. +. + +MessageId=8374 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CROSS_REF_EXISTS +Language=Bulgarian +ERROR_DS_CROSS_REF_EXISTS - A cross reference already exists. +. + +MessageId=8375 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_DEL_MASTER_CROSSREF +Language=Bulgarian +ERROR_DS_CANT_DEL_MASTER_CROSSREF - It is not permitted to delete a master cross reference. +. + +MessageId=8376 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_SUBTREE_NOTIFY_NOT_NC_HEAD +Language=Bulgarian +ERROR_DS_SUBTREE_NOTIFY_NOT_NC_HEAD - Subtree notifications are only supported on NC heads. +. + +MessageId=8377 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NOTIFY_FILTER_TOO_COMPLEX +Language=Bulgarian +ERROR_DS_NOTIFY_FILTER_TOO_COMPLEX - Notification filter is too complex. +. + +MessageId=8378 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DUP_RDN +Language=Bulgarian +ERROR_DS_DUP_RDN - Schema update failed: duplicate RDN. +. + +MessageId=8379 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DUP_OID +Language=Bulgarian +ERROR_DS_DUP_OID - Schema update failed: duplicate OID +. + +MessageId=8380 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DUP_MAPI_ID +Language=Bulgarian +ERROR_DS_DUP_MAPI_ID - Schema update failed: duplicate MAPI identifier. +. + +MessageId=8381 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DUP_SCHEMA_ID_GUID +Language=Bulgarian +ERROR_DS_DUP_SCHEMA_ID_GUID - Schema update failed: duplicate schema-id GUID. +. + +MessageId=8382 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DUP_LDAP_DISPLAY_NAME +Language=Bulgarian +ERROR_DS_DUP_LDAP_DISPLAY_NAME - Schema update failed: duplicate LDAP display name. +. + +MessageId=8383 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_SEMANTIC_ATT_TEST +Language=Bulgarian +ERROR_DS_SEMANTIC_ATT_TEST - Schema update failed: range-lower less than range upper +. + +MessageId=8384 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_SYNTAX_MISMATCH +Language=Bulgarian +ERROR_DS_SYNTAX_MISMATCH - Schema update failed: syntax mismatch +. + +MessageId=8385 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_EXISTS_IN_MUST_HAVE +Language=Bulgarian +ERROR_DS_EXISTS_IN_MUST_HAVE - Schema deletion failed: attribute is used in must-contain +. + +MessageId=8386 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_EXISTS_IN_MAY_HAVE +Language=Bulgarian +ERROR_DS_EXISTS_IN_MAY_HAVE - Schema deletion failed: attribute is used in may-contain +. + +MessageId=8387 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NONEXISTENT_MAY_HAVE +Language=Bulgarian +ERROR_DS_NONEXISTENT_MAY_HAVE - Schema update failed: attribute in may-contain does not exist +. + +MessageId=8388 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NONEXISTENT_MUST_HAVE +Language=Bulgarian +ERROR_DS_NONEXISTENT_MUST_HAVE - Schema update failed: attribute in must-contain does not exist +. + +MessageId=8389 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_AUX_CLS_TEST_FAIL +Language=Bulgarian +ERROR_DS_AUX_CLS_TEST_FAIL - Schema update failed: class in aux-class list does not exist or is not an auxiliary class +. + +MessageId=8390 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NONEXISTENT_POSS_SUP +Language=Bulgarian +ERROR_DS_NONEXISTENT_POSS_SUP - Schema update failed: class in poss-superiors does not exist +. + +MessageId=8391 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_SUB_CLS_TEST_FAIL +Language=Bulgarian +ERROR_DS_SUB_CLS_TEST_FAIL - Schema update failed: class in subclassof list does not exist or does not satisfy hierarchy rules +. + +MessageId=8392 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_BAD_RDN_ATT_ID_SYNTAX +Language=Bulgarian +ERROR_DS_BAD_RDN_ATT_ID_SYNTAX - Schema update failed: Rdn-Att-Id has wrong syntax +. + +MessageId=8393 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_EXISTS_IN_AUX_CLS +Language=Bulgarian +ERROR_DS_EXISTS_IN_AUX_CLS - Schema deletion failed: class is used as auxiliary class +. + +MessageId=8394 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_EXISTS_IN_SUB_CLS +Language=Bulgarian +ERROR_DS_EXISTS_IN_SUB_CLS - Schema deletion failed: class is used as sub class +. + +MessageId=8395 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_EXISTS_IN_POSS_SUP +Language=Bulgarian +ERROR_DS_EXISTS_IN_POSS_SUP - Schema deletion failed: class is used as poss superior +. + +MessageId=8396 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_RECALCSCHEMA_FAILED +Language=Bulgarian +ERROR_DS_RECALCSCHEMA_FAILED - Schema update failed in recalculating validation cache. +. + +MessageId=8397 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_TREE_DELETE_NOT_FINISHED +Language=Bulgarian +ERROR_DS_TREE_DELETE_NOT_FINISHED - The tree deletion is not finished. +. + +MessageId=8398 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_DELETE +Language=Bulgarian +ERROR_DS_CANT_DELETE - The requested delete operation could not be performed. +. + +MessageId=8399 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_ATT_SCHEMA_REQ_ID +Language=Bulgarian +ERROR_DS_ATT_SCHEMA_REQ_ID - Cannot read the governs class identifier for the schema record. +. + +MessageId=8400 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_BAD_ATT_SCHEMA_SYNTAX +Language=Bulgarian +ERROR_DS_BAD_ATT_SCHEMA_SYNTAX - The attribute schema has bad syntax. +. + +MessageId=8401 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_CACHE_ATT +Language=Bulgarian +ERROR_DS_CANT_CACHE_ATT - The attribute could not be cached. +. + +MessageId=8402 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_CACHE_CLASS +Language=Bulgarian +ERROR_DS_CANT_CACHE_CLASS - The class could not be cached. +. + +MessageId=8403 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_REMOVE_ATT_CACHE +Language=Bulgarian +ERROR_DS_CANT_REMOVE_ATT_CACHE - The attribute could not be removed from the cache. +. + +MessageId=8404 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_REMOVE_CLASS_CACHE +Language=Bulgarian +ERROR_DS_CANT_REMOVE_CLASS_CACHE - The class could not be removed from the cache. +. + +MessageId=8405 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_RETRIEVE_DN +Language=Bulgarian +ERROR_DS_CANT_RETRIEVE_DN - The distinguished name attribute could not be read. +. + +MessageId=8406 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_MISSING_SUPREF +Language=Bulgarian +ERROR_DS_MISSING_SUPREF - No superior reference has been configured for the directory service. The directory service is therefore unable to issue referrals to objects outside this forest. +. + +MessageId=8407 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_RETRIEVE_INSTANCE +Language=Bulgarian +ERROR_DS_CANT_RETRIEVE_INSTANCE - The instance type attribute could not be retrieved. +. + +MessageId=8408 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CODE_INCONSISTENCY +Language=Bulgarian +ERROR_DS_CODE_INCONSISTENCY - An internal error has occurred. +. + +MessageId=8409 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DATABASE_ERROR +Language=Bulgarian +ERROR_DS_DATABASE_ERROR - A database error has occurred. +. + +MessageId=8410 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_GOVERNSID_MISSING +Language=Bulgarian +ERROR_DS_GOVERNSID_MISSING - The attribute GOVERNSID is missing. +. + +MessageId=8411 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_MISSING_EXPECTED_ATT +Language=Bulgarian +ERROR_DS_MISSING_EXPECTED_ATT - An expected attribute is missing. +. + +MessageId=8412 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NCNAME_MISSING_CR_REF +Language=Bulgarian +ERROR_DS_NCNAME_MISSING_CR_REF - The specified naming context is missing a cross reference. +. + +MessageId=8413 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_SECURITY_CHECKING_ERROR +Language=Bulgarian +ERROR_DS_SECURITY_CHECKING_ERROR - A security checking error has occurred. +. + +MessageId=8414 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_SCHEMA_NOT_LOADED +Language=Bulgarian +ERROR_DS_SCHEMA_NOT_LOADED - The schema is not loaded. +. + +MessageId=8415 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_SCHEMA_ALLOC_FAILED +Language=Bulgarian +ERROR_DS_SCHEMA_ALLOC_FAILED - Schema allocation failed. Please check if the machine is running low on memory. +. + +MessageId=8416 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_ATT_SCHEMA_REQ_SYNTAX +Language=Bulgarian +ERROR_DS_ATT_SCHEMA_REQ_SYNTAX - Failed to obtain the required syntax for the attribute schema. +. + +MessageId=8417 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_GCVERIFY_ERROR +Language=Bulgarian +ERROR_DS_GCVERIFY_ERROR - The global catalog verification failed. The global catalog is not available or does not support the operation. Some part of the directory is currently not available. +. + +MessageId=8418 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_SCHEMA_MISMATCH +Language=Bulgarian +ERROR_DS_DRA_SCHEMA_MISMATCH - The replication operation failed because of a schema mismatch between the servers involved. +. + +MessageId=8419 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_FIND_DSA_OBJ +Language=Bulgarian +ERROR_DS_CANT_FIND_DSA_OBJ - The DSA object could not be found. +. + +MessageId=8420 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_FIND_EXPECTED_NC +Language=Bulgarian +ERROR_DS_CANT_FIND_EXPECTED_NC - The naming context could not be found. +. + +MessageId=8421 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_FIND_NC_IN_CACHE +Language=Bulgarian +ERROR_DS_CANT_FIND_NC_IN_CACHE - The naming context could not be found in the cache. +. + +MessageId=8422 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_RETRIEVE_CHILD +Language=Bulgarian +ERROR_DS_CANT_RETRIEVE_CHILD - The child object could not be retrieved. +. + +MessageId=8423 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_SECURITY_ILLEGAL_MODIFY +Language=Bulgarian +ERROR_DS_SECURITY_ILLEGAL_MODIFY - The modification was not permitted for security reasons. +. + +MessageId=8424 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_REPLACE_HIDDEN_REC +Language=Bulgarian +ERROR_DS_CANT_REPLACE_HIDDEN_REC - The operation cannot replace the hidden record. +. + +MessageId=8425 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_BAD_HIERARCHY_FILE +Language=Bulgarian +ERROR_DS_BAD_HIERARCHY_FILE - The hierarchy file is invalid. +. + +MessageId=8426 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_BUILD_HIERARCHY_TABLE_FAILED +Language=Bulgarian +ERROR_DS_BUILD_HIERARCHY_TABLE_FAILED - The attempt to build the hierarchy table failed. +. + +MessageId=8427 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CONFIG_PARAM_MISSING +Language=Bulgarian +ERROR_DS_CONFIG_PARAM_MISSING - The directory configuration parameter is missing from the registry. +. + +MessageId=8428 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_COUNTING_AB_INDICES_FAILED +Language=Bulgarian +ERROR_DS_COUNTING_AB_INDICES_FAILED - The attempt to count the address book indices failed. +. + +MessageId=8429 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_HIERARCHY_TABLE_MALLOC_FAILED +Language=Bulgarian +ERROR_DS_HIERARCHY_TABLE_MALLOC_FAILED - The allocation of the hierarchy table failed. +. + +MessageId=8430 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_INTERNAL_FAILURE +Language=Bulgarian +ERROR_DS_INTERNAL_FAILURE - The directory service encountered an internal failure. +. + +MessageId=8431 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_UNKNOWN_ERROR +Language=Bulgarian +ERROR_DS_UNKNOWN_ERROR - The directory service encountered an unknown failure. +. + +MessageId=8432 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_ROOT_REQUIRES_CLASS_TOP +Language=Bulgarian +ERROR_DS_ROOT_REQUIRES_CLASS_TOP - A root object requires a class of 'top'. +. + +MessageId=8433 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_REFUSING_FSMO_ROLES +Language=Bulgarian +ERROR_DS_REFUSING_FSMO_ROLES - This directory server is shutting down, and cannot take ownership of new floating single-master operation roles. +. + +MessageId=8434 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_MISSING_FSMO_SETTINGS +Language=Bulgarian +ERROR_DS_MISSING_FSMO_SETTINGS - The directory service is missing mandatory configuration information, and is unable to determine the ownership of floating single-master operation roles. +. + +MessageId=8435 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_UNABLE_TO_SURRENDER_ROLES +Language=Bulgarian +ERROR_DS_UNABLE_TO_SURRENDER_ROLES - The directory service was unable to transfer ownership of one or more floating single-master operation roles to other servers. +. + +MessageId=8436 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_GENERIC +Language=Bulgarian +ERROR_DS_DRA_GENERIC - The replication operation failed. +. + +MessageId=8437 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_INVALID_PARAMETER +Language=Bulgarian +ERROR_DS_DRA_INVALID_PARAMETER - An invalid parameter was specified for this replication operation. +. + +MessageId=8438 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_BUSY +Language=Bulgarian +ERROR_DS_DRA_BUSY - The directory service is too busy to complete the replication operation at this time. +. + +MessageId=8439 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_BAD_DN +Language=Bulgarian +ERROR_DS_DRA_BAD_DN - The distinguished name specified for this replication operation is invalid. +. + +MessageId=8440 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_BAD_NC +Language=Bulgarian +ERROR_DS_DRA_BAD_NC - The naming context specified for this replication operation is invalid. +. + +MessageId=8441 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_DN_EXISTS +Language=Bulgarian +ERROR_DS_DRA_DN_EXISTS - The distinguished name specified for this replication operation already exists. +. + +MessageId=8442 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_INTERNAL_ERROR +Language=Bulgarian +ERROR_DS_DRA_INTERNAL_ERROR - The replication system encountered an internal error. +. + +MessageId=8443 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_INCONSISTENT_DIT +Language=Bulgarian +ERROR_DS_DRA_INCONSISTENT_DIT - The replication operation encountered a database inconsistency. +. + +MessageId=8444 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_CONNECTION_FAILED +Language=Bulgarian +ERROR_DS_DRA_CONNECTION_FAILED - The server specified for this replication operation could not be contacted. +. + +MessageId=8445 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_BAD_INSTANCE_TYPE +Language=Bulgarian +ERROR_DS_DRA_BAD_INSTANCE_TYPE - The replication operation encountered an object with an invalid instance type. +. + +MessageId=8446 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_OUT_OF_MEM +Language=Bulgarian +ERROR_DS_DRA_OUT_OF_MEM - The replication operation failed to allocate memory. +. + +MessageId=8447 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_MAIL_PROBLEM +Language=Bulgarian +ERROR_DS_DRA_MAIL_PROBLEM - The replication operation encountered an error with the mail system. +. + +MessageId=8448 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_REF_ALREADY_EXISTS +Language=Bulgarian +ERROR_DS_DRA_REF_ALREADY_EXISTS - The replication reference information for the target server already exists. +. + +MessageId=8449 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_REF_NOT_FOUND +Language=Bulgarian +ERROR_DS_DRA_REF_NOT_FOUND - The replication reference information for the target server does not exist. +. + +MessageId=8450 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_OBJ_IS_REP_SOURCE +Language=Bulgarian +ERROR_DS_DRA_OBJ_IS_REP_SOURCE - The naming context cannot be removed because it is replicated to another server. +. + +MessageId=8451 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_DB_ERROR +Language=Bulgarian +ERROR_DS_DRA_DB_ERROR - The replication operation encountered a database error. +. + +MessageId=8452 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_NO_REPLICA +Language=Bulgarian +ERROR_DS_DRA_NO_REPLICA - The naming context is in the process of being removed or is not replicated from the specified server. +. + +MessageId=8453 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_ACCESS_DENIED +Language=Bulgarian +ERROR_DS_DRA_ACCESS_DENIED - Replication access was denied. +. + +MessageId=8454 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_NOT_SUPPORTED +Language=Bulgarian +ERROR_DS_DRA_NOT_SUPPORTED - The requested operation is not supported by this version of the directory service. +. + +MessageId=8455 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_RPC_CANCELLED +Language=Bulgarian +ERROR_DS_DRA_RPC_CANCELLED - The replication remote procedure call was cancelled. +. + +MessageId=8456 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_SOURCE_DISABLED +Language=Bulgarian +ERROR_DS_DRA_SOURCE_DISABLED - The source server is currently rejecting replication requests. +. + +MessageId=8457 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_SINK_DISABLED +Language=Bulgarian +ERROR_DS_DRA_SINK_DISABLED - The destination server is currently rejecting replication requests. +. + +MessageId=8458 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_NAME_COLLISION +Language=Bulgarian +ERROR_DS_DRA_NAME_COLLISION - The replication operation failed due to a collision of object names. +. + +MessageId=8459 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_SOURCE_REINSTALLED +Language=Bulgarian +ERROR_DS_DRA_SOURCE_REINSTALLED - The replication source has been reinstalled. +. + +MessageId=8460 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_MISSING_PARENT +Language=Bulgarian +ERROR_DS_DRA_MISSING_PARENT - The replication operation failed because a required parent object is missing. +. + +MessageId=8461 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_PREEMPTED +Language=Bulgarian +ERROR_DS_DRA_PREEMPTED - The replication operation was preempted. +. + +MessageId=8462 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_ABANDON_SYNC +Language=Bulgarian +ERROR_DS_DRA_ABANDON_SYNC - The replication synchronization attempt was abandoned because of a lack of updates. +. + +MessageId=8463 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_SHUTDOWN +Language=Bulgarian +ERROR_DS_DRA_SHUTDOWN - The replication operation was terminated because the system is shutting down. +. + +MessageId=8464 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_INCOMPATIBLE_PARTIAL_SET +Language=Bulgarian +ERROR_DS_DRA_INCOMPATIBLE_PARTIAL_SET - Synchronization attempt failed because the destination DC is currently waiting to synchronize new partial attributes from source. This condition is normal if a recent schema change modified the partial attribute set. The destination partial attribute set is not a subset of the source partial attribute set. +. + +MessageId=8465 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_SOURCE_IS_PARTIAL_REPLICA +Language=Bulgarian +ERROR_DS_DRA_SOURCE_IS_PARTIAL_REPLICA - The replication synchronization attempt failed because a master replica attempted to sync from a partial replica. +. + +MessageId=8466 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_EXTN_CONNECTION_FAILED +Language=Bulgarian +ERROR_DS_DRA_EXTN_CONNECTION_FAILED - The server specified for this replication operation was contacted, but that server was unable to contact an additional server needed to complete the operation. +. + +MessageId=8467 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_INSTALL_SCHEMA_MISMATCH +Language=Bulgarian +ERROR_DS_INSTALL_SCHEMA_MISMATCH - The version of the Active Directory schema of the source forest is not compatible with the version of Active Directory on this computer. +. + +MessageId=8468 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DUP_LINK_ID +Language=Bulgarian +ERROR_DS_DUP_LINK_ID - Schema update failed: An attribute with the same link identifier already exists. +. + +MessageId=8469 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NAME_ERROR_RESOLVING +Language=Bulgarian +ERROR_DS_NAME_ERROR_RESOLVING - Name translation: Generic processing error. +. + +MessageId=8470 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NAME_ERROR_NOT_FOUND +Language=Bulgarian +ERROR_DS_NAME_ERROR_NOT_FOUND - Name translation: Could not find the name or insufficient right to see name. +. + +MessageId=8471 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NAME_ERROR_NOT_UNIQUE +Language=Bulgarian +ERROR_DS_NAME_ERROR_NOT_UNIQUE - Name translation: Input name mapped to more than one output name. +. + +MessageId=8472 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NAME_ERROR_NO_MAPPING +Language=Bulgarian +ERROR_DS_NAME_ERROR_NO_MAPPING - Name translation: Input name found, but not the associated output format. +. + +MessageId=8473 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NAME_ERROR_DOMAIN_ONLY +Language=Bulgarian +ERROR_DS_NAME_ERROR_DOMAIN_ONLY - Name translation: Unable to resolve completely, only the domain was found. +. + +MessageId=8474 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NAME_ERROR_NO_SYNTACTICAL_MAPPING +Language=Bulgarian +ERROR_DS_NAME_ERROR_NO_SYNTACTICAL_MAPPING - Name translation: Unable to perform purely syntactical mapping at the client without going out to the wire. +. + +MessageId=8475 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CONSTRUCTED_ATT_MOD +Language=Bulgarian +ERROR_DS_CONSTRUCTED_ATT_MOD - Modification of a constructed attribute is not allowed. +. + +MessageId=8476 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_WRONG_OM_OBJ_CLASS +Language=Bulgarian +ERROR_DS_WRONG_OM_OBJ_CLASS - The OM-Object-Class specified is incorrect for an attribute with the specified syntax. +. + +MessageId=8477 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_REPL_PENDING +Language=Bulgarian +ERROR_DS_DRA_REPL_PENDING - The replication request has been posted; waiting for reply. +. + +MessageId=8478 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DS_REQUIRED +Language=Bulgarian +ERROR_DS_DS_REQUIRED - The requested operation requires a directory service, and none was available. +. + +MessageId=8479 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_INVALID_LDAP_DISPLAY_NAME +Language=Bulgarian +ERROR_DS_INVALID_LDAP_DISPLAY_NAME - The LDAP display name of the class or attribute contains non-ASCII characters. +. + +MessageId=8480 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NON_BASE_SEARCH +Language=Bulgarian +ERROR_DS_NON_BASE_SEARCH - The requested search operation is only supported for base searches. +. + +MessageId=8481 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_RETRIEVE_ATTS +Language=Bulgarian +ERROR_DS_CANT_RETRIEVE_ATTS - The search failed to retrieve attributes from the database. +. + +MessageId=8482 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_BACKLINK_WITHOUT_LINK +Language=Bulgarian +ERROR_DS_BACKLINK_WITHOUT_LINK - The schema update operation tried to add a backward link attribute that has no corresponding forward link. +. + +MessageId=8483 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_EPOCH_MISMATCH +Language=Bulgarian +ERROR_DS_EPOCH_MISMATCH - Source and destination of a cross domain move do not agree on the object's epoch number. Either source or destination does not have the latest version of the object. +. + +MessageId=8484 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_SRC_NAME_MISMATCH +Language=Bulgarian +ERROR_DS_SRC_NAME_MISMATCH - Source and destination of a cross domain move do not agree on the object's current name. Either source or destination does not have the latest version of the object. +. + +MessageId=8485 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_SRC_AND_DST_NC_IDENTICAL +Language=Bulgarian +ERROR_DS_SRC_AND_DST_NC_IDENTICAL - Source and destination of a cross domain move operation are identical. Caller should use local move operation instead of cross domain move operation. +. + +MessageId=8486 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DST_NC_MISMATCH +Language=Bulgarian +ERROR_DS_DST_NC_MISMATCH - Source and destination for a cross domain move are not in agreement on the naming contexts in the forest. Either source or destination does not have the latest version of the Partitions container. +. + +MessageId=8487 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NOT_AUTHORITIVE_FOR_DST_NC +Language=Bulgarian +ERROR_DS_NOT_AUTHORITIVE_FOR_DST_NC - Destination of a cross domain move is not authoritative for the destination naming context. +. + +MessageId=8488 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_SRC_GUID_MISMATCH +Language=Bulgarian +ERROR_DS_SRC_GUID_MISMATCH - Source and destination of a cross domain move do not agree on the identity of the source object. Either source or destination does not have the latest version of the source object. +. + +MessageId=8489 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_MOVE_DELETED_OBJECT +Language=Bulgarian +ERROR_DS_CANT_MOVE_DELETED_OBJECT - Object being moved across domains is already known to be deleted by the destination server. The source server does not have the latest version of the source object. +. + +MessageId=8490 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_PDC_OPERATION_IN_PROGRESS +Language=Bulgarian +ERROR_DS_PDC_OPERATION_IN_PROGRESS - Another operation, which requires exclusive access to the PDC PSMO, is already in progress. +. + +MessageId=8491 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CROSS_DOMAIN_CLEANUP_REQD +Language=Bulgarian +ERROR_DS_CROSS_DOMAIN_CLEANUP_REQD - A cross domain move operation failed such that the two versions of the moved object exist - one each in the source and destination domains. The destination object needs to be removed to restore the system to a consistent state. +. + +MessageId=8492 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_ILLEGAL_XDOM_MOVE_OPERATION +Language=Bulgarian +ERROR_DS_ILLEGAL_XDOM_MOVE_OPERATION - This object may not be moved across domain boundaries either because cross domain moves for this class are disallowed, or the object has some special characteristics, e.g.: trust account or restricted RID, which prevent its move. +. + +MessageId=8493 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_WITH_ACCT_GROUP_MEMBERSHPS +Language=Bulgarian +ERROR_DS_CANT_WITH_ACCT_GROUP_MEMBERSHPS - Can't move objects with memberships across domain boundaries as once moved, this would violate the membership conditions of the account group. Remove the object from any account group memberships and retry. +. + +MessageId=8494 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NC_MUST_HAVE_NC_PARENT +Language=Bulgarian +ERROR_DS_NC_MUST_HAVE_NC_PARENT - A naming context head must be the immediate child of another naming context head, not of an interior node. +. + +MessageId=8495 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE +Language=Bulgarian +ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE - The directory cannot validate the proposed naming context name because it does not hold a replica of the naming context above the proposed naming context. Please ensure that the domain naming master role is held by a server that is configured as a global catalog server, and that the server is up to date with its replication partners. (Applies only to Windows 2000 Domain Naming masters) +. + +MessageId=8496 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DST_DOMAIN_NOT_NATIVE +Language=Bulgarian +ERROR_DS_DST_DOMAIN_NOT_NATIVE - Destination domain must be in native mode. +. + +MessageId=8497 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_MISSING_INFRASTRUCTURE_CONTAINER +Language=Bulgarian +ERROR_DS_MISSING_INFRASTRUCTURE_CONTAINER - The operation cannot be performed because the server does not have an infrastructure container in the domain of interest. +. + +MessageId=8498 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_MOVE_ACCOUNT_GROUP +Language=Bulgarian +ERROR_DS_CANT_MOVE_ACCOUNT_GROUP - Cross-domain move of non-empty account groups is not allowed. +. + +MessageId=8499 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_MOVE_RESOURCE_GROUP +Language=Bulgarian +ERROR_DS_CANT_MOVE_RESOURCE_GROUP - Cross-domain move of non-empty resource groups is not allowed. +. + +MessageId=8500 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_INVALID_SEARCH_FLAG +Language=Bulgarian +ERROR_DS_INVALID_SEARCH_FLAG - The search flags for the attribute are invalid. The ANR bit is valid only on attributes of Unicode or Teletex strings. +. + +MessageId=8501 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NO_TREE_DELETE_ABOVE_NC +Language=Bulgarian +ERROR_DS_NO_TREE_DELETE_ABOVE_NC - Tree deletions starting at an object which has an NC head as a descendant are not allowed. +. + +MessageId=8502 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_COULDNT_LOCK_TREE_FOR_DELETE +Language=Bulgarian +ERROR_DS_COULDNT_LOCK_TREE_FOR_DELETE - The directory service failed to lock a tree in preparation for a tree deletion because the tree was in use. +. + +MessageId=8503 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_COULDNT_IDENTIFY_OBJECTS_FOR_TREE_DELETE +Language=Bulgarian +ERROR_DS_COULDNT_IDENTIFY_OBJECTS_FOR_TREE_DELETE - The directory service failed to identify the list of objects to delete while attempting a tree deletion. +. + +MessageId=8504 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_SAM_INIT_FAILURE +Language=Bulgarian +ERROR_DS_SAM_INIT_FAILURE - Security Accounts Manager initialization failed because of the following error: %1. +Error Status: 0x%2. Click OK to shut down the system and reboot into Directory Services Restore Mode. Check the event log for detailed information. +. + +MessageId=8505 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_SENSITIVE_GROUP_VIOLATION +Language=Bulgarian +ERROR_DS_SENSITIVE_GROUP_VIOLATION - Only an administrator can modify the membership list of an administrative group. +. + +MessageId=8506 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_MOD_PRIMARYGROUPID +Language=Bulgarian +ERROR_DS_CANT_MOD_PRIMARYGROUPID - Cannot change the primary group ID of a domain controller account. +. + +MessageId=8507 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_ILLEGAL_BASE_SCHEMA_MOD +Language=Bulgarian +ERROR_DS_ILLEGAL_BASE_SCHEMA_MOD - An attempt is made to modify the base schema. +. + +MessageId=8508 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NONSAFE_SCHEMA_CHANGE +Language=Bulgarian +ERROR_DS_NONSAFE_SCHEMA_CHANGE - Adding a new mandatory attribute to an existing class, deleting a mandatory attribute from an existing class, or adding an optional attribute to the special class Top that is not a backlink attribute (directly or through inheritance, for example, by adding or deleting an auxiliary class) is not allowed. +. + +MessageId=8509 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_SCHEMA_UPDATE_DISALLOWED +Language=Bulgarian +ERROR_DS_SCHEMA_UPDATE_DISALLOWED - Schema update is not allowed on this DC because the DC is not the schema FSMO Role Owner. +. + +MessageId=8510 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_CREATE_UNDER_SCHEMA +Language=Bulgarian +ERROR_DS_CANT_CREATE_UNDER_SCHEMA - An object of this class cannot be created under the schema container. You can only create attribute-schema and class-schema objects under the schema container. +. + +MessageId=8511 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_INSTALL_NO_SRC_SCH_VERSION +Language=Bulgarian +ERROR_DS_INSTALL_NO_SRC_SCH_VERSION - The replica/child install failed to get the objectVersion attribute on the schema container on the source DC. Either the attribute is missing on the schema container or the credentials supplied do not have permission to read it. +. + +MessageId=8512 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_INSTALL_NO_SCH_VERSION_IN_INIFILE +Language=Bulgarian +ERROR_DS_INSTALL_NO_SCH_VERSION_IN_INIFILE - The replica/child install failed to read the objectVersion attribute in the SCHEMA section of the file schema.ini in the system32 directory. +. + +MessageId=8513 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_INVALID_GROUP_TYPE +Language=Bulgarian +ERROR_DS_INVALID_GROUP_TYPE - The specified group type is invalid. +. + +MessageId=8514 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN +Language=Bulgarian +ERROR_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN - Cannot nest global groups in a mixed domain if the group is security-enabled. +. + +MessageId=8515 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN +Language=Bulgarian +ERROR_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN - Cannot nest local groups in a mixed domain if the group is security-enabled. +. + +MessageId=8516 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER +Language=Bulgarian +ERROR_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER - A global group cannot have a local group as a member. +. + +MessageId=8517 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER +Language=Bulgarian +ERROR_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER - A global group cannot have a universal group as a member. +. + +MessageId=8518 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER +Language=Bulgarian +ERROR_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER - A universal group cannot have a local group as a member. +. + +MessageId=8519 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER +Language=Bulgarian +ERROR_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER - A global group cannot have a cross-domain member. +. + +MessageId=8520 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER +Language=Bulgarian +ERROR_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER - A local group cannot have another cross-domain local group as a member. +. + +MessageId=8521 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_HAVE_PRIMARY_MEMBERS +Language=Bulgarian +ERROR_DS_HAVE_PRIMARY_MEMBERS - A group with primary members cannot change to a security-disabled group. +. + +MessageId=8522 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_STRING_SD_CONVERSION_FAILED +Language=Bulgarian +ERROR_DS_STRING_SD_CONVERSION_FAILED - The schema cache load failed to convert the string default SD on a class-schema object. +. + +MessageId=8523 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NAMING_MASTER_GC +Language=Bulgarian +ERROR_DS_NAMING_MASTER_GC - Only DSAs configured to be Global Catalog servers should be allowed to hold the Domain Naming Master FSMO role. (Applies only to Windows 2000 servers) +. + +MessageId=8524 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_LOOKUP_FAILURE +Language=Bulgarian +ERROR_DS_LOOKUP_FAILURE - The DSA operation is unable to proceed because of a DNS lookup failure. +. + +MessageId=8525 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_COULDNT_UPDATE_SPNS +Language=Bulgarian +ERROR_DS_COULDNT_UPDATE_SPNS - While processing a change to the DNS Host Name for an object, the Service Principal Name values could not be kept in sync. +. + +MessageId=8526 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_RETRIEVE_SD +Language=Bulgarian +ERROR_DS_CANT_RETRIEVE_SD - The Security Descriptor attribute could not be read. +. + +MessageId=8527 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_KEY_NOT_UNIQUE +Language=Bulgarian +ERROR_DS_KEY_NOT_UNIQUE - The object requested was not found, but an object with that key was found. +. + +MessageId=8528 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_WRONG_LINKED_ATT_SYNTAX +Language=Bulgarian +ERROR_DS_WRONG_LINKED_ATT_SYNTAX - The syntax of the linked attributed being added is incorrect. Forward links can only have syntax 2.5.5.1, 2.5.5.7, and 2.5.5.14, and backlinks can only have syntax 2.5.5.1. +. + +MessageId=8529 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_SAM_NEED_BOOTKEY_PASSWORD +Language=Bulgarian +ERROR_DS_SAM_NEED_BOOTKEY_PASSWORD - Security Account Manager needs to get the boot password. +. + +MessageId=8530 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_SAM_NEED_BOOTKEY_FLOPPY +Language=Bulgarian +ERROR_DS_SAM_NEED_BOOTKEY_FLOPPY - Security Account Manager needs to get the boot key from floppy disk. +. + +MessageId=8531 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_START +Language=Bulgarian +ERROR_DS_CANT_START - Directory Service cannot start. +. + +MessageId=8532 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_INIT_FAILURE +Language=Bulgarian +ERROR_DS_INIT_FAILURE - Directory Services could not start. +. + +MessageId=8533 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NO_PKT_PRIVACY_ON_CONNECTION +Language=Bulgarian +ERROR_DS_NO_PKT_PRIVACY_ON_CONNECTION - The connection between client and server requires packet privacy or better. +. + +MessageId=8534 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_SOURCE_DOMAIN_IN_FOREST +Language=Bulgarian +ERROR_DS_SOURCE_DOMAIN_IN_FOREST - The source domain may not be in the same forest as destination. +. + +MessageId=8535 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DESTINATION_DOMAIN_NOT_IN_FOREST +Language=Bulgarian +ERROR_DS_DESTINATION_DOMAIN_NOT_IN_FOREST - The destination domain must be in the forest. +. + +MessageId=8536 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DESTINATION_AUDITING_NOT_ENABLED +Language=Bulgarian +ERROR_DS_DESTINATION_AUDITING_NOT_ENABLED - The operation requires that destination domain auditing be enabled. +. + +MessageId=8537 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_FIND_DC_FOR_SRC_DOMAIN +Language=Bulgarian +ERROR_DS_CANT_FIND_DC_FOR_SRC_DOMAIN - The operation couldn't locate a DC for the source domain. +. + +MessageId=8538 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_SRC_OBJ_NOT_GROUP_OR_USER +Language=Bulgarian +ERROR_DS_SRC_OBJ_NOT_GROUP_OR_USER - The source object must be a group or user. +. + +MessageId=8539 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_SRC_SID_EXISTS_IN_FOREST +Language=Bulgarian +ERROR_DS_SRC_SID_EXISTS_IN_FOREST - The source object's SID already exists in destination forest. +. + +MessageId=8540 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_SRC_AND_DST_OBJECT_CLASS_MISMATCH +Language=Bulgarian +ERROR_DS_SRC_AND_DST_OBJECT_CLASS_MISMATCH - The source and destination object must be of the same type. +. + +MessageId=8541 +Severity=Success +Facility=System +SymbolicName=ERROR_SAM_INIT_FAILURE +Language=Bulgarian +ERROR_SAM_INIT_FAILURE - Security Accounts Manager initialization failed because of the following error: %1. +Error Status: 0x%2. Click OK to shut down the system and reboot into Safe Mode. Check the event log for detailed information. +. + +MessageId=8542 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_SCHEMA_INFO_SHIP +Language=Bulgarian +ERROR_DS_DRA_SCHEMA_INFO_SHIP - Schema information could not be included in the replication request. +. + +MessageId=8543 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_SCHEMA_CONFLICT +Language=Bulgarian +ERROR_DS_DRA_SCHEMA_CONFLICT - The replication operation could not be completed due to a schema incompatibility. +. + +MessageId=8544 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_EARLIER_SCHEMA_CONLICT +Language=Bulgarian +ERROR_DS_DRA_EARLIER_SCHEMA_CONLICT - The replication operation could not be completed due to a previous schema incompatibility. +. + +MessageId=8545 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_OBJ_NC_MISMATCH +Language=Bulgarian +ERROR_DS_DRA_OBJ_NC_MISMATCH - The replication update could not be applied because either the source or the destination has not yet received information regarding a recent cross-domain move operation. +. + +MessageId=8546 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NC_STILL_HAS_DSAS +Language=Bulgarian +ERROR_DS_NC_STILL_HAS_DSAS - The requested domain could not be deleted because there exist domain controllers that still host this domain. +. + +MessageId=8547 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_GC_REQUIRED +Language=Bulgarian +ERROR_DS_GC_REQUIRED - The requested operation can be performed only on a global catalog server. +. + +MessageId=8548 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_LOCAL_MEMBER_OF_LOCAL_ONLY +Language=Bulgarian +ERROR_DS_LOCAL_MEMBER_OF_LOCAL_ONLY - A local group can only be a member of other local groups in the same domain. +. + +MessageId=8549 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NO_FPO_IN_UNIVERSAL_GROUPS +Language=Bulgarian +ERROR_DS_NO_FPO_IN_UNIVERSAL_GROUPS - Foreign security principals cannot be members of universal groups. +. + +MessageId=8550 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_ADD_TO_GC +Language=Bulgarian +ERROR_DS_CANT_ADD_TO_GC - The attribute is not allowed to be replicated to the GC because of security reasons. +. + +MessageId=8551 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NO_CHECKPOINT_WITH_PDC +Language=Bulgarian +ERROR_DS_NO_CHECKPOINT_WITH_PDC - The checkpoint with the PDC could not be taken because there are too many modifications being processed currently. +. + +MessageId=8552 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_SOURCE_AUDITING_NOT_ENABLED +Language=Bulgarian +ERROR_DS_SOURCE_AUDITING_NOT_ENABLED - The operation requires that source domain auditing be enabled. +. + +MessageId=8553 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_CREATE_IN_NONDOMAIN_NC +Language=Bulgarian +ERROR_DS_CANT_CREATE_IN_NONDOMAIN_NC - Security principal objects can only be created inside domain naming contexts. +. + +MessageId=8554 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_INVALID_NAME_FOR_SPN +Language=Bulgarian +ERROR_DS_INVALID_NAME_FOR_SPN - A Service Principal Name (SPN) could not be constructed because the provided hostname is not in the necessary format. +. + +MessageId=8555 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_FILTER_USES_CONTRUCTED_ATTRS +Language=Bulgarian +ERROR_DS_FILTER_USES_CONTRUCTED_ATTRS - A Filter was passed that uses constructed attributes. +. + +MessageId=8556 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_UNICODEPWD_NOT_IN_QUOTES +Language=Bulgarian +ERROR_DS_UNICODEPWD_NOT_IN_QUOTES - The unicodePwd attribute value must be enclosed in double quotes. +. + +MessageId=8557 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED +Language=Bulgarian +ERROR_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED - Your computer could not be joined to the domain. You have exceeded the maximum number of computer accounts you are allowed to create in this domain. Contact your system administrator to have this limit reset or increased. +. + +MessageId=8558 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_MUST_BE_RUN_ON_DST_DC +Language=Bulgarian +ERROR_DS_MUST_BE_RUN_ON_DST_DC - For security reasons, the operation must be run on the destination DC. +. + +MessageId=8559 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_SRC_DC_MUST_BE_SP4_OR_GREATER +Language=Bulgarian +ERROR_DS_SRC_DC_MUST_BE_SP4_OR_GREATER - For security reasons, the source DC must be NT4SP4 or greater. +. + +MessageId=8560 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_TREE_DELETE_CRITICAL_OBJ +Language=Bulgarian +ERROR_DS_CANT_TREE_DELETE_CRITICAL_OBJ - Critical Directory Service System objects cannot be deleted during tree delete operations. The tree delete may have been partially performed. +. + +MessageId=8561 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_INIT_FAILURE_CONSOLE +Language=Bulgarian +ERROR_DS_INIT_FAILURE_CONSOLE - Directory Services could not start because of the following error: %1. +Error Status: 0x%2. Please click OK to shutdown the system. You can use the recovery console to diagnose the system further. +. + +MessageId=8562 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_SAM_INIT_FAILURE_CONSOLE +Language=Bulgarian +ERROR_DS_SAM_INIT_FAILURE_CONSOLE - Security Accounts Manager initialization failed because of the following error: %1. +Error Status: 0x%2. Please click OK to shutdown the system. You can use the recovery console to diagnose the system further. +. + +MessageId=8563 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_FOREST_VERSION_TOO_HIGH +Language=Bulgarian +ERROR_DS_FOREST_VERSION_TOO_HIGH - The version of the operating system installed is incompatible with the current forest functional level. You must upgrade to a new version of the operating system before this server can become a domain controller in this forest. +. + +MessageId=8564 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DOMAIN_VERSION_TOO_HIGH +Language=Bulgarian +ERROR_DS_DOMAIN_VERSION_TOO_HIGH - The version of the operating system installed is incompatible with the current domain functional level. You must upgrade to a new version of the operating system before this server can become a domain controller in this domain. +. + +MessageId=8565 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_FOREST_VERSION_TOO_LOW +Language=Bulgarian +ERROR_DS_FOREST_VERSION_TOO_LOW - This version of the operating system installed on this server no longer supports the current forest functional level. You must raise the forest functional level before this server can become a domain controller in this forest. +. + +MessageId=8566 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DOMAIN_VERSION_TOO_LOW +Language=Bulgarian +ERROR_DS_DOMAIN_VERSION_TOO_LOW - This version of the operating system installed on this server no longer supports the current domain functional level. You must raise the domain functional level before this server can become a domain controller in this domain. +. + +MessageId=8567 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_INCOMPATIBLE_VERSION +Language=Bulgarian +ERROR_DS_INCOMPATIBLE_VERSION - The version of the operating system installed on this server is incompatible with the functional level of the domain or forest. +. + +MessageId=8568 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_LOW_DSA_VERSION +Language=Bulgarian +ERROR_DS_LOW_DSA_VERSION - The functional level of the domain (or forest) cannot be raised to the requested value, because there exist one or more domain controllers in the domain (or forest) that are at a lower incompatible functional level. +. + +MessageId=8569 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NO_BEHAVIOR_VERSION_IN_MIXEDDOMAIN +Language=Bulgarian +ERROR_DS_NO_BEHAVIOR_VERSION_IN_MIXEDDOMAIN - The forest functional level cannot be raised to the requested level since one or more domains are still in mixed domain mode. All domains in the forest must be in native mode before you can raise the forest functional level. +. + +MessageId=8570 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NOT_SUPPORTED_SORT_ORDER +Language=Bulgarian +ERROR_DS_NOT_SUPPORTED_SORT_ORDER - The sort order requested is not supported. +. + +MessageId=8571 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NAME_NOT_UNIQUE +Language=Bulgarian +ERROR_DS_NAME_NOT_UNIQUE - The requested name already exists as a unique identifier. +. + +MessageId=8572 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_MACHINE_ACCOUNT_CREATED_PRENT4 +Language=Bulgarian +ERROR_DS_MACHINE_ACCOUNT_CREATED_PRENT4 - The machine account was created pre-NT4. The account needs to be recreated. +. + +MessageId=8573 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_OUT_OF_VERSION_STORE +Language=Bulgarian +ERROR_DS_OUT_OF_VERSION_STORE - The database is out of version store. +. + +MessageId=8574 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_INCOMPATIBLE_CONTROLS_USED +Language=Bulgarian +ERROR_DS_INCOMPATIBLE_CONTROLS_USED - Unable to continue operation because multiple conflicting controls were used. +. + +MessageId=8575 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NO_REF_DOMAIN +Language=Bulgarian +ERROR_DS_NO_REF_DOMAIN - Unable to find a valid security descriptor reference domain for this partition. +. + +MessageId=8576 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_RESERVED_LINK_ID +Language=Bulgarian +ERROR_DS_RESERVED_LINK_ID - Schema update failed: The link identifier is reserved. +. + +MessageId=8577 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_LINK_ID_NOT_AVAILABLE +Language=Bulgarian +ERROR_DS_LINK_ID_NOT_AVAILABLE - Schema update failed: There are no link identifiers available. +. + +MessageId=8578 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER +Language=Bulgarian +ERROR_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER - An account group cannot have a universal group as a member. +. + +MessageId=8579 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_MODIFYDN_DISALLOWED_BY_INSTANCE_TYPE +Language=Bulgarian +ERROR_DS_MODIFYDN_DISALLOWED_BY_INSTANCE_TYPE - Rename or move operations on naming context heads or read-only objects are not allowed. +. + +MessageId=8580 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NO_OBJECT_MOVE_IN_SCHEMA_NC +Language=Bulgarian +ERROR_DS_NO_OBJECT_MOVE_IN_SCHEMA_NC - Move operations on objects in the schema naming context are not allowed. +. + +MessageId=8581 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_MODIFYDN_DISALLOWED_BY_FLAG +Language=Bulgarian +ERROR_DS_MODIFYDN_DISALLOWED_BY_FLAG - A system flag has been set on the object and does not allow the object to be moved or renamed. +. + +MessageId=8582 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_MODIFYDN_WRONG_GRANDPARENT +Language=Bulgarian +ERROR_DS_MODIFYDN_WRONG_GRANDPARENT - This object is not allowed to change its grandparent container. Moves are not forbidden on this object, but are restricted to sibling containers. +. + +MessageId=8583 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NAME_ERROR_TRUST_REFERRAL +Language=Bulgarian +ERROR_DS_NAME_ERROR_TRUST_REFERRAL - Unable to resolve completely, a referral to another forest is generated. +. + +MessageId=8584 +Severity=Success +Facility=System +SymbolicName=ERROR_NOT_SUPPORTED_ON_STANDARD_SERVER +Language=Bulgarian +ERROR_NOT_SUPPORTED_ON_STANDARD_SERVER - The requested action is not supported on standard server. +. + +MessageId=8585 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_ACCESS_REMOTE_PART_OF_AD +Language=Bulgarian +ERROR_DS_CANT_ACCESS_REMOTE_PART_OF_AD - Could not access a partition of the Active Directory located on a remote server. Make sure at least one server is running for the partition in question. +. + +MessageId=8586 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE_V2 +Language=Bulgarian +ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE_V2 - The directory cannot validate the proposed naming context (or partition) name because it does not hold a replica nor can it contact a replica of the naming context above the proposed naming context. Please ensure that the parent naming context is properly registered in DNS, and at least one replica of this naming context is reachable by the Domain Naming master. +. + +MessageId=8587 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_THREAD_LIMIT_EXCEEDED +Language=Bulgarian +ERROR_DS_THREAD_LIMIT_EXCEEDED - The thread limit for this request was exceeded. +. + +MessageId=8588 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NOT_CLOSEST +Language=Bulgarian +ERROR_DS_NOT_CLOSEST - The Global catalog server is not in the closet site. +. + +MessageId=8589 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_DERIVE_SPN_WITHOUT_SERVER_REF +Language=Bulgarian +ERROR_DS_CANT_DERIVE_SPN_WITHOUT_SERVER_REF - The DS cannot derive a service principal name (SPN) with which to mutually authenticate the target server because the corresponding server object in the local DS database has no serverReference attribute. +. + +MessageId=8590 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_SINGLE_USER_MODE_FAILED +Language=Bulgarian +ERROR_DS_SINGLE_USER_MODE_FAILED - The Directory Service failed to enter single user mode. +. + +MessageId=8591 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NTDSCRIPT_SYNTAX_ERROR +Language=Bulgarian +ERROR_DS_NTDSCRIPT_SYNTAX_ERROR - The Directory Service cannot parse the script because of a syntax error. +. + +MessageId=8592 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NTDSCRIPT_PROCESS_ERROR +Language=Bulgarian +ERROR_DS_NTDSCRIPT_PROCESS_ERROR - The Directory Service cannot process the script because of an error. +. + +MessageId=8593 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DIFFERENT_REPL_EPOCHS +Language=Bulgarian +ERROR_DS_DIFFERENT_REPL_EPOCHS - The directory service cannot perform the requested operation because the servers involved are of different replication epochs (which is usually related to a domain rename that is in progress). +. + +MessageId=8594 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRS_EXTENSIONS_CHANGED +Language=Bulgarian +ERROR_DS_DRS_EXTENSIONS_CHANGED - The directory service binding must be renegotiated due to a change in the server extensions information. +. + +MessageId=8595 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_REPLICA_SET_CHANGE_NOT_ALLOWED_ON_DISABLED_CR +Language=Bulgarian +ERROR_DS_REPLICA_SET_CHANGE_NOT_ALLOWED_ON_DISABLED_CR - Operation not allowed on a disabled cross ref. +. + +MessageId=8596 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_NO_MSDS_INTID +Language=Bulgarian +ERROR_DS_NO_MSDS_INTID - Schema update failed: No values for msDS-IntId are available. +. + +MessageId=8597 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DUP_MSDS_INTID +Language=Bulgarian +ERROR_DS_DUP_MSDS_INTID - Schema update failed: Duplicate msDS-IntId. Retry the operation. +. + +MessageId=8598 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_EXISTS_IN_RDNATTID +Language=Bulgarian +ERROR_DS_EXISTS_IN_RDNATTID - Schema deletion failed: attribute is used in rDNAttID. +. + +MessageId=8599 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_AUTHORIZATION_FAILED +Language=Bulgarian +ERROR_DS_AUTHORIZATION_FAILED - The directory service failed to authorize the request. +. + +MessageId=8600 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_INVALID_SCRIPT +Language=Bulgarian +ERROR_DS_INVALID_SCRIPT - The Directory Service cannot process the script because it is invalid. +. + +MessageId=8601 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_REMOTE_CROSSREF_OP_FAILED +Language=Bulgarian +ERROR_DS_REMOTE_CROSSREF_OP_FAILED - The remote create cross reference operation failed on the Domain Naming Master FSMO. The operation's error is in the extended data. +. + +MessageId=8602 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CROSS_REF_BUSY +Language=Bulgarian +ERROR_DS_CROSS_REF_BUSY - A cross reference is in use locally with the same name. +. + +MessageId=8603 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_DERIVE_SPN_FOR_DELETED_DOMAIN +Language=Bulgarian +ERROR_DS_CANT_DERIVE_SPN_FOR_DELETED_DOMAIN - The DS cannot derive a service principal name (SPN) with which to mutually authenticate the target server because the server's domain has been deleted from the forest. +. + +MessageId=8604 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_DEMOTE_WITH_WRITEABLE_NC +Language=Bulgarian +ERROR_DS_CANT_DEMOTE_WITH_WRITEABLE_NC - Writeable NCs prevent this DC from demoting. +. + +MessageId=8605 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DUPLICATE_ID_FOUND +Language=Bulgarian +ERROR_DS_DUPLICATE_ID_FOUND - The requested object has a non-unique identifier and cannot be retrieved. +. + +MessageId=8606 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_INSUFFICIENT_ATTR_TO_CREATE_OBJECT +Language=Bulgarian +ERROR_DS_INSUFFICIENT_ATTR_TO_CREATE_OBJECT - Insufficient attributes were given to create an object. This object may not exist because it may have been deleted and already garbage collected. +. + +MessageId=8607 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_GROUP_CONVERSION_ERROR +Language=Bulgarian +ERROR_DS_GROUP_CONVERSION_ERROR - The group cannot be converted due to attribute restrictions on the requested group type. +. + +MessageId=8608 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_MOVE_APP_BASIC_GROUP +Language=Bulgarian +ERROR_DS_CANT_MOVE_APP_BASIC_GROUP - Cross-domain move of non-empty basic application groups is not allowed. +. + +MessageId=8609 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_CANT_MOVE_APP_QUERY_GROUP +Language=Bulgarian +ERROR_DS_CANT_MOVE_APP_QUERY_GROUP - Cross-domain move on non-empty query based application groups is not allowed. +. + +MessageId=8610 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_ROLE_NOT_VERIFIED +Language=Bulgarian +ERROR_DS_ROLE_NOT_VERIFIED - The role owner could not be verified because replication of its partition has not occurred recently. +. + +MessageId=8611 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_WKO_CONTAINER_CANNOT_BE_SPECIAL +Language=Bulgarian +ERROR_DS_WKO_CONTAINER_CANNOT_BE_SPECIAL - The target container for a redirection of a well-known object container cannot already be a special container. +. + +MessageId=8612 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DOMAIN_RENAME_IN_PROGRESS +Language=Bulgarian +ERROR_DS_DOMAIN_RENAME_IN_PROGRESS - The Directory Service cannot perform the requested operation because a domain rename operation is in progress. +. + +MessageId=8613 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_EXISTING_AD_CHILD_NC +Language=Bulgarian +ERROR_DS_EXISTING_AD_CHILD_NC - The Active Directory detected an Active Directory child partition below the requested new partition name. The Active Directory's partition hierarchy must be created in a top-down method. +. + +MessageId=8614 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_REPL_LIFETIME_EXCEEDED +Language=Bulgarian +ERROR_DS_REPL_LIFETIME_EXCEEDED - The Active Directory cannot replicate with this server because the time since the last replication with this server has exceeded the tombstone lifetime. +. + +MessageId=8615 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DISALLOWED_IN_SYSTEM_CONTAINER +Language=Bulgarian +ERROR_DS_DISALLOWED_IN_SYSTEM_CONTAINER - The requested operation is not allowed on an object under the system container. +. + +MessageId=8616 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_LDAP_SEND_QUEUE_FULL +Language=Bulgarian +ERROR_DS_LDAP_SEND_QUEUE_FULL - The LDAP servers network send queue has filled up because the client is not processing the results of it's requests fast enough. No more requests will be processed until the client catches up. If the client does not catch up then it will be disconnected. +. + +MessageId=8617 +Severity=Success +Facility=System +SymbolicName=ERROR_DS_DRA_OUT_SCHEDULE_WINDOW +Language=Bulgarian +ERROR_DS_DRA_OUT_SCHEDULE_WINDOW - The scheduled replication did not take place because the system was too busy to execute the request within the schedule window. The replication queue is overloaded. Consider reducing the number of partners or decreasing the scheduled replication frequency. +. + +MessageId=9001 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_RCODE_FORMAT_ERROR +Language=Bulgarian +DNS_ERROR_RCODE_FORMAT_ERROR - DNS server unable to interpret format. +. + +MessageId=9002 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_RCODE_SERVER_FAILURE +Language=Bulgarian +DNS_ERROR_RCODE_SERVER_FAILURE - DNS server failure. +. + +MessageId=9003 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_RCODE_NAME_ERROR +Language=Bulgarian +DNS_ERROR_RCODE_NAME_ERROR - DNS name does not exist. +. + +MessageId=9004 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_RCODE_NOT_IMPLEMENTED +Language=Bulgarian +DNS_ERROR_RCODE_NOT_IMPLEMENTED - DNS request not supported by name server. +. + +MessageId=9005 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_RCODE_REFUSED +Language=Bulgarian +DNS_ERROR_RCODE_REFUSED - DNS operation refused. +. + +MessageId=9006 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_RCODE_YXDOMAIN +Language=Bulgarian +DNS_ERROR_RCODE_YXDOMAIN - DNS name that ought not exist, does exist. +. + +MessageId=9007 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_RCODE_YXRRSET +Language=Bulgarian +DNS_ERROR_RCODE_YXRRSET - DNS RR set that ought not exist, does exist. +. + +MessageId=9008 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_RCODE_NXRRSET +Language=Bulgarian +DNS_ERROR_RCODE_NXRRSET - DNS RR set that ought to exist, does not exist. +. + +MessageId=9009 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_RCODE_NOTAUTH +Language=Bulgarian +DNS_ERROR_RCODE_NOTAUTH - DNS server not authoritative for zone. +. + +MessageId=9010 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_RCODE_NOTZONE +Language=Bulgarian +DNS_ERROR_RCODE_NOTZONE - DNS name in update or prereq is not in zone. +. + +MessageId=9016 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_RCODE_BADSIG +Language=Bulgarian +DNS_ERROR_RCODE_BADSIG - DNS signature failed to verify. +. + +MessageId=9017 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_RCODE_BADKEY +Language=Bulgarian +DNS_ERROR_RCODE_BADKEY - DNS bad key. +. + +MessageId=9018 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_RCODE_BADTIME +Language=Bulgarian +DNS_ERROR_RCODE_BADTIME - DNS signature validity expired. +. + +MessageId=9501 +Severity=Success +Facility=System +SymbolicName=DNS_INFO_NO_RECORDS +Language=Bulgarian +DNS_INFO_NO_RECORDS - No records found for given DNS query. +. + +MessageId=9502 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_BAD_PACKET +Language=Bulgarian +DNS_ERROR_BAD_PACKET - Bad DNS packet. +. + +MessageId=9503 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_NO_PACKET +Language=Bulgarian +DNS_ERROR_NO_PACKET - No DNS packet. +. + +MessageId=9504 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_RCODE +Language=Bulgarian +DNS_ERROR_RCODE - DNS error, check rcode. +. + +MessageId=9505 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_UNSECURE_PACKET +Language=Bulgarian +DNS_ERROR_UNSECURE_PACKET - Unsecured DNS packet. +. + +MessageId=9551 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_INVALID_TYPE +Language=Bulgarian +DNS_ERROR_INVALID_TYPE - Invalid DNS type. +. + +MessageId=9552 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_INVALID_IP_ADDRESS +Language=Bulgarian +DNS_ERROR_INVALID_IP_ADDRESS - Invalid IP address. +. + +MessageId=9553 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_INVALID_PROPERTY +Language=Bulgarian +DNS_ERROR_INVALID_PROPERTY - Invalid property. +. + +MessageId=9554 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_TRY_AGAIN_LATER +Language=Bulgarian +DNS_ERROR_TRY_AGAIN_LATER - Try DNS operation again later. +. + +MessageId=9555 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_NOT_UNIQUE +Language=Bulgarian +DNS_ERROR_NOT_UNIQUE - Record for given name and type is not unique. +. + +MessageId=9556 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_NON_RFC_NAME +Language=Bulgarian +DNS_ERROR_NON_RFC_NAME - DNS name does not comply with RFC specifications. +. + +MessageId=9557 +Severity=Success +Facility=System +SymbolicName=DNS_STATUS_FQDN +Language=Bulgarian +DNS_STATUS_FQDN - DNS name is a fully-qualified DNS name. +. + +MessageId=9558 +Severity=Success +Facility=System +SymbolicName=DNS_STATUS_DOTTED_NAME +Language=Bulgarian +DNS_STATUS_DOTTED_NAME - DNS name is dotted (multi-label). +. + +MessageId=9559 +Severity=Success +Facility=System +SymbolicName=DNS_STATUS_SINGLE_PART_NAME +Language=Bulgarian +DNS_STATUS_SINGLE_PART_NAME - DNS name is a single-part name. +. + +MessageId=9560 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_INVALID_NAME_CHAR +Language=Bulgarian +DNS_ERROR_INVALID_NAME_CHAR - DSN name contains an invalid character. +. + +MessageId=9561 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_NUMERIC_NAME +Language=Bulgarian +DNS_ERROR_NUMERIC_NAME - DNS name is entirely numeric. +. + +MessageId=9562 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_NOT_ALLOWED_ON_ROOT_SERVER +Language=Bulgarian +DNS_ERROR_NOT_ALLOWED_ON_ROOT_SERVER - The operation requested is not permitted on a DNS root server. +. + +MessageId=9563 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_NOT_ALLOWED_UNDER_DELEGATION +Language=Bulgarian +DNS_ERROR_NOT_ALLOWED_UNDER_DELEGATION - The record could not be created because this part of the DNS namespace has been delegated to another server. +. + +MessageId=9564 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_CANNOT_FIND_ROOT_HINTS +Language=Bulgarian +DNS_ERROR_CANNOT_FIND_ROOT_HINTS - The DNS server could not find a set of root hints. +. + +MessageId=9565 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_INCONSISTENT_ROOT_HINTS +Language=Bulgarian +DNS_ERROR_INCONSISTENT_ROOT_HINTS - The DNS server found root hints but they were not consistent across all adapters. +. + +MessageId=9601 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_ZONE_DOES_NOT_EXIST +Language=Bulgarian +DNS_ERROR_ZONE_DOES_NOT_EXIST - DNS zone does not exist. +. + +MessageId=9602 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_NO_ZONE_INFO +Language=Bulgarian +DNS_ERROR_NO_ZONE_INFO - DNS zone information not available. +. + +MessageId=9603 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_INVALID_ZONE_OPERATION +Language=Bulgarian +DNS_ERROR_INVALID_ZONE_OPERATION - Invalid operation for DNS zone. +. + +MessageId=9604 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_ZONE_CONFIGURATION_ERROR +Language=Bulgarian +DNS_ERROR_ZONE_CONFIGURATION_ERROR - Invalid DNS zone configuration. +. + +MessageId=9605 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_ZONE_HAS_NO_SOA_RECORD +Language=Bulgarian +DNS_ERROR_ZONE_HAS_NO_SOA_RECORD - DNS zone has no start of authority (SOA) record. +. + +MessageId=9606 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_ZONE_HAS_NO_NS_RECORDS +Language=Bulgarian +DNS_ERROR_ZONE_HAS_NO_NS_RECORDS - DNS zone has no name server (NS) record. +. + +MessageId=9607 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_ZONE_LOCKED +Language=Bulgarian +DNS_ERROR_ZONE_LOCKED - DNS zone is locked. +. + +MessageId=9608 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_ZONE_CREATION_FAILED +Language=Bulgarian +DNS_ERROR_ZONE_CREATION_FAILED - DNS zone creation failed. +. + +MessageId=9609 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_ZONE_ALREADY_EXISTS +Language=Bulgarian +DNS_ERROR_ZONE_ALREADY_EXISTS - DNS zone already exists. +. + +MessageId=9610 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_AUTOZONE_ALREADY_EXISTS +Language=Bulgarian +DNS_ERROR_AUTOZONE_ALREADY_EXISTS - DNS automatic zone already exists. +. + +MessageId=9611 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_INVALID_ZONE_TYPE +Language=Bulgarian +DNS_ERROR_INVALID_ZONE_TYPE - Invalid DNS zone type. +. + +MessageId=9612 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_SECONDARY_REQUIRES_MASTER_IP +Language=Bulgarian +DNS_ERROR_SECONDARY_REQUIRES_MASTER_IP - Secondary DNS zone requires master IP address. +. + +MessageId=9613 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_ZONE_NOT_SECONDARY +Language=Bulgarian +DNS_ERROR_ZONE_NOT_SECONDARY - DNS zone not secondary. +. + +MessageId=9614 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_NEED_SECONDARY_ADDRESSES +Language=Bulgarian +DNS_ERROR_NEED_SECONDARY_ADDRESSES - Need secondary IP address. +. + +MessageId=9615 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_WINS_INIT_FAILED +Language=Bulgarian +DNS_ERROR_WINS_INIT_FAILED - WINS initialization failed. +. + +MessageId=9616 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_NEED_WINS_SERVERS +Language=Bulgarian +DNS_ERROR_NEED_WINS_SERVERS - Need WINS servers. +. + +MessageId=9617 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_NBSTAT_INIT_FAILED +Language=Bulgarian +DNS_ERROR_NBSTAT_INIT_FAILED - NBTSTAT initialization call failed. +. + +MessageId=9618 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_SOA_DELETE_INVALID +Language=Bulgarian +DNS_ERROR_SOA_DELETE_INVALID - Invalid delete of start of authority (SOA) +. + +MessageId=9619 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_FORWARDER_ALREADY_EXISTS +Language=Bulgarian +DNS_ERROR_FORWARDER_ALREADY_EXISTS - A conditional forwarding zone already exists for that name. +. + +MessageId=9620 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_ZONE_REQUIRES_MASTER_IP +Language=Bulgarian +DNS_ERROR_ZONE_REQUIRES_MASTER_IP - This zone must be configured with one or more master DNS server IP addresses. +. + +MessageId=9621 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_ZONE_IS_SHUTDOWN +Language=Bulgarian +DNS_ERROR_ZONE_IS_SHUTDOWN - The operation cannot be performed because this zone is shutdown. +. + +MessageId=9651 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_PRIMARY_REQUIRES_DATAFILE +Language=Bulgarian +DNS_ERROR_PRIMARY_REQUIRES_DATAFILE - Primary DNS zone requires datafile. +. + +MessageId=9652 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_INVALID_DATAFILE_NAME +Language=Bulgarian +DNS_ERROR_INVALID_DATAFILE_NAME - Invalid datafile name for DNS zone. +. + +MessageId=9653 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_DATAFILE_OPEN_FAILURE +Language=Bulgarian +DNS_ERROR_DATAFILE_OPEN_FAILURE - Failed to open datafile for DNS zone. +. + +MessageId=9654 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_FILE_WRITEBACK_FAILED +Language=Bulgarian +DNS_ERROR_FILE_WRITEBACK_FAILED - Failed to write datafile for DNS zone. +. + +MessageId=9655 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_DATAFILE_PARSING +Language=Bulgarian +DNS_ERROR_DATAFILE_PARSING - Failure while reading datafile for DNS zone. +. + +MessageId=9701 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_RECORD_DOES_NOT_EXIST +Language=Bulgarian +DNS_ERROR_RECORD_DOES_NOT_EXIST - DNS record does not exist. +. + +MessageId=9702 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_RECORD_FORMAT +Language=Bulgarian +DNS_ERROR_RECORD_FORMAT - DNS record format error. +. + +MessageId=9703 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_NODE_CREATION_FAILED +Language=Bulgarian +DNS_ERROR_NODE_CREATION_FAILED - Node creation failure in DNS. +. + +MessageId=9704 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_UNKNOWN_RECORD_TYPE +Language=Bulgarian +DNS_ERROR_UNKNOWN_RECORD_TYPE - Unknown DNS record type. +. + +MessageId=9705 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_RECORD_TIMED_OUT +Language=Bulgarian +DNS_ERROR_RECORD_TIMED_OUT - DNS record timed out. +. + +MessageId=9706 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_NAME_NOT_IN_ZONE +Language=Bulgarian +DNS_ERROR_NAME_NOT_IN_ZONE - Name not in DNS zone. +. + +MessageId=9707 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_CNAME_LOOP +Language=Bulgarian +DNS_ERROR_CNAME_LOOP - CNAME loop detected. +. + +MessageId=9708 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_NODE_IS_CNAME +Language=Bulgarian +DNS_ERROR_NODE_IS_CNAME - Node is a CNAME DNS record. +. + +MessageId=9709 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_CNAME_COLLISION +Language=Bulgarian +DNS_ERROR_CNAME_COLLISION - A CNAME record already exists for given name. +. + +MessageId=9710 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_RECORD_ONLY_AT_ZONE_ROOT +Language=Bulgarian +DNS_ERROR_RECORD_ONLY_AT_ZONE_ROOT - Record only at DNS zone root. +. + +MessageId=9711 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_RECORD_ALREADY_EXISTS +Language=Bulgarian +DNS_ERROR_RECORD_ALREADY_EXISTS - DNS record already exists. +. + +MessageId=9712 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_SECONDARY_DATA +Language=Bulgarian +DNS_ERROR_SECONDARY_DATA - Secondary DNS zone data error. +. + +MessageId=9713 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_NO_CREATE_CACHE_DATA +Language=Bulgarian +DNS_ERROR_NO_CREATE_CACHE_DATA - Could not create DNS cache data. +. + +MessageId=9714 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_NAME_DOES_NOT_EXIST +Language=Bulgarian +DNS_ERROR_NAME_DOES_NOT_EXIST - DNS name does not exist. +. + +MessageId=9715 +Severity=Success +Facility=System +SymbolicName=DNS_WARNING_PTR_CREATE_FAILED +Language=Bulgarian +DNS_WARNING_PTR_CREATE_FAILED - Could not create pointer (PTR) record. +. + +MessageId=9716 +Severity=Success +Facility=System +SymbolicName=DNS_WARNING_DOMAIN_UNDELETED +Language=Bulgarian +DNS_WARNING_DOMAIN_UNDELETED - DNS domain was undeleted. +. + +MessageId=9717 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_DS_UNAVAILABLE +Language=Bulgarian +DNS_ERROR_DS_UNAVAILABLE - The directory service is unavailable. +. + +MessageId=9718 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_DS_ZONE_ALREADY_EXISTS +Language=Bulgarian +DNS_ERROR_DS_ZONE_ALREADY_EXISTS - DNS zone already exists in the directory service. +. + +MessageId=9719 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_NO_BOOTFILE_IF_DS_ZONE +Language=Bulgarian +DNS_ERROR_NO_BOOTFILE_IF_DS_ZONE - DNS server not creating or reading the boot file for the directory service integrated DNS zone. +. + +MessageId=9751 +Severity=Success +Facility=System +SymbolicName=DNS_INFO_AXFR_COMPLETE +Language=Bulgarian +DNS_INFO_AXFR_COMPLETE - DNS AXFR (zone transfer) complete. +. + +MessageId=9752 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_AXFR +Language=Bulgarian +DNS_ERROR_AXFR - DNS zone transfer failed. +. + +MessageId=9753 +Severity=Success +Facility=System +SymbolicName=DNS_INFO_ADDED_LOCAL_WINS +Language=Bulgarian +DNS_INFO_ADDED_LOCAL_WINS - Added local WINS server. +. + +MessageId=9801 +Severity=Success +Facility=System +SymbolicName=DNS_STATUS_CONTINUE_NEEDED +Language=Bulgarian +DNS_STATUS_CONTINUE_NEEDED - Secure update call needs to continue update request. +. + +MessageId=9851 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_NO_TCPIP +Language=Bulgarian +DNS_ERROR_NO_TCPIP - TCP/IP network protocol not installed. +. + +MessageId=9852 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_NO_DNS_SERVERS +Language=Bulgarian +DNS_ERROR_NO_DNS_SERVERS - No DNS servers configured for local system. +. + +MessageId=9901 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_DP_DOES_NOT_EXIST +Language=Bulgarian +DNS_ERROR_DP_DOES_NOT_EXIST - The specified directory partition does not exist. +. + +MessageId=9902 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_DP_ALREADY_EXISTS +Language=Bulgarian +DNS_ERROR_DP_ALREADY_EXISTS - The specified directory partition already exists. +. + +MessageId=9903 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_DP_NOT_ENLISTED +Language=Bulgarian +DNS_ERROR_DP_NOT_ENLISTED - The DNS server is not enlisted in the specified directory partition. +. + +MessageId=9904 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_DP_ALREADY_ENLISTED +Language=Bulgarian +DNS_ERROR_DP_ALREADY_ENLISTED - The DNS server is already enlisted in the specified directory partition. +. + +MessageId=9905 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_DP_NOT_AVAILABLE +Language=Bulgarian +DNS_ERROR_DP_NOT_AVAILABLE - The directory partition is not available at this time. Please wait a few minutes and try again. +. + +MessageId=9906 +Severity=Success +Facility=System +SymbolicName=DNS_ERROR_DP_FSMO_ERROR +Language=Bulgarian +DNS_ERROR_DP_FSMO_ERROR - The application directory partition operation failed. The domain controller holding the domain naming master role is down or unable to service the request or is not running Windows Server 2003. +. + +MessageId=10004 +Severity=Success +Facility=System +SymbolicName=WSAEINTR +Language=Bulgarian +WSAEINTR - A blocking operation was interrupted by a call to WSACancelBlockingCall. +. + +MessageId=10009 +Severity=Success +Facility=System +SymbolicName=WSAEBADF +Language=Bulgarian +WSAEBADF - The file handle supplied is not valid. +. + +MessageId=10013 +Severity=Success +Facility=System +SymbolicName=WSAEACCES +Language=Bulgarian +WSAEACCES - An attempt was made to access a socket in a way forbidden by its access permissions. +. + +MessageId=10014 +Severity=Success +Facility=System +SymbolicName=WSAEFAULT +Language=Bulgarian +WSAEFAULT - The system detected an invalid pointer address in attempting to use a pointer argument in a call. +. + +MessageId=10022 +Severity=Success +Facility=System +SymbolicName=WSAEINVAL +Language=Bulgarian +WSAEINVAL - An invalid argument was supplied. +. + +MessageId=10024 +Severity=Success +Facility=System +SymbolicName=WSAEMFILE +Language=Bulgarian +WSAEMFILE - Too many open sockets. +. + +MessageId=10035 +Severity=Success +Facility=System +SymbolicName=WSAEWOULDBLOCK +Language=Bulgarian +WSAEWOULDBLOCK - A non-blocking socket operation could not be completed immediately. +. + +MessageId=10036 +Severity=Success +Facility=System +SymbolicName=WSAEINPROGRESS +Language=Bulgarian +WSAEINPROGRESS - A blocking operation is currently executing. +. + +MessageId=10037 +Severity=Success +Facility=System +SymbolicName=WSAEALREADY +Language=Bulgarian +WSAEALREADY - An operation was attempted on a non-blocking socket that already had an operation in progress. +. + +MessageId=10038 +Severity=Success +Facility=System +SymbolicName=WSAENOTSOCK +Language=Bulgarian +WSAENOTSOCK - An operation was attempted on something that is not a socket. +. + +MessageId=10039 +Severity=Success +Facility=System +SymbolicName=WSAEDESTADDRREQ +Language=Bulgarian +WSAEDESTADDRREQ - A required address was omitted from an operation on a socket. +. + +MessageId=10040 +Severity=Success +Facility=System +SymbolicName=WSAEMSGSIZE +Language=Bulgarian +WSAEMSGSIZE - A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram into was smaller than the datagram itself. +. + +MessageId=10041 +Severity=Success +Facility=System +SymbolicName=WSAEPROTOTYPE +Language=Bulgarian +WSAEPROTOTYPE - A protocol was specified in the socket function call that does not support the semantics of the socket type requested. +. + +MessageId=10042 +Severity=Success +Facility=System +SymbolicName=WSAENOPROTOOPT +Language=Bulgarian +WSAENOPROTOOPT - An unknown, invalid, or unsupported option or level was specified in a getsockopt or setsockopt call. +. + +MessageId=10043 +Severity=Success +Facility=System +SymbolicName=WSAEPROTONOSUPPORT +Language=Bulgarian +WSAEPROTONOSUPPORT - The requested protocol has not been configured into the system, or no implementation for it exists. +. + +MessageId=10044 +Severity=Success +Facility=System +SymbolicName=WSAESOCKTNOSUPPORT +Language=Bulgarian +WSAESOCKTNOSUPPORT - The support for the specified socket type does not exist in this address family. +. + +MessageId=10045 +Severity=Success +Facility=System +SymbolicName=WSAEOPNOTSUPP +Language=Bulgarian +WSAEOPNOTSUPP - The attempted operation is not supported for the type of object referenced. +. + +MessageId=10046 +Severity=Success +Facility=System +SymbolicName=WSAEPFNOSUPPORT +Language=Bulgarian +WSAEPFNOSUPPORT - The protocol family has not been configured into the system or no implementation for it exists. +. + +MessageId=10047 +Severity=Success +Facility=System +SymbolicName=WSAEAFNOSUPPORT +Language=Bulgarian +WSAEAFNOSUPPORT - An address incompatible with the requested protocol was used. +. + +MessageId=10048 +Severity=Success +Facility=System +SymbolicName=WSAEADDRINUSE +Language=Bulgarian +WSAEADDRINUSE - Only one usage of each socket address (protocol/network address/port) is normally permitted. +. + +MessageId=10049 +Severity=Success +Facility=System +SymbolicName=WSAEADDRNOTAVAIL +Language=Bulgarian +WSAEADDRNOTAVAIL - The requested address is not valid in its context. +. + +MessageId=10050 +Severity=Success +Facility=System +SymbolicName=WSAENETDOWN +Language=Bulgarian +WSAENETDOWN - A socket operation encountered a dead network. +. + +MessageId=10051 +Severity=Success +Facility=System +SymbolicName=WSAENETUNREACH +Language=Bulgarian +WSAENETUNREACH - A socket operation was attempted to an unreachable network. +. + +MessageId=10052 +Severity=Success +Facility=System +SymbolicName=WSAENETRESET +Language=Bulgarian +WSAENETRESET - The connection has been broken due to keep-alive activity detecting a failure while the operation was in progress. +. + +MessageId=10053 +Severity=Success +Facility=System +SymbolicName=WSAECONNABORTED +Language=Bulgarian +WSAECONNABORTED - An established connection was aborted by the software in your host machine. +. + +MessageId=10054 +Severity=Success +Facility=System +SymbolicName=WSAECONNRESET +Language=Bulgarian +WSAECONNRESET - An existing connection was forcibly closed by the remote host. +. + +MessageId=10055 +Severity=Success +Facility=System +SymbolicName=WSAENOBUFS +Language=Bulgarian +WSAENOBUFS - An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full. +. + +MessageId=10056 +Severity=Success +Facility=System +SymbolicName=WSAEISCONN +Language=Bulgarian +WSAEISCONN - A connect request was made on an already connected socket. +. + +MessageId=10057 +Severity=Success +Facility=System +SymbolicName=WSAENOTCONN +Language=Bulgarian +WSAENOTCONN - A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied. +. + +MessageId=10058 +Severity=Success +Facility=System +SymbolicName=WSAESHUTDOWN +Language=Bulgarian +WSAESHUTDOWN - A request to send or receive data was disallowed because the socket had already been shut down in that direction with a previous shutdown call. +. + +MessageId=10059 +Severity=Success +Facility=System +SymbolicName=WSAETOOMANYREFS +Language=Bulgarian +WSAETOOMANYREFS - Too many references to some kernel object. +. + +MessageId=10060 +Severity=Success +Facility=System +SymbolicName=WSAETIMEDOUT +Language=Bulgarian +WSAETIMEDOUT - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. +. + +MessageId=10061 +Severity=Success +Facility=System +SymbolicName=WSAECONNREFUSED +Language=Bulgarian +WSAECONNREFUSED - No connection could be made because the target machine actively refused it. +. + +MessageId=10062 +Severity=Success +Facility=System +SymbolicName=WSAELOOP +Language=Bulgarian +WSAELOOP - Cannot translate name. +. + +MessageId=10063 +Severity=Success +Facility=System +SymbolicName=WSAENAMETOOLONG +Language=Bulgarian +WSAENAMETOOLONG - Name component or name was too long. +. + +MessageId=10064 +Severity=Success +Facility=System +SymbolicName=WSAEHOSTDOWN +Language=Bulgarian +WSAEHOSTDOWN - A socket operation failed because the destination host was down. +. + +MessageId=10065 +Severity=Success +Facility=System +SymbolicName=WSAEHOSTUNREACH +Language=Bulgarian +WSAEHOSTUNREACH - A socket operation was attempted to an unreachable host. +. + +MessageId=10066 +Severity=Success +Facility=System +SymbolicName=WSAENOTEMPTY +Language=Bulgarian +WSAENOTEMPTY - Cannot remove a directory that is not empty. +. + +MessageId=10067 +Severity=Success +Facility=System +SymbolicName=WSAEPROCLIM +Language=Bulgarian +WSAEPROCLIM - A Windows Sockets implementation may have a limit on the number of applications that may use it simultaneously. +. + +MessageId=10068 +Severity=Success +Facility=System +SymbolicName=WSAEUSERS +Language=Bulgarian +WSAEUSERS - Ran out of quota. +. + +MessageId=10069 +Severity=Success +Facility=System +SymbolicName=WSAEDQUOT +Language=Bulgarian +WSAEDQUOT - Ran out of disk quota. +. + +MessageId=10070 +Severity=Success +Facility=System +SymbolicName=WSAESTALE +Language=Bulgarian +WSAESTALE - File handle reference is no longer available. +. + +MessageId=10071 +Severity=Success +Facility=System +SymbolicName=WSAEREMOTE +Language=Bulgarian +WSAEREMOTE - Item is not available locally. +. + +MessageId=10091 +Severity=Success +Facility=System +SymbolicName=WSASYSNOTREADY +Language=Bulgarian +WSASYSNOTREADY - WSAStartup cannot function at this time because the underlying system it uses to provide network services is currently unavailable. +. + +MessageId=10092 +Severity=Success +Facility=System +SymbolicName=WSAVERNOTSUPPORTED +Language=Bulgarian +WSAVERNOTSUPPORTED - The Windows Sockets version requested is not supported. +. + +MessageId=10093 +Severity=Success +Facility=System +SymbolicName=WSANOTINITIALISED +Language=Bulgarian +WSANOTINITIALISED - Either the application has not called WSAStartup, or WSAStartup failed. +. + +MessageId=10101 +Severity=Success +Facility=System +SymbolicName=WSAEDISCON +Language=Bulgarian +WSAEDISCON - Returned by WSARecv or WSARecvFrom to indicate the remote party has initiated a graceful shutdown sequence. +. + +MessageId=10102 +Severity=Success +Facility=System +SymbolicName=WSAENOMORE +Language=Bulgarian +WSAENOMORE - No more results can be returned by WSALookupServiceNext. +. + +MessageId=10103 +Severity=Success +Facility=System +SymbolicName=WSAECANCELLED +Language=Bulgarian +WSAECANCELLED - A call to WSALookupServiceEnd was made while this call was still processing. The call has been canceled. +. + +MessageId=10104 +Severity=Success +Facility=System +SymbolicName=WSAEINVALIDPROCTABLE +Language=Bulgarian +WSAEINVALIDPROCTABLE - The procedure call table is invalid. +. + +MessageId=10105 +Severity=Success +Facility=System +SymbolicName=WSAEINVALIDPROVIDER +Language=Bulgarian +WSAEINVALIDPROVIDER - The requested service provider is invalid. +. + +MessageId=10106 +Severity=Success +Facility=System +SymbolicName=WSAEPROVIDERFAILEDINIT +Language=Bulgarian +WSAEPROVIDERFAILEDINIT - The requested service provider could not be loaded or initialized. +. + +MessageId=10107 +Severity=Success +Facility=System +SymbolicName=WSASYSCALLFAILURE +Language=Bulgarian +WSASYSCALLFAILURE - A system call that should never fail has failed. +. + +MessageId=10108 +Severity=Success +Facility=System +SymbolicName=WSASERVICE_NOT_FOUND +Language=Bulgarian +WSASERVICE_NOT_FOUND - No such service is known. The service cannot be found in the specified name space. +. + +MessageId=10109 +Severity=Success +Facility=System +SymbolicName=WSATYPE_NOT_FOUND +Language=Bulgarian +WSATYPE_NOT_FOUND - The specified class was not found. +. + +MessageId=10110 +Severity=Success +Facility=System +SymbolicName=WSA_E_NO_MORE +Language=Bulgarian +WSA_E_NO_MORE - No more results can be returned by WSALookupServiceNext. +. + +MessageId=10111 +Severity=Success +Facility=System +SymbolicName=WSA_E_CANCELLED +Language=Bulgarian +WSA_E_CANCELLED - A call to WSALookupServiceEnd was made while this call was still processing. The call has been canceled. +. + +MessageId=10112 +Severity=Success +Facility=System +SymbolicName=WSAEREFUSED +Language=Bulgarian +WSAEREFUSED - A database query failed because it was actively refused. +. + +MessageId=11001 +Severity=Success +Facility=System +SymbolicName=WSAHOST_NOT_FOUND +Language=Bulgarian +WSAHOST_NOT_FOUND - No such host is known. +. + +MessageId=11002 +Severity=Success +Facility=System +SymbolicName=WSATRY_AGAIN +Language=Bulgarian +WSATRY_AGAIN - This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server. +. + +MessageId=11003 +Severity=Success +Facility=System +SymbolicName=WSANO_RECOVERY +Language=Bulgarian +WSANO_RECOVERY - A non-recoverable error occurred during a database lookup. +. + +MessageId=11004 +Severity=Success +Facility=System +SymbolicName=WSANO_DATA +Language=Bulgarian +WSANO_DATA - The requested name is valid, but no data of the requested type was found. +. + +MessageId=11005 +Severity=Success +Facility=System +SymbolicName=WSA_QOS_RECEIVERS +Language=Bulgarian +WSA_QOS_RECEIVERS - At least one reserve has arrived. +. + +MessageId=11006 +Severity=Success +Facility=System +SymbolicName=WSA_QOS_SENDERS +Language=Bulgarian +WSA_QOS_SENDERS - At least one path has arrived. +. + +MessageId=11007 +Severity=Success +Facility=System +SymbolicName=WSA_QOS_NO_SENDERS +Language=Bulgarian +WSA_QOS_NO_SENDERS - There are no senders. +. + +MessageId=11008 +Severity=Success +Facility=System +SymbolicName=WSA_QOS_NO_RECEIVERS +Language=Bulgarian +WSA_QOS_NO_RECEIVERS - There are no receivers. +. + +MessageId=11009 +Severity=Success +Facility=System +SymbolicName=WSA_QOS_REQUEST_CONFIRMED +Language=Bulgarian +WSA_QOS_REQUEST_CONFIRMED - Reserve has been confirmed. +. + +MessageId=11010 +Severity=Success +Facility=System +SymbolicName=WSA_QOS_ADMISSION_FAILURE +Language=Bulgarian +WSA_QOS_ADMISSION_FAILURE - Error due to lack of resources. +. + +MessageId=11011 +Severity=Success +Facility=System +SymbolicName=WSA_QOS_POLICY_FAILURE +Language=Bulgarian +WSA_QOS_POLICY_FAILURE - Rejected for administrative reasons - bad credentials. +. + +MessageId=11012 +Severity=Success +Facility=System +SymbolicName=WSA_QOS_BAD_STYLE +Language=Bulgarian +WSA_QOS_BAD_STYLE - Unknown or conflicting style. +. + +MessageId=11013 +Severity=Success +Facility=System +SymbolicName=WSA_QOS_BAD_OBJECT +Language=Bulgarian +WSA_QOS_BAD_OBJECT - Problem with some part of the filterspec or providerspecific buffer in general. +. + +MessageId=11014 +Severity=Success +Facility=System +SymbolicName=WSA_QOS_TRAFFIC_CTRL_ERROR +Language=Bulgarian +WSA_QOS_TRAFFIC_CTRL_ERROR - Problem with some part of the flowspec. +. + +MessageId=11015 +Severity=Success +Facility=System +SymbolicName=WSA_QOS_GENERIC_ERROR +Language=Bulgarian +WSA_QOS_GENERIC_ERROR - General QOS error. +. + +MessageId=11016 +Severity=Success +Facility=System +SymbolicName=WSA_QOS_ESERVICETYPE +Language=Bulgarian +WSA_QOS_ESERVICETYPE - An invalid or unrecognized service type was found in the flowspec. +. + +MessageId=11017 +Severity=Success +Facility=System +SymbolicName=WSA_QOS_EFLOWSPEC +Language=Bulgarian +WSA_QOS_EFLOWSPEC - An invalid or inconsistent flowspec was found in the QOS structure. +. + +MessageId=11018 +Severity=Success +Facility=System +SymbolicName=WSA_QOS_EPROVSPECBUF +Language=Bulgarian +WSA_QOS_EPROVSPECBUF - Invalid QOS provider-specific buffer. +. + +MessageId=11019 +Severity=Success +Facility=System +SymbolicName=WSA_QOS_EFILTERSTYLE +Language=Bulgarian +WSA_QOS_EFILTERSTYLE - An invalid QOS filter style was used. +. + +MessageId=11020 +Severity=Success +Facility=System +SymbolicName=WSA_QOS_EFILTERTYPE +Language=Bulgarian +WSA_QOS_EFILTERTYPE - An invalid QOS filter type was used. +. + +MessageId=11021 +Severity=Success +Facility=System +SymbolicName=WSA_QOS_EFILTERCOUNT +Language=Bulgarian +WSA_QOS_EFILTERCOUNT - An incorrect number of QOS FILTERSPECs were specified in the FLOWDESCRIPTOR. +. + +MessageId=11022 +Severity=Success +Facility=System +SymbolicName=WSA_QOS_EOBJLENGTH +Language=Bulgarian +WSA_QOS_EOBJLENGTH - An object with an invalid ObjectLength field was specified in the QOS provider-specific buffer. +. + +MessageId=11023 +Severity=Success +Facility=System +SymbolicName=WSA_QOS_EFLOWCOUNT +Language=Bulgarian +WSA_QOS_EFLOWCOUNT - An incorrect number of flow descriptors was specified in the QOS structure. +. + +MessageId=11024 +Severity=Success +Facility=System +SymbolicName=WSA_QOS_EUNKNOWNPSOBJ +Language=Bulgarian +WSA_QOS_EUNKNOWNPSOBJ - An unrecognized object was found in the QOS provider-specific buffer. +. + +MessageId=11025 +Severity=Success +Facility=System +SymbolicName=WSA_QOS_EPOLICYOBJ +Language=Bulgarian +WSA_QOS_EPOLICYOBJ - An invalid policy object was found in the QOS provider-specific buffer. +. + +MessageId=11026 +Severity=Success +Facility=System +SymbolicName=WSA_QOS_EFLOWDESC +Language=Bulgarian +WSA_QOS_EFLOWDESC - An invalid QOS flow descriptor was found in the flow descriptor list. +. + +MessageId=11027 +Severity=Success +Facility=System +SymbolicName=WSA_QOS_EPSFLOWSPEC +Language=Bulgarian +WSA_QOS_EPSFLOWSPEC - An invalid or inconsistent flowspec was found in the QOS provider-specific buffer. +. + +MessageId=11028 +Severity=Success +Facility=System +SymbolicName=WSA_QOS_EPSFILTERSPEC +Language=Bulgarian +WSA_QOS_EPSFILTERSPEC - An invalid FILTERSPEC was found in the QOS provider-specific buffer. +. + +MessageId=11029 +Severity=Success +Facility=System +SymbolicName=WSA_QOS_ESDMODEOBJ +Language=Bulgarian +WSA_QOS_ESDMODEOBJ - An invalid shape discard mode object was found in the QOS provider-specific buffer. +. + +MessageId=11030 +Severity=Success +Facility=System +SymbolicName=WSA_QOS_ESHAPERATEOBJ +Language=Bulgarian +WSA_QOS_ESHAPERATEOBJ - An invalid shaping rate object was found in the QOS provider-specific buffer. +. + +MessageId=11031 +Severity=Success +Facility=System +SymbolicName=WSA_QOS_RESERVED_PETYPE +Language=Bulgarian +WSA_QOS_RESERVED_PETYPE - A reserved policy element was found in the QOS provider-specific buffer. +. + +MessageId=12000 +Severity=Success +Facility=System +SymbolicName=ERROR_FLT_IO_COMPLETE +Language=Bulgarian +ERROR_FLT_IO_COMPLETE - The IO was completed by a filter. +. + +MessageId=12001 +Severity=Success +Facility=System +SymbolicName=ERROR_FLT_BUFFER_TOO_SMALL +Language=Bulgarian +ERROR_FLT_BUFFER_TOO_SMALL - The buffer is too small to contain the entry. No information has been written to the buffer. +. + +MessageId=12002 +Severity=Success +Facility=System +SymbolicName=ERROR_FLT_NO_HANDLER_DEFINED +Language=Bulgarian +ERROR_FLT_NO_HANDLER_DEFINED - A handler was not defined by the filter for this operation. +. + +MessageId=12003 +Severity=Success +Facility=System +SymbolicName=ERROR_FLT_CONTEXT_ALREADY_DEFINED +Language=Bulgarian +ERROR_FLT_CONTEXT_ALREADY_DEFINED - A context is already defined for this object. +. + +MessageId=12004 +Severity=Success +Facility=System +SymbolicName=ERROR_FLT_INVALID_ASYNCHRONOUS_REQUEST +Language=Bulgarian +ERROR_FLT_INVALID_ASYNCHRONOUS_REQUEST - Asynchronous requests are not valid for this operation. +. + +MessageId=12005 +Severity=Success +Facility=System +SymbolicName=ERROR_FLT_DISALLOW_FAST_IO +Language=Bulgarian +ERROR_FLT_DISALLOW_FAST_IO - Disallow the Fast IO path for this operation. +. + +MessageId=12006 +Severity=Success +Facility=System +SymbolicName=ERROR_FLT_INVALID_NAME_REQUEST +Language=Bulgarian +ERROR_FLT_INVALID_NAME_REQUEST - An invalid name request was made. The name requested cannot be retrieved at this time. +. + +MessageId=12007 +Severity=Success +Facility=System +SymbolicName=ERROR_FLT_NOT_SAFE_TO_POST_OPERATION +Language=Bulgarian +ERROR_FLT_NOT_SAFE_TO_POST_OPERATION - Posting this operation to a worker thread for further processing is not safe at this time because it could lead to a system deadlock. +. + +MessageId=12008 +Severity=Success +Facility=System +SymbolicName=ERROR_FLT_NOT_INITIALIZED +Language=Bulgarian +ERROR_FLT_NOT_INITIALIZED - The Filter Manager was not initialized when a filter tried to register. Make sure that the Filter Manager is getting loaded as a driver. +. + +MessageId=12009 +Severity=Success +Facility=System +SymbolicName=ERROR_FLT_FILTER_NOT_READY +Language=Bulgarian +ERROR_FLT_FILTER_NOT_READY - The filter is not ready for attachment to volumes because it has not finished initializing (FltStartFiltering has not been called). +. + +MessageId=12010 +Severity=Success +Facility=System +SymbolicName=ERROR_FLT_POST_OPERATION_CLEANUP +Language=Bulgarian +ERROR_FLT_POST_OPERATION_CLEANUP - The filter must cleanup any operation specific context at this time because it is being removed from the system before the operation is completed by the lower drivers. +. + +MessageId=12011 +Severity=Success +Facility=System +SymbolicName=ERROR_FLT_INTERNAL_ERROR +Language=Bulgarian +ERROR_FLT_INTERNAL_ERROR - The Filter Manager had an internal error from which it cannot recover, therefore the operation has been failed. This is usually the result of a filter returning an invalid value from a pre-operation callback. +. + +MessageId=12012 +Severity=Success +Facility=System +SymbolicName=ERROR_FLT_DELETING_OBJECT +Language=Bulgarian +ERROR_FLT_DELETING_OBJECT - The object specified for this action is in the process of being deleted, therefore the action requested cannot be completed at this time. +. + +MessageId=12013 +Severity=Success +Facility=System +SymbolicName=ERROR_FLT_MUST_BE_NONPAGED_POOL +Language=Bulgarian +ERROR_FLT_MUST_BE_NONPAGED_POOL - Non-paged pool must be used for this type of context. +. + +MessageId=12014 +Severity=Success +Facility=System +SymbolicName=ERROR_FLT_DUPLICATE_ENTRY +Language=Bulgarian +ERROR_FLT_DUPLICATE_ENTRY - A duplicate handler definition has been provided for an operation. +. + +MessageId=12015 +Severity=Success +Facility=System +SymbolicName=ERROR_FLT_CBDQ_DISABLED +Language=Bulgarian +ERROR_FLT_CBDQ_DISABLED - The callback data queue has been disabled. +. + +MessageId=12016 +Severity=Success +Facility=System +SymbolicName=ERROR_FLT_DO_NOT_ATTACH +Language=Bulgarian +ERROR_FLT_DO_NOT_ATTACH - Do not attach the filter to the volume at this time. +. + +MessageId=12017 +Severity=Success +Facility=System +SymbolicName=ERROR_FLT_DO_NOT_DETACH +Language=Bulgarian +ERROR_FLT_DO_NOT_DETACH - Do not detach the filter from the volume at this time. +. + +MessageId=12018 +Severity=Success +Facility=System +SymbolicName=ERROR_FLT_INSTANCE_ALTITUDE_COLLISION +Language=Bulgarian +ERROR_FLT_INSTANCE_ALTITUDE_COLLISION - An instance already exists at this altitude on the volume specified. +. + +MessageId=12019 +Severity=Success +Facility=System +SymbolicName=ERROR_FLT_INSTANCE_NAME_COLLISION +Language=Bulgarian +ERROR_FLT_INSTANCE_NAME_COLLISION - An instance already exists with this name on the volume specified. +. + +MessageId=12020 +Severity=Success +Facility=System +SymbolicName=ERROR_FLT_FILTER_NOT_FOUND +Language=Bulgarian +ERROR_FLT_FILTER_NOT_FOUND - The system could not find the filter specified. +. + +MessageId=12021 +Severity=Success +Facility=System +SymbolicName=ERROR_FLT_VOLUME_NOT_FOUND +Language=Bulgarian +ERROR_FLT_VOLUME_NOT_FOUND - The system could not find the volume specified. +. + +MessageId=12022 +Severity=Success +Facility=System +SymbolicName=ERROR_FLT_INSTANCE_NOT_FOUND +Language=Bulgarian +ERROR_FLT_INSTANCE_NOT_FOUND - The system could not find the instance specified. +. + +MessageId=12023 +Severity=Success +Facility=System +SymbolicName=ERROR_FLT_CONTEXT_ALLOCATION_NOT_FOUND +Language=Bulgarian +ERROR_FLT_CONTEXT_ALLOCATION_NOT_FOUND - No registered context allocation definition was found for the given request. +. + +MessageId=12024 +Severity=Success +Facility=System +SymbolicName=ERROR_FLT_INVALID_CONTEXT_REGISTRATION +Language=Bulgarian +ERROR_FLT_INVALID_CONTEXT_REGISTRATION - An invalid parameter was specified during context registration. +. + +MessageId=12025 +Severity=Success +Facility=System +SymbolicName=ERROR_FLT_NAME_CACHE_MISS +Language=Bulgarian +ERROR_FLT_NAME_CACHE_MISS - The name requested was not found in Filter Manager's name cache and could not be retrieved from the file system. +. + +MessageId=12026 +Severity=Success +Facility=System +SymbolicName=ERROR_FLT_NO_DEVICE_OBJECT +Language=Bulgarian +ERROR_FLT_NO_DEVICE_OBJECT - The requested device object does not exist for the given volume. +. + +MessageId=12027 +Severity=Success +Facility=System +SymbolicName=ERROR_FLT_VOLUME_ALREADY_MOUNTED +Language=Bulgarian +ERROR_FLT_VOLUME_ALREADY_MOUNTED - The specified volume is already mounted. +. + +MessageId=12028 +Severity=Success +Facility=System +SymbolicName=ERROR_FLT_NO_WAITER_FOR_REPLY +Language=Bulgarian +ERROR_FLT_NO_WAITER_FOR_REPLY - No waiter is present for the filter's reply to this message. +. + +MessageId=13000 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_QM_POLICY_EXISTS +Language=Bulgarian +ERROR_IPSEC_QM_POLICY_EXISTS - The specified quick mode policy already exists. +. + +MessageId=13001 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_QM_POLICY_NOT_FOUND +Language=Bulgarian +ERROR_IPSEC_QM_POLICY_NOT_FOUND - The specified quick mode policy was not found. +. + +MessageId=13002 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_QM_POLICY_IN_USE +Language=Bulgarian +ERROR_IPSEC_QM_POLICY_IN_USE - The specified quick mode policy is being used. +. + +MessageId=13003 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_MM_POLICY_EXISTS +Language=Bulgarian +ERROR_IPSEC_MM_POLICY_EXISTS - The specified main mode policy already exists. +. + +MessageId=13004 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_MM_POLICY_NOT_FOUND +Language=Bulgarian +ERROR_IPSEC_MM_POLICY_NOT_FOUND - The specified main mode policy was not found. +. + +MessageId=13005 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_MM_POLICY_IN_USE +Language=Bulgarian +ERROR_IPSEC_MM_POLICY_IN_USE - The specified main mode policy is being used. +. + +MessageId=13006 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_MM_FILTER_EXISTS +Language=Bulgarian +ERROR_IPSEC_MM_FILTER_EXISTS - The specified main mode filter already exists. +. + +MessageId=13007 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_MM_FILTER_NOT_FOUND +Language=Bulgarian +ERROR_IPSEC_MM_FILTER_NOT_FOUND - The specified main mode filter was not found. +. + +MessageId=13008 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_TRANSPORT_FILTER_EXISTS +Language=Bulgarian +ERROR_IPSEC_TRANSPORT_FILTER_EXISTS - The specified transport mode filter already exists. +. + +MessageId=13009 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_TRANSPORT_FILTER_NOT_FOUND +Language=Bulgarian +ERROR_IPSEC_TRANSPORT_FILTER_NOT_FOUND - The specified transport mode filter does not exist. +. + +MessageId=13010 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_MM_AUTH_EXISTS +Language=Bulgarian +ERROR_IPSEC_MM_AUTH_EXISTS - The specified main mode authentication list exists. +. + +MessageId=13011 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_MM_AUTH_NOT_FOUND +Language=Bulgarian +ERROR_IPSEC_MM_AUTH_NOT_FOUND - The specified main mode authentication list was not found. +. + +MessageId=13012 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_MM_AUTH_IN_USE +Language=Bulgarian +ERROR_IPSEC_MM_AUTH_IN_USE - The specified quick mode policy is being used. +. + +MessageId=13013 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_DEFAULT_MM_POLICY_NOT_FOUND +Language=Bulgarian +ERROR_IPSEC_DEFAULT_MM_POLICY_NOT_FOUND - The specified main mode policy was not found. +. + +MessageId=13014 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_DEFAULT_MM_AUTH_NOT_FOUND +Language=Bulgarian +ERROR_IPSEC_DEFAULT_MM_AUTH_NOT_FOUND - The specified quick mode policy was not found. +. + +MessageId=13015 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_DEFAULT_QM_POLICY_NOT_FOUND +Language=Bulgarian +ERROR_IPSEC_DEFAULT_QM_POLICY_NOT_FOUND - The manifest file contains one or more syntax errors. +. + +MessageId=13016 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_TUNNEL_FILTER_EXISTS +Language=Bulgarian +ERROR_IPSEC_TUNNEL_FILTER_EXISTS - The application attempted to activate a disabled activation context. +. + +MessageId=13017 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_TUNNEL_FILTER_NOT_FOUND +Language=Bulgarian +ERROR_IPSEC_TUNNEL_FILTER_NOT_FOUND - The requested lookup key was not found in any active activation context. +. + +MessageId=13018 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_MM_FILTER_PENDING_DELETION +Language=Bulgarian +ERROR_IPSEC_MM_FILTER_PENDING_DELETION - The Main Mode filter is pending deletion. +. + +MessageId=13019 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_TRANSPORT_FILTER_PENDING_DELETION +Language=Bulgarian +ERROR_IPSEC_TRANSPORT_FILTER_PENDING_DELETION - The transport filter is pending deletion. +. + +MessageId=13020 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_TUNNEL_FILTER_PENDING_DELETION +Language=Bulgarian +ERROR_IPSEC_TUNNEL_FILTER_PENDING_DELETION - The tunnel filter is pending deletion. +. + +MessageId=13021 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_MM_POLICY_PENDING_DELETION +Language=Bulgarian +ERROR_IPSEC_MM_POLICY_PENDING_DELETION - The Main Mode policy is pending deletion. +. + +MessageId=13022 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_MM_AUTH_PENDING_DELETION +Language=Bulgarian +ERROR_IPSEC_MM_AUTH_PENDING_DELETION - The Main Mode authentication bundle is pending deletion. +. + +MessageId=13023 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_QM_POLICY_PENDING_DELETION +Language=Bulgarian +ERROR_IPSEC_QM_POLICY_PENDING_DELETION - The Quick Mode policy is pending deletion. +. + +MessageId=13024 +Severity=Success +Facility=System +SymbolicName=WARNING_IPSEC_MM_POLICY_PRUNED +Language=Bulgarian +WARNING_IPSEC_MM_POLICY_PRUNED - The Main Mode policy was successfully added, but some of the requested offers are not supported. +. + +MessageId=13025 +Severity=Success +Facility=System +SymbolicName=WARNING_IPSEC_QM_POLICY_PRUNED +Language=Bulgarian +WARNING_IPSEC_QM_POLICY_PRUNED - The Quick Mode policy was successfully added, but some of the requested offers are not supported. +. + +MessageId=13801 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_AUTH_FAIL +Language=Bulgarian +ERROR_IPSEC_IKE_AUTH_FAIL - IKE authentication credentials are unacceptable. +. + +MessageId=13802 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_ATTRIB_FAIL +Language=Bulgarian +ERROR_IPSEC_IKE_ATTRIB_FAIL - IKE security attributes are unacceptable. +. + +MessageId=13803 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_NEGOTIATION_PENDING +Language=Bulgarian +ERROR_IPSEC_IKE_NEGOTIATION_PENDING - IKE Negotiation in progress. +. + +MessageId=13804 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_GENERAL_PROCESSING_ERROR +Language=Bulgarian +ERROR_IPSEC_IKE_GENERAL_PROCESSING_ERROR - General processing error. +. + +MessageId=13805 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_TIMED_OUT +Language=Bulgarian +ERROR_IPSEC_IKE_TIMED_OUT - Negotiation timed out. +. + +MessageId=13806 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_NO_CERT +Language=Bulgarian +ERROR_IPSEC_IKE_NO_CERT - IKE failed to find valid machine certificate. +. + +MessageId=13807 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_SA_DELETED +Language=Bulgarian +ERROR_IPSEC_IKE_SA_DELETED - IKE SA deleted by peer before establishment completed. +. + +MessageId=13808 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_SA_REAPED +Language=Bulgarian +ERROR_IPSEC_IKE_SA_REAPED - IKE SA deleted before establishment completed. +. + +MessageId=13809 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_MM_ACQUIRE_DROP +Language=Bulgarian +ERROR_IPSEC_IKE_MM_ACQUIRE_DROP - Negotiation request sat in Queue too long. +. + +MessageId=13810 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_QM_ACQUIRE_DROP +Language=Bulgarian +ERROR_IPSEC_IKE_QM_ACQUIRE_DROP - Negotiation request sat in Queue too long. +. + +MessageId=13811 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_QUEUE_DROP_MM +Language=Bulgarian +ERROR_IPSEC_IKE_QUEUE_DROP_MM - Negotiation request sat in Queue too long. +. + +MessageId=13812 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_QUEUE_DROP_NO_MM +Language=Bulgarian +ERROR_IPSEC_IKE_QUEUE_DROP_NO_MM - Negotiation request sat in Queue too long. +. + +MessageId=13813 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_DROP_NO_RESPONSE +Language=Bulgarian +ERROR_IPSEC_IKE_DROP_NO_RESPONSE - No response from peer. +. + +MessageId=13814 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_MM_DELAY_DROP +Language=Bulgarian +ERROR_IPSEC_IKE_MM_DELAY_DROP - Negotiation took too long. +. + +MessageId=13815 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_QM_DELAY_DROP +Language=Bulgarian +ERROR_IPSEC_IKE_QM_DELAY_DROP - Negotiation took too long. +. + +MessageId=13816 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_ERROR +Language=Bulgarian +ERROR_IPSEC_IKE_ERROR - Unknown error occurred. +. + +MessageId=13817 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_CRL_FAILED +Language=Bulgarian +ERROR_IPSEC_IKE_CRL_FAILED - Certificate Revocation Check failed. +. + +MessageId=13818 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_INVALID_KEY_USAGE +Language=Bulgarian +ERROR_IPSEC_IKE_INVALID_KEY_USAGE - Invalid certificate key usage. +. + +MessageId=13819 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_INVALID_CERT_TYPE +Language=Bulgarian +ERROR_IPSEC_IKE_INVALID_CERT_TYPE - Invalid certificate type. +. + +MessageId=13820 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_NO_PRIVATE_KEY +Language=Bulgarian +ERROR_IPSEC_IKE_NO_PRIVATE_KEY - No private key associated with machine certificate. +. + +MessageId=13822 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_DH_FAIL +Language=Bulgarian +ERROR_IPSEC_IKE_DH_FAIL - Failure in Diffie-Hellman computation. +. + +MessageId=13824 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_INVALID_HEADER +Language=Bulgarian +ERROR_IPSEC_IKE_INVALID_HEADER - Invalid header. +. + +MessageId=13825 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_NO_POLICY +Language=Bulgarian +ERROR_IPSEC_IKE_NO_POLICY - No policy configured. +. + +MessageId=13826 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_INVALID_SIGNATURE +Language=Bulgarian +ERROR_IPSEC_IKE_INVALID_SIGNATURE - Failed to verify signature. +. + +MessageId=13827 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_KERBEROS_ERROR +Language=Bulgarian +ERROR_IPSEC_IKE_KERBEROS_ERROR - Failed to authenticate using Kerberos. +. + +MessageId=13828 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_NO_PUBLIC_KEY +Language=Bulgarian +ERROR_IPSEC_IKE_NO_PUBLIC_KEY - Peer's certificate did not have a public key. +. + +MessageId=13829 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_PROCESS_ERR +Language=Bulgarian +ERROR_IPSEC_IKE_PROCESS_ERR - Error processing error payload. +. + +MessageId=13830 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_PROCESS_ERR_SA +Language=Bulgarian +ERROR_IPSEC_IKE_PROCESS_ERR_SA - Error processing SA payload. +. + +MessageId=13831 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_PROCESS_ERR_PROP +Language=Bulgarian +ERROR_IPSEC_IKE_PROCESS_ERR_PROP - Error processing Proposal payload. +. + +MessageId=13832 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_PROCESS_ERR_TRANS +Language=Bulgarian +ERROR_IPSEC_IKE_PROCESS_ERR_TRANS - Error processing Transform payload. +. + +MessageId=13833 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_PROCESS_ERR_KE +Language=Bulgarian +ERROR_IPSEC_IKE_PROCESS_ERR_KE - Error processing KE payload. +. + +MessageId=13834 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_PROCESS_ERR_ID +Language=Bulgarian +ERROR_IPSEC_IKE_PROCESS_ERR_ID - Error processing ID payload. +. + +MessageId=13835 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_PROCESS_ERR_CERT +Language=Bulgarian +ERROR_IPSEC_IKE_PROCESS_ERR_CERT - Error processing Cert payload. +. + +MessageId=13836 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_PROCESS_ERR_CERT_REQ +Language=Bulgarian +ERROR_IPSEC_IKE_PROCESS_ERR_CERT_REQ - Error processing Certificate Request payload. +. + +MessageId=13837 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_PROCESS_ERR_HASH +Language=Bulgarian +ERROR_IPSEC_IKE_PROCESS_ERR_HASH - Error processing Hash payload. +. + +MessageId=13838 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_PROCESS_ERR_SIG +Language=Bulgarian +ERROR_IPSEC_IKE_PROCESS_ERR_SIG - Error processing Signature payload. +. + +MessageId=13839 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_PROCESS_ERR_NONCE +Language=Bulgarian +ERROR_IPSEC_IKE_PROCESS_ERR_NONCE - Error processing Nonce payload. +. + +MessageId=13840 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_PROCESS_ERR_NOTIFY +Language=Bulgarian +ERROR_IPSEC_IKE_PROCESS_ERR_NOTIFY - Error processing Notify payload. +. + +MessageId=13841 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_PROCESS_ERR_DELETE +Language=Bulgarian +ERROR_IPSEC_IKE_PROCESS_ERR_DELETE - Error processing Delete Payload. +. + +MessageId=13842 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_PROCESS_ERR_VENDOR +Language=Bulgarian +ERROR_IPSEC_IKE_PROCESS_ERR_VENDOR - Error processing VendorId payload. +. + +MessageId=13843 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_INVALID_PAYLOAD +Language=Bulgarian +ERROR_IPSEC_IKE_INVALID_PAYLOAD - Invalid payload received. +. + +MessageId=13844 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_LOAD_SOFT_SA +Language=Bulgarian +ERROR_IPSEC_IKE_LOAD_SOFT_SA - Soft SA loaded. +. + +MessageId=13845 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_SOFT_SA_TORN_DOWN +Language=Bulgarian +ERROR_IPSEC_IKE_SOFT_SA_TORN_DOWN - Soft SA torn down. +. + +MessageId=13846 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_INVALID_COOKIE +Language=Bulgarian +ERROR_IPSEC_IKE_INVALID_COOKIE - Invalid cookie received.. +. + +MessageId=13847 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_NO_PEER_CERT +Language=Bulgarian +ERROR_IPSEC_IKE_NO_PEER_CERT - Peer failed to send valid machine certificate. +. + +MessageId=13848 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_PEER_CRL_FAILED +Language=Bulgarian +ERROR_IPSEC_IKE_PEER_CRL_FAILED - Certification Revocation check of peer's certificate failed. +. + +MessageId=13849 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_POLICY_CHANGE +Language=Bulgarian +ERROR_IPSEC_IKE_POLICY_CHANGE - New policy invalidated SAs formed with old policy. +. + +MessageId=13850 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_NO_MM_POLICY +Language=Bulgarian +ERROR_IPSEC_IKE_NO_MM_POLICY - There is no available Main Mode IKE policy. +. + +MessageId=13851 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_NOTCBPRIV +Language=Bulgarian +ERROR_IPSEC_IKE_NOTCBPRIV - Failed to enabled TCB privilege. +. + +MessageId=13852 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_SECLOADFAIL +Language=Bulgarian +ERROR_IPSEC_IKE_SECLOADFAIL - Failed to load SECURITY.DLL. +. + +MessageId=13853 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_FAILSSPINIT +Language=Bulgarian +ERROR_IPSEC_IKE_FAILSSPINIT - Failed to obtain security function table dispatch address from SSPI. +. + +MessageId=13854 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_FAILQUERYSSP +Language=Bulgarian +ERROR_IPSEC_IKE_FAILQUERYSSP - Failed to query Kerberos package to obtain max token size. +. + +MessageId=13855 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_SRVACQFAIL +Language=Bulgarian +ERROR_IPSEC_IKE_SRVACQFAIL - Failed to obtain Kerberos server credentials for ISAKMP/ERROR_IPSEC_IKE service. Kerberos authentication will not function. The most likely reason for this is lack of domain membership. This is normal if your computer is a member of a workgroup. +. + +MessageId=13856 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_SRVQUERYCRED +Language=Bulgarian +ERROR_IPSEC_IKE_SRVQUERYCRED - Failed to determine SSPI principal name for ISAKMP/ERROR_IPSEC_IKE service (QueryCredentialsAttributes). +. + +MessageId=13857 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_GETSPIFAIL +Language=Bulgarian +ERROR_IPSEC_IKE_GETSPIFAIL - Failed to obtain new SPI for the inbound SA from IPSec driver. The most common cause for this is that the driver does not have the correct filter. Check your policy to verify the filters. +. + +MessageId=13858 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_INVALID_FILTER +Language=Bulgarian +ERROR_IPSEC_IKE_INVALID_FILTER - Given filter is invalid. +. + +MessageId=13859 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_OUT_OF_MEMORY +Language=Bulgarian +ERROR_IPSEC_IKE_OUT_OF_MEMORY - Memory allocation failed. +. + +MessageId=13860 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_ADD_UPDATE_KEY_FAILED +Language=Bulgarian +ERROR_IPSEC_IKE_ADD_UPDATE_KEY_FAILED - Failed to add Security Association to IPSec Driver. The most common cause for this is if the IKE negotiation took too long to complete. If the problem persists, reduce the load on the faulting machine. +. + +MessageId=13861 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_INVALID_POLICY +Language=Bulgarian +ERROR_IPSEC_IKE_INVALID_POLICY - Invalid policy. +. + +MessageId=13862 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_UNKNOWN_DOI +Language=Bulgarian +ERROR_IPSEC_IKE_UNKNOWN_DOI - Invalid DOI. +. + +MessageId=13863 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_INVALID_SITUATION +Language=Bulgarian +ERROR_IPSEC_IKE_INVALID_SITUATION - Invalid situation. +. + +MessageId=13864 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_DH_FAILURE +Language=Bulgarian +ERROR_IPSEC_IKE_DH_FAILURE - Diffie-Hellman failure. +. + +MessageId=13865 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_INVALID_GROUP +Language=Bulgarian +ERROR_IPSEC_IKE_INVALID_GROUP - Invalid Diffie-Hellman group. +. + +MessageId=13866 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_ENCRYPT +Language=Bulgarian +ERROR_IPSEC_IKE_ENCRYPT - Error encrypting payload. +. + +MessageId=13867 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_DECRYPT +Language=Bulgarian +ERROR_IPSEC_IKE_DECRYPT - Error decrypting payload. +. + +MessageId=13868 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_POLICY_MATCH +Language=Bulgarian +ERROR_IPSEC_IKE_POLICY_MATCH - Policy match error. +. + +MessageId=13869 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_UNSUPPORTED_ID +Language=Bulgarian +ERROR_IPSEC_IKE_UNSUPPORTED_ID - Unsupported ID. +. + +MessageId=13870 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_INVALID_HASH +Language=Bulgarian +ERROR_IPSEC_IKE_INVALID_HASH - Hash verification failed. +. + +MessageId=13871 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_INVALID_HASH_ALG +Language=Bulgarian +ERROR_IPSEC_IKE_INVALID_HASH_ALG - Invalid hash algorithm. +. + +MessageId=13872 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_INVALID_HASH_SIZE +Language=Bulgarian +ERROR_IPSEC_IKE_INVALID_HASH_SIZE - Invalid hash size. +. + +MessageId=13873 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_INVALID_ENCRYPT_ALG +Language=Bulgarian +ERROR_IPSEC_IKE_INVALID_ENCRYPT_ALG - Invalid encryption algorithm. +. + +MessageId=13874 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_INVALID_AUTH_ALG +Language=Bulgarian +ERROR_IPSEC_IKE_INVALID_AUTH_ALG - Invalid authentication algorithm. +. + +MessageId=13875 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_INVALID_SIG +Language=Bulgarian +ERROR_IPSEC_IKE_INVALID_SIG - Invalid certificate signature. +. + +MessageId=13876 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_LOAD_FAILED +Language=Bulgarian +ERROR_IPSEC_IKE_LOAD_FAILED - Load failed. +. + +MessageId=13877 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_RPC_DELETE +Language=Bulgarian +ERROR_IPSEC_IKE_RPC_DELETE - Deleted via RPC call. +. + +MessageId=13878 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_BENIGN_REINIT +Language=Bulgarian +ERROR_IPSEC_IKE_BENIGN_REINIT - Temporary state created to perform reinit. This is not a real failure. +. + +MessageId=13879 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_INVALID_RESPONDER_LIFETIME_NOTIFY +Language=Bulgarian +ERROR_IPSEC_IKE_INVALID_RESPONDER_LIFETIME_NOTIFY - The lifetime value received in the Responder Lifetime Notify is below the Windows 2000 configured minimum value. Please fix the policy on the peer machine. +. + +MessageId=13881 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_INVALID_CERT_KEYLEN +Language=Bulgarian +ERROR_IPSEC_IKE_INVALID_CERT_KEYLEN - Key length in certificate is too small for configured security requirements. +. + +MessageId=13882 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_MM_LIMIT +Language=Bulgarian +ERROR_IPSEC_IKE_MM_LIMIT - Max number of established MM SAs to peer exceeded. +. + +MessageId=13883 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_NEGOTIATION_DISABLED +Language=Bulgarian +ERROR_IPSEC_IKE_NEGOTIATION_DISABLED - IKE received a policy that disables negotiation. +. + +MessageId=13884 +Severity=Success +Facility=System +SymbolicName=ERROR_IPSEC_IKE_NEG_STATUS_END +Language=Bulgarian +ERROR_IPSEC_IKE_NEG_STATUS_END - ERROR_IPSEC_IKE_NEG_STATUS_END +. + +MessageId=14000 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_SECTION_NOT_FOUND +Language=Bulgarian +ERROR_SXS_SECTION_NOT_FOUND - The requested section was not present in the activation context. +. + +MessageId=14001 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_CANT_GEN_ACTCTX +Language=Bulgarian +ERROR_SXS_CANT_GEN_ACTCTX - This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. +. + +MessageId=14002 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_INVALID_ACTCTXDATA_FORMAT +Language=Bulgarian +ERROR_SXS_INVALID_ACTCTXDATA_FORMAT - The application binding data format is invalid. +. + +MessageId=14003 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_ASSEMBLY_NOT_FOUND +Language=Bulgarian +ERROR_SXS_ASSEMBLY_NOT_FOUND - The referenced assembly is not installed on your system. +. + +MessageId=14004 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_MANIFEST_FORMAT_ERROR +Language=Bulgarian +ERROR_SXS_MANIFEST_FORMAT_ERROR - The manifest file does not begin with the required tag and format information. +. + +MessageId=14005 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_MANIFEST_PARSE_ERROR +Language=Bulgarian +ERROR_SXS_MANIFEST_PARSE_ERROR - The manifest file contains one or more syntax errors. +. + +MessageId=14006 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_ACTIVATION_CONTEXT_DISABLED +Language=Bulgarian +ERROR_SXS_ACTIVATION_CONTEXT_DISABLED - The application attempted to activate a disabled activation context. +. + +MessageId=14007 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_KEY_NOT_FOUND +Language=Bulgarian +ERROR_SXS_KEY_NOT_FOUND - The requested lookup key was not found in any active activation context. +. + +MessageId=14008 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_VERSION_CONFLICT +Language=Bulgarian +ERROR_SXS_VERSION_CONFLICT - A component version required by the application conflicts with another component version already active. +. + +MessageId=14009 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_WRONG_SECTION_TYPE +Language=Bulgarian +ERROR_SXS_WRONG_SECTION_TYPE - The type requested activation context section does not match the query API used. +. + +MessageId=14010 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_THREAD_QUERIES_DISABLED +Language=Bulgarian +ERROR_SXS_THREAD_QUERIES_DISABLED - Lack of system resources has required isolated activation to be disabled for the current thread of execution. +. + +MessageId=14011 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_PROCESS_DEFAULT_ALREADY_SET +Language=Bulgarian +ERROR_SXS_PROCESS_DEFAULT_ALREADY_SET - An attempt to set the process default activation context failed because the process default activation context was already set. +. + +MessageId=14012 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_UNKNOWN_ENCODING_GROUP +Language=Bulgarian +ERROR_SXS_UNKNOWN_ENCODING_GROUP - The encoding group identifier specified is not recognized. +. + +MessageId=14013 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_UNKNOWN_ENCODING +Language=Bulgarian +ERROR_SXS_UNKNOWN_ENCODING - The encoding requested is not recognized. +. + +MessageId=14014 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_INVALID_XML_NAMESPACE_URI +Language=Bulgarian +ERROR_SXS_INVALID_XML_NAMESPACE_URI - The manifest contains a reference to an invalid URI. +. + +MessageId=14015 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_ROOT_MANIFEST_DEPENDENCY_NOT_INSTALLED +Language=Bulgarian +ERROR_SXS_ROOT_MANIFEST_DEPENDENCY_NOT_INSTALLED - The application manifest contains a reference to a dependent assembly which is not installed. +. + +MessageId=14016 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_LEAF_MANIFEST_DEPENDENCY_NOT_INSTALLED +Language=Bulgarian +ERROR_SXS_LEAF_MANIFEST_DEPENDENCY_NOT_INSTALLED - The manifest for an assembly used by the application has a reference to a dependent assembly which is not installed. +. + +MessageId=14017 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE +Language=Bulgarian +ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE - The manifest contains an attribute for the assembly identity which is not valid. +. + +MessageId=14018 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_MANIFEST_MISSING_REQUIRED_DEFAULT_NAMESPACE +Language=Bulgarian +ERROR_SXS_MANIFEST_MISSING_REQUIRED_DEFAULT_NAMESPACE - The manifest is missing the required default namespace specification on the assembly element. +. + +MessageId=14019 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_MANIFEST_INVALID_REQUIRED_DEFAULT_NAMESPACE +Language=Bulgarian +ERROR_SXS_MANIFEST_INVALID_REQUIRED_DEFAULT_NAMESPACE - The manifest has a default namespace specified on the assembly element but its value is not \"urn:schemas-microsoft-com:asm.v1\". +. + +MessageId=14020 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_PRIVATE_MANIFEST_CROSS_PATH_WITH_REPARSE_POINT +Language=Bulgarian +ERROR_SXS_PRIVATE_MANIFEST_CROSS_PATH_WITH_REPARSE_POINT - The private manifest probe has crossed the reparse-point-associated path. +. + +MessageId=14021 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_DUPLICATE_DLL_NAME +Language=Bulgarian +ERROR_SXS_DUPLICATE_DLL_NAME - Two or more components referenced directly or indirectly by the application manifest have files by the same name. +. + +MessageId=14022 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_DUPLICATE_WINDOWCLASS_NAME +Language=Bulgarian +ERROR_SXS_DUPLICATE_WINDOWCLASS_NAME - Two or more components referenced directly or indirectly by the application manifest have window classes with the same name. +. + +MessageId=14023 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_DUPLICATE_CLSID +Language=Bulgarian +ERROR_SXS_DUPLICATE_CLSID - Two or more components referenced directly or indirectly by the application manifest have the same COM server CLSIDs. +. + +MessageId=14024 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_DUPLICATE_IID +Language=Bulgarian +ERROR_SXS_DUPLICATE_IID - Two or more components referenced directly or indirectly by the application manifest have proxies for the same COM interface IIDs. +. + +MessageId=14025 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_DUPLICATE_TLBID +Language=Bulgarian +ERROR_SXS_DUPLICATE_TLBID - Two or more components referenced directly or indirectly by the application manifest have the same COM type library TLBIDs. +. + +MessageId=14026 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_DUPLICATE_PROGID +Language=Bulgarian +ERROR_SXS_DUPLICATE_PROGID - Two or more components referenced directly or indirectly by the application manifest have the same COM ProgIDs. +. + +MessageId=14027 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_DUPLICATE_ASSEMBLY_NAME +Language=Bulgarian +ERROR_SXS_DUPLICATE_ASSEMBLY_NAME - Two or more components referenced directly or indirectly by the application manifest are different versions of the same component which is not permitted. +. + +MessageId=14028 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_FILE_HASH_MISMATCH +Language=Bulgarian +ERROR_SXS_FILE_HASH_MISMATCH - A component's file does not match the verification information present in the component manifest. +. + +MessageId=14029 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_POLICY_PARSE_ERROR +Language=Bulgarian +ERROR_SXS_POLICY_PARSE_ERROR - The policy manifest contains one or more syntax errors. +. + +MessageId=14030 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_MISSINGQUOTE +Language=Bulgarian +ERROR_SXS_XML_E_MISSINGQUOTE - Manifest Parse Error : A string literal was expected, but no opening quote character was found. +. + +MessageId=14031 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_COMMENTSYNTAX +Language=Bulgarian +ERROR_SXS_XML_E_COMMENTSYNTAX - Manifest Parse Error : Incorrect syntax was used in a comment. +. + +MessageId=14032 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_BADSTARTNAMECHAR +Language=Bulgarian +ERROR_SXS_XML_E_BADSTARTNAMECHAR - Manifest Parse Error : A name was started with an invalid character. +. + +MessageId=14033 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_BADNAMECHAR +Language=Bulgarian +ERROR_SXS_XML_E_BADNAMECHAR - Manifest Parse Error : A name contained an invalid character. +. + +MessageId=14034 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_BADCHARINSTRING +Language=Bulgarian +ERROR_SXS_XML_E_BADCHARINSTRING - Manifest Parse Error : A string literal contained an invalid character. +. + +MessageId=14035 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_XMLDECLSYNTAX +Language=Bulgarian +ERROR_SXS_XML_E_XMLDECLSYNTAX - Manifest Parse Error : Invalid syntax for an XML declaration. +. + +MessageId=14036 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_BADCHARDATA +Language=Bulgarian +ERROR_SXS_XML_E_BADCHARDATA - Manifest Parse Error : An invalid character was found in text content. +. + +MessageId=14037 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_MISSINGWHITESPACE +Language=Bulgarian +ERROR_SXS_XML_E_MISSINGWHITESPACE - Manifest Parse Error : Required white space was missing. +. + +MessageId=14038 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_EXPECTINGTAGEND +Language=Bulgarian +ERROR_SXS_XML_E_EXPECTINGTAGEND - Manifest Parse Error : The character '>' was expected. +. + +MessageId=14039 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_MISSINGSEMICOLON +Language=Bulgarian +ERROR_SXS_XML_E_MISSINGSEMICOLON - Manifest Parse Error : A semi colon character was expected. +. + +MessageId=14040 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_UNBALANCEDPAREN +Language=Bulgarian +ERROR_SXS_XML_E_UNBALANCEDPAREN - Manifest Parse Error : Unbalanced parentheses. +. + +MessageId=14041 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_INTERNALERROR +Language=Bulgarian +ERROR_SXS_XML_E_INTERNALERROR - Manifest Parse Error : Internal error. +. + +MessageId=14042 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_UNEXPECTED_WHITESPACE +Language=Bulgarian +ERROR_SXS_XML_E_UNEXPECTED_WHITESPACE - Manifest Parse Error : White space is not allowed at this location. +. + +MessageId=14043 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_INCOMPLETE_ENCODING +Language=Bulgarian +ERROR_SXS_XML_E_INCOMPLETE_ENCODING - Manifest Parse Error : End of file reached in invalid state for current encoding. +. + +MessageId=14044 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_MISSING_PAREN +Language=Bulgarian +ERROR_SXS_XML_E_MISSING_PAREN - Manifest Parse Error : Missing parenthesis. +. + +MessageId=14045 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_EXPECTINGCLOSEQUOTE +Language=Bulgarian +ERROR_SXS_XML_E_EXPECTINGCLOSEQUOTE - Manifest Parse Error : A single or double closing quote character (\' or \") is missing. +. + +MessageId=14046 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_MULTIPLE_COLONS +Language=Bulgarian +ERROR_SXS_XML_E_MULTIPLE_COLONS - Manifest Parse Error : Multiple colons are not allowed in a name. +. + +MessageId=14047 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_INVALID_DECIMAL +Language=Bulgarian +ERROR_SXS_XML_E_INVALID_DECIMAL - Manifest Parse Error : Invalid character for decimal digit. +. + +MessageId=14048 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_INVALID_HEXIDECIMAL +Language=Bulgarian +ERROR_SXS_XML_E_INVALID_HEXIDECIMAL - Manifest Parse Error : Invalid character for hexadecimal digit. +. + +MessageId=14049 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_INVALID_UNICODE +Language=Bulgarian +ERROR_SXS_XML_E_INVALID_UNICODE - Manifest Parse Error : Invalid Unicode character value for this platform. +. + +MessageId=14050 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_WHITESPACEORQUESTIONMARK +Language=Bulgarian +ERROR_SXS_XML_E_WHITESPACEORQUESTIONMARK - Manifest Parse Error : Expecting white space or '?'. +. + +MessageId=14051 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_UNEXPECTEDENDTAG +Language=Bulgarian +ERROR_SXS_XML_E_UNEXPECTEDENDTAG - Manifest Parse Error : End tag was not expected at this location. +. + +MessageId=14052 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_UNCLOSEDTAG +Language=Bulgarian +ERROR_SXS_XML_E_UNCLOSEDTAG - Manifest Parse Error : The following tags were not closed: %1. +. + +MessageId=14053 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_DUPLICATEATTRIBUTE +Language=Bulgarian +ERROR_SXS_XML_E_DUPLICATEATTRIBUTE - Manifest Parse Error : Duplicate attribute. +. + +MessageId=14054 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_MULTIPLEROOTS +Language=Bulgarian +ERROR_SXS_XML_E_MULTIPLEROOTS - Manifest Parse Error : Only one top level element is allowed in an XML document. +. + +MessageId=14055 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_INVALIDATROOTLEVEL +Language=Bulgarian +ERROR_SXS_XML_E_INVALIDATROOTLEVEL - Manifest Parse Error : Invalid at the top level of the document. +. + +MessageId=14056 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_BADXMLDECL +Language=Bulgarian +ERROR_SXS_XML_E_BADXMLDECL - Manifest Parse Error : Invalid XML declaration. +. + +MessageId=14057 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_MISSINGROOT +Language=Bulgarian +ERROR_SXS_XML_E_MISSINGROOT - Manifest Parse Error : XML document must have a top level element. +. + +MessageId=14058 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_UNEXPECTEDEOF +Language=Bulgarian +ERROR_SXS_XML_E_UNEXPECTEDEOF - Manifest Parse Error : Unexpected end of file. +. + +MessageId=14059 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_BADPEREFINSUBSET +Language=Bulgarian +ERROR_SXS_XML_E_BADPEREFINSUBSET - Manifest Parse Error : Parameter entities cannot be used inside markup declarations in an internal subset. +. + +MessageId=14060 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_UNCLOSEDSTARTTAG +Language=Bulgarian +ERROR_SXS_XML_E_UNCLOSEDSTARTTAG - Manifest Parse Error : Element was not closed. +. + +MessageId=14061 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_UNCLOSEDENDTAG +Language=Bulgarian +ERROR_SXS_XML_E_UNCLOSEDENDTAG - Manifest Parse Error : End element was missing the character '>'. +. + +MessageId=14062 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_UNCLOSEDSTRING +Language=Bulgarian +ERROR_SXS_XML_E_UNCLOSEDSTRING - Manifest Parse Error : A string literal was not closed. +. + +MessageId=14063 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_UNCLOSEDCOMMENT +Language=Bulgarian +ERROR_SXS_XML_E_UNCLOSEDCOMMENT - Manifest Parse Error : A comment was not closed. +. + +MessageId=14064 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_UNCLOSEDDECL +Language=Bulgarian +ERROR_SXS_XML_E_UNCLOSEDDECL - Manifest Parse Error : A declaration was not closed. +. + +MessageId=14065 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_UNCLOSEDCDATA +Language=Bulgarian +ERROR_SXS_XML_E_UNCLOSEDCDATA - Manifest Parse Error : A CDATA section was not closed. +. + +MessageId=14066 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_RESERVEDNAMESPACE +Language=Bulgarian +ERROR_SXS_XML_E_RESERVEDNAMESPACE - Manifest Parse Error : The namespace prefix is not allowed to start with the reserved string \"xml\". +. + +MessageId=14067 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_INVALIDENCODING +Language=Bulgarian +ERROR_SXS_XML_E_INVALIDENCODING - Manifest Parse Error : System does not support the specified encoding. +. + +MessageId=14068 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_INVALIDSWITCH +Language=Bulgarian +ERROR_SXS_XML_E_INVALIDSWITCH - Manifest Parse Error : Switch from current encoding to specified encoding not supported. +. + +MessageId=14069 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_BADXMLCASE +Language=Bulgarian +ERROR_SXS_XML_E_BADXMLCASE - Manifest Parse Error : The name 'xml' is reserved and must be lower case. +. + +MessageId=14070 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_INVALID_STANDALONE +Language=Bulgarian +ERROR_SXS_XML_E_INVALID_STANDALONE - Manifest Parse Error : The standalone attribute must have the value 'yes' or 'no'. +. + +MessageId=14071 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_UNEXPECTED_STANDALONE +Language=Bulgarian +ERROR_SXS_XML_E_UNEXPECTED_STANDALONE - Manifest Parse Error : The standalone attribute cannot be used in external entities. +. + +MessageId=14072 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_INVALID_VERSION +Language=Bulgarian +ERROR_SXS_XML_E_INVALID_VERSION - Manifest Parse Error : Invalid version number. +. + +MessageId=14073 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_XML_E_MISSINGEQUALS +Language=Bulgarian +ERROR_SXS_XML_E_MISSINGEQUALS - Manifest Parse Error : Missing equals sign between attribute and attribute value. +. + +MessageId=14074 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_PROTECTION_RECOVERY_FAILED +Language=Bulgarian +ERROR_SXS_PROTECTION_RECOVERY_FAILED - Assembly Protection Error: Unable to recover the specified assembly. +. + +MessageId=14075 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_PROTECTION_PUBLIC_KEY_TOO_SHORT +Language=Bulgarian +ERROR_SXS_PROTECTION_PUBLIC_KEY_TOO_SHORT - Assembly Protection Error: The public key for an assembly was too short to be allowed. +. + +MessageId=14076 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_PROTECTION_CATALOG_NOT_VALID +Language=Bulgarian +ERROR_SXS_PROTECTION_CATALOG_NOT_VALID - Assembly Protection Error: The catalog for an assembly is not valid, or does not match the assembly's manifest. +. + +MessageId=14077 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_UNTRANSLATABLE_HRESULT +Language=Bulgarian +ERROR_SXS_UNTRANSLATABLE_HRESULT - An HRESULT could not be translated to a corresponding Win32 error code. +. + +MessageId=14078 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_PROTECTION_CATALOG_FILE_MISSING +Language=Bulgarian +ERROR_SXS_PROTECTION_CATALOG_FILE_MISSING - Assembly Protection Error: The catalog for an assembly is missing. +. + +MessageId=14079 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_MISSING_ASSEMBLY_IDENTITY_ATTRIBUTE +Language=Bulgarian +ERROR_SXS_MISSING_ASSEMBLY_IDENTITY_ATTRIBUTE - The supplied assembly identity is missing one or more attributes which must be present in this context. +. + +MessageId=14080 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE_NAME +Language=Bulgarian +ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE_NAME - The supplied assembly identity has one or more attribute names that contain characters not permitted in XML names. +. + +MessageId=14081 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_ASSEMBLY_MISSING +Language=Bulgarian +ERROR_SXS_ASSEMBLY_MISSING - The referenced assembly could not be found. +. + +MessageId=14082 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_CORRUPT_ACTIVATION_STACK +Language=Bulgarian +ERROR_SXS_CORRUPT_ACTIVATION_STACK - The activation context activation stack for the running thread of execution is corrupt. +. + +MessageId=14083 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_CORRUPTION +Language=Bulgarian +ERROR_SXS_CORRUPTION - The application isolation metadata for this process or thread has become corrupt. +. + +MessageId=14084 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_EARLY_DEACTIVATION +Language=Bulgarian +ERROR_SXS_EARLY_DEACTIVATION - The activation context being deactivated is not the most recently activated one. +. + +MessageId=14085 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_INVALID_DEACTIVATION +Language=Bulgarian +ERROR_SXS_INVALID_DEACTIVATION - The activation context being deactivated is not active for the current thread of execution. +. + +MessageId=14086 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_MULTIPLE_DEACTIVATION +Language=Bulgarian +ERROR_SXS_MULTIPLE_DEACTIVATION - The activation context being deactivated has already been deactivated. +. + +MessageId=14087 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_PROCESS_TERMINATION_REQUESTED +Language=Bulgarian +ERROR_SXS_PROCESS_TERMINATION_REQUESTED - A component used by the isolation facility has requested to terminate the process. +. + +MessageId=14088 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_RELEASE_ACTIVATION_CONTEXT +Language=Bulgarian +ERROR_SXS_RELEASE_ACTIVATION_CONTEXT - A kernel mode component is releasing a reference on an activation context. +. + +MessageId=14089 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_SYSTEM_DEFAULT_ACTIVATION_CONTEXT_EMPTY +Language=Bulgarian +ERROR_SXS_SYSTEM_DEFAULT_ACTIVATION_CONTEXT_EMPTY - The activation context of system default assembly could not be generated. +. + +MessageId=14090 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_INVALID_IDENTITY_ATTRIBUTE_VALUE +Language=Bulgarian +ERROR_SXS_INVALID_IDENTITY_ATTRIBUTE_VALUE - The value of an attribute in an identity is not within the legal range. +. + +MessageId=14091 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_INVALID_IDENTITY_ATTRIBUTE_NAME +Language=Bulgarian +ERROR_SXS_INVALID_IDENTITY_ATTRIBUTE_NAME - The name of an attribute in an identity is not within the legal range. +. + +MessageId=14092 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_IDENTITY_DUPLICATE_ATTRIBUTE +Language=Bulgarian +ERROR_SXS_IDENTITY_DUPLICATE_ATTRIBUTE - An identity contains two definitions for the same attribute. +. + +MessageId=14093 +Severity=Success +Facility=System +SymbolicName=ERROR_SXS_IDENTITY_PARSE_ERROR +Language=Bulgarian +ERROR_SXS_IDENTITY_PARSE_ERROR - The identity string is malformed. This may be due to a trailing comma, more than two unnamed attributes, missing attribute name or missing attribute value. +. + +MessageId=15000 +Severity=Success +Facility=System +SymbolicName=ERROR_EVT_INVALID_CHANNEL_PATH +Language=Bulgarian +ERROR_EVT_INVALID_CHANNEL_PATH - The specified channel path is invalid. See extended error info for more details. +. + +MessageId=15001 +Severity=Success +Facility=System +SymbolicName=ERROR_EVT_INVALID_QUERY +Language=Bulgarian +ERROR_EVT_INVALID_QUERY - The specified query is invalid. See extended error info for more details. +. + +MessageId=15002 +Severity=Success +Facility=System +SymbolicName=ERROR_EVT_PUBLISHER_MANIFEST_NOT_FOUND +Language=Bulgarian +ERROR_EVT_PUBLISHER_MANIFEST_NOT_FOUND - The publisher did indicate they have a manifest/resource but a manifest/resource could not be found. +. + +MessageId=15003 +Severity=Success +Facility=System +SymbolicName=ERROR_EVT_PUBLISHER_MANIFEST_NOT_SPECIFIED +Language=Bulgarian +ERROR_EVT_PUBLISHER_MANIFEST_NOT_SPECIFIED - The publisher does not have a manifest and is performing an operation which requires they have a manifest. +. + +MessageId=15004 +Severity=Success +Facility=System +SymbolicName=ERROR_EVT_NO_REGISTERED_TEMPLATE +Language=Bulgarian +ERROR_EVT_NO_REGISTERED_TEMPLATE - There is no registered template for specified event id. +. + +MessageId=15005 +Severity=Success +Facility=System +SymbolicName=ERROR_EVT_EVENT_CHANNEL_MISMATCH +Language=Bulgarian +ERROR_EVT_EVENT_CHANNEL_MISMATCH - The specified event was declared in the manifest to go a different channel than the one this publisher handle is bound to. +. + +MessageId=15006 +Severity=Success +Facility=System +SymbolicName=ERROR_EVT_UNEXPECTED_VALUE_TYPE +Language=Bulgarian +ERROR_EVT_UNEXPECTED_VALUE_TYPE - The type of a specified substitution value does not match the type expected from the template definition. +. + +MessageId=15007 +Severity=Success +Facility=System +SymbolicName=ERROR_EVT_UNEXPECTED_NUM_VALUES +Language=Bulgarian +ERROR_EVT_UNEXPECTED_NUM_VALUES - The number of specified substitution values does not match the number expected from the template definition. +. + +MessageId=15008 +Severity=Success +Facility=System +SymbolicName=ERROR_EVT_CHANNEL_NOT_FOUND +Language=Bulgarian +ERROR_EVT_CHANNEL_NOT_FOUND - The specified channel could not be found. Check channel configuration. +. + +MessageId=15009 +Severity=Success +Facility=System +SymbolicName=ERROR_EVT_MALFORMED_XML_TEXT +Language=Bulgarian +ERROR_EVT_MALFORMED_XML_TEXT - The specified xml text was not well-formed. See Extended Error for more details. +. + +MessageId=15010 +Severity=Success +Facility=System +SymbolicName=ERROR_EVT_CHANNEL_PATH_TOO_GENERAL +Language=Bulgarian +ERROR_EVT_CHANNEL_PATH_TOO_GENERAL - The specified channel path selects more than one instance of a channel. The operation requires that only one channel be selected. It may be necessary to scope channel path to version / publicKeyToken to select only one instance. +. + + +; Facility=WIN32 + +MessageId=0x000E +Severity=Warning +Facility=WIN32 +SymbolicName=E_OUTOFMEMORY +Language=Bulgarian +E_OUTOFMEMORY - Out of memory +. + +MessageId=0x0057 +Severity=Warning +Facility=WIN32 +SymbolicName=E_INVALIDARG +Language=Bulgarian +E_INVALIDARG - One or more arguments are invalid +. + +MessageId=0x0006 +Severity=Warning +Facility=WIN32 +SymbolicName=E_HANDLE +Language=Bulgarian +E_POINTER - Invalid handle +. + +MessageId=0x0005 +Severity=Warning +Facility=WIN32 +SymbolicName=E_ACCESSDENIED +Language=Bulgarian +E_ACCESSDENIED - WIN32 access denied error +. + + +; Facility=ITF + +MessageId=0x0000 +Severity=Warning +Facility=ITF +SymbolicName=OLE_E_OLEVERB +Language=Bulgarian +OLE_E_OLEVERB - Invalid OLEVERB structure +. + +MessageId=0x0001 +Severity=Warning +Facility=ITF +SymbolicName=OLE_E_ADVF +Language=Bulgarian +OLE_E_ADVF - Invalid advise flags +. + +MessageId=0x0002 +Severity=Warning +Facility=ITF +SymbolicName=OLE_E_ENUM_NOMORE +Language=Bulgarian +OLE_E_ENUM_NOMORE - Can't enumerate any more, because the associated data is missing +. + +MessageId=0x0003 +Severity=Warning +Facility=ITF +SymbolicName=OLE_E_ADVISENOTSUPPORTED +Language=Bulgarian +OLE_E_ADVISENOTSUPPORTED - This implementation doesn't take advises +. + +MessageId=0x0004 +Severity=Warning +Facility=ITF +SymbolicName=OLE_E_NOCONNECTION +Language=Bulgarian +OLE_E_NOCONNECTION - There is no connection for this connection ID +. + +MessageId=0x0005 +Severity=Warning +Facility=ITF +SymbolicName=OLE_E_NOTRUNNING +Language=Bulgarian +OLE_E_NOTRUNNING - Need to run the object to perform this operation +. + +MessageId=0x0006 +Severity=Warning +Facility=ITF +SymbolicName=OLE_E_NOCACHE +Language=Bulgarian +OLE_E_NOCACHE - There is no cache to operate on +. + +MessageId=0x0007 +Severity=Warning +Facility=ITF +SymbolicName=OLE_E_BLANK +Language=Bulgarian +OLE_E_BLANK - Uninitialized object +. + +MessageId=0x0008 +Severity=Warning +Facility=ITF +SymbolicName=OLE_E_CLASSDIFF +Language=Bulgarian +OLE_E_CLASSDIFF - Linked object's source class has changed +. + +MessageId=0x0009 +Severity=Warning +Facility=ITF +SymbolicName=OLE_E_CANT_GETMONIKER +Language=Bulgarian +OLE_E_CANT_GETMONIKER - Not able to get the moniker of the object +. + +MessageId=0x000A +Severity=Warning +Facility=ITF +SymbolicName=OLE_E_CANT_BINDTOSOURCE +Language=Bulgarian +OLE_E_CANT_BINDTOSOURCE - Not able to bind to the source +. + +MessageId=0x000B +Severity=Warning +Facility=ITF +SymbolicName=OLE_E_STATIC +Language=Bulgarian +OLE_E_STATIC - Object is static; operation not allowed +. + +MessageId=0x000C +Severity=Warning +Facility=ITF +SymbolicName=OLE_E_PROMPTSAVECANCELLED +Language=Bulgarian +OLE_E_PROMPTSAVECANCELLED - User canceled out of save dialog +. + +MessageId=0x000D +Severity=Warning +Facility=ITF +SymbolicName=OLE_E_INVALIDRECT +Language=Bulgarian +OLE_E_INVALIDRECT - Invalid rectangle +. + +MessageId=0x000E +Severity=Warning +Facility=ITF +SymbolicName=OLE_E_WRONGCOMPOBJ +Language=Bulgarian +OLE_E_WRONGCOMPOBJ - compobj.dll is too old for the ole2.dll initialized +. + +MessageId=0x000F +Severity=Warning +Facility=ITF +SymbolicName=OLE_E_INVALIDHWND +Language=Bulgarian +OLE_E_INVALIDHWND - Invalid window handle +. + +MessageId=0x0010 +Severity=Warning +Facility=ITF +SymbolicName=OLE_E_NOT_INPLACEACTIVE +Language=Bulgarian +OLE_E_NOT_INPLACEACTIVE - Object is not in any of the inplace active states +. + +MessageId=0x0011 +Severity=Warning +Facility=ITF +SymbolicName=OLE_E_CANTCONVERT +Language=Bulgarian +OLE_E_CANTCONVERT - Not able to convert object +. + +MessageId=0x0012 +Severity=Warning +Facility=ITF +SymbolicName=OLE_E_NOSTORAGE +Language=Bulgarian +OLE_E_NOSTORAGE - Not able to perform the operation because object is not given storage yet +. + +MessageId=0x0064 +Severity=Warning +Facility=ITF +SymbolicName=DV_E_FORMATETC +Language=Bulgarian +DV_E_FORMATETC - Invalid FORMATETC structure +. + +MessageId=0x0065 +Severity=Warning +Facility=ITF +SymbolicName=DV_E_DVTARGETDEVICE +Language=Bulgarian +DV_E_DVTARGETDEVICE - Invalid DVTARGETDEVICE structure +. + +MessageId=0x0066 +Severity=Warning +Facility=ITF +SymbolicName=DV_E_STGMEDIUM +Language=Bulgarian +DV_E_STGMEDIUM - Invalid STDGMEDIUM structure +. + +MessageId=0x0067 +Severity=Warning +Facility=ITF +SymbolicName=DV_E_STATDATA +Language=Bulgarian +DV_E_STATDATA - Invalid STATDATA structure +. + +MessageId=0x0068 +Severity=Warning +Facility=ITF +SymbolicName=DV_E_LINDEX +Language=Bulgarian +DV_E_LINDEX - Invalid lindex +. + +MessageId=0x0069 +Severity=Warning +Facility=ITF +SymbolicName=DV_E_TYMED +Language=Bulgarian +DV_E_TYMED - Invalid tymed +. + +MessageId=0x006A +Severity=Warning +Facility=ITF +SymbolicName=DV_E_CLIPFORMAT +Language=Bulgarian +DV_E_CLIPFORMAT - Invalid clipboard format +. + +MessageId=0x006B +Severity=Warning +Facility=ITF +SymbolicName=DV_E_DVASPECT +Language=Bulgarian +DV_E_DVASPECT - Invalid aspect(s) +. + +MessageId=0x006C +Severity=Warning +Facility=ITF +SymbolicName=DV_E_DVTARGETDEVICE_SIZE +Language=Bulgarian +DV_E_DVTARGETDEVICE_SIZE - tdSize parameter of the DVTARGETDEVICE structure is invalid +. + +MessageId=0x006D +Severity=Warning +Facility=ITF +SymbolicName=DV_E_NOIVIEWOBJECT +Language=Bulgarian +DV_E_NOIVIEWOBJECT - Object doesn't support IViewObject interface +. + +MessageId=0x0100 +Severity=Warning +Facility=ITF +SymbolicName=DRAGDROP_E_NOTREGISTERED +Language=Bulgarian +DRAGDROP_E_NOTREGISTERED - Trying to revoke a drop target that has not been registered +. + +MessageId=0x0101 +Severity=Warning +Facility=ITF +SymbolicName=DRAGDROP_E_ALREADYREGISTERED +Language=Bulgarian +DRAGDROP_E_ALREADYREGISTERED - This window has already been registered as a drop target +. + +MessageId=0x0102 +Severity=Warning +Facility=ITF +SymbolicName=DRAGDROP_E_INVALIDHWND +Language=Bulgarian +DRAGDROP_E_INVALIDHWND - Invalid window handle +. + +MessageId=0x0110 +Severity=Warning +Facility=ITF +SymbolicName=CLASS_E_NOAGGREGATION +Language=Bulgarian +CLASS_E_NOAGGREGATION - Class does not support aggregation (or class object is remote) +. + +MessageId=0x0111 +Severity=Warning +Facility=ITF +SymbolicName=CLASS_E_CLASSNOTAVAILABLE +Language=Bulgarian +CLASS_E_CLASSNOTAVAILABLE - ClassFactory cannot supply requested class +. + +MessageId=0x0112 +Severity=Warning +Facility=ITF +SymbolicName=CLASS_E_NOTLICENSED +Language=Bulgarian +CLASS_E_NOTLICENSED - Class is not licensed for use +. + +; EOF diff --git a/reactos/dll/win32/kernel32/misc/env.c b/reactos/dll/win32/kernel32/misc/env.c index b5aa8c5e6cb..c4f0ee25ae8 100644 --- a/reactos/dll/win32/kernel32/misc/env.c +++ b/reactos/dll/win32/kernel32/misc/env.c @@ -193,18 +193,27 @@ SetEnvironmentVariableA ( &VarName, TRUE); - RtlInitAnsiString (&VarValue, - (LPSTR)lpValue); - RtlAnsiStringToUnicodeString (&VarValueU, - &VarValue, - TRUE); + if (lpValue) + { + RtlInitAnsiString (&VarValue, + (LPSTR)lpValue); + RtlAnsiStringToUnicodeString (&VarValueU, + &VarValue, + TRUE); - Status = RtlSetEnvironmentVariable (NULL, - &VarNameU, - &VarValueU); + Status = RtlSetEnvironmentVariable (NULL, + &VarNameU, + &VarValueU); + RtlFreeUnicodeString (&VarValueU); + } + else + { + Status = RtlSetEnvironmentVariable (NULL, + &VarNameU, + NULL); + } RtlFreeUnicodeString (&VarNameU); - RtlFreeUnicodeString (&VarValueU); if (!NT_SUCCESS(Status)) { @@ -235,12 +244,22 @@ SetEnvironmentVariableW ( RtlInitUnicodeString (&VarName, lpName); - RtlInitUnicodeString (&VarValue, - lpValue); + if (lpValue) + { + RtlInitUnicodeString (&VarValue, + lpValue); + + Status = RtlSetEnvironmentVariable (NULL, + &VarName, + &VarValue); + } + else + { + Status = RtlSetEnvironmentVariable (NULL, + &VarName, + NULL); + } - Status = RtlSetEnvironmentVariable (NULL, - &VarName, - &VarValue); if (!NT_SUCCESS(Status)) { SetLastErrorByStatus (Status); diff --git a/reactos/dll/win32/kernel32/misc/stubs.c b/reactos/dll/win32/kernel32/misc/stubs.c index 125177ff165..4309610b8f5 100644 --- a/reactos/dll/win32/kernel32/misc/stubs.c +++ b/reactos/dll/win32/kernel32/misc/stubs.c @@ -1403,6 +1403,107 @@ Wow64RevertWow64FsRedirection (VOID * pv) return FALSE; } +UINT +WINAPI +EnumSystemFirmwareTables(IN DWORD FirmwareTableProviderSignature, + OUT PVOID pFirmwareTableBuffer, + IN DWORD BufferSize) +{ + STUB; + return 0; +} + +BOOL +WINAPI +GetSystemFileCacheSize(OUT PSIZE_T lpMinimumFileCacheSize, + OUT PSIZE_T lpMaximumFileCacheSize, + OUT PDWORD lpFlags) +{ + STUB; + return FALSE; +} + +UINT +WINAPI +GetSystemFirmwareTable(IN DWORD FirmwareTableProviderSignature, + IN DWORD FirmwareTableID, + OUT PVOID pFirmwareTableBuffer, + IN DWORD BufferSize) +{ + STUB; + return 0; +} + +BOOL +WINAPI +SetSystemFileCacheSize(IN SIZE_T MinimumFileCacheSize, + IN SIZE_T MaximumFileCacheSize, + IN DWORD Flags) +{ + STUB; + return FALSE; +} + +BOOL +WINAPI +SetThreadStackGuarantee(IN OUT PULONG StackSizeInBytes) +{ + STUB; + return FALSE; +} + +HANDLE +WINAPI +ReOpenFile(IN HANDLE hOriginalFile, + IN DWORD dwDesiredAccess, + IN DWORD dwShareMode, + IN DWORD dwFlags) +{ + STUB; + return INVALID_HANDLE_VALUE; +} + +BOOL +WINAPI +SetProcessWorkingSetSizeEx(IN HANDLE hProcess, + IN SIZE_T dwMinimumWorkingSetSize, + IN SIZE_T dwMaximumWorkingSetSize, + IN DWORD Flags) +{ + STUB; + return FALSE; +} + + +BOOL +WINAPI +GetProcessWorkingSetSizeEx(IN HANDLE hProcess, + OUT PSIZE_T lpMinimumWorkingSetSize, + OUT PSIZE_T lpMaximumWorkingSetSize, + OUT PDWORD Flags) +{ + STUB; + return FALSE; +} + +BOOL +WINAPI +GetLogicalProcessorInformation(OUT PSYSTEM_LOGICAL_PROCESSOR_INFORMATION Buffer, + IN OUT PDWORD ReturnLength) +{ + STUB; + return FALSE; +} + +BOOL +WINAPI +GetNumaAvailableMemoryNode(IN UCHAR Node, + OUT PULONGLONG AvailableBytes) +{ + STUB; + return FALSE; +} + BOOL WINAPI TermsrvAppInstallMode(void) { STUB; @@ -1414,3 +1515,4 @@ DWORD WINAPI SetTermsrvAppInstallMode(BOOL bInstallMode) STUB; return 0; } + diff --git a/reactos/dll/win32/kernel32/misc/sysinfo.c b/reactos/dll/win32/kernel32/misc/sysinfo.c index 6db8a5644bf..bf0acea526f 100644 --- a/reactos/dll/win32/kernel32/misc/sysinfo.c +++ b/reactos/dll/win32/kernel32/misc/sysinfo.c @@ -233,4 +233,12 @@ GetNativeSystemInfo( GetSystemInfo(lpSystemInfo); } +DWORD +WINAPI +GetCurrentProcessorNumber(VOID) +{ + /* Forward to kernel */ + return NtGetCurrentProcessorNumber(); +} + /* EOF */ diff --git a/reactos/dll/win32/msafd/misc/dllmain.c b/reactos/dll/win32/msafd/misc/dllmain.c index 4c520e132af..48d6e314085 100644 --- a/reactos/dll/win32/msafd/misc/dllmain.c +++ b/reactos/dll/win32/msafd/misc/dllmain.c @@ -285,10 +285,13 @@ DWORD MsafdReturnWithErrno( NTSTATUS Status, LPINT Errno, DWORD Received, if( ReturnedBytes ) *ReturnedBytes = Received; break; case STATUS_END_OF_FILE: *Errno = WSAESHUTDOWN; break; case STATUS_PENDING: *Errno = WSA_IO_PENDING; break; - case STATUS_BUFFER_OVERFLOW: *Errno = WSAEMSGSIZE; break; - case STATUS_INSUFFICIENT_RESOURCES: *Errno = WSA_NOT_ENOUGH_MEMORY; break; - case STATUS_INVALID_CONNECTION: *Errno = WSAEAFNOSUPPORT; break; - case STATUS_REMOTE_NOT_LISTENING: *Errno = WSAECONNRESET; break; + case STATUS_BUFFER_OVERFLOW: DbgPrint("MSAFD: STATUS_BUFFER_TOO_SMALL/STATUS_BUFFER_OVERFLOW\n"); *Errno = WSAEMSGSIZE; break; + case STATUS_NO_MEMORY: /* Fall through to STATUS_INSUFFICIENT_RESOURCES */ + case STATUS_INSUFFICIENT_RESOURCES: DbgPrint("MSAFD: STATUS_NO_MEMORY/STATUS_INSUFFICIENT_RESOURCES\n"); *Errno = WSA_NOT_ENOUGH_MEMORY; break; + case STATUS_INVALID_CONNECTION: DbgPrint("MSAFD: STATUS_INVALID_CONNECTION\n"); *Errno = WSAEAFNOSUPPORT; break; + case STATUS_REMOTE_NOT_LISTENING: DbgPrint("MSAFD: STATUS_REMOTE_NOT_LISTENING\n"); *Errno = WSAECONNRESET; break; + case STATUS_FILE_CLOSED: DbgPrint("MSAFD: STATUS_FILE_CLOSED\n"); *Errno = WSAENOTSOCK; break; + case STATUS_INVALID_PARAMETER: DbgPrint("MSAFD: STATUS_INVALID_PARAMETER\n"); *Errno = WSAEINVAL; break; default: DbgPrint("MSAFD: Error %x is unknown\n", Status); *Errno = WSAEINVAL; break; @@ -595,7 +598,7 @@ WSPSelect( IO_STATUS_BLOCK IOSB; PAFD_POLL_INFO PollInfo; NTSTATUS Status; - ULONG HandleCount, OutCount = 0; + LONG HandleCount, OutCount = 0; ULONG PollBufferSize; PVOID PollBuffer; ULONG i, j = 0, x; @@ -658,7 +661,6 @@ WSPSelect( RtlZeroMemory( PollInfo, PollBufferSize ); /* Number of handles for AFD to Check */ - PollInfo->HandleCount = HandleCount; PollInfo->Exclusive = FALSE; PollInfo->Timeout = Timeout; @@ -686,6 +688,9 @@ WSPSelect( } } + PollInfo->HandleCount = j; + PollBufferSize = ((PCHAR)&PollInfo->Handles[j+1]) - ((PCHAR)PollInfo); + /* Send IOCTL */ Status = NtDeviceIoControlFile( (HANDLE)PollInfo->Handles[0].Handle, SockEvent, diff --git a/reactos/dll/win32/netcfgx/classfactory.c b/reactos/dll/win32/netcfgx/classfactory.c new file mode 100644 index 00000000000..d03c5f340cc --- /dev/null +++ b/reactos/dll/win32/netcfgx/classfactory.c @@ -0,0 +1,124 @@ +#include + +typedef struct +{ + const IClassFactoryVtbl *lpVtbl; + LONG ref; + CLSID *rclsid; + LPFNCREATEINSTANCE lpfnCI; + const IID * riidInst; +} IClassFactoryImpl; + + +static +HRESULT +WINAPI +IClassFactory_fnQueryInterface( + LPCLASSFACTORY iface, + REFIID riid, + LPVOID *ppvObj) +{ + IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + + *ppvObj = NULL; + if(IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IClassFactory)) + { + *ppvObj = This; + InterlockedIncrement(&This->ref); + return S_OK; + } + return E_NOINTERFACE; +} + +static +ULONG +WINAPI +IClassFactory_fnAddRef( + LPCLASSFACTORY iface) +{ + IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + ULONG refCount = InterlockedIncrement(&This->ref); + + return refCount; +} + +static +ULONG +WINAPI +IClassFactory_fnRelease( + LPCLASSFACTORY iface) +{ + IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + ULONG refCount = InterlockedDecrement(&This->ref); + + if (!refCount) + { + CoTaskMemFree(This); + return 0; + } + return refCount; +} + +static +HRESULT +WINAPI +IClassFactory_fnCreateInstance( + LPCLASSFACTORY iface, + LPUNKNOWN pUnkOuter, + REFIID riid, + LPVOID *ppvObject) +{ + IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + + *ppvObject = NULL; + + if ( This->riidInst==NULL || IsEqualCLSID(riid, This->riidInst) || IsEqualCLSID(riid, &IID_IUnknown) ) + { + return This->lpfnCI(pUnkOuter, riid, ppvObject); + } + + return E_NOINTERFACE; +} + +static +HRESULT +WINAPI IClassFactory_fnLockServer( + LPCLASSFACTORY iface, + BOOL fLock) +{ + //IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + return E_NOTIMPL; +} + + +static const IClassFactoryVtbl dclfvt = +{ + IClassFactory_fnQueryInterface, + IClassFactory_fnAddRef, + IClassFactory_fnRelease, + IClassFactory_fnCreateInstance, + IClassFactory_fnLockServer +}; + + +IClassFactory * +IClassFactory_fnConstructor( + LPFNCREATEINSTANCE lpfnCI, + PLONG pcRefDll, + REFIID riidInst) +{ + IClassFactoryImpl* lpclf; + + lpclf = CoTaskMemAlloc(sizeof(IClassFactoryImpl)); + lpclf->ref = 1; + lpclf->lpVtbl = &dclfvt; + lpclf->lpfnCI = lpfnCI; + + if (pcRefDll) + InterlockedIncrement(pcRefDll); + lpclf->riidInst = riidInst; + + return (LPCLASSFACTORY)lpclf; +} + + diff --git a/reactos/dll/win32/netid/lang/es-ES.rc b/reactos/dll/win32/netid/lang/es-ES.rc index 7e1dd802ca2..e3ace94b891 100644 --- a/reactos/dll/win32/netid/lang/es-ES.rc +++ b/reactos/dll/win32/netid/lang/es-ES.rc @@ -14,7 +14,7 @@ BEGIN LTEXT "ReactOS usa la siguiente informaciуn para identificar su equipo en la red.", IDC_STATIC, 40, 5, 204, 20 LTEXT "Descripciуn del equipo:", IDC_STATIC, 6, 40, 85, 9 EDITTEXT IDC_COMPDESC, 98, 38, 146, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP - LTEXT "Nombre completo de equipo:", IDC_STATIC, 6, 66, 64, 14 + LTEXT "Nombre completo del equipo:", IDC_STATIC, 6, 66, 64, 16 LTEXT "(Defecto)", IDC_COMPUTERNAME, 98, 68, 144, 11 LTEXT "Grupo de trabajo:", IDC_WORKGROUPDOMAIN, 6, 84, 64, 9 LTEXT "(vacнo)", IDC_WORKGROUPDOMAIN_NAME, 98, 84, 144, 9 diff --git a/reactos/dll/win32/netid/lang/no-NO.rc b/reactos/dll/win32/netid/lang/no-NO.rc index ec17355510f..641a54be503 100644 --- a/reactos/dll/win32/netid/lang/no-NO.rc +++ b/reactos/dll/win32/netid/lang/no-NO.rc @@ -7,17 +7,17 @@ FONT 8, "MS Shell Dlg" BEGIN ICON IDI_COMPNAME, IDC_STATIC, 4, 3, 26, 24, SS_ICON LTEXT "ReactOS bruker fшlgende informasjon for е identifisere datamaskinen pе nettverket.", IDC_STATIC, 40, 5, 204, 20 - LTEXT "Beskrivelse av datamaskinen:", IDC_STATIC, 6, 40, 90, 9 - EDITTEXT IDC_COMPDESC, 98, 38, 146, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP + LTEXT "Beskrivelse av datamaskinen:", IDC_STATIC, 6, 40, 135, 9 + EDITTEXT IDC_COMPDESC, 110, 38, 136, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP LTEXT "Fullt datamaskinnavn:", IDC_STATIC, 6, 68, 85, 9 - LTEXT "(Standard)", IDC_COMPUTERNAME, 98, 68, 144, 11 + LTEXT "(Standard)", IDC_COMPUTERNAME, 110, 68, 144, 11 LTEXT "Arbeidsgruppe:", IDC_WORKGROUPDOMAIN, 6, 84, 64, 9 - LTEXT "(Tom)", IDC_WORKGROUPDOMAIN_NAME, 98, 84, 144, 9 + LTEXT "(Tom)", IDC_WORKGROUPDOMAIN_NAME, 110, 84, 144, 9 LTEXT "Klikk nettverks-ID for е bruke veiviseren for nettverksidentifikasjon til е bli med i et domene og opprette en lokal brukerkonto.", IDC_STATIC, 6, 113, 172, 24 PUSHBUTTON "&Nettverk-ID...", IDC_NETWORK_ID, 190, 114, 58, 15 LTEXT "Klikk Endre for е gi datamaskinen et nytt navn eller bli med i et domenet.", IDC_STATIC, 6, 149, 170, 17 PUSHBUTTON "&Endre...",IDC_NETWORK_PROPERTY, 190, 149, 58, 15 - LTEXT "OBS: Bare Administratorer kan endre disse innstillingene pе denne datamaskinen.", IDC_STATIC, 6, 179, 300, 9 + LTEXT "OBS: Bare Administratorer kan endre disse innstillingene pе datamaskinen.", IDC_STATIC, 6, 179, 300, 9 END IDD_PROPPAGECOMPNAMECHENGE DIALOGEX 0, 0, 232, 222 @@ -60,15 +60,15 @@ STRINGTABLE BEGIN 1 "* Ukjent *" 2 "ARBEIDSGRUPPE" - 3 "The following error occurred while attempting to read domain membership information:" + 3 "Fшlgende feil har oppstеtt mens datamaskinen prшvde е lese domene medlemskap informasjon:" 4 "Endring i datamaskinnavn" 5 "Arbeidsgruppe:" 6 "Domene:" 22 "Velkommen til %1 arbeidsgruppen." 23 "Velkommen til %1 domene." 24 "Du mе starte denne datamaskinen pе nytt for at endringene skal tre i kraft." - 1021 "Note: Only Administrators can change the identification of this computer." - 1022 "Note: The identification of the computer cannot be changed because:" + 1021 "OBS: Bare administratorer kan endre identifisering for denne datamaskinen." + 1022 "OBS: Identifisering for datamaskinen kunne ikke endres fordi:" 3210 "&Detaljer >>" 3220 "<< &Detaljer" END diff --git a/reactos/dll/win32/netshell/classfactory.c b/reactos/dll/win32/netshell/classfactory.c new file mode 100644 index 00000000000..d03c5f340cc --- /dev/null +++ b/reactos/dll/win32/netshell/classfactory.c @@ -0,0 +1,124 @@ +#include + +typedef struct +{ + const IClassFactoryVtbl *lpVtbl; + LONG ref; + CLSID *rclsid; + LPFNCREATEINSTANCE lpfnCI; + const IID * riidInst; +} IClassFactoryImpl; + + +static +HRESULT +WINAPI +IClassFactory_fnQueryInterface( + LPCLASSFACTORY iface, + REFIID riid, + LPVOID *ppvObj) +{ + IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + + *ppvObj = NULL; + if(IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IClassFactory)) + { + *ppvObj = This; + InterlockedIncrement(&This->ref); + return S_OK; + } + return E_NOINTERFACE; +} + +static +ULONG +WINAPI +IClassFactory_fnAddRef( + LPCLASSFACTORY iface) +{ + IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + ULONG refCount = InterlockedIncrement(&This->ref); + + return refCount; +} + +static +ULONG +WINAPI +IClassFactory_fnRelease( + LPCLASSFACTORY iface) +{ + IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + ULONG refCount = InterlockedDecrement(&This->ref); + + if (!refCount) + { + CoTaskMemFree(This); + return 0; + } + return refCount; +} + +static +HRESULT +WINAPI +IClassFactory_fnCreateInstance( + LPCLASSFACTORY iface, + LPUNKNOWN pUnkOuter, + REFIID riid, + LPVOID *ppvObject) +{ + IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + + *ppvObject = NULL; + + if ( This->riidInst==NULL || IsEqualCLSID(riid, This->riidInst) || IsEqualCLSID(riid, &IID_IUnknown) ) + { + return This->lpfnCI(pUnkOuter, riid, ppvObject); + } + + return E_NOINTERFACE; +} + +static +HRESULT +WINAPI IClassFactory_fnLockServer( + LPCLASSFACTORY iface, + BOOL fLock) +{ + //IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + return E_NOTIMPL; +} + + +static const IClassFactoryVtbl dclfvt = +{ + IClassFactory_fnQueryInterface, + IClassFactory_fnAddRef, + IClassFactory_fnRelease, + IClassFactory_fnCreateInstance, + IClassFactory_fnLockServer +}; + + +IClassFactory * +IClassFactory_fnConstructor( + LPFNCREATEINSTANCE lpfnCI, + PLONG pcRefDll, + REFIID riidInst) +{ + IClassFactoryImpl* lpclf; + + lpclf = CoTaskMemAlloc(sizeof(IClassFactoryImpl)); + lpclf->ref = 1; + lpclf->lpVtbl = &dclfvt; + lpclf->lpfnCI = lpfnCI; + + if (pcRefDll) + InterlockedIncrement(pcRefDll); + lpclf->riidInst = riidInst; + + return (LPCLASSFACTORY)lpclf; +} + + diff --git a/reactos/dll/win32/netshell/connectmanager.c b/reactos/dll/win32/netshell/connectmanager.c new file mode 100644 index 00000000000..38f5dea17e6 --- /dev/null +++ b/reactos/dll/win32/netshell/connectmanager.c @@ -0,0 +1,698 @@ +#include + +typedef struct tagINetConnectionItem +{ + struct tagINetConnectionItem * Next; + NETCON_PROPERTIES Props; +}INetConnectionItem, *PINetConnectionItem; + +typedef struct +{ + const INetConnectionManagerVtbl * lpVtbl; + const IEnumNetConnectionVtbl * lpVtblNetConnection; + LONG ref; + PINetConnectionItem pHead; + PINetConnectionItem pCurrent; + +} INetConnectionManagerImpl, *LPINetConnectionManagerImpl; + +typedef struct +{ + const INetConnectionVtbl * lpVtbl; + LONG ref; + NETCON_PROPERTIES Props; +} INetConnectionImpl, *LPINetConnectionImpl; + + +static LPINetConnectionManagerImpl __inline impl_from_EnumNetConnection(IEnumNetConnection *iface) +{ + return (LPINetConnectionManagerImpl)((char *)iface - FIELD_OFFSET(INetConnectionManagerImpl, lpVtblNetConnection)); +} + + +static +HRESULT +WINAPI +INetConnectionManager_fnQueryInterface( + INetConnectionManager * iface, + REFIID iid, + LPVOID * ppvObj) +{ + INetConnectionManagerImpl * This = (INetConnectionManagerImpl*)iface; + *ppvObj = NULL; + + if (IsEqualIID (iid, &IID_IUnknown) || + IsEqualIID (iid, &IID_INetConnectionManager)) + { + *ppvObj = This; + INetConnectionManager_AddRef(iface); + return S_OK; + } + + return E_NOINTERFACE; +} + +static +ULONG +WINAPI +INetConnectionManager_fnAddRef( + INetConnectionManager * iface) +{ + INetConnectionManagerImpl * This = (INetConnectionManagerImpl*)iface; + ULONG refCount = InterlockedIncrement(&This->ref); + + return refCount; +} + +static +ULONG +WINAPI +INetConnectionManager_fnRelease( + INetConnectionManager * iface) +{ + INetConnectionManagerImpl * This = (INetConnectionManagerImpl*)iface; + ULONG refCount = InterlockedDecrement(&This->ref); + + if (!refCount) + { + CoTaskMemFree (This); + } + return refCount; +} + +static +HRESULT +WINAPI +INetConnectionManager_fnEnumConnections( + INetConnectionManager * iface, + NETCONMGR_ENUM_FLAGS Flags, + IEnumNetConnection **ppEnum) +{ + INetConnectionManagerImpl * This = (INetConnectionManagerImpl*)iface; + + if (!ppEnum) + return E_POINTER; + + if (Flags != NCME_DEFAULT) + return E_FAIL; + + *ppEnum = (IEnumNetConnection *)&This->lpVtblNetConnection; + INetConnectionManager_AddRef(iface); + return S_OK; +} + +static const INetConnectionManagerVtbl vt_NetConnectionManager = +{ + INetConnectionManager_fnQueryInterface, + INetConnectionManager_fnAddRef, + INetConnectionManager_fnRelease, + INetConnectionManager_fnEnumConnections, +}; + +/*************************************************************** + * INetConnection Interface + */ + +static +HRESULT +WINAPI +INetConnection_fnQueryInterface( + INetConnection * iface, + REFIID iid, + LPVOID * ppvObj) +{ + INetConnectionImpl * This = (INetConnectionImpl*)iface; + *ppvObj = NULL; + + if (IsEqualIID (iid, &IID_IUnknown) || + IsEqualIID (iid, &IID_INetConnection)) + { + *ppvObj = This; + INetConnection_AddRef(iface); + return S_OK; + } + + return E_NOINTERFACE; +} + +static +ULONG +WINAPI +INetConnection_fnAddRef( + INetConnection * iface) +{ + INetConnectionImpl * This = (INetConnectionImpl*)iface; + ULONG refCount = InterlockedIncrement(&This->ref); + + return refCount; +} + +static +ULONG +WINAPI +INetConnection_fnRelease( + INetConnection * iface) +{ + INetConnectionImpl * This = (INetConnectionImpl*)iface; + ULONG refCount = InterlockedDecrement(&This->ref); + + if (!refCount) + { + CoTaskMemFree(This->Props.pszwName); + CoTaskMemFree(This->Props.pszwDeviceName); + CoTaskMemFree(This); + } + return refCount; +} + +static +HRESULT +WINAPI +INetConnection_fnConnect( + INetConnection * iface) +{ + return E_NOTIMPL; +} + +static +HRESULT +WINAPI +INetConnection_fnDisconnect( + INetConnection * iface) +{ + return E_NOTIMPL; +} + + +static +HRESULT +WINAPI +INetConnection_fnDelete( + INetConnection * iface) +{ + return E_NOTIMPL; +} + +static +HRESULT +WINAPI +INetConnection_fnDuplicate( + INetConnection * iface, + LPCWSTR pszwDuplicateName, + INetConnection **ppCon) +{ + return E_NOTIMPL; +} + +static +HRESULT +WINAPI +INetConnection_fnGetProperties( + INetConnection * iface, + NETCON_PROPERTIES **ppProps) +{ + + NETCON_PROPERTIES * pProperties; + + INetConnectionImpl * This = (INetConnectionImpl*)iface; + + if (!ppProps) + return E_POINTER; + + pProperties = CoTaskMemAlloc(sizeof(NETCON_PROPERTIES)); + if (!pProperties) + return E_OUTOFMEMORY; + + CopyMemory(pProperties, &This->Props, sizeof(NETCON_PROPERTIES)); + if (This->Props.pszwName) + { + pProperties->pszwName = CoTaskMemAlloc((wcslen(This->Props.pszwName)+1)*sizeof(WCHAR)); + if (pProperties->pszwName) + wcscpy(pProperties->pszwName, This->Props.pszwName); + } + if (This->Props.pszwDeviceName) + { + pProperties->pszwDeviceName = CoTaskMemAlloc((wcslen(This->Props.pszwDeviceName)+1)*sizeof(WCHAR)); + if (pProperties->pszwDeviceName) + wcscpy(pProperties->pszwDeviceName, This->Props.pszwDeviceName); + } + + *ppProps = pProperties; + return NOERROR; +} + +static +HRESULT +WINAPI +INetConnection_fnGetUiObjectClassId( + INetConnection * iface, + CLSID *pclsid) +{ + + INetConnectionImpl * This = (INetConnectionImpl*)iface; + + if (This->Props.MediaType == NCM_LAN) + { + CopyMemory(pclsid, &CLSID_LANConnectUI, sizeof(CLSID)); + return S_OK; + } + + return E_NOTIMPL; +} + +static +HRESULT +WINAPI +INetConnection_fnRename( + INetConnection * iface, + LPCWSTR pszwDuplicateName) +{ + return E_NOTIMPL; +} + + +static const INetConnectionVtbl vt_NetConnection = +{ + INetConnection_fnQueryInterface, + INetConnection_fnAddRef, + INetConnection_fnRelease, + INetConnection_fnConnect, + INetConnection_fnDisconnect, + INetConnection_fnDelete, + INetConnection_fnDuplicate, + INetConnection_fnGetProperties, + INetConnection_fnGetUiObjectClassId, + INetConnection_fnRename +}; + +HRESULT WINAPI IConnection_Constructor (INetConnection **ppv, PINetConnectionItem pItem) +{ + INetConnectionImpl *This; + + if (!ppv) + return E_POINTER; + + This = (INetConnectionImpl *) CoTaskMemAlloc(sizeof (INetConnectionImpl)); + if (!This) + return E_OUTOFMEMORY; + + This->ref = 1; + This->lpVtbl = &vt_NetConnection; + + CopyMemory(&This->Props, &pItem->Props, sizeof(NETCON_PROPERTIES)); + + This->Props.pszwName = CoTaskMemAlloc((wcslen(pItem->Props.pszwName)+1)*sizeof(WCHAR)); + if (This->Props.pszwName) + wcscpy(This->Props.pszwName, pItem->Props.pszwName); + + This->Props.pszwDeviceName = CoTaskMemAlloc((wcslen(pItem->Props.pszwDeviceName)+1)*sizeof(WCHAR)); + if (This->Props.pszwDeviceName) + wcscpy(This->Props.pszwDeviceName, pItem->Props.pszwDeviceName); + + *ppv = (INetConnection *)This; + + + return S_OK; +} + + +/*************************************************************** + * IEnumNetConnection Interface + */ + +static +HRESULT +WINAPI +IEnumNetConnection_fnQueryInterface( + IEnumNetConnection * iface, + REFIID iid, + LPVOID * ppvObj) +{ + INetConnectionManagerImpl * This = impl_from_EnumNetConnection(iface); + *ppvObj = NULL; + + if (IsEqualIID (iid, &IID_IUnknown) || + IsEqualIID (iid, &IID_INetConnectionManager)) + { + *ppvObj = This; + INetConnectionManager_AddRef(iface); + return S_OK; + } + + return E_NOINTERFACE; +} + +static +ULONG +WINAPI +IEnumNetConnection_fnAddRef( + IEnumNetConnection * iface) +{ + INetConnectionManagerImpl * This = impl_from_EnumNetConnection(iface); + ULONG refCount = InterlockedIncrement(&This->ref); + + return refCount; +} + +static +ULONG +WINAPI +IEnumNetConnection_fnRelease( + IEnumNetConnection * iface) +{ + INetConnectionManagerImpl * This = impl_from_EnumNetConnection(iface); + ULONG refCount = InterlockedDecrement(&This->ref); + + if (!refCount) + { + CoTaskMemFree (This); + } + return refCount; +} + +static +HRESULT +WINAPI +IEnumNetConnection_fnNext( + IEnumNetConnection * iface, + ULONG celt, + INetConnection **rgelt, + ULONG *pceltFetched) +{ + INetConnectionManagerImpl * This = impl_from_EnumNetConnection(iface); + HRESULT hr; + + if (!pceltFetched || !rgelt) + return E_POINTER; + + if (celt != 1) + return E_FAIL; + + if (!This->pCurrent) + return S_FALSE; + + hr = IConnection_Constructor(rgelt, This->pCurrent); + This->pCurrent = This->pCurrent->Next; + + return hr; +} + +static +HRESULT +WINAPI +IEnumNetConnection_fnSkip( + IEnumNetConnection * iface, + ULONG celt) +{ + INetConnectionManagerImpl * This = impl_from_EnumNetConnection(iface); + + while(This->pCurrent && celt-- > 0) + This->pCurrent = This->pCurrent->Next; + + if (celt) + return S_FALSE; + else + return NOERROR; + +} + +static +HRESULT +WINAPI +IEnumNetConnection_fnReset( + IEnumNetConnection * iface) +{ + INetConnectionManagerImpl * This = impl_from_EnumNetConnection(iface); + + This->pCurrent = This->pHead; + return NOERROR; +} + +static +HRESULT +WINAPI +IEnumNetConnection_fnClone( + IEnumNetConnection * iface, + IEnumNetConnection **ppenum) +{ + return E_NOTIMPL; +} + +static const IEnumNetConnectionVtbl vt_EnumNetConnection = +{ + IEnumNetConnection_fnQueryInterface, + IEnumNetConnection_fnAddRef, + IEnumNetConnection_fnRelease, + IEnumNetConnection_fnNext, + IEnumNetConnection_fnSkip, + IEnumNetConnection_fnReset, + IEnumNetConnection_fnClone +}; + +static +BOOL +GetAdapterIndexFromNetCfgInstanceId(PIP_ADAPTER_INFO pAdapterInfo, LPWSTR szNetCfg, PDWORD pIndex) +{ + WCHAR szBuffer[50]; + IP_ADAPTER_INFO * pCurrentAdapter; + + pCurrentAdapter = pAdapterInfo; + while(pCurrentAdapter) + { + szBuffer[0] = L'\0'; + if (MultiByteToWideChar(CP_ACP, 0, pCurrentAdapter->AdapterName, -1, szBuffer, sizeof(szBuffer)/sizeof(szBuffer[0]))) + { + szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0'; + } + if (!wcsicmp(szBuffer, szNetCfg)) + { + *pIndex = pCurrentAdapter->Index; + return TRUE; + } + pCurrentAdapter = pCurrentAdapter->Next; + } + return FALSE; +} + + +static +BOOL +EnumerateINetConnections(INetConnectionManagerImpl *This) +{ + DWORD dwSize, dwResult, dwIndex, dwAdapterIndex, dwShowIcon; + MIB_IFTABLE *pIfTable; + MIB_IFROW IfEntry; + IP_ADAPTER_INFO * pAdapterInfo; + HDEVINFO hInfo; + SP_DEVINFO_DATA DevInfo; + HKEY hSubKey; + WCHAR szNetCfg[50]; + WCHAR szAdapterNetCfg[50]; + WCHAR szDetail[200] = L"SYSTEM\\CurrentControlSet\\Control\\Class\\"; + WCHAR szName[130] = L"SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}\\"; + PINetConnectionItem pNew; + PINetConnectionItem pCurrent = NULL; + + /* get the IfTable */ + dwSize = 0; + if (GetIfTable(NULL, &dwSize, TRUE) != ERROR_INSUFFICIENT_BUFFER) + return FALSE; + + pIfTable = (PMIB_IFTABLE)CoTaskMemAlloc(dwSize); + if (!pIfTable) + return FALSE; + + dwResult = GetIfTable(pIfTable, &dwSize, TRUE); + if (dwResult != NO_ERROR) + { + CoTaskMemFree(pIfTable); + return FALSE; + } + + dwSize = 0; + dwResult = GetAdaptersInfo(NULL, &dwSize); + if (dwResult!= ERROR_BUFFER_OVERFLOW) + { + CoTaskMemFree(pIfTable); + return FALSE; + } + + pAdapterInfo = (PIP_ADAPTER_INFO)CoTaskMemAlloc(dwSize); + if (!pAdapterInfo) + { + CoTaskMemFree(pIfTable); + return FALSE; + } + + if (GetAdaptersInfo(pAdapterInfo, &dwSize) != NO_ERROR) + { + CoTaskMemFree(pIfTable); + CoTaskMemFree(pAdapterInfo); + return FALSE; + } + + + hInfo = SetupDiGetClassDevs(&GUID_DEVCLASS_NET, NULL, NULL, DIGCF_PRESENT ); + if (!hInfo) + { + CoTaskMemFree(pIfTable); + CoTaskMemFree(pAdapterInfo); + return FALSE; + } + + dwIndex = 0; + do + { + ZeroMemory(&DevInfo, sizeof(SP_DEVINFO_DATA)); + DevInfo.cbSize = sizeof(DevInfo); + + /* get device info */ + if (!SetupDiEnumDeviceInfo(hInfo, dwIndex++, &DevInfo)) + break; + + /* get device software registry path */ + if (!SetupDiGetDeviceRegistryPropertyW(hInfo, &DevInfo, SPDRP_DRIVER, NULL, (LPBYTE)&szDetail[39], sizeof(szDetail)/sizeof(WCHAR) - 40, &dwSize)) + break; + + /* open device registry key */ + if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, szDetail, 0, KEY_READ, &hSubKey) != ERROR_SUCCESS) + break; + + /* query NetCfgInstanceId for current device */ + dwSize = sizeof(szNetCfg); + if (RegQueryValueExW(hSubKey, L"NetCfgInstanceId", NULL, NULL, (LPBYTE)szNetCfg, &dwSize) != ERROR_SUCCESS) + { + RegCloseKey(hSubKey); + break; + } + RegCloseKey(hSubKey); + /* get the current adapter index from NetCfgInstanceId */ + if (!GetAdapterIndexFromNetCfgInstanceId(pAdapterInfo, szNetCfg, &dwAdapterIndex)) + break; + + /* get detailed adapter info */ + ZeroMemory(&IfEntry, sizeof(IfEntry)); + IfEntry.dwIndex = dwAdapterIndex; + if(GetIfEntry(&IfEntry) != NO_ERROR) + break; + + /* allocate new INetConnectionItem */ + pNew = CoTaskMemAlloc(sizeof(INetConnectionItem)); + if (!pNew) + break; + + ZeroMemory(pNew, sizeof(INetConnectionItem)); + + /* store NetCfgInstanceId */ + CLSIDFromString(szNetCfg, &pNew->Props.guidId); + switch(IfEntry.dwOperStatus) + { + case MIB_IF_OPER_STATUS_NON_OPERATIONAL: + pNew->Props.Status = NCS_HARDWARE_DISABLED; + break; + case MIB_IF_OPER_STATUS_UNREACHABLE: + pNew->Props.Status = NCS_DISCONNECTED; + break; + case MIB_IF_OPER_STATUS_DISCONNECTED: + pNew->Props.Status = NCS_MEDIA_DISCONNECTED; + break; + case MIB_IF_OPER_STATUS_CONNECTING: + pNew->Props.Status = NCS_CONNECTING; + break; + case MIB_IF_OPER_STATUS_CONNECTED: + pNew->Props.Status = NCS_CONNECTED; + break; + case MIB_IF_OPER_STATUS_OPERATIONAL: + pNew->Props.Status = NCS_CONNECTED; + break; + default: + break; + } + + switch(IfEntry.dwType) + { + case IF_TYPE_ETHERNET_CSMACD: + pNew->Props.MediaType = NCM_LAN; + break; + case IF_TYPE_IEEE80211: + pNew->Props.MediaType = NCM_SHAREDACCESSHOST_RAS; + break; + default: + break; + } + /* open network connections details */ + wcscpy(&szName[80], szNetCfg); + wcscpy(&szName[118], L"\\Connection"); + + if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, szName, 0, KEY_READ, &hSubKey) == ERROR_SUCCESS) + { + /* retrieve name of connection */ + dwSize = sizeof(szAdapterNetCfg); + if (RegQueryValueExW(hSubKey, L"Name", NULL, NULL, (LPBYTE)szAdapterNetCfg, &dwSize) == ERROR_SUCCESS) + { + pNew->Props.pszwName = CoTaskMemAlloc((wcslen(szAdapterNetCfg)+1) * sizeof(WCHAR)); + if (pNew->Props.pszwName) + wcscpy(pNew->Props.pszwName, szAdapterNetCfg); + } + dwSize = sizeof(dwShowIcon); + if (RegQueryValueExW(hSubKey, L"ShowIcon", NULL, NULL, (LPBYTE)&dwShowIcon, &dwSize) == ERROR_SUCCESS) + { + if (dwShowIcon) + pNew->Props.dwCharacter |= NCCF_SHOW_ICON; + } + RegCloseKey(hSubKey); + } + if (SetupDiGetDeviceRegistryPropertyW(hInfo, &DevInfo, SPDRP_DEVICEDESC, NULL, (PBYTE)szNetCfg, sizeof(szNetCfg)/sizeof(WCHAR), &dwSize)) + { + szNetCfg[(sizeof(szNetCfg)/sizeof(WCHAR))-1] = L'\0'; + pNew->Props.pszwDeviceName = CoTaskMemAlloc((wcslen(szNetCfg)+1) * sizeof(WCHAR)); + if (pNew->Props.pszwDeviceName) + wcscpy(pNew->Props.pszwDeviceName, szNetCfg); + } + + if (pCurrent) + pCurrent->Next = pNew; + else + This->pHead = pNew; + + pCurrent = pNew; + }while(TRUE); + + CoTaskMemFree(pIfTable); + CoTaskMemFree(pAdapterInfo); + SetupDiDestroyDeviceInfoList(hInfo); + + This->pCurrent = This->pHead; + return TRUE; +} + +HRESULT WINAPI INetConnectionManager_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv) +{ + INetConnectionManagerImpl *sf; + + if (!ppv) + return E_POINTER; + if (pUnkOuter) + return CLASS_E_NOAGGREGATION; + + sf = (INetConnectionManagerImpl *) CoTaskMemAlloc(sizeof (INetConnectionManagerImpl)); + if (!sf) + return E_OUTOFMEMORY; + + sf->ref = 1; + sf->lpVtbl = &vt_NetConnectionManager; + sf->lpVtblNetConnection = &vt_EnumNetConnection; + + + if (!SUCCEEDED (INetConnectionManager_QueryInterface ((INetConnectionManager*)sf, riid, ppv))) + { + INetConnectionManager_Release((INetConnectionManager*)sf); + return E_NOINTERFACE; + } + + INetConnectionManager_Release((INetConnectionManager*)sf); + EnumerateINetConnections(sf); + return S_OK; +} + + diff --git a/reactos/dll/win32/netshell/enumlist.c b/reactos/dll/win32/netshell/enumlist.c new file mode 100644 index 00000000000..aacc4a87fdf --- /dev/null +++ b/reactos/dll/win32/netshell/enumlist.c @@ -0,0 +1,356 @@ +#include + +WINE_DEFAULT_DEBUG_CHANNEL(shell); + +typedef struct tagGUIDStruct +{ + BYTE dummy; /* offset 01 is unknown */ + GUID guid; /* offset 02 */ +} GUIDStruct; + +#define PT_GUID 0x1F + +typedef struct tagPIDLDATA +{ + BYTE type; /*00*/ + union + { + struct tagGUIDStruct guid; + struct tagVALUEStruct value; + }u; +} PIDLDATA, *LPPIDLDATA; + +typedef struct tagENUMLIST +{ + struct tagENUMLIST *pNext; + LPITEMIDLIST pidl; + +}ENUMLIST, *LPENUMLIST; + +typedef struct +{ + const IEnumIDListVtbl *lpVtbl; + LONG ref; + LPENUMLIST mpFirst; + LPENUMLIST mpLast; + LPENUMLIST mpCurrent; + +} IEnumIDListImpl; + +/************************************************************************** + * AddToEnumList() + */ +BOOL +AddToEnumList( + IEnumIDList * iface, + LPITEMIDLIST pidl) +{ + LPENUMLIST pNew; + IEnumIDListImpl *This = (IEnumIDListImpl *)iface; + + + if (!iface || !pidl) + return FALSE; + + pNew = (LPENUMLIST)SHAlloc(sizeof(ENUMLIST)); + if(pNew) + { + pNew->pNext = NULL; + pNew->pidl = pidl; + + if(!This->mpFirst) + { + This->mpFirst = pNew; + This->mpCurrent = pNew; + } + + if(This->mpLast) + { + /*add the new item to the end of the list */ + This->mpLast->pNext = pNew; + } + + /*update the last item pointer */ + This->mpLast = pNew; + return TRUE; + } + return FALSE; +} + +static +HRESULT +WINAPI +IEnumIDList_fnQueryInterface( + IEnumIDList * iface, + REFIID riid, + LPVOID *ppvObj) +{ + IEnumIDListImpl *This = (IEnumIDListImpl *)iface; + + *ppvObj = NULL; + + if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IEnumIDList)) + { + *ppvObj = This; + IEnumIDList_AddRef((IEnumIDList*)*ppvObj); + return S_OK; + } + + return E_NOINTERFACE; +} + +static +ULONG +WINAPI +IEnumIDList_fnAddRef( + IEnumIDList * iface) +{ + IEnumIDListImpl *This = (IEnumIDListImpl *)iface; + ULONG refCount = InterlockedIncrement(&This->ref); + + return refCount; +} + +static +ULONG +WINAPI IEnumIDList_fnRelease( + IEnumIDList * iface) +{ + LPENUMLIST pDelete; + IEnumIDListImpl *This = (IEnumIDListImpl *)iface; + ULONG refCount = InterlockedDecrement(&This->ref); + + if (!refCount) + { + while(This->mpFirst) + { + pDelete = This->mpFirst; + This->mpFirst = pDelete->pNext; + SHFree(pDelete->pidl); + SHFree(pDelete); + } + CoTaskMemFree(This); + } + return refCount; +} + +static +HRESULT +WINAPI +IEnumIDList_fnNext( + IEnumIDList * iface, + ULONG celt, + LPITEMIDLIST * rgelt, + ULONG *pceltFetched) +{ + IEnumIDListImpl *This = (IEnumIDListImpl *)iface; + + ULONG i; + HRESULT hr = S_OK; + LPITEMIDLIST temp; + + if(pceltFetched) + *pceltFetched = 0; + + *rgelt=0; + + if(celt > 1 && !pceltFetched) + { + return E_INVALIDARG; + } + + if(celt > 0 && !This->mpCurrent) + { + return S_FALSE; + } + + for(i = 0; i < celt; i++) + { + if(!(This->mpCurrent)) + break; + + temp = ILClone(This->mpCurrent->pidl); + rgelt[i] = temp; + This->mpCurrent = This->mpCurrent->pNext; + } + + if(pceltFetched) + { + *pceltFetched = i; + } + + return hr; +} + +static +HRESULT +WINAPI +IEnumIDList_fnSkip( + IEnumIDList * iface,ULONG celt) +{ + IEnumIDListImpl *This = (IEnumIDListImpl *)iface; + + DWORD dwIndex; + HRESULT hr = S_OK; + + for(dwIndex = 0; dwIndex < celt; dwIndex++) + { + if(!This->mpCurrent) + { + hr = S_FALSE; + break; + } + This->mpCurrent = This->mpCurrent->pNext; + } + return hr; +} + +static +HRESULT +WINAPI +IEnumIDList_fnReset( + IEnumIDList * iface) +{ + IEnumIDListImpl *This = (IEnumIDListImpl *)iface; + + This->mpCurrent = This->mpFirst; + return S_OK; +} + +static +HRESULT +WINAPI +IEnumIDList_fnClone( + IEnumIDList * iface, + LPENUMIDLIST * ppenum) +{ + //IEnumIDListImpl *This = (IEnumIDListImpl *)iface; + + return E_NOTIMPL; +} + +static const IEnumIDListVtbl eidlvt = +{ + IEnumIDList_fnQueryInterface, + IEnumIDList_fnAddRef, + IEnumIDList_fnRelease, + IEnumIDList_fnNext, + IEnumIDList_fnSkip, + IEnumIDList_fnReset, + IEnumIDList_fnClone, +}; + +IEnumIDList * IEnumIDList_Constructor(void) +{ + IEnumIDListImpl *lpeidl = CoTaskMemAlloc(sizeof(IEnumIDListImpl)); + + if (lpeidl) + { + lpeidl->ref = 1; + lpeidl->lpVtbl = &eidlvt; + lpeidl->mpCurrent = NULL; + lpeidl->mpLast = NULL; + lpeidl->mpFirst = NULL; + } + + return (IEnumIDList*)lpeidl; +} + +LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl) +{ + if(pidl && pidl->mkid.cb != 0x00) + return (LPPIDLDATA) &(pidl->mkid.abID); + return NULL; +} + +LPITEMIDLIST _ILAlloc(BYTE type, unsigned int size) +{ + LPITEMIDLIST pidlOut = NULL; + + pidlOut = SHAlloc(size + 5); + if(pidlOut) + { + LPPIDLDATA pData; + + ZeroMemory(pidlOut, size + 5); + pidlOut->mkid.cb = size + 3; + pData = _ILGetDataPointer(pidlOut); + if (pData) + pData->type = type; + + } + + return pidlOut; +} + +LPITEMIDLIST _ILCreateNetConnect() +{ + LPITEMIDLIST pidlOut; + + pidlOut = _ILAlloc(PT_GUID, sizeof(GUIDStruct)); + if (pidlOut) + { + LPPIDLDATA pData = _ILGetDataPointer(pidlOut); + + memcpy(&(pData->u.guid.guid), &CLSID_NetworkConnections, sizeof(GUID)); + } + else + { + pidlOut = NULL; + } + return pidlOut; +} + +IID* _ILGetGUIDPointer(LPCITEMIDLIST pidl) +{ + LPPIDLDATA pdata =_ILGetDataPointer(pidl); + + if (!pdata) + return NULL; + + if (pdata->type != PT_GUID) + return NULL; + else + return &(pdata->u.guid.guid); + +} + +BOOL _ILIsNetConnect(LPCITEMIDLIST pidl) +{ + REFIID iid = _ILGetGUIDPointer(pidl); + + if (iid) + return IsEqualIID(iid, &CLSID_NetworkConnections); + return FALSE; +} + +LPITEMIDLIST ILCreateNetConnectItem(INetConnection * pItem) +{ + LPITEMIDLIST pidl; + LPPIDLDATA pdata; + int size = sizeof(PIDLDATA); + + pidl = (LPITEMIDLIST)SHAlloc(size + 2 * sizeof(SHITEMID)); + if (!pidl) + return pidl; + ZeroMemory(pidl, size + 2 * sizeof(SHITEMID)); + + pidl->mkid.cb = size + sizeof(SHITEMID); + + pdata = _ILGetDataPointer(pidl); + pdata->type = 0x99; + pdata->u.value.dummy = 0xFF; + pdata->u.value.pItem = (PVOID)pItem; + + return pidl; +} + +VALUEStruct * _ILGetValueStruct(LPCITEMIDLIST pidl) +{ + LPPIDLDATA pdata = _ILGetDataPointer(pidl); + + if (pdata && pdata->type==0x99) + return (VALUEStruct*)&(pdata->u.value); + + return NULL; +} diff --git a/reactos/dll/win32/netshell/lanconnectui.c b/reactos/dll/win32/netshell/lanconnectui.c new file mode 100644 index 00000000000..2c211a12e9a --- /dev/null +++ b/reactos/dll/win32/netshell/lanconnectui.c @@ -0,0 +1,468 @@ +#include + +/// CLASSID +/// {7007ACC5-3202-11D1-AAD2-00805FC1270E} +/// open network properties and wlan properties + +typedef enum +{ + NET_TYPE_CLIENT = 1, + NET_TYPE_SERVICE = 2, + NET_TYPE_PROTOCOL = 3 +}NET_TYPE; + +typedef struct +{ + NET_TYPE Type; + DWORD dwCharacteristics; + LPWSTR szHelp; + INetCfgComponent *pNCfgComp; + UINT NumPropDialogOpen; +}NET_ITEM, *PNET_ITEM; + +typedef struct +{ + INetConnectionPropertyUi *lpVtbl; + INetConnection * pCon; + INetCfg * pNCfg; + LONG ref; +}INetConnectionPropertyUiImpl, *LPINetConnectionPropertyUiImpl; + +HPROPSHEETPAGE +InitializePropertySheetPage(LPWSTR resname, DLGPROC dlgproc, LPARAM lParam, LPWSTR szTitle) +{ + PROPSHEETPAGEW ppage; + + memset(&ppage, 0x0, sizeof(PROPSHEETPAGEW)); + ppage.dwSize = sizeof(PROPSHEETPAGEW); + ppage.dwFlags = PSP_DEFAULT; + ppage.u.pszTemplate = resname; + ppage.pfnDlgProc = dlgproc; + ppage.lParam = lParam; + ppage.hInstance = netshell_hInstance; + ppage.pszTitle = szTitle; + if (szTitle) + { + ppage.dwFlags |= PSP_USETITLE; + } + return CreatePropertySheetPageW(&ppage); +} + +VOID +AddItemToListView(HWND hDlgCtrl, PNET_ITEM pItem, LPWSTR szName) +{ + LVITEMW lvItem; + + ZeroMemory(&lvItem, sizeof(lvItem)); + lvItem.mask = LVIF_TEXT | LVIF_PARAM; + lvItem.pszText = szName; + lvItem.lParam = (LPARAM)pItem; + lvItem.iItem = ListView_GetItemCount(hDlgCtrl); + lvItem.iItem = SendMessageW(hDlgCtrl, LVM_INSERTITEMW, 0, (LPARAM)&lvItem); + ListView_SetCheckState(hDlgCtrl, lvItem.iItem, TRUE); +} + +VOID +EnumComponents(HWND hDlgCtrl, INetCfg * pNCfg, const GUID * CompGuid, UINT Type) +{ + HRESULT hr; + IEnumNetCfgComponent * pENetCfg; + INetCfgComponent *pNCfgComp; + ULONG Num; + DWORD dwCharacteristics; + LPOLESTR pDisplayName, pHelpText; + PNET_ITEM pItem; + + + hr = INetCfg_EnumComponents(pNCfg, CompGuid, &pENetCfg); + if (FAILED(hr)) + { + INetCfg_Release(pNCfg); + return; + } + while(IEnumNetCfgComponent_Next(pENetCfg, 1, &pNCfgComp, &Num) == S_OK) + { + hr = INetCfgComponent_GetCharacteristics(pNCfgComp, &dwCharacteristics); + if (SUCCEEDED(hr) && (dwCharacteristics & NCF_HIDDEN)) + { + INetCfgComponent_Release(pNCfgComp); + continue; + } + pDisplayName = NULL; + pHelpText = NULL; + hr = INetCfgComponent_GetDisplayName(pNCfgComp, &pDisplayName); + hr = INetCfgComponent_GetHelpText(pNCfgComp, &pHelpText); + + pItem = CoTaskMemAlloc(sizeof(NET_ITEM)); + if (!pItem) + continue; + pItem->dwCharacteristics = dwCharacteristics; + pItem->szHelp = pHelpText; + pItem->Type = Type; + pItem->pNCfgComp = pNCfgComp; + pItem->NumPropDialogOpen = 0; + AddItemToListView(hDlgCtrl, pItem, pDisplayName); + CoTaskMemFree(pDisplayName); + } + IEnumNetCfgComponent_Release(pENetCfg); +} + + +VOID +InitializeLANPropertiesUIDlg(HWND hwndDlg, INetConnectionPropertyUiImpl * This) +{ + HRESULT hr; + INetCfg * pNCfg; + HWND hDlgCtrl = GetDlgItem(hwndDlg, IDC_COMPONENTSLIST); + LVCOLUMNW lc; + RECT rc; + DWORD dwStyle; + NETCON_PROPERTIES * pProperties; + + hr = INetConnection_GetProperties(This->pCon, &pProperties); + if (FAILED(hr)) + return; + + SendDlgItemMessageW(hwndDlg, IDC_NETCARDNAME, WM_SETTEXT, 0, (LPARAM)pProperties->pszwDeviceName); + if (pProperties->dwCharacter & NCCF_SHOW_ICON) + { + /* check show item on taskbar*/ + SendDlgItemMessageW(hwndDlg, IDC_SHOWTASKBAR, BM_SETCHECK, BST_CHECKED, 0); + } + if (pProperties->dwCharacter & NCCF_NOTIFY_DISCONNECTED) + { + /* check notify item */ + SendDlgItemMessageW(hwndDlg, IDC_NOTIFYNOCONNECTION, BM_SETCHECK, BST_CHECKED, 0); + } + + memset(&lc, 0, sizeof(LV_COLUMN)); + lc.mask = LVCF_TEXT | LVCF_SUBITEM | LVCF_FMT; + lc.fmt = LVCFMT_FIXED_WIDTH; + if (GetClientRect(hDlgCtrl, &rc)) + { + lc.mask |= LVCF_WIDTH; + lc.cx = rc.right - rc.left; + } + lc.pszText = L""; + (void)SendMessageW(hDlgCtrl, LVM_INSERTCOLUMNW, 0, (LPARAM)&lc); + dwStyle = (DWORD) SendMessage(hDlgCtrl, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0); + dwStyle = dwStyle | LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES; + SendMessage(hDlgCtrl, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dwStyle); + + + + hr = CoCreateInstance(&CLSID_CNetCfg, NULL, CLSCTX_INPROC_SERVER, &IID_INetCfg, (LPVOID*)&pNCfg); + if (FAILED(hr)) + return; + + hr = INetCfg_Initialize(pNCfg, NULL); + if (FAILED(hr)) + { + INetCfg_Release(pNCfg); + return; + } + + EnumComponents(hDlgCtrl, pNCfg, &GUID_DEVCLASS_NETCLIENT, NET_TYPE_CLIENT); + EnumComponents(hDlgCtrl, pNCfg, &GUID_DEVCLASS_NETSERVICE, NET_TYPE_SERVICE); + EnumComponents(hDlgCtrl, pNCfg, &GUID_DEVCLASS_NETTRANS, NET_TYPE_PROTOCOL); + This->pNCfg = pNCfg; +} + +VOID +ShowNetworkComponentProperties( + HWND hwndDlg, + INetConnectionPropertyUiImpl * This) +{ + LVITEMW lvItem; + HWND hDlgCtrl; + UINT Index, Count; + HRESULT hr; + INetConnectionPropertyUi * pConUI = NULL; + INetCfgComponent * pNCfgComp; + PNET_ITEM pItem; + INetCfgLock * pLock; + LPWSTR pLockApp; + + hDlgCtrl = GetDlgItem(hwndDlg, IDC_COMPONENTSLIST); + Count = ListView_GetItemCount(hDlgCtrl); + if (!Count) + return; + + + hr = CoCreateInstance(&CLSID_LANConnectUI, + NULL, + CLSCTX_INPROC_SERVER | CLSCTX_NO_CODE_DOWNLOAD, + &IID_INetConnectionPropertyUi, + (LPVOID)&pConUI); + + if (FAILED(hr)) + { + return; + } + hr = INetConnectionPropertyUi_SetConnection(pConUI, This->pCon); + if (FAILED(hr)) + { + INetConnectionPropertyUi_Release(pConUI); + return; + } + + ZeroMemory(&lvItem, sizeof(LVITEMW)); + lvItem.mask = LVIF_PARAM | LVIF_STATE; + lvItem.stateMask = (UINT)-1; + for (Index = 0; Index < Count; Index++) + { + lvItem.iItem = Index; + if (SendMessageW(hDlgCtrl, LVM_GETITEMW, 0, (LPARAM)&lvItem)) + { + if (lvItem.state & LVIS_SELECTED) + break; + } + } + + if (!(lvItem.state & LVIS_SELECTED)) + { + INetConnectionPropertyUi_Release(pConUI); + return; + } + + pItem = (PNET_ITEM)lvItem.lParam; + pNCfgComp = (INetCfgComponent*) pItem->pNCfgComp; + + hr = INetCfg_QueryInterface(This->pNCfg, &IID_INetCfgLock, (LPVOID*)&pLock); + if (FAILED(hr)) + return; + + hr = INetCfgLock_AcquireWriteLock(pLock, 10000, L"", &pLockApp); + if (FAILED(hr)) + { + CoTaskMemFree(pLockApp); + INetConnectionPropertyUi_Release(pConUI); + return; + } + + + hr = INetCfgComponent_RaisePropertyUi(pNCfgComp, GetParent(hwndDlg), NCRP_QUERY_PROPERTY_UI, (IUnknown*)pConUI); + if (SUCCEEDED(hr)) + { + hr = INetCfgComponent_RaisePropertyUi(pNCfgComp, GetParent(hwndDlg), NCRP_SHOW_PROPERTY_UI, (IUnknown*)pConUI); + } + + INetCfgLock_ReleaseWriteLock(pLock); + INetConnectionPropertyUi_Release(pConUI); + +} + + +INT_PTR +CALLBACK +LANPropertiesUIDlg( + HWND hwndDlg, + UINT uMsg, + WPARAM wParam, + LPARAM lParam +) +{ + PROPSHEETPAGE *page; + LPNMLISTVIEW lppl; + LVITEMW li; + PNET_ITEM pItem; + INetConnectionPropertyUiImpl * This; + + switch(uMsg) + { + case WM_INITDIALOG: + page = (PROPSHEETPAGE*)lParam; + This = (INetConnectionPropertyUiImpl*)page->lParam; + InitializeLANPropertiesUIDlg(hwndDlg, This); + SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)This); + return TRUE; + case WM_NOTIFY: + lppl = (LPNMLISTVIEW) lParam; + if (lppl->hdr.code == LVN_ITEMCHANGING) + { + ZeroMemory(&li, sizeof(li)); + li.mask = LVIF_PARAM; + li.iItem = lppl->iItem; + if (!SendMessageW(lppl->hdr.hwndFrom, LVM_GETITEMW, 0, (LPARAM)&li)) + return TRUE; + + pItem = (PNET_ITEM)li.lParam; + if (!pItem) + return TRUE; + + if (!(lppl->uOldState & LVIS_FOCUSED) && (lppl->uNewState & LVIS_FOCUSED)) + { + /* new focused item */ + if (pItem->dwCharacteristics & NCF_NOT_USER_REMOVABLE) + EnableWindow(GetDlgItem(hwndDlg, IDC_UNINSTALL), FALSE); + else + EnableWindow(GetDlgItem(hwndDlg, IDC_UNINSTALL), TRUE); + + if (pItem->dwCharacteristics & NCF_HAS_UI) + EnableWindow(GetDlgItem(hwndDlg, IDC_PROPERTIES), TRUE); + else + EnableWindow(GetDlgItem(hwndDlg, IDC_PROPERTIES), FALSE); + + SendDlgItemMessageW(hwndDlg, IDC_DESCRIPTION, WM_SETTEXT, 0, (LPARAM)pItem->szHelp); + } + } + break; + case WM_COMMAND: + if (LOWORD(wParam) == IDC_PROPERTIES) + { + This = (INetConnectionPropertyUiImpl*) GetWindowLongPtr(hwndDlg, DWLP_USER); + ShowNetworkComponentProperties(hwndDlg, This); + return FALSE; + } + break; + } + return FALSE; +} + +static +HRESULT +WINAPI +INetConnectionPropertyUi_fnQueryInterface( + INetConnectionPropertyUi * iface, + REFIID iid, + LPVOID * ppvObj) +{ + INetConnectionPropertyUiImpl * This = (INetConnectionPropertyUiImpl*)iface; + *ppvObj = NULL; + + if (IsEqualIID (iid, &IID_IUnknown) || + IsEqualIID (iid, &IID_INetConnectionPropertyUi)) + { + *ppvObj = This; + IUnknown_AddRef(iface); + return S_OK; + } + + return E_NOINTERFACE; +} + +static +ULONG +WINAPI +INetConnectionPropertyUi_fnAddRef( + INetConnectionPropertyUi * iface) +{ + INetConnectionPropertyUiImpl * This = (INetConnectionPropertyUiImpl*)iface; + ULONG refCount = InterlockedIncrement(&This->ref); + + return refCount; +} + +static +ULONG +WINAPI +INetConnectionPropertyUi_fnRelease( + INetConnectionPropertyUi * iface) +{ + INetConnectionPropertyUiImpl * This = (INetConnectionPropertyUiImpl*)iface; + ULONG refCount = InterlockedDecrement(&This->ref); + + if (!refCount) + { + CoTaskMemFree (This); + } + return refCount; +} + +static +HRESULT +WINAPI +INetConnectionPropertyUi_fnSetConnection( + INetConnectionPropertyUi * iface, + INetConnection *pCon) +{ + INetConnectionPropertyUiImpl * This = (INetConnectionPropertyUiImpl*)iface; + + if (!pCon) + return E_POINTER; + + if (This->pCon) + INetConnection_Release(This->pCon); + + This->pCon = pCon; + INetConnection_AddRef(This->pCon); + return S_OK; +} + +static +HRESULT +WINAPI +INetConnectionPropertyUi_fnAddPages( + INetConnectionPropertyUi * iface, + HWND hwndParent, + LPFNADDPROPSHEETPAGE pfnAddPage, + LPARAM lParam) +{ + HPROPSHEETPAGE hProp; + BOOL ret; + HRESULT hr = E_FAIL; + INITCOMMONCONTROLSEX initEx; + NETCON_PROPERTIES * pProperties; + INetConnectionPropertyUiImpl * This = (INetConnectionPropertyUiImpl*)iface; + + + initEx.dwSize = sizeof(initEx); + initEx.dwICC = ICC_LISTVIEW_CLASSES; + if(!InitCommonControlsEx(&initEx)) + return E_FAIL; + + hr = INetConnection_GetProperties(This->pCon, &pProperties); + if (FAILED(hr)) + return hr; + + hProp = InitializePropertySheetPage(MAKEINTRESOURCEW(IDD_NETPROPERTIES), LANPropertiesUIDlg, (LPARAM)This, pProperties->pszwName); + if (hProp) + { + ret = (*pfnAddPage)(hProp, lParam); + if (ret) + { + hr = NOERROR; + } + DestroyPropertySheetPage(hProp); + } + //NcFreeNetconProperties(pProperties); + return hr; +} + +static const INetConnectionPropertyUiVtbl vt_NetConnectionPropertyUi = +{ + INetConnectionPropertyUi_fnQueryInterface, + INetConnectionPropertyUi_fnAddRef, + INetConnectionPropertyUi_fnRelease, + INetConnectionPropertyUi_fnSetConnection, + INetConnectionPropertyUi_fnAddPages, +}; + +HRESULT WINAPI LanConnectUI_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv) +{ + INetConnectionPropertyUiImpl * This; + + if (!ppv) + return E_POINTER; + + if (pUnkOuter) + return CLASS_E_NOAGGREGATION; + + This = (INetConnectionPropertyUiImpl *) CoTaskMemAlloc(sizeof (INetConnectionPropertyUiImpl)); + if (!This) + return E_OUTOFMEMORY; + + This->ref = 1; + This->pCon = NULL; + This->pNCfg = NULL; + This->lpVtbl = (INetConnectionPropertyUi*)&vt_NetConnectionPropertyUi; + + if (!SUCCEEDED (INetConnectionPropertyUi_fnQueryInterface ((INetConnectionPropertyUi*)This, riid, ppv))) + { + IUnknown_Release((IUnknown*)This); + return E_NOINTERFACE; + } + + IUnknown_Release((IUnknown*)This); + return S_OK; +} diff --git a/reactos/dll/win32/netshell/lang/bg-BG.rc b/reactos/dll/win32/netshell/lang/bg-BG.rc new file mode 100644 index 00000000000..193ecae5b81 --- /dev/null +++ b/reactos/dll/win32/netshell/lang/bg-BG.rc @@ -0,0 +1,20 @@ +LANGUAGE LANG_BULGARIAN, SUBLANG_DEFAULT + +STRINGTABLE DISCARDABLE +BEGIN + IDS_NETWORKCONNECTION "Мрежово свързване" + IDS_SHV_COLUMN_NAME "Име" + IDS_SHV_COLUMN_TYPE "Вид" + IDS_SHV_COLUMN_STATE "Състояние" + IDS_SHV_COLUMN_DEVNAME "Име на устройството" + IDS_SHV_COLUMN_PHONE "Телефонен № или приемник" + IDS_SHV_COLUMN_OWNER "Собственик" + IDS_TYPE_ETHERNET "Местна мрежа или високоскоростен интернет" + IDS_STATUS_NON_OPERATIONAL "Забранен" + IDS_STATUS_UNREACHABLE "Несвързан" + IDS_STATUS_DISCONNECTED "Откачен е мрежов кабел" + IDS_STATUS_CONNECTING "Получаване на мрежов адрес" + IDS_STATUS_CONNECTED "Свързан" + IDS_STATUS_OPERATIONAL "Свързан" +END + diff --git a/reactos/dll/win32/netshell/lang/de-DE.rc b/reactos/dll/win32/netshell/lang/de-DE.rc new file mode 100644 index 00000000000..b497886071d --- /dev/null +++ b/reactos/dll/win32/netshell/lang/de-DE.rc @@ -0,0 +1,74 @@ +LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL + +IDD_NETPROPERTIES DIALOGEX DISCARDABLE 0, 0, 246, 246 +STYLE DS_SHELLFONT | WS_CHILD | WS_CAPTION +CAPTION "Allgemein" +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "List3", IDC_COMPONENTSLIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP | LVS_EX_FULLROWSELECT, 9, 71, 230, 55 + LTEXT "Verbindung herstellen ьber:", -1, 9,9,217,8 + EDITTEXT IDC_NETCARDNAME, 9, 21, 230, 12, WS_BORDER | WS_TABSTOP | ES_READONLY + PUSHBUTTON "&Konfigurieren", IDC_CONFIGURE, 189, 38, 50, 14 + LTEXT "Diese &Verbindung verwendet folgende Elemente:", -1, 9, 59, 217, 8 + PUSHBUTTON "&Installieren", IDC_INSTALL, 9, 130, 65, 14, WS_DISABLED | WS_TABSTOP + PUSHBUTTON "&Deinstallieren", IDC_UNINSTALL, 90, 130, 65, 14, WS_DISABLED | WS_TABSTOP + PUSHBUTTON "&Eigenschaften", IDC_PROPERTIES, 174, 130, 65, 14 + GROUPBOX "Beschreibung", -1, 9, 153, 230, 46, BS_GROUPBOX + LTEXT "Hier wird die Beschreibung des Elementes stehen....", IDC_DESCRIPTION, 15, 165, 217, 28, WS_GROUP + CHECKBOX "&Symbol bei Verbindung im Infobereich anzeigen", IDC_SHOWTASKBAR, 9, 206, 230, 12, BS_AUTOCHECKBOX | WS_TABSTOP + CHECKBOX "&Benachrichtigen, wenn diese Verbindung eingeschrдnkte oder\nkeine Konnektivitдt besitzt", IDC_NOTIFYNOCONNECTION, 9, 220, 230, 24, BS_AUTOCHECKBOX | WS_TABSTOP +END + +IDD_NETSTATUS DIALOGEX DISCARDABLE 0, 0, 200,180 +STYLE DS_SHELLFONT | WS_CHILD | WS_CAPTION +CAPTION "Allgemein" +FONT 8, "MS Shell Dlg" +BEGIN + GROUPBOX "Allgemein", -1, 9, 8, 182, 58, BS_GROUPBOX + LTEXT "Status:", -1, 19, 20, 60, 8 + LTEXT "Dauer:", -1, 19, 34, 60, 8 + LTEXT "Ьbertragungsrate:", -1, 19, 48, 60, 8 + GROUPBOX "Aktivitдt", -1, 9, 74, 182, 70, BS_GROUPBOX + RTEXT "Gesendet", -1, 26, 90, 60, 8 + ICON IDI_HORIZONTAL, -1, 90, 85, 18, 20 + ICON IDI_NETSTAT, -1, 110, 85, 18, 20 + ICON IDI_HORIZONTAL, -1, 130, 85, 18, 20 + LTEXT "Empfangen", -1, 149, 90, 37, 8 + LTEXT "Bytes:", -1, 17, 115, 32, 8 + RTEXT "000.000.000", IDC_SEND, 63, 115, 44, 8 + ICON IDI_VERTICAL, -1, 110, 108, 18, 20 + RTEXT "000.000.000", IDC_RECEIVED, 139, 115, 44, 8 + PUSHBUTTON "E&igenschaften", IDC_STATUS_PROPERTIES, 10, 150, 50, 14 + PUSHBUTTON "&Deaktivieren", IDC_ENDISABLE, 66, 150, 50, 14 + RTEXT "",IDC_STATUS,83,20,98,8 + RTEXT "",IDC_DURATION,83,34,98,8 + RTEXT "",IDC_SPEED,83,48,98,8 +END + + +STRINGTABLE DISCARDABLE +BEGIN + IDS_NETWORKCONNECTION "Netzwerkverbindungen" + IDS_SHV_COLUMN_NAME "Name" + IDS_SHV_COLUMN_TYPE "Typ" + IDS_SHV_COLUMN_STATE "Status" + IDS_SHV_COLUMN_DEVNAME "Gerдtename" + IDS_SHV_COLUMN_PHONE "Rufnummer oder Hostaddresse" + IDS_SHV_COLUMN_OWNER "Besitzer" + IDS_TYPE_ETHERNET "LAN oder Hochgeschwindigkeitsinternet" + IDS_STATUS_NON_OPERATIONAL "Deaktiviert" + IDS_STATUS_UNREACHABLE "Nicht verbunden" + IDS_STATUS_DISCONNECTED "Netzwerkkabel wurde entfernt" + IDS_STATUS_CONNECTING "Netzwerkaddresse beziehen" + IDS_STATUS_CONNECTED "Verbindung hergestellt" + IDS_STATUS_OPERATIONAL "Verbindung hergestellt" + + IDS_NET_ACTIVATE "Aktivieren" + IDS_NET_DEACTIVATE "Deaktivieren" + IDS_NET_STATUS "Status" + IDS_NET_REPAIR "Reparieren" + IDS_NET_CREATELINK "Verknьpfung erstellen" + IDS_NET_DELETE "Lцschen" + IDS_NET_RENAME "Umbenennen" + IDS_NET_PROPERTIES "Eigenschaften" +END diff --git a/reactos/dll/win32/netshell/lang/en-US.rc b/reactos/dll/win32/netshell/lang/en-US.rc new file mode 100644 index 00000000000..a4cf3995dc1 --- /dev/null +++ b/reactos/dll/win32/netshell/lang/en-US.rc @@ -0,0 +1,74 @@ +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +IDD_NETPROPERTIES DIALOGEX DISCARDABLE 0, 0, 246, 246 +STYLE DS_SHELLFONT | WS_CHILD | WS_CAPTION +CAPTION "General" +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "", IDC_COMPONENTSLIST, "SysListView32", LVS_LIST | LVS_SHAREIMAGELISTS | WS_BORDER | WS_TABSTOP, 9, 71, 230, 55 + LTEXT "Connect Using:", -1, 9,9,217,8 + EDITTEXT IDC_NETCARDNAME, 9, 21, 230, 12, WS_BORDER | WS_DISABLED | WS_TABSTOP + PUSHBUTTON "&Configure", IDC_CONFIGURE, 189, 38, 50, 14 + LTEXT "Components checked are used by this connection:", -1, 9, 59, 217, 8 + PUSHBUTTON "&Install", IDC_INSTALL, 9, 130, 65, 14, WS_DISABLED | WS_TABSTOP + PUSHBUTTON "&Uninstall", IDC_UNINSTALL, 90, 130, 65, 14, WS_DISABLED | WS_TABSTOP + PUSHBUTTON "&Properties", IDC_PROPERTIES, 174, 130, 65, 14 + GROUPBOX "Description", -1, 9, 153, 230, 46, BS_GROUPBOX + LTEXT "Component Description goes here...", IDC_DESCRIPTION, 15, 165, 217, 28, WS_GROUP + CHECKBOX "Show Icon in taskbar when connected", IDC_SHOWTASKBAR, 9, 206, 230, 12, BS_AUTOCHECKBOX | WS_TABSTOP + CHECKBOX "Notify me when this connection has limited or no connectivity", IDC_NOTIFYNOCONNECTION, 9, 220, 230, 12, BS_AUTOCHECKBOX | WS_TABSTOP +END + +IDD_NETSTATUS DIALOGEX DISCARDABLE 0, 0, 200,180 +STYLE DS_SHELLFONT | WS_CHILD | WS_CAPTION +CAPTION "General" +FONT 8, "MS Shell Dlg" +BEGIN + GROUPBOX "Connection", -1, 9, 8, 182, 58, BS_GROUPBOX + LTEXT "Status:", -1, 19, 20, 60, 8 + LTEXT "Duration:", -1, 19, 34, 60, 8 + LTEXT "Speed:", -1, 19, 48, 60, 8 + GROUPBOX "Activity", -1, 9, 74, 182, 70, BS_GROUPBOX + RTEXT "Sent", -1, 26, 90, 60, 8 + ICON IDI_HORIZONTAL, -1, 90, 85, 18, 20 + ICON IDI_NETSTAT, -1, 110, 85, 18, 20 + ICON IDI_HORIZONTAL, -1, 130, 85, 18, 20 + LTEXT "Received", -1, 149, 90, 37, 8 + LTEXT "Bytes:", -1, 17, 115, 32, 8 + RTEXT "000.000.000", IDC_SEND, 63, 115, 44, 8 + ICON IDI_VERTICAL, -1, 110, 108, 18, 20 + RTEXT "000.000.000", IDC_RECEIVED, 139, 115, 44, 8 + PUSHBUTTON "&Properties", IDC_STATUS_PROPERTIES, 10, 150, 50, 14 + PUSHBUTTON "&Disable", IDC_ENDISABLE, 66, 150, 50, 14 + RTEXT "",IDC_STATUS,83,20,98,8 + RTEXT "",IDC_DURATION,83,34,98,8 + RTEXT "",IDC_SPEED,83,48,98,8 +END + + +STRINGTABLE DISCARDABLE +BEGIN + IDS_NETWORKCONNECTION "Network Connection" + IDS_SHV_COLUMN_NAME "Name" + IDS_SHV_COLUMN_TYPE "Type" + IDS_SHV_COLUMN_STATE "Status" + IDS_SHV_COLUMN_DEVNAME "Device Name" + IDS_SHV_COLUMN_PHONE "Phone # or Host Address" + IDS_SHV_COLUMN_OWNER "Owner" + IDS_TYPE_ETHERNET "LAN or High-Speed Internet" + IDS_STATUS_NON_OPERATIONAL "Disabled" + IDS_STATUS_UNREACHABLE "Not Connected" + IDS_STATUS_DISCONNECTED "Network cable unplugged" + IDS_STATUS_CONNECTING "Acquiring network address" + IDS_STATUS_CONNECTED "Connected" + IDS_STATUS_OPERATIONAL "Connected" + + IDS_NET_ACTIVATE "Enable" + IDS_NET_DEACTIVATE "Disable" + IDS_NET_STATUS "Status" + IDS_NET_REPAIR "Repair" + IDS_NET_CREATELINK "Create Shortcut" + IDS_NET_DELETE "Delete" + IDS_NET_PROPERTIES "Properties" +END + diff --git a/reactos/dll/win32/netshell/lang/pl-PL.rc b/reactos/dll/win32/netshell/lang/pl-PL.rc new file mode 100644 index 00000000000..1b5eae4470d --- /dev/null +++ b/reactos/dll/win32/netshell/lang/pl-PL.rc @@ -0,0 +1,20 @@ +LANGUAGE LANG_POLISH, SUBLANG_DEFAULT + +STRINGTABLE DISCARDABLE +BEGIN + IDS_NETWORKCONNECTION "Poі№czenie sieciowe" + IDS_SHV_COLUMN_NAME "Nazwa" + IDS_SHV_COLUMN_TYPE "Typ" + IDS_SHV_COLUMN_STATE "Status" + IDS_SHV_COLUMN_DEVNAME "Nazwa urz№dzenia" + IDS_SHV_COLUMN_PHONE "Numer telefonu lub adres hosta" + IDS_SHV_COLUMN_OWNER "Wіaњciciel" + IDS_TYPE_ETHERNET "Sieж LAN lub szerokopasmowy Internet" + IDS_STATUS_NON_OPERATIONAL "Wyі№czony" + IDS_STATUS_UNREACHABLE "Niepoі№czony" + IDS_STATUS_DISCONNECTED "Kabel sieciowy odі№czony" + IDS_STATUS_CONNECTING "Pobieranie adresu sieciowego" + IDS_STATUS_CONNECTED "Poі№czony" + IDS_STATUS_OPERATIONAL "Poі№czony" +END + diff --git a/reactos/dll/win32/netshell/lang/ru-RU.rc b/reactos/dll/win32/netshell/lang/ru-RU.rc new file mode 100644 index 00000000000..91c8fff75dd --- /dev/null +++ b/reactos/dll/win32/netshell/lang/ru-RU.rc @@ -0,0 +1,73 @@ +LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT + +IDD_NETPROPERTIES DIALOGEX DISCARDABLE 0, 0, 246, 246 +STYLE DS_SHELLFONT | WS_CHILD | WS_CAPTION +CAPTION "Общие" +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "", IDC_COMPONENTSLIST, "SysListView32", LVS_LIST | LVS_SHAREIMAGELISTS | WS_BORDER | WS_TABSTOP, 9, 71, 230, 55 + LTEXT "Подключение через:", -1, 9, 9, 217, 8 + EDITTEXT IDC_NETCARDNAME, 9, 21, 230, 12, WS_BORDER | WS_DISABLED | WS_TABSTOP + PUSHBUTTON "&Настроить...", IDC_CONFIGURE, 174, 38, 65, 14 + LTEXT "Отмеченые компоненты используются этим подключением:", -1, 9, 59, 217, 8 + PUSHBUTTON "&Установить...", IDC_INSTALL, 9, 130, 65, 14, WS_DISABLED | WS_TABSTOP + PUSHBUTTON "&Удалить", IDC_UNINSTALL, 90, 130, 65, 14, WS_DISABLED | WS_TABSTOP + PUSHBUTTON "&Свойства", IDC_PROPERTIES, 174, 130, 65, 14 + GROUPBOX "Описание", -1, 9, 153, 230, 46, BS_GROUPBOX + LTEXT "Свойства компонента перечислены ниже...", IDC_DESCRIPTION, 15, 165, 217, 28, WS_GROUP + CHECKBOX "Отображать значек в трее при установленом соединении", IDC_SHOWTASKBAR, 9, 206, 230, 12, BS_AUTOCHECKBOX | WS_TABSTOP + CHECKBOX "Оповещать в случае разрыва соединения", IDC_NOTIFYNOCONNECTION, 9, 220, 230, 12, BS_AUTOCHECKBOX | WS_TABSTOP +END + +IDD_NETSTATUS DIALOGEX DISCARDABLE 0, 0, 216, 180 +STYLE DS_SHELLFONT | WS_CHILD | WS_CAPTION +CAPTION "Общие" +FONT 8, "MS Shell Dlg" +BEGIN + GROUPBOX "Подключение", -1, 9, 8, 198, 58, BS_GROUPBOX + LTEXT "Состояние:", -1, 19, 20, 60, 8 + LTEXT "Длительность:", -1, 19, 34, 60, 8 + LTEXT "Скорость:", -1, 19, 48, 60, 8 + GROUPBOX "Активность", -1, 9, 74, 198, 70, BS_GROUPBOX + RTEXT "Отправлено", -1, 20, 90, 60, 8 + ICON IDI_HORIZONTAL, -1, 90, 85, 18, 20 + ICON IDI_NETSTAT, -1, 110, 85, 18, 20 + ICON IDI_HORIZONTAL, -1, 130, 85, 18, 20 + LTEXT "Принято", -1, 158, 90, 37, 8 + LTEXT "Байт:", -1, 17, 115, 32, 8 + RTEXT "000.000.000", IDC_SEND, 54, 115, 44, 8 + ICON IDI_VERTICAL, -1, 110, 108, 18, 20 + RTEXT "000.000.000", IDC_RECEIVED, 139, 115, 46, 8 + PUSHBUTTON "&Свойства", IDC_STATUS_PROPERTIES, 10, 150, 50, 14 + PUSHBUTTON "&Отключить", IDC_ENDISABLE, 66, 150, 50, 14 + RTEXT "", IDC_STATUS, 100, 20, 98, 8 + RTEXT "", IDC_DURATION, 100, 34, 98, 8 + RTEXT "", IDC_SPEED, 100, 48, 98, 8 +END + + +STRINGTABLE DISCARDABLE +BEGIN + IDS_NETWORKCONNECTION "Сетевые подключения" + IDS_SHV_COLUMN_NAME "Имя" + IDS_SHV_COLUMN_TYPE "Тип" + IDS_SHV_COLUMN_STATE "Состояние" + IDS_SHV_COLUMN_DEVNAME "Имя устройства" + IDS_SHV_COLUMN_PHONE "Номер телефона или адрес узла" + IDS_SHV_COLUMN_OWNER "Владелец" + IDS_TYPE_ETHERNET "ЛВС или высокоскоростной Интернет" + IDS_STATUS_NON_OPERATIONAL "Отключено" + IDS_STATUS_UNREACHABLE "Отключено" + IDS_STATUS_DISCONNECTED "Сетевой кабель не подключен" + IDS_STATUS_CONNECTING "Получение сетевого адреса" + IDS_STATUS_CONNECTED "Подключено" + IDS_STATUS_OPERATIONAL "Подключено" + + IDS_NET_ACTIVATE "Включить" + IDS_NET_DEACTIVATE "Отключить" + IDS_NET_STATUS "Состояние" + IDS_NET_REPAIR "Исправить" + IDS_NET_CREATELINK "Создать ярлык" + IDS_NET_DELETE "Удалить" + IDS_NET_PROPERTIES "Свойства" +END diff --git a/reactos/dll/win32/netshell/lanstatusui.c b/reactos/dll/win32/netshell/lanstatusui.c new file mode 100644 index 00000000000..5b8591cb69f --- /dev/null +++ b/reactos/dll/win32/netshell/lanstatusui.c @@ -0,0 +1,170 @@ +#include + + +/// CLSID +/// HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{7007ACCF-3202-11D1-AAD2-00805FC1270E} +// IID B722BCCB-4E68-101B-A2BC-00AA00404770 +typedef struct +{ + IOleCommandTarget * lpVtbl; + LONG ref; +}ILanStatusImpl, *LPILanStatusImpl; + + +INT_PTR +CALLBACK +LANStatusUIDlg( + HWND hwndDlg, + UINT uMsg, + WPARAM wParam, + LPARAM lParam +) +{ + switch(uMsg) + { + case WM_INITDIALOG: + return TRUE; + } + return FALSE; +} + + + +static +HRESULT +WINAPI +IOleCommandTarget_fnQueryInterface( + IOleCommandTarget * iface, + REFIID iid, + LPVOID * ppvObj) +{ + ILanStatusImpl * This = (ILanStatusImpl*)iface; + *ppvObj = NULL; + + if (IsEqualIID (iid, &IID_IUnknown) || + IsEqualIID (iid, &IID_IOleCommandTarget)) + { + *ppvObj = This; + IUnknown_AddRef(iface); + return S_OK; + } + + return E_NOINTERFACE; +} + +static +ULONG +WINAPI +IOleCommandTarget_fnAddRef( + IOleCommandTarget * iface) +{ + ILanStatusImpl * This = (ILanStatusImpl*)iface; + ULONG refCount = InterlockedIncrement(&This->ref); + + return refCount; +} + +static +ULONG +WINAPI +IOleCommandTarget_fnRelease( + IOleCommandTarget * iface) +{ + ILanStatusImpl * This = (ILanStatusImpl*)iface; + ULONG refCount = InterlockedDecrement(&This->ref); + + if (!refCount) + { + CoTaskMemFree (This); + } + return refCount; +} + +static +HRESULT +WINAPI +IOleCommandTarget_fnQueryStatus( + IOleCommandTarget * iface, + const GUID *pguidCmdGroup, + ULONG cCmds, + OLECMD *prgCmds, + OLECMDTEXT *pCmdText) +{ + MessageBoxW(NULL, L"IOleCommandTarget_fnQueryStatus", NULL, MB_OK); + return E_NOTIMPL; +} + +static +HRESULT +WINAPI +IOleCommandTarget_fnExec( + IOleCommandTarget * iface, + const GUID *pguidCmdGroup, + DWORD nCmdID, + DWORD nCmdexecopt, + VARIANT *pvaIn, + VARIANT *pvaOut) +{ + NOTIFYICONDATA nid; + HWND hwndDlg; + //ILanStatusImpl * This = (ILanStatusImpl*)iface; + + hwndDlg = CreateDialogW(netshell_hInstance, MAKEINTRESOURCEW(IDD_NETSTATUS), NULL, LANStatusUIDlg); + if (pguidCmdGroup) + { + if (IsEqualIID(pguidCmdGroup, &CGID_ShellServiceObject)) + { + nid.cbSize = sizeof(nid); + nid.uID = 100; + nid.uFlags = NIF_ICON; + nid.u.uVersion = NOTIFYICON_VERSION; + nid.hWnd = hwndDlg; + nid.hIcon = LoadIcon(netshell_hInstance, MAKEINTRESOURCE(IDI_SHELL_NETWORK_FOLDER)); + + Shell_NotifyIcon(NIM_ADD, &nid); + return S_OK; + } + } + return S_OK; +} + + +static const IOleCommandTargetVtbl vt_OleCommandTarget = +{ + IOleCommandTarget_fnQueryInterface, + IOleCommandTarget_fnAddRef, + IOleCommandTarget_fnRelease, + IOleCommandTarget_fnQueryStatus, + IOleCommandTarget_fnExec, +}; + + +HRESULT WINAPI LanConnectStatusUI_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv) +{ + ILanStatusImpl * This; + + if (!ppv) + return E_POINTER; + + if (pUnkOuter) + return CLASS_E_NOAGGREGATION; + + This = (ILanStatusImpl *) CoTaskMemAlloc(sizeof (ILanStatusImpl)); + if (!This) + return E_OUTOFMEMORY; + + This->ref = 1; + This->lpVtbl = (IOleCommandTarget*)&vt_OleCommandTarget; + + if (!SUCCEEDED (IOleCommandTarget_fnQueryInterface ((IOleCommandTarget*)This, riid, ppv))) + { + IOleCommandTarget_Release((IUnknown*)This); + return E_NOINTERFACE; + } + + IOleCommandTarget_Release((IUnknown*)This); + return S_OK; +} + + + diff --git a/reactos/dll/win32/netshell/netshell.c b/reactos/dll/win32/netshell/netshell.c new file mode 100644 index 00000000000..9d1b0b39ba1 --- /dev/null +++ b/reactos/dll/win32/netshell/netshell.c @@ -0,0 +1,200 @@ +#include "precomp.h" +#include +#include + +HINSTANCE netshell_hInstance; +const GUID CLSID_LANConnectUI = {0x7007ACC5, 0x3202, 0x11D1, {0xAA, 0xD2, 0x00, 0x80, 0x5F, 0xC1, 0x27, 0x0E}}; +const GUID CLSID_NetworkConnections = {0x7007ACC7, 0x3202, 0x11D1, {0xAA, 0xD2, 0x00, 0x80, 0x5F, 0xC1, 0x27, 0x0E}}; +const GUID CLSID_LanConnectStatusUI = {0x7007ACCF, 0x3202, 0x11D1, {0xAA, 0xD2, 0x00, 0x80, 0x5F, 0xC1, 0x27, 0x0E}}; + +static const WCHAR szNetConnectClass[] = L"CLSID\\{7007ACC7-3202-11D1-AAD2-00805FC1270E}"; +static const WCHAR szLanConnectUI[] = L"CLSID\\{7007ACC5-3202-11D1-AA-D200805FC1270E}"; +static const WCHAR szLanConnectStatusUI[] = L"CLSID\\{7007ACCF-3202-11D1-AA-D200805FC1270E}"; +static const WCHAR szNamespaceKey[] = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ControlPanel\\NameSpace\\{7007ACC7-3202-11D1-AAD2-00805FC1270E}"; + +static INTERFACE_TABLE InterfaceTable[] = +{ + { + &CLSID_NetworkConnections, + ISF_NetConnect_Constructor + }, + { + &CLSID_ConnectionManager, + INetConnectionManager_Constructor + }, + { + &CLSID_LANConnectUI, + LanConnectUI_Constructor + }, + { + &CLSID_LanConnectStatusUI, + LanConnectStatusUI_Constructor + }, + { + NULL, + NULL + } +}; + + +BOOL +WINAPI +DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad) +{ + switch (fdwReason) + { + case DLL_PROCESS_ATTACH: + netshell_hInstance = hinstDLL; + DisableThreadLibraryCalls(netshell_hInstance); + break; + default: + break; + } + + return TRUE; +} + +HRESULT +WINAPI +DllCanUnloadNow(void) +{ + return S_FALSE; +} + +STDAPI +DllRegisterServer(void) +{ + HKEY hKey, hSubKey; + WCHAR szName[MAX_PATH+20] = {0}; + WCHAR szNet[20]; + UINT Length, Offset; + + + if (RegCreateKeyExW(HKEY_CLASSES_ROOT, szNetConnectClass, 0, NULL, 0, KEY_WRITE, NULL, &hKey, NULL) != ERROR_SUCCESS) + return SELFREG_E_CLASS; + + if (LoadStringW(netshell_hInstance, IDS_NETWORKCONNECTION, szName, MAX_PATH)) + { + szName[MAX_PATH-1] = L'\0'; + RegSetValueW(hKey, NULL, REG_SZ, szName, (wcslen(szName)+1) * sizeof(WCHAR)); + } + + if (RegCreateKeyExW(HKEY_LOCAL_MACHINE, szNamespaceKey, 0, NULL, 0, KEY_WRITE, NULL, &hSubKey, NULL) == ERROR_SUCCESS) + { + RegSetValueW(hSubKey, NULL, REG_SZ, szName, (wcslen(szName)+1) * sizeof(WCHAR)); + RegCloseKey(hSubKey); + } + + Length = swprintf(szNet, L",-%u", IDS_NETWORKCONNECTION); + Offset = GetModuleFileNameW(netshell_hInstance, &szName[1], (sizeof(szName)/sizeof(WCHAR))-1); + if (Offset + Length + 2 < MAX_PATH) + { + /* set localized name */ + szName[0] = L'@'; + wcscpy(&szName[Offset+1], szNet); + RegSetValueExW(hKey, L"LocalizedString", 0, REG_SZ, (const LPBYTE)szName, (wcslen(szName)+1) * sizeof(WCHAR)); + } + + szName[Offset+1] = L'\0'; + + /* store default icon */ + if (RegCreateKeyExW(hKey, L"DefaultIcon", 0, NULL, 0, KEY_WRITE, NULL, &hSubKey, NULL) == ERROR_SUCCESS) + { + RegSetValueW(hSubKey, NULL, REG_SZ, &szName[1], (Offset+1) * sizeof(WCHAR)); + RegCloseKey(hSubKey); + } + if (RegCreateKeyExW(hKey, L"InProcServer32", 0, NULL, 0, KEY_WRITE, NULL, &hSubKey, NULL) == ERROR_SUCCESS) + { + RegSetValueW(hSubKey, NULL, REG_SZ, &szName[1], (Offset+1) * sizeof(WCHAR)); + RegSetValueExW(hSubKey, L"ThreadingModel", 0, REG_SZ, (LPBYTE)L"Both", 10); + RegCloseKey(hSubKey); + } + + if (RegCreateKeyExW(hKey, L"ShellFolder", 0, NULL, 0, KEY_WRITE, NULL, &hSubKey, NULL) == ERROR_SUCCESS) + { + DWORD dwAttributes = SFGAO_FOLDER; + RegSetValueExW(hSubKey, L"Attributes",0, REG_BINARY, (const LPBYTE)&dwAttributes, sizeof(DWORD)); + } + + RegCloseKey(hKey); + + if (RegCreateKeyExW(HKEY_CLASSES_ROOT, szLanConnectUI, 0, NULL, 0, KEY_WRITE, NULL, &hKey, NULL) != ERROR_SUCCESS) + return SELFREG_E_CLASS; + + if (RegCreateKeyExW(hKey, L"InProcServer32", 0, NULL, 0, KEY_WRITE, NULL, &hSubKey, NULL) == ERROR_SUCCESS) + { + RegSetValueW(hSubKey, NULL, REG_SZ, &szName[1], (Offset+1) * sizeof(WCHAR)); + RegSetValueExW(hSubKey, L"ThreadingModel", 0, REG_SZ, (LPBYTE)L"Both", 10); + RegCloseKey(hSubKey); + } + + RegCloseKey(hKey); + + if (RegCreateKeyExW(HKEY_CLASSES_ROOT, szLanConnectStatusUI, 0, NULL, 0, KEY_WRITE, NULL, &hKey, NULL) != ERROR_SUCCESS) + return SELFREG_E_CLASS; + + if (RegCreateKeyExW(hKey, L"InProcServer32", 0, NULL, 0, KEY_WRITE, NULL, &hSubKey, NULL) == ERROR_SUCCESS) + { + RegSetValueW(hSubKey, NULL, REG_SZ, &szName[1], (Offset+1) * sizeof(WCHAR)); + RegSetValueExW(hSubKey, L"ThreadingModel", 0, REG_SZ, (LPBYTE)L"Both", 10); + RegCloseKey(hSubKey); + } + + RegCloseKey(hKey); + + + return S_OK; +} + +STDAPI +DllUnregisterServer(void) +{ + SHDeleteKeyW(HKEY_CLASSES_ROOT, szNetConnectClass); + SHDeleteKeyW(HKEY_LOCAL_MACHINE, szNamespaceKey); + return S_OK; +} + +STDAPI +DllGetClassObject( + REFCLSID rclsid, + REFIID riid, + LPVOID* ppv +) +{ + UINT i; + HRESULT hres = E_OUTOFMEMORY; + IClassFactory * pcf = NULL; + + if (!ppv) + return E_INVALIDARG; + + *ppv = NULL; + + for (i = 0; InterfaceTable[i].riid; i++) + { + if (IsEqualIID(InterfaceTable[i].riid, rclsid)) + { + pcf = IClassFactory_fnConstructor(InterfaceTable[i].lpfnCI, NULL, NULL); + break; + } + } + + if (!pcf) + { + return CLASS_E_CLASSNOTAVAILABLE; + } + + hres = IClassFactory_QueryInterface(pcf, riid, ppv); + IClassFactory_Release(pcf); + + return hres; +} + +VOID +STDCALL +NcFreeNetconProperties (NETCON_PROPERTIES* pProps) +{ + CoTaskMemFree(pProps->pszwName); + CoTaskMemFree(pProps->pszwDeviceName); + CoTaskMemFree(pProps); +} diff --git a/reactos/dll/win32/netshell/netshell.rbuild b/reactos/dll/win32/netshell/netshell.rbuild new file mode 100644 index 00000000000..6e9f8e83f2c --- /dev/null +++ b/reactos/dll/win32/netshell/netshell.rbuild @@ -0,0 +1,31 @@ + + + + . + 0x600 + 0x600 + 0x600 + + shlwapi + shell32 + version + iphlpapi + kernel32 + wine + ole32 + user32 + uuid + advapi32 + setupapi + comctl32 + precomp.h + netshell.c + shfldr_netconnect.c + enumlist.c + netshell.rc + classfactory.c + connectmanager.c + netshell.spec + lanconnectui.c + lanstatusui.c + diff --git a/reactos/dll/win32/netshell/netshell.rc b/reactos/dll/win32/netshell/netshell.rc new file mode 100644 index 00000000000..6d0971f51bd --- /dev/null +++ b/reactos/dll/win32/netshell/netshell.rc @@ -0,0 +1,24 @@ +#include +#include "shlobj.h" +#include "resource.h" + +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL + + +#define REACTOS_VERSION_DLL +#define REACTOS_STR_FILE_DESCRIPTION "Shell for Network Connections\0" +#define REACTOS_STR_INTERNAL_NAME "netshell.dll\0" +#define REACTOS_STR_ORIGINAL_FILENAME "netshell.dll\0" +#define REACTOS_STR_PRODUCT_VERSION "5.1.2600.3264\0" +#define REACTOS_STR_FILE_VERSION "5.1.2600.3264\0" + +#include + + +IDI_SHELL_NETWORK_FOLDER ICON "res/netshell.ico" + +#include "lang/bg-BG.rc" +#include "lang/de-DE.rc" +#include "lang/en-US.rc" +#include "lang/pl-PL.rc" +#include "lang/ru-RU.rc" diff --git a/reactos/dll/win32/netshell/netshell.spec b/reactos/dll/win32/netshell/netshell.spec new file mode 100644 index 00000000000..1561c749334 --- /dev/null +++ b/reactos/dll/win32/netshell/netshell.spec @@ -0,0 +1,34 @@ + +1 stub DoInitialCleanup +2 stdcall DllCanUnloadNow() +3 stdcall DllGetClassObject(ptr ptr ptr) +4 stdcall DllRegisterServer() +5 stdcall DllUnregisterServer() +6 stub HrCreateDesktopIcon +7 stub HrGetAnswerFileParametersForNetCard +8 stub HrGetExtendedStatusFromNCS +9 stub HrGetIconFromMediaType +10 stub HrGetInstanceGuidOfPreNT5NetCardInstance +11 stub HrGetNetConExtendedStatusFromGuid +12 stub HrGetNetConExtendedStatusFromINetConnection +13 stub HrGetStatusStringFromNetConExtendedStatus +14 stub HrIsIpStateCheckingEnabled +15 stub HrLaunchConnection +16 stub HrLaunchConnectionEx +17 stub HrLaunchNetworkOptionalComponents +18 stub HrOemUpgrade +19 stub HrRenameConnection +20 stub HrRunWizard +21 stub InvokeDunFile +22 stdcall NcFreeNetconProperties(ptr) +23 stub NcIsValidConnectionName +24 stub NetSetupAddRasConnection +25 stub NetSetupFinishInstall +26 stub NetSetupInstallSoftware +27 stub NetSetupPrepareSysPrep +28 stub NetSetupRequestWizardPages +29 stub NetSetupSetProgressCallback +30 stub NormalizeExtendedStatus +31 stub RaiseSupportDialog +32 stub RepairConnection +33 stub StartNCW diff --git a/reactos/dll/win32/netshell/precomp.h b/reactos/dll/win32/netshell/precomp.h new file mode 100644 index 00000000000..63b790b472c --- /dev/null +++ b/reactos/dll/win32/netshell/precomp.h @@ -0,0 +1,106 @@ +#ifndef _PRECOMP_H__ +#define _PRECOMP_H__ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include + +#define COBJMACROS +#define NONAMELESSUNION +#define NONAMELESSSTRUCT + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include "wine/debug.h" +#include "wine/unicode.h" +#include "resource.h" + +#define NCF_VIRTUAL 0x1 +#define NCF_SOFTWARE_ENUMERATED 0x2 +#define NCF_PHYSICAL 0x4 +#define NCF_HIDDEN 0x8 +#define NCF_NO_SERVICE 0x10 +#define NCF_NOT_USER_REMOVABLE 0x20 +#define NCF_MULTIPORT_INSTANCED_ADAPTER 0x40 +#define NCF_HAS_UI 0x80 +#define NCF_FILTER 0x400 +#define NCF_NDIS_PROTOCOL 0x4000 + +typedef struct { + int colnameid; + int pcsFlags; + int fmt; + int cxChar; +} shvheader; + +typedef HRESULT (CALLBACK *LPFNCREATEINSTANCE)(IUnknown* pUnkOuter, REFIID riid, LPVOID* ppvObject); +typedef struct { + REFIID riid; + LPFNCREATEINSTANCE lpfnCI; +} INTERFACE_TABLE; + +typedef struct tagVALUEStruct +{ + BYTE dummy; + INetConnection * pItem; +}VALUEStruct; + +/* globals */ +extern HINSTANCE netshell_hInstance; +extern const GUID CLSID_NetworkConnections; +extern const GUID CLSID_LANConnectUI; +extern const GUID GUID_DEVCLASS_NET; + + +/* shfldr_netconnect.c */ +HRESULT WINAPI ISF_NetConnect_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); + +/* enumlist.c */ +IEnumIDList * IEnumIDList_Constructor(void); +LPITEMIDLIST _ILCreateNetConnect(); +LPITEMIDLIST ILCreateNetConnectItem(INetConnection * pItem); +BOOL _ILIsNetConnect (LPCITEMIDLIST pidl); +BOOL AddToEnumList(IEnumIDList * iface, LPITEMIDLIST pidl); +VALUEStruct * _ILGetValueStruct(LPCITEMIDLIST pidl); + +/* classfactory.c */ +IClassFactory * IClassFactory_fnConstructor(LPFNCREATEINSTANCE lpfnCI, PLONG pcRefDll, REFIID riidInst); + +/* connectmanager.c */ +HRESULT WINAPI INetConnectionManager_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); + +/* lanconnectui.c */ +HRESULT WINAPI LanConnectUI_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); + +/* lanstatusui.c */ +HRESULT WINAPI LanConnectStatusUI_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); + +#define NCCF_NOTIFY_DISCONNECTED 0x100000 + +#endif diff --git a/reactos/dll/win32/netshell/res/netshell.ico b/reactos/dll/win32/netshell/res/netshell.ico new file mode 100644 index 00000000000..cf3a1413d1d Binary files /dev/null and b/reactos/dll/win32/netshell/res/netshell.ico differ diff --git a/reactos/dll/win32/netshell/resource.h b/reactos/dll/win32/netshell/resource.h new file mode 100644 index 00000000000..bd082bff3d6 --- /dev/null +++ b/reactos/dll/win32/netshell/resource.h @@ -0,0 +1,57 @@ + +/* icons */ + +#define IDI_SHELL_NETWORK_FOLDER 100 +#define IDI_HORIZONTAL 101 +#define IDI_NETSTAT 102 +#define IDI_VERTICAL 103 + +/* dialogs */ +#define IDD_NETPROPERTIES 400 +#define IDD_NETSTATUS 401 + +/* dialog controls */ +#define IDC_NETCARDNAME 1000 +#define IDC_CONFIGURE 1001 +#define IDC_COMPONENTSLIST 2800 +#define IDC_INSTALL 1003 +#define IDC_UNINSTALL 1004 +#define IDC_PROPERTIES 1005 +#define IDC_DESCRIPTION 1006 +#define IDC_SHOWTASKBAR 1007 +#define IDC_NOTIFYNOCONNECTION 1008 + +#define IDC_SEND 1100 +#define IDC_RECEIVED 1101 +#define IDC_STATUS_PROPERTIES 1102 +#define IDC_ENDISABLE 1103 +#define IDC_STATUS 1104 +#define IDC_DURATION 1105 +#define IDC_SPEED 1106 + + +/* resource constants */ + +#define IDS_NETWORKCONNECTION 10000 +#define IDS_SHV_COLUMN_NAME 10001 +#define IDS_SHV_COLUMN_TYPE 10002 +#define IDS_SHV_COLUMN_STATE 10003 +#define IDS_SHV_COLUMN_DEVNAME 10004 +#define IDS_SHV_COLUMN_PHONE 10005 +#define IDS_SHV_COLUMN_OWNER 10006 +#define IDS_TYPE_ETHERNET 10007 +#define IDS_STATUS_NON_OPERATIONAL 10008 +#define IDS_STATUS_UNREACHABLE 10009 +#define IDS_STATUS_DISCONNECTED 10010 +#define IDS_STATUS_CONNECTING 10011 +#define IDS_STATUS_CONNECTED 10012 +#define IDS_STATUS_OPERATIONAL 10013 + +#define IDS_NET_ACTIVATE 10100 +#define IDS_NET_DEACTIVATE 10101 +#define IDS_NET_STATUS 10102 +#define IDS_NET_REPAIR 10103 +#define IDS_NET_CREATELINK 10104 +#define IDS_NET_DELETE 10105 +#define IDS_NET_RENAME 10106 +#define IDS_NET_PROPERTIES 10107 diff --git a/reactos/dll/win32/netshell/shfldr_netconnect.c b/reactos/dll/win32/netshell/shfldr_netconnect.c new file mode 100644 index 00000000000..4a193f19293 --- /dev/null +++ b/reactos/dll/win32/netshell/shfldr_netconnect.c @@ -0,0 +1,983 @@ +/* + * Network Connections Shell Folder + * + * Copyright 2008 Johannes Anderwald + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include + +WINE_DEFAULT_DEBUG_CHANNEL (shell); + +#define MAX_PROPERTY_SHEET_PAGE (10) + +/*********************************************************************** +* IShellFolder implementation +*/ + +typedef struct { + const IShellFolder2Vtbl *lpVtbl; + LONG ref; + const IContextMenu2Vtbl *lpVtblContextMenu; + const IPersistFolder2Vtbl *lpVtblPersistFolder2; + + /* both paths are parsible from the desktop */ + LPITEMIDLIST pidlRoot; /* absolute pidl */ + LPCITEMIDLIST apidl; /* currently focused font item */ +} IGenericSFImpl, *LPIGenericSFImpl; + + +static const shvheader NetConnectSFHeader[] = { + {IDS_SHV_COLUMN_NAME, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 20}, + {IDS_SHV_COLUMN_TYPE, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 8}, + {IDS_SHV_COLUMN_STATE, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 10}, + {IDS_SHV_COLUMN_DEVNAME, SHCOLSTATE_TYPE_DATE | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 12}, + {IDS_SHV_COLUMN_PHONE, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 10}, + {IDS_SHV_COLUMN_OWNER, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 5} +}; + +#define NETCONNECTSHELLVIEWCOLUMNS 6 + +#define COLUMN_NAME 0 +#define COLUMN_TYPE 1 +#define COLUMN_STATUS 2 +#define COLUMN_DEVNAME 3 +#define COLUMN_PHONE 4 +#define COLUMN_OWNER 5 + +static LPIGenericSFImpl __inline impl_from_IContextMenu2(IContextMenu2 *iface) +{ + return (LPIGenericSFImpl)((char *)iface - FIELD_OFFSET(IGenericSFImpl, lpVtblContextMenu)); +} + +static LPIGenericSFImpl __inline impl_from_IPersistFolder2(IPersistFolder2 *iface) +{ + return (LPIGenericSFImpl)((char *)iface - FIELD_OFFSET(IGenericSFImpl, lpVtblPersistFolder2)); +} + + + +/************************************************************************** + * ISF_NetConnect_fnQueryInterface + * + * NOTE + * supports not IPersist/IPersistFolder + */ +static HRESULT WINAPI ISF_NetConnect_fnQueryInterface (IShellFolder2 *iface, REFIID riid, LPVOID *ppvObj) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + + *ppvObj = NULL; + + if (IsEqualIID (riid, &IID_IUnknown) || + IsEqualIID (riid, &IID_IShellFolder) || + IsEqualIID (riid, &IID_IShellFolder2)) + { + *ppvObj = This; + } + else if (IsEqualIID (riid, &IID_IPersistFolder) || + IsEqualIID (riid, &IID_IPersistFolder2)) + { + *ppvObj = (LPVOID *)&This->lpVtblPersistFolder2; + } + if (*ppvObj) + { + IUnknown_AddRef ((IUnknown *) (*ppvObj)); + return S_OK; + } + + return E_NOINTERFACE; +} + +static ULONG WINAPI ISF_NetConnect_fnAddRef (IShellFolder2 * iface) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + ULONG refCount = InterlockedIncrement(&This->ref); + + return refCount; +} + +static ULONG WINAPI ISF_NetConnect_fnRelease (IShellFolder2 * iface) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + ULONG refCount = InterlockedDecrement(&This->ref); + + + if (!refCount) + { + SHFree (This->pidlRoot); + CoTaskMemFree(This); + } + return refCount; +} + +/************************************************************************** +* ISF_NetConnect_fnParseDisplayName +*/ +static HRESULT WINAPI ISF_NetConnect_fnParseDisplayName (IShellFolder2 * iface, + HWND hwndOwner, LPBC pbcReserved, LPOLESTR lpszDisplayName, + DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes) +{ + //IGenericSFImpl *This = (IGenericSFImpl *)iface; + + HRESULT hr = E_UNEXPECTED; + + *ppidl = 0; + if (pchEaten) + *pchEaten = 0; /* strange but like the original */ + + return hr; +} + +/************************************************************************** + * CreateNetConnectEnumListss() + */ +static BOOL CreateNetConnectEnumList(IEnumIDList *list, DWORD dwFlags) +{ + HRESULT hr; + INetConnectionManager * INetConMan; + IEnumNetConnection * IEnumCon; + INetConnection * INetCon; + ULONG Count; + LPITEMIDLIST pidl; + + /* get an instance to of IConnectionManager */ + hr = INetConnectionManager_Constructor(NULL, &IID_INetConnectionManager, (LPVOID*)&INetConMan); + if (FAILED(hr)) + return FALSE; + + hr = INetConnectionManager_EnumConnections(INetConMan, NCME_DEFAULT, &IEnumCon); + if (FAILED(hr)) + { + INetConnectionManager_Release(INetConMan); + return FALSE; + } + + do + { + hr = IEnumNetConnection_Next(IEnumCon, 1, &INetCon, &Count); + if (hr == S_OK) + { + pidl = ILCreateNetConnectItem(INetCon); + if (pidl) + { + AddToEnumList(list, pidl); + } + } + else + { + break; + } + }while(TRUE); + + IEnumNetConnection_Release(IEnumCon); + INetConnectionManager_Release(INetConMan); + + return TRUE; +} + +/************************************************************************** +* ISF_NetConnect_fnEnumObjects +*/ +static HRESULT WINAPI ISF_NetConnect_fnEnumObjects (IShellFolder2 * iface, + HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST * ppEnumIDList) +{ + //IGenericSFImpl *This = (IGenericSFImpl *)iface; + + *ppEnumIDList = IEnumIDList_Constructor(); + if(*ppEnumIDList) + CreateNetConnectEnumList(*ppEnumIDList, dwFlags); + + + return (*ppEnumIDList) ? S_OK : E_OUTOFMEMORY; +} + +/************************************************************************** +* ISF_NetConnect_fnBindToObject +*/ +static HRESULT WINAPI ISF_NetConnect_fnBindToObject (IShellFolder2 * iface, + LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut) +{ + //IGenericSFImpl *This = (IGenericSFImpl *)iface; + + return E_NOTIMPL; +} + +/************************************************************************** +* ISF_NetConnect_fnBindToStorage +*/ +static HRESULT WINAPI ISF_NetConnect_fnBindToStorage (IShellFolder2 * iface, + LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut) +{ + //IGenericSFImpl *This = (IGenericSFImpl *)iface; + + + *ppvOut = NULL; + return E_NOTIMPL; +} + +/************************************************************************** +* ISF_NetConnect_fnCompareIDs +*/ + +static HRESULT WINAPI ISF_NetConnect_fnCompareIDs (IShellFolder2 * iface, + LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) +{ + //IGenericSFImpl *This = (IGenericSFImpl *)iface; + + + + return E_NOTIMPL; +} + +/************************************************************************** +* ISF_NetConnect_fnCreateViewObject +*/ +static HRESULT WINAPI ISF_NetConnect_fnCreateViewObject (IShellFolder2 * iface, + HWND hwndOwner, REFIID riid, LPVOID * ppvOut) +{ + //IGenericSFImpl *This = (IGenericSFImpl *)iface; + IShellView* pShellView; + CSFV cvf; + HRESULT hr = E_NOINTERFACE; + + if (!ppvOut) + return hr; + + *ppvOut = NULL; + + if (IsEqualIID (riid, &IID_IShellView)) + { + ZeroMemory(&cvf, sizeof(cvf)); + cvf.cbSize = sizeof(cvf); + cvf.pshf = (IShellFolder*)iface; + + hr = SHCreateShellFolderViewEx(&cvf, &pShellView); + if (SUCCEEDED(hr)) + { + hr = IShellView_QueryInterface (pShellView, riid, ppvOut); + IShellView_Release (pShellView); + } + } + + return hr; +} + +/************************************************************************** +* ISF_NetConnect_fnGetAttributesOf +*/ +static HRESULT WINAPI ISF_NetConnect_fnGetAttributesOf (IShellFolder2 * iface, + UINT cidl, LPCITEMIDLIST * apidl, DWORD * rgfInOut) +{ + //IGenericSFImpl *This = (IGenericSFImpl *)iface; + HRESULT hr = S_OK; + static const DWORD dwNetConnectAttributes = SFGAO_STORAGE | SFGAO_HASPROPSHEET | SFGAO_STORAGEANCESTOR | + SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER | SFGAO_CANRENAME | SFGAO_CANDELETE; + + + if (!rgfInOut) + return E_INVALIDARG; + + if (cidl && !apidl) + return E_INVALIDARG; + + if (*rgfInOut == 0) + *rgfInOut = ~0; + + if(cidl == 0) + *rgfInOut = dwNetConnectAttributes; + + /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */ + *rgfInOut &= ~SFGAO_VALIDATE; + + return hr; +} + +/************************************************************************** +* ISF_NetConnect_fnGetUIObjectOf +* +* PARAMETERS +* hwndOwner [in] Parent window for any output +* cidl [in] array size +* apidl [in] simple pidl array +* riid [in] Requested Interface +* prgfInOut [ ] reserved +* ppvObject [out] Resulting Interface +* +*/ +static HRESULT WINAPI ISF_NetConnect_fnGetUIObjectOf (IShellFolder2 * iface, + HWND hwndOwner, UINT cidl, LPCITEMIDLIST * apidl, REFIID riid, + UINT * prgfInOut, LPVOID * ppvOut) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + + IUnknown *pObj = NULL; + HRESULT hr = E_INVALIDARG; + + if (!ppvOut) + return hr; + + *ppvOut = NULL; + + if (IsEqualIID (riid, &IID_IContextMenu) && (cidl >= 1)) + { + pObj = (IUnknown*)(&This->lpVtblContextMenu); + This->apidl = apidl[0]; + IUnknown_AddRef(pObj); + hr = S_OK; + } + else + hr = E_NOINTERFACE; + + if (SUCCEEDED(hr) && !pObj) + hr = E_OUTOFMEMORY; + + *ppvOut = pObj; + return hr; +} + +/************************************************************************** +* ISF_NetConnect_fnGetDisplayNameOf +* +*/ +static HRESULT WINAPI ISF_NetConnect_fnGetDisplayNameOf (IShellFolder2 * iface, + LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet) +{ + LPWSTR pszName; + HRESULT hr = E_FAIL; + NETCON_PROPERTIES * pProperties; + VALUEStruct * val; + //IGenericSFImpl *This = (IGenericSFImpl *)iface; + + if (!strRet) + return E_INVALIDARG; + + pszName = CoTaskMemAlloc(MAX_PATH * sizeof(WCHAR)); + if (!pszName) + return E_OUTOFMEMORY; + + if (_ILIsNetConnect (pidl)) + { + if (LoadStringW(netshell_hInstance, IDS_NETWORKCONNECTION, pszName, MAX_PATH)) + { + pszName[MAX_PATH-1] = L'\0'; + hr = S_OK; + } + } + else + { + val = _ILGetValueStruct(pidl); + if (val) + { + if (INetConnection_GetProperties(val->pItem, &pProperties) == NOERROR) + { + if (pProperties->pszwName) + { + wcscpy(pszName, pProperties->pszwName); + hr = S_OK; + } + //NcFreeNetconProperties(pProperties); + } + } + + } + + if (SUCCEEDED(hr)) + { + strRet->uType = STRRET_WSTR; + strRet->u.pOleStr = pszName; + } + else + { + CoTaskMemFree(pszName); + } + + return hr; +} + +/************************************************************************** +* ISF_NetConnect_fnSetNameOf +* Changes the name of a file object or subfolder, possibly changing its item +* identifier in the process. +* +* PARAMETERS +* hwndOwner [in] Owner window for output +* pidl [in] simple pidl of item to change +* lpszName [in] the items new display name +* dwFlags [in] SHGNO formatting flags +* ppidlOut [out] simple pidl returned +*/ +static HRESULT WINAPI ISF_NetConnect_fnSetNameOf (IShellFolder2 * iface, + HWND hwndOwner, LPCITEMIDLIST pidl, /*simple pidl */ + LPCOLESTR lpName, DWORD dwFlags, LPITEMIDLIST * pPidlOut) +{ + //IGenericSFImpl *This = (IGenericSFImpl *)iface; + + return E_NOTIMPL; +} + +static HRESULT WINAPI ISF_NetConnect_fnGetDefaultSearchGUID ( + IShellFolder2 * iface, GUID * pguid) +{ + //IGenericSFImpl *This = (IGenericSFImpl *)iface; + + return E_NOTIMPL; +} + +static HRESULT WINAPI ISF_NetConnect_fnEnumSearches (IShellFolder2 * iface, + IEnumExtraSearch ** ppenum) +{ + //IGenericSFImpl *This = (IGenericSFImpl *)iface; + + return E_NOTIMPL; +} + +static HRESULT WINAPI ISF_NetConnect_fnGetDefaultColumn (IShellFolder2 * iface, + DWORD dwRes, ULONG * pSort, ULONG * pDisplay) +{ + //IGenericSFImpl *This = (IGenericSFImpl *)iface; + + if (pSort) + *pSort = 0; + if (pDisplay) + *pDisplay = 0; + + return S_OK; +} + +static HRESULT WINAPI ISF_NetConnect_fnGetDefaultColumnState ( + IShellFolder2 * iface, UINT iColumn, DWORD * pcsFlags) +{ + //IGenericSFImpl *This = (IGenericSFImpl *)iface; + + if (!pcsFlags || iColumn >= NETCONNECTSHELLVIEWCOLUMNS) + return E_INVALIDARG; + *pcsFlags = NetConnectSFHeader[iColumn].pcsFlags; + return S_OK; +} + +static HRESULT WINAPI ISF_NetConnect_fnGetDetailsEx (IShellFolder2 * iface, + LPCITEMIDLIST pidl, const SHCOLUMNID * pscid, VARIANT * pv) +{ + //IGenericSFImpl *This = (IGenericSFImpl *)iface; + + return E_NOTIMPL; +} + +static HRESULT WINAPI ISF_NetConnect_fnGetDetailsOf (IShellFolder2 * iface, + LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS * psd) +{ + //IGenericSFImpl *This = (IGenericSFImpl *)iface; + WCHAR buffer[MAX_PATH] = {0}; + HRESULT hr = E_FAIL; + VALUEStruct * val; + NETCON_PROPERTIES * pProperties; + + if (iColumn >= NETCONNECTSHELLVIEWCOLUMNS) + return E_FAIL; + + psd->fmt = NetConnectSFHeader[iColumn].fmt; + psd->cxChar = NetConnectSFHeader[iColumn].cxChar; + if (pidl == NULL) + { + psd->str.uType = STRRET_WSTR; + if (LoadStringW(netshell_hInstance, NetConnectSFHeader[iColumn].colnameid, buffer, MAX_PATH)) + hr = SHStrDupW(buffer, &psd->str.u.pOleStr); + + return hr; + } + + if (iColumn == COLUMN_NAME) + { + psd->str.uType = STRRET_WSTR; + return IShellFolder2_GetDisplayNameOf(iface, pidl, SHGDN_NORMAL, &psd->str); + } + + val = _ILGetValueStruct(pidl); + if (!val) + return E_FAIL; + + if (INetConnection_GetProperties((INetConnection*)val->pItem, &pProperties) != NOERROR) + return E_FAIL; + + + switch(iColumn) + { + case COLUMN_TYPE: + if (pProperties->MediaType == NCM_LAN || pProperties->MediaType == NCM_SHAREDACCESSHOST_RAS) + { + if (LoadStringW(netshell_hInstance, IDS_TYPE_ETHERNET, buffer, MAX_PATH)) + { + psd->str.uType = STRRET_WSTR; + hr = SHStrDupW(buffer, &psd->str.u.pOleStr); + } + } + break; + case COLUMN_STATUS: + buffer[0] = L'\0'; + if (pProperties->Status == NCS_HARDWARE_DISABLED) + LoadStringW(netshell_hInstance, IDS_STATUS_NON_OPERATIONAL, buffer, MAX_PATH); + else if (pProperties->Status == NCS_DISCONNECTED) + LoadStringW(netshell_hInstance, IDS_STATUS_UNREACHABLE, buffer, MAX_PATH); + else if (pProperties->Status == NCS_MEDIA_DISCONNECTED) + LoadStringW(netshell_hInstance, IDS_STATUS_DISCONNECTED, buffer, MAX_PATH); + else if (pProperties->Status == NCS_CONNECTING) + LoadStringW(netshell_hInstance, IDS_STATUS_CONNECTING, buffer, MAX_PATH); + else if (pProperties->Status == NCS_CONNECTED) + LoadStringW(netshell_hInstance, IDS_STATUS_CONNECTED, buffer, MAX_PATH); + + if (buffer[0]) + { + buffer[MAX_PATH-1] = L'\0'; + psd->str.uType = STRRET_WSTR; + hr = SHStrDupW(buffer, &psd->str.u.pOleStr); + } + break; + case COLUMN_DEVNAME: + wcscpy(buffer, pProperties->pszwDeviceName); + buffer[MAX_PATH-1] = L'\0'; + psd->str.uType = STRRET_WSTR; + hr = SHStrDupW(buffer, &psd->str.u.pOleStr); + break; + case COLUMN_PHONE: + case COLUMN_OWNER: + psd->str.u.cStr[0] = '\0'; + psd->str.uType = STRRET_CSTR; + break; + } +#if 0 + NcFreeNetconProperties(pProperties); +#endif + return hr; +} + +static HRESULT WINAPI ISF_NetConnect_fnMapColumnToSCID (IShellFolder2 * iface, + UINT column, SHCOLUMNID * pscid) +{ + //IGenericSFImpl *This = (IGenericSFImpl *)iface; + + return E_NOTIMPL; +} + +static const IShellFolder2Vtbl vt_ShellFolder2 = { + ISF_NetConnect_fnQueryInterface, + ISF_NetConnect_fnAddRef, + ISF_NetConnect_fnRelease, + ISF_NetConnect_fnParseDisplayName, + ISF_NetConnect_fnEnumObjects, + ISF_NetConnect_fnBindToObject, + ISF_NetConnect_fnBindToStorage, + ISF_NetConnect_fnCompareIDs, + ISF_NetConnect_fnCreateViewObject, + ISF_NetConnect_fnGetAttributesOf, + ISF_NetConnect_fnGetUIObjectOf, + ISF_NetConnect_fnGetDisplayNameOf, + ISF_NetConnect_fnSetNameOf, + /* ShellFolder2 */ + ISF_NetConnect_fnGetDefaultSearchGUID, + ISF_NetConnect_fnEnumSearches, + ISF_NetConnect_fnGetDefaultColumn, + ISF_NetConnect_fnGetDefaultColumnState, + ISF_NetConnect_fnGetDetailsEx, + ISF_NetConnect_fnGetDetailsOf, + ISF_NetConnect_fnMapColumnToSCID +}; + +/************************************************************************** +* IContextMenu2 Implementation +*/ + +/************************************************************************ + * ISF_NetConnect_IContextMenu_QueryInterface + */ +static HRESULT WINAPI ISF_NetConnect_IContextMenu2_QueryInterface(IContextMenu2 * iface, REFIID iid, LPVOID * ppvObject) +{ + IGenericSFImpl * This = impl_from_IContextMenu2(iface); + + return IShellFolder2_QueryInterface((IShellFolder2*)This, iid, ppvObject); +} + +/************************************************************************ + * ISF_NetConnect_IContextMenu_AddRef + */ +static ULONG WINAPI ISF_NetConnect_IContextMenu2_AddRef(IContextMenu2 * iface) +{ + IGenericSFImpl * This = impl_from_IContextMenu2(iface); + + return IShellFolder2_AddRef((IShellFolder2*)This); +} + +/************************************************************************ + * ISF_NetConnect_IContextMenu_Release + */ +static ULONG WINAPI ISF_NetConnect_IContextMenu2_Release(IContextMenu2 * iface) +{ + IGenericSFImpl * This = impl_from_IContextMenu2(iface); + + return IShellFolder2_Release((IShellFolder2*)This); +} + +void WINAPI _InsertMenuItemW ( + HMENU hmenu, + UINT indexMenu, + BOOL fByPosition, + UINT wID, + UINT fType, + LPCWSTR dwTypeData, + UINT fState) +{ + MENUITEMINFOW mii; + WCHAR szText[100]; + + ZeroMemory(&mii, sizeof(mii)); + mii.cbSize = sizeof(mii); + if (fType == MFT_SEPARATOR) + { + mii.fMask = MIIM_ID | MIIM_TYPE; + } + else if (fType == MFT_STRING) + { + mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE; + if ((ULONG_PTR)HIWORD((ULONG_PTR)dwTypeData) == 0) + { + if (LoadStringW(netshell_hInstance, LOWORD((ULONG_PTR)dwTypeData), szText, sizeof(szText)/sizeof(WCHAR))) + { + szText[(sizeof(szText)/sizeof(WCHAR))-1] = 0; + mii.dwTypeData = szText; + } + else + { + return; + } + } + else + { + mii.dwTypeData = (LPWSTR) dwTypeData; + } + mii.fState = fState; + } + + mii.wID = wID; + mii.fType = fType; + InsertMenuItemW( hmenu, indexMenu, fByPosition, &mii); +} + +/************************************************************************** +* ISF_NetConnect_IContextMenu_QueryContextMenu() +*/ +static HRESULT WINAPI ISF_NetConnect_IContextMenu2_QueryContextMenu( + IContextMenu2 *iface, + HMENU hMenu, + UINT indexMenu, + UINT idCmdFirst, + UINT idCmdLast, + UINT uFlags) +{ + IGenericSFImpl * This = impl_from_IContextMenu2(iface); + VALUEStruct * val; + NETCON_PROPERTIES * pProperties; + + val = _ILGetValueStruct(This->apidl); + if (!val) + return E_FAIL; + + if (INetConnection_GetProperties((INetConnection*)val->pItem, &pProperties) != NOERROR) + return E_FAIL; + + if (pProperties->Status == NCS_HARDWARE_DISABLED) + _InsertMenuItemW(hMenu, indexMenu++, TRUE, IDS_NET_ACTIVATE, MFT_STRING, MAKEINTRESOURCEW(IDS_NET_ACTIVATE), MFS_DEFAULT); + else + _InsertMenuItemW(hMenu, indexMenu++, TRUE, IDS_NET_DEACTIVATE, MFT_STRING, MAKEINTRESOURCEW(IDS_NET_DEACTIVATE), MFS_ENABLED); + + if (pProperties->Status == NCS_HARDWARE_DISABLED || pProperties->Status == NCS_MEDIA_DISCONNECTED || pProperties->Status == NCS_DISCONNECTED) + _InsertMenuItemW(hMenu, indexMenu++, TRUE, IDS_NET_STATUS, MFT_STRING, MAKEINTRESOURCEW(IDS_NET_STATUS), MFS_GRAYED); + else if (pProperties->Status == NCS_CONNECTED) + _InsertMenuItemW(hMenu, indexMenu++, TRUE, IDS_NET_STATUS, MFT_STRING, MAKEINTRESOURCEW(IDS_NET_STATUS), MFS_DEFAULT); + else + _InsertMenuItemW(hMenu, indexMenu++, TRUE, IDS_NET_STATUS, MFT_STRING, MAKEINTRESOURCEW(IDS_NET_STATUS), MFS_ENABLED); + + if (pProperties->Status == NCS_HARDWARE_DISABLED || pProperties->Status == NCS_MEDIA_DISCONNECTED) + _InsertMenuItemW(hMenu, indexMenu++, TRUE, IDS_NET_REPAIR, MFT_STRING, MAKEINTRESOURCEW(IDS_NET_REPAIR), MFS_GRAYED); + else + _InsertMenuItemW(hMenu, indexMenu++, TRUE, IDS_NET_REPAIR, MFT_STRING, MAKEINTRESOURCEW(IDS_NET_REPAIR), MFS_ENABLED); + + _InsertMenuItemW(hMenu, indexMenu++, TRUE, -1, MFT_SEPARATOR, NULL, MFS_ENABLED); + _InsertMenuItemW(hMenu, indexMenu++, TRUE, IDS_NET_CREATELINK, MFT_STRING, MAKEINTRESOURCEW(IDS_NET_CREATELINK), MFS_ENABLED); + + if (pProperties->dwCharacter & NCCF_ALLOW_REMOVAL) + _InsertMenuItemW(hMenu, indexMenu++, TRUE, IDS_NET_DELETE, MFT_STRING, MAKEINTRESOURCEW(IDS_NET_DELETE), MFS_ENABLED); + else + _InsertMenuItemW(hMenu, indexMenu++, TRUE, IDS_NET_DELETE, MFT_STRING, MAKEINTRESOURCEW(IDS_NET_DELETE), MFS_GRAYED); + + if (pProperties->dwCharacter & NCCF_ALLOW_RENAME) + _InsertMenuItemW(hMenu, indexMenu++, TRUE, IDS_NET_RENAME, MFT_STRING, MAKEINTRESOURCEW(IDS_NET_RENAME), MFS_ENABLED); + else + _InsertMenuItemW(hMenu, indexMenu++, TRUE, IDS_NET_RENAME, MFT_STRING, MAKEINTRESOURCEW(IDS_NET_RENAME), MFS_GRAYED); + + _InsertMenuItemW(hMenu, indexMenu++, TRUE, -1, MFT_SEPARATOR, NULL, MFS_ENABLED); + _InsertMenuItemW(hMenu, indexMenu++, TRUE, IDS_NET_PROPERTIES, MFT_STRING, MAKEINTRESOURCEW(IDS_NET_PROPERTIES), MFS_ENABLED); + + + return MAKE_HRESULT(SEVERITY_SUCCESS, 0, 9); +} + +BOOL +CALLBACK +PropSheetExCallback(HPROPSHEETPAGE hPage, LPARAM lParam) +{ + PROPSHEETHEADERW *pinfo = (PROPSHEETHEADERW *)lParam; + + if (pinfo->nPages < MAX_PROPERTY_SHEET_PAGE) + { + pinfo->u3.phpage[pinfo->nPages++] = hPage; + return TRUE; + } + return FALSE; +} + +/************************************************************************** +* ISF_NetConnect_IContextMenu_InvokeCommand() +*/ +static HRESULT WINAPI ISF_NetConnect_IContextMenu2_InvokeCommand( + IContextMenu2 *iface, + LPCMINVOKECOMMANDINFO lpcmi) +{ + IGenericSFImpl * This = impl_from_IContextMenu2(iface); + VALUEStruct * val; + NETCON_PROPERTIES * pProperties; + HRESULT hr = S_OK; + PROPSHEETHEADERW pinfo; + CLSID ClassID; + HPROPSHEETPAGE hppages[MAX_PROPERTY_SHEET_PAGE]; + INetConnectionPropertyUi * pNCP; + + val = _ILGetValueStruct(This->apidl); + if (!val) + return E_FAIL; + + if (INetConnection_GetProperties((INetConnection*)val->pItem, &pProperties) != NOERROR) + return E_FAIL; + + if (lpcmi->lpVerb == MAKEINTRESOURCEA(IDS_NET_STATUS)) + { +#if 0 + if (pProperties->MediaType == NCM_LAN) + { + hr = ShowLANConnectionStatusDialog(pProperties); + NcFreeNetconProperties(pProperties); + } +#endif + return hr; + } + else if (lpcmi->lpVerb == MAKEINTRESOURCEA(IDS_NET_PROPERTIES)) + { + hr = INetConnection_GetUiObjectClassId(val->pItem, &ClassID); + if (SUCCEEDED(hr)) + { + /* FIXME perform version checks */ + hr = CoCreateInstance(&ClassID, NULL, 0, &IID_INetConnectionPropertyUi, (LPVOID)&pNCP); + if (SUCCEEDED(hr)) + { + hr = INetConnectionPropertyUi_SetConnection(pNCP, val->pItem); + if (SUCCEEDED(hr)) + { + memset(&pinfo, 0x0, sizeof(PROPSHEETHEADERW)); + pinfo.dwSize = sizeof(PROPSHEETHEADERW); + pinfo.dwFlags = PSH_NOCONTEXTHELP | PSH_PROPTITLE; + pinfo.u3.phpage = hppages; + pinfo.pszCaption = pProperties->pszwName; + + hr = INetConnectionPropertyUi_AddPages(pNCP, lpcmi->hwnd, PropSheetExCallback, (LPARAM)&pinfo); + if (SUCCEEDED(hr)) + { + if(PropertySheetW(&pinfo) < 0) + hr = E_FAIL; + } + } + } + } + NcFreeNetconProperties(pProperties); + return hr; + } + + return S_OK; +} + +/************************************************************************** + * ISF_NetConnect_IContextMenu_GetCommandString() + * + */ +static HRESULT WINAPI ISF_NetConnect_IContextMenu2_GetCommandString( + IContextMenu2 *iface, + UINT_PTR idCommand, + UINT uFlags, + UINT* lpReserved, + LPSTR lpszName, + UINT uMaxNameLen) +{ + //IGenericSFImpl * This = impl_from_IContextMenu2(iface); + + return E_FAIL; +} + + + +/************************************************************************** +* ISF_NetConnect_IContextMenu_HandleMenuMsg() +*/ +static HRESULT WINAPI ISF_NetConnect_IContextMenu2_HandleMenuMsg( + IContextMenu2 *iface, + UINT uMsg, + WPARAM wParam, + LPARAM lParam) +{ + //IGenericSFImpl * This = impl_from_IContextMenu2(iface); + + + return E_NOTIMPL; +} + +static const IContextMenu2Vtbl vt_ContextMenu2 = +{ + ISF_NetConnect_IContextMenu2_QueryInterface, + ISF_NetConnect_IContextMenu2_AddRef, + ISF_NetConnect_IContextMenu2_Release, + ISF_NetConnect_IContextMenu2_QueryContextMenu, + ISF_NetConnect_IContextMenu2_InvokeCommand, + ISF_NetConnect_IContextMenu2_GetCommandString, + ISF_NetConnect_IContextMenu2_HandleMenuMsg +}; + +/************************************************************************ + * ISF_NetConnect_PersistFolder2_QueryInterface + */ +static HRESULT WINAPI ISF_NetConnect_PersistFolder2_QueryInterface (IPersistFolder2 * iface, + REFIID iid, LPVOID * ppvObj) +{ + IGenericSFImpl * This = impl_from_IPersistFolder2(iface); + + return IShellFolder2_QueryInterface ((IShellFolder2*)This, iid, ppvObj); +} + +/************************************************************************ + * ISF_NetConnect_PersistFolder2_AddRef + */ +static ULONG WINAPI ISF_NetConnect_PersistFolder2_AddRef (IPersistFolder2 * iface) +{ + IGenericSFImpl * This = impl_from_IPersistFolder2(iface); + + return IShellFolder2_AddRef((IShellFolder2*)This); +} + +/************************************************************************ + * ISF_NetConnect_PersistFolder2_Release + */ +static ULONG WINAPI ISF_NetConnect_PersistFolder2_Release (IPersistFolder2 * iface) +{ + IGenericSFImpl * This = impl_from_IPersistFolder2(iface); + + return IShellFolder2_Release((IShellFolder2*)This); +} + +/************************************************************************ + * ISF_NetConnect_PersistFolder2_GetClassID + */ +static HRESULT WINAPI ISF_NetConnect_PersistFolder2_GetClassID ( + IPersistFolder2 * iface, CLSID * lpClassId) +{ + //IGenericSFImpl * This = impl_from_IPersistFolder2(iface); + + if (!lpClassId) + return E_POINTER; + + *lpClassId = CLSID_NetworkConnections; + + return S_OK; +} + +/************************************************************************ + * ISF_NetConnect_PersistFolder2_Initialize + * + * NOTES: it makes no sense to change the pidl + */ +static HRESULT WINAPI ISF_NetConnect_PersistFolder2_Initialize ( + IPersistFolder2 * iface, LPCITEMIDLIST pidl) +{ + IGenericSFImpl * This = impl_from_IPersistFolder2(iface); + + SHFree(This->pidlRoot); + This->pidlRoot = ILClone(pidl); + + return S_OK; +} + +/************************************************************************** + * ISF_NetConnect_PersistFolder2_GetCurFolder + */ +static HRESULT WINAPI ISF_NetConnect_PersistFolder2_GetCurFolder ( + IPersistFolder2 * iface, LPITEMIDLIST * pidl) +{ + IGenericSFImpl * This = impl_from_IPersistFolder2(iface); + + + if (!pidl) + return E_POINTER; + + *pidl = ILClone (This->pidlRoot); + + return S_OK; +} + +static const IPersistFolder2Vtbl vt_PersistFolder2 = +{ + ISF_NetConnect_PersistFolder2_QueryInterface, + ISF_NetConnect_PersistFolder2_AddRef, + ISF_NetConnect_PersistFolder2_Release, + ISF_NetConnect_PersistFolder2_GetClassID, + ISF_NetConnect_PersistFolder2_Initialize, + ISF_NetConnect_PersistFolder2_GetCurFolder +}; + +/************************************************************************** +* ISF_NetConnect_Constructor +*/ +HRESULT WINAPI ISF_NetConnect_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv) +{ + IGenericSFImpl *sf; + + if (!ppv) + return E_POINTER; + if (pUnkOuter) + return CLASS_E_NOAGGREGATION; + + sf = (IGenericSFImpl *) CoTaskMemAlloc(sizeof (IGenericSFImpl)); + if (!sf) + return E_OUTOFMEMORY; + + sf->ref = 1; + sf->lpVtbl = &vt_ShellFolder2; + sf->lpVtblPersistFolder2 = &vt_PersistFolder2; + sf->lpVtblContextMenu = &vt_ContextMenu2; + sf->pidlRoot = _ILCreateNetConnect(); /* my qualified pidl */ + + if (!SUCCEEDED (IShellFolder2_QueryInterface ((IShellFolder2*)sf, riid, ppv))) + { + IShellFolder2_Release((IShellFolder2*)sf); + return E_NOINTERFACE; + } + + return S_OK; +} diff --git a/reactos/dll/win32/newdev/lang/bg-BG.rc b/reactos/dll/win32/newdev/lang/bg-BG.rc index 07e38b70958..6a3235829a0 100644 --- a/reactos/dll/win32/newdev/lang/bg-BG.rc +++ b/reactos/dll/win32/newdev/lang/bg-BG.rc @@ -9,9 +9,9 @@ BEGIN LTEXT "Здравейте",IDC_WELCOMETITLE,120,8,195,24 LTEXT "Вълшебникът ще сложи водач за ново устройство:", IDC_STATIC,120,21,195,16 - LTEXT "Натиснете 'Напред' за продължение.",IDC_STATIC,120,169,195,17 + LTEXT "Натиснете „Напред“ за продължение.",IDC_STATIC,120,169,195,17 LTEXT "НЕИЗВЕСТНО УСТРОЙСТВО",IDC_DEVICE,134,36,164,11 - LTEXT "WARNING! INSTALLING A CUSTOM DEVICE MAY FREEZE YOUR COMPUTER OR RENDER IT UNBOOTABLE!",IDC_STATIC,120,59,195,16 + LTEXT "ВБИМАНИЕ! СЛАГАНЕТО НА ИЗБРАНО ОТ ПОТРЕБИТЕЛЯ УСТРОЙСТВО МОЖЕ ДА ДОВЕДЕ ДО ЗАБИВАНЕ НА КОМПЮТЪРА ВИ ИЛИ ДА ГО НАПРАВИ НЕЗАПУСКАЕМ!",IDC_STATIC,120,59,195,16 CONTROL "Сам сложи водача",IDC_RADIO_AUTO,"Button", BS_AUTORADIOBUTTON,120,112,178,13 CONTROL "Слагане на водача от определено място",IDC_RADIO_MANUAL, @@ -27,7 +27,7 @@ BEGIN LTEXT "Слагането неуспешно",IDC_FINISHTITLE,120,8,195,24 LTEXT "Устройството не можа да бъде подкарано, защото не бе намерен водач.", IDC_STATIC,120,40,195,19 - LTEXT "натиснете 'Назад', ако имате диск с водач или знаете пътя към него.", + LTEXT "Натиснете „Назад“, ако имате диск с водач или знаете пътя към него.", IDC_STATIC,120,98,181,24 CONTROL "Този прозорец да не се показва повече",IDC_DONOTSHOWDLG,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,120,170,180,11 @@ -88,7 +88,7 @@ BEGIN LTEXT "Слагането приключи",IDC_FINISHTITLE,120,8,195,11 LTEXT "Трябва да презапуснете компютъра, за да завърши слагането на:", IDC_STATIC,120,32,195,19 - LTEXT "натиснете 'Край', за да затворите вълшебника.",IDC_STATIC,120,174, + LTEXT "Натиснете „Край“, за да затворите вълшебника.",IDC_STATIC,120,174, 179,11 LTEXT "НЕИЗВЕСТНО УСТРОЙСТВО",IDC_DEVICE,148,53,147,12 END @@ -102,7 +102,7 @@ BEGIN LTEXT "Слагането завърши",IDC_FINISHTITLE,120,8,195,11 LTEXT "Вълшебникът завърши слагането на водач за:", IDC_STATIC,120,32,195,19 - LTEXT "Натиснете 'Край' за затваряне на вълшебника.",IDC_STATIC,120,174, + LTEXT "Натиснете „Край“ за затваряне на вълшебника.",IDC_STATIC,120,174, 179,11 LTEXT "НЕИЗВЕСТНО УСТРОЙСТВО",IDC_DEVICE,148,53,147,12 END diff --git a/reactos/dll/win32/odbc32/odbc32.rbuild b/reactos/dll/win32/odbc32/odbc32.rbuild new file mode 100644 index 00000000000..4a968919a51 --- /dev/null +++ b/reactos/dll/win32/odbc32/odbc32.rbuild @@ -0,0 +1,16 @@ + + + + + + . + include/reactos/wine + + 0x600 + 0x600 + wine + kernel32 + proxyodbc.c + odbc32.spec + + diff --git a/reactos/dll/win32/psapi/psapi.c b/reactos/dll/win32/psapi/psapi.c index 7add84ec870..934aeb3694a 100644 --- a/reactos/dll/win32/psapi/psapi.c +++ b/reactos/dll/win32/psapi/psapi.c @@ -1398,4 +1398,17 @@ QueryWorkingSet(HANDLE hProcess, return TRUE; } +/* + * @unimplemented + */ +BOOL +WINAPI +QueryWorkingSetEx(IN HANDLE hProcess, + IN OUT PVOID pv, + IN DWORD cb) +{ + UNIMPLEMENTED; + return FALSE; +} + /* EOF */ diff --git a/reactos/dll/win32/psapi/psapi.def b/reactos/dll/win32/psapi/psapi.def index 16b71423835..b7c93913814 100644 --- a/reactos/dll/win32/psapi/psapi.def +++ b/reactos/dll/win32/psapi/psapi.def @@ -32,3 +32,4 @@ GetProcessMemoryInfo@12 @21 GetWsChanges@12 @22 InitializeProcessForWsWatch@4 @23 QueryWorkingSet@12 @24 +QueryWorkingSetEx@12 @25 \ No newline at end of file diff --git a/reactos/dll/win32/riched20/caret.c b/reactos/dll/win32/riched20/caret.c index c23d92c01c0..376318e7309 100644 --- a/reactos/dll/win32/riched20/caret.c +++ b/reactos/dll/win32/riched20/caret.c @@ -215,7 +215,7 @@ ME_GetCursorCoordinates(ME_TextEditor *editor, ME_Cursor *pCursor, *height = pSizeRun->member.run.nAscent + pSizeRun->member.run.nDescent; *x = run->member.run.pt.x + sz.cx; - *y = para->member.para.nYPos + row->member.row.nBaseline + run->member.run.pt.y - pSizeRun->member.run.nAscent - ME_GetYScrollPos(editor); + *y = para->member.para.pt.y + row->member.row.nBaseline + run->member.run.pt.y - pSizeRun->member.run.nAscent - ME_GetYScrollPos(editor); ME_DestroyContext(&c, editor->hWnd); return; } @@ -234,7 +234,7 @@ ME_MoveCaret(ME_TextEditor *editor) if (ME_WrapMarkedParagraphs(editor)) ME_UpdateScrollBar(editor); ME_GetCursorCoordinates(editor, &editor->pCursors[0], &x, &y, &height); - if(editor->bHaveFocus) + if(editor->bHaveFocus && !ME_IsSelection(editor)) { RECT rect; @@ -249,38 +249,96 @@ ME_MoveCaret(ME_TextEditor *editor) void ME_ShowCaret(ME_TextEditor *ed) { ME_MoveCaret(ed); - if(ed->bHaveFocus) + if(ed->bHaveFocus && !ME_IsSelection(ed)) ShowCaret(ed->hWnd); } void ME_HideCaret(ME_TextEditor *ed) { - if(ed->bHaveFocus) + if(!ed->bHaveFocus || ME_IsSelection(ed)) { HideCaret(ed->hWnd); DestroyCaret(); } } -void ME_InternalDeleteText(ME_TextEditor *editor, int nOfs, - int nChars) +BOOL ME_InternalDeleteText(ME_TextEditor *editor, int nOfs, int nChars, + BOOL bForce) { ME_Cursor c; int shift = 0; - + int totalChars = nChars; + ME_DisplayItem *start_para; + + { + /* Prevent deletion past last end of paragraph run. */ + ME_DisplayItem *pTextEnd = editor->pBuffer->pLast; + int nMaxChars = pTextEnd->member.para.prev_para->member.para.nCharOfs; + nMaxChars += ME_FindItemBack(pTextEnd, diRun)->member.run.nCharOfs; + nMaxChars -= nOfs; + nChars = min(nChars, nMaxChars); + } + + ME_CursorFromCharOfs(editor, nOfs, &c); + start_para = ME_GetParagraph(c.pRun); + + if (!bForce) + { + ME_ProtectPartialTableDeletion(editor, nOfs, &nChars); + if (nChars == 0) + return FALSE; + } + while(nChars > 0) { ME_Run *run; - ME_CursorFromCharOfs(editor, nOfs, &c); + ME_CursorFromCharOfs(editor, nOfs+nChars, &c); + if (!c.nOffset && + nOfs+nChars == (c.pRun->member.run.nCharOfs + + ME_GetParagraph(c.pRun)->member.para.nCharOfs)) + { + /* We aren't deleting anything in this run, so we will go back to the + * last run we are deleting text in. */ + c.pRun = ME_FindItemBack(c.pRun, diRun); + if (c.pRun->member.run.nFlags & MERF_ENDPARA) + c.nOffset = c.pRun->member.run.nCR + c.pRun->member.run.nLF; + else + c.nOffset = c.pRun->member.run.strText->nLen; + } run = &c.pRun->member.run; if (run->nFlags & MERF_ENDPARA) { int eollen = run->nCR + run->nLF; + BOOL keepFirstParaFormat; if (!ME_FindItemFwd(c.pRun, diParagraph)) { - return; + return TRUE; } - ME_JoinParagraphs(editor, ME_GetParagraph(c.pRun)); + keepFirstParaFormat = (totalChars == nChars && nChars <= eollen && + run->nCharOfs); + if (!editor->bEmulateVersion10) /* v4.1 */ + { + ME_DisplayItem *next_para = ME_FindItemFwd(c.pRun, diParagraphOrEnd); + ME_DisplayItem *this_para = next_para->member.para.prev_para; + + /* The end of paragraph before a table row is only deleted if there + * is nothing else on the line before it. */ + if (this_para == start_para && + next_para->member.para.nFlags & MEPF_ROWSTART) + { + /* If the paragraph will be empty, then it should be deleted, however + * it still might have text right now which would inherit the + * MEPF_STARTROW property if we joined it right now. + * Instead we will delete it after the preceding text is deleted. */ + if (nOfs > this_para->member.para.nCharOfs) { + /* Skip this end of line. */ + nChars -= (eollen < nChars) ? eollen : nChars; + continue; + } + keepFirstParaFormat = TRUE; + } + } + ME_JoinParagraphs(editor, ME_GetParagraph(c.pRun), keepFirstParaFormat); /* ME_SkipAndPropagateCharOffset(p->pRun, shift); */ ME_CheckCharOffsets(editor); nChars -= (eollen < nChars) ? eollen : nChars; @@ -289,22 +347,21 @@ void ME_InternalDeleteText(ME_TextEditor *editor, int nOfs, else { ME_Cursor cursor; - int nIntendedChars = nChars; - int nCharsToDelete = nChars; + int nCharsToDelete = min(nChars, c.nOffset); int i; - int loc = c.nOffset; - + + c.nOffset -= nCharsToDelete; + ME_FindItemBack(c.pRun, diParagraph)->member.para.nFlags |= MEPF_REWRAP; - + cursor = c; - ME_StrRelPos(run->strText, loc, &nChars); /* nChars is the number of characters that should be deleted from the - FOLLOWING runs (these AFTER cursor.pRun) + PRECEDING runs (these BEFORE cursor.pRun) nCharsToDelete is a number of chars to delete from THIS run */ - nCharsToDelete -= nChars; + nChars -= nCharsToDelete; shift -= nCharsToDelete; - TRACE("Deleting %d (intended %d-remaning %d) chars at %d in '%s' (%d)\n", - nCharsToDelete, nIntendedChars, nChars, c.nOffset, + TRACE("Deleting %d (remaning %d) chars at %d in '%s' (%d)\n", + nCharsToDelete, nChars, c.nOffset, debugstr_w(run->strText->szData), run->strText->nLen); if (!c.nOffset && ME_StrVLen(run->strText) == nCharsToDelete) @@ -314,7 +371,7 @@ void ME_InternalDeleteText(ME_TextEditor *editor, int nOfs, to the current (deleted) run */ ME_UndoItem *pUndo = ME_AddUndoItem(editor, diUndoInsertRun, c.pRun); if (pUndo) - pUndo->di.member.run.nCharOfs = nOfs; + pUndo->di.member.run.nCharOfs = nOfs+nChars; } else { @@ -322,7 +379,7 @@ void ME_InternalDeleteText(ME_TextEditor *editor, int nOfs, ME_UndoItem *pUndo = ME_AddUndoItem(editor, diUndoInsertRun, c.pRun); if (pUndo) { ME_DestroyString(pUndo->di.member.run.strText); - pUndo->di.member.run.nCharOfs = nOfs; + pUndo->di.member.run.nCharOfs = nOfs+nChars; pUndo->di.member.run.strText = ME_MakeStringN(run->strText->szData+c.nOffset, nCharsToDelete); } } @@ -373,15 +430,16 @@ void ME_InternalDeleteText(ME_TextEditor *editor, int nOfs, continue; } } + return TRUE; } -void ME_DeleteTextAtCursor(ME_TextEditor *editor, int nCursor, - int nChars) +BOOL ME_DeleteTextAtCursor(ME_TextEditor *editor, int nCursor, int nChars) { assert(nCursor>=0 && nCursornCursors); /* text operations set modified state */ editor->nModifyStep = 1; - ME_InternalDeleteText(editor, ME_GetCursorOfs(editor, nCursor), nChars); + return ME_InternalDeleteText(editor, ME_GetCursorOfs(editor, nCursor), nChars, + FALSE); } static ME_DisplayItem * @@ -432,31 +490,6 @@ void ME_InsertEndRowFromCursor(ME_TextEditor *editor, int nCursor) ME_SendSelChange(editor); } -void -ME_InsertTableCellFromCursor(ME_TextEditor *editor, int nCursor) -{ - WCHAR tab = '\t'; - ME_DisplayItem *p, *run; - ME_Style *pStyle = ME_GetInsertStyle(editor, nCursor); - - p = ME_InternalInsertTextFromCursor(editor, nCursor, &tab, 1, pStyle, - MERF_CELL); - run = p; - while ((run = ME_FindItemBack(run, diRunOrParagraph))->type == diRun) - { - if (run->member.run.nFlags & MERF_CELL) - { - assert(run->member.run.pCell->next); - p->member.run.pCell = run->member.run.pCell->next; - return; - } - } - assert(run->type == diParagraph); - assert(run->member.para.bTable); - assert(run->member.para.pCells); - p->member.run.pCell = run->member.para.pCells; -} - void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor, const WCHAR *str, int len, ME_Style *style) @@ -572,7 +605,7 @@ void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor, pos++; numCR = 1; numLF = 0; } - tp = ME_SplitParagraph(editor, p->pRun, p->pRun->member.run.style, numCR, numLF); + tp = ME_SplitParagraph(editor, p->pRun, p->pRun->member.run.style, numCR, numLF, 0); p->pRun = ME_FindItemFwd(tp, diRun); end_run = ME_FindItemBack(tp, diRun); ME_ReleaseStyle(end_run->member.run.style); @@ -619,7 +652,8 @@ ME_MoveCursorChars(ME_TextEditor *editor, ME_Cursor *pCursor, int nRelOfs) assert(pRun->type != diRun && pRun->type != diParagraph); return FALSE; } - } while (RUN_IS_HIDDEN(&pRun->member.run)); + } while (RUN_IS_HIDDEN(&pRun->member.run) || + pRun->member.run.nFlags & MERF_HIDDEN); pCursor->pRun = pRun; if (pRun->member.run.nFlags & MERF_ENDPARA) pCursor->nOffset = 0; @@ -645,7 +679,8 @@ ME_MoveCursorChars(ME_TextEditor *editor, ME_Cursor *pCursor, int nRelOfs) } do { pRun = ME_FindItemFwd(pRun, diRun); - } while (pRun && RUN_IS_HIDDEN(&pRun->member.run)); + } while (pRun && (RUN_IS_HIDDEN(&pRun->member.run) || + pRun->member.run.nFlags & MERF_HIDDEN)); if (pRun) { pCursor->pRun = pRun; @@ -690,9 +725,13 @@ ME_MoveCursorWords(ME_TextEditor *editor, ME_Cursor *cursor, int nRelOfs) { if (cursor->pRun == pRun && cursor->nOffset == 0) { + /* Skip empty start of table row paragraph */ + if (pOtherRun->member.para.prev_para->member.para.nFlags & MEPF_ROWSTART) + pOtherRun = pOtherRun->member.para.prev_para; /* Paragraph breaks are treated as separate words */ if (pOtherRun->member.para.prev_para->type == diTextStart) return FALSE; + pRun = ME_FindItemBack(pOtherRun, diRunOrParagraph); } break; @@ -723,6 +762,8 @@ ME_MoveCursorWords(ME_TextEditor *editor, ME_Cursor *cursor, int nRelOfs) } else if (pOtherRun->type == diParagraph) { + if (pOtherRun->member.para.nFlags & MEPF_ROWSTART) + pOtherRun = pOtherRun->member.para.next_para; if (cursor->pRun == pRun) pRun = ME_FindItemFwd(pOtherRun, diRun); nOffset = 0; @@ -744,13 +785,63 @@ ME_MoveCursorWords(ME_TextEditor *editor, ME_Cursor *cursor, int nRelOfs) void -ME_SelectWord(ME_TextEditor *editor) +ME_SelectByType(ME_TextEditor *editor, ME_SelectionType selectionType) { - ME_MoveCursorWords(editor, &editor->pCursors[1], +1); - editor->pCursors[0] = editor->pCursors[1]; - ME_MoveCursorWords(editor, &editor->pCursors[0], -1); -} + /* pCursor[0] is the end of the selection + * pCursor[1] is the start of the selection (or the position selection anchor) + * pCursor[2] and [3] are the selection anchors that are backed up + * so they are kept when the selection changes for drag selection. + */ + editor->nSelectionType = selectionType; + switch(selectionType) + { + case stPosition: + break; + case stWord: + ME_MoveCursorWords(editor, &editor->pCursors[0], +1); + editor->pCursors[1] = editor->pCursors[0]; + ME_MoveCursorWords(editor, &editor->pCursors[1], -1); + break; + case stLine: + case stParagraph: + { + ME_DisplayItem *pItem; + ME_DIType fwdSearchType, backSearchType; + if (selectionType == stParagraph) { + backSearchType = diParagraph; + fwdSearchType = diParagraphOrEnd; + } else { + backSearchType = diStartRow; + fwdSearchType = diStartRowOrParagraphOrEnd; + } + pItem = ME_FindItemFwd(editor->pCursors[0].pRun, fwdSearchType); + assert(pItem); + if (pItem->type == diTextEnd) + editor->pCursors[0].pRun = ME_FindItemBack(pItem, diRun); + else + editor->pCursors[0].pRun = ME_FindItemFwd(pItem, diRun); + editor->pCursors[0].nOffset = 0; + + pItem = ME_FindItemBack(pItem, backSearchType); + editor->pCursors[1].pRun = ME_FindItemFwd(pItem, diRun); + editor->pCursors[1].nOffset = 0; + break; + } + case stDocument: + /* Select everything with cursor anchored from the start of the text */ + editor->nSelectionType = stDocument; + editor->pCursors[1].pRun = ME_FindItemFwd(editor->pBuffer->pFirst, diRun); + editor->pCursors[1].nOffset = 0; + editor->pCursors[0].pRun = ME_FindItemBack(editor->pBuffer->pLast, diRun); + editor->pCursors[0].nOffset = 0; + break; + default: assert(0); + } + /* Store the anchor positions for extending the selection. */ + editor->pCursors[2] = editor->pCursors[0]; + editor->pCursors[3] = editor->pCursors[1]; +} int ME_GetCursorOfs(ME_TextEditor *editor, int nCursor) { @@ -759,11 +850,60 @@ int ME_GetCursorOfs(ME_TextEditor *editor, int nCursor) + pCursor->pRun->member.run.nCharOfs + pCursor->nOffset; } -static void ME_FindPixelPos(ME_TextEditor *editor, int x, int y, ME_Cursor *result, BOOL *is_eol) +/* Helper function for ME_FindPixelPos to find paragraph within tables */ +static ME_DisplayItem* ME_FindPixelPosInTableRow(int x, int y, + ME_DisplayItem *para) +{ + ME_DisplayItem *cell, *next_cell; + assert(para->member.para.nFlags & MEPF_ROWSTART); + cell = para->member.para.next_para->member.para.pCell; + assert(cell); + + /* find the cell we are in */ + while ((next_cell = cell->member.cell.next_cell) != NULL) { + if (x < next_cell->member.cell.pt.x) + { + para = ME_FindItemFwd(cell, diParagraph); + /* Found the cell, but there might be multiple paragraphs in + * the cell, so need to search down the cell for the paragraph. */ + while (cell == para->member.para.pCell) { + if (y < para->member.para.pt.y + para->member.para.nHeight) + { + if (para->member.para.nFlags & MEPF_ROWSTART) + return ME_FindPixelPosInTableRow(x, y, para); + else + return para; + } + para = para->member.para.next_para; + } + /* Past the end of the cell, so go back to the last cell paragraph */ + return para->member.para.prev_para; + } + cell = next_cell; + } + /* Return table row delimiter */ + para = ME_FindItemFwd(cell, diParagraph); + assert(para->member.para.nFlags & MEPF_ROWEND); + assert(para->member.para.pFmt->dwMask & PFM_TABLEROWDELIMITER); + assert(para->member.para.pFmt->wEffects & PFE_TABLEROWDELIMITER); + return para; +} + +/* Finds the run and offset from the pixel position. + * + * x & y are pixel positions in virtual coordinates into the rich edit control, + * so client coordinates must first be adjusted by the scroll position. + * + * returns TRUE if the result was exactly under the cursor, otherwise returns + * FALSE, and result is set to the closest position to the coordinates. + */ +static BOOL ME_FindPixelPos(ME_TextEditor *editor, int x, int y, + ME_Cursor *result, BOOL *is_eol) { ME_DisplayItem *p = editor->pBuffer->pFirst->member.para.next_para; ME_DisplayItem *last = NULL; int rx = 0; + BOOL isExact = TRUE; if (is_eol) *is_eol = 0; @@ -772,11 +912,15 @@ static void ME_FindPixelPos(ME_TextEditor *editor, int x, int y, ME_Cursor *resu for (; p != editor->pBuffer->pLast; p = p->member.para.next_para) { assert(p->type == diParagraph); - if (y < p->member.para.nYPos + p->member.para.nHeight) + if (y < p->member.para.pt.y + p->member.para.nHeight) { - y -= p->member.para.nYPos; + if (p->member.para.nFlags & MEPF_ROWSTART) + p = ME_FindPixelPosInTableRow(x, y, p); + y -= p->member.para.pt.y; p = ME_FindItemFwd(p, diStartRow); break; + } else if (p->member.para.nFlags & MEPF_ROWSTART) { + p = ME_GetTableRowEnd(p); } } /* find row */ @@ -784,7 +928,7 @@ static void ME_FindPixelPos(ME_TextEditor *editor, int x, int y, ME_Cursor *resu { ME_DisplayItem *pp; assert(p->type == diStartRow); - if (y < p->member.row.nYPos + p->member.row.nHeight) + if (y < p->member.row.pt.y + p->member.row.nHeight) { p = ME_FindItemFwd(p, diRun); break; @@ -802,6 +946,7 @@ static void ME_FindPixelPos(ME_TextEditor *editor, int x, int y, ME_Cursor *resu /* The position is below the last paragraph, so the last row will be used * rather than the end of the text, so the x position will be used to * determine the offset closest to the pixel position. */ + isExact = FALSE; p = ME_FindItemBack(p, diStartRow); if (p != NULL){ p = ME_FindItemFwd(p, diRun); @@ -830,16 +975,19 @@ static void ME_FindPixelPos(ME_TextEditor *editor, int x, int y, ME_Cursor *resu result->pRun = ME_FindItemFwd(editor->pCursors[0].pRun, diRun); result->nOffset = 0; } - return; + return isExact; } break; case diStartRow: + isExact = FALSE; p = ME_FindItemFwd(p, diRun); if (is_eol) *is_eol = 1; rx = 0; /* FIXME not sure */ goto found_here; + case diCell: case diParagraph: case diTextEnd: + isExact = FALSE; rx = 0; /* FIXME not sure */ p = last; goto found_here; @@ -850,29 +998,102 @@ static void ME_FindPixelPos(ME_TextEditor *editor, int x, int y, ME_Cursor *resu result->pRun = ME_FindItemBack(p, diRun); result->nOffset = 0; assert(result->pRun->member.run.nFlags & MERF_ENDPARA); + return FALSE; } -int -ME_CharFromPos(ME_TextEditor *editor, int x, int y) +/* Returns the character offset closest to the pixel position + * + * x & y are pixel positions in client coordinates. + * + * isExact will be set to TRUE if the run is directly under the pixel + * position, FALSE if it not, unless isExact is set to NULL. + */ +int ME_CharFromPos(ME_TextEditor *editor, int x, int y, BOOL *isExact) { ME_Cursor cursor; RECT rc; + BOOL bResult; GetClientRect(editor->hWnd, &rc); - if (x < 0 || y < 0 || x >= rc.right || y >= rc.bottom) + if (x < 0 || y < 0 || x >= rc.right || y >= rc.bottom) { + if (isExact) *isExact = FALSE; return -1; + } y += ME_GetYScrollPos(editor); - ME_FindPixelPos(editor, x, y, &cursor, NULL); + bResult = ME_FindPixelPos(editor, x, y, &cursor, NULL); + if (isExact) *isExact = bResult; return (ME_GetParagraph(cursor.pRun)->member.para.nCharOfs + cursor.pRun->member.run.nCharOfs + cursor.nOffset); } + +/* Extends the selection with a word, line, or paragraph selection type. + * + * The selection is anchored by editor->pCursors[2-3] such that the text + * between the anchors will remain selected, and one end will be extended. + * + * editor->pCursors[0] should have the position to extend the selection to + * before this function is called. + * + * Nothing will be done if editor->nSelectionType equals stPosition. + */ +static void ME_ExtendAnchorSelection(ME_TextEditor *editor) +{ + ME_Cursor tmp_cursor; + int curOfs, anchorStartOfs, anchorEndOfs; + if (editor->nSelectionType == stPosition || editor->nSelectionType == stDocument) + return; + curOfs = ME_GetCursorOfs(editor, 0); + anchorStartOfs = ME_GetCursorOfs(editor, 3); + anchorEndOfs = ME_GetCursorOfs(editor, 2); + + tmp_cursor = editor->pCursors[0]; + editor->pCursors[0] = editor->pCursors[2]; + editor->pCursors[1] = editor->pCursors[3]; + if (curOfs < anchorStartOfs) + { + /* Extend the left side of selection */ + editor->pCursors[1] = tmp_cursor; + if (editor->nSelectionType == stWord) + ME_MoveCursorWords(editor, &editor->pCursors[1], -1); + else + { + ME_DisplayItem *pItem; + ME_DIType searchType = ((editor->nSelectionType == stLine) ? + diStartRowOrParagraph:diParagraph); + pItem = ME_FindItemBack(editor->pCursors[1].pRun, searchType); + editor->pCursors[1].pRun = ME_FindItemFwd(pItem, diRun); + editor->pCursors[1].nOffset = 0; + } + } + else if (curOfs >= anchorEndOfs) + { + /* Extend the right side of selection */ + editor->pCursors[0] = tmp_cursor; + if (editor->nSelectionType == stWord) + ME_MoveCursorWords(editor, &editor->pCursors[0], +1); + else + { + ME_DisplayItem *pItem; + ME_DIType searchType = ((editor->nSelectionType == stLine) ? + diStartRowOrParagraphOrEnd:diParagraphOrEnd); + pItem = ME_FindItemFwd(editor->pCursors[0].pRun, searchType); + if (pItem->type == diTextEnd) + editor->pCursors[0].pRun = ME_FindItemBack(pItem, diRun); + else + editor->pCursors[0].pRun = ME_FindItemFwd(pItem, diRun); + editor->pCursors[0].nOffset = 0; + } + } +} + void ME_LButtonDown(ME_TextEditor *editor, int x, int y, int clickNum) { ME_Cursor tmp_cursor; int is_selection = 0; + BOOL is_shift; editor->nUDArrowX = -1; @@ -880,59 +1101,54 @@ void ME_LButtonDown(ME_TextEditor *editor, int x, int y, int clickNum) tmp_cursor = editor->pCursors[0]; is_selection = ME_IsSelection(editor); + is_shift = GetKeyState(VK_SHIFT) < 0; - if (x >= editor->selofs) + ME_FindPixelPos(editor, x, y, &editor->pCursors[0], &editor->bCaretAtEnd); + + if (x >= editor->selofs || is_shift) { - ME_FindPixelPos(editor, x, y, &editor->pCursors[0], &editor->bCaretAtEnd); - if (GetKeyState(VK_SHIFT)>=0) + if (clickNum > 1) { - /* Shift key is not down */ editor->pCursors[1] = editor->pCursors[0]; - if (clickNum > 1) - ME_SelectWord(editor); + if (is_shift) { + if (x >= editor->selofs) + ME_SelectByType(editor, stWord); + else + ME_SelectByType(editor, stParagraph); + } else if (clickNum % 2 == 0) { + ME_SelectByType(editor, stWord); + } else { + ME_SelectByType(editor, stParagraph); + } } - else if (!is_selection) { + else if (!is_shift) + { + editor->nSelectionType = stPosition; + editor->pCursors[1] = editor->pCursors[0]; + } + else if (!is_selection) + { + editor->nSelectionType = stPosition; editor->pCursors[1] = tmp_cursor; - is_selection = 1; + } + else if (editor->nSelectionType != stPosition) + { + ME_ExtendAnchorSelection(editor); } } else { - ME_DisplayItem *pRow; - - editor->linesel = 1; - editor->sely = y; - /* Set pCursors[0] to beginning of line */ - ME_FindPixelPos(editor, x, y, &editor->pCursors[1], &editor->bCaretAtEnd); - /* Set pCursors[1] to end of line */ - pRow = ME_FindItemFwd(editor->pCursors[1].pRun, diStartRowOrParagraphOrEnd); - assert(pRow); - /* pCursor[0] is the position where the cursor will be drawn, - * pCursor[1] is the other end of the selection range - * pCursor[2] and [3] are backups of [0] and [1] so I - * don't have to look them up again - */ - - if (pRow->type == diStartRow) { - /* FIXME WTF was I thinking about here ? */ - ME_DisplayItem *pRun = ME_FindItemFwd(pRow, diRun); - assert(pRun); - editor->pCursors[0].pRun = pRun; - editor->pCursors[0].nOffset = 0; - editor->bCaretAtEnd = 1; + if (clickNum < 2) { + ME_SelectByType(editor, stLine); + } else if (clickNum % 2 == 0 || is_shift) { + ME_SelectByType(editor, stParagraph); } else { - editor->pCursors[0].pRun = ME_FindItemBack(pRow, diRun); - assert(editor->pCursors[0].pRun && editor->pCursors[0].pRun->member.run.nFlags & MERF_ENDPARA); - editor->pCursors[0].nOffset = 0; - editor->bCaretAtEnd = 0; + ME_SelectByType(editor, stDocument); } - editor->pCursors[2] = editor->pCursors[0]; - editor->pCursors[3] = editor->pCursors[1]; } ME_InvalidateSelection(editor); HideCaret(editor->hWnd); - ME_MoveCaret(editor); - ShowCaret(editor->hWnd); + ME_ShowCaret(editor); ME_ClearTempStyle(editor); ME_SendSelChange(editor); } @@ -941,43 +1157,38 @@ void ME_MouseMove(ME_TextEditor *editor, int x, int y) { ME_Cursor tmp_cursor; + if (editor->nSelectionType == stDocument) + return; y += ME_GetYScrollPos(editor); tmp_cursor = editor->pCursors[0]; /* FIXME: do something with the return value of ME_FindPixelPos */ - if (!editor->linesel) - ME_FindPixelPos(editor, x, y, &tmp_cursor, &editor->bCaretAtEnd); - else ME_FindPixelPos(editor, (y > editor->sely) * editor->rcFormat.right, y, &tmp_cursor, &editor->bCaretAtEnd); - - if (!memcmp(&tmp_cursor, editor->pCursors, sizeof(tmp_cursor))) - return; + ME_FindPixelPos(editor, x, y, &tmp_cursor, &editor->bCaretAtEnd); ME_InvalidateSelection(editor); - if (!editor->linesel) - editor->pCursors[0] = tmp_cursor; - else if (!memcmp(&tmp_cursor, editor->pCursors+2, sizeof(tmp_cursor)) || - !memcmp(&tmp_cursor, editor->pCursors+3, sizeof(tmp_cursor))) + editor->pCursors[0] = tmp_cursor; + ME_ExtendAnchorSelection(editor); + + if (editor->nSelectionType != stPosition && + memcmp(&editor->pCursors[1], &editor->pCursors[3], sizeof(ME_Cursor))) { - editor->pCursors[0] = editor->pCursors[2]; - editor->pCursors[1] = editor->pCursors[3]; - } - else if (y < editor->sely) - { - editor->pCursors[0] = tmp_cursor; - editor->pCursors[1] = editor->pCursors[2]; - } - else - { - editor->pCursors[0] = tmp_cursor; - editor->pCursors[1] = editor->pCursors[3]; + /* The scroll the cursor towards the other end, since it was the one + * extended by ME_ExtendAnchorSelection + */ + ME_Cursor tmpCursor = editor->pCursors[0]; + editor->pCursors[0] = editor->pCursors[1]; + editor->pCursors[1] = tmpCursor; + SendMessageW(editor->hWnd, EM_SCROLLCARET, 0, 0); + editor->pCursors[1] = editor->pCursors[0]; + editor->pCursors[0] = tmpCursor; + } else { + SendMessageW(editor->hWnd, EM_SCROLLCARET, 0, 0); } + ME_InvalidateSelection(editor); HideCaret(editor->hWnd); - ME_MoveCaret(editor); - ME_InvalidateSelection(editor); - ShowCaret(editor->hWnd); + ME_ShowCaret(editor); ME_SendSelChange(editor); - SendMessageW(editor->hWnd, EM_SCROLLCARET, 0, 0); } static ME_DisplayItem *ME_FindRunInRow(ME_TextEditor *editor, ME_DisplayItem *pRow, @@ -1048,13 +1259,14 @@ static void ME_MoveCursorLines(ME_TextEditor *editor, ME_Cursor *pCursor, int nRelOfs) { ME_DisplayItem *pRun = pCursor->pRun; - ME_DisplayItem *pItem; + ME_DisplayItem *pItem, *pOldPara, *pNewPara; int x = ME_GetXForArrow(editor, pCursor); if (editor->bCaretAtEnd && !pCursor->nOffset) pRun = ME_FindItemBack(pRun, diRun); if (!pRun) return; + pOldPara = ME_GetParagraph(pRun); if (nRelOfs == -1) { /* start of this row */ @@ -1062,13 +1274,57 @@ ME_MoveCursorLines(ME_TextEditor *editor, ME_Cursor *pCursor, int nRelOfs) assert(pItem); /* start of the previous row */ pItem = ME_FindItemBack(pItem, diStartRow); + if (!pItem) + return; /* row not found - ignore */ + pNewPara = ME_GetParagraph(pItem); + if (pOldPara->member.para.nFlags & MEPF_ROWEND || + (pOldPara->member.para.pCell && + pOldPara->member.para.pCell != pNewPara->member.para.pCell)) + { + /* Brought out of a cell */ + pNewPara = ME_GetTableRowStart(pOldPara)->member.para.prev_para; + if (pNewPara->type == diTextStart) + return; /* At the top, so don't go anywhere. */ + pItem = ME_FindItemFwd(pNewPara, diStartRow); + } + if (pNewPara->member.para.nFlags & MEPF_ROWEND) + { + /* Brought into a table row */ + ME_Cell *cell = &ME_FindItemBack(pNewPara, diCell)->member.cell; + while (x < cell->pt.x && cell->prev_cell) + cell = &cell->prev_cell->member.cell; + if (cell->next_cell) /* else - we are still at the end of the row */ + pItem = ME_FindItemBack(cell->next_cell, diStartRow); + } } else { /* start of the next row */ pItem = ME_FindItemFwd(pRun, diStartRow); + if (!pItem) + return; /* row not found - ignore */ /* FIXME If diParagraph is before diStartRow, wrap the next paragraph? */ + pNewPara = ME_GetParagraph(pItem); + if (pOldPara->member.para.nFlags & MEPF_ROWSTART || + (pOldPara->member.para.pCell && + pOldPara->member.para.pCell != pNewPara->member.para.pCell)) + { + /* Brought out of a cell */ + pNewPara = ME_GetTableRowEnd(pOldPara)->member.para.next_para; + if (pNewPara->type == diTextEnd) + return; /* At the bottom, so don't go anywhere. */ + pItem = ME_FindItemFwd(pNewPara, diStartRow); + } + if (pNewPara->member.para.nFlags & MEPF_ROWSTART) + { + /* Brought into a table row */ + ME_DisplayItem *cell = ME_FindItemFwd(pNewPara, diCell); + while (cell->member.cell.next_cell && + x >= cell->member.cell.next_cell->member.cell.pt.x) + cell = cell->member.cell.next_cell; + pItem = ME_FindItemFwd(cell, diStartRow); + } } if (!pItem) { @@ -1094,8 +1350,8 @@ static void ME_ArrowPageUp(ME_TextEditor *editor, ME_Cursor *pCursor) p = ME_FindItemBack(pRun, diStartRowOrParagraph); assert(p->type == diStartRow); - yp = ME_FindItemBack(p, diParagraph)->member.para.nYPos; - yprev = ys = y = yp + p->member.row.nYPos; + yp = ME_FindItemBack(p, diParagraph)->member.para.pt.y; + yprev = ys = y = yp + p->member.row.pt.y; yd = y - editor->sizeWindow.cy; pLast = p; @@ -1106,10 +1362,10 @@ static void ME_ArrowPageUp(ME_TextEditor *editor, ME_Cursor *pCursor) if (p->type == diParagraph) { /* crossing paragraphs */ if (p->member.para.prev_para == NULL) break; - yp = p->member.para.prev_para->member.para.nYPos; + yp = p->member.para.prev_para->member.para.pt.y; continue; } - y = yp + p->member.row.nYPos; + y = yp + p->member.row.pt.y; if (y < yd) break; pLast = p; @@ -1149,8 +1405,8 @@ static void ME_ArrowPageDown(ME_TextEditor *editor, ME_Cursor *pCursor) p = ME_FindItemBack(pRun, diStartRowOrParagraph); assert(p->type == diStartRow); - yp = ME_FindItemBack(p, diParagraph)->member.para.nYPos; - yprev = ys = y = yp + p->member.row.nYPos; + yp = ME_FindItemBack(p, diParagraph)->member.para.pt.y; + yprev = ys = y = yp + p->member.row.pt.y; yd = y + editor->sizeWindow.cy; pLast = p; @@ -1159,10 +1415,10 @@ static void ME_ArrowPageDown(ME_TextEditor *editor, ME_Cursor *pCursor) if (!p) break; if (p->type == diParagraph) { - yp = p->member.para.nYPos; + yp = p->member.para.pt.y; continue; } - y = yp + p->member.row.nYPos; + y = yp + p->member.row.pt.y; if (y >= yd) break; pLast = p; diff --git a/reactos/dll/win32/riched20/editor.c b/reactos/dll/win32/riched20/editor.c index 2d000616e36..aa5938326a3 100644 --- a/reactos/dll/win32/riched20/editor.c +++ b/reactos/dll/win32/riched20/editor.c @@ -140,10 +140,10 @@ + WM_SETTEXT (resets undo stack !) (proper style?) ANSI&Unicode - WM_STYLECHANGING - WM_STYLECHANGED (things like read-only flag) - - WM_UNICHAR - + + WM_UNICHAR + Notifications - + * EN_CHANGE (sent from the wrong place) - EN_CORRECTTEXT - EN_DROPFILES @@ -320,6 +320,32 @@ static LRESULT ME_StreamInText(ME_TextEditor *editor, DWORD dwFormat, ME_InStrea return 0; } +static void ME_ApplyBorderProperties(RTF_Info *info, + ME_BorderRect *borderRect, + RTFBorder *borderDef) +{ + int i, colorNum; + ME_Border *pBorders[] = {&borderRect->top, + &borderRect->left, + &borderRect->bottom, + &borderRect->right}; + for (i = 0; i < 4; i++) + { + RTFColor *colorDef = info->colorList; + pBorders[i]->width = borderDef[i].width; + colorNum = borderDef[i].color; + while (colorDef && colorDef->rtfCNum != colorNum) + colorDef = colorDef->rtfNextColor; + if (colorDef) + pBorders[i]->colorRef = RGB( + colorDef->rtfCRed >= 0 ? colorDef->rtfCRed : 0, + colorDef->rtfCGreen >= 0 ? colorDef->rtfCGreen : 0, + colorDef->rtfCBlue >= 0 ? colorDef->rtfCBlue : 0); + else + pBorders[i]->colorRef = RGB(0, 0, 0); + } +} + static void ME_RTFCharAttrHook(RTF_Info *info) { CHARFORMAT2W fmt; @@ -451,8 +477,13 @@ static void ME_RTFParAttrHook(RTF_Info *info) switch(info->rtfMinor) { case rtfParDef: /* restores default paragraph attributes */ - fmt.dwMask = PFM_ALIGNMENT | PFM_BORDER | PFM_LINESPACING | PFM_TABSTOPS | PFM_OFFSET | - PFM_RIGHTINDENT | PFM_SPACEAFTER | PFM_SPACEBEFORE | PFM_STARTINDENT; + if (!info->editor->bEmulateVersion10) /* v4.1 */ + info->borderType = RTFBorderParaLeft; + else /* v1.0 - 3.0 */ + info->borderType = RTFBorderParaTop; + fmt.dwMask = PFM_ALIGNMENT | PFM_BORDER | PFM_LINESPACING | PFM_TABSTOPS | + PFM_OFFSET | PFM_RIGHTINDENT | PFM_SPACEAFTER | PFM_SPACEBEFORE | + PFM_STARTINDENT; /* TODO: numbering, shading */ fmt.wAlignment = PFA_LEFT; fmt.cTabCount = 0; @@ -462,31 +493,113 @@ static void ME_RTFParAttrHook(RTF_Info *info) fmt.bLineSpacingRule = 0; fmt.dySpaceBefore = fmt.dySpaceAfter = 0; fmt.dyLineSpacing = 0; - RTFFlushOutputBuffer(info); - ME_GetParagraph(info->editor->pCursors[0].pRun)->member.para.bTable = FALSE; + if (!info->editor->bEmulateVersion10) /* v4.1 */ + { + if (info->tableDef && info->tableDef->tableRowStart && + info->tableDef->tableRowStart->member.para.nFlags & MEPF_ROWEND) + { + ME_Cursor cursor; + ME_DisplayItem *para; + /* We are just after a table row. */ + RTFFlushOutputBuffer(info); + cursor = info->editor->pCursors[0]; + para = ME_GetParagraph(cursor.pRun); + if (para == info->tableDef->tableRowStart->member.para.next_para + && !cursor.nOffset && !cursor.pRun->member.run.nCharOfs) + { + /* Since the table row end, no text has been inserted, and the \intbl + * control word has not be used. We can confirm that we are not in a + * table anymore. + */ + info->tableDef->tableRowStart = NULL; + info->canInheritInTbl = FALSE; + } + } + } else { /* v1.0 - v3.0 */ + fmt.dwMask |= PFM_TABLE; + fmt.wEffects &= ~PFE_TABLE; + } + break; + case rtfNestLevel: + if (!info->editor->bEmulateVersion10) /* v4.1 */ + { + while (info->rtfParam > info->nestingLevel) { + RTFTable *tableDef = ALLOC_OBJ(RTFTable); + ZeroMemory(tableDef, sizeof(RTFTable)); + tableDef->parent = info->tableDef; + info->tableDef = tableDef; + + RTFFlushOutputBuffer(info); + if (tableDef->tableRowStart && + tableDef->tableRowStart->member.para.nFlags & MEPF_ROWEND) + { + ME_DisplayItem *para = tableDef->tableRowStart; + para = para->member.para.next_para; + para = ME_InsertTableRowStartAtParagraph(info->editor, para); + tableDef->tableRowStart = para; + } else { + ME_Cursor cursor; + WCHAR endl = '\r'; + cursor = info->editor->pCursors[0]; + if (cursor.nOffset || cursor.pRun->member.run.nCharOfs) + ME_InsertTextFromCursor(info->editor, 0, &endl, 1, info->style); + tableDef->tableRowStart = ME_InsertTableRowStartFromCursor(info->editor); + } + + info->nestingLevel++; + } + info->canInheritInTbl = FALSE; + } break; case rtfInTable: { - ME_DisplayItem *para; - - RTFFlushOutputBuffer(info); - para = ME_GetParagraph(info->editor->pCursors[0].pRun); - assert(para->member.para.pCells); - para->member.para.bTable = TRUE; - return; + if (!info->editor->bEmulateVersion10) /* v4.1 */ + { + if (info->nestingLevel < 1) + { + RTFTable *tableDef; + if (!info->tableDef) + { + info->tableDef = ALLOC_OBJ(RTFTable); + ZeroMemory(info->tableDef, sizeof(RTFTable)); + } + tableDef = info->tableDef; + RTFFlushOutputBuffer(info); + if (tableDef->tableRowStart && + tableDef->tableRowStart->member.para.nFlags & MEPF_ROWEND) + { + ME_DisplayItem *para = tableDef->tableRowStart; + para = para->member.para.next_para; + para = ME_InsertTableRowStartAtParagraph(info->editor, para); + tableDef->tableRowStart = para; + } else { + ME_Cursor cursor; + WCHAR endl = '\r'; + cursor = info->editor->pCursors[0]; + if (cursor.nOffset || cursor.pRun->member.run.nCharOfs) + ME_InsertTextFromCursor(info->editor, 0, &endl, 1, info->style); + tableDef->tableRowStart = ME_InsertTableRowStartFromCursor(info->editor); + } + info->nestingLevel = 1; + info->canInheritInTbl = TRUE; + } + return; + } else { /* v1.0 - v3.0 */ + fmt.dwMask |= PFM_TABLE; + fmt.wEffects |= PFE_TABLE; + } + break; } case rtfFirstIndent: ME_GetSelectionParaFormat(info->editor, &fmt); - fmt.dwMask |= PFM_STARTINDENT | PFM_OFFSET; - fmt.dxStartIndent += info->rtfParam; + fmt.dwMask = PFM_STARTINDENT | PFM_OFFSET; + fmt.dxStartIndent += fmt.dxOffset + info->rtfParam; fmt.dxOffset = -info->rtfParam; break; case rtfLeftIndent: - /* we assume rtfLeftIndent is always specified before rtfFirstIndent */ ME_GetSelectionParaFormat(info->editor, &fmt); - fmt.dwMask |= PFM_STARTINDENT; - fmt.dxStartIndent = info->rtfParam; - fmt.dxOffset = 0; + fmt.dwMask = PFM_STARTINDENT; + fmt.dxStartIndent = info->rtfParam - fmt.dxOffset; break; case rtfRightIndent: fmt.dwMask = PFM_RIGHTINDENT; @@ -509,11 +622,11 @@ static void ME_RTFParAttrHook(RTF_Info *info) ME_GetSelectionParaFormat(info->editor, &fmt); if (!(fmt.dwMask & PFM_TABSTOPS)) { - fmt.dwMask |= PFM_TABSTOPS; fmt.cTabCount = 0; } - if (fmt.cTabCount < MAX_TAB_STOPS) + if (fmt.cTabCount < MAX_TAB_STOPS && info->rtfParam < 0x1000000) fmt.rgxTabs[fmt.cTabCount++] = info->rtfParam; + fmt.dwMask = PFM_TABSTOPS; break; case rtfKeep: fmt.dwMask = PFM_KEEP; @@ -573,90 +686,138 @@ static void ME_RTFParAttrHook(RTF_Info *info) fmt.wNumberingStart = info->rtfParam; break; case rtfBorderLeft: + info->borderType = RTFBorderParaLeft; ME_GetSelectionParaFormat(info->editor, &fmt); if (!(fmt.dwMask & PFM_BORDER)) { - fmt.dwMask |= PFM_BORDER; fmt.wBorderSpace = 0; fmt.wBorderWidth = 1; fmt.wBorders = 0; } fmt.wBorders |= 1; + fmt.dwMask = PFM_BORDER; break; case rtfBorderRight: + info->borderType = RTFBorderParaRight; ME_GetSelectionParaFormat(info->editor, &fmt); if (!(fmt.dwMask & PFM_BORDER)) { - fmt.dwMask |= PFM_BORDER; fmt.wBorderSpace = 0; fmt.wBorderWidth = 1; fmt.wBorders = 0; } fmt.wBorders |= 2; + fmt.dwMask = PFM_BORDER; break; case rtfBorderTop: + info->borderType = RTFBorderParaTop; ME_GetSelectionParaFormat(info->editor, &fmt); if (!(fmt.dwMask & PFM_BORDER)) { - fmt.dwMask |= PFM_BORDER; fmt.wBorderSpace = 0; fmt.wBorderWidth = 1; fmt.wBorders = 0; } fmt.wBorders |= 4; + fmt.dwMask = PFM_BORDER; break; case rtfBorderBottom: + info->borderType = RTFBorderParaBottom; ME_GetSelectionParaFormat(info->editor, &fmt); if (!(fmt.dwMask & PFM_BORDER)) { - fmt.dwMask |= PFM_BORDER; fmt.wBorderSpace = 0; fmt.wBorderWidth = 1; fmt.wBorders = 0; } fmt.wBorders |= 8; + fmt.dwMask = PFM_BORDER; break; case rtfBorderSingle: ME_GetSelectionParaFormat(info->editor, &fmt); /* we assume that borders have been created before (RTF spec) */ fmt.wBorders &= ~0x700; fmt.wBorders |= 1 << 8; + fmt.dwMask = PFM_BORDER; break; case rtfBorderThick: ME_GetSelectionParaFormat(info->editor, &fmt); /* we assume that borders have been created before (RTF spec) */ fmt.wBorders &= ~0x700; fmt.wBorders |= 2 << 8; + fmt.dwMask = PFM_BORDER; break; case rtfBorderShadow: ME_GetSelectionParaFormat(info->editor, &fmt); /* we assume that borders have been created before (RTF spec) */ fmt.wBorders &= ~0x700; fmt.wBorders |= 10 << 8; + fmt.dwMask = PFM_BORDER; break; case rtfBorderDouble: ME_GetSelectionParaFormat(info->editor, &fmt); /* we assume that borders have been created before (RTF spec) */ fmt.wBorders &= ~0x700; fmt.wBorders |= 7 << 8; + fmt.dwMask = PFM_BORDER; break; case rtfBorderDot: ME_GetSelectionParaFormat(info->editor, &fmt); /* we assume that borders have been created before (RTF spec) */ fmt.wBorders &= ~0x700; fmt.wBorders |= 11 << 8; + fmt.dwMask = PFM_BORDER; break; case rtfBorderWidth: + { + int borderSide = info->borderType & RTFBorderSideMask; + RTFTable *tableDef = info->tableDef; ME_GetSelectionParaFormat(info->editor, &fmt); /* we assume that borders have been created before (RTF spec) */ fmt.wBorderWidth |= ((info->rtfParam / 15) & 7) << 8; + if ((info->borderType & RTFBorderTypeMask) == RTFBorderTypeCell) + { + RTFBorder *border; + if (!tableDef || tableDef->numCellsDefined >= MAX_TABLE_CELLS) + break; + border = &tableDef->cells[tableDef->numCellsDefined].border[borderSide]; + border->width = info->rtfParam; + break; + } + fmt.dwMask = PFM_BORDER; break; + } case rtfBorderSpace: ME_GetSelectionParaFormat(info->editor, &fmt); /* we assume that borders have been created before (RTF spec) */ fmt.wBorderSpace = info->rtfParam; + fmt.dwMask = PFM_BORDER; break; - } + case rtfBorderColor: + { + RTFTable *tableDef = info->tableDef; + int borderSide = info->borderType & RTFBorderSideMask; + int borderType = info->borderType & RTFBorderTypeMask; + switch(borderType) + { + case RTFBorderTypePara: + if (!info->editor->bEmulateVersion10) /* v4.1 */ + break; + /* v1.0 - 3.0 treat paragraph and row borders the same. */ + case RTFBorderTypeRow: + if (tableDef) { + tableDef->border[borderSide].color = info->rtfParam; + } + break; + case RTFBorderTypeCell: + if (tableDef && tableDef->numCellsDefined < MAX_TABLE_CELLS) { + tableDef->cells[tableDef->numCellsDefined].border[borderSide].color = info->rtfParam; + } + break; + } + break; + } + } if (fmt.dwMask) { RTFFlushOutputBuffer(info); /* FIXME too slow ? how come ?*/ @@ -666,35 +827,249 @@ static void ME_RTFParAttrHook(RTF_Info *info) static void ME_RTFTblAttrHook(RTF_Info *info) { - ME_DisplayItem *para; - switch (info->rtfMinor) { case rtfRowDef: - RTFFlushOutputBuffer(info); - para = ME_GetParagraph(info->editor->pCursors[0].pRun); - - /* Release possibly inherited cell definitions */ - ME_DestroyTableCellList(para); - - para->member.para.pCells = ALLOC_OBJ(ME_TableCell); - para->member.para.pCells->nRightBoundary = 0; - para->member.para.pCells->next = NULL; - para->member.para.pLastCell = para->member.para.pCells; - break; - case rtfCellPos: - RTFFlushOutputBuffer(info); - para = ME_GetParagraph(info->editor->pCursors[0].pRun); - - if (para->member.para.pLastCell->nRightBoundary) - { - ME_TableCell *pCell = ALLOC_OBJ(ME_TableCell); - - pCell->next = NULL; - para->member.para.pLastCell->next = pCell; - para->member.para.pLastCell = pCell; + { + if (!info->editor->bEmulateVersion10) /* v4.1 */ + info->borderType = 0; /* Not sure */ + else /* v1.0 - 3.0 */ + info->borderType = RTFBorderRowTop; + if (!info->tableDef) { + info->tableDef = ME_MakeTableDef(info->editor); + } else { + ME_InitTableDef(info->editor, info->tableDef); + } + break; + } + case rtfCellPos: + if (!info->tableDef) + { + info->tableDef = ME_MakeTableDef(info->editor); + } + if (info->tableDef->numCellsDefined >= MAX_TABLE_CELLS) + break; + info->tableDef->cells[info->tableDef->numCellsDefined].rightBoundary = info->rtfParam; + { + /* Tab stops were used to store cell positions before v4.1 but v4.1 + * still seems to set the tabstops without using them. */ + ME_DisplayItem *para = ME_GetParagraph(info->editor->pCursors[0].pRun); + PARAFORMAT2 *pFmt = para->member.para.pFmt; + int cellNum = info->tableDef->numCellsDefined; + pFmt->rgxTabs[cellNum] &= ~0x00FFFFFF; + pFmt->rgxTabs[cellNum] = 0x00FFFFFF & info->rtfParam; + } + info->tableDef->numCellsDefined++; + break; + case rtfRowBordTop: + info->borderType = RTFBorderRowTop; + break; + case rtfRowBordLeft: + info->borderType = RTFBorderRowLeft; + break; + case rtfRowBordBottom: + info->borderType = RTFBorderRowBottom; + break; + case rtfRowBordRight: + info->borderType = RTFBorderRowRight; + break; + case rtfCellBordTop: + info->borderType = RTFBorderCellTop; + break; + case rtfCellBordLeft: + info->borderType = RTFBorderCellLeft; + break; + case rtfCellBordBottom: + info->borderType = RTFBorderCellBottom; + break; + case rtfCellBordRight: + info->borderType = RTFBorderCellRight; + break; + case rtfRowGapH: + if (info->tableDef) + info->tableDef->gapH = info->rtfParam; + break; + case rtfRowLeftEdge: + if (info->tableDef) + info->tableDef->leftEdge = info->rtfParam; + break; + } +} + +static void ME_RTFSpecialCharHook(RTF_Info *info) +{ + RTFTable *tableDef = info->tableDef; + switch (info->rtfMinor) + { + case rtfNestCell: + if (info->editor->bEmulateVersion10) /* v1.0 - v3.0 */ + break; + /* else fall through since v4.1 treats rtfNestCell and rtfCell the same */ + case rtfCell: + if (!tableDef) + break; + RTFFlushOutputBuffer(info); + if (!info->editor->bEmulateVersion10) { /* v4.1 */ + if (tableDef->tableRowStart) + { + if (!info->nestingLevel && + tableDef->tableRowStart->member.para.nFlags & MEPF_ROWEND) + { + ME_DisplayItem *para = tableDef->tableRowStart; + para = para->member.para.next_para; + para = ME_InsertTableRowStartAtParagraph(info->editor, para); + tableDef->tableRowStart = para; + info->nestingLevel = 1; + } + ME_InsertTableCellFromCursor(info->editor); + } + } else { /* v1.0 - v3.0 */ + ME_DisplayItem *para = ME_GetParagraph(info->editor->pCursors[0].pRun); + PARAFORMAT2 *pFmt = para->member.para.pFmt; + if (pFmt->dwMask & PFM_TABLE && pFmt->wEffects & PFE_TABLE && + tableDef->numCellsInserted < tableDef->numCellsDefined) + { + WCHAR tab = '\t'; + ME_InsertTextFromCursor(info->editor, 0, &tab, 1, info->style); + tableDef->numCellsInserted++; + } + } + break; + case rtfNestRow: + if (info->editor->bEmulateVersion10) /* v1.0 - v3.0 */ + break; + /* else fall through since v4.1 treats rtfNestRow and rtfRow the same */ + case rtfRow: + { + ME_DisplayItem *para, *cell, *run; + int i; + + if (!tableDef) + break; + RTFFlushOutputBuffer(info); + if (!info->editor->bEmulateVersion10) { /* v4.1 */ + if (!tableDef->tableRowStart) + break; + if (!info->nestingLevel && + tableDef->tableRowStart->member.para.nFlags & MEPF_ROWEND) + { + para = tableDef->tableRowStart; + para = para->member.para.next_para; + para = ME_InsertTableRowStartAtParagraph(info->editor, para); + tableDef->tableRowStart = para; + info->nestingLevel++; + } + para = tableDef->tableRowStart; + cell = ME_FindItemFwd(para, diCell); + assert(cell && !cell->member.cell.prev_cell); + if (tableDef->numCellsDefined < 1) + { + /* 2000 twips appears to be the cell size that native richedit uses + * when no cell sizes are specified. */ + const int defaultCellSize = 2000; + int nRightBoundary = defaultCellSize; + cell->member.cell.nRightBoundary = nRightBoundary; + while (cell->member.cell.next_cell) { + cell = cell->member.cell.next_cell; + nRightBoundary += defaultCellSize; + cell->member.cell.nRightBoundary = nRightBoundary; + } + para = ME_InsertTableCellFromCursor(info->editor); + cell = para->member.para.pCell; + cell->member.cell.nRightBoundary = nRightBoundary; + } else { + for (i = 0; i < tableDef->numCellsDefined; i++) + { + RTFCell *cellDef = &tableDef->cells[i]; + cell->member.cell.nRightBoundary = cellDef->rightBoundary; + ME_ApplyBorderProperties(info, &cell->member.cell.border, + cellDef->border); + cell = cell->member.cell.next_cell; + if (!cell) + { + para = ME_InsertTableCellFromCursor(info->editor); + cell = para->member.para.pCell; + } + } + /* Cell for table row delimiter is empty */ + cell->member.cell.nRightBoundary = tableDef->cells[i-1].rightBoundary; + } + + run = ME_FindItemFwd(cell, diRun); + if (info->editor->pCursors[0].pRun != run || + info->editor->pCursors[0].nOffset) + { + int nOfs, nChars; + /* Delete inserted cells that aren't defined. */ + info->editor->pCursors[1].pRun = run; + info->editor->pCursors[1].nOffset = 0; + nOfs = ME_GetCursorOfs(info->editor, 1); + nChars = ME_GetCursorOfs(info->editor, 0) - nOfs; + ME_InternalDeleteText(info->editor, nOfs, nChars, TRUE); + } + + para = ME_InsertTableRowEndFromCursor(info->editor); + para->member.para.pFmt->dxOffset = abs(info->tableDef->gapH); + para->member.para.pFmt->dxStartIndent = info->tableDef->leftEdge; + ME_ApplyBorderProperties(info, ¶->member.para.border, + tableDef->border); + info->nestingLevel--; + if (!info->nestingLevel) + { + if (info->canInheritInTbl) { + tableDef->tableRowStart = para; + } else { + while (info->tableDef) { + tableDef = info->tableDef; + info->tableDef = tableDef->parent; + heap_free(tableDef); + } + } + } else { + info->tableDef = tableDef->parent; + heap_free(tableDef); + } + } else { /* v1.0 - v3.0 */ + WCHAR endl = '\r'; + ME_DisplayItem *para = ME_GetParagraph(info->editor->pCursors[0].pRun); + PARAFORMAT2 *pFmt = para->member.para.pFmt; + pFmt->dxOffset = info->tableDef->gapH; + pFmt->dxStartIndent = info->tableDef->leftEdge; + + para = ME_GetParagraph(info->editor->pCursors[0].pRun); + ME_ApplyBorderProperties(info, ¶->member.para.border, + tableDef->border); + while (tableDef->numCellsInserted < tableDef->numCellsDefined) + { + WCHAR tab = '\t'; + ME_InsertTextFromCursor(info->editor, 0, &tab, 1, info->style); + tableDef->numCellsInserted++; + } + pFmt->cTabCount = tableDef->numCellsDefined; + if (!tableDef->numCellsDefined) + pFmt->wEffects &= ~PFE_TABLE; + ME_InsertTextFromCursor(info->editor, 0, &endl, 1, info->style); + tableDef->numCellsInserted = 0; + } + break; + } + case rtfTab: + case rtfPar: + if (info->editor->bEmulateVersion10) { /* v1.0 - 3.0 */ + ME_DisplayItem *para; + PARAFORMAT2 *pFmt; + RTFFlushOutputBuffer(info); + para = ME_GetParagraph(info->editor->pCursors[0].pRun); + pFmt = para->member.para.pFmt; + if (pFmt->dwMask & PFM_TABLE && pFmt->wEffects & PFE_TABLE) + { + /* rtfPar is treated like a space within a table. */ + info->rtfClass = rtfText; + info->rtfMajor = ' '; + } + else if (info->rtfMinor == rtfPar && tableDef) + tableDef->numCellsInserted = 0; } - para->member.para.pLastCell->nRightBoundary = info->rtfParam; break; } } @@ -1001,11 +1376,8 @@ static void ME_RTFReadHook(RTF_Info *info) { ME_RTFTblAttrHook(info); break; case rtfSpecialChar: - if (info->rtfMinor == rtfCell) - { - RTFFlushOutputBuffer(info); - ME_InsertTableCellFromCursor(info->editor, 0); - } + ME_RTFSpecialCharHook(info); + break; } break; } @@ -1037,16 +1409,19 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre if ((format & SFF_SELECTION) && (editor->mode & TM_RICHTEXT)) { style = ME_GetSelectionInsertStyle(editor); - ME_InternalDeleteText(editor, from, to-from); + ME_InternalDeleteText(editor, from, to-from, FALSE); } else { + ME_DisplayItem *para_item; style = editor->pBuffer->pDefaultStyle; ME_AddRefStyle(style); SendMessageA(editor->hWnd, EM_SETSEL, 0, 0); - ME_InternalDeleteText(editor, 0, ME_GetTextLength(editor)); + ME_InternalDeleteText(editor, 0, ME_GetTextLength(editor), FALSE); from = to = 0; ME_ClearTempStyle(editor); - /* FIXME restore default paragraph formatting ! */ + + para_item = ME_GetParagraph(editor->pCursors[0].pRun); + ME_SetDefaultParaFormat(para_item->member.para.pFmt); } @@ -1080,6 +1455,8 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre if (!invalidRTF && !inStream.editstream->dwError) { if (format & SF_RTF) { + ME_DisplayItem *para; + /* setup the RTF parser */ memset(&parser, 0, sizeof parser); RTFSetEditStream(&parser, &inStream); @@ -1092,11 +1469,50 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre RTFSetReadHook(&parser, ME_RTFReadHook); RTFSetDestinationCallback(&parser, rtfPict, ME_RTFReadPictGroup); RTFSetDestinationCallback(&parser, rtfObject, ME_RTFReadObjectGroup); + if (!parser.editor->bEmulateVersion10) /* v4.1 */ + RTFSetDestinationCallback(&parser, rtfNoNestTables, RTFSkipGroup); BeginFile(&parser); /* do the parsing */ RTFRead(&parser); RTFFlushOutputBuffer(&parser); + if (!editor->bEmulateVersion10) { /* v4.1 */ + if (parser.tableDef && parser.tableDef->tableRowStart) + { + /* Delete any incomplete table row at the end of the rich text. */ + int nOfs, nChars; + ME_DisplayItem *pCell; + + para = parser.tableDef->tableRowStart; + + parser.rtfMinor = rtfRow; + /* Complete the table row before deleting it. + * By doing it this way we will have the current paragraph format set + * properly to reflect that is not in the complete table, and undo items + * will be added for this change to the current paragraph format. */ + if (parser.nestingLevel > 0) + { + while (parser.nestingLevel--) + ME_RTFSpecialCharHook(&parser); + } else if (parser.canInheritInTbl) { + ME_RTFSpecialCharHook(&parser); + } + if (parser.tableDef && parser.tableDef->tableRowStart && + para->member.para.nFlags & MEPF_ROWEND) + { + para = para->member.para.next_para; + } + pCell = para->member.para.pCell; + + editor->pCursors[1].pRun = ME_FindItemFwd(para, diRun); + editor->pCursors[1].nOffset = 0; + nOfs = ME_GetCursorOfs(editor, 1); + nChars = ME_GetCursorOfs(editor, 0) - nOfs; + ME_InternalDeleteText(editor, nOfs, nChars, TRUE); + parser.tableDef->tableRowStart = NULL; + } + } + ME_CheckTablesForCorruption(editor); RTFDestroy(&parser); if (parser.lpRichEditOle) IRichEditOle_Release(parser.lpRichEditOle); @@ -1117,7 +1533,7 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre ME_GetTextW(editor, lastchar, newto - linebreakSize, linebreakSize, 0); if (lastchar[0] == '\r' && (lastchar[1] == '\n' || lastchar[1] == '\0')) { - ME_InternalDeleteText(editor, newto - linebreakSize, linebreakSize); + ME_InternalDeleteText(editor, newto - linebreakSize, linebreakSize, FALSE); } } } @@ -1537,7 +1953,10 @@ ME_KeyDown(ME_TextEditor *editor, WORD nKey) { BOOL ctrl_is_down = GetKeyState(VK_CONTROL) & 0x8000; BOOL shift_is_down = GetKeyState(VK_SHIFT) & 0x8000; - + + if (nKey != VK_SHIFT && nKey != VK_CONTROL && nKey != VK_MENU) + editor->nSelectionType = stPosition; + switch (nKey) { case VK_LEFT: @@ -1573,10 +1992,17 @@ ME_KeyDown(ME_TextEditor *editor, WORD nKey) } else if (ME_ArrowKey(editor, VK_LEFT, FALSE, FALSE)) { - /* Backspace can be grouped for a single undo */ - ME_ContinueCoalescingTransaction(editor); - ME_DeleteTextAtCursor(editor, 1, 1); - ME_CommitCoalescingUndo(editor); + BOOL bDeletionSucceeded; + /* Backspace can be grouped for a single undo */ + ME_ContinueCoalescingTransaction(editor); + bDeletionSucceeded = ME_DeleteTextAtCursor(editor, 1, 1); + if (!bDeletionSucceeded && !editor->bEmulateVersion10) { /* v4.1 */ + /* Deletion was prevented so the cursor is moved back to where it was. + * (e.g. this happens when trying to delete cell boundaries) + */ + ME_ArrowKey(editor, VK_RIGHT, FALSE, FALSE); + } + ME_CommitCoalescingUndo(editor); } else return TRUE; @@ -1609,15 +2035,102 @@ ME_KeyDown(ME_TextEditor *editor, WORD nKey) return FALSE; } -static BOOL ME_SetCursor(ME_TextEditor *editor, int x) +/* Process the message and calculate the new click count. + * + * returns: The click count if it is mouse down event, else returns 0. */ +static int ME_CalculateClickCount(HWND hWnd, UINT msg, WPARAM wParam, + LPARAM lParam) { + static int clickNum = 0; + if (msg < WM_MOUSEFIRST || msg > WM_MOUSELAST) + return 0; + + if ((msg == WM_LBUTTONDBLCLK) || + (msg == WM_RBUTTONDBLCLK) || + (msg == WM_MBUTTONDBLCLK) || + (msg == WM_XBUTTONDBLCLK)) + { + msg -= (WM_LBUTTONDBLCLK - WM_LBUTTONDOWN); + } + + if ((msg == WM_LBUTTONDOWN) || + (msg == WM_RBUTTONDOWN) || + (msg == WM_MBUTTONDOWN) || + (msg == WM_XBUTTONDOWN)) + { + static MSG prevClickMsg; + MSG clickMsg; + clickMsg.hwnd = hWnd; + clickMsg.message = msg; + clickMsg.wParam = wParam; + clickMsg.lParam = lParam; + clickMsg.time = GetMessageTime(); + clickMsg.pt.x = (short)LOWORD(lParam); + clickMsg.pt.y = (short)HIWORD(lParam); + if ((clickNum != 0) && + (clickMsg.message == prevClickMsg.message) && + (clickMsg.hwnd == prevClickMsg.hwnd) && + (clickMsg.wParam == prevClickMsg.wParam) && + (clickMsg.time - prevClickMsg.time < GetDoubleClickTime()) && + (abs(clickMsg.pt.x - prevClickMsg.pt.x) < GetSystemMetrics(SM_CXDOUBLECLK)/2) && + (abs(clickMsg.pt.y - prevClickMsg.pt.y) < GetSystemMetrics(SM_CYDOUBLECLK)/2)) + { + clickNum++; + } else { + clickNum = 1; + } + prevClickMsg = clickMsg; + } else { + return 0; + } + return clickNum; +} + +static BOOL ME_SetCursor(ME_TextEditor *editor) +{ + POINT pt; + BOOL isExact; + int offset; + DWORD messagePos = GetMessagePos(); + pt.x = (short)LOWORD(messagePos); + pt.y = (short)HIWORD(messagePos); + ScreenToClient(editor->hWnd, &pt); if ((GetWindowLongW(editor->hWnd, GWL_STYLE) & ES_SELECTIONBAR) && - (x < editor->selofs || editor->linesel)) + (pt.x < editor->selofs || + (editor->nSelectionType == stLine && GetCapture() == editor->hWnd))) { SetCursor(hLeft); return TRUE; } - return FALSE; + offset = ME_CharFromPos(editor, pt.x, pt.y, &isExact); + if (isExact) + { + if (editor->AutoURLDetect_bEnable) + { + ME_Cursor cursor; + ME_Run *run; + ME_CursorFromCharOfs(editor, offset, &cursor); + run = &cursor.pRun->member.run; + if (editor->AutoURLDetect_bEnable && + run->style->fmt.dwMask & CFM_LINK && + run->style->fmt.dwEffects & CFE_LINK) + { + SetCursor(LoadCursorW(NULL, (WCHAR*)IDC_HAND)); + return TRUE; + } + } + if (ME_IsSelection(editor)) + { + int selStart, selEnd; + ME_GetSelection(editor, &selStart, &selEnd); + if (selStart <= offset && selEnd >= offset) { + SetCursor(LoadCursorW(NULL, (WCHAR*)IDC_ARROW)); + return TRUE; + } + } + } + SetCursor(LoadCursorW(NULL, (WCHAR*)IDC_IBEAM)); + return TRUE; } static BOOL ME_ShowContextMenu(ME_TextEditor *editor, int x, int y) @@ -1653,7 +2166,12 @@ ME_TextEditor *ME_MakeEditor(HWND hWnd) { ed->pBuffer = ME_MakeText(); ed->nZoomNumerator = ed->nZoomDenominator = 0; ME_MakeFirstParagraph(ed); - ed->bCaretShown = FALSE; + /* The four cursors are for: + * 0 - The position where the caret is shown + * 1 - The anchored end of the selection (for normal selection) + * 2 & 3 - The anchored start and end respectively for word, line, + * or paragraph selection. + */ ed->nCursors = 4; ed->pCursors = ALLOC_N_OBJ(ME_Cursor, ed->nCursors); ed->pCursors[0].pRun = ME_FindItemFwd(ed->pBuffer->pFirst, diRun); @@ -1700,7 +2218,7 @@ ME_TextEditor *ME_MakeEditor(HWND hWnd) { ed->selofs = SELECTIONBAR_WIDTH; else ed->selofs = 0; - ed->linesel = 0; + ed->nSelectionType = stPosition; if (GetWindowLongW(hWnd, GWL_STYLE) & ES_PASSWORD) ed->cPasswordMask = '*'; @@ -1709,6 +2227,15 @@ ME_TextEditor *ME_MakeEditor(HWND hWnd) { ed->notified_cr.cpMin = ed->notified_cr.cpMax = 0; + /* Default vertical scrollbar information */ + ed->vert_si.cbSize = sizeof(SCROLLINFO); + ed->vert_si.nMin = 0; + ed->vert_si.nMax = 0; + ed->vert_si.nPage = 0; + ed->vert_si.nPos = 0; + + OleInitialize(NULL); + return ed; } @@ -1777,6 +2304,7 @@ void ME_DestroyEditor(ME_TextEditor *editor) DeleteObject(editor->hbrBackground); if(editor->lpOleCallback) IUnknown_Release(editor->lpOleCallback); + OleUninitialize(); FREE_OBJ(editor->pBuffer); FREE_OBJ(editor->pCursors); @@ -1996,10 +2524,9 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, UNSUPPORTED_MSG(EM_SETWORDBREAKPROCEX) UNSUPPORTED_MSG(WM_STYLECHANGING) UNSUPPORTED_MSG(WM_STYLECHANGED) -/* UNSUPPORTED_MSG(WM_UNICHAR) FIXME missing in Wine headers */ - + /* Messages specific to Richedit controls */ - + case EM_STREAMIN: return ME_StreamIn(editor, wParam, (EDITSTREAM*)lParam, TRUE); case EM_STREAMOUT: @@ -2134,6 +2661,8 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, ME_InvalidateSelection(editor); ME_SetSelection(editor, wParam, lParam); ME_InvalidateSelection(editor); + HideCaret(editor->hWnd); + ME_ShowCaret(editor); ME_SendSelChange(editor); return 0; } @@ -2166,6 +2695,8 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, ME_InvalidateSelection(editor); end = ME_SetSelection(editor, range.cpMin, range.cpMax); ME_InvalidateSelection(editor); + HideCaret(editor->hWnd); + ME_ShowCaret(editor); ME_SendSelChange(editor); return end; @@ -2197,16 +2728,16 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, if (pStruct->flags & ST_SELECTION) { ME_GetSelection(editor, &from, &to); style = ME_GetSelectionInsertStyle(editor); - ME_InternalDeleteText(editor, from, to - from); + ME_InternalDeleteText(editor, from, to - from, FALSE); if (pStruct->codepage != 1200 && lParam && !strncmp((char *)lParam, "{\\rtf", 5)) - ME_StreamInRTFString(editor, 0, (char *)lParam); + ME_StreamInRTFString(editor, 1, (char *)lParam); else ME_InsertTextFromCursor(editor, 0, wszText, len, style); ME_ReleaseStyle(style); if (editor->AutoURLDetect_bEnable) ME_UpdateSelectionLinkAttribute(editor); } else { - ME_InternalDeleteText(editor, 0, ME_GetTextLength(editor)); + ME_InternalDeleteText(editor, 0, ME_GetTextLength(editor), FALSE); if (pStruct->codepage != 1200 && lParam && !strncmp((char *)lParam, "{\\rtf", 5)) ME_StreamInRTFString(editor, 0, (char *)lParam); else ME_InsertTextFromCursor(editor, 0, wszText, len, editor->pBuffer->pDefaultStyle); @@ -2328,13 +2859,15 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, return tmp.dwMask; } case EM_SETPARAFORMAT: - ME_SetSelectionParaFormat(editor, (PARAFORMAT2 *)lParam); + { + BOOL result = ME_SetSelectionParaFormat(editor, (PARAFORMAT2 *)lParam); ME_RewrapRepaint(editor); ME_CommitUndo(editor); - return 0; + return result; + } case EM_GETPARAFORMAT: ME_GetSelectionParaFormat(editor, (PARAFORMAT2 *)lParam); - return 0; + return ((PARAFORMAT2 *)lParam)->dwMask; case EM_GETFIRSTVISIBLELINE: { ME_DisplayItem *p = editor->pBuffer->pFirst; @@ -2347,10 +2880,10 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, if (p->type == diTextEnd) break; if (p->type == diParagraph) { - ypara = p->member.para.nYPos; + ypara = p->member.para.pt.y; continue; } - ystart = ypara + p->member.row.nYPos; + ystart = ypara + p->member.row.pt.y; yend = ystart + p->member.row.nHeight; if (y < yend) { break; @@ -2374,7 +2907,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, { int from, to; ME_GetSelection(editor, &from, &to); - ME_InternalDeleteText(editor, from, to-from); + ME_InternalDeleteText(editor, from, to-from, FALSE); ME_CommitUndo(editor); ME_UpdateRepaint(editor); return 0; @@ -2389,7 +2922,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, ME_GetSelection(editor, &from, &to); style = ME_GetSelectionInsertStyle(editor); - ME_InternalDeleteText(editor, from, to-from); + ME_InternalDeleteText(editor, from, to-from, FALSE); ME_InsertTextFromCursor(editor, 0, wszText, len, style); ME_ReleaseStyle(style); /* drop temporary style if line end */ @@ -2416,7 +2949,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, nPos = ME_GetYScrollPos(editor); row = ME_RowStart(editor->pCursors[0].pRun); para = ME_GetParagraph(row); - top = para->member.para.nYPos + row->member.row.nYPos; + top = para->member.para.pt.y + row->member.row.pt.y; bottom = top + row->member.row.nHeight; if (top < nPos) /* caret above window */ @@ -2448,7 +2981,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, } case WM_SETTEXT: { - ME_InternalDeleteText(editor, 0, ME_GetTextLength(editor)); + ME_InternalDeleteText(editor, 0, ME_GetTextLength(editor), FALSE); if (lParam) { TRACE("WM_SETTEXT lParam==%lx\n",lParam); @@ -2548,7 +3081,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, } if (SUCCEEDED(hr) && msg == WM_CUT) { - ME_InternalDeleteText(editor, range.cpMin, range.cpMax-range.cpMin); + ME_InternalDeleteText(editor, range.cpMin, range.cpMax-range.cpMin, FALSE); ME_CommitUndo(editor); ME_UpdateRepaint(editor); } @@ -2914,7 +3447,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, case EM_SETZOOM: return ME_SetZoom(editor, wParam, lParam); case EM_CHARFROMPOS: - return ME_CharFromPos(editor, ((POINTL *)lParam)->x, ((POINTL *)lParam)->y); + return ME_CharFromPos(editor, ((POINTL *)lParam)->x, ((POINTL *)lParam)->y, NULL); case EM_POSFROMCHAR: { ME_DisplayItem *pRun; @@ -2933,10 +3466,10 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, assert(pRun->type == diRun); pt.y = pRun->member.run.pt.y; pt.x = pRun->member.run.pt.x + ME_PointFromChar(editor, &pRun->member.run, nOffset); - pt.y += ME_GetParagraph(pRun)->member.para.nYPos; + pt.y += ME_GetParagraph(pRun)->member.para.pt.y; } else { pt.x = 0; - pt.y = editor->pBuffer->pLast->member.para.nYPos; + pt.y = editor->pBuffer->pLast->member.para.pt.y; } pt.x += editor->selofs; @@ -2953,33 +3486,50 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, return (wParam >= 0x40000) ? 0 : MAKELONG( pt.x, pt.y ); } case WM_CREATE: + { + SCROLLINFO si; + GetClientRect(hWnd, &editor->rcFormat); if (GetWindowLongW(hWnd, GWL_STYLE) & WS_HSCROLL) { /* Squelch the default horizontal scrollbar it would make */ ShowScrollBar(editor->hWnd, SB_HORZ, FALSE); } + + si.cbSize = sizeof(si); + si.fMask = SIF_PAGE | SIF_RANGE; + if (GetWindowLongW(hWnd, GWL_STYLE) & ES_DISABLENOSCROLL) + si.fMask |= SIF_DISABLENOSCROLL; + si.nMax = (si.fMask & SIF_DISABLENOSCROLL) ? 1 : 0; + si.nMin = 0; + si.nPage = 0; + SetScrollInfo(hWnd, SB_VERT, &si, TRUE); + ME_CommitUndo(editor); ME_WrapMarkedParagraphs(editor); ME_MoveCaret(editor); return 0; + } case WM_DESTROY: ME_DestroyEditor(editor); SetWindowLongPtrW(hWnd, 0, 0); return 0; + case WM_SETCURSOR: + { + return ME_SetCursor(editor); + } case WM_LBUTTONDBLCLK: case WM_LBUTTONDOWN: { - int clickNum = (msg == WM_LBUTTONDBLCLK) ? 2 : 1; ME_CommitUndo(editor); /* End coalesced undos for typed characters */ if ((editor->nEventMask & ENM_MOUSEEVENTS) && !ME_FilterEvent(editor, msg, &wParam, &lParam)) return 0; SetFocus(hWnd); ME_LButtonDown(editor, (short)LOWORD(lParam), (short)HIWORD(lParam), - clickNum); + ME_CalculateClickCount(hWnd, msg, wParam, lParam)); SetCapture(hWnd); ME_LinkNotify(editor,msg,wParam,lParam); - if (!ME_SetCursor(editor, LOWORD(lParam))) goto do_default; + if (!ME_SetCursor(editor)) goto do_default; break; } case WM_MOUSEMOVE: @@ -2989,21 +3539,22 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, if (GetCapture() == hWnd) ME_MouseMove(editor, (short)LOWORD(lParam), (short)HIWORD(lParam)); ME_LinkNotify(editor,msg,wParam,lParam); - if (!ME_SetCursor(editor, LOWORD(lParam))) goto do_default; + /* Set cursor if mouse is captured, since WM_SETCURSOR won't be received. */ + if (GetCapture() == hWnd) + ME_SetCursor(editor); break; case WM_LBUTTONUP: if (GetCapture() == hWnd) ReleaseCapture(); + if (editor->nSelectionType == stDocument) + editor->nSelectionType = stPosition; if ((editor->nEventMask & ENM_MOUSEEVENTS) && !ME_FilterEvent(editor, msg, &wParam, &lParam)) return 0; else { - BOOL ret; - editor->linesel = 0; - ret = ME_SetCursor(editor, LOWORD(lParam)); + ME_SetCursor(editor); ME_LinkNotify(editor,msg,wParam,lParam); - if (!ret) goto do_default; } break; case WM_RBUTTONUP: @@ -3035,8 +3586,8 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, return 0; case WM_KILLFOCUS: ME_CommitUndo(editor); /* End coalesced undos for typed characters */ - ME_HideCaret(editor); editor->bHaveFocus = FALSE; + ME_HideCaret(editor); ME_SendOldNotify(editor, EN_KILLFOCUS); return 0; case WM_ERASEBKGND: @@ -3112,10 +3663,35 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, if (((unsigned)wstr)>=' ' || (wstr=='\r' && (GetWindowLongW(hWnd, GWL_STYLE) & ES_MULTILINE)) || wstr=='\t') { + int from, to; + BOOL ctrl_is_down = GetKeyState(VK_CONTROL) & 0x8000; + ME_GetSelection(editor, &from, &to); + if (wstr=='\t' + /* v4.1 allows tabs to be inserted with ctrl key down */ + && !(ctrl_is_down && !editor->bEmulateVersion10) + ) + { + ME_Cursor cursor = editor->pCursors[0]; + ME_DisplayItem *para; + BOOL bSelectedRow = FALSE; + + para = ME_GetParagraph(cursor.pRun); + if (ME_IsSelection(editor) && + cursor.pRun->member.run.nCharOfs + cursor.nOffset == 0 && + para->member.para.prev_para->type == diParagraph) + { + para = para->member.para.prev_para; + bSelectedRow = TRUE; + } + if (ME_IsInTable(para)) + { + ME_TabPressedInTable(editor, bSelectedRow); + ME_CommitUndo(editor); + return 0; + } + } /* FIXME maybe it would make sense to call EM_REPLACESEL instead ? */ /* WM_CHAR is restricted to nTextLimit */ - int from, to; - ME_GetSelection(editor, &from, &to); if(editor->nTextLimit > ME_GetTextLength(editor) - (to-from)) { ME_Style *style = ME_GetInsertStyle(editor, 0); @@ -3127,6 +3703,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, ME_InsertTextFromCursor(editor, 0, &wstr, 1, style); ME_ReleaseStyle(style); ME_CommitCoalescingUndo(editor); + SetCursor(NULL); } if (editor->AutoURLDetect_bEnable) ME_UpdateSelectionLinkAttribute(editor); @@ -3135,6 +3712,23 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, } return 0; } + case WM_UNICHAR: + if (unicode) + { + if(wParam == UNICODE_NOCHAR) return TRUE; + if(wParam <= 0x000fffff) + { + if(wParam > 0xffff) /* convert to surrogates */ + { + wParam -= 0x10000; + SendMessageW(editor->hWnd, WM_CHAR, (wParam >> 10) + 0xd800, 0); + SendMessageW(editor->hWnd, WM_CHAR, (wParam & 0x03ff) + 0xdc00, 0); + } + else SendMessageW(editor->hWnd, WM_CHAR, wParam, 0); + } + return 0; + } + break; case EM_STOPGROUPTYPING: ME_CommitUndo(editor); /* End coalesced undos for typed characters */ return 0; @@ -3429,6 +4023,7 @@ void ME_LinkNotify(ME_TextEditor *editor, UINT msg, WPARAM wParam, LPARAM lParam { int x,y; ME_Cursor tmpCursor; + BOOL isExact; int nCharOfs; /* The start of the clicked text. Absolute character offset */ ME_Run *tmpRun; @@ -3436,8 +4031,8 @@ void ME_LinkNotify(ME_TextEditor *editor, UINT msg, WPARAM wParam, LPARAM lParam ENLINK info; x = (short)LOWORD(lParam); y = (short)HIWORD(lParam); - nCharOfs = ME_CharFromPos(editor, x, y); - if (nCharOfs < 0) return; + nCharOfs = ME_CharFromPos(editor, x, y, &isExact); + if (!isExact) return; ME_CursorFromCharOfs(editor, nCharOfs, &tmpCursor); tmpRun = &tmpCursor.pRun->member.run; @@ -3513,7 +4108,12 @@ int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int nStart, int nChars, in if (nLen > nChars) nLen = nChars; - if (item->member.run.nFlags & MERF_ENDPARA) + if (item->member.run.nFlags & MERF_ENDCELL && + item->member.run.nFlags & MERF_ENDPARA) + { + *buffer = '\t'; + } + else if (item->member.run.nFlags & MERF_ENDPARA) { if (!ME_FindItemFwd(item, diRun)) /* No '\r' is appended to the last paragraph. */ @@ -3525,10 +4125,16 @@ int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int nStart, int nChars, in if (bCRLF) { /* richedit 2.0 case - actual line-break is \r but should report \r\n */ - assert(nLen == 1); + if (ME_GetParagraph(item)->member.para.nFlags & (MEPF_ROWSTART|MEPF_ROWEND)) + assert(nLen == 2); + else + assert(nLen == 1); *buffer++ = '\r'; *buffer = '\n'; /* Later updated by nLen==1 at the end of the loop */ - nWritten++; + if (nLen == 1) + nWritten++; + else + buffer--; } else { diff --git a/reactos/dll/win32/riched20/editor.h b/reactos/dll/win32/riched20/editor.h index a23fb8b3972..5e6f4cb502c 100644 --- a/reactos/dll/win32/riched20/editor.h +++ b/reactos/dll/win32/riched20/editor.h @@ -84,7 +84,6 @@ ME_DisplayItem *ME_FindItemFwdOrHere(ME_DisplayItem *di, ME_DIType nTypeOrClass) BOOL ME_DITypesEqual(ME_DIType type, ME_DIType nTypeOrClass); ME_DisplayItem *ME_MakeDI(ME_DIType type); void ME_DestroyDisplayItem(ME_DisplayItem *item); -void ME_DestroyTableCellList(ME_DisplayItem *item); void ME_DumpDocument(ME_TextBuffer *buffer); const char *ME_GetDITypeName(ME_DIType type); @@ -176,14 +175,14 @@ void ME_SetDefaultCharFormat(ME_TextEditor *editor, CHARFORMAT2W *mod); /* caret.c */ int ME_SetSelection(ME_TextEditor *editor, int from, int to); -void ME_SelectWord(ME_TextEditor *editor); +void ME_SelectByType(ME_TextEditor *editor, ME_SelectionType selectionType); void ME_HideCaret(ME_TextEditor *ed); void ME_ShowCaret(ME_TextEditor *ed); void ME_MoveCaret(ME_TextEditor *ed); -int ME_CharFromPos(ME_TextEditor *editor, int x, int y); +int ME_CharFromPos(ME_TextEditor *editor, int x, int y, BOOL *isExact); void ME_LButtonDown(ME_TextEditor *editor, int x, int y, int clickNum); void ME_MouseMove(ME_TextEditor *editor, int x, int y); -void ME_DeleteTextAtCursor(ME_TextEditor *editor, int nCursor, int nChars); +BOOL ME_DeleteTextAtCursor(ME_TextEditor *editor, int nCursor, int nChars); void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor, const WCHAR *str, int len, ME_Style *style); void ME_InsertEndRowFromCursor(ME_TextEditor *editor, int nCursor); @@ -199,8 +198,7 @@ BOOL ME_IsSelection(ME_TextEditor *editor); void ME_DeleteSelection(ME_TextEditor *editor); void ME_SendSelChange(ME_TextEditor *editor); void ME_InsertOLEFromCursor(ME_TextEditor *editor, const REOBJECT* reo, int nCursor); -void ME_InsertTableCellFromCursor(ME_TextEditor *editor, int nCursor); -void ME_InternalDeleteText(ME_TextEditor *editor, int nOfs, int nChars); +BOOL ME_InternalDeleteText(ME_TextEditor *editor, int nOfs, int nChars, BOOL bForce); int ME_GetTextLength(ME_TextEditor *editor); int ME_GetTextLengthEx(ME_TextEditor *editor, const GETTEXTLENGTHEX *how); ME_Style *ME_GetSelectionInsertStyle(ME_TextEditor *editor); @@ -219,18 +217,20 @@ void ME_SendRequestResize(ME_TextEditor *editor, BOOL force); ME_DisplayItem *ME_GetParagraph(ME_DisplayItem *run); void ME_GetSelectionParas(ME_TextEditor *editor, ME_DisplayItem **para, ME_DisplayItem **para_end); void ME_MakeFirstParagraph(ME_TextEditor *editor); -ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *rp, ME_Style *style, int numCR, int numLF); -ME_DisplayItem *ME_JoinParagraphs(ME_TextEditor *editor, ME_DisplayItem *tp); +ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *rp, ME_Style *style, int numCR, int numLF, int paraFlags); +ME_DisplayItem *ME_JoinParagraphs(ME_TextEditor *editor, ME_DisplayItem *tp, + BOOL keepFirstParaFormat); void ME_DumpParaStyle(ME_Paragraph *s); void ME_DumpParaStyleToBuf(const PARAFORMAT2 *pFmt, char buf[2048]); -void ME_SetParaFormat(ME_TextEditor *editor, ME_DisplayItem *para, const PARAFORMAT2 *pFmt); -void ME_SetSelectionParaFormat(ME_TextEditor *editor, const PARAFORMAT2 *pFmt); +BOOL ME_SetParaFormat(ME_TextEditor *editor, ME_DisplayItem *para, const PARAFORMAT2 *pFmt); +BOOL ME_SetSelectionParaFormat(ME_TextEditor *editor, const PARAFORMAT2 *pFmt); void ME_GetParaFormat(ME_TextEditor *editor, const ME_DisplayItem *para, PARAFORMAT2 *pFmt); void ME_GetSelectionParaFormat(ME_TextEditor *editor, PARAFORMAT2 *pFmt); /* marks from first up to (but not including) last */ void ME_MarkForWrapping(ME_TextEditor *editor, ME_DisplayItem *first, const ME_DisplayItem *last); void ME_MarkForPainting(ME_TextEditor *editor, ME_DisplayItem *first, const ME_DisplayItem *last); void ME_MarkAllForWrapping(ME_TextEditor *editor); +void ME_SetDefaultParaFormat(PARAFORMAT2 *pFmt); /* paint.c */ void ME_PaintContent(ME_TextEditor *editor, HDC hDC, BOOL bOnlyNew, const RECT *rcUpdate); @@ -285,6 +285,21 @@ extern BOOL ME_IsCandidateAnURL(ME_TextEditor *editor, int sel_min, int sel_max) BOOL ME_UpdateLinkAttribute(ME_TextEditor *editor, int sel_min, int sel_max); void ME_UpdateSelectionLinkAttribute(ME_TextEditor *editor); +/* table.c */ +BOOL ME_IsInTable(ME_DisplayItem *pItem); +ME_DisplayItem *ME_InsertTableRowStartFromCursor(ME_TextEditor *editor); +ME_DisplayItem *ME_InsertTableRowStartAtParagraph(ME_TextEditor *editor, + ME_DisplayItem *para); +ME_DisplayItem *ME_InsertTableCellFromCursor(ME_TextEditor *editor); +ME_DisplayItem *ME_InsertTableRowEndFromCursor(ME_TextEditor *editor); +ME_DisplayItem *ME_GetTableRowEnd(ME_DisplayItem *para); +ME_DisplayItem *ME_GetTableRowStart(ME_DisplayItem *para); +void ME_CheckTablesForCorruption(ME_TextEditor *editor); +void ME_ProtectPartialTableDeletion(ME_TextEditor *editor, int nOfs,int *nChars); +void ME_TabPressedInTable(ME_TextEditor *editor, BOOL bSelectedRow); +struct RTFTable *ME_MakeTableDef(ME_TextEditor *editor); +void ME_InitTableDef(ME_TextEditor *editor, struct RTFTable *tableDef); + /* undo.c */ ME_UndoItem *ME_AddUndoItem(ME_TextEditor *editor, ME_DIType type, const ME_DisplayItem *pdi); void ME_CommitUndo(ME_TextEditor *editor); diff --git a/reactos/dll/win32/riched20/editstr.h b/reactos/dll/win32/riched20/editstr.h index cab52ad58ad..edbeb131834 100644 --- a/reactos/dll/win32/riched20/editstr.h +++ b/reactos/dll/win32/riched20/editstr.h @@ -67,27 +67,27 @@ typedef enum { diInvalid, diTextStart, /* start of the text buffer */ diParagraph, /* paragraph start */ + diCell, /* cell start */ diRun, /* run (sequence of chars with the same character format) */ diStartRow, /* start of the row (line of text on the screen) */ diTextEnd, /* end of the text buffer */ /********************* these below are meant for finding only *********************/ - diStartRowOrParagraph, /* 5 */ + diStartRowOrParagraph, /* 7 */ diStartRowOrParagraphOrEnd, diRunOrParagraph, diRunOrStartRow, diParagraphOrEnd, - diRunOrParagraphOrEnd, /* 10 */ + diRunOrParagraphOrEnd, /* 12 */ - diUndoInsertRun, /* 11 */ - diUndoDeleteRun, /* 12 */ - diUndoJoinParagraphs, /* 13 */ - diUndoSplitParagraph, /* 14 */ - diUndoSetParagraphFormat, /* 15 */ - diUndoSetCharFormat, /* 16 */ - diUndoEndTransaction, /* 17 - marks the end of a group of changes for undo */ - diUndoSetDefaultCharFormat, /* 18 */ - diUndoPotentialEndTransaction, /* 19 - allows grouping typed chars for undo */ + diUndoInsertRun, /* 13 */ + diUndoDeleteRun, /* 14 */ + diUndoJoinParagraphs, /* 15 */ + diUndoSplitParagraph, /* 16 */ + diUndoSetParagraphFormat, /* 17 */ + diUndoSetCharFormat, /* 18 */ + diUndoEndTransaction, /* 19 - marks the end of a group of changes for undo */ + diUndoPotentialEndTransaction, /* 20 - allows grouping typed chars for undo */ } ME_DIType; #define SELECTIONBAR_WIDTH 9 @@ -99,9 +99,9 @@ typedef enum { /* run is a tab (or, in future, any kind of content whose size is dependent on run position) */ #define MERF_TAB 0x002 /* run is a cell boundary */ -#define MERF_CELL 0x004 +#define MERF_ENDCELL 0x004 /* v4.1 */ -#define MERF_NONTEXT (MERF_GRAPHICS | MERF_TAB | MERF_CELL) +#define MERF_NONTEXT (MERF_GRAPHICS | MERF_TAB | MERF_ENDCELL) /* run is splittable (contains white spaces in the middle or end) */ #define MERF_SPLITTABLE 0x001000 @@ -121,6 +121,8 @@ typedef enum { #define MERF_ENDROW 0x200000 /* run is hidden */ #define MERF_HIDDEN 0x400000 +/* start of a table row has an empty paragraph that should be skipped over. */ +#define MERF_TABLESTART 0x800000 /* v4.1 */ /* runs with any of these flags set cannot be joined */ #define MERF_NOJOIN (MERF_GRAPHICS|MERF_TAB|MERF_ENDPARA|MERF_ENDROW) @@ -133,8 +135,12 @@ typedef enum { /******************************** para flags *************************/ /* this paragraph was already wrapped and hasn't changed, every change resets that flag */ -#define MEPF_REWRAP 1 -#define MEPF_REPAINT 2 +#define MEPF_REWRAP 0x01 +#define MEPF_REPAINT 0x02 +/* v4.1 */ +#define MEPF_CELL 0x04 /* The paragraph is nested in a cell */ +#define MEPF_ROWSTART 0x08 /* Hidden empty paragraph at the start of the row */ +#define MEPF_ROWEND 0x10 /* Visible empty paragraph at the end of the row */ /******************************** structures *************************/ @@ -149,7 +155,6 @@ typedef struct tagME_Run int nFlags; int nAscent, nDescent; /* pixels above/below baseline */ POINT pt; /* relative to para's position */ - struct tagME_TableCell *pCell; /* for MERF_CELL: points to respective cell in ME_Paragraph */ REOBJECT *ole_obj; /* FIXME: should be a union with strText (at least) */ int nCR; int nLF; /* for MERF_ENDPARA: number of \r and \n characters encoded by run */ } ME_Run; @@ -160,28 +165,47 @@ typedef struct tagME_Document { int last_wrapped_line; } ME_Document; -typedef struct tagME_TableCell +typedef struct tagME_Border { - int nRightBoundary; - struct tagME_TableCell *next; -} ME_TableCell; + int width; + COLORREF colorRef; +} ME_Border; + +typedef struct tagME_BorderRect +{ + ME_Border top; + ME_Border left; + ME_Border bottom; + ME_Border right; +} ME_BorderRect; typedef struct tagME_Paragraph { PARAFORMAT2 *pFmt; - - BOOL bTable; /* this paragraph is a table row */ - struct tagME_TableCell *pCells; /* list of cells and their properties */ - struct tagME_TableCell *pLastCell; /* points to the last cell in the list */ + + struct tagME_DisplayItem *pCell; /* v4.1 */ + ME_BorderRect border; int nCharOfs; int nFlags; - int nYPos, nHeight; + POINT pt; + int nHeight; int nLastPaintYPos, nLastPaintHeight; int nRows; struct tagME_DisplayItem *prev_para, *next_para, *document; } ME_Paragraph; +typedef struct tagME_Cell /* v4.1 */ +{ + int nNestingLevel; /* 0 for normal cells, and greater for nested cells */ + int nRightBoundary; + ME_BorderRect border; + POINT pt; + int nHeight, nWidth; + int yTextOffset; /* The text offset is caused by the largest top border. */ + struct tagME_DisplayItem *prev_cell, *next_cell, *parent_cell; +} ME_Cell; + typedef struct tagME_Row { int nHeight; @@ -189,7 +213,7 @@ typedef struct tagME_Row int nWidth; int nLMargin; int nRMargin; - int nYPos; + POINT pt; } ME_Row; /* the display item list layout is like this: @@ -211,6 +235,7 @@ typedef struct tagME_DisplayItem union { ME_Run run; ME_Row row; + ME_Cell cell; ME_Paragraph para; ME_Document doc; /* not used */ ME_Style *ustyle; /* used by diUndoSetCharFormat */ @@ -244,6 +269,14 @@ typedef enum { umAddBackToUndo } ME_UndoMode; +typedef enum { + stPosition = 0, + stWord, + stLine, + stParagraph, + stDocument +} ME_SelectionType; + typedef struct tagME_FontTableItem { BYTE bCharSet; WCHAR *szFaceName; @@ -276,6 +309,9 @@ typedef struct tagME_OutStream { COLORREF colortbl[STREAMOUT_COLORTBL_SIZE]; UINT nDefaultFont; UINT nDefaultCodePage; + /* nNestingLevel = 0 means we aren't in a cell, 1 means we are in a cell, + * an greater numbers mean we are in a cell nested within a cell. */ + UINT nNestingLevel; } ME_OutStream; typedef struct tagME_FontCacheItem @@ -292,7 +328,6 @@ typedef struct tagME_TextEditor { HWND hWnd; BOOL bEmulateVersion10; - BOOL bCaretShown; ME_TextBuffer *pBuffer; ME_Cursor *pCursors; int nCursors; @@ -333,10 +368,14 @@ typedef struct tagME_TextEditor BOOL bHaveFocus; /*for IME */ int imeStartIndex; - DWORD selofs, linesel, sely; + DWORD selofs; /* The size of the selection bar on the left side of control */ + ME_SelectionType nSelectionType; /* Track previous notified selection */ CHARRANGE notified_cr; + + /* Cache previously set vertical scrollbar info */ + SCROLLINFO vert_si; } ME_TextEditor; typedef struct tagME_Context diff --git a/reactos/dll/win32/riched20/list.c b/reactos/dll/win32/riched20/list.c index f5c5f42fd8d..4ddc54a9bfc 100644 --- a/reactos/dll/win32/riched20/list.c +++ b/reactos/dll/win32/riched20/list.c @@ -112,36 +112,20 @@ void ME_DestroyDisplayItem(ME_DisplayItem *item) { /* TRACE("type=%s\n", ME_GetDITypeName(item->type)); */ if (item->type==diParagraph || item->type == diUndoSetParagraphFormat) { FREE_OBJ(item->member.para.pFmt); - ME_DestroyTableCellList(item); } if (item->type==diRun || item->type == diUndoInsertRun) { if (item->member.run.ole_obj) ME_DeleteReObject(item->member.run.ole_obj); ME_ReleaseStyle(item->member.run.style); ME_DestroyString(item->member.run.strText); } - if (item->type==diUndoSetCharFormat || item->type==diUndoSetDefaultCharFormat) { + if (item->type==diUndoSetCharFormat) { ME_ReleaseStyle(item->member.ustyle); } - if (item->type==diUndoSplitParagraph) + if (item->type==diUndoSplitParagraph) { FREE_OBJ(item->member.para.pFmt); - FREE_OBJ(item); -} - -void -ME_DestroyTableCellList(ME_DisplayItem *item) -{ - if (item->member.para.pCells) - { - ME_TableCell *pCell = item->member.para.pCells; - ME_TableCell *pNext; - - while (pCell) { - pNext = pCell->next; - FREE_OBJ(pCell); - pCell = pNext; - } - item->member.para.pCells = NULL; + FREE_OBJ(item->member.para.pCell); } + FREE_OBJ(item); } ME_DisplayItem *ME_MakeDI(ME_DIType type) { @@ -151,8 +135,7 @@ ME_DisplayItem *ME_MakeDI(ME_DIType type) { item->prev = item->next = NULL; if (type == diParagraph || type == diUndoSplitParagraph) { item->member.para.pFmt = ALLOC_OBJ(PARAFORMAT2); - item->member.para.pFmt->cbSize = sizeof(PARAFORMAT2); - item->member.para.pFmt->dwMask = 0; + ME_SetDefaultParaFormat(item->member.para.pFmt); item->member.para.nFlags = MEPF_REWRAP; } @@ -165,6 +148,7 @@ const char *ME_GetDITypeName(ME_DIType type) { case diParagraph: return "diParagraph"; case diRun: return "diRun"; + case diCell: return "diCell"; case diTextStart: return "diTextStart"; case diTextEnd: return "diTextEnd"; case diStartRow: return "diStartRow"; @@ -176,7 +160,6 @@ const char *ME_GetDITypeName(ME_DIType type) case diUndoDeleteRun: return "diUndoDeleteRun"; case diUndoJoinParagraphs: return "diJoinParagraphs"; case diUndoSplitParagraph: return "diSplitParagraph"; - case diUndoSetDefaultCharFormat: return "diUndoSetDefaultCharFormat"; default: return "?"; } } @@ -192,8 +175,17 @@ void ME_DumpDocument(ME_TextBuffer *buffer) case diTextStart: TRACE("Start\n"); break; + case diCell: + TRACE("Cell(level=%d%s)\n", pItem->member.cell.nNestingLevel, + !pItem->member.cell.next_cell ? ", END" : + (!pItem->member.cell.prev_cell ? ", START" :"")); + break; case diParagraph: TRACE("Paragraph(ofs=%d)\n", pItem->member.para.nCharOfs); + if (pItem->member.para.nFlags & MEPF_ROWSTART) + TRACE(" - (Table Row Start)\n"); + if (pItem->member.para.nFlags & MEPF_ROWEND) + TRACE(" - (Table Row End)\n"); break; case diStartRow: TRACE(" - StartRow\n"); diff --git a/reactos/dll/win32/riched20/paint.c b/reactos/dll/win32/riched20/paint.c index a2bc7c52236..9cfc21ef640 100644 --- a/reactos/dll/win32/riched20/paint.c +++ b/reactos/dll/win32/riched20/paint.c @@ -32,13 +32,35 @@ void ME_PaintContent(ME_TextEditor *editor, HDC hDC, BOOL bOnlyNew, const RECT * yoffset = ME_GetYScrollPos(editor); ME_InitContext(&c, editor, hDC); SetBkMode(hDC, TRANSPARENT); - ME_MoveCaret(editor); + ME_MoveCaret(editor); /* Calls ME_WrapMarkedParagraphs */ item = editor->pBuffer->pFirst->next; c.pt.y -= yoffset; while(item != editor->pBuffer->pLast) { + int yTextOffset = 0; int ye; assert(item->type == diParagraph); - ye = c.pt.y + item->member.para.nHeight; + if (item->member.para.pCell + != item->member.para.next_para->member.para.pCell) + { + ME_Cell *cell = NULL; + cell = &ME_FindItemBack(item->member.para.next_para, diCell)->member.cell; + ye = cell->pt.y + cell->nHeight - yoffset; + } else { + ye = c.pt.y + item->member.para.nHeight; + } + if (!(item->member.para.nFlags & MEPF_ROWEND) && + item->member.para.pCell != item->member.para.prev_para->member.para.pCell) + { + ME_DisplayItem *cell; + if (item->member.para.prev_para->member.para.nFlags & MEPF_ROWSTART) + cell = item->member.para.pCell; + else + cell = item->member.para.prev_para->member.para.pCell; + assert(cell); + /* the border shifts the text down */ + yTextOffset = cell->member.cell.yTextOffset; + ye += yTextOffset; + } if (!bOnlyNew || (item->member.para.nFlags & MEPF_REPAINT)) { BOOL bPaint = (rcUpdate == NULL); @@ -46,12 +68,39 @@ void ME_PaintContent(ME_TextEditor *editor, HDC hDC, BOOL bOnlyNew, const RECT * bPaint = c.pt.ybottom && ye>rcUpdate->top; if (bPaint) { + c.pt.y += yTextOffset; ME_DrawParagraph(&c, item); - if (!rcUpdate || (rcUpdate->top<=c.pt.y && rcUpdate->bottom>=ye)) + if (!rcUpdate || (rcUpdate->top<=c.pt.y-yTextOffset && rcUpdate->bottom>=ye)) item->member.para.nFlags &= ~MEPF_REPAINT; } } - c.pt.y = ye; + if (item->member.para.pCell) + { + ME_Cell *cell = &item->member.para.pCell->member.cell; + ME_DisplayItem *next_para = item->member.para.next_para; + c.pt.x = cell->pt.x + cell->nWidth; + if (item->member.para.pCell == next_para->member.para.pCell && + !(next_para->member.para.nFlags & (MEPF_ROWSTART|MEPF_ROWEND))) + { + c.pt.y = ye; + } else { + if (next_para->member.para.nFlags & MEPF_ROWSTART) + { + cell = &ME_FindItemFwd(next_para, diCell)->member.cell; + } + else if (next_para->member.para.nFlags & MEPF_ROWEND) + { + cell = &cell->next_cell->member.cell; + } + else + { + cell = &next_para->member.para.pCell->member.cell; + } + c.pt.y = cell->pt.y - yoffset; + } + } else if (!(item->member.para.nFlags & MEPF_ROWSTART)) { + c.pt.y = ye; + } item = item->member.para.next_para; } if (c.pt.ydpi.cy * c->editor->nZoomNumerator / 1440 / c->editor->nZoomDenominator; } -static void ME_DrawTextWithStyle(ME_Context *c, int x, int y, LPCWSTR szText, int nChars, - ME_Style *s, int *width, int nSelFrom, int nSelTo, int ymin, int cy) { +static void ME_HighlightSpace(ME_Context *c, int x, int y, LPCWSTR szText, + int nChars, ME_Style *s, int width, + int nSelFrom, int nSelTo, int ymin, int cy) +{ + HDC hDC = c->hDC; + HGDIOBJ hOldFont = NULL; + SIZE sz; + int selWidth; + /* Only highlight if there is a selection in the run and when + * EM_HIDESELECTION is not being used to hide the selection. */ + if (nSelFrom >= nChars || nSelTo < 0 || nSelFrom >= nSelTo + || c->editor->bHideSelection) + return; + hOldFont = ME_SelectStyleFont(c, s); + if (width <= 0) + { + GetTextExtentPoint32W(hDC, szText, nChars, &sz); + width = sz.cx; + } + if (nSelFrom < 0) nSelFrom = 0; + if (nSelTo > nChars) nSelTo = nChars; + GetTextExtentPoint32W(hDC, szText, nSelFrom, &sz); + x += sz.cx; + if (nSelTo != nChars) + { + GetTextExtentPoint32W(hDC, szText+nSelFrom, nSelTo-nSelFrom, &sz); + selWidth = sz.cx; + } else { + selWidth = width - sz.cx; + } + ME_UnselectStyleFont(c, s, hOldFont); + + if (c->editor->bEmulateVersion10) + PatBlt(hDC, x, ymin, selWidth, cy, DSTINVERT); + else + { + RECT rect; + HBRUSH hBrush; + rect.left = x; + rect.top = ymin; + rect.right = x + selWidth; + rect.bottom = ymin + cy; + hBrush = CreateSolidBrush(GetSysColor(COLOR_HIGHLIGHT)); + FillRect(hDC, &rect, hBrush); + DeleteObject(hBrush); + } +} + +static void ME_DrawTextWithStyle(ME_Context *c, int x, int y, LPCWSTR szText, + int nChars, ME_Style *s, int width, + int nSelFrom, int nSelTo, int ymin, int cy) +{ HDC hDC = c->hDC; HGDIOBJ hOldFont; COLORREF rgbOld; int yOffset = 0, yTwipsOffset = 0; SIZE sz; COLORREF rgb; + HPEN hPen = NULL, hOldPen = NULL; + BOOL bHighlightedText = (nSelFrom < nChars && nSelTo >= 0 + && nSelFrom < nSelTo && !c->editor->bHideSelection); + int xSelStart = x, xSelEnd = x; + int *lpDx = NULL; + /* lpDx is only needed for tabs to make sure the underline done automatically + * by the font extends to the end of the tab. Tabs are always stored as + * a single character run, so we can handle this case separately, since + * otherwise lpDx would need to specify the lengths of each character. */ + if (width && nChars == 1) + lpDx = &width; /* Make sure underline for tab extends across tab space */ hOldFont = ME_SelectStyleFont(c, s); - if ((s->fmt.dwMask & CFM_LINK) && (s->fmt.dwEffects & CFE_LINK)) - rgb = RGB(0,0,255); - else if ((s->fmt.dwMask & CFM_COLOR) && (s->fmt.dwEffects & CFE_AUTOCOLOR)) - rgb = GetSysColor(COLOR_WINDOWTEXT); - else - rgb = s->fmt.crTextColor; - rgbOld = SetTextColor(hDC, rgb); if ((s->fmt.dwMask & s->fmt.dwEffects) & CFM_OFFSET) { yTwipsOffset = s->fmt.yOffset; } @@ -186,12 +289,45 @@ static void ME_DrawTextWithStyle(ME_Context *c, int x, int y, LPCWSTR szText, in } if (yTwipsOffset) yOffset = ME_twips2pointsY(c, yTwipsOffset); - ExtTextOutW(hDC, x, y-yOffset, 0, NULL, szText, nChars, NULL); + + if ((s->fmt.dwMask & CFM_LINK) && (s->fmt.dwEffects & CFE_LINK)) + rgb = RGB(0,0,255); + else if ((s->fmt.dwMask & CFM_COLOR) && (s->fmt.dwEffects & CFE_AUTOCOLOR)) + rgb = GetSysColor(COLOR_WINDOWTEXT); + else + rgb = s->fmt.crTextColor; + + /* Determine the area that is selected in the run. */ GetTextExtentPoint32W(hDC, szText, nChars, &sz); - if (width) *width = sz.cx; + /* Treat width as an optional parameter. We can get the width from the + * text extent of the string if it isn't specified. */ + if (!width) width = sz.cx; + if (bHighlightedText) + { + if (nSelFrom <= 0) + { + nSelFrom = 0; + } + else + { + GetTextExtentPoint32W(hDC, szText, nSelFrom, &sz); + xSelStart = x + sz.cx; + } + if (nSelTo >= nChars) + { + nSelTo = nChars; + xSelEnd = x + width; + } + else + { + GetTextExtentPoint32W(hDC, szText+nSelFrom, nSelTo-nSelFrom, &sz); + xSelEnd = xSelStart + sz.cx; + } + } + + /* Choose the pen type for underlining the text. */ if (s->fmt.dwMask & CFM_UNDERLINETYPE) { - HPEN hPen; switch (s->fmt.bUnderlineType) { case CFU_UNDERLINE: @@ -210,27 +346,67 @@ static void ME_DrawTextWithStyle(ME_Context *c, int x, int y, LPCWSTR szText, in hPen = NULL; break; } - if (hPen != NULL) + if (hPen) { - HPEN hOldPen = SelectObject(hDC, hPen); - /* FIXME: should use textmetrics info for Descent info */ - MoveToEx(hDC, x, y - yOffset + 1, NULL); - LineTo(hDC, x + sz.cx, y - yOffset + 1); - SelectObject(hDC, hOldPen); - DeleteObject(hPen); + hOldPen = SelectObject(hDC, hPen); } } - if (nSelFrom < nChars && nSelTo >= 0 && nSelFromeditor->bEmulateVersion10) { - if (nSelFrom < 0) nSelFrom = 0; - if (nSelTo > nChars) nSelTo = nChars; - GetTextExtentPoint32W(hDC, szText, nSelFrom, &sz); - x += sz.cx; - GetTextExtentPoint32W(hDC, szText+nSelFrom, nSelTo-nSelFrom, &sz); - - /* Invert selection if not hidden by EM_HIDESELECTION */ - if (c->editor->bHideSelection == FALSE) - PatBlt(hDC, x, ymin, sz.cx, cy, DSTINVERT); + COLORREF rgbBackOld; + RECT dim; + /* FIXME: should use textmetrics info for Descent info */ + if (hPen) + MoveToEx(hDC, x, y - yOffset + 1, NULL); + if (xSelStart > x) + { + ExtTextOutW(hDC, x, y-yOffset, 0, NULL, szText, nSelFrom, NULL); + if (hPen) + LineTo(hDC, xSelStart, y - yOffset + 1); + } + dim.top = ymin; + dim.bottom = ymin + cy; + dim.left = xSelStart; + dim.right = xSelEnd; + SetTextColor(hDC, GetSysColor(COLOR_HIGHLIGHTTEXT)); + rgbBackOld = SetBkColor(hDC, GetSysColor(COLOR_HIGHLIGHT)); + ExtTextOutW(hDC, xSelStart, y-yOffset, ETO_OPAQUE, &dim, + szText+nSelFrom, nSelTo-nSelFrom, lpDx); + if (hPen) + LineTo(hDC, xSelEnd, y - yOffset + 1); + SetBkColor(hDC, rgbBackOld); + if (xSelEnd < x + width) + { + SetTextColor(hDC, rgb); + ExtTextOutW(hDC, xSelEnd, y-yOffset, 0, NULL, szText+nSelTo, + nChars-nSelTo, NULL); + if (hPen) + LineTo(hDC, x + width, y - yOffset + 1); + } + } + else + { + ExtTextOutW(hDC, x, y-yOffset, 0, NULL, szText, nChars, lpDx); + + /* FIXME: should use textmetrics info for Descent info */ + if (hPen) + { + MoveToEx(hDC, x, y - yOffset + 1, NULL); + LineTo(hDC, x + width, y - yOffset + 1); + } + + if (bHighlightedText) /* v1.0 inverts the selection */ + { + PatBlt(hDC, xSelStart, ymin, xSelEnd-xSelStart, cy, DSTINVERT); + } + } + + if (hPen) + { + SelectObject(hDC, hOldPen); + DeleteObject(hPen); } SetTextColor(hDC, rgbOld); ME_UnselectStyleFont(c, s, hOldFont); @@ -261,14 +437,28 @@ static void ME_DrawRun(ME_Context *c, int x, int y, ME_DisplayItem *rundi, ME_Pa ME_GetSelection(c->editor, &nSelFrom, &nSelTo); /* Draw selected end-of-paragraph mark */ - if (run->nFlags & MERF_ENDPARA && runofs >= nSelFrom && runofs < nSelTo) - ME_DrawTextWithStyle(c, x, y, wszSpace, 1, run->style, NULL, 0, 1, - c->pt.y + start->member.row.nYPos, - start->member.row.nHeight); - /* you can always comment it out if you need visible paragraph marks */ - if (run->nFlags & (MERF_ENDPARA | MERF_TAB | MERF_CELL)) + if (run->nFlags & MERF_ENDPARA) + { + if (runofs >= nSelFrom && runofs < nSelTo) + { + ME_HighlightSpace(c, x, y, wszSpace, 1, run->style, 0, 0, 1, + c->pt.y + start->member.row.pt.y, + start->member.row.nHeight); + } return; + } + + if (run->nFlags & (MERF_TAB | MERF_ENDCELL)) + { + /* wszSpace is used instead of the tab character because otherwise + * an unwanted symbol can be inserted instead. */ + ME_DrawTextWithStyle(c, x, y, wszSpace, 1, run->style, run->nWidth, + nSelFrom-runofs,nSelTo-runofs, + c->pt.y + start->member.row.pt.y, + start->member.row.nHeight); + return; + } if (run->nFlags & MERF_GRAPHICS) ME_DrawOLE(c, x, y, run, para, (runofs >= nSelFrom) && (runofs < nSelTo)); @@ -277,16 +467,16 @@ static void ME_DrawRun(ME_Context *c, int x, int y, ME_DisplayItem *rundi, ME_Pa if (c->editor->cPasswordMask) { ME_String *szMasked = ME_MakeStringR(c->editor->cPasswordMask,ME_StrVLen(run->strText)); - ME_DrawTextWithStyle(c, x, y, - szMasked->szData, ME_StrVLen(szMasked), run->style, NULL, - nSelFrom-runofs,nSelTo-runofs, c->pt.y+start->member.row.nYPos, start->member.row.nHeight); + ME_DrawTextWithStyle(c, x, y, + szMasked->szData, ME_StrVLen(szMasked), run->style, run->nWidth, + nSelFrom-runofs,nSelTo-runofs, c->pt.y+start->member.row.pt.y, start->member.row.nHeight); ME_DestroyString(szMasked); } else - ME_DrawTextWithStyle(c, x, y, - run->strText->szData, ME_StrVLen(run->strText), run->style, NULL, - nSelFrom-runofs,nSelTo-runofs, c->pt.y+start->member.row.nYPos, start->member.row.nHeight); - } + ME_DrawTextWithStyle(c, x, y, + run->strText->szData, ME_StrVLen(run->strText), run->style, run->nWidth, + nSelFrom-runofs,nSelTo-runofs, c->pt.y+start->member.row.pt.y, start->member.row.nHeight); + } } static const struct {unsigned width_num : 4, width_den : 4, pen_style : 4, dble : 1;} border_details[] = { @@ -375,14 +565,45 @@ static void ME_DrawParaDecoration(ME_Context* c, ME_Paragraph* para, int y, RECT { int idx, border_width, top_border, bottom_border; RECT rc; + BOOL hasParaBorder; SetRectEmpty(bounds); if (!(para->pFmt->dwMask & (PFM_BORDER | PFM_SPACEBEFORE | PFM_SPACEAFTER))) return; border_width = top_border = bottom_border = 0; idx = (para->pFmt->wBorders >> 8) & 0xF; - if ((para->pFmt->dwMask & PFM_BORDER) && idx != 0 && (para->pFmt->wBorders & 0xF)) + hasParaBorder = (!(c->editor->bEmulateVersion10 && + para->pFmt->dwMask & PFM_TABLE && + para->pFmt->wEffects & PFE_TABLE) && + (para->pFmt->dwMask & PFM_BORDER) && + idx != 0 && + (para->pFmt->wBorders & 0xF)); + if (hasParaBorder) { + /* FIXME: wBorders is not stored as MSDN says in v1.0 - 4.1 of richedit + * controls. It actually stores the paragraph or row border style. Although + * the value isn't used for drawing, it is used for streaming out rich text. + * + * wBorders stores the border style for each side (top, left, bottom, right) + * using nibble (4 bits) to store each border style. The rich text format + * control words, and their associated value are the following: + * \brdrdash 0 + * \brdrdashsm 1 + * \brdrdb 2 + * \brdrdot 3 + * \brdrhair 4 + * \brdrs 5 + * \brdrth 6 + * \brdrtriple 7 + * + * The order of the sides stored actually differs from v1.0 to 3.0 and v4.1. + * The mask corresponding to each side for the version are the following: + * mask v1.0-3.0 v4.1 + * 0x000F top left + * 0x00F0 left top + * 0x0F00 bottom right + * 0xF000 right bottom + */ if (para->pFmt->wBorders & 0x00B0) FIXME("Unsupported border flags %x\n", para->pFmt->wBorders); border_width = ME_GetParaBorderWidth(c->editor, para->pFmt->wBorders); @@ -410,7 +631,9 @@ static void ME_DrawParaDecoration(ME_Context* c, ME_Paragraph* para, int y, RECT FillRect(c->hDC, &rc, c->editor->hbrBackground); } - if ((para->pFmt->dwMask & PFM_BORDER) && idx != 0 && (para->pFmt->wBorders & 0xF)) { + /* Native richedit doesn't support paragraph borders in v1.0 - 4.1, + * but might support it in later versions. */ + if (hasParaBorder) { int pen_width; COLORREF pencr; HPEN pen = NULL, oldpen = NULL; @@ -489,49 +712,253 @@ static void ME_DrawParaDecoration(ME_Context* c, ME_Paragraph* para, int y, RECT } } +static void ME_DrawTableBorders(ME_Context *c, ME_DisplayItem *paragraph) +{ + ME_Paragraph *para = ¶graph->member.para; + if (!c->editor->bEmulateVersion10) /* v4.1 */ + { + if (para->pCell) + { + RECT rc; + ME_Cell *cell = ¶->pCell->member.cell; + ME_DisplayItem *paraAfterRow; + HPEN pen, oldPen; + LOGBRUSH logBrush; + HBRUSH brush; + COLORREF color; + POINT oldPt; + int width; + BOOL atTop = (para->pCell != para->prev_para->member.para.pCell); + BOOL atBottom = (para->pCell != para->next_para->member.para.pCell); + int top = (atTop ? cell->pt.y : para->pt.y) - ME_GetYScrollPos(c->editor); + int bottom = (atBottom ? + cell->pt.y + cell->nHeight - ME_GetYScrollPos(c->editor): + top + para->nHeight + (atTop ? cell->yTextOffset : 0)); + rc.left = cell->pt.x; + rc.right = rc.left + cell->nWidth; + if (atTop) { + /* Erase gap before text if not all borders are the same height. */ + width = max(ME_twips2pointsY(c, cell->border.top.width), 1); + rc.top = top + width; + width = cell->yTextOffset - width; + rc.bottom = rc.top + width; + if (width) { + FillRect(c->hDC, &rc, c->editor->hbrBackground); + } + } + /* Draw cell borders. + * The borders borders are draw in is left, top, bottom, right in order + * to be consistent with native richedit. This is noticeable from the + * overlap of borders of different colours. */ + if (!(para->nFlags & MEPF_ROWEND)) { + rc.top = top; + rc.bottom = bottom; + if (cell->border.left.width > 0) + { + color = cell->border.left.colorRef; + width = max(ME_twips2pointsX(c, cell->border.left.width), 1); + } else { + color = RGB(192,192,192); + width = 1; + } + logBrush.lbStyle = BS_SOLID; + logBrush.lbColor = color; + logBrush.lbHatch = 0; + pen = ExtCreatePen(PS_GEOMETRIC|PS_SOLID|PS_ENDCAP_FLAT|PS_JOIN_MITER, + width, &logBrush, 0, NULL); + oldPen = SelectObject(c->hDC, pen); + MoveToEx(c->hDC, rc.left, rc.top, &oldPt); + LineTo(c->hDC, rc.left, rc.bottom); + SelectObject(c->hDC, oldPen); + DeleteObject(pen); + MoveToEx(c->hDC, oldPt.x, oldPt.y, NULL); + } + + if (atTop) { + if (cell->border.top.width > 0) + { + brush = CreateSolidBrush(cell->border.top.colorRef); + width = max(ME_twips2pointsY(c, cell->border.top.width), 1); + } else { + brush = GetStockObject(LTGRAY_BRUSH); + width = 1; + } + rc.top = top; + rc.bottom = rc.top + width; + FillRect(c->hDC, &rc, brush); + if (cell->border.top.width > 0) + DeleteObject(brush); + } + + /* Draw the bottom border if at the last paragraph in the cell, and when + * in the last row of the table. */ + if (atBottom) { + int oldLeft = rc.left; + width = max(ME_twips2pointsY(c, cell->border.bottom.width), 1); + paraAfterRow = ME_GetTableRowEnd(paragraph)->member.para.next_para; + if (paraAfterRow->member.para.nFlags & MEPF_ROWSTART) { + ME_DisplayItem *nextEndCell; + nextEndCell = ME_FindItemBack(ME_GetTableRowEnd(paraAfterRow), diCell); + assert(nextEndCell && !nextEndCell->member.cell.next_cell); + rc.left = nextEndCell->member.cell.pt.x; + /* FIXME: Native draws FROM the bottom of the table rather than + * TO the bottom of the table in this case, but just doing so here + * will case the next row to erase the border. */ + /* + rc.top = bottom; + rc.bottom = rc.top + width; + */ + } + if (rc.left < rc.right) { + if (cell->border.bottom.width > 0) { + brush = CreateSolidBrush(cell->border.bottom.colorRef); + } else { + brush = GetStockObject(LTGRAY_BRUSH); + } + rc.bottom = bottom; + rc.top = rc.bottom - width; + FillRect(c->hDC, &rc, brush); + if (cell->border.bottom.width > 0) + DeleteObject(brush); + } + rc.left = oldLeft; + } + + /* Right border only drawn if at the end of the table row. */ + if (!cell->next_cell->member.cell.next_cell && + !(para->nFlags & MEPF_ROWSTART)) + { + rc.top = top; + rc.bottom = bottom; + if (cell->border.right.width > 0) { + color = cell->border.right.colorRef; + width = max(ME_twips2pointsX(c, cell->border.right.width), 1); + } else { + color = RGB(192,192,192); + width = 1; + } + logBrush.lbStyle = BS_SOLID; + logBrush.lbColor = color; + logBrush.lbHatch = 0; + pen = ExtCreatePen(PS_GEOMETRIC|PS_SOLID|PS_ENDCAP_FLAT|PS_JOIN_MITER, + width, &logBrush, 0, NULL); + oldPen = SelectObject(c->hDC, pen); + MoveToEx(c->hDC, rc.right - 1, rc.top, &oldPt); + LineTo(c->hDC, rc.right - 1, rc.bottom); + SelectObject(c->hDC, oldPen); + DeleteObject(pen); + MoveToEx(c->hDC, oldPt.x, oldPt.y, NULL); + } + } + } else { /* v1.0 - 3.0 */ + /* Draw simple table border */ + if (para->pFmt->dwMask & PFM_TABLE && para->pFmt->wEffects & PFE_TABLE) { + HPEN pen = NULL, oldpen = NULL; + int i, firstX, startX, endX, rowY, rowBottom, nHeight; + POINT oldPt; + PARAFORMAT2 *pNextFmt; + + pen = CreatePen(PS_SOLID, 0, para->border.top.colorRef); + oldpen = SelectObject(c->hDC, pen); + + /* Find the start relative to the text */ + firstX = ME_FindItemFwd(paragraph, diRun)->member.run.pt.x; + /* Go back by the horizontal gap, which is stored in dxOffset */ + firstX -= ME_twips2pointsX(c, para->pFmt->dxOffset); + /* The left edge, stored in dxStartIndent affected just the first edge */ + startX = firstX - ME_twips2pointsX(c, para->pFmt->dxStartIndent); + rowY = c->pt.y; + if (para->pFmt->dwMask & PFM_SPACEBEFORE) + rowY += ME_twips2pointsY(c, para->pFmt->dySpaceBefore); + nHeight = ME_FindItemFwd(paragraph, diStartRow)->member.row.nHeight; + rowBottom = rowY + nHeight; + + /* Draw horizontal lines */ + MoveToEx(c->hDC, firstX, rowY, &oldPt); + i = para->pFmt->cTabCount - 1; + endX = startX + ME_twips2pointsX(c, para->pFmt->rgxTabs[i] & 0x00ffffff) + 1; + LineTo(c->hDC, endX, rowY); + pNextFmt = para->next_para->member.para.pFmt; + /* The bottom of the row only needs to be drawn if the next row is + * not a table. */ + if (!(pNextFmt && pNextFmt->dwMask & PFM_TABLE && pNextFmt->wEffects && + para->nRows == 1)) + { + /* Decrement rowBottom to draw the bottom line within the row, and + * to not draw over this line when drawing the vertical lines. */ + rowBottom--; + MoveToEx(c->hDC, firstX, rowBottom, NULL); + LineTo(c->hDC, endX, rowBottom); + } + + /* Draw vertical lines */ + MoveToEx(c->hDC, firstX, rowY, NULL); + LineTo(c->hDC, firstX, rowBottom); + for (i = 0; i < para->pFmt->cTabCount; i++) + { + int rightBoundary = para->pFmt->rgxTabs[i] & 0x00ffffff; + endX = startX + ME_twips2pointsX(c, rightBoundary); + MoveToEx(c->hDC, endX, rowY, NULL); + LineTo(c->hDC, endX, rowBottom); + } + + MoveToEx(c->hDC, oldPt.x, oldPt.y, NULL); + SelectObject(c->hDC, oldpen); + DeleteObject(pen); + } + } +} + void ME_DrawParagraph(ME_Context *c, ME_DisplayItem *paragraph) { int align = SetTextAlign(c->hDC, TA_BASELINE); ME_DisplayItem *p; ME_Run *run; ME_Paragraph *para = NULL; - RECT rc, rcPara, bounds; + RECT rc, bounds; int y = c->pt.y; - int height = 0, baseline = 0, no=0, pno = 0; - int xs = 0, xe = 0; + int height = 0, baseline = 0, no=0; BOOL visible = FALSE; c->pt.x = c->rcView.left; - rcPara.left = c->rcView.left; - rcPara.right = c->rcView.right; + rc.left = c->rcView.left; + rc.right = c->rcView.right; for (p = paragraph; p!=paragraph->member.para.next_para; p = p->next) { switch(p->type) { case diParagraph: para = &p->member.para; assert(para); - pno = 0; - xs = c->rcView.left + ME_twips2pointsX(c, para->pFmt->dxStartIndent); - xe = c->rcView.right - ME_twips2pointsX(c, para->pFmt->dxRightIndent); + if (para->pCell) + { + ME_Cell *cell = ¶->pCell->member.cell; + rc.left = cell->pt.x; + rc.right = rc.left + cell->nWidth; + } + if (para->nFlags & MEPF_ROWSTART) { + ME_Cell *cell = ¶->next_para->member.para.pCell->member.cell; + rc.right = cell->pt.x; + } else if (para->nFlags & MEPF_ROWEND) { + ME_Cell *cell = ¶->prev_para->member.para.pCell->member.cell; + rc.left = cell->pt.x + cell->nWidth; + } ME_DrawParaDecoration(c, para, y, &bounds); y += bounds.top; break; case diStartRow: + /* we should have seen a diParagraph before */ + assert(para); y += height; - rcPara.top = y; - rcPara.bottom = y+p->member.row.nHeight; - visible = RectVisible(c->hDC, &rcPara); - if (visible) { - /* left margin */ - rc.left = c->rcView.left + bounds.left; - rc.right = xs; - rc.top = y; + rc.top = y; + if (para->nFlags & MEPF_ROWSTART) { + ME_Cell *cell = ¶->next_para->member.para.pCell->member.cell; + rc.bottom = y + cell->nHeight; + } else if (para->nFlags & MEPF_ROWEND) { + ME_Cell *cell = ¶->prev_para->member.para.pCell->member.cell; + rc.bottom = y + cell->nHeight; + } else { rc.bottom = y+p->member.row.nHeight; - FillRect(c->hDC, &rc, c->editor->hbrBackground); - /* right margin */ - rc.left = xe; - rc.right = c->rcView.right - bounds.right; - FillRect(c->hDC, &rc, c->editor->hbrBackground); - rc.left = xs; - rc.right = xe; + } + visible = RectVisible(c->hDC, &rc); + if (visible) { FillRect(c->hDC, &rc, c->editor->hbrBackground); } if (me_debug) @@ -543,11 +970,9 @@ void ME_DrawParagraph(ME_Context *c, ME_DisplayItem *paragraph) { pt.y = 12+y; ME_DebugWrite(c->hDC, &pt, buf); } - + height = p->member.row.nHeight; baseline = p->member.row.nBaseline; - if (!pno++) - xe += ME_twips2pointsX(c, para->pFmt->dxOffset); break; case diRun: assert(para); @@ -578,11 +1003,27 @@ void ME_DrawParagraph(ME_Context *c, ME_DisplayItem *paragraph) { } /* c->pt.x += p->member.run.nWidth; */ break; + case diCell: + /* Clear any space at the bottom of the cell after the text. */ + if (para->nFlags & MEPF_ROWSTART) + break; + y += height; + rc.top = y; + rc.bottom = p->member.cell.pt.y + p->member.cell.nHeight + - ME_GetYScrollPos(c->editor); + if (RectVisible(c->hDC, &rc)) + { + FillRect(c->hDC, &rc, c->editor->hbrBackground); + } + break; default: break; } no++; } + + ME_DrawTableBorders(c, paragraph); + SetTextAlign(c->hDC, align); } @@ -641,6 +1082,7 @@ void ME_Scroll(ME_TextEditor *editor, int value, int type) ME_Repaint(editor); } + editor->vert_si.nMax = 0; ME_UpdateScrollBar(editor); } @@ -663,6 +1105,14 @@ void ME_Scroll(ME_TextEditor *editor, int value, int type) bScrollBarWasVisible = ME_GetYScrollVisible(editor); bScrollBarWillBeVisible = editor->nHeight > editor->sizeWindow.cy; + si.fMask = SIF_PAGE | SIF_RANGE; + if (GetWindowLongW(hWnd, GWL_STYLE) & ES_DISABLENOSCROLL) + si.fMask |= SIF_DISABLENOSCROLL; + if ((si.fMask & SIF_DISABLENOSCROLL)) + { + bScrollBarWillBeVisible = TRUE; + } + if (bScrollBarWasVisible != bScrollBarWillBeVisible) { ShowScrollBar(hWnd, SB_VERT, bScrollBarWillBeVisible); @@ -670,17 +1120,27 @@ void ME_Scroll(ME_TextEditor *editor, int value, int type) ME_WrapMarkedParagraphs(editor); } - si.fMask = SIF_PAGE | SIF_RANGE; - if (GetWindowLongW(hWnd, GWL_STYLE) & ES_DISABLENOSCROLL) - si.fMask |= SIF_DISABLENOSCROLL; - si.nMin = 0; si.nMax = editor->nTotalLength; si.nPage = editor->sizeWindow.cy; - TRACE("min=%d max=%d page=%d\n", si.nMin, si.nMax, si.nPage); - SetScrollInfo(hWnd, SB_VERT, &si, TRUE); + if (!(si.nMin == editor->vert_si.nMin && si.nMax == editor->vert_si.nMax && si.nPage == editor->vert_si.nPage)) + { + TRACE("min=%d max=%d page=%d\n", si.nMin, si.nMax, si.nPage); + editor->vert_si.nMin = si.nMin; + editor->vert_si.nMax = si.nMax; + editor->vert_si.nPage = si.nPage; + if (bScrollBarWillBeVisible) + { + SetScrollInfo(hWnd, SB_VERT, &si, TRUE); + } + else + { + if (bScrollBarWasVisible && !(si.fMask & SIF_DISABLENOSCROLL)) + ShowScrollBar(hWnd, SB_VERT, FALSE); + } + } } int ME_GetYScrollPos(ME_TextEditor *editor) @@ -693,10 +1153,7 @@ int ME_GetYScrollPos(ME_TextEditor *editor) BOOL ME_GetYScrollVisible(ME_TextEditor *editor) { /* Returns true if the scrollbar is visible */ - SCROLLBARINFO sbi; - sbi.cbSize = sizeof(sbi); - GetScrollBarInfo(editor->hWnd, OBJID_VSCROLL, &sbi); - return ((sbi.rgstate[0] & STATE_SYSTEM_INVISIBLE) == 0); + return (editor->vert_si.nMax - editor->vert_si.nMin >= max(editor->vert_si.nPage - 1, 0)); } void ME_EnsureVisible(ME_TextEditor *editor, ME_DisplayItem *pRun) @@ -708,7 +1165,7 @@ void ME_EnsureVisible(ME_TextEditor *editor, ME_DisplayItem *pRun) assert(pRow); assert(pPara); - y = pPara->member.para.nYPos+pRow->member.row.nYPos; + y = pPara->member.para.pt.y+pRow->member.row.pt.y; yheight = pRow->member.row.nHeight; yold = ME_GetYScrollPos(editor); yrel = y - yold; diff --git a/reactos/dll/win32/riched20/para.c b/reactos/dll/win32/riched20/para.c index de69794c33d..dd745ffc18a 100644 --- a/reactos/dll/win32/riched20/para.c +++ b/reactos/dll/win32/riched20/para.c @@ -28,7 +28,6 @@ static const WCHAR wszParagraphSign[] = {0xB6, 0}; void ME_MakeFirstParagraph(ME_TextEditor *editor) { ME_Context c; - PARAFORMAT2 fmt; CHARFORMAT2W cf; LOGFONTW lf; HFONT hf; @@ -62,13 +61,6 @@ void ME_MakeFirstParagraph(ME_TextEditor *editor) cf.bPitchAndFamily = lf.lfPitchAndFamily; cf.bCharSet = lf.lfCharSet; - ZeroMemory(&fmt, sizeof(fmt)); - fmt.cbSize = sizeof(fmt); - fmt.dwMask = PFM_ALIGNMENT | PFM_OFFSET | PFM_STARTINDENT | PFM_RIGHTINDENT | PFM_TABSTOPS; - fmt.wAlignment = PFA_LEFT; - - *para->member.para.pFmt = fmt; - style = ME_MakeStyle(&cf); text->pDefaultStyle = style; @@ -112,17 +104,51 @@ void ME_MarkForPainting(ME_TextEditor *editor, ME_DisplayItem *first, const ME_D } } +static void ME_UpdateTableFlags(ME_DisplayItem *para) +{ + para->member.para.pFmt->dwMask |= PFM_TABLE|PFM_TABLEROWDELIMITER; + if (para->member.para.pCell) { + para->member.para.nFlags |= MEPF_CELL; + } else { + para->member.para.nFlags &= ~MEPF_CELL; + } + if (para->member.para.nFlags & MEPF_ROWEND) { + para->member.para.pFmt->wEffects |= PFE_TABLEROWDELIMITER; + } else { + para->member.para.pFmt->wEffects &= ~PFE_TABLEROWDELIMITER; + } + if (para->member.para.nFlags & (MEPF_ROWSTART|MEPF_CELL|MEPF_ROWEND)) + para->member.para.pFmt->wEffects |= PFE_TABLE; + else + para->member.para.pFmt->wEffects &= ~PFE_TABLE; +} + /* split paragraph at the beginning of the run */ -ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *run, ME_Style *style, int numCR, int numLF) +ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *run, + ME_Style *style, int numCR, int numLF, + int paraFlags) { ME_DisplayItem *next_para = NULL; ME_DisplayItem *run_para = NULL; ME_DisplayItem *new_para = ME_MakeDI(diParagraph); - ME_DisplayItem *end_run = ME_MakeRun(style,ME_MakeString(wszParagraphSign), MERF_ENDPARA); + ME_DisplayItem *end_run; ME_UndoItem *undo = NULL; int ofs; ME_DisplayItem *pp; int end_len = numCR + numLF; + int run_flags = MERF_ENDPARA; + if (!editor->bEmulateVersion10) { /* v4.1 */ + /* At most 1 of MEPF_CELL, MEPF_ROWSTART, or MEPF_ROWEND should be set. */ + assert(!(paraFlags & ~(MEPF_CELL|MEPF_ROWSTART|MEPF_ROWEND))); + assert(!(paraFlags & (paraFlags-1))); + if (paraFlags == MEPF_CELL) + run_flags |= MERF_ENDCELL; + else if (paraFlags == MEPF_ROWSTART) + run_flags |= MERF_TABLESTART|MERF_HIDDEN; + } else { /* v1.0 - v3.0 */ + assert(!(paraFlags & (MEPF_CELL|MEPF_ROWSTART|MEPF_ROWEND))); + } + end_run = ME_MakeRun(style,ME_MakeString(wszParagraphSign), run_flags); assert(run->type == diRun); @@ -147,40 +173,12 @@ ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *run, ME } new_para->member.para.nCharOfs = ME_GetParagraph(run)->member.para.nCharOfs+ofs; new_para->member.para.nCharOfs += end_len; - - new_para->member.para.nFlags = MEPF_REWRAP; /* FIXME copy flags (if applicable) */ + new_para->member.para.nFlags = MEPF_REWRAP; + /* FIXME initialize format style and call ME_SetParaFormat blah blah */ *new_para->member.para.pFmt = *run_para->member.para.pFmt; + new_para->member.para.border = run_para->member.para.border; - new_para->member.para.bTable = run_para->member.para.bTable; - - /* Inherit previous cell definitions if any */ - new_para->member.para.pCells = NULL; - if (run_para->member.para.pCells) - { - ME_TableCell *pCell, *pNewCell; - - for (pCell = run_para->member.para.pCells; pCell; pCell = pCell->next) - { - pNewCell = ALLOC_OBJ(ME_TableCell); - pNewCell->nRightBoundary = pCell->nRightBoundary; - pNewCell->next = NULL; - if (new_para->member.para.pCells) - new_para->member.para.pLastCell->next = pNewCell; - else - new_para->member.para.pCells = pNewCell; - new_para->member.para.pLastCell = pNewCell; - } - } - - /* fix paragraph properties. FIXME only needed when called from RTF reader */ - if (run_para->member.para.pCells && !run_para->member.para.bTable) - { - /* Paragraph does not have an \intbl keyword, so any table definition - * stored is invalid */ - ME_DestroyTableCellList(run_para); - } - /* insert paragraph into paragraph double linked list */ new_para->member.para.prev_para = run_para; new_para->member.para.next_para = next_para; @@ -191,6 +189,44 @@ ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *run, ME ME_InsertBefore(run, new_para); ME_InsertBefore(new_para, end_run); + if (!editor->bEmulateVersion10) { /* v4.1 */ + if (paraFlags & (MEPF_ROWSTART|MEPF_CELL)) + { + ME_DisplayItem *cell = ME_MakeDI(diCell); + ME_InsertBefore(new_para, cell); + new_para->member.para.pCell = cell; + cell->member.cell.next_cell = NULL; + if (paraFlags & MEPF_ROWSTART) + { + run_para->member.para.nFlags |= MEPF_ROWSTART; + cell->member.cell.prev_cell = NULL; + cell->member.cell.parent_cell = run_para->member.para.pCell; + if (run_para->member.para.pCell) + cell->member.cell.nNestingLevel = run_para->member.para.pCell->member.cell.nNestingLevel + 1; + else + cell->member.cell.nNestingLevel = 1; + } else { + cell->member.cell.prev_cell = run_para->member.para.pCell; + assert(cell->member.cell.prev_cell); + cell->member.cell.prev_cell->member.cell.next_cell = cell; + assert(run_para->member.para.nFlags & MEPF_CELL); + assert(!(run_para->member.para.nFlags & MEPF_ROWSTART)); + cell->member.cell.nNestingLevel = cell->member.cell.prev_cell->member.cell.nNestingLevel; + cell->member.cell.parent_cell = cell->member.cell.prev_cell->member.cell.parent_cell; + } + } else if (paraFlags & MEPF_ROWEND) { + run_para->member.para.nFlags |= MEPF_ROWEND; + run_para->member.para.pCell = run_para->member.para.pCell->member.cell.parent_cell; + new_para->member.para.pCell = run_para->member.para.pCell; + assert(run_para->member.para.prev_para->member.para.nFlags & MEPF_CELL); + assert(!(run_para->member.para.prev_para->member.para.nFlags & MEPF_ROWSTART)); + } else { + new_para->member.para.pCell = run_para->member.para.pCell; + } + ME_UpdateTableFlags(run_para); + ME_UpdateTableFlags(new_para); + } + /* force rewrap of the */ run_para->member.para.prev_para->member.para.nFlags |= MEPF_REWRAP; new_para->member.para.prev_para->member.para.nFlags |= MEPF_REWRAP; @@ -204,7 +240,8 @@ ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *run, ME /* join tp with tp->member.para.next_para, keeping tp's style; this * is consistent with the original */ -ME_DisplayItem *ME_JoinParagraphs(ME_TextEditor *editor, ME_DisplayItem *tp) +ME_DisplayItem *ME_JoinParagraphs(ME_TextEditor *editor, ME_DisplayItem *tp, + BOOL keepFirstParaFormat) { ME_DisplayItem *pNext, *pFirstRunInNext, *pRun, *pTmp; int i, shift; @@ -232,14 +269,53 @@ ME_DisplayItem *ME_JoinParagraphs(ME_TextEditor *editor, ME_DisplayItem *tp) ME_InitCharFormat2W(&fmt); ME_SetCharFormat(editor, pNext->member.para.nCharOfs - end_len, end_len, &fmt); } - undo = ME_AddUndoItem(editor, diUndoSplitParagraph, NULL); + undo = ME_AddUndoItem(editor, diUndoSplitParagraph, pNext); if (undo) { undo->nStart = pNext->member.para.nCharOfs - end_len; undo->nCR = pRun->member.run.nCR; undo->nLF = pRun->member.run.nLF; - assert(pNext->member.para.pFmt->cbSize == sizeof(PARAFORMAT2)); - *undo->di.member.para.pFmt = *pNext->member.para.pFmt; + } + if (!keepFirstParaFormat) + { + ME_AddUndoItem(editor, diUndoSetParagraphFormat, tp); + *tp->member.para.pFmt = *pNext->member.para.pFmt; + } + + if (!editor->bEmulateVersion10) { /* v4.1 */ + /* Table cell/row properties are always moved over from the removed para. */ + tp->member.para.nFlags = pNext->member.para.nFlags; + tp->member.para.pCell = pNext->member.para.pCell; + + /* Remove cell boundary if it is between the end paragraph run and the next + * paragraph display item. */ + pTmp = pRun->next; + while (pTmp != pNext) { + if (pTmp->type == diCell) + { + ME_Cell *pCell = &pTmp->member.cell; + if (undo) + { + assert(!(undo->di.member.para.nFlags & MEPF_ROWEND)); + if (!(undo->di.member.para.nFlags & MEPF_ROWSTART)) + undo->di.member.para.nFlags |= MEPF_CELL; + undo->di.member.para.pCell = ALLOC_OBJ(ME_DisplayItem); + *undo->di.member.para.pCell = *pTmp; + undo->di.member.para.pCell->next = NULL; + undo->di.member.para.pCell->prev = NULL; + undo->di.member.para.pCell->member.cell.next_cell = NULL; + undo->di.member.para.pCell->member.cell.prev_cell = NULL; + } + ME_Remove(pTmp); + if (pCell->prev_cell) + pCell->prev_cell->member.cell.next_cell = pCell->next_cell; + if (pCell->next_cell) + pCell->next_cell->member.cell.prev_cell = pCell->prev_cell; + ME_DestroyDisplayItem(pTmp); + break; + } + pTmp = pTmp->next; + } } shift = pNext->member.para.nCharOfs - tp->member.para.nCharOfs - end_len; @@ -355,7 +431,7 @@ void ME_DumpParaStyleToBuf(const PARAFORMAT2 *pFmt, char buf[2048]) #undef DUMP_EFFECT } -void ME_SetParaFormat(ME_TextEditor *editor, ME_DisplayItem *para, const PARAFORMAT2 *pFmt) +BOOL ME_SetParaFormat(ME_TextEditor *editor, ME_DisplayItem *para, const PARAFORMAT2 *pFmt) { PARAFORMAT2 copy; assert(sizeof(*para->member.para.pFmt) == sizeof(PARAFORMAT2)); @@ -375,7 +451,8 @@ void ME_SetParaFormat(ME_TextEditor *editor, ME_DisplayItem *para, const PARAFOR PFM_TABLE) /* we take for granted that PFE_xxx is the hiword of the corresponding PFM_xxx */ if (pFmt->dwMask & EFFECTS_MASK) { - para->member.para.pFmt->dwMask &= ~(pFmt->dwMask & EFFECTS_MASK); + para->member.para.pFmt->dwMask |= pFmt->dwMask & EFFECTS_MASK; + para->member.para.pFmt->wEffects &= ~HIWORD(pFmt->dwMask); para->member.para.pFmt->wEffects |= pFmt->wEffects & HIWORD(pFmt->dwMask); } #undef EFFECTS_MASK @@ -411,6 +488,8 @@ void ME_SetParaFormat(ME_TextEditor *editor, ME_DisplayItem *para, const PARAFOR if (memcmp(©, para->member.para.pFmt, sizeof(PARAFORMAT2))) para->member.para.nFlags |= MEPF_REWRAP; + + return TRUE; } @@ -438,7 +517,7 @@ ME_GetSelectionParas(ME_TextEditor *editor, ME_DisplayItem **para, ME_DisplayIte } -void ME_SetSelectionParaFormat(ME_TextEditor *editor, const PARAFORMAT2 *pFmt) +BOOL ME_SetSelectionParaFormat(ME_TextEditor *editor, const PARAFORMAT2 *pFmt) { ME_DisplayItem *para, *para_end; @@ -450,6 +529,8 @@ void ME_SetSelectionParaFormat(ME_TextEditor *editor, const PARAFORMAT2 *pFmt) break; para = para->member.para.next_para; } while(1); + + return TRUE; } void ME_GetParaFormat(ME_TextEditor *editor, const ME_DisplayItem *para, PARAFORMAT2 *pFmt) @@ -472,6 +553,7 @@ void ME_GetSelectionParaFormat(ME_TextEditor *editor, PARAFORMAT2 *pFmt) ME_GetParaFormat(editor, para, pFmt); if (para == para_end) return; + /* Invalidate values that change across the selected paragraphs. */ do { ZeroMemory(&tmp, sizeof(tmp)); tmp.cbSize = sizeof(tmp); @@ -480,8 +562,8 @@ void ME_GetSelectionParaFormat(ME_TextEditor *editor, PARAFORMAT2 *pFmt) #define CHECK_FIELD(m, f) \ if (pFmt->f != tmp.f) pFmt->dwMask &= ~(m); + pFmt->dwMask &= ~((pFmt->wEffects ^ tmp.wEffects) << 16); CHECK_FIELD(PFM_NUMBERING, wNumbering); - /* para->member.para.pFmt->wEffects = pFmt->wEffects; */ assert(tmp.dwMask & PFM_ALIGNMENT); CHECK_FIELD(PFM_NUMBERING, wNumbering); assert(tmp.dwMask & PFM_STARTINDENT); @@ -520,3 +602,13 @@ void ME_GetSelectionParaFormat(ME_TextEditor *editor, PARAFORMAT2 *pFmt) para = para->member.para.next_para; } while(1); } + +void ME_SetDefaultParaFormat(PARAFORMAT2 *pFmt) +{ + ZeroMemory(pFmt, sizeof(PARAFORMAT2)); + pFmt->cbSize = sizeof(PARAFORMAT2); + pFmt->dwMask = PFM_ALL2; + pFmt->wAlignment = PFA_LEFT; + pFmt->sStyle = -1; + pFmt->bOutlineLevel = TRUE; +} diff --git a/reactos/dll/win32/riched20/reader.c b/reactos/dll/win32/riched20/reader.c index f456a09fdc3..8801137bc96 100644 --- a/reactos/dll/win32/riched20/reader.c +++ b/reactos/dll/win32/riched20/reader.c @@ -169,6 +169,12 @@ RTFDestroy(RTF_Info *info) } RTFDestroyAttrs(info); heap_free(info->cpOutputBuffer); + while (info->tableDef) + { + RTFTable *tableDef = info->tableDef; + info->tableDef = tableDef->parent; + heap_free(tableDef); + } } @@ -235,6 +241,13 @@ void RTFInit(RTF_Info *info) info->dwMaxCPOutputCount = 0x1000; info->cpOutputBuffer = heap_alloc(info->dwMaxCPOutputCount); } + + if (info->tableDef) + ZeroMemory(info->tableDef, sizeof(info->tableDef)); + info->tableDef = NULL; + info->nestingLevel = 0; + info->canInheritInTbl = FALSE; + info->borderType = 0; } /* @@ -1438,6 +1451,8 @@ static RTFKey rtfKey[] = /* is this valid? */ { rtfSpecialChar, rtfCurHeadPict, "chpict", 0 }, { rtfSpecialChar, rtfUnicode, "u", 0 }, + { rtfSpecialChar, rtfNestCell, "nestcell", 0 }, + { rtfSpecialChar, rtfNestRow, "nestrow", 0 }, /* * Character formatting attributes @@ -1601,6 +1616,7 @@ static RTFKey rtfKey[] = { rtfParAttr, rtfDarkDiagHatchBgPat, "bgdkdcross", 0 }, { rtfParAttr, rtfBgPatLineColor, "cfpat", 0 }, { rtfParAttr, rtfBgPatColor, "cbpat", 0 }, + { rtfParAttr, rtfNestLevel, "itap", 0 }, /* * Section formatting attributes @@ -1903,6 +1919,8 @@ static RTFKey rtfKey[] = { rtfDestination, rtfIndexRange, "rxe", 0 }, { rtfDestination, rtfTOC, "tc", 0 }, { rtfDestination, rtfNeXTGraphic, "NeXTGraphic", 0 }, + { rtfDestination, rtfNestTableProps, "nesttableprops", 0 }, + { rtfDestination, rtfNoNestTables, "nonesttables", 0 }, /* * Font families @@ -2605,7 +2623,6 @@ static void SpecialChar (RTF_Info *info) break; case rtfPage: case rtfSect: - case rtfRow: case rtfPar: RTFPutUnicodeChar (info, '\r'); if (info->editor->bEmulateVersion10) RTFPutUnicodeChar (info, '\n'); diff --git a/reactos/dll/win32/riched20/riched20.rbuild b/reactos/dll/win32/riched20/riched20.rbuild index e01a41bb17b..49bcba6bbb3 100644 --- a/reactos/dll/win32/riched20/riched20.rbuild +++ b/reactos/dll/win32/riched20/riched20.rbuild @@ -22,6 +22,7 @@ run.c string.c style.c + table.c txtsrv.c undo.c wrap.c diff --git a/reactos/dll/win32/riched20/rtf.h b/reactos/dll/win32/riched20/rtf.h index 8b39f60f647..ec08161a94b 100644 --- a/reactos/dll/win32/riched20/rtf.h +++ b/reactos/dll/win32/riched20/rtf.h @@ -182,7 +182,9 @@ # define rtfTOC 72 # define rtfNeXTGraphic 73 # define rtfGenerator 74 -# define rtfMaxDestination 75 /* highest dest + 1 */ +# define rtfNestTableProps 75 +# define rtfNoNestTables 76 +# define rtfMaxDestination 77 /* highest dest + 1 */ # define rtfFontFamily 4 # define rtfFFNil 0 @@ -261,6 +263,8 @@ # define rtfCurHeadPict 57 /* valid? */ /*# define rtfCurAnnot 58*/ /* apparently not used */ # define rtfUnicode 58 /* no better category*/ +# define rtfNestCell 59 +# define rtfNestRow 60 # define rtfStyleAttr 7 # define rtfAdditive 0 /* new in 1.10 */ @@ -551,6 +555,7 @@ # define rtfDarkDiagHatchBgPat 101 # define rtfBgPatLineColor 102 # define rtfBgPatColor 103 +# define rtfNestLevel 104 # define rtfCharAttr 12 # define rtfPlain 0 @@ -945,7 +950,9 @@ typedef struct RTFFont RTFFont; typedef struct RTFColor RTFColor; typedef struct RTFStyle RTFStyle; typedef struct RTFStyleElt RTFStyleElt; - +typedef struct RTFBorder RTFBorder; +typedef struct RTFCell RTFCell; +typedef struct RTFTable RTFTable; struct RTFFont { @@ -1000,6 +1007,74 @@ struct RTFStyleElt RTFStyleElt *rtfNextSE; /* next element in style */ }; +struct RTFBorder +{ + int width; + int color; +}; + +struct RTFCell +{ + int rightBoundary; + RTFBorder border[4]; +}; + + +struct RTFTable +{ + RTFCell cells[MAX_TABLE_CELLS]; + int numCellsDefined; + + int gapH, leftEdge; + /* borders for the table row */ + RTFBorder border[6]; + + /* Used in v1.0 - v3.0 */ + int numCellsInserted; + + /* v4.1 */ + /* tableRowStart may be the start row paragraph of the table row, + * or it may store the end of the previous row if it may still be + * continued, otherwise NULL is stored. */ + ME_DisplayItem *tableRowStart; + + /* Table definitions are stored as a stack to support nested tables. */ + RTFTable *parent; +}; + + +# define RTFBorderTypeNone 0x00 +# define RTFBorderTypePara 0x10 /* for \brdrX control words */ +# define RTFBorderTypeRow 0x20 /* for \trbrdrX control words */ +# define RTFBorderTypeCell 0x30 /* for \clbrdrX control words */ +# define RTFBorderTypeMask 0xf0 + +/* The X in the control words \brdrX \trbrdrX and \clbrdrX mentioned above + * should be one of t, l, b, r which stand for top, left, bottom, right + * respectively. */ +# define RTFBorderSideTop 0x00 +# define RTFBorderSideLeft 0x01 +# define RTFBorderSideBottom 0x02 +# define RTFBorderSideRight 0x03 +# define RTFBorderSideHorizontal 0x04 +# define RTFBorderSideVertical 0x05 +# define RTFBorderSideMask 0x0f + +/* Here are the values from the border types and sides put together. */ +# define RTFBorderParaTop 0x10 +# define RTFBorderParaLeft 0x11 +# define RTFBorderParaBottom 0x12 +# define RTFBorderParaRight 0x13 +# define RTFBorderRowTop 0x20 +# define RTFBorderRowLeft 0x21 +# define RTFBorderRowBottom 0x22 +# define RTFBorderRowRight 0x23 +# define RTFBorderRowHorizontal 0x24 +# define RTFBorderRowVertical 0x25 +# define RTFBorderCellTop 0x30 +# define RTFBorderCellLeft 0x31 +# define RTFBorderCellBottom 0x32 +# define RTFBorderCellRight 0x33 /* * Return pointer to new element of type t, or NULL @@ -1105,6 +1180,11 @@ struct _RTF_Info { int stackTop; BOOL styleChanged; LPRICHEDITOLE lpRichEditOle; + + RTFTable *tableDef; + int nestingLevel; + BOOL canInheritInTbl; + int borderType; /* value corresponds to the RTFBorder constants. */ }; diff --git a/reactos/dll/win32/riched20/run.c b/reactos/dll/win32/riched20/run.c index 00285365976..bb34ad864ed 100644 --- a/reactos/dll/win32/riched20/run.c +++ b/reactos/dll/win32/riched20/run.c @@ -134,6 +134,9 @@ void ME_CheckCharOffsets(ME_TextEditor *editor) else ofs += ME_StrLen(p->member.run.strText); break; + case diCell: + TRACE_(richedit_check)("cell\n"); + break; default: assert(0); } @@ -436,7 +439,7 @@ void ME_UpdateRunFlags(ME_TextEditor *editor, ME_Run *run) { assert(run->nCharOfs != -1); - if (RUN_IS_HIDDEN(run)) + if (RUN_IS_HIDDEN(run) || run->nFlags & MERF_TABLESTART) run->nFlags |= MERF_HIDDEN; else run->nFlags &= ~MERF_HIDDEN; @@ -483,7 +486,8 @@ int ME_CharFromPoint(ME_Context *c, int cx, ME_Run *run) if (!run->strText->nLen) return 0; - if (run->nFlags & (MERF_TAB | MERF_CELL)) + if (run->nFlags & MERF_TAB || + (run->nFlags & (MERF_ENDCELL|MERF_ENDPARA)) == MERF_ENDCELL) { if (cx < run->nWidth/2) return 0; @@ -540,7 +544,7 @@ int ME_CharFromPointCursor(ME_TextEditor *editor, int cx, ME_Run *run) if (!run->strText->nLen) return 0; - if (run->nFlags & (MERF_TAB | MERF_CELL)) + if (run->nFlags & (MERF_TAB | MERF_ENDCELL)) { if (cx < run->nWidth/2) return 0; @@ -667,13 +671,21 @@ static SIZE ME_GetRunSizeCommon(ME_Context *c, const ME_Paragraph *para, ME_Run if (run->nFlags & MERF_TAB) { - int pos = 0, i = 0, ppos; + int pos = 0, i = 0, ppos, shift = 0; PARAFORMAT2 *pFmt = para->pFmt; + if (c->editor->bEmulateVersion10 && /* v1.0 - 3.0 */ + pFmt->dwMask & PFM_TABLE && pFmt->wEffects & PFE_TABLE) + /* The horizontal gap shifts the tab positions to leave the gap. */ + shift = pFmt->dxOffset * 2; do { if (i < pFmt->cTabCount) { - pos = pFmt->rgxTabs[i]&0x00FFFFFF; + /* Only one side of the horizontal gap is needed at the end of + * the table row. */ + if (i == pFmt->cTabCount -1) + shift = shift >> 1; + pos = shift + (pFmt->rgxTabs[i]&0x00FFFFFF); i++; } else @@ -697,11 +709,6 @@ static SIZE ME_GetRunSizeCommon(ME_Context *c, const ME_Paragraph *para, ME_Run /* descent is unchanged */ return size; } - if (run->nFlags & MERF_CELL) - { - size.cx = ME_twips2pointsX(c, run->pCell->nRightBoundary) - run->pt.x; - return size; - } return size; } @@ -832,17 +839,8 @@ void ME_SetCharFormat(ME_TextEditor *editor, int nOfs, int nChars, CHARFORMAT2W void ME_SetDefaultCharFormat(ME_TextEditor *editor, CHARFORMAT2W *mod) { ME_Style *style; - ME_UndoItem *undo; - /* FIXME: Should this be removed? It breaks a test. */ assert(mod->cbSize == sizeof(CHARFORMAT2W)); - undo = ME_AddUndoItem(editor, diUndoSetDefaultCharFormat, NULL); - if (undo) { - undo->nStart = -1; - undo->nLen = -1; - undo->di.member.ustyle = editor->pBuffer->pDefaultStyle; - ME_AddRefStyle(undo->di.member.ustyle); - } style = ME_ApplyStyle(editor->pBuffer->pDefaultStyle, mod); editor->pBuffer->pDefaultStyle->fmt = style->fmt; editor->pBuffer->pDefaultStyle->tm = style->tm; diff --git a/reactos/dll/win32/riched20/style.c b/reactos/dll/win32/riched20/style.c index 66e45f5a832..b7dae3e97a5 100644 --- a/reactos/dll/win32/riched20/style.c +++ b/reactos/dll/win32/riched20/style.c @@ -197,7 +197,10 @@ ME_Style *ME_ApplyStyle(ME_Style *sSrc, CHARFORMAT2W *style) COPY_STYLE_ITEM(CFM_LCID, lcid); COPY_STYLE_ITEM(CFM_OFFSET, yOffset); COPY_STYLE_ITEM(CFM_REVAUTHOR, bRevAuthor); - COPY_STYLE_ITEM(CFM_SIZE, yHeight); + if (style->dwMask & CFM_SIZE) { + s->fmt.dwMask |= CFM_SIZE; + s->fmt.yHeight = min(style->yHeight, yHeightCharPtsMost * 20); + } COPY_STYLE_ITEM(CFM_SPACING, sSpacing); COPY_STYLE_ITEM(CFM_STYLE, sStyle); COPY_STYLE_ITEM(CFM_UNDERLINETYPE, bUnderlineType); diff --git a/reactos/dll/win32/riched20/table.c b/reactos/dll/win32/riched20/table.c new file mode 100644 index 00000000000..248ea11719f --- /dev/null +++ b/reactos/dll/win32/riched20/table.c @@ -0,0 +1,618 @@ +/* + * RichEdit functions dealing with on tables + * + * Copyright 2008 by Dylan Smith + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/* + * The implementation of tables differs greatly between version 3.0 + * (in riched20.dll) and version 4.1 (in msftedit.dll) of richedit controls. + * Currently Wine is not distinguishing between version 3.0 and version 4.1, + * so v4.1 is assumed unless v1.0 is being emulated (i.e. riched32.dll is used). + * If this lack of distinction causes a bug in a Windows application, then Wine + * will need to start making this distinction. + * + * Richedit version 1.0 - 3.0: + * Tables are implemented in these versions using tabs at the end of cells, + * and tab stops to position the cells. The paragraph format flag PFE_TABLE + * will indicate the the paragraph is a table row. Note that in this + * implementation there is one paragraph per table row. + * + * Richedit version 4.1: + * Tables are implemented such that cells can contain multiple paragraphs, + * each with it's own paragraph format, and cells may even contain tables + * nested within the cell. + * + * There are is also a paragraph at the start of each table row that contains + * the rows paragraph format (e.g. to change the row alignment to row), and a + * paragraph at the end of the table row with the PFE_TABLEROWDELIMITER flag + * set. The paragraphs at the start and end of the table row should always be + * empty, but should have a length of 2. + * + * Wine implements this using display items (ME_DisplayItem) with a type of + * diCell. These cell display items store the cell properties, and are + * inserted into the editors linked list before each cell, and at the end of + * the last cell. The cell display item for a cell comes before the paragraphs + * for the cell, but the last cell display item refers to no cell, so it is + * just a delimiter. + */ + +#include "editor.h" +#include "rtf.h" + +WINE_DEFAULT_DEBUG_CHANNEL(richedit); +WINE_DECLARE_DEBUG_CHANNEL(richedit_lists); + +static ME_DisplayItem* ME_InsertEndParaFromCursor(ME_TextEditor *editor, + int nCursor, + int numCR, + int numLF, + int paraFlags) +{ + ME_Style *pStyle = ME_GetInsertStyle(editor, nCursor); + ME_DisplayItem *tp; + ME_Cursor* cursor = &editor->pCursors[nCursor]; + if (cursor->nOffset) { + ME_SplitRunSimple(editor, cursor->pRun, cursor->nOffset); + cursor = &editor->pCursors[nCursor]; + } + + tp = ME_SplitParagraph(editor, cursor->pRun, pStyle, numCR, numLF, paraFlags); + cursor->pRun = ME_FindItemFwd(tp, diRun); + return tp; +} + +ME_DisplayItem* ME_InsertTableRowStartFromCursor(ME_TextEditor *editor) +{ + ME_DisplayItem *para; + para = ME_InsertEndParaFromCursor(editor, 0, 1, 1, MEPF_ROWSTART); + return para->member.para.prev_para; +} + +ME_DisplayItem* ME_InsertTableRowStartAtParagraph(ME_TextEditor *editor, + ME_DisplayItem *para) +{ + ME_DisplayItem *prev_para, *end_para; + ME_Cursor savedCursor = editor->pCursors[0]; + ME_DisplayItem *startRowPara; + editor->pCursors[0].pRun = ME_FindItemFwd(para, diRun); + editor->pCursors[0].nOffset = 0; + editor->pCursors[1] = editor->pCursors[0]; + startRowPara = ME_InsertTableRowStartFromCursor(editor); + editor->pCursors[0] = savedCursor; + editor->pCursors[1] = editor->pCursors[0]; + + end_para = ME_GetParagraph(editor->pCursors[0].pRun)->member.para.next_para; + prev_para = startRowPara->member.para.next_para; + para = prev_para->member.para.next_para; + while (para != end_para) + { + para->member.para.pCell = prev_para->member.para.pCell; + para->member.para.nFlags |= MEPF_CELL; + para->member.para.nFlags &= ~(MEPF_ROWSTART|MEPF_ROWEND); + para->member.para.pFmt->dwMask |= PFM_TABLE|PFM_TABLEROWDELIMITER; + para->member.para.pFmt->wEffects |= PFE_TABLE; + para->member.para.pFmt->wEffects &= ~PFE_TABLEROWDELIMITER; + prev_para = para; + para = para->member.para.next_para; + } + return startRowPara; +} + +/* Inserts a diCell and starts a new paragraph for the next cell. + * + * Returns the first paragraph of the new cell. */ +ME_DisplayItem* ME_InsertTableCellFromCursor(ME_TextEditor *editor) +{ + ME_DisplayItem *para; + para = ME_InsertEndParaFromCursor(editor, 0, 1, 0, MEPF_CELL); + return para; +} + +ME_DisplayItem* ME_InsertTableRowEndFromCursor(ME_TextEditor *editor) +{ + ME_DisplayItem *para; + para = ME_InsertEndParaFromCursor(editor, 0, 1, 1, MEPF_ROWEND); + return para->member.para.prev_para; +} + +ME_DisplayItem* ME_GetTableRowEnd(ME_DisplayItem *para) +{ + ME_DisplayItem *cell; + assert(para); + if (para->member.para.nFlags & MEPF_ROWEND) + return para; + if (para->member.para.nFlags & MEPF_ROWSTART) + para = para->member.para.next_para; + cell = para->member.para.pCell; + assert(cell && cell->type == diCell); + while (cell->member.cell.next_cell) + cell = cell->member.cell.next_cell; + + para = ME_FindItemFwd(cell, diParagraph); + assert(para && para->member.para.nFlags & MEPF_ROWEND); + return para; +} + +ME_DisplayItem* ME_GetTableRowStart(ME_DisplayItem *para) +{ + ME_DisplayItem *cell; + assert(para); + if (para->member.para.nFlags & MEPF_ROWSTART) + return para; + if (para->member.para.nFlags & MEPF_ROWEND) + para = para->member.para.prev_para; + cell = para->member.para.pCell; + assert(cell && cell->type == diCell); + while (cell->member.cell.prev_cell) + cell = cell->member.cell.prev_cell; + + para = ME_FindItemBack(cell, diParagraph); + assert(para && para->member.para.nFlags & MEPF_ROWSTART); + return para; +} + +/* Make a bunch of assertions to make sure tables haven't been corrupted. + * + * These invariants may not hold true in the middle of streaming in rich text + * or during an undo and redo of streaming in rich text. It should be safe to + * call this method after an event is processed. + */ +void ME_CheckTablesForCorruption(ME_TextEditor *editor) +{ + if(TRACE_ON(richedit_lists)) + { + TRACE_(richedit_lists)("---\n"); + ME_DumpDocument(editor->pBuffer); + } +#ifndef NDEBUG + { + ME_DisplayItem *p, *pPrev; + pPrev = editor->pBuffer->pFirst; + p = pPrev->next; + if (!editor->bEmulateVersion10) /* v4.1 */ + { + while (p->type == diParagraph) + { + assert(p->member.para.pFmt->dwMask & PFM_TABLE); + assert(p->member.para.pFmt->dwMask & PFM_TABLEROWDELIMITER); + if (p->member.para.pCell) + { + assert(p->member.para.nFlags & MEPF_CELL); + assert(p->member.para.pFmt->wEffects & PFE_TABLE); + } + if (p->member.para.pCell != pPrev->member.para.pCell) + { + /* There must be a diCell in between the paragraphs if pCell changes. */ + ME_DisplayItem *pCell = ME_FindItemBack(p, diCell); + assert(pCell); + assert(ME_FindItemBack(p, diRun) == ME_FindItemBack(pCell, diRun)); + } + if (p->member.para.nFlags & MEPF_ROWEND) + { + /* ROWEND must come after a cell. */ + assert(pPrev->member.para.pCell); + assert(p->member.para.pCell + == pPrev->member.para.pCell->member.cell.parent_cell); + assert(p->member.para.pFmt->wEffects & PFE_TABLEROWDELIMITER); + } + else if (p->member.para.pCell) + { + assert(!(p->member.para.pFmt->wEffects & PFE_TABLEROWDELIMITER)); + assert(pPrev->member.para.pCell || + pPrev->member.para.nFlags & MEPF_ROWSTART); + if (pPrev->member.para.pCell && + !(pPrev->member.para.nFlags & MEPF_ROWSTART)) + { + assert(p->member.para.pCell->member.cell.parent_cell + == pPrev->member.para.pCell->member.cell.parent_cell); + if (pPrev->member.para.pCell != p->member.para.pCell) + assert(pPrev->member.para.pCell + == p->member.para.pCell->member.cell.prev_cell); + } + } + else if (!(p->member.para.nFlags & MEPF_ROWSTART)) + { + assert(!(p->member.para.pFmt->wEffects & (PFE_TABLE|PFE_TABLEROWDELIMITER))); + /* ROWSTART must be followed by a cell. */ + assert(!(p->member.para.nFlags & MEPF_CELL)); + /* ROWSTART must be followed by a cell. */ + assert(!(pPrev->member.para.nFlags & MEPF_ROWSTART)); + } + pPrev = p; + p = p->member.para.next_para; + } + } else { /* v1.0 - 3.0 */ + while (p->type == diParagraph) + { + assert(!(p->member.para.nFlags & (MEPF_ROWSTART|MEPF_ROWEND|MEPF_CELL))); + assert(p->member.para.pFmt->dwMask & PFM_TABLE); + assert(!(p->member.para.pFmt->wEffects & PFM_TABLEROWDELIMITER)); + assert(!p->member.para.pCell); + p = p->member.para.next_para; + } + return; + } + assert(p->type == diTextEnd); + assert(!pPrev->member.para.pCell); + } +#endif +} + +BOOL ME_IsInTable(ME_DisplayItem *pItem) +{ + PARAFORMAT2 *pFmt; + if (!pItem) + return FALSE; + if (pItem->type == diRun) + pItem = ME_GetParagraph(pItem); + if (pItem->type != diParagraph) + return FALSE; + pFmt = pItem->member.para.pFmt; + return pFmt->dwMask & PFM_TABLE && pFmt->wEffects & PFE_TABLE; +} + +/* Table rows should either be deleted completely or not at all. */ +void ME_ProtectPartialTableDeletion(ME_TextEditor *editor, int nOfs,int *nChars) +{ + ME_Cursor c, c2; + ME_DisplayItem *this_para, *end_para; + ME_CursorFromCharOfs(editor, nOfs, &c); + this_para = ME_GetParagraph(c.pRun); + ME_CursorFromCharOfs(editor, nOfs + *nChars, &c2); + end_para = ME_GetParagraph(c2.pRun); + if (c2.pRun->member.run.nFlags & MERF_ENDPARA) { + /* End offset might be in the middle of the end paragraph run. + * If this is the case, then we need to use the next paragraph as the last + * paragraphs. + */ + int remaining = nOfs + *nChars - c2.pRun->member.run.nCharOfs + - end_para->member.para.nCharOfs; + if (remaining) + { + assert(remaining < c2.pRun->member.run.nCR + c2.pRun->member.run.nLF); + end_para = end_para->member.para.next_para; + } + } + if (!editor->bEmulateVersion10) { /* v4.1 */ + if (this_para->member.para.pCell != end_para->member.para.pCell || + ((this_para->member.para.nFlags|end_para->member.para.nFlags) + & (MEPF_ROWSTART|MEPF_ROWEND))) + { + while (this_para != end_para) + { + ME_DisplayItem *next_para = this_para->member.para.next_para; + BOOL bTruancateDeletion = FALSE; + if (this_para->member.para.nFlags & MEPF_ROWSTART) { + /* The following while loop assumes that next_para is MEPF_ROWSTART, + * so moving back one paragraph let's it be processed as the start + * of the row. */ + next_para = this_para; + this_para = this_para->member.para.prev_para; + } else if (next_para->member.para.pCell != this_para->member.para.pCell + || this_para->member.para.nFlags & MEPF_ROWEND) + { + /* Start of the deletion from after the start of the table row. */ + bTruancateDeletion = TRUE; + } + while (!bTruancateDeletion && + next_para->member.para.nFlags & MEPF_ROWSTART) + { + next_para = ME_GetTableRowEnd(next_para)->member.para.next_para; + if (next_para->member.para.nCharOfs > nOfs + *nChars) + { + /* End of deletion is not past the end of the table row. */ + next_para = this_para->member.para.next_para; + /* Delete the end paragraph preceding the table row if the + * preceding table row will be empty. */ + if (this_para->member.para.nCharOfs >= nOfs) + { + next_para = next_para->member.para.next_para; + } + bTruancateDeletion = TRUE; + } else { + this_para = next_para->member.para.prev_para; + } + } + if (bTruancateDeletion) + { + ME_Run *end_run = &ME_FindItemBack(next_para, diRun)->member.run; + int nCharsNew = (next_para->member.para.nCharOfs - nOfs + - end_run->nCR - end_run->nLF); + nCharsNew = max(nCharsNew, 0); + assert(nCharsNew <= *nChars); + *nChars = nCharsNew; + break; + } + this_para = next_para; + } + } + } else { /* v1.0 - 3.0 */ + ME_DisplayItem *pRun; + int nCharsToBoundary; + + if (this_para->member.para.nCharOfs != nOfs && + this_para->member.para.pFmt->dwMask & PFM_TABLE && + this_para->member.para.pFmt->wEffects & PFE_TABLE) + { + pRun = c.pRun; + /* Find the next tab or end paragraph to use as a delete boundary */ + while (!(pRun->member.run.nFlags & (MERF_TAB|MERF_ENDPARA))) + pRun = ME_FindItemFwd(pRun, diRun); + nCharsToBoundary = pRun->member.run.nCharOfs + - c.pRun->member.run.nCharOfs + - c.nOffset; + *nChars = min(*nChars, nCharsToBoundary); + } else if (end_para->member.para.pFmt->dwMask & PFM_TABLE && + end_para->member.para.pFmt->wEffects & PFE_TABLE) + { + if (this_para == end_para) + { + pRun = c2.pRun; + /* Find the previous tab or end paragraph to use as a delete boundary */ + while (pRun && !(pRun->member.run.nFlags & (MERF_TAB|MERF_ENDPARA))) + pRun = ME_FindItemBack(pRun, diRun); + if (pRun && pRun->member.run.nFlags & MERF_ENDPARA) + { + /* We are in the first cell, and have gone back to the previous + * paragraph, so nothing needs to be protected. */ + pRun = NULL; + } + } else { + /* The deletion starts from before the row, so don't join it with + * previous non-empty paragraphs. */ + pRun = NULL; + if (nOfs > this_para->member.para.nCharOfs) + pRun = ME_FindItemBack(end_para, diRun); + if (!pRun) + pRun = ME_FindItemFwd(end_para, diRun); + } + if (pRun) + { + nCharsToBoundary = ME_GetParagraph(pRun)->member.para.nCharOfs + + pRun->member.run.nCharOfs + - nOfs; + if (nCharsToBoundary >= 0) + *nChars = min(*nChars, nCharsToBoundary); + } + } + if (*nChars < 0) + nChars = 0; + } +} + +static ME_DisplayItem* ME_AppendTableRow(ME_TextEditor *editor, + ME_DisplayItem *table_row) +{ + WCHAR endl = '\r', tab = '\t'; + ME_DisplayItem *run; + PARAFORMAT2 *pFmt; + int i; + + assert(table_row); + if (!editor->bEmulateVersion10) { /* v4.1 */ + ME_DisplayItem *insertedCell, *para, *cell; + cell = ME_FindItemFwd(table_row, diCell); + run = ME_GetTableRowEnd(table_row)->member.para.next_para; + run = ME_FindItemFwd(run, diRun); + editor->pCursors[0].pRun = run; + editor->pCursors[0].nOffset = 0; + editor->pCursors[1] = editor->pCursors[0]; + para = ME_InsertTableRowStartFromCursor(editor); + insertedCell = ME_FindItemFwd(para, diCell); + /* Copy cell properties */ + insertedCell->member.cell.nRightBoundary = cell->member.cell.nRightBoundary; + while (cell->member.cell.next_cell) { + cell = cell->member.cell.next_cell; + para = ME_InsertTableCellFromCursor(editor); + insertedCell = ME_FindItemBack(para, diCell); + /* Copy cell properties */ + insertedCell->member.cell.nRightBoundary = cell->member.cell.nRightBoundary; + }; + ME_InsertTableRowEndFromCursor(editor); + /* return the table row start for the inserted paragraph */ + return ME_FindItemFwd(cell, diParagraph)->member.para.next_para; + } else { /* v1.0 - 3.0 */ + run = ME_FindItemBack(table_row->member.para.next_para, diRun); + pFmt = table_row->member.para.pFmt; + assert(pFmt->dwMask & PFM_TABLE && pFmt->wEffects & PFE_TABLE); + editor->pCursors[0].pRun = run; + editor->pCursors[0].nOffset = 0; + editor->pCursors[1] = editor->pCursors[0]; + ME_InsertTextFromCursor(editor, 0, &endl, 1, run->member.run.style); + run = editor->pCursors[0].pRun; + for (i = 0; i < pFmt->cTabCount; i++) { + ME_InsertTextFromCursor(editor, 0, &tab, 1, run->member.run.style); + } + return table_row->member.para.next_para; + } +} + +/* Selects the next table cell or appends a new table row if at end of table */ +static void ME_SelectOrInsertNextCell(ME_TextEditor *editor, + ME_DisplayItem *run) +{ + ME_DisplayItem *para = ME_GetParagraph(run); + int i; + + assert(run && run->type == diRun); + assert(ME_IsInTable(run)); + if (!editor->bEmulateVersion10) { /* v4.1 */ + ME_DisplayItem *cell; + /* Get the initial cell */ + if (para->member.para.nFlags & MEPF_ROWSTART) { + cell = para->member.para.next_para->member.para.pCell; + } else if (para->member.para.nFlags & MEPF_ROWEND) { + cell = para->member.para.prev_para->member.para.pCell; + } else { + cell = para->member.para.pCell; + } + assert(cell); + /* Get the next cell. */ + if (cell->member.cell.next_cell && + cell->member.cell.next_cell->member.cell.next_cell) + { + cell = cell->member.cell.next_cell; + } else { + para = ME_GetTableRowEnd(ME_FindItemFwd(cell, diParagraph)); + para = para->member.para.next_para; + assert(para); + if (para->member.para.nFlags & MEPF_ROWSTART) { + cell = para->member.para.next_para->member.para.pCell; + } else { + /* Insert row */ + para = para->member.para.prev_para; + para = ME_AppendTableRow(editor, ME_GetTableRowStart(para)); + /* Put cursor at the start of the new table row */ + para = para->member.para.next_para; + editor->pCursors[0].pRun = ME_FindItemFwd(para, diRun); + editor->pCursors[0].nOffset = 0; + editor->pCursors[1] = editor->pCursors[0]; + ME_WrapMarkedParagraphs(editor); + return; + } + } + /* Select cell */ + editor->pCursors[1].pRun = ME_FindItemFwd(cell, diRun); + editor->pCursors[1].nOffset = 0; + assert(editor->pCursors[0].pRun); + cell = cell->member.cell.next_cell; + editor->pCursors[0].pRun = ME_FindItemBack(cell, diRun); + editor->pCursors[0].nOffset = 0; + assert(editor->pCursors[1].pRun); + } else { /* v1.0 - 3.0 */ + if (run->member.run.nFlags & MERF_ENDPARA && + ME_IsInTable(ME_FindItemFwd(run, diParagraphOrEnd))) + { + run = ME_FindItemFwd(run, diRun); + assert(run); + } + for (i = 0; i < 2; i++) + { + while (!(run->member.run.nFlags & MERF_TAB)) + { + run = ME_FindItemFwd(run, diRunOrParagraphOrEnd); + if (run->type != diRun) + { + para = run; + if (ME_IsInTable(para)) + { + run = ME_FindItemFwd(para, diRun); + assert(run); + editor->pCursors[0].pRun = run; + editor->pCursors[0].nOffset = 0; + i = 1; + } else { + /* Insert table row */ + para = ME_AppendTableRow(editor, para->member.para.prev_para); + /* Put cursor at the start of the new table row */ + editor->pCursors[0].pRun = ME_FindItemFwd(para, diRun); + editor->pCursors[0].nOffset = 0; + editor->pCursors[1] = editor->pCursors[0]; + ME_WrapMarkedParagraphs(editor); + return; + } + } + } + if (i == 0) + run = ME_FindItemFwd(run, diRun); + editor->pCursors[i].pRun = run; + editor->pCursors[i].nOffset = 0; + } + } +} + + +void ME_TabPressedInTable(ME_TextEditor *editor, BOOL bSelectedRow) +{ + /* FIXME: Shift tab should move to the previous cell. */ + ME_Cursor fromCursor, toCursor; + ME_InvalidateSelection(editor); + { + int from, to; + from = ME_GetCursorOfs(editor, 0); + to = ME_GetCursorOfs(editor, 1); + if (from <= to) + { + fromCursor = editor->pCursors[0]; + toCursor = editor->pCursors[1]; + } else { + fromCursor = editor->pCursors[1]; + toCursor = editor->pCursors[0]; + } + } + if (!editor->bEmulateVersion10) /* v4.1 */ + { + if (!ME_IsInTable(toCursor.pRun)) + { + editor->pCursors[0] = toCursor; + editor->pCursors[1] = toCursor; + } else { + ME_SelectOrInsertNextCell(editor, toCursor.pRun); + } + } else { /* v1.0 - 3.0 */ + if (!ME_IsInTable(fromCursor.pRun)) { + editor->pCursors[0] = fromCursor; + editor->pCursors[1] = fromCursor; + /* FIXME: For some reason the caret is shown at the start of the + * previous paragraph in v1.0 to v3.0, and bCaretAtEnd only works + * within the paragraph for wrapped lines. */ + if (ME_FindItemBack(fromCursor.pRun, diRun)) + editor->bCaretAtEnd = TRUE; + } else if ((bSelectedRow || !ME_IsInTable(toCursor.pRun))) { + ME_SelectOrInsertNextCell(editor, fromCursor.pRun); + } else { + if (ME_IsSelection(editor) && !toCursor.nOffset) + { + ME_DisplayItem *run; + run = ME_FindItemBack(toCursor.pRun, diRunOrParagraphOrEnd); + if (run->type == diRun && run->member.run.nFlags & MERF_TAB) + ME_SelectOrInsertNextCell(editor, run); + else + ME_SelectOrInsertNextCell(editor, toCursor.pRun); + } else { + ME_SelectOrInsertNextCell(editor, toCursor.pRun); + } + } + } + ME_InvalidateSelection(editor); + ME_Repaint(editor); + HideCaret(editor->hWnd); + ME_ShowCaret(editor); + ME_SendSelChange(editor); +} + +struct RTFTable *ME_MakeTableDef(ME_TextEditor *editor) +{ + RTFTable *tableDef = ALLOC_OBJ(RTFTable); + ZeroMemory(tableDef, sizeof(RTFTable)); + if (!editor->bEmulateVersion10) /* v4.1 */ + tableDef->gapH = 10; + return tableDef; +} + +void ME_InitTableDef(ME_TextEditor *editor, struct RTFTable *tableDef) +{ + ZeroMemory(tableDef->cells, sizeof(tableDef->cells)); + ZeroMemory(tableDef->border, sizeof(tableDef->border)); + tableDef->numCellsDefined = 0; + tableDef->leftEdge = 0; + if (!editor->bEmulateVersion10) /* v4.1 */ + tableDef->gapH = 10; + else /* v1.0 - 3.0 */ + tableDef->gapH = 0; +} diff --git a/reactos/dll/win32/riched20/undo.c b/reactos/dll/win32/riched20/undo.c index bf992ab20f7..3ab39d01526 100644 --- a/reactos/dll/win32/riched20/undo.c +++ b/reactos/dll/win32/riched20/undo.c @@ -84,17 +84,22 @@ ME_UndoItem *ME_AddUndoItem(ME_TextEditor *editor, ME_DIType type, const ME_Disp else pItem->member.run.ole_obj = NULL; break; case diUndoSetCharFormat: - case diUndoSetDefaultCharFormat: break; case diUndoDeleteRun: case diUndoJoinParagraphs: break; case diUndoSplitParagraph: + { + ME_DisplayItem *prev_para = pdi->member.para.prev_para; + assert(pdi->member.para.pFmt->cbSize == sizeof(PARAFORMAT2)); pItem->member.para.pFmt = ALLOC_OBJ(PARAFORMAT2); pItem->member.para.pFmt->cbSize = sizeof(PARAFORMAT2); pItem->member.para.pFmt->dwMask = 0; - + *pItem->member.para.pFmt = *pdi->member.para.pFmt; + pItem->member.para.nFlags = prev_para->member.para.nFlags & ~MEPF_CELL; + pItem->member.para.pCell = NULL; break; + } default: assert(0 == "AddUndoItem, unsupported item type"); return NULL; @@ -283,8 +288,11 @@ static void ME_PlayUndoItem(ME_TextEditor *editor, ME_DisplayItem *pItem) case diUndoSetParagraphFormat: { ME_Cursor tmp; + ME_DisplayItem *para; ME_CursorFromCharOfs(editor, pItem->member.para.nCharOfs, &tmp); - ME_SetParaFormat(editor, ME_FindItemBack(tmp.pRun, diParagraph), pItem->member.para.pFmt); + para = ME_FindItemBack(tmp.pRun, diParagraph); + ME_AddUndoItem(editor, diUndoSetParagraphFormat, para); + *para->member.para.pFmt = *pItem->member.para.pFmt; break; } case diUndoSetCharFormat: @@ -292,11 +300,6 @@ static void ME_PlayUndoItem(ME_TextEditor *editor, ME_DisplayItem *pItem) ME_SetCharFormat(editor, pUItem->nStart, pUItem->nLen, &pItem->member.ustyle->fmt); break; } - case diUndoSetDefaultCharFormat: - { - ME_SetDefaultCharFormat(editor, &pItem->member.ustyle->fmt); - break; - } case diUndoInsertRun: { ME_InsertRun(editor, pItem->member.run.nCharOfs, pItem); @@ -304,7 +307,7 @@ static void ME_PlayUndoItem(ME_TextEditor *editor, ME_DisplayItem *pItem) } case diUndoDeleteRun: { - ME_InternalDeleteText(editor, pUItem->nStart, pUItem->nLen); + ME_InternalDeleteText(editor, pUItem->nStart, pUItem->nLen, TRUE); break; } case diUndoJoinParagraphs: @@ -312,22 +315,41 @@ static void ME_PlayUndoItem(ME_TextEditor *editor, ME_DisplayItem *pItem) ME_Cursor tmp; ME_CursorFromCharOfs(editor, pUItem->nStart, &tmp); /* the only thing that's needed is paragraph offset, so no need to split runs */ - ME_JoinParagraphs(editor, ME_GetParagraph(tmp.pRun)); + ME_JoinParagraphs(editor, ME_GetParagraph(tmp.pRun), TRUE); break; } case diUndoSplitParagraph: { ME_Cursor tmp; - ME_DisplayItem *new_para; + ME_DisplayItem *this_para, *new_para; + BOOL bFixRowStart; + int paraFlags = pItem->member.para.nFlags & (MEPF_ROWSTART|MEPF_CELL|MEPF_ROWEND); ME_CursorFromCharOfs(editor, pUItem->nStart, &tmp); if (tmp.nOffset) tmp.pRun = ME_SplitRunSimple(editor, tmp.pRun, tmp.nOffset); assert(pUItem->nCR >= 0); assert(pUItem->nLF >= 0); + this_para = ME_GetParagraph(tmp.pRun); + bFixRowStart = this_para->member.para.nFlags & MEPF_ROWSTART; + if (bFixRowStart) + { + /* Re-insert the paragraph before the table, making sure the nFlag value + * is correct. */ + this_para->member.para.nFlags &= ~MEPF_ROWSTART; + } new_para = ME_SplitParagraph(editor, tmp.pRun, tmp.pRun->member.run.style, - pUItem->nCR, pUItem->nLF); + pUItem->nCR, pUItem->nLF, paraFlags); + if (bFixRowStart) + new_para->member.para.nFlags |= MEPF_ROWSTART; assert(pItem->member.para.pFmt->cbSize == sizeof(PARAFORMAT2)); *new_para->member.para.pFmt = *pItem->member.para.pFmt; + if (pItem->member.para.pCell) + { + ME_DisplayItem *pItemCell, *pCell; + pItemCell = pItem->member.para.pCell; + pCell = new_para->member.para.pCell; + pCell->member.cell.nRightBoundary = pItemCell->member.cell.nRightBoundary; + } break; } default: @@ -365,6 +387,7 @@ BOOL ME_Undo(ME_TextEditor *editor) { if (p) p->prev = NULL; ME_AddUndoItem(editor, diUndoEndTransaction, NULL); + ME_CheckTablesForCorruption(editor); editor->nUndoStackSize--; editor->nUndoMode = nMode; ME_UpdateRepaint(editor); @@ -400,6 +423,7 @@ BOOL ME_Redo(ME_TextEditor *editor) { if (p) p->prev = NULL; ME_AddUndoItem(editor, diUndoEndTransaction, NULL); + ME_CheckTablesForCorruption(editor); editor->nUndoMode = nMode; ME_UpdateRepaint(editor); return TRUE; diff --git a/reactos/dll/win32/riched20/wrap.c b/reactos/dll/win32/riched20/wrap.c index adabea13803..a3c5d544ff6 100644 --- a/reactos/dll/win32/riched20/wrap.c +++ b/reactos/dll/win32/riched20/wrap.c @@ -42,17 +42,48 @@ static ME_DisplayItem *ME_MakeRow(int height, int baseline, int width) return item; } -static void ME_BeginRow(ME_WrapContext *wc) +static void ME_BeginRow(ME_WrapContext *wc, ME_DisplayItem *para) { + PARAFORMAT2 *pFmt; + assert(para && para->type == diParagraph); + pFmt = para->member.para.pFmt; wc->pRowStart = NULL; wc->bOverflown = FALSE; wc->pLastSplittableRun = NULL; - if (wc->context->editor->bWordWrap) - wc->nAvailWidth = wc->context->rcView.right - wc->context->rcView.left - - (wc->nRow ? wc->nLeftMargin : wc->nFirstMargin) - wc->nRightMargin; - else + if (para->member.para.nFlags & (MEPF_ROWSTART|MEPF_ROWEND)) { + wc->nAvailWidth = 0; + if (para->member.para.nFlags & MEPF_ROWEND) + { + ME_Cell *cell = &ME_FindItemBack(para, diCell)->member.cell; + cell->nWidth = 0; + } + } else if (para->member.para.pCell) { + ME_Cell *cell = ¶->member.para.pCell->member.cell; + int width; + + width = cell->nRightBoundary; + if (cell->prev_cell) + width -= cell->prev_cell->member.cell.nRightBoundary; + if (!cell->prev_cell) + { + int rowIndent = ME_GetTableRowEnd(para)->member.para.pFmt->dxStartIndent; + width -= rowIndent; + } + cell->nWidth = max(ME_twips2pointsX(wc->context, width), 0); + + wc->nAvailWidth = cell->nWidth + - (wc->nRow ? wc->nLeftMargin : wc->nFirstMargin) - wc->nRightMargin; + } else if (wc->context->editor->bWordWrap) { + wc->nAvailWidth = wc->context->rcView.right - wc->context->rcView.left + - (wc->nRow ? wc->nLeftMargin : wc->nFirstMargin) - wc->nRightMargin; + } else { wc->nAvailWidth = ~0u >> 1; - wc->pt.x = 0; + } + wc->pt.x = wc->context->pt.x; + if (wc->context->editor->bEmulateVersion10 && /* v1.0 - 3.0 */ + pFmt->dwMask & PFM_TABLE && pFmt->wEffects & PFE_TABLE) + /* Shift the text down because of the border. */ + wc->pt.y++; } static void ME_InsertRowStart(ME_WrapContext *wc, const ME_DisplayItem *pEnd) @@ -60,8 +91,10 @@ static void ME_InsertRowStart(ME_WrapContext *wc, const ME_DisplayItem *pEnd) ME_DisplayItem *p, *row, *para; BOOL bSkippingSpaces = TRUE; int ascent = 0, descent = 0, width=0, shift = 0, align = 0; + PARAFORMAT2 *pFmt; /* wrap text */ para = ME_GetParagraph(wc->pRowStart); + pFmt = para->member.para.pFmt; for (p = pEnd->prev; p!=wc->pRowStart->prev; p = p->prev) { @@ -100,7 +133,16 @@ static void ME_InsertRowStart(ME_WrapContext *wc, const ME_DisplayItem *pEnd) } row = ME_MakeRow(ascent+descent, ascent, width); - row->member.row.nYPos = wc->pt.y; + if (wc->context->editor->bEmulateVersion10 && /* v1.0 - 3.0 */ + pFmt->dwMask & PFM_TABLE && pFmt->wEffects & PFE_TABLE) + { + /* The text was shifted down in ME_BeginRow so move the wrap context + * back to where it should be. */ + wc->pt.y--; + /* The height of the row is increased by the borders. */ + row->member.row.nHeight += 2; + } + row->member.row.pt = wc->pt; row->member.row.nLMargin = (!wc->nRow ? wc->nFirstMargin : wc->nLeftMargin); row->member.row.nRMargin = wc->nRightMargin; assert(para->member.para.pFmt->dwMask & PFM_ALIGNMENT); @@ -117,14 +159,23 @@ static void ME_InsertRowStart(ME_WrapContext *wc, const ME_DisplayItem *pEnd) } ME_InsertBefore(wc->pRowStart, row); wc->nRow++; - wc->pt.y += ascent+descent; - ME_BeginRow(wc); + wc->pt.y += row->member.row.nHeight; + ME_BeginRow(wc, para); } static void ME_WrapEndParagraph(ME_WrapContext *wc, ME_DisplayItem *p) { + ME_DisplayItem *para = p->member.para.prev_para; + PARAFORMAT2 *pFmt = para->member.para.pFmt; if (wc->pRowStart) ME_InsertRowStart(wc, p); + if (wc->context->editor->bEmulateVersion10 && /* v1.0 - 3.0 */ + pFmt->dwMask & PFM_TABLE && pFmt->wEffects & PFE_TABLE) + { + /* ME_BeginRow was called an extra time for the paragraph, and it shifts the + * text down by one pixel for the border, so fix up the wrap context. */ + wc->pt.y--; + } /* p = p->member.para.prev_para->next; @@ -290,9 +341,13 @@ static ME_DisplayItem *ME_WrapHandleRun(ME_WrapContext *wc, ME_DisplayItem *p) if (wc->bOverflown) /* just skipping final whitespaces */ { - if (run->nFlags & (MERF_WHITESPACE|MERF_TAB)) { + /* End paragraph run can't overflow to the next line by itself. */ + if (run->nFlags & MERF_ENDPARA) + return p->next; + + if (run->nFlags & MERF_WHITESPACE) { p->member.run.nFlags |= MERF_SKIPPED; - /* wc->pt.x += run->nWidth; */ + wc->pt.x += run->nWidth; /* skip runs consisting of only whitespaces */ return p->next; } @@ -320,17 +375,11 @@ static ME_DisplayItem *ME_WrapHandleRun(ME_WrapContext *wc, ME_DisplayItem *p) ME_InsertRowStart(wc, p); return p; } - /* we're not at the end of the row */ - if (run->nFlags & MERF_TAB) { - /* force recomputation of tabs' size as it depends on position */ - ME_CalcRunExtent(wc->context, &ME_GetParagraph(p)->member.para, - wc->nRow ? wc->nLeftMargin : wc->nFirstMargin, run); - } /* will current run fit? */ - if (wc->pt.x + run->nWidth > wc->nAvailWidth) + if (wc->pt.x + run->nWidth > wc->context->pt.x + wc->nAvailWidth) { - int loc = wc->nAvailWidth - wc->pt.x; + int loc = wc->context->pt.x + wc->nAvailWidth - wc->pt.x; /* total white run ? */ if (run->nFlags & MERF_WHITESPACE) { /* let the overflow logic handle it */ @@ -340,7 +389,12 @@ static ME_DisplayItem *ME_WrapHandleRun(ME_WrapContext *wc, ME_DisplayItem *p) /* TAB: we can split before */ if (run->nFlags & MERF_TAB) { wc->bOverflown = TRUE; - return p; + if (wc->pRowStart == p) + /* Don't split before the start of the run, or we will get an + * endless loop. */ + return p->next; + else + return p; } /* graphics: we can split before, if run's width is smaller than row's width */ if ((run->nFlags & MERF_GRAPHICS) && run->nWidth <= wc->nAvailWidth) { @@ -360,8 +414,20 @@ static ME_DisplayItem *ME_WrapHandleRun(ME_WrapContext *wc, ME_DisplayItem *p) pp = ME_SplitByBacktracking(wc, p, loc); if (pp == wc->pRowStart) { - /* we had only spaces so far, entire content can be omitted */ - wc->pt.x = 0; + if (run->nFlags & MERF_STARTWHITE) + { + /* we had only spaces so far, so we must be on the first line of the + * paragraph, since no other lines of the paragraph start with spaces. */ + assert(!wc->nRow); + /* The lines will only contain spaces, and the rest of the run will + * overflow onto the next line. */ + wc->bOverflown = TRUE; + return p; + } + /* Couldn't split the first run, possible because we have a large font + * with a single character that caused an overflow. + */ + wc->pt.x += run->nWidth; return p->next; } if (p != pp) /* found a suitable split point */ @@ -392,46 +458,55 @@ static void ME_WrapTextParagraph(ME_Context *c, ME_DisplayItem *tp, DWORD begino ME_WrapContext wc; int border = 0; int linespace = 0; + PARAFORMAT2 *pFmt; assert(tp->type == diParagraph); if (!(tp->member.para.nFlags & MEPF_REWRAP)) { return; } ME_PrepareParagraphForWrapping(c, tp); + pFmt = tp->member.para.pFmt; wc.context = c; /* wc.para_style = tp->member.para.style; */ wc.style = NULL; - wc.nFirstMargin = ME_twips2pointsX(c, tp->member.para.pFmt->dxStartIndent) + beginofs; - wc.nLeftMargin = wc.nFirstMargin + ME_twips2pointsX(c, tp->member.para.pFmt->dxOffset); - wc.nRightMargin = ME_twips2pointsX(c, tp->member.para.pFmt->dxRightIndent); + if (tp->member.para.nFlags & MEPF_ROWEND) { + wc.nFirstMargin = wc.nLeftMargin = wc.nRightMargin = 0; + } else { + int dxStartIndent = pFmt->dxStartIndent; + if (tp->member.para.pCell) { + dxStartIndent += ME_GetTableRowEnd(tp)->member.para.pFmt->dxOffset; + } + wc.nFirstMargin = ME_twips2pointsX(c, dxStartIndent); + wc.nLeftMargin = wc.nFirstMargin + ME_twips2pointsX(c, pFmt->dxOffset); + wc.nRightMargin = ME_twips2pointsX(c, pFmt->dxRightIndent); + } + if (c->editor->bEmulateVersion10 && /* v1.0 - 3.0 */ + pFmt->dwMask & PFM_TABLE && pFmt->wEffects & PFE_TABLE) + { + wc.nFirstMargin += ME_twips2pointsX(c, pFmt->dxOffset * 2); + } wc.nRow = 0; - wc.pt.x = 0; wc.pt.y = 0; - if (tp->member.para.pFmt->dwMask & PFM_SPACEBEFORE) - wc.pt.y += ME_twips2pointsY(c, tp->member.para.pFmt->dySpaceBefore); - if (tp->member.para.pFmt->dwMask & PFM_BORDER) + if (pFmt->dwMask & PFM_SPACEBEFORE) + wc.pt.y += ME_twips2pointsY(c, pFmt->dySpaceBefore); + if (!(pFmt->dwMask & PFM_TABLE && pFmt->wEffects & PFE_TABLE) && + pFmt->dwMask & PFM_BORDER) { border = ME_GetParaBorderWidth(c->editor, tp->member.para.pFmt->wBorders); - if (tp->member.para.pFmt->wBorders & 1) { + if (pFmt->wBorders & 1) { wc.nFirstMargin += border; wc.nLeftMargin += border; } - if (tp->member.para.pFmt->wBorders & 2) + if (pFmt->wBorders & 2) wc.nRightMargin -= border; - if (tp->member.para.pFmt->wBorders & 4) + if (pFmt->wBorders & 4) wc.pt.y += border; } - if (c->editor->bWordWrap) - wc.nAvailWidth = c->rcView.right - c->rcView.left - wc.nFirstMargin - wc.nRightMargin; - else - wc.nAvailWidth = ~0u >> 1; - wc.pRowStart = NULL; - linespace = ME_GetParaLineSpace(c, &tp->member.para); - ME_BeginRow(&wc); + ME_BeginRow(&wc, tp); for (p = tp->next; p!=tp->member.para.next_para; ) { assert(p->type != diStartRow); if (p->type == diRun) { @@ -442,10 +517,11 @@ static void ME_WrapTextParagraph(ME_Context *c, ME_DisplayItem *tp, DWORD begino wc.pt.y += linespace; } ME_WrapEndParagraph(&wc, p); - if ((tp->member.para.pFmt->dwMask & PFM_BORDER) && (tp->member.para.pFmt->wBorders & 8)) + if (!(pFmt->dwMask & PFM_TABLE && pFmt->wEffects & PFE_TABLE) && + (pFmt->dwMask & PFM_BORDER) && (pFmt->wBorders & 8)) wc.pt.y += border; if (tp->member.para.pFmt->dwMask & PFM_SPACEAFTER) - wc.pt.y += ME_twips2pointsY(c, tp->member.para.pFmt->dySpaceAfter); + wc.pt.y += ME_twips2pointsY(c, pFmt->dySpaceAfter); tp->member.para.nFlags &= ~MEPF_REWRAP; tp->member.para.nHeight = wc.pt.y; @@ -500,17 +576,18 @@ BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor) { int yLastPos = 0; ME_InitContext(&c, editor, GetDC(editor->hWnd)); + c.pt.x = editor->selofs; editor->nHeight = 0; item = editor->pBuffer->pFirst->next; while(item != editor->pBuffer->pLast) { BOOL bRedraw = FALSE; assert(item->type == diParagraph); - editor->nHeight = max(editor->nHeight, item->member.para.nYPos); + editor->nHeight = max(editor->nHeight, item->member.para.pt.y); if ((item->member.para.nFlags & MEPF_REWRAP) - || (item->member.para.nYPos != c.pt.y)) + || (item->member.para.pt.y != c.pt.y)) bRedraw = TRUE; - item->member.para.nYPos = c.pt.y; + item->member.para.pt = c.pt; ME_WrapTextParagraph(&c, item, editor->selofs); @@ -523,24 +600,129 @@ BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor) { bModified = bModified | bRedraw; - yLastPos = c.pt.y; - c.pt.y += item->member.para.nHeight; + yLastPos = max(yLastPos, c.pt.y); + + if (item->member.para.nFlags & MEPF_ROWSTART) + { + ME_DisplayItem *cell = ME_FindItemFwd(item, diCell); + ME_DisplayItem *endRowPara; + int borderWidth = 0; + cell->member.cell.pt = c.pt; + /* Offset the text by the largest top border width. */ + while (cell->member.cell.next_cell) { + borderWidth = max(borderWidth, cell->member.cell.border.top.width); + cell = cell->member.cell.next_cell; + } + endRowPara = ME_FindItemFwd(cell, diParagraph); + assert(endRowPara->member.para.nFlags & MEPF_ROWEND); + if (borderWidth > 0) + { + borderWidth = max(ME_twips2pointsY(&c, borderWidth), 1); + while (cell) { + cell->member.cell.yTextOffset = borderWidth; + cell = cell->member.cell.prev_cell; + } + c.pt.y += borderWidth; + } + if (endRowPara->member.para.pFmt->dxStartIndent > 0) + { + int dxStartIndent = endRowPara->member.para.pFmt->dxStartIndent; + cell = ME_FindItemFwd(item, diCell); + cell->member.cell.pt.x += ME_twips2pointsX(&c, dxStartIndent); + c.pt.x = cell->member.cell.pt.x; + } + } + else if (item->member.para.nFlags & MEPF_ROWEND) + { + /* Set all the cells to the height of the largest cell */ + ME_DisplayItem *startRowPara; + int prevHeight, nHeight, bottomBorder = 0; + ME_DisplayItem *cell = ME_FindItemBack(item, diCell); + if (!(item->member.para.next_para->member.para.nFlags & MEPF_ROWSTART)) + { + /* Last row, the bottom border is added to the height. */ + cell = cell->member.cell.prev_cell; + while (cell) + { + bottomBorder = max(bottomBorder, cell->member.cell.border.bottom.width); + cell = cell->member.cell.prev_cell; + } + bottomBorder = ME_twips2pointsY(&c, bottomBorder); + cell = ME_FindItemBack(item, diCell); + } + prevHeight = cell->member.cell.nHeight; + nHeight = cell->member.cell.prev_cell->member.cell.nHeight + bottomBorder; + cell->member.cell.nHeight = nHeight; + item->member.para.nHeight = nHeight; + cell = cell->member.cell.prev_cell; + cell->member.cell.nHeight = nHeight; + while (cell->member.cell.prev_cell) + { + cell = cell->member.cell.prev_cell; + cell->member.cell.nHeight = nHeight; + } + /* Also set the height of the start row paragraph */ + startRowPara = ME_FindItemBack(cell, diParagraph); + startRowPara->member.para.nHeight = nHeight; + c.pt.x = startRowPara->member.para.pt.x; + c.pt.y = cell->member.cell.pt.y + nHeight; + if (prevHeight < nHeight) + { + /* The height of the cells has grown, so invalidate the bottom of + * the cells. */ + item->member.para.nFlags |= MEPF_REPAINT; + cell = ME_FindItemBack(item, diCell); + while (cell) { + ME_FindItemBack(cell, diParagraph)->member.para.nFlags |= MEPF_REPAINT; + cell = cell->member.cell.prev_cell; + } + } + } + else if (item->member.para.pCell && + item->member.para.pCell != item->member.para.next_para->member.para.pCell) + { + /* The next paragraph is in the next cell in the table row. */ + ME_Cell *cell = &item->member.para.pCell->member.cell; + cell->nHeight = c.pt.y + item->member.para.nHeight - cell->pt.y; + + /* Propagate the largest height to the end so that it can be easily + * sent back to all the cells at the end of the row. */ + if (cell->prev_cell) + cell->nHeight = max(cell->nHeight, cell->prev_cell->member.cell.nHeight); + + c.pt.x = cell->pt.x + cell->nWidth; + c.pt.y = cell->pt.y; + cell->next_cell->member.cell.pt = c.pt; + c.pt.y += cell->yTextOffset; + } + else + { + if (item->member.para.pCell) { + /* Next paragraph in the same cell. */ + c.pt.x = item->member.para.pCell->member.cell.pt.x; + } else { + /* Normal paragraph */ + c.pt.x = editor->selofs; + } + c.pt.y += item->member.para.nHeight; + } item = item->member.para.next_para; } editor->sizeWindow.cx = c.rcView.right-c.rcView.left; editor->sizeWindow.cy = c.rcView.bottom-c.rcView.top; editor->nTotalLength = c.pt.y; - editor->pBuffer->pLast->member.para.nYPos = yLastPos; + editor->pBuffer->pLast->member.para.pt.x = 0; + editor->pBuffer->pLast->member.para.pt.y = yLastPos; ME_DestroyContext(&c, editor->hWnd); /* Each paragraph may contain multiple rows, which should be scrollable, even - if the containing paragraph has nYPos == 0 */ + if the containing paragraph has pt.y == 0 */ item = editor->pBuffer->pFirst; while ((item = ME_FindItemFwd(item, diStartRow)) != NULL) { assert(item->type == diStartRow); - editor->nHeight = max(editor->nHeight, item->member.row.nYPos); + editor->nHeight = max(editor->nHeight, item->member.row.pt.y); } if (bModified || editor->nTotalLength < editor->nLastTotalLength) @@ -560,8 +742,8 @@ void ME_InvalidateMarkedParagraphs(ME_TextEditor *editor) { ME_DisplayItem *item = editor->pBuffer->pFirst; while(item != editor->pBuffer->pLast) { if (item->member.para.nFlags & MEPF_REPAINT) { - rc.top = item->member.para.nYPos - ofs; - rc.bottom = item->member.para.nYPos + item->member.para.nHeight - ofs; + rc.top = item->member.para.pt.y - ofs; + rc.bottom = item->member.para.pt.y + item->member.para.nHeight - ofs; InvalidateRect(editor->hWnd, &rc, TRUE); } item = item->member.para.next_para; diff --git a/reactos/dll/win32/riched20/writer.c b/reactos/dll/win32/riched20/writer.c index ce9e8537d7f..912cae3f48e 100644 --- a/reactos/dll/win32/riched20/writer.c +++ b/reactos/dll/win32/riched20/writer.c @@ -41,6 +41,7 @@ ME_StreamOutInit(ME_TextEditor *editor, EDITSTREAM *stream) pStream->written = 0; pStream->nFontTblLen = 0; pStream->nColorTblLen = 1; + pStream->nNestingLevel = 0; return pStream; } @@ -283,35 +284,64 @@ ME_StreamOutRTFFontAndColorTbl(ME_OutStream *pStream, ME_DisplayItem *pFirstRun, return TRUE; } +static BOOL +ME_StreamOutRTFTableProps(ME_TextEditor *editor, ME_OutStream *pStream, + const ME_DisplayItem *para) +{ + ME_DisplayItem *cell; + char props[STREAMOUT_BUFFER_SIZE] = ""; + + if (!ME_StreamOutPrint(pStream, "\\trowd")) + return FALSE; + if (!editor->bEmulateVersion10) { /* v4.1 */ + assert(para->member.para.nFlags & MEPF_ROWSTART); + cell = para->member.para.next_para->member.para.pCell; + assert(cell); + do { + sprintf(props + strlen(props), "\\cellx%d", cell->member.cell.nRightBoundary); + cell = cell->member.cell.next_cell; + } while (cell->member.cell.next_cell); + } else { /* v1.0 - 3.0 */ + PARAFORMAT2 *pFmt = para->member.para.pFmt; + int i; + + assert(!(para->member.para.nFlags & (MEPF_ROWSTART|MEPF_ROWEND|MEPF_CELL))); + if (pFmt->dxOffset) + sprintf(props + strlen(props), "\\trgaph%d", pFmt->dxOffset); + if (pFmt->dxStartIndent) + sprintf(props + strlen(props), "\\trleft%d", pFmt->dxStartIndent); + for (i = 0; i < pFmt->cTabCount; i++) + { + sprintf(props + strlen(props), "\\cellx%d", pFmt->rgxTabs[i] & 0x00FFFFFF); + } + } + if (!ME_StreamOutPrint(pStream, props)) + return FALSE; + props[0] = '\0'; + return TRUE; +} static BOOL -ME_StreamOutRTFParaProps(ME_OutStream *pStream, const ME_DisplayItem *para) +ME_StreamOutRTFParaProps(ME_TextEditor *editor, ME_OutStream *pStream, + const ME_DisplayItem *para) { PARAFORMAT2 *fmt = para->member.para.pFmt; char props[STREAMOUT_BUFFER_SIZE] = ""; int i; - - if (para->member.para.pCells) - { - ME_TableCell *cell = para->member.para.pCells; - - if (!ME_StreamOutPrint(pStream, "\\trowd")) - return FALSE; - do { - sprintf(props, "\\cellx%d", cell->nRightBoundary); - if (!ME_StreamOutPrint(pStream, props)) - return FALSE; - cell = cell->next; - } while (cell); - props[0] = '\0'; - } /* TODO: Don't emit anything if the last PARAFORMAT2 is inherited */ if (!ME_StreamOutPrint(pStream, "\\pard")) return FALSE; - if (para->member.para.bTable) - strcat(props, "\\intbl"); + if (!editor->bEmulateVersion10) { /* v4.1 */ + if (pStream->nNestingLevel > 0) + strcat(props, "\\intbl"); + if (pStream->nNestingLevel > 1) + sprintf(props + strlen(props), "\\itap%d", pStream->nNestingLevel); + } else { /* v1.0 - 3.0 */ + if (fmt->dwMask & PFM_TABLE && fmt->wEffects & PFE_TABLE) + strcat(props, "\\intbl"); + } /* TODO: PFM_BORDER. M$ does not emit any keywords for these properties, and * when streaming border keywords in, PFM_BORDER is set, but wBorder field is @@ -376,46 +406,46 @@ ME_StreamOutRTFParaProps(ME_OutStream *pStream, const ME_DisplayItem *para) strcat(props, "\\rtlpar"); if (fmt->dwMask & PFM_SIDEBYSIDE && fmt->wEffects & PFE_SIDEBYSIDE) strcat(props, "\\sbys"); - if (fmt->dwMask & PFM_TABLE && fmt->dwMask & PFE_TABLE) - strcat(props, "\\intbl"); - if (fmt->dwMask & PFM_OFFSET) - sprintf(props + strlen(props), "\\li%d", fmt->dxOffset); - if (fmt->dwMask & PFM_OFFSETINDENT || fmt->dwMask & PFM_STARTINDENT) - sprintf(props + strlen(props), "\\fi%d", fmt->dxStartIndent); - if (fmt->dwMask & PFM_RIGHTINDENT) - sprintf(props + strlen(props), "\\ri%d", fmt->dxRightIndent); + if (!(editor->bEmulateVersion10 && /* v1.0 - 3.0 */ + fmt->dwMask & PFM_TABLE && fmt->wEffects & PFE_TABLE)) + { + if (fmt->dwMask & PFM_OFFSET) + sprintf(props + strlen(props), "\\li%d", fmt->dxOffset); + if (fmt->dwMask & PFM_OFFSETINDENT || fmt->dwMask & PFM_STARTINDENT) + sprintf(props + strlen(props), "\\fi%d", fmt->dxStartIndent); + if (fmt->dwMask & PFM_RIGHTINDENT) + sprintf(props + strlen(props), "\\ri%d", fmt->dxRightIndent); + if (fmt->dwMask & PFM_TABSTOPS) { + static const char * const leader[6] = { "", "\\tldot", "\\tlhyph", "\\tlul", "\\tlth", "\\tleq" }; + + for (i = 0; i < fmt->cTabCount; i++) { + switch ((fmt->rgxTabs[i] >> 24) & 0xF) { + case 1: + strcat(props, "\\tqc"); + break; + case 2: + strcat(props, "\\tqr"); + break; + case 3: + strcat(props, "\\tqdec"); + break; + case 4: + /* Word bar tab (vertical bar). Handled below */ + break; + } + if (fmt->rgxTabs[i] >> 28 <= 5) + strcat(props, leader[fmt->rgxTabs[i] >> 28]); + sprintf(props+strlen(props), "\\tx%d", fmt->rgxTabs[i]&0x00FFFFFF); + } + } + } if (fmt->dwMask & PFM_SPACEAFTER) sprintf(props + strlen(props), "\\sa%d", fmt->dySpaceAfter); if (fmt->dwMask & PFM_SPACEBEFORE) sprintf(props + strlen(props), "\\sb%d", fmt->dySpaceBefore); if (fmt->dwMask & PFM_STYLE) sprintf(props + strlen(props), "\\s%d", fmt->sStyle); - - if (fmt->dwMask & PFM_TABSTOPS) { - static const char * const leader[6] = { "", "\\tldot", "\\tlhyph", "\\tlul", "\\tlth", "\\tleq" }; - - for (i = 0; i < fmt->cTabCount; i++) { - switch ((fmt->rgxTabs[i] >> 24) & 0xF) { - case 1: - strcat(props, "\\tqc"); - break; - case 2: - strcat(props, "\\tqr"); - break; - case 3: - strcat(props, "\\tqdec"); - break; - case 4: - /* Word bar tab (vertical bar). Handled below */ - break; - } - if (fmt->rgxTabs[i] >> 28 <= 5) - strcat(props, leader[fmt->rgxTabs[i] >> 28]); - sprintf(props+strlen(props), "\\tx%d", fmt->rgxTabs[i]&0x00FFFFFF); - } - } - if (fmt->dwMask & PFM_SHADING) { static const char * const style[16] = { "", "\\bgdkhoriz", "\\bgdkvert", "\\bgdkfdiag", @@ -680,7 +710,7 @@ ME_StreamOutRTF(ME_TextEditor *editor, ME_OutStream *pStream, int nStart, int nC /* TODO: section formatting properties */ - if (!ME_StreamOutRTFParaProps(pStream, ME_GetParagraph(p))) + if (!ME_StreamOutRTFParaProps(editor, pStream, ME_GetParagraph(p))) return FALSE; while(1) @@ -688,8 +718,39 @@ ME_StreamOutRTF(ME_TextEditor *editor, ME_OutStream *pStream, int nStart, int nC switch(p->type) { case diParagraph: - if (!ME_StreamOutRTFParaProps(pStream, p)) - return FALSE; + if (!editor->bEmulateVersion10) { /* v4.1 */ + if (p->member.para.nFlags & MEPF_ROWSTART) { + pStream->nNestingLevel++; + if (pStream->nNestingLevel == 1) { + if (!ME_StreamOutRTFTableProps(editor, pStream, p)) + return FALSE; + } + } else if (p->member.para.nFlags & MEPF_ROWEND) { + pStream->nNestingLevel--; + if (pStream->nNestingLevel > 1) { + if (!ME_StreamOutPrint(pStream, "{\\*\\nesttableprops")) + return FALSE; + if (!ME_StreamOutRTFTableProps(editor, pStream, p)) + return FALSE; + if (!ME_StreamOutPrint(pStream, "\\nestrow}{\\nonesttables\\par}\r\n")) + return FALSE; + } else { + if (!ME_StreamOutPrint(pStream, "\\row \r\n")) + return FALSE; + } + } else if (!ME_StreamOutRTFParaProps(editor, pStream, p)) { + return FALSE; + } + } else { /* v1.0 - 3.0 */ + if (p->member.para.pFmt->dwMask & PFM_TABLE && + p->member.para.pFmt->wEffects & PFE_TABLE) + { + if (!ME_StreamOutRTFTableProps(editor, pStream, p)) + return FALSE; + } + if (!ME_StreamOutRTFParaProps(editor, pStream, p)) + return FALSE; + } pPara = p; break; case diRun: @@ -697,14 +758,35 @@ ME_StreamOutRTF(ME_TextEditor *editor, ME_OutStream *pStream, int nStart, int nC break; TRACE("flags %xh\n", p->member.run.nFlags); /* TODO: emit embedded objects */ - if (p->member.run.nFlags & MERF_GRAPHICS) + if (pPara->member.para.nFlags & (MEPF_ROWSTART|MEPF_ROWEND)) + break; + if (p->member.run.nFlags & MERF_GRAPHICS) { FIXME("embedded objects are not handled\n"); - if (p->member.run.nFlags & MERF_CELL) { - if (!ME_StreamOutPrint(pStream, "\\cell ")) - return FALSE; + } else if (p->member.run.nFlags & MERF_TAB) { + if (editor->bEmulateVersion10 && /* v1.0 - 3.0 */ + pPara->member.para.pFmt->dwMask & PFM_TABLE && + pPara->member.para.pFmt->wEffects & PFE_TABLE) + { + if (!ME_StreamOutPrint(pStream, "\\cell ")) + return FALSE; + } else { + if (!ME_StreamOutPrint(pStream, "\\tab ")) + return FALSE; + } + } else if (p->member.run.nFlags & MERF_ENDCELL) { + if (pStream->nNestingLevel > 1) { + if (!ME_StreamOutPrint(pStream, "\\nestcell ")) + return FALSE; + } else { + if (!ME_StreamOutPrint(pStream, "\\cell ")) + return FALSE; + } nChars--; } else if (p->member.run.nFlags & MERF_ENDPARA) { - if (pPara->member.para.bTable) { + if (pPara->member.para.pFmt->dwMask & PFM_TABLE && + pPara->member.para.pFmt->wEffects & PFE_TABLE && + !(pPara->member.para.nFlags & (MEPF_ROWSTART|MEPF_ROWEND|MEPF_CELL))) + { if (!ME_StreamOutPrint(pStream, "\\row \r\n")) return FALSE; } else { diff --git a/reactos/dll/win32/sfc/precomp.h b/reactos/dll/win32/sfc/precomp.h new file mode 100644 index 00000000000..2801b0ffdbd --- /dev/null +++ b/reactos/dll/win32/sfc/precomp.h @@ -0,0 +1,14 @@ +#ifndef _PRECOMP_H__ +#define _PRECOMP_H__ + +#include +#include +#include + +DWORD WINAPI sfc_8(); +DWORD WINAPI sfc_9(); + +typedef BOOL (WINAPI *PSRSRPA)(PRESTOREPOINTINFOA, PSTATEMGRSTATUS); +typedef BOOL (WINAPI *PSRSRPW)(PRESTOREPOINTINFOW, PSTATEMGRSTATUS); + +#endif diff --git a/reactos/dll/win32/sfc/sfc.c b/reactos/dll/win32/sfc/sfc.c new file mode 100644 index 00000000000..ed180e199d2 --- /dev/null +++ b/reactos/dll/win32/sfc/sfc.c @@ -0,0 +1,130 @@ +/* + * System File Checker (Windows File Protection) + * + * Copyright 2008 Pierre Schweitzer + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "precomp.h" + +HINSTANCE hLibModule; + +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) +{ + switch (fdwReason) + { + case DLL_PROCESS_ATTACH: + { + DisableThreadLibraryCalls(hinstDLL); + hLibModule = hinstDLL; + break; + } + case DLL_PROCESS_DETACH: + { + break; + } + } + + return TRUE; +} + +DWORD WINAPI sfc_8() +{ + return ERROR_CALL_NOT_IMPLEMENTED; +} + +DWORD WINAPI sfc_9() +{ + return ERROR_CALL_NOT_IMPLEMENTED; +} + +BOOL WINAPI SRSetRestorePointA(PRESTOREPOINTINFOA pRestorePtSpec, PSTATEMGRSTATUS pSMgrStatus) +{ + HMODULE hModule; + PSRSRPA pSRSRPA; + BOOL bStatus = FALSE; + LPCWSTR lpLibFileName = L"srclient.dll"; + LPCSTR lpProcName = "SRSetRestorePointA"; + + hModule = LoadLibraryW(lpLibFileName); + if (hModule) + { + pSRSRPA = (PSRSRPA)GetProcAddress(hModule, lpProcName); + if (pSRSRPA) + { + bStatus = pSRSRPA(pRestorePtSpec, pSMgrStatus); + } + else + { + if (pSMgrStatus) + { + pSMgrStatus->nStatus = ERROR_CALL_NOT_IMPLEMENTED; + } + } + FreeLibrary(hModule); + } + else + { + if (pSMgrStatus) + { + pSMgrStatus->nStatus = ERROR_CALL_NOT_IMPLEMENTED; + } + } + + return bStatus; +} + +BOOL WINAPI SRSetRestorePointW(PRESTOREPOINTINFOW pRestorePtSpec, PSTATEMGRSTATUS pSMgrStatus) +{ + HMODULE hModule; + PSRSRPW pSRSRPW; + BOOL bStatus = FALSE; + LPCWSTR lpLibFileName = L"srclient.dll"; + LPCSTR lpProcName = "SRSetRestorePointW"; + + hModule = LoadLibraryW(lpLibFileName); + if (hModule) + { + pSRSRPW = (PSRSRPW)GetProcAddress(hModule, lpProcName); + if (pSRSRPW) + { + bStatus = pSRSRPW(pRestorePtSpec, pSMgrStatus); + } + else + { + if (pSMgrStatus) + { + pSMgrStatus->nStatus = ERROR_CALL_NOT_IMPLEMENTED; + } + } + FreeLibrary(hModule); + } + else + { + if (pSMgrStatus) + { + pSMgrStatus->nStatus = ERROR_CALL_NOT_IMPLEMENTED; + } + } + + return bStatus; +} + +BOOL WINAPI SfpVerifyFile(LPCSTR pszFileName, LPSTR pszError, DWORD dwErrSize) +{ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} diff --git a/reactos/dll/win32/sfc/sfc.rbuild b/reactos/dll/win32/sfc/sfc.rbuild new file mode 100644 index 00000000000..d3ad6561cb4 --- /dev/null +++ b/reactos/dll/win32/sfc/sfc.rbuild @@ -0,0 +1,8 @@ + + + . + kernel32 + sfc.c + sfc.spec + precomp.h + diff --git a/reactos/dll/win32/sfc/sfc.spec b/reactos/dll/win32/sfc/sfc.spec new file mode 100644 index 00000000000..4fa278bcda3 --- /dev/null +++ b/reactos/dll/win32/sfc/sfc.spec @@ -0,0 +1,17 @@ +@ stub sfc_1 +@ stub sfc_2 +@ stub sfc_3 +@ stub sfc_4 +@ stub sfc_5 +@ stub sfc_6 +@ stub sfc_7 +@ stdcall sfc_8 () +@ stdcall sfc_9 () +@ stdcall SRSetRestorePoint (ptr ptr) SRSetRestorePointA +@ stdcall SRSetRestorePointA (ptr ptr) +@ stdcall SRSetRestorePointW (ptr ptr) +@ stdcall SfcGetNextProtectedFile (ptr ptr) sfc_os.SfcGetNextProtectedFile +@ stdcall SfcIsFileProtected (ptr wstr) sfc_os.SfcIsFileProtected +@ stub SfcWLEventLogoff +@ stub SfcWLEventLogon +@ stdcall SfpVerifyFile (str str long) \ No newline at end of file diff --git a/reactos/dll/win32/sfc_os/precomp.h b/reactos/dll/win32/sfc_os/precomp.h new file mode 100644 index 00000000000..3a0b5e06545 --- /dev/null +++ b/reactos/dll/win32/sfc_os/precomp.h @@ -0,0 +1,6 @@ +#ifndef _PRECOMP_H__ +#define _PRECOMP_H__ + +#include + +#endif diff --git a/reactos/dll/win32/sfc_os/sfc_os.c b/reactos/dll/win32/sfc_os/sfc_os.c new file mode 100644 index 00000000000..f51d7f146f7 --- /dev/null +++ b/reactos/dll/win32/sfc_os/sfc_os.c @@ -0,0 +1,42 @@ +/* + * System File Checker (Windows File Protection) + * + * Copyright 2008 Pierre Schweitzer + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "precomp.h" + +HINSTANCE hLibModule; + +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) +{ + switch (fdwReason) + { + case DLL_PROCESS_ATTACH: + { + DisableThreadLibraryCalls(hinstDLL); + hLibModule = hinstDLL; + break; + } + case DLL_PROCESS_DETACH: + { + break; + } + } + + return TRUE; +} diff --git a/reactos/dll/win32/sfc_os/sfc_os.rbuild b/reactos/dll/win32/sfc_os/sfc_os.rbuild new file mode 100644 index 00000000000..2e02263c20e --- /dev/null +++ b/reactos/dll/win32/sfc_os/sfc_os.rbuild @@ -0,0 +1,8 @@ + + + . + kernel32 + sfc_os.c + sfc_os.spec + precomp.h + diff --git a/reactos/dll/win32/sfc_os/sfc_os.spec b/reactos/dll/win32/sfc_os/sfc_os.spec new file mode 100644 index 00000000000..7506386f2b5 --- /dev/null +++ b/reactos/dll/win32/sfc_os/sfc_os.spec @@ -0,0 +1,11 @@ +@ stub sfc_os_1 +@ stub sfc_os_2 +@ stub sfc_os_3 +@ stub sfc_os_4 +@ stub sfc_os_5 +@ stub sfc_os_6 +@ stub sfc_os_7 +@ stub SfcGetNextProtectedFile +@ stub SfcIsFileProtected +@ stub SfcWLEventLogoff +@ stub SfcWLEventLogon \ No newline at end of file diff --git a/reactos/dll/win32/shell32/autocomplete.c b/reactos/dll/win32/shell32/autocomplete.c index 71cfffb8e5f..a0ace20c051 100644 --- a/reactos/dll/win32/shell32/autocomplete.c +++ b/reactos/dll/win32/shell32/autocomplete.c @@ -33,29 +33,9 @@ - implement ACO_RTLREADING style */ -#include "config.h" -#include -#include -#include -#include -#define COBJMACROS +#include -#include "wine/debug.h" -#include "windef.h" -#include "winbase.h" -#include "winreg.h" -#include "undocshell.h" -#include "shlwapi.h" -#include "winerror.h" -#include "objbase.h" - -#include "pidl.h" -#include "shlobj.h" -#include "shldisp.h" -#include "debughlp.h" - -#include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(shell); @@ -78,7 +58,7 @@ typedef struct static const IAutoCompleteVtbl acvt; static const IAutoComplete2Vtbl ac2vt; -static inline IAutoCompleteImpl *impl_from_IAutoComplete2( IAutoComplete2 *iface ) +static IAutoCompleteImpl * impl_from_IAutoComplete2( IAutoComplete2 *iface ) { return (IAutoCompleteImpl *)((char*)iface - FIELD_OFFSET(IAutoCompleteImpl, lpvtblAutoComplete2)); } @@ -281,8 +261,8 @@ static HRESULT WINAPI IAutoComplete_fnInit( LONG len; /* pwszRegKeyPath contains the key as well as the value, so we split */ - key = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (lstrlenW(pwzsRegKeyPath)+1)*sizeof(WCHAR)); - strcpyW(key, pwzsRegKeyPath); + key = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (wcslen(pwzsRegKeyPath)+1)*sizeof(WCHAR)); + wcscpy(key, pwzsRegKeyPath); value = strrchrW(key, '\\'); *value = 0; value++; @@ -296,7 +276,7 @@ static HRESULT WINAPI IAutoComplete_fnInit( res = RegQueryValueW(hKey, value, result, &len); if (res == ERROR_SUCCESS) { This->quickComplete = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len*sizeof(WCHAR)); - strcpyW(This->quickComplete, result); + wcscpy(This->quickComplete, result); } RegCloseKey(hKey); } @@ -304,8 +284,8 @@ static HRESULT WINAPI IAutoComplete_fnInit( } if ((pwszQuickComplete) && (!This->quickComplete)) { - This->quickComplete = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (lstrlenW(pwszQuickComplete)+1)*sizeof(WCHAR)); - lstrcpyW(This->quickComplete, pwszQuickComplete); + This->quickComplete = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (wcslen(pwszQuickComplete)+1)*sizeof(WCHAR)); + wcscpy(This->quickComplete, pwszQuickComplete); } return S_OK; @@ -484,8 +464,8 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, control = GetKeyState(VK_CONTROL) & 0x8000; if (control && This->quickComplete) { hwndQCText = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - (lstrlenW(This->quickComplete)+lstrlenW(hwndText))*sizeof(WCHAR)); - sel = sprintfW(hwndQCText, This->quickComplete, hwndText); + (wcslen(This->quickComplete)+wcslen(hwndText))*sizeof(WCHAR)); + sel = swprintf(hwndQCText, This->quickComplete, hwndText); SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)hwndQCText); SendMessageW(hwnd, EM_SETSEL, 0, sel); HeapFree(GetProcessHeap(), 0, hwndQCText); @@ -529,11 +509,11 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, msg = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len+1)*sizeof(WCHAR)); SendMessageW(This->hwndListBox, LB_GETTEXT, sel, (LPARAM)msg); SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)msg); - SendMessageW(hwnd, EM_SETSEL, lstrlenW(msg), lstrlenW(msg)); + SendMessageW(hwnd, EM_SETSEL, wcslen(msg), wcslen(msg)); HeapFree(GetProcessHeap(), 0, msg); } else { SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)This->txtbackup); - SendMessageW(hwnd, EM_SETSEL, lstrlenW(This->txtbackup), lstrlenW(This->txtbackup)); + SendMessageW(hwnd, EM_SETSEL, wcslen(This->txtbackup), wcslen(This->txtbackup)); } } return 0; @@ -564,8 +544,8 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, HeapFree(GetProcessHeap(), 0, This->txtbackup); This->txtbackup = HeapAlloc(GetProcessHeap(), - HEAP_ZERO_MEMORY, (lstrlenW(hwndText)+1)*sizeof(WCHAR)); - lstrcpyW(This->txtbackup, hwndText); + HEAP_ZERO_MEMORY, (wcslen(hwndText)+1)*sizeof(WCHAR)); + wcscpy(This->txtbackup, hwndText); /* Returns if there is no text to search and we doesn't want to display all the entries */ if ((!displayall) && (! *hwndText) ) @@ -582,7 +562,7 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, if (This->options & ACO_AUTOAPPEND) { SetWindowTextW(hwnd, strs); - SendMessageW(hwnd, EM_SETSEL, lstrlenW(hwndText), lstrlenW(strs)); + SendMessageW(hwnd, EM_SETSEL, wcslen(hwndText), wcslen(strs)); break; } @@ -638,7 +618,7 @@ static LRESULT APIENTRY ACLBoxSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, msg = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len+1)*sizeof(WCHAR)); SendMessageW(hwnd, LB_GETTEXT, sel, (LPARAM)msg); SendMessageW(This->hwndEdit, WM_SETTEXT, 0, (LPARAM)msg); - SendMessageW(This->hwndEdit, EM_SETSEL, 0, lstrlenW(msg)); + SendMessageW(This->hwndEdit, EM_SETSEL, 0, wcslen(msg)); ShowWindow(hwnd, SW_HIDE); HeapFree(GetProcessHeap(), 0, msg); break; diff --git a/reactos/dll/win32/shell32/brsfolder.c b/reactos/dll/win32/shell32/brsfolder.c index 8d5ff4ecd4d..0179706b4ca 100644 --- a/reactos/dll/win32/shell32/brsfolder.c +++ b/reactos/dll/win32/shell32/brsfolder.c @@ -23,19 +23,8 @@ * - implement new dialog style resizing */ -#include -#include +#include -#define COBJMACROS -#define NONAMELESSUNION -#define NONAMELESSSTRUCT - -#include "wine/debug.h" -#include "undocshell.h" -#include "pidl.h" -#include "shell32_main.h" -#include "shellapi.h" -#include "shresdef.h" WINE_DEFAULT_DEBUG_CHANNEL(shell); @@ -74,7 +63,7 @@ static const WCHAR szBrowseFolderInfo[] = { 'I','N','F','O',0 }; -static inline DWORD BrowseFlagsToSHCONTF(UINT ulFlags) +static DWORD __inline BrowseFlagsToSHCONTF(UINT ulFlags) { return SHCONTF_FOLDERS | (ulFlags & BIF_BROWSEINCLUDEFILES ? SHCONTF_NONFOLDERS : 0); } @@ -290,7 +279,7 @@ static HTREEITEM InsertTreeViewItem( browse_info *info, IShellFolder * lpsf, tvins.hInsertAfter = NULL; tvins.hParent = hParent; - return (HTREEITEM)TreeView_InsertItemW( info->hwndTreeView, &tvins ); + return (HTREEITEM)SendMessageW(info->hwndTreeView, TVM_INSERTITEM, 0, (LPARAM)&tvins ); } /****************************************************************************** @@ -361,7 +350,7 @@ done: SHFree(pidlTemp); } -static inline BOOL PIDLIsType(LPCITEMIDLIST pidl, PIDLTYPE type) +static BOOL __inline PIDLIsType(LPCITEMIDLIST pidl, PIDLTYPE type) { LPPIDLDATA data = _ILGetDataPointer(pidl); if (!data) diff --git a/reactos/dll/win32/shell32/changenotify.c b/reactos/dll/win32/shell32/changenotify.c index 2bddd6ffb67..f394fc12295 100644 --- a/reactos/dll/win32/shell32/changenotify.c +++ b/reactos/dll/win32/shell32/changenotify.c @@ -18,15 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -#include +#include -#define NONAMELESSUNION -#define NONAMELESSSTRUCT -#include "windef.h" -#include "winbase.h" -#include "wine/debug.h" -#include "shell32_main.h" WINE_DEFAULT_DEBUG_CHANNEL(shell); @@ -192,7 +185,7 @@ SHChangeNotifyRegister( LONG wEventMask, UINT uMsg, int cItems, - SHChangeNotifyEntry *lpItems) + const SHChangeNotifyEntry *lpItems) { LPNOTIFICATIONLIST item; int i; @@ -315,8 +308,8 @@ void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID switch (typeFlag) { case SHCNF_PATHA: - if (dwItem1) Pidls[0] = SHSimpleIDListFromPathA((LPCSTR)dwItem1); - if (dwItem2) Pidls[1] = SHSimpleIDListFromPathA((LPCSTR)dwItem2); + if (dwItem1) Pidls[0] = SHSimpleIDListFromPathA((LPCSTR)dwItem1); //FIXME + if (dwItem2) Pidls[1] = SHSimpleIDListFromPathA((LPCSTR)dwItem2); //FIXME break; case SHCNF_PATHW: if (dwItem1) Pidls[0] = SHSimpleIDListFromPathW((LPCWSTR)dwItem1); diff --git a/reactos/dll/win32/shell32/classes.c b/reactos/dll/win32/shell32/classes.c index 9b85d4efa2e..0b498aba86b 100644 --- a/reactos/dll/win32/shell32/classes.c +++ b/reactos/dll/win32/shell32/classes.c @@ -19,31 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - -#include -#include -#include -#include - -#define COBJMACROS - -#include "wine/debug.h" -#include "winerror.h" -#include "windef.h" -#include "winbase.h" -#include "winreg.h" -#include "wingdi.h" -#include "winuser.h" - -#include "shlobj.h" -#include "shell32_main.h" -#include "shlguid.h" -#include "shresdef.h" -#include "shlwapi.h" -#include "pidl.h" -#include "wine/unicode.h" +#include WINE_DEFAULT_DEBUG_CHANNEL(shell); @@ -133,7 +109,7 @@ BOOL HCR_GetDefaultVerbW( HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD l LONG size; HKEY hkey; - TRACE("%p %s %p\n", hkeyClass, debugstr_w(szVerb), szDest); + TRACE("%p %s %p\n", hkeyClass, debugstr_w(szVerb), szDest); if (szVerb) { @@ -143,13 +119,13 @@ BOOL HCR_GetDefaultVerbW( HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD l size=len; *szDest='\0'; - if (!RegQueryValueW(hkeyClass, swShell, szDest, &size) && *szDest) + if (!RegQueryValueW(hkeyClass, L"shell", szDest, &size) && *szDest) { /* The MSDN says to first try the default verb */ - lstrcpyW(sTemp, swShell); - lstrcatW(sTemp, szDest); - lstrcatW(sTemp, swCommand); - if (!RegOpenKeyExW(hkeyClass, sTemp, 0, 0, &hkey)) + wcscpy(sTemp, swShell); + wcscat(sTemp, szDest); + wcscat(sTemp, swCommand); + if (!RegOpenKeyExW(hkeyClass, sTemp, 0, KEY_READ, &hkey)) { RegCloseKey(hkey); TRACE("default verb=%s\n", debugstr_w(szDest)); @@ -158,10 +134,10 @@ BOOL HCR_GetDefaultVerbW( HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD l } /* then fallback to 'open' */ - lstrcpyW(sTemp, swShell); - lstrcatW(sTemp, swOpen); - lstrcatW(sTemp, swCommand); - if (!RegOpenKeyExW(hkeyClass, sTemp, 0, 0, &hkey)) + wcscpy(sTemp, swShell); + wcscat(sTemp, swOpen); + wcscat(sTemp, swCommand); + if (!RegOpenKeyExW(hkeyClass, sTemp, 0, KEY_READ, &hkey)) { RegCloseKey(hkey); lstrcpynW(szDest, swOpen, len); @@ -170,14 +146,20 @@ BOOL HCR_GetDefaultVerbW( HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD l } /* and then just use the first verb on Windows >= 2000 */ - if (!RegEnumKeyW(hkeyClass, 0, szDest, len) && *szDest) + if (!RegOpenKeyExW(hkeyClass, L"shell", 0, KEY_READ, &hkey)) { - TRACE("default verb=first verb=%s\n", debugstr_w(szDest)); - return TRUE; + if (!RegEnumKeyW(hkey, 0, szDest, len) && *szDest) + { + TRACE("default verb=first verb=%s\n", debugstr_w(szDest)); + RegCloseKey(hkey); + return TRUE; + } + RegCloseKey(hkey); } + TRACE("no default verb!\n"); - return FALSE; + return FALSE; } BOOL HCR_GetExecuteCommandW( HKEY hkeyClass, LPCWSTR szClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len ) @@ -196,9 +178,9 @@ BOOL HCR_GetExecuteCommandW( HKEY hkeyClass, LPCWSTR szClass, LPCWSTR szVerb, LP if (HCR_GetDefaultVerbW(hkeyClass, szVerb, sTempVerb, sizeof(sTempVerb))) { WCHAR sTemp[MAX_PATH]; - lstrcpyW(sTemp, swShell); - lstrcatW(sTemp, sTempVerb); - lstrcatW(sTemp, swCommand); + wcscpy(sTemp, swShell); + wcscat(sTemp, sTempVerb); + wcscat(sTemp, swCommand); ret = (ERROR_SUCCESS == SHGetValueW(hkeyClass, sTemp, NULL, NULL, szDest, &len)); } if (szClass) @@ -284,7 +266,7 @@ BOOL HCR_GetDefaultIconW(LPCWSTR szClass, LPWSTR szDest, DWORD len, int* picon_i TRACE("%s\n",debugstr_w(szClass) ); lstrcpynW(sTemp, szClass, MAX_PATH); - lstrcatW(sTemp, swDefaultIcon); + wcscat(sTemp, swDefaultIcon); if (!RegOpenKeyExW(HKEY_CLASSES_ROOT, sTemp, 0, KEY_READ, &hkey)) { @@ -345,15 +327,28 @@ BOOL HCR_GetClassNameW(REFIID riid, LPWSTR szDest, DWORD len) HKEY hkey; BOOL ret = FALSE; DWORD buflen = len; + WCHAR szName[100]; + LPOLESTR pStr; - szDest[0] = 0; - if (HCR_RegOpenClassIDKey(riid, &hkey)) + szDest[0] = 0; + + if (StringFromCLSID(riid, &pStr) == S_OK) { - static const WCHAR wszLocalizedString[] = - { 'L','o','c','a','l','i','z','e','d','S','t','r','i','n','g', 0 }; - if (!RegLoadMUIStringW(hkey, wszLocalizedString, szDest, len, NULL, 0, NULL) || + DWORD dwLen = buflen * sizeof(WCHAR); + swprintf(szName, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CLSID\\%s", pStr); + if (RegGetValueW(HKEY_CURRENT_USER, szName, NULL, RRF_RT_REG_SZ, NULL, (PVOID)szDest, &dwLen) == ERROR_SUCCESS) + { + ret = TRUE; + } + CoTaskMemFree(pStr); + } + if (!ret && HCR_RegOpenClassIDKey(riid, &hkey)) + { + static const WCHAR wszLocalizedString[] = + { 'L','o','c','a','l','i','z','e','d','S','t','r','i','n','g', 0 }; + if (!RegLoadMUIStringW(hkey, wszLocalizedString, szDest, len, NULL, 0, NULL) || !RegQueryValueExW(hkey, swEmpty, 0, NULL, (LPBYTE)szDest, &len)) - { + { ret = TRUE; } RegCloseKey(hkey); diff --git a/reactos/dll/win32/shell32/clipboard.c b/reactos/dll/win32/shell32/clipboard.c index 7e8c920b8fb..1bdae631878 100644 --- a/reactos/dll/win32/shell32/clipboard.c +++ b/reactos/dll/win32/shell32/clipboard.c @@ -35,20 +35,7 @@ * */ -#include -#include - -#include "windef.h" -#include "winbase.h" -#include "winreg.h" -#include "wingdi.h" -#include "pidl.h" -#include "undocshell.h" -#include "shell32_main.h" -#include "shlwapi.h" - -#include "wine/unicode.h" -#include "wine/debug.h" +#include WINE_DEFAULT_DEBUG_CHANNEL(shell); @@ -74,12 +61,12 @@ HGLOBAL RenderHDROP(LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl) SHGetPathFromIDListW(pidlRoot, wszRootPath); PathAddBackslashW(wszRootPath); - rootlen = strlenW(wszRootPath); + rootlen = wcslen(wszRootPath); for (i=0; ipFiles = offset * sizeof(WCHAR); pDropFiles->fWide = TRUE; - strcpyW(wszFileName, wszRootPath); + wcscpy(wszFileName, wszRootPath); for (i=0; i -#include -#include -#include -#include -#include "windef.h" -#include "winbase.h" -#include "wingdi.h" -#include "winuser.h" -#include "wine/winbase16.h" -#include "wownt32.h" -#include "wine/debug.h" -#include "cpl.h" -#include "wine/unicode.h" - -#define NO_SHLWAPI_REG -#include "shlwapi.h" - -#include "cpanel.h" +#include WINE_DEFAULT_DEBUG_CHANNEL(shlctrl); @@ -319,13 +301,13 @@ static void Control_DoWindow(CPanel* panel, HWND hWnd, HINSTANCE hInst) WCHAR *p; GetSystemDirectoryW( buffer, MAX_PATH ); - p = buffer + strlenW(buffer); + p = buffer + wcslen(buffer); *p++ = '\\'; - lstrcpyW(p, wszAllCpl); + wcscpy(p, wszAllCpl); if ((h = FindFirstFileW(buffer, &fd)) != INVALID_HANDLE_VALUE) { do { - lstrcpyW(p, fd.cFileName); + wcscpy(p, fd.cFileName); Control_LoadApplet(hWnd, buffer, panel); } while (FindNextFileW(h, &fd)); FindClose(h); @@ -348,21 +330,44 @@ static void Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd) LPWSTR beg = NULL; LPWSTR end; WCHAR ch; - LPWSTR ptr; + LPCWSTR ptr, ptr2; + WCHAR szName[MAX_PATH]; unsigned sp = 0; LPWSTR extraPmts = NULL; int quoted = 0; BOOL spSet = FALSE; - HANDLE hMutex; + HANDLE hMutex; + UINT Length; + + ptr = wcsrchr(wszCmd, L'\\'); + ptr2 = wcsrchr(wszCmd, L','); + if (!ptr2) + { + ptr2 = wszCmd + wcslen(wszCmd) + 1; + } + + if (ptr) + ptr++; + else + ptr = wszCmd; + + Length = (ptr2 - ptr); + if (Length >= MAX_PATH) + return; + + memcpy(szName, (LPVOID)ptr, Length * sizeof(WCHAR)); + szName[Length] = L'\0'; + hMutex = CreateMutexW(NULL, TRUE, szName); - hMutex = CreateMutex(NULL, FALSE, (LPCTSTR) wszCmd); if ((!hMutex) || (GetLastError() == ERROR_ALREADY_EXISTS)) return; - buffer = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(wszCmd) + 1) * sizeof(*wszCmd)); - if (!buffer) return; - - end = lstrcpyW(buffer, wszCmd); - + buffer = HeapAlloc(GetProcessHeap(), 0, (wcslen(wszCmd) + 1) * sizeof(*wszCmd)); + if (!buffer) + { + CloseHandle(hMutex); + return; + } + end = wcscpy(buffer, wszCmd); for (;;) { ch = *end; if (ch == '"') quoted = !quoted; @@ -386,10 +391,10 @@ static void Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd) end++; } while ((ptr = StrChrW(buffer, '"'))) - memmove(ptr, ptr+1, lstrlenW(ptr)*sizeof(WCHAR)); + memmove((LPVOID)ptr, ptr+1, wcslen(ptr)*sizeof(WCHAR)); while ((ptr = StrChrW(extraPmts, '"'))) - memmove(ptr, ptr+1, lstrlenW(ptr)*sizeof(WCHAR)); + memmove((LPVOID)ptr, ptr+1, wcslen(ptr)*sizeof(WCHAR)); TRACE("cmd %s, extra %s, sp %d\n", debugstr_w(buffer), debugstr_w(extraPmts), sp); @@ -404,12 +409,20 @@ static void Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd) sp = 0; } - if ((extraPmts)&&(!spSet)) + if ((extraPmts) && extraPmts[0] &&(!spSet)) { while ((lstrcmpiW(extraPmts, applet->info[sp].szName)) && (sp < applet->count)) sp++; - } + if (sp >= applet->count) + { + ReleaseMutex(hMutex); + CloseHandle(hMutex); + Control_UnloadApplet(applet); + HeapFree(GetProcessHeap(), 0, buffer); + return; + } + } if (applet->info[sp].dwSize) { if (!applet->proc(applet->hWnd, CPL_STARTWPARMSA, sp, (LPARAM)extraPmts)) applet->proc(applet->hWnd, CPL_DBLCLK, sp, applet->info[sp].lData); diff --git a/reactos/dll/win32/shell32/cpanelfolder.c b/reactos/dll/win32/shell32/cpanelfolder.c index 36aadb03a06..d96ba91746b 100644 --- a/reactos/dll/win32/shell32/cpanelfolder.c +++ b/reactos/dll/win32/shell32/cpanelfolder.c @@ -18,38 +18,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "wine/config.h" -#include "wine/port.h" -#include -#include -#include -#include +#include -#define COBJMACROS -#define NONAMELESSUNION -#define NONAMELESSSTRUCT - -#include "winerror.h" -#include "windef.h" -#include "winbase.h" -#include "winreg.h" -#include "wingdi.h" -#include "winuser.h" - -#include "ole2.h" -#include "shlguid.h" - -#include "cpanel.h" -#include "enumidlist.h" -#include "pidl.h" -#include "undocshell.h" -#include "shell32_main.h" -#include "shresdef.h" -#include "shlwapi.h" -#include "wine/debug.h" -#include "debughlp.h" -#include "shfldr.h" WINE_DEFAULT_DEBUG_CHANNEL(shell); @@ -71,7 +42,7 @@ typedef struct { int dwAttributes; /* attributes returned by GetAttributesOf FIXME: use it */ LPCITEMIDLIST *apidl; UINT cidl; -} ICPanelImpl; +} ICPanelImpl, *LPICPanelImpl; static const IShellFolder2Vtbl vt_ShellFolder2; static const IPersistFolder2Vtbl vt_PersistFolder2; @@ -79,25 +50,25 @@ static const IShellExecuteHookWVtbl vt_ShellExecuteHookW; static const IShellExecuteHookAVtbl vt_ShellExecuteHookA; static const IContextMenu2Vtbl vt_ContextMenu; -static inline ICPanelImpl *impl_from_IPersistFolder2( IPersistFolder2 *iface ) +static LPICPanelImpl __inline impl_from_IPersistFolder2( IPersistFolder2 *iface ) { - return (ICPanelImpl *)((char*)iface - FIELD_OFFSET(ICPanelImpl, lpVtblPersistFolder2)); + return (LPICPanelImpl)((char*)iface - FIELD_OFFSET(ICPanelImpl, lpVtblPersistFolder2)); } -static inline ICPanelImpl *impl_from_IContextMenu( IContextMenu2 *iface ) +static LPICPanelImpl __inline impl_from_IContextMenu( IContextMenu2 *iface ) { - return (ICPanelImpl *)((char*)iface - FIELD_OFFSET(ICPanelImpl, lpVtblContextMenu)); + return (LPICPanelImpl)((char*)iface - FIELD_OFFSET(ICPanelImpl, lpVtblContextMenu)); } -static inline ICPanelImpl *impl_from_IShellExecuteHookW( IShellExecuteHookW *iface ) +static LPICPanelImpl __inline impl_from_IShellExecuteHookW( IShellExecuteHookW *iface ) { - return (ICPanelImpl *)((char*)iface - FIELD_OFFSET(ICPanelImpl, lpVtblShellExecuteHookW)); + return (LPICPanelImpl)((char*)iface - FIELD_OFFSET(ICPanelImpl, lpVtblShellExecuteHookW)); } -static inline ICPanelImpl *impl_from_IShellExecuteHookA( IShellExecuteHookA *iface ) +static LPICPanelImpl __inline impl_from_IShellExecuteHookA( IShellExecuteHookA *iface ) { - return (ICPanelImpl *)((char*)iface - FIELD_OFFSET(ICPanelImpl, lpVtblShellExecuteHookA)); + return (LPICPanelImpl)((char*)iface - FIELD_OFFSET(ICPanelImpl, lpVtblShellExecuteHookA)); } @@ -700,10 +671,10 @@ static HRESULT WINAPI ISF_ControlPanel_fnGetDisplayNameOf(IShellFolder2 * iface, int len = 0; PathAddBackslashW(wszPath); - len = lstrlenW(wszPath); + len = wcslen(wszPath); if (!SUCCEEDED - (SHELL32_GetDisplayNameOfChild(iface, pidl, dwFlags | SHGDN_INFOLDER, wszPath + len, MAX_PATH + 1 - len))) + (SHELL32_GetDisplayNameOfChild(iface, pidl, dwFlags, wszPath + len, MAX_PATH + 1 - len))) return E_OUTOFMEMORY; if (!WideCharToMultiByte(CP_ACP, 0, wszPath, -1, szPath, MAX_PATH, NULL, NULL)) wszPath[0] = '\0'; @@ -907,8 +878,11 @@ static HRESULT WINAPI ICPanel_PersistFolder2_GetClassID(IPersistFolder2 * iface, static HRESULT WINAPI ICPanel_PersistFolder2_Initialize(IPersistFolder2 * iface, LPCITEMIDLIST pidl) { ICPanelImpl *This = impl_from_IPersistFolder2(iface); - TRACE("(%p)->(%p)\n", This, pidl); - return E_NOTIMPL; + if (This->pidlRoot) + SHFree((LPVOID)This->pidlRoot); + + This->pidlRoot = ILClone(pidl); + return S_OK; } /************************************************************************** @@ -1222,7 +1196,7 @@ static HRESULT WINAPI ICPanel_IContextMenu2_QueryContextMenu( UINT idCmdLast, UINT uFlags) { - char szBuffer[30] = {0}; + WCHAR szBuffer[30] = {0}; ULONG Count = 1; ICPanelImpl *This = impl_from_IContextMenu(iface); @@ -1230,22 +1204,22 @@ static HRESULT WINAPI ICPanel_IContextMenu2_QueryContextMenu( TRACE("(%p)->(hmenu=%p indexmenu=%x cmdfirst=%x cmdlast=%x flags=%x )\n", This, hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags); - if (LoadStringA(shell32_hInstance, IDS_OPEN, szBuffer, sizeof(szBuffer)/sizeof(char))) + if (LoadStringW(shell32_hInstance, IDS_OPEN, szBuffer, sizeof(szBuffer)/sizeof(WCHAR))) { - szBuffer[(sizeof(szBuffer)/sizeof(char))-1] = L'\0'; - _InsertMenuItem(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_STRING, szBuffer, MFS_DEFAULT); + szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0'; + _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_STRING, szBuffer, MFS_DEFAULT); Count++; } - if (LoadStringA(shell32_hInstance, IDS_CREATELINK, szBuffer, sizeof(szBuffer)/sizeof(char))) + if (LoadStringW(shell32_hInstance, IDS_CREATELINK, szBuffer, sizeof(szBuffer)/sizeof(WCHAR))) { if (Count) { - _InsertMenuItem(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_SEPARATOR, NULL, MFS_ENABLED); + _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_SEPARATOR, NULL, MFS_ENABLED); } - szBuffer[(sizeof(szBuffer)/sizeof(char))-1] = L'\0'; + szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0'; - _InsertMenuItem(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_STRING, szBuffer, MFS_ENABLED); + _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_STRING, szBuffer, MFS_ENABLED); Count++; } return MAKE_HRESULT(SEVERITY_SUCCESS, 0, Count); @@ -1272,7 +1246,7 @@ static HRESULT WINAPI ICPanel_IContextMenu2_InvokeCommand( TRACE("(%p)->(invcom=%p verb=%p wnd=%p)\n",This,lpcmi,lpcmi->lpVerb, lpcmi->hwnd); - if (lpcmi->lpVerb == MAKEINTRESOURCE(1)) + if (lpcmi->lpVerb == MAKEINTRESOURCEA(1)) { ZeroMemory(&sei, sizeof(sei)); sei.cbSize = sizeof(sei); @@ -1285,7 +1259,7 @@ static HRESULT WINAPI ICPanel_IContextMenu2_InvokeCommand( if (sei.hInstApp <= (HINSTANCE)32) return E_FAIL; } - else if (lpcmi->lpVerb == MAKEINTRESOURCE(2)) + else if (lpcmi->lpVerb == MAKEINTRESOURCEA(2)) { if (!SHGetSpecialFolderPathW(NULL, szPath, CSIDL_DESKTOPDIRECTORY, FALSE)) return E_FAIL; diff --git a/reactos/dll/win32/shell32/dataobject.c b/reactos/dll/win32/shell32/dataobject.c index 3192a3ee7cd..503ff4568d4 100644 --- a/reactos/dll/win32/shell32/dataobject.c +++ b/reactos/dll/win32/shell32/dataobject.c @@ -19,19 +19,8 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -#define COBJMACROS -#define NONAMELESSUNION -#define NONAMELESSSTRUCT - -#include "windef.h" -#include "wingdi.h" -#include "pidl.h" -#include "winerror.h" -#include "shell32_main.h" -#include "wine/debug.h" -#include "undocshell.h" +#include WINE_DEFAULT_DEBUG_CHANNEL(shell); diff --git a/reactos/dll/win32/shell32/dde.c b/reactos/dll/win32/shell32/dde.c index fe5a1f7d8ad..63f47877954 100644 --- a/reactos/dll/win32/shell32/dde.c +++ b/reactos/dll/win32/shell32/dde.c @@ -18,14 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include - -#include "windef.h" -#include "winbase.h" -#include "ddeml.h" -#include "shellapi.h" - -#include "wine/debug.h" +#include WINE_DEFAULT_DEBUG_CHANNEL(shell); @@ -40,7 +33,7 @@ static HSZ hszFolders; static DWORD dwDDEInst; -static inline BOOL Dde_OnConnect(HSZ hszTopic, HSZ hszService) +static BOOL __inline Dde_OnConnect(HSZ hszTopic, HSZ hszService) { if ((hszTopic == hszProgmanTopic) && (hszService == hszProgmanService)) return TRUE; @@ -53,25 +46,25 @@ static inline BOOL Dde_OnConnect(HSZ hszTopic, HSZ hszService) return FALSE; } -static inline void Dde_OnConnectConfirm(HCONV hconv, HSZ hszTopic, HSZ hszService) +static void __inline Dde_OnConnectConfirm(HCONV hconv, HSZ hszTopic, HSZ hszService) { FIXME("stub\n"); } -static inline BOOL Dde_OnWildConnect(HSZ hszTopic, HSZ hszService) +static BOOL __inline Dde_OnWildConnect(HSZ hszTopic, HSZ hszService) { FIXME("stub\n"); return FALSE; } -static inline HDDEDATA Dde_OnRequest(UINT uFmt, HCONV hconv, HSZ hszTopic, +static HDDEDATA __inline Dde_OnRequest(UINT uFmt, HCONV hconv, HSZ hszTopic, HSZ hszItem) { FIXME("stub\n"); return NULL; } -static inline DWORD Dde_OnExecute(HCONV hconv, HSZ hszTopic, HDDEDATA hdata) +static DWORD __inline Dde_OnExecute(HCONV hconv, HSZ hszTopic, HDDEDATA hdata) { BYTE * pszCommand; @@ -86,7 +79,7 @@ static inline DWORD Dde_OnExecute(HCONV hconv, HSZ hszTopic, HDDEDATA hdata) return DDE_FNOTPROCESSED; } -static inline void Dde_OnDisconnect(HCONV hconv) +static void __inline Dde_OnDisconnect(HCONV hconv) { FIXME("stub\n"); } diff --git a/reactos/dll/win32/shell32/debughlp.c b/reactos/dll/win32/shell32/debughlp.c index 50bf0dc48f2..8a2ad756f9c 100644 --- a/reactos/dll/win32/shell32/debughlp.c +++ b/reactos/dll/win32/shell32/debughlp.c @@ -18,19 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -#include -#include -#include -#include "windef.h" -#include "wingdi.h" -#include "pidl.h" -#include "shldisp.h" -#include "wine/debug.h" -#include "debughlp.h" -#include "docobj.h" -#include "shell32_main.h" - +#include WINE_DEFAULT_DEBUG_CHANNEL(pidl); @@ -190,7 +178,7 @@ LPWSTR _dbg_ILGetSTextPointerW(LPCITEMIDLIST pidl) return NULL; case PT_VALUEW: - return (LPWSTR)(pdata->u.file.szNames + lstrlenW ((LPWSTR)pdata->u.file.szNames) + 1); + return (LPWSTR)(pdata->u.file.szNames + wcslen ((LPWSTR)pdata->u.file.szNames) + 1); } } return NULL; diff --git a/reactos/dll/win32/shell32/desktop.c b/reactos/dll/win32/shell32/desktop.c index 513327db164..703d05fb31d 100644 --- a/reactos/dll/win32/shell32/desktop.c +++ b/reactos/dll/win32/shell32/desktop.c @@ -18,23 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define COBJMACROS -#define NONAMELESSUNION -#define NONAMELESSSTRUCT - -#include - -#include "windef.h" -#include "winbase.h" -#include "wingdi.h" -#include "winnls.h" -#include "winuser.h" -#include "shellapi.h" -#include "shlobj.h" -#include "undocshell.h" -#include "shell32_main.h" - -#include "wine/debug.h" +#include WINE_DEFAULT_DEBUG_CHANNEL(desktop); diff --git a/reactos/dll/win32/shell32/dialogs.c b/reactos/dll/win32/shell32/dialogs.c index 05e962c8479..d2fcf062349 100644 --- a/reactos/dll/win32/shell32/dialogs.c +++ b/reactos/dll/win32/shell32/dialogs.c @@ -18,27 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" +#include -#include -#include -#include -#include "winerror.h" -#include "windef.h" -#include "winbase.h" -#include "winreg.h" -#include "wingdi.h" -#include "winuser.h" -#include "commdlg.h" -#include "wine/debug.h" - -#include "shellapi.h" -#include "shlobj.h" -#include "shell32_main.h" -#include "shresdef.h" -#include "undocshell.h" -#include "shlwapi.h" typedef struct { @@ -244,6 +225,7 @@ INT_PTR CALLBACK PickIconProc(HWND hwndDlg, DI_NORMAL); break; } + break; } return FALSE; diff --git a/reactos/dll/win32/shell32/dragdrophelper.c b/reactos/dll/win32/shell32/dragdrophelper.c index 9c3f236f061..ebd39a3be37 100644 --- a/reactos/dll/win32/shell32/dragdrophelper.c +++ b/reactos/dll/win32/shell32/dragdrophelper.c @@ -19,27 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - -#include -#include - -#define COBJMACROS - -#include "windef.h" -#include "winbase.h" -#include "winreg.h" -#include "wingdi.h" -#include "winuser.h" - -#include "objbase.h" -#include "ole2.h" -#include "shlguid.h" -#include "shlobj.h" - -#include "wine/debug.h" -#include "debughlp.h" +#include WINE_DEFAULT_DEBUG_CHANNEL (shell); diff --git a/reactos/dll/win32/shell32/drive.c b/reactos/dll/win32/shell32/drive.c index 5bc61a30268..44135c97d32 100644 --- a/reactos/dll/win32/shell32/drive.c +++ b/reactos/dll/win32/shell32/drive.c @@ -18,8 +18,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "config.h" -#include "wine/port.h" #define LARGEINT_PROTOS #define LargeIntegerDivide RtlLargeIntegerDivide #define ExtendedIntegerMultiply RtlExtendedIntegerMultiply @@ -31,22 +29,13 @@ #define NTOS_MODE_USER #define UNICODE #define _UNICODE +#define COBJMACROS #include #include - -#include -#include -#include -#include "wine/debug.h" -#include "shresdef.h" - -#include -#include -#include -#include -#include -#include #include +#include + +#include WINE_DEFAULT_DEBUG_CHANNEL(shell); @@ -92,6 +81,20 @@ VOID IN PFMIFSCALLBACK Callback ); +typedef +VOID +(NTAPI *CHKDSK)( + IN PWCHAR DriveRoot, + IN PWCHAR Format, + IN BOOLEAN CorrectErrors, + IN BOOLEAN Verbose, + IN BOOLEAN CheckOnlyIfDirty, + IN BOOLEAN ScanDrive, + IN PVOID Unused2, + IN PVOID Unused3, + IN PFMIFSCALLBACK Callback +); + typedef struct { @@ -101,9 +104,13 @@ typedef struct QUERY_AVAILABLEFSFORMAT QueryAvailableFileSystemFormat; FORMAT_EX FormatEx; ENABLEVOLUMECOMPRESSION EnableVolumeCompression; + CHKDSK Chkdsk; UINT Result; }FORMAT_DRIVE_CONTEXT, *PFORMAT_DRIVE_CONTEXT; +BOOL InitializeFmifsLibrary(PFORMAT_DRIVE_CONTEXT pContext); +BOOL GetDefaultClusterSize(LPWSTR szFs, PDWORD pClusterSize, PULARGE_INTEGER TotalNumberOfBytes); +HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey, UINT max_iface, IDataObject *pDataObj); HWND WINAPI DeviceCreateHardwarePageEx(HWND hWndParent, LPGUID lpGuids, @@ -114,7 +121,174 @@ HPROPSHEETPAGE SH_CreatePropertySheetPage(LPSTR resname, DLGPROC dlgproc, LPARAM #define DRIVE_PROPERTY_PAGES (3) -extern HINSTANCE shell32_hInstance; +static const GUID GUID_DEVCLASS_DISKDRIVE = {0x4d36e967L, 0xe325, 0x11ce, {0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18}}; + + +VOID +GetDriveNameWithLetter(LPWSTR szText, UINT Length, WCHAR Drive) +{ + WCHAR szDrive[] = {'C',':','\\', 0}; + DWORD dwMaxComp, dwFileSys, TempLength = 0; + + szDrive[0] = Drive; + if (GetVolumeInformationW(szDrive, szText, Length, NULL, &dwMaxComp, &dwFileSys, NULL, 0)) + { + szText[Length-1] = L'\0'; + TempLength = wcslen(szText); + if (!TempLength) + { + /* load default volume label */ + TempLength = LoadStringW(shell32_hInstance, IDS_DRIVE_FIXED, &szText[Length+1], (sizeof(szText)/sizeof(WCHAR))- Length - 2); + } + } + if (TempLength + 4 < Length) + { + szText[TempLength] = L' '; + szText[TempLength+1] = L'('; + szText[TempLength+2] = szDrive[0]; + szText[TempLength+3] = L')'; + TempLength +=4; + } + + if (TempLength < Length) + szText[TempLength] = L'\0'; + else + szText[Length-1] = L'\0'; +} + + +VOID +InitializeChkDskDialog(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext) +{ + WCHAR szText[100]; + UINT Length; + SetWindowLongPtr(hwndDlg, DWLP_USER, (INT_PTR)pContext); + + Length = GetWindowTextW(hwndDlg, szText, sizeof(szText)/sizeof(WCHAR)); + + GetDriveNameWithLetter(&szText[Length +1], (sizeof(szText)/sizeof(WCHAR))-Length-1, pContext->Drive); + szText[Length] = L' '; + szText[(sizeof(szText)/sizeof(WCHAR))-1] = L'\0'; + SetWindowText(hwndDlg, szText); +} + +HWND ChkdskDrvDialog = NULL; +BOOLEAN bChkdskSuccess = FALSE; + +BOOLEAN +NTAPI +ChkdskCallback( + IN CALLBACKCOMMAND Command, + IN ULONG SubAction, + IN PVOID ActionInfo) +{ + PDWORD Progress; + PBOOLEAN pSuccess; + switch(Command) + { + case PROGRESS: + Progress = (PDWORD)ActionInfo; + SendDlgItemMessageW(ChkdskDrvDialog, 14002, PBM_SETPOS, (WPARAM)*Progress, 0); + break; + case DONE: + pSuccess = (PBOOLEAN)ActionInfo; + bChkdskSuccess = (*pSuccess); + break; + + case VOLUMEINUSE: + case INSUFFICIENTRIGHTS: + case FSNOTSUPPORTED: + case CLUSTERSIZETOOSMALL: + bChkdskSuccess = FALSE; + FIXME("\n"); + break; + + default: + break; + } + + return TRUE; +} + +VOID +ChkDskNow(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext) +{ + DWORD ClusterSize = 0, dwMaxComponentLength, FileSystemFlags; + WCHAR szFs[30]; + WCHAR szDrive[] = {'C',':','\\', 0}; + WCHAR szVolumeLabel[40]; + ULARGE_INTEGER TotalNumberOfFreeBytes, FreeBytesAvailableUser; + BOOLEAN bCorrectErrors = FALSE, bScanDrive = FALSE; + + szDrive[0] = pContext->Drive; + if(!GetVolumeInformationW(szDrive, szVolumeLabel, sizeof(szVolumeLabel)/sizeof(WCHAR), NULL, &dwMaxComponentLength, &FileSystemFlags, szFs, sizeof(szFs)/sizeof(WCHAR))) + { + FIXME("failed to get drive fs type\n"); + return; + } + + if (!GetDiskFreeSpaceExW(szDrive, &FreeBytesAvailableUser, &TotalNumberOfFreeBytes, NULL)) + { + FIXME("failed to get drive space type\n"); + return; + } + + if (!GetDefaultClusterSize(szFs, &ClusterSize, &TotalNumberOfFreeBytes)) + { + FIXME("invalid cluster size\n"); + return; + } + + if (SendDlgItemMessageW(hwndDlg, 14000, BM_GETCHECK, 0, 0) == BST_CHECKED) + bCorrectErrors = TRUE; + + if (SendDlgItemMessageW(hwndDlg, 14001, BM_GETCHECK, 0, 0) == BST_CHECKED) + bScanDrive = TRUE; + + ChkdskDrvDialog = hwndDlg; + bChkdskSuccess = FALSE; + SendDlgItemMessageW(hwndDlg, 14002, PBM_SETRANGE, 0, MAKELPARAM(0, 100)); + pContext->Chkdsk(szDrive, szFs, bCorrectErrors, TRUE, FALSE, bScanDrive, NULL, NULL, ChkdskCallback); + + ChkdskDrvDialog = NULL; + pContext->Result = bChkdskSuccess; + bChkdskSuccess = FALSE; + +} + +INT_PTR +CALLBACK +ChkDskDlg( + HWND hwndDlg, + UINT uMsg, + WPARAM wParam, + LPARAM lParam +) +{ + PFORMAT_DRIVE_CONTEXT pContext; + switch(uMsg) + { + case WM_INITDIALOG: + SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)lParam); + InitializeChkDskDialog(hwndDlg, (PFORMAT_DRIVE_CONTEXT)lParam); + return TRUE; + case WM_COMMAND: + switch(LOWORD(wParam)) + { + case IDCANCEL: + EndDialog(hwndDlg, 0); + break; + case IDOK: + pContext = (PFORMAT_DRIVE_CONTEXT) GetWindowLongPtr(hwndDlg, DWLP_USER); + ChkDskNow(hwndDlg, pContext); + break; + } + break; + } + + return FALSE; +} + static LARGE_INTEGER @@ -225,7 +399,7 @@ InitializeGeneralDriveDialog(HWND hwndDlg, WCHAR * szDrive) HANDLE hVolume; DWORD BytesReturned = 0; - sprintfW(szResult, L"\\\\.\\%c:", towupper(szDrive[0])); + swprintf(szResult, L"\\\\.\\%c:", towupper(szDrive[0])); hVolume = CreateFileW(szResult, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL); if (hVolume != INVALID_HANDLE_VALUE) { @@ -365,11 +539,12 @@ DriveExtraDlg( { STARTUPINFOW si; PROCESS_INFORMATION pi; - WCHAR szPath[MAX_PATH]; + WCHAR szPath[MAX_PATH + 10]; WCHAR szArg[MAX_PATH]; WCHAR * szDrive; - UINT length; LPPROPSHEETPAGEW ppsp; + DWORD dwSize; + FORMAT_DRIVE_CONTEXT Context; switch (uMsg) { @@ -381,38 +556,58 @@ DriveExtraDlg( ZeroMemory( &si, sizeof(si) ); si.cb = sizeof(si); ZeroMemory( &pi, sizeof(pi) ); - if (!GetSystemDirectoryW(szPath, MAX_PATH)) - break; + szDrive = (WCHAR*)GetWindowLongPtr(hwndDlg, DWLP_USER); switch(LOWORD(wParam)) { case 14000: - /// - /// FIXME - /// show checkdsk dialog - /// + if (InitializeFmifsLibrary(&Context)) + { + Context.Drive = szDrive[0]; + DialogBoxParamW(shell32_hInstance, L"CHKDSK_DLG", hwndDlg, ChkDskDlg, (LPARAM)&Context); + FreeLibrary(Context.hLibrary); + } break; case 14001: - szArg[0] = L'"'; - wcscpy(&szArg[1], szPath); - wcscat(szPath, L"\\mmc.exe"); - wcscat(szArg, L"\\dfrg.msc\" "); - length = wcslen(szArg); - szArg[length] = szDrive[0]; - szArg[length+1] = L':'; - szArg[length+2] = L'\0'; - if (CreateProcessW(szPath, szArg, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) + dwSize = sizeof(szPath); + if (RegGetValueW(HKEY_LOCAL_MACHINE, + L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\DefragPath", + NULL, + RRF_RT_REG_EXPAND_SZ, + NULL, + (PVOID)szPath, + &dwSize) == S_OK) { - CloseHandle(pi.hProcess); - CloseHandle(pi.hThread); + swprintf(szArg, szPath, szDrive[0]); + if (!GetSystemDirectoryW(szPath, MAX_PATH)) + break; + szDrive = PathAddBackslashW(szPath); + if (!szDrive) + break; + + wcscat(szDrive, L"mmc.exe"); + if (CreateProcessW(szPath, szArg, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) + { + CloseHandle(pi.hProcess); + CloseHandle(pi.hThread); + } } break; case 14002: - wcscat(szPath, L"\\ntbackup.exe"); - if (CreateProcessW(szPath, NULL, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) + dwSize = sizeof(szPath); + if (RegGetValueW(HKEY_LOCAL_MACHINE, + L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\BackupPath", + NULL, + RRF_RT_REG_EXPAND_SZ, + NULL, + (PVOID)szPath, + &dwSize) == S_OK) { - CloseHandle(pi.hProcess); - CloseHandle(pi.hThread); + if (CreateProcessW(szPath, NULL, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) + { + CloseHandle(pi.hProcess); + CloseHandle(pi.hThread); + } } } break; @@ -462,7 +657,7 @@ struct { "DRIVE_HARDWARE_DLG", DriveHardwareDlg }, }; -BOOL +HRESULT CALLBACK AddPropSheetPageProc(HPROPSHEETPAGE hpage, LPARAM lParam) { @@ -476,15 +671,16 @@ AddPropSheetPageProc(HPROPSHEETPAGE hpage, LPARAM lParam) } BOOL -SH_ShowDriveProperties(WCHAR * drive) +SH_ShowDriveProperties(WCHAR * drive, LPCITEMIDLIST pidlFolder, LPCITEMIDLIST * apidl) { - HPSXA hpsx; + HPSXA hpsx = NULL; HPROPSHEETPAGE hpsp[MAX_PROPERTY_SHEET_PAGE]; PROPSHEETHEADERW psh; BOOL ret; UINT i; WCHAR szName[MAX_PATH]; DWORD dwMaxComponent, dwFileSysFlags; + IDataObject * pDataObj = NULL; ZeroMemory(&psh, sizeof(PROPSHEETHEADERW)); psh.dwSize = sizeof(PROPSHEETHEADERW); @@ -516,7 +712,6 @@ SH_ShowDriveProperties(WCHAR * drive) } } - for (i = 0; i < DRIVE_PROPERTY_PAGES; i++) { HPROPSHEETPAGE hprop = SH_CreatePropertySheetPage(PropPages[i].resname, PropPages[i].dlgproc, (LPARAM)drive, NULL); @@ -526,31 +721,98 @@ SH_ShowDriveProperties(WCHAR * drive) psh.nPages++; } } - - hpsx = SHCreatePropSheetExtArray(HKEY_CLASSES_ROOT, - L"Drive", - MAX_PROPERTY_SHEET_PAGE-DRIVE_PROPERTY_PAGES); - - SHAddFromPropSheetExtArray(hpsx, - (LPFNADDPROPSHEETPAGE)AddPropSheetPageProc, - (LPARAM)&psh); + if (SHCreateDataObject(pidlFolder, 1, apidl, NULL, &IID_IDataObject, (void**)&pDataObj) == S_OK) + { + hpsx = SHCreatePropSheetExtArrayEx(HKEY_CLASSES_ROOT, L"Drive", MAX_PROPERTY_SHEET_PAGE-DRIVE_PROPERTY_PAGES, pDataObj); + if (hpsx) + { + SHAddFromPropSheetExtArray(hpsx, (LPFNADDPROPSHEETPAGE)AddPropSheetPageProc, (LPARAM)&psh); + } + } ret = PropertySheetW(&psh); + if (pDataObj) + IDataObject_Release(pDataObj); + + if (hpsx) + SHDestroyPropSheetExtArray(hpsx); + if (ret < 0) return FALSE; else return TRUE; } +BOOL +GetDefaultClusterSize(LPWSTR szFs, PDWORD pClusterSize, PULARGE_INTEGER TotalNumberOfBytes) +{ + DWORD ClusterSize; + if (!wcsicmp(szFs, L"FAT16") || + !wcsicmp(szFs, L"FAT")) //REACTOS HACK + { + if (TotalNumberOfBytes->QuadPart <= (16 * 1024 * 1024)) + ClusterSize = 2048; + else if (TotalNumberOfBytes->QuadPart <= (32 * 1024 * 1024)) + ClusterSize = 512; + else if (TotalNumberOfBytes->QuadPart <= (64 * 1024 * 1024)) + ClusterSize = 1024; + else if (TotalNumberOfBytes->QuadPart <= (128 * 1024 * 1024)) + ClusterSize = 2048; + else if (TotalNumberOfBytes->QuadPart <= (256 * 1024 * 1024)) + ClusterSize = 4096; + else if (TotalNumberOfBytes->QuadPart <= (512 * 1024 * 1024)) + ClusterSize = 8192; + else if (TotalNumberOfBytes->QuadPart <= (1024 * 1024 * 1024)) + ClusterSize = 16384; + else if (TotalNumberOfBytes->QuadPart <= (2048LL * 1024LL * 1024LL)) + ClusterSize = 32768; + else if (TotalNumberOfBytes->QuadPart <= (4096LL * 1024LL * 1024LL)) + ClusterSize = 8192; + else + return FALSE; + } + else if (!wcsicmp(szFs, L"FAT32")) + { + if (TotalNumberOfBytes->QuadPart <=(64 * 1024 * 1024)) + ClusterSize = 512; + else if (TotalNumberOfBytes->QuadPart <= (128 * 1024 * 1024)) + ClusterSize = 1024; + else if (TotalNumberOfBytes->QuadPart <= (256 * 1024 * 1024)) + ClusterSize = 2048; + else if (TotalNumberOfBytes->QuadPart <= (8192LL * 1024LL * 1024LL)) + ClusterSize = 2048; + else if (TotalNumberOfBytes->QuadPart <= (16384LL * 1024LL * 1024LL)) + ClusterSize = 8192; + else if (TotalNumberOfBytes->QuadPart <= (32768LL * 1024LL * 1024LL)) + ClusterSize = 16384; + else + return FALSE; + } + else if (!wcsicmp(szFs, L"NTFS")) + { + if (TotalNumberOfBytes->QuadPart <=(512 * 1024 * 1024)) + ClusterSize = 512; + else if (TotalNumberOfBytes->QuadPart <= (1024 * 1024 * 1024)) + ClusterSize = 1024; + else if (TotalNumberOfBytes->QuadPart <= (2048LL * 1024LL * 1024LL)) + ClusterSize = 2048; + else + ClusterSize = 2048; + } + else + return FALSE; + *pClusterSize = ClusterSize; + return TRUE; +} VOID InsertDefaultClusterSizeForFs(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext) { WCHAR szFs[100] = {0}; - WCHAR szDrive[4] = { L'C', ':', '\\', 0 }; + WCHAR szDrive[4] = { L'C', ':', '\\', 0 }; INT iSelIndex; ULARGE_INTEGER FreeBytesAvailableUser, TotalNumberOfBytes; DWORD ClusterSize; @@ -574,30 +836,13 @@ InsertDefaultClusterSizeForFs(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext) if (!wcsicmp(szFs, L"FAT16") || !wcsicmp(szFs, L"FAT")) //REACTOS HACK { - if (TotalNumberOfBytes.QuadPart <= (16 * 1024 * 1024)) - ClusterSize = 2048; - else if (TotalNumberOfBytes.QuadPart <= (32 * 1024 * 1024)) - ClusterSize = 512; - else if (TotalNumberOfBytes.QuadPart <= (64 * 1024 * 1024)) - ClusterSize = 1024; - else if (TotalNumberOfBytes.QuadPart <= (128 * 1024 * 1024)) - ClusterSize = 2048; - else if (TotalNumberOfBytes.QuadPart <= (256 * 1024 * 1024)) - ClusterSize = 4096; - else if (TotalNumberOfBytes.QuadPart <= (512 * 1024 * 1024)) - ClusterSize = 8192; - else if (TotalNumberOfBytes.QuadPart <= (1024 * 1024 * 1024)) - ClusterSize = 16384; - else if (TotalNumberOfBytes.QuadPart <= (2048LL * 1024LL * 1024LL)) - ClusterSize = 32768; - else if (TotalNumberOfBytes.QuadPart <= (4096LL * 1024LL * 1024LL)) - ClusterSize = 8192; - else + if (!GetDefaultClusterSize(szFs, &ClusterSize, &TotalNumberOfBytes)) { TRACE("FAT16 is not supported on hdd larger than 4G current %lu\n", TotalNumberOfBytes.QuadPart); SendMessageW(hDlgCtrl, CB_DELETESTRING, iSelIndex, 0); return; } + if (LoadStringW(shell32_hInstance, IDS_DEFAULT_CLUSTER_SIZE, szFs, sizeof(szFs)/sizeof(WCHAR))) { hDlgCtrl = GetDlgItem(hwndDlg, 28680); @@ -611,19 +856,7 @@ InsertDefaultClusterSizeForFs(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext) } else if (!wcsicmp(szFs, L"FAT32")) { - if (TotalNumberOfBytes.QuadPart <=(64 * 1024 * 1024)) - ClusterSize = 512; - else if (TotalNumberOfBytes.QuadPart <= (128 * 1024 * 1024)) - ClusterSize = 1024; - else if (TotalNumberOfBytes.QuadPart <= (256 * 1024 * 1024)) - ClusterSize = 2048; - else if (TotalNumberOfBytes.QuadPart <= (8192LL * 1024LL * 1024LL)) - ClusterSize = 2048; - else if (TotalNumberOfBytes.QuadPart <= (16384LL * 1024LL * 1024LL)) - ClusterSize = 8192; - else if (TotalNumberOfBytes.QuadPart <= (32768LL * 1024LL * 1024LL)) - ClusterSize = 16384; - else + if (!GetDefaultClusterSize(szFs, &ClusterSize, &TotalNumberOfBytes)) { TRACE("FAT32 is not supported on hdd larger than 32G current %lu\n", TotalNumberOfBytes.QuadPart); SendMessageW(hDlgCtrl, CB_DELETESTRING, iSelIndex, 0); @@ -643,14 +876,12 @@ InsertDefaultClusterSizeForFs(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext) } else if (!wcsicmp(szFs, L"NTFS")) { - if (TotalNumberOfBytes.QuadPart <=(512 * 1024 * 1024)) - ClusterSize = 512; - else if (TotalNumberOfBytes.QuadPart <= (1024 * 1024 * 1024)) - ClusterSize = 1024; - else if (TotalNumberOfBytes.QuadPart <= (2048LL * 1024LL * 1024LL)) - ClusterSize = 2048; - else - ClusterSize = 2048; + if (!GetDefaultClusterSize(szFs, &ClusterSize, &TotalNumberOfBytes)) + { + TRACE("NTFS is not supported on hdd larger than 2TB current %lu\n", TotalNumberOfBytes.QuadPart); + SendMessageW(hDlgCtrl, CB_DELETESTRING, iSelIndex, 0); + return; + } hDlgCtrl = GetDlgItem(hwndDlg, 28680); if (LoadStringW(shell32_hInstance, IDS_DEFAULT_CLUSTER_SIZE, szFs, sizeof(szFs)/sizeof(WCHAR))) @@ -1016,6 +1247,14 @@ InitializeFmifsLibrary(PFORMAT_DRIVE_CONTEXT pContext) return FALSE; } + pContext->Chkdsk = (CHKDSK) GetProcAddress(hLibrary, "Chkdsk"); + if (!pContext->Chkdsk) + { + ERR("Chkdsk export is missing\n"); + FreeLibrary(hLibrary); + return FALSE; + } + return TRUE; } diff --git a/reactos/dll/win32/shell32/enumidlist.c b/reactos/dll/win32/shell32/enumidlist.c index adc2dde2352..9ae675e6f28 100644 --- a/reactos/dll/win32/shell32/enumidlist.c +++ b/reactos/dll/win32/shell32/enumidlist.c @@ -18,21 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -#include -#include - -#define COBJMACROS - -#include "wine/debug.h" -#include "wine/unicode.h" -#include "windef.h" -#include "winbase.h" -#include "winreg.h" -#include "shlwapi.h" - -#include "pidl.h" -#include "enumidlist.h" +#include WINE_DEFAULT_DEBUG_CHANNEL(shell); @@ -143,9 +129,9 @@ BOOL CreateFolderEnumList( if(!lpszPath || !lpszPath[0]) return FALSE; - strcpyW(szPath, lpszPath); + wcscpy(szPath, lpszPath); PathAddBackslashW(szPath); - strcatW(szPath,stars); + wcscat(szPath,stars); hFile = FindFirstFileW(szPath,&stffile); if ( hFile != INVALID_HANDLE_VALUE ) diff --git a/reactos/dll/win32/shell32/extracticon.c b/reactos/dll/win32/shell32/extracticon.c index 719cc5500cc..576d46195b2 100644 --- a/reactos/dll/win32/shell32/extracticon.c +++ b/reactos/dll/win32/shell32/extracticon.c @@ -7,10 +7,9 @@ * PROGRAMMERS: Hervй Poussineau (hpoussin@reactos.org) */ -#define COBJMACROS +#include + #define CONST_VTABLE -#include -#include WINE_DEFAULT_DEBUG_CHANNEL(shell); @@ -536,10 +535,10 @@ SHCreateDefaultExtractIcon( if (!s) return E_OUTOFMEMORY; memset(s, 0, sizeof(struct IconExtraction)); - s->defaultExtractIconInitImpl.lpVtbl = &IconExtractionDefaultExtractIconInitVtbl; - s->extractIconAImpl.lpVtbl = &IconExtractionExtractIconAVtbl; - s->extractIconWImpl.lpVtbl = &IconExtractionExtractIconWVtbl; - s->persistFileImpl.lpVtbl = &IconExtractionPersistFileVtbl; + s->defaultExtractIconInitImpl.lpVtbl = (IDefaultExtractIconInitVtbl*)&IconExtractionDefaultExtractIconInitVtbl; + s->extractIconAImpl.lpVtbl = (IExtractIconAVtbl*)&IconExtractionExtractIconAVtbl; + s->extractIconWImpl.lpVtbl = (IExtractIconWVtbl*)&IconExtractionExtractIconWVtbl; + s->persistFileImpl.lpVtbl = (IPersistFileVtbl*)&IconExtractionPersistFileVtbl; s->ref = 1; *ppv = &s->defaultExtractIconInitImpl; diff --git a/reactos/dll/win32/shell32/folder_options.c b/reactos/dll/win32/shell32/folder_options.c index f7fb6c239e0..f41a02336ec 100644 --- a/reactos/dll/win32/shell32/folder_options.c +++ b/reactos/dll/win32/shell32/folder_options.c @@ -18,27 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include +#include -#define COBJMACROS -#define NONAMELESSUNION -#define NONAMELESSSTRUCT -#include "winerror.h" -#include "wine/debug.h" - -#include "windef.h" -#include "wingdi.h" -#include "pidl.h" -#include "undocshell.h" -#include "shlobj.h" -#include "objbase.h" -#include "commdlg.h" - -#include "shell32_main.h" -#include "shellfolder.h" -#include "shresdef.h" -#include "stdio.h" -#include "shlwapi.h" WINE_DEFAULT_DEBUG_CHANNEL (fprop); #define MAX_PROPERTY_SHEET_PAGE (32) @@ -60,6 +41,48 @@ typedef struct WCHAR szFolderPath[MAX_PATH]; }FOLDER_PROPERTIES_CONTEXT, *PFOLDER_PROPERTIES_CONTEXT; +typedef struct +{ + LPCWSTR szKeyName; + UINT ResourceID; +}FOLDER_VIEW_ENTRY, PFOLDER_VIEW_ENTRY; +/* +static FOLDER_VIEW_ENTRY s_Options[] = +{ + { L"AlwaysShowMenus", IDS_ALWAYSSHOWMENUS }, + { L"AutoCheckSelect", -1 }, + { L"ClassicViewState", -1 }, + { L"DontPrettyPath", -1 }, + { L"Filter", -1 }, + { L"FolderContentsInfoTip", IDS_FOLDERCONTENTSTIP }, + { L"FriendlyTree", -1 }, + { L"Hidden", -1, }, + { L"HideFileExt", IDS_HIDEFILEEXT }, + { L"HideIcons", -1}, + { L"IconsOnly", -1}, + { L"ListviewAlphaSelect", -1}, + { L"ListviewShadow", -1}, + { L"ListviewWatermark", -1}, + { L"MapNetDrvBtn", -1}, + { L"PersistBrowsers", -1}, + { L"SeperateProcess", IDS_SEPERATEPROCESS}, + { L"ServerAdminUI", -1}, + { L"SharingWizardOn", IDS_USESHAREWIZARD}, + { L"ShowCompColor", IDS_COMPCOLOR}, + { L"ShowInfoTip", IDS_SHOWINFOTIP}, + { L"ShowPreviewHandlers", -1}, + { L"ShowSuperHidden", IDS_HIDEOSFILES}, + { L"ShowTypeOverlay", -1}, + { L"Start_ShowMyGames", -1}, + { L"StartMenuInit", -1}, + { L"SuperHidden", -1}, + { L"TypeAhead", -1}, + { L"Webview", -1}, + { NULL, -1} + +}; +*/ + INT_PTR CALLBACK @@ -76,6 +99,35 @@ FolderOptionsGeneralDlg( return FALSE; } +static +VOID +InitializeFolderOptionsListCtrl(HWND hwndDlg) +{ + RECT clientRect; + LVCOLUMNW col; + WCHAR szName[50]; + HWND hDlgCtrl; + + hDlgCtrl = GetDlgItem(hwndDlg, 14003); + + if (!LoadStringW(shell32_hInstance, IDS_COLUMN_EXTENSION, szName, sizeof(szName) / sizeof(WCHAR))) + szName[0] = 0; + szName[(sizeof(szName)/sizeof(WCHAR))-1] = 0; + + GetClientRect(hDlgCtrl, &clientRect); + ZeroMemory(&col, sizeof(LV_COLUMN)); + col.mask = LVCF_SUBITEM | LVCF_WIDTH | LVCF_FMT; + col.iSubItem = 0; + col.pszText = szName; + col.fmt = LVCFMT_LEFT; + col.cx = (clientRect.right - clientRect.left) - GetSystemMetrics(SM_CXVSCROLL); + (void)SendMessageW(hDlgCtrl, LVM_INSERTCOLUMN, 0, (LPARAM)&col); + + + +} + + INT_PTR CALLBACK FolderOptionsViewDlg( @@ -85,10 +137,15 @@ FolderOptionsViewDlg( LPARAM lParam ) { - - + switch(uMsg) + { + case WM_INITDIALOG: + InitializeFolderOptionsListCtrl(hwndDlg); + return TRUE; + } return FALSE; + } VOID @@ -109,7 +166,7 @@ InitializeFileTypesListCtrlColumns(HWND hDlgCtrl) col.pszText = szName; col.fmt = LVCFMT_LEFT; col.cx = (clientRect.right - clientRect.left) - GetSystemMetrics(SM_CXVSCROLL); - (void)ListView_InsertColumnW(hDlgCtrl, 0, &col); + (void)SendMessageW(hDlgCtrl, LVM_INSERTCOLUMNW, 0, (LPARAM)&col); } INT FindItem(HWND hDlgCtrl, WCHAR * ItemName) @@ -159,7 +216,7 @@ InsertFileType(HWND hDlgCtrl, WCHAR * szName, DWORD Size, INT iItem) if (RegOpenKeyExW(HKEY_CLASSES_ROOT, szPath, 0, KEY_READ, &hKey) == ERROR_SUCCESS) { lvItem.lParam = 0; - (void)ListView_InsertItemW(hDlgCtrl, &lvItem); + (void)SendMessageW(hDlgCtrl, LVM_INSERTITEMW, 0, (LPARAM)&lvItem); RegCloseKey(hKey); } } @@ -173,12 +230,9 @@ InitializeFileTypesListCtrl(HWND hwndDlg) DWORD dwName; INT iItem = 0; - hDlgCtrl = GetDlgItem(hwndDlg, 14000); InitializeFileTypesListCtrlColumns(hDlgCtrl); - - dwName = sizeof(szName) / sizeof(WCHAR); while(RegEnumKeyExW(HKEY_CLASSES_ROOT, dwIndex++, szName, &dwName, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) @@ -206,7 +260,6 @@ FolderOptionsFileTypesDlg( return TRUE; } - return FALSE; } @@ -393,7 +446,7 @@ InitializeFolderGeneralDlg(PFOLDER_PROPERTIES_CONTEXT pContext) if (FileTimeToLocalFileTime(&FolderAttribute.ftCreationTime, &ft)) { FileTimeToSystemTime(&ft, &dt); - sprintfW (szBuffer, wFormat, dt.wDay, dt.wMonth, dt.wYear, dt.wHour, dt.wMinute); + swprintf (szBuffer, wFormat, dt.wDay, dt.wMonth, dt.wYear, dt.wHour, dt.wMinute); SendDlgItemMessageW(pContext->hwndDlg, 14015, WM_SETTEXT, 0, (LPARAM) szBuffer); } } @@ -404,7 +457,7 @@ InitializeFolderGeneralDlg(PFOLDER_PROPERTIES_CONTEXT pContext) /* set folder details */ LoadStringW(shell32_hInstance, IDS_FILE_FOLDER, szFormat, sizeof(szFormat)/sizeof(WCHAR)); szFormat[(sizeof(szFormat)/sizeof(WCHAR))-1] = L'\0'; - sprintfW(szBuffer, szFormat, pContext->cFiles, pContext->cFolder); + swprintf(szBuffer, szFormat, pContext->cFiles, pContext->cFolder); SendDlgItemMessageW(pContext->hwndDlg, 14011, WM_SETTEXT, 0, (LPARAM) szBuffer); if (StrFormatByteSizeW(pContext->bSize.QuadPart, szBuffer, sizeof(szBuffer)/sizeof(WCHAR))) diff --git a/reactos/dll/win32/shell32/folders.c b/reactos/dll/win32/shell32/folders.c index e0bf151f0dc..3c0532750a3 100644 --- a/reactos/dll/win32/shell32/folders.c +++ b/reactos/dll/win32/shell32/folders.c @@ -17,29 +17,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - -#include -#include -#include -#include - -#define COBJMACROS - -#include "windef.h" -#include "winbase.h" -#include "winerror.h" -#include "objbase.h" -#include "undocshell.h" -#include "shlguid.h" - -#include "wine/debug.h" - -#include "pidl.h" -#include "shell32_main.h" -#include "shfldr.h" -#include "shresdef.h" +#include WINE_DEFAULT_DEBUG_CHANNEL(shell); @@ -63,7 +41,7 @@ static HRESULT getIconLocationForFolder(LPCITEMIDLIST pidl, UINT uFlags, WCHAR wszIconIndex[10]; SHELL32_GetCustomFolderAttribute(pidl, shellClassInfo, iconIndex, wszIconIndex, 10); - *piIndex = atoiW(wszIconIndex); + *piIndex = _wtoi(wszIconIndex); } else if (SHELL32_GetCustomFolderAttribute(pidl, shellClassInfo, clsid, wszCLSIDValue, CHARS_IN_GUID) && @@ -133,7 +111,7 @@ IExtractIconW* IExtractIconW_Constructor(LPCITEMIDLIST pidl) '%','0','2','x','%','0','2','x','%','0','2','x','%','0','2','x','}',0 }; WCHAR xriid[50]; - sprintfW(xriid, fmt, + swprintf(xriid, fmt, riid->Data1, riid->Data2, riid->Data3, riid->Data4[0], riid->Data4[1], riid->Data4[2], riid->Data4[3], riid->Data4[4], riid->Data4[5], riid->Data4[6], riid->Data4[7]); @@ -291,8 +269,9 @@ IExtractIconA* IExtractIconA_Constructor(LPCITEMIDLIST pidl) extractIconW = IExtractIconW_Constructor(pidl); if (!extractIconW) return NULL; - hr = IExtractIconW_QueryInterface(extractIconW, &IID_IExtractIconA, (void **)&extractIconA); - IExtractIconW_Release(extractIconW); + + hr = extractIconW->lpVtbl->QueryInterface(extractIconW, &IID_IExtractIconA, (void **)&extractIconA); + extractIconW->lpVtbl->Release(extractIconW); if (!SUCCEEDED(hr)) return NULL; return extractIconA; diff --git a/reactos/dll/win32/shell32/fprop.c b/reactos/dll/win32/shell32/fprop.c index 6cb44310181..f5643ba5b9d 100644 --- a/reactos/dll/win32/shell32/fprop.c +++ b/reactos/dll/win32/shell32/fprop.c @@ -18,30 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#define COBJMACROS -#define NONAMELESSUNION - -#include "config.h" -#include "wine/port.h" -#include -#include -#include -#include "winerror.h" -#include "windef.h" -#include "winbase.h" -#include "winreg.h" -#include "wingdi.h" -#include "winuser.h" -#include "commdlg.h" -#include "wine/debug.h" - -#include "shellapi.h" -#include -#include "shlobj.h" -#include "shell32_main.h" -#include "shresdef.h" -#include "undocshell.h" -#include "prsht.h" +#include WINE_DEFAULT_DEBUG_CHANNEL(shell); @@ -138,7 +115,7 @@ SH_FileGeneralSetFileType(HWND hwndDlg, WCHAR * filext) { /* the fileextension is unknown, so default to string "FileExtension File" */ SendMessageW(hDlgCtrl, WM_GETTEXT, (WPARAM)MAX_PATH, (LPARAM)value); - sprintfW(name, value, &filext[1]); + swprintf(name, value, &filext[1]); SendMessageW(hDlgCtrl, WM_SETTEXT, (WPARAM)NULL, (LPARAM)name); return TRUE; } @@ -230,7 +207,7 @@ SHFileGeneralGetFileTimeString(LPFILETIME lpFileTime, WCHAR * lpResult) wYear = dt.wYear; /* ddmmyy */ - sprintfW (lpResult, wFormat, dt.wDay, dt.wMonth, wYear, dt.wHour, dt.wMinute); + swprintf (lpResult, wFormat, dt.wDay, dt.wMonth, wYear, dt.wHour, dt.wMinute); TRACE("result %s\n",debugstr_w(lpResult)); return TRUE; @@ -256,15 +233,15 @@ SH_FileGeneralSetText(HWND hwndDlg, WCHAR * lpstr) if (lpstr == NULL) return FALSE; - lpdir = strrchrW(lpstr, '\\'); /* find the last occurence of '\\' */ + lpdir = wcschr(lpstr, '\\'); /* find the last occurence of '\\' */ - plength = strlenW(lpstr); - flength = strlenW(lpdir); + plength = wcslen(lpstr); + flength = wcslen(lpdir); if (lpdir) { /* location text field */ - strncpyW(buff, lpstr, plength - flength); + wcsncpy(buff, lpstr, plength - flength); buff[plength - flength] = UNICODE_NULL; hDlgCtrl = GetDlgItem(hwndDlg, 14009); SendMessageW(hDlgCtrl, WM_SETTEXT, (WPARAM)NULL, (LPARAM)buff); @@ -273,7 +250,7 @@ SH_FileGeneralSetText(HWND hwndDlg, WCHAR * lpstr) if(flength > 1) { /* text filename field */ - strncpyW(buff, &lpdir[1], flength); + wcsncpy(buff, &lpdir[1], flength); hDlgCtrl = GetDlgItem(hwndDlg, 14001); SendMessageW(hDlgCtrl, WM_SETTEXT, (WPARAM)NULL, (LPARAM)buff); } @@ -412,7 +389,7 @@ SH_FileVersionQuerySetListText(HWND hwndDlg, LPVOID pInfo, const WCHAR * text, W if(hwndDlg == NULL || resptr == NULL || text == NULL) return FALSE; - sprintfW(buff, wFormat, lang, code, text); + swprintf(buff, wFormat, lang, code, text); if(VerQueryValueW(pInfo, buff, (LPVOID *)resptr, &reslen)) { /* listbox name property */ @@ -483,7 +460,7 @@ SH_FileVersionInitialize(HWND hwndDlg, WCHAR * lpfilename) if(VerQueryValueW(pBuf, wSlash, &info, &infolen)) { VS_FIXEDFILEINFO * inf = (VS_FIXEDFILEINFO *)info; - sprintfW(buff, wVersionFormat, HIWORD(inf->dwFileVersionMS), + swprintf(buff, wVersionFormat, HIWORD(inf->dwFileVersionMS), LOWORD(inf->dwFileVersionMS), HIWORD(inf->dwFileVersionLS), LOWORD(inf->dwFileVersionLS)); @@ -502,10 +479,10 @@ SH_FileVersionInitialize(HWND hwndDlg, WCHAR * lpfilename) code = lplangcode->code; } - sprintfW(buff, wFileDescriptionFormat, lang, code); + swprintf(buff, wFileDescriptionFormat, lang, code); SH_FileVersionQuerySetText(hwndDlg, 14003, pBuf, buff, &str); - sprintfW(buff, wLegalCopyrightFormat, lang, code); + swprintf(buff, wLegalCopyrightFormat, lang, code); SH_FileVersionQuerySetText(hwndDlg, 14005, pBuf, buff, &str); /* listbox properties */ @@ -638,7 +615,7 @@ SH_FileGeneralDlgProc( /* set general text properties filename filelocation and icon */ SH_FileGeneralSetText(hwndDlg, lpstr); /* enumerate file extension from registry and application which opens it*/ - SH_FileGeneralSetFileType(hwndDlg, strrchrW(lpstr, '.')); + SH_FileGeneralSetFileType(hwndDlg, wcsrchr(lpstr, '.')); /* set file time create/modfied/accessed */ SH_FileGeneralSetFileSizeTime(hwndDlg, lpstr, NULL); return TRUE; @@ -650,26 +627,21 @@ SH_FileGeneralDlgProc( BOOL CALLBACK AddShellPropSheetExCallback(HPROPSHEETPAGE hPage, LPARAM lParam) { - UINT iIndex; - HPROPSHEETPAGE * hppages = (HPROPSHEETPAGE *)lParam; + PROPSHEETHEADERW *pinfo = (PROPSHEETHEADERW *)lParam; - TRACE("AddShellPropSheetExCallback called\n"); - for(iIndex = 0; iIndex < MAX_PROPERTY_SHEET_PAGE; iIndex++) + if (pinfo->nPages < MAX_PROPERTY_SHEET_PAGE) { - if (hppages[iIndex] == NULL) - { - hppages[iIndex] = hPage; - return TRUE; - } + pinfo->u3.phpage[pinfo->nPages++] = hPage; + return TRUE; } return FALSE; } int -EnumPropSheetExt(LPWSTR wFileName, HPROPSHEETPAGE * hppages, int NumPages, HPSXA * hpsxa, IDataObject *pDataObj) +EnumPropSheetExt(LPWSTR wFileName, PROPSHEETHEADERW *pinfo, int NumPages, HPSXA * hpsxa, IDataObject *pDataObj) { - WCHAR szName[100]; + WCHAR szName[MAX_PATH] = {0}; WCHAR * pOffset; UINT Length; DWORD dwName; @@ -680,7 +652,7 @@ EnumPropSheetExt(LPWSTR wFileName, HPROPSHEETPAGE * hppages, int NumPages, HPSXA if (!pOffset) { Length = wcslen(szName); - if (Length >=94) + if (Length + 6 > sizeof(szName)/sizeof(szName[0])) return 0; if (CLSIDFromString(wFileName, &clsid) == NOERROR) @@ -696,13 +668,13 @@ EnumPropSheetExt(LPWSTR wFileName, HPROPSHEETPAGE * hppages, int NumPages, HPSXA else { Length = wcslen(pOffset); - if (Length >= 100) + if (Length >= sizeof(szName)/sizeof(szName[0])) return 0; wcscpy(szName, pOffset); } TRACE("EnumPropSheetExt szName %s\n", debugstr_w(szName)); hpsxa[0] = SHCreatePropSheetExtArrayEx(HKEY_CLASSES_ROOT, szName, NumPages, pDataObj); - Pages = SHAddFromPropSheetExtArray(hpsxa[0], AddShellPropSheetExCallback, (LPARAM)hppages); + Pages = SHAddFromPropSheetExtArray(hpsxa[0], AddShellPropSheetExCallback, (LPARAM)pinfo); if (pOffset) @@ -714,7 +686,7 @@ EnumPropSheetExt(LPWSTR wFileName, HPROPSHEETPAGE * hppages, int NumPages, HPSXA TRACE("EnumPropSheetExt szName %s, pOffset %s\n", debugstr_w(szName), debugstr_w(pOffset)); szName[(sizeof(szName)/sizeof(WCHAR))-1] = L'\0'; hpsxa[1] = SHCreatePropSheetExtArrayEx(HKEY_CLASSES_ROOT, szName, NumPages - Pages, pDataObj); - Pages +=SHAddFromPropSheetExtArray(hpsxa[1], AddShellPropSheetExCallback, (LPARAM)hppages); + Pages +=SHAddFromPropSheetExtArray(hpsxa[1], AddShellPropSheetExCallback, (LPARAM)pinfo); } } return Pages; @@ -735,19 +707,15 @@ EnumPropSheetExt(LPWSTR wFileName, HPROPSHEETPAGE * hppages, int NumPages, HPSXA */ BOOL -SH_ShowPropertiesDialog(PCWSTR lpf) +SH_ShowPropertiesDialog(WCHAR * lpf, LPCITEMIDLIST pidlFolder, LPCITEMIDLIST * apidl) { PROPSHEETHEADERW pinfo; HPROPSHEETPAGE hppages[MAX_PROPERTY_SHEET_PAGE]; - HPROPSHEETPAGE hpage; WCHAR wFileName[MAX_PATH]; - UINT num_pages = 0; DWORD dwHandle = 0; WCHAR * pFileName; HPSXA hpsxa[2]; INT_PTR res; - LPITEMIDLIST pidlChild, pidlFolder; - WCHAR szTemp[MAX_PATH]; IDataObject* pDataObj = NULL; HRESULT hResult; @@ -756,7 +724,7 @@ SH_ShowPropertiesDialog(PCWSTR lpf) if (lpf== NULL) return FALSE; - if ( !strlenW(lpf) ) + if ( !wcslen(lpf) ) return FALSE; memset(hppages, 0x0, sizeof(HPROPSHEETPAGE) * MAX_PROPERTY_SHEET_PAGE); @@ -773,7 +741,7 @@ SH_ShowPropertiesDialog(PCWSTR lpf) } else { - strcpyW(wFileName, lpf); + wcscpy(wFileName, lpf); } if (PathIsDirectoryW(wFileName)) @@ -783,45 +751,9 @@ SH_ShowPropertiesDialog(PCWSTR lpf) if (wcslen(wFileName) == 3) { - return SH_ShowDriveProperties(wFileName); + return SH_ShowDriveProperties(wFileName, pidlFolder, apidl); } - wcscpy(szTemp, wFileName); - pFileName = wcsrchr(szTemp, '\\'); - if (pFileName) - { - pFileName[0] = L'\0'; - pFileName++; - pidlChild = ILCreateFromPathW(pFileName); - pidlFolder = ILCreateFromPathW(szTemp); - if (pidlChild && pidlFolder) - { - hResult = SHCreateDataObject(pidlFolder, 1, (LPCITEMIDLIST*)&pidlChild, NULL, &IID_IDataObject, (LPVOID*)&pDataObj); - ILFree(pidlChild); - ILFree(pidlFolder); - if (hResult != S_OK) - pDataObj = NULL; - } - } - - - hpage = SH_CreatePropertySheetPage("SHELL_FILE_GENERAL_DLG", SH_FileGeneralDlgProc, (LPARAM)wFileName, NULL); - - if (hpage == NULL) - return FALSE; - - hppages[num_pages] = hpage; - num_pages++; - num_pages += EnumPropSheetExt(wFileName, hppages, MAX_PROPERTY_SHEET_PAGE-1, hpsxa, pDataObj); - - if ( GetFileVersionInfoSizeW(lpf, &dwHandle) && num_pages) - { - if ( (hpage = SH_CreatePropertySheetPage("SHELL_FILE_VERSION_DLG",SH_FileVersionDlgProc, (LPARAM)wFileName, NULL))!= NULL) - { - hppages[num_pages] = hpage; - num_pages++; - } - } pFileName = wcsrchr(wFileName, '\\'); if (!pFileName) @@ -833,17 +765,39 @@ SH_ShowPropertiesDialog(PCWSTR lpf) memset(&pinfo, 0x0, sizeof(PROPSHEETHEADERW)); pinfo.dwSize = sizeof(PROPSHEETHEADERW); pinfo.dwFlags = PSH_NOCONTEXTHELP | PSH_PROPTITLE; - pinfo.nPages = num_pages; pinfo.u3.phpage = hppages; pinfo.pszCaption = pFileName; - TRACE("SH_ShowPropertiesDialog pages %u\n", num_pages); + hppages[pinfo.nPages] = SH_CreatePropertySheetPage("SHELL_FILE_GENERAL_DLG", SH_FileGeneralDlgProc, (LPARAM)wFileName, NULL); + if (hppages[pinfo.nPages]) + pinfo.nPages++; + + + hResult = SHCreateDataObject(pidlFolder, 1, apidl, NULL, &IID_IDataObject, (LPVOID*)&pDataObj); + if (hResult == S_OK) + { + if (!EnumPropSheetExt(wFileName, &pinfo, MAX_PROPERTY_SHEET_PAGE-1, hpsxa, pDataObj)) + { + hpsxa[0] = NULL; + hpsxa[1] = NULL; + } + } + + if ( GetFileVersionInfoSizeW(lpf, &dwHandle)) + { + hppages[pinfo.nPages] = SH_CreatePropertySheetPage("SHELL_FILE_VERSION_DLG",SH_FileVersionDlgProc, (LPARAM)wFileName, NULL); + if (hppages[pinfo.nPages]) + pinfo.nPages++; + } + res = PropertySheetW(&pinfo); - SHDestroyPropSheetExtArray(hpsxa[0]); - SHDestroyPropSheetExtArray(hpsxa[1]); - if (pDataObj) + if (hResult == S_OK) + { + SHDestroyPropSheetExtArray(hpsxa[0]); + SHDestroyPropSheetExtArray(hpsxa[1]); IDataObject_Release(pDataObj); + } return (res != -1); } diff --git a/reactos/dll/win32/shell32/icon_res.rc b/reactos/dll/win32/shell32/icon_res.rc index 16b2fe41d0f..e3d52e077f4 100644 --- a/reactos/dll/win32/shell32/icon_res.rc +++ b/reactos/dll/win32/shell32/icon_res.rc @@ -56,6 +56,15 @@ IDI_SHELL_RUN2 ICON "res/icons/160.ico" // "res/icons/161.ico" IDI_SHELL_NETWORK_FOLDER ICON "res/icons/172.ico" // "res/icons/173.ico" + +// Folder Options, General dialog +IDI_SHELL_SHOW_COMMON_TASKS ICON "res/icons/182.ico" +IDI_SHELL_CLASSIC_FOLDERS ICON "res/icons/183.ico" +IDI_SHELL_OPEN_IN_SOME_WINDOW ICON "res/icons/184.ico" +IDI_SHELL_OPEN_IN_NEW_WINDOW ICON "res/icons/185.ico" +IDI_SHELL_SINGLE_CLICK_TO_OPEN ICON "res/icons/186.ico" +IDI_SHELL_DOUBLE_CLICK_TO_OPEN ICON "res/icons/187.ico" + IDI_SHELL_EMPTY_RECYCLE_BIN1 ICON "res/icons/191.ico" IDI_SHELL_FULL_RECYCLE_BIN1 ICON "res/icons/192.ico" // "res/icons/210.ico" diff --git a/reactos/dll/win32/shell32/iconcache.c b/reactos/dll/win32/shell32/iconcache.c index e1509e4d5c6..5e03f9ab43d 100644 --- a/reactos/dll/win32/shell32/iconcache.c +++ b/reactos/dll/win32/shell32/iconcache.c @@ -18,31 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - -#include -#include -#include -#ifdef HAVE_UNISTD_H -# include -#endif - -#define COBJMACROS - -#include "windef.h" -#include "winbase.h" -#include "wingdi.h" -#include "winuser.h" -#include "winreg.h" -#include "wine/debug.h" - -#include "shellapi.h" -#include "objbase.h" -#include "pidl.h" -#include "shell32_main.h" -#include "undocshell.h" -#include "shresdef.h" +#include WINE_DEFAULT_DEBUG_CHANNEL(shell); @@ -89,7 +65,7 @@ static INT CALLBACK SIC_CompareEntries( LPVOID p1, LPVOID p2, LPARAM lparam) (e1->dwFlags & GIL_FORSHORTCUT) != (e2->dwFlags & GIL_FORSHORTCUT)) return 1; - if (strcmpiW(e1->sSourceFile,e2->sSourceFile)) + if (wcsicmp(e1->sSourceFile,e2->sSourceFile)) return 1; return 0; @@ -263,8 +239,8 @@ static INT SIC_IconAppend (LPCWSTR sSourceFile, INT dwSourceIndex, HICON hSmallI lpsice = (LPSIC_ENTRY) SHAlloc (sizeof (SIC_ENTRY)); GetFullPathNameW(sSourceFile, MAX_PATH, path, NULL); - lpsice->sSourceFile = HeapAlloc( GetProcessHeap(), 0, (strlenW(path)+1)*sizeof(WCHAR) ); - strcpyW( lpsice->sSourceFile, path ); + lpsice->sSourceFile = HeapAlloc( GetProcessHeap(), 0, (wcslen(path)+1)*sizeof(WCHAR) ); + wcscpy( lpsice->sSourceFile, path ); lpsice->dwSourceIndex = dwSourceIndex; lpsice->dwFlags = dwFlags; @@ -501,18 +477,18 @@ static int SIC_LoadOverlayIcon(int icon_idx) { DWORD count = sizeof(buffer); - sprintfW(wszIdx, wszNumFmt, icon_idx); + swprintf(wszIdx, wszNumFmt, icon_idx); /* read icon path and index */ if (RegQueryValueExW(hKeyShellIcons, wszIdx, NULL, NULL, (LPBYTE)buffer, &count) == ERROR_SUCCESS) { - LPWSTR p = strchrW(buffer, ','); + LPWSTR p = wcschr(buffer, ','); if (p) *p++ = 0; iconPath = buffer; - iconIdx = atoiW(p); + iconIdx = _wtoi(p); } RegCloseKey(hKeyShellIcons); @@ -568,12 +544,12 @@ BOOL PidlToSicIndex ( if (SUCCEEDED (IShellFolder_GetUIObjectOf(sh, 0, 1, &pidl, &IID_IExtractIconW, 0, (void **)&ei))) { - if (SUCCEEDED(IExtractIconW_GetIconLocation(ei, uFlags, szIconFile, MAX_PATH, &iSourceIndex, &dwFlags))) + if (SUCCEEDED(ei->lpVtbl->GetIconLocation(ei, uFlags, szIconFile, MAX_PATH, &iSourceIndex, &dwFlags))) { *pIndex = SIC_GetIconIndex(szIconFile, iSourceIndex, uFlags); ret = TRUE; } - IExtractIconW_Release(ei); + ei->lpVtbl->Release(ei); } if (INVALID_INDEX == *pIndex) /* default icon when failed */ @@ -646,7 +622,7 @@ HRESULT WINAPI SHMapIDListToImageListIndexAsync(IUnknown *pts, IShellFolder *psf * Shell_GetCachedImageIndex [SHELL32.72] * */ -INT WINAPI Shell_GetCachedImageIndexA(LPCSTR szPath, INT nIndex, BOOL bSimulateDoc) +INT WINAPI Shell_GetCachedImageIndexA(LPCSTR szPath, INT nIndex, UINT bSimulateDoc) { INT ret, len; LPWSTR szTemp; @@ -664,7 +640,7 @@ INT WINAPI Shell_GetCachedImageIndexA(LPCSTR szPath, INT nIndex, BOOL bSimulateD return ret; } -INT WINAPI Shell_GetCachedImageIndexW(LPCWSTR szPath, INT nIndex, BOOL bSimulateDoc) +INT WINAPI Shell_GetCachedImageIndexW(LPCWSTR szPath, INT nIndex, UINT bSimulateDoc) { WARN("(%s,%08x,%08x) semi-stub.\n",debugstr_w(szPath), nIndex, bSimulateDoc); @@ -777,7 +753,7 @@ HICON WINAPI ExtractAssociatedIconW(HINSTANCE hInst, LPWSTR lpIconPath, LPWORD l HINSTANCE uRet = FindExecutableW(lpIconPath,NULL,tempPath); if( uRet > (HINSTANCE)32 && tempPath[0] ) - { lstrcpyW(lpIconPath,tempPath); + { wcscpy(lpIconPath,tempPath); hIcon = ExtractIconW(hInst, lpIconPath, *lpiIcon); if( hIcon > (HICON)2 ) return hIcon; diff --git a/reactos/dll/win32/shell32/lang/bg-BG.rc b/reactos/dll/win32/shell32/lang/bg-BG.rc index e8281537cf5..a56669c98fa 100644 --- a/reactos/dll/win32/shell32/lang/bg-BG.rc +++ b/reactos/dll/win32/shell32/lang/bg-BG.rc @@ -143,7 +143,7 @@ IDD_SHELL_ABOUT_AUTHORS DIALOGEX MOVEABLE DISCARDABLE 35, 90, 235, 85 STYLE DS_SHELLFONT | WS_CHILD FONT 8, "MS Shell Dlg" BEGIN - LTEXT "Реактос достигна до вас, благодарение на:", IDC_STATIC, 0, 0, 250, 10 + LTEXT "РеактОС достигна до вас, благодарение на:", IDC_STATIC, 0, 0, 250, 10 LISTBOX IDC_SHELL_ABOUT_AUTHORS_LISTBOX, 0, 10, 165, 75 END @@ -206,18 +206,18 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN ICON "", 14000, 10, 3, 30, 30, WS_VISIBLE EDITTEXT 14001, 70, 9, 158, 14, ES_LEFT | ES_READONLY - LTEXT "Type of file:", 14004, 8, 35, 50, 10 - LTEXT "Folder", 14005, 68, 35, 160, 10 - LTEXT "Location:", 14006, 8, 53, 50, 10 + LTEXT "Вид на файла:", 14004, 8, 35, 50, 10 + LTEXT "Папка", 14005, 68, 35, 160, 10 + LTEXT "Място:", 14006, 8, 53, 50, 10 LTEXT "", 14007, 68, 53, 315, 10 - LTEXT "Size:", 14008, 8, 72, 45, 10 + LTEXT "Размер:", 14008, 8, 72, 45, 10 LTEXT "", 14009, 68, 72, 315, 10 - LTEXT "Contains:", 14010, 8, 93, 45, 10 + LTEXT "Съдържа:", 14010, 8, 93, 45, 10 LTEXT "", 14011, 68, 93, 160, 10 - LTEXT "Created:", 14014, 8, 118, 45, 10 + LTEXT "Създадено:", 14014, 8, 118, 45, 10 LTEXT "", 14015, 68, 118, 160, 10 - AUTOCHECKBOX "&Read-only", 14021, 45, 150, 67, 10 - AUTOCHECKBOX "&Hidden", 14022, 126, 150, 50, 10 + AUTOCHECKBOX "&Само за четене", 14021, 45, 150, 67, 10 + AUTOCHECKBOX "&Скрит", 14022, 126, 150, 50, 10 END SHELL_FILE_GENERAL_DLG DIALOGEX 0, 0, 240, 205 @@ -377,22 +377,21 @@ STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION CAPTION "Общи" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - -GROUPBOX "Задачи", -1, 7, 10, 249, 45 -//ICON -AUTORADIOBUTTON "Показване на общите задачи в папките", 14001, 20, 25, 210, 10, WS_TABSTOP -AUTORADIOBUTTON "Използване на обичайните папки на Windows", 14002, 20, 37, 210, 10, WS_TABSTOP -GROUPBOX "Обзор на папките", -1, 7, 60, 249, 45, WS_TABSTOP -//ICON -AUTORADIOBUTTON "Отваряне на всички папки в &един прозорец", 14004, 20, 70, 210, 10, WS_TABSTOP -AUTORADIOBUTTON "Отваряне на всяка папка в от&делен прозорец", 14005, 20, 82, 210, 10, WS_TABSTOP -GROUPBOX "Цъкането действа така:", -1, 7, 110, 249, 60 -//ICON -AUTORADIOBUTTON "&Отваряне с единично цъкане (избор с посочване)", 14007, 20, 120, 210, 10, WS_TABSTOP -AUTORADIOBUTTON "Подчертаване заглавията на значетата съгласно &обзорника ми", 14008, 30, 220, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Подчертаване на заглавията на значетата при &посочване", 14009, 30, 144, 220, 10, WS_TABSTOP -AUTORADIOBUTTON "&Отваряне с двойно цъкане (избиране с единично)", 14010, 20, 156, 170, 10, WS_TABSTOP -PUSHBUTTON "От под&разбираните", 14011, 160, 180, 75, 14, WS_TABSTOP + GROUPBOX "Задачи", -1, 7, 10, 249, 45 + ICON "", 30109, 14, 25, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Показване на общите задачи в папките", 14001, 20, 25, 210, 10, WS_TABSTOP + AUTORADIOBUTTON "Използване на обичайните папки на Windows", 14002, 20, 37, 210, 10, WS_TABSTOP + GROUPBOX "Обзор на папките", -1, 7, 60, 249, 45, WS_TABSTOP + ICON "", 30110, 14, 70, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Отваряне на всички папки в &един прозорец", 14004, 20, 70, 210, 10, WS_TABSTOP + AUTORADIOBUTTON "Отваряне на всяка папка в от&делен прозорец", 14005, 20, 82, 210, 10, WS_TABSTOP + GROUPBOX "Цъкането действа така:", -1, 7, 110, 249, 60 + ICON "", 30111, 14, 120, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "&Отваряне с единично цъкане (избор с посочване)", 14007, 20, 120, 210, 10, WS_TABSTOP + AUTORADIOBUTTON "Подчертаване заглавията на значетата съгласно &обзорника ми", 14008, 30, 220, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Подчертаване на заглавията на значетата при &посочване", 14009, 30, 144, 220, 10, WS_TABSTOP + AUTORADIOBUTTON "&Отваряне с двойно цъкане (избиране с единично)", 14010, 20, 156, 170, 10, WS_TABSTOP + PUSHBUTTON "От под&разбираните", 14011, 160, 180, 75, 14, WS_TABSTOP END FOLDER_OPTIONS_VIEW_DLG DIALOGEX 0, 0, 264, 256 @@ -529,8 +528,6 @@ BEGIN PUSHBUTTON "Отказ", IDCANCEL, 159, 160, 60, 14 END - - SHUTDOWN_DLG DIALOGEX 0, 0, 211, 103 STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION CAPTION "Изключване на РеактОС" @@ -566,17 +563,17 @@ BEGIN AUTOCHECKBOX "&Използване на уплътняване", 28675, 16, 152, 155, 10 END -CHKDSK_DLG DIALOGEX 50, 50, 194, 120 +CHKDSK_DLG DIALOGEX 50, 50, 244, 120 STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION -CAPTION "Check Disk" +CAPTION "Проверка на диска" FONT 8, "MS Shell Dlg" BEGIN - DEFPUSHBUTTON "Start", IDOK, 53, 100, 60, 14 - GROUPBOX "Check disk options", -1, 7, 6, 179, 50 - PUSHBUTTON "Cancel", IDCANCEL, 118, 100, 60, 14 - AUTOCHECKBOX "Automatically fix file system errors", 14000, 16, 15, 155, 10 - AUTOCHECKBOX "&Scan for and attempt recovery of bad sectors", 14001, 16, 30, 165, 10 - CONTROL "", 14002, "MSCTLS_PROGRESS32", 16, 7, 60, 170, 8 + DEFPUSHBUTTON "Начало", IDOK, 53, 100, 60, 14 + GROUPBOX "Настройки за проверката", -1, 7, 6, 229, 50 + PUSHBUTTON "Отказ", IDCANCEL, 118, 100, 60, 14 + AUTOCHECKBOX "Самопоправяне на системните грешки на файловете", 14000, 16, 15, 210, 10 + AUTOCHECKBOX "Об&хождане и опит за възстановяване на лошите сектори", 14001, 16, 30, 210, 10 + CONTROL "", 14002, "MSCTLS_PROGRESS32", 16, 42, 60, 170, 8 LTEXT "", 14003, 60, 80, 170, 10 END @@ -609,25 +606,25 @@ BEGIN IDS_SHV_COLUMN9 "Забележки" IDS_SHV_COLUMN10 "Собственик" IDS_SHV_COLUMN11 "Група" - IDS_SHV_COLUMN12 "Filename" - IDS_SHV_COLUMN13 "Category" + IDS_SHV_COLUMN12 "Файлово име" + IDS_SHV_COLUMN13 "Раздел" IDS_SHV_COLUMN_DELFROM "Първоначално място" IDS_SHV_COLUMN_DELDATE "Дата на изтриване" - IDS_SHV_COLUMN_FONTTYPE "Fonttype" - IDS_SHV_COLUMN_WORKGROUP "Workgroup" - IDS_SHV_NETWORKLOCATION "Network Location" - IDS_SHV_COLUMN_DOCUMENTS "Documents" - IDS_SHV_COLUMN_STATUS "Status" - IDS_SHV_COLUMN_COMMENTS "Comments" - IDS_SHV_COLUMN_LOCATION "Location" - IDS_SHV_COLUMN_MODEL "Model" + IDS_SHV_COLUMN_FONTTYPE "Вид шрифт" + IDS_SHV_COLUMN_WORKGROUP "Работна група" + IDS_SHV_NETWORKLOCATION "Място в мрежата" + IDS_SHV_COLUMN_DOCUMENTS "Книжа" + IDS_SHV_COLUMN_STATUS "Състояние" + IDS_SHV_COLUMN_COMMENTS "Забележки" + IDS_SHV_COLUMN_LOCATION "Място" + IDS_SHV_COLUMN_MODEL "Модел" // special folders IDS_DESKTOP "Работна площ" IDS_MYCOMPUTER "Моят компютър" IDS_RECYCLEBIN_FOLDER_NAME "Кошче" IDS_CONTROLPANEL "Крило за управление" - IDS_ADMINISTRATIVETOOLS "Administrative Tools" + IDS_ADMINISTRATIVETOOLS "Управленски средства" // context menus IDS_VIEW_LARGE "&Големи значета" @@ -641,7 +638,10 @@ BEGIN IDS_DELETE "Из&триване" IDS_PROPERTIES "&Свойства" IDS_CUT "Из&рязване" - IDS_RESTORE "Restore" + IDS_RESTORE "Възвръщане" + IDS_FORMATDRIVE "Оразмеряване..." + IDS_RENAME "Преименуване" + IDS_INSERT "Вмъкване" IDS_CREATEFOLDER_DENIED "Създаването на нова папка е невъзможно: недостатъчни права." IDS_CREATEFOLDER_CAPTION "Грешка при създаване на нова папка" @@ -719,36 +719,36 @@ BEGIN IDS_PICK_ICON_FILTER "Файлове със значета(*.ico, *.icl, *.exe, *.dll)\0*.ico;*.icl;*.exe;*.dll\0" IDS_OPEN_WITH_FILTER "Изпълними файлове\0*.exe\0" IDS_DIRECTORY "Папка" - IDS_VIRTUAL_DRIVER "Virtual Device Driver" - IDS_BAT_FILE "ReactOS Batch File" - IDS_CMD_FILE "ReactOS Command Script" - IDS_COM_FILE "Dos Application" - IDS_CPL_FILE "Control Panel Item" - IDS_CUR_FILE "Cursor" - IDS_DLL_FILE "Application Extension" - IDS_DRV_FILE "Device Driver" - IDS_EXE_FILE "Application" - IDS_FON_FILE "Font file" - IDS_TTF_FILE "TrueType Font file" - IDS_HLP_FILE "Help File" - IDS_INI_FILE "Configuration Settings" - IDS_LNK_FILE "Shortcut" - IDS_SYS_FILE "System file" + IDS_VIRTUAL_DRIVER "Водач на привидно устройство" + IDS_BAT_FILE "Пакетен файл на РеактОС" + IDS_CMD_FILE "Писание за управление на РеактОС" + IDS_COM_FILE "Приложение за ДОС" + IDS_CPL_FILE "Предмет от крилото за управление" + IDS_CUR_FILE "Показалец" + IDS_DLL_FILE "Разширение за приложения" + IDS_DRV_FILE "Водача на устройство" + IDS_EXE_FILE "Приложение" + IDS_FON_FILE "Шрифтов файл" + IDS_TTF_FILE "Файл с шрифт TrueType " + IDS_HLP_FILE "Помощен файл" + IDS_INI_FILE "Настроечен файл" + IDS_LNK_FILE "Препратка" + IDS_SYS_FILE "Системен файл" - IDS_OPEN_VERB "Open" - IDS_RUNAS_VERB "Run as " - IDS_EDIT_VERB "Edit" - IDS_FIND_VERB "Find" - IDS_PRINT_VERB "Print" - IDS_PLAY_VERB "Play" - IDS_PREVIEW_VERB "Preview" + IDS_OPEN_VERB "Отваряне" + IDS_RUNAS_VERB "Изпълняване като " + IDS_EDIT_VERB "Обработка" + IDS_FIND_VERB "Търсене" + IDS_PRINT_VERB "Разпечатване" + IDS_PLAY_VERB "Възпроизвеждане" + IDS_PREVIEW_VERB "Преглед" - IDS_FILE_FOLDER "%u Files, %u Folders" - IDS_PRINTERS "Printers" - IDS_FONTS "Fonts" - IDS_INSTALLNEWFONT "Install New Font..." + IDS_FILE_FOLDER "%u файла, %u папки" + IDS_PRINTERS "Печатачи" + IDS_FONTS "Шрифтове" + IDS_INSTALLNEWFONT "Слагане на нов шрифт..." - IDS_DEFAULT_CLUSTER_SIZE "Default allocation size" + IDS_DEFAULT_CLUSTER_SIZE "Подразбиран разпределителен размер" END diff --git a/reactos/dll/win32/shell32/lang/ca-ES.rc b/reactos/dll/win32/shell32/lang/ca-ES.rc index 7a93e48c92b..6626a801e8e 100644 --- a/reactos/dll/win32/shell32/lang/ca-ES.rc +++ b/reactos/dll/win32/shell32/lang/ca-ES.rc @@ -378,22 +378,21 @@ STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION CAPTION "General" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - -GROUPBOX "Tasks", -1, 7, 10, 249, 45 -//ICON -AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP -AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP -GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP -//ICON -AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP -AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP -GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 -//ICON -AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP -PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP + GROUPBOX "Tasks", -1, 7, 10, 249, 45 + ICON "", 30109, 14, 25, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP + AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP + GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP + ICON "", 30110, 14, 70, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP + AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP + GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 + ICON "", 30111, 14, 120, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP + PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP END FOLDER_OPTIONS_VIEW_DLG DIALOGEX 0, 0, 264, 256 @@ -639,6 +638,9 @@ BEGIN IDS_PROPERTIES "Properties" IDS_CUT "Cut" IDS_RESTORE "Restore" + IDS_FORMATDRIVE "Format..." + IDS_RENAME "Rename" + IDS_INSERT "Insert" IDS_CREATEFOLDER_DENIED "Unable to create new Folder: Permission denied." IDS_CREATEFOLDER_CAPTION "Error during creation of a new folder" diff --git a/reactos/dll/win32/shell32/lang/cs-CZ.rc b/reactos/dll/win32/shell32/lang/cs-CZ.rc index 49b5605cccf..c70abea1d04 100644 --- a/reactos/dll/win32/shell32/lang/cs-CZ.rc +++ b/reactos/dll/win32/shell32/lang/cs-CZ.rc @@ -380,22 +380,21 @@ STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION CAPTION "Obecnй" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - -GROUPBOX "Ъkoly", -1, 7, 10, 249, 45 -//ICON -AUTORADIOBUTTON "&Zobrazit bмћnй operace ve sloћkбch", 14001, 40, 25, 120, 10, WS_TABSTOP -AUTORADIOBUTTON "Pouћнt klas&ickй sloћky ReactOS", 14002, 40, 37, 120, 10, WS_TABSTOP -GROUPBOX "Prochбzenн sloћek", -1, 7, 60, 249, 45, WS_TABSTOP -//ICON -AUTORADIOBUTTON "Otevнrat kaћdou sloћku ve stejnй&m oknм", 14004, 40, 70, 140, 10, WS_TABSTOP -AUTORADIOBUTTON "Ote&vнrat kaћdou sloћku ve svйm vlastnнm oknм", 14005, 40, 82, 140, 10, WS_TABSTOP -GROUPBOX "Klikбnн na poloћky", -1, 7, 110, 249, 60 -//ICON -AUTORADIOBUTTON "Jedno kliknutн k &otevшenн poloћky (vybrat ukбzбnнm)", 14007, 40, 120, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Podtrhбvat nбzvy ikon podle &nastavenн prohlнћeиe", 14008, 50, 132, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Podtrhбvat nбzvy ikon jen &pшi ukбzбnн na nм", 14009, 50, 144, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "&Dvojkliknutн k otevшenн poloћky (vybrat kliknutнm)", 14010, 40, 156, 170, 10, WS_TABSTOP -PUSHBUTTON "O&bnovit vэchozн", 14011, 180, 180, 60, 14, WS_TABSTOP + GROUPBOX "Ъkoly", -1, 7, 10, 249, 45 + ICON "", 30109, 14, 25, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "&Zobrazit bмћnй operace ve sloћkбch", 14001, 40, 25, 120, 10, WS_TABSTOP + AUTORADIOBUTTON "Pouћнt klas&ickй sloћky ReactOS", 14002, 40, 37, 120, 10, WS_TABSTOP + GROUPBOX "Prochбzenн sloћek", -1, 7, 60, 249, 45, WS_TABSTOP + ICON "", 30110, 14, 70, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Otevнrat kaћdou sloћku ve stejnй&m oknм", 14004, 40, 70, 140, 10, WS_TABSTOP + AUTORADIOBUTTON "Ote&vнrat kaћdou sloћku ve svйm vlastnнm oknм", 14005, 40, 82, 140, 10, WS_TABSTOP + GROUPBOX "Klikбnн na poloћky", -1, 7, 110, 249, 60 + ICON "", 30111, 14, 120, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Jedno kliknutн k &otevшenн poloћky (vybrat ukбzбnнm)", 14007, 40, 120, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Podtrhбvat nбzvy ikon podle &nastavenн prohlнћeиe", 14008, 50, 132, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Podtrhбvat nбzvy ikon jen &pшi ukбzбnн na nм", 14009, 50, 144, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "&Dvojkliknutн k otevшenн poloћky (vybrat kliknutнm)", 14010, 40, 156, 170, 10, WS_TABSTOP + PUSHBUTTON "O&bnovit vэchozн", 14011, 180, 180, 60, 14, WS_TABSTOP END FOLDER_OPTIONS_VIEW_DLG DIALOGEX 0, 0, 264, 256 @@ -641,6 +640,9 @@ BEGIN IDS_PROPERTIES "&Vlastnosti" IDS_CUT "Vyj&mout" IDS_RESTORE "Restore" + IDS_FORMATDRIVE "Format..." + IDS_RENAME "Rename" + IDS_INSERT "Insert" IDS_CREATEFOLDER_DENIED "Nelze vytvoшit novou sloћku, protoћe pшнstup byl odepшen." IDS_CREATEFOLDER_CAPTION "Chyba pшi pokusu vytvoшit novэ adresбш" diff --git a/reactos/dll/win32/shell32/lang/da-DK.rc b/reactos/dll/win32/shell32/lang/da-DK.rc index fb665bdf8dc..f67714caa08 100644 --- a/reactos/dll/win32/shell32/lang/da-DK.rc +++ b/reactos/dll/win32/shell32/lang/da-DK.rc @@ -378,22 +378,21 @@ STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION CAPTION "General" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - -GROUPBOX "Tasks", -1, 7, 10, 249, 45 -//ICON -AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP -AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP -GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP -//ICON -AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP -AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP -GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 -//ICON -AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP -PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP + GROUPBOX "Tasks", -1, 7, 10, 249, 45 + ICON "", 30109, 14, 25, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP + AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP + GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP + ICON "", 30110, 14, 70, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP + AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP + GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 + ICON "", 30111, 14, 120, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP + PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP END FOLDER_OPTIONS_VIEW_DLG DIALOGEX 0, 0, 264, 256 @@ -639,6 +638,9 @@ BEGIN IDS_PROPERTIES "Properties" IDS_CUT "Cut" IDS_RESTORE "Restore" + IDS_FORMATDRIVE "Format..." + IDS_RENAME "Rename" + IDS_INSERT "Insert" IDS_CREATEFOLDER_DENIED "Unable to create new Folder: Permission denied." IDS_CREATEFOLDER_CAPTION "Error during creation of a new folder" diff --git a/reactos/dll/win32/shell32/lang/de-DE.rc b/reactos/dll/win32/shell32/lang/de-DE.rc index ae8fab4a46c..ff1e520637b 100644 --- a/reactos/dll/win32/shell32/lang/de-DE.rc +++ b/reactos/dll/win32/shell32/lang/de-DE.rc @@ -382,15 +382,15 @@ CAPTION "Allgemein" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN GROUPBOX "Aufgaben", -1, 7, 10, 249, 45 - //ICON + ICON "", 30109, 14, 25, 21, 20, SS_REALSIZECONTROL AUTORADIOBUTTON "&Allgemeine Aufgaben in Ordnern anzeigen", 14001, 40, 25, 150, 10, WS_TABSTOP AUTORADIOBUTTON "ReactOS Klassisc&he Ansicht verwenden", 14002, 40, 37, 150, 10, WS_TABSTOP GROUPBOX "Ordner durchsuchen", -1, 7, 60, 249, 45, WS_TABSTOP - //ICON + ICON "", 30110, 14, 70, 21, 20, SS_REALSIZECONTROL AUTORADIOBUTTON "Jeden Ordner im &selben Fenster цffnen", 14004, 40, 70, 150, 10, WS_TABSTOP AUTORADIOBUTTON "&Jeden Ordner im eigenen Fenster цffnen", 14005, 40, 82, 150, 10, WS_TABSTOP GROUPBOX "Markieren von Elementen", -1, 7, 110, 249, 60 - //ICON + ICON "", 30111, 14, 120, 21, 20, SS_REALSIZECONTROL AUTORADIOBUTTON "&Цffnen durch &einfachen Klick (Markieren durch zeigen)", 14007, 40, 120, 210, 10, WS_TABSTOP AUTORADIOBUTTON "Symbolunerschriften wie im Br&owser unterstreichen", 14008, 50, 132, 210, 10, WS_TABSTOP AUTORADIOBUTTON "Symbolunerschriften nur beim Zeigen &unterstreichen", 14009, 50, 144, 210, 10, WS_TABSTOP @@ -643,6 +643,9 @@ BEGIN IDS_PROPERTIES "Eigenschaften" IDS_CUT "Ausschneiden" IDS_RESTORE "Wiederherstellen" + IDS_FORMATDRIVE "Formatieren..." + IDS_RENAME "Umbenennen" + IDS_INSERT "Einfьgen" IDS_CREATEFOLDER_DENIED "Es konnte kein neues Verzeichnis erstellt werden: Zugriff verweigert." IDS_CREATEFOLDER_CAPTION "Es trat ein Fehler beim Erstellen eines neuen Verzeichnisses auf." diff --git a/reactos/dll/win32/shell32/lang/el-GR.rc b/reactos/dll/win32/shell32/lang/el-GR.rc index f2ac5f9ac87..f1c6212ccc1 100644 --- a/reactos/dll/win32/shell32/lang/el-GR.rc +++ b/reactos/dll/win32/shell32/lang/el-GR.rc @@ -378,22 +378,21 @@ STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION CAPTION "General" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - -GROUPBOX "Tasks", -1, 7, 10, 249, 45 -//ICON -AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP -AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP -GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP -//ICON -AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP -AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP -GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 -//ICON -AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP -PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP + GROUPBOX "Tasks", -1, 7, 10, 249, 45 + ICON "", 30109, 14, 25, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP + AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP + GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP + ICON "", 30110, 14, 70, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP + AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP + GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 + ICON "", 30111, 14, 120, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP + PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP END FOLDER_OPTIONS_VIEW_DLG DIALOGEX 0, 0, 264, 256 @@ -640,6 +639,9 @@ BEGIN IDS_PROPERTIES "&Йдйьфзфет" IDS_CUT "Б&рпкпрЮ" IDS_RESTORE "Restore" + IDS_FORMATDRIVE "Format..." + IDS_RENAME "Rename" + IDS_INSERT "Insert" IDS_CREATEFOLDER_DENIED "Ден Юфбн дхнбфЮ з дзмйпхсгЯб фпх цбкЭлпх: Ден ерйфсЭрефбй з рсьувбуз." IDS_CREATEFOLDER_CAPTION "УцЬлмб кбфЬ фзн дзмйпхсгЯб нЭпх цбкЭлпх" diff --git a/reactos/dll/win32/shell32/lang/en-GB.rc b/reactos/dll/win32/shell32/lang/en-GB.rc index 65d588245ad..e1ef5e6f918 100644 --- a/reactos/dll/win32/shell32/lang/en-GB.rc +++ b/reactos/dll/win32/shell32/lang/en-GB.rc @@ -378,22 +378,21 @@ STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION CAPTION "General" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - -GROUPBOX "Tasks", -1, 7, 10, 249, 45 -//ICON -AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP -AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP -GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP -//ICON -AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP -AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP -GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 -//ICON -AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP -PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP + GROUPBOX "Tasks", -1, 7, 10, 249, 45 + ICON "", 30109, 14, 25, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP + AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP + GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP + ICON "", 30110, 14, 70, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP + AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP + GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 + ICON "", 30111, 14, 120, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP + PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP END FOLDER_OPTIONS_VIEW_DLG DIALOGEX 0, 0, 264, 256 @@ -639,6 +638,9 @@ BEGIN IDS_PROPERTIES "Properties" IDS_CUT "C&ut" IDS_RESTORE "Restore" + IDS_FORMATDRIVE "Format..." + IDS_RENAME "Rename" + IDS_INSERT "Insert" IDS_CREATEFOLDER_DENIED "Unable to create new Folder: Permission denied." IDS_CREATEFOLDER_CAPTION "Error during creation of a new folder" diff --git a/reactos/dll/win32/shell32/lang/en-US.rc b/reactos/dll/win32/shell32/lang/en-US.rc index 2b2cf1a4770..4e9047fc2df 100644 --- a/reactos/dll/win32/shell32/lang/en-US.rc +++ b/reactos/dll/win32/shell32/lang/en-US.rc @@ -379,22 +379,21 @@ STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION CAPTION "General" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - -GROUPBOX "Tasks", -1, 7, 10, 249, 45 -//ICON -AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP -AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP -GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP -//ICON -AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP -AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP -GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 -//ICON -AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP -PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP + GROUPBOX "Tasks", -1, 7, 10, 249, 45 + ICON "", 30109, 14, 25, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP + AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP + GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP + ICON "", 30110, 14, 70, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP + AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP + GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 + ICON "", 30111, 14, 120, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP + PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP END FOLDER_OPTIONS_VIEW_DLG DIALOGEX 0, 0, 264, 256 @@ -640,6 +639,9 @@ BEGIN IDS_PROPERTIES "Properties" IDS_CUT "Cut" IDS_RESTORE "Restore" + IDS_FORMATDRIVE "Format..." + IDS_RENAME "Rename" + IDS_INSERT "Insert" IDS_CREATEFOLDER_DENIED "Unable to create new Folder: Permission denied." IDS_CREATEFOLDER_CAPTION "Error during creation of a new folder" diff --git a/reactos/dll/win32/shell32/lang/es-ES.rc b/reactos/dll/win32/shell32/lang/es-ES.rc index cfbeea723e6..7e335a62e07 100644 --- a/reactos/dll/win32/shell32/lang/es-ES.rc +++ b/reactos/dll/win32/shell32/lang/es-ES.rc @@ -297,9 +297,9 @@ BEGIN CONTROL "", 14015, "Static", SS_NOTIFY | SS_SUNKEN | SS_OWNERDRAW, 20, 140, 200, 20 LTEXT "Unidad %s", 14010, 100, 170, 40, 10 - PUSHBUTTON "Liberar espacio en disco", 14011, 180, 175, 50, 15, WS_TABSTOP - CHECKBOX "Comprimir contenido para ahorrar espacio en disco", 14012, 15, 205, 180, 10, WS_DISABLED - CHECKBOX "Permitir a Index Server indizar el disco para acelerar la bъsqueda", 14012, 15, 220, 200, 10, WS_DISABLED + PUSHBUTTON "Liberar espacio en disco", 14011, 160, 175, 80, 15, WS_TABSTOP + CHECKBOX "Comprimir contenido para ahorrar espacio en disco", 14012, 5, 205, 180, 10, WS_DISABLED + CHECKBOX "Permitir a Index Server indizar el disco para acelerar la bъsqueda", 14012, 5, 220, 220, 10, WS_DISABLED END DRIVE_EXTRA_DLG DIALOGEX 0, 0, 240, 230 @@ -315,7 +315,7 @@ BEGIN PUSHBUTTON "Desfragmentar ahora...", 14001, 130, 105, 90, 15, WS_TABSTOP GROUPBOX "Copia de seguridad ", -1, 5, 130, 230, 60 LTEXT "Esta opciуn realizarб una copia de seguridad de\nlos archivos almacenados en la unidad.", -1, 40, 150, 160, 20 - PUSHBUTTON "Realizar copia de seguridad ahora...", 14002, 130, 170, 90, 15, WS_TABSTOP + PUSHBUTTON "Realizar copia de seguridad ahora...", 14002, 90, 170, 130, 15, WS_TABSTOP END DRIVE_HARDWARE_DLG DIALOGEX 0, 0, 240, 230 @@ -381,22 +381,21 @@ STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION CAPTION "General" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - -GROUPBOX "Tareas", -1, 7, 10, 249, 45 -//ICON -AUTORADIOBUTTON "M&ostrar tareas comunes en las carpetas", 14001, 40, 25, 120, 10, WS_TABSTOP -AUTORADIOBUTTON "Utilizar las carpetas clб&sicas de ReactOS", 14002, 40, 37, 120, 10, WS_TABSTOP -GROUPBOX "Examinar carpetas ", -1, 7, 60, 249, 45, WS_TABSTOP -//ICON -AUTORADIOBUTTON "Abrir todas las carpetas en la &misma ventana", 14004, 40, 70, 140, 10, WS_TABSTOP -AUTORADIOBUTTON "Abrir cada carpeta ventanas di&ferentes", 14005, 40, 82, 140, 10, WS_TABSTOP -GROUPBOX "Hacer clic en los elementos como se indica ", -1, 7, 110, 249, 60 -//ICON -AUTORADIOBUTTON "&Un solo clic para abrir elemento (seleccionar al seсalar)", 14007, 40, 120, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Subrayar los tнtulos de iconos que coincidan con el e&xplorador", 14008, 50, 132, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Subrayar &los tнtulos de iconos cuando yo los seсale", 14009, 50, 144, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "&Doble clic para abrir elemento (seleccionar con un clic)", 14010, 40, 156, 170, 10, WS_TABSTOP -PUSHBUTTON "&Restaurar valores predeterminados", 14011, 180, 180, 60, 14, WS_TABSTOP + GROUPBOX "Tareas", -1, 7, 10, 249, 45 + ICON "", 30109, 14, 25, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "M&ostrar tareas comunes en las carpetas", 14001, 40, 25, 120, 10, WS_TABSTOP + AUTORADIOBUTTON "Utilizar las carpetas clб&sicas de ReactOS", 14002, 40, 37, 120, 10, WS_TABSTOP + GROUPBOX "Examinar carpetas ", -1, 7, 60, 249, 45, WS_TABSTOP + ICON "", 30110, 14, 70, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Abrir todas las carpetas en la &misma ventana", 14004, 40, 70, 140, 10, WS_TABSTOP + AUTORADIOBUTTON "Abrir cada carpeta ventanas di&ferentes", 14005, 40, 82, 140, 10, WS_TABSTOP + GROUPBOX "Hacer clic en los elementos como se indica ", -1, 7, 110, 249, 60 + ICON "", 30111, 14, 120, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "&Un solo clic para abrir elemento (seleccionar al seсalar)", 14007, 40, 120, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Subrayar los tнtulos de iconos que coincidan con el e&xplorador", 14008, 50, 132, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Subrayar &los tнtulos de iconos cuando yo los seсale", 14009, 50, 144, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "&Doble clic para abrir elemento (seleccionar con un clic)", 14010, 40, 156, 170, 10, WS_TABSTOP + PUSHBUTTON "&Restaurar valores predeterminados", 14011, 180, 180, 60, 14, WS_TABSTOP END FOLDER_OPTIONS_VIEW_DLG DIALOGEX 0, 0, 264, 256 @@ -567,17 +566,17 @@ BEGIN AUTOCHECKBOX "&Habilitar compresiуn", 28675, 16, 152, 155, 10 END -CHKDSK_DLG DIALOGEX 50, 50, 194, 120 +CHKDSK_DLG DIALOGEX 50, 50, 240, 120 STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION -CAPTION "Check Disk" +CAPTION "Comprobar disco" FONT 8, "MS Shell Dlg" BEGIN - DEFPUSHBUTTON "Start", IDOK, 53, 100, 60, 14 - GROUPBOX "Check disk options", -1, 7, 6, 179, 50 - PUSHBUTTON "Cancel", IDCANCEL, 118, 100, 60, 14 - AUTOCHECKBOX "Automatically fix file system errors", 14000, 16, 15, 155, 10 - AUTOCHECKBOX "&Scan for and attempt recovery of bad sectors", 14001, 16, 30, 165, 10 - CONTROL "", 14002, "MSCTLS_PROGRESS32", 16, 7, 60, 170, 8 + DEFPUSHBUTTON "Iniciar", IDOK, 53, 100, 60, 14 + GROUPBOX "Opciones de comprobaciуn de disco ", -1, 7, 6, 225, 50 + PUSHBUTTON "Cancelar", IDCANCEL, 118, 100, 60, 14 + AUTOCHECKBOX "Reparar &automбticamente errores en el sistema de archivos", 14000, 16, 15, 200, 10 + AUTOCHECKBOX "&Examinar e intentar recuperar los sectores defectuosos", 14001, 16, 30, 200, 10 + CONTROL "", 14002, "MSCTLS_PROGRESS32", 16, 7, 60, 225, 8 LTEXT "", 14003, 60, 80, 170, 10 END @@ -609,25 +608,25 @@ BEGIN IDS_SHV_COLUMN9 "Comentarios" IDS_SHV_COLUMN10 "Propietario" IDS_SHV_COLUMN11 "Grupo" - IDS_SHV_COLUMN12 "Filename" - IDS_SHV_COLUMN13 "Category" + IDS_SHV_COLUMN12 "Nombre del archivo" + IDS_SHV_COLUMN13 "Categorнa" IDS_SHV_COLUMN_DELFROM "Ubicaciуn original" IDS_SHV_COLUMN_DELDATE "Fecha de eliminaciуn" - IDS_SHV_COLUMN_FONTTYPE "Fonttype" - IDS_SHV_COLUMN_WORKGROUP "Workgroup" - IDS_SHV_NETWORKLOCATION "Network Location" - IDS_SHV_COLUMN_DOCUMENTS "Documents" - IDS_SHV_COLUMN_STATUS "Status" - IDS_SHV_COLUMN_COMMENTS "Comments" - IDS_SHV_COLUMN_LOCATION "Location" - IDS_SHV_COLUMN_MODEL "Model" + IDS_SHV_COLUMN_FONTTYPE "Tipo de fuente" + IDS_SHV_COLUMN_WORKGROUP "Grupo de trabajo" + IDS_SHV_NETWORKLOCATION "Ubicaciуn en red" + IDS_SHV_COLUMN_DOCUMENTS "Documentos" + IDS_SHV_COLUMN_STATUS "Estado" + IDS_SHV_COLUMN_COMMENTS "Comentarios" + IDS_SHV_COLUMN_LOCATION "Ubicaciуn" + IDS_SHV_COLUMN_MODEL "Modelo" /* special folders */ IDS_DESKTOP "Escritorio" IDS_MYCOMPUTER "Mi PC" IDS_RECYCLEBIN_FOLDER_NAME "Papelera de reciclaje" IDS_CONTROLPANEL "Panel de control" - IDS_ADMINISTRATIVETOOLS "Administrative Tools" + IDS_ADMINISTRATIVETOOLS "Herramientas Administrativas" /* context menus */ IDS_VIEW_LARGE "Iconos &grandes" @@ -642,8 +641,11 @@ BEGIN IDS_PROPERTIES "&Propiedades" IDS_CUT "C&ortar" IDS_RESTORE "Restaurar" + IDS_FORMATDRIVE "Formatear..." + IDS_RENAME "Renombrar" + IDS_INSERT "Insertar" - IDS_CREATEFOLDER_DENIED "No se puede crear nueva carpeta: Permiso denegado." + IDS_CREATEFOLDER_DENIED "No se puede crear una nueva carpeta: Permiso denegado." IDS_CREATEFOLDER_CAPTION "Error durante la creaciуn de una nueva carpeta" IDS_DELETEITEM_CAPTION "Confirmar eliminaciуn de archivos" IDS_DELETEFOLDER_CAPTION "Confirmar eliminaciуn de carpetas" @@ -744,9 +746,9 @@ BEGIN IDS_PREVIEW_VERB "Vista previa" IDS_FILE_FOLDER "%u Archivos, %u Carpetas" - IDS_PRINTERS "Printers" - IDS_FONTS "Fonts" - IDS_INSTALLNEWFONT "Install New Font..." + IDS_PRINTERS "Impresoras" + IDS_FONTS "Fuentes" + IDS_INSTALLNEWFONT "Instalar Nueva Fuente..." - IDS_DEFAULT_CLUSTER_SIZE "Default allocation size" + IDS_DEFAULT_CLUSTER_SIZE "Tamaсo asignado por defecto" END diff --git a/reactos/dll/win32/shell32/lang/fi-FI.rc b/reactos/dll/win32/shell32/lang/fi-FI.rc index a845f945013..66ddaa22b47 100644 --- a/reactos/dll/win32/shell32/lang/fi-FI.rc +++ b/reactos/dll/win32/shell32/lang/fi-FI.rc @@ -378,22 +378,21 @@ STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION CAPTION "General" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - -GROUPBOX "Tasks", -1, 7, 10, 249, 45 -//ICON -AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP -AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP -GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP -//ICON -AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP -AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP -GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 -//ICON -AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP -PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP + GROUPBOX "Tasks", -1, 7, 10, 249, 45 + ICON "", 30109, 14, 25, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP + AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP + GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP + ICON "", 30110, 14, 70, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP + AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP + GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 + ICON "", 30111, 14, 120, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP + PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP END FOLDER_OPTIONS_VIEW_DLG DIALOGEX 0, 0, 264, 256 @@ -639,6 +638,9 @@ BEGIN IDS_PROPERTIES "&Ominaisuudet" IDS_CUT "&Leikkaa" IDS_RESTORE "Restore" + IDS_FORMATDRIVE "Format..." + IDS_RENAME "Rename" + IDS_INSERT "Insert" IDS_CREATEFOLDER_DENIED "Uutta kansiota ei voitu luoda: Oikeudet eivдt riitд." IDS_CREATEFOLDER_CAPTION "Virhe luotaessa uutta kansiota" diff --git a/reactos/dll/win32/shell32/lang/fr-FR.rc b/reactos/dll/win32/shell32/lang/fr-FR.rc index 764fac64741..8e3342d6549 100644 --- a/reactos/dll/win32/shell32/lang/fr-FR.rc +++ b/reactos/dll/win32/shell32/lang/fr-FR.rc @@ -96,7 +96,7 @@ END SHNEWBRSFORFOLDER_MSGBOX DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 15, 40, 218, 196 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU -CAPTION "Parcourir pour un dossier" +CAPTION "Rechercher un dossier" FONT 8, "MS Shell Dlg" BEGIN LTEXT "", IDD_TITLE, 10, 8, 198, 24 @@ -308,7 +308,7 @@ STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Outils" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - GROUPBOX "Vйrifcation-d'erreurs", -1, 5, 5, 230, 60 + GROUPBOX "Vйrification d'erreurs", -1, 5, 5, 230, 60 LTEXT "Cette option vйrifiera le volume pour йviter les\nerreurs.", -1, 40, 25, 160, 20 PUSHBUTTON "Vйrifier maintenant...", 14000, 130, 45, 90, 15, WS_TABSTOP GROUPBOX "Dйfragmentation", -1, 5, 65, 230, 60 @@ -349,7 +349,7 @@ END BITBUCKET_PROPERTIES_DLG DIALOGEX 0, 0, 240, 190 STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "Proprйtйs de la corbeille" +CAPTION "Propriйtйs de la corbeille" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN CONTROL "", 14000, "SysListView32", LVS_REPORT | LVS_SHAREIMAGELISTS | WS_BORDER | WS_TABSTOP, 10, 10, 220, 50 @@ -382,22 +382,21 @@ STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION CAPTION "Gйnйral" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - -GROUPBOX "Tвches", -1, 7, 10, 249, 45 -//ICON -AUTORADIOBUTTON "Afficher les tвches habituelles dans les dossiers", 14001, 40, 25, 120, 10, WS_TABSTOP -AUTORADIOBUTTON "Utiliser les dossiers ReactOS class&iques", 14002, 40, 37, 120, 10, WS_TABSTOP -GROUPBOX "Parcourir les dossiers", -1, 7, 60, 249, 45, WS_TABSTOP -//ICON -AUTORADIOBUTTON "Ouvrir tous les dossiers dans la &mкme fenкtre", 14004, 40, 70, 140, 10, WS_TABSTOP -AUTORADIOBUTTON "Ouvrir chaque dossier dans sa propre fenкtre", 14005, 40, 82, 140, 10, WS_TABSTOP -GROUPBOX "Cliquer sur les йlйments de la faзon suivante", -1, 7, 110, 249, 60 -//ICON -AUTORADIOBUTTON "Clic unique pour ouvrir un йlйment (pointer pour sйlectionner)", 14007, 40, 120, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Toujours souligner les titres des icфnes comme dans le navigateur", 14008, 50, 132, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Souligner les titres des icфnes seulement quand je les &pointe", 14009, 50, 144, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "&Double-cliquer pour ouvrir un йlйment (clic unique pour le sйlectionner)", 14010, 40, 156, 170, 10, WS_TABSTOP -PUSHBUTTON "Pa&ramиtres par dйfaut", 14011, 180, 180, 60, 14, WS_TABSTOP + GROUPBOX "Tвches", -1, 7, 10, 249, 45 + ICON "", 30109, 14, 25, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Afficher les tвches habituelles dans les dossiers", 14001, 40, 25, 120, 10, WS_TABSTOP + AUTORADIOBUTTON "Utiliser les dossiers ReactOS class&iques", 14002, 40, 37, 120, 10, WS_TABSTOP + GROUPBOX "Parcourir les dossiers", -1, 7, 60, 249, 45, WS_TABSTOP + ICON "", 30110, 14, 70, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Ouvrir tous les dossiers dans la &mкme fenкtre", 14004, 40, 70, 140, 10, WS_TABSTOP + AUTORADIOBUTTON "Ouvrir chaque dossier dans sa propre fenкtre", 14005, 40, 82, 140, 10, WS_TABSTOP + GROUPBOX "Cliquer sur les йlйments de la faзon suivante", -1, 7, 110, 249, 60 + ICON "", 30111, 14, 120, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Clic unique pour ouvrir un йlйment (pointer pour sйlectionner)", 14007, 40, 120, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Toujours souligner les titres des icфnes comme dans le navigateur", 14008, 50, 132, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Souligner les titres des icфnes seulement quand je les &pointe", 14009, 50, 144, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "&Double-cliquer pour ouvrir un йlйment (clic unique pour le sйlectionner)", 14010, 40, 156, 170, 10, WS_TABSTOP + PUSHBUTTON "Pa&ramиtres par dйfaut", 14011, 180, 180, 60, 14, WS_TABSTOP END FOLDER_OPTIONS_VIEW_DLG DIALOGEX 0, 0, 264, 256 @@ -610,18 +609,18 @@ BEGIN IDS_SHV_COLUMN9 "Commentaires" IDS_SHV_COLUMN10 "Propriйtaire" IDS_SHV_COLUMN11 "Groupe" - IDS_SHV_COLUMN12 "Filename" - IDS_SHV_COLUMN13 "Category" + IDS_SHV_COLUMN12 "Nom de fichier" + IDS_SHV_COLUMN13 "Catйgorie" IDS_SHV_COLUMN_DELFROM "Localisation d'origine" IDS_SHV_COLUMN_DELDATE "Date de suppression" - IDS_SHV_COLUMN_FONTTYPE "Fonttype" + IDS_SHV_COLUMN_FONTTYPE "Type de police" IDS_SHV_COLUMN_WORKGROUP "Workgroup" - IDS_SHV_NETWORKLOCATION "Network Location" + IDS_SHV_NETWORKLOCATION "Emplacement rйseau" IDS_SHV_COLUMN_DOCUMENTS "Documents" - IDS_SHV_COLUMN_STATUS "Status" - IDS_SHV_COLUMN_COMMENTS "Comments" - IDS_SHV_COLUMN_LOCATION "Location" - IDS_SHV_COLUMN_MODEL "Model" + IDS_SHV_COLUMN_STATUS "Йtat" + IDS_SHV_COLUMN_COMMENTS "Commentaires" + IDS_SHV_COLUMN_LOCATION "Emplacement" + IDS_SHV_COLUMN_MODEL "Modиle" /* special folders */ IDS_DESKTOP "Bureau" @@ -642,7 +641,10 @@ BEGIN IDS_DELETE "&Supprimer" IDS_PROPERTIES "&Propriйtйs" IDS_CUT "C&ouper" - IDS_RESTORE "Restore" + IDS_RESTORE "Res&taurer" + IDS_FORMATDRIVE "Format..." + IDS_RENAME "Rename" + IDS_INSERT "Insert" IDS_CREATEFOLDER_DENIED "Impossible de crйer le nouveau dossier : permission refusйe." IDS_CREATEFOLDER_CAPTION "Erreur lors de la crйation du nouveau dossier" @@ -715,7 +717,7 @@ BEGIN IDS_FOLDER_OPTIONS "Options du dossier" IDS_RECYCLEBIN_LOCATION "Emplacement de la corbeille" IDS_RECYCLEBIN_DISKSPACE "Espace disponible" - IDS_EMPTY_BITBUCKET "Corbeille vide" + IDS_EMPTY_BITBUCKET "Vider la Corbeille" IDS_PICK_ICON_TITLE "Choisir une icфne" IDS_PICK_ICON_FILTER "Fichiers d'icфnes (*.ico, *.icl, *.exe, *.dll)\0*.ico;*.icl;*.exe;*.dll\0" IDS_OPEN_WITH_FILTER "Fichiers exйcutables\0*.exe\0" @@ -744,10 +746,10 @@ BEGIN IDS_PLAY_VERB "Lire" IDS_PREVIEW_VERB "Apercevoir" - IDS_FILE_FOLDER "%u Files, %u Folders" - IDS_PRINTERS "Printers" - IDS_FONTS "Fonts" - IDS_INSTALLNEWFONT "Install New Font..." + IDS_FILE_FOLDER "%u fichiers, %u rйpertoires" + IDS_PRINTERS "Imprimantes" + IDS_FONTS "Polices" + IDS_INSTALLNEWFONT "Installer une nouvelle police..." - IDS_DEFAULT_CLUSTER_SIZE "Default allocation size" + IDS_DEFAULT_CLUSTER_SIZE "Taille d'allocation par dйfaut" END diff --git a/reactos/dll/win32/shell32/lang/hu-HU.rc b/reactos/dll/win32/shell32/lang/hu-HU.rc index 99a511153d9..a56e952742c 100644 --- a/reactos/dll/win32/shell32/lang/hu-HU.rc +++ b/reactos/dll/win32/shell32/lang/hu-HU.rc @@ -381,22 +381,21 @@ STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION CAPTION "General" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - -GROUPBOX "Tasks", -1, 7, 10, 249, 45 -//ICON -AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP -AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP -GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP -//ICON -AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP -AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP -GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 -//ICON -AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP -PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP + GROUPBOX "Tasks", -1, 7, 10, 249, 45 + ICON "", 30109, 14, 25, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP + AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP + GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP + ICON "", 30110, 14, 70, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP + AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP + GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 + ICON "", 30111, 14, 120, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP + PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP END FOLDER_OPTIONS_VIEW_DLG DIALOGEX 0, 0, 264, 256 @@ -642,6 +641,9 @@ BEGIN IDS_PROPERTIES "Tulajdonsбgok" IDS_CUT "Kivбgбs" IDS_RESTORE "Restore" + IDS_FORMATDRIVE "Format..." + IDS_RENAME "Rename" + IDS_INSERT "Insert" IDS_CREATEFOLDER_DENIED "Nem hozhatу lйtre ъj mappa: Nincs hozzб engedйlyed." IDS_CREATEFOLDER_CAPTION "Hiba a mappa lйtrehozбsakor" diff --git a/reactos/dll/win32/shell32/lang/it-IT.rc b/reactos/dll/win32/shell32/lang/it-IT.rc index e0e7033d547..6cdbdabb22f 100644 --- a/reactos/dll/win32/shell32/lang/it-IT.rc +++ b/reactos/dll/win32/shell32/lang/it-IT.rc @@ -207,18 +207,18 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN ICON "", 14000, 10, 3, 30, 30, WS_VISIBLE EDITTEXT 14001, 70, 9, 158, 14, ES_LEFT | ES_READONLY - LTEXT "Type of file:", 14004, 8, 35, 50, 10 - LTEXT "Folder", 14005, 68, 35, 160, 10 - LTEXT "Location:", 14006, 8, 53, 50, 10 + LTEXT "Tipo del file:", 14004, 8, 35, 50, 10 + LTEXT "Cartella", 14005, 68, 35, 160, 10 + LTEXT "Posizione:", 14006, 8, 53, 50, 10 LTEXT "", 14007, 68, 53, 315, 10 - LTEXT "Size:", 14008, 8, 72, 45, 10 + LTEXT "Dimensione:", 14008, 8, 72, 45, 10 LTEXT "", 14009, 68, 72, 315, 10 - LTEXT "Contains:", 14010, 8, 93, 45, 10 + LTEXT "Contenente:", 14010, 8, 93, 45, 10 LTEXT "", 14011, 68, 93, 160, 10 - LTEXT "Created:", 14014, 8, 118, 45, 10 + LTEXT "Creato:", 14014, 8, 118, 45, 10 LTEXT "", 14015, 68, 118, 160, 10 - AUTOCHECKBOX "&Read-only", 14021, 45, 150, 67, 10 - AUTOCHECKBOX "&Hidden", 14022, 126, 150, 50, 10 + AUTOCHECKBOX "&Sola lettura", 14021, 45, 150, 67, 10 + AUTOCHECKBOX "&Nascosto", 14022, 126, 150, 50, 10 END SHELL_FILE_GENERAL_DLG DIALOGEX 0, 0, 240, 205 @@ -379,22 +379,21 @@ STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION CAPTION "Generale" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - -GROUPBOX "Attivitа", -1, 7, 10, 249, 45 -//ICON -AUTORADIOBUTTON "Mostrare le attivitа comuni nelle cartelle", 14001, 40, 25, 120, 10, WS_TABSTOP -AUTORADIOBUTTON "Utilizzare le cartelle nella forma 'ReactOS class&ic' ", 14002, 40, 37, 120, 10, WS_TABSTOP -GROUPBOX "Sfoglia cartelle", -1, 7, 60, 249, 45, WS_TABSTOP -//ICON -AUTORADIOBUTTON "Aprire ogni cartella nella stessa finestra", 14004, 40, 70, 140, 10, WS_TABSTOP -AUTORADIOBUTTON "Aprire ogni cartella in una nuova finestra", 14005, 40, 82, 140, 10, WS_TABSTOP -GROUPBOX "Click sugli elementi come segue", -1, 7, 110, 249, 60 -//ICON -AUTORADIOBUTTON "&Click singolo per aprire un elemento (seleziona ed apre)", 14007, 40, 120, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Sottolinea i titoli delle icone in modo coerente con il &browser", 14008, 50, 132, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Sottolinea i titoli delle icone solo se &selezionate", 14009, 50, 144, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "&Doppio click per aprire un elemento (click singolo per selezionare)", 14010, 40, 156, 170, 10, WS_TABSTOP -PUSHBUTTON "&Ripristina le impostazioni predefinite", 14011, 180, 180, 60, 14, WS_TABSTOP + GROUPBOX "Attivitа", -1, 7, 10, 249, 45 + ICON "", 30109, 14, 25, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Mostrare le attivitа comuni nelle cartelle", 14001, 40, 25, 120, 10, WS_TABSTOP + AUTORADIOBUTTON "Utilizzare le cartelle nella forma 'ReactOS class&ic' ", 14002, 40, 37, 120, 10, WS_TABSTOP + GROUPBOX "Sfoglia cartelle", -1, 7, 60, 249, 45, WS_TABSTOP + ICON "", 30110, 14, 70, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Aprire ogni cartella nella stessa finestra", 14004, 40, 70, 140, 10, WS_TABSTOP + AUTORADIOBUTTON "Aprire ogni cartella in una nuova finestra", 14005, 40, 82, 140, 10, WS_TABSTOP + GROUPBOX "Click sugli elementi come segue", -1, 7, 110, 249, 60 + ICON "", 30111, 14, 120, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "&Click singolo per aprire un elemento (seleziona ed apre)", 14007, 40, 120, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Sottolinea i titoli delle icone in modo coerente con il &browser", 14008, 50, 132, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Sottolinea i titoli delle icone solo se &selezionate", 14009, 50, 144, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "&Doppio click per aprire un elemento (click singolo per selezionare)", 14010, 40, 156, 170, 10, WS_TABSTOP + PUSHBUTTON "&Ripristina le impostazioni predefinite", 14011, 180, 180, 60, 14, WS_TABSTOP END FOLDER_OPTIONS_VIEW_DLG DIALOGEX 0, 0, 264, 256 @@ -570,11 +569,11 @@ STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBL CAPTION "Check Disk" FONT 8, "MS Shell Dlg" BEGIN - DEFPUSHBUTTON "Start", IDOK, 53, 100, 60, 14 - GROUPBOX "Check disk options", -1, 7, 6, 179, 50 - PUSHBUTTON "Cancel", IDCANCEL, 118, 100, 60, 14 - AUTOCHECKBOX "Automatically fix file system errors", 14000, 16, 15, 155, 10 - AUTOCHECKBOX "&Scan for and attempt recovery of bad sectors", 14001, 16, 30, 165, 10 + DEFPUSHBUTTON "Inizia", IDOK, 53, 100, 60, 14 + GROUPBOX "Opzioni per la verifica del disco", -1, 7, 6, 179, 50 + PUSHBUTTON "Annulla", IDCANCEL, 118, 100, 60, 14 + AUTOCHECKBOX "Correggi automaticamente gli errori", 14000, 16, 15, 155, 10 + AUTOCHECKBOX "&Ricerca dei settori difettosi e tentativo di correzione", 14001, 16, 30, 165, 10 CONTROL "", 14002, "MSCTLS_PROGRESS32", 16, 7, 60, 170, 8 LTEXT "", 14003, 60, 80, 170, 10 END @@ -607,25 +606,25 @@ BEGIN IDS_SHV_COLUMN9 "Commenti" IDS_SHV_COLUMN10 "Proprietario" IDS_SHV_COLUMN11 "Gruppo" - IDS_SHV_COLUMN12 "Filename" - IDS_SHV_COLUMN13 "Category" + IDS_SHV_COLUMN12 "Nome file" + IDS_SHV_COLUMN13 "Categoria" IDS_SHV_COLUMN_DELFROM "Posizione originale" IDS_SHV_COLUMN_DELDATE "Data di cancellazione" - IDS_SHV_COLUMN_FONTTYPE "Fonttype" - IDS_SHV_COLUMN_WORKGROUP "Workgroup" - IDS_SHV_NETWORKLOCATION "Network Location" - IDS_SHV_COLUMN_DOCUMENTS "Documents" - IDS_SHV_COLUMN_STATUS "Status" - IDS_SHV_COLUMN_COMMENTS "Comments" - IDS_SHV_COLUMN_LOCATION "Location" - IDS_SHV_COLUMN_MODEL "Model" + IDS_SHV_COLUMN_FONTTYPE "Tipo di font" + IDS_SHV_COLUMN_WORKGROUP "Gruppo di lavoro" + IDS_SHV_NETWORKLOCATION "Posizione in rete" + IDS_SHV_COLUMN_DOCUMENTS "Documenti" + IDS_SHV_COLUMN_STATUS "Stato" + IDS_SHV_COLUMN_COMMENTS "Commenti" + IDS_SHV_COLUMN_LOCATION "Posizione" + IDS_SHV_COLUMN_MODEL "Modello" /* special folders */ IDS_DESKTOP "Desktop" IDS_MYCOMPUTER "Risorse del Computer" IDS_RECYCLEBIN_FOLDER_NAME "Cestino" IDS_CONTROLPANEL "Pannello di controllo" - IDS_ADMINISTRATIVETOOLS "Administrative Tools" + IDS_ADMINISTRATIVETOOLS "Strumenti di amministrazione" /* context menus */ IDS_VIEW_LARGE "&Icone Grandi" @@ -639,7 +638,10 @@ BEGIN IDS_DELETE "&Cancella" IDS_PROPERTIES "&Proprietа" IDS_CUT "&Taglia" - IDS_RESTORE "Restore" + IDS_RESTORE "Ripristina" + IDS_FORMATDRIVE "Formatta..." + IDS_RENAME "Rinomina" + IDS_INSERT "Inserisci" IDS_CREATEFOLDER_DENIED "Impossibile creare la cartella: Accesso negato." IDS_CREATEFOLDER_CAPTION "Errore durante la creazione della cartella" @@ -661,9 +663,9 @@ BEGIN /* message box strings */ IDS_RESTART_TITLE "Riavvia" - IDS_RESTART_PROMPT "Vuoi simulare un riavvio do Windows?" + IDS_RESTART_PROMPT "Volete riavviare il sistema?" IDS_SHUTDOWN_TITLE "Termina sessione" - IDS_SHUTDOWN_PROMPT "Vuoi terminare la sessione di ReactOS?" + IDS_SHUTDOWN_PROMPT "Volete terminare la sessione di ReactOS?" /* shell folder path default values */ IDS_PROGRAMS "Menu Avvio\\Programmi" @@ -677,7 +679,7 @@ BEGIN IDS_MYVIDEO "Video" IDS_DESKTOPDIRECTORY "Desktop" IDS_NETHOOD "Rete" - IDS_TEMPLATES "Templates" + IDS_TEMPLATES "Modelli" IDS_APPDATA "DatiApplicazioni" IDS_PRINTHOOD "Stampanti" IDS_LOCAL_APPDATA "Impostazioni locali\\Dati Applicazioni" @@ -725,7 +727,7 @@ BEGIN IDS_CUR_FILE "Cursore" IDS_DLL_FILE "Estensione di applicazione" IDS_DRV_FILE "Device Driver" - IDS_EXE_FILE "Applicatione" + IDS_EXE_FILE "Applicazione" IDS_FON_FILE "Font" IDS_TTF_FILE "TrueType Font" IDS_HLP_FILE "Help File" @@ -733,18 +735,18 @@ BEGIN IDS_LNK_FILE "Collegamento" IDS_SYS_FILE "File di sistema" - IDS_OPEN_VERB "Open" - IDS_RUNAS_VERB "Run as " - IDS_EDIT_VERB "Edit" - IDS_FIND_VERB "Find" - IDS_PRINT_VERB "Print" - IDS_PLAY_VERB "Play" - IDS_PREVIEW_VERB "Preview" + IDS_OPEN_VERB "Apri" + IDS_RUNAS_VERB "Eseguire come " + IDS_EDIT_VERB "Modifica" + IDS_FIND_VERB "Cerca" + IDS_PRINT_VERB "Stampa" + IDS_PLAY_VERB "Mostra" + IDS_PREVIEW_VERB "Anteprima" - IDS_FILE_FOLDER "%u Files, %u Folders" - IDS_PRINTERS "Printers" - IDS_FONTS "Fonts" - IDS_INSTALLNEWFONT "Install New Font..." + IDS_FILE_FOLDER "%u File, %u Cartelle" + IDS_PRINTERS "Stampanti" + IDS_FONTS "Font" + IDS_INSTALLNEWFONT "Installazione nuovi Font..." - IDS_DEFAULT_CLUSTER_SIZE "Default allocation size" + IDS_DEFAULT_CLUSTER_SIZE "Dimensione predefinita di allocazione" END diff --git a/reactos/dll/win32/shell32/lang/ja-JP.rc b/reactos/dll/win32/shell32/lang/ja-JP.rc index 3aa95f8ef99..db24d649ddf 100644 --- a/reactos/dll/win32/shell32/lang/ja-JP.rc +++ b/reactos/dll/win32/shell32/lang/ja-JP.rc @@ -378,22 +378,21 @@ STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION CAPTION "General" FONT 9, "MS UI Gothic", 0, 0, 0x0 BEGIN - -GROUPBOX "Tasks", -1, 7, 10, 249, 45 -//ICON -AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP -AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP -GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP -//ICON -AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP -AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP -GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 -//ICON -AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP -PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP + GROUPBOX "Tasks", -1, 7, 10, 249, 45 + ICON "", 30109, 14, 25, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP + AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP + GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP + ICON "", 30110, 14, 70, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP + AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP + GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 + ICON "", 30111, 14, 120, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP + PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP END FOLDER_OPTIONS_VIEW_DLG DIALOGEX 0, 0, 264, 256 @@ -639,6 +638,9 @@ BEGIN IDS_PROPERTIES "Properties" IDS_CUT "Cut" IDS_RESTORE "Restore" + IDS_FORMATDRIVE "Format..." + IDS_RENAME "Rename" + IDS_INSERT "Insert" IDS_CREATEFOLDER_DENIED "ђV‚µ‚ўѓtѓHѓ‹ѓ_‚рЌмђ¬‚Е‚«‚Ь‚№‚с‚Е‚µ‚Ѕ: ѓAѓNѓZѓXЊ ‚Є‚ ‚и‚Ь‚№‚сЃB" IDS_CREATEFOLDER_CAPTION "ђV‚µ‚ўѓtѓHѓ‹ѓ_‚МЌмђ¬’†‚ЙѓGѓ‰Ѓ[‚Є”­ђ¶‚µ‚Ь‚µ‚Ѕ" diff --git a/reactos/dll/win32/shell32/lang/ko-KR.rc b/reactos/dll/win32/shell32/lang/ko-KR.rc index eae30075385..4244428718b 100644 --- a/reactos/dll/win32/shell32/lang/ko-KR.rc +++ b/reactos/dll/win32/shell32/lang/ko-KR.rc @@ -378,22 +378,21 @@ STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION CAPTION "General" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - -GROUPBOX "Tasks", -1, 7, 10, 249, 45 -//ICON -AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP -AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP -GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP -//ICON -AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP -AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP -GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 -//ICON -AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP -PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP + GROUPBOX "Tasks", -1, 7, 10, 249, 45 + ICON "", 30109, 14, 25, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP + AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP + GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP + ICON "", 30110, 14, 70, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP + AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP + GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 + ICON "", 30111, 14, 120, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP + PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP END FOLDER_OPTIONS_VIEW_DLG DIALOGEX 0, 0, 264, 256 @@ -639,6 +638,9 @@ BEGIN IDS_PROPERTIES "Properties" IDS_CUT "Cut" IDS_RESTORE "Restore" + IDS_FORMATDRIVE "Format..." + IDS_RENAME "Rename" + IDS_INSERT "Insert" IDS_CREATEFOLDER_DENIED "Unable to create new Folder: Permission denied." IDS_CREATEFOLDER_CAPTION "Error during creation of a new folder" diff --git a/reactos/dll/win32/shell32/lang/nl-NL.rc b/reactos/dll/win32/shell32/lang/nl-NL.rc index 9a3aef600af..8f63cb2c2aa 100644 --- a/reactos/dll/win32/shell32/lang/nl-NL.rc +++ b/reactos/dll/win32/shell32/lang/nl-NL.rc @@ -378,22 +378,21 @@ STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION CAPTION "General" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - -GROUPBOX "Tasks", -1, 7, 10, 249, 45 -//ICON -AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP -AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP -GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP -//ICON -AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP -AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP -GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 -//ICON -AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP -PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP + GROUPBOX "Tasks", -1, 7, 10, 249, 45 + ICON "", 30109, 14, 25, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP + AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP + GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP + ICON "", 30110, 14, 70, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP + AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP + GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 + ICON "", 30111, 14, 120, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP + PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP END FOLDER_OPTIONS_VIEW_DLG DIALOGEX 0, 0, 264, 256 @@ -639,6 +638,9 @@ BEGIN IDS_PROPERTIES "Properties" IDS_CUT "Cut" IDS_RESTORE "Restore" + IDS_FORMATDRIVE "Format..." + IDS_RENAME "Rename" + IDS_INSERT "Insert" IDS_CREATEFOLDER_DENIED "Unable to create new Folder: Permission denied." IDS_CREATEFOLDER_CAPTION "Error during creation of a new folder" diff --git a/reactos/dll/win32/shell32/lang/no-NO.rc b/reactos/dll/win32/shell32/lang/no-NO.rc index 7d71a5a0058..f1269cd40c9 100644 --- a/reactos/dll/win32/shell32/lang/no-NO.rc +++ b/reactos/dll/win32/shell32/lang/no-NO.rc @@ -149,7 +149,7 @@ END SHELL_RUN_DLG DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "" +CAPTION "Kjшr" FONT 8, "MS Shell Dlg" BEGIN ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE @@ -167,11 +167,11 @@ CAPTION "Snarvei" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN ICON "", 14000, 10, 5, 30, 30, WS_VISIBLE - LTEXT "Target type:", 14004, 10, 30, 50, 10 + LTEXT "Plasseringstype:", 14004, 10, 30, 50, 10 LTEXT "", 14005, 70, 30, 150, 10 - LTEXT "Target sted:", 14006, 10, 40, 70, 10 + LTEXT "Plasseringssted:", 14006, 10, 40, 70, 10 LTEXT "", 14007, 70, 40, 150, 10 - LTEXT "Target:", 14008, 10, 55, 45, 10 + LTEXT "Plassering:", 14008, 10, 55, 45, 10 EDITTEXT 14009, 70, 55, 150, 10, ES_LEFT | ES_AUTOHSCROLL LTEXT "&Start i:",14010, 10, 65, 57, 10 EDITTEXT 14011, 70, 65, 150, 10, ES_LEFT | ES_AUTOHSCROLL @@ -188,17 +188,39 @@ END SHELL_EXTENDED_SHORTCUT_DLG DIALOGEX 0, 0, 230, 150 STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION -CAPTION "Utvidet Egenskaper" +CAPTION "Avanserte egenskaper" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN LTEXT "Velg avansert egenskaper som du vil for denne snarveien.", -1, 5, 30, 210, 10 - CHECKBOX "Kjшr med forskjellig credentials", 14000, 25, 50, 150, 10 - LTEXT "Dette valget vil godta deg е kjшre denne snarveien med en annen bruker, eller fortsette som deg selv mens du beskytter din datamaskin og data fra uautorisert program aktivitet.", -1, 50, 60, 175, 40 - CHECKBOX "Kjшr i seperat ledig minne plass", 14001, 25, 100, 90, 10, WS_DISABLED + CHECKBOX "Kjшr som administrator", 14000, 25, 50, 150, 10 + LTEXT "Med dette valget kan du kjшre denne snarveien med som en administrator, mens du beskytter din datamaskin og data fra uautorisert program aktivitet.", -1, 50, 60, 175, 40 + CHECKBOX "Kjшr i seperat minneplass", 14001, 25, 100, 90, 10, WS_DISABLED PUSHBUTTON "OK", IDOK, 25, 120, 50, 15, WS_VISIBLE PUSHBUTTON "Avbryt", IDCANCEL, 120, 120, 50, 15, WS_VISIBLE END +SHELL_FOLDER_GENERAL_DLG DIALOGEX 0, 0, 240, 205 +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Generielt" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + ICON "", 14000, 10, 3, 30, 30, WS_VISIBLE + EDITTEXT 14001, 70, 9, 158, 14, ES_LEFT | ES_READONLY + LTEXT "Filtype:", 14004, 8, 35, 50, 10 + LTEXT "Mappe", 14005, 68, 35, 160, 10 + LTEXT "Lokalisjon:", 14006, 8, 53, 50, 10 + LTEXT "", 14007, 68, 53, 315, 10 + LTEXT "Stшrrelse:", 14008, 8, 72, 45, 10 + LTEXT "", 14009, 68, 72, 315, 10 + LTEXT "Inneholder:", 14010, 8, 93, 45, 10 + LTEXT "", 14011, 68, 93, 160, 10 + LTEXT "Opprettet:", 14014, 8, 118, 45, 10 + LTEXT "", 14015, 68, 118, 160, 10 + AUTOCHECKBOX "&Bare-lesbar", 14021, 45, 150, 67, 10 + AUTOCHECKBOX "&Skjult", 14022, 126, 150, 50, 10 +END + + SHELL_FILE_GENERAL_DLG DIALOGEX 0, 0, 240, 205 STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Generielt" @@ -237,7 +259,7 @@ BEGIN LTEXT "", 14003, 77, 27, 152, 10 LTEXT "Enerett: ", 14004, 10, 46, 66, 10 LTEXT "", 14005, 77, 46, 152, 10 - GROUPBOX "Other version information: ", 14006, 6, 70, 222, 115 + GROUPBOX "Annet versjon informasjon: ", 14006, 6, 70, 222, 115 LTEXT "Enhetsnavn: ", 14007, 13, 82, 50, 10 LTEXT "Verdi: ", 14008, 112, 82, 45, 10 LISTBOX 14009, 12, 94, 94, 83, LBS_STANDARD | WS_TABSTOP | LBS_NOTIFY @@ -288,7 +310,7 @@ BEGIN PUSHBUTTON "Kontroller nе...", 14000, 130, 45, 90, 15, WS_TABSTOP GROUPBOX "Defragmentering", -1, 5, 65, 230, 60 LTEXT "Dette alternativet defragmenterer filene pе volumet.", -1, 40, 85, 160, 20 - PUSHBUTTON "Defragmenter Nе...", 14001, 130, 105, 90, 15, WS_TABSTOP + PUSHBUTTON "Defragmenter nе...", 14001, 130, 105, 90, 15, WS_TABSTOP GROUPBOX "Sikkerhetskopi", -1, 5, 130, 230, 60 LTEXT "Dette alternativet tar sikkerhetskopi av filene pе volumet.", -1, 40, 150, 160, 20 PUSHBUTTON "Ta sikkerhetskopi...", 14002, 130, 170, 90, 15, WS_TABSTOP @@ -307,7 +329,7 @@ CAPTION "Kj FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN LTEXT "Hvilken brukerkonto vil du bruke for е kjшre dette programmet?", -1, 10, 20, 220, 20 - CHECKBOX "Current User %s", 14000, 10, 45, 150, 10 + CHECKBOX "Fшlgende bruker %s", 14000, 10, 45, 150, 10 LTEXT "Beskytt min datamaskin og data fra uautorisert program aktivitet", -1, 25, 57, 200, 10, WS_DISABLED CHECKBOX "Dette valget kan forebygge data virus fra е uskadeliggjшre din datamaskin eller personlige data, men utvelging det skulle kanskje forеrsake program til funksjon formatfeil.", 14001, 25, 68, 200, 30, WS_DISABLED | BS_MULTILINE CHECKBOX "Fшlgende bruker:", 14002, 10, 100, 90, 10 @@ -357,22 +379,21 @@ STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION CAPTION "Generielt" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - -GROUPBOX "Oppgaver", -1, 7, 10, 249, 45 -//ICON -AUTORADIOBUTTON "Vis felles oppgaver i &mapper", 14001, 40, 25, 120, 10, WS_TABSTOP -AUTORADIOBUTTON "Bruk ReactOS klass&isk mapper", 14002, 40, 37, 120, 10, WS_TABSTOP -GROUPBOX "Utforsk mapper", -1, 7, 60, 249, 45, WS_TABSTOP -//ICON -AUTORADIOBUTTON "Еpne hver mapper i sa&mme vindu", 14004, 40, 70, 140, 10, WS_TABSTOP -AUTORADIOBUTTON "Еpne hver mapper i sitt egen &vindu", 14005, 40, 82, 140, 10, WS_TABSTOP -GROUPBOX "Klikk enheter som fшlgende", -1, 7, 110, 249, 60 -//ICON -AUTORADIOBUTTON "&Enkelt-klikk for е еpne en enhet (peker for е velge)", 14007, 40, 120, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Utheve ikon titteler konsekvent med min &utforsker", 14008, 50, 132, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "UUtheve ikon titteler bare mens jeg &peker pе de", 14009, 50, 144, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "&Dobbelt klikk for е еpne enheten (Enkelt-klikk for е velge)", 14010, 40, 156, 170, 10, WS_TABSTOP -PUSHBUTTON "&Gjenopprette standard", 14011, 180, 180, 60, 14, WS_TABSTOP + GROUPBOX "Oppgaver", -1, 7, 10, 249, 45 + ICON "", 30109, 14, 25, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Vis felles oppgaver i &mapper", 14001, 40, 25, 120, 10, WS_TABSTOP + AUTORADIOBUTTON "Bruk ReactOS klass&isk mapper", 14002, 40, 37, 120, 10, WS_TABSTOP + GROUPBOX "Utforsk mapper", -1, 7, 60, 249, 45, WS_TABSTOP + ICON "", 30110, 14, 70, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Еpne hver mapper i sa&mme vindu", 14004, 40, 70, 140, 10, WS_TABSTOP + AUTORADIOBUTTON "Еpne hver mapper i sitt egen &vindu", 14005, 40, 82, 140, 10, WS_TABSTOP + GROUPBOX "Klikk enheter som fшlgende", -1, 7, 110, 249, 60 + ICON "", 30111, 14, 120, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "&Enkelt-klikk for е еpne en enhet (peker for е velge)", 14007, 40, 120, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Utheve ikon titteler konsekvent med min &utforsker", 14008, 50, 132, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "UUtheve ikon titteler bare mens jeg &peker pе de", 14009, 50, 144, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "&Dobbelt klikk for е еpne enheten (Enkelt-klikk for е velge)", 14010, 40, 156, 170, 10, WS_TABSTOP + PUSHBUTTON "&Gjenopprette standard", 14011, 180, 180, 60, 14, WS_TABSTOP END FOLDER_OPTIONS_VIEW_DLG DIALOGEX 0, 0, 264, 256 @@ -453,21 +474,21 @@ END AUTOPLAY1_DLG DIALOGEX 0, 0, 227, 218 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUPWINDOW | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CAPTION -CAPTION "AutoPlay" +CAPTION "Autostart" FONT 8, "MS Shell Dlg" BEGIN - LTEXT "&Select a content type, then choose an action for ReactOS to perform automatically when that type is used in this device:", 1000, 7, 7, 215, 20 + LTEXT "&Velg en innhold type, ogsе velg en handling for ReactOS for е gjennomfшre automatisk nеr denne type er brukt til denne enheten:", 1000, 7, 7, 215, 20 CONTROL "", 1001, "COMBOBOXEX32", WS_TABSTOP | 0x00000043, 7, 27, 212, 200 GROUPBOX "Handlinger", -1, 7, 45, 212, 146 AUTORADIOBUTTON "Velg en handling for е &utfшre:", 1005, 14, 54, 202, 10, WS_GROUP CONTROL "LIST2", 1002, "SYSLISTVIEW32", WS_BORDER | WS_TABSTOP | 0x0000C04D, 22, 66, 192, 107 - AUTORADIOBUTTON "Prompt me each time to &choose an action", 1006, 14, 177, 202, 10 + AUTORADIOBUTTON "Velg denne handlingen hver gang jeg &utfшrer denne handlingen", 1006, 14, 177, 202, 10 PUSHBUTTON "&Gjenopprett standard", 1008, 108, 197, 110, 14, WS_DISABLED END MIXED_CONTENT1_DLG DIALOGEX 0, 0, 227, 207 STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CAPTION -CAPTION "Mixed Content" +CAPTION "Mikset innhold" FONT 8, "MS Shell Dlg" BEGIN ICON "", 1000, 5, 7, 21, 20 @@ -480,7 +501,7 @@ END MIXED_CONTENT2_DLG DIALOGEX 0, 0, 227, 206 STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CAPTION -CAPTION "Mixed Content" +CAPTION "Mikset innhold" FONT 8, "MS Shell Dlg" BEGIN ICON "", 1000, 5, 7, 21, 20 @@ -496,7 +517,7 @@ END AUTOPLAY2_DLG DIALOGEX 0, 0, 227, 181 STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CAPTION -CAPTION "Autoplay" +CAPTION "Autostart" FONT 8, "MS Shell Dlg" BEGIN ICON "", 1000, 5, 7, 21, 20 @@ -516,7 +537,7 @@ BEGIN ICON 8240, -1, 6, 6, 21, 20, SS_REALSIZECONTROL | WS_GROUP LTEXT "Hva vil du at datamaskinen skal gjшre?", -1, 39, 7, 167, 10 COMBOBOX 8224, 39, 20, 165, 200, CBS_DROPDOWNLIST | WS_VSCROLL - LTEXT "Maintains your session, keeping the computer running on low power with data still in memory. The computer wakes up when you press a key or move the mouse.", 8225, 39, 40, 167, 37 + LTEXT "Behandle din sesjon, din datamaskin bruker lite strшm nеr data er i minnet. Datamaskinen vil vеkne hvis du trykker pе en tast eller beveger pе musen.", 8225, 39, 40, 167, 37 DEFPUSHBUTTON "OK", 1, 7, 82, 60, 14, WS_GROUP PUSHBUTTON "Avbryt", IDCANCEL, 75, 82, 60, 14 PUSHBUTTON "&Hjelp", IDHELP, 144, 82, 60, 14 @@ -534,9 +555,9 @@ BEGIN LTEXT "&Filsystem", -1, 7, 35, 170, 9 COMBOBOX 28677, 7, 46, 170, 200, CBS_DROPDOWNLIST | WS_VSCROLL | NOT WS_TABSTOP CONTROL "", 28678, "MSCTLS_PROGRESS32", 0, 7, 181, 170, 8 - LTEXT "&Allocation unit size", -1, 7, 64, 170, 9 + LTEXT "&Stшrrelse pе tildelingsenheten", -1, 7, 64, 170, 9 COMBOBOX 28680, 7, 75, 170, 200, CBS_DROPDOWNLIST | WS_VSCROLL | NOT WS_TABSTOP - LTEXT "Volum &label", -1, 7, 93, 170, 9 + LTEXT "Volum&navn", -1, 7, 93, 170, 9 EDITTEXT 28679, 7, 103, 170, 13, ES_AUTOHSCROLL GROUPBOX "Formatterings &valg", 4610, 7, 121, 170, 49 AUTOCHECKBOX "&Rask formattering", 28674, 16, 135, 155, 10 @@ -545,24 +566,25 @@ END CHKDSK_DLG DIALOGEX 50, 50, 194, 120 STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION -CAPTION "Check Disk" +CAPTION "Kontroller disken" FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "Start", IDOK, 53, 100, 60, 14 - GROUPBOX "Check disk options", -1, 7, 6, 179, 50 - PUSHBUTTON "Cancel", IDCANCEL, 118, 100, 60, 14 - AUTOCHECKBOX "Automatically fix file system errors", 14000, 16, 15, 155, 10 - AUTOCHECKBOX "&Scan for and attempt recovery of bad sectors", 14001, 16, 30, 165, 10 + GROUPBOX "Alternativer for diskkontroll", -1, 7, 6, 179, 50 + PUSHBUTTON "Avbryt", IDCANCEL, 118, 100, 60, 14 + AUTOCHECKBOX "Reparer feil i filsysten automatisk", 14000, 16, 15, 155, 10 + AUTOCHECKBOX "&Sшk etter og forsшk е reparere skadet sektorer", 14001, 16, 30, 165, 10 CONTROL "", 14002, "MSCTLS_PROGRESS32", 16, 7, 60, 170, 8 LTEXT "", 14003, 60, 80, 170, 10 END + IDD_PICK_ICON_DIALOG DIALOGEX 0, 0, 237, 204 STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION -CAPTION "Endre Ikon" +CAPTION "Endre ikon" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - LTEXT "Filename:", -1, 7, 14, 208, 10 + LTEXT "Filnavn:", -1, 7, 14, 208, 10 PUSHBUTTON "Utforsk...",IDC_BUTTON_PATH, 148, 24,67,14 EDITTEXT IDC_EDIT_PATH, 6, 24, 135, 15, ES_AUTOHSCROLL LTEXT "Icons:", -1, 7, 47, 208, 10 @@ -585,25 +607,26 @@ BEGIN IDS_SHV_COLUMN9 "Kommentarer" IDS_SHV_COLUMN10 "Eier" IDS_SHV_COLUMN11 "Gruppe" - IDS_SHV_COLUMN12 "Filename" - IDS_SHV_COLUMN13 "Category" + IDS_SHV_COLUMN12 "Filnavn" + IDS_SHV_COLUMN13 "Kategori" IDS_SHV_COLUMN_DELFROM "Opprinnelig plassering" IDS_SHV_COLUMN_DELDATE "Dato slettet" - IDS_SHV_COLUMN_FONTTYPE "Fonttype" - IDS_SHV_COLUMN_WORKGROUP "Workgroup" - IDS_SHV_NETWORKLOCATION "Network Location" - IDS_SHV_COLUMN_DOCUMENTS "Documents" + IDS_SHV_COLUMN_FONTTYPE "Skrifttype" + IDS_SHV_COLUMN_WORKGROUP "Arbeidsgruppe" + IDS_SHV_NETWORKLOCATION "Nettverksplassering" + IDS_SHV_COLUMN_DOCUMENTS "Dokumenter" + IDS_SHV_COLUMN_STATUS "Status" - IDS_SHV_COLUMN_COMMENTS "Comments" - IDS_SHV_COLUMN_LOCATION "Location" - IDS_SHV_COLUMN_MODEL "Model" + IDS_SHV_COLUMN_COMMENTS "Kommentarer" + IDS_SHV_COLUMN_LOCATION "Plassering" + IDS_SHV_COLUMN_MODEL "Modell" /* special folders */ IDS_DESKTOP "Skrivebord" IDS_MYCOMPUTER "Min datamaskin" IDS_RECYCLEBIN_FOLDER_NAME "Papirkurv" IDS_CONTROLPANEL "Kontrollpanel" - IDS_ADMINISTRATIVETOOLS "Administrative Tools" + IDS_ADMINISTRATIVETOOLS "Administrative verktшy" /* context menus */ IDS_VIEW_LARGE "&Store ikoner" @@ -613,11 +636,14 @@ BEGIN IDS_SELECT "Velg" IDS_OPEN "Еpne" IDS_CREATELINK "&Opprett snarvei" - IDS_COPY "&Kopier" - IDS_DELETE "&Slett" - IDS_PROPERTIES "Egenska&per" - IDS_CUT "Klipp &ut" - IDS_RESTORE "Restore" + IDS_COPY "Kopier" + IDS_DELETE "Slett" + IDS_PROPERTIES "Egenskaper" + IDS_CUT "Klipp ut" + IDS_RESTORE "Gjenopprett" + IDS_FORMATDRIVE "Formatering..." + IDS_RENAME "Endre navn" + IDS_INSERT "Sett inn" IDS_CREATEFOLDER_DENIED "Kunne ikke opprette ny mappe: tilgang nektet." IDS_CREATEFOLDER_CAPTION "Klarte ikke opprette ny mappe" @@ -649,7 +675,7 @@ BEGIN IDS_FAVORITES "Favoritter" IDS_STARTUP "Start-meny\\Programmer\\Oppstart" IDS_RECENT "Siste" - IDS_SENDTO "SendTil" + IDS_SENDTO "Sendtil" IDS_STARTMENU "Start-meny" IDS_MYMUSIC "Min musikk" IDS_MYVIDEO "Mine videoklipp" @@ -688,13 +714,14 @@ BEGIN FCIDM_SHVIEW_NEWFOLDER "Ny &mappe" FCIDM_SHVIEW_NEWLINK "Ny &snarvei" IDS_FOLDER_OPTIONS "Mappe valg" - IDS_RECYCLEBIN_LOCATION "Papirkurv localtion" + IDS_RECYCLEBIN_LOCATION "Papirkurv plassering" IDS_RECYCLEBIN_DISKSPACE "Ledig plass" + IDS_EMPTY_BITBUCKET "Tшm papirkurven" IDS_PICK_ICON_TITLE "Velg Ikon" IDS_PICK_ICON_FILTER "Ikon Fil(*.ico, *.icl, *.exe, *.dll)\0*.ico;*.icl;*.exe;*.dll\0" IDS_OPEN_WITH_FILTER "Kjшrbare filer\0*.exe\0" IDS_DIRECTORY "Mappe" - IDS_VIRTUAL_DRIVER "Virtuell enhet driver" + IDS_VIRTUAL_DRIVER "Virtuell enhetdriver" IDS_BAT_FILE "ReactOS Batch fil" IDS_CMD_FILE "ReactOS Kommando skript" IDS_COM_FILE "Dos applikasjon" @@ -710,18 +737,19 @@ BEGIN IDS_LNK_FILE "Snarvei" IDS_SYS_FILE "Systemfil" - IDS_OPEN_VERB "Open" - IDS_RUNAS_VERB "Run as " - IDS_EDIT_VERB "Edit" - IDS_FIND_VERB "Find" - IDS_PRINT_VERB "Print" - IDS_PLAY_VERB "Play" - IDS_PREVIEW_VERB "Preview" + IDS_OPEN_VERB "Еpne" + IDS_RUNAS_VERB "Kjшr som" + IDS_EDIT_VERB "Rediger" + IDS_FIND_VERB "Finn" + IDS_PRINT_VERB "Skriv ut" + IDS_PLAY_VERB "Spill" + IDS_PREVIEW_VERB "Forhеndsvis" - IDS_FILE_FOLDER "%u Files, %u Folders" - IDS_PRINTERS "Printers" - IDS_FONTS "Fonts" - IDS_INSTALLNEWFONT "Install New Font..." + IDS_FILE_FOLDER "%u filer, %u mapper" + IDS_PRINTERS "Skrivere" + IDS_FONTS "Skrifttyper" + IDS_INSTALLNEWFONT "Installere nye skrifttyper..." + + IDS_DEFAULT_CLUSTER_SIZE "Standard tildelingsstшrrelse" - IDS_DEFAULT_CLUSTER_SIZE "Default allocation size" END diff --git a/reactos/dll/win32/shell32/lang/pl-PL.rc b/reactos/dll/win32/shell32/lang/pl-PL.rc index 2dd997f9dab..10cd2d418ee 100644 --- a/reactos/dll/win32/shell32/lang/pl-PL.rc +++ b/reactos/dll/win32/shell32/lang/pl-PL.rc @@ -335,7 +335,7 @@ CAPTION "Uruchom jako" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN LTEXT "Ktуre konto uїytkownika chcesz uїyж do uruchomienia tego programu?", -1, 10, 20, 220, 20 - CHECKBOX "Bierz№cy uїytkownik %s", 14000, 10, 45, 150, 10 + CHECKBOX "Bieї№cy uїytkownik %s", 14000, 10, 45, 150, 10 LTEXT "Zabezpiecz mуj komputer i dane przed nieautoryzowanym dziaіaniem programуw", -1, 25, 57, 200, 10, WS_DISABLED CHECKBOX "Ta opcja moїe zabezpieczyж twуj komputer lub dane na nim przed szkodliwymi programami, ale uїycie jej moїe spowodowaж nieprawidіowe dziaіanie programуw.", 14001, 25, 68, 200, 30, WS_DISABLED | BS_MULTILINE CHECKBOX "Nastкpuj№cy uїytkownik:", 14002, 10, 100, 90, 10 @@ -385,22 +385,21 @@ STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION CAPTION "Ogуlne" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - -GROUPBOX "Zadania", -1, 7, 10, 249, 45 -//ICON -AUTORADIOBUTTON "Pokaї podstawowe zadania w &katalogach", 14001, 40, 25, 120, 10, WS_TABSTOP -AUTORADIOBUTTON "Uїyj klasycznych katalogуw &ReactOS", 14002, 40, 37, 120, 10, WS_TABSTOP -GROUPBOX "Przegl№daj katalogi", -1, 7, 60, 249, 45, WS_TABSTOP -//ICON -AUTORADIOBUTTON "Otwуrz kaїdy katalog w tym &samym oknie", 14004, 40, 70, 140, 10, WS_TABSTOP -AUTORADIOBUTTON "Otwуrz kaїdy katalog w &osobnym oknie", 14005, 40, 82, 140, 10, WS_TABSTOP -GROUPBOX "Dziaіanie przyciskуw myszki", -1, 7, 110, 249, 60 -//ICON -AUTORADIOBUTTON "&Pojedyncze klikniкcie by otworzyж cel (najechanie by wskazaж)", 14007, 40, 120, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Po&dwуjne klikniкcie by otworzyж (pojedyncze klikniкcie by wskazaж)", 14010, 40, 156, 170, 10, WS_TABSTOP -PUSHBUTTON "&Ustawienia domyњlne", 14011, 180, 180, 60, 14, WS_TABSTOP + GROUPBOX "Zadania", -1, 7, 10, 249, 45 + ICON "", 30109, 14, 25, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Pokaї podstawowe zadania w &katalogach", 14001, 40, 25, 120, 10, WS_TABSTOP + AUTORADIOBUTTON "Uїyj klasycznych katalogуw &ReactOS", 14002, 40, 37, 120, 10, WS_TABSTOP + GROUPBOX "Przegl№daj katalogi", -1, 7, 60, 249, 45, WS_TABSTOP + ICON "", 30110, 14, 70, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Otwуrz kaїdy katalog w tym &samym oknie", 14004, 40, 70, 140, 10, WS_TABSTOP + AUTORADIOBUTTON "Otwуrz kaїdy katalog w &osobnym oknie", 14005, 40, 82, 140, 10, WS_TABSTOP + GROUPBOX "Dziaіanie przyciskуw myszki", -1, 7, 110, 249, 60 + ICON "", 30111, 14, 120, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "&Pojedyncze klikniкcie by otworzyж cel (najechanie by wskazaж)", 14007, 40, 120, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Podkreњ&laj tytuіy ikon tak jak w przegl№darce", 14008, 50, 132, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Podkreњlaj &tytuіy ikon tylko po najechaniu na nie kursorem", 14009, 50, 144, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Po&dwуjne klikniкcie by otworzyж (pojedyncze klikniкcie by wskazaж)", 14010, 40, 156, 170, 10, WS_TABSTOP + PUSHBUTTON "&Ustawienia domyњlne", 14011, 180, 180, 60, 14, WS_TABSTOP END FOLDER_OPTIONS_VIEW_DLG DIALOGEX 0, 0, 264, 256 @@ -573,14 +572,14 @@ END CHKDSK_DLG DIALOGEX 50, 50, 194, 120 STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION -CAPTION "Check Disk" +CAPTION "Sprawdzanie dyskуw" FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "Start", IDOK, 53, 100, 60, 14 - GROUPBOX "Check disk options", -1, 7, 6, 179, 50 - PUSHBUTTON "Cancel", IDCANCEL, 118, 100, 60, 14 - AUTOCHECKBOX "Automatically fix file system errors", 14000, 16, 15, 155, 10 - AUTOCHECKBOX "&Scan for and attempt recovery of bad sectors", 14001, 16, 30, 165, 10 + GROUPBOX "Opcje sprawdzania dyskуw", -1, 7, 6, 179, 50 + PUSHBUTTON "Anuluj", IDCANCEL, 118, 100, 60, 14 + AUTOCHECKBOX "Automatycznie naprawiaj bікdy systemu plikуw", 14000, 16, 15, 155, 10 + AUTOCHECKBOX "&Szukaj i prуbuj odzyskaж uszkodzone sektory", 14001, 16, 30, 165, 10 CONTROL "", 14002, "MSCTLS_PROGRESS32", 16, 7, 60, 170, 8 LTEXT "", 14003, 60, 80, 170, 10 END @@ -631,7 +630,7 @@ BEGIN IDS_MYCOMPUTER "Mуj komputer" IDS_RECYCLEBIN_FOLDER_NAME "Kosz" IDS_CONTROLPANEL "Panel Sterowania" - IDS_ADMINISTRATIVETOOLS "Administrative Tools" + IDS_ADMINISTRATIVETOOLS "Narzкdzia Administracyjne" /* context menus */ IDS_VIEW_LARGE "&Duїe Ikony" @@ -646,6 +645,9 @@ BEGIN IDS_PROPERTIES "Wіaњciwoњci" IDS_CUT "Wytnij" IDS_RESTORE "Przywrуж" + IDS_FORMATDRIVE "Formatuj..." + IDS_RENAME "Zmieс nazwк" + IDS_INSERT "Wіуї" IDS_CREATEFOLDER_DENIED "Nie mogк utworzyж nowego katalogu: Brak dostкpu." IDS_CREATEFOLDER_CAPTION "Bі№d przy tworzeniu nowego katalogu." @@ -695,9 +697,9 @@ BEGIN IDS_PROGRAM_FILES_COMMON "Program Files\\Common Files" IDS_COMMON_DOCUMENTS "Dokumenty" IDS_ADMINTOOLS "Menu Start\\Programy\\Narzкdzia administracyjne" - IDS_COMMON_MUSIC "Documenty\\Moja muzyka" - IDS_COMMON_PICTURES "Documenty\\Moje obrazy" - IDS_COMMON_VIDEO "Documenty\\Moje wideo" + IDS_COMMON_MUSIC "Dokumenty\\Moja muzyka" + IDS_COMMON_PICTURES "Dokumenty\\Moje obrazy" + IDS_COMMON_VIDEO "Dokumenty\\Moje wideo" IDS_CDBURN_AREA "Ustawienia lokalne\\Dane aplikacji\\Microsoft\\Nagrywanie dyskуw CD" IDS_NETWORKPLACE "Moja sieж" @@ -752,5 +754,5 @@ BEGIN IDS_FONTS "Czcionki" IDS_INSTALLNEWFONT "Zainstaluj Now№ Czcionkк..." - IDS_DEFAULT_CLUSTER_SIZE "Default allocation size" + IDS_DEFAULT_CLUSTER_SIZE "Domyњlny rozmiar jednostki alokacji" END diff --git a/reactos/dll/win32/shell32/lang/pt-BR.rc b/reactos/dll/win32/shell32/lang/pt-BR.rc index da7a4a4f932..3f66ce4e004 100644 --- a/reactos/dll/win32/shell32/lang/pt-BR.rc +++ b/reactos/dll/win32/shell32/lang/pt-BR.rc @@ -380,22 +380,21 @@ STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION CAPTION "General" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - -GROUPBOX "Tasks", -1, 7, 10, 249, 45 -//ICON -AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP -AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP -GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP -//ICON -AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP -AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP -GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 -//ICON -AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP -PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP + GROUPBOX "Tasks", -1, 7, 10, 249, 45 + ICON "", 30109, 14, 25, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP + AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP + GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP + ICON "", 30110, 14, 70, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP + AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP + GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 + ICON "", 30111, 14, 120, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP + PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP END FOLDER_OPTIONS_VIEW_DLG DIALOGEX 0, 0, 264, 256 @@ -641,6 +640,9 @@ BEGIN IDS_PROPERTIES "Propriedades" IDS_CUT "C&ortar" IDS_RESTORE "Restore" + IDS_FORMATDRIVE "Format..." + IDS_RENAME "Rename" + IDS_INSERT "Insert" IDS_CREATEFOLDER_DENIED "Nгo pode criar nova pasta: Permissгo negada." IDS_CREATEFOLDER_CAPTION "Erro durante a criaзгo da nova pasta" diff --git a/reactos/dll/win32/shell32/lang/pt-PT.rc b/reactos/dll/win32/shell32/lang/pt-PT.rc index cc6c78f9a42..5ca01e8f812 100644 --- a/reactos/dll/win32/shell32/lang/pt-PT.rc +++ b/reactos/dll/win32/shell32/lang/pt-PT.rc @@ -380,22 +380,21 @@ STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION CAPTION "General" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - -GROUPBOX "Tasks", -1, 7, 10, 249, 45 -//ICON -AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP -AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP -GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP -//ICON -AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP -AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP -GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 -//ICON -AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP -PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP + GROUPBOX "Tasks", -1, 7, 10, 249, 45 + ICON "", 30109, 14, 25, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP + AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP + GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP + ICON "", 30110, 14, 70, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP + AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP + GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 + ICON "", 30111, 14, 120, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP + PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP END FOLDER_OPTIONS_VIEW_DLG DIALOGEX 0, 0, 264, 256 @@ -641,6 +640,9 @@ BEGIN IDS_PROPERTIES "Properties" IDS_CUT "Cut" IDS_RESTORE "Restore" + IDS_FORMATDRIVE "Format..." + IDS_RENAME "Rename" + IDS_INSERT "Insert" IDS_CREATEFOLDER_DENIED "Nгo й possнvel criar nova pasta: Permissгo negada." IDS_CREATEFOLDER_CAPTION "Erro durante a criaзгo da nova pasta" diff --git a/reactos/dll/win32/shell32/lang/ru-RU.rc b/reactos/dll/win32/shell32/lang/ru-RU.rc index 5da6844743f..e88f25deda6 100644 --- a/reactos/dll/win32/shell32/lang/ru-RU.rc +++ b/reactos/dll/win32/shell32/lang/ru-RU.rc @@ -373,59 +373,59 @@ BEGIN PUSHBUTTON "Отмена", 14006, 206, 236, 50, 14 END -FOLDER_OPTIONS_GENERAL_DLG DIALOGEX 0, 0, 264, 256 +FOLDER_OPTIONS_GENERAL_DLG DIALOGEX 0, 0, 264, 238 STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION CAPTION "Общие" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN -GROUPBOX "Задачи", -1, 7, 10, 249, 45 -//ICON -AUTORADIOBUTTON "Отобра&жение списка типичных задач в папках", 14001, 40, 25, 120, 10, WS_TABSTOP -AUTORADIOBUTTON "Использовать обы&чные папки ReactOS", 14002, 40, 37, 120, 10, WS_TABSTOP -GROUPBOX "Обзор папок", -1, 7, 60, 249, 45, WS_TABSTOP -//ICON -AUTORADIOBUTTON "&Открывать папки в одном и том же окне", 14004, 40, 70, 140, 10, WS_TABSTOP -AUTORADIOBUTTON "О&ткрывать каждую папку в отдельном окне", 14005, 40, 82, 140, 10, WS_TABSTOP -GROUPBOX "Щелчки мышью", -1, 7, 110, 249, 60 -//ICON -AUTORADIOBUTTON "От&крывать одним щелчком, выделять указателем", 14007, 40, 120, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Подчеркив&ать подписи значков", 14008, 50, 132, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Подчеркивать подписи з&начков при наведении", 14009, 50, 144, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Откр&ывать двойным, а выделять одним щелчком", 14010, 40, 156, 170, 10, WS_TABSTOP -PUSHBUTTON "&Восстановить умолчания", 14011, 180, 180, 60, 14, WS_TABSTOP + GROUPBOX "Задачи", -1, 7, 10, 249, 45 + ICON "", 30109, 14, 24, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Отобра&жение списка типичных задач в папках", 14001, 40, 24, 185, 10, WS_TABSTOP + AUTORADIOBUTTON "Использовать обы&чные папки ReactOS", 14002, 40, 36, 185, 10, WS_TABSTOP + GROUPBOX "Обзор папок", -1, 7, 60, 249, 45, WS_TABSTOP + ICON "", 30110, 14, 75, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "&Открывать папки в одном и том же окне", 14004, 40, 75, 185, 10, WS_TABSTOP + AUTORADIOBUTTON "О&ткрывать каждую папку в отдельном окне", 14005, 40, 87, 185, 10, WS_TABSTOP + GROUPBOX "Щелчки мышью", -1, 7, 110, 249, 60 + ICON "", 30111, 14, 120, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "От&крывать одним щелчком, выделять указателем", 14007, 40, 120, 200, 10, WS_TABSTOP + AUTORADIOBUTTON "Подчеркив&ать подписи значков", 14008, 50, 132, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Подчеркивать подписи з&начков при наведении", 14009, 50, 144, 185, 10, WS_TABSTOP + AUTORADIOBUTTON "Откр&ывать двойным, а выделять одним щелчком", 14010, 40, 156, 195, 10, WS_TABSTOP + PUSHBUTTON "&Восстановить умолчания", 14011, 148, 180, 104, 14, WS_TABSTOP END -FOLDER_OPTIONS_VIEW_DLG DIALOGEX 0, 0, 264, 256 +FOLDER_OPTIONS_VIEW_DLG DIALOGEX 0, 0, 264, 238 STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION CAPTION "Вид" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN GROUPBOX "Представление папок", -1, 7, 10, 249, 60 //ICON -LTEXT "Можно применить вид, выбранный для этой папки, например, ""Таблица"" или ""Плитка"", ко всем папкам.", -1, 60, 20, 180, 20 -PUSHBUTTON "&Применить ко всем папкам", 14001, 60, 50, 80, 14, WS_TABSTOP -PUSHBUTTON "&Сброс для всех папок", 14002, 150, 50, 80, 14, WS_TABSTOP -LTEXT "Дополнительные параметры:", -1, 7, 80, 100, 10 +LTEXT "Можно применить вид, выбранный для этой папки, например, ""Таблица"" или ""Плитка"", ко всем папкам.", -1, 60, 24, 180, 20 +PUSHBUTTON "&Применить ко всем папкам", 14001, 60, 50, 100, 14, WS_TABSTOP +PUSHBUTTON "&Сброс для всех папок", 14002, 164, 50, 80, 14, WS_TABSTOP +LTEXT "Дополнительные параметры:", -1, 9, 78, 120, 10 CONTROL "", 14003, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS | WS_BORDER | WS_TABSTOP, 7, 90, 249, 120 -PUSHBUTTON "&Восстановить умолчания", 14004, 180, 210, 80, 14, WS_TABSTOP +PUSHBUTTON "&Восстановить умолчания", 14004, 156, 216, 101, 14, WS_TABSTOP END -FOLDER_OPTIONS_FILETYPES_DLG DIALOGEX 0, 0, 264, 256 +FOLDER_OPTIONS_FILETYPES_DLG DIALOGEX 0, 0, 264, 238 STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION CAPTION "Типы файлов" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN -LTEXT "&Зарегистрированные типы файлов:", -1, 7, 10, 70, 10 +LTEXT "&Зарегистрированные типы файлов:", -1, 9, 7, 133, 10 CONTROL "", 14000, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHAREIMAGELISTS | WS_BORDER | WS_TABSTOP, 7, 20, 249, 80 -PUSHBUTTON "&Создать", 14001, 120, 110, 50, 14, WS_TABSTOP -PUSHBUTTON "&Удалить", 14002, 180, 110, 50, 14, WS_TABSTOP +PUSHBUTTON "&Создать", 14001, 147, 110, 50, 14, WS_TABSTOP +PUSHBUTTON "&Удалить", 14002, 202, 110, 50, 14, WS_TABSTOP GROUPBOX "Описание расширения '%s'", 14003, 7, 130, 249, 70 -LTEXT "Открывать в:", -1, 12, 140, 40, 10 +LTEXT "Открывать в:", -1, 12, 142, 54, 10 //ICON -LTEXT "Приложение:", 14005, 100, 140, 40, 10 -PUSHBUTTON "&Изменить...", 14006, 180, 140, 50, 14, WS_TABSTOP -LTEXT "Файлы с расширением '%s' имеют тип '%s'. Для\nизменения параметров всех файлов '%s', нажмите\n""Дополнительно"".", 14007, 12, 155, 160, 30 -PUSHBUTTON "До&полнительно", 14008, 180, 175, 50, 14, WS_TABSTOP +LTEXT "Приложение:", 14005, 100, 142, 54, 10 +PUSHBUTTON "&Изменить...", 14006, 180, 140, 63, 14, WS_TABSTOP +LTEXT "Файлы с расширением '%s' имеют тип '%s'. Для изменения параметров всех файлов '%s', нажмите ""Дополнительно"".", 14007, 12, 155, 162, 36 +PUSHBUTTON "До&полнительно", 14008, 180, 175, 63, 14, WS_TABSTOP END CONFIRM_FILE_REPLACE_DLG DIALOGEX 0, 0, 282, 143 @@ -563,18 +563,18 @@ BEGIN AUTOCHECKBOX "&Использовать сжатие", 28675, 16, 152, 155, 10 END -CHKDSK_DLG DIALOGEX 50, 50, 194, 120 +CHKDSK_DLG DIALOGEX 50, 50, 232, 111 STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION -CAPTION "Check Disk" +CAPTION "Проверка диска" FONT 8, "MS Shell Dlg" BEGIN - DEFPUSHBUTTON "Start", IDOK, 53, 100, 60, 14 - GROUPBOX "Check disk options", -1, 7, 6, 179, 50 - PUSHBUTTON "Cancel", IDCANCEL, 118, 100, 60, 14 - AUTOCHECKBOX "Automatically fix file system errors", 14000, 16, 15, 155, 10 - AUTOCHECKBOX "&Scan for and attempt recovery of bad sectors", 14001, 16, 30, 165, 10 - CONTROL "", 14002, "MSCTLS_PROGRESS32", 16, 7, 60, 170, 8 - LTEXT "", 14003, 60, 80, 170, 10 + DEFPUSHBUTTON "Запуск", IDOK, 101, 91, 60, 14 + GROUPBOX "Параметры проверки диска", -1, 7, 5, 218, 50 + PUSHBUTTON "Отмена", IDCANCEL, 165, 91, 60, 14 + AUTOCHECKBOX "&Автоматически исправлять системные ошибки", 14000, 16, 19, 178, 10 + AUTOCHECKBOX "&Проверять и востанавливать поврежденные сектора", 14001, 16, 35, 200, 10 + CONTROL "", 14002, "MSCTLS_PROGRESS32", 16, 7, 60, 218, 8 + LTEXT "", 14003, 7, 75, 218, 10 END IDD_PICK_ICON_DIALOG DIALOGEX 0, 0, 237, 204 @@ -623,7 +623,7 @@ BEGIN IDS_MYCOMPUTER "Мой компьютер" IDS_RECYCLEBIN_FOLDER_NAME "Корзина" IDS_CONTROLPANEL "Панель управления" - IDS_ADMINISTRATIVETOOLS "Administrative Tools" + IDS_ADMINISTRATIVETOOLS "Администрирование" /* context menus */ IDS_VIEW_LARGE "&Большие значки" @@ -638,6 +638,9 @@ BEGIN IDS_PROPERTIES "Свойства" IDS_CUT "Вырезать" IDS_RESTORE "Востановить" + IDS_FORMATDRIVE "Форматировать..." + IDS_RENAME "Переименовать" + IDS_INSERT "Вставить" IDS_CREATEFOLDER_DENIED "Невозможно создать папку - нет полномочий." IDS_CREATEFOLDER_CAPTION "Ошибка во время создания папки" @@ -743,5 +746,5 @@ BEGIN IDS_FONTS "Шрифты" IDS_INSTALLNEWFONT "Установить новый шрифт..." - IDS_DEFAULT_CLUSTER_SIZE "Default allocation size" + IDS_DEFAULT_CLUSTER_SIZE "Выделяемый по умолчанию размер" END diff --git a/reactos/dll/win32/shell32/lang/sk-SK.rc b/reactos/dll/win32/shell32/lang/sk-SK.rc index d8ebb75e35f..8b660b39d26 100644 --- a/reactos/dll/win32/shell32/lang/sk-SK.rc +++ b/reactos/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: 30-07-2008 + * LAST CHANGE: 16-08-2008 */ /* @@ -56,12 +56,12 @@ BEGIN END MENUITEM "Zarovnaќ ikony", FCIDM_SHVIEW_SNAPTOGRID MENUITEM SEPARATOR - MENUITEM "Obnoviќ", FCIDM_SHVIEW_REFRESH + MENUITEM "&Obnoviќ", FCIDM_SHVIEW_REFRESH MENUITEM SEPARATOR MENUITEM "&Prilepiќ", FCIDM_SHVIEW_INSERT MENUITEM "Prilepiќ od&kaz", FCIDM_SHVIEW_INSERTLINK MENUITEM SEPARATOR - MENUITEM "Vlastnosti", FCIDM_SHVIEW_PROPERTIES + MENUITEM "Vl&astnosti", FCIDM_SHVIEW_PROPERTIES END END @@ -384,22 +384,21 @@ STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION CAPTION "Vљeobecnй" //General FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - -GROUPBOX "Ъlohy", -1, 7, 10, 249, 45 -//ICON -AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP -AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP -GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP -//ICON -AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP -AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP -GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 -//ICON -AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP -PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP + GROUPBOX "Ъlohy", -1, 7, 10, 249, 45 + ICON "", 30109, 14, 25, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP + AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP + GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP + ICON "", 30110, 14, 70, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP + AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP + GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 + ICON "", 30111, 14, 120, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP + PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP END FOLDER_OPTIONS_VIEW_DLG DIALOGEX 0, 0, 264, 256 @@ -572,14 +571,14 @@ END CHKDSK_DLG DIALOGEX 50, 50, 194, 120 STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION -CAPTION "Check Disk" +CAPTION "Kontrola disku" FONT 8, "MS Shell Dlg" BEGIN - DEFPUSHBUTTON "Start", IDOK, 53, 100, 60, 14 - GROUPBOX "Check disk options", -1, 7, 6, 179, 50 - PUSHBUTTON "Cancel", IDCANCEL, 118, 100, 60, 14 - AUTOCHECKBOX "Automatically fix file system errors", 14000, 16, 15, 155, 10 - AUTOCHECKBOX "&Scan for and attempt recovery of bad sectors", 14001, 16, 30, 165, 10 + DEFPUSHBUTTON "&Spustiќ", IDOK, 53, 100, 60, 14 + GROUPBOX "Moћnosti kontroly disku", -1, 7, 6, 179, 50 + PUSHBUTTON "Zruљiќ", IDCANCEL, 118, 100, 60, 14 + AUTOCHECKBOX "&Automaticky opraviќ chyby v systэme sъborov", 14000, 16, 15, 155, 10 + AUTOCHECKBOX "Vy&hѕadaќ a pokъsiќ sa obnoviќ chybnй sektory", 14001, 16, 30, 165, 10 CONTROL "", 14002, "MSCTLS_PROGRESS32", 16, 7, 60, 170, 8 LTEXT "", 14003, 60, 80, 170, 10 END @@ -613,14 +612,14 @@ BEGIN IDS_SHV_COLUMN10 "Vlastnнk" IDS_SHV_COLUMN11 "Skupina" IDS_SHV_COLUMN12 "Filename" - IDS_SHV_COLUMN13 "Category" + IDS_SHV_COLUMN13 "Kategуria" IDS_SHV_COLUMN_DELFROM "Pфvod" //Pфvodnй umiestnenie IDS_SHV_COLUMN_DELDATE "Odstrбnenэ" //Dбtum zmazania IDS_SHV_COLUMN_FONTTYPE "Fonttype" IDS_SHV_COLUMN_WORKGROUP "Workgroup" IDS_SHV_NETWORKLOCATION "Network Location" - IDS_SHV_COLUMN_DOCUMENTS "Documents" - IDS_SHV_COLUMN_STATUS "Status" + IDS_SHV_COLUMN_DOCUMENTS "Dokumenty" + IDS_SHV_COLUMN_STATUS "Stav" IDS_SHV_COLUMN_COMMENTS "Comments" IDS_SHV_COLUMN_LOCATION "Location" IDS_SHV_COLUMN_MODEL "Model" @@ -630,7 +629,7 @@ BEGIN IDS_MYCOMPUTER "Tento poинtaи" IDS_RECYCLEBIN_FOLDER_NAME "Kфљ" IDS_CONTROLPANEL "Ovlбdacн panel" - IDS_ADMINISTRATIVETOOLS "Administrative Tools" + IDS_ADMINISTRATIVETOOLS "Nбstroje na sprбvu" /* context menus */ IDS_VIEW_LARGE "&Veѕkй ikony" @@ -638,13 +637,16 @@ BEGIN IDS_VIEW_LIST "&Zoznam" IDS_VIEW_DETAILS "&Podrobnosti" IDS_SELECT "Vybraќ" - IDS_OPEN "Otvoriќ" + IDS_OPEN "&Otvoriќ" IDS_CREATELINK "Vytvoriќ o&dkaz" - IDS_COPY "&Kopнrova" - IDS_DELETE "&Odstrбni" + IDS_COPY "&Kopнrovaќ" + IDS_DELETE "Odstrбniќ" IDS_PROPERTIES "Vl&astnosti" IDS_CUT "&Vystrihnъќ" - IDS_RESTORE "Restore" + IDS_RESTORE "&Obnoviќ" + IDS_FORMATDRIVE "Format..." + IDS_RENAME "Rename" + IDS_INSERT "Insert" IDS_CREATEFOLDER_DENIED "Nie je moћnй vytvoriќ novэ prieиinok: Prнstup zamietnutэ." IDS_CREATEFOLDER_CAPTION "Chyba poиas vytvбrania novйho prieиinka" @@ -727,7 +729,7 @@ BEGIN IDS_CMD_FILE "ReactOS Command Script" IDS_COM_FILE "DOS aplikбcia" IDS_CPL_FILE "Poloћka ovlбdacieho panela" - IDS_CUR_FILE "Cursor" + IDS_CUR_FILE "Kurzor" IDS_DLL_FILE "Application Extension" IDS_DRV_FILE "Ovlбdaи zariadenia" IDS_EXE_FILE "Aplikбcia" @@ -747,9 +749,9 @@ BEGIN IDS_PREVIEW_VERB "Preview" //Nбhѕad, Ukбћka, Prezrieќ ??? IDS_FILE_FOLDER "sъbory: %u, prieиinky: %u" - IDS_PRINTERS "Printers" - IDS_FONTS "Fonts" - IDS_INSTALLNEWFONT "Install New Font..." + IDS_PRINTERS "Tlaиiarne" + IDS_FONTS "Pнsma" + IDS_INSTALLNEWFONT "&Nainљtalovaќ novй pнsmo..." - IDS_DEFAULT_CLUSTER_SIZE "Default allocation size" + IDS_DEFAULT_CLUSTER_SIZE "Predvolenб alokaиnб veѕkosќ" //Default allocation size END diff --git a/reactos/dll/win32/shell32/lang/sl-SI.rc b/reactos/dll/win32/shell32/lang/sl-SI.rc index 9ce5ceb6723..1b3b79358c8 100644 --- a/reactos/dll/win32/shell32/lang/sl-SI.rc +++ b/reactos/dll/win32/shell32/lang/sl-SI.rc @@ -378,22 +378,21 @@ STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION CAPTION "General" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - -GROUPBOX "Tasks", -1, 7, 10, 249, 45 -//ICON -AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP -AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP -GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP -//ICON -AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP -AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP -GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 -//ICON -AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP -PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP + GROUPBOX "Tasks", -1, 7, 10, 249, 45 + ICON "", 30109, 14, 25, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP + AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP + GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP + ICON "", 30110, 14, 70, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP + AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP + GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 + ICON "", 30111, 14, 120, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP + PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP END FOLDER_OPTIONS_VIEW_DLG DIALOGEX 0, 0, 264, 256 @@ -639,6 +638,9 @@ BEGIN IDS_PROPERTIES "Properties" IDS_CUT "Cut" IDS_RESTORE "Restore" + IDS_FORMATDRIVE "Format..." + IDS_RENAME "Rename" + IDS_INSERT "Insert" IDS_CREATEFOLDER_DENIED "Unable to create new Folder: Permission denied." IDS_CREATEFOLDER_CAPTION "Error during creation of a new folder" diff --git a/reactos/dll/win32/shell32/lang/sv-SE.rc b/reactos/dll/win32/shell32/lang/sv-SE.rc index b5edf7351f2..9b8e0e2d4b7 100644 --- a/reactos/dll/win32/shell32/lang/sv-SE.rc +++ b/reactos/dll/win32/shell32/lang/sv-SE.rc @@ -378,22 +378,21 @@ STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION CAPTION "General" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - -GROUPBOX "Tasks", -1, 7, 10, 249, 45 -//ICON -AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP -AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP -GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP -//ICON -AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP -AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP -GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 -//ICON -AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP -PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP + GROUPBOX "Tasks", -1, 7, 10, 249, 45 + ICON "", 30109, 14, 25, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP + AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP + GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP + ICON "", 30110, 14, 70, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP + AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP + GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 + ICON "", 30111, 14, 120, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP + PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP END FOLDER_OPTIONS_VIEW_DLG DIALOGEX 0, 0, 264, 256 @@ -639,6 +638,9 @@ BEGIN IDS_PROPERTIES "Properties" IDS_CUT "Cut" IDS_RESTORE "Restore" + IDS_FORMATDRIVE "Format..." + IDS_RENAME "Rename" + IDS_INSERT "Insert" IDS_CREATEFOLDER_DENIED "Unable to create new Folder: Permission denied." IDS_CREATEFOLDER_CAPTION "Error during creation of a new folder" diff --git a/reactos/dll/win32/shell32/lang/tr-TR.rc b/reactos/dll/win32/shell32/lang/tr-TR.rc index 3c0c50e5b12..dd50639a734 100644 --- a/reactos/dll/win32/shell32/lang/tr-TR.rc +++ b/reactos/dll/win32/shell32/lang/tr-TR.rc @@ -378,22 +378,21 @@ STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION CAPTION "General" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - -GROUPBOX "Tasks", -1, 7, 10, 249, 45 -//ICON -AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP -AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP -GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP -//ICON -AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP -AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP -GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 -//ICON -AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP -PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP + GROUPBOX "Tasks", -1, 7, 10, 249, 45 + ICON "", 30109, 14, 25, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP + AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP + GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP + ICON "", 30110, 14, 70, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP + AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP + GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 + ICON "", 30111, 14, 120, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP + PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP END FOLDER_OPTIONS_VIEW_DLG DIALOGEX 0, 0, 264, 256 @@ -639,6 +638,9 @@ BEGIN IDS_PROPERTIES "&Цzellikler" IDS_CUT "&Kes" IDS_RESTORE "Restore" + IDS_FORMATDRIVE "Format..." + IDS_RENAME "Rename" + IDS_INSERT "Insert" IDS_CREATEFOLDER_DENIED "Yeni dizin oluюturulamэyor: Eriюim engellendi." IDS_CREATEFOLDER_CAPTION "Dizin oluюturma sэrasэnda hata" diff --git a/reactos/dll/win32/shell32/lang/uk-UA.rc b/reactos/dll/win32/shell32/lang/uk-UA.rc index f1fd47c86f6..d01b29db63d 100644 --- a/reactos/dll/win32/shell32/lang/uk-UA.rc +++ b/reactos/dll/win32/shell32/lang/uk-UA.rc @@ -379,22 +379,21 @@ STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION CAPTION "Загальні" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - -GROUPBOX "Завдання", -1, 7, 10, 249, 45 -//ICON -AUTORADIOBUTTON "&Показувати список типових завдань у папках", 14001, 40, 25, 120, 10, WS_TABSTOP -AUTORADIOBUTTON "Використовувати зви&чайні папки ReactOS", 14002, 40, 37, 120, 10, WS_TABSTOP -GROUPBOX "Огляд папок", -1, 7, 60, 249, 45, WS_TABSTOP -//ICON -AUTORADIOBUTTON "Відкривати папки в то&му самому вікні", 14004, 40, 70, 140, 10, WS_TABSTOP -AUTORADIOBUTTON "Відкрива&ти кожну папку в окремому вікні", 14005, 40, 82, 140, 10, WS_TABSTOP -GROUPBOX "Клацання мишею", -1, 7, 110, 249, 60 -//ICON -AUTORADIOBUTTON "Від&кривати одиночним, виділяти вказівником", 14007, 40, 120, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Підкресл&ювати підписи значків", 14008, 50, 132, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Підкр&еслювати лише при наведенні", 14009, 50, 144, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Відкрив&ати подвійним, виділяти одиночним", 14010, 40, 156, 170, 10, WS_TABSTOP -PUSHBUTTON "&Відновити", 14011, 180, 180, 60, 14, WS_TABSTOP + GROUPBOX "Завдання", -1, 7, 10, 249, 45 + ICON "", 30109, 14, 25, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "&Показувати список типових завдань у папках", 14001, 40, 25, 120, 10, WS_TABSTOP + AUTORADIOBUTTON "Використовувати зви&чайні папки ReactOS", 14002, 40, 37, 120, 10, WS_TABSTOP + GROUPBOX "Огляд папок", -1, 7, 60, 249, 45, WS_TABSTOP + ICON "", 30110, 14, 70, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Відкривати папки в то&му самому вікні", 14004, 40, 70, 140, 10, WS_TABSTOP + AUTORADIOBUTTON "Відкрива&ти кожну папку в окремому вікні", 14005, 40, 82, 140, 10, WS_TABSTOP + GROUPBOX "Клацання мишею", -1, 7, 110, 249, 60 + ICON "", 30111, 14, 120, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Від&кривати одиночним, виділяти вказівником", 14007, 40, 120, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Підкресл&ювати підписи значків", 14008, 50, 132, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Підкр&еслювати лише при наведенні", 14009, 50, 144, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Відкрив&ати подвійним, виділяти одиночним", 14010, 40, 156, 170, 10, WS_TABSTOP + PUSHBUTTON "&Відновити", 14011, 180, 180, 60, 14, WS_TABSTOP END FOLDER_OPTIONS_VIEW_DLG DIALOGEX 0, 0, 264, 256 @@ -640,6 +639,9 @@ BEGIN IDS_PROPERTIES "В&ластивості" IDS_CUT "&Вирізати" IDS_RESTORE "Restore" + IDS_FORMATDRIVE "Format..." + IDS_RENAME "Rename" + IDS_INSERT "Insert" IDS_CREATEFOLDER_DENIED "Не вдалося створити нову папку: Відмова у доступі." IDS_CREATEFOLDER_CAPTION "Помилка при створенні нової папки" diff --git a/reactos/dll/win32/shell32/lang/zh-CN.rc b/reactos/dll/win32/shell32/lang/zh-CN.rc index e67b019a999..9c221ea72d4 100644 --- a/reactos/dll/win32/shell32/lang/zh-CN.rc +++ b/reactos/dll/win32/shell32/lang/zh-CN.rc @@ -367,22 +367,21 @@ STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION CAPTION "General" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - -GROUPBOX "Tasks", -1, 7, 10, 249, 45 -//ICON -AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP -AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP -GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP -//ICON -AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP -AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP -GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 -//ICON -AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP -PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP + GROUPBOX "Tasks", -1, 7, 10, 249, 45 + ICON "", 30109, 14, 25, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP + AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP + GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP + ICON "", 30110, 14, 70, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP + AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP + GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 + ICON "", 30111, 14, 120, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP + PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP END FOLDER_OPTIONS_VIEW_DLG DIALOGEX 0, 0, 264, 256 @@ -628,6 +627,9 @@ BEGIN IDS_PROPERTIES "КфРФ(&P)" IDS_CUT "јфЗР(&U)" IDS_RESTORE "Restore" + IDS_FORMATDRIVE "Format..." + IDS_RENAME "Rename" + IDS_INSERT "Insert" IDS_CREATEFOLDER_DENIED "Unable to create new Folder: Permission denied." IDS_CREATEFOLDER_CAPTION "Error during creation of a new folder" diff --git a/reactos/dll/win32/shell32/lang/zh-TW.rc b/reactos/dll/win32/shell32/lang/zh-TW.rc index e76c86a85ec..24561281463 100644 --- a/reactos/dll/win32/shell32/lang/zh-TW.rc +++ b/reactos/dll/win32/shell32/lang/zh-TW.rc @@ -379,22 +379,21 @@ STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION CAPTION "General" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - -GROUPBOX "Tasks", -1, 7, 10, 249, 45 -//ICON -AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP -AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP -GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP -//ICON -AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP -AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP -GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 -//ICON -AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP -AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP -PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP + GROUPBOX "Tasks", -1, 7, 10, 249, 45 + ICON "", 30109, 14, 25, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Show common tasks in &folders", 14001, 40, 25, 120, 10, WS_TABSTOP + AUTORADIOBUTTON "Use ReactOS class&ic folders", 14002, 40, 37, 120, 10, WS_TABSTOP + GROUPBOX "Browse folders", -1, 7, 60, 249, 45, WS_TABSTOP + ICON "", 30110, 14, 70, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "Open each folder in the sa&me window", 14004, 40, 70, 140, 10, WS_TABSTOP + AUTORADIOBUTTON "Open each folder in its own &window", 14005, 40, 82, 140, 10, WS_TABSTOP + GROUPBOX "Click items as follows", -1, 7, 110, 249, 60 + ICON "", 30111, 14, 120, 21, 20, SS_REALSIZECONTROL + AUTORADIOBUTTON "&Single-click to open an item (point to select)", 14007, 40, 120, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles consistent with my &browser", 14008, 50, 132, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "Underline icon titles only when I &point at them", 14009, 50, 144, 170, 10, WS_TABSTOP + AUTORADIOBUTTON "&Double-click to open an item (single-click to select)", 14010, 40, 156, 170, 10, WS_TABSTOP + PUSHBUTTON "&Restore Defaults", 14011, 180, 180, 60, 14, WS_TABSTOP END FOLDER_OPTIONS_VIEW_DLG DIALOGEX 0, 0, 264, 256 @@ -640,6 +639,9 @@ BEGIN IDS_PROPERTIES "Properties" IDS_CUT "Cut" IDS_RESTORE "Restore" + IDS_FORMATDRIVE "Format..." + IDS_RENAME "Rename" + IDS_INSERT "Insert" IDS_CREATEFOLDER_DENIED "Unable to create new Folder: Permission denied." IDS_CREATEFOLDER_CAPTION "Error during creation of a new folder" diff --git a/reactos/dll/win32/shell32/pidl.c b/reactos/dll/win32/shell32/pidl.c index 452e85695e7..b146c928a72 100644 --- a/reactos/dll/win32/shell32/pidl.c +++ b/reactos/dll/win32/shell32/pidl.c @@ -22,32 +22,7 @@ * */ -#include "config.h" -#include "wine/port.h" - -#include -#include -#include -#include - -#define COBJMACROS -#define NONAMELESSUNION -#define NONAMELESSSTRUCT - -#include "windef.h" -#include "winbase.h" -#include "winreg.h" -#include "objbase.h" -#include "shlguid.h" -#include "winerror.h" -#include "winnls.h" -#include "undocshell.h" -#include "shell32_main.h" -#include "shlwapi.h" -#include "shresdef.h" - -#include "pidl.h" -#include "wine/debug.h" +#include WINE_DEFAULT_DEBUG_CHANNEL(pidl); WINE_DECLARE_DEBUG_CHANNEL(shell); @@ -110,7 +85,7 @@ BOOL WINAPI ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR pa return FALSE; } - if (type >= 0 && type <= 2) + if (type <= 2) { switch (type) { @@ -509,7 +484,7 @@ BOOL WINAPI ILIsEqual(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) _ILSimpleGetText(pidltemp1, szData1, MAX_PATH); _ILSimpleGetText(pidltemp2, szData2, MAX_PATH); - if (strcasecmp( szData1, szData2 )) + if (strcmp( szData1, szData2 )) return FALSE; pidltemp1 = ILGetNext(pidltemp1); @@ -559,7 +534,7 @@ BOOL WINAPI ILIsParent(LPCITEMIDLIST pidlParent, LPCITEMIDLIST pidlChild, BOOL b _ILSimpleGetText(pParent, szData1, MAX_PATH); _ILSimpleGetText(pChild, szData2, MAX_PATH); - if (strcasecmp( szData1, szData2 )) + if (strcmp( szData1, szData2 )) return FALSE; pParent = ILGetNext(pParent); @@ -626,7 +601,7 @@ LPITEMIDLIST WINAPI ILFindChild(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) _ILSimpleGetText(pidltemp1, szData1, MAX_PATH); _ILSimpleGetText(pidltemp2, szData2, MAX_PATH); - if (strcasecmp(szData1,szData2)) + if (strcmp(szData1,szData2)) break; pidltemp1 = ILGetNext(pidltemp1); @@ -1382,6 +1357,24 @@ LPITEMIDLIST _ILCreateIExplore(void) LPITEMIDLIST _ILCreateControlPanel(void) { + LPITEMIDLIST ret = NULL; + LPITEMIDLIST parent = _ILCreateGuid(PT_GUID, &CLSID_MyComputer); + + TRACE("()\n"); + + if (parent) + { + LPITEMIDLIST printers = _ILCreateGuid(PT_YAGUID, &CLSID_ControlPanel); + + if (printers) + { + ret = ILCombine(parent, printers); + SHFree(printers); + } + SHFree(parent); + } + return ret; + return _ILCreateGuid(PT_SHELLEXT, &CLSID_ControlPanel); } @@ -1405,7 +1398,7 @@ LPITEMIDLIST _ILCreateBitBucket(void) LPITEMIDLIST _ILCreateAdminTools(void) { TRACE("()\n"); - return _ILCreateGuid(PT_GUID, &CLSID_AdminFolderShortcut); + return _ILCreateGuid(PT_GUID, &CLSID_AdminFolderShortcut); //FIXME } LPITEMIDLIST _ILCreateGuid(PIDLTYPE type, REFIID guid) @@ -1448,7 +1441,7 @@ LPITEMIDLIST _ILCreateGuidFromStrW(LPCWSTR szGUID) { IID iid; - if (!SUCCEEDED(SHCLSIDFromStringW(szGUID, &iid))) + if (FAILED(CLSIDFromString((LPOLESTR)szGUID, &iid))) { ERR("%s is not a GUID\n", debugstr_w(szGUID)); return NULL; @@ -1475,7 +1468,7 @@ LPITEMIDLIST _ILCreateFromFindDataW( const WIN32_FIND_DATAW *wfd ) type = (wfd->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? PT_FOLDER : PT_VALUE; - wlen = lstrlenW(wfd->cFileName) + 1; + wlen = wcslen(wfd->cFileName) + 1; pidl = _ILAlloc(type, FIELD_OFFSET(FileStruct, szNames[alen + (alen & 1)]) + FIELD_OFFSET(FileStructW, wszName[wlen]) + sizeof(WORD)); if (pidl) @@ -1538,7 +1531,7 @@ LPITEMIDLIST _ILCreateDrive(LPCWSTR lpszNew) if (pszDest) { strcpy(pszDest, "x:\\"); - pszDest[0]=toupperW(lpszNew[0]); + pszDest[0]=towupper(lpszNew[0]); TRACE("-- create Drive: %s\n", debugstr_a(pszDest)); } } @@ -1637,7 +1630,6 @@ LPITEMIDLIST _ILCreateNetHood(void) LPITEMIDLIST _ILCreateFont(void) { - return _ILCreateGuid(PT_GUID, &CLSID_FontsFolderShortcut); } @@ -1838,7 +1830,7 @@ DWORD _ILSimpleGetTextW (LPCITEMIDLIST pidl, LPWSTR szOut, UINT uOutSize) if (pFileStructW) { lstrcpynW(szOut, pFileStructW->wszName, uOutSize); - dwReturn = lstrlenW(pFileStructW->wszName); + dwReturn = wcslen(pFileStructW->wszName); } else { GUID const * riid; WCHAR szTemp[MAX_PATH]; @@ -1860,7 +1852,7 @@ DWORD _ILSimpleGetTextW (LPCITEMIDLIST pidl, LPWSTR szOut, UINT uOutSize) if (szOut) lstrcpynW(szOut, szTemp, uOutSize); - dwReturn = lstrlenW (szTemp); + dwReturn = wcslen (szTemp); } } else if (( szSrcW = _ILGetTextPointerW(pidl) )) @@ -1869,7 +1861,7 @@ DWORD _ILSimpleGetTextW (LPCITEMIDLIST pidl, LPWSTR szOut, UINT uOutSize) if (szOut) lstrcpynW(szOut, szSrcW, uOutSize); - dwReturn = lstrlenW(szSrcW); + dwReturn = wcslen(szSrcW); } else if (( szSrc = _ILGetTextPointer(pidl) )) { @@ -1879,7 +1871,7 @@ DWORD _ILSimpleGetTextW (LPCITEMIDLIST pidl, LPWSTR szOut, UINT uOutSize) if (szOut) lstrcpynW(szOut, szTemp, uOutSize); - dwReturn = lstrlenW (szTemp); + dwReturn = wcslen (szTemp); } else if (( riid = _ILGetGUIDPointer(pidl) )) { @@ -1889,7 +1881,7 @@ DWORD _ILSimpleGetTextW (LPCITEMIDLIST pidl, LPWSTR szOut, UINT uOutSize) if (szOut) lstrcpynW(szOut, szTemp, uOutSize); - dwReturn = lstrlenW (szTemp); + dwReturn = wcslen (szTemp); } } else diff --git a/reactos/dll/win32/shell32/pidl.h b/reactos/dll/win32/shell32/pidl.h index eee285e16a5..51b655bf0f8 100644 --- a/reactos/dll/win32/shell32/pidl.h +++ b/reactos/dll/win32/shell32/pidl.h @@ -35,12 +35,13 @@ #ifndef __WINE_PIDL_H #define __WINE_PIDL_H + #include -#include "windef.h" -#include "winbase.h" -#include "winuser.h" -#include "shlobj.h" +#include +#include +#include +#include /* * the pidl does cache fileattributes to speed up SHGetAttributes when diff --git a/reactos/dll/win32/shell32/precomp.h b/reactos/dll/win32/shell32/precomp.h new file mode 100644 index 00000000000..962eb34cead --- /dev/null +++ b/reactos/dll/win32/shell32/precomp.h @@ -0,0 +1,77 @@ +#ifndef _PRECOMP_H__ +#define _PRECOMP_H__ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include + +#define COBJMACROS +#define NONAMELESSUNION +#define NONAMELESSSTRUCT +#define WIN32_NO_STATUS +#define NTOS_MODE_USER +#define UNICODE +#define _UNICODE + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//#include +//#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include "base/shell/explorer-new/todo.h" +#include "dlgs.h" +#include "pidl.h" +#include "debughlp.h" +#include "undocshell.h" +#include "shell32_main.h" +#include "shresdef.h" +#include "cpanel.h" +#include "enumidlist.h" +#include "shfldr.h" +#include "version.h" +#include "shellfolder.h" +#include "xdg.h" + +#include "wine/debug.h" +#include "wine/unicode.h" + +extern const GUID CLSID_AdminFolderShortcut; +extern const GUID CLSID_FontsFolderShortcut; +extern const GUID CLSID_StartMenu; +extern const GUID CLSID_OpenWith; +extern const GUID CLSID_UnixFolder; +extern const GUID CLSID_UnixDosFolder; +extern const GUID SHELL32_AdvtShortcutProduct; +extern const GUID SHELL32_AdvtShortcutComponent; + + +#endif diff --git a/reactos/dll/win32/shell32/regsvr.c b/reactos/dll/win32/shell32/regsvr.c index c127059a5ec..74e6e622e80 100644 --- a/reactos/dll/win32/shell32/regsvr.c +++ b/reactos/dll/win32/shell32/regsvr.c @@ -17,26 +17,17 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include -#include -#include -#include +const GUID CLSID_AdminFolderShortcut = {0xD20EA4E1, 0x3957, 0x11D2, {0xA4, 0x0B, 0x0C, 0x50, 0x20, 0x52, 0x41, 0x53} }; +const GUID CLSID_StartMenu = {0x4622AD11, 0xFF23, 0x11D0, {0x8D, 0x34, 0x00, 0xA0, 0xC9, 0x0F, 0x27, 0x19}}; +const GUID CLSID_OpenWith = {0x09799AFB, 0xAD67, 0x11d1, {0xAB, 0xCD, 0x00, 0xC0, 0x4F, 0xC3, 0x09, 0x36}}; +const GUID CLSID_UnixFolder = {0xcc702eb2, 0x7dc5, 0x11d9, {0xc6, 0x87, 0x00, 0x04, 0x23, 0x8a, 0x01, 0xcd}}; +const GUID CLSID_UnixDosFolder = {0x9d20aae8, 0x0625, 0x44b0, {0x9c, 0xa7, 0x71, 0x88, 0x9c, 0x22, 0x54, 0xd9}}; +const GUID CLSID_FontsFolderShortcut = {0xD20EA4E1, 0x3957, 0x11D2, {0xA4, 0x0B, 0x0C, 0x50, 0x20, 0x52, 0x41,0x52}}; +const GUID SHELL32_AdvtShortcutProduct = {0x9db1186f, 0x40df, 0x11d1, {0xaa, 0x8c, 0x00, 0xc0, 0x4f, 0xb6, 0x78, 0x63}}; +const GUID SHELL32_AdvtShortcutComponent = {0x9db1186e, 0x40df, 0x11d1, {0xaa, 0x8c, 0x00, 0xc0, 0x4f, 0xb6, 0x78, 0x63}}; -#include "windef.h" -#include "winbase.h" -#include "winuser.h" -#include "winreg.h" -#include "winerror.h" - -#include "ole2.h" -#include "shldisp.h" -#include "shlguid.h" -#include "shell32_main.h" -#include "shresdef.h" -#include "initguid.h" -#include "shfldr.h" - -#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); @@ -193,10 +184,10 @@ static HRESULT register_interfaces(struct regsvr_interface const *list) KEY_READ | KEY_WRITE, NULL, &key, NULL); if (res != ERROR_SUCCESS) goto error_close_iid_key; - wsprintfW(buf, fmt, list->num_methods); + swprintf(buf, fmt, list->num_methods); res = RegSetValueExW(key, NULL, 0, REG_SZ, (CONST BYTE*)buf, - (lstrlenW(buf) + 1) * sizeof(WCHAR)); + (wcslen(buf) + 1) * sizeof(WCHAR)); RegCloseKey(key); if (res != ERROR_SUCCESS) goto error_close_iid_key; @@ -464,18 +455,18 @@ static WCHAR *get_namespace_key(struct regsvr_namespace const *list) { WCHAR *pwszKey, *pwszCLSID; pwszKey = HeapAlloc(GetProcessHeap(), 0, sizeof(wszExplorerKey)+sizeof(wszNamespace)+ - sizeof(WCHAR)*(lstrlenW(list->parent)+CHARS_IN_GUID)); + sizeof(WCHAR)*(wcslen(list->parent)+CHARS_IN_GUID)); if (!pwszKey) return NULL; - lstrcpyW(pwszKey, wszExplorerKey); - lstrcatW(pwszKey, list->parent); - lstrcatW(pwszKey, wszNamespace); + wcscpy(pwszKey, wszExplorerKey); + wcscat(pwszKey, list->parent); + wcscat(pwszKey, wszNamespace); if (FAILED(StringFromCLSID(list->clsid, &pwszCLSID))) { HeapFree(GetProcessHeap(), 0, pwszKey); return NULL; } - lstrcatW(pwszKey, pwszCLSID); + wcscat(pwszKey, pwszCLSID); CoTaskMemFree(pwszCLSID); return pwszKey; @@ -492,7 +483,7 @@ static HRESULT register_namespace_extensions(struct regsvr_namespace const *list if (pwszKey && ERROR_SUCCESS == RegCreateKeyExW(HKEY_LOCAL_MACHINE, pwszKey, 0, NULL, 0, KEY_WRITE, NULL, &hKey, NULL)) { - RegSetValueExW(hKey, NULL, 0, REG_SZ, (const BYTE *)list->value, sizeof(WCHAR)*(lstrlenW(list->value)+1)); + RegSetValueExW(hKey, NULL, 0, REG_SZ, (const BYTE *)list->value, sizeof(WCHAR)*(wcslen(list->value)+1)); RegCloseKey(hKey); } @@ -538,7 +529,7 @@ static LONG register_key_defvalueW( KEY_READ | KEY_WRITE, NULL, &key, NULL); if (res != ERROR_SUCCESS) return res; res = RegSetValueExW(key, NULL, 0, REG_SZ, (CONST BYTE*)value, - (lstrlenW(value) + 1) * sizeof(WCHAR)); + (wcslen(value) + 1) * sizeof(WCHAR)); RegCloseKey(key); return res; } @@ -626,8 +617,8 @@ static struct regsvr_coclass const coclass_list[] = { NULL, "shell32.dll", "Apartment", - SHELLFOLDER_ATTRIBUTES, - SFGAO_FOLDER, + SHELLFOLDER_ATTRIBUTES|SHELLFOLDER_CALLFORATTRIBUTES, + SFGAO_FOLDER|SFGAO_HASPROPSHEET, 0, NULL, NULL, @@ -674,24 +665,6 @@ static struct regsvr_coclass const coclass_list[] = { "shell32.dll", "Apartment", }, - { &CLSID_UnixFolder, - "/", - 0, - NULL, - "shell32.dll", - "Apartment", - SHELLFOLDER_WANTSFORPARSING - }, - { &CLSID_UnixDosFolder, - "/", - 0, - NULL, - "shell32.dll", - "Apartment", - SHELLFOLDER_WANTSFORPARSING|SHELLFOLDER_ATTRIBUTES|SHELLFOLDER_CALLFORATTRIBUTES, - SFGAO_FILESYSANCESTOR|SFGAO_FOLDER|SFGAO_HASSUBFOLDER, - SFGAO_FILESYSTEM - }, { &CLSID_FolderShortcut, "Foldershortcut", 0, @@ -718,7 +691,7 @@ static struct regsvr_coclass const coclass_list[] = { NULL, "shell32.dll", "Apartment", - SHELLFOLDER_ATTRIBUTES, + SHELLFOLDER_ATTRIBUTES|SHELLFOLDER_CALLFORATTRIBUTES, SFGAO_FOLDER|SFGAO_DROPTARGET|SFGAO_HASPROPSHEET, 0, NULL, diff --git a/reactos/dll/win32/shell32/res/icons/182.ico b/reactos/dll/win32/shell32/res/icons/182.ico new file mode 100644 index 00000000000..56c8f24b994 Binary files /dev/null and b/reactos/dll/win32/shell32/res/icons/182.ico differ diff --git a/reactos/dll/win32/shell32/res/icons/183.ico b/reactos/dll/win32/shell32/res/icons/183.ico new file mode 100644 index 00000000000..5f3251917ba Binary files /dev/null and b/reactos/dll/win32/shell32/res/icons/183.ico differ diff --git a/reactos/dll/win32/shell32/res/icons/184.ico b/reactos/dll/win32/shell32/res/icons/184.ico new file mode 100644 index 00000000000..5eee0af44ec Binary files /dev/null and b/reactos/dll/win32/shell32/res/icons/184.ico differ diff --git a/reactos/dll/win32/shell32/res/icons/185.ico b/reactos/dll/win32/shell32/res/icons/185.ico new file mode 100644 index 00000000000..6b4dc9303e5 Binary files /dev/null and b/reactos/dll/win32/shell32/res/icons/185.ico differ diff --git a/reactos/dll/win32/shell32/res/icons/186.ico b/reactos/dll/win32/shell32/res/icons/186.ico new file mode 100644 index 00000000000..d09411113a0 Binary files /dev/null and b/reactos/dll/win32/shell32/res/icons/186.ico differ diff --git a/reactos/dll/win32/shell32/res/icons/187.ico b/reactos/dll/win32/shell32/res/icons/187.ico new file mode 100644 index 00000000000..38b924da89a Binary files /dev/null and b/reactos/dll/win32/shell32/res/icons/187.ico differ diff --git a/reactos/dll/win32/shell32/ros-systray.c b/reactos/dll/win32/shell32/ros-systray.c index 59a9c23762f..f1e9f819b21 100644 --- a/reactos/dll/win32/shell32/ros-systray.c +++ b/reactos/dll/win32/shell32/ros-systray.c @@ -19,14 +19,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include - -#include "windef.h" -#include "winbase.h" -#include "winuser.h" -#include "shellapi.h" - +#include /* copy data structure for tray notifications */ typedef struct TrayNotifyCDS_Dummy { diff --git a/reactos/dll/win32/shell32/she_ocmenu.c b/reactos/dll/win32/shell32/she_ocmenu.c index ec57da1ba77..972a85597db 100644 --- a/reactos/dll/win32/shell32/she_ocmenu.c +++ b/reactos/dll/win32/shell32/she_ocmenu.c @@ -18,31 +18,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include - -#define COBJMACROS -#define NONAMELESSUNION -#define NONAMELESSSTRUCT -#include "winerror.h" -#include "wine/debug.h" - -#include "windef.h" -#include "wingdi.h" -#include "pidl.h" -#include "undocshell.h" -#include "shlobj.h" -#include "objbase.h" -#include "commdlg.h" -#include "shlwapi.h" -#include "shell32_main.h" -#include "shellfolder.h" -#include "shresdef.h" -#include "stdio.h" +#include WINE_DEFAULT_DEBUG_CHANNEL (shell); -const GUID CLSID_OpenWith = { 0x09799AFB, 0xAD67, 0x11d1, {0xAB,0xCD,0x00,0xC0,0x4F,0xC3,0x09,0x36} }; - /// /// [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system] /// "NoInternetOpenWith"=dword:00000001 @@ -63,7 +42,7 @@ typedef struct UINT count; WCHAR szPath[MAX_PATH]; HMENU hSubMenu; -} SHEOWImpl; +} SHEOWImpl, *LPSHEOWImpl; typedef struct { @@ -143,8 +122,8 @@ HRESULT WINAPI SHEOW_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID *ppv) SHEOWImpl * ow; HRESULT res; - ow = LocalAlloc(LMEM_ZEROINIT, sizeof(SHEOWImpl)); - if (!ow) + ow = LocalAlloc(LMEM_ZEROINIT, sizeof(SHEOWImpl)); + if (!ow) { return E_OUTOFMEMORY; } @@ -160,12 +139,12 @@ HRESULT WINAPI SHEOW_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID *ppv) return res; } -static inline SHEOWImpl *impl_from_IShellExtInit( IShellExtInit *iface ) +static LPSHEOWImpl __inline impl_from_IShellExtInit( IShellExtInit *iface ) { return (SHEOWImpl *)((char*)iface - FIELD_OFFSET(SHEOWImpl, lpvtblShellExtInit)); } -static inline SHEOWImpl *impl_from_IContextMenu( IContextMenu2 *iface ) +static LPSHEOWImpl __inline impl_from_IContextMenu( IContextMenu2 *iface ) { return (SHEOWImpl *)((char*)iface - FIELD_OFFSET(SHEOWImpl, lpVtblContextMenu)); } @@ -241,19 +220,21 @@ AddItem(HMENU hMenu, UINT idCmdFirst) if (!LoadStringW(shell32_hInstance, IDS_OPEN_WITH_CHOOSE, szBuffer, sizeof(szBuffer) / sizeof(WCHAR))) wcscpy(szBuffer, szChoose); + szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0'; + mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE; mii.fType = MFT_STRING; mii.fState = MFS_ENABLED; mii.wID = idCmdFirst; mii.dwTypeData = (LPWSTR)szBuffer; - mii.cch = strlenW(szBuffer); + mii.cch = wcslen(szBuffer); InsertMenuItemW(hMenu, -1, TRUE, &mii); } static void -LoadOWItems(POPEN_WITH_CONTEXT pContext, WCHAR * szName) +LoadOWItems(POPEN_WITH_CONTEXT pContext, LPCWSTR szName) { WCHAR * szExt; WCHAR szPath[100]; @@ -279,6 +260,7 @@ LoadOWItems(POPEN_WITH_CONTEXT pContext, WCHAR * szName) szPath[0] = 0; if (RegGetValueW(HKEY_CLASSES_ROOT, szExt, NULL, RRF_RT_REG_SZ, NULL, szPath, &dwPath) == ERROR_SUCCESS) { + szPath[(sizeof(szPath)/sizeof(WCHAR))-1] = L'\0'; LoadItemFromHKCR(pContext, szPath); } } @@ -294,17 +276,18 @@ static HRESULT WINAPI SHEOWCm_fnQueryContextMenu( UINT uFlags) { MENUITEMINFOW mii; - WCHAR szBuffer[100]; + WCHAR szBuffer[100] = {0}; INT pos; HMENU hSubMenu = NULL; OPEN_WITH_CONTEXT Context; SHEOWImpl *This = impl_from_IContextMenu(iface); - if (LoadStringW(shell32_hInstance, IDS_OPEN_WITH, szBuffer, 100) < 0) + if (LoadStringW(shell32_hInstance, IDS_OPEN_WITH, szBuffer, sizeof(szBuffer)/sizeof(WCHAR)) < 0) { TRACE("failed to load string\n"); return E_FAIL; } + szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0'; hSubMenu = CreatePopupMenu(); @@ -383,12 +366,16 @@ FreeListItems(HWND hwndDlg) BOOL HideApplicationFromList(WCHAR * pFileName) { - WCHAR szBuffer[100]; + WCHAR szBuffer[100] = {'A','p','p','l','i','c','a','t','i','o','n','s','\\',0}; DWORD dwSize = 0; LONG result; - wcscpy(szBuffer, L"Applications\\"); - wcscat(szBuffer, pFileName); + if (wcslen(pFileName) > (sizeof(szBuffer)/sizeof(WCHAR)) - 14) + { + ERR("insufficient buffer\n"); + return FALSE; + } + wcscpy(&szBuffer[13], pFileName); result = RegGetValueW(HKEY_CLASSES_ROOT, szBuffer, L"NoOpenWith", RRF_RT_REG_SZ, NULL, NULL, &dwSize); @@ -405,11 +392,17 @@ WriteStaticShellExtensionKey(HKEY hRootKey, WCHAR * pVerb, WCHAR *pFullPath) { HKEY hShell; LONG result; - WCHAR szBuffer[MAX_PATH+10]; + WCHAR szBuffer[MAX_PATH+10] = {'s','h','e','l','l','\\', 0 }; + + if (wcslen(pVerb) > (sizeof(szBuffer)/sizeof(WCHAR)) - 15 || + wcslen(pFullPath) > (sizeof(szBuffer)/sizeof(WCHAR)) - 4) + { + ERR("insufficient buffer\n"); + return; + } /* construct verb reg path */ - wcscpy(szBuffer, L"shell\\"); - wcscat(szBuffer, pVerb); + wcscpy(&szBuffer[6], pVerb); wcscat(szBuffer, L"\\command"); /* create verb reg key */ @@ -420,14 +413,14 @@ WriteStaticShellExtensionKey(HKEY hRootKey, WCHAR * pVerb, WCHAR *pFullPath) wcscpy(szBuffer, pFullPath); wcscat(szBuffer, L" %1"); - result = RegSetValueExW(hShell, NULL, 0, REG_SZ, (const BYTE*)szBuffer, (strlenW(szBuffer)+1)* sizeof(WCHAR)); + result = RegSetValueExW(hShell, NULL, 0, REG_SZ, (const BYTE*)szBuffer, (wcslen(szBuffer)+1)* sizeof(WCHAR)); RegCloseKey(hShell); } VOID -StoreNewSettings(WCHAR * szFileName, WCHAR *szAppName) +StoreNewSettings(LPCWSTR szFileName, WCHAR *szAppName) { - WCHAR szBuffer[100]; + WCHAR szBuffer[100] = { L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\"}; WCHAR * pFileExt; HKEY hKey; LONG result; @@ -435,9 +428,12 @@ StoreNewSettings(WCHAR * szFileName, WCHAR *szAppName) /* get file extension */ pFileExt = wcsrchr(szFileName, L'.'); - wcscpy(szBuffer, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\"); - wcscat(szBuffer, pFileExt); - + if (wcslen(pFileExt) > (sizeof(szBuffer)/sizeof(WCHAR)) - 60) + { + ERR("insufficient buffer\n"); + return; + } + wcscpy(&szBuffer[60], pFileExt); /* open base key for this file extension */ if (RegCreateKeyExW(HKEY_CURRENT_USER, szBuffer, 0, NULL, 0, KEY_WRITE | KEY_READ, NULL, &hKey, NULL) != ERROR_SUCCESS) return; @@ -461,10 +457,10 @@ StoreNewSettings(WCHAR * szFileName, WCHAR *szAppName) } VOID -SetProgrammAsDefaultHandler(WCHAR * szFileName, WCHAR * szAppName) +SetProgrammAsDefaultHandler(LPCWSTR szFileName, WCHAR * szAppName) { HKEY hKey; - HKEY hAppKey; + HKEY hAppKey; DWORD dwDisposition; WCHAR szBuffer[100]; DWORD dwSize; @@ -486,7 +482,7 @@ SetProgrammAsDefaultHandler(WCHAR * szFileName, WCHAR * szAppName) /* a new entry was created create the prog key id */ wcscpy(szBuffer, &pFileExt[1]); wcscat(szBuffer, L"_auto_file"); - if (RegSetValueExW(hKey, NULL, 0, REG_SZ, (const BYTE*)szBuffer, (strlenW(szBuffer)+1) * sizeof(WCHAR)) != ERROR_SUCCESS) + if (RegSetValueExW(hKey, NULL, 0, REG_SZ, (const BYTE*)szBuffer, (wcslen(szBuffer)+1) * sizeof(WCHAR)) != ERROR_SUCCESS) { RegCloseKey(hKey); return; @@ -541,20 +537,19 @@ SetProgrammAsDefaultHandler(WCHAR * szFileName, WCHAR * szAppName) void BrowseForApplication(HWND hwndDlg) { - WCHAR szBuffer[30]; - WCHAR szFilter[30]; + WCHAR szBuffer[30] = {0}; + WCHAR szFilter[30] = {0}; WCHAR szPath[MAX_PATH]; OPENFILENAMEW ofn; OPEN_WITH_CONTEXT Context; INT count; /* load resource open with */ - szBuffer[0] = 0; if (LoadStringW(shell32_hInstance, IDS_OPEN_WITH, szBuffer, sizeof(szBuffer) / sizeof(WCHAR))) { - szBuffer[99] = 0; + szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0'; ofn.lpstrTitle = szBuffer; - ofn.nMaxFileTitle = strlenW(szBuffer); + ofn.nMaxFileTitle = wcslen(szBuffer); } ZeroMemory(&ofn, sizeof(OPENFILENAMEW)); @@ -565,10 +560,9 @@ BrowseForApplication(HWND hwndDlg) ofn.lpstrFile = szPath; /* load the filter resource string */ - szFilter[0] = 0; if (LoadStringW(shell32_hInstance, IDS_OPEN_WITH_FILTER, szFilter, sizeof(szFilter) / sizeof(WCHAR))) { - szFilter[99] = 0; + szFilter[(sizeof(szFilter)/sizeof(WCHAR))-1] = 0; ofn.lpstrFilter = szFilter; } ZeroMemory(szPath, sizeof(szPath)); @@ -640,6 +634,7 @@ static BOOL CALLBACK OpenWithProgrammDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, COLORREF preColor, preBkColor; POPEN_ITEM_CONTEXT pItemContext; LONG YOffset; + OPEN_WITH_CONTEXT Context; poainfo = (OPENASINFO*) GetWindowLong(hwndDlg, DWLP_USER); @@ -657,17 +652,16 @@ static BOOL CALLBACK OpenWithProgrammDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, if (poainfo->pcszFile) { szBuffer[0] = L'\0'; - SendDlgItemMessageA(hwndDlg, 14001, WM_GETTEXT, sizeof(szBuffer), (LPARAM)szBuffer); - strcat((char*)szBuffer, poainfo->pcszFile); - SendDlgItemMessageA(hwndDlg, 14001, WM_SETTEXT, 0, (LPARAM)szBuffer); - } - if (MultiByteToWideChar(CP_ACP, 0,poainfo->pcszFile, -1, szBuffer, MAX_PATH)) - { - OPEN_WITH_CONTEXT Context; - ZeroMemory(&Context, sizeof(OPEN_WITH_CONTEXT)); - Context.hDlgCtrl = GetDlgItem(hwndDlg, 14002); - LoadOWItems(&Context, szBuffer); - SendMessage(Context.hDlgCtrl, LB_SETCURSEL, 0, 0); + SendDlgItemMessageW(hwndDlg, 14001, WM_GETTEXT, sizeof(szBuffer), (LPARAM)szBuffer); + index = wcslen(szBuffer); + if (index + wcslen(poainfo->pcszFile) + 1 < sizeof(szBuffer)/sizeof(szBuffer[0])) + wcscat(szBuffer, poainfo->pcszFile); + szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0'; + SendDlgItemMessageW(hwndDlg, 14001, WM_SETTEXT, 0, (LPARAM)szBuffer); + ZeroMemory(&Context, sizeof(OPEN_WITH_CONTEXT)); + Context.hDlgCtrl = GetDlgItem(hwndDlg, 14002); + LoadOWItems(&Context, poainfo->pcszFile); + SendMessage(Context.hDlgCtrl, LB_SETCURSEL, 0, 0); } return TRUE; case WM_MEASUREITEM: @@ -689,20 +683,16 @@ static BOOL CALLBACK OpenWithProgrammDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, if (pItemContext) { /* store settings in HKCU path */ - if(MultiByteToWideChar(CP_ACP, 0, poainfo->pcszFile, -1, szBuffer, MAX_PATH + 30)) - { - szBuffer[MAX_PATH+29] = 0; - StoreNewSettings(szBuffer, pItemContext->szAppName); - } + StoreNewSettings(poainfo->pcszFile, pItemContext->szAppName); if (SendDlgItemMessage(hwndDlg, 14003, BM_GETCHECK, 0, 0) == BST_CHECKED) { /* set programm as default handler */ - SetProgrammAsDefaultHandler(szBuffer, pItemContext->szAppName); + SetProgrammAsDefaultHandler(poainfo->pcszFile, pItemContext->szAppName); } if (poainfo->oaifInFlags & OAIF_EXEC) - ExecuteOpenItem(pItemContext, szBuffer); + ExecuteOpenItem(pItemContext, poainfo->pcszFile); } FreeListItems(hwndDlg); EndDialog(hwndDlg, 1); @@ -815,13 +805,8 @@ SHEOWCm_fnInvokeCommand( IContextMenu2* iface, LPCMINVOKECOMMANDINFO lpici ) if (This->wId == LOWORD(lpici->lpVerb)) { OPENASINFO info; - char buffer[MAX_PATH] = {0}; - - if(WideCharToMultiByte(CP_ACP,0,This->szPath,-1,buffer,MAX_PATH,NULL,NULL)) - { - info.pcszFile = buffer; - } + info.pcszFile = This->szPath; info.oaifInFlags = OAIF_ALLOW_REGISTRATION | OAIF_REGISTER_EXT | OAIF_EXEC; info.pcszClass = NULL; FreeMenuItemContext(This->hSubMenu); @@ -934,7 +919,7 @@ GetManufacturer(WCHAR * szAppName, POPEN_ITEM_CONTEXT pContext) code = lplangcode->code; } /* set up format */ - sprintfW(szBuffer, wFormat, lang, code); + swprintf(szBuffer, wFormat, lang, code); /* query manufacturer */ pResult = NULL; bResult = VerQueryValueW(pBuf, szBuffer, (LPVOID *)&pResult, &VerSize); @@ -982,7 +967,7 @@ InsertOpenWithItem(POPEN_WITH_CONTEXT pContext, WCHAR * szAppName) mii.fState = MFS_ENABLED; mii.wID = pContext->idCmdFirst; mii.dwTypeData = Buffer; - mii.cch = strlenW(Buffer); + mii.cch = wcslen(Buffer); mii.dwItemData = (ULONG_PTR)pItemContext; wcscpy(pItemContext->szManufacturer, Buffer); if (InsertMenuItemW(pContext->hMenu, -1, TRUE, &mii)) @@ -1023,10 +1008,10 @@ OpenMRUList(HKEY hKey) wcscat(szPath, L"comctl32.dll"); hModule = LoadLibraryExW(szPath, NULL, 0); } - CreateMRUListW = (CREATEMRULISTW)GetProcAddress(hModule, MAKEINTRESOURCE(400)); - EnumMRUListW = (ENUMMRULISTW)GetProcAddress(hModule, MAKEINTRESOURCE(403)); - FreeMRUList = (FREEMRULIST)GetProcAddress(hModule, MAKEINTRESOURCE(152)); - AddMRUStringW = (ADDMRUSTRINGW)GetProcAddress(hModule, MAKEINTRESOURCE(401)); + CreateMRUListW = (CREATEMRULISTW)GetProcAddress(hModule, MAKEINTRESOURCEA(400)); + EnumMRUListW = (ENUMMRULISTW)GetProcAddress(hModule, MAKEINTRESOURCEA(403)); + FreeMRUList = (FREEMRULIST)GetProcAddress(hModule, MAKEINTRESOURCEA(152)); + AddMRUStringW = (ADDMRUSTRINGW)GetProcAddress(hModule, MAKEINTRESOURCEA(401)); if (!CreateMRUListW || !EnumMRUListW || !FreeMRUList || !AddMRUStringW) return 0; @@ -1134,7 +1119,7 @@ LoadItemFromHKCR(POPEN_WITH_CONTEXT pContext, WCHAR * szExt) } /* load items from SystemFileAssociations\Ext key */ - sprintfW(szResult, szSysFileAssoc, szExt); + swprintf(szResult, szSysFileAssoc, szExt); if (RegOpenKeyExW(HKEY_CLASSES_ROOT, szResult, 0, KEY_READ | KEY_WRITE, &hSubKey) == ERROR_SUCCESS) { AddItemFromMRUList(pContext, hSubKey); @@ -1152,7 +1137,7 @@ LoadItemFromHKCR(POPEN_WITH_CONTEXT pContext, WCHAR * szExt) /* terminate it explictely */ szBuffer[29] = 0; - sprintfW(szResult, szSysFileAssoc, szBuffer); + swprintf(szResult, szSysFileAssoc, szBuffer); if (RegOpenKeyExW(HKEY_CLASSES_ROOT, szResult, 0, KEY_READ | KEY_WRITE, &hSubKey) == ERROR_SUCCESS) { AddItemFromMRUList(pContext, hSubKey); @@ -1170,7 +1155,7 @@ LoadItemFromHKCU(POPEN_WITH_CONTEXT pContext, WCHAR * szExt) static const WCHAR szOpenWithList[] = L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\%s"; /* handle first progid lists */ - sprintfW(szBuffer, szOpenWithProgIDs, szExt); + swprintf(szBuffer, szOpenWithProgIDs, szExt); if (RegOpenKeyExW(HKEY_CURRENT_USER, szBuffer, 0, KEY_READ | KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS) { AddItemFromProgIDList(pContext, hKey); @@ -1178,7 +1163,7 @@ LoadItemFromHKCU(POPEN_WITH_CONTEXT pContext, WCHAR * szExt) } /* now handle mru lists */ - sprintfW(szBuffer, szOpenWithList, szExt); + swprintf(szBuffer, szOpenWithList, szExt); if (RegOpenKeyExW(HKEY_CURRENT_USER, szBuffer, 0, KEY_READ | KEY_WRITE, &hKey) == ERROR_SUCCESS) { AddItemFromMRUList(pContext, hKey); @@ -1231,7 +1216,7 @@ SHEOW_LoadOpenWithItems(SHEOWImpl *This, IDataObject *pdtobj) return E_OUTOFMEMORY; } if (_ILIsDesktop(pidl_child) || _ILIsMyDocuments(pidl_child) || _ILIsControlPanel(pidl_child) || _ILIsNetHood(pidl_child) || - _ILIsBitBucket(pidl_child) || _ILIsDrive(pidl_child) || _ILIsCPanelStruct(pidl_child) || _ILIsFolder(pidl_child)) + _ILIsBitBucket(pidl_child) || _ILIsDrive(pidl_child) || _ILIsCPanelStruct(pidl_child) || _ILIsFolder(pidl_child) || _ILIsControlPanel(pidl_folder)) { TRACE("pidl is a folder\n"); SHFree((void*)pidl); diff --git a/reactos/dll/win32/shell32/shell.c b/reactos/dll/win32/shell32/shell.c index 26b614636c7..71761fc49ad 100644 --- a/reactos/dll/win32/shell32/shell.c +++ b/reactos/dll/win32/shell32/shell.c @@ -20,612 +20,14 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - #include #include #include -#ifdef HAVE_UNISTD_H -# include -#endif #include +#include +#include +#include -#include "windef.h" -#include "winbase.h" -#include "winreg.h" -#include "wownt32.h" -#include "shellapi.h" -#include "winuser.h" -#include "wingdi.h" -#include "shlobj.h" -#include "shlwapi.h" -#include "wine/winbase16.h" -#include "shell32_main.h" -#include "wine/debug.h" -WINE_DEFAULT_DEBUG_CHANNEL(shell); - - -typedef struct { /* structure for dropped files */ - WORD wSize; - POINT16 ptMousePos; - BOOL16 fInNonClientArea; - /* memory block with filenames follows */ -} DROPFILESTRUCT16, *LPDROPFILESTRUCT16; - -static const char lpstrMsgWndCreated[] = "OTHERWINDOWCREATED"; -static const char lpstrMsgWndDestroyed[] = "OTHERWINDOWDESTROYED"; -static const char lpstrMsgShellActivate[] = "ACTIVATESHELLWINDOW"; - -static HWND SHELL_hWnd = 0; -static HHOOK SHELL_hHook = 0; -static UINT uMsgWndCreated = 0; -static UINT uMsgWndDestroyed = 0; -static UINT uMsgShellActivate = 0; - -/*********************************************************************** - * DllEntryPoint [SHELL.101] - * - * Initialization code for shell.dll. Automatically loads the - * 32-bit shell32.dll to allow thunking up to 32-bit code. - * - * RETURNS - * Success: TRUE. Initialization completed successfully. - * Failure: FALSE. - */ -BOOL WINAPI SHELL_DllEntryPoint(DWORD Reason, HINSTANCE16 hInst, - WORD ds, WORD HeapSize, DWORD res1, WORD res2) -{ - return TRUE; -} - -/************************************************************************* - * DragAcceptFiles [SHELL.9] - */ -void WINAPI DragAcceptFiles16(HWND16 hWnd, BOOL16 b) -{ - DragAcceptFiles(HWND_32(hWnd), b); -} - -/************************************************************************* - * DragQueryFile [SHELL.11] - */ -UINT16 WINAPI DragQueryFile16( - HDROP16 hDrop, - WORD wFile, - LPSTR lpszFile, - WORD wLength) -{ - LPSTR lpDrop; - UINT i = 0; - LPDROPFILESTRUCT16 lpDropFileStruct = (LPDROPFILESTRUCT16) GlobalLock16(hDrop); - - TRACE("(%04x, %x, %p, %u)\n", hDrop,wFile,lpszFile,wLength); - - if(!lpDropFileStruct) goto end; - - lpDrop = (LPSTR) lpDropFileStruct + lpDropFileStruct->wSize; - - while (i++ < wFile) - { - while (*lpDrop++); /* skip filename */ - if (!*lpDrop) - { - i = (wFile == 0xFFFF) ? i : 0; - goto end; - } - } - - i = strlen(lpDrop); - if (!lpszFile ) goto end; /* needed buffer size */ - lstrcpynA (lpszFile, lpDrop, wLength); -end: - GlobalUnlock16(hDrop); - return i; -} - -/************************************************************************* - * DragFinish [SHELL.12] - */ -void WINAPI DragFinish16(HDROP16 h) -{ - TRACE("\n"); - GlobalFree16((HGLOBAL16)h); -} - - -/************************************************************************* - * DragQueryPoint [SHELL.13] - */ -BOOL16 WINAPI DragQueryPoint16(HDROP16 hDrop, POINT16 *p) -{ - LPDROPFILESTRUCT16 lpDropFileStruct; - BOOL16 bRet; - TRACE("\n"); - lpDropFileStruct = (LPDROPFILESTRUCT16) GlobalLock16(hDrop); - - memcpy(p,&lpDropFileStruct->ptMousePos,sizeof(POINT16)); - bRet = lpDropFileStruct->fInNonClientArea; - - GlobalUnlock16(hDrop); - return bRet; -} - -/************************************************************************* - * FindExecutable (SHELL.21) - */ -HINSTANCE16 WINAPI FindExecutable16( LPCSTR lpFile, LPCSTR lpDirectory, - LPSTR lpResult ) -{ return HINSTANCE_16(FindExecutableA( lpFile, lpDirectory, lpResult )); -} - -/************************************************************************* - * AboutDlgProc (SHELL.33) - */ -BOOL16 WINAPI AboutDlgProc16( HWND16 hWnd, UINT16 msg, WPARAM16 wParam, - LPARAM lParam ) -{ return (BOOL16)AboutDlgProc( HWND_32(hWnd), msg, wParam, lParam ); -} - - -/************************************************************************* - * ShellAbout (SHELL.22) - */ -BOOL16 WINAPI ShellAbout16( HWND16 hWnd, LPCSTR szApp, LPCSTR szOtherStuff, - HICON16 hIcon ) -{ return ShellAboutA( HWND_32(hWnd), szApp, szOtherStuff, HICON_32(hIcon) ); -} - -/************************************************************************* - * InternalExtractIcon [SHELL.39] - * - * This abortion is called directly by Progman - */ -HGLOBAL16 WINAPI InternalExtractIcon16(HINSTANCE16 hInstance, - LPCSTR lpszExeFileName, UINT16 nIconIndex, WORD n ) -{ - HGLOBAL16 hRet = 0; - HICON16 *RetPtr = NULL; - OFSTRUCT ofs; - - TRACE("(%04x,file %s,start %d,extract %d\n", - hInstance, lpszExeFileName, nIconIndex, n); - - if (!n) - return 0; - - hRet = GlobalAlloc16(GMEM_FIXED | GMEM_ZEROINIT, sizeof(*RetPtr) * n); - RetPtr = (HICON16*)GlobalLock16(hRet); - - if (nIconIndex == (UINT16)-1) /* get number of icons */ - { - RetPtr[0] = PrivateExtractIconsA(ofs.szPathName, 0, 0, 0, NULL, NULL, 0, LR_DEFAULTCOLOR); - } - else - { - UINT ret; - HICON *icons; - - icons = HeapAlloc(GetProcessHeap(), 0, n * sizeof(*icons)); - ret = PrivateExtractIconsA(ofs.szPathName, nIconIndex, - GetSystemMetrics(SM_CXICON), - GetSystemMetrics(SM_CYICON), - icons, NULL, n, LR_DEFAULTCOLOR); - if ((ret != 0xffffffff) && ret) - { - int i; - for (i = 0; i < n; i++) RetPtr[i] = HICON_16(icons[i]); - } - else - { - GlobalFree16(hRet); - hRet = 0; - } - HeapFree(GetProcessHeap(), 0, icons); - } - return hRet; -} - -/************************************************************************* - * ExtractIcon (SHELL.34) - */ -HICON16 WINAPI ExtractIcon16( HINSTANCE16 hInstance, LPCSTR lpszExeFileName, - UINT16 nIconIndex ) -{ TRACE("\n"); - return HICON_16(ExtractIconA(HINSTANCE_32(hInstance), lpszExeFileName, nIconIndex)); -} - -/************************************************************************* - * ExtractIconEx (SHELL.40) - */ -HICON16 WINAPI ExtractIconEx16( - LPCSTR lpszFile, INT16 nIconIndex, HICON16 *phiconLarge, - HICON16 *phiconSmall, UINT16 nIcons -) { - HICON *ilarge,*ismall; - UINT16 ret; - int i; - - if (phiconLarge) - ilarge = HeapAlloc(GetProcessHeap(),0,nIcons*sizeof(HICON)); - else - ilarge = NULL; - if (phiconSmall) - ismall = HeapAlloc(GetProcessHeap(),0,nIcons*sizeof(HICON)); - else - ismall = NULL; - ret = HICON_16(ExtractIconExA(lpszFile,nIconIndex,ilarge,ismall,nIcons)); - if (ilarge) { - for (i=0;i length - 1 ) - goto err; - - memcpy(lpBuffer + bufCnt, lpKey, l); - bufCnt += l; - } else { /* Keyword not found; Leave the %KEYWORD% intact */ - if( bufCnt + envKeyLen + 2 > length - 1 ) - goto err; - - memcpy(lpBuffer + bufCnt, lpstr, envKeyLen + 2); - bufCnt += envKeyLen + 2; - } - - lpstr = lpend + 1; - } - - if (!*lpstr && bufCnt <= length - 1) { - memcpy(str,lpBuffer, bufCnt); - str[bufCnt] = '\0'; - retLength = bufCnt + 1; - retStatus = 1; - } - - err: - if (!retStatus) - WARN("-- Env subst aborted - string too short or invalid input\n"); - TRACE("-- return %s\n", str); - - OemToCharA(str,str); - HeapFree( GetProcessHeap(), 0, lpBuffer); - - return (DWORD)MAKELONG(retLength, retStatus); -} - -/************************************************************************* - * SHELL_HookProc - * - * 32-bit version of the system-wide WH_SHELL hook. - */ -static LRESULT WINAPI SHELL_HookProc(INT code, WPARAM wParam, LPARAM lParam) -{ - TRACE("%i, %lx, %08lx\n", code, wParam, lParam ); - - if (SHELL_hWnd) - { - switch( code ) - { - case HSHELL_WINDOWCREATED: - PostMessageA( SHELL_hWnd, uMsgWndCreated, wParam, 0 ); - break; - case HSHELL_WINDOWDESTROYED: - PostMessageA( SHELL_hWnd, uMsgWndDestroyed, wParam, 0 ); - break; - case HSHELL_ACTIVATESHELLWINDOW: - PostMessageA( SHELL_hWnd, uMsgShellActivate, wParam, 0 ); - break; - } - } - return CallNextHookEx( SHELL_hHook, code, wParam, lParam ); -} - -/************************************************************************* - * ShellHookProc [SHELL.103] - * System-wide WH_SHELL hook. - */ -LRESULT WINAPI ShellHookProc16(INT16 code, WPARAM16 wParam, LPARAM lParam) -{ - return SHELL_HookProc( code, wParam, lParam ); -} - -/************************************************************************* - * RegisterShellHook [SHELL.102] - */ -BOOL WINAPI RegisterShellHook16(HWND16 hWnd, UINT16 uAction) -{ - TRACE("%04x [%u]\n", hWnd, uAction ); - - switch( uAction ) - { - case 2: /* register hWnd as a shell window */ - if( !SHELL_hHook ) - { - SHELL_hHook = SetWindowsHookExA( WH_SHELL, SHELL_HookProc, - GetModuleHandleA("shell32.dll"), 0 ); - if ( SHELL_hHook ) - { - uMsgWndCreated = RegisterWindowMessageA( lpstrMsgWndCreated ); - uMsgWndDestroyed = RegisterWindowMessageA( lpstrMsgWndDestroyed ); - uMsgShellActivate = RegisterWindowMessageA( lpstrMsgShellActivate ); - } - else - WARN("-- unable to install ShellHookProc()!\n"); - } - - if ( SHELL_hHook ) - return ((SHELL_hWnd = HWND_32(hWnd)) != 0); - break; - - default: - WARN("-- unknown code %i\n", uAction ); - SHELL_hWnd = 0; /* just in case */ - } - return FALSE; -} - - -/*********************************************************************** - * DriveType (SHELL.262) - */ -UINT16 WINAPI DriveType16( UINT16 drive ) -{ - UINT ret; - char path[] = "A:\\"; - path[0] += drive; - ret = GetDriveTypeA(path); - switch(ret) /* some values are not supported in Win16 */ - { - case DRIVE_CDROM: - ret = DRIVE_REMOTE; - break; - case DRIVE_NO_ROOT_DIR: - ret = DRIVE_UNKNOWN; - break; - } - return ret; -} - - -/* 0 and 1 are valid rootkeys in win16 shell.dll and are used by - * some programs. Do not remove those cases. -MM - */ -static inline void fix_win16_hkey( HKEY *hkey ) -{ - if (*hkey == 0 || *hkey == (HKEY)1) *hkey = HKEY_CLASSES_ROOT; -} - -/****************************************************************************** - * RegOpenKey [SHELL.1] - */ -DWORD WINAPI RegOpenKey16( HKEY hkey, LPCSTR name, PHKEY retkey ) -{ - fix_win16_hkey( &hkey ); - return RegOpenKeyA( hkey, name, retkey ); -} - -/****************************************************************************** - * RegCreateKey [SHELL.2] - */ -DWORD WINAPI RegCreateKey16( HKEY hkey, LPCSTR name, PHKEY retkey ) -{ - fix_win16_hkey( &hkey ); - return RegCreateKeyA( hkey, name, retkey ); -} - -/****************************************************************************** - * RegCloseKey [SHELL.3] - */ -DWORD WINAPI RegCloseKey16( HKEY hkey ) -{ - fix_win16_hkey( &hkey ); - return RegCloseKey( hkey ); -} - -/****************************************************************************** - * RegDeleteKey [SHELL.4] - */ -DWORD WINAPI RegDeleteKey16( HKEY hkey, LPCSTR name ) -{ - fix_win16_hkey( &hkey ); - return RegDeleteKeyA( hkey, name ); -} - -/****************************************************************************** - * RegSetValue [SHELL.5] - */ -DWORD WINAPI RegSetValue16( HKEY hkey, LPCSTR name, DWORD type, LPCSTR data, DWORD count ) -{ - fix_win16_hkey( &hkey ); - return RegSetValueA( hkey, name, type, data, count ); -} - -/****************************************************************************** - * RegQueryValue [SHELL.6] - * - * NOTES - * Is this HACK still applicable? - * - * HACK - * The 16bit RegQueryValue doesn't handle selectorblocks anyway, so we just - * mask out the high 16 bit. This (not so much incidently) hopefully fixes - * Aldus FH4) - */ -DWORD WINAPI RegQueryValue16( HKEY hkey, LPCSTR name, LPSTR data, LPDWORD count -) -{ - fix_win16_hkey( &hkey ); - if (count) *count &= 0xffff; - return RegQueryValueA( hkey, name, data, (LONG*) count ); -} - -/****************************************************************************** - * RegEnumKey [SHELL.7] - */ -DWORD WINAPI RegEnumKey16( HKEY hkey, DWORD index, LPSTR name, DWORD name_len ) -{ - fix_win16_hkey( &hkey ); - return RegEnumKeyA( hkey, index, name, name_len ); -} - -/************************************************************************* - * SHELL_Execute16 [Internal] - */ -static UINT_PTR SHELL_Execute16(const WCHAR *lpCmd, WCHAR *env, BOOL shWait, - LPSHELLEXECUTEINFOW psei, LPSHELLEXECUTEINFOW psei_out) -{ - UINT ret; - char sCmd[MAX_PATH]; - WideCharToMultiByte(CP_ACP, 0, lpCmd, -1, sCmd, MAX_PATH, NULL, NULL); - ret = WinExec16(sCmd, (UINT16)psei->nShow); - psei_out->hInstApp = HINSTANCE_32(ret); - return ret; -} - -/************************************************************************* - * ShellExecute [SHELL.20] - */ -HINSTANCE16 WINAPI ShellExecute16( HWND16 hWnd, LPCSTR lpOperation, - LPCSTR lpFile, LPCSTR lpParameters, - LPCSTR lpDirectory, INT16 iShowCmd ) -{ - SHELLEXECUTEINFOW seiW; - WCHAR *wVerb = NULL, *wFile = NULL, *wParameters = NULL, *wDirectory = NULL; - HANDLE hProcess = 0; - - seiW.lpVerb = lpOperation ? __SHCloneStrAtoW(&wVerb, lpOperation) : NULL; - seiW.lpFile = lpFile ? __SHCloneStrAtoW(&wFile, lpFile) : NULL; - seiW.lpParameters = lpParameters ? __SHCloneStrAtoW(&wParameters, lpParameters) : NULL; - seiW.lpDirectory = lpDirectory ? __SHCloneStrAtoW(&wDirectory, lpDirectory) : NULL; - - seiW.cbSize = sizeof(seiW); - seiW.fMask = 0; - seiW.hwnd = HWND_32(hWnd); - seiW.nShow = iShowCmd; - seiW.lpIDList = 0; - seiW.lpClass = 0; - seiW.hkeyClass = 0; - seiW.dwHotKey = 0; - seiW.hProcess = hProcess; - - SHELL_execute( &seiW, SHELL_Execute16 ); - - SHFree(wVerb); - SHFree(wFile); - SHFree(wParameters); - SHFree(wDirectory); - - return HINSTANCE_16(seiW.hInstApp); -} diff --git a/reactos/dll/win32/shell32/shell32.rbuild b/reactos/dll/win32/shell32/shell32.rbuild index 991848772af..d3eeeef2782 100644 --- a/reactos/dll/win32/shell32/shell32.rbuild +++ b/reactos/dll/win32/shell32/shell32.rbuild @@ -25,6 +25,7 @@ devmgr winspool winmm + precomp.h authors.c autocomplete.c brsfolder.c @@ -32,7 +33,6 @@ classes.c clipboard.c control.c - cpanelfolder.c dataobject.c dde.c debughlp.c @@ -58,6 +58,10 @@ shfldr_mydocuments.c shfldr_printers.c shfldr_admintools.c + shfldr_netplaces.c + shfldr_fonts.c + shfldr_cpanel.c + shfldr_recyclebin.c shlexec.c shlfileop.c shlfolder.c @@ -65,18 +69,14 @@ shlmenu.c shlview.c shpolicy.c - shv_bg_cmenu.c - shv_item_cmenu.c + shv_def_cmenu.c startmenu.c ros-systray.c - shell32.rc shell32.spec fprop.c drive.c - shfldr_recyclebin.c she_ocmenu.c shv_item_new.c folder_options.c - shfldr_netplaces.c - shfldr_fonts.c + shell32.rc diff --git a/reactos/dll/win32/shell32/shell32_main.c b/reactos/dll/win32/shell32/shell32_main.c index fa2f3a04bec..2887fa62f34 100644 --- a/reactos/dll/win32/shell32/shell32_main.c +++ b/reactos/dll/win32/shell32/shell32_main.c @@ -19,34 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" - -#include -#include -#include -#include - -#define COBJMACROS - -#include "windef.h" -#include "winbase.h" -#include "winerror.h" -#include "winreg.h" -#include "dlgs.h" -#include "shellapi.h" -#include "winuser.h" -#include "wingdi.h" -#include "shlobj.h" -#include "shlwapi.h" - -#include "undocshell.h" -#include "pidl.h" -#include "shell32_main.h" -#include "version.h" -#include "shresdef.h" - -#include "wine/debug.h" -#include "wine/unicode.h" +#include WINE_DEFAULT_DEBUG_CHANNEL(shell); @@ -157,11 +130,11 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs) /* Allocate in a single lump, the string array, and the strings that go with it. * This way the caller can make a single GlobalFree call to free both, as per MSDN. */ - argv=LocalAlloc(LMEM_FIXED, argc*sizeof(LPWSTR)+(strlenW(lpCmdline)+1)*sizeof(WCHAR)); + argv=LocalAlloc(LMEM_FIXED, argc*sizeof(LPWSTR)+(wcslen(lpCmdline)+1)*sizeof(WCHAR)); if (!argv) return NULL; cmdline=(LPWSTR)(argv+argc); - strcpyW(cmdline, lpCmdline); + wcscpy(cmdline, lpCmdline); argc=0; bcount=0; @@ -439,7 +412,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, { if (flags & SHGFI_USEFILEATTRIBUTES) { - lstrcpyW (psfi->szDisplayName, PathFindFileNameW(szFullPath)); + wcscpy (psfi->szDisplayName, PathFindFileNameW(szFullPath)); } else { @@ -466,17 +439,17 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, else { if (dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) - strcatW (psfi->szTypeName, szFile); + wcscat (psfi->szTypeName, szFile); else { WCHAR sTemp[64]; - lstrcpyW(sTemp,PathFindExtensionW(szFullPath)); + wcscpy(sTemp,PathFindExtensionW(szFullPath)); if (!( HCR_MapTypeToValueW(sTemp, sTemp, 64, TRUE) && HCR_MapTypeToValueW(sTemp, psfi->szTypeName, 80, FALSE ))) { lstrcpynW (psfi->szTypeName, sTemp, 64); - strcatW (psfi->szTypeName, szDashFile); + wcscat (psfi->szTypeName, szDashFile); } } } @@ -513,7 +486,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, { if (dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - lstrcpyW(psfi->szDisplayName, swShell32Name); + wcscpy(psfi->szDisplayName, swShell32Name); psfi->iIcon = -IDI_SHELL_FOLDER; } else @@ -529,11 +502,11 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, HCR_GetDefaultIconW(sTemp, sTemp, MAX_PATH, &psfi->iIcon)) { if (lstrcmpW(p1W, sTemp)) - strcpyW(psfi->szDisplayName, sTemp); + wcscpy(psfi->szDisplayName, sTemp); else { /* the icon is in the file */ - strcpyW(psfi->szDisplayName, szFullPath); + wcscpy(psfi->szDisplayName, szFullPath); } } else @@ -547,17 +520,17 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, &uDummy, (LPVOID*)&pei); if (SUCCEEDED(hr)) { - hr = IExtractIconW_GetIconLocation(pei, uGilFlags, + hr = pei->lpVtbl->GetIconLocation(pei, uGilFlags, szLocation, MAX_PATH, &iIndex, &uFlags); if (uFlags & GIL_NOTFILENAME) ret = FALSE; else { - lstrcpyW (psfi->szDisplayName, szLocation); + wcscpy (psfi->szDisplayName, szLocation); psfi->iIcon = iIndex; } - IExtractIconW_Release(pei); + pei->lpVtbl->Release(pei); } } } @@ -586,7 +559,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, HCR_GetDefaultIconW(sTemp, sTemp, MAX_PATH, &icon_idx)) { if (!lstrcmpW(p1W,sTemp)) /* icon is in the file */ - strcpyW(sTemp, szFullPath); + wcscpy(sTemp, szFullPath); if (flags & SHGFI_SYSICONINDEX) { @@ -1043,7 +1016,7 @@ INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam SendDlgItemMessageW(hWnd, IDC_SHELL_ABOUT_ICON, STM_SETICON, (WPARAM)info->hIcon, 0); GetWindowTextW( hWnd, szAppTitleTemplate, sizeof(szAppTitleTemplate) / sizeof(WCHAR) ); - wsprintfW( szAppTitle, szAppTitleTemplate, info->szApp ); + swprintf( szAppTitle, szAppTitleTemplate, info->szApp ); SetWindowTextW( hWnd, szAppTitle ); SetDlgItemTextW( hWnd, IDC_SHELL_ABOUT_APPNAME, info->szApp ); @@ -1108,13 +1081,13 @@ INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam uDecimals = (UCHAR)((UINT)(dTotalPhys * 100) - uIntegral * 100); // Display the RAM size with 2 decimals - wsprintfW(szBuf, L"%u%s%02u %s", uIntegral, szDecimalSeparator, uDecimals, szUnits); + swprintf(szBuf, L"%u%s%02u %s", uIntegral, szDecimalSeparator, uDecimals, szUnits); } } else { // We're dealing with MBs, don't show any decimals - wsprintfW( szBuf, L"%u MB", (UINT)MemStat.ullTotalPhys / 1024 / 1024 ); + swprintf( szBuf, L"%u MB", (UINT)MemStat.ullTotalPhys / 1024 / 1024 ); } SetDlgItemTextW( hWnd, IDC_SHELL_ABOUT_PHYSMEM, szBuf); diff --git a/reactos/dll/win32/shell32/shell32_main.h b/reactos/dll/win32/shell32/shell32_main.h index ec01b3b5a69..a4b05a83162 100644 --- a/reactos/dll/win32/shell32/shell32_main.h +++ b/reactos/dll/win32/shell32/shell32_main.h @@ -23,7 +23,9 @@ #define __WINE_SHELL_MAIN_H #include +#include +/* #include "windef.h" #include "winbase.h" #include "wingdi.h" @@ -38,6 +40,7 @@ #include "wine/windef16.h" #include "wine/unicode.h" +*/ /******************************************* * global SHELL32.DLL variables */ @@ -162,24 +165,10 @@ void FreeChangeNotifications(void); BOOL SHELL_DeleteDirectoryW(HWND hwnd, LPCWSTR pwszDir, BOOL bShowUI); BOOL SHELL_ConfirmYesNoW(HWND hWnd, int nKindOfDialog, LPCWSTR szDir); -/* 16-bit functions */ -void WINAPI DragAcceptFiles16(HWND16 hWnd, BOOL16 b); -UINT16 WINAPI DragQueryFile16(HDROP16 hDrop, WORD wFile, LPSTR lpszFile, WORD wLength); -void WINAPI DragFinish16(HDROP16 h); -BOOL16 WINAPI DragQueryPoint16(HDROP16 hDrop, POINT16 *p); -HINSTANCE16 WINAPI ShellExecute16(HWND16,LPCSTR,LPCSTR,LPCSTR,LPCSTR,INT16); -HICON16 WINAPI ExtractIcon16(HINSTANCE16,LPCSTR,UINT16); -HICON16 WINAPI ExtractAssociatedIcon16(HINSTANCE16,LPSTR,LPWORD); -HICON16 WINAPI ExtractIconEx16 ( LPCSTR, INT16, HICON16 *, HICON16 *, UINT16 ); -HINSTANCE16 WINAPI FindExecutable16(LPCSTR,LPCSTR,LPSTR); -HGLOBAL16 WINAPI InternalExtractIcon16(HINSTANCE16,LPCSTR,UINT16,WORD); -BOOL16 WINAPI ShellAbout16(HWND16,LPCSTR,LPCSTR,HICON16); -BOOL16 WINAPI AboutDlgProc16(HWND16,UINT16,WPARAM16,LPARAM); +void WINAPI _InsertMenuItemW (HMENU hmenu, UINT indexMenu, BOOL fByPosition, + UINT wID, UINT fType, LPCWSTR dwTypeData, UINT fState); -void WINAPI _InsertMenuItem (HMENU hmenu, UINT indexMenu, BOOL fByPosition, - UINT wID, UINT fType, LPCSTR dwTypeData, UINT fState); - -static inline BOOL SHELL_OsIsUnicode(void) +static BOOL __inline SHELL_OsIsUnicode(void) { /* if high-bit of version is 0, we are emulating NT */ return !(GetVersion() & 0x80000000); @@ -190,26 +179,26 @@ static inline BOOL SHELL_OsIsUnicode(void) SHFree(*ptr); \ *ptr = NULL; \ }; -static inline void __SHCloneStrA(char ** target,const char * source) +static void __inline __SHCloneStrA(char ** target,const char * source) { *target = SHAlloc(strlen(source)+1); strcpy(*target, source); } -static inline void __SHCloneStrWtoA(char ** target, const WCHAR * source) +static void __inline __SHCloneStrWtoA(char ** target, const WCHAR * source) { int len = WideCharToMultiByte(CP_ACP, 0, source, -1, NULL, 0, NULL, NULL); *target = SHAlloc(len); WideCharToMultiByte(CP_ACP, 0, source, -1, *target, len, NULL, NULL); } -static inline void __SHCloneStrW(WCHAR ** target, const WCHAR * source) +static void __inline __SHCloneStrW(WCHAR ** target, const WCHAR * source) { *target = SHAlloc( (lstrlenW(source)+1) * sizeof(WCHAR) ); lstrcpyW(*target, source); } -static inline WCHAR * __SHCloneStrAtoW(WCHAR ** target, const char * source) +static LPWSTR __inline __SHCloneStrAtoW(WCHAR ** target, const char * source) { int len = MultiByteToWideChar(CP_ACP, 0, source, -1, NULL, 0); *target = SHAlloc(len*sizeof(WCHAR)); @@ -246,8 +235,8 @@ BOOL SHELL_IsShortcut(LPCITEMIDLIST); INT_PTR CALLBACK SH_FileGeneralDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); INT_PTR CALLBACK SH_FileVersionDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); HPROPSHEETPAGE SH_CreatePropertySheetPage(LPSTR resname, DLGPROC dlgproc, LPARAM lParam, LPWSTR szTitle); -BOOL SH_ShowDriveProperties(WCHAR * drive); +BOOL SH_ShowDriveProperties(WCHAR * drive, LPCITEMIDLIST pidlFolder, LPCITEMIDLIST * apidl); BOOL SH_ShowRecycleBinProperties(WCHAR sDrive); -BOOL SH_ShowPropertiesDialog(PCWSTR lpf); +BOOL SH_ShowPropertiesDialog(LPWSTR lpf, LPCITEMIDLIST pidlFolder, LPCITEMIDLIST * apidl); BOOL SH_ShowFolderProperties(LPWSTR pwszFolder); #endif diff --git a/reactos/dll/win32/shell32/shellfolder.h b/reactos/dll/win32/shell32/shellfolder.h index 942e0e7ea28..7b8bd898271 100644 --- a/reactos/dll/win32/shell32/shellfolder.h +++ b/reactos/dll/win32/shell32/shellfolder.h @@ -37,6 +37,7 @@ DEFINE_GUID(IID_ISFHelper, 0x1fe68efbL, 0x1874, 0x9812, 0x56, 0xdc, 0x00, 0x00, /***************************************************************************** * ISFHelper interface */ +#undef INTERFACE #define INTERFACE ISFHelper DECLARE_INTERFACE_(ISFHelper,IUnknown) diff --git a/reactos/dll/win32/shell32/shelllink.c b/reactos/dll/win32/shell32/shelllink.c index 2e174836c75..ce03347f077 100644 --- a/reactos/dll/win32/shell32/shelllink.c +++ b/reactos/dll/win32/shell32/shelllink.c @@ -32,38 +32,10 @@ * in that string is parsed an stored. */ -#define COBJMACROS -#define NONAMELESSUNION - -#include "wine/debug.h" -#include "winerror.h" -#include "windef.h" -#include "winbase.h" -#include "winnls.h" -#include "winreg.h" - -#include "winuser.h" -#include "wingdi.h" -#include "shlobj.h" -#include "undocshell.h" - -#include "pidl.h" -#include "shell32_main.h" -#include "shlguid.h" -#include "shlwapi.h" -#include "msi.h" -#include "appmgmt.h" -#include "prsht.h" -#include "initguid.h" -#include "shresdef.h" +#include WINE_DEFAULT_DEBUG_CHANNEL(shell); -DEFINE_GUID( SHELL32_AdvtShortcutProduct, - 0x9db1186f,0x40df,0x11d1,0xaa,0x8c,0x00,0xc0,0x4f,0xb6,0x78,0x63); -DEFINE_GUID( SHELL32_AdvtShortcutComponent, - 0x9db1186e,0x40df,0x11d1,0xaa,0x8c,0x00,0xc0,0x4f,0xb6,0x78,0x63); - /* link file formats */ #include "pshpack1.h" @@ -166,44 +138,44 @@ typedef struct BOOL bDirty; INT iIdOpen; /* id of the "Open" entry in the context menu */ IUnknown *site; -} IShellLinkImpl; +} IShellLinkImpl, *LPIShellLinkImpl; -static inline IShellLinkImpl *impl_from_IShellLinkW( IShellLinkW *iface ) +static LPIShellLinkImpl __inline impl_from_IShellLinkW( IShellLinkW *iface ) { return (IShellLinkImpl *)((char*)iface - FIELD_OFFSET(IShellLinkImpl, lpvtblw)); } -static inline IShellLinkImpl *impl_from_IPersistFile( IPersistFile *iface ) +static LPIShellLinkImpl __inline impl_from_IPersistFile( IPersistFile *iface ) { return (IShellLinkImpl *)((char*)iface - FIELD_OFFSET(IShellLinkImpl, lpvtblPersistFile)); } -static inline IShellLinkImpl *impl_from_IPersistStream( IPersistStream *iface ) +static LPIShellLinkImpl __inline impl_from_IPersistStream( IPersistStream *iface ) { return (IShellLinkImpl *)((char*)iface - FIELD_OFFSET(IShellLinkImpl, lpvtblPersistStream)); } -static inline IShellLinkImpl *impl_from_IShellLinkDataList( IShellLinkDataList *iface ) +static LPIShellLinkImpl __inline impl_from_IShellLinkDataList( IShellLinkDataList *iface ) { return (IShellLinkImpl *)((char*)iface - FIELD_OFFSET(IShellLinkImpl, lpvtblShellLinkDataList)); } -static inline IShellLinkImpl *impl_from_IShellExtInit( IShellExtInit *iface ) +static LPIShellLinkImpl __inline impl_from_IShellExtInit( IShellExtInit *iface ) { return (IShellLinkImpl *)((char*)iface - FIELD_OFFSET(IShellLinkImpl, lpvtblShellExtInit)); } -static inline IShellLinkImpl *impl_from_IContextMenu( IContextMenu *iface ) +static LPIShellLinkImpl __inline impl_from_IContextMenu( IContextMenu *iface ) { return (IShellLinkImpl *)((char*)iface - FIELD_OFFSET(IShellLinkImpl, lpvtblContextMenu)); } -static inline IShellLinkImpl *impl_from_IObjectWithSite( IObjectWithSite *iface ) +static LPIShellLinkImpl __inline impl_from_IObjectWithSite( IObjectWithSite *iface ) { return (IShellLinkImpl *)((char*)iface - FIELD_OFFSET(IShellLinkImpl, lpvtblObjectWithSite)); } -static inline IShellLinkImpl *impl_from_IShellPropSheetExt( IShellPropSheetExt *iface ) +static LPIShellLinkImpl __inline impl_from_IShellPropSheetExt( IShellPropSheetExt *iface ) { return (IShellLinkImpl *)((char*)iface - FIELD_OFFSET(IShellLinkImpl, lpvtblPropSheetExt)); } @@ -212,7 +184,7 @@ static inline IShellLinkImpl *impl_from_IShellPropSheetExt( IShellPropSheetExt * static HRESULT ShellLink_UpdatePath(LPCWSTR sPathRel, LPCWSTR path, LPCWSTR sWorkDir, LPWSTR* psPath); /* strdup on the process heap */ -static inline LPWSTR HEAP_strdupAtoW( HANDLE heap, DWORD flags, LPCSTR str) +static LPWSTR __inline HEAP_strdupAtoW( HANDLE heap, DWORD flags, LPCSTR str) { INT len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 ); LPWSTR p = HeapAlloc( heap, flags, len*sizeof (WCHAR) ); @@ -222,13 +194,13 @@ static inline LPWSTR HEAP_strdupAtoW( HANDLE heap, DWORD flags, LPCSTR str) return p; } -static inline LPWSTR strdupW( LPCWSTR src ) +static LPWSTR __inline strdupW( LPCWSTR src ) { LPWSTR dest; if (!src) return NULL; - dest = HeapAlloc( GetProcessHeap(), 0, (lstrlenW(src)+1)*sizeof(WCHAR) ); + dest = HeapAlloc( GetProcessHeap(), 0, (wcslen(src)+1)*sizeof(WCHAR) ); if (dest) - lstrcpyW(dest, src); + wcscpy(dest, src); return dest; } @@ -424,12 +396,12 @@ static BOOL StartLinkProcessor( LPCOLESTR szLink ) PROCESS_INFORMATION pi; BOOL ret; - len = sizeof(szFormat) + lstrlenW( szLink ) * sizeof(WCHAR); + len = sizeof(szFormat) + wcslen( szLink ) * sizeof(WCHAR); buffer = HeapAlloc( GetProcessHeap(), 0, len ); if( !buffer ) return FALSE; - wsprintfW( buffer, szFormat, szLink ); + swprintf( buffer, szFormat, szLink ); TRACE("starting %s\n",debugstr_w(buffer)); @@ -762,36 +734,36 @@ static HRESULT Stream_LoadAdvertiseInfo( IStream* stm, LPWSTR *str ) TRACE("%p\n",stm); - r = IStream_Read( stm, &buffer.dbh.cbSize, sizeof (DWORD), &count ); + r = IStream_Read( stm, &buffer.cbSize, sizeof (DWORD), &count ); if( FAILED( r ) ) return r; /* make sure that we read the size of the structure even on error */ size = sizeof buffer - sizeof (DWORD); - if( buffer.dbh.cbSize != sizeof buffer ) + if( buffer.cbSize != sizeof buffer ) { ERR("Ooops. This structure is not as expected...\n"); return E_FAIL; } - r = IStream_Read( stm, &buffer.dbh.dwSignature, size, &count ); + r = IStream_Read( stm, &buffer.dwSignature, size, &count ); if( FAILED( r ) ) return r; if( count != size ) return E_FAIL; - TRACE("magic %08x string = %s\n", buffer.dbh.dwSignature, debugstr_w(buffer.szwDarwinID)); + TRACE("magic %08x string = %s\n", buffer.dwSignature, debugstr_w(buffer.szwDarwinID)); - if( (buffer.dbh.dwSignature&0xffff0000) != 0xa0000000 ) + if( (buffer.dwSignature&0xffff0000) != 0xa0000000 ) { - ERR("Unknown magic number %08x in advertised shortcut\n", buffer.dbh.dwSignature); + ERR("Unknown magic number %08x in advertised shortcut\n", buffer.dwSignature); return E_FAIL; } *str = HeapAlloc( GetProcessHeap(), 0, - (lstrlenW(buffer.szwDarwinID)+1) * sizeof(WCHAR) ); - lstrcpyW( *str, buffer.szwDarwinID ); + (wcslen(buffer.szwDarwinID)+1) * sizeof(WCHAR) ); + wcscpy( *str, buffer.szwDarwinID ); return S_OK; } @@ -924,6 +896,7 @@ static HRESULT WINAPI IPersistStream_fnLoad( if( FAILED( r ) ) goto end; +#if (NTDDI_VERSION < NTDDI_LONGHORN) if( hdr.dwFlags & SLDF_HAS_LOGO3ID ) { r = Stream_LoadAdvertiseInfo( stm, &This->sProduct ); @@ -931,6 +904,7 @@ static HRESULT WINAPI IPersistStream_fnLoad( } if( FAILED( r ) ) goto end; +#endif if( hdr.dwFlags & SLDF_HAS_DARWINID ) { @@ -970,7 +944,7 @@ end: */ static HRESULT Stream_WriteString( IStream* stm, LPCWSTR str ) { - USHORT len = lstrlenW( str ) + 1; + USHORT len = wcslen( str ) + 1; DWORD count; HRESULT r; @@ -1057,8 +1031,8 @@ static EXP_DARWIN_LINK* shelllink_build_darwinid( LPCWSTR string, DWORD magic ) EXP_DARWIN_LINK *buffer; buffer = LocalAlloc( LMEM_ZEROINIT, sizeof *buffer ); - buffer->dbh.cbSize = sizeof *buffer; - buffer->dbh.dwSignature = magic; + buffer->cbSize = sizeof *buffer; + buffer->dwSignature = magic; lstrcpynW( buffer->szwDarwinID, string, MAX_PATH ); WideCharToMultiByte(CP_ACP, 0, string, -1, buffer->szDarwinID, MAX_PATH, NULL, NULL ); @@ -1074,7 +1048,7 @@ static HRESULT Stream_WriteAdvertiseInfo( IStream* stm, LPCWSTR string, DWORD ma buffer = shelllink_build_darwinid( string, magic ); - return IStream_Write( stm, buffer, buffer->dbh.cbSize, &count ); + return IStream_Write( stm, buffer, buffer->cbSize, &count ); } /************************************************************************ @@ -1116,8 +1090,10 @@ static HRESULT WINAPI IPersistStream_fnSave( header.dwFlags |= SLDF_HAS_ARGS; if( This->sIcoPath ) header.dwFlags |= SLDF_HAS_ICONLOCATION; +#if (NTDDI_VERSION < NTDDI_LONGHORN) if( This->sProduct ) header.dwFlags |= SLDF_HAS_LOGO3ID; +#endif if( This->sComponent ) header.dwFlags |= SLDF_HAS_DARWINID; if( This->bRunAs ) @@ -1273,34 +1249,34 @@ static HRESULT ShellLink_UpdatePath(LPCWSTR sPathRel, LPCWSTR path, LPCWSTR sWor GetFullPathNameW( path, MAX_PATH*2, buffer, &final ); if( !final ) final = buffer; - lstrcpyW(final, sPathRel); + wcscpy(final, sPathRel); *abs_path = '\0'; if (SHELL_ExistsFileW(buffer)) { if (!GetFullPathNameW(buffer, MAX_PATH, abs_path, &final)) - lstrcpyW(abs_path, buffer); + wcscpy(abs_path, buffer); } else { /* try if [working directory] + [relative path] finds an existing file */ if (sWorkDir) { - lstrcpyW(buffer, sWorkDir); - lstrcpyW(PathAddBackslashW(buffer), sPathRel); + wcscpy(buffer, sWorkDir); + wcscpy(PathAddBackslashW(buffer), sPathRel); if (SHELL_ExistsFileW(buffer)) if (!GetFullPathNameW(buffer, MAX_PATH, abs_path, &final)) - lstrcpyW(abs_path, buffer); + wcscpy(abs_path, buffer); } } /* FIXME: This is even not enough - not all shell links can be resolved using this algorithm. */ if (!*abs_path) - lstrcpyW(abs_path, sPathRel); + wcscpy(abs_path, sPathRel); - *psPath = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(abs_path)+1)*sizeof(WCHAR)); + *psPath = HeapAlloc(GetProcessHeap(), 0, (wcslen(abs_path)+1)*sizeof(WCHAR)); if (!*psPath) return E_OUTOFMEMORY; - lstrcpyW(*psPath, abs_path); + wcscpy(*psPath, abs_path); } return S_OK; @@ -1566,9 +1542,9 @@ static HRESULT SHELL_PidlGeticonLocationA(IShellFolder* psf, LPCITEMIDLIST pidl, hr = IShellFolder_GetUIObjectOf(psf, 0, 1, (LPCITEMIDLIST*)&pidlLast, &IID_IExtractIconA, NULL, (LPVOID*)&pei); if (SUCCEEDED(hr)) { - hr = IExtractIconA_GetIconLocation(pei, 0, pszIconPath, MAX_PATH, piIcon, NULL); + hr = pei->lpVtbl->GetIconLocation(pei, 0, pszIconPath, MAX_PATH, piIcon, NULL); - IExtractIconA_Release(pei); + pei->lpVtbl->Release(pei); } IShellFolder_Release(psf); @@ -1816,11 +1792,11 @@ static HRESULT WINAPI IShellLinkW_fnSetDescription(IShellLinkW * iface, LPCWSTR HeapFree(GetProcessHeap(), 0, This->sDescription); This->sDescription = HeapAlloc( GetProcessHeap(), 0, - (lstrlenW( pszName )+1)*sizeof(WCHAR) ); + (wcslen( pszName )+1)*sizeof(WCHAR) ); if ( !This->sDescription ) return E_OUTOFMEMORY; - lstrcpyW( This->sDescription, pszName ); + wcscpy( This->sDescription, pszName ); This->bDirty = TRUE; return S_OK; @@ -1848,10 +1824,10 @@ static HRESULT WINAPI IShellLinkW_fnSetWorkingDirectory(IShellLinkW * iface, LPC HeapFree(GetProcessHeap(), 0, This->sWorkDir); This->sWorkDir = HeapAlloc( GetProcessHeap(), 0, - (lstrlenW( pszDir )+1)*sizeof (WCHAR) ); + (wcslen( pszDir )+1)*sizeof (WCHAR) ); if ( !This->sWorkDir ) return E_OUTOFMEMORY; - lstrcpyW( This->sWorkDir, pszDir ); + wcscpy( This->sWorkDir, pszDir ); This->bDirty = TRUE; return S_OK; @@ -1879,10 +1855,10 @@ static HRESULT WINAPI IShellLinkW_fnSetArguments(IShellLinkW * iface, LPCWSTR ps HeapFree(GetProcessHeap(), 0, This->sArgs); This->sArgs = HeapAlloc( GetProcessHeap(), 0, - (lstrlenW( pszArgs )+1)*sizeof (WCHAR) ); + (wcslen( pszArgs )+1)*sizeof (WCHAR) ); if ( !This->sArgs ) return E_OUTOFMEMORY; - lstrcpyW( This->sArgs, pszArgs ); + wcscpy( This->sArgs, pszArgs ); This->bDirty = TRUE; return S_OK; @@ -1946,9 +1922,9 @@ static HRESULT SHELL_PidlGeticonLocationW(IShellFolder* psf, LPCITEMIDLIST pidl, hr = IShellFolder_GetUIObjectOf(psf, 0, 1, (LPCITEMIDLIST*)&pidlLast, &IID_IExtractIconW, NULL, (LPVOID*)&pei); if (SUCCEEDED(hr)) { - hr = IExtractIconW_GetIconLocation(pei, 0, pszIconPath, MAX_PATH, piIcon, &wFlags); + hr = pei->lpVtbl->GetIconLocation(pei, 0, pszIconPath, MAX_PATH, piIcon, &wFlags); - IExtractIconW_Release(pei); + pei->lpVtbl->Release(pei); } IShellFolder_Release(psf); @@ -2016,10 +1992,10 @@ static HRESULT WINAPI IShellLinkW_fnSetIconLocation(IShellLinkW * iface, LPCWSTR HeapFree(GetProcessHeap(), 0, This->sIcoPath); This->sIcoPath = HeapAlloc( GetProcessHeap(), 0, - (lstrlenW( pszIconPath )+1)*sizeof (WCHAR) ); + (wcslen( pszIconPath )+1)*sizeof (WCHAR) ); if ( !This->sIcoPath ) return E_OUTOFMEMORY; - lstrcpyW( This->sIcoPath, pszIconPath ); + wcscpy( This->sIcoPath, pszIconPath ); This->iIcoNdx = iIcon; This->bDirty = TRUE; @@ -2035,10 +2011,10 @@ static HRESULT WINAPI IShellLinkW_fnSetRelativePath(IShellLinkW * iface, LPCWSTR HeapFree(GetProcessHeap(), 0, This->sPathRel); This->sPathRel = HeapAlloc( GetProcessHeap(), 0, - (lstrlenW( pszPathRel )+1) * sizeof (WCHAR) ); + (wcslen( pszPathRel )+1) * sizeof (WCHAR) ); if ( !This->sPathRel ) return E_OUTOFMEMORY; - lstrcpyW( This->sPathRel, pszPathRel ); + wcscpy( This->sPathRel, pszPathRel ); This->bDirty = TRUE; return ShellLink_UpdatePath(This->sPathRel, This->sPath, This->sWorkDir, &This->sPath); @@ -2061,11 +2037,11 @@ static HRESULT WINAPI IShellLinkW_fnResolve(IShellLinkW * iface, HWND hwnd, DWOR bSuccess = SHGetPathFromIDListW(This->pPidl, buffer); if (bSuccess && *buffer) { - This->sPath = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(buffer)+1)*sizeof(WCHAR)); + This->sPath = HeapAlloc(GetProcessHeap(), 0, (wcslen(buffer)+1)*sizeof(WCHAR)); if (!This->sPath) return E_OUTOFMEMORY; - lstrcpyW(This->sPath, buffer); + wcscpy(This->sPath, buffer); This->bDirty = TRUE; } else @@ -2073,11 +2049,11 @@ static HRESULT WINAPI IShellLinkW_fnResolve(IShellLinkW * iface, HWND hwnd, DWOR } if (!This->sIcoPath && This->sPath) { - This->sIcoPath = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(This->sPath)+1)*sizeof(WCHAR)); + This->sIcoPath = HeapAlloc(GetProcessHeap(), 0, (wcslen(This->sPath)+1)*sizeof(WCHAR)); if (!This->sIcoPath) return E_OUTOFMEMORY; - lstrcpyW(This->sIcoPath, This->sPath); + wcscpy(This->sIcoPath, This->sPath); This->iIcoNdx = 0; This->bDirty = TRUE; @@ -2095,7 +2071,7 @@ static LPWSTR ShellLink_GetAdvertisedArg(LPCWSTR str) if( !str ) return NULL; - p = strchrW( str, ':' ); + p = wcschr( str, ':' ); if( !p ) return NULL; len = p - str; @@ -2127,7 +2103,7 @@ static HRESULT ShellLink_SetAdvertiseInfo(IShellLinkImpl *This, LPCWSTR str) str += 2; /* there must be a colon straight after a guid */ - p = strchrW( str, ':' ); + p = wcschr( str, ':' ); if( !p ) return E_FAIL; len = p - str; @@ -2151,7 +2127,7 @@ static HRESULT ShellLink_SetAdvertiseInfo(IShellLinkImpl *This, LPCWSTR str) return E_FAIL; /* skip to the next field */ - str = strchrW( str, ':' ); + str = wcschr( str, ':' ); if( !str ) return E_FAIL; } @@ -2194,7 +2170,7 @@ static HRESULT WINAPI IShellLinkW_fnSetPath(IShellLinkW * iface, LPCWSTR pszFile TRACE("(%p)->(path=%s)\n",This, debugstr_w(pszFile)); /* quotes at the ends of the string are stripped */ - len = lstrlenW(pszFile); + len = wcslen(pszFile); if (pszFile[0] == '"' && pszFile[len-1] == '"') { unquoted = strdupW(pszFile); @@ -2203,7 +2179,7 @@ static HRESULT WINAPI IShellLinkW_fnSetPath(IShellLinkW * iface, LPCWSTR pszFile } /* any other quote marks are invalid */ - if (strchrW(pszFile, '"')) + if (wcschr(pszFile, '"')) return S_FALSE; HeapFree(GetProcessHeap(), 0, This->sPath); @@ -2230,11 +2206,11 @@ static HRESULT WINAPI IShellLinkW_fnSetPath(IShellLinkW * iface, LPCWSTR pszFile ShellLink_GetVolumeInfo(buffer, &This->volume); This->sPath = HeapAlloc( GetProcessHeap(), 0, - (lstrlenW( buffer )+1) * sizeof (WCHAR) ); + (wcslen( buffer )+1) * sizeof (WCHAR) ); if (!This->sPath) return E_OUTOFMEMORY; - lstrcpyW(This->sPath, buffer); + wcscpy(This->sPath, buffer); } This->bDirty = TRUE; HeapFree(GetProcessHeap(), 0, unquoted); @@ -2352,8 +2328,10 @@ ShellLink_GetFlags( IShellLinkDataList* iface, DWORD* pdwFlags ) flags |= SLDF_HAS_DARWINID; if (This->sIcoPath) flags |= SLDF_HAS_ICONLOCATION; +#if (NTDDI_VERSION < NTDDI_LONGHORN) if (This->sProduct) flags |= SLDF_HAS_LOGO3ID; +#endif if (This->pPidl) flags |= SLDF_HAS_ID_LIST; @@ -2506,13 +2484,13 @@ ShellLink_QueryContextMenu( IContextMenu* iface, HMENU hmenu, UINT indexMenu, mii.cbSize = sizeof (mii); mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE; mii.dwTypeData = (LPWSTR)szOpen; - mii.cch = strlenW( mii.dwTypeData ); + mii.cch = wcslen( mii.dwTypeData ); mii.wID = idCmdFirst + id++; mii.fState = MFS_DEFAULT | MFS_ENABLED; mii.fType = MFT_STRING; if (!InsertMenuItemW( hmenu, indexMenu, TRUE, &mii )) return E_FAIL; - This->iIdOpen = 0; + This->iIdOpen = 1; return MAKE_HRESULT( SEVERITY_SUCCESS, 0, id ); } @@ -2788,7 +2766,8 @@ static HRESULT WINAPI ShellLink_InvokeCommand( IContextMenu* iface, LPCMINVOKECOMMANDINFO lpici ) { IShellLinkImpl *This = impl_from_IContextMenu(iface); - static const WCHAR szOpen[] = { 'O','p','e','n',0 }; + static const WCHAR szOpen[] = { 'o','p','e','n',0 }; + static const WCHAR szCplOpen[] = { 'c','p','l','o','p','e','n',0 }; SHELLEXECUTEINFOW sei; HWND hwnd = NULL; /* FIXME: get using interface set from IObjectWithSite */ LPWSTR args = NULL; @@ -2800,16 +2779,12 @@ ShellLink_InvokeCommand( IContextMenu* iface, LPCMINVOKECOMMANDINFO lpici ) if ( lpici->cbSize < sizeof (CMINVOKECOMMANDINFO) ) return E_INVALIDARG; - if ( lpici->lpVerb != MAKEINTRESOURCEA(This->iIdOpen) ) - { - ERR("Unknown id %d != %d\n", (INT)lpici->lpVerb, This->iIdOpen ); - return E_INVALIDARG; - } - r = IShellLinkW_Resolve( (IShellLinkW*)&(This->lpvtblw), hwnd, 0 ); if ( FAILED( r ) ) + { + TRACE("failed to resolve component with error 0x%08x", r); return r; - + } if ( This->sComponent ) { path = shelllink_get_msi_component_path( This->sComponent ); @@ -2826,19 +2801,19 @@ ShellLink_InvokeCommand( IContextMenu* iface, LPCMINVOKECOMMANDINFO lpici ) DWORD len = 2; if ( This->sArgs ) - len += lstrlenW( This->sArgs ); + len += wcslen( This->sArgs ); if ( iciex->lpParametersW ) - len += lstrlenW( iciex->lpParametersW ); + len += wcslen( iciex->lpParametersW ); args = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) ); args[0] = 0; if ( This->sArgs ) - lstrcatW( args, This->sArgs ); + wcscat( args, This->sArgs ); if ( iciex->lpParametersW ) { static const WCHAR space[] = { ' ', 0 }; - lstrcatW( args, space ); - lstrcatW( args, iciex->lpParametersW ); + wcscat( args, space ); + wcscat( args, iciex->lpParametersW ); } } @@ -2847,11 +2822,16 @@ ShellLink_InvokeCommand( IContextMenu* iface, LPCMINVOKECOMMANDINFO lpici ) sei.fMask = SEE_MASK_UNICODE | (lpici->fMask & (SEE_MASK_NOASYNC|SEE_MASK_ASYNCOK|SEE_MASK_FLAG_NO_UI)); sei.lpFile = path; sei.nShow = This->iShowCmd; - sei.lpIDList = This->pPidl; sei.lpDirectory = This->sWorkDir; sei.lpParameters = args; sei.lpVerb = szOpen; + // HACK for ShellExecuteExW + if (!wcsstr(This->sPath, L".cpl")) + sei.lpVerb = szOpen; + else + sei.lpVerb = szCplOpen; + if( ShellExecuteExW( &sei ) ) r = S_OK; else diff --git a/reactos/dll/win32/shell32/shellole.c b/reactos/dll/win32/shell32/shellole.c index c4e7de7f977..13f7c30155f 100644 --- a/reactos/dll/win32/shell32/shellole.c +++ b/reactos/dll/win32/shell32/shellole.c @@ -19,31 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" - -#include -#include -#include - -#define COBJMACROS - -#include "windef.h" -#include "winbase.h" -#include "shellapi.h" -#include "wingdi.h" -#include "winuser.h" -#include "shlobj.h" -#include "shlguid.h" -#include "winreg.h" -#include "winerror.h" - -#include "undocshell.h" -#include "wine/unicode.h" -#include "shell32_main.h" - -#include "wine/debug.h" -#include "shlwapi.h" -#include "debughlp.h" +#include WINE_DEFAULT_DEBUG_CHANNEL(shell); @@ -51,6 +27,7 @@ extern HRESULT WINAPI IFSFolder_Constructor(IUnknown * pUnkOuter, REFIID riid, L static const WCHAR sShell32[12] = {'S','H','E','L','L','3','2','.','D','L','L','\0'}; static const GUID dummy1 = {0xD969A300, 0xE7FF, 0x11d0, {0xA9, 0x3B, 0x00, 0xA0, 0xC9, 0x0F, 0x27, 0x19} }; + /************************************************************************** * Default ClassFactory types */ @@ -98,7 +75,7 @@ DWORD WINAPI __SHGUIDToStringW (REFGUID guid, LPWSTR str) '2','x','%','0','2','x','%','0','2','x', '}','\0'}; - return wsprintfW ( str, sFormat, + return swprintf ( str, sFormat, guid->Data1, guid->Data2, guid->Data3, guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3], guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7] ); @@ -129,7 +106,7 @@ HRESULT WINAPI SHCoCreateInstance( LPVOID *ppv) { DWORD hres; - IID iid; + CLSID iid; const CLSID * myclsid = clsid; WCHAR sKeyName[MAX_PATH]; const WCHAR sCLSID[7] = {'C','L','S','I','D','\\','\0'}; @@ -150,7 +127,7 @@ HRESULT WINAPI SHCoCreateInstance( if (!clsid) { if (!aclsid) return REGDB_E_CLASSNOTREG; - SHCLSIDFromStringW(aclsid, &iid); + CLSIDFromString((LPOLESTR)aclsid, &iid); myclsid = &iid; } @@ -159,9 +136,9 @@ HRESULT WINAPI SHCoCreateInstance( /* we look up the dll path in the registry */ __SHGUIDToStringW(myclsid, sClassID); - lstrcpyW(sKeyName, sCLSID); - lstrcatW(sKeyName, sClassID); - lstrcatW(sKeyName, sInProcServer32); + wcscpy(sKeyName, sCLSID); + wcscat(sKeyName, sClassID); + wcscat(sKeyName, sInProcServer32); if (ERROR_SUCCESS == RegOpenKeyExW(HKEY_CLASSES_ROOT, sKeyName, 0, KEY_READ, &hKey)) { dwSize = sizeof(sDllPath); @@ -685,7 +662,7 @@ UINT WINAPI DragQueryFileW( } } - i = strlenW(lpwDrop); + i = wcslen(lpwDrop); if ( !lpszwFile) goto end; /* needed buffer size */ lstrcpynW (lpszwFile, lpwDrop, lLength); end: diff --git a/reactos/dll/win32/shell32/shellord.c b/reactos/dll/win32/shell32/shellord.c index f3811d54c46..458b8ff7c79 100644 --- a/reactos/dll/win32/shell32/shellord.c +++ b/reactos/dll/win32/shell32/shellord.c @@ -172,26 +172,26 @@ DWORD WINAPI ParseFieldAW(LPCVOID src, DWORD nField, LPVOID dst, DWORD len) */ BOOL WINAPI GetFileNameFromBrowse( HWND hwndOwner, - LPSTR lpstrFile, - DWORD nMaxFile, - LPCSTR lpstrInitialDir, - LPCSTR lpstrDefExt, - LPCSTR lpstrFilter, - LPCSTR lpstrTitle) + LPWSTR lpstrFile, + UINT nMaxFile, + LPCWSTR lpstrInitialDir, + LPCWSTR lpstrDefExt, + LPCWSTR lpstrFilter, + LPCWSTR lpstrTitle) { HMODULE hmodule; - FARPROC pGetOpenFileNameA; - OPENFILENAMEA ofn; + FARPROC pGetOpenFileNameW; + OPENFILENAMEW ofn; BOOL ret; TRACE("%p, %s, %d, %s, %s, %s, %s)\n", - hwndOwner, lpstrFile, nMaxFile, lpstrInitialDir, lpstrDefExt, + hwndOwner, debugstr_w(lpstrFile), nMaxFile, lpstrInitialDir, lpstrDefExt, lpstrFilter, lpstrTitle); - hmodule = LoadLibraryA("comdlg32.dll"); + hmodule = LoadLibraryW(L"comdlg32.dll"); if(!hmodule) return FALSE; - pGetOpenFileNameA = GetProcAddress(hmodule, "GetOpenFileNameA"); - if(!pGetOpenFileNameA) + pGetOpenFileNameW = GetProcAddress(hmodule, "GetOpenFileNameW"); + if(!pGetOpenFileNameW) { FreeLibrary(hmodule); return FALSE; @@ -208,7 +208,7 @@ BOOL WINAPI GetFileNameFromBrowse( ofn.lpstrTitle = lpstrTitle; ofn.lpstrDefExt = lpstrDefExt; ofn.Flags = OFN_EXPLORER | OFN_HIDEREADONLY | OFN_FILEMUSTEXIST; - ret = pGetOpenFileNameA(&ofn); + ret = pGetOpenFileNameW(&ofn); FreeLibrary(hmodule); return ret; @@ -532,9 +532,9 @@ WORD WINAPI ArrangeWindows( * exported by ordinal */ DWORD WINAPI -SignalFileOpen (DWORD dwParam1) +SignalFileOpen (LPCITEMIDLIST pidl) { - FIXME("(0x%08x):stub.\n", dwParam1); + FIXME("(0x%08x):stub.\n", pidl); return 0; } @@ -1048,8 +1048,9 @@ HRESULT WINAPI SHWinHelp (DWORD v, DWORD w, DWORD x, DWORD z) * SHRunControlPanel [SHELL32.161] * */ -HRESULT WINAPI SHRunControlPanel (DWORD x, DWORD z) -{ FIXME("0x%08x 0x%08x stub\n",x,z); +HRESULT WINAPI SHRunControlPanel (LPCWSTR lpcszCmdLine, HWND hwndMsgParent) +{ + FIXME("0x%08x 0x%08x stub\n",lpcszCmdLine,hwndMsgParent); return 0; } @@ -1103,7 +1104,7 @@ void WINAPI SHFreeUnusedLibraries (void) * DAD_AutoScroll [SHELL32.129] * */ -BOOL WINAPI DAD_AutoScroll(HWND hwnd, AUTO_SCROLL_DATA *samples, LPPOINT pt) +BOOL WINAPI DAD_AutoScroll(HWND hwnd, AUTO_SCROLL_DATA *samples, const POINT * pt) { FIXME("hwnd = %p %p %p\n",hwnd,samples,pt); return 0; @@ -1121,7 +1122,7 @@ BOOL WINAPI DAD_DragEnter(HWND hwnd) * DAD_DragEnterEx [SHELL32.131] * */ -BOOL WINAPI DAD_DragEnterEx(HWND hwnd, POINT p) +BOOL WINAPI DAD_DragEnterEx(HWND hwnd, const POINT p) { FIXME("hwnd = %p (%d,%d)\n",hwnd,p.x,p.y); return FALSE; @@ -1411,9 +1412,11 @@ HRESULT WINAPI SHLoadOLE(LPARAM lParam) * DriveType [SHELL32.64] * */ -HRESULT WINAPI DriveType(DWORD u) -{ FIXME("0x%04x stub\n",u); - return 0; +HRESULT WINAPI DriveType(int DriveType) +{ + WCHAR root[] = L"A:\\"; + root[0] = L'A' + DriveType; + return GetDriveTypeW(root); } /************************************************************************* * InvalidateDriveType [SHELL32.65] @@ -1494,9 +1497,9 @@ DWORD WINAPI RLBuildListOfPaths (void) * SHValidateUNC [SHELL32.173] * */ -HRESULT WINAPI SHValidateUNC (DWORD x, DWORD y, DWORD z) +HRESULT WINAPI SHValidateUNC (HWND hwndOwner, LPWSTR pszFile, UINT fConnect) { - FIXME("0x%08x 0x%08x 0x%08x stub\n",x,y,z); + FIXME("0x%08x 0x%08x 0x%08x stub\n",hwndOwner,pszFile,fConnect); return 0; } @@ -1662,6 +1665,7 @@ HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey, UINT max_ IShellPropSheetExt *pspsx; HKEY hkBase, hkPropSheetHandlers; PPSXA psxa = NULL; + HRESULT hr; TRACE("(%p,%s,%u)\n", hKey, debugstr_w(pszSubKey), max_iface); @@ -1699,38 +1703,41 @@ HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey, UINT max_ lRet = ERROR_SUCCESS; break; } - - dwClsidSize = sizeof(szClsidHandler); - if (SHGetValueW(hkPropSheetHandlers, szHandler, NULL, NULL, szClsidHandler, &dwClsidSize) == ERROR_SUCCESS) + szHandler[(sizeof(szHandler) / sizeof(szHandler[0])) - 1] = 0; + hr = CLSIDFromString(szHandler, &clsid); + if (FAILED(hr)) { - /* Force a NULL-termination and convert the string */ - szClsidHandler[(sizeof(szClsidHandler) / sizeof(szClsidHandler[0])) - 1] = 0; - if (SUCCEEDED(SHCLSIDFromStringW(szClsidHandler, &clsid))) + dwClsidSize = sizeof(szClsidHandler); + if (SHGetValueW(hkPropSheetHandlers, szHandler, NULL, NULL, szClsidHandler, &dwClsidSize) == ERROR_SUCCESS) { - /* Attempt to get an IShellPropSheetExt and an IShellExtInit instance. - Only if both interfaces are supported it's a real shell extension. - Then call IShellExtInit's Initialize method. */ - if (SUCCEEDED(CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER/* | CLSCTX_NO_CODE_DOWNLOAD */, &IID_IShellPropSheetExt, (LPVOID *)&pspsx))) - { - if (SUCCEEDED(pspsx->lpVtbl->QueryInterface(pspsx, &IID_IShellExtInit, (PVOID *)&psxi))) - { - if (SUCCEEDED(psxi->lpVtbl->Initialize(psxi, NULL, pDataObj, hKey))) - { - /* Add the IShellPropSheetExt instance to the array */ - psxa->pspsx[psxa->uiCount++] = pspsx; - } - else - { - psxi->lpVtbl->Release(psxi); - pspsx->lpVtbl->Release(pspsx); - } - } - else - pspsx->lpVtbl->Release(pspsx); - } + szClsidHandler[(sizeof(szClsidHandler) / sizeof(szClsidHandler[0])) - 1] = 0; + hr = CLSIDFromString(szClsidHandler, &clsid); + } + } + if (SUCCEEDED(hr)) + { + /* Attempt to get an IShellPropSheetExt and an IShellExtInit instance. + Only if both interfaces are supported it's a real shell extension. + Then call IShellExtInit's Initialize method. */ + if (SUCCEEDED(CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER/* | CLSCTX_NO_CODE_DOWNLOAD */, &IID_IShellPropSheetExt, (LPVOID *)&pspsx))) + { + if (SUCCEEDED(pspsx->lpVtbl->QueryInterface(pspsx, &IID_IShellExtInit, (PVOID *)&psxi))) + { + if (SUCCEEDED(psxi->lpVtbl->Initialize(psxi, NULL, pDataObj, hKey))) + { + /* Add the IShellPropSheetExt instance to the array */ + psxa->pspsx[psxa->uiCount++] = pspsx; + } + else + { + psxi->lpVtbl->Release(psxi); + pspsx->lpVtbl->Release(pspsx); + } + } + else + pspsx->lpVtbl->Release(pspsx); } } - } while (psxa->uiCount != psxa->uiAllocated); } else @@ -1842,7 +1849,7 @@ HRESULT WINAPI CIDLData_CreateFromIDArray( * */ HRESULT WINAPI SHCreateStdEnumFmtEtc( - DWORD cFormats, + UINT cFormats, const FORMATETC *lpFormats, LPENUMFORMATETC *ppenumFormatetc) { @@ -2099,7 +2106,7 @@ HRESULT WINAPI SHQueryRecycleBinW(LPCWSTR pszRootPath, LPSHQUERYRBINFO pSHQueryR /************************************************************************* * SHSetLocalizedName (SHELL32.@) */ -HRESULT WINAPI SHSetLocalizedName(LPWSTR pszPath, LPCWSTR pszResModule, int idsRes) +HRESULT WINAPI SHSetLocalizedName(LPCWSTR pszPath, LPCWSTR pszResModule, int idsRes) { FIXME("%p, %s, %d - stub\n", pszPath, debugstr_w(pszResModule), idsRes); @@ -2124,3 +2131,29 @@ BOOL WINAPI LinkWindow_UnregisterClass(void) return TRUE; } +/************************************************************************* + * SHParseDisplayName [shell version 6.0] + */ +HRESULT WINAPI SHParseDisplayName(LPCWSTR pszName, IBindCtx *pbc, +LPITEMIDLIST *ppidl, SFGAOF sfgaoIn, SFGAOF *psfgaoOut) +{ + IShellFolder * psfDesktop; + HRESULT hr=E_FAIL; + ULONG dwAttr=sfgaoIn; + + if (!pszName || !ppidl || !psfgaoOut) + return E_INVALIDARG; + + hr = SHGetDesktopFolder(&psfDesktop); + if (FAILED(hr)) + return hr; + + hr = IShellFolder_ParseDisplayName(psfDesktop, (HWND)NULL, pbc, (LPOLESTR)pszName, (ULONG *)NULL, ppidl, &dwAttr); + + IShellFolder_Release(psfDesktop); + + if (SUCCEEDED(hr)) + *psfgaoOut = dwAttr; + + return hr; +} diff --git a/reactos/dll/win32/shell32/shellpath.c b/reactos/dll/win32/shell32/shellpath.c index b804ca0c2e7..56ae632aebd 100644 --- a/reactos/dll/win32/shell32/shellpath.c +++ b/reactos/dll/win32/shell32/shellpath.c @@ -24,29 +24,7 @@ * */ -#define symlink(A, B) -#include "config.h" -#include "wine/port.h" - -#include -#include -#include -#include -#include "wine/debug.h" -#include "windef.h" -#include "winbase.h" -#include "winnls.h" -#include "winreg.h" -#include "wingdi.h" -#include "winuser.h" - -#include "shlobj.h" -#include "shresdef.h" -#include "shell32_main.h" -#include "undocshell.h" -#include "pidl.h" -#include "wine/unicode.h" -#include "shlwapi.h" +#include WINE_DEFAULT_DEBUG_CHANNEL(shell); @@ -264,7 +242,7 @@ static void PathGetShortPathW(LPWSTR pszPath) if (GetShortPathNameW(pszPath, path, MAX_PATH)) { - lstrcpyW(pszPath, path); + wcscpy(pszPath, path); } } @@ -576,7 +554,7 @@ int WINAPI PathCleanupSpec( LPCWSTR lpszPathW, LPWSTR lpszFileW ) TRACE("Cleanup %s\n",debugstr_w(lpszFileW)); if (lpszPathW) - length = strlenW(lpszPathW); + length = wcslen(lpszPathW); while (*p) { @@ -727,8 +705,8 @@ LONG WINAPI PathProcessCommandW ( FIXME("(%s, %p, 0x%04x, 0x%04x) stub\n", debugstr_w(lpszPath), lpszBuff, dwBuffSize, dwFlags); if(!lpszPath) return -1; - if(lpszBuff) strcpyW(lpszBuff, lpszPath); - return strlenW(lpszPath); + if(lpszBuff) wcscpy(lpszBuff, lpszPath); + return wcslen(lpszPath); } /************************************************************************* @@ -1173,13 +1151,13 @@ static HRESULT _SHGetUserShellFolderPath(HKEY rootKey, LPCWSTR userPrefix, if (userPrefix) { - strcpyW(shellFolderPath, userPrefix); + wcscpy(shellFolderPath, userPrefix); PathAddBackslashW(shellFolderPath); - strcatW(shellFolderPath, szSHFolders); + wcscat(shellFolderPath, szSHFolders); pShellFolderPath = shellFolderPath; - strcpyW(userShellFolderPath, userPrefix); + wcscpy(userShellFolderPath, userPrefix); PathAddBackslashW(userShellFolderPath); - strcatW(userShellFolderPath, szSHUserFolders); + wcscat(userShellFolderPath, szSHUserFolders); pUserShellFolderPath = userShellFolderPath; } else @@ -1217,7 +1195,7 @@ static HRESULT _SHGetUserShellFolderPath(HKEY rootKey, LPCWSTR userPrefix, lstrcpynW(path, szTemp, MAX_PATH); } ret = RegSetValueExW(shellFolderKey, value, 0, REG_SZ, (LPBYTE)path, - (strlenW(path) + 1) * sizeof(WCHAR)); + (wcslen(path) + 1) * sizeof(WCHAR)); if (ret != ERROR_SUCCESS) hr = HRESULT_FROM_WIN32(ret); else @@ -1284,13 +1262,13 @@ static HRESULT _SHGetDefaultValue(BYTE folder, LPWSTR pszPath) switch (CSIDL_Data[folder].type) { case CSIDL_Type_User: - strcpyW(pszPath, UserProfileW); + wcscpy(pszPath, UserProfileW); break; case CSIDL_Type_AllUsers: - strcpyW(pszPath, AllUsersProfileW); + wcscpy(pszPath, AllUsersProfileW); break; case CSIDL_Type_CurrVer: - strcpyW(pszPath, SystemDriveW); + wcscpy(pszPath, SystemDriveW); break; default: ; /* no corresponding env. var, do nothing */ @@ -1298,7 +1276,7 @@ static HRESULT _SHGetDefaultValue(BYTE folder, LPWSTR pszPath) if (pDefaultPath) { PathAddBackslashW(pszPath); - strcatW(pszPath, pDefaultPath); + wcscat(pszPath, pDefaultPath); } } TRACE("returning 0x%08x\n", hr); @@ -1346,7 +1324,7 @@ static HRESULT _SHGetCurrentVersionPath(DWORD dwFlags, BYTE folder, hr = _SHGetDefaultValue(folder, pszPath); dwType = REG_EXPAND_SZ; RegSetValueExW(hKey, CSIDL_Data[folder].szValueName, 0, dwType, - (LPBYTE)pszPath, (strlenW(pszPath)+1)*sizeof(WCHAR)); + (LPBYTE)pszPath, (wcslen(pszPath)+1)*sizeof(WCHAR)); } else { @@ -1495,7 +1473,7 @@ static HRESULT _SHGetProfilesValue(HKEY profilesKey, LPCWSTR szValueName, debugstr_w(szValue)); lRet = RegSetValueExW(profilesKey, szValueName, 0, REG_EXPAND_SZ, (LPBYTE)szValue, - (strlenW(szValue) + 1) * sizeof(WCHAR)); + (wcslen(szValue) + 1) * sizeof(WCHAR)); if (lRet) hr = HRESULT_FROM_WIN32(lRet); else @@ -1530,7 +1508,7 @@ static HRESULT _SHExpandEnvironmentStrings(LPCWSTR szSrc, LPWSTR szDest) /* short-circuit if there's nothing to expand */ if (szSrc[0] != '%') { - strcpyW(szDest, szSrc); + wcscpy(szDest, szSrc); hr = S_OK; goto end; } @@ -1548,30 +1526,30 @@ static HRESULT _SHExpandEnvironmentStrings(LPCWSTR szSrc, LPWSTR szDest) } *szDest = 0; - strcpyW(szTemp, szSrc); + wcscpy(szTemp, szSrc); while (SUCCEEDED(hr) && szTemp[0] == '%') { - if (!strncmpiW(szTemp, AllUsersProfileW, strlenW(AllUsersProfileW))) + if (!strncmpiW(szTemp, AllUsersProfileW, wcslen(AllUsersProfileW))) { WCHAR szAllUsers[MAX_PATH]; - strcpyW(szDest, szProfilesPrefix); + wcscpy(szDest, szProfilesPrefix); hr = _SHGetProfilesValue(key, AllUsersProfileValueW, szAllUsers, AllUsersW); PathAppendW(szDest, szAllUsers); - PathAppendW(szDest, szTemp + strlenW(AllUsersProfileW)); + PathAppendW(szDest, szTemp + wcslen(AllUsersProfileW)); } - else if (!strncmpiW(szTemp, UserProfileW, strlenW(UserProfileW))) + else if (!strncmpiW(szTemp, UserProfileW, wcslen(UserProfileW))) { WCHAR userName[MAX_PATH]; DWORD userLen = MAX_PATH; - strcpyW(szDest, szProfilesPrefix); + wcscpy(szDest, szProfilesPrefix); GetUserNameW(userName, &userLen); PathAppendW(szDest, userName); - PathAppendW(szDest, szTemp + strlenW(UserProfileW)); + PathAppendW(szDest, szTemp + wcslen(UserProfileW)); } - else if (!strncmpiW(szTemp, SystemDriveW, strlenW(SystemDriveW))) + else if (!strncmpiW(szTemp, SystemDriveW, wcslen(SystemDriveW))) { GetSystemDirectoryW(szDest, MAX_PATH); if (szDest[1] != ':') @@ -1581,7 +1559,7 @@ static HRESULT _SHExpandEnvironmentStrings(LPCWSTR szSrc, LPWSTR szDest) } else { - strcpyW(szDest + 3, szTemp + strlenW(SystemDriveW) + 1); + wcscpy(szDest + 3, szTemp + wcslen(SystemDriveW) + 1); hr = S_OK; } } @@ -1597,7 +1575,7 @@ static HRESULT _SHExpandEnvironmentStrings(LPCWSTR szSrc, LPWSTR szDest) hr = S_OK; } if (SUCCEEDED(hr) && szDest[0] == '%') - strcpyW(szTemp, szDest); + wcscpy(szTemp, szDest); else { /* terminate loop */ @@ -1703,7 +1681,7 @@ HRESULT WINAPI SHGetFolderPathAndSubDirW( { HRESULT hr; WCHAR szBuildPath[MAX_PATH], szTemp[MAX_PATH]; - DWORD folder = nFolder & CSIDL_FOLDER_MASK; + DWORD folder = nFolder & CSIDL_FOLDER_MASK; //FIXME CSIDL_Type type; int ret; @@ -1736,7 +1714,7 @@ HRESULT WINAPI SHGetFolderPathAndSubDirW( *CSIDL_Data[folder].szDefaultPath) { PathAddBackslashW(szTemp); - strcatW(szTemp, CSIDL_Data[folder].szDefaultPath); + wcscat(szTemp, CSIDL_Data[folder].szDefaultPath); } hr = S_OK; break; @@ -1747,7 +1725,7 @@ HRESULT WINAPI SHGetFolderPathAndSubDirW( *CSIDL_Data[folder].szDefaultPath) { PathAddBackslashW(szTemp); - strcatW(szTemp, CSIDL_Data[folder].szDefaultPath); + wcscat(szTemp, CSIDL_Data[folder].szDefaultPath); } hr = S_OK; break; @@ -1770,14 +1748,14 @@ HRESULT WINAPI SHGetFolderPathAndSubDirW( if (*szTemp == '%') hr = _SHExpandEnvironmentStrings(szTemp, szBuildPath); else - strcpyW(szBuildPath, szTemp); + wcscpy(szBuildPath, szTemp); if (FAILED(hr)) goto end; if(pszSubPath) { /* make sure the new path does not exceed th bufferlength * rememebr to backslash and the termination */ - if(MAX_PATH < (lstrlenW(szBuildPath) + lstrlenW(pszSubPath) + 2)) { + if(MAX_PATH < (wcslen(szBuildPath) + wcslen(pszSubPath) + 2)) { hr = HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE); goto end; } @@ -1786,7 +1764,7 @@ HRESULT WINAPI SHGetFolderPathAndSubDirW( } /* Copy the path if it's available before we might return */ if (SUCCEEDED(hr) && pszPath) - strcpyW(pszPath, szBuildPath); + wcscpy(pszPath, szBuildPath); /* if we don't care about existing directories we are ready */ if(nFolder & CSIDL_FLAG_DONT_VERIFY) goto end; @@ -1898,7 +1876,7 @@ static HRESULT _SHRegisterFolders(HKEY hRootKey, HANDLE hToken, { ret = RegSetValueExW(hUserKey, CSIDL_Data[folders[i]].szValueName, 0, REG_EXPAND_SZ, - (LPBYTE)path, (strlenW(path) + 1) * sizeof(WCHAR)); + (LPBYTE)path, (wcslen(path) + 1) * sizeof(WCHAR)); if (ret) hr = HRESULT_FROM_WIN32(ret); else @@ -1907,7 +1885,7 @@ static HRESULT _SHRegisterFolders(HKEY hRootKey, HANDLE hToken, hToken, SHGFP_TYPE_DEFAULT, path); ret = RegSetValueExW(hKey, CSIDL_Data[folders[i]].szValueName, 0, REG_SZ, - (LPBYTE)path, (strlenW(path) + 1) * sizeof(WCHAR)); + (LPBYTE)path, (wcslen(path) + 1) * sizeof(WCHAR)); if (ret) hr = HRESULT_FROM_WIN32(ret); } @@ -1958,13 +1936,13 @@ static HRESULT _SHRegisterUserShellFolders(BOOL bDefault) { hToken = (HANDLE)-1; hRootKey = HKEY_USERS; - strcpyW(userShellFolderPath, DefaultW); + wcscpy(userShellFolderPath, DefaultW); PathAddBackslashW(userShellFolderPath); - strcatW(userShellFolderPath, szSHUserFolders); + wcscat(userShellFolderPath, szSHUserFolders); pUserShellFolderPath = userShellFolderPath; - strcpyW(shellFolderPath, DefaultW); + wcscpy(shellFolderPath, DefaultW); PathAddBackslashW(shellFolderPath); - strcatW(shellFolderPath, szSHFolders); + wcscat(shellFolderPath, szSHFolders); pShellFolderPath = shellFolderPath; } else @@ -2017,7 +1995,7 @@ static HRESULT _SHRegisterCommonShellFolders(void) * Success: TRUE, * Failure: FALSE */ -static inline BOOL _SHAppendToUnixPath(char *szBasePath, LPCWSTR pwszSubPath) { +static BOOL __inline _SHAppendToUnixPath(char *szBasePath, LPCWSTR pwszSubPath) { WCHAR wszSubPath[MAX_PATH]; int cLen = strlen(szBasePath); char *pBackslash; @@ -2027,16 +2005,16 @@ static inline BOOL _SHAppendToUnixPath(char *szBasePath, LPCWSTR pwszSubPath) { /* Fall back to hard coded defaults. */ switch (LOWORD(pwszSubPath)) { case IDS_PERSONAL: - lstrcpyW(wszSubPath, PersonalW); + wcscpy(wszSubPath, PersonalW); break; case IDS_MYMUSIC: - lstrcpyW(wszSubPath, My_MusicW); + wcscpy(wszSubPath, My_MusicW); break; case IDS_MYPICTURES: - lstrcpyW(wszSubPath, My_PicturesW); + wcscpy(wszSubPath, My_PicturesW); break; case IDS_MYVIDEO: - lstrcpyW(wszSubPath, My_VideoW); + wcscpy(wszSubPath, My_VideoW); break; default: ERR("LoadString(%d) failed!\n", LOWORD(pwszSubPath)); @@ -2044,7 +2022,7 @@ static inline BOOL _SHAppendToUnixPath(char *szBasePath, LPCWSTR pwszSubPath) { } } } else { - lstrcpyW(wszSubPath, pwszSubPath); + wcscpy(wszSubPath, pwszSubPath); } if (szBasePath[cLen-1] != '/') szBasePath[cLen++] = '/'; diff --git a/reactos/dll/win32/shell32/shellreg.c b/reactos/dll/win32/shell32/shellreg.c index 9ed8f9a6c07..812566cd7fd 100644 --- a/reactos/dll/win32/shell32/shellreg.c +++ b/reactos/dll/win32/shell32/shellreg.c @@ -18,24 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" - -#include -#include -#include - -#include "windef.h" -#include "winbase.h" -#include "shellapi.h" -#include "wingdi.h" -#include "winuser.h" -#include "shlobj.h" -#include "winreg.h" - -#include "undocshell.h" -#include "wine/winbase16.h" - -#include "wine/debug.h" +#include WINE_DEFAULT_DEBUG_CHANNEL(shell); diff --git a/reactos/dll/win32/shell32/shellstring.c b/reactos/dll/win32/shell32/shellstring.c index 5eba435fc78..153807ac250 100644 --- a/reactos/dll/win32/shell32/shellstring.c +++ b/reactos/dll/win32/shell32/shellstring.c @@ -16,27 +16,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -#include -#include -#include -#include - -#define NONAMELESSUNION -#define NONAMELESSSTRUCT -#include "windef.h" -#include "winbase.h" -#include "winnls.h" -#include "wingdi.h" -#include "winuser.h" -#include "winreg.h" - -#include "shlobj.h" -#include "shlwapi.h" -#include "shell32_main.h" -#include "undocshell.h" -#include "wine/unicode.h" -#include "wine/debug.h" +#include WINE_DEFAULT_DEBUG_CHANNEL(shell); @@ -153,8 +133,8 @@ int WINAPI StrToOleStrW (LPWSTR lpWideCharStr, LPCWSTR lpWString) TRACE("(%p, %p %s)\n", lpWideCharStr, lpWString, debugstr_w(lpWString)); - strcpyW (lpWideCharStr, lpWString ); - return strlenW(lpWideCharStr); + wcscpy (lpWideCharStr, lpWString ); + return wcslen(lpWideCharStr); } BOOL WINAPI StrToOleStrAW (LPWSTR lpWideCharStr, LPCVOID lpString) @@ -179,7 +159,7 @@ BOOL WINAPI StrToOleStrNW (LPWSTR lpWide, INT nWide, LPCWSTR lpStrW, INT nStr) TRACE("(%p, %x, %s, %x)\n", lpWide, nWide, debugstr_wn(lpStrW, nStr), nStr); if (lstrcpynW (lpWide, lpStrW, nWide)) - { return lstrlenW (lpWide); + { return wcslen (lpWide); } return 0; } @@ -205,7 +185,7 @@ BOOL WINAPI OleStrToStrNW (LPWSTR lpwStr, INT nwStr, LPCWSTR lpOle, INT nOle) TRACE("(%p, %x, %s, %x)\n", lpwStr, nwStr, debugstr_wn(lpOle,nOle), nOle); if (lstrcpynW ( lpwStr, lpOle, nwStr)) - { return lstrlenW (lpwStr); + { return wcslen (lpwStr); } return 0; } @@ -264,7 +244,7 @@ DWORD WINAPI CheckEscapesW( LPWSTR string, DWORD len) { - DWORD size = lstrlenW(string); + DWORD size = wcslen(string); LPWSTR s, d; TRACE("(%s %d) stub\n", debugstr_w(string), len); diff --git a/reactos/dll/win32/shell32/shfldr.h b/reactos/dll/win32/shell32/shfldr.h index 49502545ba6..04c02a78433 100644 --- a/reactos/dll/win32/shell32/shfldr.h +++ b/reactos/dll/win32/shell32/shfldr.h @@ -48,7 +48,7 @@ HRESULT SHELL32_BindToChild (LPCITEMIDLIST pidlRoot, HRESULT SHELL32_CompareIDs (IShellFolder * iface, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2); LPITEMIDLIST SHELL32_CreatePidlFromBindCtx(IBindCtx *pbc, LPCWSTR path); -static inline int SHELL32_GUIDToStringA (REFGUID guid, LPSTR str) +static int __inline SHELL32_GUIDToStringA (REFGUID guid, LPSTR str) { return sprintf(str, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", guid->Data1, guid->Data2, guid->Data3, @@ -56,14 +56,14 @@ static inline int SHELL32_GUIDToStringA (REFGUID guid, LPSTR str) guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]); } -static inline int SHELL32_GUIDToStringW (REFGUID guid, LPWSTR str) +static int __inline SHELL32_GUIDToStringW (REFGUID guid, LPWSTR str) { static const WCHAR fmtW[] = { '{','%','0','8','l','x','-','%','0','4','x','-','%','0','4','x','-', '%','0','2','x','%','0','2','x','-', '%','0','2','x','%','0','2','x','%','0','2','x','%','0','2','x', '%','0','2','x','%','0','2','x','}',0 }; - return sprintfW(str, fmtW, + return swprintf(str, fmtW, guid->Data1, guid->Data2, guid->Data3, guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3], guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]); @@ -71,6 +71,3 @@ static inline int SHELL32_GUIDToStringW (REFGUID guid, LPWSTR str) void SHELL_FS_ProcessDisplayFilename(LPWSTR szPath, DWORD dwFlags); BOOL SHELL_FS_HideExtension(LPWSTR pwszPath); - -DEFINE_GUID( CLSID_UnixFolder, 0xcc702eb2, 0x7dc5, 0x11d9, 0xc6, 0x87, 0x00, 0x04, 0x23, 0x8a, 0x01, 0xcd ); -DEFINE_GUID( CLSID_UnixDosFolder, 0x9d20aae8, 0x0625, 0x44b0, 0x9c, 0xa7, 0x71, 0x88, 0x9c, 0x22, 0x54, 0xd9 ); diff --git a/reactos/dll/win32/shell32/shfldr_admintools.c b/reactos/dll/win32/shell32/shfldr_admintools.c index bc67dd2b020..8ceb80b5cf1 100644 --- a/reactos/dll/win32/shell32/shfldr_admintools.c +++ b/reactos/dll/win32/shell32/shfldr_admintools.c @@ -18,43 +18,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "config.h" -#include "wine/port.h" - -#include -#include -#include -#include - -#define COBJMACROS -#define NONAMELESSUNION -#define NONAMELESSSTRUCT - -#include "winerror.h" -#include "windef.h" -#include "winbase.h" -#include "winreg.h" -#include "wingdi.h" -#include "winuser.h" -#include "winspool.h" - -#include "ole2.h" -#include "shlguid.h" - -#include "enumidlist.h" -#include "pidl.h" -#include "undocshell.h" -#include "shell32_main.h" -#include "shresdef.h" -#include "shlwapi.h" -#include "shellfolder.h" -#include "wine/debug.h" -#include "debughlp.h" -#include "shfldr.h" -#include "shresdef.h" +#include WINE_DEFAULT_DEBUG_CHANNEL (shell); + /* List shortcuts of * CSIDL_COMMON_ADMINTOOLS * Note: CSIDL_ADMINTOOLS is ignored, tested with Window XP SP3+ @@ -163,7 +131,8 @@ static ULONG WINAPI ISF_AdminTools_fnRelease (IShellFolder2 * iface) TRACE ("-- destroying IShellFolder(%p)\n", This); if (This->pidlRoot) SHFree (This->pidlRoot); - LocalFree ((HLOCAL) This); + HeapFree(GetProcessHeap(), 0, This->szTarget); + HeapFree(GetProcessHeap(), 0, This); return 0; } return refCount; @@ -187,6 +156,8 @@ static HRESULT WINAPI ISF_AdminTools_fnParseDisplayName (IShellFolder2 * iface, if (pchEaten) *pchEaten = 0; + MessageBoxW(NULL, lpszDisplayName, L"ParseDisplayName", MB_OK); + return E_NOTIMPL; } @@ -433,7 +404,8 @@ static HRESULT WINAPI ISF_AdminTools_fnGetDisplayNameOf (IShellFolder2 * iface, { IGenericSFImpl *This = (IGenericSFImpl *)iface; HRESULT hr = S_OK; - LPWSTR pszPath; + LPWSTR pszPath, pOffset; + TRACE ("(%p)->(pidl=%p,0x%08x,%p)\n", This, pidl, dwFlags, strRet); pdump (pidl); @@ -451,13 +423,25 @@ static HRESULT WINAPI ISF_AdminTools_fnGetDisplayNameOf (IShellFolder2 * iface, { if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) && (GET_SHGDN_FOR (dwFlags) & SHGDN_FORPARSING)) - strcpyW(pszPath, This->szTarget); + wcscpy(pszPath, This->szTarget); else HCR_GetClassNameW(&CLSID_AdminFolderShortcut, pszPath, MAX_PATH); } else if (_ILIsPidlSimple(pidl)) { - _ILSimpleGetTextW(pidl, pszPath, MAX_PATH); + if ((GET_SHGDN_FOR(dwFlags) & SHGDN_FORPARSING) && + (GET_SHGDN_RELATION(dwFlags) != SHGDN_INFOLDER) && + This->szTarget) + { + wcscpy(pszPath, This->szTarget); + pOffset = PathAddBackslashW(pszPath); + if (pOffset) + _ILSimpleGetTextW(pidl, pOffset, MAX_PATH + 1 - (pOffset - pszPath)); + } + else + { + _ILSimpleGetTextW(pidl, pszPath, MAX_PATH + 1); + } } else if (_ILIsSpecialFolder(pidl)) { @@ -467,18 +451,14 @@ static HRESULT WINAPI ISF_AdminTools_fnGetDisplayNameOf (IShellFolder2 * iface, { _ILSimpleGetTextW(pidl, pszPath, MAX_PATH); } - else - { - FIXME("special pidl\n"); - } if ((dwFlags & SHGDN_FORPARSING) && !bSimplePidl) { int len = 0; - strcpyW(pszPath, This->szTarget); + wcscpy(pszPath, This->szTarget); PathAddBackslashW(pszPath); - len = lstrlenW(pszPath); + len = wcslen(pszPath); if (!SUCCEEDED(SHELL32_GetDisplayNameOfChild(iface, pidl, dwFlags | SHGDN_INFOLDER, pszPath + len, MAX_PATH + 1 - len))) { @@ -709,8 +689,11 @@ static HRESULT WINAPI IPF_AdminTools_Initialize ( IPersistFolder2 * iface, LPCITEMIDLIST pidl) { _ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface); - FIXME ("(%p)->(%p): stub\n", This, pidl); - return E_NOTIMPL; + if (This->pidlRoot) + SHFree((LPVOID)This->pidlRoot); + + This->pidlRoot = ILClone(pidl); + return S_OK; } /************************************************************************** @@ -765,6 +748,7 @@ HRESULT WINAPI ISF_AdminTools_Constructor ( { HeapFree(GetProcessHeap(), 0, sf->szTarget); HeapFree(GetProcessHeap(), 0, sf); + return E_FAIL; } sf->ref = 1; diff --git a/reactos/dll/win32/shell32/shfldr_cpanel.c b/reactos/dll/win32/shell32/shfldr_cpanel.c new file mode 100644 index 00000000000..d96ba91746b --- /dev/null +++ b/reactos/dll/win32/shell32/shfldr_cpanel.c @@ -0,0 +1,1373 @@ +/* + * Control panel folder + * + * Copyright 2003 Martin Fuchs + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + + +#include + + +WINE_DEFAULT_DEBUG_CHANNEL(shell); + +/*********************************************************************** +* control panel implementation in shell namespace +*/ + +typedef struct { + const IShellFolder2Vtbl *lpVtbl; + LONG ref; + const IPersistFolder2Vtbl *lpVtblPersistFolder2; + const IShellExecuteHookWVtbl *lpVtblShellExecuteHookW; + const IShellExecuteHookAVtbl *lpVtblShellExecuteHookA; + const IContextMenu2Vtbl *lpVtblContextMenu; + IUnknown *pUnkOuter; /* used for aggregation */ + + /* both paths are parsible from the desktop */ + LPITEMIDLIST pidlRoot; /* absolute pidl */ + int dwAttributes; /* attributes returned by GetAttributesOf FIXME: use it */ + LPCITEMIDLIST *apidl; + UINT cidl; +} ICPanelImpl, *LPICPanelImpl; + +static const IShellFolder2Vtbl vt_ShellFolder2; +static const IPersistFolder2Vtbl vt_PersistFolder2; +static const IShellExecuteHookWVtbl vt_ShellExecuteHookW; +static const IShellExecuteHookAVtbl vt_ShellExecuteHookA; +static const IContextMenu2Vtbl vt_ContextMenu; + +static LPICPanelImpl __inline impl_from_IPersistFolder2( IPersistFolder2 *iface ) +{ + return (LPICPanelImpl)((char*)iface - FIELD_OFFSET(ICPanelImpl, lpVtblPersistFolder2)); +} + +static LPICPanelImpl __inline impl_from_IContextMenu( IContextMenu2 *iface ) +{ + return (LPICPanelImpl)((char*)iface - FIELD_OFFSET(ICPanelImpl, lpVtblContextMenu)); +} + + +static LPICPanelImpl __inline impl_from_IShellExecuteHookW( IShellExecuteHookW *iface ) +{ + return (LPICPanelImpl)((char*)iface - FIELD_OFFSET(ICPanelImpl, lpVtblShellExecuteHookW)); +} + +static LPICPanelImpl __inline impl_from_IShellExecuteHookA( IShellExecuteHookA *iface ) +{ + return (LPICPanelImpl)((char*)iface - FIELD_OFFSET(ICPanelImpl, lpVtblShellExecuteHookA)); +} + + +/* + converts This to an interface pointer +*/ +#define _IUnknown_(This) (IUnknown*)&(This->lpVtbl) +#define _IShellFolder_(This) (IShellFolder*)&(This->lpVtbl) +#define _IShellFolder2_(This) (IShellFolder2*)&(This->lpVtbl) + +#define _IPersist_(This) (IPersist*)&(This->lpVtblPersistFolder2) +#define _IPersistFolder_(This) (IPersistFolder*)&(This->lpVtblPersistFolder2) +#define _IPersistFolder2_(This) (IPersistFolder2*)&(This->lpVtblPersistFolder2) +#define _IShellExecuteHookW_(This) (IShellExecuteHookW*)&(This->lpVtblShellExecuteHookW) +#define _IShellExecuteHookA_(This) (IShellExecuteHookA*)&(This->lpVtblShellExecuteHookA) + + +/*********************************************************************** +* IShellFolder [ControlPanel] implementation +*/ + +static const shvheader ControlPanelSFHeader[] = { + {IDS_SHV_COLUMN8, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 15},/*FIXME*/ + {IDS_SHV_COLUMN9, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 200},/*FIXME*/ +}; + +#define CONROLPANELSHELLVIEWCOLUMNS 2 + +/************************************************************************** +* IControlPanel_Constructor +*/ +HRESULT WINAPI IControlPanel_Constructor(IUnknown* pUnkOuter, REFIID riid, LPVOID * ppv) +{ + ICPanelImpl *sf; + + TRACE("unkOut=%p %s\n", pUnkOuter, shdebugstr_guid(riid)); + + if (!ppv) + return E_POINTER; + if (pUnkOuter && !IsEqualIID (riid, &IID_IUnknown)) + return CLASS_E_NOAGGREGATION; + + sf = (ICPanelImpl *) LocalAlloc(LMEM_ZEROINIT, sizeof(ICPanelImpl)); + if (!sf) + return E_OUTOFMEMORY; + + sf->ref = 0; + sf->apidl = NULL; + sf->cidl = 0; + sf->lpVtbl = &vt_ShellFolder2; + sf->lpVtblPersistFolder2 = &vt_PersistFolder2; + sf->lpVtblShellExecuteHookW = &vt_ShellExecuteHookW; + sf->lpVtblShellExecuteHookA = &vt_ShellExecuteHookA; + sf->lpVtblContextMenu = &vt_ContextMenu; + sf->pidlRoot = _ILCreateControlPanel(); /* my qualified pidl */ + sf->pUnkOuter = pUnkOuter ? pUnkOuter : _IUnknown_ (sf); + + if (!SUCCEEDED(IUnknown_QueryInterface(_IUnknown_(sf), riid, ppv))) { + IUnknown_Release(_IUnknown_(sf)); + return E_NOINTERFACE; + } + + TRACE("--(%p)\n", sf); + return S_OK; +} + +/************************************************************************** + * ISF_ControlPanel_fnQueryInterface + * + * NOTES supports not IPersist/IPersistFolder + */ +static HRESULT WINAPI ISF_ControlPanel_fnQueryInterface(IShellFolder2 * iface, REFIID riid, LPVOID * ppvObject) +{ + ICPanelImpl *This = (ICPanelImpl *)iface; + + TRACE("(%p)->(%s,%p)\n", This, shdebugstr_guid(riid), ppvObject); + + *ppvObject = NULL; + + if (IsEqualIID(riid, &IID_IUnknown) || + IsEqualIID(riid, &IID_IShellFolder) || IsEqualIID(riid, &IID_IShellFolder2)) + *ppvObject = This; + else if (IsEqualIID(riid, &IID_IPersist) || + IsEqualIID(riid, &IID_IPersistFolder) || IsEqualIID(riid, &IID_IPersistFolder2)) + *ppvObject = _IPersistFolder2_(This); + else if (IsEqualIID(riid, &IID_IShellExecuteHookW)) + *ppvObject = _IShellExecuteHookW_(This); + else if (IsEqualIID(riid, &IID_IShellExecuteHookA)) + *ppvObject = _IShellExecuteHookA_(This); + + if (*ppvObject) { + IUnknown_AddRef((IUnknown *)(*ppvObject)); + TRACE("-- Interface:(%p)->(%p)\n", ppvObject, *ppvObject); + return S_OK; + } + TRACE("-- Interface: E_NOINTERFACE\n"); + return E_NOINTERFACE; +} + +static ULONG WINAPI ISF_ControlPanel_fnAddRef(IShellFolder2 * iface) +{ + ICPanelImpl *This = (ICPanelImpl *)iface; + ULONG refCount = InterlockedIncrement(&This->ref); + + TRACE("(%p)->(count=%u)\n", This, refCount - 1); + + return refCount; +} + +static ULONG WINAPI ISF_ControlPanel_fnRelease(IShellFolder2 * iface) +{ + ICPanelImpl *This = (ICPanelImpl *)iface; + ULONG refCount = InterlockedDecrement(&This->ref); + + TRACE("(%p)->(count=%u)\n", This, refCount + 1); + + if (!refCount) { + TRACE("-- destroying IShellFolder(%p)\n", This); + SHFree(This->pidlRoot); + LocalFree((HLOCAL) This); + } + return refCount; +} + +/************************************************************************** +* ISF_ControlPanel_fnParseDisplayName +*/ +static HRESULT WINAPI +ISF_ControlPanel_fnParseDisplayName(IShellFolder2 * iface, + HWND hwndOwner, + LPBC pbc, + LPOLESTR lpszDisplayName, + DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes) +{ + ICPanelImpl *This = (ICPanelImpl *)iface; + + HRESULT hr = E_INVALIDARG; + + FIXME("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n", + This, hwndOwner, pbc, lpszDisplayName, debugstr_w(lpszDisplayName), pchEaten, ppidl, pdwAttributes); + + *ppidl = 0; + if (pchEaten) + *pchEaten = 0; + + TRACE("(%p)->(-- ret=0x%08x)\n", This, hr); + + return hr; +} + +static LPITEMIDLIST _ILCreateCPanelApplet(LPCSTR name, LPCSTR displayName, + LPCSTR comment, int iconIdx) +{ + PIDLCPanelStruct *p; + LPITEMIDLIST pidl; + PIDLDATA tmp; + int size0 = (char*)&tmp.u.cpanel.szName-(char*)&tmp.u.cpanel; + int size = size0; + int l; + + tmp.type = PT_CPLAPPLET; + tmp.u.cpanel.dummy = 0; + tmp.u.cpanel.iconIdx = iconIdx; + + l = strlen(name); + size += l+1; + + tmp.u.cpanel.offsDispName = l+1; + l = strlen(displayName); + size += l+1; + + tmp.u.cpanel.offsComment = tmp.u.cpanel.offsDispName+1+l; + l = strlen(comment); + size += l+1; + + pidl = SHAlloc(size+4); + if (!pidl) + return NULL; + + pidl->mkid.cb = size+2; + memcpy(pidl->mkid.abID, &tmp, 2+size0); + + p = &((PIDLDATA*)pidl->mkid.abID)->u.cpanel; + strcpy(p->szName, name); + strcpy(p->szName+tmp.u.cpanel.offsDispName, displayName); + strcpy(p->szName+tmp.u.cpanel.offsComment, comment); + + *(WORD*)((char*)pidl+(size+2)) = 0; + + pcheck(pidl); + + return pidl; +} + +/************************************************************************** + * _ILGetCPanelPointer() + * gets a pointer to the control panel struct stored in the pidl + */ +static PIDLCPanelStruct* _ILGetCPanelPointer(LPCITEMIDLIST pidl) +{ + LPPIDLDATA pdata = _ILGetDataPointer(pidl); + + if (pdata && pdata->type==PT_CPLAPPLET) + return (PIDLCPanelStruct*)&(pdata->u.cpanel); + + return NULL; +} + + /************************************************************************** + * ISF_ControlPanel_fnEnumObjects + */ +static BOOL SHELL_RegisterCPanelApp(IEnumIDList* list, LPCSTR path) +{ + LPITEMIDLIST pidl; + CPlApplet* applet; + CPanel panel; + CPLINFO info; + unsigned i; + int iconIdx; + + char displayName[MAX_PATH]; + char comment[MAX_PATH]; + + WCHAR wpath[MAX_PATH]; + + MultiByteToWideChar(CP_ACP, 0, path, -1, wpath, MAX_PATH); + + panel.first = NULL; + applet = Control_LoadApplet(0, wpath, &panel); + + if (applet) + { + for(i=0; icount; ++i) + { + WideCharToMultiByte(CP_ACP, 0, applet->info[i].szName, -1, displayName, MAX_PATH, 0, 0); + WideCharToMultiByte(CP_ACP, 0, applet->info[i].szInfo, -1, comment, MAX_PATH, 0, 0); + + applet->proc(0, CPL_INQUIRE, i, (LPARAM)&info); + + if (info.idIcon > 0) + iconIdx = -info.idIcon; /* negative icon index instead of icon number */ + else + iconIdx = 0; + + pidl = _ILCreateCPanelApplet(path, displayName, comment, iconIdx); + + if (pidl) + AddToEnumList(list, pidl); + } + Control_UnloadApplet(applet); + } + return TRUE; +} + +static int SHELL_RegisterRegistryCPanelApps(IEnumIDList* list, HKEY hkey_root, LPCSTR szRepPath) +{ + char name[MAX_PATH]; + char value[MAX_PATH]; + HKEY hkey; + + int cnt = 0; + + if (RegOpenKeyA(hkey_root, szRepPath, &hkey) == ERROR_SUCCESS) + { + int idx = 0; + + for(;; ++idx) + { + DWORD nameLen = MAX_PATH; + DWORD valueLen = MAX_PATH; + + if (RegEnumValueA(hkey, idx, name, &nameLen, NULL, NULL, (LPBYTE)&value, &valueLen) != ERROR_SUCCESS) + break; + + if (SHELL_RegisterCPanelApp(list, value)) + ++cnt; + } + RegCloseKey(hkey); + } + + return cnt; +} + +static int SHELL_RegisterCPanelFolders(IEnumIDList* list, HKEY hkey_root, LPCSTR szRepPath) +{ + char name[MAX_PATH]; + HKEY hkey; + + int cnt = 0; + + if (RegOpenKeyA(hkey_root, szRepPath, &hkey) == ERROR_SUCCESS) + { + int idx = 0; + for(;; ++idx) + { + if (RegEnumKeyA(hkey, idx, name, MAX_PATH) != ERROR_SUCCESS) + break; + + if (*name == '{') + { + LPITEMIDLIST pidl = _ILCreateGuidFromStrA(name); + + if (pidl && AddToEnumList(list, pidl)) + ++cnt; + } + } + + RegCloseKey(hkey); + } + + return cnt; +} + +/************************************************************************** + * CreateCPanelEnumList() + */ +static BOOL CreateCPanelEnumList( + IEnumIDList * iface, + DWORD dwFlags) +{ + CHAR szPath[MAX_PATH]; + WIN32_FIND_DATAA wfd; + HANDLE hFile; + + TRACE("(%p)->(flags=0x%08x)\n", iface, dwFlags); + + /* enumerate control panel folders */ + if (dwFlags & SHCONTF_FOLDERS) + SHELL_RegisterCPanelFolders(iface, HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ControlPanel\\NameSpace"); + + /* enumerate the control panel applets */ + if (dwFlags & SHCONTF_NONFOLDERS) + { + LPSTR p; + + GetSystemDirectoryA(szPath, MAX_PATH); + p = PathAddBackslashA(szPath); + strcpy(p, "*.cpl"); + + TRACE("-- (%p)-> enumerate SHCONTF_NONFOLDERS of %s\n",iface,debugstr_a(szPath)); + hFile = FindFirstFileA(szPath, &wfd); + + if (hFile != INVALID_HANDLE_VALUE) + { + do + { + if (!(dwFlags & SHCONTF_INCLUDEHIDDEN) && (wfd.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)) + continue; + + if (!(wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { + strcpy(p, wfd.cFileName); + SHELL_RegisterCPanelApp((IEnumIDList*)iface, szPath); + } + } while(FindNextFileA(hFile, &wfd)); + FindClose(hFile); + } + + SHELL_RegisterRegistryCPanelApps((IEnumIDList*)iface, HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Cpls"); + SHELL_RegisterRegistryCPanelApps((IEnumIDList*)iface, HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Cpls"); + } + return TRUE; +} + +/************************************************************************** +* ISF_ControlPanel_fnEnumObjects +*/ +static HRESULT WINAPI +ISF_ControlPanel_fnEnumObjects(IShellFolder2 * iface, HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST * ppEnumIDList) +{ + ICPanelImpl *This = (ICPanelImpl *)iface; + + TRACE("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", This, hwndOwner, dwFlags, ppEnumIDList); + + *ppEnumIDList = IEnumIDList_Constructor(); + if (*ppEnumIDList) + CreateCPanelEnumList(*ppEnumIDList, dwFlags); + + TRACE("--(%p)->(new ID List: %p)\n", This, *ppEnumIDList); + + return(*ppEnumIDList) ? S_OK : E_OUTOFMEMORY; +} + +/************************************************************************** +* ISF_ControlPanel_fnBindToObject +*/ +static HRESULT WINAPI +ISF_ControlPanel_fnBindToObject(IShellFolder2 * iface, LPCITEMIDLIST pidl, + LPBC pbcReserved, REFIID riid, LPVOID * ppvOut) +{ + ICPanelImpl *This = (ICPanelImpl *)iface; + + TRACE("(%p)->(pidl=%p,%p,%s,%p)\n", This, pidl, pbcReserved, shdebugstr_guid(riid), ppvOut); + + return SHELL32_BindToChild(This->pidlRoot, NULL, pidl, riid, ppvOut); +} + +/************************************************************************** +* ISF_ControlPanel_fnBindToStorage +*/ +static HRESULT WINAPI +ISF_ControlPanel_fnBindToStorage(IShellFolder2 * iface, + LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut) +{ + ICPanelImpl *This = (ICPanelImpl *)iface; + + FIXME("(%p)->(pidl=%p,%p,%s,%p) stub\n", This, pidl, pbcReserved, shdebugstr_guid(riid), ppvOut); + + *ppvOut = NULL; + return E_NOTIMPL; +} + +/************************************************************************** +* ISF_ControlPanel_fnCompareIDs +*/ + +static HRESULT WINAPI +ISF_ControlPanel_fnCompareIDs(IShellFolder2 * iface, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) +{ + ICPanelImpl *This = (ICPanelImpl *)iface; + + int nReturn; + + TRACE("(%p)->(0x%08lx,pidl1=%p,pidl2=%p)\n", This, lParam, pidl1, pidl2); + nReturn = SHELL32_CompareIDs(_IShellFolder_(This), lParam, pidl1, pidl2); + TRACE("-- %i\n", nReturn); + return nReturn; +} + +/************************************************************************** +* ISF_ControlPanel_fnCreateViewObject +*/ +static HRESULT WINAPI +ISF_ControlPanel_fnCreateViewObject(IShellFolder2 * iface, HWND hwndOwner, REFIID riid, LPVOID * ppvOut) +{ + ICPanelImpl *This = (ICPanelImpl *)iface; + + LPSHELLVIEW pShellView; + HRESULT hr = E_INVALIDARG; + + TRACE("(%p)->(hwnd=%p,%s,%p)\n", This, hwndOwner, shdebugstr_guid(riid), ppvOut); + + if (ppvOut) { + *ppvOut = NULL; + + if (IsEqualIID(riid, &IID_IDropTarget)) { + WARN("IDropTarget not implemented\n"); + hr = E_NOTIMPL; + } else if (IsEqualIID(riid, &IID_IContextMenu)) { + WARN("IContextMenu not implemented\n"); + hr = E_NOTIMPL; + } else if (IsEqualIID(riid, &IID_IShellView)) { + pShellView = IShellView_Constructor((IShellFolder *) iface); + if (pShellView) { + hr = IShellView_QueryInterface(pShellView, riid, ppvOut); + IShellView_Release(pShellView); + } + } + } + TRACE("--(%p)->(interface=%p)\n", This, ppvOut); + return hr; +} + +/************************************************************************** +* ISF_ControlPanel_fnGetAttributesOf +*/ +static HRESULT WINAPI +ISF_ControlPanel_fnGetAttributesOf(IShellFolder2 * iface, UINT cidl, LPCITEMIDLIST * apidl, DWORD * rgfInOut) +{ + ICPanelImpl *This = (ICPanelImpl *)iface; + + HRESULT hr = S_OK; + + TRACE("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n", + This, cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0); + + if (!rgfInOut) + return E_INVALIDARG; + if (cidl && !apidl) + return E_INVALIDARG; + + if (*rgfInOut == 0) + *rgfInOut = ~0; + + while(cidl > 0 && *apidl) { + pdump(*apidl); + SHELL32_GetItemAttributes(_IShellFolder_(This), *apidl, rgfInOut); + apidl++; + cidl--; + } + /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */ + *rgfInOut &= ~SFGAO_VALIDATE; + + TRACE("-- result=0x%08x\n", *rgfInOut); + return hr; +} + +/************************************************************************** +* ISF_ControlPanel_fnGetUIObjectOf +* +* PARAMETERS +* HWND hwndOwner, //[in ] Parent window for any output +* UINT cidl, //[in ] array size +* LPCITEMIDLIST* apidl, //[in ] simple pidl array +* REFIID riid, //[in ] Requested Interface +* UINT* prgfInOut, //[ ] reserved +* LPVOID* ppvObject) //[out] Resulting Interface +* +*/ +static HRESULT WINAPI +ISF_ControlPanel_fnGetUIObjectOf(IShellFolder2 * iface, + HWND hwndOwner, + UINT cidl, LPCITEMIDLIST * apidl, REFIID riid, UINT * prgfInOut, LPVOID * ppvOut) +{ + ICPanelImpl *This = (ICPanelImpl *)iface; + + LPITEMIDLIST pidl; + IUnknown *pObj = NULL; + HRESULT hr = E_INVALIDARG; + + TRACE("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n", + This, hwndOwner, cidl, apidl, shdebugstr_guid(riid), prgfInOut, ppvOut); + + if (ppvOut) { + *ppvOut = NULL; + + if (IsEqualIID(riid, &IID_IContextMenu) &&(cidl >= 1)) { + pObj = (IUnknown*)(&This->lpVtblContextMenu); + This->apidl = apidl; + This->cidl = cidl; + IUnknown_AddRef(pObj); + } else if (IsEqualIID(riid, &IID_IDataObject) &&(cidl >= 1)) { + pObj = (LPUNKNOWN) IDataObject_Constructor(hwndOwner, This->pidlRoot, apidl, cidl); + hr = S_OK; + } else if (IsEqualIID(riid, &IID_IExtractIconA) &&(cidl == 1)) { + pidl = ILCombine(This->pidlRoot, apidl[0]); + pObj = (LPUNKNOWN) IExtractIconA_Constructor(pidl); + SHFree(pidl); + hr = S_OK; + } else if (IsEqualIID(riid, &IID_IExtractIconW) &&(cidl == 1)) { + pidl = ILCombine(This->pidlRoot, apidl[0]); + pObj = (LPUNKNOWN) IExtractIconW_Constructor(pidl); + SHFree(pidl); + hr = S_OK; + } else if ((IsEqualIID(riid,&IID_IShellLinkW) || IsEqualIID(riid,&IID_IShellLinkA)) + && (cidl == 1)) { + pidl = ILCombine(This->pidlRoot, apidl[0]); + hr = IShellLink_ConstructFromFile(NULL, riid, pidl,(LPVOID*)&pObj); + SHFree(pidl); + } else { + hr = E_NOINTERFACE; + } + + if (SUCCEEDED(hr) && !pObj) + hr = E_OUTOFMEMORY; + + *ppvOut = pObj; + } + TRACE("(%p)->hr=0x%08x\n", This, hr); + return hr; +} + +/************************************************************************** +* ISF_ControlPanel_fnGetDisplayNameOf +*/ +static HRESULT WINAPI ISF_ControlPanel_fnGetDisplayNameOf(IShellFolder2 * iface, LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet) +{ + ICPanelImpl *This = (ICPanelImpl *)iface; + + CHAR szPath[MAX_PATH]; + WCHAR wszPath[MAX_PATH+1]; /* +1 for potential backslash */ + PIDLCPanelStruct* pcpanel; + + *szPath = '\0'; + + TRACE("(%p)->(pidl=%p,0x%08x,%p)\n", This, pidl, dwFlags, strRet); + pdump(pidl); + + if (!pidl || !strRet) + return E_INVALIDARG; + + pcpanel = _ILGetCPanelPointer(pidl); + + if (pcpanel) { + lstrcpyA(szPath, pcpanel->szName+pcpanel->offsDispName); + + if (!(dwFlags & SHGDN_FORPARSING)) + FIXME("retrieve display name from control panel app\n"); + } + /* take names of special folders only if it's only this folder */ + else if (_ILIsSpecialFolder(pidl)) { + BOOL bSimplePidl = _ILIsPidlSimple(pidl); + + if (bSimplePidl) { + _ILSimpleGetTextW(pidl, wszPath, MAX_PATH); /* append my own path */ + } else { + FIXME("special pidl\n"); + } + + if ((dwFlags & SHGDN_FORPARSING) && !bSimplePidl) { /* go deeper if needed */ + int len = 0; + + PathAddBackslashW(wszPath); + len = wcslen(wszPath); + + if (!SUCCEEDED + (SHELL32_GetDisplayNameOfChild(iface, pidl, dwFlags, wszPath + len, MAX_PATH + 1 - len))) + return E_OUTOFMEMORY; + if (!WideCharToMultiByte(CP_ACP, 0, wszPath, -1, szPath, MAX_PATH, NULL, NULL)) + wszPath[0] = '\0'; + } else { + if (bSimplePidl) { + if (!WideCharToMultiByte(CP_ACP, 0, wszPath, -1, szPath, MAX_PATH, NULL, NULL)) + wszPath[0] = '\0'; + } + } + } + + strRet->uType = STRRET_CSTR; + lstrcpynA(strRet->u.cStr, szPath, MAX_PATH); + + TRACE("--(%p)->(%s)\n", This, szPath); + return S_OK; +} + +/************************************************************************** +* ISF_ControlPanel_fnSetNameOf +* Changes the name of a file object or subfolder, possibly changing its item +* identifier in the process. +* +* PARAMETERS +* HWND hwndOwner, //[in ] Owner window for output +* LPCITEMIDLIST pidl, //[in ] simple pidl of item to change +* LPCOLESTR lpszName, //[in ] the items new display name +* DWORD dwFlags, //[in ] SHGNO formatting flags +* LPITEMIDLIST* ppidlOut) //[out] simple pidl returned +*/ +static HRESULT WINAPI ISF_ControlPanel_fnSetNameOf(IShellFolder2 * iface, HWND hwndOwner, LPCITEMIDLIST pidl, /*simple pidl */ + LPCOLESTR lpName, DWORD dwFlags, LPITEMIDLIST * pPidlOut) +{ + ICPanelImpl *This = (ICPanelImpl *)iface; + FIXME("(%p)->(%p,pidl=%p,%s,%u,%p)\n", This, hwndOwner, pidl, debugstr_w(lpName), dwFlags, pPidlOut); + return E_FAIL; +} + +static HRESULT WINAPI ISF_ControlPanel_fnGetDefaultSearchGUID(IShellFolder2 * iface, GUID * pguid) +{ + ICPanelImpl *This = (ICPanelImpl *)iface; + FIXME("(%p)\n", This); + return E_NOTIMPL; +} +static HRESULT WINAPI ISF_ControlPanel_fnEnumSearches(IShellFolder2 * iface, IEnumExtraSearch ** ppenum) +{ + ICPanelImpl *This = (ICPanelImpl *)iface; + FIXME("(%p)\n", This); + return E_NOTIMPL; +} +static HRESULT WINAPI ISF_ControlPanel_fnGetDefaultColumn(IShellFolder2 * iface, DWORD dwRes, ULONG * pSort, ULONG * pDisplay) +{ + ICPanelImpl *This = (ICPanelImpl *)iface; + + TRACE("(%p)\n", This); + + if (pSort) *pSort = 0; + if (pDisplay) *pDisplay = 0; + return S_OK; +} +static HRESULT WINAPI ISF_ControlPanel_fnGetDefaultColumnState(IShellFolder2 * iface, UINT iColumn, DWORD * pcsFlags) +{ + ICPanelImpl *This = (ICPanelImpl *)iface; + + TRACE("(%p)\n", This); + + if (!pcsFlags || iColumn >= CONROLPANELSHELLVIEWCOLUMNS) return E_INVALIDARG; + *pcsFlags = ControlPanelSFHeader[iColumn].pcsFlags; + return S_OK; +} +static HRESULT WINAPI ISF_ControlPanel_fnGetDetailsEx(IShellFolder2 * iface, LPCITEMIDLIST pidl, const SHCOLUMNID * pscid, VARIANT * pv) +{ + ICPanelImpl *This = (ICPanelImpl *)iface; + FIXME("(%p)\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI ISF_ControlPanel_fnGetDetailsOf(IShellFolder2 * iface, LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS * psd) +{ + ICPanelImpl *This = (ICPanelImpl *)iface; + HRESULT hr; + + TRACE("(%p)->(%p %i %p)\n", This, pidl, iColumn, psd); + + if (!psd || iColumn >= CONROLPANELSHELLVIEWCOLUMNS) + return E_INVALIDARG; + + if (!pidl) { + psd->fmt = ControlPanelSFHeader[iColumn].fmt; + psd->cxChar = ControlPanelSFHeader[iColumn].cxChar; + psd->str.uType = STRRET_CSTR; + LoadStringA(shell32_hInstance, ControlPanelSFHeader[iColumn].colnameid, psd->str.u.cStr, MAX_PATH); + return S_OK; + } else { + psd->str.u.cStr[0] = 0x00; + psd->str.uType = STRRET_CSTR; + switch(iColumn) { + case 0: /* name */ + hr = IShellFolder_GetDisplayNameOf(iface, pidl, SHGDN_NORMAL | SHGDN_INFOLDER, &psd->str); + break; + case 1: /* comment */ + _ILGetFileType(pidl, psd->str.u.cStr, MAX_PATH); + break; + } + hr = S_OK; + } + + return hr; +} +static HRESULT WINAPI ISF_ControlPanel_fnMapColumnToSCID(IShellFolder2 * iface, UINT column, SHCOLUMNID * pscid) +{ + ICPanelImpl *This = (ICPanelImpl *)iface; + FIXME("(%p)\n", This); + return E_NOTIMPL; +} + +static const IShellFolder2Vtbl vt_ShellFolder2 = +{ + + ISF_ControlPanel_fnQueryInterface, + ISF_ControlPanel_fnAddRef, + ISF_ControlPanel_fnRelease, + ISF_ControlPanel_fnParseDisplayName, + ISF_ControlPanel_fnEnumObjects, + ISF_ControlPanel_fnBindToObject, + ISF_ControlPanel_fnBindToStorage, + ISF_ControlPanel_fnCompareIDs, + ISF_ControlPanel_fnCreateViewObject, + ISF_ControlPanel_fnGetAttributesOf, + ISF_ControlPanel_fnGetUIObjectOf, + ISF_ControlPanel_fnGetDisplayNameOf, + ISF_ControlPanel_fnSetNameOf, + + /* ShellFolder2 */ + ISF_ControlPanel_fnGetDefaultSearchGUID, + ISF_ControlPanel_fnEnumSearches, + ISF_ControlPanel_fnGetDefaultColumn, + ISF_ControlPanel_fnGetDefaultColumnState, + ISF_ControlPanel_fnGetDetailsEx, + ISF_ControlPanel_fnGetDetailsOf, + ISF_ControlPanel_fnMapColumnToSCID +}; + +/************************************************************************ + * ICPanel_PersistFolder2_QueryInterface + */ +static HRESULT WINAPI ICPanel_PersistFolder2_QueryInterface(IPersistFolder2 * iface, REFIID iid, LPVOID * ppvObject) +{ + ICPanelImpl *This = impl_from_IPersistFolder2(iface); + + TRACE("(%p)\n", This); + + return IUnknown_QueryInterface(_IUnknown_(This), iid, ppvObject); +} + +/************************************************************************ + * ICPanel_PersistFolder2_AddRef + */ +static ULONG WINAPI ICPanel_PersistFolder2_AddRef(IPersistFolder2 * iface) +{ + ICPanelImpl *This = impl_from_IPersistFolder2(iface); + + TRACE("(%p)->(count=%u)\n", This, This->ref); + + return IUnknown_AddRef(_IUnknown_(This)); +} + +/************************************************************************ + * ISFPersistFolder_Release + */ +static ULONG WINAPI ICPanel_PersistFolder2_Release(IPersistFolder2 * iface) +{ + ICPanelImpl *This = impl_from_IPersistFolder2(iface); + + TRACE("(%p)->(count=%u)\n", This, This->ref); + + return IUnknown_Release(_IUnknown_(This)); +} + +/************************************************************************ + * ICPanel_PersistFolder2_GetClassID + */ +static HRESULT WINAPI ICPanel_PersistFolder2_GetClassID(IPersistFolder2 * iface, CLSID * lpClassId) +{ + ICPanelImpl *This = impl_from_IPersistFolder2(iface); + + TRACE("(%p)\n", This); + + if (!lpClassId) + return E_POINTER; + *lpClassId = CLSID_ControlPanel; + + return S_OK; +} + +/************************************************************************ + * ICPanel_PersistFolder2_Initialize + * + * NOTES: it makes no sense to change the pidl + */ +static HRESULT WINAPI ICPanel_PersistFolder2_Initialize(IPersistFolder2 * iface, LPCITEMIDLIST pidl) +{ + ICPanelImpl *This = impl_from_IPersistFolder2(iface); + if (This->pidlRoot) + SHFree((LPVOID)This->pidlRoot); + + This->pidlRoot = ILClone(pidl); + return S_OK; +} + +/************************************************************************** + * IPersistFolder2_fnGetCurFolder + */ +static HRESULT WINAPI ICPanel_PersistFolder2_GetCurFolder(IPersistFolder2 * iface, LPITEMIDLIST * pidl) +{ + ICPanelImpl *This = impl_from_IPersistFolder2(iface); + + TRACE("(%p)->(%p)\n", This, pidl); + + if (!pidl) + return E_POINTER; + *pidl = ILClone(This->pidlRoot); + return S_OK; +} + +static const IPersistFolder2Vtbl vt_PersistFolder2 = +{ + + ICPanel_PersistFolder2_QueryInterface, + ICPanel_PersistFolder2_AddRef, + ICPanel_PersistFolder2_Release, + ICPanel_PersistFolder2_GetClassID, + ICPanel_PersistFolder2_Initialize, + ICPanel_PersistFolder2_GetCurFolder +}; + +HRESULT CPanel_GetIconLocationW(LPCITEMIDLIST pidl, + LPWSTR szIconFile, UINT cchMax, int* piIndex) +{ + PIDLCPanelStruct* pcpanel = _ILGetCPanelPointer(pidl); + + if (!pcpanel) + return E_INVALIDARG; + + MultiByteToWideChar(CP_ACP, 0, pcpanel->szName, -1, szIconFile, cchMax); + *piIndex = pcpanel->iconIdx!=-1? pcpanel->iconIdx: 0; + + return S_OK; +} + + +/************************************************************************** +* IShellExecuteHookW Implementation +*/ + +static HRESULT WINAPI IShellExecuteHookW_fnQueryInterface( + IShellExecuteHookW* iface, REFIID riid, void** ppvObject) +{ + ICPanelImpl *This = impl_from_IShellExecuteHookW(iface); + + TRACE("(%p)->(count=%u)\n", This, This->ref); + + return IUnknown_QueryInterface(This->pUnkOuter, riid, ppvObject); +} + +static ULONG STDMETHODCALLTYPE IShellExecuteHookW_fnAddRef(IShellExecuteHookW* iface) +{ + ICPanelImpl *This = impl_from_IShellExecuteHookW(iface); + + TRACE("(%p)->(count=%u)\n", This, This->ref); + + return IUnknown_AddRef(This->pUnkOuter); +} + +static ULONG STDMETHODCALLTYPE IShellExecuteHookW_fnRelease(IShellExecuteHookW* iface) +{ + ICPanelImpl *This = impl_from_IShellExecuteHookW(iface); + + TRACE("(%p)\n", This); + + return IUnknown_Release(This->pUnkOuter); +} + +HRESULT +ExecuteAppletFromCLSID(LPOLESTR pOleStr) +{ + WCHAR szCmd[MAX_PATH]; + WCHAR szExpCmd[MAX_PATH]; + PROCESS_INFORMATION pi; + STARTUPINFOW si; + WCHAR szBuffer[90] = { 'C', 'L', 'S', 'I', 'D', '\\', 0 }; + DWORD dwType, dwSize; + + wcscpy(&szBuffer[6], pOleStr); + wcscat(szBuffer, L"\\shell\\open\\command"); + + dwSize = sizeof(szCmd); + if (RegGetValueW(HKEY_CLASSES_ROOT, szBuffer, NULL, RRF_RT_REG_SZ, &dwType, (PVOID)szCmd, &dwSize) != ERROR_SUCCESS) + { + ERR("RegGetValueW failed with %u\n", GetLastError()); + return E_FAIL; + } + +#if 0 + if (dwType != RRF_RT_REG_SZ && dwType != RRF_RT_REG_EXPAND_SZ) + return E_FAIL; +#endif + + if (!ExpandEnvironmentStringsW(szCmd, szExpCmd, sizeof(szExpCmd)/sizeof(WCHAR))) + return E_FAIL; + + ZeroMemory(&si, sizeof(si)); + si.cb = sizeof(si); + if (!CreateProcessW(NULL, szExpCmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) + return E_FAIL; + + CloseHandle(pi.hProcess); + CloseHandle(pi.hThread); + return S_OK; +} + + +static HRESULT WINAPI IShellExecuteHookW_fnExecute(IShellExecuteHookW* iface, LPSHELLEXECUTEINFOW psei) +{ + static const WCHAR wCplopen[] = {'c','p','l','o','p','e','n','\0'}; + ICPanelImpl *This = (ICPanelImpl *)iface; + + SHELLEXECUTEINFOW sei_tmp; + PIDLCPanelStruct* pcpanel; + WCHAR path[MAX_PATH]; + WCHAR params[MAX_PATH]; + BOOL ret; + HRESULT hr; + int l; + + TRACE("(%p)->execute(%p)\n", This, psei); + + if (!psei) + return E_INVALIDARG; + + pcpanel = _ILGetCPanelPointer(ILFindLastID(psei->lpIDList)); + + if (!pcpanel) + { + LPOLESTR pOleStr; + + IID * iid = _ILGetGUIDPointer(ILFindLastID(psei->lpIDList)); + if (!iid) + return E_INVALIDARG; + if (StringFromCLSID(iid, &pOleStr) == S_OK) + { + + hr = ExecuteAppletFromCLSID(pOleStr); + CoTaskMemFree(pOleStr); + return hr; + } + + return E_INVALIDARG; + } + path[0] = '\"'; + /* Return value from MultiByteToWideChar includes terminating NUL, which + * compensates for the starting double quote we just put in */ + l = MultiByteToWideChar(CP_ACP, 0, pcpanel->szName, -1, path+1, MAX_PATH); + + /* pass applet name to Control_RunDLL to distinguish between applets in one .cpl file */ + path[l++] = '"'; + path[l] = '\0'; + + MultiByteToWideChar(CP_ACP, 0, pcpanel->szName+pcpanel->offsDispName, -1, params, MAX_PATH); + + memcpy(&sei_tmp, psei, sizeof(sei_tmp)); + sei_tmp.lpFile = path; + sei_tmp.lpParameters = params; + sei_tmp.fMask &= ~SEE_MASK_INVOKEIDLIST; + sei_tmp.lpVerb = wCplopen; + + ret = ShellExecuteExW(&sei_tmp); + if (ret) + return S_OK; + else + return S_FALSE; +} + +static const IShellExecuteHookWVtbl vt_ShellExecuteHookW = +{ + + IShellExecuteHookW_fnQueryInterface, + IShellExecuteHookW_fnAddRef, + IShellExecuteHookW_fnRelease, + + IShellExecuteHookW_fnExecute +}; + + +/************************************************************************** +* IShellExecuteHookA Implementation +*/ + +static HRESULT WINAPI IShellExecuteHookA_fnQueryInterface(IShellExecuteHookA* iface, REFIID riid, void** ppvObject) +{ + ICPanelImpl *This = impl_from_IShellExecuteHookA(iface); + + TRACE("(%p)->(count=%u)\n", This, This->ref); + + return IUnknown_QueryInterface(This->pUnkOuter, riid, ppvObject); +} + +static ULONG STDMETHODCALLTYPE IShellExecuteHookA_fnAddRef(IShellExecuteHookA* iface) +{ + ICPanelImpl *This = impl_from_IShellExecuteHookA(iface); + + TRACE("(%p)->(count=%u)\n", This, This->ref); + + return IUnknown_AddRef(This->pUnkOuter); +} + +static ULONG STDMETHODCALLTYPE IShellExecuteHookA_fnRelease(IShellExecuteHookA* iface) +{ + ICPanelImpl *This = impl_from_IShellExecuteHookA(iface); + + TRACE("(%p)\n", This); + + return IUnknown_Release(This->pUnkOuter); +} + +static HRESULT WINAPI IShellExecuteHookA_fnExecute(IShellExecuteHookA* iface, LPSHELLEXECUTEINFOA psei) +{ + ICPanelImpl *This = (ICPanelImpl *)iface; + + SHELLEXECUTEINFOA sei_tmp; + PIDLCPanelStruct* pcpanel; + char path[MAX_PATH]; + BOOL ret; + + TRACE("(%p)->execute(%p)\n", This, psei); + + if (!psei) + return E_INVALIDARG; + + pcpanel = _ILGetCPanelPointer(ILFindLastID(psei->lpIDList)); + + if (!pcpanel) + return E_INVALIDARG; + + path[0] = '\"'; + lstrcpyA(path+1, pcpanel->szName); + + /* pass applet name to Control_RunDLL to distinguish between applets in one .cpl file */ + lstrcatA(path, "\" "); + lstrcatA(path, pcpanel->szName+pcpanel->offsDispName); + + memcpy(&sei_tmp, psei, sizeof(sei_tmp)); + sei_tmp.lpFile = path; + sei_tmp.fMask &= ~SEE_MASK_INVOKEIDLIST; + + ret = ShellExecuteExA(&sei_tmp); + if (ret) + return S_OK; + else + return S_FALSE; +} + +static const IShellExecuteHookAVtbl vt_ShellExecuteHookA = +{ + IShellExecuteHookA_fnQueryInterface, + IShellExecuteHookA_fnAddRef, + IShellExecuteHookA_fnRelease, + IShellExecuteHookA_fnExecute +}; + +/************************************************************************** +* IContextMenu2 Implementation +*/ + +/************************************************************************ + * ICPanel_IContextMenu_QueryInterface + */ +static HRESULT WINAPI ICPanel_IContextMenu2_QueryInterface(IContextMenu2 * iface, REFIID iid, LPVOID * ppvObject) +{ + ICPanelImpl *This = impl_from_IContextMenu(iface); + + TRACE("(%p)\n", This); + + return IUnknown_QueryInterface(_IUnknown_(This), iid, ppvObject); +} + +/************************************************************************ + * ICPanel_IContextMenu_AddRef + */ +static ULONG WINAPI ICPanel_IContextMenu2_AddRef(IContextMenu2 * iface) +{ + ICPanelImpl *This = impl_from_IContextMenu(iface); + + TRACE("(%p)->(count=%u)\n", This, This->ref); + + return IUnknown_AddRef(_IUnknown_(This)); +} + +/************************************************************************ + * ICPanel_IContextMenu_Release + */ +static ULONG WINAPI ICPanel_IContextMenu2_Release(IContextMenu2 * iface) +{ + ICPanelImpl *This = impl_from_IContextMenu(iface); + + TRACE("(%p)->(count=%u)\n", This, This->ref); + + return IUnknown_Release(_IUnknown_(This)); +} + +/************************************************************************** +* ICPanel_IContextMenu_QueryContextMenu() +*/ +static HRESULT WINAPI ICPanel_IContextMenu2_QueryContextMenu( + IContextMenu2 *iface, + HMENU hMenu, + UINT indexMenu, + UINT idCmdFirst, + UINT idCmdLast, + UINT uFlags) +{ + WCHAR szBuffer[30] = {0}; + ULONG Count = 1; + + ICPanelImpl *This = impl_from_IContextMenu(iface); + + TRACE("(%p)->(hmenu=%p indexmenu=%x cmdfirst=%x cmdlast=%x flags=%x )\n", + This, hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags); + + if (LoadStringW(shell32_hInstance, IDS_OPEN, szBuffer, sizeof(szBuffer)/sizeof(WCHAR))) + { + szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0'; + _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_STRING, szBuffer, MFS_DEFAULT); + Count++; + } + + if (LoadStringW(shell32_hInstance, IDS_CREATELINK, szBuffer, sizeof(szBuffer)/sizeof(WCHAR))) + { + if (Count) + { + _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_SEPARATOR, NULL, MFS_ENABLED); + } + szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0'; + + _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_STRING, szBuffer, MFS_ENABLED); + Count++; + } + return MAKE_HRESULT(SEVERITY_SUCCESS, 0, Count); +} + + +/************************************************************************** +* ICPanel_IContextMenu_InvokeCommand() +*/ +static HRESULT WINAPI ICPanel_IContextMenu2_InvokeCommand( + IContextMenu2 *iface, + LPCMINVOKECOMMANDINFO lpcmi) +{ + SHELLEXECUTEINFOW sei; + WCHAR szPath[MAX_PATH]; + char szTarget[MAX_PATH]; + STRRET strret; + WCHAR* pszPath; + INT Length, cLength; + PIDLCPanelStruct *pcpanel; + IPersistFile * ppf; + IShellLinkA * isl; + ICPanelImpl *This = impl_from_IContextMenu(iface); + + TRACE("(%p)->(invcom=%p verb=%p wnd=%p)\n",This,lpcmi,lpcmi->lpVerb, lpcmi->hwnd); + + if (lpcmi->lpVerb == MAKEINTRESOURCEA(1)) + { + ZeroMemory(&sei, sizeof(sei)); + sei.cbSize = sizeof(sei); + sei.fMask = SEE_MASK_INVOKEIDLIST; + sei.lpIDList = ILCombine(This->pidlRoot, This->apidl[0]); + sei.hwnd = lpcmi->hwnd; + sei.nShow = SW_SHOWNORMAL; + sei.lpVerb = L"open"; + ShellExecuteExW(&sei); + if (sei.hInstApp <= (HINSTANCE)32) + return E_FAIL; + } + else if (lpcmi->lpVerb == MAKEINTRESOURCEA(2)) + { + if (!SHGetSpecialFolderPathW(NULL, szPath, CSIDL_DESKTOPDIRECTORY, FALSE)) + return E_FAIL; + + pszPath = PathAddBackslashW(szPath); + if (!pszPath) + return E_FAIL; + + if (IShellFolder_GetDisplayNameOf((IShellFolder*)This, This->apidl[0], SHGDN_FORPARSING, &strret) != S_OK) + return E_FAIL; + + Length = MAX_PATH - (pszPath - szPath); + cLength = strlen(strret.u.cStr); + if (Length < cLength + 5) + { + FIXME("\n"); + return E_FAIL; + } + + if (MultiByteToWideChar(CP_ACP, 0, strret.u.cStr, cLength +1, pszPath, Length)) + { + pszPath += cLength; + Length -= cLength; + } + + if (Length > 10) + { + wcscpy(pszPath, L" - "); + cLength = LoadStringW(shell32_hInstance, IDS_LNK_FILE, &pszPath[3], Length -4) + 3; + if (cLength + 5 > Length) + cLength = Length - 5; + Length -= cLength; + pszPath += cLength; + } + wcscpy(pszPath, L".lnk"); + + pcpanel = _ILGetCPanelPointer(ILFindLastID(This->apidl[0])); + if (pcpanel) + { + strncpy(szTarget, pcpanel->szName, MAX_PATH); + } + else + { + FIXME("\n"); + return E_FAIL; + } + if (SUCCEEDED(IShellLink_Constructor(NULL, &IID_IShellLinkA, (LPVOID*)&isl))) + { + IShellLinkA_SetPath(isl, szTarget); + if (SUCCEEDED(IShellLinkA_QueryInterface(isl, &IID_IPersistFile, (LPVOID*)&ppf))) + { + IPersistFile_Save(ppf, szPath, TRUE); + IPersistFile_Release(ppf); + } + IShellLinkA_Release(isl); + } + return NOERROR; + } + return S_OK; +} + +/************************************************************************** + * ICPanel_IContextMenu_GetCommandString() + * + */ +static HRESULT WINAPI ICPanel_IContextMenu2_GetCommandString( + IContextMenu2 *iface, + UINT_PTR idCommand, + UINT uFlags, + UINT* lpReserved, + LPSTR lpszName, + UINT uMaxNameLen) +{ + ICPanelImpl *This = impl_from_IContextMenu(iface); + + TRACE("(%p)->(idcom=%lx flags=%x %p name=%p len=%x)\n",This, idCommand, uFlags, lpReserved, lpszName, uMaxNameLen); + + + FIXME("unknown command string\n"); + return E_FAIL; +} + + + +/************************************************************************** +* ICPanel_IContextMenu_HandleMenuMsg() +*/ +static HRESULT WINAPI ICPanel_IContextMenu2_HandleMenuMsg( + IContextMenu2 *iface, + UINT uMsg, + WPARAM wParam, + LPARAM lParam) +{ + ICPanelImpl *This = impl_from_IContextMenu(iface); + + TRACE("ICPanel_IContextMenu_HandleMenuMsg (%p)->(msg=%x wp=%lx lp=%lx)\n",This, uMsg, wParam, lParam); + + return E_NOTIMPL; +} + +static const IContextMenu2Vtbl vt_ContextMenu = +{ + ICPanel_IContextMenu2_QueryInterface, + ICPanel_IContextMenu2_AddRef, + ICPanel_IContextMenu2_Release, + ICPanel_IContextMenu2_QueryContextMenu, + ICPanel_IContextMenu2_InvokeCommand, + ICPanel_IContextMenu2_GetCommandString, + ICPanel_IContextMenu2_HandleMenuMsg +}; + diff --git a/reactos/dll/win32/shell32/shfldr_desktop.c b/reactos/dll/win32/shell32/shfldr_desktop.c index 15c09cb7a3d..a3197be3b2b 100644 --- a/reactos/dll/win32/shell32/shfldr_desktop.c +++ b/reactos/dll/win32/shell32/shfldr_desktop.c @@ -20,38 +20,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - -#include -#include -#include -#include - -#define COBJMACROS -#define NONAMELESSUNION -#define NONAMELESSSTRUCT - -#include "winerror.h" -#include "windef.h" -#include "winbase.h" -#include "winreg.h" -#include "wingdi.h" -#include "winuser.h" - -#include "ole2.h" -#include "shlguid.h" - -#include "enumidlist.h" -#include "pidl.h" -#include "undocshell.h" -#include "shell32_main.h" -#include "shresdef.h" -#include "shlwapi.h" -#include "shellfolder.h" -#include "wine/debug.h" -#include "debughlp.h" -#include "shfldr.h" +#include WINE_DEFAULT_DEBUG_CHANNEL (shell); @@ -62,6 +31,7 @@ WINE_DEFAULT_DEBUG_CHANNEL (shell); typedef struct { const IShellFolder2Vtbl *lpVtbl; const IPersistFolder2Vtbl *lpPF2; + const ISFHelperVtbl *lpvtblSFHelper; LONG ref; /* both paths are parsible from the desktop */ @@ -70,7 +40,10 @@ typedef struct { UINT cfShellIDList; /* clipboardformat for IDropTarget */ BOOL fAcceptFmt; /* flag for pending Drop */ -} IGenericSFImpl; +} IGenericSFImpl, *LPIGenericSFImpl; + +WCHAR *build_paths_list(LPCWSTR wszBasePath, int cidl, LPCITEMIDLIST *pidls); +int SHELL_ConfirmMsgBox(HWND hWnd, LPWSTR lpszText, LPWSTR lpszCaption, HICON hIcon, BOOL bYesToAll); #define _IUnknown_(This) (IShellFolder*)&(This->lpVtbl) #define _IShellFolder_(This) (IShellFolder*)&(This->lpVtbl) @@ -110,6 +83,10 @@ static HRESULT WINAPI ISF_Desktop_fnQueryInterface( { *ppvObj = &This->lpPF2; } + else if (IsEqualIID(riid, &IID_ISFHelper)) + { + *ppvObj = &This->lpvtblSFHelper; + } if (*ppvObj) { IUnknown_AddRef ((IUnknown *) (*ppvObj)); @@ -120,6 +97,11 @@ static HRESULT WINAPI ISF_Desktop_fnQueryInterface( return E_NOINTERFACE; } +static LPIGenericSFImpl __inline impl_from_ISFHelper( ISFHelper *iface ) +{ + return (IGenericSFImpl *)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpvtblSFHelper)); +} + static ULONG WINAPI ISF_Desktop_fnAddRef (IShellFolder2 * iface) { return 2; /* non-heap based object */ @@ -164,7 +146,7 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface, { szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH); TRACE ("-- element: %s\n", debugstr_w (szElement)); - SHCLSIDFromStringW (szElement + 2, &clsid); + CLSIDFromString (szElement + 2, &clsid); pidlTemp = _ILCreateGuid (PT_GUID, &clsid); } else if (PathGetDriveNumberW (lpszDisplayName) >= 0) @@ -246,7 +228,7 @@ static const WCHAR ClassicStartMenuW[] = {'S','O','F','T','W','A','R','E','\\', 'C','l','a','s','s','i','c','S','t','a','r','t','M','e','n','u','\0' }; INT -HideNamespaceExtension(WCHAR *iid) +IsNamespaceExtensionHidden(WCHAR *iid) { DWORD Result, dwResult; dwResult = sizeof(DWORD); @@ -265,6 +247,19 @@ HideNamespaceExtension(WCHAR *iid) return Result; } +static +VOID +SetNamespaceExtensionVisibleStatus(WCHAR * iid, DWORD dwStatus) +{ + HKEY hKey; + + if (RegOpenKeyExW(HKEY_CURRENT_USER, ClassicStartMenuW, 0, KEY_WRITE, &hKey) == ERROR_SUCCESS) + { + RegSetValueExW(hKey, iid, 0, REG_DWORD, (LPBYTE)&dwStatus, sizeof(DWORD)); + RegCloseKey(hKey); + } +} + /************************************************************************** @@ -280,6 +275,7 @@ static BOOL CreateDesktopEnumList(IEnumIDList *list, DWORD dwFlags) { BOOL ret = TRUE; WCHAR szPath[MAX_PATH]; + static WCHAR MyDocumentsClassString[] = L"{450D8FBA-AD25-11D0-98A8-0800361B1103}"; @@ -293,7 +289,7 @@ static BOOL CreateDesktopEnumList(IEnumIDList *list, DWORD dwFlags) DWORD dwResult; /* create the pidl for This item */ - if (HideNamespaceExtension(MyDocumentsClassString) < 1) + if (IsNamespaceExtensionHidden(MyDocumentsClassString) < 1) { ret = AddToEnumList(list, _ILCreateMyDocuments()); } @@ -321,7 +317,7 @@ static BOOL CreateDesktopEnumList(IEnumIDList *list, DWORD dwFlags) r = RegEnumKeyExW(hkey, i, iid, &size, 0, NULL, NULL, NULL); if (ERROR_SUCCESS == r) { - if (HideNamespaceExtension(iid) < 1) + if (IsNamespaceExtensionHidden(iid) < 1) { pidl = _ILCreateGuidFromStrW(iid); if (!HasItemWithCLSID(list, pidl)) @@ -388,7 +384,7 @@ static BOOL CreateDesktopEnumList(IEnumIDList *list, DWORD dwFlags) } /* enumerate the elements in %windir%\desktop */ - SHGetSpecialFolderPathW(0, szPath, CSIDL_DESKTOPDIRECTORY, FALSE); + ret = ret && SHGetSpecialFolderPathW(0, szPath, CSIDL_DESKTOPDIRECTORY, FALSE); ret = ret && CreateFolderEnumList(list, szPath, dwFlags); return ret; @@ -653,7 +649,7 @@ static HRESULT WINAPI ISF_Desktop_fnGetDisplayNameOf (IShellFolder2 * iface, { if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) && (GET_SHGDN_FOR (dwFlags) & SHGDN_FORPARSING)) - strcpyW(pszPath, This->sPathTarget); + wcscpy(pszPath, This->sPathTarget); else HCR_GetClassNameW(&CLSID_ShellDesktop, pszPath, MAX_PATH); } @@ -691,9 +687,9 @@ static HRESULT WINAPI ISF_Desktop_fnGetDisplayNameOf (IShellFolder2 * iface, WCHAR szRegPath[100]; LONG r; - lstrcpyW (szRegPath, clsidW); + wcscpy (szRegPath, clsidW); SHELL32_GUIDToStringW (clsid, &szRegPath[6]); - lstrcatW (szRegPath, shellfolderW); + wcscat (szRegPath, shellfolderW); r = SHGetValueW(HKEY_CLASSES_ROOT, szRegPath, wantsForParsingW, NULL, NULL, NULL); if (r == ERROR_SUCCESS) @@ -737,11 +733,10 @@ static HRESULT WINAPI ISF_Desktop_fnGetDisplayNameOf (IShellFolder2 * iface, { lstrcpynW(pszPath, This->sPathTarget, MAX_PATH - 1); PathAddBackslashW(pszPath); - cLen = lstrlenW(pszPath); + cLen = wcslen(pszPath); } _ILSimpleGetTextW(pidl, pszPath + cLen, MAX_PATH - cLen); - if (!_ILIsFolder(pidl)) SHELL_FS_ProcessDisplayFilename(pszPath, dwFlags); } @@ -796,13 +791,73 @@ static HRESULT WINAPI ISF_Desktop_fnSetNameOf (IShellFolder2 * iface, LPCOLESTR lpName, DWORD dwFlags, LPITEMIDLIST * pPidlOut) { IGenericSFImpl *This = (IGenericSFImpl *)iface; + IShellFolder2 * psf; + HRESULT hr; + WCHAR szSrc[MAX_PATH + 1], szDest[MAX_PATH + 1]; + LPWSTR ptr; + BOOL bIsFolder = _ILIsFolder (ILFindLastID (pidl)); - FIXME ("(%p)->(%p,pidl=%p,%s,%u,%p)\n", This, hwndOwner, pidl, + TRACE ("(%p)->(%p,pidl=%p,%s,%u,%p)\n", This, hwndOwner, pidl, debugstr_w (lpName), dwFlags, pPidlOut); + if (_ILGetGUIDPointer(pidl)) + { + if (SUCCEEDED(IShellFolder2_BindToObject(iface, pidl, NULL, &IID_IShellFolder2, (LPVOID*)&psf))) + { + hr = IShellFolder2_SetNameOf(psf, hwndOwner, pidl, lpName, dwFlags, pPidlOut); + IShellFolder2_Release(psf); + return hr; + } + } + + /* build source path */ + lstrcpynW(szSrc, This->sPathTarget, MAX_PATH); + ptr = PathAddBackslashW (szSrc); + if (ptr) + _ILSimpleGetTextW (pidl, ptr, MAX_PATH + 1 - (ptr - szSrc)); + + /* build destination path */ + if (dwFlags == SHGDN_NORMAL || dwFlags & SHGDN_INFOLDER) { + lstrcpynW(szDest, This->sPathTarget, MAX_PATH); + ptr = PathAddBackslashW (szDest); + if (ptr) + lstrcpynW(ptr, lpName, MAX_PATH + 1 - (ptr - szDest)); + } else + lstrcpynW(szDest, lpName, MAX_PATH); + + if(!(dwFlags & SHGDN_FORPARSING) && SHELL_FS_HideExtension(szSrc)) { + WCHAR *ext = PathFindExtensionW(szSrc); + if(*ext != '\0') { + INT len = wcslen(szDest); + lstrcpynW(szDest + len, ext, MAX_PATH - len); + } + } + + if (!memcmp(szSrc, szDest, (wcslen(szDest)+1) * sizeof(WCHAR))) + { + /* src and destination is the same */ + hr = S_OK; + if (pPidlOut) + hr = _ILCreateFromPathW(szDest, pPidlOut); + + return hr; + } + + TRACE ("src=%s dest=%s\n", debugstr_w(szSrc), debugstr_w(szDest)); + if (MoveFileW (szSrc, szDest)) + { + hr = S_OK; + + if (pPidlOut) + hr = _ILCreateFromPathW(szDest, pPidlOut); + + SHChangeNotify (bIsFolder ? SHCNE_RENAMEFOLDER : SHCNE_RENAMEITEM, + SHCNF_PATHW, szSrc, szDest); + + return hr; + } return E_FAIL; } - static HRESULT WINAPI ISF_Desktop_fnGetDefaultSearchGUID(IShellFolder2 *iface, GUID * pguid) { @@ -938,7 +993,7 @@ static const IShellFolder2Vtbl vt_MCFldr_ShellFolder2 = ISF_Desktop_fnMapColumnToSCID }; -static inline IGenericSFImpl *impl_from_IPersistFolder2( IPersistFolder2 *iface ) +static LPIGenericSFImpl __inline impl_from_IPersistFolder2( IPersistFolder2 *iface ) { return (IGenericSFImpl *)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpPF2)); } @@ -1024,6 +1079,228 @@ static const IPersistFolder2Vtbl vt_FSFldr_PersistFolder2 = ISF_Desktop_PersistFolder2_fnGetCurFolder, }; +static HRESULT WINAPI +ISF_Desktop_ISFHelper_fnQueryInterface (ISFHelper * iface, REFIID riid, LPVOID * ppvObj) +{ + IGenericSFImpl *This = impl_from_ISFHelper(iface); + + TRACE ("(%p)->(count=%u)\n", This, This->ref); + + return ISF_Desktop_fnQueryInterface ((IShellFolder2*)This, riid, ppvObj); +} + +static ULONG WINAPI +ISF_Desktop_ISFHelper_fnAddRef (ISFHelper * iface) +{ + IGenericSFImpl *This = impl_from_ISFHelper(iface); + + TRACE ("(%p)->(count=%u)\n", This, This->ref); + + return ISF_Desktop_fnAddRef((IShellFolder2*)This); +} + +static ULONG WINAPI +ISF_Desktop_ISFHelper_fnRelease (ISFHelper * iface) +{ + IGenericSFImpl *This = impl_from_ISFHelper(iface); + + TRACE ("(%p)\n", This); + + return ISF_Desktop_fnRelease ((IShellFolder2*)This); +} + +static HRESULT WINAPI +ISF_Desktop_ISFHelper_fnGetUniqueName (ISFHelper * iface, LPWSTR pwszName, UINT uLen) +{ + IGenericSFImpl *This = impl_from_ISFHelper(iface); + IEnumIDList *penum; + HRESULT hr; + WCHAR wszText[MAX_PATH]; + WCHAR wszNewFolder[25]; + const WCHAR wszFormat[] = {'%','s',' ','%','d',0 }; + + LoadStringW(shell32_hInstance, IDS_NEWFOLDER, wszNewFolder, sizeof(wszNewFolder)/sizeof(WCHAR)); + + TRACE ("(%p)(%p %u)\n", This, pwszName, uLen); + + if (uLen < sizeof(wszNewFolder)/sizeof(WCHAR) + 3) + return E_POINTER; + + lstrcpynW (pwszName, wszNewFolder, uLen); + + hr = IShellFolder_EnumObjects ((IShellFolder2*)This, 0, + SHCONTF_FOLDERS | SHCONTF_NONFOLDERS | SHCONTF_INCLUDEHIDDEN, &penum); + if (penum) { + LPITEMIDLIST pidl; + DWORD dwFetched; + int i = 1; + +next: + IEnumIDList_Reset (penum); + while (S_OK == IEnumIDList_Next (penum, 1, &pidl, &dwFetched) && + dwFetched) { + _ILSimpleGetTextW (pidl, wszText, MAX_PATH); + if (0 == lstrcmpiW (wszText, pwszName)) { + _snwprintf (pwszName, uLen, wszFormat, wszNewFolder, i++); + if (i > 99) { + hr = E_FAIL; + break; + } + goto next; + } + } + + IEnumIDList_Release (penum); + } + return hr; +} + +static HRESULT WINAPI +ISF_Desktop_ISFHelper_fnAddFolder (ISFHelper * iface, HWND hwnd, LPCWSTR pwszName, + LPITEMIDLIST * ppidlOut) +{ + IGenericSFImpl *This = impl_from_ISFHelper(iface); + WCHAR wszNewDir[MAX_PATH]; + DWORD bRes; + HRESULT hres = E_FAIL; + + TRACE ("(%p)(%s %p)\n", This, debugstr_w(pwszName), ppidlOut); + + wszNewDir[0] = 0; + if (This->sPathTarget) + lstrcpynW(wszNewDir, This->sPathTarget, MAX_PATH); + PathAppendW(wszNewDir, pwszName); + bRes = CreateDirectoryW (wszNewDir, NULL); + if (bRes) + { + SHChangeNotify (SHCNE_MKDIR, SHCNF_PATHW, wszNewDir, NULL); + hres = S_OK; + if (ppidlOut) + hres = _ILCreateFromPathW(wszNewDir, ppidlOut); + } + + return hres; +} +static HRESULT WINAPI +ISF_Desktop_ISFHelper_fnDeleteItems (ISFHelper * iface, UINT cidl, LPCITEMIDLIST * apidl) +{ + IGenericSFImpl *This = impl_from_ISFHelper(iface); + UINT i; + SHFILEOPSTRUCTW op; + WCHAR wszPath[MAX_PATH]; + WCHAR wszCaption[50]; + WCHAR *wszPathsList; + HRESULT ret; + WCHAR *wszCurrentPath; + UINT bRestoreWithDeskCpl = FALSE; + int res; + + TRACE ("(%p)(%u %p)\n", This, cidl, apidl); + if (cidl==0) return S_OK; + + for(i = 0; i < cidl; i++) + { + if (_ILIsMyComputer(apidl[i])) + bRestoreWithDeskCpl++; + else if (_ILIsNetHood(apidl[i])) + bRestoreWithDeskCpl++; + else if (_ILIsMyDocuments(apidl[i])) + bRestoreWithDeskCpl++; + } + + if (bRestoreWithDeskCpl) + { + /* FIXME use FormatMessage + * use a similar message resource as in windows + */ + LoadStringW(shell32_hInstance, IDS_DELETEMULTIPLE_TEXT, wszPath, sizeof(wszPath)/sizeof(WCHAR)); + wszPath[(sizeof(wszPath)/sizeof(WCHAR))-1] = 0; + + LoadStringW(shell32_hInstance, IDS_DELETEITEM_CAPTION, wszCaption, sizeof(wszCaption)/sizeof(WCHAR)); + wszCaption[(sizeof(wszCaption)/sizeof(WCHAR))-1] = 0; + + res = SHELL_ConfirmMsgBox(GetActiveWindow(), wszPath, wszCaption, NULL, cidl > 1); + if (res == IDD_YESTOALL || res == IDYES) + { + for(i = 0; i < cidl; i++) + { + if (_ILIsMyComputer(apidl[i])) + SetNamespaceExtensionVisibleStatus(L"{20D04FE0-3AEA-1069-A2D8-08002B30309D}", 0x1); + else if (_ILIsNetHood(apidl[i])) + SetNamespaceExtensionVisibleStatus(L"{208D2C60-3AEA-1069-A2D7-08002B30309D}", 0x1); + else if (_ILIsMyDocuments(apidl[i])) + SetNamespaceExtensionVisibleStatus(L"{450D8FBA-AD25-11D0-98A8-0800361B1103}", 0x1); + } + } + } + if (This->sPathTarget) + lstrcpynW(wszPath, This->sPathTarget, MAX_PATH); + else + wszPath[0] = '\0'; + + PathAddBackslashW(wszPath); + wszPathsList = build_paths_list(wszPath, cidl, apidl); + + ZeroMemory(&op, sizeof(op)); + op.hwnd = GetActiveWindow(); + op.wFunc = FO_DELETE; + op.pFrom = wszPathsList; + op.fFlags = FOF_ALLOWUNDO; + if (SHFileOperationW(&op)) + { + WARN("SHFileOperation failed\n"); + ret = E_FAIL; + } + else + ret = S_OK; + + /* we currently need to manually send the notifies */ + wszCurrentPath = wszPathsList; + for (i = 0; i < cidl; i++) + { + LONG wEventId; + + if (_ILIsFolder(apidl[i])) + wEventId = SHCNE_RMDIR; + else if (_ILIsValue(apidl[i])) + wEventId = SHCNE_DELETE; + else + continue; + + /* check if file exists */ + if (GetFileAttributesW(wszCurrentPath) == INVALID_FILE_ATTRIBUTES) + { + LPITEMIDLIST pidl = ILCombine(This->pidlRoot, apidl[i]); + SHChangeNotify(wEventId, SHCNF_IDLIST, pidl, NULL); + SHFree(pidl); + } + + wszCurrentPath += wcslen(wszCurrentPath)+1; + } + HeapFree(GetProcessHeap(), 0, wszPathsList); + return ret; +} + +static HRESULT WINAPI +ISF_Desktop_ISFHelper_fnCopyItems (ISFHelper * iface, IShellFolder * pSFFrom, UINT cidl, LPCITEMIDLIST * apidl) +{ + IGenericSFImpl *This = impl_from_ISFHelper(iface); + + TRACE ("(%p)->(%p,%u,%p)\n", This, pSFFrom, cidl, apidl); + return E_NOTIMPL; +} + +static const ISFHelperVtbl vt_FSFldr_ISFHelper = +{ + ISF_Desktop_ISFHelper_fnQueryInterface, + ISF_Desktop_ISFHelper_fnAddRef, + ISF_Desktop_ISFHelper_fnRelease, + ISF_Desktop_ISFHelper_fnGetUniqueName, + ISF_Desktop_ISFHelper_fnAddFolder, + ISF_Desktop_ISFHelper_fnDeleteItems, + ISF_Desktop_ISFHelper_fnCopyItems +}; + /************************************************************************** * ISF_Desktop_Constructor @@ -1055,9 +1332,10 @@ HRESULT WINAPI ISF_Desktop_Constructor ( sf->ref = 1; sf->lpVtbl = &vt_MCFldr_ShellFolder2; sf->lpPF2 = &vt_FSFldr_PersistFolder2; + sf->lpvtblSFHelper = &vt_FSFldr_ISFHelper; sf->pidlRoot = _ILCreateDesktop(); /* my qualified pidl */ - sf->sPathTarget = SHAlloc( (lstrlenW(szMyPath) + 1)*sizeof(WCHAR) ); - lstrcpyW( sf->sPathTarget, szMyPath ); + sf->sPathTarget = SHAlloc( (wcslen(szMyPath) + 1)*sizeof(WCHAR) ); + wcscpy( sf->sPathTarget, szMyPath ); if (InterlockedCompareExchangePointer((void *)&cached_sf, sf, NULL) != NULL) { diff --git a/reactos/dll/win32/shell32/shfldr_fonts.c b/reactos/dll/win32/shell32/shfldr_fonts.c index 10b0595e107..cd54d778feb 100644 --- a/reactos/dll/win32/shell32/shfldr_fonts.c +++ b/reactos/dll/win32/shell32/shfldr_fonts.c @@ -18,33 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - -#include -#include -#include -#include - -#define COBJMACROS -#define NONAMELESSUNION -#define NONAMELESSSTRUCT - -#include "winerror.h" -#include "windef.h" -#include "winbase.h" -#include "winreg.h" - -#include "pidl.h" -#include "enumidlist.h" -#include "undocshell.h" -#include "shell32_main.h" -#include "shresdef.h" -#include "wine/debug.h" -#include "debughlp.h" -#include "shfldr.h" -#include "shlwapi.h" - +#include WINE_DEFAULT_DEBUG_CHANNEL (shell); @@ -61,7 +35,7 @@ typedef struct { /* both paths are parsible from the desktop */ LPITEMIDLIST pidlRoot; /* absolute pidl */ LPCITEMIDLIST apidl; /* currently focused font item */ -} IGenericSFImpl; +} IGenericSFImpl, *LPIGenericSFImpl; static const IShellFolder2Vtbl vt_ShellFolder2; static const IPersistFolder2Vtbl vt_NP_PersistFolder2; @@ -88,9 +62,19 @@ static shvheader FontsSFHeader[] = { #define COLUMN_SIZE 2 #define COLUMN_FILENAME 3 - #define FontsSHELLVIEWCOLUMNS (4) + +static LPIGenericSFImpl __inline impl_from_IPersistFolder2( IPersistFolder2 *iface ) +{ + return (LPIGenericSFImpl)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpVtblPersistFolder2)); +} + +static LPIGenericSFImpl __inline impl_from_IContextMenu2(IContextMenu2 *iface) +{ + return (LPIGenericSFImpl)((char *)iface - FIELD_OFFSET(IGenericSFImpl, lpVtblContextMenuFontItem)); +} + /************************************************************************** * ISF_Fonts_Constructor */ @@ -918,7 +902,7 @@ static HRESULT WINAPI ISF_Fonts_IContextMenu2_QueryContextMenu( UINT idCmdLast, UINT uFlags) { - char szBuffer[30] = {0}; + WCHAR szBuffer[30] = {0}; ULONG Count = 1; _ICOM_THIS_From_IContextMenu2FontItem(IGenericSFImpl, iface); @@ -926,38 +910,38 @@ static HRESULT WINAPI ISF_Fonts_IContextMenu2_QueryContextMenu( TRACE("(%p)->(hmenu=%p indexmenu=%x cmdfirst=%x cmdlast=%x flags=%x )\n", This, hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags); - if (LoadStringA(shell32_hInstance, IDS_OPEN, szBuffer, sizeof(szBuffer)/sizeof(char))) + if (LoadStringW(shell32_hInstance, IDS_OPEN, szBuffer, sizeof(szBuffer)/sizeof(WCHAR))) { szBuffer[(sizeof(szBuffer)/sizeof(char))-1] = L'\0'; - _InsertMenuItem(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_STRING, szBuffer, MFS_DEFAULT); + _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_STRING, szBuffer, MFS_DEFAULT); Count++; } - if (LoadStringA(shell32_hInstance, IDS_PRINT_VERB, szBuffer, sizeof(szBuffer)/sizeof(char))) + if (LoadStringW(shell32_hInstance, IDS_PRINT_VERB, szBuffer, sizeof(szBuffer)/sizeof(WCHAR))) { szBuffer[(sizeof(szBuffer)/sizeof(char))-1] = L'\0'; - _InsertMenuItem(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_STRING, szBuffer, MFS_ENABLED); + _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_STRING, szBuffer, MFS_ENABLED); } - if (LoadStringA(shell32_hInstance, IDS_COPY, szBuffer, sizeof(szBuffer)/sizeof(char))) + if (LoadStringW(shell32_hInstance, IDS_COPY, szBuffer, sizeof(szBuffer)/sizeof(WCHAR))) { - szBuffer[(sizeof(szBuffer)/sizeof(char))-1] = L'\0'; - _InsertMenuItem(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_SEPARATOR, NULL, MFS_ENABLED); - _InsertMenuItem(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_STRING, szBuffer, MFS_ENABLED); + szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0'; + _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_SEPARATOR, NULL, MFS_ENABLED); + _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_STRING, szBuffer, MFS_ENABLED); } - if (LoadStringA(shell32_hInstance, IDS_DELETE, szBuffer, sizeof(szBuffer)/sizeof(char))) + if (LoadStringW(shell32_hInstance, IDS_DELETE, szBuffer, sizeof(szBuffer)/sizeof(WCHAR))) { - szBuffer[(sizeof(szBuffer)/sizeof(char))-1] = L'\0'; - _InsertMenuItem(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_SEPARATOR, NULL, MFS_ENABLED); - _InsertMenuItem(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_STRING, szBuffer, MFS_ENABLED); + szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0'; + _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_SEPARATOR, NULL, MFS_ENABLED); + _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_STRING, szBuffer, MFS_ENABLED); } - if (LoadStringA(shell32_hInstance, IDS_PROPERTIES, szBuffer, sizeof(szBuffer)/sizeof(char))) + if (LoadStringW(shell32_hInstance, IDS_PROPERTIES, szBuffer, sizeof(szBuffer)/sizeof(WCHAR))) { - szBuffer[(sizeof(szBuffer)/sizeof(char))-1] = L'\0'; - _InsertMenuItem(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_SEPARATOR, NULL, MFS_ENABLED); - _InsertMenuItem(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_STRING, szBuffer, MFS_ENABLED); + szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0'; + _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_SEPARATOR, NULL, MFS_ENABLED); + _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_STRING, szBuffer, MFS_ENABLED); } return MAKE_HRESULT(SEVERITY_SUCCESS, 0, Count); @@ -971,24 +955,25 @@ static HRESULT WINAPI ISF_Fonts_IContextMenu2_InvokeCommand( IContextMenu2 *iface, LPCMINVOKECOMMANDINFO lpcmi) { - _ICOM_THIS_From_IContextMenu2FontItem(IGenericSFImpl, iface); SHELLEXECUTEINFOW sei; PIDLFontStruct * pfont; SHFILEOPSTRUCTW op; + IGenericSFImpl * This = impl_from_IContextMenu2(iface); + TRACE("(%p)->(invcom=%p verb=%p wnd=%p)\n",This,lpcmi,lpcmi->lpVerb, lpcmi->hwnd); - if (lpcmi->lpVerb == MAKEINTRESOURCE(1) || lpcmi->lpVerb == MAKEINTRESOURCE(2) || lpcmi->lpVerb == MAKEINTRESOURCE(7)) + if (lpcmi->lpVerb == MAKEINTRESOURCEA(1) || lpcmi->lpVerb == MAKEINTRESOURCEA(2) || lpcmi->lpVerb == MAKEINTRESOURCEA(7)) { ZeroMemory(&sei, sizeof(sei)); sei.cbSize = sizeof(sei); sei.hwnd = lpcmi->hwnd; sei.nShow = SW_SHOWNORMAL; - if (lpcmi->lpVerb == MAKEINTRESOURCE(1)) + if (lpcmi->lpVerb == MAKEINTRESOURCEA(1)) sei.lpVerb = L"open"; - else if (lpcmi->lpVerb == MAKEINTRESOURCE(2)) + else if (lpcmi->lpVerb == MAKEINTRESOURCEA(2)) sei.lpVerb = L"print"; - else if (lpcmi->lpVerb == MAKEINTRESOURCE(7)) + else if (lpcmi->lpVerb == MAKEINTRESOURCEA(7)) sei.lpVerb = L"properties"; pfont = _ILGetFontStruct(This->apidl); @@ -998,12 +983,12 @@ static HRESULT WINAPI ISF_Fonts_IContextMenu2_InvokeCommand( if (sei.hInstApp <= (HINSTANCE)32) return E_FAIL; } - else if (lpcmi->lpVerb == MAKEINTRESOURCE(4)) + else if (lpcmi->lpVerb == MAKEINTRESOURCEA(4)) { FIXME("implement font copying\n"); return E_NOTIMPL; } - else if (lpcmi->lpVerb == MAKEINTRESOURCE(6)) + else if (lpcmi->lpVerb == MAKEINTRESOURCEA(6)) { ZeroMemory(&op, sizeof(op)); op.hwnd = lpcmi->hwnd; diff --git a/reactos/dll/win32/shell32/shfldr_fs.c b/reactos/dll/win32/shell32/shfldr_fs.c index 4046bb2e1a2..072e6748eec 100644 --- a/reactos/dll/win32/shell32/shfldr_fs.c +++ b/reactos/dll/win32/shell32/shfldr_fs.c @@ -20,38 +20,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - -#include -#include -#include -#include - -#define COBJMACROS -#define NONAMELESSUNION -#define NONAMELESSSTRUCT - -#include "winerror.h" -#include "windef.h" -#include "winbase.h" -#include "winreg.h" -#include "wingdi.h" -#include "winuser.h" - -#include "ole2.h" -#include "shlguid.h" - -#include "enumidlist.h" -#include "pidl.h" -#include "undocshell.h" -#include "shell32_main.h" -#include "shresdef.h" -#include "shlwapi.h" -#include "shellfolder.h" -#include "wine/debug.h" -#include "debughlp.h" -#include "shfldr.h" +#include WINE_DEFAULT_DEBUG_CHANNEL (shell); @@ -78,7 +47,7 @@ typedef struct { UINT cfShellIDList; /* clipboardformat for IDropTarget */ BOOL fAcceptFmt; /* flag for pending Drop */ -} IGenericSFImpl; +} IGenericSFImpl, *LPIGenericSFImpl; static const IUnknownVtbl unkvt; static const IShellFolder2Vtbl sfvt; @@ -86,24 +55,24 @@ static const IPersistFolder3Vtbl vt_FSFldr_PersistFolder3; /* IPersistFolder3 fo static const IDropTargetVtbl dtvt; static const ISFHelperVtbl shvt; -static inline IGenericSFImpl *impl_from_IShellFolder2( IShellFolder2 *iface ) +static LPIGenericSFImpl __inline impl_from_IShellFolder2( IShellFolder2 *iface ) { - return (IGenericSFImpl *)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpvtblShellFolder)); + return (LPIGenericSFImpl)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpvtblShellFolder)); } -static inline IGenericSFImpl *impl_from_IPersistFolder3( IPersistFolder3 *iface ) +static LPIGenericSFImpl __inline impl_from_IPersistFolder3( IPersistFolder3 *iface ) { - return (IGenericSFImpl *)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpvtblPersistFolder3)); + return (LPIGenericSFImpl)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpvtblPersistFolder3)); } -static inline IGenericSFImpl *impl_from_IDropTarget( IDropTarget *iface ) +static LPIGenericSFImpl __inline impl_from_IDropTarget( IDropTarget *iface ) { - return (IGenericSFImpl *)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpvtblDropTarget)); + return (LPIGenericSFImpl)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpvtblDropTarget)); } -static inline IGenericSFImpl *impl_from_ISFHelper( ISFHelper *iface ) +static LPIGenericSFImpl __inline impl_from_ISFHelper( ISFHelper *iface ) { - return (IGenericSFImpl *)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpvtblSFHelper)); + return (LPIGenericSFImpl)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpvtblSFHelper)); } @@ -405,7 +374,7 @@ IShellFolder_fnParseDisplayName (IShellFolder2 * iface, /* build the full pathname to the element */ lstrcpynW(szPath, This->sPathTarget, MAX_PATH - 1); PathAddBackslashW(szPath); - len = lstrlenW(szPath); + len = wcslen(szPath); lstrcpynW(szPath + len, szElement, MAX_PATH - len); /* get the pidl */ @@ -653,10 +622,17 @@ IShellFolder_fnGetUIObjectOf (IShellFolder2 * iface, if (IsEqualIID (riid, &IID_IContextMenu) && (cidl >= 1)) { hr = CDefFolderMenu_Create2(This->pidlRoot, hwndOwner, cidl, apidl, (IShellFolder*)iface, NULL, 0, NULL, (IContextMenu**)&pObj); - } else if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1)) { + } else if (IsEqualIID (riid, &IID_IDataObject)){ + if (cidl >= 1) { pObj = (LPUNKNOWN) IDataObject_Constructor (hwndOwner, This->pidlRoot, apidl, cidl); hr = S_OK; + } + else + { + pObj = (LPUNKNOWN) IDataObject_Constructor (hwndOwner, This->pidlRoot, (LPCITEMIDLIST*)&This->pidlRoot, 1); + hr = S_OK; + } } else if (IsEqualIID (riid, &IID_IExtractIconA) && (cidl == 1)) { pidl = ILCombine (This->pidlRoot, apidl[0]); pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl); @@ -801,7 +777,7 @@ IShellFolder_fnGetDisplayNameOf (IShellFolder2 * iface, LPCITEMIDLIST pidl, { lstrcpynW(pszPath, This->sPathTarget, MAX_PATH); PathAddBackslashW(pszPath); - len = lstrlenW(pszPath); + len = wcslen(pszPath); } _ILSimpleGetTextW(pidl, pszPath + len, MAX_PATH + 1 - len); if (!_ILIsFolder(pidl)) SHELL_FS_ProcessDisplayFilename(pszPath, dwFlags); @@ -873,12 +849,22 @@ static HRESULT WINAPI IShellFolder_fnSetNameOf (IShellFolder2 * iface, if(!(dwFlags & SHGDN_FORPARSING) && SHELL_FS_HideExtension(szSrc)) { WCHAR *ext = PathFindExtensionW(szSrc); if(*ext != '\0') { - INT len = strlenW(szDest); + INT len = wcslen(szDest); lstrcpynW(szDest + len, ext, MAX_PATH - len); } } TRACE ("src=%s dest=%s\n", debugstr_w(szSrc), debugstr_w(szDest)); + if (!memcmp(szSrc, szDest, (wcslen(szDest)+1) * sizeof(WCHAR))) + { + /* src and destination is the same */ + HRESULT hr = S_OK; + if (pPidlOut) + hr = _ILCreateFromPathW(szDest, pPidlOut); + + return hr; + } + if (MoveFileW (szSrc, szDest)) { HRESULT hr = S_OK; @@ -1103,7 +1089,7 @@ next: dwFetched) { _ILSimpleGetTextW (pidl, wszText, MAX_PATH); if (0 == lstrcmpiW (wszText, pwszName)) { - snprintfW (pwszName, uLen, wszFormat, wszNewFolder, i++); + _snwprintf (pwszName, uLen, wszFormat, wszNewFolder, i++); if (i > 99) { hr = E_FAIL; break; @@ -1157,7 +1143,7 @@ ISFHelper_fnAddFolder (ISFHelper * iface, HWND hwnd, LPCWSTR pwszName, sizeof (wszTempText)); LoadStringW (shell32_hInstance, IDS_CREATEFOLDER_CAPTION, wszCaption, sizeof (wszCaption)); - sprintfW (wszText, wszTempText, wszNewDir); + swprintf (wszText, wszTempText, wszNewDir); MessageBoxW (hwnd, wszText, wszCaption, MB_OK | MB_ICONEXCLAMATION); } @@ -1177,7 +1163,7 @@ WCHAR *build_paths_list(LPCWSTR wszBasePath, int cidl, LPCITEMIDLIST *pidls) int iPathLen; int i; - iPathLen = lstrlenW(wszBasePath); + iPathLen = wcslen(wszBasePath); wszPathsList = HeapAlloc(GetProcessHeap(), 0, MAX_PATH*sizeof(WCHAR)*cidl+1); wszListPos = wszPathsList; @@ -1188,7 +1174,7 @@ WCHAR *build_paths_list(LPCWSTR wszBasePath, int cidl, LPCITEMIDLIST *pidls) lstrcpynW(wszListPos, wszBasePath, MAX_PATH); /* FIXME: abort if path too long */ _ILSimpleGetTextW(pidls[i], wszListPos+iPathLen, MAX_PATH-iPathLen); - wszListPos += lstrlenW(wszListPos)+1; + wszListPos += wcslen(wszListPos)+1; } *wszListPos=0; return wszPathsList; @@ -1254,7 +1240,7 @@ ISFHelper_fnDeleteItems (ISFHelper * iface, UINT cidl, LPCITEMIDLIST * apidl) SHFree(pidl); } - wszCurrentPath += lstrlenW(wszCurrentPath)+1; + wszCurrentPath += wcslen(wszCurrentPath)+1; } HeapFree(GetProcessHeap(), 0, wszPathsList); return ret; @@ -1269,39 +1255,109 @@ static HRESULT WINAPI ISFHelper_fnCopyItems (ISFHelper * iface, IShellFolder * pSFFrom, UINT cidl, LPCITEMIDLIST * apidl) { - UINT i; IPersistFolder2 *ppf2 = NULL; - char szSrcPath[MAX_PATH], - szDstPath[MAX_PATH]; + WCHAR szSrcPath[MAX_PATH]; + WCHAR szTargetPath[MAX_PATH]; + SHFILEOPSTRUCTW op; + LPITEMIDLIST pidl; + LPWSTR pszSrc, pszTarget, pszSrcList, pszTargetList; + int res; + STRRET strRet; IGenericSFImpl *This = impl_from_ISFHelper(iface); TRACE ("(%p)->(%p,%u,%p)\n", This, pSFFrom, cidl, apidl); - IShellFolder_QueryInterface (pSFFrom, &IID_IPersistFolder2, - (LPVOID *) & ppf2); - if (ppf2) { - LPITEMIDLIST pidl; - - if (SUCCEEDED (IPersistFolder2_GetCurFolder (ppf2, &pidl))) { - for (i = 0; i < cidl; i++) { - SHGetPathFromIDListA (pidl, szSrcPath); - PathAddBackslashA (szSrcPath); - _ILSimpleGetText (apidl[i], szSrcPath + strlen (szSrcPath), - MAX_PATH); - - if (!WideCharToMultiByte(CP_ACP, 0, This->sPathTarget, -1, szDstPath, MAX_PATH, NULL, NULL)) - szDstPath[0] = '\0'; - PathAddBackslashA (szDstPath); - _ILSimpleGetText (apidl[i], szDstPath + strlen (szDstPath), - MAX_PATH); - MESSAGE ("would copy %s to %s\n", szSrcPath, szDstPath); - } - SHFree (pidl); + IShellFolder_QueryInterface (pSFFrom, &IID_IPersistFolder2, (LPVOID *) & ppf2); + if (ppf2) + { + if (FAILED(IPersistFolder2_GetCurFolder (ppf2, &pidl))) + { + IPersistFolder2_Release(ppf2); + return E_FAIL; } - IPersistFolder2_Release (ppf2); + IPersistFolder2_Release(ppf2); + + if (FAILED(IShellFolder_GetDisplayNameOf(pSFFrom, pidl, SHGDN_FORPARSING, &strRet))) + { + SHFree (pidl); + return E_FAIL; + } + + if (FAILED(StrRetToBufW(&strRet, pidl, szSrcPath, MAX_PATH))) + { + SHFree (pidl); + return E_FAIL; + } + SHFree (pidl); + + pszSrc = PathAddBackslashW (szSrcPath); + + wcscpy(szTargetPath, This->sPathTarget); + pszTarget = PathAddBackslashW (szTargetPath); + + pszSrcList = build_paths_list(szSrcPath, cidl, apidl); + pszTargetList = build_paths_list(szTargetPath, cidl, apidl); + + if (!pszSrcList || !pszTargetList) + { + if (pszSrcList) + HeapFree(GetProcessHeap(), 0, pszSrcList); + + if (pszTargetList) + HeapFree(GetProcessHeap(), 0, pszTargetList); + + SHFree (pidl); + IPersistFolder2_Release (ppf2); + return E_OUTOFMEMORY; + } + ZeroMemory(&op, sizeof(op)); + if (!pszSrcList[0]) + { + /* remove trailing backslash */ + pszSrc--; + pszSrc[0] = L'\0'; + op.pFrom = szSrcPath; + } + else + { + op.pFrom = pszSrcList; + } + + if (!pszTargetList[0]) + { + /* remove trailing backslash */ + if (pszTarget - szTargetPath > 3) + { + pszTarget--; + pszTarget[0] = L'\0'; + } + else + { + pszTarget[1] = L'\0'; + } + + op.pTo = szTargetPath; + } + else + { + op.pTo = pszTargetList; + } + op.hwnd = GetActiveWindow(); + op.wFunc = FO_COPY; + op.fFlags = FOF_ALLOWUNDO | FOF_NOCONFIRMMKDIR; + + res = SHFileOperationW(&op); + + HeapFree(GetProcessHeap(), 0, pszSrc); + HeapFree(GetProcessHeap(), 0, pszTarget); + + if (res) + return E_FAIL; + else + return S_OK; } - return S_OK; + return E_FAIL; } static const ISFHelperVtbl shvt = @@ -1398,7 +1454,7 @@ IFSFldr_PersistFolder3_Initialize (IPersistFolder3 * iface, LPCITEMIDLIST pidl) /* set my path */ if (SHGetPathFromIDListW (pidl, wszTemp)) { - int len = strlenW(wszTemp); + int len = wcslen(wszTemp); This->sPathTarget = SHAlloc((len + 1) * sizeof(WCHAR)); if (!This->sPathTarget) return E_OUTOFMEMORY; @@ -1468,14 +1524,14 @@ IFSFldr_PersistFolder3_InitializeEx (IPersistFolder3 * iface, if (ppfti->csidl != -1) { if (SHGetSpecialFolderPathW (0, wszTemp, ppfti->csidl, ppfti->csidl & CSIDL_FLAG_CREATE)) { - int len = strlenW(wszTemp); + int len = wcslen(wszTemp); This->sPathTarget = SHAlloc((len + 1) * sizeof(WCHAR)); if (!This->sPathTarget) return E_OUTOFMEMORY; memcpy(This->sPathTarget, wszTemp, (len + 1) * sizeof(WCHAR)); } } else if (ppfti->szTargetParsingName[0]) { - int len = strlenW(ppfti->szTargetParsingName); + int len = wcslen(ppfti->szTargetParsingName); This->sPathTarget = SHAlloc((len + 1) * sizeof(WCHAR)); if (!This->sPathTarget) return E_OUTOFMEMORY; @@ -1483,7 +1539,7 @@ IFSFldr_PersistFolder3_InitializeEx (IPersistFolder3 * iface, (len + 1) * sizeof(WCHAR)); } else if (ppfti->pidlTargetFolder) { if (SHGetPathFromIDListW(ppfti->pidlTargetFolder, wszTemp)) { - int len = strlenW(wszTemp); + int len = wcslen(wszTemp); This->sPathTarget = SHAlloc((len + 1) * sizeof(WCHAR)); if (!This->sPathTarget) return E_OUTOFMEMORY; diff --git a/reactos/dll/win32/shell32/shfldr_mycomp.c b/reactos/dll/win32/shell32/shfldr_mycomp.c index b54e7d2e9ee..7bd7daa9214 100644 --- a/reactos/dll/win32/shell32/shfldr_mycomp.c +++ b/reactos/dll/win32/shell32/shfldr_mycomp.c @@ -19,34 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - -#include -#include -#include -#include - -#define COBJMACROS -#define NONAMELESSUNION -#define NONAMELESSSTRUCT - -#include "winerror.h" -#include "windef.h" -#include "winbase.h" -#include "winreg.h" - -#include "wingdi.h" -#include "pidl.h" -#include "shlguid.h" -#include "enumidlist.h" -#include "undocshell.h" -#include "shell32_main.h" -#include "shresdef.h" -#include "shlwapi.h" -#include "wine/debug.h" -#include "debughlp.h" -#include "shfldr.h" +#include WINE_DEFAULT_DEBUG_CHANNEL (shell); @@ -62,14 +35,14 @@ typedef struct { /* both paths are parsible from the desktop */ LPITEMIDLIST pidlRoot; /* absolute pidl */ LPWSTR sName; -} IGenericSFImpl; +} IGenericSFImpl, *LPIGenericSFImpl; static const IShellFolder2Vtbl vt_ShellFolder2; static const IPersistFolder2Vtbl vt_PersistFolder2; -static inline IGenericSFImpl *impl_from_IPersistFolder2( IPersistFolder2 *iface ) +static LPIGenericSFImpl __inline impl_from_IPersistFolder2( IPersistFolder2 *iface ) { - return (IGenericSFImpl *)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpVtblPersistFolder2)); + return (LPIGenericSFImpl)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpVtblPersistFolder2)); } @@ -137,10 +110,10 @@ HRESULT WINAPI ISF_MyComputer_Constructor (IUnknown * pUnkOuter, REFIID riid, LP &dwSize) == ERROR_SUCCESS) { szName[MAX_PATH-1] = 0; - sf->sName = SHAlloc((strlenW(szName)+1) * sizeof(WCHAR)); + sf->sName = SHAlloc((wcslen(szName)+1) * sizeof(WCHAR)); if (sf->sName) { - lstrcpyW( sf->sName, szName ); + wcscpy( sf->sName, szName ); } TRACE("sName %s\n", debugstr_w(sf->sName)); } @@ -239,7 +212,7 @@ static HRESULT WINAPI ISF_MyComputer_fnParseDisplayName (IShellFolder2 *iface, { szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH); TRACE ("-- element: %s\n", debugstr_w (szElement)); - SHCLSIDFromStringW (szElement + 2, &clsid); + CLSIDFromString (szElement + 2, &clsid); pidlTemp = _ILCreateGuid (PT_GUID, &clsid); } /* do we have an absolute path name ? */ @@ -451,6 +424,9 @@ static HRESULT WINAPI ISF_MyComputer_fnGetAttributesOf (IShellFolder2 * iface, { IGenericSFImpl *This = (IGenericSFImpl *)iface; HRESULT hr = S_OK; + static const DWORD dwComputerAttributes = + SFGAO_STORAGE | SFGAO_HASPROPSHEET | SFGAO_STORAGEANCESTOR | SFGAO_CANCOPY | + SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER | SFGAO_CANRENAME | SFGAO_CANDELETE; TRACE ("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n", This, cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0); @@ -463,15 +439,8 @@ static HRESULT WINAPI ISF_MyComputer_fnGetAttributesOf (IShellFolder2 * iface, if (*rgfInOut == 0) *rgfInOut = ~0; - if(cidl == 0){ - IShellFolder *psfParent = NULL; - LPCITEMIDLIST rpidl = NULL; - - hr = SHBindToParent(This->pidlRoot, &IID_IShellFolder, (LPVOID*)&psfParent, (LPCITEMIDLIST*)&rpidl); - if(SUCCEEDED(hr)) { - SHELL32_GetItemAttributes (psfParent, rpidl, rgfInOut); - IShellFolder_Release(psfParent); - } + if(cidl == 0) { + *rgfInOut &= dwComputerAttributes; } else { while (cidl > 0 && *apidl) { pdump (*apidl); @@ -628,9 +597,9 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface, * Get the "WantsFORPARSING" flag from the registry */ - lstrcpyW (szRegPath, clsidW); + wcscpy (szRegPath, clsidW); SHELL32_GUIDToStringW (clsid, &szRegPath[6]); - lstrcatW (szRegPath, shellfolderW); + wcscat (szRegPath, shellfolderW); r = SHGetValueW (HKEY_CLASSES_ROOT, szRegPath, wantsForParsingW, NULL, NULL, NULL); if (r == ERROR_SUCCESS) @@ -669,7 +638,7 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface, /* user friendly name */ if (_ILIsMyComputer(pidl) && This->sName) - strcpyW(pszPath, This->sName); + wcscpy(pszPath, This->sName); else HCR_GetClassNameW (clsid, pszPath, MAX_PATH); @@ -726,10 +695,10 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface, pszPath[MAX_PATH-7] = L'\0'; } } - strcatW (pszPath, wszOpenBracket); + wcscat (pszPath, wszOpenBracket); wszDrive[2] = L'\0'; - strcatW (pszPath, wszDrive); - strcatW (pszPath, wszCloseBracket); + wcscat (pszPath, wszDrive); + wcscat (pszPath, wszCloseBracket); } } else @@ -778,16 +747,29 @@ static HRESULT WINAPI ISF_MyComputer_fnSetNameOf ( LPWSTR sName; HKEY hKey; UINT length; + WCHAR szName[30]; TRACE ("(%p)->(%p,pidl=%p,%s,%u,%p)\n", This, hwndOwner, pidl, debugstr_w (lpName), dwFlags, pPidlOut); + if (_ILIsDrive(pidl)) + { + if (_ILSimpleGetTextW(pidl, szName, sizeof(szName)/sizeof(WCHAR))) + { + SetVolumeLabelW(szName, lpName); + } + if (pPidlOut) + *pPidlOut = _ILCreateDrive(szName); + return S_OK; + } + + if (pPidlOut != NULL) { *pPidlOut = _ILCreateMyComputer(); } - length = (strlenW(lpName)+1) * sizeof(WCHAR); + length = (wcslen(lpName)+1) * sizeof(WCHAR); sName = SHAlloc(length); if (!sName) @@ -809,7 +791,7 @@ static HRESULT WINAPI ISF_MyComputer_fnSetNameOf ( RegCloseKey(hKey); } - lstrcpyW(sName, lpName); + wcscpy(sName, lpName); SHFree(This->sName); This->sName = sName; TRACE("result %s\n", debugstr_w(This->sName)); @@ -1021,7 +1003,12 @@ static HRESULT WINAPI IMCFldr_PersistFolder2_Initialize ( { IGenericSFImpl *This = impl_from_IPersistFolder2(iface); TRACE ("(%p)->(%p)\n", This, pidl); - return E_NOTIMPL; + + if (This->pidlRoot) + SHFree((LPVOID)This->pidlRoot); + + This->pidlRoot = ILClone(pidl); + return S_OK; } /************************************************************************** diff --git a/reactos/dll/win32/shell32/shfldr_mydocuments.c b/reactos/dll/win32/shell32/shfldr_mydocuments.c index 94a680b5a6c..d45ba8dff0a 100644 --- a/reactos/dll/win32/shell32/shfldr_mydocuments.c +++ b/reactos/dll/win32/shell32/shfldr_mydocuments.c @@ -19,38 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - -#include -#include -#include -#include - -#define COBJMACROS -#define NONAMELESSUNION -#define NONAMELESSSTRUCT - -#include "winerror.h" -#include "windef.h" -#include "winbase.h" -#include "winreg.h" -#include "wingdi.h" -#include "winuser.h" - -#include "ole2.h" -#include "shlguid.h" - -#include "enumidlist.h" -#include "pidl.h" -#include "undocshell.h" -#include "shell32_main.h" -#include "shresdef.h" -#include "shlwapi.h" -#include "shellfolder.h" -#include "wine/debug.h" -#include "debughlp.h" -#include "shfldr.h" +#include WINE_DEFAULT_DEBUG_CHANNEL (mydocs); @@ -69,7 +38,7 @@ typedef struct { UINT cfShellIDList; /* clipboardformat for IDropTarget */ BOOL fAcceptFmt; /* flag for pending Drop */ -} IGenericSFImpl; +} IGenericSFImpl, *LPIGenericSFImpl; #define _IUnknown_(This) (IShellFolder*)&(This->lpVtbl) #define _IShellFolder_(This) (IShellFolder*)&(This->lpVtbl) @@ -175,7 +144,7 @@ WINAPI ISF_MyDocuments_fnParseDisplayName (IShellFolder2 * iface, { szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH); TRACE ("-- element: %s\n", debugstr_w (szElement)); - SHCLSIDFromStringW (szElement + 2, &clsid); + CLSIDFromString (szElement + 2, &clsid); pidlTemp = _ILCreateGuid (PT_GUID, &clsid); } else if( (pidlTemp = SHELL32_CreatePidlFromBindCtx(pbc, lpszDisplayName)) ) @@ -368,8 +337,8 @@ static HRESULT WINAPI ISF_MyDocuments_fnGetAttributesOf (IShellFolder2 * iface, IGenericSFImpl *This = (IGenericSFImpl *)iface; HRESULT hr = S_OK; static const DWORD dwMyDocumentsAttributes = - SFGAO_STORAGE | SFGAO_HASPROPSHEET | SFGAO_STORAGEANCESTOR | - SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER; + SFGAO_STORAGE | SFGAO_HASPROPSHEET | SFGAO_STORAGEANCESTOR | SFGAO_CANCOPY | + SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER | SFGAO_CANRENAME | SFGAO_CANDELETE; TRACE ("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n", This, cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0); @@ -506,7 +475,7 @@ WINAPI ISF_MyDocuments_fnGetDisplayNameOf (IShellFolder2 * iface, { if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) && (GET_SHGDN_FOR (dwFlags) & SHGDN_FORPARSING)) - strcpyW(pszPath, This->sPathTarget); + wcscpy(pszPath, This->sPathTarget); else HCR_GetClassNameW(&CLSID_MyDocuments, pszPath, MAX_PATH); TRACE("CP\n"); @@ -545,9 +514,9 @@ WINAPI ISF_MyDocuments_fnGetDisplayNameOf (IShellFolder2 * iface, WCHAR szRegPath[100]; LONG r; - lstrcpyW (szRegPath, clsidW); + wcscpy (szRegPath, clsidW); SHELL32_GUIDToStringW (clsid, &szRegPath[6]); - lstrcatW (szRegPath, shellfolderW); + wcscat (szRegPath, shellfolderW); r = SHGetValueW(HKEY_CLASSES_ROOT, szRegPath, wantsForParsingW, NULL, NULL, NULL); if (r == ERROR_SUCCESS) @@ -599,7 +568,7 @@ WINAPI ISF_MyDocuments_fnGetDisplayNameOf (IShellFolder2 * iface, if (!_ILIsDesktop(pidl)) { PathAddBackslashW(pszPath); - cLen = lstrlenW(pszPath); + cLen = wcslen(pszPath); _ILSimpleGetTextW(pidl, pszPath + cLen, MAX_PATH - cLen); if (!_ILIsFolder(pidl)) { @@ -787,9 +756,9 @@ static const IShellFolder2Vtbl vt_MCFldr_ShellFolder2 = ISF_MyDocuments_fnMapColumnToSCID }; -static inline IGenericSFImpl *impl_from_IPersistFolder2( IPersistFolder2 *iface ) +static LPIGenericSFImpl __inline impl_from_IPersistFolder2( IPersistFolder2 *iface ) { - return (IGenericSFImpl *)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpPF2)); + return (LPIGenericSFImpl)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpPF2)); } static HRESULT WINAPI @@ -904,8 +873,8 @@ HRESULT WINAPI ISF_MyDocuments_Constructor ( sf->lpVtbl = &vt_MCFldr_ShellFolder2; sf->lpPF2 = &vt_FSFldr_PersistFolder2; sf->pidlRoot = _ILCreateMyDocuments(); /* my qualified pidl */ - sf->sPathTarget = SHAlloc( (lstrlenW(szMyPath) + 1)*sizeof(WCHAR) ); - lstrcpyW( sf->sPathTarget, szMyPath ); + sf->sPathTarget = SHAlloc( (wcslen(szMyPath) + 1)*sizeof(WCHAR) ); + wcscpy( sf->sPathTarget, szMyPath ); if (InterlockedCompareExchangePointer((void *)&cached_sf, sf, NULL) != NULL) { diff --git a/reactos/dll/win32/shell32/shfldr_netplaces.c b/reactos/dll/win32/shell32/shfldr_netplaces.c index adf27f33fb6..31722d2c7c5 100644 --- a/reactos/dll/win32/shell32/shfldr_netplaces.c +++ b/reactos/dll/win32/shell32/shfldr_netplaces.c @@ -20,32 +20,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - -#include -#include -#include -#include - -#define COBJMACROS -#define NONAMELESSUNION -#define NONAMELESSSTRUCT - -#include "winerror.h" -#include "windef.h" -#include "winbase.h" -#include "winreg.h" - -#include "pidl.h" -#include "enumidlist.h" -#include "undocshell.h" -#include "shell32_main.h" -#include "shresdef.h" -#include "wine/debug.h" -#include "debughlp.h" -#include "shfldr.h" -#include "shlwapi.h" +#include WINE_DEFAULT_DEBUG_CHANNEL (shell); @@ -317,6 +292,9 @@ static HRESULT WINAPI ISF_NetworkPlaces_fnGetAttributesOf (IShellFolder2 * iface UINT cidl, LPCITEMIDLIST * apidl, DWORD * rgfInOut) { IGenericSFImpl *This = (IGenericSFImpl *)iface; + static const DWORD dwNethoodAttributes = + SFGAO_STORAGE | SFGAO_HASPROPSHEET | SFGAO_STORAGEANCESTOR | + SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER | SFGAO_CANRENAME | SFGAO_CANDELETE; HRESULT hr = S_OK; TRACE ("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n", This, @@ -330,17 +308,8 @@ static HRESULT WINAPI ISF_NetworkPlaces_fnGetAttributesOf (IShellFolder2 * iface if (*rgfInOut == 0) *rgfInOut = ~0; - if (cidl == 0) - { - IShellFolder *psfParent = NULL; - LPCITEMIDLIST rpidl = NULL; - - hr = SHBindToParent(This->pidlRoot, &IID_IShellFolder, (LPVOID*)&psfParent, (LPCITEMIDLIST*)&rpidl); - if(SUCCEEDED(hr)) - { - SHELL32_GetItemAttributes (psfParent, rpidl, rgfInOut); - IShellFolder_Release(psfParent); - } + if(cidl == 0) { + *rgfInOut = dwNethoodAttributes; } else { @@ -392,8 +361,7 @@ static HRESULT WINAPI ISF_NetworkPlaces_fnGetUIObjectOf (IShellFolder2 * iface, if (IsEqualIID (riid, &IID_IContextMenu) && (cidl >= 1)) { - pObj = (LPUNKNOWN) ISvItemCm_Constructor ((IShellFolder *) iface, This->pidlRoot, apidl, cidl); - hr = S_OK; + hr = CDefFolderMenu_Create2(This->pidlRoot, hwndOwner, cidl, apidl, (IShellFolder*)iface, NULL, 0, NULL, (IContextMenu**)&pObj); } else if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1)) { diff --git a/reactos/dll/win32/shell32/shfldr_printers.c b/reactos/dll/win32/shell32/shfldr_printers.c index 9e31aa2abee..e8596bbab23 100644 --- a/reactos/dll/win32/shell32/shfldr_printers.c +++ b/reactos/dll/win32/shell32/shfldr_printers.c @@ -20,40 +20,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "config.h" -#include "wine/port.h" - -#include -#include -#include -#include - -#define COBJMACROS -#define NONAMELESSUNION -#define NONAMELESSSTRUCT - -#include "winerror.h" -#include "windef.h" -#include "winbase.h" -#include "winreg.h" -#include "wingdi.h" -#include "winuser.h" -#include "winspool.h" - -#include "ole2.h" -#include "shlguid.h" - -#include "enumidlist.h" -#include "pidl.h" -#include "undocshell.h" -#include "shell32_main.h" -#include "shresdef.h" -#include "shlwapi.h" -#include "shellfolder.h" -#include "wine/debug.h" -#include "debughlp.h" -#include "shfldr.h" -#include "shresdef.h" +#include WINE_DEFAULT_DEBUG_CHANNEL (shell); @@ -117,7 +84,7 @@ static HRESULT WINAPI IEI_Printers_fnQueryInterface(IExtractIconW *iface, REFIID if(*ppvObj) { - IExtractIconW_AddRef((IExtractIconW*) *ppvObj); + ((IExtractIconW*)*ppvObj)->lpVtbl->AddRef(*ppvObj); TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj); return S_OK; } @@ -225,7 +192,7 @@ static HRESULT WINAPI IEIA_Printers_fnQueryInterface(IExtractIconA * iface, REFI { _ICOM_THIS_From_IExtractIconA(IExtractIconW, iface); - return IExtractIconW_QueryInterface(This, riid, ppvObj); + return This->lpVtbl->QueryInterface(This, riid, ppvObj); } /************************************************************************** @@ -235,7 +202,7 @@ static ULONG WINAPI IEIA_Printers_fnAddRef(IExtractIconA * iface) { _ICOM_THIS_From_IExtractIconA(IExtractIconW, iface); - return IExtractIconW_AddRef(This); + return This->lpVtbl->AddRef(This); } /************************************************************************** * IExtractIconA_Release @@ -244,7 +211,7 @@ static ULONG WINAPI IEIA_Printers_fnRelease(IExtractIconA * iface) { _ICOM_THIS_From_IExtractIconA(IExtractIconW, iface); - return IExtractIconW_AddRef(This); + return This->lpVtbl->AddRef(This); } /************************************************************************** @@ -264,7 +231,7 @@ static HRESULT WINAPI IEIA_Printers_fnGetIconLocation( TRACE("(%p) (flags=%u %p %u %p %p)\n", This, uFlags, szIconFile, cchMax, piIndex, pwFlags); - ret = IExtractIconW_GetIconLocation(This, uFlags, lpwstrFile, cchMax, piIndex, pwFlags); + ret = This->lpVtbl->GetIconLocation(This, uFlags, lpwstrFile, cchMax, piIndex, pwFlags); WideCharToMultiByte(CP_ACP, 0, lpwstrFile, -1, szIconFile, cchMax, NULL, NULL); HeapFree(GetProcessHeap(), 0, lpwstrFile); @@ -286,7 +253,7 @@ static HRESULT WINAPI IEIA_Printers_fnExtract(IExtractIconA *iface, LPCSTR pszFi TRACE("(%p) (file=%p index=%u %p %p size=%u)\n", This, pszFile, nIconIndex, phiconLarge, phiconSmall, nIconSize); MultiByteToWideChar(CP_ACP, 0, pszFile, -1, lpwstrFile, len); - ret = IExtractIconW_Extract(This, lpwstrFile, nIconIndex, phiconLarge, phiconSmall, nIconSize); + ret = This->lpVtbl->Extract(This, lpwstrFile, nIconIndex, phiconLarge, phiconSmall, nIconSize); HeapFree(GetProcessHeap(), 0, lpwstrFile); return ret; } @@ -923,8 +890,11 @@ static HRESULT WINAPI IPF_Printers_Initialize ( IPersistFolder2 * iface, LPCITEMIDLIST pidl) { _ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface); - FIXME ("(%p)->(%p): stub\n", This, pidl); - return E_NOTIMPL; + if (This->pidlRoot) + SHFree((LPVOID)This->pidlRoot); + + This->pidlRoot = ILClone(pidl); + return S_OK; } /************************************************************************** diff --git a/reactos/dll/win32/shell32/shfldr_recyclebin.c b/reactos/dll/win32/shell32/shfldr_recyclebin.c index aae4772cdf5..8f713e07c4f 100644 --- a/reactos/dll/win32/shell32/shfldr_recyclebin.c +++ b/reactos/dll/win32/shell32/shfldr_recyclebin.c @@ -18,31 +18,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#define COBJMACROS -#define NONAMELESSUNION -#define NONAMELESSSTRUCT #define MAX_PROPERTY_SHEET_PAGE 32 -#include - -#include "winerror.h" -#include "windef.h" -#include "winbase.h" -#include "winreg.h" -#include "winuser.h" -#include "ntquery.h" -#include "shlwapi.h" -#include "shlobj.h" -#include "shresdef.h" -#include "pidl.h" -#include "wine/debug.h" - -#include "shell32_main.h" -#include "enumidlist.h" -#include "xdg.h" -#include "recyclebin.h" -#include +#include WINE_DEFAULT_DEBUG_CHANNEL(recyclebin); @@ -88,14 +66,10 @@ typedef struct tagRecycleBin const IContextMenu2Vtbl *lpContextMenu2; const IShellExtInitVtbl *lpSEI; LONG refCount; - - INT iIdOpen; INT iIdEmpty; - INT iIdProperties; - LPITEMIDLIST pidl; LPCITEMIDLIST apidl; -} RecycleBin; +} RecycleBin, *LPRecycleBin; typedef struct { @@ -118,17 +92,17 @@ static const IShellFolder2Vtbl recycleBinVtbl; static const IPersistFolder2Vtbl recycleBinPersistVtbl; static const IShellExtInitVtbl eivt; -static RecycleBin *impl_from_IContextMenu2(IContextMenu2 *iface) +static LPRecycleBin __inline impl_from_IContextMenu2(IContextMenu2 *iface) { return (RecycleBin *)((char *)iface - FIELD_OFFSET(RecycleBin, lpContextMenu2)); } -static RecycleBin *impl_from_IPersistFolder(IPersistFolder2 *iface) +static LPRecycleBin __inline impl_from_IPersistFolder(IPersistFolder2 *iface) { return (RecycleBin *)((char *)iface - FIELD_OFFSET(RecycleBin, lpPersistFolderVtbl)); } -static inline RecycleBin *impl_from_IShellExtInit( IShellExtInit *iface ) +static LPRecycleBin __inline impl_from_IShellExtInit( IShellExtInit *iface ) { return (RecycleBin *)((char*)iface - FIELD_OFFSET(RecycleBin, lpSEI)); } @@ -180,12 +154,12 @@ static HRESULT WINAPI RecycleBin_QueryInterface(IShellFolder2 *iface, REFIID rii || IsEqualGUID(riid, &IID_IPersistFolder2)) *ppvObject = &This->lpPersistFolderVtbl; - if (IsEqualIID(riid, &IID_IContextMenu) || IsEqualGUID(riid, &IID_IContextMenu2)) + else if (IsEqualIID(riid, &IID_IContextMenu) || IsEqualGUID(riid, &IID_IContextMenu2)) { This->lpContextMenu2 = &recycleBincmVtblFolder; *ppvObject = &This->lpContextMenu2; } - if(IsEqualIID(riid, &IID_IShellExtInit)) + else if(IsEqualIID(riid, &IID_IShellExtInit)) { *ppvObject = &(This->lpSEI); } @@ -533,10 +507,12 @@ static HRESULT WINAPI RecycleBin_GetDisplayNameOf(IShellFolder2 *This, LPCITEMID { WCHAR pszPath[100]; - HCR_GetClassNameW(&CLSID_RecycleBin, pszPath, MAX_PATH); - pName->uType = STRRET_WSTR; - pName->u.pOleStr = StrDupW(pszPath); - return S_OK; + if (HCR_GetClassNameW(&CLSID_RecycleBin, pszPath, MAX_PATH)) + { + pName->uType = STRRET_WSTR; + pName->u.pOleStr = StrDupW(pszPath); + return S_OK; + } } pFileDetails = _ILGetRecycleStruct(pidl); @@ -672,12 +648,12 @@ static HRESULT WINAPI RecycleBin_GetDetailsOf(IShellFolder2 *iface, LPCITEMIDLIS break; case COLUMN_TYPE: szTypeName[0] = L'\0'; - lstrcpyW(buffer,PathFindExtensionW(pFileDetails->szName)); + wcscpy(buffer,PathFindExtensionW(pFileDetails->szName)); if (!( HCR_MapTypeToValueW(buffer, buffer, sizeof(buffer)/sizeof(WCHAR), TRUE) && HCR_MapTypeToValueW(buffer, szTypeName, sizeof(szTypeName)/sizeof(WCHAR), FALSE ))) { - lstrcpyW (szTypeName, PathFindExtensionW(pFileDetails->szName)); - strcatW(szTypeName, L"-"); + wcscpy (szTypeName, PathFindExtensionW(pFileDetails->szName)); + wcscat(szTypeName, L"-"); Length = wcslen(szTypeName); if (LoadStringW(shell32_hInstance, IDS_SHV_COLUMN1, &szTypeName[Length], (sizeof(szTypeName)/sizeof(WCHAR))- Length)) szTypeName[(sizeof(szTypeName)/sizeof(WCHAR))-1] = L'\0'; @@ -747,6 +723,7 @@ static HRESULT WINAPI RecycleBin_IPersistFolder2_Initialize(IPersistFolder2 *ifa RecycleBin *This = impl_from_IPersistFolder(iface); TRACE("(%p, %p)\n", This, pidl); + SHFree((LPVOID)This->pidl); This->pidl = ILClone(pidl); if (This->pidl == NULL) return E_OUTOFMEMORY; @@ -874,31 +851,19 @@ RecycleBin_IContextMenu2Folder_QueryContextMenu( IContextMenu2* iface, HMENU hme memset( &mii, 0, sizeof(mii) ); mii.cbSize = sizeof(mii); mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE; - szBuffer[0] = L'\0'; - LoadStringW(shell32_hInstance, IDS_OPEN, szBuffer, sizeof(szBuffer)/sizeof(WCHAR)); - szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0'; - mii.dwTypeData = (LPWSTR)szBuffer; - mii.cch = strlenW( mii.dwTypeData ); - mii.wID = idCmdFirst + id++; - mii.fState = MFS_ENABLED; - mii.fType = MFT_STRING; - - if (!InsertMenuItemW( hmenu, indexMenu, TRUE, &mii )) - return E_FAIL; - This->iIdOpen = 1; - mii.fState = MFS_ENABLED; szBuffer[0] = L'\0'; LoadStringW(shell32_hInstance, IDS_EMPTY_BITBUCKET, szBuffer, sizeof(szBuffer)/sizeof(WCHAR)); szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0'; - mii.cch = strlenW( mii.dwTypeData ); + mii.dwTypeData = szBuffer; + mii.cch = wcslen( mii.dwTypeData ); mii.wID = idCmdFirst + id++; - if (!InsertMenuItemW( hmenu, idCmdLast, TRUE, &mii )) - { - TRACE("RecycleBin_IContextMenu2Folder_QueryContextMenu failed to insert item properties"); + mii.fType = MFT_STRING; + This->iIdEmpty = 1; + + if (!InsertMenuItemW( hmenu, indexMenu, TRUE, &mii )) return E_FAIL; - } - This->iIdEmpty = 2; + return MAKE_HRESULT( SEVERITY_SUCCESS, 0, id ); } @@ -908,7 +873,6 @@ RecycleBin_IContextMenu2Folder_InvokeCommand( IContextMenu2* iface, LPCMINVOKECO HRESULT hr; LPSHELLBROWSER lpSB; LPSHELLVIEW lpSV = NULL; - RecycleBin * This = impl_from_IContextMenu2(iface); TRACE("%p %p verb %p\n", This, lpici, lpici->lpVerb); @@ -932,15 +896,6 @@ RecycleBin_IContextMenu2Folder_InvokeCommand( IContextMenu2* iface, LPCMINVOKECO } } } - - - if ( LOWORD(lpici->lpVerb) == This->iIdProperties) - { - WCHAR szDrive = 'C'; - SH_ShowRecycleBinProperties(szDrive); - return S_OK; - } - return S_OK; } @@ -1036,7 +991,7 @@ static HRESULT WINAPI RecycleBin_IContextMenu2Item_QueryContextMenu( UINT idCmdLast, UINT uFlags) { - char szBuffer[30] = {0}; + WCHAR szBuffer[30] = {0}; ULONG Count = 1; RecycleBin * This = impl_from_IContextMenu2(iface); @@ -1044,32 +999,32 @@ static HRESULT WINAPI RecycleBin_IContextMenu2Item_QueryContextMenu( TRACE("(%p)->(hmenu=%p indexmenu=%x cmdfirst=%x cmdlast=%x flags=%x )\n", This, hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags); - if (LoadStringA(shell32_hInstance, IDS_RESTORE, szBuffer, sizeof(szBuffer)/sizeof(char))) + if (LoadStringW(shell32_hInstance, IDS_RESTORE, szBuffer, sizeof(szBuffer)/sizeof(WCHAR))) { - szBuffer[(sizeof(szBuffer)/sizeof(char))-1] = L'\0'; - _InsertMenuItem(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_STRING, szBuffer, MFS_ENABLED); + szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0'; + _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_STRING, szBuffer, MFS_ENABLED); Count++; } - if (LoadStringA(shell32_hInstance, IDS_CUT, szBuffer, sizeof(szBuffer)/sizeof(char))) + if (LoadStringW(shell32_hInstance, IDS_CUT, szBuffer, sizeof(szBuffer)/sizeof(WCHAR))) { - _InsertMenuItem(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_SEPARATOR, NULL, MFS_ENABLED); - szBuffer[(sizeof(szBuffer)/sizeof(char))-1] = L'\0'; - _InsertMenuItem(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_STRING, szBuffer, MFS_ENABLED); + _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_SEPARATOR, NULL, MFS_ENABLED); + szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0'; + _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_STRING, szBuffer, MFS_ENABLED); } - if (LoadStringA(shell32_hInstance, IDS_DELETE, szBuffer, sizeof(szBuffer)/sizeof(char))) + if (LoadStringW(shell32_hInstance, IDS_DELETE, szBuffer, sizeof(szBuffer)/sizeof(char))) { - szBuffer[(sizeof(szBuffer)/sizeof(char))-1] = L'\0'; - _InsertMenuItem(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_SEPARATOR, NULL, MFS_ENABLED); - _InsertMenuItem(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_STRING, szBuffer, MFS_ENABLED); + szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0'; + _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_SEPARATOR, NULL, MFS_ENABLED); + _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_STRING, szBuffer, MFS_ENABLED); } - if (LoadStringA(shell32_hInstance, IDS_PROPERTIES, szBuffer, sizeof(szBuffer)/sizeof(char))) + if (LoadStringW(shell32_hInstance, IDS_PROPERTIES, szBuffer, sizeof(szBuffer)/sizeof(WCHAR))) { - szBuffer[(sizeof(szBuffer)/sizeof(char))-1] = L'\0'; - _InsertMenuItem(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_SEPARATOR, NULL, MFS_ENABLED); - _InsertMenuItem(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_STRING, szBuffer, MFS_DEFAULT); + szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0'; + _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count++, MFT_SEPARATOR, NULL, MFS_ENABLED); + _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_STRING, szBuffer, MFS_DEFAULT); } return MAKE_HRESULT(SEVERITY_SUCCESS, 0, Count); @@ -1090,7 +1045,7 @@ static HRESULT WINAPI RecycleBin_IContextMenu2Item_InvokeCommand( TRACE("(%p)->(invcom=%p verb=%p wnd=%p)\n",This,lpcmi,lpcmi->lpVerb, lpcmi->hwnd); - if (lpcmi->lpVerb == MAKEINTRESOURCE(1) || lpcmi->lpVerb == MAKEINTRESOURCE(5)) + if (lpcmi->lpVerb == MAKEINTRESOURCEA(1) || lpcmi->lpVerb == MAKEINTRESOURCEA(5)) { Context.pFileDetails = _ILGetRecycleStruct(This->apidl); Context.bFound = FALSE; @@ -1099,7 +1054,7 @@ static HRESULT WINAPI RecycleBin_IContextMenu2Item_InvokeCommand( if (!Context.bFound) return E_FAIL; - if (lpcmi->lpVerb == MAKEINTRESOURCE(1)) + if (lpcmi->lpVerb == MAKEINTRESOURCEA(1)) { /* restore file */ if (RestoreFile(Context.hDeletedFile)) @@ -1113,12 +1068,12 @@ static HRESULT WINAPI RecycleBin_IContextMenu2Item_InvokeCommand( return E_NOTIMPL; } } - else if (lpcmi->lpVerb == MAKEINTRESOURCE(3)) + else if (lpcmi->lpVerb == MAKEINTRESOURCEA(3)) { FIXME("implement cut\n"); return E_NOTIMPL; } - else if (lpcmi->lpVerb == MAKEINTRESOURCE(7)) + else if (lpcmi->lpVerb == MAKEINTRESOURCEA(7)) { FIXME("implement properties\n"); return E_NOTIMPL; @@ -1229,18 +1184,18 @@ InitializeBitBucketDlg(HWND hwndDlg, WCHAR DefaultDrive) lc.iSubItem = 0; lc.fmt = LVCFMT_FIXED_WIDTH; lc.cx = columnSize; - lc.cchTextMax = lstrlenW(szVolume); + lc.cchTextMax = wcslen(szVolume); lc.pszText = szVolume; - (void)ListView_InsertColumnW(hDlgCtrl, 0, &lc); + (void)SendMessageW(hDlgCtrl, LVM_INSERTCOLUMNW, 0, (LPARAM)&lc); if (!LoadStringW(shell32_hInstance, IDS_RECYCLEBIN_DISKSPACE, szVolume, sizeof(szVolume) / sizeof(WCHAR))) szVolume[0] = 0; lc.iSubItem = 1; lc.cx = rect.right - rect.left - columnSize; - lc.cchTextMax = lstrlenW(szVolume); + lc.cchTextMax = wcslen(szVolume); lc.pszText = szVolume; - (void)ListView_InsertColumnW(hDlgCtrl, 1, &lc); + (void)SendMessageW(hDlgCtrl, LVM_INSERTCOLUMNW, 1, (LPARAM)&lc); dwDrives = GetLogicalDrives(); itemCount = 0; @@ -1257,13 +1212,13 @@ InitializeBitBucketDlg(HWND hwndDlg, WCHAR DefaultDrive) dwSerial = -1; } - sprintfW(szVolume, L"%s (%c)", szName, szDrive[0]); + swprintf(szVolume, L"%s (%c)", szName, szDrive[0]); memset(&li, 0x0, sizeof(LVITEMW)); li.mask = LVIF_TEXT | LVIF_PARAM; li.iSubItem = 0; li.pszText = szVolume; li.iItem = itemCount; - (void)ListView_InsertItemW(hDlgCtrl, &li); + (void)SendMessageW(hDlgCtrl, LVM_INSERTCOLUMN, 0, (LPARAM)&li); if (GetDiskFreeSpaceExW(szDrive, &FreeBytesAvailable , &TotalNumberOfBytes, &TotalNumberOfFreeBytes)) { if (StrFormatByteSizeW(TotalNumberOfFreeBytes.QuadPart, szVolume, sizeof(szVolume) / sizeof(WCHAR))) @@ -1272,7 +1227,7 @@ InitializeBitBucketDlg(HWND hwndDlg, WCHAR DefaultDrive) pItem = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DRIVE_ITEM_CONTEXT)); if (pItem) { - sprintfW(szName, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Bitbucket\\Volume\\%04X-%04X", LOWORD(dwSerial), HIWORD(dwSerial)); + swprintf(szName, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Bitbucket\\Volume\\%04X-%04X", LOWORD(dwSerial), HIWORD(dwSerial)); dwSize = sizeof(DWORD); RegGetValueW(HKEY_CURRENT_USER, szName, L"MaxCapacity", RRF_RT_DWORD, NULL, &pItem->dwMaxCapacity, &dwSize); dwSize = sizeof(DWORD); @@ -1280,7 +1235,7 @@ InitializeBitBucketDlg(HWND hwndDlg, WCHAR DefaultDrive) pItem->dwSerial = dwSerial; li.mask = LVIF_PARAM; li.lParam = (LPARAM)pItem; - (void)ListView_SetItemW(hDlgCtrl, &li); + (void)SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&li); if (CurDrive == DefaultDrive) { defIndex = itemCount; @@ -1294,7 +1249,7 @@ InitializeBitBucketDlg(HWND hwndDlg, WCHAR DefaultDrive) li.iSubItem = 1; li.pszText = szVolume; li.iItem = itemCount; - (void)ListView_SetItemW(hDlgCtrl, &li); + (void)SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&li); } } itemCount++; @@ -1317,7 +1272,7 @@ InitializeBitBucketDlg(HWND hwndDlg, WCHAR DefaultDrive) li.stateMask = (UINT)-1; li.state = LVIS_FOCUSED|LVIS_SELECTED; li.iItem = defIndex; - (void)ListView_SetItemW(hDlgCtrl, &li); + (void)SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&li); } @@ -1343,10 +1298,10 @@ static BOOL StoreDriveSettings(HWND hwndDlg) for(iIndex = 0; iIndex < iCount; iIndex++) { li.iItem = iIndex; - if (ListView_GetItemW(hDlgCtrl, &li)) + if (SendMessageW(hDlgCtrl, LVM_GETITEMW, 0, (LPARAM)&li)) { pItem = (PDRIVE_ITEM_CONTEXT)li.lParam; - sprintfW(szSerial, L"%04X-%04X", LOWORD(pItem->dwSerial), HIWORD(pItem->dwSerial)); + swprintf(szSerial, L"%04X-%04X", LOWORD(pItem->dwSerial), HIWORD(pItem->dwSerial)); if (RegCreateKeyExW(hKey, szSerial, 0, NULL, 0, KEY_WRITE, NULL, &hSubKey, NULL) == ERROR_SUCCESS) { dwSize = sizeof(DWORD); @@ -1376,7 +1331,7 @@ static VOID FreeDriveItemContext(HWND hwndDlg) for(iIndex = 0; iIndex < iCount; iIndex++) { li.iItem = iIndex; - if (ListView_GetItemW(hDlgCtrl, &li)) + if (SendMessageW(hDlgCtrl, LVM_GETITEMW, 0, (LPARAM)&li)) { HeapFree(GetProcessHeap(), 0, (LPVOID)li.lParam); } @@ -1403,7 +1358,7 @@ GetDefaultItem(HWND hwndDlg, LVITEMW * li) for (iIndex = 0; iIndex < iItemCount; iIndex++) { li->iItem = iIndex; - if (ListView_GetItemW(hDlgCtrl, li)) + if (SendMessageW(hDlgCtrl, LVM_GETITEMW, 0, (LPARAM)li)) { if (li->state & LVIS_SELECTED) return iIndex; @@ -1485,7 +1440,7 @@ BitBucketDlg( ZeroMemory(&li, sizeof(li)); li.mask = LVIF_PARAM; li.iItem = lppl->iItem; - if (!ListView_GetItemW(lppl->hdr.hwndFrom, &li)) + if (!SendMessageW(lppl->hdr.hwndFrom, LVM_GETITEMW, 0, (LPARAM)&li)) return TRUE; pItem = (PDRIVE_ITEM_CONTEXT)li.lParam; @@ -1582,7 +1537,7 @@ TRASH_CanTrashFile(LPCWSTR wszPath) return FALSE; } - sprintfW(szBuffer, L"%04X-%04X", LOWORD(VolSerialNumber), HIWORD(VolSerialNumber)); + swprintf(szBuffer, L"%04X-%04X", LOWORD(VolSerialNumber), HIWORD(VolSerialNumber)); wcscat(szKey, szBuffer); if (RegCreateKeyExW(HKEY_CURRENT_USER, szKey, 0, NULL, 0, KEY_WRITE, NULL, &hKey, &dwDisposition) != ERROR_SUCCESS) diff --git a/reactos/dll/win32/shell32/shlexec.c b/reactos/dll/win32/shell32/shlexec.c index ce88e563607..63044eb76a3 100644 --- a/reactos/dll/win32/shell32/shlexec.c +++ b/reactos/dll/win32/shell32/shlexec.c @@ -19,34 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - -#include -#include -#include -#include -#ifdef HAVE_UNISTD_H -# include -#endif -#include -#include - -#define COBJMACROS - -#include "windef.h" -#include "winbase.h" -#include "winerror.h" -#include "winreg.h" -#include "winuser.h" -#include "shlwapi.h" -#include "ddeml.h" - -#include "wine/winbase16.h" -#include "shell32_main.h" -#include "pidl.h" - -#include "wine/debug.h" +#include WINE_DEFAULT_DEBUG_CHANNEL(exec); @@ -129,6 +102,7 @@ static BOOL SHELL_ArgifyW(WCHAR* out, int len, const WCHAR* fmt, const WCHAR* lp used++; if (used < len) *res++ = '"'; + break; } else { @@ -146,7 +120,10 @@ static BOOL SHELL_ArgifyW(WCHAR* out, int len, const WCHAR* fmt, const WCHAR* lp } break; } - /* else fall through */ + else + { + break; + } case '1': if (!done || (*fmt == '1')) { @@ -156,11 +133,11 @@ static BOOL SHELL_ArgifyW(WCHAR* out, int len, const WCHAR* fmt, const WCHAR* lp else cmd = lpFile; - used += strlenW(cmd); + used += wcslen(cmd); if (used < len) { - strcpyW(res, cmd); - res += strlenW(cmd); + wcscpy(res, cmd); + res += wcslen(cmd); } } found_p1 = TRUE; @@ -174,11 +151,11 @@ static BOOL SHELL_ArgifyW(WCHAR* out, int len, const WCHAR* fmt, const WCHAR* lp case 'l': case 'L': if (lpFile) { - used += strlenW(lpFile); + used += wcslen(lpFile); if (used < len) { - strcpyW(res, lpFile); - res += strlenW(lpFile); + wcscpy(res, lpFile); + res += wcslen(lpFile); } } found_p1 = TRUE; @@ -194,13 +171,13 @@ static BOOL SHELL_ArgifyW(WCHAR* out, int len, const WCHAR* fmt, const WCHAR* lp LPVOID pv; HGLOBAL hmem = SHAllocShared(pidl, ILGetSize(pidl), 0); pv = SHLockShared(hmem, 0); - chars = sprintfW(buf, wszILPtr, pv); + chars = swprintf(buf, wszILPtr, pv); if (chars >= sizeof(buf)/sizeof(WCHAR)) ERR("pidl format buffer too small!\n"); used += chars; if (used < len) { - strcpyW(res,buf); + wcscpy(res,buf); res += chars; } SHUnlockShared(pv); @@ -214,7 +191,7 @@ static BOOL SHELL_ArgifyW(WCHAR* out, int len, const WCHAR* fmt, const WCHAR* lp */ /* Make sure that we have at least one more %.*/ - if (strchrW(fmt, '%')) + if (wcschr(fmt, '%')) { WCHAR tmpBuffer[1024]; PWSTR tmpB = tmpBuffer; @@ -230,20 +207,20 @@ static BOOL SHELL_ArgifyW(WCHAR* out, int len, const WCHAR* fmt, const WCHAR* lp envRet = GetEnvironmentVariableW(tmpBuffer, tmpEnvBuff, MAX_PATH); if (envRet == 0 || envRet > MAX_PATH) { - used += strlenW(tmpBuffer); + used += wcslen(tmpBuffer); if (used < len) { - strcpyW( res, tmpBuffer ); - res += strlenW(tmpBuffer); + wcscpy( res, tmpBuffer ); + res += wcslen(tmpBuffer); } } else { - used += strlenW(tmpEnvBuff); + used += wcslen(tmpEnvBuff); if (used < len) { - strcpyW( res, tmpEnvBuff ); - res += strlenW(tmpEnvBuff); + wcscpy( res, tmpEnvBuff ); + res += wcslen(tmpEnvBuff); } } } @@ -375,15 +352,15 @@ static void *SHELL_BuildEnvW( const WCHAR *path ) static const WCHAR wPath[] = {'P','A','T','H','=',0}; WCHAR *strings, *new_env; WCHAR *p, *p2; - int total = strlenW(path) + 1; + int total = wcslen(path) + 1; BOOL got_path = FALSE; if (!(strings = GetEnvironmentStringsW())) return NULL; p = strings; while (*p) { - int len = strlenW(p) + 1; - if (!strncmpiW( p, wPath, 5 )) got_path = TRUE; + int len = wcslen(p) + 1; + if (!wcsnicmp( p, wPath, 5 )) got_path = TRUE; total += len; p += len; } @@ -399,22 +376,22 @@ static void *SHELL_BuildEnvW( const WCHAR *path ) p2 = new_env; while (*p) { - int len = strlenW(p) + 1; + int len = wcslen(p) + 1; memcpy( p2, p, len * sizeof(WCHAR) ); - if (!strncmpiW( p, wPath, 5 )) + if (!wcsnicmp( p, wPath, 5 )) { p2[len - 1] = ';'; - strcpyW( p2 + len, path ); - p2 += strlenW(path) + 1; + wcscpy( p2 + len, path ); + p2 += wcslen(path) + 1; } p += len; p2 += len; } if (!got_path) { - strcpyW( p2, wPath ); - strcatW( p2, path ); - p2 += strlenW(p2) + 1; + wcscpy( p2, wPath ); + wcscat( p2, path ); + p2 += wcslen(p2) + 1; } *p2 = 0; FreeEnvironmentStringsW( strings ); @@ -442,8 +419,8 @@ static BOOL SHELL_TryAppPathW( LPCWSTR szName, LPWSTR lpResult, WCHAR **env) BOOL found = FALSE; if (env) *env = NULL; - strcpyW(buffer, wszKeyAppPaths); - strcatW(buffer, szName); + wcscpy(buffer, wszKeyAppPaths); + wcscat(buffer, szName); res = RegOpenKeyExW(HKEY_LOCAL_MACHINE, buffer, 0, KEY_READ, &hkApp); if (res) goto end; @@ -477,15 +454,15 @@ static UINT SHELL_FindExecutableByOperation(LPCWSTR lpOperation, LPWSTR key, LPW RegCloseKey(hkeyClass); /* Looking for ...buffer\shell\\command */ - strcatW(filetype, wszShell); - strcatW(filetype, verb); - strcatW(filetype, wCommand); + wcscat(filetype, wszShell); + wcscat(filetype, verb); + wcscat(filetype, wCommand); if (RegQueryValueW(HKEY_CLASSES_ROOT, filetype, command, &commandlen) == ERROR_SUCCESS) { commandlen /= sizeof(WCHAR); - if (key) strcpyW(key, filetype); + if (key) wcscpy(key, filetype); #if 0 LPWSTR tmp; WCHAR param[256]; @@ -501,13 +478,13 @@ static UINT SHELL_FindExecutableByOperation(LPCWSTR lpOperation, LPWSTR key, LPW from the associated ddeexec key */ tmp = strstrW(filetype, wCommand); tmp[0] = '\0'; - strcatW(filetype, wDdeexec); + wcscat(filetype, wDdeexec); if (RegQueryValueW(HKEY_CLASSES_ROOT, filetype, param, ¶mlen) == ERROR_SUCCESS) { paramlen /= sizeof(WCHAR); - strcatW(command, wSpace); - strcatW(command, param); + wcscat(command, wSpace); + wcscat(command, param); commandlen += paramlen; } #endif @@ -583,13 +560,13 @@ UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation, attribs = GetFileAttributesW(lpFile); if (attribs!=INVALID_FILE_ATTRIBUTES && (attribs&FILE_ATTRIBUTE_DIRECTORY)) { - strcpyW(filetype, wszFolder); + wcscpy(filetype, wszFolder); filetypelen = 6; /* strlen("Folder") */ } else { /* First thing we need is the file's extension */ - extension = strrchrW(xlpFile, '.'); /* Assume last "." is the one; */ + extension = wcschr(xlpFile, '.'); /* Assume last "." is the one; */ /* File->Run in progman uses */ /* .\FILE.EXE :( */ TRACE("xlpFile=%s,extension=%s\n", debugstr_w(xlpFile), debugstr_w(extension)); @@ -625,9 +602,9 @@ UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation, while (*p == ' ' || *p == '\t') p++; } - if (strcmpiW(tok, &extension[1]) == 0) /* have to skip the leading "." */ + if (wcsicmp(tok, &extension[1]) == 0) /* have to skip the leading "." */ { - strcpyW(lpResult, xlpFile); + wcscpy(lpResult, xlpFile); /* Need to perhaps check that the file has a path * attached */ TRACE("found %s\n", debugstr_w(lpResult)); @@ -699,18 +676,18 @@ UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation, extension++; if (GetProfileStringW(wExtensions, extension, wszEmpty, command, sizeof(command)/sizeof(WCHAR)) > 0) { - if (strlenW(command) != 0) + if (wcslen(command) != 0) { - strcpyW(lpResult, command); - tok = strchrW(lpResult, '^'); /* should be ^.extension? */ + wcscpy(lpResult, command); + tok = wcschr(lpResult, '^'); /* should be ^.extension? */ if (tok != NULL) { tok[0] = '\0'; - strcatW(lpResult, xlpFile); /* what if no dir in xlpFile? */ - tok = strchrW(command, '^'); /* see above */ - if ((tok != NULL) && (strlenW(tok)>5)) + wcscat(lpResult, xlpFile); /* what if no dir in xlpFile? */ + tok = wcschr(command, '^'); /* see above */ + if ((tok != NULL) && (wcslen(tok)>5)) { - strcatW(lpResult, &tok[5]); + wcscat(lpResult, &tok[5]); } } retval = 33; /* FIXME - see above */ @@ -753,7 +730,7 @@ static unsigned dde_connect(WCHAR* key, const WCHAR* start, WCHAR* ddeexec, static const WCHAR wApplication[] = {'\\','a','p','p','l','i','c','a','t','i','o','n',0}; static const WCHAR wTopic[] = {'\\','t','o','p','i','c',0}; WCHAR regkey[256]; - WCHAR * endkey = regkey + strlenW(key); + WCHAR * endkey = regkey + wcslen(key); WCHAR app[256], topic[256], ifexec[256], res[256]; LONG applen, topiclen, ifexeclen; WCHAR * exec; @@ -766,8 +743,8 @@ static unsigned dde_connect(WCHAR* key, const WCHAR* start, WCHAR* ddeexec, unsigned ret = SE_ERR_NOASSOC; BOOL unicode = !(GetVersion() & 0x80000000); - strcpyW(regkey, key); - strcpyW(endkey, wApplication); + wcscpy(regkey, key); + wcscpy(endkey, wApplication); applen = sizeof(app); if (RegQueryValueW(HKEY_CLASSES_ROOT, regkey, app, &applen) != ERROR_SUCCESS) { @@ -780,15 +757,15 @@ static unsigned dde_connect(WCHAR* key, const WCHAR* start, WCHAR* ddeexec, /* Get application command from start string and find filename of application */ if (*start == '"') { - strcpyW(command, start+1); - if ((ptr = strchrW(command, '"'))) + wcscpy(command, start+1); + if ((ptr = wcschr(command, '"'))) *ptr = 0; ret = SearchPathW(NULL, command, wszExe, sizeof(fullpath)/sizeof(WCHAR), fullpath, &ptr); } else { LPWSTR p,space; - for (p=(LPWSTR)start; (space=strchrW(p, ' ')); p=space+1) + for (p=(LPWSTR)start; (space=wcschr(p, ' ')); p=space+1) { int idx = space-start; memcpy(command, start, idx*sizeof(WCHAR)); @@ -805,25 +782,25 @@ static unsigned dde_connect(WCHAR* key, const WCHAR* start, WCHAR* ddeexec, ERR("Unable to find application path for command %s\n", debugstr_w(start)); return ERROR_ACCESS_DENIED; } - strcpyW(app, ptr); + wcscpy(app, ptr); /* Remove extensions (including .so) */ - ptr = app + strlenW(app) - (sizeSo-1); - if (strlenW(app) >= sizeSo && - !strcmpW(ptr, wSo)) + ptr = app + wcslen(app) - (sizeSo-1); + if (wcslen(app) >= sizeSo && + !wcscmp(ptr, wSo)) *ptr = 0; - ptr = strrchrW(app, '.'); + ptr = wcschr(app, '.'); assert(ptr); *ptr = 0; } - strcpyW(endkey, wTopic); + wcscpy(endkey, wTopic); topiclen = sizeof(topic); if (RegQueryValueW(HKEY_CLASSES_ROOT, regkey, topic, &topiclen) != ERROR_SUCCESS) { static const WCHAR wSystem[] = {'S','y','s','t','e','m',0}; - strcpyW(topic, wSystem); + wcscpy(topic, wSystem); } if (unicode) @@ -860,7 +837,7 @@ static unsigned dde_connect(WCHAR* key, const WCHAR* start, WCHAR* ddeexec, SetLastError(ERROR_DDE_FAIL); return 30; /* whatever */ } - strcpyW(endkey, wIfexec); + wcscpy(endkey, wIfexec); ifexeclen = sizeof(ifexec); if (RegQueryValueW(HKEY_CLASSES_ROOT, regkey, ifexec, &ifexeclen) == ERROR_SUCCESS) { @@ -877,7 +854,7 @@ static unsigned dde_connect(WCHAR* key, const WCHAR* start, WCHAR* ddeexec, * error DMLERR_NOTPROCESSED on XTYP_EXECUTE request. */ if (unicode) - hDdeData = DdeClientTransaction((LPBYTE)res, (strlenW(res) + 1) * sizeof(WCHAR), hConv, 0L, 0, + hDdeData = DdeClientTransaction((LPBYTE)res, (wcslen(res) + 1) * sizeof(WCHAR), hConv, 0L, 0, XTYP_EXECUTE, 30000, &tid); else { @@ -939,14 +916,14 @@ static UINT_PTR execute_from_key(LPWSTR key, LPCWSTR lpFile, WCHAR *env, LPCWSTR /* Get the parameters needed by the application from the associated ddeexec key */ - tmp = strstrW(key, wCommand); + tmp = wcsstr(key, wCommand); assert(tmp); - strcpyW(tmp, wDdeexec); + wcscpy(tmp, wDdeexec); if (RegQueryValueW(HKEY_CLASSES_ROOT, key, ddeexec, &ddeexeclen) == ERROR_SUCCESS) { TRACE("Got ddeexec %s => %s\n", debugstr_w(key), debugstr_w(ddeexec)); - if (!param[0]) strcpyW(param, executable_name); + if (!param[0]) wcscpy(param, executable_name); retval = dde_connect(key, param, ddeexec, lpFile, env, szCommandline, psei->lpIDList, execfunc, psei, psei_out); } else if (param[0]) @@ -1298,9 +1275,9 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) static const WCHAR wFile[] = {'f','i','l','e',0}; static const WCHAR wHttp[] = {'h','t','t','p',':','/','/',0}; static const WCHAR wExplorer[] = {'e','x','p','l','o','r','e','r','.','e','x','e',0}; - static const WCHAR wProperties[] = { 'p','r','o','p','e','r','t','i','e','s',0 }; + //static const WCHAR wProperties[] = { 'p','r','o','p','e','r','t','i','e','s',0 }; static const DWORD unsupportedFlags = - SEE_MASK_INVOKEIDLIST | SEE_MASK_ICON | SEE_MASK_HOTKEY | + SEE_MASK_INVOKEIDLIST | SEE_MASK_HOTKEY | SEE_MASK_CONNECTNETDRV | SEE_MASK_FLAG_DDEWAIT | SEE_MASK_FLAG_NO_UI | SEE_MASK_UNICODE | SEE_MASK_ASYNCOK | SEE_MASK_HMONITOR; @@ -1338,7 +1315,7 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) } else if (*sei_tmp.lpFile == '\"') { - DWORD l = strlenW(sei_tmp.lpFile+1); + DWORD l = wcslen(sei_tmp.lpFile+1); if(l >= dwApplicationNameLen) dwApplicationNameLen = l+1; wszApplicationName = HeapAlloc(GetProcessHeap(), 0, dwApplicationNameLen*sizeof(WCHAR)); memcpy(wszApplicationName, sei_tmp.lpFile+1, (l+1)*sizeof(WCHAR)); @@ -1347,19 +1324,19 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) appKnownSingular = TRUE; TRACE("wszApplicationName=%s\n",debugstr_w(wszApplicationName)); } else { - DWORD l = strlenW(sei_tmp.lpFile)+1; + DWORD l = wcslen(sei_tmp.lpFile)+1; if(l > dwApplicationNameLen) dwApplicationNameLen = l+1; wszApplicationName = HeapAlloc(GetProcessHeap(), 0, dwApplicationNameLen*sizeof(WCHAR)); memcpy(wszApplicationName, sei_tmp.lpFile, l*sizeof(WCHAR)); } if (sei_tmp.lpParameters) - strcpyW(wszParameters, sei_tmp.lpParameters); + wcscpy(wszParameters, sei_tmp.lpParameters); else *wszParameters = '\0'; if (sei_tmp.lpDirectory) - strcpyW(wszDir, sei_tmp.lpDirectory); + wcscpy(wszDir, sei_tmp.lpDirectory); else *wszDir = '\0'; @@ -1382,9 +1359,9 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) if (SUCCEEDED(hr)) { - hr = IShellExecuteHookW_Execute(pSEH, &sei_tmp); + hr = pSEH->lpVtbl->Execute(pSEH, &sei_tmp); - IShellExecuteHookW_Release(pSEH); + pSEH->lpVtbl->Release(pSEH); if (hr == S_OK) { HeapFree(GetProcessHeap(), 0, wszApplicationName); @@ -1403,14 +1380,14 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) HeapFree(GetProcessHeap(), 0, wszApplicationName); return TRUE; } - +#if 0 if (sei_tmp.lpVerb && !wcscmp(sei_tmp.lpVerb, wProperties)) { SH_ShowPropertiesDialog(sei_tmp.lpFile); sei->hInstApp = (HINSTANCE) 33; return TRUE; } - +#endif if (sei_tmp.fMask & SEE_MASK_CLASSALL) { /* launch a document by fileclass like 'WordPad.Document.1' */ @@ -1430,8 +1407,8 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) done = SHELL_ArgifyW(wcmd, sizeof(wcmd)/sizeof(WCHAR), wszParameters, wszApplicationName, sei_tmp.lpIDList, NULL, &resultLen); if (!done && wszApplicationName[0]) { - strcatW(wcmd, wSpace); - strcatW(wcmd, wszApplicationName); + wcscat(wcmd, wSpace); + wcscat(wcmd, wszApplicationName); } if (resultLen > sizeof(wcmd)/sizeof(WCHAR)) ERR("Argify buffer not large enough... truncating\n"); @@ -1448,8 +1425,8 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) if (SUCCEEDED(SHELL_GetPathFromIDListForExecuteW(sei_tmp.lpIDList, buffer, sizeof(buffer)))) { if (buffer[0]==':' && buffer[1]==':') { /* open shell folder for the specified class GUID */ - strcpyW(wszParameters, buffer); - strcpyW(wszApplicationName, wExplorer); + wcscpy(wszParameters, buffer); + wcscpy(wszApplicationName, wExplorer); appKnownSingular = TRUE; sei_tmp.fMask &= ~SEE_MASK_INVOKEIDLIST; @@ -1459,7 +1436,7 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) DWORD resultLen; /* Check if we're executing a directory and if so use the handler for the Folder class */ - strcpyW(target, buffer); + wcscpy(target, buffer); attribs = GetFileAttributesW(buffer); if (attribs != INVALID_FILE_ATTRIBUTES && (attribs & FILE_ATTRIBUTE_DIRECTORY) && @@ -1551,7 +1528,7 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) end = src; /* copy the parameter string to 'wszParameters' */ - strcpyW(wszParameters, src); + wcscpy(wszParameters, src); /* terminate previous command string after the quote character */ *end = '\0'; @@ -1564,7 +1541,7 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) LPWSTR space, s; LPWSTR beg = wszApplicationName/*sei_tmp.lpFile*/; - for(s=beg; (space=strchrW(s, ' ')); s=space+1) { + for(s=beg; (space=wcschr(s, ' ')); s=space+1) { int idx = space-sei_tmp.lpFile; memcpy(buffer, sei_tmp.lpFile, idx * sizeof(WCHAR)); buffer[idx] = '\0'; @@ -1575,27 +1552,27 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) /* separate out command from parameter string */ LPCWSTR p = space + 1; - while(isspaceW(*p)) + while(iswspace(*p)) ++p; - strcpyW(wszParameters, p); + wcscpy(wszParameters, p); *space = '\0'; break; } } - strcpyW(wfileName, sei_tmp.lpFile); + wcscpy(wfileName, sei_tmp.lpFile); } } else - strcpyW(wfileName, sei_tmp.lpFile); + wcscpy(wfileName, sei_tmp.lpFile); lpFile = wfileName; - strcpyW(wcmd, wszApplicationName); + wcscpy(wcmd, wszApplicationName); if (sei_tmp.lpParameters[0]) { - strcatW(wcmd, wSpace); - strcatW(wcmd, wszParameters); + wcscat(wcmd, wSpace); + wcscat(wcmd, wszParameters); } retval = execfunc(wcmd, NULL, FALSE, &sei_tmp, sei); @@ -1613,12 +1590,12 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) /* Must quote to handle case where cmd contains spaces, * else security hole if malicious user creates executable file "C:\\Program" */ - strcpyW(wszQuotedCmd, wQuote); - strcatW(wszQuotedCmd, wcmd); - strcatW(wszQuotedCmd, wQuote); + wcscpy(wszQuotedCmd, wQuote); + wcscat(wszQuotedCmd, wcmd); + wcscat(wszQuotedCmd, wQuote); if (wszParameters[0]) { - strcatW(wszQuotedCmd, wSpace); - strcatW(wszQuotedCmd, wszParameters); + wcscat(wszQuotedCmd, wSpace); + wcscat(wszQuotedCmd, wszParameters); } TRACE("%s/%s => %s/%s\n", debugstr_w(wszApplicationName), debugstr_w(sei_tmp.lpVerb), debugstr_w(wszQuotedCmd), debugstr_w(lpstrProtocol)); if (*lpstrProtocol) @@ -1634,23 +1611,23 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) LPWSTR lpstrRes; INT iSize; - lpstrRes = strchrW(lpFile, ':'); + lpstrRes = wcschr(lpFile, ':'); if (lpstrRes) iSize = lpstrRes - lpFile; else - iSize = strlenW(lpFile); + iSize = wcslen(lpFile); TRACE("Got URL: %s\n", debugstr_w(lpFile)); /* Looking for ...protocol\shell\lpOperation\command */ memcpy(lpstrProtocol, lpFile, iSize*sizeof(WCHAR)); lpstrProtocol[iSize] = '\0'; - strcatW(lpstrProtocol, wShell); - strcatW(lpstrProtocol, sei_tmp.lpVerb? sei_tmp.lpVerb: wszOpen); - strcatW(lpstrProtocol, wCommand); + wcscat(lpstrProtocol, wShell); + wcscat(lpstrProtocol, sei_tmp.lpVerb? sei_tmp.lpVerb: wszOpen); + wcscat(lpstrProtocol, wCommand); /* Remove File Protocol from lpFile */ /* In the case file://path/file */ - if (!strncmpiW(lpFile, wFile, iSize)) + if (!wcsnicmp(lpFile, wFile, iSize)) { lpFile += iSize; while (*lpFile == ':') lpFile++; @@ -1658,12 +1635,12 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) retval = execute_from_key(lpstrProtocol, lpFile, NULL, sei_tmp.lpParameters, wcmd, execfunc, &sei_tmp, sei); } /* Check if file specified is in the form www.??????.*** */ - else if (!strncmpiW(lpFile, wWww, 3)) + else if (!wcsnicmp(lpFile, wWww, 3)) { /* if so, append lpFile http:// and call ShellExecute */ WCHAR lpstrTmpFile[256]; - strcpyW(lpstrTmpFile, wHttp); - strcatW(lpstrTmpFile, lpFile); + wcscpy(lpstrTmpFile, wHttp); + wcscat(lpstrTmpFile, lpFile); retval = (UINT_PTR)ShellExecuteW(sei_tmp.hwnd, sei_tmp.lpVerb, lpstrTmpFile, NULL, NULL, 0); } diff --git a/reactos/dll/win32/shell32/shlfileop.c b/reactos/dll/win32/shell32/shlfileop.c index 6f99819e690..11741a81e4c 100644 --- a/reactos/dll/win32/shell32/shlfileop.c +++ b/reactos/dll/win32/shell32/shlfileop.c @@ -21,28 +21,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" +//#define NO_SHLWAPI_STREAM +#include -#include -#include -#include -#include - -#include "windef.h" -#include "winbase.h" -#include "winreg.h" -#include "shellapi.h" -#include "wingdi.h" -#include "winuser.h" -#include "shlobj.h" -#include "shresdef.h" -#define NO_SHLWAPI_STREAM -#include "shlwapi.h" -#include "shell32_main.h" -#include "undocshell.h" -#include "wine/debug.h" -#include "xdg.h" WINE_DEFAULT_DEBUG_CHANNEL(shell); @@ -190,7 +171,7 @@ static INT_PTR CALLBACK ConfirmMsgBoxProc(HWND hDlg, UINT uMsg, WPARAM wParam, L return FALSE; } -static int SHELL_ConfirmMsgBox(HWND hWnd, LPWSTR lpszText, LPWSTR lpszCaption, HICON hIcon, BOOL bYesToAll) +int SHELL_ConfirmMsgBox(HWND hWnd, LPWSTR lpszText, LPWSTR lpszCaption, HICON hIcon, BOOL bYesToAll) { static const WCHAR wszTemplate[] = {'S','H','E','L','L','_','Y','E','S','T','O','A','L','L','_','M','S','G','B','O','X',0}; struct confirm_msg_info info; @@ -660,11 +641,9 @@ static DWORD SHNotifyCopyFileW(LPCWSTR src, LPCWSTR dest, BOOL bFailIfExists) * Win9x exports ANSI * WinNT/2000 exports Unicode */ -DWORD WINAPI SHCreateDirectory(HWND hWnd, LPCVOID path) +DWORD WINAPI SHCreateDirectory(HWND hWnd, LPCWSTR path) { - if (SHELL_OsIsUnicode()) - return SHCreateDirectoryExW(hWnd, path, NULL); - return SHCreateDirectoryExA(hWnd, path, NULL); + return SHCreateDirectoryExW(hWnd, path, NULL); } /************************************************************************* @@ -699,7 +678,7 @@ DWORD WINAPI SHCreateDirectory(HWND hWnd, LPCVOID path) * If hWnd is set to NULL, no user interface is displayed and the function * returns ERROR_CANCELLED. */ -int WINAPI SHCreateDirectoryExA(HWND hWnd, LPCSTR path, LPSECURITY_ATTRIBUTES sec) +int WINAPI SHCreateDirectoryExA(HWND hWnd, LPCSTR path, const SECURITY_ATTRIBUTES *sec) { LPWSTR wPath; DWORD retCode; @@ -720,7 +699,7 @@ int WINAPI SHCreateDirectoryExA(HWND hWnd, LPCSTR path, LPSECURITY_ATTRIBUTES se * * See SHCreateDirectoryExA. */ -int WINAPI SHCreateDirectoryExW(HWND hWnd, LPCWSTR path, LPSECURITY_ATTRIBUTES sec) +int WINAPI SHCreateDirectoryExW(HWND hWnd, LPCWSTR path, const SECURITY_ATTRIBUTES *sec) { int ret = ERROR_BAD_PATHNAME; TRACE("(%p, %s, %p)\n", hWnd, debugstr_w(path), sec); @@ -731,7 +710,7 @@ int WINAPI SHCreateDirectoryExW(HWND hWnd, LPCWSTR path, LPSECURITY_ATTRIBUTES s } else { - ret = SHNotifyCreateDirectoryW(path, sec); + ret = SHNotifyCreateDirectoryW(path, (LPSECURITY_ATTRIBUTES)sec); /* Refuse to work on certain error codes before trying to create directories recursively */ if (ret != ERROR_SUCCESS && ret != ERROR_FILE_EXISTS && @@ -751,7 +730,7 @@ int WINAPI SHCreateDirectoryExW(HWND hWnd, LPCWSTR path, LPSECURITY_ATTRIBUTES s { *pSlash = 0; /* terminate path at separator */ - ret = SHNotifyCreateDirectoryW(szTemp, pSlash + 1 == pEnd ? sec : NULL); + ret = SHNotifyCreateDirectoryW(szTemp, pSlash + 1 == pEnd ? (LPSECURITY_ATTRIBUTES)sec : NULL); } *pSlash++ = '\\'; /* put the separator back */ } @@ -919,7 +898,7 @@ typedef struct } FILE_LIST; -static inline void grow_list(FILE_LIST *list) +static void __inline grow_list(FILE_LIST *list) { FILE_ENTRY *new = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, list->feFiles, list->num_alloc * 2 * sizeof(*new) ); @@ -931,11 +910,11 @@ static inline void grow_list(FILE_LIST *list) */ static void add_file_to_entry(FILE_ENTRY *feFile, LPWSTR szFile) { - DWORD dwLen = lstrlenW(szFile) + 1; + DWORD dwLen = wcslen(szFile) + 1; LPWSTR ptr; feFile->szFullPath = HeapAlloc(GetProcessHeap(), 0, dwLen * sizeof(WCHAR)); - lstrcpyW(feFile->szFullPath, szFile); + wcscpy(feFile->szFullPath, szFile); ptr = StrRChrW(szFile, NULL, '\\'); if (ptr) @@ -944,9 +923,9 @@ static void add_file_to_entry(FILE_ENTRY *feFile, LPWSTR szFile) feFile->szDirectory = HeapAlloc(GetProcessHeap(), 0, dwLen * sizeof(WCHAR)); lstrcpynW(feFile->szDirectory, szFile, dwLen); - dwLen = lstrlenW(feFile->szFullPath) - dwLen + 1; + dwLen = wcslen(feFile->szFullPath) - dwLen + 1; feFile->szFilename = HeapAlloc(GetProcessHeap(), 0, dwLen * sizeof(WCHAR)); - lstrcpyW(feFile->szFilename, ptr + 1); /* skip over backslash */ + wcscpy(feFile->szFilename, ptr + 1); /* skip over backslash */ } feFile->bFromWildcard = FALSE; } @@ -959,11 +938,11 @@ static LPWSTR wildcard_to_file(LPWSTR szWildCard, LPWSTR szFileName) ptr = StrRChrW(szWildCard, NULL, '\\'); dwDirLen = ptr - szWildCard + 1; - dwFullLen = dwDirLen + lstrlenW(szFileName) + 1; + dwFullLen = dwDirLen + wcslen(szFileName) + 1; szFullPath = HeapAlloc(GetProcessHeap(), 0, dwFullLen * sizeof(WCHAR)); lstrcpynW(szFullPath, szWildCard, dwDirLen + 1); - lstrcatW(szFullPath, szFileName); + wcscat(szFullPath, szFileName); return szFullPath; } @@ -1030,7 +1009,7 @@ static HRESULT parse_file_list(FILE_LIST *flList, LPCWSTR szFiles) } else { - lstrcpyW(szCurFile, ptr); + wcscpy(szCurFile, ptr); flList->feFiles[i].bFromRelative = FALSE; } @@ -1052,7 +1031,7 @@ static HRESULT parse_file_list(FILE_LIST *flList, LPCWSTR szFiles) } /* advance to the next string */ - ptr += lstrlenW(ptr) + 1; + ptr += wcslen(ptr) + 1; i++; } flList->dwNumFiles = i; @@ -1091,7 +1070,7 @@ static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPWSTR if (PathFileExistsW(szDestPath)) PathCombineW(szTo, szDestPath, feFrom->szFilename); else - lstrcpyW(szTo, szDestPath); + wcscpy(szTo, szDestPath); if (!(op->req->fFlags & FOF_NOCONFIRMATION) && PathFileExistsW(szTo)) { if (!SHELL_ConfirmDialogW(op->req->hwnd, ASK_OVERWRITE_FOLDER, feFrom->szFilename, op)) @@ -1103,11 +1082,11 @@ static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPWSTR } } - szTo[lstrlenW(szTo) + 1] = '\0'; + szTo[wcslen(szTo) + 1] = '\0'; SHNotifyCreateDirectoryW(szTo, NULL); PathCombineW(szFrom, feFrom->szFullPath, wildCardFiles); - szFrom[lstrlenW(szFrom) + 1] = '\0'; + szFrom[wcslen(szFrom) + 1] = '\0'; memcpy(&fileOp, op->req, sizeof(fileOp)); fileOp.pFrom = szFrom; @@ -1274,7 +1253,7 @@ static BOOL confirm_delete_list(HWND hWnd, DWORD fFlags, BOOL fTrash, const FILE WCHAR tmp[8]; const WCHAR format[] = {'%','d',0}; - wnsprintfW(tmp, sizeof(tmp)/sizeof(tmp[0]), format, flFrom->dwNumFiles); + _snwprintf(tmp, sizeof(tmp)/sizeof(tmp[0]), format, flFrom->dwNumFiles); return SHELL_ConfirmDialogW(hWnd, (fTrash?ASK_TRASH_MULTIPLE_ITEM:ASK_DELETE_MULTIPLE_ITEM), tmp, NULL); } else @@ -1365,10 +1344,10 @@ static void move_dir_to_dir(LPSHFILEOPSTRUCTW lpFileOp, const FILE_ENTRY *feFrom SHNotifyCreateDirectoryW(szDestPath, NULL); PathCombineW(szFrom, feFrom->szFullPath, wildCardFiles); - szFrom[lstrlenW(szFrom) + 1] = '\0'; + szFrom[wcslen(szFrom) + 1] = '\0'; - lstrcpyW(szTo, szDestPath); - szTo[lstrlenW(szDestPath) + 1] = '\0'; + wcscpy(szTo, szDestPath); + szTo[wcslen(szDestPath) + 1] = '\0'; memcpy(&fileOp, lpFileOp, sizeof(fileOp)); fileOp.pFrom = szFrom; @@ -1674,7 +1653,7 @@ DWORD WINAPI SheChangeDirW(LPWSTR path) /************************************************************************* * IsNetDrive [SHELL32.66] */ -BOOL WINAPI IsNetDrive(DWORD drive) +INT WINAPI IsNetDrive(INT drive) { char root[4]; strcpy(root, "A:\\"); diff --git a/reactos/dll/win32/shell32/shlfolder.c b/reactos/dll/win32/shell32/shlfolder.c index 71351113725..6653c34fe7f 100644 --- a/reactos/dll/win32/shell32/shlfolder.c +++ b/reactos/dll/win32/shell32/shlfolder.c @@ -21,32 +21,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - -#include -#include -#include -#include - -#define COBJMACROS - -#include "winerror.h" -#include "windef.h" -#include "winbase.h" -#include "winreg.h" -#include "wingdi.h" -#include "winuser.h" - -#include "ole2.h" -#include "shlguid.h" - -#include "pidl.h" -#include "undocshell.h" -#include "shell32_main.h" -#include "shlwapi.h" -#include "wine/debug.h" -#include "shfldr.h" +#include WINE_DEFAULT_DEBUG_CHANNEL (shell); @@ -70,7 +45,7 @@ static const WCHAR wszDotShellClassInfo[] = { * TRUE if returned non-NULL value. * FALSE otherwise. */ -static inline BOOL SHELL32_GetCustomFolderAttributeFromPath( +static BOOL __inline SHELL32_GetCustomFolderAttributeFromPath( LPWSTR pwszFolderPath, LPCWSTR pwszHeading, LPCWSTR pwszAttribute, LPWSTR pwszValue, DWORD cchValue) { @@ -224,7 +199,7 @@ static HRESULT SHELL32_CoCreateInitSF (LPCITEMIDLIST pidlRoot, LPCWSTR pathRoot, } if (pidlChild) { - int len = lstrlenW(ppfti.szTargetParsingName); + int len = wcslen(ppfti.szTargetParsingName); if (!_ILSimpleGetTextW(pidlChild, ppfti.szTargetParsingName + len, MAX_PATH - len)) hr = E_INVALIDARG; @@ -418,7 +393,7 @@ HRESULT SHELL32_GetItemAttributes (IShellFolder * psf, LPCITEMIDLIST pidl, LPDWO if (_ILIsDrive (pidl)) { *pdwAttributes &= SFGAO_HASSUBFOLDER|SFGAO_FILESYSTEM|SFGAO_FOLDER|SFGAO_FILESYSANCESTOR| - SFGAO_DROPTARGET|SFGAO_HASPROPSHEET|SFGAO_CANLINK|SFGAO_CANRENAME; + SFGAO_DROPTARGET|SFGAO_HASPROPSHEET|SFGAO_CANRENAME; } else if (has_guid && HCR_GetFolderAttributes(pidl, &dwAttributes)) { *pdwAttributes = dwAttributes; } else if (_ILGetDataPointer (pidl)) { @@ -446,7 +421,10 @@ HRESULT SHELL32_GetItemAttributes (IShellFolder * psf, LPCITEMIDLIST pidl, LPDWO SFGAO_CANRENAME | SFGAO_CANLINK | SFGAO_CANMOVE | SFGAO_CANCOPY; if (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) + { *pdwAttributes |= (SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_FILESYSANCESTOR); + *pdwAttributes &= ~SFGAO_CANLINK; + } else *pdwAttributes &= ~(SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_FILESYSANCESTOR); diff --git a/reactos/dll/win32/shell32/shlfsbind.c b/reactos/dll/win32/shell32/shlfsbind.c index 50f5c92eda2..a9bf8f0af6c 100644 --- a/reactos/dll/win32/shell32/shlfsbind.c +++ b/reactos/dll/win32/shell32/shlfsbind.c @@ -19,20 +19,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * */ -#include "config.h" -#include "wine/port.h" -#include - -#define COBJMACROS - -#include "windef.h" -#include "winbase.h" -#include "winuser.h" -#include "shlobj.h" -#include "shell32_main.h" - -#include "wine/debug.h" +#include WINE_DEFAULT_DEBUG_CHANNEL(pidl); diff --git a/reactos/dll/win32/shell32/shlmenu.c b/reactos/dll/win32/shell32/shlmenu.c index cdd08c9fcc4..868085b5ea3 100644 --- a/reactos/dll/win32/shell32/shlmenu.c +++ b/reactos/dll/win32/shell32/shlmenu.c @@ -18,23 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -#include - -#define COBJMACROS - -#include "windef.h" -#include "winbase.h" -#include "winreg.h" -#include "wingdi.h" -#include "winuser.h" -#include "shlobj.h" -#include "undocshell.h" -#include "shlwapi.h" -#include "shell32_main.h" - -#include "pidl.h" -#include "wine/debug.h" +#include #ifdef FM_SEPARATOR #undef FM_SEPARATOR @@ -330,9 +314,9 @@ static BOOL FileMenu_AppendItemW( if (lpText != FM_SEPARATOR) { - int len = strlenW (lpText); + int len = wcslen (lpText); myItem = (LPFMITEM) SHAlloc( sizeof(FMITEM) + len*sizeof(WCHAR)); - strcpyW (myItem->szItemText, lpText); + wcscpy (myItem->szItemText, lpText); myItem->cchItemText = len; myItem->iIconIndex = icon; myItem->hMenu = hMenu; @@ -825,7 +809,7 @@ void WINAPI FileMenu_AbortInitMenu (void) * LPXXXXX pointer to struct containing a func addr at offset 8 * or NULL at failure. */ -LPVOID WINAPI SHFind_InitMenuPopup (HMENU hMenu, HWND hWndParent, DWORD w, DWORD x) +IContextMenu * WINAPI SHFind_InitMenuPopup (HMENU hMenu, HWND hWndParent, UINT w, UINT x) { FIXME("hmenu=%p hwnd=%p 0x%08x 0x%08x stub\n", hMenu,hWndParent,w,x); @@ -859,7 +843,8 @@ static BOOL _SHIsMenuSeparator(HMENU hm, int i) * Shell_MergeMenus [SHELL32.67] */ HRESULT WINAPI Shell_MergeMenus (HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags) -{ int nItem; +{ + INT nItem; HMENU hmSubMenu; BOOL bAlreadySeparated; MENUITEMINFOW miiSrc; @@ -907,6 +892,7 @@ HRESULT WINAPI Shell_MergeMenus (HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uI if (!GetMenuItemInfoW(hmSrc, nItem, TRUE, &miiSrc)) { +MessageBoxW(NULL, L"GetMenuItemInfoW failed", NULL, MB_OK); continue; } @@ -916,8 +902,10 @@ HRESULT WINAPI Shell_MergeMenus (HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uI { /* This is a separator; don't put two of them in a row */ if (bAlreadySeparated) + { +MessageBoxW(NULL, L"bAlreadySeparated failed", NULL, MB_OK); continue; - + } bAlreadySeparated = TRUE; } else if (miiSrc.hSubMenu) @@ -926,9 +914,10 @@ HRESULT WINAPI Shell_MergeMenus (HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uI { miiSrc.wID += uIDAdjust; /* add uIDAdjust to the ID */ - if (miiSrc.wID > uIDAdjustMax) /* skip ID's higher uIDAdjustMax */ + if (miiSrc.wID > uIDAdjustMax) /* skip ID's higher uIDAdjustMax */ + {MessageBoxW(NULL, L"uIDAdjustMax 111 failed", NULL, MB_OK); continue; - + } if (uIDMax <= miiSrc.wID) /* remember the highest ID */ uIDMax = miiSrc.wID + 1; } @@ -953,9 +942,10 @@ HRESULT WINAPI Shell_MergeMenus (HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uI { miiSrc.wID += uIDAdjust; /* add uIDAdjust to the ID */ - if (miiSrc.wID > uIDAdjustMax) /* skip ID's higher uIDAdjustMax */ + if (miiSrc.wID > uIDAdjustMax) /* skip ID's higher uIDAdjustMax */{ +MessageBoxW(NULL, L"uIDAdjustMax max 222 failed", NULL, MB_OK); continue; - + } if (uIDMax <= miiSrc.wID) /* remember the highest ID */ uIDMax = miiSrc.wID + 1; @@ -966,6 +956,7 @@ HRESULT WINAPI Shell_MergeMenus (HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uI */ if (!InsertMenuItemW(hmDst, uInsert, TRUE, &miiSrc)) { +MessageBoxW(NULL, L"InsertMenuItemW failed", NULL, MB_OK); return(uIDMax); } } diff --git a/reactos/dll/win32/shell32/shlview.c b/reactos/dll/win32/shell32/shlview.c index 9c03d8a7271..4a69665b178 100644 --- a/reactos/dll/win32/shell32/shlview.c +++ b/reactos/dll/win32/shell32/shlview.c @@ -36,35 +36,7 @@ * Release() ??? */ -#include "config.h" -#include "wine/port.h" - -#include -#include -#include - -#define COBJMACROS -#define NONAMELESSUNION -#define NONAMELESSSTRUCT - -#include "windef.h" -#include "winerror.h" -#include "winbase.h" -#include "winnls.h" -#include "objbase.h" -#include "servprov.h" -#include "shlguid.h" -#include "wingdi.h" -#include "winuser.h" -#include "shlobj.h" -#include "undocshell.h" -#include "shresdef.h" -#include "wine/debug.h" - -#include "docobj.h" -#include "pidl.h" -#include "shell32_main.h" -#include "shellfolder.h" +#include WINE_DEFAULT_DEBUG_CHANNEL(shell); @@ -110,7 +82,7 @@ typedef struct UINT cScrollDelay; /* Send a WM_*SCROLL msg every 250 ms during drag-scroll */ POINT ptLastMousePos; /* Mouse position at last DragOver call */ IContextMenu2 *pCM; -} IShellViewImpl; +} IShellViewImpl, *LPIShellViewImpl; static const IShellViewVtbl svvt; static const IOleCommandTargetVtbl ctvt; @@ -119,24 +91,24 @@ static const IDropSourceVtbl dsvt; static const IViewObjectVtbl vovt; -static inline IShellViewImpl *impl_from_IOleCommandTarget( IOleCommandTarget *iface ) +static LPIShellViewImpl __inline impl_from_IOleCommandTarget( IOleCommandTarget *iface ) { - return (IShellViewImpl *)((char*)iface - FIELD_OFFSET(IShellViewImpl, lpvtblOleCommandTarget)); + return (LPIShellViewImpl)((char*)iface - FIELD_OFFSET(IShellViewImpl, lpvtblOleCommandTarget)); } -static inline IShellViewImpl *impl_from_IDropTarget( IDropTarget *iface ) +static LPIShellViewImpl __inline impl_from_IDropTarget( IDropTarget *iface ) { - return (IShellViewImpl *)((char*)iface - FIELD_OFFSET(IShellViewImpl, lpvtblDropTarget)); + return (LPIShellViewImpl)((char*)iface - FIELD_OFFSET(IShellViewImpl, lpvtblDropTarget)); } -static inline IShellViewImpl *impl_from_IDropSource( IDropSource *iface ) +static LPIShellViewImpl __inline impl_from_IDropSource( IDropSource *iface ) { - return (IShellViewImpl *)((char*)iface - FIELD_OFFSET(IShellViewImpl, lpvtblDropSource)); + return (LPIShellViewImpl)((char*)iface - FIELD_OFFSET(IShellViewImpl, lpvtblDropSource)); } -static inline IShellViewImpl *impl_from_IViewObject( IViewObject *iface ) +static LPIShellViewImpl __inline impl_from_IViewObject( IViewObject *iface ) { - return (IShellViewImpl *)((char*)iface - FIELD_OFFSET(IShellViewImpl, lpvtblViewObject)); + return (LPIShellViewImpl)((char*)iface - FIELD_OFFSET(IShellViewImpl, lpvtblViewObject)); } /* ListView Header ID's */ @@ -566,7 +538,10 @@ static BOOLEAN LV_AddItem(IShellViewImpl * This, LPCITEMIDLIST pidl) lvItem.lParam = (LPARAM) ILClone(ILFindLastID(pidl)); /*set the item's data*/ lvItem.pszText = LPSTR_TEXTCALLBACKW; /*get text on a callback basis*/ lvItem.iImage = I_IMAGECALLBACK; /*get the image on a callback basis*/ - return (-1==ListView_InsertItemW(This->hWndList, &lvItem))? FALSE: TRUE; + if (SendMessageW(This->hWndList, LVM_INSERTITEMW, 0, (LPARAM)&lvItem) == -1) + return FALSE; + else + return TRUE; } /********************************************************** @@ -774,8 +749,8 @@ static void ShellView_MergeFileMenu(IShellViewImpl * This, HMENU hSubMenu) if(hSubMenu) { /*insert This item at the beginning of the menu */ - _InsertMenuItem(hSubMenu, 0, TRUE, 0, MFT_SEPARATOR, NULL, MFS_ENABLED); - _InsertMenuItem(hSubMenu, 0, TRUE, IDM_MYFILEITEM, MFT_STRING, "dummy45", MFS_ENABLED); + _InsertMenuItemW(hSubMenu, 0, TRUE, 0, MFT_SEPARATOR, NULL, MFS_ENABLED); + _InsertMenuItemW(hSubMenu, 0, TRUE, IDM_MYFILEITEM, MFT_STRING, L"dummy45", MFS_ENABLED); } TRACE("--\n"); @@ -791,18 +766,18 @@ static void ShellView_MergeViewMenu(IShellViewImpl * This, HMENU hSubMenu) if(hSubMenu) { /*add a separator at the correct position in the menu*/ - MENUITEMINFOA mii; - static char view[] = "View"; + MENUITEMINFOW mii; + static WCHAR view[] = L"View"; - _InsertMenuItem(hSubMenu, FCIDM_MENU_VIEW_SEP_OPTIONS, FALSE, 0, MFT_SEPARATOR, NULL, MFS_ENABLED); + _InsertMenuItemW(hSubMenu, FCIDM_MENU_VIEW_SEP_OPTIONS, FALSE, 0, MFT_SEPARATOR, NULL, MFS_ENABLED); ZeroMemory(&mii, sizeof(mii)); mii.cbSize = sizeof(mii); mii.fMask = MIIM_SUBMENU | MIIM_TYPE | MIIM_DATA; mii.fType = MFT_STRING; mii.dwTypeData = view; - mii.hSubMenu = LoadMenuA(shell32_hInstance, "MENU_001"); - InsertMenuItemA(hSubMenu, FCIDM_MENU_VIEW_SEP_OPTIONS, FALSE, &mii); + mii.hSubMenu = LoadMenuW(shell32_hInstance, L"MENU_001"); + InsertMenuItemW(hSubMenu, FCIDM_MENU_VIEW_SEP_OPTIONS, FALSE, &mii); } } @@ -835,12 +810,14 @@ static UINT ShellView_GetSelections(IShellViewImpl * This) lvItem.iItem = 0; lvItem.iSubItem = 0; - while(ListView_GetItemW(This->hWndList, &lvItem) && (i < This->cidl)) + while(SendMessageW(This->hWndList, LVM_GETITEMW, 0, (LPARAM)&lvItem) && (i < This->cidl)) { if(lvItem.state & LVIS_SELECTED) { This->apidl[i] = (LPITEMIDLIST)lvItem.lParam; i++; + if (i == This->cidl) + break; TRACE("-- selected Item found\n"); } lvItem.iItem++; @@ -1030,7 +1007,7 @@ static void ShellView_DoContextMenu(IShellViewImpl * This, WORD x, WORD y, BOOL { hMenu = CreatePopupMenu(); - This->pCM = ISvBgCm_Constructor(This->pSFParent, FALSE); + CDefFolderMenu_Create2(NULL, NULL, This->cidl, (LPCITEMIDLIST*)This->apidl, This->pSFParent, NULL, 0, NULL, (IContextMenu**)&This->pCM); IContextMenu2_QueryContextMenu(This->pCM, hMenu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST, 0); uCommand = TrackPopupMenu( hMenu, TPM_LEFTALIGN | TPM_RETURNCMD,x,y,0,This->hWnd,NULL); @@ -2063,6 +2040,7 @@ static HRESULT WINAPI IShellView_fnSelectItem( static HRESULT WINAPI IShellView_fnGetItemObject(IShellView * iface, UINT uItem, REFIID riid, LPVOID *ppvOut) { + HRESULT hr = E_FAIL; IShellViewImpl *This = (IShellViewImpl *)iface; TRACE("(%p)->(uItem=0x%08x,\n\tIID=%s, ppv=%p)\n",This, uItem, debugstr_guid(riid), ppvOut); @@ -2072,19 +2050,19 @@ static HRESULT WINAPI IShellView_fnGetItemObject(IShellView * iface, UINT uItem, switch(uItem) { case SVGIO_BACKGROUND: - *ppvOut = ISvBgCm_Constructor(This->pSFParent, FALSE); + //*ppvOut = ISvBgCm_Constructor(This->pSFParent, FALSE); + CDefFolderMenu_Create2(NULL, NULL, This->cidl, (LPCITEMIDLIST*)This->apidl, This->pSFParent, NULL, 0, NULL, (IContextMenu**)ppvOut); + if (!ppvOut) hr = E_OUTOFMEMORY; break; case SVGIO_SELECTION: ShellView_GetSelections(This); - IShellFolder_GetUIObjectOf(This->pSFParent, This->hWnd, This->cidl, (LPCITEMIDLIST*)This->apidl, riid, 0, ppvOut); + hr = IShellFolder_GetUIObjectOf(This->pSFParent, This->hWnd, This->cidl, (LPCITEMIDLIST*)This->apidl, riid, 0, ppvOut); break; } TRACE("-- (%p)->(interface=%p)\n",This, *ppvOut); - if(!*ppvOut) return E_OUTOFMEMORY; - - return S_OK; + return hr; } static const IShellViewVtbl svvt = diff --git a/reactos/dll/win32/shell32/shpolicy.c b/reactos/dll/win32/shell32/shpolicy.c index 8441a7492a2..9678fb39cee 100644 --- a/reactos/dll/win32/shell32/shpolicy.c +++ b/reactos/dll/win32/shell32/shpolicy.c @@ -29,19 +29,7 @@ * Up to date as of SHELL32 v5.00 (W2K) */ -#include -#include -#include - -#include "windef.h" -#include "winbase.h" -#include "winerror.h" -#include "winreg.h" - -#include "shell32_main.h" -#include "shlobj.h" - -#include "wine/debug.h" +#include WINE_DEFAULT_DEBUG_CHANNEL(shell); @@ -441,12 +429,14 @@ static POLICYDATA sh32_policy_table[] = strForceCopyACLW, SHELL_NO_POLICY }, +#if (NTDDI_VERSION < NTDDI_LONGHORN) { REST_NOLOGO3CHANNELNOTIFY, strExplorer, strNoMSAppLogo, SHELL_NO_POLICY }, +#endif { REST_NOFORGETSOFTWAREUPDATE, strExplorer, diff --git a/reactos/dll/win32/shell32/shresdef.h b/reactos/dll/win32/shell32/shresdef.h index 3a06fe0abcd..66ae980124b 100644 --- a/reactos/dll/win32/shell32/shresdef.h +++ b/reactos/dll/win32/shell32/shresdef.h @@ -162,6 +162,9 @@ #define IDS_RESTORE 324 #define IDS_DEFAULT_CLUSTER_SIZE 325 #define IDS_ADMINISTRATIVETOOLS 326 +#define IDS_FORMATDRIVE 327 +#define IDS_RENAME 328 +#define IDS_INSERT 329 /* Note: this string is referenced from the registry */ #define IDS_RECYCLEBIN_FOLDER_NAME 8964 @@ -238,6 +241,15 @@ #define IDI_SHELL_MY_DOCUMENTS 235 #define IDI_SHELL_CONTROL_PANEL1 330 #define IDI_SHELL_ADMINTOOLS 328 + +// Icons for Folder Options (ID's identical to Windows XP SP3) +#define IDI_SHELL_SHOW_COMMON_TASKS 182 +#define IDI_SHELL_CLASSIC_FOLDERS 183 +#define IDI_SHELL_OPEN_IN_SOME_WINDOW 184 +#define IDI_SHELL_OPEN_IN_NEW_WINDOW 185 +#define IDI_SHELL_SINGLE_CLICK_TO_OPEN 186 +#define IDI_SHELL_DOUBLE_CLICK_TO_OPEN 187 + /* AVI resources, windows shell32 has 14 of them: 150-152 and 160-170 FIXME: Need to add them, but for now just let them use the same: searching.avi @@ -251,4 +263,40 @@ FIXME: Need to add them, but for now just let them use the same: searching.avi #define IDR_AVI_FILENUKE 163 #define IDR_AVI_FILEDELETE 164 +#define FCIDM_SHVIEW_ARRANGE 0x7001 +#define FCIDM_SHVIEW_DELETE 0x7011 +#define FCIDM_SHVIEW_PROPERTIES 0x7013 +#define FCIDM_SHVIEW_CUT 0x7018 +#define FCIDM_SHVIEW_COPY 0x7019 +#define FCIDM_SHVIEW_INSERT 0x701A +#define FCIDM_SHVIEW_UNDO 0x701B +#define FCIDM_SHVIEW_INSERTLINK 0x701C +#define FCIDM_SHVIEW_SELECTALL 0x7021 +#define FCIDM_SHVIEW_INVERTSELECTION 0x7022 + +#define FCIDM_SHVIEW_BIGICON 0x7029 //FIXME +#define FCIDM_SHVIEW_SMALLICON 0x702A //FIXME +#define FCIDM_SHVIEW_LISTVIEW 0x702B //FIXME +#define FCIDM_SHVIEW_REPORTVIEW 0x702C //FIXME +/* 0x7030-0x703f are used by the shellbrowser */ +#define FCIDM_SHVIEW_AUTOARRANGE 0x7031 +#define FCIDM_SHVIEW_SNAPTOGRID 0x7032 + +#define FCIDM_SHVIEW_HELP 0x7041 +#define FCIDM_SHVIEW_RENAME 0x7050 +#define FCIDM_SHVIEW_CREATELINK 0x7051 +#define FCIDM_SHVIEW_NEWLINK 0x7052 +#define FCIDM_SHVIEW_NEWFOLDER 0x7053 + +#define FCIDM_SHVIEW_REFRESH 0x7100 /* FIXME */ +#define FCIDM_SHVIEW_EXPLORE 0x7101 /* FIXME */ +#define FCIDM_SHVIEW_OPEN 0x7102 /* FIXME */ + + +#define FCIDM_TB_UPFOLDER 0xA001 +#define FCIDM_TB_NEWFOLDER 0xA002 +#define FCIDM_TB_SMALLICON 0xA003 +#define FCIDM_TB_REPORTVIEW 0xA004 +#define FCIDM_TB_DESKTOP 0xA005 /* FIXME */ + #endif diff --git a/reactos/dll/win32/shell32/shv_bg_cmenu.c b/reactos/dll/win32/shell32/shv_bg_cmenu.c deleted file mode 100644 index d5a4ff8afd7..00000000000 --- a/reactos/dll/win32/shell32/shv_bg_cmenu.c +++ /dev/null @@ -1,500 +0,0 @@ -/* - * IContextMenu - * ShellView Background Context Menu (shv_bg_cm) - * - * Copyright 1999 Juergen Schmied - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ -#include - -#define COBJMACROS -#define NONAMELESSUNION -#define NONAMELESSSTRUCT -#include "wine/debug.h" - -#include "windef.h" -#include "wingdi.h" -#include "pidl.h" -#include "shlobj.h" -#include "shtypes.h" -#include "shell32_main.h" -#include "shellfolder.h" -#include "undocshell.h" -#include "shlwapi.h" -#include "stdio.h" -#include "winuser.h" - -WINE_DEFAULT_DEBUG_CHANNEL(shell); - -/************************************************************************** -* IContextMenu Implementation -*/ -typedef struct -{ - const IContextMenu2Vtbl *lpVtbl; - IShellFolder* pSFParent; - LONG ref; - BOOL bDesktop; - IContextMenu2 * icm_new; -} BgCmImpl; - -static const IContextMenu2Vtbl cmvt; - -BOOL -HasClipboardData() -{ - BOOL ret = FALSE; - IDataObject * pda; - - if(SUCCEEDED(OleGetClipboard(&pda))) - { - STGMEDIUM medium; - FORMATETC formatetc; - - TRACE("pda=%p\n", pda); - - /* Set the FORMATETC structure*/ - InitFormatEtc(formatetc, RegisterClipboardFormatA(CFSTR_SHELLIDLIST), TYMED_HGLOBAL); - if(SUCCEEDED(IDataObject_GetData(pda,&formatetc,&medium))) - { - ret = TRUE; - } - - IDataObject_Release(pda); - ReleaseStgMedium(&medium); - } - - return ret; -} - - -/************************************************************************** -* ISVBgCm_Constructor() -*/ -IContextMenu2 *ISvBgCm_Constructor(IShellFolder* pSFParent, BOOL bDesktop) -{ - BgCmImpl* cm; - - cm = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(BgCmImpl)); - cm->lpVtbl = &cmvt; - cm->ref = 1; - cm->pSFParent = pSFParent; - cm->bDesktop = bDesktop; - if(pSFParent) IShellFolder_AddRef(pSFParent); - - TRACE("(%p)->()\n",cm); - return (IContextMenu2*)cm; -} - -/************************************************************************** -* ISVBgCm_fnQueryInterface -*/ -static HRESULT WINAPI ISVBgCm_fnQueryInterface(IContextMenu2 *iface, REFIID riid, LPVOID *ppvObj) -{ - BgCmImpl *This = (BgCmImpl *)iface; - - TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObj); - - *ppvObj = NULL; - - if(IsEqualIID(riid, &IID_IUnknown) || - IsEqualIID(riid, &IID_IContextMenu) || - IsEqualIID(riid, &IID_IContextMenu2)) - { - *ppvObj = This; - } - else if(IsEqualIID(riid, &IID_IShellExtInit)) /*IShellExtInit*/ - { - FIXME("-- LPSHELLEXTINIT pointer requested\n"); - } - - if(*ppvObj) - { - IUnknown_AddRef((IUnknown*)*ppvObj); - TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj); - return S_OK; - } - TRACE("-- Interface: E_NOINTERFACE\n"); - return E_NOINTERFACE; -} - -/************************************************************************** -* ISVBgCm_fnAddRef -*/ -static ULONG WINAPI ISVBgCm_fnAddRef(IContextMenu2 *iface) -{ - BgCmImpl *This = (BgCmImpl *)iface; - ULONG refCount = InterlockedIncrement(&This->ref); - - TRACE("(%p)->(count=%u)\n", This, refCount - 1); - - return refCount; -} - -/************************************************************************** -* ISVBgCm_fnRelease -*/ -static ULONG WINAPI ISVBgCm_fnRelease(IContextMenu2 *iface) -{ - BgCmImpl *This = (BgCmImpl *)iface; - ULONG refCount = InterlockedDecrement(&This->ref); - - TRACE("(%p)->(count=%i)\n", This, refCount + 1); - - if (!refCount) - { - TRACE(" destroying IContextMenu(%p)\n",This); - - if(This->pSFParent) - IShellFolder_Release(This->pSFParent); - - HeapFree(GetProcessHeap(),0,This); - } - return refCount; -} - -/************************************************************************** -* ISVBgCm_fnQueryContextMenu() -*/ - -VOID INewItem_SetParent(LPSHELLFOLDER pSFParent); /* FIXME: remove that, shouldn't be needed */ - -static HRESULT WINAPI ISVBgCm_fnQueryContextMenu( - IContextMenu2 *iface, - HMENU hMenu, - UINT indexMenu, - UINT idCmdFirst, - UINT idCmdLast, - UINT uFlags) -{ - HMENU hMyMenu; - UINT idMax; - MENUITEMINFOW mii; - HRESULT hr; - - IContextMenu2 * icm; - BgCmImpl *This = (BgCmImpl *)iface; - - TRACE("(%p)->(hmenu=%p indexmenu=%x cmdfirst=%x cmdlast=%x flags=%x )\n", - This, hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags); - - - hMyMenu = LoadMenuA(shell32_hInstance, "MENU_002"); - if (uFlags & CMF_DEFAULTONLY) - { - HMENU ourMenu = GetSubMenu(hMyMenu,0); - UINT oldDef = GetMenuDefaultItem(hMenu,TRUE,GMDI_USEDISABLED); - UINT newDef = GetMenuDefaultItem(ourMenu,TRUE,GMDI_USEDISABLED); - if (newDef != oldDef) - SetMenuDefaultItem(hMenu,newDef,TRUE); - if (newDef!=0xFFFFFFFF) - hr = MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_NULL, newDef+1); - else - hr = MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_NULL, 0); - } - else - { - idMax = Shell_MergeMenus (hMenu, GetSubMenu(hMyMenu,0), indexMenu, - idCmdFirst, idCmdLast, MM_SUBMENUSHAVEIDS); - hr = MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_NULL, idMax-idCmdFirst+1); - } - DestroyMenu(hMyMenu); - - if (!HasClipboardData()) - { - mii.cbSize = sizeof(mii); - mii.fMask = MIIM_STATE; - mii.fState = MFS_DISABLED; - mii.fType = 0; - SetMenuItemInfoW(hMenu, FCIDM_SHVIEW_INSERT, FALSE, &mii); - SetMenuItemInfoW(hMenu, FCIDM_SHVIEW_INSERTLINK, FALSE, &mii); - } - - /* - * FIXME - * load other shell extensions - */ - if (SUCCEEDED(INewItem_Constructor(NULL, &IID_IContextMenu2, (LPVOID*)&icm))) - { - if (SUCCEEDED(IContextMenu_QueryContextMenu(icm, hMenu, 10, idCmdFirst, idCmdLast, uFlags))) - { - This->icm_new = icm; - _InsertMenuItem(hMenu, 11, TRUE, -1, MFT_SEPARATOR, NULL, MFS_ENABLED); - } - else - { - This->icm_new = NULL; - } - } - - /* Prepare 'New item' shell extension */ - /* FIXME: shouldn't be needed... */ - INewItem_SetParent(This->pSFParent); - - if (This->bDesktop) - { - /* desktop menu has no view option */ - DeleteMenu(hMenu, 0, MF_BYPOSITION); - DeleteMenu(hMenu, 0, MF_BYPOSITION); - } - TRACE("(%p)->returning 0x%x\n",This,hr); - return hr; -} - - -/************************************************************************** -* DoPaste -*/ -static BOOL DoPaste( - IContextMenu2 *iface) -{ - BgCmImpl *This = (BgCmImpl *)iface; - BOOL bSuccess = FALSE; - IDataObject * pda; - - TRACE("\n"); - - if(SUCCEEDED(OleGetClipboard(&pda))) - { - STGMEDIUM medium; - FORMATETC formatetc; - - TRACE("pda=%p\n", pda); - - /* Set the FORMATETC structure*/ - InitFormatEtc(formatetc, RegisterClipboardFormatA(CFSTR_SHELLIDLIST), TYMED_HGLOBAL); - - /* Get the pidls from IDataObject */ - if(SUCCEEDED(IDataObject_GetData(pda,&formatetc,&medium))) - { - LPITEMIDLIST * apidl; - LPITEMIDLIST pidl; - IShellFolder *psfFrom = NULL, *psfDesktop; - - LPIDA lpcida = GlobalLock(medium.u.hGlobal); - TRACE("cida=%p\n", lpcida); - - apidl = _ILCopyCidaToaPidl(&pidl, lpcida); - - /* bind to the source shellfolder */ - SHGetDesktopFolder(&psfDesktop); - if(psfDesktop) - { - IShellFolder_BindToObject(psfDesktop, pidl, NULL, &IID_IShellFolder, (LPVOID*)&psfFrom); - IShellFolder_Release(psfDesktop); - } - - if (psfFrom) - { - /* get source and destination shellfolder */ - ISFHelper *psfhlpdst, *psfhlpsrc; - IShellFolder_QueryInterface(This->pSFParent, &IID_ISFHelper, (LPVOID*)&psfhlpdst); - IShellFolder_QueryInterface(psfFrom, &IID_ISFHelper, (LPVOID*)&psfhlpsrc); - - /* do the copy/move */ - if (psfhlpdst && psfhlpsrc) - { - ISFHelper_CopyItems(psfhlpdst, psfFrom, lpcida->cidl, (LPCITEMIDLIST*)apidl); - /* FIXME handle move - ISFHelper_DeleteItems(psfhlpsrc, lpcida->cidl, apidl); - */ - } - if(psfhlpdst) ISFHelper_Release(psfhlpdst); - if(psfhlpsrc) ISFHelper_Release(psfhlpsrc); - IShellFolder_Release(psfFrom); - } - - _ILFreeaPidl(apidl, lpcida->cidl); - SHFree(pidl); - - /* release the medium*/ - ReleaseStgMedium(&medium); - } - IDataObject_Release(pda); - } -#if 0 - HGLOBAL hMem; - - OpenClipboard(NULL); - hMem = GetClipboardData(CF_HDROP); - - if(hMem) - { - char * pDropFiles = (char *)GlobalLock(hMem); - if(pDropFiles) - { - int len, offset = sizeof(DROPFILESTRUCT); - - while( pDropFiles[offset] != 0) - { - len = strlen(pDropFiles + offset); - TRACE("%s\n", pDropFiles + offset); - offset += len+1; - } - } - GlobalUnlock(hMem); - } - CloseClipboard(); -#endif - return bSuccess; -} - -/************************************************************************** -* ISVBgCm_fnInvokeCommand() -*/ -static HRESULT WINAPI ISVBgCm_fnInvokeCommand( - IContextMenu2 *iface, - LPCMINVOKECOMMANDINFO lpcmi) -{ - BgCmImpl *This = (BgCmImpl *)iface; - - LPSHELLBROWSER lpSB; - LPSHELLVIEW lpSV = NULL; - HWND hWndSV = 0; - - TRACE("(%p)->(invcom=%p verb=%p wnd=%p)\n",This,lpcmi,lpcmi->lpVerb, lpcmi->hwnd); - - /* get the active IShellView */ - if((lpSB = (LPSHELLBROWSER)SendMessageA(lpcmi->hwnd, CWM_GETISHELLBROWSER,0,0))) - { - if(SUCCEEDED(IShellBrowser_QueryActiveShellView(lpSB, &lpSV))) - { - IShellView_GetWindow(lpSV, &hWndSV); - } - } - - if(HIWORD(lpcmi->lpVerb)) - { - TRACE("%s\n",lpcmi->lpVerb); - - if (! strcmp(lpcmi->lpVerb,CMDSTR_VIEWLISTA)) - { - if(hWndSV) SendMessageA(hWndSV, WM_COMMAND, MAKEWPARAM(FCIDM_SHVIEW_LISTVIEW,0),0 ); - } - else if (! strcmp(lpcmi->lpVerb,CMDSTR_VIEWDETAILSA)) - { - if(hWndSV) SendMessageA(hWndSV, WM_COMMAND, MAKEWPARAM(FCIDM_SHVIEW_REPORTVIEW,0),0 ); - } - else - { - FIXME("please report: unknown verb %s\n",lpcmi->lpVerb); - } - } - else - { - switch(LOWORD(lpcmi->lpVerb)) - { - case FCIDM_SHVIEW_REFRESH: - if (lpSV) IShellView_Refresh(lpSV); - break; - case FCIDM_SHVIEW_INSERT: - DoPaste(iface); - break; - - case FCIDM_SHVIEW_PROPERTIES: - if (This->bDesktop) { - ShellExecuteA(lpcmi->hwnd, "open", "rundll32.exe shell32.dll,Control_RunDLL desk.cpl", NULL, NULL, SW_SHOWNORMAL); - } else { - FIXME("launch item properties dialog\n"); - } - break; - - default: - - if (This->icm_new && SUCCEEDED(IContextMenu2_InvokeCommand(This->icm_new, lpcmi))) - return S_OK; - - /* if it's an id just pass it to the parent shv */ - if (hWndSV) SendMessageA(hWndSV, WM_COMMAND, MAKEWPARAM(LOWORD(lpcmi->lpVerb), 0),0 ); - break; - } - } - - if (lpSV) - IShellView_Release(lpSV); /* QueryActiveShellView does AddRef */ - - return NOERROR; -} - -/************************************************************************** - * ISVBgCm_fnGetCommandString() - * - */ -static HRESULT WINAPI ISVBgCm_fnGetCommandString( - IContextMenu2 *iface, - UINT_PTR idCommand, - UINT uFlags, - UINT* lpReserved, - LPSTR lpszName, - UINT uMaxNameLen) -{ - BgCmImpl *This = (BgCmImpl *)iface; - - TRACE("(%p)->(idcom=%lx flags=%x %p name=%p len=%x)\n",This, idCommand, uFlags, lpReserved, lpszName, uMaxNameLen); - - /* test the existence of the menu items, the file dialog enables - the buttons according to this */ - if (uFlags == GCS_VALIDATEA) - { - if(HIWORD(idCommand)) - { - if (!strcmp((LPSTR)idCommand, CMDSTR_VIEWLISTA) || - !strcmp((LPSTR)idCommand, CMDSTR_VIEWDETAILSA)) - { - return NOERROR; - } - } - } - - FIXME("unknown command string\n"); - return E_FAIL; -} - -/************************************************************************** -* ISVBgCm_fnHandleMenuMsg() -*/ -static HRESULT WINAPI ISVBgCm_fnHandleMenuMsg( - IContextMenu2 *iface, - UINT uMsg, - WPARAM wParam, - LPARAM lParam) -{ - BgCmImpl *This = (BgCmImpl *)iface; - - TRACE("ISVBgCm_fnHandleMenuMsg (%p)->(msg=%x wp=%lx lp=%lx)\n",This, uMsg, wParam, lParam); - - if (This->icm_new) - { - IContextMenu2_HandleMenuMsg(This->icm_new, uMsg, wParam, lParam); - } - - return E_NOTIMPL; -} - -/************************************************************************** -* IContextMenu2 VTable -* -*/ -static const IContextMenu2Vtbl cmvt = -{ - ISVBgCm_fnQueryInterface, - ISVBgCm_fnAddRef, - ISVBgCm_fnRelease, - ISVBgCm_fnQueryContextMenu, - ISVBgCm_fnInvokeCommand, - ISVBgCm_fnGetCommandString, - ISVBgCm_fnHandleMenuMsg -}; diff --git a/reactos/dll/win32/shell32/shv_def_cmenu.c b/reactos/dll/win32/shell32/shv_def_cmenu.c new file mode 100644 index 00000000000..1acd018b71f --- /dev/null +++ b/reactos/dll/win32/shell32/shv_def_cmenu.c @@ -0,0 +1,1715 @@ +/* + * PROJECT: shell32 + * LICENSE: GPL - See COPYING in the top level directory + * FILE: dll/win32/shell32/shv_item_new.c + * PURPOSE: provides default context menu implementation + * PROGRAMMERS: Johannes Anderwald (janderwald@reactos.org) + */ + +#include + +WINE_DEFAULT_DEBUG_CHANNEL(dmenu); + +typedef struct _DynamicShellEntry_ +{ + UINT iIdCmdFirst; + UINT NumIds; + CLSID ClassID; + IContextMenu * CMenu; + struct _DynamicShellEntry_ * Next; +}DynamicShellEntry, *PDynamicShellEntry; + +typedef struct _StaticShellEntry_ +{ + LPWSTR szVerb; + LPWSTR szClass; + struct _StaticShellEntry_ * Next; +}StaticShellEntry, *PStaticShellEntry; + + +typedef struct +{ + const IContextMenu2Vtbl *lpVtbl; + LONG ref; + DEFCONTEXTMENU dcm; + IDataObject * pDataObj; + DWORD bGroupPolicyActive; + PDynamicShellEntry dhead; /* first dynamic shell extension entry */ + UINT iIdSHEFirst; /* first used id */ + UINT iIdSHELast; /* last used id */ + PStaticShellEntry shead; /* first static shell extension entry */ + UINT iIdSCMFirst; /* first static used id */ + UINT iIdSCMLast; /* last static used id */ +}IDefaultContextMenuImpl, *LPIDefaultContextMenuImpl; + +static LPIDefaultContextMenuImpl __inline impl_from_IContextMenu( IContextMenu2 *iface ) +{ + return (LPIDefaultContextMenuImpl)((char*)iface - FIELD_OFFSET(IDefaultContextMenuImpl, lpVtbl)); +} + +VOID INewItem_SetCurrentShellFolder(IShellFolder * psfParent); // HACK + + +static +HRESULT +WINAPI +IDefaultContextMenu_fnQueryInterface( + IContextMenu2 *iface, + REFIID riid, + LPVOID *ppvObj) +{ + IDefaultContextMenuImpl *This = (IDefaultContextMenuImpl *)iface; + + TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObj); + + *ppvObj = NULL; + + if(IsEqualIID(riid, &IID_IUnknown) || + IsEqualIID(riid, &IID_IContextMenu) || + IsEqualIID(riid, &IID_IContextMenu2)) + { + *ppvObj = This; + } + + if(*ppvObj) + { + IUnknown_AddRef((IUnknown*)*ppvObj); + TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj); + return S_OK; + } + TRACE("-- Interface: E_NOINTERFACE\n"); + return E_NOINTERFACE; +} + + +static +ULONG +WINAPI +IDefaultContextMenu_fnAddRef( + IContextMenu2 *iface) +{ + IDefaultContextMenuImpl *This = (IDefaultContextMenuImpl *)iface; + ULONG refCount = InterlockedIncrement(&This->ref); + + TRACE("(%p)->(count=%u)\n", This, refCount - 1); + + return refCount; +} + +static +ULONG +WINAPI +IDefaultContextMenu_fnRelease( + IContextMenu2 *iface) +{ + PDynamicShellEntry dEntry, dNext; + PStaticShellEntry sEntry, sNext; + IDefaultContextMenuImpl *This = (IDefaultContextMenuImpl *)iface; + ULONG refCount = InterlockedDecrement(&This->ref); + + TRACE("(%p)->(count=%u)\n", This, refCount + 1); + if (!refCount) + { + /* free dynamic shell extension entries */ + dEntry = This->dhead; + while(dEntry) + { + dNext = dEntry->Next; + IContextMenu_Release(dEntry->CMenu); + HeapFree(GetProcessHeap(), 0, dEntry); + dEntry = dNext; + } + /* free static shell extension entries */ + sEntry = This->shead; + while(sEntry) + { + sNext = sEntry->Next; + HeapFree(GetProcessHeap(), 0, sEntry->szClass); + HeapFree(GetProcessHeap(), 0, sEntry->szVerb); + HeapFree(GetProcessHeap(), 0, sEntry); + sEntry = sNext; + } + HeapFree(GetProcessHeap(),0,This); + } + + return refCount; +} + +static +void +SH_AddStaticEntry(IDefaultContextMenuImpl * This, WCHAR *szVerb, WCHAR * szClass) +{ + PStaticShellEntry curEntry; + PStaticShellEntry lastEntry = NULL; + + curEntry = This->shead; + while(curEntry) + { + if (!wcsicmp(curEntry->szVerb, szVerb)) + { + /* entry already exists */ + return; + } + lastEntry = curEntry; + curEntry = curEntry->Next; + } + + TRACE("adding verb %s szClass %s\n", debugstr_w(szVerb), debugstr_w(szClass)); + + curEntry = HeapAlloc(GetProcessHeap(), 0, sizeof(StaticShellEntry)); + if (curEntry) + { + curEntry->Next = NULL; + curEntry->szVerb = HeapAlloc(GetProcessHeap(), 0, (wcslen(szVerb)+1) * sizeof(WCHAR)); + if (curEntry->szVerb) + wcscpy(curEntry->szVerb, szVerb); + curEntry->szClass = HeapAlloc(GetProcessHeap(), 0, (wcslen(szClass)+1) * sizeof(WCHAR)); + if (curEntry->szClass) + wcscpy(curEntry->szClass, szClass); + } + + if (lastEntry) + { + lastEntry->Next = curEntry; + } + else + { + This->shead = curEntry; + } +} + +static +void +SH_AddStaticEntryForKey(IDefaultContextMenuImpl * This, HKEY hKey, WCHAR * szClass) +{ + LONG result; + DWORD dwIndex; + WCHAR szName[40]; + DWORD dwName; + + dwIndex = 0; + do + { + szName[0] = 0; + dwName = sizeof(szName) / sizeof(WCHAR); + result = RegEnumKeyExW(hKey, dwIndex, szName, &dwName, NULL, NULL, NULL, NULL); + szName[(sizeof(szName)/sizeof(WCHAR))-1] = 0; + if (result == ERROR_SUCCESS) + { + SH_AddStaticEntry(This, szName, szClass); + } + dwIndex++; + }while(result == ERROR_SUCCESS); +} + +static +void +SH_AddStaticEntryForFileClass(IDefaultContextMenuImpl * This, WCHAR * szExt) +{ + WCHAR szBuffer[100]; + HKEY hKey; + LONG result; + DWORD dwBuffer; + UINT Length; + static WCHAR szShell[] = L"\\shell"; + static WCHAR szShellAssoc[] = L"SystemFileAssociations\\"; + + TRACE("SH_AddStaticEntryForFileClass entered with %s\n", debugstr_w(szExt)); + + Length = wcslen(szExt); + if (Length + (sizeof(szShell)/sizeof(WCHAR)) + 1 < sizeof(szBuffer)/sizeof(WCHAR)) + { + wcscpy(szBuffer, szExt); + wcscpy(&szBuffer[Length], szShell); + result = RegOpenKeyExW(HKEY_CLASSES_ROOT, szBuffer, 0, KEY_READ | KEY_QUERY_VALUE, &hKey); + if (result == ERROR_SUCCESS) + { + szBuffer[Length] = 0; + SH_AddStaticEntryForKey(This, hKey, szExt); + RegCloseKey(hKey); + } + } + + dwBuffer = sizeof(szBuffer); + result = RegGetValueW(HKEY_CLASSES_ROOT, szExt, NULL, RRF_RT_REG_SZ, NULL, (LPBYTE)szBuffer, &dwBuffer); + if (result == ERROR_SUCCESS) + { + Length = wcslen(szBuffer); + if (Length + (sizeof(szShell)/sizeof(WCHAR)) + 1 < sizeof(szBuffer)/sizeof(WCHAR)) + { + wcscpy(&szBuffer[Length], szShell); + TRACE("szBuffer %s\n", debugstr_w(szBuffer)); + + result = RegOpenKeyExW(HKEY_CLASSES_ROOT, szBuffer, 0, KEY_READ | KEY_QUERY_VALUE, &hKey); + if (result == ERROR_SUCCESS) + { + szBuffer[Length] = 0; + SH_AddStaticEntryForKey(This, hKey, szBuffer); + RegCloseKey(hKey); + } + } + } + + wcscpy(szBuffer, szShellAssoc); + dwBuffer = sizeof(szBuffer) - sizeof(szShellAssoc) - sizeof(WCHAR); + result = RegGetValueW(HKEY_CLASSES_ROOT, szExt, L"PerceivedType", RRF_RT_REG_SZ, NULL, (LPBYTE)&szBuffer[(sizeof(szShellAssoc)/sizeof(WCHAR))], &dwBuffer); + if (result == ERROR_SUCCESS) + { + Length = wcslen(&szBuffer[(sizeof(szShellAssoc)/sizeof(WCHAR))]) + (sizeof(szShellAssoc)/sizeof(WCHAR)); + wcscat(&szBuffer[(sizeof(szShellAssoc)/sizeof(WCHAR))], szShell); + TRACE("szBuffer %s\n", debugstr_w(szBuffer)); + + result = RegOpenKeyExW(HKEY_CLASSES_ROOT, szBuffer, 0, KEY_READ | KEY_QUERY_VALUE, &hKey); + if (result == ERROR_SUCCESS) + { + szBuffer[Length] = 0; + SH_AddStaticEntryForKey(This, hKey, szBuffer); + RegCloseKey(hKey); + } + } + RegCloseKey(hKey); +} + +static +BOOL +HasClipboardData() +{ + BOOL ret = FALSE; + IDataObject * pda; + + if(SUCCEEDED(OleGetClipboard(&pda))) + { + STGMEDIUM medium; + FORMATETC formatetc; + + TRACE("pda=%p\n", pda); + + /* Set the FORMATETC structure*/ + InitFormatEtc(formatetc, RegisterClipboardFormatA(CFSTR_SHELLIDLIST), TYMED_HGLOBAL); + if(SUCCEEDED(IDataObject_GetData(pda,&formatetc,&medium))) + { + ret = TRUE; + } + + IDataObject_Release(pda); + ReleaseStgMedium(&medium); + } + + return ret; +} + +VOID +DisablePasteOptions(HMENU hMenu) +{ + MENUITEMINFOW mii; + + mii.cbSize = sizeof(mii); + mii.fMask = MIIM_STATE; + mii.fState = MFS_DISABLED; + + TRACE("result %d\n", SetMenuItemInfoW(hMenu, FCIDM_SHVIEW_INSERT, FALSE, &mii)); + TRACE("result %d\n", SetMenuItemInfoW(hMenu, FCIDM_SHVIEW_INSERTLINK, FALSE, &mii)); +} + +BOOL +IsShellExtensionAlreadyLoaded(IDefaultContextMenuImpl * This, const CLSID * szClass) +{ + PDynamicShellEntry curEntry = This->dhead; + + while(curEntry) + { + if (!memcmp(&curEntry->ClassID, szClass, sizeof(CLSID))) + return TRUE; + curEntry = curEntry->Next; + } + return FALSE; +} + + +static +HRESULT +SH_LoadDynamicContextMenuHandler(IDefaultContextMenuImpl * This, HKEY hKey, const CLSID * szClass, BOOL bExternalInit) +{ + HRESULT hr; + IContextMenu * cmobj; + IShellExtInit *shext; + PDynamicShellEntry curEntry; + //WCHAR szTemp[100]; + LPOLESTR pstr; + + StringFromCLSID(szClass, &pstr); + + TRACE("SH_LoadDynamicContextMenuHandler entered with This %p hKey %p szClass %s bExternalInit %u\n",This, hKey, wine_dbgstr_guid(szClass), bExternalInit); + //swprintf(szTemp, L"This %p hKey %p szClass %s bExternalInit %u", This, hKey, pstr, bExternalInit); + //MessageBoxW(NULL, szTemp, NULL, MB_OK); + + if (IsShellExtensionAlreadyLoaded(This, szClass)) + return S_OK; + + hr = SHCoCreateInstance(NULL, szClass, NULL, &IID_IContextMenu, (void**)&cmobj); + if (hr != S_OK) + { + TRACE("SHCoCreateInstance failed %x\n", GetLastError()); + return hr; + } + + if (bExternalInit) + { + hr = IContextMenu_QueryInterface(cmobj, &IID_IShellExtInit, (void**)&shext); + if (hr != S_OK) + { + TRACE("Failed to query for interface IID_IShellExtInit\n"); + IContextMenu_Release(cmobj); + return FALSE; + } + hr = IShellExtInit_Initialize(shext, NULL, This->pDataObj, hKey); + IShellExtInit_Release(shext); + if (hr != S_OK) + { + TRACE("Failed to initialize shell extension error %x\n", hr); + IContextMenu_Release(cmobj); + return hr; + } + } + + curEntry = HeapAlloc(GetProcessHeap(), 0, sizeof(DynamicShellEntry)); + if(!curEntry) + { + IContextMenu_Release(cmobj); + return E_OUTOFMEMORY; + } + + curEntry->iIdCmdFirst = 0; + curEntry->Next = NULL; + curEntry->NumIds = 0; + curEntry->CMenu = cmobj; + memcpy(&curEntry->ClassID, szClass, sizeof(CLSID)); + + if (This->dhead) + { + PDynamicShellEntry pEntry = This->dhead; + + while(pEntry->Next) + { + pEntry = pEntry->Next; + } + + pEntry->Next = curEntry; + } + else + { + This->dhead = curEntry; + } + + + if (!memcmp(szClass, &CLSID_NewMenu, sizeof(CLSID))) + { + /* A REAL UGLY HACK */ + INewItem_SetCurrentShellFolder(This->dcm.psf); + } + + + return hr; +} + +static +UINT +EnumerateDynamicContextHandlerForKey(IDefaultContextMenuImpl *This, HKEY hRootKey) +{ + WCHAR szKey[MAX_PATH] = {0}; + WCHAR szName[MAX_PATH] = {0}; + DWORD dwIndex, dwName; + LONG res; + HRESULT hResult; + UINT index; + CLSID clsid; + HKEY hKey; + + static const WCHAR szShellEx[] = { 's','h','e','l','l','e','x','\\','C','o','n','t','e','x','t','M','e','n','u','H','a','n','d','l','e','r','s',0 }; + + if (RegOpenKeyExW(hRootKey, szShellEx, 0, KEY_READ, &hKey) != ERROR_SUCCESS) + { + TRACE("RegOpenKeyExW failed for key %s\n", debugstr_w(szKey)); + return 0; + } + + dwIndex = 0; + index = 0; + do + { + dwName = MAX_PATH; + res = RegEnumKeyExW(hKey, dwIndex, szName, &dwName, NULL, NULL, NULL, NULL); + if (res == ERROR_SUCCESS) + { + hResult = CLSIDFromString(szName, &clsid); + if (hResult != S_OK) + { + dwName = MAX_PATH; + if (RegGetValueW(hKey, szName, NULL, RRF_RT_REG_SZ, NULL, szKey, &dwName) == ERROR_SUCCESS) + { + hResult = CLSIDFromString(szKey, &clsid); + } + } + if (SUCCEEDED(hResult)) + { + if (This->bGroupPolicyActive) + { + if (RegGetValueW(HKEY_LOCAL_MACHINE, + L"Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved", + szKey, + RRF_RT_REG_SZ, + NULL, + NULL, + &dwName) == ERROR_SUCCESS) + { + SH_LoadDynamicContextMenuHandler(This, hKey, &clsid, TRUE); + } + } + else + { + SH_LoadDynamicContextMenuHandler(This, hKey, &clsid, TRUE); + } + } + } + dwIndex++; + }while(res == ERROR_SUCCESS); + + RegCloseKey(hKey); + return index; +} + + +static +UINT +InsertMenuItemsOfDynamicContextMenuExtension(IDefaultContextMenuImpl * This, HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast) +{ + PDynamicShellEntry curEntry; + HRESULT hResult; + + if (!This->dhead) + { + This->iIdSHEFirst = 0; + This->iIdSHELast = 0; + return indexMenu; + } + + curEntry = This->dhead; + idCmdFirst = 0x5000; + idCmdLast = 0x6000; + This->iIdSHEFirst = idCmdFirst; + do + { + hResult = IContextMenu_QueryContextMenu(curEntry->CMenu, hMenu, indexMenu++, idCmdFirst, idCmdLast, CMF_NORMAL); + if (SUCCEEDED(hResult)) + { + curEntry->iIdCmdFirst = idCmdFirst; + curEntry->NumIds = LOWORD(hResult); + indexMenu += curEntry->NumIds; + idCmdFirst += curEntry->NumIds + 0x10; + } + TRACE("curEntry %p hresult %x contextmenu %p cmdfirst %x num ids %x\n", curEntry, hResult, curEntry->CMenu, curEntry->iIdCmdFirst, curEntry->NumIds); + curEntry = curEntry->Next; + }while(curEntry); + + This->iIdSHELast = idCmdFirst; + TRACE("SH_LoadContextMenuHandlers first %x last %x\n", This->iIdSHEFirst, This->iIdSHELast); + return indexMenu; +} + +UINT +BuildBackgroundContextMenu( + IDefaultContextMenuImpl * This, + HMENU hMenu, + UINT iIdCmdFirst, + UINT iIdCmdLast, + UINT uFlags) +{ + MENUITEMINFOW mii; + WCHAR szBuffer[MAX_PATH]; + UINT indexMenu = 0; + HMENU hSubMenu; + HKEY hKey; + + ZeroMemory(&mii, sizeof(mii)); + + TRACE("BuildBackgroundContextMenu entered\n"); + + if (!_ILIsDesktop(This->dcm.pidlFolder)) + { + /* view option is only available in browsing mode */ + hSubMenu = LoadMenuA(shell32_hInstance, "MENU_001"); + if (hSubMenu) + { + szBuffer[0] = 0; + LoadStringW(shell32_hInstance, FCIDM_SHVIEW_VIEW, szBuffer, MAX_PATH); + szBuffer[MAX_PATH-1] = 0; + + TRACE("szBuffer %s\n", debugstr_w(szBuffer)); + + mii.cbSize = sizeof(mii); + mii.fMask = MIIM_TYPE | MIIM_STATE | MIIM_SUBMENU | MIIM_ID; + mii.fType = MFT_STRING; + mii.wID = iIdCmdFirst++; + mii.dwTypeData = szBuffer; + mii.cch = wcslen( mii.dwTypeData ); + mii.fState = MFS_ENABLED; + mii.hSubMenu = hSubMenu; + InsertMenuItemW(hMenu, indexMenu++, TRUE, &mii); + DestroyMenu(hSubMenu); + } + } + hSubMenu = LoadMenuW(shell32_hInstance, L"MENU_002"); + if (hSubMenu) + { + /* merge general background context menu in */ + iIdCmdFirst = Shell_MergeMenus(hMenu, GetSubMenu(hSubMenu, 0), indexMenu, 0, 0xFFFF, MM_DONTREMOVESEPS | MM_SUBMENUSHAVEIDS) + 1; + DestroyMenu(hSubMenu); + } + + if (!HasClipboardData()) + { + TRACE("disabling paste options\n"); + DisablePasteOptions(hMenu); + } + /* load extensions from HKCR\* key */ + if (RegOpenKeyExW(HKEY_CLASSES_ROOT, + L"*", + 0, + KEY_READ, + &hKey) == ERROR_SUCCESS) + { + EnumerateDynamicContextHandlerForKey(This, hKey); + RegCloseKey(hKey); + } + + /* load create new shell extension */ + if (RegOpenKeyExW(HKEY_CLASSES_ROOT, + L"CLSID\\{D969A300-E7FF-11d0-A93B-00A0C90F2719}", + 0, + KEY_READ, + &hKey) == ERROR_SUCCESS) + { + SH_LoadDynamicContextMenuHandler(This, hKey, &CLSID_NewMenu, TRUE); + RegCloseKey(hKey); + } + + if (InsertMenuItemsOfDynamicContextMenuExtension(This, hMenu, GetMenuItemCount(hMenu)-1, iIdCmdFirst, iIdCmdLast)) + { + /* seperate dynamic context menu items */ + _InsertMenuItemW(hMenu, GetMenuItemCount(hMenu)-1, TRUE, -1, MFT_SEPARATOR, NULL, MFS_ENABLED); + } + + return iIdCmdLast; +} + +static +UINT +AddStaticContextMenusToMenu( + HMENU hMenu, + UINT indexMenu, + IDefaultContextMenuImpl * This) +{ + MENUITEMINFOW mii; + UINT idResource; + PStaticShellEntry curEntry; + WCHAR szVerb[40]; + WCHAR szTemp[50]; + DWORD dwSize; + UINT fState; + UINT Length; + + mii.cbSize = sizeof(mii); + mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE | MIIM_DATA; + mii.fType = MFT_STRING; + mii.fState = MFS_ENABLED | MFS_DEFAULT; + mii.wID = 0x4000; + This->iIdSCMFirst = mii.wID; + + curEntry = This->shead; + + while(curEntry) + { + fState = MFS_ENABLED; + if (!wcsicmp(curEntry->szVerb, L"open")) + { + fState |= MFS_DEFAULT; + idResource = IDS_OPEN_VERB; + } + else if (!wcsicmp(curEntry->szVerb, L"runas")) + idResource = IDS_RUNAS_VERB; + else if (!wcsicmp(curEntry->szVerb, L"edit")) + idResource = IDS_EDIT_VERB; + else if (!wcsicmp(curEntry->szVerb, L"find")) + idResource = IDS_FIND_VERB; + else if (!wcsicmp(curEntry->szVerb, L"print")) + idResource = IDS_PRINT_VERB; + else if (!wcsicmp(curEntry->szVerb, L"play")) + idResource = IDS_PLAY_VERB; + else if (!wcsicmp(curEntry->szVerb, L"preview")) + idResource = IDS_PREVIEW_VERB; + else + idResource = 0; + + if (idResource > 0) + { + if (LoadStringW(shell32_hInstance, idResource, szVerb, sizeof(szVerb)/sizeof(WCHAR))) + { + /* use translated verb */ + szVerb[(sizeof(szVerb)/sizeof(WCHAR))-1] = L'\0'; + mii.dwTypeData = szVerb; + } + } + else + { + Length = wcslen(curEntry->szClass) + wcslen(curEntry->szVerb) + 8; + if (Length < sizeof(szTemp)/sizeof(WCHAR)) + { + wcscpy(szTemp, curEntry->szClass); + wcscat(szTemp, L"\\shell\\"); + wcscat(szTemp, curEntry->szVerb); + dwSize = sizeof(szVerb); + + if (RegGetValueW(HKEY_CLASSES_ROOT, szTemp, NULL, RRF_RT_REG_SZ, NULL, szVerb, &dwSize) == ERROR_SUCCESS) + { + /* use description for the menu entry */ + mii.dwTypeData = szVerb; + } + else + { + /* use verb for the menu entry */ + mii.dwTypeData = curEntry->szVerb; + } + } + + } + + mii.cch = wcslen(mii.dwTypeData); + InsertMenuItemW(hMenu, indexMenu++, TRUE, &mii); + mii.fState = fState; + mii.wID++; + curEntry = curEntry->Next; + } + This->iIdSCMLast = mii.wID - 1; + return indexMenu; +} + +void WINAPI _InsertMenuItemW ( + HMENU hmenu, + UINT indexMenu, + BOOL fByPosition, + UINT wID, + UINT fType, + LPCWSTR dwTypeData, + UINT fState) +{ + MENUITEMINFOW mii; + WCHAR szText[100]; + + ZeroMemory(&mii, sizeof(mii)); + mii.cbSize = sizeof(mii); + if (fType == MFT_SEPARATOR) + { + mii.fMask = MIIM_ID | MIIM_TYPE; + } + else if (fType == MFT_STRING) + { + mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE; + if ((ULONG_PTR)HIWORD((ULONG_PTR)dwTypeData) == 0) + { + if (LoadStringW(shell32_hInstance, LOWORD((ULONG_PTR)dwTypeData), szText, sizeof(szText)/sizeof(WCHAR))) + { + szText[(sizeof(szText)/sizeof(WCHAR))-1] = 0; + mii.dwTypeData = szText; + } + else + { + TRACE("failed to load string %p\n", dwTypeData); + return; + } + } + else + { + mii.dwTypeData = (LPWSTR) dwTypeData; + } + mii.fState = fState; + } + + mii.wID = wID; + mii.fType = fType; + InsertMenuItemW( hmenu, indexMenu, fByPosition, &mii); +} + +UINT +BuildShellItemContextMenu( + IDefaultContextMenuImpl * This, + HMENU hMenu, + UINT iIdCmdFirst, + UINT iIdCmdLast, + UINT uFlags) +{ + WCHAR szPath[MAX_PATH]; + WCHAR szTemp[40]; + HKEY hKey; + UINT indexMenu; + SFGAOF rfg; + HRESULT hr; + BOOL bAddSep; + GUID * guid; + BOOL bClipboardData; + STRRET strFile; + LPWSTR pOffset; + DWORD dwSize; + + TRACE("BuildShellItemContextMenu entered\n"); + + if (IShellFolder2_GetDisplayNameOf(This->dcm.psf, This->dcm.apidl[0], SHGDN_FORPARSING, &strFile) == S_OK) + { + if (StrRetToBufW(&strFile, This->dcm.apidl[0], szPath, MAX_PATH) == S_OK) + { + pOffset = wcsrchr(szPath, L'.'); + if (pOffset) + { + /* enumerate dynamic/static for a given file class */ + if (RegOpenKeyExW(HKEY_CLASSES_ROOT, pOffset, 0, KEY_READ, &hKey) == ERROR_SUCCESS) + { + /* add static verbs */ + SH_AddStaticEntryForFileClass(This, pOffset); + /* load dynamic extensions from file extension key */ + EnumerateDynamicContextHandlerForKey(This, hKey); + RegCloseKey(hKey); + } + dwSize = sizeof(szTemp); + if (RegGetValueW(HKEY_CLASSES_ROOT, pOffset, NULL, RRF_RT_REG_SZ, NULL, szTemp, &dwSize) == ERROR_SUCCESS) + { + if (RegOpenKeyExW(HKEY_CLASSES_ROOT, szTemp, 0, KEY_READ, &hKey) == ERROR_SUCCESS) + { + /* add static verbs from progid key */ + SH_AddStaticEntryForFileClass(This, szTemp); + /* load dynamic extensions from progid key */ + EnumerateDynamicContextHandlerForKey(This, hKey); + RegCloseKey(hKey); + } + } + } + if (RegOpenKeyExW(HKEY_CLASSES_ROOT, L"*", 0, KEY_READ, &hKey) == ERROR_SUCCESS) + { + /* load default extensions */ + EnumerateDynamicContextHandlerForKey(This, hKey); + RegCloseKey(hKey); + } + } + } + + guid = _ILGetGUIDPointer(This->dcm.apidl[0]); + if (guid) + { + LPOLESTR pwszCLSID; + WCHAR buffer[60]; + + wcscpy(buffer, L"CLSID\\"); + hr = StringFromCLSID(guid, &pwszCLSID); + if (hr == S_OK) + { + wcscpy(&buffer[6], pwszCLSID); + TRACE("buffer %s\n", debugstr_w(buffer)); + if (RegOpenKeyExW(HKEY_CLASSES_ROOT, buffer, 0, KEY_READ, &hKey) == ERROR_SUCCESS) + { + EnumerateDynamicContextHandlerForKey(This, hKey); + SH_AddStaticEntryForFileClass(This, buffer); + RegCloseKey(hKey); + } + CoTaskMemFree(pwszCLSID); + } + } + + + if (_ILIsDrive(This->dcm.apidl[0])) + { + SH_AddStaticEntryForFileClass(This, L"Drive"); + if (RegOpenKeyExW(HKEY_CLASSES_ROOT, L"Drive", 0, KEY_READ, &hKey) == ERROR_SUCCESS) + { + EnumerateDynamicContextHandlerForKey(This, hKey); + RegCloseKey(hKey); + } + + } + + /* add static actions */ + rfg = SFGAO_BROWSABLE | SFGAO_CANCOPY | SFGAO_CANLINK | SFGAO_CANMOVE | SFGAO_CANDELETE | SFGAO_CANRENAME | SFGAO_HASPROPSHEET | SFGAO_FILESYSTEM | SFGAO_FOLDER; + hr = IShellFolder_GetAttributesOf(This->dcm.psf, This->dcm.cidl, This->dcm.apidl, &rfg); + if (!SUCCEEDED(hr)) + rfg = 0; + + if (rfg & SFGAO_FOLDER) + { + /* add the default verbs open / explore */ + SH_AddStaticEntryForFileClass(This, L"Folder"); + SH_AddStaticEntryForFileClass(This, L"Directory"); + if (RegOpenKeyExW(HKEY_CLASSES_ROOT, L"Folder", 0, KEY_READ, &hKey) == ERROR_SUCCESS) + { + EnumerateDynamicContextHandlerForKey(This, hKey); + RegCloseKey(hKey); + } + if (RegOpenKeyExW(HKEY_CLASSES_ROOT, L"Directory", 0, KEY_READ, &hKey) == ERROR_SUCCESS) + { + EnumerateDynamicContextHandlerForKey(This, hKey); + RegCloseKey(hKey); + } + } + + + if (rfg & SFGAO_FILESYSTEM) + { + if (RegOpenKeyExW(HKEY_CLASSES_ROOT, L"AllFilesystemObjects", 0, KEY_READ, &hKey) == ERROR_SUCCESS) + { + /* sendto service is registered here */ + EnumerateDynamicContextHandlerForKey(This, hKey); + RegCloseKey(hKey); + } + } + + /* add static context menu handlers */ + indexMenu = AddStaticContextMenusToMenu(hMenu, 0, This); + /* now process dynamic context menu handlers */ + indexMenu = InsertMenuItemsOfDynamicContextMenuExtension(This, hMenu, indexMenu, iIdCmdFirst, iIdCmdLast); + TRACE("indexMenu %d\n", indexMenu); + + if (_ILIsDrive(This->dcm.apidl[0])) + { + /* The 'Format' option must be always available, + * thus it is not registered as a static shell extension + */ + _InsertMenuItemW(hMenu, indexMenu++, TRUE, 0, MFT_SEPARATOR, NULL, 0); + _InsertMenuItemW(hMenu, indexMenu++, TRUE, 0x7ABC, MFT_STRING, MAKEINTRESOURCEW(IDS_FORMATDRIVE), MFS_ENABLED); + bAddSep = TRUE; + } + + bClipboardData = (HasClipboardData() && (rfg & SFGAO_FILESYSTEM)); + if (rfg & (SFGAO_CANCOPY | SFGAO_CANMOVE) || bClipboardData) + { + _InsertMenuItemW(hMenu, indexMenu++, TRUE, 0, MFT_SEPARATOR, NULL, 0); + if (rfg & SFGAO_CANMOVE) + _InsertMenuItemW(hMenu, indexMenu++, TRUE, FCIDM_SHVIEW_CUT, MFT_STRING, MAKEINTRESOURCEW(IDS_CUT), MFS_ENABLED); + if (rfg & SFGAO_CANCOPY) + _InsertMenuItemW(hMenu, indexMenu++, TRUE, FCIDM_SHVIEW_COPY, MFT_STRING, MAKEINTRESOURCEW(IDS_COPY), MFS_ENABLED); + if (bClipboardData) + _InsertMenuItemW(hMenu, indexMenu++, TRUE, FCIDM_SHVIEW_INSERT, MFT_STRING, MAKEINTRESOURCEW(IDS_INSERT), MFS_ENABLED); + + bAddSep = TRUE; + } + + + if (rfg & SFGAO_CANLINK) + { + bAddSep = FALSE; + _InsertMenuItemW(hMenu, indexMenu++, TRUE, 0, MFT_SEPARATOR, NULL, 0); + _InsertMenuItemW(hMenu, indexMenu++, TRUE, FCIDM_SHVIEW_CREATELINK, MFT_STRING, MAKEINTRESOURCEW(IDS_CREATELINK), MFS_ENABLED); + } + + + if (rfg & SFGAO_CANDELETE) + { + if (bAddSep) + { + bAddSep = FALSE; + _InsertMenuItemW(hMenu, indexMenu++, TRUE, 0, MFT_SEPARATOR, NULL, 0); + } + _InsertMenuItemW(hMenu, indexMenu++, TRUE, FCIDM_SHVIEW_DELETE, MFT_STRING, MAKEINTRESOURCEW(IDS_DELETE), MFS_ENABLED); + } + + if (rfg & SFGAO_CANRENAME) + { + if (bAddSep) + { + _InsertMenuItemW(hMenu, indexMenu++, TRUE, 0, MFT_SEPARATOR, NULL, 0); + } + _InsertMenuItemW(hMenu, indexMenu++, TRUE, FCIDM_SHVIEW_RENAME, MFT_STRING, MAKEINTRESOURCEW(IDS_RENAME), MFS_ENABLED); + bAddSep = TRUE; + } + + if (rfg & SFGAO_HASPROPSHEET) + { + _InsertMenuItemW(hMenu, indexMenu++, TRUE, 0, MFT_SEPARATOR, NULL, 0); + _InsertMenuItemW(hMenu, indexMenu++, TRUE, FCIDM_SHVIEW_PROPERTIES, MFT_STRING, MAKEINTRESOURCEW(IDS_PROPERTIES), MFS_ENABLED); + } + + return iIdCmdLast; +} + +static +HRESULT +WINAPI +IDefaultContextMenu_fnQueryContextMenu( + IContextMenu2 *iface, + HMENU hmenu, + UINT indexMenu, + UINT idCmdFirst, + UINT idCmdLast, + UINT uFlags) +{ + IDefaultContextMenuImpl * This = impl_from_IContextMenu(iface); + if (This->dcm.cidl) + { + idCmdFirst = BuildShellItemContextMenu(This, hmenu, idCmdFirst, idCmdLast, uFlags); + } + else + { + idCmdFirst = BuildBackgroundContextMenu(This, hmenu, idCmdFirst, idCmdLast, uFlags); + } + + return S_OK; +} + +static +HRESULT +NotifyShellViewWindow(LPCMINVOKECOMMANDINFO lpcmi, BOOL bRefresh) +{ + LPSHELLBROWSER lpSB; + LPSHELLVIEW lpSV = NULL; + HWND hwndSV = NULL; + + if((lpSB = (LPSHELLBROWSER)SendMessageA(lpcmi->hwnd, CWM_GETISHELLBROWSER,0,0))) + { + if(SUCCEEDED(IShellBrowser_QueryActiveShellView(lpSB, &lpSV))) + { + IShellView_GetWindow(lpSV, &hwndSV); + } + } + + if (LOWORD(lpcmi->lpVerb) == FCIDM_SHVIEW_REFRESH || bRefresh) + { + if (lpSV) + IShellView_Refresh(lpSV); + + return S_OK; + } + + SendMessageW(hwndSV, WM_COMMAND, MAKEWPARAM(LOWORD(lpcmi->lpVerb), 0), 0); + + return S_OK; +} + +static +HRESULT +DoPaste( + IDefaultContextMenuImpl *This, + LPCMINVOKECOMMANDINFO lpcmi) +{ + IDataObject * pda; + STGMEDIUM medium; + FORMATETC formatetc; + LPITEMIDLIST * apidl; + LPITEMIDLIST pidl; + IShellFolder *psfFrom = NULL, *psfDesktop, *psfTarget = NULL; + LPIDA lpcida; + ISFHelper *psfhlpdst, *psfhlpsrc; + HRESULT hr; + + if (OleGetClipboard(&pda) != S_OK) + return E_FAIL; + + InitFormatEtc(formatetc, RegisterClipboardFormatA(CFSTR_SHELLIDLIST), TYMED_HGLOBAL); + hr = IDataObject_GetData(pda,&formatetc,&medium); + + if (FAILED(hr)) + { + IDataObject_Release(pda); + return E_FAIL; + } + + /* lock the handle */ + lpcida = GlobalLock(medium.u.hGlobal); + if (!lpcida) + { + ReleaseStgMedium(&medium); + IDataObject_Release(pda); + return E_FAIL; + } + + /* convert the data into pidl */ + apidl = _ILCopyCidaToaPidl(&pidl, lpcida); + + if (!apidl) + return E_FAIL; + + if (FAILED(SHGetDesktopFolder(&psfDesktop))) + { + SHFree(pidl); + _ILFreeaPidl(apidl, lpcida->cidl); + ReleaseStgMedium(&medium); + IDataObject_Release(pda); + return E_FAIL; + } + + if (FAILED(IShellFolder_BindToObject(psfDesktop, pidl, NULL, &IID_IShellFolder, (LPVOID*)&psfFrom))) + { + ERR("no IShellFolder\n"); + + IShellFolder_Release(psfDesktop); + SHFree(pidl); + _ILFreeaPidl(apidl, lpcida->cidl); + ReleaseStgMedium(&medium); + IDataObject_Release(pda); + + return E_FAIL; + } + + IShellFolder_Release(psfDesktop); + + if (FAILED(IShellFolder_BindToObject(This->dcm.psf, This->dcm.apidl[0], NULL, &IID_IShellFolder, (LPVOID*)&psfTarget))) + { + ERR("no IShellFolder\n"); + + IShellFolder_Release(psfFrom); + SHFree(pidl); + _ILFreeaPidl(apidl, lpcida->cidl); + ReleaseStgMedium(&medium); + IDataObject_Release(pda); + + return E_FAIL; + } + + + /* get source and destination shellfolder */ + if (FAILED(IShellFolder_QueryInterface(psfTarget, &IID_ISFHelper, (LPVOID*)&psfhlpdst))) + { + ERR("no IID_ISFHelper for destination\n"); + + IShellFolder_Release(psfFrom); + IShellFolder_Release(psfTarget); + SHFree(pidl); + _ILFreeaPidl(apidl, lpcida->cidl); + ReleaseStgMedium(&medium); + IDataObject_Release(pda); + + return E_FAIL; + } + + if (FAILED(IShellFolder_QueryInterface(psfFrom, &IID_ISFHelper, (LPVOID*)&psfhlpsrc))) + { + ERR("no IID_ISFHelper for source\n"); + + ISFHelper_Release(psfhlpdst); + IShellFolder_Release(psfFrom); + IShellFolder_Release(psfTarget); + SHFree(pidl); + _ILFreeaPidl(apidl, lpcida->cidl); + ReleaseStgMedium(&medium); + IDataObject_Release(pda); + return E_FAIL; + } + + /* FIXXME + * do we want to perform a copy or move ??? + */ + hr = ISFHelper_CopyItems(psfhlpdst, psfFrom, lpcida->cidl, (LPCITEMIDLIST*)apidl); + + ISFHelper_Release(psfhlpdst); + ISFHelper_Release(psfhlpsrc); + IShellFolder_Release(psfFrom); + IShellFolder_Release(psfTarget); + SHFree(pidl); + _ILFreeaPidl(apidl, lpcida->cidl); + ReleaseStgMedium(&medium); + IDataObject_Release(pda); + return S_OK; +} + +static +HRESULT +DoOpenOrExplore( + IDefaultContextMenuImpl *iface, + LPCMINVOKECOMMANDINFO lpcmi) +{ + + + return E_FAIL; +} + +BOOL +GetUniqueFileName(LPWSTR szBasePath, LPWSTR szExt, LPWSTR szTarget, BOOL bShortcut) +{ + UINT RetryCount = 0, Length; + WCHAR szLnk[40]; + HANDLE hFile; + + if (!bShortcut) + { + Length = LoadStringW(shell32_hInstance, IDS_LNK_FILE, szLnk, sizeof(szLnk)/sizeof(WCHAR)); + } + + do + { + if (!bShortcut) + { + if (RetryCount) + swprintf(szTarget, L"%s%s(%u).%s", szLnk, szBasePath, RetryCount, szExt); + else + swprintf(szTarget, L"%s%s.%s", szLnk, szBasePath, szExt); + } + else + { + if (RetryCount) + swprintf(szTarget, L"%s(%u).%s", szBasePath, RetryCount, szExt); + else + swprintf(szTarget, L"%s.%s", szBasePath, szExt); + } + + hFile = CreateFileW(szTarget, GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); + if (hFile != INVALID_HANDLE_VALUE) + { + CloseHandle(hFile); + return TRUE; + } + + }while(RetryCount++ < 100); + + return FALSE; + +} + +static +HRESULT +DoCreateLink( + IDefaultContextMenuImpl *This, + LPCMINVOKECOMMANDINFO lpcmi) +{ + WCHAR szPath[MAX_PATH]; + WCHAR szTarget[MAX_PATH] = {0}; + STRRET strFile; + LPWSTR pszExt; + HRESULT hr; + IShellLinkW * nLink; + IPersistFile * ipf; + static WCHAR szLnk[] = L"lnk"; + + if (IShellFolder2_GetDisplayNameOf(This->dcm.psf, This->dcm.apidl[0], SHGDN_FORPARSING, &strFile) != S_OK) + { + ERR("IShellFolder_GetDisplayNameOf failed for apidl\n"); + return E_FAIL; + } + + if (StrRetToBufW(&strFile, This->dcm.apidl[0], szPath, MAX_PATH) != S_OK) + return E_FAIL; + + + pszExt = wcsrchr(szPath, L'.'); + pszExt[0] = 0; + + if (!wcsicmp(pszExt + 1, szLnk)) + { + if (!GetUniqueFileName(szPath, pszExt + 1, szTarget, TRUE)) + return E_FAIL; + + hr = IShellLink_ConstructFromFile(NULL, &IID_IPersistFile, This->dcm.apidl[0], (LPVOID*)&ipf); + if (hr != S_OK) + { + return hr; + } + hr = IPersistFile_Save(ipf, szTarget, FALSE); + IPersistFile_Release(ipf); + NotifyShellViewWindow(lpcmi, TRUE); + return hr; + } + else + { + if (!GetUniqueFileName(szPath, szLnk, szTarget, TRUE)) + return E_FAIL; + + hr = IShellLink_Constructor(NULL, &IID_IShellLinkW, (LPVOID*)&nLink); + if (hr != S_OK) + { + return E_FAIL; + } + pszExt[0] = '.'; + if (SUCCEEDED(IShellLinkW_SetPath(nLink, szPath))) + { + if (SUCCEEDED(IShellLinkW_QueryInterface(nLink, &IID_IPersistFile, (LPVOID*)&ipf))) + { + hr = IPersistFile_Save(ipf, szTarget, TRUE); + IPersistFile_Release(ipf); + } + } + IShellLinkW_Release(nLink); + NotifyShellViewWindow(lpcmi, TRUE); + return hr; + } +} + +static +HRESULT +DoDelete( + IDefaultContextMenuImpl *This, + LPCMINVOKECOMMANDINFO lpcmi) +{ + HRESULT hr; + STRRET strTemp; + WCHAR szPath[MAX_PATH]; + SHFILEOPSTRUCTW op; + int ret; + LPSHELLBROWSER lpSB; + HWND hwnd; + + + hr = IShellFolder2_GetDisplayNameOf(This->dcm.psf, This->dcm.apidl[0], SHGDN_FORPARSING, &strTemp); + if(hr != S_OK) + { + ERR("IShellFolder_GetDisplayNameOf failed with %x\n", hr); + return hr; + } + ZeroMemory(szPath, sizeof(szPath)); + hr = StrRetToBufW(&strTemp, This->dcm.apidl[0], szPath, MAX_PATH); + if (hr != S_OK) + { + ERR("StrRetToBufW failed with %x\n", hr); + return hr; + } + /* FIXME + * implement deletion with multiple files + */ + + ZeroMemory(&op, sizeof(op)); + op.hwnd = GetActiveWindow(); + op.wFunc = FO_DELETE; + op.pFrom = szPath; + op.fFlags = FOF_ALLOWUNDO; + ret = SHFileOperationW(&op); + + if (ret) + { + TRACE("SHFileOperation failed with %0x%x", GetLastError()); + return S_OK; + } + + /* get the active IShellView */ + if ((lpSB = (LPSHELLBROWSER)SendMessageA(lpcmi->hwnd, CWM_GETISHELLBROWSER,0,0))) + { + /* is the treeview focused */ + if (SUCCEEDED(IShellBrowser_GetControlWindow(lpSB, FCW_TREE, &hwnd))) + { + HTREEITEM hItem = TreeView_GetSelection(hwnd); + if (hItem) + { + (void)TreeView_DeleteItem(hwnd, hItem); + } + } + } + NotifyShellViewWindow(lpcmi, TRUE); + + return S_OK; + +} + +static +HRESULT +DoCopyOrCut( + IDefaultContextMenuImpl *iface, + LPCMINVOKECOMMANDINFO lpcmi, + BOOL bCopy) +{ + LPSHELLBROWSER lpSB; + LPSHELLVIEW lpSV; + LPDATAOBJECT lpDo; + HRESULT hr; + + lpSB = (LPSHELLBROWSER)SendMessageA(lpcmi->hwnd, CWM_GETISHELLBROWSER,0,0); + if (!lpSB) + { + TRACE("failed to get shellbrowser\n"); + return E_FAIL; + } + + hr = IShellBrowser_QueryActiveShellView(lpSB, &lpSV); + if (FAILED(hr)) + { + TRACE("failed to query the active shellview\n"); + return hr; + } + + hr = IShellView_GetItemObject(lpSV, SVGIO_SELECTION, &IID_IDataObject, (LPVOID*)&lpDo); + if (FAILED(hr)) + { + TRACE("failed to get item object\n"); + return hr; + } + + hr = OleSetClipboard(lpDo); + if (FAILED(hr)) + { + WARN("OleSetClipboard failed"); + } + IDataObject_Release(lpDo); + IShellView_Release(lpSV); + return S_OK; +} + +static +HRESULT +DoRename( + IDefaultContextMenuImpl *This, + LPCMINVOKECOMMANDINFO lpcmi) +{ + LPSHELLBROWSER lpSB; + LPSHELLVIEW lpSV; + HWND hwnd; + + /* get the active IShellView */ + if ((lpSB = (LPSHELLBROWSER)SendMessageA(lpcmi->hwnd, CWM_GETISHELLBROWSER,0,0))) + { + /* is the treeview focused */ + if (SUCCEEDED(IShellBrowser_GetControlWindow(lpSB, FCW_TREE, &hwnd))) + { + HTREEITEM hItem = TreeView_GetSelection(hwnd); + if (hItem) + { + (void)TreeView_EditLabel(hwnd, hItem); + } + } + + if(SUCCEEDED(IShellBrowser_QueryActiveShellView(lpSB, &lpSV))) + { + IShellView_SelectItem(lpSV, This->dcm.apidl[0], + SVSI_DESELECTOTHERS|SVSI_EDIT|SVSI_ENSUREVISIBLE|SVSI_FOCUSED|SVSI_SELECT); + IShellView_Release(lpSV); + return S_OK; + } + } + return E_FAIL; +} + +static +HRESULT +DoProperties( + IDefaultContextMenuImpl *This, + LPCMINVOKECOMMANDINFO lpcmi) +{ + WCHAR szDrive[MAX_PATH]; + STRRET strFile; + + if (This->dcm.cidl &&_ILIsMyComputer(This->dcm.apidl[0])) + { + ShellExecuteW(lpcmi->hwnd, L"open", L"rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl", NULL, NULL, SW_SHOWNORMAL); + return S_OK; + } + else if (This->dcm.cidl == 0 && _ILIsDesktop(This->dcm.pidlFolder)) + { + ShellExecuteW(lpcmi->hwnd, L"open", L"rundll32.exe shell32.dll,Control_RunDLL desk.cpl", NULL, NULL, SW_SHOWNORMAL); + return S_OK; + } + else if (_ILIsDrive(This->dcm.apidl[0])) + { + ILGetDisplayName(This->dcm.apidl[0], szDrive); + SH_ShowDriveProperties(szDrive, This->dcm.pidlFolder, This->dcm.apidl); + return S_OK; + } + else if (_ILIsNetHood(This->dcm.apidl[0])) + { + /* FIXME + * implement nethood properties + */ + FIXME("implement network connection shell folder\n"); + return S_OK; + } + else if (_ILIsBitBucket(This->dcm.apidl[0])) + { + /* FIXME + * detect the drive path of bitbucket if appropiate + */ + + SH_ShowRecycleBinProperties(L'C'); + return S_OK; + } + + if (This->dcm.cidl > 1) + WARN("SHMultiFileProperties is not yet implemented\n"); + + if (IShellFolder2_GetDisplayNameOf(This->dcm.psf, This->dcm.apidl[0], SHGDN_FORPARSING, &strFile) != S_OK) + { + ERR("IShellFolder_GetDisplayNameOf failed for apidl\n"); + return E_FAIL; + } + + if (StrRetToBufW(&strFile, This->dcm.apidl[0], szDrive, MAX_PATH) != S_OK) + return E_FAIL; + + return SH_ShowPropertiesDialog(szDrive, This->dcm.pidlFolder, This->dcm.apidl); +} + +static +HRESULT +DoFormat( + IDefaultContextMenuImpl *This, + LPCMINVOKECOMMANDINFO lpcmi) +{ + char sDrive[5] = {0}; + + if (!_ILGetDrive(This->dcm.apidl[0], sDrive, sizeof(sDrive))) + { + ERR("pidl is not a drive\n"); + return E_FAIL; + } + + SHFormatDrive(lpcmi->hwnd, sDrive[0] - 'A', SHFMT_ID_DEFAULT, 0); + return S_OK; +} + +static +HRESULT +DoDynamicShellExtensions( + IDefaultContextMenuImpl *This, + LPCMINVOKECOMMANDINFO lpcmi) +{ + UINT verb = LOWORD(lpcmi->lpVerb); + PDynamicShellEntry pCurrent = This->dhead; + + TRACE("verb %p first %x last %x", lpcmi->lpVerb, This->iIdSHEFirst, This->iIdSHELast); + + while(pCurrent && verb > pCurrent->iIdCmdFirst + pCurrent->NumIds) + pCurrent = pCurrent->Next; + + if (!pCurrent) + return E_FAIL; + + if (verb >= pCurrent->iIdCmdFirst && verb <= pCurrent->iIdCmdFirst + pCurrent->NumIds) + { + /* invoke the dynamic context menu */ + lpcmi->lpVerb = MAKEINTRESOURCEA(verb - pCurrent->iIdCmdFirst); + return IContextMenu_InvokeCommand(pCurrent->CMenu, lpcmi); + } + + return E_FAIL; +} + + +static +HRESULT +DoStaticShellExtensions( + IDefaultContextMenuImpl *This, + LPCMINVOKECOMMANDINFO lpcmi) +{ + STRRET strFile; + WCHAR szPath[MAX_PATH]; + SHELLEXECUTEINFOW sei; + PStaticShellEntry pCurrent = This->shead; + int verb = LOWORD(lpcmi->lpVerb) - This->iIdSCMFirst; + + + while(pCurrent && verb-- > 0) + pCurrent = pCurrent->Next; + + if (verb > 0) + return E_FAIL; + + + if (IShellFolder2_GetDisplayNameOf(This->dcm.psf, This->dcm.apidl[0], SHGDN_FORPARSING, &strFile) != S_OK) + { + ERR("IShellFolder_GetDisplayNameOf failed for apidl\n"); + return E_FAIL; + } + + if (StrRetToBufW(&strFile, This->dcm.apidl[0], szPath, MAX_PATH) != S_OK) + return E_FAIL; + + + ZeroMemory(&sei, sizeof(sei)); + sei.cbSize = sizeof(sei); + sei.fMask = SEE_MASK_CLASSNAME; + sei.lpClass = pCurrent->szClass; + sei.hwnd = lpcmi->hwnd; + sei.nShow = SW_SHOWNORMAL; + sei.lpVerb = pCurrent->szVerb; + sei.lpFile = szPath; + ShellExecuteExW(&sei); + return S_OK; + +} + +static +HRESULT +WINAPI +IDefaultContextMenu_fnInvokeCommand( + IContextMenu2 *iface, + LPCMINVOKECOMMANDINFO lpcmi) +{ + IDefaultContextMenuImpl * This = impl_from_IContextMenu(iface); + + switch(LOWORD(lpcmi->lpVerb)) + { + case FCIDM_SHVIEW_BIGICON: + case FCIDM_SHVIEW_SMALLICON: + case FCIDM_SHVIEW_LISTVIEW: + case FCIDM_SHVIEW_REPORTVIEW: + case 0x30: /* FIX IDS in resource files */ + case 0x31: + case 0x32: + case 0x33: + case FCIDM_SHVIEW_AUTOARRANGE: + case FCIDM_SHVIEW_SNAPTOGRID: + case FCIDM_SHVIEW_REFRESH: + return NotifyShellViewWindow(lpcmi, FALSE); + case FCIDM_SHVIEW_INSERT: + case FCIDM_SHVIEW_INSERTLINK: + return DoPaste(This, lpcmi); + case FCIDM_SHVIEW_OPEN: + case FCIDM_SHVIEW_EXPLORE: + return DoOpenOrExplore(This, lpcmi); + case FCIDM_SHVIEW_COPY: + case FCIDM_SHVIEW_CUT: + return DoCopyOrCut(This, lpcmi, LOWORD(lpcmi->lpVerb) == FCIDM_SHVIEW_COPY); + case FCIDM_SHVIEW_CREATELINK: + return DoCreateLink(This, lpcmi); + case FCIDM_SHVIEW_DELETE: + return DoDelete(This, lpcmi); + case FCIDM_SHVIEW_RENAME: + return DoRename(This, lpcmi); + case FCIDM_SHVIEW_PROPERTIES: + return DoProperties(This, lpcmi); + case 0x7ABC: + return DoFormat(This, lpcmi); + } + + if (This->iIdSHEFirst && This->iIdSHELast) + { + if (LOWORD(lpcmi->lpVerb) >= This->iIdSHEFirst && LOWORD(lpcmi->lpVerb) <= This->iIdSHELast) + { + return DoDynamicShellExtensions(This, lpcmi); + } + } + + if (This->iIdSCMFirst && This->iIdSCMLast) + { + if (LOWORD(lpcmi->lpVerb) >= This->iIdSCMFirst && LOWORD(lpcmi->lpVerb) <= This->iIdSCMLast) + { + return DoStaticShellExtensions(This, lpcmi); + } + } + + FIXME("Unhandled Verb %xl\n",LOWORD(lpcmi->lpVerb)); + return E_UNEXPECTED; +} + +static +HRESULT +WINAPI +IDefaultContextMenu_fnGetCommandString( + IContextMenu2 *iface, + UINT_PTR idCommand, + UINT uFlags, + UINT* lpReserved, + LPSTR lpszName, + UINT uMaxNameLen) +{ + + return S_OK; +} + +static +HRESULT +WINAPI +IDefaultContextMenu_fnHandleMenuMsg( + IContextMenu2 *iface, + UINT uMsg, + WPARAM wParam, + LPARAM lParam) +{ + + return S_OK; +} + +static const IContextMenu2Vtbl cmvt = +{ + IDefaultContextMenu_fnQueryInterface, + IDefaultContextMenu_fnAddRef, + IDefaultContextMenu_fnRelease, + IDefaultContextMenu_fnQueryContextMenu, + IDefaultContextMenu_fnInvokeCommand, + IDefaultContextMenu_fnGetCommandString, + IDefaultContextMenu_fnHandleMenuMsg +}; +static +HRESULT +IDefaultContextMenu_Constructor( + const DEFCONTEXTMENU *pdcm, + REFIID riid, + void **ppv) +{ + IDefaultContextMenuImpl * This; + HRESULT hr = E_FAIL; + IDataObject * pDataObj; + + This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDefaultContextMenuImpl)); + if (This) + { + This->lpVtbl = &cmvt; + This->ref = 1; + TRACE("cidl %u\n", This->dcm.cidl); + if (SUCCEEDED(SHCreateDataObject(pdcm->pidlFolder, pdcm->cidl, pdcm->apidl, NULL, &IID_IDataObject, (void**)&pDataObj))) + { + This->pDataObj = pDataObj; + } + CopyMemory(&This->dcm, pdcm, sizeof(DEFCONTEXTMENU)); + hr = IDefaultContextMenu_fnQueryInterface((IContextMenu2*)This, riid, ppv); + if (SUCCEEDED(hr)) + IContextMenu_Release((IContextMenu2*)This); + } + + TRACE("This(%p)(%x) cidl %u\n",This, hr, This->dcm.cidl); + return hr; +} + +/************************************************************************* + * SHCreateDefaultContextMenu [SHELL32.325] Vista API + * + */ + +HRESULT +WINAPI +SHCreateDefaultContextMenu( + const DEFCONTEXTMENU *pdcm, + REFIID riid, + void **ppv) +{ + HRESULT hr = E_FAIL; + + *ppv = NULL; + hr = IDefaultContextMenu_Constructor( pdcm, riid, ppv ); + + TRACE("pcm %p hr %x\n", pdcm, hr); + return hr; +} + +/************************************************************************* + * CDefFolderMenu_Create2 [SHELL32.701] + * + */ + +HRESULT +WINAPI +CDefFolderMenu_Create2( + LPCITEMIDLIST pidlFolder, + HWND hwnd, + UINT cidl, + LPCITEMIDLIST *apidl, + IShellFolder *psf, + LPFNDFMCALLBACK lpfn, + UINT nKeys, + const HKEY *ahkeyClsKeys, + IContextMenu **ppcm) +{ + DEFCONTEXTMENU pdcm; + HRESULT hr; + + pdcm.hwnd = hwnd; + pdcm.pcmcb = NULL; + pdcm.pidlFolder = pidlFolder; + pdcm.psf = psf; + pdcm.cidl = cidl; + pdcm.apidl = apidl; + pdcm.punkAssociationInfo = NULL; + pdcm.cKeys = nKeys; + pdcm.aKeys = ahkeyClsKeys; + + hr = SHCreateDefaultContextMenu(&pdcm, &IID_IContextMenu, (void**)ppcm); + return hr; +} + diff --git a/reactos/dll/win32/shell32/shv_item_cmenu.c b/reactos/dll/win32/shell32/shv_item_cmenu.c deleted file mode 100644 index 257f89152db..00000000000 --- a/reactos/dll/win32/shell32/shv_item_cmenu.c +++ /dev/null @@ -1,1373 +0,0 @@ -/* - * IContextMenu for items in the shellview - * - * Copyright 1998, 2000 Juergen Schmied - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include - -#define COBJMACROS -#define NONAMELESSUNION -#define NONAMELESSSTRUCT -#include "winerror.h" -#include "wine/debug.h" - -#include "windef.h" -#include "wingdi.h" -#include "pidl.h" -#include "undocshell.h" -#include "shlobj.h" -#include "objbase.h" - -#include "shlwapi.h" -#include "shell32_main.h" -#include "shellfolder.h" -#include "debughlp.h" -#include "shresdef.h" -WINE_DEFAULT_DEBUG_CHANNEL(shell); - -/* ugly hack for cut&paste files */ -BOOL fileMoving = FALSE; - -typedef struct _StaticShellEntry_ -{ - LPWSTR szVerb; - LPWSTR szClass; - struct _StaticShellEntry_ * Next; -}StaticShellEntry, *PStaticShellEntry; - -typedef struct _DynamicShellEntry_ -{ - UINT iIdCmdFirst; - UINT NumIds; - IContextMenu * CMenu; - struct _DynamicShellEntry_ * Next; -}DynamicShellEntry, *PDynamicShellEntry; - -/************************************************************************** -* IContextMenu Implementation -*/ - -typedef struct -{ const IContextMenu2Vtbl *lpVtbl; - LONG ref; - IShellFolder* pSFParent; - LPITEMIDLIST pidl; /* root pidl */ - LPITEMIDLIST *apidl; /* array of child pidls */ - UINT cidl; - BOOL bAllValues; - PDynamicShellEntry dhead; - PStaticShellEntry head; - UINT iIdSCMFirst; - UINT iIdSCMLast; - UINT iIdSHEFirst; - UINT iIdSHELast; - SFGAOF rfg; -} ItemCmImpl; - -UINT -SH_EnumerateDynamicContextHandlerForKey(LPWSTR szFileClass, ItemCmImpl *This, IDataObject * pDataObj, DWORD bGroupPolicyActive); -WCHAR *build_paths_list(LPCWSTR wszBasePath, int cidl, LPCITEMIDLIST *pidls); -WCHAR *strdupW(LPWSTR str); -static const IContextMenu2Vtbl cmvt; - -/************************************************************************** -* ISvItemCm_CanRenameItems() -*/ -static BOOL ISvItemCm_CanRenameItems(ItemCmImpl *This) -{ UINT i; - DWORD dwAttributes; - - TRACE("(%p)->()\n",This); - - if(This->apidl) - { - for(i = 0; i < This->cidl; i++){} - if(i > 1) return FALSE; /* can't rename more than one item at a time*/ - dwAttributes = SFGAO_CANRENAME; - IShellFolder_GetAttributesOf(This->pSFParent, 1, (LPCITEMIDLIST*)This->apidl, &dwAttributes); - return dwAttributes & SFGAO_CANRENAME; - } - return FALSE; -} - -/************************************************************************** -* ISvItemCm_Constructor() -*/ -IContextMenu2 *ISvItemCm_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST pidl, const LPCITEMIDLIST *apidl, UINT cidl) -{ ItemCmImpl* cm; - UINT u; - - cm = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(ItemCmImpl)); - cm->lpVtbl = &cmvt; - cm->ref = 1; - cm->pidl = ILClone(pidl); - cm->pSFParent = pSFParent; - - if(pSFParent) - { - HRESULT hr; - IShellFolder_AddRef(pSFParent); - cm->rfg = SFGAO_BROWSABLE | SFGAO_CANCOPY | SFGAO_CANMOVE | SFGAO_CANDELETE | SFGAO_CANRENAME | SFGAO_HASPROPSHEET; - hr = IShellFolder_GetAttributesOf(pSFParent, cidl, (LPCITEMIDLIST *)apidl, &cm->rfg); - if (!SUCCEEDED(hr)) - cm->rfg = 0; /* No action available */ - } - - cm->apidl = _ILCopyaPidl(apidl, cidl); - cm->cidl = cidl; - - cm->bAllValues = 1; - for(u = 0; u < cidl; u++) - { - cm->bAllValues &= (_ILIsValue(apidl[u]) ? 1 : 0); - } - - TRACE("(%p)->()\n",cm); - - return (IContextMenu2*)cm; -} - -/************************************************************************** -* ISvItemCm_fnQueryInterface -*/ -static HRESULT WINAPI ISvItemCm_fnQueryInterface(IContextMenu2 *iface, REFIID riid, LPVOID *ppvObj) -{ - ItemCmImpl *This = (ItemCmImpl *)iface; - - TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObj); - - *ppvObj = NULL; - - if(IsEqualIID(riid, &IID_IUnknown) || - IsEqualIID(riid, &IID_IContextMenu) || - IsEqualIID(riid, &IID_IContextMenu2)) - { - *ppvObj = This; - } - else if(IsEqualIID(riid, &IID_IShellExtInit)) /*IShellExtInit*/ - { - FIXME("-- LPSHELLEXTINIT pointer requested\n"); - } - - if(*ppvObj) - { - IUnknown_AddRef((IUnknown*)*ppvObj); - TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj); - return S_OK; - } - TRACE("-- Interface: E_NOINTERFACE\n"); - return E_NOINTERFACE; -} - -/************************************************************************** -* ISvItemCm_fnAddRef -*/ -static ULONG WINAPI ISvItemCm_fnAddRef(IContextMenu2 *iface) -{ - ItemCmImpl *This = (ItemCmImpl *)iface; - ULONG refCount = InterlockedIncrement(&This->ref); - - TRACE("(%p)->(count=%u)\n", This, refCount - 1); - - return refCount; -} - -/************************************************************************** -* ISvItemCm_fnRelease -*/ -static ULONG WINAPI ISvItemCm_fnRelease(IContextMenu2 *iface) -{ - ItemCmImpl *This = (ItemCmImpl *)iface; - ULONG refCount = InterlockedDecrement(&This->ref); - PStaticShellEntry curEntry; - PStaticShellEntry nextEntry; - - - TRACE("(%p)->(count=%i)\n", This, refCount + 1); - - if (!refCount) - { - TRACE(" destroying IContextMenu(%p)\n",This); - - curEntry = nextEntry = This->head; - while(nextEntry) - { - nextEntry = nextEntry->Next; - free(curEntry->szVerb); - free(curEntry->szClass); - free(curEntry); - curEntry = nextEntry; - } - - if(This->pSFParent) - IShellFolder_Release(This->pSFParent); - - SHFree(This->pidl); - - /*make sure the pidl is freed*/ - _ILFreeaPidl(This->apidl, This->cidl); - - HeapFree(GetProcessHeap(),0,This); - } - return refCount; -} - -/************************************************************************** -* ICM_InsertItem() -*/ -void WINAPI _InsertMenuItem ( - HMENU hmenu, - UINT indexMenu, - BOOL fByPosition, - UINT wID, - UINT fType, - LPCSTR dwTypeData, - UINT fState) -{ - MENUITEMINFOA mii; - - ZeroMemory(&mii, sizeof(mii)); - mii.cbSize = sizeof(mii); - if (fType == MFT_SEPARATOR) - { - mii.fMask = MIIM_ID | MIIM_TYPE; - } - else - { - mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE; - mii.dwTypeData = (LPSTR) dwTypeData; - mii.fState = fState; - } - mii.wID = wID; - mii.fType = fType; - InsertMenuItemA( hmenu, indexMenu, fByPosition, &mii); -} - -HRESULT -DoCustomItemAction(ItemCmImpl *This, LPARAM lParam, UINT uMsg) -{ - IContextMenu2 * cmenu; - MEASUREITEMSTRUCT * lpmis = (MEASUREITEMSTRUCT *)lParam; - HRESULT hResult; - UINT i; - PDynamicShellEntry curEntry; - - TRACE("DoCustomItemAction entered with uMsg %x lParam %p\n", uMsg, lParam); - - curEntry = This->dhead; - i = This->iIdSHEFirst; - - - while(curEntry) - { - if (i == lpmis->itemID) - break; - - i++; - curEntry = curEntry->Next; - } - - if (!curEntry) - return E_FAIL; - - hResult = IContextMenu_QueryInterface(curEntry->CMenu, &IID_IContextMenu2, (void**)&cmenu); - if (hResult != S_OK) - { - ERR("failed to get IID_IContextMenu2 interface\n"); - return hResult; - } - - hResult = IContextMenu2_HandleMenuMsg(cmenu, uMsg, (WPARAM)0, lParam); - IContextMenu2_Release(cmenu); - - TRACE("returning hResult %x\n", hResult); - return hResult; -} - -UINT -SH_LoadContextMenuHandlers(ItemCmImpl *This, IDataObject * pDataObj, HMENU hMenu, UINT indexMenu ) -{ - UINT i; - WCHAR buffer[111]; - WCHAR szProgKey[20]; - char ebuf[10]; - HRESULT hr; - HRESULT hResult; - UINT idCmdFirst = 0x6000; - UINT idCmdLast = 0xFFF0; - PDynamicShellEntry curEntry; - DWORD bGroupPolicyActive = FALSE; - DWORD dwSize; - static WCHAR szAny[] = { '*',0}; - - dwSize = sizeof(DWORD); - RegGetValueW(HKEY_CURRENT_USER, - L"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer", - L"EnforceShellExtensionSecurity", - RRF_RT_DWORD, - NULL, - &bGroupPolicyActive, - &dwSize); - - SH_EnumerateDynamicContextHandlerForKey(szAny, This, pDataObj, bGroupPolicyActive); - - for (i = 0; i < This->cidl; i++) - { - GUID * guid = _ILGetGUIDPointer(This->apidl[i]); - if (guid) - { - LPOLESTR pwszCLSID; - static const WCHAR CLSID[] = { 'C','L','S','I','D','\\',0 }; - wcscpy(buffer, CLSID); - hr = StringFromCLSID(guid, &pwszCLSID); - if (hr == S_OK) - { - wcscpy(&buffer[6], pwszCLSID); - TRACE("buffer %s\n", debugstr_w(buffer)); - SH_EnumerateDynamicContextHandlerForKey(buffer, This, pDataObj, bGroupPolicyActive); - } - } - - if (_ILGetExtension(This->apidl[i], &ebuf[1], sizeof(ebuf) / sizeof(char))) - { - ebuf[0] = L'.'; - buffer[0] = L'\0'; - if (MultiByteToWideChar(CP_ACP, 0, ebuf, -1, buffer, 111)) - { - SH_EnumerateDynamicContextHandlerForKey(buffer, This, pDataObj, bGroupPolicyActive); - dwSize = sizeof(szProgKey); - if (RegGetValueW(HKEY_CLASSES_ROOT, buffer, NULL, RRF_RT_REG_SZ, NULL, szProgKey, &dwSize) == ERROR_SUCCESS) - { - szProgKey[(sizeof(szProgKey)/sizeof(WCHAR))-1] = L'\0'; - SH_EnumerateDynamicContextHandlerForKey(szProgKey, This, pDataObj, bGroupPolicyActive); - } - } - } - } - TRACE("-- done loading\n"); - if (!This->dhead) - { - This->iIdSHEFirst = 0; - This->iIdSHELast = 0; - return indexMenu; - } - - curEntry = This->dhead; - This->iIdSHEFirst = idCmdFirst; - do - { - - hResult = IContextMenu_QueryContextMenu(curEntry->CMenu, hMenu, indexMenu, idCmdFirst, idCmdLast, CMF_NORMAL); - if (SUCCEEDED(hResult)) - { - curEntry->iIdCmdFirst = idCmdFirst; - curEntry->NumIds = LOWORD(hResult); - indexMenu += curEntry->NumIds; - idCmdFirst += curEntry->NumIds + 0x10; - } - TRACE("curEntry %p hresult %x contextmenu %p cmdfirst %x num ids %x\n", curEntry, hResult, curEntry->CMenu, curEntry->iIdCmdFirst, curEntry->NumIds); - curEntry = curEntry->Next; - }while(curEntry); - - This->iIdSHELast = idCmdFirst; - TRACE("SH_LoadContextMenuHandlers first %x last %x\n", This->iIdSHEFirst, This->iIdSHELast); - return indexMenu; -} - -void -SH_AddStaticEntry(ItemCmImpl * This, HKEY hKey, WCHAR *szVerb, WCHAR * szClass) -{ - PStaticShellEntry curEntry; - PStaticShellEntry lastEntry = NULL; - - curEntry = This->head; - - while(curEntry) - { - if (!wcsicmp(curEntry->szVerb, szVerb)) - { - /* entry already exists */ - return; - } - lastEntry = curEntry; - curEntry = curEntry->Next; - } - - TRACE("adding verb %s szClass %s\n", debugstr_w(szVerb), debugstr_w(szClass)); - - curEntry = malloc(sizeof(StaticShellEntry)); - if (curEntry) - { - curEntry->Next = NULL; - curEntry->szVerb = wcsdup(szVerb); - curEntry->szClass = wcsdup(szClass); - } - - if (lastEntry) - { - lastEntry->Next = curEntry; - } - else - { - This->head = curEntry; - } -} - -void -SH_AddStaticEntryForKey(ItemCmImpl * This, HKEY hKey, WCHAR * szClass) -{ - LONG result; - DWORD dwIndex; - WCHAR szName[40]; - DWORD dwName; - - dwIndex = 0; - do - { - szName[0] = 0; - dwName = sizeof(szName) / sizeof(WCHAR); - result = RegEnumKeyExW(hKey, dwIndex, szName, &dwName, NULL, NULL, NULL, NULL); - szName[39] = 0; - if (result == ERROR_SUCCESS) - { - SH_AddStaticEntry(This, hKey, szName, szClass); - } - dwIndex++; - }while(result == ERROR_SUCCESS); -} - -void -SH_AddStaticEntryForFileClass(ItemCmImpl * This, WCHAR * szExt) -{ - WCHAR szBuffer[100]; - HKEY hKey; - LONG result; - DWORD dwBuffer; - - TRACE("SH_AddStaticEntryForFileClass entered with %s\n", debugstr_w(szExt)); - - wcscpy(szBuffer, szExt); - wcscat(szBuffer, L"\\shell"); - result = RegOpenKeyExW(HKEY_CLASSES_ROOT, szBuffer, 0, KEY_READ | KEY_QUERY_VALUE, &hKey); - if (result == ERROR_SUCCESS) - { - SH_AddStaticEntryForKey(This, hKey, szExt); - RegCloseKey(hKey); - } - - dwBuffer = sizeof(szBuffer); - result = RegGetValueW(HKEY_CLASSES_ROOT, szExt, NULL, RRF_RT_REG_SZ, NULL, (LPBYTE)szBuffer, &dwBuffer); - if (result == ERROR_SUCCESS) - { - UINT length = strlenW(szBuffer); - wcscat(szBuffer, L"\\shell"); - TRACE("szBuffer %s\n", debugstr_w(szBuffer)); - - result = RegOpenKeyExW(HKEY_CLASSES_ROOT, szBuffer, 0, KEY_READ | KEY_QUERY_VALUE, &hKey); - if (result == ERROR_SUCCESS) - { - szBuffer[length] = 0; - SH_AddStaticEntryForKey(This, hKey, szBuffer); - RegCloseKey(hKey); - } - } - - strcpyW(szBuffer, "SystemFileAssociations\\"); - dwBuffer = sizeof(szBuffer) - strlenW(szBuffer) * sizeof(WCHAR); - result = RegGetValueW(HKEY_CLASSES_ROOT, szExt, L"PerceivedType", RRF_RT_REG_SZ, NULL, (LPBYTE)&szBuffer[23], &dwBuffer); - if (result == ERROR_SUCCESS) - { - UINT length = strlenW(szBuffer); - wcscat(szBuffer, L"\\shell"); - TRACE("szBuffer %s\n", debugstr_w(szBuffer)); - - result = RegOpenKeyExW(HKEY_CLASSES_ROOT, szBuffer, 0, KEY_READ | KEY_QUERY_VALUE, &hKey); - if (result == ERROR_SUCCESS) - { - szBuffer[length] = 0; - SH_AddStaticEntryForKey(This, hKey, szBuffer); - RegCloseKey(hKey); - } - } - RegCloseKey(hKey); -} - -void -SH_AddStaticEntrySpecial(ItemCmImpl * This) -{ - if (_ILIsFolder(This->apidl[0])) // && (This->rfg & SFGAO_BROWSABLE)) - { - SH_AddStaticEntryForFileClass(This, L"Folder"); - } - else if (_ILIsDrive(This->apidl[0])) - { - SH_AddStaticEntryForFileClass(This, L"Drive"); - } -} - - -UINT -SH_AddStaticEntryToMenu(HMENU hMenu, UINT indexMenu, ItemCmImpl * This) -{ - MENUITEMINFOW mii; - PStaticShellEntry curEntry; - WCHAR szVerb[20]; - UINT idResource; - - mii.cbSize = sizeof(mii); - mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE | MIIM_DATA; - mii.fType = MFT_STRING; - mii.fState = MFS_ENABLED | MFS_DEFAULT; - mii.wID = 0x4000; - This->iIdSCMFirst = mii.wID; - - curEntry = This->head; - - while(curEntry) - { - if (!wcsicmp(curEntry->szVerb, L"open")) - idResource = IDS_OPEN_VERB; - else if (!wcsicmp(curEntry->szVerb, L"runas")) - idResource = IDS_RUNAS_VERB; - else if (!wcsicmp(curEntry->szVerb, L"edit")) - idResource = IDS_EDIT_VERB; - else if (!wcsicmp(curEntry->szVerb, L"find")) - idResource = IDS_FIND_VERB; - else if (!wcsicmp(curEntry->szVerb, L"print")) - idResource = IDS_PRINT_VERB; - else if (!wcsicmp(curEntry->szVerb, L"play")) - idResource = IDS_PLAY_VERB; - else if (!wcsicmp(curEntry->szVerb, L"preview")) - idResource = IDS_PREVIEW_VERB; - else if (!wcsicmp(curEntry->szVerb, L"cplopen")) - idResource = IDS_OPEN_VERB; - - else - idResource = 0; - - if (idResource > 0) - { - if (LoadStringW(shell32_hInstance, idResource, szVerb, sizeof(szVerb)/sizeof(WCHAR))) - { - szVerb[(sizeof(szVerb)/sizeof(WCHAR))-1] = L'\0'; - mii.dwTypeData = szVerb; - } - else - { - WARN("unknown verb %s\n", debugstr_w(curEntry->szVerb)); - mii.dwTypeData = curEntry->szVerb; - } - } - else - { - WARN("unknown verb %s\n", debugstr_w(curEntry->szVerb)); - mii.dwTypeData = curEntry->szVerb; - } - - mii.cch = strlenW(mii.dwTypeData); - InsertMenuItemW(hMenu, indexMenu++, TRUE, &mii); - mii.fState = MFS_ENABLED; - mii.wID++; - curEntry = curEntry->Next; - } - This->iIdSCMLast = mii.wID - 1; - return indexMenu; -} - -const char * GetLocalizedString(HMENU hMenu, UINT wID, const char * sDefault, char * sResult) -{ - MENUITEMINFOA mii; - if (!hMenu) - { - return sDefault; - } - - mii.cbSize = sizeof(mii); - mii.fMask = MIIM_TYPE; - mii.fType = MFT_STRING; - mii.dwTypeData = sResult; - mii.cch = 100; - - if (GetMenuItemInfoA(hMenu, wID, FALSE, &mii)) - { - return sResult; - } - else - { - return sDefault; - } -} - -/************************************************************************** -* ISvItemCm_fnQueryContextMenu() -* FIXME: load menu MENU_SHV_FILE out of resources instead if creating -* each menu item by calling _InsertMenuItem() -*/ -static HRESULT WINAPI ISvItemCm_fnQueryContextMenu( - IContextMenu2 *iface, - HMENU hmenu, - UINT indexMenu, - UINT idCmdFirst, - UINT idCmdLast, - UINT uFlags) -{ - IDataObject * pDataObj; - ItemCmImpl *This = (ItemCmImpl *)iface; - USHORT lastindex = 0; - HMENU hLocalMenu; - char sBuffer[100]; - WCHAR szExt[10]; - - static const char sCopy[] = { '&','C','o','p','y',0 }; - static const char sCut[] = { '&','C','u','t',0 }; - static const char sDelete[] = { '&','D','e','l','e','t','e',0 }; - static const char sRename[] = { '&','R','e','n','a','m','e',0 }; - static const char sProperties[] = { '&','P','r','o','p','e','r','t','i','e','s',0 }; - static const WCHAR szSHVFile[] = { 'M','E','N','U','_','S','H','V','_','F','I','L','E',0 }; - - - TRACE("(%p)->(hmenu=%p indexmenu=%x cmdfirst=%x cmdlast=%x flags=%x )\n",This, hmenu, indexMenu, idCmdFirst, idCmdLast, uFlags); - - hLocalMenu = LoadMenuW(shell32_hInstance, szSHVFile); - - if (_ILGetExtension(This->apidl[0], &sBuffer[1], sizeof(sBuffer)-1)) - { - sBuffer[0] = '.'; - MultiByteToWideChar( CP_ACP, 0, sBuffer, -1, (LPWSTR)szExt, 10); - SH_AddStaticEntryForFileClass(This, szExt); - } - else - { - SH_AddStaticEntrySpecial(This); - - } - indexMenu = SH_AddStaticEntryToMenu(hmenu, indexMenu, This); - - SetMenuDefaultItem(hmenu, 0, MF_BYPOSITION); - pDataObj = IDataObject_Constructor(NULL, This->pidl, (LPCITEMIDLIST *)This->apidl, This->cidl); - if (pDataObj) - { - indexMenu = SH_LoadContextMenuHandlers(This, pDataObj, hmenu, indexMenu); - IDataObject_Release(pDataObj); - } - - if(!(CMF_DEFAULTONLY & uFlags) && This->cidl>0) - { - if(!(uFlags & CMF_EXPLORE)) - _InsertMenuItem(hmenu, indexMenu++, TRUE, FCIDM_SHVIEW_OPEN, MFT_STRING, "&Select", MFS_ENABLED); - - TRACE("rfg %x\n", This->rfg); - - - if (This->rfg & (SFGAO_CANCOPY | SFGAO_CANMOVE)) - { - _InsertMenuItem(hmenu, indexMenu++, TRUE, 0, MFT_SEPARATOR, NULL, 0); - if (This->rfg & SFGAO_CANCOPY) - _InsertMenuItem(hmenu, indexMenu++, TRUE, FCIDM_SHVIEW_COPY, MFT_STRING, GetLocalizedString(hLocalMenu, FCIDM_SHVIEW_COPY, sCopy, sBuffer), MFS_ENABLED); - if (This->rfg & SFGAO_CANMOVE) - _InsertMenuItem(hmenu, indexMenu++, TRUE, FCIDM_SHVIEW_CUT, MFT_STRING, GetLocalizedString(hLocalMenu, FCIDM_SHVIEW_CUT, sCut, sBuffer), MFS_ENABLED); - } - - if (This->rfg & SFGAO_CANDELETE) - { - _InsertMenuItem(hmenu, indexMenu++, TRUE, 0, MFT_SEPARATOR, NULL, 0); - _InsertMenuItem(hmenu, indexMenu++, TRUE, FCIDM_SHVIEW_DELETE, MFT_STRING, GetLocalizedString(hLocalMenu, FCIDM_SHVIEW_DELETE, sDelete, sBuffer), MFS_ENABLED); - } - - if ((uFlags & CMF_CANRENAME) && (This->rfg & SFGAO_CANRENAME)) - _InsertMenuItem(hmenu, indexMenu++, TRUE, FCIDM_SHVIEW_RENAME, MFT_STRING, GetLocalizedString(hLocalMenu, FCIDM_SHVIEW_RENAME, sRename, sBuffer), ISvItemCm_CanRenameItems(This) ? MFS_ENABLED : MFS_DISABLED); - - if (This->rfg & SFGAO_HASPROPSHEET) - { - _InsertMenuItem(hmenu, indexMenu++, TRUE, 0, MFT_SEPARATOR, NULL, 0); - _InsertMenuItem(hmenu, indexMenu++, TRUE, FCIDM_SHVIEW_PROPERTIES, MFT_STRING, GetLocalizedString(hLocalMenu, FCIDM_SHVIEW_PROPERTIES, sProperties, sBuffer), MFS_ENABLED); - } - - lastindex = FCIDM_SHVIEWLAST; - } - - if (hLocalMenu) - { - DestroyMenu(hLocalMenu); - } - - return MAKE_HRESULT(SEVERITY_SUCCESS, 0, lastindex); -} - -/************************************************************************** -* DoRename -*/ -static void DoRename( - IContextMenu2 *iface, - HWND hwnd) -{ - ItemCmImpl *This = (ItemCmImpl *)iface; - - LPSHELLBROWSER lpSB; - LPSHELLVIEW lpSV; - - TRACE("(%p)->(wnd=%p)\n",This, hwnd); - - /* get the active IShellView */ - if ((lpSB = (LPSHELLBROWSER)SendMessageA(hwnd, CWM_GETISHELLBROWSER,0,0))) - { - if(SUCCEEDED(IShellBrowser_QueryActiveShellView(lpSB, &lpSV))) - { - TRACE("(sv=%p)\n",lpSV); - IShellView_SelectItem(lpSV, This->apidl[0], - SVSI_DESELECTOTHERS|SVSI_EDIT|SVSI_ENSUREVISIBLE|SVSI_FOCUSED|SVSI_SELECT); - IShellView_Release(lpSV); - } - } -} - -/************************************************************************** - * DoDelete - * - * deletes the currently selected items - */ -static void DoDelete(IContextMenu2 *iface, HWND hwnd) -{ - WCHAR szPath[MAX_PATH]; - WCHAR * szTarget; - SHFILEOPSTRUCTW op; - LPSHELLBROWSER lpSB; - LPSHELLVIEW lpSV; - IPersistFolder2 * psf; - LPITEMIDLIST pidl; - STRRET strTemp; - ItemCmImpl *This = (ItemCmImpl *)iface; - - if (IShellFolder2_QueryInterface(This->pSFParent, &IID_IPersistFolder2, (LPVOID*)&psf) != S_OK) - { - ERR("Failed to get interface IID_IPersistFolder2\n"); - return; - } - - if (IPersistFolder2_GetCurFolder(psf, &pidl) != S_OK) - { - ERR("IPersistFolder2_GetCurFolder failed\n"); - IPersistFolder2_Release(psf); - return; - } - - if (IShellFolder2_GetDisplayNameOf(This->pSFParent, pidl, SHGDN_FORPARSING, &strTemp) != S_OK) - { - ERR("IShellFolder_GetDisplayNameOf failed\n"); - IPersistFolder2_Release(psf); - return; - } - szPath[MAX_PATH-1] = 0; - StrRetToBufW(&strTemp, pidl, szPath, MAX_PATH); - PathAddBackslashW(szPath); - IPersistFolder2_Release(psf); - - szTarget = build_paths_list(szPath, This->cidl, (LPCITEMIDLIST *)This->apidl); - - if (pidl) - { - if (SHGetPathFromIDListW(pidl, szPath)) - { - ZeroMemory(&op, sizeof(op)); - op.hwnd = GetActiveWindow(); - op.wFunc = FO_DELETE; - op.pFrom = szTarget; - op.fFlags = FOF_ALLOWUNDO; - SHFileOperationW(&op); - } - ILFree(pidl); - } - - if ((lpSB = (LPSHELLBROWSER)SendMessageA(hwnd, CWM_GETISHELLBROWSER,0,0))) - { - if (SUCCEEDED(IShellBrowser_QueryActiveShellView(lpSB, &lpSV))) - { - IShellView_Refresh(lpSV); - } - } -} - -/************************************************************************** - * DoCopyOrCut - * - * copies the currently selected items into the clipboard - */ -static BOOL DoCopyOrCut( - IContextMenu2 *iface, - HWND hwnd, - BOOL bCut) -{ - ItemCmImpl *This = (ItemCmImpl *)iface; - - LPSHELLBROWSER lpSB; - LPSHELLVIEW lpSV; - LPDATAOBJECT lpDo; - - TRACE("(%p)->(wnd=%p,bCut=0x%08x)\n",This, hwnd, bCut); - - /* get the active IShellView */ - if ((lpSB = (LPSHELLBROWSER)SendMessageA(hwnd, CWM_GETISHELLBROWSER,0,0))) - { - if (SUCCEEDED(IShellBrowser_QueryActiveShellView(lpSB, &lpSV))) - { - if (SUCCEEDED(IShellView_GetItemObject(lpSV, SVGIO_SELECTION, &IID_IDataObject, (LPVOID*)&lpDo))) - { - OleSetClipboard(lpDo); - IDataObject_Release(lpDo); - } - IShellView_Release(lpSV); - } - } - return TRUE; -} -static void DoProperties( - IContextMenu2 *iface, - HWND hwnd) -{ - ItemCmImpl *This = (ItemCmImpl *)iface; - LPITEMIDLIST pidlFQ = NULL; - SHELLEXECUTEINFOA sei; - - /* - * FIXXME - * - * The IShellFolder interface GetUIObject should create the specific item and then query if it has an IContextMenu interface - * If yes return interface to it. - */ - - if (_ILIsMyComputer(This->apidl[0])) - { - ShellExecuteA(hwnd, "open", "rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl", NULL, NULL, SW_SHOWNORMAL); - return; - } - else if (_ILIsDesktop(This->apidl[0])) - { - ShellExecuteA(hwnd, "open", "rundll32.exe shell32.dll,Control_RunDLL desk.cpl", NULL, NULL, SW_SHOWNORMAL); - return; - } - else if (_ILIsDrive(This->apidl[0])) - { - WCHAR buffer[111]; - ILGetDisplayName(This->apidl[0], buffer); - SH_ShowDriveProperties(buffer); - return; - } - else if (_ILIsNetHood(This->apidl[0])) - { - /* FIXME - * implement nethood properties - */ - FIXME("implement nethood property dialog\n"); - return; - } - else if (_ILIsBitBucket(This->apidl[0])) - { - ///FIXME - WCHAR szDrive = 'C'; - SH_ShowRecycleBinProperties(szDrive); - } - else - { - pidlFQ = ILCombine(This->pidl, This->apidl[0]); - } - - ZeroMemory(&sei, sizeof(sei)); - sei.cbSize = sizeof(sei); - sei.fMask = SEE_MASK_INVOKEIDLIST; - sei.lpIDList = pidlFQ; - sei.hwnd = hwnd; - sei.nShow = SW_SHOWNORMAL; - sei.lpVerb = "properties"; - - TRACE("DoProperties before ShellExecuteEx\n"); - ShellExecuteExA(&sei); - TRACE("DoProperties after ShellExecuteEx\n"); - - if (pidlFQ) - { - SHFree(pidlFQ); - } -} -HRESULT -DoStaticShellExtensions(ItemCmImpl *This, LPCMINVOKECOMMANDINFO lpcmi) -{ - UINT i; - PStaticShellEntry curEntry; - LPITEMIDLIST pidl; - UINT bFolderFound = FALSE; - SHELLEXECUTEINFOW sei; - - TRACE("DoStaticShellExtensions entered with lpVerb %x first %x last %x\n", LOWORD(lpcmi->lpVerb), This->iIdSCMFirst, This->iIdSCMLast); - - i = This->iIdSCMFirst; - curEntry = This->head; - - while(curEntry) - { - if (i == LOWORD(lpcmi->lpVerb)) - break; - - i++; - curEntry = curEntry->Next; - } - - if (!curEntry) - { - ERR("unexpected\n"); - return E_UNEXPECTED; - } - - for(i = 0; icidl; i++) - { - if(!_ILIsValue(This->apidl[i])) - { - bFolderFound = TRUE; - break; - } - } - - if (bFolderFound && wcsicmp(curEntry->szClass, L"Folder")) - { - /* when there is a folder with item selected - * do nothing - */ - return S_OK; - } - - TRACE("curEntry %p verb %s szClass %s\n", curEntry, debugstr_w(curEntry->szVerb), debugstr_w(curEntry->szClass)); - - pidl = ILCombine(This->pidl, This->apidl[0]); - - ZeroMemory(&sei, sizeof(sei)); - sei.cbSize = sizeof(sei); - sei.fMask = SEE_MASK_CLASSNAME | SEE_MASK_IDLIST; - sei.lpIDList = pidl; - sei.lpClass = curEntry->szClass; - sei.hwnd = lpcmi->hwnd; - sei.nShow = SW_SHOWNORMAL; - sei.lpVerb = curEntry->szVerb; - ShellExecuteExW(&sei); - SHFree(pidl); - return S_OK; -} - -HRESULT -DoDynamicShellExtensions(ItemCmImpl *This, LPCMINVOKECOMMANDINFO lpcmi) -{ - HRESULT hResult = NOERROR; - PDynamicShellEntry curEntry; - UINT id; - - curEntry = This->dhead; - id = LOWORD(lpcmi->lpVerb); - - while(curEntry) - { - if (curEntry->iIdCmdFirst <= id && curEntry->iIdCmdFirst + curEntry->NumIds >= id) - break; - - curEntry = curEntry->Next; - } - - if (!curEntry) - return E_FAIL; - - lpcmi->lpVerb -= curEntry->iIdCmdFirst; - - hResult = IContextMenu_InvokeCommand(curEntry->CMenu, lpcmi); - - TRACE("DoDynamicShellExtensions hResult %x verb %x first %x\n", hResult, lpcmi->lpVerb, curEntry->iIdCmdFirst); - return hResult; -} - - -/************************************************************************** -* ISvItemCm_fnInvokeCommand() -*/ -static HRESULT WINAPI ISvItemCm_fnInvokeCommand( - IContextMenu2 *iface, - LPCMINVOKECOMMANDINFO lpcmi) -{ - ItemCmImpl *This = (ItemCmImpl *)iface; - - if (lpcmi->cbSize != sizeof(CMINVOKECOMMANDINFO)) - FIXME("Is an EX structure\n"); - - TRACE("ISvItemCm_fnInvokeCommand (%p)->(invcom=%p verb=%p wnd=%p)\n",This,lpcmi,lpcmi->lpVerb, lpcmi->hwnd); - - if( HIWORD(lpcmi->lpVerb)==0 && LOWORD(lpcmi->lpVerb) > FCIDM_SHVIEWLAST) - { - TRACE("Invalid Verb %x\n",LOWORD(lpcmi->lpVerb)); - return E_INVALIDARG; - } - - if (HIWORD(lpcmi->lpVerb) == 0) - { - switch(LOWORD(lpcmi->lpVerb)) - { - case FCIDM_SHVIEW_RENAME: - TRACE("Verb FCIDM_SHVIEW_RENAME\n"); - DoRename(iface, lpcmi->hwnd); - break; - case FCIDM_SHVIEW_DELETE: - TRACE("Verb FCIDM_SHVIEW_DELETE\n"); - DoDelete(iface, lpcmi->hwnd); - break; - case FCIDM_SHVIEW_COPY: - TRACE("Verb FCIDM_SHVIEW_COPY\n"); - DoCopyOrCut(iface, lpcmi->hwnd, FALSE); - break; - case FCIDM_SHVIEW_CUT: - TRACE("Verb FCIDM_SHVIEW_CUT\n"); - DoCopyOrCut(iface, lpcmi->hwnd, TRUE); - break; - case FCIDM_SHVIEW_PROPERTIES: - TRACE("Verb FCIDM_SHVIEW_PROPERTIES\n"); - DoProperties(iface, lpcmi->hwnd); - break; - default: - TRACE("iIdSHEFirst %x iIdSHELast %x iIdSCMFirst %x iIdSCMLast %x\n", This->iIdSHEFirst, This->iIdSHELast, This->iIdSCMFirst, This->iIdSCMLast); - if (This->iIdSHEFirst && This->iIdSHELast) - { - if (LOWORD(lpcmi->lpVerb) >= This->iIdSHEFirst && LOWORD(lpcmi->lpVerb) <= This->iIdSHELast) - { - return DoDynamicShellExtensions(This, lpcmi); - } - } - if (This->iIdSCMFirst && This->iIdSCMLast) - { - if (LOWORD(lpcmi->lpVerb) >= This->iIdSCMFirst && LOWORD(lpcmi->lpVerb) <= This->iIdSCMLast) - { - return DoStaticShellExtensions(This, lpcmi); - } - } - FIXME("Unhandled Verb %xl\n",LOWORD(lpcmi->lpVerb)); - } - } - else - { - TRACE("Verb is %s\n",debugstr_a(lpcmi->lpVerb)); - if (strcmp(lpcmi->lpVerb,"delete")==0) - DoDelete(iface, lpcmi->hwnd); - else - FIXME("Unhandled string verb %s\n",debugstr_a(lpcmi->lpVerb)); - } - return NOERROR; -} - -/************************************************************************** -* ISvItemCm_fnGetCommandString() -*/ -static HRESULT WINAPI ISvItemCm_fnGetCommandString( - IContextMenu2 *iface, - UINT_PTR idCommand, - UINT uFlags, - UINT* lpReserved, - LPSTR lpszName, - UINT uMaxNameLen) -{ - ItemCmImpl *This = (ItemCmImpl *)iface; - - HRESULT hr = E_INVALIDARG; - - TRACE("(%p)->(idcom=%lx flags=%x %p name=%p len=%x)\n",This, idCommand, uFlags, lpReserved, lpszName, uMaxNameLen); - - switch(uFlags) - { - case GCS_HELPTEXTA: - case GCS_HELPTEXTW: - hr = E_NOTIMPL; - break; - - case GCS_VERBA: - switch(idCommand) - { - case FCIDM_SHVIEW_RENAME: - strcpy((LPSTR)lpszName, "rename"); - hr = NOERROR; - break; - } - break; - - /* NT 4.0 with IE 3.0x or no IE will always call This with GCS_VERBW. In This - case, you need to do the lstrcpyW to the pointer passed.*/ - case GCS_VERBW: - switch(idCommand) - { case FCIDM_SHVIEW_RENAME: - MultiByteToWideChar( CP_ACP, 0, "rename", -1, (LPWSTR)lpszName, uMaxNameLen ); - hr = NOERROR; - break; - } - break; - - case GCS_VALIDATEA: - case GCS_VALIDATEW: - hr = NOERROR; - break; - } - TRACE("-- (%p)->(name=%s)\n",This, lpszName); - return hr; -} - -/************************************************************************** -* ISvItemCm_fnHandleMenuMsg() -* NOTES -* should be only in IContextMenu2 and IContextMenu3 -* is nevertheless called from word95 -*/ -static HRESULT WINAPI ISvItemCm_fnHandleMenuMsg( - IContextMenu2 *iface, - UINT uMsg, - WPARAM wParam, - LPARAM lParam) -{ - ItemCmImpl *This = (ItemCmImpl *)iface; - LPMEASUREITEMSTRUCT lpmis = (LPMEASUREITEMSTRUCT) lParam; - TRACE("(%p)->(msg=%x wp=%lx lp=%lx)\n",This, uMsg, wParam, lParam); - - switch(uMsg) - { - case WM_MEASUREITEM: - case WM_DRAWITEM: - if (lpmis->itemID >= This->iIdSHEFirst && lpmis->itemID <= This->iIdSHELast) - return DoCustomItemAction(This, lParam, uMsg); - break; - - } - - return E_NOTIMPL; -} - -static const IContextMenu2Vtbl cmvt = -{ - ISvItemCm_fnQueryInterface, - ISvItemCm_fnAddRef, - ISvItemCm_fnRelease, - ISvItemCm_fnQueryContextMenu, - ISvItemCm_fnInvokeCommand, - ISvItemCm_fnGetCommandString, - ISvItemCm_fnHandleMenuMsg -}; - -HRESULT -SH_LoadDynamicContextMenuHandler(HKEY hKey, const CLSID * szClass, ItemCmImpl *This, IDataObject * pDataObj) -{ - HRESULT hr; - IContextMenu * cmobj; - IShellExtInit *shext; - PDynamicShellEntry curEntry; - TRACE("SH_LoadDynamicContextMenuHandler entered with %s\n",wine_dbgstr_guid(szClass)); - - hr = SHCoCreateInstance(NULL, szClass, NULL, &IID_IContextMenu, (void**)&cmobj); - if (hr != S_OK) - { - TRACE("SHCoCreateInstance failed %x\n", GetLastError()); - return hr; - } - hr = cmobj->lpVtbl->QueryInterface(cmobj, &IID_IShellExtInit, (void**)&shext); - if (hr != S_OK) - { - TRACE("Failed to query for interface IID_IShellExtInit\n"); - cmobj->lpVtbl->Release(cmobj); - return FALSE; - } - hr = shext->lpVtbl->Initialize(shext, NULL, pDataObj, hKey); - if (hr != S_OK) - { - TRACE("Failed to initialize shell extension error %x\n", hr); - shext->lpVtbl->Release(shext); - cmobj->lpVtbl->Release(cmobj); - return hr; - } - curEntry = malloc(sizeof(DynamicShellEntry)); - if(!curEntry) - { - return E_OUTOFMEMORY; - } - - curEntry->iIdCmdFirst = 0; - curEntry->Next = NULL; - curEntry->NumIds = 0; - curEntry->CMenu = cmobj; - - if (This->dhead) - { - PDynamicShellEntry pEntry = This->dhead; - - while(pEntry->Next) - { - pEntry = pEntry->Next; - } - - pEntry->Next = curEntry; - } - else - { - This->dhead = curEntry; - } - - return hr; -} - -UINT -SH_EnumerateDynamicContextHandlerForKey(const LPWSTR szFileClass, ItemCmImpl *This, IDataObject * pDataObj, DWORD bGroupPolicyActive) -{ - HKEY hKey; - WCHAR szKey[MAX_PATH] = {0}; - WCHAR szName[MAX_PATH] = {0}; - DWORD dwIndex, dwName; - LONG res; - HRESULT hResult; - UINT index; - CLSID clsid; - static const WCHAR szShellEx[] = { '\\','s','h','e','l','l','e','x','\\','C','o','n','t','e','x','t','M','e','n','u','H','a','n','d','l','e','r','s',0 }; - - wcscpy(szKey, szFileClass); - wcscat(szKey, szShellEx); - - TRACE("SH_EnumerateDynamicContextHandlerForKey key %s\n", debugstr_w(szFileClass)); - - if (RegOpenKeyExW(HKEY_CLASSES_ROOT, szKey, 0, KEY_READ, &hKey) != ERROR_SUCCESS) - { - TRACE("RegOpenKeyExW failed for key %s\n", debugstr_w(szKey)); - return 0; - } - - dwIndex = 0; - index = 0; - do - { - dwName = MAX_PATH; - res = RegEnumKeyExW(hKey, dwIndex, szName, &dwName, NULL, NULL, NULL, NULL); - if (res == ERROR_SUCCESS) - { - hResult = CLSIDFromString(szName, &clsid); - if (hResult != S_OK) - { - dwName = MAX_PATH; - if (RegGetValueW(hKey, szName, NULL, RRF_RT_REG_SZ, NULL, szKey, &dwName) == ERROR_SUCCESS) - { - if (CLSIDFromString(szKey, &clsid) == S_OK) - { - if (bGroupPolicyActive) - { - if (RegGetValueW(HKEY_LOCAL_MACHINE, - L"Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved", - szKey, - RRF_RT_REG_SZ, - NULL, - NULL, - &dwName) == ERROR_SUCCESS) - { - SH_LoadDynamicContextMenuHandler(hKey, &clsid, This, pDataObj); - } - - } - else - { - SH_LoadDynamicContextMenuHandler(hKey, &clsid, This, pDataObj); - } - } - } - } - if (hResult == S_OK) - { - if (bGroupPolicyActive) - { - if (RegGetValueW(HKEY_LOCAL_MACHINE, - L"Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved", - szKey, - RRF_RT_REG_SZ, - NULL, - NULL, - &dwName) == ERROR_SUCCESS) - { - SH_LoadDynamicContextMenuHandler(hKey, &clsid, This, pDataObj); - } - } - else - { - SH_LoadDynamicContextMenuHandler(hKey, &clsid, This, pDataObj); - } - } - } - dwIndex++; - }while(res == ERROR_SUCCESS); - - RegCloseKey(hKey); - return index; -} - -/************************************************************************* - * SHCreateDefaultContextMenu [SHELL32.325] Vista API - * - */ - -HRESULT WINAPI SHCreateDefaultContextMenu( - const DEFCONTEXTMENU *pdcm, - REFIID riid, - void **ppv) -{ - HRESULT hr; - IContextMenu2 * pcm; - - if (pdcm->cidl > 0) - pcm = ISvItemCm_Constructor( pdcm->psf, pdcm->pidlFolder, pdcm->apidl, pdcm->cidl ); - else - pcm = ISvBgCm_Constructor( pdcm->psf, TRUE ); - - hr = S_OK; - *ppv = pcm; - - return hr; -} - -/************************************************************************* - * CDefFolderMenu_Create2 [SHELL32.701] - * - */ - -INT -WINAPI -CDefFolderMenu_Create2( - LPCITEMIDLIST pidlFolder, - HWND hwnd, - UINT cidl, - LPCITEMIDLIST *apidl, - IShellFolder *psf, - LPFNDFMCALLBACK lpfn, - UINT nKeys, - HKEY *ahkeyClsKeys, - IContextMenu **ppcm) -{ - DEFCONTEXTMENU pdcm; - HRESULT hr; - - pdcm.hwnd = hwnd; - pdcm.pcmcb = NULL; //FIXME - pdcm.pidlFolder = pidlFolder; - pdcm.psf = psf; - pdcm.cidl = cidl; - pdcm.apidl = apidl; - pdcm.punkAssociationInfo = NULL; - pdcm.cKeys = nKeys; - pdcm.aKeys = ahkeyClsKeys; - - hr = SHCreateDefaultContextMenu(&pdcm, &IID_IContextMenu, (void**)ppcm); - return hr; -} diff --git a/reactos/dll/win32/shell32/shv_item_new.c b/reactos/dll/win32/shell32/shv_item_new.c index f8f52c057f3..ed82b0ab9fa 100644 --- a/reactos/dll/win32/shell32/shv_item_new.c +++ b/reactos/dll/win32/shell32/shv_item_new.c @@ -6,25 +6,7 @@ * PROGRAMMERS: Johannes Anderwald (janderwald@reactos.org) */ -#include - -#define COBJMACROS -#define NONAMELESSUNION -#define NONAMELESSSTRUCT -#include "wine/debug.h" - -#include "windef.h" -#include "wingdi.h" -#include "pidl.h" -#include "shlobj.h" -#include "shtypes.h" -#include "shell32_main.h" -#include "shellfolder.h" -#include "undocshell.h" -#include "shlwapi.h" -#include "stdio.h" -#include "winuser.h" -#include "shresdef.h" +#include WINE_DEFAULT_DEBUG_CHANNEL(shell); @@ -50,11 +32,14 @@ typedef struct __SHELLNEW_ITEM__ typedef struct { const IContextMenu2Vtbl *lpVtblContextMenu; - LPSHELLFOLDER pSFParent; + const IShellExtInitVtbl *lpvtblShellExtInit; + LPWSTR szPath; + IShellFolder *pSFParent; PSHELLNEW_ITEM s_SnHead; -}INewMenuImpl; +}INewMenuImpl, *LPINewMenuImpl; -static const IContextMenu2Vtbl cmvt; +//static const IContextMenu2Vtbl cmvt; +//static const IShellExtInitVtbl sei; static WCHAR szNew[MAX_PATH]; @@ -277,7 +262,7 @@ InsertShellNewItems(HMENU hMenu, UINT idFirst, UINT idMenu, INewMenuImpl * This) mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE | MIIM_DATA; mii.fType = MFT_STRING; mii.dwTypeData = szBuffer; - mii.cch = strlenW(mii.dwTypeData); + mii.cch = wcslen(mii.dwTypeData); mii.wID = idFirst++; InsertMenuItemW(hMenu, idMenu++, TRUE, &mii); @@ -286,7 +271,7 @@ InsertShellNewItems(HMENU hMenu, UINT idFirst, UINT idMenu, INewMenuImpl * This) szBuffer[0] = 0; szBuffer[MAX_PATH-1] = 0; mii.dwTypeData = szBuffer; - mii.cch = strlenW(mii.dwTypeData); + mii.cch = wcslen(mii.dwTypeData); mii.wID = idFirst++; InsertMenuItemW(hMenu, idMenu++, TRUE, &mii); @@ -314,7 +299,7 @@ InsertShellNewItems(HMENU hMenu, UINT idFirst, UINT idMenu, INewMenuImpl * This) { TRACE("szDesc %s\n", debugstr_w(pCurItem->szDesc)); mii.dwTypeData = pCurItem->szDesc; - mii.cch = strlenW(mii.dwTypeData); + mii.cch = wcslen(mii.dwTypeData); mii.wID = idFirst++; InsertMenuItemW(hMenu, idMenu++, TRUE, &mii); } @@ -393,7 +378,7 @@ DoShellNewCmd(INewMenuImpl * This, LPCMINVOKECOMMANDINFO lpcmi) if (ptr) { ptr[1] = 's'; - sprintfW(szTemp, szBuffer, szPath); + swprintf(szTemp, szBuffer, szPath); ptr = szTemp; } else @@ -434,7 +419,7 @@ DoShellNewCmd(INewMenuImpl * This, LPCMINVOKECOMMANDINFO lpcmi) dwError = GetLastError(); TRACE("FileName %s szBuffer %s i %u error %x\n", debugstr_w(szBuffer), debugstr_w(szPath), i, dwError); - sprintfW(szBuffer, szFormat, szPath, i, pCurItem->szExt); + swprintf(szBuffer, szFormat, szPath, i, pCurItem->szExt); i++; }while(hFile == INVALID_HANDLE_VALUE && dwError == ERROR_FILE_EXISTS); @@ -497,7 +482,7 @@ DoMeasureItem(INewMenuImpl *This, HWND hWnd, MEASUREITEMSTRUCT * lpmis) return E_FAIL; } hDC = GetDC(hWnd); - GetTextExtentPoint32W(hDC, pCurItem->szDesc, strlenW(pCurItem->szDesc), &size); + GetTextExtentPoint32W(hDC, pCurItem->szDesc, wcslen(pCurItem->szDesc), &size); lpmis->itemWidth = size.cx + 32; lpmis->itemHeight = max(size.cy, 20); ReleaseDC (hWnd, hDC); @@ -552,15 +537,20 @@ static void DoNewFolder( if (psfhlp) { LPITEMIDLIST pidl; - ISFHelper_GetUniqueName(psfhlp, wszName, MAX_PATH); - ISFHelper_AddFolder(psfhlp, 0, wszName, &pidl); + + if (ISFHelper_GetUniqueName(psfhlp, wszName, MAX_PATH) != S_OK) + return; + if (ISFHelper_AddFolder(psfhlp, 0, wszName, &pidl) != S_OK) + return; if(psv) { + IShellView_Refresh(psv); /* if we are in a shellview do labeledit */ IShellView_SelectItem(psv, pidl,(SVSI_DESELECTOTHERS | SVSI_EDIT | SVSI_ENSUREVISIBLE |SVSI_FOCUSED|SVSI_SELECT)); + IShellView_Refresh(psv); } SHFree(pidl); @@ -569,36 +559,33 @@ static void DoNewFolder( } -#if 0 -static inline INewMenuImpl *impl_from_IShellExtInit( IShellExtInit *iface ) +static LPINewMenuImpl __inline impl_from_IShellExtInit( IShellExtInit *iface ) { return (INewMenuImpl *)((char*)iface - FIELD_OFFSET(INewMenuImpl, lpvtblShellExtInit)); } -#endif -static __inline INewMenuImpl * impl_from_IContextMenu( IContextMenu2 *iface ) +static LPINewMenuImpl __inline impl_from_IContextMenu( IContextMenu2 *iface ) { return (INewMenuImpl *)((char*)iface - FIELD_OFFSET(INewMenuImpl, lpVtblContextMenu)); } static HRESULT WINAPI INewItem_fnQueryInterface(INewMenuImpl * This, REFIID riid, LPVOID *ppvObj) { - TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObj); + TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObj); - *ppvObj = NULL; + *ppvObj = NULL; if(IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IContextMenu) || IsEqualIID(riid, &IID_IContextMenu2)) - { - *ppvObj = &This->lpVtblContextMenu; - } -#if 0 - else if(IsEqualIID(riid, &IID_IShellExtInit)) - { - *ppvObj = &This->lpvtblShellExtInit; - } -#endif + { + *ppvObj = &This->lpVtblContextMenu; + } + else if(IsEqualIID(riid, &IID_IShellExtInit)) + { + *ppvObj = &This->lpvtblShellExtInit; + } + if(*ppvObj) { @@ -681,7 +668,7 @@ INewItem_IContextMenu_fnQueryContextMenu(IContextMenu2 *iface, mii.fType = MFT_STRING; mii.wID = idCmdFirst + id++; mii.dwTypeData = szBuffer; - mii.cch = strlenW( mii.dwTypeData ); + mii.cch = wcslen( mii.dwTypeData ); mii.fState = MFS_ENABLED; if (hSubMenu) @@ -757,12 +744,12 @@ INewItem_IContextMenu_fnHandleMenuMsg(IContextMenu2 *iface, LPARAM lParam) { INewMenuImpl *This = impl_from_IContextMenu(iface); - //DRAWITEMSTRUCT * lpids = (DRAWITEMSTRUCT*) lParam; - //MEASUREITEMSTRUCT *lpmis = (MEASUREITEMSTRUCT*) lParam; + DRAWITEMSTRUCT * lpids = (DRAWITEMSTRUCT*) lParam; + MEASUREITEMSTRUCT *lpmis = (MEASUREITEMSTRUCT*) lParam; + + TRACE("INewItem_IContextMenu_fnHandleMenuMsg (%p)->(msg=%x wp=%lx lp=%lx)\n",This, uMsg, wParam, lParam); - TRACE("INewItem_IContextMenu_fnHandleMenuMsg (%p)->(msg=%x wp=%lx lp=%lx)\n",This, uMsg, wParam, lParam); -#if 0 switch(uMsg) { case WM_MEASUREITEM: @@ -772,9 +759,7 @@ INewItem_IContextMenu_fnHandleMenuMsg(IContextMenu2 *iface, return DoDrawItem(This, (HWND)wParam, lpids); break; } -#else return S_OK; -#endif return E_UNEXPECTED; } @@ -790,7 +775,48 @@ static const IContextMenu2Vtbl cmvt = INewItem_IContextMenu_fnHandleMenuMsg }; -static INewMenuImpl *cached_ow; +static HRESULT WINAPI +INewItem_ExtInit_fnQueryInterface( IShellExtInit* iface, REFIID riid, void** ppvObject ) +{ + return INewItem_fnQueryInterface(impl_from_IShellExtInit(iface), riid, ppvObject); +} + +static ULONG WINAPI +INewItem_ExtInit_AddRef( IShellExtInit* iface ) +{ + return INewItem_fnAddRef(impl_from_IShellExtInit(iface)); +} + +static ULONG WINAPI +INewItem_ExtInit_Release( IShellExtInit* iface ) +{ + return INewItem_fnRelease(impl_from_IShellExtInit(iface)); +} + +static HRESULT WINAPI +INewItem_ExtInit_Initialize( IShellExtInit* iface, LPCITEMIDLIST pidlFolder, + IDataObject *pdtobj, HKEY hkeyProgID ) +{ + + return S_OK; +} + +static const IShellExtInitVtbl sei = +{ + INewItem_ExtInit_fnQueryInterface, + INewItem_ExtInit_AddRef, + INewItem_ExtInit_Release, + INewItem_ExtInit_Initialize +}; +static INewMenuImpl *cached_ow = NULL; + +VOID +INewItem_SetCurrentShellFolder(IShellFolder * psfParent) +{ + if (cached_ow) + cached_ow->pSFParent = psfParent; +} + HRESULT WINAPI INewItem_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID *ppv) { INewMenuImpl * ow; @@ -798,14 +824,16 @@ HRESULT WINAPI INewItem_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID *p if (!cached_ow) { - ow = LocalAlloc(LMEM_ZEROINIT, sizeof(INewMenuImpl)); - if (!ow) + ow = LocalAlloc(LMEM_ZEROINIT, sizeof(INewMenuImpl)); + if (!ow) { return E_OUTOFMEMORY; } ow->lpVtblContextMenu = &cmvt; + ow->lpvtblShellExtInit = &sei; ow->s_SnHead = NULL; + ow->szPath = NULL; if (InterlockedCompareExchangePointer((void *)&cached_ow, ow, NULL) != NULL) { @@ -814,18 +842,6 @@ HRESULT WINAPI INewItem_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID *p } } - TRACE("(%p)->()\n",cached_ow); - res = INewItem_fnQueryInterface( cached_ow, riid, ppv ); return res; } - -VOID INewItem_SetParent(LPSHELLFOLDER pSFParent) -{ - if (cached_ow->pSFParent) - { - IShellFolder_Release(cached_ow->pSFParent); - } - cached_ow->pSFParent = pSFParent; - IShellFolder_AddRef(pSFParent); -} diff --git a/reactos/dll/win32/shell32/startmenu.c b/reactos/dll/win32/shell32/startmenu.c index ce56362243b..84890f08f2c 100644 --- a/reactos/dll/win32/shell32/startmenu.c +++ b/reactos/dll/win32/shell32/startmenu.c @@ -18,45 +18,35 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define COBJMACROS - -#include "wine/debug.h" - -#include "windef.h" -#include "shlobj.h" -#include "base/shell/explorer-new/todo.h" - -#include "shell32_main.h" +#include WINE_DEFAULT_DEBUG_CHANNEL(shell); -const GUID CLSID_StartMenu = { 0x4622AD11, 0xFF23, 0x11D0, {0x8D,0x34,0x00,0xA0,0xC9,0x0F,0x27,0x19} }; - typedef struct _tagStartMenu { const IMenuPopupVtbl *vtbl; const IObjectWithSiteVtbl *objectSiteVtbl; const IInitializeObjectVtbl *initObjectVtbl; IUnknown *pUnkSite; LONG refCount; -} StartMenu; +} StartMenu, *LPStartMenu; static const IMenuPopupVtbl StartMenuVtbl; static const IObjectWithSiteVtbl StartMenu_ObjectWithSiteVtbl; static const IInitializeObjectVtbl StartMenu_InitializeObjectVtbl; -static inline StartMenu *impl_from_IMenuPopup(IMenuPopup *iface) +static LPStartMenu __inline impl_from_IMenuPopup(IMenuPopup *iface) { - return (StartMenu *)((char *)iface - FIELD_OFFSET(StartMenu, vtbl)); + return (LPStartMenu)((char *)iface - FIELD_OFFSET(StartMenu, vtbl)); } -static inline StartMenu *impl_from_IObjectWithSite(IObjectWithSite *iface) +static LPStartMenu __inline impl_from_IObjectWithSite(IObjectWithSite *iface) { - return (StartMenu *)((char *)iface - FIELD_OFFSET(StartMenu, objectSiteVtbl)); + return (LPStartMenu)((char *)iface - FIELD_OFFSET(StartMenu, objectSiteVtbl)); } -static inline StartMenu *impl_from_IInitializeObject(IInitializeObject *iface) +static LPStartMenu __inline impl_from_IInitializeObject(IInitializeObject *iface) { - return (StartMenu *)((char *)iface - FIELD_OFFSET(StartMenu, initObjectVtbl)); + return (LPStartMenu)((char *)iface - FIELD_OFFSET(StartMenu, initObjectVtbl)); } HRESULT WINAPI StartMenu_Constructor(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv) diff --git a/reactos/dll/win32/shell32/undocshell.h b/reactos/dll/win32/shell32/undocshell.h index d4ebf03c1cd..68d9bbe1dab 100644 --- a/reactos/dll/win32/shell32/undocshell.h +++ b/reactos/dll/win32/shell32/undocshell.h @@ -51,8 +51,7 @@ BOOL WINAPI ILGetDisplayNameEx( LPITEMIDLIST WINAPI ILGlobalClone(LPCITEMIDLIST pidl); void WINAPI ILGlobalFree(LPITEMIDLIST pidl); - -LPITEMIDLIST WINAPI SHSimpleIDListFromPathA (LPCSTR lpszPath); +LPITEMIDLIST WINAPI SHSimpleIDListFromPathA (LPCSTR lpszPath); //FIXME LPITEMIDLIST WINAPI SHSimpleIDListFromPathW (LPCWSTR lpszPath); HRESULT WINAPI SHILCreateFromPathA ( @@ -176,10 +175,10 @@ typedef struct * System Imagelist Routines */ -int WINAPI Shell_GetCachedImageIndex( +int WINAPI Shell_GetCachedImageIndexA( LPCSTR lpszFileName, - UINT nIconIndex, - BOOL bSimulateDoc); + int nIconIndex, + UINT bSimulateDoc); BOOL WINAPI Shell_GetImageLists( HIMAGELIST *lphimlLarge, @@ -415,7 +414,7 @@ VOID WINAPI PathSetDlgItemPathAW(HWND hDlg, int nIDDlgItem, LPCVOID lpszPath); /* PathProcessCommand flags */ #define PPCF_QUOTEPATH 0x01 /* implies PPCF_INCLUDEARGS */ #define PPCF_INCLUDEARGS 0x02 -#define PPCF_NODIRECTORIES 0x10 +//#define PPCF_NODIRECTORIES 0x10 move to shlobj #define PPCF_DONTRESOLVE 0x20 #define PPCF_PATHISRELATIVE 0x40 @@ -545,9 +544,6 @@ DWORD WINAPI CheckEscapesW(LPWSTR string, DWORD len); /* policy functions */ BOOL WINAPI SHInitRestricted(LPCVOID unused, LPCVOID inpRegKey); -DEFINE_GUID(CLSID_OpenWith, 0x09799AFB, 0xAD67, 0x11d1, 0xAB,0xCD,0x00,0xC0,0x4F,0xC3,0x09,0x36); -DEFINE_GUID(CLSID_StartMenu, 0x4622AD11, 0xFF23, 0x11D0, 0x8D,0x34,0x00,0xA0,0xC9,0x0F,0x27,0x19); - /* Shell Desktop functions */ #undef INTERFACE @@ -579,6 +575,8 @@ DECLARE_INTERFACE_(IShellDesktop,IUnknown) HANDLE WINAPI SHCreateDesktop(IShellDesktop*); BOOL WINAPI SHDesktopMessageLoop(HANDLE); +#define CSIDL_FOLDER_MASK 0x00ff + #ifdef __cplusplus } /* extern "C" */ #endif /* defined(__cplusplus) */ diff --git a/reactos/dll/win32/syssetup/install.c b/reactos/dll/win32/syssetup/install.c index 7ec896ffedc..df20011587b 100644 --- a/reactos/dll/win32/syssetup/install.c +++ b/reactos/dll/win32/syssetup/install.c @@ -979,13 +979,6 @@ InstallReactOS(HINSTANCE hInstance) return 0; } - if (SetupData.BootCDRegtestActive) - { - /// THE FOLLOWING DPRINT IS FOR THE SYSTEM REGRESSION TOOL - /// DO NOT REMOVE!!! - DbgPrint("SYSREG_CHECKPOINT:SYSSETUP_COMPLETE\n"); - } - ExitWindowsEx(EWX_REBOOT, 0); return 0; } diff --git a/reactos/dll/win32/syssetup/wizard.c b/reactos/dll/win32/syssetup/wizard.c index 8dada65e5f6..d2cd2f1ffce 100644 --- a/reactos/dll/win32/syssetup/wizard.c +++ b/reactos/dll/win32/syssetup/wizard.c @@ -2192,6 +2192,8 @@ ProcessUnattendInf(HINF hUnattendedInf) { char szPath[MAX_PATH]; FILE * file; + WIN32_FIND_DATAA ffd; + HANDLE hFind = INVALID_HANDLE_VALUE; #if 0 if (!SHGetSpecialFolderPathA(0, szPath, CSIDL_DESKTOP, FALSE)) { @@ -2217,20 +2219,22 @@ ProcessUnattendInf(HINF hUnattendedInf) (const BYTE*)szPath, strlen(szPath) * sizeof(char)); - if (GetSystemDirectoryA(szPath, MAX_PATH)) - { - UINT length = strlen(szPath); - if (szPath[length-1] != '\\') - { - szPath[length] = '\\'; - length++; - } - strcpy(&szPath[length], "dbgprint.exe SYSREG_CHECKPOINT:THIRDBOOT_COMPLETE\n"); - fwrite(szPath, 1, strlen(szPath) + 1, file); - strcpy(&szPath[length], "shutdown.exe -s"); - fwrite(szPath, 1, strlen(szPath) + 1, file); + /* winetests */ + hFind = FindFirstFileA("c:\\reactos\\bin\\*.exe", &ffd); /* %windir% isn't working on ros */ + if (hFind != INVALID_HANDLE_VALUE) + { + do + { + if (ffd.dwFileAttributes & ~FILE_ATTRIBUTE_DIRECTORY) + fprintf(file, "%s%s\n", "dbgprint --winetest %windir%\\bin\\", ffd.cFileName); } + while (FindNextFileA(hFind, &ffd) != 0); + FindClose(hFind); + } + + fprintf(file, "%s\n", "dbgprint SYSREG_CHECKPOINT:THIRDBOOT_COMPLETE"); + fprintf(file, "%s\n", "shutdown -s"); fclose(file); } RegCloseKey(hKey); diff --git a/reactos/dll/win32/user32/include/user32p.h b/reactos/dll/win32/user32/include/user32p.h index 24a9c9f4d82..3c156a0bb00 100644 --- a/reactos/dll/win32/user32/include/user32p.h +++ b/reactos/dll/win32/user32/include/user32p.h @@ -187,6 +187,7 @@ extern int SPY_Init(void); #define VALIDATE_TYPE_ACCEL 8 #define VALIDATE_TYPE_MONITOR 12 #define VALIDATE_TYPE_EVENT 15 +#define VALIDATE_TYPE_TIMER 16 #define FIRST_USER_HANDLE 0x0020 /* first possible value for low word of user handle */ #define LAST_USER_HANDLE 0xffef /* last possible value for low word of user handle */ diff --git a/reactos/dll/win32/user32/windows/dialog.c b/reactos/dll/win32/user32/windows/dialog.c index f45142b614f..1980fb32b8e 100644 --- a/reactos/dll/win32/user32/windows/dialog.c +++ b/reactos/dll/win32/user32/windows/dialog.c @@ -755,14 +755,13 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate, { rect.left += MulDiv(template.x, xBaseUnit, 4); rect.top += MulDiv(template.y, yBaseUnit, 8); + if( !(template.style & (WS_CHILD|DS_ABSALIGN)) ) + ClientToScreen( owner, (POINT *)&rect ); } if ( !(template.style & WS_CHILD) ) { INT dX, dY; - if( !(template.style & DS_ABSALIGN) ) - ClientToScreen( owner, (POINT *)&rect ); - /* try to fit it into the desktop */ if( (dX = rect.left + rect.right + GetSystemMetrics(SM_CXDLGFRAME) diff --git a/reactos/dll/win32/win32.rbuild b/reactos/dll/win32/win32.rbuild index ef58b5e7b08..bd011344499 100644 --- a/reactos/dll/win32/win32.rbuild +++ b/reactos/dll/win32/win32.rbuild @@ -196,6 +196,9 @@ + + + @@ -211,6 +214,9 @@ + + + @@ -289,6 +295,12 @@ + + + + + + diff --git a/reactos/dll/win32/wininet/cookie.c b/reactos/dll/win32/wininet/cookie.c index bd22bc625c4..12d841bc7b9 100644 --- a/reactos/dll/win32/wininet/cookie.c +++ b/reactos/dll/win32/wininet/cookie.c @@ -631,10 +631,10 @@ BOOL WINAPI InternetClearAllPerSiteCookieDecisions( VOID ) * * See InternetEnumPerSiteCookieDecisionW. */ -BOOL WINAPI InternetEnumPerSiteCookieDecisionA( LPSTR pszSiteName, unsigned long *pcSiteNameSize, - unsigned long *pdwDecision, unsigned long dwIndex ) +BOOL WINAPI InternetEnumPerSiteCookieDecisionA( LPSTR pszSiteName, ULONG *pcSiteNameSize, + ULONG *pdwDecision, ULONG dwIndex ) { - FIXME("(%s, %p, %p, 0x%08lx) stub\n", + FIXME("(%s, %p, %p, 0x%08x) stub\n", debugstr_a(pszSiteName), pcSiteNameSize, pdwDecision, dwIndex); return FALSE; } @@ -649,10 +649,10 @@ BOOL WINAPI InternetEnumPerSiteCookieDecisionA( LPSTR pszSiteName, unsigned long * FALSE on failure * */ -BOOL WINAPI InternetEnumPerSiteCookieDecisionW( LPWSTR pszSiteName, unsigned long *pcSiteNameSize, - unsigned long *pdwDecision, unsigned long dwIndex ) +BOOL WINAPI InternetEnumPerSiteCookieDecisionW( LPWSTR pszSiteName, ULONG *pcSiteNameSize, + ULONG *pdwDecision, ULONG dwIndex ) { - FIXME("(%s, %p, %p, 0x%08lx) stub\n", + FIXME("(%s, %p, %p, 0x%08x) stub\n", debugstr_w(pszSiteName), pcSiteNameSize, pdwDecision, dwIndex); return FALSE; } @@ -660,7 +660,7 @@ BOOL WINAPI InternetEnumPerSiteCookieDecisionW( LPWSTR pszSiteName, unsigned lon /*********************************************************************** * InternetGetPerSiteCookieDecisionA (WININET.@) */ -BOOL WINAPI InternetGetPerSiteCookieDecisionA( LPCSTR pwchHostName, unsigned long *pResult ) +BOOL WINAPI InternetGetPerSiteCookieDecisionA( LPCSTR pwchHostName, ULONG *pResult ) { FIXME("(%s, %p) stub\n", debugstr_a(pwchHostName), pResult); return FALSE; @@ -669,7 +669,7 @@ BOOL WINAPI InternetGetPerSiteCookieDecisionA( LPCSTR pwchHostName, unsigned lon /*********************************************************************** * InternetGetPerSiteCookieDecisionW (WININET.@) */ -BOOL WINAPI InternetGetPerSiteCookieDecisionW( LPCWSTR pwchHostName, unsigned long *pResult ) +BOOL WINAPI InternetGetPerSiteCookieDecisionW( LPCWSTR pwchHostName, ULONG *pResult ) { FIXME("(%s, %p) stub\n", debugstr_w(pwchHostName), pResult); return FALSE; diff --git a/reactos/dll/win32/wininet/ftp.c b/reactos/dll/win32/wininet/ftp.c index 36e90057008..cb24782fa4b 100644 --- a/reactos/dll/win32/wininet/ftp.c +++ b/reactos/dll/win32/wininet/ftp.c @@ -1227,8 +1227,7 @@ static DWORD FTPFILE_QueryOption(WININETHANDLEHEADER *hdr, DWORD option, void *b return ERROR_SUCCESS; } - FIXME("Not implemented option %d\n", option); - return ERROR_INTERNET_INVALID_OPTION; + return INET_QueryOption(option, buffer, size, unicode); } static DWORD FTPFILE_ReadFile(WININETHANDLEHEADER *hdr, void *buffer, DWORD size, DWORD *read) @@ -1553,6 +1552,7 @@ static BOOL FTP_FtpGetFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszRemoteFile, &iar, sizeof(INTERNET_ASYNC_RESULT)); } + if (!bSuccess) DeleteFileW(lpszNewFile); return bSuccess; } @@ -2194,8 +2194,7 @@ static DWORD FTPSESSION_QueryOption(WININETHANDLEHEADER *hdr, DWORD option, void return ERROR_SUCCESS; } - FIXME("Not implemented option %d\n", option); - return ERROR_INTERNET_INVALID_OPTION; + return INET_QueryOption(option, buffer, size, unicode); } static const HANDLEHEADERVtbl FTPSESSIONVtbl = { @@ -3275,8 +3274,7 @@ static DWORD FTPFINDNEXT_QueryOption(WININETHANDLEHEADER *hdr, DWORD option, voi return ERROR_SUCCESS; } - FIXME("Not implemented option %d\n", option); - return ERROR_INTERNET_INVALID_OPTION; + return INET_QueryOption(option, buffer, size, unicode); } static DWORD FTPFINDNEXT_FindNextFileW(WININETHANDLEHEADER *hdr, void *data) diff --git a/reactos/dll/win32/wininet/http.c b/reactos/dll/win32/wininet/http.c index a27997e84c8..f0ad6beddc1 100644 --- a/reactos/dll/win32/wininet/http.c +++ b/reactos/dll/win32/wininet/http.c @@ -1348,6 +1348,8 @@ static BOOL HTTP_ResolveName(LPWININETHTTPREQW lpwhr) INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext, INTERNET_STATUS_NAME_RESOLVED, szaddr, strlen(szaddr)+1); + + TRACE("resolved %s to %s\n", debugstr_w(lpwhs->lpszServerName), szaddr); return TRUE; } @@ -1394,7 +1396,6 @@ static void HTTPREQ_Destroy(WININETHANDLEHEADER *hdr) static void HTTPREQ_CloseConnection(WININETHANDLEHEADER *hdr) { LPWININETHTTPREQW lpwhr = (LPWININETHTTPREQW) hdr; - LPWININETHTTPSESSIONW lpwhs = NULL; TRACE("%p\n",lpwhr); @@ -1426,8 +1427,6 @@ static void HTTPREQ_CloseConnection(WININETHANDLEHEADER *hdr) lpwhr->pProxyAuthInfo = NULL; } - lpwhs = lpwhr->lpHttpSession; - INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext, INTERNET_STATUS_CLOSING_CONNECTION, 0, 0); @@ -1456,14 +1455,20 @@ static DWORD HTTPREQ_QueryOption(WININETHANDLEHEADER *hdr, DWORD option, void *b WCHAR url[INTERNET_MAX_URL_LENGTH]; HTTPHEADERW *host; DWORD len; + WCHAR *pch; - static const WCHAR formatW[] = {'h','t','t','p',':','/','/','%','s','%','s',0}; + static const WCHAR httpW[] = {'h','t','t','p',':','/','/',0}; static const WCHAR hostW[] = {'H','o','s','t',0}; TRACE("INTERNET_OPTION_URL\n"); host = HTTP_GetHeader(req, hostW); - sprintfW(url, formatW, host->lpszValue, req->lpszPath); + strcpyW(url, httpW); + strcatW(url, host->lpszValue); + if (NULL != (pch = strchrW(url + strlenW(httpW), ':'))) + *pch = 0; + strcatW(url, req->lpszPath); + TRACE("INTERNET_OPTION_URL: %s\n",debugstr_w(url)); if(unicode) { @@ -1576,8 +1581,7 @@ static DWORD HTTPREQ_QueryOption(WININETHANDLEHEADER *hdr, DWORD option, void *b } } - FIXME("Not implemented option %d\n", option); - return ERROR_INTERNET_INVALID_OPTION; + return INET_QueryOption(option, buffer, size, unicode); } static DWORD HTTPREQ_SetOption(WININETHANDLEHEADER *hdr, DWORD option, void *buffer, DWORD size) @@ -1886,13 +1890,10 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(LPWININETHTTPSESSIONW lpwhs, { LPWININETAPPINFOW hIC = NULL; LPWININETHTTPREQW lpwhr; - LPWSTR lpszCookies; - LPWSTR lpszUrl = NULL; - DWORD nCookieSize; + LPWSTR lpszHostName = NULL; HINTERNET handle = NULL; - static const WCHAR szUrlForm[] = {'h','t','t','p',':','/','/','%','s',0}; + static const WCHAR szHostForm[] = {'%','s',':','%','u',0}; DWORD len; - LPHTTPHEADERW Host; TRACE("-->\n"); @@ -1917,6 +1918,14 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(LPWININETHTTPSESSIONW lpwhs, lpwhr->lpHttpSession = lpwhs; list_add_head( &lpwhs->hdr.children, &lpwhr->hdr.entry ); + lpszHostName = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR) * + (strlenW(lpwhs->lpszHostName) + 7 /* length of ":65535" + 1 */)); + if (NULL == lpszHostName) + { + INTERNET_SetLastError(ERROR_OUTOFMEMORY); + goto lend; + } + handle = WININET_AllocHandle( &lpwhr->hdr ); if (NULL == handle) { @@ -1971,7 +1980,17 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(LPWININETHTTPSESSIONW lpwhs, else lpwhr->lpszVersion = WININET_strdupW(g_szHttp1_1); - HTTP_ProcessHeader(lpwhr, szHost, lpwhs->lpszHostName, HTTP_ADDREQ_FLAG_ADD | HTTP_ADDHDR_FLAG_REQ); + if (lpwhs->nHostPort != INTERNET_INVALID_PORT_NUMBER && + lpwhs->nHostPort != INTERNET_DEFAULT_HTTP_PORT && + lpwhs->nHostPort != INTERNET_DEFAULT_HTTPS_PORT) + { + sprintfW(lpszHostName, szHostForm, lpwhs->lpszHostName, lpwhs->nHostPort); + HTTP_ProcessHeader(lpwhr, szHost, lpszHostName, + HTTP_ADDREQ_FLAG_ADD | HTTP_ADDHDR_FLAG_REQ); + } + else + HTTP_ProcessHeader(lpwhr, szHost, lpwhs->lpszHostName, + HTTP_ADDREQ_FLAG_ADD | HTTP_ADDHDR_FLAG_REQ); if (lpwhs->nServerPort == INTERNET_INVALID_PORT_NUMBER) lpwhs->nServerPort = (dwFlags & INTERNET_FLAG_SECURE ? @@ -1986,47 +2005,12 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(LPWININETHTTPSESSIONW lpwhs, if (NULL != hIC->lpszProxy && hIC->lpszProxy[0] != 0) HTTP_DealWithProxy( hIC, lpwhs, lpwhr ); - Host = HTTP_GetHeader(lpwhr,szHost); - - len = lstrlenW(Host->lpszValue) + strlenW(szUrlForm); - lpszUrl = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); - sprintfW( lpszUrl, szUrlForm, Host->lpszValue ); - - if (!(lpwhr->hdr.dwFlags & INTERNET_FLAG_NO_COOKIES) && - InternetGetCookieW(lpszUrl, NULL, NULL, &nCookieSize)) - { - int cnt = 0; - static const WCHAR szCookie[] = {'C','o','o','k','i','e',':',' ',0}; - static const WCHAR szcrlf[] = {'\r','\n',0}; - - lpszCookies = HeapAlloc(GetProcessHeap(), 0, (nCookieSize + 1 + 8)*sizeof(WCHAR)); - - cnt += sprintfW(lpszCookies, szCookie); - InternetGetCookieW(lpszUrl, NULL, lpszCookies + cnt, &nCookieSize); - strcatW(lpszCookies, szcrlf); - - HTTP_HttpAddRequestHeadersW(lpwhr, lpszCookies, strlenW(lpszCookies), - HTTP_ADDREQ_FLAG_ADD); - HeapFree(GetProcessHeap(), 0, lpszCookies); - } - HeapFree(GetProcessHeap(), 0, lpszUrl); - - INTERNET_SendCallback(&lpwhs->hdr, dwContext, INTERNET_STATUS_HANDLE_CREATED, &handle, sizeof(handle)); - /* - * A STATUS_REQUEST_COMPLETE is NOT sent here as per my tests on windows - */ - - if (!HTTP_ResolveName(lpwhr)) - { - InternetCloseHandle( handle ); - handle = NULL; - } - lend: + HeapFree(GetProcessHeap(), 0, lpszHostName); if( lpwhr ) WININET_Release( &lpwhr->hdr ); @@ -3027,17 +3011,16 @@ static BOOL HTTP_HandleRedirect(LPWININETHTTPREQW lpwhr, LPCWSTR lpszUrl) if (!using_proxy) { - HeapFree(GetProcessHeap(), 0, lpwhs->lpszServerName); - lpwhs->lpszServerName = WININET_strdupW(hostName); - lpwhs->nServerPort = urlComponents.nPort; + if (strcmpiW(lpwhs->lpszServerName, hostName) || lpwhs->nServerPort != urlComponents.nPort) + { + HeapFree(GetProcessHeap(), 0, lpwhs->lpszServerName); + lpwhs->lpszServerName = WININET_strdupW(hostName); + lpwhs->nServerPort = urlComponents.nPort; - if (!HTTP_ResolveName(lpwhr)) - return FALSE; - - NETCON_close(&lpwhr->netConnection); - - if (!NETCON_init(&lpwhr->netConnection,lpwhr->hdr.dwFlags & INTERNET_FLAG_SECURE)) - return FALSE; + NETCON_close(&lpwhr->netConnection); + if (!HTTP_ResolveName(lpwhr)) return FALSE; + if (!NETCON_init(&lpwhr->netConnection, lpwhr->hdr.dwFlags & INTERNET_FLAG_SECURE)) return FALSE; + } } else TRACE("Redirect through proxy\n"); @@ -3139,6 +3122,37 @@ static BOOL HTTP_SecureProxyConnect(LPWININETHTTPREQW lpwhr) return TRUE; } +static void HTTP_InsertCookies(LPWININETHTTPREQW lpwhr) +{ + static const WCHAR szUrlForm[] = {'h','t','t','p',':','/','/','%','s',0}; + LPWSTR lpszCookies, lpszUrl = NULL; + DWORD nCookieSize, size; + LPHTTPHEADERW Host = HTTP_GetHeader(lpwhr,szHost); + + size = (strlenW(Host->lpszValue) + strlenW(szUrlForm)) * sizeof(WCHAR); + if (!(lpszUrl = HeapAlloc(GetProcessHeap(), 0, size))) return; + sprintfW( lpszUrl, szUrlForm, Host->lpszValue ); + + if (InternetGetCookieW(lpszUrl, NULL, NULL, &nCookieSize)) + { + int cnt = 0; + static const WCHAR szCookie[] = {'C','o','o','k','i','e',':',' ',0}; + static const WCHAR szcrlf[] = {'\r','\n',0}; + + size = sizeof(szCookie) + nCookieSize * sizeof(WCHAR) + sizeof(szcrlf); + if ((lpszCookies = HeapAlloc(GetProcessHeap(), 0, size))) + { + cnt += sprintfW(lpszCookies, szCookie); + InternetGetCookieW(lpszUrl, NULL, lpszCookies + cnt, &nCookieSize); + strcatW(lpszCookies, szcrlf); + + HTTP_HttpAddRequestHeadersW(lpwhr, lpszCookies, strlenW(lpszCookies), HTTP_ADDREQ_FLAG_ADD); + HeapFree(GetProcessHeap(), 0, lpszCookies); + } + } + HeapFree(GetProcessHeap(), 0, lpszUrl); +} + /*********************************************************************** * HTTP_HttpSendRequestW (internal) * @@ -3159,7 +3173,6 @@ BOOL WINAPI HTTP_HttpSendRequestW(LPWININETHTTPREQW lpwhr, LPCWSTR lpszHeaders, INT responseLen; BOOL loop_next; INTERNET_ASYNC_RESULT iar; - static const WCHAR szClose[] = { 'C','l','o','s','e',0 }; static const WCHAR szPost[] = { 'P','O','S','T',0 }; static const WCHAR szContentLength[] = { 'C','o','n','t','e','n','t','-','L','e','n','g','t','h',':',' ','%','l','i','\r','\n',0 }; @@ -3169,9 +3182,6 @@ BOOL WINAPI HTTP_HttpSendRequestW(LPWININETHTTPREQW lpwhr, LPCWSTR lpszHeaders, assert(lpwhr->hdr.htype == WH_HHTTPREQ); - /* Clear any error information */ - INTERNET_SetLastError(0); - /* if the verb is NULL default to GET */ if (!lpwhr->lpszVerb) lpwhr->lpszVerb = WININET_strdupW(szGET); @@ -3194,6 +3204,17 @@ BOOL WINAPI HTTP_HttpSendRequestW(LPWININETHTTPREQW lpwhr, LPCWSTR lpszHeaders, HTTP_HttpAddRequestHeadersW(lpwhr, agent_header, strlenW(agent_header), HTTP_ADDREQ_FLAG_ADD_IF_NEW); HeapFree(GetProcessHeap(), 0, agent_header); } + if (lpwhr->hdr.dwFlags & INTERNET_FLAG_PRAGMA_NOCACHE) + { + static const WCHAR pragma_nocache[] = {'P','r','a','g','m','a',':',' ','n','o','-','c','a','c','h','e','\r','\n',0}; + HTTP_HttpAddRequestHeadersW(lpwhr, pragma_nocache, strlenW(pragma_nocache), HTTP_ADDREQ_FLAG_ADD_IF_NEW); + } + if ((lpwhr->hdr.dwFlags & INTERNET_FLAG_NO_CACHE_WRITE) && !strcmpW(lpwhr->lpszVerb, szPost)) + { + static const WCHAR cache_control[] = {'C','a','c','h','e','-','C','o','n','t','r','o','l',':', + ' ','n','o','-','c','a','c','h','e','\r','\n',0}; + HTTP_HttpAddRequestHeadersW(lpwhr, cache_control, strlenW(cache_control), HTTP_ADDREQ_FLAG_ADD_IF_NEW); + } do { @@ -3214,13 +3235,16 @@ BOOL WINAPI HTTP_HttpSendRequestW(LPWININETHTTPREQW lpwhr, LPCWSTR lpszHeaders, } HTTP_FixURL(lpwhr); - HTTP_ProcessHeader(lpwhr, szConnection, - lpwhr->hdr.dwFlags & INTERNET_FLAG_KEEP_CONNECTION ? szKeepAlive : szClose, - HTTP_ADDHDR_FLAG_REQ | HTTP_ADDHDR_FLAG_REPLACE); - + if (lpwhr->hdr.dwFlags & INTERNET_FLAG_KEEP_CONNECTION) + { + HTTP_ProcessHeader(lpwhr, szConnection, szKeepAlive, HTTP_ADDHDR_FLAG_REQ | HTTP_ADDHDR_FLAG_REPLACE); + } HTTP_InsertAuthorization(lpwhr, lpwhr->pAuthInfo, szAuthorization); HTTP_InsertAuthorization(lpwhr, lpwhr->pProxyAuthInfo, szProxy_Authorization); + if (!(lpwhr->hdr.dwFlags & INTERNET_FLAG_NO_COOKIES)) + HTTP_InsertCookies(lpwhr); + /* add the headers the caller supplied */ if( lpszHeaders && dwHeaderLength ) { @@ -3413,6 +3437,7 @@ lend: sizeof(INTERNET_ASYNC_RESULT)); TRACE("<--\n"); + if (bSuccess) INTERNET_SetLastError(ERROR_SUCCESS); return bSuccess; } @@ -3451,8 +3476,7 @@ static DWORD HTTPSESSION_QueryOption(WININETHANDLEHEADER *hdr, DWORD option, voi return ERROR_SUCCESS; } - FIXME("Not implemented option %d\n", option); - return ERROR_INTERNET_INVALID_OPTION; + return INET_QueryOption(option, buffer, size, unicode); } static const HANDLEHEADERVtbl HTTPSESSIONVtbl = { @@ -3598,6 +3622,7 @@ static BOOL HTTP_OpenConnection(LPWININETHTTPREQW lpwhr) bSuccess = TRUE; goto lend; } + if (!HTTP_ResolveName(lpwhr)) goto lend; lpwhs = lpwhr->lpHttpSession; @@ -3612,7 +3637,7 @@ static BOOL HTTP_OpenConnection(LPWININETHTTPREQW lpwhr) if (!NETCON_create(&lpwhr->netConnection, lpwhs->socketAddress.sin_family, SOCK_STREAM, 0)) { - WARN("Socket creation failed\n"); + WARN("Socket creation failed: %u\n", INTERNET_GetLastError()); goto lend; } @@ -3813,7 +3838,10 @@ lend: if (bSuccess) return rc; else + { + HeapFree(GetProcessHeap(), 0, lpszRawHeaders); return 0; + } } @@ -4026,7 +4054,9 @@ static BOOL HTTP_ProcessHeader(LPWININETHTTPREQW lpwhr, LPCWSTR field, LPCWSTR v BOOL HTTP_FinishedReading(LPWININETHTTPREQW lpwhr) { WCHAR szVersion[10]; + WCHAR szConnectionResponse[20]; DWORD dwBufferSize = sizeof(szVersion); + BOOL keepalive = FALSE; TRACE("\n"); @@ -4036,15 +4066,19 @@ BOOL HTTP_FinishedReading(LPWININETHTTPREQW lpwhr) &dwBufferSize, NULL) || strcmpiW(szVersion, g_szHttp1_1)) { - WCHAR szConnectionResponse[20]; - dwBufferSize = sizeof(szConnectionResponse); - if ((!HTTP_HttpQueryInfoW(lpwhr, HTTP_QUERY_CONNECTION, szConnectionResponse, &dwBufferSize, NULL) || - strcmpiW(szConnectionResponse, szKeepAlive)) && - (!HTTP_HttpQueryInfoW(lpwhr, HTTP_QUERY_PROXY_CONNECTION, szConnectionResponse, &dwBufferSize, NULL) || - strcmpiW(szConnectionResponse, szKeepAlive))) - { - HTTPREQ_CloseConnection(&lpwhr->hdr); - } + keepalive = TRUE; + } + + dwBufferSize = sizeof(szConnectionResponse); + if (HTTP_HttpQueryInfoW(lpwhr, HTTP_QUERY_PROXY_CONNECTION, szConnectionResponse, &dwBufferSize, NULL) || + HTTP_HttpQueryInfoW(lpwhr, HTTP_QUERY_CONNECTION, szConnectionResponse, &dwBufferSize, NULL)) + { + keepalive = !strcmpiW(szConnectionResponse, szKeepAlive); + } + + if (!keepalive) + { + HTTPREQ_CloseConnection(&lpwhr->hdr); } /* FIXME: store data in the URL cache here */ @@ -4142,6 +4176,9 @@ static BOOL HTTP_DeleteCustomHeader(LPWININETHTTPREQW lpwhr, DWORD index) return FALSE; lpwhr->nCustHeaders--; + HeapFree(GetProcessHeap(), 0, lpwhr->pCustHeaders[index].lpszField); + HeapFree(GetProcessHeap(), 0, lpwhr->pCustHeaders[index].lpszValue); + memmove( &lpwhr->pCustHeaders[index], &lpwhr->pCustHeaders[index+1], (lpwhr->nCustHeaders - index)* sizeof(HTTPHEADERW) ); memset( &lpwhr->pCustHeaders[lpwhr->nCustHeaders], 0, sizeof(HTTPHEADERW) ); diff --git a/reactos/dll/win32/wininet/inet_ntop.c b/reactos/dll/win32/wininet/inet_ntop.c index b13bdcce0c3..f29d46d1625 100644 --- a/reactos/dll/win32/wininet/inet_ntop.c +++ b/reactos/dll/win32/wininet/inet_ntop.c @@ -39,7 +39,10 @@ */ static const char *inet_ntop4(const u_char *src, char *dst, size_t size); + +#ifdef INET6 static const char *inet_ntop6(const u_char *src, char *dst, size_t size); +#endif /* char * * inet_ntop(af, src, dst, size) diff --git a/reactos/dll/win32/wininet/internet.c b/reactos/dll/win32/wininet/internet.c index 2301d9c8628..bad795ddbd4 100644 --- a/reactos/dll/win32/wininet/internet.c +++ b/reactos/dll/win32/wininet/internet.c @@ -181,9 +181,13 @@ BOOL WININET_Release( LPWININETHANDLEHEADER info ) TRACE( "closing connection %p\n", info); info->vtbl->CloseConnection( info ); } - INTERNET_SendCallback(info, info->dwContext, - INTERNET_STATUS_HANDLE_CLOSING, &info->hInternet, - sizeof(HINTERNET)); + /* Don't send a callback if this is a session handle created with InternetOpenUrl */ + if (info->htype != WH_HHTTPSESSION || !(info->dwInternalFlags & INET_OPENURL)) + { + INTERNET_SendCallback(info, info->dwContext, + INTERNET_STATUS_HANDLE_CLOSING, &info->hInternet, + sizeof(HINTERNET)); + } TRACE( "destroying object %p\n", info); if ( info->htype != WH_HINIT ) list_remove( &info->entry ); @@ -491,6 +495,8 @@ static VOID APPINFO_Destroy(WININETHANDLEHEADER *hdr) static DWORD APPINFO_QueryOption(WININETHANDLEHEADER *hdr, DWORD option, void *buffer, DWORD *size, BOOL unicode) { + LPWININETAPPINFOW ai = (LPWININETAPPINFOW)hdr; + switch(option) { case INTERNET_OPTION_HANDLE_TYPE: TRACE("INTERNET_OPTION_HANDLE_TYPE\n"); @@ -501,10 +507,98 @@ static DWORD APPINFO_QueryOption(WININETHANDLEHEADER *hdr, DWORD option, void *b *size = sizeof(DWORD); *(DWORD*)buffer = INTERNET_HANDLE_TYPE_INTERNET; return ERROR_SUCCESS; + + case INTERNET_OPTION_USER_AGENT: { + DWORD bufsize; + + TRACE("INTERNET_OPTION_USER_AGENT\n"); + + bufsize = *size; + + if (unicode) { + *size = (strlenW(ai->lpszAgent) + 1) * sizeof(WCHAR); + if(!buffer || bufsize < *size) + return ERROR_INSUFFICIENT_BUFFER; + + strcpyW(buffer, ai->lpszAgent); + }else { + *size = WideCharToMultiByte(CP_ACP, 0, ai->lpszAgent, -1, NULL, 0, NULL, NULL); + if(!buffer || bufsize < *size) + return ERROR_INSUFFICIENT_BUFFER; + + WideCharToMultiByte(CP_ACP, 0, ai->lpszAgent, -1, buffer, *size, NULL, NULL); + } + + return ERROR_SUCCESS; } - FIXME("Not implemented option %d\n", option); - return ERROR_INTERNET_INVALID_OPTION; + case INTERNET_OPTION_PROXY: + if (unicode) { + INTERNET_PROXY_INFOW *pi = (INTERNET_PROXY_INFOW *)buffer; + DWORD proxyBytesRequired = 0, proxyBypassBytesRequired = 0; + LPWSTR proxy, proxy_bypass; + + if (ai->lpszProxy) + proxyBytesRequired = (lstrlenW(ai->lpszProxy) + 1) * sizeof(WCHAR); + if (ai->lpszProxyBypass) + proxyBypassBytesRequired = (lstrlenW(ai->lpszProxyBypass) + 1) * sizeof(WCHAR); + if (*size < sizeof(INTERNET_PROXY_INFOW) + proxyBytesRequired + proxyBypassBytesRequired) + return ERROR_INSUFFICIENT_BUFFER; + + proxy = (LPWSTR)((LPBYTE)buffer + sizeof(INTERNET_PROXY_INFOW)); + proxy_bypass = (LPWSTR)((LPBYTE)buffer + sizeof(INTERNET_PROXY_INFOW) + proxyBytesRequired); + + pi->dwAccessType = ai->dwAccessType; + pi->lpszProxy = NULL; + pi->lpszProxyBypass = NULL; + if (ai->lpszProxy) { + lstrcpyW(proxy, ai->lpszProxy); + pi->lpszProxy = proxy; + } + + if (ai->lpszProxyBypass) { + lstrcpyW(proxy_bypass, ai->lpszProxyBypass); + pi->lpszProxyBypass = proxy_bypass; + } + + *size = sizeof(INTERNET_PROXY_INFOW) + proxyBytesRequired + proxyBypassBytesRequired; + return ERROR_SUCCESS; + }else { + INTERNET_PROXY_INFOA *pi = (INTERNET_PROXY_INFOA *)buffer; + DWORD proxyBytesRequired = 0, proxyBypassBytesRequired = 0; + LPSTR proxy, proxy_bypass; + + if (ai->lpszProxy) + proxyBytesRequired = WideCharToMultiByte(CP_ACP, 0, ai->lpszProxy, -1, NULL, 0, NULL, NULL); + if (ai->lpszProxyBypass) + proxyBypassBytesRequired = WideCharToMultiByte(CP_ACP, 0, ai->lpszProxyBypass, -1, + NULL, 0, NULL, NULL); + if (*size < sizeof(INTERNET_PROXY_INFOA) + proxyBytesRequired + proxyBypassBytesRequired) + return ERROR_INSUFFICIENT_BUFFER; + + proxy = (LPSTR)((LPBYTE)buffer + sizeof(INTERNET_PROXY_INFOA)); + proxy_bypass = (LPSTR)((LPBYTE)buffer + sizeof(INTERNET_PROXY_INFOA) + proxyBytesRequired); + + pi->dwAccessType = ai->dwAccessType; + pi->lpszProxy = NULL; + pi->lpszProxyBypass = NULL; + if (ai->lpszProxy) { + WideCharToMultiByte(CP_ACP, 0, ai->lpszProxy, -1, proxy, proxyBytesRequired, NULL, NULL); + pi->lpszProxy = proxy; + } + + if (ai->lpszProxyBypass) { + WideCharToMultiByte(CP_ACP, 0, ai->lpszProxyBypass, -1, proxy_bypass, + proxyBypassBytesRequired, NULL, NULL); + pi->lpszProxyBypass = proxy_bypass; + } + + *size = sizeof(INTERNET_PROXY_INFOA) + proxyBytesRequired + proxyBypassBytesRequired; + return ERROR_SUCCESS; + } + } + + return INET_QueryOption(option, buffer, size, unicode); } static const HANDLEHEADERVtbl APPINFOVtbl = { @@ -1046,14 +1140,14 @@ BOOL WINAPI InternetCloseHandle(HINTERNET hInternet) /*********************************************************************** * ConvertUrlComponentValue (Internal) * - * Helper function for InternetCrackUrlW + * Helper function for InternetCrackUrlA * */ static void ConvertUrlComponentValue(LPSTR* lppszComponent, LPDWORD dwComponentLen, LPWSTR lpwszComponent, DWORD dwwComponentLen, LPCSTR lpszStart, LPCWSTR lpwszStart) { - TRACE("%p %d %p %d %p %p\n", lppszComponent, *dwComponentLen, lpwszComponent, dwwComponentLen, lpszStart, lpwszStart); + TRACE("%p %d %p %d %p %p\n", *lppszComponent, *dwComponentLen, lpwszComponent, dwwComponentLen, lpszStart, lpwszStart); if (*dwComponentLen != 0) { DWORD nASCIILength=WideCharToMultiByte(CP_ACP,0,lpwszComponent,dwwComponentLen,NULL,0,NULL,NULL); @@ -1087,9 +1181,13 @@ BOOL WINAPI InternetCrackUrlA(LPCSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags, { DWORD nLength; URL_COMPONENTSW UCW; - WCHAR* lpwszUrl; + BOOL ret = FALSE; + WCHAR *lpwszUrl, *hostname = NULL, *username = NULL, *password = NULL, *path = NULL, + *scheme = NULL, *extra = NULL; - TRACE("(%s %u %x %p)\n", debugstr_a(lpszUrl), dwUrlLength, dwFlags, lpUrlComponents); + TRACE("(%s %u %x %p)\n", + lpszUrl ? debugstr_an(lpszUrl, dwUrlLength ? dwUrlLength : strlen(lpszUrl)) : "(null)", + dwUrlLength, dwFlags, lpUrlComponents); if (!lpszUrl || !*lpszUrl || !lpUrlComponents || lpUrlComponents->dwStructSize != sizeof(URL_COMPONENTSA)) @@ -1111,53 +1209,92 @@ BOOL WINAPI InternetCrackUrlA(LPCSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags, memset(&UCW,0,sizeof(UCW)); UCW.dwStructSize = sizeof(URL_COMPONENTSW); - if(lpUrlComponents->dwHostNameLength!=0) - UCW.dwHostNameLength= lpUrlComponents->dwHostNameLength; - if(lpUrlComponents->dwUserNameLength!=0) - UCW.dwUserNameLength=lpUrlComponents->dwUserNameLength; - if(lpUrlComponents->dwPasswordLength!=0) - UCW.dwPasswordLength=lpUrlComponents->dwPasswordLength; - if(lpUrlComponents->dwUrlPathLength!=0) - UCW.dwUrlPathLength=lpUrlComponents->dwUrlPathLength; - if(lpUrlComponents->dwSchemeLength!=0) - UCW.dwSchemeLength=lpUrlComponents->dwSchemeLength; - if(lpUrlComponents->dwExtraInfoLength!=0) - UCW.dwExtraInfoLength=lpUrlComponents->dwExtraInfoLength; - if(!InternetCrackUrlW(lpwszUrl,nLength,dwFlags,&UCW)) + if (lpUrlComponents->dwHostNameLength) { - HeapFree(GetProcessHeap(), 0, lpwszUrl); - return FALSE; + UCW.dwHostNameLength = lpUrlComponents->dwHostNameLength; + if (lpUrlComponents->lpszHostName) + { + hostname = HeapAlloc(GetProcessHeap(), 0, UCW.dwHostNameLength * sizeof(WCHAR)); + UCW.lpszHostName = hostname; + } } + if (lpUrlComponents->dwUserNameLength) + { + UCW.dwUserNameLength = lpUrlComponents->dwUserNameLength; + if (lpUrlComponents->lpszUserName) + { + username = HeapAlloc(GetProcessHeap(), 0, UCW.dwUserNameLength * sizeof(WCHAR)); + UCW.lpszUserName = username; + } + } + if (lpUrlComponents->dwPasswordLength) + { + UCW.dwPasswordLength = lpUrlComponents->dwPasswordLength; + if (lpUrlComponents->lpszPassword) + { + password = HeapAlloc(GetProcessHeap(), 0, UCW.dwPasswordLength * sizeof(WCHAR)); + UCW.lpszPassword = password; + } + } + if (lpUrlComponents->dwUrlPathLength) + { + UCW.dwUrlPathLength = lpUrlComponents->dwUrlPathLength; + if (lpUrlComponents->lpszUrlPath) + { + path = HeapAlloc(GetProcessHeap(), 0, UCW.dwUrlPathLength * sizeof(WCHAR)); + UCW.lpszUrlPath = path; + } + } + if (lpUrlComponents->dwSchemeLength) + { + UCW.dwSchemeLength = lpUrlComponents->dwSchemeLength; + if (lpUrlComponents->lpszScheme) + { + scheme = HeapAlloc(GetProcessHeap(), 0, UCW.dwSchemeLength * sizeof(WCHAR)); + UCW.lpszScheme = scheme; + } + } + if (lpUrlComponents->dwExtraInfoLength) + { + UCW.dwExtraInfoLength = lpUrlComponents->dwExtraInfoLength; + if (lpUrlComponents->lpszExtraInfo) + { + extra = HeapAlloc(GetProcessHeap(), 0, UCW.dwExtraInfoLength * sizeof(WCHAR)); + UCW.lpszExtraInfo = extra; + } + } + if ((ret = InternetCrackUrlW(lpwszUrl, nLength, dwFlags, &UCW))) + { + ConvertUrlComponentValue(&lpUrlComponents->lpszHostName, &lpUrlComponents->dwHostNameLength, + UCW.lpszHostName, UCW.dwHostNameLength, lpszUrl, lpwszUrl); + ConvertUrlComponentValue(&lpUrlComponents->lpszUserName, &lpUrlComponents->dwUserNameLength, + UCW.lpszUserName, UCW.dwUserNameLength, lpszUrl, lpwszUrl); + ConvertUrlComponentValue(&lpUrlComponents->lpszPassword, &lpUrlComponents->dwPasswordLength, + UCW.lpszPassword, UCW.dwPasswordLength, lpszUrl, lpwszUrl); + ConvertUrlComponentValue(&lpUrlComponents->lpszUrlPath, &lpUrlComponents->dwUrlPathLength, + UCW.lpszUrlPath, UCW.dwUrlPathLength, lpszUrl, lpwszUrl); + ConvertUrlComponentValue(&lpUrlComponents->lpszScheme, &lpUrlComponents->dwSchemeLength, + UCW.lpszScheme, UCW.dwSchemeLength, lpszUrl, lpwszUrl); + ConvertUrlComponentValue(&lpUrlComponents->lpszExtraInfo, &lpUrlComponents->dwExtraInfoLength, + UCW.lpszExtraInfo, UCW.dwExtraInfoLength, lpszUrl, lpwszUrl); - ConvertUrlComponentValue(&lpUrlComponents->lpszHostName, &lpUrlComponents->dwHostNameLength, - UCW.lpszHostName, UCW.dwHostNameLength, - lpszUrl, lpwszUrl); - ConvertUrlComponentValue(&lpUrlComponents->lpszUserName, &lpUrlComponents->dwUserNameLength, - UCW.lpszUserName, UCW.dwUserNameLength, - lpszUrl, lpwszUrl); - ConvertUrlComponentValue(&lpUrlComponents->lpszPassword, &lpUrlComponents->dwPasswordLength, - UCW.lpszPassword, UCW.dwPasswordLength, - lpszUrl, lpwszUrl); - ConvertUrlComponentValue(&lpUrlComponents->lpszUrlPath, &lpUrlComponents->dwUrlPathLength, - UCW.lpszUrlPath, UCW.dwUrlPathLength, - lpszUrl, lpwszUrl); - ConvertUrlComponentValue(&lpUrlComponents->lpszScheme, &lpUrlComponents->dwSchemeLength, - UCW.lpszScheme, UCW.dwSchemeLength, - lpszUrl, lpwszUrl); - ConvertUrlComponentValue(&lpUrlComponents->lpszExtraInfo, &lpUrlComponents->dwExtraInfoLength, - UCW.lpszExtraInfo, UCW.dwExtraInfoLength, - lpszUrl, lpwszUrl); - lpUrlComponents->nScheme=UCW.nScheme; - lpUrlComponents->nPort=UCW.nPort; + lpUrlComponents->nScheme = UCW.nScheme; + lpUrlComponents->nPort = UCW.nPort; + + TRACE("%s: scheme(%s) host(%s) path(%s) extra(%s)\n", lpszUrl, + debugstr_an(lpUrlComponents->lpszScheme, lpUrlComponents->dwSchemeLength), + debugstr_an(lpUrlComponents->lpszHostName, lpUrlComponents->dwHostNameLength), + debugstr_an(lpUrlComponents->lpszUrlPath, lpUrlComponents->dwUrlPathLength), + debugstr_an(lpUrlComponents->lpszExtraInfo, lpUrlComponents->dwExtraInfoLength)); + } HeapFree(GetProcessHeap(), 0, lpwszUrl); - - TRACE("%s: scheme(%s) host(%s) path(%s) extra(%s)\n", lpszUrl, - debugstr_an(lpUrlComponents->lpszScheme,lpUrlComponents->dwSchemeLength), - debugstr_an(lpUrlComponents->lpszHostName,lpUrlComponents->dwHostNameLength), - debugstr_an(lpUrlComponents->lpszUrlPath,lpUrlComponents->dwUrlPathLength), - debugstr_an(lpUrlComponents->lpszExtraInfo,lpUrlComponents->dwExtraInfoLength)); - - return TRUE; + HeapFree(GetProcessHeap(), 0, hostname); + HeapFree(GetProcessHeap(), 0, username); + HeapFree(GetProcessHeap(), 0, password); + HeapFree(GetProcessHeap(), 0, path); + HeapFree(GetProcessHeap(), 0, scheme); + HeapFree(GetProcessHeap(), 0, extra); + return ret; } static const WCHAR url_schemes[][7] = @@ -1264,10 +1401,10 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl_orig, DWORD dwUrlLength_orig, DWOR LPCWSTR lpszcp = NULL; LPWSTR lpszUrl_decode = NULL; DWORD dwUrlLength = dwUrlLength_orig; - const WCHAR lpszSeparators[3]={';','?',0}; - const WCHAR lpszSlash[2]={'/',0}; - TRACE("(%s %u %x %p)\n", debugstr_w(lpszUrl), dwUrlLength, dwFlags, lpUC); + TRACE("(%s %u %x %p)\n", + lpszUrl ? debugstr_wn(lpszUrl, dwUrlLength ? dwUrlLength : strlenW(lpszUrl)) : "(null)", + dwUrlLength, dwFlags, lpUC); if (!lpszUrl_orig || !*lpszUrl_orig || !lpUC) { @@ -1278,16 +1415,33 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl_orig, DWORD dwUrlLength_orig, DWOR if (dwFlags & ICU_DECODE) { - lpszUrl_decode=HeapAlloc( GetProcessHeap(), 0, dwUrlLength * sizeof (WCHAR) ); - if( InternetCanonicalizeUrlW(lpszUrl_orig, lpszUrl_decode, &dwUrlLength, dwFlags)) - { - lpszUrl = lpszUrl_decode; - } + WCHAR *url_tmp; + DWORD len = dwUrlLength + 1; + + if (!(url_tmp = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)))) + { + INTERNET_SetLastError(ERROR_OUTOFMEMORY); + return FALSE; + } + memcpy(url_tmp, lpszUrl_orig, dwUrlLength * sizeof(WCHAR)); + url_tmp[dwUrlLength] = 0; + if (!(lpszUrl_decode = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)))) + { + HeapFree(GetProcessHeap(), 0, url_tmp); + INTERNET_SetLastError(ERROR_OUTOFMEMORY); + return FALSE; + } + if (InternetCanonicalizeUrlW(url_tmp, lpszUrl_decode, &len, ICU_DECODE | ICU_NO_ENCODE)) + { + dwUrlLength = len; + lpszUrl = lpszUrl_decode; + } + HeapFree(GetProcessHeap(), 0, url_tmp); } lpszap = lpszUrl; /* Determine if the URI is absolute. */ - while (*lpszap != '\0') + while (lpszap - lpszUrl < dwUrlLength) { if (isalnumW(*lpszap)) { @@ -1311,7 +1465,9 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl_orig, DWORD dwUrlLength_orig, DWOR lpUC->nPort = INTERNET_INVALID_PORT_NUMBER; /* Parse */ - lpszParam = strpbrkW(lpszap, lpszSeparators); + if (!(lpszParam = memchrW(lpszap, ';', dwUrlLength - (lpszap - lpszUrl)))) + lpszParam = memchrW(lpszap, '?', dwUrlLength - (lpszap - lpszUrl)); + SetUrlComponentValueW(&lpUC->lpszExtraInfo, &lpUC->dwExtraInfoLength, lpszParam, lpszParam ? dwUrlLength-(lpszParam-lpszUrl) : 0); @@ -1332,7 +1488,7 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl_orig, DWORD dwUrlLength_orig, DWOR { lpszcp += 2; - lpszNetLoc = strpbrkW(lpszcp, lpszSlash); + lpszNetLoc = memchrW(lpszcp, '/', dwUrlLength - (lpszcp - lpszUrl)); if (lpszParam) { if (lpszNetLoc) @@ -1352,7 +1508,7 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl_orig, DWORD dwUrlLength_orig, DWOR /* [[<:password>]@][:] */ /* First find the user and password if they exist */ - lpszHost = strchrW(lpszcp, '@'); + lpszHost = memchrW(lpszcp, '@', dwUrlLength - (lpszcp - lpszUrl)); if (lpszHost == NULL || lpszHost > lpszNetLoc) { /* username and password not specified. */ @@ -1461,7 +1617,7 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl_orig, DWORD dwUrlLength_orig, DWOR * :[//][/path][;][?][#] * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */ - if (lpszcp != 0 && *lpszcp != '\0' && (!lpszParam || lpszcp < lpszParam)) + if (lpszcp != 0 && lpszcp - lpszUrl < dwUrlLength && (!lpszParam || lpszcp < lpszParam)) { INT len; @@ -1475,7 +1631,7 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl_orig, DWORD dwUrlLength_orig, DWOR /* Leave the parameter list in lpszUrlPath. Strip off any trailing * newlines if necessary. */ - LPWSTR lpsznewline = strchrW(lpszcp, '\n'); + LPWSTR lpsznewline = memchrW(lpszcp, '\n', dwUrlLength - (lpszcp - lpszUrl)); if (lpsznewline != NULL) len = lpsznewline - lpszcp; else @@ -1486,6 +1642,8 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl_orig, DWORD dwUrlLength_orig, DWOR } else { + if (lpUC->lpszUrlPath && (lpUC->dwUrlPathLength > 0)) + lpUC->lpszUrlPath[0] = 0; lpUC->dwUrlPathLength = 0; } @@ -1586,7 +1744,7 @@ BOOL WINAPI InternetCanonicalizeUrlW(LPCWSTR lpszUrl, LPWSTR lpszBuffer, DWORD dwURLFlags = URL_WININET_COMPATIBILITY | URL_ESCAPE_UNSAFE; TRACE("(%s, %p, %p, 0x%08x) bufferlength: %d\n", debugstr_w(lpszUrl), lpszBuffer, - lpdwBufferLength, lpdwBufferLength ? *lpdwBufferLength : -1, dwFlags); + lpdwBufferLength, dwFlags, lpdwBufferLength ? *lpdwBufferLength : -1); if(dwFlags & ICU_DECODE) { @@ -1861,315 +2019,137 @@ BOOL WINAPI InternetReadFileExW(HINTERNET hFile, LPINTERNET_BUFFERSW lpBuffer, return FALSE; } -/*********************************************************************** - * INET_QueryOptionHelper (internal) - */ -static BOOL INET_QueryOptionHelper(BOOL bIsUnicode, HINTERNET hInternet, DWORD dwOption, - LPVOID lpBuffer, LPDWORD lpdwBufferLength) +DWORD INET_QueryOption(DWORD option, void *buffer, DWORD *size, BOOL unicode) { - LPWININETHANDLEHEADER lpwhh; - BOOL bSuccess = FALSE; + switch(option) { + case INTERNET_OPTION_REQUEST_FLAGS: + TRACE("INTERNET_OPTION_REQUEST_FLAGS\n"); - TRACE("(%p, 0x%08x, %p, %p)\n", hInternet, dwOption, lpBuffer, lpdwBufferLength); + if (*size < sizeof(ULONG)) + return ERROR_INSUFFICIENT_BUFFER; - lpwhh = WININET_GetObject( hInternet ); + *(ULONG*)buffer = 4; + *size = sizeof(ULONG); - switch (dwOption) - { - case INTERNET_OPTION_REQUEST_FLAGS: - { - ULONG flags = 4; - TRACE("INTERNET_OPTION_REQUEST_FLAGS: %d\n", flags); - if (*lpdwBufferLength < sizeof(ULONG)) - INTERNET_SetLastError(ERROR_INSUFFICIENT_BUFFER); - else - { - memcpy(lpBuffer, &flags, sizeof(ULONG)); - bSuccess = TRUE; - } - *lpdwBufferLength = sizeof(ULONG); - break; - } + return ERROR_SUCCESS; - case INTERNET_OPTION_USER_AGENT: - { - DWORD required; - LPWININETAPPINFOW ai = (LPWININETAPPINFOW)lpwhh; + case INTERNET_OPTION_HTTP_VERSION: + if (*size < sizeof(HTTP_VERSION_INFO)) + return ERROR_INSUFFICIENT_BUFFER; - TRACE("INTERNET_OPTION_USER_AGENT\n"); + /* + * Presently hardcoded to 1.1 + */ + ((HTTP_VERSION_INFO*)buffer)->dwMajorVersion = 1; + ((HTTP_VERSION_INFO*)buffer)->dwMinorVersion = 1; + *size = sizeof(HTTP_VERSION_INFO); - if (lpwhh->htype != INTERNET_HANDLE_TYPE_INTERNET) - { - INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE); - return FALSE; - } - if (bIsUnicode) - { - required = (strlenW(ai->lpszAgent) + 1) * sizeof(WCHAR); - if (*lpdwBufferLength < required) - INTERNET_SetLastError(ERROR_INSUFFICIENT_BUFFER); - else if (lpBuffer) - { - strcpyW(lpBuffer, ai->lpszAgent); - bSuccess = TRUE; - } - } - else - { - required = WideCharToMultiByte(CP_ACP, 0, ai->lpszAgent, -1, NULL, 0, NULL, NULL); - if (*lpdwBufferLength < required) - INTERNET_SetLastError(ERROR_INSUFFICIENT_BUFFER); - else if (lpBuffer) - { - WideCharToMultiByte(CP_ACP, 0, ai->lpszAgent, -1, lpBuffer, required, NULL, NULL); - bSuccess = TRUE; - } - } - *lpdwBufferLength = required; - break; - } - case INTERNET_OPTION_HTTP_VERSION: - { - if (*lpdwBufferLength < sizeof(HTTP_VERSION_INFO)) - INTERNET_SetLastError(ERROR_INSUFFICIENT_BUFFER); - else - { - /* - * Presently hardcoded to 1.1 - */ - ((HTTP_VERSION_INFO*)lpBuffer)->dwMajorVersion = 1; - ((HTTP_VERSION_INFO*)lpBuffer)->dwMinorVersion = 1; - bSuccess = TRUE; - } - *lpdwBufferLength = sizeof(HTTP_VERSION_INFO); - break; - } - case INTERNET_OPTION_CONNECTED_STATE: - { - DWORD *pdwConnectedState = (DWORD *)lpBuffer; - FIXME("INTERNET_OPTION_CONNECTED_STATE: semi-stub\n"); + return ERROR_SUCCESS; - if (*lpdwBufferLength < sizeof(*pdwConnectedState)) - INTERNET_SetLastError(ERROR_INSUFFICIENT_BUFFER); - else - { - *pdwConnectedState = INTERNET_STATE_CONNECTED; - bSuccess = TRUE; - } - *lpdwBufferLength = sizeof(*pdwConnectedState); - break; - } - case INTERNET_OPTION_PROXY: - { - LPWININETAPPINFOW lpwai = (LPWININETAPPINFOW)lpwhh; - WININETAPPINFOW wai; + case INTERNET_OPTION_CONNECTED_STATE: + FIXME("INTERNET_OPTION_CONNECTED_STATE: semi-stub\n"); - if (lpwai == NULL) - { - TRACE("Getting global proxy info\n"); - memset(&wai, 0, sizeof(WININETAPPINFOW)); - INTERNET_ConfigureProxy( &wai ); - lpwai = &wai; - } + if (*size < sizeof(ULONG)) + return ERROR_INSUFFICIENT_BUFFER; - if (bIsUnicode) - { - INTERNET_PROXY_INFOW *pPI = (INTERNET_PROXY_INFOW *)lpBuffer; - DWORD proxyBytesRequired = 0, proxyBypassBytesRequired = 0; + *(ULONG*)buffer = INTERNET_STATE_CONNECTED; + *size = sizeof(ULONG); - if (lpwai->lpszProxy) - proxyBytesRequired = (lstrlenW(lpwai->lpszProxy) + 1) * - sizeof(WCHAR); - if (lpwai->lpszProxyBypass) - proxyBypassBytesRequired = - (lstrlenW(lpwai->lpszProxyBypass) + 1) * sizeof(WCHAR); - if (*lpdwBufferLength < sizeof(INTERNET_PROXY_INFOW) + - proxyBytesRequired + proxyBypassBytesRequired) - INTERNET_SetLastError(ERROR_INSUFFICIENT_BUFFER); - else - { - LPWSTR proxy = (LPWSTR)((LPBYTE)lpBuffer + - sizeof(INTERNET_PROXY_INFOW)); - LPWSTR proxy_bypass = (LPWSTR)((LPBYTE)lpBuffer + - sizeof(INTERNET_PROXY_INFOW) + - proxyBytesRequired); + return ERROR_SUCCESS; - pPI->dwAccessType = lpwai->dwAccessType; - pPI->lpszProxy = NULL; - pPI->lpszProxyBypass = NULL; - if (lpwai->lpszProxy) - { - lstrcpyW(proxy, lpwai->lpszProxy); - pPI->lpszProxy = proxy; - } + case INTERNET_OPTION_PROXY: { + WININETAPPINFOW ai; - if (lpwai->lpszProxyBypass) - { - lstrcpyW(proxy_bypass, lpwai->lpszProxyBypass); - pPI->lpszProxyBypass = proxy_bypass; - } - bSuccess = TRUE; - } - *lpdwBufferLength = sizeof(INTERNET_PROXY_INFOW) + - proxyBytesRequired + proxyBypassBytesRequired; - } - else - { - INTERNET_PROXY_INFOA *pPI = (INTERNET_PROXY_INFOA *)lpBuffer; - DWORD proxyBytesRequired = 0, proxyBypassBytesRequired = 0; + TRACE("Getting global proxy info\n"); + memset(&ai, 0, sizeof(WININETAPPINFOW)); + INTERNET_ConfigureProxy(&ai); - if (lpwai->lpszProxy) - proxyBytesRequired = WideCharToMultiByte(CP_ACP, 0, - lpwai->lpszProxy, -1, NULL, 0, NULL, NULL); - if (lpwai->lpszProxyBypass) - proxyBypassBytesRequired = WideCharToMultiByte(CP_ACP, 0, - lpwai->lpszProxyBypass, -1, NULL, 0, NULL, NULL); - if (*lpdwBufferLength < sizeof(INTERNET_PROXY_INFOA) + - proxyBytesRequired + proxyBypassBytesRequired) - INTERNET_SetLastError(ERROR_INSUFFICIENT_BUFFER); - else - { - LPSTR proxy = (LPSTR)((LPBYTE)lpBuffer + - sizeof(INTERNET_PROXY_INFOA)); - LPSTR proxy_bypass = (LPSTR)((LPBYTE)lpBuffer + - sizeof(INTERNET_PROXY_INFOA) + - proxyBytesRequired); + return APPINFO_QueryOption(&ai.hdr, INTERNET_OPTION_PROXY, buffer, size, unicode); /* FIXME */ + } - pPI->dwAccessType = lpwai->dwAccessType; - pPI->lpszProxy = NULL; - pPI->lpszProxyBypass = NULL; - if (lpwai->lpszProxy) - { - WideCharToMultiByte(CP_ACP, 0, lpwai->lpszProxy, -1, - proxy, proxyBytesRequired, NULL, NULL); - pPI->lpszProxy = proxy; - } + case INTERNET_OPTION_MAX_CONNS_PER_SERVER: + TRACE("INTERNET_OPTION_MAX_CONNS_PER_SERVER\n"); - if (lpwai->lpszProxyBypass) - { - WideCharToMultiByte(CP_ACP, 0, lpwai->lpszProxyBypass, - -1, proxy_bypass, proxyBypassBytesRequired, - NULL, NULL); - pPI->lpszProxyBypass = proxy_bypass; - } - bSuccess = TRUE; - } - *lpdwBufferLength = sizeof(INTERNET_PROXY_INFOA) + - proxyBytesRequired + proxyBypassBytesRequired; - } - break; - } - case INTERNET_OPTION_MAX_CONNS_PER_SERVER: - { - ULONG conn = 2; - TRACE("INTERNET_OPTION_MAX_CONNS_PER_SERVER: %d\n", conn); - if (*lpdwBufferLength < sizeof(ULONG)) - INTERNET_SetLastError(ERROR_INSUFFICIENT_BUFFER); - else - { - memcpy(lpBuffer, &conn, sizeof(ULONG)); - bSuccess = TRUE; - } - *lpdwBufferLength = sizeof(ULONG); - break; - } - case INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER: - { - ULONG conn = 4; - TRACE("INTERNET_OPTION_MAX_CONNS_1_0_SERVER: %d\n", conn); - if (*lpdwBufferLength < sizeof(ULONG)) - INTERNET_SetLastError(ERROR_INSUFFICIENT_BUFFER); - else - { - memcpy(lpBuffer, &conn, sizeof(ULONG)); - bSuccess = TRUE; - } - *lpdwBufferLength = sizeof(ULONG); - break; - } - case INTERNET_OPTION_SECURITY_FLAGS: - FIXME("INTERNET_OPTION_SECURITY_FLAGS: Stub\n"); - bSuccess = TRUE; - break; + if (*size < sizeof(ULONG)) + return ERROR_INSUFFICIENT_BUFFER; - case INTERNET_OPTION_VERSION: - { - TRACE("INTERNET_OPTION_VERSION\n"); - if (*lpdwBufferLength < sizeof(INTERNET_VERSION_INFO)) - INTERNET_SetLastError(ERROR_INSUFFICIENT_BUFFER); - else - { - static const INTERNET_VERSION_INFO info = { 1, 2 }; - memcpy(lpBuffer, &info, sizeof(info)); - *lpdwBufferLength = sizeof(info); - bSuccess = TRUE; - } - break; - } - case INTERNET_OPTION_PER_CONNECTION_OPTION: - FIXME("INTERNET_OPTION_PER_CONNECTION_OPTION stub\n"); - if (*lpdwBufferLength < sizeof(INTERNET_PER_CONN_OPTION_LISTW)) - INTERNET_SetLastError(ERROR_INSUFFICIENT_BUFFER); - else - { - INTERNET_PER_CONN_OPTION_LISTW *con = lpBuffer; - int x; - bSuccess = TRUE; - for (x = 0; x < con->dwOptionCount; ++x) - { - INTERNET_PER_CONN_OPTIONW *option = con->pOptions + x; - switch (option->dwOption) - { - case INTERNET_PER_CONN_FLAGS: - option->Value.dwValue = PROXY_TYPE_DIRECT; - break; + *(ULONG*)buffer = 2; + *size = sizeof(ULONG); - case INTERNET_PER_CONN_PROXY_SERVER: - case INTERNET_PER_CONN_PROXY_BYPASS: - case INTERNET_PER_CONN_AUTOCONFIG_URL: - case INTERNET_PER_CONN_AUTODISCOVERY_FLAGS: - case INTERNET_PER_CONN_AUTOCONFIG_SECONDARY_URL: - case INTERNET_PER_CONN_AUTOCONFIG_RELOAD_DELAY_MINS: - case INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_TIME: - case INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_URL: - FIXME("Unhandled dwOption %d\n", option->dwOption); - option->Value.dwValue = 0; - bSuccess = FALSE; - break; + return ERROR_SUCCESS; - default: - FIXME("Unknown dwOption %d\n", option->dwOption); - bSuccess = FALSE; - break; - } - } - if (!bSuccess) - INTERNET_SetLastError(ERROR_INVALID_PARAMETER); - } - break; - case 66: - FIXME("66\n"); - bSuccess = TRUE; - break; - default: { - if(lpwhh) { - DWORD res; + case INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER: + TRACE("INTERNET_OPTION_MAX_CONNS_1_0_SERVER\n"); - res = lpwhh->vtbl->QueryOption(lpwhh, dwOption, lpBuffer, lpdwBufferLength, bIsUnicode); - if(res == ERROR_SUCCESS) - bSuccess = TRUE; - else - SetLastError(res); - }else { - FIXME("Stub! %d\n", dwOption); + if (*size < sizeof(ULONG)) + return ERROR_INSUFFICIENT_BUFFER; + + *(ULONG*)size = 4; + *size = sizeof(ULONG); + + return ERROR_SUCCESS; + + case INTERNET_OPTION_SECURITY_FLAGS: + FIXME("INTERNET_OPTION_SECURITY_FLAGS: Stub\n"); + return ERROR_SUCCESS; + + case INTERNET_OPTION_VERSION: { + static const INTERNET_VERSION_INFO info = { 1, 2 }; + + TRACE("INTERNET_OPTION_VERSION\n"); + + if (*size < sizeof(INTERNET_VERSION_INFO)) + return ERROR_INSUFFICIENT_BUFFER; + + memcpy(buffer, &info, sizeof(info)); + *size = sizeof(info); + + return ERROR_SUCCESS; + } + + case INTERNET_OPTION_PER_CONNECTION_OPTION: { + INTERNET_PER_CONN_OPTION_LISTW *con = buffer; + DWORD res = ERROR_SUCCESS, i; + + FIXME("INTERNET_OPTION_PER_CONNECTION_OPTION stub\n"); + + if (*size < sizeof(INTERNET_PER_CONN_OPTION_LISTW)) + return ERROR_INSUFFICIENT_BUFFER; + + for (i = 0; i < con->dwOptionCount; i++) { + INTERNET_PER_CONN_OPTIONW *option = con->pOptions + i; + + switch (option->dwOption) { + case INTERNET_PER_CONN_FLAGS: + option->Value.dwValue = PROXY_TYPE_DIRECT; + break; + + case INTERNET_PER_CONN_PROXY_SERVER: + case INTERNET_PER_CONN_PROXY_BYPASS: + case INTERNET_PER_CONN_AUTOCONFIG_URL: + case INTERNET_PER_CONN_AUTODISCOVERY_FLAGS: + case INTERNET_PER_CONN_AUTOCONFIG_SECONDARY_URL: + case INTERNET_PER_CONN_AUTOCONFIG_RELOAD_DELAY_MINS: + case INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_TIME: + case INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_URL: + FIXME("Unhandled dwOption %d\n", option->dwOption); + option->Value.dwValue = 0; + res = ERROR_INVALID_PARAMETER; + break; + + default: + FIXME("Unknown dwOption %d\n", option->dwOption); + res = ERROR_INVALID_PARAMETER; break; } } - } - if (lpwhh) - WININET_Release( lpwhh ); - return bSuccess; + return res; + } + } + + FIXME("Stub for %d\n", option); + return ERROR_INTERNET_INCORRECT_HANDLE_TYPE; } /*********************************************************************** @@ -2185,7 +2165,24 @@ static BOOL INET_QueryOptionHelper(BOOL bIsUnicode, HINTERNET hInternet, DWORD d BOOL WINAPI InternetQueryOptionW(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, LPDWORD lpdwBufferLength) { - return INET_QueryOptionHelper(TRUE, hInternet, dwOption, lpBuffer, lpdwBufferLength); + LPWININETHANDLEHEADER hdr; + DWORD res = ERROR_INVALID_HANDLE; + + TRACE("%p %d %p %p\n", hInternet, dwOption, lpBuffer, lpdwBufferLength); + + if(hInternet) { + hdr = WININET_GetObject(hInternet); + if (hdr) { + res = hdr->vtbl->QueryOption(hdr, dwOption, lpBuffer, lpdwBufferLength, TRUE); + WININET_Release(hdr); + } + }else { + res = INET_QueryOption(dwOption, lpBuffer, lpdwBufferLength, TRUE); + } + + if(res != ERROR_SUCCESS) + SetLastError(res); + return res == ERROR_SUCCESS; } /*********************************************************************** @@ -2201,7 +2198,24 @@ BOOL WINAPI InternetQueryOptionW(HINTERNET hInternet, DWORD dwOption, BOOL WINAPI InternetQueryOptionA(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, LPDWORD lpdwBufferLength) { - return INET_QueryOptionHelper(FALSE, hInternet, dwOption, lpBuffer, lpdwBufferLength); + LPWININETHANDLEHEADER hdr; + DWORD res = ERROR_INVALID_HANDLE; + + TRACE("%p %d %p %p\n", hInternet, dwOption, lpBuffer, lpdwBufferLength); + + if(hInternet) { + hdr = WININET_GetObject(hInternet); + if (hdr) { + res = hdr->vtbl->QueryOption(hdr, dwOption, lpBuffer, lpdwBufferLength, FALSE); + WININET_Release(hdr); + } + }else { + res = INET_QueryOption(dwOption, lpBuffer, lpdwBufferLength, FALSE); + } + + if(res != ERROR_SUCCESS) + SetLastError(res); + return res == ERROR_SUCCESS; } @@ -2254,44 +2268,44 @@ BOOL WINAPI InternetSetOptionW(HINTERNET hInternet, DWORD dwOption, break; case INTERNET_OPTION_ERROR_MASK: { - unsigned long flags=*(unsigned long*)lpBuffer; - FIXME("Option INTERNET_OPTION_ERROR_MASK(%ld): STUB\n",flags); + ULONG flags = *(ULONG *)lpBuffer; + FIXME("Option INTERNET_OPTION_ERROR_MASK(%d): STUB\n", flags); } break; case INTERNET_OPTION_CODEPAGE: { - unsigned long codepage=*(unsigned long*)lpBuffer; - FIXME("Option INTERNET_OPTION_CODEPAGE (%ld): STUB\n",codepage); + ULONG codepage = *(ULONG *)lpBuffer; + FIXME("Option INTERNET_OPTION_CODEPAGE (%d): STUB\n", codepage); } break; case INTERNET_OPTION_REQUEST_PRIORITY: { - unsigned long priority=*(unsigned long*)lpBuffer; - FIXME("Option INTERNET_OPTION_REQUEST_PRIORITY (%ld): STUB\n",priority); + ULONG priority = *(ULONG *)lpBuffer; + FIXME("Option INTERNET_OPTION_REQUEST_PRIORITY (%d): STUB\n", priority); } break; case INTERNET_OPTION_CONNECT_TIMEOUT: { - unsigned long connecttimeout=*(unsigned long*)lpBuffer; - FIXME("Option INTERNET_OPTION_CONNECT_TIMEOUT (%ld): STUB\n",connecttimeout); + ULONG connecttimeout = *(ULONG *)lpBuffer; + FIXME("Option INTERNET_OPTION_CONNECT_TIMEOUT (%d): STUB\n", connecttimeout); } break; case INTERNET_OPTION_DATA_RECEIVE_TIMEOUT: { - unsigned long receivetimeout=*(unsigned long*)lpBuffer; - FIXME("Option INTERNET_OPTION_DATA_RECEIVE_TIMEOUT (%ld): STUB\n",receivetimeout); + ULONG receivetimeout = *(ULONG *)lpBuffer; + FIXME("Option INTERNET_OPTION_DATA_RECEIVE_TIMEOUT (%d): STUB\n", receivetimeout); } break; case INTERNET_OPTION_MAX_CONNS_PER_SERVER: { - unsigned long conns=*(unsigned long*)lpBuffer; - FIXME("Option INTERNET_OPTION_MAX_CONNS_PER_SERVER (%ld): STUB\n",conns); + ULONG conns = *(ULONG *)lpBuffer; + FIXME("Option INTERNET_OPTION_MAX_CONNS_PER_SERVER (%d): STUB\n", conns); } break; case INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER: { - unsigned long conns=*(unsigned long*)lpBuffer; - FIXME("Option INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER (%ld): STUB\n",conns); + ULONG conns = *(ULONG *)lpBuffer; + FIXME("Option INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER (%d): STUB\n", conns); } break; case INTERNET_OPTION_RESET_URLCACHE_SESSION: @@ -2308,17 +2322,26 @@ BOOL WINAPI InternetSetOptionW(HINTERNET hInternet, DWORD dwOption, break; case INTERNET_OPTION_SEND_TIMEOUT: case INTERNET_OPTION_RECEIVE_TIMEOUT: - FIXME("INTERNET_OPTION_SEND/RECEIVE_TIMEOUT\n"); + { + ULONG timeout = *(ULONG *)lpBuffer; + FIXME("INTERNET_OPTION_SEND/RECEIVE_TIMEOUT %d\n", timeout); break; + } case INTERNET_OPTION_CONNECT_RETRIES: - FIXME("Option INTERNET_OPTION_CONNECT_RETRIES: STUB\n"); + { + ULONG retries = *(ULONG *)lpBuffer; + FIXME("INTERNET_OPTION_CONNECT_RETRIES %d\n", retries); break; + } case INTERNET_OPTION_CONTEXT_VALUE: FIXME("Option INTERNET_OPTION_CONTEXT_VALUE; STUB\n"); break; case INTERNET_OPTION_SECURITY_FLAGS: FIXME("Option INTERNET_OPTION_SECURITY_FLAGS; STUB\n"); break; + case INTERNET_OPTION_DISABLE_AUTODIAL: + FIXME("Option INTERNET_OPTION_DISABLE_AUTODIAL; STUB\n"); + break; case 86: FIXME("86\n"); break; @@ -2638,7 +2661,7 @@ BOOL WINAPI InternetCheckConnectionW( LPCWSTR lpszUrl, DWORD dwFlags, DWORD dwRe URL_COMPONENTSW components; ZeroMemory(&components,sizeof(URL_COMPONENTSW)); - components.lpszHostName = (LPWSTR)&hostW; + components.lpszHostName = (LPWSTR)hostW; components.dwHostNameLength = 1024; if (!InternetCrackUrlW(lpszUrl,0,0,&components)) @@ -3353,7 +3376,7 @@ static LPCWSTR INTERNET_GetSchemeString(INTERNET_SCHEME scheme) index = scheme - INTERNET_SCHEME_FIRST; if (index >= sizeof(url_schemes)/sizeof(url_schemes[0])) return NULL; - return (LPCWSTR)&url_schemes[index]; + return (LPCWSTR)url_schemes[index]; } /* we can calculate using ansi strings because we're just diff --git a/reactos/dll/win32/wininet/internet.h b/reactos/dll/win32/wininet/internet.h index 5d4d7e89b6b..2e7f642b32a 100644 --- a/reactos/dll/win32/wininet/internet.h +++ b/reactos/dll/win32/wininet/internet.h @@ -41,18 +41,6 @@ # include # include #endif -#ifdef HAVE_OPENSSL_SSL_H -#define DSA __ssl_DSA /* avoid conflict with commctrl.h */ -#undef FAR -/* avoid conflict with wincrypt.h */ -#undef PKCS7_SIGNER_INFO -#undef X509_NAME -#undef X509_CERT_PAIR -# include -#undef FAR -#define FAR do_not_use_this_in_wine -#undef DSA -#endif #ifdef HAVE_SYS_SOCKET_H # include #endif @@ -72,12 +60,10 @@ typedef struct { BOOL useSSL; int socketFD; -#ifdef HAVE_OPENSSL_SSL_H - SSL *ssl_s; + void *ssl_s; char *peek_msg; char *peek_msg_mem; size_t peek_len; -#endif } WININET_NETCONNECTION; static inline LPWSTR WININET_strdupW( LPCWSTR str ) @@ -364,6 +350,8 @@ LPWININETHANDLEHEADER WININET_AddRef( LPWININETHANDLEHEADER info ); BOOL WININET_Release( LPWININETHANDLEHEADER info ); BOOL WININET_FreeHandle( HINTERNET hinternet ); +DWORD INET_QueryOption(DWORD,void*,DWORD*,BOOL); + time_t ConvertTimeString(LPCWSTR asctime); HINTERNET FTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName, diff --git a/reactos/dll/win32/wininet/netconnection.c b/reactos/dll/win32/wininet/netconnection.c index 45dc40d025d..5d8b4d75534 100644 --- a/reactos/dll/win32/wininet/netconnection.c +++ b/reactos/dll/win32/wininet/netconnection.c @@ -23,6 +23,7 @@ #include "config.h" #include "wine/port.h" +#include #ifdef HAVE_POLL_H #include #endif @@ -42,6 +43,22 @@ #ifdef HAVE_SYS_IOCTL_H # include #endif +#include +#ifdef HAVE_NETDB_H +# include +#endif +#ifdef HAVE_NETINET_IN_H +# include +#endif +#ifdef HAVE_OPENSSL_SSL_H +# include +#undef FAR +#undef DSA +#endif +#ifdef HAVE_SYS_SOCKET_H +# include +#endif + #include #include #include diff --git a/reactos/dll/win32/wininet/rsrc.rc b/reactos/dll/win32/wininet/rsrc.rc index c160c476447..866159d813f 100644 --- a/reactos/dll/win32/wininet/rsrc.rc +++ b/reactos/dll/win32/wininet/rsrc.rc @@ -57,6 +57,7 @@ #include "wininet_No.rc" #include "wininet_Pl.rc" #include "wininet_Pt.rc" +#include "wininet_Ro.rc" #include "wininet_Ru.rc" #include "wininet_Si.rc" #include "wininet_Sv.rc" diff --git a/reactos/dll/win32/wininet/urlcache.c b/reactos/dll/win32/wininet/urlcache.c index 6e768933a07..75bcf342d3f 100644 --- a/reactos/dll/win32/wininet/urlcache.c +++ b/reactos/dll/win32/wininet/urlcache.c @@ -2339,7 +2339,7 @@ static BOOL WINAPI CommitUrlCacheEntryInternal( /* skip container path prefix */ lpszLocalFileName += lstrlenW(pContainer->path); - WideCharToMultiByte(CP_ACP, 0, lpszLocalFileName, -1, achFile, -1, NULL, NULL); + WideCharToMultiByte(CP_ACP, 0, lpszLocalFileName, -1, achFile, MAX_PATH, NULL, NULL); pchLocalFileName = achFile; for (cDirectory = 0; cDirectory < pHeader->DirectoryCount; cDirectory++) diff --git a/reactos/dll/win32/wininet/utility.c b/reactos/dll/win32/wininet/utility.c index 25972688a1e..b0d9c9c91c6 100644 --- a/reactos/dll/win32/wininet/utility.c +++ b/reactos/dll/win32/wininet/utility.c @@ -40,6 +40,16 @@ WINE_DEFAULT_DEBUG_CHANNEL(wininet); +/* critical section to protect non-reentrant gethostbyname() */ +static CRITICAL_SECTION cs_gethostbyname; +static CRITICAL_SECTION_DEBUG critsect_debug = +{ + 0, 0, &cs_gethostbyname, + { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": cs_gethostbyname") } +}; +static CRITICAL_SECTION cs_gethostbyname = { &critsect_debug, -1, 0, 0, 0, 0 }; + #define TIME_STRING_LEN 30 time_t ConvertTimeString(LPCWSTR asctime) @@ -151,12 +161,15 @@ BOOL GetAddress(LPCWSTR lpszServerName, INTERNET_PORT nServerPort, name = HeapAlloc(GetProcessHeap(), 0, sz+1); WideCharToMultiByte( CP_UNIXCP, 0, lpszServerName, len, name, sz, NULL, NULL ); name[sz] = 0; + + EnterCriticalSection( &cs_gethostbyname ); phe = gethostbyname(name); HeapFree( GetProcessHeap(), 0, name ); if (NULL == phe) { TRACE("Failed to get hostname: (%s)\n", debugstr_w(lpszServerName) ); + LeaveCriticalSection( &cs_gethostbyname ); return FALSE; } @@ -165,6 +178,7 @@ BOOL GetAddress(LPCWSTR lpszServerName, INTERNET_PORT nServerPort, psa->sin_family = phe->h_addrtype; psa->sin_port = htons(nServerPort); + LeaveCriticalSection( &cs_gethostbyname ); return TRUE; } diff --git a/reactos/dll/win32/wininet/wininet_Ro.rc b/reactos/dll/win32/wininet/wininet_Ro.rc new file mode 100644 index 00000000000..367bbb5955a --- /dev/null +++ b/reactos/dll/win32/wininet/wininet_Ro.rc @@ -0,0 +1,49 @@ +/* + * Copyright 2003 Mike McCormack for CodeWeavers + * Copyright 2008 Michael Stefaniuc + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +LANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL + +#pragma code_page(65001) + +IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Introducere parolДѓ de reИ›ea" +FONT 8, "MS Shell Dlg" +{ + LTEXT "IntroduceИ›i numele de utilizator И™i parola:", -1, 40, 6, 150, 15 + LTEXT "Proxy", -1, 40, 26, 50, 10 + LTEXT "Realm", -1, 40, 46, 50, 10 + LTEXT "Utilizator", -1, 40, 66, 50, 10 + LTEXT "ParolДѓ", -1, 40, 86, 50, 10 + LTEXT "" IDC_PROXY, 80, 26, 150, 14, 0 + LTEXT "" IDC_REALM, 80, 46, 150, 14, 0 + EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP + EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD + CHECKBOX "&SalveazДѓ aceastДѓ parolДѓ (nesigur)", IDC_SAVEPASSWORD, + 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON + PUSHBUTTON "RenunИ›Дѓ", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP +} + +STRINGTABLE DISCARDABLE +{ + IDS_LANCONNECTION "Conexiune LAN" +} + +#pragma code_page(default) diff --git a/reactos/dll/win32/wininet/wininet_ros.diff b/reactos/dll/win32/wininet/wininet_ros.diff index f83345b96fc..11b26d0c71a 100644 --- a/reactos/dll/win32/wininet/wininet_ros.diff +++ b/reactos/dll/win32/wininet/wininet_ros.diff @@ -9,28 +9,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(wininet); static const WCHAR g_szHttp1_0[] = {'H','T','T','P','/','1','.','0',0}; -@@ -1617,8 +1619,9 @@ - - if(req->lpszCacheFile) { - BOOL res; -+ DWORD dwBytesWritten; - -- res = WriteFile(req->hCacheFile, buffer, bytes_read, NULL, NULL); -+ res = WriteFile(req->hCacheFile, buffer, bytes_read, &dwBytesWritten, NULL); - if(!res) - WARN("WriteFile failed: %u\n", GetLastError()); - } -@@ -1686,7 +1689,9 @@ - - if (req->lpszCacheFile) - { -- if (!WriteFile(req->hCacheFile, p, bytes_read, NULL, NULL)) -+ DWORD dwBytesWritten; -+ -+ if (!WriteFile(req->hCacheFile, p, bytes_read, &dwBytesWritten, NULL)) - WARN("WriteFile failed: %u\n", GetLastError()); - } - p += bytes_read; --- D:/Wine-CVS/wine/dlls/wininet/internet.c Wed May 28 14:33:28 2008 +++ D:/ReactOS-Trunk/reactos/dll/win32/wininet/internet.c Fri May 30 18:04:29 2008 @@ -3101,19 +3101,22 @@ diff --git a/reactos/dll/win32/ws2_32/misc/ns.c b/reactos/dll/win32/ws2_32/misc/ns.c index 1db254dee9b..b95b2af53ee 100644 --- a/reactos/dll/win32/ws2_32/misc/ns.c +++ b/reactos/dll/win32/ws2_32/misc/ns.c @@ -1298,6 +1298,12 @@ inet_addr(IN CONST CHAR FAR* cp) p = (PCHAR)cp; + if (!p) + { + WSASetLastError(WSAEFAULT); + return INADDR_NONE; + } + if (strlen(p) == 0) return INADDR_NONE; diff --git a/reactos/drivers/bus/pci/fdo.c b/reactos/drivers/bus/pci/fdo.c index bb86808aa30..311b5862f37 100644 --- a/reactos/drivers/bus/pci/fdo.c +++ b/reactos/drivers/bus/pci/fdo.c @@ -206,7 +206,7 @@ FdoQueryBusRelations( Size = sizeof(DEVICE_RELATIONS) + sizeof(Relations->Objects) * (DeviceExtension->DeviceListCount - 1); - Relations = (PDEVICE_RELATIONS)ExAllocatePoolWithTag(PagedPool, Size, TAG_PCI); + Relations = (PDEVICE_RELATIONS)ExAllocatePool(PagedPool, Size); if (!Relations) return STATUS_INSUFFICIENT_RESOURCES; diff --git a/reactos/drivers/bus/pci/pdo.c b/reactos/drivers/bus/pci/pdo.c index ed278bd5b88..3dee4e54d3f 100644 --- a/reactos/drivers/bus/pci/pdo.c +++ b/reactos/drivers/bus/pci/pdo.c @@ -136,7 +136,7 @@ PdoQueryBusInformation( DeviceExtension = (PPDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; FdoDeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceExtension->Fdo->DeviceExtension; - BusInformation = ExAllocatePoolWithTag(PagedPool, sizeof(PNP_BUS_INFORMATION), TAG_PCI); + BusInformation = ExAllocatePool(PagedPool, sizeof(PNP_BUS_INFORMATION)); Irp->IoStatus.Information = (ULONG_PTR)BusInformation; if (BusInformation != NULL) { diff --git a/reactos/drivers/filesystems/cdfs/cdfs.h b/reactos/drivers/filesystems/cdfs/cdfs.h index a2a3e460da4..8f22905fd54 100644 --- a/reactos/drivers/filesystems/cdfs/cdfs.h +++ b/reactos/drivers/filesystems/cdfs/cdfs.h @@ -4,7 +4,6 @@ #include #include #include -#include #define CDFS_BASIC_SECTOR 2048 #define CDFS_PRIMARY_DESCRIPTOR_LOCATION 16 diff --git a/reactos/drivers/filesystems/cdfs/dirctl.c b/reactos/drivers/filesystems/cdfs/dirctl.c index 50be672295c..10381f549bd 100644 --- a/reactos/drivers/filesystems/cdfs/dirctl.c +++ b/reactos/drivers/filesystems/cdfs/dirctl.c @@ -189,7 +189,6 @@ CdfsFindFile(PDEVICE_EXTENSION DeviceExt, if (FileToFind == NULL || FileToFind->Length == 0) { - CHECKPOINT; RtlInitUnicodeString(&TempString, L"."); FileToFind = &TempString; } diff --git a/reactos/drivers/filesystems/ext2/src/fsctrl.c b/reactos/drivers/filesystems/ext2/src/fsctrl.c index 372c0c227c3..dfd545975a7 100644 --- a/reactos/drivers/filesystems/ext2/src/fsctrl.c +++ b/reactos/drivers/filesystems/ext2/src/fsctrl.c @@ -252,6 +252,14 @@ Ext2MountVolume ( Ext2PerformVerifyDiskRead ( TargetDeviceObject, BootSector, StartingOffset, NumberOfBytesToRead ); + // Reject a volume that contains fat artifacts + + DebugTrace(DEBUG_TRACE_MOUNT, "OEM[%s]", BootSector->Oem); + if (BootSector->Oem[0]) + { + try_return (STATUS_WRONG_VOLUME); + } + // Allocating memory for reading in Super Block... SuperBlock = Ext2AllocatePool( PagedPool, NumberOfBytesToRead ); diff --git a/reactos/drivers/filesystems/fastfat/create.c b/reactos/drivers/filesystems/fastfat/create.c index 6d2bf54fa3c..35f2194a4f6 100644 --- a/reactos/drivers/filesystems/fastfat/create.c +++ b/reactos/drivers/filesystems/fastfat/create.c @@ -204,7 +204,6 @@ FindFile ( PathNameBuffer = ExAllocatePoolWithTag(NonPagedPool, PathNameBufferLength + sizeof(WCHAR), TAG_VFAT); if (!PathNameBuffer) { - CHECKPOINT1; return STATUS_INSUFFICIENT_RESOURCES; } @@ -263,7 +262,6 @@ FindFile ( Status = RtlUpcaseUnicodeString(&FileToFindUpcase, FileToFindU, TRUE); if (!NT_SUCCESS(Status)) { - CHECKPOINT; ExFreePool(PathNameBuffer); return Status; } diff --git a/reactos/drivers/filesystems/fastfat/dir.c b/reactos/drivers/filesystems/fastfat/dir.c index 674ba56f4f3..e94546e6657 100644 --- a/reactos/drivers/filesystems/fastfat/dir.c +++ b/reactos/drivers/filesystems/fastfat/dir.c @@ -478,7 +478,6 @@ NTSTATUS VfatDirectoryControl (PVFAT_IRP_CONTEXT IrpContext) */ { NTSTATUS RC = STATUS_SUCCESS; - CHECKPOINT; IrpContext->Irp->IoStatus.Information = 0; switch (IrpContext->MinorFunction) { diff --git a/reactos/drivers/filesystems/fastfat/direntry.c b/reactos/drivers/filesystems/fastfat/direntry.c index 3dda26a5db0..c796b167131 100644 --- a/reactos/drivers/filesystems/fastfat/direntry.c +++ b/reactos/drivers/filesystems/fastfat/direntry.c @@ -205,7 +205,6 @@ NTSTATUS FATGetNextDirEntry(PVOID * pContext, if (FileOffset.u.LowPart >= pDirFcb->RFCB.FileSize.u.LowPart || !CcMapData(pDirFcb->FileObject, &FileOffset, PAGE_SIZE, TRUE, pContext, pPage)) { - CHECKPOINT; *pContext = NULL; return STATUS_NO_MORE_ENTRIES; } @@ -230,7 +229,6 @@ NTSTATUS FATGetNextDirEntry(PVOID * pContext, if (FileOffset.u.LowPart >= pDirFcb->RFCB.FileSize.u.LowPart || !CcMapData(pDirFcb->FileObject, &FileOffset, PAGE_SIZE, TRUE, pContext, pPage)) { - CHECKPOINT; *pContext = NULL; return STATUS_NO_MORE_ENTRIES; } @@ -328,7 +326,6 @@ NTSTATUS FATGetNextDirEntry(PVOID * pContext, if (FileOffset.u.LowPart >= pDirFcb->RFCB.FileSize.u.LowPart || !CcMapData(pDirFcb->FileObject, &FileOffset, PAGE_SIZE, TRUE, pContext, pPage)) { - CHECKPOINT; *pContext = NULL; return STATUS_NO_MORE_ENTRIES; } @@ -440,7 +437,6 @@ NTSTATUS FATXGetNextDirEntry(PVOID * pContext, if (FileOffset.u.LowPart >= pDirFcb->RFCB.FileSize.u.LowPart || !CcMapData(pDirFcb->FileObject, &FileOffset, PAGE_SIZE, TRUE, pContext, pPage)) { - CHECKPOINT; *pContext = NULL; return STATUS_NO_MORE_ENTRIES; } diff --git a/reactos/drivers/filesystems/fastfat/dirwr.c b/reactos/drivers/filesystems/fastfat/dirwr.c index baedfd5c7ce..df3fd658961 100644 --- a/reactos/drivers/filesystems/fastfat/dirwr.c +++ b/reactos/drivers/filesystems/fastfat/dirwr.c @@ -137,7 +137,6 @@ vfatFindDirSpace( if (*start + nbSlots > count) { LARGE_INTEGER AllocationSize; - CHECKPOINT; /* extend the directory */ if (vfatFCBIsRoot(pDirFcb) && DeviceExt->FatInfo.FatType != FAT32) { @@ -270,7 +269,6 @@ FATAddEntry( if (i == 100) /* FIXME : what to do after this ? */ { ExFreePoolWithTag(Buffer, TAG_VFAT); - CHECKPOINT; return STATUS_UNSUCCESSFUL; } IsNameLegal = RtlIsNameLegalDOS8Dot3(&DirContext.ShortNameU, &NameA, &SpacesFound); @@ -440,7 +438,6 @@ FATAddEntry( if (DirContext.StartIndex / i == DirContext.DirIndex / i) { /* one cluster */ - CHECKPOINT; CcPinRead(ParentFcb->FileObject, &FileOffset, nbSlots * sizeof(FAT_DIR_ENTRY), TRUE, &Context, (PVOID*)&pFatEntry); if (nbSlots > 1) @@ -452,7 +449,6 @@ FATAddEntry( else { /* two clusters */ - CHECKPOINT; size = DeviceExt->FatInfo.BytesPerCluster - (DirContext.StartIndex * sizeof(FAT_DIR_ENTRY)) % DeviceExt->FatInfo.BytesPerCluster; i = size / sizeof(FAT_DIR_ENTRY); @@ -533,7 +529,6 @@ FATXAddEntry( if (DirContext.LongNameU.Length / sizeof(WCHAR) > 42) { /* name too long */ - CHECKPOINT; return STATUS_NAME_TOO_LONG; } diff --git a/reactos/drivers/filesystems/fastfat/fat.c b/reactos/drivers/filesystems/fastfat/fat.c index 4f64508c4f8..c9fb49ea57d 100644 --- a/reactos/drivers/filesystems/fastfat/fat.c +++ b/reactos/drivers/filesystems/fastfat/fat.c @@ -653,7 +653,6 @@ GetNextClusterExtend(PDEVICE_EXTENSION DeviceExt, DeviceExt, CurrentCluster); ExAcquireResourceExclusiveLite(&DeviceExt->FatResource, TRUE); - CHECKPOINT; /* * If the file hasn't any clusters allocated then we need special * handling diff --git a/reactos/drivers/filesystems/fastfat/fcb.c b/reactos/drivers/filesystems/fastfat/fcb.c index 8ae22b8411d..d015966ee08 100644 --- a/reactos/drivers/filesystems/fastfat/fcb.c +++ b/reactos/drivers/filesystems/fastfat/fcb.c @@ -81,7 +81,7 @@ vfatInitFcb(PVFATFCB Fcb, PUNICODE_STRING NameU) { /* FIXME: what to do if no more memory? */ DPRINT1("Unable to initialize FCB for filename '%wZ'\n", NameU); - KEBUGCHECKEX(0, (ULONG_PTR)Fcb, (ULONG_PTR)NameU, 0, 0); + KeBugCheckEx(0, (ULONG_PTR)Fcb, (ULONG_PTR)NameU, 0, 0); } Fcb->PathNameU.Length = 0; @@ -300,14 +300,12 @@ vfatGrabFCBFromTable(PDEVICE_EXTENSION pVCB, PUNICODE_STRING PathNameU) if (RtlEqualUnicodeString(&FileNameU, FcbNameU, TRUE)) { rcFCB->RefCount++; - CHECKPOINT; return rcFCB; } } } entry = entry->next; } - CHECKPOINT; return NULL; } @@ -536,7 +534,6 @@ vfatAttachFCBToFileObject ( newCCB = ExAllocateFromNPagedLookasideList(&VfatGlobalData->CcbLookasideList); if (newCCB == NULL) { - CHECKPOINT; return STATUS_INSUFFICIENT_RESOURCES; } RtlZeroMemory (newCCB, sizeof (VFATCCB)); diff --git a/reactos/drivers/filesystems/fastfat/fsctl.c b/reactos/drivers/filesystems/fastfat/fsctl.c index fed155a672b..0ecb51fcc54 100644 --- a/reactos/drivers/filesystems/fastfat/fsctl.c +++ b/reactos/drivers/filesystems/fastfat/fsctl.c @@ -241,7 +241,6 @@ VfatHasFileSystem(PDEVICE_OBJECT DeviceToMount, if (PartitionInfoIsValid && FatInfo.Sectors > PartitionInfo.PartitionLength.QuadPart / FatInfo.BytesPerSector) { - CHECKPOINT1; *RecognizedFS = FALSE; } diff --git a/reactos/drivers/filesystems/fastfat/rw.c b/reactos/drivers/filesystems/fastfat/rw.c index 11ed87212ae..76518016118 100644 --- a/reactos/drivers/filesystems/fastfat/rw.c +++ b/reactos/drivers/filesystems/fastfat/rw.c @@ -69,7 +69,7 @@ OffsetToCluster(PDEVICE_EXTENSION DeviceExt, if (FirstCluster == 0) { DbgPrint("OffsetToCluster is called with FirstCluster = 0!\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (FirstCluster == 1) @@ -194,7 +194,6 @@ VfatReadFileData (PVFAT_IRP_CONTEXT IrpContext, if (FirstCluster == 1) { // Directory of FAT12/16 needs a special handling - CHECKPOINT; if (ReadOffset.u.LowPart + Length > DeviceExt->FatInfo.rootDirectorySectors * BytesPerSector) { Length = DeviceExt->FatInfo.rootDirectorySectors * BytesPerSector - ReadOffset.u.LowPart; @@ -233,7 +232,7 @@ VfatReadFileData (PVFAT_IRP_CONTEXT IrpContext, ROUND_DOWN(ReadOffset.u.LowPart, BytesPerCluster), &CorrectCluster, FALSE); if (CorrectCluster != CurrentCluster) - KEBUGCHECK(FAT_FILE_SYSTEM); + KeBugCheck(FAT_FILE_SYSTEM); } #endif } @@ -442,7 +441,7 @@ VfatWriteFileData(PVFAT_IRP_CONTEXT IrpContext, ROUND_DOWN(WriteOffset.u.LowPart, BytesPerCluster), &CorrectCluster, FALSE); if (CorrectCluster != CurrentCluster) - KEBUGCHECK(FAT_FILE_SYSTEM); + KeBugCheck(FAT_FILE_SYSTEM); } #endif } @@ -660,7 +659,6 @@ VfatRead(PVFAT_IRP_CONTEXT IrpContext) !(Fcb->Flags & (FCB_IS_PAGE_FILE|FCB_IS_VOLUME))) { // cached read - CHECKPOINT; Status = STATUS_SUCCESS; if (ByteOffset.u.LowPart + Length > Fcb->RFCB.FileSize.u.LowPart) { @@ -668,7 +666,6 @@ VfatRead(PVFAT_IRP_CONTEXT IrpContext) Status = /*STATUS_END_OF_FILE*/STATUS_SUCCESS; } - CHECKPOINT; if (IrpContext->FileObject->PrivateCacheMap == NULL) { CcInitializeCacheMap(IrpContext->FileObject, @@ -684,7 +681,6 @@ VfatRead(PVFAT_IRP_CONTEXT IrpContext) Status = IrpContext->Irp->IoStatus.Status;//STATUS_PENDING; goto ByeBye; } - CHECKPOINT; if (!NT_SUCCESS(IrpContext->Irp->IoStatus.Status)) { Status = IrpContext->Irp->IoStatus.Status; @@ -693,7 +689,6 @@ VfatRead(PVFAT_IRP_CONTEXT IrpContext) else { // non cached read - CHECKPOINT; if (ByteOffset.QuadPart + Length > ROUND_UP(Fcb->RFCB.FileSize.QuadPart, BytesPerSector)) { Length = (ULONG)(ROUND_UP(Fcb->RFCB.FileSize.QuadPart, BytesPerSector) - ByteOffset.QuadPart); @@ -951,7 +946,6 @@ NTSTATUS VfatWrite (PVFAT_IRP_CONTEXT IrpContext) IrpContext->DeviceExt, &AllocationSize); if (!NT_SUCCESS (Status)) { - CHECKPOINT; goto ByeBye; } } @@ -960,7 +954,6 @@ NTSTATUS VfatWrite (PVFAT_IRP_CONTEXT IrpContext) !(Fcb->Flags & (FCB_IS_PAGE_FILE|FCB_IS_VOLUME))) { // cached write - CHECKPOINT; if (IrpContext->FileObject->PrivateCacheMap == NULL) { @@ -984,12 +977,10 @@ NTSTATUS VfatWrite (PVFAT_IRP_CONTEXT IrpContext) { Status = STATUS_UNSUCCESSFUL; } - CHECKPOINT; } else { // non cached write - CHECKPOINT; if (ByteOffset.QuadPart > OldFileSize.QuadPart) { diff --git a/reactos/drivers/filesystems/fastfat/vfatfs.def b/reactos/drivers/filesystems/fastfat/vfatfs.def deleted file mode 100644 index 02fcc1c471b..00000000000 --- a/reactos/drivers/filesystems/fastfat/vfatfs.def +++ /dev/null @@ -1 +0,0 @@ -LIBRARY VFATFS.SYS diff --git a/reactos/drivers/filesystems/fastfat/volume.c b/reactos/drivers/filesystems/fastfat/volume.c index 89f2f66b735..4bf4ffeea40 100644 --- a/reactos/drivers/filesystems/fastfat/volume.c +++ b/reactos/drivers/filesystems/fastfat/volume.c @@ -179,7 +179,6 @@ FsdSetFsLabelInformation(PDEVICE_OBJECT DeviceObject, if (sizeof(DeviceObject->Vpb->VolumeLabel) < FsLabelInfo->VolumeLabelLength) { - CHECKPOINT; return STATUS_NAME_TOO_LONG; } diff --git a/reactos/drivers/filesystems/npfs/rw.c b/reactos/drivers/filesystems/npfs/rw.c index e5793b5bab2..f0e65f0f8bc 100644 --- a/reactos/drivers/filesystems/npfs/rw.c +++ b/reactos/drivers/filesystems/npfs/rw.c @@ -80,7 +80,7 @@ NpfsReadWriteCancelRoutine(IN PDEVICE_OBJECT DeviceObject, } break; default: - KEBUGCHECK(0); + ASSERT(FALSE); } ExReleaseFastMutex(&Ccb->DataListLock); KeUnlockMutex(&DeviceExt->PipeListLock); @@ -130,7 +130,7 @@ NpfsWaiterThread(PVOID InitContext) NpfsRead(IoStack->DeviceObject, Irp); break; default: - KEBUGCHECK(0); + ASSERT(FALSE); } } } @@ -148,7 +148,7 @@ NpfsWaiterThread(PVOID InitContext) ThreadContext->WaitBlockArray); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } KeLockMutex(&ThreadContext->DeviceExt->PipeListLock); Count = Status - STATUS_SUCCESS; @@ -185,7 +185,7 @@ NpfsWaiterThread(PVOID InitContext) } break; default: - KEBUGCHECK(0); + ASSERT(FALSE); } ExReleaseFastMutex(&Ccb->DataListLock); } @@ -357,7 +357,7 @@ NpfsRead(IN PDEVICE_OBJECT DeviceObject, NULL); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } ExAcquireFastMutex(&Ccb->DataListLock); } diff --git a/reactos/drivers/filesystems/ntfs/ntfs.h b/reactos/drivers/filesystems/ntfs/ntfs.h index 2a3cd315853..7080e801c14 100644 --- a/reactos/drivers/filesystems/ntfs/ntfs.h +++ b/reactos/drivers/filesystems/ntfs/ntfs.h @@ -4,7 +4,6 @@ #include #include #include -#include #define CACHEPAGESIZE(pDeviceExt) \ ((pDeviceExt)->NtfsInfo.UCHARsPerCluster > PAGE_SIZE ? \ diff --git a/reactos/drivers/input/i8042prt/pnp.c b/reactos/drivers/input/i8042prt/pnp.c index 81f440b3d4b..007689592e9 100644 --- a/reactos/drivers/input/i8042prt/pnp.c +++ b/reactos/drivers/input/i8042prt/pnp.c @@ -85,6 +85,7 @@ i8042BasicDetect( i8042Flush(DeviceExtension); + /* Issue a CTRL_SELF_TEST command to check if this is really an i8042 controller */ ResendIterations = DeviceExtension->Settings.ResendIterations + 1; while (ResendIterations--) { @@ -118,24 +119,6 @@ i8042BasicDetect( } } - /* - * We used to send a KBD_LINE_TEST (0xAB) command here, but on at least HP - * Pavilion notebooks the response to that command was incorrect. - * So now we just assume that a keyboard is attached. - */ - DeviceExtension->Flags |= KEYBOARD_PRESENT; - - if (i8042Write(DeviceExtension, DeviceExtension->ControlPort, MOUSE_LINE_TEST)) - { - Status = i8042ReadDataWait(DeviceExtension, &Value); - if (NT_SUCCESS(Status) && Value == 0) - DeviceExtension->Flags |= MOUSE_PRESENT; - } - - if (IsFirstStageSetup()) - /* Ignore the mouse */ - DeviceExtension->Flags &= ~MOUSE_PRESENT; - return STATUS_SUCCESS; } @@ -165,6 +148,13 @@ i8042DetectKeyboard( if (!i8042ChangeMode(DeviceExtension, 0, CCB_TRANSLATE | CCB_SYSTEM_FLAG)) return; + /* + * We used to send a KBD_LINE_TEST (0xAB) command, but on at least HP + * Pavilion notebooks the response to that command was incorrect. + * So now we just assume that a keyboard is attached. + */ + DeviceExtension->Flags |= KEYBOARD_PRESENT; + INFO_(I8042PRT, "Keyboard detected\n"); } @@ -177,6 +167,19 @@ i8042DetectMouse( UCHAR ExpectedReply[] = { MOUSE_ACK, 0xAA }; UCHAR ReplyByte; + /* First do a mouse line test */ + if (i8042Write(DeviceExtension, DeviceExtension->ControlPort, MOUSE_LINE_TEST)) + { + Status = i8042ReadDataWait(DeviceExtension, &Value); + + if (!NT_SUCCESS(Status) || Value != 0) + { + WARN_(I8042PRT, "Mouse line test failed\n"); + goto failure; + } + } + + /* Now reset the mouse */ i8042Flush(DeviceExtension); if(!i8042IsrWritePort(DeviceExtension, MOU_CMD_RESET, CTRL_WRITE_MOUSE)) @@ -240,6 +243,7 @@ i8042DetectMouse( goto failure; } + DeviceExtension->Flags |= MOUSE_PRESENT; INFO_(I8042PRT, "Mouse detected\n"); return; @@ -415,9 +419,14 @@ StartProcedure( } /* First detect the mouse and then the keyboard! - If we do it the other way round, some systems throw away settings like the keyboard translation, when detecting the mouse. */ - TRACE_(I8042PRT, "Detecting mouse\n"); - i8042DetectMouse(DeviceExtension); + If we do it the other way round, some systems throw away settings like the keyboard translation, when detecting the mouse. + + Don't detect the mouse if we're in 1st stage setup! */ + if(!IsFirstStageSetup()) + { + TRACE_(I8042PRT, "Detecting mouse\n"); + i8042DetectMouse(DeviceExtension); + } TRACE_(I8042PRT, "Detecting keyboard\n"); i8042DetectKeyboard(DeviceExtension); @@ -608,8 +617,8 @@ i8042PnpStartDevice( } default: { - ERR_(I8042PRT, "Unknown FDO type %u\n", DeviceExtension->Type); - ASSERT(FALSE); + WARN_(I8042PRT, "Unknown FDO type %u\n", DeviceExtension->Type); + ASSERT(!(PortDeviceExtension->Flags & KEYBOARD_CONNECTED) || !(PortDeviceExtension->Flags & MOUSE_CONNECTED)); Status = STATUS_INVALID_DEVICE_REQUEST; } } @@ -664,7 +673,7 @@ i8042Pnp( PDEVICE_RELATIONS DeviceRelations; TRACE_(I8042PRT, "IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations\n"); - DeviceRelations = ExAllocatePoolWithTag(PagedPool, sizeof(DEVICE_RELATIONS), I8042PRT_TAG); + DeviceRelations = ExAllocatePool(PagedPool, sizeof(DEVICE_RELATIONS)); if (DeviceRelations) { DeviceRelations->Count = 0; diff --git a/reactos/drivers/ksfilter/ks/events.c b/reactos/drivers/ksfilter/ks/events.c index c5a94731e4d..ab0334f3b40 100644 --- a/reactos/drivers/ksfilter/ks/events.c +++ b/reactos/drivers/ksfilter/ks/events.c @@ -95,7 +95,7 @@ KSDDKAPI VOID NTAPI KsFreeEventList( IN PFILE_OBJECT FileObject, IN OUT PLIST_ENTRY EventsList, - IN KSEVENTS_LOCKTYPE EVentsFlags, + IN KSEVENTS_LOCKTYPE EventsFlags, IN PVOID EventsLock) { UNIMPLEMENTED; diff --git a/reactos/drivers/ksfilter/ks/kcom.c b/reactos/drivers/ksfilter/ks/kcom.c index c041e60c1c8..d1d1d1d545e 100644 --- a/reactos/drivers/ksfilter/ks/kcom.c +++ b/reactos/drivers/ksfilter/ks/kcom.c @@ -1,51 +1,51 @@ -/* =============================================================== - Kernel-mode COM -*/ - -#include -#include -#include -#include -#include - - -/* http://msdn2.microsoft.com/en-us/library/ms809781.aspx */ -COMDDKAPI NTSTATUS NTAPI -KoCreateInstance( - IN REFCLSID ClassId, - IN IUnknown* UnkOuter OPTIONAL, - IN ULONG ClsContext, - IN REFIID InterfaceId, - OUT PVOID* Interface) -{ - /* If UnkOuter isn't NULL, it must be IUnknown - TODO: CHECK THIS PARAM */ - /* TODO: Check IRQL? */ - - DPRINT("KoCreateInstance called\n"); - - if ( ClsContext != CLSCTX_KERNEL_SERVER ) - { - DPRINT("FAILED: ClsContext must be CLSCTX_KERNEL_SERVER\n"); - return STATUS_INVALID_PARAMETER_3; - } - - /* - Find the desired interface and create an instance. - - But we also need to supply a - pointer which will be set to a list of available interfaces, to - IoGetDeviceInterfaces. - - We can then create a file based on this information and thus talk - to the appropriate device. - - Useful references: - http://www.freelists.org/archives/wdmaudiodev/01-2003/msg00023.html - - TODO - */ - - DPRINT("** FAKING SUCCESS **\n"); - - return STATUS_SUCCESS; -} +/* =============================================================== + Kernel-mode COM +*/ + +#include +#include +#include +#include +#include + + +/* http://msdn2.microsoft.com/en-us/library/ms809781.aspx */ +COMDDKAPI NTSTATUS NTAPI +KoCreateInstance( + IN REFCLSID ClassId, + IN IUnknown* UnkOuter OPTIONAL, + IN ULONG ClsContext, + IN REFIID InterfaceId, + OUT PVOID* Interface) +{ + /* If UnkOuter isn't NULL, it must be IUnknown - TODO: CHECK THIS PARAM */ + /* TODO: Check IRQL? */ + + DPRINT("KoCreateInstance called\n"); + + if ( ClsContext != CLSCTX_KERNEL_SERVER ) + { + DPRINT("FAILED: ClsContext must be CLSCTX_KERNEL_SERVER\n"); + return STATUS_INVALID_PARAMETER_3; + } + + /* + Find the desired interface and create an instance. + + But we also need to supply a + pointer which will be set to a list of available interfaces, to + IoGetDeviceInterfaces. + + We can then create a file based on this information and thus talk + to the appropriate device. + + Useful references: + http://www.freelists.org/archives/wdmaudiodev/01-2003/msg00023.html + + TODO + */ + + DPRINT("** FAKING SUCCESS **\n"); + + return STATUS_SUCCESS; +} diff --git a/reactos/drivers/ksfilter/ks/ks.def b/reactos/drivers/ksfilter/ks/ks.def deleted file mode 100644 index 5b76c945b38..00000000000 --- a/reactos/drivers/ksfilter/ks/ks.def +++ /dev/null @@ -1,115 +0,0 @@ -; -; Exports definition file for ks.sys -; - -EXPORTS -KsCreateAllocator@12 -KsCreateDefaultAllocator@4 -KsValidateAllocatorCreateRequest@8 -KsCreateDefaultAllocatorEx@24 -KsValidateAllocatorFramingEx@12 - -KsCreateClock@12 -KsCreateDefaultClock@8 -KsAllocateDefaultClock@4 -KsAllocateDefaultClockEx@28 -KsFreeDefaultClock@4 -KsValidateClockCreateRequest@8 -KsGetDefaultClockState@4 -KsSetDefaultClockState@8 -KsGetDefaultClockTime@4 -KsSetDefaultClockTime@12 - -KsMethodHandler@12 -KsMethodHandlerWithAllocator@20 -KsFastMethodHandler@32 - -KsPropertyHandler@12 -KsPropertyHandlerWithAllocator@20 -KsUnserializeObjectPropertiesFromRegistry@12 -KsFastPropertyHandler@32 - -KsGenerateEvent@4 -KsEnableEventWithAllocator@32 -KsGenerateDataEvent@12 -KsEnableEvent@24 -KsDiscardEvent@4 -KsDisableEvent@16 -KsFreeEventList@16 - -KsValidateTopologyNodeCreateRequest@12 -KsCreateTopologyNode@16 -KsTopologyPropertyHandler@16 - -KsCreatePin@16 -KsValidateConnectRequest@16 -KsPinPropertyHandler@20 -KsPinDataIntersection@24 - -KsHandleSizedListQuery@16 - -KsAcquireResetValue@8 -KsAddIrpToCancelableQueue@20 -KsAddObjectCreateItemToDeviceHeader@20 -KsAddObjectCreateItemToObjectHeader@20 -KsAllocateDeviceHeader@12 -KsAllocateExtraData@12 -KsAllocateObjectCreateItem@16 -KsAllocateObjectHeader@20 -KsCancelIo@8 -KsCancelRoutine@8 -KsDefaultDeviceIoCompletion@8 -KsDispatchFastIoDeviceControlFailure@36 -KsDispatchFastReadFailure@32 -; KsDispatchFastWriteFailure@32 -KsDispatchInvalidDeviceRequest@8 -KsDispatchIrp@8 -KsDispatchSpecificMethod@8 -KsDispatchSpecificProperty@8 -KsForwardAndCatchIrp@16 -KsForwardIrp@12 -KsFreeDeviceHeader@4 -KsFreeObjectHeader@4 -KsGetChildCreateParameter@8 -KsMoveIrpsOnCancelableQueue@28 -KsProbeStreamIrp@12 -KsQueryInformationFile@16 -KsQueryObjectAccessMask@4 -KsQueryObjectCreateItem@4 -KsReadFile@32 -KsReleaseIrpOnCancelableQueue@8 -KsRemoveIrpFromCancelableQueue@16 -KsRemoveSpecificIrpFromCancelableQueue@4 -KsSetInformationFile@16 -KsSetMajorFunctionHandler@8 -KsStreamIo@44 -KsWriteFile@32 - -KsRegisterWorker@8 -KsUnregisterWorker@4 -KsRegisterCountedWorker@12 -KsDecrementCountedWorker@4 -KsIncrementCountedWorker@4 -KsQueueWorkItem@8 - -KsCacheMedium@12 -KsDefaultDispatchPnp@8 -KsSetDevicePnpAndBaseObject@12 -KsDefaultDispatchPower@8 -KsSetPowerDispatch@12 -KsReferenceBusObject@4 -KsDereferenceBusObject@4 -KsFreeObjectCreateItem@8 -KsFreeObjectCreateItemsByContext@8 -KsLoadResource@24 -; KsNullDriverUnload@4 -KsPinDataIntersectionEx@32 -KsQueryDevicePnpObject@4 -KsRecalculateStackDepth@8 -KsSetTargetDeviceObject@8 -KsSetTargetState@8 -KsSynchronousIoControlDevice@32 -KsInitializeDriver@12 - -; Kernel COM -KoCreateInstance@20 diff --git a/reactos/drivers/ksfilter/ks/ks.rbuild b/reactos/drivers/ksfilter/ks/ks.rbuild index f91d0c497cd..4e9301005b3 100644 --- a/reactos/drivers/ksfilter/ks/ks.rbuild +++ b/reactos/drivers/ksfilter/ks/ks.rbuild @@ -4,7 +4,7 @@ . .. ../include - + ntoskrnl @@ -21,4 +21,5 @@ topology.c worker.c kcom.c + ks.spec diff --git a/reactos/drivers/ksfilter/ks/ks.spec b/reactos/drivers/ksfilter/ks/ks.spec new file mode 100644 index 00000000000..75ab3fd72cf --- /dev/null +++ b/reactos/drivers/ksfilter/ks/ks.spec @@ -0,0 +1,110 @@ +@ stdcall KsCreateAllocator(ptr ptr ptr) +@ stdcall KsCreateDefaultAllocator(ptr) +@ stdcall KsValidateAllocatorCreateRequest(ptr ptr) +@ stdcall KsCreateDefaultAllocatorEx(ptr ptr ptr ptr ptr ptr) +@ stdcall KsValidateAllocatorFramingEx(ptr long ptr) + +@ stdcall KsCreateClock(ptr ptr ptr) +@ stdcall KsCreateDefaultClock(ptr ptr) +@ stdcall KsAllocateDefaultClock(ptr) +@ stdcall KsAllocateDefaultClockEx(ptr ptr ptr ptr ptr ptr long) +@ stdcall KsFreeDefaultClock(ptr) +@ stdcall KsValidateClockCreateRequest(ptr ptr) +@ stdcall KsGetDefaultClockState(ptr) +@ stdcall KsSetDefaultClockState(ptr long) +@ stdcall KsGetDefaultClockTime(ptr) +@ stdcall KsSetDefaultClockTime(ptr long long) + +@ stdcall KsMethodHandler(ptr long ptr) +@ stdcall KsMethodHandlerWithAllocator(ptr long ptr ptr long) +@ stdcall KsFastMethodHandler(ptr ptr long ptr long ptr long ptr) + +@ stdcall KsPropertyHandler(ptr long ptr) +@ stdcall KsPropertyHandlerWithAllocator(ptr long ptr ptr long) +@ stdcall KsUnserializeObjectPropertiesFromRegistry(ptr ptr ptr) +@ stdcall KsFastPropertyHandler(ptr ptr long ptr long ptr long ptr) + +@ stdcall KsGenerateEvent(ptr) +@ stdcall KsEnableEventWithAllocator(ptr long ptr ptr long ptr ptr long) +@ stdcall KsGenerateDataEvent(ptr long ptr) +@ stdcall KsEnableEvent(ptr long ptr ptr long ptr) +@ stdcall KsDiscardEvent(ptr) +@ stdcall KsDisableEvent(ptr ptr long ptr) +@ stdcall KsFreeEventList(ptr ptr long ptr) + +@ stdcall KsValidateTopologyNodeCreateRequest(ptr ptr ptr) +@ stdcall KsCreateTopologyNode(ptr ptr long ptr) +@ stdcall KsTopologyPropertyHandler(ptr ptr ptr ptr) + +@ stdcall KsCreatePin(ptr ptr long ptr) +@ stdcall KsValidateConnectRequest(ptr long ptr ptr) +@ stdcall KsPinPropertyHandler(ptr ptr ptr long ptr) +@ stdcall KsPinDataIntersection(ptr ptr ptr long ptr ptr) + +@ stdcall KsHandleSizedListQuery(ptr long long ptr) + +@ stdcall KsAcquireResetValue(ptr ptr) +@ stdcall KsAddIrpToCancelableQueue(ptr ptr ptr long ptr) +@ stdcall KsAddObjectCreateItemToDeviceHeader(ptr ptr ptr wstr ptr) +@ stdcall KsAddObjectCreateItemToObjectHeader(ptr ptr ptr wstr ptr) +@ stdcall KsAllocateDeviceHeader(ptr long ptr) +@ stdcall KsAllocateExtraData(ptr long ptr) +@ stdcall KsAllocateObjectCreateItem(long ptr long ptr) +@ stdcall KsAllocateObjectHeader(ptr long ptr ptr ptr) +@ stdcall KsCancelIo(ptr ptr) +@ stdcall KsCancelRoutine(ptr ptr) +@ stdcall KsDefaultDeviceIoCompletion(ptr ptr) +@ stdcall KsDispatchFastIoDeviceControlFailure(ptr long ptr long ptr long long ptr ptr) +@ stdcall KsDispatchFastReadFailure(ptr ptr long long long ptr ptr ptr) +; KsDispatchFastWriteFailure@32 +@ stdcall KsDispatchInvalidDeviceRequest(ptr ptr) +@ stdcall KsDispatchIrp(ptr ptr) +@ stdcall KsDispatchSpecificMethod(ptr ptr) +@ stdcall KsDispatchSpecificProperty(ptr ptr) +@ stdcall KsForwardAndCatchIrp(ptr ptr ptr long) +@ stdcall KsForwardIrp(ptr ptr long) +@ stdcall KsFreeDeviceHeader(ptr) +@ stdcall KsFreeObjectHeader(ptr) +@ stdcall KsGetChildCreateParameter(ptr ptr) +@ stdcall KsMoveIrpsOnCancelableQueue(ptr ptr ptr ptr long ptr ptr) +@ stdcall KsProbeStreamIrp(ptr long long) +@ stdcall KsQueryInformationFile(ptr ptr long long) +@ stdcall KsQueryObjectAccessMask(ptr) +@ stdcall KsQueryObjectCreateItem(ptr) +@ stdcall KsReadFile(ptr ptr ptr ptr ptr long long long) +@ stdcall KsReleaseIrpOnCancelableQueue(ptr ptr) +@ stdcall KsRemoveIrpFromCancelableQueue(ptr ptr long long) +@ stdcall KsRemoveSpecificIrpFromCancelableQueue(ptr) +@ stdcall KsSetInformationFile(ptr ptr long long) +@ stdcall KsSetMajorFunctionHandler(ptr long) +@ stdcall KsStreamIo(ptr ptr ptr ptr ptr long ptr ptr long long long) +@ stdcall KsWriteFile(ptr ptr ptr ptr ptr long long long) + +@ stdcall KsRegisterWorker(long ptr) +@ stdcall KsUnregisterWorker(ptr) +@ stdcall KsRegisterCountedWorker(long ptr ptr) +@ stdcall KsDecrementCountedWorker(ptr) +@ stdcall KsIncrementCountedWorker(ptr) +@ stdcall KsQueueWorkItem(ptr ptr) + +@ stdcall KsCacheMedium(ptr ptr long) +@ stdcall KsDefaultDispatchPnp(ptr ptr) +@ stdcall KsSetDevicePnpAndBaseObject(ptr ptr ptr) +@ stdcall KsDefaultDispatchPower(ptr ptr) +@ stdcall KsSetPowerDispatch(ptr ptr ptr) +@ stdcall KsReferenceBusObject(ptr) +@ stdcall KsDereferenceBusObject(ptr) +@ stdcall KsFreeObjectCreateItem(ptr ptr) +@ stdcall KsFreeObjectCreateItemsByContext(ptr ptr) +@ stdcall KsLoadResource(ptr long ptr long ptr ptr) +; KsNullDriverUnload@4 +@ stdcall KsPinDataIntersectionEx(ptr ptr ptr long ptr long ptr ptr) +@ stdcall KsQueryDevicePnpObject(ptr) +@ stdcall KsRecalculateStackDepth(ptr long) +@ stdcall KsSetTargetDeviceObject(ptr ptr) +@ stdcall KsSetTargetState(ptr long) +@ stdcall KsSynchronousIoControlDevice(ptr long long ptr long ptr long ptr) +@ stdcall KsInitializeDriver(ptr ptr ptr) + +; Kernel COM +@ stdcall KoCreateInstance(ptr ptr long ptr ptr) diff --git a/reactos/drivers/ksfilter/ks/misc.c b/reactos/drivers/ksfilter/ks/misc.c index 288333349f1..a3075846fbd 100644 --- a/reactos/drivers/ksfilter/ks/misc.c +++ b/reactos/drivers/ksfilter/ks/misc.c @@ -223,9 +223,9 @@ KsSynchronousIoControlDevice( */ KSDDKAPI NTSTATUS NTAPI KsInitializeDriver( -IN PDRIVER_OBJECT DriverObject, -IN PUNICODE_STRING RegistryPath, -IN const KSDEVICE_DESCRIPTOR *Descriptor OPTIONAL + IN PDRIVER_OBJECT DriverObject, + IN PUNICODE_STRING RegistryPath, + IN const KSDEVICE_DESCRIPTOR *Descriptor OPTIONAL ) { UNIMPLEMENTED; diff --git a/reactos/drivers/multimedia/audio/sb16_nt4/sb16_nt4.def b/reactos/drivers/multimedia/audio/sb16_nt4/sb16_nt4.def deleted file mode 100644 index 32ef407d0a6..00000000000 --- a/reactos/drivers/multimedia/audio/sb16_nt4/sb16_nt4.def +++ /dev/null @@ -1,6 +0,0 @@ -; -; Exports definition file for sb16_ks.sys -; -EXPORTS -DriverEntry@8 - diff --git a/reactos/drivers/multimedia/audio/sb16_nt4/sb16_nt4.rbuild b/reactos/drivers/multimedia/audio/sb16_nt4/sb16_nt4.rbuild index dff053f7e4f..9874081382c 100644 --- a/reactos/drivers/multimedia/audio/sb16_nt4/sb16_nt4.rbuild +++ b/reactos/drivers/multimedia/audio/sb16_nt4/sb16_nt4.rbuild @@ -3,7 +3,6 @@ . .. - ntoskrnl hal main.c diff --git a/reactos/drivers/network/acd/rasacd.def b/reactos/drivers/network/acd/rasacd.def deleted file mode 100644 index 82868d1dd6f..00000000000 --- a/reactos/drivers/network/acd/rasacd.def +++ /dev/null @@ -1,8 +0,0 @@ -; RAS Automatic Connection Driver - ReactOS Operating System - -LIBRARY RASACD.SYS - -EXPORTS - - -; EOF diff --git a/reactos/drivers/network/acd/rasacd.rbuild b/reactos/drivers/network/acd/rasacd.rbuild index b6d2139c72f..499dbe776a5 100644 --- a/reactos/drivers/network/acd/rasacd.rbuild +++ b/reactos/drivers/network/acd/rasacd.rbuild @@ -1,7 +1,6 @@ - include ntoskrnl hal diff --git a/reactos/drivers/network/afd/afd/bind.c b/reactos/drivers/network/afd/afd/bind.c index 73bb6a617ab..4745b841b51 100644 --- a/reactos/drivers/network/afd/afd/bind.c +++ b/reactos/drivers/network/afd/afd/bind.c @@ -25,7 +25,7 @@ NTSTATUS WarmSocketForBind( PAFD_FCB FCB ) { } if( !FCB->LocalAddress ) { AFD_DbgPrint(MID_TRACE,("No local address\n")); - return STATUS_UNSUCCESSFUL; + return STATUS_INVALID_PARAMETER; } Status = TdiOpenAddressFile(&FCB->TdiDeviceName, @@ -53,6 +53,7 @@ AfdBindSocket(PDEVICE_OBJECT DeviceObject, PIRP Irp, return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, Irp, 0, NULL ); + if( FCB->LocalAddress ) ExFreePool( FCB->LocalAddress ); FCB->LocalAddress = TaCopyTransportAddress( &BindReq->Address ); if( FCB->LocalAddress ) @@ -70,6 +71,8 @@ AfdBindSocket(PDEVICE_OBJECT DeviceObject, PIRP Irp, TdiBuildConnectionInfo( &FCB->AddressFrom, FCB->LocalAddress ); + if( !FCB->AddressFrom ) return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, Irp, 0, NULL ); + AFD_DbgPrint(MID_TRACE,("Calling TdiReceiveDatagram\n")); Status = TdiReceiveDatagram diff --git a/reactos/drivers/network/afd/afd/connect.c b/reactos/drivers/network/afd/afd/connect.c index 77d9f0aa94a..8759aca017d 100644 --- a/reactos/drivers/network/afd/afd/connect.c +++ b/reactos/drivers/network/afd/afd/connect.c @@ -52,15 +52,17 @@ NTSTATUS MakeSocketIntoConnection( PAFD_FCB FCB ) { FCB->State = SOCKET_STATE_CONNECTED; Status = TdiReceive( &FCB->ReceiveIrp.InFlightRequest, - FCB->Connection.Object, - TDI_RECEIVE_NORMAL, - FCB->Recv.Window, - FCB->Recv.Size, - &FCB->ReceiveIrp.Iosb, - ReceiveComplete, - FCB ); + FCB->Connection.Object, + TDI_RECEIVE_NORMAL, + FCB->Recv.Window, + FCB->Recv.Size, + &FCB->ReceiveIrp.Iosb, + ReceiveComplete, + FCB ); - return Status; + if( Status == STATUS_PENDING ) Status = STATUS_SUCCESS; + + return Status; } static NTSTATUS NTAPI StreamSocketConnectComplete @@ -77,23 +79,23 @@ static NTSTATUS NTAPI StreamSocketConnectComplete /* I was wrong about this before as we can have pending writes to a not * yet connected socket */ - if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp ); + if( !SocketAcquireStateLock( FCB ) ) return STATUS_FILE_CLOSED; AFD_DbgPrint(MID_TRACE,("Irp->IoStatus.Status = %x\n", Irp->IoStatus.Status)); if( NT_SUCCESS(Irp->IoStatus.Status) ) { FCB->PollState |= AFD_EVENT_CONNECT | AFD_EVENT_SEND; - FCB->State = SOCKET_STATE_CONNECTED; AFD_DbgPrint(MID_TRACE,("Going to connected state %d\n", FCB->State)); - PollReeval( FCB->DeviceExt, FCB->FileObject ); + FCB->State = SOCKET_STATE_CONNECTED; } else { FCB->PollState |= AFD_EVENT_CONNECT_FAIL | AFD_EVENT_RECEIVE; AFD_DbgPrint(MID_TRACE,("Going to bound state\n")); FCB->State = SOCKET_STATE_BOUND; - PollReeval( FCB->DeviceExt, FCB->FileObject ); } + PollReeval( FCB->DeviceExt, FCB->FileObject ); + /* Succeed pending irps on the FUNCTION_CONNECT list */ while( !IsListEmpty( &FCB->PendingIrpList[FUNCTION_CONNECT] ) ) { NextIrpEntry = RemoveHeadList(&FCB->PendingIrpList[FUNCTION_CONNECT]); @@ -108,7 +110,10 @@ static NTSTATUS NTAPI StreamSocketConnectComplete if( NT_SUCCESS(Status) ) { Status = MakeSocketIntoConnection( FCB ); - if( !NT_SUCCESS(Status) ) return Status; + if( !NT_SUCCESS(Status) ) { + SocketStateUnlock( FCB ); + return Status; + } if( !IsListEmpty( &FCB->PendingIrpList[FUNCTION_SEND] ) ) { NextIrpEntry = RemoveHeadList(&FCB->PendingIrpList[FUNCTION_SEND]); @@ -166,6 +171,7 @@ AfdStreamSocketConnect(PDEVICE_OBJECT DeviceObject, PIRP Irp, return LeaveIrpUntilLater( FCB, Irp, FUNCTION_CONNECT ); case SOCKET_STATE_CREATED: + if( FCB->LocalAddress ) ExFreePool( FCB->LocalAddress ); FCB->LocalAddress = TaCopyTransportAddress( &ConnectReq->RemoteAddress ); @@ -193,9 +199,15 @@ AfdStreamSocketConnect(PDEVICE_OBJECT DeviceObject, PIRP Irp, /* Drop through to SOCKET_STATE_BOUND */ case SOCKET_STATE_BOUND: + if( FCB->RemoteAddress ) ExFreePool( FCB->RemoteAddress ); FCB->RemoteAddress = TaCopyTransportAddress( &ConnectReq->RemoteAddress ); + if( !FCB->RemoteAddress ) { + Status = STATUS_NO_MEMORY; + break; + } + if( FCB->Flags & AFD_ENDPOINT_CONNECTIONLESS ) { Status = STATUS_SUCCESS; diff --git a/reactos/drivers/network/afd/afd/context.c b/reactos/drivers/network/afd/afd/context.c index 18744884ed0..9796a1c8db5 100644 --- a/reactos/drivers/network/afd/afd/context.c +++ b/reactos/drivers/network/afd/afd/context.c @@ -39,27 +39,30 @@ AfdGetContext( PDEVICE_OBJECT DeviceObject, PIRP Irp, NTSTATUS STDCALL AfdSetContext( PDEVICE_OBJECT DeviceObject, PIRP Irp, PIO_STACK_LOCATION IrpSp ) { - NTSTATUS Status = STATUS_NO_MEMORY; + NTSTATUS Status = STATUS_BUFFER_TOO_SMALL; PFILE_OBJECT FileObject = IrpSp->FileObject; PAFD_FCB FCB = FileObject->FsContext; if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp ); + if( FCB->Context ) { + ExFreePool( FCB->Context ); + FCB->Context = NULL; + } + if( FCB->ContextSize < IrpSp->Parameters.DeviceIoControl.InputBufferLength ) { - if( FCB->Context ) - ExFreePool( FCB->Context ); FCB->Context = ExAllocatePool ( PagedPool, IrpSp->Parameters.DeviceIoControl.InputBufferLength ); - } - if( FCB->Context ) { - Status = STATUS_SUCCESS; + if( !FCB->Context ) return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, Irp, 0, NULL ); + RtlCopyMemory( FCB->Context, IrpSp->Parameters.DeviceIoControl.Type3InputBuffer, IrpSp->Parameters.DeviceIoControl.InputBufferLength ); + Status = STATUS_SUCCESS; } AFD_DbgPrint(MID_TRACE,("Returning %x\n", Status)); diff --git a/reactos/drivers/network/afd/afd/info.c b/reactos/drivers/network/afd/afd/info.c index 9a3ead68093..f2833af7b0d 100644 --- a/reactos/drivers/network/afd/afd/info.c +++ b/reactos/drivers/network/afd/afd/info.c @@ -24,12 +24,9 @@ AfdGetInfo( PDEVICE_OBJECT DeviceObject, PIRP Irp, AFD_DbgPrint(MID_TRACE,("Called %x %x\n", InfoReq, InfoReq ? InfoReq->InformationClass : 0)); - _SEH_TRY { - if( !SocketAcquireStateLock( FCB ) ) { - Status = LostSocket( Irp ); - _SEH_YIELD(return Status); - } + if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp ); + _SEH_TRY { switch( InfoReq->InformationClass ) { case AFD_INFO_RECEIVE_WINDOW_SIZE: InfoReq->Information.Ulong = FCB->Recv.Size; @@ -87,7 +84,7 @@ AfdGetSockOrPeerName( PDEVICE_OBJECT DeviceObject, PIRP Irp, if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp ); if( FCB->AddressFile.Object == NULL) { - return UnlockAndMaybeComplete( FCB, STATUS_UNSUCCESSFUL, Irp, 0, + return UnlockAndMaybeComplete( FCB, STATUS_INVALID_PARAMETER, Irp, 0, NULL ); } @@ -113,7 +110,7 @@ AfdGetSockOrPeerName( PDEVICE_OBJECT DeviceObject, PIRP Irp, TDI_QUERY_ADDRESS_INFO, Mdl ); } else { - if( !NT_SUCCESS + if( NT_SUCCESS ( Status = TdiBuildNullConnectionInfo ( &ConnInfo, FCB->LocalAddress->Address[0].AddressType ) ) ) { @@ -128,31 +125,39 @@ AfdGetSockOrPeerName( PDEVICE_OBJECT DeviceObject, PIRP Irp, } if( SysMdl ) { - MmBuildMdlForNonPagedPool( SysMdl ); - Status = TdiQueryInformation - ( FCB->AddressFile.Object, - TDI_QUERY_CONNECTION_INFO, - SysMdl ); + _SEH_TRY { + MmProbeAndLockPages( SysMdl, Irp->RequestorMode, IoModifyAccess ); + } _SEH_HANDLE { + AFD_DbgPrint(MIN_TRACE, ("MmProbeAndLockPages() failed.\n")); + Status = _SEH_GetExceptionCode(); + } _SEH_END; } else Status = STATUS_NO_MEMORY; if( NT_SUCCESS(Status) ) { - TransAddr = - (PTRANSPORT_ADDRESS)MmMapLockedPages - ( Mdl, IoModifyAccess ); + Status = TdiQueryInformation + ( FCB->Connection.Object, + TDI_QUERY_CONNECTION_INFO, + SysMdl ); } - if( TransAddr ) - RtlCopyMemory( TransAddr, ConnInfo->RemoteAddress, - TaLengthOfTransportAddress - ( ConnInfo->RemoteAddress ) ); + if( NT_SUCCESS(Status) ) { + TransAddr = + (PTRANSPORT_ADDRESS)MmGetSystemAddressForMdlSafe( Mdl, NormalPagePriority ); + + if( TransAddr ) + RtlCopyMemory( TransAddr, ConnInfo->RemoteAddress, + TaLengthOfTransportAddress + ( ConnInfo->RemoteAddress ) ); + else Status = STATUS_INSUFFICIENT_RESOURCES; + } if( ConnInfo ) ExFreePool( ConnInfo ); if( SysMdl ) IoFreeMdl( SysMdl ); + if( TransAddr ) MmUnmapLockedPages( TransAddr, Mdl ); + MmUnlockPages( Mdl ); + IoFreeMdl( Mdl ); } } - - /* MmUnlockPages( Mdl ); */ - /* IoFreeMdl( Mdl ); */ } else { Status = STATUS_INSUFFICIENT_RESOURCES; } diff --git a/reactos/drivers/network/afd/afd/listen.c b/reactos/drivers/network/afd/afd/listen.c index b26f0936119..061342cb774 100644 --- a/reactos/drivers/network/afd/afd/listen.c +++ b/reactos/drivers/network/afd/afd/listen.c @@ -17,6 +17,7 @@ static VOID SatisfyAccept( PAFD_DEVICE_EXTENSION DeviceExt, PFILE_OBJECT NewFileObject, PAFD_TDI_OBJECT_QELT Qelt ) { PAFD_FCB FCB = NewFileObject->FsContext; + NTSTATUS Status; if( !SocketAcquireStateLock( FCB ) ) { LostSocket( Irp ); @@ -26,21 +27,28 @@ static VOID SatisfyAccept( PAFD_DEVICE_EXTENSION DeviceExt, /* Transfer the connection to the new socket, launch the opening read */ AFD_DbgPrint(MID_TRACE,("Completing a real accept (FCB %x)\n", FCB)); - FCB->State = SOCKET_STATE_CONNECTED; FCB->Connection = Qelt->Object; + + if( FCB->RemoteAddress ) ExFreePool( FCB->RemoteAddress ); FCB->RemoteAddress = TaCopyTransportAddress( Qelt->ConnInfo->RemoteAddress ); + if( !FCB->RemoteAddress ) + Status = STATUS_NO_MEMORY; + else + Status = MakeSocketIntoConnection( FCB ); + + if( NT_SUCCESS(Status) ) { + FCB->PollState |= AFD_EVENT_SEND; + PollReeval( DeviceExt, NewFileObject ); + } + if( Irp->MdlAddress ) UnlockRequest( Irp, IoGetCurrentIrpStackLocation( Irp ) ); - + Irp->IoStatus.Information = 0; - Irp->IoStatus.Status = STATUS_SUCCESS; + Irp->IoStatus.Status = Status; IoCompleteRequest( Irp, IO_NETWORK_INCREMENT ); - MakeSocketIntoConnection( FCB ); - FCB->PollState |= AFD_EVENT_SEND; - PollReeval( DeviceExt, NewFileObject ); - SocketStateUnlock( FCB ); } @@ -61,6 +69,13 @@ static VOID SatisfyPreAccept( PIRP Irp, PAFD_TDI_OBJECT_QELT Qelt ) { IPAddr = (PTA_IP_ADDRESS)&ListenReceive->Address; + if( !IPAddr ) { + if( Irp->MdlAddress ) UnlockRequest( Irp, IoGetCurrentIrpStackLocation( Irp ) ); + Irp->IoStatus.Status = STATUS_NO_MEMORY; + Irp->IoStatus.Information = 0; + IoCompleteRequest( Irp, IO_NETWORK_INCREMENT ); + } + AFD_DbgPrint(MID_TRACE,("IPAddr->TAAddressCount %d\n", IPAddr->TAAddressCount)); AFD_DbgPrint(MID_TRACE,("IPAddr->Address[0].AddressType %d\n", @@ -83,17 +98,16 @@ static NTSTATUS NTAPI ListenComplete ( PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context ) { - NTSTATUS Status = STATUS_UNSUCCESSFUL; + NTSTATUS Status = STATUS_SUCCESS; PAFD_FCB FCB = (PAFD_FCB)Context; PAFD_TDI_OBJECT_QELT Qelt; - if ( Irp->Cancel ) { - /* FIXME: is this anything else we need to do? */ - FCB->ListenIrp.InFlightRequest = NULL; - return STATUS_SUCCESS; + if( Irp->Cancel ) { + if( FCB ) FCB->ListenIrp.InFlightRequest = NULL; + return STATUS_CANCELLED; } - if( !SocketAcquireStateLock( FCB ) ) return Status; + if( !SocketAcquireStateLock( FCB ) ) return STATUS_FILE_CLOSED; FCB->ListenIrp.InFlightRequest = NULL; @@ -108,8 +122,10 @@ static NTSTATUS NTAPI ListenComplete Qelt = ExAllocatePool( NonPagedPool, sizeof(*Qelt) ); if( !Qelt ) { + /* Is this correct? */ TdiCloseDevice( FCB->Connection.Handle, FCB->Connection.Object ); + Status = STATUS_NO_MEMORY; } else { UINT AddressType = FCB->LocalAddress->Address[0].AddressType; @@ -122,11 +138,12 @@ static NTSTATUS NTAPI ListenComplete ConnectionReturnInfo->RemoteAddress)); TdiBuildNullConnectionInfo( &Qelt->ConnInfo, AddressType ); - TaCopyTransportAddressInPlace - ( Qelt->ConnInfo->RemoteAddress, - FCB->ListenIrp.ConnectionReturnInfo->RemoteAddress ); - - InsertTailList( &FCB->PendingConnections, &Qelt->ListEntry ); + if( Qelt->ConnInfo ) { + TaCopyTransportAddressInPlace + ( Qelt->ConnInfo->RemoteAddress, + FCB->ListenIrp.ConnectionReturnInfo->RemoteAddress ); + InsertTailList( &FCB->PendingConnections, &Qelt->ListEntry ); + } else Status = STATUS_NO_MEMORY; } /* Satisfy a pre-accept request if one is available */ @@ -154,7 +171,7 @@ static NTSTATUS NTAPI ListenComplete SocketStateUnlock( FCB ); - return STATUS_SUCCESS; + return Status; } NTSTATUS AfdListenSocket(PDEVICE_OBJECT DeviceObject, PIRP Irp, @@ -173,7 +190,7 @@ NTSTATUS AfdListenSocket(PDEVICE_OBJECT DeviceObject, PIRP Irp, 0, NULL ); if( FCB->State != SOCKET_STATE_BOUND ) { - Status = STATUS_UNSUCCESSFUL; + Status = STATUS_INVALID_PARAMETER; AFD_DbgPrint(MID_TRACE,("Could not listen an unbound socket\n")); return UnlockAndMaybeComplete( FCB, Status, Irp, 0, NULL ); } @@ -188,8 +205,6 @@ NTSTATUS AfdListenSocket(PDEVICE_OBJECT DeviceObject, PIRP Irp, if( !NT_SUCCESS(Status) ) return UnlockAndMaybeComplete( FCB, Status, Irp, 0, NULL ); - FCB->State = SOCKET_STATE_LISTENING; - TdiBuildNullConnectionInfo ( &FCB->ListenIrp.ConnectionCallInfo, FCB->LocalAddress->Address[0].AddressType ); @@ -197,6 +212,11 @@ NTSTATUS AfdListenSocket(PDEVICE_OBJECT DeviceObject, PIRP Irp, ( &FCB->ListenIrp.ConnectionReturnInfo, FCB->LocalAddress->Address[0].AddressType ); + if( !FCB->ListenIrp.ConnectionReturnInfo || !FCB->ListenIrp.ConnectionCallInfo ) + return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, Irp, 0, NULL ); + + FCB->State = SOCKET_STATE_LISTENING; + Status = TdiListen( &FCB->ListenIrp.InFlightRequest, FCB->Connection.Object, &FCB->ListenIrp.ConnectionCallInfo, @@ -214,7 +234,6 @@ NTSTATUS AfdListenSocket(PDEVICE_OBJECT DeviceObject, PIRP Irp, NTSTATUS AfdWaitForListen( PDEVICE_OBJECT DeviceObject, PIRP Irp, PIO_STACK_LOCATION IrpSp ) { - NTSTATUS Status = STATUS_SUCCESS; PFILE_OBJECT FileObject = IrpSp->FileObject; PAFD_FCB FCB = FileObject->FsContext; @@ -237,7 +256,7 @@ NTSTATUS AfdWaitForListen( PDEVICE_OBJECT DeviceObject, PIRP Irp, PollReeval( FCB->DeviceExt, FCB->FileObject ); SocketStateUnlock( FCB ); - return Status; + return Irp->IoStatus.Status; } else { AFD_DbgPrint(MID_TRACE,("Holding\n")); @@ -272,6 +291,8 @@ NTSTATUS AfdAccept( PDEVICE_OBJECT DeviceObject, PIRP Irp, ( &FCB->ListenIrp.ConnectionReturnInfo, FCB->LocalAddress->Address[0].AddressType ); + if( !FCB->ListenIrp.ConnectionReturnInfo ) return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, Irp, 0, NULL ); + Status = TdiListen( &FCB->ListenIrp.InFlightRequest, FCB->Connection.Object, &FCB->ListenIrp.ConnectionCallInfo, @@ -306,6 +327,8 @@ NTSTATUS AfdAccept( PDEVICE_OBJECT DeviceObject, PIRP Irp, (PVOID *)&NewFileObject, NULL ); + if( !NT_SUCCESS(Status) ) UnlockAndMaybeComplete( FCB, Status, Irp, 0, NULL ); + ASSERT(NewFileObject != FileObject); ASSERT(NewFileObject->FsContext != FCB); @@ -318,14 +341,15 @@ NTSTATUS AfdAccept( PDEVICE_OBJECT DeviceObject, PIRP Irp, ExFreePool( PendingConnObj ); - if( IsListEmpty( &FCB->PendingConnections ) ) + if( IsListEmpty( &FCB->PendingConnections ) ) { FCB->PollState &= ~AFD_EVENT_ACCEPT; + PollReeval( FCB->DeviceExt, FCB->FileObject ); + } SocketStateUnlock( FCB ); - return Status; + return Irp->IoStatus.Status; } } - SocketStateUnlock( FCB ); - return STATUS_UNSUCCESSFUL; + return UnlockAndMaybeComplete( FCB, STATUS_UNSUCCESSFUL, Irp, 0, NULL ); } diff --git a/reactos/drivers/network/afd/afd/lock.c b/reactos/drivers/network/afd/afd/lock.c index da4a3e196c5..448239a8521 100644 --- a/reactos/drivers/network/afd/afd/lock.c +++ b/reactos/drivers/network/afd/afd/lock.c @@ -15,6 +15,8 @@ /* Lock a method_neither request so it'll be available from DISPATCH_LEVEL */ PVOID LockRequest( PIRP Irp, PIO_STACK_LOCATION IrpSp ) { + BOOLEAN LockFailed = FALSE; + Irp->MdlAddress = IoAllocateMdl( IrpSp->Parameters.DeviceIoControl.Type3InputBuffer, IrpSp->Parameters.DeviceIoControl.InputBufferLength, @@ -22,18 +24,39 @@ PVOID LockRequest( PIRP Irp, PIO_STACK_LOCATION IrpSp ) { FALSE, NULL ); if( Irp->MdlAddress ) { - MmProbeAndLockPages( Irp->MdlAddress, KernelMode, IoModifyAccess ); + _SEH_TRY { + MmProbeAndLockPages( Irp->MdlAddress, KernelMode, IoModifyAccess ); + } _SEH_HANDLE { + LockFailed = TRUE; + } _SEH_END; + + if( LockFailed ) { + IoFreeMdl( Irp->MdlAddress ); + Irp->MdlAddress = NULL; + return NULL; + } + IrpSp->Parameters.DeviceIoControl.Type3InputBuffer = - MmMapLockedPages( Irp->MdlAddress, KernelMode ); + MmGetSystemAddressForMdlSafe( Irp->MdlAddress, NormalPagePriority ); + + if( !IrpSp->Parameters.DeviceIoControl.Type3InputBuffer ) { + IoFreeMdl( Irp->MdlAddress ); + Irp->MdlAddress = NULL; + return NULL; + } + return IrpSp->Parameters.DeviceIoControl.Type3InputBuffer; } else return NULL; } VOID UnlockRequest( PIRP Irp, PIO_STACK_LOCATION IrpSp ) { - MmUnmapLockedPages( IrpSp->Parameters.DeviceIoControl.Type3InputBuffer, - Irp->MdlAddress ); - MmUnlockPages( Irp->MdlAddress ); - IoFreeMdl( Irp->MdlAddress ); + PVOID Buffer = MmGetSystemAddressForMdlSafe( Irp->MdlAddress, NormalPagePriority ); + if( IrpSp->Parameters.DeviceIoControl.Type3InputBuffer == Buffer || Buffer == NULL ) { + MmUnmapLockedPages( IrpSp->Parameters.DeviceIoControl.Type3InputBuffer, Irp->MdlAddress ); + MmUnlockPages( Irp->MdlAddress ); + IoFreeMdl( Irp->MdlAddress ); + } + Irp->MdlAddress = NULL; } @@ -50,6 +73,7 @@ PAFD_WSABUF LockBuffers( PAFD_WSABUF Buf, UINT Count, UINT Size = sizeof(AFD_WSABUF) * (Count + Lock); PAFD_WSABUF NewBuf = ExAllocatePool( PagedPool, Size * 2 ); PMDL NewMdl; + BOOLEAN LockFailed = FALSE; AFD_DbgPrint(MID_TRACE,("Called(%08x)\n", NewBuf)); @@ -95,10 +119,24 @@ PAFD_WSABUF LockBuffers( PAFD_WSABUF Buf, UINT Count, if( MapBuf[i].Mdl ) { AFD_DbgPrint(MID_TRACE,("Probe and lock pages\n")); - MmProbeAndLockPages( MapBuf[i].Mdl, KernelMode, - Write ? IoModifyAccess : IoReadAccess ); + _SEH_TRY { + MmProbeAndLockPages( MapBuf[i].Mdl, KernelMode, + Write ? IoModifyAccess : IoReadAccess ); + } _SEH_HANDLE { + LockFailed = TRUE; + } _SEH_END; AFD_DbgPrint(MID_TRACE,("MmProbeAndLock finished\n")); - } + + if( LockFailed ) { + IoFreeMdl( MapBuf[i].Mdl ); + MapBuf[i].Mdl = NULL; + ExFreePool( NewBuf ); + return NULL; + } + } else { + ExFreePool( NewBuf ); + return NULL; + } } } @@ -130,7 +168,7 @@ VOID UnlockBuffers( PAFD_WSABUF Buf, UINT Count, BOOL Address ) { * pointers. This will allow the system to do proper alerting */ PAFD_HANDLE LockHandles( PAFD_HANDLE HandleArray, UINT HandleCount ) { UINT i; - NTSTATUS Status; + NTSTATUS Status = STATUS_SUCCESS; PAFD_HANDLE FileObjects = ExAllocatePool ( NonPagedPool, HandleCount * sizeof(AFD_HANDLE) ); @@ -139,13 +177,21 @@ PAFD_HANDLE LockHandles( PAFD_HANDLE HandleArray, UINT HandleCount ) { HandleArray[i].Status = 0; HandleArray[i].Events = HandleArray[i].Events; FileObjects[i].Handle = 0; - Status = ObReferenceObjectByHandle - ( (PVOID)(ULONG_PTR)HandleArray[i].Handle, - FILE_ALL_ACCESS, - NULL, - KernelMode, - (PVOID*)&FileObjects[i].Handle, - NULL ); + if( !HandleArray[i].Handle ) continue; + if( NT_SUCCESS(Status) ) { + Status = ObReferenceObjectByHandle + ( (PVOID)(ULONG_PTR)HandleArray[i].Handle, + FILE_ALL_ACCESS, + NULL, + KernelMode, + (PVOID*)&FileObjects[i].Handle, + NULL ); + } + } + + if( !NT_SUCCESS(Status) ) { + UnlockHandles( FileObjects, HandleCount ); + return NULL; } return FileObjects; @@ -167,7 +213,7 @@ UINT SocketAcquireStateLock( PAFD_FCB FCB ) { NTSTATUS Status = STATUS_SUCCESS; PVOID CurrentThread = KeGetCurrentThread(); - ASSERT(KeGetCurrentIrql() == PASSIVE_LEVEL); + ASSERT(KeGetCurrentIrql() <= APC_LEVEL); AFD_DbgPrint(MAX_TRACE,("Called on %x, attempting to lock\n", FCB)); @@ -218,7 +264,7 @@ VOID SocketStateUnlock( PAFD_FCB FCB ) { PVOID CurrentThread = KeGetCurrentThread(); #endif ASSERT(FCB->LockCount > 0); - ASSERT(KeGetCurrentIrql() == PASSIVE_LEVEL); + ASSERT(KeGetCurrentIrql() <= APC_LEVEL); ExAcquireFastMutex( &FCB->Mutex ); FCB->LockCount--; @@ -262,7 +308,7 @@ NTSTATUS NTAPI UnlockAndMaybeComplete NTSTATUS LostSocket( PIRP Irp ) { - NTSTATUS Status = STATUS_INVALID_PARAMETER; + NTSTATUS Status = STATUS_FILE_CLOSED; AFD_DbgPrint(MIN_TRACE,("Called.\n")); Irp->IoStatus.Information = 0; Irp->IoStatus.Status = Status; diff --git a/reactos/drivers/network/afd/afd/main.c b/reactos/drivers/network/afd/afd/main.c index e1f41ae6f0e..af86fc376cd 100644 --- a/reactos/drivers/network/afd/afd/main.c +++ b/reactos/drivers/network/afd/afd/main.c @@ -190,9 +190,8 @@ VOID DestroySocket( PAFD_FCB FCB ) { if( InFlightRequest[i]->InFlightRequest ) { AFD_DbgPrint(MID_TRACE,("Cancelling in flight irp %d (%x)\n", i, InFlightRequest[i]->InFlightRequest)); - InFlightRequest[i]->InFlightRequest->IoStatus.Status = STATUS_CANCELLED; - InFlightRequest[i]->InFlightRequest->IoStatus.Information = 0; - IoCancelIrp( InFlightRequest[i]->InFlightRequest ); + IoCancelIrp(InFlightRequest[i]->InFlightRequest); + InFlightRequest[i]->InFlightRequest = NULL; } } @@ -210,8 +209,12 @@ VOID DestroySocket( PAFD_FCB FCB ) { ExFreePool( FCB->LocalAddress ); if( FCB->RemoteAddress ) ExFreePool( FCB->RemoteAddress ); - - ExFreePool(FCB->TdiDeviceName.Buffer); + if( FCB->ListenIrp.ConnectionReturnInfo ) + ExFreePool( FCB->ListenIrp.ConnectionReturnInfo ); + if( FCB->ListenIrp.ConnectionCallInfo ) + ExFreePool( FCB->ListenIrp.ConnectionCallInfo ); + if( FCB->TdiDeviceName.Buffer ) + ExFreePool(FCB->TdiDeviceName.Buffer); ExFreePool(FCB); AFD_DbgPrint(MIN_TRACE,("Deleted (%x)\n", FCB)); diff --git a/reactos/drivers/network/afd/afd/read.c b/reactos/drivers/network/afd/afd/read.c index 05f723ba9c2..65183288ca7 100644 --- a/reactos/drivers/network/afd/afd/read.c +++ b/reactos/drivers/network/afd/afd/read.c @@ -98,6 +98,7 @@ static NTSTATUS TryToSatisfyRecvRequestFromBuffer( PAFD_FCB FCB, if( FCB->Recv.BytesUsed == FCB->Recv.Content ) { FCB->Recv.BytesUsed = FCB->Recv.Content = 0; FCB->PollState &= ~AFD_EVENT_RECEIVE; + PollReeval( FCB->DeviceExt, FCB->FileObject ); if( !FCB->ReceiveIrp.InFlightRequest ) { AFD_DbgPrint(MID_TRACE,("Replenishing buffer\n")); @@ -233,6 +234,11 @@ NTSTATUS NTAPI ReceiveComplete ASSERT_IRQL(APC_LEVEL); + if( Irp->Cancel ) { + if( FCB ) FCB->ReceiveIrp.InFlightRequest = NULL; + return STATUS_CANCELLED; + } + if( !SocketAcquireStateLock( FCB ) ) return Status; FCB->ReceiveIrp.InFlightRequest = NULL; @@ -247,7 +253,7 @@ NTSTATUS NTAPI ReceiveComplete } else if( FCB->State == SOCKET_STATE_LISTENING ) { AFD_DbgPrint(MIN_TRACE,("!!! LISTENER GOT A RECEIVE COMPLETE !!!\n")); SocketStateUnlock( FCB ); - return STATUS_UNSUCCESSFUL; + return STATUS_INVALID_PARAMETER; } HandleEOFOnIrp( FCB, Irp->IoStatus.Status, Irp->IoStatus.Information ); @@ -280,7 +286,7 @@ AfdConnectedSocketReadData(PDEVICE_OBJECT DeviceObject, PIRP Irp, FCB->State != SOCKET_STATE_CONNECTING ) { AFD_DbgPrint(MID_TRACE,("Called recv on wrong kind of socket (s%x)\n", FCB->State)); - return UnlockAndMaybeComplete( FCB, STATUS_UNSUCCESSFUL, + return UnlockAndMaybeComplete( FCB, STATUS_INVALID_PARAMETER, Irp, 0, NULL ); } @@ -449,7 +455,12 @@ PacketSocketRecvComplete( AFD_DbgPrint(MID_TRACE,("Called on %x\n", FCB)); - if( !SocketAcquireStateLock( FCB ) ) return STATUS_UNSUCCESSFUL; + if( Irp->Cancel ) { + if( FCB ) FCB->ReceiveIrp.InFlightRequest = NULL; + return STATUS_CANCELLED; + } + + if( !SocketAcquireStateLock( FCB ) ) return STATUS_FILE_CLOSED; FCB->ReceiveIrp.InFlightRequest = NULL; @@ -470,12 +481,16 @@ PacketSocketRecvComplete( DatagramRecv->Address = TaCopyTransportAddress( FCB->AddressFrom->RemoteAddress ); - InsertTailList( &FCB->DatagramList, &DatagramRecv->ListEntry ); + if( !DatagramRecv->Address ) Status = STATUS_NO_MEMORY; + } else Status = STATUS_NO_MEMORY; if( !NT_SUCCESS( Status ) ) { + if( DatagramRecv ) ExFreePool( DatagramRecv ); SocketStateUnlock( FCB ); return Status; + } else { + InsertTailList( &FCB->DatagramList, &DatagramRecv->ListEntry ); } /* Satisfy as many requests as we can */ @@ -566,7 +581,7 @@ AfdPacketSocketReadData(PDEVICE_OBJECT DeviceObject, PIRP Irp, /* Check that the socket is bound */ if( FCB->State != SOCKET_STATE_BOUND ) return UnlockAndMaybeComplete - ( FCB, STATUS_UNSUCCESSFUL, Irp, 0, NULL ); + ( FCB, STATUS_INVALID_PARAMETER, Irp, 0, NULL ); if( !(RecvReq = LockRequest( Irp, IrpSp )) ) return UnlockAndMaybeComplete ( FCB, STATUS_NO_MEMORY, Irp, 0, NULL ); diff --git a/reactos/drivers/network/afd/afd/select.c b/reactos/drivers/network/afd/afd/select.c index 1888340cd3d..82788123cde 100644 --- a/reactos/drivers/network/afd/afd/select.c +++ b/reactos/drivers/network/afd/afd/select.c @@ -277,6 +277,10 @@ AfdEventSelect( PDEVICE_OBJECT DeviceObject, PIRP Irp, (PAFD_EVENT_SELECT_INFO)LockRequest( Irp, IrpSp ); PAFD_FCB FCB = FileObject->FsContext; + if( !SocketAcquireStateLock( FCB ) ) { + return LostSocket( Irp ); + } + if ( !EventSelectInfo ) { return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, Irp, 0, NULL ); @@ -285,10 +289,6 @@ AfdEventSelect( PDEVICE_OBJECT DeviceObject, PIRP Irp, EventSelectInfo->EventObject, EventSelectInfo->Events)); - if( !SocketAcquireStateLock( FCB ) ) { - return LostSocket( Irp ); - } - FCB->EventSelectTriggers = FCB->EventsFired = 0; if( FCB->EventSelect ) ObDereferenceObject( FCB->EventSelect ); FCB->EventSelect = NULL; @@ -325,15 +325,15 @@ AfdEnumEvents( PDEVICE_OBJECT DeviceObject, PIRP Irp, AFD_DbgPrint(MID_TRACE,("Called (FCB %x)\n", FCB)); + if( !SocketAcquireStateLock( FCB ) ) { + return LostSocket( Irp ); + } + if ( !EnumReq ) { return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, Irp, 0, NULL ); } - if( !SocketAcquireStateLock( FCB ) ) { - return LostSocket( Irp ); - } - EnumReq->PollEvents = FCB->PollState; RtlZeroMemory( EnumReq->EventStatus, sizeof(EnumReq->EventStatus) ); diff --git a/reactos/drivers/network/afd/afd/tdi.c b/reactos/drivers/network/afd/afd/tdi.c index a80452d2284..dbe74cee242 100644 --- a/reactos/drivers/network/afd/afd/tdi.c +++ b/reactos/drivers/network/afd/afd/tdi.c @@ -136,7 +136,8 @@ static NTSTATUS TdiOpenDevice( NULL); /* Handle information */ if (!NT_SUCCESS(Status)) { AFD_DbgPrint(MIN_TRACE, ("ObReferenceObjectByHandle() failed with status (0x%X).\n", Status)); - ZwClose(*Handle); + ZwClose(*Handle); + *Handle = NULL; } else { AFD_DbgPrint(MAX_TRACE, ("Got handle (0x%X) Object (0x%X)\n", *Handle, *Object)); @@ -608,7 +609,7 @@ NTSTATUS TdiQueryInformation( KeInitializeEvent(&Event, NotificationEvent, FALSE); - Irp = TdiBuildInternalDeviceControlIrp(IOCTL_TCP_QUERY_INFORMATION, /* Sub function */ + Irp = TdiBuildInternalDeviceControlIrp(TDI_QUERY_INFORMATION, /* Sub function */ DeviceObject, /* Device object */ ConnectionObject, /* File object */ &Event, /* Event */ diff --git a/reactos/drivers/network/afd/afd/tdiconn.c b/reactos/drivers/network/afd/afd/tdiconn.c index 392adc8c885..b574020a6aa 100644 --- a/reactos/drivers/network/afd/afd/tdiconn.c +++ b/reactos/drivers/network/afd/afd/tdiconn.c @@ -122,8 +122,10 @@ NTSTATUS TdiBuildNullConnectionInfo ExAllocatePool(NonPagedPool, sizeof(TDI_CONNECTION_INFORMATION) + TdiAddressSize); - if (!ConnInfo) - return STATUS_INSUFFICIENT_RESOURCES; + if (!ConnInfo) { + *ConnectionInfo = NULL; + return STATUS_INSUFFICIENT_RESOURCES; + } Status = TdiBuildNullConnectionInfoInPlace( ConnInfo, Type ); diff --git a/reactos/drivers/network/afd/afd/write.c b/reactos/drivers/network/afd/afd/write.c index c2341e66faf..a6bdd134427 100644 --- a/reactos/drivers/network/afd/afd/write.c +++ b/reactos/drivers/network/afd/afd/write.c @@ -40,6 +40,11 @@ static NTSTATUS NTAPI SendComplete ASSERT_IRQL(APC_LEVEL); + if( Irp->Cancel ) { + if( FCB ) FCB->SendIrp.InFlightRequest = NULL; + return STATUS_CANCELLED; + } + if( !SocketAcquireStateLock( FCB ) ) return Status; FCB->SendIrp.InFlightRequest = NULL; @@ -135,9 +140,10 @@ static NTSTATUS NTAPI SendComplete SocketCalloutLeave( FCB ); } else { FCB->PollState |= AFD_EVENT_SEND; - PollReeval( FCB->DeviceExt, FCB->FileObject ); } + PollReeval( FCB->DeviceExt, FCB->FileObject ); + if( TotalBytesCopied > 0 ) { UnlockBuffers( SendReq->BufferArray, SendReq->BufferCount, FALSE ); @@ -170,6 +176,11 @@ static NTSTATUS NTAPI PacketSocketSendComplete Irp->IoStatus.Status, Irp->IoStatus.Information)); + if( Irp->Cancel ) { + if( FCB ) FCB->SendIrp.InFlightRequest = NULL; + return STATUS_CANCELLED; + } + /* It's ok if the FCB already died */ if( !SocketAcquireStateLock( FCB ) ) return STATUS_SUCCESS; @@ -213,7 +224,7 @@ AfdConnectedSocketWriteData(PDEVICE_OBJECT DeviceObject, PIRP Irp, /* Check that the socket is bound */ if( FCB->State != SOCKET_STATE_BOUND ) - return UnlockAndMaybeComplete( FCB, STATUS_UNSUCCESSFUL, Irp, + return UnlockAndMaybeComplete( FCB, STATUS_INVALID_PARAMETER, Irp, 0, NULL ); if( !(SendReq = LockRequest( Irp, IrpSp )) ) @@ -264,22 +275,6 @@ AfdConnectedSocketWriteData(PDEVICE_OBJECT DeviceObject, PIRP Irp, return UnlockAndMaybeComplete ( FCB, STATUS_NO_MEMORY, Irp, TotalBytesCopied, NULL ); - AFD_DbgPrint(MID_TRACE,("Socket state %d\n", FCB->State)); - - if( FCB->State != SOCKET_STATE_CONNECTED ) { - if( SendReq->AfdFlags & AFD_IMMEDIATE ) { - AFD_DbgPrint(MID_TRACE,("Nonblocking\n")); - return UnlockAndMaybeComplete - ( FCB, STATUS_CANT_WAIT, Irp, 0, NULL ); - } else { - AFD_DbgPrint(MID_TRACE,("Queuing request\n")); - return LeaveIrpUntilLater( FCB, Irp, FUNCTION_SEND ); - } - } - - AFD_DbgPrint(MID_TRACE,("We already have %d bytes waiting.\n", - FCB->Send.BytesUsed)); - SendReq->BufferArray = LockBuffers( SendReq->BufferArray, SendReq->BufferCount, NULL, NULL, @@ -290,6 +285,20 @@ AfdConnectedSocketWriteData(PDEVICE_OBJECT DeviceObject, PIRP Irp, Irp, 0, NULL ); } + AFD_DbgPrint(MID_TRACE,("Socket state %d\n", FCB->State)); + + if( FCB->State != SOCKET_STATE_CONNECTED ) { + if( SendReq->AfdFlags & AFD_IMMEDIATE ) { + AFD_DbgPrint(MID_TRACE,("Nonblocking\n")); + UnlockBuffers( SendReq->BufferArray, SendReq->BufferCount, FALSE ); + return UnlockAndMaybeComplete + ( FCB, STATUS_CANT_WAIT, Irp, 0, NULL ); + } else { + AFD_DbgPrint(MID_TRACE,("Queuing request\n")); + return LeaveIrpUntilLater( FCB, Irp, FUNCTION_SEND ); + } + } + AFD_DbgPrint(MID_TRACE,("FCB->Send.BytesUsed = %d\n", FCB->Send.BytesUsed)); @@ -362,6 +371,7 @@ AfdConnectedSocketWriteData(PDEVICE_OBJECT DeviceObject, PIRP Irp, if( SendReq->AfdFlags & AFD_IMMEDIATE ) { AFD_DbgPrint(MID_TRACE,("Nonblocking\n")); + UnlockBuffers( SendReq->BufferArray, SendReq->BufferCount, FALSE ); return UnlockAndMaybeComplete ( FCB, STATUS_CANT_WAIT, Irp, 0, NULL ); } else { @@ -386,10 +396,12 @@ AfdPacketSocketWriteData(PDEVICE_OBJECT DeviceObject, PIRP Irp, FCB->EventsFired &= ~AFD_EVENT_SEND; FCB->PollState &= ~AFD_EVENT_SEND; + PollReeval( FCB->DeviceExt, FCB->FileObject ); + /* Check that the socket is bound */ if( FCB->State != SOCKET_STATE_BOUND ) return UnlockAndMaybeComplete - ( FCB, STATUS_UNSUCCESSFUL, Irp, 0, NULL ); + ( FCB, STATUS_INVALID_PARAMETER, Irp, 0, NULL ); if( !(SendReq = LockRequest( Irp, IrpSp )) ) return UnlockAndMaybeComplete ( FCB, STATUS_NO_MEMORY, Irp, 0, NULL ); diff --git a/reactos/drivers/network/dd/pcnet/pcnet.h b/reactos/drivers/network/dd/pcnet/pcnet.h index f455155e1bc..27e51f02d44 100644 --- a/reactos/drivers/network/dd/pcnet/pcnet.h +++ b/reactos/drivers/network/dd/pcnet/pcnet.h @@ -145,8 +145,12 @@ MiGetMediaState(PADAPTER Adapter); #define BREAKPOINT #endif +#ifndef TAG +#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24)) +#endif + /* memory pool tag */ -#define PCNET_TAG 0xbaadf00d +#define PCNET_TAG TAG('P', 'c', 'N', 't') #endif // _PCNET_H_ diff --git a/reactos/drivers/network/ndis/ndis/buffer.c b/reactos/drivers/network/ndis/ndis/buffer.c index 4ea78f4ab5b..a87d36d6660 100644 --- a/reactos/drivers/network/ndis/ndis/buffer.c +++ b/reactos/drivers/network/ndis/ndis/buffer.c @@ -408,6 +408,8 @@ NdisAllocatePacket( NDIS_DbgPrint(MAX_TRACE, ("Status (0x%X) Packet (0x%X) PoolHandle (0x%X).\n", Status, Packet, PoolHandle)); + *Packet = NULL; + if (Pool == NULL) { *Status = NDIS_STATUS_FAILURE; @@ -488,6 +490,8 @@ NdisAllocatePacketPoolEx( "NumberOfDescriptors (%d) ProtocolReservedLength (%d).\n", Status, PoolHandle, NumberOfDescriptors, ProtocolReservedLength)); + *PoolHandle = NULL; + if (NumberOfDescriptors > 0xffff) { *Status = NDIS_STATUS_RESOURCES; @@ -528,8 +532,9 @@ NdisAllocatePacketPoolEx( *Status = NDIS_STATUS_SUCCESS; *PoolHandle = (PNDIS_HANDLE)Pool; - } else + } else { *Status = NDIS_STATUS_RESOURCES; + } } } @@ -705,6 +710,7 @@ NdisDprAllocatePacket( * PoolHandle = Handle returned by NdisAllocatePacketPool */ { + *Status = NDIS_STATUS_FAILURE; } diff --git a/reactos/drivers/network/ndis/ndis/config.c b/reactos/drivers/network/ndis/ndis/config.c index 2199328e04d..61a2da0d04a 100644 --- a/reactos/drivers/network/ndis/ndis/config.c +++ b/reactos/drivers/network/ndis/ndis/config.c @@ -193,13 +193,14 @@ NdisOpenConfiguration( NDIS_DbgPrint(MAX_TRACE, ("Called\n")); + *ConfigurationHandle = NULL; + *Status = ZwDuplicateObject(NtCurrentProcess(), RootKeyHandle, NtCurrentProcess(), &KeyHandle, 0, 0, DUPLICATE_SAME_ACCESS); if(!NT_SUCCESS(*Status)) { NDIS_DbgPrint(MID_TRACE, ("Failed to open registry configuration for this miniport\n")); - *ConfigurationHandle = NULL; *Status = NDIS_STATUS_FAILURE; return; } @@ -743,7 +744,8 @@ NdisReadNetworkAddress( if(!MiniportResource) { NDIS_DbgPrint(MIN_TRACE,("Insufficient resources.\n")); - *Status = NDIS_STATUS_FAILURE; + ExFreePool(IntArray); + *Status = NDIS_STATUS_RESOURCES; return; } @@ -797,6 +799,8 @@ NdisOpenConfigurationKeyByIndex( NDIS_HANDLE RegKeyHandle; PMINIPORT_CONFIGURATION_CONTEXT ConfigurationContext; + *KeyHandle = NULL; + *Status = ZwEnumerateKey(ConfigurationHandle, Index, KeyBasicInformation, NULL, 0, &KeyInformationLength); if(*Status != STATUS_BUFFER_TOO_SMALL && *Status != STATUS_BUFFER_OVERFLOW && *Status != STATUS_SUCCESS) { @@ -885,6 +889,8 @@ NdisOpenConfigurationKeyByName( OBJECT_ATTRIBUTES KeyAttributes; NDIS_HANDLE RegKeyHandle; + *KeyHandle = NULL; + InitializeObjectAttributes(&KeyAttributes, KeyName, OBJ_CASE_INSENSITIVE, ConfigurationHandle, 0); *Status = ZwOpenKey(&RegKeyHandle, KEY_ALL_ACCESS, &KeyAttributes); diff --git a/reactos/drivers/network/ndis/ndis/efilter.c b/reactos/drivers/network/ndis/ndis/efilter.c index 8c72e8b65d0..90a59b99bb7 100644 --- a/reactos/drivers/network/ndis/ndis/efilter.c +++ b/reactos/drivers/network/ndis/ndis/efilter.c @@ -44,6 +44,7 @@ EthCreateFilter( *Filter = (PETH_FILTER)NewFilter; return TRUE; } + *Filter = NULL; return FALSE; } diff --git a/reactos/drivers/network/ndis/ndis/hardware.c b/reactos/drivers/network/ndis/ndis/hardware.c index f855b0410ca..022fef52daa 100644 --- a/reactos/drivers/network/ndis/ndis/hardware.c +++ b/reactos/drivers/network/ndis/ndis/hardware.c @@ -125,7 +125,7 @@ NdisMQueryAdapterResources( &MiniportBlock->AllocatedResources->List[0].PartialResourceList, ResourceListSize); *BufferSize = ResourceListSize; - *Status = STATUS_SUCCESS; + *Status = NDIS_STATUS_SUCCESS; } else { diff --git a/reactos/drivers/network/ndis/ndis/io.c b/reactos/drivers/network/ndis/ndis/io.c index 554be0fca3d..43bed6fa3ac 100644 --- a/reactos/drivers/network/ndis/ndis/io.c +++ b/reactos/drivers/network/ndis/ndis/io.c @@ -841,6 +841,8 @@ NdisMRegisterIoPortRange( PNDIS_MINIPORT_BLOCK Adapter = (PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle; ULONG AddressSpace = 1; /* FIXME The HAL handles this wrong atm */ + *PortOffset = 0; + NDIS_DbgPrint(MAX_TRACE, ("Called - InitialPort 0x%x, NumberOfPorts 0x%x\n", InitialPort, NumberOfPorts)); memset(&PortAddress, 0, sizeof(PortAddress)); @@ -878,7 +880,6 @@ NdisMRegisterIoPortRange( NDIS_DbgPrint(MAX_TRACE, ("calling MmMapIoSpace\n")); - *PortOffset = 0; *PortOffset = MmMapIoSpace(TranslatedAddress, NumberOfPorts, MmNonCached); NDIS_DbgPrint(MAX_TRACE, ("Returning 0x%x for port range\n", *PortOffset)); diff --git a/reactos/drivers/network/ndis/ndis/miniport.c b/reactos/drivers/network/ndis/ndis/miniport.c index de2fec6969d..5927af063b6 100644 --- a/reactos/drivers/network/ndis/ndis/miniport.c +++ b/reactos/drivers/network/ndis/ndis/miniport.c @@ -562,13 +562,6 @@ MiniQueryInformation( /* FIXME: Wait in pending case! */ - /* XXX is status_pending part of success macro? */ - if ((NT_SUCCESS(NdisStatus)) || (NdisStatus == NDIS_STATUS_PENDING)) - { - NDIS_DbgPrint(DEBUG_MINIPORT, ("Miniport returned status (0x%X).\n", NdisStatus)); - return NdisStatus; - } - return NdisStatus; } @@ -1017,6 +1010,7 @@ NdisInitializeWrapper( RegistryPath = ExAllocatePool(PagedPool, sizeof(UNICODE_STRING)); if(!RegistryPath) { + ExFreePool(Miniport); NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n")); return; } @@ -1028,6 +1022,8 @@ NdisInitializeWrapper( if(!RegistryBuffer) { NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n")); + ExFreePool(Miniport); + ExFreePool(RegistryPath); return; } @@ -1424,6 +1420,7 @@ NdisIPnPStartDevice( { NDIS_DbgPrint(MIN_TRACE, ("MiniportInitialize() failed for an adapter.\n")); ExInterlockedRemoveEntryList( &Adapter->ListEntry, &AdapterListLock ); + if (NdisStatus == NDIS_STATUS_SUCCESS) NdisStatus = NDIS_STATUS_FAILURE; return (NTSTATUS)NdisStatus; } @@ -1466,6 +1463,7 @@ NdisIPnPStartDevice( Adapter->LookaheadBuffer = NULL; } ExInterlockedRemoveEntryList( &Adapter->ListEntry, &AdapterListLock ); + if (NdisStatus == NDIS_STATUS_SUCCESS) NdisStatus = NDIS_STATUS_FAILURE; return (NTSTATUS)NdisStatus; } @@ -1625,7 +1623,7 @@ NdisIAddDevice( Status = IoGetDeviceProperty(PhysicalDeviceObject, DevicePropertyDriverKeyName, 0, NULL, &DriverKeyLength); - if (Status != STATUS_BUFFER_TOO_SMALL) + if (Status != STATUS_BUFFER_TOO_SMALL && Status != STATUS_BUFFER_OVERFLOW) { NDIS_DbgPrint(DEBUG_MINIPORT, ("Can't get miniport driver key length.\n")); return Status; diff --git a/reactos/drivers/network/ndis/ndis/protocol.c b/reactos/drivers/network/ndis/ndis/protocol.c index 3fa7c3922c1..59ad6f2b454 100644 --- a/reactos/drivers/network/ndis/ndis/protocol.c +++ b/reactos/drivers/network/ndis/ndis/protocol.c @@ -674,6 +674,8 @@ NdisRegisterProtocol( NDIS_DbgPrint(MAX_TRACE, ("Called.\n")); + *NdisProtocolHandle = NULL; + /* first validate the PROTOCOL_CHARACTERISTICS */ switch (ProtocolCharacteristics->MajorNdisVersion) { diff --git a/reactos/drivers/network/tcpip/tcpip/dispatch.c b/reactos/drivers/network/tcpip/tcpip/dispatch.c index 94232ca7b1b..2b14914b82a 100644 --- a/reactos/drivers/network/tcpip/tcpip/dispatch.c +++ b/reactos/drivers/network/tcpip/tcpip/dispatch.c @@ -53,34 +53,6 @@ NTSTATUS DispPrepareIrpForCancel( return IRPFinish(Irp, STATUS_CANCELLED); } - -VOID DispCancelComplete( - PVOID Context) -/* - * FUNCTION: Completes a cancel request - * ARGUMENTS: - * Context = Pointer to context information (FILE_OBJECT) - */ -{ - /*KIRQL OldIrql;*/ - PFILE_OBJECT FileObject; - PTRANSPORT_CONTEXT TranContext; - - TI_DbgPrint(DEBUG_IRP, ("Called.\n")); - - FileObject = (PFILE_OBJECT)Context; - TranContext = (PTRANSPORT_CONTEXT)FileObject->FsContext; - - /* Set the cleanup event */ - KeSetEvent(&TranContext->CleanupEvent, 0, FALSE); - - /* We are expected to release the cancel spin lock */ - /*IoReleaseCancelSpinLock(OldIrql);*/ - - TI_DbgPrint(DEBUG_IRP, ("Leaving.\n")); -} - - VOID DispDataRequestComplete( PVOID Context, NTSTATUS Status, @@ -155,8 +127,6 @@ VOID DispDoDisconnect( PVOID Data ) { TI_DbgPrint(DEBUG_IRP, ("PostCancel: DoDisconnect done\n")); DispDataRequestComplete(DisType->Irp, STATUS_CANCELLED, 0); - - DispCancelComplete(DisType->FileObject); } VOID NTAPI DispCancelRequest( @@ -209,15 +179,15 @@ VOID NTAPI DispCancelRequest( if( !ChewCreate( &WorkItem, sizeof(DISCONNECT_TYPE), DispDoDisconnect, &DisType ) ) ASSERT(0); - break; + + IoReleaseCancelSpinLock(Irp->CancelIrql); + return; case TDI_SEND_DATAGRAM: if (FileObject->FsContext2 != (PVOID)TDI_TRANSPORT_ADDRESS_FILE) { TI_DbgPrint(MIN_TRACE, ("TDI_SEND_DATAGRAM, but no address file.\n")); break; } - - /*DGCancelSendRequest(TranContext->Handle.AddressHandle, Irp);*/ break; case TDI_RECEIVE_DATAGRAM: @@ -226,7 +196,7 @@ VOID NTAPI DispCancelRequest( break; } - /*DGCancelReceiveRequest(TranContext->Handle.AddressHandle, Irp);*/ + DGRemoveIRP(TranContext->Handle.AddressHandle, Irp); break; default: @@ -235,6 +205,7 @@ VOID NTAPI DispCancelRequest( } IoReleaseCancelSpinLock(Irp->CancelIrql); + IoCompleteRequest(Irp, IO_NO_INCREMENT); TI_DbgPrint(MAX_TRACE, ("Leaving.\n")); } @@ -280,8 +251,6 @@ VOID NTAPI DispCancelListenRequest( DispDataRequestComplete(Irp, STATUS_CANCELLED, 0); - DispCancelComplete(FileObject); - TI_DbgPrint(MAX_TRACE, ("Leaving.\n")); } diff --git a/reactos/drivers/network/tcpip/tcpip/irp.c b/reactos/drivers/network/tcpip/tcpip/irp.c index 0ba3bfb5ab5..da0e95e890c 100644 --- a/reactos/drivers/network/tcpip/tcpip/irp.c +++ b/reactos/drivers/network/tcpip/tcpip/irp.c @@ -27,14 +27,14 @@ NTSTATUS IRPFinish( PIRP Irp, NTSTATUS Status ) { UntrackFL( __FILE__, __LINE__, Irp ); #endif - (void)IoSetCancelRoutine( Irp, NULL ); + Irp->IoStatus.Status = Status; if( Status == STATUS_PENDING ) IoMarkIrpPending( Irp ); else { - Irp->IoStatus.Status = Status; Irql = KeGetCurrentIrql(); + (void)IoSetCancelRoutine( Irp, NULL ); IoCompleteRequest( Irp, IO_NETWORK_INCREMENT ); if (KeGetCurrentIrql() != Irql) { DbgPrint("WARNING: IO COMPLETION RETURNED AT WRONG IRQL:\n"); diff --git a/reactos/drivers/network/tcpip/tcpip/main.c b/reactos/drivers/network/tcpip/tcpip/main.c index 19c5a67a681..a7ef85812df 100644 --- a/reactos/drivers/network/tcpip/tcpip/main.c +++ b/reactos/drivers/network/tcpip/tcpip/main.c @@ -138,7 +138,6 @@ CP } CP Context->CancelIrps = FALSE; - KeInitializeEvent(&Context->CleanupEvent, NotificationEvent, FALSE); CP IrpSp = IoGetCurrentIrpStackLocation(Irp); IrpSp->FileObject->FsContext = Context; @@ -253,36 +252,6 @@ CP return Status; } - -VOID TiCleanupFileObjectComplete( - PVOID Context, - NTSTATUS Status) -/* - * FUNCTION: Completes an object cleanup IRP I/O request - * ARGUMENTS: - * Context = Pointer to the IRP for this request - * Status = Final status of the operation - */ -{ - PIRP Irp; - PIO_STACK_LOCATION IrpSp; - PTRANSPORT_CONTEXT TranContext; - KIRQL OldIrql; - - Irp = (PIRP)Context; - IrpSp = IoGetCurrentIrpStackLocation(Irp); - TranContext = (PTRANSPORT_CONTEXT)IrpSp->FileObject->FsContext; - - Irp->IoStatus.Status = Status; - - IoAcquireCancelSpinLock(&OldIrql); - - KeSetEvent(&TranContext->CleanupEvent, 0, FALSE); - - IoReleaseCancelSpinLock(OldIrql); -} - - /* * FUNCTION: Releases resources used by a file object * ARGUMENTS: @@ -313,13 +282,9 @@ NTSTATUS TiCleanupFileObject( IoAcquireCancelSpinLock(&OldIrql); Context->CancelIrps = TRUE; - KeResetEvent(&Context->CleanupEvent); IoReleaseCancelSpinLock(OldIrql); - Request.RequestNotifyObject = TiCleanupFileObjectComplete; - Request.RequestContext = Irp; - switch ((ULONG_PTR)IrpSp->FileObject->FsContext2) { case TDI_TRANSPORT_ADDRESS_FILE: Request.Handle.AddressHandle = Context->Handle.AddressHandle; @@ -345,19 +310,8 @@ NTSTATUS TiCleanupFileObject( Context->CancelIrps = FALSE; IoReleaseCancelSpinLock(OldIrql); - Irp->IoStatus.Status = STATUS_INVALID_PARAMETER; + Status = STATUS_INVALID_PARAMETER; - return Irp->IoStatus.Status; - } - - if (Status != STATUS_PENDING) - { - IoAcquireCancelSpinLock(&OldIrql); - KeSetEvent(&Context->CleanupEvent, 0, FALSE); - IoReleaseCancelSpinLock(OldIrql); - - KeWaitForSingleObject(&Context->CleanupEvent, - UserRequest, KernelMode, FALSE, NULL); } Irp->IoStatus.Status = Status; diff --git a/reactos/drivers/network/tcpip/tcpip/ninfo.c b/reactos/drivers/network/tcpip/tcpip/ninfo.c index c32822447fb..f39b35b5929 100644 --- a/reactos/drivers/network/tcpip/tcpip/ninfo.c +++ b/reactos/drivers/network/tcpip/tcpip/ninfo.c @@ -27,6 +27,9 @@ TDI_STATUS InfoTdiQueryGetAddrTable( PNDIS_BUFFER Buffer, TI_DbgPrint(DEBUG_INFO, ("Called.\n")); + if (!IpAddress) + return TDI_NO_RESOURCES; + TcpipAcquireSpinLock(&InterfaceListLock, &OldIrql); ForEachInterface(CurrentIF) { @@ -80,7 +83,7 @@ TDI_STATUS InfoTdiQueryGetRouteTable( PNDIS_BUFFER Buffer, PUINT BufferSize ) { if( !RCache || !RouteEntries ) { if( RCache ) ExFreePool( RCache ); if( RouteEntries ) ExFreePool( RouteEntries ); - return STATUS_NO_MEMORY; + return TDI_NO_RESOURCES; } RtlZeroMemory( RouteEntries, Size ); diff --git a/reactos/drivers/setup/blue/blue.c b/reactos/drivers/setup/blue/blue.c index a343e9c3b6e..7e4f6e8984e 100644 --- a/reactos/drivers/setup/blue/blue.c +++ b/reactos/drivers/setup/blue/blue.c @@ -627,7 +627,6 @@ ScrIoControl(PDEVICE_OBJECT DeviceObject, offset = (Buf->dwCoord.Y * DeviceExtension->Columns * 2) + (Buf->dwCoord.X * 2); - CHECKPOINT for (dwCount = 0; dwCount < Buf->nLength; dwCount++) { diff --git a/reactos/drivers/storage/class/ramdisk/ramdisk.c b/reactos/drivers/storage/class/ramdisk/ramdisk.c index 0a15a6c1bb3..59f3d24ff43 100644 --- a/reactos/drivers/storage/class/ramdisk/ramdisk.c +++ b/reactos/drivers/storage/class/ramdisk/ramdisk.c @@ -2284,7 +2284,7 @@ RamdiskAddDevice(IN PDRIVER_OBJECT DriverObject, // // Are we being booted from setup? Not yet supported // - ASSERT (!KeLoaderBlock->SetupLdrBlock); + //ASSERT(!KeLoaderBlock->SetupLdrBlock); } // @@ -2308,6 +2308,7 @@ DriverEntry(IN PDRIVER_OBJECT DriverObject, PCHAR BootDeviceName, CommandLine; PDEVICE_OBJECT PhysicalDeviceObject = NULL; NTSTATUS Status; + DPRINT1("RAM Disk Driver Initialized\n"); // // Query ramdisk parameters @@ -2399,7 +2400,7 @@ DriverEntry(IN PDRIVER_OBJECT DriverObject, // // Installing from Ramdisk isn't supported yet // - ASSERT(!KeLoaderBlock->SetupLdrBlock); + //ASSERT(!KeLoaderBlock->SetupLdrBlock); // // Are we reporting the device diff --git a/reactos/drivers/storage/ide/pciidex/pciidex.rbuild b/reactos/drivers/storage/ide/pciidex/pciidex.rbuild index ec532f5e771..d37294759fb 100644 --- a/reactos/drivers/storage/ide/pciidex/pciidex.rbuild +++ b/reactos/drivers/storage/ide/pciidex/pciidex.rbuild @@ -10,4 +10,5 @@ pciidex.c pdo.c pciidex.rc + pciidex.spec diff --git a/reactos/drivers/storage/ide/pciidex/pciidex.spec b/reactos/drivers/storage/ide/pciidex/pciidex.spec index 93d22bcb28a..b31793550f3 100644 --- a/reactos/drivers/storage/ide/pciidex/pciidex.spec +++ b/reactos/drivers/storage/ide/pciidex/pciidex.spec @@ -1,5 +1,3 @@ - @ stdcall PciIdeXGetBusData(ptr ptr long long) @ stdcall PciIdeXInitialize(ptr ptr ptr long) @ stdcall PciIdeXSetBusData(ptr ptr ptr long long) - diff --git a/reactos/drivers/storage/ide/uniata/atapi.h b/reactos/drivers/storage/ide/uniata/atapi.h index 2f9dce60029..3b7a0fbf7fb 100644 --- a/reactos/drivers/storage/ide/uniata/atapi.h +++ b/reactos/drivers/storage/ide/uniata/atapi.h @@ -138,6 +138,10 @@ ScsiDebugPrint( #else // _DEBUG +#ifdef KdPrint +#undef KdPrint +#endif + #define PRINT_PREFIX "UniATA: " //#define KdPrint3(_x_) {if(LOG_ON_RAISED_IRQL_W2K || MajorVersion < 0x05 || KeGetCurrentIrql() <= 2){/*DbgPrint("%x: ", PsGetCurrentThread()) ;*/ DbgPrint _x_ ; if(g_LogToDisplay){ PrintNtConsole _x_ ;} }} diff --git a/reactos/drivers/storage/port/diskdump/diskdump.c b/reactos/drivers/storage/port/diskdump/diskdump.c index b5c1492c935..4a39c74b8fb 100644 --- a/reactos/drivers/storage/port/diskdump/diskdump.c +++ b/reactos/drivers/storage/port/diskdump/diskdump.c @@ -1,22 +1,4 @@ -/* - * ReactOS kernel - * Copyright (C) 2001, 2002, 2003 ReactOS Team - * - * 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. - */ -/* $Id$ +/* $Id: diskdump.c 29690 2007-10-19 23:21:45Z dreimer $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS Kernel diff --git a/reactos/drivers/storage/port/diskdump/diskdump.def b/reactos/drivers/storage/port/diskdump/diskdump.def deleted file mode 100644 index 65e33b51740..00000000000 --- a/reactos/drivers/storage/port/diskdump/diskdump.def +++ /dev/null @@ -1,7 +0,0 @@ -; $Id$ -; -; diskdump.def - export definition file for crash dump driver -; -LIBRARY DISKDUMP.SYS -EXPORTS -DiskDumpFunctions diff --git a/reactos/drivers/storage/port/diskdump/diskdump.rbuild b/reactos/drivers/storage/port/diskdump/diskdump.rbuild index 67a7bf8527c..35ff83526e2 100644 --- a/reactos/drivers/storage/port/diskdump/diskdump.rbuild +++ b/reactos/drivers/storage/port/diskdump/diskdump.rbuild @@ -2,7 +2,7 @@ - + include/reactos/drivers ntoskrnl hal @@ -11,4 +11,5 @@ diskdump.c diskdump_helper.S diskdump.rc + diskdump.spec diff --git a/reactos/drivers/storage/port/diskdump/diskdump.rc b/reactos/drivers/storage/port/diskdump/diskdump.rc index 67b00ce30b3..be01545ecb7 100644 --- a/reactos/drivers/storage/port/diskdump/diskdump.rc +++ b/reactos/drivers/storage/port/diskdump/diskdump.rc @@ -1,4 +1,4 @@ -/* $Id$ */ +/* $Id: diskdump.rc 21842 2006-05-07 19:16:11Z ion $ */ #define REACTOS_VERSION_DLL #define REACTOS_STR_FILE_DESCRIPTION "Crash Dump Disk Driver\0" diff --git a/reactos/drivers/storage/port/diskdump/diskdump.spec b/reactos/drivers/storage/port/diskdump/diskdump.spec new file mode 100644 index 00000000000..c28c1a442ed --- /dev/null +++ b/reactos/drivers/storage/port/diskdump/diskdump.spec @@ -0,0 +1 @@ +@ extern DiskDumpFunctions diff --git a/reactos/drivers/usb/directory.rbuild b/reactos/drivers/usb/directory.rbuild index 8bc30145c16..50f53bccb70 100644 --- a/reactos/drivers/usb/directory.rbuild +++ b/reactos/drivers/usb/directory.rbuild @@ -10,7 +10,7 @@ - directory name="usbstor"> + diff --git a/reactos/drivers/usb/usbd/usbd.def b/reactos/drivers/usb/usbd/usbd.def deleted file mode 100644 index ac55df0ea44..00000000000 --- a/reactos/drivers/usb/usbd/usbd.def +++ /dev/null @@ -1,13 +0,0 @@ -; -; Exports definition file for usbd.sys -; -EXPORTS -USBD_Debug_GetHeap@16 -USBD_Debug_RetHeap@12 -USBD_CalculateUsbBandwidth@12 -USBD_CreateConfigurationRequestEx@8 -USBD_CreateConfigurationRequest@8 -USBD_GetInterfaceLength@8 -USBD_ParseConfigurationDescriptorEx@28 -USBD_ParseDescriptors@16 -;USBD_GetPdoRegistryParameters diff --git a/reactos/drivers/usb/usbd/usbd.rbuild b/reactos/drivers/usb/usbd/usbd.rbuild index a5bb94b8a09..5a9f43661cf 100644 --- a/reactos/drivers/usb/usbd/usbd.rbuild +++ b/reactos/drivers/usb/usbd/usbd.rbuild @@ -1,9 +1,10 @@ - + ntoskrnl hal usbd.c usbd.rc + usbd.spec diff --git a/reactos/drivers/usb/usbd/usbd.spec b/reactos/drivers/usb/usbd/usbd.spec new file mode 100644 index 00000000000..5f6f8349ab0 --- /dev/null +++ b/reactos/drivers/usb/usbd/usbd.spec @@ -0,0 +1,9 @@ +USBD_Debug_GetHeap(long long long long) +USBD_Debug_RetHeap(ptr long long) +USBD_CalculateUsbBandwidth(long long long) +USBD_CreateConfigurationRequestEx(ptr ptr) +USBD_CreateConfigurationRequest(ptr ptr) +USBD_GetInterfaceLength(ptr ptr) +USBD_ParseConfigurationDescriptorEx(ptr ptr long long long long long) +USBD_ParseDescriptors(ptr long ptr long) +;USBD_GetPdoRegistryParameters diff --git a/reactos/drivers/usb/usbstor/usbstor.def b/reactos/drivers/usb/usbstor/usbstor.def deleted file mode 100644 index 0eaf4f07f2c..00000000000 --- a/reactos/drivers/usb/usbstor/usbstor.def +++ /dev/null @@ -1,2 +0,0 @@ -LIBRARY usbstor.sys -EXPORTS diff --git a/reactos/drivers/usb/usbstor/usbstor.rbuild b/reactos/drivers/usb/usbstor/usbstor.rbuild index e13ade995d2..5a92f8ba383 100644 --- a/reactos/drivers/usb/usbstor/usbstor.rbuild +++ b/reactos/drivers/usb/usbstor/usbstor.rbuild @@ -1,7 +1,6 @@ - include ntoskrnl diff --git a/reactos/drivers/video/displays/framebuf/framebuf.def b/reactos/drivers/video/displays/framebuf/framebuf.def deleted file mode 100644 index 3ab97ffa6b8..00000000000 --- a/reactos/drivers/video/displays/framebuf/framebuf.def +++ /dev/null @@ -1,3 +0,0 @@ -LIBRARY framebuf.dll -EXPORTS -DrvEnableDriver@12 diff --git a/reactos/drivers/video/displays/framebuf/framebuf.rbuild b/reactos/drivers/video/displays/framebuf/framebuf.rbuild index f6db9a453b4..cdadcab0007 100644 --- a/reactos/drivers/video/displays/framebuf/framebuf.rbuild +++ b/reactos/drivers/video/displays/framebuf/framebuf.rbuild @@ -1,7 +1,7 @@ - + . win32k libcntpr @@ -11,4 +11,5 @@ screen.c surface.c framebuf.rc + framebuf.spec diff --git a/reactos/drivers/video/displays/framebuf/framebuf.spec b/reactos/drivers/video/displays/framebuf/framebuf.spec new file mode 100644 index 00000000000..aec115e4ef7 --- /dev/null +++ b/reactos/drivers/video/displays/framebuf/framebuf.spec @@ -0,0 +1 @@ +@ stdcall DrvEnableDriver(long long ptr) diff --git a/reactos/drivers/video/displays/framebufacc/framebufacc.def b/reactos/drivers/video/displays/framebufacc/framebufacc.def deleted file mode 100644 index 3ab97ffa6b8..00000000000 --- a/reactos/drivers/video/displays/framebufacc/framebufacc.def +++ /dev/null @@ -1,3 +0,0 @@ -LIBRARY framebuf.dll -EXPORTS -DrvEnableDriver@12 diff --git a/reactos/drivers/video/displays/framebufacc/framebufacc.rbuild b/reactos/drivers/video/displays/framebufacc/framebufacc.rbuild index 814fb2ada80..47c32ec3e4d 100644 --- a/reactos/drivers/video/displays/framebufacc/framebufacc.rbuild +++ b/reactos/drivers/video/displays/framebufacc/framebufacc.rbuild @@ -1,7 +1,7 @@ - + . win32k libcntpr @@ -11,4 +11,5 @@ screen.c surface.c framebufacc.rc + framebufacc.spec diff --git a/reactos/drivers/video/displays/framebufacc/framebufacc.spec b/reactos/drivers/video/displays/framebufacc/framebufacc.spec new file mode 100644 index 00000000000..aec115e4ef7 --- /dev/null +++ b/reactos/drivers/video/displays/framebufacc/framebufacc.spec @@ -0,0 +1 @@ +@ stdcall DrvEnableDriver(long long ptr) diff --git a/reactos/drivers/video/displays/vga/vgaddi.def b/reactos/drivers/video/displays/vga/vgaddi.def deleted file mode 100644 index 2f98d49c250..00000000000 --- a/reactos/drivers/video/displays/vga/vgaddi.def +++ /dev/null @@ -1,4 +0,0 @@ -; vgaddi.def -LIBRARY vgaddi.dll -EXPORTS -DrvEnableDriver@12 diff --git a/reactos/drivers/video/displays/vga/vgaddi.rbuild b/reactos/drivers/video/displays/vga/vgaddi.rbuild index 09ff2a846a0..ca0d329f0e9 100644 --- a/reactos/drivers/video/displays/vga/vgaddi.rbuild +++ b/reactos/drivers/video/displays/vga/vgaddi.rbuild @@ -1,7 +1,7 @@ - + . libcntpr win32k @@ -22,4 +22,5 @@ vgavideo.c vgaddi.rc + vgaddi.spec diff --git a/reactos/drivers/video/displays/vga/vgaddi.spec b/reactos/drivers/video/displays/vga/vgaddi.spec new file mode 100644 index 00000000000..aec115e4ef7 --- /dev/null +++ b/reactos/drivers/video/displays/vga/vgaddi.spec @@ -0,0 +1 @@ +@ stdcall DrvEnableDriver(long long ptr) diff --git a/reactos/drivers/video/videoprt/ddc.c b/reactos/drivers/video/videoprt/ddc.c index 0b51f35b6f6..a29f639ddd6 100644 --- a/reactos/drivers/video/videoprt/ddc.c +++ b/reactos/drivers/video/videoprt/ddc.c @@ -183,7 +183,7 @@ VideoPortDDCMonitorHelper( TRACE_(VIDEOPRT, "VideoPortDDCMonitorHelper()\n"); - ASSERT_IRQL(PASSIVE_LEVEL); + ASSERT_IRQL_LESS_OR_EQUAL(PASSIVE_LEVEL); if (ddc->Size != sizeof (ddc)) { WARN_(VIDEOPRT, "ddc->Size != %d (%d)\n", sizeof (ddc), ddc->Size); diff --git a/reactos/drivers/video/videoprt/videoprt.c b/reactos/drivers/video/videoprt/videoprt.c index e21a044cfec..636b7120f5a 100644 --- a/reactos/drivers/video/videoprt/videoprt.c +++ b/reactos/drivers/video/videoprt/videoprt.c @@ -875,7 +875,7 @@ VideoPortSetRegistryParameters( TRACE_(VIDEOPRT, "VideoPortSetRegistryParameters ParameterName %S, RegPath: %wZ\n", ValueName, &VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension)->RegistryPath); - ASSERT_IRQL(PASSIVE_LEVEL); + ASSERT_IRQL_LESS_OR_EQUAL(PASSIVE_LEVEL); Status = RtlWriteRegistryValue( RTL_REGISTRY_ABSOLUTE, VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension)->RegistryPath.Buffer, diff --git a/reactos/drivers/wdm/audio/backpln/portcls/port_factory.c b/reactos/drivers/wdm/audio/backpln/portcls/port_factory.c index 49e864ad930..23def6b7b20 100644 --- a/reactos/drivers/wdm/audio/backpln/portcls/port_factory.c +++ b/reactos/drivers/wdm/audio/backpln/portcls/port_factory.c @@ -48,7 +48,7 @@ PcNewPort( { DPRINT("Calling KoCreateInstance\n"); /* Call KS.SYS's Kernel-mode COM function */ - status = KoCreateInstance(ClassId, NULL, CLSCTX_KERNEL_SERVER, &IID_IPort, &new_port); + status = KoCreateInstance(ClassId, NULL, CLSCTX_KERNEL_SERVER, &IID_IPort, (PVOID*)&new_port); } else { diff --git a/reactos/drivers/wdm/audio/backpln/portcls/portcls.def b/reactos/drivers/wdm/audio/backpln/portcls/portcls.def deleted file mode 100644 index 4ad6a010c50..00000000000 --- a/reactos/drivers/wdm/audio/backpln/portcls/portcls.def +++ /dev/null @@ -1,55 +0,0 @@ -; -; Exports definition file for portcls.sys -; -EXPORTS -DllInitialize@4 -DllUnload@0 - -; Adapters (adapter.c) -PcAddAdapterDevice@20 -PcInitializeAdapterDriver@12 - -; Factories -PcNewDmaChannel@20 -PcNewInterruptSync@20 -PcNewMiniport@8 -PcNewPort@8 -PcNewRegistryKey@36 -PcNewResourceList@20 -PcNewResourceSublist@20 -PcNewServiceGroup@8 - -; Digital Rights Management (drm.c) -PcAddContentHandlers@12 -PcCreateContentMixed@12 -PcDestroyContent@4 -PcForwardContentToDeviceObject@12 -PcForwardContentToFileObject@8 -PcForwardContentToInterface@12 -PcGetContentRights@8 - -; IRP Helpers -PcCompleteIrp@12 -PcDispatchIrp@8 -PcForwardIrpSynchronous@8 - -; Misc -PcGetTimeInterval@8 -PcRegisterSubdevice@12 - -; Physical Connections -PcRegisterPhysicalConnection@20 -PcRegisterPhysicalConnectionFromExternal@20 -PcRegisterPhysicalConnectionToExternal@20 - -; Power Management -PcRegisterAdapterPowerManagement@8 -PcRequestNewPowerState@8 - -; Properties -PcCompletePendingPropertyRequest@8 -PcGetDeviceProperty@20 - -; Timeouts -PcRegisterIoTimeout@12 -PcUnregisterIoTimeout@12 diff --git a/reactos/drivers/wdm/audio/backpln/portcls/portcls.rbuild b/reactos/drivers/wdm/audio/backpln/portcls/portcls.rbuild index 043d7c43c7a..6f2fc9c06e2 100644 --- a/reactos/drivers/wdm/audio/backpln/portcls/portcls.rbuild +++ b/reactos/drivers/wdm/audio/backpln/portcls/portcls.rbuild @@ -8,7 +8,7 @@ -fno-rtti --> -Wno-non-virtual-dtor - + @@ -48,4 +48,5 @@ MiniportWavePci.cpp portcls.rc + portcls.spec diff --git a/reactos/drivers/wdm/audio/backpln/portcls/portcls.spec b/reactos/drivers/wdm/audio/backpln/portcls/portcls.spec new file mode 100644 index 00000000000..1af797cafed --- /dev/null +++ b/reactos/drivers/wdm/audio/backpln/portcls/portcls.spec @@ -0,0 +1,51 @@ +@ stdcall DllInitialize(long) +@ stdcall DllUnload() + +; Adapters (adapter.c) +@ stdcall PcAddAdapterDevice(ptr ptr ptr long long) +@ stdcall PcInitializeAdapterDriver(ptr ptr ptr) + +; Factories +@ stdcall PcNewDmaChannel(ptr ptr long ptr ptr) +@ stdcall PcNewInterruptSync(ptr ptr ptr long long) +@ stdcall PcNewMiniport(ptr ptr) +@ stdcall PcNewPort(ptr ptr) +@ stdcall PcNewRegistryKey(ptr ptr long long ptr ptr ptr long ptr) +@ stdcall PcNewResourceList(ptr ptr long ptr ptr) +@ stdcall PcNewResourceSublist(ptr ptr long ptr long) +@ stdcall PcNewServiceGroup(ptr ptr) + +; Digital Rights Management (drm.c) +@ stdcall PcAddContentHandlers(long ptr long) +@ stdcall PcCreateContentMixed(ptr long ptr) +@ stdcall PcDestroyContent(long) +@ stdcall PcForwardContentToDeviceObject(long ptr ptr) +@ stdcall PcForwardContentToFileObject(long ptr) +@ stdcall PcForwardContentToInterface(long ptr long) +@ stdcall PcGetContentRights(long ptr) + +; IRP Helpers +@ stdcall PcCompleteIrp(ptr ptr long) +@ stdcall PcDispatchIrp(ptr ptr) +@ stdcall PcForwardIrpSynchronous(ptr ptr) + +; Misc +@ stdcall PcGetTimeInterval(long long) +@ stdcall PcRegisterSubdevice(ptr wstr ptr) + +; Physical Connections +@ stdcall PcRegisterPhysicalConnection(ptr ptr long ptr long) +@ stdcall PcRegisterPhysicalConnectionFromExternal(ptr ptr long ptr long) +@ stdcall PcRegisterPhysicalConnectionToExternal(ptr ptr long ptr long) + +; Power Management +@ stdcall PcRegisterAdapterPowerManagement(ptr ptr) +@ stdcall PcRequestNewPowerState(ptr long) + +; Properties +@ stdcall PcCompletePendingPropertyRequest(ptr long) +@ stdcall PcGetDeviceProperty(ptr long long ptr ptr) + +; Timeouts +@ stdcall PcRegisterIoTimeout(ptr ptr ptr) +@ stdcall PcUnregisterIoTimeout(ptr ptr ptr) diff --git a/reactos/drivers/wdm/audio/drivers/mpu401/adapter.cpp b/reactos/drivers/wdm/audio/drivers/mpu401/adapter.cpp index 6011a343a0b..2850711496b 100644 --- a/reactos/drivers/wdm/audio/drivers/mpu401/adapter.cpp +++ b/reactos/drivers/wdm/audio/drivers/mpu401/adapter.cpp @@ -111,8 +111,8 @@ DriverEntry( IN PDRIVER_OBJECT Context1, IN PUNICODE_STRING Context2) { - PDEVICE_OBJECT DeviceObject; - UNICODE_STRING DeviceName = RTL_CONSTANT_STRING(L"\\Device\\MPU401Static"); + //PDEVICE_OBJECT DeviceObject; + //UNICODE_STRING DeviceName = RTL_CONSTANT_STRING(L"\\Device\\MPU401Static"); // KeBugCheck(0x0000007F); DPRINT1("MPU401_KS DriverEntry called, redirecting to PcInitializeAdapterDriver\n"); diff --git a/reactos/drivers/wdm/audio/drivers/mpu401/mpu401.def b/reactos/drivers/wdm/audio/drivers/mpu401/mpu401.def deleted file mode 100644 index 1a605ebb6b5..00000000000 --- a/reactos/drivers/wdm/audio/drivers/mpu401/mpu401.def +++ /dev/null @@ -1,6 +0,0 @@ -; -; Exports definition file for mpu401_ks.sys -; -EXPORTS -DriverEntry@8 - diff --git a/reactos/drivers/wdm/audio/drivers/mpu401/mpu401.rbuild b/reactos/drivers/wdm/audio/drivers/mpu401/mpu401.rbuild index cbd1fef36b1..ea1ea6fce4a 100644 --- a/reactos/drivers/wdm/audio/drivers/mpu401/mpu401.rbuild +++ b/reactos/drivers/wdm/audio/drivers/mpu401/mpu401.rbuild @@ -1,18 +1,10 @@ - - - . .. ntoskrnl portcls - + mpu401.rc adapter.cpp diff --git a/reactos/drivers/wdm/audio/drivers/sb16/sb16.rbuild b/reactos/drivers/wdm/audio/drivers/sb16/sb16.rbuild index 00e7e0763d7..8d9ae1587b2 100644 --- a/reactos/drivers/wdm/audio/drivers/sb16/sb16.rbuild +++ b/reactos/drivers/wdm/audio/drivers/sb16/sb16.rbuild @@ -3,7 +3,6 @@ . .. - ntoskrnl portcls stdunk.cpp diff --git a/reactos/drivers/wdm/audio/drivers/sb16/sb16_ks.def b/reactos/drivers/wdm/audio/drivers/sb16/sb16_ks.def deleted file mode 100644 index 32ef407d0a6..00000000000 --- a/reactos/drivers/wdm/audio/drivers/sb16/sb16_ks.def +++ /dev/null @@ -1,6 +0,0 @@ -; -; Exports definition file for sb16_ks.sys -; -EXPORTS -DriverEntry@8 - diff --git a/reactos/drivers/wdm/audio/drm/drmk/drmk.def b/reactos/drivers/wdm/audio/drm/drmk/drmk.def deleted file mode 100644 index b5208628163..00000000000 --- a/reactos/drivers/wdm/audio/drm/drmk/drmk.def +++ /dev/null @@ -1,12 +0,0 @@ -; -; Exports definition file for drmk.sys -; - -EXPORTS -DrmAddContentHandlers@12 -DrmCreateContentMixed@12 -DrmDestroyContent@4 -DrmForwardContentToDeviceObject@12 -DrmForwardContentToFileObject@8 -DrmForwardContentToInterface@12 -DrmGetContentRights@8 \ No newline at end of file diff --git a/reactos/drivers/wdm/audio/drm/drmk/drmk.rbuild b/reactos/drivers/wdm/audio/drm/drmk/drmk.rbuild index 5b425b517ca..beef05a26fb 100644 --- a/reactos/drivers/wdm/audio/drm/drmk/drmk.rbuild +++ b/reactos/drivers/wdm/audio/drm/drmk/drmk.rbuild @@ -4,9 +4,10 @@ . .. ../include - + ntoskrnl - drmk.rc stubs.cpp + drmk.rc + drmk.spec diff --git a/reactos/drivers/wdm/audio/drm/drmk/drmk.spec b/reactos/drivers/wdm/audio/drm/drmk/drmk.spec new file mode 100644 index 00000000000..9f6947e5314 --- /dev/null +++ b/reactos/drivers/wdm/audio/drm/drmk/drmk.spec @@ -0,0 +1,7 @@ +@ stdcall DrmAddContentHandlers(long ptr long) +@ stdcall DrmCreateContentMixed(ptr long ptr) +@ stdcall DrmDestroyContent(long) +@ stdcall DrmForwardContentToDeviceObject(long ptr ptr) +@ stdcall DrmForwardContentToFileObject(long ptr) +@ stdcall DrmForwardContentToInterface(long ptr long) +@ stdcall DrmGetContentRights(long ptr) diff --git a/reactos/hal/hal/hal.c b/reactos/hal/hal/hal.c index a30b42c804c..7cfe343b937 100644 --- a/reactos/hal/hal/hal.c +++ b/reactos/hal/hal/hal.c @@ -49,7 +49,7 @@ VOID NTAPI HalStopProfileInterrupt(IN KPROFILE_SOURCE ProfileSource) { - KEBUGCHECK(0); + ASSERT(FALSE); return; } @@ -60,7 +60,7 @@ VOID NTAPI HalStartProfileInterrupt(IN KPROFILE_SOURCE ProfileSource) { - KEBUGCHECK(0); + ASSERT(FALSE); return; } @@ -71,7 +71,7 @@ ULONG_PTR NTAPI HalSetProfileInterval(IN ULONG_PTR Interval) { - KEBUGCHECK(0); + ASSERT(FALSE); return Interval; } diff --git a/reactos/hal/halppc/generic/dma.c b/reactos/hal/halppc/generic/dma.c index 57b6dfe80c6..a3bf04aaaf4 100644 --- a/reactos/hal/halppc/generic/dma.c +++ b/reactos/hal/halppc/generic/dma.c @@ -1569,7 +1569,7 @@ IoFlushAdapterBuffers( PHYSICAL_ADDRESS PhysicalAddress; PPFN_NUMBER MdlPagesPtr; - ASSERT_IRQL(DISPATCH_LEVEL); + ASSERT_IRQL_LESS_OR_EQUAL(DISPATCH_LEVEL); if (AdapterObject != NULL && !AdapterObject->MasterDevice) { diff --git a/reactos/hal/halx86/generic/bus.c b/reactos/hal/halx86/generic/bus.c index a35adbe315a..9b708a296a5 100644 --- a/reactos/hal/halx86/generic/bus.c +++ b/reactos/hal/halx86/generic/bus.c @@ -222,7 +222,7 @@ HalGetBusDataByOffset(IN BUS_DATA_TYPE BusDataType, else if (BusDataType == EisaConfiguration) { /* FIXME: TODO */ - KEBUGCHECK(0); + ASSERT(FALSE); } else if ((BusDataType == PCIConfiguration) && (HalpPCIConfigInitialized) && diff --git a/reactos/hal/halx86/generic/dma.c b/reactos/hal/halx86/generic/dma.c index 804bf782f6b..efd53f430d6 100644 --- a/reactos/hal/halx86/generic/dma.c +++ b/reactos/hal/halx86/generic/dma.c @@ -1487,7 +1487,7 @@ HalpCopyBufferMap( */ /* FIXME: The correct bug check code isn't defined. */ /* KEBUGCHECKEX(HAL_MEMORY_ALLOCATION, PAGE_SIZE, 0, (ULONG_PTR)__FILE__, 0); */ - KEBUGCHECK(0); + ASSERT(FALSE);; } CurrentAddress = (ULONG_PTR)VirtualAddress + @@ -1569,7 +1569,7 @@ IoFlushAdapterBuffers( PHYSICAL_ADDRESS PhysicalAddress; PPFN_NUMBER MdlPagesPtr; - ASSERT_IRQL(DISPATCH_LEVEL); + ASSERT_IRQL_LESS_OR_EQUAL(DISPATCH_LEVEL); if (AdapterObject != NULL && !AdapterObject->MasterDevice) { diff --git a/reactos/hal/halx86/generic/profil.c b/reactos/hal/halx86/generic/profil.c index e98e982a906..4db4839d0eb 100644 --- a/reactos/hal/halx86/generic/profil.c +++ b/reactos/hal/halx86/generic/profil.c @@ -21,7 +21,7 @@ VOID NTAPI HalStopProfileInterrupt(IN KPROFILE_SOURCE ProfileSource) { - KEBUGCHECK(0); + ASSERT(FALSE); return; } @@ -32,7 +32,7 @@ VOID NTAPI HalStartProfileInterrupt(IN KPROFILE_SOURCE ProfileSource) { - KEBUGCHECK(0); + ASSERT(FALSE); return; } @@ -43,6 +43,6 @@ ULONG_PTR NTAPI HalSetProfileInterval(IN ULONG_PTR Interval) { - KEBUGCHECK(0); + ASSERT(FALSE); return Interval; } diff --git a/reactos/hal/halx86/mp/apic.c b/reactos/hal/halx86/mp/apic.c index e38fd740c62..a4d6e81c601 100644 --- a/reactos/hal/halx86/mp/apic.c +++ b/reactos/hal/halx86/mp/apic.c @@ -947,7 +947,7 @@ VOID HaliInitBSP(VOID) /* Only initialize the BSP once */ if (BSPInitialized) { - KEBUGCHECK(0); + ASSERT(FALSE); return; } @@ -969,7 +969,7 @@ VOID HaliInitBSP(VOID) else { DPRINT("No APIC found\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (APICMode == amPIC) @@ -1021,7 +1021,7 @@ HaliStartApplicationProcessor(ULONG Cpu, ULONG Stack) Cpu >= CPUCount || OnlineCPUs & (1 << Cpu)) { - KEBUGCHECK(0); + ASSERT(FALSE); } DPRINT1("Attempting to boot CPU %d\n", Cpu); diff --git a/reactos/hal/halx86/mp/halinit_mp.c b/reactos/hal/halx86/mp/halinit_mp.c index f22d932225b..89f023f2122 100644 --- a/reactos/hal/halx86/mp/halinit_mp.c +++ b/reactos/hal/halx86/mp/halinit_mp.c @@ -43,14 +43,14 @@ HalpInitPhase0(PLOADER_PARAMETER_BLOCK LoaderBlock) if (MPSInitialized) { - KEBUGCHECK(0); + ASSERT(FALSE); } MPSInitialized = TRUE; if (!HaliFindSmpConfig()) { - KEBUGCHECK(0); + ASSERT(FALSE); } /* store the kernel base for later use */ diff --git a/reactos/hal/halx86/mp/ioapic.c b/reactos/hal/halx86/mp/ioapic.c index 34dbb6cdf51..6015f0dbf4c 100644 --- a/reactos/hal/halx86/mp/ioapic.c +++ b/reactos/hal/halx86/mp/ioapic.c @@ -256,7 +256,7 @@ AssignIrqVector(ULONG irq) else if (current_vector == FIRST_SYSTEM_VECTOR) { DPRINT1("Ran out of interrupt sources!"); - KEBUGCHECK(0); + ASSERT(FALSE); } vector = current_vector; @@ -489,7 +489,7 @@ IOAPICSetupIds(VOID) if (GET_IOAPIC_ID(tmp) != IOAPICMap[apic].ApicId) { DPRINT1("Could not set I/O APIC ID!\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } } } @@ -648,15 +648,13 @@ HaliReconfigurePciInterrupts(VOID) i, IRQMap[i].IrqType, IRQMap[i].IrqFlag, IRQMap[i].SrcBusId, IRQMap[i].SrcBusIrq, IRQMap[i].DstApicId, IRQMap[i].DstApicInt); - if(1 != HalSetBusDataByOffset(PCIConfiguration, + HalSetBusDataByOffset(PCIConfiguration, IRQMap[i].SrcBusId, (IRQMap[i].SrcBusIrq >> 2) & 0x1f, &IRQMap[i].DstApicInt, 0x3c /*PCI_INTERRUPT_LINE*/, - 1)) - { - CHECKPOINT; - } + 1); + } } } diff --git a/reactos/hal/halx86/mp/mpconfig.c b/reactos/hal/halx86/mp/mpconfig.c index f14e50865aa..88e6e009bf8 100644 --- a/reactos/hal/halx86/mp/mpconfig.c +++ b/reactos/hal/halx86/mp/mpconfig.c @@ -45,7 +45,7 @@ HaliMPIntSrcInfo(PMP_CONFIGURATION_INTSRC m) if (IRQCount > MAX_IRQ_SOURCE) { DPRINT1("Max # of irq sources exceeded!!\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } IRQMap[IRQCount] = *m; @@ -217,7 +217,7 @@ HaliMPIOApicInfo(PMP_CONFIGURATION_IOAPIC m) DPRINT("Max # of I/O APICs (%d) exceeded (found %d).\n", MAX_IOAPIC, IOAPICCount); DPRINT1("Recompile with bigger MAX_IOAPIC!.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } IOAPICMap[IOAPICCount].ApicId = m->ApicId; @@ -245,12 +245,12 @@ HaliMPIntLocalInfo(PMP_CONFIGURATION_INTLOCAL m) if ((m->IrqType == INT_EXTINT) && (m->DstApicLInt != 0)) { DPRINT1("Invalid MP table!\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if ((m->IrqType == INT_NMI) && (m->DstApicLInt != 1)) { DPRINT1("Invalid MP table!\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } } @@ -271,14 +271,14 @@ HaliReadMPConfigTable(PMP_CONFIGURATION_TABLE Table) DPRINT1("Bad MP configuration block signature: %c%c%c%c\n", pc[0], pc[1], pc[2], pc[3]); - KEBUGCHECKEX(0, pc[0], pc[1], pc[2], pc[3]); + KeBugCheckEx(0, pc[0], pc[1], pc[2], pc[3]); return FALSE; } if (MPChecksum((PUCHAR)Table, Table->Length)) { DPRINT1("Bad MP configuration block checksum\n"); - KEBUGCHECK(0); + ASSERT(FALSE); return FALSE; } @@ -286,7 +286,7 @@ HaliReadMPConfigTable(PMP_CONFIGURATION_TABLE Table) { DPRINT1("Bad MP configuration table version (%d)\n", Table->Specification); - KEBUGCHECK(0); + ASSERT(FALSE); return FALSE; } @@ -294,7 +294,7 @@ HaliReadMPConfigTable(PMP_CONFIGURATION_TABLE Table) { DPRINT1("APIC base address is at 0x%X. I cannot handle non-standard adresses\n", Table->LocalAPICAddress); - KEBUGCHECK(0); + ASSERT(FALSE); return FALSE; } @@ -346,7 +346,7 @@ HaliReadMPConfigTable(PMP_CONFIGURATION_TABLE Table) } default: DPRINT1("Unknown entry in MPC table\n"); - KEBUGCHECK(0); + ASSERT(FALSE); return FALSE; } } @@ -597,7 +597,7 @@ HaliGetSmpConfig(VOID) } else { - KEBUGCHECK(0); + ASSERT(FALSE); } return TRUE; } diff --git a/reactos/hal/halx86/mp/mpsirql.c b/reactos/hal/halx86/mp/mpsirql.c index 3919b1e94ab..673ac5af844 100644 --- a/reactos/hal/halx86/mp/mpsirql.c +++ b/reactos/hal/halx86/mp/mpsirql.c @@ -37,7 +37,7 @@ KIRQL STDCALL KeGetCurrentIrql (VOID) if (irql > HIGH_LEVEL) { DPRINT1 ("CurrentIrql %x\n", irql); - KEBUGCHECK (0); + ASSERT(FALSE); } if (Flags & EFLAGS_INTERRUPT_MASK) { @@ -57,7 +57,7 @@ VOID KeSetCurrentIrql (KIRQL NewIrql) if (NewIrql > HIGH_LEVEL) { DPRINT1 ("NewIrql %x\n", NewIrql); - KEBUGCHECK (0); + ASSERT(FALSE); } Ke386SaveFlags(Flags); _disable(); @@ -138,7 +138,7 @@ KfLowerIrql (KIRQL NewIrql) if (NewIrql > oldIrql) { DPRINT1 ("NewIrql %x CurrentIrql %x\n", NewIrql, oldIrql); - KEBUGCHECK (0); + ASSERT(FALSE); } HalpLowerIrql (NewIrql, FALSE); } @@ -198,7 +198,7 @@ KfRaiseIrql (KIRQL NewIrql) if (NewIrql < OldIrql) { DPRINT1 ("CurrentIrql %x NewIrql %x\n", KeGetCurrentIrql (), NewIrql); - KEBUGCHECK (0); + ASSERT(FALSE); } @@ -301,14 +301,14 @@ HalBeginSystemInterrupt (KIRQL Irql, if (KeGetCurrentIrql () >= Irql) { DPRINT1("current irql %d, new irql %d\n", KeGetCurrentIrql(), Irql); - KEBUGCHECK(0); + ASSERT(FALSE); } Ke386SaveFlags(Flags); if (Flags & EFLAGS_INTERRUPT_MASK) { DPRINT1("HalBeginSystemInterrupt was called with interrupt's enabled\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } APICWrite (APIC_TPR, IRQL2TPR (Irql) & APIC_TPR_PRI); *OldIrql = KeGetCurrentIrql (); @@ -330,7 +330,7 @@ HalEndSystemInterrupt (KIRQL Irql, if (Flags & EFLAGS_INTERRUPT_MASK) { DPRINT1("HalEndSystemInterrupt was called with interrupt's enabled\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } APICSendEOI(); HalpLowerIrql (Irql, TRUE); @@ -394,7 +394,7 @@ HalRequestSoftwareInterrupt(IN KIRQL Request) break; default: - KEBUGCHECK(0); + ASSERT(FALSE); } } diff --git a/reactos/hal/halx86/mp/processor_mp.c b/reactos/hal/halx86/mp/processor_mp.c index 442d403d948..2deb0f5eb68 100644 --- a/reactos/hal/halx86/mp/processor_mp.c +++ b/reactos/hal/halx86/mp/processor_mp.c @@ -31,7 +31,7 @@ HalInitializeProcessor(ULONG ProcessorNumber, CPU = ThisCPU(); if (OnlineCPUs & (1 << CPU)) { - KEBUGCHECK(0); + ASSERT(FALSE); } if (ProcessorNumber == 0) @@ -70,7 +70,7 @@ HalAllProcessorsStarted (VOID) } if (CPUs > CPUCount) { - KEBUGCHECK(0); + ASSERT(FALSE); } else if (CPUs == CPUCount) { @@ -108,7 +108,7 @@ HalStartNextProcessor( if (CPU >= CPUCount) { - KEBUGCHECK(0); + ASSERT(FALSE); } DPRINT1("Attempting to boot CPU %d\n", CPU); diff --git a/reactos/include/ddk/tdikrnl.h b/reactos/include/ddk/tdikrnl.h index ef55f4ab93b..b0f05dd0752 100644 --- a/reactos/include/ddk/tdikrnl.h +++ b/reactos/include/ddk/tdikrnl.h @@ -577,7 +577,7 @@ TdiDefaultSendPossibleHandler( IrpSubFunction, DeviceObject, \ FileObject, Event, IoStatusBlock) \ IoBuildDeviceIoControlRequest( \ - 0x00000003, DeviceObject, \ + IrpSubFunction, DeviceObject, \ NULL, 0, NULL, 0, \ TRUE, Event, IoStatusBlock) diff --git a/reactos/include/ddk/winddk.h b/reactos/include/ddk/winddk.h index 6359f9bede9..cb94e6853d3 100644 --- a/reactos/include/ddk/winddk.h +++ b/reactos/include/ddk/winddk.h @@ -11481,6 +11481,9 @@ NTAPI PoSetDeviceBusy( PULONG IdlePointer); +#define PoSetDeviceBusy(IdlePointer) \ + ((void)(*(IdlePointer) = 0)) + NTKERNELAPI POWER_STATE NTAPI diff --git a/reactos/include/ndk/cctypes.h b/reactos/include/ndk/cctypes.h index 238680180de..c8d342815c4 100644 --- a/reactos/include/ndk/cctypes.h +++ b/reactos/include/ndk/cctypes.h @@ -127,8 +127,8 @@ typedef struct _SHARED_CACHE_MAP ULONG BcbSpinLock; PVOID Reserved; KEVENT Event; - PEX_PUSH_LOCK VacbPushLock; - PPRIVATE_CACHE_MAP PrivateCacheMap; + EX_PUSH_LOCK VacbPushLock; + PRIVATE_CACHE_MAP PrivateCacheMap; } SHARED_CACHE_MAP; #endif /* _NTIFS_INCLUDED_ */ diff --git a/reactos/include/ndk/i386/ketypes.h b/reactos/include/ndk/i386/ketypes.h index d165f72c924..6ad6aeba6ff 100644 --- a/reactos/include/ndk/i386/ketypes.h +++ b/reactos/include/ndk/i386/ketypes.h @@ -88,11 +88,14 @@ Author: #define EFLAGS_TF 0x100L #define EFLAGS_INTERRUPT_MASK 0x200L #define EFLAGS_DF 0x400L +#define EFLAGS_IOPL 0x3000L #define EFLAGS_NESTED_TASK 0x4000L +#define EFLAGS_RF 0x10000 #define EFLAGS_V86_MASK 0x20000 #define EFLAGS_ALIGN_CHECK 0x40000 #define EFLAGS_VIF 0x80000 #define EFLAGS_VIP 0x100000 +#define EFLAGS_ID 0x200000 #define EFLAGS_USER_SANITIZE 0x3F4DD7 #define EFLAG_SIGN 0x8000 #define EFLAG_ZERO 0x4000 diff --git a/reactos/include/ndk/i386/mmtypes.h b/reactos/include/ndk/i386/mmtypes.h index 9572ffdf304..01bc426ca6b 100644 --- a/reactos/include/ndk/i386/mmtypes.h +++ b/reactos/include/ndk/i386/mmtypes.h @@ -115,9 +115,9 @@ typedef struct _MMPTE_LIST ULONG Valid:1; ULONG OneEntry:1; ULONG filler0:8; - ULONG NextEntry:20; ULONG Prototype:1; ULONG filler1:1; + ULONG NextEntry:20; } MMPTE_LIST; #ifndef CONFIG_SMP diff --git a/reactos/include/ndk/iofuncs.h b/reactos/include/ndk/iofuncs.h index 3ff89f4bc00..06648fd596c 100644 --- a/reactos/include/ndk/iofuncs.h +++ b/reactos/include/ndk/iofuncs.h @@ -37,6 +37,13 @@ IoAssignDriveLetters( OUT PUCHAR NtSystemPath, OUT PSTRING NtSystemPathString ); + +NTSTATUS +NTAPI +IoSynchronousInvalidateDeviceRelations( + IN PDEVICE_OBJECT DeviceObject, + IN DEVICE_RELATION_TYPE Type +); #endif // diff --git a/reactos/include/ndk/iotypes.h b/reactos/include/ndk/iotypes.h index 42f7644ef95..5f7f2655f30 100644 --- a/reactos/include/ndk/iotypes.h +++ b/reactos/include/ndk/iotypes.h @@ -23,6 +23,7 @@ Author: // #include #include +#include // // I/O Completion Access Rights @@ -321,6 +322,18 @@ typedef enum _FSINFOCLASS #endif +// +// Dock Profile Status +// +typedef enum _PROFILE_STATUS +{ + DOCK_NOTDOCKDEVICE, + DOCK_QUIESCENT, + DOCK_ARRIVING, + DOCK_DEPARTING, + DOCK_EJECTIRP_COMPLETED +} PROFILE_STATUS, *PPROFILE_STATUS; + // // Device Node States // @@ -740,17 +753,18 @@ typedef struct _IO_CLIENT_EXTENSION // typedef struct _DEVICE_NODE { - struct _DEVICE_NODE *Parent; - struct _DEVICE_NODE *PrevSibling; - struct _DEVICE_NODE *NextSibling; + struct _DEVICE_NODE *Sibling; struct _DEVICE_NODE *Child; + struct _DEVICE_NODE *Parent; + struct _DEVICE_NODE *LastChild; ULONG Level; struct _PO_DEVICE_NOTIFY *Notify; + PO_IRP_MANAGER PoIrpManager; PNP_DEVNODE_STATE State; PNP_DEVNODE_STATE PreviousState; PNP_DEVNODE_STATE StateHistory[20]; ULONG StateHistoryEntry; - INT CompletionStatus; + NTSTATUS CompletionStatus; PIRP PendingIrp; ULONG Flags; ULONG UserFlags; @@ -786,10 +800,13 @@ typedef struct _DEVICE_NODE struct _DEVICE_NODE *NextResourceDeviceNode; } OverUsed2; PCM_RESOURCE_LIST BootResources; +#if (NTDDI_VERSION >= NTDDI_LONGHORN) + PCM_RESOURCE_LIST BootResourcesTranslated; +#endif ULONG CapabilityFlags; struct { - ULONG DockStatus; + PROFILE_STATUS DockStatus; LIST_ENTRY ListEntry; WCHAR *SerialNumber; } DockInfo; @@ -799,6 +816,9 @@ typedef struct _DEVICE_NODE ULONG DriverUnloadRetryCount; struct _DEVICE_NODE *PreviousParent; ULONG DeletedChidren; +#if (NTDDI_VERSION >= NTDDI_LONGHORN) + ULONG NumaNodeIndex; +#endif } DEVICE_NODE, *PDEVICE_NODE; // diff --git a/reactos/include/ndk/ketypes.h b/reactos/include/ndk/ketypes.h index d5393ee6b1d..48f50e37a50 100644 --- a/reactos/include/ndk/ketypes.h +++ b/reactos/include/ndk/ketypes.h @@ -536,17 +536,6 @@ typedef enum _KAPC_ENVIRONMENT InsertApcEnvironment } KAPC_ENVIRONMENT; -// -// CPU Cache Types -// -typedef enum _PROCESSOR_CACHE_TYPE -{ - CacheUnified, - CacheInstruction, - CacheData, - CacheTrace, -} PROCESSOR_CACHE_TYPE; - // // PRCB DPC Data // @@ -567,18 +556,6 @@ typedef struct _PP_LOOKASIDE_LIST struct _GENERAL_LOOKASIDE *L; } PP_LOOKASIDE_LIST, *PPP_LOOKASIDE_LIST; -// -// CPU Cache Descriptor -// -typedef struct _CACHE_DESCRIPTOR -{ - UCHAR Level; - UCHAR Associativity; - USHORT LineSize; - ULONG Size; - PROCESSOR_CACHE_TYPE Type; -} CACHE_DESCRIPTOR, *PCACHE_DESCRIPTOR; - // // Architectural Types // diff --git a/reactos/include/ndk/mmtypes.h b/reactos/include/ndk/mmtypes.h index d550184dd4e..924f4fb4f8b 100644 --- a/reactos/include/ndk/mmtypes.h +++ b/reactos/include/ndk/mmtypes.h @@ -389,9 +389,9 @@ typedef struct _SEGMENT // typedef struct _EVENT_COUNTER { + SLIST_ENTRY ListEntry; ULONG RefCount; KEVENT Event; - LIST_ENTRY ListEntry; } EVENT_COUNTER, *PEVENT_COUNTER; // @@ -642,7 +642,7 @@ typedef struct _MMWSLENTRY ULONG Hashed:1; ULONG Direct:1; ULONG Age:2; - ULONG VirtualPageNumber:14; + ULONG VirtualPageNumber:20; } MMWSLENTRY, *PMMWSLENTRY; typedef struct _MMWSLE diff --git a/reactos/include/ndk/potypes.h b/reactos/include/ndk/potypes.h index 6627aabe037..91f7f6be3d7 100644 --- a/reactos/include/ndk/potypes.h +++ b/reactos/include/ndk/potypes.h @@ -107,6 +107,22 @@ typedef struct _PO_DEVICE_NOTIFY ULONG ActiveChild; } PO_DEVICE_NOTIFY, *PPO_DEVICE_NOTIFY; +// +// Power IRP Queue +// +typedef struct _PO_IRP_QUEUE +{ + PIRP CurrentIrp; + PIRP PendingIrpList; +} PO_IRP_QUEUE, *PPO_IRP_QUEUE; + +// Power IRP Manager +typedef struct _PO_IRP_MANAGER +{ + PO_IRP_QUEUE DeviceIrpQueue; + PO_IRP_QUEUE SystemIrpQueue; +} PO_IRP_MANAGER, *PPO_IRP_MANAGER; + #endif // !NTOS_MODE_USER #endif // _POTYPES_H diff --git a/reactos/include/psdk/d3d9types.h b/reactos/include/psdk/d3d9types.h index d4d4def9a02..2d4267e1ce0 100644 --- a/reactos/include/psdk/d3d9types.h +++ b/reactos/include/psdk/d3d9types.h @@ -822,8 +822,11 @@ typedef enum _D3DFORMAT { D3DFMT_L16 = 81, D3DFMT_D32F_LOCKABLE = 82, D3DFMT_D24FS8 = 83, + +#ifndef D3D_DISABLE_9EX D3DFMT_D32_LOCKABLE = 84, D3DFMT_S8_LOCKABLE = 85, +#endif D3DFMT_VERTEXDATA = 100, D3DFMT_INDEX16 = 101, diff --git a/reactos/include/psdk/ipifcons.h b/reactos/include/psdk/ipifcons.h index 0a9e0e0d6e1..4dc256bedc0 100644 --- a/reactos/include/psdk/ipifcons.h +++ b/reactos/include/psdk/ipifcons.h @@ -30,4 +30,9 @@ #define MIB_IF_TYPE_PPP 23 #define MIB_IF_TYPE_LOOPBACK 24 #define MIB_IF_TYPE_SLIP 28 + +#define IF_TYPE_OTHER 1 +#define IF_TYPE_ETHERNET_CSMACD 6 +#define IF_TYPE_IEEE80211 71 + #endif /* _IPIFCONS_H */ diff --git a/reactos/include/psdk/ks.h b/reactos/include/psdk/ks.h index 5bda665365b..0563313c039 100644 --- a/reactos/include/psdk/ks.h +++ b/reactos/include/psdk/ks.h @@ -73,8 +73,11 @@ typedef PVOID PKSWORKER; #ifndef _NTRTL_ #ifndef DEFINE_GUIDEX - /* CDECL is used here in MS DDK but does this really work?? */ - #define DEFINE_GUIDEX(name) EXTERN_C const CDECL GUID name + #ifdef _MSC_VER + #define DEFINE_GUIDEX(name) EXTERN_C const CDECL GUID name + #else + #define DEFINE_GUIDEX(name) EXTERN_C const GUID name + #endif #endif #ifndef STATICGUIDOF diff --git a/reactos/include/psdk/netcfgx.h b/reactos/include/psdk/netcfgx.h new file mode 100644 index 00000000000..7a97b86d0bc --- /dev/null +++ b/reactos/include/psdk/netcfgx.h @@ -0,0 +1,137 @@ +#ifndef __NETCFGX_H__ +#define __NETCFGX_H__ + +#undef INTERFACE +#define INTERFACE INetCfgLock +DECLARE_INTERFACE_(INetCfgLock, IUnknown) +{ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void **ppv) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + STDMETHOD_(HRESULT,AcquireWriteLock)(THIS_ DWORD cmsTimeout, LPCWSTR pszwClientDescription, LPWSTR *ppszwClientDescription) PURE; + STDMETHOD_(HRESULT,ReleaseWriteLock)(THIS) PURE; + STDMETHOD_(HRESULT,IsWriteLocked)(THIS_ LPWSTR *ppszwClientDescription) PURE; +}; +#undef INTERFACE + +EXTERN_C const IID IID_INetCfgLock; + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define INetCfgLock_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define INetCfgLock_AddRef(p) (p)->lpVtbl->AddRef(p) +#define INetCfgLock_Release(p) (p)->lpVtbl->Release(p) +#define INetCfgLock_AcquireWriteLock(p,a,b,c) (p)->lpVtbl->AcquireWriteLock(p,a,b,c) +#define INetCfgLock_ReleaseWriteLock(p) (p)->lpVtbl->ReleaseWriteLock(p) +#define INetCfgLock_IsWriteLocked(p,a) (p)->lpVtbl->IsWriteLocked(p,a) +#endif + +typedef enum +{ + NCRP_QUERY_PROPERTY_UI = 1, + NCRP_SHOW_PROPERTY_UI = 2 +}NCRP_FLAGS; + + +#undef INTERFACE +#define INTERFACE INetCfgComponent +DECLARE_INTERFACE_(INetCfgComponent, IUnknown) +{ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void **ppv) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + STDMETHOD_(HRESULT,GetDisplayName)(THIS_ LPWSTR *ppszwDisplayName) PURE; + STDMETHOD_(HRESULT,SetDisplayName)(THIS_ LPWSTR *ppszwDisplayName) PURE; + STDMETHOD_(HRESULT,GetHelpText)(THIS_ LPWSTR *pszwHelpText) PURE; + STDMETHOD_(HRESULT,GetId)(THIS_ LPWSTR *ppszwId) PURE; + STDMETHOD_(HRESULT,GetCharacteristics)(THIS_ LPDWORD pdwCharacteristics) PURE; + STDMETHOD_(HRESULT,GetInstanceGuid)(THIS_ GUID *pGuid) PURE; + STDMETHOD_(HRESULT,GetPnpDevNodeId)(THIS_ LPWSTR *ppszwDevNodeId) PURE; + STDMETHOD_(HRESULT,GetClassGuid)(THIS_ GUID *pGuid) PURE; + STDMETHOD_(HRESULT,GetBindName)(THIS_ LPWSTR *ppszwBindName) PURE; + STDMETHOD_(HRESULT,GetDeviceStatus)(THIS_ ULONG *pulStatus) PURE; + STDMETHOD_(HRESULT,OpenParamKey)(THIS_ HKEY *phkey) PURE; + STDMETHOD_(HRESULT,RaisePropertyUi)(THIS_ HWND hwndParent, DWORD dwFlags, IUnknown *punkContext) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define INetCfgComponent_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define INetCfgComponent_AddRef(p) (p)->lpVtbl->AddRef(p) +#define INetCfgComponent_Release(p) (p)->lpVtbl->Release(p) +#define INetCfgComponent_GetDisplayName(p,a) (p)->lpVtbl->GetDisplayName(p,a) +#define INetCfgComponent_SetDisplayName(p,a) (p)->lpVtbl->SetDisplayName(p,a) +#define INetCfgComponent_GetHelpText(p,a) (p)->lpVtbl->GetHelpText(p,a) +#define INetCfgComponent_GetId(p,a) (p)->lpVtbl->GetId(p,a) +#define INetCfgComponent_GetCharacteristics(p,a) (p)->lpVtbl->GetCharacteristics(p,a) +#define INetCfgComponent_GetInstanceGuid(p,a) (p)->lpVtbl->GetInstanceGuid(p,a) +#define INetCfgComponent_GetPnpDevNodeId(p,a) (p)->lpVtbl->GetPnpDevNodeId(p,a) +#define INetCfgComponent_GetClassGuid(p,a) (p)->lpVtbl->GetClassGuid(p,a) +#define INetCfgComponent_GetBindName(p,a) (p)->lpVtbl->GetBindName(p,a) +#define INetCfgComponent_GetDeviceStatus(p,a) (p)->lpVtbl->GetDeviceStatus(p,a) +#define INetCfgComponent_OpenParamKey(p,a) (p)->lpVtbl->OpenParamKey(p,a) +#define INetCfgComponent_RaisePropertyUi(p,a,b,c) (p)->lpVtbl->RaisePropertyUi(p,a,b,c) +#endif + +#undef INTERFACE +#define INTERFACE IEnumNetCfgComponent +DECLARE_INTERFACE_(IEnumNetCfgComponent, IUnknown) +{ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void **ppv) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + STDMETHOD_(HRESULT,Next)(THIS_ ULONG celt, INetCfgComponent **rgelt, ULONG *pceltFetched) PURE; + STDMETHOD_(HRESULT,Skip) (THIS_ ULONG celt) PURE; + STDMETHOD_(HRESULT,Reset) (THIS) PURE; + STDMETHOD_(HRESULT,Clone) (THIS_ IEnumNetCfgComponent **ppenum) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IEnumNetCfgComponent_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IEnumNetCfgComponent_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IEnumNetCfgComponent_Release(p) (p)->lpVtbl->Release(p) +#define IEnumNetCfgComponent_Next(p,a,b,c) (p)->lpVtbl->Next(p,a,b,c) +#define IEnumNetCfgComponent_Skip(p,a) (p)->lpVtbl->Skip(p,a) +#define IEnumNetCfgComponent_Reset(p) (p)->lpVtbl->Reset(p) +#define IEnumNetCfgComponent_Clone(p,a) (p)->lpVtbl->Clone(p,a) +#endif + + +#undef INTERFACE +#define INTERFACE INetCfg +DECLARE_INTERFACE_(INetCfg, IUnknown) +{ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void **ppv) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + STDMETHOD_(HRESULT,Initialize) (THIS_ PVOID pvReserved) PURE; + STDMETHOD_(HRESULT,Uninitialize) (THIS) PURE; + STDMETHOD_(HRESULT,Apply) (THIS) PURE; + STDMETHOD_(HRESULT,Cancel) (THIS) PURE; + STDMETHOD_(HRESULT,EnumComponents) (THIS_ const GUID *pguidClass, IEnumNetCfgComponent **ppenumComponent) PURE; + STDMETHOD_(HRESULT,FindComponent) (THIS_ LPCWSTR pszwInfId, IEnumNetCfgComponent **ppenumComponent) PURE; + STDMETHOD_(HRESULT,QueryNetCfgClass) (THIS_ const GUID *pguidClass, REFIID riid, void **ppvObject) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define INetCfg_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define INetCfg_AddRef(p) (p)->lpVtbl->AddRef(p) +#define INetCfg_Release(p) (p)->lpVtbl->Release(p) +#define INetCfg_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) +#define INetCfg_Uninitialize(p) (p)->lpVtbl->Uninitialize(p) +#define INetCfg_Apply(p) (p)->lpVtbl->Apply(p) +#define INetCfg_Cancel(p) (p)->lpVtbl->Cancel(p) +#define INetCfg_EnumComponents(p,a,b) (p)->lpVtbl->EnumComponents(p,a,b) +#define INetCfg_FindComponent(p,a,b) (p)->lpVtbl->FindComponent(p,a,b) +#define INetCfg_QueryNetCfgClass(p,a,b,c) (p)->lpVtbl->QueryNetCfgClass(p,a,b,c) +#endif + +EXTERN_C const GUID CLSID_CNetCfg; +EXTERN_C const IID IID_INetCfg; + +#endif diff --git a/reactos/include/psdk/netcon.h b/reactos/include/psdk/netcon.h new file mode 100644 index 00000000000..c5aee83898b --- /dev/null +++ b/reactos/include/psdk/netcon.h @@ -0,0 +1,197 @@ +#ifndef __NETCON_H__ +#define __NETCON_H__ + +typedef enum +{ + NCME_DEFAULT = 0 +}NETCONMGR_ENUM_FLAGS; + +typedef enum +{ + NCCF_NONE = 0, + NCCF_ALL_USERS = 0x1, + NCCF_ALLOW_DUPLICATION = 0x2, + NCCF_ALLOW_REMOVAL = 0x4, + NCCF_ALLOW_RENAME = 0x8, + NCCF_SHOW_ICON = 0x10, + NCCF_INCOMING_ONLY = 0x20, + NCCF_OUTGOING_ONLY = 0x40, + NCCF_BRANDED = 0x80, + NCCF_SHARED = 0x100, + NCCF_BRIDGED = 0x200, + NCCF_FIREWALLED = 0x400, + NCCF_DEFAULT = 0x800, + NCCF_HOMENET_CAPABLE = 0x1000, + NCCF_SHARED_PRIVATE = 0x2000, + NCCF_QUARANTINED = 0x4000, + NCCF_RESERVED = 0x8000, + NCCF_BLUETOOTH_MASK = 0xf0000, + NCCF_LAN_MASK = 0xf00000 +}NETCON_CHARACTERISTIC_FLAGS; + + +typedef enum +{ + NCS_DISCONNECTED = 0, + NCS_CONNECTING = NCS_DISCONNECTED + 1, + NCS_CONNECTED = NCS_CONNECTING + 1, + NCS_DISCONNECTING = NCS_CONNECTED + 1, + NCS_HARDWARE_NOT_PRESENT = NCS_DISCONNECTING + 1, + NCS_HARDWARE_DISABLED = NCS_HARDWARE_NOT_PRESENT + 1, + NCS_HARDWARE_MALFUNCTION = NCS_HARDWARE_DISABLED + 1, + NCS_MEDIA_DISCONNECTED = NCS_HARDWARE_MALFUNCTION + 1, + NCS_AUTHENTICATING = NCS_MEDIA_DISCONNECTED + 1, + NCS_AUTHENTICATION_SUCCEEDED= NCS_AUTHENTICATING + 1, + NCS_AUTHENTICATION_FAILED = NCS_AUTHENTICATION_SUCCEEDED + 1, + NCS_INVALID_ADDRESS = NCS_AUTHENTICATION_FAILED + 1, + NCS_CREDENTIALS_REQUIRED = NCS_INVALID_ADDRESS + 1 +}NETCON_STATUS; + +typedef enum +{ + NCT_DIRECT_CONNECT = 0, + NCT_INBOUND = NCT_DIRECT_CONNECT + 1, + NCT_INTERNET = NCT_INBOUND + 1, + NCT_LAN = NCT_INTERNET + 1, + NCT_PHONE = NCT_LAN + 1, + NCT_TUNNEL = NCT_PHONE + 1, + NCT_BRIDGE = NCT_TUNNEL + 1 +}NETCON_TYPE; + + +typedef enum +{ + NCM_NONE = 0, + NCM_DIRECT = NCM_NONE + 1, + NCM_ISDN = NCM_DIRECT + 1, + NCM_LAN = NCM_ISDN + 1, + NCM_PHONE = NCM_LAN + 1, + NCM_TUNNEL = NCM_PHONE + 1, + NCM_PPPOE = NCM_TUNNEL + 1, + NCM_BRIDGE = NCM_PPPOE + 1, + NCM_SHAREDACCESSHOST_LAN = NCM_BRIDGE + 1, + NCM_SHAREDACCESSHOST_RAS = NCM_SHAREDACCESSHOST_LAN + 1 +}NETCON_MEDIATYPE; + + +typedef struct tagNETCON_PROPERTIES +{ + GUID guidId; + LPWSTR pszwName; + LPWSTR pszwDeviceName; + NETCON_STATUS Status; + NETCON_MEDIATYPE MediaType; + DWORD dwCharacter; + CLSID clsidThisObject; + CLSID clsidUiObject; +}NETCON_PROPERTIES; + + +#undef INTERFACE +#define INTERFACE INetConnection +DECLARE_INTERFACE_(INetConnection, IUnknown) +{ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void **ppv) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + STDMETHOD_(HRESULT,Connect) (THIS) PURE; + STDMETHOD_(HRESULT,Disconnect) (THIS) PURE; + STDMETHOD_(HRESULT,Delete) (THIS) PURE; + STDMETHOD_(HRESULT,Duplicate)(THIS_ LPCWSTR pszwDuplicateName, INetConnection **ppCon) PURE; + STDMETHOD_(HRESULT,GetProperties) (THIS_ NETCON_PROPERTIES **ppProps) PURE; + STDMETHOD_(HRESULT,GetUiObjectClassId) (THIS_ CLSID *pclsid) PURE; + STDMETHOD_(HRESULT,Rename) (THIS_ LPCWSTR pszwNewName) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define INetConnection_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define INetConnection_AddRef(p) (p)->lpVtbl->AddRef(p) +#define INetConnection_Release(p) (p)->lpVtbl->Release(p) +#define INetConnection_Connect(p) (p)->lpVtbl->Connect(p) +#define INetConnection_Disconnect(p) (p)->lpVtbl->Disconnect(p) +#define INetConnection_Delete(p) (p)->lpVtbl->Delete(p) +#define INetConnection_Duplicate(p,a,b) (p)->lpVtbl->Duplicate(p,a,b) +#define INetConnection_GetProperties(p,a) (p)->lpVtbl->GetProperties(p,a) +#define INetConnection_GetUiObjectClassId(p,a) (p)->lpVtbl->GetUiObjectClassId(p,a) +#define INetConnection_Rename(p,a) (p)->lpVtbl->Rename(p,a) +#endif + +EXTERN_C const IID IID_INetConnection; + + +#undef INTERFACE +#define INTERFACE IEnumNetConnection +DECLARE_INTERFACE_(IEnumNetConnection, IUnknown) +{ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + STDMETHOD(Next)(THIS_ ULONG celt, INetConnection **rgelt, ULONG *pceltFetched) PURE; + STDMETHOD(Skip) (THIS_ ULONG celt) PURE; + STDMETHOD(Reset) (THIS) PURE; + STDMETHOD(Clone) (THIS_ IEnumNetConnection **ppenum) PURE; +}; +#undef INTERFACE + +EXTERN_C const IID IID_IEnumNetConnection; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IEnumNetConnection_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IEnumNetConnection_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IEnumNetConnection_Release(p) (p)->lpVtbl->Release(p) +#define IEnumNetConnection_Next(p,a,b,c) (p)->lpVtbl->Next(p,a,b,c) +#define IEnumNetConnection_Skip(p,a) (p)->lpVtbl->Skip(p,a) +#define IEnumNetConnection_Reset(p) (p)->lpVtbl->Reset(p) +#define IEnumNetConnection_Clone(p,a) (p)->lpVtbl->Clone(p,a) +#endif + +#undef INTERFACE +#define INTERFACE INetConnectionManager +DECLARE_INTERFACE_(INetConnectionManager, IUnknown) +{ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void **ppv) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + STDMETHOD_(HRESULT,EnumConnections) (THIS_ NETCONMGR_ENUM_FLAGS Flags, IEnumNetConnection **ppEnum) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define INetConnectionManager_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define INetConnectionManager_AddRef(p) (p)->lpVtbl->AddRef(p) +#define INetConnectionManager_Release(p) (p)->lpVtbl->Release(p) +#define INetConnectionManager_EnumConnections(p,a,b) (p)->lpVtbl->EnumConnections(p,a,b) +#endif + +EXTERN_C const CLSID CLSID_ConnectionManager; +EXTERN_C const IID IID_INetConnectionManager; + +#undef INTERFACE +#define INTERFACE INetConnectionPropertyUi +DECLARE_INTERFACE_(INetConnectionPropertyUi, IUnknown) +{ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void **ppv) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + STDMETHOD_(HRESULT, SetConnection) (THIS_ INetConnection *pCon) PURE; + STDMETHOD_(HRESULT, AddPages) (THIS_ HWND hwndParent, LPFNADDPROPSHEETPAGE pfnAddPage, LPARAM lParam) PURE; + + +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define INetConnectionPropertyUi_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define INetConnectionPropertyUi_AddRef(p) (p)->lpVtbl->AddRef(p) +#define INetConnectionPropertyUi_Release(p) (p)->lpVtbl->Release(p) +#define INetConnectionPropertyUi_SetConnection(p,a) (p)->lpVtbl->SetConnection(p,a) +#define INetConnectionPropertyUi_AddPages(p,a,b,c) (p)->lpVtbl->AddPages(p,a,b,c) +#endif + +EXTERN_C const IID IID_INetConnectionPropertyUi; + +VOID STDCALL NcFreeNetconProperties (NETCON_PROPERTIES* pProps); + +#endif diff --git a/reactos/include/psdk/shlguid.h b/reactos/include/psdk/shlguid.h index 49060f374dc..942421632fc 100644 --- a/reactos/include/psdk/shlguid.h +++ b/reactos/include/psdk/shlguid.h @@ -116,8 +116,6 @@ DEFINE_GUID(CLSID_ControlPanel, 0x21EC2020, 0x3AEA, 0x1069, 0xA2, 0xDD, 0x08, 0x DEFINE_GUID(CLSID_Printers, 0x2227A280, 0x3AEA, 0x1069, 0xA2, 0xDE, 0x08, 0x00, 0x2B, 0x30, 0x30, 0x9D); DEFINE_GUID(CLSID_MyDocuments, 0x450d8fba, 0xad25, 0x11d0, 0x98, 0xa8, 0x08, 0x00, 0x36, 0x1b, 0x11, 0x03); DEFINE_GUID(CLSID_FolderShortcut, 0x0AFACED1, 0xE828, 0x11D1, 0x91, 0x87, 0xB5, 0x32, 0xF1, 0xE9, 0x57, 0x5D); -DEFINE_GUID(CLSID_FontsFolderShortcut, 0xD20EA4E1, 0x3957, 0x11D2, 0xA4, 0x0B, 0x0C, 0x50, 0x20, 0x52, 0x41,0x52); -DEFINE_GUID(CLSID_AdminFolderShortcut, 0xD20EA4E1, 0x3957, 0x11D2, 0xA4, 0x0B, 0x0C, 0x50, 0x20, 0x52, 0x41, 0x53); DEFINE_GUID(IID_IQueryAssociations, 0xc46ca590, 0x3c3f, 0x11d2, 0xbe, 0xe6, 0x00, 0x00, 0xf8, 0x05, 0xca, 0x57); DEFINE_GUID(CLSID_DragDropHelper, 0x4657278a, 0x411b, 0x11d2, 0x83, 0x9a, 0x00, 0xc0, 0x4f, 0xd9, 0x18, 0xd0); diff --git a/reactos/include/psdk/shlobj.h b/reactos/include/psdk/shlobj.h index f60920edb06..003f7f5e7b9 100644 --- a/reactos/include/psdk/shlobj.h +++ b/reactos/include/psdk/shlobj.h @@ -46,12 +46,12 @@ HPSXA WINAPI SHCreatePropSheetExtArray(HKEY,LPCWSTR,UINT); DWORD WINAPI SHCLSIDFromStringA(LPCSTR,CLSID*); DWORD WINAPI SHCLSIDFromStringW(LPCWSTR,CLSID*); #define SHCLSIDFromString WINELIB_NAME_AW(SHCLSIDFromString) -HRESULT WINAPI SHCreateStdEnumFmtEtc(DWORD,const FORMATETC *,IEnumFORMATETC**); +HRESULT WINAPI SHCreateStdEnumFmtEtc(UINT,const FORMATETC *,IEnumFORMATETC**); void WINAPI SHDestroyPropSheetExtArray(HPSXA); BOOL WINAPI SHFindFiles(LPCITEMIDLIST,LPCITEMIDLIST); DWORD WINAPI SHFormatDrive(HWND,UINT,UINT,UINT); void WINAPI SHFree(LPVOID); -BOOL WINAPI GetFileNameFromBrowse(HWND,LPSTR,DWORD,LPCSTR,LPCSTR,LPCSTR,LPCSTR); +BOOL WINAPI GetFileNameFromBrowse(HWND,LPWSTR,UINT,LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR); HRESULT WINAPI SHGetInstanceExplorer(IUnknown**); HRESULT WINAPI SHGetFolderPathAndSubDirA(HWND,int,HANDLE,DWORD,LPCSTR,LPSTR); HRESULT WINAPI SHGetFolderPathAndSubDirW(HWND,int,HANDLE,DWORD,LPCWSTR,LPWSTR); @@ -1147,7 +1147,13 @@ typedef struct { } NT_FE_CONSOLE_PROPS, *LPNT_FE_CONSOLE_PROPS; typedef struct { + +#ifdef __cplusplus DATABLOCK_HEADER dbh; +#else + DWORD cbSize; + DWORD dwSignature; +#endif CHAR szDarwinID[MAX_PATH]; WCHAR szwDarwinID[MAX_PATH]; } EXP_DARWIN_LINK, *LPEXP_DARWIN_LINK; @@ -1188,7 +1194,7 @@ typedef struct _SHChangeProductKeyAsIDList { } SHChangeProductKeyAsIDList, *LPSHChangeProductKeyAsIDList; ULONG WINAPI SHChangeNotifyRegister(HWND hwnd, int fSources, LONG fEvents, UINT wMsg, - int cEntries, SHChangeNotifyEntry *pshcne); + int cEntries, const SHChangeNotifyEntry *pshcne); BOOL WINAPI SHChangeNotifyDeregister(ULONG ulID); BOOL WINAPI SHChangeNotification_Unlock(HANDLE hLock); @@ -1197,9 +1203,9 @@ HRESULT WINAPI SHGetRealIDL(IShellFolder *psf, LPCITEMIDLIST pidlSimple, LPITEMI /**************************************************************************** * SHCreateDirectory API */ -DWORD WINAPI SHCreateDirectory(HWND, LPCVOID); -int WINAPI SHCreateDirectoryExA(HWND, LPCSTR, LPSECURITY_ATTRIBUTES); -int WINAPI SHCreateDirectoryExW(HWND, LPCWSTR, LPSECURITY_ATTRIBUTES); +DWORD WINAPI SHCreateDirectory(HWND, LPCWSTR); +int WINAPI SHCreateDirectoryExA(HWND, LPCSTR, const SECURITY_ATTRIBUTES*); +int WINAPI SHCreateDirectoryExW(HWND, LPCWSTR, const SECURITY_ATTRIBUTES*); /**************************************************************************** * SHGetSpecialFolderLocation API @@ -1277,7 +1283,6 @@ HRESULT WINAPI SHGetFolderPathW(HWND hwnd, int nFolder, HANDLE hToken, DWORD dwF #define CSIDL_CDBURN_AREA 0x003b #define CSIDL_COMPUTERSNEARME 0x003d #define CSIDL_PROFILES 0x003e -#define CSIDL_FOLDER_MASK 0x00ff #define CSIDL_FLAG_PER_USER_INIT 0x0800 #define CSIDL_FLAG_NO_ALIAS 0x1000 #define CSIDL_FLAG_DONT_VERIFY 0x4000 @@ -1417,7 +1422,7 @@ BOOL WINAPI DAD_DragEnterEx(HWND,POINT); BOOL WINAPI DAD_DragEnterEx2(HWND,POINT,IDataObject*); BOOL WINAPI DAD_DragMove(POINT); BOOL WINAPI DAD_DragLeave(void); -BOOL WINAPI DAD_AutoScroll(HWND,AUTO_SCROLL_DATA*,LPPOINT); +BOOL WINAPI DAD_AutoScroll(HWND,AUTO_SCROLL_DATA*,const POINT*); HRESULT WINAPI SHDoDragDrop(HWND,IDataObject*,IDropSource*,DWORD,LPDWORD); LPITEMIDLIST WINAPI ILAppendID(LPITEMIDLIST,LPCSHITEMID,BOOL); @@ -1470,7 +1475,7 @@ typedef struct HRESULT WINAPI SHCreateDefaultContextMenu(const DEFCONTEXTMENU *,REFIID,void **ppv); typedef HRESULT (CALLBACK * LPFNDFMCALLBACK)(IShellFolder*,HWND,IDataObject*,UINT,WPARAM,LPARAM); -INT WINAPI CDefFolderMenu_Create2(LPCITEMIDLIST,HWND,UINT,LPCITEMIDLIST*,IShellFolder*,LPFNDFMCALLBACK,UINT,HKEY *,IContextMenu **); +HRESULT WINAPI CDefFolderMenu_Create2(LPCITEMIDLIST,HWND,UINT,LPCITEMIDLIST*,IShellFolder*,LPFNDFMCALLBACK,UINT,const HKEY *,IContextMenu **); /**************************************************************************** * SHCreateDefaultContextMenu API @@ -1522,8 +1527,8 @@ typedef int OPEN_AS_INFO_FLAGS; typedef struct tagOPENASINFO { - LPCTSTR pcszFile; - LPCTSTR pcszClass; + LPCWSTR pcszFile; + LPCWSTR pcszClass; OPEN_AS_INFO_FLAGS oaifInFlags; } OPENASINFO; diff --git a/reactos/include/psdk/srrestoreptapi.h b/reactos/include/psdk/srrestoreptapi.h new file mode 100644 index 00000000000..456186c4094 --- /dev/null +++ b/reactos/include/psdk/srrestoreptapi.h @@ -0,0 +1,64 @@ +/* + * Definitions for the System File Checker (Windows File Protection) + * + * Copyright 2008 Pierre Schweitzer + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef _SRRESTOREPTAPI_H +#define _SRRESTOREPTAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Defines */ + +#define MAX_DESC 64 +#define MAX_DESC_W 256 + +/* Types */ + +typedef struct _RESTOREPTINFOA { + DWORD dwEventType; + DWORD dwRestorePtType; + INT64 llSequenceNumber; + CHAR szDescription[MAX_DESC]; +} RESTOREPOINTINFOA, *PRESTOREPOINTINFOA; + +typedef struct _RESTOREPTINFOW { + DWORD dwEventType; + DWORD dwRestorePtType; + INT64 llSequenceNumber; + WCHAR szDescription[MAX_DESC_W]; +} RESTOREPOINTINFOW, *PRESTOREPOINTINFOW; + +typedef struct _SMGRSTATUS { + DWORD nStatus; + INT64 llSequenceNumber; +} STATEMGRSTATUS, *PSTATEMGRSTATUS; + +/* Functions */ + +BOOL WINAPI SRSetRestorePointA(PRESTOREPOINTINFOA, PSTATEMGRSTATUS); +BOOL WINAPI SRSetRestorePointW(PRESTOREPOINTINFOW, PSTATEMGRSTATUS); +DWORD WINAPI SRRemoveRestorePoint(DWORD); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/reactos/include/psdk/winbase.h b/reactos/include/psdk/winbase.h index 28ece8ba31d..3b129ce1454 100644 --- a/reactos/include/psdk/winbase.h +++ b/reactos/include/psdk/winbase.h @@ -1208,6 +1208,7 @@ BOOL WINAPI CopyFileExW(LPCWSTR,LPCWSTR,LPPROGRESS_ROUTINE,LPVOID,LPBOOL,DWORD); #define CopyMemory RtlCopyMemory #define FillMemory RtlFillMemory #define ZeroMemory RtlZeroMemory +#define SecureZeroMemory RtlSecureZeroMemory BOOL WINAPI CopySid(DWORD,PSID,PSID); #if (_WIN32_WINNT >= 0x0501) HANDLE WINAPI CreateActCtxA(PCACTCTXA); diff --git a/reactos/include/psdk/winnt.h b/reactos/include/psdk/winnt.h index e870fbdbbd0..9e49480cb83 100644 --- a/reactos/include/psdk/winnt.h +++ b/reactos/include/psdk/winnt.h @@ -4401,6 +4401,45 @@ typedef OSVERSIONINFOEXA OSVERSIONINFOEX,*POSVERSIONINFOEX,*LPOSVERSIONINFOEX; ULONGLONG WINAPI VerSetConditionMask(ULONGLONG,DWORD,BYTE); #endif +typedef enum _PROCESSOR_CACHE_TYPE { + CacheUnified, + CacheInstruction, + CacheData, + CacheTrace +} PROCESSOR_CACHE_TYPE; + +typedef enum _LOGICAL_PROCESSOR_RELATIONSHIP { + RelationProcessorCore, + RelationNumaNode, + RelationCache, + RelationProcessorPackage +} LOGICAL_PROCESSOR_RELATIONSHIP; + +#define CACHE_FULLY_ASSOCIATIVE 0xFF + +typedef struct _CACHE_DESCRIPTOR { + BYTE Level; + BYTE Associativity; + WORD LineSize; + DWORD Size; + PROCESSOR_CACHE_TYPE Type; +} CACHE_DESCRIPTOR, *PCACHE_DESCRIPTOR; + +typedef struct _SYSTEM_LOGICAL_PROCESSOR_INFORMATION { + ULONG_PTR ProcessorMask; + LOGICAL_PROCESSOR_RELATIONSHIP Relationship; + union { + struct { + BYTE Flags; + } ProcessorCore; + struct { + DWORD NodeNumber; + } NumaNode; + CACHE_DESCRIPTOR Cache; + ULONGLONG Reserved[2]; + }; +} SYSTEM_LOGICAL_PROCESSOR_INFORMATION, *PSYSTEM_LOGICAL_PROCESSOR_INFORMATION; + NTSYSAPI SIZE_T STDCALL @@ -4415,6 +4454,23 @@ RtlCompareMemory ( #define RtlFillMemory(d,l,f) memset((d), (f), (l)) #define RtlZeroMemory(d,l) RtlFillMemory((d),(l),0) +FORCEINLINE +PVOID +RtlSecureZeroMemory(IN PVOID ptr, + IN SIZE_T cnt) +{ + volatile char *vptr = (volatile char *)ptr; + + while (cnt) + { + *vptr = 0; + vptr++; + cnt--; + } + + return ptr; +} + typedef struct _OBJECT_TYPE_LIST { WORD Level; WORD Sbz; @@ -4622,6 +4678,40 @@ BitScanReverse(OUT ULONG *Index, #endif +/* TODO: Other architectures than X86 */ +#if defined(_M_IX86) +#define PF_TEMPORAL_LEVEL_1 +#define PF_NON_TEMPORAL_LEVEL_ALL +#define PreFetchCacheLine(l, a) +#elif defined (_M_AMD64) +#define PreFetchCacheLine(l, a) +#elif defined(_M_PPC) +#define PreFetchCacheLine(l, a) +#elif defined(_M_ARM) +#define PreFetchCacheLine(l, a) +#else +#error Unknown architecture +#endif + +/* TODO: Other architectures than X86 */ +#if defined(_M_IX86) +FORCEINLINE +VOID +MemoryBarrier(VOID) +{ + LONG Barrier; + __asm__ __volatile__("xchgl %%eax, %[Barrier]" : : [Barrier] "m" (Barrier) : "memory"); +} +#elif defined (_M_AMD64) +#define MemoryBarrier() +#elif defined(_M_PPC) +#define MemoryBarrier() +#elif defined(_M_ARM) +#define MemoryBarrier() +#else +#error Unknown architecture +#endif + #if defined(_M_IX86) #define YieldProcessor() __asm__ __volatile__("pause"); #elif defined (_M_AMD64) diff --git a/reactos/include/psdk/winuser.h b/reactos/include/psdk/winuser.h index 437316bb8d7..d9d9b0b24b6 100644 --- a/reactos/include/psdk/winuser.h +++ b/reactos/include/psdk/winuser.h @@ -8,6 +8,13 @@ extern "C" { #endif +#if !defined(_USER32_) +#define WINUSERAPI DECLSPEC_IMPORT +#else +#define WINUSERAPI +#endif + + #define WC_DIALOG MAKEINTATOM(0x8002) #define FALT 16 #define FCONTROL 8 diff --git a/reactos/include/reactos/arc/arc.h b/reactos/include/reactos/arc/arc.h index b57001bae81..1e3f7d738f0 100644 --- a/reactos/include/reactos/arc/arc.h +++ b/reactos/include/reactos/arc/arc.h @@ -118,10 +118,10 @@ typedef struct _MEMORY_ALLOCATION_DESCRIPTOR typedef struct _BOOT_DRIVER_LIST_ENTRY { - LIST_ENTRY ListEntry; + LIST_ENTRY Link; UNICODE_STRING FilePath; UNICODE_STRING RegistryPath; - struct _LDR_DATA_TABLE_ENTRY *DataTableEntry; + struct _LDR_DATA_TABLE_ENTRY *LdrEntry; } BOOT_DRIVER_LIST_ENTRY, *PBOOT_DRIVER_LIST_ENTRY; typedef struct _ARC_DISK_SIGNATURE diff --git a/reactos/include/reactos/debug.h b/reactos/include/reactos/debug.h index 47d12eda3b0..10d36fa0f20 100644 --- a/reactos/include/reactos/debug.h +++ b/reactos/include/reactos/debug.h @@ -16,11 +16,6 @@ #ifndef __INTERNAL_DEBUG #define __INTERNAL_DEBUG -/* FIXME: should probably remove this later */ -#if !defined(CHECKED) && !defined(NDEBUG) -#define CHECKED -#endif - /* Define DbgPrint/DbgPrintEx/RtlAssert unless the NDK is used */ #if !defined(_RTLFUNCS_H) && (!defined(_NTDDK_) || !defined(__NTDDK_H)) @@ -87,13 +82,11 @@ RtlAssert( /* These are always printed */ #define DPRINT1 DbgPrint("(%s:%d) ",__FILE__,__LINE__), DbgPrint - #define CHECKPOINT1 do { DbgPrint("%s:%d\n",__FILE__,__LINE__); } while(0); /* These are printed only if NDEBUG is NOT defined */ #ifndef NDEBUG #define DPRINT DbgPrint("(%s:%d) ",__FILE__,__LINE__), DbgPrint - #define CHECKPOINT do { DbgPrint("%s:%d\n",__FILE__,__LINE__); } while(0); #else #ifdef _MSC_VER @@ -104,7 +97,6 @@ RtlAssert( #else #define DPRINT(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0) #endif - #define CHECKPOINT #endif #define UNIMPLEMENTED DbgPrint("WARNING: %s at %s:%d is UNIMPLEMENTED!\n",__FUNCTION__,__FILE__,__LINE__); @@ -122,8 +114,6 @@ RtlAssert( #define DPRINT1(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0) #define DPRINT(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0) - #define CHECKPOINT1 - #define CHECKPOINT #define UNIMPLEMENTED #define ERR_(ch, ...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0) @@ -132,17 +122,8 @@ RtlAssert( #define INFO_(ch, ...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0) #endif -/* - * FUNCTION: Assert a maximum value for the current irql - * ARGUMENTS: - * x = Maximum irql - */ -#define ASSERT_IRQL(x) assert(KeGetCurrentIrql()<=(x)) -#define assert_irql(x) assert(KeGetCurrentIrql()<=(x)) - -#ifndef KEBUGCHECK -#define KEBUGCHECK(a) DbgPrint("KeBugCheck (0x%X) at %s:%i\n", a, __FILE__,__LINE__), KeBugCheck(a) -#define KEBUGCHECKEX(a,b,c,d,e) DbgPrint("KeBugCheckEx (0x%X, 0x%X, 0x%X, 0x%X, 0x%X) at %s:%i\n", a, b, c, d, e, __FILE__,__LINE__), KeBugCheckEx(a,b,c,d,e) -#endif +#define ASSERT_IRQL_LESS_OR_EQUAL(x) ASSERT(KeGetCurrentIrql()<=(x)) +#define ASSERT_IRQL_EQUAL(x) ASSERT(KeGetCurrentIrql()==(x)) +#define ASSERT_IRQL_LESS(x) ASSERT(KeGetCurrentIrql()<(x)) #endif /* __INTERNAL_DEBUG */ diff --git a/reactos/include/reactos/helper.h b/reactos/include/reactos/helper.h index f3fdd7f9be4..1bb7a52cfe4 100644 --- a/reactos/include/reactos/helper.h +++ b/reactos/include/reactos/helper.h @@ -27,15 +27,6 @@ #define PAGE_ROUND_UP(x) ( (((ULONG_PTR)(x)) + PAGE_SIZE-1) & (~(PAGE_SIZE-1)) ) #endif -#define ABS_VALUE(V) (((V) < 0) ? -(V) : (V)) - -#define RtlRosMin3(X,Y,Z) (((X) < (Y)) ? RtlRosMin(X,Z) : RtlRosMin(Y,Z)) - -#ifndef KEBUGCHECK -#define KEBUGCHECKEX(a,b,c,d,e) DbgPrint("KeBugCheckEx at %s:%i\n",__FILE__,__LINE__), KeBugCheckEx(a,b,c,d,e) -#define KEBUGCHECK(a) DbgPrint("KeBugCheck at %s:%i\n",__FILE__,__LINE__), KeBugCheck(a) -#endif - /* iterate through the list using a list entry. * elem is set to NULL if the list is run thru without breaking out or if list is empty. */ diff --git a/reactos/include/reactos/idl/svcctl.idl b/reactos/include/reactos/idl/svcctl.idl index 761ecc135a1..2f737a5a489 100644 --- a/reactos/include/reactos/idl/svcctl.idl +++ b/reactos/include/reactos/idl/svcctl.idl @@ -578,7 +578,8 @@ interface svcctl DWORD RQueryServiceConfigA( [in] handle_t BindingHandle, [in] SC_RPC_HANDLE hService, - [out] LPQUERY_SERVICE_CONFIGA lpServiceConfig, + [out, unique, size_is(cbBufSize)] LPBYTE lpServiceConfig, + /* FIXME: should be [out] LPQUERY_SERVICE_CONFIGA lpServiceConfig, */ [in, range(0, 1024*8)] DWORD cbBufSize, [out] LPBOUNDED_DWORD_8K pcbBytesNeeded); diff --git a/reactos/include/reactos/kddll.h b/reactos/include/reactos/kddll.h index 6790fee0d5c..85916327adb 100644 --- a/reactos/include/reactos/kddll.h +++ b/reactos/include/reactos/kddll.h @@ -51,4 +51,16 @@ KdSendPacket( IN OUT PKD_CONTEXT Context ); +NTSTATUS +NTAPI +KdD0Transition( + VOID +); + +NTSTATUS +NTAPI +KdD3Transition( + VOID +); + #endif diff --git a/reactos/include/reactos/libs/pseh/framebased.h b/reactos/include/reactos/libs/pseh/framebased.h index dde90f1522c..08245deeb77 100644 --- a/reactos/include/reactos/libs/pseh/framebased.h +++ b/reactos/include/reactos/libs/pseh/framebased.h @@ -154,6 +154,7 @@ static _SEHPortableTryLevel_t * const _SEHPortableTryLevel = 0; _SEHHandlers.SH_Finally = (FINALLY_); #endif +#define _SEH_SetExceptionCode(CODE_) (_SEHPortableFrame->SPF_Code = (CODE_)) #define _SEH_GetExceptionCode() (unsigned long)(_SEHPortableFrame->SPF_Code) #define _SEH_GetExceptionPointers() \ diff --git a/reactos/include/reactos/mc/bugcodes.mc b/reactos/include/reactos/mc/bugcodes.mc index 0a45c74956d..b3f8dac9cb1 100644 --- a/reactos/include/reactos/mc/bugcodes.mc +++ b/reactos/include/reactos/mc/bugcodes.mc @@ -1097,6 +1097,14 @@ Language=English PP1_INITIALIZATION_FAILED . +MessageId=0x93 +Severity=Success +Facility=System +SymbolicName=INVALID_KERNEL_HANDLE +Language=English +INVALID_KERNEL_HANDLE +. + MessageId=0x94 Severity=Success Facility=System @@ -1389,6 +1397,14 @@ Language=English MultiProcessor Kernel . +MessageId=0x8A +Severity=Informational +Facility=System +SymbolicName=THREAD_TERMINATE_HELD_MUTEX +Language=English +A kernel thread terminated while holding a mutex +. + MessageId=0x9D Severity=Informational Facility=System diff --git a/reactos/include/reactos/win32k/ntgdihdl.h b/reactos/include/reactos/win32k/ntgdihdl.h index e38622c3635..f30b0c397d8 100644 --- a/reactos/include/reactos/win32k/ntgdihdl.h +++ b/reactos/include/reactos/win32k/ntgdihdl.h @@ -290,13 +290,13 @@ typedef struct _DC_ATTR LONG lBreakExtra; LONG cBreak; HANDLE hlfntNew; - MATRIX_S mxWorldToDevice; - MATRIX_S mxDeviceToWorld; - MATRIX_S mxWorldToPage; - EFLOAT_S efM11PtoD; - EFLOAT_S efM22PtoD; - EFLOAT_S efDxPtoD; - EFLOAT_S efDyPtoD; + MATRIX mxWorldToDevice; + MATRIX mxDeviceToWorld; + MATRIX mxWorldToPage; + FLOATOBJ efM11PtoD; + FLOATOBJ efM22PtoD; + FLOATOBJ efDxPtoD; + FLOATOBJ efDyPtoD; INT iMapMode; DWORD dwLayout; LONG lWindowOrgx; diff --git a/reactos/include/reactos/wine/winuser.h b/reactos/include/reactos/wine/winuser.h index 49ac94f2023..9d11b5cb047 100644 --- a/reactos/include/reactos/wine/winuser.h +++ b/reactos/include/reactos/wine/winuser.h @@ -8,7 +8,7 @@ #include #if !defined(_MSC_VER) -#include "../../psdk/winuser.h" +#include_next "winuser.h" #endif #define WS_EX_TRAYWINDOW 0x80000000L @@ -16,13 +16,15 @@ #define WS_EX_MANAGED 0x40000000L /* Window managed by the window system */ #define LB_CARETOFF 0x01a4 -UINT WINAPI PrivateExtractIconsA(LPCSTR,int,int,int,HICON*,UINT*,UINT,UINT); -UINT WINAPI PrivateExtractIconsW(LPCWSTR,int,int,int,HICON*,UINT*,UINT,UINT); +WINUSERAPI UINT WINAPI PrivateExtractIconsA(LPCSTR,int,int,int,HICON*,UINT*,UINT,UINT); +WINUSERAPI UINT WINAPI PrivateExtractIconsW(LPCWSTR,int,int,int,HICON*,UINT*,UINT,UINT); typedef struct tagCWPSTRUCT *LPCWPSTRUCT; #define WM_ALTTABACTIVE 0x0029 +#define UNICODE_NOCHAR 0xFFFF + #ifndef E_PROP_ID_UNSUPPORTED #define E_PROP_ID_UNSUPPORTED ((HRESULT)0x80070490) #endif @@ -31,12 +33,13 @@ typedef struct tagCWPSTRUCT *LPCWPSTRUCT; #endif /* MapVirtualKey translation types */ +#if 0 #define MAPVK_VK_TO_VSC 0 #define MAPVK_VSC_TO_VK 1 #define MAPVK_VK_TO_CHAR 2 #define MAPVK_VSC_TO_VK_EX 3 #define MAPVK_VK_TO_VSC_EX 4 - +#endif #define WM_SETVISIBLE 0x0009 #define MAKEINTATOMA(atom) ((LPCSTR)((ULONG_PTR)((WORD)(atom)))) diff --git a/reactos/lib/cmlib/cminit.c b/reactos/lib/cmlib/cminit.c index 7c3f7ddf838..80f2893cf4f 100644 --- a/reactos/lib/cmlib/cminit.c +++ b/reactos/lib/cmlib/cminit.c @@ -6,6 +6,8 @@ */ #include "cmlib.h" +#define NDEBUG +#include ULONG CmlibTraceLevel = 0; @@ -95,7 +97,7 @@ CmpPrepareIndexOfKeys( } else { - DbgPrint("IndexCell->Signature %x\n", IndexCell->Signature); + DPRINT1("IndexCell->Signature %x\n", IndexCell->Signature); ASSERT(FALSE); } } diff --git a/reactos/lib/cmlib/cmlib.h b/reactos/lib/cmlib/cmlib.h index 66a5ffa44c6..ff780d166b1 100644 --- a/reactos/lib/cmlib/cmlib.h +++ b/reactos/lib/cmlib/cmlib.h @@ -8,6 +8,11 @@ #ifndef CMLIB_H #define CMLIB_H +// +// Debug support switch +// +#define _CMLIB_DEBUG_ 1 + #ifdef CMLIB_HOST #include #include @@ -23,82 +28,76 @@ #define STATUS_NOT_REGISTRY_FILE ((NTSTATUS)0xC000015C) #define STATUS_REGISTRY_RECOVERED ((NTSTATUS)0x40000009) + #define REG_OPTION_VOLATILE 1 + #define OBJ_CASE_INSENSITIVE 0x00000040L + #define USHORT_MAX USHRT_MAX + + VOID NTAPI + KeQuerySystemTime( + OUT PLARGE_INTEGER CurrentTime); + + VOID NTAPI + RtlInitializeBitMap( + IN PRTL_BITMAP BitMapHeader, + IN PULONG BitMapBuffer, + IN ULONG SizeOfBitMap); + + ULONG NTAPI + RtlFindSetBits( + IN PRTL_BITMAP BitMapHeader, + IN ULONG NumberToFind, + IN ULONG HintIndex); + + VOID NTAPI + RtlSetBits( + IN PRTL_BITMAP BitMapHeader, + IN ULONG StartingIndex, + IN ULONG NumberToSet); + + VOID NTAPI + RtlClearAllBits( + IN PRTL_BITMAP BitMapHeader); + + #define RtlCheckBit(BMH,BP) (((((PLONG)(BMH)->Buffer)[(BP) / 32]) >> ((BP) % 32)) & 0x1) + + #define PKTHREAD PVOID + #define PKGUARDED_MUTEX PVOID + #define PERESOURCE PVOID + #define PFILE_OBJECT PVOID + #define PKEVENT PVOID + #define PWORK_QUEUE_ITEM PVOID + #define EX_PUSH_LOCK PULONG_PTR + /* For */ #define USE_HOST_WCSFUNCS + + #define CMLTRACE(x, ...) +#else + // + // Debug/Tracing support + // + #if _CMLIB_DEBUG_ + #ifdef NEW_DEBUG_SYSTEM_IMPLEMENTED // enable when Debug Filters are implemented + #define CMLTRACE DbgPrintEx + #else + #define CMLTRACE(x, ...) \ + if (x & CmlibTraceLevel) DbgPrint(__VA_ARGS__) + #endif + #else + #define CMLTRACE(x, ...) DPRINT(__VA_ARGS__) + #endif + + + #include #endif #include -// -// Debug support switch -// -#define _CMLIB_DEBUG_ 1 - // // These define the Debug Masks Supported // #define CMLIB_HCELL_DEBUG 0x01 -// -// Debug/Tracing support -// -#if _CMLIB_DEBUG_ -#ifdef NEW_DEBUG_SYSTEM_IMPLEMENTED // enable when Debug Filters are implemented -#define CMLTRACE DbgPrintEx -#else -#define CMLTRACE(x, ...) \ - if (x & CmlibTraceLevel) DbgPrint(__VA_ARGS__) -#endif -#else -#define CMLTRACE(x, ...) DPRINT(__VA_ARGS__) -#endif - -#ifndef _TYPEDEFS_HOST_H - #include - -#else - #define REG_OPTION_VOLATILE 1 - #define OBJ_CASE_INSENSITIVE 0x00000040L - #define USHORT_MAX USHRT_MAX - -VOID NTAPI -KeQuerySystemTime( - OUT PLARGE_INTEGER CurrentTime); - -VOID NTAPI -RtlInitializeBitMap( - IN PRTL_BITMAP BitMapHeader, - IN PULONG BitMapBuffer, - IN ULONG SizeOfBitMap); - -ULONG NTAPI -RtlFindSetBits( - IN PRTL_BITMAP BitMapHeader, - IN ULONG NumberToFind, - IN ULONG HintIndex); - -VOID NTAPI -RtlSetBits( - IN PRTL_BITMAP BitMapHeader, - IN ULONG StartingIndex, - IN ULONG NumberToSet); - -VOID NTAPI -RtlClearAllBits( - IN PRTL_BITMAP BitMapHeader); - -#define RtlCheckBit(BMH,BP) (((((PLONG)(BMH)->Buffer)[(BP) / 32]) >> ((BP) % 32)) & 0x1) - -#define PKTHREAD PVOID -#define PKGUARDED_MUTEX PVOID -#define PERESOURCE PVOID -#define PFILE_OBJECT PVOID -#define PKEVENT PVOID -#define PWORK_QUEUE_ITEM PVOID -#define EX_PUSH_LOCK PULONG_PTR - -#endif - #ifndef ROUND_UP #define ROUND_UP(a,b) ((((a)+(b)-1)/(b))*(b)) #define ROUND_DOWN(a,b) (((a)/(b))*(b)) diff --git a/reactos/lib/cmlib/cmlib.rbuild b/reactos/lib/cmlib/cmlib.rbuild index ea4f4d1adcb..61392ce730c 100644 --- a/reactos/lib/cmlib/cmlib.rbuild +++ b/reactos/lib/cmlib/cmlib.rbuild @@ -14,7 +14,7 @@ hivesum.c hivewrt.c - + . include/reactos include diff --git a/reactos/lib/cmlib/hiveinit.c b/reactos/lib/cmlib/hiveinit.c index 48950bdf847..8dea06a6f46 100644 --- a/reactos/lib/cmlib/hiveinit.c +++ b/reactos/lib/cmlib/hiveinit.c @@ -498,10 +498,7 @@ HvInitialize( } if (!NT_SUCCESS(Status)) - { - Hive->Free(Hive, 0); return Status; - } if (Operation != HINIT_CREATE) CmPrepareHive(Hive); diff --git a/reactos/lib/drivers/ip/network/arp.c b/reactos/lib/drivers/ip/network/arp.c index 1ac2d5baaef..5c830589ca8 100644 --- a/reactos/lib/drivers/ip/network/arp.c +++ b/reactos/lib/drivers/ip/network/arp.c @@ -150,6 +150,8 @@ BOOLEAN ARPTransmit(PIP_ADDRESS Address, PIP_INTERFACE Interface) &Address->Address, /* Target's (remote) protocol address */ ARP_OPCODE_REQUEST); /* ARP request */ + if( !NdisPacket ) return FALSE; + ASSERT_KM_POINTER(NdisPacket); ASSERT_KM_POINTER(PC(NdisPacket)); PC(NdisPacket)->DLComplete = ARPTransmitComplete; diff --git a/reactos/lib/drivers/ip/transport/datagram/datagram.c b/reactos/lib/drivers/ip/transport/datagram/datagram.c index c26c56b3eef..0b701338075 100644 --- a/reactos/lib/drivers/ip/transport/datagram/datagram.c +++ b/reactos/lib/drivers/ip/transport/datagram/datagram.c @@ -177,6 +177,7 @@ VOID DGDeliverData( } else { + TcpipReleaseSpinLock(&AddrFile->Lock, OldIrql); TI_DbgPrint(MAX_TRACE, ("Discarding datagram.\n")); } diff --git a/reactos/lib/drivers/ip/transport/rawip/rawip.c b/reactos/lib/drivers/ip/transport/rawip/rawip.c index 5422b17d131..90f0ac7b775 100644 --- a/reactos/lib/drivers/ip/transport/rawip/rawip.c +++ b/reactos/lib/drivers/ip/transport/rawip/rawip.c @@ -143,6 +143,13 @@ NTSTATUS BuildRawIpPacket( break; } + if( !NT_SUCCESS(Status) ) { + TI_DbgPrint(MIN_TRACE, ("Cannot add header. Status = (0x%X)\n", + Status)); + FreeNdisPacket(Packet->NdisPacket); + return Status; + } + TI_DbgPrint(MID_TRACE, ("Copying data (hdr %x data %x (%d))\n", Packet->Header, Packet->Data, (PCHAR)Packet->Data - (PCHAR)Packet->Header)); diff --git a/reactos/lib/drivers/ip/transport/tcp/if.c b/reactos/lib/drivers/ip/transport/tcp/if.c index 9821d367dfe..225215e31f7 100644 --- a/reactos/lib/drivers/ip/transport/tcp/if.c +++ b/reactos/lib/drivers/ip/transport/tcp/if.c @@ -34,9 +34,9 @@ PVOID TCPPrepareInterface( PIP_INTERFACE IF ) { NTSTATUS Status; POSK_IFADDR ifaddr = exAllocatePool ( NonPagedPool, sizeof(*ifaddr) + 2 * sizeof( struct sockaddr_in ) ); + if( !ifaddr ) return NULL; struct sockaddr_in *addr_in = (struct sockaddr_in *)&ifaddr[1]; struct sockaddr_in *dstaddr_in = (struct sockaddr_in *)&addr_in[1]; - if( !ifaddr ) return NULL; TI_DbgPrint(DEBUG_TCPIF,("Called\n")); diff --git a/reactos/lib/drivers/ip/transport/tcp/tcp.c b/reactos/lib/drivers/ip/transport/tcp/tcp.c index 86dcb16727f..c6657fd0407 100644 --- a/reactos/lib/drivers/ip/transport/tcp/tcp.c +++ b/reactos/lib/drivers/ip/transport/tcp/tcp.c @@ -89,8 +89,10 @@ static VOID HandleSignalledConnection( PCONNECTION_ENDPOINT Connection, if( Status == STATUS_PENDING ) { InsertHeadList( &Connection->ListenRequest, &Bucket->Entry ); break; - } else + } else { Complete( Bucket->Request.RequestContext, Status, 0 ); + PoolFreeBuffer( Bucket ); + } } } @@ -141,6 +143,7 @@ static VOID HandleSignalledConnection( PCONNECTION_ENDPOINT Connection, Complete( Bucket->Request.RequestContext, STATUS_SUCCESS, Received ); + PoolFreeBuffer( Bucket ); } else if( Status == STATUS_PENDING ) { InsertHeadList ( &Connection->ReceiveRequest, &Bucket->Entry ); @@ -150,6 +153,7 @@ static VOID HandleSignalledConnection( PCONNECTION_ENDPOINT Connection, ("Completing Receive request: %x %x\n", Bucket->Request, Status)); Complete( Bucket->Request.RequestContext, Status, 0 ); + PoolFreeBuffer( Bucket ); } } } @@ -198,6 +202,7 @@ static VOID HandleSignalledConnection( PCONNECTION_ENDPOINT Connection, Complete( Bucket->Request.RequestContext, STATUS_SUCCESS, Sent ); + PoolFreeBuffer( Bucket ); } else if( Status == STATUS_PENDING ) { InsertHeadList ( &Connection->SendRequest, &Bucket->Entry ); @@ -207,6 +212,7 @@ static VOID HandleSignalledConnection( PCONNECTION_ENDPOINT Connection, ("Completing Send request: %x %x\n", Bucket->Request, Status)); Complete( Bucket->Request.RequestContext, Status, 0 ); + PoolFreeBuffer( Bucket ); } } } @@ -225,13 +231,15 @@ static VOID HandleSignalledConnection( PCONNECTION_ENDPOINT Connection, ListsToErase[2] = &Connection->ConnectRequest; IrpStatus [2] = STATUS_UNSUCCESSFUL; ListsToErase[3] = 0; + IrpStatus [3] = 0; for( i = 0; ListsToErase[i]; i++ ) { while( !IsListEmpty( ListsToErase[i] ) ) { Entry = RemoveHeadList( ListsToErase[i] ); Bucket = CONTAINING_RECORD( Entry, TDI_BUCKET, Entry ); Complete = Bucket->Request.RequestNotifyObject; - Complete( Bucket->Request.RequestContext, STATUS_SUCCESS, 0 ); + Complete( Bucket->Request.RequestContext, IrpStatus[i], 0 ); + PoolFreeBuffer( Bucket ); } } } @@ -584,10 +592,7 @@ NTSTATUS TCPConnect TcpipRecursiveMutexLeave( &TCPLock ); - if( Status == OSK_EINPROGRESS ) - return STATUS_PENDING; - else - return Status; + return Status; } NTSTATUS TCPDisconnect @@ -836,6 +841,7 @@ VOID TCPRemoveIRP( PCONNECTION_ENDPOINT Endpoint, PIRP Irp ) { if( Bucket->Request.RequestContext == Irp ) { RemoveEntryList( &Bucket->Entry ); + PoolFreeBuffer( Bucket ); break; } } diff --git a/reactos/lib/drivers/ip/transport/udp/udp.c b/reactos/lib/drivers/ip/transport/udp/udp.c index 07561d44036..1dba3035179 100644 --- a/reactos/lib/drivers/ip/transport/udp/udp.c +++ b/reactos/lib/drivers/ip/transport/udp/udp.c @@ -330,6 +330,8 @@ NTSTATUS UDPShutdown( /* Deregister this protocol with IP layer */ IPRegisterProtocol(IPPROTO_UDP, NULL); + UDPInitialized = FALSE; + return STATUS_SUCCESS; } diff --git a/reactos/lib/drivers/oskittcp/include/freebsd/src/sys/sys/types.h b/reactos/lib/drivers/oskittcp/include/freebsd/src/sys/sys/types.h index e99d820fb47..e55825568ae 100644 --- a/reactos/lib/drivers/oskittcp/include/freebsd/src/sys/sys/types.h +++ b/reactos/lib/drivers/oskittcp/include/freebsd/src/sys/sys/types.h @@ -126,6 +126,7 @@ typedef _BSD_SIZE_T_ size_t; #ifdef _BSD_SSIZE_T_ typedef _BSD_SSIZE_T_ ssize_t; +#define _SSIZE_T_DEFINED #undef _BSD_SSIZE_T_ #endif diff --git a/reactos/lib/drivers/oskittcp/oskittcp/tcp_subr.c b/reactos/lib/drivers/oskittcp/oskittcp/tcp_subr.c index 4632b688ef1..e3557eea13e 100644 --- a/reactos/lib/drivers/oskittcp/oskittcp/tcp_subr.c +++ b/reactos/lib/drivers/oskittcp/oskittcp/tcp_subr.c @@ -163,6 +163,7 @@ tcp_respond(tp, ti, m, ack, seq, flags) tcp_seq ack, seq; int flags; { + struct mbuf *n; register int tlen; int win = 0; struct route *ro = 0; @@ -221,6 +222,18 @@ tcp_respond(tp, ti, m, ack, seq, flags) tcp_trace(TA_OUTPUT, 0, tp, ti, 0); #endif (void) ip_output(m, NULL, ro, 0, NULL); +#ifdef __REACTOS__ + /* We allocated m, so we are responsible for freeing it. If the mbuf + contains a pointer to an external datablock, we (or rather, m_copy) + didn't allocate it but pointed it to the data to send. So we have + to cheat a little bit and keep M_FREE from freeing the external + data block */ + while (NULL != m) { + m->m_flags &= ~M_EXT; + MFREE(m, n); + m = n; + } +#endif } /* diff --git a/reactos/lib/fslib/ext2lib/Mke2fs.c b/reactos/lib/fslib/ext2lib/Mke2fs.c index b7527913529..3038f8c002c 100644 --- a/reactos/lib/fslib/ext2lib/Mke2fs.c +++ b/reactos/lib/fslib/ext2lib/Mke2fs.c @@ -813,17 +813,14 @@ Ext2Format( EXT2_FILESYS FileSys; ULONG Percent; - CHECKPOINT; Callback(PROGRESS, 0, (PVOID)&Percent); - CHECKPOINT; RtlZeroMemory(&Ext2Sb, sizeof(EXT2_SUPER_BLOCK)); RtlZeroMemory(&FileSys, sizeof(EXT2_FILESYS)); FileSys.ext2_sb = &Ext2Sb; - CHECKPOINT; if (!NT_SUCCESS(Ext2OpenDevice(&FileSys, DriveRoot))) { @@ -831,7 +828,6 @@ Ext2Format( goto clean_up; } - CHECKPOINT; if (!NT_SUCCESS(Ext2GetMediaInfo(&FileSys))) { @@ -844,7 +840,6 @@ Ext2Format( Ext2Sb.s_blocks_count = FileSys.PartInfo.PartitionLength.QuadPart / EXT2_BLOCK_SIZE(&Ext2Sb); - CHECKPOINT; /* * Calculate number of inodes based on the inode ratio @@ -857,7 +852,6 @@ Ext2Format( */ Ext2Sb.s_r_blocks_count = (Ext2Sb.s_blocks_count * 5) / 100; - CHECKPOINT; Status = Ext2LockVolume(&FileSys); if (NT_SUCCESS(Status)) @@ -865,7 +859,6 @@ Ext2Format( bLocked = TRUE; } - CHECKPOINT; // Initialize if (!ext2_initialize_sb(&FileSys)) @@ -874,7 +867,6 @@ Ext2Format( goto clean_up; } - CHECKPOINT; zap_sector(&FileSys, 2, 6); @@ -999,13 +991,9 @@ clean_up: } } - CHECKPOINT; Ext2CloseDevice(&FileSys); - CHECKPOINT; - CHECKPOINT; Callback(DONE, 0, (PVOID)&bRet); - CHECKPOINT; return Status; } diff --git a/reactos/lib/fslib/vfatlib/check/fat.c b/reactos/lib/fslib/vfatlib/check/fat.c index 7e2ad9c1d62..e5a5504232f 100644 --- a/reactos/lib/fslib/vfatlib/check/fat.c +++ b/reactos/lib/fslib/vfatlib/check/fat.c @@ -66,6 +66,8 @@ void read_fat(DOS_FS *fs) second = NULL; if (second && memcmp(first,second,eff_size) != 0) { FAT_ENTRY first_media, second_media; + memset (&first_media, 0, sizeof (first_media)); + memset (&second_media, 0, sizeof (second_media)); get_fat(&first_media,first,0,fs); get_fat(&second_media,second,0,fs); first_ok = (first_media.value & FAT_EXTD(fs)) == FAT_EXTD(fs); diff --git a/reactos/lib/fslib/vfatlib/check/io.c b/reactos/lib/fslib/vfatlib/check/io.c index cea6654d56e..7899134d935 100644 --- a/reactos/lib/fslib/vfatlib/check/io.c +++ b/reactos/lib/fslib/vfatlib/check/io.c @@ -72,51 +72,25 @@ void fs_open(PUNICODE_STRING DriveRoot,int rw) return; } + // If rw is specified, then the volume should be exclusively locked + if (rw) fs_lock(TRUE); + + // Query geometry and partition info, to have bytes per sector, etc + CurrentOffset.QuadPart = 0LL; changes = last = NULL; did_change = 0; } -BOOLEAN fs_isdirty(PUNICODE_STRING DriveRoot) +BOOLEAN fs_isdirty() { - OBJECT_ATTRIBUTES ObjectAttributes; ULONG DirtyMask = 0; - WCHAR TempRootBuf[128]; - UNICODE_STRING TempRoot; - HANDLE FileSystem; - IO_STATUS_BLOCK IoSb; NTSTATUS Status; - - /* Add backslash to the end, so FS will be opened */ - TempRoot.Length = 0; - TempRoot.MaximumLength = sizeof(TempRootBuf); - TempRoot.Buffer = TempRootBuf; - RtlCopyUnicodeString(&TempRoot, DriveRoot); - if (TempRoot.Length == (TempRoot.MaximumLength-1)) return FALSE; - wcscat(TempRoot.Buffer, L"\\"); - TempRoot.Length += sizeof(WCHAR); - - InitializeObjectAttributes(&ObjectAttributes, - &TempRoot, - 0, - NULL, - NULL); - - Status = NtOpenFile(&FileSystem, - FILE_GENERIC_READ, - &ObjectAttributes, - &IoSb, - 0, - 0); - if (!NT_SUCCESS(Status)) - { - DPRINT1("NtOpenFile() failed with status 0x%.08x\n", Status); - return FALSE; - } + IO_STATUS_BLOCK IoSb; /* Check if volume is dirty */ - Status = NtFsControlFile(FileSystem, + Status = NtFsControlFile(fd, NULL, NULL, NULL, &IoSb, FSCTL_IS_VOLUME_DIRTY, NULL, 0, &DirtyMask, sizeof(DirtyMask)); @@ -124,17 +98,49 @@ BOOLEAN fs_isdirty(PUNICODE_STRING DriveRoot) if (!NT_SUCCESS(Status)) { DPRINT1("NtFsControlFile() failed with Status 0x%08x\n", Status); - /* Close FS handle */ - NtClose(FileSystem); return FALSE; } - /* Close FS handle */ - NtClose(FileSystem); - + /* Convert Dirty mask to a boolean value */ return (DirtyMask & 1); } +NTSTATUS fs_lock(BOOLEAN LockVolume) +{ + NTSTATUS Status; + IO_STATUS_BLOCK IoSb; + + /* Check if volume is dirty */ + Status = NtFsControlFile(fd, + NULL, NULL, NULL, &IoSb, + LockVolume ? FSCTL_LOCK_VOLUME : + FSCTL_UNLOCK_VOLUME, + NULL, 0, NULL, 0); + + if (!NT_SUCCESS(Status)) + { + DPRINT1("NtFsControlFile() failed with Status 0x%08x\n", Status); + } + + return Status; +} + +void fs_dismount() +{ + NTSTATUS Status; + IO_STATUS_BLOCK IoSb; + + /* Check if volume is dirty */ + Status = NtFsControlFile(fd, + NULL, NULL, NULL, &IoSb, + FSCTL_DISMOUNT_VOLUME, + NULL, 0, NULL, 0); + + if (!NT_SUCCESS(Status)) + { + DPRINT1("NtFsControlFile() failed with Status 0x%08x\n", Status); + } +} void fs_read(loff_t pos,int size,void *data) { diff --git a/reactos/lib/fslib/vfatlib/check/io.h b/reactos/lib/fslib/vfatlib/check/io.h index 6c6675f0f9b..7b23462f515 100644 --- a/reactos/lib/fslib/vfatlib/check/io.h +++ b/reactos/lib/fslib/vfatlib/check/io.h @@ -21,7 +21,7 @@ void fs_open(PUNICODE_STRING DriveRoot,int rw); /* Opens the file system PATH. If RW is zero, the file system is opened read-only, otherwise, it is opened read-write. */ -BOOLEAN fs_isdirty(PUNICODE_STRING DriveRoot); +BOOLEAN fs_isdirty(); /* Checks if filesystem is dirty */ @@ -51,6 +51,14 @@ int fs_changed(void); /* Determines whether the file system has changed. See fs_close. */ +NTSTATUS fs_lock(BOOLEAN LockVolume); + +/* Lock or unlocks the volume */ + +void fs_dismount(); + +/* Dismounts the volume */ + extern unsigned device_no; /* Major number of device (0 if file) and size (in 512 byte sectors) */ diff --git a/reactos/lib/fslib/vfatlib/vfatlib.c b/reactos/lib/fslib/vfatlib/vfatlib.c index bbe72705429..02f1d9b1447 100755 --- a/reactos/lib/fslib/vfatlib/vfatlib.c +++ b/reactos/lib/fslib/vfatlib/vfatlib.c @@ -256,7 +256,7 @@ VfatChkdsk( /* Open filesystem */ fs_open(DriveRoot,FixErrors); - if (CheckOnlyIfDirty && !fs_isdirty(DriveRoot)) + if (CheckOnlyIfDirty && !fs_isdirty()) { /* No need to check FS */ return fs_close(FALSE); @@ -300,6 +300,16 @@ VfatChkdsk( VfatPrint("%wZ: %u files, %lu/%lu clusters\n", DriveRoot, FsCheckTotalFiles, fs.clusters - free_clusters, fs.clusters ); + if (FixErrors) + { + /* Dismount the volume */ + fs_dismount(); + + /* Unlock the volume */ + fs_lock(FALSE); + } + + /* Close the volume */ return fs_close(FixErrors) ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL; #else return STATUS_SUCCESS; diff --git a/reactos/lib/recyclebin/recyclebin_v5.c b/reactos/lib/recyclebin/recyclebin_v5.c index 6f7e4b69dd5..3090055cdbe 100644 --- a/reactos/lib/recyclebin/recyclebin_v5.c +++ b/reactos/lib/recyclebin/recyclebin_v5.c @@ -472,6 +472,7 @@ RecycleBin5_RecycleBin5_Restore( PINFO2_HEADER pHeader; DELETED_FILE_RECORD *pRecord, *pLast; DWORD dwEntries, i; + SHFILEOPSTRUCTW op; TRACE("(%p, %s, %p)\n", This, debugstr_w(pDeletedFileName), pDeletedFile); @@ -496,7 +497,12 @@ RecycleBin5_RecycleBin5_Restore( if (pRecord->dwRecordUniqueId == pDeletedFile->dwRecordUniqueId) { /* Restore file */ - if (!MoveFileW(pDeletedFileName, pDeletedFile->FileNameW)) + ZeroMemory(&op, sizeof(op)); + op.wFunc = FO_COPY; + op.pFrom = pDeletedFileName; + op.pTo = pDeletedFile->FileNameW; + + if (!SHFileOperationW(&op)) { UnmapViewOfFile(pHeader); return HRESULT_FROM_WIN32(GetLastError()); diff --git a/reactos/lib/rtl/debug.c b/reactos/lib/rtl/debug.c index 5993cd02e8e..bfde2e0f2f3 100644 --- a/reactos/lib/rtl/debug.c +++ b/reactos/lib/rtl/debug.c @@ -54,51 +54,46 @@ vDbgPrintExWithPrefixInternal(IN LPCSTR Prefix, IN va_list ap, IN BOOLEAN HandleBreakpoint) { - NTSTATUS Status; + NTSTATUS Status = STATUS_SUCCESS; ANSI_STRING DebugString; CHAR Buffer[512]; - PCHAR pBuffer = Buffer; - ULONG pBufferSize = sizeof(Buffer); - ULONG Length; + ULONG Length, PrefixLength; EXCEPTION_RECORD ExceptionRecord; /* Check if we should print it or not */ - if (ComponentId != -1 && !NtQueryDebugFilterState(ComponentId, Level)) + if ((ComponentId != -1) && !(NtQueryDebugFilterState(ComponentId, Level))) { /* This message is masked */ - return STATUS_SUCCESS; + return Status; } /* For user mode, don't recursively DbgPrint */ - if (RtlpSetInDbgPrint(TRUE)) return STATUS_SUCCESS; + if (RtlpSetInDbgPrint(TRUE)) return Status; - /* Initialize the length to 8 */ - DebugString.Length = 0; - - /* Handle the prefix */ - if (Prefix && *Prefix) + /* Guard against incorrect pointers */ + _SEH_TRY { - /* Get the length */ - DebugString.Length = strlen(Prefix); - - /* Normalize it */ - if(DebugString.Length > sizeof(Buffer)) - { - DebugString.Length = sizeof(Buffer); - } + /* Get the length and normalize it */ + PrefixLength = strlen(Prefix); + if (PrefixLength > sizeof(Buffer)) PrefixLength = sizeof(Buffer); /* Copy it */ - strncpy(Buffer, Prefix, DebugString.Length); - - /* Set the pointer and update the size */ - pBuffer = &Buffer[DebugString.Length]; - pBufferSize -= DebugString.Length; + strncpy(Buffer, Prefix, PrefixLength); + + /* Do the printf */ + Length = _vsnprintf(Buffer + PrefixLength, + sizeof(Buffer) - PrefixLength, + Format, + ap); } - - /* Setup the ANSI String */ - DebugString.Buffer = Buffer; - DebugString.MaximumLength = sizeof(Buffer); - Length = _vsnprintf(pBuffer, pBufferSize, Format, ap); + _SEH_HANDLE + { + /* Fail */ + Length = PrefixLength = 0; + Status = _SEH_GetExceptionCode(); + } + _SEH_END; + if (!NT_SUCCESS(Status)) return Status; /* Check if we went past the buffer */ if (Length == -1) @@ -109,9 +104,15 @@ vDbgPrintExWithPrefixInternal(IN LPCSTR Prefix, /* Put maximum */ Length = sizeof(Buffer); } - - /* Update length */ - DebugString.Length += (USHORT)Length; + else + { + /* Add the prefix */ + Length += PrefixLength; + } + + /* Build the string */ + DebugString.Length = Length; + DebugString.Buffer = Buffer; /* First, let the debugger know as well */ if (RtlpCheckForActiveDebugger(FALSE)) @@ -185,7 +186,7 @@ vDbgPrintEx(IN ULONG ComponentId, IN va_list ap) { /* Call the internal routine that also handles ControlC */ - return vDbgPrintExWithPrefixInternal(NULL, + return vDbgPrintExWithPrefixInternal("", ComponentId, Level, Format, @@ -205,7 +206,7 @@ DbgPrint(PCCH Format, /* Call the internal routine that also handles ControlC */ va_start(ap, Format); - return vDbgPrintExWithPrefixInternal(NULL, + return vDbgPrintExWithPrefixInternal("", -1, DPFLTR_ERROR_LEVEL, Format, @@ -228,7 +229,7 @@ DbgPrintEx(IN ULONG ComponentId, /* Call the internal routine that also handles ControlC */ va_start(ap, Format); - return vDbgPrintExWithPrefixInternal(NULL, + return vDbgPrintExWithPrefixInternal("", ComponentId, Level, Format, @@ -249,7 +250,7 @@ DbgPrintReturnControlC(PCH Format, /* Call the internal routine that also handles ControlC */ va_start(ap, Format); - return vDbgPrintExWithPrefixInternal(NULL, + return vDbgPrintExWithPrefixInternal("", -1, DPFLTR_ERROR_LEVEL, Format, diff --git a/reactos/lib/rtl/dos8dot3.c b/reactos/lib/rtl/dos8dot3.c index 76307b1d762..a4999ff9d0d 100644 --- a/reactos/lib/rtl/dos8dot3.c +++ b/reactos/lib/rtl/dos8dot3.c @@ -162,7 +162,6 @@ RtlGenerate8dot3Name(IN PUNICODE_STRING Name, (Checksum == Context->Checksum) && (Context->LastIndexValue < 999)) { - CHECKPOINT; Context->LastIndexValue++; if (Context->CheckSumInserted == FALSE && Context->LastIndexValue > 9) @@ -174,7 +173,6 @@ RtlGenerate8dot3Name(IN PUNICODE_STRING Name, } else { - CHECKPOINT; Context->LastIndexValue = 1; Context->CheckSumInserted = FALSE; } diff --git a/reactos/lib/rtl/env.c b/reactos/lib/rtl/env.c index cdce0379083..86a418ed6c7 100644 --- a/reactos/lib/rtl/env.c +++ b/reactos/lib/rtl/env.c @@ -282,6 +282,10 @@ RtlSetEnvironmentVariable(PWSTR *Environment, DPRINT("RtlSetEnvironmentVariable(Environment %p Name %wZ Value %wZ)\n", Environment, Name, Value); + /* Variable name must not be empty */ + if (Name->Length < sizeof(WCHAR)) + return STATUS_INVALID_PARAMETER; + /* Variable names can't contain a '=' except as a first character. */ for (wcs = Name->Buffer + 1; wcs < Name->Buffer + (Name->Length / sizeof(WCHAR)); @@ -351,7 +355,7 @@ RtlSetEnvironmentVariable(PWSTR *Environment, } found: - if (Value != NULL && Value->Length > 0) + if (Value != NULL) { hole_len = tail - hole; /* calculate new environment size */ diff --git a/reactos/lib/rtl/generictable.c b/reactos/lib/rtl/generictable.c index 508eea3f8f8..8f8c0ee91ed 100644 --- a/reactos/lib/rtl/generictable.c +++ b/reactos/lib/rtl/generictable.c @@ -57,7 +57,7 @@ RtlpFindGenericTableNodeOrParent(IN PRTL_GENERIC_TABLE Table, if ((ChildNode = RtlLeftChild(CurrentNode))) { /* Continue searching from this node */ - ChildNode = CurrentNode; + CurrentNode = ChildNode; } else { @@ -72,7 +72,7 @@ RtlpFindGenericTableNodeOrParent(IN PRTL_GENERIC_TABLE Table, if ((ChildNode = RtlRightChild(CurrentNode))) { /* Continue searching from this node */ - ChildNode = CurrentNode; + CurrentNode = ChildNode; } else { diff --git a/reactos/lib/sdk/crt/crt.rbuild b/reactos/lib/sdk/crt/crt.rbuild index 5d04ade62c4..17fa2c60ce7 100644 --- a/reactos/lib/sdk/crt/crt.rbuild +++ b/reactos/lib/sdk/crt/crt.rbuild @@ -100,6 +100,7 @@ cabs.c cosh.c div.c + fdivbug.c frexp.c huge_val.c hypot.c @@ -111,13 +112,13 @@ rand.c s_modf.c sinh.c - stubs.c tanh.c pow_asm.c atan2.c + ci.c exp.c fmod.c ldexp.c @@ -134,7 +135,9 @@ ldexp.c - + + stubs.c + diff --git a/reactos/lib/sdk/crt/except/i386/seh.s b/reactos/lib/sdk/crt/except/i386/seh.s index 96ec9951e9b..15a8cc5777a 100644 --- a/reactos/lib/sdk/crt/except/i386/seh.s +++ b/reactos/lib/sdk/crt/except/i386/seh.s @@ -438,31 +438,3 @@ except_return3: pop ebp ret .endfunc - -// -// -// REMOVE ME REMOVE ME REMOVE ME REMOVE ME REMOVE ME REMOVE ME REMOVE ME -// -// -.func RtlpGetStackLimits@8 -.globl _RtlpGetStackLimits@8 -_RtlpGetStackLimits@8: - - /* Get the current thread */ - mov eax, [fs:KPCR_CURRENT_THREAD] - - /* Get the stack limits */ - mov ecx, [eax+KTHREAD_STACK_LIMIT] - mov edx, [eax+KTHREAD_INITIAL_STACK] - sub edx, SIZEOF_FX_SAVE_AREA - - /* Return them */ - mov eax, [esp+4] - mov [eax], ecx - - mov eax, [esp+8] - mov [eax], edx - - /* return */ - ret 8 -.endfunc diff --git a/reactos/lib/sdk/crt/libcntpr.rbuild b/reactos/lib/sdk/crt/libcntpr.rbuild index 97d7d61175f..4884817f55a 100644 --- a/reactos/lib/sdk/crt/libcntpr.rbuild +++ b/reactos/lib/sdk/crt/libcntpr.rbuild @@ -41,6 +41,7 @@ aulldvrm_asm.s aullrem_asm.s aullshr_asm.s + ci.c ceil_asm.s cos_asm.s fabs_asm.s diff --git a/reactos/lib/sdk/crt/math/fdivbug.c b/reactos/lib/sdk/crt/math/fdivbug.c new file mode 100644 index 00000000000..d790eefc9a4 --- /dev/null +++ b/reactos/lib/sdk/crt/math/fdivbug.c @@ -0,0 +1,89 @@ +#include +#include + +/* The following functions are likely workarounds for the pentium fdiv bug */ +void __stdcall _adj_fdiv_m32( unsigned int arg ) +{ + FIXME("_adj_fdiv_m32 stub\n"); +} +void __stdcall _adj_fdiv_m32i( int arg ) +{ + FIXME("_adj_fdiv_m32i stub\n"); +} + +void __stdcall _adj_fdiv_m64( unsigned __int64 arg ) +{ + FIXME("_adj_fdiv_m64 stub\n"); +} + +void _adj_fdiv_r(void) +{ + FIXME("_adj_fdiv_r stub\n"); +} + +void __stdcall _adj_fdivr_m32( unsigned int arg ) +{ + FIXME("_adj_fdivr_m32i stub\n"); +} + +void __stdcall _adj_fdivr_m32i( int arg ) +{ + FIXME("_adj_fdivr_m32i stub\n"); +} + +void __stdcall _adj_fdivr_m64( unsigned __int64 arg ) +{ + FIXME("_adj_fdivr_m64 stub\n"); +} + +void _adj_fpatan(void) +{ + FIXME("_adj_fpatan stub\n"); +} + +void __stdcall _adj_fdiv_m16i( short arg ) +{ + FIXME("_adj_fdiv_m16i stub\n"); +} + +void __stdcall _adj_fdivr_m16i( short arg ) +{ + FIXME("_adj_fdivr_m16i stub\n"); +} + +void _adj_fprem(void) +{ + FIXME("_adj_fprem stub\n"); +} + +void _adj_fprem1(void) +{ + FIXME("_adj_fprem1 stub\n"); +} + +void _adj_fptan(void) +{ + FIXME("_adj_fptan stub\n"); +} + +void _safe_fdiv(void) +{ + FIXME("_safe_fdiv stub\n"); +} + +void _safe_fdivr(void) +{ + FIXME("_safe_fdivr stub\n"); +} + +void _safe_fprem(void) +{ + FIXME("_safe_fprem stub\n"); +} + +void _safe_fprem1(void) +{ + FIXME("_safe_fprem1 stub\n"); +} + + diff --git a/reactos/lib/sdk/crt/math/i386/allmul_asm.s b/reactos/lib/sdk/crt/math/i386/allmul_asm.s index c07867de052..1c17bb939a7 100644 --- a/reactos/lib/sdk/crt/math/i386/allmul_asm.s +++ b/reactos/lib/sdk/crt/math/i386/allmul_asm.s @@ -83,7 +83,7 @@ __allmul: mov ecx,BLO jnz short hard //both are zero, just mult ALO and BLO - mov eax,AHI + mov eax,ALO mul ecx ret 16 // callee restores the stack diff --git a/reactos/lib/sdk/crt/math/i386/ci.c b/reactos/lib/sdk/crt/math/i386/ci.c new file mode 100644 index 00000000000..b0a58eb2d5c --- /dev/null +++ b/reactos/lib/sdk/crt/math/i386/ci.c @@ -0,0 +1,137 @@ +#include +#include + +#define FPU_DOUBLE(var) double var; \ + __asm__ __volatile__( "fstpl %0;fwait" : "=m" (var) : ) +#define FPU_DOUBLES(var1,var2) double var1,var2; \ + __asm__ __volatile__( "fstpl %0;fwait" : "=m" (var2) : ); \ + __asm__ __volatile__( "fstpl %0;fwait" : "=m" (var1) : ) + +/* + * @implemented + */ +double CDECL _CIsin(void) +{ + FPU_DOUBLE(x); + return sin(x); +} +/* + * @implemented + */ +double CDECL _CIcos(void) +{ + FPU_DOUBLE(x); + return cos(x); +} +/* + * @implemented + */ +double CDECL _CItan(void) +{ + FPU_DOUBLE(x); + return tan(x); +} +/* + * @implemented + */ +double CDECL _CIsinh(void) +{ + FPU_DOUBLE(x); + return sinh(x); +} +/* + * @implemented + */ +double CDECL _CIcosh(void) +{ + FPU_DOUBLE(x); + return cosh(x); +} +/* + * @implemented + */ +double CDECL _CItanh(void) +{ + FPU_DOUBLE(x); + return tanh(x); +} +/* + * @implemented + */ +double CDECL _CIasin(void) +{ + FPU_DOUBLE(x); + return asin(x); +} +/* + * @implemented + */ +double CDECL _CIacos(void) +{ + FPU_DOUBLE(x); + return acos(x); +} +/* + * @implemented + */ +double CDECL _CIatan(void) +{ + FPU_DOUBLE(x); + return atan(x); +} +/* + * @implemented + */ +double CDECL _CIatan2(void) +{ + FPU_DOUBLES(x, y); + return atan2(x, y); +} +/* + * @implemented + */ +double CDECL _CIexp(void) +{ + FPU_DOUBLE(x); + return exp(x); +} +/* + * @implemented + */ +double CDECL _CIlog(void) +{ + FPU_DOUBLE(x); + return log(x); +} +/* + * @implemented + */ +double CDECL _CIlog10(void) +{ + FPU_DOUBLE(x); + return log10(x); +} +/* + * @implemented + */ +double CDECL _CIpow(void) +{ + FPU_DOUBLES(x, y); + return pow(x, y); +} +/* + * @implemented + */ +double CDECL _CIsqrt(void) +{ + FPU_DOUBLE(x); + return sqrt(x); +} +/* + * @implemented + */ +double CDECL _CIfmod(void) +{ + FPU_DOUBLES(x, y); + return fmod(x, y); +} diff --git a/reactos/lib/sdk/crt/math/stubs.c b/reactos/lib/sdk/crt/math/stubs.c index 40c726cffc2..271807fb9f5 100644 --- a/reactos/lib/sdk/crt/math/stubs.c +++ b/reactos/lib/sdk/crt/math/stubs.c @@ -1,133 +1,133 @@ #include #include -double _CIsin(double x); -double _CIcos(double x); -double _CItan(double x); -double _CIsinh(double x); -double _CIcosh(double x); -double _CItanh(double x); -double _CIasin(double x); -double _CIacos(double x); -double _CIatan(double x); -double _CIatan2(double y, double x); -double _CIexp(double x); -double _CIlog(double x); -double _CIlog10(double x); -double _CIpow(double x, double y); -double _CIsqrt(double x); -double _CIfmod(double x, double y); +double CDECL _CIsin(double x); +double CDECL _CIcos(double x); +double CDECL _CItan(double x); +double CDECL _CIsinh(double x); +double CDECL _CIcosh(double x); +double CDECL _CItanh(double x); +double CDECL _CIasin(double x); +double CDECL _CIacos(double x); +double CDECL _CIatan(double x); +double CDECL _CIatan2(double y, double x); +double CDECL _CIexp(double x); +double CDECL _CIlog(double x); +double CDECL _CIlog10(double x); +double CDECL _CIpow(double x, double y); +double CDECL _CIsqrt(double x); +double CDECL _CIfmod(double x, double y); /* * @implemented */ -double _CIsin(double x) +double CDECL _CIsin(double x) { return sin(x); } /* * @implemented */ -double _CIcos(double x) +double CDECL _CIcos(double x) { return cos(x); } /* * @implemented */ -double _CItan(double x) +double CDECL _CItan(double x) { return tan(x); } /* * @implemented */ -double _CIsinh(double x) +double CDECL _CIsinh(double x) { return sinh(x); } /* * @implemented */ -double _CIcosh(double x) +double CDECL _CIcosh(double x) { return cosh(x); } /* * @implemented */ -double _CItanh(double x) +double CDECL _CItanh(double x) { return tanh(x); } /* * @implemented */ -double _CIasin(double x) +double CDECL _CIasin(double x) { return asin(x); } /* * @implemented */ -double _CIacos(double x) +double CDECL _CIacos(double x) { return acos(x); } /* * @implemented */ -double _CIatan(double x) +double CDECL _CIatan(double x) { return atan(x); } /* * @implemented */ -double _CIatan2(double y, double x) +double CDECL _CIatan2(double x, double y) { return atan2(y, x); } /* * @implemented */ -double _CIexp(double x) +double CDECL _CIexp(double x) { return exp(x); } /* * @implemented */ -double _CIlog(double x) +double CDECL _CIlog(double x) { return log(x); } /* * @implemented */ -double _CIlog10(double x) +double CDECL _CIlog10(double x) { return log10(x); } /* * @implemented */ -double _CIpow(double x, double y) +double CDECL _CIpow(double x, double y) { return pow(x, y); } /* * @implemented */ -double _CIsqrt(double x) +double CDECL _CIsqrt(double x) { return sqrt(x); } /* * @implemented */ -double _CIfmod(double x, double y) +double CDECL _CIfmod(double x, double y) { return fmod(x, y); } diff --git a/reactos/lib/sdk/crt/mem/i386/memchr_asm.s b/reactos/lib/sdk/crt/mem/i386/memchr_asm.s index f044a1d72f1..f6e8037fc31 100644 --- a/reactos/lib/sdk/crt/mem/i386/memchr_asm.s +++ b/reactos/lib/sdk/crt/mem/i386/memchr_asm.s @@ -2,7 +2,7 @@ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel - * FILE: lib/string/i386/memchr.s + * FILE: lib/sdk/crt/mem/i386/memchr.s */ /* @@ -19,13 +19,14 @@ _memchr: mov 0xc(%ebp),%eax mov 0x10(%ebp),%ecx cld + jecxz .Lnotfound repne scasb - je .L1 + je .Lfound +.Lnotfound: mov $1,%edi -.L1: +.Lfound: mov %edi,%eax dec %eax pop %edi leave ret - diff --git a/reactos/lib/sdk/crt/stdio/lnx_sprintf.c b/reactos/lib/sdk/crt/stdio/lnx_sprintf.c index 7f12c7933a8..c4336e9c402 100644 --- a/reactos/lib/sdk/crt/stdio/lnx_sprintf.c +++ b/reactos/lib/sdk/crt/stdio/lnx_sprintf.c @@ -167,18 +167,16 @@ numberf(char * buf, char * end, double num, int base, int size, int precision, i return 0; c = (type & ZEROPAD) ? '0' : ' '; sign = 0; - if (type & SIGN) { - if (num < 0) { - sign = '-'; - num = -num; - size--; - } else if (type & PLUS) { - sign = '+'; - size--; - } else if (type & SPACE) { - sign = ' '; - size--; - } + if (num < 0) { + sign = '-'; + num = -num; + size--; + } else if (type & PLUS) { + sign = '+'; + size--; + } else if (type & SPACE) { + sign = ' '; + size--; } if (type & SPECIAL) { if (base == 16) @@ -231,10 +229,12 @@ numberf(char * buf, char * end, double num, int base, int size, int precision, i ++buf; } } - while (i < precision--) { - if (buf <= end) - *buf = '0'; - ++buf; + if (type & ZEROPAD) { + while (i < precision--) { + if (buf <= end) + *buf = '0'; + ++buf; + } } while (i-- > 0) { if (buf <= end) diff --git a/reactos/lib/sdk/crt/stdlib/fcvtbuf.c b/reactos/lib/sdk/crt/stdlib/fcvtbuf.c index 9d145be717d..a76b27bc515 100644 --- a/reactos/lib/sdk/crt/stdlib/fcvtbuf.c +++ b/reactos/lib/sdk/crt/stdlib/fcvtbuf.c @@ -48,7 +48,6 @@ static char *cvt(double arg, int ndigits, int *decpt, int *sign, char *buf, int double fi, fj; char *p, *p1; - if (ndigits < 0) ndigits = 0; if (ndigits >= CVTBUFSIZE - 1) ndigits = CVTBUFSIZE - 2; r2 = 0; *sign = 0; diff --git a/reactos/lib/sdk/uuid/uuid.c b/reactos/lib/sdk/uuid/uuid.c index 72e07ceca59..a12b340e2bf 100644 --- a/reactos/lib/sdk/uuid/uuid.c +++ b/reactos/lib/sdk/uuid/uuid.c @@ -95,6 +95,15 @@ DEFINE_GUID(IID_ISFHelper, 0x1fe68efb,0x1874,0x9812,0x56,0xdc,0x0 DEFINE_GUID(IID_IDPLobbySP, 0x5a4e5a20,0x2ced,0x11d0,0xa8,0x89,0x00,0xa0,0xc9,0x05,0x43,0x3c); DEFINE_GUID(IID_IProxyManager, 0x00000008,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); DEFINE_GUID(IID_IBindStatusCallbackHolder,0x79eac9cc,0xbaf9,0x11ce,0x8c,0x82,0x00,0xaa,0x00,0x4b,0xa9,0x0b); +DEFINE_GUID(IID_IEnumNetConnection, 0xC08956A0,0x1CD3,0x11D1,0xB1,0xC5,0x00,0x80,0x5F,0xC1,0x27,0x0E); +DEFINE_GUID(IID_INetConnection, 0xC08956A1,0x1CD3,0x11D1,0xB1,0xC5,0x00,0x80,0x5F,0xC1,0x27,0x0E); +DEFINE_GUID(IID_INetConnectionManager, 0xC08956A2,0x1CD3,0x11D1,0xB1,0xC5,0x00,0x80,0x5F,0xC1,0x27,0x0E); +DEFINE_GUID(IID_INetConnectionPropertyUi, 0xC08956A4,0x1CD3,0x11D1,0xB1,0xC5,0x00,0x80,0x5F,0xC1,0x27,0x0E); +DEFINE_GUID(IID_IEnumNetCfgComponent, 0xC0E8AE92,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E); +DEFINE_GUID(IID_INetCfg, 0xC0E8AE93,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E); +DEFINE_GUID(IID_INetCfgComponent, 0xC0E8AE99,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E); +DEFINE_GUID(IID_INetCfgLock, 0xC0E8AE9F,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E); + DEFINE_GUID(FMTID_SummaryInformation,0xF29F85E0,0x4FF9,0x1068,0xAB,0x91,0x08,0x00,0x2B,0x27,0xB3,0xD9); DEFINE_GUID(FMTID_DocSummaryInformation,0xD5CDD502,0x2E9C,0x101B,0x93,0x97,0x08,0x00,0x2B,0x2C,0xF9,0xAE); @@ -123,3 +132,6 @@ DEFINE_GUID(CLSID_StdEvent, 0x0000032b,0x0000,0x0000,0xc0,0x00,0x0 DEFINE_GUID(CLSID_ManualResetEvent, 0x0000032c,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); DEFINE_GUID(CLSID_SynchronizeContainer, 0x0000032d,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); DEFINE_GUID(CLSID_InProcFreeMarshaler, 0x0000033a,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(CLSID_ConnectionManager, 0xBA126AD1,0x2166,0x11D1,0xB1,0xD0,0x0,0x80,0x5F,0xC1,0x27,0x0E); +DEFINE_GUID(CLSID_CNetCfg, 0x5B035261,0x40F9,0x11D1,0xAA,0xEC,0x00,0x80,0x5F,0xC1,0x27,0x0E); + diff --git a/reactos/ntoskrnl/cc/cacheman.c b/reactos/ntoskrnl/cc/cacheman.c index 9921b4b786e..87c0ab5cb1a 100644 --- a/reactos/ntoskrnl/cc/cacheman.c +++ b/reactos/ntoskrnl/cc/cacheman.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include PFSN_PREFETCHER_GLOBALS CcPfGlobals; diff --git a/reactos/ntoskrnl/cc/copy.c b/reactos/ntoskrnl/cc/copy.c index c7c5ea532f9..37bdd8a1b9b 100644 --- a/reactos/ntoskrnl/cc/copy.c +++ b/reactos/ntoskrnl/cc/copy.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include /* GLOBALS *******************************************************************/ @@ -47,13 +47,13 @@ CcInitCacheZeroPage(VOID) if (!NT_SUCCESS(Status)) { DbgPrint("Can't allocate CcZeroPage.\n"); - KEBUGCHECKCC; + KeBugCheck(CACHE_MANAGER); } Status = MiZeroPage(CcZeroPage); if (!NT_SUCCESS(Status)) { DbgPrint("Can't zero out CcZeroPage.\n"); - KEBUGCHECKCC; + KeBugCheck(CACHE_MANAGER); } } diff --git a/reactos/ntoskrnl/cc/fs.c b/reactos/ntoskrnl/cc/fs.c index 9f7324c9c22..2a06df76159 100644 --- a/reactos/ntoskrnl/cc/fs.c +++ b/reactos/ntoskrnl/cc/fs.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include #ifndef VACB_MAPPING_GRANULARITY #define VACB_MAPPING_GRANULARITY (256 * 1024) @@ -183,7 +183,7 @@ CcSetFileSizes (IN PFILE_OBJECT FileObject, else { DPRINT1("Anyone has referenced a cache segment behind the new size.\n"); - KEBUGCHECKCC; + KeBugCheck(CACHE_MANAGER); } } } @@ -202,7 +202,7 @@ CcSetFileSizes (IN PFILE_OBJECT FileObject, if (!NT_SUCCESS(Status)) { DPRINT1("CcRosInternalFreeCacheSegment failed, status = %x\n", Status); - KEBUGCHECK(0); + KeBugCheck(CACHE_MANAGER); } } } diff --git a/reactos/ntoskrnl/cc/mdl.c b/reactos/ntoskrnl/cc/mdl.c index 5dde9884825..f334f38ad94 100644 --- a/reactos/ntoskrnl/cc/mdl.c +++ b/reactos/ntoskrnl/cc/mdl.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/ntoskrnl/cc/pin.c b/reactos/ntoskrnl/cc/pin.c index 1645883181d..2afde1e358c 100644 --- a/reactos/ntoskrnl/cc/pin.c +++ b/reactos/ntoskrnl/cc/pin.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include /* GLOBALS *******************************************************************/ diff --git a/reactos/ntoskrnl/cc/view.c b/reactos/ntoskrnl/cc/view.c index 5155b2296c1..8edec604722 100644 --- a/reactos/ntoskrnl/cc/view.c +++ b/reactos/ntoskrnl/cc/view.c @@ -33,7 +33,7 @@ #include #define NDEBUG -#include +#include #if defined (ALLOC_PRAGMA) #pragma alloc_text(INIT, CcInitView) @@ -485,7 +485,7 @@ CcRosMarkDirtyCacheSegment(PBCB Bcb, ULONG FileOffset) CacheSeg = CcRosLookupCacheSegment(Bcb, FileOffset); if (CacheSeg == NULL) { - KEBUGCHECKCC; + KeBugCheck(CACHE_MANAGER); } if (!CacheSeg->Dirty) { @@ -674,7 +674,7 @@ CcRosCreateCacheSegment(PBCB Bcb, if (StartingOffset == 0xffffffff) { DPRINT1("Out of CacheSeg mapping space\n"); - KEBUGCHECKCC; + KeBugCheck(CACHE_MANAGER); } current->BaseAddress = CiCacheSegMappingRegionBase + StartingOffset * PAGE_SIZE; @@ -700,7 +700,7 @@ CcRosCreateCacheSegment(PBCB Bcb, MmUnlockAddressSpace(MmGetKernelAddressSpace()); if (!NT_SUCCESS(Status)) { - KEBUGCHECKCC; + KeBugCheck(CACHE_MANAGER); } #endif @@ -834,9 +834,9 @@ CcRosRequestCacheSegment(PBCB Bcb, if ((FileOffset % Bcb->CacheSegmentSize) != 0) { - CPRINT("Bad fileoffset %x should be multiple of %x", + DPRINT1("Bad fileoffset %x should be multiple of %x", FileOffset, Bcb->CacheSegmentSize); - KEBUGCHECKCC; + KeBugCheck(CACHE_MANAGER); } return(CcRosGetCacheSegment(Bcb, @@ -1339,7 +1339,7 @@ CmLazyCloseThreadMain(PVOID Ignored) if (!NT_SUCCESS(Status)) { DbgPrint("LazyCloseThread: Wait failed\n"); - KEBUGCHECKCC; + KeBugCheck(CACHE_MANAGER); break; } if (LazyCloseThreadShouldTerminate) @@ -1401,7 +1401,7 @@ CcInitView(VOID) MmUnlockAddressSpace(MmGetKernelAddressSpace()); if (!NT_SUCCESS(Status)) { - KEBUGCHECKCC; + KeBugCheck(CACHE_MANAGER); } Buffer = ExAllocatePool(NonPagedPool, CI_CACHESEG_MAPPING_REGION_SIZE / (PAGE_SIZE * 8)); diff --git a/reactos/ntoskrnl/config/cmalloc.c b/reactos/ntoskrnl/config/cmalloc.c index 3c8cdbbcc35..a0e6c0a6b83 100644 --- a/reactos/ntoskrnl/config/cmalloc.c +++ b/reactos/ntoskrnl/config/cmalloc.c @@ -62,7 +62,7 @@ CmpFreeKeyControlBlock(IN PCM_KEY_CONTROL_BLOCK Kcb) if (!Kcb->PrivateAlloc) { /* Free it from the pool */ - ExFreePool(Kcb); + ExFreePoolWithTag(Kcb, TAG_CM); return; } @@ -99,7 +99,7 @@ CmpFreeKeyControlBlock(IN PCM_KEY_CONTROL_BLOCK Kcb) } /* Free the page */ - ExFreePool(AllocPage); + ExFreePoolWithTag(AllocPage, TAG_CM); } /* Release the lock */ @@ -296,7 +296,7 @@ CmpFreeDelayItem(PVOID Entry) } /* Now free the page */ - ExFreePool(AllocPage); + ExFreePoolWithTag(AllocPage, TAG_CM); } /* Release the lock */ diff --git a/reactos/ntoskrnl/config/cmconfig.c b/reactos/ntoskrnl/config/cmconfig.c index e56a60ca2fd..7aae14da7a6 100644 --- a/reactos/ntoskrnl/config/cmconfig.c +++ b/reactos/ntoskrnl/config/cmconfig.c @@ -386,7 +386,7 @@ CmpInitializeHardwareConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBlock) } /* Close our handle, free the buffer and return status */ - ExFreePool(CmpConfigurationData); + ExFreePoolWithTag(CmpConfigurationData, TAG_CM); NtClose(KeyHandle); return Status; } diff --git a/reactos/ntoskrnl/config/cmkcbncb.c b/reactos/ntoskrnl/config/cmkcbncb.c index 17fe617b66d..fde338018dd 100644 --- a/reactos/ntoskrnl/config/cmkcbncb.c +++ b/reactos/ntoskrnl/config/cmkcbncb.c @@ -483,7 +483,7 @@ CmpCleanUpKcbCacheWithLock(IN PCM_KEY_CONTROL_BLOCK Kcb, /* Cleanup the value cache */ CmpCleanUpKcbValueCache(Kcb); - /* Reference the NCB */ + /* Dereference the NCB */ CmpDereferenceNameControlBlockWithLock(Kcb->NameBlock); /* Check if we have an index hint block and free it */ @@ -492,10 +492,10 @@ CmpCleanUpKcbCacheWithLock(IN PCM_KEY_CONTROL_BLOCK Kcb, /* Check if we were already deleted */ Parent = Kcb->ParentKcb; if (!Kcb->Delete) CmpRemoveKeyControlBlock(Kcb); - + /* Set invalid KCB signature */ Kcb->Signature = CM_KCB_INVALID_SIGNATURE; - + /* Free the KCB as well */ CmpFreeKeyControlBlock(Kcb); @@ -504,8 +504,8 @@ CmpCleanUpKcbCacheWithLock(IN PCM_KEY_CONTROL_BLOCK Kcb, { /* Dereference the parent */ LockHeldExclusively ? - CmpDereferenceKeyControlBlockWithLock(Kcb,LockHeldExclusively) : - CmpDelayDerefKeyControlBlock(Kcb); + CmpDereferenceKeyControlBlockWithLock(Parent,LockHeldExclusively) : + CmpDelayDerefKeyControlBlock(Parent); } } @@ -886,6 +886,151 @@ CmpCreateKeyControlBlock(IN PHHIVE Hive, return Kcb; } +PUNICODE_STRING +NTAPI +CmpConstructName(IN PCM_KEY_CONTROL_BLOCK Kcb) +{ + PUNICODE_STRING KeyName; + ULONG NameLength, i; + PCM_KEY_CONTROL_BLOCK MyKcb; + PCM_KEY_NODE KeyNode; + BOOLEAN DeletedKey = FALSE; + PWCHAR TargetBuffer, CurrentNameW; + PUCHAR CurrentName; + + /* Calculate how much size our key name is going to occupy */ + NameLength = 0; + MyKcb = Kcb; + + while (MyKcb) + { + /* Add length of the name */ + if (!MyKcb->NameBlock->Compressed) + { + NameLength += MyKcb->NameBlock->NameLength; + } + else + { + NameLength += CmpCompressedNameSize(MyKcb->NameBlock->Name, + MyKcb->NameBlock->NameLength); + } + + /* Sum up the separator too */ + NameLength += sizeof(WCHAR); + + /* Go to the parent KCB */ + MyKcb = MyKcb->ParentKcb; + } + + /* Allocate the unicode string now */ + KeyName = ExAllocatePoolWithTag(PagedPool, + NameLength + sizeof(UNICODE_STRING), + TAG_CM); + + if (!KeyName) return NULL; + + /* Set it up */ + KeyName->Buffer = (PWSTR)(KeyName + 1); + KeyName->Length = NameLength; + KeyName->MaximumLength = NameLength; + + /* Loop the keys again, now adding names */ + NameLength = 0; + MyKcb = Kcb; + + while (MyKcb) + { + /* Sanity checks for deleted and fake keys */ + if ((!MyKcb->KeyCell && !MyKcb->Delete) || + !MyKcb->KeyHive || + MyKcb->ExtFlags & CM_KCB_KEY_NON_EXIST) + { + /* Failure */ + ExFreePool(KeyName); + return NULL; + } + + /* Try to get the name from the keynode, + if the key is not deleted */ + if (!DeletedKey && !MyKcb->Delete) + { + KeyNode = HvGetCell(MyKcb->KeyHive, MyKcb->KeyCell); + + if (!KeyNode) + { + /* Failure */ + ExFreePool(KeyName); + return NULL; + } + } + else + { + /* The key was deleted */ + KeyNode = NULL; + DeletedKey = TRUE; + } + + /* Get the pointer to the beginning of the current key name */ + NameLength += (MyKcb->NameBlock->NameLength + 1) * sizeof(WCHAR); + TargetBuffer = &KeyName->Buffer[(KeyName->Length - NameLength) / sizeof(WCHAR)]; + + /* Add a separator */ + TargetBuffer[0] = OBJ_NAME_PATH_SEPARATOR; + + /* Add the name, but remember to go from the end to the beginning */ + if (!MyKcb->NameBlock->Compressed) + { + /* Get the pointer to the name (from the keynode, if possible) */ + if ((MyKcb->Flags & (KEY_HIVE_ENTRY | KEY_HIVE_EXIT)) || + !KeyNode) + { + CurrentNameW = MyKcb->NameBlock->Name; + } + else + { + CurrentNameW = KeyNode->Name; + } + + /* Copy the name */ + for (i=0; i < MyKcb->NameBlock->NameLength; i++) + { + TargetBuffer[i+1] = *CurrentNameW; + CurrentNameW++; + } + } + else + { + /* Get the pointer to the name (from the keynode, if possible) */ + if ((MyKcb->Flags & (KEY_HIVE_ENTRY | KEY_HIVE_EXIT)) || + !KeyNode) + { + CurrentName = (PUCHAR)MyKcb->NameBlock->Name; + } + else + { + CurrentName = (PUCHAR)KeyNode->Name; + } + + /* Copy the name */ + for (i=0; i < MyKcb->NameBlock->NameLength; i++) + { + TargetBuffer[i+1] = (WCHAR)*CurrentName; + CurrentName++; + } + } + + /* Release the cell, if needed */ + if (KeyNode) HvReleaseCell(MyKcb->KeyHive, MyKcb->KeyCell); + + /* Go to the parent KCB */ + MyKcb = MyKcb->ParentKcb; + } + + /* Return resulting buffer (both UNICODE_STRING and + its buffer following it) */ + return KeyName; +} + VOID NTAPI EnlistKeyBodyWithKCB(IN PCM_KEY_BODY KeyBody, diff --git a/reactos/ntoskrnl/config/cmse.c b/reactos/ntoskrnl/config/cmse.c index 80d56dde569..4ee2335c064 100644 --- a/reactos/ntoskrnl/config/cmse.c +++ b/reactos/ntoskrnl/config/cmse.c @@ -43,7 +43,7 @@ CmpHiveRootSecurityDescriptor(VOID) if (!(Sid[0]) || !(Sid[1]) || !(Sid[2]) || !(Sid[3])) { /* Bugcheck */ - KEBUGCHECKEX(REGISTRY_ERROR, 11, 1, 0, 0); + KeBugCheckEx(REGISTRY_ERROR, 11, 1, 0, 0); } /* Phase 2: Initialize all SIDs */ @@ -51,7 +51,7 @@ CmpHiveRootSecurityDescriptor(VOID) Status |= RtlInitializeSid(Sid[1], &NtAuthority, 1); Status |= RtlInitializeSid(Sid[2], &NtAuthority, 1); Status |= RtlInitializeSid(Sid[3], &NtAuthority, 2); - if (!NT_SUCCESS(Status)) KEBUGCHECKEX(REGISTRY_ERROR, 11, 2, 0, 0); + if (!NT_SUCCESS(Status)) KeBugCheckEx(REGISTRY_ERROR, 11, 2, 0, 0); /* Phase 2: Setup SID Sub Authorities */ *RtlSubAuthoritySid(Sid[0], 0) = SECURITY_WORLD_RID; @@ -78,18 +78,18 @@ CmpHiveRootSecurityDescriptor(VOID) /* Phase 3: Allocate the ACL */ Acl = ExAllocatePoolWithTag(PagedPool, AclLength, TAG_CM); - if (!Acl) KEBUGCHECKEX(REGISTRY_ERROR, 11, 3, 0, 0); + if (!Acl) KeBugCheckEx(REGISTRY_ERROR, 11, 3, 0, 0); /* Phase 4: Create the ACL */ Status = RtlCreateAcl(Acl, AclLength, ACL_REVISION); - if (!NT_SUCCESS(Status)) KEBUGCHECKEX(REGISTRY_ERROR, 11, 4, Status, 0); + if (!NT_SUCCESS(Status)) KeBugCheckEx(REGISTRY_ERROR, 11, 4, Status, 0); /* Phase 5: Build the ACL */ Status = RtlAddAccessAllowedAce(Acl, ACL_REVISION, KEY_ALL_ACCESS, Sid[0]); Status |= RtlAddAccessAllowedAce(Acl, ACL_REVISION, KEY_ALL_ACCESS, Sid[1]); Status |= RtlAddAccessAllowedAce(Acl, ACL_REVISION, KEY_READ, Sid[2]); Status |= RtlAddAccessAllowedAce(Acl, ACL_REVISION, KEY_READ, Sid[3]); - if (!NT_SUCCESS(Status)) KEBUGCHECKEX(REGISTRY_ERROR, 11, 5, Status, 0); + if (!NT_SUCCESS(Status)) KeBugCheckEx(REGISTRY_ERROR, 11, 5, Status, 0); /* Phase 5: Make the ACEs inheritable */ Status = RtlGetAce(Acl, 0,( PVOID*)&AceHeader); @@ -110,7 +110,7 @@ CmpHiveRootSecurityDescriptor(VOID) sizeof(SECURITY_DESCRIPTOR) + AclLength, TAG_CM); - if (!SecurityDescriptor) KEBUGCHECKEX(REGISTRY_ERROR, 11, 6, 0, 0); + if (!SecurityDescriptor) KeBugCheckEx(REGISTRY_ERROR, 11, 6, 0, 0); /* Phase 6: Make a copy of the ACL */ AclCopy = (PACL)((PISECURITY_DESCRIPTOR)SecurityDescriptor + 1); @@ -119,18 +119,18 @@ CmpHiveRootSecurityDescriptor(VOID) /* Phase 7: Create the security descriptor */ Status = RtlCreateSecurityDescriptor(SecurityDescriptor, SECURITY_DESCRIPTOR_REVISION); - if (!NT_SUCCESS(Status)) KEBUGCHECKEX(REGISTRY_ERROR, 11, 7, Status, 0); + if (!NT_SUCCESS(Status)) KeBugCheckEx(REGISTRY_ERROR, 11, 7, Status, 0); /* Phase 8: Set the ACL as a DACL */ Status = RtlSetDaclSecurityDescriptor(SecurityDescriptor, TRUE, AclCopy, FALSE); - if (!NT_SUCCESS(Status)) KEBUGCHECKEX(REGISTRY_ERROR, 11, 8, Status, 0); + if (!NT_SUCCESS(Status)) KeBugCheckEx(REGISTRY_ERROR, 11, 8, Status, 0); /* Free the SIDs and original ACL */ - for (i = 0; i < 4; i++) ExFreePool(Sid[i]); - ExFreePool(Acl); + for (i = 0; i < 4; i++) ExFreePoolWithTag(Sid[i], TAG_CM); + ExFreePoolWithTag(Acl, TAG_CM); /* Return the security descriptor */ return SecurityDescriptor; diff --git a/reactos/ntoskrnl/config/cmsysini.c b/reactos/ntoskrnl/config/cmsysini.c index d96919bfa45..f95e6ed2e81 100644 --- a/reactos/ntoskrnl/config/cmsysini.c +++ b/reactos/ntoskrnl/config/cmsysini.c @@ -119,9 +119,77 @@ CmpQueryKeyName(IN PVOID ObjectBody, OUT PULONG ReturnLength, IN KPROCESSOR_MODE PreviousMode) { - DPRINT1("CmpQueryKeyName() called\n"); - ASSERT(FALSE); - return STATUS_SUCCESS; + PUNICODE_STRING KeyName; + NTSTATUS Status = STATUS_SUCCESS; + PCM_KEY_BODY KeyBody = (PCM_KEY_BODY)ObjectBody; + PCM_KEY_CONTROL_BLOCK Kcb = KeyBody->KeyControlBlock; + + /* Acquire hive lock */ + CmpLockRegistry(); + + /* Lock KCB shared */ + CmpAcquireKcbLockShared(Kcb); + + /* Check if it's a deleted block */ + if (Kcb->Delete) + { + /* Release the locks */ + CmpReleaseKcbLock(Kcb); + CmpUnlockRegistry(); + + /* Let the caller know it's deleted */ + return STATUS_KEY_DELETED; + } + + /* Get the name */ + KeyName = CmpConstructName(Kcb); + + /* Release the locks */ + CmpReleaseKcbLock(Kcb); + CmpUnlockRegistry(); + + /* Check if we got the name */ + if (!KeyName) return STATUS_INSUFFICIENT_RESOURCES; + + /* Set the returned length */ + *ReturnLength = KeyName->Length + sizeof(OBJECT_NAME_INFORMATION) + sizeof(WCHAR); + + /* Check if it fits into the provided buffer */ + if ((Length < sizeof(OBJECT_NAME_INFORMATION)) || + (Length < (*ReturnLength - sizeof(OBJECT_NAME_INFORMATION)))) + { + /* Free the buffer allocated by CmpConstructName */ + ExFreePool(KeyName); + + /* Return buffer length failure */ + return STATUS_INFO_LENGTH_MISMATCH; + } + + /* Fill in the result */ + _SEH_TRY + { + /* Return data to user */ + ObjectNameInfo->Name.Buffer = (PWCHAR)(ObjectNameInfo + 1); + ObjectNameInfo->Name.MaximumLength = KeyName->Length; + ObjectNameInfo->Name.Length = KeyName->Length; + + /* Copy string content*/ + RtlCopyMemory(ObjectNameInfo->Name.Buffer, + KeyName->Buffer, + *ReturnLength); + } + _SEH_HANDLE + { + /* Get the status */ + Status = _SEH_GetExceptionCode(); + } + _SEH_END; + + /* Free the buffer allocated by CmpConstructName */ + ExFreePool(KeyName); + + /* Return status */ + return Status; } NTSTATUS @@ -643,7 +711,7 @@ CmpInitializeSystemHive(IN PLOADER_PARAMETER_BLOCK LoaderBlock) if (!Buffer) { /* Fail */ - KEBUGCHECKEX(BAD_SYSTEM_CONFIG_INFO, 3, 1, (ULONG_PTR)LoaderBlock, 0); + KeBugCheckEx(BAD_SYSTEM_CONFIG_INFO, 3, 1, (ULONG_PTR)LoaderBlock, 0); } /* Setup the unicode string */ @@ -716,7 +784,7 @@ CmpInitializeSystemHive(IN PLOADER_PARAMETER_BLOCK LoaderBlock) if (CmpBootType & 4) { /* We're disabled, so bugcheck */ - KEBUGCHECKEX(BAD_SYSTEM_CONFIG_INFO, + KeBugCheckEx(BAD_SYSTEM_CONFIG_INFO, 3, 3, (ULONG_PTR)SystemHive, @@ -736,7 +804,7 @@ CmpInitializeSystemHive(IN PLOADER_PARAMETER_BLOCK LoaderBlock) SecurityDescriptor); /* Free the security descriptor */ - ExFreePool(SecurityDescriptor); + ExFreePoolWithTag(SecurityDescriptor, TAG_CM); if (!NT_SUCCESS(Status)) return FALSE; /* Add the hive to the hive list */ @@ -876,7 +944,7 @@ CmpCreateRegistryRoot(VOID) 0, 0, (PVOID*)&RootKey); - ExFreePool(SecurityDescriptor); + ExFreePoolWithTag(SecurityDescriptor, TAG_CM); if (!NT_SUCCESS(Status)) return FALSE; /* Sanity check, and get the key cell */ @@ -973,7 +1041,7 @@ CmpGetRegistryPath(IN PWCHAR ConfigPath) if (!NT_SUCCESS(Status)) { /* Fail */ - ExFreePool(ValueInfo); + ExFreePoolWithTag(ValueInfo, TAG_CM); return Status; } @@ -982,7 +1050,7 @@ CmpGetRegistryPath(IN PWCHAR ConfigPath) ValueInfo->Data, ValueInfo->DataLength); ConfigPath[ValueInfo->DataLength / sizeof(WCHAR)] = UNICODE_NULL; - ExFreePool(ValueInfo); + ExFreePoolWithTag(ValueInfo, TAG_CM); } else { @@ -1288,7 +1356,7 @@ CmpInitializeHiveList(IN USHORT Flag) } /* Get rid of the SD */ - ExFreePool(SecurityDescriptor); + ExFreePoolWithTag(SecurityDescriptor, TAG_CM); /* FIXME: Link SECURITY to SAM */ @@ -1346,7 +1414,7 @@ CmInitSystem1(VOID) if (!NT_SUCCESS(Status)) { /* Bugcheck */ - KEBUGCHECKEX(CONFIG_INITIALIZATION_FAILED, 1, 1, Status, 0); + KeBugCheckEx(CONFIG_INITIALIZATION_FAILED, 1, 1, Status, 0); } /* Build the master hive */ @@ -1363,14 +1431,14 @@ CmInitSystem1(VOID) if (!NT_SUCCESS(Status)) { /* Bugcheck */ - KEBUGCHECKEX(CONFIG_INITIALIZATION_FAILED, 1, 2, Status, 0); + KeBugCheckEx(CONFIG_INITIALIZATION_FAILED, 1, 2, Status, 0); } /* Create the \REGISTRY key node */ if (!CmpCreateRegistryRoot()) { /* Bugcheck */ - KEBUGCHECKEX(CONFIG_INITIALIZATION_FAILED, 1, 3, 0, 0); + KeBugCheckEx(CONFIG_INITIALIZATION_FAILED, 1, 3, 0, 0); } /* Create the default security descriptor */ @@ -1393,7 +1461,7 @@ CmInitSystem1(VOID) if (!NT_SUCCESS(Status)) { /* Bugcheck */ - KEBUGCHECKEX(CONFIG_INITIALIZATION_FAILED, 1, 5, Status, 0); + KeBugCheckEx(CONFIG_INITIALIZATION_FAILED, 1, 5, Status, 0); } /* Close the handle */ @@ -1416,7 +1484,7 @@ CmInitSystem1(VOID) if (!NT_SUCCESS(Status)) { /* Bugcheck */ - KEBUGCHECKEX(CONFIG_INITIALIZATION_FAILED, 1, 6, Status, 0); + KeBugCheckEx(CONFIG_INITIALIZATION_FAILED, 1, 6, Status, 0); } /* Close the handle */ @@ -1426,7 +1494,7 @@ CmInitSystem1(VOID) if (!CmpInitializeSystemHive(KeLoaderBlock)) { /* Bugcheck */ - KEBUGCHECKEX(CONFIG_INITIALIZATION_FAILED, 1, 7, 0, 0); + KeBugCheckEx(CONFIG_INITIALIZATION_FAILED, 1, 7, 0, 0); } /* Create the 'CurrentControlSet' link. */ @@ -1434,7 +1502,7 @@ CmInitSystem1(VOID) if (!NT_SUCCESS(Status)) { /* Bugcheck */ - KEBUGCHECKEX(CONFIG_INITIALIZATION_FAILED, 1, 8, Status, 0); + KeBugCheckEx(CONFIG_INITIALIZATION_FAILED, 1, 8, Status, 0); } /* Create the hardware hive */ @@ -1451,7 +1519,7 @@ CmInitSystem1(VOID) if (!NT_SUCCESS(Status)) { /* Bugcheck */ - KEBUGCHECKEX(CONFIG_INITIALIZATION_FAILED, 1, 11, Status, 0); + KeBugCheckEx(CONFIG_INITIALIZATION_FAILED, 1, 11, Status, 0); } /* Add the hive to the hive list */ @@ -1467,20 +1535,20 @@ CmInitSystem1(VOID) if (!NT_SUCCESS(Status)) { /* Bugcheck */ - KEBUGCHECKEX(CONFIG_INITIALIZATION_FAILED, 1, 12, Status, 0); + KeBugCheckEx(CONFIG_INITIALIZATION_FAILED, 1, 12, Status, 0); } /* FIXME: Add to HiveList key */ /* Free the security descriptor */ - ExFreePool(SecurityDescriptor); + ExFreePoolWithTag(SecurityDescriptor, TAG_CM); /* Fill out the Hardware key with the ARC Data from the Loader */ Status = CmpInitializeHardwareConfiguration(KeLoaderBlock); if (!NT_SUCCESS(Status)) { /* Bugcheck */ - KEBUGCHECKEX(CONFIG_INITIALIZATION_FAILED, 1, 13, Status, 0); + KeBugCheckEx(CONFIG_INITIALIZATION_FAILED, 1, 13, Status, 0); } /* Initialize machine-dependent information into the registry */ @@ -1488,7 +1556,7 @@ CmInitSystem1(VOID) if (!NT_SUCCESS(Status)) { /* Bugcheck */ - KEBUGCHECKEX(CONFIG_INITIALIZATION_FAILED, 1, 14, Status, 0); + KeBugCheckEx(CONFIG_INITIALIZATION_FAILED, 1, 14, Status, 0); } /* Initialize volatile registry settings */ @@ -1496,11 +1564,11 @@ CmInitSystem1(VOID) if (!NT_SUCCESS(Status)) { /* Bugcheck */ - KEBUGCHECKEX(CONFIG_INITIALIZATION_FAILED, 1, 15, Status, 0); + KeBugCheckEx(CONFIG_INITIALIZATION_FAILED, 1, 15, Status, 0); } /* Free the load options */ - ExFreePool(CmpLoadOptions.Buffer); + ExFreePoolWithTag(CmpLoadOptions.Buffer, TAG_CM); /* If we got here, all went well */ return TRUE; diff --git a/reactos/ntoskrnl/config/cmvalue.c b/reactos/ntoskrnl/config/cmvalue.c index 5eb5976e568..5ccd8372bfc 100644 --- a/reactos/ntoskrnl/config/cmvalue.c +++ b/reactos/ntoskrnl/config/cmvalue.c @@ -189,7 +189,7 @@ CmpValueToData(IN PHHIVE Hive, { /* Free the buffer and bugcheck */ ExFreePool(Buffer); - KEBUGCHECKEX(REGISTRY_ERROR, 8, 0, (ULONG_PTR)Hive, (ULONG_PTR)Value); + KeBugCheckEx(REGISTRY_ERROR, 8, 0, (ULONG_PTR)Hive, (ULONG_PTR)Value); } /* Otherwise, return the cell data */ diff --git a/reactos/ntoskrnl/config/i386/cmhardwr.c b/reactos/ntoskrnl/config/i386/cmhardwr.c index 96db7f34687..a3a04fe7e58 100644 --- a/reactos/ntoskrnl/config/i386/cmhardwr.c +++ b/reactos/ntoskrnl/config/i386/cmhardwr.c @@ -95,7 +95,7 @@ CmpGetBiosDate(IN PCHAR BiosStart, } } - /* Add slashes were we previously had NULLs */ + /* Add slashes where we previously had NULLs */ CurrentDate[4] = CurrentDate[7] = '/'; /* Check which date is newer */ @@ -546,7 +546,7 @@ CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBloc } /* Free the configuration data */ - ExFreePool(CmpConfigurationData); + ExFreePoolWithTag(CmpConfigurationData, TAG_CM); } /* Open physical memory */ @@ -636,7 +636,7 @@ CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBloc if (BiosHandle) { /* Get the BIOS Date Identifier */ - RtlCopyMemory(Buffer, (PCHAR)BaseAddress + (16*PAGE_SIZE - 11), 8); + RtlCopyMemory(Buffer, (PCHAR)BaseAddress + (16 * PAGE_SIZE - 11), 8); Buffer[8] = ANSI_NULL; /* Convert it to unicode */ @@ -665,7 +665,7 @@ CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBloc } /* Get the BIOS Version */ - if (CmpGetBiosVersion(BaseAddress, 16* PAGE_SIZE, Buffer)) + if (CmpGetBiosVersion(BaseAddress, 16 * PAGE_SIZE, Buffer)) { /* Start at the beginning of our buffer */ CurrentVersion = BiosVersion; @@ -764,7 +764,7 @@ CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBloc } /* Get the Video BIOS Version */ - if (CmpGetBiosVersion(BaseAddress, 8* PAGE_SIZE, Buffer)) + if (CmpGetBiosVersion(BaseAddress, 8 * PAGE_SIZE, Buffer)) { /* Start at the beginning of our buffer */ CurrentVersion = BiosVersion; @@ -824,7 +824,7 @@ CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBloc ZwClose(SectionHandle); /* Free the BIOS version string buffer */ - if (BiosVersion) ExFreePool(BiosVersion); + if (BiosVersion) ExFreePoolWithTag(BiosVersion, TAG_CM); Quickie: /* Close the procesor handle */ diff --git a/reactos/ntoskrnl/config/ntapi.c b/reactos/ntoskrnl/config/ntapi.c index 62a2232d9a1..4c734d44043 100644 --- a/reactos/ntoskrnl/config/ntapi.c +++ b/reactos/ntoskrnl/config/ntapi.c @@ -707,7 +707,7 @@ NtLoadKey(IN POBJECT_ATTRIBUTES KeyObjectAttributes, IN POBJECT_ATTRIBUTES FileObjectAttributes) { /* Call the newer API */ - return NtLoadKey2(KeyObjectAttributes, FileObjectAttributes, 0); + return NtLoadKeyEx(KeyObjectAttributes, FileObjectAttributes, 0, NULL); } NTSTATUS diff --git a/reactos/ntoskrnl/dbgk/dbgkobj.c b/reactos/ntoskrnl/dbgk/dbgkobj.c index 2495dc51551..8a558d6dd52 100644 --- a/reactos/ntoskrnl/dbgk/dbgkobj.c +++ b/reactos/ntoskrnl/dbgk/dbgkobj.c @@ -10,7 +10,7 @@ #include #define NDEBUG -#include +#include POBJECT_TYPE DbgkDebugObjectType; FAST_MUTEX DbgkpProcessDebugPortMutex; @@ -712,7 +712,7 @@ DbgkpPostFakeThreadMessages(IN PEPROCESS Process, { /* We failed. FIXME: Handle this */ DPRINT1("Unhandled Dbgk codepath!\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* Check if this was the first message */ @@ -736,7 +736,7 @@ DbgkpPostFakeThreadMessages(IN PEPROCESS Process, { /* We failed. FIXME: Handle this */ DPRINT1("Unhandled Dbgk codepath!\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* Make sure we have a first thread */ diff --git a/reactos/ntoskrnl/ex/atom.c b/reactos/ntoskrnl/ex/atom.c index 27f605fda58..de2c030c492 100644 --- a/reactos/ntoskrnl/ex/atom.c +++ b/reactos/ntoskrnl/ex/atom.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include #define TAG_ATOM TAG('A', 't', 'o', 'm') diff --git a/reactos/ntoskrnl/ex/callback.c b/reactos/ntoskrnl/ex/callback.c index e5c21205b1e..f8705f2bfa2 100644 --- a/reactos/ntoskrnl/ex/callback.c +++ b/reactos/ntoskrnl/ex/callback.c @@ -10,7 +10,7 @@ #include #define NDEBUG -#include +#include /* TYPES *********************************************************************/ @@ -177,7 +177,7 @@ ExReferenceCallBackBlock(IN OUT PEX_CALLBACK CallBack) /* FIXME: Race */ CallbackRoutineBlock = NULL; DPRINT1("Unhandled callback race condition\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } else { diff --git a/reactos/ntoskrnl/ex/dbgctrl.c b/reactos/ntoskrnl/ex/dbgctrl.c index 78c02cd1867..34badf7a868 100644 --- a/reactos/ntoskrnl/ex/dbgctrl.c +++ b/reactos/ntoskrnl/ex/dbgctrl.c @@ -10,7 +10,7 @@ #include #define NDEBUG -#include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/ntoskrnl/ex/efi.c b/reactos/ntoskrnl/ex/efi.c index 38c6c01ab43..b13fe15ce2d 100644 --- a/reactos/ntoskrnl/ex/efi.c +++ b/reactos/ntoskrnl/ex/efi.c @@ -10,7 +10,7 @@ #include #define NDEBUG -#include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/ntoskrnl/ex/event.c b/reactos/ntoskrnl/ex/event.c index c8998b596f6..890ccd46830 100644 --- a/reactos/ntoskrnl/ex/event.c +++ b/reactos/ntoskrnl/ex/event.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include #if defined (ALLOC_PRAGMA) #pragma alloc_text(INIT, ExpInitializeEventImplementation) diff --git a/reactos/ntoskrnl/ex/evtpair.c b/reactos/ntoskrnl/ex/evtpair.c index b7dab929c56..65a7dddc109 100644 --- a/reactos/ntoskrnl/ex/evtpair.c +++ b/reactos/ntoskrnl/ex/evtpair.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include #if defined (ALLOC_PRAGMA) #pragma alloc_text(INIT, ExpInitializeEventPairImplementation) diff --git a/reactos/ntoskrnl/ex/fmutex.c b/reactos/ntoskrnl/ex/fmutex.c index 4b22f8b9e01..e84e1cc613a 100644 --- a/reactos/ntoskrnl/ex/fmutex.c +++ b/reactos/ntoskrnl/ex/fmutex.c @@ -131,7 +131,7 @@ FASTCALL ExReleaseFastMutex(IN OUT PFAST_MUTEX FastMutex) { KIRQL OldIrql; - ASSERT_IRQL(APC_LEVEL); + ASSERT_IRQL_LESS_OR_EQUAL(APC_LEVEL); /* Erase the owner */ FastMutex->Owner = NULL; diff --git a/reactos/ntoskrnl/ex/handle.c b/reactos/ntoskrnl/ex/handle.c index 20040f5cd7a..2e38fe2d999 100644 --- a/reactos/ntoskrnl/ex/handle.c +++ b/reactos/ntoskrnl/ex/handle.c @@ -59,7 +59,7 @@ ExpLookupHandleTableEntry(IN PHANDLE_TABLE HandleTable, /* Direct index */ case 0: - /* Use level 1 and just get the entry directlry */ + /* Use level 1 and just get the entry directly */ Level1 = (PUCHAR)TableBase; Entry = (PVOID)&Level1[Handle.Value * (sizeof(HANDLE_TABLE_ENTRY) / @@ -210,8 +210,8 @@ ExpFreeHandleTable(IN PHANDLE_TABLE HandleTable) PEPROCESS Process = HandleTable->QuotaProcess; ULONG i, j; ULONG_PTR TableCode = HandleTable->TableCode; - ULONG TableLevel = TableCode & 3; ULONG_PTR TableBase = TableCode & ~3; + ULONG TableLevel = (ULONG)(TableCode & 3); PHANDLE_TABLE_ENTRY Level1, *Level2, **Level3; PAGED_CODE(); @@ -661,7 +661,7 @@ ExpMoveFreeHandles(IN PHANDLE_TABLE HandleTable) } /* We are strict FIFO, we need to reverse the entries */ - KEBUGCHECK(0); + ASSERT(FALSE); return LastFree; } @@ -958,7 +958,7 @@ ExDestroyHandleTable(IN PHANDLE_TABLE HandleTable, if (DestroyHandleProcedure) { /* FIXME: */ - KEBUGCHECK(0); + ASSERT(FALSE); } /* Free the handle table */ diff --git a/reactos/ntoskrnl/ex/harderr.c b/reactos/ntoskrnl/ex/harderr.c index 722cc0ba758..74a5fdeaffc 100644 --- a/reactos/ntoskrnl/ex/harderr.c +++ b/reactos/ntoskrnl/ex/harderr.c @@ -10,7 +10,7 @@ #include #define NDEBUG -#include +#include #define TAG_ERR TAG('E', 'r', 'r', ' ') diff --git a/reactos/ntoskrnl/ex/i386/fastinterlck_asm.S b/reactos/ntoskrnl/ex/i386/fastinterlck_asm.S index c0d56a3b511..af825ca1f59 100644 --- a/reactos/ntoskrnl/ex/i386/fastinterlck_asm.S +++ b/reactos/ntoskrnl/ex/i386/fastinterlck_asm.S @@ -226,7 +226,7 @@ cmp eax, ecx je 2f - /* Get the next entry and do the deletion*/ + /* Get the next entry and do the deletion */ #ifdef CONFIG_SMP push ebx mov ebx, [eax] @@ -569,7 +569,7 @@ _ExpInterlockedPopEntrySListEnd@0: push ebx push ebp - /* Get desination pointer, exchange value and comperand value/address */ + /* Get destination pointer, exchange value and comperand value/address */ mov ebp, ecx mov ebx, [edx] mov ecx, [edx+4] @@ -601,7 +601,7 @@ _ExpInterlockedPopEntrySListEnd@0: push ebp push ebp - /* Get desination pointer, exchange value and comperand value/address */ + /* Get destination pointer, exchange value and comperand value/address */ mov ebp, ecx mov ebx, [edx] mov ecx, [edx+4] @@ -730,7 +730,7 @@ _ExpInterlockedPopEntrySListEnd@0: push ebp push ebp - /* Get desination pointer, exchange value and comperand value/address */ + /* Get destination pointer, exchange value and comperand value/address */ mov ebp, ecx mov ebx, [edx] mov ecx, [edx+4] diff --git a/reactos/ntoskrnl/ex/i386/interlck_asm.S b/reactos/ntoskrnl/ex/i386/interlck_asm.S index 0a81f482ffc..e6a8f3a2159 100644 --- a/reactos/ntoskrnl/ex/i386/interlck_asm.S +++ b/reactos/ntoskrnl/ex/i386/interlck_asm.S @@ -239,7 +239,7 @@ _ExInterlockedInsertTailList@12: /* Restore flags */ popfd - /* check if the list was empty and return NULL */ + /* Check if the list was empty and return NULL */ xor eax, edx jz 2f @@ -556,24 +556,5 @@ _Exi386InterlockedExchangeUlong@12: /* Return */ ret 8 - -/* Ugly hack: Use InterlockedExchange64 */ -.att_syntax -.global @ExfpInterlockedExchange64@8 -@ExfpInterlockedExchange64@8: - pushl %ebx - pushl %esi - movl %ecx,%esi - movl (%edx),%ebx - movl 4(%edx),%ecx -1: - movl (%esi),%eax - movl 4(%esi),%edx - LOCK - cmpxchg8b (%esi) - jnz 1b - popl %esi - popl %ebx - ret /* EOF */ diff --git a/reactos/ntoskrnl/ex/init.c b/reactos/ntoskrnl/ex/init.c index bba774dbf5e..62f8588822c 100644 --- a/reactos/ntoskrnl/ex/init.c +++ b/reactos/ntoskrnl/ex/init.c @@ -324,7 +324,7 @@ ExpInitNls(IN PLOADER_PARAMETER_BLOCK LoaderBlock) RtlCopyMemory(SectionBase, ExpNlsTableBase, ExpNlsTableSize); /* Free the previously allocated buffer and set the new location */ - ExFreePool(ExpNlsTableBase); + ExFreePoolWithTag(ExpNlsTableBase, TAG('R', 't', 'l', 'i')); ExpNlsTableBase = SectionBase; /* Initialize the NLS Tables */ @@ -981,12 +981,12 @@ ExpInitializeExecutive(IN ULONG Cpu, /* Now fill it in */ Status = RtlAnsiStringToUnicodeString(&NtSystemRoot, &AnsiPath, FALSE); - if (!NT_SUCCESS(Status)) KEBUGCHECK(SESSION3_INITIALIZATION_FAILED); + if (!NT_SUCCESS(Status)) KeBugCheck(SESSION3_INITIALIZATION_FAILED); /* Setup bugcheck messages */ KiInitializeBugCheck(); - /* Setup initial system settings (FIXME: Needs Cm Rewrite) */ + /* Setup initial system settings */ CmGetSystemControlValues(LoaderBlock->RegistryBase, CmControlVector); /* Load static defaults for Service Pack 1 and add our SVN revision */ @@ -1002,7 +1002,7 @@ ExpInitializeExecutive(IN ULONG Cpu, } /* Initialize the executive at phase 0 */ - if (!ExInitSystem()) KEBUGCHECK(PHASE0_INITIALIZATION_FAILED); + if (!ExInitSystem()) KeBugCheck(PHASE0_INITIALIZATION_FAILED); /* Initialize the memory manager at phase 0 */ if (!MmInitSystem(0, LoaderBlock)) KeBugCheck(PHASE0_INITIALIZATION_FAILED); @@ -1203,16 +1203,16 @@ ExpInitializeExecutive(IN ULONG Cpu, #endif /* Create the Basic Object Manager Types to allow new Object Types */ - if (!ObInit()) KEBUGCHECK(OBJECT_INITIALIZATION_FAILED); + if (!ObInitSystem()) KeBugCheck(OBJECT_INITIALIZATION_FAILED); /* Load basic Security for other Managers */ - if (!SeInit()) KEBUGCHECK(SECURITY_INITIALIZATION_FAILED); + if (!SeInitSystem()) KeBugCheck(SECURITY_INITIALIZATION_FAILED); /* Initialize the Process Manager */ - if (!PsInitSystem(LoaderBlock)) KEBUGCHECK(PROCESS_INITIALIZATION_FAILED); + if (!PsInitSystem(LoaderBlock)) KeBugCheck(PROCESS_INITIALIZATION_FAILED); /* Initialize the PnP Manager */ - if (!PpInitSystem()) KEBUGCHECK(PP0_INITIALIZATION_FAILED); + if (!PpInitSystem()) KeBugCheck(PP0_INITIALIZATION_FAILED); /* Initialize the User-Mode Debugging Subsystem */ DbgkInitialize(); @@ -1520,7 +1520,7 @@ Phase1InitializationDiscard(IN PVOID Context) InbvUpdateProgressBar(5); /* Call OB initialization again */ - if (!ObInit()) KeBugCheck(OBJECT1_INITIALIZATION_FAILED); + if (!ObInitSystem()) KeBugCheck(OBJECT1_INITIALIZATION_FAILED); /* Initialize Basic System Objects and Worker Threads */ if (!ExInitSystem()) KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, 0, 0, 1, 0); @@ -1536,7 +1536,7 @@ Phase1InitializationDiscard(IN PVOID Context) } /* Initialize the SRM in Phase 1 */ - if (!SeInit()) KEBUGCHECK(SECURITY1_INITIALIZATION_FAILED); + if (!SeInitSystem()) KeBugCheck(SECURITY1_INITIALIZATION_FAILED); /* Update the progress bar */ InbvUpdateProgressBar(10); diff --git a/reactos/ntoskrnl/ex/locale.c b/reactos/ntoskrnl/ex/locale.c index b8589dd3a29..daecdb08440 100644 --- a/reactos/ntoskrnl/ex/locale.c +++ b/reactos/ntoskrnl/ex/locale.c @@ -12,7 +12,7 @@ #include #define NDEBUG -#include +#include /* GLOBALS *******************************************************************/ @@ -74,7 +74,7 @@ ExpGetCurrentUserUILanguage(IN PWSTR MuiName, /* Success, is the value the right type? */ if (ValueInfo->Type == REG_SZ) { - /* It is. Initailize the data and convert it */ + /* It is. Initialize the data and convert it */ RtlInitUnicodeString(&ValueString, (PWSTR)ValueInfo->Data); Status = RtlUnicodeStringToInteger(&ValueString, 16, &Value); if (NT_SUCCESS(Status)) @@ -245,7 +245,7 @@ NtSetDefaultLocale(IN BOOLEAN UserProfile, { DPRINT1("TODO\n"); Status = STATUS_SUCCESS; - KEBUGCHECK(0); + ASSERT(FALSE); } else { @@ -395,7 +395,7 @@ NtSetDefaultUILanguage(IN LANGID LanguageId) { /* FIXME */ DPRINT1("TODO\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* Otherwise, call the internal routine */ diff --git a/reactos/ntoskrnl/ex/mutant.c b/reactos/ntoskrnl/ex/mutant.c index 13fc099cab6..87c5485b030 100644 --- a/reactos/ntoskrnl/ex/mutant.c +++ b/reactos/ntoskrnl/ex/mutant.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include #if defined (ALLOC_PRAGMA) #pragma alloc_text(INIT, ExpInitializeMutantImplementation) diff --git a/reactos/ntoskrnl/ex/profile.c b/reactos/ntoskrnl/ex/profile.c index 15c0150c388..02b15043762 100644 --- a/reactos/ntoskrnl/ex/profile.c +++ b/reactos/ntoskrnl/ex/profile.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include #if defined (ALLOC_PRAGMA) #pragma alloc_text(INIT, ExpInitializeProfileImplementation) diff --git a/reactos/ntoskrnl/ex/resource.c b/reactos/ntoskrnl/ex/resource.c index ad3e7c516a9..fe054e56ec2 100644 --- a/reactos/ntoskrnl/ex/resource.c +++ b/reactos/ntoskrnl/ex/resource.c @@ -6,14 +6,6 @@ * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) */ -/* - * WARNING: - * This implementation is the Windows NT 5.x one. - * Vista has optimized the OwnerThread entry array and the internals of - * ExpFindEntryForThread and ExpFindFreeEntry probably need to be modified - * accordingly in order to support the WDK. - */ - /* INCLUDES *****************************************************************/ #include diff --git a/reactos/ntoskrnl/ex/rundown.c b/reactos/ntoskrnl/ex/rundown.c index aa1ab24c612..0466e6ed664 100644 --- a/reactos/ntoskrnl/ex/rundown.c +++ b/reactos/ntoskrnl/ex/rundown.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/ntoskrnl/ex/sem.c b/reactos/ntoskrnl/ex/sem.c index ff496cd9b44..b6499c6722b 100644 --- a/reactos/ntoskrnl/ex/sem.c +++ b/reactos/ntoskrnl/ex/sem.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include #if defined (ALLOC_PRAGMA) #pragma alloc_text(INIT, ExpInitializeSemaphoreImplementation) diff --git a/reactos/ntoskrnl/ex/shutdown.c b/reactos/ntoskrnl/ex/shutdown.c index cee5482b087..abf92ee2747 100644 --- a/reactos/ntoskrnl/ex/shutdown.c +++ b/reactos/ntoskrnl/ex/shutdown.c @@ -10,7 +10,7 @@ /* INCLUDES *****************************************************************/ #include -#include +#include /* FUNCTIONS *****************************************************************/ @@ -185,7 +185,7 @@ ShutdownThreadMain(PVOID Context) PKDPC Dpc = ExAllocatePool(NonPagedPool, sizeof(KDPC)); if (Dpc == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } KeInitializeDpc(Dpc, KiHaltProcessorDpcRoutine, (PVOID)Dpc); KeSetTargetProcessorDpc(Dpc, i); @@ -197,7 +197,7 @@ ShutdownThreadMain(PVOID Context) #endif /* CONFIG_SMP */ PopSetSystemPowerState(PowerSystemShutdown); - CHECKPOINT1; + DPRINT1("Shutting down\n"); KiHaltProcessorDpcRoutine(NULL, NULL, NULL, NULL); /* KiHaltProcessor does never return */ @@ -245,7 +245,7 @@ NtShutdownSystem(IN SHUTDOWN_ACTION Action) (PVOID)Action); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } Status = ObReferenceObjectByHandle(ThreadHandle, THREAD_ALL_ACCESS, @@ -256,7 +256,7 @@ NtShutdownSystem(IN SHUTDOWN_ACTION Action) NtClose(ThreadHandle); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } KeSetPriorityThread(&ShutdownThread->Tcb, LOW_REALTIME_PRIORITY + 1); diff --git a/reactos/ntoskrnl/ex/sysinfo.c b/reactos/ntoskrnl/ex/sysinfo.c index d36cdce75f9..b7e9bf25d15 100644 --- a/reactos/ntoskrnl/ex/sysinfo.c +++ b/reactos/ntoskrnl/ex/sysinfo.c @@ -12,7 +12,7 @@ #include #define NDEBUG -#include +#include VOID MmPrintMemoryStatistic(VOID); diff --git a/reactos/ntoskrnl/ex/time.c b/reactos/ntoskrnl/ex/time.c index 8dd4aaed68f..ddf0b64eba4 100644 --- a/reactos/ntoskrnl/ex/time.c +++ b/reactos/ntoskrnl/ex/time.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include #define TICKSPERMINUTE 600000000 diff --git a/reactos/ntoskrnl/ex/uuid.c b/reactos/ntoskrnl/ex/uuid.c index c3957a5c4ab..ff953b331f7 100644 --- a/reactos/ntoskrnl/ex/uuid.c +++ b/reactos/ntoskrnl/ex/uuid.c @@ -12,7 +12,7 @@ #include #define NDEBUG -#include +#include #define SEED_BUFFER_SIZE 6 diff --git a/reactos/ntoskrnl/ex/win32k.c b/reactos/ntoskrnl/ex/win32k.c index 6180de75dd2..ff9d753f308 100644 --- a/reactos/ntoskrnl/ex/win32k.c +++ b/reactos/ntoskrnl/ex/win32k.c @@ -8,7 +8,7 @@ #include #define NDEBUG -#include +#include #if defined (ALLOC_PRAGMA) #pragma alloc_text(INIT, ExpWin32kInit) diff --git a/reactos/ntoskrnl/ex/work.c b/reactos/ntoskrnl/ex/work.c index c17f498e4ed..7d1e8146663 100644 --- a/reactos/ntoskrnl/ex/work.c +++ b/reactos/ntoskrnl/ex/work.c @@ -10,7 +10,7 @@ #include #define NDEBUG -#include +#include #if defined (ALLOC_PRAGMA) #pragma alloc_text(INIT, ExpInitializeWorkerThreads) @@ -177,7 +177,7 @@ ProcessLoop: if (KeGetCurrentIrql() != PASSIVE_LEVEL) { /* It didn't, bugcheck! */ - KEBUGCHECKEX(WORKER_THREAD_RETURNED_AT_BAD_IRQL, + KeBugCheckEx(WORKER_THREAD_RETURNED_AT_BAD_IRQL, (ULONG_PTR)WorkItem->WorkerRoutine, KeGetCurrentIrql(), (ULONG_PTR)WorkItem->Parameter, @@ -188,7 +188,7 @@ ProcessLoop: if (Thread->ActiveImpersonationInfo) { /* It didn't, bugcheck! */ - KEBUGCHECKEX(IMPERSONATING_WORKER_THREAD, + KeBugCheckEx(IMPERSONATING_WORKER_THREAD, (ULONG_PTR)WorkItem->WorkerRoutine, (ULONG_PTR)WorkItem->Parameter, (ULONG_PTR)WorkItem, @@ -628,7 +628,7 @@ ExQueueWorkItem(IN PWORK_QUEUE_ITEM WorkItem, if ((ULONG_PTR)WorkItem->WorkerRoutine < MmUserProbeAddress) { /* Bugcheck the system */ - KEBUGCHECKEX(WORKER_INVALID, + KeBugCheckEx(WORKER_INVALID, 1, (ULONG_PTR)WorkItem, (ULONG_PTR)WorkItem->WorkerRoutine, diff --git a/reactos/ntoskrnl/fsrtl/dbcsname.c b/reactos/ntoskrnl/fsrtl/dbcsname.c index f2535d3c6db..6be74e4c95c 100644 --- a/reactos/ntoskrnl/fsrtl/dbcsname.c +++ b/reactos/ntoskrnl/fsrtl/dbcsname.c @@ -45,7 +45,7 @@ FsRtlDissectDbcs(IN ANSI_STRING Name, OUT PANSI_STRING FirstPart, OUT PANSI_STRING RemainingPart) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); } /*++ @@ -109,7 +109,7 @@ NTAPI FsRtlIsDbcsInExpression(IN PANSI_STRING Expression, IN PANSI_STRING Name) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); return FALSE; } @@ -143,7 +143,7 @@ FsRtlIsFatDbcsLegal(IN ANSI_STRING DbcsName, IN BOOLEAN PathNamePermissible, IN BOOLEAN LeadingBackslashPermissible) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); return FALSE; } @@ -177,6 +177,6 @@ FsRtlIsHpfsDbcsLegal(IN ANSI_STRING DbcsName, IN BOOLEAN PathNamePermissible, IN BOOLEAN LeadingBackslashPermissible) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); return FALSE; } diff --git a/reactos/ntoskrnl/fsrtl/fastio.c b/reactos/ntoskrnl/fsrtl/fastio.c index 99acb807da7..d6490876651 100644 --- a/reactos/ntoskrnl/fsrtl/fastio.c +++ b/reactos/ntoskrnl/fsrtl/fastio.c @@ -1398,7 +1398,7 @@ FsRtlAcquireFileExclusive(IN PFILE_OBJECT FileObject) PAGED_CODE(); FsRtlAcquireFileExclusiveCommon(FileObject,0,0); */ - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); } /* @@ -1409,7 +1409,7 @@ NTAPI FsRtlReleaseFile(IN PFILE_OBJECT FileObject) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); } /*++ diff --git a/reactos/ntoskrnl/fsrtl/filelock.c b/reactos/ntoskrnl/fsrtl/filelock.c index 5491088d99c..8e28eb48859 100644 --- a/reactos/ntoskrnl/fsrtl/filelock.c +++ b/reactos/ntoskrnl/fsrtl/filelock.c @@ -55,7 +55,7 @@ NTAPI FsRtlGetNextFileLock(IN PFILE_LOCK FileLock, IN BOOLEAN Restart) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); return NULL; } @@ -115,7 +115,7 @@ NTAPI FsRtlCheckLockForReadAccess(IN PFILE_LOCK FileLock, IN PIRP Irp) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); return FALSE; } @@ -127,7 +127,7 @@ NTAPI FsRtlCheckLockForWriteAccess(IN PFILE_LOCK FileLock, IN PIRP Irp) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); return FALSE; } @@ -143,7 +143,7 @@ FsRtlFastCheckLockForRead(IN PFILE_LOCK FileLock, IN PFILE_OBJECT FileObject, IN PEPROCESS Process) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); return FALSE; } @@ -159,7 +159,7 @@ FsRtlFastCheckLockForWrite(IN PFILE_LOCK FileLock, IN PFILE_OBJECT FileObject, IN PEPROCESS Process) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); return FALSE; } @@ -192,7 +192,7 @@ FsRtlFastUnlockAll(IN PFILE_LOCK FileLock, IN PEPROCESS Process, IN PVOID Context OPTIONAL) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); return STATUS_UNSUCCESSFUL; } @@ -207,7 +207,7 @@ FsRtlFastUnlockAllByKey(IN PFILE_LOCK FileLock, IN ULONG Key, IN PVOID Context OPTIONAL) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); return STATUS_UNSUCCESSFUL; } diff --git a/reactos/ntoskrnl/fsrtl/filtrctx.c b/reactos/ntoskrnl/fsrtl/filtrctx.c index 7ce96f4fafd..63149bf94e0 100644 --- a/reactos/ntoskrnl/fsrtl/filtrctx.c +++ b/reactos/ntoskrnl/fsrtl/filtrctx.c @@ -32,7 +32,7 @@ LOGICAL NTAPI FsRtlIsPagingFile(IN PFILE_OBJECT FileObject) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); return FALSE; } @@ -45,7 +45,7 @@ FsRtlLookupPerStreamContextInternal(IN PFSRTL_ADVANCED_FCB_HEADER StreamContext, IN PVOID OwnerId OPTIONAL, IN PVOID InstanceId OPTIONAL) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); return FALSE; } @@ -58,7 +58,7 @@ FsRtlLookupPerFileObjectContext(IN PFILE_OBJECT FileObject, IN PVOID OwnerId OPTIONAL, IN PVOID InstanceId OPTIONAL) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); return FALSE; } @@ -70,7 +70,7 @@ NTAPI FsRtlInsertPerStreamContext(IN PFSRTL_ADVANCED_FCB_HEADER PerStreamContext, IN PFSRTL_PER_STREAM_CONTEXT Ptr) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); return STATUS_NOT_IMPLEMENTED; } @@ -83,7 +83,7 @@ FsRtlRemovePerStreamContext(IN PFSRTL_ADVANCED_FCB_HEADER StreamContext, IN PVOID OwnerId OPTIONAL, IN PVOID InstanceId OPTIONAL) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); return NULL; } @@ -95,7 +95,7 @@ NTAPI FsRtlInsertPerFileObjectContext(IN PFILE_OBJECT FileObject, IN PFSRTL_PER_FILEOBJECT_CONTEXT Ptr) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); return STATUS_NOT_IMPLEMENTED; } @@ -108,7 +108,7 @@ FsRtlRemovePerFileObjectContext(IN PFILE_OBJECT PerFileObjectContext, IN PVOID OwnerId OPTIONAL, IN PVOID InstanceId OPTIONAL) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); return NULL; } @@ -119,6 +119,6 @@ VOID NTAPI FsRtlTeardownPerStreamContexts(IN PFSRTL_ADVANCED_FCB_HEADER AdvancedHeader) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); } diff --git a/reactos/ntoskrnl/fsrtl/fsfilter.c b/reactos/ntoskrnl/fsrtl/fsfilter.c index 378c816fa8e..78904e7982b 100644 --- a/reactos/ntoskrnl/fsrtl/fsfilter.c +++ b/reactos/ntoskrnl/fsrtl/fsfilter.c @@ -69,7 +69,7 @@ FsRtlCreateSectionForDataScan(OUT PHANDLE SectionHandle, IN ULONG Flags) { /* Unimplemented */ - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); return STATUS_NOT_IMPLEMENTED; } diff --git a/reactos/ntoskrnl/fsrtl/largemcb.c b/reactos/ntoskrnl/fsrtl/largemcb.c index a63dc90a623..2785f97b6b5 100644 --- a/reactos/ntoskrnl/fsrtl/largemcb.c +++ b/reactos/ntoskrnl/fsrtl/largemcb.c @@ -24,7 +24,7 @@ FsRtlAddLargeMcbEntry(IN PLARGE_MCB Mcb, IN LONGLONG Lbn, IN LONGLONG SectorCount) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); return FALSE; } @@ -57,7 +57,7 @@ FsRtlGetNextLargeMcbEntry(IN PLARGE_MCB Mcb, OUT PLONGLONG Lbn, OUT PLONGLONG SectorCount) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); *Vbn = 0; *Lbn = 0; *SectorCount= 0; @@ -105,7 +105,7 @@ NTAPI FsRtlInitializeLargeMcb(IN PLARGE_MCB Mcb, IN POOL_TYPE PoolType) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); } /* @@ -134,7 +134,7 @@ FsRtlLookupLargeMcbEntry(IN PLARGE_MCB Mcb, OUT PLONGLONG SectorCountFromStartingLbn OPTIONAL, OUT PULONG Index OPTIONAL) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); *Lbn = 0; *SectorCountFromLbn = 0; return FALSE; @@ -150,7 +150,7 @@ FsRtlLookupLastLargeMcbEntryAndIndex(IN PLARGE_MCB OpaqueMcb, OUT PLONGLONG LargeLbn, OUT PULONG Index) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); *LargeVbn = 0; *LargeLbn = 0; *Index = 0; @@ -166,7 +166,7 @@ FsRtlLookupLastLargeMcbEntry(IN PLARGE_MCB Mcb, OUT PLONGLONG Vbn, OUT PLONGLONG Lbn) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); return(FALSE); } @@ -269,7 +269,7 @@ FsRtlRemoveLargeMcbEntry(IN PLARGE_MCB Mcb, IN LONGLONG Vbn, IN LONGLONG SectorCount) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); } /* @@ -295,7 +295,7 @@ NTAPI FsRtlResetLargeMcb(IN PLARGE_MCB Mcb, IN BOOLEAN SelfSynchronized) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); } /* @@ -307,7 +307,7 @@ FsRtlSplitLargeMcb(IN PLARGE_MCB Mcb, IN LONGLONG Vbn, IN LONGLONG Amount) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); return FALSE; } @@ -319,7 +319,7 @@ NTAPI FsRtlTruncateLargeMcb(IN PLARGE_MCB Mcb, IN LONGLONG Vbn) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); } /* @@ -342,7 +342,7 @@ VOID NTAPI FsRtlUninitializeLargeMcb(IN PLARGE_MCB Mcb) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); } /* diff --git a/reactos/ntoskrnl/fsrtl/notify.c b/reactos/ntoskrnl/fsrtl/notify.c index fae90245469..bd2cf09f0ca 100644 --- a/reactos/ntoskrnl/fsrtl/notify.c +++ b/reactos/ntoskrnl/fsrtl/notify.c @@ -96,7 +96,7 @@ FsRtlNotifyCleanup(IN PNOTIFY_SYNC NotifySync, IN PLIST_ENTRY NotifyList, IN PVOID FsContext) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); } /*++ @@ -157,7 +157,7 @@ FsRtlNotifyFilterChangeDirectory(IN PNOTIFY_SYNC NotifySync, IN PSECURITY_SUBJECT_CONTEXT SubjectContext OPTIONAL, IN PFILTER_REPORT_CHANGE FilterCallback OPTIONAL) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); } /*++ @@ -214,7 +214,7 @@ FsRtlNotifyFilterReportChange(IN PNOTIFY_SYNC NotifySync, IN PVOID TargetContext, IN PVOID FilterContext) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); } /*++ @@ -271,7 +271,7 @@ FsRtlNotifyFullChangeDirectory(IN PNOTIFY_SYNC NotifySync, IN PCHECK_FOR_TRAVERSE_ACCESS TraverseCallback OPTIONAL, IN PSECURITY_SUBJECT_CONTEXT SubjectContext OPTIONAL) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); } /*++ @@ -324,7 +324,7 @@ FsRtlNotifyFullReportChange(IN PNOTIFY_SYNC NotifySync, IN ULONG Action, IN PVOID TargetContext) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); } /*++ @@ -345,7 +345,7 @@ VOID NTAPI FsRtlNotifyInitializeSync(IN PNOTIFY_SYNC *NotifySync) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); } /*++ @@ -382,7 +382,7 @@ FsRtlNotifyReportChange(IN PNOTIFY_SYNC NotifySync, IN PUSHORT FileNamePartLength, IN ULONG FilterMatch) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); } /*++ @@ -404,6 +404,6 @@ VOID NTAPI FsRtlNotifyUninitializeSync(IN PNOTIFY_SYNC *NotifySync) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); } diff --git a/reactos/ntoskrnl/fsrtl/oplock.c b/reactos/ntoskrnl/fsrtl/oplock.c index d92643ed418..c02521d397d 100644 --- a/reactos/ntoskrnl/fsrtl/oplock.c +++ b/reactos/ntoskrnl/fsrtl/oplock.c @@ -49,7 +49,7 @@ FsRtlCheckOplock(IN POPLOCK Oplock, IN POPLOCK_FS_PREPOST_IRP PostIrpRoutine OPTIONAL) { /* Unimplemented */ - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); return STATUS_NOT_IMPLEMENTED; } @@ -72,7 +72,7 @@ NTAPI FsRtlCurrentBatchOplock(IN POPLOCK Oplock) { /* Unimplemented */ - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); return FALSE; } @@ -95,7 +95,7 @@ NTAPI FsRtlInitializeOplock(IN OUT POPLOCK Oplock) { /* Unimplemented */ - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); } /*++ @@ -125,7 +125,7 @@ FsRtlOplockFsctrl(IN POPLOCK Oplock, IN ULONG OpenCount) { /* Unimplemented */ - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); return STATUS_NOT_IMPLEMENTED; } @@ -148,7 +148,7 @@ NTAPI FsRtlOplockIsFastIoPossible(IN POPLOCK Oplock) { /* Unimplemented */ - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); return FALSE; } @@ -171,6 +171,6 @@ NTAPI FsRtlUninitializeOplock(IN POPLOCK Oplock) { /* Unimplemented */ - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); } diff --git a/reactos/ntoskrnl/fsrtl/pnp.c b/reactos/ntoskrnl/fsrtl/pnp.c index f0b23f310ca..f3ce085a764 100644 --- a/reactos/ntoskrnl/fsrtl/pnp.c +++ b/reactos/ntoskrnl/fsrtl/pnp.c @@ -37,6 +37,6 @@ FsRtlNotifyVolumeEvent(IN PFILE_OBJECT FileObject, IN ULONG EventCode) { /* Unimplemented */ - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); return STATUS_NOT_IMPLEMENTED; } diff --git a/reactos/ntoskrnl/fsrtl/stackovf.c b/reactos/ntoskrnl/fsrtl/stackovf.c index af6cd579c3a..776cb4b23e7 100644 --- a/reactos/ntoskrnl/fsrtl/stackovf.c +++ b/reactos/ntoskrnl/fsrtl/stackovf.c @@ -63,7 +63,7 @@ FsRtlPostStackOverflow(IN PVOID Context, IN PKEVENT Event, IN PFSRTL_STACK_OVERFLOW_ROUTINE StackOverflowRoutine) { - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); } /* EOF */ diff --git a/reactos/ntoskrnl/fsrtl/tunnel.c b/reactos/ntoskrnl/fsrtl/tunnel.c index 6347126994e..9ede1ec5693 100644 --- a/reactos/ntoskrnl/fsrtl/tunnel.c +++ b/reactos/ntoskrnl/fsrtl/tunnel.c @@ -57,7 +57,7 @@ FsRtlAddToTunnelCache(IN PTUNNEL Cache, IN PVOID Data) { /* Unimplemented */ - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); } /*++ @@ -83,7 +83,7 @@ FsRtlDeleteKeyFromTunnelCache(IN PTUNNEL Cache, IN ULONGLONG DirectoryKey) { /* Unimplemented */ - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); } /*++ @@ -105,7 +105,7 @@ NTAPI FsRtlDeleteTunnelCache(IN PTUNNEL Cache) { /* Unimplemented */ - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); } /*++ @@ -151,7 +151,7 @@ FsRtlFindInTunnelCache(IN PTUNNEL Cache, OUT PVOID Data) { /* Unimplemented */ - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); return FALSE; } @@ -174,7 +174,7 @@ NTAPI FsRtlInitializeTunnelCache(IN PTUNNEL Cache) { /* Unimplemented */ - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); } /* EOF */ diff --git a/reactos/ntoskrnl/fsrtl/unc.c b/reactos/ntoskrnl/fsrtl/unc.c index 8738a97ee1c..e0fe5081e09 100644 --- a/reactos/ntoskrnl/fsrtl/unc.c +++ b/reactos/ntoskrnl/fsrtl/unc.c @@ -33,7 +33,7 @@ NTAPI FsRtlDeregisterUncProvider(IN HANDLE Handle) { /* Unimplemented */ - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); } /*++ @@ -62,6 +62,6 @@ FsRtlRegisterUncProvider(IN OUT PHANDLE Handle, IN BOOLEAN MailslotsSupported) { /* Unimplemented */ - KEBUGCHECK(0); + KeBugCheck(FILE_SYSTEM); return STATUS_NOT_IMPLEMENTED; } diff --git a/reactos/ntoskrnl/fstub/disksup.c b/reactos/ntoskrnl/fstub/disksup.c index e799d605796..725ac343b75 100644 --- a/reactos/ntoskrnl/fstub/disksup.c +++ b/reactos/ntoskrnl/fstub/disksup.c @@ -12,7 +12,7 @@ #include #define NDEBUG -#include +#include #include /* DEPRECATED FUNCTIONS ******************************************************/ @@ -948,7 +948,7 @@ HalpGetFullGeometry(IN PDEVICE_OBJECT DeviceObject, if (!Irp) { /* Fail, free the event */ - ExFreePool(Event); + ExFreePoolWithTag(Event, TAG_FILE_SYSTEM); return STATUS_INSUFFICIENT_RESOURCES; } @@ -977,7 +977,7 @@ HalpGetFullGeometry(IN PDEVICE_OBJECT DeviceObject, if (!Irp) { /* Fail, free the event */ - ExFreePool(Event); + ExFreePoolWithTag(Event, TAG_FILE_SYSTEM); return STATUS_INSUFFICIENT_RESOURCES; } @@ -1000,7 +1000,7 @@ HalpGetFullGeometry(IN PDEVICE_OBJECT DeviceObject, } /* Free the event and return the Status */ - ExFreePool(Event); + ExFreePoolWithTag(Event, TAG_FILE_SYSTEM); return Status; } @@ -1200,7 +1200,7 @@ xHalGetPartialGeometry(IN PDEVICE_OBJECT DeviceObject, Cleanup: /* Free all the pointers */ - if (Event) ExFreePool(Event); + if (Event) ExFreePoolWithTag(Event, TAG_FILE_SYSTEM); if (IoStatusBlock) ExFreePool(IoStatusBlock); if (DiskGeometry) ExFreePool(DiskGeometry); return; @@ -1251,7 +1251,7 @@ xHalExamineMBR(IN PDEVICE_OBJECT DeviceObject, if (!Irp) { /* Failed */ - ExFreePool(Buffer); + ExFreePoolWithTag(Buffer, TAG_FILE_SYSTEM); return; } @@ -1275,7 +1275,7 @@ xHalExamineMBR(IN PDEVICE_OBJECT DeviceObject, if (((PUSHORT)Buffer)[BOOT_SIGNATURE_OFFSET] != BOOT_RECORD_SIGNATURE) { /* Failed */ - ExFreePool(Buffer); + ExFreePoolWithTag(Buffer, TAG_FILE_SYSTEM); return; } @@ -1287,7 +1287,7 @@ xHalExamineMBR(IN PDEVICE_OBJECT DeviceObject, if (PartitionDescriptor->PartitionType != MbrTypeIdentifier) { /* It's not, free our buffer */ - ExFreePool(Buffer); + ExFreePoolWithTag(Buffer, TAG_FILE_SYSTEM); } else { @@ -1367,7 +1367,7 @@ xHalIoReadPartitionTable(IN PDEVICE_OBJECT DeviceObject, Status = HalpGetFullGeometry(DeviceObject, &DiskGeometry, &MaxOffset); if (!NT_SUCCESS(Status)) { - ExFreePool(*PartitionBuffer); + ExFreePoolWithTag(*PartitionBuffer, TAG_FILE_SYSTEM); *PartitionBuffer = NULL; return Status; } @@ -1383,7 +1383,8 @@ xHalIoReadPartitionTable(IN PDEVICE_OBJECT DeviceObject, if (!Buffer) { /* Fail, free the input buffer */ - ExFreePool(*PartitionBuffer); + ExFreePoolWithTag(*PartitionBuffer, TAG_FILE_SYSTEM); + *PartitionBuffer = NULL; return STATUS_INSUFFICIENT_RESOURCES; } @@ -1549,7 +1550,7 @@ xHalIoReadPartitionTable(IN PDEVICE_OBJECT DeviceObject, BufferSize); /* Free the old buffer and set this one as the new one */ - ExFreePool(*PartitionBuffer); + ExFreePoolWithTag(*PartitionBuffer, TAG_FILE_SYSTEM); *PartitionBuffer = DriveLayoutInfo; /* Double the size */ @@ -1732,8 +1733,8 @@ xHalIoReadPartitionTable(IN PDEVICE_OBJECT DeviceObject, if (!i) (*PartitionBuffer)->Signature = 0; /* Free the buffer and check for success */ - if (Buffer) ExFreePool(Buffer); - if (!NT_SUCCESS(Status)) ExFreePool(*PartitionBuffer); + if (Buffer) ExFreePoolWithTag(Buffer, TAG_FILE_SYSTEM); + if (!NT_SUCCESS(Status)) ExFreePoolWithTag(*PartitionBuffer, TAG_FILE_SYSTEM); /* Return status */ return Status; @@ -2212,7 +2213,7 @@ xHalIoWritePartitionTable(IN PDEVICE_OBJECT DeviceObject, } /* If we had a buffer, free it, then return status */ - if (Buffer) ExFreePool(Buffer); + if (Buffer) ExFreePoolWithTag(Buffer, TAG_FILE_SYSTEM); return Status; } diff --git a/reactos/ntoskrnl/fstub/fstubex.c b/reactos/ntoskrnl/fstub/fstubex.c index 87125b4121f..bd419931f16 100644 --- a/reactos/ntoskrnl/fstub/fstubex.c +++ b/reactos/ntoskrnl/fstub/fstubex.c @@ -10,7 +10,7 @@ #include #define NDEBUG -#include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/ntoskrnl/fstub/halstub.c b/reactos/ntoskrnl/fstub/halstub.c index 4cd0d418610..fbce1057a90 100644 --- a/reactos/ntoskrnl/fstub/halstub.c +++ b/reactos/ntoskrnl/fstub/halstub.c @@ -10,7 +10,7 @@ #include #define NDEBUG -#include +#include /* GLOBALS *******************************************************************/ diff --git a/reactos/ntoskrnl/include/internal/cc.h b/reactos/ntoskrnl/include/internal/cc.h index c1ab3cffbd9..9993fc81f11 100644 --- a/reactos/ntoskrnl/include/internal/cc.h +++ b/reactos/ntoskrnl/include/internal/cc.h @@ -301,13 +301,4 @@ NTSTATUS NTAPI CcTryToInitializeFileCache(PFILE_OBJECT FileObject); -/* - * Macro for generic cache manage bugchecking. Note that this macro assumes - * that the file name including extension is always longer than 4 characters. - */ -#define KEBUGCHECKCC \ - KEBUGCHECKEX(CACHE_MANAGER, \ - (*(ULONG*)(__FILE__ + sizeof(__FILE__) - 4) << 16) | \ - (__LINE__ & 0xFFFF), 0, 0, 0) - #endif diff --git a/reactos/ntoskrnl/include/internal/cm.h b/reactos/ntoskrnl/include/internal/cm.h index 8e9289817dd..a930f05e9cb 100644 --- a/reactos/ntoskrnl/include/internal/cm.h +++ b/reactos/ntoskrnl/include/internal/cm.h @@ -899,6 +899,12 @@ CmpCleanUpSubKeyInfo( IN PCM_KEY_CONTROL_BLOCK Kcb ); +PUNICODE_STRING +NTAPI +CmpConstructName( + IN PCM_KEY_CONTROL_BLOCK Kcb +); + VOID NTAPI CmpDereferenceKeyControlBlockWithLock( @@ -1405,6 +1411,12 @@ CmLoadKey( // // Startup and Shutdown // +BOOLEAN +NTAPI +CmInitSystem1( + VOID +); + VOID NTAPI CmShutdownSystem( diff --git a/reactos/ntoskrnl/include/internal/debug.h b/reactos/ntoskrnl/include/internal/debug.h deleted file mode 100644 index a45e5ca8af4..00000000000 --- a/reactos/ntoskrnl/include/internal/debug.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: include/internal/debug.h - * PURPOSE: Useful debugging macros - * PROGRAMMER: David Welch (welch@mcmail.com) - * UPDATE HISTORY: - * 28/05/98: Created - */ - -/* - * NOTES: Define DBG in configuration file for "checked" version - * Define NDEBUG before including this header to disable debugging - * macros - * Define NASSERT before including this header to disable assertions - */ - -#include - -#ifndef __NTOSKRNL_DEBUG -#define __NTOSKRNL_DEBUG - -#include - -#if defined(_MSC_VER) && (_MSC_VER < 1300) -/* TODO: Verify which version the MS compiler learned the __FUNCTION__ macro */ -#define __FUNCTION__ "" -#endif - -#define CPRINT DPRINT1 - -/* - * FUNCTION: Assert a maximum value for the current irql - * ARGUMENTS: - * x = Maximum irql - */ -#define ASSERT_IRQL_LESS_OR_EQUAL(x) ASSERT(KeGetCurrentIrql()<=(x)) -#define ASSERT_IRQL_EQUAL(x) ASSERT(KeGetCurrentIrql()==(x)) -#define ASSERT_IRQL_LESS(x) ASSERT(KeGetCurrentIrql()<(x)) - -#endif /* __NTOSKRNL_DEBUG */ diff --git a/reactos/ntoskrnl/include/internal/ex.h b/reactos/ntoskrnl/include/internal/ex.h index 3881a335703..fd3a458d644 100644 --- a/reactos/ntoskrnl/include/internal/ex.h +++ b/reactos/ntoskrnl/include/internal/ex.h @@ -1008,13 +1008,6 @@ ExTryToAcquireResourceExclusiveLite( IN PERESOURCE Resource ); -LONGLONG -FASTCALL -ExfpInterlockedExchange64( - LONGLONG volatile * Destination, - PLONGLONG Exchange -); - NTSTATUS ExpSetTimeZoneInformation(PTIME_ZONE_INFORMATION TimeZoneInformation); @@ -1069,7 +1062,4 @@ XIPInit( #define ExfInterlockedCompareExchange64UL(Destination, Exchange, Comperand) \ (ULONGLONG)ExfInterlockedCompareExchange64((PLONGLONG)(Destination), (PLONGLONG)(Exchange), (PLONGLONG)(Comperand)) -#define ExfpInterlockedExchange64UL(Target, Value) \ - (ULONGLONG)ExfpInterlockedExchange64((PLONGLONG)(Target), (PLONGLONG)(Value)) - #endif /* __NTOSKRNL_INCLUDE_INTERNAL_EXECUTIVE_H */ diff --git a/reactos/ntoskrnl/include/internal/i386/fpu.h b/reactos/ntoskrnl/include/internal/i386/fpu.h deleted file mode 100644 index d13a3e3a54e..00000000000 --- a/reactos/ntoskrnl/include/internal/i386/fpu.h +++ /dev/null @@ -1,5 +0,0 @@ -#ifndef __NTOSKRNL_INCLUDE_INTERNAL_I386_FPU_H -#define __NTOSKRNL_INCLUDE_INTERNAL_I386_FPU_H - -#endif /* __NTOSKRNL_INCLUDE_INTERNAL_I386_FPU_H */ - diff --git a/reactos/ntoskrnl/include/internal/i386/ke.h b/reactos/ntoskrnl/include/internal/i386/ke.h index 64d1c1310fc..cd4eddfacb0 100644 --- a/reactos/ntoskrnl/include/internal/i386/ke.h +++ b/reactos/ntoskrnl/include/internal/i386/ke.h @@ -5,42 +5,6 @@ #pragma GCC system_header #endif -#define X86_EFLAGS_TF 0x00000100 /* Trap flag */ -#define X86_EFLAGS_IF 0x00000200 /* Interrupt Enable flag */ -#define X86_EFLAGS_IOPL 0x00003000 /* I/O Privilege Level bits */ -#define X86_EFLAGS_NT 0x00004000 /* Nested Task flag */ -#define X86_EFLAGS_RF 0x00010000 /* Resume flag */ -#define X86_EFLAGS_VM 0x00020000 /* Virtual Mode */ -#define X86_EFLAGS_ID 0x00200000 /* CPUID detection flag */ - -#define X86_CR0_PE 0x00000001 /* enable Protected Mode */ -#define X86_CR0_NE 0x00000020 /* enable native FPU error reporting */ -#define X86_CR0_TS 0x00000008 /* enable exception on FPU instruction for task switch */ -#define X86_CR0_EM 0x00000004 /* enable FPU emulation (disable FPU) */ -#define X86_CR0_MP 0x00000002 /* enable FPU monitoring */ -#define X86_CR0_WP 0x00010000 /* enable Write Protect (copy on write) */ -#define X86_CR0_PG 0x80000000 /* enable Paging */ - -#define X86_CR4_PAE 0x00000020 /* enable physical address extensions */ -#define X86_CR4_PGE 0x00000080 /* enable global pages */ -#define X86_CR4_OSFXSR 0x00000200 /* enable FXSAVE/FXRSTOR instructions */ -#define X86_CR4_OSXMMEXCPT 0x00000400 /* enable #XF exception */ - -#define X86_FEATURE_VME 0x00000002 /* Virtual 8086 Extensions are present */ -#define X86_FEATURE_TSC 0x00000010 /* time stamp counters are present */ -#define X86_FEATURE_PAE 0x00000040 /* physical address extension is present */ -#define X86_FEATURE_CX8 0x00000100 /* CMPXCHG8B instruction present */ -#define X86_FEATURE_SYSCALL 0x00000800 /* SYSCALL/SYSRET support present */ -#define X86_FEATURE_PGE 0x00002000 /* Page Global Enable */ -#define X86_FEATURE_MMX 0x00800000 /* MMX extension present */ -#define X86_FEATURE_FXSR 0x01000000 /* FXSAVE/FXRSTOR instructions present */ -#define X86_FEATURE_SSE 0x02000000 /* SSE extension present */ -#define X86_FEATURE_SSE2 0x04000000 /* SSE2 extension present */ -#define X86_FEATURE_HT 0x10000000 /* Hyper-Threading present */ - -#define X86_EXT_FEATURE_SSE3 0x00000001 /* SSE3 extension present */ -#define X86_EXT_FEATURE_3DNOW 0x40000000 /* 3DNOW! extension present */ - #define FRAME_EDITED 0xFFF8 #ifndef __ASM__ diff --git a/reactos/ntoskrnl/include/internal/i386/v86m.h b/reactos/ntoskrnl/include/internal/i386/v86m.h index 0596b362d7f..dcbaf7e2f8a 100644 --- a/reactos/ntoskrnl/include/internal/i386/v86m.h +++ b/reactos/ntoskrnl/include/internal/i386/v86m.h @@ -59,68 +59,3 @@ typedef struct _KV86M_TRAP_FRAME } KV86M_TRAP_FRAME, *PKV86M_TRAP_FRAME; #endif - -/* EOF */ -#ifndef __V86M_ -#define __V86M_ - -#include "ketypes.h" - -/* Emulate cli/sti instructions */ -#define KV86M_EMULATE_CLI_STI (0x1) -/* Allow the v86 mode code to access i/o ports */ -#define KV86M_ALLOW_IO_PORT_ACCESS (0x2) - -typedef struct _KV86M_REGISTERS -{ - /* - * General purpose registers - */ - ULONG Ebp; - ULONG Edi; - ULONG Esi; - ULONG Edx; - ULONG Ecx; - ULONG Ebx; - ULONG Eax; - ULONG Ds; - ULONG Es; - ULONG Fs; - ULONG Gs; - - /* - * Control registers - */ - ULONG Eip; - ULONG Cs; - ULONG Eflags; - ULONG Esp; - ULONG Ss; - - /* - * Control structures - */ - ULONG RecoveryAddress; - UCHAR RecoveryInstruction[4]; - ULONG Vif; - ULONG Flags; - PNTSTATUS PStatus; -} KV86M_REGISTERS, *PKV86M_REGISTERS; - -typedef struct _KV86M_TRAP_FRAME -{ - KTRAP_FRAME Tf; - - ULONG SavedExceptionStack; - - /* - * These are put on the top of the stack by the routine that entered - * v86 mode so the exception handlers can find the control information - */ - struct _KV86M_REGISTERS* regs; - ULONG orig_ebp; -} KV86M_TRAP_FRAME, *PKV86M_TRAP_FRAME; - -#endif - -/* EOF */ diff --git a/reactos/ntoskrnl/include/internal/io.h b/reactos/ntoskrnl/include/internal/io.h index 235ab7ffda1..3f18138a968 100644 --- a/reactos/ntoskrnl/include/internal/io.h +++ b/reactos/ntoskrnl/include/internal/io.h @@ -553,8 +553,12 @@ IopActionConfigureChildServices( NTSTATUS IopActionInitChildServices( IN PDEVICE_NODE DeviceNode, - IN PVOID Context, - IN BOOLEAN BootDrivers + IN PVOID Context +); + +NTSTATUS +IopEnumerateDevice( + IN PDEVICE_OBJECT DeviceObject ); NTSTATUS @@ -579,16 +583,23 @@ IopQueueTargetDeviceEvent( NTSTATUS IopInitializePnpServices( - IN PDEVICE_NODE DeviceNode, - IN BOOLEAN BootDrivers); + IN PDEVICE_NODE DeviceNode); NTSTATUS +NTAPI IopOpenRegistryKeyEx( PHANDLE KeyHandle, HANDLE ParentKey, PUNICODE_STRING Name, ACCESS_MASK DesiredAccess); +NTSTATUS +NTAPI +IopGetRegistryValue(IN HANDLE Handle, + IN PWSTR ValueName, + OUT PKEY_VALUE_FULL_INFORMATION *Information); + + // // Initialization Routines // diff --git a/reactos/ntoskrnl/include/internal/kd.h b/reactos/ntoskrnl/include/internal/kd.h index a799b3b149c..9390411b128 100644 --- a/reactos/ntoskrnl/include/internal/kd.h +++ b/reactos/ntoskrnl/include/internal/kd.h @@ -183,6 +183,13 @@ KD_CONTINUE_TYPE /* INIT ROUTINES *************************************************************/ +BOOLEAN +NTAPI +KdInitSystem( + ULONG Reserved, + PLOADER_PARAMETER_BLOCK LoaderBlock +); + VOID STDCALL KdpScreenInit( diff --git a/reactos/ntoskrnl/include/internal/kd64.h b/reactos/ntoskrnl/include/internal/kd64.h index 6387e6fc1bd..b129260d1cf 100644 --- a/reactos/ntoskrnl/include/internal/kd64.h +++ b/reactos/ntoskrnl/include/internal/kd64.h @@ -50,6 +50,16 @@ BOOLEAN IN BOOLEAN SecondChance ); +// +// Initialization Routines +// +BOOLEAN +NTAPI +KdInitSystem( + ULONG Reserved, + PLOADER_PARAMETER_BLOCK LoaderBlock +); + // // Debug and Multi-Processor Switch Routines // diff --git a/reactos/ntoskrnl/include/internal/mm.h b/reactos/ntoskrnl/include/internal/mm.h index 7073011d33d..46de9701da1 100644 --- a/reactos/ntoskrnl/include/internal/mm.h +++ b/reactos/ntoskrnl/include/internal/mm.h @@ -164,6 +164,13 @@ typedef ULONG PFN_TYPE, *PPFN_TYPE; (PAGE_WRITECOPY | \ PAGE_EXECUTE_WRITECOPY) + +#define InterlockedCompareExchangePte(PointerPte, Exchange, Comperand) \ + InterlockedCompareExchange((PLONG)(PointerPte), Exchange, Comperand) + +#define InterlockedExchangePte(PointerPte, Value) \ + InterlockedExchange((PLONG)(PointerPte), Value) + typedef struct { ULONG Entry[NR_SECTION_PAGE_ENTRIES]; @@ -381,6 +388,8 @@ typedef VOID BOOLEAN Dirty ); +PMM_AVL_TABLE MmKernelAddressSpace; + /* marea.c *******************************************************************/ NTSTATUS @@ -1052,13 +1061,6 @@ PVOID NTAPI MmCreateHyperspaceMapping(PFN_TYPE Page); -PFN_TYPE -NTAPI -MmChangeHyperspaceMapping( - PVOID Address, - PFN_TYPE Page -); - PFN_TYPE NTAPI MmDeleteHyperspaceMapping(PVOID Address); @@ -1210,13 +1212,6 @@ VOID NTAPI MmReferencePageUnsafe(PFN_TYPE Page); -BOOLEAN -NTAPI -MmIsAccessedAndResetAccessPage( - struct _EPROCESS *Process, - PVOID Address -); - ULONG NTAPI MmGetReferenceCountPage(PFN_TYPE Page); @@ -1552,11 +1547,25 @@ MmCheckSystemImage( IN BOOLEAN PurgeSection ); -/* ReactOS Mm Hack */ +NTSTATUS +NTAPI +MmCallDllInitialize( + IN PLDR_DATA_TABLE_ENTRY LdrEntry, + IN PLIST_ENTRY ListHead +); + +/* ReactOS Mm Hacks */ VOID FASTCALL -MiSyncThreadProcessViews( - IN PKTHREAD NextThread +MiSyncForProcessAttach( + IN PKTHREAD NextThread, + IN PEPROCESS Process +); + +VOID +FASTCALL +MiSyncForContextSwitch( + IN PKTHREAD Thread ); extern PMM_AVL_TABLE MmKernelAddressSpace; diff --git a/reactos/ntoskrnl/include/internal/ntoskrnl.h b/reactos/ntoskrnl/include/internal/ntoskrnl.h index 7a1742fb93e..884f3c068ca 100644 --- a/reactos/ntoskrnl/include/internal/ntoskrnl.h +++ b/reactos/ntoskrnl/include/internal/ntoskrnl.h @@ -37,13 +37,14 @@ #define InterlockedCompareExchange64 _InterlockedCompareExchange64 #define InterlockedExchange _InterlockedExchange #define InterlockedExchangeAdd _InterlockedExchangeAdd +#define InterlockedOr _InterlockedOr +#define InterlockedAnd _InterlockedAnd #include "ke.h" #ifdef _M_AMD64 #include "amd64/mm.h" #else #include "i386/mm.h" -#include "i386/fpu.h" #include "i386/v86m.h" #endif #include "ob.h" @@ -296,8 +297,8 @@ C_ASSERT(FIELD_OFFSET(KTHREAD, TrapFrame) == KTHREAD_TRAP_FRAME); C_ASSERT(FIELD_OFFSET(KTHREAD, CallbackStack) == KTHREAD_CALLBACK_STACK); C_ASSERT(FIELD_OFFSET(KTHREAD, ApcState.Process) == KTHREAD_APCSTATE_PROCESS); C_ASSERT(FIELD_OFFSET(KPROCESS, DirectoryTableBase) == KPROCESS_DIRECTORY_TABLE_BASE); -//C_ASSERT(FIELD_OFFSET(KPCR, Tib.ExceptionList) == KPCR_EXCEPTION_LIST); -//C_ASSERT(FIELD_OFFSET(KPCR, Self) == KPCR_SELF); +C_ASSERT(FIELD_OFFSET(KPCR, Tib.ExceptionList) == KPCR_EXCEPTION_LIST); +C_ASSERT(FIELD_OFFSET(KPCR, Self) == KPCR_SELF); #endif #ifdef _M_IX86 @@ -309,7 +310,7 @@ C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, NextThread) == KPCR C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, NpxThread) == KPCR_NPX_THREAD); C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) == KPCR_PRCB_DATA); C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, KeSystemCalls) == KPCR_SYSTEM_CALLS); -C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, DpcData) + /*FIELD_OFFSET(KDPC_DATA, DpcQueuDepth)*/12 == KPCR_PRCB_DPC_QUEUE_DEPTH); +C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, DpcData) + FIELD_OFFSET(KDPC_DATA, DpcQueueDepth) == KPCR_PRCB_DPC_QUEUE_DEPTH); C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, DpcData) + 16 == KPCR_PRCB_DPC_COUNT); C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, DpcStack) == KPCR_PRCB_DPC_STACK); C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, TimerRequest) == KPCR_PRCB_TIMER_REQUEST); @@ -322,7 +323,7 @@ C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, TimerRequest) == KP C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, QuantumEnd) == KPCR_PRCB_QUANTUM_END); C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, DeferredReadyListHead) == KPCR_PRCB_DEFERRED_READY_LIST_HEAD); C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, PowerState) == KPCR_PRCB_POWER_STATE_IDLE_FUNCTION); -//C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, PrcbLock) == KPCR_PRCB_PRCB_LOCK); +C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, PrcbLock) == KPCR_PRCB_PRCB_LOCK); C_ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, DpcStack) == KPCR_PRCB_DPC_STACK); C_ASSERT(sizeof(FX_SAVE_AREA) == SIZEOF_FX_SAVE_AREA); diff --git a/reactos/ntoskrnl/include/internal/ob_x.h b/reactos/ntoskrnl/include/internal/ob_x.h index 91877a4c661..f1bc04ce57d 100644 --- a/reactos/ntoskrnl/include/internal/ob_x.h +++ b/reactos/ntoskrnl/include/internal/ob_x.h @@ -113,7 +113,7 @@ ObpReferenceNameInfo(IN POBJECT_HEADER ObjectHeader) { /* FIXME: Unhandled*/ DbgPrint("OB: Unhandled path\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* Return the name information */ diff --git a/reactos/ntoskrnl/include/internal/se.h b/reactos/ntoskrnl/include/internal/se.h index 5ab71dcc74c..d7365f4d594 100644 --- a/reactos/ntoskrnl/include/internal/se.h +++ b/reactos/ntoskrnl/include/internal/se.h @@ -86,7 +86,7 @@ extern PSECURITY_DESCRIPTOR SeUnrestrictedSd; /* Functions */ BOOLEAN NTAPI -SeInit(VOID); +SeInitSystem(VOID); BOOLEAN NTAPI diff --git a/reactos/ntoskrnl/io/iomgr/adapter.c b/reactos/ntoskrnl/io/iomgr/adapter.c index 222a12dda84..1d402c95045 100644 --- a/reactos/ntoskrnl/io/iomgr/adapter.c +++ b/reactos/ntoskrnl/io/iomgr/adapter.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include /* DATA **********************************************************************/ diff --git a/reactos/ntoskrnl/io/iomgr/arcname.c b/reactos/ntoskrnl/io/iomgr/arcname.c index c18a31c3d62..6560a3d732f 100644 --- a/reactos/ntoskrnl/io/iomgr/arcname.c +++ b/reactos/ntoskrnl/io/iomgr/arcname.c @@ -242,8 +242,8 @@ IopGetDiskInformation(IN ULONG i, if (!NT_SUCCESS(Status)) { /* Try again */ - ExFreePool(PartitionBuffer); - ExFreePool(DriveLayout); + ExFreePoolWithTag(PartitionBuffer, TAG_IO); + ExFreePoolWithTag(DriveLayout, TAG_FILE_SYSTEM); return FALSE; } @@ -257,8 +257,8 @@ IopGetDiskInformation(IN ULONG i, *PartitionCount = DriveLayout->PartitionCount; /* Free the buffer */ - ExFreePool(PartitionBuffer); - ExFreePool(DriveLayout); + ExFreePoolWithTag(PartitionBuffer, TAG_IO); + ExFreePoolWithTag(DriveLayout, TAG_FILE_SYSTEM); return TRUE; } @@ -574,7 +574,7 @@ IopCreateArcNames(IN PLOADER_PARAMETER_BLOCK LoaderBlock) } /* Free the buffer */ - ExFreePool(PartitionBuffer); + ExFreePoolWithTag(PartitionBuffer, TAG_IO); } /* Return success */ diff --git a/reactos/ntoskrnl/io/iomgr/bootlog.c b/reactos/ntoskrnl/io/iomgr/bootlog.c index d083bec2f00..2426f6e3a4c 100644 --- a/reactos/ntoskrnl/io/iomgr/bootlog.c +++ b/reactos/ntoskrnl/io/iomgr/bootlog.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include #if defined (ALLOC_PRAGMA) #pragma alloc_text(INIT, IopInitBootLog) @@ -337,7 +337,6 @@ IopSaveBootLogToFile(VOID) BufferSize); if (KeyInfo == NULL) { - CHECKPOINT1; ExReleaseResourceLite(&IopBootLogResource); return; } @@ -354,7 +353,6 @@ IopSaveBootLogToFile(VOID) &ObjectAttributes); if (!NT_SUCCESS(Status)) { - CHECKPOINT1; ExFreePool(KeyInfo); ExReleaseResourceLite(&IopBootLogResource); return; @@ -381,7 +379,6 @@ IopSaveBootLogToFile(VOID) if (!NT_SUCCESS(Status)) { - CHECKPOINT1; ZwClose(KeyHandle); ExFreePool(KeyInfo); ExReleaseResourceLite(&IopBootLogResource); @@ -391,7 +388,6 @@ IopSaveBootLogToFile(VOID) Status = IopWriteLogFile((PWSTR)&KeyInfo->Data); if (!NT_SUCCESS(Status)) { - CHECKPOINT1; ZwClose(KeyHandle); ExFreePool(KeyInfo); ExReleaseResourceLite(&IopBootLogResource); diff --git a/reactos/ntoskrnl/io/iomgr/controller.c b/reactos/ntoskrnl/io/iomgr/controller.c index 8616926b4d2..6220ba8de43 100644 --- a/reactos/ntoskrnl/io/iomgr/controller.c +++ b/reactos/ntoskrnl/io/iomgr/controller.c @@ -9,7 +9,7 @@ /* INCLUDES *****************************************************************/ #include -#include +#include /* GLOBALS *******************************************************************/ diff --git a/reactos/ntoskrnl/io/iomgr/device.c b/reactos/ntoskrnl/io/iomgr/device.c index 1fa5d0d6721..4d88d8c88c8 100644 --- a/reactos/ntoskrnl/io/iomgr/device.c +++ b/reactos/ntoskrnl/io/iomgr/device.c @@ -12,7 +12,7 @@ #include #define NDEBUG -#include +#include /* GLOBALS ********************************************************************/ @@ -122,7 +122,7 @@ IoShutdownRegisteredDevices(VOID) } /* Free the shutdown entry and reset the event */ - ExFreePool(ShutdownEntry); + ExFreePoolWithTag(ShutdownEntry, TAG_SHUTDOWN_ENTRY); KeClearEvent(&Event); /* Go to the next entry */ @@ -317,7 +317,7 @@ IopUnloadDevice(IN PDEVICE_OBJECT DeviceObject) if (DeviceObject->SecurityDescriptor) { /* Free it */ - ExFreePool(DeviceObject->SecurityDescriptor); + ExFreePoolWithTag(DeviceObject->SecurityDescriptor, TAG_SD); } /* Remove the device from the list */ @@ -1195,7 +1195,7 @@ IoGetRelatedDeviceObject(IN PFILE_OBJECT FileObject) { /* FIXME: Unhandled yet */ DPRINT1("FOEs not supported\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } } @@ -1328,7 +1328,7 @@ IoUnregisterShutdownNotification(PDEVICE_OBJECT DeviceObject) NextEntry = NextEntry->Blink; /* Free the entry */ - ExFreePool(ShutdownEntry); + ExFreePoolWithTag(ShutdownEntry, TAG_SHUTDOWN_ENTRY); } /* Go to the next entry */ @@ -1352,7 +1352,7 @@ IoUnregisterShutdownNotification(PDEVICE_OBJECT DeviceObject) NextEntry = NextEntry->Blink; /* Free the entry */ - ExFreePool(ShutdownEntry); + ExFreePoolWithTag(ShutdownEntry, TAG_SHUTDOWN_ENTRY); } /* Go to the next entry */ diff --git a/reactos/ntoskrnl/io/iomgr/deviface.c b/reactos/ntoskrnl/io/iomgr/deviface.c index 81122e429b2..c2dac1d7fdc 100644 --- a/reactos/ntoskrnl/io/iomgr/deviface.c +++ b/reactos/ntoskrnl/io/iomgr/deviface.c @@ -14,7 +14,7 @@ #include #define NDEBUG -#include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/ntoskrnl/io/iomgr/driver.c b/reactos/ntoskrnl/io/iomgr/driver.c index d69b47eb8ac..d4fe8ab6b6c 100644 --- a/reactos/ntoskrnl/io/iomgr/driver.c +++ b/reactos/ntoskrnl/io/iomgr/driver.c @@ -12,7 +12,7 @@ #include #define NDEBUG -#include +#include /* GLOBALS ********************************************************************/ @@ -29,6 +29,8 @@ UNICODE_STRING IopHardwareDatabaseKey = POBJECT_TYPE IoDriverObjectType = NULL; +#define TAG_RTLREGISTRY TAG('R', 'q', 'r', 'v') + extern BOOLEAN ExpInTextModeSetup; /* PRIVATE FUNCTIONS **********************************************************/ @@ -246,7 +248,7 @@ IopNormalizeImagePath( RtlAppendUnicodeStringToString(ImagePath, &InputImagePath); /* Free caller's string */ - RtlFreeUnicodeString(&InputImagePath); + ExFreePoolWithTag(InputImagePath.Buffer, TAG_RTLREGISTRY); } return STATUS_SUCCESS; @@ -275,6 +277,7 @@ IopLoadServiceModule( UNICODE_STRING ServiceImagePath, CCSName; NTSTATUS Status; HANDLE CCSKey, ServiceKey; + PVOID BaseAddress; DPRINT("IopLoadServiceModule(%wZ, 0x%p)\n", ServiceName, ModuleObject); @@ -356,7 +359,7 @@ IopLoadServiceModule( else { DPRINT("Loading module\n"); - Status = MmLoadSystemImage(&ServiceImagePath, NULL, NULL, 0, (PVOID)ModuleObject, NULL); + Status = MmLoadSystemImage(&ServiceImagePath, NULL, NULL, 0, (PVOID)ModuleObject, &BaseAddress); } ExFreePool(ServiceImagePath.Buffer); @@ -782,10 +785,6 @@ IopInitializeBuiltinDriver(IN PLDR_DATA_TABLE_ENTRY LdrEntry) LPWSTR FileExtension; PUNICODE_STRING ModuleName = &LdrEntry->BaseDllName; UNICODE_STRING ServiceName; -#if 1 // Disable for FreeLDR 2.5 - UNICODE_STRING ServiceNameWithExtension; - PLDR_DATA_TABLE_ENTRY ModuleObject; -#endif /* * Display 'Loading XXX...' message @@ -805,19 +804,6 @@ IopInitializeBuiltinDriver(IN PLDR_DATA_TABLE_ENTRY LdrEntry) FileNameWithoutPath++; } - /* - * Load the module. - */ -#if 1 // Remove for FreeLDR 2.5. - RtlCreateUnicodeString(&ServiceNameWithExtension, FileNameWithoutPath); - Status = LdrProcessDriverModule(LdrEntry, &ServiceNameWithExtension, &ModuleObject); - if (!NT_SUCCESS(Status)) - { - CPRINT("Driver '%wZ' load failed, status (%x)\n", ModuleName, Status); - return Status; - } -#endif - /* * Strip the file extension from ServiceName */ @@ -836,7 +822,7 @@ IopInitializeBuiltinDriver(IN PLDR_DATA_TABLE_ENTRY LdrEntry) Status = IopCreateDeviceNode(IopRootDeviceNode, NULL, &ServiceName, &DeviceNode); if (!NT_SUCCESS(Status)) { - CPRINT("Driver '%wZ' load failed, status (%x)\n", ModuleName, Status); + DPRINT1("Driver '%wZ' load failed, status (%x)\n", ModuleName, Status); return(Status); } DeviceNode->ServiceName = ServiceName; @@ -844,7 +830,6 @@ IopInitializeBuiltinDriver(IN PLDR_DATA_TABLE_ENTRY LdrEntry) /* * Initialize the driver */ - DeviceNode->Flags |= DN_DRIVER_LOADED; Status = IopInitializeDriverModule(DeviceNode, LdrEntry, &DeviceNode->ServiceName, FALSE, &DriverObject); @@ -1577,6 +1562,7 @@ IopLoadUnloadDriver(PLOAD_UNLOAD_PARAMS LoadParams) PDEVICE_NODE DeviceNode; PDRIVER_OBJECT DriverObject; PLDR_DATA_TABLE_ENTRY ModuleObject; + PVOID BaseAddress; WCHAR *cur; /* Check if it's an unload request */ @@ -1687,7 +1673,7 @@ IopLoadUnloadDriver(PLOAD_UNLOAD_PARAMS LoadParams) * Load the driver module */ - Status = MmLoadSystemImage(&ImagePath, NULL, NULL, 0, (PVOID)&ModuleObject, NULL); + Status = MmLoadSystemImage(&ImagePath, NULL, NULL, 0, (PVOID)&ModuleObject, &BaseAddress); if (!NT_SUCCESS(Status) && Status != STATUS_IMAGE_ALREADY_LOADED) { DPRINT("MmLoadSystemImage() failed (Status %lx)\n", Status); @@ -1729,9 +1715,6 @@ IopLoadUnloadDriver(PLOAD_UNLOAD_PARAMS LoadParams) /* Store its DriverSection, so that it could be unloaded */ DriverObject->DriverSection = ModuleObject; - - /* We have a driver for this DeviceNode */ - DeviceNode->Flags |= DN_DRIVER_LOADED; } IopInitializeDevice(DeviceNode, DriverObject); diff --git a/reactos/ntoskrnl/io/iomgr/drvrlist.c b/reactos/ntoskrnl/io/iomgr/drvrlist.c index dfdc2a3efe5..e8f3a720ee4 100644 --- a/reactos/ntoskrnl/io/iomgr/drvrlist.c +++ b/reactos/ntoskrnl/io/iomgr/drvrlist.c @@ -10,7 +10,7 @@ #include #define NDEBUG -#include +#include typedef struct _SERVICE_GROUP { @@ -37,6 +37,8 @@ typedef struct _SERVICE /* BOOLEAN ServiceRunning;*/ // needed ?? } SERVICE, *PSERVICE; +#define TAG_RTLREGISTRY TAG('R', 'q', 'r', 'v') + /* GLOBALS ********************************************************************/ LIST_ENTRY GroupListHead = {NULL, NULL}; @@ -205,11 +207,11 @@ IopCreateServiceListEntry(PUNICODE_STRING ServiceName) */ if (Service->ServiceGroup.Buffer) { - ExFreePool(Service->ServiceGroup.Buffer); + ExFreePoolWithTag(Service->ServiceGroup.Buffer, TAG_RTLREGISTRY); } if (Service->ImagePath.Buffer) { - ExFreePool(Service->ImagePath.Buffer); + ExFreePoolWithTag(Service->ImagePath.Buffer, TAG_RTLREGISTRY); } ExFreePool(Service); return(Status); @@ -350,39 +352,59 @@ IoCreateDriverList(VOID) NTSTATUS INIT_FUNCTION IoDestroyDriverList(VOID) { - PSERVICE_GROUP CurrentGroup, tmp1; - PSERVICE CurrentService, tmp2; + PSERVICE_GROUP CurrentGroup; + PSERVICE CurrentService; + PLIST_ENTRY NextEntry, TempEntry; - DPRINT("IoDestroyDriverList() called\n"); + DPRINT("IoDestroyDriverList() called\n"); - /* Destroy group list */ - LIST_FOR_EACH_SAFE(CurrentGroup, tmp1, &GroupListHead, SERVICE_GROUP, GroupListEntry) + /* Destroy the Group List */ + for (NextEntry = GroupListHead.Flink, TempEntry = NextEntry->Flink; + NextEntry != &GroupListHead; + NextEntry = TempEntry, TempEntry = NextEntry->Flink) { - ExFreePool(CurrentGroup->GroupName.Buffer); - RemoveEntryList(&CurrentGroup->GroupListEntry); - if (CurrentGroup->TagArray) - { - ExFreePool(CurrentGroup->TagArray); - } - ExFreePool(CurrentGroup); + /* Get the entry */ + CurrentGroup = CONTAINING_RECORD(NextEntry, + SERVICE_GROUP, + GroupListEntry); + + /* Remove it from the list */ + RemoveEntryList(&CurrentGroup->GroupListEntry); + + /* Free buffers */ + ExFreePool(CurrentGroup->GroupName.Buffer); + if (CurrentGroup->TagArray) + ExFreePool(CurrentGroup->TagArray); + ExFreePool(CurrentGroup); } - /* Destroy service list */ - LIST_FOR_EACH_SAFE(CurrentService, tmp2, &ServiceListHead, SERVICE, ServiceListEntry) + /* Destroy the Service List */ + for (NextEntry = ServiceListHead.Flink, TempEntry = NextEntry->Flink; + NextEntry != &ServiceListHead; + NextEntry = TempEntry, TempEntry = NextEntry->Flink) { - ExFreePool(CurrentService->ServiceName.Buffer); - ExFreePool(CurrentService->RegistryPath.Buffer); - if (CurrentService->ServiceGroup.Buffer) - ExFreePool(CurrentService->ServiceGroup.Buffer); - if (CurrentService->ImagePath.Buffer) - ExFreePool(CurrentService->ImagePath.Buffer); - RemoveEntryList(&CurrentService->ServiceListEntry); - ExFreePool(CurrentService); + /* Get the entry */ + CurrentService = CONTAINING_RECORD(NextEntry, + SERVICE, + ServiceListEntry); + + /* Remove it from the list */ + RemoveEntryList(&CurrentService->ServiceListEntry); + + /* Free buffers */ + ExFreePool(CurrentService->ServiceName.Buffer); + ExFreePool(CurrentService->RegistryPath.Buffer); + if (CurrentService->ServiceGroup.Buffer) + ExFreePool(CurrentService->ServiceGroup.Buffer); + if (CurrentService->ImagePath.Buffer) + ExFreePool(CurrentService->ImagePath.Buffer); + ExFreePool(CurrentService); } - DPRINT("IoDestroyDriverList() done\n"); + DPRINT("IoDestroyDriverList() done\n"); - return(STATUS_SUCCESS); + /* Return success */ + return STATUS_SUCCESS; } static INIT_FUNCTION NTSTATUS @@ -435,61 +457,87 @@ IopLoadDriver(PSERVICE Service) * Return Value * None */ - -VOID FASTCALL +VOID +FASTCALL IopInitializeSystemDrivers(VOID) { PSERVICE_GROUP CurrentGroup; PSERVICE CurrentService; NTSTATUS Status; ULONG i; + PLIST_ENTRY NextGroupEntry, NextServiceEntry; DPRINT("IopInitializeSystemDrivers()\n"); - LIST_FOR_EACH(CurrentGroup, &GroupListHead, SERVICE_GROUP, GroupListEntry) - { - DPRINT("Group: %wZ\n", &CurrentGroup->GroupName); + /* Start looping */ + for (NextGroupEntry = GroupListHead.Flink; + NextGroupEntry != &GroupListHead; + NextGroupEntry = NextGroupEntry->Flink) + { + /* Get the entry */ + CurrentGroup = CONTAINING_RECORD(NextGroupEntry, + SERVICE_GROUP, + GroupListEntry); - /* Load all drivers with a valid tag */ - for (i = 0; i < CurrentGroup->TagCount; i++) - { - LIST_FOR_EACH(CurrentService, &ServiceListHead, SERVICE, ServiceListEntry) - { - if ((RtlCompareUnicodeString(&CurrentGroup->GroupName, - &CurrentService->ServiceGroup, TRUE) == 0) && - (CurrentService->Start == 1 /*SERVICE_SYSTEM_START*/) && - (CurrentService->Tag == CurrentGroup->TagArray[i])) - { - DPRINT(" Path: %wZ\n", &CurrentService->RegistryPath); - Status = IopLoadDriver(CurrentService); - } - } - } + DPRINT("Group: %wZ\n", &CurrentGroup->GroupName); - /* Load all drivers without a tag or with an invalid tag */ - LIST_FOR_EACH(CurrentService, &ServiceListHead, SERVICE, ServiceListEntry) - { - if ((RtlCompareUnicodeString(&CurrentGroup->GroupName, - &CurrentService->ServiceGroup, TRUE) == 0) && - (CurrentService->Start == 1 /*SERVICE_SYSTEM_START*/)) - { - for (i = 0; i < CurrentGroup->TagCount; i++) - { - if (CurrentGroup->TagArray[i] == CurrentService->Tag) - { - break; - } - } - if (i >= CurrentGroup->TagCount) - { - DPRINT(" Path: %wZ\n", &CurrentService->RegistryPath); - Status = IopLoadDriver(CurrentService); - } - } - } + /* Load all drivers with a valid tag */ + for (i = 0; i < CurrentGroup->TagCount; i++) + { + /* Start looping */ + for (NextServiceEntry = ServiceListHead.Flink; + NextServiceEntry != &ServiceListHead; + NextServiceEntry = NextServiceEntry->Flink) + { + /* Get the entry */ + CurrentService = CONTAINING_RECORD(NextServiceEntry, + SERVICE, + ServiceListEntry); - } + if ((!RtlCompareUnicodeString(&CurrentGroup->GroupName, + &CurrentService->ServiceGroup, + TRUE)) && + (CurrentService->Start == SERVICE_SYSTEM_START) && + (CurrentService->Tag == CurrentGroup->TagArray[i])) - DPRINT("IopInitializeSystemDrivers() done\n"); + { + DPRINT(" Path: %wZ\n", &CurrentService->RegistryPath); + Status = IopLoadDriver(CurrentService); + } + } + } + + /* Load all drivers without a tag or with an invalid tag */ + for (NextServiceEntry = ServiceListHead.Flink; + NextServiceEntry != &ServiceListHead; + NextServiceEntry = NextServiceEntry->Flink) + { + /* Get the entry */ + CurrentService = CONTAINING_RECORD(NextServiceEntry, + SERVICE, + ServiceListEntry); + + if ((!RtlCompareUnicodeString(&CurrentGroup->GroupName, + &CurrentService->ServiceGroup, + TRUE)) && + (CurrentService->Start == SERVICE_SYSTEM_START)) + { + for (i = 0; i < CurrentGroup->TagCount; i++) + { + if (CurrentGroup->TagArray[i] == CurrentService->Tag) + { + break; + } + } + + if (i >= CurrentGroup->TagCount) + { + DPRINT(" Path: %wZ\n", &CurrentService->RegistryPath); + Status = IopLoadDriver(CurrentService); + } + } + } + } + + DPRINT("IopInitializeSystemDrivers() done\n"); } -/* EOF */ diff --git a/reactos/ntoskrnl/io/iomgr/error.c b/reactos/ntoskrnl/io/iomgr/error.c index 8488af4a0fb..749149ab481 100644 --- a/reactos/ntoskrnl/io/iomgr/error.c +++ b/reactos/ntoskrnl/io/iomgr/error.c @@ -10,7 +10,7 @@ #include #define NDEBUG -#include +#include /* TYPES *********************************************************************/ @@ -122,7 +122,7 @@ IopConnectLogPort(VOID) NULL); if (NT_SUCCESS(Status)) { - /* Remmeber we're connected */ + /* Remember we're connected */ IopLogPortConnected = TRUE; return TRUE; } @@ -583,7 +583,7 @@ IoWriteErrorLogEntry(IN PVOID ElEntry) KeAcquireSpinLock(&IopLogListLock, &Irql); InsertHeadList(&IopErrorLogListHead, &LogEntry->ListEntry); - /* Check if the worker is runnign */ + /* Check if the worker is running */ if (!IopLogWorkerRunning) { #if 0 @@ -648,7 +648,7 @@ IoRaiseInformationalHardError(IN NTSTATUS ErrorStatus, IN PKTHREAD Thread) { UNIMPLEMENTED; - return(FALSE); + return FALSE; } /* @@ -659,14 +659,12 @@ NTAPI IoSetThreadHardErrorMode(IN BOOLEAN HardErrorEnabled) { PETHREAD Thread = PsGetCurrentThread(); - BOOLEAN Old; + BOOLEAN OldMode; /* Get the current value */ - Old = !Thread->HardErrorsAreDisabled; + OldMode = !Thread->HardErrorsAreDisabled; /* Set the new one and return the old */ Thread->HardErrorsAreDisabled = !HardErrorEnabled; - return Old; + return OldMode; } - -/* EOF */ diff --git a/reactos/ntoskrnl/io/iomgr/file.c b/reactos/ntoskrnl/io/iomgr/file.c index da7dfce3345..2efe9b05784 100644 --- a/reactos/ntoskrnl/io/iomgr/file.c +++ b/reactos/ntoskrnl/io/iomgr/file.c @@ -786,7 +786,7 @@ IopParseDevice(IN PVOID ParseObject, else if (Status == STATUS_REPARSE) { /* FIXME: We don't handle this at all! */ - KEBUGCHECK(0); + ASSERT(FALSE); } /* Get the owner of the File Object */ @@ -1031,7 +1031,7 @@ IopDeleteFile(IN PVOID ObjectBody) /* Clear the file name */ if (FileObject->FileName.Buffer) { - ExFreePool(FileObject->FileName.Buffer); + ExFreePoolWithTag(FileObject->FileName.Buffer, TAG_IO_NAME); FileObject->FileName.Buffer = NULL; } @@ -1405,7 +1405,7 @@ IopCloseFile(IN PEPROCESS Process OPTIONAL, if ((FileObject->LockOperation) && (SystemHandleCount != 1)) { DPRINT1("We need to unlock this file!\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* Make sure this is the last handle */ diff --git a/reactos/ntoskrnl/io/iomgr/iocomp.c b/reactos/ntoskrnl/io/iomgr/iocomp.c index 8924a8903ae..e2cee39ee14 100644 --- a/reactos/ntoskrnl/io/iomgr/iocomp.c +++ b/reactos/ntoskrnl/io/iomgr/iocomp.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include POBJECT_TYPE IoCompletionType; diff --git a/reactos/ntoskrnl/io/iomgr/ioevent.c b/reactos/ntoskrnl/io/iomgr/ioevent.c index c3e6ff3f660..01b4f8dc22c 100644 --- a/reactos/ntoskrnl/io/iomgr/ioevent.c +++ b/reactos/ntoskrnl/io/iomgr/ioevent.c @@ -10,7 +10,7 @@ /* INCLUDES *****************************************************************/ #include -#include +#include /* PRIVATE FUNCTIONS *********************************************************/ diff --git a/reactos/ntoskrnl/io/iomgr/iofunc.c b/reactos/ntoskrnl/io/iomgr/iofunc.c index e210a183fb5..a6abaf8c693 100644 --- a/reactos/ntoskrnl/io/iomgr/iofunc.c +++ b/reactos/ntoskrnl/io/iomgr/iofunc.c @@ -682,7 +682,7 @@ IoSynchronousPageWrite(IN PFILE_OBJECT FileObject, StackPtr->FileObject = FileObject; /* Call the Driver */ - return IofCallDriver(DeviceObject, Irp); + return IoCallDriver(DeviceObject, Irp); } /* @@ -732,7 +732,7 @@ IoPageRead(IN PFILE_OBJECT FileObject, StackPtr->FileObject = FileObject; /* Call the Driver */ - return IofCallDriver(DeviceObject, Irp); + return IoCallDriver(DeviceObject, Irp); } /* @@ -776,7 +776,7 @@ IoQueryVolumeInformation(IN PFILE_OBJECT FileObject, } /* - * @unimplemented + * @implemented */ NTSTATUS NTAPI @@ -1890,7 +1890,7 @@ NtQueryInformationFile(IN HANDLE FileHandle, { /* Clear it in the IRP for completion */ Irp->UserEvent = NULL; - ExFreePool(Event); + ExFreePoolWithTag(Event, TAG_IO); } /* Set the caller IOSB */ @@ -2045,7 +2045,7 @@ NtReadFile(IN HANDLE FileHandle, CapturedByteOffset = FileObject->CurrentByteOffset; } - /* Rememer we are sync */ + /* Remember we are sync */ Synchronous = TRUE; } else if (!(ByteOffset) && @@ -2904,7 +2904,7 @@ NtWriteFile(IN HANDLE FileHandle, CapturedByteOffset = FileObject->CurrentByteOffset; } - /* Rememer we are sync */ + /* Remember we are sync */ Synchronous = TRUE; } else if (!(ByteOffset) && diff --git a/reactos/ntoskrnl/io/iomgr/iomdl.c b/reactos/ntoskrnl/io/iomgr/iomdl.c index fbfa8a029e8..8ccb16d330f 100644 --- a/reactos/ntoskrnl/io/iomgr/iomdl.c +++ b/reactos/ntoskrnl/io/iomgr/iomdl.c @@ -10,7 +10,7 @@ #include #define NDEBUG -#include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/ntoskrnl/io/iomgr/iomgr.c b/reactos/ntoskrnl/io/iomgr/iomgr.c index f9cf68a94b4..015018e38db 100644 --- a/reactos/ntoskrnl/io/iomgr/iomgr.c +++ b/reactos/ntoskrnl/io/iomgr/iomgr.c @@ -11,17 +11,10 @@ #include #define NDEBUG -#include +#include ULONG IopTraceLevel = 0; - -// should go into a proper header -VOID -NTAPI -IoSynchronousInvalidateDeviceRelations( - IN PDEVICE_OBJECT DeviceObject, - IN DEVICE_RELATION_TYPE Type -); +BOOLEAN PnpSystemInit = FALSE; VOID NTAPI @@ -75,7 +68,6 @@ extern LIST_ENTRY IopErrorLogListHead; extern LIST_ENTRY IopTimerQueueHead; extern KDPC IopTimerDpc; extern KTIMER IopTimer; -extern KSPIN_LOCK CancelSpinLock; extern KSPIN_LOCK IoVpbLock; extern KSPIN_LOCK IoStatisticsLock; extern KSPIN_LOCK DriverReinitListLock; @@ -470,7 +462,6 @@ IoInitSystem(IN PLOADER_PARAMETER_BLOCK LoaderBlock) InitializeListHead(&LastChanceShutdownListHead); InitializeListHead(&FsChangeNotifyListHead); InitializeListHead(&IopErrorLogListHead); - KeInitializeSpinLock(&CancelSpinLock); KeInitializeSpinLock(&IoVpbLock); KeInitializeSpinLock(&IoStatisticsLock); KeInitializeSpinLock(&DriverReinitListLock); @@ -509,10 +500,8 @@ IoInitSystem(IN PLOADER_PARAMETER_BLOCK LoaderBlock) IopReinitializeBootDrivers(); /* Initialize PnP root relations */ - IoSynchronousInvalidateDeviceRelations(IopRootDeviceNode-> - PhysicalDeviceObject, - BusRelations); - + IopEnumerateDevice(IopRootDeviceNode->PhysicalDeviceObject); + /* Check if this was a ramdisk boot */ if (!_strnicmp(LoaderBlock->ArcBootDeviceName, "ramdisk(0)", 10)) { @@ -535,9 +524,10 @@ IoInitSystem(IN PLOADER_PARAMETER_BLOCK LoaderBlock) #endif /* Load services for devices found by PnP manager */ - IopInitializePnpServices(IopRootDeviceNode, FALSE); + IopInitializePnpServices(IopRootDeviceNode); /* Load system start drivers */ + PnpSystemInit = TRUE; IopInitializeSystemDrivers(); /* Destroy the group driver list */ diff --git a/reactos/ntoskrnl/io/iomgr/iorsrce.c b/reactos/ntoskrnl/io/iomgr/iorsrce.c index ec9c742a5ab..6e0d2f37134 100644 --- a/reactos/ntoskrnl/io/iomgr/iorsrce.c +++ b/reactos/ntoskrnl/io/iomgr/iorsrce.c @@ -11,7 +11,7 @@ /* INCLUDES *****************************************************************/ #include -#include +#include /* GLOBALS *******************************************************************/ @@ -179,7 +179,7 @@ IopQueryDeviceDescription( if (!NT_SUCCESS(Status)) { if (ControllerFullInformation != NULL) - ExFreePool(ControllerFullInformation); + ExFreePoolWithTag(ControllerFullInformation, TAG_IO_RESOURCE); return Status; } @@ -188,7 +188,7 @@ IopQueryDeviceDescription( MaximumControllerNumber = ControllerFullInformation->SubKeys; /* Free Memory */ - ExFreePool(ControllerFullInformation); + ExFreePoolWithTag(ControllerFullInformation, TAG_IO_RESOURCE); ControllerFullInformation = NULL; } @@ -318,7 +318,7 @@ IopQueryDeviceDescription( MaximumPeripheralNumber = PeripheralFullInformation->SubKeys; /* Free Memory */ - ExFreePool(PeripheralFullInformation); + ExFreePoolWithTag(PeripheralFullInformation, TAG_IO_RESOURCE); PeripheralFullInformation = NULL; } @@ -400,7 +400,7 @@ IopQueryDeviceDescription( { if (PeripheralInformation[PeripheralLoop]) { - ExFreePool(PeripheralInformation[PeripheralLoop]); + ExFreePoolWithTag(PeripheralInformation[PeripheralLoop], TAG_IO_RESOURCE); PeripheralInformation[PeripheralLoop] = NULL; } } @@ -416,7 +416,7 @@ EndLoop: { if (ControllerInformation[ControllerLoop]) { - ExFreePool(ControllerInformation[ControllerLoop]); + ExFreePoolWithTag(ControllerInformation[ControllerLoop], TAG_IO_RESOURCE); ControllerInformation[ControllerLoop] = NULL; } } @@ -498,7 +498,7 @@ IopQueryBusDescription( } /* Deallocate the old Buffer */ - ExFreePool(FullInformation); + ExFreePoolWithTag(FullInformation, TAG_IO_RESOURCE); /* Try to find a Bus */ for (BusLoop = 0; NT_SUCCESS(Status); BusLoop++) @@ -619,7 +619,7 @@ IopQueryBusDescription( { if (BusInformation[SubBusLoop]) { - ExFreePool(BusInformation[SubBusLoop]); + ExFreePoolWithTag(BusInformation[SubBusLoop], TAG_IO_RESOURCE); BusInformation[SubBusLoop] = NULL; } } @@ -645,7 +645,7 @@ IopQueryBusDescription( /* Free the last remaining Allocated Memory */ if (BasicInformation) - ExFreePool(BasicInformation); + ExFreePoolWithTag(BasicInformation, TAG_IO_RESOURCE); return Status; } @@ -788,7 +788,7 @@ IoQueryDeviceDescription(PINTERFACE_TYPE BusType OPTIONAL, } /* Free Memory */ - ExFreePool(RootRegKey.Buffer); + ExFreePoolWithTag(RootRegKey.Buffer, TAG_IO_RESOURCE); return Status; } diff --git a/reactos/ntoskrnl/io/iomgr/iotimer.c b/reactos/ntoskrnl/io/iomgr/iotimer.c index 87066cba770..e462ce0e200 100644 --- a/reactos/ntoskrnl/io/iomgr/iotimer.c +++ b/reactos/ntoskrnl/io/iomgr/iotimer.c @@ -10,7 +10,7 @@ #include #define NDEBUG -#include +#include /* GLOBALS *******************************************************************/ diff --git a/reactos/ntoskrnl/io/iomgr/iowork.c b/reactos/ntoskrnl/io/iomgr/iowork.c index c3db3adaff5..f4aad64691f 100644 --- a/reactos/ntoskrnl/io/iomgr/iowork.c +++ b/reactos/ntoskrnl/io/iomgr/iowork.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include /* PRIVATE FUNCTIONS *********************************************************/ @@ -26,7 +26,7 @@ IopWorkItemCallback(IN PVOID Parameter) /* Call the work routine */ IoWorkItem->WorkerRoutine(DeviceObject, IoWorkItem->Context); - /* Dereferenece the device object */ + /* Dereference the device object */ ObDereferenceObject(DeviceObject); } diff --git a/reactos/ntoskrnl/io/iomgr/irp.c b/reactos/ntoskrnl/io/iomgr/irp.c index 4b6842d84d8..0d445bb1abb 100644 --- a/reactos/ntoskrnl/io/iomgr/irp.c +++ b/reactos/ntoskrnl/io/iomgr/irp.c @@ -1,8 +1,7 @@ - /* * PROJECT: ReactOS Kernel * LICENSE: GPL - See COPYING in the top level directory - * FILE: ntoskrnl/io/irp.c + * FILE: ntoskrnl/io/iomgr/irp.c * PURPOSE: IRP Handling Functions * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) * Gunnar Dalsnes @@ -13,7 +12,7 @@ #include #define NDEBUG -#include +#include /* Undefine some macros we implement here */ #undef IoCallDriver @@ -627,7 +626,7 @@ IoBuildAsynchronousFsdRequest(IN ULONG MajorFunction, /* Allocate IRP */ Irp = IoAllocateIrp(DeviceObject->StackSize, FALSE); - if (!Irp) return Irp; + if (!Irp) return NULL; /* Get the Stack */ StackPtr = IoGetNextIrpStackLocation(Irp); @@ -731,7 +730,7 @@ IoBuildAsynchronousFsdRequest(IN ULONG MajorFunction, Irp->UserIosb = IoStatusBlock; Irp->Tail.Overlay.Thread = PsGetCurrentThread(); - /* Set the Status Block after all is done */ + /* Return the IRP */ IOTRACE(IO_IRP_DEBUG, "%s - Built IRP %p with Major, Buffer, DO %lx %p %p\n", __FUNCTION__, @@ -763,7 +762,7 @@ IoBuildDeviceIoControlRequest(IN ULONG IoControlCode, /* Allocate IRP */ Irp = IoAllocateIrp(DeviceObject->StackSize, FALSE); - if (!Irp) return Irp; + if (!Irp) return NULL; /* Get the Stack */ StackPtr = IoGetNextIrpStackLocation(Irp); @@ -857,6 +856,7 @@ IoBuildDeviceIoControlRequest(IN ULONG IoControlCode, } else { + /* Clear the flags */ Irp->Flags = 0; } @@ -970,12 +970,14 @@ NTAPI IoCancelIrp(IN PIRP Irp) { KIRQL OldIrql; + KIRQL IrqlAtEntry; PDRIVER_CANCEL CancelRoutine; IOTRACE(IO_IRP_DEBUG, "%s - Canceling IRP %p\n", __FUNCTION__, Irp); ASSERT(Irp->Type == IO_TYPE_IRP); + IrqlAtEntry = KeGetCurrentIrql(); /* Acquire the cancel lock and cancel the IRP */ IoAcquireCancelSpinLock(&OldIrql); @@ -999,6 +1001,7 @@ IoCancelIrp(IN PIRP Irp) /* Set the cancel IRQL And call the routine */ Irp->CancelIrql = OldIrql; CancelRoutine(IoGetCurrentIrpStackLocation(Irp)->DeviceObject, Irp); + ASSERT(IrqlAtEntry == KeGetCurrentIrql()); return TRUE; } @@ -1058,7 +1061,12 @@ IoCancelThreadIo(IN PETHREAD Thread) * Don't stay here forever if some broken driver doesn't complete * the IRP. */ - if (!(Retries--)) IopRemoveThreadIrp(); + if (!(Retries--)) + { + /* Print out a message and remove the IRP */ + DPRINT1("Broken driver did not complete!\n"); + IopRemoveThreadIrp(); + } /* Raise the IRQL Again */ KeRaiseIrql(APC_LEVEL, &OldIrql); @@ -1076,7 +1084,7 @@ NTAPI IoCallDriver(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) { - /* Call fast call */ + /* Call fastcall */ return IofCallDriver(DeviceObject, Irp); } @@ -1112,7 +1120,7 @@ IofCallDriver(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) { PDRIVER_OBJECT DriverObject; - PIO_STACK_LOCATION Param; + PIO_STACK_LOCATION StackPtr; /* Get the Driver Object */ DriverObject = DeviceObject->DriverObject; @@ -1126,15 +1134,15 @@ IofCallDriver(IN PDEVICE_OBJECT DeviceObject, } /* Now update the stack location */ - Param = IoGetNextIrpStackLocation(Irp); - Irp->Tail.Overlay.CurrentStackLocation = Param; + StackPtr = IoGetNextIrpStackLocation(Irp); + Irp->Tail.Overlay.CurrentStackLocation = StackPtr; /* Get the Device Object */ - Param->DeviceObject = DeviceObject; + StackPtr->DeviceObject = DeviceObject; /* Call it */ - return DriverObject->MajorFunction[Param->MajorFunction](DeviceObject, - Irp); + return DriverObject->MajorFunction[StackPtr->MajorFunction](DeviceObject, + Irp); } FORCEINLINE @@ -1417,10 +1425,9 @@ IofCompleteRequest(IN PIRP Irp, NTSTATUS NTAPI -IopSynchronousCompletion( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp, - IN PVOID Context) +IopSynchronousCompletion(IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp, + IN PVOID Context) { if (Irp->PendingReturned) KeSetEvent((PKEVENT)Context, IO_NO_INCREMENT, FALSE); @@ -1464,6 +1471,7 @@ IoForwardIrpSynchronously(IN PDEVICE_OBJECT DeviceObject, KeWaitForSingleObject(&Event, Suspended, KernelMode, FALSE, NULL); } + /* Return success */ return TRUE; } @@ -1491,7 +1499,7 @@ IoFreeIrp(IN PIRP Irp) if (!(Irp->AllocationFlags & IRP_ALLOCATED_FIXED_SIZE)) { /* Free it */ - ExFreePool(Irp); + ExFreePoolWithTag(Irp, TAG_IRP); } else { @@ -1520,7 +1528,7 @@ IoFreeIrp(IN PIRP Irp) { /* All lists failed, use the pool */ List->L.FreeMisses++; - ExFreePool(Irp); + ExFreePoolWithTag(Irp, TAG_IRP); Irp = NULL; } } @@ -1550,10 +1558,12 @@ IoGetPagingIoPriority(IN PIRP Irp) /* * @implemented */ -PEPROCESS NTAPI +PEPROCESS +NTAPI IoGetRequestorProcess(IN PIRP Irp) { - return(Irp->Tail.Overlay.Thread->ThreadsProcess); + /* Return the requestor process */ + return Irp->Tail.Overlay.Thread->ThreadsProcess; } /* @@ -1563,6 +1573,7 @@ ULONG NTAPI IoGetRequestorProcessId(IN PIRP Irp) { + /* Return the requestor process' id */ return (ULONG)(IoGetRequestorProcess(Irp)->UniqueProcessId); } @@ -1586,6 +1597,7 @@ PIRP NTAPI IoGetTopLevelIrp(VOID) { + /* Return the IRP */ return (PIRP)PsGetCurrentThread()->TopLevelIrp; } @@ -1736,5 +1748,3 @@ IoSetTopLevelIrp(IN PIRP Irp) /* Set the IRP */ PsGetCurrentThread()->TopLevelIrp = (ULONG)Irp; } - -/* EOF */ diff --git a/reactos/ntoskrnl/io/iomgr/irq.c b/reactos/ntoskrnl/io/iomgr/irq.c index 91cd1597d83..6d45b254343 100644 --- a/reactos/ntoskrnl/io/iomgr/irq.c +++ b/reactos/ntoskrnl/io/iomgr/irq.c @@ -10,7 +10,7 @@ #include #define NDEBUG -#include +#include /* FUNCTIONS *****************************************************************/ @@ -35,7 +35,7 @@ IoConnectInterrupt(OUT PKINTERRUPT *InterruptObject, PKINTERRUPT InterruptUsed; PIO_INTERRUPT IoInterrupt; PKSPIN_LOCK SpinLockUsed; - BOOLEAN FirstRun = TRUE; + BOOLEAN FirstRun; CCHAR Count = 0; KAFFINITY Affinity; PAGED_CODE(); diff --git a/reactos/ntoskrnl/io/iomgr/remlock.c b/reactos/ntoskrnl/io/iomgr/remlock.c index 60b037b750a..b5f301830dd 100644 --- a/reactos/ntoskrnl/io/iomgr/remlock.c +++ b/reactos/ntoskrnl/io/iomgr/remlock.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include /* FUNCTIONS *****************************************************************/ @@ -74,7 +74,7 @@ IoAcquireRemoveLockEx(IN PIO_REMOVE_LOCK RemoveLock, { /* FIXME: Not yet supported */ DPRINT1("UNIMPLEMENTED\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } } else @@ -110,7 +110,7 @@ IoReleaseRemoveLockEx(IN PIO_REMOVE_LOCK RemoveLock, { /* FIXME: Not yet supported */ DPRINT1("UNIMPLEMENTED\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* Decrement the lock count */ @@ -150,7 +150,7 @@ IoReleaseRemoveLockAndWaitEx(IN PIO_REMOVE_LOCK RemoveLock, { /* FIXME: Not yet supported */ DPRINT1("UNIMPLEMENTED\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } } diff --git a/reactos/ntoskrnl/io/iomgr/symlink.c b/reactos/ntoskrnl/io/iomgr/symlink.c index a2dc900c63c..6c2f083bf14 100644 --- a/reactos/ntoskrnl/io/iomgr/symlink.c +++ b/reactos/ntoskrnl/io/iomgr/symlink.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include /* FUNCTIONS ****************************************************************/ diff --git a/reactos/ntoskrnl/io/iomgr/util.c b/reactos/ntoskrnl/io/iomgr/util.c index 9506a49007f..871b3b9f23f 100644 --- a/reactos/ntoskrnl/io/iomgr/util.c +++ b/reactos/ntoskrnl/io/iomgr/util.c @@ -1,26 +1,24 @@ /* * PROJECT: ReactOS Kernel * LICENSE: GPL - See COPYING in the top level directory - * FILE: ntoskrnl/io/util.c + * FILE: ntoskrnl/io/iomgr/util.c * PURPOSE: I/O Utility Functions - * PROGRAMMERS: + * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) + * Aleksey Bragin (aleksey@reactos.org) + * Daniel Zimmerman (netzimme@aim.com) */ /* INCLUDES *****************************************************************/ #include #define NDEBUG -#include +#include VOID NTAPI RtlpGetStackLimits(PULONG_PTR StackBase, PULONG_PTR StackLimit); -/* DATA **********************************************************************/ - -KSPIN_LOCK CancelSpinLock; - /* FUNCTIONS *****************************************************************/ /* @@ -28,10 +26,10 @@ KSPIN_LOCK CancelSpinLock; */ VOID NTAPI -IoAcquireCancelSpinLock(PKIRQL Irql) +IoAcquireCancelSpinLock(OUT PKIRQL Irql) { /* Just acquire the internal lock */ - KeAcquireSpinLock(&CancelSpinLock,Irql); + *Irql = KeAcquireQueuedSpinLock(LockQueueIoCancelLock); } /* @@ -113,6 +111,7 @@ PEPROCESS NTAPI IoGetCurrentProcess(VOID) { + /* Return the current thread's process */ return (PEPROCESS)PsGetCurrentThread()->Tcb.ApcState.Process; } @@ -121,10 +120,10 @@ IoGetCurrentProcess(VOID) */ VOID NTAPI -IoReleaseCancelSpinLock(KIRQL Irql) +IoReleaseCancelSpinLock(IN KIRQL Irql) { /* Release the internal lock */ - KeReleaseSpinLock(&CancelSpinLock,Irql); + KeReleaseQueuedSpinLock(LockQueueIoCancelLock, Irql); } /* @@ -315,4 +314,3 @@ IoCheckQuerySetVolumeInformation(IN FS_INFORMATION_CLASS FsInformationClass, UNIMPLEMENTED; return STATUS_NOT_IMPLEMENTED; } -/* EOF */ diff --git a/reactos/ntoskrnl/io/iomgr/volume.c b/reactos/ntoskrnl/io/iomgr/volume.c index 14adb252c10..56d7d06856d 100644 --- a/reactos/ntoskrnl/io/iomgr/volume.c +++ b/reactos/ntoskrnl/io/iomgr/volume.c @@ -12,7 +12,7 @@ #include #define NDEBUG -#include +#include #if defined (ALLOC_PRAGMA) #pragma alloc_text(INIT, IoInitFileSystemImplementation) @@ -140,7 +140,7 @@ IopDereferenceVpb(IN PVPB Vpb) if (!Vpb->ReferenceCount) { /* FIXME: IMPLEMENT CLEANUP! */ - KEBUGCHECK(0); + ASSERT(FALSE); } /* Release VPB lock */ diff --git a/reactos/ntoskrnl/io/pnpmgr/plugplay.c b/reactos/ntoskrnl/io/pnpmgr/plugplay.c index 43fc9104f1d..15239bab02c 100644 --- a/reactos/ntoskrnl/io/pnpmgr/plugplay.c +++ b/reactos/ntoskrnl/io/pnpmgr/plugplay.c @@ -1,18 +1,16 @@ /* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/io/plugplay.c + * PROJECT: ReactOS Kernel + * COPYRIGHT: GPL - See COPYING in the top level directory + * FILE: ntoskrnl/io/pnpmgr/plugplay.c * PURPOSE: Plug-and-play interface routines - * * PROGRAMMERS: Eric Kohl */ /* INCLUDES *****************************************************************/ #include - #define NDEBUG -#include +#include #if defined (ALLOC_PRAGMA) #pragma alloc_text(INIT, IopInitPlugPlayEvents) @@ -114,127 +112,6 @@ IopRemovePlugPlayEvent(VOID) return STATUS_SUCCESS; } - -/* - * Plug and Play event structure used by NtGetPlugPlayEvent. - * - * EventGuid - * Can be one of the following values: - * GUID_HWPROFILE_QUERY_CHANGE - * GUID_HWPROFILE_CHANGE_CANCELLED - * GUID_HWPROFILE_CHANGE_COMPLETE - * GUID_TARGET_DEVICE_QUERY_REMOVE - * GUID_TARGET_DEVICE_REMOVE_CANCELLED - * GUID_TARGET_DEVICE_REMOVE_COMPLETE - * GUID_PNP_CUSTOM_NOTIFICATION - * GUID_PNP_POWER_NOTIFICATION - * GUID_DEVICE_* (see above) - * - * EventCategory - * Type of the event that happened. - * - * Result - * ? - * - * Flags - * ? - * - * TotalSize - * Size of the event block including the device IDs and other - * per category specific fields. - */ -/* - * NtGetPlugPlayEvent - * - * Returns one Plug & Play event from a global queue. - * - * Parameters - * Reserved1 - * Reserved2 - * Always set to zero. - * - * Buffer - * The buffer that will be filled with the event information on - * successful return from the function. - * - * BufferSize - * Size of the buffer pointed by the Buffer parameter. If the - * buffer size is not large enough to hold the whole event - * information, error STATUS_BUFFER_TOO_SMALL is returned and - * the buffer remains untouched. - * - * Return Values - * STATUS_PRIVILEGE_NOT_HELD - * STATUS_BUFFER_TOO_SMALL - * STATUS_SUCCESS - * - * Remarks - * This function isn't multi-thread safe! - * - * @implemented - */ -NTSTATUS STDCALL -NtGetPlugPlayEvent(IN ULONG Reserved1, - IN ULONG Reserved2, - OUT PPLUGPLAY_EVENT_BLOCK Buffer, - IN ULONG BufferSize) -{ - PPNP_EVENT_ENTRY Entry; - NTSTATUS Status; - - DPRINT("NtGetPlugPlayEvent() called\n"); - - /* Function can only be called from user-mode */ - if (KeGetPreviousMode() == KernelMode) - { - DPRINT1("NtGetPlugPlayEvent cannot be called from kernel mode!\n"); - return STATUS_ACCESS_DENIED; - } - - /* Check for Tcb privilege */ - if (!SeSinglePrivilegeCheck(SeTcbPrivilege, - UserMode)) - { - DPRINT1("NtGetPlugPlayEvent: Caller does not hold the SeTcbPrivilege privilege!\n"); - return STATUS_PRIVILEGE_NOT_HELD; - } - - /* Wait for a PnP event */ - DPRINT("Waiting for pnp notification event\n"); - Status = KeWaitForSingleObject(&IopPnpNotifyEvent, - UserRequest, - KernelMode, - FALSE, - NULL); - if (!NT_SUCCESS(Status)) - { - DPRINT1("KeWaitForSingleObject() failed (Status %lx)\n", Status); - return Status; - } - - /* Get entry from the tail of the queue */ - Entry = CONTAINING_RECORD(IopPnpEventQueueHead.Blink, - PNP_EVENT_ENTRY, - ListEntry); - - /* Check the buffer size */ - if (BufferSize < Entry->Event.TotalSize) - { - DPRINT1("Buffer is too small for the pnp-event\n"); - return STATUS_BUFFER_TOO_SMALL; - } - - /* Copy event data to the user buffer */ - memcpy(Buffer, - &Entry->Event, - Entry->Event.TotalSize); - - DPRINT("NtGetPlugPlayEvent() done\n"); - - return STATUS_SUCCESS; -} - - static PDEVICE_OBJECT IopTraverseDeviceNode(PDEVICE_NODE Node, PUNICODE_STRING DeviceInstance) { @@ -251,7 +128,7 @@ IopTraverseDeviceNode(PDEVICE_NODE Node, PUNICODE_STRING DeviceInstance) /* Traversal of all children nodes */ for (ChildNode = Node->Child; ChildNode != NULL; - ChildNode = ChildNode->NextSibling) + ChildNode = ChildNode->Sibling) { DeviceObject = IopTraverseDeviceNode(ChildNode, DeviceInstance); if (DeviceObject != NULL) @@ -483,7 +360,7 @@ IopGetRelatedDevice(PPLUGPLAY_CONTROL_RELATED_DEVICE_DATA RelatedDeviceData) break; case PNP_GET_SIBLING_DEVICE: - RelatedDeviceNode = DeviceNode->NextSibling; + RelatedDeviceNode = DeviceNode->Sibling; break; default: @@ -699,13 +576,135 @@ IopResetDevice(PPLUGPLAY_CONTROL_RESET_DEVICE_DATA ResetDeviceData) Status = IopActionConfigureChildServices(DeviceNode, DeviceNode->Parent); if (NT_SUCCESS(Status)) - Status = IopActionInitChildServices(DeviceNode, DeviceNode->Parent, FALSE); + Status = IopActionInitChildServices(DeviceNode, DeviceNode->Parent); ObDereferenceObject(DeviceObject); return Status; } +/* PUBLIC FUNCTIONS **********************************************************/ + +/* + * Plug and Play event structure used by NtGetPlugPlayEvent. + * + * EventGuid + * Can be one of the following values: + * GUID_HWPROFILE_QUERY_CHANGE + * GUID_HWPROFILE_CHANGE_CANCELLED + * GUID_HWPROFILE_CHANGE_COMPLETE + * GUID_TARGET_DEVICE_QUERY_REMOVE + * GUID_TARGET_DEVICE_REMOVE_CANCELLED + * GUID_TARGET_DEVICE_REMOVE_COMPLETE + * GUID_PNP_CUSTOM_NOTIFICATION + * GUID_PNP_POWER_NOTIFICATION + * GUID_DEVICE_* (see above) + * + * EventCategory + * Type of the event that happened. + * + * Result + * ? + * + * Flags + * ? + * + * TotalSize + * Size of the event block including the device IDs and other + * per category specific fields. + */ + +/* + * NtGetPlugPlayEvent + * + * Returns one Plug & Play event from a global queue. + * + * Parameters + * Reserved1 + * Reserved2 + * Always set to zero. + * + * Buffer + * The buffer that will be filled with the event information on + * successful return from the function. + * + * BufferSize + * Size of the buffer pointed by the Buffer parameter. If the + * buffer size is not large enough to hold the whole event + * information, error STATUS_BUFFER_TOO_SMALL is returned and + * the buffer remains untouched. + * + * Return Values + * STATUS_PRIVILEGE_NOT_HELD + * STATUS_BUFFER_TOO_SMALL + * STATUS_SUCCESS + * + * Remarks + * This function isn't multi-thread safe! + * + * @implemented + */ +NTSTATUS +NTAPI +NtGetPlugPlayEvent(IN ULONG Reserved1, + IN ULONG Reserved2, + OUT PPLUGPLAY_EVENT_BLOCK Buffer, + IN ULONG BufferSize) +{ + PPNP_EVENT_ENTRY Entry; + NTSTATUS Status; + + DPRINT("NtGetPlugPlayEvent() called\n"); + + /* Function can only be called from user-mode */ + if (KeGetPreviousMode() == KernelMode) + { + DPRINT1("NtGetPlugPlayEvent cannot be called from kernel mode!\n"); + return STATUS_ACCESS_DENIED; + } + + /* Check for Tcb privilege */ + if (!SeSinglePrivilegeCheck(SeTcbPrivilege, + UserMode)) + { + DPRINT1("NtGetPlugPlayEvent: Caller does not hold the SeTcbPrivilege privilege!\n"); + return STATUS_PRIVILEGE_NOT_HELD; + } + + /* Wait for a PnP event */ + DPRINT("Waiting for pnp notification event\n"); + Status = KeWaitForSingleObject(&IopPnpNotifyEvent, + UserRequest, + KernelMode, + FALSE, + NULL); + if (!NT_SUCCESS(Status)) + { + DPRINT1("KeWaitForSingleObject() failed (Status %lx)\n", Status); + return Status; + } + + /* Get entry from the tail of the queue */ + Entry = CONTAINING_RECORD(IopPnpEventQueueHead.Blink, + PNP_EVENT_ENTRY, + ListEntry); + + /* Check the buffer size */ + if (BufferSize < Entry->Event.TotalSize) + { + DPRINT1("Buffer is too small for the pnp-event\n"); + return STATUS_BUFFER_TOO_SMALL; + } + + /* Copy event data to the user buffer */ + memcpy(Buffer, + &Entry->Event, + Entry->Event.TotalSize); + + DPRINT("NtGetPlugPlayEvent() done\n"); + + return STATUS_SUCCESS; +} /* * NtPlugPlayControl @@ -763,7 +762,8 @@ IopResetDevice(PPLUGPLAY_CONTROL_RESET_DEVICE_DATA ResetDeviceData) * * @unimplemented */ -NTSTATUS STDCALL +NTSTATUS +NTAPI NtPlugPlayControl(IN PLUGPLAY_CONTROL_CLASS PlugPlayControlClass, IN OUT PVOID Buffer, IN ULONG BufferLength) @@ -844,5 +844,3 @@ NtPlugPlayControl(IN PLUGPLAY_CONTROL_CLASS PlugPlayControlClass, return STATUS_NOT_IMPLEMENTED; } - -/* EOF */ diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpdma.c b/reactos/ntoskrnl/io/pnpmgr/pnpdma.c index 19fdd982ad3..c0bd951b1f3 100644 --- a/reactos/ntoskrnl/io/pnpmgr/pnpdma.c +++ b/reactos/ntoskrnl/io/pnpmgr/pnpdma.c @@ -1,9 +1,8 @@ /* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/io/pnpdma.c + * PROJECT: ReactOS Kernel + * COPYRIGHT: GPL - See COPYING in the top level directory + * FILE: ntoskrnl/io/pnpmgr/pnpdma.c * PURPOSE: PnP manager DMA routines - * * PROGRAMMERS: Filip Navara (xnavara@volny.cz) */ @@ -11,72 +10,77 @@ #include #define NDEBUG -#include +#include #include -/* FUNCTIONS *****************************************************************/ +/* PUBLIC FUNCTIONS **********************************************************/ /* * @implemented */ -PDMA_ADAPTER STDCALL -IoGetDmaAdapter( - IN PDEVICE_OBJECT PhysicalDeviceObject, - IN PDEVICE_DESCRIPTION DeviceDescription, - IN OUT PULONG NumberOfMapRegisters) +PDMA_ADAPTER +NTAPI +IoGetDmaAdapter(IN PDEVICE_OBJECT PhysicalDeviceObject, + IN PDEVICE_DESCRIPTION DeviceDescription, + IN OUT PULONG NumberOfMapRegisters) { - NTSTATUS Status; - ULONG ResultLength; - BUS_INTERFACE_STANDARD BusInterface; - IO_STATUS_BLOCK IoStatusBlock; - IO_STACK_LOCATION Stack; - DEVICE_DESCRIPTION PrivateDeviceDescription; - PDMA_ADAPTER Adapter = NULL; + NTSTATUS Status; + ULONG ResultLength; + BUS_INTERFACE_STANDARD BusInterface; + IO_STATUS_BLOCK IoStatusBlock; + IO_STACK_LOCATION Stack; + DEVICE_DESCRIPTION PrivateDeviceDescription; + PDMA_ADAPTER Adapter = NULL; - DPRINT("IoGetDmaAdapter called\n"); + DPRINT("IoGetDmaAdapter called\n"); - /* - * Try to create DMA adapter through bus driver. - */ - if (PhysicalDeviceObject != NULL) - { - if (DeviceDescription->InterfaceType == PNPBus || - DeviceDescription->InterfaceType == InterfaceTypeUndefined) + /* Try to create DMA adapter through bus driver */ + if (PhysicalDeviceObject) { - RtlCopyMemory(&PrivateDeviceDescription, DeviceDescription, - sizeof(DEVICE_DESCRIPTION)); - Status = IoGetDeviceProperty(PhysicalDeviceObject, - DevicePropertyLegacyBusType, sizeof(INTERFACE_TYPE), - &PrivateDeviceDescription.InterfaceType, &ResultLength); - if (!NT_SUCCESS(Status)) - PrivateDeviceDescription.InterfaceType = Internal; - DeviceDescription = &PrivateDeviceDescription; + if (DeviceDescription->InterfaceType == PNPBus || + DeviceDescription->InterfaceType == InterfaceTypeUndefined) + { + RtlCopyMemory(&PrivateDeviceDescription, + DeviceDescription, + sizeof(DEVICE_DESCRIPTION)); + + Status = IoGetDeviceProperty(PhysicalDeviceObject, + DevicePropertyLegacyBusType, + sizeof(INTERFACE_TYPE), + &PrivateDeviceDescription.InterfaceType, + &ResultLength); + + if (!NT_SUCCESS(Status)) + PrivateDeviceDescription.InterfaceType = Internal; + + DeviceDescription = &PrivateDeviceDescription; + } + + Stack.Parameters.QueryInterface.Size = sizeof(BUS_INTERFACE_STANDARD); + Stack.Parameters.QueryInterface.Version = 1; + Stack.Parameters.QueryInterface.Interface = (PINTERFACE)&BusInterface; + Stack.Parameters.QueryInterface.InterfaceType = + &GUID_BUS_INTERFACE_STANDARD; + + Status = IopInitiatePnpIrp(PhysicalDeviceObject, + &IoStatusBlock, + IRP_MN_QUERY_INTERFACE, + &Stack); + + if (NT_SUCCESS(Status)) + { + Adapter = BusInterface.GetDmaAdapter(BusInterface.Context, + DeviceDescription, + NumberOfMapRegisters); + + BusInterface.InterfaceDereference(BusInterface.Context); + if (Adapter) return Adapter; + } } - Stack.Parameters.QueryInterface.Size = sizeof(BUS_INTERFACE_STANDARD); - Stack.Parameters.QueryInterface.Version = 1; - Stack.Parameters.QueryInterface.Interface = (PINTERFACE)&BusInterface; - Stack.Parameters.QueryInterface.InterfaceType = - &GUID_BUS_INTERFACE_STANDARD; - Status = IopInitiatePnpIrp(PhysicalDeviceObject, &IoStatusBlock, - IRP_MN_QUERY_INTERFACE, &Stack); - if (NT_SUCCESS(Status)) - { - Adapter = BusInterface.GetDmaAdapter(BusInterface.Context, - DeviceDescription, NumberOfMapRegisters); - BusInterface.InterfaceDereference(BusInterface.Context); - if (Adapter != NULL) - return Adapter; - } - } - - /* - * Fallback to HAL. - */ - - return HalGetDmaAdapter(PhysicalDeviceObject, DeviceDescription, - NumberOfMapRegisters); + /* Fall back to HAL */ + return HalGetDmaAdapter(PhysicalDeviceObject, + DeviceDescription, + NumberOfMapRegisters); } - -/* EOF */ diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c index 60364eddd3b..f56c241492f 100644 --- a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c +++ b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c @@ -1,19 +1,17 @@ /* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/io/pnpmgr.c + * PROJECT: ReactOS Kernel + * COPYRIGHT: GPL - See COPYING in the top level directory + * FILE: ntoskrnl/io/pnpmgr/pnpmgr.c * PURPOSE: Initializes the PnP manager - * * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net) - * Hervй Poussineau (hpoussin@reactos.org) + * Copyright 2007 Hervй Poussineau (hpoussin@reactos.org) */ /* INCLUDES ******************************************************************/ #include - #define NDEBUG -#include +#include //#define ENABLE_ACPI @@ -26,6 +24,7 @@ KGUARDED_MUTEX PpDeviceReferenceTableLock; RTL_AVL_TABLE PpDeviceReferenceTable; extern ULONG ExpInitializationPhase; +extern BOOLEAN PnpSystemInit; /* DATA **********************************************************************/ @@ -44,13 +43,6 @@ typedef struct _INVALIDATE_DEVICE_RELATION_DATA PIO_WORKITEM WorkItem; } INVALIDATE_DEVICE_RELATION_DATA, *PINVALIDATE_DEVICE_RELATION_DATA; -VOID -NTAPI -IoSynchronousInvalidateDeviceRelations( - IN PDEVICE_OBJECT DeviceObject, - IN DEVICE_RELATION_TYPE Type); - - /* FUNCTIONS *****************************************************************/ static NTSTATUS @@ -141,16 +133,13 @@ IopStartDevice( IO_STATUS_BLOCK IoStatusBlock; IO_STACK_LOCATION Stack; ULONG RequiredLength; - PDEVICE_OBJECT Fdo; NTSTATUS Status; - Fdo = IoGetAttachedDeviceReference(DeviceNode->PhysicalDeviceObject); - IopDeviceNodeSetFlag(DeviceNode, DNF_ASSIGNING_RESOURCES); DPRINT("Sending IRP_MN_FILTER_RESOURCE_REQUIREMENTS to device stack\n"); Stack.Parameters.FilterResourceRequirements.IoResourceRequirementList = DeviceNode->ResourceRequirements; Status = IopInitiatePnpIrp( - Fdo, + DeviceNode->PhysicalDeviceObject, &IoStatusBlock, IRP_MN_FILTER_RESOURCE_REQUIREMENTS, &Stack); @@ -192,7 +181,7 @@ IopStartDevice( KeEnterCriticalRegion(); Status = IopInitiatePnpIrp( - Fdo, + DeviceNode->PhysicalDeviceObject, &IoStatusBlock, IRP_MN_START_DEVICE, &Stack); @@ -210,21 +199,19 @@ IopStartDevice( DPRINT("Device needs enumeration, invalidating bus relations\n"); /* Invalidate device relations synchronously (otherwise there will be dirty read of DeviceNode) */ - IoSynchronousInvalidateDeviceRelations(DeviceNode->PhysicalDeviceObject, BusRelations); + IopEnumerateDevice(DeviceNode->PhysicalDeviceObject); IopDeviceNodeClearFlag(DeviceNode, DNF_NEED_ENUMERATION_ONLY); } } - ObDereferenceObject(Fdo); - if (NT_SUCCESS(Status)) - DeviceNode->Flags |= DN_STARTED; + IopDeviceNodeSetFlag(DeviceNode, DNF_STARTED); return Status; } NTSTATUS -STDCALL +NTAPI IopQueryDeviceCapabilities(PDEVICE_NODE DeviceNode, PDEVICE_CAPABILITIES DeviceCaps) { @@ -265,466 +252,6 @@ IopAsynchronousInvalidateDeviceRelations( ExFreePool(Data); } -/* - * @implemented - */ -VOID -NTAPI -IoInvalidateDeviceRelations( - IN PDEVICE_OBJECT DeviceObject, - IN DEVICE_RELATION_TYPE Type) -{ - PIO_WORKITEM WorkItem; - PINVALIDATE_DEVICE_RELATION_DATA Data; - - Data = ExAllocatePool(PagedPool, sizeof(INVALIDATE_DEVICE_RELATION_DATA)); - if (!Data) - return; - WorkItem = IoAllocateWorkItem(DeviceObject); - if (!WorkItem) - { - ExFreePool(Data); - return; - } - - ObReferenceObject(DeviceObject); - Data->DeviceObject = DeviceObject; - Data->Type = Type; - Data->WorkItem = WorkItem; - - IoQueueWorkItem( - WorkItem, - IopAsynchronousInvalidateDeviceRelations, - DelayedWorkQueue, - Data); -} - -/* - * @unimplemented - */ -NTSTATUS -STDCALL -IoGetDeviceProperty(IN PDEVICE_OBJECT DeviceObject, - IN DEVICE_REGISTRY_PROPERTY DeviceProperty, - IN ULONG BufferLength, - OUT PVOID PropertyBuffer, - OUT PULONG ResultLength) -{ - PDEVICE_NODE DeviceNode = IopGetDeviceNode(DeviceObject); - DEVICE_CAPABILITIES DeviceCaps; - ULONG Length; - PVOID Data = NULL; - PWSTR Ptr; - NTSTATUS Status; - - DPRINT("IoGetDeviceProperty(0x%p %d)\n", DeviceObject, DeviceProperty); - - *ResultLength = 0; - - if (DeviceNode == NULL) - return STATUS_INVALID_DEVICE_REQUEST; - - switch (DeviceProperty) - { - case DevicePropertyBusNumber: - Length = sizeof(ULONG); - Data = &DeviceNode->ChildBusNumber; - break; - - /* Complete, untested */ - case DevicePropertyBusTypeGuid: - /* Sanity check */ - if ((DeviceNode->ChildBusTypeIndex != 0xFFFF) && - (DeviceNode->ChildBusTypeIndex < IopBusTypeGuidList->GuidCount)) - { - /* Return the GUID */ - *ResultLength = sizeof(GUID); - - /* Check if the buffer given was large enough */ - if (BufferLength < *ResultLength) - { - return STATUS_BUFFER_TOO_SMALL; - } - - /* Copy the GUID */ - RtlCopyMemory(PropertyBuffer, - &(IopBusTypeGuidList->Guids[DeviceNode->ChildBusTypeIndex]), - sizeof(GUID)); - return STATUS_SUCCESS; - } - else - { - return STATUS_OBJECT_NAME_NOT_FOUND; - } - break; - - case DevicePropertyLegacyBusType: - Length = sizeof(INTERFACE_TYPE); - Data = &DeviceNode->ChildInterfaceType; - break; - - case DevicePropertyAddress: - /* Query the device caps */ - Status = IopQueryDeviceCapabilities(DeviceNode, &DeviceCaps); - if (NT_SUCCESS(Status) && (DeviceCaps.Address != (ULONG)-1)) - { - /* Return length */ - *ResultLength = sizeof(ULONG); - - /* Check if the buffer given was large enough */ - if (BufferLength < *ResultLength) - { - return STATUS_BUFFER_TOO_SMALL; - } - - /* Return address */ - *(PULONG)PropertyBuffer = DeviceCaps.Address; - return STATUS_SUCCESS; - } - else - { - return STATUS_OBJECT_NAME_NOT_FOUND; - } - break; - -// case DevicePropertyUINumber: -// if (DeviceNode->CapabilityFlags == NULL) -// return STATUS_INVALID_DEVICE_REQUEST; -// Length = sizeof(ULONG); -// Data = &DeviceNode->CapabilityFlags->UINumber; -// break; - - case DevicePropertyClassName: - case DevicePropertyClassGuid: - case DevicePropertyDriverKeyName: - case DevicePropertyManufacturer: - case DevicePropertyFriendlyName: - case DevicePropertyHardwareID: - case DevicePropertyCompatibleIDs: - case DevicePropertyDeviceDescription: - case DevicePropertyLocationInformation: - case DevicePropertyUINumber: - { - LPCWSTR RegistryPropertyName; - UNICODE_STRING EnumRoot = RTL_CONSTANT_STRING(ENUM_ROOT); - UNICODE_STRING ValueName; - KEY_VALUE_PARTIAL_INFORMATION *ValueInformation; - ULONG ValueInformationLength; - HANDLE KeyHandle, EnumRootHandle; - NTSTATUS Status; - - switch (DeviceProperty) - { - case DevicePropertyClassName: - RegistryPropertyName = L"Class"; break; - case DevicePropertyClassGuid: - RegistryPropertyName = L"ClassGuid"; break; - case DevicePropertyDriverKeyName: - RegistryPropertyName = L"Driver"; break; - case DevicePropertyManufacturer: - RegistryPropertyName = L"Mfg"; break; - case DevicePropertyFriendlyName: - RegistryPropertyName = L"FriendlyName"; break; - case DevicePropertyHardwareID: - RegistryPropertyName = L"HardwareID"; break; - case DevicePropertyCompatibleIDs: - RegistryPropertyName = L"CompatibleIDs"; break; - case DevicePropertyDeviceDescription: - RegistryPropertyName = L"DeviceDesc"; break; - case DevicePropertyLocationInformation: - RegistryPropertyName = L"LocationInformation"; break; - case DevicePropertyUINumber: - RegistryPropertyName = L"UINumber"; break; - default: - /* Should not happen */ - ASSERT(FALSE); - return STATUS_UNSUCCESSFUL; - } - - DPRINT("Registry property %S\n", RegistryPropertyName); - - /* Open Enum key */ - Status = IopOpenRegistryKeyEx(&EnumRootHandle, NULL, - &EnumRoot, KEY_READ); - if (!NT_SUCCESS(Status)) - { - DPRINT1("Error opening ENUM_ROOT, Status=0x%08x\n", Status); - return Status; - } - - /* Open instance key */ - Status = IopOpenRegistryKeyEx(&KeyHandle, EnumRootHandle, - &DeviceNode->InstancePath, KEY_READ); - if (!NT_SUCCESS(Status)) - { - DPRINT1("Error opening InstancePath, Status=0x%08x\n", Status); - ZwClose(EnumRootHandle); - return Status; - } - - /* Allocate buffer to read as much data as required by the caller */ - ValueInformationLength = FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, - Data[0]) + BufferLength; - ValueInformation = ExAllocatePool(PagedPool, ValueInformationLength); - if (!ValueInformation) - { - ZwClose(KeyHandle); - return STATUS_INSUFFICIENT_RESOURCES; - } - - /* Read the value */ - RtlInitUnicodeString(&ValueName, RegistryPropertyName); - Status = ZwQueryValueKey(KeyHandle, &ValueName, - KeyValuePartialInformation, ValueInformation, - ValueInformationLength, - &ValueInformationLength); - ZwClose(KeyHandle); - - /* Return data */ - *ResultLength = ValueInformation->DataLength; - - if (!NT_SUCCESS(Status)) - { - DPRINT1("Problem: Status=0x%08x, ResultLength = %d\n", Status, *ResultLength); - ExFreePool(ValueInformation); - if (Status == STATUS_BUFFER_OVERFLOW) - return STATUS_BUFFER_TOO_SMALL; - else - return Status; - } - - /* FIXME: Verify the value (NULL-terminated, correct format). */ - RtlCopyMemory(PropertyBuffer, ValueInformation->Data, - ValueInformation->DataLength); - ExFreePool(ValueInformation); - - return STATUS_SUCCESS; - } - - case DevicePropertyBootConfiguration: - Length = 0; - if (DeviceNode->BootResources->Count != 0) - { - Length = CM_RESOURCE_LIST_SIZE(DeviceNode->BootResources); - } - Data = &DeviceNode->BootResources; - break; - - /* FIXME: use a translated boot configuration instead */ - case DevicePropertyBootConfigurationTranslated: - Length = 0; - if (DeviceNode->BootResources->Count != 0) - { - Length = CM_RESOURCE_LIST_SIZE(DeviceNode->BootResources); - } - Data = &DeviceNode->BootResources; - break; - - case DevicePropertyEnumeratorName: - /* A buffer overflow can't happen here, since InstancePath - * always contains the enumerator name followed by \\ */ - Ptr = wcschr(DeviceNode->InstancePath.Buffer, L'\\'); - ASSERT(Ptr); - Length = (Ptr - DeviceNode->InstancePath.Buffer + 1) * sizeof(WCHAR); - Data = DeviceNode->InstancePath.Buffer; - break; - - case DevicePropertyPhysicalDeviceObjectName: - /* InstancePath buffer is NULL terminated, so we can do this */ - Length = DeviceNode->InstancePath.MaximumLength; - Data = DeviceNode->InstancePath.Buffer; - break; - - default: - return STATUS_INVALID_PARAMETER_2; - } - - /* Prepare returned values */ - *ResultLength = Length; - if (BufferLength < Length) - return STATUS_BUFFER_TOO_SMALL; - RtlCopyMemory(PropertyBuffer, Data, Length); - - /* NULL terminate the string (if required) */ - if (DeviceProperty == DevicePropertyEnumeratorName) - ((LPWSTR)PropertyBuffer)[Length / sizeof(WCHAR)] = UNICODE_NULL; - - return STATUS_SUCCESS; -} - -/* - * @unimplemented - */ -VOID -STDCALL -IoInvalidateDeviceState(IN PDEVICE_OBJECT PhysicalDeviceObject) -{ - UNIMPLEMENTED; -} - -/** - * @name IoOpenDeviceRegistryKey - * - * Open a registry key unique for a specified driver or device instance. - * - * @param DeviceObject Device to get the registry key for. - * @param DevInstKeyType Type of the key to return. - * @param DesiredAccess Access mask (eg. KEY_READ | KEY_WRITE). - * @param DevInstRegKey Handle to the opened registry key on - * successful return. - * - * @return Status. - * - * @implemented - */ -NTSTATUS -STDCALL -IoOpenDeviceRegistryKey(IN PDEVICE_OBJECT DeviceObject, - IN ULONG DevInstKeyType, - IN ACCESS_MASK DesiredAccess, - OUT PHANDLE DevInstRegKey) -{ - static WCHAR RootKeyName[] = - L"\\Registry\\Machine\\System\\CurrentControlSet\\"; - static WCHAR ProfileKeyName[] = - L"Hardware Profiles\\Current\\System\\CurrentControlSet\\"; - static WCHAR ClassKeyName[] = L"Control\\Class\\"; - static WCHAR EnumKeyName[] = L"Enum\\"; - static WCHAR DeviceParametersKeyName[] = L"Device Parameters"; - ULONG KeyNameLength; - LPWSTR KeyNameBuffer; - UNICODE_STRING KeyName; - ULONG DriverKeyLength; - OBJECT_ATTRIBUTES ObjectAttributes; - PDEVICE_NODE DeviceNode = NULL; - NTSTATUS Status; - - DPRINT("IoOpenDeviceRegistryKey() called\n"); - - if ((DevInstKeyType & (PLUGPLAY_REGKEY_DEVICE | PLUGPLAY_REGKEY_DRIVER)) == 0) - { - DPRINT1("IoOpenDeviceRegistryKey(): got wrong params, exiting... \n"); - return STATUS_INVALID_PARAMETER; - } - - /* - * Calculate the length of the base key name. This is the full - * name for driver key or the name excluding "Device Parameters" - * subkey for device key. - */ - - KeyNameLength = sizeof(RootKeyName); - if (DevInstKeyType & PLUGPLAY_REGKEY_CURRENT_HWPROFILE) - KeyNameLength += sizeof(ProfileKeyName) - sizeof(UNICODE_NULL); - if (DevInstKeyType & PLUGPLAY_REGKEY_DRIVER) - { - KeyNameLength += sizeof(ClassKeyName) - sizeof(UNICODE_NULL); - Status = IoGetDeviceProperty(DeviceObject, DevicePropertyDriverKeyName, - 0, NULL, &DriverKeyLength); - if (Status != STATUS_BUFFER_TOO_SMALL) - return Status; - KeyNameLength += DriverKeyLength; - } - else - { - DeviceNode = IopGetDeviceNode(DeviceObject); - KeyNameLength += sizeof(EnumKeyName) - sizeof(UNICODE_NULL) + - DeviceNode->InstancePath.Length; - } - - /* - * Now allocate the buffer for the key name... - */ - - KeyNameBuffer = ExAllocatePool(PagedPool, KeyNameLength); - if (KeyNameBuffer == NULL) - return STATUS_INSUFFICIENT_RESOURCES; - - KeyName.Length = 0; - KeyName.MaximumLength = (USHORT)KeyNameLength; - KeyName.Buffer = KeyNameBuffer; - - /* - * ...and build the key name. - */ - - KeyName.Length += sizeof(RootKeyName) - sizeof(UNICODE_NULL); - RtlCopyMemory(KeyNameBuffer, RootKeyName, KeyName.Length); - - if (DevInstKeyType & PLUGPLAY_REGKEY_CURRENT_HWPROFILE) - RtlAppendUnicodeToString(&KeyName, ProfileKeyName); - - if (DevInstKeyType & PLUGPLAY_REGKEY_DRIVER) - { - RtlAppendUnicodeToString(&KeyName, ClassKeyName); - Status = IoGetDeviceProperty(DeviceObject, DevicePropertyDriverKeyName, - DriverKeyLength, KeyNameBuffer + - (KeyName.Length / sizeof(WCHAR)), - &DriverKeyLength); - if (!NT_SUCCESS(Status)) - { - DPRINT1("Call to IoGetDeviceProperty() failed with Status 0x%08lx\n", Status); - ExFreePool(KeyNameBuffer); - return Status; - } - KeyName.Length += (USHORT)DriverKeyLength - sizeof(UNICODE_NULL); - } - else - { - RtlAppendUnicodeToString(&KeyName, EnumKeyName); - Status = RtlAppendUnicodeStringToString(&KeyName, &DeviceNode->InstancePath); - if (DeviceNode->InstancePath.Length == 0) - { - ExFreePool(KeyNameBuffer); - return Status; - } - } - - /* - * Open the base key. - */ - Status = IopOpenRegistryKeyEx(DevInstRegKey, NULL, &KeyName, DesiredAccess); - if (!NT_SUCCESS(Status)) - { - DPRINT1("IoOpenDeviceRegistryKey(%wZ): Base key doesn't exist, exiting... (Status 0x%08lx)\n", &KeyName, Status); - ExFreePool(KeyNameBuffer); - return Status; - } - ExFreePool(KeyNameBuffer); - - /* - * For driver key we're done now. - */ - - if (DevInstKeyType & PLUGPLAY_REGKEY_DRIVER) - return Status; - - /* - * Let's go further. For device key we must open "Device Parameters" - * subkey and create it if it doesn't exist yet. - */ - - RtlInitUnicodeString(&KeyName, DeviceParametersKeyName); - InitializeObjectAttributes(&ObjectAttributes, &KeyName, - OBJ_CASE_INSENSITIVE, *DevInstRegKey, NULL); - Status = ZwCreateKey(DevInstRegKey, DesiredAccess, &ObjectAttributes, - 0, NULL, REG_OPTION_NON_VOLATILE, NULL); - ZwClose(ObjectAttributes.RootDirectory); - - return Status; -} - -/* - * @unimplemented - */ -VOID -STDCALL -IoRequestDeviceEject(IN PDEVICE_OBJECT PhysicalDeviceObject) -{ - UNIMPLEMENTED; -} - - NTSTATUS IopGetSystemPowerDeviceObject(PDEVICE_OBJECT *DeviceObject) { @@ -743,7 +270,7 @@ IopGetSystemPowerDeviceObject(PDEVICE_OBJECT *DeviceObject) } USHORT -STDCALL +NTAPI IopGetBusTypeGuidIndex(LPGUID BusTypeGuid) { USHORT i = 0, FoundIndex = 0xFFFF; @@ -857,19 +384,19 @@ IopCreateDeviceNode(PDEVICE_NODE ParentNode, ((PEXTENDED_DEVOBJ_EXTENSION)PhysicalDeviceObject->DeviceObjectExtension)->DeviceNode = Node; - if (ParentNode) - { - KeAcquireSpinLock(&IopDeviceTreeLock, &OldIrql); - Node->Parent = ParentNode; - Node->NextSibling = ParentNode->Child; - if (ParentNode->Child != NULL) - { - ParentNode->Child->PrevSibling = Node; - } - ParentNode->Child = Node; - KeReleaseSpinLock(&IopDeviceTreeLock, OldIrql); - Node->Level = ParentNode->Level + 1; - } + if (ParentNode) + { + KeAcquireSpinLock(&IopDeviceTreeLock, &OldIrql); + Node->Parent = ParentNode; + Node->Sibling = ParentNode->Child; + ParentNode->Child = Node; + if (ParentNode->LastChild == NULL) + ParentNode->LastChild = Node; + KeReleaseSpinLock(&IopDeviceTreeLock, OldIrql); + Node->Level = ParentNode->Level + 1; + } + + PhysicalDeviceObject->Flags &= ~DO_DEVICE_INITIALIZING; *DeviceNode = Node; @@ -880,6 +407,7 @@ NTSTATUS IopFreeDeviceNode(PDEVICE_NODE DeviceNode) { KIRQL OldIrql; + PDEVICE_NODE PrevSibling = NULL; /* All children must be deleted before a parent is deleted */ ASSERT(!DeviceNode->Child); @@ -890,24 +418,30 @@ IopFreeDeviceNode(PDEVICE_NODE DeviceNode) ObDereferenceObject(DeviceNode->PhysicalDeviceObject); - /* Unlink from parent if it exists */ + /* Get previous sibling */ + if (DeviceNode->Parent && DeviceNode->Parent->Child != DeviceNode) + { + PrevSibling = DeviceNode->Parent->Child; + while (PrevSibling->Sibling != DeviceNode) + PrevSibling = PrevSibling->Sibling; + } - if ((DeviceNode->Parent) && (DeviceNode->Parent->Child == DeviceNode)) - { - DeviceNode->Parent->Child = DeviceNode->NextSibling; - } + /* Unlink from parent if it exists */ + if (DeviceNode->Parent) + { + if (DeviceNode->Parent->LastChild == DeviceNode) + { + DeviceNode->Parent->LastChild = PrevSibling; + if (PrevSibling) + PrevSibling->Sibling = NULL; + } + if (DeviceNode->Parent->Child == DeviceNode) + DeviceNode->Parent->Child = DeviceNode->Sibling; + } - /* Unlink from sibling list */ - - if (DeviceNode->PrevSibling) - { - DeviceNode->PrevSibling->NextSibling = DeviceNode->NextSibling; - } - - if (DeviceNode->NextSibling) - { - DeviceNode->NextSibling->PrevSibling = DeviceNode->PrevSibling; - } + /* Unlink from sibling list */ + if (PrevSibling) + PrevSibling->Sibling = DeviceNode->Sibling; KeReleaseSpinLock(&IopDeviceTreeLock, OldIrql); @@ -1020,7 +554,7 @@ IopTraverseDeviceTreeNode(PDEVICETREE_TRAVERSE_CONTEXT Context) /* Traversal of all children nodes */ for (ChildDeviceNode = ParentDeviceNode->Child; ChildDeviceNode != NULL; - ChildDeviceNode = ChildDeviceNode->NextSibling) + ChildDeviceNode = ChildDeviceNode->Sibling) { /* Pass the current device node to the action routine */ Context->DeviceNode = ChildDeviceNode; @@ -1403,7 +937,7 @@ IopAssignDeviceResources( 0x3c /* PCI_INTERRUPT_LINE */, sizeof(UCHAR)); if (ret == 0 || ret == 2) - KEBUGCHECK(0); + ASSERT(FALSE); } } } @@ -2129,89 +1663,98 @@ IopActionInterrogateDeviceStack(PDEVICE_NODE DeviceNode, if (!IopDeviceNodeHasFlag(DeviceNode, DNF_LEGACY_DRIVER)) { /* Report the device to the user-mode pnp manager */ - IopQueueTargetDeviceEvent(&GUID_DEVICE_ARRIVAL, + IopQueueTargetDeviceEvent(&GUID_DEVICE_ENUMERATED, &DeviceNode->InstancePath); } return STATUS_SUCCESS; } -/* - * @implemented - */ -VOID -NTAPI -IoSynchronousInvalidateDeviceRelations( - IN PDEVICE_OBJECT DeviceObject, - IN DEVICE_RELATION_TYPE Type) + +NTSTATUS +IopEnumerateDevice( + IN PDEVICE_OBJECT DeviceObject) { PDEVICE_NODE DeviceNode = IopGetDeviceNode(DeviceObject); DEVICETREE_TRAVERSE_CONTEXT Context; PDEVICE_RELATIONS DeviceRelations; + PDEVICE_OBJECT ChildDeviceObject; IO_STATUS_BLOCK IoStatusBlock; PDEVICE_NODE ChildDeviceNode; IO_STACK_LOCATION Stack; - BOOLEAN BootDrivers; - OBJECT_ATTRIBUTES ObjectAttributes; - UNICODE_STRING LinkName = RTL_CONSTANT_STRING(L"\\SystemRoot"); - HANDLE Handle; NTSTATUS Status; ULONG i; DPRINT("DeviceObject 0x%p\n", DeviceObject); + DPRINT("Sending GUID_DEVICE_ARRIVAL\n"); + + /* Report the device to the user-mode pnp manager */ + IopQueueTargetDeviceEvent(&GUID_DEVICE_ARRIVAL, + &DeviceNode->InstancePath); + DPRINT("Sending IRP_MN_QUERY_DEVICE_RELATIONS to device stack\n"); - Stack.Parameters.QueryDeviceRelations.Type = Type; + Stack.Parameters.QueryDeviceRelations.Type = BusRelations; Status = IopInitiatePnpIrp( DeviceObject, &IoStatusBlock, IRP_MN_QUERY_DEVICE_RELATIONS, &Stack); - if (!NT_SUCCESS(Status)) + if (!NT_SUCCESS(Status) || Status == STATUS_PENDING) { DPRINT("IopInitiatePnpIrp() failed with status 0x%08lx\n", Status); - return; + return Status; } DeviceRelations = (PDEVICE_RELATIONS)IoStatusBlock.Information; - if (!DeviceRelations || DeviceRelations->Count <= 0) + if (!DeviceRelations) { DPRINT("No PDOs\n"); - if (DeviceRelations) - { - ExFreePool(DeviceRelations); - } - return; + return STATUS_UNSUCCESSFUL; } - DPRINT("Got %d PDOs\n", DeviceRelations->Count); + DPRINT("Got %u PDOs\n", DeviceRelations->Count); /* * Create device nodes for all discovered devices */ for (i = 0; i < DeviceRelations->Count; i++) { - if (IopGetDeviceNode(DeviceRelations->Objects[i]) != NULL) + ChildDeviceObject = DeviceRelations->Objects[i]; + ASSERT((ChildDeviceObject->Flags & DO_DEVICE_INITIALIZING) == 0); + + ChildDeviceNode = IopGetDeviceNode(ChildDeviceObject); + if (!ChildDeviceNode) { - ObDereferenceObject(DeviceRelations->Objects[i]); - continue; + /* One doesn't exist, create it */ + Status = IopCreateDeviceNode( + DeviceNode, + ChildDeviceObject, + NULL, + &ChildDeviceNode); + if (NT_SUCCESS(Status)) + { + /* Mark the node as enumerated */ + ChildDeviceNode->Flags |= DNF_ENUMERATED; + + /* Mark the DO as bus enumerated */ + ChildDeviceObject->Flags |= DO_BUS_ENUMERATED_DEVICE; + } + else + { + /* Ignore this DO */ + DPRINT1("IopCreateDeviceNode() failed with status 0x%08x. Skipping PDO %u\n", Status, i); + ObDereferenceObject(ChildDeviceNode); + } } - Status = IopCreateDeviceNode( - DeviceNode, - DeviceRelations->Objects[i], - NULL, - &ChildDeviceNode); - DeviceNode->Flags |= DNF_ENUMERATED; - if (!NT_SUCCESS(Status)) + else { - DPRINT("No resources\n"); - for (i = 0; i < DeviceRelations->Count; i++) - ObDereferenceObject(DeviceRelations->Objects[i]); - ExFreePool(DeviceRelations); - return; + /* Mark it as enumerated */ + ChildDeviceNode->Flags |= DNF_ENUMERATED; + ObDereferenceObject(ChildDeviceObject); } } ExFreePool(DeviceRelations); @@ -2229,7 +1772,7 @@ IoSynchronousInvalidateDeviceRelations( if (!NT_SUCCESS(Status)) { DPRINT("IopTraverseDeviceTree() failed with status 0x%08lx\n", Status); - return; + return Status; } /* @@ -2245,49 +1788,24 @@ IoSynchronousInvalidateDeviceRelations( if (!NT_SUCCESS(Status)) { DPRINT("IopTraverseDeviceTree() failed with status 0x%08lx\n", Status); - return; + return Status; } /* - * Get the state of the system boot. If the \\SystemRoot link isn't - * created yet, we will assume that it's possible to load only boot - * drivers. + * Initialize services for discovered children. */ - InitializeObjectAttributes( - &ObjectAttributes, - &LinkName, - 0, - NULL, - NULL); - Status = ZwOpenFile( - &Handle, - FILE_ALL_ACCESS, - &ObjectAttributes, - &IoStatusBlock, - 0, - 0); - if (NT_SUCCESS(Status)) - { - BootDrivers = FALSE; - ZwClose(Handle); - } - else - BootDrivers = TRUE; - - /* - * Initialize services for discovered children. Only boot drivers will - * be loaded from boot driver! - */ - Status = IopInitializePnpServices(DeviceNode, BootDrivers); + Status = IopInitializePnpServices(DeviceNode); if (!NT_SUCCESS(Status)) { DPRINT("IopInitializePnpServices() failed with status 0x%08lx\n", Status); - return; + return Status; } - DPRINT("IopInvalidateDeviceRelations() finished\n"); + DPRINT("IopEnumerateDevice() finished\n"); + return STATUS_SUCCESS; } + /* * IopActionConfigureChildServices * @@ -2398,7 +1916,6 @@ IopActionConfigureChildServices(PDEVICE_NODE DeviceNode, * device is started */ DPRINT1("%wZ is using NULL driver\n", &DeviceNode->InstancePath); IopDeviceNodeSetFlag(DeviceNode, DNF_STARTED); - DeviceNode->Flags |= DN_STARTED; } return STATUS_SUCCESS; } @@ -2419,8 +1936,6 @@ IopActionConfigureChildServices(PDEVICE_NODE DeviceNode, * Pointer to device node. * Context * Pointer to parent node to initialize child node services for. - * BootDrivers - * Load only driver marked as boot start. * * Remarks * If the driver image for a service is not loaded and initialized @@ -2433,14 +1948,13 @@ IopActionConfigureChildServices(PDEVICE_NODE DeviceNode, NTSTATUS IopActionInitChildServices(PDEVICE_NODE DeviceNode, - PVOID Context, - BOOLEAN BootDrivers) + PVOID Context) { PDEVICE_NODE ParentDeviceNode; NTSTATUS Status; + BOOLEAN BootDrivers = !PnpSystemInit; - DPRINT("IopActionInitChildServices(%p, %p, %d)\n", DeviceNode, Context, - BootDrivers); + DPRINT("IopActionInitChildServices(%p, %p)\n", DeviceNode, Context); ParentDeviceNode = (PDEVICE_NODE)Context; @@ -2514,8 +2028,6 @@ IopActionInitChildServices(PDEVICE_NODE DeviceNode, /* Driver is loaded and initialized at this point */ if (NT_SUCCESS(Status)) { - /* We have a driver for this DeviceNode */ - DeviceNode->Flags |= DN_DRIVER_LOADED; /* Attach lower level filter drivers. */ IopAttachFilterDrivers(DeviceNode, TRUE); /* Initialize the function driver for the device node */ @@ -2545,7 +2057,7 @@ IopActionInitChildServices(PDEVICE_NODE DeviceNode, IopDeviceNodeSetFlag(DeviceNode, DNF_DISABLED); IopDeviceNodeSetFlag(DeviceNode, DNF_START_FAILED); /* FIXME: Log the error (possibly in IopInitializeDeviceNodeService) */ - CPRINT("Initialization of service %S failed (Status %x)\n", + DPRINT1("Initialization of service %S failed (Status %x)\n", DeviceNode->ServiceName.Buffer, Status); } } @@ -2559,34 +2071,6 @@ IopActionInitChildServices(PDEVICE_NODE DeviceNode, return STATUS_SUCCESS; } -/* - * IopActionInitAllServices - * - * Initialize the service for all (direct) child nodes of a parent node. This - * function just calls IopActionInitChildServices with BootDrivers = FALSE. - */ - -NTSTATUS -IopActionInitAllServices(PDEVICE_NODE DeviceNode, - PVOID Context) -{ - return IopActionInitChildServices(DeviceNode, Context, FALSE); -} - -/* - * IopActionInitBootServices - * - * Initialize the boot start services for all (direct) child nodes of a - * parent node. This function just calls IopActionInitChildServices with - * BootDrivers = TRUE. - */ -NTSTATUS -IopActionInitBootServices(PDEVICE_NODE DeviceNode, - PVOID Context) -{ - return IopActionInitChildServices(DeviceNode, Context, TRUE); -} - /* * IopInitializePnpServices * @@ -2596,37 +2080,21 @@ IopActionInitBootServices(PDEVICE_NODE DeviceNode, * DeviceNode * Top device node to start initializing services. * - * BootDrivers - * When set to TRUE, only drivers marked as boot start will - * be loaded. Otherwise, all drivers will be loaded. - * * Return Value * Status */ NTSTATUS -IopInitializePnpServices(IN PDEVICE_NODE DeviceNode, - IN BOOLEAN BootDrivers) +IopInitializePnpServices(IN PDEVICE_NODE DeviceNode) { DEVICETREE_TRAVERSE_CONTEXT Context; - DPRINT("IopInitializePnpServices(%p, %d)\n", DeviceNode, BootDrivers); + DPRINT("IopInitializePnpServices(%p)\n", DeviceNode); - if (BootDrivers) - { - IopInitDeviceTreeTraverseContext( - &Context, - DeviceNode, - IopActionInitBootServices, - DeviceNode); - } - else - { - IopInitDeviceTreeTraverseContext( - &Context, - DeviceNode, - IopActionInitAllServices, - DeviceNode); - } + IopInitDeviceTreeTraverseContext( + &Context, + DeviceNode, + IopActionInitChildServices, + DeviceNode); return IopTraverseDeviceTree(&Context); } @@ -3283,6 +2751,7 @@ IopUpdateRootKey(VOID) } NTSTATUS +NTAPI IopOpenRegistryKeyEx(PHANDLE KeyHandle, HANDLE ParentKey, PUNICODE_STRING Name, @@ -3306,6 +2775,51 @@ IopOpenRegistryKeyEx(PHANDLE KeyHandle, return Status; } +NTSTATUS +NTAPI +IopGetRegistryValue(IN HANDLE Handle, + IN PWSTR ValueName, + OUT PKEY_VALUE_FULL_INFORMATION *Information) +{ + UNICODE_STRING ValueString; + NTSTATUS Status; + PKEY_VALUE_FULL_INFORMATION FullInformation; + ULONG Size; + PAGED_CODE(); + + RtlInitUnicodeString(&ValueString, ValueName); + + Status = ZwQueryValueKey(Handle, + &ValueString, + KeyValueFullInformation, + NULL, + 0, + &Size); + if ((Status != STATUS_BUFFER_OVERFLOW) && + (Status != STATUS_BUFFER_TOO_SMALL)) + { + return Status; + } + + FullInformation = ExAllocatePool(NonPagedPool, Size); + if (!FullInformation) return STATUS_INSUFFICIENT_RESOURCES; + + Status = ZwQueryValueKey(Handle, + &ValueString, + KeyValueFullInformation, + FullInformation, + Size, + &Size); + if (!NT_SUCCESS(Status)) + { + ExFreePool(FullInformation); + return Status; + } + + *Information = FullInformation; + return STATUS_SUCCESS; +} + static NTSTATUS INIT_FUNCTION NTAPI PnpDriverInitializeEmpty(IN struct _DRIVER_OBJECT *DriverObject, IN PUNICODE_STRING RegistryPath) @@ -3332,8 +2846,8 @@ PnpInit(VOID) Status = IopInitPlugPlayEvents(); if (!NT_SUCCESS(Status)) { - CPRINT("IopInitPlugPlayEvents() failed\n"); - KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0); + DPRINT1("IopInitPlugPlayEvents() failed\n"); + KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0); } /* @@ -3343,30 +2857,30 @@ PnpInit(VOID) Status = IopCreateDriver(NULL, PnpDriverInitializeEmpty, NULL, 0, 0, &IopRootDriverObject); if (!NT_SUCCESS(Status)) { - CPRINT("IoCreateDriverObject() failed\n"); - KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0); + DPRINT1("IoCreateDriverObject() failed\n"); + KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0); } Status = IoCreateDevice(IopRootDriverObject, 0, NULL, FILE_DEVICE_CONTROLLER, 0, FALSE, &Pdo); if (!NT_SUCCESS(Status)) { - CPRINT("IoCreateDevice() failed\n"); - KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0); + DPRINT1("IoCreateDevice() failed\n"); + KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0); } Status = IopCreateDeviceNode(NULL, Pdo, NULL, &IopRootDeviceNode); if (!NT_SUCCESS(Status)) { - CPRINT("Insufficient resources\n"); - KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0); + DPRINT1("Insufficient resources\n"); + KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0); } if (!RtlCreateUnicodeString(&IopRootDeviceNode->InstancePath, L"HTREE\\ROOT\\0")) { - CPRINT("Failed to create the instance path!\n"); - KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, STATUS_NO_MEMORY, 0, 0, 0); + DPRINT1("Failed to create the instance path!\n"); + KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, STATUS_NO_MEMORY, 0, 0, 0); } /* Report the device to the user-mode pnp manager */ @@ -3384,8 +2898,8 @@ PnpInit(VOID) Status = IopUpdateRootKey(); if (!NT_SUCCESS(Status)) { - CPRINT("IopUpdateRootKey() failed\n"); - KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0); + DPRINT1("IopUpdateRootKey() failed\n"); + KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0); } } @@ -3396,7 +2910,7 @@ PiCompareInstancePath(IN PRTL_AVL_TABLE Table, IN PVOID SecondStruct) { /* FIXME: TODO */ - KEBUGCHECK(0); + ASSERT(FALSE); return 0; } @@ -3411,7 +2925,7 @@ PiAllocateGenericTableEntry(IN PRTL_AVL_TABLE Table, IN CLONG ByteSize) { /* FIXME: TODO */ - KEBUGCHECK(0); + ASSERT(FALSE); return NULL; } @@ -3421,7 +2935,7 @@ PiFreeGenericTableEntry(IN PRTL_AVL_TABLE Table, IN PVOID Buffer) { /* FIXME: TODO */ - KEBUGCHECK(0); + ASSERT(FALSE); } VOID @@ -3476,4 +2990,490 @@ PpInitSystem(VOID) } } -/* EOF */ +/* PUBLIC FUNCTIONS **********************************************************/ + +/* + * @unimplemented + */ +NTSTATUS +NTAPI +IoGetDeviceProperty(IN PDEVICE_OBJECT DeviceObject, + IN DEVICE_REGISTRY_PROPERTY DeviceProperty, + IN ULONG BufferLength, + OUT PVOID PropertyBuffer, + OUT PULONG ResultLength) +{ + PDEVICE_NODE DeviceNode = IopGetDeviceNode(DeviceObject); + DEVICE_CAPABILITIES DeviceCaps; + ULONG Length; + PVOID Data = NULL; + PWSTR Ptr; + NTSTATUS Status; + + DPRINT("IoGetDeviceProperty(0x%p %d)\n", DeviceObject, DeviceProperty); + + *ResultLength = 0; + + if (DeviceNode == NULL) + return STATUS_INVALID_DEVICE_REQUEST; + + switch (DeviceProperty) + { + case DevicePropertyBusNumber: + Length = sizeof(ULONG); + Data = &DeviceNode->ChildBusNumber; + break; + + /* Complete, untested */ + case DevicePropertyBusTypeGuid: + /* Sanity check */ + if ((DeviceNode->ChildBusTypeIndex != 0xFFFF) && + (DeviceNode->ChildBusTypeIndex < IopBusTypeGuidList->GuidCount)) + { + /* Return the GUID */ + *ResultLength = sizeof(GUID); + + /* Check if the buffer given was large enough */ + if (BufferLength < *ResultLength) + { + return STATUS_BUFFER_TOO_SMALL; + } + + /* Copy the GUID */ + RtlCopyMemory(PropertyBuffer, + &(IopBusTypeGuidList->Guids[DeviceNode->ChildBusTypeIndex]), + sizeof(GUID)); + return STATUS_SUCCESS; + } + else + { + return STATUS_OBJECT_NAME_NOT_FOUND; + } + break; + + case DevicePropertyLegacyBusType: + Length = sizeof(INTERFACE_TYPE); + Data = &DeviceNode->ChildInterfaceType; + break; + + case DevicePropertyAddress: + /* Query the device caps */ + Status = IopQueryDeviceCapabilities(DeviceNode, &DeviceCaps); + if (NT_SUCCESS(Status) && (DeviceCaps.Address != (ULONG)-1)) + { + /* Return length */ + *ResultLength = sizeof(ULONG); + + /* Check if the buffer given was large enough */ + if (BufferLength < *ResultLength) + { + return STATUS_BUFFER_TOO_SMALL; + } + + /* Return address */ + *(PULONG)PropertyBuffer = DeviceCaps.Address; + return STATUS_SUCCESS; + } + else + { + return STATUS_OBJECT_NAME_NOT_FOUND; + } + break; + +// case DevicePropertyUINumber: +// if (DeviceNode->CapabilityFlags == NULL) +// return STATUS_INVALID_DEVICE_REQUEST; +// Length = sizeof(ULONG); +// Data = &DeviceNode->CapabilityFlags->UINumber; +// break; + + case DevicePropertyClassName: + case DevicePropertyClassGuid: + case DevicePropertyDriverKeyName: + case DevicePropertyManufacturer: + case DevicePropertyFriendlyName: + case DevicePropertyHardwareID: + case DevicePropertyCompatibleIDs: + case DevicePropertyDeviceDescription: + case DevicePropertyLocationInformation: + case DevicePropertyUINumber: + { + LPCWSTR RegistryPropertyName; + UNICODE_STRING EnumRoot = RTL_CONSTANT_STRING(ENUM_ROOT); + UNICODE_STRING ValueName; + KEY_VALUE_PARTIAL_INFORMATION *ValueInformation; + ULONG ValueInformationLength; + HANDLE KeyHandle, EnumRootHandle; + NTSTATUS Status; + + switch (DeviceProperty) + { + case DevicePropertyClassName: + RegistryPropertyName = L"Class"; break; + case DevicePropertyClassGuid: + RegistryPropertyName = L"ClassGuid"; break; + case DevicePropertyDriverKeyName: + RegistryPropertyName = L"Driver"; break; + case DevicePropertyManufacturer: + RegistryPropertyName = L"Mfg"; break; + case DevicePropertyFriendlyName: + RegistryPropertyName = L"FriendlyName"; break; + case DevicePropertyHardwareID: + RegistryPropertyName = L"HardwareID"; break; + case DevicePropertyCompatibleIDs: + RegistryPropertyName = L"CompatibleIDs"; break; + case DevicePropertyDeviceDescription: + RegistryPropertyName = L"DeviceDesc"; break; + case DevicePropertyLocationInformation: + RegistryPropertyName = L"LocationInformation"; break; + case DevicePropertyUINumber: + RegistryPropertyName = L"UINumber"; break; + default: + /* Should not happen */ + ASSERT(FALSE); + return STATUS_UNSUCCESSFUL; + } + + DPRINT("Registry property %S\n", RegistryPropertyName); + + /* Open Enum key */ + Status = IopOpenRegistryKeyEx(&EnumRootHandle, NULL, + &EnumRoot, KEY_READ); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Error opening ENUM_ROOT, Status=0x%08x\n", Status); + return Status; + } + + /* Open instance key */ + Status = IopOpenRegistryKeyEx(&KeyHandle, EnumRootHandle, + &DeviceNode->InstancePath, KEY_READ); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Error opening InstancePath, Status=0x%08x\n", Status); + ZwClose(EnumRootHandle); + return Status; + } + + /* Allocate buffer to read as much data as required by the caller */ + ValueInformationLength = FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, + Data[0]) + BufferLength; + ValueInformation = ExAllocatePool(PagedPool, ValueInformationLength); + if (!ValueInformation) + { + ZwClose(KeyHandle); + return STATUS_INSUFFICIENT_RESOURCES; + } + + /* Read the value */ + RtlInitUnicodeString(&ValueName, RegistryPropertyName); + Status = ZwQueryValueKey(KeyHandle, &ValueName, + KeyValuePartialInformation, ValueInformation, + ValueInformationLength, + &ValueInformationLength); + ZwClose(KeyHandle); + + /* Return data */ + *ResultLength = ValueInformation->DataLength; + + if (!NT_SUCCESS(Status)) + { + ExFreePool(ValueInformation); + if (Status == STATUS_BUFFER_OVERFLOW) + return STATUS_BUFFER_TOO_SMALL; + DPRINT1("Problem: Status=0x%08x, ResultLength = %d\n", Status, *ResultLength); + return Status; + } + + /* FIXME: Verify the value (NULL-terminated, correct format). */ + RtlCopyMemory(PropertyBuffer, ValueInformation->Data, + ValueInformation->DataLength); + ExFreePool(ValueInformation); + + return STATUS_SUCCESS; + } + + case DevicePropertyBootConfiguration: + Length = 0; + if (DeviceNode->BootResources->Count != 0) + { + Length = CM_RESOURCE_LIST_SIZE(DeviceNode->BootResources); + } + Data = &DeviceNode->BootResources; + break; + + /* FIXME: use a translated boot configuration instead */ + case DevicePropertyBootConfigurationTranslated: + Length = 0; + if (DeviceNode->BootResources->Count != 0) + { + Length = CM_RESOURCE_LIST_SIZE(DeviceNode->BootResources); + } + Data = &DeviceNode->BootResources; + break; + + case DevicePropertyEnumeratorName: + /* A buffer overflow can't happen here, since InstancePath + * always contains the enumerator name followed by \\ */ + Ptr = wcschr(DeviceNode->InstancePath.Buffer, L'\\'); + ASSERT(Ptr); + Length = (Ptr - DeviceNode->InstancePath.Buffer + 1) * sizeof(WCHAR); + Data = DeviceNode->InstancePath.Buffer; + break; + + case DevicePropertyPhysicalDeviceObjectName: + /* InstancePath buffer is NULL terminated, so we can do this */ + Length = DeviceNode->InstancePath.MaximumLength; + Data = DeviceNode->InstancePath.Buffer; + break; + + default: + return STATUS_INVALID_PARAMETER_2; + } + + /* Prepare returned values */ + *ResultLength = Length; + if (BufferLength < Length) + return STATUS_BUFFER_TOO_SMALL; + RtlCopyMemory(PropertyBuffer, Data, Length); + + /* NULL terminate the string (if required) */ + if (DeviceProperty == DevicePropertyEnumeratorName) + ((LPWSTR)PropertyBuffer)[Length / sizeof(WCHAR)] = UNICODE_NULL; + + return STATUS_SUCCESS; +} + +/* + * @unimplemented + */ +VOID +NTAPI +IoInvalidateDeviceState(IN PDEVICE_OBJECT PhysicalDeviceObject) +{ + UNIMPLEMENTED; +} + +/** + * @name IoOpenDeviceRegistryKey + * + * Open a registry key unique for a specified driver or device instance. + * + * @param DeviceObject Device to get the registry key for. + * @param DevInstKeyType Type of the key to return. + * @param DesiredAccess Access mask (eg. KEY_READ | KEY_WRITE). + * @param DevInstRegKey Handle to the opened registry key on + * successful return. + * + * @return Status. + * + * @implemented + */ +NTSTATUS +NTAPI +IoOpenDeviceRegistryKey(IN PDEVICE_OBJECT DeviceObject, + IN ULONG DevInstKeyType, + IN ACCESS_MASK DesiredAccess, + OUT PHANDLE DevInstRegKey) +{ + static WCHAR RootKeyName[] = + L"\\Registry\\Machine\\System\\CurrentControlSet\\"; + static WCHAR ProfileKeyName[] = + L"Hardware Profiles\\Current\\System\\CurrentControlSet\\"; + static WCHAR ClassKeyName[] = L"Control\\Class\\"; + static WCHAR EnumKeyName[] = L"Enum\\"; + static WCHAR DeviceParametersKeyName[] = L"Device Parameters"; + ULONG KeyNameLength; + LPWSTR KeyNameBuffer; + UNICODE_STRING KeyName; + ULONG DriverKeyLength; + OBJECT_ATTRIBUTES ObjectAttributes; + PDEVICE_NODE DeviceNode = NULL; + NTSTATUS Status; + + DPRINT("IoOpenDeviceRegistryKey() called\n"); + + if ((DevInstKeyType & (PLUGPLAY_REGKEY_DEVICE | PLUGPLAY_REGKEY_DRIVER)) == 0) + { + DPRINT1("IoOpenDeviceRegistryKey(): got wrong params, exiting... \n"); + return STATUS_INVALID_PARAMETER; + } + + /* + * Calculate the length of the base key name. This is the full + * name for driver key or the name excluding "Device Parameters" + * subkey for device key. + */ + + KeyNameLength = sizeof(RootKeyName); + if (DevInstKeyType & PLUGPLAY_REGKEY_CURRENT_HWPROFILE) + KeyNameLength += sizeof(ProfileKeyName) - sizeof(UNICODE_NULL); + if (DevInstKeyType & PLUGPLAY_REGKEY_DRIVER) + { + KeyNameLength += sizeof(ClassKeyName) - sizeof(UNICODE_NULL); + Status = IoGetDeviceProperty(DeviceObject, DevicePropertyDriverKeyName, + 0, NULL, &DriverKeyLength); + if (Status != STATUS_BUFFER_TOO_SMALL) + return Status; + KeyNameLength += DriverKeyLength; + } + else + { + DeviceNode = IopGetDeviceNode(DeviceObject); + KeyNameLength += sizeof(EnumKeyName) - sizeof(UNICODE_NULL) + + DeviceNode->InstancePath.Length; + } + + /* + * Now allocate the buffer for the key name... + */ + + KeyNameBuffer = ExAllocatePool(PagedPool, KeyNameLength); + if (KeyNameBuffer == NULL) + return STATUS_INSUFFICIENT_RESOURCES; + + KeyName.Length = 0; + KeyName.MaximumLength = (USHORT)KeyNameLength; + KeyName.Buffer = KeyNameBuffer; + + /* + * ...and build the key name. + */ + + KeyName.Length += sizeof(RootKeyName) - sizeof(UNICODE_NULL); + RtlCopyMemory(KeyNameBuffer, RootKeyName, KeyName.Length); + + if (DevInstKeyType & PLUGPLAY_REGKEY_CURRENT_HWPROFILE) + RtlAppendUnicodeToString(&KeyName, ProfileKeyName); + + if (DevInstKeyType & PLUGPLAY_REGKEY_DRIVER) + { + RtlAppendUnicodeToString(&KeyName, ClassKeyName); + Status = IoGetDeviceProperty(DeviceObject, DevicePropertyDriverKeyName, + DriverKeyLength, KeyNameBuffer + + (KeyName.Length / sizeof(WCHAR)), + &DriverKeyLength); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Call to IoGetDeviceProperty() failed with Status 0x%08lx\n", Status); + ExFreePool(KeyNameBuffer); + return Status; + } + KeyName.Length += (USHORT)DriverKeyLength - sizeof(UNICODE_NULL); + } + else + { + RtlAppendUnicodeToString(&KeyName, EnumKeyName); + Status = RtlAppendUnicodeStringToString(&KeyName, &DeviceNode->InstancePath); + if (DeviceNode->InstancePath.Length == 0) + { + ExFreePool(KeyNameBuffer); + return Status; + } + } + + /* + * Open the base key. + */ + Status = IopOpenRegistryKeyEx(DevInstRegKey, NULL, &KeyName, DesiredAccess); + if (!NT_SUCCESS(Status)) + { + DPRINT1("IoOpenDeviceRegistryKey(%wZ): Base key doesn't exist, exiting... (Status 0x%08lx)\n", &KeyName, Status); + ExFreePool(KeyNameBuffer); + return Status; + } + ExFreePool(KeyNameBuffer); + + /* + * For driver key we're done now. + */ + + if (DevInstKeyType & PLUGPLAY_REGKEY_DRIVER) + return Status; + + /* + * Let's go further. For device key we must open "Device Parameters" + * subkey and create it if it doesn't exist yet. + */ + + RtlInitUnicodeString(&KeyName, DeviceParametersKeyName); + InitializeObjectAttributes(&ObjectAttributes, &KeyName, + OBJ_CASE_INSENSITIVE, *DevInstRegKey, NULL); + Status = ZwCreateKey(DevInstRegKey, DesiredAccess, &ObjectAttributes, + 0, NULL, REG_OPTION_NON_VOLATILE, NULL); + ZwClose(ObjectAttributes.RootDirectory); + + return Status; +} + +/* + * @unimplemented + */ +VOID +NTAPI +IoRequestDeviceEject(IN PDEVICE_OBJECT PhysicalDeviceObject) +{ + UNIMPLEMENTED; +} + +/* + * @implemented + */ +VOID +NTAPI +IoInvalidateDeviceRelations( + IN PDEVICE_OBJECT DeviceObject, + IN DEVICE_RELATION_TYPE Type) +{ + PIO_WORKITEM WorkItem; + PINVALIDATE_DEVICE_RELATION_DATA Data; + + Data = ExAllocatePool(PagedPool, sizeof(INVALIDATE_DEVICE_RELATION_DATA)); + if (!Data) + return; + WorkItem = IoAllocateWorkItem(DeviceObject); + if (!WorkItem) + { + ExFreePool(Data); + return; + } + + ObReferenceObject(DeviceObject); + Data->DeviceObject = DeviceObject; + Data->Type = Type; + Data->WorkItem = WorkItem; + + IoQueueWorkItem( + WorkItem, + IopAsynchronousInvalidateDeviceRelations, + DelayedWorkQueue, + Data); +} + +/* + * @implemented + */ +NTSTATUS +NTAPI +IoSynchronousInvalidateDeviceRelations( + IN PDEVICE_OBJECT DeviceObject, + IN DEVICE_RELATION_TYPE Type) +{ + PAGED_CODE(); + + switch (Type) + { + case BusRelations: + /* Enumerate the device */ + return IopEnumerateDevice(DeviceObject); + case PowerRelations: + /* Not handled yet */ + return STATUS_NOT_IMPLEMENTED; + case TargetDeviceRelation: + /* Nothing to do */ + return STATUS_SUCCESS; + default: + /* Ejection relations are not supported */ + return STATUS_NOT_SUPPORTED; + } +} diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpnotify.c b/reactos/ntoskrnl/io/pnpmgr/pnpnotify.c index 79e10df0394..3c125e52ea7 100644 --- a/reactos/ntoskrnl/io/pnpmgr/pnpnotify.c +++ b/reactos/ntoskrnl/io/pnpmgr/pnpnotify.c @@ -1,9 +1,8 @@ /* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/io/pnpnotify.c + * PROJECT: ReactOS Kernel + * COPYRIGHT: GPL - See COPYING in the top level directory + * FILE: ntoskrnl/io/pnpmgr/pnpnotify.c * PURPOSE: Plug & Play notification functions - * * PROGRAMMERS: Filip Navara (xnavara@volny.cz) * Hervй Poussineau (hpoussin@reactos.org) */ @@ -14,21 +13,16 @@ #define NDEBUG #include -#if defined (ALLOC_PRAGMA) -#pragma alloc_text(INIT, IopInitPnpNotificationImplementation) -#endif - - /* TYPES *******************************************************************/ typedef struct _PNP_NOTIFY_ENTRY { - LIST_ENTRY PnpNotifyList; - IO_NOTIFICATION_EVENT_CATEGORY EventCategory; - PVOID Context; - UNICODE_STRING Guid; - PFILE_OBJECT FileObject; - PDRIVER_NOTIFICATION_CALLBACK_ROUTINE PnpNotificationProc; + LIST_ENTRY PnpNotifyList; + IO_NOTIFICATION_EVENT_CATEGORY EventCategory; + PVOID Context; + UNICODE_STRING Guid; + PFILE_OBJECT FileObject; + PDRIVER_NOTIFICATION_CALLBACK_ROUTINE PnpNotificationProc; } PNP_NOTIFY_ENTRY, *PPNP_NOTIFY_ENTRY; KGUARDED_MUTEX PnpNotifyListLock; @@ -36,163 +30,6 @@ LIST_ENTRY PnpNotifyListHead; /* FUNCTIONS *****************************************************************/ -/* - * @unimplemented - */ -ULONG -STDCALL -IoPnPDeliverServicePowerNotification( - ULONG VetoedPowerOperation OPTIONAL, - ULONG PowerNotification, - ULONG Unknown OPTIONAL, - BOOLEAN Synchronous - ) -{ - UNIMPLEMENTED; - return 0; -} - -/* - * @implemented - */ -NTSTATUS -STDCALL -IoRegisterPlugPlayNotification( - IN IO_NOTIFICATION_EVENT_CATEGORY EventCategory, - IN ULONG EventCategoryFlags, - IN PVOID EventCategoryData OPTIONAL, - IN PDRIVER_OBJECT DriverObject, - IN PDRIVER_NOTIFICATION_CALLBACK_ROUTINE CallbackRoutine, - IN PVOID Context, - OUT PVOID *NotificationEntry) -{ - PPNP_NOTIFY_ENTRY Entry; - PWSTR SymbolicLinkList; - NTSTATUS Status; - - PAGED_CODE(); - - DPRINT("IoRegisterPlugPlayNotification(EventCategory 0x%x, EventCategoryFlags 0x%lx, DriverObject %p) called.\n", - EventCategory, - EventCategoryFlags, - DriverObject); - - ObReferenceObject(DriverObject); - - /* Try to allocate entry for notification before sending any notification */ - Entry = ExAllocatePoolWithTag( - NonPagedPool, - sizeof(PNP_NOTIFY_ENTRY), - TAG_PNP_NOTIFY); - if (!Entry) - { - DPRINT("ExAllocatePool() failed\n"); - ObDereferenceObject(DriverObject); - return STATUS_INSUFFICIENT_RESOURCES; - } - - if (EventCategory == EventCategoryDeviceInterfaceChange - && EventCategoryFlags & PNPNOTIFY_DEVICE_INTERFACE_INCLUDE_EXISTING_INTERFACES) - { - DEVICE_INTERFACE_CHANGE_NOTIFICATION NotificationInfos; - UNICODE_STRING SymbolicLinkU; - PWSTR SymbolicLink; - - Status = IoGetDeviceInterfaces( - (LPGUID)EventCategoryData, - NULL, /* PhysicalDeviceObject OPTIONAL */ - 0, /* Flags */ - &SymbolicLinkList); - if (!NT_SUCCESS(Status)) - { - DPRINT("IoGetDeviceInterfaces() failed with status 0x%08lx\n", Status); - ExFreePoolWithTag(Entry, TAG_PNP_NOTIFY); - ObDereferenceObject(DriverObject); - return Status; - } - /* Enumerate SymbolicLinkList */ - NotificationInfos.Version = 1; - NotificationInfos.Size = sizeof(DEVICE_INTERFACE_CHANGE_NOTIFICATION); - RtlCopyMemory(&NotificationInfos.Event, &GUID_DEVICE_INTERFACE_ARRIVAL, sizeof(GUID)); - RtlCopyMemory(&NotificationInfos.InterfaceClassGuid, EventCategoryData, sizeof(GUID)); - NotificationInfos.SymbolicLinkName = &SymbolicLinkU; - for (SymbolicLink = SymbolicLinkList; *SymbolicLink; SymbolicLink += wcslen(SymbolicLink) + 1) - { - RtlInitUnicodeString(&SymbolicLinkU, SymbolicLink); - DPRINT("Calling callback routine for %S\n", SymbolicLink); - (*CallbackRoutine)(&NotificationInfos, Context); - } - ExFreePool(SymbolicLinkList); - } - - Entry->PnpNotificationProc = CallbackRoutine; - Entry->EventCategory = EventCategory; - Entry->Context = Context; - switch (EventCategory) - { - case EventCategoryDeviceInterfaceChange: - { - Status = RtlStringFromGUID(EventCategoryData, &Entry->Guid); - if (!NT_SUCCESS(Status)) - { - ExFreePoolWithTag(Entry, TAG_PNP_NOTIFY); - ObDereferenceObject(DriverObject); - return Status; - } - break; - } - case EventCategoryHardwareProfileChange: - { - /* nothing to do */ - break; - } - case EventCategoryTargetDeviceChange: - { - Entry->FileObject = (PFILE_OBJECT)EventCategoryData; - break; - } - default: - { - DPRINT1("IoRegisterPlugPlayNotification(): unknown EventCategory 0x%x UNIMPLEMENTED\n", EventCategory); - break; - } - } - - KeAcquireGuardedMutex(&PnpNotifyListLock); - InsertHeadList(&PnpNotifyListHead, - &Entry->PnpNotifyList); - KeReleaseGuardedMutex(&PnpNotifyListLock); - - DPRINT("IoRegisterPlugPlayNotification() returns NotificationEntry %p\n", - Entry); - *NotificationEntry = Entry; - return STATUS_SUCCESS; -} - -/* - * @implemented - */ -NTSTATUS -STDCALL -IoUnregisterPlugPlayNotification( - IN PVOID NotificationEntry) -{ - PPNP_NOTIFY_ENTRY Entry; - - PAGED_CODE(); - - Entry = (PPNP_NOTIFY_ENTRY)NotificationEntry; - DPRINT("IoUnregisterPlugPlayNotification(NotificationEntry %p) called\n", - Entry); - - KeAcquireGuardedMutex(&PnpNotifyListLock); - RtlFreeUnicodeString(&Entry->Guid); - RemoveEntryList(&Entry->PnpNotifyList); - KeReleaseGuardedMutex(&PnpNotifyListLock); - - return STATUS_SUCCESS; -} - VOID IopNotifyPlugPlayNotification( IN PDEVICE_OBJECT DeviceObject, @@ -323,4 +160,166 @@ IopNotifyPlugPlayNotification( ExFreePoolWithTag(NotificationStructure, TAG_PNP_NOTIFY); } -/* EOF */ +/* PUBLIC FUNCTIONS **********************************************************/ + +/* + * @unimplemented + */ +ULONG +NTAPI +IoPnPDeliverServicePowerNotification(ULONG VetoedPowerOperation OPTIONAL, + ULONG PowerNotification, + ULONG Unknown OPTIONAL, + BOOLEAN Synchronous) +{ + UNIMPLEMENTED; + return 0; +} + +/* + * @implemented + */ +NTSTATUS +NTAPI +IoRegisterPlugPlayNotification(IN IO_NOTIFICATION_EVENT_CATEGORY EventCategory, + IN ULONG EventCategoryFlags, + IN PVOID EventCategoryData OPTIONAL, + IN PDRIVER_OBJECT DriverObject, + IN PDRIVER_NOTIFICATION_CALLBACK_ROUTINE CallbackRoutine, + IN PVOID Context, + OUT PVOID *NotificationEntry) +{ + PPNP_NOTIFY_ENTRY Entry; + PWSTR SymbolicLinkList; + NTSTATUS Status; + PAGED_CODE(); + + DPRINT("__FUNCTION__(EventCategory 0x%x, EventCategoryFlags 0x%lx, DriverObject %p) called.\n", + EventCategory, + EventCategoryFlags, + DriverObject); + + ObReferenceObject(DriverObject); + + /* Try to allocate entry for notification before sending any notification */ + Entry = ExAllocatePoolWithTag(NonPagedPool, + sizeof(PNP_NOTIFY_ENTRY), + TAG_PNP_NOTIFY); + + if (!Entry) + { + DPRINT("ExAllocatePool() failed\n"); + ObDereferenceObject(DriverObject); + return STATUS_INSUFFICIENT_RESOURCES; + } + + if (EventCategory == EventCategoryDeviceInterfaceChange && + EventCategoryFlags & PNPNOTIFY_DEVICE_INTERFACE_INCLUDE_EXISTING_INTERFACES) + { + DEVICE_INTERFACE_CHANGE_NOTIFICATION NotificationInfos; + UNICODE_STRING SymbolicLinkU; + PWSTR SymbolicLink; + + Status = IoGetDeviceInterfaces((LPGUID)EventCategoryData, + NULL, /* PhysicalDeviceObject OPTIONAL */ + 0, /* Flags */ + &SymbolicLinkList); + if (!NT_SUCCESS(Status)) + { + DPRINT("IoGetDeviceInterfaces() failed with status 0x%08lx\n", + Status); + ExFreePoolWithTag(Entry, TAG_PNP_NOTIFY); + ObDereferenceObject(DriverObject); + return Status; + } + + /* Enumerate SymbolicLinkList */ + NotificationInfos.Version = 1; + NotificationInfos.Size = sizeof(DEVICE_INTERFACE_CHANGE_NOTIFICATION); + RtlCopyMemory(&NotificationInfos.Event, + &GUID_DEVICE_INTERFACE_ARRIVAL, + sizeof(GUID)); + RtlCopyMemory(&NotificationInfos.InterfaceClassGuid, + EventCategoryData, + sizeof(GUID)); + NotificationInfos.SymbolicLinkName = &SymbolicLinkU; + + for (SymbolicLink = SymbolicLinkList; + *SymbolicLink; + SymbolicLink += wcslen(SymbolicLink) + 1) + { + RtlInitUnicodeString(&SymbolicLinkU, SymbolicLink); + DPRINT("Calling callback routine for %S\n", SymbolicLink); + (*CallbackRoutine)(&NotificationInfos, Context); + } + + ExFreePool(SymbolicLinkList); + } + + Entry->PnpNotificationProc = CallbackRoutine; + Entry->EventCategory = EventCategory; + Entry->Context = Context; + switch (EventCategory) + { + case EventCategoryDeviceInterfaceChange: + { + Status = RtlStringFromGUID(EventCategoryData, &Entry->Guid); + if (!NT_SUCCESS(Status)) + { + ExFreePoolWithTag(Entry, TAG_PNP_NOTIFY); + ObDereferenceObject(DriverObject); + return Status; + } + break; + } + case EventCategoryHardwareProfileChange: + { + /* nothing to do */ + break; + } + case EventCategoryTargetDeviceChange: + { + Entry->FileObject = (PFILE_OBJECT)EventCategoryData; + break; + } + default: + { + DPRINT1("__FUNCTION__(): unknown EventCategory 0x%x UNIMPLEMENTED\n", + EventCategory); + break; + } + } + + KeAcquireGuardedMutex(&PnpNotifyListLock); + InsertHeadList(&PnpNotifyListHead, + &Entry->PnpNotifyList); + KeReleaseGuardedMutex(&PnpNotifyListLock); + + DPRINT("IoRegisterPlugPlayNotification() returns NotificationEntry %p\n", + Entry); + + *NotificationEntry = Entry; + + return STATUS_SUCCESS; +} + +/* + * @implemented + */ +NTSTATUS +NTAPI +IoUnregisterPlugPlayNotification(IN PVOID NotificationEntry) +{ + PPNP_NOTIFY_ENTRY Entry; + PAGED_CODE(); + + Entry = (PPNP_NOTIFY_ENTRY)NotificationEntry; + DPRINT("__FUNCTION__(NotificationEntry %p) called\n", Entry); + + KeAcquireGuardedMutex(&PnpNotifyListLock); + RtlFreeUnicodeString(&Entry->Guid); + RemoveEntryList(&Entry->PnpNotifyList); + KeReleaseGuardedMutex(&PnpNotifyListLock); + + return STATUS_SUCCESS; +} diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpreport.c b/reactos/ntoskrnl/io/pnpmgr/pnpreport.c index 0e372b08b95..e11c4b0263e 100644 --- a/reactos/ntoskrnl/io/pnpmgr/pnpreport.c +++ b/reactos/ntoskrnl/io/pnpmgr/pnpreport.c @@ -1,9 +1,8 @@ /* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/io/pnpreport.c - * PURPOSE: Device Changes Reporting functions - * + * PROJECT: ReactOS Kernel + * COPYRIGHT: GPL - See COPYING in the top level directory + * FILE: ntoskrnl/io/pnpmgr/pnpreport.c + * PURPOSE: Device Changes Reporting Functions * PROGRAMMERS: Filip Navara (xnavara@volny.cz) */ @@ -13,116 +12,127 @@ #define NDEBUG #include -/* FUNCTIONS *****************************************************************/ +/* PUBLIC FUNCTIONS **********************************************************/ /* * @implemented */ NTSTATUS -STDCALL -IoReportDetectedDevice( - IN PDRIVER_OBJECT DriverObject, - IN INTERFACE_TYPE LegacyBusType, - IN ULONG BusNumber, - IN ULONG SlotNumber, - IN PCM_RESOURCE_LIST ResourceList, - IN PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirements OPTIONAL, - IN BOOLEAN ResourceAssigned, - IN OUT PDEVICE_OBJECT *DeviceObject) +NTAPI +IoReportDetectedDevice(IN PDRIVER_OBJECT DriverObject, + IN INTERFACE_TYPE LegacyBusType, + IN ULONG BusNumber, + IN ULONG SlotNumber, + IN PCM_RESOURCE_LIST ResourceList, + IN PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirements OPTIONAL, + IN BOOLEAN ResourceAssigned, + IN OUT PDEVICE_OBJECT *DeviceObject OPTIONAL) { - PDEVICE_NODE DeviceNode; - PDEVICE_OBJECT Pdo; - NTSTATUS Status = STATUS_SUCCESS; + PDEVICE_NODE DeviceNode; + PDEVICE_OBJECT Pdo; + NTSTATUS Status = STATUS_SUCCESS; - DPRINT("IoReportDetectedDevice (DeviceObject %p, *DeviceObject %p)\n", - DeviceObject, DeviceObject ? *DeviceObject : NULL); + DPRINT("__FUNCTION__ (DeviceObject %p, *DeviceObject %p)\n", + DeviceObject, DeviceObject ? *DeviceObject : NULL); - /* if *DeviceObject is not NULL, we must use it as a PDO, - * and don't create a new one. - */ - if (DeviceObject && *DeviceObject) - Pdo = *DeviceObject; - else - { - UNICODE_STRING ServiceName; - ServiceName.Buffer = DriverObject->DriverName.Buffer + sizeof(DRIVER_ROOT_NAME) / sizeof(WCHAR) - 1; - ServiceName.Length = ServiceName.MaximumLength = DriverObject->DriverName.Length - sizeof(DRIVER_ROOT_NAME) + sizeof(WCHAR); - - /* create a new PDO and return it in *DeviceObject */ - Status = IopCreateDeviceNode(IopRootDeviceNode, NULL, &ServiceName, &DeviceNode); - if (!NT_SUCCESS(Status)) + /* if *DeviceObject is not NULL, we must use it as a PDO, and don't create a new one */ + if (DeviceObject && *DeviceObject) { - DPRINT("IopCreateDeviceNode() failed (Status 0x%08lx)\n", Status); - return Status; + Pdo = *DeviceObject; } - Pdo = DeviceNode->PhysicalDeviceObject; - if (DeviceObject) - *DeviceObject = Pdo; + else + { + UNICODE_STRING ServiceName; + ServiceName.Buffer = DriverObject->DriverName.Buffer + + sizeof(DRIVER_ROOT_NAME) / sizeof(WCHAR) - 1; + ServiceName.Length = DriverObject->DriverName.Length - + sizeof(DRIVER_ROOT_NAME) + sizeof(WCHAR); + ServiceName.MaximumLength = ServiceName.Length; + + /* create a new PDO and return it in *DeviceObject */ + Status = IopCreateDeviceNode(IopRootDeviceNode, + NULL, + &ServiceName, + &DeviceNode); + + if (!NT_SUCCESS(Status)) + { + DPRINT("IopCreateDeviceNode() failed (Status 0x%08lx)\n", Status); + return Status; + } + + Pdo = DeviceNode->PhysicalDeviceObject; + if (DeviceObject) *DeviceObject = Pdo; } - /* we don't need to call AddDevice and send IRP_MN_START_DEVICE */ - - return Status; + /* we don't need to call AddDevice and send IRP_MN_START_DEVICE */ + return Status; } /* * @unimplemented */ NTSTATUS -STDCALL -IoReportResourceForDetection( - IN PDRIVER_OBJECT DriverObject, - IN PCM_RESOURCE_LIST DriverList OPTIONAL, - IN ULONG DriverListSize OPTIONAL, - IN PDEVICE_OBJECT DeviceObject OPTIONAL, - IN PCM_RESOURCE_LIST DeviceList OPTIONAL, - IN ULONG DeviceListSize OPTIONAL, - OUT PBOOLEAN ConflictDetected) +NTAPI +IoReportResourceForDetection(IN PDRIVER_OBJECT DriverObject, + IN PCM_RESOURCE_LIST DriverList OPTIONAL, + IN ULONG DriverListSize OPTIONAL, + IN PDEVICE_OBJECT DeviceObject OPTIONAL, + IN PCM_RESOURCE_LIST DeviceList OPTIONAL, + IN ULONG DeviceListSize OPTIONAL, + OUT PBOOLEAN ConflictDetected) { - static int warned = 0; - if (!warned) - { - DPRINT1("IoReportResourceForDetection partly implemented\n"); - warned = 1; - } + static int warned = 0; + if (!warned) + { + DPRINT1("IoReportResourceForDetection partly implemented\n"); + warned = 1; + } - *ConflictDetected = FALSE; + *ConflictDetected = FALSE; - if (PopSystemPowerDeviceNode != NULL && DriverListSize > 0) - { - /* We hope legacy devices will be enumerated by ACPI */ - *ConflictDetected = TRUE; - return STATUS_CONFLICTING_ADDRESSES; - } - return STATUS_SUCCESS; + if (PopSystemPowerDeviceNode && DriverListSize > 0) + { + /* We hope legacy devices will be enumerated by ACPI */ + *ConflictDetected = TRUE; + return STATUS_CONFLICTING_ADDRESSES; + } + + return STATUS_SUCCESS; +} + +VOID +NTAPI +IopSetEvent(IN PVOID Context) +{ + PKEVENT Event = Context; + + /* Set the event */ + KeSetEvent(Event, IO_NO_INCREMENT, FALSE); } /* * @unimplemented */ NTSTATUS -STDCALL -IoReportTargetDeviceChange( - IN PDEVICE_OBJECT PhysicalDeviceObject, - IN PVOID NotificationStructure) +NTAPI +IoReportTargetDeviceChange(IN PDEVICE_OBJECT PhysicalDeviceObject, + IN PVOID NotificationStructure) { - DPRINT1("IoReportTargetDeviceChange called (UNIMPLEMENTED)\n"); - return STATUS_NOT_IMPLEMENTED; + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; } /* * @unimplemented */ NTSTATUS -STDCALL -IoReportTargetDeviceChangeAsynchronous( - IN PDEVICE_OBJECT PhysicalDeviceObject, - IN PVOID NotificationStructure, - IN PDEVICE_CHANGE_COMPLETE_CALLBACK Callback OPTIONAL, - IN PVOID Context OPTIONAL) +NTAPI +IoReportTargetDeviceChangeAsynchronous(IN PDEVICE_OBJECT PhysicalDeviceObject, + IN PVOID NotificationStructure, + IN PDEVICE_CHANGE_COMPLETE_CALLBACK Callback OPTIONAL, + IN PVOID Context OPTIONAL) { - DPRINT1("IoReportTargetDeviceChangeAsynchronous called (UNIMPLEMENTED)\n"); - return STATUS_NOT_IMPLEMENTED; + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; } - -/* EOF */ diff --git a/reactos/ntoskrnl/io/pnpmgr/pnproot.c b/reactos/ntoskrnl/io/pnpmgr/pnproot.c index af9d9cd67f9..01d003667dc 100644 --- a/reactos/ntoskrnl/io/pnpmgr/pnproot.c +++ b/reactos/ntoskrnl/io/pnpmgr/pnproot.c @@ -1,9 +1,8 @@ /* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/io/pnproot.c + * PROJECT: ReactOS Kernel + * COPYRIGHT: GPL - See COPYING in the top level directory + * FILE: ntoskrnl/io/pnpmgr/pnproot.c * PURPOSE: PnP manager root device - * * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net) * Copyright 2007 Hervй Poussineau (hpoussin@reactos.org) */ @@ -12,7 +11,7 @@ #include #define NDEBUG -#include +#include /* GLOBALS *******************************************************************/ @@ -100,20 +99,31 @@ LocateChildDevice( { PPNPROOT_DEVICE Device; UNICODE_STRING DeviceIdU, InstanceIdU; + PLIST_ENTRY NextEntry; + /* Initialize the strings to compare */ RtlInitUnicodeString(&DeviceIdU, DeviceId); RtlInitUnicodeString(&InstanceIdU, InstanceId); - LIST_FOR_EACH(Device, &DeviceExtension->DeviceListHead, PNPROOT_DEVICE, ListEntry) + /* Start looping */ + for (NextEntry = DeviceExtension->DeviceListHead.Flink; + NextEntry != &DeviceExtension->DeviceListHead; + NextEntry = NextEntry->Flink) { - if (RtlEqualUnicodeString(&DeviceIdU, &Device->DeviceID, TRUE) - && RtlEqualUnicodeString(&InstanceIdU, &Device->InstanceID, TRUE)) + /* Get the entry */ + Device = CONTAINING_RECORD(NextEntry, PNPROOT_DEVICE, ListEntry); + + /* See if the strings match */ + if (RtlEqualUnicodeString(&DeviceIdU, &Device->DeviceID, TRUE) && + RtlEqualUnicodeString(&InstanceIdU, &Device->InstanceID, TRUE)) { + /* They do, so set the pointer and return success */ *ChildDevice = Device; return STATUS_SUCCESS; } } + /* No device found */ return STATUS_NO_SUCH_DEVICE; } @@ -517,6 +527,7 @@ PnpRootQueryDeviceRelations( PPNPROOT_DEVICE Device = NULL; ULONG Size; NTSTATUS Status; + PLIST_ENTRY NextEntry; DPRINT("PnpRootQueryDeviceRelations(FDO %p, Irp %p)\n", DeviceObject, Irp); @@ -552,8 +563,15 @@ PnpRootQueryDeviceRelations( } KeAcquireGuardedMutex(&DeviceExtension->DeviceListLock); - LIST_FOR_EACH(Device, &DeviceExtension->DeviceListHead, PNPROOT_DEVICE, ListEntry) + + /* Start looping */ + for (NextEntry = DeviceExtension->DeviceListHead.Flink; + NextEntry != &DeviceExtension->DeviceListHead; + NextEntry = NextEntry->Flink) { + /* Get the entry */ + Device = CONTAINING_RECORD(NextEntry, PNPROOT_DEVICE, ListEntry); + if (!Device->Pdo) { /* Create a physical device object for the @@ -1063,7 +1081,7 @@ PnpRootPnpControl( } NTSTATUS -STDCALL +NTAPI PnpRootAddDevice( IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT PhysicalDeviceObject) @@ -1077,7 +1095,7 @@ PnpRootAddDevice( { DPRINT("PhysicalDeviceObject 0x%p\n", PhysicalDeviceObject); Status = STATUS_INSUFFICIENT_RESOURCES; - KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0); + KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0); } Status = IoCreateDevice( @@ -1091,7 +1109,7 @@ PnpRootAddDevice( if (!NT_SUCCESS(Status)) { DPRINT("IoCreateDevice() failed with status 0x%08lx\n", Status); - KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0); + KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0); } DPRINT("Created FDO %p\n", PnpRootDeviceObject); @@ -1111,7 +1129,7 @@ PnpRootAddDevice( if (!NT_SUCCESS(Status)) { DPRINT("IoAttachDeviceToDeviceStackSafe() failed with status 0x%08lx\n", Status); - KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0); + KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0); } PnpRootDeviceObject->Flags &= ~DO_DEVICE_INITIALIZING; @@ -1135,5 +1153,3 @@ PnpRootDriverEntry( return STATUS_SUCCESS; } - -/* EOF */ diff --git a/reactos/ntoskrnl/kd/i386/kdmemsup.c b/reactos/ntoskrnl/kd/i386/kdmemsup.c index c3054ac2269..5a3d4b818b8 100644 --- a/reactos/ntoskrnl/kd/i386/kdmemsup.c +++ b/reactos/ntoskrnl/kd/i386/kdmemsup.c @@ -9,7 +9,7 @@ #include #define NDEBUG -#include +#include #define HIGH_PHYS_MASK 0x80000000 #define PAGE_TABLE_MASK 0x3ff diff --git a/reactos/ntoskrnl/kd/kdinit.c b/reactos/ntoskrnl/kd/kdinit.c index 6746593bb29..979fe789514 100644 --- a/reactos/ntoskrnl/kd/kdinit.c +++ b/reactos/ntoskrnl/kd/kdinit.c @@ -9,7 +9,7 @@ #include #define NDEBUG -#include +#include #if defined (ALLOC_PRAGMA) #pragma alloc_text(INIT, KdInitSystem) diff --git a/reactos/ntoskrnl/kd/kdio.c b/reactos/ntoskrnl/kd/kdio.c index 45a68db079f..a0d0286dee0 100644 --- a/reactos/ntoskrnl/kd/kdio.c +++ b/reactos/ntoskrnl/kd/kdio.c @@ -10,7 +10,7 @@ /* INCLUDES ******************************************************************/ #include -#include +#include /* GLOBALS *******************************************************************/ diff --git a/reactos/ntoskrnl/kd/kdmain.c b/reactos/ntoskrnl/kd/kdmain.c index eacf3ef8e7d..3b02aa253db 100644 --- a/reactos/ntoskrnl/kd/kdmain.c +++ b/reactos/ntoskrnl/kd/kdmain.c @@ -9,7 +9,7 @@ #include #define NDEBUG -#include +#include /* VARIABLES ***************************************************************/ @@ -59,7 +59,7 @@ KdpServiceDispatcher(ULONG Service, break; case ManualBugCheck: - KEBUGCHECK(MANUALLY_INITIATED_CRASH); + KeBugCheck(MANUALLY_INITIATED_CRASH); break; case DumpNonPagedPoolStats: diff --git a/reactos/ntoskrnl/kd/wrappers/bochs.c b/reactos/ntoskrnl/kd/wrappers/bochs.c index df2702b9836..bc2266d9143 100644 --- a/reactos/ntoskrnl/kd/wrappers/bochs.c +++ b/reactos/ntoskrnl/kd/wrappers/bochs.c @@ -9,7 +9,7 @@ #include #define NDEBUG -#include +#include /* bochs debug output */ #define BOCHS_LOGGER_PORT ((PVOID)0xe9) diff --git a/reactos/ntoskrnl/kd/wrappers/gdbstub.c b/reactos/ntoskrnl/kd/wrappers/gdbstub.c index aedf32da54b..cc77b28f435 100644 --- a/reactos/ntoskrnl/kd/wrappers/gdbstub.c +++ b/reactos/ntoskrnl/kd/wrappers/gdbstub.c @@ -85,7 +85,7 @@ #include #define NDEBUG -#include +#include /************************************************************************/ /* BUFMAX defines the maximum number of characters in inbound/outbound buffers*/ diff --git a/reactos/ntoskrnl/kd/wrappers/gdbstub_powerpc.c b/reactos/ntoskrnl/kd/wrappers/gdbstub_powerpc.c index 043333b249f..acf6fee7e8c 100644 --- a/reactos/ntoskrnl/kd/wrappers/gdbstub_powerpc.c +++ b/reactos/ntoskrnl/kd/wrappers/gdbstub_powerpc.c @@ -85,7 +85,7 @@ #include #define NDEBUG -#include +#include /************************************************************************/ /* BUFMAX defines the maximum number of characters in inbound/outbound buffers*/ diff --git a/reactos/ntoskrnl/kd/wrappers/kdbg.c b/reactos/ntoskrnl/kd/wrappers/kdbg.c index 54f82d73aab..342120752a1 100644 --- a/reactos/ntoskrnl/kd/wrappers/kdbg.c +++ b/reactos/ntoskrnl/kd/wrappers/kdbg.c @@ -9,7 +9,7 @@ #include #define NDEBUG -#include +#include VOID NTAPI KdbInitialize(PKD_DISPATCH_TABLE DispatchTable, ULONG BootPhase); diff --git a/reactos/ntoskrnl/kdbg/amd64/kdb.c b/reactos/ntoskrnl/kdbg/amd64/kdb.c index 0fa9f7d0597..13602a839ef 100644 --- a/reactos/ntoskrnl/kdbg/amd64/kdb.c +++ b/reactos/ntoskrnl/kdbg/amd64/kdb.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include /* GLOBALS *******************************************************************/ diff --git a/reactos/ntoskrnl/kdbg/kdb.c b/reactos/ntoskrnl/kdbg/kdb.c index 33d803440b1..19952b8601a 100644 --- a/reactos/ntoskrnl/kdbg/kdb.c +++ b/reactos/ntoskrnl/kdbg/kdb.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include /* TYPES *********************************************************************/ @@ -1333,7 +1333,7 @@ KdbEnterDebuggerException( BreakPoint->Data.SavedInstruction, NULL))) { KdbpPrint("Couldn't restore original instruction after INT3! Cannot continue execution.\n"); - KEBUGCHECK(0); + KeBugCheck(0); // FIXME: Proper bugcode! } } @@ -1351,7 +1351,7 @@ KdbEnterDebuggerException( else if (BreakPoint->Type == KdbBreakPointTemporary && BreakPoint->Process == KdbCurrentProcess) { - ASSERT((TrapFrame->EFlags & X86_EFLAGS_TF) == 0); + ASSERT((TrapFrame->EFlags & EFLAGS_TF) == 0); /* * Delete the temporary breakpoint which was used to step over or into the instruction. @@ -1363,7 +1363,7 @@ KdbEnterDebuggerException( if ((KdbSingleStepOver && !KdbpStepOverInstruction(TrapFrame->Eip)) || (!KdbSingleStepOver && !KdbpStepIntoInstruction(TrapFrame->Eip))) { - Context->EFlags |= X86_EFLAGS_TF; + Context->EFlags |= EFLAGS_TF; } goto continue_execution; /* return */ } @@ -1379,7 +1379,7 @@ KdbEnterDebuggerException( BreakPoint->Type == KdbBreakPointTemporary) { ASSERT(ExceptionCode == STATUS_BREAKPOINT); - Context->EFlags |= X86_EFLAGS_TF; + Context->EFlags |= EFLAGS_TF; KdbBreakPointToReenable = BreakPoint; } @@ -1452,30 +1452,30 @@ KdbEnterDebuggerException( /* Unset TF if we are no longer single stepping. */ if (KdbNumSingleSteps == 0) - Context->EFlags &= ~X86_EFLAGS_TF; + Context->EFlags &= ~EFLAGS_TF; goto continue_execution; /* return */ } /* Check if we expect a single step */ if ((TrapFrame->Dr6 & 0xf) == 0 && KdbNumSingleSteps > 0) { - /*ASSERT((Context->Eflags & X86_EFLAGS_TF) != 0);*/ + /*ASSERT((Context->Eflags & EFLAGS_TF) != 0);*/ if (--KdbNumSingleSteps > 0) { if ((KdbSingleStepOver && KdbpStepOverInstruction(TrapFrame->Eip)) || (!KdbSingleStepOver && KdbpStepIntoInstruction(TrapFrame->Eip))) { - Context->EFlags &= ~X86_EFLAGS_TF; + Context->EFlags &= ~EFLAGS_TF; } else { - Context->EFlags |= X86_EFLAGS_TF; + Context->EFlags |= EFLAGS_TF; } goto continue_execution; /* return */ } else { - Context->EFlags &= ~X86_EFLAGS_TF; + Context->EFlags &= ~EFLAGS_TF; KdbEnteredOnSingleStep = TRUE; } } @@ -1576,12 +1576,12 @@ KdbEnterDebuggerException( if ((KdbSingleStepOver && KdbpStepOverInstruction(KdbCurrentTrapFrame->Tf.Eip)) || (!KdbSingleStepOver && KdbpStepIntoInstruction(KdbCurrentTrapFrame->Tf.Eip))) { - ASSERT((KdbCurrentTrapFrame->Tf.EFlags & X86_EFLAGS_TF) == 0); - /*KdbCurrentTrapFrame->Tf.EFlags &= ~X86_EFLAGS_TF;*/ + ASSERT((KdbCurrentTrapFrame->Tf.EFlags & EFLAGS_TF) == 0); + /*KdbCurrentTrapFrame->Tf.EFlags &= ~EFLAGS_TF;*/ } else { - Context->EFlags |= X86_EFLAGS_TF; + Context->EFlags |= EFLAGS_TF; } } @@ -1610,7 +1610,7 @@ continue_execution: /* Set the RF flag so we don't trigger the same breakpoint again. */ if (Resume) { - TrapFrame->EFlags |= X86_EFLAGS_RF; + TrapFrame->EFlags |= EFLAGS_RF; } /* Clear dr6 status flags. */ diff --git a/reactos/ntoskrnl/kdbg/kdb_cli.c b/reactos/ntoskrnl/kdbg/kdb_cli.c index 6c157563583..9344839cd0f 100644 --- a/reactos/ntoskrnl/kdbg/kdb_cli.c +++ b/reactos/ntoskrnl/kdbg/kdb_cli.c @@ -31,7 +31,7 @@ #include #define NDEBUG -#include +#include /* DEFINES *******************************************************************/ @@ -1689,7 +1689,7 @@ KdbpCmdTss(ULONG Argc, PCHAR Argv[]) STATIC BOOLEAN KdbpCmdBugCheck(ULONG Argc, PCHAR Argv[]) { - KEBUGCHECK(0xDEADDEAD); + KeBugCheck(0xDEADDEAD); return TRUE; } diff --git a/reactos/ntoskrnl/kdbg/kdb_expr.c b/reactos/ntoskrnl/kdbg/kdb_expr.c index 198a5c0b622..8e08d88b614 100644 --- a/reactos/ntoskrnl/kdbg/kdb_expr.c +++ b/reactos/ntoskrnl/kdbg/kdb_expr.c @@ -35,7 +35,7 @@ #include #define NDEBUG -#include +#include /* TYPES *********************************************************************/ typedef enum _RPN_OP_TYPE diff --git a/reactos/ntoskrnl/kdbg/kdb_symbols.c b/reactos/ntoskrnl/kdbg/kdb_symbols.c index 7d582651c99..d141fc984e8 100644 --- a/reactos/ntoskrnl/kdbg/kdb_symbols.c +++ b/reactos/ntoskrnl/kdbg/kdb_symbols.c @@ -12,7 +12,7 @@ #include #define NDEBUG -#include +#include /* GLOBALS ******************************************************************/ @@ -510,7 +510,7 @@ KdbSymLoadUserModuleSymbols(IN PLDR_DATA_TABLE_ENTRY LdrModule) KernelName.MaximumLength = sizeof(Prefix) + LdrModule->FullDllName.Length; KernelName.Length = KernelName.MaximumLength - sizeof(WCHAR); - KernelName.Buffer = ExAllocatePoolWithTag(PagedPool, KernelName.MaximumLength, TAG_KDBS); + KernelName.Buffer = ExAllocatePoolWithTag(NonPagedPool, KernelName.MaximumLength, TAG_KDBS); if (NULL == KernelName.Buffer) { return; diff --git a/reactos/ntoskrnl/ke/amd64/spinlock.c b/reactos/ntoskrnl/ke/amd64/spinlock.c index c3ac026d878..73e1bceecbc 100644 --- a/reactos/ntoskrnl/ke/amd64/spinlock.c +++ b/reactos/ntoskrnl/ke/amd64/spinlock.c @@ -10,7 +10,7 @@ #include #define NDEBUG -#include +#include #undef KeAcquireSpinLock #undef KeReleaseSpinLock diff --git a/reactos/ntoskrnl/ke/apc.c b/reactos/ntoskrnl/ke/apc.c index 688585526e8..4839df2e452 100644 --- a/reactos/ntoskrnl/ke/apc.c +++ b/reactos/ntoskrnl/ke/apc.c @@ -10,7 +10,7 @@ #include #define NDEBUG -#include +#include /* PRIVATE FUNCTIONS *********************************************************/ @@ -478,7 +478,7 @@ Quickie: if (Process != Thread->ApcState.Process) { /* Erm, we got attached or something! BAD! */ - KEBUGCHECKEX(INVALID_PROCESS_ATTACH_ATTEMPT, + KeBugCheckEx(INVALID_PROCESS_ATTACH_ATTEMPT, (ULONG_PTR)Process, (ULONG_PTR)Thread->ApcState.Process, Thread->ApcStateIndex, diff --git a/reactos/ntoskrnl/ke/arm/cpu.c b/reactos/ntoskrnl/ke/arm/cpu.c index 28868f3103a..a9154ceaad1 100644 --- a/reactos/ntoskrnl/ke/arm/cpu.c +++ b/reactos/ntoskrnl/ke/arm/cpu.c @@ -261,6 +261,32 @@ KeSaveStateForHibernate(IN PKPROCESSOR_STATE State) KiSaveProcessorControlState(State); } +/* + * @implemented + */ +NTSTATUS +NTAPI +KeSaveFloatingPointState(OUT PKFLOATING_SAVE Save) +{ + // + // Nothing to do on ARM + // + return STATUS_SUCCESS; +} + +/* + * @implemented + */ +NTSTATUS +NTAPI +KeRestoreFloatingPointState(IN PKFLOATING_SAVE Save) +{ + // + // Nothing to do on ARM + // + return STATUS_SUCCESS; +} + /* SYSTEM CALLS NOT VALID ON THIS CPU *****************************************/ /* diff --git a/reactos/ntoskrnl/ke/bug.c b/reactos/ntoskrnl/ke/bug.c index dde2c95a38b..c1d6e2d90cc 100644 --- a/reactos/ntoskrnl/ke/bug.c +++ b/reactos/ntoskrnl/ke/bug.c @@ -10,7 +10,7 @@ #include #define NDEBUG -#include +#include #if defined (ALLOC_PRAGMA) #pragma alloc_text(INIT, KiInitializeBugCheck) diff --git a/reactos/ntoskrnl/ke/clock.c b/reactos/ntoskrnl/ke/clock.c index 219289caa36..ce50d4c8293 100644 --- a/reactos/ntoskrnl/ke/clock.c +++ b/reactos/ntoskrnl/ke/clock.c @@ -76,7 +76,7 @@ KeSetSystemTime(IN PLARGE_INTEGER NewTime, KeLowerIrql(OldIrql2); /* Check if we need to adjust interrupt time */ - if (FixInterruptTime) KEBUGCHECK(0); + if (FixInterruptTime) ASSERT(FALSE); /* Setup a temporary list of absolute timers */ InitializeListHead(&TempList); diff --git a/reactos/ntoskrnl/ke/config.c b/reactos/ntoskrnl/ke/config.c index 01807226548..aa92e96ea67 100644 --- a/reactos/ntoskrnl/ke/config.c +++ b/reactos/ntoskrnl/ke/config.c @@ -10,7 +10,7 @@ #include #define NDEBUG -#include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/ntoskrnl/ke/devqueue.c b/reactos/ntoskrnl/ke/devqueue.c index 5377105efb8..c7b23c3db2c 100644 --- a/reactos/ntoskrnl/ke/devqueue.c +++ b/reactos/ntoskrnl/ke/devqueue.c @@ -10,7 +10,7 @@ #include #define NDEBUG -#include +#include /* FUNCTIONS *****************************************************************/ @@ -197,7 +197,7 @@ NTAPI KeRemoveByKeyDeviceQueue(IN PKDEVICE_QUEUE DeviceQueue, IN ULONG SortKey) { - PLIST_ENTRY ListEntry; + PLIST_ENTRY NextEntry; PKDEVICE_QUEUE_ENTRY ReturnEntry; KLOCK_QUEUE_HANDLE DeviceLock; ASSERT_DEVICE_QUEUE(DeviceQueue); @@ -218,8 +218,8 @@ KeRemoveByKeyDeviceQueue(IN PKDEVICE_QUEUE DeviceQueue, else { /* If SortKey is greater than the last key, then return the first entry right away */ - ListEntry = &DeviceQueue->DeviceListHead; - ReturnEntry = CONTAINING_RECORD(ListEntry->Blink, + NextEntry = &DeviceQueue->DeviceListHead; + ReturnEntry = CONTAINING_RECORD(NextEntry->Blink, KDEVICE_QUEUE_ENTRY, DeviceListEntry); @@ -227,24 +227,27 @@ KeRemoveByKeyDeviceQueue(IN PKDEVICE_QUEUE DeviceQueue, if (ReturnEntry->SortKey <= SortKey) { /* Get the first entry */ - ReturnEntry = CONTAINING_RECORD(ListEntry->Flink, + ReturnEntry = CONTAINING_RECORD(NextEntry->Flink, KDEVICE_QUEUE_ENTRY, DeviceListEntry); } else { /* Loop the list */ - ListEntry = DeviceQueue->DeviceListHead.Flink; + NextEntry = DeviceQueue->DeviceListHead.Flink; while (TRUE) { + /* Make sure we don't go beyond the end of the queue */ + ASSERT(NextEntry != &DeviceQueue->DeviceListHead); + /* Get the next entry and check if the key is low enough */ - ReturnEntry = CONTAINING_RECORD(ListEntry, + ReturnEntry = CONTAINING_RECORD(NextEntry, KDEVICE_QUEUE_ENTRY, DeviceListEntry); if (SortKey <= ReturnEntry->SortKey) break; /* Try the next one */ - ListEntry = ListEntry->Flink; + NextEntry = NextEntry->Flink; } } @@ -270,7 +273,7 @@ NTAPI KeRemoveByKeyDeviceQueueIfBusy(IN PKDEVICE_QUEUE DeviceQueue, IN ULONG SortKey) { - PLIST_ENTRY ListEntry; + PLIST_ENTRY NextEntry; PKDEVICE_QUEUE_ENTRY ReturnEntry; KLOCK_QUEUE_HANDLE DeviceLock; ASSERT_DEVICE_QUEUE(DeviceQueue); @@ -289,27 +292,42 @@ KeRemoveByKeyDeviceQueueIfBusy(IN PKDEVICE_QUEUE DeviceQueue, } else { - /* Find entry with SortKey greater than or equal to the passed-in SortKey */ - LIST_FOR_EACH(ReturnEntry, &DeviceQueue->DeviceListHead, KDEVICE_QUEUE_ENTRY, DeviceListEntry) - { - /* Check if keys match */ - if (ReturnEntry->SortKey >= SortKey) - { - /* We found it, so just remove it */ - RemoveEntryList(&ReturnEntry->DeviceListEntry); - break; - } - } + /* If SortKey is greater than the last key, then return the first entry right away */ + NextEntry = &DeviceQueue->DeviceListHead; + ReturnEntry = CONTAINING_RECORD(NextEntry->Blink, + KDEVICE_QUEUE_ENTRY, + DeviceListEntry); - /* Check if we found something */ - if (!ReturnEntry) + /* Check if we can just get the first entry */ + if (ReturnEntry->SortKey <= SortKey) { - /* Not found, return the first entry */ - ListEntry = RemoveHeadList(&DeviceQueue->DeviceListHead); - ReturnEntry = CONTAINING_RECORD(ListEntry, + /* Get the first entry */ + ReturnEntry = CONTAINING_RECORD(NextEntry->Flink, KDEVICE_QUEUE_ENTRY, DeviceListEntry); } + else + { + /* Loop the list */ + NextEntry = DeviceQueue->DeviceListHead.Flink; + while (TRUE) + { + /* Make sure we don't go beyond the end of the queue */ + ASSERT(NextEntry != &DeviceQueue->DeviceListHead); + + /* Get the next entry and check if the key is low enough */ + ReturnEntry = CONTAINING_RECORD(NextEntry, + KDEVICE_QUEUE_ENTRY, + DeviceListEntry); + if (SortKey <= ReturnEntry->SortKey) break; + + /* Try the next one */ + NextEntry = NextEntry->Flink; + } + } + + /* We have an entry, remove it now */ + RemoveEntryList(&ReturnEntry->DeviceListEntry); /* Set it as non-inserted */ ReturnEntry->Inserted = FALSE; diff --git a/reactos/ntoskrnl/ke/eventobj.c b/reactos/ntoskrnl/ke/eventobj.c index ab3c11659fc..2f798a1b05c 100644 --- a/reactos/ntoskrnl/ke/eventobj.c +++ b/reactos/ntoskrnl/ke/eventobj.c @@ -10,7 +10,7 @@ #include #define NDEBUG -#include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/ntoskrnl/ke/except.c b/reactos/ntoskrnl/ke/except.c index b994d077585..c83b938fbc8 100644 --- a/reactos/ntoskrnl/ke/except.c +++ b/reactos/ntoskrnl/ke/except.c @@ -10,7 +10,7 @@ #include #define NDEBUG -#include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/ntoskrnl/ke/freeldr.c b/reactos/ntoskrnl/ke/freeldr.c index 20a27758a59..08decf0338d 100644 --- a/reactos/ntoskrnl/ke/freeldr.c +++ b/reactos/ntoskrnl/ke/freeldr.c @@ -76,7 +76,7 @@ NTAPI KiRosGetMdFromArray(VOID) { /* Return the next MD from the list, but make sure we don't overflow */ - if (BldrCurrentMd > 60) KEBUGCHECK(0); + if (BldrCurrentMd > 60) ASSERT(FALSE); return &BldrMemoryDescriptors[BldrCurrentMd++]; } @@ -1177,6 +1177,9 @@ KiRosFrldrLpbToNtLpb(IN PROS_LOADER_PARAMETER_BLOCK RosLoaderBlock, LoaderBlock->Extension->MajorVersion = 5; LoaderBlock->Extension->MinorVersion = 2; + +// FIXME FIXME FIXME NOW!!!! + /* FreeLDR hackllocates 1536 static pages for the initial boot images */ LoaderBlock->Extension->LoaderPagesSpanned = 1536 * PAGE_SIZE; diff --git a/reactos/ntoskrnl/ke/gate.c b/reactos/ntoskrnl/ke/gate.c index ea15bcc097e..15619ab0847 100644 --- a/reactos/ntoskrnl/ke/gate.c +++ b/reactos/ntoskrnl/ke/gate.c @@ -10,7 +10,7 @@ #include #define NDEBUG -#include +#include /* FUNCTIONS ****************************************************************/ diff --git a/reactos/ntoskrnl/ke/gmutex.c b/reactos/ntoskrnl/ke/gmutex.c index fb7dadbe096..e2b762d2224 100644 --- a/reactos/ntoskrnl/ke/gmutex.c +++ b/reactos/ntoskrnl/ke/gmutex.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include /* PRIVATE FUNCTIONS *********************************************************/ @@ -79,6 +79,9 @@ KiAcquireGuardedMutexContented(IN OUT PKGUARDED_MUTEX GuardedMutex) /* Ok, the wait is done, so set the new bits */ BitsToRemove = GM_LOCK_BIT | GM_LOCK_WAITER_WOKEN; BitsToAdd = GM_LOCK_WAITER_WOKEN; + + /* We depend on these bits being just right */ + C_ASSERT((GM_LOCK_WAITER_WOKEN * 2) == GM_LOCK_WAITER_INC); } } @@ -103,7 +106,7 @@ FORCEINLINE FASTCALL KiReleaseGuardedMutex(IN OUT PKGUARDED_MUTEX GuardedMutex) { - LONG OldValue; + LONG OldValue, NewValue; /* Destroy the Owner */ GuardedMutex->Owner = NULL; @@ -117,10 +120,14 @@ KiReleaseGuardedMutex(IN OUT PKGUARDED_MUTEX GuardedMutex) { /* Update the Oldvalue to what it should be now */ OldValue |= GM_LOCK_BIT; + + /* The mutex will be woken, minus one waiter */ + NewValue = (OldValue | GM_LOCK_WAITER_WOKEN); + NewValue &= ~GM_LOCK_WAITER_INC; /* Remove the Woken bit */ if (InterlockedCompareExchange(&GuardedMutex->Count, - OldValue - GM_LOCK_WAITER_WOKEN, + NewValue, OldValue) == OldValue) { /* Signal the Gate */ diff --git a/reactos/ntoskrnl/ke/i386/boot.S b/reactos/ntoskrnl/ke/i386/boot.S index 24dd19cde4b..1cf68a52f36 100644 --- a/reactos/ntoskrnl/ke/i386/boot.S +++ b/reactos/ntoskrnl/ke/i386/boot.S @@ -36,7 +36,7 @@ _KiSystemStartup: test dword ptr [esp+4], 0x80000000 jnz _KiSystemStartupReal@4 - /* FREELDR Boot: Cal the FreeLDR wrapper */ + /* FREELDR Boot: Call the FreeLDR wrapper */ jmp @KiRosPrepareForSystemStartup@8 .endfunc diff --git a/reactos/ntoskrnl/ke/i386/cpu.c b/reactos/ntoskrnl/ke/i386/cpu.c index d5f9298b685..3e5aa136a47 100644 --- a/reactos/ntoskrnl/ke/i386/cpu.c +++ b/reactos/ntoskrnl/ke/i386/cpu.c @@ -12,12 +12,6 @@ #define NDEBUG #include -/* FIXME: Local EFLAGS defines not used anywhere else */ -#define EFLAGS_IOPL 0x3000 -#define EFLAGS_NF 0x4000 -#define EFLAGS_RF 0x10000 -#define EFLAGS_ID 0x200000 - /* GLOBALS *******************************************************************/ /* The Boot TSS */ diff --git a/reactos/ntoskrnl/ke/i386/ctxswitch.S b/reactos/ntoskrnl/ke/i386/ctxswitch.S index 3cff2d27a1c..73fe48388ee 100644 --- a/reactos/ntoskrnl/ke/i386/ctxswitch.S +++ b/reactos/ntoskrnl/ke/i386/ctxswitch.S @@ -738,7 +738,7 @@ CheckNext: SwapContext: /* ReactOS Mm Hack */ mov ecx, esi - call @MiSyncThreadProcessViews@4 + call @MiSyncForContextSwitch@4 /* Swap context at APC_LEVEL */ mov ecx, APC_LEVEL diff --git a/reactos/ntoskrnl/ke/i386/exp.c b/reactos/ntoskrnl/ke/i386/exp.c index 0af453bffb0..5bddfd7fa12 100644 --- a/reactos/ntoskrnl/ke/i386/exp.c +++ b/reactos/ntoskrnl/ke/i386/exp.c @@ -72,7 +72,7 @@ KeInitExceptions(VOID) extern KIDTENTRY KiIdt[MAXIMUM_IDTVECTOR]; /* Loop the IDT */ - for (i = 0; i <= MAXIMUM_IDTVECTOR; i ++) + for (i = 0; i <= MAXIMUM_IDTVECTOR; i++) { /* Save the current Selector */ FlippedSelector = KiIdt[i].Selector; @@ -113,7 +113,7 @@ KiRecordDr7(OUT PULONG Dr7Ptr, /* Check if the caller gave us a mask */ if (!DrMask) { - /* He didn't use the one from the thread */ + /* He didn't, use the one from the thread */ Mask = KeGetCurrentThread()->DispatcherHeader.DebugActive; } else @@ -266,7 +266,7 @@ ULONG NTAPI KiSsFromTrapFrame(IN PKTRAP_FRAME TrapFrame) { - /* If this was V86 Mode */ + /* Check if this was V86 Mode */ if (TrapFrame->EFlags & EFLAGS_V86_MASK) { /* Just return it */ @@ -274,7 +274,7 @@ KiSsFromTrapFrame(IN PKTRAP_FRAME TrapFrame) } else if (TrapFrame->SegCs & MODE_MASK) { - /* Usermode, return the User SS */ + /* User mode, return the User SS */ return TrapFrame->HardwareSegSs | RPL_MASK; } else @@ -599,7 +599,7 @@ KeContextToTrapFrame(IN PCONTEXT Context, } /* Check if thread has IOPL and force it enabled if so */ - if (KeGetCurrentThread()->Iopl) TrapFrame->EFlags |= 0x3000; + if (KeGetCurrentThread()->Iopl) TrapFrame->EFlags |= EFLAGS_IOPL; /* Restore IRQL */ if (OldIrql < APC_LEVEL) KeLowerIrql(OldIrql); diff --git a/reactos/ntoskrnl/ke/i386/kiinit.c b/reactos/ntoskrnl/ke/i386/kiinit.c index a87d09638f7..416b3433f20 100644 --- a/reactos/ntoskrnl/ke/i386/kiinit.c +++ b/reactos/ntoskrnl/ke/i386/kiinit.c @@ -294,7 +294,7 @@ KiInitMachineDependent(VOID) if (KiMXCsrMask != MXCsrMask) { /* No, something is definitely wrong */ - KEBUGCHECKEX(MULTIPROCESSOR_CONFIGURATION_NOT_SUPPORTED, + KeBugCheckEx(MULTIPROCESSOR_CONFIGURATION_NOT_SUPPORTED, KF_FXSR, KiMXCsrMask, MXCsrMask, diff --git a/reactos/ntoskrnl/ke/i386/ldt.c b/reactos/ntoskrnl/ke/i386/ldt.c index 2d3f5480448..a6ce3b6ea00 100644 --- a/reactos/ntoskrnl/ke/i386/ldt.c +++ b/reactos/ntoskrnl/ke/i386/ldt.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include /* GLOBALS *******************************************************************/ diff --git a/reactos/ntoskrnl/ke/i386/thrdini.c b/reactos/ntoskrnl/ke/i386/thrdini.c index ec4043980a2..9428d6a0a8a 100644 --- a/reactos/ntoskrnl/ke/i386/thrdini.c +++ b/reactos/ntoskrnl/ke/i386/thrdini.c @@ -132,7 +132,7 @@ Ke386InitThreadWithContext(IN PKTHREAD Thread, Thread->NpxState = NPX_STATE_NOT_LOADED &~ CR0_MP; } - /* Disable any debug regiseters */ + /* Disable any debug registers */ Context->ContextFlags &= ~CONTEXT_DEBUG_REGISTERS; /* Setup the Trap Frame */ diff --git a/reactos/ntoskrnl/ke/i386/trap.s b/reactos/ntoskrnl/ke/i386/trap.s index 65ecc781906..2f3aec94e87 100644 --- a/reactos/ntoskrnl/ke/i386/trap.s +++ b/reactos/ntoskrnl/ke/i386/trap.s @@ -1836,7 +1836,7 @@ NotGdt: CheckRing3Io: /* Get EFLAGS and IOPL */ mov ebx, [ebp+KTRAP_FRAME_EFLAGS] - and ebx, 0x3000 + and ebx, EFLAGS_IOPL shr ebx, 12 /* Check the CS's RPL mask */ diff --git a/reactos/ntoskrnl/ke/i386/usercall.c b/reactos/ntoskrnl/ke/i386/usercall.c index 71221e49447..57811c1594e 100644 --- a/reactos/ntoskrnl/ke/i386/usercall.c +++ b/reactos/ntoskrnl/ke/i386/usercall.c @@ -10,7 +10,7 @@ #include #define NDEBUG -#include +#include extern PGDI_BATCHFLUSH_ROUTINE KeGdiFlushUserBatch; @@ -116,7 +116,7 @@ KiInitializeUserApc(IN PKEXCEPTION_FRAME ExceptionFrame, TrapFrame->EFlags = Ke386SanitizeFlags(Context.EFlags, UserMode); /* Check if thread has IOPL and force it enabled if so */ - if (KeGetCurrentThread()->Iopl) TrapFrame->EFlags |= 0x3000; + if (KeGetCurrentThread()->Iopl) TrapFrame->EFlags |= EFLAGS_IOPL; /* Setup the stack */ *(PULONG_PTR)(Stack + 0 * sizeof(ULONG_PTR)) = (ULONG_PTR)NormalRoutine; diff --git a/reactos/ntoskrnl/ke/i386/v86m_sup.S b/reactos/ntoskrnl/ke/i386/v86m_sup.S index 8db3c4c7cc3..a6ff1a7c153 100644 --- a/reactos/ntoskrnl/ke/i386/v86m_sup.S +++ b/reactos/ntoskrnl/ke/i386/v86m_sup.S @@ -203,7 +203,7 @@ _OpcodeOUTSWV86: _OpcodePUSHFV86: /* Get VDM state */ - mov eax, 0x714 + mov eax, FIXED_NTVDMSTATE_LINEAR_PC_AT mov eax, [eax] /* Get EFLAGS and mask out IF */ @@ -211,11 +211,11 @@ _OpcodePUSHFV86: and eax, ~EFLAGS_INTERRUPT_MASK /* Mask align check and interrupt mask */ - and eax, EFLAGS_ALIGN_CHECK + 0x4000 + EFLAGS_INTERRUPT_MASK + and eax, EFLAGS_ALIGN_CHECK + EFLAGS_NESTED_TASK + EFLAGS_INTERRUPT_MASK or eax, edx /* Add IOPL Mask */ - or eax, 0x3000 + or eax, EFLAGS_IOPL /* Get flat ESP */ movzx ecx, word ptr [ebp+KTRAP_FRAME_SS] @@ -252,7 +252,7 @@ SkipPrefix: _OpcodePOPFV86: /* Get VDM state */ - mov eax, 0x714 + mov eax, FIXED_NTVDMSTATE_LINEAR_PC_AT /* Get flat ESP */ mov ecx, [ebp+KTRAP_FRAME_SS] @@ -277,10 +277,10 @@ NoPrefix: mov [ebp+KTRAP_FRAME_ESP], edx /* Mask out EFLAGS */ - and eax, ~0x3000 + and eax, ~EFLAGS_IOPL mov ebx, ebx - and ebx, ~0x4000 - and ecx, EFLAGS_ALIGN_CHECK + 0x4000 + EFLAGS_INTERRUPT_MASK + and ebx, ~EFLAGS_NESTED_TASK + and ecx, EFLAGS_ALIGN_CHECK + EFLAGS_NESTED_TASK + EFLAGS_INTERRUPT_MASK /* FIXME: Support VME */ @@ -314,7 +314,7 @@ NoAdjustEsp0: pop eax /* Update the flags in the VDM State */ - LOCK and dword ptr [eax], ~(EFLAGS_ALIGN_CHECK + 0x4000 + EFLAGS_INTERRUPT_MASK) + LOCK and dword ptr [eax], ~(EFLAGS_ALIGN_CHECK + EFLAGS_NESTED_TASK + EFLAGS_INTERRUPT_MASK) LOCK or [eax], ecx /* Update EIP */ @@ -334,7 +334,7 @@ _OpcodeINTnnV86: mov edx, [ebp+KTRAP_FRAME_EFLAGS] /* Remove the flag in the VDM State */ - mov eax, 0x714 + mov eax, FIXED_NTVDMSTATE_LINEAR_PC_AT mov ecx, [eax] LOCK and dword ptr [eax], ~EFLAGS_INTERRUPT_MASK @@ -349,11 +349,11 @@ _OpcodeINTnnV86: /* Now mask out VIF and TF */ or eax, ecx - and edx, ~(EFLAGS_VIF + 0x4000 + EFLAGS_TF) + and edx, ~(EFLAGS_VIF + EFLAGS_NESTED_TASK + EFLAGS_TF) mov [ebp+KTRAP_FRAME_EFLAGS], edx /* Set the IOPL Mask */ - or eax, 0x3000 + or eax, EFLAGS_IOPL /* Get stack flat address */ movzx ecx, word ptr [ebp+KTRAP_FRAME_SS] @@ -422,7 +422,7 @@ _OpcodeINTOV86: _OpcodeIRETV86: /* Get the VDM State */ - mov eax, 0x714 + mov eax, FIXED_NTVDMSTATE_LINEAR_PC_AT /* Get flat ESP */ movzx ecx, word ptr [ebp+KTRAP_FRAME_SS] @@ -450,7 +450,7 @@ _OpcodeIRETV86: MaskEFlags: /* Mask out EFLAGS */ - and ebx, ~(0x3000 + EFLAGS_VIF + 0x4000 + EFLAGS_VIP) + and ebx, ~(EFLAGS_IOPL + EFLAGS_VIF + EFLAGS_NESTED_TASK + EFLAGS_VIP) mov ecx, ebx /* FIXME: Check for VME support */ @@ -595,7 +595,7 @@ _OpcodeREPPrefixV86: _OpcodeCLIV86: /* Get VDM State */ - mov eax, 0x714 + mov eax, FIXED_NTVDMSTATE_LINEAR_PC_AT /* FIXME: Support VME */ @@ -616,7 +616,7 @@ _OpcodeCLIV86: _OpcodeSTIV86: /* Get VDM State */ - mov eax, 0x714 + mov eax, FIXED_NTVDMSTATE_LINEAR_PC_AT /* FIXME: Support VME */ diff --git a/reactos/ntoskrnl/ke/ipi.c b/reactos/ntoskrnl/ke/ipi.c index d7d1c2a6ce0..979fcdd87b2 100644 --- a/reactos/ntoskrnl/ke/ipi.c +++ b/reactos/ntoskrnl/ke/ipi.c @@ -10,7 +10,7 @@ #include #define NDEBUG -#include +#include /* GLOBALS *******************************************************************/ diff --git a/reactos/ntoskrnl/ke/mutex.c b/reactos/ntoskrnl/ke/mutex.c index 18836750267..73bb15ee738 100644 --- a/reactos/ntoskrnl/ke/mutex.c +++ b/reactos/ntoskrnl/ke/mutex.c @@ -10,7 +10,7 @@ #include #define NDEBUG -#include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/ntoskrnl/ke/powerpc/exp.c b/reactos/ntoskrnl/ke/powerpc/exp.c index 3d9a04459e2..8534a57ee1f 100644 --- a/reactos/ntoskrnl/ke/powerpc/exp.c +++ b/reactos/ntoskrnl/ke/powerpc/exp.c @@ -104,7 +104,7 @@ KiDispatchException(IN PEXCEPTION_RECORD ExceptionRecord, DbgPrint("EXCEPTION! Record %08x Frame %08x\n", ExceptionRecord, ExceptionFrame); MmuDumpMap(); - KEBUGCHECK(0); + KeBugCheck(0); } /* diff --git a/reactos/ntoskrnl/ke/powerpc/ppc_irq.c b/reactos/ntoskrnl/ke/powerpc/ppc_irq.c index 9f1a8e4f4e5..909dc0a25ff 100644 --- a/reactos/ntoskrnl/ke/powerpc/ppc_irq.c +++ b/reactos/ntoskrnl/ke/powerpc/ppc_irq.c @@ -21,7 +21,7 @@ #include #define NDEBUG -#include +#include KDPC KiExpireTimerDpc; extern ULONG KiMaximumDpcQueueDepth; diff --git a/reactos/ntoskrnl/ke/procobj.c b/reactos/ntoskrnl/ke/procobj.c index e456824d133..fd52948dbae 100644 --- a/reactos/ntoskrnl/ke/procobj.c +++ b/reactos/ntoskrnl/ke/procobj.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include /* GLOBALS *******************************************************************/ @@ -448,7 +448,7 @@ KeAttachProcess(IN PKPROCESS Process) ASSERT_IRQL_LESS_OR_EQUAL(DISPATCH_LEVEL); /* Make sure that we are in the right page directory (ReactOS Mm Hack) */ - MiSyncThreadProcessViews(Thread); + MiSyncForProcessAttach(Thread, (PEPROCESS)Process); /* Check if we're already in that process */ if (Thread->ApcState.Process == Process) return; @@ -458,7 +458,7 @@ KeAttachProcess(IN PKPROCESS Process) (KeIsExecutingDpc())) { /* Invalid attempt */ - KEBUGCHECKEX(INVALID_PROCESS_ATTACH_ATTEMPT, + KeBugCheckEx(INVALID_PROCESS_ATTACH_ATTEMPT, (ULONG_PTR)Process, (ULONG_PTR)Thread->ApcState.Process, Thread->ApcStateIndex, @@ -574,13 +574,13 @@ KeStackAttachProcess(IN PKPROCESS Process, ASSERT_IRQL_LESS_OR_EQUAL(DISPATCH_LEVEL); /* Make sure that we are in the right page directory (ReactOS Mm Hack) */ - MiSyncThreadProcessViews(Thread); + MiSyncForProcessAttach(Thread, (PEPROCESS)Process); /* Crash system if DPC is being executed! */ if (KeIsExecutingDpc()) { /* Executing a DPC, crash! */ - KEBUGCHECKEX(INVALID_PROCESS_ATTACH_ATTEMPT, + KeBugCheckEx(INVALID_PROCESS_ATTACH_ATTEMPT, (ULONG_PTR)Process, (ULONG_PTR)Thread->ApcState.Process, Thread->ApcStateIndex, @@ -662,7 +662,7 @@ KeUnstackDetachProcess(IN PRKAPC_STATE ApcState) (!IsListEmpty(&Thread->ApcState.ApcListHead[UserMode]))) { /* Bugcheck the system */ - KEBUGCHECK(INVALID_PROCESS_DETACH_ATTEMPT); + KeBugCheck(INVALID_PROCESS_DETACH_ATTEMPT); } /* Get the process */ diff --git a/reactos/ntoskrnl/ke/profobj.c b/reactos/ntoskrnl/ke/profobj.c index 274da416035..1927f77560a 100644 --- a/reactos/ntoskrnl/ke/profobj.c +++ b/reactos/ntoskrnl/ke/profobj.c @@ -1,16 +1,16 @@ /* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/ke/profile.c + * COPYRIGHT: GPL - See COPYING in the top level directory + * PROJECT: ReactOS Kernel + * FILE: ntoskrnl/ke/profobj.c * PURPOSE: Kernel Profiling - * * PROGRAMMERS: Alex Ionescu (alex@relsoft.net) */ /* INCLUDES *****************************************************************/ + #include #define NDEBUG -#include +#include /* GLOBALS *******************************************************************/ @@ -54,8 +54,9 @@ KeStartProfile(PKPROFILE Profile, KIRQL OldIrql; PKPROFILE_SOURCE_OBJECT SourceBuffer; PKPROFILE_SOURCE_OBJECT CurrentSource; - BOOLEAN FreeBuffer = TRUE; + BOOLEAN FreeBuffer = TRUE, SourceFound = FALSE;; PKPROCESS ProfileProcess; + PLIST_ENTRY NextEntry; /* Allocate a buffer first, before we raise IRQL */ SourceBuffer = ExAllocatePoolWithTag(NonPagedPool, @@ -68,8 +69,8 @@ KeStartProfile(PKPROFILE Profile, KeAcquireSpinLockAtDpcLevel(&KiProfileLock); /* Make sure it's not running */ - if (!Profile->Started) { - + if (!Profile->Started) + { /* Set it as Started */ Profile->Buffer = Buffer; Profile->Started = TRUE; @@ -77,28 +78,40 @@ KeStartProfile(PKPROFILE Profile, /* Get the process, if any */ ProfileProcess = Profile->Process; - /* Insert it into the Process List or Global List */ - if (ProfileProcess) { - + /* Check where we should insert it */ + if (ProfileProcess) + { + /* Insert it into the Process List */ InsertTailList(&ProfileProcess->ProfileListHead, &Profile->ProfileListEntry); - - } else { - + } + else + { + /* Insert it into the Global List */ InsertTailList(&KiProfileListHead, &Profile->ProfileListEntry); } - /* Check if this type of profile (source) is already running */ - LIST_FOR_EACH(CurrentSource, &KiProfileSourceListHead, KPROFILE_SOURCE_OBJECT, ListEntry) + /* Start looping */ + for (NextEntry = KiProfileSourceListHead.Flink; + NextEntry != &KiProfileSourceListHead; + NextEntry = NextEntry->Flink) { + /* Get the entry */ + CurrentSource = CONTAINING_RECORD(NextEntry, + KPROFILE_SOURCE_OBJECT, + ListEntry); + /* Check if it's the same as the one being requested now */ - if (CurrentSource->Source == Profile->Source) { + if (CurrentSource->Source == Profile->Source) + { + /* It is, break out */ + SourceFound = TRUE; break; } } /* See if the loop found something */ - if (!CurrentSource) { - + if (!SourceFound) + { /* Nothing found, use our allocated buffer */ CurrentSource = SourceBuffer; @@ -119,7 +132,7 @@ KeStartProfile(PKPROFILE Profile, //HalStartProfileInterrupt(Profile->Source); /* Free the pool */ - if (!FreeBuffer) ExFreePool(SourceBuffer); + if (FreeBuffer) ExFreePool(SourceBuffer); } BOOLEAN @@ -128,23 +141,37 @@ KeStopProfile(PKPROFILE Profile) { KIRQL OldIrql; PKPROFILE_SOURCE_OBJECT CurrentSource = NULL; + PLIST_ENTRY NextEntry; + BOOLEAN SourceFound = FALSE; /* Raise to PROFILE_LEVEL and acquire spinlock */ KeRaiseIrql(PROFILE_LEVEL, &OldIrql); KeAcquireSpinLockAtDpcLevel(&KiProfileLock); /* Make sure it's running */ - if (Profile->Started) { - + if (Profile->Started) + { /* Remove it from the list and disable */ RemoveEntryList(&Profile->ProfileListEntry); Profile->Started = FALSE; - /* Find the Source Object */ - LIST_FOR_EACH(CurrentSource, &KiProfileSourceListHead, KPROFILE_SOURCE_OBJECT, ListEntry) + /* Start looping */ + for (NextEntry = KiProfileSourceListHead.Flink; + NextEntry != &KiProfileSourceListHead; + NextEntry = NextEntry->Flink) { - if (CurrentSource->Source == Profile->Source) { - /* Remove it */ + /* Get the entry */ + CurrentSource = CONTAINING_RECORD(NextEntry, + KPROFILE_SOURCE_OBJECT, + ListEntry); + + /* Check if this is the Source Object */ + if (CurrentSource->Source == Profile->Source) + { + /* Remember we found one */ + SourceFound = TRUE; + + /* Remove it and break out */ RemoveEntryList(&CurrentSource->ListEntry); break; } @@ -160,7 +187,7 @@ KeStopProfile(PKPROFILE Profile) //HalStopProfileInterrupt(Profile->Source); /* Free the Source Object */ - if (CurrentSource) ExFreePool(CurrentSource); + if (SourceFound) ExFreePool(CurrentSource); /* FIXME */ return FALSE; @@ -171,13 +198,13 @@ STDCALL KeQueryIntervalProfile(KPROFILE_SOURCE ProfileSource) { /* Check if this is the timer profile */ - if (ProfileSource == ProfileTime) { - + if (ProfileSource == ProfileTime) + { /* Return the good old 100ns sampling interval */ return KiProfileTimeInterval; - - } else { - + } + else + { /* Request it from HAL. FIXME: What structure is used? */ HalQuerySystemInformation(HalProfileSourceInformation, sizeof(NULL), @@ -194,18 +221,17 @@ KeSetIntervalProfile(KPROFILE_SOURCE ProfileSource, ULONG Interval) { /* Check if this is the timer profile */ - if (ProfileSource == ProfileTime) { - + if (ProfileSource == ProfileTime) + { /* Set the good old 100ns sampling interval */ KiProfileTimeInterval = Interval; - - } else { - + } + else + { /* Set it with HAL. FIXME: What structure is used? */ HalSetSystemInformation(HalProfileSourceInformation, sizeof(NULL), NULL); - } } @@ -228,16 +254,22 @@ KiParseProfileList(IN PKTRAP_FRAME TrapFrame, { PULONG BucketValue; PKPROFILE Profile; + PLIST_ENTRY NextEntry; /* Loop the List */ - LIST_FOR_EACH(Profile, ListHead, KPROFILE, ProfileListEntry) + for (NextEntry = ListHead->Flink; + NextEntry != ListHead; + NextEntry = NextEntry->Flink) { + /* Get the entry */ + Profile = CONTAINING_RECORD(NextEntry, KPROFILE, ProfileListEntry); + /* Check if the source is good, and if it's within the range */ #ifdef _M_IX86 if ((Profile->Source != Source) || (TrapFrame->Eip < (ULONG_PTR)Profile->RangeBase) || - (TrapFrame->Eip > (ULONG_PTR)Profile->RangeLimit)) { - + (TrapFrame->Eip > (ULONG_PTR)Profile->RangeLimit)) + { continue; } diff --git a/reactos/ntoskrnl/ke/queue.c b/reactos/ntoskrnl/ke/queue.c index efe31c44064..a548a7df098 100644 --- a/reactos/ntoskrnl/ke/queue.c +++ b/reactos/ntoskrnl/ke/queue.c @@ -12,7 +12,7 @@ #include #define NDEBUG -#include +#include /* PRIVATE FUNCTIONS *********************************************************/ diff --git a/reactos/ntoskrnl/ke/semphobj.c b/reactos/ntoskrnl/ke/semphobj.c index 918dd1c2f51..7c92e0670d1 100644 --- a/reactos/ntoskrnl/ke/semphobj.c +++ b/reactos/ntoskrnl/ke/semphobj.c @@ -10,7 +10,7 @@ #include #define NDEBUG -#include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/ntoskrnl/ke/spinlock.c b/reactos/ntoskrnl/ke/spinlock.c index ab2cb37e601..13988761b27 100644 --- a/reactos/ntoskrnl/ke/spinlock.c +++ b/reactos/ntoskrnl/ke/spinlock.c @@ -10,7 +10,7 @@ #include #define NDEBUG -#include +#include #define LQ_WAIT 1 #define LQ_OWN 2 diff --git a/reactos/ntoskrnl/ke/thrdobj.c b/reactos/ntoskrnl/ke/thrdobj.c index dccfe9c4a80..e8b6dfaec97 100644 --- a/reactos/ntoskrnl/ke/thrdobj.c +++ b/reactos/ntoskrnl/ke/thrdobj.c @@ -10,7 +10,7 @@ #include #define NDEBUG -#include +#include extern EX_WORK_QUEUE ExWorkerQueue[MaximumWorkQueue]; extern LIST_ENTRY PspReaperListHead; @@ -416,7 +416,7 @@ KeRundownThread(VOID) if (Mutant->ApcDisable) { /* Bugcheck the system */ - KEBUGCHECKEX(0, //THREAD_TERMINATE_HELD_MUTEX, + KeBugCheckEx(THREAD_TERMINATE_HELD_MUTEX, (ULONG_PTR)Thread, (ULONG_PTR)Mutant, 0, @@ -811,7 +811,7 @@ KeInitThread(IN OUT PKTHREAD Thread, Thread->KernelStackResident = TRUE; /* Make sure that we are in the right page directory (ReactOS Mm Hack) */ - MiSyncThreadProcessViews(Thread); + MiSyncForProcessAttach(Thread, (PEPROCESS)Process); /* Enter SEH to avoid crashes due to user mode */ Status = STATUS_SUCCESS; diff --git a/reactos/ntoskrnl/ke/thrdschd.c b/reactos/ntoskrnl/ke/thrdschd.c index 15a2d9f61a2..ff64d40cf5b 100644 --- a/reactos/ntoskrnl/ke/thrdschd.c +++ b/reactos/ntoskrnl/ke/thrdschd.c @@ -344,7 +344,7 @@ KiSwapThread(IN PKTHREAD CurrentThread, WaitIrql = CurrentThread->WaitIrql; /* REACTOS Mm Hack of Doom */ - MiSyncThreadProcessViews(NextThread); + MiSyncForContextSwitch(NextThread); /* Swap contexts */ ApcState = KiSwapContext(CurrentThread, NextThread); @@ -378,7 +378,7 @@ KiReadyThread(IN PKTHREAD Thread) if (Process->State != ProcessInMemory) { /* We don't page out processes in ROS */ - KEBUGCHECK(0); + ASSERT(FALSE); } else if (!Thread->KernelStackResident) { @@ -391,7 +391,7 @@ KiReadyThread(IN PKTHREAD Thread) Thread->State = Transition; /* The stack is always resident in ROS */ - KEBUGCHECK(0); + ASSERT(FALSE); } else { @@ -610,7 +610,7 @@ KiSetPriorityThread(IN PKTHREAD Thread, { /* FIXME: TODO */ DPRINT1("Deferred state not yet supported\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } else { @@ -714,7 +714,7 @@ NtYieldExecution(VOID) ASSERT(OldIrql <= DISPATCH_LEVEL); /* REACTOS Mm Hack of Doom */ - MiSyncThreadProcessViews(NextThread); + MiSyncForContextSwitch(NextThread); /* Swap to new thread */ KiSwapContext(Thread, NextThread); diff --git a/reactos/ntoskrnl/ke/wait.c b/reactos/ntoskrnl/ke/wait.c index a37b4a092ae..2ec2cec5159 100644 --- a/reactos/ntoskrnl/ke/wait.c +++ b/reactos/ntoskrnl/ke/wait.c @@ -520,7 +520,7 @@ KeWaitForMultipleObjects(IN ULONG Count, if (Count > THREAD_WAIT_OBJECTS) { /* Bugcheck */ - KEBUGCHECK(MAXIMUM_WAIT_OBJECTS_EXCEEDED); + KeBugCheck(MAXIMUM_WAIT_OBJECTS_EXCEEDED); } /* Use the Thread's Wait Block */ @@ -532,7 +532,7 @@ KeWaitForMultipleObjects(IN ULONG Count, if (Count > MAXIMUM_WAIT_OBJECTS) { /* Bugcheck */ - KEBUGCHECK(MAXIMUM_WAIT_OBJECTS_EXCEEDED); + KeBugCheck(MAXIMUM_WAIT_OBJECTS_EXCEEDED); } } diff --git a/reactos/ntoskrnl/lpc/close.c b/reactos/ntoskrnl/lpc/close.c index d142d0f50a9..173fcdf8794 100644 --- a/reactos/ntoskrnl/lpc/close.c +++ b/reactos/ntoskrnl/lpc/close.c @@ -40,7 +40,7 @@ LpcExitThread(IN PETHREAD Thread) if (Message) { /* FIXME: TODO */ - KEBUGCHECK(0); + ASSERT(FALSE); } /* Release the lock */ diff --git a/reactos/ntoskrnl/mm/amd64/page.c b/reactos/ntoskrnl/mm/amd64/page.c index 97848d66d6e..b21af64f9f7 100644 --- a/reactos/ntoskrnl/mm/amd64/page.c +++ b/reactos/ntoskrnl/mm/amd64/page.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include #if defined (ALLOC_PRAGMA) #pragma alloc_text(INIT, MmInitGlobalKernelPageDirectory) @@ -308,7 +308,7 @@ MmUpdatePageDir(PEPROCESS Process, PVOID Address, ULONG Size) /* Sanity check */ if (Address < MmSystemRangeStart) { - KEBUGCHECK(0); + KeBugCheck(0); } /* Get pointer to the page directory to update */ diff --git a/reactos/ntoskrnl/mm/anonmem.c b/reactos/ntoskrnl/mm/anonmem.c index dd1943c639c..e7e68b48841 100644 --- a/reactos/ntoskrnl/mm/anonmem.c +++ b/reactos/ntoskrnl/mm/anonmem.c @@ -41,7 +41,7 @@ #include #define NDEBUG -#include +#include /* FUNCTIONS *****************************************************************/ @@ -163,7 +163,7 @@ MmPageOutVirtualMemory(PMM_AVL_TABLE AddressSpace, if (Page == 0) { - KEBUGCHECK(0); + ASSERT(FALSE); } /* @@ -301,7 +301,7 @@ MmNotPresentFaultVirtualMemory(PMM_AVL_TABLE AddressSpace, if (PageOp == NULL) { DPRINT1("MmGetPageOp failed"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* @@ -322,12 +322,12 @@ MmNotPresentFaultVirtualMemory(PMM_AVL_TABLE AddressSpace, if (Status != STATUS_SUCCESS) { DPRINT1("Failed to wait for page op\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (PageOp->Status == STATUS_PENDING) { DPRINT1("Woke for page op before completion\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* * If this wasn't a pagein then we need to restart the handling @@ -373,7 +373,7 @@ MmNotPresentFaultVirtualMemory(PMM_AVL_TABLE AddressSpace, if (!NT_SUCCESS(Status)) { DPRINT1("MmRequestPageMemoryConsumer failed, status = %x\n", Status); - KEBUGCHECK(0); + ASSERT(FALSE); } /* @@ -387,7 +387,7 @@ MmNotPresentFaultVirtualMemory(PMM_AVL_TABLE AddressSpace, Status = MmReadFromSwapPage(SwapEntry, Page); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } MmSetSavedSwapEntryPage(Page, SwapEntry); } @@ -414,7 +414,7 @@ MmNotPresentFaultVirtualMemory(PMM_AVL_TABLE AddressSpace, if (!NT_SUCCESS(Status)) { DPRINT1("MmCreateVirtualMapping failed, not out of memory\n"); - KEBUGCHECK(0); + ASSERT(FALSE); return(Status); } @@ -870,7 +870,7 @@ MmFreeVirtualMemory(PEPROCESS Process, if (Status != STATUS_SUCCESS) { DPRINT1("Failed to wait for page op\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } MmLockAddressSpace(&Process->VadRoot); MmReleasePageOp(PageOp); diff --git a/reactos/ntoskrnl/mm/aspace.c b/reactos/ntoskrnl/mm/aspace.c deleted file mode 100644 index 48b44a08fe6..00000000000 --- a/reactos/ntoskrnl/mm/aspace.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/mm/aspace.c - * PURPOSE: Manages address spaces - * - * PROGRAMMERS: David Welch (welch@cwcom.net) - */ - -/* INCLUDES *****************************************************************/ - -#include -#include - -#if defined (ALLOC_PRAGMA) -#pragma alloc_text(INIT, MmInitializeKernelAddressSpace) -#endif - - -/* GLOBALS ******************************************************************/ - -PMM_AVL_TABLE MmKernelAddressSpace; - -/* FUNCTIONS *****************************************************************/ - - -/* EOF */ diff --git a/reactos/ntoskrnl/mm/balance.c b/reactos/ntoskrnl/mm/balance.c index 03608ea3086..a364c5afcf1 100644 --- a/reactos/ntoskrnl/mm/balance.c +++ b/reactos/ntoskrnl/mm/balance.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include #if defined (ALLOC_PRAGMA) #pragma alloc_text(INIT, MmInitializeBalancer) @@ -97,7 +97,7 @@ MmReleasePageMemoryConsumer(ULONG Consumer, PFN_TYPE Page) if (Page == 0) { DPRINT1("Tried to release page zero.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } KeAcquireSpinLock(&AllocationListLock, &oldIrql); @@ -169,7 +169,7 @@ MmRebalanceMemoryConsumers(VOID) Status = MiMemoryConsumers[i].Trim(Target, 0, &NrFreedPages); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } Target = Target - NrFreedPages; } @@ -215,7 +215,7 @@ MmRequestPageMemoryConsumer(ULONG Consumer, BOOLEAN CanWait, Page = MmAllocPage(Consumer, 0); if (Page == 0) { - KEBUGCHECK(NO_PAGES_AVAILABLE); + KeBugCheck(NO_PAGES_AVAILABLE); } *AllocatedPage = Page; if (MmStats.NrFreePages <= MiMinimumAvailablePages && @@ -263,7 +263,7 @@ MmRequestPageMemoryConsumer(ULONG Consumer, BOOLEAN CanWait, Page = Request.Page; if (Page == 0) { - KEBUGCHECK(NO_PAGES_AVAILABLE); + KeBugCheck(NO_PAGES_AVAILABLE); } /* Update the Consumer */ MiGetPfnEntry(Page)->Flags.Consumer = Consumer; @@ -279,7 +279,7 @@ MmRequestPageMemoryConsumer(ULONG Consumer, BOOLEAN CanWait, Page = MmAllocPage(Consumer, 0); if (Page == 0) { - KEBUGCHECK(NO_PAGES_AVAILABLE); + KeBugCheck(NO_PAGES_AVAILABLE); } if(Consumer == MC_USER) MmInsertLRULastUserPage(Page); *AllocatedPage = Page; @@ -316,7 +316,6 @@ MiBalancerThread(PVOID Unused) if (Status == STATUS_SUCCESS) { /* MiBalancerEvent */ - CHECKPOINT; while (MmStats.NrFreePages < MiMinimumAvailablePages + 5) { for (i = 0; i < MC_MAXIMUM; i++) @@ -327,13 +326,12 @@ MiBalancerThread(PVOID Unused) Status = MiMemoryConsumers[i].Trim(MiMinimumPagesPerRun, 0, &NrFreedPages); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } } } } InterlockedExchange(&MiBalancerWork, 0); - CHECKPOINT; } else if (Status == STATUS_SUCCESS + 1) { @@ -359,7 +357,7 @@ MiBalancerThread(PVOID Unused) Status = MiMemoryConsumers[i].Trim(Target, 0, &NrFreedPages); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } } } @@ -368,7 +366,7 @@ MiBalancerThread(PVOID Unused) else { DPRINT1("KeWaitForMultipleObjects failed, status = %x\n", Status); - KEBUGCHECK(0); + ASSERT(FALSE); } } } @@ -387,7 +385,6 @@ MiInitBalancerThread(VOID) ; #endif - CHECKPOINT; KeInitializeEvent(&MiBalancerEvent, SynchronizationEvent, FALSE); KeInitializeTimerEx(&MiBalancerTimer, SynchronizationTimer); @@ -409,7 +406,7 @@ MiInitBalancerThread(VOID) NULL); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } Priority = LOW_REALTIME_PRIORITY + 1; diff --git a/reactos/ntoskrnl/mm/cont.c b/reactos/ntoskrnl/mm/cont.c index 4000a9b455d..2253cf4a517 100644 --- a/reactos/ntoskrnl/mm/cont.c +++ b/reactos/ntoskrnl/mm/cont.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/ntoskrnl/mm/drvlck.c b/reactos/ntoskrnl/mm/drvlck.c index 63551d5f2e5..1b5036caabf 100644 --- a/reactos/ntoskrnl/mm/drvlck.c +++ b/reactos/ntoskrnl/mm/drvlck.c @@ -10,7 +10,7 @@ /* INCLUDES *****************************************************************/ #include -#include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/ntoskrnl/mm/elf.inc.h b/reactos/ntoskrnl/mm/elf.inc.h index 3592c1b40ca..b5795d130b4 100644 --- a/reactos/ntoskrnl/mm/elf.inc.h +++ b/reactos/ntoskrnl/mm/elf.inc.h @@ -1,5 +1,5 @@ #define NDEBUG -#include +#include #include diff --git a/reactos/ntoskrnl/mm/freelist.c b/reactos/ntoskrnl/mm/freelist.c index 0327faf8f99..f824cf25981 100644 --- a/reactos/ntoskrnl/mm/freelist.c +++ b/reactos/ntoskrnl/mm/freelist.c @@ -12,7 +12,7 @@ #include #define NDEBUG -#include +#include #if defined (ALLOC_PRAGMA) #pragma alloc_text(INIT, MmInitializePageList) @@ -270,7 +270,7 @@ MmInitializePageList(VOID) if (!NT_SUCCESS(Status)) { DPRINT1("Unable to create virtual mapping\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } } else @@ -416,7 +416,7 @@ MmMarkPageMapped(PFN_TYPE Pfn) if (Page->Flags.Type == MM_PHYSICAL_PAGE_FREE) { DPRINT1("Mapping non-used page\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } Page->MapCount++; Page->ReferenceCount++; @@ -438,12 +438,12 @@ MmMarkPageUnmapped(PFN_TYPE Pfn) if (Page->Flags.Type == MM_PHYSICAL_PAGE_FREE) { DPRINT1("Unmapping non-used page\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (Page->MapCount == 0) { DPRINT1("Unmapping not mapped page\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } Page->MapCount--; Page->ReferenceCount--; @@ -511,7 +511,7 @@ MmReferencePageUnsafe(PFN_TYPE Pfn) if (Page->Flags.Type != MM_PHYSICAL_PAGE_USED) { DPRINT1("Referencing non-used page\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } Page->ReferenceCount++; @@ -542,7 +542,7 @@ MmGetReferenceCountPage(PFN_TYPE Pfn) if (Page->Flags.Type != MM_PHYSICAL_PAGE_USED) { DPRINT1("Getting reference count for free page\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } RCount = Page->ReferenceCount; @@ -577,12 +577,12 @@ MmDereferencePage(PFN_TYPE Pfn) if (Page->Flags.Type != MM_PHYSICAL_PAGE_USED) { DPRINT1("Dereferencing free page\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (Page->ReferenceCount == 0) { DPRINT1("Derefrencing page with reference count 0\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } Page->ReferenceCount--; @@ -594,29 +594,29 @@ MmDereferencePage(PFN_TYPE Pfn) if (Page->RmapListHead != NULL) { DPRINT1("Freeing page with rmap entries.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (Page->MapCount != 0) { DPRINT1("Freeing mapped page (0x%x count %d)\n", Pfn << PAGE_SHIFT, Page->MapCount); - KEBUGCHECK(0); + ASSERT(FALSE); } if (Page->LockCount > 0) { DPRINT1("Freeing locked page\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (Page->SavedSwapEntry != 0) { DPRINT1("Freeing page with swap entry.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (Page->Flags.Type != MM_PHYSICAL_PAGE_USED) { DPRINT1("Freeing page with flags %x\n", Page->Flags.Type); - KEBUGCHECK(0); + ASSERT(FALSE); } Page->Flags.Type = MM_PHYSICAL_PAGE_FREE; Page->Flags.Consumer = MC_MAXIMUM; @@ -647,7 +647,7 @@ MmGetLockCountPage(PFN_TYPE Pfn) if (Page->Flags.Type != MM_PHYSICAL_PAGE_USED) { DPRINT1("Getting lock count for free page\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } LockCount = Page->LockCount; @@ -671,7 +671,7 @@ MmLockPageUnsafe(PFN_TYPE Pfn) if (Page->Flags.Type != MM_PHYSICAL_PAGE_USED) { DPRINT1("Locking free page\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } Page->LockCount++; @@ -702,7 +702,7 @@ MmUnlockPage(PFN_TYPE Pfn) if (Page->Flags.Type != MM_PHYSICAL_PAGE_USED) { DPRINT1("Unlocking free page\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } Page->LockCount--; @@ -757,17 +757,17 @@ MmAllocPage(ULONG Consumer, SWAPENTRY SavedSwapEntry) if (PageDescriptor->Flags.Type != MM_PHYSICAL_PAGE_FREE) { DPRINT1("Got non-free page from freelist\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (PageDescriptor->MapCount != 0) { DPRINT1("Got mapped page from freelist\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (PageDescriptor->ReferenceCount != 0) { DPRINT1("%d\n", PageDescriptor->ReferenceCount); - KEBUGCHECK(0); + ASSERT(FALSE); } PageDescriptor->Flags.Type = MM_PHYSICAL_PAGE_USED; PageDescriptor->Flags.Consumer = Consumer; @@ -789,7 +789,7 @@ MmAllocPage(ULONG Consumer, SWAPENTRY SavedSwapEntry) if (PageDescriptor->MapCount != 0) { DPRINT1("Returning mapped page.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } return PfnOffset; } @@ -970,7 +970,7 @@ MmZeroPageThreadMain(PVOID Ignored) if (!NT_SUCCESS(Status)) { DPRINT1("ZeroPageThread: Wait failed\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (ZeroPageThreadShouldTerminate) @@ -995,7 +995,7 @@ MmZeroPageThreadMain(PVOID Ignored) if (PageDescriptor->MapCount != 0) { DPRINT1("Mapped page on freelist.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } PageDescriptor->Flags.Zero = 1; PageDescriptor->Flags.Type = MM_PHYSICAL_PAGE_FREE; diff --git a/reactos/ntoskrnl/mm/i386/page.c b/reactos/ntoskrnl/mm/i386/page.c index a5a47a2ed20..cfa8a1d05ab 100644 --- a/reactos/ntoskrnl/mm/i386/page.c +++ b/reactos/ntoskrnl/mm/i386/page.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include #if defined (ALLOC_PRAGMA) #pragma alloc_text(INIT, MmInitGlobalKernelPageDirectory) @@ -62,25 +62,6 @@ __inline LARGE_INTEGER PTE_TO_PAGE(ULONG npage) BOOLEAN MmUnmapPageTable(PULONG Pt); -ULONG_PTR -NTAPI -MiFlushTlbIpiRoutine(ULONG_PTR Address) -{ - if (Address == (ULONG_PTR)-1) - { - KeFlushCurrentTb(); - } - else if (Address == (ULONG_PTR)-2) - { - KeFlushCurrentTb(); - } - else - { - __invlpg((PVOID)Address); - } - return 0; -} - VOID MiFlushTlb(PULONG Pt, PVOID Address) { @@ -90,8 +71,6 @@ MiFlushTlb(PULONG Pt, PVOID Address) } } - - PULONG MmGetPageDirectory(VOID) { @@ -118,7 +97,7 @@ ProtectToPTE(ULONG flProtect) else { DPRINT1("Unknown main protection type.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (flProtect & PAGE_SYSTEM) @@ -262,7 +241,7 @@ MmDeletePageTable(PEPROCESS Process, PVOID Address) if (Address >= MmSystemRangeStart) { - KEBUGCHECK(0); + ASSERT(FALSE); // MmGlobalKernelPageDirectory[ADDR_TO_PDE_OFFSET(Address)] = 0; } if (Process != NULL && Process != CurrentProcess) @@ -271,50 +250,6 @@ MmDeletePageTable(PEPROCESS Process, PVOID Address) } } -VOID -NTAPI -MmFreePageTable(PEPROCESS Process, PVOID Address) -{ - PEPROCESS CurrentProcess = PsGetCurrentProcess(); - ULONG i; - PFN_TYPE Pfn; - PULONG PageTable; - - DPRINT("ProcessId %d, Address %x\n", Process->UniqueProcessId, Address); - if (Process != NULL && Process != CurrentProcess) - { - KeAttachProcess(&Process->Pcb); - } - - PageTable = (PULONG)PAGE_ROUND_DOWN((PVOID)MiAddressToPte(Address)); - for (i = 0; i < 1024; i++) - { - if (PageTable[i] != 0) - { - DbgPrint("Page table entry not clear at %x/%x (is %x)\n", - ((ULONG)Address / (4*1024*1024)), i, PageTable[i]); - KEBUGCHECK(0); - } - } - Pfn = MiAddressToPde(Address)->u.Hard.PageFrameNumber; - MiAddressToPde(Address)->u.Long = 0; - MiFlushTlb((PULONG)MiAddressToPde(Address), MiAddressToPte(Address)); - - if (Address >= MmSystemRangeStart) - { - // MmGlobalKernelPageDirectory[ADDR_TO_PDE_OFFSET(Address)] = 0; - KEBUGCHECK(0); - } - else - { - MmReleasePageMemoryConsumer(MC_NPPOOL, Pfn); - } - if (Process != NULL && Process != CurrentProcess) - { - KeDetachProcess(); - } -} - static PULONG MmGetPageTableForProcess(PEPROCESS Process, PVOID Address, BOOLEAN Create) { @@ -329,9 +264,9 @@ MmGetPageTableForProcess(PEPROCESS Process, PVOID Address, BOOLEAN Create) PageDir = MmCreateHyperspaceMapping(PTE_TO_PFN(Process->Pcb.DirectoryTableBase[0])); if (PageDir == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } - if (0 == InterlockedCompareExchangeUL(&PageDir[PdeOffset], 0, 0)) + if (0 == InterlockedCompareExchangePte(&PageDir[PdeOffset], 0, 0)) { if (Create == FALSE) { @@ -341,9 +276,9 @@ MmGetPageTableForProcess(PEPROCESS Process, PVOID Address, BOOLEAN Create) Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn); if (!NT_SUCCESS(Status) || Pfn == 0) { - KEBUGCHECK(0); + ASSERT(FALSE); } - Entry = InterlockedCompareExchangeUL(&PageDir[PdeOffset], PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE | PA_USER, 0); + Entry = InterlockedCompareExchangePte(&PageDir[PdeOffset], PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE | PA_USER, 0); if (Entry != 0) { MmReleasePageMemoryConsumer(MC_NPPOOL, Pfn); @@ -358,16 +293,16 @@ MmGetPageTableForProcess(PEPROCESS Process, PVOID Address, BOOLEAN Create) Pt = MmCreateHyperspaceMapping(Pfn); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } return Pt + ADDR_TO_PTE_OFFSET(Address); } PageDir = (PULONG)MiAddressToPde(Address); - if (0 == InterlockedCompareExchangeUL(PageDir, 0, 0)) + if (0 == InterlockedCompareExchangePte(PageDir, 0, 0)) { if (Address >= MmSystemRangeStart) { - if (0 == InterlockedCompareExchangeUL(&MmGlobalKernelPageDirectory[PdeOffset], 0, 0)) + if (0 == InterlockedCompareExchangePte(&MmGlobalKernelPageDirectory[PdeOffset], 0, 0)) { if (Create == FALSE) { @@ -376,19 +311,19 @@ MmGetPageTableForProcess(PEPROCESS Process, PVOID Address, BOOLEAN Create) Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn); if (!NT_SUCCESS(Status) || Pfn == 0) { - KEBUGCHECK(0); + ASSERT(FALSE); } Entry = PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE; if (Ke386GlobalPagesEnabled) { Entry |= PA_GLOBAL; } - if(0 != InterlockedCompareExchangeUL(&MmGlobalKernelPageDirectory[PdeOffset], Entry, 0)) + if(0 != InterlockedCompareExchangePte(&MmGlobalKernelPageDirectory[PdeOffset], Entry, 0)) { MmReleasePageMemoryConsumer(MC_NPPOOL, Pfn); } } - (void)InterlockedExchangeUL(PageDir, MmGlobalKernelPageDirectory[PdeOffset]); + InterlockedExchangePte(PageDir, MmGlobalKernelPageDirectory[PdeOffset]); } else { @@ -399,9 +334,9 @@ MmGetPageTableForProcess(PEPROCESS Process, PVOID Address, BOOLEAN Create) Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn); if (!NT_SUCCESS(Status) || Pfn == 0) { - KEBUGCHECK(0); + ASSERT(FALSE); } - Entry = InterlockedCompareExchangeUL(PageDir, PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE | PA_USER, 0); + Entry = InterlockedCompareExchangePte(PageDir, PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE | PA_USER, 0); if (Entry != 0) { MmReleasePageMemoryConsumer(MC_NPPOOL, Pfn); @@ -468,7 +403,7 @@ MmDisableVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN* WasDirty, PPF Pt = MmGetPageTableForProcess(Process, Address, FALSE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } /* * Atomically disable the present bit and get the old value. @@ -476,13 +411,13 @@ MmDisableVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN* WasDirty, PPF do { Pte = *Pt; - } while (Pte != InterlockedCompareExchangeUL(Pt, Pte & ~PA_PRESENT, Pte)); + } while (Pte != InterlockedCompareExchangePte(Pt, Pte & ~PA_PRESENT, Pte)); MiFlushTlb(Pt, Address); WasValid = (PAGE_MASK(Pte) != 0); if (!WasValid) { - KEBUGCHECK(0); + ASSERT(FALSE); } /* @@ -510,7 +445,7 @@ MmRawDeleteVirtualMapping(PVOID Address) /* * Set the entry to zero */ - (void)InterlockedExchangeUL(Pt, 0); + InterlockedExchangePte(Pt, 0); MiFlushTlb(Pt, Address); } } @@ -549,7 +484,7 @@ MmDeleteVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN FreePage, /* * Atomically set the entry to zero and get the old value. */ - Pte = InterlockedExchangeUL(Pt, 0); + Pte = InterlockedExchangePte(Pt, 0); MiFlushTlb(Pt, Address); @@ -604,7 +539,7 @@ MmDeletePageFileMapping(PEPROCESS Process, PVOID Address, /* * Atomically set the entry to zero and get the old value. */ - Pte = InterlockedExchangeUL(Pt, 0); + Pte = InterlockedExchangePte(Pt, 0); MiFlushTlb(Pt, Address); @@ -637,42 +572,6 @@ MmIsDirtyPage(PEPROCESS Process, PVOID Address) return MmGetPageEntryForProcess(Process, Address) & PA_DIRTY ? TRUE : FALSE; } -BOOLEAN -NTAPI -MmIsAccessedAndResetAccessPage(PEPROCESS Process, PVOID Address) -{ - PULONG Pt; - ULONG Pte; - - if (Address < MmSystemRangeStart && Process == NULL) - { - DPRINT1("MmIsAccessedAndResetAccessPage is called for user space without a process.\n"); - KEBUGCHECK(0); - } - - Pt = MmGetPageTableForProcess(Process, Address, FALSE); - if (Pt == NULL) - { - KEBUGCHECK(0); - } - - do - { - Pte = *Pt; - } while (Pte != InterlockedCompareExchangeUL(Pt, Pte & ~PA_ACCESSED, Pte)); - - if (Pte & PA_ACCESSED) - { - MiFlushTlb(Pt, Address); - return TRUE; - } - else - { - MmUnmapPageTable(Pt); - return FALSE; - } -} - VOID NTAPI MmSetCleanPage(PEPROCESS Process, PVOID Address) @@ -683,20 +582,20 @@ MmSetCleanPage(PEPROCESS Process, PVOID Address) if (Address < MmSystemRangeStart && Process == NULL) { DPRINT1("MmSetCleanPage is called for user space without a process.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } Pt = MmGetPageTableForProcess(Process, Address, FALSE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } do { Pte = *Pt; - } while (Pte != InterlockedCompareExchangeUL(Pt, Pte & ~PA_DIRTY, Pte)); + } while (Pte != InterlockedCompareExchangePte(Pt, Pte & ~PA_DIRTY, Pte)); if (Pte & PA_DIRTY) { @@ -718,19 +617,19 @@ MmSetDirtyPage(PEPROCESS Process, PVOID Address) if (Address < MmSystemRangeStart && Process == NULL) { DPRINT1("MmSetDirtyPage is called for user space without a process.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } Pt = MmGetPageTableForProcess(Process, Address, FALSE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } do { Pte = *Pt; - } while (Pte != InterlockedCompareExchangeUL(Pt, Pte | PA_DIRTY, Pte)); + } while (Pte != InterlockedCompareExchangePte(Pt, Pte | PA_DIRTY, Pte)); if (!(Pte & PA_DIRTY)) { MiFlushTlb(Pt, Address); @@ -751,13 +650,13 @@ MmEnableVirtualMapping(PEPROCESS Process, PVOID Address) Pt = MmGetPageTableForProcess(Process, Address, FALSE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } do { Pte = *Pt; - } while (Pte != InterlockedCompareExchangeUL(Pt, Pte | PA_PRESENT, Pte)); + } while (Pte != InterlockedCompareExchangePte(Pt, Pte | PA_PRESENT, Pte)); if (!(Pte & PA_PRESENT)) { MiFlushTlb(Pt, Address); @@ -805,7 +704,7 @@ MmCreateVirtualMappingForKernel(PVOID Address, if (Address < MmSystemRangeStart) { DPRINT1("MmCreateVirtualMappingForKernel is called for user space\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } Attributes = ProtectToPTE(flProtect); @@ -825,7 +724,7 @@ MmCreateVirtualMappingForKernel(PVOID Address, Pt = MmGetPageTableForProcess(NULL, Addr, TRUE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } Pt--; @@ -836,7 +735,7 @@ MmCreateVirtualMappingForKernel(PVOID Address, DPRINT1("Setting physical address but not allowing access at address " "0x%.8X with attributes %x/%x.\n", Addr, Attributes, flProtect); - KEBUGCHECK(0); + ASSERT(FALSE); } PdeOffset = ADDR_TO_PDE_OFFSET(Addr); @@ -845,7 +744,7 @@ MmCreateVirtualMappingForKernel(PVOID Address, Pt = MmGetPageTableForProcess(NULL, Addr, TRUE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } } else @@ -857,9 +756,9 @@ MmCreateVirtualMappingForKernel(PVOID Address, Pte = *Pt; if (Pte != 0) { - KEBUGCHECK(0); + ASSERT(FALSE); } - (void)InterlockedExchangeUL(Pt, PFN_TO_PTE(Pages[i]) | Attributes); + InterlockedExchangePte(Pt, PFN_TO_PTE(Pages[i]) | Attributes); } return(STATUS_SUCCESS); @@ -877,29 +776,29 @@ MmCreatePageFileMapping(PEPROCESS Process, if (Process == NULL && Address < MmSystemRangeStart) { DPRINT1("No process\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (Process != NULL && Address >= MmSystemRangeStart) { DPRINT1("Setting kernel address with process context\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (SwapEntry & (1 << 31)) { - KEBUGCHECK(0); + ASSERT(FALSE); } Pt = MmGetPageTableForProcess(Process, Address, TRUE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } Pte = *Pt; if (PAGE_MASK((Pte)) != 0) { MmMarkPageUnmapped(PTE_TO_PFN((Pte))); } - (void)InterlockedExchangeUL(Pt, SwapEntry << 1); + InterlockedExchangePte(Pt, SwapEntry << 1); if (Pte != 0) { MiFlushTlb(Pt, Address); @@ -937,13 +836,13 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, if (Address < MmSystemRangeStart) { DPRINT1("No process\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (PageCount > 0x10000 || (ULONG_PTR) Address / PAGE_SIZE + PageCount > 0x100000) { DPRINT1("Page count to large\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } } else @@ -951,14 +850,14 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, if (Address >= MmSystemRangeStart) { DPRINT1("Setting kernel address with process context\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (PageCount > (ULONG_PTR)MmSystemRangeStart / PAGE_SIZE || (ULONG_PTR) Address / PAGE_SIZE + PageCount > (ULONG_PTR)MmSystemRangeStart / PAGE_SIZE) { DPRINT1("Page Count to large\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } } @@ -990,7 +889,7 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, DPRINT1("Setting physical address but not allowing access at address " "0x%.8X with attributes %x/%x.\n", Addr, Attributes, flProtect); - KEBUGCHECK(0); + ASSERT(FALSE); } PdeOffset = ADDR_TO_PDE_OFFSET(Addr); if (oldPdeOffset != PdeOffset) @@ -999,7 +898,7 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, Pt = MmGetPageTableForProcess(Process, Addr, TRUE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } } else @@ -1012,13 +911,13 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, MmMarkPageMapped(Pages[i]); if (PAGE_MASK((Pte)) != 0 && !((Pte) & PA_PRESENT)) { - KEBUGCHECK(0); + ASSERT(FALSE); } if (PAGE_MASK((Pte)) != 0) { MmMarkPageUnmapped(PTE_TO_PFN((Pte))); } - (void)InterlockedExchangeUL(Pt, PFN_TO_PTE(Pages[i]) | Attributes); + InterlockedExchangePte(Pt, PFN_TO_PTE(Pages[i]) | Attributes); if (Pte != 0) { if (Address > MmSystemRangeStart || @@ -1051,7 +950,7 @@ MmCreateVirtualMapping(PEPROCESS Process, if (!MmIsPageInUse(Pages[i])) { DPRINT1("Page at address %x not in use\n", PFN_TO_PTE(Pages[i])); - KEBUGCHECK(0); + ASSERT(FALSE); } } @@ -1136,9 +1035,9 @@ MmSetPageProtect(PEPROCESS Process, PVOID Address, ULONG flProtect) Pt = MmGetPageTableForProcess(Process, Address, FALSE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } - InterlockedExchange((PLONG)Pt, PAGE_MASK(*Pt) | Attributes | (*Pt & (PA_ACCESSED|PA_DIRTY))); + InterlockedExchangePte(Pt, PAGE_MASK(*Pt) | Attributes | (*Pt & (PA_ACCESSED|PA_DIRTY))); MiFlushTlb(Pt, Address); } @@ -1200,7 +1099,7 @@ MmCreateHyperspaceMapping(PFN_TYPE Page) } if (i >= Page % 1024) { - KEBUGCHECK(0); + ASSERT(FALSE); } } } @@ -1225,7 +1124,7 @@ MmCreateHyperspaceMapping(PFN_TYPE Page) } if (i <= Page % 1024) { - KEBUGCHECK(0); + ASSERT(FALSE); } } } @@ -1234,22 +1133,6 @@ MmCreateHyperspaceMapping(PFN_TYPE Page) return Address; } -PFN_TYPE -NTAPI -MmChangeHyperspaceMapping(PVOID Address, PFN_TYPE NewPage) -{ - PFN_TYPE Pfn; - ULONG Entry; - - ASSERT (IS_HYPERSPACE(Address)); - - Entry = InterlockedExchange((PLONG)MiAddressToPte(Address), PFN_TO_PTE(NewPage) | PA_PRESENT | PA_READWRITE); - Pfn = PTE_TO_PFN(Entry); - - __invlpg(Address); - return Pfn; -} - PFN_TYPE NTAPI MmDeleteHyperspaceMapping(PVOID Address) @@ -1259,7 +1142,7 @@ MmDeleteHyperspaceMapping(PVOID Address) ASSERT (IS_HYPERSPACE(Address)); - Entry = InterlockedExchange((PLONG)MiAddressToPte(Address), 0); + Entry = InterlockedExchangePte(MiAddressToPte(Address), 0); Pfn = PTE_TO_PFN(Entry); __invlpg(Address); @@ -1275,7 +1158,7 @@ MmUpdatePageDir(PEPROCESS Process, PVOID Address, ULONG Size) if (Address < MmSystemRangeStart) { - KEBUGCHECK(0); + ASSERT(FALSE); } StartOffset = ADDR_TO_PDE_OFFSET(Address); @@ -1293,7 +1176,7 @@ MmUpdatePageDir(PEPROCESS Process, PVOID Address, ULONG Size) { if (Offset != ADDR_TO_PDE_OFFSET(PAGETABLE_MAP)) { - (void)InterlockedCompareExchangeUL(&Pde[Offset], MmGlobalKernelPageDirectory[Offset], 0); + InterlockedCompareExchangePte(&Pde[Offset], MmGlobalKernelPageDirectory[Offset], 0); } } if (Pde != (PULONG)PAGEDIRECTORY_MAP) @@ -1354,7 +1237,7 @@ MiInitPageDirectoryMap(VOID) BoundaryAddressMultiple); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } BaseAddress = (PVOID)HYPERSPACE; Status = MmCreateMemoryArea(MmGetKernelAddressSpace(), @@ -1368,7 +1251,7 @@ MiInitPageDirectoryMap(VOID) BoundaryAddressMultiple); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } } diff --git a/reactos/ntoskrnl/mm/i386/pagepae.c b/reactos/ntoskrnl/mm/i386/pagepae.c index 45ca9f32fd0..de52e2b8d4f 100644 --- a/reactos/ntoskrnl/mm/i386/pagepae.c +++ b/reactos/ntoskrnl/mm/i386/pagepae.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include #if defined (ALLOC_PRAGMA) #pragma alloc_text(INIT, MmInitGlobalKernelPageDirectory) @@ -145,7 +145,7 @@ ProtectToPTE(ULONG flProtect) else { DPRINT1("Unknown main protection type.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (Ke386NoExecute && !(flProtect & PAGE_IS_EXECUTABLE)) @@ -444,7 +444,7 @@ MmDeletePageTable(PEPROCESS Process, PVOID Address) } if (Address >= MmSystemRangeStart) { - KEBUGCHECK(0); + ASSERT(FALSE); // MmGlobalKernelPageDirectory[ADDR_TO_PDE_OFFSET(Address)] = 0; } if (Process != NULL && Process != CurrentProcess) @@ -477,7 +477,7 @@ MmFreePageTable(PEPROCESS Process, PVOID Address) { DbgPrint("Page table entry not clear at %x/%x (is %I64x)\n", ((ULONG)Address / (4*1024*1024)), i, PageTable[i]); - KEBUGCHECK(0); + ASSERT(FALSE); } } Pfn = PAE_PTE_TO_PFN(*(PAE_ADDR_TO_PDE(Address))); @@ -494,7 +494,7 @@ MmFreePageTable(PEPROCESS Process, PVOID Address) { DbgPrint("Page table entry not clear at %x/%x (is %x)\n", ((ULONG)Address / (4*1024*1024)), i, PageTable[i]); - KEBUGCHECK(0); + ASSERT(FALSE); } } Pfn = PTE_TO_PFN(*(ADDR_TO_PDE(Address))); @@ -505,7 +505,7 @@ MmFreePageTable(PEPROCESS Process, PVOID Address) if (Address >= MmSystemRangeStart) { // MmGlobalKernelPageDirectory[ADDR_TO_PDE_OFFSET(Address)] = 0; - KEBUGCHECK(0); + ASSERT(FALSE); } else { @@ -532,20 +532,20 @@ MmGetPageTableForProcessForPAE(PEPROCESS Process, PVOID Address, BOOLEAN Create) Process, Address, Create); if (Address >= (PVOID)PAGETABLE_MAP && Address < (PVOID)((ULONG_PTR)PAGETABLE_MAP + 0x800000)) { - KEBUGCHECK(0); + ASSERT(FALSE); } if (Address < MmSystemRangeStart && Process && Process != PsGetCurrentProcess()) { PageDirTable = MmCreateHyperspaceMapping(PAE_PTE_TO_PFN(Process->Pcb.DirectoryTableBase.QuadPart)); if (PageDirTable == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } PageDir = MmCreateHyperspaceMapping(PAE_PTE_TO_PFN(PageDirTable[PAE_ADDR_TO_PDTE_OFFSET(Address)])); MmDeleteHyperspaceMapping(PageDirTable); if (PageDir == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } PageDir += PAE_ADDR_TO_PDE_PAGE_OFFSET(Address); Entry = ExfInterlockedCompareExchange64UL(PageDir, &ZeroEntry, &ZeroEntry); @@ -559,7 +559,7 @@ MmGetPageTableForProcessForPAE(PEPROCESS Process, PVOID Address, BOOLEAN Create) Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } Entry = PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE | PA_USER; Entry = ExfInterlockedCompareExchange64UL(PageDir, &Entry, &ZeroEntry); @@ -577,7 +577,7 @@ MmGetPageTableForProcessForPAE(PEPROCESS Process, PVOID Address, BOOLEAN Create) Pt = MmCreateHyperspaceMapping(Pfn); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } return Pt + PAE_ADDR_TO_PTE_OFFSET(Address); } @@ -595,7 +595,7 @@ MmGetPageTableForProcessForPAE(PEPROCESS Process, PVOID Address, BOOLEAN Create) Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } Entry = PAE_PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE; if (Ke386GlobalPagesEnabled) @@ -618,7 +618,7 @@ MmGetPageTableForProcessForPAE(PEPROCESS Process, PVOID Address, BOOLEAN Create) Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } Entry = PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE | PA_USER; Entry = ExfInterlockedCompareExchange64UL(PageDir, &Entry, &ZeroEntry); @@ -645,7 +645,7 @@ MmGetPageTableForProcess(PEPROCESS Process, PVOID Address, BOOLEAN Create) PageDir = MmCreateHyperspaceMapping(PTE_TO_PFN(Process->Pcb.DirectoryTableBase.LowPart)); if (PageDir == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } if (0 == InterlockedCompareExchangeUL(&PageDir[PdeOffset], 0, 0)) { @@ -657,7 +657,7 @@ MmGetPageTableForProcess(PEPROCESS Process, PVOID Address, BOOLEAN Create) Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn); if (!NT_SUCCESS(Status) || Pfn == 0) { - KEBUGCHECK(0); + ASSERT(FALSE); } Entry = InterlockedCompareExchangeUL(&PageDir[PdeOffset], PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE | PA_USER, 0); if (Entry != 0) @@ -674,7 +674,7 @@ MmGetPageTableForProcess(PEPROCESS Process, PVOID Address, BOOLEAN Create) Pt = MmCreateHyperspaceMapping(Pfn); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } return Pt + ADDR_TO_PTE_OFFSET(Address); } @@ -692,7 +692,7 @@ MmGetPageTableForProcess(PEPROCESS Process, PVOID Address, BOOLEAN Create) Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn); if (!NT_SUCCESS(Status) || Pfn == 0) { - KEBUGCHECK(0); + ASSERT(FALSE); } Entry = PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE; if (Ke386GlobalPagesEnabled) @@ -715,7 +715,7 @@ MmGetPageTableForProcess(PEPROCESS Process, PVOID Address, BOOLEAN Create) Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn); if (!NT_SUCCESS(Status) || Pfn == 0) { - KEBUGCHECK(0); + ASSERT(FALSE); } Entry = InterlockedCompareExchangeUL(PageDir, PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE | PA_USER, 0); if (Entry != 0) @@ -825,7 +825,7 @@ MmDisableVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN* WasDirty, PPF Pt = MmGetPageTableForProcessForPAE(Process, Address, FALSE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } /* * Atomically disable the present bit and get the old value. @@ -840,7 +840,7 @@ MmDisableVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN* WasDirty, PPF WasValid = PAE_PAGE_MASK(Pte) != 0LL ? TRUE : FALSE; if (!WasValid) { - KEBUGCHECK(0); + ASSERT(FALSE); } /* @@ -863,7 +863,7 @@ MmDisableVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN* WasDirty, PPF Pt = MmGetPageTableForProcess(Process, Address, FALSE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } /* * Atomically disable the present bit and get the old value. @@ -877,7 +877,7 @@ MmDisableVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN* WasDirty, PPF WasValid = (PAGE_MASK(Pte) != 0); if (!WasValid) { - KEBUGCHECK(0); + ASSERT(FALSE); } /* @@ -1232,7 +1232,7 @@ MmIsAccessedAndResetAccessPage(PEPROCESS Process, PVOID Address) if (Address < MmSystemRangeStart && Process == NULL) { DPRINT1("MmIsAccessedAndResetAccessPage is called for user space without a process.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (Ke386Pae) { @@ -1243,7 +1243,7 @@ MmIsAccessedAndResetAccessPage(PEPROCESS Process, PVOID Address) Pt = MmGetPageTableForProcessForPAE(Process, Address, FALSE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } do @@ -1271,7 +1271,7 @@ MmIsAccessedAndResetAccessPage(PEPROCESS Process, PVOID Address) Pt = MmGetPageTableForProcess(Process, Address, FALSE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } do @@ -1299,7 +1299,7 @@ MmSetCleanPage(PEPROCESS Process, PVOID Address) if (Address < MmSystemRangeStart && Process == NULL) { DPRINT1("MmSetCleanPage is called for user space without a process.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (Ke386Pae) { @@ -1311,7 +1311,7 @@ MmSetCleanPage(PEPROCESS Process, PVOID Address) if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } do @@ -1338,7 +1338,7 @@ MmSetCleanPage(PEPROCESS Process, PVOID Address) if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } do @@ -1364,7 +1364,7 @@ MmSetDirtyPage(PEPROCESS Process, PVOID Address) if (Address < MmSystemRangeStart && Process == NULL) { DPRINT1("MmSetDirtyPage is called for user space without a process.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (Ke386Pae) { @@ -1375,7 +1375,7 @@ MmSetDirtyPage(PEPROCESS Process, PVOID Address) Pt = MmGetPageTableForProcessForPAE(Process, Address, FALSE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } do @@ -1400,7 +1400,7 @@ MmSetDirtyPage(PEPROCESS Process, PVOID Address) Pt = MmGetPageTableForProcess(Process, Address, FALSE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } do @@ -1431,7 +1431,7 @@ MmEnableVirtualMapping(PEPROCESS Process, PVOID Address) Pt = MmGetPageTableForProcessForPAE(Process, Address, FALSE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } do @@ -1456,7 +1456,7 @@ MmEnableVirtualMapping(PEPROCESS Process, PVOID Address) Pt = MmGetPageTableForProcess(Process, Address, FALSE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } do @@ -1525,7 +1525,7 @@ MmCreateVirtualMappingForKernel(PVOID Address, if (Address < MmSystemRangeStart) { DPRINT1("MmCreateVirtualMappingForKernel is called for user space\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } Attributes = ProtectToPTE(flProtect); @@ -1554,7 +1554,7 @@ MmCreateVirtualMappingForKernel(PVOID Address, DPRINT1("Setting physical address but not allowing access at address " "0x%.8X with attributes %x/%x.\n", Addr, Attributes, flProtect); - KEBUGCHECK(0); + ASSERT(FALSE); } PdeOffset = PAE_ADDR_TO_PDE_OFFSET(Addr); @@ -1563,7 +1563,7 @@ MmCreateVirtualMappingForKernel(PVOID Address, Pt = MmGetPageTableForProcessForPAE(NULL, Addr, TRUE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } } else @@ -1580,7 +1580,7 @@ MmCreateVirtualMappingForKernel(PVOID Address, Pte = ExfpInterlockedExchange64UL(Pt, &Pte); if (Pte != 0LL) { - KEBUGCHECK(0); + ASSERT(FALSE); } } } @@ -1593,7 +1593,7 @@ MmCreateVirtualMappingForKernel(PVOID Address, Pt = MmGetPageTableForProcess(NULL, Addr, TRUE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } Pt--; @@ -1604,7 +1604,7 @@ MmCreateVirtualMappingForKernel(PVOID Address, DPRINT1("Setting physical address but not allowing access at address " "0x%.8X with attributes %x/%x.\n", Addr, Attributes, flProtect); - KEBUGCHECK(0); + ASSERT(FALSE); } PdeOffset = ADDR_TO_PDE_OFFSET(Addr); @@ -1613,7 +1613,7 @@ MmCreateVirtualMappingForKernel(PVOID Address, Pt = MmGetPageTableForProcess(NULL, Addr, TRUE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } } else @@ -1625,7 +1625,7 @@ MmCreateVirtualMappingForKernel(PVOID Address, Pte = *Pt; if (Pte != 0) { - KEBUGCHECK(0); + ASSERT(FALSE); } (void)InterlockedExchangeUL(Pt, PFN_TO_PTE(Pages[i]) | Attributes); } @@ -1643,16 +1643,16 @@ MmCreatePageFileMapping(PEPROCESS Process, if (Process == NULL && Address < MmSystemRangeStart) { DPRINT1("No process\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (Process != NULL && Address >= MmSystemRangeStart) { DPRINT1("Setting kernel address with process context\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (SwapEntry & (1 << 31)) { - KEBUGCHECK(0); + ASSERT(FALSE); } if (Ke386Pae) @@ -1664,7 +1664,7 @@ MmCreatePageFileMapping(PEPROCESS Process, Pt = MmGetPageTableForProcessForPAE(Process, Address, TRUE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } tmpPte = SwapEntry << 1; Pte = ExfpInterlockedExchange64UL(Pt, &tmpPte); @@ -1690,7 +1690,7 @@ MmCreatePageFileMapping(PEPROCESS Process, Pt = MmGetPageTableForProcess(Process, Address, TRUE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } Pte = *Pt; if (PAGE_MASK((Pte)) != 0) @@ -1744,13 +1744,13 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, if (Address < MmSystemRangeStart) { DPRINT1("No process\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (PageCount > 0x10000 || (ULONG_PTR) Address / PAGE_SIZE + PageCount > 0x100000) { DPRINT1("Page count to large\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } } else @@ -1758,14 +1758,14 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, if (Address >= MmSystemRangeStart) { DPRINT1("Setting kernel address with process context\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (PageCount > (ULONG_PTR)MmSystemRangeStart / PAGE_SIZE || (ULONG_PTR) Address / PAGE_SIZE + PageCount > (ULONG_PTR)MmSystemRangeStart / PAGE_SIZE) { DPRINT1("Page Count to large\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } } @@ -1803,7 +1803,7 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, DPRINT1("Setting physical address but not allowing access at address " "0x%.8X with attributes %x/%x.\n", Addr, Attributes, flProtect); - KEBUGCHECK(0); + ASSERT(FALSE); } PdeOffset = PAE_ADDR_TO_PDE_OFFSET(Addr); if (oldPdeOffset != PdeOffset) @@ -1812,7 +1812,7 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, Pt = MmGetPageTableForProcessForPAE(Process, Addr, TRUE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } } else @@ -1830,7 +1830,7 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, Pte = ExfpInterlockedExchange64UL(Pt, &tmpPte); if (PAE_PAGE_MASK((Pte)) != 0LL && !((Pte) & PA_PRESENT)) { - KEBUGCHECK(0); + ASSERT(FALSE); } if (PAE_PAGE_MASK((Pte)) != 0LL) { @@ -1872,7 +1872,7 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, DPRINT1("Setting physical address but not allowing access at address " "0x%.8X with attributes %x/%x.\n", Addr, Attributes, flProtect); - KEBUGCHECK(0); + ASSERT(FALSE); } PdeOffset = ADDR_TO_PDE_OFFSET(Addr); if (oldPdeOffset != PdeOffset) @@ -1881,7 +1881,7 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, Pt = MmGetPageTableForProcess(Process, Addr, TRUE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } } else @@ -1894,7 +1894,7 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, MmMarkPageMapped(Pages[i]); if (PAGE_MASK((Pte)) != 0 && !((Pte) & PA_PRESENT)) { - KEBUGCHECK(0); + ASSERT(FALSE); } if (PAGE_MASK((Pte)) != 0) { @@ -1943,7 +1943,7 @@ MmCreateVirtualMapping(PEPROCESS Process, if (!MmIsPageInUse(Pages[i])) { DPRINT1("Page at address %x not in use\n", PFN_TO_PTE(Pages[i])); - KEBUGCHECK(0); + ASSERT(FALSE); } } @@ -2037,7 +2037,7 @@ MmSetPageProtect(PEPROCESS Process, PVOID Address, ULONG flProtect) if (Pt == NULL) { DPRINT1("Address %x\n", Address); - KEBUGCHECK(0); + ASSERT(FALSE); } do { @@ -2062,7 +2062,7 @@ MmSetPageProtect(PEPROCESS Process, PVOID Address, ULONG flProtect) Pt = MmGetPageTableForProcess(Process, Address, FALSE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } InterlockedExchange((PLONG)Pt, PAGE_MASK(*Pt) | Attributes | (*Pt & (PA_ACCESSED|PA_DIRTY))); MiFlushTlb(Pt, Address); @@ -2149,7 +2149,7 @@ MmCreateHyperspaceMapping(PFN_TYPE Page) } if (i >= Page % 1024) { - KEBUGCHECK(0); + ASSERT(FALSE); } } } @@ -2174,7 +2174,7 @@ MmCreateHyperspaceMapping(PFN_TYPE Page) } if (i <= Page % 1024) { - KEBUGCHECK(0); + ASSERT(FALSE); } } } @@ -2206,7 +2206,7 @@ MmCreateHyperspaceMapping(PFN_TYPE Page) } if (i >= Page % 1024) { - KEBUGCHECK(0); + ASSERT(FALSE); } } } @@ -2231,7 +2231,7 @@ MmCreateHyperspaceMapping(PFN_TYPE Page) } if (i <= Page % 1024) { - KEBUGCHECK(0); + ASSERT(FALSE); } } } @@ -2293,7 +2293,7 @@ MmUpdatePageDir(PEPROCESS Process, PVOID Address, ULONG Size) if (Address < MmSystemRangeStart) { - KEBUGCHECK(0); + ASSERT(FALSE); } if (Ke386Pae) { @@ -2450,7 +2450,7 @@ MiInitPageDirectoryMap(VOID) BoundaryAddressMultiple); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } BaseAddress = (PVOID)HYPERSPACE; Status = MmCreateMemoryArea(MmGetKernelAddressSpace(), @@ -2464,7 +2464,7 @@ MiInitPageDirectoryMap(VOID) BoundaryAddressMultiple); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } } diff --git a/reactos/ntoskrnl/mm/iospace.c b/reactos/ntoskrnl/mm/iospace.c index 2e78a2f7d0e..9d90746901b 100644 --- a/reactos/ntoskrnl/mm/iospace.c +++ b/reactos/ntoskrnl/mm/iospace.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include /* FUNCTIONS *****************************************************************/ @@ -104,7 +104,7 @@ MmMapIoSpace (IN PHYSICAL_ADDRESS PhysicalAddress, if (!NT_SUCCESS(Status)) { DbgPrint("Unable to create virtual mapping\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } } return (PVOID)((ULONG_PTR)Result + Offset); diff --git a/reactos/ntoskrnl/mm/kmap.c b/reactos/ntoskrnl/mm/kmap.c index 7cd2794dd6e..16ee67007f6 100644 --- a/reactos/ntoskrnl/mm/kmap.c +++ b/reactos/ntoskrnl/mm/kmap.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include /* GLOBALS *****************************************************************/ diff --git a/reactos/ntoskrnl/mm/marea.c b/reactos/ntoskrnl/mm/marea.c index 0dee681e585..87763493466 100644 --- a/reactos/ntoskrnl/mm/marea.c +++ b/reactos/ntoskrnl/mm/marea.c @@ -43,7 +43,7 @@ #include #define NDEBUG -#include +#include #if defined (ALLOC_PRAGMA) #pragma alloc_text(INIT, MmInitMemoryAreas) @@ -899,7 +899,7 @@ MmFreeMemoryAreaByPtr( BaseAddress); if (MemoryArea == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); return(STATUS_UNSUCCESSFUL); } @@ -978,14 +978,12 @@ MmCreateMemoryArea(PMM_AVL_TABLE AddressSpace, if (!MmGetAddressSpaceOwner(AddressSpace) && *BaseAddress < MmSystemRangeStart) { - CHECKPOINT; return STATUS_ACCESS_VIOLATION; } if (MmGetAddressSpaceOwner(AddressSpace) && (ULONG_PTR)(*BaseAddress) + tmpLength > (ULONG_PTR)MmSystemRangeStart) { - CHECKPOINT; return STATUS_ACCESS_VIOLATION; } @@ -1041,7 +1039,7 @@ MmMapMemoryArea(PVOID BaseAddress, if (!NT_SUCCESS(Status)) { DPRINT1("Unable to allocate page\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } Status = MmCreateVirtualMapping (NULL, (PVOID)((ULONG_PTR)BaseAddress + (i * PAGE_SIZE)), @@ -1051,7 +1049,7 @@ MmMapMemoryArea(PVOID BaseAddress, if (!NT_SUCCESS(Status)) { DPRINT1("Unable to create virtual mapping\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } } } diff --git a/reactos/ntoskrnl/mm/mdlsup.c b/reactos/ntoskrnl/mm/mdlsup.c index bf6cdda206d..b6290237479 100644 --- a/reactos/ntoskrnl/mm/mdlsup.c +++ b/reactos/ntoskrnl/mm/mdlsup.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include #if defined (ALLOC_PRAGMA) #pragma alloc_text(INIT, MmInitializeMdlImplementation) @@ -57,7 +57,7 @@ MmInitializeMdlImplementation(VOID) if (!NT_SUCCESS(Status)) { MmUnlockAddressSpace(MmGetKernelAddressSpace()); - KEBUGCHECK(0); + ASSERT(FALSE); } MmUnlockAddressSpace(MmGetKernelAddressSpace()); @@ -692,7 +692,7 @@ MmMapLockedPagesSpecifyCache(IN PMDL Mdl, { return NULL; } - KEBUGCHECK(0); + ASSERT(FALSE); } Base = (PVOID)((ULONG_PTR)MiMdlMappingRegionBase + StartingOffset * PAGE_SIZE); if (MiMdlMappingRegionHint == StartingOffset) MiMdlMappingRegionHint += PageCount; diff --git a/reactos/ntoskrnl/mm/mm.c b/reactos/ntoskrnl/mm/mm.c index 860469eb1c5..36a196f9fb2 100644 --- a/reactos/ntoskrnl/mm/mm.c +++ b/reactos/ntoskrnl/mm/mm.c @@ -10,7 +10,7 @@ #include #define NDEBUG -#include +#include /* GLOBALS *****************************************************************/ @@ -26,15 +26,31 @@ MM_STATS MmStats; VOID FASTCALL -MiSyncThreadProcessViews(IN PKTHREAD NextThread) +MiSyncForProcessAttach(IN PKTHREAD Thread, + IN PEPROCESS Process) { - /* Hack Sync because Mm is broken */ - MmUpdatePageDir(PsGetCurrentProcess(), - ((PETHREAD)NextThread)->ThreadsProcess, - sizeof(EPROCESS)); - MmUpdatePageDir(PsGetCurrentProcess(), - (PVOID)((PETHREAD)NextThread)->Tcb.StackLimit, - NextThread->LargeStack ? + PETHREAD Ethread = CONTAINING_RECORD(Thread, ETHREAD, Tcb); + + /* Hack Sync because Mm is broken */ + MmUpdatePageDir(Process, Ethread->ThreadsProcess, sizeof(EPROCESS)); + MmUpdatePageDir(Process, + (PVOID)Thread->StackLimit, + Thread->LargeStack ? + KERNEL_LARGE_STACK_SIZE : KERNEL_STACK_SIZE); +} + +VOID +FASTCALL +MiSyncForContextSwitch(IN PKTHREAD Thread) +{ + PVOID Process = PsGetCurrentProcess(); + PETHREAD Ethread = CONTAINING_RECORD(Thread, ETHREAD, Tcb); + + /* Hack Sync because Mm is broken */ + MmUpdatePageDir(Process, Ethread->ThreadsProcess, sizeof(EPROCESS)); + MmUpdatePageDir(Process, + (PVOID)Thread->StackLimit, + Thread->LargeStack ? KERNEL_LARGE_STACK_SIZE : KERNEL_STACK_SIZE); } @@ -101,7 +117,7 @@ MmpAccessFault(KPROCESSOR_MODE Mode, if (KeGetCurrentIrql() >= DISPATCH_LEVEL) { - CPRINT("Page fault at high IRQL was %d\n", KeGetCurrentIrql()); + DPRINT1("Page fault at high IRQL was %d\n", KeGetCurrentIrql()); return(STATUS_UNSUCCESSFUL); } if (PsGetCurrentProcess() == NULL) @@ -203,7 +219,7 @@ MmNotPresentFault(KPROCESSOR_MODE Mode, if (KeGetCurrentIrql() >= DISPATCH_LEVEL) { - CPRINT("Page fault at high IRQL was %d, address %x\n", KeGetCurrentIrql(), Address); + DPRINT1("Page fault at high IRQL was %d, address %x\n", KeGetCurrentIrql(), Address); return(STATUS_UNSUCCESSFUL); } @@ -217,7 +233,7 @@ MmNotPresentFault(KPROCESSOR_MODE Mode, */ if (Mode != KernelMode) { - CPRINT("Address: %x\n", Address); + DPRINT1("Address: %x\n", Address); return(STATUS_ACCESS_VIOLATION); } AddressSpace = MmGetKernelAddressSpace(); @@ -364,6 +380,31 @@ MmCommitPagedPoolAddress(PVOID Address, BOOLEAN Locked) /* Miscellanea functions: they may fit somewhere else */ +/* + * @implemented + */ +BOOLEAN +NTAPI +MmIsRecursiveIoFault (VOID) +{ + PETHREAD Thread = PsGetCurrentThread(); + + return (Thread->DisablePageFaultClustering | Thread->ForwardClusterOnly); +} + +/* + * @unimplemented + */ +NTSTATUS +NTAPI +MmMapUserAddressesToPage(IN PVOID BaseAddress, + IN SIZE_T NumberOfBytes, + IN PVOID PageAddress) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + /* * @unimplemented */ diff --git a/reactos/ntoskrnl/mm/mminit.c b/reactos/ntoskrnl/mm/mminit.c index 327a0d66762..e0b6306d509 100644 --- a/reactos/ntoskrnl/mm/mminit.c +++ b/reactos/ntoskrnl/mm/mminit.c @@ -10,7 +10,7 @@ #include #define NDEBUG -#include +#include /* GLOBALS *******************************************************************/ diff --git a/reactos/ntoskrnl/mm/mpw.c b/reactos/ntoskrnl/mm/mpw.c index b17199858f2..d96b13a59e4 100644 --- a/reactos/ntoskrnl/mm/mpw.c +++ b/reactos/ntoskrnl/mm/mpw.c @@ -12,7 +12,7 @@ #include #define NDEBUG -#include +#include /* GLOBALS *******************************************************************/ @@ -71,7 +71,7 @@ MmMpwThreadMain(PVOID Ignored) if (!NT_SUCCESS(Status)) { DbgPrint("MpwThread: Wait failed\n"); - KEBUGCHECK(0); + ASSERT(FALSE); return(STATUS_UNSUCCESSFUL); } if (MpwThreadShouldTerminate) diff --git a/reactos/ntoskrnl/mm/ncache.c b/reactos/ntoskrnl/mm/ncache.c index 947b2fcc79f..9941a8e0045 100644 --- a/reactos/ntoskrnl/mm/ncache.c +++ b/reactos/ntoskrnl/mm/ncache.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/ntoskrnl/mm/npool.c b/reactos/ntoskrnl/mm/npool.c index f0c8cc4551b..08629b3e0aa 100644 --- a/reactos/ntoskrnl/mm/npool.c +++ b/reactos/ntoskrnl/mm/npool.c @@ -13,7 +13,7 @@ #include #define NDEBUG -#include +#include #if defined (ALLOC_PRAGMA) #pragma alloc_text(INIT, MiInitializeNonPagedPool) @@ -936,7 +936,7 @@ static void validate_free_list(void) { DbgPrint("Bad block magic (probable pool corruption) at %x\n", current); - KEBUGCHECK(/*KBUG_POOL_FREE_LIST_CORRUPT*/0); + ASSERT(FALSE); } if (base_addr < MiNonPagedPoolStart || @@ -946,13 +946,13 @@ static void validate_free_list(void) DbgPrint("Size %d\n",current->hdr.Size); DbgPrint("Limits are %x %x\n",MiNonPagedPoolStart, (ULONG_PTR)MiNonPagedPoolStart+MiNonPagedPoolLength); - KEBUGCHECK(/*KBUG_POOL_FREE_LIST_CORRUPT*/0); + ASSERT(FALSE); } blocks_seen++; if (blocks_seen > EiNrFreeBlocks) { DbgPrint("Too many blocks on free list\n"); - KEBUGCHECK(/*KBUG_POOL_FREE_LIST_CORRUPT*/0); + ASSERT(FALSE); } p = avl_get_next(FreeBlockListRoot, p); } @@ -979,7 +979,7 @@ static void validate_used_list(void) { DbgPrint("Bad block magic (probable pool corruption) at %x\n", current); - KEBUGCHECK(/*KBUG_POOL_FREE_LIST_CORRUPT*/0); + ASSERT(FALSE); } if (base_addr < MiNonPagedPoolStart || ((ULONG_PTR)base_addr+current->hdr.Size) > @@ -989,13 +989,13 @@ static void validate_used_list(void) DbgPrint("Size %d\n",current->hdr.Size); DbgPrint("Limits are %x %x\n",MiNonPagedPoolStart, (ULONG_PTR)MiNonPagedPoolStart+MiNonPagedPoolLength); - KEBUGCHECK(/*KBUG_POOL_FREE_LIST_CORRUPT*/0); + ASSERT(FALSE); } blocks_seen++; if (blocks_seen > EiNrUsedBlocks) { DbgPrint("Too many blocks on used list\n"); - KEBUGCHECK(/*KBUG_POOL_FREE_LIST_CORRUPT*/0); + ASSERT(FALSE); } if (current->ListEntry.Flink != &UsedBlockListHead && current->ListEntry.Flink->Blink != ¤t->ListEntry) @@ -1004,7 +1004,7 @@ static void validate_used_list(void) "current->next->previous %x)\n", __FILE__,__LINE__,current, current->ListEntry.Flink, current->ListEntry.Flink->Blink); - KEBUGCHECK(/*KBUG_POOL_FREE_LIST_CORRUPT*/0); + ASSERT(FALSE); } current_entry = current_entry->Flink; @@ -1035,19 +1035,19 @@ static void check_duplicates(HDR* blk) { DbgPrint("Bad block magic (probable pool corruption) at %x\n", free); - KEBUGCHECK(/*KBUG_POOL_FREE_LIST_CORRUPT*/0); + ASSERT(FALSE); } if ( (ULONG_PTR)free > base && (ULONG_PTR)free < last ) { DbgPrint("intersecting blocks on list\n"); - KEBUGCHECK(/*KBUG_POOL_FREE_LIST_CORRUPT*/0); + ASSERT(FALSE); } if ( (ULONG_PTR)free < base && ((ULONG_PTR)free + free->hdr.Size) > base ) { DbgPrint("intersecting blocks on list\n"); - KEBUGCHECK(/*KBUG_POOL_FREE_LIST_CORRUPT*/0); + ASSERT(FALSE); } p = avl_get_next(FreeBlockListRoot, p); } @@ -1060,13 +1060,13 @@ static void check_duplicates(HDR* blk) if ( (ULONG_PTR)used > base && (ULONG_PTR)used < last ) { DbgPrint("intersecting blocks on list\n"); - KEBUGCHECK(/*KBUG_POOL_FREE_LIST_CORRUPT*/0); + ASSERT(FALSE); } if ( (ULONG_PTR)used < base && ((ULONG_PTR)used + used->hdr.Size) > base ) { DbgPrint("intersecting blocks on list\n"); - KEBUGCHECK(/*KBUG_POOL_FREE_LIST_CORRUPT*/0); + ASSERT(FALSE); } current_entry = current_entry->Flink; @@ -1460,7 +1460,7 @@ ExRosQueryNonPagedPoolTag ( PVOID Addr ) { HDR_USED* blk=(HDR_USED*)((ULONG_PTR)Addr - HDR_USED_SIZE); if (blk->hdr.Magic != BLOCK_HDR_USED_MAGIC) - KEBUGCHECK(0); + ASSERT(FALSE); return blk->Tag; } @@ -1510,7 +1510,7 @@ void check_redzone_header(HDR_USED* hdr) DbgPrint("NPPOL: High-side redzone overwritten, Block %x, Size %d, Tag %x(%s), Caller %x\n", (ULONG_PTR)hdr + HDR_USED_SIZE, hdr->UserSize, hdr->Tag, c, hdr->Caller); } - KEBUGCHECK(0); + ASSERT(FALSE); } } #endif @@ -1556,14 +1556,12 @@ VOID STDCALL ExFreeNonPagedPool (PVOID block) { if (blk->hdr.Magic == BLOCK_HDR_FREE_MAGIC) { - DbgPrint("ExFreePool of already freed address %x\n", block); + KeBugCheckEx(BAD_POOL_CALLER, 0x07, 0, (ULONG_PTR)blk, (ULONG_PTR)block); } else { - DbgPrint("ExFreePool of non-allocated address %x (magic %x)\n", - block, blk->hdr.Magic); + KeBugCheckEx(BAD_POOL_CALLER, 0x46, (ULONG_PTR)block, 0, 0); } - KEBUGCHECK(0); return; } @@ -1684,6 +1682,12 @@ ExAllocateNonPagedPoolWithTag(POOL_TYPE Type, ULONG Size, ULONG Tag, PVOID Calle return(block); } +ULONG NTAPI +EiGetNonPagedPoolTag(PVOID Block) +{ + return ((HDR_USED*)((ULONG_PTR)Block - HDR_USED_SIZE))->Tag; +} + VOID INIT_FUNCTION NTAPI @@ -1724,7 +1728,7 @@ MiInitializeNonPagedPool(VOID) if (!NT_SUCCESS(Status)) { DbgPrint("Unable to allocate a page\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } Status = MmCreateVirtualMapping(NULL, @@ -1735,7 +1739,7 @@ MiInitializeNonPagedPool(VOID) if (!NT_SUCCESS(Status)) { DbgPrint("Unable to create virtual mapping\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } Address = (PVOID)((ULONG_PTR)Address + PAGE_SIZE); } diff --git a/reactos/ntoskrnl/mm/pagefile.c b/reactos/ntoskrnl/mm/pagefile.c index 4188bb13e7e..3d27c249a1c 100644 --- a/reactos/ntoskrnl/mm/pagefile.c +++ b/reactos/ntoskrnl/mm/pagefile.c @@ -29,7 +29,7 @@ #include #define NDEBUG -#include +#include #if defined (ALLOC_PRAGMA) #pragma alloc_text(INIT, MmInitPagingFile) @@ -205,7 +205,7 @@ MmGetOffsetPageFile(PRETRIEVAL_POINTERS_BUFFER RetrievalPointers, LARGE_INTEGER first = mid + 1; } } - KEBUGCHECK(0); + ASSERT(FALSE); #if defined(__GNUC__) return (LARGE_INTEGER)0LL; @@ -237,7 +237,7 @@ MmWriteToSwapPage(SWAPENTRY SwapEntry, PFN_TYPE Page) if (SwapEntry == 0) { - KEBUGCHECK(0); + ASSERT(FALSE); return(STATUS_UNSUCCESSFUL); } @@ -247,13 +247,13 @@ MmWriteToSwapPage(SWAPENTRY SwapEntry, PFN_TYPE Page) if (i >= MAX_PAGING_FILES) { DPRINT1("Bad swap entry 0x%.8X\n", SwapEntry); - KEBUGCHECK(0); + ASSERT(FALSE); } if (PagingFileList[i]->FileObject == NULL || PagingFileList[i]->FileObject->DeviceObject == NULL) { DPRINT1("Bad paging file 0x%.8X\n", SwapEntry); - KEBUGCHECK(0); + ASSERT(FALSE); } MmInitializeMdl(Mdl, NULL, PAGE_SIZE); @@ -298,7 +298,7 @@ MmReadFromSwapPage(SWAPENTRY SwapEntry, PFN_TYPE Page) if (SwapEntry == 0) { - KEBUGCHECK(0); + ASSERT(FALSE); return(STATUS_UNSUCCESSFUL); } @@ -308,13 +308,13 @@ MmReadFromSwapPage(SWAPENTRY SwapEntry, PFN_TYPE Page) if (i >= MAX_PAGING_FILES) { DPRINT1("Bad swap entry 0x%.8X\n", SwapEntry); - KEBUGCHECK(0); + ASSERT(FALSE); } if (PagingFileList[i]->FileObject == NULL || PagingFileList[i]->FileObject->DeviceObject == NULL) { DPRINT1("Bad paging file 0x%.8X\n", SwapEntry); - KEBUGCHECK(0); + ASSERT(FALSE); } MmInitializeMdl(Mdl, NULL, PAGE_SIZE); @@ -450,13 +450,13 @@ MmFreeSwapPage(SWAPENTRY Entry) if (i >= MAX_PAGING_FILES) { DPRINT1("Bad swap entry 0x%.8X\n", Entry); - KEBUGCHECK(0); + ASSERT(FALSE); } KeAcquireSpinLock(&PagingFileListLock, &oldIrql); if (PagingFileList[i] == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } KeAcquireSpinLockAtDpcLevel(&PagingFileList[i]->AllocMapLock); @@ -504,7 +504,7 @@ MmAllocSwapPage(VOID) off = MiAllocPageFromPagingFile(PagingFileList[i]); if (off == 0xFFFFFFFF) { - KEBUGCHECK(0); + ASSERT(FALSE); KeReleaseSpinLock(&PagingFileListLock, oldIrql); return(STATUS_UNSUCCESSFUL); } @@ -518,7 +518,7 @@ MmAllocSwapPage(VOID) } KeReleaseSpinLock(&PagingFileListLock, oldIrql); - KEBUGCHECK(0); + ASSERT(FALSE); return(0); } @@ -694,6 +694,7 @@ MmInitializeCrashDump(HANDLE PageFileHandle, ULONG PageFileNum) ANSI_STRING ProcName; PIO_STACK_LOCATION StackPtr; PLDR_DATA_TABLE_ENTRY ModuleObject = NULL; + PVOID BaseAddress; Status = ZwFsControlFile(PageFileHandle, 0, @@ -766,13 +767,13 @@ MmInitializeCrashDump(HANDLE PageFileHandle, ULONG PageFileNum) } /* Load the diskdump driver. */ - Status = MmLoadSystemImage(&DiskDumpName, NULL, NULL, 0, (PVOID)&ModuleObject, NULL); + Status = MmLoadSystemImage(&DiskDumpName, NULL, NULL, 0, (PVOID)&ModuleObject, &BaseAddress); if (ModuleObject == NULL) { return(STATUS_OBJECT_NAME_NOT_FOUND); } RtlInitAnsiString(&ProcName, "DiskDumpFunctions"); - MmCoreDumpFunctions = MiFindExportedRoutineByName(ModuleObject->DllBase, + MmCoreDumpFunctions = MiFindExportedRoutineByName(BaseAddress, &ProcName); if (!NT_SUCCESS(Status)) { diff --git a/reactos/ntoskrnl/mm/pageop.c b/reactos/ntoskrnl/mm/pageop.c index deb4d128bd3..a0d0eb2eb0c 100644 --- a/reactos/ntoskrnl/mm/pageop.c +++ b/reactos/ntoskrnl/mm/pageop.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include #if defined (ALLOC_PRAGMA) #pragma alloc_text(INIT, MmInitializePageOp) @@ -66,7 +66,7 @@ MmReleasePageOp(PMM_PAGEOP PageOp) PrevPageOp = PrevPageOp->Next; } KeReleaseSpinLock(&MmPageOpHashTableLock, oldIrql); - KEBUGCHECK(0); + ASSERT(FALSE); } PMM_PAGEOP @@ -211,7 +211,7 @@ MmGetPageOp(PMEMORY_AREA MArea, HANDLE Pid, PVOID Address, if (PageOp == NULL) { KeReleaseSpinLock(&MmPageOpHashTableLock, oldIrql); - KEBUGCHECK(0); + ASSERT(FALSE); return(NULL); } diff --git a/reactos/ntoskrnl/mm/pager.c b/reactos/ntoskrnl/mm/pager.c deleted file mode 100644 index 793d73df328..00000000000 --- a/reactos/ntoskrnl/mm/pager.c +++ /dev/null @@ -1,109 +0,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/mm/pager.c - * PURPOSE: Moves infrequently used data out of memory - * - * PROGRAMMERS: David Welch (welch@cwcom.net) - */ - -/* INCLUDES ****************************************************************/ - -#include -#define NDEBUG -#include - -/* GLOBALS *******************************************************************/ - -#if 0 -static HANDLE PagerThreadHandle; -static CLIENT_ID PagerThreadId; -static KEVENT PagerThreadEvent; -static BOOLEAN PagerThreadShouldTerminate; -static ULONG PagerThreadWorkCount; -#endif - -/* FUNCTIONS *****************************************************************/ - -#if 0 -BOOLEAN -MiIsPagerThread(VOID) -{ - return(PsGetCurrentThreadId() == PagerThreadId.UniqueThread); -} - -VOID -MiStartPagerThread(VOID) -{ - ULONG WasWorking; - - WasWorking = InterlockedIncrement(&PagerThreadWorkCount); - if (WasWorking == 1) - { - KeSetEvent(&PagerThreadEvent, IO_NO_INCREMENT, FALSE); - } -} - -VOID -MiStopPagerThread(VOID) -{ - (VOID)InterlockedDecrement(&PagerThreadWorkCount); -} - -static NTSTATUS STDCALL -MmPagerThreadMain(PVOID Ignored) -{ - NTSTATUS Status; - - for(;;) - { - /* Wake for a low memory situation or a terminate request. */ - Status = KeWaitForSingleObject(&PagerThreadEvent, - 0, - KernelMode, - FALSE, - NULL); - if (!NT_SUCCESS(Status)) - { - DbgPrint("PagerThread: Wait failed\n"); - KEBUGCHECK(0); - } - if (PagerThreadShouldTerminate) - { - DbgPrint("PagerThread: Terminating\n"); - return(STATUS_SUCCESS); - } - do - { - /* Try and make some memory available to the system. */ - MmRebalanceMemoryConsumers(); - } - while(PagerThreadWorkCount > 0); - } -} - -NTSTATUS MmInitPagerThread(VOID) -{ - NTSTATUS Status; - - PagerThreadShouldTerminate = FALSE; - PagerThreadWorkCount = 0; - KeInitializeEvent(&PagerThreadEvent, - SynchronizationEvent, - FALSE); - - Status = PsCreateSystemThread(&PagerThreadHandle, - THREAD_ALL_ACCESS, - NULL, - NULL, - &PagerThreadId, - (PKSTART_ROUTINE) MmPagerThreadMain, - NULL); - if (!NT_SUCCESS(Status)) - { - return(Status); - } - - return(STATUS_SUCCESS); -} -#endif diff --git a/reactos/ntoskrnl/mm/pagfault.c b/reactos/ntoskrnl/mm/pagfault.c deleted file mode 100644 index 4bae88943f6..00000000000 --- a/reactos/ntoskrnl/mm/pagfault.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/mm/pagfault.c - * PURPOSE: No purpose listed. - * - * PROGRAMMERS: No programmer listed. - */ - - -#include - -/* - * @implemented - */ -BOOLEAN -STDCALL -MmIsRecursiveIoFault ( - VOID -) -{ - PETHREAD Thread = PsGetCurrentThread (); - - return ( Thread->DisablePageFaultClustering - | Thread->ForwardClusterOnly - ); -} - - -/* EOF */ diff --git a/reactos/ntoskrnl/mm/paging.c b/reactos/ntoskrnl/mm/paging.c deleted file mode 100644 index 228e1c7ea18..00000000000 --- a/reactos/ntoskrnl/mm/paging.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/mm/paging.c - * PURPOSE: Paging file functions - * - * PROGRAMMERS: David Welch (welch@mcmail.com) - */ - -/* INCLUDES *****************************************************************/ - -#include -#include - - -/* FUNCTIONS *****************************************************************/ - -/* - * @unimplemented - */ -NTSTATUS -STDCALL -MmMapUserAddressesToPage ( - IN PVOID BaseAddress, - IN SIZE_T NumberOfBytes, - IN PVOID PageAddress - ) -{ - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; -} diff --git a/reactos/ntoskrnl/mm/pe.c b/reactos/ntoskrnl/mm/pe.c index 7e0465f9837..56d96cedaf9 100644 --- a/reactos/ntoskrnl/mm/pe.c +++ b/reactos/ntoskrnl/mm/pe.c @@ -12,7 +12,7 @@ #include //#define NDEBUG -#include +#include #include diff --git a/reactos/ntoskrnl/mm/pool.c b/reactos/ntoskrnl/mm/pool.c index a651f76b583..eb9b36908cc 100644 --- a/reactos/ntoskrnl/mm/pool.c +++ b/reactos/ntoskrnl/mm/pool.c @@ -12,7 +12,7 @@ #include #define NDEBUG -#include +#include extern ULONG MiNonPagedPoolLength; extern ULONG MmTotalPagedPoolQuota; @@ -21,6 +21,12 @@ extern MM_STATS MmStats; /* FUNCTIONS ***************************************************************/ +ULONG NTAPI +EiGetPagedPoolTag(IN PVOID Block); + +ULONG NTAPI +EiGetNonPagedPoolTag(IN PVOID Block); + static PVOID STDCALL EiAllocatePool(POOL_TYPE PoolType, ULONG NumberOfBytes, @@ -28,22 +34,39 @@ EiAllocatePool(POOL_TYPE PoolType, PVOID Caller) { PVOID Block; + PCHAR TagChars = (PCHAR)&Tag; - /* FIXME: Handle SESSION_POOL_MASK, VERIFIER_POOL_MASK, QUOTA_POOL_MASK */ - if (PoolType & PAGED_POOL_MASK) - { - Block = ExAllocatePagedPoolWithTag(PoolType,NumberOfBytes,Tag); - } - else - { - Block = ExAllocateNonPagedPoolWithTag(PoolType,NumberOfBytes,Tag,Caller); - } + if (NumberOfBytes == 0) + KeBugCheckEx(BAD_POOL_CALLER, 0x00, 0, PoolType, Tag); + if (Tag == 0) + KeBugCheckEx(BAD_POOL_CALLER, 0x9b, PoolType, NumberOfBytes, (ULONG_PTR)Caller); + if (Tag == TAG('B','I','G',0)) + KeBugCheckEx(BAD_POOL_CALLER, 0x9c, PoolType, NumberOfBytes, (ULONG_PTR)Caller); - if ((PoolType & MUST_SUCCEED_POOL_MASK) && Block==NULL) - { - KEBUGCHECK(MUST_SUCCEED_POOL_EMPTY); - } - return(Block); +#define IS_LETTER_OR_DIGIT(c) (((c) >= 'a' && (c) <= 'z') || ((c) >= 'A' && (c) <= 'Z') || ((c) >= '0' && (c) <= '9')) + if (!IS_LETTER_OR_DIGIT(TagChars[0]) && + !IS_LETTER_OR_DIGIT(TagChars[1]) && + !IS_LETTER_OR_DIGIT(TagChars[2]) && + !IS_LETTER_OR_DIGIT(TagChars[3])) + KeBugCheckEx(BAD_POOL_CALLER, 0x9d, Tag, PoolType, (ULONG_PTR)Caller); + + /* FIXME: Handle SESSION_POOL_MASK, VERIFIER_POOL_MASK, QUOTA_POOL_MASK */ + if (PoolType & PAGED_POOL_MASK) + { + if (KeGetCurrentIrql() > APC_LEVEL) + KeBugCheckEx(BAD_POOL_CALLER, 0x08, KeGetCurrentIrql(), PoolType, Tag); + Block = ExAllocatePagedPoolWithTag(PoolType, NumberOfBytes, Tag); + } + else + { + if (KeGetCurrentIrql() > DISPATCH_LEVEL) + KeBugCheckEx(BAD_POOL_CALLER, 0x08, KeGetCurrentIrql(), PoolType, Tag); + Block = ExAllocateNonPagedPoolWithTag(PoolType, NumberOfBytes, Tag, Caller); + } + + if ((PoolType & MUST_SUCCEED_POOL_MASK) && !Block) + KeBugCheckEx(BAD_POOL_CALLER, 0x9a, PoolType, NumberOfBytes, Tag); + return Block; } /* @@ -222,29 +245,40 @@ ExAllocatePoolWithQuotaTag (IN POOL_TYPE PoolType, * @implemented */ #undef ExFreePool -VOID STDCALL +VOID NTAPI ExFreePool(IN PVOID Block) { - ASSERT_IRQL(DISPATCH_LEVEL); - - if (Block >= MmPagedPoolBase && (char*)Block < ((char*)MmPagedPoolBase + MmPagedPoolSize)) - { - ExFreePagedPool(Block); - } - else - { - ExFreeNonPagedPool(Block); - } + if (Block >= MmPagedPoolBase && (char*)Block < ((char*)MmPagedPoolBase + MmPagedPoolSize)) + { + if (KeGetCurrentIrql() > APC_LEVEL) + KeBugCheckEx(BAD_POOL_CALLER, 0x09, KeGetCurrentIrql(), PagedPool, (ULONG_PTR)Block); + ExFreePagedPool(Block); + } + else + { + if (KeGetCurrentIrql() > DISPATCH_LEVEL) + KeBugCheckEx(BAD_POOL_CALLER, 0x09, KeGetCurrentIrql(), NonPagedPool, (ULONG_PTR)Block); + ExFreeNonPagedPool(Block); + } } /* * @implemented */ -VOID STDCALL +VOID NTAPI ExFreePoolWithTag(IN PVOID Block, IN ULONG Tag) { - /* FIXME: Validate the tag */ - ExFreePool(Block); + ULONG BlockTag; + + if (Block >= MmPagedPoolBase && (char*)Block < ((char*)MmPagedPoolBase + MmPagedPoolSize)) + BlockTag = EiGetPagedPoolTag(Block); + else + BlockTag = EiGetNonPagedPoolTag(Block); + + if (BlockTag != Tag) + KeBugCheckEx(BAD_POOL_CALLER, 0x0a, (ULONG_PTR)Block, BlockTag, Tag); + + ExFreePool(Block); } /* diff --git a/reactos/ntoskrnl/mm/powerpc/page.c b/reactos/ntoskrnl/mm/powerpc/page.c index 73b46616680..5000bbf5747 100644 --- a/reactos/ntoskrnl/mm/powerpc/page.c +++ b/reactos/ntoskrnl/mm/powerpc/page.c @@ -13,7 +13,7 @@ #include #include //#define NDEBUG -#include +#include #if defined (ALLOC_PRAGMA) #pragma alloc_text(INIT, MmInitGlobalKernelPageDirectory) @@ -98,7 +98,7 @@ MmCopyMmInfo(PEPROCESS Src, { DPRINT("MmCopyMmInfo(Src %x, Dest %x)\n", Src, Dest); - KeBugCheck(0); + ASSERT(FALSE); return(STATUS_SUCCESS); } @@ -125,7 +125,7 @@ MmCreateProcessAddressSpace(IN ULONG MinWs, IN PEPROCESS Process, IN PLARGE_INTEGER DirectoryTableBase) { - KeBugCheck(0); + ASSERT(FALSE); return TRUE; } @@ -302,7 +302,7 @@ MmIsAccessedAndResetAccessPage(PEPROCESS Process, PVOID Address) if (Address < MmSystemRangeStart && Process == NULL) { DPRINT1("MmIsAccessedAndResetAccessPage is called for user space without a process.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } info.proc = Process ? (int)Process->UniqueProcessId : 0; @@ -370,7 +370,7 @@ MmCreateVirtualMappingForKernel(PVOID Address, if (Address < MmSystemRangeStart) { DPRINT1("MmCreateVirtualMappingForKernel is called for user space\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } Addr = Address; @@ -383,7 +383,7 @@ MmCreateVirtualMappingForKernel(PVOID Address, DPRINT1("Setting physical address but not allowing access at address " "0x%.8X with attributes %x/%x.\n", Addr, Attributes, flProtect); - KEBUGCHECK(0); + ASSERT(FALSE); } (void)InterlockedExchangeUL(Pt, PFN_TO_PTE(Pages[i]) | Attributes); #endif @@ -401,16 +401,16 @@ MmCreatePageFileMapping(PEPROCESS Process, if (Process == NULL && Address < MmSystemRangeStart) { DPRINT1("No process\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (Process != NULL && Address >= MmSystemRangeStart) { DPRINT1("Setting kernel address with process context\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (SwapEntry & (1 << 31)) { - KEBUGCHECK(0); + ASSERT(FALSE); } // XXX arty @@ -440,13 +440,13 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, if (Address < MmSystemRangeStart) { DPRINT1("No process\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (PageCount > 0x10000 || (ULONG_PTR) Address / PAGE_SIZE + PageCount > 0x100000) { DPRINT1("Page count to large\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } } else @@ -454,14 +454,14 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, if (Address >= MmSystemRangeStart) { DPRINT1("Setting kernel address with process context\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (PageCount > (ULONG_PTR)MmSystemRangeStart / PAGE_SIZE || (ULONG_PTR) Address / PAGE_SIZE + PageCount > (ULONG_PTR)MmSystemRangeStart / PAGE_SIZE) { DPRINT1("Page Count to large\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } } @@ -508,7 +508,7 @@ MmCreateVirtualMapping(PEPROCESS Process, if (!MmIsUsablePage(Pages[i])) { DPRINT1("Page at address %x not usable\n", PFN_TO_PTE(Pages[i])); - KEBUGCHECK(0); + ASSERT(FALSE); } } @@ -564,7 +564,7 @@ MmSetPageProtect(PEPROCESS Process, PVOID Address, ULONG flProtect) Pt = MmGetPageTableForProcess(Process, Address, FALSE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } InterlockedExchange((PLONG)Pt, PAGE_MASK(*Pt) | Attributes | (*Pt & (PA_ACCESSED|PA_DIRTY))); MiFlushTlb(Pt, Address); diff --git a/reactos/ntoskrnl/mm/powerpc/pfault.c b/reactos/ntoskrnl/mm/powerpc/pfault.c index bb6b302e0b2..2c4104e7c15 100644 --- a/reactos/ntoskrnl/mm/powerpc/pfault.c +++ b/reactos/ntoskrnl/mm/powerpc/pfault.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include #include /* EXTERNS *******************************************************************/ diff --git a/reactos/ntoskrnl/mm/ppool.c b/reactos/ntoskrnl/mm/ppool.c index b2cc217fcf7..2575c8c37a3 100644 --- a/reactos/ntoskrnl/mm/ppool.c +++ b/reactos/ntoskrnl/mm/ppool.c @@ -12,7 +12,7 @@ #include #define NDEBUG -#include +#include #if defined (ALLOC_PRAGMA) #pragma alloc_text(INIT, MmInitializePagedPool) @@ -91,7 +91,7 @@ ExAllocatePagedPoolWithTag (IN POOL_TYPE PoolType, else align = 0; - ASSERT_IRQL(APC_LEVEL); + ASSERT_IRQL_LESS_OR_EQUAL(APC_LEVEL); return RPoolAlloc ( MmPagedPool, NumberOfBytes, Tag, align ); } @@ -99,10 +99,16 @@ ExAllocatePagedPoolWithTag (IN POOL_TYPE PoolType, VOID STDCALL ExFreePagedPool(IN PVOID Block) { - ASSERT_IRQL(APC_LEVEL); + ASSERT_IRQL_LESS_OR_EQUAL(APC_LEVEL); RPoolFree ( MmPagedPool, Block ); } +ULONG NTAPI +EiGetPagedPoolTag(IN PVOID Block) +{ + return RBodyToHdr(Block)->Tag; +} + #ifdef PPOOL_UMODE_TEST diff --git a/reactos/ntoskrnl/mm/procsup.c b/reactos/ntoskrnl/mm/procsup.c index ae9e8d55ac0..9a7b2817263 100644 --- a/reactos/ntoskrnl/mm/procsup.c +++ b/reactos/ntoskrnl/mm/procsup.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include extern ULONG NtMajorVersion; extern ULONG NtMinorVersion; @@ -215,7 +215,7 @@ MmCreateKernelStack(BOOLEAN GuiStack, if (!NT_SUCCESS(Status)) { DPRINT1("Failed to create thread stack\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* @@ -239,7 +239,7 @@ MmCreateKernelStack(BOOLEAN GuiStack, if (!NT_SUCCESS(Status)) { DPRINT1("Could not create Virtual Mapping for Kernel Stack\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* Return the stack base */ @@ -709,11 +709,11 @@ MmDeleteProcessAddressSpace(PEPROCESS Process) break; case MEMORY_AREA_MDL_MAPPING: - KEBUGCHECK(PROCESS_HAS_LOCKED_PAGES); + KeBugCheck(PROCESS_HAS_LOCKED_PAGES); break; default: - KEBUGCHECK(0); + ASSERT(FALSE); } } diff --git a/reactos/ntoskrnl/mm/region.c b/reactos/ntoskrnl/mm/region.c index 41e97516216..13f206e7aee 100644 --- a/reactos/ntoskrnl/mm/region.c +++ b/reactos/ntoskrnl/mm/region.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/ntoskrnl/mm/rmap.c b/reactos/ntoskrnl/mm/rmap.c index e2120a072b1..cf6b00fa5b1 100644 --- a/reactos/ntoskrnl/mm/rmap.c +++ b/reactos/ntoskrnl/mm/rmap.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include #if defined (ALLOC_PRAGMA) #pragma alloc_text(INIT, MmInitializeRmapList) @@ -81,7 +81,7 @@ MmWritePagePhysicalAddress(PFN_TYPE Page) Address = entry->Address; if ((((ULONG_PTR)Address) & 0xFFF) != 0) { - KEBUGCHECK(0); + ASSERT(FALSE); } if (Address < MmSystemRangeStart) { @@ -177,7 +177,7 @@ MmWritePagePhysicalAddress(PFN_TYPE Page) } else { - KEBUGCHECK(0); + ASSERT(FALSE); } if (Address < MmSystemRangeStart) { @@ -211,7 +211,7 @@ MmPageOutPhysicalAddress(PFN_TYPE Page) Address = entry->Address; if ((((ULONG_PTR)Address) & 0xFFF) != 0) { - KEBUGCHECK(0); + ASSERT(FALSE); } if (Address < MmSystemRangeStart) @@ -301,7 +301,7 @@ MmPageOutPhysicalAddress(PFN_TYPE Page) } else { - KEBUGCHECK(0); + ASSERT(FALSE); } if (Address < MmSystemRangeStart) { @@ -321,7 +321,7 @@ MmSetCleanAllRmaps(PFN_TYPE Page) if (current_entry == NULL) { DPRINT1("MmIsDirtyRmap: No rmaps.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } while (current_entry != NULL) { @@ -342,7 +342,7 @@ MmSetDirtyAllRmaps(PFN_TYPE Page) if (current_entry == NULL) { DPRINT1("MmIsDirtyRmap: No rmaps.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } while (current_entry != NULL) { @@ -392,7 +392,7 @@ MmInsertRmap(PFN_TYPE Page, PEPROCESS Process, new_entry = ExAllocateFromNPagedLookasideList(&RmapLookasideList); if (new_entry == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } new_entry->Address = Address; new_entry->Process = (PEPROCESS)Process; @@ -410,7 +410,7 @@ MmInsertRmap(PFN_TYPE Page, PEPROCESS Process, "address 0x%.8X\n", Process->UniqueProcessId, Address, MmGetPfnForProcess(Process, Address) << PAGE_SHIFT, Page << PAGE_SHIFT); - KEBUGCHECK(0); + ASSERT(FALSE); } ExAcquireFastMutex(&RmapListLock); @@ -427,7 +427,7 @@ MmInsertRmap(PFN_TYPE Page, PEPROCESS Process, DbgPrint("\n previous caller "); DbgPrint("%p", current_entry->Caller); DbgPrint("\n"); - KeBugCheck(0); + ASSERT(FALSE); } current_entry = current_entry->Next; } @@ -463,7 +463,7 @@ MmDeleteAllRmaps(PFN_TYPE Page, PVOID Context, if (current_entry == NULL) { DPRINT1("MmDeleteAllRmaps: No rmaps.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } MmSetRmapListHeadPage(Page, NULL); ExReleaseFastMutex(&RmapListLock); @@ -527,5 +527,5 @@ MmDeleteRmap(PFN_TYPE Page, PEPROCESS Process, previous_entry = current_entry; current_entry = current_entry->Next; } - KEBUGCHECK(0); + ASSERT(FALSE); } diff --git a/reactos/ntoskrnl/mm/section.c b/reactos/ntoskrnl/mm/section.c index d86c77003d8..e95ee507a3b 100644 --- a/reactos/ntoskrnl/mm/section.c +++ b/reactos/ntoskrnl/mm/section.c @@ -46,7 +46,7 @@ #include #define NDEBUG -#include +#include #include #if defined (ALLOC_PRAGMA) @@ -136,7 +136,7 @@ MmGetFileNameForSection(IN PROS_SECTION_OBJECT Section, if (!NT_SUCCESS(Status)) { /* Failed, free memory */ - ExFreePool(ObjectNameInfo); + ExFreePoolWithTag(ObjectNameInfo, TAG('M', 'm', ' ', ' ')); return Status; } @@ -250,7 +250,7 @@ MmFreeSectionSegments(PFILE_OBJECT FileObject) { DPRINT1("Image segment %d still referenced (was %d)\n", i, SectionSegments[i].ReferenceCount); - KEBUGCHECK(0); + ASSERT(FALSE); } MmFreePageTablesSectionSegment(&SectionSegments[i]); } @@ -268,7 +268,7 @@ MmFreeSectionSegments(PFILE_OBJECT FileObject) if (Segment->ReferenceCount != 0) { DPRINT1("Data segment still referenced\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } MmFreePageTablesSectionSegment(Segment); ExFreePool(Segment); @@ -316,7 +316,7 @@ MmSetPageEntrySectionSegment(PMM_SECTION_SEGMENT Segment, TAG_SECTION_PAGE_TABLE); if (Table == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } memset(Table, 0, sizeof(SECTION_PAGE_TABLE)); DPRINT("Table %x\n", Table); @@ -369,16 +369,16 @@ MmSharePageEntrySectionSegment(PMM_SECTION_SEGMENT Segment, if (Entry == 0) { DPRINT1("Entry == 0 for MmSharePageEntrySectionSegment\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (SHARE_COUNT_FROM_SSE(Entry) == MAX_SHARE_COUNT) { DPRINT1("Maximum share count reached\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (IS_SWAP_FROM_SSE(Entry)) { - KEBUGCHECK(0); + ASSERT(FALSE); } Entry = MAKE_SSE(PAGE_FROM_SSE(Entry), SHARE_COUNT_FROM_SSE(Entry) + 1); MmSetPageEntrySectionSegment(Segment, Offset, Entry); @@ -399,16 +399,16 @@ MmUnsharePageEntrySectionSegment(PROS_SECTION_OBJECT Section, if (Entry == 0) { DPRINT1("Entry == 0 for MmUnsharePageEntrySectionSegment\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (SHARE_COUNT_FROM_SSE(Entry) == 0) { DPRINT1("Zero share count for unshare\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (IS_SWAP_FROM_SSE(Entry)) { - KEBUGCHECK(0); + ASSERT(FALSE); } Entry = MAKE_SSE(PAGE_FROM_SSE(Entry), SHARE_COUNT_FROM_SSE(Entry) - 1); /* @@ -444,7 +444,7 @@ MmUnsharePageEntrySectionSegment(PROS_SECTION_OBJECT Section, if (!NT_SUCCESS(Status)) { DPRINT1("CcRosUnmapCacheSegment failed, status = %x\n", Status); - KEBUGCHECK(0); + ASSERT(FALSE); } } } @@ -493,7 +493,7 @@ MmUnsharePageEntrySectionSegment(PROS_SECTION_OBJECT Section, if (!NT_SUCCESS(Status)) { DPRINT1("MM: Failed to write to swap page (Status was 0x%.8X)\n", Status); - KEBUGCHECK(0); + ASSERT(FALSE); } } MmSetPageEntrySectionSegment(Segment, Offset, MAKE_SWAP_SSE(SavedSwapEntry)); @@ -504,7 +504,7 @@ MmUnsharePageEntrySectionSegment(PROS_SECTION_OBJECT Section, else { DPRINT1("Found a swapentry for a non private page in an image or data file sgment\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } } } @@ -775,7 +775,7 @@ MmNotPresentFaultSectionView(PMM_AVL_TABLE AddressSpace, if (PageOp == NULL) { DPRINT1("MmGetPageOp failed\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* @@ -793,12 +793,12 @@ MmNotPresentFaultSectionView(PMM_AVL_TABLE AddressSpace, if (Status != STATUS_SUCCESS) { DPRINT1("Failed to wait for page op, status = %x\n", Status); - KEBUGCHECK(0); + ASSERT(FALSE); } if (PageOp->Status == STATUS_PENDING) { DPRINT1("Woke for page op before completion\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } MmLockAddressSpace(AddressSpace); /* @@ -856,7 +856,7 @@ MmNotPresentFaultSectionView(PMM_AVL_TABLE AddressSpace, if (!NT_SUCCESS(Status)) { DPRINT1("Unable to create virtual mapping\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } MmInsertRmap(Page, Process, (PVOID)PAddress); } @@ -885,7 +885,7 @@ MmNotPresentFaultSectionView(PMM_AVL_TABLE AddressSpace, if (Segment->Flags & MM_PAGEFILE_SEGMENT) { DPRINT1("Found a swaped out private page in a pagefile section.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } MmUnlockSectionSegment(Segment); @@ -895,14 +895,14 @@ MmNotPresentFaultSectionView(PMM_AVL_TABLE AddressSpace, Status = MmRequestPageMemoryConsumer(MC_USER, TRUE, &Page); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } Status = MmReadFromSwapPage(SwapEntry, Page); if (!NT_SUCCESS(Status)) { DPRINT1("MmReadFromSwapPage failed, status = %x\n", Status); - KEBUGCHECK(0); + ASSERT(FALSE); } MmLockAddressSpace(AddressSpace); Status = MmCreateVirtualMapping(Process, @@ -913,7 +913,7 @@ MmNotPresentFaultSectionView(PMM_AVL_TABLE AddressSpace, if (!NT_SUCCESS(Status)) { DPRINT("MmCreateVirtualMapping failed, not out of memory\n"); - KEBUGCHECK(0); + ASSERT(FALSE); return(Status); } @@ -958,7 +958,7 @@ MmNotPresentFaultSectionView(PMM_AVL_TABLE AddressSpace, if (!NT_SUCCESS(Status)) { DPRINT("MmCreateVirtualMappingUnsafe failed, not out of memory\n"); - KEBUGCHECK(0); + ASSERT(FALSE); return(Status); } /* @@ -994,7 +994,7 @@ MmNotPresentFaultSectionView(PMM_AVL_TABLE AddressSpace, } if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } Status = MmCreateVirtualMapping(Process, Address, @@ -1004,7 +1004,7 @@ MmNotPresentFaultSectionView(PMM_AVL_TABLE AddressSpace, if (!NT_SUCCESS(Status)) { DPRINT("MmCreateVirtualMapping failed, not out of memory\n"); - KEBUGCHECK(0); + ASSERT(FALSE); return(Status); } MmInsertRmap(Page, Process, (PVOID)PAddress); @@ -1085,7 +1085,7 @@ MmNotPresentFaultSectionView(PMM_AVL_TABLE AddressSpace, if (Entry != Entry1) { DPRINT1("Someone changed ppte entry while we slept\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* @@ -1104,7 +1104,7 @@ MmNotPresentFaultSectionView(PMM_AVL_TABLE AddressSpace, if (!NT_SUCCESS(Status)) { DPRINT1("Unable to create virtual mapping\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } MmInsertRmap(Page, Process, (PVOID)PAddress); @@ -1133,13 +1133,13 @@ MmNotPresentFaultSectionView(PMM_AVL_TABLE AddressSpace, Status = MmRequestPageMemoryConsumer(MC_USER, TRUE, &Page); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } Status = MmReadFromSwapPage(SwapEntry, Page); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } /* @@ -1156,7 +1156,7 @@ MmNotPresentFaultSectionView(PMM_AVL_TABLE AddressSpace, if (Entry != Entry1) { DPRINT1("Someone changed ppte entry while we slept\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* @@ -1179,7 +1179,7 @@ MmNotPresentFaultSectionView(PMM_AVL_TABLE AddressSpace, if (!NT_SUCCESS(Status)) { DPRINT1("Unable to create virtual mapping\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } MmInsertRmap(Page, Process, (PVOID)PAddress); if (Locked) @@ -1211,7 +1211,7 @@ MmNotPresentFaultSectionView(PMM_AVL_TABLE AddressSpace, if (!NT_SUCCESS(Status)) { DPRINT1("Unable to create virtual mapping\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } MmInsertRmap(Page, Process, (PVOID)PAddress); if (Locked) @@ -1305,7 +1305,7 @@ MmAccessFaultSectionView(PMM_AVL_TABLE AddressSpace, if (PageOp == NULL) { DPRINT1("MmGetPageOp failed\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* @@ -1321,12 +1321,12 @@ MmAccessFaultSectionView(PMM_AVL_TABLE AddressSpace, if (Status == STATUS_TIMEOUT) { DPRINT1("Failed to wait for page op, status = %x\n", Status); - KEBUGCHECK(0); + ASSERT(FALSE); } if (PageOp->Status == STATUS_PENDING) { DPRINT1("Woke for page op before completion\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* * Restart the operation @@ -1348,7 +1348,7 @@ MmAccessFaultSectionView(PMM_AVL_TABLE AddressSpace, Status = MmRequestPageMemoryConsumer(MC_USER, TRUE, &NewPage); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } /* @@ -1373,13 +1373,13 @@ MmAccessFaultSectionView(PMM_AVL_TABLE AddressSpace, if (!NT_SUCCESS(Status)) { DPRINT("MmCreateVirtualMapping failed, not out of memory\n"); - KEBUGCHECK(0); + ASSERT(FALSE); return(Status); } if (!NT_SUCCESS(Status)) { DPRINT1("Unable to create virtual mapping\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (Locked) { @@ -1509,7 +1509,7 @@ MmPageOutSectionView(PMM_AVL_TABLE AddressSpace, DPRINT1("Trying to page out from physical memory section address 0x%X " "process %d\n", Address, Process ? Process->UniqueProcessId : 0); - KEBUGCHECK(0); + ASSERT(FALSE); } /* @@ -1520,7 +1520,7 @@ MmPageOutSectionView(PMM_AVL_TABLE AddressSpace, { DPRINT1("Trying to page out not-present page at (%d,0x%.8X).\n", Process ? Process->UniqueProcessId : 0, Address); - KEBUGCHECK(0); + ASSERT(FALSE); } Page = MmGetPfnForProcess(Process, Address); SwapEntry = MmGetSavedSwapEntryPage(Page); @@ -1548,7 +1548,7 @@ MmPageOutSectionView(PMM_AVL_TABLE AddressSpace, if(!MiIsPageFromCache(MemoryArea, Context.Offset)) { DPRINT1("Direct mapped non private page is not associated with the cache.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } } else @@ -1567,7 +1567,7 @@ MmPageOutSectionView(PMM_AVL_TABLE AddressSpace, if (!(Context.Segment->Flags & MM_PAGEFILE_SEGMENT) && !(Context.Segment->Characteristics & IMAGE_SCN_MEM_SHARED)) { - KEBUGCHECK(0); + ASSERT(FALSE); } } @@ -1585,7 +1585,7 @@ MmPageOutSectionView(PMM_AVL_TABLE AddressSpace, { DPRINT1("Found a %s private page (address %x) in a pagefile segment.\n", Context.WasDirty ? "dirty" : "clean", Address); - KEBUGCHECK(0); + ASSERT(FALSE); } if (!Context.WasDirty && SwapEntry != 0) { @@ -1603,7 +1603,7 @@ MmPageOutSectionView(PMM_AVL_TABLE AddressSpace, { DPRINT1("Found a %s private page (address %x) in a shared section segment.\n", Context.WasDirty ? "dirty" : "clean", Address); - KEBUGCHECK(0); + ASSERT(FALSE); } if (!Context.WasDirty || SwapEntry != 0) { @@ -1624,13 +1624,13 @@ MmPageOutSectionView(PMM_AVL_TABLE AddressSpace, { DPRINT1("Found a swapentry for a non private and direct mapped page (address %x)\n", Address); - KEBUGCHECK(0); + ASSERT(FALSE); } Status = CcRosUnmapCacheSegment(Bcb, FileOffset, FALSE); if (!NT_SUCCESS(Status)) { DPRINT1("CCRosUnmapCacheSegment failed, status = %x\n", Status); - KEBUGCHECK(0); + ASSERT(FALSE); } PageOp->Status = STATUS_SUCCESS; MmspCompleteAndReleasePageOp(PageOp); @@ -1642,7 +1642,7 @@ MmPageOutSectionView(PMM_AVL_TABLE AddressSpace, { DPRINT1("Found a swap entry for a non dirty, non private and not direct mapped page (address %x)\n", Address); - KEBUGCHECK(0); + ASSERT(FALSE); } MmReleasePageMemoryConsumer(MC_USER, Page); PageOp->Status = STATUS_SUCCESS; @@ -1659,7 +1659,7 @@ MmPageOutSectionView(PMM_AVL_TABLE AddressSpace, MmUnlockAddressSpace(AddressSpace); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } MmReleasePageMemoryConsumer(MC_USER, Page); PageOp->Status = STATUS_SUCCESS; @@ -1787,7 +1787,7 @@ MmPageOutSectionView(PMM_AVL_TABLE AddressSpace, MmUnlockAddressSpace(AddressSpace); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } } else @@ -1862,7 +1862,7 @@ MmWritePageSectionView(PMM_AVL_TABLE AddressSpace, DPRINT1("Trying to write back page from physical memory mapped at %X " "process %d\n", Address, Process ? Process->UniqueProcessId : 0); - KEBUGCHECK(0); + ASSERT(FALSE); } /* @@ -1873,7 +1873,7 @@ MmWritePageSectionView(PMM_AVL_TABLE AddressSpace, { DPRINT1("Trying to page out not-present page at (%d,0x%.8X).\n", Process ? Process->UniqueProcessId : 0, Address); - KEBUGCHECK(0); + ASSERT(FALSE); } Page = MmGetPfnForProcess(Process, Address); SwapEntry = MmGetSavedSwapEntryPage(Page); @@ -2036,7 +2036,6 @@ MmProtectSectionView(PMM_AVL_TABLE AddressSpace, if ((MemoryArea->Flags & SEC_NO_CHANGE) && Region->Protect != Protect) { - CHECKPOINT1; return STATUS_INVALID_PAGE_PROTECTION; } @@ -2242,7 +2241,7 @@ MmCreatePhysicalMemorySection(VOID) if (!NT_SUCCESS(Status)) { DPRINT1("Failed to create PhysicalMemory section\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } Status = ObInsertObject(PhysSection, NULL, @@ -2685,7 +2684,7 @@ ExeFmtpReadFile(IN PVOID File, if(Length == 0) { - KEBUGCHECK(STATUS_INVALID_PARAMETER_4); + ASSERT(FALSE); } FileOffset = *Offset; @@ -2693,7 +2692,7 @@ ExeFmtpReadFile(IN PVOID File, /* Negative/special offset: it cannot be used in this context */ if(FileOffset.u.HighPart < 0) { - KEBUGCHECK(STATUS_INVALID_PARAMETER_5); + ASSERT(FALSE); } AdjustOffset = PAGE_ROUND_DOWN(FileOffset.u.LowPart); @@ -2762,7 +2761,7 @@ ExeFmtpReadFile(IN PVOID File, } else { - ExFreePool(Buffer); + ExFreePoolWithTag(Buffer, TAG('M', 'm', 'X', 'r')); } return Status; @@ -3171,7 +3170,7 @@ ExeFmtpCreateImageSection(HANDLE FileHandle, break; } - ExFreePool(FileHeaderBuffer); + ExFreePoolWithTag(FileHeaderBuffer, TAG('M', 'm', 'X', 'r')); /* * No loader handled the format @@ -3688,7 +3687,6 @@ NtMapViewOfSection(IN HANDLE SectionHandle, */ if (Protect & ~PAGE_FLAGS_VALID_FROM_USER_MODE) { - CHECKPOINT1; return STATUS_INVALID_PARAMETER_10; } @@ -3702,7 +3700,6 @@ NtMapViewOfSection(IN HANDLE SectionHandle, tmpProtect != PAGE_EXECUTE_READWRITE && tmpProtect != PAGE_EXECUTE_WRITECOPY) { - CHECKPOINT1; return STATUS_INVALID_PAGE_PROTECTION; } @@ -3867,7 +3864,7 @@ MmFreeSectionPage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address, if (Status != STATUS_SUCCESS) { DPRINT1("Failed to wait for page op, status = %x\n", Status); - KEBUGCHECK(0); + ASSERT(FALSE); } MmLockAddressSpace(AddressSpace); @@ -3901,7 +3898,7 @@ MmFreeSectionPage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address, if (Segment->Flags & MM_PAGEFILE_SEGMENT) { DPRINT1("Found a swap entry for a page in a pagefile section.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } MmFreeSwapPage(SwapEntry); } @@ -3916,7 +3913,7 @@ MmFreeSectionPage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address, if (Segment->Flags & MM_PAGEFILE_SEGMENT) { DPRINT1("Found a private page in a pagefile section.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* * Just dereference private pages @@ -3968,7 +3965,7 @@ MmUnmapViewOfSegment(PMM_AVL_TABLE AddressSpace, { CurrentEntry = RemoveHeadList(RegionListHead); CurrentRegion = CONTAINING_RECORD(CurrentEntry, MM_REGION, RegionListEntry); - ExFreePool(CurrentRegion); + ExFreePoolWithTag(CurrentRegion, TAG_MM_REGION); } if (Section->AllocationAttributes & SEC_PHYSICALMEMORY) @@ -4042,7 +4039,7 @@ MmUnmapViewOfSection(PEPROCESS Process, if (Status != STATUS_SUCCESS) { DPRINT1("Failed to wait for page op, status = %x\n", Status); - KEBUGCHECK(0); + ASSERT(FALSE); } MmLockAddressSpace(AddressSpace); MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, @@ -4088,7 +4085,7 @@ MmUnmapViewOfSection(PEPROCESS Process, } if (i >= NrSegments) { - KEBUGCHECK(0); + ASSERT(FALSE); } for (i = 0; i < NrSegments; i++) @@ -4510,7 +4507,6 @@ MmMapViewOfSection(IN PVOID SectionObject, Protect != PAGE_EXECUTE_READWRITE && Protect != PAGE_EXECUTE_WRITECOPY) { - CHECKPOINT1; return STATUS_INVALID_PAGE_PROTECTION; } @@ -4607,21 +4603,18 @@ MmMapViewOfSection(IN PVOID SectionObject, if ((Protect & (PAGE_READWRITE|PAGE_EXECUTE_READWRITE)) && !(Section->SectionPageProtection & (PAGE_READWRITE|PAGE_EXECUTE_READWRITE))) { - CHECKPOINT1; return STATUS_SECTION_PROTECTION; } /* check for read access */ if ((Protect & (PAGE_READONLY|PAGE_WRITECOPY|PAGE_EXECUTE_READ|PAGE_EXECUTE_WRITECOPY)) && !(Section->SectionPageProtection & (PAGE_READONLY|PAGE_READWRITE|PAGE_WRITECOPY|PAGE_EXECUTE_READ|PAGE_EXECUTE_READWRITE|PAGE_EXECUTE_WRITECOPY))) { - CHECKPOINT1; return STATUS_SECTION_PROTECTION; } /* check for execute access */ if ((Protect & (PAGE_EXECUTE|PAGE_EXECUTE_READ|PAGE_EXECUTE_READWRITE|PAGE_EXECUTE_WRITECOPY)) && !(Section->SectionPageProtection & (PAGE_EXECUTE|PAGE_EXECUTE_READ|PAGE_EXECUTE_READWRITE|PAGE_EXECUTE_WRITECOPY))) { - CHECKPOINT1; return STATUS_SECTION_PROTECTION; } @@ -4629,7 +4622,7 @@ MmMapViewOfSection(IN PVOID SectionObject, { /* Following this pointer would lead to us to the dark side */ /* What to do? Bugcheck? Return status? Do the mambo? */ - KEBUGCHECK(MEMORY_MANAGEMENT); + KeBugCheck(MEMORY_MANAGEMENT); } if (SectionOffset == NULL) @@ -4927,7 +4920,6 @@ MmCreateSection (OUT PVOID * Section, Protection != PAGE_EXECUTE_READWRITE && Protection != PAGE_EXECUTE_WRITECOPY) { - CHECKPOINT1; return STATUS_INVALID_PAGE_PROTECTION; } diff --git a/reactos/ntoskrnl/mm/sysldr.c b/reactos/ntoskrnl/mm/sysldr.c index 32a5fb8da38..9d006941643 100644 --- a/reactos/ntoskrnl/mm/sysldr.c +++ b/reactos/ntoskrnl/mm/sysldr.c @@ -660,7 +660,7 @@ MiSnapThunk(IN PVOID DllBase, &MissingForwarder); /* Free the forwarder name and set the thunk */ - ExFreePool(ForwardName); + ExFreePoolWithTag(ForwardName, TAG_LDR_WSTR); Address->u1 = ForwardThunk.u1; break; } @@ -876,7 +876,7 @@ MiResolveImageReferences(IN PVOID ImageBase, { /* Failed */ MiDereferenceImports(LoadedImports); - if (LoadedImports) ExFreePool(LoadedImports); + if (LoadedImports) ExFreePoolWithTag(LoadedImports, TAG_LDR_WSTR); return Status; } @@ -997,7 +997,7 @@ CheckDllState: /* Cleanup and return */ RtlFreeUnicodeString(&NameString); MiDereferenceImports(LoadedImports); - if (LoadedImports) ExFreePool(LoadedImports); + if (LoadedImports) ExFreePoolWithTag(LoadedImports, TAG_LDR_WSTR); return Status; } @@ -1030,7 +1030,7 @@ CheckDllState: { /* Cleanup and return */ MiDereferenceImports(LoadedImports); - if (LoadedImports) ExFreePool(LoadedImports); + if (LoadedImports) ExFreePoolWithTag(LoadedImports, TAG_LDR_WSTR); return STATUS_DRIVER_ENTRYPOINT_NOT_FOUND; } @@ -1059,7 +1059,7 @@ CheckDllState: { /* Cleanup and return */ MiDereferenceImports(LoadedImports); - if (LoadedImports) ExFreePool(LoadedImports); + if (LoadedImports) ExFreePoolWithTag(LoadedImports, TAG_LDR_WSTR); return Status; } @@ -1091,13 +1091,13 @@ CheckDllState: if (!ImportCount) { /* Free the list and set it to no imports */ - ExFreePool(LoadedImports); + ExFreePoolWithTag(LoadedImports, TAG_LDR_WSTR); LoadedImports = (PVOID)-2; } else if (ImportCount == 1) { /* Just one entry, we can free the table and only use our entry */ - ExFreePool(LoadedImports); + ExFreePoolWithTag(LoadedImports, TAG_LDR_WSTR); LoadedImports = (PLOAD_IMPORTS)ImportEntry; } else if (ImportCount != LoadedImports->Count) @@ -1125,7 +1125,7 @@ CheckDllState: } /* Free the old copy */ - ExFreePool(LoadedImports); + ExFreePoolWithTag(LoadedImports, TAG_LDR_WSTR); LoadedImports = NewImports; } } @@ -1834,7 +1834,7 @@ LoaderScan: } /* Free the entry itself */ - ExFreePool(LdrEntry); + ExFreePoolWithTag(LdrEntry, TAG_MODULE_OBJECT); LdrEntry = NULL; goto Quickie; } @@ -1924,7 +1924,7 @@ Quickie: if (NamePrefix) ExFreePool(PrefixName.Buffer); /* Free the name buffer and return status */ - ExFreePool(Buffer); + ExFreePoolWithTag(Buffer, TAG_LDR_WSTR); return Status; } diff --git a/reactos/ntoskrnl/mm/verifier.c b/reactos/ntoskrnl/mm/verifier.c index 0b30939b49c..f2682991609 100644 --- a/reactos/ntoskrnl/mm/verifier.c +++ b/reactos/ntoskrnl/mm/verifier.c @@ -10,7 +10,7 @@ #include #define NDEBUG -#include +#include /* GLOBALS *******************************************************************/ diff --git a/reactos/ntoskrnl/mm/wset.c b/reactos/ntoskrnl/mm/wset.c index df570353d6c..1978caa816c 100644 --- a/reactos/ntoskrnl/mm/wset.c +++ b/reactos/ntoskrnl/mm/wset.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild b/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild index c8908fa403b..386fd266537 100644 --- a/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild +++ b/reactos/ntoskrnl/ntoskrnl-amd64hack.rbuild @@ -375,7 +375,6 @@ anonmem.c - aspace.c balance.c cont.c drvlck.c @@ -391,9 +390,6 @@ npool.c pagefile.c pageop.c - pager.c - pagfault.c - paging.c pe.c physical.c pool.c diff --git a/reactos/ntoskrnl/ntoskrnl-generic.rbuild b/reactos/ntoskrnl/ntoskrnl-generic.rbuild index 3f72f594a78..ab039c94e7f 100644 --- a/reactos/ntoskrnl/ntoskrnl-generic.rbuild +++ b/reactos/ntoskrnl/ntoskrnl-generic.rbuild @@ -2,12 +2,7 @@ - - - - - - + @@ -364,7 +359,6 @@ anonmem.c - aspace.c balance.c cont.c drvlck.c @@ -380,9 +374,6 @@ npool.c pagefile.c pageop.c - pager.c - pagfault.c - paging.c pe.c physical.c pool.c @@ -446,6 +437,11 @@ rtlexcpt.c + + + stack.S + + libsupp.c misc.c diff --git a/reactos/ntoskrnl/ntoskrnl.spec b/reactos/ntoskrnl/ntoskrnl.spec index f37251e4eda..992a5651790 100644 --- a/reactos/ntoskrnl/ntoskrnl.spec +++ b/reactos/ntoskrnl/ntoskrnl.spec @@ -169,12 +169,14 @@ @ fastcall ExfReleasePushLockShared(ptr) @ fastcall ExfTryToWakePushLock(ptr) @ fastcall ExfUnblockPushLock(ptr ptr) +#ifdef _M_IX86 @ fastcall Exfi386InterlockedDecrementLong(ptr) @ fastcall Exfi386InterlockedExchangeUlong(ptr long) @ fastcall Exfi386InterlockedIncrementLong(ptr) @ stdcall Exi386InterlockedDecrementLong(ptr) @ stdcall Exi386InterlockedExchangeUlong(ptr long long) @ stdcall Exi386InterlockedIncrementLong(ptr) +#endif @ fastcall ExiAcquireFastMutex(ptr) ExAcquireFastMutex @ fastcall ExiReleaseFastMutex(ptr) ExReleaseFastMutex @ fastcall ExiTryToAcquireFastMutex(ptr) ExTryToAcquireFastMutex @@ -534,10 +536,12 @@ @ stdcall KdPowerTransition(long) @ stdcall KdRefreshDebuggerNotPresent() @ stdcall KdSystemDebugControl(long ptr long ptr long ptr long) +#ifdef _M_IX86 @ stdcall Ke386CallBios(long ptr) ;Ke386IoSetAccessProcess ;Ke386QueryIoAccessMap ;Ke386SetIoAccessMap +#endif @ fastcall KeAcquireGuardedMutex(ptr) @ fastcall KeAcquireGuardedMutexUnsafe(ptr) @ fastcall KeAcquireInStackQueuedSpinLockAtDpcLevel(ptr ptr) @@ -572,6 +576,7 @@ @ stdcall KeGetCurrentThread() @ stdcall KeGetPreviousMode() @ stdcall KeGetRecommendedSharedDataAlignment() +#ifdef _M_IX86 ;KeI386AbiosCall @ stdcall KeI386AllocateGdtSelectors(ptr long) ;KeI386Call16BitCStyleFunction @@ -582,6 +587,7 @@ @ stdcall KeI386ReleaseGdtSelectors(ptr long) ;KeI386ReleaseLid ;KeI386SetGdtSelector +#endif @ stdcall KeInitializeApc(ptr ptr long ptr ptr ptr long ptr) @ stdcall KeInitializeCrashDumpHeader(long long ptr long ptr) @ stdcall KeInitializeDeviceQueue(ptr) @@ -693,18 +699,26 @@ @ stdcall KeWaitForSingleObject(ptr long long long ptr) @ fastcall KefAcquireSpinLockAtDpcLevel(ptr) @ fastcall KefReleaseSpinLockFromDpcLevel(ptr) +#ifdef _M_IX86 @ stdcall Kei386EoiHelper() +#endif @ fastcall KiAcquireSpinLock(ptr) @ extern KiBugCheckData @ stdcall KiCheckForKernelApcDelivery() +#ifdef _M_IX86 @ stdcall KiCoprocessorError() +#endif @ stdcall KiDeliverApc(long ptr ptr) +#ifdef _M_IX86 @ stdcall KiDispatchInterrupt() +#endif @ extern KiEnableTimerWatchdog @ stdcall KiIpiServiceRoutine(ptr ptr) @ fastcall KiReleaseSpinLock(ptr) @ cdecl KiUnexpectedInterrupt() +#ifdef _M_IX86 ;Kii386SpinOnSpinLock +#endif @ stdcall LdrAccessResource(ptr ptr ptr ptr) @ stdcall LdrEnumResources(ptr ptr long ptr ptr) @ stdcall LdrFindResourceDirectory_U(ptr ptr long ptr) @@ -909,7 +923,6 @@ @ stdcall PoRequestPowerIrp(ptr long long ptr ptr ptr) ;PoRequestShutdownEvent ;PoSetHiberRange -@ stdcall PoSetDeviceBusy(ptr) @ stdcall PoSetPowerState(ptr long long) @ stdcall PoSetSystemState(long) ;PoShutdownBugCheck @@ -1503,6 +1516,7 @@ ;_CIsin ;_CIsqrt @ cdecl _abnormal_termination() +#ifdef _M_IX86 @ cdecl _alldiv() @ cdecl _alldvrm() @ cdecl _allmul() @@ -1514,6 +1528,7 @@ @ cdecl _aulldvrm() @ cdecl _aullrem() @ cdecl _aullshr() +#endif @ cdecl _except_handler2() @ cdecl _except_handler3() @ cdecl _global_unwind2() diff --git a/reactos/ntoskrnl/ntoskrnl_arm.def b/reactos/ntoskrnl/ntoskrnl_arm.def deleted file mode 100644 index 4f7797e2771..00000000000 --- a/reactos/ntoskrnl/ntoskrnl_arm.def +++ /dev/null @@ -1,1485 +0,0 @@ -; reactos/ntoskrnl/ntoskrnl.def -; -; ReactOS Operating System -; -EXPORTS -CcCanIWrite -CcCopyRead -CcCopyWrite -CcDeferWrite -CcFastCopyRead -CcFastCopyWrite -CcFlushCache -CcGetDirtyPages -CcGetFileObjectFromBcb -CcGetFileObjectFromSectionPtrs -CcGetFlushedValidData -CcGetLsnForFileObject -CcInitializeCacheMap -CcIsThereDirtyData -CcFastMdlReadWait DATA -CcFastReadNotPossible DATA -CcFastReadWait DATA -CcMapData -CcMdlRead -CcMdlReadComplete -CcMdlWriteAbort -CcMdlWriteComplete -CcPinMappedData -CcPinRead -CcPrepareMdlWrite -CcPreparePinWrite -CcPurgeCacheSection -CcRemapBcb -CcRepinBcb -CcScheduleReadAhead -CcSetAdditionalCacheAttributes -CcSetBcbOwnerPointer -CcSetDirtyPageThreshold -CcSetDirtyPinnedData -CcSetLogHandleForFile -CcSetReadAheadGranularity -CcUninitializeCacheMap -CcUnpinData -CcUnpinDataForThread -CcUnpinRepinnedBcb -CcWaitForCurrentLazyWriterActivity -CcSetFileSizes -CcZeroData -CmRegisterCallback -CmUnRegisterCallback -DbgBreakPoint -DbgBreakPointWithStatus -DbgLoadImageSymbols -DbgPrint -DbgPrompt -DbgPrintEx -DbgPrintReturnControlC -DbgQueryDebugFilterState -DbgSetDebugFilterState -ExiAcquireFastMutex=ExAcquireFastMutex -ExAcquireFastMutexUnsafe -ExAcquireRundownProtection=ExfAcquireRundownProtection -ExAcquireRundownProtectionCacheAware=ExfAcquireRundownProtectionCacheAware -ExAcquireRundownProtectionCacheAwareEx=ExfAcquireRundownProtectionCacheAwareEx -ExAcquireRundownProtectionEx=ExfAcquireRundownProtectionEx -ExInitializeRundownProtection=ExfInitializeRundownProtection -ExReInitializeRundownProtection=ExfReInitializeRundownProtection -ExReInitializeRundownProtectionCacheAware=ExfReInitializeRundownProtectionCacheAware -ExReleaseRundownProtection=ExfReleaseRundownProtection -ExReleaseRundownProtectionCacheAware=ExfReleaseRundownProtectionCacheAware -ExReleaseRundownProtectionCacheAwareEx=ExfReleaseRundownProtectionCacheAwareEx -ExReleaseRundownProtectionEx=ExfReleaseRundownProtectionEx -ExRundownCompleted=ExfRundownCompleted -ExRundownCompletedCacheAware=ExfRundownCompletedCacheAware -ExWaitForRundownProtectionRelease=ExfWaitForRundownProtectionRelease -ExWaitForRundownProtectionReleaseCacheAware=ExfWaitForRundownProtectionReleaseCacheAware -ExAllocateCacheAwareRundownProtection -ExFreeCacheAwareRundownProtection -ExInitializeRundownProtectionCacheAware -ExSizeOfRundownProtectionCacheAware -ExAcquireResourceExclusiveLite -ExAcquireResourceSharedLite -ExAcquireSharedStarveExclusive -ExAcquireSharedWaitForExclusive -ExAllocateFromPagedLookasideList=ExiAllocateFromPagedLookasideList -ExAllocatePool -ExAllocatePoolWithQuota -ExAllocatePoolWithQuotaTag -ExAllocatePoolWithTag -ExAllocatePoolWithTagPriority -ExConvertExclusiveToSharedLite -ExCreateCallback -ExDeleteNPagedLookasideList -ExDeletePagedLookasideList -ExDeleteResourceLite -ExDesktopObjectType -ExDisableResourceBoostLite -ExEnumHandleTable -ExEnterCriticalRegionAndAcquireFastMutexUnsafe -ExEventObjectType=_ExEventObjectType -ExExtendZone -ExFreePool -ExFreePoolWithTag -ExFreeToPagedLookasideList=ExiFreeToPagedLookasideList -ExGetCurrentProcessorCounts -ExGetCurrentProcessorCpuUsage -ExGetExclusiveWaiterCount -ExGetPreviousMode -ExGetSharedWaiterCount -ExInitializeNPagedLookasideList -ExInitializePagedLookasideList -ExInitializeResourceLite -ExInitializeZone -ExInterlockedAddLargeInteger -ExInterlockedAddLargeStatistic -ExInterlockedAddUlong -ExInterlockedCompareExchange64 -ExInterlockedDecrementLong -ExInterlockedExchangeUlong -ExInterlockedExtendZone -ExInterlockedIncrementLong -ExInterlockedFlushSList -ExInterlockedInsertHeadList -ExInterlockedInsertTailList -ExInterlockedPopEntryList -ExInterlockedPopEntrySList -ExInterlockedPushEntryList -ExInterlockedPushEntrySList -ExInterlockedRemoveHeadList -ExIsProcessorFeaturePresent -ExIsResourceAcquiredExclusiveLite -ExIsResourceAcquiredSharedLite -ExLocalTimeToSystemTime -ExNotifyCallback -ExQueryPoolBlockSize -ExQueueWorkItem -ExRaiseAccessViolation -ExRaiseDatatypeMisalignment -ExRaiseException=RtlRaiseException -ExRaiseHardError -ExRaiseStatus=RtlRaiseStatus -ExRegisterCallback -ExReinitializeResourceLite -ExiReleaseFastMutex=ExReleaseFastMutex -ExReleaseFastMutexUnsafe -ExReleaseFastMutexUnsafeAndLeaveCriticalRegion -ExReleaseResourceForThreadLite -ExReleaseResourceLite -ExSemaphoreObjectType=_ExSemaphoreObjectType -ExSetResourceOwnerPointer -ExSetTimerResolution -ExSystemExceptionFilter -ExSystemTimeToLocalTime -ExiTryToAcquireFastMutex=ExTryToAcquireFastMutex -ExTryToAcquireResourceExclusiveLite -ExUnregisterCallback -ExUuidCreate -ExVerifySuite -ExWindowStationObjectType DATA -ExfInterlockedAddUlong -ExfInterlockedInsertHeadList -ExfInterlockedInsertTailList -ExfInterlockedCompareExchange64 -ExfInterlockedPopEntryList -ExfInterlockedPushEntryList -ExfInterlockedRemoveHeadList -FsRtlAcquireFileExclusive -;FsRtlAddBaseMcbEntry -FsRtlAddLargeMcbEntry -FsRtlAddMcbEntry -FsRtlAddToTunnelCache -FsRtlAllocateFileLock -FsRtlAllocatePool -FsRtlAllocatePoolWithQuota -FsRtlAllocatePoolWithQuotaTag -FsRtlAllocatePoolWithTag -FsRtlAllocateResource -FsRtlAreNamesEqual -FsRtlBalanceReads -FsRtlCheckLockForReadAccess -FsRtlCheckLockForWriteAccess -FsRtlCheckOplock -FsRtlCopyRead -FsRtlCopyWrite -;FsRtlCreateSectionForDataScan -FsRtlCurrentBatchOplock -FsRtlDeleteKeyFromTunnelCache -FsRtlDeleteTunnelCache -FsRtlDeregisterUncProvider -FsRtlDissectDbcs -FsRtlDissectName -FsRtlDoesDbcsContainWildCards -FsRtlDoesNameContainWildCards -FsRtlFastCheckLockForRead -FsRtlFastCheckLockForWrite -FsRtlFastUnlockAll -FsRtlFastUnlockAllByKey -FsRtlFastUnlockSingle -FsRtlFindInTunnelCache -FsRtlFreeFileLock -FsRtlGetFileSize -;FsRtlGetNextBaseMcbEntry -FsRtlGetNextFileLock -FsRtlGetNextLargeMcbEntry -FsRtlGetNextMcbEntry -FsRtlIncrementCcFastReadNotPossible -FsRtlIncrementCcFastReadNoWait -FsRtlIncrementCcFastReadResourceMiss -FsRtlIncrementCcFastReadWait -;FsRtlInitializeBaseMcb -FsRtlInitializeFileLock -FsRtlInitializeLargeMcb -FsRtlInitializeMcb -FsRtlInitializeOplock -FsRtlInitializeTunnelCache -FsRtlInsertPerFileObjectContext -FsRtlInsertPerStreamContext -FsRtlIsDbcsInExpression -FsRtlIsFatDbcsLegal -FsRtlIsHpfsDbcsLegal -FsRtlIsNameInExpression -FsRtlIsNtstatusExpected -FsRtlIsPagingFile -FsRtlIsTotalDeviceFailure -FsRtlLegalAnsiCharacterArray=_FsRtlLegalAnsiCharacterArray -;FsRtlLookupBaseMcbEntry -FsRtlLookupLargeMcbEntry -;FsRtlLookupLastBaseMcbEntry -;FsRtlLookupLastBaseMcbEntryAndIndex -FsRtlLookupLastLargeMcbEntry -FsRtlLookupLastLargeMcbEntryAndIndex -FsRtlLookupLastMcbEntry -FsRtlLookupMcbEntry -FsRtlLookupPerFileObjectContext -FsRtlLookupPerStreamContextInternal -FsRtlMdlRead -FsRtlMdlReadComplete -FsRtlMdlReadCompleteDev -FsRtlMdlReadDev -FsRtlMdlWriteComplete -FsRtlMdlWriteCompleteDev -FsRtlNormalizeNtstatus -FsRtlNotifyChangeDirectory -FsRtlNotifyCleanup -FsRtlNotifyFilterChangeDirectory -FsRtlNotifyFilterReportChange -FsRtlNotifyFullChangeDirectory -FsRtlNotifyFullReportChange -FsRtlNotifyInitializeSync -FsRtlNotifyReportChange -FsRtlNotifyUninitializeSync -FsRtlNotifyVolumeEvent -;FsRtlNumberOfRunsInBaseMcb -FsRtlNumberOfRunsInLargeMcb -FsRtlNumberOfRunsInMcb -FsRtlOplockFsctrl -FsRtlOplockIsFastIoPossible -FsRtlPostPagingFileStackOverflow -FsRtlPostStackOverflow -FsRtlPrepareMdlWrite -FsRtlPrepareMdlWriteDev -FsRtlPrivateLock -FsRtlProcessFileLock -FsRtlRegisterFileSystemFilterCallbacks -FsRtlRegisterUncProvider -FsRtlReleaseFile -;FsRtlRemoveBaseMcbEntry -FsRtlRemoveLargeMcbEntry -FsRtlRemoveMcbEntry -FsRtlRemovePerFileObjectContext -FsRtlRemovePerStreamContext -;FsRtlResetBaseMcb -FsRtlResetLargeMcb -;FsRtlSplitBaseMcb -FsRtlSplitLargeMcb -FsRtlSyncVolumes -FsRtlTeardownPerStreamContexts -;FsRtlTruncateBaseMcb -FsRtlTruncateLargeMcb -FsRtlTruncateMcb -;FsRtlUninitializeBaseMcb -FsRtlUninitializeFileLock -FsRtlUninitializeLargeMcb -FsRtlUninitializeMcb -FsRtlUninitializeOplock -HalDispatchTable=_HalDispatchTable -HalPrivateDispatchTable DATA -HalExamineMBR -InbvAcquireDisplayOwnership -InbvCheckDisplayOwnership -InbvDisplayString -InbvEnableBootDriver -InbvEnableDisplayString -InbvInstallDisplayStringFilter -InbvIsBootDriverInstalled -InbvNotifyDisplayOwnershipLost -InbvResetDisplay -InbvSetScrollRegion -InbvSetTextColor -InbvSolidColorFill -InitSafeBootMode DATA -InterlockedCompareExchange -InterlockedDecrement -InterlockedExchange -InterlockedExchangeAdd -InterlockedIncrement -InterlockedPushEntrySList -InterlockedPopEntrySList -IoAcquireCancelSpinLock -IoAcquireRemoveLockEx -IoAcquireVpbSpinLock -IoAdapterObjectType DATA -IoAllocateAdapterChannel -IoAllocateIrp -IoAllocateMdl -IoAllocateController -IoAllocateDriverObjectExtension -IoAllocateErrorLogEntry -IoAllocateWorkItem -IoAssignDriveLetters -IoAssignResources -IoAttachDevice -IoAttachDeviceByPointer -IoAttachDeviceToDeviceStack -IoAttachDeviceToDeviceStackSafe -IoBuildAsynchronousFsdRequest -IoBuildDeviceIoControlRequest -IoBuildPartialMdl -IoBuildSynchronousFsdRequest -IoCallDriver -IoCancelFileOpen -IoCancelIrp -IoCheckDesiredAccess -IoCheckEaBufferValidity -IoCheckFunctionAccess -IoCheckQuerySetFileInformation -IoCheckQuerySetVolumeInformation -IoCheckQuotaBufferValidity -IoCheckShareAccess -IoCompleteRequest -IoConnectInterrupt -IoCreateController -IoCreateDevice -IoCreateDisk -IoCreateDriver -IoCreateFile -IoCreateFileSpecifyDeviceObjectHint -IoCreateNotificationEvent -IoCreateStreamFileObject -IoCreateStreamFileObjectEx -IoCreateStreamFileObjectLite -IoCreateSymbolicLink -IoCreateSynchronizationEvent -IoCreateUnprotectedSymbolicLink -IoCsqInitialize -IoCsqInitializeEx -IoCsqInsertIrp -IoCsqInsertIrpEx -IoCsqRemoveIrp -IoCsqRemoveNextIrp -IoDeleteController -IoDeleteDevice -IoDeleteDriver -IoDeleteSymbolicLink -IoDetachDevice -IoDeviceHandlerObjectSize DATA -IoDeviceHandlerObjectType DATA -IoDeviceObjectType DATA -IoDisconnectInterrupt -IoDriverObjectType DATA -IoEnqueueIrp -IoEnumerateDeviceObjectList -IoFastQueryNetworkAttributes -IoFileObjectType=_IoFileObjectType -IoForwardAndCatchIrp=IoForwardIrpSynchronously -IoForwardIrpSynchronously -IoFreeController -IoFreeErrorLogEntry -IoFreeIrp -IoFreeMdl -IoFreeWorkItem -IoGetAttachedDevice -IoGetAttachedDeviceReference -IoGetBaseFileSystemDeviceObject -IoGetBootDiskInformation -IoGetConfigurationInformation -IoGetCurrentProcess -IoGetDeviceObjectPointer -IoGetDeviceAttachmentBaseRef -IoGetDeviceInterfaceAlias -IoGetDeviceInterfaces -IoGetDriverObjectExtension -IoGetDeviceProperty -IoGetDeviceToVerify -IoGetDiskDeviceObject -IoGetDmaAdapter -IoGetFileObjectGenericMapping -IoGetInitialStack -IoGetLowerDeviceObject -IoGetRelatedDeviceObject -IoGetRequestorProcess -IoGetRequestorProcessId -IoGetRequestorSessionId -IoGetStackLimits -IoGetTopLevelIrp -IoInitializeIrp -IoInvalidateDeviceRelations -IoInvalidateDeviceState -IoInitializeRemoveLockEx -IoInitializeTimer -IoIsFileOriginRemote -IoIsSystemThread -IoIsValidNameGraftingBuffer -IoIsOperationSynchronous -IoMakeAssociatedIrp -IoOpenDeviceInterfaceRegistryKey -IoOpenDeviceRegistryKey -IoPageRead -IoPnPDeliverServicePowerNotification -IoQueryDeviceDescription -IoQueryFileDosDeviceName -IoQueryFileInformation -IoQueryVolumeInformation -IoQueueThreadIrp -IoQueueWorkItem -IoRaiseHardError -IoRaiseInformationalHardError -IoReadDiskSignature -IoReadOperationCount DATA -IoReadPartitionTable -IoReadPartitionTableEx -IoReadTransferCount DATA -IoRegisterBootDriverReinitialization -IoRegisterDeviceInterface -IoRegisterDriverReinitialization -IoRegisterFileSystem -IoRegisterFsRegistrationChange -IoRegisterLastChanceShutdownNotification -IoRegisterPlugPlayNotification -IoRegisterShutdownNotification -IoReleaseCancelSpinLock -IoReleaseRemoveLockAndWaitEx -IoReleaseRemoveLockEx -IoReleaseVpbSpinLock -IoRemoveShareAccess -IoReportDetectedDevice -IoReportHalResourceUsage -IoReportResourceUsage -IoReportResourceForDetection -IoReportTargetDeviceChange -IoReportTargetDeviceChangeAsynchronous -IoRequestDeviceEject -IoReuseIrp -IoSetCompletionRoutineEx -IoSetSystemPartition -IoSetDeviceInterfaceState -IoSetDeviceToVerify -IoSetFileOrigin -IoSetHardErrorOrVerifyDevice -IoSetInformation -IoSetIoCompletion -IoSetPartitionInformation -IoSetPartitionInformationEx -IoSetStartIoAttributes -IoSetShareAccess -IoSetThreadHardErrorMode -IoSetTopLevelIrp -IoStartNextPacket -IoStartNextPacketByKey -IoStartPacket -IoStartTimer -IoStatisticsLock DATA -IoStopTimer -IoSynchronousPageWrite -IoSynchronousInvalidateDeviceRelations -IoThreadToProcess -IoUnregisterFileSystem -IoUnregisterFsRegistrationChange -IoUnregisterPlugPlayNotification -IoUnregisterShutdownNotification -IoUpdateShareAccess -IoValidateDeviceIoControlAccess -IoVerifyPartitionTable -IoVerifyVolume -IoVolumeDeviceToDosName -IoWMIAllocateInstanceIds -IoWMIDeviceObjectToInstanceName -IoWMIExecuteMethod -IoWMIHandleToInstanceName -IoWMIOpenBlock -IoWMIQueryAllData -IoWMIQueryAllDataMultiple -IoWMIQuerySingleInstance -IoWMIQuerySingleInstanceMultiple -IoWMIRegistrationControl -IoWMISetNotificationCallback -IoWMISetSingleInstance -IoWMISetSingleItem -IoWMISuggestInstanceName -IoWMIWriteEvent -IoWriteErrorLogEntry -IoWriteOperationCount DATA -IoWritePartitionTable -IoWritePartitionTableEx -IoWriteTransferCount DATA -IofCallDriver -IofCompleteRequest -IoIsWdmVersionAvailable -KdChangeOption -KdDebuggerEnabled=_KdDebuggerEnabled -KdDebuggerNotPresent=_KdDebuggerNotPresent -KdDisableDebugger -KdEnableDebugger -KdEnteredDebugger -KdPollBreakIn -KdPowerTransition -KdSystemDebugControl -KeAcquireGuardedMutex -KeAcquireGuardedMutexUnsafe -KeAcquireSpinLockAtDpcLevel -KeAcquireInStackQueuedSpinLockAtDpcLevel -KeAcquireInterruptSpinLock -KeAddSystemServiceTable -KeAreApcsDisabled -KeAttachProcess -;KeBoostCurrentThread -KeBugCheck -KeBugCheckEx -KeCancelTimer -KeCapturePersistentThreadState -KeClearEvent -KeConnectInterrupt -KeDcacheFlushCount DATA -KeDelayExecutionThread -KeDeregisterBugCheckCallback -KeDeregisterBugCheckReasonCallback -KeDetachProcess -KeDisconnectInterrupt -KeEnterCriticalRegion=_KeEnterCriticalRegion -KeEnterGuardedRegion=_KeEnterGuardedRegion -KeEnterKernelDebugger -KeFindConfigurationEntry -KeFindConfigurationNextEntry -KeFlushEntireTb -KeFlushQueuedDpcs -KeGetCurrentThread -KeGetPreviousMode -KeGetRecommendedSharedDataAlignment -KeIcacheFlushCount DATA -KeInitializeApc -KeInitializeDeviceQueue -KeInitializeDpc -KeInitializeEvent -KeInitializeGuardedMutex -KeInitializeInterrupt -KeInitializeMutant -KeInitializeMutex -KeInitializeQueue -KeInitializeSemaphore -KeInitializeSpinLock -KeInitializeTimer -KeInitializeTimerEx -KeInsertByKeyDeviceQueue -KeInsertDeviceQueue -KeInsertHeadQueue -KeInsertQueue -KeInsertQueueApc -KeInsertQueueDpc -KeIsAttachedProcess -KeIsExecutingDpc -KeLeaveCriticalRegion=_KeLeaveCriticalRegion -KeLeaveGuardedRegion=_KeLeaveGuardedRegion -KeLoaderBlock DATA -KeNumberProcessors DATA -KeProfileInterrupt -KeProfileInterruptWithSource -KePulseEvent -KeQueryActiveProcessors -KeQueryInterruptTime -KeQueryPriorityThread -KeQueryRuntimeThread -KeQuerySystemTime -KeQueryTickCount -KeQueryTimeIncrement -KeRaiseUserException -KeReadStateEvent -KeReadStateMutant -KeReadStateMutex=KeReadStateMutant -KeReadStateQueue -KeReadStateSemaphore -KeReadStateTimer -KeRegisterBugCheckCallback -KeRegisterBugCheckReasonCallback -KeReleaseGuardedMutexUnsafe -KeReleaseGuardedMutex -KeReleaseInStackQueuedSpinLockFromDpcLevel -KeReleaseInterruptSpinLock -KeReleaseMutant -KeReleaseMutex -KeReleaseSemaphore -KeReleaseSpinLockFromDpcLevel -KeRemoveByKeyDeviceQueue -KeRemoveByKeyDeviceQueueIfBusy -KeRemoveDeviceQueue -KeRemoveEntryDeviceQueue -KeRemoveQueue -KeRemoveQueueDpc -KeRemoveSystemServiceTable -KeResetEvent -KeRevertToUserAffinityThread -KeRundownQueue -KeSaveStateForHibernate -KeServiceDescriptorTable DATA -KeSetAffinityThread -KeSetBasePriorityThread -KeSetDmaIoCoherency -KeSetEvent -KeSetEventBoostPriority -KeSetIdealProcessorThread -KeSetImportanceDpc -KeSetKernelStackSwapEnable -KeSetPriorityThread -KeSetProfileIrql -KeSetSystemAffinityThread -;KeSetSwapContextNotifyRoutine -KeSetTargetProcessorDpc -;KeSetThreadSelectNotifyRoutine -KeSetTimeIncrement -KeSetTimer -KeSetTimerEx -KeStackAttachProcess -KeSynchronizeExecution -KeTerminateThread -KeTickCount DATA -KeTryToAcquireGuardedMutex -KeUpdateRunTime -KeUpdateSystemTime -KeUnstackDetachProcess -KeUserModeCallback -KeWaitForMultipleObjects -KeWaitForMutexObject=KeWaitForSingleObject -KeWaitForSingleObject -KefAcquireSpinLockAtDpcLevel -KefReleaseSpinLockFromDpcLevel -KiAcquireSpinLock -;KiBugCheckData DATA -KiCheckForKernelApcDelivery -KiDeliverApc -KiEnableTimerWatchdog -KiIpiServiceRoutine -KiReleaseSpinLock -KiUnexpectedInterrupt -;Kii386SpinOnSpinLock -KiRawTicks DATA -LdrAccessResource -LdrEnumResources -LdrFindResourceDirectory_U -LdrFindResource_U -LpcPortObjectType DATA -LpcRequestPort -LpcRequestWaitReplyPort -LsaCallAuthenticationPackage -LsaDeregisterLogonProcess -LsaFreeReturnBuffer -LsaLogonUser -LsaLookupAuthenticationPackage -LsaRegisterLogonProcess -Mm64BitPhysicalAddress DATA -MmAddPhysicalMemory -MmAddVerifierThunks -MmAdjustWorkingSetSize -MmAdvanceMdl -MmAllocateContiguousMemory -MmAllocateContiguousMemorySpecifyCache -MmAllocateMappingAddress -MmAllocateNonCachedMemory -MmAllocatePagesForMdl -MmBuildMdlForNonPagedPool -MmCanFileBeTruncated -MmCreateMdl -MmCreateSection -MmDisableModifiedWriteOfSection -MmFlushImageSection -MmForceSectionClosed -MmFreeContiguousMemory -MmFreeContiguousMemorySpecifyCache -MmFreeMappingAddress -MmFreeNonCachedMemory -MmFreePagesFromMdl -MmGetPhysicalAddress -MmGetPhysicalMemoryRanges -MmGetSystemRoutineAddress -MmGetVirtualForPhysical -MmGrowKernelStack -MmHighestUserAddress DATA -MmIsAddressValid -MmIsDriverVerifying -MmIsNonPagedSystemAddressValid -MmIsRecursiveIoFault -MmIsThisAnNtAsSystem -MmIsVerifierEnabled -MmLockPagableDataSection -MmLockPagableImageSection=MmLockPagableDataSection -MmLockPagableSectionByHandle -MmMapIoSpace -MmMapLockedPages -MmMapLockedPagesSpecifyCache -MmMapLockedPagesWithReservedMapping -MmMapMemoryDumpMdl -MmMapUserAddressesToPage -MmMapVideoDisplay -MmMapViewInSessionSpace -MmMapViewInSystemSpace -MmMapViewOfSection -MmMarkPhysicalMemoryAsBad -MmMarkPhysicalMemoryAsGood -MmPageEntireDriver -MmPrefetchPages -MmProbeAndLockPages -MmProbeAndLockProcessPages -MmProbeAndLockSelectedPages -MmProtectMdlSystemAddress -MmQuerySystemSize -MmRemovePhysicalMemory -MmResetDriverPaging -MmSectionObjectType DATA -MmSecureVirtualMemory -MmSetAddressRangeModified -MmSetBankedSection -MmSizeOfMdl -MmSystemRangeStart DATA -MmTrimAllSystemPagableMemory -MmUnlockPagableImageSection -MmUnlockPages -MmUnmapIoSpace -MmUnmapLockedPages -MmUnmapReservedMapping -MmUnmapVideoDisplay -MmUnmapViewInSessionSpace -MmUnmapViewInSystemSpace -MmUnmapViewOfSection -MmUnsecureVirtualMemory -MmUserProbeAddress DATA -NlsAnsiCodePage DATA -NlsLeadByteInfo DATA -NlsMbCodePageTag DATA -NlsMbOemCodePageTag DATA -NlsOemCodePage DATA -NlsOemLeadByteInfo=_NlsOemLeadByteInfo -NtAddAtom -NtAdjustPrivilegesToken -NtAlertThread -NtAllocateLocallyUniqueId -NtAllocateUuids -NtAllocateVirtualMemory -NtBuildNumber DATA -NtClose -NtConnectPort -NtCreateEvent -NtCreateTimer -NtOpenEvent -NtCreateFile -NtCreateSection -NtDeleteAtom -NtDeleteFile -NtDeviceIoControlFile -NtDuplicateObject -NtDuplicateToken -NtFindAtom -NtFreeVirtualMemory -NtFsControlFile -NtGlobalFlag DATA -NtLockFile -NtMakePermanentObject -NtMapViewOfSection -NtNotifyChangeDirectoryFile -NtOpenFile -NtOpenProcess -NtOpenProcessToken -NtOpenProcessTokenEx -NtOpenThread -NtOpenThreadToken -NtOpenThreadTokenEx -NtQueryDirectoryFile -NtQueryEaFile -NtQueryInformationAtom -NtQueryInformationFile -NtQueryInformationProcess -NtQueryInformationThread -NtQueryInformationToken -NtQueryQuotaInformationFile -NtQuerySecurityObject -NtQuerySystemInformation -NtQuerySystemTime -NtQueryVolumeInformationFile -NtReadFile -NtRequestPort -NtRequestWaitReplyPort -NtSetEaFile -NtSetEvent -NtSetInformationFile -NtSetInformationProcess -NtSetInformationThread -NtSetQuotaInformationFile -NtSetSecurityObject -NtSetVolumeInformationFile -NtSetSystemTime -NtShutdownSystem -NtTraceEvent -NtUnlockFile -NtVdmControl -NtW32Call -NtWaitForSingleObject -NtWriteFile - -; -; Object Manager -ObAssignSecurity -ObCheckCreateObjectAccess -ObCheckObjectAccess -ObCloseHandle -ObCreateObject -ObCreateObjectType -ObDereferenceObject -ObDereferenceObjectDeferDelete -ObDereferenceSecurityDescriptor -ObfDereferenceObject -ObFindHandleForObject -ObfReferenceObject -ObGetObjectSecurity -ObInsertObject -ObIsKernelHandle -ObLogSecurityDescriptor -ObMakeTemporaryObject -ObOpenObjectByName -ObOpenObjectByPointer -ObQueryNameString -ObQueryObjectAuditingByHandle -ObReferenceObjectByHandle -ObReferenceObjectByName -ObReferenceObjectByPointer -;ObReferenceSecurityDescriptor -ObReleaseObjectSecurity -;ObSetHandleAttributes -;ObSetSecurityDescriptorInfo -;ObSetSecurityObjectByPointer - -; -; -; -;PfxFindPrefix -;PfxInitialize -;PfxInsertPrefix -;PfxRemovePrefix -PoCallDriver -PoQueueShutdownWorkItem -PoRegisterDeviceForIdleDetection -PoRegisterSystemState -PoRequestPowerIrp -PoSetDeviceBusy -PoSetPowerState -PoSetSystemState -PoStartNextPowerIrp -PoUnregisterSystemState -ProbeForRead -ProbeForWrite -PsAssignImpersonationToken -PsChargePoolQuota -PsChargeProcessNonPagedPoolQuota=PsDereferenceImpersonationToken -PsChargeProcessPagedPoolQuota -PsChargeProcessPoolQuota -PsCreateSystemProcess -PsCreateSystemThread -PsDereferenceImpersonationToken=PsDereferencePrimaryToken -PsDereferencePrimaryToken -PsDisableImpersonation -PsEstablishWin32Callouts -PsGetContextThread -PsGetCurrentProcess=IoGetCurrentProcess -PsGetCurrentProcessId -PsGetCurrentProcessWin32Process -PsGetCurrentProcessSessionId -PsGetCurrentThread=KeGetCurrentThread -PsGetCurrentThreadId -PsGetCurrentThreadPreviousMode -PsGetCurrentThreadWin32Thread -PsGetCurrentThreadStackBase -PsGetCurrentThreadStackLimit -PsGetJobLock -PsGetJobSessionId -PsGetJobUIRestrictionsClass -PsGetProcessCreateTimeQuadPart -PsGetProcessDebugPort -PsGetProcessExitProcessCalled -PsGetProcessExitStatus -PsGetProcessExitTime -PsGetProcessId -PsGetProcessImageFileName -PsGetProcessInheritedFromUniqueProcessId -PsGetProcessJob -PsGetProcessPeb -PsGetProcessPriorityClass -PsGetProcessSectionBaseAddress -PsGetProcessSecurityPort -PsGetProcessSessionId -PsGetProcessWin32Process -PsGetProcessWin32WindowStation -PsGetThreadFreezeCount -PsGetThreadHardErrorsAreDisabled -PsGetThreadId -PsGetThreadProcess -PsGetThreadProcessId -PsGetThreadSessionId -PsGetThreadTeb -PsGetThreadWin32Thread -PsGetVersion -PsImpersonateClient -PsInitialSystemProcess DATA -PsIsProcessBeingDebugged -PsIsSystemThread -PsIsThreadImpersonating -PsIsThreadTerminating -PsJobType DATA -PsLookupProcessByProcessId -PsLookupProcessThreadByCid -PsLookupThreadByThreadId -PsProcessType=_PsProcessType -PsReferenceImpersonationToken -PsReferencePrimaryToken -PsRemoveCreateThreadNotifyRoutine -PsRemoveLoadImageNotifyRoutine -PsRestoreImpersonation -PsReturnPoolQuota -PsReturnProcessNonPagedPoolQuota -PsReturnProcessPagedPoolQuota -PsRevertToSelf -PsRevertThreadToSelf -PsSetContextThread -PsSetCreateProcessNotifyRoutine -PsSetCreateThreadNotifyRoutine -PsSetJobUIRestrictionsClass -PsSetLegoNotifyRoutine -PsSetProcessPriorityClass -PsSetProcessPriorityByClass -PsSetProcessSecurityPort -PsSetProcessWin32Process -PsSetProcessWindowStation -PsSetThreadHardErrorsAreDisabled -PsSetThreadWin32Thread -PsSetLoadImageNotifyRoutine -PsTerminateSystemThread -PsThreadType=_PsThreadType -READ_REGISTER_UCHAR -READ_REGISTER_ULONG -READ_REGISTER_USHORT -READ_REGISTER_BUFFER_UCHAR -READ_REGISTER_BUFFER_ULONG -READ_REGISTER_BUFFER_USHORT -KeRosDumpStackFrames -RtlAbsoluteToSelfRelativeSD -RtlAddAccessAllowedAce -RtlAddAce -RtlAddAtomToAtomTable -RtlAddRange -;RtlAllocateAndInitializeSid -RtlAllocateHeap -RtlAnsiCharToUnicodeChar -RtlAnsiStringToUnicodeSize=RtlxAnsiStringToUnicodeSize -RtlAnsiStringToUnicodeString -RtlAppendAsciizToString -RtlAppendStringToString -RtlAppendUnicodeStringToString -RtlAppendUnicodeToString -RtlAreAllAccessesGranted -RtlAreAnyAccessesGranted -RtlAreBitsClear -RtlAreBitsSet -RtlAssert -RtlCaptureContext -RtlCaptureStackBackTrace -RtlCharToInteger -RtlCheckRegistryKey -RtlClearAllBits -RtlClearBit -RtlClearBits -RtlCompareMemory -RtlCompareMemoryUlong -RtlCompareString -RtlCompareUnicodeString -RtlCompressBuffer -RtlCompressChunks -RtlConvertLongToLargeInteger -RtlConvertSidToUnicodeString -RtlConvertUlongToLargeInteger -RtlCopyLuid -RtlCopyRangeList -RtlCopySid -RtlCopyString -RtlCopyUnicodeString -RtlCreateAcl -RtlCreateAtomTable -RtlCreateHeap -RtlCreateRegistryKey -RtlCreateSecurityDescriptor -RtlCreateSystemVolumeInformationFolder -RtlCreateUnicodeString -RtlCustomCPToUnicodeN -RtlDecompressBuffer -RtlDecompressChunks -RtlDecompressFragment -RtlDelete -RtlDeleteAce -RtlDeleteAtomFromAtomTable -RtlDeleteElementGenericTable -RtlDeleteElementGenericTableAvl -RtlDeleteNoSplay -RtlDeleteOwnersRanges -RtlDeleteRange -RtlDeleteRegistryValue -RtlDescribeChunk -RtlDestroyAtomTable -RtlDestroyHeap -RtlDowncaseUnicodeString -RtlDuplicateUnicodeString -RtlEmptyAtomTable -RtlEnlargedIntegerMultiply -RtlEnlargedUnsignedDivide -RtlEnlargedUnsignedMultiply -RtlEnumerateGenericTable -RtlEnumerateGenericTableAvl -RtlEnumerateGenericTableLikeADirectory -RtlEnumerateGenericTableWithoutSplaying -RtlEnumerateGenericTableWithoutSplayingAvl -RtlEqualLuid -RtlEqualSid -RtlEqualString -RtlEqualUnicodeString -RtlExtendedIntegerMultiply -RtlExtendedLargeIntegerDivide -RtlExtendedMagicDivide -RtlFillMemory -RtlFillMemoryUlong -RtlFindClearBits -RtlFindClearBitsAndSet -RtlFindClearRuns -RtlFindFirstRunClear -RtlFindFirstRunSet -RtlFindLastBackwardRunClear -RtlFindLeastSignificantBit -RtlFindLongestRunClear -RtlFindLongestRunSet -RtlFindMessage -RtlFindMostSignificantBit -RtlFindNextForwardRunClear -RtlFindRange -RtlFindSetBits -RtlFindSetBitsAndClear -RtlFindUnicodePrefix -RtlFormatCurrentUserKeyPath -RtlFreeAnsiString -RtlFreeHeap -RtlFreeRangeList -RtlFreeOemString -RtlFreeUnicodeString -RtlGUIDFromString -RtlGenerate8dot3Name -RtlGetAce -RtlGetCallersAddress -RtlGetCompressionWorkSpaceSize -RtlGetDaclSecurityDescriptor -RtlGetDefaultCodePage -RtlGetElementGenericTable -RtlGetElementGenericTableAvl -RtlGetFirstRange -RtlGetGroupSecurityDescriptor -RtlGetNextRange -RtlGetNtGlobalFlags -RtlGetOwnerSecurityDescriptor -RtlGetSaclSecurityDescriptor -RtlGetSetBootStatusData -RtlGetVersion -RtlHashUnicodeString -RtlImageNtHeader -RtlImageDirectoryEntryToData -RtlInitAnsiString -RtlInitCodePageTable -RtlInitString -RtlInitUnicodeString -RtlInitializeBitMap -RtlInitializeGenericTable -RtlInitializeGenericTableAvl -RtlInitializeRangeList -RtlInitializeSid -RtlInitializeUnicodePrefix -RtlInsertElementGenericTable -RtlInsertElementGenericTableAvl -RtlInsertElementGenericTableFull -RtlInsertElementGenericTableFullAvl -RtlInsertUnicodePrefix -RtlInt64ToUnicodeString -RtlIntegerToChar -RtlIntegerToUnicode -RtlIntegerToUnicodeString -RtlInvertRangeList -RtlIpv4AddressToStringA -RtlIpv4AddressToStringExA -RtlIpv4AddressToStringExW -RtlIpv4AddressToStringW -RtlIpv4StringToAddressA -RtlIpv4StringToAddressExA -RtlIpv4StringToAddressExW -RtlIpv4StringToAddressW -RtlIpv6AddressToStringA -RtlIpv6AddressToStringExA -RtlIpv6AddressToStringExW -RtlIpv6AddressToStringW -RtlIpv6StringToAddressA -RtlIpv6StringToAddressExA -RtlIpv6StringToAddressExW -RtlIpv6StringToAddressW -RtlIsGenericTableEmpty -RtlIsGenericTableEmptyAvl -RtlIsNameLegalDOS8Dot3 -RtlIsRangeAvailable -RtlIsValidOemCharacter -RtlLargeIntegerAdd -RtlLargeIntegerArithmeticShift -RtlLargeIntegerDivide -RtlLargeIntegerNegate -RtlLargeIntegerShiftLeft -RtlLargeIntegerShiftRight -RtlLargeIntegerSubtract -RtlLengthRequiredSid -RtlLengthSecurityDescriptor -RtlLengthSid -RtlLockBootStatusData -RtlLookupAtomInAtomTable -RtlLookupElementGenericTable -RtlLookupElementGenericTableAvl -RtlLookupElementGenericTableFull -RtlLookupElementGenericTableFullAvl -RtlMapGenericMask -RtlMapSecurityErrorToNtStatus -RtlMergeRangeLists -RtlMoveMemory -RtlMultiByteToUnicodeN -RtlMultiByteToUnicodeSize -RtlNextUnicodePrefix -RtlNtStatusToDosError -RtlNtStatusToDosErrorNoTeb -RtlNumberGenericTableElements -RtlNumberGenericTableElementsAvl -RtlNumberOfClearBits -RtlNumberOfSetBits -RtlOemStringToCountedUnicodeString -RtlOemStringToUnicodeSize=RtlxOemStringToUnicodeSize -RtlOemStringToUnicodeString -RtlOemToUnicodeN -RtlPinAtomInAtomTable -RtlPrefetchMemoryNonTemporal -RtlPrefixString -RtlPrefixUnicodeString -RtlQueryAtomInAtomTable -RtlQueryRegistryValues -RtlQueryTimeZoneInformation -RtlRaiseException -RtlRandom -RtlRandomEx -RtlRealPredecessor -RtlRealSuccessor -RtlRemoveUnicodePrefix -RtlReserveChunk -RtlSecondsSince1970ToTime -RtlSecondsSince1980ToTime -RtlSelfRelativeToAbsoluteSD2 -RtlSelfRelativeToAbsoluteSD -RtlSetAllBits -RtlSetBit -RtlSetBits -RtlSetDaclSecurityDescriptor -RtlSetGroupSecurityDescriptor -RtlSetOwnerSecurityDescriptor -RtlSetSaclSecurityDescriptor -RtlSetTimeZoneInformation -RtlSizeHeap -RtlSplay -RtlStringFromGUID -RtlSubAuthorityCountSid -RtlSubAuthoritySid -RtlSubtreePredecessor -RtlSubtreeSuccessor -RtlTestBit -RtlTimeFieldsToTime -RtlTimeToElapsedTimeFields -RtlTimeToSecondsSince1970 -RtlTimeToSecondsSince1980 -RtlTimeToTimeFields -RtlUlongByteSwap -RtlUlonglongByteSwap -RtlUnicodeStringToAnsiSize=RtlxUnicodeStringToAnsiSize -RtlUnicodeStringToAnsiString -RtlUnicodeStringToCountedOemString -RtlUnicodeStringToInteger -RtlUnicodeStringToOemSize=RtlxUnicodeStringToOemSize -RtlUnicodeStringToOemString -RtlUnicodeToCustomCPN -RtlUnicodeToMultiByteN -RtlUnicodeToMultiByteSize -RtlUnicodeToOemN -RtlUnlockBootStatusData -RtlUnwind -RtlUpcaseUnicodeChar -RtlUpcaseUnicodeString -RtlUpcaseUnicodeStringToAnsiString -RtlUpcaseUnicodeStringToCountedOemString -RtlUpcaseUnicodeStringToOemString -RtlUpcaseUnicodeToCustomCPN -RtlUpcaseUnicodeToMultiByteN -RtlUpcaseUnicodeToOemN -RtlUpperChar -RtlUpperString -RtlUshortByteSwap -RtlValidRelativeSecurityDescriptor -RtlValidSecurityDescriptor -RtlValidSid -RtlVerifyVersionInfo -RtlVolumeDeviceToDosName -RtlWalkFrameChain -RtlWriteRegistryValue -RtlZeroHeap -RtlZeroMemory -RtlxAnsiStringToUnicodeSize -RtlxOemStringToUnicodeSize -RtlxUnicodeStringToAnsiSize -RtlxUnicodeStringToOemSize -SeAccessCheck -SeAppendPrivileges -SeAssignSecurity -SeAssignSecurityEx -SeAuditHardLinkCreation -SeAuditingFileEvents -SeAuditingFileEventsWithContext -SeAuditingFileOrGlobalEvents -SeAuditingHardLinkEvents -SeAuditingHardLinkEventsWithContext -SeCaptureSecurityDescriptor -SeCaptureSubjectContext -SeCloseObjectAuditAlarm -SeCreateAccessState -SeCreateClientSecurity -SeCreateClientSecurityFromSubjectContext -SeDeassignSecurity -SeDeleteAccessState -SeDeleteObjectAuditAlarm -SeExports DATA -SeFilterToken -SeFreePrivileges -SeImpersonateClient -SeImpersonateClientEx -SeLockSubjectContext -SeMarkLogonSessionForTerminationNotification -SeOpenObjectAuditAlarm -SeOpenObjectForDeleteAuditAlarm -SePrivilegeCheck -SePrivilegeObjectAuditAlarm -SePublicDefaultDacl DATA -SeQueryAuthenticationIdToken -SeQueryInformationToken -SeQuerySecurityDescriptorInfo -SeQuerySessionIdToken -SeRegisterLogonSessionTerminatedRoutine -SeReleaseSecurityDescriptor -SeReleaseSubjectContext -SeSetAccessStateGenericMapping -SeSetSecurityDescriptorInfo -SeSetSecurityDescriptorInfoEx -SeSinglePrivilegeCheck -SeSystemDefaultDacl DATA -SeTokenImpersonationLevel -SeTokenIsAdmin -SeTokenIsRestricted -SeTokenIsWriteRestricted -SeTokenType -SeUnlockSubjectContext -SeUnregisterLogonSessionTerminatedRoutine -SeValidSecurityDescriptor -VerSetConditionMask -WRITE_REGISTER_UCHAR -WRITE_REGISTER_ULONG -WRITE_REGISTER_USHORT -WRITE_REGISTER_BUFFER_UCHAR -WRITE_REGISTER_BUFFER_ULONG -WRITE_REGISTER_BUFFER_USHORT -ZwAccessCheckAndAuditAlarm -ZwAddBootEntry -ZwAdjustPrivilegesToken -ZwAlertThread -ZwAllocateVirtualMemory -ZwAssignProcessToJobObject -ZwCancelIoFile -ZwCancelTimer -ZwClearEvent -ZwClose -ZwCloseObjectAuditAlarm -ZwConnectPort -ZwCreateDirectoryObject -ZwCreateEvent -ZwCreateFile -ZwCreateJobObject -ZwCreateKey -ZwCreateSection -ZwCreateSymbolicLinkObject -ZwCreateTimer -ZwDeleteFile -ZwDeleteKey -ZwDeleteValueKey -ZwDeviceIoControlFile -ZwDisplayString -ZwDuplicateObject -ZwDuplicateToken -ZwEnumerateBootEntries -ZwEnumerateKey -ZwEnumerateValueKey -ZwFlushInstructionCache -ZwFlushKey -ZwFlushVirtualMemory -ZwFreeVirtualMemory -ZwFsControlFile -ZwInitiatePowerAction -ZwIsProcessInJob -ZwLoadDriver -ZwLoadKey -ZwMakeTemporaryObject -ZwMapViewOfSection -ZwNotifyChangeKey -ZwOpenDirectoryObject -ZwOpenEvent -ZwOpenFile -ZwOpenJobObject -ZwOpenKey -ZwOpenProcess -ZwOpenProcessToken -ZwOpenProcessTokenEx -ZwOpenSection -ZwOpenSymbolicLinkObject -ZwOpenThread -ZwOpenThreadToken -ZwOpenThreadTokenEx -ZwOpenTimer -ZwPowerInformation -ZwPulseEvent -ZwQueryBootEntryOrder -ZwQueryBootOptions -ZwQueryDefaultLocale -ZwQueryDefaultUILanguage -ZwQueryDirectoryFile -ZwQueryDirectoryObject -ZwQueryEaFile -ZwQueryFullAttributesFile -ZwQueryInformationAtom -ZwQueryInformationFile -ZwQueryInformationJobObject -ZwQueryInformationProcess -ZwQueryInformationThread -ZwQueryInformationToken -ZwQueryInstallUILanguage -ZwQueryKey -ZwQueryObject -ZwQuerySection -ZwQuerySecurityObject -ZwQuerySymbolicLinkObject -ZwQuerySystemInformation -ZwQuerySystemTime -ZwQueryValueKey -ZwQueryVolumeInformationFile -ZwReadFile -ZwReplaceKey -ZwRequestWaitReplyPort -ZwResetEvent -ZwRestoreKey -ZwSaveKey -ZwSaveKeyEx -ZwSetBootEntryOrder -ZwSetBootOptions -ZwSetDefaultLocale -ZwSetDefaultUILanguage -ZwSetEaFile -ZwSetEvent -ZwSetInformationFile -ZwSetInformationJobObject -ZwSetInformationObject -ZwSetInformationProcess -ZwSetInformationThread -ZwSetSecurityObject -ZwSetSystemInformation -ZwSetSystemTime -ZwSetTimer -ZwSetValueKey -ZwSetVolumeInformationFile -ZwTerminateJobObject -ZwTerminateProcess -ZwTranslateFilePath -ZwUnloadDriver -ZwUnloadKey -ZwUnmapViewOfSection -ZwWaitForMultipleObjects -ZwWaitForSingleObject -ZwWriteFile -ZwYieldExecution -_abnormal_termination -_except_handler2 -_except_handler3 -_global_unwind2 -_itoa -_itow -_local_unwind2 -_purecall -_snprintf -_snwprintf -_stricmp -_strlwr -_strnicmp -_strnset -_strrev -_strset -_strupr -_vsnprintf -_vsnwprintf -_wcsicmp -_wcslwr -_wcsnicmp -_wcsnset -_wcsrev -_wcsupr -atoi -atol -isdigit -islower -isprint -isspace -isupper -isxdigit -mbstowcs -mbtowc -memchr -memcpy -memmove -memset -qsort -rand -sprintf -srand -strcat -strchr -strcmp -strcpy -strlen -strncat -strncmp -strncpy -strrchr -strspn -strstr -swprintf -tolower -toupper -towlower -towupper -vDbgPrintEx -vDbgPrintExWithPrefix -vsprintf -wcscat -wcschr -wcscmp -wcscpy -wcscspn -wcslen -wcsncat -wcsncmp -wcsncpy -wcsrchr -wcsspn -wcsstr -wcstombs -wctomb diff --git a/reactos/ntoskrnl/ob/obdir.c b/reactos/ntoskrnl/ob/obdir.c index 1b7f1b3ff12..0bccc1234a0 100644 --- a/reactos/ntoskrnl/ob/obdir.c +++ b/reactos/ntoskrnl/ob/obdir.c @@ -1,7 +1,7 @@ /* * PROJECT: ReactOS Kernel * LICENSE: GPL - See COPYING in the top level directory - * FILE: ntoskrnl/ob/dirobj.c + * FILE: ntoskrnl/ob/obdir.c * PURPOSE: Manages the Object Manager's Directory Implementation, * such as functions for addition, deletion and lookup into * the Object Manager's namespace. These routines are separate @@ -62,7 +62,7 @@ ObpInsertEntryDirectory(IN POBJECT_DIRECTORY Parent, /* Invalid context */ DPRINT1("OB: ObpInsertEntryDirectory - invalid context %p %ld\n", Context, Context->DirectoryLocked); - KEBUGCHECK(0); + ASSERT(FALSE); return FALSE; } @@ -252,7 +252,7 @@ ObpLookupEntryDirectory(IN POBJECT_DIRECTORY Directory, if ((SearchShadow) && (Directory->DeviceMap)) { /* FIXME: We don't support this yet */ - KEBUGCHECK(0); + ASSERT(FALSE); } } @@ -326,7 +326,7 @@ ObpDeleteEntryDirectory(POBP_LOOKUP_CONTEXT Context) CurrentEntry->ChainLink = NULL; /* Free it */ - ExFreePool(CurrentEntry); + ExFreePoolWithTag(CurrentEntry, OB_DIR_TAG); /* Return */ return TRUE; @@ -529,7 +529,7 @@ NtQueryDirectoryObject(IN HANDLE DirectoryHandle, if (!NT_SUCCESS(Status)) { /* Free the buffer and fail */ - ExFreePool(LocalBuffer); + ExFreePoolWithTag(LocalBuffer, OB_NAME_TAG); return Status; } @@ -701,7 +701,7 @@ Quickie: /* Dereference the directory and free our buffer */ ObDereferenceObject(Directory); - ExFreePool(LocalBuffer); + ExFreePoolWithTag(LocalBuffer, OB_NAME_TAG); /* Return status to caller */ return Status; diff --git a/reactos/ntoskrnl/ob/obhandle.c b/reactos/ntoskrnl/ob/obhandle.c index a82595f477c..5916040c591 100644 --- a/reactos/ntoskrnl/ob/obhandle.c +++ b/reactos/ntoskrnl/ob/obhandle.c @@ -289,7 +289,7 @@ ObpInsertHandleCount(IN POBJECT_HEADER ObjectHeader) else { /* Otherwise we had a DB, free it */ - ExFreePool(OldHandleDatabase); + ExFreePoolWithTag(OldHandleDatabase, TAG_OB_HANDLE); } /* Find the end of the copy and zero out the new data */ @@ -697,7 +697,7 @@ ObpCloseHandleTableEntry(IN PHANDLE_TABLE HandleTable, else { /* Otherwise, bugcheck the OS */ - KeBugCheckEx(0x8B, (ULONG_PTR)Handle, 0, 0, 0); + KeBugCheckEx(INVALID_KERNEL_HANDLE, (ULONG_PTR)Handle, 0, 0, 0); } } @@ -916,7 +916,7 @@ ObpIncrementHandleCount(IN PVOID Object, { /* FIXME: This should never happen for now */ DPRINT1("Unhandled case\n"); - KEBUGCHECK(0); + ASSERT(FALSE); goto Quickie; } } @@ -945,7 +945,7 @@ ObpIncrementHandleCount(IN PVOID Object, { /* FIXME: This should never happen for now */ DPRINT1("Unhandled case\n"); - KEBUGCHECK(0); + ASSERT(FALSE); return Status; } } @@ -1143,7 +1143,7 @@ ObpIncrementUnnamedHandleCount(IN PVOID Object, { /* FIXME: This should never happen for now */ DPRINT1("Unhandled case\n"); - KEBUGCHECK(0); + ASSERT(FALSE); goto Quickie; } } @@ -1169,7 +1169,7 @@ ObpIncrementUnnamedHandleCount(IN PVOID Object, { /* FIXME: This should never happen for now */ DPRINT1("Unhandled case\n"); - KEBUGCHECK(0); + ASSERT(FALSE); return Status; } } @@ -1753,7 +1753,7 @@ ObpCloseHandle(IN HANDLE Handle, if (KdDebuggerEnabled) { /* Bugcheck */ - KeBugCheckEx(0, (ULONG_PTR)Handle, 1, 0, 0); + KeBugCheckEx(INVALID_KERNEL_HANDLE, (ULONG_PTR)Handle, 1, 0, 0); } } } @@ -2425,7 +2425,7 @@ ObOpenObjectByName(IN POBJECT_ATTRIBUTES ObjectAttributes, if (!NT_SUCCESS(Status)) { /* Fail */ - ExFreePool(TempBuffer); + ExFreePoolWithTag(TempBuffer, TAG_OB_TEMP_STORAGE); return Status; } @@ -2533,7 +2533,7 @@ Quickie: /* Release the object attributes and temporary buffer */ ObpReleaseObjectCreateInformation(&TempBuffer->ObjectCreateInfo); if (ObjectName.Buffer) ObpFreeObjectNameBuffer(&ObjectName); - ExFreePool(TempBuffer); + ExFreePoolWithTag(TempBuffer, TAG_OB_TEMP_STORAGE); /* Return status */ OBTRACE(OB_HANDLE_DEBUG, @@ -3034,7 +3034,7 @@ ObInsertObject(IN PVOID Object, { /* Weird case where we need to do a manual delete */ DPRINT1("Unhandled path\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* Cleanup the lookup */ @@ -3052,7 +3052,7 @@ ObInsertObject(IN PVOID Object, } /* Return failure code */ - KEBUGCHECK(0); + ASSERT(FALSE); return Status; } } diff --git a/reactos/ntoskrnl/ob/obinit.c b/reactos/ntoskrnl/ob/obinit.c index 1cf18b051f6..51a2f9fca36 100644 --- a/reactos/ntoskrnl/ob/obinit.c +++ b/reactos/ntoskrnl/ob/obinit.c @@ -1,7 +1,7 @@ /* * PROJECT: ReactOS Kernel * LICENSE: GPL - See COPYING in the top level directory - * FILE: ntoskrnl/ob/init.c + * FILE: ntoskrnl/ob/obinit.c * PURPOSE: Handles Object Manager Initialization and Shutdown * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) * Eric Kohl @@ -124,7 +124,7 @@ ObInit2(VOID) BOOLEAN INIT_FUNCTION NTAPI -ObInit(VOID) +ObInitSystem(VOID) { OBJECT_ATTRIBUTES ObjectAttributes; UNICODE_STRING Name; diff --git a/reactos/ntoskrnl/ob/oblife.c b/reactos/ntoskrnl/ob/oblife.c index 91b550d3533..9a1e26c932f 100644 --- a/reactos/ntoskrnl/ob/oblife.c +++ b/reactos/ntoskrnl/ob/oblife.c @@ -1,7 +1,7 @@ /* * PROJECT: ReactOS Kernel * LICENSE: GPL - See COPYING in the top level directory - * FILE: ntoskrnl/ob/create.c + * FILE: ntoskrnl/ob/oblife.c * PURPOSE: Manages the lifetime of an Object, including its creation, * and deletion, as well as setting or querying any of its * information while it is active. Since Object Types are also @@ -15,7 +15,7 @@ #include #define NDEBUG -#include +#include extern ULONG NtGlobalFlag; diff --git a/reactos/ntoskrnl/ob/oblink.c b/reactos/ntoskrnl/ob/oblink.c index c173d1baf8a..8c7c9a2838f 100644 --- a/reactos/ntoskrnl/ob/oblink.c +++ b/reactos/ntoskrnl/ob/oblink.c @@ -1,7 +1,7 @@ /* * PROJECT: ReactOS Kernel * LICENSE: GPL - See COPYING in the top level directory -* FILE: ntoskrnl/ob/symlink.c +* FILE: ntoskrnl/ob/oblink.c * PURPOSE: Implements symbolic links * PROGRAMMERS: Alex Ionescu (alex@relsoft.net) * David Welch (welch@mcmail.com) @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include /* GLOBALS ******************************************************************/ @@ -49,7 +49,7 @@ ObpCreateSymbolicLinkName(IN POBJECT_SYMBOLIC_LINK SymbolicLink) /* FIXME: We don't support device maps yet */ DPRINT1("Unhandled path!\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /*++ diff --git a/reactos/ntoskrnl/ob/obname.c b/reactos/ntoskrnl/ob/obname.c index 513032127e2..79800319003 100644 --- a/reactos/ntoskrnl/ob/obname.c +++ b/reactos/ntoskrnl/ob/obname.c @@ -1,7 +1,7 @@ /* * PROJECT: ReactOS Kernel * LICENSE: GPL - See COPYING in the top level directory - * FILE: ntoskrnl/ob/namespce.c + * FILE: ntoskrnl/ob/obname.c * PURPOSE: Manages all functions related to the Object Manager name- * space, such as finding objects or querying their names. * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) @@ -720,7 +720,7 @@ ParseFromRoot: if (ObjectNameInfo->Name.Buffer) { /* Free it */ - ExFreePool(ObjectNameInfo->Name.Buffer); + ExFreePoolWithTag(ObjectNameInfo->Name.Buffer, OB_NAME_TAG ); } /* Write new one */ diff --git a/reactos/ntoskrnl/ob/obref.c b/reactos/ntoskrnl/ob/obref.c index 0ebb04b5fbd..eaa45237217 100644 --- a/reactos/ntoskrnl/ob/obref.c +++ b/reactos/ntoskrnl/ob/obref.c @@ -1,7 +1,7 @@ /* * PROJECT: ReactOS Kernel * LICENSE: GPL - See COPYING in the top level directory - * FILE: ntoskrnl/ob/refderef.c + * FILE: ntoskrnl/ob/obref.c * PURPOSE: Manages the referencing and de-referencing of all Objects, * as well as the Object Fast Reference implementation. * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) diff --git a/reactos/ntoskrnl/ob/obsdcach.c b/reactos/ntoskrnl/ob/obsdcach.c index b252ae61450..9a27a2a7b5c 100644 --- a/reactos/ntoskrnl/ob/obsdcach.c +++ b/reactos/ntoskrnl/ob/obsdcach.c @@ -1,10 +1,9 @@ /* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/ob/sdcache.c - * PURPOSE: No purpose listed. - * - * PROGRAMMERS: David Welch (welch@cwcom.net) + * PROJECT: ReactOS Kernel + * LICENSE: GPL - See COPYING in the top level directory + * FILE: ntoskrnl/ob/obsdcach.c + * PURPOSE: Security Descriptor Caching + * PROGRAMMERS: Aleksey Bragin (aleksey@reactos.org) */ /* INCLUDES *******************************************************************/ @@ -82,11 +81,12 @@ ObpHash(IN PVOID Buffer, PULONG p, pp; PUCHAR pb, ppb; ULONG Hash = 0; - + /* Setup aligned and byte buffers */ p = Buffer; + pb = (PUCHAR)p; ppb = (PUCHAR)((ULONG_PTR)Buffer + Length); - pp = (PULONG)ALIGN_DOWN(p + Length, ULONG); + pp = (PULONG)ALIGN_DOWN(pb + Length, ULONG); /* Loop aligned data */ while (p < pp) @@ -95,7 +95,7 @@ ObpHash(IN PVOID Buffer, Hash ^= *p++; Hash = _rotl(Hash, 3); } - + /* Loop non-aligned data */ pb = (PUCHAR)p; while (pb < ppb) diff --git a/reactos/ntoskrnl/ob/obsecure.c b/reactos/ntoskrnl/ob/obsecure.c index 6d4653804a0..493f3a45e3b 100644 --- a/reactos/ntoskrnl/ob/obsecure.c +++ b/reactos/ntoskrnl/ob/obsecure.c @@ -40,7 +40,7 @@ ObAssignObjectSecurityDescriptor(IN PVOID Object, if (NT_SUCCESS(Status)) { /* Free the old copy */ - ExFreePool(SecurityDescriptor); + ExFreePoolWithTag(SecurityDescriptor, TAG_SD); /* Set the new pointer */ ASSERT(NewSd); @@ -633,7 +633,7 @@ ObGetObjectSecurity(IN PVOID Object, if (!NT_SUCCESS(Status)) { /* Free the descriptor and tell the caller we failed */ - ExFreePool(*SecurityDescriptor); + ExFreePoolWithTag(*SecurityDescriptor, TAG_SEC_QUERY); *MemoryAllocated = FALSE; } diff --git a/reactos/ntoskrnl/ob/obwait.c b/reactos/ntoskrnl/ob/obwait.c index a110604b6d5..eddb17d4ba3 100644 --- a/reactos/ntoskrnl/ob/obwait.c +++ b/reactos/ntoskrnl/ob/obwait.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include /* FUNCTIONS *****************************************************************/ @@ -279,7 +279,7 @@ Quickie: } /* Free wait block array */ - if (WaitBlockArray) ExFreePool(WaitBlockArray); + if (WaitBlockArray) ExFreePoolWithTag(WaitBlockArray, TAG_WAIT); /* Re-enable APCs if needed */ if (LockInUse) KeLeaveCriticalRegion(); diff --git a/reactos/ntoskrnl/po/events.c b/reactos/ntoskrnl/po/events.c index 51450faab09..0cd97405a47 100644 --- a/reactos/ntoskrnl/po/events.c +++ b/reactos/ntoskrnl/po/events.c @@ -1,18 +1,27 @@ /* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel + * PROJECT: ReactOS Kernel + * LICENSE: GPL - See COPYING in the top level directory * FILE: ntoskrnl/po/events.c * PURPOSE: Power Manager - * * PROGRAMMERS: Hervй Poussineau (hpoussin@reactos.org) */ +/* INCLUDES ******************************************************************/ + #include #define NDEBUG -#include +#include -PKWIN32_POWEREVENT_CALLOUT PopEventCallout; -extern PCALLBACK_OBJECT SetSystemTimeCallback; +/* GLOBALS *******************************************************************/ + +typedef struct _SYS_BUTTON_CONTEXT +{ + PDEVICE_OBJECT DeviceObject; + PIO_WORKITEM WorkItem; + KEVENT Event; + IO_STATUS_BLOCK IoStatusBlock; + ULONG SysButton; +} SYS_BUTTON_CONTEXT, *PSYS_BUTTON_CONTEXT; static VOID NTAPI @@ -20,6 +29,11 @@ PopGetSysButton( IN PDEVICE_OBJECT DeviceObject, IN PVOID Context); +PKWIN32_POWEREVENT_CALLOUT PopEventCallout; +extern PCALLBACK_OBJECT SetSystemTimeCallback; + +/* FUNCTIONS *****************************************************************/ + VOID NTAPI PoNotifySystemTimeSet(VOID) @@ -40,15 +54,6 @@ PoNotifySystemTimeSet(VOID) } } -typedef struct _SYS_BUTTON_CONTEXT -{ - PDEVICE_OBJECT DeviceObject; - PIO_WORKITEM WorkItem; - KEVENT Event; - IO_STATUS_BLOCK IoStatusBlock; - ULONG SysButton; -} SYS_BUTTON_CONTEXT, *PSYS_BUTTON_CONTEXT; - static NTSTATUS NTAPI PopGetSysButtonCompletion( @@ -137,9 +142,8 @@ PopGetSysButton( NTSTATUS NTAPI -PopAddRemoveSysCapsCallback( - IN PVOID NotificationStructure, - IN PVOID Context) +PopAddRemoveSysCapsCallback(IN PVOID NotificationStructure, + IN PVOID Context) { PDEVICE_INTERFACE_CHANGE_NOTIFICATION Notification; PSYS_BUTTON_CONTEXT SysButtonContext; diff --git a/reactos/ntoskrnl/po/power.c b/reactos/ntoskrnl/po/power.c index 74c8b059fed..21fe70624b1 100644 --- a/reactos/ntoskrnl/po/power.c +++ b/reactos/ntoskrnl/po/power.c @@ -1,16 +1,19 @@ /* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel + * PROJECT: ReactOS Kernel + * LICENSE: GPL - See COPYING in the top level directory * FILE: ntoskrnl/po/power.c * PURPOSE: Power Manager - * * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net) * Hervй Poussineau (hpoussin@reactos.com) */ +/* INCLUDES ******************************************************************/ + #include #define NDEBUG -#include +#include + +/* GLOBALS *******************************************************************/ extern ULONG ExpInitialiationPhase; @@ -24,50 +27,11 @@ typedef struct _REQUEST_POWER_ITEM PDEVICE_NODE PopSystemPowerDeviceNode = NULL; BOOLEAN PopAcpiPresent = FALSE; -/* - * @implemented - */ -NTSTATUS -STDCALL -PoCallDriver(IN PDEVICE_OBJECT DeviceObject, - IN OUT PIRP Irp) -{ - NTSTATUS Status; - - Status = IoCallDriver(DeviceObject, Irp); - - return Status; -} - -/* - * @unimplemented - */ -PULONG -STDCALL -PoRegisterDeviceForIdleDetection(IN PDEVICE_OBJECT DeviceObject, - IN ULONG ConservationIdleTime, - IN ULONG PerformanceIdleTime, - IN DEVICE_POWER_STATE State) -{ - UNIMPLEMENTED; - return NULL; -} - -/* - * @unimplemented - */ -PVOID -STDCALL -PoRegisterSystemState(IN PVOID StateHandle, - IN EXECUTION_STATE Flags) -{ - UNIMPLEMENTED; - return NULL; -} +/* PRIVATE FUNCTIONS *********************************************************/ static NTSTATUS -STDCALL +NTAPI PopRequestPowerIrpCompletion(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Context) @@ -90,94 +54,6 @@ PopRequestPowerIrpCompletion(IN PDEVICE_OBJECT DeviceObject, return STATUS_SUCCESS; } -/* - * @implemented - */ -NTSTATUS -STDCALL -PoRequestPowerIrp(IN PDEVICE_OBJECT DeviceObject, - IN UCHAR MinorFunction, - IN POWER_STATE PowerState, - IN PREQUEST_POWER_COMPLETE CompletionFunction, - IN PVOID Context, - OUT PIRP *pIrp OPTIONAL) -{ - PDEVICE_OBJECT TopDeviceObject; - PIO_STACK_LOCATION Stack; - PIRP Irp; - PIO_STATUS_BLOCK IoStatusBlock; - PREQUEST_POWER_ITEM RequestPowerItem; - NTSTATUS Status; - - if (MinorFunction != IRP_MN_QUERY_POWER - && MinorFunction != IRP_MN_SET_POWER - && MinorFunction != IRP_MN_WAIT_WAKE) - return STATUS_INVALID_PARAMETER_2; - - RequestPowerItem = ExAllocatePool(NonPagedPool, sizeof(REQUEST_POWER_ITEM)); - if (!RequestPowerItem) - return STATUS_INSUFFICIENT_RESOURCES; - IoStatusBlock = ExAllocatePool(NonPagedPool, sizeof(IO_STATUS_BLOCK)); - if (!IoStatusBlock) - { - ExFreePool(RequestPowerItem); - return STATUS_INSUFFICIENT_RESOURCES; - } - - /* Always call the top of the device stack */ - TopDeviceObject = IoGetAttachedDeviceReference(DeviceObject); - - Irp = IoBuildSynchronousFsdRequest(IRP_MJ_PNP, - TopDeviceObject, - NULL, - 0, - NULL, - NULL, - IoStatusBlock); - if (!Irp) - { - ExFreePool(RequestPowerItem); - ExFreePool(IoStatusBlock); - return STATUS_INSUFFICIENT_RESOURCES; - } - - /* POWER IRPs are always initialized with a status code of - STATUS_NOT_IMPLEMENTED */ - Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED; - Irp->IoStatus.Information = 0; - - Stack = IoGetNextIrpStackLocation(Irp); - Stack->MinorFunction = MinorFunction; - if (MinorFunction == IRP_MN_WAIT_WAKE) - Stack->Parameters.WaitWake.PowerState = PowerState.SystemState; - else - Stack->Parameters.WaitWake.PowerState = PowerState.DeviceState; - - RequestPowerItem->CompletionRoutine = CompletionFunction; - RequestPowerItem->PowerState = PowerState; - RequestPowerItem->Context = Context; - - if (pIrp != NULL) - *pIrp = Irp; - - IoSetCompletionRoutine(Irp, PopRequestPowerIrpCompletion, RequestPowerItem, TRUE, TRUE, TRUE); - Status = IoCallDriver(TopDeviceObject, Irp); - - /* Always return STATUS_PENDING. The completion routine - * will call CompletionFunction and complete the Irp. - */ - return STATUS_PENDING; -} - -#undef PoSetDeviceBusy -VOID -NTAPI -PoSetDeviceBusy(IN PULONG IdlePointer) -{ - UNIMPLEMENTED; - *IdlePointer = 0; -} - VOID NTAPI PopCleanupPowerState(IN PPOWER_STATE PowerState) @@ -185,55 +61,6 @@ PopCleanupPowerState(IN PPOWER_STATE PowerState) //UNIMPLEMENTED; } -/* - * @unimplemented - */ -POWER_STATE -STDCALL -PoSetPowerState(IN PDEVICE_OBJECT DeviceObject, - IN POWER_STATE_TYPE Type, - IN POWER_STATE State) -{ - POWER_STATE ps; - - ASSERT_IRQL(DISPATCH_LEVEL); - - ps.SystemState = PowerSystemWorking; // Fully on - ps.DeviceState = PowerDeviceD0; // Fully on - - return ps; -} - -/* - * @unimplemented - */ -VOID -STDCALL -PoSetSystemState(IN EXECUTION_STATE Flags) -{ - UNIMPLEMENTED; -} - -/* - * @unimplemented - */ -VOID -STDCALL -PoStartNextPowerIrp(IN PIRP Irp) -{ - UNIMPLEMENTED; -} - -/* - * @unimplemented - */ -VOID -STDCALL -PoUnregisterSystemState(IN PVOID StateHandle) -{ - UNIMPLEMENTED; -} - NTSTATUS NTAPI PopSetSystemPowerState(SYSTEM_POWER_STATE PowerState) @@ -251,7 +78,7 @@ PopSetSystemPowerState(SYSTEM_POWER_STATE PowerState) Status = IopGetSystemPowerDeviceObject(&DeviceObject); if (!NT_SUCCESS(Status)) { - CPRINT("No system power driver available\n"); + DPRINT1("No system power driver available\n"); return STATUS_UNSUCCESSFUL; } @@ -387,11 +214,197 @@ PoInitializePrcb(IN PKPRCB Prcb) KeInitializeTimerEx(&Prcb->PowerState.PerfTimer, SynchronizationTimer); } +/* PUBLIC FUNCTIONS **********************************************************/ + +/* + * @implemented + */ +NTSTATUS +NTAPI +PoCallDriver(IN PDEVICE_OBJECT DeviceObject, + IN OUT PIRP Irp) +{ + NTSTATUS Status; + + /* Forward to Io -- FIXME! */ + Status = IoCallDriver(DeviceObject, Irp); + + /* Return status */ + return Status; +} + +/* + * @unimplemented + */ +PULONG +NTAPI +PoRegisterDeviceForIdleDetection(IN PDEVICE_OBJECT DeviceObject, + IN ULONG ConservationIdleTime, + IN ULONG PerformanceIdleTime, + IN DEVICE_POWER_STATE State) +{ + UNIMPLEMENTED; + return NULL; +} + +/* + * @unimplemented + */ +PVOID +NTAPI +PoRegisterSystemState(IN PVOID StateHandle, + IN EXECUTION_STATE Flags) +{ + UNIMPLEMENTED; + return NULL; +} + +/* + * @implemented + */ +NTSTATUS +NTAPI +PoRequestPowerIrp(IN PDEVICE_OBJECT DeviceObject, + IN UCHAR MinorFunction, + IN POWER_STATE PowerState, + IN PREQUEST_POWER_COMPLETE CompletionFunction, + IN PVOID Context, + OUT PIRP *pIrp OPTIONAL) +{ + PDEVICE_OBJECT TopDeviceObject; + PIO_STACK_LOCATION Stack; + PIRP Irp; + PIO_STATUS_BLOCK IoStatusBlock; + PREQUEST_POWER_ITEM RequestPowerItem; + NTSTATUS Status; + + if (MinorFunction != IRP_MN_QUERY_POWER + && MinorFunction != IRP_MN_SET_POWER + && MinorFunction != IRP_MN_WAIT_WAKE) + return STATUS_INVALID_PARAMETER_2; + + RequestPowerItem = ExAllocatePool(NonPagedPool, sizeof(REQUEST_POWER_ITEM)); + if (!RequestPowerItem) + return STATUS_INSUFFICIENT_RESOURCES; + IoStatusBlock = ExAllocatePool(NonPagedPool, sizeof(IO_STATUS_BLOCK)); + if (!IoStatusBlock) + { + ExFreePool(RequestPowerItem); + return STATUS_INSUFFICIENT_RESOURCES; + } + + /* Always call the top of the device stack */ + TopDeviceObject = IoGetAttachedDeviceReference(DeviceObject); + + Irp = IoBuildSynchronousFsdRequest(IRP_MJ_PNP, + TopDeviceObject, + NULL, + 0, + NULL, + NULL, + IoStatusBlock); + if (!Irp) + { + ExFreePool(RequestPowerItem); + ExFreePool(IoStatusBlock); + return STATUS_INSUFFICIENT_RESOURCES; + } + + /* POWER IRPs are always initialized with a status code of + STATUS_NOT_IMPLEMENTED */ + Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED; + Irp->IoStatus.Information = 0; + + Stack = IoGetNextIrpStackLocation(Irp); + Stack->MinorFunction = MinorFunction; + if (MinorFunction == IRP_MN_WAIT_WAKE) + Stack->Parameters.WaitWake.PowerState = PowerState.SystemState; + else + Stack->Parameters.WaitWake.PowerState = PowerState.DeviceState; + + RequestPowerItem->CompletionRoutine = CompletionFunction; + RequestPowerItem->PowerState = PowerState; + RequestPowerItem->Context = Context; + + if (pIrp != NULL) + *pIrp = Irp; + + IoSetCompletionRoutine(Irp, PopRequestPowerIrpCompletion, RequestPowerItem, TRUE, TRUE, TRUE); + Status = IoCallDriver(TopDeviceObject, Irp); + + /* Always return STATUS_PENDING. The completion routine + * will call CompletionFunction and complete the Irp. + */ + return STATUS_PENDING; +} + +/* + * @unimplemented + */ +POWER_STATE +NTAPI +PoSetPowerState(IN PDEVICE_OBJECT DeviceObject, + IN POWER_STATE_TYPE Type, + IN POWER_STATE State) +{ + POWER_STATE ps; + + ASSERT_IRQL_LESS_OR_EQUAL(DISPATCH_LEVEL); + + ps.SystemState = PowerSystemWorking; // Fully on + ps.DeviceState = PowerDeviceD0; // Fully on + + return ps; +} + +/* + * @unimplemented + */ +VOID +NTAPI +PoSetSystemState(IN EXECUTION_STATE Flags) +{ + UNIMPLEMENTED; +} + +/* + * @unimplemented + */ +VOID +NTAPI +PoStartNextPowerIrp(IN PIRP Irp) +{ + UNIMPLEMENTED; +} + +/* + * @unimplemented + */ +VOID +NTAPI +PoUnregisterSystemState(IN PVOID StateHandle) +{ + UNIMPLEMENTED; +} + /* * @unimplemented */ NTSTATUS -STDCALL +NTAPI +PoQueueShutdownWorkItem(IN PWORK_QUEUE_ITEM WorkItem) +{ + PAGED_CODE(); + + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* + * @unimplemented + */ +NTSTATUS +NTAPI NtInitiatePowerAction (IN POWER_ACTION SystemAction, IN SYSTEM_POWER_STATE MinSystemState, IN ULONG Flags, @@ -405,7 +418,7 @@ NtInitiatePowerAction (IN POWER_ACTION SystemAction, * @unimplemented */ NTSTATUS -STDCALL +NTAPI NtPowerInformation(IN POWER_INFORMATION_LEVEL PowerInformationLevel, IN PVOID InputBuffer OPTIONAL, IN ULONG InputBufferLength, @@ -467,18 +480,6 @@ NtPowerInformation(IN POWER_INFORMATION_LEVEL PowerInformationLevel, return Status; } - -NTSTATUS -STDCALL -PoQueueShutdownWorkItem(IN PWORK_QUEUE_ITEM WorkItem) -{ - PAGED_CODE(); - - DPRINT1("PoQueueShutdownWorkItem(%p)\n", WorkItem); - - return STATUS_NOT_IMPLEMENTED; -} - NTSTATUS NTAPI NtGetDevicePowerState(IN HANDLE Device, @@ -512,5 +513,3 @@ NtSetThreadExecutionState(IN EXECUTION_STATE esFlags, UNIMPLEMENTED; return STATUS_NOT_IMPLEMENTED; } - -/* EOF */ diff --git a/reactos/ntoskrnl/ps/job.c b/reactos/ntoskrnl/ps/job.c index 135822d652b..a1fa2f145d2 100644 --- a/reactos/ntoskrnl/ps/job.c +++ b/reactos/ntoskrnl/ps/job.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include /* GLOBALS *******************************************************************/ @@ -117,7 +117,7 @@ PspExitProcessFromJob(IN PEJOB Job, * @unimplemented */ NTSTATUS -STDCALL +NTAPI NtAssignProcessToJobObject ( HANDLE JobHandle, HANDLE ProcessHandle) @@ -216,7 +216,7 @@ NtCreateJobSet(IN ULONG NumJob, * @unimplemented */ NTSTATUS -STDCALL +NTAPI NtCreateJobObject ( PHANDLE JobHandle, ACCESS_MASK DesiredAccess, @@ -321,7 +321,7 @@ NtCreateJobObject ( * @implemented */ NTSTATUS -STDCALL +NTAPI NtIsProcessInJob ( IN HANDLE ProcessHandle, IN HANDLE JobHandle OPTIONAL ) @@ -389,7 +389,7 @@ NtIsProcessInJob ( * @implemented */ NTSTATUS -STDCALL +NTAPI NtOpenJobObject ( PHANDLE JobHandle, ACCESS_MASK DesiredAccess, @@ -453,7 +453,7 @@ NtOpenJobObject ( * @unimplemented */ NTSTATUS -STDCALL +NTAPI NtQueryInformationJobObject ( HANDLE JobHandle, JOBOBJECTINFOCLASS JobInformationClass, @@ -470,7 +470,7 @@ NtQueryInformationJobObject ( * @unimplemented */ NTSTATUS -STDCALL +NTAPI NtSetInformationJobObject ( HANDLE JobHandle, JOBOBJECTINFOCLASS JobInformationClass, @@ -486,7 +486,7 @@ NtSetInformationJobObject ( * @unimplemented */ NTSTATUS -STDCALL +NTAPI NtTerminateJobObject ( HANDLE JobHandle, NTSTATUS ExitStatus ) @@ -523,7 +523,7 @@ NtTerminateJobObject ( * @implemented */ PVOID -STDCALL +NTAPI PsGetJobLock ( PEJOB Job ) { ASSERT(Job); @@ -535,7 +535,7 @@ PsGetJobLock ( PEJOB Job ) * @implemented */ PVOID -STDCALL +NTAPI PsGetJobSessionId ( PEJOB Job ) { ASSERT(Job); @@ -547,7 +547,7 @@ PsGetJobSessionId ( PEJOB Job ) * @implemented */ ULONG -STDCALL +NTAPI PsGetJobUIRestrictionsClass ( PEJOB Job ) { ASSERT(Job); @@ -559,7 +559,7 @@ PsGetJobUIRestrictionsClass ( PEJOB Job ) * @unimplemented */ VOID -STDCALL +NTAPI PsSetJobUIRestrictionsClass(PEJOB Job, ULONG UIRestrictionsClass) { diff --git a/reactos/ntoskrnl/ps/kill.c b/reactos/ntoskrnl/ps/kill.c index 0a15b7c3849..8840dd806cf 100644 --- a/reactos/ntoskrnl/ps/kill.c +++ b/reactos/ntoskrnl/ps/kill.c @@ -12,7 +12,7 @@ #include #define NDEBUG -#include +#include /* GLOBALS *******************************************************************/ @@ -310,7 +310,7 @@ PspDeleteProcess(IN PVOID ObjectBody) if (!(ExDestroyHandle(PspCidTable, Process->UniqueProcessId, NULL))) { /* Something wrong happened, bugcheck */ - KEBUGCHECK(CID_HANDLE_DELETION); + KeBugCheck(CID_HANDLE_DELETION); } } @@ -360,7 +360,7 @@ PspDeleteThread(IN PVOID ObjectBody) if (!(ExDestroyHandle(PspCidTable, Thread->Cid.UniqueThread, NULL))) { /* Something wrong happened, bugcheck */ - KEBUGCHECK(CID_HANDLE_DELETION); + KeBugCheck(CID_HANDLE_DELETION); } } @@ -421,7 +421,7 @@ PspExitThread(IN NTSTATUS ExitStatus) if (KeIsAttachedProcess()) { /* Bugcheck */ - KEBUGCHECKEX(INVALID_PROCESS_ATTACH_ATTEMPT, + KeBugCheckEx(INVALID_PROCESS_ATTACH_ATTEMPT, (ULONG_PTR)CurrentProcess, (ULONG_PTR)Thread->Tcb.ApcState.Process, (ULONG_PTR)Thread->Tcb.ApcStateIndex, @@ -435,7 +435,7 @@ PspExitThread(IN NTSTATUS ExitStatus) if (Thread->ActiveExWorker) { /* Bugcheck */ - KEBUGCHECKEX(ACTIVE_EX_WORKER_THREAD_TERMINATION, + KeBugCheckEx(ACTIVE_EX_WORKER_THREAD_TERMINATION, (ULONG_PTR)Thread, 0, 0, @@ -446,7 +446,7 @@ PspExitThread(IN NTSTATUS ExitStatus) if (Thread->Tcb.CombinedApcDisable != 0) { /* Bugcheck */ - KEBUGCHECKEX(KERNEL_APC_PENDING_DURING_EXIT, + KeBugCheckEx(KERNEL_APC_PENDING_DURING_EXIT, 0, Thread->Tcb.CombinedApcDisable, 0, @@ -578,7 +578,7 @@ PspExitThread(IN NTSTATUS ExitStatus) else { /* Bugcheck, we can't allow this */ - KEBUGCHECKEX(CRITICAL_PROCESS_DIED, + KeBugCheckEx(CRITICAL_PROCESS_DIED, (ULONG_PTR)CurrentProcess, 0, 0, @@ -701,7 +701,7 @@ PspExitThread(IN NTSTATUS ExitStatus) if (!Thread->Tcb.EnableStackSwap) { /* Stack swap really shouldn't be disabled during exit! */ - KEBUGCHECKEX(KERNEL_STACK_LOCKED_AT_EXIT, 0, 0, 0, 0); + KeBugCheckEx(KERNEL_STACK_LOCKED_AT_EXIT, 0, 0, 0, 0); } /* Cancel I/O for the thread. */ @@ -849,7 +849,7 @@ PspExitThread(IN NTSTATUS ExitStatus) if ((FirstEntry) || (Thread->Tcb.CombinedApcDisable != 0)) { /* Bugcheck time */ - KEBUGCHECKEX(KERNEL_APC_PENDING_DURING_EXIT, + KeBugCheckEx(KERNEL_APC_PENDING_DURING_EXIT, (ULONG_PTR)FirstEntry, Thread->Tcb.CombinedApcDisable, KeGetCurrentIrql(), @@ -1142,7 +1142,7 @@ NtTerminateProcess(IN HANDLE ProcessHandle OPTIONAL, /* Lock the Process */ if (!ExAcquireRundownProtection(&Process->RundownProtect)) { - /* Failed to lock, fal */ + /* Failed to lock, fail */ ObDereferenceObject (Process); return STATUS_PROCESS_IS_TERMINATING; } @@ -1182,7 +1182,7 @@ NtTerminateProcess(IN HANDLE ProcessHandle OPTIONAL, /* Also make sure the caller gave us our handle */ if (KillByHandle) { - /* Dereference the project */ + /* Dereference the process */ ObDereferenceObject(Process); /* Terminate ourselves */ diff --git a/reactos/ntoskrnl/ps/process.c b/reactos/ntoskrnl/ps/process.c index 3e549ff9bd8..85989a3dbfa 100644 --- a/reactos/ntoskrnl/ps/process.c +++ b/reactos/ntoskrnl/ps/process.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include /* GLOBALS *******************************************************************/ @@ -698,7 +698,7 @@ PspCreateProcess(OUT PHANDLE ProcessHandle, { /* FIXME: We need to insert this process */ DPRINT1("Jobs not yet supported\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* Create PEB only for User-Mode Processes */ diff --git a/reactos/ntoskrnl/ps/psmgr.c b/reactos/ntoskrnl/ps/psmgr.c index 29cda1baece..7d271d5a3b5 100644 --- a/reactos/ntoskrnl/ps/psmgr.c +++ b/reactos/ntoskrnl/ps/psmgr.c @@ -10,7 +10,7 @@ #include #define NDEBUG -#include +#include extern ULONG ExpInitializationPhase; extern BOOLEAN SysThreadCreated; diff --git a/reactos/ntoskrnl/ps/query.c b/reactos/ntoskrnl/ps/query.c index 472d5545010..11bde0afdf2 100644 --- a/reactos/ntoskrnl/ps/query.c +++ b/reactos/ntoskrnl/ps/query.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include /* Include Information Class Tables */ #include "internal/ps_i.h" diff --git a/reactos/ntoskrnl/ps/quota.c b/reactos/ntoskrnl/ps/quota.c index ab73d045418..d07e2c137f2 100644 --- a/reactos/ntoskrnl/ps/quota.c +++ b/reactos/ntoskrnl/ps/quota.c @@ -12,7 +12,7 @@ #include #define NDEBUG -#include +#include EPROCESS_QUOTA_BLOCK PspDefaultQuotaBlock; diff --git a/reactos/ntoskrnl/ps/security.c b/reactos/ntoskrnl/ps/security.c index 525b130c076..45ec74d6533 100644 --- a/reactos/ntoskrnl/ps/security.c +++ b/reactos/ntoskrnl/ps/security.c @@ -12,7 +12,7 @@ #include #define NDEBUG -#include +#include PTOKEN PspBootAccessToken; @@ -647,7 +647,7 @@ PsImpersonateClient(IN PETHREAD Thread, } /* Check if this is a job, which we don't support yet */ - if (Thread->ThreadsProcess->Job) KEBUGCHECK(0); + if (Thread->ThreadsProcess->Job) ASSERT(FALSE); /* Lock thread security */ PspLockThreadSecurityExclusive(Thread); diff --git a/reactos/ntoskrnl/ps/state.c b/reactos/ntoskrnl/ps/state.c index 562153b8520..4b6b6702c89 100644 --- a/reactos/ntoskrnl/ps/state.c +++ b/reactos/ntoskrnl/ps/state.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include /* PRIVATE FUNCTIONS *********************************************************/ diff --git a/reactos/ntoskrnl/ps/thread.c b/reactos/ntoskrnl/ps/thread.c index 6de4bfc6490..2090314a842 100644 --- a/reactos/ntoskrnl/ps/thread.c +++ b/reactos/ntoskrnl/ps/thread.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include /* GLOBALS ******************************************************************/ diff --git a/reactos/ntoskrnl/ps/win32.c b/reactos/ntoskrnl/ps/win32.c index adea459425d..8e8a78af4b6 100644 --- a/reactos/ntoskrnl/ps/win32.c +++ b/reactos/ntoskrnl/ps/win32.c @@ -11,7 +11,7 @@ #include #include #define NDEBUG -#include +#include /* GLOBALS ******************************************************************/ diff --git a/reactos/ntoskrnl/rtl/i386/stack.S b/reactos/ntoskrnl/rtl/i386/stack.S new file mode 100644 index 00000000000..d71cc4f0c3e --- /dev/null +++ b/reactos/ntoskrnl/rtl/i386/stack.S @@ -0,0 +1,37 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Kernel + * FILE: ntoskrnl/rtl/i386/stack.s + * PURPOSE: Stack Support for RTL + * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) + */ + +/* INCLUDES ******************************************************************/ + +#include +.intel_syntax noprefix + +/* FUNCTIONS *****************************************************************/ + +.func RtlpGetStackLimits@8 +.globl _RtlpGetStackLimits@8 +_RtlpGetStackLimits@8: + + /* Get the current thread */ + mov eax, [fs:KPCR_CURRENT_THREAD] + + /* Get the stack limits */ + mov ecx, [eax+KTHREAD_STACK_LIMIT] + mov edx, [eax+KTHREAD_INITIAL_STACK] + sub edx, SIZEOF_FX_SAVE_AREA + + /* Return them */ + mov eax, [esp+4] + mov [eax], ecx + + mov eax, [esp+8] + mov [eax], edx + + /* return */ + ret 8 +.endfunc diff --git a/reactos/ntoskrnl/rtl/libsupp.c b/reactos/ntoskrnl/rtl/libsupp.c index 7ccf0e1cc05..48890214cf5 100644 --- a/reactos/ntoskrnl/rtl/libsupp.c +++ b/reactos/ntoskrnl/rtl/libsupp.c @@ -11,7 +11,9 @@ #include #define NDEBUG -#include +#include + +#define TAG_ATMT TAG('A', 't', 'o', 'T') /* Atom table */ extern ULONG NtGlobalFlag; @@ -74,13 +76,18 @@ RtlpAllocateMemory(ULONG Bytes, } +#define TAG_USTR TAG('U', 'S', 'T', 'R') +#define TAG_ASTR TAG('A', 'S', 'T', 'R') +#define TAG_OSTR TAG('O', 'S', 'T', 'R') VOID STDCALL RtlpFreeMemory(PVOID Mem, ULONG Tag) { - ExFreePoolWithTag(Mem, - Tag); + if (Tag == TAG_ASTR || Tag == TAG_OSTR || Tag == TAG_USTR) + ExFreePool(Mem); + else + ExFreePoolWithTag(Mem, Tag); } /* @@ -121,7 +128,7 @@ STDCALL RtlDeleteHeapLock( PRTL_CRITICAL_SECTION CriticalSection) { - KEBUGCHECK(0); + ASSERT(FALSE); return STATUS_SUCCESS; } @@ -130,7 +137,7 @@ STDCALL RtlEnterHeapLock( PRTL_CRITICAL_SECTION CriticalSection) { - KEBUGCHECK(0); + ASSERT(FALSE); return STATUS_SUCCESS; } @@ -139,7 +146,7 @@ STDCALL RtlInitializeHeapLock( PRTL_CRITICAL_SECTION CriticalSection) { - KEBUGCHECK(0); + ASSERT(FALSE); return STATUS_SUCCESS; } @@ -148,7 +155,7 @@ STDCALL RtlLeaveHeapLock( PRTL_CRITICAL_SECTION CriticalSection) { - KEBUGCHECK(0); + ASSERT(FALSE); return STATUS_SUCCESS; } @@ -159,7 +166,7 @@ CHECK_PAGED_CODE_RTL(char *file, int line) if(KeGetCurrentIrql() > APC_LEVEL) { DbgPrint("%s:%i: Pagable code called at IRQL > APC_LEVEL (%d)\n", file, line, KeGetCurrentIrql()); - KEBUGCHECK(0); + ASSERT(FALSE); } } #endif @@ -477,21 +484,21 @@ RtlpFreeAtomTable(PRTL_ATOM_TABLE AtomTable) PRTL_ATOM_TABLE_ENTRY RtlpAllocAtomTableEntry(ULONG Size) { - PRTL_ATOM_TABLE_ENTRY Entry = ExAllocatePool(NonPagedPool, - Size); - if (Entry != NULL) - { - RtlZeroMemory(Entry, - Size); - } + PRTL_ATOM_TABLE_ENTRY Entry; - return Entry; + Entry = ExAllocatePoolWithTag(NonPagedPool, Size, TAG_ATMT); + if (Entry != NULL) + { + RtlZeroMemory(Entry, Size); + } + + return Entry; } VOID RtlpFreeAtomTableEntry(PRTL_ATOM_TABLE_ENTRY Entry) { - ExFreePool(Entry); + ExFreePoolWithTag(Entry, TAG_ATMT); } VOID @@ -557,30 +564,6 @@ RtlpGetAtomEntry(PRTL_ATOM_TABLE AtomTable, ULONG Index) return Entry; } -/* FIXME - RtlpCreateUnicodeString is obsolete and should be removed ASAP! */ -BOOLEAN FASTCALL -RtlpCreateUnicodeString( - IN OUT PUNICODE_STRING UniDest, - IN PCWSTR Source, - IN POOL_TYPE PoolType) -{ - ULONG Length; - - Length = (wcslen (Source) + 1) * sizeof(WCHAR); - UniDest->Buffer = ExAllocatePoolWithTag(PoolType, Length, TAG('U', 'S', 'T', 'R')); - if (UniDest->Buffer == NULL) - return FALSE; - - RtlCopyMemory (UniDest->Buffer, - Source, - Length); - - UniDest->MaximumLength = (USHORT)Length; - UniDest->Length = (USHORT)Length - sizeof (WCHAR); - - return TRUE; -} - /* * Ldr Resource support code */ diff --git a/reactos/ntoskrnl/rtl/misc.c b/reactos/ntoskrnl/rtl/misc.c index 925aa724e4c..f933c57070a 100644 --- a/reactos/ntoskrnl/rtl/misc.c +++ b/reactos/ntoskrnl/rtl/misc.c @@ -11,7 +11,7 @@ #include #define NDEBUG -#include +#include /* GLOBALS *******************************************************************/ diff --git a/reactos/ntoskrnl/se/audit.c b/reactos/ntoskrnl/se/audit.c index 7ba66134257..2ff42317793 100644 --- a/reactos/ntoskrnl/se/audit.c +++ b/reactos/ntoskrnl/se/audit.c @@ -84,7 +84,7 @@ SeInitializeProcessAuditName(IN PFILE_OBJECT FileObject, (!(NT_SUCCESS(Status)) || (ReturnLength == sizeof(LocalNameInfo)))) { /* First, free any buffer we might've allocated */ - KEBUGCHECK(0); + ASSERT(FALSE); if (ObjectNameInfo) ExFreePool(ObjectNameInfo); /* Now allocate a temporary one */ diff --git a/reactos/ntoskrnl/se/sd.c b/reactos/ntoskrnl/se/sd.c index 2c58e399b12..a4891437f78 100644 --- a/reactos/ntoskrnl/se/sd.c +++ b/reactos/ntoskrnl/se/sd.c @@ -619,8 +619,9 @@ DescriptorCopy.AclType = NULL; \ /* allocate enough memory to store a complete copy of a self-relative security descriptor */ - NewDescriptor = ExAllocatePool(PoolType, - DescriptorSize); + NewDescriptor = ExAllocatePoolWithTag(PoolType, + DescriptorSize, + TAG_SD); if(NewDescriptor != NULL) { ULONG_PTR Offset = sizeof(SECURITY_DESCRIPTOR); @@ -872,7 +873,7 @@ SeReleaseSecurityDescriptor(IN PSECURITY_DESCRIPTOR CapturedSecurityDescriptor, (CurrentMode == KernelMode && CaptureIfKernelMode))) { /* only delete the descriptor when SeCaptureSecurityDescriptor() allocated one! */ - ExFreePool(CapturedSecurityDescriptor); + ExFreePoolWithTag(CapturedSecurityDescriptor, TAG_SD); } return STATUS_SUCCESS; @@ -1450,8 +1451,9 @@ SeAssignSecurity(PSECURITY_DESCRIPTOR _ParentDescriptor OPTIONAL, DaclLength, SaclLength); - Descriptor = ExAllocatePool(PagedPool, - Length); + Descriptor = ExAllocatePoolWithTag(PagedPool, + Length, + TAG_SD); if (Descriptor == NULL) { DPRINT1("ExAlloctePool() failed\n"); diff --git a/reactos/ntoskrnl/se/semgr.c b/reactos/ntoskrnl/se/semgr.c index 262723b811d..5cf54558ad6 100644 --- a/reactos/ntoskrnl/se/semgr.c +++ b/reactos/ntoskrnl/se/semgr.c @@ -134,7 +134,7 @@ SepInitializationPhase1(VOID) BOOLEAN NTAPI -SeInit(VOID) +SeInitSystem(VOID) { /* Check the initialization phase */ switch (ExpInitializationPhase) diff --git a/reactos/ntoskrnl/se/token.c b/reactos/ntoskrnl/se/token.c index c80a5da97f4..47832556b18 100644 --- a/reactos/ntoskrnl/se/token.c +++ b/reactos/ntoskrnl/se/token.c @@ -2277,7 +2277,7 @@ NtOpenThreadTokenEx(IN HANDLE ThreadHandle, PrimaryToken = PsReferencePrimaryToken(Thread->ThreadsProcess); Status = SepCreateImpersonationTokenDacl(Token, PrimaryToken, &Dacl); - KEBUGCHECK(0); + ASSERT(FALSE); ObfDereferenceObject(PrimaryToken); ObfDereferenceObject(Thread); if (!NT_SUCCESS(Status)) diff --git a/reactos/ntoskrnl/wmi/wmi.c b/reactos/ntoskrnl/wmi/wmi.c index 56e3ea4aecc..5ebb2101ab4 100644 --- a/reactos/ntoskrnl/wmi/wmi.c +++ b/reactos/ntoskrnl/wmi/wmi.c @@ -10,7 +10,7 @@ #include #define NDEBUG -#include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/subsystems/win32/csrss/win32csr/conio.c b/reactos/subsystems/win32/csrss/win32csr/conio.c index 19223ad0c20..65c3ffd582c 100644 --- a/reactos/subsystems/win32/csrss/win32csr/conio.c +++ b/reactos/subsystems/win32/csrss/win32csr/conio.c @@ -574,7 +574,6 @@ CSR_API(CsrReadConsole) CurrentEntry = RemoveHeadList(&Console->InputEvents); if (IsListEmpty(&Console->InputEvents)) { - CHECKPOINT; ResetEvent(Console->ActiveEvent); } Input = CONTAINING_RECORD(CurrentEntry, ConsoleInput, ListEntry); @@ -960,7 +959,6 @@ ConioProcessChar(PCSRSS_CONSOLE Console, ConsoleInput *KeyEventRecord) { BOOL updown; - BOOL bClientWake = FALSE; ConsoleInput *TempInput; if (0 != (Console->Mode & (ENABLE_PROCESSED_INPUT | ENABLE_LINE_INPUT))) @@ -1004,8 +1002,6 @@ ConioProcessChar(PCSRSS_CONSOLE Console, { Console->WaitingLines++; } - bClientWake = TRUE; - SetEvent(Console->ActiveEvent); } KeyEventRecord->Echoed = FALSE; if (0 != (Console->Mode & (ENABLE_PROCESSED_INPUT | ENABLE_LINE_INPUT)) @@ -1037,10 +1033,7 @@ ConioProcessChar(PCSRSS_CONSOLE Console, RemoveEntryList(&KeyEventRecord->ListEntry); HeapFree(Win32CsrApiHeap, 0, KeyEventRecord); Console->WaitingChars -= 2; - } - else - { - SetEvent(Console->ActiveEvent); + return; } } else @@ -1061,10 +1054,7 @@ ConioProcessChar(PCSRSS_CONSOLE Console, } /* Console->WaitingChars++; */ - if (bClientWake || 0 == (Console->Mode & ENABLE_LINE_INPUT)) - { - SetEvent(Console->ActiveEvent); - } + SetEvent(Console->ActiveEvent); } static DWORD FASTCALL diff --git a/reactos/subsystems/win32/csrss/win32csr/lang/bg-BG.rc b/reactos/subsystems/win32/csrss/win32csr/lang/bg-BG.rc index d358f5703c7..69d97786ad4 100644 --- a/reactos/subsystems/win32/csrss/win32csr/lang/bg-BG.rc +++ b/reactos/subsystems/win32/csrss/win32csr/lang/bg-BG.rc @@ -27,7 +27,7 @@ BEGIN DEFPUSHBUTTON "Отказ",IDCANCEL,142,98,43,17 PUSHBUTTON "&Прекратяване веднага",IDC_END_NOW,150,71,60,17 LTEXT "Приложението не отговаря",IDC_STATIC,7,7,178,8 - LTEXT "За да се върнете в РеактОС и да проверите състоянието на приложението, натиснете „Отказ„.", + LTEXT "За да се върнете в РеактОС и да проверите състоянието на приложението, натиснете „Отказ“.", IDC_STATIC,7,26,178,16 LTEXT "Ако решите да затворите приложението веднага, ще изгубите всички незаписани данни. За да прекратите приложението веднага, натиснете „Прекратяване веднага“.", IDC_STATIC,7,53,178,26 diff --git a/reactos/subsystems/win32/csrss/win32csr/lang/fr-FR.rc b/reactos/subsystems/win32/csrss/win32csr/lang/fr-FR.rc index 834aa502dec..708af193c8e 100644 --- a/reactos/subsystems/win32/csrss/win32csr/lang/fr-FR.rc +++ b/reactos/subsystems/win32/csrss/win32csr/lang/fr-FR.rc @@ -47,7 +47,7 @@ BEGIN IDS_SCROLL "Dйfiler" IDS_FIND "Trouver..." IDS_DEFAULTS "Dйfauts" - IDS_PROPERTIES "Proprietйs" + IDS_PROPERTIES "Propriйtйs" IDS_SCROLLHERE "Dйfiler ici" IDS_SCROLLTOP "Dйfiler tout en haut" IDS_SCROLLBOTTOM "Dйfiler tout en bas" diff --git a/reactos/subsystems/win32/csrss/win32csr/rsrc.rc b/reactos/subsystems/win32/csrss/win32csr/rsrc.rc index 2fc1e5e82b6..3ea5c5e057b 100644 --- a/reactos/subsystems/win32/csrss/win32csr/rsrc.rc +++ b/reactos/subsystems/win32/csrss/win32csr/rsrc.rc @@ -13,6 +13,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL #include "lang/fr-FR.rc" #include "lang/id-ID.rc" #include "lang/it-IT.rc" +#include "lang/no-NO.rc" #include "lang/pl-PL.rc" #include "lang/ru-RU.rc" #include "lang/sk-SK.rc" diff --git a/reactos/subsystems/win32/csrss/win32csr/tuiconsole.c b/reactos/subsystems/win32/csrss/win32csr/tuiconsole.c index 972da8f223e..dd1a8bbd02f 100644 --- a/reactos/subsystems/win32/csrss/win32csr/tuiconsole.c +++ b/reactos/subsystems/win32/csrss/win32csr/tuiconsole.c @@ -23,10 +23,8 @@ TuiConsoleWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { if (msg == WM_ACTIVATE) { - CHECKPOINT1; if (LOWORD(wParam) != WA_INACTIVE) { - CHECKPOINT1; SetFocus(hWnd); ConioDrawConsole(ActiveConsole); } diff --git a/reactos/subsystems/win32/win32k/dib/dib16bpp.c b/reactos/subsystems/win32/win32k/dib/dib16bpp.c index 7d4417cd0d1..d3a5f27a67d 100644 --- a/reactos/subsystems/win32/win32k/dib/dib16bpp.c +++ b/reactos/subsystems/win32/win32k/dib/dib16bpp.c @@ -466,18 +466,6 @@ typedef unsigned short PIXEL; /* 16-bit HiColor (565 format) */ __inline PIXEL average16(PIXEL a, PIXEL b) { -// This one doesn't work -/* - if (a == b) - { - return a; - } - else - { - unsigned short mask = ~ (((a | b) & 0x0410) << 1); - return ((a & mask) + (b & mask)) >> 1; - }*/ /* if */ - // This one should be correct, but it's too long /* unsigned char r1, g1, b1, r2, g2, b2, rr, gr, br; @@ -499,8 +487,11 @@ __inline PIXEL average16(PIXEL a, PIXEL b) return res; */ - // This one is the short form of the correct one ;-) - return (((a ^ b) & 0xf7deU) >> 1) + (a & b); + // This one is the short form of the correct one, but does not work for QEMU (expects 555 format) + //return (((a ^ b) & 0xf7deU) >> 1) + (a & b); + + //hack until short version works properly + return a; } //NOTE: If you change something here, please do the same in other dibXXbpp.c files! diff --git a/reactos/subsystems/win32/win32k/eng/engwindow.c b/reactos/subsystems/win32/win32k/eng/engwindow.c index 2534bb37aa9..7bb7848e786 100644 --- a/reactos/subsystems/win32/win32k/eng/engwindow.c +++ b/reactos/subsystems/win32/win32k/eng/engwindow.c @@ -153,7 +153,7 @@ IntEngWindowChanged( PLIST_ENTRY CurrentEntry; WNDGDI *Current; - ASSERT_IRQL(PASSIVE_LEVEL); + ASSERT_IRQL_LESS_OR_EQUAL(PASSIVE_LEVEL); CurrentEntry = Window->WndObjListHead.Flink; while (CurrentEntry != &Window->WndObjListHead) diff --git a/reactos/subsystems/win32/win32k/eng/float.c b/reactos/subsystems/win32/win32k/eng/float.c index 0d348dbd8b0..aa080ab9896 100644 --- a/reactos/subsystems/win32/win32k/eng/float.c +++ b/reactos/subsystems/win32/win32k/eng/float.c @@ -33,30 +33,6 @@ #define NDEBUG #include -/* DEFINES *****************************************************************/ - -#ifdef _M_IX86 -#ifdef __GNUC__ -#define FLOAT_TO_INT(in,out) \ - __asm__ __volatile__ ("fistpl %0" : "=m" (out) : "t" (in) : "st"); -#else -#define FLOAT_TO_INT(in,out) \ - __asm fld in \ - __asm fistp out -#endif -#else -#define FLOAT_TO_INT(in,out) \ - out = (long)in; -#endif - -/* the following deal with IEEE single-precision numbers */ -#define EXCESS 126L -#define SIGNBIT 0x80000000L -#define SIGN(fp) ((fp) & SIGNBIT) -#define EXP(fp) (((fp) >> 23L) & 0xFF) -#define MANT(fp) ((fp) & 0x7FFFFFL) -#define PACK(s,e,m) ((s) | ((e) << 23L) | (m)) - /* FUNCTIONS *****************************************************************/ BOOL @@ -101,525 +77,3 @@ EngSaveFloatingPointState(OUT VOID *Buffer, } return TRUE; } - -VOID -FASTCALL -EF_Negate(EFLOAT_S * efp) -{ - efp->lMant = -efp->lMant; -} - -LONG -FASTCALL -EFtoF( EFLOAT_S * efp) -{ - long Mant, Exp, Sign = 0; - - if (!efp->lMant) return 0; - - Mant = efp->lMant; - Exp = efp->lExp; - Sign = SIGN(Mant); - -//// M$ storage emulation - if( Sign ) Mant = -Mant; - Mant = ((Mant & 0x3fffffff) >> 7); - Exp += (EXCESS-1); -//// - Mant = MANT(Mant); - return PACK(Sign, Exp, Mant); -} - -VOID -FASTCALL -FtoEF( EFLOAT_S * efp, FLOATL f) -{ - long Mant, Exp, Sign = 0; - gxf_long worker; - -#ifdef _X86_ - worker.l = f; // It's a float stored in a long. -#else - worker.f = f; -#endif - - Exp = EXP(worker.l); - Mant = MANT(worker.l); - if (SIGN(worker.l)) Sign = -1; -//// M$ storage emulation - Mant = ((Mant << 7) | 0x40000000); - Mant ^= Sign; - Mant -= Sign; - Exp -= (EXCESS-1); -//// - efp->lMant = Mant; - efp->lExp = Exp; -} - -VOID -STDCALL -FLOATOBJ_Add ( - IN OUT PFLOATOBJ pf, - IN PFLOATOBJ pf1 - ) -{ - // www.osr.com/ddk/graphics/gdifncs_2i3r.htm - EFLOAT_S * efp = (EFLOAT_S *)pf; - EFLOAT_S * efp1 = (EFLOAT_S *)pf1; - gxf_long f; - gxf_long f1; - f.l = EFtoF(efp); - f1.l = EFtoF(efp1); - f.f = f.f + f1.f; -#ifdef _X86_ - FtoEF( efp, f.l ); -#else - FtoEF( efp, f.f ); -#endif -} - -VOID -STDCALL -FLOATOBJ_AddFloat( - IN OUT PFLOATOBJ pf, - IN FLOATL f - ) -{ - // www.osr.com/ddk/graphics/gdifncs_0ip3.htm - EFLOAT_S * efp = (EFLOAT_S *)pf; - gxf_long fe; - gxf_long f1; - fe.l = EFtoF(efp); -#ifdef _X86_ - f1.l = f; -#else - f1.f = f; -#endif - fe.f = fe.f + f1.f; -#ifdef _X86_ - FtoEF( efp, fe.l ); -#else - FtoEF( efp, fe.f ); -#endif -} - -VOID FASTCALL -XForm2MatrixS( MATRIX_S * Matrix, PXFORM XForm) -{ -gxf_long f; - f.f = XForm->eM11; - FtoEF( &Matrix->efM11, f.l); - f.f = XForm->eM12; - FtoEF( &Matrix->efM12, f.l); - f.f = XForm->eM21; - FtoEF( &Matrix->efM21, f.l); - f.f = XForm->eM22; - FtoEF( &Matrix->efM22, f.l); - f.f = XForm->eDx; - FtoEF( &Matrix->efDx, f.l); - f.f = XForm->eDy; - FtoEF( &Matrix->efDy, f.l); - Matrix->flAccel = 0; - if (XForm->eM12 == 0. && XForm->eM21 == 0.) - { - Matrix->flAccel |= MX_SCALE; - } -} - -VOID FASTCALL -MatrixS2XForm( PXFORM XForm, MATRIX_S * Matrix) -{ -gxf_long f; - f.l = EFtoF(&Matrix->efM11); - XForm->eM11 = f.f; - f.l = EFtoF(&Matrix->efM12); - XForm->eM12 = f.f; - f.l = EFtoF(&Matrix->efM21); - XForm->eM21 = f.f; - f.l = EFtoF(&Matrix->efM22); - XForm->eM22 = f.f; - f.l = EFtoF(&Matrix->efDx); - XForm->eDx = f.f; - f.l = EFtoF(&Matrix->efDy); - XForm->eDy = f.f; -} - - -VOID -STDCALL -FLOATOBJ_AddLong( - IN OUT PFLOATOBJ pf, - IN LONG l - ) -{ - // www.osr.com/ddk/graphics/gdifncs_12jr.htm - EFLOAT_S * efp = (EFLOAT_S *)pf; - gxf_long f; - f.l = EFtoF(efp); - f.f = f.f + l; -#ifdef _X86_ - FtoEF( efp, f.l ); -#else - FtoEF( efp, f.f ); -#endif -} - -VOID -STDCALL -FLOATOBJ_Div( - IN OUT PFLOATOBJ pf, - IN PFLOATOBJ pf1 - ) -{ - // www.osr.com/ddk/graphics/gdifncs_3ndz.htm - EFLOAT_S * efp = (EFLOAT_S *)pf; - EFLOAT_S * efp1 = (EFLOAT_S *)pf1; - gxf_long f; - gxf_long f1; - f.l = EFtoF(efp); - f1.l = EFtoF(efp1); - f.f = f.f / f1.f; -#ifdef _X86_ - FtoEF( efp, f.l ); -#else - FtoEF( efp, f.f ); -#endif -} - -VOID -STDCALL -FLOATOBJ_DivFloat( - IN OUT PFLOATOBJ pf, - IN FLOATL f - ) -{ - // www.osr.com/ddk/graphics/gdifncs_0gfb.htm - EFLOAT_S * efp = (EFLOAT_S *)pf; - gxf_long fe; - gxf_long f1; - fe.l = EFtoF(efp); -#ifdef _X86_ - f1.l = f; -#else - f1.f = f; -#endif - fe.f = fe.f / f1.f; -#ifdef _X86_ - FtoEF( efp, fe.l ); -#else - FtoEF( efp, fe.f ); -#endif -} - -VOID -STDCALL -FLOATOBJ_DivLong( - IN OUT PFLOATOBJ pf, - IN LONG l - ) -{ - // www.osr.com/ddk/graphics/gdifncs_6jdz.htm - EFLOAT_S * efp = (EFLOAT_S *)pf; - gxf_long f; - f.l = EFtoF(efp); - f.f = f.f / l; -#ifdef _X86_ - FtoEF( efp, f.l ); -#else - FtoEF( efp, f.f ); -#endif -} - -BOOL -STDCALL -FLOATOBJ_Equal( - IN PFLOATOBJ pf, - IN PFLOATOBJ pf1 - ) -{ - // www.osr.com/ddk/graphics/gdifncs_6ysn.htm - EFLOAT_S * efp = (EFLOAT_S *)pf; - EFLOAT_S * efp1 = (EFLOAT_S *)pf1; - gxf_long f; - gxf_long f1; - f.l = EFtoF(efp); - f1.l = EFtoF(efp1); - if (f.f == f1.f) return TRUE; - return FALSE; -} - -BOOL -STDCALL -FLOATOBJ_EqualLong( - IN PFLOATOBJ pf, - IN LONG l - ) -{ - // www.osr.com/ddk/graphics/gdifncs_1pgn.htm - EFLOAT_S * efp = (EFLOAT_S *)pf; - gxf_long f; - f.l = EFtoF(efp); - if (f.f == l) return TRUE; - return FALSE; -} - -LONG -STDCALL -FLOATOBJ_GetFloat ( IN PFLOATOBJ pf ) -{ - // www.osr.com/ddk/graphics/gdifncs_4d5z.htm - EFLOAT_S * efp = (EFLOAT_S *)pf; - return EFtoF(efp); -} - -LONG -STDCALL -FLOATOBJ_GetLong ( IN PFLOATOBJ pf ) -{ - // www.osr.com/ddk/graphics/gdifncs_0tgn.htm - EFLOAT_S * efp = (EFLOAT_S *)pf; - gxf_long f; - long l; - - f.l = EFtoF( efp ); - FLOAT_TO_INT(f.f, l); // Let FPP handle it the fasty haxy way. - - return l; -} - -BOOL -STDCALL -FLOATOBJ_GreaterThan( - IN PFLOATOBJ pf, - IN PFLOATOBJ pf1 - ) -{ - // www.osr.com/ddk/graphics/gdifncs_8n53.htm - EFLOAT_S * efp = (EFLOAT_S *)pf; - EFLOAT_S * efp1 = (EFLOAT_S *)pf1; - gxf_long f; - gxf_long f1; - f.l = EFtoF(efp); - f1.l = EFtoF(efp1); - if(f.f > f1.f) return TRUE; - return FALSE; -} - -BOOL -STDCALL -FLOATOBJ_GreaterThanLong( - IN PFLOATOBJ pf, - IN LONG l - ) -{ - // www.osr.com/ddk/graphics/gdifncs_6gx3.htm - EFLOAT_S * efp = (EFLOAT_S *)pf; - gxf_long f; - f.l = EFtoF(efp); - if (f.f > l) return TRUE; - return FALSE; -} - -BOOL -STDCALL -FLOATOBJ_LessThan( - IN PFLOATOBJ pf, - IN PFLOATOBJ pf1 - ) -{ - // www.osr.com/ddk/graphics/gdifncs_1ynb.htm - EFLOAT_S * efp = (EFLOAT_S *)pf; - EFLOAT_S * efp1 = (EFLOAT_S *)pf1; - gxf_long f; - gxf_long f1; - f.l = EFtoF(efp); - f1.l = EFtoF(efp1); - if(f.f < f1.f) return TRUE; - return FALSE; -} - -BOOL -STDCALL -FLOATOBJ_LessThanLong( - IN PFLOATOBJ pf, - IN LONG l - ) -{ - // www.osr.com/ddk/graphics/gdifncs_9nzb.htm - EFLOAT_S * efp = (EFLOAT_S *)pf; - gxf_long f; - f.l = EFtoF(efp); - if (f.f < l) return TRUE; - return FALSE; -} - -VOID -STDCALL -FLOATOBJ_Mul( - IN OUT PFLOATOBJ pf, - IN PFLOATOBJ pf1 - ) -{ - // www.osr.com/ddk/graphics/gdifncs_8ppj.htm - EFLOAT_S * efp = (EFLOAT_S *)pf; - EFLOAT_S * efp1 = (EFLOAT_S *)pf1; - gxf_long f; - gxf_long f1; - f.l = EFtoF(efp); - f1.l = EFtoF(efp1); - f.f = f1.f * f.f; -#ifdef _X86_ - FtoEF( efp, f.l ); -#else - FtoEF( efp, f.f ); -#endif -} - -VOID -STDCALL -FLOATOBJ_MulFloat( - IN OUT PFLOATOBJ pf, - IN FLOATL f - ) -{ - // www.osr.com/ddk/graphics/gdifncs_3puv.htm - EFLOAT_S * efp = (EFLOAT_S *)pf; - gxf_long fe; - gxf_long f1; - fe.l = EFtoF(efp); -#ifdef _X86_ - f1.l = f; -#else - f1.f = f; -#endif - fe.f = f1.f * fe.f; -#ifdef _X86_ - FtoEF( efp, fe.l ); -#else - FtoEF( efp, fe.f ); -#endif -} - -VOID -STDCALL -FLOATOBJ_MulLong( - IN OUT PFLOATOBJ pf, - IN LONG l - ) -{ - // www.osr.com/ddk/graphics/gdifncs_56lj.htm - EFLOAT_S * efp = (EFLOAT_S *)pf; - gxf_long f; - f.l = EFtoF(efp); - f.f = f.f * l; -#ifdef _X86_ - FtoEF( efp, f.l ); -#else - FtoEF( efp, f.f ); -#endif -} - -VOID -STDCALL -FLOATOBJ_Neg ( IN OUT PFLOATOBJ pf ) -{ - // www.osr.com/ddk/graphics/gdifncs_14pz.htm - EFLOAT_S * efp = (EFLOAT_S *)pf; - EF_Negate(efp); -} - -VOID -STDCALL -FLOATOBJ_SetFloat( - OUT PFLOATOBJ pf, - IN FLOATL f - ) -{ - // www.osr.com/ddk/graphics/gdifncs_1prb.htm - EFLOAT_S * efp = (EFLOAT_S *)pf; - FtoEF( efp, f); -} - -VOID -STDCALL -FLOATOBJ_SetLong( - OUT PFLOATOBJ pf, - IN LONG l - ) -{ - // www.osr.com/ddk/graphics/gdifncs_0gpz.htm - EFLOAT_S * efp = (EFLOAT_S *)pf; - gxf_long f; - f.f = (float) l; // Convert it now. -#ifdef _X86_ - FtoEF( efp, f.l ); -#else - FtoEF( efp, f.f ); -#endif -} - -VOID -STDCALL -FLOATOBJ_Sub( - IN OUT PFLOATOBJ pf, - IN PFLOATOBJ pf1 - ) -{ - // www.osr.com/ddk/graphics/gdifncs_6lyf.htm - EFLOAT_S * efp = (EFLOAT_S *)pf; - EFLOAT_S * efp1 = (EFLOAT_S *)pf1; - gxf_long f; - gxf_long f1; - f.l = EFtoF(efp); - f1.l = EFtoF(efp1); - f.f = f.f - f1.f; -#ifdef _X86_ - FtoEF( efp, f.l ); -#else - FtoEF( efp, f.f ); -#endif -} - -VOID -STDCALL -FLOATOBJ_SubFloat( - IN OUT PFLOATOBJ pf, - IN FLOATL f - ) -{ - // www.osr.com/ddk/graphics/gdifncs_2zvr.htm - EFLOAT_S * efp = (EFLOAT_S *)pf; - gxf_long fe; - gxf_long f1; - fe.l = EFtoF(efp); -#ifdef _X86_ - f1.l = f; -#else - f1.f = f; -#endif - fe.f = fe.f - f1.f; -#ifdef _X86_ - FtoEF( efp, fe.l ); -#else - FtoEF( efp, fe.f ); -#endif -} - -VOID -STDCALL -FLOATOBJ_SubLong( - IN OUT PFLOATOBJ pf, - IN LONG l - ) -{ - // www.osr.com/ddk/graphics/gdifncs_852f.htm - EFLOAT_S * efp = (EFLOAT_S *)pf; - gxf_long f; - f.l = EFtoF(efp); - f.f = f.f - l; -#ifdef _X86_ - FtoEF( efp, f.l ); -#else - FtoEF( efp, f.f ); -#endif -} diff --git a/reactos/subsystems/win32/win32k/eng/semaphor.c b/reactos/subsystems/win32/win32k/eng/semaphor.c index 0cb96b75792..50d20841cd1 100644 --- a/reactos/subsystems/win32/win32k/eng/semaphor.c +++ b/reactos/subsystems/win32/win32k/eng/semaphor.c @@ -134,7 +134,7 @@ EngInitializeSafeSemaphore( { /* Wait for the other thread to create the semaphore */ ASSERT(Semaphore->lCount > 1); - ASSERT_IRQL(PASSIVE_LEVEL); + ASSERT_IRQL_LESS_OR_EQUAL(PASSIVE_LEVEL); while (Semaphore->hsem == NULL); } diff --git a/reactos/subsystems/win32/win32k/eng/surface.c b/reactos/subsystems/win32/win32k/eng/surface.c index bda6561e129..7fb5c1fbc0c 100644 --- a/reactos/subsystems/win32/win32k/eng/surface.c +++ b/reactos/subsystems/win32/win32k/eng/surface.c @@ -317,7 +317,7 @@ IntCreateBitmap(IN SIZEL Size, SurfObj->lDelta = DIB_GetDIBWidthBytes(Size.cx, BitsPerFormat(BMF_4BPP)); SurfObj->cjBits = SurfObj->lDelta * Size.cy; UncompressedFormat = BMF_4BPP; - UncompressedBits = EngAllocMem(FL_ZERO_MEMORY, SurfObj->cjBits, 0); + UncompressedBits = EngAllocMem(FL_ZERO_MEMORY, SurfObj->cjBits, TAG_DIB); Decompress4bpp(Size, (BYTE *)Bits, (BYTE *)UncompressedBits, SurfObj->lDelta); } else if (Format == BMF_8RLE) @@ -325,7 +325,7 @@ IntCreateBitmap(IN SIZEL Size, SurfObj->lDelta = DIB_GetDIBWidthBytes(Size.cx, BitsPerFormat(BMF_8BPP)); SurfObj->cjBits = SurfObj->lDelta * Size.cy; UncompressedFormat = BMF_8BPP; - UncompressedBits = EngAllocMem(FL_ZERO_MEMORY, SurfObj->cjBits, 0); + UncompressedBits = EngAllocMem(FL_ZERO_MEMORY, SurfObj->cjBits, TAG_DIB); Decompress8bpp(Size, (BYTE *)Bits, (BYTE *)UncompressedBits, SurfObj->lDelta); } else @@ -356,7 +356,7 @@ IntCreateBitmap(IN SIZEL Size, { SurfObj->pvBits = EngAllocMem(0 != (Flags & BMF_NOZEROINIT) ? 0 : FL_ZERO_MEMORY, - SurfObj->cjBits, 0); + SurfObj->cjBits, TAG_DIB); } if (SurfObj->pvBits == NULL) { diff --git a/reactos/subsystems/win32/win32k/eng/xlate.c b/reactos/subsystems/win32/win32k/eng/xlate.c index f484bc3ee7b..1b1265490c9 100644 --- a/reactos/subsystems/win32/win32k/eng/xlate.c +++ b/reactos/subsystems/win32/win32k/eng/xlate.c @@ -243,7 +243,7 @@ IntEngCreateXlate(USHORT DestPalType, USHORT SourcePalType, { XlateObj->cEntries = SourcePalGDI->NumColors; XlateObj->pulXlate = - EngAllocMem(0, sizeof(ULONG) * XlateObj->cEntries, 0); + EngAllocMem(0, sizeof(ULONG) * XlateObj->cEntries, TAG_XLATEOBJ); XlateObj->flXlate |= XO_TRIVIAL; for (i = 0; i < XlateObj->cEntries; i++) @@ -264,7 +264,7 @@ IntEngCreateXlate(USHORT DestPalType, USHORT SourcePalType, { XlateObj->cEntries = SourcePalGDI->NumColors; XlateObj->pulXlate = - EngAllocMem(0, sizeof(ULONG) * XlateObj->cEntries, 0); + EngAllocMem(0, sizeof(ULONG) * XlateObj->cEntries, TAG_XLATEOBJ); for (i = 0; i < XlateObj->cEntries; i++) XlateObj->pulXlate[i] = ShiftAndMask(XlateGDI, *((ULONG *)&SourcePalGDI->IndexedColors[i])); @@ -379,7 +379,7 @@ IntEngCreateSrcMonoXlate(HPALETTE PaletteDest, XlateObj = GDIToObj(XlateGDI, XLATE); XlateObj->cEntries = 2; - XlateObj->pulXlate = EngAllocMem(0, sizeof(ULONG) * XlateObj->cEntries, 0); + XlateObj->pulXlate = EngAllocMem(0, sizeof(ULONG) * XlateObj->cEntries, TAG_XLATEOBJ); if (XlateObj->pulXlate == NULL) { PALETTE_UnlockPalette(DestPalGDI); diff --git a/reactos/subsystems/win32/win32k/include/coord.h b/reactos/subsystems/win32/win32k/include/coord.h index 5f69aaeb5c8..89c317e0311 100644 --- a/reactos/subsystems/win32/win32k/include/coord.h +++ b/reactos/subsystems/win32/win32k/include/coord.h @@ -3,26 +3,17 @@ #include -VOID -FASTCALL -IntDPtoLP ( PDC dc, LPPOINT Points, INT Count ); - -VOID -FASTCALL -CoordDPtoLP ( PDC Dc, LPPOINT Point ); +#define IntDPtoLP(dc, pp, c) XFORMOBJ_bApplyXform((XFORMOBJ*)&(dc)->DcLevel.mxDeviceToWorld, XF_LTOL, c, pp, pp); +#define IntLPtoDP(dc, pp, c) XFORMOBJ_bApplyXform((XFORMOBJ*)&(dc)->DcLevel.mxWorldToDevice, XF_LTOL, c, pp, pp); +#define CoordDPtoLP(dc, pp) XFORMOBJ_bApplyXform((XFORMOBJ*)&(dc)->DcLevel.mxDeviceToWorld, XF_LTOL, 1, pp, pp); +#define CoordLPtoDP(dc, pp) XFORMOBJ_bApplyXform((XFORMOBJ*)&(dc)->DcLevel.mxWorldToDevice, XF_LTOL, 1, pp, pp); +#define XForm2MatrixS(m, x) XFORMOBJ_iSetXform((XFORMOBJ*)m, (XFORML*)x) +#define MatrixS2XForm(x, m) XFORMOBJ_iGetXform((XFORMOBJ*)m, (XFORML*)x) int FASTCALL IntGetGraphicsMode ( PDC dc ); -VOID -FASTCALL -CoordLPtoDP ( PDC Dc, LPPOINT Point ); - -VOID -FASTCALL -IntLPtoDP ( PDC dc, LPPOINT Points, INT Count ); - int STDCALL IntGdiSetMapMode(PDC, int); BOOL diff --git a/reactos/subsystems/win32/win32k/include/dc.h b/reactos/subsystems/win32/win32k/include/dc.h index 2d8700df985..fcda0637fad 100644 --- a/reactos/subsystems/win32/win32k/include/dc.h +++ b/reactos/subsystems/win32/win32k/include/dc.h @@ -77,17 +77,17 @@ typedef struct _DCLEVEL BOOL ufiSet; FLONG fl; FLONG flBrush; - MATRIX_S mxWorldToDevice; - MATRIX_S mxDeviceToWorld; - MATRIX_S mxWorldToPage; - EFLOAT_S efM11PtoD; - EFLOAT_S efM22PtoD; - EFLOAT_S efDxPtoD; - EFLOAT_S efDyPtoD; - EFLOAT_S efM11_TWIPS; - EFLOAT_S efM22_TWIPS; - EFLOAT_S efPr11; - EFLOAT_S efPr22; + MATRIX mxWorldToDevice; + MATRIX mxDeviceToWorld; + MATRIX mxWorldToPage; + FLOATOBJ efM11PtoD; + FLOATOBJ efM22PtoD; + FLOATOBJ efDxPtoD; + FLOATOBJ efDyPtoD; + FLOATOBJ efM11_TWIPS; + FLOATOBJ efM22_TWIPS; + FLOATOBJ efPr11; + FLOATOBJ efPr22; PBITMAPOBJ pSurface; // SURFACE* SIZE sizl; } DCLEVEL, *PDCLEVEL; diff --git a/reactos/subsystems/win32/win32k/include/floatobj.h b/reactos/subsystems/win32/win32k/include/floatobj.h new file mode 100644 index 00000000000..631ec8f0cdc --- /dev/null +++ b/reactos/subsystems/win32/win32k/include/floatobj.h @@ -0,0 +1,73 @@ +#ifndef _WIN32K_FLOATOBJ_H_ +#define _WIN32K_FLOATOBJ_H_ + +#if defined(_X86_) + +FORCEINLINE +BOOL +_FLOATOBJ_Equal(FLOATOBJ *pf1, FLOATOBJ *pf2) +{ + EFLOAT_S *pef1 = (EFLOAT_S*)pf1; + EFLOAT_S *pef2 = (EFLOAT_S*)pf2; + return (pef1->lMant == pef2->lMant && pef1->lExp == pef2->lExp); +} + +FORCEINLINE +LONG +_FLOATOBJ_GetLong(FLOATOBJ *pf) +{ + EFLOAT_S *pef = (EFLOAT_S*)pf; + return pef->lMant >> (32 - pef->lExp); +} + +FORCEINLINE +LONG +_FLOATOBJ_GetFix(FLOATOBJ *pf) +{ + EFLOAT_S *pef = (EFLOAT_S*)pf; + LONG Shift = (28 - pef->lExp); + return (Shift >= 0 ? pef->lMant >> Shift : pef->lMant << -Shift); +} + +FORCEINLINE +BOOL +_FLOATOBJ_IsLong(FLOATOBJ *pf) +{ + EFLOAT_S *pef = (EFLOAT_S*)pf; + ULONG Shift = 32 - pef->lExp; + return (((pef->lMant >> Shift) << Shift) == pef->lMant); +} + +FORCEINLINE +BOOL +_FLOATOBJ_Equal0(FLOATOBJ *pf) +{ + EFLOAT_S *pef = (EFLOAT_S*)pf; + return (pef->lMant == 0 && pef->lExp == 0); +} + +FORCEINLINE +BOOL +_FLOATOBJ_Equal1(FLOATOBJ *pf) +{ + EFLOAT_S *pef = (EFLOAT_S*)pf; + return (pef->lMant == 0x40000000 && pef->lExp == 2); +} + +#define FLOATOBJ_Set0(fo) (fo)->ul1 = 0; (fo)->ul2 = 0; +#define FLOATOBJ_Set1(fo) (fo)->ul1 = 0x40000000; (fo)->ul2 = 2; + +#else + +#define _FLOATOBJ_Equal(pf,pf1) (*(pf) == *(pf1)) +#define _FLOATOBJ_GetLong(pf) ((LONG)*(pf)) +#define _FLOATOBJ_IsLong(pf) ((FLOAT)((LONG)*(pf)) == *(pf)) +#define _FLOATOBJ_Equal0(pf) (*(pf) == 0.) +#define _FLOATOBJ_Equal1(pf) (*(pf) == 1.) + +#define FLOATOBJ_Set0(fo) *(fo) = 0; +#define FLOATOBJ_Set1(fo) *(fo) = 1; + +#endif + +#endif /* not _WIN32K_FLOATOBJ_H_ */ diff --git a/reactos/subsystems/win32/win32k/include/gdifloat.h b/reactos/subsystems/win32/win32k/include/gdifloat.h index dabef3beb56..15081a526ed 100644 --- a/reactos/subsystems/win32/win32k/include/gdifloat.h +++ b/reactos/subsystems/win32/win32k/include/gdifloat.h @@ -24,9 +24,8 @@ static __inline INT GDI_ROUND(FLOAT val) } -VOID FASTCALL XForm2MatrixS( MATRIX_S *, PXFORM); -VOID FASTCALL MatrixS2XForm( PXFORM, MATRIX_S *); -/* Performs a world-to-viewport transformation on the specified point (which +/* FIXME: Do not use the fpu in kernel on x86, use FLOATOBJ_Xxx api instead + * Performs a world-to-viewport transformation on the specified point (which * is in floating point format). */ static __inline void INTERNAL_LPTODP_FLOAT(DC *dc, FLOAT_POINT *point) diff --git a/reactos/subsystems/win32/win32k/include/object.h b/reactos/subsystems/win32/win32k/include/object.h index 32c32fb2e31..952697e16c5 100644 --- a/reactos/subsystems/win32/win32k/include/object.h +++ b/reactos/subsystems/win32/win32k/include/object.h @@ -51,7 +51,8 @@ typedef enum _USER_OBJECT_TYPE otCallProc = 7, otAccel, otMonitor = 12, - otEvent = 15 + otEvent = 15, + otTimer } USER_OBJECT_TYPE; diff --git a/reactos/subsystems/win32/win32k/include/tags.h b/reactos/subsystems/win32/win32k/include/tags.h index 9c3c3e66f53..bea0c0333e8 100644 --- a/reactos/subsystems/win32/win32k/include/tags.h +++ b/reactos/subsystems/win32/win32k/include/tags.h @@ -2,6 +2,7 @@ #define _WIN32K_TAGS_H #define TAG_STRING TAG('S', 'T', 'R', ' ') /* string */ +#define TAG_RTLREGISTRY TAG('R', 'q', 'r', 'v') /* RTL registry */ /* ntuser */ #define TAG_MOUSE TAG('M', 'O', 'U', 'S') /* mouse */ @@ -87,6 +88,7 @@ #define TAG_DRIVER TAG('G', 'D', 'R', 'V') /* video drivers */ #define TAG_FNTFILE TAG('F', 'N', 'T', 'F') /* font file */ #define TAG_SSECTPOOL TAG('S', 'S', 'C', 'P') /* shared section pool */ +#define TAG_PFF TAG('G', 'p', 'f', 'f') /* physical font file */ /* Dx internal tags rember I do not known if it right namees */ #define TAG_DXPVMLIST TAG('D', 'X', 'P', 'L') /* pmvlist for the driver */ diff --git a/reactos/subsystems/win32/win32k/include/win32k.h b/reactos/subsystems/win32/win32k/include/win32k.h index a2f3c7cb32c..95423ad799b 100644 --- a/reactos/subsystems/win32/win32k/include/win32k.h +++ b/reactos/subsystems/win32/win32k/include/win32k.h @@ -12,8 +12,6 @@ #define INTERNAL_CALL NTAPI /* Internal Win32k Headers */ -#include - #include #include #include @@ -29,13 +27,16 @@ #include #include #include +#include #include +#include #include #include #include #include #include #include +#include #include #include @@ -74,4 +75,5 @@ #include #include #include + #endif /* __WIN32K_H */ diff --git a/reactos/subsystems/win32/win32k/include/xformobj.h b/reactos/subsystems/win32/win32k/include/xformobj.h new file mode 100644 index 00000000000..5daf643a69d --- /dev/null +++ b/reactos/subsystems/win32/win32k/include/xformobj.h @@ -0,0 +1,31 @@ +#ifndef _WIN32K_XFORMOBJ_H_ +#define _WIN32K_XFORMOBJ_H_ + +ULONG +INTERNAL_CALL +XFORMOBJ_iSetXform( + OUT XFORMOBJ *pxo, + IN XFORML * pxform); + +ULONG +INTERNAL_CALL +XFORMOBJ_iCombine( + IN XFORMOBJ *pxo, + IN XFORMOBJ *pxo1, + IN XFORMOBJ *pxo2); + +ULONG +INTERNAL_CALL +XFORMOBJ_iCombineXform( + IN XFORMOBJ *pxo, + IN XFORMOBJ *pxo1, + IN XFORML *pxform, + IN BOOL bLeftMultiply); + +ULONG +INTERNAL_CALL +XFORMOBJ_Inverse( + OUT XFORMOBJ *pxoDst, + IN XFORMOBJ *pxoSrc); + +#endif /* not _WIN32K_XFORMOBJ_H_ */ diff --git a/reactos/subsystems/win32/win32k/ntuser/cursoricon.c b/reactos/subsystems/win32/win32k/ntuser/cursoricon.c index c1c8210e613..caab60dd274 100644 --- a/reactos/subsystems/win32/win32k/ntuser/cursoricon.c +++ b/reactos/subsystems/win32/win32k/ntuser/cursoricon.c @@ -317,7 +317,7 @@ IntSetupCurIconHandles(PWINSTATION_OBJECT WinSta) NULL, 0, sizeof(CURICON_PROCESS), - 0, + TAG_DIB, 128); InitializeListHead(&gCurIconList); diff --git a/reactos/subsystems/win32/win32k/ntuser/desktop.c b/reactos/subsystems/win32/win32k/ntuser/desktop.c index b144d4a306c..47ed4e3f769 100644 --- a/reactos/subsystems/win32/win32k/ntuser/desktop.c +++ b/reactos/subsystems/win32/win32k/ntuser/desktop.c @@ -355,7 +355,7 @@ IntParseDesktopPath(PEPROCESS Process, NULL, (HANDLE*)hWinSta); - RtlFreeUnicodeString(&FullName); + ExFreePoolWithTag(FullName.Buffer, TAG_STRING); if(!NT_SUCCESS(Status)) { @@ -389,7 +389,7 @@ IntParseDesktopPath(PEPROCESS Process, NULL, (HANDLE*)hDesktop); - RtlFreeUnicodeString(&FullName); + ExFreePoolWithTag(FullName.Buffer, TAG_STRING); if(!NT_SUCCESS(Status)) { @@ -931,11 +931,12 @@ NtUserCreateDesktop( { SetLastNtError(STATUS_INSUFFICIENT_RESOURCES); ObDereferenceObject(WinStaObject); - if (lpszDesktopName) - RtlFreeUnicodeString(&SafeDesktopName); + if (lpszDesktopName) + ExFreePoolWithTag(SafeDesktopName.Buffer, TAG_STRING); RETURN( NULL); } - RtlFreeUnicodeString(&SafeDesktopName); + if (lpszDesktopName) + ExFreePoolWithTag(SafeDesktopName.Buffer, TAG_STRING); ObDereferenceObject(WinStaObject); /* @@ -963,7 +964,7 @@ NtUserCreateDesktop( if (!NT_SUCCESS(Status)) RETURN(NULL); if (Status == STATUS_OBJECT_NAME_EXISTS) { - ExFreePool(DesktopName.Buffer); + ExFreePoolWithTag(DesktopName.Buffer, TAG_STRING); RETURN( Desktop); } @@ -1019,7 +1020,7 @@ NtUserCreateDesktop( /* Initialize some local (to win32k) desktop state. */ DesktopObject->ActiveMessageQueue = NULL; - ExFreePool(DesktopName.Buffer); + ExFreePoolWithTag(DesktopName.Buffer, TAG_STRING); if (! NT_SUCCESS(Status)) { @@ -1138,7 +1139,8 @@ NtUserOpenDesktop( Result = IntGetFullWindowStationName(&DesktopName, &WinStaObject->Name, &SafeDesktopName); - RtlFreeUnicodeString(&SafeDesktopName); + if (lpszDesktopName) + ExFreePoolWithTag(SafeDesktopName.Buffer, TAG_STRING); ObDereferenceObject(WinStaObject); diff --git a/reactos/subsystems/win32/win32k/ntuser/focus.c b/reactos/subsystems/win32/win32k/ntuser/focus.c index 22dc53535d6..547dd2cca9f 100644 --- a/reactos/subsystems/win32/win32k/ntuser/focus.c +++ b/reactos/subsystems/win32/win32k/ntuser/focus.c @@ -136,7 +136,6 @@ co_IntSendActivateMessages(HWND hWndPrev, HWND hWnd, BOOL MouseActivate) /* FIXME: IntIsWindow */ - CHECKPOINT; co_IntPostOrSendMessage(hWnd, WM_NCACTIVATE, (WPARAM)(hWnd == UserGetForegroundWindow()), 0); /* FIXME: WA_CLICKACTIVE */ co_IntPostOrSendMessage(hWnd, WM_ACTIVATE, @@ -251,7 +250,6 @@ co_IntSetForegroundAndFocusWindow(PWINDOW_OBJECT Window, PWINDOW_OBJECT FocusWin /* FIXME: Send WM_ACTIVATEAPP to all thread windows. */ } - CHECKPOINT; co_IntSendSetFocusMessages(hWndFocusPrev, hWndFocus); co_IntSendActivateMessages(hWndPrev, hWnd, MouseActivate); diff --git a/reactos/subsystems/win32/win32k/ntuser/hook.c b/reactos/subsystems/win32/win32k/ntuser/hook.c index 4bd3f19e323..bbdef0ba2fc 100644 --- a/reactos/subsystems/win32/win32k/ntuser/hook.c +++ b/reactos/subsystems/win32/win32k/ntuser/hook.c @@ -1045,7 +1045,7 @@ NtUserSetWindowsHookEx( Global = TRUE; } - if ( Global || + if ( ( Global && (HookId != WH_KEYBOARD_LL || HookId != WH_MOUSE_LL) ) || WH_DEBUG == HookId || WH_JOURNALPLAYBACK == HookId || WH_JOURNALRECORD == HookId) diff --git a/reactos/subsystems/win32/win32k/ntuser/input.c b/reactos/subsystems/win32/win32k/ntuser/input.c index a86b1984c7a..4657293394b 100644 --- a/reactos/subsystems/win32/win32k/ntuser/input.c +++ b/reactos/subsystems/win32/win32k/ntuser/input.c @@ -839,6 +839,12 @@ InitInputImpl(VOID) KeInitializeEvent(&InputThreadsStart, NotificationEvent, FALSE); + /* Initialize the default keyboard layout */ + if(!UserInitDefaultKeyboardLayout()) + { + DPRINT1("Failed to initialize default keyboard layout!\n"); + } + Status = PsCreateSystemThread(&KeyboardThreadHandle, THREAD_ALL_ACCESS, NULL, @@ -851,12 +857,6 @@ InitInputImpl(VOID) DPRINT1("Win32K: Failed to create keyboard thread.\n"); } - /* Initialize the default keyboard layout */ - if(!UserInitDefaultKeyboardLayout()) - { - DPRINT1("Failed to initialize default keyboard layout!\n"); - } - Status = PsCreateSystemThread(&MouseThreadHandle, THREAD_ALL_ACCESS, NULL, diff --git a/reactos/subsystems/win32/win32k/ntuser/kbdlayout.c b/reactos/subsystems/win32/win32k/ntuser/kbdlayout.c index b11ffa071f2..daaf0bbeff5 100644 --- a/reactos/subsystems/win32/win32k/ntuser/kbdlayout.c +++ b/reactos/subsystems/win32/win32k/ntuser/kbdlayout.c @@ -92,7 +92,7 @@ static NTSTATUS NTAPI ReadRegistryValue( PUNICODE_STRING KeyName, if( !NT_SUCCESS(Status) ) { NtClose(KeyHandle); - ExFreePool(KeyValuePartialInfo); + ExFreePoolWithTag(KeyValuePartialInfo, TAG_STRING); return Status; } @@ -104,7 +104,7 @@ static NTSTATUS NTAPI ReadRegistryValue( PUNICODE_STRING KeyName, if(!ReturnBuffer) { NtClose(KeyHandle); - ExFreePool(KeyValuePartialInfo); + ExFreePoolWithTag(KeyValuePartialInfo, TAG_STRING); return STATUS_NO_MEMORY; } @@ -113,7 +113,7 @@ static NTSTATUS NTAPI ReadRegistryValue( PUNICODE_STRING KeyName, KeyValuePartialInfo->DataLength); RtlInitUnicodeString(ReturnedValue, ReturnBuffer); - ExFreePool(KeyValuePartialInfo); + ExFreePoolWithTag(KeyValuePartialInfo, TAG_STRING); NtClose(KeyHandle); return Status; @@ -154,7 +154,7 @@ static BOOL UserLoadKbdDll(WCHAR *wsKLID, FullLayoutPath.MaximumLength = sizeof(LayoutPathBuffer); RtlAppendUnicodeStringToString(&FullLayoutPath, &LayoutFile); DPRINT("Loading Keyboard DLL %wZ\n", &FullLayoutPath); - RtlFreeUnicodeString(&LayoutFile); + ExFreePoolWithTag(LayoutFile.Buffer, TAG_STRING); *phModule = EngLoadImage(FullLayoutPath.Buffer); @@ -321,7 +321,10 @@ PKBL W32kGetDefaultKeyLayout(VOID) Status = ReadRegistryValue(&FullKeyboardLayoutPath, &LayoutValueName, &LayoutLocaleIdString); if( NT_SUCCESS(Status) ) + { RtlUnicodeStringToInteger(&LayoutLocaleIdString, 16, &LayoutLocaleId); + ExFreePoolWithTag(LayoutLocaleIdString.Buffer, TAG_STRING); + } else DPRINT1("ReadRegistryValue failed! (%08lx).\n", Status); } diff --git a/reactos/subsystems/win32/win32k/ntuser/menu.c b/reactos/subsystems/win32/win32k/ntuser/menu.c index 4c23b30449f..898307f4762 100644 --- a/reactos/subsystems/win32/win32k/ntuser/menu.c +++ b/reactos/subsystems/win32/win32k/ntuser/menu.c @@ -95,7 +95,7 @@ UserMenuInfo( { \ if((MENU_ITEM_TYPE((MenuItem)->fType) == MF_STRING) && \ (MenuItem)->Text.Length) { \ - RtlFreeUnicodeString(&(MenuItem)->Text); \ + ExFreePoolWithTag((MenuItem)->Text.Buffer, TAG_STRING); \ } \ } @@ -220,7 +220,6 @@ IntFreeMenuItem(PMENU_OBJECT Menu, PMENU_ITEM MenuItem, BOOL bRecurse) } /* Free memory */ - if (MenuItem->Text.Buffer) ExFreePool(MenuItem->Text.Buffer); ExFreePool(MenuItem); return TRUE; diff --git a/reactos/subsystems/win32/win32k/ntuser/msgqueue.c b/reactos/subsystems/win32/win32k/ntuser/msgqueue.c index d472d8ec2cb..ebed9aad710 100644 --- a/reactos/subsystems/win32/win32k/ntuser/msgqueue.c +++ b/reactos/subsystems/win32/win32k/ntuser/msgqueue.c @@ -155,14 +155,14 @@ MsqInitializeImpl(VOID) NULL, 0, sizeof(USER_MESSAGE), - 0, + TAG_USRMSG, 256); ExInitializePagedLookasideList(&TimerLookasideList, NULL, NULL, 0, sizeof(TIMER_ENTRY), - 0, + TAG_TIMER, 64); return(STATUS_SUCCESS); diff --git a/reactos/subsystems/win32/win32k/ntuser/windc.c b/reactos/subsystems/win32/win32k/ntuser/windc.c index 24f4955d26b..fd1a03eee34 100644 --- a/reactos/subsystems/win32/win32k/ntuser/windc.c +++ b/reactos/subsystems/win32/win32k/ntuser/windc.c @@ -467,6 +467,7 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags) { Dce = DceAllocDCE(NULL, DCE_CACHE_DC); } + if (!Dce) return NULL; Dce->hwndCurrent = (Window ? Window->hSelf : NULL); } diff --git a/reactos/subsystems/win32/win32k/ntuser/window.c b/reactos/subsystems/win32/win32k/ntuser/window.c index d56010a17d7..08a2e43b171 100644 --- a/reactos/subsystems/win32/win32k/ntuser/window.c +++ b/reactos/subsystems/win32/win32k/ntuser/window.c @@ -2259,7 +2259,7 @@ NtUserCreateWindowEx(DWORD dwExStyle, { if (! IS_ATOM(ClassName.Buffer)) { - RtlFreeUnicodeString(&ClassName); + ExFreePoolWithTag(ClassName.Buffer, TAG_STRING); } SetLastNtError(Status); RETURN( NULL); @@ -2273,10 +2273,13 @@ NtUserCreateWindowEx(DWORD dwExStyle, NewWindow = co_IntCreateWindowEx(dwExStyle, &ClassName, &WindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam, dwShowMode, bUnicodeWindow); - RtlFreeUnicodeString(&WindowName); + if (WindowName.Buffer) + { + ExFreePoolWithTag(WindowName.Buffer, TAG_STRING); + } if (! IS_ATOM(ClassName.Buffer)) { - RtlFreeUnicodeString(&ClassName); + ExFreePoolWithTag(ClassName.Buffer, TAG_STRING); } RETURN( NewWindow); @@ -4013,7 +4016,7 @@ NtUserRegisterWindowMessage(PUNICODE_STRING MessageNameUnsafe) Ret = (UINT)IntAddAtom(SafeMessageName.Buffer); - RtlFreeUnicodeString(&SafeMessageName); + ExFreePoolWithTag(SafeMessageName.Buffer, TAG_STRING); RETURN( Ret); CLEANUP: diff --git a/reactos/subsystems/win32/win32k/objects/coord.c b/reactos/subsystems/win32/win32k/objects/coord.c index bc4cc602562..305c0737d67 100644 --- a/reactos/subsystems/win32/win32k/objects/coord.c +++ b/reactos/subsystems/win32/win32k/objects/coord.c @@ -116,33 +116,6 @@ BOOL STDCALL NtGdiCombineTransform(LPXFORM UnsafeXFormResult, return Ret; } -VOID FASTCALL -CoordDPtoLP(PDC Dc, LPPOINT Point) -{ -FLOAT x, y; - x = (FLOAT)Point->x; - y = (FLOAT)Point->y; - XFORM xformVport2World; - - MatrixS2XForm(&xformVport2World, &Dc->DcLevel.mxDeviceToWorld); - - Point->x = x * xformVport2World.eM11 + - y * xformVport2World.eM21 + xformVport2World.eDx; - Point->y = x * xformVport2World.eM12 + - y * xformVport2World.eM22 + xformVport2World.eDy; -} - -VOID -FASTCALL -IntDPtoLP ( PDC dc, LPPOINT Points, INT Count ) -{ - INT i; - - ASSERT ( Points ); - - for ( i = 0; i < Count; i++ ) - CoordDPtoLP ( dc, &Points[i] ); -} int FASTCALL @@ -245,38 +218,6 @@ NtGdiGetTransform(HDC hDC, return NT_SUCCESS(Status); } -VOID -FASTCALL -CoordLPtoDP ( PDC Dc, LPPOINT Point ) -{ - FLOAT x, y; - XFORM xformWorld2Vport; - - ASSERT(Dc); - ASSERT(Point); - - x = (FLOAT)Point->x; - y = (FLOAT)Point->y; - - MatrixS2XForm(&xformWorld2Vport, &Dc->DcLevel.mxWorldToDevice); - - Point->x = x * xformWorld2Vport.eM11 + - y * xformWorld2Vport.eM21 + xformWorld2Vport.eDx; - Point->y = x * xformWorld2Vport.eM12 + - y * xformWorld2Vport.eM22 + xformWorld2Vport.eDy; -} - -VOID -FASTCALL -IntLPtoDP ( PDC dc, LPPOINT Points, INT Count ) -{ - INT i; - - ASSERT ( Points ); - - for ( i = 0; i < Count; i++ ) - CoordLPtoDP ( dc, &Points[i] ); -} /*! * Converts points from logical coordinates into device coordinates. Conversion depends on the mapping mode, @@ -727,6 +668,10 @@ IntGdiSetMapMode(PDC dc, Dc_Attr->szlWindowExt.cy = 1; Dc_Attr->szlViewportExt.cx = 1; Dc_Attr->szlViewportExt.cy = 1; + Dc_Attr->flXform &= ~(ISO_OR_ANISO_MAP_MODE|PTOD_EFM22_NEGATIVE| + PTOD_EFM11_NEGATIVE|POSITIVE_Y_IS_UP); + Dc_Attr->flXform |= (PAGE_XLATE_CHANGED|PAGE_TO_DEVICE_SCALE_IDENTITY| + INVALIDATE_ATTRIBUTES|DEVICE_TO_WORLD_INVALID); break; case MM_LOMETRIC: @@ -766,7 +711,12 @@ IntGdiSetMapMode(PDC dc, break; case MM_ANISOTROPIC: + Dc_Attr->flXform &= ~(PAGE_TO_DEVICE_IDENTITY|POSITIVE_Y_IS_UP); + Dc_Attr->flXform |= ISO_OR_ANISO_MAP_MODE; break; + default: + Dc_Attr->iMapMode = PrevMapMode; + PrevMapMode = 0; } DC_UpdateXforms(dc); diff --git a/reactos/subsystems/win32/win32k/objects/dc.c b/reactos/subsystems/win32/win32k/objects/dc.c index 60198717dbb..f8b1096e860 100644 --- a/reactos/subsystems/win32/win32k/objects/dc.c +++ b/reactos/subsystems/win32/win32k/objects/dc.c @@ -216,7 +216,7 @@ FindDriverFileNames(PUNICODE_STRING DriverFileNames, ULONG DisplayNumber) QueryTable, NULL, NULL); - RtlFreeUnicodeString(&RegistryPath); + ExFreePoolWithTag(RegistryPath.Buffer, TAG_RTLREGISTRY); if (! NT_SUCCESS(Status)) { DPRINT1("No InstalledDisplayDrivers value in service entry found\n"); @@ -323,7 +323,7 @@ SetupDevMode(PDEVMODEW DevMode, ULONG DisplayNumber) } } - RtlFreeUnicodeString(&RegistryPath); + ExFreePoolWithTag(RegistryPath.Buffer, TAG_RTLREGISTRY); if (! Valid) { @@ -428,14 +428,14 @@ IntPrepareDriver() if (!GotDriver) { ObDereferenceObject(PrimarySurface.VideoFileObject); - RtlFreeUnicodeString(&DriverFileNames); + ExFreePoolWithTag(DriverFileNames.Buffer, TAG_RTLREGISTRY); DPRINT1("No suitable DDI driver found\n"); continue; } DPRINT("Display driver %S loaded\n", CurrentName); - RtlFreeUnicodeString(&DriverFileNames); + ExFreePoolWithTag(DriverFileNames.Buffer, TAG_RTLREGISTRY); DPRINT("Building DDI Functions\n"); @@ -2453,7 +2453,7 @@ DC_AllocDC(PUNICODE_STRING Driver) { if(Buf) { - ExFreePool(Buf); + ExFreePoolWithTag(Buf, TAG_DC); } DPRINT1("GDIOBJ_AllocObjWithHandle failed\n"); return NULL; @@ -2644,7 +2644,8 @@ BOOL INTERNAL_CALL DC_Cleanup(PVOID ObjectBody) { PDC pDC = (PDC)ObjectBody; - RtlFreeUnicodeString(&pDC->DriverName); + if (pDC->DriverName.Buffer) + ExFreePoolWithTag(pDC->DriverName.Buffer, TAG_DC); return TRUE; } @@ -3103,7 +3104,7 @@ IntEnumDisplaySettings( } } - RtlFreeUnicodeString(&DriverFileNames); + ExFreePoolWithTag(DriverFileNames.Buffer, TAG_RTLREGISTRY); } /* return cached info */ diff --git a/reactos/subsystems/win32/win32k/objects/text.c b/reactos/subsystems/win32/win32k/objects/text.c index 77606d81765..a4e59a2978f 100644 --- a/reactos/subsystems/win32/win32k/objects/text.c +++ b/reactos/subsystems/win32/win32k/objects/text.c @@ -355,7 +355,7 @@ IntGdiAddFontResource(PUNICODE_STRING FileName, DWORD Characteristics) return 0; } - FontGDI->Filename = ExAllocatePool(PagedPool, FileName->Length + sizeof(WCHAR)); + FontGDI->Filename = ExAllocatePoolWithTag(PagedPool, FileName->Length + sizeof(WCHAR), TAG_PFF); if (FontGDI->Filename == NULL) { EngFreeMem(FontGDI); @@ -385,7 +385,7 @@ IntGdiAddFontResource(PUNICODE_STRING FileName, DWORD Characteristics) - DPRINT1("Font loaded: %s (%s)\n", Face->family_name, Face->style_name); + DPRINT("Font loaded: %s (%s)\n", Face->family_name, Face->style_name); DPRINT("Num glyphs: %u\n", Face->num_glyphs); /* Add this font resource to the font table */ diff --git a/reactos/subsystems/win32/win32k/objects/xformobj.c b/reactos/subsystems/win32/win32k/objects/xformobj.c new file mode 100644 index 00000000000..53697ccc3b7 --- /dev/null +++ b/reactos/subsystems/win32/win32k/objects/xformobj.c @@ -0,0 +1,525 @@ +/* + * PROJECT: ReactOS win32 kernel mode subsystem + * LICENSE: GPL - See COPYING in the top level directory + * FILE: subsystems/win32/win32k/objects/xformobj.c + * PURPOSE: XFORMOBJ api + * PROGRAMMER: Timo Kreuzer + */ + +/** Includes ******************************************************************/ + +#include +#define NDEBUG +#include + +C_ASSERT(sizeof(FIX) == sizeof(LONG)); +#define FIX2LONG(x) ((x) >> 4) +#define LONG2FIX(x) ((x) << 4) + +#define FLOATOBJ_Equal _FLOATOBJ_Equal +#define FLOATOBJ_GetLong _FLOATOBJ_GetLong +#define FLOATOBJ_GetFix _FLOATOBJ_GetFix +#define FLOATOBJ_IsLong _FLOATOBJ_IsLong +#define FLOATOBJ_Equal0 _FLOATOBJ_Equal0 +#define FLOATOBJ_Equal1 _FLOATOBJ_Equal1 + +/** Inline helper functions ***************************************************/ + +/* + * Inline helper to calculate pfo1 * pfo2 + pfo3 * pfo4 + */ +VOID FORCEINLINE +MulAdd( + PFLOATOBJ pfoDest, + PFLOATOBJ pfo1, + PFLOATOBJ pfo2, + PFLOATOBJ pfo3, + PFLOATOBJ pfo4) +{ + FLOATOBJ foTmp; + + *pfoDest = *pfo1; + FLOATOBJ_Mul(pfoDest, pfo2); + foTmp = *pfo3; + FLOATOBJ_Mul(&foTmp, pfo4); + FLOATOBJ_Add(pfoDest, &foTmp); +} + +/* + * Inline helper to calculate pfo1 * l2 + pfo3 * l4 + */ +VOID FORCEINLINE +MulAddLong( + PFLOATOBJ pfoDest, + PFLOATOBJ pfo1, + LONG l2, + PFLOATOBJ pfo3, + LONG l4) +{ + FLOATOBJ foTmp; + + *pfoDest = *pfo1; + FLOATOBJ_MulLong(pfoDest, l2); + foTmp = *pfo3; + FLOATOBJ_MulLong(&foTmp, l4); + FLOATOBJ_Add(pfoDest, &foTmp); +} + +/* + * Inline helper to calculate pfo1 * pfo2 - pfo3 * pfo4 + */ +VOID FORCEINLINE +MulSub( + PFLOATOBJ pfoDest, + PFLOATOBJ pfo1, + PFLOATOBJ pfo2, + PFLOATOBJ pfo3, + PFLOATOBJ pfo4) +{ + FLOATOBJ foTmp; + + *pfoDest = *pfo1; + FLOATOBJ_Mul(pfoDest, pfo2); + foTmp = *pfo3; + FLOATOBJ_Mul(&foTmp, pfo4); + FLOATOBJ_Sub(pfoDest, &foTmp); +} + +/* + * Inline helper to get the complexity hint from flAccel + */ +ULONG FORCEINLINE +HintFromAccel(ULONG flAccel) +{ + switch (flAccel & (MX_NOTRANSLATE | MX_IDENTITYSCALE | MX_SCALE)) + { + case (MX_SCALE | MX_IDENTITYSCALE | MX_NOTRANSLATE): + return GX_IDENTITY; + case (MX_SCALE | MX_IDENTITYSCALE): + return GX_OFFSET; + case MX_SCALE: + return GX_SCALE; + default: + return GX_GENERAL; + } +} + +/** Internal functions ********************************************************/ + +ULONG +INTERNAL_CALL +XFORMOBJ_UpdateAccel( + IN XFORMOBJ *pxo) +{ + PMATRIX pmx = (PMATRIX)pxo; + + /* Copy Dx and Dy to FIX format */ + pmx->fxDx = FLOATOBJ_GetFix(&pmx->efDx); + pmx->fxDy = FLOATOBJ_GetFix(&pmx->efDy); + + pmx->flAccel = 0; + + if (FLOATOBJ_Equal0(&pmx->efDx) && + FLOATOBJ_Equal0(&pmx->efDy)) + { + pmx->flAccel |= MX_NOTRANSLATE; + } + + if (FLOATOBJ_Equal0(&pmx->efM12) && + FLOATOBJ_Equal0(&pmx->efM21)) + { + pmx->flAccel |= MX_SCALE; + } + + if (FLOATOBJ_Equal1(&pmx->efM11) && + FLOATOBJ_Equal1(&pmx->efM22)) + { + pmx->flAccel |= MX_IDENTITYSCALE; + } + + if (FLOATOBJ_IsLong(&pmx->efM11) && FLOATOBJ_IsLong(&pmx->efM12) && + FLOATOBJ_IsLong(&pmx->efM21) && FLOATOBJ_IsLong(&pmx->efM22)) + { + pmx->flAccel |= MX_INTEGER; + } + + return HintFromAccel(pmx->flAccel); +} + + +ULONG +INTERNAL_CALL +XFORMOBJ_iSetXform( + OUT XFORMOBJ *pxo, + IN XFORML * pxform) +{ + PMATRIX pmx = (PMATRIX)pxo; + + /* Check parameters */ + if (!pxo || !pxform) + { + return DDI_ERROR; + } + + /* Copy members */ + FLOATOBJ_SetFloat(&pmx->efM11, pxform->eM11); + FLOATOBJ_SetFloat(&pmx->efM12, pxform->eM12); + FLOATOBJ_SetFloat(&pmx->efM21, pxform->eM21); + FLOATOBJ_SetFloat(&pmx->efM22, pxform->eM22); + FLOATOBJ_SetFloat(&pmx->efDx, pxform->eDx); + FLOATOBJ_SetFloat(&pmx->efDy, pxform->eDy); + + /* Update accelerators and return complexity */ + return XFORMOBJ_UpdateAccel(pxo); +} + + +/* + * Multiplies pxo1 with pxo2 and stores the result in pxo. + * returns complexity hint + * | efM11 efM12 0 | + * | efM21 efM22 0 | + * | efDx efDy 1 | + */ +ULONG +INTERNAL_CALL +XFORMOBJ_iCombine( + IN XFORMOBJ *pxo, + IN XFORMOBJ *pxo1, + IN XFORMOBJ *pxo2) +{ + MATRIX mx; + PMATRIX pmx, pmx1, pmx2; + + pmx = (PMATRIX)pxo; + pmx1 = (PMATRIX)pxo1; + pmx2 = (PMATRIX)pxo2; + + /* Do a 3 x 3 matrix multiplication with mx as destinantion */ + MulAdd(&mx.efM11, &pmx1->efM11, &pmx2->efM11, &pmx1->efM12, &pmx2->efM21); + MulAdd(&mx.efM12, &pmx1->efM11, &pmx2->efM12, &pmx1->efM12, &pmx2->efM22); + MulAdd(&mx.efM21, &pmx1->efM21, &pmx2->efM11, &pmx1->efM22, &pmx2->efM21); + MulAdd(&mx.efM22, &pmx1->efM21, &pmx2->efM12, &pmx1->efM22, &pmx2->efM22); + MulAdd(&mx.efDx, &pmx1->efDx, &pmx2->efM11, &pmx1->efDy, &pmx2->efM21); + FLOATOBJ_Add(&mx.efDx, &pmx2->efDx); + MulAdd(&mx.efDy, &pmx1->efDx, &pmx2->efM12, &pmx1->efDy, &pmx2->efM22); + FLOATOBJ_Add(&mx.efDy, &pmx2->efDy); + + /* Copy back */ + *pmx = mx; + + /* Update accelerators and return complexity */ + return XFORMOBJ_UpdateAccel(pxo); +} + + +ULONG +INTERNAL_CALL +XFORMOBJ_iCombineXform( + IN XFORMOBJ *pxo, + IN XFORMOBJ *pxo1, + IN XFORML *pxform, + IN BOOL bLeftMultiply) +{ + MATRIX mx; + XFORMOBJ *pxo2 = (XFORMOBJ*)&mx; + + XFORMOBJ_iSetXform(pxo2, pxform); + + if (bLeftMultiply) + { + return XFORMOBJ_iCombine(pxo, pxo2, pxo1); + } + else + { + return XFORMOBJ_iCombine(pxo, pxo1, pxo2); + } +} + +/* + * A^-1 = adj(A) / det(AT) + * A^-1 = 1/(a*d - b*c) * (a22,-a12,a21,-a11) + */ +ULONG +INTERNAL_CALL +XFORMOBJ_Inverse( + OUT XFORMOBJ *pxoDst, + IN XFORMOBJ *pxoSrc) +{ + PMATRIX pmxDst, pmxSrc; + FLOATOBJ foDet; + + pmxDst = (PMATRIX)pxoDst; + pmxSrc = (PMATRIX)pxoSrc; + + /* det = M11 * M22 - M12 * M21 */ + MulSub(&foDet, &pmxSrc->efM11, &pmxSrc->efM22, &pmxSrc->efM12, &pmxSrc->efM21); + + if (FLOATOBJ_Equal0(&foDet)) + { + /* Determinant is 0! */ + return DDI_ERROR; + } + + /* Calculate adj(A) / det(A) */ + pmxDst->efM11 = pmxSrc->efM22; + FLOATOBJ_Div(&pmxDst->efM11, &foDet); + pmxDst->efM22 = pmxSrc->efM11; + FLOATOBJ_Div(&pmxDst->efM22, &foDet); + + /* The other 2 are negative, negate foDet for that */ + FLOATOBJ_Neg(&foDet); + pmxDst->efM12 = pmxSrc->efM21; + FLOATOBJ_Div(&pmxDst->efM12, &foDet); + pmxDst->efM21 = pmxSrc->efM12; + FLOATOBJ_Div(&pmxDst->efM22, &foDet); + + /* Update accelerators and return complexity */ + return XFORMOBJ_UpdateAccel(pxoDst); +} + + +BOOL +INTERNAL_CALL +XFORMOBJ_bXformFixPoints( + IN XFORMOBJ *pxo, + IN ULONG cPoints, + IN PPOINTL pptIn, + OUT PPOINTL pptOut) +{ + PMATRIX pmx; + INT i; + FLOATOBJ fo1, fo2; + FLONG flAccel; + + pmx = (PMATRIX)pxo; + flAccel = pmx->flAccel & (MX_INTEGER|MX_SCALE|MX_IDENTITYSCALE); + + switch (flAccel) + { + case (MX_SCALE | MX_IDENTITYSCALE): + case (MX_SCALE | MX_IDENTITYSCALE | MX_INTEGER): + /* Identity transformation, nothing todo */ + break; + + case (MX_IDENTITYSCALE | MX_INTEGER): + /* 1-scale integer transform */ + i = cPoints - 1; + do + { + LONG x = pptIn[i].x + pptIn[i].y * FLOATOBJ_GetLong(&pmx->efM21); + LONG y = pptIn[i].y + pptIn[i].x * FLOATOBJ_GetLong(&pmx->efM12); + pptOut[i].y = y; + pptOut[i].x = x; + } + while (--i >= 0); + break; + + case (MX_SCALE | MX_INTEGER): + /* Diagonal integer transform */ + i = cPoints - 1; + do + { + pptOut[i].x = pptIn[i].x * FLOATOBJ_GetLong(&pmx->efM11); + pptOut[i].y = pptIn[i].y * FLOATOBJ_GetLong(&pmx->efM22); + } + while (--i >= 0); + break; + + case (MX_INTEGER): + /* Full integer transform */ + i = cPoints - 1; + do + { + LONG x; + x = pptIn[i].x * FLOATOBJ_GetLong(&pmx->efM11); + x += pptIn[i].y * FLOATOBJ_GetLong(&pmx->efM21); + pptOut[i].y = pptIn[i].y * FLOATOBJ_GetLong(&pmx->efM22); + pptOut[i].y += pptIn[i].x * FLOATOBJ_GetLong(&pmx->efM12); + pptOut[i].x = x; + } + while (--i >= 0); + break; + + case (MX_IDENTITYSCALE): + /* 1-scale transform */ + i = cPoints - 1; + do + { + fo1 = pmx->efM21; + FLOATOBJ_MulLong(&fo1, pptIn[i].y); + fo2 = pmx->efM12; + FLOATOBJ_MulLong(&fo2, pptIn[i].x); + pptOut[i].x = pptIn[i].x + FLOATOBJ_GetLong(&fo1); + pptOut[i].y = pptIn[i].y + FLOATOBJ_GetLong(&fo2); + } + while (--i >= 0); + break; + + case (MX_SCALE): + /* Diagonal float transform */ + i = cPoints - 1; + do + { + fo1 = pmx->efM11; + FLOATOBJ_MulLong(&fo1, pptIn[i].x); + pptOut[i].x = FLOATOBJ_GetLong(&fo1); + fo2 = pmx->efM22; + FLOATOBJ_MulLong(&fo2, pptIn[i].y); + pptOut[i].y = FLOATOBJ_GetLong(&fo2); + } + while (--i >= 0); + break; + + default: + /* Full float transform */ + i = cPoints - 1; + do + { + MulAddLong(&fo1, &pmx->efM11, pptIn[i].x, &pmx->efM21, pptIn[i].y); + MulAddLong(&fo2, &pmx->efM12, pptIn[i].x, &pmx->efM22, pptIn[i].y); + pptOut[i].x = FLOATOBJ_GetLong(&fo1); + pptOut[i].y = FLOATOBJ_GetLong(&fo2); + } + while (--i >= 0); + break; + } + + if (!(pmx->flAccel & MX_NOTRANSLATE)) + { + /* Translate points */ + i = cPoints - 1; + do + { +// DPRINT1("Translating Points (%d,%d)->(%d,%d)\n", pptOut[i].x, pptOut[i].y, pptOut[i].x + pmx->fxDx, pptOut[i].y + pmx->fxDy); + pptOut[i].x += pmx->fxDx; + pptOut[i].y += pmx->fxDy; + } + while (--i >= 0); + } + + return TRUE; +} + +/** Public functions **********************************************************/ + +// www.osr.com/ddk/graphics/gdifncs_0s2v.htm +ULONG +NTAPI +XFORMOBJ_iGetXform( + IN XFORMOBJ *pxo, + OUT XFORML *pxform) +{ + PMATRIX pmx = (PMATRIX)pxo; + + /* Check parameters */ + if (!pxo || !pxform) + { + return DDI_ERROR; + } + + /* Copy members */ + pxform->eM11 = FLOATOBJ_GetFloat(&pmx->efM11); + pxform->eM12 = FLOATOBJ_GetFloat(&pmx->efM12); + pxform->eM21 = FLOATOBJ_GetFloat(&pmx->efM21); + pxform->eM22 = FLOATOBJ_GetFloat(&pmx->efM22); + pxform->eDx = FLOATOBJ_GetFloat(&pmx->efDx); + pxform->eDy = FLOATOBJ_GetFloat(&pmx->efDy); + + /* Return complexity hint */ + return HintFromAccel(pmx->flAccel); +} + + +// www.osr.com/ddk/graphics/gdifncs_5ig7.htm +ULONG +NTAPI +XFORMOBJ_iGetFloatObjXform( + IN XFORMOBJ *pxo, + OUT FLOATOBJ_XFORM *pxfo) +{ + PMATRIX pmx = (PMATRIX)pxo; + + /* Check parameters */ + if (!pxo || !pxfo) + { + return DDI_ERROR; + } + + /* Copy members */ + pxfo->eM11 = pmx->efM11; + pxfo->eM12 = pmx->efM12; + pxfo->eM21 = pmx->efM21; + pxfo->eM22 = pmx->efM22; + pxfo->eDx = pmx->efDx; + pxfo->eDy = pmx->efDy; + + /* Return complexity hint */ + return HintFromAccel(pmx->flAccel); +} + + +// www.osr.com/ddk/graphics/gdifncs_027b.htm +BOOL +NTAPI +XFORMOBJ_bApplyXform( + IN XFORMOBJ *pxo, + IN ULONG iMode, + IN ULONG cPoints, + IN PVOID pvIn, + OUT PVOID pvOut) +{ + MATRIX mx; + POINTL *pptl; + INT i; + + /* Check parameters */ + if (!pxo || !pvIn || !pvOut || cPoints < 1) + { + return FALSE; + } + + /* Use inverse xform? */ + if (iMode == XF_INV_FXTOL || iMode == XF_INV_LTOL) + { + ULONG ret; + ret = XFORMOBJ_Inverse((XFORMOBJ*)&mx, pxo); + if (ret == DDI_ERROR) + { + return FALSE; + } + pxo = (XFORMOBJ*)&mx; + } + + /* Convert POINTL to POINTFIX? */ + if (iMode == XF_LTOFX || iMode == XF_LTOL || iMode == XF_INV_LTOL) + { + pptl = pvIn; + for (i = cPoints - 1; i >= 0; i--) + { + pptl[i].x = LONG2FIX(pptl[i].x); + pptl[i].y = LONG2FIX(pptl[i].y); + } + } + + /* Do the actual fixpoint transformation */ + if (!XFORMOBJ_bXformFixPoints(pxo, cPoints, pvIn, pvOut)) + { + return FALSE; + } + + /* Convert POINTFIX to POINTL? */ + if (iMode == XF_INV_FXTOL || iMode == XF_INV_LTOL || iMode == XF_LTOL) + { + pptl = pvOut; + for (i = cPoints - 1; i >= 0; i--) + { + pptl[i].x = FIX2LONG(pptl[i].x); + pptl[i].y = FIX2LONG(pptl[i].y); + } + } + + return TRUE; +} + +/* EOF */ diff --git a/reactos/subsystems/win32/win32k/stubs/stubs.c b/reactos/subsystems/win32/win32k/stubs/stubs.c index 2851bbc50c2..c662f170356 100644 --- a/reactos/subsystems/win32/win32k/stubs/stubs.c +++ b/reactos/subsystems/win32/win32k/stubs/stubs.c @@ -736,45 +736,6 @@ PATHOBJ_vGetBounds( UNIMPLEMENTED; } -BOOL -APIENTRY -XFORMOBJ_bApplyXform( - IN XFORMOBJ *pxo, - IN ULONG iMode, - IN ULONG cPoints, - IN PVOID pvIn, - OUT PVOID pvOut - ) -{ - // www.osr.com/ddk/graphics/gdifncs_027b.htm - UNIMPLEMENTED; - return FALSE; -} - -ULONG -APIENTRY -XFORMOBJ_iGetFloatObjXform( - IN XFORMOBJ *pxo, - OUT FLOATOBJ_XFORM *pxfo - ) -{ - // www.osr.com/ddk/graphics/gdifncs_5ig7.htm - UNIMPLEMENTED; - return 0; -} - -ULONG -APIENTRY -XFORMOBJ_iGetXform( - IN XFORMOBJ *pxo, - OUT XFORML *pxform - ) -{ - // www.osr.com/ddk/graphics/gdifncs_0s2v.htm - UNIMPLEMENTED; - return 0; -} - /* * @unimplemented */ diff --git a/reactos/subsystems/win32/win32k/win32k.rbuild b/reactos/subsystems/win32/win32k/win32k.rbuild index bc25e040634..413cdc26514 100644 --- a/reactos/subsystems/win32/win32k/win32k.rbuild +++ b/reactos/subsystems/win32/win32k/win32k.rbuild @@ -53,6 +53,11 @@ error.c event.c float.c + + + floatobj.S + + gradient.c lineto.c mem.c @@ -82,7 +87,7 @@ copy.c usrheap.c - + cos_asm.s sin_asm.s atan2_asm.s @@ -173,6 +178,7 @@ stockobj.c text.c wingl.c + xformobj.c stubs.c diff --git a/reactos/tools/sysreg/comp_factory.h b/reactos/tools/sysreg/comp_factory.h deleted file mode 100644 index d3d0ec07b22..00000000000 --- a/reactos/tools/sysreg/comp_factory.h +++ /dev/null @@ -1,205 +0,0 @@ -#ifndef COMPONENT_FACTORY_TEMPLATE_H_ //comp_factory.h -#define COMPONENT_FACTORY_TEMPLATE_H_ - -/* $Id$ - * - * PROJECT: System regression tool for ReactOS - * LICENSE: GPL - See COPYING in the top level directory - * FILE: tools/sysreg/comp_factory.h - * PURPOSE: component management - * PROGRAMMERS: Johannes Anderwald (johannes.anderwald at sbox tugraz at) - */ - - -#include "user_types.h" -#include -#include - -namespace System_ -{ - using std::map; - using std::vector; - -//---------------------------------------------------------- -/// -/// ComponentFactoryTemplate -/// -/// This class servess as a factory class for components. In general -/// can be used for any possible class which has base class -/// and a derrived class -/// - -//-------------------------------------------------------------------- -/// -/// create -/// -/// Description: this template function creates a function which returns -/// objects of type ElementType but in real are objects of DerrivedType -/// - - template - static ElementType * create () - { - return new DerrivedType(); - } - -//-------------------------------------------------------------------- - - template - class ComponentFactoryTemplate - { - typedef ElementType * (*creation_function)(); - typedef map ElementMap; - typedef vector ElementIdVector; - public: - -//-------------------------------------------------------------------- -/// -/// ComponentFactoryTemplate -/// -/// Description: default destructor of class ComponentFactoryTemplate -/// - - ComponentFactoryTemplate() - { - - } - -//-------------------------------------------------------------------- -/// -/// ~ComponentFactoryTemplate -/// -/// Description: default destructor of class ComponentFactoryTemplate -/// - - virtual ~ComponentFactoryTemplate() - { - - } -//-------------------------------------------------------------------- -/// -/// listComponent -/// -/// Description: lists all registererd components ids - - void listComponentIds() - { - for(unsigned i = 0; i < ids_.size (); i++) - cout< - bool registerComponent(ElementId const & id) - { - typename ElementMap::const_iterator iter = elements_.find(id); - if(iter != elements_.end()) - return false; - ids_.insert(ids_.begin(),id); - elements_.insert(std::make_pair(id, &create)); - return true; - - } - - //-------------------------------------------------------------------- -/// -/// deregisterComponent -/// -/// Description: unregisters a given component indentified by param id -/// After unregistration, the specified component can no longer be -/// created -/// @return bool -/// @param id the element id of the ContentType - - template - const bool deregisterComponent(ElementId const & id) - { - typename ElementMap::const_iterator iterator = elements_.find(id); - if(iterator != elements_.end()) - { - elements_.erase(iterator); - return true; - } - else - return false; - } - - -//-------------------------------------------------------------------- -/// -/// createComponent -/// -/// Description: creates a component according to the specified information -/// returns the component encapsulated in an std::auto_ptr -/// @param id specifies the key id, to look for -/// @return std::auto_ptr - ElementType * createComponent(ElementId const & id) const - { - typename ElementMap::const_iterator first_it = elements_.find(id); - if(first_it != elements_.end()) - return (first_it->second)(); - else - return 0; - } - -//-------------------------------------------------------------------- -/// -/// deleteComponent -/// -/// Description: deletes a component -/// @param element the element to be deleted - - void deleteComponent(ElementType * element) - { - delete element; - } - protected: - ElementMap elements_; - ElementIdVector ids_; - }; - - -} //end of namespace Sysreg_ - -#endif - diff --git a/reactos/tools/sysreg/conf_parser.cpp b/reactos/tools/sysreg/conf_parser.cpp deleted file mode 100644 index f999a4fca5b..00000000000 --- a/reactos/tools/sysreg/conf_parser.cpp +++ /dev/null @@ -1,112 +0,0 @@ -/* $Id$ - * - * PROJECT: System regression tool for ReactOS - * LICENSE: GPL - See COPYING in the top level directory - * FILE: tools/sysreg/conf_parser.h - * PURPOSE: configuration parser - * PROGRAMMERS: Johannes Anderwald (johannes.anderwald at sbox tugraz at) - */ - -#include "conf_parser.h" - -namespace Sysreg_ -{ - using std::ifstream; -//--------------------------------------------------------------------------------------- - ConfigParser::ConfigParser() - { - - } - -//--------------------------------------------------------------------------------------- - ConfigParser::~ConfigParser() - { - m_Map.clear (); - } - -//--------------------------------------------------------------------------------------- - bool ConfigParser::parseFile(char * FileName) - { - FILE * file = fopen(FileName, "rt"); - if (!file) - { - cerr << "Error: ConfigParser::parseFile failed to open configuration file " << FileName << endl; - return false; - } - bool ret = false; - while (!feof(file)) - { - char buffer[500]; - char * buf; - - buf = fgets(buffer, sizeof(buffer) / sizeof(char), file); - if (buf) - { - if (buffer[0] != ';') - { - string s_buffer = string(buffer); - string::size_type ws_pos = s_buffer.find_first_of ("="); - - if (ws_pos != string::npos && ws_pos > 0 && ws_pos < s_buffer.size()) - { - string name = s_buffer.substr (0, ws_pos); - string value = s_buffer.substr (ws_pos + 1, s_buffer.size() - ws_pos - 2); -/* - if (value[value.length () -1] == 0xA) - { - // remove newline char - value[value.length ()-1] = '\0'; - } -*/ -// cerr << "name: "<< name << "value: "<< value << "|" << endl; - m_Map[name] = value; - ret = true; - } - } - } - } - fclose(file); - return ret; - } - -//--------------------------------------------------------------------------------------- - bool ConfigParser::getStringValue(string &ConfVariable, string &ConfValue) - { - ConfigMap::iterator it = m_Map.find (ConfVariable); - if (it == m_Map.end ()) - { - //cerr << "ConfigParser::getValue failed to find " << ConfVariable << endl; - return false; - } - - ConfValue = it->second; - return true; - } -//---------------------------------------------------------------------------------------- - bool ConfigParser::getDoubleValue(string ConfVariable, double & ConfValue) - { - ConfigMap::iterator it = m_Map.find (ConfVariable); - if (it == m_Map.end ()) - { - cerr << "ConfigParser::getValue failed to find " << ConfVariable << endl; - return false; - } - - ConfValue = strtod(it->second.c_str(), NULL); - return true; - } -//----------------------------------------------------------------------------------------- - bool ConfigParser::getIntValue(string ConfVariable, long int & ConfValue) - { - ConfigMap::iterator it = m_Map.find (ConfVariable); - if (it == m_Map.end ()) - { - cerr << "ConfigParser::getValue failed to find " << ConfVariable << endl; - return false; - } - - ConfValue = strtol(it->second.c_str(), NULL, 10); - return true; - } - -} // end of namespace Sysreg_ diff --git a/reactos/tools/sysreg/conf_parser.h b/reactos/tools/sysreg/conf_parser.h deleted file mode 100644 index 78991263cf7..00000000000 --- a/reactos/tools/sysreg/conf_parser.h +++ /dev/null @@ -1,97 +0,0 @@ -#ifndef CONF_PARSER_H__ -#define CONF_PARSER_H__ - -/* $Id$ - * - * PROJECT: System regression tool for ReactOS - * LICENSE: GPL - See COPYING in the top level directory - * FILE: tools/sysreg/conf_parser.h - * PURPOSE: configuration parser - * PROGRAMMERS: Johannes Anderwald (johannes.anderwald at sbox tugraz at) - */ - -#include "user_types.h" -#include -#include -#include -#include -#include -#include - -namespace Sysreg_ -{ - using std::map; -//--------------------------------------------------------------------------------------- -/// -/// class ConfigParser -/// -/// Description: this class reads configuration entries from a configuration file -/// Each entry must have the form of VALUE=XXX. The entries are stored -/// in a map which can be queried after parsing the configuration file -/// -/// Note: lines beginning with an ; are ignored -/// -/// Usage: First, call parseFile with param to file. Finally, call getValue with the -/// appropiate type - - class ConfigParser - { - public: - - typedef map ConfigMap; -//--------------------------------------------------------------------------------------- -/// -/// ConfigParser -/// -/// Description: constructor of class ConfigParser - - ConfigParser(); - -//--------------------------------------------------------------------------------------- -/// -/// ~ConfigParser -/// -/// Description: destructor of class ConfigParser - - virtual ~ConfigParser(); - -//--------------------------------------------------------------------------------------- -/// -/// parseFile -/// -/// Description: this function takes as param a path to file. it attempts to parse this specific -/// file with the given syntax. On success it returns true. -/// -/// Note: Everytime parseFile is called, the previous stored values are cleared -/// -/// @param FileName path to configuration file -/// @return bool - - bool parseFile(char * FileName); - -//-------------------------------------------------------------------------------------- -/// -/// getStringValue -/// -/// Description: attempts to read a config variable from the configuration file -/// If the variable name is not found, it returns false and the param -/// ConfValue remains untouched. On success it returns the true. -/// -/// @param ConfVariable name of the configuration variable to retrieve -/// @param ConfValue type of value to retrieve - - bool getStringValue(string & ConfVariable, string & ConfValue); - - bool getDoubleValue(string ConfVariable, double & value); - bool getIntValue(string ConfVariable, long int & value); - - protected: - ConfigMap m_Map; - - }; // end of class ConfigParser - - -} // end of namspace Sysreg_ - - -#endif /* end of CONF_PARSER_H__ */ diff --git a/reactos/tools/sysreg/data_source.h b/reactos/tools/sysreg/data_source.h deleted file mode 100644 index 748a8d3df12..00000000000 --- a/reactos/tools/sysreg/data_source.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef DATA_SOURCE_H__ -#define DATA_SOURCE_H__ - - -/* $Id$ - * - * PROJECT: System regression tool for ReactOS - * LICENSE: GPL - See COPYING in the top level directory - * FILE: tools/sysreg/conf_parser.h - * PURPOSE: data source abstraction - * PROGRAMMERS: Johannes Anderwald (johannes.anderwald at sbox tugraz at) - */ - -#include -#include "user_types.h" - -namespace System_ -{ - - -class DataSource -{ -public: - - DataSource() - {} - - virtual ~DataSource() - {} - - virtual bool openSource(const string & opencmd) = 0; - - virtual bool closeSource() = 0; - - virtual bool readSource(std::vector & vect) = 0; - - virtual bool isSourceOpen() = 0; - -}; // end of class DataSource - - - -} // end of namespace System_ - - - - - - - -#endif /* end of DATA_SOURCE_H__ */ diff --git a/reactos/tools/sysreg/env_var.cpp b/reactos/tools/sysreg/env_var.cpp deleted file mode 100644 index a9958baae42..00000000000 --- a/reactos/tools/sysreg/env_var.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* $Id$ - * - * PROJECT: System regression tool for ReactOS - * LICENSE: GPL - See COPYING in the top level directory - * FILE: tools/sysreg/conf_parser.h - * PURPOSE: environment variable lookup - * PROGRAMMERS: Johannes Anderwald (johannes.anderwald at sbox tugraz at) - */ - - -#include "env_var.h" - -namespace System_ -{ - - EnvironmentVariable::EnvironmentMap EnvironmentVariable::m_Map; - -//--------------------------------------------------------------------------------------- - EnvironmentVariable::EnvironmentVariable() - { - - } - -//--------------------------------------------------------------------------------------- - EnvironmentVariable::~EnvironmentVariable() - { - m_Map.clear (); - } - -//--------------------------------------------------------------------------------------- - - bool EnvironmentVariable::getValue( string const &EnvName, string &EnvValue) - { - EnvironmentMap::const_iterator it = m_Map.find (EnvName); - if (it != m_Map.end()) - { - EnvValue = it->second; - return true; - } - - char * value = getenv(EnvName.c_str ()); - - if (!value) - { - cerr << "EnvironmentVariable::getValue found no value for " << EnvName << endl; - return false; - } - - if (!strlen(value)) - { - cerr << "EnvironmentVariable::getValue found no value for " << EnvName << endl; - return false; - } - - EnvValue = value; - m_Map[EnvName] = EnvValue; - return true; - } - - -} // end of namespace System_ diff --git a/reactos/tools/sysreg/env_var.h b/reactos/tools/sysreg/env_var.h deleted file mode 100644 index 2b82b194509..00000000000 --- a/reactos/tools/sysreg/env_var.h +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef ENV_VAR_H__ -#define ENV_VAR_H__ - -/* $Id$ - * - * PROJECT: System regression tool for ReactOS - * LICENSE: GPL - See COPYING in the top level directory - * FILE: tools/sysreg/conf_parser.h - * PURPOSE: environment variable lookup - * PROGRAMMERS: Johannes Anderwald (johannes.anderwald at sbox tugraz at) - */ - -#include "user_types.h" -#include -#include -#include -#include - -namespace System_ -{ - using std::map; -//--------------------------------------------------------------------------------------- -/// -/// class EnvironmentVariable -/// -/// Description: this class performs looking up environment variable from the system -/// The result is also stored in its internal map to cache results - - class EnvironmentVariable - { - public: - typedef map EnvironmentMap; -//--------------------------------------------------------------------------------------- -/// -/// ~EnvironmentVariable -/// -/// Description: destructor of class EnvironmentVariable - - virtual ~EnvironmentVariable(); - -//--------------------------------------------------------------------------------------- -/// -/// getValue -/// -/// Description: this function returns the value of an associated environment variable. if -/// the variable is set it returns true and the value in the parameter EnvValue. On error -/// it returns false and the param EnvValue remains untouched -/// -/// @param EnvName name of environment variable to retrieve -/// @param EnvValue value of the environment variable -/// @return bool - - static bool getValue(const string & EnvName, string & EnvValue); - - - protected: - -//--------------------------------------------------------------------------------------- -/// -/// EnvironmentVariable -/// -/// Description: constructor of class EnvironmentVariable - - EnvironmentVariable(); - - static EnvironmentMap m_Map; - - }; // end of class EnvironmentVariable - -} // end of namespace System_ - -#endif /* end of ENV_VAR_H__ */ diff --git a/reactos/tools/sysreg/file_reader.cpp b/reactos/tools/sysreg/file_reader.cpp deleted file mode 100644 index 6997d6ac82d..00000000000 --- a/reactos/tools/sysreg/file_reader.cpp +++ /dev/null @@ -1,127 +0,0 @@ -/* $Id$ - * - * PROJECT: System regression tool for ReactOS - * LICENSE: GPL - See COPYING in the top level directory - * FILE: tools/sysreg/conf_parser.h - * PURPOSE: file reading support - * PROGRAMMERS: Johannes Anderwald (johannes.anderwald at sbox tugraz at) - */ - -#include "file_reader.h" - -namespace System_ -{ -//--------------------------------------------------------------------------------------- - FileReader::FileReader() : DataSource(), m_File(NULL) - { - } -//--------------------------------------------------------------------------------------- - FileReader::~FileReader() - { - } -//--------------------------------------------------------------------------------------- - bool FileReader::openSource(const string & filename) - { - m_File = fopen((char*)filename.c_str(), (char*)"rb"); - - if (m_File) - { - return true; - } - else - { - return false; - } - } -//--------------------------------------------------------------------------------------- - bool FileReader::closeSource() - { - if (!m_File) - { - return false; - } - - if (!fclose(m_File)) - { - m_File = NULL; - return true; - } - - return false; - } -//--------------------------------------------------------------------------------------- - bool FileReader::readSource(vector & lines) - { - if (!m_File) - { - return false; - } - - bool ret = true; - size_t total_length = 0; - size_t line_count = lines.size(); - size_t num = 0; - char szBuffer[256]; - int readoffset = 0; - - if (m_BufferedLines.length()) - { - strcpy(szBuffer, m_BufferedLines.c_str()); - readoffset = m_BufferedLines.length(); - } - - do - { - if (total_length < num) - { - memmove(szBuffer, &szBuffer[total_length], num - total_length); - readoffset = num - total_length; - } - - num = fread(&szBuffer[readoffset], - sizeof(char), sizeof(szBuffer)/sizeof(char) - (readoffset+1) * sizeof(char), - m_File); - - szBuffer[num] = L'\0'; - - if (!num) - { - if (line_count == lines.size ()) - { - ret = false; - } - break; - } - char * ptr; - char * offset = szBuffer; - - total_length = 0; - while((ptr = strstr(offset, "\x0D\x0A")) != NULL) - { - long length = ((long )ptr - (long)offset); - length /= sizeof(char); - - offset[length] = '\0'; - - string line = offset; - lines.push_back (line); - - offset += length + 2; - total_length += length + 2; - - if (total_length == num) - { - break; - } - } - }while(num ); - - if (total_length < num) - { - m_BufferedLines = &szBuffer[total_length]; - } - - return ret; - } - -} // end of namespace System_ diff --git a/reactos/tools/sysreg/file_reader.h b/reactos/tools/sysreg/file_reader.h deleted file mode 100644 index aed6dbd3c5d..00000000000 --- a/reactos/tools/sysreg/file_reader.h +++ /dev/null @@ -1,93 +0,0 @@ -#ifndef FILE_READER_H__ -#define FILE_READER_H__ - -/* $Id$ - * - * PROJECT: System regression tool for ReactOS - * LICENSE: GPL - See COPYING in the top level directory - * FILE: tools/sysreg/conf_parser.h - * PURPOSE: pipe reader support - * PROGRAMMERS: Johannes Anderwald (johannes.anderwald at sbox tugraz at) - */ - - -#include "user_types.h" -#include "data_source.h" -#include -#include -#include -#include - -namespace System_ -{ - using std::vector; -//--------------------------------------------------------------------------------------- -/// -/// class FileReader -/// -/// Description: this class implements reading from a file - - class FileReader : public DataSource - { - public: -//--------------------------------------------------------------------------------------- -/// -/// FileReader -/// -/// Description: constructor of class FileReader - - FileReader(); - -//--------------------------------------------------------------------------------------- -/// -/// ~FileReader -/// -/// Description: destructor of class FileReader - - virtual ~FileReader(); - -//--------------------------------------------------------------------------------------- -/// -/// openFile -/// -/// Description: attempts to open a file. Returns true on success -/// -/// @param filename name of the file to open -/// @return bool - - virtual bool openSource(const string & filename); -//--------------------------------------------------------------------------------------- -/// -/// closeFile -/// -/// Description: attempts to close a file. Returns true on success -/// -/// @return bool - - virtual bool closeSource(); - -//--------------------------------------------------------------------------------------- -/// -/// readFile -/// -/// Description: reads from file. The result is stored in a vector of strings -/// -/// Note: returns true on success -/// - - virtual bool readSource(vector & lines); - - - - protected: - FILE * m_File; - string m_BufferedLines; - - - }; // end of class FileReader - - -} // end of namespace System_ - - -#endif /* end of FILE_READER_H__ */ diff --git a/reactos/tools/sysreg/namedpipe_reader.cpp b/reactos/tools/sysreg/namedpipe_reader.cpp deleted file mode 100644 index 5175422617d..00000000000 --- a/reactos/tools/sysreg/namedpipe_reader.cpp +++ /dev/null @@ -1,330 +0,0 @@ -/* $Id: pipe_reader.cpp 24643 2006-10-24 11:45:21Z janderwald $ - * - * PROJECT: System regression tool for ReactOS - * LICENSE: GPL - See COPYING in the top level directory - * FILE: tools/sysreg/namedpipe_reader.cpp - * PURPOSE: pipe reader support - * PROGRAMMERS: Johannes Anderwald (johannes.anderwald at sbox tugraz at) - * Christoph von Wittich (Christoph_vW@ReactOS.org) - */ - -#include "namedpipe_reader.h" - -namespace System_ -{ -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) - -#ifndef WIN32 - const char * NamedPipeReader::s_LineBreak = "\x0A\0"; -#else - const char * NamedPipeReader::s_LineBreak = "\x0D\x0A\0"; -#endif - using std::vector; -//--------------------------------------------------------------------------------------- - NamedPipeReader::NamedPipeReader() : DataSource(), h_Pipe(NULLVAL), m_Buffer(0) - { - } - -//--------------------------------------------------------------------------------------- - NamedPipeReader::~NamedPipeReader() - { - if (m_Buffer) - free(m_Buffer); - } - - bool NamedPipeReader::isSourceOpen() - { - return true; - } - -//--------------------------------------------------------------------------------------- - - bool NamedPipeReader::openSource(const string & PipeCmd) - { - if (h_Pipe != NULLVAL) - { - cerr << "NamedPipeReader::openPipe> pipe already open" << endl; - return false; - } -#ifdef WIN32 - h_Pipe = CreateFile(PipeCmd.c_str(), - GENERIC_WRITE | GENERIC_READ, - 0, - NULL, - OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, - (HANDLE) - NULL); - - if(INVALID_HANDLE_VALUE == h_Pipe) { - cerr << "NamedPipeReader::openPipe> failed to open pipe " << PipeCmd << " Error:" << GetLastError() << endl; - h_Pipe = NULLVAL; - return false; - } - else - { - cout << "NamedPipeReader::openPipe> successfully opened pipe" << endl; - - if (!m_Buffer) - { - m_BufferLength = 100; - m_Buffer = (char*)malloc(sizeof(char) * m_BufferLength); - } - ConnectNamedPipe(h_Pipe, - 0); - return true; - } -#else - h_Pipe = open(PipeCmd.c_str(), O_RDONLY); - - if(INVALID_HANDLE_VALUE == h_Pipe) { - cerr << "NamedPipeReader::openPipe> failed to open pipe " << PipeCmd << endl; - h_Pipe = NULLVAL; - return false; - } - else - { - cout << "NamedPipeReader::openPipe> successfully opened pipe handle: "<< h_Pipe << endl << "Src: " << PipeCmd << endl; - if (!m_Buffer) - { - m_BufferLength = 100; - m_Buffer = (char*)malloc(sizeof(char) * m_BufferLength); - } - return true; - } -#endif - } - -//--------------------------------------------------------------------------------------- - - bool NamedPipeReader::closeSource() - { - cerr << "NamedPipeReader::closePipe> entered" << endl; - if (h_Pipe == NULLVAL) - { - cerr << "NamedPipeReader::closePipe> pipe is not open" << endl; - return false; - } -#ifndef WIN32 - close(h_Pipe); -#else - DisconnectNamedPipe(h_Pipe); - CloseHandle(h_Pipe); -#endif - h_Pipe = NULLVAL; - return true; - } -//--------------------------------------------------------------------------------------- - void NamedPipeReader::insertLine(std::vector & vect, string line, bool append_line) - { - if (append_line && vect.size ()) - { - string prev = vect[vect.size () - 1]; - prev += line; - vect[vect.size () - 1] = prev; - } - else - { - vect.push_back (line); - } - - } -//--------------------------------------------------------------------------------------- - void NamedPipeReader::extractLines(char * buffer, std::vector & vect, bool & append_line, unsigned long cbRead) - { -#if 0 - long offset = 0; - size_t start_size = vect.size (); - char * start = buffer; - buffer[cbRead] = '\0'; - char * end = strstr(buffer, s_LineBreak); - - //cout << "extractLines entered with append_line: " << append_line << " cbRead: " << cbRead << "buffer: " << buffer << endl; - - do - { - if (end) - { - end[0] = '\0'; - string line = start; - end += (sizeof(s_LineBreak) / sizeof(char)); - start = end; - offset += line.length() + (sizeof(s_LineBreak) / sizeof(char)); - - // cout << "Offset: "<< offset << "cbRead: " << cbRead << "line: " << line << endl; - insertLine(vect, line, append_line); - if (append_line) - { - append_line = false; - } - } - else - { - string line = start; -// cout << "inserting line start_size: " << start_size << "current: " << vect.size () << "line length: "<< line.length () << endl; - if (!line.length ()) - { - if (start_size == vect.size ()) - append_line = true; - break; - } - if (start_size == vect.size ()) - { - insertLine(vect, line, true); - } - else - { - insertLine(vect, line, false); - } - append_line = true; - break; - } - - end = strstr(end, s_LineBreak); - - }while(append_line); - -#else - DWORD buf_offset = 0; - char * offset = strchr(buffer, '\x0D'); - while(offset) - { - /// - /// HACKHACK - /// due to some mysterious reason, strchr / strstr sometimes returns - /// not always the offset to the CR character but to the next LF - /// in MSVC 2005 (Debug Modus) - - if (offset[0] == '\x0A') - { - if (buf_offset) - { - offset--; - } - else - { - //TODO - // implement me special case - } - } - - if (offset[0] == '\x0D') - { - buf_offset += 2; - offset[0] = '\0'; - offset +=2; - } - else - { - /// - /// BUG detected in parsing code - /// - abort(); - } - - string line = buffer; - if (append_line) - { - assert(vect.empty () == false); - string prev_line = vect[vect.size () -1]; - prev_line += line; - vect.pop_back (); - vect.push_back (prev_line); - append_line = false; - } - else - { - vect.push_back (line); - } - - buf_offset += line.length(); - if (buf_offset >= cbRead) - { - break; - } - buffer = offset; - - offset = strstr(buffer, "\n"); - } - if (buf_offset < cbRead) - { - buffer[cbRead - buf_offset] = '\0'; - string line = buffer; - if (append_line) - { - assert(vect.empty () == false); - string prev_line = vect[vect.size () -1]; - vect.pop_back (); - prev_line += line; - vect.push_back (prev_line); - } - else - { - vect.push_back (line); - append_line = true; - } - } - else - { - append_line = false; - } -#endif - } -//--------------------------------------------------------------------------------------- - bool NamedPipeReader::readPipe(char * buffer, int bufferlength, long & bytesread) - { - -#ifndef WIN32 - long cbRead = read(h_Pipe, - buffer, - (bufferlength-1) * sizeof(char)); -#else - DWORD cbRead = 0; - BOOL fSuccess = ReadFile(h_Pipe, - buffer, - (bufferlength-1) * sizeof(char), - &cbRead, - NULL); - - if (!fSuccess && GetLastError() != ERROR_MORE_DATA) - return false; -#endif - - bytesread = cbRead; - return true; - } -//--------------------------------------------------------------------------------------- - - bool NamedPipeReader::readSource(vector & vect) - { - size_t lines = vect.size (); - - if (h_Pipe == NULLVAL) - { - cerr << "Error: pipe is not open" << endl; - return false; - } - - if (!m_Buffer) - { - cerr << "Error: no memory" << endl; - return false; - } - - bool append_line = false; - do - { - memset(m_Buffer, 0x0, m_BufferLength * sizeof(char)); - long cbRead = 0; - - if (!readPipe(m_Buffer, m_BufferLength-1, cbRead)) - break; - - extractLines(m_Buffer, vect, append_line, cbRead); - }while (append_line); - - return (vect.size () - lines); -} - - -} // end of namespace System_ diff --git a/reactos/tools/sysreg/namedpipe_reader.h b/reactos/tools/sysreg/namedpipe_reader.h deleted file mode 100644 index fe1dcf4a721..00000000000 --- a/reactos/tools/sysreg/namedpipe_reader.h +++ /dev/null @@ -1,142 +0,0 @@ -#ifndef NAMEDPIPE_READER_H__ -#define NAMEDPIPE_READER_H__ - -/* $Id: namedpipe_reader.h 24643 2006-10-24 11:45:21Z janderwald $ - * - * PROJECT: System regression tool for ReactOS - * LICENSE: GPL - See COPYING in the top level directory - * FILE: tools/sysreg/namedpipe_reader.h - * PURPOSE: file reading support - * PROGRAMMERS: Johannes Anderwald (johannes.anderwald at sbox tugraz at) - * Christoph von Wittich (Christoph@ApiViewer.de) - */ - - - -#include "user_types.h" -#include "data_source.h" -#include -#include -#include -#include -#include -#include - -#if defined(WIN32) -#include -#define NULLVAL NULL -#else -#include -#include -#define NULLVAL 0 -#define DWORD unsigned long -#define HANDLE long -#ifndef INVALID_HANDLE_VALUE -#define INVALID_HANDLE_VALUE -1 -#endif -#endif - -namespace System_ -{ -//--------------------------------------------------------------------------------------- -/// -/// class NamedPipeReader -/// -/// Description: this class implements a named pipe reader. - - class NamedPipeReader : public DataSource - { - public: - -//--------------------------------------------------------------------------------------- -/// -/// NamedPipeReader -/// -/// Description: constructor of class PipeReader - - NamedPipeReader(); - -//--------------------------------------------------------------------------------------- -/// -/// virtual ~NamedPipeReader -/// -/// Description: destructor of class PipeReader - - virtual ~NamedPipeReader(); - -//--------------------------------------------------------------------------------------- -/// -/// open -/// -/// Description: this function attempts to open a pipe. If an pipe is already open or -/// it fails to open a pipe, the function returns false -/// -/// @param PipeCmd command of the pipe to open -/// -/// @return bool - - virtual bool openSource(const string & PipeCmd); - -//--------------------------------------------------------------------------------------- -/// -/// close -/// -/// Description: closes a pipe. Returns true on success -/// -/// @return bool - - virtual bool closeSource(); - -//--------------------------------------------------------------------------------------- -/// -/// readPipe -/// -/// Description: attempts to read from the pipe. Returns true on success. If it returns -/// false, call PipeReader::isEoF() to determine if the pipe should be closed -/// -/// @param Buffer to be written to -/// @return size_t - - virtual bool readSource(std::vector & vect); - -//--------------------------------------------------------------------------------------- -/// -/// isEof -/// -/// Description: returns true if the pipe has reached end of file. The caller should call -/// closePipe if this function returns true - - virtual bool isSourceOpen(); - -protected: -//--------------------------------------------------------------------------------------- -/// -/// extractLines -/// -/// Description: this functions extract lines from a buffer and pushes them into the supplied vector -/// -/// @param buffer from which the lines are extracted from -/// @param vect vector storing the extracted lines -/// @param append_line if the line isnt fully read, the line is appended - - void extractLines(char * buffer, std::vector & vect, bool & append_line, unsigned long cbRead); - void insertLine(std::vector & vect, string line, bool append_line); - - bool readPipe(char * buffer, int bufferlength, long & read); - - - HANDLE h_Pipe; - char * m_Buffer; - int m_BufferLength; -#ifdef UNICODE - WCHAR * m_WBuffer; -#endif - - static const char * s_LineBreak; - }; // end of class NamedPipeReader - -} // end of namespace System_ - - - -#endif /* end of NAMEDPIPE_READER_H__ */ diff --git a/reactos/tools/sysreg/os_support.cpp b/reactos/tools/sysreg/os_support.cpp deleted file mode 100644 index f8b610bbbba..00000000000 --- a/reactos/tools/sysreg/os_support.cpp +++ /dev/null @@ -1,341 +0,0 @@ -/* $Id: os_support.h 24643 2006-10-24 11:45:21Z janderwald $ - * - * PROJECT: System regression tool for ReactOS - * LICENSE: GPL - See COPYING in the top level directory - * FILE: tools/sysreg/conf_parser.h - * PURPOSE: operating systems specific code - * PROGRAMMERS: Johannes Anderwald (johannes.anderwald at sbox tugraz at) - */ - -#include "os_support.h" - -namespace System_ -{ - - OsSupport::TimeEntryVector OsSupport::s_Entries; - - //int gettimeofday(struct timeval *tv, void * tz); -//------------------------------------------------------------------------ - void OsSupport::checkAlarms() - { - struct timeval tm; - size_t i; -#if 0 -// gettimeofday(&tm, 0); -#else - memset(&tm, 0, sizeof(tm)); -#endif - for (i = 0; i < s_Entries.size(); i++) - { - long diffsec = s_Entries[i]->tm.tv_sec - tm.tv_sec; - if (diffsec < 0) - { - cout << "terminating process pid:" << s_Entries[i]->pid << endl; - terminateProcess(s_Entries[i]->pid, -2); - free(s_Entries[i]); - s_Entries.erase (s_Entries.begin () + i); - i = MAX(0, i-1); - } - } - -#ifndef WIN32 - if (s_Entries.size()) - { - long secs = s_Entries[i]->tm.tv_sec - tm.tv_sec; - alarm(secs); - } -#endif - } - bool OsSupport::hasAlarms () - { - return (s_Entries.size () != 0); - } -//------------------------------------------------------------------------ - void OsSupport::cancelAlarms() - { - -#ifdef WIN32 - if (s_hThread) - { - TerminateThread(s_hThread, 0); - s_hThread = 0; - } -#endif - - for(size_t i = 0; i < s_Entries.size(); i++) - { - free(s_Entries[i]); - } - - s_Entries.clear(); - - - } - - -#ifdef WIN32 - - HANDLE OsSupport::s_hThread = 0; - static HANDLE hTimer; -#if 0 -__inline int gettimeofday(struct timeval *tv, struct timezone *tz) -{ - FILETIME ft; - LARGE_INTEGER li; - __int64 t; - static int tzflag; - - if (tv) - { - GetSystemTimeAsFileTime(&ft); - li.LowPart = ft.dwLowDateTime; - li.HighPart = ft.dwHighDateTime; - t = li.QuadPart; /* In 100-nanosecond intervals */ - t -= EPOCHFILETIME; /* Offset to the Epoch time */ - t /= 10; /* In microseconds */ - tv->tv_sec = (long)(t / 1000000); - tv->tv_usec = (long)(t % 1000000); - } - - if (tz) - { - if (!tzflag) - { - _tzset(); - tzflag++; - } - tz->tz_minuteswest = _timezone / 60; - tz->tz_dsttime = _daylight; - } - - return 0; -} -#endif - bool OsSupport::terminateProcess(OsSupport::ProcessID pid, int exitcode) - { - HANDLE hProcess = OpenProcess(PROCESS_TERMINATE, FALSE, pid); - if (!hProcess) - { - return false; - } - - bool ret = TerminateProcess(hProcess, exitcode); - CloseHandle(hProcess); - return ret; - } - - OsSupport::ProcessID OsSupport::createProcess(const char *procname, int procargsnum, const char **procargs, bool wait) - { - STARTUPINFO siStartInfo; - PROCESS_INFORMATION piProcInfo; - OsSupport::ProcessID pid; - DWORD length = 0; - char * szBuffer; - char * cmd; - ZeroMemory(&siStartInfo, sizeof(STARTUPINFO)); - ZeroMemory(&piProcInfo, sizeof(PROCESS_INFORMATION)); - - siStartInfo.cb = sizeof(STARTUPINFO); - siStartInfo.wShowWindow = SW_SHOWNORMAL; - siStartInfo.dwFlags = STARTF_USESHOWWINDOW; - - if (procargsnum) - { - for (int i = 1; i < procargsnum; i++) - { - length += strlen(procargs[i]); - } - - length += procargsnum; - szBuffer = (char*)malloc(length * sizeof(char)); - length = 0; - for (int i = 1; i < procargsnum; i++) - { - strcpy(&szBuffer[length], procargs[i]); - length += strlen(procargs[i]); - if (i + 1 < procargsnum) - { - szBuffer[length] = ' '; - } - else - { - szBuffer[length] = '\0'; - } - length++; - } - length = strlen(procname) + strlen(szBuffer) + 2; - cmd = (char*)malloc(length * sizeof(char)); - strcpy(cmd, procname); - strcat(cmd, " "); - strcat(cmd, szBuffer); - free(szBuffer); - } - else - { - cmd = _strdup(procname); - - } - if (!CreateProcess(NULL, cmd, NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, NULL, &siStartInfo, &piProcInfo)) - { - cerr << "Error: CreateProcess failed " << cmd << endl; - pid = 0; - } - else - { - pid = piProcInfo.dwProcessId; - if (wait) - { - WaitForSingleObject(piProcInfo.hThread, INFINITE); - } - CloseHandle(piProcInfo.hProcess); - CloseHandle(piProcInfo.hThread); - } - free(cmd); - return pid; - } - void OsSupport::delayExecution(long value) - { - Sleep(value * 1000); - } - - DWORD WINAPI AlarmThread(LPVOID param) - { - LARGE_INTEGER liDueTime; - - hTimer = CreateWaitableTimer(NULL, TRUE, "SysRegTimer"); - if (!hTimer) - { - return 0; - } - liDueTime.QuadPart = -100000000LL; - while(1) - { - SetWaitableTimer(hTimer, &liDueTime, 5000, NULL, NULL, FALSE); - WaitForSingleObject(hTimer, INFINITE); - OsSupport::checkAlarms (); - } - return 0; - } - - void OsSupport::setAlarm(long secs, OsSupport::ProcessID pid) - { - return; - PTIME_ENTRY entry = (PTIME_ENTRY) malloc(sizeof(TIME_ENTRY)); - if (entry) - { - cout << "secs: " << secs << endl; - struct timeval tm; -#if 0 - gettimeofday(&tm, 0); -#else -#endif - tm.tv_sec += secs; - - entry->tm = tm; - entry->pid = pid; - s_Entries.push_back(entry); - if (s_Entries.size () == 1) - { - s_hThread = CreateThread(NULL, 0, AlarmThread, 0, 0, NULL); - } - } - } - -#else -/********************************************************************************************************************/ - - - struct sigaction OsSupport::s_sact; - - - OsSupport::ProcessID OsSupport::createProcess(const char *procname, int procargsnum, const char **procargs, bool bWait) - { - ProcessID pid; - - if ((pid = fork()) < 0) - { - cerr << "OsSupport::createProcess> fork failed" << endl; - return 0; - } - if (pid == 0) - { - execv(procname, (char* const*)procargs); - return 0; - } - else - { - /* parent process */ - if (bWait) - { - waitpid(pid, NULL, 0); - } - } - return pid; - } - - bool OsSupport::terminateProcess(OsSupport::ProcessID pid, int exitcode) - { - kill(pid, SIGKILL); - return true; - } - - void OsSupport::delayExecution(long value) - { - sleep( value ); - } - - void handleSignal(int sig) - { - if (sig == SIGALRM) - { - OsSupport::checkAlarms(); - } - else if (sig == SIGCHLD) - { - if (OsSupport::hasAlarms()) - { - /// - /// FIXME - /// - /// there are expiriation alarms active and a child died unexpectly - /// lets commit suicide - exit(-2); - } - } - } - void OsSupport::setAlarm(long secs, OsSupport::ProcessID pid) - { - sigemptyset( &s_sact.sa_mask ); - s_sact.sa_flags = 0; - s_sact.sa_handler = handleSignal; - sigaction( SIGALRM, &s_sact, NULL ); - - PTIME_ENTRY entry = (PTIME_ENTRY) malloc(sizeof(TIME_ENTRY)); - if (entry) - { - struct timeval tm; - gettimeofday(&tm, 0); - tm.tv_sec += secs; - - entry->tm = tm; - entry->pid = pid; - for(size_t i = 0; i < s_Entries.size(); i++) - { - if (tm.tv_sec < s_Entries[i]->tm.tv_sec && tm.tv_usec < s_Entries[i]->tm.tv_usec) - { - if (i == 0) - { - /* adjust alarm timer to new period */ - alarm(secs); - } - s_Entries.insert(s_Entries.begin() + i, entry); - return; - } - } - s_Entries.push_back(entry); - alarm(secs); - } - } -#endif - -} // end of namespace System_ diff --git a/reactos/tools/sysreg/os_support.h b/reactos/tools/sysreg/os_support.h deleted file mode 100644 index 2d33a70e6da..00000000000 --- a/reactos/tools/sysreg/os_support.h +++ /dev/null @@ -1,160 +0,0 @@ -#ifndef OS_SUPPORT_H__ -#define OS_SUPPORT_H__ - -/* $Id: os_support.h 24643 2006-10-24 11:45:21Z janderwald $ - * - * PROJECT: System regression tool for ReactOS - * LICENSE: GPL - See COPYING in the top level directory - * FILE: tools/sysreg/conf_parser.h - * PURPOSE: operating systems specific code - * PROGRAMMERS: Johannes Anderwald (johannes.anderwald at sbox tugraz at) - */ - -#ifdef WIN32 -#include -#else -#include -#include -#include -#include -#endif - -#include "user_types.h" -#include -#include -#include -#include - -#ifndef _MSC_VER -#include -#endif - -#define MAX(a, b) (((a) > (b)) ? (a) : (b)) - -namespace System_ -{ -//--------------------------------------------------------------------------------------- -/// -/// class OsSupport -/// -/// Description: this class encapsulates operating system specific functions -/// -/// - - class OsSupport - { - public: -#ifdef WIN32 - typedef DWORD ProcessID; -#else - typedef pid_t ProcessID; -#endif - -//--------------------------------------------------------------------------------------- -/// -/// OsSupport -/// -/// Description: constructor of class OsSupport - - virtual ~OsSupport() - {} - -//--------------------------------------------------------------------------------------- -/// -/// createProcess -/// -/// Description: this functions creates a new process and returns its pid on success -/// -/// @param procname name of the file to execute -/// @param procargsnum num of arguments for the new process -/// @param procargs arguments for the new process -/// -/// - - static ProcessID createProcess(const char * procname, int procargsnum, const char ** procargs, bool wait); - -//--------------------------------------------------------------------------------------- -/// -/// terminateProcess -/// -/// Description: this function terminates a process given by its pid -/// -/// Note: returns true if the process with the given pid was terminated -/// -/// @param pid process id of the process to terminate -/// @param exitcode for the killed process - - static bool terminateProcess(ProcessID pid, int exitcode); - - -//---------------------------------------------------------------------------------------- -/// -/// delayExecution -/// -/// Description: this function sleeps the current process for the amount given in seconds -/// -/// @param sec amount of seconds to sleep - - static void delayExecution(long sec); - -///--------------------------------------------------------------------------------------- -/// -/// initializeTimer -/// -/// Description: this function initializes an alarm. When the alarm expires, it will terminate -/// the given process - - static void setAlarm(long sec, OsSupport::ProcessID pid); - -///--------------------------------------------------------------------------------------- -/// -/// cancelAlarms -/// -/// Description: this function cancels all available timers - - static void cancelAlarms(); - -///--------------------------------------------------------------------------------------- -/// -/// checkAlarms -/// -/// Description: this function checks for expired alarams - - static void checkAlarms(); - -///--------------------------------------------------------------------------------------- -/// -/// hasAlarms -/// -/// Description: this function checks wether there are alarms set active - - static bool hasAlarms(); - - protected: -//--------------------------------------------------------------------------------------- -/// -/// OsSupport -/// -/// Description: constructor of class OsSupport - - OsSupport() - {} - -#ifndef WIN32 - static struct sigaction s_sact; -#else - static HANDLE s_hThread; -#endif - - typedef struct - { - struct timeval tm; - ProcessID pid; - }TIME_ENTRY, *PTIME_ENTRY; - typedef std::vector TimeEntryVector; - static TimeEntryVector s_Entries; - }; // end of class OsSupport - -} // end of namespace System_ - -#endif /* end of OS_SUPPORT_H__ */ diff --git a/reactos/tools/sysreg/pipe_reader.cpp b/reactos/tools/sysreg/pipe_reader.cpp deleted file mode 100644 index b3e97b35c28..00000000000 --- a/reactos/tools/sysreg/pipe_reader.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* $Id$ - * - * PROJECT: System regression tool for ReactOS - * LICENSE: GPL - See COPYING in the top level directory - * FILE: tools/sysreg/conf_parser.h - * PURPOSE: pipe reader support - * PROGRAMMERS: Johannes Anderwald (johannes.anderwald at sbox tugraz at) - */ - -#include "pipe_reader.h" - -namespace System_ -{ - using std::vector; -//--------------------------------------------------------------------------------------- - PipeReader::PipeReader() : m_File(NULL) - { - - } - -//--------------------------------------------------------------------------------------- - PipeReader::~PipeReader() - { - - } - -//--------------------------------------------------------------------------------------- - - bool PipeReader::openSource(string const & PipeCmd) - { - if (m_File != NULL) - { - cerr << "PipeReader::openPipe> pipe already open" << endl; - return false; - } - - cerr << "cmd>" << PipeCmd << endl; - - m_File = popen(PipeCmd.c_str(), "r"); //AccessMode.c_str()); - if (m_File) - { - cerr << "PipeReader::openPipe> successfully opened pipe" << endl; - return true; - } - - cerr << "PipeReader::openPipe> failed to open pipe " << PipeCmd << endl; - return false; - } - -//--------------------------------------------------------------------------------------- - - bool PipeReader::closeSource() - { - if (!m_File) - { - cerr << "PipeReader::closePipe> pipe is not open" << endl; - return false; - } - - int res = pclose(m_File); - - if (res == INT_MAX) - { - cerr << "Error: _pclose failed " < & lines) - { - char * buf = (char*)malloc(100 * sizeof(char)); -//#ifdef NDEBUG - memset(buf, 0x0, sizeof(char) * 100); -//#endif - - char * res = fgets(buf, 100, m_File); - if (!res) - { - //cerr << "Error: PipeReader::readPipe failed" << endl; - free(buf); - return false; - } - fflush(m_File); - string line(buf); - lines.push_back(line); - return true; - } - -} // end of namespace System_ diff --git a/reactos/tools/sysreg/pipe_reader.h b/reactos/tools/sysreg/pipe_reader.h deleted file mode 100644 index 17eaaf269ae..00000000000 --- a/reactos/tools/sysreg/pipe_reader.h +++ /dev/null @@ -1,110 +0,0 @@ -#ifndef PIPE_READER_H__ -#define PIPE_READER_H__ - -/* $Id$ - * - * PROJECT: System regression tool for ReactOS - * LICENSE: GPL - See COPYING in the top level directory - * FILE: tools/sysreg/conf_parser.h - * PURPOSE: file reading support - * PROGRAMMERS: Johannes Anderwald (johannes.anderwald at sbox tugraz at) - */ - - - -#include "user_types.h" -#include "data_source.h" -#include -#include -#include -#include -#include -#include - -namespace System_ -{ -//--------------------------------------------------------------------------------------- -/// -/// class PipeReader -/// -/// Description: this class implements a pipe reader. It uses _popen to perform opening of -/// pipe / _pclose - - class PipeReader : public DataSource - { - public: - -//--------------------------------------------------------------------------------------- -/// -/// PipeReader -/// -/// Description: constructor of class PipeReader - - PipeReader(); - -//--------------------------------------------------------------------------------------- -/// -/// virtual ~PipeReader -/// -/// Description: destructor of class PipeReader - - virtual ~PipeReader(); - -//--------------------------------------------------------------------------------------- -/// -/// openPipe -/// -/// Description: this function attempts to open a pipe. If an pipe is already open or -/// it fails to open a pipe, the function returns false -/// -/// @param PipeCmd command of the pipe to open -/// @param AccessMode on how to open the pipe -/// accepted modes are t ... text mode - not compatible with b -/// b ... binary mode - not compatible with t -/// r ... allows reading from the pipe -/// w ... allows writing to the pipe -/// @return bool - - virtual bool openSource(const string & PipeCmd); - -//--------------------------------------------------------------------------------------- -/// -/// closePipe -/// -/// Description: closes a pipe. Returns true on success -/// -/// @return bool - - virtual bool closeSource(); - -//--------------------------------------------------------------------------------------- -/// -/// readPipe -/// -/// Description: attempts to read from the pipe. Returns true on success. If it returns -/// false, call PipeReader::isEoF() to determine if the pipe should be closed -/// -/// @param Buffer to be written to -/// @return string::size_type - - bool readSource(std::vector & lines); - -//--------------------------------------------------------------------------------------- -/// -/// isEof -/// -/// Description: returns true if the pipe has reached end of file. The caller should call -/// closePipe if this function returns true - - virtual bool isSourceOpen(); - -protected: - FILE * m_File; - - }; // end of class PipeReader - -} // end of namespace System_ - - - -#endif /* end of PIPE_READER_H__ */ diff --git a/reactos/tools/sysreg/reg_test.h b/reactos/tools/sysreg/reg_test.h deleted file mode 100644 index ae492340cd8..00000000000 --- a/reactos/tools/sysreg/reg_test.h +++ /dev/null @@ -1,93 +0,0 @@ -#ifndef REG_TEST_H__ -#define REG_TEST_H__ - -/* $Id$ - * - * PROJECT: System regression tool for ReactOS - * LICENSE: GPL - See COPYING in the top level directory - * FILE: tools/sysreg/conf_parser.h - * PURPOSE: regression test abstract class - * PROGRAMMERS: Johannes Anderwald (johannes.anderwald at sbox tugraz at) - */ - -#include "user_types.h" -#include "conf_parser.h" - -namespace Sysreg_ -{ - using Sysreg_::ConfigParser; -//------------------------------------------------------------------- -/// -/// class RegressionTest -/// -/// Description: The class RegressionTest is an abstract base class. Every -/// regression test class derives from this class. - - - class RegressionTest - { - public: - -//--------------------------------------------------------------------------------------- -/// -/// RegressionTest -/// -/// Description: constructor of class RegressionTest -/// -/// @param RegName name of derriving subclass - - RegressionTest(const string RegName) : m_Name(RegName) - {} - -//--------------------------------------------------------------------------------------- -/// -/// ~RegressionTest -/// -/// Description: destructor of class RegressionTest - - virtual ~RegressionTest() - {} - -//--------------------------------------------------------------------------------------- -/// -/// getName -/// -/// Description: returns the value of the member m_Name - - const string & getName() const - { return m_Name; } - -//--------------------------------------------------------------------------------------- -/// -/// execute -/// -/// Description: the execute function passes an System_::ConfigParser object to the -/// derriving RegresssionTest class. The class can then read required options from the -/// configuration file. The RegressionTest shall then perform its specific regression test. -/// @see System_::PipeReader -/// @see System_::SymbolFile -/// -/// Note : if an error happens or the option cannot be found, this function -/// should return false. - - virtual bool execute(ConfigParser & conf_parser) = 0; - -//--------------------------------------------------------------------------------------- -/// -/// checkForHang -/// -/// -/// - - - - - protected: - string m_Name; - - }; // end of class RegressionTest - - -} // end of namespace Sysreg_ - -#endif diff --git a/reactos/tools/sysreg/rosboot_test.cpp b/reactos/tools/sysreg/rosboot_test.cpp deleted file mode 100644 index da4ad9d6a1f..00000000000 --- a/reactos/tools/sysreg/rosboot_test.cpp +++ /dev/null @@ -1,1063 +0,0 @@ - -/* $Id$ - * - * PROJECT: System regression tool for ReactOS - * LICENSE: GPL - See COPYING in the top level directory - * FILE: tools/sysreg/conf_parser.h - * PURPOSE: ReactOS boot test - * PROGRAMMERS: Johannes Anderwald (johannes.anderwald at sbox tugraz at) - */ - - -#include "rosboot_test.h" - -namespace Sysreg_ -{ - using std::vector; - using System_::PipeReader; - using System_::NamedPipeReader; -/* using System_::SymbolFile; */ - using System_::FileReader; - using System_::OsSupport; - using System_::EnvironmentVariable; - -#ifdef UNICODE - using std::wofstream; - typedef wofstream ofstream; -#else - using std::ofstream; -#endif - - string RosBootTest::ROS_EMU_TYPE= "ROS_EMU_TYPE"; - string RosBootTest::EMU_TYPE_QEMU = "qemu"; - string RosBootTest::EMU_TYPE_VMWARE = "vmware"; - string RosBootTest::EMU_TYPE_XEN = "xen"; - string RosBootTest::ROS_HDD_IMAGE= "ROS_HDD_IMAGE"; - string RosBootTest::ROS_CD_IMAGE = "ROS_CD_IMAGE"; - string RosBootTest::ROS_MAX_TIME = "ROS_MAX_TIME"; - string RosBootTest::ROS_LOG_FILE = "ROS_LOG_FILE"; - string RosBootTest::ROS_SYM_DIR = "ROS_SYM_DIR"; - string RosBootTest::ROS_DELAY_READ = "ROS_DELAY_READ"; - string RosBootTest::ROS_SYSREG_CHECKPOINT = "SYSREG_CHECKPOINT:"; - string RosBootTest::ROS_CRITICAL_IMAGE = "ROS_CRITICAL_IMAGE"; - string RosBootTest::ROS_EMU_KILL = "ROS_EMU_KILL"; - string RosBootTest::ROS_EMU_MEM = "ROS_EMU_MEM"; - string RosBootTest::ROS_BOOT_CMD = "ROS_BOOT_CMD"; - string RosBootTest::XEN_CONFIG_FILE = "XEN_CONFIG_FILE"; - string RosBootTest::XEN_CONFIG_NAME = "XEN_CONFIG_NAME"; - -#ifndef WIN32 - string RosBootTest::ROS_EMU_PATH = "ROS_EMU_PATH_LIN"; -#else - string RosBootTest::ROS_EMU_PATH = "ROS_EMU_PATH_WIN"; -#endif - -//--------------------------------------------------------------------------------------- - RosBootTest::RosBootTest() : m_MaxTime(65), m_DelayRead(0) - { - - } - -//--------------------------------------------------------------------------------------- - RosBootTest::~RosBootTest() - { - - } -//--------------------------------------------------------------------------------------- - bool RosBootTest::executeBootCmd() - { - int numargs = 0; - const char * args[128]; - char * pBuf; - char szBuffer[128]; - - pBuf = (char*)m_BootCmd.c_str (); - if (pBuf) - { - pBuf = strtok(pBuf, " "); - while(pBuf != NULL) - { - if (!numargs) - strcpy(szBuffer, pBuf); - - args[numargs] = pBuf; - numargs++; - pBuf = strtok(NULL, " "); - } - args[numargs++] = 0; - } - else - { - strcpy(szBuffer, pBuf); - } - m_Pid = OsSupport::createProcess (szBuffer, numargs-1, args, false); - if (!m_Pid) - { - cerr << "Error: failed to launch boot cmd " << m_BootCmd << endl; - return false; - } - - return true; - } -//--------------------------------------------------------------------------------------- - void RosBootTest::delayRead() - { - if (m_DelayRead) - { - /// - /// delay reading until emulator is ready - /// - - OsSupport::delayExecution(m_DelayRead); - } - } -//--------------------------------------------------------------------------------------- - void RosBootTest::getDefaultHDDImage(string & img) - { - img = "output-i386"; - - EnvironmentVariable::getValue("ROS_OUTPUT", img); -#ifndef WIN32 - img += "/ros.hd"; -#else - img += "\\ros.hd"; -#endif - } -//--------------------------------------------------------------------------------------- - bool RosBootTest::isFileExisting(string output) - { - FILE * file; - file = fopen(output.c_str(), "r"); - - if (file) - { - /* the file exists */ - fclose(file); - return true; - } - return false; - } - -//--------------------------------------------------------------------------------------- - bool RosBootTest::isDefaultHDDImageExisting() - { - string img; - - getDefaultHDDImage(img); - return isFileExisting(img); - } - -//--------------------------------------------------------------------------------------- - bool RosBootTest::createHDDImage(string image) - { - - string qemuimgdir; - if (!getQemuDir(qemuimgdir)) - { - cerr << "Error: failed to retrieve qemu directory path" << endl; - return false; - } - - -#ifndef WIN32 - qemuimgdir += "/qemu-img"; - -#else - qemuimgdir += "\\qemu-img.exe"; -#endif - - if (!isFileExisting(qemuimgdir)) - { - cerr << "Error: ROS_EMU_PATH must contain the path to qemu and qemu-img " << qemuimgdir << endl; - return false; - } - remove(image.c_str ()); - - const char * options[] = {NULL, - "create", - "-f", -#ifndef WIN32 - "raw", -#else - "vmdk", -#endif - NULL, - "100M", - NULL - }; - - - options[0] = qemuimgdir.c_str(); - options[4] = image.c_str(); - - cerr << "Creating HDD Image ..." << image << endl; - OsSupport::createProcess (qemuimgdir.c_str(), 6, options, true); - if (isFileExisting(image)) - { - m_HDDImage = image; - return true; - } - return false; - } -//---------------------------------------------------------------------------------------- - bool RosBootTest::isQemuPathValid() - { - string qemupath; - - if (m_BootCmd.length()) - { - /* the boot cmd is already provided - * check if path to qemu is valid - */ - string::size_type pos = m_BootCmd.find_first_of(" "); - if (pos == string::npos) - { - /* the bootcmd is certainly not valid */ - return false; - } - qemupath = m_BootCmd.substr(0, pos); - } - else - { - /* the qemu path is provided ROS_EMU_PATH variable */ - qemupath = m_EmuPath; - } - - - return isFileExisting(qemupath); - } -//---------------------------------------------------------------------------------------- - bool RosBootTest::hasQemuNoRebootOption() - { - /// - /// FIXME - /// extract version - /// - - return true; - } -//---------------------------------------------------------------------------------------- - bool RosBootTest::getQemuDir(string & qemupath) - { - string::size_type pos; - -#ifndef WIN32 - pos = m_EmuPath.find_last_of("/"); -#else - pos = m_EmuPath.find_last_of("\\"); -#endif - if (pos == string::npos) - { - cerr << "Error: ROS_EMU_PATH is invalid!!!" << endl; - return false; - } - qemupath = m_EmuPath.substr(0, pos); - return true; - } -//---------------------------------------------------------------------------------------- - bool RosBootTest::createBootCmd() - { - string pipe; - string qemudir; - char pipename[] = "qemuXXXXXX"; - if (m_MaxMem.length() == 0) - { - /* set default memory size to 64M */ - m_MaxMem = "64"; - } - -#ifndef WIN32 - - if (mktemp(pipename)) - { - string temp = pipename; - m_Src = "/tmp/" + temp; - pipe = "pipe:" + m_Src; - } - else - { - - pipe = "pipe:/tmp/qemu"; - m_Src = "/tmp/qemu"; - } - - qemudir = "/usr/share/qemu"; - m_DebugPort = "pipe"; -#else - if (_mktemp(pipename)) - { - string temp = pipename; - pipe = "pipe:" + temp; - m_Src = "\\\\.\\pipe\\" + temp; - } - else - { - pipe = "pipe:qemu"; - m_Src = "\\\\.\\pipe\\qemu"; - } - m_DebugPort = "pipe"; - - if (!getQemuDir(qemudir)) - { - return false; - } -#endif - - - m_BootCmd = m_EmuPath + " -L " + qemudir + " -m " + m_MaxMem + " -serial " + pipe; - - if (m_CDImage.length()) - { - /* boot from cdrom */ - m_BootCmd += " -boot d -cdrom " + m_CDImage; - - if (m_HDDImage.length ()) - { - /* add disk when specified */ - m_BootCmd += " -hda " + m_HDDImage; - } - - } - else if (m_HDDImage.length ()) - { - /* boot from hdd */ - m_BootCmd += " -boot c -hda " + m_HDDImage; - } - else - { - /* - * no boot device provided - */ - cerr << "Error: no bootdevice provided" << endl; - return false; - } - -#ifndef WIN32 - /* on linux we need get pid in order to be able - * to terminate the emulator in case of errors - * on windows we can get pid as return of CreateProcess - */ - m_PidFile = "output-i386"; - EnvironmentVariable::getValue("ROS_OUTPUT", m_PidFile); - m_PidFile += "/pid.txt"; - m_BootCmd += " -pidfile "; - m_BootCmd += m_PidFile; - m_BootCmd += " -nographic"; -#else - - if (hasQemuNoRebootOption()) - { - m_BootCmd += " -no-reboot "; - } -#endif - return true; - } -//---------------------------------------------------------------------------------------- - bool RosBootTest::extractPipeFromBootCmd() - { - string::size_type pos = m_BootCmd.find("-serial pipe:"); - if (pos == string::npos) - { - /* no debug options provided */ - cerr << "Error: provided boot cmd does not specify a pipe debugging port" << endl; - return false; - } - - string pipe = m_BootCmd.substr(pos + 13, m_BootCmd.size() - pos - 13); - pos = pipe.find(" "); - if (pos != string::npos) - { - pipe = pipe.substr(0, pos); - } -#ifndef WIN32 - m_Src = pipe; -#else - m_Src = "\\\\.\\pipe\\" + pipe.substr(0, pos); -#endif - m_DebugPort = "pipe"; - return true; - } -//---------------------------------------------------------------------------------------- - bool RosBootTest::configureHDDImage() - { - //cout << "configureHDDImage m_HDDImage " << m_HDDImage.length() << " m_CDImage " << m_CDImage.length() << " m_BootCmd: " << m_BootCmd.length() << endl; - if (m_HDDImage.length()) - { - /* check if ROS_HDD_IMAGE points to hdd image */ - if (!isFileExisting(m_HDDImage)) - { - if (!m_CDImage.length ()) - { - cerr << "Error: HDD image is not existing and CDROM image not provided" << endl; - return false; - } - /* create it */ - return createHDDImage(m_HDDImage); - } - return true; - } - else if (!m_BootCmd.length ()) - { - /* no hdd image provided - * but also no override by - * ROS_BOOT_CMD - */ - if (!m_CDImage.length ()) - { - cerr << "Error: no HDD and CDROM image provided" << endl; - return false; - } - - getDefaultHDDImage(m_HDDImage); - if (isFileExisting(m_HDDImage)) - { - cerr << "Falling back to default hdd image " << m_HDDImage << endl; - return true; - } - return createHDDImage(m_HDDImage); - } - /* - * verify the provided ROS_BOOT_CMD for hdd image - * - */ - - bool hdaboot = false; - string::size_type pos = m_BootCmd.find ("-boot c"); - if (pos != string::npos) - { - hdaboot = true; - } - - pos = m_BootCmd.find("-hda "); - if (pos != string::npos) - { - string hdd = m_BootCmd.substr(pos + 5, m_BootCmd.length() - pos - 5); - if (!hdd.length ()) - { - cerr << "Error: ROS_BOOT_CMD misses value of -hda option" << endl; - return false; - } - pos = m_BootCmd.find(" "); - if (pos != string::npos) - { - /// FIXME - /// sysreg assumes that the hdd image filename has no spaces - /// - hdd = hdd.substr(0, pos); - } - if (!isFileExisting(hdd)) - { - if (hdaboot) - { - cerr << "Error: ROS_BOOT_CMD specifies booting from hda but no valid hdd image " << hdd << " provided" << endl; - return false; - } - - /* the file does not exist create it */ - return createHDDImage(hdd); - } - return true; - } - - return false; - } -//---------------------------------------------------------------------------------------- - bool RosBootTest::configureCDImage() - { - if (!m_BootCmd.length ()) - { - if (m_CDImage.length()) - { - /* we have a cd image lets check if its valid */ - if (isFileExisting(m_CDImage)) - { - cerr << "Using CDROM image " << m_CDImage << endl; - return true; - } - } - if (isFileExisting("ReactOS-RegTest.iso")) - { - m_CDImage = "ReactOS-RegTest.iso"; - cerr << "Falling back to default CDROM image " << m_CDImage << endl; - return true; - } - cerr << "No CDROM image found, boot device is HDD" << endl; - m_CDImage = ""; - return true; - } - - string::size_type pos = m_BootCmd.find("-boot "); - if (pos == string::npos) - { - /* ROS_BOOT_CMD must provide a boot parameter*/ - cerr << "Error: ROS_BOOT_CMD misses boot parameter" << endl; - return false; - } - - string rest = m_BootCmd.substr(pos + 6, m_BootCmd.length() - pos - 6); - if (rest.length() < 1) - { - /* boot parameter misses option where to boot from */ - cerr << "Error: ROS_BOOT_CMD misses boot parameter" << endl; - return false; - } - if (rest[0] != 'c' && rest[0] != 'd') - { - cerr << "Error: ROS_BOOT_CMD has invalid boot parameter" << endl; - return false; - } - - if (rest[0] == 'c') - { - /* ROS_BOOT_CMD boots from hdd */ - return true; - } - - pos = m_BootCmd.find("-cdrom "); - if (pos == string::npos) - { - cerr << "Error: ROS_BOOT_CMD misses cdrom parameter" << endl; - return false; - } - rest = m_BootCmd.substr(pos + 7, m_BootCmd.length() - pos - 7); - if (!rest.length()) - { - cerr << "Error: ROS_BOOT_CMD misses cdrom parameter" << endl; - return false; - } - pos = rest.find(" "); - if (pos != string::npos) - { - rest = rest.substr(0, pos); - } - - if (!isFileExisting(rest)) - { - cerr << "Error: cdrom image " << rest << " does not exist" << endl; - return false; - } - else - { - m_CDImage = rest; - return true; - } - } -//---------------------------------------------------------------------------------------- - bool RosBootTest::configureQemu() - { - if (!isQemuPathValid()) - { - cerr << "Error: the path to qemu is not valid" << endl; - return false; - } - - if (!configureCDImage()) - { - cerr << "Error: failed to set a valid cdrom configuration" << endl; - return false; - } - - if (!configureHDDImage()) - { - cerr << "Error: failed to set a valid hdd configuration" << endl; - return false; - } - - if (m_BootCmd.length()) - { - if (!extractPipeFromBootCmd()) - { - return false; - } - } - else - { - if (!createBootCmd()) - { - return false; - } - } -#ifndef WIN32 - if (mkfifo(m_Src.c_str(), 400)) - { -/* - if (errno != EEXIST) - { - cerr <<"Error: mkfifo failed with " << errno << endl; - } -*/ - return false; - } - -#endif - if (m_PidFile.length () && isFileExisting(m_PidFile)) - { - cerr << "Deleting pid file " << m_PidFile << endl; - remove(m_PidFile.c_str ()); - } - - cerr << "Opening Data Source:" << m_BootCmd << endl; - m_DataSource = new NamedPipeReader(); - if (!executeBootCmd()) - { - - cerr << "Error: failed to launch emulator with: " << m_BootCmd << endl; - return false; - } - - return true; - } - -//--------------------------------------------------------------------------------------- - bool RosBootTest::xenGetCaps() - { - FILE *fp; - int ch, i; - char buffer[2048]; - - fp = popen("xm info", "r"); - if (!fp) - { - cerr << "Error getting Xen caps." << endl; - return false; - } - for (i=0;(i<2049)&&(feof(fp) == 0 && ((ch = fgetc(fp)) != -1)); i++) - { - buffer[i] = (char) ch; - } - buffer[i] = '\0'; - pclose(fp); - - if (strstr(buffer, "hvm") == 0) - { - cerr << "No hvm support detected!" << endl; - return false; - } - else - { - return true; - } - - } - -//--------------------------------------------------------------------------------------- - bool RosBootTest::configureXen(ConfigParser &conf_parser) - { - if (!xenGetCaps()) - { - return false; - } - - if (!isFileExisting(m_XenConfig)) - { - cerr << "Xen configuration file missing" << endl; - return false; - } - m_Src = "xm console "; - string xen_name = "reactos"; - conf_parser.getStringValue(RosBootTest::XEN_CONFIG_NAME, xen_name); - m_Src += xen_name; - - m_DataSource = new PipeReader(); - m_BootCmd = m_EmuPath + "/xm create " + m_XenConfig; - if (!executeBootCmd()) - return false; - - return true; - } -//--------------------------------------------------------------------------------------- - bool RosBootTest::configureVmWare() - { - cerr << "VmWare is currently not yet supported" << endl; - return false; - } -//--------------------------------------------------------------------------------------- - bool RosBootTest::readConfigurationValues(ConfigParser &conf_parser) - { - - if (!conf_parser.getStringValue(RosBootTest::ROS_EMU_TYPE, m_EmuType)) - { - cerr << "Error: ROS_EMU_TYPE is not set" << endl; - return false; - } - - if (m_EmuType == EMU_TYPE_XEN) - { - if (!conf_parser.getStringValue(RosBootTest::XEN_CONFIG_FILE, m_XenConfig)) - { - cerr << "Error: XEN_CONFIG_FILE is not set" << endl; - return false; - } - } - if (!conf_parser.getStringValue(RosBootTest::ROS_EMU_PATH, m_EmuPath)) - { - cerr << "Error: ROS_EMU_PATH_[LIN/WIN] is not set" << endl; - return false; - } - if (!m_HDDImage.length()) - { - /* only read image once */ - conf_parser.getStringValue (RosBootTest::ROS_HDD_IMAGE, m_HDDImage); - } - if (!m_CDImage.length()) - { - /* only read cdimage once */ - conf_parser.getStringValue (RosBootTest::ROS_CD_IMAGE, m_CDImage); - } - /* reset boot cmd */ - m_BootCmd = ""; - - - conf_parser.getIntValue (RosBootTest::ROS_MAX_TIME, m_MaxTime); - conf_parser.getStringValue (RosBootTest::ROS_LOG_FILE, m_DebugFile); - conf_parser.getStringValue (RosBootTest::ROS_SYM_DIR, m_SymDir); - conf_parser.getIntValue (RosBootTest::ROS_DELAY_READ, m_DelayRead); - conf_parser.getStringValue (RosBootTest::ROS_SYSREG_CHECKPOINT, m_Checkpoint); - conf_parser.getStringValue (RosBootTest::ROS_CRITICAL_IMAGE, m_CriticalImage); - conf_parser.getStringValue (RosBootTest::ROS_EMU_KILL, m_KillEmulator); - conf_parser.getStringValue (RosBootTest::ROS_EMU_MEM, m_MaxMem); - conf_parser.getStringValue (RosBootTest::ROS_BOOT_CMD, m_BootCmd); - - return true; - } -//--------------------------------------------------------------------------------------- - void RosBootTest::cleanup(ConfigParser &conf_parser) - { - m_DataSource->closeSource(); - OsSupport::delayExecution(3); - - if (m_EmuType == EMU_TYPE_XEN) - { - string xen_name = "reactos"; - conf_parser.getStringValue(RosBootTest::XEN_CONFIG_NAME, xen_name); - string cmd = "xm destroy " + xen_name; - system(cmd.c_str ()); - } - else - { - if (m_Pid) - { - OsSupport::terminateProcess (m_Pid, 0); - } - } - delete m_DataSource; - m_DataSource = NULL; - - if (m_PidFile.length ()) - { - remove(m_PidFile.c_str ()); - } - } - -//--------------------------------------------------------------------------------------- - bool RosBootTest::execute(ConfigParser &conf_parser) - { - if (!readConfigurationValues(conf_parser)) - { - return false; - } - - if (m_EmuType == EMU_TYPE_QEMU) - { - if (!configureQemu()) - { - cerr << "Error: failed to configure qemu" << endl; - return false; - } - } - else if (m_EmuType == EMU_TYPE_VMWARE) - { - if (!configureVmWare()) - { - cerr << "Error: failed to configure vmware" << endl; - return false; - } - } - else if (m_EmuType == EMU_TYPE_XEN) - { - if (!configureXen(conf_parser)) - { - cerr << "Error: failed to configure xen" << endl; - return false; - } - } - else - { - /// - /// unsupported emulator - - cerr << "Error: ROS_EMU_TYPE value is not supported:" << m_EmuType << "=" << EMU_TYPE_QEMU << endl; - return false; - } - - if (m_DelayRead) - { - cerr << "Delaying read for " << m_DelayRead << " seconds" << endl; - OsSupport::delayExecution(m_DelayRead); - } - - if (!m_DataSource->openSource(m_Src)) - { - cerr << "Error: failed to open data source with " << m_Src << endl; - cleanup(conf_parser); - return false; - } -#ifndef WIN32 - /* - * For linux systems we can only - * check if the emulator runs by - * opening pid.txt and lookthrough if - * it exists - */ - - if (m_EmuType != EMU_TYPE_XEN) - { - FILE * file = fopen(m_PidFile.c_str(), "r"); - if (!file) - { - cerr << "Error: failed to launch emulator" << endl; - cleanup(conf_parser); - return false; - } - char buffer[128]; - if (!fread(buffer, 1, sizeof(buffer), file)) - { - cerr << "Error: pid file w/o pid!!! " << endl; - fclose(file); - cleanup(conf_parser); - return false; - } - m_Pid = atoi(buffer); - fclose(file); - } -#endif - OsSupport::cancelAlarms(); -#ifndef WIN32 - // OsSupport::setAlarm (m_MaxTime, m_Pid); - // OsSupport::setAlarm(m_MaxTime, getpid()); -#else - OsSupport::setAlarm (m_MaxTime, m_Pid); - OsSupport::setAlarm(m_MaxTime, GetCurrentProcessId()); -#endif - - bool ret = analyzeDebugData(); - cleanup(conf_parser); - - return ret; -} -//--------------------------------------------------------------------------------------- - void RosBootTest::dumpCheckpoints() - { - if (m_Checkpoints.size ()) - { - cerr << "Dumping list of checkpoints: "<< endl; - while(!m_Checkpoints.empty ()) - { - cerr << m_Checkpoints[0] << endl; - m_Checkpoints.erase (m_Checkpoints.begin ()); - } - } - } -//--------------------------------------------------------------------------------------- - RosBootTest::DebugState RosBootTest::checkDebugData(vector & debug_data) - { - /// TBD the information needs to be written into an provided log object - /// which writes the info into HTML/log / sends etc .... - - bool clear = true; - DebugState state = DebugStateContinue; - - for(size_t i = 0; i < debug_data.size();i++) - { - string line = debug_data[i]; - - cout << line << endl; - - if (line.find (RosBootTest::ROS_SYSREG_CHECKPOINT) != string::npos) - { - line.erase (0, line.find (RosBootTest::ROS_SYSREG_CHECKPOINT) + - RosBootTest::ROS_SYSREG_CHECKPOINT.length ()); - if (!strncmp(line.c_str (), m_Checkpoint.c_str (), m_Checkpoint.length ())) - { - state = DebugStateCPReached; - break; - } - m_Checkpoints.push_back (line); - } - - - if (line.find ("*** Fatal System Error") != string::npos) - { - cerr << "Blue Screen of Death detected" <= debug_data.size ()) - { - /// - /// missing information is cut off -> try reconstruct at next call - /// - clear = false; - break; - } - - /// - /// extract address from next line - /// - - string address = debug_data[i+2]; - string::size_type pos = address.find_last_of (" "); - if (pos == string::npos) - { - cerr << "Error: trace is not available (corrupted debug info" << endl; - continue; - } - - - address = address.substr (pos, address.length () - 1 - pos); - - /// - /// extract module name - /// - string modulename = debug_data[i+3]; - - pos = modulename.find_last_of ("\\"); - if (pos == string::npos) - { - cerr << "Error: trace is not available (corrupted debug info" << endl; - continue; - } - - string appname = modulename.substr (pos + 1, modulename.length () - pos); - if (m_CriticalImage.find (appname) == string::npos && m_CriticalImage.length () > 1) - { - /// the application is not in the list of - /// critical apps. Therefore we ignore the user-mode - /// exception - - continue; - } - - pos = appname.find_last_of ("."); - if (pos == string::npos) - { - cerr << "Error: trace is not available (corrupted debug info" << endl; - continue; - } - - modulename = appname.substr (0, pos); - - cerr << "UM detected" < 5) - { - debug_data.clear (); - } - return state; - } -//--------------------------------------------------------------------------------------- - bool RosBootTest::analyzeDebugData() - { - vector vect; - size_t lines = 0; - bool write_log; - ofstream file; - bool ret = true; - - if (m_DebugFile.length ()) - { - remove(m_DebugFile.c_str ()); - file.open (m_DebugFile.c_str ()); - } - - write_log = file.is_open (); - while(1) - { - size_t prev_count = vect.size (); - if (!m_DataSource->readSource (vect)) - { - continue; - } - if (write_log) - { - for (size_t i = prev_count; i < vect.size (); i++) - { - string & line = vect[i]; - file << line; - } - } - - DebugState state = checkDebugData(vect); - if (state == DebugStateBSODDetected || state == DebugStateUMEDetected) - { - ret = false; - break; - } - else if (state == DebugStateCPReached) - { - break; - } - lines += (vect.size() -prev_count); //WTF? - } - if (write_log) - { - file.close(); - } - - return ret; - } -} // end of namespace Sysreg_ diff --git a/reactos/tools/sysreg/rosboot_test.h b/reactos/tools/sysreg/rosboot_test.h deleted file mode 100644 index bc2345fd76e..00000000000 --- a/reactos/tools/sysreg/rosboot_test.h +++ /dev/null @@ -1,194 +0,0 @@ -#ifndef ROSBOOT_TEST_H__ -#define ROSBOOT_TEST_H__ - -/* $Id$ - * - * PROJECT: System regression tool for ReactOS - * LICENSE: GPL - See COPYING in the top level directory - * FILE: tools/sysreg/conf_parser.h - * PURPOSE: ReactOS boot test - * PROGRAMMERS: Johannes Anderwald (johannes.anderwald at sbox tugraz at) - */ -#include "data_source.h" -#include "conf_parser.h" -#include "os_support.h" -#include "user_types.h" -#include "pipe_reader.h" -#include "namedpipe_reader.h" -#include "file_reader.h" -#include "os_support.h" -#include "env_var.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef WIN32 -#include -#include -#endif - -#ifndef WIN32 -#include -#include -#if defined(__FreeBSD__) || defined(__APPLE__) -# include -#endif // __FreeBSD__ -#endif - -namespace Sysreg_ -{ - using std::vector; - using System_::DataSource; - using System_::OsSupport; - - -//--------------------------------------------------------------------------------------- -/// -/// class RosBootTest -/// -/// Description: this class attempts to boot ReactOS in an emulator with console logging enabled. -/// It - - class RosBootTest - { - public: - - static string ROS_EMU_TYPE; - static string EMU_TYPE_QEMU; - static string EMU_TYPE_VMWARE; - static string EMU_TYPE_XEN; - static string ROS_EMU_PATH; - static string ROS_HDD_IMAGE; - static string ROS_CD_IMAGE; - static string ROS_MAX_TIME; - static string ROS_LOG_FILE; - static string ROS_SYM_DIR; - static string ROS_DELAY_READ; - static string ROS_SYSREG_CHECKPOINT; - static string ROS_CRITICAL_IMAGE; - static string ROS_EMU_KILL; - static string ROS_EMU_MEM; - static string ROS_BOOT_CMD; - static string XEN_CONFIG_FILE; - static string XEN_CONFIG_NAME; - -//--------------------------------------------------------------------------------------- -/// -/// RosBootTest -/// -/// Description: constructor of class RosBootTest -/// - - RosBootTest(); - -//--------------------------------------------------------------------------------------- -/// -/// ~RosBootTest -/// -/// Description: destructor of class RosBootTest -/// - - virtual ~RosBootTest(); - -//--------------------------------------------------------------------------------------- -/// -/// execute -/// -/// Description: this function performs a ReactOS boot test. It reads the variable -/// ROSBOOT_CMD and executes this specific command. This command shall contain the path -/// to an emulator (i.e. qemu) and the required arguments (-serial switch, hdd img etc) to be able -/// to read from console. If an error is detected, it attempts to resolve the faulting -/// module and address. - - virtual bool execute(ConfigParser & conf_parser); - - protected: - - void getDefaultHDDImage(string & img); - bool isFileExisting(string filename); - bool isDefaultHDDImageExisting(); - bool createHDDImage(string filename); - bool isQemuPathValid(); - bool getQemuDir(string &); - bool createBootCmd(); - bool extractPipeFromBootCmd(); - bool configureCDImage(); - bool configureHDDImage(); - void getPidFromFile(); - bool executeBootCmd(); - void delayRead(); - bool configurePipe(); - bool configureFile(); - bool analyzeDebugData(); - bool readConfigurationValues(ConfigParser & conf_parser); - bool configureQemu(); - bool configureVmWare(); - bool configureXen(ConfigParser &conf_parser); - bool hasQemuNoRebootOption(); - void cleanup(ConfigParser &conf_parser); - bool xenGetCaps(); -//--------------------------------------------------------------------------------------- -/// -/// dumpCheckpoints -/// -/// Description: prints a list of all reached checkpoints so far - - void dumpCheckpoints(); - -enum DebugState -{ - DebugStateContinue = 1, /* continue debugging */ - DebugStateBSODDetected, /* bsod detected */ - DebugStateUMEDetected, /* user-mode exception detected */ - DebugStateCPReached /* check-point reached */ -}; - -//--------------------------------------------------------------------------------------- -/// -/// checkDebugData -/// -/// Description: this function parses the given debug data for BSOD, UM exception etc -/// If it detects an fatal error, it should return false -/// -/// Note: the received debug information should be written to an internal log object -/// to facilate post-processing of the results - - DebugState checkDebugData(vector & debug_data); - -protected: - - string m_EmuType; - string m_EmuPath; - string m_HDDImage; - string m_CDImage; - long int m_MaxTime; - string m_DebugFile; - string m_SymDir; - long int m_DelayRead; - string m_Checkpoint; - string m_CriticalImage; - string m_KillEmulator; - string m_MaxMem; - string m_BootCmd; - string m_Src; - string m_DebugPort; - string m_PidFile; - string m_XenConfig; - - DataSource * m_DataSource; - OsSupport::ProcessID m_Pid; - std::vector m_Checkpoints; - - }; // end of class RosBootTest - -} // end of namespace Sysreg_ - -#endif /* end of ROSBOOT_H__ */ diff --git a/reactos/tools/sysreg/sym_file.cpp b/reactos/tools/sysreg/sym_file.cpp deleted file mode 100644 index 29bcfb76257..00000000000 --- a/reactos/tools/sysreg/sym_file.cpp +++ /dev/null @@ -1,191 +0,0 @@ - -/* $Id$ - * - * PROJECT: System regression tool for ReactOS - * LICENSE: GPL - See COPYING in the top level directory - * FILE: tools/sysreg/conf_parser.h - * PURPOSE: source symbol lookup - * PROGRAMMERS: Johannes Anderwald (johannes.anderwald at sbox tugraz at) - */ - - -#include "sym_file.h" -#include "env_var.h" -#include "pipe_reader.h" -#include "conf_parser.h" - -#include -#include -#include -#include -#define _FINDDATA_T_DEFINED -#include -#include - - -namespace System_ -{ - - using std::vector; - string SymbolFile::VAR_ROS_OUTPUT = "ROS_OUTPUT"; - string SymbolFile::ROS_ADDR2LINE = "ROS_ADDR2LINE"; - string SymbolFile::m_SymbolPath= ""; - string SymbolFile::m_SymResolver= ""; - SymbolFile::SymbolMap SymbolFile::m_Map; - -//--------------------------------------------------------------------------------------- - SymbolFile::SymbolFile() - { - - } - -//--------------------------------------------------------------------------------------- - SymbolFile::~SymbolFile() - { - - } - -//--------------------------------------------------------------------------------------- - bool SymbolFile::initialize(ConfigParser & conf_parser, string const &Path) - { - vector vect; - string current_dir; - - if (Path == "") - { - current_dir = "output-i386"; - EnvironmentVariable::getValue(SymbolFile::VAR_ROS_OUTPUT, current_dir); - } - else - { - current_dir = Path; - } - - m_SymbolPath = current_dir; - - if (!conf_parser.getStringValue (ROS_ADDR2LINE, m_SymResolver)) - { - cerr << "Warning: ROS_ADDR2LINE is not set in configuration file -> symbol lookup will fail" < failed" <(modulename, path)); - - } - if (c_file.attrib & _A_SUBDIR) - { - if (c_file.name[0] != _T('.')) - { - string path = current_dir; - path.insert (path.length ()-1, "\\"); - path.insert (path.length ()-1, c_file.name); - vect.push_back (path); - } - } - - }while(_tfindnexti64(hFile, &c_file) == 0); - - _findclose(hFile); - hFile = -1L; - - while(!vect.empty ()) - { - current_dir = vect.front (); - vect.erase (vect.begin()); - val = current_dir; - val.insert (val.length() -1, "\\*"); - hFile = _tfindfirsti64(val.c_str(), &c_file); - if (hFile != -1L) - { - break; - } - } - - if (hFile == -1L) - { - break; - } - - }while(1); - - - return !m_Map.empty(); - } - -//--------------------------------------------------------------------------------------- - bool SymbolFile::resolveAddress(const string &module_name, const string &module_address, string &Buffer) - { - SymbolMap::const_iterator it = m_Map.find (module_name); - - if (it == m_Map.end () || m_SymResolver == "") - { - cerr << "SymbolFile::resolveAddress> no symbol file or ROS_ADDR2LINE not set" << endl; - return false; - } - - char szCmd[300]; - - sprintf(szCmd, "%s %s %s", m_SymResolver.c_str (), it->second.c_str (), module_address.c_str()); - string pipe_cmd(szCmd); - vector vect; - PipeReader pipe_reader; - - if (!pipe_reader.openSource(pipe_cmd)) - { - cerr << "SymbolFile::resolveAddress> failed to open pipe" < no symbol file found for module " << ModuleName << endl; - return false; - } - - FilePath = it->second; - return true; - } - -} // end of namespace System_ diff --git a/reactos/tools/sysreg/sym_file.h b/reactos/tools/sysreg/sym_file.h deleted file mode 100644 index 9973a2e7316..00000000000 --- a/reactos/tools/sysreg/sym_file.h +++ /dev/null @@ -1,111 +0,0 @@ -#ifndef SYM_FILE_H__ -#define SYM_FILE_H__ - - -/* $Id$ - * - * PROJECT: System regression tool for ReactOS - * LICENSE: GPL - See COPYING in the top level directory - * FILE: tools/sysreg/conf_parser.h - * PURPOSE: source symbol lookup - * PROGRAMMERS: Johannes Anderwald (johannes.anderwald at sbox tugraz at) - */ - -#include "conf_parser.h" -#include - -namespace System_ -{ - using Sysreg_::ConfigParser; - -//--------------------------------------------------------------------------------------- -/// -/// class SymbolFile -/// -/// Description: this class performs 2 tasks: First, it locates all available module names -/// and their associated symbol files. Secondly, it performs resolving address to source addresses -/// via the function resolveAddress -/// -/// Usage: call initialize(). Then call resolveAddress(); -/// i.e. resolveAddress("comctl32.dll", 0xBLABLABLA, result); - - class SymbolFile - { - public: - static string VAR_ROS_OUTPUT; - static string ROS_ADDR2LINE; - typedef std::map SymbolMap; -//--------------------------------------------------------------------------------------- -/// -/// ~SymbolFile -/// -/// Description: destructor of class SymbolFile - - virtual ~SymbolFile(); - -//--------------------------------------------------------------------------------------- -/// -/// initialize -/// -/// Description: this function initialize the class. It searches the subdirs -/// of ROS_OUTPUT and adds all files with name *.nostrip.* to a map with module -/// name as the key. -/// -/// Note: if the param Path is not empty, it adds all found modules to the internal -/// map -/// -/// Note: if the path does not exist or the no symbol files were added then false is returned -/// -/// Note: if a module with same module name is already in the map, then the new module is not added -/// -/// @param Path path to ROS_OUTPUT containing symbol files -/// @return bool - - static bool initialize(ConfigParser & conf_parser, const string & Path); - -//--------------------------------------------------------------------------------------- -/// -/// resolveAddress -/// -/// Description: this function attempts to resolve an address using a given symbol file -/// -/// Note: the lookup is performed with raddr2line -/// -/// @param module_name name of the module to examine -/// @param module_address address of the module to resolve -/// @param buffer receives information about the resolved location -/// @return bool - - static bool resolveAddress(const string & module_name, const string & module_address, string & Buffer); - -//--------------------------------------------------------------------------------------- -/// -/// getSymbolFilePath -/// -/// Description: this function returns the associated FilePath to a given module name. If -/// the module name is not known, it returns false and the param FilePath remains untouched -/// -/// @param ModuleName name of the module to lookup -/// @param FilePath buffer receiving the address of symbol file - - static bool getSymbolFilePath(const string & ModuleName, string & FilePath); - - protected: - -//--------------------------------------------------------------------------------------- -/// -/// SymbolFile -/// -/// Description: constructor of class SymbolFile - - SymbolFile(); - - static SymbolMap m_Map; - static string m_SymbolPath; - static string m_SymResolver; - }; -} // end of namespace System_ - - - -#endif /* end of SYM_FILE_H__ */ diff --git a/reactos/tools/sysreg/sysreg.cpp b/reactos/tools/sysreg/sysreg.cpp deleted file mode 100644 index 0f193c398ba..00000000000 --- a/reactos/tools/sysreg/sysreg.cpp +++ /dev/null @@ -1,87 +0,0 @@ - -/* $Id$ - * - * PROJECT: System regression tool for ReactOS - * LICENSE: GPL - See COPYING in the top level directory - * FILE: tools/sysreg/conf_parser.h - * PURPOSE: app initialization - * PROGRAMMERS: Johannes Anderwald (johannes.anderwald at sbox tugraz at) - */ - - -#include "sysreg.h" - -using System_::EnvironmentVariable; - -using Sysreg_::ConfigParser; - -//regression test classes -using Sysreg_::RosBootTest; - -#if 0 -using System_::SymbolFile; -#endif - -static const char USAGE[] = -"sysreg.exe [conf_file]\nconfiguration file (default: sysreg.cfg)"; - - - - -int main(int argc, char * argv[]) -{ - ConfigParser config; - char DefaultConfig[] = "sysreg.cfg"; - char *ConfigFile; - - if ((argc > 2)) - { - cerr << USAGE << endl; - return -1; - } - -//--------------------------------------------------------------------------------------- - - if (argc == 2) - { - ConfigFile = argv[1]; - } - else - { - ConfigFile = DefaultConfig; - } - - if (!config.parseFile (ConfigFile)) - { - cerr << USAGE << endl; - return -1; - } - - RosBootTest * regtest = new RosBootTest(); - if (!regtest) - { - cerr << "Error: failed to create regression test" << endl; - return -1; - } - - string envvar; - string ros = "ROS_OUTPUT"; - config.getStringValue (ros, envvar); -#if 0 - SymbolFile::initialize (config, envvar); -#endif - - for(int i = 0; i < 3; i++) - { - bool ret = regtest->execute(config); - if (!ret) - { - cout << "The regression test has failed at stage: " << i << endl; - delete regtest; - return -2; - } - } - cout << "The regression test completed successfully" << endl; - delete regtest; - return 0; -} diff --git a/reactos/tools/sysreg/sysreg.h b/reactos/tools/sysreg/sysreg.h deleted file mode 100644 index dc27283ccce..00000000000 --- a/reactos/tools/sysreg/sysreg.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef SYSREG_H__ -#define SYSREG_H__ - -/* $Id$ - * - * PROJECT: System regression tool for ReactOS - * LICENSE: GPL - See COPYING in the top level directory - * FILE: tools/sysreg/conf_parser.h - * PURPOSE: app initialization - * PROGRAMMERS: Johannes Anderwald (johannes.anderwald at sbox tugraz at) - */ - -#include "user_types.h" -#include "env_var.h" -#include "sym_file.h" -#include "conf_parser.h" - -// regression test classes -#include "rosboot_test.h" - - - -#endif /* end of SYSREG_H__ */ diff --git a/reactos/tools/sysreg/sysreg.rbuild b/reactos/tools/sysreg/sysreg.rbuild deleted file mode 100644 index 458e67cea25..00000000000 --- a/reactos/tools/sysreg/sysreg.rbuild +++ /dev/null @@ -1,14 +0,0 @@ - - - - - conf_parser.cpp - env_var.cpp - rosboot_test.cpp - namedpipe_reader.cpp - pipe_reader.cpp - sysreg.cpp - file_reader.cpp - os_support.cpp - timer_command_callback.cpp - diff --git a/reactos/tools/sysreg/timer_callback.h b/reactos/tools/sysreg/timer_callback.h deleted file mode 100644 index a786fe1f9a0..00000000000 --- a/reactos/tools/sysreg/timer_callback.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef TIMER_CALLBACK_H__ -#define TIMER_CALLBACK_H__ - - -namespace System_ -{ -//--------------------------------------------------------------------------------------- -/// -/// TimerCallback -/// -/// Description: base class for all timer callback functions - - class TimerCallback - { - public: -//--------------------------------------------------------------------------------------- -/// -/// TimerCallback -/// -/// Description: constructor of class TimerCallback - - TimerCallback() {} - -//--------------------------------------------------------------------------------------- -/// -/// TimerCallback -/// -/// Description: destructor of class TimerCallback - - virtual ~TimerCallback() {} - - -//--------------------------------------------------------------------------------------- -/// -/// initialize -/// -/// Description: this function is called when the timercallback object is initialized in -/// in the callback mechanism - - virtual bool initialize(){ return true;} - - -//--------------------------------------------------------------------------------------- -/// -/// hasExpired -/// -/// Description: this function is called everytime timer event has started. The callback object -/// should return true if the expiration function has expired. -/// Note: the function should then also cleanup all consumed resourced - - virtual bool hasExpired() = 0; - }; //end of class TimerCallback - -}// end of namespace System_ - -#endif diff --git a/reactos/tools/sysreg/timer_command_callback.cpp b/reactos/tools/sysreg/timer_command_callback.cpp deleted file mode 100644 index f83fb98cd56..00000000000 --- a/reactos/tools/sysreg/timer_command_callback.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include "timer_command_callback.h" - - -namespace System_ -{ - using Sysreg_::ConfigParser; - - string TimerCommandCallback::ROS_TIMER_COMMAND="ROS_TIMER_COMMAND"; - string TimerCommandCallback::ROS_TIMER_TIMEOUT="ROS_TIMER_TIMEOUT"; - -//--------------------------------------------------------------- - TimerCommandCallback::TimerCommandCallback(ConfigParser &conf_parser) : TimerCallback(), m_parser(conf_parser), m_Cmd(""), m_Timeout(0) - { - } -//--------------------------------------------------------------- - TimerCommandCallback::~TimerCommandCallback() - { - } -//--------------------------------------------------------------- - bool TimerCommandCallback::initialize() - { - m_parser.getStringValue(ROS_TIMER_COMMAND, m_Cmd); - m_parser.getIntValue(ROS_TIMER_TIMEOUT, m_Timeout); - //FIXME - // calculate current time - - return true; - } - -//--------------------------------------------------------------- - bool TimerCommandCallback::hasExpired() - { - - // FIXME - // calculate current time - // calculate difference - // and invoke m_Cmd when it has expired - return false; - } - -} // end of namespace System_ diff --git a/reactos/tools/sysreg/timer_command_callback.h b/reactos/tools/sysreg/timer_command_callback.h deleted file mode 100644 index 79beabe83ff..00000000000 --- a/reactos/tools/sysreg/timer_command_callback.h +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef TIMER_COMMAND_CALLBACK_H__ //timer_command_callback.h -#define TIMER_COMMAND_CALLBACK_H__ - -#include "conf_parser.h" -#include "timer_callback.h" - -namespace System_ -{ - - class TimerCommandCallback : public TimerCallback - { - public: -//--------------------------------------------------------------- -/// -/// TimerCommandCallback -/// -/// Description: constructor of class TimerCommandCallback -/// -/// @param conf_parser contains configuration data - - TimerCommandCallback(Sysreg_::ConfigParser &conf_parser); - -//--------------------------------------------------------------- -/// -/// ~TimerCommandCallback -/// -/// Description: destructor of class TimerCommandCallback - - virtual ~TimerCommandCallback(); - -//--------------------------------------------------------------- -/// -/// initialize -/// -/// Description: initializes the callback object - - virtual bool initialize(); - -//--------------------------------------------------------------- -/// -/// hasExpired -/// -/// Description: returns true when the callback object has expired - - virtual bool hasExpired(); - protected: - Sysreg_::ConfigParser & m_parser; - string m_Cmd; - long int m_Timeout; - static string ROS_TIMER_TIMEOUT; - static string ROS_TIMER_COMMAND; - }; - -} /* EOF namspace System_ */ - - -#endif /* EOF TIMER_COMMAND_CALLBACK_H__ */ diff --git a/reactos/tools/sysreg/txtmode.cfg b/reactos/tools/sysreg/txtmode.cfg deleted file mode 100644 index 78078578944..00000000000 --- a/reactos/tools/sysreg/txtmode.cfg +++ /dev/null @@ -1,110 +0,0 @@ -; ROS_EMULATOR_TYPE -; -; This variable defines which emulator should be used to emulate ReactOS -; -;ROS_EMU_TYPE=[qemu|vmware|xen] - -ROS_EMU_TYPE=qemu - -; ROS_EMU_PATH[LIN|WIN] -; -; This variable sets the path to the emulator (path to xm for xen [/usr/sbin]) -; -ROS_EMU_PATH_WIN=E:\reactos\qemu\qemu.exe -ROS_EMU_PATH_LIN=/usr/bin/qemu - -; ROS_HDD_IMAGE -; -; The hdd image to use for running the emulator. If this variable is not -; set, SysReg will create a HDD with name "ros.img" using the qemu-img tool. It will search -; this tool in the directory of emulator and abort if the tool cannot be found -;ROS_HDD_IMAGE=E:\reactos\qemu\ReactOS.hd - -; ROS_CD_IMAGE -; -; Set this variable if you want sysreg to perform a full ReactOS installation using -; an ReactOS unattended installation disk. If this variable is not set, SysReg lets the emulator boot -; from harddisk. -; - -;ROS_CD_IMAGE=E:\reactos\qemu\Reactos-Regtest.iso - -;------------------------------------------------------------------------------------------- -; Additional Options -; - -; ROS_MAX_TIME -; -; -; Set this variable to value which is the maximum time the emulator lets ReactOS run -; If not set, the emulator runs as long as no exception occurs in the emulator. -ROS_MAX_TIME=180 - -; ROS_LOG_FILE -; -; filename of log which receives all debugging data gained from the Emulator -; ROS_LOG_FILE=debug.log - -; ROS_SYM_DIR -; -; This directory sets the location where to search symbol files for modules -; In case of an BSOD, usermode exception, Sysreg will attempt to create a backtrace -; from the debugging data -; -; ROS_SYM_DIR=E:\reactos\output-i386 - -; ROS_DELAY_READ; -; -; When the emulator is started, it spends a little time loading and running through its -; BIOS. This time delays reading from the pipe/file untill the specified value. -; -; Note: set this value if you have problems with timeouts or cutoff debugging data -; -ROS_DELAY_READ=1 - -; ROS_CHECK_POINT -; -; RosBoot will stop executing when it finds a string in the form -; SYSREG_CHECKPOINT:YOUR_CHECKPOINT_NAME -; -;ROS_CHECK_POINT=YOUR_CHECKPOINT_NAME - -;ROS_CRITICAL_IMAGE -; -; If an user-mode exception occurs in an critical application, dll etc, i.e. setup.exe / explorer.exe, sysreg will report -; that the test has failed and quit debugging immediately -; -;ROS_CRITICAL_IMAGE=setup.exe userinit.exe smss.exe winlogon.exe csrss.exe explorer.exe - -; ROS_EMU_KILL -; -; Set this variable to true if you want SysReg to kill the emulator process when it has decided to exit. -; -; Note: Qemu>=0.9.0 has the option to shutdown on reboot (-no--reboot) -; -; ROS_EMU_KILL=yes - -; ROS_EMU_MEM -; -; Controls how much memory the emulator use for ReactOS -; -; ROS_EMU_MEM=64 - -; ROS_BOOT_CMD -; -; Sysreg normally builds the boot command from ROS_EMU_PATH and ROS_CD_IMAGE etc... If you want to override -; all settings set this value -; -; ROS_BOOT_CMD=/usr/bin/qemu -serial stdio -m 64 -hda ~/reactos/qemu/ReactOS.hd -boot d -cdrom ~/reactos/qemu/bootcd.iso -; -no-reboot - -; XEN_CONFIG_FILE -; -; Set this variable to path of xen config file when ROS_EMU_TYPE=xen is used -; XEN_CONFIG_FILE= - - -; XEN_CONFIG_NAME -; -; Set this variable to the name of xen station -; XEN_CONFIG_NAME=reactos diff --git a/reactos/tools/sysreg/user_types.h b/reactos/tools/sysreg/user_types.h deleted file mode 100644 index a1ed1870599..00000000000 --- a/reactos/tools/sysreg/user_types.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef USER_TYPES_H__ -#define USER_TYPES_H__ - -/* $Id$ - * - * PROJECT: System regression tool for ReactOS - * LICENSE: GPL - See COPYING in the top level directory - * FILE: tools/sysreg/user_types.h - * PURPOSE: user types - * PROGRAMMERS: Johannes Anderwald (johannes.anderwald at sbox tugraz at) - */ - -#include -#include - -#ifdef WIN32 -#define popen _popen -#define pclose _pclose -#endif - -typedef std::basic_string string; -typedef std::basic_istringstream istringstream; - -using std::cout; -using std::cerr; -using std::endl; - - -#endif // end of USER_TYPES_H__ diff --git a/reactos/tools/tools.rbuild b/reactos/tools/tools.rbuild index f4817fbf554..6b571e6c010 100644 --- a/reactos/tools/tools.rbuild +++ b/reactos/tools/tools.rbuild @@ -13,9 +13,6 @@ - - -