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
December
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
April 2005
----- 2024 -----
December 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
26 participants
477 discussions
Start a n
N
ew thread
[hpoussin] 14874: Don't double define GUID_DEVICE_INTERFACE_ARRIVAL and GUID_DEVICE_INTERFACE_REMOVAL in include/ntos/ntpnp.h and w32api/include/ddk/wdmguid.h
by hpoussin@svn.reactos.com
Don't double define GUID_DEVICE_INTERFACE_ARRIVAL and GUID_DEVICE_INTERFACE_REMOVAL in include/ntos/ntpnp.h and w32api/include/ddk/wdmguid.h Modified: trunk/reactos/include/ntos/ntpnp.h Modified: trunk/reactos/ntoskrnl/include/ntoskrnl.h _____ Modified: trunk/reactos/include/ntos/ntpnp.h --- trunk/reactos/include/ntos/ntpnp.h 2005-04-30 14:15:38 UTC (rev 14873) +++ trunk/reactos/include/ntos/ntpnp.h 2005-04-30 14:36:05 UTC (rev 14874) @@ -38,8 +38,9 @@ DEFINE_GUID(GUID_DEVICE_HIBERNATE_VETOED, 0x61173AD9, 0x194F, 0x11D3, 0x97, 0xDC, 0x00, 0xA0, 0xC9, 0x40, 0x52, 0x2E); DEFINE_GUID(GUID_DEVICE_BATTERY, 0x72631E54, 0x78A4, 0x11D0, 0xBC, 0xF7, 0x00, 0xAA, 0x00, 0xB7, 0xB3, 0x2A); DEFINE_GUID(GUID_DEVICE_SAFE_REMOVAL, 0x8FBEF967, 0xD6C5, 0x11D2, 0x97, 0xB5, 0x00, 0xA0, 0xC9, 0x40, 0x52, 0x2E); -DEFINE_GUID(GUID_DEVICE_INTERFACE_ARRIVAL, 0xCB3A4004, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); -DEFINE_GUID(GUID_DEVICE_INTERFACE_REMOVAL, 0xCB3A4005, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); +/* These GUIDs are documented, and they are defined in wdmguid.h */ +/* DEFINE_GUID(GUID_DEVICE_INTERFACE_ARRIVAL, 0xCB3A4004, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); */ +/* DEFINE_GUID(GUID_DEVICE_INTERFACE_REMOVAL, 0xCB3A4005, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); */ DEFINE_GUID(GUID_DEVICE_ARRIVAL, 0xCB3A4009, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); DEFINE_GUID(GUID_DEVICE_ENUMERATED, 0xCB3A400A, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); DEFINE_GUID(GUID_DEVICE_ENUMERATE_REQUEST, 0xCB3A400B, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); _____ Modified: trunk/reactos/ntoskrnl/include/ntoskrnl.h --- trunk/reactos/ntoskrnl/include/ntoskrnl.h 2005-04-30 14:15:38 UTC (rev 14873) +++ trunk/reactos/ntoskrnl/include/ntoskrnl.h 2005-04-30 14:36:05 UTC (rev 14874) @@ -27,6 +27,7 @@ #include <ddk/kefuncs.h> #include <ddk/pnptypes.h> #include <ddk/pnpfuncs.h> +#include <ddk/wdmguid.h> #include <ntdll/ldr.h> #include <internal/ctype.h> #include <internal/ntoskrnl.h>
19 years, 7 months
1
0
0
0
[gvg] 14873: Change BootDrive/BootPartition examples to BootPath
by gvg@svn.reactos.com
Change BootDrive/BootPartition examples to BootPath Modified: trunk/reactos/boot/freeldr/FREELDR.INI _____ Modified: trunk/reactos/boot/freeldr/FREELDR.INI --- trunk/reactos/boot/freeldr/FREELDR.INI 2005-04-30 13:53:39 UTC (rev 14872) +++ trunk/reactos/boot/freeldr/FREELDR.INI 2005-04-30 14:15:38 UTC (rev 14873) @@ -51,8 +51,7 @@ ; [OS-General] Section Commands: ; ; BootType - sets the boot type: ReactOS, Linux, BootSector, Partition, Drive -; BootDrive - sets the boot drive: 0 - first floppy, 1 - second floppy, 0x80 - first hard disk, 0x81 - second hard disk -; BootPartition - sets the boot partition +; BootPath - ARC path e.g. multi(0)disk(0)rdisk(x)partition(y) ; DriveMap - maps a BIOS drive number to another (i.e. DriveMap=hd1,hd0 maps harddisk1 to harddisk0 or DriveMap=fd1,fd0) ; [BootSector OSType] Section Commands: @@ -134,8 +133,7 @@ [Linux] BootType=Linux -BootDrive=hd1 -BootPartition=1 +BootPath=multi(0)disk(0)rdisk(1)partition(1) Kernel=/vmlinuz Initrd=/initrd.img CommandLine="root=/dev/sdb1" @@ -146,13 +144,11 @@ [MSWinders] BootType=Partition -BootDrive=hd0 -BootPartition=1 +BootPath=multi(0)disk(0)rdisk(0)partition(1) ;DriveMap=hd1,hd0 ;DriveMap=hd2,hd0 ;DriveMap=hd3,hd0 [DriveD] BootType=Partition -BootDrive=hd1 -BootPartition=1 +BootPath=multi(0)disk(0)rdisk(1)partition(1)
19 years, 7 months
1
0
0
0
[hpoussin] 14872: I forgot to dereference FileObject in IoSetDeviceInterfaceState
by hpoussin@svn.reactos.com
I forgot to dereference FileObject in IoSetDeviceInterfaceState Modified: trunk/reactos/ntoskrnl/io/deviface.c _____ Modified: trunk/reactos/ntoskrnl/io/deviface.c --- trunk/reactos/ntoskrnl/io/deviface.c 2005-04-30 13:35:52 UTC (rev 14871) +++ trunk/reactos/ntoskrnl/io/deviface.c 2005-04-30 13:53:39 UTC (rev 14872) @@ -837,6 +837,8 @@ &GuidString, (PVOID)SymbolicLinkName); + ObDereferenceObject(FileObject); + return STATUS_SUCCESS; }
19 years, 7 months
1
0
0
0
[greatlrd] 14871: Remove all hardcode string to En.rc
by greatlrd@svn.reactos.com
Remove all hardcode string to En.rc Modified: trunk/reactos/subsys/system/cmd/En.rc Modified: trunk/reactos/subsys/system/cmd/resource.h Modified: trunk/reactos/subsys/system/cmd/timer.c _____ Modified: trunk/reactos/subsys/system/cmd/En.rc --- trunk/reactos/subsys/system/cmd/En.rc 2005-04-30 13:13:36 UTC (rev 14870) +++ trunk/reactos/subsys/system/cmd/En.rc 2005-04-30 13:35:52 UTC (rev 14871) @@ -403,8 +403,28 @@ STRING_TIME_HELP2, "Enter new time: " +STRING_TIMER_HELP1, "Elapsed %d msecs\n" +STRING_TIMER_HELP2, "Elapsed %02d%c%02d%c%02d%c%02d\n" +STRING_TIMER_HELP3, "allow the use of ten stopwaches.\n\n \ +TIMER [ON|OFF] [/S] [/n] [/Fn]\n\n \ + ON set stopwach ON\n \ + OFF set stopwach OFF\n \ + /S Split time. Return stopwach split\n \ + time without changing its value\n \ + /n Specifiy the stopwach number.\n \ + Stopwaches avaliable are 0 to 10\n \ + If it is not specified default is 1\n \ + /Fn Format for output\n \ + n can be:\n \ + 0 milliseconds\n \ + 1 hh%cmm%css%cdd\n\n \ +if none of ON, OFF or /S is specified the command\n \ +will toggle stopwach state\n\n" + + + STRING_CHOICE_OPTION, "YN" STRING_COPY_OPTION, "YNA" _____ Modified: trunk/reactos/subsys/system/cmd/resource.h --- trunk/reactos/subsys/system/cmd/resource.h 2005-04-30 13:13:36 UTC (rev 14870) +++ trunk/reactos/subsys/system/cmd/resource.h 2005-04-30 13:35:52 UTC (rev 14871) @@ -180,6 +180,9 @@ #define STRING_TIME_HELP1 678 #define STRING_TIME_HELP2 679 +#define STRING_TIMER_HELP1 680 +#define STRING_TIMER_HELP2 681 +#define STRING_TIMER_HELP3 682 _____ Modified: trunk/reactos/subsys/system/cmd/timer.c --- trunk/reactos/subsys/system/cmd/timer.c 2005-04-30 13:13:36 UTC (rev 14870) +++ trunk/reactos/subsys/system/cmd/timer.c 2005-04-30 13:35:52 UTC (rev 14871) @@ -8,6 +8,7 @@ */ #include "precomp.h" +#include "resource.h" #ifdef INCLUDE_CMD_TIMER @@ -36,7 +37,7 @@ static VOID PrintElapsedTime (DWORD time,INT format) { - + WCHAR szMsg[RC_STRING_MAX_SIZE]; DWORD h,m,s,ms; #ifdef _DEBUG @@ -46,7 +47,8 @@ switch (format) { case 0: - ConOutPrintf(_T("Elapsed %d msecs\n"),time); + LoadString( GetModuleHandle(NULL), STRING_TIMER_HELP1, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPrintf((LPTSTR)szMsg,time); break; case 1: @@ -56,7 +58,8 @@ time /=60; m = time % 60; h = time / 60; - ConOutPrintf(_T("Elapsed %02d%c%02d%c%02d%c%02d\n"), + LoadString( GetModuleHandle(NULL), STRING_TIMER_HELP2, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPrintf((LPTSTR)szMsg, h,cTimeSeparator, m,cTimeSeparator, s,cDecimalSeparator,ms/10); @@ -67,6 +70,8 @@ INT CommandTimer (LPTSTR cmd, LPTSTR param) { + WCHAR szMsg[RC_STRING_MAX_SIZE]; + // all timers are kept static DWORD clksT[10]; @@ -99,29 +104,8 @@ if (_tcsncmp (param, _T("/?"), 2) == 0) { - ConOutPrintf(_T( - "allow the use of ten stopwaches.\n" - "\n" - "TIMER [ON|OFF] [/S] [/n] [/Fn]\n" - "\n" - " ON set stopwach ON\n" - " OFF set stopwach OFF\n" - " /S Split time. Return stopwach split\n" - " time without changing its value\n" - " /n Specifiy the stopwach number.\n" - " Stopwaches avaliable are 0 to 10\n" - " If it is not specified default is 1\n" - " /Fn Format for output\n" - " n can be:\n" - " 0 milliseconds\n" - " 1 hh%cmm%css%cdd\n" - "\n"), - cTimeSeparator,cTimeSeparator,cDecimalSeparator); - - ConOutPrintf(_T( - "if none of ON, OFF or /S is specified the command\n" - "will toggle stopwach state\n" - "\n")); + LoadString( GetModuleHandle(NULL), STRING_TIMER_HELP3, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPrintf ((LPTSTR)szMsg,cTimeSeparator,cTimeSeparator,cDecimalSeparator); return 0; }
19 years, 7 months
1
0
0
0
[greatlrd] 14870: Remove all hardcode string to En.rc
by greatlrd@svn.reactos.com
Remove all hardcode string to En.rc Modified: trunk/reactos/subsys/system/cmd/En.rc Modified: trunk/reactos/subsys/system/cmd/ren.c Modified: trunk/reactos/subsys/system/cmd/resource.h Modified: trunk/reactos/subsys/system/cmd/start.c Modified: trunk/reactos/subsys/system/cmd/time.c _____ Modified: trunk/reactos/subsys/system/cmd/En.rc --- trunk/reactos/subsys/system/cmd/En.rc 2005-04-30 12:36:36 UTC (rev 14869) +++ trunk/reactos/subsys/system/cmd/En.rc 2005-04-30 13:13:36 UTC (rev 14870) @@ -355,6 +355,23 @@ STRING_RMDIR_HELP, "Removes a directory.\n\n \ RMDIR [drive:]path\nRD [drive:]path" +STRING_REN_HELP1, "Renames a file/directory or files/directories.\n\n \ +RENAME [/E /N /P /Q /S /T] old_name ... new_name\n \ +REN [/E /N /P /Q /S /T] old_name ... new_name\n\n \ + /E No eror messages.\n \ + /N Nothing.\n \ + /P Prompts for confirmation before renaming each file.\n \ + (Not implemented yet!)\n \ + /Q Quiet.\n \ + /S Rename subdirectories.\n \ + /T Display total number of renamed files.\n\n \ +Note that you cannot specify a new drive or path for your destination. Use\n \ +the MOVE command for that purpose." + +STRING_REN_HELP2, " %lu file renamed\n" + +STRING_REN_HELP3, " %lu files renamed\n" + STRING_SHIFT_HELP, "Changes the position of replaceable parameters in a batch file.\n\n \ SHIFT [DOWN]" @@ -369,14 +386,25 @@ string Specifies a series of characters to assign to the variable.\n\n \ Type SET without parameters to display the current environment variables.\n" +STRING_START_HELP1, "Starts a command.\n\n \ +START command \n\n \ + command Specifies the command to run.\n\n \ +At the moment all commands are started asynchronously.\n" + STRING_TITLE_HELP, "Sets the window title for the command prompt window.\n\n \ TITLE [string]\n\n \ string Specifies the title for the command prompt window." - +STRING_TIME_HELP1, "Displays or sets the system time.\n\n \ +TIME [/T][time]\n\n \ + /T display only\n\n \ +Type TIME with no parameters to display the current time setting and a prompt\n \ +for a new one. Press ENTER to keep the same time." +STRING_TIME_HELP2, "Enter new time: " + STRING_CHOICE_OPTION, "YN" STRING_COPY_OPTION, "YNA" @@ -431,8 +459,14 @@ STRING_PARAM_ERROR, "Required parameter missing\n" -STRING_PATH_ERROR "CMD: Not in environment 'PATH'\n" +STRING_PATH_ERROR, "CMD: Not in environment 'PATH'\n" +STRING_REN_ERROR1, "MoveFile() failed. Error: %lu\n" + +STRING_START_ERROR1, "No batch support at the moment!" + +STRING_TIME_ERROR1, "Invalid time." + STRING_ERROR_PARAMETERF_ERROR, "Parameter format not correct - %c\n" STRING_ERROR_INVALID_SWITCH, "Invalid switch - /%c\n" STRING_ERROR_TOO_MANY_PARAMETERS, "Too many parameters - %s\n" _____ Modified: trunk/reactos/subsys/system/cmd/ren.c --- trunk/reactos/subsys/system/cmd/ren.c 2005-04-30 12:36:36 UTC (rev 14869) +++ trunk/reactos/subsys/system/cmd/ren.c 2005-04-30 13:13:36 UTC (rev 14870) @@ -15,9 +15,13 @@ * * 17-Oct-2001 (Eric Kohl <ekohl(a)rz.online.de> * Implemented basic rename code. + * + * 30-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) + * Remove all hardcode string to En.rc */ #include "precomp.h" +#include "resource.h" #ifdef INCLUDE_CMD_RENAME @@ -54,24 +58,13 @@ HANDLE hFile; WIN32_FIND_DATA f; + WCHAR szMsg[RC_STRING_MAX_SIZE]; if (!_tcsncmp(param, _T("/?"), 2)) { - ConOutPuts(_T("Renames a file/directory or files/directories.\n" - "\n" - "RENAME [/E /N /P /Q /S /T] old_name ... new_name\n" - "REN [/E /N /P /Q /S /T] old_name ... new_name\n" - "\n" - " /E No eror messages.\n" - " /N Nothing.\n" - " /P Prompts for confirmation before renaming each file.\n" - " (Not implemented yet!)\n" - " /Q Quiet.\n" - " /S Rename subdirectories.\n" - " /T Display total number of renamed files.\n" - "\n" - "Note that you cannot specify a new drive or path for your destination. Use\n" - "the MOVE command for that purpose.")); + LoadString( GetModuleHandle(NULL), STRING_REN_HELP1, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPuts((LPTSTR)szMsg); + return(0); } @@ -245,7 +238,10 @@ else { if (!(dwFlags & REN_ERROR)) - ConErrPrintf(_T("MoveFile() failed. Error: %lu\n"), GetLastError()); + { + LoadString( GetModuleHandle(NULL), STRING_REN_ERROR1, (LPTSTR) szMsg,sizeof(szMsg)); + ConErrPrintf ((LPTSTR)szMsg, GetLastError()); + } } } } @@ -256,13 +252,15 @@ if (!(dwFlags & REN_QUIET)) { if (dwFiles == 1) - ConOutPrintf(_T(" %lu file renamed\n"), - dwFiles); + LoadString( GetModuleHandle(NULL), STRING_REN_HELP2, (LPTSTR) szMsg,sizeof(szMsg)); else - ConOutPrintf(_T(" %lu files renamed\n"), - dwFiles); + LoadString( GetModuleHandle(NULL), STRING_REN_HELP3, (LPTSTR) szMsg,sizeof(szMsg)); + + ConOutPrintf((LPTSTR)szMsg,dwFiles); } + + freep(arg); return(0); _____ Modified: trunk/reactos/subsys/system/cmd/resource.h --- trunk/reactos/subsys/system/cmd/resource.h 2005-04-30 12:36:36 UTC (rev 14869) +++ trunk/reactos/subsys/system/cmd/resource.h 2005-04-30 13:13:36 UTC (rev 14870) @@ -65,6 +65,9 @@ #define STRING_MOVE_ERROR2 343 #define STRING_PARAM_ERROR 344 #define STRING_PATH_ERROR 345 +#define STRING_REN_ERROR1 346 +#define STRING_START_ERROR1 347 +#define STRING_TIME_ERROR1 348 @@ -158,18 +161,27 @@ #define STRING_REM_HELP 670 -#define STRING_RMDIR_HELP 671 +#define STRING_REN_HELP1 671 +#define STRING_REN_HELP2 672 +#define STRING_REN_HELP3 673 -#define STRING_SCREEN_HELP 672 +#define STRING_RMDIR_HELP 672 -#define STRING_SHIFT_HELP 673 +#define STRING_SCREEN_HELP 673 -#define STRING_SET_HELP 674 +#define STRING_SHIFT_HELP 674 -#define STRING_TITLE_HELP 675 +#define STRING_SET_HELP 675 +#define STRING_START_HELP1 676 +#define STRING_TITLE_HELP 677 +#define STRING_TIME_HELP1 678 +#define STRING_TIME_HELP2 679 + + + _____ Modified: trunk/reactos/subsys/system/cmd/start.c --- trunk/reactos/subsys/system/cmd/start.c 2005-04-30 12:36:36 UTC (rev 14869) +++ trunk/reactos/subsys/system/cmd/start.c 2005-04-30 13:13:36 UTC (rev 14870) @@ -6,9 +6,13 @@ * * 24-Jul-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) * Started. + * + * 30-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) + * Remove all hardcode string to En.rc */ #include "precomp.h" +#include "resource.h" #ifdef INCLUDE_CMD_START @@ -18,13 +22,13 @@ TCHAR szFullName[MAX_PATH]; BOOL bWait = FALSE; TCHAR *param; + WCHAR szMsg[RC_STRING_MAX_SIZE]; if (_tcsncmp (rest, _T("/?"), 2) == 0) { - ConOutPuts (_T("Starts a command.\n\n" - "START command \n\n" - " command Specifies the command to run.\n\n" - "At the moment all commands are started asynchronously.\n")); + + LoadString( GetModuleHandle(NULL), STRING_START_HELP1, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPuts((LPTSTR)szMsg); return 0; } @@ -68,7 +72,9 @@ #ifdef _DEBUG DebugPrintf (_T("[BATCH: %s %s]\n"), szFullName, rest); #endif - ConErrPuts (_T("No batch support at the moment!")); + + LoadString( GetModuleHandle(NULL), STRING_START_ERROR1, (LPTSTR) szMsg,sizeof(szMsg)); + ConErrPuts ((LPTSTR)szMsg); } else { _____ Modified: trunk/reactos/subsys/system/cmd/time.c --- trunk/reactos/subsys/system/cmd/time.c 2005-04-30 12:36:36 UTC (rev 14869) +++ trunk/reactos/subsys/system/cmd/time.c 2005-04-30 13:13:36 UTC (rev 14870) @@ -19,9 +19,13 @@ * * 04-Feb-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) * Fixed time input bug. + * + * 30-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) + * Remove all hardcode string to En.rc */ #include "precomp.h" +#include "resource.h" #ifdef INCLUDE_CMD_TIME @@ -133,17 +137,13 @@ INT i; BOOL bPrompt = TRUE; INT nTimeString = -1; + WCHAR szMsg[RC_STRING_MAX_SIZE]; + if (!_tcsncmp (param, _T("/?"), 2)) { - ConOutPuts (_T("Displays or sets the system time.\n" - "\n" - "TIME [/T][time]\n" - "\n" - " /T display only\n" - "\n" - "Type TIME with no parameters to display the current time setting and a prompt\n" - "for a new one. Press ENTER to keep the same time.")); + LoadString( GetModuleHandle(NULL), STRING_TIME_HELP1, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPuts((LPTSTR)szMsg); return 0; } @@ -175,7 +175,8 @@ { TCHAR s[40]; - ConOutPrintf (_T("Enter new time: ")); + LoadString( GetModuleHandle(NULL), STRING_TIME_HELP2, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPrintf ((LPTSTR)szMsg); ConInString (s, 40); @@ -203,7 +204,8 @@ /* force input the next time around. */ nTimeString = -1; } - ConErrPuts (_T("Invalid time.")); + LoadString( GetModuleHandle(NULL), STRING_TIME_ERROR1, (LPTSTR) szMsg,sizeof(szMsg)); + ConErrPuts ((LPTSTR)szMsg); } freep (arg);
19 years, 7 months
1
0
0
0
[greatlrd] 14869: Remove all hardcode string to En.rc
by greatlrd@svn.reactos.com
Remove all hardcode string to En.rc Modified: trunk/reactos/subsys/system/cmd/En.rc Modified: trunk/reactos/subsys/system/cmd/resource.h Modified: trunk/reactos/subsys/system/cmd/screen.c Modified: trunk/reactos/subsys/system/cmd/set.c Modified: trunk/reactos/subsys/system/cmd/shift.c Modified: trunk/reactos/subsys/system/cmd/title.c _____ Modified: trunk/reactos/subsys/system/cmd/En.rc --- trunk/reactos/subsys/system/cmd/En.rc 2005-04-30 11:53:15 UTC (rev 14868) +++ trunk/reactos/subsys/system/cmd/En.rc 2005-04-30 12:36:36 UTC (rev 14869) @@ -350,13 +350,29 @@ STRING_PROMPT_HELP3, "\nType PROMPT without parameters to reset the prompt to the default setting." +STRING_REM_HELP, "Starts a comment line in a batch file.\n\nREM [Comment]" STRING_RMDIR_HELP, "Removes a directory.\n\n \ RMDIR [drive:]path\nRD [drive:]path" -STRING_REM_HELP, "Starts a comment line in a batch file.\n\nREM [Comment]" +STRING_SHIFT_HELP, "Changes the position of replaceable parameters in a batch file.\n\n \ +SHIFT [DOWN]" +STRING_SCREEN_HELP, "move cursor and optionally print text\n\n \ +SCREEN row col [text]\n\n \ + row row to wich move the cursor\n \ + col column to wich move the cursor" +STRING_SET_HELP, "Displays, sets, or removes environment variables.\n\n \ +SET [variable[=][string]]\n\n \ + variable Specifies the environment-variable name.\n \ + string Specifies a series of characters to assign to the variable.\n\n \ +Type SET without parameters to display the current environment variables.\n" + +STRING_TITLE_HELP, "Sets the window title for the command prompt window.\n\n \ +TITLE [string]\n\n \ +string Specifies the title for the command prompt window." + _____ Modified: trunk/reactos/subsys/system/cmd/resource.h --- trunk/reactos/subsys/system/cmd/resource.h 2005-04-30 11:53:15 UTC (rev 14868) +++ trunk/reactos/subsys/system/cmd/resource.h 2005-04-30 12:36:36 UTC (rev 14869) @@ -156,12 +156,20 @@ #define STRING_PROMPT_HELP2 668 #define STRING_PROMPT_HELP3 669 -#define STRING_RMDIR_HELP 670 +#define STRING_REM_HELP 670 -#define STRING_REM_HELP 671 +#define STRING_RMDIR_HELP 671 +#define STRING_SCREEN_HELP 672 +#define STRING_SHIFT_HELP 673 +#define STRING_SET_HELP 674 + +#define STRING_TITLE_HELP 675 + + + _____ Modified: trunk/reactos/subsys/system/cmd/screen.c --- trunk/reactos/subsys/system/cmd/screen.c 2005-04-30 11:53:15 UTC (rev 14868) +++ trunk/reactos/subsys/system/cmd/screen.c 2005-04-30 12:36:36 UTC (rev 14869) @@ -6,10 +6,13 @@ * 30 Aug 1999 * started - Paolo Pantaleo <paolopan(a)freemail.it> * + * 30-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) + * Remove all hardcode string to En.rc * */ #include "precomp.h" +#include "resource.h" #ifdef INCLUDE_CMD_SCREEN @@ -18,16 +21,13 @@ { SHORT x,y; BOOL bSkipText = FALSE; + WCHAR szMsg[RC_STRING_MAX_SIZE]; if (_tcsncmp (param, _T("/?"), 2) == 0) { - ConOutPuts(_T( - "move cursor and optionally print text\n" - "\n" - "SCREEN row col [text]\n" - "\n" - " row row to wich move the cursor\n" - " col column to wich move the cursor")); + LoadString( GetModuleHandle(NULL), STRING_SCREEN_HELP, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPuts((LPTSTR)szMsg); + return 0; } _____ Modified: trunk/reactos/subsys/system/cmd/set.c --- trunk/reactos/subsys/system/cmd/set.c 2005-04-30 11:53:15 UTC (rev 14868) +++ trunk/reactos/subsys/system/cmd/set.c 2005-04-30 12:36:36 UTC (rev 14869) @@ -29,9 +29,13 @@ * * 25-Feb-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) * Fixed little bug. + * + * 30-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) + * Remove all hardcode string to En.rc */ #include "precomp.h" +#include "resource.h" #ifdef INCLUDE_CMD_SET @@ -43,14 +47,13 @@ INT cmd_set (LPTSTR cmd, LPTSTR param) { LPTSTR p; + WCHAR szMsg[RC_STRING_MAX_SIZE]; if (!_tcsncmp (param, _T("/?"), 2)) { - ConOutPuts (_T("Displays, sets, or removes environment variables.\n\n" - "SET [variable[=][string]]\n\n" - " variable Specifies the environment-variable name.\n" - " string Specifies a series of characters to assign to the variable.\n\n" - "Type SET without parameters to display the current environment variables.\n")); + LoadString( GetModuleHandle(NULL), STRING_SET_HELP, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPuts ((LPTSTR)szMsg); + return 0; } _____ Modified: trunk/reactos/subsys/system/cmd/shift.c --- trunk/reactos/subsys/system/cmd/shift.c 2005-04-30 11:53:15 UTC (rev 14868) +++ trunk/reactos/subsys/system/cmd/shift.c 2005-04-30 12:36:36 UTC (rev 14869) @@ -18,9 +18,13 @@ * * 20-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) * Unicode and redirection safe! + * + * 30-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) + * Remove all hardcode string to En.rc */ #include "precomp.h" +#include "resource.h" /* @@ -30,18 +34,22 @@ * * FREEDOS extension : optional parameter DOWN to allow shifting * parameters backwards. + * */ INT cmd_shift (LPTSTR cmd, LPTSTR param) { + WCHAR szMsg[RC_STRING_MAX_SIZE]; + #ifdef _DEBUG DebugPrintf (_T("cmd_shift: (\'%s\', \'%s\')\n"), cmd, param); #endif if (!_tcsncmp (param, _T("/?"), 2)) { - ConOutPuts (_T("Changes the position of replaceable parameters in a batch file.\n\n" - "SHIFT [DOWN]")); + LoadString( GetModuleHandle(NULL), STRING_SHIFT_HELP, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPuts((LPTSTR)szMsg); + return 0; } _____ Modified: trunk/reactos/subsys/system/cmd/title.c --- trunk/reactos/subsys/system/cmd/title.c 2005-04-30 11:53:15 UTC (rev 14868) +++ trunk/reactos/subsys/system/cmd/title.c 2005-04-30 12:36:36 UTC (rev 14869) @@ -4,15 +4,21 @@ * * History: * 1999-02-11 Emanuele Aliberti + * + * 30-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) + * Remove all hardcode string to En.rc */ #include "precomp.h" +#include "resource.h" #ifdef INCLUDE_CMD_TITLE INT cmd_title (LPTSTR cmd, LPTSTR param) { + WCHAR szMsg[RC_STRING_MAX_SIZE]; + /* Do nothing if no args */ if (*param == _T('\0')) return 0; @@ -20,11 +26,8 @@ /* Asking help? */ if (!_tcsncmp(param, _T("/?"), 2)) { - ConOutPuts (_T("Sets the window title for the command prompt window.\n" - "\n" - "TITLE [string]\n" - "\n" - " string Specifies the title for the command prompt window.")); + LoadString( GetModuleHandle(NULL), STRING_TITLE_HELP, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPuts((LPTSTR)szMsg); return 0; }
19 years, 7 months
1
0
0
0
[greatlrd] 14868: Remove all hardcode string to En.rc
by greatlrd@svn.reactos.com
Remove all hardcode string to En.rc Modified: trunk/reactos/subsys/system/cmd/En.rc Modified: trunk/reactos/subsys/system/cmd/msgbox.c Modified: trunk/reactos/subsys/system/cmd/path.c Modified: trunk/reactos/subsys/system/cmd/resource.h _____ Modified: trunk/reactos/subsys/system/cmd/En.rc --- trunk/reactos/subsys/system/cmd/En.rc 2005-04-30 11:16:47 UTC (rev 14867) +++ trunk/reactos/subsys/system/cmd/En.rc 2005-04-30 11:53:15 UTC (rev 14868) @@ -303,9 +303,24 @@ /N Nothing. Don everthing but move files or direcories.\n\n \ Current limitations:\n \ - You can't move a file or directory from one drive to another.\n" - +STRING_MSGBOX_HELP, "display a message box and return user responce\n\n \ +MSGBOX type ['title'] prompt\n\n \ +type button displayed\n \ + possible values are: OK, OKCANCEL,\n \ + YESNO, YESNOCANCEL\n \ +title title of message box\n \ +prompt text displayed by the message box\n\n\n \ +ERRORLEVEL is set according the button pressed:\n\n \ +YES : 10 | NO : 11\n \ +OK : 10 | CANCEL : 12\n" +STRING_PATH_HELP1, "Displays or sets a search path for executable files.\n\n \ +PATH [[drive:]path[;...]]\nPATH ;\n\n \ +Type PATH ; to clear all search-path settings and direct the command shell\n \ +to search only in the current directory.\n \ +Type PATH without parameters to display the current path.\n" + STRING_PROMPT_HELP1, "Changes the command prompt.\n\n \ PROMPT [text]\n\n \ text Specifies a new command prompt.\n\n \ @@ -400,6 +415,8 @@ STRING_PARAM_ERROR, "Required parameter missing\n" +STRING_PATH_ERROR "CMD: Not in environment 'PATH'\n" + STRING_ERROR_PARAMETERF_ERROR, "Parameter format not correct - %c\n" STRING_ERROR_INVALID_SWITCH, "Invalid switch - /%c\n" STRING_ERROR_TOO_MANY_PARAMETERS, "Too many parameters - %s\n" _____ Modified: trunk/reactos/subsys/system/cmd/msgbox.c --- trunk/reactos/subsys/system/cmd/msgbox.c 2005-04-30 11:16:47 UTC (rev 14867) +++ trunk/reactos/subsys/system/cmd/msgbox.c 2005-04-30 11:53:15 UTC (rev 14868) @@ -5,9 +5,13 @@ * * 25 Aug 1999 * started - Paolo Pantaleo <paolopan(a)freemail.it> + * + * 30-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) + * Remove all hardcode string to En.rc */ #include "precomp.h" +#include "resource.h" #ifdef INCLUDE_CMD_MSGBOX @@ -28,6 +32,7 @@ //and to find window handle to pass to MessageBox HWND hWnd; TCHAR buff[128]; + WCHAR szMsg[RC_STRING_MAX_SIZE]; //these are MessabeBox() parameters LPTSTR title, prompt=""; @@ -39,22 +44,8 @@ if (_tcsncmp (param, _T("/?"), 2) == 0) { - ConOutPuts(_T( - "display a message box and return user responce\n" - "\n" - "MSGBOX type [\"title\"] prompt\n" - "\n" - "type button displayed\n" - " possible values are: OK, OKCANCEL,\n" - " YESNO, YESNOCANCEL\n" - "title title of message box\n" - "prompt text displayed by the message box\n" - "\n" - "\n" - "ERRORLEVEL is set according the button pressed:\n" - "\n" - "YES : 10 | NO : 11\n" - "OK : 10 | CANCEL : 12\n")); + LoadString( GetModuleHandle(NULL), STRING_MSGBOX_HELP, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPuts((LPTSTR)szMsg); return 0; } _____ Modified: trunk/reactos/subsys/system/cmd/path.c --- trunk/reactos/subsys/system/cmd/path.c 2005-04-30 11:16:47 UTC (rev 14867) +++ trunk/reactos/subsys/system/cmd/path.c 2005-04-30 11:53:15 UTC (rev 14868) @@ -21,8 +21,12 @@ * * 24-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) * Fixed Win32 environment handling. + * + * 30-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) + * Remove all hardcode string to En.rc */ #include "precomp.h" +#include "resource.h" #ifdef INCLUDE_CMD_PATH @@ -32,13 +36,13 @@ INT cmd_path (LPTSTR cmd, LPTSTR param) { + WCHAR szMsg[RC_STRING_MAX_SIZE]; + if (!_tcsncmp (param, _T("/?"), 2)) - { - ConOutPuts (_T("Displays or sets a search path for executable files.\n\n" - "PATH [[drive:]path[;...]]\nPATH ;\n\n" - "Type PATH ; to clear all search-path settings and direct the command shell\n" - "to search only in the current directory.\n" - "Type PATH without parameters to display the current path.\n")); + { + LoadString( GetModuleHandle(NULL), STRING_PATH_HELP1, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPuts ((LPTSTR)szMsg); + return 0; } @@ -52,7 +56,8 @@ dwBuffer = GetEnvironmentVariable (_T("PATH"), pszBuffer, ENV_BUFFER_SIZE); if (dwBuffer == 0) { - ConErrPrintf (_T("CMD: Not in environment \"PATH\"\n")); + LoadString( GetModuleHandle(NULL), STRING_PATH_ERROR, (LPTSTR) szMsg,sizeof(szMsg)); + ConErrPrintf ((LPTSTR)szMsg); return 0; } else if (dwBuffer > ENV_BUFFER_SIZE) _____ Modified: trunk/reactos/subsys/system/cmd/resource.h --- trunk/reactos/subsys/system/cmd/resource.h 2005-04-30 11:16:47 UTC (rev 14867) +++ trunk/reactos/subsys/system/cmd/resource.h 2005-04-30 11:53:15 UTC (rev 14868) @@ -64,8 +64,10 @@ #define STRING_MOVE_ERROR1 342 #define STRING_MOVE_ERROR2 343 #define STRING_PARAM_ERROR 344 +#define STRING_PATH_ERROR 345 + #define STRING_ATTRIB_HELP 600 #define STRING_ALIAS_HELP 601 #define STRING_BEEP_HELP 602 @@ -144,18 +146,22 @@ #define STRING_MOVE_HELP1 662 #define STRING_MOVE_HELP2 663 -#define STRING_PAUSE_HELP1 664 +#define STRING_MSGBOX_HELP 664 -#define STRING_PROMPT_HELP1 665 -#define STRING_PROMPT_HELP2 666 -#define STRING_PROMPT_HELP3 667 +#define STRING_PATH_HELP1 665 -#define STRING_RMDIR_HELP 668 +#define STRING_PAUSE_HELP1 666 -#define STRING_REM_HELP 669 +#define STRING_PROMPT_HELP1 667 +#define STRING_PROMPT_HELP2 668 +#define STRING_PROMPT_HELP3 669 +#define STRING_RMDIR_HELP 670 +#define STRING_REM_HELP 671 + +
19 years, 7 months
1
0
0
0
[greatlrd] 14867: Remove all hardcode string to En.rc
by greatlrd@svn.reactos.com
Remove all hardcode string to En.rc from misc.c, move.c pause.c, prompt.c Modified: trunk/reactos/subsys/system/cmd/En.rc Modified: trunk/reactos/subsys/system/cmd/misc.c Modified: trunk/reactos/subsys/system/cmd/move.c Modified: trunk/reactos/subsys/system/cmd/pause.c Modified: trunk/reactos/subsys/system/cmd/prompt.c Modified: trunk/reactos/subsys/system/cmd/resource.h _____ Modified: trunk/reactos/subsys/system/cmd/En.rc --- trunk/reactos/subsys/system/cmd/En.rc 2005-04-30 09:39:09 UTC (rev 14866) +++ trunk/reactos/subsys/system/cmd/En.rc 2005-04-30 11:16:47 UTC (rev 14867) @@ -289,7 +289,53 @@ %13s bytes total virtual memory.\n \ %13s bytes available virtual memory.\n" +STRING_MISC_HELP1, "Press a key to continue...\n" +STRING_MOVE_HELP1, "Overwrite %s (Yes/No/All)? " + +STRING_MOVE_HELP2, "Moves files and renames files and directories.\n\n \ +To move one or more files:\n \ +MOVE [/N][drive:][path]filename1[,...] destination\n\n \ +To rename a directory:\n \ +MOVE [/N][drive:][path]dirname1 dirname2\n\n \ + [drive:][path]filename1 Specifies the location and name of the file\n \ + or files you want to move.\n \ + /N Nothing. Don everthing but move files or direcories.\n\n \ +Current limitations:\n \ + - You can't move a file or directory from one drive to another.\n" + + + +STRING_PROMPT_HELP1, "Changes the command prompt.\n\n \ +PROMPT [text]\n\n \ + text Specifies a new command prompt.\n\n \ +Prompt can be made up of normal characters and the following special codes:\n\n \ + $A & (Ampersand)\n \ + $B | (pipe)\n \ + $C ( (Left parenthesis)\n \ + $D Current date\n \ + $E Escape code (ASCII code 27)\n \ + $F ) (Right parenthesis)\n \ + $G > (greater-than sign)\n \ + $H Backspace (erases previous character)\n \ + $L < (less-than sign)\n \ + $N Current drive\n \ + $P Current drive and path\n \ + $Q = (equal sign)\n \ + $T Current time\n \ + $V OS version number\n \ + $_ Carriage return and linefeed\n \ + $$ $ (dollar sign)" + +STRING_PAUSE_HELP1, "Stops the execution of a batch file and shows the following message:\n \ +'Press any key to continue...' or a user defined message.\n\n \ +PAUSE [message]" + +STRING_PROMPT_HELP2, " $+ Displays the current depth of the directory stack" + +STRING_PROMPT_HELP3, "\nType PROMPT without parameters to reset the prompt to the default setting." + + STRING_RMDIR_HELP, "Removes a directory.\n\n \ RMDIR [drive:]path\nRD [drive:]path" @@ -349,6 +395,9 @@ STRING_GOTO_ERROR1, "No label specified for GOTO" STRING_GOTO_ERROR2, "Label '%s' not found\n" +STRING_MOVE_ERROR1, "[OK]\n" +STRING_MOVE_ERROR2, "[Error]\n" + STRING_PARAM_ERROR, "Required parameter missing\n" STRING_ERROR_PARAMETERF_ERROR, "Parameter format not correct - %c\n" _____ Modified: trunk/reactos/subsys/system/cmd/misc.c --- trunk/reactos/subsys/system/cmd/misc.c 2005-04-30 09:39:09 UTC (rev 14866) +++ trunk/reactos/subsys/system/cmd/misc.c 2005-04-30 11:16:47 UTC (rev 14867) @@ -27,9 +27,13 @@ * * 06-Nov-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) * Added PagePrompt() and FilePrompt(). + * + * 30-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) + * Remove all hardcode string to En.rc */ #include "precomp.h" +#include "resource.h" /* @@ -434,8 +438,10 @@ INT PagePrompt (VOID) { INPUT_RECORD ir; + WCHAR szMsg[RC_STRING_MAX_SIZE]; - ConOutPrintf (_T("Press a key to continue...\n")); + LoadString( GetModuleHandle(NULL), STRING_MISC_HELP1, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPrintf((LPTSTR)szMsg); RemoveBreakHandler (); ConInDisable (); @@ -464,6 +470,8 @@ { TCHAR szOut[512]; va_list arg_ptr; + WCHAR szMsg[RC_STRING_MAX_SIZE]; + // TCHAR cKey = 0; // LPTSTR szKeys = _T("yna"); @@ -484,10 +492,16 @@ for (p = szIn; _istspace (*p); p++) ; - if (*p == _T('Y')) - return PROMPT_YES; - else if (*p == _T('N')) - return PROMPT_NO; + LoadString( GetModuleHandle(NULL), STRING_CHOICE_OPTION, (LPTSTR) szMsg,sizeof(szMsg)); + + + + if (wcsncmp(((WCHAR*) p),&szMsg[0],1)==0) + return PROMPT_YES; + else if (wcsncmp(((WCHAR*) p),&szMsg[1],1)==0) + return PROMPT_NO; + + #if 0 else if (*p == _T('\03')) return PROMPT_BREAK; @@ -533,6 +547,8 @@ va_list arg_ptr; // TCHAR cKey = 0; // LPTSTR szKeys = _T("yna"); + WCHAR szMsg[RC_STRING_MAX_SIZE]; + TCHAR szIn[10]; LPTSTR p; @@ -551,12 +567,16 @@ for (p = szIn; _istspace (*p); p++) ; - if (*p == _T('Y')) - return PROMPT_YES; - else if (*p == _T('N')) - return PROMPT_NO; - if (*p == _T('A')) - return PROMPT_ALL; + LoadString( GetModuleHandle(NULL), STRING_COPY_OPTION, (LPTSTR) szMsg,sizeof(szMsg)); + + + if (wcsncmp(((WCHAR*) p),&szMsg[0],1)==0) + return PROMPT_YES; + else if (wcsncmp(((WCHAR*) p),&szMsg[1],1)==0) + return PROMPT_NO; + else if (wcsncmp( ((WCHAR*) p),&szMsg[2],1)==0) + return PROMPT_ALL; + #if 0 else if (*p == _T('\03')) return PROMPT_BREAK; _____ Modified: trunk/reactos/subsys/system/cmd/move.c --- trunk/reactos/subsys/system/cmd/move.c 2005-04-30 09:39:09 UTC (rev 14866) +++ trunk/reactos/subsys/system/cmd/move.c 2005-04-30 11:16:47 UTC (rev 14867) @@ -20,9 +20,13 @@ * * 03-Feb-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) * Added "/N" option. + * + * 30-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) + * Remove all hardcode string to En.rc */ #include "precomp.h" +#include "resource.h" #ifdef INCLUDE_CMD_MOVE @@ -37,8 +41,10 @@ { TCHAR inp[10]; LPTSTR p; + WCHAR szMsg[RC_STRING_MAX_SIZE]; - ConOutPrintf (_T("Overwrite %s (Yes/No/All)? "), fn); + LoadString( GetModuleHandle(NULL), STRING_MOVE_HELP1, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPrintf ((LPTSTR)szMsg, fn); ConInString (inp, 10); _tcsupr (inp); @@ -67,6 +73,7 @@ HANDLE hFile; LPTSTR pszFile; BOOL bNothing = FALSE; + WCHAR szMsg[RC_STRING_MAX_SIZE]; if (!_tcsncmp (param, _T("/?"), 2)) { @@ -85,20 +92,8 @@ " /-Y\n" "...")); #else - ConOutPuts (_T("Moves files and renames files and directories.\n\n" - "To move one or more files:\n" - "MOVE [/N][drive:][path]filename1[,...] destination\n" - "\n" - "To rename a directory:\n" - "MOVE [/N][drive:][path]dirname1 dirname2\n" - "\n" - " [drive:][path]filename1 Specifies the location and name of the file\n" - " or files you want to move.\n" - " /N Nothing. Don everthing but move files or direcories.\n" - "\n" - "Current limitations:\n" - " - You can't move a file or directory from one drive to another.\n" - )); + LoadString( GetModuleHandle(NULL), STRING_MOVE_HELP2, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPuts ((LPTSTR)szMsg); #endif return 0; } @@ -106,6 +101,8 @@ arg = split (param, &argc, FALSE); nFiles = argc; + LoadString( GetModuleHandle(NULL), STRING_COPY_OPTION, (LPTSTR) szMsg,sizeof(szMsg)); + /* read options */ for (i = 0; i < argc; i++) { @@ -117,14 +114,14 @@ if (*p == _T('-')) { p++; - if (_totupper (*p) == _T('Y')) + if ((WCHAR*) _totupper (*p) == &szMsg[0]) bPrompt = TRUE; } else { - if (_totupper (*p) == _T('Y')) + if ((WCHAR*) _totupper (*p) == &szMsg[0]) bPrompt = FALSE; - else if (_totupper (*p) == _T('N')) + else if ((WCHAR*) _totupper (*p) == &szMsg[1]) bNothing = TRUE; } nFiles--; @@ -197,9 +194,11 @@ if (!bNothing) { if (MoveFile (szSrcPath, szFullDestPath)) - ConOutPrintf (_T("[OK]\n")); + LoadString( GetModuleHandle(NULL), STRING_MOVE_ERROR1, (LPTSTR) szMsg,sizeof(szMsg)); else - ConOutPrintf (_T("[Error]\n")); + LoadString( GetModuleHandle(NULL), STRING_MOVE_ERROR2, (LPTSTR) szMsg,sizeof(szMsg)); + + ConOutPrintf ((LPTSTR)szMsg); } } else @@ -219,9 +218,10 @@ if (!bNothing) { if (MoveFile (szSrcPath, szDestPath)) - ConOutPrintf (_T("[OK]\n")); + LoadString( GetModuleHandle(NULL), STRING_MOVE_ERROR1, (LPTSTR) szMsg,sizeof(szMsg)); else - ConOutPrintf (_T("[Error]\n")); + LoadString( GetModuleHandle(NULL), STRING_MOVE_ERROR2, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPrintf ((LPTSTR)szMsg); } } } @@ -238,9 +238,10 @@ if (!bNothing) { if (MoveFile (szSrcPath, szFullDestPath)) - ConOutPrintf (_T("[OK]\n")); - else - ConOutPrintf (_T("[Error]\n")); + LoadString( GetModuleHandle(NULL), STRING_MOVE_ERROR1, (LPTSTR) szMsg,sizeof(szMsg)); + else + LoadString( GetModuleHandle(NULL), STRING_MOVE_ERROR2, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPrintf ((LPTSTR)szMsg); } } } _____ Modified: trunk/reactos/subsys/system/cmd/pause.c --- trunk/reactos/subsys/system/cmd/pause.c 2005-04-30 09:39:09 UTC (rev 14866) +++ trunk/reactos/subsys/system/cmd/pause.c 2005-04-30 11:16:47 UTC (rev 14867) @@ -18,6 +18,7 @@ */ #include "precomp.h" +#include "resource.h" #ifdef INCLUDE_CMD_PAUSE @@ -29,19 +30,24 @@ * * ?? Extend to include functionality of CHOICE if switch chars * specified. + * + * 30-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) + * Remove all hardcode string to En.rc */ INT cmd_pause (LPTSTR cmd, LPTSTR param) { + WCHAR szMsg[RC_STRING_MAX_SIZE]; + #ifdef _DEBUG DebugPrintf (_T("cmd_pause: \'%s\' : \'%s\')\n"), cmd, param); #endif if (!_tcsncmp (param, _T("/?"), 2)) { - ConOutPuts (_T("Stops the execution of a batch file and shows the following message:\n" - "\"Press any key to continue...\" or a user defined message.\n\n" - "PAUSE [message]")); + LoadString( GetModuleHandle(NULL), STRING_PAUSE_HELP1, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPuts ((LPTSTR)szMsg); + return 0; } _____ Modified: trunk/reactos/subsys/system/cmd/prompt.c --- trunk/reactos/subsys/system/cmd/prompt.c 2005-04-30 09:39:09 UTC (rev 14866) +++ trunk/reactos/subsys/system/cmd/prompt.c 2005-04-30 11:16:47 UTC (rev 14867) @@ -42,8 +42,12 @@ * * 24-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) * Fixed Win32 environment handling. + * + * 30-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) + * Remove all hardcode string to En.rc */ #include "precomp.h" +#include "resource.h" /* * print the command-line prompt @@ -178,32 +182,19 @@ INT cmd_prompt (LPTSTR cmd, LPTSTR param) { + WCHAR szMsg[RC_STRING_MAX_SIZE]; + if (!_tcsncmp (param, _T("/?"), 2)) { - ConOutPuts (_T("Changes the command prompt.\n\n" - "PROMPT [text]\n\n" - " text Specifies a new command prompt.\n\n" - "Prompt can be made up of normal characters and the following special codes:\n\n" - " $A & (Ampersand)\n" - " $B | (pipe)\n" - " $C ( (Left parenthesis)\n" - " $D Current date\n" - " $E Escape code (ASCII code 27)\n" - " $F ) (Right parenthesis)\n" - " $G > (greater-than sign)\n" - " $H Backspace (erases previous character)\n" - " $L < (less-than sign)\n" - " $N Current drive\n" - " $P Current drive and path\n" - " $Q = (equal sign)\n" - " $T Current time\n" - " $V OS version number\n" - " $_ Carriage return and linefeed\n" - " $$ $ (dollar sign)")); + LoadString( GetModuleHandle(NULL), STRING_PROMPT_HELP1, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPuts ((LPTSTR)szMsg); + #ifdef FEATURE_DIRECTORY_STACK - ConOutPuts (_T(" $+ Displays the current depth of the directory stack")); + LoadString( GetModuleHandle(NULL), STRING_PROMPT_HELP2, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPuts ((LPTSTR)szMsg); #endif - ConOutPuts (_T("\nType PROMPT without parameters to reset the prompt to the default setting.")); + LoadString( GetModuleHandle(NULL), STRING_PROMPT_HELP3, (LPTSTR) szMsg,sizeof(szMsg)); + ConOutPuts ((LPTSTR)szMsg); return 0; } _____ Modified: trunk/reactos/subsys/system/cmd/resource.h --- trunk/reactos/subsys/system/cmd/resource.h 2005-04-30 09:39:09 UTC (rev 14866) +++ trunk/reactos/subsys/system/cmd/resource.h 2005-04-30 11:16:47 UTC (rev 14867) @@ -61,7 +61,9 @@ #define STRING_FREE_ERROR2 339 #define STRING_GOTO_ERROR1 340 #define STRING_GOTO_ERROR2 341 -#define STRING_PARAM_ERROR 342 +#define STRING_MOVE_ERROR1 342 +#define STRING_MOVE_ERROR2 343 +#define STRING_PARAM_ERROR 344 #define STRING_ATTRIB_HELP 600 @@ -137,12 +139,23 @@ #define STRING_MEMMORY_HELP1 659 #define STRING_MEMMORY_HELP2 660 -#define STRING_RMDIR_HELP 661 +#define STRING_MISC_HELP1 661 -#define STRING_REM_HELP 662 +#define STRING_MOVE_HELP1 662 +#define STRING_MOVE_HELP2 663 +#define STRING_PAUSE_HELP1 664 +#define STRING_PROMPT_HELP1 665 +#define STRING_PROMPT_HELP2 666 +#define STRING_PROMPT_HELP3 667 +#define STRING_RMDIR_HELP 668 + +#define STRING_REM_HELP 669 + + +
19 years, 7 months
1
0
0
0
[hpoussin] 14866: Implement IoRegisterPlugPlayNotification, IoUnregisterPlugPlayNotification
by hpoussin@svn.reactos.com
Implement IoRegisterPlugPlayNotification, IoUnregisterPlugPlayNotification Implement IoSetDeviceInterfaceState Fix IoRegisterDeviceInterface Add prototype for ExFreePoolWithTag namespc.c: change STATUS_UNSUCCESSFUL to STATUS_OBJECT_NAME_INVALID SVN maintenance in ntoskrnl/kd/wrappers/ Modified: trunk/reactos/include/ddk/exfuncs.h Modified: trunk/reactos/include/ddk/pnptypes.h Modified: trunk/reactos/include/ntos/ntpnp.h Modified: trunk/reactos/ntoskrnl/include/internal/io.h Modified: trunk/reactos/ntoskrnl/io/deviface.c Modified: trunk/reactos/ntoskrnl/io/iomgr.c Modified: trunk/reactos/ntoskrnl/io/pnpnotify.c Modified: trunk/reactos/ntoskrnl/io/pnproot.c Modified: trunk/reactos/ntoskrnl/ob/namespc.c _____ Modified: trunk/reactos/include/ddk/exfuncs.h --- trunk/reactos/include/ddk/exfuncs.h 2005-04-30 05:08:13 UTC (rev 14865) +++ trunk/reactos/include/ddk/exfuncs.h 2005-04-30 09:39:09 UTC (rev 14866) @@ -215,6 +215,13 @@ PVOID block ); +void +STDCALL +ExFreePoolWithTag ( + PVOID block, + ULONG tag + ); + /* * PVOID * ExFreeToZone ( _____ Modified: trunk/reactos/include/ddk/pnptypes.h --- trunk/reactos/include/ddk/pnptypes.h 2005-04-30 05:08:13 UTC (rev 14865) +++ trunk/reactos/include/ddk/pnptypes.h 2005-04-30 09:39:09 UTC (rev 14866) @@ -147,6 +147,9 @@ EventCategoryTargetDeviceChange } IO_NOTIFICATION_EVENT_CATEGORY; +/* EventCategoryFlags for IoRegisterPlugPlayNotification */ +#define PNPNOTIFY_DEVICE_INTERFACE_INCLUDE_EXISTING_INTERFACES 0x00000001 + /* CallbackRoutine for IoRegisterPlugPlayNotification */ typedef NTSTATUS STDCALL_FUNC (*PDRIVER_NOTIFICATION_CALLBACK_ROUTINE)( _____ Modified: trunk/reactos/include/ntos/ntpnp.h --- trunk/reactos/include/ntos/ntpnp.h 2005-04-30 05:08:13 UTC (rev 14865) +++ trunk/reactos/include/ntos/ntpnp.h 2005-04-30 09:39:09 UTC (rev 14866) @@ -38,8 +38,8 @@ DEFINE_GUID(GUID_DEVICE_HIBERNATE_VETOED, 0x61173AD9, 0x194F, 0x11D3, 0x97, 0xDC, 0x00, 0xA0, 0xC9, 0x40, 0x52, 0x2E); DEFINE_GUID(GUID_DEVICE_BATTERY, 0x72631E54, 0x78A4, 0x11D0, 0xBC, 0xF7, 0x00, 0xAA, 0x00, 0xB7, 0xB3, 0x2A); DEFINE_GUID(GUID_DEVICE_SAFE_REMOVAL, 0x8FBEF967, 0xD6C5, 0x11D2, 0x97, 0xB5, 0x00, 0xA0, 0xC9, 0x40, 0x52, 0x2E); -/* DEFINE_GUID(GUID_DEVICE_INTERFACE_ARRIVAL, 0xCB3A4004, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); */ -/* DEFINE_GUID(GUID_DEVICE_INTERFACE_REMOVAL, 0xCB3A4005, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); */ +DEFINE_GUID(GUID_DEVICE_INTERFACE_ARRIVAL, 0xCB3A4004, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); +DEFINE_GUID(GUID_DEVICE_INTERFACE_REMOVAL, 0xCB3A4005, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); DEFINE_GUID(GUID_DEVICE_ARRIVAL, 0xCB3A4009, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); DEFINE_GUID(GUID_DEVICE_ENUMERATED, 0xCB3A400A, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); DEFINE_GUID(GUID_DEVICE_ENUMERATE_REQUEST, 0xCB3A400B, 0x46F0, 0x11D0, 0xB0, 0x8F, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3F); _____ Modified: trunk/reactos/ntoskrnl/include/internal/io.h --- trunk/reactos/ntoskrnl/include/internal/io.h 2005-04-30 05:08:13 UTC (rev 14865) +++ trunk/reactos/ntoskrnl/include/internal/io.h 2005-04-30 09:39:09 UTC (rev 14866) @@ -330,6 +330,17 @@ VOID IopInitDriverImplementation(VOID); +VOID +IopInitPnpNotificationImplementation(VOID); + +VOID +IopNotifyPlugPlayNotification( + IN PDEVICE_OBJECT DeviceObject, + IN IO_NOTIFICATION_EVENT_CATEGORY EventCategory, + IN GUID* Event, + IN PVOID EventCategoryData1, + IN PVOID EventCategoryData2); + NTSTATUS IopGetSystemPowerDeviceObject(PDEVICE_OBJECT *DeviceObject); NTSTATUS _____ Modified: trunk/reactos/ntoskrnl/io/deviface.c --- trunk/reactos/ntoskrnl/io/deviface.c 2005-04-30 05:08:13 UTC (rev 14865) +++ trunk/reactos/ntoskrnl/io/deviface.c 2005-04-30 09:39:09 UTC (rev 14866) @@ -7,6 +7,7 @@ * * PROGRAMMERS: Filip Navara (xnavara(a)volny.cz) * Matthew Brace (ismarc(a)austin.rr.com) + * HervÚ Poussineau (hpoussin(a)reactos.com) */ /* INCLUDES ******************************************************************/ @@ -573,6 +574,8 @@ UNICODE_STRING GuidString; UNICODE_STRING SubKeyName; UNICODE_STRING BaseKeyName; + UCHAR PdoNameInfoBuffer[sizeof(OBJECT_NAME_INFORMATION) + (256 * sizeof(WCHAR))]; + POBJECT_NAME_INFORMATION PdoNameInfo = (POBJECT_NAME_INFORMATION)PdoNameInfoBuffer; UNICODE_STRING DeviceInstance = RTL_CONSTANT_STRING(L"DeviceInstance"); UNICODE_STRING SymbolicLink = RTL_CONSTANT_STRING(L"SymbolicLink"); HANDLE InterfaceKey; @@ -589,6 +592,19 @@ return Status; } + /* Create Pdo name: \Device\xxxxxxxx (unnamed device) */ + Status = ObQueryNameString( + PhysicalDeviceObject, + PdoNameInfo, + sizeof(PdoNameInfoBuffer), + &i); + if (!NT_SUCCESS(Status)) + { + DPRINT("ObQueryNameString() failed with status 0x%08lx\n", Status); + return Status; + } + ASSERT(PdoNameInfo->Name.Length); + /* Create base key name for this interface: HKLM\SYSTEM\CurrentControlSet\DeviceClasses\{GUID}\##?#ACPI#PNP0501#1#{G UID} */ InstancePath = &PhysicalDeviceObject->DeviceObjectExtension->DeviceNode->InstancePath; BaseKeyName.Length = wcslen(BaseKeyString) * sizeof(WCHAR); @@ -703,10 +719,10 @@ return Status; } - /* Create symbolic link name: \\?\ACPI#PNP0501#1#{GUID}\ReferenceString */ + /* Create symbolic link name: \??\ACPI#PNP0501#1#{GUID}\ReferenceString */ SymbolicLinkName->Length = 0; SymbolicLinkName->MaximumLength = SymbolicLinkName->Length - + 4 * sizeof(WCHAR) /* 5 = size of \\??\ */ + + 4 * sizeof(WCHAR) /* 4 = size of \??\ */ + InstancePath->Length + sizeof(WCHAR) /* 1 = size of # */ + GuidString.Length @@ -725,7 +741,7 @@ ExFreePool(BaseKeyName.Buffer); return STATUS_INSUFFICIENT_RESOURCES; } - RtlAppendUnicodeToString(SymbolicLinkName, L"\\\\??\\"); + RtlAppendUnicodeToString(SymbolicLinkName, L"\\??\\"); StartIndex = SymbolicLinkName->Length / sizeof(WCHAR); RtlAppendUnicodeStringToString(SymbolicLinkName, InstancePath); for (i = 0; i < InstancePath->Length / sizeof(WCHAR); i++) @@ -743,7 +759,8 @@ SymbolicLinkName->Buffer[SymbolicLinkName->Length] = '\0'; /* Create symbolic link */ - Status = IoCreateSymbolicLink(SymbolicLinkName, InstancePath); + DPRINT("IoRegisterDeviceInterface(): creating symbolic link %wZ -> %wZ\n", SymbolicLinkName, &PdoNameInfo->Name); + Status = IoCreateSymbolicLink(SymbolicLinkName, &PdoNameInfo->Name); if (!NT_SUCCESS(Status)) { DPRINT("IoCreateSymbolicLink() failed with status 0x%08lx\n", Status); @@ -778,7 +795,7 @@ } /* - * @unimplemented + * @implemented */ NTSTATUS STDCALL @@ -786,7 +803,40 @@ IN PUNICODE_STRING SymbolicLinkName, IN BOOLEAN Enable) { - DPRINT("IoSetDeviceInterfaceState called (UNIMPLEMENTED)\n"); + PDEVICE_OBJECT PhysicalDeviceObject; + PFILE_OBJECT FileObject; + UNICODE_STRING GuidString; + PWCHAR StartPosition; + PWCHAR EndPosition; + NTSTATUS Status; + + if (SymbolicLinkName == NULL) + return STATUS_INVALID_PARAMETER_1; + + DPRINT("IoSetDeviceInterfaceState('%wZ', %d)\n", SymbolicLinkName, Enable); + Status = IoGetDeviceObjectPointer(SymbolicLinkName, + 0, /* DesiredAccess */ + &FileObject, + &PhysicalDeviceObject); + if (!NT_SUCCESS(Status)) + return Status; + + /* Symbolic link name is \??\ACPI#PNP0501#1#{GUID}\ReferenceString */ + /* Get GUID from SymbolicLinkName */ + StartPosition = wcschr(SymbolicLinkName->Buffer, L'{'); + EndPosition = wcschr(SymbolicLinkName->Buffer, L'}'); + if (!StartPosition ||!EndPosition || StartPosition > EndPosition) + return STATUS_INVALID_PARAMETER_1; + GuidString.Buffer = StartPosition; + GuidString.MaximumLength = GuidString.Length = (ULONG_PTR)(EndPosition + 1) - (ULONG_PTR)StartPosition; + + IopNotifyPlugPlayNotification( + PhysicalDeviceObject, + EventCategoryDeviceInterfaceChange, + Enable ? (LPGUID)&GUID_DEVICE_INTERFACE_ARRIVAL : (LPGUID)&GUID_DEVICE_INTERFACE_REMOVAL, + &GuidString, + (PVOID)SymbolicLinkName); + return STATUS_SUCCESS; } _____ Modified: trunk/reactos/ntoskrnl/io/iomgr.c --- trunk/reactos/ntoskrnl/io/iomgr.c 2005-04-30 05:08:13 UTC (rev 14865) +++ trunk/reactos/ntoskrnl/io/iomgr.c 2005-04-30 09:39:09 UTC (rev 14866) @@ -216,6 +216,7 @@ IoInitFileSystemImplementation(); IoInitVpbImplementation(); IoInitShutdownNotification(); + IopInitPnpNotificationImplementation(); IopInitErrorLog(); IopInitTimerImplementation(); IopInitIoCompletionImplementation(); _____ Modified: trunk/reactos/ntoskrnl/io/pnpnotify.c --- trunk/reactos/ntoskrnl/io/pnpnotify.c 2005-04-30 05:08:13 UTC (rev 14865) +++ trunk/reactos/ntoskrnl/io/pnpnotify.c 2005-04-30 09:39:09 UTC (rev 14866) @@ -6,13 +6,32 @@ * PURPOSE: Plug & Play notification functions * * PROGRAMMERS: Filip Navara (xnavara(a)volny.cz) + * HervÚ Poussineau (hpoussin(a)reactos.com) */ /* INCLUDES ******************************************************************/ +#define NDEBUG #include <ntoskrnl.h> #include <internal/debug.h> +/* 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; +} PNP_NOTIFY_ENTRY, *PPNP_NOTIFY_ENTRY; + +static KGUARDED_MUTEX PnpNotifyListLock; +static LIST_ENTRY PnpNotifyListHead; + +#define TAG_PNP_NOTIFY TAG('P', 'n', 'P', 'N') + /* FUNCTIONS *****************************************************************/ /* @@ -32,33 +51,262 @@ } /* - * @unimplemented + * @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) + 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) { - DPRINT("IoRegisterPlugPlayNotification called (UNIMPLEMENTED)\n"); - return STATUS_NOT_IMPLEMENTED; + 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 == EventCategoryTargetDeviceChange + && EventCategoryFlags & PNPNOTIFY_DEVICE_INTERFACE_INCLUDE_EXISTING_INTERFACES) + { + 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; + } + /* FIXME: enumerate SymbolicLinkList */ + DPRINT1("IoRegisterPlugPlayNotification(): need to send notifications for existing interfaces!\n"); + 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; } /* - * @unimplemented + * @implemented */ NTSTATUS STDCALL IoUnregisterPlugPlayNotification( - IN PVOID NotificationEntry) + IN PVOID NotificationEntry) { - DPRINT("IoUnregisterPlugPlayNotification called (UNIMPLEMENTED)\n"); - return STATUS_NOT_IMPLEMENTED; + 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, + IN IO_NOTIFICATION_EVENT_CATEGORY EventCategory, + IN GUID* Event, + IN PVOID EventCategoryData1, + IN PVOID EventCategoryData2) +{ + PPNP_NOTIFY_ENTRY ChangeEntry; + PLIST_ENTRY Entry; + PVOID NotificationStructure; + BOOLEAN CallCurrentEntry; + + ASSERT(DeviceObject); + + KeAcquireGuardedMutex(&PnpNotifyListLock); + if (IsListEmpty(&PnpNotifyListHead)) + { + KeReleaseGuardedMutex(&PnpNotifyListLock); + return; + } + + switch (EventCategory) + { + case EventCategoryDeviceInterfaceChange: + { + PDEVICE_INTERFACE_CHANGE_NOTIFICATION NotificationInfos; + NotificationStructure = NotificationInfos = ExAllocatePoolWithTag( + PagedPool, + sizeof(DEVICE_INTERFACE_CHANGE_NOTIFICATION), + TAG_PNP_NOTIFY); + NotificationInfos->Version = 1; + NotificationInfos->Size = sizeof(DEVICE_INTERFACE_CHANGE_NOTIFICATION); + RtlCopyMemory(&NotificationInfos->Event, Event, sizeof(GUID)); + RtlCopyMemory(&NotificationInfos->InterfaceClassGuid, EventCategoryData1, sizeof(GUID)); + NotificationInfos->SymbolicLinkName = (PUNICODE_STRING)EventCategoryData2; + break; + } + case EventCategoryHardwareProfileChange: + { + PHWPROFILE_CHANGE_NOTIFICATION NotificationInfos; + NotificationStructure = NotificationInfos = ExAllocatePoolWithTag( + PagedPool, + sizeof(HWPROFILE_CHANGE_NOTIFICATION), + TAG_PNP_NOTIFY); + NotificationInfos->Version = 1; + NotificationInfos->Size = sizeof(HWPROFILE_CHANGE_NOTIFICATION); + RtlCopyMemory(&NotificationInfos->Event, Event, sizeof(GUID)); + break; + } + case EventCategoryTargetDeviceChange: + { + PTARGET_DEVICE_REMOVAL_NOTIFICATION NotificationInfos; + NotificationStructure = NotificationInfos = ExAllocatePoolWithTag( + PagedPool, + sizeof(TARGET_DEVICE_REMOVAL_NOTIFICATION), + TAG_PNP_NOTIFY); + NotificationInfos->Version = 1; + NotificationInfos->Size = sizeof(TARGET_DEVICE_REMOVAL_NOTIFICATION); + RtlCopyMemory(&NotificationInfos->Event, Event, sizeof(GUID)); + NotificationInfos->FileObject = (PFILE_OBJECT)EventCategoryData1; + break; + } + default: + { + DPRINT1("IopNotifyPlugPlayNotification(): unknown EventCategory 0x%x UNIMPLEMENTED\n", EventCategory); + return; + } + } + + /* Loop through procedures registred in PnpNotifyListHead + * list to find those that meet some criteria. + */ + + Entry = PnpNotifyListHead.Flink; + while (Entry != &PnpNotifyListHead) + { + ChangeEntry = CONTAINING_RECORD(Entry, PNP_NOTIFY_ENTRY, PnpNotifyList); + CallCurrentEntry = FALSE; + + switch (EventCategory) + { + case EventCategoryDeviceInterfaceChange: + { + if (ChangeEntry->EventCategory == EventCategory + && RtlCompareUnicodeString(&ChangeEntry->Guid, (PUNICODE_STRING)EventCategoryData1, FALSE) == 0) + { + CallCurrentEntry = TRUE; + } + break; + } + case EventCategoryHardwareProfileChange: + { + CallCurrentEntry = TRUE; + break; + } + case EventCategoryTargetDeviceChange: + { + if (ChangeEntry->FileObject == (PFILE_OBJECT)EventCategoryData1) + CallCurrentEntry = TRUE; + } + default: + { + DPRINT1("IopNotifyPlugPlayNotification(): unknown EventCategory 0x%x UNIMPLEMENTED\n", EventCategory); + break; + } + } + + if (CallCurrentEntry) + { + /* Call entry into new allocated memory */ + DPRINT("IopNotifyPlugPlayNotification(): found suitable callback %p\n", + ChangeEntry); + + (ChangeEntry->PnpNotificationProc)( + NotificationStructure, + ChangeEntry->Context); + } + + Entry = Entry->Flink; + } + KeReleaseGuardedMutex(&PnpNotifyListLock); + ExFreePoolWithTag(NotificationStructure, TAG_PNP_NOTIFY); +} + +VOID INIT_FUNCTION +IopInitPnpNotificationImplementation(VOID) +{ + KeInitializeGuardedMutex(&PnpNotifyListLock); + InitializeListHead(&PnpNotifyListHead); +} + /* EOF */ _____ Modified: trunk/reactos/ntoskrnl/io/pnproot.c --- trunk/reactos/ntoskrnl/io/pnproot.c 2005-04-30 05:08:13 UTC (rev 14865) +++ trunk/reactos/ntoskrnl/io/pnproot.c 2005-04-30 09:39:09 UTC (rev 14866) @@ -634,7 +634,7 @@ sizeof(PNPROOT_PDO_DEVICE_EXTENSION), NULL, FILE_DEVICE_CONTROLLER, - 0, + FILE_AUTOGENERATED_DEVICE_NAME, FALSE, &Device->Pdo); if (!NT_SUCCESS(Status)) Property changes on: trunk/reactos/ntoskrnl/kd/wrappers ___________________________________________________________________ Name: svn:ignore + *.d _____ Modified: trunk/reactos/ntoskrnl/ob/namespc.c --- trunk/reactos/ntoskrnl/ob/namespc.c 2005-04-30 05:08:13 UTC (rev 14865) +++ trunk/reactos/ntoskrnl/ob/namespc.c 2005-04-30 09:39:09 UTC (rev 14866) @@ -147,7 +147,7 @@ Object == NULL) { RtlFreeUnicodeString(&RemainingPath); - return STATUS_UNSUCCESSFUL; + return STATUS_OBJECT_NAME_INVALID; } Status = ObCreateHandle(PsGetCurrentProcess(),
19 years, 7 months
1
0
0
0
[navaraf] 14865: Denzil <d3nzil@gmail.com>
by navaraf@svn.reactos.com
Denzil <d3nzil(a)gmail.com> Czech translation of Package Manager (with minor corrections by myself). Added: trunk/rosapps/packmgr/gui/cz.rc Modified: trunk/rosapps/packmgr/gui/en.rc Modified: trunk/rosapps/packmgr/gui/packmgr.rc Added: trunk/rosapps/packmgr/lib/cz.rc Modified: trunk/rosapps/packmgr/lib/package.rc _____ Added: trunk/rosapps/packmgr/gui/cz.rc --- trunk/rosapps/packmgr/gui/cz.rc 2005-04-30 04:43:17 UTC (rev 14864) +++ trunk/rosapps/packmgr/gui/cz.rc 2005-04-30 05:08:13 UTC (rev 14865) @@ -0,0 +1,43 @@ + +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +/* Dialogs */ +IDD_OPTIONS DIALOG DISCARDABLE 0, 0, 180, 200 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "NastavenÝ" +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "ZatÝm zde nejsou ×ßdnÚ mo×nosti.", 0, 50, 95, 80, 8 +END + +IDD_DOIT DIALOG DISCARDABLE 0, 0, 180, 100 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "ProvßdÝm operace" +FONT 8, "MS Sans Serif" +BEGIN + + CTEXT "{Status}", IDC_TSTATUS, 0, 10, 180, 8 + + CONTROL "", IDC_STATUS1, "msctls_progress32", PBS_SMOOTH, 20, 25, 140, 15 + + CONTROL "", IDC_STATUS2, "msctls_progress32", PBS_SMOOTH, 20, 45, 140, 15 + + PUSHBUTTON "ZruÜit", IDC_CANCEL, 65, 70, 50, 14, WS_DISABLED +END + +IDR_POPUP MENU DISCARDABLE +BEGIN + POPUP "PopUp", MENUBARBREAK + BEGIN + MENUITEM "Äßdnß akce", 1, GRAYED + MENUITEM "Instalovat (doporuÞeno)", 2, GRAYED + MENUITEM "Instalovat ze zdrojov²ch k¾d¨", 3, GRAYED + MENUITEM "Aktualizovat", 4, GRAYED + MENUITEM "Odinstalovat", 5, GRAYED + MENUITEM SEPARATOR + MENUITEM "NastavenÝ", 8 + MENUITEM SEPARATOR + MENUITEM "ProvÚst", 6 + END +END + _____ Modified: trunk/rosapps/packmgr/gui/en.rc --- trunk/rosapps/packmgr/gui/en.rc 2005-04-30 04:43:17 UTC (rev 14864) +++ trunk/rosapps/packmgr/gui/en.rc 2005-04-30 05:08:13 UTC (rev 14865) @@ -33,7 +33,7 @@ MENUITEM "Install (recommended)", 2, GRAYED MENUITEM "Install from Source", 3, GRAYED MENUITEM "Update", 4, GRAYED - MENUITEM "Unnstall", 5, GRAYED + MENUITEM "Uninstall", 5, GRAYED MENUITEM SEPARATOR MENUITEM "Options", 8 MENUITEM SEPARATOR _____ Modified: trunk/rosapps/packmgr/gui/packmgr.rc --- trunk/rosapps/packmgr/gui/packmgr.rc 2005-04-30 04:43:17 UTC (rev 14864) +++ trunk/rosapps/packmgr/gui/packmgr.rc 2005-04-30 05:08:13 UTC (rev 14865) @@ -14,7 +14,8 @@ /* Language specific */ #include "en.rc" +#include "cz.rc" +#include "de.rc" #include "es.rc" -#include "de.rc" /* EOF */ _____ Added: trunk/rosapps/packmgr/lib/cz.rc --- trunk/rosapps/packmgr/lib/cz.rc 2005-04-30 04:43:17 UTC (rev 14864) +++ trunk/rosapps/packmgr/lib/cz.rc 2005-04-30 05:08:13 UTC (rev 14865) @@ -0,0 +1,23 @@ + +LANGUAGE LANG_CZECH, SUBLANG_DEFAULT + +/* String Tables */ +STRINGTABLE DISCARDABLE +BEGIN + IDS_LOAD "Nahrßvßm ..." + ERR_OK "Operace dokonÞena." + ERR_PACK "VÜechny balÝÞky nemohly b²t nainstalovßny.\n\nProsÝm podÝvejte se do logu pro detaily." + ERR_GENERIC "Nastala chyba. \nProsÝm podÝvejte se do logu pro detaily." + ERR_DOWNL "Vy×adovan² soubor nemohl b²t sta×en!\nProsÝm podÝvejte se do logu pro detaily." + ERR_FILE "Nastala chyba býhem vykonßvßnÝ skriptu.\nSoubor nelze otev°Ýt." + + ERR_SYNATX "Nastala chyba býhem vykonßvßnÝ skriptu.\nChybnß synatxe." + ERR_CALL "Nastala chyba býhem vykonßvßnÝ skriptu.\nNelze najÝt funkci." + ERR_PARAMETER "Nastala chyba býhem vykonßvßnÝ skriptu.\nNesprßvn² parametr(y)." + + ERR_DEP1 "K nainstalovßnÝ tohoto balÝÞku je t°eba instalovat takÚ tyto balÝÞky:\n\n" + ERR_DEP2 "\nChcete toto p°idat ?" + ERR_READY "Zvolili jste si instalaci %d balÝÞk·. Aby jste je nainstalovali je t°eba abyste p°eÞetli a souhlasili s jejich licencemi. \n\nChcete nadßle pokraÞovat ?" +END + +/* EOF */ _____ Modified: trunk/rosapps/packmgr/lib/package.rc --- trunk/rosapps/packmgr/lib/package.rc 2005-04-30 04:43:17 UTC (rev 14864) +++ trunk/rosapps/packmgr/lib/package.rc 2005-04-30 05:08:13 UTC (rev 14865) @@ -11,6 +11,7 @@ /* Language specific */ #include "en.rc" +#include "cz.rc" #include "es.rc" /* EOF */
19 years, 7 months
1
0
0
0
← Newer
1
2
3
4
5
6
...
48
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
Results per page:
10
25
50
100
200