ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
January 2005
----- 2024 -----
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
28 participants
703 discussions
Start a n
N
ew thread
[arty] 12874: Reverted some local changes that aren't meant to be checked in yet.
by arty@svn.reactos.com
Reverted some local changes that aren't meant to be checked in yet. Modified: trunk/reactos/Makefile Modified: trunk/reactos/bootdata/txtsetup.sif _____ Modified: trunk/reactos/Makefile --- trunk/reactos/Makefile 2005-01-07 18:57:43 UTC (rev 12873) +++ trunk/reactos/Makefile 2005-01-07 19:16:19 UTC (rev 12874) @@ -38,7 +38,7 @@ # Filesystem libraries # vfatlib -LIB_FSLIB = vfatlib ext2lib +LIB_FSLIB = vfatlib # Static libraries LIB_STATIC = string rosrtl epsapi uuid libwine zlib rtl tgetopt pseh adns dxguid strmiids @@ -83,7 +83,7 @@ # Kernel mode file system drivers # cdfs ext2 fs_rec ms np vfat -FS_DRIVERS = cdfs fs_rec ms np vfat ext2 mup ntfs +FS_DRIVERS = cdfs fs_rec ms np vfat mup ntfs # Kernel mode networking drivers # afd ndis npf tcpip tdi wshtcpip _____ Modified: trunk/reactos/bootdata/txtsetup.sif --- trunk/reactos/bootdata/txtsetup.sif 2005-01-07 18:57:43 UTC (rev 12873) +++ trunk/reactos/bootdata/txtsetup.sif 2005-01-07 19:16:19 UTC (rev 12874) @@ -29,15 +29,14 @@ ntoskrnl.exe = 2 scsiport.sys = 3 vfatfs.sys = 3 -ext2.sys = 3 [Cabinets] Cabinet=reactos.cab [SetupData] DefaultPath = \ReactOS -;OsLoadOptions = "/NOGUIBOOT /NODEBUG" -OsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM1" +OsLoadOptions = "/NOGUIBOOT /NODEBUG" +;OsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM1" ;OsLoadOptions = "/NOGUIBOOT /DEBUGPORT=SCREEN" ;OsLoadOptions = "/NOGUIBOOT /DEBUGPORT=BOCHS"
19 years, 10 months
1
0
0
0
[arty] 12873: Spanish Keyboard Layout
by arty@svn.reactos.com
Spanish Keyboard Layout Contributed by HUMA2000 Modified: trunk/reactos/Makefile Modified: trunk/reactos/bootdata/packages/reactos.dff Modified: trunk/reactos/bootdata/txtsetup.sif Added: trunk/reactos/lib/kbdes/ Added: trunk/reactos/lib/kbdes/kbdes.c Added: trunk/reactos/lib/kbdes/kbdes.def Added: trunk/reactos/lib/kbdes/kbdes.rc _____ Modified: trunk/reactos/Makefile --- trunk/reactos/Makefile 2005-01-07 16:10:50 UTC (rev 12872) +++ trunk/reactos/Makefile 2005-01-07 18:57:43 UTC (rev 12873) @@ -38,13 +38,13 @@ # Filesystem libraries # vfatlib -LIB_FSLIB = vfatlib +LIB_FSLIB = vfatlib ext2lib # Static libraries LIB_STATIC = string rosrtl epsapi uuid libwine zlib rtl tgetopt pseh adns dxguid strmiids # Keyboard layout libraries -DLLS_KBD = kbdda kbddv kbdfr kbdgr kbdse kbduk kbdus +DLLS_KBD = kbdda kbddv kbdes kbdfr kbdgr kbdse kbduk kbdus # Control Panels DLLS_CPL = cpl @@ -83,7 +83,7 @@ # Kernel mode file system drivers # cdfs ext2 fs_rec ms np vfat -FS_DRIVERS = cdfs fs_rec ms np vfat mup ntfs +FS_DRIVERS = cdfs fs_rec ms np vfat ext2 mup ntfs # Kernel mode networking drivers # afd ndis npf tcpip tdi wshtcpip _____ Modified: trunk/reactos/bootdata/packages/reactos.dff --- trunk/reactos/bootdata/packages/reactos.dff 2005-01-07 16:10:50 UTC (rev 12872) +++ trunk/reactos/bootdata/packages/reactos.dff 2005-01-07 18:57:43 UTC (rev 12873) @@ -85,6 +85,7 @@ lib\iphlpapi\iphlpapi.dll 1 lib\kbdda\kbdda.dll 1 lib\kbddv\kbddv.dll 1 +lib\kbdes\kbdes.dll 1 lib\kbdfr\kbdfr.dll 1 lib\kbdgr\kbdgr.dll 1 lib\kbdse\kbdse.dll 1 _____ Modified: trunk/reactos/bootdata/txtsetup.sif --- trunk/reactos/bootdata/txtsetup.sif 2005-01-07 16:10:50 UTC (rev 12872) +++ trunk/reactos/bootdata/txtsetup.sif 2005-01-07 18:57:43 UTC (rev 12873) @@ -29,14 +29,15 @@ ntoskrnl.exe = 2 scsiport.sys = 3 vfatfs.sys = 3 +ext2.sys = 3 [Cabinets] Cabinet=reactos.cab [SetupData] DefaultPath = \ReactOS -OsLoadOptions = "/NOGUIBOOT /NODEBUG" -;OsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM1" +;OsLoadOptions = "/NOGUIBOOT /NODEBUG" +OsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM1" ;OsLoadOptions = "/NOGUIBOOT /DEBUGPORT=SCREEN" ;OsLoadOptions = "/NOGUIBOOT /DEBUGPORT=BOCHS" @@ -69,6 +70,7 @@ 00010409 = "English (USA-Dvorak)" 0000040C = "French (France)" 00000407 = "German (Germany)" +0000040A = "Spanish (traditional short)" 0000041D = "Swedish (Sweden)" [Files.KeyboardLayout] @@ -79,6 +81,7 @@ 0000040C = kbdfr.dll 0000041D = kbdse.dll 00000809 = kgbgb.dll +0000040A = kbdes.dll [Mouse] ;<id> = <user friendly name>,<spare>,<service key name> _____ Added: trunk/reactos/lib/kbdes/kbdes.c --- trunk/reactos/lib/kbdes/kbdes.c 2005-01-07 16:10:50 UTC (rev 12872) +++ trunk/reactos/lib/kbdes/kbdes.c 2005-01-07 18:57:43 UTC (rev 12873) @@ -0,0 +1,398 @@ + /* + * ReactOS ESASCII Keyboard layout + * Copyright (C) 2003 ReactOS + * License: LGPL, see: LGPL.txt + * Created by HUMA2000 from kbdus, kbdgr and kbdfr + * huma2000(a)terra.es + * + * Thanks to:
http://www.barcodeman.com/altek/mule/scandoc.php
+ * and
http://win.tue.nl/~aeb/linux/kbd/scancodes-1.html
+ */ + + #include <windows.h> + #include <internal/kbd.h> + #ifdef _M_IA64 + #define ROSDATA static __declspec(allocate(".data")) + #else + #pragma data_seg(".data") + #define ROSDATA static + #endif + + #define VK_EMPTY 0xff /* The non-existent VK */ + #define KSHIFT 0x001 /* Shift modifier */ + #define KCTRL 0x002 /* Ctrl modifier */ + #define KALT 0x004 /* Alt modifier */ + #define KEXT 0x100 /* Extended key code */ + #define KMULTI 0x200 /* Multi-key */ + #define KSPEC 0x400 /* Special key */ + #define KNUMP 0x800 /* Number-pad */ + #define KNUMS 0xc00 /* Special + number pad */ + #define KMEXT 0x300 /* Multi + ext */ + /* Thanks to
http://asp.flaaten.dk/pforum/keycode/keycode.htm
*/ + #ifndef VK_OEM_1 + #define VK_OEM_1 0xba + #endif + #ifndef VK_OEM_PLUS + #define VK_OEM_PLUS 0xbb + #endif + #ifndef VK_OEM_COMMA + #define VK_OEM_COMMA 0xbc + #endif + #ifndef VK_OEM_MINUS + #define VK_OEM_MINUS 0xbd + #endif + #ifndef VK_OEM_PERIOD + #define VK_OEM_PERIOD 0xbe + #endif + #ifndef VK_OEM_2 + #define VK_OEM_2 0xbf + #endif + #ifndef VK_OEM_3 + #define VK_OEM_3 0xc0 + #endif + #ifndef VK_OEM_4 + #define VK_OEM_4 0xdb + #endif + #ifndef VK_OEM_5 + #define VK_OEM_5 0xdc + #endif + #ifndef VK_OEM_6 + #define VK_OEM_6 0xdd + #endif + #ifndef VK_OEM_7 + #define VK_OEM_7 0xde + #endif + #ifndef VK_OEM_8 + #define VK_OEM_8 0xdf + #endif + #ifndef VK_OEM_102 + #define VK_OEM_102 0xe1 + #endif + #ifndef VK_acentos + #define VK_acentos 0x0e + #endif + + ROSDATA USHORT scancode_to_vk[] = { + /* Numbers Row */ + /* - 00 - */ + /* 1 ... 2 ... 3 ... 4 ... */ + VK_acentos, '1', '2', + '3', '4', '5', '6', + '7', '8', '9', '0', + VK_OEM_MINUS, VK_OEM_PLUS, VK_BACK, + /* - 0f - */ + /* First Letters Row */ + VK_TAB, 'Q', 'W', 'E', + 'R', 'T', 'Y', 'U', + 'I', 'O', 'P', + VK_OEM_4, VK_OEM_6, VK_RETURN, + /* - 1d - */ + /* Second Letters Row */ + VK_LCONTROL, + 'A', 'S', 'D', 'F', + 'G', 'H', 'J', 'K', + 'L', 'Ñ', VK_OEM_7, VK_OEM_3, + VK_LSHIFT, VK_OEM_5, + /* - 2c - */ + /* Third letters row */ + VK_OEM_102, 'Z', 'X', 'C', 'V', + 'B', 'N', 'M', VK_OEM_COMMA, + VK_OEM_PERIOD, VK_OEM_2, VK_RSHIFT, + /* - 37 - */ + /* Bottom Row */ + VK_MULTIPLY, VK_LMENU, VK_SPACE, VK_CAPITAL, + /* - 3b - */ + /* F-Keys */ + VK_ESCAPE, VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, + VK_F7, VK_F8, VK_F9, VK_F10, + /* - 45 - */ + /* Locks */ + VK_NUMLOCK | KMEXT, + VK_SCROLL | KMULTI, + /* - 47 - */ + /* Number-Pad */ + VK_HOME | KNUMS, VK_UP | KNUMS, VK_PRIOR | KNUMS, + VK_SUBTRACT, + VK_LEFT | KNUMS, VK_CLEAR | KNUMS, VK_RIGHT | KNUMS, VK_ADD, + VK_END | KNUMS, VK_DOWN | KNUMS, VK_NEXT | KNUMS, + VK_INSERT | KNUMS, VK_DELETE | KNUMS, + /* - 54 - */ + /* Presumably PrtSc */ + VK_SNAPSHOT, + /* - 55 - */ + /* Oddities, and the remaining standard F-Keys */ + VK_EMPTY, VK_EMPTY, VK_F11, VK_F12, + /* - 59 - */ + VK_CLEAR, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* + EREOF */ + VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* ZOOM */ + VK_HELP, + /* - 64 - */ + /* Even more F-Keys (for example, NCR keyboards from the early 90's) + */ + VK_F13, VK_F14, VK_F15, VK_F16, VK_F17, VK_F18, VK_F19, VK_F20, + VK_F21, VK_F22, VK_F23, + /* - 6f - */ + /* Not sure who uses these codes */ + VK_EMPTY, VK_EMPTY, VK_EMPTY, + /* - 72 - */ + VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, + /* - 76 - */ + /* One more f-key */ + VK_F24, + /* - 77 - */ + VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, + VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* PA1 */ + VK_EMPTY, + /* - 80 - */ + 0 + }; + ROSDATA VSC_VK extcode0_to_vk[] = { + { 0, 0 }, + }; + + ROSDATA VSC_VK extcode1_to_vk[] = { + { 0, 0 }, + }; + ROSDATA VK_TO_BIT modifier_keys[] = { + { VK_SHIFT, KSHIFT }, + { VK_CONTROL, KCTRL }, + { VK_MENU, KALT }, + { 0, 0 } + }; + + typedef struct _mymod { + PVOID mod_keys; + WORD maxmod; + BYTE mod_max[4]; + } INTERNAL_KBD_MODIFIERS; + ROSDATA INTERNAL_KBD_MODIFIERS modifier_bits[] = { + modifier_keys, + 3, + { 0, 1, 2, 3 } /* Modifier bit order, NONE, SHIFT, CTRL, ALT */ + }; + + #define NOCAPS 0 + #define CAPS KSHIFT /* Caps -> shift */ + ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[] = { + /* Normal vs Shifted */ + /* The numbers */ + //Del 1 al 5 tienen tres estados + { '4', NOCAPS, '4', '$' }, + //El 6 tiene 3 estados + { '7', NOCAPS, '7', '&' }, + { '8', NOCAPS, '8', '*' }, + { '9', NOCAPS, '9', '(' }, + { '0', NOCAPS, '0', ')' }, + /* First letter row */ + { 'Q', CAPS, 'q', 'Q' }, + { 'W', CAPS, 'w', 'W' }, + //La E tiene 3 estados + { 'R', CAPS, 'r', 'R' }, + { 'T', CAPS, 't', 'T' }, + { 'Y', CAPS, 'y', 'Y' }, + { 'U', CAPS, 'u', 'U' }, + { 'I', CAPS, 'i', 'I' }, + { 'O', CAPS, 'o', 'O' }, + { 'P', CAPS, 'p', 'P' }, + /* Second letter row */ + { 'A', CAPS, 'a', 'A' }, + { 'S', CAPS, 's', 'S' }, + { 'D', CAPS, 'd', 'D' }, + { 'F', CAPS, 'f', 'F' }, + { 'G', CAPS, 'g', 'G' }, + { 'H', CAPS, 'h', 'H' }, + { 'J', CAPS, 'j', 'J' }, + { 'K', CAPS, 'k', 'K' }, + { 'L', CAPS, 'l', 'L' }, + { 'Ñ', CAPS, 'ñ', 'Ñ' }, //No se si funcionara así + /* Third letter row */ + { 'Z', CAPS, 'z', 'Z' }, + { 'X', CAPS, 'x', 'X' }, + { 'C', CAPS, 'c', 'C' }, + { 'V', CAPS, 'v', 'V' }, + { 'B', CAPS, 'b', 'B' }, + { 'N', CAPS, 'n', 'N' }, + { 'M', CAPS, 'm', 'M' }, + + /* Specials */ + /* Ctrl-_ generates ES */ + { VK_OEM_PLUS ,NOCAPS, '=', '+' }, + { VK_OEM_1 ,NOCAPS, ';', ':' }, + { VK_OEM_COMMA ,NOCAPS, ',', ';' }, + { VK_OEM_PERIOD ,NOCAPS, '.', ':' }, + { VK_OEM_2 ,NOCAPS, '-', '_' }, + { VK_OEM_102 ,NOCAPS, '<', '>' }, + /* Keys that do not have shift states */ + { VK_TAB ,NOCAPS, '\t','\t'}, + { VK_ADD ,NOCAPS, '+', '+' }, + { VK_SUBTRACT,NOCAPS, '-', '-' }, + { VK_MULTIPLY,NOCAPS, '*', '*' }, + { VK_DIVIDE ,NOCAPS, '/', '/' }, + { VK_ESCAPE ,NOCAPS, '\x1b','\x1b' }, + { VK_SPACE ,NOCAPS, ' ', ' ' }, + { 0, 0 } + }; + + ROSDATA VK_TO_WCHARS3 key_to_chars_3mod[] = { + /* Normal, Shifted, Ctrl */ + /* Legacy (telnet-style) ascii escapes */ + { '1', NOCAPS, '1', '!', '|' }, // ¿Funcionara? + { '2', NOCAPS, '2', '"', '@' }, // ¿Funcionara? + { '3', NOCAPS, '3', '·','#' }, // ¿Funcionara? + { '5', NOCAPS, '5', '%', 0x20AC }, // añadir caracter EUR, asi no va a funcionar + { '6', NOCAPS, '6', '&', '¬' }, // ¿Funcionara? + { 'E', CAPS, 'e', 'E', 0x20AC }, // añadir caracter EUR, asi no va a funcionar + { VK_OEM_4, 0, '[', '{', 0x1b /* ESC */ }, + { VK_OEM_6, 0, ']', '}', 0x1d /* GS */ }, + { VK_OEM_5, 0, '\\','|', 0x1c /* FS */ }, + { VK_RETURN,0, '\r', '\r', '\n' }, + { VK_OEM_7 ,NOCAPS, '´','¨','{'}, // Tecla ¨ ´{ a ver si funciona + { VK_OEM_3 ,NOCAPS, 'ç', 'Ç', '}' }, // Tecla ç Ç } a ver si funciona + { VK_acentos ,NOCAPS, 'º', 'ª', '\\' }, // Tecla º ª \ a ver si funciona + { VK_OEM_MINUS, NOCAPS, 0x0027, '?' }, // Tecla ' ? a ver si funciona, no creo, debo definir ' de alguna otra manera + { VK_OEM_PLUS, NOCAPS, '¡', '¿' }, // Tecla ¡ ¿ a ver si funciona + { 0,0 } + }; + + ROSDATA VK_TO_WCHARS4 key_to_chars_4mod[] = { + /* Normal, Shifted, Ctrl, C-S-x */ + /* Legacy Ascii generators */ + { 0, 0 } + }; + ROSDATA VK_TO_WCHARS1 keypad_numbers[] = { + { VK_NUMPAD0, 0, '0' }, + { VK_NUMPAD1, 0, '1' }, + { VK_NUMPAD2, 0, '2' }, + { VK_NUMPAD3, 0, '3' }, + { VK_NUMPAD4, 0, '4' }, + { VK_NUMPAD5, 0, '5' }, + { VK_NUMPAD6, 0, '6' }, + { VK_NUMPAD7, 0, '7' }, + { VK_NUMPAD8, 0, '8' }, + { VK_NUMPAD9, 0, '9' }, + { VK_DECIMAL, 0, '.' }, + { VK_BACK, 0, '\010' }, + { 0,0 } + }; + + #define vk_master(n,x) { (PVK_TO_WCHARS1)x, n, sizeof(x[0]) } + ROSDATA VK_TO_WCHAR_TABLE vk_to_wchar_master_table[] = { + vk_master(1,keypad_numbers), + vk_master(2,key_to_chars_2mod), + vk_master(3,key_to_chars_3mod), + vk_master(4,key_to_chars_4mod), + { 0,0,0 } + }; + + ROSDATA VSC_LPWSTR key_names[] = { + { 0x00, L"" }, + { 0x01, L"Esc" }, + { 0x0e, L"Backspace" }, + { 0x0f, L"Tab" }, + { 0x1c, L"Enter" }, + { 0x1d, L"Ctrl" }, + { 0x2a, L"Shift" }, + { 0x36, L"Right Shift" }, + { 0x37, L"Num *" }, + { 0x38, L"Alt" }, + { 0x39, L"Space" }, + { 0x3a, L"Caps Lock" }, + { 0x3b, L"F1" }, + { 0x3c, L"F2" }, + { 0x3d, L"F3" }, + { 0x3e, L"F4" }, + { 0x3f, L"F5" }, + { 0x40, L"F6" }, + { 0x41, L"F7" }, + { 0x42, L"F8" }, + { 0x43, L"F9" }, + { 0x44, L"F10" }, + { 0x45, L"Pause" }, + { 0x46, L"Scroll Lock" }, + { 0x47, L"Num 7" }, + { 0x48, L"Num 8" }, + { 0x49, L"Num 9" }, + { 0x4a, L"Num -" }, + { 0x4b, L"Num 4" }, + { 0x4c, L"Num 5" }, + { 0x4d, L"Num 6" }, + { 0x4e, L"Num +" }, + { 0x4f, L"Num 1" }, + { 0x50, L"Num 2" }, + { 0x51, L"Num 3" }, + { 0x52, L"Num 0" }, + { 0x53, L"Num Del" }, + { 0x54, L"Sys Req" }, + { 0x57, L"F11" }, + { 0x58, L"F12" }, + { 0x7c, L"F13" }, + { 0x7d, L"F14" }, + { 0x7e, L"F15" }, + { 0x7f, L"F16" }, + { 0x80, L"F17" }, + { 0x81, L"F18" }, + { 0x82, L"F19" }, + { 0x83, L"F20" }, + { 0x84, L"F21" }, + { 0x85, L"F22" }, + { 0x86, L"F23" }, + { 0x87, L"F24" }, + { 0, NULL }, + }; + ROSDATA VSC_LPWSTR extended_key_names[] = { + { 0x1c, L"Num Enter" }, + { 0x1d, L"Right Ctrl" }, + { 0x35, L"Num /" }, + { 0x37, L"Prnt Scrn" }, + { 0x38, L"Right Alt" }, + { 0x45, L"Num Lock" }, + { 0x46, L"Break" }, + { 0x47, L"Home" }, + { 0x48, L"Up" }, + { 0x49, L"Page Up" }, + { 0x4a, L"Left" }, + { 0x4c, L"Center" }, + { 0x4d, L"Right" }, + { 0x4f, L"End" }, + { 0x50, L"Down" }, + { 0x51, L"Page Down" }, + { 0x52, L"Insert" }, + { 0x53, L"Delete" }, + { 0x54, L"<ReactOS>" }, + { 0x55, L"Help" }, + { 0x56, L"Left Windows" }, + { 0x5b, L"Right Windows" }, + { 0, NULL }, + }; + + /* Finally, the master table */ + ROSDATA KBDTABLES keyboard_layout_table = { + /* modifier assignments */ + (PMODIFIERS)&modifier_bits, + /* character from vk tables */ + vk_to_wchar_master_table, + + /* diacritical marks -- currently implemented by wine code */ + /* English doesn't have any, anyway */ + NULL, + /* Key names */ + (VSC_LPWSTR *)key_names, + (VSC_LPWSTR *)extended_key_names, + NULL, /* Dead key names */ + + /* scan code to virtual key maps */ + scancode_to_vk, + sizeof(scancode_to_vk) / sizeof(scancode_to_vk[0]), + extcode0_to_vk, + extcode1_to_vk, + MAKELONG(0,1), /* Version 1.0 */ + + /* Ligatures -- Spanish doesn't have any */ + 0, + 0, + NULL + }; + PKBDTABLES STDCALL KbdLayerDescriptor() { + return &keyboard_layout_table; + } _____ Added: trunk/reactos/lib/kbdes/kbdes.def --- trunk/reactos/lib/kbdes/kbdes.def 2005-01-07 16:10:50 UTC (rev 12872) +++ trunk/reactos/lib/kbdes/kbdes.def 2005-01-07 18:57:43 UTC (rev 12873) @@ -0,0 +1,3 @@ +LIBRARY kbdda.dll +EXPORTS +KbdLayerDescriptor@0 _____ Added: trunk/reactos/lib/kbdes/kbdes.rc --- trunk/reactos/lib/kbdes/kbdes.rc 2005-01-07 16:10:50 UTC (rev 12872) +++ trunk/reactos/lib/kbdes/kbdes.rc 2005-01-07 18:57:43 UTC (rev 12873) @@ -0,0 +1,5 @@ +#define REACTOS_VERSION_DLL +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Spanish Keyboard Layout\0" +#define REACTOS_STR_INTERNAL_NAME "kbdes\0" +#define REACTOS_STR_ORIGINAL_FILENAME "kbdes.dll\0" +#include <reactos/version.rc>
19 years, 10 months
1
0
0
0
[ion] 12872: Move ke/zw.c to ex/zw.c
by ion@svn.reactos.com
Move ke/zw.c to ex/zw.c Modified: trunk/reactos/iface/native/makefile Modified: trunk/reactos/ntoskrnl/Makefile _____ Modified: trunk/reactos/iface/native/makefile --- trunk/reactos/iface/native/makefile 2005-01-07 16:10:48 UTC (rev 12871) +++ trunk/reactos/iface/native/makefile 2005-01-07 16:10:50 UTC (rev 12872) @@ -14,7 +14,7 @@ SYSTEM_CALLS_DB = sysfuncs.lst NTDLL_STUBS = ../../lib/ntdll/napi.c KERNEL_SERVICE_TABLE = ../../include/ntdll/napi.h -KERNEL_ZW_CALLS = ../../ntoskrnl/ke/zw.c +KERNEL_ZW_CALLS = ../../ntoskrnl/ex/zw.c NAPI_FILES = $(NTDLL_STUBS) $(KERNEL_SERVICE_TABLE) $(KERNEL_ZW_CALLS) BASE_CFLAGS = -I../../include _____ Modified: trunk/reactos/ntoskrnl/Makefile --- trunk/reactos/ntoskrnl/Makefile 2005-01-07 16:10:48 UTC (rev 12871) +++ trunk/reactos/ntoskrnl/Makefile 2005-01-07 16:10:50 UTC (rev 12872) @@ -121,7 +121,6 @@ ke/spinlock.o \ ke/timer.o \ ke/wait.o \ - ke/zw.o # Memory Manager (Mm) OBJECTS_MM = \ @@ -270,7 +269,8 @@ ex/uuid.o \ ex/win32k.o \ ex/work.o \ - ex/zone.o + ex/zone.o \ + ex/zw.o # Installable File System Run-Time Library (FsRtl) OBJECTS_FS = \
19 years, 10 months
1
0
0
0
[blight] 12871: modified include/ntos/zwtypes.h Add SYSTEM_BATTERY_STATE from w32api.
by blight@svn.reactos.com
modified include/ntos/zwtypes.h Add SYSTEM_BATTERY_STATE from w32api. modified ntoskrnl/include/internal/mm.h Add MmAllocPagesSpecifyRange (internal function) modified ntoskrnl/mm/freelist.c Add MmAllocPagesSpecifyRange function (used by MmAllocatePagesForMdl) modified ntoskrnl/mm/mdl.c Implemenet MmAllocatePagesForMdl, MmFreePagesFromMdl. Turn MmMapLockedPages into MmMapLockedPagesSpecifyCache (and make MmMapLockedPages a wrapper to it). modified ntoskrnl/po/power.c Implement SystemBatteryState in NtPowerInformation (Thanks to Alex for testing the returned values on his windows desktop PC) Windows 2000 NVIDIA driver should work now. Modified: trunk/reactos/include/ntos/zwtypes.h Modified: trunk/reactos/ntoskrnl/include/internal/mm.h Modified: trunk/reactos/ntoskrnl/mm/freelist.c Modified: trunk/reactos/ntoskrnl/mm/mdl.c Modified: trunk/reactos/ntoskrnl/po/power.c _____ Modified: trunk/reactos/include/ntos/zwtypes.h --- trunk/reactos/include/ntos/zwtypes.h 2005-01-07 15:36:40 UTC (rev 12870) +++ trunk/reactos/include/ntos/zwtypes.h 2005-01-07 16:10:48 UTC (rev 12871) @@ -1666,6 +1666,22 @@ } OBJECT_DIRECTORY_INFORMATION, *POBJECT_DIRECTORY_INFORMATION; +/* system battery state */ +typedef struct _SYSTEM_BATTERY_STATE { + BOOLEAN AcOnLine; + BOOLEAN BatteryPresent; + BOOLEAN Charging; + BOOLEAN Discharging; + BOOLEAN Spare1[4]; + ULONG MaxCapacity; + ULONG RemainingCapacity; + ULONG Rate; + ULONG EstimatedTime; + ULONG DefaultAlert1; + ULONG DefaultAlert2; +} SYSTEM_BATTERY_STATE, *PSYSTEM_BATTERY_STATE; + + // power information levels typedef enum _POWER_INFORMATION_LEVEL { SystemPowerPolicyAc, _____ Modified: trunk/reactos/ntoskrnl/include/internal/mm.h --- trunk/reactos/ntoskrnl/include/internal/mm.h 2005-01-07 15:36:40 UTC (rev 12870) +++ trunk/reactos/ntoskrnl/include/internal/mm.h 2005-01-07 16:10:48 UTC (rev 12871) @@ -697,6 +697,12 @@ PFN_TYPE MmAllocPage(ULONG Consumer, SWAPENTRY SavedSwapEntry); +LONG MmAllocPagesSpecifyRange(ULONG Consumer, + PHYSICAL_ADDRESS LowestAddress, + PHYSICAL_ADDRESS HighestAddress, + ULONG NumberOfPages, + PPFN_TYPE Pages); + VOID MmDereferencePage(PFN_TYPE Page); VOID MmReferencePage(PFN_TYPE Page); _____ Modified: trunk/reactos/ntoskrnl/mm/freelist.c --- trunk/reactos/ntoskrnl/mm/freelist.c 2005-01-07 15:36:40 UTC (rev 12870) +++ trunk/reactos/ntoskrnl/mm/freelist.c 2005-01-07 16:10:48 UTC (rev 12871) @@ -897,7 +897,155 @@ return PfnOffset; } +LONG +MmAllocPagesSpecifyRange(ULONG Consumer, + PHYSICAL_ADDRESS LowestAddress, + PHYSICAL_ADDRESS HighestAddress, + ULONG NumberOfPages, + PPFN_TYPE Pages) +{ + PPHYSICAL_PAGE PageDescriptor; + KIRQL oldIrql; + PFN_TYPE LowestPage, HighestPage; + PFN_TYPE pfn; + ULONG NumberOfPagesFound = 0; + ULONG i; + DPRINT("MmAllocPagesSpecifyRange()\n" + " LowestAddress = 0x%08x%08x\n" + " HighestAddress = 0x%08x%08x\n" + " NumberOfPages = %d\n", + LowestAddress.u.HighPart, LowestAddress.u.LowPart, + HighestAddress.u.HighPart, HighestAddress.u.LowPart, + NumberOfPages); + + if (NumberOfPages == 0) + return 0; + + LowestPage = LowestAddress.QuadPart / PAGE_SIZE; + HighestPage = HighestAddress.QuadPart / PAGE_SIZE; + if ((HighestAddress.u.LowPart % PAGE_SIZE) != 0) + HighestPage++; + + if (LowestPage >= MmPageArraySize) + { + DPRINT1("MmAllocPagesSpecifyRange(): Out of memory\n"); + return -1; + } + if (HighestPage > MmPageArraySize) + HighestPage = MmPageArraySize; + + KeAcquireSpinLock(&PageListLock, &oldIrql); + if (LowestPage == 0 && HighestPage == MmPageArraySize) + { + PLIST_ENTRY ListEntry; + while (NumberOfPagesFound < NumberOfPages) + { + if (!IsListEmpty(&FreeZeroedPageListHead)) + { + ListEntry = RemoveTailList(&FreeZeroedPageListHead); + } + else if (!IsListEmpty(&FreeUnzeroedPageListHead)) + { + ListEntry = RemoveTailList(&FreeUnzeroedPageListHead); + UnzeroedPageCount--; + } + else + { + if (NumberOfPagesFound == 0) + { + KeReleaseSpinLock(&PageListLock, oldIrql); + DPRINT1("MmAllocPagesSpecifyRange(): Out of memory\n"); + return -1; + } + else + { + break; + } + } + PageDescriptor = CONTAINING_RECORD(ListEntry, PHYSICAL_PAGE, ListEntry); + + ASSERT(PageDescriptor->Flags.Type == MM_PHYSICAL_PAGE_FREE); + ASSERT(PageDescriptor->MapCount == 0); + ASSERT(PageDescriptor->ReferenceCount == 0); + + /* Allocate the page */ + PageDescriptor->Flags.Type = MM_PHYSICAL_PAGE_USED; + PageDescriptor->Flags.Consumer = Consumer; + PageDescriptor->ReferenceCount = 1; + PageDescriptor->LockCount = 0; + PageDescriptor->MapCount = 0; + PageDescriptor->SavedSwapEntry = 0; /* FIXME: Do we need swap entries? */ + InsertTailList(&UsedPageListHeads[Consumer], &PageDescriptor->ListEntry); + + MmStats.NrSystemPages++; + MmStats.NrFreePages--; + + /* Remember the page */ + pfn = PageDescriptor - MmPageArray; + Pages[NumberOfPagesFound++] = pfn; + } + } + else + { + INT LookForZeroedPages; + for (LookForZeroedPages = 1; LookForZeroedPages >= 0; LookForZeroedPages--) + { + for (pfn = LowestPage; pfn < HighestPage; pfn++) + { + PageDescriptor = MmPageArray + pfn; + + if (PageDescriptor->Flags.Type != MM_PHYSICAL_PAGE_FREE) + continue; + if (PageDescriptor->Flags.Zero != LookForZeroedPages) + continue; + + ASSERT(PageDescriptor->MapCount == 0); + ASSERT(PageDescriptor->ReferenceCount == 0); + + /* Allocate the page */ + PageDescriptor->Flags.Type = MM_PHYSICAL_PAGE_USED; + PageDescriptor->Flags.Consumer = Consumer; + PageDescriptor->ReferenceCount = 1; + PageDescriptor->LockCount = 0; + PageDescriptor->MapCount = 0; + PageDescriptor->SavedSwapEntry = 0; /* FIXME: Do we need swap entries? */ + RemoveEntryList(&PageDescriptor->ListEntry); + InsertTailList(&UsedPageListHeads[Consumer], &PageDescriptor->ListEntry); + + if (!PageDescriptor->Flags.Zero) + UnzeroedPageCount--; + MmStats.NrSystemPages++; + MmStats.NrFreePages--; + + /* Remember the page */ + Pages[NumberOfPagesFound++] = pfn; + if (NumberOfPagesFound == NumberOfPages) + break; + } + if (NumberOfPagesFound == NumberOfPages) + break; + } + } + KeReleaseSpinLock(&PageListLock, oldIrql); + + /* Zero unzero-ed pages */ + for (i = 0; i < NumberOfPagesFound; i++) + { + pfn = Pages[i]; + if (MmPageArray[pfn].Flags.Zero == 0) + { + MiZeroPage(pfn); + } + else + { + MmPageArray[pfn].Flags.Zero = 0; + } + } + + return NumberOfPagesFound; +} + NTSTATUS STDCALL MmZeroPageThreadMain(PVOID Ignored) { _____ Modified: trunk/reactos/ntoskrnl/mm/mdl.c --- trunk/reactos/ntoskrnl/mm/mdl.c 2005-01-07 15:36:40 UTC (rev 12870) +++ trunk/reactos/ntoskrnl/mm/mdl.c 2005-01-07 16:10:48 UTC (rev 12871) @@ -40,6 +40,7 @@ /* FUNCTIONS *****************************************************************/ + /* * @unimplemented */ @@ -54,6 +55,7 @@ return STATUS_NOT_IMPLEMENTED; } + VOID INIT_FUNCTION MmInitializeMdlImplementation(VOID) { @@ -92,6 +94,7 @@ KeInitializeSpinLock(&MiMdlMappingRegionLock); } + PVOID MmGetMdlPageAddress(PMDL Mdl, PVOID Offset) { @@ -170,154 +173,7 @@ } - /* - * @implemented - */ -PVOID STDCALL -MmMapLockedPages(PMDL Mdl, KPROCESSOR_MODE AccessMode) -/* - * FUNCTION: Maps the physical pages described by a given MDL - * ARGUMENTS: - * Mdl = Points to an MDL updated by MmProbeAndLockPages, MmBuildMdlForNonPagedPool - * or IoBuildPartialMdl. - * AccessMode = Specifies the portion of the address space to map the - * pages. - * RETURNS: The base virtual address that maps the locked pages for the - * range described by the MDL - * - * If mapping into user space, pages are mapped into current address space. - */ -{ - PVOID Base; - PULONG MdlPages; - KIRQL oldIrql; - ULONG PageCount; - ULONG StartingOffset; - PEPROCESS CurrentProcess; - NTSTATUS Status; - - DPRINT("MmMapLockedPages(Mdl %x, AccessMode %x)\n", Mdl, AccessMode); - - /* Calculate the number of pages required. */ - PageCount = PAGE_ROUND_UP(Mdl->ByteCount + Mdl->ByteOffset) / PAGE_SIZE; - - if (AccessMode == UserMode) - { - MEMORY_AREA *Result; - LARGE_INTEGER BoundaryAddressMultiple; - NTSTATUS Status; - - /* pretty sure you can't map partial mdl's to user space */ - ASSERT(!(Mdl->MdlFlags & MDL_PARTIAL)); - - BoundaryAddressMultiple.QuadPart = 0; - Base = NULL; - - CurrentProcess = PsGetCurrentProcess(); - - MmLockAddressSpace(&CurrentProcess->AddressSpace); - Status = MmCreateMemoryArea(CurrentProcess, - &CurrentProcess->AddressSpace, - MEMORY_AREA_MDL_MAPPING, - &Base, - PageCount * PAGE_SIZE, - 0, /* PAGE_READWRITE? */ - &Result, - FALSE, - FALSE, - BoundaryAddressMultiple); - MmUnlockAddressSpace(&CurrentProcess->AddressSpace); - if (!NT_SUCCESS(Status)) - { - if (Mdl->MdlFlags & MDL_MAPPING_CAN_FAIL) - { - return NULL; - } - - KEBUGCHECK(0); - /* FIXME: handle this? */ - } - - Mdl->Process = CurrentProcess; - } - else /* if (AccessMode == KernelMode) */ - { - /* can't map mdl twice */ - ASSERT(!(Mdl->MdlFlags & (MDL_MAPPED_TO_SYSTEM_VA|MDL_PARTIAL_HAS_BEEN_MAPPED))); - /* can't map mdl buildt from non paged pool into kernel space */ - ASSERT(!(Mdl->MdlFlags & (MDL_SOURCE_IS_NONPAGED_POOL))); - - CurrentProcess = NULL; - - /* Allocate that number of pages from the mdl mapping region. */ - KeAcquireSpinLock(&MiMdlMappingRegionLock, &oldIrql); - - StartingOffset = RtlFindClearBitsAndSet(&MiMdlMappingRegionAllocMap, PageCount, MiMdlMappingRegionHint); - - if (StartingOffset == 0xffffffff) - { - KeReleaseSpinLock(&MiMdlMappingRegionLock, oldIrql); - - DPRINT1("Out of MDL mapping space\n"); - - if (Mdl->MdlFlags & MDL_MAPPING_CAN_FAIL) - { - return NULL; - } - - KEBUGCHECK(0); - } - - Base = (PVOID)((ULONG_PTR)MiMdlMappingRegionBase + StartingOffset * PAGE_SIZE); - - if (MiMdlMappingRegionHint == StartingOffset) - { - MiMdlMappingRegionHint += PageCount; - } - - KeReleaseSpinLock(&MiMdlMappingRegionLock, oldIrql); - } - - - - /* Set the virtual mappings for the MDL pages. */ - MdlPages = (PULONG)(Mdl + 1); - - Status = MmCreateVirtualMapping(CurrentProcess, - Base, - PAGE_READWRITE, - MdlPages, - PageCount); - if (!NT_SUCCESS(Status)) - { - DbgPrint("Unable to create virtual mapping\n"); - if (Mdl->MdlFlags & MDL_MAPPING_CAN_FAIL) - { - return NULL; - } - KEBUGCHECK(0); - } - - /* Mark the MDL has having being mapped. */ - if (AccessMode == KernelMode) - { - if (Mdl->MdlFlags & MDL_PARTIAL) - { - Mdl->MdlFlags |= MDL_PARTIAL_HAS_BEEN_MAPPED; - } - else - { - Mdl->MdlFlags |= MDL_MAPPED_TO_SYSTEM_VA; - } - Mdl->MappedSystemVa = (char*)Base + Mdl->ByteOffset; - } - - return((char*)Base + Mdl->ByteOffset); -} - - -/* * @unimplemented */ PVOID @@ -333,6 +189,7 @@ return 0; } + /* * @implemented */ @@ -423,6 +280,7 @@ } + /* * @unimplemented */ @@ -447,6 +305,7 @@ Mdl->MdlFlags |= MDL_IO_PAGE_READ; } + /* * @unimplemented */ @@ -461,6 +320,7 @@ return STATUS_NOT_IMPLEMENTED; } + /* * @unimplemented */ @@ -477,7 +337,7 @@ /* - * @unimplemented + * @implemented */ VOID STDCALL MmProbeAndLockPages (PMDL Mdl, KPROCESSOR_MODE AccessMode, @@ -603,6 +463,7 @@ Mdl->MdlFlags |= MDL_PAGES_LOCKED; } + /* * @unimplemented */ @@ -618,6 +479,7 @@ UNIMPLEMENTED; } + /* * @unimplemented */ @@ -633,6 +495,7 @@ UNIMPLEMENTED; } + /* * @implemented */ @@ -732,6 +595,7 @@ return(Mdl); } + /* * @unimplemented */ @@ -745,8 +609,9 @@ UNIMPLEMENTED; } + /* - * @unimplemented + * @implemented */ PMDL STDCALL MmAllocatePagesForMdl ( IN PHYSICAL_ADDRESS LowAddress, @@ -776,15 +641,61 @@ */ + PMDL Mdl; + PPFN_TYPE Pages; + ULONG NumberOfPagesWanted, NumberOfPagesAllocated; + ULONG Ret; + + DPRINT("MmAllocatePagesForMdl - LowAddress = 0x%I64x, HighAddress = 0x%I64x, " + "SkipBytes = 0x%I64x, Totalbytes = 0x%x\n", + LowAddress.QuadPart, HighAddress.QuadPart, + SkipBytes.QuadPart, Totalbytes); + /* SkipBytes must be a multiple of the page size */ ASSERT((SkipBytes.QuadPart % PAGE_SIZE) == 0); - - UNIMPLEMENTED; - return(NULL); + + /* Allocate memory for the MDL */ + Mdl = MmCreateMdl(NULL, 0, Totalbytes); + if (Mdl == NULL) + { + return NULL; + } + + /* Allocate pages into the MDL */ + NumberOfPagesAllocated = 0; + NumberOfPagesWanted = PAGE_ROUND_UP(Mdl->ByteCount + Mdl->ByteOffset) / PAGE_SIZE; + Pages = (PPFN_TYPE)(Mdl + 1); + while (NumberOfPagesWanted > 0) + { + Ret = MmAllocPagesSpecifyRange( + MC_NPPOOL, + LowAddress, + HighAddress, + NumberOfPagesWanted, + Pages + NumberOfPagesAllocated); + if (Ret == -1) + break; + + NumberOfPagesAllocated += Ret; + NumberOfPagesWanted -= Ret; + + if (SkipBytes.QuadPart == 0) + break; + LowAddress.QuadPart += SkipBytes.QuadPart; + HighAddress.QuadPart += SkipBytes.QuadPart; + } + + if (NumberOfPagesAllocated == 0) + { + ExFreePool(Mdl); + Mdl = NULL; + } + return Mdl; } + /* - * @unimplemented + * @implemented */ VOID STDCALL MmFreePagesFromMdl ( IN PMDL Mdl ) @@ -801,12 +712,21 @@ Konstantin Gusev */ - - UNIMPLEMENTED; + PPFN_TYPE Pages; + LONG NumberOfPages; + + NumberOfPages = PAGE_ROUND_UP(Mdl->ByteCount + Mdl->ByteOffset) / PAGE_SIZE; + Pages = (PPFN_TYPE)(Mdl + 1); + + while (--NumberOfPages >= 0) + { + MmDereferencePage(Pages[NumberOfPages]); + } } + /* - * @unimplemented + * @implemented */ PVOID STDCALL MmMapLockedPagesSpecifyCache ( IN PMDL Mdl, @@ -814,12 +734,184 @@ IN MEMORY_CACHING_TYPE CacheType, IN PVOID BaseAddress, IN ULONG BugCheckOnFailure, - IN MM_PAGE_PRIORITY Priority ) + IN MM_PAGE_PRIORITY Priority) { - UNIMPLEMENTED; - return MmMapLockedPages (Mdl, AccessMode); + PVOID Base; + PULONG MdlPages; + KIRQL oldIrql; + ULONG PageCount; + ULONG StartingOffset; + PEPROCESS CurrentProcess; + NTSTATUS Status; + ULONG Protect; + + DPRINT("MmMapLockedPagesSpecifyCache(Mdl 0x%x, AccessMode 0x%x, CacheType 0x%x, " + "BaseAddress 0x%x, BugCheckOnFailure 0x%x, Priority 0x%x)\n", + Mdl, AccessMode, CacheType, BaseAddress, BugCheckOnFailure, Priority); + + /* FIXME: Implement Priority */ + (void) Priority; + + /* Calculate the number of pages required. */ + PageCount = PAGE_ROUND_UP(Mdl->ByteCount + Mdl->ByteOffset) / PAGE_SIZE; + + if (AccessMode == UserMode) + { + MEMORY_AREA *Result; + LARGE_INTEGER BoundaryAddressMultiple; + NTSTATUS Status; + + /* pretty sure you can't map partial mdl's to user space */ + ASSERT(!(Mdl->MdlFlags & MDL_PARTIAL)); + + BoundaryAddressMultiple.QuadPart = 0; + Base = BaseAddress; + + CurrentProcess = PsGetCurrentProcess(); + + MmLockAddressSpace(&CurrentProcess->AddressSpace); + Status = MmCreateMemoryArea(CurrentProcess, + &CurrentProcess->AddressSpace, + MEMORY_AREA_MDL_MAPPING, + &Base, + PageCount * PAGE_SIZE, + 0, /* PAGE_READWRITE? */ + &Result, + (Base != NULL), + FALSE, + BoundaryAddressMultiple); + MmUnlockAddressSpace(&CurrentProcess->AddressSpace); + if (!NT_SUCCESS(Status)) + { + if (Mdl->MdlFlags & MDL_MAPPING_CAN_FAIL) + { + return NULL; + } + + /* FIXME: Raise an exception instead of bugchecking */ + KEBUGCHECK(0); + } + + Mdl->Process = CurrentProcess; + } + else /* if (AccessMode == KernelMode) */ + { + /* can't map mdl twice */ + ASSERT(!(Mdl->MdlFlags & (MDL_MAPPED_TO_SYSTEM_VA|MDL_PARTIAL_HAS_BEEN_MAPPED))); + /* can't map mdl buildt from non paged pool into kernel space */ + ASSERT(!(Mdl->MdlFlags & (MDL_SOURCE_IS_NONPAGED_POOL))); + + CurrentProcess = NULL; + + /* Allocate that number of pages from the mdl mapping region. */ + KeAcquireSpinLock(&MiMdlMappingRegionLock, &oldIrql); + + StartingOffset = RtlFindClearBitsAndSet(&MiMdlMappingRegionAllocMap, PageCount, MiMdlMappingRegionHint); + + if (StartingOffset == 0xffffffff) + { + KeReleaseSpinLock(&MiMdlMappingRegionLock, oldIrql); + + DPRINT1("Out of MDL mapping space\n"); + + if ((Mdl->MdlFlags & MDL_MAPPING_CAN_FAIL) || !BugCheckOnFailure) + { + return NULL; + } + + KEBUGCHECK(0); + } + + Base = (PVOID)((ULONG_PTR)MiMdlMappingRegionBase + StartingOffset * PAGE_SIZE); + + if (MiMdlMappingRegionHint == StartingOffset) + { + MiMdlMappingRegionHint += PageCount; + } + + KeReleaseSpinLock(&MiMdlMappingRegionLock, oldIrql); + } + + /* Set the virtual mappings for the MDL pages. */ + MdlPages = (PULONG)(Mdl + 1); + + Protect = PAGE_READWRITE; + if (CacheType == MmNonCached) + Protect |= PAGE_NOCACHE; + else if (CacheType == MmWriteCombined) + DPRINT("CacheType MmWriteCombined not supported!\n"); + Status = MmCreateVirtualMapping(CurrentProcess, + Base, + Protect, + MdlPages, + PageCount); + if (!NT_SUCCESS(Status)) + { + DbgPrint("Unable to create virtual mapping\n"); + if (Mdl->MdlFlags & MDL_MAPPING_CAN_FAIL) + { + return NULL; + } + if (AccessMode == UserMode) + { + /* FIXME: Raise an exception */ + return NULL; + } + else /* AccessMode == KernelMode */ + { + if (!BugCheckOnFailure) + return NULL; + + /* FIXME: Use some bugcheck code instead of 0 */ + KEBUGCHECK(0); + } + } + + /* Mark the MDL has having being mapped. */ + if (AccessMode == KernelMode) + { + if (Mdl->MdlFlags & MDL_PARTIAL) + { + Mdl->MdlFlags |= MDL_PARTIAL_HAS_BEEN_MAPPED; + } + else + { + Mdl->MdlFlags |= MDL_MAPPED_TO_SYSTEM_VA; + } + Mdl->MappedSystemVa = (char*)Base + Mdl->ByteOffset; + } + + return((char*)Base + Mdl->ByteOffset); } + +/* + * @implemented + */ +PVOID STDCALL +MmMapLockedPages(PMDL Mdl, KPROCESSOR_MODE AccessMode) +/* + * FUNCTION: Maps the physical pages described by a given MDL + * ARGUMENTS: + * Mdl = Points to an MDL updated by MmProbeAndLockPages, MmBuildMdlForNonPagedPool, + * MmAllocatePagesForMdl or IoBuildPartialMdl. + * AccessMode = Specifies the portion of the address space to map the + * pages. + * RETURNS: The base virtual address that maps the locked pages for the + * range described by the MDL + * + * If mapping into user space, pages are mapped into current address space. + */ +{ + return MmMapLockedPagesSpecifyCache(Mdl, + AccessMode, + MmCached, + NULL, + TRUE, + NormalPagePriority); +} + + /* EOF */ _____ Modified: trunk/reactos/ntoskrnl/po/power.c --- trunk/reactos/ntoskrnl/po/power.c 2005-01-07 15:36:40 UTC (rev 12870) +++ trunk/reactos/ntoskrnl/po/power.c 2005-01-07 16:10:48 UTC (rev 12871) @@ -245,8 +245,41 @@ IN ULONG OutputBufferLength ) { - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; + NTSTATUS Status; + + DPRINT("NtPowerInformation(PowerInformationLevel 0x%x, InputBuffer 0x%x, " + "InputBufferLength 0x%x, OutputBuffer 0x%x, OutputBufferLength 0x%x)\n", + PowerInformationLevel, + InputBuffer, InputBufferLength, + OutputBuffer, OutputBufferLength); + switch (PowerInformationLevel) + { + case SystemBatteryState: + { + PSYSTEM_BATTERY_STATE BatteryState = (PSYSTEM_BATTERY_STATE)OutputBuffer; + + if (InputBuffer != NULL) + return STATUS_INVALID_PARAMETER; + if (OutputBufferLength < sizeof(SYSTEM_BATTERY_STATE)) + return STATUS_BUFFER_TOO_SMALL; + + /* Just zero the struct (and thus set BatteryState->BatteryPresent = FALSE) */ + RtlZeroMemory(BatteryState, sizeof(SYSTEM_BATTERY_STATE)); + BatteryState->EstimatedTime = (ULONG)-1; + + Status = STATUS_SUCCESS; + break; + } + + default: + Status = STATUS_NOT_IMPLEMENTED; + DPRINT1("PowerInformationLevel 0x%x is UNIMPLEMENTED! Have a nice day.\n", + PowerInformationLevel); + for (;;); + break; + } + + return Status; } /* EOF */
19 years, 10 months
1
0
0
0
[mf] 12870: fix case of XML.o
by mf@svn.reactos.com
fix case of XML.o Modified: branches/xmlbuildsystem/reactos/tools/rbuild/makefile _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/makefile --- branches/xmlbuildsystem/reactos/tools/rbuild/makefile 2005-01-07 15:07:52 UTC (rev 12869) +++ branches/xmlbuildsystem/reactos/tools/rbuild/makefile 2005-01-07 15:36:40 UTC (rev 12870) @@ -18,7 +18,7 @@ module.o \ project.o \ ssprintf.o \ - xml.o + XML.o OBJECTS = $(BASE_OBJECTS) rbuild.o
19 years, 10 months
1
0
0
0
[gvg] 12866: Protect against unused variable warning
by gvg@svn.reactos.com
Protect against unused variable warning Modified: trunk/reactos/drivers/video/videoprt/videoprt.c _____ Modified: trunk/reactos/drivers/video/videoprt/videoprt.c --- trunk/reactos/drivers/video/videoprt/videoprt.c 2005-01-07 13:04:36 UTC (rev 12865) +++ trunk/reactos/drivers/video/videoprt/videoprt.c 2005-01-07 13:06:11 UTC (rev 12866) @@ -1019,6 +1019,7 @@ break; } +#ifndef NDEBUG if (ChildType == Monitor) { INT j; @@ -1039,6 +1040,7 @@ { DPRINT("HwGetVideoChildDescriptor returned unsupported type: %d\n", ChildType); } +#endif /* NDEBUG */ }
19 years, 10 months
2
1
0
0
[gdalsnes] 12869: Fixed RtlGetFullPathName_U bug (didn't remove duplicate slashes) and general ugliness by rippin fresh version from wine. Makes w2k cmd.exe work (imo) 100%.
by gdalsnes@svn.reactos.com
Fixed RtlGetFullPathName_U bug (didn't remove duplicate slashes) and general ugliness by rippin fresh version from wine. Makes w2k cmd.exe work (imo) 100%. Modified: trunk/reactos/include/ntdll/rtl.h Modified: trunk/reactos/lib/ntdll/rtl/path.c _____ Modified: trunk/reactos/include/ntdll/rtl.h --- trunk/reactos/include/ntdll/rtl.h 2005-01-07 13:48:53 UTC (rev 12868) +++ trunk/reactos/include/ntdll/rtl.h 2005-01-07 15:07:52 UTC (rev 12869) @@ -17,6 +17,13 @@ #ifndef __USE_W32API +#define RTL_CONSTANT_STRING(__SOURCE_STRING__) \ +{ \ + sizeof(__SOURCE_STRING__) - sizeof((__SOURCE_STRING__)[0]), \ + sizeof(__SOURCE_STRING__), \ + (__SOURCE_STRING__) \ +} + typedef struct _DEBUG_BUFFER { HANDLE SectionHandle; @@ -355,7 +362,7 @@ ULONG STDCALL RtlGetFullPathName_U ( - WCHAR *dosname, + const WCHAR *dosname, ULONG size, WCHAR *buf, WCHAR **shortname _____ Modified: trunk/reactos/lib/ntdll/rtl/path.c --- trunk/reactos/lib/ntdll/rtl/path.c 2005-01-07 13:48:53 UTC (rev 12868) +++ trunk/reactos/lib/ntdll/rtl/path.c 2005-01-07 15:07:52 UTC (rev 12869) @@ -12,9 +12,11 @@ #include <ddk/ntddk.h> #include <ntdll/rtl.h> +#include <ntos/minmax.h> #include <string.h> #include <stdio.h> #include <ctype.h> +#include <base.h> #include <ddk/obfuncs.h> #define NDEBUG @@ -26,142 +28,28 @@ #define IS_PATH_SEPARATOR(x) (((x)==L'\\')||((x)==L'/')) + /* GLOBALS ********************************************************************/ -static const UNICODE_STRING _condev = -{ - .Length = sizeof(L"\\\\.\\CON") - sizeof(WCHAR), - .MaximumLength = sizeof(L"\\\\.\\CON"), - .Buffer = L"\\\\.\\CON" -}; +static const WCHAR DeviceRootW[] = L"\\\\.\\"; -static const UNICODE_STRING _lpt = -{ - .Length = sizeof(L"LPT") - sizeof(WCHAR), - .MaximumLength = sizeof(L"LPT"), - .Buffer = L"LPT" -}; +static const UNICODE_STRING _condev = RTL_CONSTANT_STRING(L"\\\\.\\CON"); -static const UNICODE_STRING _com = -{ - .Length = sizeof(L"COM") - sizeof(WCHAR), - .MaximumLength = sizeof(L"COM"), - .Buffer = L"COM" -}; +static const UNICODE_STRING _lpt = RTL_CONSTANT_STRING(L"LPT"); -static const UNICODE_STRING _prn = -{ - .Length = sizeof(L"PRN") - sizeof(WCHAR), - .MaximumLength = sizeof(L"PRN"), - .Buffer = L"PRN" -}; +static const UNICODE_STRING _com = RTL_CONSTANT_STRING(L"COM"); -static const UNICODE_STRING _aux = -{ - .Length = sizeof(L"AUX") - sizeof(WCHAR), - .MaximumLength = sizeof(L"AUX"), - .Buffer = L"AUX" -}; +static const UNICODE_STRING _prn = RTL_CONSTANT_STRING(L"PRN"); -static const UNICODE_STRING _con = -{ - .Length = sizeof(L"CON") - sizeof(WCHAR), - .MaximumLength = sizeof(L"CON"), - .Buffer = L"CON" -}; +static const UNICODE_STRING _aux = RTL_CONSTANT_STRING(L"AUX"); -static const UNICODE_STRING _nul = -{ - .Length = sizeof(L"NUL") - sizeof(WCHAR), - .MaximumLength = sizeof(L"NUL"), - .Buffer = L"NUL" -}; +static const UNICODE_STRING _con = RTL_CONSTANT_STRING(L"CON"); +static const UNICODE_STRING _nul = RTL_CONSTANT_STRING(L"NUL"); + /* FUNCTIONS *****************************************************************/ -static ULONG RtlpGetDotSequence (PWSTR p) -{ - ULONG Count = 0; - - for (;;) - { - if (*p == '.') - Count++; - else if ((*p == '\\' || *p == '\0') && Count) - return Count; - else - return 0; - p++; - } - return 0; -} - -static VOID RtlpEatPath (PWSTR Path) -{ - PWSTR p, prev; - - p = Path + 2; - prev = p; - - while ((*p) != 0 || ((*p) == L'\\' && (*(p+1)) == 0)) - { - ULONG DotLen; - - DotLen = RtlpGetDotSequence (p+1); - DPRINT("DotSequenceLength %u\n", DotLen); - DPRINT("prev '%S' p '%S'\n",prev,p); - - if (DotLen == 0) - { - prev = p; - p = wcschr(p + 1, L'\\'); - if (p == NULL) - { - break; - } - } - else if (DotLen == 1) - { - wcscpy (p, p+2); - } - else - { - if (DotLen > 2) - { - int n = DotLen - 2; - - while (n > 0 && prev > (Path + 2)) - { - prev--; - if ((*prev) == L'\\') - n--; - } - } - - if (*(p + DotLen + 1) == 0) - *(prev + 1) = 0; - else - wcscpy (prev, p + DotLen + 1); - p = prev; - if (prev > (Path + 2)) - { - prev--; - while ((*prev) != L'\\') - { - prev--; - } - } - } - } - if (Path[2] == 0) - { - Path[2] = L'\\'; - Path[3] = 0; - } -} - - /* * @implemented */ @@ -532,224 +420,338 @@ return STATUS_SUCCESS; } -/* - * @implemented + + +/****************************************************************** + * collapse_path + * + * Helper for RtlGetFullPathName_U. + * 1) Convert slashes into backslashes + * 2) Get rid of duplicate backslashes + * 3) Get rid of . and .. components in the path. */ -ULONG STDCALL -RtlGetFullPathName_U(PWSTR DosName, - ULONG size, - PWSTR buf, - PWSTR *FilePart) +static inline void collapse_path( WCHAR *path, UINT mark ) { - WCHAR *wcs, var[4], drive; - ULONG len; - ULONG templen = 0; - DWORD offs, sz, type; - UNICODE_STRING usvar, pfx; - PCURDIR cd; - NTSTATUS Status; - WCHAR TempFullPathName[MAX_PATH] = L""; + WCHAR *p, *next; - DPRINT("RtlGetFullPathName_U %S %ld %p %p\n", - DosName, size, buf, FilePart); + /* convert every / into a \ */ + for (p = path; *p; p++) if (*p == '/') *p = '\\'; - /* FIXME: this code is a mess! We should use Wine's implementation - of this function, since it's cleaner and IMO better. -Gunnar */ - - if (!DosName || !*DosName) - return 0; + /* collapse duplicate backslashes */ + next = path + max( 1, mark ); + for (p = next; *p; p++) if (*p != '\\' || next[-1] != '\\') *next++ = *p; + *next = 0; - len = wcslen (DosName); + p = path + mark; + while (*p) + { + if (*p == '.') + { + switch(p[1]) + { + case '\\': /* .\ component */ + next = p + 2; + memmove( p, next, (wcslen(next) + 1) * sizeof(WCHAR) ); + continue; + case 0: /* final . */ + if (p > path + mark) p--; + *p = 0; + continue; + case '.': + if (p[2] == '\\') /* ..\ component */ + { + next = p + 3; + if (p > path + mark) + { + p--; + while (p > path + mark && p[-1] != '\\') p--; + } + memmove( p, next, (wcslen(next) + 1) * sizeof(WCHAR) ); + continue; + } + else if (!p[2]) /* final .. */ + { + if (p > path + mark) + { + p--; + while (p > path + mark && p[-1] != '\\') p--; + if (p > path + mark) p--; + } + *p = 0; + continue; + } + break; + } + } + /* skip to the next component */ + while (*p && *p != '\\') p++; + if (*p == '\\') p++; + } - /* strip trailing spaces */ - while (len && DosName[len - 1] == L' ') - len--; - if (!len) - return 0; - - /* strip trailing path separator (but don't change '\') */ - if ((len > 1) && - IS_PATH_SEPARATOR(DosName[len - 1])) - len--; - if (FilePart) - *FilePart = NULL; - if (buf) - *buf = 0; + /* remove trailing spaces and dots (yes, Windows really does that, don't ask) */ + while (p > path + mark && (p[-1] == ' ' || p[-1] == '.')) p--; + *p = 0; +} -CHECKPOINT; - /* check for DOS device name */ - sz = RtlIsDosDeviceName_U (DosName); - if (sz) - { - offs = sz >> 17; - sz &= 0x0000FFFF; - if (sz + 8 >= size) - return sz + 10; - if (buf) - { - wcscpy (buf, L"\\\\.\\"); - wcsncat (buf, DosName + offs, sz / sizeof(WCHAR)); - } - return sz + 8; - } -CHECKPOINT; - type = RtlDetermineDosPathNameType_U (DosName); - RtlAcquirePebLock(); +/****************************************************************** + * skip_unc_prefix + * + * Skip the \\share\dir\ part of a file name. Helper for RtlGetFullPathName_U. + */ +static const WCHAR *skip_unc_prefix( const WCHAR *ptr ) +{ + ptr += 2; + while (*ptr && !IS_PATH_SEPARATOR(*ptr)) ptr++; /* share name */ + while (IS_PATH_SEPARATOR(*ptr)) ptr++; + while (*ptr && !IS_PATH_SEPARATOR(*ptr)) ptr++; /* dir name */ + while (IS_PATH_SEPARATOR(*ptr)) ptr++; + return ptr; +} - cd = (PCURDIR)&(NtCurrentPeb ()->ProcessParameters->CurrentDirectoryName); -DPRINT("type %ld\n", type); - switch (type) - { - case 1: /* \\xxx or \\.xxx */ - case 6: /* \\.\xxx */ - break; - case 2: - break; -#if 0 - /* this makes a direct CreateFileW call crash! */ +/****************************************************************** + * get_full_path_helper + * + * Helper for RtlGetFullPathName_U + * Note: name and buffer are allowed to point to the same memory spot + */ +static ULONG get_full_path_helper( + LPCWSTR name, + LPWSTR buffer, + ULONG size) +{ + ULONG reqsize = 0, mark = 0, dep = 0, deplen; + DOS_PATHNAME_TYPE type; + LPWSTR ins_str = NULL; + LPCWSTR ptr; + const UNICODE_STRING* cd; + WCHAR tmp[4]; - case 2: /* x:\xxx */ - *DosName = RtlUpcaseUnicodeChar (*DosName); - break; -#endif + /* return error if name only consists of spaces */ + for (ptr = name; *ptr; ptr++) if (*ptr != ' ') break; + if (!*ptr) return 0; - case 3: /* x:xxx */ - drive = RtlUpcaseUnicodeChar (*DosName); - DosName += 2; - len -= 2; -CHECKPOINT; - if (drive == RtlUpcaseUnicodeChar (cd->DosPath.Buffer[0])) - { -CHECKPOINT; - memcpy (TempFullPathName, cd->DosPath.Buffer, cd->DosPath.Length); - templen = cd->DosPath.Length / sizeof(WCHAR); - } - else - { -CHECKPOINT; - var[0] = L'='; - var[1] = drive; - var[2] = L':'; - var[3] = 0; - usvar.Length = 3 * sizeof(WCHAR); - usvar.MaximumLength = 4 * sizeof(WCHAR); - usvar.Buffer = var; - pfx.Length = 0; - pfx.MaximumLength = MAX_PATH; - pfx.Buffer = TempFullPathName; - Status = RtlQueryEnvironmentVariable_U (NULL, - &usvar, - &pfx); -CHECKPOINT; - if (!NT_SUCCESS(Status)) - { -CHECKPOINT; - if (Status == STATUS_BUFFER_TOO_SMALL) - return pfx.Length + len * 2 + 2; -CHECKPOINT; - TempFullPathName[0] = drive; - TempFullPathName[1] = L':'; - TempFullPathName[2] = L'\\'; - TempFullPathName[3] = 0; - templen = 3; - } - else - { -CHECKPOINT; - templen = pfx.Length / sizeof(WCHAR); - } + RtlAcquirePebLock(); - } - break; + cd = &((PCURDIR)&NtCurrentTeb()->Peb->ProcessParameters->CurrentDirectoryName )->DosPath; - case 4: /* \xxx */ - wcsncpy (TempFullPathName, cd->DosPath.Buffer, 2); - TempFullPathName[2] = 0; - templen = wcslen(TempFullPathName); - break; + switch (type = RtlDetermineDosPathNameType_U(name)) + { + case UNC_PATH: /* \\foo */ + ptr = skip_unc_prefix( name ); + mark = (ptr - name); + break; - case 5: /* xxx */ - memcpy (TempFullPathName, cd->DosPath.Buffer, cd->DosPath.Length); - templen = cd->DosPath.Length / sizeof(WCHAR); - break; + case DEVICE_PATH: /* \\.\foo */ + mark = 4; + break; - case 7: /* \\. */ - memcpy (TempFullPathName, L"\\\\.\\", 8); - templen = 4; - break; + case ABSOLUTE_DRIVE_PATH: /* c:\foo */ + reqsize = sizeof(WCHAR); + tmp[0] = towupper(name[0]); + ins_str = tmp; + dep = 1; + mark = 3; + break; - default: - return 0; - } + case RELATIVE_DRIVE_PATH: /* c:foo */ + dep = 2; + if (towupper(name[0]) != towupper(cd->Buffer[0]) || cd->Buffer[1] != ':') + { + UNICODE_STRING var, val; + tmp[0] = '='; + tmp[1] = name[0]; + tmp[2] = ':'; + tmp[3] = '\0'; + var.Length = 3 * sizeof(WCHAR); + var.MaximumLength = 4 * sizeof(WCHAR); + var.Buffer = tmp; + val.Length = 0; + val.MaximumLength = size; + val.Buffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, size); - RtlReleasePebLock(); + switch (RtlQueryEnvironmentVariable_U(NULL, &var, &val)) + { + case STATUS_SUCCESS: + /* FIXME: Win2k seems to check that the environment variable actually points + * to an existing directory. If not, root of the drive is used + * (this seems also to be the only spot in RtlGetFullPathName that the + * existence of a part of a path is checked) + */ + /* fall thru */ + case STATUS_BUFFER_TOO_SMALL: + reqsize = val.Length + sizeof(WCHAR); /* append trailing '\\' */ + val.Buffer[val.Length / sizeof(WCHAR)] = '\\'; + ins_str = val.Buffer; + break; + case STATUS_VARIABLE_NOT_FOUND: + reqsize = 3 * sizeof(WCHAR); + tmp[0] = name[0]; + tmp[1] = ':'; + tmp[2] = '\\'; + ins_str = tmp; + break; + default: + DPRINT1("Unsupported status code\n"); + break; + } + mark = 3; + break; + } + /* fall through */ - DPRINT("TempFullPathName \'%S\' DosName \'%S\' len %ld\n", TempFullPathName, DosName, len); - /* add dosname to prefix */ - memcpy (TempFullPathName + templen, DosName, len * sizeof(WCHAR)); - - /* dirty/temporary fix for the CreateFileW problem */ - if (type == 2){ - TempFullPathName[0] = RtlUpcaseUnicodeChar(TempFullPathName[0]); - } - len += templen; - TempFullPathName[len] = 0; + case RELATIVE_PATH: /* foo */ + reqsize = cd->Length; + ins_str = cd->Buffer; + if (cd->Buffer[1] != ':') + { + ptr = skip_unc_prefix( cd->Buffer ); + mark = ptr - cd->Buffer; + } + else mark = 3; + break; - CHECKPOINT; - /* replace slashes */ - wcs = wcschr(TempFullPathName, L'/'); - while(wcs) - { - *wcs = L'\\'; - wcs = wcschr(wcs + 1, L'/'); - } + case ABSOLUTE_PATH: /* \xxx */ +#ifdef __WINE__ + if (name[0] == '/') /* may be a Unix path */ + { + const WCHAR *ptr = name; + int drive = find_drive_root( &ptr ); + if (drive != -1) + { + reqsize = 3 * sizeof(WCHAR); + tmp[0] = 'A' + drive; + tmp[1] = ':'; + tmp[2] = '\\'; + ins_str = tmp; + mark = 3; + dep = ptr - name; + break; + } + } +#endif + if (cd->Buffer[1] == ':') + { + reqsize = 2 * sizeof(WCHAR); + tmp[0] = cd->Buffer[0]; + tmp[1] = ':'; + ins_str = tmp; + mark = 3; + } + else + { + ptr = skip_unc_prefix( cd->Buffer ); + reqsize = (ptr - cd->Buffer) * sizeof(WCHAR); + mark = reqsize / sizeof(WCHAR); + ins_str = cd->Buffer; + } + break; - if (len == 2 && TempFullPathName[1] == L':') - { - TempFullPathName[len++] = L'\\'; - TempFullPathName[len] = 0; - } + case UNC_DOT_PATH: /* \\. */ + reqsize = 4 * sizeof(WCHAR); + dep = 3; + tmp[0] = '\\'; + tmp[1] = '\\'; + tmp[2] = '.'; + tmp[3] = '\\'; + ins_str = tmp; + mark = 4; + break; + case INVALID_PATH: + goto done; + } - DPRINT("TempFullPathName \'%S\'\n", TempFullPathName); - RtlpEatPath (TempFullPathName); - DPRINT("TempFullPathName \'%S\'\n", TempFullPathName); + /* enough space ? */ + deplen = wcslen(name + dep) * sizeof(WCHAR); + if (reqsize + deplen + sizeof(WCHAR) > size) + { + /* not enough space, return need size (including terminating '\0') */ + reqsize += deplen + sizeof(WCHAR); + goto done; + } - len = wcslen (TempFullPathName); + memmove(buffer + reqsize / sizeof(WCHAR), name + dep, deplen + sizeof(WCHAR)); + if (reqsize) memcpy(buffer, ins_str, reqsize); + reqsize += deplen; - if (len < (size / sizeof(WCHAR))) - { - if (buf) - memcpy (buf, TempFullPathName, (len + 1) * sizeof(WCHAR)); + if (ins_str && ins_str != tmp && ins_str != cd->Buffer) + RtlFreeHeap(RtlGetProcessHeap(), 0, ins_str); - /* find file part */ - if (FilePart && buf) - { -#if 0 - *FilePart = wcsrchr(buf, L'\\'); - if (*FilePart) - { - (*FilePart)++; - } - else - { - *FilePart = buf; - } -#else - *FilePart = buf + len; - while (*FilePart != buf && **FilePart != L'\\') - --(*FilePart); - if (**FilePart == L'\\') - ++(*FilePart); -#endif - } + collapse_path( buffer, mark ); + reqsize = wcslen(buffer) * sizeof(WCHAR); + +done: + RtlReleasePebLock(); + return reqsize; +} + + +/****************************************************************** + * RtlGetFullPathName_U (NTDLL.@) + * + * Returns the number of bytes written to buffer (not including the + * terminating NULL) if the function succeeds, or the required number of bytes + * (including the terminating NULL) if the buffer is too small. + * + * file_part will point to the filename part inside buffer (except if we use + * DOS device name, in which case file_in_buf is NULL) + * + * @implemented + */ +DWORD STDCALL RtlGetFullPathName_U( + const WCHAR* name, + ULONG size, + WCHAR* buffer, + WCHAR** file_part) +{ + WCHAR* ptr; + DWORD dosdev; + DWORD reqsize; + + DPRINT("RtlGetFullPathName_U(%S %lu %p %p)\n", name, size, buffer, file_part); + + if (!name || !*name) return 0; + + if (file_part) *file_part = NULL; + + /* check for DOS device name */ + dosdev = RtlIsDosDeviceName_U((WCHAR*)name); + if (dosdev) + { + DWORD offset = HIWORD(dosdev) / sizeof(WCHAR); /* get it in WCHARs, not bytes */ + DWORD sz = LOWORD(dosdev); /* in bytes */ + + if (8 + sz + 2 > size) return sz + 10; + wcscpy(buffer, DeviceRootW); + memmove(buffer + 4, name + offset, sz); + buffer[4 + sz / sizeof(WCHAR)] = '\0'; + /* file_part isn't set in this case */ + return sz + 8; + } + + reqsize = get_full_path_helper(name, buffer, size); + if (!reqsize) return 0; + if (reqsize > size) + { + LPWSTR tmp = RtlAllocateHeap(RtlGetProcessHeap(), 0, reqsize); + reqsize = get_full_path_helper(name, tmp, reqsize); + if (reqsize > size) /* it may have worked the second time */ + { + RtlFreeHeap(RtlGetProcessHeap(), 0, tmp); + return reqsize + sizeof(WCHAR); } + memcpy( buffer, tmp, reqsize + sizeof(WCHAR) ); + RtlFreeHeap(RtlGetProcessHeap(), 0, tmp); + } - return len * sizeof(WCHAR); + /* find file part */ + if (file_part && (ptr = wcsrchr(buffer, '\\')) != NULL && ptr >= buffer + 2 && *++ptr) + *file_part = ptr; + return reqsize; }
19 years, 10 months
1
0
0
0
[royce] 12868: parse, but ignore, <? ?> tags - eliminated duplicate code ala FixSeparator() - fix path separator issues
by royce@svn.reactos.com
parse, but ignore, <? ?> tags - eliminated duplicate code ala FixSeparator() - fix path separator issues Modified: branches/xmlbuildsystem/reactos/tools/rbuild/XML.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/project.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h Modified: branches/xmlbuildsystem/reactos/tools/rbuild/tests/data/module.xml Modified: branches/xmlbuildsystem/reactos/tools/rbuild/tests/data/project.xml Modified: branches/xmlbuildsystem/reactos/tools/rbuild/tests/moduletest.cpp _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/XML.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/XML.cpp 2005-01-07 13:34:47 UTC (rev 12867) +++ branches/xmlbuildsystem/reactos/tools/rbuild/XML.cpp 2005-01-07 13:48:53 UTC (rev 12868) @@ -251,6 +251,14 @@ else tokend += 3; } + else if ( !strncmp ( _p, "<?", 2 ) ) + { + tokend = strstr ( _p, "?>" ); + if ( !tokend ) + tokend = _end; + else + tokend += 2; + } else if ( *_p == '<' ) { tokend = strchr ( _p, '>' ); @@ -456,7 +464,9 @@ return NULL; bool end_tag; - while ( token[0] != '<' || !strncmp ( token.c_str(), "<!--", 4 ) ) + while ( token[0] != '<' + || !strncmp ( token.c_str(), "<!--", 4 ) + || !strncmp ( token.c_str(), "<?", 2 ) ) { if ( token[0] != '<' ) throw XMLSyntaxErrorException ( f.Location(), _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp 2005-01-07 13:34:47 UTC (rev 12867) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp 2005-01-07 13:48:53 UTC (rev 12868) @@ -1,5 +1,6 @@ #include "../../pch.h" +#include <assert.h> #include "../../rbuild.h" #include "mingw.h" @@ -162,30 +163,30 @@ archiveFilename.c_str (), importLibraryDependencies.c_str () ); fprintf ( fMakefile, - "\t${gcc} -Wl,--base-file,%s/base.tmp -o %s/junk.tmp %s %s\n", + "\t${gcc} -Wl,--base-file,%s" SSEP "base.tmp -o %s" SSEP "junk.tmp %s %s\n", workingDirectory.c_str (), workingDirectory.c_str (), archiveFilename.c_str (), importLibraryDependencies.c_str () ); fprintf ( fMakefile, - "\t${rm} %s/junk.tmp\n", + "\t${rm} %s" SSEP "junk.tmp\n", workingDirectory.c_str () ); fprintf ( fMakefile, - "\t${dlltool} --dllname %s --base-file %s/base.tmp --output-exp %s/temp.exp --kill-at\n", + "\t${dlltool} --dllname %s --base-file %s" SSEP "base.tmp --output-exp %s" SSEP "temp.exp --kill-at\n", module.GetPath ().c_str (), workingDirectory.c_str (), workingDirectory.c_str ()); fprintf ( fMakefile, - "\t${rm} %s/base.tmp\n", + "\t${rm} %s" SSEP "base.tmp\n", workingDirectory.c_str () ); fprintf ( fMakefile, - "\t${ld} -Wl,%s/temp.exp -o %s %s %s\n", + "\t${ld} -Wl,%s" SSEP "temp.exp -o %s %s %s\n", workingDirectory.c_str (), module.GetPath ().c_str (), archiveFilename.c_str (), importLibraryDependencies.c_str () ); fprintf ( fMakefile, - "\t${rm} %s/temp.exp\n", + "\t${rm} %s" SSEP "temp.exp\n", workingDirectory.c_str () ); GenerateArchiveTarget ( module ); _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp 2005-01-07 13:34:47 UTC (rev 12867) +++ branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp 2005-01-07 13:48:53 UTC (rev 12868) @@ -8,37 +8,18 @@ using std::string; using std::vector; -#ifdef WIN32 -#define EXEPOSTFIX ".exe" -#define SEP "\\" string FixSeparator ( const string& s ) { string s2(s); - char* p = strchr ( &s2[0], '/' ); + char* p = strchr ( &s2[0], CBAD_SEP ); while ( p ) { - *p++ = '\\'; - p = strchr ( p, '/' ); + *p++ = CSEP; + p = strchr ( p, CBAD_SEP ); } return s2; } -#else -#define EXEPOSTFIX -#define SEP "/" -string -FixSeparator ( const string& s ) -{ - string s2(s); - char* p = strchr ( &s2[0], '\\' ); - while ( p ) - { - *p++ = '/'; - p = strchr ( p, '\\' ); - } - return s2; -} -#endif Module::Module ( Project* project, const XMLElement& moduleNode, @@ -68,7 +49,7 @@ string subpath ( path ); if ( e.name == "file" && e.value.size () ) { - files.push_back ( new File ( path + "/" + e.value ) ); + files.push_back ( new File ( path + CSEP + e.value ) ); } else if ( e.name == "library" && e.value.size () ) { @@ -78,7 +59,7 @@ { const XMLAttribute* att = e.GetAttribute ( "name", true ); assert(att); - subpath = path + "/" + att->value; + subpath = path + CSEP + att->value; } for ( size_t i = 0; i < e.subElements.size (); i++ ) ProcessXML ( *e.subElements[i], subpath ); @@ -100,7 +81,7 @@ string Module::GetPath () { - return FixSeparator (path) + SEP + name + EXEPOSTFIX; + return FixSeparator (path) + CSEP + name + EXEPOSTFIX; } _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/project.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/project.cpp 2005-01-07 13:34:47 UTC (rev 12867) +++ branches/xmlbuildsystem/reactos/tools/rbuild/project.cpp 2005-01-07 13:48:53 UTC (rev 12868) @@ -30,15 +30,12 @@ { Path path; - head = XMLParse ( xmlfile, path ); - if ( !head ) - throw InvalidBuildFileException ( "Document contains no 'project' tag." ); - - if ( head->name != "project" ) + do { - throw InvalidBuildFileException ( "Expected 'project', got '%s'.", - head->name.c_str()); - } + head = XMLParse ( xmlfile, path ); + if ( !head ) + throw InvalidBuildFileException ( "Document contains no 'project' tag." ); + } while ( head->name != "project" ); this->ProcessXML ( *head, "." ); } @@ -73,7 +70,7 @@ { const XMLAttribute* att = e.GetAttribute ( "name", true ); assert(att); - subpath = path + "/" + att->value; + subpath = path + CSEP + att->value; } for ( size_t i = 0; i < e.subElements.size (); i++ ) ProcessXML ( *e.subElements[i], subpath ); _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h --- branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h 2005-01-07 13:34:47 UTC (rev 12867) +++ branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h 2005-01-07 13:48:53 UTC (rev 12868) @@ -7,6 +7,20 @@ #include "exception.h" #include "XML.h" +#ifdef WIN32 +#define EXEPOSTFIX ".exe" +#define CSEP '\\' +#define CBAD_SEP '/' +#define SSEP "\\" +#define SBAD_SEP "/" +#else +#define EXEPOSTFIX +#define CSEP '/' +#define CBAD_SEP '\\' +#define SSEP "/" +#define SBAD_SEP "\\" +#endif + class Project; class Module; class File; @@ -78,4 +92,7 @@ Library ( const std::string& _name ); }; +extern std::string +FixSeparator ( const std::string& s ); + #endif /* __RBUILD_H */ _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/tests/data/module.xml --- branches/xmlbuildsystem/reactos/tools/rbuild/tests/data/module.xml 2005-01-07 13:34:47 UTC (rev 12867) +++ branches/xmlbuildsystem/reactos/tools/rbuild/tests/data/module.xml 2005-01-07 13:48:53 UTC (rev 12868) @@ -1,3 +1,4 @@ +<?xml version="1.0" ?> <project name="Project" makefile="Makefile"> <directory name="dir1"> <module name="module1" type="buildtool"> _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/tests/data/project.xml --- branches/xmlbuildsystem/reactos/tools/rbuild/tests/data/project.xml 2005-01-07 13:34:47 UTC (rev 12867) +++ branches/xmlbuildsystem/reactos/tools/rbuild/tests/data/project.xml 2005-01-07 13:48:53 UTC (rev 12868) @@ -1,3 +1,4 @@ +<?xml version="1.0" ?> <project name="Project" makefile="Makefile"> <directory name="dir1"> <module name="module1" type="buildtool"> _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/tests/moduletest.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/tests/moduletest.cpp 2005-01-07 13:34:47 UTC (rev 12867) +++ branches/xmlbuildsystem/reactos/tools/rbuild/tests/moduletest.cpp 2005-01-07 13:48:53 UTC (rev 12868) @@ -11,16 +11,16 @@ Module& module1 = *project.modules[0]; IS_TRUE(module1.type == BuildTool); ARE_EQUAL(2, module1.files.size()); - ARE_EQUAL("./dir1/file1.c", module1.files[0]->name); - ARE_EQUAL("./dir1/file2.c", module1.files[1]->name); + ARE_EQUAL("." SSEP "dir1" SSEP "file1.c", module1.files[0]->name); + ARE_EQUAL("." SSEP "dir1" SSEP "file2.c", module1.files[1]->name); ARE_EQUAL(0, module1.libraries.size()); Module& module2 = *project.modules[1]; IS_TRUE(module2.type == KernelModeDLL); ARE_EQUAL(2, module2.files.size()); - ARE_EQUAL("./dir2/file3.c", module2.files[0]->name); - ARE_EQUAL("./dir2/file4.c", module2.files[1]->name); + ARE_EQUAL("." SSEP "dir2" SSEP "file3.c", module2.files[0]->name); + ARE_EQUAL("." SSEP "dir2" SSEP "file4.c", module2.files[1]->name); ARE_EQUAL(1, module2.libraries.size()); Library& library1 = *module2.libraries[0];
19 years, 10 months
1
0
0
0
[weiden] 12867: GetProcessAffinityMask() should return correct system affinity mask
by weiden@svn.reactos.com
GetProcessAffinityMask() should return correct system affinity mask Modified: trunk/reactos/lib/kernel32/process/proc.c _____ Modified: trunk/reactos/lib/kernel32/process/proc.c --- trunk/reactos/lib/kernel32/process/proc.c 2005-01-07 13:06:11 UTC (rev 12866) +++ trunk/reactos/lib/kernel32/process/proc.c 2005-01-07 13:34:47 UTC (rev 12867) @@ -37,7 +37,18 @@ LPDWORD lpSystemAffinityMask) { PROCESS_BASIC_INFORMATION ProcessInfo; + SYSTEM_BASIC_INFORMATION SystemInfo; NTSTATUS Status; + + Status = NtQuerySystemInformation(SystemBasicInformation, + &SystemInfo, + sizeof(SystemInfo), + NULL); + if (!NT_SUCCESS(Status)) + { + SetLastErrorByStatus (Status); + return FALSE; + } Status = NtQueryInformationProcess (hProcess, ProcessBasicInformation, @@ -51,10 +62,8 @@ } *lpProcessAffinityMask = (DWORD)ProcessInfo.AffinityMask; + *lpSystemAffinityMask = (DWORD)SystemInfo.ActiveProcessors; - /* FIXME */ - *lpSystemAffinityMask = 0x00000001; - return TRUE; }
19 years, 10 months
1
0
0
0
[gvg] 12865: Silence debug messages
by gvg@svn.reactos.com
Silence debug messages Modified: trunk/reactos/drivers/video/videoprt/videoprt.h _____ Modified: trunk/reactos/drivers/video/videoprt/videoprt.h --- trunk/reactos/drivers/video/videoprt/videoprt.h 2005-01-07 12:58:46 UTC (rev 12864) +++ trunk/reactos/drivers/video/videoprt/videoprt.h 2005-01-07 13:04:36 UTC (rev 12865) @@ -29,7 +29,7 @@ #include <ddk/ntddvdeo.h> #include <ddk/ntapi.h> #include <ddk/ntagp.h> -//#define NDEBUG +#define NDEBUG #include <debug.h> int swprintf(wchar_t *buf, const wchar_t *fmt, ...);
19 years, 10 months
1
0
0
0
← Newer
1
...
48
49
50
51
52
53
54
...
71
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Results per page:
10
25
50
100
200